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,171 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { Group, Paint, rect, Text as SkiaText } from "@shopify/react-native-skia";
|
|
4
|
+
import React, { useMemo, useState } from "react";
|
|
5
|
+
import { makeMutable, useAnimatedReaction, useDerivedValue } from "react-native-reanimated";
|
|
6
|
+
import { DIGIT_COUNT, SUPERSCRIPT_SCALE } from "../core/constants.js";
|
|
7
|
+
import { getSuperscriptTransform } from "../core/superscript.js";
|
|
8
|
+
import { useAnimatedX } from "../core/useAnimatedX.js";
|
|
9
|
+
import { useDigitAnimation } from "../core/useDigitAnimation.js";
|
|
10
|
+
import { signedDigitOffset } from "../core/utils.js";
|
|
11
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
12
|
+
export const DigitSlot = /*#__PURE__*/React.memo(({
|
|
13
|
+
metrics,
|
|
14
|
+
digitValue,
|
|
15
|
+
targetX,
|
|
16
|
+
charWidth,
|
|
17
|
+
baseY,
|
|
18
|
+
color,
|
|
19
|
+
font,
|
|
20
|
+
spinTiming,
|
|
21
|
+
opacityTiming,
|
|
22
|
+
transformTiming,
|
|
23
|
+
trend,
|
|
24
|
+
entering,
|
|
25
|
+
exiting,
|
|
26
|
+
exitKey,
|
|
27
|
+
onExitComplete,
|
|
28
|
+
workletDigitValue,
|
|
29
|
+
workletLayout,
|
|
30
|
+
slotIndex,
|
|
31
|
+
digitCount,
|
|
32
|
+
continuousSpinGeneration,
|
|
33
|
+
maskTop = 0,
|
|
34
|
+
maskBottom = 0,
|
|
35
|
+
superscript,
|
|
36
|
+
digitStrings
|
|
37
|
+
}) => {
|
|
38
|
+
const resolvedDigitCount = digitCount ?? DIGIT_COUNT;
|
|
39
|
+
const resolvedDigitStrings = digitStrings ?? Array.from({
|
|
40
|
+
length: resolvedDigitCount
|
|
41
|
+
}, (_, i) => String(i));
|
|
42
|
+
const {
|
|
43
|
+
initialDigit,
|
|
44
|
+
animDelta,
|
|
45
|
+
currentDigitSV,
|
|
46
|
+
slotOpacity
|
|
47
|
+
} = useDigitAnimation({
|
|
48
|
+
digitValue,
|
|
49
|
+
entering,
|
|
50
|
+
exiting,
|
|
51
|
+
trend,
|
|
52
|
+
spinTiming,
|
|
53
|
+
opacityTiming,
|
|
54
|
+
exitKey,
|
|
55
|
+
onExitComplete,
|
|
56
|
+
workletDigitValue,
|
|
57
|
+
digitCount: resolvedDigitCount,
|
|
58
|
+
continuousSpinGeneration
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Per-digit Y transforms: each digit independently positions itself
|
|
63
|
+
* based on its signed modular distance from the virtual scroll position.
|
|
64
|
+
* Initialized with correct positions so the first frame is accurate.
|
|
65
|
+
*/
|
|
66
|
+
const [digitYTransforms] = useState(() => {
|
|
67
|
+
const lh = metrics.lineHeight;
|
|
68
|
+
return Array.from({
|
|
69
|
+
length: resolvedDigitCount
|
|
70
|
+
}, (_, n) => {
|
|
71
|
+
const offset = signedDigitOffset(n, initialDigit, resolvedDigitCount);
|
|
72
|
+
const clamped = Math.max(-1.5, Math.min(1.5, offset));
|
|
73
|
+
return makeMutable([{
|
|
74
|
+
translateY: clamped * lh
|
|
75
|
+
}]);
|
|
76
|
+
});
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* Mirrors NumberFlow's CSS mod(): each digit n computes its signed
|
|
81
|
+
* offset from virtual position c, clamped to [-1.5, 1.5].
|
|
82
|
+
* Only the current digit (offset ≈ 0) and its neighbors (offset ≈ ±1)
|
|
83
|
+
* are visible through the clip window. All others park just outside.
|
|
84
|
+
* Runs every frame via Reanimated's mapper system (animDelta changes →
|
|
85
|
+
* marks mapper dirty → microtask recalculates).
|
|
86
|
+
*/
|
|
87
|
+
useAnimatedReaction(() => currentDigitSV.value - animDelta.value, c => {
|
|
88
|
+
const lh = metrics.lineHeight;
|
|
89
|
+
for (let n = 0; n < resolvedDigitCount; n++) {
|
|
90
|
+
const offset = signedDigitOffset(n, c, resolvedDigitCount);
|
|
91
|
+
const clamped = Math.max(-1.5, Math.min(1.5, offset));
|
|
92
|
+
digitYTransforms[n].value = [{
|
|
93
|
+
translateY: clamped * lh
|
|
94
|
+
}];
|
|
95
|
+
}
|
|
96
|
+
}, [metrics.lineHeight, resolvedDigitCount]);
|
|
97
|
+
const animatedX = useAnimatedX(targetX, exiting, transformTiming);
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* Group transform absorbs clipX (centering offset within slot width).
|
|
101
|
+
* This makes clipRect and digitXOffsets static (font-metric only).
|
|
102
|
+
* For superscript slots the visual clip is scaled, so cx accounts for that.
|
|
103
|
+
*/
|
|
104
|
+
const visualClipWidth = superscript ? metrics.maxDigitWidth * SUPERSCRIPT_SCALE : metrics.maxDigitWidth;
|
|
105
|
+
const groupTransform = useDerivedValue(() => {
|
|
106
|
+
const wl = workletLayout?.value;
|
|
107
|
+
if (wl && slotIndex !== undefined && slotIndex < wl.length) {
|
|
108
|
+
const slotWidth = wl[slotIndex].width;
|
|
109
|
+
const cx = slotWidth / 2 - visualClipWidth / 2;
|
|
110
|
+
return [{
|
|
111
|
+
translateX: wl[slotIndex].x + cx
|
|
112
|
+
}];
|
|
113
|
+
}
|
|
114
|
+
const cx = charWidth / 2 - visualClipWidth / 2;
|
|
115
|
+
return [{
|
|
116
|
+
translateX: animatedX.value + cx
|
|
117
|
+
}];
|
|
118
|
+
});
|
|
119
|
+
|
|
120
|
+
// Digit centering within the maxDigitWidth clip (font-metric only, static)
|
|
121
|
+
const digitXOffsets = useMemo(() => {
|
|
122
|
+
const offsets = [];
|
|
123
|
+
for (let d = 0; d < resolvedDigitCount; d++) {
|
|
124
|
+
const w = metrics.charWidths[resolvedDigitStrings[d]] ?? metrics.maxDigitWidth;
|
|
125
|
+
offsets.push((metrics.maxDigitWidth - w) / 2);
|
|
126
|
+
}
|
|
127
|
+
return offsets;
|
|
128
|
+
}, [metrics, resolvedDigitCount, resolvedDigitStrings]);
|
|
129
|
+
|
|
130
|
+
// Superscript digits use a tight clip (no mask buffer) — the container-level
|
|
131
|
+
// gradient doesn't cover the superscript position, so buffer would leak neighbors.
|
|
132
|
+
const effectiveMaskTop = superscript ? 0 : maskTop;
|
|
133
|
+
const effectiveMaskBottom = superscript ? 0 : maskBottom;
|
|
134
|
+
const clipRect = useMemo(() => rect(0, baseY + metrics.ascent - effectiveMaskTop, metrics.maxDigitWidth, metrics.lineHeight + effectiveMaskTop + effectiveMaskBottom), [baseY, metrics, effectiveMaskTop, effectiveMaskBottom]);
|
|
135
|
+
const opacityPaint = useMemo(() => /*#__PURE__*/_jsx(Paint, {
|
|
136
|
+
opacity: slotOpacity
|
|
137
|
+
}), [slotOpacity]);
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* Each digit gets its own Group transform driven by the position
|
|
141
|
+
* reaction. Only 10 elements needed (vs 30 with the copy approach).
|
|
142
|
+
* useMemo creates stable JSX — shared values drive the animation.
|
|
143
|
+
*/
|
|
144
|
+
const digitElements = useMemo(() => Array.from({
|
|
145
|
+
length: resolvedDigitCount
|
|
146
|
+
}, (_, n) => /*#__PURE__*/_jsx(Group, {
|
|
147
|
+
transform: digitYTransforms[n],
|
|
148
|
+
children: /*#__PURE__*/_jsx(SkiaText, {
|
|
149
|
+
color: color,
|
|
150
|
+
font: font,
|
|
151
|
+
text: resolvedDigitStrings[n],
|
|
152
|
+
x: digitXOffsets[n],
|
|
153
|
+
y: baseY
|
|
154
|
+
})
|
|
155
|
+
}, n)), [resolvedDigitCount, resolvedDigitStrings, baseY, color, font, digitXOffsets, digitYTransforms]);
|
|
156
|
+
const superscriptTransform = useMemo(() => superscript ? getSuperscriptTransform(baseY, metrics.ascent) : undefined, [superscript, baseY, metrics]);
|
|
157
|
+
const clipContent = /*#__PURE__*/_jsx(Group, {
|
|
158
|
+
clip: clipRect,
|
|
159
|
+
children: digitElements
|
|
160
|
+
});
|
|
161
|
+
return /*#__PURE__*/_jsx(Group, {
|
|
162
|
+
layer: opacityPaint,
|
|
163
|
+
transform: groupTransform,
|
|
164
|
+
children: superscriptTransform ? /*#__PURE__*/_jsx(Group, {
|
|
165
|
+
transform: superscriptTransform,
|
|
166
|
+
children: clipContent
|
|
167
|
+
}) : clipContent
|
|
168
|
+
});
|
|
169
|
+
});
|
|
170
|
+
DigitSlot.displayName = "DigitSlot";
|
|
171
|
+
//# sourceMappingURL=DigitSlot.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["Group","Paint","rect","Text","SkiaText","React","useMemo","useState","makeMutable","useAnimatedReaction","useDerivedValue","DIGIT_COUNT","SUPERSCRIPT_SCALE","getSuperscriptTransform","useAnimatedX","useDigitAnimation","signedDigitOffset","jsx","_jsx","DigitSlot","memo","metrics","digitValue","targetX","charWidth","baseY","color","font","spinTiming","opacityTiming","transformTiming","trend","entering","exiting","exitKey","onExitComplete","workletDigitValue","workletLayout","slotIndex","digitCount","continuousSpinGeneration","maskTop","maskBottom","superscript","digitStrings","resolvedDigitCount","resolvedDigitStrings","Array","from","length","_","i","String","initialDigit","animDelta","currentDigitSV","slotOpacity","digitYTransforms","lh","lineHeight","n","offset","clamped","Math","max","min","translateY","value","c","animatedX","visualClipWidth","maxDigitWidth","groupTransform","wl","undefined","slotWidth","width","cx","translateX","x","digitXOffsets","offsets","d","w","charWidths","push","effectiveMaskTop","effectiveMaskBottom","clipRect","ascent","opacityPaint","opacity","digitElements","transform","children","text","y","superscriptTransform","clipContent","clip","layer","displayName"],"sourceRoot":"../../../src","sources":["skia/DigitSlot.tsx"],"mappings":";;AAAA,SAASA,KAAK,EAAEC,KAAK,EAAEC,IAAI,EAAEC,IAAI,IAAIC,QAAQ,QAAQ,4BAA4B;AACjF,OAAOC,KAAK,IAAIC,OAAO,EAAEC,QAAQ,QAAQ,OAAO;AAChD,SACEC,WAAW,EAEXC,mBAAmB,EACnBC,eAAe,QACV,yBAAyB;AAChC,SAASC,WAAW,EAAEC,iBAAiB,QAAQ,sBAAmB;AAClE,SAASC,uBAAuB,QAAQ,wBAAqB;AAE7D,SAASC,YAAY,QAAQ,yBAAsB;AACnD,SAASC,iBAAiB,QAAQ,8BAA2B;AAC7D,SAASC,iBAAiB,QAAQ,kBAAe;AAAC,SAAAC,GAAA,IAAAC,IAAA;AA6BlD,OAAO,MAAMC,SAAS,gBAAGd,KAAK,CAACe,IAAI,CACjC,CAAC;EACCC,OAAO;EACPC,UAAU;EACVC,OAAO;EACPC,SAAS;EACTC,KAAK;EACLC,KAAK;EACLC,IAAI;EACJC,UAAU;EACVC,aAAa;EACbC,eAAe;EACfC,KAAK;EACLC,QAAQ;EACRC,OAAO;EACPC,OAAO;EACPC,cAAc;EACdC,iBAAiB;EACjBC,aAAa;EACbC,SAAS;EACTC,UAAU;EACVC,wBAAwB;EACxBC,OAAO,GAAG,CAAC;EACXC,UAAU,GAAG,CAAC;EACdC,WAAW;EACXC;AACc,CAAC,KAAK;EACpB,MAAMC,kBAAkB,GAAGN,UAAU,IAAI5B,WAAW;EACpD,MAAMmC,oBAAoB,GACxBF,YAAY,IAAIG,KAAK,CAACC,IAAI,CAAC;IAAEC,MAAM,EAAEJ;EAAmB,CAAC,EAAE,CAACK,CAAC,EAAEC,CAAC,KAAK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E;IAAAkC,QAAA,eAC5C5E,IAAA,CAACd,QAAQ;MACPsB,KAAK,EAAEA,KAAM;MACbC,IAAI,EAAEA,IAAK;MACXoE,IAAI,EAAEjD,oBAAoB,CAACc,CAAC,CAAE;MAC9BmB,CAAC,EAAEC,aAAa,CAACpB,CAAC,CAAE;MACpBoC,CAAC,EAAEvE;IAAM,CACV;EAAC,GAPQmC,CAQL,CACR,CAAC,EACJ,CACEf,kBAAkB,EAClBC,oBAAoB,EACpBrB,KAAK,EACLC,KAAK,EACLC,IAAI,EACJqD,aAAa,EACbvB,gBAAgB,CAEpB,CAAC;EAED,MAAMwC,oBAAoB,GAAG3F,OAAO,CAClC,MAAOqC,WAAW,GAAG9B,uBAAuB,CAACY,KAAK,EAAEJ,OAAO,CAACoE,MAAM,CAAC,GAAGf,SAAU,EAChF,CAAC/B,WAAW,EAAElB,KAAK,EAAEJ,OAAO,CAC9B,CAAC;EAED,MAAM6E,WAAW,gBAAGhF,IAAA,CAAClB,KAAK;IAACmG,IAAI,EAAEX,QAAS;IAAAM,QAAA,EAAEF;EAAa,CAAQ,CAAC;EAElE,oBACE1E,IAAA,CAAClB,KAAK;IAACoG,KAAK,EAAEV,YAAa;IAACG,SAAS,EAAErB,cAAe;IAAAsB,QAAA,EACnDG,oBAAoB,gBACnB/E,IAAA,CAAClB,KAAK;MAAC6F,SAAS,EAAEI,oBAAqB;MAAAH,QAAA,EAAEI;IAAW,CAAQ,CAAC,GAE7DA;EACD,CACI,CAAC;AAEZ,CACF,CAAC;AAED/E,SAAS,CAACkF,WAAW,GAAG,WAAW","ignoreList":[]}
|
|
@@ -0,0 +1,430 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { Group, LinearGradient, Paint, Rect as SkiaRect, vec } from "@shopify/react-native-skia";
|
|
4
|
+
import { useMemo } from "react";
|
|
5
|
+
import { MASK_WIDTH_RATIO } from "../core/constants.js";
|
|
6
|
+
import { computeKeyedLayout, computeStringLayout } from "../core/layout.js";
|
|
7
|
+
import { detectNumberingSystem, getDigitStrings, getZeroCodePoint } from "../core/numerals/index.js";
|
|
8
|
+
import { useAccessibilityAnnouncement } from "../core/useAccessibilityAnnouncement.js";
|
|
9
|
+
import { useFlowPipeline } from "../core/useFlowPipeline.js";
|
|
10
|
+
import { getFormatCharacters } from "../core/intlHelpers.js";
|
|
11
|
+
import { useNumberFormatting } from "../core/useNumberFormatting.js";
|
|
12
|
+
import { getDigitCount } from "../core/utils.js";
|
|
13
|
+
import { warnOnce } from "../core/warnings.js";
|
|
14
|
+
import { renderSlots } from "./renderSlots.js";
|
|
15
|
+
import { useGlyphMetrics } from "./useGlyphMetrics.js";
|
|
16
|
+
import { useScrubbingBridge, useScrubbingLayout } from "./useScrubbing.js";
|
|
17
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
18
|
+
function SkiaNumberFlowRuntime({
|
|
19
|
+
keyedParts,
|
|
20
|
+
trendValue,
|
|
21
|
+
layout,
|
|
22
|
+
metrics,
|
|
23
|
+
font,
|
|
24
|
+
color,
|
|
25
|
+
x,
|
|
26
|
+
y,
|
|
27
|
+
opacity,
|
|
28
|
+
spinTiming,
|
|
29
|
+
opacityTiming,
|
|
30
|
+
transformTiming,
|
|
31
|
+
trend,
|
|
32
|
+
animated,
|
|
33
|
+
respectMotionPreference,
|
|
34
|
+
continuous,
|
|
35
|
+
digits,
|
|
36
|
+
onAnimationsStart,
|
|
37
|
+
onAnimationsFinish,
|
|
38
|
+
mask,
|
|
39
|
+
digitStringsArr,
|
|
40
|
+
workletDigitValues,
|
|
41
|
+
workletLayout
|
|
42
|
+
}) {
|
|
43
|
+
const {
|
|
44
|
+
resolvedSpinTiming,
|
|
45
|
+
resolvedOpacityTiming,
|
|
46
|
+
resolvedTransformTiming,
|
|
47
|
+
resolvedTrend,
|
|
48
|
+
spinGenerations,
|
|
49
|
+
prevMap,
|
|
50
|
+
isInitialRender,
|
|
51
|
+
exitingEntries,
|
|
52
|
+
onExitComplete,
|
|
53
|
+
accessibilityLabel,
|
|
54
|
+
adaptiveMask
|
|
55
|
+
} = useFlowPipeline({
|
|
56
|
+
keyedParts,
|
|
57
|
+
trendValue,
|
|
58
|
+
layout,
|
|
59
|
+
metrics,
|
|
60
|
+
animated,
|
|
61
|
+
respectMotionPreference,
|
|
62
|
+
spinTiming,
|
|
63
|
+
opacityTiming,
|
|
64
|
+
transformTiming,
|
|
65
|
+
trend,
|
|
66
|
+
continuous,
|
|
67
|
+
mask,
|
|
68
|
+
onAnimationsStart,
|
|
69
|
+
onAnimationsFinish
|
|
70
|
+
});
|
|
71
|
+
useAccessibilityAnnouncement(accessibilityLabel);
|
|
72
|
+
if (layout.length === 0 && exitingEntries.size === 0) {
|
|
73
|
+
return /*#__PURE__*/_jsx(Group, {});
|
|
74
|
+
}
|
|
75
|
+
const baseY = y;
|
|
76
|
+
const resolvedMask = mask ?? true;
|
|
77
|
+
const maskTopHeight = resolvedMask ? adaptiveMask.top : 0;
|
|
78
|
+
const maskBottomHeight = resolvedMask ? adaptiveMask.bottom : 0;
|
|
79
|
+
const maskWidth = resolvedMask ? MASK_WIDTH_RATIO * metrics.lineHeight : 0;
|
|
80
|
+
|
|
81
|
+
// Content bounds in the content group's local coordinate space
|
|
82
|
+
const contentLeft = layout.reduce((min, entry) => Math.min(min, entry.x), Infinity);
|
|
83
|
+
const contentRight = layout.reduce((max, entry) => Math.max(max, entry.x + entry.width), 0);
|
|
84
|
+
const contentWidth = layout.length > 0 ? contentRight - contentLeft : 0;
|
|
85
|
+
const content = /*#__PURE__*/_jsx(Group, {
|
|
86
|
+
transform: [{
|
|
87
|
+
translateX: x
|
|
88
|
+
}],
|
|
89
|
+
children: renderSlots({
|
|
90
|
+
layout,
|
|
91
|
+
exitingEntries,
|
|
92
|
+
prevMap,
|
|
93
|
+
isInitialRender,
|
|
94
|
+
onExitComplete,
|
|
95
|
+
metrics,
|
|
96
|
+
font,
|
|
97
|
+
color,
|
|
98
|
+
baseY,
|
|
99
|
+
resolvedTrend,
|
|
100
|
+
spinTiming: resolvedSpinTiming,
|
|
101
|
+
opacityTiming: resolvedOpacityTiming,
|
|
102
|
+
transformTiming: resolvedTransformTiming,
|
|
103
|
+
spinGenerations,
|
|
104
|
+
digitCountResolver: key => getDigitCount(digits, key),
|
|
105
|
+
maskTop: maskTopHeight,
|
|
106
|
+
maskBottom: maskBottomHeight,
|
|
107
|
+
digitStrings: digitStringsArr,
|
|
108
|
+
workletDigitValues,
|
|
109
|
+
workletLayout
|
|
110
|
+
})
|
|
111
|
+
});
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* Container-level 2D gradient mask matching web NumberFlow's vignette.
|
|
115
|
+
* Two DstIn-blended rects compose independent horizontal and vertical fades:
|
|
116
|
+
* final_alpha = content_alpha * horizontal_alpha * vertical_alpha.
|
|
117
|
+
* This produces smooth corners naturally (alpha multiplication).
|
|
118
|
+
*
|
|
119
|
+
* Architecture: content draws into a saveLayer, then each gradient rect
|
|
120
|
+
* composites with DstIn (result = existing_content * gradient_alpha).
|
|
121
|
+
*/
|
|
122
|
+
// Horizontal: fade extends OUTSIDE text edges (for enter/exit animations)
|
|
123
|
+
// Vertical: fade is WITHIN the text line height (digits roll through it)
|
|
124
|
+
const maskLeft = x + contentLeft - maskWidth;
|
|
125
|
+
const maskRight = x + contentRight + maskWidth;
|
|
126
|
+
const maskY = baseY + metrics.ascent;
|
|
127
|
+
const maskTotalWidth = contentWidth + 2 * maskWidth;
|
|
128
|
+
const maskTotalHeight = metrics.lineHeight;
|
|
129
|
+
const hRatio = maskTotalWidth > 0 ? maskWidth / maskTotalWidth : 0;
|
|
130
|
+
const vRatioTop = maskTotalHeight > 0 ? maskTopHeight / maskTotalHeight : 0;
|
|
131
|
+
const vRatioBottom = maskTotalHeight > 0 ? maskBottomHeight / maskTotalHeight : 0;
|
|
132
|
+
const maskedContent = resolvedMask ? /*#__PURE__*/_jsxs(Group, {
|
|
133
|
+
layer: /*#__PURE__*/_jsx(Paint, {}),
|
|
134
|
+
children: [content, /*#__PURE__*/_jsx(Group, {
|
|
135
|
+
layer: /*#__PURE__*/_jsx(Paint, {
|
|
136
|
+
blendMode: "dstIn"
|
|
137
|
+
}),
|
|
138
|
+
children: /*#__PURE__*/_jsx(SkiaRect, {
|
|
139
|
+
height: maskTotalHeight,
|
|
140
|
+
width: maskTotalWidth,
|
|
141
|
+
x: maskLeft,
|
|
142
|
+
y: maskY,
|
|
143
|
+
children: /*#__PURE__*/_jsx(LinearGradient, {
|
|
144
|
+
colors: ["transparent", "black", "black", "transparent"],
|
|
145
|
+
end: vec(maskRight, 0),
|
|
146
|
+
positions: [0, hRatio, 1 - hRatio, 1],
|
|
147
|
+
start: vec(maskLeft, 0)
|
|
148
|
+
})
|
|
149
|
+
})
|
|
150
|
+
}), /*#__PURE__*/_jsx(Group, {
|
|
151
|
+
layer: /*#__PURE__*/_jsx(Paint, {
|
|
152
|
+
blendMode: "dstIn"
|
|
153
|
+
}),
|
|
154
|
+
children: /*#__PURE__*/_jsx(SkiaRect, {
|
|
155
|
+
height: maskTotalHeight,
|
|
156
|
+
width: maskTotalWidth,
|
|
157
|
+
x: maskLeft,
|
|
158
|
+
y: maskY,
|
|
159
|
+
children: /*#__PURE__*/_jsx(LinearGradient, {
|
|
160
|
+
colors: ["transparent", "black", "black", "transparent"],
|
|
161
|
+
end: vec(0, maskY + maskTotalHeight),
|
|
162
|
+
positions: [0, vRatioTop, 1 - vRatioBottom, 1],
|
|
163
|
+
start: vec(0, maskY)
|
|
164
|
+
})
|
|
165
|
+
})
|
|
166
|
+
})]
|
|
167
|
+
}) : content;
|
|
168
|
+
if (opacity) {
|
|
169
|
+
return /*#__PURE__*/_jsx(Group, {
|
|
170
|
+
layer: /*#__PURE__*/_jsx(Paint, {
|
|
171
|
+
opacity: opacity
|
|
172
|
+
}),
|
|
173
|
+
children: maskedContent
|
|
174
|
+
});
|
|
175
|
+
}
|
|
176
|
+
return maskedContent;
|
|
177
|
+
}
|
|
178
|
+
function SkiaNumberFlowValueMode({
|
|
179
|
+
value,
|
|
180
|
+
format,
|
|
181
|
+
locales,
|
|
182
|
+
font,
|
|
183
|
+
color,
|
|
184
|
+
x,
|
|
185
|
+
y,
|
|
186
|
+
width,
|
|
187
|
+
textAlign,
|
|
188
|
+
prefix,
|
|
189
|
+
suffix,
|
|
190
|
+
opacity,
|
|
191
|
+
spinTiming,
|
|
192
|
+
opacityTiming,
|
|
193
|
+
transformTiming,
|
|
194
|
+
trend,
|
|
195
|
+
animated,
|
|
196
|
+
respectMotionPreference,
|
|
197
|
+
continuous,
|
|
198
|
+
digits,
|
|
199
|
+
onAnimationsStart,
|
|
200
|
+
onAnimationsFinish,
|
|
201
|
+
mask,
|
|
202
|
+
metrics,
|
|
203
|
+
digitStringsArr
|
|
204
|
+
}) {
|
|
205
|
+
const keyedParts = useNumberFormatting(value, format, locales, prefix, suffix);
|
|
206
|
+
const layout = useMemo(() => {
|
|
207
|
+
if (keyedParts.length === 0) return [];
|
|
208
|
+
return computeKeyedLayout(keyedParts, metrics, width, textAlign, digitStringsArr);
|
|
209
|
+
}, [keyedParts, metrics, width, textAlign, digitStringsArr]);
|
|
210
|
+
return /*#__PURE__*/_jsx(SkiaNumberFlowRuntime, {
|
|
211
|
+
animated: animated,
|
|
212
|
+
color: color,
|
|
213
|
+
continuous: continuous,
|
|
214
|
+
digitStringsArr: digitStringsArr,
|
|
215
|
+
digits: digits,
|
|
216
|
+
font: font,
|
|
217
|
+
keyedParts: keyedParts,
|
|
218
|
+
layout: layout,
|
|
219
|
+
mask: mask,
|
|
220
|
+
metrics: metrics,
|
|
221
|
+
onAnimationsFinish: onAnimationsFinish,
|
|
222
|
+
onAnimationsStart: onAnimationsStart,
|
|
223
|
+
opacity: opacity,
|
|
224
|
+
opacityTiming: opacityTiming,
|
|
225
|
+
respectMotionPreference: respectMotionPreference,
|
|
226
|
+
spinTiming: spinTiming,
|
|
227
|
+
transformTiming: transformTiming,
|
|
228
|
+
trend: trend,
|
|
229
|
+
trendValue: value,
|
|
230
|
+
x: x,
|
|
231
|
+
y: y
|
|
232
|
+
});
|
|
233
|
+
}
|
|
234
|
+
function SkiaNumberFlowSharedMode({
|
|
235
|
+
sharedValue,
|
|
236
|
+
format,
|
|
237
|
+
locales,
|
|
238
|
+
font,
|
|
239
|
+
color,
|
|
240
|
+
x,
|
|
241
|
+
y,
|
|
242
|
+
width,
|
|
243
|
+
textAlign,
|
|
244
|
+
prefix,
|
|
245
|
+
suffix,
|
|
246
|
+
opacity,
|
|
247
|
+
spinTiming,
|
|
248
|
+
opacityTiming,
|
|
249
|
+
transformTiming,
|
|
250
|
+
trend,
|
|
251
|
+
animated,
|
|
252
|
+
respectMotionPreference,
|
|
253
|
+
continuous,
|
|
254
|
+
digits,
|
|
255
|
+
scrubDigitWidthPercentile,
|
|
256
|
+
onAnimationsStart,
|
|
257
|
+
onAnimationsFinish,
|
|
258
|
+
mask,
|
|
259
|
+
metrics,
|
|
260
|
+
digitStringsArr,
|
|
261
|
+
zeroCodePoint
|
|
262
|
+
}) {
|
|
263
|
+
// Scrubbing bridge: digit-count bridging between worklet and JS thread
|
|
264
|
+
const {
|
|
265
|
+
effectiveValue
|
|
266
|
+
} = useScrubbingBridge({
|
|
267
|
+
sharedValue,
|
|
268
|
+
value: undefined,
|
|
269
|
+
prefix,
|
|
270
|
+
suffix,
|
|
271
|
+
zeroCodePoint
|
|
272
|
+
});
|
|
273
|
+
const keyedParts = useNumberFormatting(effectiveValue, format, locales, prefix, suffix);
|
|
274
|
+
const layout = useMemo(() => {
|
|
275
|
+
const text = `${prefix}${sharedValue.value}${suffix}`;
|
|
276
|
+
return computeStringLayout(text, metrics, width, textAlign);
|
|
277
|
+
}, [metrics, width, textAlign, prefix, suffix, sharedValue]);
|
|
278
|
+
const layoutDigitCount = useMemo(() => {
|
|
279
|
+
let count = 0;
|
|
280
|
+
for (let i = 0; i < layout.length; i++) {
|
|
281
|
+
if (layout[i].isDigit) count++;
|
|
282
|
+
}
|
|
283
|
+
return count;
|
|
284
|
+
}, [layout]);
|
|
285
|
+
|
|
286
|
+
// Scrubbing layout: worklet-driven digit values and per-slot positioning
|
|
287
|
+
const {
|
|
288
|
+
workletDigitValues,
|
|
289
|
+
workletLayout
|
|
290
|
+
} = useScrubbingLayout({
|
|
291
|
+
sharedValue,
|
|
292
|
+
prefix,
|
|
293
|
+
suffix,
|
|
294
|
+
zeroCodePoint,
|
|
295
|
+
metrics,
|
|
296
|
+
digitStringsArr,
|
|
297
|
+
scrubDigitWidthPercentile,
|
|
298
|
+
layout,
|
|
299
|
+
layoutDigitCount,
|
|
300
|
+
width,
|
|
301
|
+
textAlign
|
|
302
|
+
});
|
|
303
|
+
return /*#__PURE__*/_jsx(SkiaNumberFlowRuntime, {
|
|
304
|
+
animated: animated,
|
|
305
|
+
color: color,
|
|
306
|
+
continuous: continuous,
|
|
307
|
+
digitStringsArr: digitStringsArr,
|
|
308
|
+
digits: digits,
|
|
309
|
+
font: font,
|
|
310
|
+
keyedParts: keyedParts,
|
|
311
|
+
layout: layout,
|
|
312
|
+
mask: mask,
|
|
313
|
+
metrics: metrics,
|
|
314
|
+
onAnimationsFinish: onAnimationsFinish,
|
|
315
|
+
onAnimationsStart: onAnimationsStart,
|
|
316
|
+
opacity: opacity,
|
|
317
|
+
opacityTiming: opacityTiming,
|
|
318
|
+
respectMotionPreference: respectMotionPreference,
|
|
319
|
+
spinTiming: spinTiming,
|
|
320
|
+
transformTiming: transformTiming,
|
|
321
|
+
trend: trend,
|
|
322
|
+
trendValue: undefined,
|
|
323
|
+
workletDigitValues: workletDigitValues,
|
|
324
|
+
workletLayout: workletLayout,
|
|
325
|
+
x: x,
|
|
326
|
+
y: y
|
|
327
|
+
});
|
|
328
|
+
}
|
|
329
|
+
export const SkiaNumberFlow = ({
|
|
330
|
+
value,
|
|
331
|
+
format,
|
|
332
|
+
locales,
|
|
333
|
+
sharedValue,
|
|
334
|
+
font,
|
|
335
|
+
color = "#000000",
|
|
336
|
+
x = 0,
|
|
337
|
+
y = 0,
|
|
338
|
+
width = 0,
|
|
339
|
+
textAlign = "left",
|
|
340
|
+
prefix = "",
|
|
341
|
+
suffix = "",
|
|
342
|
+
opacity,
|
|
343
|
+
spinTiming,
|
|
344
|
+
opacityTiming,
|
|
345
|
+
transformTiming,
|
|
346
|
+
trend,
|
|
347
|
+
animated,
|
|
348
|
+
respectMotionPreference,
|
|
349
|
+
continuous,
|
|
350
|
+
digits,
|
|
351
|
+
scrubDigitWidthPercentile = 0.75,
|
|
352
|
+
onAnimationsStart,
|
|
353
|
+
onAnimationsFinish,
|
|
354
|
+
mask
|
|
355
|
+
}) => {
|
|
356
|
+
const formatChars = useMemo(() => getFormatCharacters(locales, format, prefix, suffix), [locales, format, prefix, suffix]);
|
|
357
|
+
const numberingSystem = useMemo(() => detectNumberingSystem(locales, format), [locales, format]);
|
|
358
|
+
const zeroCodePoint = getZeroCodePoint(numberingSystem);
|
|
359
|
+
const digitStringsArr = useMemo(() => getDigitStrings(numberingSystem), [numberingSystem]);
|
|
360
|
+
const metrics = useGlyphMetrics(font, formatChars, digitStringsArr);
|
|
361
|
+
if (__DEV__) {
|
|
362
|
+
if (!font) {
|
|
363
|
+
warnOnce("skia-font", "font is null — pass a loaded SkFont from useFont(). Component renders empty until font loads.");
|
|
364
|
+
}
|
|
365
|
+
if (value !== undefined && sharedValue !== undefined) {
|
|
366
|
+
warnOnce("skia-nf-both", "Both value and sharedValue provided. Use one or the other.");
|
|
367
|
+
}
|
|
368
|
+
if (value === undefined && sharedValue === undefined) {
|
|
369
|
+
warnOnce("skia-nf-neither", "Neither value nor sharedValue provided.");
|
|
370
|
+
}
|
|
371
|
+
if (scrubDigitWidthPercentile < 0 || scrubDigitWidthPercentile > 1) {
|
|
372
|
+
warnOnce("nf-percentile", "scrubDigitWidthPercentile should be between 0 and 1.");
|
|
373
|
+
}
|
|
374
|
+
if (digits) {
|
|
375
|
+
for (const [posStr, constraint] of Object.entries(digits)) {
|
|
376
|
+
if (constraint.max < 1 || constraint.max > 9) {
|
|
377
|
+
warnOnce(`skia-nf-digit-max-${posStr}`, `digits[${posStr}].max must be between 1 and 9, got ${constraint.max}.`);
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
}
|
|
381
|
+
}
|
|
382
|
+
const clampedPercentile = Math.max(0, Math.min(1, scrubDigitWidthPercentile));
|
|
383
|
+
if (!font || !metrics) {
|
|
384
|
+
return /*#__PURE__*/_jsx(Group, {});
|
|
385
|
+
}
|
|
386
|
+
const baseProps = {
|
|
387
|
+
format,
|
|
388
|
+
locales,
|
|
389
|
+
font,
|
|
390
|
+
color,
|
|
391
|
+
x,
|
|
392
|
+
y,
|
|
393
|
+
width,
|
|
394
|
+
textAlign,
|
|
395
|
+
prefix,
|
|
396
|
+
suffix,
|
|
397
|
+
opacity,
|
|
398
|
+
spinTiming,
|
|
399
|
+
opacityTiming,
|
|
400
|
+
transformTiming,
|
|
401
|
+
trend,
|
|
402
|
+
animated,
|
|
403
|
+
respectMotionPreference,
|
|
404
|
+
continuous,
|
|
405
|
+
digits,
|
|
406
|
+
scrubDigitWidthPercentile: clampedPercentile,
|
|
407
|
+
onAnimationsStart,
|
|
408
|
+
onAnimationsFinish,
|
|
409
|
+
mask,
|
|
410
|
+
metrics,
|
|
411
|
+
digitStringsArr,
|
|
412
|
+
zeroCodePoint
|
|
413
|
+
};
|
|
414
|
+
|
|
415
|
+
// Shared-value mode mounts scrubbing hooks; value mode avoids them entirely.
|
|
416
|
+
if (sharedValue !== undefined && value === undefined) {
|
|
417
|
+
return /*#__PURE__*/_jsx(SkiaNumberFlowSharedMode, {
|
|
418
|
+
...baseProps,
|
|
419
|
+
sharedValue: sharedValue
|
|
420
|
+
});
|
|
421
|
+
}
|
|
422
|
+
if (value === undefined) {
|
|
423
|
+
return /*#__PURE__*/_jsx(Group, {});
|
|
424
|
+
}
|
|
425
|
+
return /*#__PURE__*/_jsx(SkiaNumberFlowValueMode, {
|
|
426
|
+
...baseProps,
|
|
427
|
+
value: value
|
|
428
|
+
});
|
|
429
|
+
};
|
|
430
|
+
//# sourceMappingURL=SkiaNumberFlow.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["Group","LinearGradient","Paint","Rect","SkiaRect","vec","useMemo","MASK_WIDTH_RATIO","computeKeyedLayout","computeStringLayout","detectNumberingSystem","getDigitStrings","getZeroCodePoint","useAccessibilityAnnouncement","useFlowPipeline","getFormatCharacters","useNumberFormatting","getDigitCount","warnOnce","renderSlots","useGlyphMetrics","useScrubbingBridge","useScrubbingLayout","jsx","_jsx","jsxs","_jsxs","SkiaNumberFlowRuntime","keyedParts","trendValue","layout","metrics","font","color","x","y","opacity","spinTiming","opacityTiming","transformTiming","trend","animated","respectMotionPreference","continuous","digits","onAnimationsStart","onAnimationsFinish","mask","digitStringsArr","workletDigitValues","workletLayout","resolvedSpinTiming","resolvedOpacityTiming","resolvedTransformTiming","resolvedTrend","spinGenerations","prevMap","isInitialRender","exitingEntries","onExitComplete","accessibilityLabel","adaptiveMask","length","size","baseY","resolvedMask","maskTopHeight","top","maskBottomHeight","bottom","maskWidth","lineHeight","contentLeft","reduce","min","entry","Math","Infinity","contentRight","max","width","contentWidth","content","transform","translateX","children","digitCountResolver","key","maskTop","maskBottom","digitStrings","maskLeft","maskRight","maskY","ascent","maskTotalWidth","maskTotalHeight","hRatio","vRatioTop","vRatioBottom","maskedContent","layer","blendMode","height","colors","end","positions","start","SkiaNumberFlowValueMode","value","format","locales","textAlign","prefix","suffix","SkiaNumberFlowSharedMode","sharedValue","scrubDigitWidthPercentile","zeroCodePoint","effectiveValue","undefined","text","layoutDigitCount","count","i","isDigit","SkiaNumberFlow","formatChars","numberingSystem","__DEV__","posStr","constraint","Object","entries","clampedPercentile","baseProps"],"sourceRoot":"../../../src","sources":["skia/SkiaNumberFlow.tsx"],"mappings":";;AAAA,SAASA,KAAK,EAAEC,cAAc,EAAEC,KAAK,EAAEC,IAAI,IAAIC,QAAQ,EAAEC,GAAG,Q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