number-flow-react-native 0.1.0

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.
Files changed (245) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +44 -0
  3. package/lib/module/core/constants.js +21 -0
  4. package/lib/module/core/constants.js.map +1 -0
  5. package/lib/module/core/intlHelpers.js +310 -0
  6. package/lib/module/core/intlHelpers.js.map +1 -0
  7. package/lib/module/core/layout.js +71 -0
  8. package/lib/module/core/layout.js.map +1 -0
  9. package/lib/module/core/mask.js +50 -0
  10. package/lib/module/core/mask.js.map +1 -0
  11. package/lib/module/core/numerals/detection.js +105 -0
  12. package/lib/module/core/numerals/detection.js.map +1 -0
  13. package/lib/module/core/numerals/digits.js +128 -0
  14. package/lib/module/core/numerals/digits.js.map +1 -0
  15. package/lib/module/core/numerals/index.js +5 -0
  16. package/lib/module/core/numerals/index.js.map +1 -0
  17. package/lib/module/core/numerals/tables.js +114 -0
  18. package/lib/module/core/numerals/tables.js.map +1 -0
  19. package/lib/module/core/superscript.js +31 -0
  20. package/lib/module/core/superscript.js.map +1 -0
  21. package/lib/module/core/timeLayout.js +98 -0
  22. package/lib/module/core/timeLayout.js.map +1 -0
  23. package/lib/module/core/timeTypes.js +4 -0
  24. package/lib/module/core/timeTypes.js.map +1 -0
  25. package/lib/module/core/timing.js +45 -0
  26. package/lib/module/core/timing.js.map +1 -0
  27. package/lib/module/core/types.js +58 -0
  28. package/lib/module/core/types.js.map +1 -0
  29. package/lib/module/core/useAccessibilityAnnouncement.js +27 -0
  30. package/lib/module/core/useAccessibilityAnnouncement.js.map +1 -0
  31. package/lib/module/core/useAnimatedX.js +25 -0
  32. package/lib/module/core/useAnimatedX.js.map +1 -0
  33. package/lib/module/core/useAnimationLifecycle.js +37 -0
  34. package/lib/module/core/useAnimationLifecycle.js.map +1 -0
  35. package/lib/module/core/useCanAnimate.js +22 -0
  36. package/lib/module/core/useCanAnimate.js.map +1 -0
  37. package/lib/module/core/useContinuousSpin.js +89 -0
  38. package/lib/module/core/useContinuousSpin.js.map +1 -0
  39. package/lib/module/core/useDebouncedWidths.js +74 -0
  40. package/lib/module/core/useDebouncedWidths.js.map +1 -0
  41. package/lib/module/core/useDigitAnimation.js +138 -0
  42. package/lib/module/core/useDigitAnimation.js.map +1 -0
  43. package/lib/module/core/useFlowPipeline.js +85 -0
  44. package/lib/module/core/useFlowPipeline.js.map +1 -0
  45. package/lib/module/core/useFormattedValue.js +28 -0
  46. package/lib/module/core/useFormattedValue.js.map +1 -0
  47. package/lib/module/core/useLayoutDiff.js +59 -0
  48. package/lib/module/core/useLayoutDiff.js.map +1 -0
  49. package/lib/module/core/useNumberFormatting.js +158 -0
  50. package/lib/module/core/useNumberFormatting.js.map +1 -0
  51. package/lib/module/core/useSlotOpacity.js +53 -0
  52. package/lib/module/core/useSlotOpacity.js.map +1 -0
  53. package/lib/module/core/useTimeFormatting.js +74 -0
  54. package/lib/module/core/useTimeFormatting.js.map +1 -0
  55. package/lib/module/core/useTimingResolution.js +21 -0
  56. package/lib/module/core/useTimingResolution.js.map +1 -0
  57. package/lib/module/core/useWorkletFormatting.js +49 -0
  58. package/lib/module/core/useWorkletFormatting.js.map +1 -0
  59. package/lib/module/core/utils.js +132 -0
  60. package/lib/module/core/utils.js.map +1 -0
  61. package/lib/module/core/warnings.js +10 -0
  62. package/lib/module/core/warnings.js.map +1 -0
  63. package/lib/module/index.js +7 -0
  64. package/lib/module/index.js.map +1 -0
  65. package/lib/module/native/DigitSlot.js +163 -0
  66. package/lib/module/native/DigitSlot.js.map +1 -0
  67. package/lib/module/native/NumberFlow.js +244 -0
  68. package/lib/module/native/NumberFlow.js.map +1 -0
  69. package/lib/module/native/SymbolSlot.js +52 -0
  70. package/lib/module/native/SymbolSlot.js.map +1 -0
  71. package/lib/module/native/TimeFlow.js +270 -0
  72. package/lib/module/native/TimeFlow.js.map +1 -0
  73. package/lib/module/native/index.js +5 -0
  74. package/lib/module/native/index.js.map +1 -0
  75. package/lib/module/native/renderSlots.js +108 -0
  76. package/lib/module/native/renderSlots.js.map +1 -0
  77. package/lib/module/native/types.js +4 -0
  78. package/lib/module/native/types.js.map +1 -0
  79. package/lib/module/native/useMeasuredGlyphMetrics.js +156 -0
  80. package/lib/module/native/useMeasuredGlyphMetrics.js.map +1 -0
  81. package/lib/module/package.json +1 -0
  82. package/lib/module/skia/DigitSlot.js +171 -0
  83. package/lib/module/skia/DigitSlot.js.map +1 -0
  84. package/lib/module/skia/SkiaNumberFlow.js +430 -0
  85. package/lib/module/skia/SkiaNumberFlow.js.map +1 -0
  86. package/lib/module/skia/SkiaTimeFlow.js +226 -0
  87. package/lib/module/skia/SkiaTimeFlow.js.map +1 -0
  88. package/lib/module/skia/SymbolSlot.js +92 -0
  89. package/lib/module/skia/SymbolSlot.js.map +1 -0
  90. package/lib/module/skia/index.js +6 -0
  91. package/lib/module/skia/index.js.map +1 -0
  92. package/lib/module/skia/renderSlots.js +131 -0
  93. package/lib/module/skia/renderSlots.js.map +1 -0
  94. package/lib/module/skia/useGlyphMetrics.js +72 -0
  95. package/lib/module/skia/useGlyphMetrics.js.map +1 -0
  96. package/lib/module/skia/useScrubbing.js +165 -0
  97. package/lib/module/skia/useScrubbing.js.map +1 -0
  98. package/lib/module/skia/useSkiaFont.js +23 -0
  99. package/lib/module/skia/useSkiaFont.js.map +1 -0
  100. package/lib/typescript/core/constants.d.ts +15 -0
  101. package/lib/typescript/core/constants.d.ts.map +1 -0
  102. package/lib/typescript/core/intlHelpers.d.ts +10 -0
  103. package/lib/typescript/core/intlHelpers.d.ts.map +1 -0
  104. package/lib/typescript/core/layout.d.ts +22 -0
  105. package/lib/typescript/core/layout.d.ts.map +1 -0
  106. package/lib/typescript/core/mask.d.ts +18 -0
  107. package/lib/typescript/core/mask.d.ts.map +1 -0
  108. package/lib/typescript/core/numerals/detection.d.ts +17 -0
  109. package/lib/typescript/core/numerals/detection.d.ts.map +1 -0
  110. package/lib/typescript/core/numerals/digits.d.ts +43 -0
  111. package/lib/typescript/core/numerals/digits.d.ts.map +1 -0
  112. package/lib/typescript/core/numerals/index.d.ts +3 -0
  113. package/lib/typescript/core/numerals/index.d.ts.map +1 -0
  114. package/lib/typescript/core/numerals/tables.d.ts +32 -0
  115. package/lib/typescript/core/numerals/tables.d.ts.map +1 -0
  116. package/lib/typescript/core/superscript.d.ts +16 -0
  117. package/lib/typescript/core/superscript.d.ts.map +1 -0
  118. package/lib/typescript/core/timeLayout.d.ts +19 -0
  119. package/lib/typescript/core/timeLayout.d.ts.map +1 -0
  120. package/lib/typescript/core/timeTypes.d.ts +80 -0
  121. package/lib/typescript/core/timeTypes.d.ts.map +1 -0
  122. package/lib/typescript/core/timing.d.ts +6 -0
  123. package/lib/typescript/core/timing.d.ts.map +1 -0
  124. package/lib/typescript/core/types.d.ts +165 -0
  125. package/lib/typescript/core/types.d.ts.map +1 -0
  126. package/lib/typescript/core/useAccessibilityAnnouncement.d.ts +10 -0
  127. package/lib/typescript/core/useAccessibilityAnnouncement.d.ts.map +1 -0
  128. package/lib/typescript/core/useAnimatedX.d.ts +9 -0
  129. package/lib/typescript/core/useAnimatedX.d.ts.map +1 -0
  130. package/lib/typescript/core/useAnimationLifecycle.d.ts +14 -0
  131. package/lib/typescript/core/useAnimationLifecycle.d.ts.map +1 -0
  132. package/lib/typescript/core/useCanAnimate.d.ts +14 -0
  133. package/lib/typescript/core/useCanAnimate.d.ts.map +1 -0
  134. package/lib/typescript/core/useContinuousSpin.d.ts +23 -0
  135. package/lib/typescript/core/useContinuousSpin.d.ts.map +1 -0
  136. package/lib/typescript/core/useDebouncedWidths.d.ts +17 -0
  137. package/lib/typescript/core/useDebouncedWidths.d.ts.map +1 -0
  138. package/lib/typescript/core/useDigitAnimation.d.ts +38 -0
  139. package/lib/typescript/core/useDigitAnimation.d.ts.map +1 -0
  140. package/lib/typescript/core/useFlowPipeline.d.ts +46 -0
  141. package/lib/typescript/core/useFlowPipeline.d.ts.map +1 -0
  142. package/lib/typescript/core/useFormattedValue.d.ts +14 -0
  143. package/lib/typescript/core/useFormattedValue.d.ts.map +1 -0
  144. package/lib/typescript/core/useLayoutDiff.d.ts +18 -0
  145. package/lib/typescript/core/useLayoutDiff.d.ts.map +1 -0
  146. package/lib/typescript/core/useNumberFormatting.d.ts +18 -0
  147. package/lib/typescript/core/useNumberFormatting.d.ts.map +1 -0
  148. package/lib/typescript/core/useSlotOpacity.d.ts +18 -0
  149. package/lib/typescript/core/useSlotOpacity.d.ts.map +1 -0
  150. package/lib/typescript/core/useTimeFormatting.d.ts +22 -0
  151. package/lib/typescript/core/useTimeFormatting.d.ts.map +1 -0
  152. package/lib/typescript/core/useTimingResolution.d.ts +13 -0
  153. package/lib/typescript/core/useTimingResolution.d.ts.map +1 -0
  154. package/lib/typescript/core/useWorkletFormatting.d.ts +14 -0
  155. package/lib/typescript/core/useWorkletFormatting.d.ts.map +1 -0
  156. package/lib/typescript/core/utils.d.ts +44 -0
  157. package/lib/typescript/core/utils.d.ts.map +1 -0
  158. package/lib/typescript/core/warnings.d.ts +2 -0
  159. package/lib/typescript/core/warnings.d.ts.map +1 -0
  160. package/lib/typescript/index.d.ts +8 -0
  161. package/lib/typescript/index.d.ts.map +1 -0
  162. package/lib/typescript/native/DigitSlot.d.ts +27 -0
  163. package/lib/typescript/native/DigitSlot.d.ts.map +1 -0
  164. package/lib/typescript/native/NumberFlow.d.ts +3 -0
  165. package/lib/typescript/native/NumberFlow.d.ts.map +1 -0
  166. package/lib/typescript/native/SymbolSlot.d.ts +19 -0
  167. package/lib/typescript/native/SymbolSlot.d.ts.map +1 -0
  168. package/lib/typescript/native/TimeFlow.d.ts +3 -0
  169. package/lib/typescript/native/TimeFlow.d.ts.map +1 -0
  170. package/lib/typescript/native/index.d.ts +3 -0
  171. package/lib/typescript/native/index.d.ts.map +1 -0
  172. package/lib/typescript/native/renderSlots.d.ts +31 -0
  173. package/lib/typescript/native/renderSlots.d.ts.map +1 -0
  174. package/lib/typescript/native/types.d.ts +36 -0
  175. package/lib/typescript/native/types.d.ts.map +1 -0
  176. package/lib/typescript/native/useMeasuredGlyphMetrics.d.ts +8 -0
  177. package/lib/typescript/native/useMeasuredGlyphMetrics.d.ts.map +1 -0
  178. package/lib/typescript/package.json +1 -0
  179. package/lib/typescript/skia/DigitSlot.d.ts +35 -0
  180. package/lib/typescript/skia/DigitSlot.d.ts.map +1 -0
  181. package/lib/typescript/skia/SkiaNumberFlow.d.ts +3 -0
  182. package/lib/typescript/skia/SkiaNumberFlow.d.ts.map +1 -0
  183. package/lib/typescript/skia/SkiaTimeFlow.d.ts +3 -0
  184. package/lib/typescript/skia/SkiaTimeFlow.d.ts.map +1 -0
  185. package/lib/typescript/skia/SymbolSlot.d.ts +26 -0
  186. package/lib/typescript/skia/SymbolSlot.d.ts.map +1 -0
  187. package/lib/typescript/skia/index.d.ts +6 -0
  188. package/lib/typescript/skia/index.d.ts.map +1 -0
  189. package/lib/typescript/skia/renderSlots.d.ts +40 -0
  190. package/lib/typescript/skia/renderSlots.d.ts.map +1 -0
  191. package/lib/typescript/skia/useGlyphMetrics.d.ts +16 -0
  192. package/lib/typescript/skia/useGlyphMetrics.d.ts.map +1 -0
  193. package/lib/typescript/skia/useScrubbing.d.ts +59 -0
  194. package/lib/typescript/skia/useScrubbing.d.ts.map +1 -0
  195. package/lib/typescript/skia/useSkiaFont.d.ts +13 -0
  196. package/lib/typescript/skia/useSkiaFont.d.ts.map +1 -0
  197. package/package.json +104 -0
  198. package/src/core/constants.ts +20 -0
  199. package/src/core/intlHelpers.ts +351 -0
  200. package/src/core/layout.ts +108 -0
  201. package/src/core/mask.ts +72 -0
  202. package/src/core/numerals/detection.ts +112 -0
  203. package/src/core/numerals/digits.ts +102 -0
  204. package/src/core/numerals/index.ts +9 -0
  205. package/src/core/numerals/tables.ts +112 -0
  206. package/src/core/superscript.ts +27 -0
  207. package/src/core/timeLayout.ts +119 -0
  208. package/src/core/timeTypes.ts +88 -0
  209. package/src/core/timing.ts +60 -0
  210. package/src/core/types.ts +189 -0
  211. package/src/core/useAccessibilityAnnouncement.ts +27 -0
  212. package/src/core/useAnimatedX.ts +30 -0
  213. package/src/core/useAnimationLifecycle.ts +54 -0
  214. package/src/core/useCanAnimate.ts +21 -0
  215. package/src/core/useContinuousSpin.ts +112 -0
  216. package/src/core/useDebouncedWidths.ts +93 -0
  217. package/src/core/useDigitAnimation.ts +192 -0
  218. package/src/core/useFlowPipeline.ts +126 -0
  219. package/src/core/useFormattedValue.ts +32 -0
  220. package/src/core/useLayoutDiff.ts +71 -0
  221. package/src/core/useNumberFormatting.ts +164 -0
  222. package/src/core/useSlotOpacity.ts +66 -0
  223. package/src/core/useTimeFormatting.ts +95 -0
  224. package/src/core/useTimingResolution.ts +47 -0
  225. package/src/core/useWorkletFormatting.ts +59 -0
  226. package/src/core/utils.ts +149 -0
  227. package/src/core/warnings.ts +8 -0
  228. package/src/index.ts +15 -0
  229. package/src/native/DigitSlot.tsx +203 -0
  230. package/src/native/NumberFlow.tsx +287 -0
  231. package/src/native/SymbolSlot.tsx +68 -0
  232. package/src/native/TimeFlow.tsx +287 -0
  233. package/src/native/index.ts +2 -0
  234. package/src/native/renderSlots.tsx +150 -0
  235. package/src/native/types.ts +40 -0
  236. package/src/native/useMeasuredGlyphMetrics.tsx +205 -0
  237. package/src/skia/DigitSlot.tsx +221 -0
  238. package/src/skia/SkiaNumberFlow.tsx +506 -0
  239. package/src/skia/SkiaTimeFlow.tsx +257 -0
  240. package/src/skia/SymbolSlot.tsx +120 -0
  241. package/src/skia/index.ts +5 -0
  242. package/src/skia/renderSlots.tsx +180 -0
  243. package/src/skia/useGlyphMetrics.ts +79 -0
  244. package/src/skia/useScrubbing.ts +223 -0
  245. package/src/skia/useSkiaFont.ts +25 -0
