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.
- package/LICENSE +21 -0
- package/README.md +44 -0
- package/lib/module/core/constants.js +21 -0
- package/lib/module/core/constants.js.map +1 -0
- package/lib/module/core/intlHelpers.js +310 -0
- package/lib/module/core/intlHelpers.js.map +1 -0
- package/lib/module/core/layout.js +71 -0
- package/lib/module/core/layout.js.map +1 -0
- package/lib/module/core/mask.js +50 -0
- package/lib/module/core/mask.js.map +1 -0
- package/lib/module/core/numerals/detection.js +105 -0
- package/lib/module/core/numerals/detection.js.map +1 -0
- package/lib/module/core/numerals/digits.js +128 -0
- package/lib/module/core/numerals/digits.js.map +1 -0
- package/lib/module/core/numerals/index.js +5 -0
- package/lib/module/core/numerals/index.js.map +1 -0
- package/lib/module/core/numerals/tables.js +114 -0
- package/lib/module/core/numerals/tables.js.map +1 -0
- package/lib/module/core/superscript.js +31 -0
- package/lib/module/core/superscript.js.map +1 -0
- package/lib/module/core/timeLayout.js +98 -0
- package/lib/module/core/timeLayout.js.map +1 -0
- package/lib/module/core/timeTypes.js +4 -0
- package/lib/module/core/timeTypes.js.map +1 -0
- package/lib/module/core/timing.js +45 -0
- package/lib/module/core/timing.js.map +1 -0
- package/lib/module/core/types.js +58 -0
- package/lib/module/core/types.js.map +1 -0
- package/lib/module/core/useAccessibilityAnnouncement.js +27 -0
- package/lib/module/core/useAccessibilityAnnouncement.js.map +1 -0
- package/lib/module/core/useAnimatedX.js +25 -0
- package/lib/module/core/useAnimatedX.js.map +1 -0
- package/lib/module/core/useAnimationLifecycle.js +37 -0
- package/lib/module/core/useAnimationLifecycle.js.map +1 -0
- package/lib/module/core/useCanAnimate.js +22 -0
- package/lib/module/core/useCanAnimate.js.map +1 -0
- package/lib/module/core/useContinuousSpin.js +89 -0
- package/lib/module/core/useContinuousSpin.js.map +1 -0
- package/lib/module/core/useDebouncedWidths.js +74 -0
- package/lib/module/core/useDebouncedWidths.js.map +1 -0
- package/lib/module/core/useDigitAnimation.js +138 -0
- package/lib/module/core/useDigitAnimation.js.map +1 -0
- package/lib/module/core/useFlowPipeline.js +85 -0
- package/lib/module/core/useFlowPipeline.js.map +1 -0
- package/lib/module/core/useFormattedValue.js +28 -0
- package/lib/module/core/useFormattedValue.js.map +1 -0
- package/lib/module/core/useLayoutDiff.js +59 -0
- package/lib/module/core/useLayoutDiff.js.map +1 -0
- package/lib/module/core/useNumberFormatting.js +158 -0
- package/lib/module/core/useNumberFormatting.js.map +1 -0
- package/lib/module/core/useSlotOpacity.js +53 -0
- package/lib/module/core/useSlotOpacity.js.map +1 -0
- package/lib/module/core/useTimeFormatting.js +74 -0
- package/lib/module/core/useTimeFormatting.js.map +1 -0
- package/lib/module/core/useTimingResolution.js +21 -0
- package/lib/module/core/useTimingResolution.js.map +1 -0
- package/lib/module/core/useWorkletFormatting.js +49 -0
- package/lib/module/core/useWorkletFormatting.js.map +1 -0
- package/lib/module/core/utils.js +132 -0
- package/lib/module/core/utils.js.map +1 -0
- package/lib/module/core/warnings.js +10 -0
- package/lib/module/core/warnings.js.map +1 -0
- package/lib/module/index.js +7 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/native/DigitSlot.js +163 -0
- package/lib/module/native/DigitSlot.js.map +1 -0
- package/lib/module/native/NumberFlow.js +244 -0
- package/lib/module/native/NumberFlow.js.map +1 -0
- package/lib/module/native/SymbolSlot.js +52 -0
- package/lib/module/native/SymbolSlot.js.map +1 -0
- package/lib/module/native/TimeFlow.js +270 -0
- package/lib/module/native/TimeFlow.js.map +1 -0
- package/lib/module/native/index.js +5 -0
- package/lib/module/native/index.js.map +1 -0
- package/lib/module/native/renderSlots.js +108 -0
- package/lib/module/native/renderSlots.js.map +1 -0
- package/lib/module/native/types.js +4 -0
- package/lib/module/native/types.js.map +1 -0
- package/lib/module/native/useMeasuredGlyphMetrics.js +156 -0
- package/lib/module/native/useMeasuredGlyphMetrics.js.map +1 -0
- package/lib/module/package.json +1 -0
- package/lib/module/skia/DigitSlot.js +171 -0
- package/lib/module/skia/DigitSlot.js.map +1 -0
- package/lib/module/skia/SkiaNumberFlow.js +430 -0
- package/lib/module/skia/SkiaNumberFlow.js.map +1 -0
- package/lib/module/skia/SkiaTimeFlow.js +226 -0
- package/lib/module/skia/SkiaTimeFlow.js.map +1 -0
- package/lib/module/skia/SymbolSlot.js +92 -0
- package/lib/module/skia/SymbolSlot.js.map +1 -0
- package/lib/module/skia/index.js +6 -0
- package/lib/module/skia/index.js.map +1 -0
- package/lib/module/skia/renderSlots.js +131 -0
- package/lib/module/skia/renderSlots.js.map +1 -0
- package/lib/module/skia/useGlyphMetrics.js +72 -0
- package/lib/module/skia/useGlyphMetrics.js.map +1 -0
- package/lib/module/skia/useScrubbing.js +165 -0
- package/lib/module/skia/useScrubbing.js.map +1 -0
- package/lib/module/skia/useSkiaFont.js +23 -0
- package/lib/module/skia/useSkiaFont.js.map +1 -0
- package/lib/typescript/core/constants.d.ts +15 -0
- package/lib/typescript/core/constants.d.ts.map +1 -0
- package/lib/typescript/core/intlHelpers.d.ts +10 -0
- package/lib/typescript/core/intlHelpers.d.ts.map +1 -0
- package/lib/typescript/core/layout.d.ts +22 -0
- package/lib/typescript/core/layout.d.ts.map +1 -0
- package/lib/typescript/core/mask.d.ts +18 -0
- package/lib/typescript/core/mask.d.ts.map +1 -0
- package/lib/typescript/core/numerals/detection.d.ts +17 -0
- package/lib/typescript/core/numerals/detection.d.ts.map +1 -0
- package/lib/typescript/core/numerals/digits.d.ts +43 -0
- package/lib/typescript/core/numerals/digits.d.ts.map +1 -0
- package/lib/typescript/core/numerals/index.d.ts +3 -0
- package/lib/typescript/core/numerals/index.d.ts.map +1 -0
- package/lib/typescript/core/numerals/tables.d.ts +32 -0
- package/lib/typescript/core/numerals/tables.d.ts.map +1 -0
- package/lib/typescript/core/superscript.d.ts +16 -0
- package/lib/typescript/core/superscript.d.ts.map +1 -0
- package/lib/typescript/core/timeLayout.d.ts +19 -0
- package/lib/typescript/core/timeLayout.d.ts.map +1 -0
- package/lib/typescript/core/timeTypes.d.ts +80 -0
- package/lib/typescript/core/timeTypes.d.ts.map +1 -0
- package/lib/typescript/core/timing.d.ts +6 -0
- package/lib/typescript/core/timing.d.ts.map +1 -0
- package/lib/typescript/core/types.d.ts +165 -0
- package/lib/typescript/core/types.d.ts.map +1 -0
- package/lib/typescript/core/useAccessibilityAnnouncement.d.ts +10 -0
- package/lib/typescript/core/useAccessibilityAnnouncement.d.ts.map +1 -0
- package/lib/typescript/core/useAnimatedX.d.ts +9 -0
- package/lib/typescript/core/useAnimatedX.d.ts.map +1 -0
- package/lib/typescript/core/useAnimationLifecycle.d.ts +14 -0
- package/lib/typescript/core/useAnimationLifecycle.d.ts.map +1 -0
- package/lib/typescript/core/useCanAnimate.d.ts +14 -0
- package/lib/typescript/core/useCanAnimate.d.ts.map +1 -0
- package/lib/typescript/core/useContinuousSpin.d.ts +23 -0
- package/lib/typescript/core/useContinuousSpin.d.ts.map +1 -0
- package/lib/typescript/core/useDebouncedWidths.d.ts +17 -0
- package/lib/typescript/core/useDebouncedWidths.d.ts.map +1 -0
- package/lib/typescript/core/useDigitAnimation.d.ts +38 -0
- package/lib/typescript/core/useDigitAnimation.d.ts.map +1 -0
- package/lib/typescript/core/useFlowPipeline.d.ts +46 -0
- package/lib/typescript/core/useFlowPipeline.d.ts.map +1 -0
- package/lib/typescript/core/useFormattedValue.d.ts +14 -0
- package/lib/typescript/core/useFormattedValue.d.ts.map +1 -0
- package/lib/typescript/core/useLayoutDiff.d.ts +18 -0
- package/lib/typescript/core/useLayoutDiff.d.ts.map +1 -0
- package/lib/typescript/core/useNumberFormatting.d.ts +18 -0
- package/lib/typescript/core/useNumberFormatting.d.ts.map +1 -0
- package/lib/typescript/core/useSlotOpacity.d.ts +18 -0
- package/lib/typescript/core/useSlotOpacity.d.ts.map +1 -0
- package/lib/typescript/core/useTimeFormatting.d.ts +22 -0
- package/lib/typescript/core/useTimeFormatting.d.ts.map +1 -0
- package/lib/typescript/core/useTimingResolution.d.ts +13 -0
- package/lib/typescript/core/useTimingResolution.d.ts.map +1 -0
- package/lib/typescript/core/useWorkletFormatting.d.ts +14 -0
- package/lib/typescript/core/useWorkletFormatting.d.ts.map +1 -0
- package/lib/typescript/core/utils.d.ts +44 -0
- package/lib/typescript/core/utils.d.ts.map +1 -0
- package/lib/typescript/core/warnings.d.ts +2 -0
- package/lib/typescript/core/warnings.d.ts.map +1 -0
- package/lib/typescript/index.d.ts +8 -0
- package/lib/typescript/index.d.ts.map +1 -0
- package/lib/typescript/native/DigitSlot.d.ts +27 -0
- package/lib/typescript/native/DigitSlot.d.ts.map +1 -0
- package/lib/typescript/native/NumberFlow.d.ts +3 -0
- package/lib/typescript/native/NumberFlow.d.ts.map +1 -0
- package/lib/typescript/native/SymbolSlot.d.ts +19 -0
- package/lib/typescript/native/SymbolSlot.d.ts.map +1 -0
- package/lib/typescript/native/TimeFlow.d.ts +3 -0
- package/lib/typescript/native/TimeFlow.d.ts.map +1 -0
- package/lib/typescript/native/index.d.ts +3 -0
- package/lib/typescript/native/index.d.ts.map +1 -0
- package/lib/typescript/native/renderSlots.d.ts +31 -0
- package/lib/typescript/native/renderSlots.d.ts.map +1 -0
- package/lib/typescript/native/types.d.ts +36 -0
- package/lib/typescript/native/types.d.ts.map +1 -0
- package/lib/typescript/native/useMeasuredGlyphMetrics.d.ts +8 -0
- package/lib/typescript/native/useMeasuredGlyphMetrics.d.ts.map +1 -0
- package/lib/typescript/package.json +1 -0
- package/lib/typescript/skia/DigitSlot.d.ts +35 -0
- package/lib/typescript/skia/DigitSlot.d.ts.map +1 -0
- package/lib/typescript/skia/SkiaNumberFlow.d.ts +3 -0
- package/lib/typescript/skia/SkiaNumberFlow.d.ts.map +1 -0
- package/lib/typescript/skia/SkiaTimeFlow.d.ts +3 -0
- package/lib/typescript/skia/SkiaTimeFlow.d.ts.map +1 -0
- package/lib/typescript/skia/SymbolSlot.d.ts +26 -0
- package/lib/typescript/skia/SymbolSlot.d.ts.map +1 -0
- package/lib/typescript/skia/index.d.ts +6 -0
- package/lib/typescript/skia/index.d.ts.map +1 -0
- package/lib/typescript/skia/renderSlots.d.ts +40 -0
- package/lib/typescript/skia/renderSlots.d.ts.map +1 -0
- package/lib/typescript/skia/useGlyphMetrics.d.ts +16 -0
- package/lib/typescript/skia/useGlyphMetrics.d.ts.map +1 -0
- package/lib/typescript/skia/useScrubbing.d.ts +59 -0
- package/lib/typescript/skia/useScrubbing.d.ts.map +1 -0
- package/lib/typescript/skia/useSkiaFont.d.ts +13 -0
- package/lib/typescript/skia/useSkiaFont.d.ts.map +1 -0
- package/package.json +104 -0
- package/src/core/constants.ts +20 -0
- package/src/core/intlHelpers.ts +351 -0
- package/src/core/layout.ts +108 -0
- package/src/core/mask.ts +72 -0
- package/src/core/numerals/detection.ts +112 -0
- package/src/core/numerals/digits.ts +102 -0
- package/src/core/numerals/index.ts +9 -0
- package/src/core/numerals/tables.ts +112 -0
- package/src/core/superscript.ts +27 -0
- package/src/core/timeLayout.ts +119 -0
- package/src/core/timeTypes.ts +88 -0
- package/src/core/timing.ts +60 -0
- package/src/core/types.ts +189 -0
- package/src/core/useAccessibilityAnnouncement.ts +27 -0
- package/src/core/useAnimatedX.ts +30 -0
- package/src/core/useAnimationLifecycle.ts +54 -0
- package/src/core/useCanAnimate.ts +21 -0
- package/src/core/useContinuousSpin.ts +112 -0
- package/src/core/useDebouncedWidths.ts +93 -0
- package/src/core/useDigitAnimation.ts +192 -0
- package/src/core/useFlowPipeline.ts +126 -0
- package/src/core/useFormattedValue.ts +32 -0
- package/src/core/useLayoutDiff.ts +71 -0
- package/src/core/useNumberFormatting.ts +164 -0
- package/src/core/useSlotOpacity.ts +66 -0
- package/src/core/useTimeFormatting.ts +95 -0
- package/src/core/useTimingResolution.ts +47 -0
- package/src/core/useWorkletFormatting.ts +59 -0
- package/src/core/utils.ts +149 -0
- package/src/core/warnings.ts +8 -0
- package/src/index.ts +15 -0
- package/src/native/DigitSlot.tsx +203 -0
- package/src/native/NumberFlow.tsx +287 -0
- package/src/native/SymbolSlot.tsx +68 -0
- package/src/native/TimeFlow.tsx +287 -0
- package/src/native/index.ts +2 -0
- package/src/native/renderSlots.tsx +150 -0
- package/src/native/types.ts +40 -0
- package/src/native/useMeasuredGlyphMetrics.tsx +205 -0
- package/src/skia/DigitSlot.tsx +221 -0
- package/src/skia/SkiaNumberFlow.tsx +506 -0
- package/src/skia/SkiaTimeFlow.tsx +257 -0
- package/src/skia/SymbolSlot.tsx +120 -0
- package/src/skia/index.ts +5 -0
- package/src/skia/renderSlots.tsx +180 -0
- package/src/skia/useGlyphMetrics.ts +79 -0
- package/src/skia/useScrubbing.ts +223 -0
- package/src/skia/useSkiaFont.ts +25 -0
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
import type { SkFont } from "@shopify/react-native-skia";
|
|
2
|
+
import type { EasingFunction, SharedValue } from "react-native-reanimated";
|
|
3
|
+
export interface TimingConfig {
|
|
4
|
+
/** Duration in milliseconds */
|
|
5
|
+
duration: number;
|
|
6
|
+
/** Easing function (t: 0→1) => 0→1 */
|
|
7
|
+
easing: EasingFunction;
|
|
8
|
+
}
|
|
9
|
+
export interface AnimationConfig {
|
|
10
|
+
/** Timing for layout transforms (position, width changes). Defaults to NumberFlow's 900ms deceleration curve. */
|
|
11
|
+
transformTiming?: TimingConfig;
|
|
12
|
+
/** Timing for digit spin/rolling. Falls back to transformTiming if unset. */
|
|
13
|
+
spinTiming?: TimingConfig;
|
|
14
|
+
/** Timing for enter/exit opacity. Defaults to 450ms ease-out. */
|
|
15
|
+
opacityTiming?: TimingConfig;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Controls digit spin direction:
|
|
19
|
+
* - `1`: always spin upward
|
|
20
|
+
* - `-1`: always spin downward
|
|
21
|
+
* - `0`: each digit takes the shortest path
|
|
22
|
+
*/
|
|
23
|
+
export type Trend = -1 | 0 | 1;
|
|
24
|
+
/**
|
|
25
|
+
* Trend prop accepted by components: either a static direction
|
|
26
|
+
* or a function that receives (prevValue, nextValue) and returns the direction.
|
|
27
|
+
*/
|
|
28
|
+
export type TrendProp = Trend | ((prev: number, next: number) => Trend);
|
|
29
|
+
/**
|
|
30
|
+
* Animation behavior props shared by all Flow components (NumberFlow, TimeFlow,
|
|
31
|
+
* SkiaNumberFlow, SkiaTimeFlow). Controls how digit transitions behave.
|
|
32
|
+
*/
|
|
33
|
+
export interface AnimationBehaviorProps extends AnimationConfig {
|
|
34
|
+
/**
|
|
35
|
+
* Digit spin direction. When omitted, auto-detects from value changes:
|
|
36
|
+
* increasing values spin up, decreasing spin down.
|
|
37
|
+
* Pass `0` explicitly for shortest-path per-digit behavior.
|
|
38
|
+
*/
|
|
39
|
+
trend?: TrendProp;
|
|
40
|
+
/** Set to false to disable animations and update instantly. Defaults to true. */
|
|
41
|
+
animated?: boolean;
|
|
42
|
+
/** When true (default), disables animations when the device's "Reduce Motion" setting is on. */
|
|
43
|
+
respectMotionPreference?: boolean;
|
|
44
|
+
/**
|
|
45
|
+
* When true, unchanged lower-significance digits spin through a full cycle
|
|
46
|
+
* during transitions, making the number appear to pass through intermediate values.
|
|
47
|
+
* Defaults to false.
|
|
48
|
+
*/
|
|
49
|
+
continuous?: boolean;
|
|
50
|
+
/** Enable edge gradient fade masking on digit slots. Defaults to true. */
|
|
51
|
+
mask?: boolean;
|
|
52
|
+
/** Called when update animations begin */
|
|
53
|
+
onAnimationsStart?: () => void;
|
|
54
|
+
/** Called when all update animations complete */
|
|
55
|
+
onAnimationsFinish?: () => void;
|
|
56
|
+
}
|
|
57
|
+
/** A single character with a stable key from formatToParts RTL/LTR keying */
|
|
58
|
+
export interface KeyedPart {
|
|
59
|
+
/** Stable key: "integer:0" (ones), "integer:1" (tens), "fraction:0" (tenths), "decimal:0", etc. */
|
|
60
|
+
key: string;
|
|
61
|
+
/** Whether this is a rolling digit or a static symbol */
|
|
62
|
+
type: "digit" | "symbol";
|
|
63
|
+
/** The display character */
|
|
64
|
+
char: string;
|
|
65
|
+
/** 0-9 for digits, -1 for symbols */
|
|
66
|
+
digitValue: number;
|
|
67
|
+
}
|
|
68
|
+
export declare function digitPart(key: string, value: number): KeyedPart;
|
|
69
|
+
export declare function symbolPart(key: string, char: string): KeyedPart;
|
|
70
|
+
export interface GlyphMetrics {
|
|
71
|
+
/** Advance width for each measurable character */
|
|
72
|
+
charWidths: Record<string, number>;
|
|
73
|
+
/** Maximum width among digits 0-9 (used for uniform digit slot sizing) */
|
|
74
|
+
maxDigitWidth: number;
|
|
75
|
+
/** Line height computed from font metrics: ceil(descent - ascent) */
|
|
76
|
+
lineHeight: number;
|
|
77
|
+
/** Font ascent (negative value — distance above baseline) */
|
|
78
|
+
ascent: number;
|
|
79
|
+
/** Font descent (positive value — distance below baseline) */
|
|
80
|
+
descent: number;
|
|
81
|
+
/**
|
|
82
|
+
* Per-character tight vertical bounds relative to the baseline.
|
|
83
|
+
* `top` is negative (above baseline), `bottom` is positive (below baseline).
|
|
84
|
+
* Used by the adaptive mask to avoid fading into visible glyph content.
|
|
85
|
+
*/
|
|
86
|
+
charBounds: Record<string, {
|
|
87
|
+
top: number;
|
|
88
|
+
bottom: number;
|
|
89
|
+
}>;
|
|
90
|
+
}
|
|
91
|
+
export type TextAlign = "left" | "right" | "center";
|
|
92
|
+
/**
|
|
93
|
+
* Per-position digit constraint. `max` defines the highest value the
|
|
94
|
+
* digit can display (inclusive), creating a wheel of (max + 1) values.
|
|
95
|
+
* Example: { max: 5 } creates a 0-5 wheel (6 elements).
|
|
96
|
+
*/
|
|
97
|
+
export interface DigitConstraint {
|
|
98
|
+
max: number;
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Maps integer positions to their constraints.
|
|
102
|
+
* Position 0 = ones, 1 = tens, 2 = hundreds, etc.
|
|
103
|
+
* Positions not listed default to { max: 9 } (standard 0-9 wheel).
|
|
104
|
+
*/
|
|
105
|
+
export type DigitsProp = Record<number, DigitConstraint>;
|
|
106
|
+
/** Value props — mutually exclusive: provide `value` (JS-driven) or `sharedValue` (worklet-driven), not both. */
|
|
107
|
+
type SkiaNumberFlowValueProps = {
|
|
108
|
+
/** JS-thread numeric value. Mutually exclusive with sharedValue. */
|
|
109
|
+
value: number;
|
|
110
|
+
/** Intl.NumberFormatOptions for value formatting */
|
|
111
|
+
format?: Intl.NumberFormatOptions;
|
|
112
|
+
/** Locale(s) for Intl.NumberFormat */
|
|
113
|
+
locales?: Intl.LocalesArgument;
|
|
114
|
+
sharedValue?: never;
|
|
115
|
+
} | {
|
|
116
|
+
value?: never;
|
|
117
|
+
format?: never;
|
|
118
|
+
locales?: never;
|
|
119
|
+
/** Worklet-driven pre-formatted string. Mutually exclusive with value. */
|
|
120
|
+
sharedValue: SharedValue<string>;
|
|
121
|
+
};
|
|
122
|
+
interface SkiaNumberFlowBaseProps extends AnimationBehaviorProps {
|
|
123
|
+
/** SkFont instance from useFont(). Required — renders empty until font loads. */
|
|
124
|
+
font: SkFont | null;
|
|
125
|
+
/** Text color (Skia color string). Defaults to "#000000". */
|
|
126
|
+
color?: string;
|
|
127
|
+
/** X position within the Canvas. Defaults to 0. */
|
|
128
|
+
x?: number;
|
|
129
|
+
/** Y position within the Canvas (baseline). Defaults to 0. */
|
|
130
|
+
y?: number;
|
|
131
|
+
/** Available width for alignment calculations. Defaults to 0. */
|
|
132
|
+
width?: number;
|
|
133
|
+
/** Text alignment within the available width. Defaults to "left". */
|
|
134
|
+
textAlign?: TextAlign;
|
|
135
|
+
/** Static string prepended before the number */
|
|
136
|
+
prefix?: string;
|
|
137
|
+
/** Static string appended after the number */
|
|
138
|
+
suffix?: string;
|
|
139
|
+
/** Parent opacity (SharedValue for animation coordination) */
|
|
140
|
+
opacity?: SharedValue<number>;
|
|
141
|
+
/**
|
|
142
|
+
* Per-position digit constraints. Maps integer position (0=ones, 1=tens, ...)
|
|
143
|
+
* to { max: N } where N is the highest digit value (inclusive).
|
|
144
|
+
* Example: { 1: { max: 5 } } for a wheel where tens go 0-5.
|
|
145
|
+
*/
|
|
146
|
+
digits?: DigitsProp;
|
|
147
|
+
/**
|
|
148
|
+
* Controls digit width during worklet-driven scrubbing (when sharedValue is active).
|
|
149
|
+
* Value between 0 and 1 representing the percentile between min and max digit width.
|
|
150
|
+
* - 0: use narrowest digit width (tightest, may clip wide digits)
|
|
151
|
+
* - 0.5: use average digit width
|
|
152
|
+
* - 1: use widest digit width (no clipping, but wider spacing)
|
|
153
|
+
* Defaults to 0.75 (75th percentile) for a good balance.
|
|
154
|
+
* Only affects digits; symbols like "." keep their natural width.
|
|
155
|
+
*/
|
|
156
|
+
scrubDigitWidthPercentile?: number;
|
|
157
|
+
}
|
|
158
|
+
/**
|
|
159
|
+
* Props for SkiaNumberFlow.
|
|
160
|
+
* Value changes are auto-announced for screen reader users.
|
|
161
|
+
* For VoiceOver/TalkBack focus-based reading, set `accessibilityLabel` on the parent Canvas.
|
|
162
|
+
*/
|
|
163
|
+
export type SkiaNumberFlowProps = SkiaNumberFlowBaseProps & SkiaNumberFlowValueProps;
|
|
164
|
+
export {};
|
|
165
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/core/types.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Announces label changes to screen readers for Skia components.
|
|
3
|
+
*
|
|
4
|
+
* Skia renders inside <Canvas>, which is opaque to the accessibility tree.
|
|
5
|
+
* This hook auto-announces value changes when a screen reader is active
|
|
6
|
+
* so users get audio feedback. The first render is skipped to avoid
|
|
7
|
+
* announcing the initial value.
|
|
8
|
+
*/
|
|
9
|
+
export declare function useAccessibilityAnnouncement(label: string | undefined): void;
|
|
10
|
+
//# sourceMappingURL=useAccessibilityAnnouncement.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useAccessibilityAnnouncement.d.ts","sourceRoot":"","sources":["../../../src/core/useAccessibilityAnnouncement.ts"],"names":[],"mappings":"AAGA;;;;;;;GAOG;AACH,wBAAgB,4BAA4B,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,CAe5E"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type SharedValue } from "react-native-reanimated";
|
|
2
|
+
import type { TimingConfig } from "./types";
|
|
3
|
+
/**
|
|
4
|
+
* We use makeMutable (via useState) instead of useSharedValue because
|
|
5
|
+
* useSharedValue's cleanup calls cancelAnimation, which kills in-flight
|
|
6
|
+
* animations when the component re-renders in StrictMode.
|
|
7
|
+
*/
|
|
8
|
+
export declare function useAnimatedX(targetX: number, exiting: boolean, transformTiming: TimingConfig): SharedValue<number>;
|
|
9
|
+
//# sourceMappingURL=useAnimatedX.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useAnimatedX.d.ts","sourceRoot":"","sources":["../../../src/core/useAnimatedX.ts"],"names":[],"mappings":"AACA,OAAO,EAAe,KAAK,WAAW,EAAc,MAAM,yBAAyB,CAAC;AACpF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAE5C;;;;GAIG;AAEH,wBAAgB,YAAY,CAC1B,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,OAAO,EAChB,eAAe,EAAE,YAAY,GAC5B,WAAW,CAAC,MAAM,CAAC,CAerB"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { CharLayout } from "./layout";
|
|
2
|
+
import type { TimingConfig } from "./types";
|
|
3
|
+
/**
|
|
4
|
+
* Fires animation lifecycle callbacks (start/finish) when the layout changes.
|
|
5
|
+
*
|
|
6
|
+
* Uses refs for callbacks to avoid stale closures in the setTimeout,
|
|
7
|
+
* and tracks previous layout to detect actual changes (not initial mount).
|
|
8
|
+
*/
|
|
9
|
+
export declare function useAnimationLifecycle(layout: CharLayout[], timings: {
|
|
10
|
+
spin: TimingConfig;
|
|
11
|
+
opacity: TimingConfig;
|
|
12
|
+
transform: TimingConfig;
|
|
13
|
+
}, onAnimationsStart?: () => void, onAnimationsFinish?: () => void): void;
|
|
14
|
+
//# sourceMappingURL=useAnimationLifecycle.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useAnimationLifecycle.d.ts","sourceRoot":"","sources":["../../../src/core/useAnimationLifecycle.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAC3C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAE5C;;;;;GAKG;AACH,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,UAAU,EAAE,EACpB,OAAO,EAAE;IAAE,IAAI,EAAE,YAAY,CAAC;IAAC,OAAO,EAAE,YAAY,CAAC;IAAC,SAAS,EAAE,YAAY,CAAA;CAAE,EAC/E,iBAAiB,CAAC,EAAE,MAAM,IAAI,EAC9B,kBAAkB,CAAC,EAAE,MAAM,IAAI,GAC9B,IAAI,CAsCN"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Returns whether NumberFlow animations are currently enabled.
|
|
3
|
+
*
|
|
4
|
+
* Use this to conditionally render UI based on animation support:
|
|
5
|
+
* ```tsx
|
|
6
|
+
* const canAnimate = useCanAnimate();
|
|
7
|
+
* return canAnimate ? <NumberFlow value={42} /> : <Text>42</Text>;
|
|
8
|
+
* ```
|
|
9
|
+
*
|
|
10
|
+
* When `respectMotionPreference` is true (default), returns false
|
|
11
|
+
* if the device's "Reduce Motion" accessibility setting is on.
|
|
12
|
+
*/
|
|
13
|
+
export declare function useCanAnimate(respectMotionPreference?: boolean): boolean;
|
|
14
|
+
//# sourceMappingURL=useCanAnimate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useCanAnimate.d.ts","sourceRoot":"","sources":["../../../src/core/useCanAnimate.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;GAWG;AACH,wBAAgB,aAAa,CAAC,uBAAuB,UAAO,GAAG,OAAO,CAMrE"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { KeyedPart, Trend } from "./types";
|
|
2
|
+
/**
|
|
3
|
+
* Pure algorithm: given previous and current keyed parts, determines which
|
|
4
|
+
* unchanged lower-significance digits should do a full-wheel continuous spin.
|
|
5
|
+
*
|
|
6
|
+
* Returns a new Map with incremented generation counters for those digits.
|
|
7
|
+
* The generation counter is what triggers the spin animation in useDigitAnimation.
|
|
8
|
+
*/
|
|
9
|
+
export declare function computeContinuousGenerations(prevParts: KeyedPart[], currentParts: KeyedPart[], prevGenerations: Map<string, number>): Map<string, number>;
|
|
10
|
+
/**
|
|
11
|
+
* Tracks which digits need a full-wheel continuous spin.
|
|
12
|
+
*
|
|
13
|
+
* When `continuous` is enabled, unchanged lower-significance digits spin
|
|
14
|
+
* through a complete cycle alongside higher-significance digits that changed.
|
|
15
|
+
* For example, 100 -> 200 with trend=1 makes ones and tens both do a
|
|
16
|
+
* full upward rotation even though their values didn't change.
|
|
17
|
+
*
|
|
18
|
+
* Returns a Map<key, generation> where generation increments each time
|
|
19
|
+
* a digit should perform a continuous spin. Returns undefined when
|
|
20
|
+
* continuous is disabled (zero overhead path).
|
|
21
|
+
*/
|
|
22
|
+
export declare function useContinuousSpin(keyedParts: KeyedPart[], continuous: boolean | undefined, trend: Trend): Map<string, number> | undefined;
|
|
23
|
+
//# sourceMappingURL=useContinuousSpin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useContinuousSpin.d.ts","sourceRoot":"","sources":["../../../src/core/useContinuousSpin.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAGhD;;;;;;GAMG;AACH,wBAAgB,4BAA4B,CAC1C,SAAS,EAAE,SAAS,EAAE,EACtB,YAAY,EAAE,SAAS,EAAE,EACzB,eAAe,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,GACnC,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAqDrB;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,iBAAiB,CAC/B,UAAU,EAAE,SAAS,EAAE,EACvB,UAAU,EAAE,OAAO,GAAG,SAAS,EAC/B,KAAK,EAAE,KAAK,GACX,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS,CAyBjC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { type SharedValue } from "react-native-reanimated";
|
|
2
|
+
/**
|
|
3
|
+
* Creates a pool of SharedValue<number> that hold digit widths for worklet layout.
|
|
4
|
+
*
|
|
5
|
+
* **Tabular mode during scrubbing**: While sharedValue is active (scrubbing),
|
|
6
|
+
* all digits use a fixed width (scrubDigitWidth) — this eliminates jitter entirely
|
|
7
|
+
* because all digits occupy the same width regardless of which digit (0-9) is displayed.
|
|
8
|
+
* Only digits are affected; symbols (like `.`) keep their natural width.
|
|
9
|
+
*
|
|
10
|
+
* **Proportional mode when idle**: When scrubbing ends (sharedValue becomes
|
|
11
|
+
* empty), widths animate to proportional values for natural typography.
|
|
12
|
+
*
|
|
13
|
+
* This approach gives the best of both worlds: stable layout during rapid
|
|
14
|
+
* scrubbing, and beautiful proportional spacing for static display.
|
|
15
|
+
*/
|
|
16
|
+
export declare function useDebouncedWidths(digitWidths: number[] | null, scrubDigitWidth: number, sharedValue: SharedValue<string> | undefined, prefix: string, suffix: string, zeroCodePoint?: number): SharedValue<number>[];
|
|
17
|
+
//# sourceMappingURL=useDebouncedWidths.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useDebouncedWidths.d.ts","sourceRoot":"","sources":["../../../src/core/useDebouncedWidths.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,KAAK,WAAW,EAGjB,MAAM,yBAAyB,CAAC;AAMjC;;;;;;;;;;;;;GAaG;AACH,wBAAgB,kBAAkB,CAChC,WAAW,EAAE,MAAM,EAAE,GAAG,IAAI,EAC5B,eAAe,EAAE,MAAM,EACvB,WAAW,EAAE,WAAW,CAAC,MAAM,CAAC,GAAG,SAAS,EAC5C,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EACd,aAAa,SAAK,GACjB,WAAW,CAAC,MAAM,CAAC,EAAE,CA2DvB"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { type SharedValue } from "react-native-reanimated";
|
|
2
|
+
import type { TimingConfig, Trend } from "./types";
|
|
3
|
+
/**
|
|
4
|
+
* We use makeMutable (via useState) instead of useSharedValue because
|
|
5
|
+
* useSharedValue's cleanup calls cancelAnimation, which kills in-flight
|
|
6
|
+
* animations when the component re-renders in StrictMode.
|
|
7
|
+
*/
|
|
8
|
+
interface UseDigitAnimationParams {
|
|
9
|
+
digitValue: number;
|
|
10
|
+
entering: boolean;
|
|
11
|
+
exiting: boolean;
|
|
12
|
+
trend: Trend;
|
|
13
|
+
spinTiming: TimingConfig;
|
|
14
|
+
opacityTiming: TimingConfig;
|
|
15
|
+
exitKey?: string;
|
|
16
|
+
onExitComplete?: (key: string) => void;
|
|
17
|
+
workletDigitValue?: SharedValue<number>;
|
|
18
|
+
/** Number of values in this digit's wheel. Defaults to 10 (0-9). */
|
|
19
|
+
digitCount?: number;
|
|
20
|
+
/** Incrementing counter from useContinuousSpin; triggers a full-wheel rotation when changed. */
|
|
21
|
+
continuousSpinGeneration?: number;
|
|
22
|
+
}
|
|
23
|
+
interface UseDigitAnimationResult {
|
|
24
|
+
initialDigit: number;
|
|
25
|
+
animDelta: SharedValue<number>;
|
|
26
|
+
currentDigitSV: SharedValue<number>;
|
|
27
|
+
slotOpacity: SharedValue<number>;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Manages the digit rolling state machine: delta tracking, exit animations,
|
|
31
|
+
* prop-driven digit changes, and worklet-driven digit updates.
|
|
32
|
+
*
|
|
33
|
+
* Each renderer creates its own format-specific Y transforms and position
|
|
34
|
+
* reaction that reads animDelta + currentDigitSV from this hook.
|
|
35
|
+
*/
|
|
36
|
+
export declare function useDigitAnimation({ digitValue, entering, exiting, trend, spinTiming, opacityTiming, exitKey, onExitComplete, workletDigitValue, digitCount, continuousSpinGeneration, }: UseDigitAnimationParams): UseDigitAnimationResult;
|
|
37
|
+
export {};
|
|
38
|
+
//# sourceMappingURL=useDigitAnimation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useDigitAnimation.d.ts","sourceRoot":"","sources":["../../../src/core/useDigitAnimation.ts"],"names":[],"mappings":"AACA,OAAO,EAGL,KAAK,WAAW,EAGjB,MAAM,yBAAyB,CAAC;AAEjC,OAAO,KAAK,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAInD;;;;GAIG;AAEH,UAAU,uBAAuB;IAC/B,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,OAAO,CAAC;IAClB,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,KAAK,CAAC;IACb,UAAU,EAAE,YAAY,CAAC;IACzB,aAAa,EAAE,YAAY,CAAC;IAC5B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,cAAc,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IACvC,iBAAiB,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IACxC,oEAAoE;IACpE,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,gGAAgG;IAChG,wBAAwB,CAAC,EAAE,MAAM,CAAC;CACnC;AAED,UAAU,uBAAuB;IAC/B,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAC/B,cAAc,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IACpC,WAAW,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;CAClC;AAED;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,EAChC,UAAU,EACV,QAAQ,EACR,OAAO,EACP,KAAK,EACL,UAAU,EACV,aAAa,EACb,OAAO,EACP,cAAc,EACd,iBAAiB,EACjB,UAAU,EACV,wBAAwB,GACzB,EAAE,uBAAuB,GAAG,uBAAuB,CAkInD"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import type { CharLayout } from "./layout";
|
|
2
|
+
import { type MaskHeights } from "./mask";
|
|
3
|
+
import type { GlyphMetrics, KeyedPart, TimingConfig, Trend, TrendProp } from "./types";
|
|
4
|
+
interface FlowPipelineInput {
|
|
5
|
+
keyedParts: KeyedPart[];
|
|
6
|
+
trendValue: number | undefined;
|
|
7
|
+
layout: CharLayout[];
|
|
8
|
+
metrics: GlyphMetrics | null;
|
|
9
|
+
animated?: boolean;
|
|
10
|
+
respectMotionPreference?: boolean;
|
|
11
|
+
spinTiming?: TimingConfig;
|
|
12
|
+
opacityTiming?: TimingConfig;
|
|
13
|
+
transformTiming?: TimingConfig;
|
|
14
|
+
trend?: TrendProp;
|
|
15
|
+
continuous?: boolean;
|
|
16
|
+
mask?: boolean;
|
|
17
|
+
onAnimationsStart?: () => void;
|
|
18
|
+
onAnimationsFinish?: () => void;
|
|
19
|
+
}
|
|
20
|
+
interface FlowPipelineOutput {
|
|
21
|
+
resolvedSpinTiming: TimingConfig;
|
|
22
|
+
resolvedOpacityTiming: TimingConfig;
|
|
23
|
+
resolvedTransformTiming: TimingConfig;
|
|
24
|
+
resolvedTrend: Trend;
|
|
25
|
+
spinGenerations: Map<string, number> | undefined;
|
|
26
|
+
prevMap: Map<string, CharLayout>;
|
|
27
|
+
isInitialRender: boolean;
|
|
28
|
+
exitingEntries: Map<string, CharLayout>;
|
|
29
|
+
onExitComplete: (key: string) => void;
|
|
30
|
+
accessibilityLabel: string | undefined;
|
|
31
|
+
adaptiveMask: MaskHeights;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Shared data pipeline for all Flow components (NumberFlow, TimeFlow,
|
|
35
|
+
* SkiaNumberFlow, SkiaTimeFlow).
|
|
36
|
+
*
|
|
37
|
+
* Handles: timing resolution, trend tracking, continuous spin,
|
|
38
|
+
* animation lifecycle, layout diffing, accessibility label,
|
|
39
|
+
* and adaptive mask computation.
|
|
40
|
+
*
|
|
41
|
+
* Layout computation is left to callers because Skia components
|
|
42
|
+
* have additional sharedValue-driven layout paths.
|
|
43
|
+
*/
|
|
44
|
+
export declare function useFlowPipeline(input: FlowPipelineInput): FlowPipelineOutput;
|
|
45
|
+
export {};
|
|
46
|
+
//# sourceMappingURL=useFlowPipeline.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useFlowPipeline.d.ts","sourceRoot":"","sources":["../../../src/core/useFlowPipeline.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAC3C,OAAO,EAA8B,KAAK,WAAW,EAAE,MAAM,QAAQ,CAAC;AACtE,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,YAAY,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAOvF,UAAU,iBAAiB;IACzB,UAAU,EAAE,SAAS,EAAE,CAAC;IAKxB,UAAU,EAAE,MAAM,GAAG,SAAS,CAAC;IAI/B,MAAM,EAAE,UAAU,EAAE,CAAC;IAGrB,OAAO,EAAE,YAAY,GAAG,IAAI,CAAC;IAG7B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAClC,UAAU,CAAC,EAAE,YAAY,CAAC;IAC1B,aAAa,CAAC,EAAE,YAAY,CAAC;IAC7B,eAAe,CAAC,EAAE,YAAY,CAAC;IAC/B,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,iBAAiB,CAAC,EAAE,MAAM,IAAI,CAAC;IAC/B,kBAAkB,CAAC,EAAE,MAAM,IAAI,CAAC;CACjC;AAED,UAAU,kBAAkB;IAC1B,kBAAkB,EAAE,YAAY,CAAC;IACjC,qBAAqB,EAAE,YAAY,CAAC;IACpC,uBAAuB,EAAE,YAAY,CAAC;IACtC,aAAa,EAAE,KAAK,CAAC;IACrB,eAAe,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS,CAAC;IAEjD,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;IACjC,eAAe,EAAE,OAAO,CAAC;IACzB,cAAc,EAAE,GAAG,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;IACxC,cAAc,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IAEtC,kBAAkB,EAAE,MAAM,GAAG,SAAS,CAAC;IACvC,YAAY,EAAE,WAAW,CAAC;CAC3B;AAID;;;;;;;;;;GAUG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,iBAAiB,GAAG,kBAAkB,CA0D5E"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Formats a numeric value to a display string using Intl.NumberFormat, with optional prefix/suffix.
|
|
3
|
+
* Useful for providing an accessibility label on a parent Canvas for Skia components:
|
|
4
|
+
*
|
|
5
|
+
* ```tsx
|
|
6
|
+
* const label = useFormattedValue(value, { style: "currency", currency: "USD" });
|
|
7
|
+
*
|
|
8
|
+
* <Canvas accessible accessibilityLabel={label}>
|
|
9
|
+
* <SkiaNumberFlow value={value} font={font} format={{ style: "currency", currency: "USD" }} />
|
|
10
|
+
* </Canvas>
|
|
11
|
+
* ```
|
|
12
|
+
*/
|
|
13
|
+
export declare function useFormattedValue(value: number | undefined, format?: Intl.NumberFormatOptions, locales?: Intl.LocalesArgument, prefix?: string, suffix?: string): string | undefined;
|
|
14
|
+
//# sourceMappingURL=useFormattedValue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useFormattedValue.d.ts","sourceRoot":"","sources":["../../../src/core/useFormattedValue.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;GAWG;AACH,wBAAgB,iBAAiB,CAC/B,KAAK,EAAE,MAAM,GAAG,SAAS,EACzB,MAAM,CAAC,EAAE,IAAI,CAAC,mBAAmB,EACjC,OAAO,CAAC,EAAE,IAAI,CAAC,eAAe,EAC9B,MAAM,CAAC,EAAE,MAAM,EACf,MAAM,CAAC,EAAE,MAAM,GACd,MAAM,GAAG,SAAS,CAUpB"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { CharLayout } from "./layout";
|
|
2
|
+
interface LayoutDiffResult {
|
|
3
|
+
prevMap: Map<string, CharLayout>;
|
|
4
|
+
isInitialRender: boolean;
|
|
5
|
+
exitingEntries: Map<string, CharLayout>;
|
|
6
|
+
onExitComplete: (key: string) => void;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Manages enter/exit tracking for layout transitions. Diffs the current
|
|
10
|
+
* layout against the previous one and tracks exiting entries until their
|
|
11
|
+
* animations complete.
|
|
12
|
+
*
|
|
13
|
+
* The diff logic runs during render (not in useEffect) using a ref-based
|
|
14
|
+
* idempotent pattern for StrictMode safety.
|
|
15
|
+
*/
|
|
16
|
+
export declare function useLayoutDiff(layout: CharLayout[]): LayoutDiffResult;
|
|
17
|
+
export {};
|
|
18
|
+
//# sourceMappingURL=useLayoutDiff.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useLayoutDiff.d.ts","sourceRoot":"","sources":["../../../src/core/useLayoutDiff.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAE3C,UAAU,gBAAgB;IACxB,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;IACjC,eAAe,EAAE,OAAO,CAAC;IACzB,cAAc,EAAE,GAAG,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;IACxC,cAAc,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;CACvC;AAED;;;;;;;GAOG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,UAAU,EAAE,GAAG,gBAAgB,CAoDpE"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { KeyedPart } from "./types";
|
|
2
|
+
/**
|
|
3
|
+
* Transforms `Intl.NumberFormat.formatToParts()` output into a flat array of
|
|
4
|
+
* stably-keyed single-character parts. Integer digits are keyed right-to-left
|
|
5
|
+
* (ones = `integer:0`, tens = `integer:1`, etc.) so that the ones place always
|
|
6
|
+
* maps to the same React key regardless of digit count. Fraction digits are
|
|
7
|
+
* keyed left-to-right from the decimal point (`fraction:0` = tenths, etc.).
|
|
8
|
+
*
|
|
9
|
+
* This keying ensures correct animation behavior when digits are added/removed
|
|
10
|
+
* (e.g., 9→10: ones place spins 9→0, tens place enters as new digit).
|
|
11
|
+
*/
|
|
12
|
+
export declare function formatToKeyedParts(value: number, formatter: Intl.NumberFormat, locales: Intl.LocalesArgument | undefined, prefix?: string, suffix?: string): KeyedPart[];
|
|
13
|
+
/**
|
|
14
|
+
* Hook that formats a numeric value into stably-keyed character parts.
|
|
15
|
+
* Uses Intl.NumberFormat.formatToParts() with RTL integer keying.
|
|
16
|
+
*/
|
|
17
|
+
export declare function useNumberFormatting(value: number | undefined, format: Intl.NumberFormatOptions | undefined, locales: Intl.LocalesArgument | undefined, prefix: string, suffix: string): KeyedPart[];
|
|
18
|
+
//# sourceMappingURL=useNumberFormatting.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useNumberFormatting.d.ts","sourceRoot":"","sources":["../../../src/core/useNumberFormatting.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEzC;;;;;;;;;GASG;AACH,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,MAAM,EACb,SAAS,EAAE,IAAI,CAAC,YAAY,EAC5B,OAAO,EAAE,IAAI,CAAC,eAAe,GAAG,SAAS,EACzC,MAAM,SAAK,EACX,MAAM,SAAK,GACV,SAAS,EAAE,CAwHb;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,MAAM,GAAG,SAAS,EACzB,MAAM,EAAE,IAAI,CAAC,mBAAmB,GAAG,SAAS,EAC5C,OAAO,EAAE,IAAI,CAAC,eAAe,GAAG,SAAS,EACzC,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,GACb,SAAS,EAAE,CAUb"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { type SharedValue } from "react-native-reanimated";
|
|
2
|
+
import type { TimingConfig } from "./types";
|
|
3
|
+
/**
|
|
4
|
+
* We use makeMutable (via useState) instead of useSharedValue because
|
|
5
|
+
* useSharedValue's cleanup calls cancelAnimation, which kills in-flight
|
|
6
|
+
* animations when the component re-renders in StrictMode.
|
|
7
|
+
*/
|
|
8
|
+
interface UseSlotOpacityParams {
|
|
9
|
+
entering: boolean;
|
|
10
|
+
exiting: boolean;
|
|
11
|
+
opacityTiming: TimingConfig;
|
|
12
|
+
exitKey?: string;
|
|
13
|
+
onExitComplete?: (key: string) => void;
|
|
14
|
+
onExitingStart?: () => void;
|
|
15
|
+
}
|
|
16
|
+
export declare function useSlotOpacity({ entering, exiting, opacityTiming, exitKey, onExitComplete, onExitingStart, }: UseSlotOpacityParams): SharedValue<number>;
|
|
17
|
+
export {};
|
|
18
|
+
//# sourceMappingURL=useSlotOpacity.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useSlotOpacity.d.ts","sourceRoot":"","sources":["../../../src/core/useSlotOpacity.ts"],"names":[],"mappings":"AACA,OAAO,EAAwB,KAAK,WAAW,EAAc,MAAM,yBAAyB,CAAC;AAC7F,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAE5C;;;;GAIG;AAEH,UAAU,oBAAoB;IAC5B,QAAQ,EAAE,OAAO,CAAC;IAClB,OAAO,EAAE,OAAO,CAAC;IACjB,aAAa,EAAE,YAAY,CAAC;IAC5B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,cAAc,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IACvC,cAAc,CAAC,EAAE,MAAM,IAAI,CAAC;CAC7B;AAED,wBAAgB,cAAc,CAAC,EAC7B,QAAQ,EACR,OAAO,EACP,aAAa,EACb,OAAO,EACP,cAAc,EACd,cAAc,GACf,EAAE,oBAAoB,GAAG,WAAW,CAAC,MAAM,CAAC,CAuC5C"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { type KeyedPart } from "./types";
|
|
2
|
+
/**
|
|
3
|
+
* Converts 24h hours (0-23) to 12h display value (1-12).
|
|
4
|
+
* 0 → 12 (12 AM), 1-12 → as-is, 13-23 → subtract 12.
|
|
5
|
+
*/
|
|
6
|
+
export declare function to12Hour(h: number): number;
|
|
7
|
+
/**
|
|
8
|
+
* Builds a time display into stably-keyed character parts.
|
|
9
|
+
*
|
|
10
|
+
* Each digit position gets a fixed semantic key (h10, h1, m10, m1, s10, s1)
|
|
11
|
+
* regardless of the actual value. This ensures correct enter/exit animation
|
|
12
|
+
* behavior — e.g. when hours go from 9→10, the h10 key *enters* (fades in)
|
|
13
|
+
* rather than shifting all existing positions.
|
|
14
|
+
*/
|
|
15
|
+
export declare function formatTimeToKeyedParts(hours: number | undefined, minutes: number, seconds: number | undefined, is24Hour: boolean, padHours: boolean): KeyedPart[];
|
|
16
|
+
/**
|
|
17
|
+
* Hook that formats time values into stably-keyed character parts.
|
|
18
|
+
* Uses fixed positional keys (h10, h1, sep, m10, m1, etc.) instead of
|
|
19
|
+
* NumberFlow's RTL integer keying.
|
|
20
|
+
*/
|
|
21
|
+
export declare function useTimeFormatting(hours: number | undefined, minutes: number, seconds: number | undefined, is24Hour: boolean, padHours: boolean): KeyedPart[];
|
|
22
|
+
//# sourceMappingURL=useTimeFormatting.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useTimeFormatting.d.ts","sourceRoot":"","sources":["../../../src/core/useTimeFormatting.ts"],"names":[],"mappings":"AACA,OAAO,EAAyB,KAAK,SAAS,EAAE,MAAM,SAAS,CAAC;AAEhE;;;GAGG;AACH,wBAAgB,QAAQ,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAI1C;AAED;;;;;;;GAOG;AACH,wBAAgB,sBAAsB,CACpC,KAAK,EAAE,MAAM,GAAG,SAAS,EACzB,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,MAAM,GAAG,SAAS,EAC3B,QAAQ,EAAE,OAAO,EACjB,QAAQ,EAAE,OAAO,GAChB,SAAS,EAAE,CAiDb;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAC/B,KAAK,EAAE,MAAM,GAAG,SAAS,EACzB,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,MAAM,GAAG,SAAS,EAC3B,QAAQ,EAAE,OAAO,EACjB,QAAQ,EAAE,OAAO,GAChB,SAAS,EAAE,CAKb"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { TimingConfig } from "./types";
|
|
2
|
+
interface ResolvedTimings {
|
|
3
|
+
resolvedSpinTiming: TimingConfig;
|
|
4
|
+
resolvedOpacityTiming: TimingConfig;
|
|
5
|
+
resolvedTransformTiming: TimingConfig;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Resolves animation timing based on the `animated` prop and reduced-motion preference.
|
|
9
|
+
* When animations are disabled, all timings collapse to zero-duration.
|
|
10
|
+
*/
|
|
11
|
+
export declare function useTimingResolution(animated: boolean | undefined, respectMotionPreference: boolean | undefined, spinTiming?: TimingConfig, opacityTiming?: TimingConfig, transformTiming?: TimingConfig): ResolvedTimings;
|
|
12
|
+
export {};
|
|
13
|
+
//# sourceMappingURL=useTimingResolution.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useTimingResolution.d.ts","sourceRoot":"","sources":["../../../src/core/useTimingResolution.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAS5C,UAAU,eAAe;IACvB,kBAAkB,EAAE,YAAY,CAAC;IACjC,qBAAqB,EAAE,YAAY,CAAC;IACpC,uBAAuB,EAAE,YAAY,CAAC;CACvC;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CACjC,QAAQ,EAAE,OAAO,GAAG,SAAS,EAC7B,uBAAuB,EAAE,OAAO,GAAG,SAAS,EAC5C,UAAU,CAAC,EAAE,YAAY,EACzB,aAAa,CAAC,EAAE,YAAY,EAC5B,eAAe,CAAC,EAAE,YAAY,GAC7B,eAAe,CAqBjB"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type SharedValue } from "react-native-reanimated";
|
|
2
|
+
/**
|
|
3
|
+
* Watches a SharedValue<string> and extracts per-digit numeric values on the
|
|
4
|
+
* UI thread. Returns an array of SharedValues indexed by digit position
|
|
5
|
+
* (0 = first digit, 1 = second digit, etc.), skipping non-digit characters.
|
|
6
|
+
*
|
|
7
|
+
* This enables zero-latency digit updates during chart scrubbing — the worklet
|
|
8
|
+
* writes directly to SharedValues without crossing the JS bridge.
|
|
9
|
+
*
|
|
10
|
+
* When sharedValue is empty (e.g., scrubbing ended), all slots are set to
|
|
11
|
+
* -1, signaling DigitSlots to fall back to prop-driven animated updates.
|
|
12
|
+
*/
|
|
13
|
+
export declare function useWorkletFormatting(sharedValue: SharedValue<string> | undefined, prefix: string, suffix: string, zeroCodePoint?: number): SharedValue<number>[] | null;
|
|
14
|
+
//# sourceMappingURL=useWorkletFormatting.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useWorkletFormatting.d.ts","sourceRoot":"","sources":["../../../src/core/useWorkletFormatting.ts"],"names":[],"mappings":"AACA,OAAO,EAAe,KAAK,WAAW,EAAuB,MAAM,yBAAyB,CAAC;AAI7F;;;;;;;;;;GAUG;AACH,wBAAgB,oBAAoB,CAClC,WAAW,EAAE,WAAW,CAAC,MAAM,CAAC,GAAG,SAAS,EAC5C,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EACd,aAAa,SAAK,GACjB,WAAW,CAAC,MAAM,CAAC,EAAE,GAAG,IAAI,CAqC9B"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import type { Trend, TrendProp } from "./types";
|
|
2
|
+
/**
|
|
3
|
+
* Computes the signed modular offset for digit n relative to virtual
|
|
4
|
+
* scroll position c. Returns a value in [-half, half), where 0 means
|
|
5
|
+
* the digit is centered in the viewport.
|
|
6
|
+
*
|
|
7
|
+
* This is the Reanimated equivalent of NumberFlow's CSS:
|
|
8
|
+
* offset-raw: mod(length + n - mod(c, length), length)
|
|
9
|
+
* offset: offset-raw - length * round(down, offset-raw / (length/2), 1)
|
|
10
|
+
*/
|
|
11
|
+
export declare function signedDigitOffset(n: number, c: number, digitCount?: number): number;
|
|
12
|
+
/**
|
|
13
|
+
* Computes the roll delta for a digit transition, respecting the trend direction.
|
|
14
|
+
*
|
|
15
|
+
* For trend > 0 (always up): 8→2 = +4 (through 9,0,1,2), not -6
|
|
16
|
+
* For trend < 0 (always down): 2→8 = -6 (through 1,0,9,8), not +4
|
|
17
|
+
* For trend = 0 (auto): takes the shortest path
|
|
18
|
+
*/
|
|
19
|
+
export declare function computeRollDelta(prev: number, next: number, trend: number, digitCount?: number): number;
|
|
20
|
+
/**
|
|
21
|
+
* Resolves a TrendProp (static value or function) into a concrete Trend.
|
|
22
|
+
* When undefined, auto-detects direction from the value change.
|
|
23
|
+
*/
|
|
24
|
+
export declare function resolveTrend(trendProp: TrendProp | undefined, prevValue: number | undefined, nextValue: number | undefined): Trend;
|
|
25
|
+
/**
|
|
26
|
+
* Extracts the significance position from a digit's keyed part key.
|
|
27
|
+
* "integer:2" → 2 (hundreds), "fraction:0" → -1 (tenths).
|
|
28
|
+
* Returns undefined for non-digit keys (symbols, decimals, etc.).
|
|
29
|
+
*/
|
|
30
|
+
export declare function parseDigitPosition(key: string): number | undefined;
|
|
31
|
+
/**
|
|
32
|
+
* Correct wheel size for each time digit position.
|
|
33
|
+
* s10/m10 only go 0-5, h10 only goes 0-2.
|
|
34
|
+
*/
|
|
35
|
+
export declare const TIME_DIGIT_COUNTS: Record<string, number>;
|
|
36
|
+
/**
|
|
37
|
+
* Resolves the wheel size for a digit at a given key.
|
|
38
|
+
* Uses the `digits` prop for NumberFlow, or TIME_DIGIT_COUNTS for TimeFlow.
|
|
39
|
+
* Returns DIGIT_COUNT (10) when no constraint applies.
|
|
40
|
+
*/
|
|
41
|
+
export declare function getDigitCount(digits: Record<number, {
|
|
42
|
+
max: number;
|
|
43
|
+
}> | undefined, key: string): number;
|
|
44
|
+
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/core/utils.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEhD;;;;;;;;GAQG;AACH,wBAAgB,iBAAiB,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,UAAU,GAAE,MAAoB,GAAG,MAAM,CAOhG;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAC9B,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,MAAM,EACb,UAAU,GAAE,MAAoB,GAC/B,MAAM,CAqBR;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAC1B,SAAS,EAAE,SAAS,GAAG,SAAS,EAChC,SAAS,EAAE,MAAM,GAAG,SAAS,EAC7B,SAAS,EAAE,MAAM,GAAG,SAAS,GAC5B,KAAK,CAeP;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CA+BlE;AAED;;;GAGG;AACH,eAAO,MAAM,iBAAiB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAOpD,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,aAAa,CAC3B,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE;IAAE,GAAG,EAAE,MAAM,CAAA;CAAE,CAAC,GAAG,SAAS,EACnD,GAAG,EAAE,MAAM,GACV,MAAM,CAQR"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"warnings.d.ts","sourceRoot":"","sources":["../../../src/core/warnings.ts"],"names":[],"mappings":"AAEA,wBAAgB,QAAQ,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI,CAK3D"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { detectNumberingSystem, getDigitStrings, getZeroCodePoint } from "./core/numerals";
|
|
2
|
+
export type { TimeFlowProps } from "./core/timeTypes";
|
|
3
|
+
export type { AnimationConfig, DigitConstraint, DigitsProp, TextAlign, TimingConfig, Trend, TrendProp, } from "./core/types";
|
|
4
|
+
export { useCanAnimate } from "./core/useCanAnimate";
|
|
5
|
+
export { useFormattedValue } from "./core/useFormattedValue";
|
|
6
|
+
export { NumberFlow, TimeFlow } from "./native";
|
|
7
|
+
export type { NumberFlowProps, NumberFlowStyle } from "./native/types";
|
|
8
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAC3F,YAAY,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACtD,YAAY,EACV,eAAe,EACf,eAAe,EACf,UAAU,EACV,SAAS,EACT,YAAY,EACZ,KAAK,EACL,SAAS,GACV,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAChD,YAAY,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC"}
|