react-native-nitro-input 0.3.0 → 0.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +80 -0
- package/README.md +120 -5
- package/android/src/main/cpp/JMaskEngine.cpp +45 -0
- package/android/src/main/cpp/JMaskEngine.hpp +9 -0
- package/android/src/main/cpp/JReflowEngine.cpp +32 -0
- package/android/src/main/cpp/JReflowEngine.hpp +13 -0
- package/android/src/main/cpp/JRollingEngine.cpp +42 -2
- package/android/src/main/cpp/JRollingEngine.hpp +9 -1
- package/android/src/main/java/com/margelo/nitro/nitroinput/HybridNitroInputView.kt +24 -0
- package/android/src/main/java/com/margelo/nitro/nitroinput/HybridNitroNumberFormatPlatform.kt +76 -1
- package/android/src/main/java/com/margelo/nitro/nitroinput/HybridNitroNumberView.kt +88 -0
- package/android/src/main/java/com/margelo/nitro/nitroinput/HybridNitroTextMeasure.kt +25 -0
- package/android/src/main/java/com/margelo/nitro/nitroinput/HybridNitroTextView.kt +140 -0
- package/android/src/main/java/com/margelo/nitro/nitroinput/MaskEngine.kt +16 -0
- package/android/src/main/java/com/margelo/nitro/nitroinput/NitroInputPackage.kt +2 -1
- package/android/src/main/java/com/margelo/nitro/nitroinput/NitroInputView.kt +96 -6
- package/android/src/main/java/com/margelo/nitro/nitroinput/NitroNumberView.kt +388 -136
- package/android/src/main/java/com/margelo/nitro/nitroinput/NitroTextView.kt +868 -0
- package/android/src/main/java/com/margelo/nitro/nitroinput/ReflowEngine.kt +21 -0
- package/android/src/main/java/com/margelo/nitro/nitroinput/RollingEngine.kt +13 -2
- package/cpp/MaskEngine.cpp +294 -33
- package/cpp/MaskEngine.hpp +68 -0
- package/cpp/RollingEngine.cpp +92 -8
- package/cpp/RollingEngine.hpp +36 -2
- package/ios/HybridNitroInputView.swift +18 -0
- package/ios/HybridNitroNumberFormatPlatform.swift +87 -9
- package/ios/HybridNitroNumberView.swift +82 -1
- package/ios/HybridNitroTextView.swift +134 -0
- package/ios/NitroInputView.swift +125 -7
- package/ios/NitroNumberView.swift +368 -135
- package/ios/NitroTextView.swift +583 -0
- package/lib/commonjs/nitrogen/generated/shared/json/NitroInputViewConfig.json +6 -0
- package/lib/commonjs/nitrogen/generated/shared/json/NitroNumberViewConfig.json +20 -0
- package/lib/commonjs/nitrogen/generated/shared/json/NitroTextViewConfig.json +30 -0
- package/lib/commonjs/src/NitroInput.js +15 -2
- package/lib/commonjs/src/NitroNumber.js +52 -3
- package/lib/commonjs/src/NitroText.js +138 -0
- package/lib/commonjs/src/NitroTime.js +65 -0
- package/lib/commonjs/src/formatProps.js +76 -16
- package/lib/commonjs/src/index.js +6 -1
- package/lib/commonjs/src/specs/NitroText.nitro.js +2 -0
- package/lib/module/nitrogen/generated/shared/json/NitroInputViewConfig.json +6 -0
- package/lib/module/nitrogen/generated/shared/json/NitroNumberViewConfig.json +20 -0
- package/lib/module/nitrogen/generated/shared/json/NitroTextViewConfig.json +30 -0
- package/lib/module/src/NitroInput.js +15 -2
- package/lib/module/src/NitroNumber.js +53 -4
- package/lib/module/src/NitroText.js +98 -0
- package/lib/module/src/NitroTime.js +29 -0
- package/lib/module/src/formatProps.js +76 -17
- package/lib/module/src/index.js +2 -0
- package/lib/module/src/specs/NitroText.nitro.js +1 -0
- package/lib/typescript/src/NitroInput.d.ts +39 -1
- package/lib/typescript/src/NitroNumber.d.ts +79 -1
- package/lib/typescript/src/NitroText.d.ts +67 -0
- package/lib/typescript/src/NitroTime.d.ts +19 -0
- package/lib/typescript/src/formatProps.d.ts +30 -4
- package/lib/typescript/src/index.d.ts +5 -2
- package/lib/typescript/src/specs/NitroInput.nitro.d.ts +43 -0
- package/lib/typescript/src/specs/NitroNumber.nitro.d.ts +67 -0
- package/lib/typescript/src/specs/NitroText.nitro.d.ts +60 -0
- package/nitro.json +20 -0
- package/nitrogen/generated/android/NitroInput+autolinking.cmake +6 -0
- package/nitrogen/generated/android/NitroInputOnLoad.cpp +34 -0
- package/nitrogen/generated/android/c++/JHybridNitroInputViewSpec.cpp +102 -0
- package/nitrogen/generated/android/c++/JHybridNitroInputViewSpec.hpp +12 -0
- package/nitrogen/generated/android/c++/JHybridNitroNumberViewSpec.cpp +243 -0
- package/nitrogen/generated/android/c++/JHybridNitroNumberViewSpec.hpp +40 -0
- package/nitrogen/generated/android/c++/JHybridNitroTextMeasureSpec.cpp +58 -0
- package/nitrogen/generated/android/c++/JHybridNitroTextMeasureSpec.hpp +64 -0
- package/nitrogen/generated/android/c++/JHybridNitroTextViewSpec.cpp +253 -0
- package/nitrogen/generated/android/c++/JHybridNitroTextViewSpec.hpp +104 -0
- package/nitrogen/generated/android/c++/JNitroInputCharacterMapping.hpp +61 -0
- package/nitrogen/generated/android/c++/JNitroInputMaskAffinity.hpp +64 -0
- package/nitrogen/generated/android/c++/JNitroInputTextCase.hpp +61 -0
- package/nitrogen/generated/android/c++/JNitroNumberShimmerDirection.hpp +61 -0
- package/nitrogen/generated/android/c++/JNitroNumberSignDisplay.hpp +67 -0
- package/nitrogen/generated/android/c++/views/JHybridNitroInputViewStateUpdater.cpp +30 -0
- package/nitrogen/generated/android/c++/views/JHybridNitroNumberViewStateUpdater.cpp +100 -0
- package/nitrogen/generated/android/c++/views/JHybridNitroTextViewStateUpdater.cpp +174 -0
- package/nitrogen/generated/android/c++/views/JHybridNitroTextViewStateUpdater.hpp +54 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinput/HybridNitroInputViewSpec.kt +36 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinput/HybridNitroNumberViewSpec.kt +136 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinput/HybridNitroTextMeasureSpec.kt +60 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinput/HybridNitroTextViewSpec.kt +179 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinput/NitroInputCharacterMapping.kt +56 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinput/NitroInputMaskAffinity.kt +25 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinput/NitroInputTextCase.kt +24 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinput/NitroNumberShimmerDirection.kt +24 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinput/NitroNumberSignDisplay.kt +26 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinput/views/HybridNitroTextViewManager.kt +96 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinput/views/HybridNitroTextViewStateUpdater.kt +23 -0
- package/nitrogen/generated/ios/NitroInput-Swift-Cxx-Bridge.cpp +34 -0
- package/nitrogen/generated/ios/NitroInput-Swift-Cxx-Bridge.hpp +146 -11
- package/nitrogen/generated/ios/NitroInput-Swift-Cxx-Umbrella.hpp +25 -0
- package/nitrogen/generated/ios/NitroInputAutolinking.mm +16 -0
- package/nitrogen/generated/ios/NitroInputAutolinking.swift +24 -0
- package/nitrogen/generated/ios/c++/HybridNitroInputViewSpecSwift.hpp +50 -0
- package/nitrogen/generated/ios/c++/HybridNitroNumberViewSpecSwift.hpp +146 -0
- package/nitrogen/generated/ios/c++/HybridNitroTextMeasureSpecSwift.cpp +11 -0
- package/nitrogen/generated/ios/c++/HybridNitroTextMeasureSpecSwift.hpp +90 -0
- package/nitrogen/generated/ios/c++/HybridNitroTextViewSpecSwift.cpp +11 -0
- package/nitrogen/generated/ios/c++/HybridNitroTextViewSpecSwift.hpp +233 -0
- package/nitrogen/generated/ios/c++/views/HybridNitroInputViewComponent.mm +36 -0
- package/nitrogen/generated/ios/c++/views/HybridNitroNumberViewComponent.mm +120 -0
- package/nitrogen/generated/ios/c++/views/HybridNitroTextViewComponent.mm +264 -0
- package/nitrogen/generated/ios/swift/HybridNitroInputViewSpec.swift +6 -0
- package/nitrogen/generated/ios/swift/HybridNitroInputViewSpec_cxx.swift +78 -0
- package/nitrogen/generated/ios/swift/HybridNitroNumberViewSpec.swift +20 -0
- package/nitrogen/generated/ios/swift/HybridNitroNumberViewSpec_cxx.swift +493 -0
- package/nitrogen/generated/ios/swift/HybridNitroTextMeasureSpec.swift +56 -0
- package/nitrogen/generated/ios/swift/HybridNitroTextMeasureSpec_cxx.swift +150 -0
- package/nitrogen/generated/ios/swift/HybridNitroTextViewSpec.swift +75 -0
- package/nitrogen/generated/ios/swift/HybridNitroTextViewSpec_cxx.swift +608 -0
- package/nitrogen/generated/ios/swift/NitroInputCharacterMapping.swift +34 -0
- package/nitrogen/generated/ios/swift/NitroInputMaskAffinity.swift +48 -0
- package/nitrogen/generated/ios/swift/NitroInputTextCase.swift +44 -0
- package/nitrogen/generated/ios/swift/NitroNumberShimmerDirection.swift +44 -0
- package/nitrogen/generated/ios/swift/NitroNumberSignDisplay.swift +52 -0
- package/nitrogen/generated/shared/c++/HybridNitroInputViewSpec.cpp +12 -0
- package/nitrogen/generated/shared/c++/HybridNitroInputViewSpec.hpp +21 -0
- package/nitrogen/generated/shared/c++/HybridNitroNumberViewSpec.cpp +40 -0
- package/nitrogen/generated/shared/c++/HybridNitroNumberViewSpec.hpp +46 -0
- package/nitrogen/generated/shared/c++/HybridNitroTextMeasureSpec.cpp +22 -0
- package/nitrogen/generated/shared/c++/HybridNitroTextMeasureSpec.hpp +63 -0
- package/nitrogen/generated/shared/c++/HybridNitroTextViewSpec.cpp +62 -0
- package/nitrogen/generated/shared/c++/HybridNitroTextViewSpec.hpp +115 -0
- package/nitrogen/generated/shared/c++/NitroInputCharacterMapping.hpp +87 -0
- package/nitrogen/generated/shared/c++/NitroInputMaskAffinity.hpp +84 -0
- package/nitrogen/generated/shared/c++/NitroInputTextCase.hpp +80 -0
- package/nitrogen/generated/shared/c++/NitroNumberShimmerDirection.hpp +80 -0
- package/nitrogen/generated/shared/c++/NitroNumberSignDisplay.hpp +88 -0
- package/nitrogen/generated/shared/c++/views/HybridNitroInputViewComponent.cpp +12 -0
- package/nitrogen/generated/shared/c++/views/HybridNitroInputViewComponent.hpp +21 -0
- package/nitrogen/generated/shared/c++/views/HybridNitroNumberViewComponent.cpp +40 -0
- package/nitrogen/generated/shared/c++/views/HybridNitroNumberViewComponent.hpp +62 -0
- package/nitrogen/generated/shared/c++/views/HybridNitroTextViewComponent.cpp +74 -0
- package/nitrogen/generated/shared/c++/views/HybridNitroTextViewComponent.hpp +149 -0
- package/nitrogen/generated/shared/json/NitroInputViewConfig.json +6 -0
- package/nitrogen/generated/shared/json/NitroNumberViewConfig.json +20 -0
- package/nitrogen/generated/shared/json/NitroTextViewConfig.json +30 -0
- package/package.json +2 -2
- package/src/NitroInput.tsx +73 -0
- package/src/NitroNumber.tsx +183 -9
- package/src/NitroText.tsx +166 -0
- package/src/NitroTime.tsx +68 -0
- package/src/formatProps.ts +108 -18
- package/src/index.ts +8 -0
- package/src/specs/NitroInput.nitro.ts +46 -0
- package/src/specs/NitroNumber.nitro.ts +69 -0
- package/src/specs/NitroText.nitro.ts +65 -0
|
@@ -103,6 +103,8 @@ function reactTagOf(host) {
|
|
|
103
103
|
return typeof tag === 'number' ? tag : 0;
|
|
104
104
|
}
|
|
105
105
|
const EMPTY_NOTATIONS = [];
|
|
106
|
+
const EMPTY_STRINGS = [];
|
|
107
|
+
const EMPTY_MAPPINGS = [];
|
|
106
108
|
/** Mounted fields, by the host instance React Native's registry stores. */
|
|
107
109
|
const mountedFields = new WeakMap();
|
|
108
110
|
let patchedRegistry = false;
|
|
@@ -176,7 +178,7 @@ function warnIncompatible(what) {
|
|
|
176
178
|
* Like a `TextInput`, it takes its width from its parent; `autoWidth` sizes
|
|
177
179
|
* it to its content instead, and is on by default when the text reflows.
|
|
178
180
|
*/
|
|
179
|
-
exports.NitroInput = (0, react_1.forwardRef)(function NitroInput({ value, defaultValue, mode, fractionDigits, maxIntegerDigits, groupingSeparator, decimalSeparator, prefix, suffix, prefixFontSize, suffixFontSize, affixAlign, signPlacement, prefixAlign, suffixAlign, letterSpacing, prefixSpacing, suffixSpacing, prefixOffset, suffixOffset, format, placeholder, placeholderTextColor, duration, easing, bounce, effect, fontSize, lineHeight, fontWeight, fontFamily, color, textAlign, cursorColor, selectionColor, caretHidden, adjustsFontSizeToFit, minimumFontScale, allowFontScaling, maxFontSizeMultiplier, variant, label, labelBehavior, labelColor, labelFocusedColor, labelFontSize, strokeColor, focusedStrokeColor, strokeWidth, cornerRadius, fillColor, keyboardType, inputMode, enterKeyHint, mask, maskNotations, maskAutocomplete, maskAutoSkip, returnKeyType, autoCapitalize, autoCorrect, editable, multiline, numberOfLines, rows, textAlignVertical, scrollEnabled, autoFocus, transition, autoWidth: autoWidthProp, submitBehavior, blurOnSubmit, secureTextEntry, keyboardAppearance, textContentType, autoComplete, enablesReturnKeyAutomatically, showSoftInputOnFocus, selectTextOnFocus, clearTextOnFocus, contextMenuHidden, spellCheck, readOnly, selection, onEndEditing, onSelectionChange, onKeyPress, maxLength, transform, onChangeText, onChange, onChangeValue, onChangeMask, onFocus, onBlur, onSubmitEditing, onNativeRef, style, ...viewProps }, ref) {
|
|
181
|
+
exports.NitroInput = (0, react_1.forwardRef)(function NitroInput({ value, defaultValue, mode, fractionDigits, maxIntegerDigits, groupingSeparator, decimalSeparator, prefix, suffix, prefixFontSize, suffixFontSize, affixAlign, signPlacement, prefixAlign, suffixAlign, letterSpacing, prefixSpacing, suffixSpacing, prefixOffset, suffixOffset, format, placeholder, placeholderTextColor, duration, easing, bounce, effect, fontSize, lineHeight, fontWeight, fontFamily, color, textAlign, cursorColor, selectionColor, caretHidden, adjustsFontSizeToFit, minimumFontScale, allowFontScaling, maxFontSizeMultiplier, variant, label, labelBehavior, labelColor, labelFocusedColor, labelFontSize, strokeColor, focusedStrokeColor, strokeWidth, cornerRadius, fillColor, keyboardType, inputMode, enterKeyHint, mask, maskNotations, maskAutocomplete, maskAutoSkip, maskAffinityFormats, maskAffinityStrategy, maskTextCase, maskCharacterMap, maskSlotPlaceholder, keepPlaceholder, returnKeyType, autoCapitalize, autoCorrect, editable, multiline, numberOfLines, rows, textAlignVertical, scrollEnabled, autoFocus, transition, autoWidth: autoWidthProp, submitBehavior, blurOnSubmit, secureTextEntry, keyboardAppearance, textContentType, autoComplete, enablesReturnKeyAutomatically, showSoftInputOnFocus, selectTextOnFocus, clearTextOnFocus, contextMenuHidden, spellCheck, readOnly, selection, onEndEditing, onSelectionChange, onKeyPress, maxLength, transform, onChangeText, onChange, onChangeValue, onChangeMask, onFocus, onBlur, onSubmitEditing, onNativeRef, style, ...viewProps }, ref) {
|
|
180
182
|
const nativeRef = (0, react_1.useRef)(null);
|
|
181
183
|
// What React Native's registry stores for this field. The React host
|
|
182
184
|
// instance when there is one (iOS), otherwise a stable per-instance token:
|
|
@@ -484,6 +486,17 @@ exports.NitroInput = (0, react_1.forwardRef)(function NitroInput({ value, defaul
|
|
|
484
486
|
const stableNotations = (0, react_1.useMemo)(() => (notationsKey !== '' && maskNotations ? [...maskNotations] : EMPTY_NOTATIONS),
|
|
485
487
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
486
488
|
[notationsKey]);
|
|
489
|
+
// The same for the affinity formats and the character map.
|
|
490
|
+
const affinityKey = maskAffinityFormats != null && maskAffinityFormats.length > 0 ? JSON.stringify(maskAffinityFormats) : '';
|
|
491
|
+
const stableAffinityFormats = (0, react_1.useMemo)(() => (affinityKey !== '' && maskAffinityFormats ? [...maskAffinityFormats] : EMPTY_STRINGS),
|
|
492
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
493
|
+
[affinityKey]);
|
|
494
|
+
const characterMapKey = maskCharacterMap != null && Object.keys(maskCharacterMap).length > 0 ? JSON.stringify(maskCharacterMap) : '';
|
|
495
|
+
const stableCharacterMap = (0, react_1.useMemo)(() => characterMapKey !== '' && maskCharacterMap
|
|
496
|
+
? Object.entries(maskCharacterMap).map(([from, to]) => ({ from, to }))
|
|
497
|
+
: EMPTY_MAPPINGS,
|
|
498
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
499
|
+
[characterMapKey]);
|
|
487
500
|
const resolvedFractionDigits = fractionDigits ?? derived?.fractionDigits ?? 2;
|
|
488
501
|
const resolvedKeyboardType = keyboardType ??
|
|
489
502
|
(inputMode != null
|
|
@@ -546,7 +559,7 @@ exports.NitroInput = (0, react_1.forwardRef)(function NitroInput({ value, defaul
|
|
|
546
559
|
? { width: size.width, height: size.height }
|
|
547
560
|
: { height: size.height }
|
|
548
561
|
: { height: resolvedFontSize * 1.25 }, [size, resolvedFontSize, autoWidth]);
|
|
549
|
-
return (react_1.default.createElement(exports.NativeNitroInputView, { ...hostViewProps, ref: hostRef, style: [autoSize, style], hybridRef: hybridRef, text: value ?? initialText, mostRecentEventCount: eventCountRef.current, mode: resolvedMode, plain: !reflows, fractionDigits: resolvedFractionDigits, maxIntegerDigits: maxIntegerDigits ?? 15, groupingSeparator: groupingSeparator ?? derived?.groupingSeparator ?? ',', decimalSeparator: decimalSeparator ?? derived?.decimalSeparator ?? '.', prefix: resolvedPrefix, suffix: resolvedSuffix, prefixFontSize: prefixFontSize ?? resolvedFontSize, suffixFontSize: suffixFontSize ?? resolvedFontSize, signPlacement: signPlacement ?? derived?.signPlacement ?? 'beforeAffix', prefixAlign: prefixAlign ?? resolvedAffixAlign, suffixAlign: suffixAlign ?? resolvedAffixAlign, letterSpacing: letterSpacing ?? 0, prefixSpacing: prefixSpacing ?? Infinity, suffixSpacing: suffixSpacing ?? Infinity, prefixOffset: prefixOffset ?? 0, suffixOffset: suffixOffset ?? 0, placeholder: placeholder ?? '', placeholderColor: processedPlaceholderColor, duration: duration ?? 400, easing: easing ?? 'expo', bounce: bounce ?? 0.15, effect: effect ?? 'auto', fontSize: resolvedFontSize, lineHeight: Math.max(0, lineHeight ?? 0), fontWeight: numericWeight, fontFamily: fontFamily ?? '', color: processedColor, textAlign: textAlign ?? 'auto', rightToLeft: rightToLeft, caretColor: processedCursorColor, selectionColor: processedSelectionColor, caretHidden: caretHidden ?? false, adjustsFontSizeToFit: adjustsFontSizeToFit ?? false, minimumFontScale: minimumFontScale ?? 0.5, allowFontScaling: allowFontScaling ?? false, maxFontSizeMultiplier: maxFontSizeMultiplier ?? 0, variant: variant ?? 'none', label: label ?? '', labelBehavior: labelBehavior ?? 'float', labelColor: processedLabelColor, labelFocusedColor: processedLabelFocusedColor, labelFontSize: labelFontSize ?? 0, strokeColor: processedStrokeColor, focusedStrokeColor: processedFocusedStrokeColor, strokeWidth: strokeWidth ?? 1, cornerRadius: cornerRadius ?? 8, fillColor: processedFillColor, mask: resolvedMode === 'mask' ? (mask ?? '') : '', maskNotations: stableNotations, maskAutocomplete: maskAutocomplete ?? true, maskAutoSkip: maskAutoSkip ?? false, onChangeMask: onChangeMaskCallback, keyboardType: resolvedKeyboardType, returnKeyType: resolvedReturnKeyType, autoCapitalize: autoCapitalize ?? 'sentences', autoCorrect: autoCorrect ?? true, editable: (editable ?? true) && !(readOnly ?? false), multiline: isMultiline, numberOfLines: Math.max(0, Math.trunc(numberOfLines ?? rows ?? 0)), textAlignVertical: textAlignVertical ?? 'auto', scrollEnabled: scrollEnabled ?? true, autoFocus: autoFocus ?? false, fieldTestID: viewProps.testID ?? '', fieldAccessibilityLabel: resolvedAccessibilityLabel ?? '', submitBehavior: submitBehavior ??
|
|
562
|
+
return (react_1.default.createElement(exports.NativeNitroInputView, { ...hostViewProps, ref: hostRef, style: [autoSize, style], hybridRef: hybridRef, text: value ?? initialText, mostRecentEventCount: eventCountRef.current, mode: resolvedMode, plain: !reflows, fractionDigits: resolvedFractionDigits, maxIntegerDigits: maxIntegerDigits ?? 15, groupingSeparator: groupingSeparator ?? derived?.groupingSeparator ?? ',', decimalSeparator: decimalSeparator ?? derived?.decimalSeparator ?? '.', prefix: resolvedPrefix, suffix: resolvedSuffix, prefixFontSize: prefixFontSize ?? resolvedFontSize, suffixFontSize: suffixFontSize ?? resolvedFontSize, signPlacement: signPlacement ?? derived?.signPlacement ?? 'beforeAffix', prefixAlign: prefixAlign ?? resolvedAffixAlign, suffixAlign: suffixAlign ?? resolvedAffixAlign, letterSpacing: letterSpacing ?? 0, prefixSpacing: prefixSpacing ?? Infinity, suffixSpacing: suffixSpacing ?? Infinity, prefixOffset: prefixOffset ?? 0, suffixOffset: suffixOffset ?? 0, placeholder: placeholder ?? '', placeholderColor: processedPlaceholderColor, duration: duration ?? 400, easing: easing ?? 'expo', bounce: bounce ?? 0.15, effect: effect ?? 'auto', fontSize: resolvedFontSize, lineHeight: Math.max(0, lineHeight ?? 0), fontWeight: numericWeight, fontFamily: fontFamily ?? '', color: processedColor, textAlign: textAlign ?? 'auto', rightToLeft: rightToLeft, caretColor: processedCursorColor, selectionColor: processedSelectionColor, caretHidden: caretHidden ?? false, adjustsFontSizeToFit: adjustsFontSizeToFit ?? false, minimumFontScale: minimumFontScale ?? 0.5, allowFontScaling: allowFontScaling ?? false, maxFontSizeMultiplier: maxFontSizeMultiplier ?? 0, variant: variant ?? 'none', label: label ?? '', labelBehavior: labelBehavior ?? 'float', labelColor: processedLabelColor, labelFocusedColor: processedLabelFocusedColor, labelFontSize: labelFontSize ?? 0, strokeColor: processedStrokeColor, focusedStrokeColor: processedFocusedStrokeColor, strokeWidth: strokeWidth ?? 1, cornerRadius: cornerRadius ?? 8, fillColor: processedFillColor, mask: resolvedMode === 'mask' ? (mask ?? '') : '', maskNotations: stableNotations, maskAutocomplete: maskAutocomplete ?? true, maskAutoSkip: maskAutoSkip ?? false, maskAffinityFormats: stableAffinityFormats, maskAffinityStrategy: maskAffinityStrategy ?? 'wholeString', maskTextCase: maskTextCase ?? 'none', maskCharacterMap: stableCharacterMap, maskSlotPlaceholder: maskSlotPlaceholder ?? (keepPlaceholder ? '_' : ''), keepPlaceholder: keepPlaceholder ?? false, onChangeMask: onChangeMaskCallback, keyboardType: resolvedKeyboardType, returnKeyType: resolvedReturnKeyType, autoCapitalize: autoCapitalize ?? 'sentences', autoCorrect: autoCorrect ?? true, editable: (editable ?? true) && !(readOnly ?? false), multiline: isMultiline, numberOfLines: Math.max(0, Math.trunc(numberOfLines ?? rows ?? 0)), textAlignVertical: textAlignVertical ?? 'auto', scrollEnabled: scrollEnabled ?? true, autoFocus: autoFocus ?? false, fieldTestID: viewProps.testID ?? '', fieldAccessibilityLabel: resolvedAccessibilityLabel ?? '', submitBehavior: submitBehavior ??
|
|
550
563
|
// As `TextInput` resolves the legacy `blurOnSubmit`: a multiline
|
|
551
564
|
// field's return key inserts a line break unless told to blur.
|
|
552
565
|
(multiline
|
|
@@ -48,6 +48,8 @@ const formatProps_1 = require("./formatProps");
|
|
|
48
48
|
* auto-sizing, color/weight conversion and a convenient handle.
|
|
49
49
|
*/
|
|
50
50
|
exports.NativeNitroNumberView = (0, react_native_nitro_modules_1.getHostComponent)('NitroNumberView', () => NitroNumberViewConfig_json_1.default);
|
|
51
|
+
const EMPTY = [];
|
|
52
|
+
const EMPTY_STRINGS = [];
|
|
51
53
|
/** Each transition's own timing, used when the props leave it unsaid. */
|
|
52
54
|
const TRANSITION_DEFAULTS = {
|
|
53
55
|
roll: { duration: 500, easing: 'easeInOut', stagger: 0 },
|
|
@@ -64,7 +66,7 @@ const TRANSITION_DEFAULTS = {
|
|
|
64
66
|
* The view sizes itself to its content unless you pass an explicit `width` /
|
|
65
67
|
* `height` in `style`.
|
|
66
68
|
*/
|
|
67
|
-
exports.NitroNumber = (0, react_1.forwardRef)(function NitroNumber({ value, fractionDigits, minimumIntegerDigits, groupingSeparator, decimalSeparator, prefix, suffix, transition, flashUpColor, flashDownColor, flashDuration, popOnChange, duration, easing, bounce, stagger, direction, reveal, revealStyle, revealDuration, revealBounce, revealGrow, revealStagger, revealMilestones, revealMilestoneHold, onRevealEnd, onRevealMilestone, loading, shimmerColor, shimmerDuration, fontSize, prefixFontSize, suffixFontSize, affixAlign, prefixAlign, suffixAlign, letterSpacing, prefixSpacing, suffixSpacing, prefixOffset, suffixOffset, tabularNums, format, adjustsFontSizeToFit, minimumFontScale, allowFontScaling, maxFontSizeMultiplier, fontWeight, fontFamily, color, textAlign, onNativeRef, style, ...viewProps }, ref) {
|
|
69
|
+
exports.NitroNumber = (0, react_1.forwardRef)(function NitroNumber({ value, fractionDigits, minimumIntegerDigits, groupingSeparator, decimalSeparator, prefix, suffix, transition, flashUpColor, flashDownColor, flashDuration, popOnChange, duration, easing, bounce, stagger, direction, reveal, revealStyle, revealDuration, revealBounce, revealGrow, revealStagger, revealMilestones, revealMilestoneHold, onRevealEnd, onRevealMilestone, loading, shimmerColor, shimmerDuration, shimmerAngle, shimmerWidth, shimmerBaseColor, shimmerDirection, shimmerDelay, fontSize, prefixFontSize, suffixFontSize, affixAlign, prefixAlign, suffixAlign, letterSpacing, prefixSpacing, suffixSpacing, prefixOffset, suffixOffset, tabularNums, format, adjustsFontSizeToFit, minimumFontScale, allowFontScaling, maxFontSizeMultiplier, fontWeight, fontFamily, color, textAlign, signDisplay, plusSign, minusSign, prefixColor, suffixColor, fractionColor, fractionFontSize, fractionAlign, digitGlyphs, groupingSizes, digits, continuous, animated, respectReduceMotion, onAnimationStart, onAnimationEnd, onNativeRef, style, ...viewProps }, ref) {
|
|
68
70
|
const nativeRef = (0, react_1.useRef)(null);
|
|
69
71
|
const latestOnNativeRef = (0, react_1.useRef)(onNativeRef);
|
|
70
72
|
latestOnNativeRef.current = onNativeRef;
|
|
@@ -74,6 +76,10 @@ exports.NitroNumber = (0, react_1.forwardRef)(function NitroNumber({ value, frac
|
|
|
74
76
|
latestOnRevealMilestone.current = onRevealMilestone;
|
|
75
77
|
const latestValue = (0, react_1.useRef)(value);
|
|
76
78
|
latestValue.current = value;
|
|
79
|
+
const latestOnAnimationStart = (0, react_1.useRef)(onAnimationStart);
|
|
80
|
+
latestOnAnimationStart.current = onAnimationStart;
|
|
81
|
+
const latestOnAnimationEnd = (0, react_1.useRef)(onAnimationEnd);
|
|
82
|
+
latestOnAnimationEnd.current = onAnimationEnd;
|
|
77
83
|
const [size, setSize] = (0, react_1.useState)(null);
|
|
78
84
|
// Nitro callbacks must be wrapped with `callback()` and the wrapper object
|
|
79
85
|
// has to be referentially stable, otherwise every render re-sets the prop.
|
|
@@ -96,6 +102,13 @@ exports.NitroNumber = (0, react_1.forwardRef)(function NitroNumber({ value, frac
|
|
|
96
102
|
const onRevealMilestoneCallback = (0, react_1.useMemo)(() => (0, react_native_nitro_modules_1.callback)((index, milestone) => {
|
|
97
103
|
latestOnRevealMilestone.current?.(index, milestone);
|
|
98
104
|
}), []);
|
|
105
|
+
const onAnimationStartCallback = (0, react_1.useMemo)(() => (0, react_native_nitro_modules_1.callback)(() => {
|
|
106
|
+
latestOnAnimationStart.current?.();
|
|
107
|
+
}), []);
|
|
108
|
+
// The figure a compact format rolls is not the value (1.2 for 1,234): report the value.
|
|
109
|
+
const onAnimationEndCallback = (0, react_1.useMemo)(() => (0, react_native_nitro_modules_1.callback)((shown) => {
|
|
110
|
+
latestOnAnimationEnd.current?.(compactRef.current ? latestValue.current : shown);
|
|
111
|
+
}), []);
|
|
99
112
|
// A new array literal each render must not re-set the native prop. Always an
|
|
100
113
|
// array (empty = no tiers): removing the prop would reach native as `null`,
|
|
101
114
|
// which Nitro's array parser rejects ("Value is null, expected an Object").
|
|
@@ -109,7 +122,7 @@ exports.NitroNumber = (0, react_1.forwardRef)(function NitroNumber({ value, frac
|
|
|
109
122
|
jumpTo: (next) => nativeRef.current?.jumpTo(next),
|
|
110
123
|
animateTo: (next) => nativeRef.current?.animateTo(next),
|
|
111
124
|
revealTo: (next) => nativeRef.current?.revealTo(next),
|
|
112
|
-
getValue: () => nativeRef.current?.value ?? latestValue.current,
|
|
125
|
+
getValue: () => (compactRef.current ? latestValue.current : nativeRef.current?.value ?? latestValue.current),
|
|
113
126
|
get native() {
|
|
114
127
|
return nativeRef.current;
|
|
115
128
|
},
|
|
@@ -123,12 +136,48 @@ exports.NitroNumber = (0, react_1.forwardRef)(function NitroNumber({ value, frac
|
|
|
123
136
|
// render and had the whole configuration re-applied on every value change.
|
|
124
137
|
const processedColor = (0, react_1.useMemo)(() => (0, styleHelpers_1.toProcessedColor)(color) ?? Infinity, [color]);
|
|
125
138
|
const processedShimmerColor = (0, react_1.useMemo)(() => (0, styleHelpers_1.toProcessedColor)(shimmerColor) ?? Infinity, [shimmerColor]);
|
|
139
|
+
const processedShimmerBase = (0, react_1.useMemo)(() => (0, styleHelpers_1.toProcessedColor)(shimmerBaseColor) ?? Infinity, [shimmerBaseColor]);
|
|
126
140
|
const processedFlashUp = (0, react_1.useMemo)(() => (0, styleHelpers_1.toProcessedColor)(flashUpColor) ?? Infinity, [flashUpColor]);
|
|
127
141
|
const processedFlashDown = (0, react_1.useMemo)(() => (0, styleHelpers_1.toProcessedColor)(flashDownColor) ?? Infinity, [flashDownColor]);
|
|
128
142
|
const numericWeight = (0, styleHelpers_1.toNumericWeight)(fontWeight) ?? 400;
|
|
129
143
|
const resolvedFontSize = fontSize ?? 32;
|
|
130
144
|
const resolvedAffixAlign = affixAlign ?? 'baseline';
|
|
131
145
|
const derived = format ? (0, formatProps_1.formatProps)(format) : undefined;
|
|
146
|
+
// Compact notation: "1.2K" rolls the figure 1.2 and swaps the suffix.
|
|
147
|
+
const compact = format && derived?.compact ? (0, formatProps_1.compactParts)(format, value) : undefined;
|
|
148
|
+
const compactRef = (0, react_1.useRef)(false);
|
|
149
|
+
compactRef.current = compact !== undefined;
|
|
150
|
+
// Which way the value moved, for a compact figure that fell while the value grew (999 → 1K).
|
|
151
|
+
const previousValue = (0, react_1.useRef)(value);
|
|
152
|
+
const compactDirection = compact && direction === undefined ? (value >= previousValue.current ? 'up' : 'down') : undefined;
|
|
153
|
+
previousValue.current = value;
|
|
154
|
+
const processedPrefixColor = (0, react_1.useMemo)(() => (0, styleHelpers_1.toProcessedColor)(prefixColor) ?? Infinity, [prefixColor]);
|
|
155
|
+
const processedSuffixColor = (0, react_1.useMemo)(() => (0, styleHelpers_1.toProcessedColor)(suffixColor) ?? Infinity, [suffixColor]);
|
|
156
|
+
const processedFractionColor = (0, react_1.useMemo)(() => (0, styleHelpers_1.toProcessedColor)(fractionColor) ?? Infinity, [fractionColor]);
|
|
157
|
+
// Arrays reach native only when their contents change.
|
|
158
|
+
const digitMaxKey = digits ? JSON.stringify(digits) : '';
|
|
159
|
+
const digitMax = (0, react_1.useMemo)(() => {
|
|
160
|
+
if (!digits)
|
|
161
|
+
return EMPTY;
|
|
162
|
+
const out = [];
|
|
163
|
+
for (const [position, spec] of Object.entries(digits)) {
|
|
164
|
+
const index = Number(position);
|
|
165
|
+
if (!Number.isInteger(index) || index < 0 || index >= 20)
|
|
166
|
+
continue;
|
|
167
|
+
while (out.length <= index)
|
|
168
|
+
out.push(9);
|
|
169
|
+
out[index] = spec.max;
|
|
170
|
+
}
|
|
171
|
+
return out;
|
|
172
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
173
|
+
}, [digitMaxKey]);
|
|
174
|
+
const glyphs = digitGlyphs ?? derived?.digitGlyphs ?? EMPTY_STRINGS;
|
|
175
|
+
const glyphsKey = glyphs.join('|');
|
|
176
|
+
const stableGlyphs = (0, react_1.useMemo)(() => glyphs, [glyphsKey]); // eslint-disable-line react-hooks/exhaustive-deps
|
|
177
|
+
const groups = groupingSizes ?? derived?.groupingSizes ?? EMPTY;
|
|
178
|
+
const groupsKey = groups.join(',');
|
|
179
|
+
const stableGroups = (0, react_1.useMemo)(() => groups, [groupsKey]); // eslint-disable-line react-hooks/exhaustive-deps
|
|
180
|
+
const still = animated === false;
|
|
132
181
|
const autoSize = (0, react_1.useMemo)(() => size !== null
|
|
133
182
|
? { width: size.width, height: size.height }
|
|
134
183
|
: { height: (fontSize ?? 32) * 1.25 }, [size, fontSize]);
|
|
@@ -137,5 +186,5 @@ exports.NitroNumber = (0, react_1.forwardRef)(function NitroNumber({ value, frac
|
|
|
137
186
|
// does not hand a Hybrid View its resolved direction, so native is told.
|
|
138
187
|
const layoutDirection = (0, react_1.useMemo)(() => react_native_1.StyleSheet.flatten(style)?.direction, [style]);
|
|
139
188
|
const rightToLeft = layoutDirection === 'rtl' || (layoutDirection !== 'ltr' && react_native_1.I18nManager.isRTL);
|
|
140
|
-
return (react_1.default.createElement(exports.NativeNitroNumberView, { ...viewProps, style: [autoSize, style], hybridRef: hybridRef, value: value, fractionDigits: fractionDigits ?? derived?.fractionDigits ?? 0, minimumIntegerDigits: minimumIntegerDigits ?? derived?.minimumIntegerDigits ?? 1, groupingSeparator: groupingSeparator ?? derived?.groupingSeparator ?? '', decimalSeparator: decimalSeparator ?? derived?.decimalSeparator ?? '.', prefix: prefix ?? derived?.prefix ?? '', suffix: suffix ?? derived?.suffix ?? '', transition: transition ?? 'roll', flashUpColor: processedFlashUp, flashDownColor: processedFlashDown, flashDuration: flashDuration ?? 600, popOnChange: popOnChange ?? 0, duration: duration ?? TRANSITION_DEFAULTS[transition ?? 'roll'].duration, easing: easing ?? TRANSITION_DEFAULTS[transition ?? 'roll'].easing, bounce: bounce ?? 0.15, stagger: stagger ?? TRANSITION_DEFAULTS[transition ?? 'roll'].stagger, rollDirection: direction ?? 'auto', revealState: reveal === undefined ? 0 : reveal ? 2 : 1, revealStyle: revealStyle ?? 'count', revealDuration: revealDuration ?? 2200, revealBounce: revealBounce ?? 0.12, revealGrow: revealGrow ?? 0.2, revealStagger: revealStagger ?? 200, revealMilestones: stableMilestones, revealMilestoneHold: revealMilestoneHold ?? 0, onRevealEnd: onRevealEndCallback, onRevealMilestone: onRevealMilestoneCallback, loading: loading ?? false, shimmerColor: processedShimmerColor, shimmerDuration: shimmerDuration ?? 950, fontSize: resolvedFontSize, prefixFontSize: prefixFontSize ?? resolvedFontSize, suffixFontSize: suffixFontSize ?? resolvedFontSize, affixAlign: resolvedAffixAlign, prefixAlign: prefixAlign ?? resolvedAffixAlign, suffixAlign: suffixAlign ?? resolvedAffixAlign, letterSpacing: letterSpacing ?? 0, prefixSpacing: prefixSpacing ?? Infinity, suffixSpacing: suffixSpacing ?? Infinity, prefixOffset: prefixOffset ?? 0, suffixOffset: suffixOffset ?? 0, tabularNums: tabularNums ?? true, adjustsFontSizeToFit: adjustsFontSizeToFit ?? false, minimumFontScale: minimumFontScale ?? 0.5, allowFontScaling: allowFontScaling ?? false, maxFontSizeMultiplier: maxFontSizeMultiplier ?? 0, fontWeight: numericWeight, fontFamily: fontFamily ?? '', color: processedColor, textAlign: textAlign ?? 'auto', rightToLeft: rightToLeft, onSizeChange: onSizeChange }));
|
|
189
|
+
return (react_1.default.createElement(exports.NativeNitroNumberView, { ...viewProps, style: [autoSize, style], hybridRef: hybridRef, value: compact ? compact.value : value, fractionDigits: fractionDigits ?? compact?.fractionDigits ?? derived?.fractionDigits ?? 0, minimumIntegerDigits: minimumIntegerDigits ?? derived?.minimumIntegerDigits ?? 1, groupingSeparator: groupingSeparator ?? derived?.groupingSeparator ?? '', decimalSeparator: decimalSeparator ?? derived?.decimalSeparator ?? '.', prefix: prefix ?? compact?.prefix ?? derived?.prefix ?? '', suffix: suffix ?? compact?.suffix ?? derived?.suffix ?? '', transition: transition ?? 'roll', flashUpColor: processedFlashUp, flashDownColor: processedFlashDown, flashDuration: flashDuration ?? 600, popOnChange: popOnChange ?? 0, duration: still ? 0 : duration ?? TRANSITION_DEFAULTS[transition ?? 'roll'].duration, easing: easing ?? TRANSITION_DEFAULTS[transition ?? 'roll'].easing, bounce: bounce ?? 0.15, stagger: stagger ?? TRANSITION_DEFAULTS[transition ?? 'roll'].stagger, rollDirection: direction ?? compactDirection ?? 'auto', revealState: reveal === undefined ? 0 : reveal ? 2 : 1, revealStyle: revealStyle ?? 'count', revealDuration: still ? 0 : revealDuration ?? 2200, revealBounce: revealBounce ?? 0.12, revealGrow: revealGrow ?? 0.2, revealStagger: revealStagger ?? 200, revealMilestones: stableMilestones, revealMilestoneHold: revealMilestoneHold ?? 0, onRevealEnd: onRevealEndCallback, onRevealMilestone: onRevealMilestoneCallback, onAnimationStart: onAnimationStartCallback, onAnimationEnd: onAnimationEndCallback, loading: loading ?? false, shimmerColor: processedShimmerColor, shimmerDuration: shimmerDuration ?? 950, shimmerAngle: shimmerAngle ?? 31, shimmerWidth: shimmerWidth ?? 1, shimmerBaseColor: processedShimmerBase, shimmerDirection: shimmerDirection ?? 'auto', shimmerDelay: shimmerDelay ?? 0, fontSize: resolvedFontSize, prefixFontSize: prefixFontSize ?? resolvedFontSize, suffixFontSize: suffixFontSize ?? resolvedFontSize, affixAlign: resolvedAffixAlign, prefixAlign: prefixAlign ?? resolvedAffixAlign, suffixAlign: suffixAlign ?? resolvedAffixAlign, letterSpacing: letterSpacing ?? 0, prefixSpacing: prefixSpacing ?? Infinity, suffixSpacing: suffixSpacing ?? Infinity, prefixOffset: prefixOffset ?? 0, suffixOffset: suffixOffset ?? 0, tabularNums: tabularNums ?? true, signDisplay: signDisplay ?? derived?.signDisplay ?? 'auto', plusSign: plusSign ?? derived?.plusSign ?? '+', minusSign: minusSign ?? derived?.minusSign ?? '-', digitGlyphs: stableGlyphs, groupingSizes: stableGroups, digitMax: digitMax, continuous: continuous ?? false, prefixColor: processedPrefixColor, suffixColor: processedSuffixColor, fractionColor: processedFractionColor, fractionFontSize: fractionFontSize ?? Infinity, fractionAlign: fractionAlign ?? 'baseline', respectReduceMotion: respectReduceMotion ?? true, adjustsFontSizeToFit: adjustsFontSizeToFit ?? false, minimumFontScale: minimumFontScale ?? 0.5, allowFontScaling: allowFontScaling ?? false, maxFontSizeMultiplier: maxFontSizeMultiplier ?? 0, fontWeight: numericWeight, fontFamily: fontFamily ?? '', color: processedColor, textAlign: textAlign ?? 'auto', rightToLeft: rightToLeft, onSizeChange: onSizeChange }));
|
|
141
190
|
});
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
36
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
|
+
};
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.NativeNitroTextView = void 0;
|
|
40
|
+
exports.NitroText = NitroText;
|
|
41
|
+
const react_1 = __importStar(require("react"));
|
|
42
|
+
const react_native_1 = require("react-native");
|
|
43
|
+
const react_native_nitro_modules_1 = require("react-native-nitro-modules");
|
|
44
|
+
const NitroTextViewConfig_json_1 = __importDefault(require("../nitrogen/generated/shared/json/NitroTextViewConfig.json"));
|
|
45
|
+
const styleHelpers_1 = require("./styleHelpers");
|
|
46
|
+
/** The raw Nitro host component behind {@link NitroText}. */
|
|
47
|
+
exports.NativeNitroTextView = (0, react_native_nitro_modules_1.getHostComponent)('NitroTextView', () => NitroTextViewConfig_json_1.default);
|
|
48
|
+
let measurer = null;
|
|
49
|
+
function measure() {
|
|
50
|
+
measurer ??= react_native_nitro_modules_1.NitroModules.createHybridObject('NitroTextMeasure');
|
|
51
|
+
return measurer;
|
|
52
|
+
}
|
|
53
|
+
const lineHeights = new Map();
|
|
54
|
+
/**
|
|
55
|
+
* A single line of text that morphs to the next, natively, as Torph does on
|
|
56
|
+
* the web: the characters the two share glide to their new places, digits
|
|
57
|
+
* matched by place ("$1,204" → "$1,318" rolls the hundreds and tens), and the
|
|
58
|
+
* rest fade out and in ("Sign in" → "Signing in…"). At rest it is one line
|
|
59
|
+
* drawn in one pass, like a label: no text field, no layer per character.
|
|
60
|
+
* It sizes itself to its text in the render that mounts it (a native
|
|
61
|
+
* measurement, synchronously); a `width` in `style` overrides it.
|
|
62
|
+
*
|
|
63
|
+
* Only the props that were set go to the native view, as
|
|
64
|
+
* react-native-plain-text does: every prop that crosses is converted and
|
|
65
|
+
* stored per view in the commit, and the native side holds the defaults.
|
|
66
|
+
*/
|
|
67
|
+
function NitroText({ children, fontSize, fontWeight, fontFamily, color, letterSpacing, textAlign, allowFontScaling, maxFontSizeMultiplier, duration, easing, bounce, effect, respectReduceMotion, loading, shimmerColor, shimmerDuration, shimmerAngle, shimmerWidth, shimmerBaseColor, shimmerDirection, shimmerDelay, style, ...viewProps }) {
|
|
68
|
+
const text = typeof children === 'string' ? children : String(children);
|
|
69
|
+
const scale = allowFontScaling
|
|
70
|
+
? maxFontSizeMultiplier && maxFontSizeMultiplier > 0
|
|
71
|
+
? Math.min(react_native_1.PixelRatio.getFontScale(), maxFontSizeMultiplier)
|
|
72
|
+
: react_native_1.PixelRatio.getFontScale()
|
|
73
|
+
: 1;
|
|
74
|
+
const size = (fontSize ?? 17) * scale;
|
|
75
|
+
const weight = fontWeight === undefined ? 400 : (0, styleHelpers_1.toNumericWeight)(fontWeight) ?? 400;
|
|
76
|
+
const family = fontFamily ?? '';
|
|
77
|
+
const spacing = letterSpacing ?? 0;
|
|
78
|
+
const width = (0, react_1.useMemo)(() => measure().measure(text, size, weight, family, spacing), [text, size, weight, family, spacing]);
|
|
79
|
+
const fontKey = `${size}|${weight}|${family}`;
|
|
80
|
+
let height = lineHeights.get(fontKey);
|
|
81
|
+
if (height === undefined) {
|
|
82
|
+
height = measure().lineHeight(size, weight, family);
|
|
83
|
+
lineHeights.set(fontKey, height);
|
|
84
|
+
}
|
|
85
|
+
const native = viewProps;
|
|
86
|
+
native.text = text;
|
|
87
|
+
native.style = style == null ? { width: Math.ceil(width), height } : [{ width: Math.ceil(width), height }, style];
|
|
88
|
+
if (size !== 17)
|
|
89
|
+
native.fontSize = size;
|
|
90
|
+
if (weight !== 400)
|
|
91
|
+
native.fontWeight = weight;
|
|
92
|
+
if (family !== '')
|
|
93
|
+
native.fontFamily = family;
|
|
94
|
+
if (spacing !== 0)
|
|
95
|
+
native.letterSpacing = spacing;
|
|
96
|
+
const processedColor = (0, styleHelpers_1.toProcessedColor)(color);
|
|
97
|
+
if (processedColor !== undefined)
|
|
98
|
+
native.color = processedColor;
|
|
99
|
+
if (textAlign !== undefined)
|
|
100
|
+
native.textAlign = textAlign;
|
|
101
|
+
if (duration !== undefined)
|
|
102
|
+
native.duration = duration;
|
|
103
|
+
if (easing !== undefined)
|
|
104
|
+
native.easing = easing;
|
|
105
|
+
if (bounce !== undefined)
|
|
106
|
+
native.bounce = bounce;
|
|
107
|
+
if (effect !== undefined)
|
|
108
|
+
native.effect = effect;
|
|
109
|
+
if (respectReduceMotion !== undefined)
|
|
110
|
+
native.respectReduceMotion = respectReduceMotion;
|
|
111
|
+
if (loading !== undefined)
|
|
112
|
+
native.loading = loading;
|
|
113
|
+
const processedShimmerColor = (0, styleHelpers_1.toProcessedColor)(shimmerColor);
|
|
114
|
+
if (processedShimmerColor !== undefined)
|
|
115
|
+
native.shimmerColor = processedShimmerColor;
|
|
116
|
+
if (shimmerDuration !== undefined)
|
|
117
|
+
native.shimmerDuration = shimmerDuration;
|
|
118
|
+
if (shimmerAngle !== undefined)
|
|
119
|
+
native.shimmerAngle = shimmerAngle;
|
|
120
|
+
if (shimmerWidth !== undefined)
|
|
121
|
+
native.shimmerWidth = shimmerWidth;
|
|
122
|
+
const processedShimmerBaseColor = (0, styleHelpers_1.toProcessedColor)(shimmerBaseColor);
|
|
123
|
+
if (processedShimmerBaseColor !== undefined)
|
|
124
|
+
native.shimmerBaseColor = processedShimmerBaseColor;
|
|
125
|
+
if (shimmerDirection !== undefined)
|
|
126
|
+
native.shimmerDirection = shimmerDirection;
|
|
127
|
+
if (shimmerDelay !== undefined)
|
|
128
|
+
native.shimmerDelay = shimmerDelay;
|
|
129
|
+
// The start edge follows the layout direction, the app's unless the style sets one.
|
|
130
|
+
const direction = style == null ? undefined : react_native_1.StyleSheet.flatten(style).direction;
|
|
131
|
+
if (direction === 'rtl' || (direction !== 'ltr' && react_native_1.I18nManager.isRTL))
|
|
132
|
+
native.rightToLeft = true;
|
|
133
|
+
// The native view is the accessibility element, labelled with its text and
|
|
134
|
+
// announced as text. A label from outside takes over, on this view.
|
|
135
|
+
if (native.accessibilityLabel != null && native.accessible === undefined)
|
|
136
|
+
native.accessible = true;
|
|
137
|
+
return react_1.default.createElement(exports.NativeNitroTextView, { ...native });
|
|
138
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.NitroTime = void 0;
|
|
37
|
+
const react_1 = __importStar(require("react"));
|
|
38
|
+
const NitroNumber_1 = require("./NitroNumber");
|
|
39
|
+
const LAYOUT = {
|
|
40
|
+
'm:ss': { hours: false, digits: 3 },
|
|
41
|
+
'mm:ss': { hours: false, digits: 4 },
|
|
42
|
+
'h:mm:ss': { hours: true, digits: 5 },
|
|
43
|
+
'hh:mm:ss': { hours: true, digits: 6 },
|
|
44
|
+
};
|
|
45
|
+
// The tens of seconds, and of minutes when hours are shown, wrap after 5.
|
|
46
|
+
const SECONDS = { 1: { max: 5 } };
|
|
47
|
+
const MINUTES_AND_SECONDS = { 1: { max: 5 }, 3: { max: 5 } };
|
|
48
|
+
// One separator before the seconds: 125:00 is 125 minutes, not 1:25:00.
|
|
49
|
+
const MINUTES_ONLY = [2, 0];
|
|
50
|
+
const PAIRS = [2];
|
|
51
|
+
/**
|
|
52
|
+
* A clock, a timer or a countdown: `NitroNumber` with the time as its figure
|
|
53
|
+
* (12:34:56 is 123456), grouped in pairs, and the tens of seconds and minutes
|
|
54
|
+
* wrapping after 5, so 0:59 → 1:00 turns them one step, as a clock's wheels
|
|
55
|
+
* do, instead of rolling back through 4, 3, 2, 1.
|
|
56
|
+
*/
|
|
57
|
+
exports.NitroTime = (0, react_1.forwardRef)(function NitroTime({ seconds, timeFormat = 'm:ss', separator = ':', ...props }, ref) {
|
|
58
|
+
const layout = LAYOUT[timeFormat];
|
|
59
|
+
const total = Math.max(0, Math.floor(Number.isFinite(seconds) ? seconds : 0));
|
|
60
|
+
const s = total % 60;
|
|
61
|
+
const value = layout.hours
|
|
62
|
+
? Math.floor(total / 3600) * 10000 + (Math.floor(total / 60) % 60) * 100 + s
|
|
63
|
+
: Math.floor(total / 60) * 100 + s;
|
|
64
|
+
return (react_1.default.createElement(NitroNumber_1.NitroNumber, { ref: ref, value: value, minimumIntegerDigits: layout.digits, groupingSeparator: separator, groupingSizes: layout.hours ? PAIRS : MINUTES_ONLY, digits: layout.hours ? MINUTES_AND_SECONDS : SECONDS, ...props }));
|
|
65
|
+
});
|
|
@@ -1,16 +1,38 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.formatProps = formatProps;
|
|
4
|
+
exports.compactParts = compactParts;
|
|
4
5
|
const NumberFormat_1 = require("./NumberFormat");
|
|
5
6
|
const NUMBER_PARTS = new Set(['integer', 'group', 'decimal', 'fraction']);
|
|
6
7
|
// By the native formatter, which instances built with the same locales and options share.
|
|
7
8
|
const cache = new WeakMap();
|
|
9
|
+
function join(parts, from, to) {
|
|
10
|
+
return parts
|
|
11
|
+
.slice(from, to)
|
|
12
|
+
.map((p) => p.value)
|
|
13
|
+
.join('');
|
|
14
|
+
}
|
|
15
|
+
/** The text before and after the number in `parts`. */
|
|
16
|
+
function affixes(parts) {
|
|
17
|
+
const first = parts.findIndex((p) => NUMBER_PARTS.has(p.type));
|
|
18
|
+
let last = first;
|
|
19
|
+
parts.forEach((p, i) => {
|
|
20
|
+
if (NUMBER_PARTS.has(p.type))
|
|
21
|
+
last = i;
|
|
22
|
+
});
|
|
23
|
+
// The sign is the component's own glyph, not part of an affix.
|
|
24
|
+
const unsigned = (from, to) => join(parts.map((p) => (p.type === 'minusSign' || p.type === 'plusSign' ? { ...p, value: '' } : p)), from, to);
|
|
25
|
+
return {
|
|
26
|
+
prefix: first < 0 ? '' : unsigned(0, first),
|
|
27
|
+
suffix: first < 0 ? '' : unsigned(last + 1, parts.length),
|
|
28
|
+
};
|
|
29
|
+
}
|
|
8
30
|
/**
|
|
9
31
|
* The prefix, suffix, separators and digit counts of `format`, read off its
|
|
10
32
|
* parts once and cached per formatter. The components keep their own model
|
|
11
|
-
* (a sign, a prefix, digits
|
|
12
|
-
*
|
|
13
|
-
*
|
|
33
|
+
* (a sign, a prefix, digits in groups, a suffix), so a format outside it
|
|
34
|
+
* (accounting parentheses, a unit between the digits) is followed as far as
|
|
35
|
+
* that model goes.
|
|
14
36
|
*/
|
|
15
37
|
function formatProps(format) {
|
|
16
38
|
const key = (0, NumberFormat_1.sharedFormatterOf)(format) ?? format;
|
|
@@ -18,31 +40,69 @@ function formatProps(format) {
|
|
|
18
40
|
if (cached)
|
|
19
41
|
return cached;
|
|
20
42
|
const resolved = format.resolvedOptions();
|
|
43
|
+
const compact = resolved.notation === 'compact';
|
|
21
44
|
const fractionDigits = resolved.maximumFractionDigits ?? 0;
|
|
22
45
|
// A value with every part: groups, and a fraction when the format has one.
|
|
23
|
-
|
|
24
|
-
const
|
|
25
|
-
let last = first;
|
|
26
|
-
parts.forEach((p, i) => {
|
|
27
|
-
if (NUMBER_PARTS.has(p.type))
|
|
28
|
-
last = i;
|
|
29
|
-
});
|
|
30
|
-
const text = (from, to) => parts
|
|
31
|
-
.slice(from, to)
|
|
32
|
-
.map((p) => p.value)
|
|
33
|
-
.join('');
|
|
46
|
+
// Compact notation would print it "1.2M", so its affixes come per value.
|
|
47
|
+
const parts = format.formatToParts(compact ? 1 : fractionDigits > 0 ? 1234567.5 : 1234567);
|
|
34
48
|
const negative = format.formatToParts(-1);
|
|
35
49
|
const minus = negative.findIndex((p) => p.type === 'minusSign');
|
|
36
50
|
const currency = negative.findIndex((p) => p.type === 'currency' || p.type === 'percentSign');
|
|
51
|
+
const integers = parts.filter((p) => p.type === 'integer').map((p) => p.value.length);
|
|
37
52
|
const props = {
|
|
38
|
-
|
|
39
|
-
suffix: first < 0 ? '' : text(last + 1, parts.length),
|
|
53
|
+
...affixes(parts),
|
|
40
54
|
groupingSeparator: parts.find((p) => p.type === 'group')?.value ?? '',
|
|
41
55
|
decimalSeparator: parts.find((p) => p.type === 'decimal')?.value ?? '.',
|
|
42
56
|
fractionDigits,
|
|
43
57
|
minimumIntegerDigits: resolved.minimumIntegerDigits,
|
|
44
58
|
signPlacement: minus >= 0 && currency >= 0 && minus > currency ? 'afterAffix' : 'beforeAffix',
|
|
59
|
+
signDisplay: (resolved.signDisplay ?? 'auto'),
|
|
60
|
+
minusSign: negative[minus]?.value ?? '-',
|
|
61
|
+
plusSign: '+',
|
|
62
|
+
digitGlyphs: digitGlyphsOf(resolved.locale, resolved.numberingSystem),
|
|
63
|
+
// "12,34,567": the last group is the first size, the one before it every later one.
|
|
64
|
+
groupingSizes: integers.length >= 3 ? [integers[integers.length - 1], integers[integers.length - 2]] : [3],
|
|
65
|
+
compact,
|
|
45
66
|
};
|
|
46
67
|
cache.set(key, props);
|
|
47
68
|
return props;
|
|
48
69
|
}
|
|
70
|
+
const digitGlyphCache = new Map();
|
|
71
|
+
/** The ten digits of a numbering system, or [] for Latin ones. */
|
|
72
|
+
function digitGlyphsOf(locale, numberingSystem) {
|
|
73
|
+
if (!numberingSystem || numberingSystem === 'latn')
|
|
74
|
+
return [];
|
|
75
|
+
const cached = digitGlyphCache.get(numberingSystem);
|
|
76
|
+
if (cached)
|
|
77
|
+
return cached;
|
|
78
|
+
const digits = new NumberFormat_1.NumberFormat(locale, { numberingSystem, useGrouping: false });
|
|
79
|
+
const glyphs = Array.from({ length: 10 }, (_, d) => digits.format(d));
|
|
80
|
+
const result = glyphs.every((g, d) => g === String(d)) ? [] : glyphs;
|
|
81
|
+
digitGlyphCache.set(numberingSystem, result);
|
|
82
|
+
return result;
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Compact notation's parts for `value`: "1.2K" is the figure 1.2 with the
|
|
86
|
+
* suffix "K", so the digits roll and the suffix swaps as the value crosses
|
|
87
|
+
* a thousand, a million…
|
|
88
|
+
*/
|
|
89
|
+
function compactParts(format, value) {
|
|
90
|
+
const parts = format.formatToParts(value);
|
|
91
|
+
const props = formatProps(format);
|
|
92
|
+
const latin = (text) => props.digitGlyphs.length === 10
|
|
93
|
+
? Array.from(text)
|
|
94
|
+
.map((c) => {
|
|
95
|
+
const d = props.digitGlyphs.indexOf(c);
|
|
96
|
+
return d >= 0 ? String(d) : c;
|
|
97
|
+
})
|
|
98
|
+
.join('')
|
|
99
|
+
: text;
|
|
100
|
+
const integer = latin(parts.filter((p) => p.type === 'integer').map((p) => p.value).join(''));
|
|
101
|
+
const fraction = latin(parts.filter((p) => p.type === 'fraction').map((p) => p.value).join(''));
|
|
102
|
+
const magnitude = Number(fraction ? `${integer}.${fraction}` : integer);
|
|
103
|
+
return {
|
|
104
|
+
value: (value < 0 ? -1 : 1) * (Number.isFinite(magnitude) ? magnitude : 0),
|
|
105
|
+
fractionDigits: fraction.length,
|
|
106
|
+
...affixes(parts),
|
|
107
|
+
};
|
|
108
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.NumberFormat = exports.NativeNitroNumberView = exports.NitroNumber = exports.useNitroInputState = exports.isWorklet = exports.NativeNitroInputView = exports.NitroInput = void 0;
|
|
3
|
+
exports.NumberFormat = exports.NativeNitroTextView = exports.NitroText = exports.NitroTime = exports.NativeNitroNumberView = exports.NitroNumber = exports.useNitroInputState = exports.isWorklet = exports.NativeNitroInputView = exports.NitroInput = void 0;
|
|
4
4
|
var NitroInput_1 = require("./NitroInput");
|
|
5
5
|
Object.defineProperty(exports, "NitroInput", { enumerable: true, get: function () { return NitroInput_1.NitroInput; } });
|
|
6
6
|
Object.defineProperty(exports, "NativeNitroInputView", { enumerable: true, get: function () { return NitroInput_1.NativeNitroInputView; } });
|
|
@@ -11,5 +11,10 @@ Object.defineProperty(exports, "useNitroInputState", { enumerable: true, get: fu
|
|
|
11
11
|
var NitroNumber_1 = require("./NitroNumber");
|
|
12
12
|
Object.defineProperty(exports, "NitroNumber", { enumerable: true, get: function () { return NitroNumber_1.NitroNumber; } });
|
|
13
13
|
Object.defineProperty(exports, "NativeNitroNumberView", { enumerable: true, get: function () { return NitroNumber_1.NativeNitroNumberView; } });
|
|
14
|
+
var NitroTime_1 = require("./NitroTime");
|
|
15
|
+
Object.defineProperty(exports, "NitroTime", { enumerable: true, get: function () { return NitroTime_1.NitroTime; } });
|
|
16
|
+
var NitroText_1 = require("./NitroText");
|
|
17
|
+
Object.defineProperty(exports, "NitroText", { enumerable: true, get: function () { return NitroText_1.NitroText; } });
|
|
18
|
+
Object.defineProperty(exports, "NativeNitroTextView", { enumerable: true, get: function () { return NitroText_1.NativeNitroTextView; } });
|
|
14
19
|
var NumberFormat_1 = require("./NumberFormat");
|
|
15
20
|
Object.defineProperty(exports, "NumberFormat", { enumerable: true, get: function () { return NumberFormat_1.NumberFormat; } });
|
|
@@ -14,6 +14,12 @@
|
|
|
14
14
|
"maskNotations": true,
|
|
15
15
|
"maskAutocomplete": true,
|
|
16
16
|
"maskAutoSkip": true,
|
|
17
|
+
"maskAffinityFormats": true,
|
|
18
|
+
"maskAffinityStrategy": true,
|
|
19
|
+
"maskTextCase": true,
|
|
20
|
+
"maskCharacterMap": true,
|
|
21
|
+
"maskSlotPlaceholder": true,
|
|
22
|
+
"keepPlaceholder": true,
|
|
17
23
|
"groupingSeparator": true,
|
|
18
24
|
"decimalSeparator": true,
|
|
19
25
|
"variant": true,
|
|
@@ -32,6 +32,11 @@
|
|
|
32
32
|
"loading": true,
|
|
33
33
|
"shimmerColor": true,
|
|
34
34
|
"shimmerDuration": true,
|
|
35
|
+
"shimmerAngle": true,
|
|
36
|
+
"shimmerWidth": true,
|
|
37
|
+
"shimmerBaseColor": true,
|
|
38
|
+
"shimmerDirection": true,
|
|
39
|
+
"shimmerDelay": true,
|
|
35
40
|
"fontSize": true,
|
|
36
41
|
"prefixFontSize": true,
|
|
37
42
|
"suffixFontSize": true,
|
|
@@ -44,6 +49,19 @@
|
|
|
44
49
|
"prefixOffset": true,
|
|
45
50
|
"suffixOffset": true,
|
|
46
51
|
"tabularNums": true,
|
|
52
|
+
"signDisplay": true,
|
|
53
|
+
"plusSign": true,
|
|
54
|
+
"minusSign": true,
|
|
55
|
+
"digitGlyphs": true,
|
|
56
|
+
"groupingSizes": true,
|
|
57
|
+
"digitMax": true,
|
|
58
|
+
"continuous": true,
|
|
59
|
+
"prefixColor": true,
|
|
60
|
+
"suffixColor": true,
|
|
61
|
+
"fractionColor": true,
|
|
62
|
+
"fractionFontSize": true,
|
|
63
|
+
"fractionAlign": true,
|
|
64
|
+
"respectReduceMotion": true,
|
|
47
65
|
"adjustsFontSizeToFit": true,
|
|
48
66
|
"minimumFontScale": true,
|
|
49
67
|
"allowFontScaling": true,
|
|
@@ -56,6 +74,8 @@
|
|
|
56
74
|
"onSizeChange": true,
|
|
57
75
|
"onRevealEnd": true,
|
|
58
76
|
"onRevealMilestone": true,
|
|
77
|
+
"onAnimationStart": true,
|
|
78
|
+
"onAnimationEnd": true,
|
|
59
79
|
"hybridRef": true
|
|
60
80
|
}
|
|
61
81
|
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
{
|
|
2
|
+
"uiViewClassName": "NitroTextView",
|
|
3
|
+
"supportsRawText": false,
|
|
4
|
+
"bubblingEventTypes": {},
|
|
5
|
+
"directEventTypes": {},
|
|
6
|
+
"validAttributes": {
|
|
7
|
+
"text": true,
|
|
8
|
+
"fontSize": true,
|
|
9
|
+
"fontWeight": true,
|
|
10
|
+
"fontFamily": true,
|
|
11
|
+
"color": true,
|
|
12
|
+
"letterSpacing": true,
|
|
13
|
+
"textAlign": true,
|
|
14
|
+
"rightToLeft": true,
|
|
15
|
+
"duration": true,
|
|
16
|
+
"easing": true,
|
|
17
|
+
"bounce": true,
|
|
18
|
+
"effect": true,
|
|
19
|
+
"respectReduceMotion": true,
|
|
20
|
+
"loading": true,
|
|
21
|
+
"shimmerColor": true,
|
|
22
|
+
"shimmerDuration": true,
|
|
23
|
+
"shimmerAngle": true,
|
|
24
|
+
"shimmerWidth": true,
|
|
25
|
+
"shimmerBaseColor": true,
|
|
26
|
+
"shimmerDirection": true,
|
|
27
|
+
"shimmerDelay": true,
|
|
28
|
+
"hybridRef": true
|
|
29
|
+
}
|
|
30
|
+
}
|