@@ -0,0 +1,27 @@
1
+ import React from "react";
2
+ import { type TextStyle } from "react-native";
3
+ import type { GlyphMetrics, TimingConfig, Trend } from "../core/types";
4
+ interface DigitSlotProps {
5
+ metrics: GlyphMetrics;
6
+ digitValue: number;
7
+ targetX: number;
8
+ charWidth: number;
9
+ textStyle: TextStyle;
10
+ spinTiming: TimingConfig;
11
+ opacityTiming: TimingConfig;
12
+ transformTiming: TimingConfig;
13
+ trend: Trend;
14
+ entering: boolean;
15
+ exiting: boolean;
16
+ exitKey?: string;
17
+ onExitComplete?: (key: string) => void;
18
+ digitCount?: number;
19
+ continuousSpinGeneration?: number;
20
+ maskTop?: number;
21
+ maskBottom?: number;
22
+ superscript?: boolean;
23
+ digitStrings?: string[];
24
+ }
25
+ export declare const DigitSlot: React.MemoExoticComponent<({ metrics, digitValue, targetX, charWidth, textStyle, spinTiming, opacityTiming, transformTiming, trend, entering, exiting, exitKey, onExitComplete, digitCount, continuousSpinGeneration, maskTop, maskBottom, superscript, digitStrings, }: DigitSlotProps) => import("react/jsx-runtime").JSX.Element>;
26
+ export {};
27
+ //# sourceMappingURL=DigitSlot.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DigitSlot.d.ts","sourceRoot":"","sources":["../../../src/native/DigitSlot.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqD,MAAM,OAAO,CAAC;AAC1E,OAAO,EAAoB,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAUhE,OAAO,KAAK,EAAE,YAAY,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AA0BvE,UAAU,cAAc;IACtB,OAAO,EAAE,YAAY,CAAC;IACtB,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,SAAS,CAAC;IACrB,UAAU,EAAE,YAAY,CAAC;IACzB,aAAa,EAAE,YAAY,CAAC;IAC5B,eAAe,EAAE,YAAY,CAAC;IAC9B,KAAK,EAAE,KAAK,CAAC;IACb,QAAQ,EAAE,OAAO,CAAC;IAClB,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,cAAc,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IACvC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,wBAAwB,CAAC,EAAE,MAAM,CAAC;IAClC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;CACzB;AAED,eAAO,MAAM,SAAS,2QAqBjB,cAAc,6CA6GlB,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { NumberFlowProps } from "./types";
2
+ export declare const NumberFlow: ({ value, format, locales, style: nfStyle, textAlign, prefix, suffix, spinTiming, opacityTiming, transformTiming, trend, animated, respectMotionPreference, continuous, digits, onAnimationsStart, onAnimationsFinish, containerStyle, mask, }: NumberFlowProps) => import("react/jsx-runtime").JSX.Element;
3
+ //# sourceMappingURL=NumberFlow.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NumberFlow.d.ts","sourceRoot":"","sources":["../../../src/native/NumberFlow.tsx"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAG/C,eAAO,MAAM,UAAU,GAAI,+OAoBxB,eAAe,4CA4PjB,CAAC"}
@@ -0,0 +1,19 @@
1
+ import React from "react";
2
+ import { type TextStyle } from "react-native";
3
+ import type { TimingConfig } from "../core/types";
4
+ interface SymbolSlotProps {
5
+ char: string;
6
+ targetX: number;
7
+ lineHeight: number;
8
+ textStyle: TextStyle;
9
+ opacityTiming: TimingConfig;
10
+ transformTiming: TimingConfig;
11
+ entering: boolean;
12
+ exiting: boolean;
13
+ exitKey?: string;
14
+ onExitComplete?: (key: string) => void;
15
+ superscript?: boolean;
16
+ }
17
+ export declare const SymbolSlot: React.MemoExoticComponent<({ char, targetX, lineHeight, textStyle, opacityTiming, transformTiming, entering, exiting, exitKey, onExitComplete, superscript, }: SymbolSlotProps) => import("react/jsx-runtime").JSX.Element>;
18
+ export {};
19
+ //# sourceMappingURL=SymbolSlot.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SymbolSlot.d.ts","sourceRoot":"","sources":["../../../src/native/SymbolSlot.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAkB,MAAM,OAAO,CAAC;AACvC,OAAO,EAAQ,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAIpD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAIlD,UAAU,eAAe;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,SAAS,CAAC;IACrB,aAAa,EAAE,YAAY,CAAC;IAC5B,eAAe,EAAE,YAAY,CAAC;IAC9B,QAAQ,EAAE,OAAO,CAAC;IAClB,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,cAAc,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IACvC,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED,eAAO,MAAM,UAAU,iKAalB,eAAe,6CA6BnB,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { TimeFlowProps } from "../core/timeTypes";
2
+ export declare const TimeFlow: ({ hours, minutes, seconds, timestamp, timezoneOffset, is24Hour, padHours, style: nfStyle, textAlign, spinTiming, opacityTiming, transformTiming, trend, animated, respectMotionPreference, continuous, onAnimationsStart, onAnimationsFinish, containerStyle, mask, }: TimeFlowProps) => import("react/jsx-runtime").JSX.Element;
3
+ //# sourceMappingURL=TimeFlow.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TimeFlow.d.ts","sourceRoot":"","sources":["../../../src/native/TimeFlow.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAQvD,eAAO,MAAM,QAAQ,GAAI,uQAqBtB,aAAa,4CA6Pf,CAAC"}
@@ -0,0 +1,3 @@
1
+ export { NumberFlow } from "./NumberFlow";
2
+ export { TimeFlow } from "./TimeFlow";
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/native/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC"}
@@ -0,0 +1,31 @@
1
+ import type { TextStyle } from "react-native";
2
+ import type { CharLayout } from "../core/layout";
3
+ import type { GlyphMetrics, TimingConfig, Trend } from "../core/types";
4
+ interface RenderSlotsParams {
5
+ layout: CharLayout[];
6
+ exitingEntries: Map<string, CharLayout>;
7
+ prevMap: Map<string, CharLayout>;
8
+ isInitialRender: boolean;
9
+ onExitComplete: (key: string) => void;
10
+ metrics: GlyphMetrics;
11
+ textStyle: TextStyle;
12
+ resolvedTrend: Trend;
13
+ spinTiming: TimingConfig;
14
+ opacityTiming: TimingConfig;
15
+ transformTiming: TimingConfig;
16
+ spinGenerations: Map<string, number> | undefined;
17
+ digitCountResolver: (key: string) => number;
18
+ maskTop: number;
19
+ maskBottom: number;
20
+ digitStrings?: string[];
21
+ }
22
+ /**
23
+ * Renders the active and exiting digit/symbol slot tree.
24
+ *
25
+ * Shared between NumberFlow and TimeFlow — the only behavioral differences
26
+ * are abstracted via `digitCountResolver` (which digit-count lookup to use)
27
+ * and the optional `digitStrings` (locale-specific digit characters).
28
+ */
29
+ export declare function renderSlots({ layout, exitingEntries, prevMap, isInitialRender, onExitComplete, metrics, textStyle, resolvedTrend, spinTiming, opacityTiming, transformTiming, spinGenerations, digitCountResolver, maskTop, maskBottom, digitStrings, }: RenderSlotsParams): import("react/jsx-runtime").JSX.Element;
30
+ export {};
31
+ //# sourceMappingURL=renderSlots.d.ts.map
@@ -0,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-0,0 +1,36 @@
1
+ import type { TextStyle, ViewStyle } from "react-native";
2
+ import type { AnimationBehaviorProps, DigitsProp, TextAlign } from "../core/types";
3
+ /** Text style for NumberFlow/TimeFlow. Requires fontSize; fontFamily defaults to the system font when omitted. */
4
+ export type NumberFlowStyle = TextStyle & {
5
+ fontSize: number;
6
+ };
7
+ interface NumberFlowValueProps {
8
+ /** Numeric value to display */
9
+ value: number;
10
+ /** Intl.NumberFormatOptions for value formatting */
11
+ format?: Intl.NumberFormatOptions;
12
+ /** Locale(s) for Intl.NumberFormat */
13
+ locales?: Intl.LocalesArgument;
14
+ }
15
+ interface NumberFlowBaseProps extends AnimationBehaviorProps {
16
+ /** Text styling. fontSize is required; fontFamily defaults to the platform system font. */
17
+ style: NumberFlowStyle;
18
+ /** Text alignment. Defaults to "left". */
19
+ textAlign?: TextAlign;
20
+ /** Static string prepended before the number */
21
+ prefix?: string;
22
+ /** Static string appended after the number */
23
+ suffix?: string;
24
+ /**
25
+ * Per-position digit constraints. Maps integer position (0=ones, 1=tens, ...)
26
+ * to { max: N } where N is the highest digit value (inclusive).
27
+ * Example: { 1: { max: 5 } } for a wheel where tens go 0-5.
28
+ */
29
+ digits?: DigitsProp;
30
+ /** Style applied to the outer container View */
31
+ containerStyle?: ViewStyle;
32
+ }
33
+ /** Props for NumberFlow. Accessibility is built-in: accessibilityRole="text" and accessibilityLabel are set automatically. */
34
+ export type NumberFlowProps = NumberFlowBaseProps & NumberFlowValueProps;
35
+ export {};
36
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/native/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzD,OAAO,KAAK,EAAE,sBAAsB,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAEnF,kHAAkH;AAClH,MAAM,MAAM,eAAe,GAAG,SAAS,GAAG;IACxC,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,UAAU,oBAAoB;IAC5B,+BAA+B;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,oDAAoD;IACpD,MAAM,CAAC,EAAE,IAAI,CAAC,mBAAmB,CAAC;IAClC,sCAAsC;IACtC,OAAO,CAAC,EAAE,IAAI,CAAC,eAAe,CAAC;CAChC;AAED,UAAU,mBAAoB,SAAQ,sBAAsB;IAC1D,2FAA2F;IAC3F,KAAK,EAAE,eAAe,CAAC;IACvB,0CAA0C;IAC1C,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,gDAAgD;IAChD,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,8CAA8C;IAC9C,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;;;OAIG;IACH,MAAM,CAAC,EAAE,UAAU,CAAC;IAEpB,gDAAgD;IAChD,cAAc,CAAC,EAAE,SAAS,CAAC;CAC5B;AAED,8HAA8H;AAC9H,MAAM,MAAM,eAAe,GAAG,mBAAmB,GAAG,oBAAoB,CAAC"}
@@ -0,0 +1,8 @@
1
+ import React from "react";
2
+ import type { GlyphMetrics } from "../core/types";
3
+ import type { NumberFlowStyle } from "./types";
4
+ export declare function useMeasuredGlyphMetrics(style: NumberFlowStyle, additionalChars?: string, localeDigitStrings?: string[]): {
5
+ metrics: GlyphMetrics | null;
6
+ MeasureElement: React.ReactElement | null;
7
+ };
8
+ //# sourceMappingURL=useMeasuredGlyphMetrics.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useMeasuredGlyphMetrics.d.ts","sourceRoot":"","sources":["../../../src/native/useMeasuredGlyphMetrics.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmD,MAAM,OAAO,CAAC;AAGxE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAClD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAuJ/C,wBAAgB,uBAAuB,CACrC,KAAK,EAAE,eAAe,EACtB,eAAe,CAAC,EAAE,MAAM,EACxB,kBAAkB,CAAC,EAAE,MAAM,EAAE,GAC5B;IACD,OAAO,EAAE,YAAY,GAAG,IAAI,CAAC;IAC7B,cAAc,EAAE,KAAK,CAAC,YAAY,GAAG,IAAI,CAAC;CAC3C,CA0CA"}
@@ -0,0 +1 @@
1
+ {"type":"module"}
@@ -0,0 +1,35 @@
1
+ import React from "react";
2
+ import { type SharedValue } from "react-native-reanimated";
3
+ import type { GlyphMetrics, SkiaNumberFlowProps, TimingConfig, Trend } from "../core/types";
4
+ interface DigitSlotProps {
5
+ metrics: GlyphMetrics;
6
+ digitValue: number;
7
+ targetX: number;
8
+ charWidth: number;
9
+ baseY: number;
10
+ color: string;
11
+ font: NonNullable<SkiaNumberFlowProps["font"]>;
12
+ spinTiming: TimingConfig;
13
+ opacityTiming: TimingConfig;
14
+ transformTiming: TimingConfig;
15
+ trend: Trend;
16
+ entering: boolean;
17
+ exiting: boolean;
18
+ exitKey?: string;
19
+ onExitComplete?: (key: string) => void;
20
+ workletDigitValue?: SharedValue<number>;
21
+ workletLayout?: SharedValue<{
22
+ x: number;
23
+ width: number;
24
+ }[]>;
25
+ slotIndex?: number;
26
+ digitCount?: number;
27
+ continuousSpinGeneration?: number;
28
+ maskTop?: number;
29
+ maskBottom?: number;
30
+ superscript?: boolean;
31
+ digitStrings?: string[];
32
+ }
33
+ export declare const DigitSlot: React.MemoExoticComponent<({ metrics, digitValue, targetX, charWidth, baseY, color, font, spinTiming, opacityTiming, transformTiming, trend, entering, exiting, exitKey, onExitComplete, workletDigitValue, workletLayout, slotIndex, digitCount, continuousSpinGeneration, maskTop, maskBottom, superscript, digitStrings, }: DigitSlotProps) => import("react/jsx-runtime").JSX.Element>;
34
+ export {};
35
+ //# sourceMappingURL=DigitSlot.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DigitSlot.d.ts","sourceRoot":"","sources":["../../../src/skia/DigitSlot.tsx"],"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Ac,6CAsJlB,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { SkiaNumberFlowProps } from "../core/types";
2
+ export declare const SkiaNumberFlow: ({ value, format, locales, sharedValue, font, color, x, y, width, textAlign, prefix, suffix, opacity, spinTiming, opacityTiming, transformTiming, trend, animated, respectMotionPreference, continuous, digits, scrubDigitWidthPercentile, onAnimationsStart, onAnimationsFinish, mask, }: SkiaNumberFlowProps) => import("react/jsx-runtime").JSX.Element;
3
+ //# sourceMappingURL=SkiaNumberFlow.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SkiaNumberFlow.d.ts","sourceRoot":"","sources":["../../../src/skia/SkiaNumberFlow.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAA2B,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAsYlF,eAAO,MAAM,cAAc,GAAI,0RA0B5B,mBAAmB,4CAmFrB,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { SkiaTimeFlowProps } from "../core/timeTypes";
2
+ export declare const SkiaTimeFlow: ({ hours, minutes, seconds, timestamp, timezoneOffset, sharedValue, is24Hour, padHours, font, color, x, y, width, textAlign, opacity, spinTiming, opacityTiming, transformTiming, trend, animated, respectMotionPreference, continuous, mask, onAnimationsStart, onAnimationsFinish, }: SkiaTimeFlowProps) => import("react/jsx-runtime").JSX.Element;
3
+ //# sourceMappingURL=SkiaTimeFlow.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SkiaTimeFlow.d.ts","sourceRoot":"","sources":["../../../src/skia/SkiaTimeFlow.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAU3D,eAAO,MAAM,YAAY,GAAI,uRA0B1B,iBAAiB,4CAuNnB,CAAC"}
@@ -0,0 +1,26 @@
1
+ import React from "react";
2
+ import { type SharedValue } from "react-native-reanimated";
3
+ import type { SkiaNumberFlowProps, TimingConfig } from "../core/types";
4
+ interface SymbolSlotProps {
5
+ char: string;
6
+ targetX: number;
7
+ baseY: number;
8
+ ascent: number;
9
+ color: string;
10
+ font: NonNullable<SkiaNumberFlowProps["font"]>;
11
+ opacityTiming: TimingConfig;
12
+ transformTiming: TimingConfig;
13
+ entering: boolean;
14
+ exiting: boolean;
15
+ exitKey?: string;
16
+ onExitComplete?: (key: string) => void;
17
+ workletLayout?: SharedValue<{
18
+ x: number;
19
+ width: number;
20
+ }[]>;
21
+ slotIndex?: number;
22
+ superscript?: boolean;
23
+ }
24
+ export declare const SymbolSlot: React.MemoExoticComponent<({ char, targetX, baseY, ascent, color, font, opacityTiming, transformTiming, entering, exiting, exitKey, onExitComplete, workletLayout, slotIndex, superscript, }: SymbolSlotProps) => import("react/jsx-runtime").JSX.Element>;
25
+ export {};
26
+ //# sourceMappingURL=SymbolSlot.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SymbolSlot.d.ts","sourceRoot":"","sources":["../../../src/skia/SymbolSlot.tsx"],"names":[],"mappings":"AACA,OAAO,KAA4B,MAAM,OAAO,CAAC;AACjD,OAAO,EAGL,KAAK,WAAW,EAIjB,MAAM,yBAAyB,CAAC;AAEjC,OAAO,KAAK,EAAE,mBAAmB,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAOvE,UAAU,eAAe;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,WAAW,CAAC,mBAAmB,CAAC,MAAM,CAAC,CAAC,CAAC;IAC/C,aAAa,EAAE,YAAY,CAAC;IAC5B,eAAe,EAAE,YAAY,CAAC;IAC9B,QAAQ,EAAE,OAAO,CAAC;IAClB,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,cAAc,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IACvC,aAAa,CAAC,EAAE,WAAW,CAAC;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC,CAAC;IAC5D,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED,eAAO,MAAM,UAAU,gMAiBlB,eAAe,6CAgEnB,CAAC"}
@@ -0,0 +1,6 @@
1
+ export { SkiaNumberFlow } from "./SkiaNumberFlow";
2
+ export { SkiaTimeFlow } from "./SkiaTimeFlow";
3
+ export { useSkiaFont } from "./useSkiaFont";
4
+ export type { SkiaNumberFlowProps } from "../core/types";
5
+ export type { SkiaTimeFlowProps } from "../core/timeTypes";
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/skia/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,YAAY,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AACzD,YAAY,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC"}
@@ -0,0 +1,40 @@
1
+ import type { SkFont } from "@shopify/react-native-skia";
2
+ import type { SharedValue } from "react-native-reanimated";
3
+ import type { CharLayout } from "../core/layout";
4
+ import type { GlyphMetrics, TimingConfig, Trend } from "../core/types";
5
+ interface RenderSlotsParams {
6
+ layout: CharLayout[];
7
+ exitingEntries: Map<string, CharLayout>;
8
+ prevMap: Map<string, CharLayout>;
9
+ isInitialRender: boolean;
10
+ onExitComplete: (key: string) => void;
11
+ metrics: GlyphMetrics;
12
+ font: SkFont;
13
+ color: string;
14
+ baseY: number;
15
+ resolvedTrend: Trend;
16
+ spinTiming: TimingConfig;
17
+ opacityTiming: TimingConfig;
18
+ transformTiming: TimingConfig;
19
+ spinGenerations: Map<string, number> | undefined;
20
+ digitCountResolver: (key: string) => number;
21
+ maskTop: number;
22
+ maskBottom: number;
23
+ digitStrings?: string[];
24
+ workletDigitValues?: SharedValue<number>[] | null;
25
+ workletLayout?: SharedValue<{
26
+ x: number;
27
+ width: number;
28
+ }[]>;
29
+ }
30
+ /**
31
+ * Renders the active and exiting digit/symbol slot tree for Skia.
32
+ *
33
+ * Shared between SkiaNumberFlow and SkiaTimeFlow. Behavioral differences:
34
+ * - `digitCountResolver`: NumberFlow uses getDigitCount, TimeFlow uses TIME_DIGIT_COUNTS
35
+ * - `digitStrings`: NumberFlow passes locale-specific digits, TimeFlow omits (Latin fallback)
36
+ * - `workletLayout`: NumberFlow passes for scrubbing positioning, TimeFlow omits
37
+ */
38
+ export declare function renderSlots({ layout, exitingEntries, prevMap, isInitialRender, onExitComplete, metrics, font, color, baseY, resolvedTrend, spinTiming, opacityTiming, transformTiming, spinGenerations, digitCountResolver, maskTop, maskBottom, digitStrings, workletDigitValues, workletLayout, }: RenderSlotsParams): import("react/jsx-runtime").JSX.Element;
39
+ export {};
40
+ //# sourceMappingURL=renderSlots.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"renderSlots.d.ts","sourceRoot":"","sources":["../../../src/skia/renderSlots.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AACzD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,KAAK,EAAE,YAAY,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAIvE,UAAU,iBAAiB;IACzB,MAAM,EAAE,UAAU,EAAE,CAAC;IACrB,cAAc,EAAE,GAAG,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;IACxC,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;IACjC,eAAe,EAAE,OAAO,CAAC;IACzB,cAAc,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IACtC,OAAO,EAAE,YAAY,CAAC;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,aAAa,EAAE,KAAK,CAAC;IACrB,UAAU,EAAE,YAAY,CAAC;IACzB,aAAa,EAAE,YAAY,CAAC;IAC5B,eAAe,EAAE,YAAY,CAAC;IAC9B,eAAe,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS,CAAC;IACjD,kBAAkB,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,MAAM,CAAC;IAC5C,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,kBAAkB,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,EAAE,GAAG,IAAI,CAAC;IAClD,aAAa,CAAC,EAAE,WAAW,CAAC;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC,CAAC;CAC7D;AAED;;;;;;;GAOG;AACH,wBAAgB,WAAW,CAAC,EAC1B,MAAM,EACN,cAAc,EACd,OAAO,EACP,eAAe,EACf,cAAc,EACd,OAAO,EACP,IAAI,EACJ,KAAK,EACL,KAAK,EACL,aAAa,EACb,UAAU,EACV,aAAa,EACb,eAAe,EACf,eAAe,EACf,kBAAkB,EAClB,OAAO,EACP,UAAU,EACV,YAAY,EACZ,kBAAkB,EAClB,aAAa,GACd,EAAE,iBAAiB,2CAwHnB"}
@@ -0,0 +1,16 @@
1
+ import type { SkFont } from "@shopify/react-native-skia";
2
+ import type { GlyphMetrics } from "../core/types";
3
+ /**
4
+ * Pre-computes glyph width lookup table and line metrics from an SkFont.
5
+ * Runs once on font load. All measurements use advance widths (not bounding boxes)
6
+ * for correct text layout spacing.
7
+ *
8
+ * Digit slots use `maxDigitWidth` (the widest of 0-9) for the clip window
9
+ * so all 10 digit glyphs fit during rolling. Individual digit positions
10
+ * within the clip use proportional charWidths for natural spacing.
11
+ *
12
+ * @param font - The SkFont to measure
13
+ * @param additionalChars - Optional additional characters to measure (e.g., from prefix/suffix with diacritics)
14
+ */
15
+ export declare function useGlyphMetrics(font: SkFont | null, additionalChars?: string, localeDigitStrings?: string[]): GlyphMetrics | null;
16
+ //# sourceMappingURL=useGlyphMetrics.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useGlyphMetrics.d.ts","sourceRoot":"","sources":["../../../src/skia/useGlyphMetrics.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AAGzD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAElD;;;;;;;;;;;GAWG;AACH,wBAAgB,eAAe,CAC7B,IAAI,EAAE,MAAM,GAAG,IAAI,EACnB,eAAe,CAAC,EAAE,MAAM,EACxB,kBAAkB,CAAC,EAAE,MAAM,EAAE,GAC5B,YAAY,GAAG,IAAI,CAyDrB"}
@@ -0,0 +1,59 @@
1
+ import { type SharedValue } from "react-native-reanimated";
2
+ import { type CharLayout } from "../core/layout";
3
+ import type { GlyphMetrics, TextAlign } from "../core/types";
4
+ interface UseScrubbingBridgeParams {
5
+ sharedValue: SharedValue<string> | undefined;
6
+ value: number | undefined;
7
+ prefix: string;
8
+ suffix: string;
9
+ zeroCodePoint: number;
10
+ }
11
+ interface UseScrubbingBridgeResult {
12
+ effectiveValue: number | undefined;
13
+ }
14
+ /**
15
+ * Digit-count bridging for worklet-driven scrubbing.
16
+ *
17
+ * When the worklet-driven sharedValue crosses a digit boundary (e.g.
18
+ * 99.9 → 100.0), the React-side layout must re-render with the correct
19
+ * number of digit slots. This hook watches the worklet's digit count and
20
+ * schedules a JS-side state update when it changes.
21
+ *
22
+ * Must be called **before** `useNumberFormatting` so the returned
23
+ * `effectiveValue` can feed into the formatter.
24
+ */
25
+ export declare function useScrubbingBridge({ sharedValue, value, prefix, suffix, zeroCodePoint, }: UseScrubbingBridgeParams): UseScrubbingBridgeResult;
26
+ interface UseScrubbingLayoutParams {
27
+ sharedValue: SharedValue<string> | undefined;
28
+ prefix: string;
29
+ suffix: string;
30
+ zeroCodePoint: number;
31
+ metrics: GlyphMetrics | null;
32
+ digitStringsArr: string[];
33
+ scrubDigitWidthPercentile: number;
34
+ layout: CharLayout[];
35
+ layoutDigitCount: number;
36
+ width: number;
37
+ textAlign: TextAlign;
38
+ }
39
+ interface UseScrubbingLayoutResult {
40
+ workletDigitValues: SharedValue<number>[] | null;
41
+ workletLayout: SharedValue<{
42
+ x: number;
43
+ width: number;
44
+ }[]>;
45
+ }
46
+ /**
47
+ * Worklet-driven layout and digit extraction for scrubbing mode.
48
+ *
49
+ * Encapsulates:
50
+ * - `useWorkletFormatting`: per-digit SharedValues from the sharedValue string
51
+ * - Tabular digit widths: fixed-width digits during scrubbing to prevent jitter
52
+ * - `useDebouncedWidths`: animated transition between tabular and proportional
53
+ * - `workletLayout`: UI-thread-computed per-slot x/width using debounced widths
54
+ *
55
+ * Must be called **after** the layout is computed from `computeKeyedLayout`.
56
+ */
57
+ export declare function useScrubbingLayout({ sharedValue, prefix, suffix, zeroCodePoint, metrics, digitStringsArr, scrubDigitWidthPercentile, layout, layoutDigitCount, width, textAlign, }: UseScrubbingLayoutParams): UseScrubbingLayoutResult;
58
+ export {};
59
+ //# sourceMappingURL=useScrubbing.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useScrubbing.d.ts","sourceRoot":"","sources":["../../../src/skia/useScrubbing.ts"],"names":[],"mappings":"AACA,OAAO,EAGL,KAAK,WAAW,EAGjB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAoB,KAAK,UAAU,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AM,EACN,aAAa,EACb,OAAO,EACP,eAAe,EACf,yBAAyB,EACzB,MAAM,EACN,gBAAgB,EAChB,KAAK,EACL,SAAS,GACV,EAAE,wBAAwB,GAAG,wBAAwB,CAoFrD"}
@@ -0,0 +1,13 @@
1
+ import type { DataSourceParam, SkFont } from "@shopify/react-native-skia";
2
+ /**
3
+ * Loads a custom Skia font asynchronously while providing a synchronous
4
+ * system-font fallback via `matchFont`. This guarantees a non-null `SkFont`
5
+ * from the very first render, so components can run the full animated pipeline
6
+ * immediately instead of showing a blank canvas or static placeholder.
7
+ *
8
+ * Once the custom font finishes loading, the returned value swaps to the
9
+ * custom font — triggering a smooth animated transition in SkiaNumberFlow /
10
+ * SkiaTimeFlow (the value re-renders with new glyph metrics).
11
+ */
12
+ export declare function useSkiaFont(source: DataSourceParam, size: number, onError?: (err: Error) => void): SkFont;
13
+ //# sourceMappingURL=useSkiaFont.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useSkiaFont.d.ts","sourceRoot":"","sources":["../../../src/skia/useSkiaFont.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AAG1E;;;;;;;;;GASG;AACH,wBAAgB,WAAW,CACzB,MAAM,EAAE,eAAe,EACvB,IAAI,EAAE,MAAM,EACZ,OAAO,CAAC,EAAE,CAAC,GAAG,EAAE,KAAK,KAAK,IAAI,GAC7B,MAAM,CAMR"}
package/package.json ADDED
@@ -0,0 +1,104 @@
1
+ {
2
+ "name": "number-flow-react-native",
3
+ "version": "0.1.0",
4
+ "description": "Animated number transitions for React Native — View-based and Skia renderers",
5
+ "source": "./src/index.ts",
6
+ "main": "./lib/module/index.js",
7
+ "module": "./lib/module/index.js",
8
+ "react-native": "./src/index.ts",
9
+ "types": "./lib/typescript/index.d.ts",
10
+ "exports": {
11
+ ".": {
12
+ "source": "./src/index.ts",
13
+ "react-native": "./src/index.ts",
14
+ "types": "./lib/typescript/index.d.ts",
15
+ "default": "./lib/module/index.js"
16
+ },
17
+ "./skia": {
18
+ "source": "./src/skia/index.ts",
19
+ "react-native": "./src/skia/index.ts",
20
+ "types": "./lib/typescript/skia/index.d.ts",
21
+ "default": "./lib/module/skia/index.js"
22
+ },
23
+ "./native": {
24
+ "source": "./src/native/index.ts",
25
+ "react-native": "./src/native/index.ts",
26
+ "types": "./lib/typescript/native/index.d.ts",
27
+ "default": "./lib/module/native/index.js"
28
+ },
29
+ "./package.json": "./package.json"
30
+ },
31
+ "files": [
32
+ "src",
33
+ "lib"
34
+ ],
35
+ "sideEffects": false,
36
+ "repository": {
37
+ "type": "git",
38
+ "url": "https://github.com/Rednegniw/number-flow-react-native.git",
39
+ "directory": "packages/number-flow-react-native"
40
+ },
41
+ "keywords": [
42
+ "react-native",
43
+ "animation",
44
+ "number",
45
+ "animated-numbers",
46
+ "reanimated",
47
+ "skia",
48
+ "number-flow",
49
+ "digit-animation"
50
+ ],
51
+ "author": "Antonin Wingender",
52
+ "license": "MIT",
53
+ "engines": {
54
+ "node": ">=18"
55
+ },
56
+ "scripts": {
57
+ "prepare": "bob build",
58
+ "prepublishOnly": "tsc --noEmit && jest",
59
+ "check-types": "tsc --noEmit",
60
+ "test": "jest",
61
+ "lint": "biome check .",
62
+ "lint:fix": "biome check --write ."
63
+ },
64
+ "peerDependencies": {
65
+ "react": ">=18",
66
+ "react-native": ">=0.73",
67
+ "react-native-reanimated": ">=3.0.0",
68
+ "@shopify/react-native-skia": ">=2.0.0"
69
+ },
70
+ "peerDependenciesMeta": {
71
+ "@shopify/react-native-skia": {
72
+ "optional": true
73
+ }
74
+ },
75
+ "dependencies": {
76
+ "@rednegniw/masked-view": "^0.4.0"
77
+ },
78
+ "devDependencies": {
79
+ "@types/jest": "^30.0.0",
80
+ "@types/react": "~19.1.0",
81
+ "jest": "^30.0.0",
82
+ "react-native-builder-bob": "^0.40.18",
83
+ "ts-jest": "^29.4.6",
84
+ "typescript": "~5.9.2"
85
+ },
86
+ "react-native-builder-bob": {
87
+ "source": "src",
88
+ "output": "lib",
89
+ "targets": [
90
+ [
91
+ "module",
92
+ {
93
+ "esm": true
94
+ }
95
+ ],
96
+ [
97
+ "typescript",
98
+ {
99
+ "project": "tsconfig.build.json"
100
+ }
101
+ ]
102
+ ]
103
+ }
104
+ }
@@ -0,0 +1,20 @@
1
+ export const MAX_SLOTS = 20;
2
+
3
+ export const DIGIT_COUNT = 10;
4
+
5
+ // Fallback character set for glyph measurement when the actual format characters are unknown
6
+ export const MEASURABLE_CHARS =
7
+ "0123456789.,%+-$/:! €£¥₩abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ~°";
8
+
9
+ /**
10
+ * Horizontal mask fade width as a ratio of lineHeight.
11
+ * Matches web NumberFlow's --number-flow-mask-width: 0.5em
12
+ */
13
+ export const MASK_WIDTH_RATIO = 0.5;
14
+
15
+ /**
16
+ * Superscript exponent rendering scale derived from OpenType font metrics.
17
+ * Inter font OS/2 table: ySuperscriptYSize = 1229/2048 ≈ 0.60.
18
+ * Consistent with TeX (\defaultscriptratio=0.7) and general typography convention (60-70%).
19
+ */
20
+ export const SUPERSCRIPT_SCALE = 0.6;