diff --git a/example/__tests__/nitro-input-sizing.harness.tsx b/example/__tests__/nitro-input-sizing.harness.tsx index a2ad4aa..ddca70f 100644 --- a/example/__tests__/nitro-input-sizing.harness.tsx +++ b/example/__tests__/nitro-input-sizing.harness.tsx @@ -18,7 +18,7 @@ import React, { createRef, useLayoutEffect, useRef, useState } from 'react' import { View } from 'react-native' import { describe, expect, it } from 'react-native-harness' -import { NitroInput, NumberFormat, type NitroInputHandle, type NitroInputProps } from 'react-native-nitro-input' +import { NitroInput, NitroNumber, NitroText, NumberFormat, type NitroInputHandle, type NitroInputProps } from 'react-native-nitro-input' import { render, sleep, waitFor } from './test-utils' const usd = new NumberFormat('en-US', { style: 'currency', currency: 'USD' }) @@ -136,3 +136,83 @@ describe('NitroInput first layout', () => { await waitFor(() => expect(rectOf(state.view!).width).toBeGreaterThan(before + 20)) }) }) + +describe('a TextInput style', () => { + // Fabric hands a view its style's keys as props: when a native prop shared a + // name with a text style key, `style={{ fontWeight: '700' }}` threw. The + // native props are named so that none can (PropNameCollisions.test); this is + // the same check on a device, for every component, every text style key. + const textStyle = { + fontSize: 22, + fontWeight: '700' as const, + fontFamily: 'OpenRunde-Semibold', + fontStyle: 'italic' as const, + color: 'tomato', + letterSpacing: 1, + lineHeight: 30, + textAlign: 'center' as const, + textAlignVertical: 'center' as const, + textDecorationLine: 'underline' as const, + textTransform: 'uppercase' as const, + fontVariant: ['tabular-nums' as const], + } + + it('is taken by NitroInput, as TextInput takes it', async () => { + const { state, Box } = boxed() + await render( + + + + ) + await expectFinalAtMount(state) + // Measured at the style's 22 pt, not the default 32. + expect(state.mounted!.height).toBeLessThan(40) + }) + + it('does not reach NitroNumber or NitroText as props', async () => { + const { state, Box } = boxed() + await render( + + {/* Their style is a view style; a text style is what an app might still pass. */} + + styled + + ) + await waitFor(() => expect(state.mounted).not.toBeNull()) + await sleep(SETTLE_MS) + expect(rectOf(state.view!).width).toBeGreaterThan(0) + }) +}) + +describe('a size TextInput would give', () => { + it('is lineHeight tall on one line', async () => { + const { state, Box } = boxed() + await render( + + + + ) + await expectFinalAtMount(state) + expect(state.mounted!.height).toBeCloseTo(40, 0) + }) + + it('grows by its padding and border instead of squeezing the text', async () => { + const plain = boxed() + const padded = boxed() + await render( + + + + + + + + + ) + await expectFinalAtMount(padded.state) + const a = rectOf(plain.state.view!) + const b = rectOf(padded.state.view!) + expect(b.width - a.width).toBeCloseTo(18, 0) + expect(b.height - a.height).toBeCloseTo(8, 0) + }) +}) diff --git a/packages/react-native-nitro-input/CHANGELOG.md b/packages/react-native-nitro-input/CHANGELOG.md index d12f55d..5bc62eb 100644 --- a/packages/react-native-nitro-input/CHANGELOG.md +++ b/packages/react-native-nitro-input/CHANGELOG.md @@ -61,6 +61,33 @@ text area as the field's own text and hint are: in a padded field narrower than its placeholder (or once the typed text filled it), the tail ran over the padding to the field's edge. iOS already clipped it. +- **A `TextInput` style no longer crashes a field, and `NitroInput` reads + its typography from it.** Fabric hands a view its style's keys as props, + and six to eight of each view's native props shared a name with a text + style key: `style={{ fontWeight: '700' }}` threw ("Value is a string, + expected a number") on `NitroInput`, `NitroNumber` and `NitroText`, and a + numeric `fontSize` or `color` there was fought over by the style and the + prop. The native props are renamed (`textSize`, `textWeight`, + `textFamily`, `textColor`, `textLetterSpacing`, `textLineHeight`, + `textAlignment`, `textVerticalAlignment`); the components' own props keep + their names. A test now fails if any native prop shares a name with a React + Native style key or view prop. `NitroInput` also takes `fontSize`, + `fontWeight`, `fontFamily`, `color`, `letterSpacing`, `lineHeight`, + `textAlign` and `textAlignVertical` from `style`, as `TextInput` does (its + `style` is typed as `TextInput`'s); the props of the same name win. +- **`NitroInput` matches `TextInput` in three more places**, found by a + visual comparison of the two side by side: + - Android: `textAlign` `center` / `right` on a plain field did nothing; the + alignment set when the field became plain (before `textAlign` arrived in + the same commit) overrode it. + - A `style` padding or border insets the text and adds to the size the + field works out for itself, as `TextInput`'s does. An `autoWidth` field + with `paddingHorizontal: 8` squeezed its text to "…" on iOS; on Android + the padding did not inset the text at all (React Native never hands a + Nitro view its padding there, so the view now insets its text, overlay and + frame itself). + - iOS: `lineHeight` sets a single line's height, as on Android; it was the + font's own line box whatever the prop said. ## 0.3.8 diff --git a/packages/react-native-nitro-input/README.md b/packages/react-native-nitro-input/README.md index 5b2378c..750a249 100644 --- a/packages/react-native-nitro-input/README.md +++ b/packages/react-native-nitro-input/README.md @@ -587,7 +587,7 @@ screen behaves like theirs with these settings: | `onKeyPress` | `(event) => void` | – | Before the text changes: the character, `'Backspace'` or `'Enter'`. | | `onNativeRef` | `(ref) => void` | – | Receives the Nitro object on mount. | | `id` / `aria-label` | `string` | – | React Native's HTML-style aliases for `nativeID` / `accessibilityLabel`, resolved here because a Nitro view is handed the raw props; each wins over the older spelling. | -| `style`, `testID`, … | `ViewProps` | – | Regular view props. `testID` and the accessibility label are forwarded to the system field, the element VoiceOver, TalkBack and e2e tools interact with. The field takes its width from its parent like a `TextInput`; see `autoWidth`. | +| `style`, `testID`, … | `ViewProps`; `style` as `TextInput`'s | – | Regular view props. `testID` and the accessibility label are forwarded to the system field, the element VoiceOver, TalkBack and e2e tools interact with. The field takes its width from its parent like a `TextInput`; see `autoWidth`. As on a `TextInput`, `style` can carry the typography (`fontSize`, `fontWeight`, `fontFamily`, `color`, `letterSpacing`, `lineHeight`, `textAlign`, `textAlignVertical`; the props of the same name win), and its padding and border inset the text and add to a size the field works out for itself. Two deliberate differences: digits are always tabular (Android's Roboto has them anyway, and a field keeps its width whether it reflows or not), and Android gets no default padding (iOS's `TextInput` has none; React Native's Android one keeps the platform field's). | `keyboardType`: `'default' | 'number-pad' | 'decimal-pad' | 'numeric' | 'email-address' | 'phone-pad' | 'url' | 'ascii-capable' | 'numbers-and-punctuation'`. diff --git a/packages/react-native-nitro-input/android/src/main/java/com/margelo/nitro/nitroinput/HybridNitroInputView.kt b/packages/react-native-nitro-input/android/src/main/java/com/margelo/nitro/nitroinput/HybridNitroInputView.kt index a015ae0..87a0b2d 100644 --- a/packages/react-native-nitro-input/android/src/main/java/com/margelo/nitro/nitroinput/HybridNitroInputView.kt +++ b/packages/react-native-nitro-input/android/src/main/java/com/margelo/nitro/nitroinput/HybridNitroInputView.kt @@ -127,7 +127,7 @@ class HybridNitroInputView(private val context: ThemedReactContext) : HybridNitr set(v) { field = v; markConfigDirty() } override var suffixAlign: NitroInputAffixAlign = NitroInputAffixAlign.BASELINE set(v) { field = v; markConfigDirty() } - override var letterSpacing: Double = 0.0 + override var textLetterSpacing: Double = 0.0 set(v) { field = v; markConfigDirty() } override var prefixSpacing: Double = Double.POSITIVE_INFINITY set(v) { field = v; markConfigDirty() } @@ -171,17 +171,17 @@ class HybridNitroInputView(private val context: ThemedReactContext) : HybridNitr set(v) { field = v; markConfigDirty() } override var effect: NitroInputEffect = NitroInputEffect.AUTO set(v) { field = v; markConfigDirty() } - override var fontSize: Double = 32.0 + override var textSize: Double = 32.0 set(v) { field = v; markConfigDirty() } - override var lineHeight: Double = 0.0 + override var textLineHeight: Double = 0.0 set(v) { field = v; markConfigDirty() } - override var fontWeight: Double = 400.0 + override var textWeight: Double = 400.0 set(v) { field = v; markConfigDirty() } - override var fontFamily: String = "" + override var textFamily: String = "" set(v) { field = v; markConfigDirty() } - override var color: Double = Double.NaN + override var textColor: Double = Double.NaN set(v) { field = v; markConfigDirty() } - override var textAlign: NitroInputTextAlign = NitroInputTextAlign.AUTO + override var textAlignment: NitroInputTextAlign = NitroInputTextAlign.AUTO set(v) { field = v; markConfigDirty() } override var rightToLeft: Boolean = false set(v) { field = v; markConfigDirty() } @@ -213,7 +213,15 @@ class HybridNitroInputView(private val context: ThemedReactContext) : HybridNitr set(v) { field = v; markConfigDirty() } override var numberOfLines: Double = 0.0 set(v) { field = v; markConfigDirty() } - override var textAlignVertical: NitroInputTextAlignVertical = NitroInputTextAlignVertical.AUTO + override var textVerticalAlignment: NitroInputTextAlignVertical = NitroInputTextAlignVertical.AUTO + set(v) { field = v; markConfigDirty() } + override var textInsetLeft: Double = 0.0 + set(v) { field = v; markConfigDirty() } + override var textInsetTop: Double = 0.0 + set(v) { field = v; markConfigDirty() } + override var textInsetRight: Double = 0.0 + set(v) { field = v; markConfigDirty() } + override var textInsetBottom: Double = 0.0 set(v) { field = v; markConfigDirty() } override var scrollEnabled: Boolean = true set(v) { field = v; markConfigDirty() } @@ -414,7 +422,7 @@ class HybridNitroInputView(private val context: ThemedReactContext) : HybridNitr prefixFontSize = Double.NaN suffixFontSize = Double.NaN signPlacement = NitroInputSignPlacement.BEFOREAFFIX - letterSpacing = 0.0 + textLetterSpacing = 0.0 prefixSpacing = Double.POSITIVE_INFINITY suffixSpacing = Double.POSITIVE_INFINITY prefixOffset = 0.0 @@ -438,12 +446,12 @@ class HybridNitroInputView(private val context: ThemedReactContext) : HybridNitr easing = NitroInputEasing.EXPO bounce = 0.15 effect = NitroInputEffect.AUTO - fontSize = 32.0 - lineHeight = 0.0 - fontWeight = 400.0 - fontFamily = "" - color = Double.NaN - textAlign = NitroInputTextAlign.AUTO + textSize = 32.0 + textLineHeight = 0.0 + textWeight = 400.0 + textFamily = "" + textColor = Double.NaN + textAlignment = NitroInputTextAlign.AUTO rightToLeft = false caretColor = Double.NaN selectionColor = Double.NaN @@ -459,7 +467,11 @@ class HybridNitroInputView(private val context: ThemedReactContext) : HybridNitr editable = true multiline = false numberOfLines = 0.0 - textAlignVertical = NitroInputTextAlignVertical.AUTO + textVerticalAlignment = NitroInputTextAlignVertical.AUTO + textInsetLeft = 0.0 + textInsetTop = 0.0 + textInsetRight = 0.0 + textInsetBottom = 0.0 scrollEnabled = true autoFocus = false plain = false @@ -631,7 +643,7 @@ class HybridNitroInputView(private val context: ThemedReactContext) : HybridNitr // which sizes the field before this view exists. inputView.format = formatOf(this) inputView.typography = sizingTypographyOf(this, inputView.resources.displayMetrics.density).copy( - color = colorFromARGB(color), + color = colorFromARGB(textColor), placeholderColor = colorFromARGB(placeholderColor), prefixAlign = mapAffixAlign(prefixAlign), suffixAlign = mapAffixAlign(suffixAlign), @@ -699,7 +711,7 @@ class HybridNitroInputView(private val context: ThemedReactContext) : HybridNitr plain = plain, multiline = multiline, numberOfLines = clampInt(numberOfLines, 0, 1000, 0), - textAlignVertical = when (textAlignVertical) { + textAlignVertical = when (textVerticalAlignment) { NitroInputTextAlignVertical.TOP -> NitroInputView.TextAlignVertical.TOP NitroInputTextAlignVertical.CENTER -> NitroInputView.TextAlignVertical.CENTER NitroInputTextAlignVertical.BOTTOM -> NitroInputView.TextAlignVertical.BOTTOM @@ -735,7 +747,11 @@ class HybridNitroInputView(private val context: ThemedReactContext) : HybridNitr strokeWidth = Math.max(0.0, finite(strokeWidth, 1.0)).toFloat(), fillColor = colorFromARGB(fillColor), ) - inputView.alignment = when (textAlign) { + inputView.contentInsets = android.graphics.RectF( + Math.max(0.0, finite(textInsetLeft, 0.0)).toFloat(), Math.max(0.0, finite(textInsetTop, 0.0)).toFloat(), + Math.max(0.0, finite(textInsetRight, 0.0)).toFloat(), Math.max(0.0, finite(textInsetBottom, 0.0)).toFloat(), + ) + inputView.alignment = when (textAlignment) { NitroInputTextAlign.CENTER -> NitroInputView.Alignment.CENTER NitroInputTextAlign.RIGHT -> NitroInputView.Alignment.RIGHT NitroInputTextAlign.LEFT -> NitroInputView.Alignment.LEFT diff --git a/packages/react-native-nitro-input/android/src/main/java/com/margelo/nitro/nitroinput/HybridNitroNumberView.kt b/packages/react-native-nitro-input/android/src/main/java/com/margelo/nitro/nitroinput/HybridNitroNumberView.kt index 7a07d63..51551e6 100644 --- a/packages/react-native-nitro-input/android/src/main/java/com/margelo/nitro/nitroinput/HybridNitroNumberView.kt +++ b/packages/react-native-nitro-input/android/src/main/java/com/margelo/nitro/nitroinput/HybridNitroNumberView.kt @@ -141,7 +141,7 @@ class HybridNitroNumberView(private val context: ThemedReactContext) : HybridNit set(v) { field = v; markConfigDirty() } override var shimmerDelay: Double? = null set(v) { field = v; markConfigDirty() } - override var fontSize: Double? = null + override var textSize: Double? = null set(v) { field = v; markConfigDirty() } override var prefixFontSize: Double? = null set(v) { field = v; markConfigDirty() } @@ -153,7 +153,7 @@ class HybridNitroNumberView(private val context: ThemedReactContext) : HybridNit set(v) { field = v; markConfigDirty() } override var suffixAlign: NitroNumberAffixAlign? = null set(v) { field = v; markConfigDirty() } - override var letterSpacing: Double? = null + override var textLetterSpacing: Double? = null set(v) { field = v; markConfigDirty() } override var prefixSpacing: Double? = null set(v) { field = v; markConfigDirty() } @@ -201,13 +201,13 @@ class HybridNitroNumberView(private val context: ThemedReactContext) : HybridNit set(v) { field = v; markConfigDirty() } override var maxFontSizeMultiplier: Double? = null set(v) { field = v; markConfigDirty() } - override var fontWeight: Double? = null + override var textWeight: Double? = null set(v) { field = v; markConfigDirty() } - override var fontFamily: String? = null + override var textFamily: String? = null set(v) { field = v; markConfigDirty() } - override var color: Double? = null + override var textColor: Double? = null set(v) { field = v; markConfigDirty() } - override var textAlign: NitroNumberTextAlign? = null + override var textAlignment: NitroNumberTextAlign? = null set(v) { field = v; markConfigDirty() } override var rightToLeft: Boolean? = null set(v) { field = v; markConfigDirty() } @@ -360,13 +360,13 @@ class HybridNitroNumberView(private val context: ThemedReactContext) : HybridNit shimmerBaseColor = null shimmerDirection = null shimmerDelay = null - fontSize = null + textSize = null prefixFontSize = null suffixFontSize = null affixAlign = null prefixAlign = null suffixAlign = null - letterSpacing = null + textLetterSpacing = null prefixSpacing = null suffixSpacing = null prefixOffset = null @@ -391,10 +391,10 @@ class HybridNitroNumberView(private val context: ThemedReactContext) : HybridNit minimumFontScale = null allowFontScaling = null maxFontSizeMultiplier = null - fontWeight = null - fontFamily = null - color = null - textAlign = null + textWeight = null + textFamily = null + textColor = null + textAlignment = null rightToLeft = null onSizeChange = null configDirty = true @@ -447,15 +447,15 @@ class HybridNitroNumberView(private val context: ThemedReactContext) : HybridNit configDirty = false rollingView.typography = NitroNumberView.Typography( - fontSize = (fontSize ?: 32.0).toFloat(), + fontSize = (textSize ?: 32.0).toFloat(), prefixFontSize = prefixFontSize?.toFloat(), suffixFontSize = suffixFontSize?.toFloat(), - fontWeight = clampInt(fontWeight, 100, 900, 400), - fontFamily = fontFamily, - color = color?.let { colorFromARGB(it) }, + fontWeight = clampInt(textWeight, 100, 900, 400), + fontFamily = textFamily, + color = textColor?.let { colorFromARGB(it) }, prefixAlign = mapAffixAlign(prefixAlign ?: affixAlign), suffixAlign = mapAffixAlign(suffixAlign ?: affixAlign), - letterSpacing = (letterSpacing ?: 0.0).takeIf { it.isFinite() }?.toFloat() ?: 0f, + letterSpacing = (textLetterSpacing ?: 0.0).takeIf { it.isFinite() }?.toFloat() ?: 0f, prefixSpacing = prefixSpacing?.takeIf { it.isFinite() }?.toFloat(), suffixSpacing = suffixSpacing?.takeIf { it.isFinite() }?.toFloat(), prefixOffset = (prefixOffset ?: 0.0).takeIf { it.isFinite() }?.toFloat() ?: 0f, @@ -545,7 +545,7 @@ class HybridNitroNumberView(private val context: ThemedReactContext) : HybridNit downColor = flashDownColor?.let { colorFromARGB(it) }, durationMs = Math.max(50.0, flashDuration ?: 600.0).toLong(), ) - rollingView.alignment = when (textAlign) { + rollingView.alignment = when (textAlignment) { NitroNumberTextAlign.CENTER -> NitroNumberView.Alignment.CENTER NitroNumberTextAlign.RIGHT -> NitroNumberView.Alignment.RIGHT NitroNumberTextAlign.LEFT -> NitroNumberView.Alignment.LEFT diff --git a/packages/react-native-nitro-input/android/src/main/java/com/margelo/nitro/nitroinput/HybridNitroTextView.kt b/packages/react-native-nitro-input/android/src/main/java/com/margelo/nitro/nitroinput/HybridNitroTextView.kt index 711f17c..8e2cdb1 100644 --- a/packages/react-native-nitro-input/android/src/main/java/com/margelo/nitro/nitroinput/HybridNitroTextView.kt +++ b/packages/react-native-nitro-input/android/src/main/java/com/margelo/nitro/nitroinput/HybridNitroTextView.kt @@ -26,12 +26,12 @@ class HybridNitroTextView(private val context: ThemedReactContext) : HybridNitro override var text: String = "" // Unset unless the element set it: the wrapper sends only those. - override var fontSize: Double? = null - override var fontWeight: Double? = null - override var fontFamily: String? = null - override var color: Double? = null - override var letterSpacing: Double? = null - override var textAlign: NitroNumberTextAlign? = null + override var textSize: Double? = null + override var textWeight: Double? = null + override var textFamily: String? = null + override var textColor: Double? = null + override var textLetterSpacing: Double? = null + override var textAlignment: NitroNumberTextAlign? = null override var rightToLeft: Boolean? = null override var duration: Double? = null override var easing: NitroInputEasing? = null @@ -57,12 +57,12 @@ class HybridNitroTextView(private val context: ThemedReactContext) : HybridNitro private fun apply() { textView.style = NitroTextView.Style( - fontSize = fontSize?.takeIf { it.isFinite() && it > 0 } ?: 17.0, - fontWeight = fontWeight?.takeIf { it.isFinite() } ?: 400.0, - fontFamily = fontFamily ?: "", - color = color?.let(::colorFromARGB), - letterSpacing = (letterSpacing?.takeIf { it.isFinite() } ?: 0.0).toFloat(), - textAlign = when (textAlign) { + fontSize = textSize?.takeIf { it.isFinite() && it > 0 } ?: 17.0, + fontWeight = textWeight?.takeIf { it.isFinite() } ?: 400.0, + fontFamily = textFamily ?: "", + color = textColor?.let(::colorFromARGB), + letterSpacing = (textLetterSpacing?.takeIf { it.isFinite() } ?: 0.0).toFloat(), + textAlign = when (textAlignment) { NitroNumberTextAlign.LEFT -> NitroNumberView.Alignment.LEFT NitroNumberTextAlign.CENTER -> NitroNumberView.Alignment.CENTER NitroNumberTextAlign.RIGHT -> NitroNumberView.Alignment.RIGHT @@ -116,8 +116,8 @@ class HybridNitroTextView(private val context: ThemedReactContext) : HybridNitro override fun prepareForRecycle() { // The next element's props arrive as a first mount's do, only the ones it set. text = "" - fontSize = null; fontWeight = null; fontFamily = null; color = null; letterSpacing = null - textAlign = null; rightToLeft = null + textSize = null; textWeight = null; textFamily = null; textColor = null; textLetterSpacing = null + textAlignment = null; rightToLeft = null duration = null; easing = null; bounce = null; effect = null; respectReduceMotion = null loading = null shimmerColor = null; shimmerDuration = null; shimmerAngle = null; shimmerWidth = null diff --git a/packages/react-native-nitro-input/android/src/main/java/com/margelo/nitro/nitroinput/InputSizing.kt b/packages/react-native-nitro-input/android/src/main/java/com/margelo/nitro/nitroinput/InputSizing.kt index 4b73c70..bf34c3d 100644 --- a/packages/react-native-nitro-input/android/src/main/java/com/margelo/nitro/nitroinput/InputSizing.kt +++ b/packages/react-native-nitro-input/android/src/main/java/com/margelo/nitro/nitroinput/InputSizing.kt @@ -34,13 +34,13 @@ internal interface InputSizingProps { val suffix: String val signPlacement: NitroInputSignPlacement val placeholder: String - val fontSize: Double - val lineHeight: Double + val textSize: Double + val textLineHeight: Double val prefixFontSize: Double val suffixFontSize: Double - val fontWeight: Double - val fontFamily: String - val letterSpacing: Double + val textWeight: Double + val textFamily: String + val textLetterSpacing: Double val prefixSpacing: Double val suffixSpacing: Double val allowFontScaling: Boolean @@ -87,15 +87,15 @@ internal fun formatOf(p: InputSizingProps) = Format( /** The typography's sizing half; the view adds the colours, alignment and offsets. */ internal fun sizingTypographyOf(p: InputSizingProps, density: Float): Typography { - val size = finiteOr(p.fontSize, 32.0).toFloat() + val size = finiteOr(p.textSize, 32.0).toFloat() return Typography( fontSize = size, - lineHeightPx = (max(0.0, finiteOr(p.lineHeight, 0.0)) * density).toFloat(), + lineHeightPx = (max(0.0, finiteOr(p.textLineHeight, 0.0)) * density).toFloat(), prefixFontSize = finiteOr(p.prefixFontSize, size.toDouble()).toFloat(), suffixFontSize = finiteOr(p.suffixFontSize, size.toDouble()).toFloat(), - fontWeight = clampedInt(p.fontWeight, 100, 900, 400), - fontFamily = p.fontFamily.ifEmpty { null }, - letterSpacing = if (p.letterSpacing.isFinite()) p.letterSpacing.toFloat() else 0f, + fontWeight = clampedInt(p.textWeight, 100, 900, 400), + fontFamily = p.textFamily.ifEmpty { null }, + letterSpacing = if (p.textLetterSpacing.isFinite()) p.textLetterSpacing.toFloat() else 0f, prefixSpacing = p.prefixSpacing.takeIf { it.isFinite() }?.toFloat(), suffixSpacing = p.suffixSpacing.takeIf { it.isFinite() }?.toFloat(), allowFontScaling = p.allowFontScaling, @@ -379,13 +379,13 @@ internal class SizingProps(s: NitroInputSizing) : InputSizingProps { override val suffix = s.suffix override val signPlacement = s.signPlacement override val placeholder = s.placeholder - override val fontSize = s.fontSize - override val lineHeight = s.lineHeight + override val textSize = s.textSize + override val textLineHeight = s.textLineHeight override val prefixFontSize = s.prefixFontSize override val suffixFontSize = s.suffixFontSize - override val fontWeight = s.fontWeight - override val fontFamily = s.fontFamily - override val letterSpacing = s.letterSpacing + override val textWeight = s.textWeight + override val textFamily = s.textFamily + override val textLetterSpacing = s.textLetterSpacing override val prefixSpacing = s.prefixSpacing override val suffixSpacing = s.suffixSpacing override val allowFontScaling = s.allowFontScaling diff --git a/packages/react-native-nitro-input/android/src/main/java/com/margelo/nitro/nitroinput/NitroInputView.kt b/packages/react-native-nitro-input/android/src/main/java/com/margelo/nitro/nitroinput/NitroInputView.kt index 7d7be64..573214d 100644 --- a/packages/react-native-nitro-input/android/src/main/java/com/margelo/nitro/nitroinput/NitroInputView.kt +++ b/packages/react-native-nitro-input/android/src/main/java/com/margelo/nitro/nitroinput/NitroInputView.kt @@ -303,9 +303,45 @@ class NitroInputView(context: Context) : FrameLayout(context) { if (field == value) return field = value applyEditTextLayout() + // The gravity alone did nothing: the plain field's text alignment, set + // when it became plain (before `textAlign` arrived in the same commit), + // overrides it, so a centred or right-aligned field stayed at the start. + applyTextAlignment() overlay.invalidate() } + /** + * A plain field's own text alignment. `AUTO` is the start edge of the layout + * direction; `LEFT` and `RIGHT` are absolute, which only + * `TEXT_ALIGNMENT_GRAVITY` over an absolute gravity gives - `VIEW_START` / + * `VIEW_END` would flip with the direction. A reflowing field's edit text is + * hidden behind the overlay and stays at the start. + */ + private fun applyTextAlignment() { + editText.textAlignment = if (!keyboard.plain) TEXT_ALIGNMENT_VIEW_START else when (alignment) { + Alignment.AUTO -> TEXT_ALIGNMENT_VIEW_START + Alignment.CENTER -> TEXT_ALIGNMENT_CENTER + Alignment.LEFT, Alignment.RIGHT -> TEXT_ALIGNMENT_GRAVITY + } + } + + /** + * The style's padding and border, in dp. React Native lays an iOS view's + * content out inside them, but never hands a Nitro view on Android its + * padding, so the text ran to the field's edges: they inset the edit text, + * the overlay and the frame here instead (JS sends them; see `NitroInput`). + */ + var contentInsets: android.graphics.RectF = android.graphics.RectF() + set(value) { + if (field == value) return + field = value + setPadding( + (value.left * density).roundToInt(), (value.top * density).roundToInt(), + (value.right * density).roundToInt(), (value.bottom * density).roundToInt(), + ) + invalidate() + } + /** The outline / fill and floating label this view draws for itself. */ var inputFrame: Frame = Frame() set(value) { @@ -1010,14 +1046,7 @@ class NitroInputView(context: Context) : FrameLayout(context) { applyNativeCursor() applyAutoSize() applyAffixes() - // `AUTO` is the start edge of the layout direction; `LEFT` and `RIGHT` - // are absolute, which only `TEXT_ALIGNMENT_GRAVITY` over an absolute - // gravity gives - `VIEW_START` / `VIEW_END` would flip with the direction. - editText.textAlignment = when (alignment) { - Alignment.AUTO -> TEXT_ALIGNMENT_VIEW_START - Alignment.CENTER -> TEXT_ALIGNMENT_CENTER - Alignment.LEFT, Alignment.RIGHT -> TEXT_ALIGNMENT_GRAVITY - } + applyTextAlignment() // The width now comes from the field, not the engine. reportIntrinsicSize() } else { @@ -2038,7 +2067,18 @@ class NitroInputView(context: Context) : FrameLayout(context) { override fun onDraw(canvas: Canvas) { super.onDraw(canvas) - if (!inputFrame.draws || width <= 0 || height <= 0) return + // Inside the style's padding and border, as React Native lays the frame + // out on iOS (see [contentInsets]). + val boxWidth = width - paddingLeft - paddingRight + val boxHeight = height - paddingTop - paddingBottom + if (!inputFrame.draws || boxWidth <= 0 || boxHeight <= 0) return + val saved = canvas.save() + canvas.translate(paddingLeft.toFloat(), paddingTop.toFloat()) + drawFrame(canvas, boxWidth, boxHeight) + canvas.restoreToCount(saved) + } + + private fun drawFrame(canvas: Canvas, width: Int, height: Int) { val filled = inputFrame.variant == Variant.FILLED val stroke = strokeWidthPx diff --git a/packages/react-native-nitro-input/ios/HybridNitroInputView.swift b/packages/react-native-nitro-input/ios/HybridNitroInputView.swift index 36e1625..d1803cd 100644 --- a/packages/react-native-nitro-input/ios/HybridNitroInputView.swift +++ b/packages/react-native-nitro-input/ios/HybridNitroInputView.swift @@ -117,7 +117,7 @@ final class HybridNitroInputView: HybridNitroInputViewSpec, RecyclableView { var signPlacement: NitroInputSignPlacement = .beforeaffix { didSet { markConfigDirty() } } var prefixAlign: NitroInputAffixAlign = .baseline { didSet { markConfigDirty() } } var suffixAlign: NitroInputAffixAlign = .baseline { didSet { markConfigDirty() } } - var letterSpacing: Double = 0 { didSet { markConfigDirty() } } + var textLetterSpacing: Double = 0 { didSet { markConfigDirty() } } var prefixSpacing: Double = .infinity { didSet { markConfigDirty() } } var suffixSpacing: Double = .infinity { didSet { markConfigDirty() } } var prefixOffset: Double = 0 { didSet { markConfigDirty() } } @@ -128,12 +128,12 @@ final class HybridNitroInputView: HybridNitroInputViewSpec, RecyclableView { var easing: NitroInputEasing = .expo { didSet { markConfigDirty() } } var bounce: Double = 0.15 { didSet { markConfigDirty() } } var effect: NitroInputEffect = .auto { didSet { markConfigDirty() } } - var fontSize: Double = 32 { didSet { markConfigDirty() } } - var lineHeight: Double = 0 { didSet { markConfigDirty() } } - var fontWeight: Double = 400 { didSet { markConfigDirty() } } - var fontFamily: String = "" { didSet { markConfigDirty() } } - var color: Double = .nan { didSet { markConfigDirty() } } - var textAlign: NitroInputTextAlign = .auto { didSet { markConfigDirty() } } + var textSize: Double = 32 { didSet { markConfigDirty() } } + var textLineHeight: Double = 0 { didSet { markConfigDirty() } } + var textWeight: Double = 400 { didSet { markConfigDirty() } } + var textFamily: String = "" { didSet { markConfigDirty() } } + var textColor: Double = .nan { didSet { markConfigDirty() } } + var textAlignment: NitroInputTextAlign = .auto { didSet { markConfigDirty() } } var rightToLeft: Bool = false { didSet { markConfigDirty() } } var caretColor: Double = .nan { didSet { markConfigDirty() } } var selectionColor: Double = .nan { didSet { markConfigDirty() } } @@ -149,7 +149,13 @@ final class HybridNitroInputView: HybridNitroInputViewSpec, RecyclableView { var editable: Bool = true { didSet { markConfigDirty() } } var multiline: Bool = false { didSet { markConfigDirty() } } var numberOfLines: Double = 0 { didSet { markConfigDirty() } } - var textAlignVertical: NitroInputTextAlignVertical = .auto { didSet { markConfigDirty() } } + var textVerticalAlignment: NitroInputTextAlignVertical = .auto { didSet { markConfigDirty() } } + /// The style's padding and border. Android insets its content by them; on + /// iOS React Native already lays the view's content out inside them. + var textInsetLeft: Double = 0 + var textInsetTop: Double = 0 + var textInsetRight: Double = 0 + var textInsetBottom: Double = 0 var scrollEnabled: Bool = true { didSet { markConfigDirty() } } var autoFocus: Bool = false { didSet { markConfigDirty() } } var fieldTestID: String = "" { didSet { markConfigDirty() } } @@ -330,7 +336,7 @@ final class HybridNitroInputView: HybridNitroInputViewSpec, RecyclableView { signPlacement = .beforeaffix prefixAlign = .baseline suffixAlign = .baseline - letterSpacing = 0 + textLetterSpacing = 0 prefixSpacing = .infinity suffixSpacing = .infinity prefixOffset = 0 @@ -341,12 +347,12 @@ final class HybridNitroInputView: HybridNitroInputViewSpec, RecyclableView { easing = .expo bounce = 0.15 effect = .auto - fontSize = 32 - lineHeight = 0 - fontWeight = 400 - fontFamily = "" - color = .nan - textAlign = .auto + textSize = 32 + textLineHeight = 0 + textWeight = 400 + textFamily = "" + textColor = .nan + textAlignment = .auto rightToLeft = false caretColor = .nan selectionColor = .nan @@ -362,7 +368,11 @@ final class HybridNitroInputView: HybridNitroInputViewSpec, RecyclableView { editable = true multiline = false numberOfLines = 0 - textAlignVertical = .auto + textVerticalAlignment = .auto + textInsetLeft = 0 + textInsetTop = 0 + textInsetRight = 0 + textInsetBottom = 0 scrollEnabled = true autoFocus = false fieldTestID = "" @@ -552,7 +562,7 @@ final class HybridNitroInputView: HybridNitroInputViewSpec, RecyclableView { // which sizes the field before this view exists (InputSizing.swift). let format = InputMapping.format(self) var typography = InputMapping.sizingTypography(self) - typography.color = Self.color(fromARGB: color) ?? .label + typography.color = Self.color(fromARGB: textColor) ?? .label typography.placeholderColor = Self.color(fromARGB: placeholderColor) ?? .placeholderText typography.prefixAlign = Self.mapAffixAlign(prefixAlign) typography.suffixAlign = Self.mapAffixAlign(suffixAlign) @@ -575,7 +585,7 @@ final class HybridNitroInputView: HybridNitroInputViewSpec, RecyclableView { traits.editable = editable traits.multiline = multiline traits.numberOfLines = numberOfLines.isFinite ? max(0, Int(numberOfLines)) : 0 - traits.textAlignVertical = switch textAlignVertical { + traits.textAlignVertical = switch textVerticalAlignment { case .top: .top case .center: .center case .bottom: .bottom @@ -625,7 +635,7 @@ final class HybridNitroInputView: HybridNitroInputViewSpec, RecyclableView { inputView.timing = timing inputView.traits = traits inputView.worklets = worklets - inputView.alignment = Self.mapAlignment(textAlign) + inputView.alignment = Self.mapAlignment(textAlignment) // Fabric does not hand a Hybrid View its layout direction, so JS resolves // it and the view is told outright; `effectiveUserInterfaceLayoutDirection` // then reads it back for everything that has an edge. diff --git a/packages/react-native-nitro-input/ios/HybridNitroNumberView.swift b/packages/react-native-nitro-input/ios/HybridNitroNumberView.swift index ff7291b..ebc8762 100644 --- a/packages/react-native-nitro-input/ios/HybridNitroNumberView.swift +++ b/packages/react-native-nitro-input/ios/HybridNitroNumberView.swift @@ -90,13 +90,13 @@ final class HybridNitroNumberView: HybridNitroNumberViewSpec, RecyclableView { var shimmerBaseColor: Double? { didSet { markConfigDirty() } } var shimmerDirection: NitroNumberShimmerDirection? { didSet { markConfigDirty() } } var shimmerDelay: Double? { didSet { markConfigDirty() } } - var fontSize: Double? { didSet { markConfigDirty() } } + var textSize: Double? { didSet { markConfigDirty() } } var prefixFontSize: Double? { didSet { markConfigDirty() } } var suffixFontSize: Double? { didSet { markConfigDirty() } } var affixAlign: NitroNumberAffixAlign? { didSet { markConfigDirty() } } var prefixAlign: NitroNumberAffixAlign? { didSet { markConfigDirty() } } var suffixAlign: NitroNumberAffixAlign? { didSet { markConfigDirty() } } - var letterSpacing: Double? { didSet { markConfigDirty() } } + var textLetterSpacing: Double? { didSet { markConfigDirty() } } var prefixSpacing: Double? { didSet { markConfigDirty() } } var suffixSpacing: Double? { didSet { markConfigDirty() } } var prefixOffset: Double? { didSet { markConfigDirty() } } @@ -121,10 +121,10 @@ final class HybridNitroNumberView: HybridNitroNumberViewSpec, RecyclableView { var minimumFontScale: Double? { didSet { markConfigDirty() } } var allowFontScaling: Bool? { didSet { markConfigDirty() } } var maxFontSizeMultiplier: Double? { didSet { markConfigDirty() } } - var fontWeight: Double? { didSet { markConfigDirty() } } - var fontFamily: String? { didSet { markConfigDirty() } } - var color: Double? { didSet { markConfigDirty() } } - var textAlign: NitroNumberTextAlign? { didSet { markConfigDirty() } } + var textWeight: Double? { didSet { markConfigDirty() } } + var textFamily: String? { didSet { markConfigDirty() } } + var textColor: Double? { didSet { markConfigDirty() } } + var textAlignment: NitroNumberTextAlign? { didSet { markConfigDirty() } } var rightToLeft: Bool? { didSet { markConfigDirty() } } var onSizeChange: ((Double, Double) -> Void)? { didSet { onMain { self.rollingView.resendIntrinsicSize() } } @@ -256,13 +256,13 @@ final class HybridNitroNumberView: HybridNitroNumberViewSpec, RecyclableView { shimmerBaseColor = nil shimmerDirection = nil shimmerDelay = nil - fontSize = nil + textSize = nil prefixFontSize = nil suffixFontSize = nil affixAlign = nil prefixAlign = nil suffixAlign = nil - letterSpacing = nil + textLetterSpacing = nil prefixSpacing = nil suffixSpacing = nil prefixOffset = nil @@ -287,10 +287,10 @@ final class HybridNitroNumberView: HybridNitroNumberViewSpec, RecyclableView { minimumFontScale = nil allowFontScaling = nil maxFontSizeMultiplier = nil - fontWeight = nil - fontFamily = nil - color = nil - textAlign = nil + textWeight = nil + textFamily = nil + textColor = nil + textAlignment = nil rightToLeft = nil onSizeChange = nil configDirty = true @@ -359,16 +359,16 @@ final class HybridNitroNumberView: HybridNitroNumberViewSpec, RecyclableView { format.digitMax = (digitMax ?? []).map { $0.isFinite ? Int($0.rounded()) : 9 } var typography = NitroNumberView.Typography() - typography.fontSize = CGFloat(fontSize ?? 32) + typography.fontSize = CGFloat(textSize ?? 32) typography.prefixFontSize = prefixFontSize.map { CGFloat($0) } typography.suffixFontSize = suffixFontSize.map { CGFloat($0) } - typography.fontWeight = CGFloat(fontWeight ?? 400) - typography.fontFamily = fontFamily - typography.color = color.map(Self.color(fromARGB:)) ?? .label + typography.fontWeight = CGFloat(textWeight ?? 400) + typography.fontFamily = textFamily + typography.color = textColor.map(Self.color(fromARGB:)) ?? .label let sharedAlign = Self.mapAffixAlign(affixAlign) typography.prefixAlign = prefixAlign.map { Self.mapAffixAlign($0) } ?? sharedAlign typography.suffixAlign = suffixAlign.map { Self.mapAffixAlign($0) } ?? sharedAlign - typography.letterSpacing = CGFloat((letterSpacing ?? 0).isFinite ? letterSpacing ?? 0 : 0) + typography.letterSpacing = CGFloat((textLetterSpacing ?? 0).isFinite ? textLetterSpacing ?? 0 : 0) typography.prefixSpacing = prefixSpacing.flatMap { $0.isFinite ? CGFloat($0) : nil } typography.suffixSpacing = suffixSpacing.flatMap { $0.isFinite ? CGFloat($0) : nil } typography.prefixOffset = CGFloat((prefixOffset ?? 0).isFinite ? prefixOffset ?? 0 : 0) @@ -426,7 +426,7 @@ final class HybridNitroNumberView: HybridNitroNumberViewSpec, RecyclableView { rollingView.timing = timing rollingView.revealMilestones = revealMilestones ?? [] rollingView.shimmer = shimmer - rollingView.alignment = Self.mapAlignment(textAlign) + rollingView.alignment = Self.mapAlignment(textAlignment) // Fabric does not hand a Hybrid View its layout direction, so JS resolves // it and the view is told outright; `effectiveUserInterfaceLayoutDirection` // then reads it back for the alignment and the affixes. diff --git a/packages/react-native-nitro-input/ios/HybridNitroTextView.swift b/packages/react-native-nitro-input/ios/HybridNitroTextView.swift index 62ce564..34b368b 100644 --- a/packages/react-native-nitro-input/ios/HybridNitroTextView.swift +++ b/packages/react-native-nitro-input/ios/HybridNitroTextView.swift @@ -17,12 +17,12 @@ final class HybridNitroTextView: HybridNitroTextViewSpec, RecyclableView { var text: String = "" // Unset unless the element set it: the wrapper sends only those. - var fontSize: Double? - var fontWeight: Double? - var fontFamily: String? - var color: Double? - var letterSpacing: Double? - var textAlign: NitroNumberTextAlign? + var textSize: Double? + var textWeight: Double? + var textFamily: String? + var textColor: Double? + var textLetterSpacing: Double? + var textAlignment: NitroNumberTextAlign? var rightToLeft: Bool? var duration: Double? var easing: NitroInputEasing? @@ -42,12 +42,12 @@ final class HybridNitroTextView: HybridNitroTextViewSpec, RecyclableView { /// (the style first, so the text is laid out in its font). func afterUpdate() { var style = NitroTextView.Style() - if let fontSize, fontSize.isFinite, fontSize > 0 { style.fontSize = CGFloat(fontSize) } - if let fontWeight, fontWeight.isFinite { style.fontWeight = CGFloat(fontWeight) } - if let fontFamily { style.fontFamily = fontFamily } - if let color = color.flatMap(Self.color) { style.color = color } - if let letterSpacing, letterSpacing.isFinite { style.letterSpacing = CGFloat(letterSpacing) } - switch textAlign { + if let textSize, textSize.isFinite, textSize > 0 { style.fontSize = CGFloat(textSize) } + if let textWeight, textWeight.isFinite { style.fontWeight = CGFloat(textWeight) } + if let textFamily { style.fontFamily = textFamily } + if let color = textColor.flatMap(Self.color) { style.color = color } + if let textLetterSpacing, textLetterSpacing.isFinite { style.letterSpacing = CGFloat(textLetterSpacing) } + switch textAlignment { case .left: style.textAlign = .left case .center: style.textAlign = .center case .right: style.textAlign = .right @@ -97,8 +97,8 @@ final class HybridNitroTextView: HybridNitroTextViewSpec, RecyclableView { /// set, so forget this one's first. func prepareForRecycle() { text = "" - fontSize = nil; fontWeight = nil; fontFamily = nil; color = nil; letterSpacing = nil - textAlign = nil; rightToLeft = nil + textSize = nil; textWeight = nil; textFamily = nil; textColor = nil; textLetterSpacing = nil + textAlignment = nil; rightToLeft = nil duration = nil; easing = nil; bounce = nil; effect = nil; respectReduceMotion = nil loading = nil shimmerColor = nil; shimmerDuration = nil; shimmerAngle = nil; shimmerWidth = nil diff --git a/packages/react-native-nitro-input/ios/InputSizing.swift b/packages/react-native-nitro-input/ios/InputSizing.swift index 972bd9e..f195b40 100644 --- a/packages/react-native-nitro-input/ios/InputSizing.swift +++ b/packages/react-native-nitro-input/ios/InputSizing.swift @@ -40,13 +40,13 @@ protocol InputSizingProps { var signPlacement: NitroInputSignPlacement { get } var placeholder: String { get } var maxLength: Double { get } - var fontSize: Double { get } - var lineHeight: Double { get } + var textSize: Double { get } + var textLineHeight: Double { get } var prefixFontSize: Double { get } var suffixFontSize: Double { get } - var fontWeight: Double { get } - var fontFamily: String { get } - var letterSpacing: Double { get } + var textWeight: Double { get } + var textFamily: String { get } + var textLetterSpacing: Double { get } var prefixSpacing: Double { get } var suffixSpacing: Double { get } var allowFontScaling: Bool { get } @@ -101,13 +101,13 @@ enum InputMapping { /// The typography's sizing half; the view adds the colours, alignment and offsets. static func sizingTypography(_ p: some InputSizingProps) -> NitroInputView.Typography { var typography = NitroInputView.Typography() - typography.fontSize = CGFloat(p.fontSize.isFinite && p.fontSize > 0 ? p.fontSize : 32) - typography.lineHeight = CGFloat(p.lineHeight.isFinite && p.lineHeight > 0 ? p.lineHeight : 0) + typography.fontSize = CGFloat(p.textSize.isFinite && p.textSize > 0 ? p.textSize : 32) + typography.lineHeight = CGFloat(p.textLineHeight.isFinite && p.textLineHeight > 0 ? p.textLineHeight : 0) typography.prefixFontSize = p.prefixFontSize.isFinite && p.prefixFontSize > 0 ? CGFloat(p.prefixFontSize) : nil typography.suffixFontSize = p.suffixFontSize.isFinite && p.suffixFontSize > 0 ? CGFloat(p.suffixFontSize) : nil - typography.fontWeight = CGFloat(p.fontWeight.isFinite ? p.fontWeight : 400) - typography.fontFamily = p.fontFamily.isEmpty ? nil : p.fontFamily - typography.letterSpacing = CGFloat(p.letterSpacing.isFinite ? p.letterSpacing : 0) + typography.fontWeight = CGFloat(p.textWeight.isFinite ? p.textWeight : 400) + typography.fontFamily = p.textFamily.isEmpty ? nil : p.textFamily + typography.letterSpacing = CGFloat(p.textLetterSpacing.isFinite ? p.textLetterSpacing : 0) typography.prefixSpacing = p.prefixSpacing.isFinite ? CGFloat(p.prefixSpacing) : nil typography.suffixSpacing = p.suffixSpacing.isFinite ? CGFloat(p.suffixSpacing) : nil typography.allowFontScaling = p.allowFontScaling @@ -210,6 +210,9 @@ final class InputMetrics { let suffixOffset: CGFloat /// Height of the line box (the body font's line height). let lineHeight: CGFloat + /// The height a single line asks for: `lineHeight` when the typography sets + /// one, else the font's own, as on Android (and as `TextInput` sizes itself). + let lineBoxHeight: CGFloat /// The advance of one of the bullets a plain secure field draws (see `init`). let secureBulletWidth: CGFloat private var widthCache: [WidthKey: CGFloat] = [:] @@ -232,6 +235,7 @@ final class InputMetrics { prefixOffset = t.prefixOffset * scale suffixOffset = t.suffixOffset * scale lineHeight = ceil(body.lineHeight) + lineBoxHeight = t.lineHeight > 0 ? t.lineHeight : lineHeight // A plain secure field is drawn by UITextField, which shows every // character as U+2219 in the *system* font at the field's size - in the // field's weight when that is the system font, regular otherwise - not as @@ -524,7 +528,7 @@ final class HybridNitroInputMeasure: HybridNitroInputMeasureSpec { ? InputSizing.plainWidth(metrics, format: format, text: text, hint: hint, tail: tail, secure: sizing.secureTextEntry) : InputSizing.reflowWidth(metrics, format: format, text: text, hint: hint, tail: tail, secure: sizing.secureTextEntry) let size = InputSizing.reported(width: InputFrameMetrics.width(content: width, frame: frame, metrics: metrics), - height: InputFrameMetrics.singleLineHeight(metrics.lineHeight, frame: frame, metrics: metrics)) + height: InputFrameMetrics.singleLineHeight(metrics.lineBoxHeight, frame: frame, metrics: metrics)) return NitroInputSize(width: Double(size.width), height: Double(size.height)) } } diff --git a/packages/react-native-nitro-input/ios/NitroInputView.swift b/packages/react-native-nitro-input/ios/NitroInputView.swift index 37b8a08..af01810 100644 --- a/packages/react-native-nitro-input/ios/NitroInputView.swift +++ b/packages/react-native-nitro-input/ios/NitroInputView.swift @@ -1945,7 +1945,11 @@ final class NitroInputView: UIView { private func intrinsicHeight() -> CGFloat { // A single line is centred in its height; a frame adds its padding (and a filled label's line). - guard traits.multiline else { return InputFrameMetrics.singleLineHeight(fonts.lineHeight, frame: inputFrame, metrics: fonts.metrics) } + // `lineHeight` sets a single line's height too, as on Android; it was the + // font's own line box here whatever the prop said. + guard traits.multiline else { + return InputFrameMetrics.singleLineHeight(fonts.metrics.lineBoxHeight, frame: inputFrame, metrics: fonts.metrics) + } let line = lineBoxHeight // Only the frame's room is on top of the text. The rest of the text view's // inset is `lineBoxPadding`, which is the *first* line's share of the diff --git a/packages/react-native-nitro-input/nitrogen/generated/android/c++/JHybridNitroInputViewSpec.cpp b/packages/react-native-nitro-input/nitrogen/generated/android/c++/JHybridNitroInputViewSpec.cpp index 39cc381..ad10c89 100644 --- a/packages/react-native-nitro-input/nitrogen/generated/android/c++/JHybridNitroInputViewSpec.cpp +++ b/packages/react-native-nitro-input/nitrogen/generated/android/c++/JHybridNitroInputViewSpec.cpp @@ -500,14 +500,14 @@ namespace margelo::nitro::nitroinput { static const auto method = _javaPart->javaClassStatic()->getMethod /* suffixAlign */)>("setSuffixAlign"); method(_javaPart, JNitroInputAffixAlign::fromCpp(suffixAlign)); } - double JHybridNitroInputViewSpec::getLetterSpacing() { - static const auto method = _javaPart->javaClassStatic()->getMethod("getLetterSpacing"); + double JHybridNitroInputViewSpec::getTextLetterSpacing() { + static const auto method = _javaPart->javaClassStatic()->getMethod("getTextLetterSpacing"); auto __result = method(_javaPart); return __result; } - void JHybridNitroInputViewSpec::setLetterSpacing(double letterSpacing) { - static const auto method = _javaPart->javaClassStatic()->getMethod("setLetterSpacing"); - method(_javaPart, letterSpacing); + void JHybridNitroInputViewSpec::setTextLetterSpacing(double textLetterSpacing) { + static const auto method = _javaPart->javaClassStatic()->getMethod("setTextLetterSpacing"); + method(_javaPart, textLetterSpacing); } double JHybridNitroInputViewSpec::getPrefixSpacing() { static const auto method = _javaPart->javaClassStatic()->getMethod("getPrefixSpacing"); @@ -599,59 +599,59 @@ namespace margelo::nitro::nitroinput { static const auto method = _javaPart->javaClassStatic()->getMethod /* effect */)>("setEffect"); method(_javaPart, JNitroInputEffect::fromCpp(effect)); } - double JHybridNitroInputViewSpec::getFontSize() { - static const auto method = _javaPart->javaClassStatic()->getMethod("getFontSize"); + double JHybridNitroInputViewSpec::getTextSize() { + static const auto method = _javaPart->javaClassStatic()->getMethod("getTextSize"); auto __result = method(_javaPart); return __result; } - void JHybridNitroInputViewSpec::setFontSize(double fontSize) { - static const auto method = _javaPart->javaClassStatic()->getMethod("setFontSize"); - method(_javaPart, fontSize); + void JHybridNitroInputViewSpec::setTextSize(double textSize) { + static const auto method = _javaPart->javaClassStatic()->getMethod("setTextSize"); + method(_javaPart, textSize); } - double JHybridNitroInputViewSpec::getLineHeight() { - static const auto method = _javaPart->javaClassStatic()->getMethod("getLineHeight"); + double JHybridNitroInputViewSpec::getTextLineHeight() { + static const auto method = _javaPart->javaClassStatic()->getMethod("getTextLineHeight"); auto __result = method(_javaPart); return __result; } - void JHybridNitroInputViewSpec::setLineHeight(double lineHeight) { - static const auto method = _javaPart->javaClassStatic()->getMethod("setLineHeight"); - method(_javaPart, lineHeight); + void JHybridNitroInputViewSpec::setTextLineHeight(double textLineHeight) { + static const auto method = _javaPart->javaClassStatic()->getMethod("setTextLineHeight"); + method(_javaPart, textLineHeight); } - double JHybridNitroInputViewSpec::getFontWeight() { - static const auto method = _javaPart->javaClassStatic()->getMethod("getFontWeight"); + double JHybridNitroInputViewSpec::getTextWeight() { + static const auto method = _javaPart->javaClassStatic()->getMethod("getTextWeight"); auto __result = method(_javaPart); return __result; } - void JHybridNitroInputViewSpec::setFontWeight(double fontWeight) { - static const auto method = _javaPart->javaClassStatic()->getMethod("setFontWeight"); - method(_javaPart, fontWeight); + void JHybridNitroInputViewSpec::setTextWeight(double textWeight) { + static const auto method = _javaPart->javaClassStatic()->getMethod("setTextWeight"); + method(_javaPart, textWeight); } - std::string JHybridNitroInputViewSpec::getFontFamily() { - static const auto method = _javaPart->javaClassStatic()->getMethod()>("getFontFamily"); + std::string JHybridNitroInputViewSpec::getTextFamily() { + static const auto method = _javaPart->javaClassStatic()->getMethod()>("getTextFamily"); auto __result = method(_javaPart); return __result->toStdString(); } - void JHybridNitroInputViewSpec::setFontFamily(const std::string& fontFamily) { - static const auto method = _javaPart->javaClassStatic()->getMethod /* fontFamily */)>("setFontFamily"); - method(_javaPart, jni::make_jstring(fontFamily)); + void JHybridNitroInputViewSpec::setTextFamily(const std::string& textFamily) { + static const auto method = _javaPart->javaClassStatic()->getMethod /* textFamily */)>("setTextFamily"); + method(_javaPart, jni::make_jstring(textFamily)); } - double JHybridNitroInputViewSpec::getColor() { - static const auto method = _javaPart->javaClassStatic()->getMethod("getColor"); + double JHybridNitroInputViewSpec::getTextColor() { + static const auto method = _javaPart->javaClassStatic()->getMethod("getTextColor"); auto __result = method(_javaPart); return __result; } - void JHybridNitroInputViewSpec::setColor(double color) { - static const auto method = _javaPart->javaClassStatic()->getMethod("setColor"); - method(_javaPart, color); + void JHybridNitroInputViewSpec::setTextColor(double textColor) { + static const auto method = _javaPart->javaClassStatic()->getMethod("setTextColor"); + method(_javaPart, textColor); } - NitroInputTextAlign JHybridNitroInputViewSpec::getTextAlign() { - static const auto method = _javaPart->javaClassStatic()->getMethod()>("getTextAlign"); + NitroInputTextAlign JHybridNitroInputViewSpec::getTextAlignment() { + static const auto method = _javaPart->javaClassStatic()->getMethod()>("getTextAlignment"); auto __result = method(_javaPart); return __result->toCpp(); } - void JHybridNitroInputViewSpec::setTextAlign(NitroInputTextAlign textAlign) { - static const auto method = _javaPart->javaClassStatic()->getMethod /* textAlign */)>("setTextAlign"); - method(_javaPart, JNitroInputTextAlign::fromCpp(textAlign)); + void JHybridNitroInputViewSpec::setTextAlignment(NitroInputTextAlign textAlignment) { + static const auto method = _javaPart->javaClassStatic()->getMethod /* textAlignment */)>("setTextAlignment"); + method(_javaPart, JNitroInputTextAlign::fromCpp(textAlignment)); } bool JHybridNitroInputViewSpec::getRightToLeft() { static const auto method = _javaPart->javaClassStatic()->getMethod("getRightToLeft"); @@ -788,14 +788,50 @@ namespace margelo::nitro::nitroinput { static const auto method = _javaPart->javaClassStatic()->getMethod("setNumberOfLines"); method(_javaPart, numberOfLines); } - NitroInputTextAlignVertical JHybridNitroInputViewSpec::getTextAlignVertical() { - static const auto method = _javaPart->javaClassStatic()->getMethod()>("getTextAlignVertical"); + NitroInputTextAlignVertical JHybridNitroInputViewSpec::getTextVerticalAlignment() { + static const auto method = _javaPart->javaClassStatic()->getMethod()>("getTextVerticalAlignment"); auto __result = method(_javaPart); return __result->toCpp(); } - void JHybridNitroInputViewSpec::setTextAlignVertical(NitroInputTextAlignVertical textAlignVertical) { - static const auto method = _javaPart->javaClassStatic()->getMethod /* textAlignVertical */)>("setTextAlignVertical"); - method(_javaPart, JNitroInputTextAlignVertical::fromCpp(textAlignVertical)); + void JHybridNitroInputViewSpec::setTextVerticalAlignment(NitroInputTextAlignVertical textVerticalAlignment) { + static const auto method = _javaPart->javaClassStatic()->getMethod /* textVerticalAlignment */)>("setTextVerticalAlignment"); + method(_javaPart, JNitroInputTextAlignVertical::fromCpp(textVerticalAlignment)); + } + double JHybridNitroInputViewSpec::getTextInsetLeft() { + static const auto method = _javaPart->javaClassStatic()->getMethod("getTextInsetLeft"); + auto __result = method(_javaPart); + return __result; + } + void JHybridNitroInputViewSpec::setTextInsetLeft(double textInsetLeft) { + static const auto method = _javaPart->javaClassStatic()->getMethod("setTextInsetLeft"); + method(_javaPart, textInsetLeft); + } + double JHybridNitroInputViewSpec::getTextInsetTop() { + static const auto method = _javaPart->javaClassStatic()->getMethod("getTextInsetTop"); + auto __result = method(_javaPart); + return __result; + } + void JHybridNitroInputViewSpec::setTextInsetTop(double textInsetTop) { + static const auto method = _javaPart->javaClassStatic()->getMethod("setTextInsetTop"); + method(_javaPart, textInsetTop); + } + double JHybridNitroInputViewSpec::getTextInsetRight() { + static const auto method = _javaPart->javaClassStatic()->getMethod("getTextInsetRight"); + auto __result = method(_javaPart); + return __result; + } + void JHybridNitroInputViewSpec::setTextInsetRight(double textInsetRight) { + static const auto method = _javaPart->javaClassStatic()->getMethod("setTextInsetRight"); + method(_javaPart, textInsetRight); + } + double JHybridNitroInputViewSpec::getTextInsetBottom() { + static const auto method = _javaPart->javaClassStatic()->getMethod("getTextInsetBottom"); + auto __result = method(_javaPart); + return __result; + } + void JHybridNitroInputViewSpec::setTextInsetBottom(double textInsetBottom) { + static const auto method = _javaPart->javaClassStatic()->getMethod("setTextInsetBottom"); + method(_javaPart, textInsetBottom); } bool JHybridNitroInputViewSpec::getScrollEnabled() { static const auto method = _javaPart->javaClassStatic()->getMethod("getScrollEnabled"); diff --git a/packages/react-native-nitro-input/nitrogen/generated/android/c++/JHybridNitroInputViewSpec.hpp b/packages/react-native-nitro-input/nitrogen/generated/android/c++/JHybridNitroInputViewSpec.hpp index 6a9022c..d6cf3ea 100644 --- a/packages/react-native-nitro-input/nitrogen/generated/android/c++/JHybridNitroInputViewSpec.hpp +++ b/packages/react-native-nitro-input/nitrogen/generated/android/c++/JHybridNitroInputViewSpec.hpp @@ -122,8 +122,8 @@ namespace margelo::nitro::nitroinput { void setPrefixAlign(NitroInputAffixAlign prefixAlign) override; NitroInputAffixAlign getSuffixAlign() override; void setSuffixAlign(NitroInputAffixAlign suffixAlign) override; - double getLetterSpacing() override; - void setLetterSpacing(double letterSpacing) override; + double getTextLetterSpacing() override; + void setTextLetterSpacing(double textLetterSpacing) override; double getPrefixSpacing() override; void setPrefixSpacing(double prefixSpacing) override; double getSuffixSpacing() override; @@ -144,18 +144,18 @@ namespace margelo::nitro::nitroinput { void setBounce(double bounce) override; NitroInputEffect getEffect() override; void setEffect(NitroInputEffect effect) override; - double getFontSize() override; - void setFontSize(double fontSize) override; - double getLineHeight() override; - void setLineHeight(double lineHeight) override; - double getFontWeight() override; - void setFontWeight(double fontWeight) override; - std::string getFontFamily() override; - void setFontFamily(const std::string& fontFamily) override; - double getColor() override; - void setColor(double color) override; - NitroInputTextAlign getTextAlign() override; - void setTextAlign(NitroInputTextAlign textAlign) override; + double getTextSize() override; + void setTextSize(double textSize) override; + double getTextLineHeight() override; + void setTextLineHeight(double textLineHeight) override; + double getTextWeight() override; + void setTextWeight(double textWeight) override; + std::string getTextFamily() override; + void setTextFamily(const std::string& textFamily) override; + double getTextColor() override; + void setTextColor(double textColor) override; + NitroInputTextAlign getTextAlignment() override; + void setTextAlignment(NitroInputTextAlign textAlignment) override; bool getRightToLeft() override; void setRightToLeft(bool rightToLeft) override; double getCaretColor() override; @@ -186,8 +186,16 @@ namespace margelo::nitro::nitroinput { void setMultiline(bool multiline) override; double getNumberOfLines() override; void setNumberOfLines(double numberOfLines) override; - NitroInputTextAlignVertical getTextAlignVertical() override; - void setTextAlignVertical(NitroInputTextAlignVertical textAlignVertical) override; + NitroInputTextAlignVertical getTextVerticalAlignment() override; + void setTextVerticalAlignment(NitroInputTextAlignVertical textVerticalAlignment) override; + double getTextInsetLeft() override; + void setTextInsetLeft(double textInsetLeft) override; + double getTextInsetTop() override; + void setTextInsetTop(double textInsetTop) override; + double getTextInsetRight() override; + void setTextInsetRight(double textInsetRight) override; + double getTextInsetBottom() override; + void setTextInsetBottom(double textInsetBottom) override; bool getScrollEnabled() override; void setScrollEnabled(bool scrollEnabled) override; bool getAutoFocus() override; diff --git a/packages/react-native-nitro-input/nitrogen/generated/android/c++/JHybridNitroNumberViewSpec.cpp b/packages/react-native-nitro-input/nitrogen/generated/android/c++/JHybridNitroNumberViewSpec.cpp index df2cfb3..32bc256 100644 --- a/packages/react-native-nitro-input/nitrogen/generated/android/c++/JHybridNitroNumberViewSpec.cpp +++ b/packages/react-native-nitro-input/nitrogen/generated/android/c++/JHybridNitroNumberViewSpec.cpp @@ -386,14 +386,14 @@ namespace margelo::nitro::nitroinput { static const auto method = _javaPart->javaClassStatic()->getMethod /* shimmerDelay */)>("setShimmerDelay"); method(_javaPart, shimmerDelay.has_value() ? jni::JDouble::valueOf(shimmerDelay.value()) : nullptr); } - std::optional JHybridNitroNumberViewSpec::getFontSize() { - static const auto method = _javaPart->javaClassStatic()->getMethod()>("getFontSize"); + std::optional JHybridNitroNumberViewSpec::getTextSize() { + static const auto method = _javaPart->javaClassStatic()->getMethod()>("getTextSize"); auto __result = method(_javaPart); return __result != nullptr ? std::make_optional(__result->value()) : std::nullopt; } - void JHybridNitroNumberViewSpec::setFontSize(std::optional fontSize) { - static const auto method = _javaPart->javaClassStatic()->getMethod /* fontSize */)>("setFontSize"); - method(_javaPart, fontSize.has_value() ? jni::JDouble::valueOf(fontSize.value()) : nullptr); + void JHybridNitroNumberViewSpec::setTextSize(std::optional textSize) { + static const auto method = _javaPart->javaClassStatic()->getMethod /* textSize */)>("setTextSize"); + method(_javaPart, textSize.has_value() ? jni::JDouble::valueOf(textSize.value()) : nullptr); } std::optional JHybridNitroNumberViewSpec::getPrefixFontSize() { static const auto method = _javaPart->javaClassStatic()->getMethod()>("getPrefixFontSize"); @@ -440,14 +440,14 @@ namespace margelo::nitro::nitroinput { static const auto method = _javaPart->javaClassStatic()->getMethod /* suffixAlign */)>("setSuffixAlign"); method(_javaPart, suffixAlign.has_value() ? JNitroNumberAffixAlign::fromCpp(suffixAlign.value()) : nullptr); } - std::optional JHybridNitroNumberViewSpec::getLetterSpacing() { - static const auto method = _javaPart->javaClassStatic()->getMethod()>("getLetterSpacing"); + std::optional JHybridNitroNumberViewSpec::getTextLetterSpacing() { + static const auto method = _javaPart->javaClassStatic()->getMethod()>("getTextLetterSpacing"); auto __result = method(_javaPart); return __result != nullptr ? std::make_optional(__result->value()) : std::nullopt; } - void JHybridNitroNumberViewSpec::setLetterSpacing(std::optional letterSpacing) { - static const auto method = _javaPart->javaClassStatic()->getMethod /* letterSpacing */)>("setLetterSpacing"); - method(_javaPart, letterSpacing.has_value() ? jni::JDouble::valueOf(letterSpacing.value()) : nullptr); + void JHybridNitroNumberViewSpec::setTextLetterSpacing(std::optional textLetterSpacing) { + static const auto method = _javaPart->javaClassStatic()->getMethod /* textLetterSpacing */)>("setTextLetterSpacing"); + method(_javaPart, textLetterSpacing.has_value() ? jni::JDouble::valueOf(textLetterSpacing.value()) : nullptr); } std::optional JHybridNitroNumberViewSpec::getPrefixSpacing() { static const auto method = _javaPart->javaClassStatic()->getMethod()>("getPrefixSpacing"); @@ -685,41 +685,41 @@ namespace margelo::nitro::nitroinput { static const auto method = _javaPart->javaClassStatic()->getMethod /* maxFontSizeMultiplier */)>("setMaxFontSizeMultiplier"); method(_javaPart, maxFontSizeMultiplier.has_value() ? jni::JDouble::valueOf(maxFontSizeMultiplier.value()) : nullptr); } - std::optional JHybridNitroNumberViewSpec::getFontWeight() { - static const auto method = _javaPart->javaClassStatic()->getMethod()>("getFontWeight"); + std::optional JHybridNitroNumberViewSpec::getTextWeight() { + static const auto method = _javaPart->javaClassStatic()->getMethod()>("getTextWeight"); auto __result = method(_javaPart); return __result != nullptr ? std::make_optional(__result->value()) : std::nullopt; } - void JHybridNitroNumberViewSpec::setFontWeight(std::optional fontWeight) { - static const auto method = _javaPart->javaClassStatic()->getMethod /* fontWeight */)>("setFontWeight"); - method(_javaPart, fontWeight.has_value() ? jni::JDouble::valueOf(fontWeight.value()) : nullptr); + void JHybridNitroNumberViewSpec::setTextWeight(std::optional textWeight) { + static const auto method = _javaPart->javaClassStatic()->getMethod /* textWeight */)>("setTextWeight"); + method(_javaPart, textWeight.has_value() ? jni::JDouble::valueOf(textWeight.value()) : nullptr); } - std::optional JHybridNitroNumberViewSpec::getFontFamily() { - static const auto method = _javaPart->javaClassStatic()->getMethod()>("getFontFamily"); + std::optional JHybridNitroNumberViewSpec::getTextFamily() { + static const auto method = _javaPart->javaClassStatic()->getMethod()>("getTextFamily"); auto __result = method(_javaPart); return __result != nullptr ? std::make_optional(__result->toStdString()) : std::nullopt; } - void JHybridNitroNumberViewSpec::setFontFamily(const std::optional& fontFamily) { - static const auto method = _javaPart->javaClassStatic()->getMethod /* fontFamily */)>("setFontFamily"); - method(_javaPart, fontFamily.has_value() ? jni::make_jstring(fontFamily.value()) : nullptr); + void JHybridNitroNumberViewSpec::setTextFamily(const std::optional& textFamily) { + static const auto method = _javaPart->javaClassStatic()->getMethod /* textFamily */)>("setTextFamily"); + method(_javaPart, textFamily.has_value() ? jni::make_jstring(textFamily.value()) : nullptr); } - std::optional JHybridNitroNumberViewSpec::getColor() { - static const auto method = _javaPart->javaClassStatic()->getMethod()>("getColor"); + std::optional JHybridNitroNumberViewSpec::getTextColor() { + static const auto method = _javaPart->javaClassStatic()->getMethod()>("getTextColor"); auto __result = method(_javaPart); return __result != nullptr ? std::make_optional(__result->value()) : std::nullopt; } - void JHybridNitroNumberViewSpec::setColor(std::optional color) { - static const auto method = _javaPart->javaClassStatic()->getMethod /* color */)>("setColor"); - method(_javaPart, color.has_value() ? jni::JDouble::valueOf(color.value()) : nullptr); + void JHybridNitroNumberViewSpec::setTextColor(std::optional textColor) { + static const auto method = _javaPart->javaClassStatic()->getMethod /* textColor */)>("setTextColor"); + method(_javaPart, textColor.has_value() ? jni::JDouble::valueOf(textColor.value()) : nullptr); } - std::optional JHybridNitroNumberViewSpec::getTextAlign() { - static const auto method = _javaPart->javaClassStatic()->getMethod()>("getTextAlign"); + std::optional JHybridNitroNumberViewSpec::getTextAlignment() { + static const auto method = _javaPart->javaClassStatic()->getMethod()>("getTextAlignment"); auto __result = method(_javaPart); return __result != nullptr ? std::make_optional(__result->toCpp()) : std::nullopt; } - void JHybridNitroNumberViewSpec::setTextAlign(std::optional textAlign) { - static const auto method = _javaPart->javaClassStatic()->getMethod /* textAlign */)>("setTextAlign"); - method(_javaPart, textAlign.has_value() ? JNitroNumberTextAlign::fromCpp(textAlign.value()) : nullptr); + void JHybridNitroNumberViewSpec::setTextAlignment(std::optional textAlignment) { + static const auto method = _javaPart->javaClassStatic()->getMethod /* textAlignment */)>("setTextAlignment"); + method(_javaPart, textAlignment.has_value() ? JNitroNumberTextAlign::fromCpp(textAlignment.value()) : nullptr); } std::optional JHybridNitroNumberViewSpec::getRightToLeft() { static const auto method = _javaPart->javaClassStatic()->getMethod()>("getRightToLeft"); diff --git a/packages/react-native-nitro-input/nitrogen/generated/android/c++/JHybridNitroNumberViewSpec.hpp b/packages/react-native-nitro-input/nitrogen/generated/android/c++/JHybridNitroNumberViewSpec.hpp index b1f25e4..9403eeb 100644 --- a/packages/react-native-nitro-input/nitrogen/generated/android/c++/JHybridNitroNumberViewSpec.hpp +++ b/packages/react-native-nitro-input/nitrogen/generated/android/c++/JHybridNitroNumberViewSpec.hpp @@ -116,8 +116,8 @@ namespace margelo::nitro::nitroinput { void setShimmerDirection(std::optional shimmerDirection) override; std::optional getShimmerDelay() override; void setShimmerDelay(std::optional shimmerDelay) override; - std::optional getFontSize() override; - void setFontSize(std::optional fontSize) override; + std::optional getTextSize() override; + void setTextSize(std::optional textSize) override; std::optional getPrefixFontSize() override; void setPrefixFontSize(std::optional prefixFontSize) override; std::optional getSuffixFontSize() override; @@ -128,8 +128,8 @@ namespace margelo::nitro::nitroinput { void setPrefixAlign(std::optional prefixAlign) override; std::optional getSuffixAlign() override; void setSuffixAlign(std::optional suffixAlign) override; - std::optional getLetterSpacing() override; - void setLetterSpacing(std::optional letterSpacing) override; + std::optional getTextLetterSpacing() override; + void setTextLetterSpacing(std::optional textLetterSpacing) override; std::optional getPrefixSpacing() override; void setPrefixSpacing(std::optional prefixSpacing) override; std::optional getSuffixSpacing() override; @@ -174,14 +174,14 @@ namespace margelo::nitro::nitroinput { void setAllowFontScaling(std::optional allowFontScaling) override; std::optional getMaxFontSizeMultiplier() override; void setMaxFontSizeMultiplier(std::optional maxFontSizeMultiplier) override; - std::optional getFontWeight() override; - void setFontWeight(std::optional fontWeight) override; - std::optional getFontFamily() override; - void setFontFamily(const std::optional& fontFamily) override; - std::optional getColor() override; - void setColor(std::optional color) override; - std::optional getTextAlign() override; - void setTextAlign(std::optional textAlign) override; + std::optional getTextWeight() override; + void setTextWeight(std::optional textWeight) override; + std::optional getTextFamily() override; + void setTextFamily(const std::optional& textFamily) override; + std::optional getTextColor() override; + void setTextColor(std::optional textColor) override; + std::optional getTextAlignment() override; + void setTextAlignment(std::optional textAlignment) override; std::optional getRightToLeft() override; void setRightToLeft(std::optional rightToLeft) override; std::optional> getOnSizeChange() override; diff --git a/packages/react-native-nitro-input/nitrogen/generated/android/c++/JHybridNitroTextViewSpec.cpp b/packages/react-native-nitro-input/nitrogen/generated/android/c++/JHybridNitroTextViewSpec.cpp index 018021f..4f78ee6 100644 --- a/packages/react-native-nitro-input/nitrogen/generated/android/c++/JHybridNitroTextViewSpec.cpp +++ b/packages/react-native-nitro-input/nitrogen/generated/android/c++/JHybridNitroTextViewSpec.cpp @@ -66,59 +66,59 @@ namespace margelo::nitro::nitroinput { static const auto method = _javaPart->javaClassStatic()->getMethod /* text */)>("setText"); method(_javaPart, jni::make_jstring(text)); } - std::optional JHybridNitroTextViewSpec::getFontSize() { - static const auto method = _javaPart->javaClassStatic()->getMethod()>("getFontSize"); + std::optional JHybridNitroTextViewSpec::getTextSize() { + static const auto method = _javaPart->javaClassStatic()->getMethod()>("getTextSize"); auto __result = method(_javaPart); return __result != nullptr ? std::make_optional(__result->value()) : std::nullopt; } - void JHybridNitroTextViewSpec::setFontSize(std::optional fontSize) { - static const auto method = _javaPart->javaClassStatic()->getMethod /* fontSize */)>("setFontSize"); - method(_javaPart, fontSize.has_value() ? jni::JDouble::valueOf(fontSize.value()) : nullptr); + void JHybridNitroTextViewSpec::setTextSize(std::optional textSize) { + static const auto method = _javaPart->javaClassStatic()->getMethod /* textSize */)>("setTextSize"); + method(_javaPart, textSize.has_value() ? jni::JDouble::valueOf(textSize.value()) : nullptr); } - std::optional JHybridNitroTextViewSpec::getFontWeight() { - static const auto method = _javaPart->javaClassStatic()->getMethod()>("getFontWeight"); + std::optional JHybridNitroTextViewSpec::getTextWeight() { + static const auto method = _javaPart->javaClassStatic()->getMethod()>("getTextWeight"); auto __result = method(_javaPart); return __result != nullptr ? std::make_optional(__result->value()) : std::nullopt; } - void JHybridNitroTextViewSpec::setFontWeight(std::optional fontWeight) { - static const auto method = _javaPart->javaClassStatic()->getMethod /* fontWeight */)>("setFontWeight"); - method(_javaPart, fontWeight.has_value() ? jni::JDouble::valueOf(fontWeight.value()) : nullptr); + void JHybridNitroTextViewSpec::setTextWeight(std::optional textWeight) { + static const auto method = _javaPart->javaClassStatic()->getMethod /* textWeight */)>("setTextWeight"); + method(_javaPart, textWeight.has_value() ? jni::JDouble::valueOf(textWeight.value()) : nullptr); } - std::optional JHybridNitroTextViewSpec::getFontFamily() { - static const auto method = _javaPart->javaClassStatic()->getMethod()>("getFontFamily"); + std::optional JHybridNitroTextViewSpec::getTextFamily() { + static const auto method = _javaPart->javaClassStatic()->getMethod()>("getTextFamily"); auto __result = method(_javaPart); return __result != nullptr ? std::make_optional(__result->toStdString()) : std::nullopt; } - void JHybridNitroTextViewSpec::setFontFamily(const std::optional& fontFamily) { - static const auto method = _javaPart->javaClassStatic()->getMethod /* fontFamily */)>("setFontFamily"); - method(_javaPart, fontFamily.has_value() ? jni::make_jstring(fontFamily.value()) : nullptr); + void JHybridNitroTextViewSpec::setTextFamily(const std::optional& textFamily) { + static const auto method = _javaPart->javaClassStatic()->getMethod /* textFamily */)>("setTextFamily"); + method(_javaPart, textFamily.has_value() ? jni::make_jstring(textFamily.value()) : nullptr); } - std::optional JHybridNitroTextViewSpec::getColor() { - static const auto method = _javaPart->javaClassStatic()->getMethod()>("getColor"); + std::optional JHybridNitroTextViewSpec::getTextColor() { + static const auto method = _javaPart->javaClassStatic()->getMethod()>("getTextColor"); auto __result = method(_javaPart); return __result != nullptr ? std::make_optional(__result->value()) : std::nullopt; } - void JHybridNitroTextViewSpec::setColor(std::optional color) { - static const auto method = _javaPart->javaClassStatic()->getMethod /* color */)>("setColor"); - method(_javaPart, color.has_value() ? jni::JDouble::valueOf(color.value()) : nullptr); + void JHybridNitroTextViewSpec::setTextColor(std::optional textColor) { + static const auto method = _javaPart->javaClassStatic()->getMethod /* textColor */)>("setTextColor"); + method(_javaPart, textColor.has_value() ? jni::JDouble::valueOf(textColor.value()) : nullptr); } - std::optional JHybridNitroTextViewSpec::getLetterSpacing() { - static const auto method = _javaPart->javaClassStatic()->getMethod()>("getLetterSpacing"); + std::optional JHybridNitroTextViewSpec::getTextLetterSpacing() { + static const auto method = _javaPart->javaClassStatic()->getMethod()>("getTextLetterSpacing"); auto __result = method(_javaPart); return __result != nullptr ? std::make_optional(__result->value()) : std::nullopt; } - void JHybridNitroTextViewSpec::setLetterSpacing(std::optional letterSpacing) { - static const auto method = _javaPart->javaClassStatic()->getMethod /* letterSpacing */)>("setLetterSpacing"); - method(_javaPart, letterSpacing.has_value() ? jni::JDouble::valueOf(letterSpacing.value()) : nullptr); + void JHybridNitroTextViewSpec::setTextLetterSpacing(std::optional textLetterSpacing) { + static const auto method = _javaPart->javaClassStatic()->getMethod /* textLetterSpacing */)>("setTextLetterSpacing"); + method(_javaPart, textLetterSpacing.has_value() ? jni::JDouble::valueOf(textLetterSpacing.value()) : nullptr); } - std::optional JHybridNitroTextViewSpec::getTextAlign() { - static const auto method = _javaPart->javaClassStatic()->getMethod()>("getTextAlign"); + std::optional JHybridNitroTextViewSpec::getTextAlignment() { + static const auto method = _javaPart->javaClassStatic()->getMethod()>("getTextAlignment"); auto __result = method(_javaPart); return __result != nullptr ? std::make_optional(__result->toCpp()) : std::nullopt; } - void JHybridNitroTextViewSpec::setTextAlign(std::optional textAlign) { - static const auto method = _javaPart->javaClassStatic()->getMethod /* textAlign */)>("setTextAlign"); - method(_javaPart, textAlign.has_value() ? JNitroNumberTextAlign::fromCpp(textAlign.value()) : nullptr); + void JHybridNitroTextViewSpec::setTextAlignment(std::optional textAlignment) { + static const auto method = _javaPart->javaClassStatic()->getMethod /* textAlignment */)>("setTextAlignment"); + method(_javaPart, textAlignment.has_value() ? JNitroNumberTextAlign::fromCpp(textAlignment.value()) : nullptr); } std::optional JHybridNitroTextViewSpec::getRightToLeft() { static const auto method = _javaPart->javaClassStatic()->getMethod()>("getRightToLeft"); diff --git a/packages/react-native-nitro-input/nitrogen/generated/android/c++/JHybridNitroTextViewSpec.hpp b/packages/react-native-nitro-input/nitrogen/generated/android/c++/JHybridNitroTextViewSpec.hpp index fc73205..aa0cb49 100644 --- a/packages/react-native-nitro-input/nitrogen/generated/android/c++/JHybridNitroTextViewSpec.hpp +++ b/packages/react-native-nitro-input/nitrogen/generated/android/c++/JHybridNitroTextViewSpec.hpp @@ -52,18 +52,18 @@ namespace margelo::nitro::nitroinput { // Properties std::string getText() override; void setText(const std::string& text) override; - std::optional getFontSize() override; - void setFontSize(std::optional fontSize) override; - std::optional getFontWeight() override; - void setFontWeight(std::optional fontWeight) override; - std::optional getFontFamily() override; - void setFontFamily(const std::optional& fontFamily) override; - std::optional getColor() override; - void setColor(std::optional color) override; - std::optional getLetterSpacing() override; - void setLetterSpacing(std::optional letterSpacing) override; - std::optional getTextAlign() override; - void setTextAlign(std::optional textAlign) override; + std::optional getTextSize() override; + void setTextSize(std::optional textSize) override; + std::optional getTextWeight() override; + void setTextWeight(std::optional textWeight) override; + std::optional getTextFamily() override; + void setTextFamily(const std::optional& textFamily) override; + std::optional getTextColor() override; + void setTextColor(std::optional textColor) override; + std::optional getTextLetterSpacing() override; + void setTextLetterSpacing(std::optional textLetterSpacing) override; + std::optional getTextAlignment() override; + void setTextAlignment(std::optional textAlignment) override; std::optional getRightToLeft() override; void setRightToLeft(std::optional rightToLeft) override; std::optional getDuration() override; diff --git a/packages/react-native-nitro-input/nitrogen/generated/android/c++/JNitroInputSizing.hpp b/packages/react-native-nitro-input/nitrogen/generated/android/c++/JNitroInputSizing.hpp index c14f049..e5f1b82 100644 --- a/packages/react-native-nitro-input/nitrogen/generated/android/c++/JNitroInputSizing.hpp +++ b/packages/react-native-nitro-input/nitrogen/generated/android/c++/JNitroInputSizing.hpp @@ -96,20 +96,20 @@ namespace margelo::nitro::nitroinput { jni::local_ref maskSlotPlaceholder = this->getFieldValue(fieldMaskSlotPlaceholder); static const auto fieldKeepPlaceholder = clazz->getField("keepPlaceholder"); jboolean keepPlaceholder = this->getFieldValue(fieldKeepPlaceholder); - static const auto fieldFontSize = clazz->getField("fontSize"); - double fontSize = this->getFieldValue(fieldFontSize); - static const auto fieldLineHeight = clazz->getField("lineHeight"); - double lineHeight = this->getFieldValue(fieldLineHeight); + static const auto fieldTextSize = clazz->getField("textSize"); + double textSize = this->getFieldValue(fieldTextSize); + static const auto fieldTextLineHeight = clazz->getField("textLineHeight"); + double textLineHeight = this->getFieldValue(fieldTextLineHeight); static const auto fieldPrefixFontSize = clazz->getField("prefixFontSize"); double prefixFontSize = this->getFieldValue(fieldPrefixFontSize); static const auto fieldSuffixFontSize = clazz->getField("suffixFontSize"); double suffixFontSize = this->getFieldValue(fieldSuffixFontSize); - static const auto fieldFontWeight = clazz->getField("fontWeight"); - double fontWeight = this->getFieldValue(fieldFontWeight); - static const auto fieldFontFamily = clazz->getField("fontFamily"); - jni::local_ref fontFamily = this->getFieldValue(fieldFontFamily); - static const auto fieldLetterSpacing = clazz->getField("letterSpacing"); - double letterSpacing = this->getFieldValue(fieldLetterSpacing); + static const auto fieldTextWeight = clazz->getField("textWeight"); + double textWeight = this->getFieldValue(fieldTextWeight); + static const auto fieldTextFamily = clazz->getField("textFamily"); + jni::local_ref textFamily = this->getFieldValue(fieldTextFamily); + static const auto fieldTextLetterSpacing = clazz->getField("textLetterSpacing"); + double textLetterSpacing = this->getFieldValue(fieldTextLetterSpacing); static const auto fieldPrefixSpacing = clazz->getField("prefixSpacing"); double prefixSpacing = this->getFieldValue(fieldPrefixSpacing); static const auto fieldSuffixSpacing = clazz->getField("suffixSpacing"); @@ -180,13 +180,13 @@ namespace margelo::nitro::nitroinput { }(maskCharacterMap), maskSlotPlaceholder->toStdString(), static_cast(keepPlaceholder), - fontSize, - lineHeight, + textSize, + textLineHeight, prefixFontSize, suffixFontSize, - fontWeight, - fontFamily->toStdString(), - letterSpacing, + textWeight, + textFamily->toStdString(), + textLetterSpacing, prefixSpacing, suffixSpacing, static_cast(allowFontScaling), @@ -261,13 +261,13 @@ namespace margelo::nitro::nitroinput { }(value.maskCharacterMap), jni::make_jstring(value.maskSlotPlaceholder), value.keepPlaceholder, - value.fontSize, - value.lineHeight, + value.textSize, + value.textLineHeight, value.prefixFontSize, value.suffixFontSize, - value.fontWeight, - jni::make_jstring(value.fontFamily), - value.letterSpacing, + value.textWeight, + jni::make_jstring(value.textFamily), + value.textLetterSpacing, value.prefixSpacing, value.suffixSpacing, value.allowFontScaling, diff --git a/packages/react-native-nitro-input/nitrogen/generated/android/c++/views/JHybridNitroInputViewStateUpdater.cpp b/packages/react-native-nitro-input/nitrogen/generated/android/c++/views/JHybridNitroInputViewStateUpdater.cpp index 02c692c..c963ef6 100644 --- a/packages/react-native-nitro-input/nitrogen/generated/android/c++/views/JHybridNitroInputViewStateUpdater.cpp +++ b/packages/react-native-nitro-input/nitrogen/generated/android/c++/views/JHybridNitroInputViewStateUpdater.cpp @@ -234,9 +234,9 @@ void JHybridNitroInputViewStateUpdater::updateViewProps(jni::alias_refsetSuffixAlign(newProps->suffixAlign.get()); } if (oldProps == nullptr - ? newProps->letterSpacing.isProvided() - : !newProps->letterSpacing.hasSameValue(oldProps->letterSpacing)) { - hybridView->setLetterSpacing(newProps->letterSpacing.get()); + ? newProps->textLetterSpacing.isProvided() + : !newProps->textLetterSpacing.hasSameValue(oldProps->textLetterSpacing)) { + hybridView->setTextLetterSpacing(newProps->textLetterSpacing.get()); } if (oldProps == nullptr ? newProps->prefixSpacing.isProvided() @@ -289,34 +289,34 @@ void JHybridNitroInputViewStateUpdater::updateViewProps(jni::alias_refsetEffect(newProps->effect.get()); } if (oldProps == nullptr - ? newProps->fontSize.isProvided() - : !newProps->fontSize.hasSameValue(oldProps->fontSize)) { - hybridView->setFontSize(newProps->fontSize.get()); + ? newProps->textSize.isProvided() + : !newProps->textSize.hasSameValue(oldProps->textSize)) { + hybridView->setTextSize(newProps->textSize.get()); } if (oldProps == nullptr - ? newProps->lineHeight.isProvided() - : !newProps->lineHeight.hasSameValue(oldProps->lineHeight)) { - hybridView->setLineHeight(newProps->lineHeight.get()); + ? newProps->textLineHeight.isProvided() + : !newProps->textLineHeight.hasSameValue(oldProps->textLineHeight)) { + hybridView->setTextLineHeight(newProps->textLineHeight.get()); } if (oldProps == nullptr - ? newProps->fontWeight.isProvided() - : !newProps->fontWeight.hasSameValue(oldProps->fontWeight)) { - hybridView->setFontWeight(newProps->fontWeight.get()); + ? newProps->textWeight.isProvided() + : !newProps->textWeight.hasSameValue(oldProps->textWeight)) { + hybridView->setTextWeight(newProps->textWeight.get()); } if (oldProps == nullptr - ? newProps->fontFamily.isProvided() - : !newProps->fontFamily.hasSameValue(oldProps->fontFamily)) { - hybridView->setFontFamily(newProps->fontFamily.get()); + ? newProps->textFamily.isProvided() + : !newProps->textFamily.hasSameValue(oldProps->textFamily)) { + hybridView->setTextFamily(newProps->textFamily.get()); } if (oldProps == nullptr - ? newProps->color.isProvided() - : !newProps->color.hasSameValue(oldProps->color)) { - hybridView->setColor(newProps->color.get()); + ? newProps->textColor.isProvided() + : !newProps->textColor.hasSameValue(oldProps->textColor)) { + hybridView->setTextColor(newProps->textColor.get()); } if (oldProps == nullptr - ? newProps->textAlign.isProvided() - : !newProps->textAlign.hasSameValue(oldProps->textAlign)) { - hybridView->setTextAlign(newProps->textAlign.get()); + ? newProps->textAlignment.isProvided() + : !newProps->textAlignment.hasSameValue(oldProps->textAlignment)) { + hybridView->setTextAlignment(newProps->textAlignment.get()); } if (oldProps == nullptr ? newProps->rightToLeft.isProvided() @@ -394,9 +394,29 @@ void JHybridNitroInputViewStateUpdater::updateViewProps(jni::alias_refsetNumberOfLines(newProps->numberOfLines.get()); } if (oldProps == nullptr - ? newProps->textAlignVertical.isProvided() - : !newProps->textAlignVertical.hasSameValue(oldProps->textAlignVertical)) { - hybridView->setTextAlignVertical(newProps->textAlignVertical.get()); + ? newProps->textVerticalAlignment.isProvided() + : !newProps->textVerticalAlignment.hasSameValue(oldProps->textVerticalAlignment)) { + hybridView->setTextVerticalAlignment(newProps->textVerticalAlignment.get()); + } + if (oldProps == nullptr + ? newProps->textInsetLeft.isProvided() + : !newProps->textInsetLeft.hasSameValue(oldProps->textInsetLeft)) { + hybridView->setTextInsetLeft(newProps->textInsetLeft.get()); + } + if (oldProps == nullptr + ? newProps->textInsetTop.isProvided() + : !newProps->textInsetTop.hasSameValue(oldProps->textInsetTop)) { + hybridView->setTextInsetTop(newProps->textInsetTop.get()); + } + if (oldProps == nullptr + ? newProps->textInsetRight.isProvided() + : !newProps->textInsetRight.hasSameValue(oldProps->textInsetRight)) { + hybridView->setTextInsetRight(newProps->textInsetRight.get()); + } + if (oldProps == nullptr + ? newProps->textInsetBottom.isProvided() + : !newProps->textInsetBottom.hasSameValue(oldProps->textInsetBottom)) { + hybridView->setTextInsetBottom(newProps->textInsetBottom.get()); } if (oldProps == nullptr ? newProps->scrollEnabled.isProvided() diff --git a/packages/react-native-nitro-input/nitrogen/generated/android/c++/views/JHybridNitroNumberViewStateUpdater.cpp b/packages/react-native-nitro-input/nitrogen/generated/android/c++/views/JHybridNitroNumberViewStateUpdater.cpp index 2ad796e..6a778d4 100644 --- a/packages/react-native-nitro-input/nitrogen/generated/android/c++/views/JHybridNitroNumberViewStateUpdater.cpp +++ b/packages/react-native-nitro-input/nitrogen/generated/android/c++/views/JHybridNitroNumberViewStateUpdater.cpp @@ -219,9 +219,9 @@ void JHybridNitroNumberViewStateUpdater::updateViewProps(jni::alias_refsetShimmerDelay(newProps->shimmerDelay.get()); } if (oldProps == nullptr - ? newProps->fontSize.isProvided() - : !newProps->fontSize.hasSameValue(oldProps->fontSize)) { - hybridView->setFontSize(newProps->fontSize.get()); + ? newProps->textSize.isProvided() + : !newProps->textSize.hasSameValue(oldProps->textSize)) { + hybridView->setTextSize(newProps->textSize.get()); } if (oldProps == nullptr ? newProps->prefixFontSize.isProvided() @@ -249,9 +249,9 @@ void JHybridNitroNumberViewStateUpdater::updateViewProps(jni::alias_refsetSuffixAlign(newProps->suffixAlign.get()); } if (oldProps == nullptr - ? newProps->letterSpacing.isProvided() - : !newProps->letterSpacing.hasSameValue(oldProps->letterSpacing)) { - hybridView->setLetterSpacing(newProps->letterSpacing.get()); + ? newProps->textLetterSpacing.isProvided() + : !newProps->textLetterSpacing.hasSameValue(oldProps->textLetterSpacing)) { + hybridView->setTextLetterSpacing(newProps->textLetterSpacing.get()); } if (oldProps == nullptr ? newProps->prefixSpacing.isProvided() @@ -364,24 +364,24 @@ void JHybridNitroNumberViewStateUpdater::updateViewProps(jni::alias_refsetMaxFontSizeMultiplier(newProps->maxFontSizeMultiplier.get()); } if (oldProps == nullptr - ? newProps->fontWeight.isProvided() - : !newProps->fontWeight.hasSameValue(oldProps->fontWeight)) { - hybridView->setFontWeight(newProps->fontWeight.get()); + ? newProps->textWeight.isProvided() + : !newProps->textWeight.hasSameValue(oldProps->textWeight)) { + hybridView->setTextWeight(newProps->textWeight.get()); } if (oldProps == nullptr - ? newProps->fontFamily.isProvided() - : !newProps->fontFamily.hasSameValue(oldProps->fontFamily)) { - hybridView->setFontFamily(newProps->fontFamily.get()); + ? newProps->textFamily.isProvided() + : !newProps->textFamily.hasSameValue(oldProps->textFamily)) { + hybridView->setTextFamily(newProps->textFamily.get()); } if (oldProps == nullptr - ? newProps->color.isProvided() - : !newProps->color.hasSameValue(oldProps->color)) { - hybridView->setColor(newProps->color.get()); + ? newProps->textColor.isProvided() + : !newProps->textColor.hasSameValue(oldProps->textColor)) { + hybridView->setTextColor(newProps->textColor.get()); } if (oldProps == nullptr - ? newProps->textAlign.isProvided() - : !newProps->textAlign.hasSameValue(oldProps->textAlign)) { - hybridView->setTextAlign(newProps->textAlign.get()); + ? newProps->textAlignment.isProvided() + : !newProps->textAlignment.hasSameValue(oldProps->textAlignment)) { + hybridView->setTextAlignment(newProps->textAlignment.get()); } if (oldProps == nullptr ? newProps->rightToLeft.isProvided() diff --git a/packages/react-native-nitro-input/nitrogen/generated/android/c++/views/JHybridNitroTextViewStateUpdater.cpp b/packages/react-native-nitro-input/nitrogen/generated/android/c++/views/JHybridNitroTextViewStateUpdater.cpp index afe0aa1..575d5e5 100644 --- a/packages/react-native-nitro-input/nitrogen/generated/android/c++/views/JHybridNitroTextViewStateUpdater.cpp +++ b/packages/react-native-nitro-input/nitrogen/generated/android/c++/views/JHybridNitroTextViewStateUpdater.cpp @@ -59,34 +59,34 @@ void JHybridNitroTextViewStateUpdater::updateViewProps(jni::alias_refsetText(newProps->text.get()); } if (oldProps == nullptr - ? newProps->fontSize.isProvided() - : !newProps->fontSize.hasSameValue(oldProps->fontSize)) { - hybridView->setFontSize(newProps->fontSize.get()); + ? newProps->textSize.isProvided() + : !newProps->textSize.hasSameValue(oldProps->textSize)) { + hybridView->setTextSize(newProps->textSize.get()); } if (oldProps == nullptr - ? newProps->fontWeight.isProvided() - : !newProps->fontWeight.hasSameValue(oldProps->fontWeight)) { - hybridView->setFontWeight(newProps->fontWeight.get()); + ? newProps->textWeight.isProvided() + : !newProps->textWeight.hasSameValue(oldProps->textWeight)) { + hybridView->setTextWeight(newProps->textWeight.get()); } if (oldProps == nullptr - ? newProps->fontFamily.isProvided() - : !newProps->fontFamily.hasSameValue(oldProps->fontFamily)) { - hybridView->setFontFamily(newProps->fontFamily.get()); + ? newProps->textFamily.isProvided() + : !newProps->textFamily.hasSameValue(oldProps->textFamily)) { + hybridView->setTextFamily(newProps->textFamily.get()); } if (oldProps == nullptr - ? newProps->color.isProvided() - : !newProps->color.hasSameValue(oldProps->color)) { - hybridView->setColor(newProps->color.get()); + ? newProps->textColor.isProvided() + : !newProps->textColor.hasSameValue(oldProps->textColor)) { + hybridView->setTextColor(newProps->textColor.get()); } if (oldProps == nullptr - ? newProps->letterSpacing.isProvided() - : !newProps->letterSpacing.hasSameValue(oldProps->letterSpacing)) { - hybridView->setLetterSpacing(newProps->letterSpacing.get()); + ? newProps->textLetterSpacing.isProvided() + : !newProps->textLetterSpacing.hasSameValue(oldProps->textLetterSpacing)) { + hybridView->setTextLetterSpacing(newProps->textLetterSpacing.get()); } if (oldProps == nullptr - ? newProps->textAlign.isProvided() - : !newProps->textAlign.hasSameValue(oldProps->textAlign)) { - hybridView->setTextAlign(newProps->textAlign.get()); + ? newProps->textAlignment.isProvided() + : !newProps->textAlignment.hasSameValue(oldProps->textAlignment)) { + hybridView->setTextAlignment(newProps->textAlignment.get()); } if (oldProps == nullptr ? newProps->rightToLeft.isProvided() diff --git a/packages/react-native-nitro-input/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinput/HybridNitroInputViewSpec.kt b/packages/react-native-nitro-input/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinput/HybridNitroInputViewSpec.kt index c4da6d3..da3d0c3 100644 --- a/packages/react-native-nitro-input/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinput/HybridNitroInputViewSpec.kt +++ b/packages/react-native-nitro-input/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinput/HybridNitroInputViewSpec.kt @@ -247,7 +247,7 @@ abstract class HybridNitroInputViewSpec: HybridView() { @get:Keep @set:DoNotStrip @set:Keep - abstract var letterSpacing: Double + abstract var textLetterSpacing: Double @get:DoNotStrip @get:Keep @@ -313,37 +313,37 @@ abstract class HybridNitroInputViewSpec: HybridView() { @get:Keep @set:DoNotStrip @set:Keep - abstract var fontSize: Double + abstract var textSize: Double @get:DoNotStrip @get:Keep @set:DoNotStrip @set:Keep - abstract var lineHeight: Double + abstract var textLineHeight: Double @get:DoNotStrip @get:Keep @set:DoNotStrip @set:Keep - abstract var fontWeight: Double + abstract var textWeight: Double @get:DoNotStrip @get:Keep @set:DoNotStrip @set:Keep - abstract var fontFamily: String + abstract var textFamily: String @get:DoNotStrip @get:Keep @set:DoNotStrip @set:Keep - abstract var color: Double + abstract var textColor: Double @get:DoNotStrip @get:Keep @set:DoNotStrip @set:Keep - abstract var textAlign: NitroInputTextAlign + abstract var textAlignment: NitroInputTextAlign @get:DoNotStrip @get:Keep @@ -439,7 +439,31 @@ abstract class HybridNitroInputViewSpec: HybridView() { @get:Keep @set:DoNotStrip @set:Keep - abstract var textAlignVertical: NitroInputTextAlignVertical + abstract var textVerticalAlignment: NitroInputTextAlignVertical + + @get:DoNotStrip + @get:Keep + @set:DoNotStrip + @set:Keep + abstract var textInsetLeft: Double + + @get:DoNotStrip + @get:Keep + @set:DoNotStrip + @set:Keep + abstract var textInsetTop: Double + + @get:DoNotStrip + @get:Keep + @set:DoNotStrip + @set:Keep + abstract var textInsetRight: Double + + @get:DoNotStrip + @get:Keep + @set:DoNotStrip + @set:Keep + abstract var textInsetBottom: Double @get:DoNotStrip @get:Keep diff --git a/packages/react-native-nitro-input/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinput/HybridNitroNumberViewSpec.kt b/packages/react-native-nitro-input/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinput/HybridNitroNumberViewSpec.kt index 54f6c4d..2ca4bb5 100644 --- a/packages/react-native-nitro-input/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinput/HybridNitroNumberViewSpec.kt +++ b/packages/react-native-nitro-input/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinput/HybridNitroNumberViewSpec.kt @@ -229,7 +229,7 @@ abstract class HybridNitroNumberViewSpec: HybridView() { @get:Keep @set:DoNotStrip @set:Keep - abstract var fontSize: Double? + abstract var textSize: Double? @get:DoNotStrip @get:Keep @@ -265,7 +265,7 @@ abstract class HybridNitroNumberViewSpec: HybridView() { @get:Keep @set:DoNotStrip @set:Keep - abstract var letterSpacing: Double? + abstract var textLetterSpacing: Double? @get:DoNotStrip @get:Keep @@ -403,25 +403,25 @@ abstract class HybridNitroNumberViewSpec: HybridView() { @get:Keep @set:DoNotStrip @set:Keep - abstract var fontWeight: Double? + abstract var textWeight: Double? @get:DoNotStrip @get:Keep @set:DoNotStrip @set:Keep - abstract var fontFamily: String? + abstract var textFamily: String? @get:DoNotStrip @get:Keep @set:DoNotStrip @set:Keep - abstract var color: Double? + abstract var textColor: Double? @get:DoNotStrip @get:Keep @set:DoNotStrip @set:Keep - abstract var textAlign: NitroNumberTextAlign? + abstract var textAlignment: NitroNumberTextAlign? @get:DoNotStrip @get:Keep diff --git a/packages/react-native-nitro-input/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinput/HybridNitroTextViewSpec.kt b/packages/react-native-nitro-input/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinput/HybridNitroTextViewSpec.kt index a17a20b..5f13490 100644 --- a/packages/react-native-nitro-input/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinput/HybridNitroTextViewSpec.kt +++ b/packages/react-native-nitro-input/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinput/HybridNitroTextViewSpec.kt @@ -37,37 +37,37 @@ abstract class HybridNitroTextViewSpec: HybridView() { @get:Keep @set:DoNotStrip @set:Keep - abstract var fontSize: Double? + abstract var textSize: Double? @get:DoNotStrip @get:Keep @set:DoNotStrip @set:Keep - abstract var fontWeight: Double? + abstract var textWeight: Double? @get:DoNotStrip @get:Keep @set:DoNotStrip @set:Keep - abstract var fontFamily: String? + abstract var textFamily: String? @get:DoNotStrip @get:Keep @set:DoNotStrip @set:Keep - abstract var color: Double? + abstract var textColor: Double? @get:DoNotStrip @get:Keep @set:DoNotStrip @set:Keep - abstract var letterSpacing: Double? + abstract var textLetterSpacing: Double? @get:DoNotStrip @get:Keep @set:DoNotStrip @set:Keep - abstract var textAlign: NitroNumberTextAlign? + abstract var textAlignment: NitroNumberTextAlign? @get:DoNotStrip @get:Keep diff --git a/packages/react-native-nitro-input/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinput/NitroInputSizing.kt b/packages/react-native-nitro-input/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinput/NitroInputSizing.kt index 5dc49ad..1cfe3d1 100644 --- a/packages/react-native-nitro-input/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinput/NitroInputSizing.kt +++ b/packages/react-native-nitro-input/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinput/NitroInputSizing.kt @@ -92,10 +92,10 @@ data class NitroInputSizing( val keepPlaceholder: Boolean, @DoNotStrip @Keep - val fontSize: Double, + val textSize: Double, @DoNotStrip @Keep - val lineHeight: Double, + val textLineHeight: Double, @DoNotStrip @Keep val prefixFontSize: Double, @@ -104,13 +104,13 @@ data class NitroInputSizing( val suffixFontSize: Double, @DoNotStrip @Keep - val fontWeight: Double, + val textWeight: Double, @DoNotStrip @Keep - val fontFamily: String, + val textFamily: String, @DoNotStrip @Keep - val letterSpacing: Double, + val textLetterSpacing: Double, @DoNotStrip @Keep val prefixSpacing: Double, @@ -168,13 +168,13 @@ data class NitroInputSizing( && Objects.deepEquals(this.maskCharacterMap, other.maskCharacterMap) && Objects.deepEquals(this.maskSlotPlaceholder, other.maskSlotPlaceholder) && Objects.deepEquals(this.keepPlaceholder, other.keepPlaceholder) - && Objects.deepEquals(this.fontSize, other.fontSize) - && Objects.deepEquals(this.lineHeight, other.lineHeight) + && Objects.deepEquals(this.textSize, other.textSize) + && Objects.deepEquals(this.textLineHeight, other.textLineHeight) && Objects.deepEquals(this.prefixFontSize, other.prefixFontSize) && Objects.deepEquals(this.suffixFontSize, other.suffixFontSize) - && Objects.deepEquals(this.fontWeight, other.fontWeight) - && Objects.deepEquals(this.fontFamily, other.fontFamily) - && Objects.deepEquals(this.letterSpacing, other.letterSpacing) + && Objects.deepEquals(this.textWeight, other.textWeight) + && Objects.deepEquals(this.textFamily, other.textFamily) + && Objects.deepEquals(this.textLetterSpacing, other.textLetterSpacing) && Objects.deepEquals(this.prefixSpacing, other.prefixSpacing) && Objects.deepEquals(this.suffixSpacing, other.suffixSpacing) && Objects.deepEquals(this.allowFontScaling, other.allowFontScaling) @@ -212,13 +212,13 @@ data class NitroInputSizing( maskCharacterMap, maskSlotPlaceholder, keepPlaceholder, - fontSize, - lineHeight, + textSize, + textLineHeight, prefixFontSize, suffixFontSize, - fontWeight, - fontFamily, - letterSpacing, + textWeight, + textFamily, + textLetterSpacing, prefixSpacing, suffixSpacing, allowFontScaling, @@ -239,8 +239,8 @@ data class NitroInputSizing( @Keep @Suppress("unused") @JvmStatic - private fun fromCpp(text: String, mode: NitroInputMode, plain: Boolean, multiline: Boolean, secureTextEntry: Boolean, maxLength: Double, fractionDigits: Double, maxIntegerDigits: Double, groupingSeparator: String, decimalSeparator: String, prefix: String, suffix: String, signPlacement: NitroInputSignPlacement, placeholder: String, mask: String, maskNotations: Array, maskAutocomplete: Boolean, maskAutoSkip: Boolean, maskAffinityFormats: Array, maskAffinityStrategy: NitroInputMaskAffinity, maskTextCase: NitroInputTextCase, maskCharacterMap: Array, maskSlotPlaceholder: String, keepPlaceholder: Boolean, fontSize: Double, lineHeight: Double, prefixFontSize: Double, suffixFontSize: Double, fontWeight: Double, fontFamily: String, letterSpacing: Double, prefixSpacing: Double, suffixSpacing: Double, allowFontScaling: Boolean, maxFontSizeMultiplier: Double, variant: NitroInputVariant, label: String, labelBehavior: NitroInputLabelBehavior, labelFontSize: Double, cornerRadius: Double): NitroInputSizing { - return NitroInputSizing(text, mode, plain, multiline, secureTextEntry, maxLength, fractionDigits, maxIntegerDigits, groupingSeparator, decimalSeparator, prefix, suffix, signPlacement, placeholder, mask, maskNotations, maskAutocomplete, maskAutoSkip, maskAffinityFormats, maskAffinityStrategy, maskTextCase, maskCharacterMap, maskSlotPlaceholder, keepPlaceholder, fontSize, lineHeight, prefixFontSize, suffixFontSize, fontWeight, fontFamily, letterSpacing, prefixSpacing, suffixSpacing, allowFontScaling, maxFontSizeMultiplier, variant, label, labelBehavior, labelFontSize, cornerRadius) + private fun fromCpp(text: String, mode: NitroInputMode, plain: Boolean, multiline: Boolean, secureTextEntry: Boolean, maxLength: Double, fractionDigits: Double, maxIntegerDigits: Double, groupingSeparator: String, decimalSeparator: String, prefix: String, suffix: String, signPlacement: NitroInputSignPlacement, placeholder: String, mask: String, maskNotations: Array, maskAutocomplete: Boolean, maskAutoSkip: Boolean, maskAffinityFormats: Array, maskAffinityStrategy: NitroInputMaskAffinity, maskTextCase: NitroInputTextCase, maskCharacterMap: Array, maskSlotPlaceholder: String, keepPlaceholder: Boolean, textSize: Double, textLineHeight: Double, prefixFontSize: Double, suffixFontSize: Double, textWeight: Double, textFamily: String, textLetterSpacing: Double, prefixSpacing: Double, suffixSpacing: Double, allowFontScaling: Boolean, maxFontSizeMultiplier: Double, variant: NitroInputVariant, label: String, labelBehavior: NitroInputLabelBehavior, labelFontSize: Double, cornerRadius: Double): NitroInputSizing { + return NitroInputSizing(text, mode, plain, multiline, secureTextEntry, maxLength, fractionDigits, maxIntegerDigits, groupingSeparator, decimalSeparator, prefix, suffix, signPlacement, placeholder, mask, maskNotations, maskAutocomplete, maskAutoSkip, maskAffinityFormats, maskAffinityStrategy, maskTextCase, maskCharacterMap, maskSlotPlaceholder, keepPlaceholder, textSize, textLineHeight, prefixFontSize, suffixFontSize, textWeight, textFamily, textLetterSpacing, prefixSpacing, suffixSpacing, allowFontScaling, maxFontSizeMultiplier, variant, label, labelBehavior, labelFontSize, cornerRadius) } } } diff --git a/packages/react-native-nitro-input/nitrogen/generated/ios/c++/HybridNitroInputViewSpecSwift.hpp b/packages/react-native-nitro-input/nitrogen/generated/ios/c++/HybridNitroInputViewSpecSwift.hpp index 4721afc..09a8516 100644 --- a/packages/react-native-nitro-input/nitrogen/generated/ios/c++/HybridNitroInputViewSpecSwift.hpp +++ b/packages/react-native-nitro-input/nitrogen/generated/ios/c++/HybridNitroInputViewSpecSwift.hpp @@ -353,11 +353,11 @@ namespace margelo::nitro::nitroinput { inline void setSuffixAlign(NitroInputAffixAlign suffixAlign) noexcept override { _swiftPart.setSuffixAlign(static_cast(suffixAlign)); } - inline double getLetterSpacing() noexcept override { - return _swiftPart.getLetterSpacing(); + inline double getTextLetterSpacing() noexcept override { + return _swiftPart.getTextLetterSpacing(); } - inline void setLetterSpacing(double letterSpacing) noexcept override { - _swiftPart.setLetterSpacing(std::forward(letterSpacing)); + inline void setTextLetterSpacing(double textLetterSpacing) noexcept override { + _swiftPart.setTextLetterSpacing(std::forward(textLetterSpacing)); } inline double getPrefixSpacing() noexcept override { return _swiftPart.getPrefixSpacing(); @@ -422,43 +422,43 @@ namespace margelo::nitro::nitroinput { inline void setEffect(NitroInputEffect effect) noexcept override { _swiftPart.setEffect(static_cast(effect)); } - inline double getFontSize() noexcept override { - return _swiftPart.getFontSize(); + inline double getTextSize() noexcept override { + return _swiftPart.getTextSize(); } - inline void setFontSize(double fontSize) noexcept override { - _swiftPart.setFontSize(std::forward(fontSize)); + inline void setTextSize(double textSize) noexcept override { + _swiftPart.setTextSize(std::forward(textSize)); } - inline double getLineHeight() noexcept override { - return _swiftPart.getLineHeight(); + inline double getTextLineHeight() noexcept override { + return _swiftPart.getTextLineHeight(); } - inline void setLineHeight(double lineHeight) noexcept override { - _swiftPart.setLineHeight(std::forward(lineHeight)); + inline void setTextLineHeight(double textLineHeight) noexcept override { + _swiftPart.setTextLineHeight(std::forward(textLineHeight)); } - inline double getFontWeight() noexcept override { - return _swiftPart.getFontWeight(); + inline double getTextWeight() noexcept override { + return _swiftPart.getTextWeight(); } - inline void setFontWeight(double fontWeight) noexcept override { - _swiftPart.setFontWeight(std::forward(fontWeight)); + inline void setTextWeight(double textWeight) noexcept override { + _swiftPart.setTextWeight(std::forward(textWeight)); } - inline std::string getFontFamily() noexcept override { - auto __result = _swiftPart.getFontFamily(); + inline std::string getTextFamily() noexcept override { + auto __result = _swiftPart.getTextFamily(); return __result; } - inline void setFontFamily(const std::string& fontFamily) noexcept override { - _swiftPart.setFontFamily(fontFamily); + inline void setTextFamily(const std::string& textFamily) noexcept override { + _swiftPart.setTextFamily(textFamily); } - inline double getColor() noexcept override { - return _swiftPart.getColor(); + inline double getTextColor() noexcept override { + return _swiftPart.getTextColor(); } - inline void setColor(double color) noexcept override { - _swiftPart.setColor(std::forward(color)); + inline void setTextColor(double textColor) noexcept override { + _swiftPart.setTextColor(std::forward(textColor)); } - inline NitroInputTextAlign getTextAlign() noexcept override { - auto __result = _swiftPart.getTextAlign(); + inline NitroInputTextAlign getTextAlignment() noexcept override { + auto __result = _swiftPart.getTextAlignment(); return static_cast(__result); } - inline void setTextAlign(NitroInputTextAlign textAlign) noexcept override { - _swiftPart.setTextAlign(static_cast(textAlign)); + inline void setTextAlignment(NitroInputTextAlign textAlignment) noexcept override { + _swiftPart.setTextAlignment(static_cast(textAlignment)); } inline bool getRightToLeft() noexcept override { return _swiftPart.getRightToLeft(); @@ -553,12 +553,36 @@ namespace margelo::nitro::nitroinput { inline void setNumberOfLines(double numberOfLines) noexcept override { _swiftPart.setNumberOfLines(std::forward(numberOfLines)); } - inline NitroInputTextAlignVertical getTextAlignVertical() noexcept override { - auto __result = _swiftPart.getTextAlignVertical(); + inline NitroInputTextAlignVertical getTextVerticalAlignment() noexcept override { + auto __result = _swiftPart.getTextVerticalAlignment(); return static_cast(__result); } - inline void setTextAlignVertical(NitroInputTextAlignVertical textAlignVertical) noexcept override { - _swiftPart.setTextAlignVertical(static_cast(textAlignVertical)); + inline void setTextVerticalAlignment(NitroInputTextAlignVertical textVerticalAlignment) noexcept override { + _swiftPart.setTextVerticalAlignment(static_cast(textVerticalAlignment)); + } + inline double getTextInsetLeft() noexcept override { + return _swiftPart.getTextInsetLeft(); + } + inline void setTextInsetLeft(double textInsetLeft) noexcept override { + _swiftPart.setTextInsetLeft(std::forward(textInsetLeft)); + } + inline double getTextInsetTop() noexcept override { + return _swiftPart.getTextInsetTop(); + } + inline void setTextInsetTop(double textInsetTop) noexcept override { + _swiftPart.setTextInsetTop(std::forward(textInsetTop)); + } + inline double getTextInsetRight() noexcept override { + return _swiftPart.getTextInsetRight(); + } + inline void setTextInsetRight(double textInsetRight) noexcept override { + _swiftPart.setTextInsetRight(std::forward(textInsetRight)); + } + inline double getTextInsetBottom() noexcept override { + return _swiftPart.getTextInsetBottom(); + } + inline void setTextInsetBottom(double textInsetBottom) noexcept override { + _swiftPart.setTextInsetBottom(std::forward(textInsetBottom)); } inline bool getScrollEnabled() noexcept override { return _swiftPart.getScrollEnabled(); diff --git a/packages/react-native-nitro-input/nitrogen/generated/ios/c++/HybridNitroNumberViewSpecSwift.hpp b/packages/react-native-nitro-input/nitrogen/generated/ios/c++/HybridNitroNumberViewSpecSwift.hpp index bbd0c6b..1d2fb2c 100644 --- a/packages/react-native-nitro-input/nitrogen/generated/ios/c++/HybridNitroNumberViewSpecSwift.hpp +++ b/packages/react-native-nitro-input/nitrogen/generated/ios/c++/HybridNitroNumberViewSpecSwift.hpp @@ -318,12 +318,12 @@ namespace margelo::nitro::nitroinput { inline void setShimmerDelay(std::optional shimmerDelay) noexcept override { _swiftPart.setShimmerDelay(shimmerDelay); } - inline std::optional getFontSize() noexcept override { - auto __result = _swiftPart.getFontSize(); + inline std::optional getTextSize() noexcept override { + auto __result = _swiftPart.getTextSize(); return __result; } - inline void setFontSize(std::optional fontSize) noexcept override { - _swiftPart.setFontSize(fontSize); + inline void setTextSize(std::optional textSize) noexcept override { + _swiftPart.setTextSize(textSize); } inline std::optional getPrefixFontSize() noexcept override { auto __result = _swiftPart.getPrefixFontSize(); @@ -360,12 +360,12 @@ namespace margelo::nitro::nitroinput { inline void setSuffixAlign(std::optional suffixAlign) noexcept override { _swiftPart.setSuffixAlign(suffixAlign); } - inline std::optional getLetterSpacing() noexcept override { - auto __result = _swiftPart.getLetterSpacing(); + inline std::optional getTextLetterSpacing() noexcept override { + auto __result = _swiftPart.getTextLetterSpacing(); return __result; } - inline void setLetterSpacing(std::optional letterSpacing) noexcept override { - _swiftPart.setLetterSpacing(letterSpacing); + inline void setTextLetterSpacing(std::optional textLetterSpacing) noexcept override { + _swiftPart.setTextLetterSpacing(textLetterSpacing); } inline std::optional getPrefixSpacing() noexcept override { auto __result = _swiftPart.getPrefixSpacing(); @@ -521,33 +521,33 @@ namespace margelo::nitro::nitroinput { inline void setMaxFontSizeMultiplier(std::optional maxFontSizeMultiplier) noexcept override { _swiftPart.setMaxFontSizeMultiplier(maxFontSizeMultiplier); } - inline std::optional getFontWeight() noexcept override { - auto __result = _swiftPart.getFontWeight(); + inline std::optional getTextWeight() noexcept override { + auto __result = _swiftPart.getTextWeight(); return __result; } - inline void setFontWeight(std::optional fontWeight) noexcept override { - _swiftPart.setFontWeight(fontWeight); + inline void setTextWeight(std::optional textWeight) noexcept override { + _swiftPart.setTextWeight(textWeight); } - inline std::optional getFontFamily() noexcept override { - auto __result = _swiftPart.getFontFamily(); + inline std::optional getTextFamily() noexcept override { + auto __result = _swiftPart.getTextFamily(); return __result; } - inline void setFontFamily(const std::optional& fontFamily) noexcept override { - _swiftPart.setFontFamily(fontFamily); + inline void setTextFamily(const std::optional& textFamily) noexcept override { + _swiftPart.setTextFamily(textFamily); } - inline std::optional getColor() noexcept override { - auto __result = _swiftPart.getColor(); + inline std::optional getTextColor() noexcept override { + auto __result = _swiftPart.getTextColor(); return __result; } - inline void setColor(std::optional color) noexcept override { - _swiftPart.setColor(color); + inline void setTextColor(std::optional textColor) noexcept override { + _swiftPart.setTextColor(textColor); } - inline std::optional getTextAlign() noexcept override { - auto __result = _swiftPart.getTextAlign(); + inline std::optional getTextAlignment() noexcept override { + auto __result = _swiftPart.getTextAlignment(); return __result; } - inline void setTextAlign(std::optional textAlign) noexcept override { - _swiftPart.setTextAlign(textAlign); + inline void setTextAlignment(std::optional textAlignment) noexcept override { + _swiftPart.setTextAlignment(textAlignment); } inline std::optional getRightToLeft() noexcept override { auto __result = _swiftPart.getRightToLeft(); diff --git a/packages/react-native-nitro-input/nitrogen/generated/ios/c++/HybridNitroTextViewSpecSwift.hpp b/packages/react-native-nitro-input/nitrogen/generated/ios/c++/HybridNitroTextViewSpecSwift.hpp index 3e975ea..27fd53b 100644 --- a/packages/react-native-nitro-input/nitrogen/generated/ios/c++/HybridNitroTextViewSpecSwift.hpp +++ b/packages/react-native-nitro-input/nitrogen/generated/ios/c++/HybridNitroTextViewSpecSwift.hpp @@ -81,47 +81,47 @@ namespace margelo::nitro::nitroinput { inline void setText(const std::string& text) noexcept override { _swiftPart.setText(text); } - inline std::optional getFontSize() noexcept override { - auto __result = _swiftPart.getFontSize(); + inline std::optional getTextSize() noexcept override { + auto __result = _swiftPart.getTextSize(); return __result; } - inline void setFontSize(std::optional fontSize) noexcept override { - _swiftPart.setFontSize(fontSize); + inline void setTextSize(std::optional textSize) noexcept override { + _swiftPart.setTextSize(textSize); } - inline std::optional getFontWeight() noexcept override { - auto __result = _swiftPart.getFontWeight(); + inline std::optional getTextWeight() noexcept override { + auto __result = _swiftPart.getTextWeight(); return __result; } - inline void setFontWeight(std::optional fontWeight) noexcept override { - _swiftPart.setFontWeight(fontWeight); + inline void setTextWeight(std::optional textWeight) noexcept override { + _swiftPart.setTextWeight(textWeight); } - inline std::optional getFontFamily() noexcept override { - auto __result = _swiftPart.getFontFamily(); + inline std::optional getTextFamily() noexcept override { + auto __result = _swiftPart.getTextFamily(); return __result; } - inline void setFontFamily(const std::optional& fontFamily) noexcept override { - _swiftPart.setFontFamily(fontFamily); + inline void setTextFamily(const std::optional& textFamily) noexcept override { + _swiftPart.setTextFamily(textFamily); } - inline std::optional getColor() noexcept override { - auto __result = _swiftPart.getColor(); + inline std::optional getTextColor() noexcept override { + auto __result = _swiftPart.getTextColor(); return __result; } - inline void setColor(std::optional color) noexcept override { - _swiftPart.setColor(color); + inline void setTextColor(std::optional textColor) noexcept override { + _swiftPart.setTextColor(textColor); } - inline std::optional getLetterSpacing() noexcept override { - auto __result = _swiftPart.getLetterSpacing(); + inline std::optional getTextLetterSpacing() noexcept override { + auto __result = _swiftPart.getTextLetterSpacing(); return __result; } - inline void setLetterSpacing(std::optional letterSpacing) noexcept override { - _swiftPart.setLetterSpacing(letterSpacing); + inline void setTextLetterSpacing(std::optional textLetterSpacing) noexcept override { + _swiftPart.setTextLetterSpacing(textLetterSpacing); } - inline std::optional getTextAlign() noexcept override { - auto __result = _swiftPart.getTextAlign(); + inline std::optional getTextAlignment() noexcept override { + auto __result = _swiftPart.getTextAlignment(); return __result; } - inline void setTextAlign(std::optional textAlign) noexcept override { - _swiftPart.setTextAlign(textAlign); + inline void setTextAlignment(std::optional textAlignment) noexcept override { + _swiftPart.setTextAlignment(textAlignment); } inline std::optional getRightToLeft() noexcept override { auto __result = _swiftPart.getRightToLeft(); diff --git a/packages/react-native-nitro-input/nitrogen/generated/ios/c++/views/HybridNitroInputViewComponent.mm b/packages/react-native-nitro-input/nitrogen/generated/ios/c++/views/HybridNitroInputViewComponent.mm index 4861567..7b3992f 100644 --- a/packages/react-native-nitro-input/nitrogen/generated/ios/c++/views/HybridNitroInputViewComponent.mm +++ b/packages/react-native-nitro-input/nitrogen/generated/ios/c++/views/HybridNitroInputViewComponent.mm @@ -314,11 +314,11 @@ - (void) updateProps:(const std::shared_ptr&)props : !newViewProps.suffixAlign.hasSameValue(oldViewProps->suffixAlign)) { swiftPart.setSuffixAlign(static_cast(newViewProps.suffixAlign.get())); } - // letterSpacing: number + // textLetterSpacing: number if (oldViewProps == nullptr - ? newViewProps.letterSpacing.isProvided() - : !newViewProps.letterSpacing.hasSameValue(oldViewProps->letterSpacing)) { - swiftPart.setLetterSpacing(newViewProps.letterSpacing.get()); + ? newViewProps.textLetterSpacing.isProvided() + : !newViewProps.textLetterSpacing.hasSameValue(oldViewProps->textLetterSpacing)) { + swiftPart.setTextLetterSpacing(newViewProps.textLetterSpacing.get()); } // prefixSpacing: number if (oldViewProps == nullptr @@ -380,41 +380,41 @@ - (void) updateProps:(const std::shared_ptr&)props : !newViewProps.effect.hasSameValue(oldViewProps->effect)) { swiftPart.setEffect(static_cast(newViewProps.effect.get())); } - // fontSize: number + // textSize: number if (oldViewProps == nullptr - ? newViewProps.fontSize.isProvided() - : !newViewProps.fontSize.hasSameValue(oldViewProps->fontSize)) { - swiftPart.setFontSize(newViewProps.fontSize.get()); + ? newViewProps.textSize.isProvided() + : !newViewProps.textSize.hasSameValue(oldViewProps->textSize)) { + swiftPart.setTextSize(newViewProps.textSize.get()); } - // lineHeight: number + // textLineHeight: number if (oldViewProps == nullptr - ? newViewProps.lineHeight.isProvided() - : !newViewProps.lineHeight.hasSameValue(oldViewProps->lineHeight)) { - swiftPart.setLineHeight(newViewProps.lineHeight.get()); + ? newViewProps.textLineHeight.isProvided() + : !newViewProps.textLineHeight.hasSameValue(oldViewProps->textLineHeight)) { + swiftPart.setTextLineHeight(newViewProps.textLineHeight.get()); } - // fontWeight: number + // textWeight: number if (oldViewProps == nullptr - ? newViewProps.fontWeight.isProvided() - : !newViewProps.fontWeight.hasSameValue(oldViewProps->fontWeight)) { - swiftPart.setFontWeight(newViewProps.fontWeight.get()); + ? newViewProps.textWeight.isProvided() + : !newViewProps.textWeight.hasSameValue(oldViewProps->textWeight)) { + swiftPart.setTextWeight(newViewProps.textWeight.get()); } - // fontFamily: string + // textFamily: string if (oldViewProps == nullptr - ? newViewProps.fontFamily.isProvided() - : !newViewProps.fontFamily.hasSameValue(oldViewProps->fontFamily)) { - swiftPart.setFontFamily(newViewProps.fontFamily.get()); + ? newViewProps.textFamily.isProvided() + : !newViewProps.textFamily.hasSameValue(oldViewProps->textFamily)) { + swiftPart.setTextFamily(newViewProps.textFamily.get()); } - // color: number + // textColor: number if (oldViewProps == nullptr - ? newViewProps.color.isProvided() - : !newViewProps.color.hasSameValue(oldViewProps->color)) { - swiftPart.setColor(newViewProps.color.get()); + ? newViewProps.textColor.isProvided() + : !newViewProps.textColor.hasSameValue(oldViewProps->textColor)) { + swiftPart.setTextColor(newViewProps.textColor.get()); } - // textAlign: enum + // textAlignment: enum if (oldViewProps == nullptr - ? newViewProps.textAlign.isProvided() - : !newViewProps.textAlign.hasSameValue(oldViewProps->textAlign)) { - swiftPart.setTextAlign(static_cast(newViewProps.textAlign.get())); + ? newViewProps.textAlignment.isProvided() + : !newViewProps.textAlignment.hasSameValue(oldViewProps->textAlignment)) { + swiftPart.setTextAlignment(static_cast(newViewProps.textAlignment.get())); } // rightToLeft: boolean if (oldViewProps == nullptr @@ -506,11 +506,35 @@ - (void) updateProps:(const std::shared_ptr&)props : !newViewProps.numberOfLines.hasSameValue(oldViewProps->numberOfLines)) { swiftPart.setNumberOfLines(newViewProps.numberOfLines.get()); } - // textAlignVertical: enum + // textVerticalAlignment: enum if (oldViewProps == nullptr - ? newViewProps.textAlignVertical.isProvided() - : !newViewProps.textAlignVertical.hasSameValue(oldViewProps->textAlignVertical)) { - swiftPart.setTextAlignVertical(static_cast(newViewProps.textAlignVertical.get())); + ? newViewProps.textVerticalAlignment.isProvided() + : !newViewProps.textVerticalAlignment.hasSameValue(oldViewProps->textVerticalAlignment)) { + swiftPart.setTextVerticalAlignment(static_cast(newViewProps.textVerticalAlignment.get())); + } + // textInsetLeft: number + if (oldViewProps == nullptr + ? newViewProps.textInsetLeft.isProvided() + : !newViewProps.textInsetLeft.hasSameValue(oldViewProps->textInsetLeft)) { + swiftPart.setTextInsetLeft(newViewProps.textInsetLeft.get()); + } + // textInsetTop: number + if (oldViewProps == nullptr + ? newViewProps.textInsetTop.isProvided() + : !newViewProps.textInsetTop.hasSameValue(oldViewProps->textInsetTop)) { + swiftPart.setTextInsetTop(newViewProps.textInsetTop.get()); + } + // textInsetRight: number + if (oldViewProps == nullptr + ? newViewProps.textInsetRight.isProvided() + : !newViewProps.textInsetRight.hasSameValue(oldViewProps->textInsetRight)) { + swiftPart.setTextInsetRight(newViewProps.textInsetRight.get()); + } + // textInsetBottom: number + if (oldViewProps == nullptr + ? newViewProps.textInsetBottom.isProvided() + : !newViewProps.textInsetBottom.hasSameValue(oldViewProps->textInsetBottom)) { + swiftPart.setTextInsetBottom(newViewProps.textInsetBottom.get()); } // scrollEnabled: boolean if (oldViewProps == nullptr diff --git a/packages/react-native-nitro-input/nitrogen/generated/ios/c++/views/HybridNitroNumberViewComponent.mm b/packages/react-native-nitro-input/nitrogen/generated/ios/c++/views/HybridNitroNumberViewComponent.mm index b46ec43..636a144 100644 --- a/packages/react-native-nitro-input/nitrogen/generated/ios/c++/views/HybridNitroNumberViewComponent.mm +++ b/packages/react-native-nitro-input/nitrogen/generated/ios/c++/views/HybridNitroNumberViewComponent.mm @@ -296,11 +296,11 @@ - (void) updateProps:(const std::shared_ptr&)props : !newViewProps.shimmerDelay.hasSameValue(oldViewProps->shimmerDelay)) { swiftPart.setShimmerDelay(newViewProps.shimmerDelay.get()); } - // fontSize: optional + // textSize: optional if (oldViewProps == nullptr - ? newViewProps.fontSize.isProvided() - : !newViewProps.fontSize.hasSameValue(oldViewProps->fontSize)) { - swiftPart.setFontSize(newViewProps.fontSize.get()); + ? newViewProps.textSize.isProvided() + : !newViewProps.textSize.hasSameValue(oldViewProps->textSize)) { + swiftPart.setTextSize(newViewProps.textSize.get()); } // prefixFontSize: optional if (oldViewProps == nullptr @@ -332,11 +332,11 @@ - (void) updateProps:(const std::shared_ptr&)props : !newViewProps.suffixAlign.hasSameValue(oldViewProps->suffixAlign)) { swiftPart.setSuffixAlign(newViewProps.suffixAlign.get()); } - // letterSpacing: optional + // textLetterSpacing: optional if (oldViewProps == nullptr - ? newViewProps.letterSpacing.isProvided() - : !newViewProps.letterSpacing.hasSameValue(oldViewProps->letterSpacing)) { - swiftPart.setLetterSpacing(newViewProps.letterSpacing.get()); + ? newViewProps.textLetterSpacing.isProvided() + : !newViewProps.textLetterSpacing.hasSameValue(oldViewProps->textLetterSpacing)) { + swiftPart.setTextLetterSpacing(newViewProps.textLetterSpacing.get()); } // prefixSpacing: optional if (oldViewProps == nullptr @@ -470,29 +470,29 @@ - (void) updateProps:(const std::shared_ptr&)props : !newViewProps.maxFontSizeMultiplier.hasSameValue(oldViewProps->maxFontSizeMultiplier)) { swiftPart.setMaxFontSizeMultiplier(newViewProps.maxFontSizeMultiplier.get()); } - // fontWeight: optional + // textWeight: optional if (oldViewProps == nullptr - ? newViewProps.fontWeight.isProvided() - : !newViewProps.fontWeight.hasSameValue(oldViewProps->fontWeight)) { - swiftPart.setFontWeight(newViewProps.fontWeight.get()); + ? newViewProps.textWeight.isProvided() + : !newViewProps.textWeight.hasSameValue(oldViewProps->textWeight)) { + swiftPart.setTextWeight(newViewProps.textWeight.get()); } - // fontFamily: optional + // textFamily: optional if (oldViewProps == nullptr - ? newViewProps.fontFamily.isProvided() - : !newViewProps.fontFamily.hasSameValue(oldViewProps->fontFamily)) { - swiftPart.setFontFamily(newViewProps.fontFamily.get()); + ? newViewProps.textFamily.isProvided() + : !newViewProps.textFamily.hasSameValue(oldViewProps->textFamily)) { + swiftPart.setTextFamily(newViewProps.textFamily.get()); } - // color: optional + // textColor: optional if (oldViewProps == nullptr - ? newViewProps.color.isProvided() - : !newViewProps.color.hasSameValue(oldViewProps->color)) { - swiftPart.setColor(newViewProps.color.get()); + ? newViewProps.textColor.isProvided() + : !newViewProps.textColor.hasSameValue(oldViewProps->textColor)) { + swiftPart.setTextColor(newViewProps.textColor.get()); } - // textAlign: optional + // textAlignment: optional if (oldViewProps == nullptr - ? newViewProps.textAlign.isProvided() - : !newViewProps.textAlign.hasSameValue(oldViewProps->textAlign)) { - swiftPart.setTextAlign(newViewProps.textAlign.get()); + ? newViewProps.textAlignment.isProvided() + : !newViewProps.textAlignment.hasSameValue(oldViewProps->textAlignment)) { + swiftPart.setTextAlignment(newViewProps.textAlignment.get()); } // rightToLeft: optional if (oldViewProps == nullptr diff --git a/packages/react-native-nitro-input/nitrogen/generated/ios/c++/views/HybridNitroTextViewComponent.mm b/packages/react-native-nitro-input/nitrogen/generated/ios/c++/views/HybridNitroTextViewComponent.mm index 342189c..fa95c54 100644 --- a/packages/react-native-nitro-input/nitrogen/generated/ios/c++/views/HybridNitroTextViewComponent.mm +++ b/packages/react-native-nitro-input/nitrogen/generated/ios/c++/views/HybridNitroTextViewComponent.mm @@ -104,41 +104,41 @@ - (void) updateProps:(const std::shared_ptr&)props : !newViewProps.text.hasSameValue(oldViewProps->text)) { swiftPart.setText(newViewProps.text.get()); } - // fontSize: optional + // textSize: optional if (oldViewProps == nullptr - ? newViewProps.fontSize.isProvided() - : !newViewProps.fontSize.hasSameValue(oldViewProps->fontSize)) { - swiftPart.setFontSize(newViewProps.fontSize.get()); + ? newViewProps.textSize.isProvided() + : !newViewProps.textSize.hasSameValue(oldViewProps->textSize)) { + swiftPart.setTextSize(newViewProps.textSize.get()); } - // fontWeight: optional + // textWeight: optional if (oldViewProps == nullptr - ? newViewProps.fontWeight.isProvided() - : !newViewProps.fontWeight.hasSameValue(oldViewProps->fontWeight)) { - swiftPart.setFontWeight(newViewProps.fontWeight.get()); + ? newViewProps.textWeight.isProvided() + : !newViewProps.textWeight.hasSameValue(oldViewProps->textWeight)) { + swiftPart.setTextWeight(newViewProps.textWeight.get()); } - // fontFamily: optional + // textFamily: optional if (oldViewProps == nullptr - ? newViewProps.fontFamily.isProvided() - : !newViewProps.fontFamily.hasSameValue(oldViewProps->fontFamily)) { - swiftPart.setFontFamily(newViewProps.fontFamily.get()); + ? newViewProps.textFamily.isProvided() + : !newViewProps.textFamily.hasSameValue(oldViewProps->textFamily)) { + swiftPart.setTextFamily(newViewProps.textFamily.get()); } - // color: optional + // textColor: optional if (oldViewProps == nullptr - ? newViewProps.color.isProvided() - : !newViewProps.color.hasSameValue(oldViewProps->color)) { - swiftPart.setColor(newViewProps.color.get()); + ? newViewProps.textColor.isProvided() + : !newViewProps.textColor.hasSameValue(oldViewProps->textColor)) { + swiftPart.setTextColor(newViewProps.textColor.get()); } - // letterSpacing: optional + // textLetterSpacing: optional if (oldViewProps == nullptr - ? newViewProps.letterSpacing.isProvided() - : !newViewProps.letterSpacing.hasSameValue(oldViewProps->letterSpacing)) { - swiftPart.setLetterSpacing(newViewProps.letterSpacing.get()); + ? newViewProps.textLetterSpacing.isProvided() + : !newViewProps.textLetterSpacing.hasSameValue(oldViewProps->textLetterSpacing)) { + swiftPart.setTextLetterSpacing(newViewProps.textLetterSpacing.get()); } - // textAlign: optional + // textAlignment: optional if (oldViewProps == nullptr - ? newViewProps.textAlign.isProvided() - : !newViewProps.textAlign.hasSameValue(oldViewProps->textAlign)) { - swiftPart.setTextAlign(newViewProps.textAlign.get()); + ? newViewProps.textAlignment.isProvided() + : !newViewProps.textAlignment.hasSameValue(oldViewProps->textAlignment)) { + swiftPart.setTextAlignment(newViewProps.textAlignment.get()); } // rightToLeft: optional if (oldViewProps == nullptr diff --git a/packages/react-native-nitro-input/nitrogen/generated/ios/swift/HybridNitroInputViewSpec.swift b/packages/react-native-nitro-input/nitrogen/generated/ios/swift/HybridNitroInputViewSpec.swift index e830b84..e61f408 100644 --- a/packages/react-native-nitro-input/nitrogen/generated/ios/swift/HybridNitroInputViewSpec.swift +++ b/packages/react-native-nitro-input/nitrogen/generated/ios/swift/HybridNitroInputViewSpec.swift @@ -46,7 +46,7 @@ public protocol HybridNitroInputViewSpec_protocol: HybridObject, HybridView { var signPlacement: NitroInputSignPlacement { get set } var prefixAlign: NitroInputAffixAlign { get set } var suffixAlign: NitroInputAffixAlign { get set } - var letterSpacing: Double { get set } + var textLetterSpacing: Double { get set } var prefixSpacing: Double { get set } var suffixSpacing: Double { get set } var prefixOffset: Double { get set } @@ -57,12 +57,12 @@ public protocol HybridNitroInputViewSpec_protocol: HybridObject, HybridView { var easing: NitroInputEasing { get set } var bounce: Double { get set } var effect: NitroInputEffect { get set } - var fontSize: Double { get set } - var lineHeight: Double { get set } - var fontWeight: Double { get set } - var fontFamily: String { get set } - var color: Double { get set } - var textAlign: NitroInputTextAlign { get set } + var textSize: Double { get set } + var textLineHeight: Double { get set } + var textWeight: Double { get set } + var textFamily: String { get set } + var textColor: Double { get set } + var textAlignment: NitroInputTextAlign { get set } var rightToLeft: Bool { get set } var caretColor: Double { get set } var selectionColor: Double { get set } @@ -78,7 +78,11 @@ public protocol HybridNitroInputViewSpec_protocol: HybridObject, HybridView { var editable: Bool { get set } var multiline: Bool { get set } var numberOfLines: Double { get set } - var textAlignVertical: NitroInputTextAlignVertical { get set } + var textVerticalAlignment: NitroInputTextAlignVertical { get set } + var textInsetLeft: Double { get set } + var textInsetTop: Double { get set } + var textInsetRight: Double { get set } + var textInsetBottom: Double { get set } var scrollEnabled: Bool { get set } var autoFocus: Bool { get set } var fieldTestID: String { get set } diff --git a/packages/react-native-nitro-input/nitrogen/generated/ios/swift/HybridNitroInputViewSpec_cxx.swift b/packages/react-native-nitro-input/nitrogen/generated/ios/swift/HybridNitroInputViewSpec_cxx.swift index 38d21f3..c133281 100644 --- a/packages/react-native-nitro-input/nitrogen/generated/ios/swift/HybridNitroInputViewSpec_cxx.swift +++ b/packages/react-native-nitro-input/nitrogen/generated/ios/swift/HybridNitroInputViewSpec_cxx.swift @@ -535,14 +535,14 @@ open class HybridNitroInputViewSpec_cxx { } } - public final var letterSpacing: Double { + public final var textLetterSpacing: Double { @inline(__always) get { - return self.__implementation.letterSpacing + return self.__implementation.textLetterSpacing } @inline(__always) set { - self.__implementation.letterSpacing = newValue + self.__implementation.textLetterSpacing = newValue } } @@ -656,69 +656,69 @@ open class HybridNitroInputViewSpec_cxx { } } - public final var fontSize: Double { + public final var textSize: Double { @inline(__always) get { - return self.__implementation.fontSize + return self.__implementation.textSize } @inline(__always) set { - self.__implementation.fontSize = newValue + self.__implementation.textSize = newValue } } - public final var lineHeight: Double { + public final var textLineHeight: Double { @inline(__always) get { - return self.__implementation.lineHeight + return self.__implementation.textLineHeight } @inline(__always) set { - self.__implementation.lineHeight = newValue + self.__implementation.textLineHeight = newValue } } - public final var fontWeight: Double { + public final var textWeight: Double { @inline(__always) get { - return self.__implementation.fontWeight + return self.__implementation.textWeight } @inline(__always) set { - self.__implementation.fontWeight = newValue + self.__implementation.textWeight = newValue } } - public final var fontFamily: std.string { + public final var textFamily: std.string { @inline(__always) get { - return std.string(self.__implementation.fontFamily) + return std.string(self.__implementation.textFamily) } @inline(__always) set { - self.__implementation.fontFamily = String(newValue) + self.__implementation.textFamily = String(newValue) } } - public final var color: Double { + public final var textColor: Double { @inline(__always) get { - return self.__implementation.color + return self.__implementation.textColor } @inline(__always) set { - self.__implementation.color = newValue + self.__implementation.textColor = newValue } } - public final var textAlign: Int32 { + public final var textAlignment: Int32 { @inline(__always) get { - return self.__implementation.textAlign.rawValue + return self.__implementation.textAlignment.rawValue } @inline(__always) set { - self.__implementation.textAlign = margelo.nitro.nitroinput.NitroInputTextAlign(rawValue: newValue)! + self.__implementation.textAlignment = margelo.nitro.nitroinput.NitroInputTextAlign(rawValue: newValue)! } } @@ -887,14 +887,58 @@ open class HybridNitroInputViewSpec_cxx { } } - public final var textAlignVertical: Int32 { + public final var textVerticalAlignment: Int32 { @inline(__always) get { - return self.__implementation.textAlignVertical.rawValue + return self.__implementation.textVerticalAlignment.rawValue } @inline(__always) set { - self.__implementation.textAlignVertical = margelo.nitro.nitroinput.NitroInputTextAlignVertical(rawValue: newValue)! + self.__implementation.textVerticalAlignment = margelo.nitro.nitroinput.NitroInputTextAlignVertical(rawValue: newValue)! + } + } + + public final var textInsetLeft: Double { + @inline(__always) + get { + return self.__implementation.textInsetLeft + } + @inline(__always) + set { + self.__implementation.textInsetLeft = newValue + } + } + + public final var textInsetTop: Double { + @inline(__always) + get { + return self.__implementation.textInsetTop + } + @inline(__always) + set { + self.__implementation.textInsetTop = newValue + } + } + + public final var textInsetRight: Double { + @inline(__always) + get { + return self.__implementation.textInsetRight + } + @inline(__always) + set { + self.__implementation.textInsetRight = newValue + } + } + + public final var textInsetBottom: Double { + @inline(__always) + get { + return self.__implementation.textInsetBottom + } + @inline(__always) + set { + self.__implementation.textInsetBottom = newValue } } diff --git a/packages/react-native-nitro-input/nitrogen/generated/ios/swift/HybridNitroNumberViewSpec.swift b/packages/react-native-nitro-input/nitrogen/generated/ios/swift/HybridNitroNumberViewSpec.swift index daca21a..a7df7aa 100644 --- a/packages/react-native-nitro-input/nitrogen/generated/ios/swift/HybridNitroNumberViewSpec.swift +++ b/packages/react-native-nitro-input/nitrogen/generated/ios/swift/HybridNitroNumberViewSpec.swift @@ -43,13 +43,13 @@ public protocol HybridNitroNumberViewSpec_protocol: HybridObject, HybridView { var shimmerBaseColor: Double? { get set } var shimmerDirection: NitroNumberShimmerDirection? { get set } var shimmerDelay: Double? { get set } - var fontSize: Double? { get set } + var textSize: Double? { get set } var prefixFontSize: Double? { get set } var suffixFontSize: Double? { get set } var affixAlign: NitroNumberAffixAlign? { get set } var prefixAlign: NitroNumberAffixAlign? { get set } var suffixAlign: NitroNumberAffixAlign? { get set } - var letterSpacing: Double? { get set } + var textLetterSpacing: Double? { get set } var prefixSpacing: Double? { get set } var suffixSpacing: Double? { get set } var prefixOffset: Double? { get set } @@ -72,10 +72,10 @@ public protocol HybridNitroNumberViewSpec_protocol: HybridObject, HybridView { var minimumFontScale: Double? { get set } var allowFontScaling: Bool? { get set } var maxFontSizeMultiplier: Double? { get set } - var fontWeight: Double? { get set } - var fontFamily: String? { get set } - var color: Double? { get set } - var textAlign: NitroNumberTextAlign? { get set } + var textWeight: Double? { get set } + var textFamily: String? { get set } + var textColor: Double? { get set } + var textAlignment: NitroNumberTextAlign? { get set } var rightToLeft: Bool? { get set } var onSizeChange: ((_ width: Double, _ height: Double) -> Void)? { get set } var onRevealEnd: (() -> Void)? { get set } diff --git a/packages/react-native-nitro-input/nitrogen/generated/ios/swift/HybridNitroNumberViewSpec_cxx.swift b/packages/react-native-nitro-input/nitrogen/generated/ios/swift/HybridNitroNumberViewSpec_cxx.swift index ff479d5..a99fa35 100644 --- a/packages/react-native-nitro-input/nitrogen/generated/ios/swift/HybridNitroNumberViewSpec_cxx.swift +++ b/packages/react-native-nitro-input/nitrogen/generated/ios/swift/HybridNitroNumberViewSpec_cxx.swift @@ -871,11 +871,11 @@ open class HybridNitroNumberViewSpec_cxx { } } - public final var fontSize: bridge.std__optional_double_ { + public final var textSize: bridge.std__optional_double_ { @inline(__always) get { return { () -> bridge.std__optional_double_ in - if let __unwrappedValue = self.__implementation.fontSize { + if let __unwrappedValue = self.__implementation.textSize { return bridge.create_std__optional_double_(__unwrappedValue) } else { return .init() @@ -884,7 +884,7 @@ open class HybridNitroNumberViewSpec_cxx { } @inline(__always) set { - self.__implementation.fontSize = { () -> Double? in + self.__implementation.textSize = { () -> Double? in if bridge.has_value_std__optional_double_(newValue) { let __unwrapped = bridge.get_std__optional_double_(newValue) return __unwrapped @@ -994,11 +994,11 @@ open class HybridNitroNumberViewSpec_cxx { } } - public final var letterSpacing: bridge.std__optional_double_ { + public final var textLetterSpacing: bridge.std__optional_double_ { @inline(__always) get { return { () -> bridge.std__optional_double_ in - if let __unwrappedValue = self.__implementation.letterSpacing { + if let __unwrappedValue = self.__implementation.textLetterSpacing { return bridge.create_std__optional_double_(__unwrappedValue) } else { return .init() @@ -1007,7 +1007,7 @@ open class HybridNitroNumberViewSpec_cxx { } @inline(__always) set { - self.__implementation.letterSpacing = { () -> Double? in + self.__implementation.textLetterSpacing = { () -> Double? in if bridge.has_value_std__optional_double_(newValue) { let __unwrapped = bridge.get_std__optional_double_(newValue) return __unwrapped @@ -1550,11 +1550,11 @@ open class HybridNitroNumberViewSpec_cxx { } } - public final var fontWeight: bridge.std__optional_double_ { + public final var textWeight: bridge.std__optional_double_ { @inline(__always) get { return { () -> bridge.std__optional_double_ in - if let __unwrappedValue = self.__implementation.fontWeight { + if let __unwrappedValue = self.__implementation.textWeight { return bridge.create_std__optional_double_(__unwrappedValue) } else { return .init() @@ -1563,7 +1563,7 @@ open class HybridNitroNumberViewSpec_cxx { } @inline(__always) set { - self.__implementation.fontWeight = { () -> Double? in + self.__implementation.textWeight = { () -> Double? in if bridge.has_value_std__optional_double_(newValue) { let __unwrapped = bridge.get_std__optional_double_(newValue) return __unwrapped @@ -1574,11 +1574,11 @@ open class HybridNitroNumberViewSpec_cxx { } } - public final var fontFamily: bridge.std__optional_std__string_ { + public final var textFamily: bridge.std__optional_std__string_ { @inline(__always) get { return { () -> bridge.std__optional_std__string_ in - if let __unwrappedValue = self.__implementation.fontFamily { + if let __unwrappedValue = self.__implementation.textFamily { return bridge.create_std__optional_std__string_(std.string(__unwrappedValue)) } else { return .init() @@ -1587,7 +1587,7 @@ open class HybridNitroNumberViewSpec_cxx { } @inline(__always) set { - self.__implementation.fontFamily = { () -> String? in + self.__implementation.textFamily = { () -> String? in if bridge.has_value_std__optional_std__string_(newValue) { let __unwrapped = bridge.get_std__optional_std__string_(newValue) return String(__unwrapped) @@ -1598,11 +1598,11 @@ open class HybridNitroNumberViewSpec_cxx { } } - public final var color: bridge.std__optional_double_ { + public final var textColor: bridge.std__optional_double_ { @inline(__always) get { return { () -> bridge.std__optional_double_ in - if let __unwrappedValue = self.__implementation.color { + if let __unwrappedValue = self.__implementation.textColor { return bridge.create_std__optional_double_(__unwrappedValue) } else { return .init() @@ -1611,7 +1611,7 @@ open class HybridNitroNumberViewSpec_cxx { } @inline(__always) set { - self.__implementation.color = { () -> Double? in + self.__implementation.textColor = { () -> Double? in if bridge.has_value_std__optional_double_(newValue) { let __unwrapped = bridge.get_std__optional_double_(newValue) return __unwrapped @@ -1622,11 +1622,11 @@ open class HybridNitroNumberViewSpec_cxx { } } - public final var textAlign: bridge.std__optional_NitroNumberTextAlign_ { + public final var textAlignment: bridge.std__optional_NitroNumberTextAlign_ { @inline(__always) get { return { () -> bridge.std__optional_NitroNumberTextAlign_ in - if let __unwrappedValue = self.__implementation.textAlign { + if let __unwrappedValue = self.__implementation.textAlignment { return bridge.create_std__optional_NitroNumberTextAlign_(__unwrappedValue) } else { return .init() @@ -1635,7 +1635,7 @@ open class HybridNitroNumberViewSpec_cxx { } @inline(__always) set { - self.__implementation.textAlign = newValue.value + self.__implementation.textAlignment = newValue.value } } diff --git a/packages/react-native-nitro-input/nitrogen/generated/ios/swift/HybridNitroTextViewSpec.swift b/packages/react-native-nitro-input/nitrogen/generated/ios/swift/HybridNitroTextViewSpec.swift index 43b4cda..a2bf5ba 100644 --- a/packages/react-native-nitro-input/nitrogen/generated/ios/swift/HybridNitroTextViewSpec.swift +++ b/packages/react-native-nitro-input/nitrogen/generated/ios/swift/HybridNitroTextViewSpec.swift @@ -11,12 +11,12 @@ import NitroModules public protocol HybridNitroTextViewSpec_protocol: HybridObject, HybridView { // Properties var text: String { get set } - var fontSize: Double? { get set } - var fontWeight: Double? { get set } - var fontFamily: String? { get set } - var color: Double? { get set } - var letterSpacing: Double? { get set } - var textAlign: NitroNumberTextAlign? { get set } + var textSize: Double? { get set } + var textWeight: Double? { get set } + var textFamily: String? { get set } + var textColor: Double? { get set } + var textLetterSpacing: Double? { get set } + var textAlignment: NitroNumberTextAlign? { get set } var rightToLeft: Bool? { get set } var duration: Double? { get set } var easing: NitroInputEasing? { get set } diff --git a/packages/react-native-nitro-input/nitrogen/generated/ios/swift/HybridNitroTextViewSpec_cxx.swift b/packages/react-native-nitro-input/nitrogen/generated/ios/swift/HybridNitroTextViewSpec_cxx.swift index 6e06275..aa1c693 100644 --- a/packages/react-native-nitro-input/nitrogen/generated/ios/swift/HybridNitroTextViewSpec_cxx.swift +++ b/packages/react-native-nitro-input/nitrogen/generated/ios/swift/HybridNitroTextViewSpec_cxx.swift @@ -132,11 +132,11 @@ open class HybridNitroTextViewSpec_cxx { } } - public final var fontSize: bridge.std__optional_double_ { + public final var textSize: bridge.std__optional_double_ { @inline(__always) get { return { () -> bridge.std__optional_double_ in - if let __unwrappedValue = self.__implementation.fontSize { + if let __unwrappedValue = self.__implementation.textSize { return bridge.create_std__optional_double_(__unwrappedValue) } else { return .init() @@ -145,7 +145,7 @@ open class HybridNitroTextViewSpec_cxx { } @inline(__always) set { - self.__implementation.fontSize = { () -> Double? in + self.__implementation.textSize = { () -> Double? in if bridge.has_value_std__optional_double_(newValue) { let __unwrapped = bridge.get_std__optional_double_(newValue) return __unwrapped @@ -156,11 +156,11 @@ open class HybridNitroTextViewSpec_cxx { } } - public final var fontWeight: bridge.std__optional_double_ { + public final var textWeight: bridge.std__optional_double_ { @inline(__always) get { return { () -> bridge.std__optional_double_ in - if let __unwrappedValue = self.__implementation.fontWeight { + if let __unwrappedValue = self.__implementation.textWeight { return bridge.create_std__optional_double_(__unwrappedValue) } else { return .init() @@ -169,7 +169,7 @@ open class HybridNitroTextViewSpec_cxx { } @inline(__always) set { - self.__implementation.fontWeight = { () -> Double? in + self.__implementation.textWeight = { () -> Double? in if bridge.has_value_std__optional_double_(newValue) { let __unwrapped = bridge.get_std__optional_double_(newValue) return __unwrapped @@ -180,11 +180,11 @@ open class HybridNitroTextViewSpec_cxx { } } - public final var fontFamily: bridge.std__optional_std__string_ { + public final var textFamily: bridge.std__optional_std__string_ { @inline(__always) get { return { () -> bridge.std__optional_std__string_ in - if let __unwrappedValue = self.__implementation.fontFamily { + if let __unwrappedValue = self.__implementation.textFamily { return bridge.create_std__optional_std__string_(std.string(__unwrappedValue)) } else { return .init() @@ -193,7 +193,7 @@ open class HybridNitroTextViewSpec_cxx { } @inline(__always) set { - self.__implementation.fontFamily = { () -> String? in + self.__implementation.textFamily = { () -> String? in if bridge.has_value_std__optional_std__string_(newValue) { let __unwrapped = bridge.get_std__optional_std__string_(newValue) return String(__unwrapped) @@ -204,11 +204,11 @@ open class HybridNitroTextViewSpec_cxx { } } - public final var color: bridge.std__optional_double_ { + public final var textColor: bridge.std__optional_double_ { @inline(__always) get { return { () -> bridge.std__optional_double_ in - if let __unwrappedValue = self.__implementation.color { + if let __unwrappedValue = self.__implementation.textColor { return bridge.create_std__optional_double_(__unwrappedValue) } else { return .init() @@ -217,7 +217,7 @@ open class HybridNitroTextViewSpec_cxx { } @inline(__always) set { - self.__implementation.color = { () -> Double? in + self.__implementation.textColor = { () -> Double? in if bridge.has_value_std__optional_double_(newValue) { let __unwrapped = bridge.get_std__optional_double_(newValue) return __unwrapped @@ -228,11 +228,11 @@ open class HybridNitroTextViewSpec_cxx { } } - public final var letterSpacing: bridge.std__optional_double_ { + public final var textLetterSpacing: bridge.std__optional_double_ { @inline(__always) get { return { () -> bridge.std__optional_double_ in - if let __unwrappedValue = self.__implementation.letterSpacing { + if let __unwrappedValue = self.__implementation.textLetterSpacing { return bridge.create_std__optional_double_(__unwrappedValue) } else { return .init() @@ -241,7 +241,7 @@ open class HybridNitroTextViewSpec_cxx { } @inline(__always) set { - self.__implementation.letterSpacing = { () -> Double? in + self.__implementation.textLetterSpacing = { () -> Double? in if bridge.has_value_std__optional_double_(newValue) { let __unwrapped = bridge.get_std__optional_double_(newValue) return __unwrapped @@ -252,11 +252,11 @@ open class HybridNitroTextViewSpec_cxx { } } - public final var textAlign: bridge.std__optional_NitroNumberTextAlign_ { + public final var textAlignment: bridge.std__optional_NitroNumberTextAlign_ { @inline(__always) get { return { () -> bridge.std__optional_NitroNumberTextAlign_ in - if let __unwrappedValue = self.__implementation.textAlign { + if let __unwrappedValue = self.__implementation.textAlignment { return bridge.create_std__optional_NitroNumberTextAlign_(__unwrappedValue) } else { return .init() @@ -265,7 +265,7 @@ open class HybridNitroTextViewSpec_cxx { } @inline(__always) set { - self.__implementation.textAlign = newValue.value + self.__implementation.textAlignment = newValue.value } } diff --git a/packages/react-native-nitro-input/nitrogen/generated/ios/swift/NitroInputSizing.swift b/packages/react-native-nitro-input/nitrogen/generated/ios/swift/NitroInputSizing.swift index 963f474..1fe6888 100644 --- a/packages/react-native-nitro-input/nitrogen/generated/ios/swift/NitroInputSizing.swift +++ b/packages/react-native-nitro-input/nitrogen/generated/ios/swift/NitroInputSizing.swift @@ -18,7 +18,7 @@ public extension NitroInputSizing { /** * Create a new instance of `NitroInputSizing`. */ - init(text: String, mode: NitroInputMode, plain: Bool, multiline: Bool, secureTextEntry: Bool, maxLength: Double, fractionDigits: Double, maxIntegerDigits: Double, groupingSeparator: String, decimalSeparator: String, prefix: String, suffix: String, signPlacement: NitroInputSignPlacement, placeholder: String, mask: String, maskNotations: [NitroInputNotation], maskAutocomplete: Bool, maskAutoSkip: Bool, maskAffinityFormats: [String], maskAffinityStrategy: NitroInputMaskAffinity, maskTextCase: NitroInputTextCase, maskCharacterMap: [NitroInputCharacterMapping], maskSlotPlaceholder: String, keepPlaceholder: Bool, fontSize: Double, lineHeight: Double, prefixFontSize: Double, suffixFontSize: Double, fontWeight: Double, fontFamily: String, letterSpacing: Double, prefixSpacing: Double, suffixSpacing: Double, allowFontScaling: Bool, maxFontSizeMultiplier: Double, variant: NitroInputVariant, label: String, labelBehavior: NitroInputLabelBehavior, labelFontSize: Double, cornerRadius: Double) { + init(text: String, mode: NitroInputMode, plain: Bool, multiline: Bool, secureTextEntry: Bool, maxLength: Double, fractionDigits: Double, maxIntegerDigits: Double, groupingSeparator: String, decimalSeparator: String, prefix: String, suffix: String, signPlacement: NitroInputSignPlacement, placeholder: String, mask: String, maskNotations: [NitroInputNotation], maskAutocomplete: Bool, maskAutoSkip: Bool, maskAffinityFormats: [String], maskAffinityStrategy: NitroInputMaskAffinity, maskTextCase: NitroInputTextCase, maskCharacterMap: [NitroInputCharacterMapping], maskSlotPlaceholder: String, keepPlaceholder: Bool, textSize: Double, textLineHeight: Double, prefixFontSize: Double, suffixFontSize: Double, textWeight: Double, textFamily: String, textLetterSpacing: Double, prefixSpacing: Double, suffixSpacing: Double, allowFontScaling: Bool, maxFontSizeMultiplier: Double, variant: NitroInputVariant, label: String, labelBehavior: NitroInputLabelBehavior, labelFontSize: Double, cornerRadius: Double) { self.init(std.string(text), mode, plain, multiline, secureTextEntry, maxLength, fractionDigits, maxIntegerDigits, std.string(groupingSeparator), std.string(decimalSeparator), std.string(prefix), std.string(suffix), signPlacement, std.string(placeholder), std.string(mask), { () -> bridge.std__vector_NitroInputNotation_ in var __vector = bridge.create_std__vector_NitroInputNotation_(maskNotations.count) for __item in maskNotations { @@ -37,7 +37,7 @@ public extension NitroInputSizing { __vector.push_back(__item) } return __vector - }(), std.string(maskSlotPlaceholder), keepPlaceholder, fontSize, lineHeight, prefixFontSize, suffixFontSize, fontWeight, std.string(fontFamily), letterSpacing, prefixSpacing, suffixSpacing, allowFontScaling, maxFontSizeMultiplier, variant, std.string(label), labelBehavior, labelFontSize, cornerRadius) + }(), std.string(maskSlotPlaceholder), keepPlaceholder, textSize, textLineHeight, prefixFontSize, suffixFontSize, textWeight, std.string(textFamily), textLetterSpacing, prefixSpacing, suffixSpacing, allowFontScaling, maxFontSizeMultiplier, variant, std.string(label), labelBehavior, labelFontSize, cornerRadius) } @inline(__always) @@ -161,13 +161,13 @@ public extension NitroInputSizing { } @inline(__always) - var fontSize: Double { - return self.__fontSize + var textSize: Double { + return self.__textSize } @inline(__always) - var lineHeight: Double { - return self.__lineHeight + var textLineHeight: Double { + return self.__textLineHeight } @inline(__always) @@ -181,18 +181,18 @@ public extension NitroInputSizing { } @inline(__always) - var fontWeight: Double { - return self.__fontWeight + var textWeight: Double { + return self.__textWeight } @inline(__always) - var fontFamily: String { - return String(self.__fontFamily) + var textFamily: String { + return String(self.__textFamily) } @inline(__always) - var letterSpacing: Double { - return self.__letterSpacing + var textLetterSpacing: Double { + return self.__textLetterSpacing } @inline(__always) diff --git a/packages/react-native-nitro-input/nitrogen/generated/shared/c++/HybridNitroInputViewSpec.cpp b/packages/react-native-nitro-input/nitrogen/generated/shared/c++/HybridNitroInputViewSpec.cpp index 8f43623..44e7f97 100644 --- a/packages/react-native-nitro-input/nitrogen/generated/shared/c++/HybridNitroInputViewSpec.cpp +++ b/packages/react-native-nitro-input/nitrogen/generated/shared/c++/HybridNitroInputViewSpec.cpp @@ -86,8 +86,8 @@ namespace margelo::nitro::nitroinput { prototype.registerHybridSetter("prefixAlign", &HybridNitroInputViewSpec::setPrefixAlign); prototype.registerHybridGetter("suffixAlign", &HybridNitroInputViewSpec::getSuffixAlign); prototype.registerHybridSetter("suffixAlign", &HybridNitroInputViewSpec::setSuffixAlign); - prototype.registerHybridGetter("letterSpacing", &HybridNitroInputViewSpec::getLetterSpacing); - prototype.registerHybridSetter("letterSpacing", &HybridNitroInputViewSpec::setLetterSpacing); + prototype.registerHybridGetter("textLetterSpacing", &HybridNitroInputViewSpec::getTextLetterSpacing); + prototype.registerHybridSetter("textLetterSpacing", &HybridNitroInputViewSpec::setTextLetterSpacing); prototype.registerHybridGetter("prefixSpacing", &HybridNitroInputViewSpec::getPrefixSpacing); prototype.registerHybridSetter("prefixSpacing", &HybridNitroInputViewSpec::setPrefixSpacing); prototype.registerHybridGetter("suffixSpacing", &HybridNitroInputViewSpec::getSuffixSpacing); @@ -108,18 +108,18 @@ namespace margelo::nitro::nitroinput { prototype.registerHybridSetter("bounce", &HybridNitroInputViewSpec::setBounce); prototype.registerHybridGetter("effect", &HybridNitroInputViewSpec::getEffect); prototype.registerHybridSetter("effect", &HybridNitroInputViewSpec::setEffect); - prototype.registerHybridGetter("fontSize", &HybridNitroInputViewSpec::getFontSize); - prototype.registerHybridSetter("fontSize", &HybridNitroInputViewSpec::setFontSize); - prototype.registerHybridGetter("lineHeight", &HybridNitroInputViewSpec::getLineHeight); - prototype.registerHybridSetter("lineHeight", &HybridNitroInputViewSpec::setLineHeight); - prototype.registerHybridGetter("fontWeight", &HybridNitroInputViewSpec::getFontWeight); - prototype.registerHybridSetter("fontWeight", &HybridNitroInputViewSpec::setFontWeight); - prototype.registerHybridGetter("fontFamily", &HybridNitroInputViewSpec::getFontFamily); - prototype.registerHybridSetter("fontFamily", &HybridNitroInputViewSpec::setFontFamily); - prototype.registerHybridGetter("color", &HybridNitroInputViewSpec::getColor); - prototype.registerHybridSetter("color", &HybridNitroInputViewSpec::setColor); - prototype.registerHybridGetter("textAlign", &HybridNitroInputViewSpec::getTextAlign); - prototype.registerHybridSetter("textAlign", &HybridNitroInputViewSpec::setTextAlign); + prototype.registerHybridGetter("textSize", &HybridNitroInputViewSpec::getTextSize); + prototype.registerHybridSetter("textSize", &HybridNitroInputViewSpec::setTextSize); + prototype.registerHybridGetter("textLineHeight", &HybridNitroInputViewSpec::getTextLineHeight); + prototype.registerHybridSetter("textLineHeight", &HybridNitroInputViewSpec::setTextLineHeight); + prototype.registerHybridGetter("textWeight", &HybridNitroInputViewSpec::getTextWeight); + prototype.registerHybridSetter("textWeight", &HybridNitroInputViewSpec::setTextWeight); + prototype.registerHybridGetter("textFamily", &HybridNitroInputViewSpec::getTextFamily); + prototype.registerHybridSetter("textFamily", &HybridNitroInputViewSpec::setTextFamily); + prototype.registerHybridGetter("textColor", &HybridNitroInputViewSpec::getTextColor); + prototype.registerHybridSetter("textColor", &HybridNitroInputViewSpec::setTextColor); + prototype.registerHybridGetter("textAlignment", &HybridNitroInputViewSpec::getTextAlignment); + prototype.registerHybridSetter("textAlignment", &HybridNitroInputViewSpec::setTextAlignment); prototype.registerHybridGetter("rightToLeft", &HybridNitroInputViewSpec::getRightToLeft); prototype.registerHybridSetter("rightToLeft", &HybridNitroInputViewSpec::setRightToLeft); prototype.registerHybridGetter("caretColor", &HybridNitroInputViewSpec::getCaretColor); @@ -150,8 +150,16 @@ namespace margelo::nitro::nitroinput { prototype.registerHybridSetter("multiline", &HybridNitroInputViewSpec::setMultiline); prototype.registerHybridGetter("numberOfLines", &HybridNitroInputViewSpec::getNumberOfLines); prototype.registerHybridSetter("numberOfLines", &HybridNitroInputViewSpec::setNumberOfLines); - prototype.registerHybridGetter("textAlignVertical", &HybridNitroInputViewSpec::getTextAlignVertical); - prototype.registerHybridSetter("textAlignVertical", &HybridNitroInputViewSpec::setTextAlignVertical); + prototype.registerHybridGetter("textVerticalAlignment", &HybridNitroInputViewSpec::getTextVerticalAlignment); + prototype.registerHybridSetter("textVerticalAlignment", &HybridNitroInputViewSpec::setTextVerticalAlignment); + prototype.registerHybridGetter("textInsetLeft", &HybridNitroInputViewSpec::getTextInsetLeft); + prototype.registerHybridSetter("textInsetLeft", &HybridNitroInputViewSpec::setTextInsetLeft); + prototype.registerHybridGetter("textInsetTop", &HybridNitroInputViewSpec::getTextInsetTop); + prototype.registerHybridSetter("textInsetTop", &HybridNitroInputViewSpec::setTextInsetTop); + prototype.registerHybridGetter("textInsetRight", &HybridNitroInputViewSpec::getTextInsetRight); + prototype.registerHybridSetter("textInsetRight", &HybridNitroInputViewSpec::setTextInsetRight); + prototype.registerHybridGetter("textInsetBottom", &HybridNitroInputViewSpec::getTextInsetBottom); + prototype.registerHybridSetter("textInsetBottom", &HybridNitroInputViewSpec::setTextInsetBottom); prototype.registerHybridGetter("scrollEnabled", &HybridNitroInputViewSpec::getScrollEnabled); prototype.registerHybridSetter("scrollEnabled", &HybridNitroInputViewSpec::setScrollEnabled); prototype.registerHybridGetter("autoFocus", &HybridNitroInputViewSpec::getAutoFocus); diff --git a/packages/react-native-nitro-input/nitrogen/generated/shared/c++/HybridNitroInputViewSpec.hpp b/packages/react-native-nitro-input/nitrogen/generated/shared/c++/HybridNitroInputViewSpec.hpp index 0393994..9e84242 100644 --- a/packages/react-native-nitro-input/nitrogen/generated/shared/c++/HybridNitroInputViewSpec.hpp +++ b/packages/react-native-nitro-input/nitrogen/generated/shared/c++/HybridNitroInputViewSpec.hpp @@ -172,8 +172,8 @@ namespace margelo::nitro::nitroinput { virtual void setPrefixAlign(NitroInputAffixAlign prefixAlign) = 0; virtual NitroInputAffixAlign getSuffixAlign() = 0; virtual void setSuffixAlign(NitroInputAffixAlign suffixAlign) = 0; - virtual double getLetterSpacing() = 0; - virtual void setLetterSpacing(double letterSpacing) = 0; + virtual double getTextLetterSpacing() = 0; + virtual void setTextLetterSpacing(double textLetterSpacing) = 0; virtual double getPrefixSpacing() = 0; virtual void setPrefixSpacing(double prefixSpacing) = 0; virtual double getSuffixSpacing() = 0; @@ -194,18 +194,18 @@ namespace margelo::nitro::nitroinput { virtual void setBounce(double bounce) = 0; virtual NitroInputEffect getEffect() = 0; virtual void setEffect(NitroInputEffect effect) = 0; - virtual double getFontSize() = 0; - virtual void setFontSize(double fontSize) = 0; - virtual double getLineHeight() = 0; - virtual void setLineHeight(double lineHeight) = 0; - virtual double getFontWeight() = 0; - virtual void setFontWeight(double fontWeight) = 0; - virtual std::string getFontFamily() = 0; - virtual void setFontFamily(const std::string& fontFamily) = 0; - virtual double getColor() = 0; - virtual void setColor(double color) = 0; - virtual NitroInputTextAlign getTextAlign() = 0; - virtual void setTextAlign(NitroInputTextAlign textAlign) = 0; + virtual double getTextSize() = 0; + virtual void setTextSize(double textSize) = 0; + virtual double getTextLineHeight() = 0; + virtual void setTextLineHeight(double textLineHeight) = 0; + virtual double getTextWeight() = 0; + virtual void setTextWeight(double textWeight) = 0; + virtual std::string getTextFamily() = 0; + virtual void setTextFamily(const std::string& textFamily) = 0; + virtual double getTextColor() = 0; + virtual void setTextColor(double textColor) = 0; + virtual NitroInputTextAlign getTextAlignment() = 0; + virtual void setTextAlignment(NitroInputTextAlign textAlignment) = 0; virtual bool getRightToLeft() = 0; virtual void setRightToLeft(bool rightToLeft) = 0; virtual double getCaretColor() = 0; @@ -236,8 +236,16 @@ namespace margelo::nitro::nitroinput { virtual void setMultiline(bool multiline) = 0; virtual double getNumberOfLines() = 0; virtual void setNumberOfLines(double numberOfLines) = 0; - virtual NitroInputTextAlignVertical getTextAlignVertical() = 0; - virtual void setTextAlignVertical(NitroInputTextAlignVertical textAlignVertical) = 0; + virtual NitroInputTextAlignVertical getTextVerticalAlignment() = 0; + virtual void setTextVerticalAlignment(NitroInputTextAlignVertical textVerticalAlignment) = 0; + virtual double getTextInsetLeft() = 0; + virtual void setTextInsetLeft(double textInsetLeft) = 0; + virtual double getTextInsetTop() = 0; + virtual void setTextInsetTop(double textInsetTop) = 0; + virtual double getTextInsetRight() = 0; + virtual void setTextInsetRight(double textInsetRight) = 0; + virtual double getTextInsetBottom() = 0; + virtual void setTextInsetBottom(double textInsetBottom) = 0; virtual bool getScrollEnabled() = 0; virtual void setScrollEnabled(bool scrollEnabled) = 0; virtual bool getAutoFocus() = 0; diff --git a/packages/react-native-nitro-input/nitrogen/generated/shared/c++/HybridNitroNumberViewSpec.cpp b/packages/react-native-nitro-input/nitrogen/generated/shared/c++/HybridNitroNumberViewSpec.cpp index 03e7742..6a90be5 100644 --- a/packages/react-native-nitro-input/nitrogen/generated/shared/c++/HybridNitroNumberViewSpec.cpp +++ b/packages/react-native-nitro-input/nitrogen/generated/shared/c++/HybridNitroNumberViewSpec.cpp @@ -80,8 +80,8 @@ namespace margelo::nitro::nitroinput { prototype.registerHybridSetter("shimmerDirection", &HybridNitroNumberViewSpec::setShimmerDirection); prototype.registerHybridGetter("shimmerDelay", &HybridNitroNumberViewSpec::getShimmerDelay); prototype.registerHybridSetter("shimmerDelay", &HybridNitroNumberViewSpec::setShimmerDelay); - prototype.registerHybridGetter("fontSize", &HybridNitroNumberViewSpec::getFontSize); - prototype.registerHybridSetter("fontSize", &HybridNitroNumberViewSpec::setFontSize); + prototype.registerHybridGetter("textSize", &HybridNitroNumberViewSpec::getTextSize); + prototype.registerHybridSetter("textSize", &HybridNitroNumberViewSpec::setTextSize); prototype.registerHybridGetter("prefixFontSize", &HybridNitroNumberViewSpec::getPrefixFontSize); prototype.registerHybridSetter("prefixFontSize", &HybridNitroNumberViewSpec::setPrefixFontSize); prototype.registerHybridGetter("suffixFontSize", &HybridNitroNumberViewSpec::getSuffixFontSize); @@ -92,8 +92,8 @@ namespace margelo::nitro::nitroinput { prototype.registerHybridSetter("prefixAlign", &HybridNitroNumberViewSpec::setPrefixAlign); prototype.registerHybridGetter("suffixAlign", &HybridNitroNumberViewSpec::getSuffixAlign); prototype.registerHybridSetter("suffixAlign", &HybridNitroNumberViewSpec::setSuffixAlign); - prototype.registerHybridGetter("letterSpacing", &HybridNitroNumberViewSpec::getLetterSpacing); - prototype.registerHybridSetter("letterSpacing", &HybridNitroNumberViewSpec::setLetterSpacing); + prototype.registerHybridGetter("textLetterSpacing", &HybridNitroNumberViewSpec::getTextLetterSpacing); + prototype.registerHybridSetter("textLetterSpacing", &HybridNitroNumberViewSpec::setTextLetterSpacing); prototype.registerHybridGetter("prefixSpacing", &HybridNitroNumberViewSpec::getPrefixSpacing); prototype.registerHybridSetter("prefixSpacing", &HybridNitroNumberViewSpec::setPrefixSpacing); prototype.registerHybridGetter("suffixSpacing", &HybridNitroNumberViewSpec::getSuffixSpacing); @@ -138,14 +138,14 @@ namespace margelo::nitro::nitroinput { prototype.registerHybridSetter("allowFontScaling", &HybridNitroNumberViewSpec::setAllowFontScaling); prototype.registerHybridGetter("maxFontSizeMultiplier", &HybridNitroNumberViewSpec::getMaxFontSizeMultiplier); prototype.registerHybridSetter("maxFontSizeMultiplier", &HybridNitroNumberViewSpec::setMaxFontSizeMultiplier); - prototype.registerHybridGetter("fontWeight", &HybridNitroNumberViewSpec::getFontWeight); - prototype.registerHybridSetter("fontWeight", &HybridNitroNumberViewSpec::setFontWeight); - prototype.registerHybridGetter("fontFamily", &HybridNitroNumberViewSpec::getFontFamily); - prototype.registerHybridSetter("fontFamily", &HybridNitroNumberViewSpec::setFontFamily); - prototype.registerHybridGetter("color", &HybridNitroNumberViewSpec::getColor); - prototype.registerHybridSetter("color", &HybridNitroNumberViewSpec::setColor); - prototype.registerHybridGetter("textAlign", &HybridNitroNumberViewSpec::getTextAlign); - prototype.registerHybridSetter("textAlign", &HybridNitroNumberViewSpec::setTextAlign); + prototype.registerHybridGetter("textWeight", &HybridNitroNumberViewSpec::getTextWeight); + prototype.registerHybridSetter("textWeight", &HybridNitroNumberViewSpec::setTextWeight); + prototype.registerHybridGetter("textFamily", &HybridNitroNumberViewSpec::getTextFamily); + prototype.registerHybridSetter("textFamily", &HybridNitroNumberViewSpec::setTextFamily); + prototype.registerHybridGetter("textColor", &HybridNitroNumberViewSpec::getTextColor); + prototype.registerHybridSetter("textColor", &HybridNitroNumberViewSpec::setTextColor); + prototype.registerHybridGetter("textAlignment", &HybridNitroNumberViewSpec::getTextAlignment); + prototype.registerHybridSetter("textAlignment", &HybridNitroNumberViewSpec::setTextAlignment); prototype.registerHybridGetter("rightToLeft", &HybridNitroNumberViewSpec::getRightToLeft); prototype.registerHybridSetter("rightToLeft", &HybridNitroNumberViewSpec::setRightToLeft); prototype.registerHybridGetter("onSizeChange", &HybridNitroNumberViewSpec::getOnSizeChange); diff --git a/packages/react-native-nitro-input/nitrogen/generated/shared/c++/HybridNitroNumberViewSpec.hpp b/packages/react-native-nitro-input/nitrogen/generated/shared/c++/HybridNitroNumberViewSpec.hpp index d4c1c27..bc3be32 100644 --- a/packages/react-native-nitro-input/nitrogen/generated/shared/c++/HybridNitroNumberViewSpec.hpp +++ b/packages/react-native-nitro-input/nitrogen/generated/shared/c++/HybridNitroNumberViewSpec.hpp @@ -136,8 +136,8 @@ namespace margelo::nitro::nitroinput { virtual void setShimmerDirection(std::optional shimmerDirection) = 0; virtual std::optional getShimmerDelay() = 0; virtual void setShimmerDelay(std::optional shimmerDelay) = 0; - virtual std::optional getFontSize() = 0; - virtual void setFontSize(std::optional fontSize) = 0; + virtual std::optional getTextSize() = 0; + virtual void setTextSize(std::optional textSize) = 0; virtual std::optional getPrefixFontSize() = 0; virtual void setPrefixFontSize(std::optional prefixFontSize) = 0; virtual std::optional getSuffixFontSize() = 0; @@ -148,8 +148,8 @@ namespace margelo::nitro::nitroinput { virtual void setPrefixAlign(std::optional prefixAlign) = 0; virtual std::optional getSuffixAlign() = 0; virtual void setSuffixAlign(std::optional suffixAlign) = 0; - virtual std::optional getLetterSpacing() = 0; - virtual void setLetterSpacing(std::optional letterSpacing) = 0; + virtual std::optional getTextLetterSpacing() = 0; + virtual void setTextLetterSpacing(std::optional textLetterSpacing) = 0; virtual std::optional getPrefixSpacing() = 0; virtual void setPrefixSpacing(std::optional prefixSpacing) = 0; virtual std::optional getSuffixSpacing() = 0; @@ -194,14 +194,14 @@ namespace margelo::nitro::nitroinput { virtual void setAllowFontScaling(std::optional allowFontScaling) = 0; virtual std::optional getMaxFontSizeMultiplier() = 0; virtual void setMaxFontSizeMultiplier(std::optional maxFontSizeMultiplier) = 0; - virtual std::optional getFontWeight() = 0; - virtual void setFontWeight(std::optional fontWeight) = 0; - virtual std::optional getFontFamily() = 0; - virtual void setFontFamily(const std::optional& fontFamily) = 0; - virtual std::optional getColor() = 0; - virtual void setColor(std::optional color) = 0; - virtual std::optional getTextAlign() = 0; - virtual void setTextAlign(std::optional textAlign) = 0; + virtual std::optional getTextWeight() = 0; + virtual void setTextWeight(std::optional textWeight) = 0; + virtual std::optional getTextFamily() = 0; + virtual void setTextFamily(const std::optional& textFamily) = 0; + virtual std::optional getTextColor() = 0; + virtual void setTextColor(std::optional textColor) = 0; + virtual std::optional getTextAlignment() = 0; + virtual void setTextAlignment(std::optional textAlignment) = 0; virtual std::optional getRightToLeft() = 0; virtual void setRightToLeft(std::optional rightToLeft) = 0; virtual std::optional> getOnSizeChange() = 0; diff --git a/packages/react-native-nitro-input/nitrogen/generated/shared/c++/HybridNitroTextViewSpec.cpp b/packages/react-native-nitro-input/nitrogen/generated/shared/c++/HybridNitroTextViewSpec.cpp index b5cad2c..60fcb3e 100644 --- a/packages/react-native-nitro-input/nitrogen/generated/shared/c++/HybridNitroTextViewSpec.cpp +++ b/packages/react-native-nitro-input/nitrogen/generated/shared/c++/HybridNitroTextViewSpec.cpp @@ -16,18 +16,18 @@ namespace margelo::nitro::nitroinput { registerHybrids(this, [](Prototype& prototype) { prototype.registerHybridGetter("text", &HybridNitroTextViewSpec::getText); prototype.registerHybridSetter("text", &HybridNitroTextViewSpec::setText); - prototype.registerHybridGetter("fontSize", &HybridNitroTextViewSpec::getFontSize); - prototype.registerHybridSetter("fontSize", &HybridNitroTextViewSpec::setFontSize); - prototype.registerHybridGetter("fontWeight", &HybridNitroTextViewSpec::getFontWeight); - prototype.registerHybridSetter("fontWeight", &HybridNitroTextViewSpec::setFontWeight); - prototype.registerHybridGetter("fontFamily", &HybridNitroTextViewSpec::getFontFamily); - prototype.registerHybridSetter("fontFamily", &HybridNitroTextViewSpec::setFontFamily); - prototype.registerHybridGetter("color", &HybridNitroTextViewSpec::getColor); - prototype.registerHybridSetter("color", &HybridNitroTextViewSpec::setColor); - prototype.registerHybridGetter("letterSpacing", &HybridNitroTextViewSpec::getLetterSpacing); - prototype.registerHybridSetter("letterSpacing", &HybridNitroTextViewSpec::setLetterSpacing); - prototype.registerHybridGetter("textAlign", &HybridNitroTextViewSpec::getTextAlign); - prototype.registerHybridSetter("textAlign", &HybridNitroTextViewSpec::setTextAlign); + prototype.registerHybridGetter("textSize", &HybridNitroTextViewSpec::getTextSize); + prototype.registerHybridSetter("textSize", &HybridNitroTextViewSpec::setTextSize); + prototype.registerHybridGetter("textWeight", &HybridNitroTextViewSpec::getTextWeight); + prototype.registerHybridSetter("textWeight", &HybridNitroTextViewSpec::setTextWeight); + prototype.registerHybridGetter("textFamily", &HybridNitroTextViewSpec::getTextFamily); + prototype.registerHybridSetter("textFamily", &HybridNitroTextViewSpec::setTextFamily); + prototype.registerHybridGetter("textColor", &HybridNitroTextViewSpec::getTextColor); + prototype.registerHybridSetter("textColor", &HybridNitroTextViewSpec::setTextColor); + prototype.registerHybridGetter("textLetterSpacing", &HybridNitroTextViewSpec::getTextLetterSpacing); + prototype.registerHybridSetter("textLetterSpacing", &HybridNitroTextViewSpec::setTextLetterSpacing); + prototype.registerHybridGetter("textAlignment", &HybridNitroTextViewSpec::getTextAlignment); + prototype.registerHybridSetter("textAlignment", &HybridNitroTextViewSpec::setTextAlignment); prototype.registerHybridGetter("rightToLeft", &HybridNitroTextViewSpec::getRightToLeft); prototype.registerHybridSetter("rightToLeft", &HybridNitroTextViewSpec::setRightToLeft); prototype.registerHybridGetter("duration", &HybridNitroTextViewSpec::getDuration); diff --git a/packages/react-native-nitro-input/nitrogen/generated/shared/c++/HybridNitroTextViewSpec.hpp b/packages/react-native-nitro-input/nitrogen/generated/shared/c++/HybridNitroTextViewSpec.hpp index 730cee4..59c4d8a 100644 --- a/packages/react-native-nitro-input/nitrogen/generated/shared/c++/HybridNitroTextViewSpec.hpp +++ b/packages/react-native-nitro-input/nitrogen/generated/shared/c++/HybridNitroTextViewSpec.hpp @@ -58,18 +58,18 @@ namespace margelo::nitro::nitroinput { // Properties virtual std::string getText() = 0; virtual void setText(const std::string& text) = 0; - virtual std::optional getFontSize() = 0; - virtual void setFontSize(std::optional fontSize) = 0; - virtual std::optional getFontWeight() = 0; - virtual void setFontWeight(std::optional fontWeight) = 0; - virtual std::optional getFontFamily() = 0; - virtual void setFontFamily(const std::optional& fontFamily) = 0; - virtual std::optional getColor() = 0; - virtual void setColor(std::optional color) = 0; - virtual std::optional getLetterSpacing() = 0; - virtual void setLetterSpacing(std::optional letterSpacing) = 0; - virtual std::optional getTextAlign() = 0; - virtual void setTextAlign(std::optional textAlign) = 0; + virtual std::optional getTextSize() = 0; + virtual void setTextSize(std::optional textSize) = 0; + virtual std::optional getTextWeight() = 0; + virtual void setTextWeight(std::optional textWeight) = 0; + virtual std::optional getTextFamily() = 0; + virtual void setTextFamily(const std::optional& textFamily) = 0; + virtual std::optional getTextColor() = 0; + virtual void setTextColor(std::optional textColor) = 0; + virtual std::optional getTextLetterSpacing() = 0; + virtual void setTextLetterSpacing(std::optional textLetterSpacing) = 0; + virtual std::optional getTextAlignment() = 0; + virtual void setTextAlignment(std::optional textAlignment) = 0; virtual std::optional getRightToLeft() = 0; virtual void setRightToLeft(std::optional rightToLeft) = 0; virtual std::optional getDuration() = 0; diff --git a/packages/react-native-nitro-input/nitrogen/generated/shared/c++/NitroInputSizing.hpp b/packages/react-native-nitro-input/nitrogen/generated/shared/c++/NitroInputSizing.hpp index 4e187fc..580cab6 100644 --- a/packages/react-native-nitro-input/nitrogen/generated/shared/c++/NitroInputSizing.hpp +++ b/packages/react-native-nitro-input/nitrogen/generated/shared/c++/NitroInputSizing.hpp @@ -87,13 +87,13 @@ namespace margelo::nitro::nitroinput { std::vector maskCharacterMap SWIFT_PRIVATE; std::string maskSlotPlaceholder SWIFT_PRIVATE; bool keepPlaceholder SWIFT_PRIVATE; - double fontSize SWIFT_PRIVATE; - double lineHeight SWIFT_PRIVATE; + double textSize SWIFT_PRIVATE; + double textLineHeight SWIFT_PRIVATE; double prefixFontSize SWIFT_PRIVATE; double suffixFontSize SWIFT_PRIVATE; - double fontWeight SWIFT_PRIVATE; - std::string fontFamily SWIFT_PRIVATE; - double letterSpacing SWIFT_PRIVATE; + double textWeight SWIFT_PRIVATE; + std::string textFamily SWIFT_PRIVATE; + double textLetterSpacing SWIFT_PRIVATE; double prefixSpacing SWIFT_PRIVATE; double suffixSpacing SWIFT_PRIVATE; bool allowFontScaling SWIFT_PRIVATE; @@ -106,7 +106,7 @@ namespace margelo::nitro::nitroinput { public: NitroInputSizing() = default; - explicit NitroInputSizing(std::string text, NitroInputMode mode, bool plain, bool multiline, bool secureTextEntry, double maxLength, double fractionDigits, double maxIntegerDigits, std::string groupingSeparator, std::string decimalSeparator, std::string prefix, std::string suffix, NitroInputSignPlacement signPlacement, std::string placeholder, std::string mask, std::vector maskNotations, bool maskAutocomplete, bool maskAutoSkip, std::vector maskAffinityFormats, NitroInputMaskAffinity maskAffinityStrategy, NitroInputTextCase maskTextCase, std::vector maskCharacterMap, std::string maskSlotPlaceholder, bool keepPlaceholder, double fontSize, double lineHeight, double prefixFontSize, double suffixFontSize, double fontWeight, std::string fontFamily, double letterSpacing, double prefixSpacing, double suffixSpacing, bool allowFontScaling, double maxFontSizeMultiplier, NitroInputVariant variant, std::string label, NitroInputLabelBehavior labelBehavior, double labelFontSize, double cornerRadius): text(text), mode(mode), plain(plain), multiline(multiline), secureTextEntry(secureTextEntry), maxLength(maxLength), fractionDigits(fractionDigits), maxIntegerDigits(maxIntegerDigits), groupingSeparator(groupingSeparator), decimalSeparator(decimalSeparator), prefix(prefix), suffix(suffix), signPlacement(signPlacement), placeholder(placeholder), mask(mask), maskNotations(maskNotations), maskAutocomplete(maskAutocomplete), maskAutoSkip(maskAutoSkip), maskAffinityFormats(maskAffinityFormats), maskAffinityStrategy(maskAffinityStrategy), maskTextCase(maskTextCase), maskCharacterMap(maskCharacterMap), maskSlotPlaceholder(maskSlotPlaceholder), keepPlaceholder(keepPlaceholder), fontSize(fontSize), lineHeight(lineHeight), prefixFontSize(prefixFontSize), suffixFontSize(suffixFontSize), fontWeight(fontWeight), fontFamily(fontFamily), letterSpacing(letterSpacing), prefixSpacing(prefixSpacing), suffixSpacing(suffixSpacing), allowFontScaling(allowFontScaling), maxFontSizeMultiplier(maxFontSizeMultiplier), variant(variant), label(label), labelBehavior(labelBehavior), labelFontSize(labelFontSize), cornerRadius(cornerRadius) {} + explicit NitroInputSizing(std::string text, NitroInputMode mode, bool plain, bool multiline, bool secureTextEntry, double maxLength, double fractionDigits, double maxIntegerDigits, std::string groupingSeparator, std::string decimalSeparator, std::string prefix, std::string suffix, NitroInputSignPlacement signPlacement, std::string placeholder, std::string mask, std::vector maskNotations, bool maskAutocomplete, bool maskAutoSkip, std::vector maskAffinityFormats, NitroInputMaskAffinity maskAffinityStrategy, NitroInputTextCase maskTextCase, std::vector maskCharacterMap, std::string maskSlotPlaceholder, bool keepPlaceholder, double textSize, double textLineHeight, double prefixFontSize, double suffixFontSize, double textWeight, std::string textFamily, double textLetterSpacing, double prefixSpacing, double suffixSpacing, bool allowFontScaling, double maxFontSizeMultiplier, NitroInputVariant variant, std::string label, NitroInputLabelBehavior labelBehavior, double labelFontSize, double cornerRadius): text(text), mode(mode), plain(plain), multiline(multiline), secureTextEntry(secureTextEntry), maxLength(maxLength), fractionDigits(fractionDigits), maxIntegerDigits(maxIntegerDigits), groupingSeparator(groupingSeparator), decimalSeparator(decimalSeparator), prefix(prefix), suffix(suffix), signPlacement(signPlacement), placeholder(placeholder), mask(mask), maskNotations(maskNotations), maskAutocomplete(maskAutocomplete), maskAutoSkip(maskAutoSkip), maskAffinityFormats(maskAffinityFormats), maskAffinityStrategy(maskAffinityStrategy), maskTextCase(maskTextCase), maskCharacterMap(maskCharacterMap), maskSlotPlaceholder(maskSlotPlaceholder), keepPlaceholder(keepPlaceholder), textSize(textSize), textLineHeight(textLineHeight), prefixFontSize(prefixFontSize), suffixFontSize(suffixFontSize), textWeight(textWeight), textFamily(textFamily), textLetterSpacing(textLetterSpacing), prefixSpacing(prefixSpacing), suffixSpacing(suffixSpacing), allowFontScaling(allowFontScaling), maxFontSizeMultiplier(maxFontSizeMultiplier), variant(variant), label(label), labelBehavior(labelBehavior), labelFontSize(labelFontSize), cornerRadius(cornerRadius) {} public: friend bool operator==(const NitroInputSizing& lhs, const NitroInputSizing& rhs) = default; @@ -146,13 +146,13 @@ namespace margelo::nitro { JSIConverter>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "maskCharacterMap"))), JSIConverter::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "maskSlotPlaceholder"))), JSIConverter::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "keepPlaceholder"))), - JSIConverter::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "fontSize"))), - JSIConverter::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "lineHeight"))), + JSIConverter::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "textSize"))), + JSIConverter::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "textLineHeight"))), JSIConverter::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "prefixFontSize"))), JSIConverter::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "suffixFontSize"))), - JSIConverter::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "fontWeight"))), - JSIConverter::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "fontFamily"))), - JSIConverter::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "letterSpacing"))), + JSIConverter::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "textWeight"))), + JSIConverter::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "textFamily"))), + JSIConverter::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "textLetterSpacing"))), JSIConverter::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "prefixSpacing"))), JSIConverter::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "suffixSpacing"))), JSIConverter::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "allowFontScaling"))), @@ -190,13 +190,13 @@ namespace margelo::nitro { obj.setProperty(runtime, PropNameIDCache::get(runtime, "maskCharacterMap"), JSIConverter>::toJSI(runtime, arg.maskCharacterMap)); obj.setProperty(runtime, PropNameIDCache::get(runtime, "maskSlotPlaceholder"), JSIConverter::toJSI(runtime, arg.maskSlotPlaceholder)); obj.setProperty(runtime, PropNameIDCache::get(runtime, "keepPlaceholder"), JSIConverter::toJSI(runtime, arg.keepPlaceholder)); - obj.setProperty(runtime, PropNameIDCache::get(runtime, "fontSize"), JSIConverter::toJSI(runtime, arg.fontSize)); - obj.setProperty(runtime, PropNameIDCache::get(runtime, "lineHeight"), JSIConverter::toJSI(runtime, arg.lineHeight)); + obj.setProperty(runtime, PropNameIDCache::get(runtime, "textSize"), JSIConverter::toJSI(runtime, arg.textSize)); + obj.setProperty(runtime, PropNameIDCache::get(runtime, "textLineHeight"), JSIConverter::toJSI(runtime, arg.textLineHeight)); obj.setProperty(runtime, PropNameIDCache::get(runtime, "prefixFontSize"), JSIConverter::toJSI(runtime, arg.prefixFontSize)); obj.setProperty(runtime, PropNameIDCache::get(runtime, "suffixFontSize"), JSIConverter::toJSI(runtime, arg.suffixFontSize)); - obj.setProperty(runtime, PropNameIDCache::get(runtime, "fontWeight"), JSIConverter::toJSI(runtime, arg.fontWeight)); - obj.setProperty(runtime, PropNameIDCache::get(runtime, "fontFamily"), JSIConverter::toJSI(runtime, arg.fontFamily)); - obj.setProperty(runtime, PropNameIDCache::get(runtime, "letterSpacing"), JSIConverter::toJSI(runtime, arg.letterSpacing)); + obj.setProperty(runtime, PropNameIDCache::get(runtime, "textWeight"), JSIConverter::toJSI(runtime, arg.textWeight)); + obj.setProperty(runtime, PropNameIDCache::get(runtime, "textFamily"), JSIConverter::toJSI(runtime, arg.textFamily)); + obj.setProperty(runtime, PropNameIDCache::get(runtime, "textLetterSpacing"), JSIConverter::toJSI(runtime, arg.textLetterSpacing)); obj.setProperty(runtime, PropNameIDCache::get(runtime, "prefixSpacing"), JSIConverter::toJSI(runtime, arg.prefixSpacing)); obj.setProperty(runtime, PropNameIDCache::get(runtime, "suffixSpacing"), JSIConverter::toJSI(runtime, arg.suffixSpacing)); obj.setProperty(runtime, PropNameIDCache::get(runtime, "allowFontScaling"), JSIConverter::toJSI(runtime, arg.allowFontScaling)); @@ -240,13 +240,13 @@ namespace margelo::nitro { if (!JSIConverter>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "maskCharacterMap")))) return false; if (!JSIConverter::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "maskSlotPlaceholder")))) return false; if (!JSIConverter::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "keepPlaceholder")))) return false; - if (!JSIConverter::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "fontSize")))) return false; - if (!JSIConverter::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "lineHeight")))) return false; + if (!JSIConverter::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "textSize")))) return false; + if (!JSIConverter::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "textLineHeight")))) return false; if (!JSIConverter::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "prefixFontSize")))) return false; if (!JSIConverter::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "suffixFontSize")))) return false; - if (!JSIConverter::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "fontWeight")))) return false; - if (!JSIConverter::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "fontFamily")))) return false; - if (!JSIConverter::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "letterSpacing")))) return false; + if (!JSIConverter::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "textWeight")))) return false; + if (!JSIConverter::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "textFamily")))) return false; + if (!JSIConverter::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "textLetterSpacing")))) return false; if (!JSIConverter::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "prefixSpacing")))) return false; if (!JSIConverter::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "suffixSpacing")))) return false; if (!JSIConverter::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "allowFontScaling")))) return false; diff --git a/packages/react-native-nitro-input/nitrogen/generated/shared/c++/views/HybridNitroInputViewComponent.cpp b/packages/react-native-nitro-input/nitrogen/generated/shared/c++/views/HybridNitroInputViewComponent.cpp index 990d41d..df1702e 100644 --- a/packages/react-native-nitro-input/nitrogen/generated/shared/c++/views/HybridNitroInputViewComponent.cpp +++ b/packages/react-native-nitro-input/nitrogen/generated/shared/c++/views/HybridNitroInputViewComponent.cpp @@ -56,7 +56,7 @@ namespace margelo::nitro::nitroinput::views { signPlacement(nitro::ReactProp::fromRawValue("NitroInputView", "signPlacement", rawProps, sourceProps.signPlacement)), prefixAlign(nitro::ReactProp::fromRawValue("NitroInputView", "prefixAlign", rawProps, sourceProps.prefixAlign)), suffixAlign(nitro::ReactProp::fromRawValue("NitroInputView", "suffixAlign", rawProps, sourceProps.suffixAlign)), - letterSpacing(nitro::ReactProp::fromRawValue("NitroInputView", "letterSpacing", rawProps, sourceProps.letterSpacing)), + textLetterSpacing(nitro::ReactProp::fromRawValue("NitroInputView", "textLetterSpacing", rawProps, sourceProps.textLetterSpacing)), prefixSpacing(nitro::ReactProp::fromRawValue("NitroInputView", "prefixSpacing", rawProps, sourceProps.prefixSpacing)), suffixSpacing(nitro::ReactProp::fromRawValue("NitroInputView", "suffixSpacing", rawProps, sourceProps.suffixSpacing)), prefixOffset(nitro::ReactProp::fromRawValue("NitroInputView", "prefixOffset", rawProps, sourceProps.prefixOffset)), @@ -67,12 +67,12 @@ namespace margelo::nitro::nitroinput::views { easing(nitro::ReactProp::fromRawValue("NitroInputView", "easing", rawProps, sourceProps.easing)), bounce(nitro::ReactProp::fromRawValue("NitroInputView", "bounce", rawProps, sourceProps.bounce)), effect(nitro::ReactProp::fromRawValue("NitroInputView", "effect", rawProps, sourceProps.effect)), - fontSize(nitro::ReactProp::fromRawValue("NitroInputView", "fontSize", rawProps, sourceProps.fontSize)), - lineHeight(nitro::ReactProp::fromRawValue("NitroInputView", "lineHeight", rawProps, sourceProps.lineHeight)), - fontWeight(nitro::ReactProp::fromRawValue("NitroInputView", "fontWeight", rawProps, sourceProps.fontWeight)), - fontFamily(nitro::ReactProp::fromRawValue("NitroInputView", "fontFamily", rawProps, sourceProps.fontFamily)), - color(nitro::ReactProp::fromRawValue("NitroInputView", "color", rawProps, sourceProps.color)), - textAlign(nitro::ReactProp::fromRawValue("NitroInputView", "textAlign", rawProps, sourceProps.textAlign)), + textSize(nitro::ReactProp::fromRawValue("NitroInputView", "textSize", rawProps, sourceProps.textSize)), + textLineHeight(nitro::ReactProp::fromRawValue("NitroInputView", "textLineHeight", rawProps, sourceProps.textLineHeight)), + textWeight(nitro::ReactProp::fromRawValue("NitroInputView", "textWeight", rawProps, sourceProps.textWeight)), + textFamily(nitro::ReactProp::fromRawValue("NitroInputView", "textFamily", rawProps, sourceProps.textFamily)), + textColor(nitro::ReactProp::fromRawValue("NitroInputView", "textColor", rawProps, sourceProps.textColor)), + textAlignment(nitro::ReactProp::fromRawValue("NitroInputView", "textAlignment", rawProps, sourceProps.textAlignment)), rightToLeft(nitro::ReactProp::fromRawValue("NitroInputView", "rightToLeft", rawProps, sourceProps.rightToLeft)), caretColor(nitro::ReactProp::fromRawValue("NitroInputView", "caretColor", rawProps, sourceProps.caretColor)), selectionColor(nitro::ReactProp::fromRawValue("NitroInputView", "selectionColor", rawProps, sourceProps.selectionColor)), @@ -88,7 +88,11 @@ namespace margelo::nitro::nitroinput::views { editable(nitro::ReactProp::fromRawValue("NitroInputView", "editable", rawProps, sourceProps.editable)), multiline(nitro::ReactProp::fromRawValue("NitroInputView", "multiline", rawProps, sourceProps.multiline)), numberOfLines(nitro::ReactProp::fromRawValue("NitroInputView", "numberOfLines", rawProps, sourceProps.numberOfLines)), - textAlignVertical(nitro::ReactProp::fromRawValue("NitroInputView", "textAlignVertical", rawProps, sourceProps.textAlignVertical)), + textVerticalAlignment(nitro::ReactProp::fromRawValue("NitroInputView", "textVerticalAlignment", rawProps, sourceProps.textVerticalAlignment)), + textInsetLeft(nitro::ReactProp::fromRawValue("NitroInputView", "textInsetLeft", rawProps, sourceProps.textInsetLeft)), + textInsetTop(nitro::ReactProp::fromRawValue("NitroInputView", "textInsetTop", rawProps, sourceProps.textInsetTop)), + textInsetRight(nitro::ReactProp::fromRawValue("NitroInputView", "textInsetRight", rawProps, sourceProps.textInsetRight)), + textInsetBottom(nitro::ReactProp::fromRawValue("NitroInputView", "textInsetBottom", rawProps, sourceProps.textInsetBottom)), scrollEnabled(nitro::ReactProp::fromRawValue("NitroInputView", "scrollEnabled", rawProps, sourceProps.scrollEnabled)), autoFocus(nitro::ReactProp::fromRawValue("NitroInputView", "autoFocus", rawProps, sourceProps.autoFocus)), fieldTestID(nitro::ReactProp::fromRawValue("NitroInputView", "fieldTestID", rawProps, sourceProps.fieldTestID)), @@ -165,7 +169,7 @@ namespace margelo::nitro::nitroinput::views { case hashString("signPlacement"): return true; case hashString("prefixAlign"): return true; case hashString("suffixAlign"): return true; - case hashString("letterSpacing"): return true; + case hashString("textLetterSpacing"): return true; case hashString("prefixSpacing"): return true; case hashString("suffixSpacing"): return true; case hashString("prefixOffset"): return true; @@ -176,12 +180,12 @@ namespace margelo::nitro::nitroinput::views { case hashString("easing"): return true; case hashString("bounce"): return true; case hashString("effect"): return true; - case hashString("fontSize"): return true; - case hashString("lineHeight"): return true; - case hashString("fontWeight"): return true; - case hashString("fontFamily"): return true; - case hashString("color"): return true; - case hashString("textAlign"): return true; + case hashString("textSize"): return true; + case hashString("textLineHeight"): return true; + case hashString("textWeight"): return true; + case hashString("textFamily"): return true; + case hashString("textColor"): return true; + case hashString("textAlignment"): return true; case hashString("rightToLeft"): return true; case hashString("caretColor"): return true; case hashString("selectionColor"): return true; @@ -197,7 +201,11 @@ namespace margelo::nitro::nitroinput::views { case hashString("editable"): return true; case hashString("multiline"): return true; case hashString("numberOfLines"): return true; - case hashString("textAlignVertical"): return true; + case hashString("textVerticalAlignment"): return true; + case hashString("textInsetLeft"): return true; + case hashString("textInsetTop"): return true; + case hashString("textInsetRight"): return true; + case hashString("textInsetBottom"): return true; case hashString("scrollEnabled"): return true; case hashString("autoFocus"): return true; case hashString("fieldTestID"): return true; diff --git a/packages/react-native-nitro-input/nitrogen/generated/shared/c++/views/HybridNitroInputViewComponent.hpp b/packages/react-native-nitro-input/nitrogen/generated/shared/c++/views/HybridNitroInputViewComponent.hpp index cd42470..3eb41d3 100644 --- a/packages/react-native-nitro-input/nitrogen/generated/shared/c++/views/HybridNitroInputViewComponent.hpp +++ b/packages/react-native-nitro-input/nitrogen/generated/shared/c++/views/HybridNitroInputViewComponent.hpp @@ -98,7 +98,7 @@ namespace margelo::nitro::nitroinput::views { nitro::ReactProp signPlacement; nitro::ReactProp prefixAlign; nitro::ReactProp suffixAlign; - nitro::ReactProp letterSpacing; + nitro::ReactProp textLetterSpacing; nitro::ReactProp prefixSpacing; nitro::ReactProp suffixSpacing; nitro::ReactProp prefixOffset; @@ -109,12 +109,12 @@ namespace margelo::nitro::nitroinput::views { nitro::ReactProp easing; nitro::ReactProp bounce; nitro::ReactProp effect; - nitro::ReactProp fontSize; - nitro::ReactProp lineHeight; - nitro::ReactProp fontWeight; - nitro::ReactProp fontFamily; - nitro::ReactProp color; - nitro::ReactProp textAlign; + nitro::ReactProp textSize; + nitro::ReactProp textLineHeight; + nitro::ReactProp textWeight; + nitro::ReactProp textFamily; + nitro::ReactProp textColor; + nitro::ReactProp textAlignment; nitro::ReactProp rightToLeft; nitro::ReactProp caretColor; nitro::ReactProp selectionColor; @@ -130,7 +130,11 @@ namespace margelo::nitro::nitroinput::views { nitro::ReactProp editable; nitro::ReactProp multiline; nitro::ReactProp numberOfLines; - nitro::ReactProp textAlignVertical; + nitro::ReactProp textVerticalAlignment; + nitro::ReactProp textInsetLeft; + nitro::ReactProp textInsetTop; + nitro::ReactProp textInsetRight; + nitro::ReactProp textInsetBottom; nitro::ReactProp scrollEnabled; nitro::ReactProp autoFocus; nitro::ReactProp fieldTestID; @@ -207,7 +211,7 @@ namespace margelo::nitro::nitroinput::views { signPlacement.hasSameValue(other.signPlacement) && prefixAlign.hasSameValue(other.prefixAlign) && suffixAlign.hasSameValue(other.suffixAlign) && - letterSpacing.hasSameValue(other.letterSpacing) && + textLetterSpacing.hasSameValue(other.textLetterSpacing) && prefixSpacing.hasSameValue(other.prefixSpacing) && suffixSpacing.hasSameValue(other.suffixSpacing) && prefixOffset.hasSameValue(other.prefixOffset) && @@ -218,12 +222,12 @@ namespace margelo::nitro::nitroinput::views { easing.hasSameValue(other.easing) && bounce.hasSameValue(other.bounce) && effect.hasSameValue(other.effect) && - fontSize.hasSameValue(other.fontSize) && - lineHeight.hasSameValue(other.lineHeight) && - fontWeight.hasSameValue(other.fontWeight) && - fontFamily.hasSameValue(other.fontFamily) && - color.hasSameValue(other.color) && - textAlign.hasSameValue(other.textAlign) && + textSize.hasSameValue(other.textSize) && + textLineHeight.hasSameValue(other.textLineHeight) && + textWeight.hasSameValue(other.textWeight) && + textFamily.hasSameValue(other.textFamily) && + textColor.hasSameValue(other.textColor) && + textAlignment.hasSameValue(other.textAlignment) && rightToLeft.hasSameValue(other.rightToLeft) && caretColor.hasSameValue(other.caretColor) && selectionColor.hasSameValue(other.selectionColor) && @@ -239,7 +243,11 @@ namespace margelo::nitro::nitroinput::views { editable.hasSameValue(other.editable) && multiline.hasSameValue(other.multiline) && numberOfLines.hasSameValue(other.numberOfLines) && - textAlignVertical.hasSameValue(other.textAlignVertical) && + textVerticalAlignment.hasSameValue(other.textVerticalAlignment) && + textInsetLeft.hasSameValue(other.textInsetLeft) && + textInsetTop.hasSameValue(other.textInsetTop) && + textInsetRight.hasSameValue(other.textInsetRight) && + textInsetBottom.hasSameValue(other.textInsetBottom) && scrollEnabled.hasSameValue(other.scrollEnabled) && autoFocus.hasSameValue(other.autoFocus) && fieldTestID.hasSameValue(other.fieldTestID) && @@ -317,7 +325,7 @@ namespace margelo::nitro::nitroinput::views { signPlacement.isProvided() || prefixAlign.isProvided() || suffixAlign.isProvided() || - letterSpacing.isProvided() || + textLetterSpacing.isProvided() || prefixSpacing.isProvided() || suffixSpacing.isProvided() || prefixOffset.isProvided() || @@ -328,12 +336,12 @@ namespace margelo::nitro::nitroinput::views { easing.isProvided() || bounce.isProvided() || effect.isProvided() || - fontSize.isProvided() || - lineHeight.isProvided() || - fontWeight.isProvided() || - fontFamily.isProvided() || - color.isProvided() || - textAlign.isProvided() || + textSize.isProvided() || + textLineHeight.isProvided() || + textWeight.isProvided() || + textFamily.isProvided() || + textColor.isProvided() || + textAlignment.isProvided() || rightToLeft.isProvided() || caretColor.isProvided() || selectionColor.isProvided() || @@ -349,7 +357,11 @@ namespace margelo::nitro::nitroinput::views { editable.isProvided() || multiline.isProvided() || numberOfLines.isProvided() || - textAlignVertical.isProvided() || + textVerticalAlignment.isProvided() || + textInsetLeft.isProvided() || + textInsetTop.isProvided() || + textInsetRight.isProvided() || + textInsetBottom.isProvided() || scrollEnabled.isProvided() || autoFocus.isProvided() || fieldTestID.isProvided() || diff --git a/packages/react-native-nitro-input/nitrogen/generated/shared/c++/views/HybridNitroNumberViewComponent.cpp b/packages/react-native-nitro-input/nitrogen/generated/shared/c++/views/HybridNitroNumberViewComponent.cpp index bec9924..71eb5b1 100644 --- a/packages/react-native-nitro-input/nitrogen/generated/shared/c++/views/HybridNitroNumberViewComponent.cpp +++ b/packages/react-native-nitro-input/nitrogen/generated/shared/c++/views/HybridNitroNumberViewComponent.cpp @@ -53,13 +53,13 @@ namespace margelo::nitro::nitroinput::views { shimmerBaseColor(nitro::ReactProp>::fromRawValue("NitroNumberView", "shimmerBaseColor", rawProps, sourceProps.shimmerBaseColor)), shimmerDirection(nitro::ReactProp>::fromRawValue("NitroNumberView", "shimmerDirection", rawProps, sourceProps.shimmerDirection)), shimmerDelay(nitro::ReactProp>::fromRawValue("NitroNumberView", "shimmerDelay", rawProps, sourceProps.shimmerDelay)), - fontSize(nitro::ReactProp>::fromRawValue("NitroNumberView", "fontSize", rawProps, sourceProps.fontSize)), + textSize(nitro::ReactProp>::fromRawValue("NitroNumberView", "textSize", rawProps, sourceProps.textSize)), prefixFontSize(nitro::ReactProp>::fromRawValue("NitroNumberView", "prefixFontSize", rawProps, sourceProps.prefixFontSize)), suffixFontSize(nitro::ReactProp>::fromRawValue("NitroNumberView", "suffixFontSize", rawProps, sourceProps.suffixFontSize)), affixAlign(nitro::ReactProp>::fromRawValue("NitroNumberView", "affixAlign", rawProps, sourceProps.affixAlign)), prefixAlign(nitro::ReactProp>::fromRawValue("NitroNumberView", "prefixAlign", rawProps, sourceProps.prefixAlign)), suffixAlign(nitro::ReactProp>::fromRawValue("NitroNumberView", "suffixAlign", rawProps, sourceProps.suffixAlign)), - letterSpacing(nitro::ReactProp>::fromRawValue("NitroNumberView", "letterSpacing", rawProps, sourceProps.letterSpacing)), + textLetterSpacing(nitro::ReactProp>::fromRawValue("NitroNumberView", "textLetterSpacing", rawProps, sourceProps.textLetterSpacing)), prefixSpacing(nitro::ReactProp>::fromRawValue("NitroNumberView", "prefixSpacing", rawProps, sourceProps.prefixSpacing)), suffixSpacing(nitro::ReactProp>::fromRawValue("NitroNumberView", "suffixSpacing", rawProps, sourceProps.suffixSpacing)), prefixOffset(nitro::ReactProp>::fromRawValue("NitroNumberView", "prefixOffset", rawProps, sourceProps.prefixOffset)), @@ -82,10 +82,10 @@ namespace margelo::nitro::nitroinput::views { minimumFontScale(nitro::ReactProp>::fromRawValue("NitroNumberView", "minimumFontScale", rawProps, sourceProps.minimumFontScale)), allowFontScaling(nitro::ReactProp>::fromRawValue("NitroNumberView", "allowFontScaling", rawProps, sourceProps.allowFontScaling)), maxFontSizeMultiplier(nitro::ReactProp>::fromRawValue("NitroNumberView", "maxFontSizeMultiplier", rawProps, sourceProps.maxFontSizeMultiplier)), - fontWeight(nitro::ReactProp>::fromRawValue("NitroNumberView", "fontWeight", rawProps, sourceProps.fontWeight)), - fontFamily(nitro::ReactProp>::fromRawValue("NitroNumberView", "fontFamily", rawProps, sourceProps.fontFamily)), - color(nitro::ReactProp>::fromRawValue("NitroNumberView", "color", rawProps, sourceProps.color)), - textAlign(nitro::ReactProp>::fromRawValue("NitroNumberView", "textAlign", rawProps, sourceProps.textAlign)), + textWeight(nitro::ReactProp>::fromRawValue("NitroNumberView", "textWeight", rawProps, sourceProps.textWeight)), + textFamily(nitro::ReactProp>::fromRawValue("NitroNumberView", "textFamily", rawProps, sourceProps.textFamily)), + textColor(nitro::ReactProp>::fromRawValue("NitroNumberView", "textColor", rawProps, sourceProps.textColor)), + textAlignment(nitro::ReactProp>::fromRawValue("NitroNumberView", "textAlignment", rawProps, sourceProps.textAlignment)), rightToLeft(nitro::ReactProp>::fromRawValue("NitroNumberView", "rightToLeft", rawProps, sourceProps.rightToLeft)), onSizeChange(nitro::ReactProp>>::fromRawValue("NitroNumberView", "onSizeChange", rawProps, sourceProps.onSizeChange)), onRevealEnd(nitro::ReactProp>>::fromRawValue("NitroNumberView", "onRevealEnd", rawProps, sourceProps.onRevealEnd)), @@ -129,13 +129,13 @@ namespace margelo::nitro::nitroinput::views { case hashString("shimmerBaseColor"): return true; case hashString("shimmerDirection"): return true; case hashString("shimmerDelay"): return true; - case hashString("fontSize"): return true; + case hashString("textSize"): return true; case hashString("prefixFontSize"): return true; case hashString("suffixFontSize"): return true; case hashString("affixAlign"): return true; case hashString("prefixAlign"): return true; case hashString("suffixAlign"): return true; - case hashString("letterSpacing"): return true; + case hashString("textLetterSpacing"): return true; case hashString("prefixSpacing"): return true; case hashString("suffixSpacing"): return true; case hashString("prefixOffset"): return true; @@ -158,10 +158,10 @@ namespace margelo::nitro::nitroinput::views { case hashString("minimumFontScale"): return true; case hashString("allowFontScaling"): return true; case hashString("maxFontSizeMultiplier"): return true; - case hashString("fontWeight"): return true; - case hashString("fontFamily"): return true; - case hashString("color"): return true; - case hashString("textAlign"): return true; + case hashString("textWeight"): return true; + case hashString("textFamily"): return true; + case hashString("textColor"): return true; + case hashString("textAlignment"): return true; case hashString("rightToLeft"): return true; case hashString("onSizeChange"): return true; case hashString("onRevealEnd"): return true; diff --git a/packages/react-native-nitro-input/nitrogen/generated/shared/c++/views/HybridNitroNumberViewComponent.hpp b/packages/react-native-nitro-input/nitrogen/generated/shared/c++/views/HybridNitroNumberViewComponent.hpp index 0d154b6..d786146 100644 --- a/packages/react-native-nitro-input/nitrogen/generated/shared/c++/views/HybridNitroNumberViewComponent.hpp +++ b/packages/react-native-nitro-input/nitrogen/generated/shared/c++/views/HybridNitroNumberViewComponent.hpp @@ -85,13 +85,13 @@ namespace margelo::nitro::nitroinput::views { nitro::ReactProp> shimmerBaseColor; nitro::ReactProp> shimmerDirection; nitro::ReactProp> shimmerDelay; - nitro::ReactProp> fontSize; + nitro::ReactProp> textSize; nitro::ReactProp> prefixFontSize; nitro::ReactProp> suffixFontSize; nitro::ReactProp> affixAlign; nitro::ReactProp> prefixAlign; nitro::ReactProp> suffixAlign; - nitro::ReactProp> letterSpacing; + nitro::ReactProp> textLetterSpacing; nitro::ReactProp> prefixSpacing; nitro::ReactProp> suffixSpacing; nitro::ReactProp> prefixOffset; @@ -114,10 +114,10 @@ namespace margelo::nitro::nitroinput::views { nitro::ReactProp> minimumFontScale; nitro::ReactProp> allowFontScaling; nitro::ReactProp> maxFontSizeMultiplier; - nitro::ReactProp> fontWeight; - nitro::ReactProp> fontFamily; - nitro::ReactProp> color; - nitro::ReactProp> textAlign; + nitro::ReactProp> textWeight; + nitro::ReactProp> textFamily; + nitro::ReactProp> textColor; + nitro::ReactProp> textAlignment; nitro::ReactProp> rightToLeft; nitro::ReactProp>> onSizeChange; nitro::ReactProp>> onRevealEnd; @@ -161,13 +161,13 @@ namespace margelo::nitro::nitroinput::views { shimmerBaseColor.hasSameValue(other.shimmerBaseColor) && shimmerDirection.hasSameValue(other.shimmerDirection) && shimmerDelay.hasSameValue(other.shimmerDelay) && - fontSize.hasSameValue(other.fontSize) && + textSize.hasSameValue(other.textSize) && prefixFontSize.hasSameValue(other.prefixFontSize) && suffixFontSize.hasSameValue(other.suffixFontSize) && affixAlign.hasSameValue(other.affixAlign) && prefixAlign.hasSameValue(other.prefixAlign) && suffixAlign.hasSameValue(other.suffixAlign) && - letterSpacing.hasSameValue(other.letterSpacing) && + textLetterSpacing.hasSameValue(other.textLetterSpacing) && prefixSpacing.hasSameValue(other.prefixSpacing) && suffixSpacing.hasSameValue(other.suffixSpacing) && prefixOffset.hasSameValue(other.prefixOffset) && @@ -190,10 +190,10 @@ namespace margelo::nitro::nitroinput::views { minimumFontScale.hasSameValue(other.minimumFontScale) && allowFontScaling.hasSameValue(other.allowFontScaling) && maxFontSizeMultiplier.hasSameValue(other.maxFontSizeMultiplier) && - fontWeight.hasSameValue(other.fontWeight) && - fontFamily.hasSameValue(other.fontFamily) && - color.hasSameValue(other.color) && - textAlign.hasSameValue(other.textAlign) && + textWeight.hasSameValue(other.textWeight) && + textFamily.hasSameValue(other.textFamily) && + textColor.hasSameValue(other.textColor) && + textAlignment.hasSameValue(other.textAlignment) && rightToLeft.hasSameValue(other.rightToLeft) && onSizeChange.hasSameValue(other.onSizeChange) && onRevealEnd.hasSameValue(other.onRevealEnd) && @@ -238,13 +238,13 @@ namespace margelo::nitro::nitroinput::views { shimmerBaseColor.isProvided() || shimmerDirection.isProvided() || shimmerDelay.isProvided() || - fontSize.isProvided() || + textSize.isProvided() || prefixFontSize.isProvided() || suffixFontSize.isProvided() || affixAlign.isProvided() || prefixAlign.isProvided() || suffixAlign.isProvided() || - letterSpacing.isProvided() || + textLetterSpacing.isProvided() || prefixSpacing.isProvided() || suffixSpacing.isProvided() || prefixOffset.isProvided() || @@ -267,10 +267,10 @@ namespace margelo::nitro::nitroinput::views { minimumFontScale.isProvided() || allowFontScaling.isProvided() || maxFontSizeMultiplier.isProvided() || - fontWeight.isProvided() || - fontFamily.isProvided() || - color.isProvided() || - textAlign.isProvided() || + textWeight.isProvided() || + textFamily.isProvided() || + textColor.isProvided() || + textAlignment.isProvided() || rightToLeft.isProvided() || onSizeChange.isProvided() || onRevealEnd.isProvided() || diff --git a/packages/react-native-nitro-input/nitrogen/generated/shared/c++/views/HybridNitroTextViewComponent.cpp b/packages/react-native-nitro-input/nitrogen/generated/shared/c++/views/HybridNitroTextViewComponent.cpp index 9c240ab..0ee17c4 100644 --- a/packages/react-native-nitro-input/nitrogen/generated/shared/c++/views/HybridNitroTextViewComponent.cpp +++ b/packages/react-native-nitro-input/nitrogen/generated/shared/c++/views/HybridNitroTextViewComponent.cpp @@ -21,12 +21,12 @@ namespace margelo::nitro::nitroinput::views { const react::RawProps& rawProps): react::ViewProps(context, sourceProps, rawProps, filterObjectKeys), text(nitro::ReactProp::fromRawValue("NitroTextView", "text", rawProps, sourceProps.text)), - fontSize(nitro::ReactProp>::fromRawValue("NitroTextView", "fontSize", rawProps, sourceProps.fontSize)), - fontWeight(nitro::ReactProp>::fromRawValue("NitroTextView", "fontWeight", rawProps, sourceProps.fontWeight)), - fontFamily(nitro::ReactProp>::fromRawValue("NitroTextView", "fontFamily", rawProps, sourceProps.fontFamily)), - color(nitro::ReactProp>::fromRawValue("NitroTextView", "color", rawProps, sourceProps.color)), - letterSpacing(nitro::ReactProp>::fromRawValue("NitroTextView", "letterSpacing", rawProps, sourceProps.letterSpacing)), - textAlign(nitro::ReactProp>::fromRawValue("NitroTextView", "textAlign", rawProps, sourceProps.textAlign)), + textSize(nitro::ReactProp>::fromRawValue("NitroTextView", "textSize", rawProps, sourceProps.textSize)), + textWeight(nitro::ReactProp>::fromRawValue("NitroTextView", "textWeight", rawProps, sourceProps.textWeight)), + textFamily(nitro::ReactProp>::fromRawValue("NitroTextView", "textFamily", rawProps, sourceProps.textFamily)), + textColor(nitro::ReactProp>::fromRawValue("NitroTextView", "textColor", rawProps, sourceProps.textColor)), + textLetterSpacing(nitro::ReactProp>::fromRawValue("NitroTextView", "textLetterSpacing", rawProps, sourceProps.textLetterSpacing)), + textAlignment(nitro::ReactProp>::fromRawValue("NitroTextView", "textAlignment", rawProps, sourceProps.textAlignment)), rightToLeft(nitro::ReactProp>::fromRawValue("NitroTextView", "rightToLeft", rawProps, sourceProps.rightToLeft)), duration(nitro::ReactProp>::fromRawValue("NitroTextView", "duration", rawProps, sourceProps.duration)), easing(nitro::ReactProp>::fromRawValue("NitroTextView", "easing", rawProps, sourceProps.easing)), @@ -46,12 +46,12 @@ namespace margelo::nitro::nitroinput::views { bool HybridNitroTextViewProps::filterObjectKeys(const std::string& propName) { switch (hashString(propName)) { case hashString("text"): return true; - case hashString("fontSize"): return true; - case hashString("fontWeight"): return true; - case hashString("fontFamily"): return true; - case hashString("color"): return true; - case hashString("letterSpacing"): return true; - case hashString("textAlign"): return true; + case hashString("textSize"): return true; + case hashString("textWeight"): return true; + case hashString("textFamily"): return true; + case hashString("textColor"): return true; + case hashString("textLetterSpacing"): return true; + case hashString("textAlignment"): return true; case hashString("rightToLeft"): return true; case hashString("duration"): return true; case hashString("easing"): return true; diff --git a/packages/react-native-nitro-input/nitrogen/generated/shared/c++/views/HybridNitroTextViewComponent.hpp b/packages/react-native-nitro-input/nitrogen/generated/shared/c++/views/HybridNitroTextViewComponent.hpp index beadccb..c05a1a8 100644 --- a/packages/react-native-nitro-input/nitrogen/generated/shared/c++/views/HybridNitroTextViewComponent.hpp +++ b/packages/react-native-nitro-input/nitrogen/generated/shared/c++/views/HybridNitroTextViewComponent.hpp @@ -48,12 +48,12 @@ namespace margelo::nitro::nitroinput::views { public: nitro::ReactProp text; - nitro::ReactProp> fontSize; - nitro::ReactProp> fontWeight; - nitro::ReactProp> fontFamily; - nitro::ReactProp> color; - nitro::ReactProp> letterSpacing; - nitro::ReactProp> textAlign; + nitro::ReactProp> textSize; + nitro::ReactProp> textWeight; + nitro::ReactProp> textFamily; + nitro::ReactProp> textColor; + nitro::ReactProp> textLetterSpacing; + nitro::ReactProp> textAlignment; nitro::ReactProp> rightToLeft; nitro::ReactProp> duration; nitro::ReactProp> easing; @@ -73,12 +73,12 @@ namespace margelo::nitro::nitroinput::views { [[nodiscard]] bool hasSameProps(const HybridNitroTextViewProps& other) const noexcept { return text.hasSameValue(other.text) && - fontSize.hasSameValue(other.fontSize) && - fontWeight.hasSameValue(other.fontWeight) && - fontFamily.hasSameValue(other.fontFamily) && - color.hasSameValue(other.color) && - letterSpacing.hasSameValue(other.letterSpacing) && - textAlign.hasSameValue(other.textAlign) && + textSize.hasSameValue(other.textSize) && + textWeight.hasSameValue(other.textWeight) && + textFamily.hasSameValue(other.textFamily) && + textColor.hasSameValue(other.textColor) && + textLetterSpacing.hasSameValue(other.textLetterSpacing) && + textAlignment.hasSameValue(other.textAlignment) && rightToLeft.hasSameValue(other.rightToLeft) && duration.hasSameValue(other.duration) && easing.hasSameValue(other.easing) && @@ -99,12 +99,12 @@ namespace margelo::nitro::nitroinput::views { [[nodiscard]] bool hasAnyProvidedProps() const noexcept { return text.isProvided() || - fontSize.isProvided() || - fontWeight.isProvided() || - fontFamily.isProvided() || - color.isProvided() || - letterSpacing.isProvided() || - textAlign.isProvided() || + textSize.isProvided() || + textWeight.isProvided() || + textFamily.isProvided() || + textColor.isProvided() || + textLetterSpacing.isProvided() || + textAlignment.isProvided() || rightToLeft.isProvided() || duration.isProvided() || easing.isProvided() || diff --git a/packages/react-native-nitro-input/nitrogen/generated/shared/json/NitroInputViewConfig.json b/packages/react-native-nitro-input/nitrogen/generated/shared/json/NitroInputViewConfig.json index d42dc47..a92dfbf 100644 --- a/packages/react-native-nitro-input/nitrogen/generated/shared/json/NitroInputViewConfig.json +++ b/packages/react-native-nitro-input/nitrogen/generated/shared/json/NitroInputViewConfig.json @@ -40,7 +40,7 @@ "signPlacement": true, "prefixAlign": true, "suffixAlign": true, - "letterSpacing": true, + "textLetterSpacing": true, "prefixSpacing": true, "suffixSpacing": true, "prefixOffset": true, @@ -51,12 +51,12 @@ "easing": true, "bounce": true, "effect": true, - "fontSize": true, - "lineHeight": true, - "fontWeight": true, - "fontFamily": true, - "color": true, - "textAlign": true, + "textSize": true, + "textLineHeight": true, + "textWeight": true, + "textFamily": true, + "textColor": true, + "textAlignment": true, "rightToLeft": true, "caretColor": true, "selectionColor": true, @@ -72,7 +72,11 @@ "editable": true, "multiline": true, "numberOfLines": true, - "textAlignVertical": true, + "textVerticalAlignment": true, + "textInsetLeft": true, + "textInsetTop": true, + "textInsetRight": true, + "textInsetBottom": true, "scrollEnabled": true, "autoFocus": true, "fieldTestID": true, diff --git a/packages/react-native-nitro-input/nitrogen/generated/shared/json/NitroNumberViewConfig.json b/packages/react-native-nitro-input/nitrogen/generated/shared/json/NitroNumberViewConfig.json index 19980dc..dede6a4 100644 --- a/packages/react-native-nitro-input/nitrogen/generated/shared/json/NitroNumberViewConfig.json +++ b/packages/react-native-nitro-input/nitrogen/generated/shared/json/NitroNumberViewConfig.json @@ -37,13 +37,13 @@ "shimmerBaseColor": true, "shimmerDirection": true, "shimmerDelay": true, - "fontSize": true, + "textSize": true, "prefixFontSize": true, "suffixFontSize": true, "affixAlign": true, "prefixAlign": true, "suffixAlign": true, - "letterSpacing": true, + "textLetterSpacing": true, "prefixSpacing": true, "suffixSpacing": true, "prefixOffset": true, @@ -66,10 +66,10 @@ "minimumFontScale": true, "allowFontScaling": true, "maxFontSizeMultiplier": true, - "fontWeight": true, - "fontFamily": true, - "color": true, - "textAlign": true, + "textWeight": true, + "textFamily": true, + "textColor": true, + "textAlignment": true, "rightToLeft": true, "onSizeChange": true, "onRevealEnd": true, diff --git a/packages/react-native-nitro-input/nitrogen/generated/shared/json/NitroTextViewConfig.json b/packages/react-native-nitro-input/nitrogen/generated/shared/json/NitroTextViewConfig.json index f0381d6..ccb5e00 100644 --- a/packages/react-native-nitro-input/nitrogen/generated/shared/json/NitroTextViewConfig.json +++ b/packages/react-native-nitro-input/nitrogen/generated/shared/json/NitroTextViewConfig.json @@ -5,12 +5,12 @@ "directEventTypes": {}, "validAttributes": { "text": true, - "fontSize": true, - "fontWeight": true, - "fontFamily": true, - "color": true, - "letterSpacing": true, - "textAlign": true, + "textSize": true, + "textWeight": true, + "textFamily": true, + "textColor": true, + "textLetterSpacing": true, + "textAlignment": true, "rightToLeft": true, "duration": true, "easing": true, diff --git a/packages/react-native-nitro-input/src/NitroInput.tsx b/packages/react-native-nitro-input/src/NitroInput.tsx index daf7dba..fcced0e 100644 --- a/packages/react-native-nitro-input/src/NitroInput.tsx +++ b/packages/react-native-nitro-input/src/NitroInput.tsx @@ -11,6 +11,7 @@ import { I18nManager, StyleSheet, type ColorValue, + type StyleProp, type TextStyle, type ViewProps, } from 'react-native' @@ -277,7 +278,14 @@ export interface NitroInputKeyPressEvent { nativeEvent: { key: string; eventCount: number; target: number } } -export interface NitroInputProps extends Omit { +export interface NitroInputProps extends Omit { + /** + * As `TextInput`'s: a view style, and the text styles it reads its + * typography from (`fontSize`, `fontWeight`, `fontFamily`, `color`, + * `letterSpacing`, `lineHeight`, `textAlign`, `textAlignVertical`). The props + * of the same name win over it. + */ + style?: StyleProp /** * The text to show (controlled). The native side formats and shows what the * user types on its own; this prop is applied when it changes to something @@ -736,6 +744,64 @@ export type NitroInputTransition = 'none' | 'reflow' * Like a `TextInput`, it takes its width from its parent; `autoWidth` sizes * it to its content instead, and is on by default when the text reflows. */ +interface Insets { + left: number + top: number + right: number + bottom: number +} +const NO_INSETS: Insets = { left: 0, top: 0, right: 0, bottom: 0 } + +/** + * The style's padding plus border per edge, resolved the way Yoga does: a + * start / end edge before left / right, then horizontal / vertical, then all. + * A size measured for the text gets them added, as `TextInput`'s is, so a + * padded field grows rather than squeezing its text. Percentages are not + * resolved here (they need the parent's size) and count as 0. + */ +function styleInsets(flat: Record | undefined, rightToLeft: boolean): Insets { + if (flat == null) return NO_INSETS + const n = (key: string): number | undefined => { + const value = flat[key] + return typeof value === 'number' && Number.isFinite(value) ? value : undefined + } + const start = rightToLeft ? 'End' : 'Start' + const end = rightToLeft ? 'Start' : 'End' + const insets = { + left: + (n(`padding${start}`) ?? n('paddingLeft') ?? n('paddingHorizontal') ?? n('padding') ?? 0) + + (n(`border${start}Width`) ?? n('borderLeftWidth') ?? n('borderWidth') ?? 0), + right: + (n(`padding${end}`) ?? n('paddingRight') ?? n('paddingHorizontal') ?? n('padding') ?? 0) + + (n(`border${end}Width`) ?? n('borderRightWidth') ?? n('borderWidth') ?? 0), + top: + (n('paddingTop') ?? n('paddingVertical') ?? n('padding') ?? 0) + (n('borderTopWidth') ?? n('borderWidth') ?? 0), + bottom: + (n('paddingBottom') ?? n('paddingVertical') ?? n('padding') ?? 0) + + (n('borderBottomWidth') ?? n('borderWidth') ?? 0), + } + return insets.left === 0 && insets.right === 0 && insets.top === 0 && insets.bottom === 0 ? NO_INSETS : insets +} + +function styleTextAlign(value: TextStyle['textAlign'], rightToLeft: boolean): NitroInputTextAlign | undefined { + switch (value) { + case undefined: + return undefined + // `justify` has no meaning on one line: the start edge, as on a TextInput. + case 'start': + case 'justify': + return 'auto' + case 'end': + return rightToLeft ? 'left' : 'right' + default: + return value + } +} + +function styleTextAlignVertical(value: TextStyle['textAlignVertical']): NitroInputTextAlignVertical | undefined { + return value ?? undefined +} + // One per app, made on first use. `null` when the native side has none (an // app built against an older version, or a test without native modules): the // field then takes its size from the view's first report, as it used to. @@ -775,7 +841,7 @@ export const NitroInput = forwardRef( signPlacement, prefixAlign, suffixAlign, - letterSpacing, + letterSpacing: letterSpacingProp, prefixSpacing, suffixSpacing, prefixOffset, @@ -787,12 +853,12 @@ export const NitroInput = forwardRef( easing, bounce, effect, - fontSize, - lineHeight, - fontWeight, - fontFamily, - color, - textAlign, + fontSize: fontSizeProp, + lineHeight: lineHeightProp, + fontWeight: fontWeightProp, + fontFamily: fontFamilyProp, + color: colorProp, + textAlign: textAlignProp, cursorColor, selectionColor, caretHidden, @@ -831,7 +897,7 @@ export const NitroInput = forwardRef( multiline, numberOfLines, rows, - textAlignVertical, + textAlignVertical: textAlignVerticalProp, scrollEnabled, autoFocus, transition, @@ -1063,16 +1129,29 @@ export const NitroInput = forwardRef( const flat = useMemo( () => StyleSheet.flatten(style) as - | { width?: unknown; flex?: unknown; height?: unknown; direction?: unknown } + | ({ width?: unknown; flex?: unknown; height?: unknown; direction?: unknown } & TextStyle) | undefined, [style] ) + // `TextInput` takes its typography from `style`; so does this, under the + // props of the same name, which win. (Fabric hands a view its style's keys + // as props too; the view's own are named so that none can be one of them - + // see PropNameCollisions.test.) + const fontSize = fontSizeProp ?? flat?.fontSize + const lineHeight = lineHeightProp ?? flat?.lineHeight + const fontWeight = fontWeightProp ?? flat?.fontWeight + const fontFamily = fontFamilyProp ?? flat?.fontFamily + const color = colorProp ?? flat?.color + const letterSpacing = letterSpacingProp ?? flat?.letterSpacing + const textAlignVertical = textAlignVerticalProp ?? styleTextAlignVertical(flat?.textAlignVertical) // The layout direction, resolved the way React Native resolves it for its // own views: the field's `style.direction` if it says, else the app's. // Fabric does not hand a Hybrid View its resolved direction, so native is // told outright. const rightToLeft = flat?.direction === 'rtl' || (flat?.direction !== 'ltr' && I18nManager.isRTL) + const textAlign = textAlignProp ?? styleTextAlign(flat?.textAlign, rightToLeft) + const insets = useMemo(() => styleInsets(flat as Record | undefined, rightToLeft), [flat, rightToLeft]) // `TextInput` stretches to its parent; sizing to content is this // component's own behaviour, and it is what stops it being a drop-in. // `NitroInput` turns it off so flexbox gives it the parent's width, the @@ -1451,13 +1530,13 @@ export const NitroInput = forwardRef( maskCharacterMap: stableCharacterMap, maskSlotPlaceholder: maskSlotPlaceholder ?? (keepPlaceholder ? '_' : ''), keepPlaceholder: keepPlaceholder ?? false, - fontSize: resolvedFontSize, - lineHeight: Math.max(0, lineHeight ?? 0), + textSize: resolvedFontSize, + textLineHeight: Math.max(0, lineHeight ?? 0), prefixFontSize: prefixFontSize ?? resolvedFontSize, suffixFontSize: suffixFontSize ?? resolvedFontSize, - fontWeight: numericWeight, - fontFamily: fontFamily ?? '', - letterSpacing: letterSpacing ?? 0, + textWeight: numericWeight, + textFamily: fontFamily ?? '', + textLetterSpacing: letterSpacing ?? 0, prefixSpacing: prefixSpacing ?? Infinity, suffixSpacing: suffixSpacing ?? Infinity, allowFontScaling: allowFontScaling ?? false, @@ -1483,15 +1562,17 @@ export const NitroInput = forwardRef( } } const shownSize = size ?? seedRef.current - const autoSize = useMemo( - () => - shownSize !== null - ? autoWidth - ? { width: shownSize.width, height: shownSize.height } - : { height: shownSize.height } - : { height: resolvedFontSize * 1.25 }, - [shownSize, resolvedFontSize, autoWidth] - ) + // The size measured for the text, plus the style's padding and border + // (Yoga's box includes them; `TextInput`'s measured size gets them too). + const autoSize = useMemo(() => { + const extraWidth = insets.left + insets.right + const extraHeight = insets.top + insets.bottom + return shownSize !== null + ? autoWidth + ? { width: shownSize.width + extraWidth, height: shownSize.height + extraHeight } + : { height: shownSize.height + extraHeight } + : { height: resolvedFontSize * 1.25 + extraHeight } + }, [shownSize, resolvedFontSize, autoWidth, insets]) return ( ( easing={easing ?? 'expo'} bounce={bounce ?? 0.15} effect={effect ?? 'auto'} - color={processedColor} - textAlign={textAlign ?? 'auto'} + textColor={processedColor} + textAlignment={textAlign ?? 'auto'} rightToLeft={rightToLeft} caretColor={processedCursorColor} selectionColor={processedSelectionColor} @@ -1533,7 +1614,11 @@ export const NitroInput = forwardRef( autoCorrect={autoCorrect ?? true} editable={(editable ?? true) && !(readOnly ?? false)} numberOfLines={Math.max(0, Math.trunc(numberOfLines ?? rows ?? 0))} - textAlignVertical={textAlignVertical ?? 'auto'} + textVerticalAlignment={textAlignVertical ?? 'auto'} + textInsetLeft={insets.left} + textInsetTop={insets.top} + textInsetRight={insets.right} + textInsetBottom={insets.bottom} scrollEnabled={scrollEnabled ?? true} autoFocus={autoFocus ?? false} fieldTestID={viewProps.testID ?? ''} diff --git a/packages/react-native-nitro-input/src/NitroNumber.tsx b/packages/react-native-nitro-input/src/NitroNumber.tsx index bc9dc2e..7386948 100644 --- a/packages/react-native-nitro-input/src/NitroNumber.tsx +++ b/packages/react-native-nitro-input/src/NitroNumber.tsx @@ -693,13 +693,13 @@ export const NitroNumber = forwardRef( shimmerBaseColor={processedShimmerBase} shimmerDirection={shimmerDirection ?? 'auto'} shimmerDelay={shimmerDelay ?? 0} - fontSize={resolvedFontSize} + textSize={resolvedFontSize} prefixFontSize={prefixFontSize ?? resolvedFontSize} suffixFontSize={suffixFontSize ?? resolvedFontSize} affixAlign={resolvedAffixAlign} prefixAlign={prefixAlign ?? resolvedAffixAlign} suffixAlign={suffixAlign ?? resolvedAffixAlign} - letterSpacing={letterSpacing ?? 0} + textLetterSpacing={letterSpacing ?? 0} prefixSpacing={prefixSpacing ?? Infinity} suffixSpacing={suffixSpacing ?? Infinity} prefixOffset={prefixOffset ?? 0} @@ -722,10 +722,10 @@ export const NitroNumber = forwardRef( minimumFontScale={minimumFontScale ?? 0.5} allowFontScaling={allowFontScaling ?? false} maxFontSizeMultiplier={maxFontSizeMultiplier ?? 0} - fontWeight={numericWeight} - fontFamily={fontFamily ?? ''} - color={processedColor} - textAlign={textAlign ?? 'auto'} + textWeight={numericWeight} + textFamily={fontFamily ?? ''} + textColor={processedColor} + textAlignment={textAlign ?? 'auto'} rightToLeft={rightToLeft} onSizeChange={onSizeChange} /> diff --git a/packages/react-native-nitro-input/src/NitroText.tsx b/packages/react-native-nitro-input/src/NitroText.tsx index 91fcd43..f539ebe 100644 --- a/packages/react-native-nitro-input/src/NitroText.tsx +++ b/packages/react-native-nitro-input/src/NitroText.tsx @@ -134,13 +134,13 @@ export function NitroText({ const native: NativeNitroTextProps & Record = viewProps as never native.text = text native.style = style == null ? { width: Math.ceil(width), height } : [{ width: Math.ceil(width), height }, style] - if (size !== 17) native.fontSize = size - if (weight !== 400) native.fontWeight = weight - if (family !== '') native.fontFamily = family - if (spacing !== 0) native.letterSpacing = spacing + if (size !== 17) native.textSize = size + if (weight !== 400) native.textWeight = weight + if (family !== '') native.textFamily = family + if (spacing !== 0) native.textLetterSpacing = spacing const processedColor = toProcessedColor(color) - if (processedColor !== undefined) native.color = processedColor - if (textAlign !== undefined) native.textAlign = textAlign + if (processedColor !== undefined) native.textColor = processedColor + if (textAlign !== undefined) native.textAlignment = textAlign if (duration !== undefined) native.duration = duration if (easing !== undefined) native.easing = easing if (bounce !== undefined) native.bounce = bounce diff --git a/packages/react-native-nitro-input/src/__tests__/NitroInput.test.tsx b/packages/react-native-nitro-input/src/__tests__/NitroInput.test.tsx index 634438b..2fd86d4 100644 --- a/packages/react-native-nitro-input/src/__tests__/NitroInput.test.tsx +++ b/packages/react-native-nitro-input/src/__tests__/NitroInput.test.tsx @@ -47,10 +47,10 @@ describe('right-to-left', () => { it('aligns to the start edge unless told otherwise', () => { // `'auto'` is the start edge of the layout direction, as `TextInput` with // no `textAlign`; `'left'` and `'right'` are absolute. - expect(nativeProps(render()).textAlign).toBe('auto') - expect(nativeProps(render()).textAlign).toBe('left') - expect(nativeProps(render()).textAlign).toBe('right') - expect(nativeProps(render()).textAlign).toBe('center') + expect(nativeProps(render()).textAlignment).toBe('auto') + expect(nativeProps(render()).textAlignment).toBe('left') + expect(nativeProps(render()).textAlignment).toBe('right') + expect(nativeProps(render()).textAlignment).toBe('center') }) }) @@ -87,7 +87,7 @@ describe('multiline', () => { expect(nativeProps(render()).numberOfLines).toBe(4) expect(nativeProps(render()).numberOfLines).toBe(3) expect(nativeProps(render()).numberOfLines).toBe(4) - expect(nativeProps(render()).textAlignVertical).toBe('bottom') + expect(nativeProps(render()).textVerticalAlignment).toBe('bottom') }) }) @@ -129,8 +129,9 @@ describe('autoWidth', () => { expect(measured(render())).toEqual({ width: 120, height: 48 }) expect(measured(render())).toEqual({ height: 48 }) expect(measured(render())).toEqual({ height: 48 }) + // The padding is added to the measured height, as TextInput's is. expect(measured(render())).toEqual({ - height: 48, + height: 56, }) }) @@ -258,3 +259,63 @@ describe('colours', () => { expect(props.fillColor).toBe(Infinity) }) }) + +describe('typography in style, as TextInput takes it', () => { + it('reads the text keys from style', () => { + const props = nativeProps( + render( + + ) + ) + expect(props.textSize).toBe(18) + expect(props.textWeight).toBe(700) + expect(props.textFamily).toBe('Menlo') + expect(props.textLetterSpacing).toBe(2) + expect(props.textLineHeight).toBe(30) + expect(props.textAlignment).toBe('center') + expect(props.textVerticalAlignment).toBe('top') + expect(props.textColor).not.toBe(Infinity) + }) + + it('lets the props of the same name win', () => { + const props = nativeProps(render()) + expect(props.textSize).toBe(40) + expect(props.textWeight).toBe(300) + }) + + it('reads start, end and justify the way TextInput does', () => { + expect(nativeProps(render()).textAlignment).toBe('auto') + expect(nativeProps(render()).textAlignment).toBe('right') + expect(nativeProps(render()).textAlignment).toBe('left') + expect(nativeProps(render()).textAlignment).toBe('auto') + }) +}) + +describe('padding and border in style', () => { + const measured = (renderer: ReactTestRenderer) => { + const onSizeChange = nativeProps(renderer).onSizeChange as { f: (w: number, h: number) => void } + act(() => onSizeChange.f(120, 48)) + return (nativeProps(renderer).style as unknown[])[0] + } + const insets = (renderer: ReactTestRenderer) => { + const p = nativeProps(renderer) + return [p.textInsetLeft, p.textInsetTop, p.textInsetRight, p.textInsetBottom] + } + + it('grows an autoWidth field by them instead of squeezing its text', () => { + const renderer = render() + expect(measured(renderer)).toEqual({ width: 120 + 18, height: 48 + 6 }) + expect(insets(renderer)).toEqual([9, 3, 9, 3]) + }) + + it('resolves the edges the way Yoga does', () => { + // A start / end edge before left / right, before horizontal, before all. + expect(insets(render())).toEqual([4, 1, 2, 1]) + // Start is the right edge right-to-left. + expect(insets(render())).toEqual([0, 0, 4, 0]) + // A percentage needs the parent's size: not resolved, counted as 0. + expect(insets(render())).toEqual([0, 0, 0, 0]) + }) +}) diff --git a/packages/react-native-nitro-input/src/__tests__/NitroNumber.test.tsx b/packages/react-native-nitro-input/src/__tests__/NitroNumber.test.tsx index fa2563b..0e6523f 100644 --- a/packages/react-native-nitro-input/src/__tests__/NitroNumber.test.tsx +++ b/packages/react-native-nitro-input/src/__tests__/NitroNumber.test.tsx @@ -36,10 +36,10 @@ describe('NitroNumber', () => { expect(props.groupingSeparator).toBe(',') expect(props.prefix).toBe('$') expect(props.suffix).toBe(' USD') - expect(props.fontWeight).toBe(700) - expect(props.color).toBe(processColor('#ff0000')) + expect(props.textWeight).toBe(700) + expect(props.textColor).toBe(processColor('#ff0000')) expect(props.shimmerColor).toBe(processColor('#00ff00')) - expect(props.textAlign).toBe('right') + expect(props.textAlignment).toBe('right') }) it('passes the transition through with its own timing defaults', () => { @@ -68,10 +68,10 @@ describe('NitroNumber', () => { }) it('maps numeric and string font weights', () => { - expect(nativeProps(render()).fontWeight).toBe(600) - expect(nativeProps(render()).fontWeight).toBe(300) - expect(nativeProps(render()).fontWeight).toBe(600) - expect(nativeProps(render()).fontWeight).toBe(400) + expect(nativeProps(render()).textWeight).toBe(600) + expect(nativeProps(render()).textWeight).toBe(300) + expect(nativeProps(render()).textWeight).toBe(600) + expect(nativeProps(render()).textWeight).toBe(400) }) it('never sends undefined for a native prop (a removed prop reaches native as null, which Nitro rejects)', () => { @@ -88,8 +88,8 @@ describe('NitroNumber', () => { } expect(props.prefix).toBe('') expect(props.suffix).toBe('') - expect(props.fontFamily).toBe('') - expect(props.color).toBe(Infinity) + expect(props.textFamily).toBe('') + expect(props.textColor).toBe(Infinity) expect(props.shimmerColor).toBe(Infinity) expect(props.prefixFontSize).toBe(32) expect(props.loading).toBe(false) @@ -222,7 +222,7 @@ describe('NitroNumber', () => { }) it('resolves the layout direction the way React Native does and aligns to the start edge by default', () => { - expect(nativeProps(render()).textAlign).toBe('auto') + expect(nativeProps(render()).textAlignment).toBe('auto') expect(nativeProps(render()).rightToLeft).toBe(false) // The view's own `direction` wins over the app's. expect(nativeProps(render()).rightToLeft).toBe(true) diff --git a/packages/react-native-nitro-input/src/__tests__/PropNameCollisions.test.tsx b/packages/react-native-nitro-input/src/__tests__/PropNameCollisions.test.tsx index e70066e..7614fb9 100644 --- a/packages/react-native-nitro-input/src/__tests__/PropNameCollisions.test.tsx +++ b/packages/react-native-nitro-input/src/__tests__/PropNameCollisions.test.tsx @@ -35,9 +35,24 @@ function reactNativeViewDir(): string { return join(dirname(entry), 'ReactCommon/react/renderer/components/view'); } +/** + * Every key a `style` can carry. Fabric hands a view its style's keys as + * props, so a style key that is also the name of one of our props reaches the + * prop's parser: `style={{ fontWeight: '700' }}` threw "Value is a string, + * expected a number" when the view had a numeric `fontWeight` of its own. + */ +function styleKeys(): Set { + const entry = require.resolve('react-native/package.json'); + const source = readFileSync( + join(dirname(entry), 'Libraries/Components/View/ReactNativeStyleAttributes.js'), + 'utf8', + ); + return new Set([...source.matchAll(/^\s+([a-zA-Z]+):/gm)].map((match) => match[1]!)); +} + function namesReactNativeParses(): Set { const dir = reactNativeViewDir(); - const names = new Set(); + const names = styleKeys(); for (const file of VIEW_PROP_SOURCES) { let source: string; try { @@ -87,6 +102,19 @@ describe('prop names', () => { expect(reserved.size).toBeGreaterThan(50); expect(reserved.has('outlineColor')).toBe(true); expect(reserved.has('borderRadius')).toBe(true); + // The style keys too, text ones included. + expect(reserved.has('fontWeight')).toBe(true); + expect(reserved.has('textAlignVertical')).toBe(true); + }); + + it('would catch the style key that crashed', () => { + const before = [ + 'export interface Props extends HybridViewProps {', + ' fontWeight?: number', + ' textWeight?: number', + '}', + ].join('\n'); + expect(declaredProps(before).filter((name) => reserved.has(name))).toEqual(['fontWeight']); }); it('would catch the collision we already shipped once', () => { diff --git a/packages/react-native-nitro-input/src/__tests__/Reflow.test.tsx b/packages/react-native-nitro-input/src/__tests__/Reflow.test.tsx index 358ade1..d4e5dae 100644 --- a/packages/react-native-nitro-input/src/__tests__/Reflow.test.tsx +++ b/packages/react-native-nitro-input/src/__tests__/Reflow.test.tsx @@ -32,14 +32,14 @@ describe('NitroInput with transition="reflow"', () => { expect(props.duration).toBe(400) expect(props.easing).toBe('expo') expect(props.effect).toBe('auto') - expect(props.fontSize).toBe(32) + expect(props.textSize).toBe(32) expect(props.prefixFontSize).toBe(32) expect(props.prefixAlign).toBe('baseline') expect(props.suffixAlign).toBe('baseline') expect(props.prefixAlign).toBe('baseline') - expect(props.color).toBe(Infinity) + expect(props.textColor).toBe(Infinity) expect(props.placeholderColor).toBe(Infinity) - expect(props.fontFamily).toBe('') + expect(props.textFamily).toBe('') expect(props.maxLength).toBe(0) expect(props.editable).toBe(true) expect(props.submitBehavior).toBe('blurAndSubmit') @@ -118,9 +118,9 @@ describe('NitroInput with transition="reflow"', () => { it('converts colors and font weights', () => { const props = nativeProps(render()) - expect(props.color).toBe(0xffff0000) + expect(props.textColor).toBe(0xffff0000) expect(props.placeholderColor).toBe(0xff00ff00) - expect(props.fontWeight).toBe(700) + expect(props.textWeight).toBe(700) }) it('keeps an uncontrolled field on its initial text', () => { diff --git a/packages/react-native-nitro-input/src/__tests__/TextInputParity.test.tsx b/packages/react-native-nitro-input/src/__tests__/TextInputParity.test.tsx index 21afe39..c1d209d 100644 --- a/packages/react-native-nitro-input/src/__tests__/TextInputParity.test.tsx +++ b/packages/react-native-nitro-input/src/__tests__/TextInputParity.test.tsx @@ -411,11 +411,9 @@ describe('props reach the native side the same way', () => { ['showSoftInputOnFocus', false], ['allowFontScaling', false], ['maxFontSizeMultiplier', 2], - ['textAlign', 'center'], ['editable', false], ['multiline', true], ['numberOfLines', 3], - ['textAlignVertical', 'top'], ['spellCheck', false], ['submitBehavior', 'submit'], ] @@ -426,6 +424,19 @@ describe('props reach the native side the same way', () => { expect(ours.host()[prop]).toEqual(value) }) + // The same, under a native name of ours that no style key can share (see + // PropNameCollisions.test): Fabric hands a view its style's keys as props. + const RENAMED: Array<[prop: string, native: string, value: unknown]> = [ + ['textAlign', 'textAlignment', 'center'], + ['textAlignVertical', 'textVerticalAlignment', 'top'], + ] + + it.each(RENAMED)('%s (as %s)', (prop, native, value) => { + const { rn, ours } = both({ [prop]: value }) + expect(ours.host()[native]).toEqual(rn.host()[prop]) + expect(ours.host()[native]).toEqual(value) + }) + it('defaultValue becomes the initial text on both', () => { const { rn, ours } = both({ defaultValue: 'seed' }) expect(rn.host().text).toBe('seed') diff --git a/packages/react-native-nitro-input/src/specs/NitroInput.nitro.ts b/packages/react-native-nitro-input/src/specs/NitroInput.nitro.ts index 887ece7..5649be0 100644 --- a/packages/react-native-nitro-input/src/specs/NitroInput.nitro.ts +++ b/packages/react-native-nitro-input/src/specs/NitroInput.nitro.ts @@ -267,7 +267,7 @@ export interface NitroInputProps extends HybridViewProps { /** Vertical alignment of `suffix` relative to the text (the wrapper folds its `affixAlign` into this). */ suffixAlign: NitroInputAffixAlign /** Points added after every glyph, like `Text`'s `letterSpacing`; an affix gets it in proportion to its size. */ - letterSpacing: number + textLetterSpacing: number /** Points between the prefix and the text, in place of the letter spacing there. Not finite: the letter spacing. */ prefixSpacing: number /** Points between the text and the suffix, in place of the letter spacing there. Not finite: the letter spacing. */ @@ -289,7 +289,7 @@ export interface NitroInputProps extends HybridViewProps { /** How characters enter and leave. Default: `'auto'`. */ effect: NitroInputEffect /** Font size of the text in points. Default: `32`. */ - fontSize: number + textSize: number /** * Height of the line box in points — the CSS meaning: the total height a * line occupies, not extra leading. `0` (the default) uses the font's own. @@ -302,15 +302,15 @@ export interface NitroInputProps extends HybridViewProps { * `lineHeight < font.lineHeight`), and the reason a compressed `lineHeight` * renders off-centre on a `TextInput`. */ - lineHeight: number + textLineHeight: number /** Numeric font weight, `100`–`900`. Default: `400`. */ - fontWeight: number + textWeight: number /** Font family name; empty = system font. */ - fontFamily: string + textFamily: string /** Text color as a processed ARGB integer; `NaN` = platform label color. */ - color: number + textColor: number /** Where the text sits when the view is wider than it. Default: `'auto'`, the start edge. */ - textAlign: NitroInputTextAlign + textAlignment: NitroInputTextAlign /** * Lay the field out right-to-left: `'auto'` alignment resolves to the right * edge, the prefix moves to the right and the suffix to the left, and a @@ -361,7 +361,16 @@ export interface NitroInputProps extends HybridViewProps { */ numberOfLines: number /** `multiline`: where the text sits in the box. Default: `'auto'` (top). */ - textAlignVertical: NitroInputTextAlignVertical + textVerticalAlignment: NitroInputTextAlignVertical + /** + * The style's padding and border, in points, resolved per edge by + * `NitroInput`. Android insets the text, the overlay and the frame by them; + * on iOS React Native already lays the view's content out inside them. + */ + textInsetLeft: number + textInsetTop: number + textInsetRight: number + textInsetBottom: number /** * `multiline`: whether the field scrolls once the text is taller than it. * Turning it off lets a growing field drive its own height. Default: `true`. diff --git a/packages/react-native-nitro-input/src/specs/NitroInputMeasure.nitro.ts b/packages/react-native-nitro-input/src/specs/NitroInputMeasure.nitro.ts index 3fdbe2d..b0d4951 100644 --- a/packages/react-native-nitro-input/src/specs/NitroInputMeasure.nitro.ts +++ b/packages/react-native-nitro-input/src/specs/NitroInputMeasure.nitro.ts @@ -40,13 +40,13 @@ export interface NitroInputSizing { maskCharacterMap: NitroInputCharacterMapping[] maskSlotPlaceholder: string keepPlaceholder: boolean - fontSize: number - lineHeight: number + textSize: number + textLineHeight: number prefixFontSize: number suffixFontSize: number - fontWeight: number - fontFamily: string - letterSpacing: number + textWeight: number + textFamily: string + textLetterSpacing: number prefixSpacing: number suffixSpacing: number allowFontScaling: boolean diff --git a/packages/react-native-nitro-input/src/specs/NitroNumber.nitro.ts b/packages/react-native-nitro-input/src/specs/NitroNumber.nitro.ts index 56cf8d6..c7ecfb3 100644 --- a/packages/react-native-nitro-input/src/specs/NitroNumber.nitro.ts +++ b/packages/react-native-nitro-input/src/specs/NitroNumber.nitro.ts @@ -196,7 +196,7 @@ export interface NitroNumberProps extends HybridViewProps { /** A pause after each sweep, in ms. Default: `0`. */ shimmerDelay?: number /** Font size of the digits in points. Default: `32`. */ - fontSize?: number + textSize?: number /** Font size of `prefix` in points. Defaults to `fontSize`. */ prefixFontSize?: number /** Font size of `suffix` in points. Defaults to `fontSize`. */ @@ -208,7 +208,7 @@ export interface NitroNumberProps extends HybridViewProps { /** Vertical alignment of `suffix` only. Defaults to `affixAlign`. */ suffixAlign?: NitroNumberAffixAlign /** Points added after every glyph, like `Text`'s `letterSpacing`; an affix gets it in proportion to its size. Default: `0`. */ - letterSpacing?: number + textLetterSpacing?: number /** Points between the prefix and the digits, in place of the letter spacing there. Not finite: the letter spacing. */ prefixSpacing?: number /** Points between the digits and the suffix, in place of the letter spacing there. Not finite: the letter spacing. */ @@ -274,13 +274,13 @@ export interface NitroNumberProps extends HybridViewProps { /** Upper bound for `allowFontScaling`, e.g. `1.3`. `0` means no cap. Default: `0`. */ maxFontSizeMultiplier?: number /** Numeric font weight, `100`–`900`. Default: `400`. */ - fontWeight?: number + textWeight?: number /** Font family name. Defaults to the system font. */ - fontFamily?: string + textFamily?: string /** Text color as a processed ARGB integer (from `processColor`). Defaults to the platform label color. */ - color?: number + textColor?: number /** Where the number sits inside the view when the view is wider than the number. Default: `'auto'`, the start edge. */ - textAlign?: NitroNumberTextAlign + textAlignment?: NitroNumberTextAlign /** * Lay the figure out right-to-left: `'auto'` alignment resolves to the right * edge, the prefix moves to the right and the suffix to the left, and the diff --git a/packages/react-native-nitro-input/src/specs/NitroText.nitro.ts b/packages/react-native-nitro-input/src/specs/NitroText.nitro.ts index ff83511..5814154 100644 --- a/packages/react-native-nitro-input/src/specs/NitroText.nitro.ts +++ b/packages/react-native-nitro-input/src/specs/NitroText.nitro.ts @@ -21,16 +21,16 @@ import type { NitroInputEasing, NitroInputEffect } from './NitroInput.nitro' export interface NitroTextProps extends HybridViewProps { text: string /** In points, already scaled for the system text size when the wrapper was asked to. Default 17. */ - fontSize?: number + textSize?: number /** Numeric weight, 100–900. Default 400. */ - fontWeight?: number + textWeight?: number /** Default: the system font. */ - fontFamily?: string + textFamily?: string /** Processed ARGB. Default: the platform label colour. */ - color?: number + textColor?: number /** Points after every character. */ - letterSpacing?: number - textAlign?: NitroNumberTextAlign + textLetterSpacing?: number + textAlignment?: NitroNumberTextAlign rightToLeft?: boolean /** Of a morph, in ms. Default 400. */ duration?: number