@rootnative/inertia-svg 0.0.4 → 0.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +15 -1
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +3 -5
- package/dist/index.mjs +4 -6
- package/package.json +3 -3
- package/src/MotionPath.tsx +6 -5
- package/src/createMotionSvgComponent.tsx +7 -3
package/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,18 @@ This package ships in lockstep with `@rootnative/inertia` — version numbers tr
|
|
|
6
6
|
|
|
7
7
|
## [Unreleased]
|
|
8
8
|
|
|
9
|
+
## [0.0.6] - 2026-08-08
|
|
10
|
+
|
|
11
|
+
**Version bump alongside `@rootnative/inertia@0.0.6`, and this adapter carries half of that release's colour fix.** It seeded its own colour slots from the same unanimatable spelling, so the defect reached `MotionPath` independently of core. The `@rootnative/inertia` peer range moves to `>=0.0.6`.
|
|
12
|
+
|
|
13
|
+
### Fixed
|
|
14
|
+
|
|
15
|
+
- **A colour prop engaged only through `animate` now animates.** `fill`, `stroke`, and any key listed in `colorProps` seeded from `'transparent'` when neither a static prop nor `initial` supplied a value — and `'transparent'` is the one CSS colour name Reanimated's `isColor()` rejects, so the slot could not be animated away from. Under `type: 'timing'` the target still arrived when the duration elapsed, hiding it; under the default spring the animation never settled and the colour never appeared. Seeds are now `TRANSPARENT` (`'rgba(0, 0, 0, 0)'`), the same colour in a spelling Reanimated recognises. Affects `MotionPath`'s `fill` / `stroke` and every component built with `createMotionSvgComponent`. See the core changelog for the full mechanism.
|
|
16
|
+
|
|
17
|
+
## [0.0.5] - 2026-07-31
|
|
18
|
+
|
|
19
|
+
**Lockstep version bump** alongside `@rootnative/inertia@0.0.5` (40 layout and text-metric keys join the `animate` surface, `AnimateStyle<C>` narrows to reject keys the runtime doesn't drive, and reduced motion is no longer bypassable by a sequence step's own `type`). No runtime changes in this adapter; the `@rootnative/inertia` peer range moves to `>=0.0.5`.
|
|
20
|
+
|
|
9
21
|
## [0.0.4] - 2026-07-29
|
|
10
22
|
|
|
11
23
|
**Lockstep version bump** alongside `@rootnative/inertia@0.0.4` (`boxShadow` on the `animate` surface, plus window-coordinate measurement and a style carry for `layoutId` shared-element transitions). No runtime changes in this adapter; the `@rootnative/inertia` peer range moves to `>=0.0.4`.
|
|
@@ -41,7 +53,9 @@ _No git tag was cut for this release; the published artifact is on npm as [`@roo
|
|
|
41
53
|
|
|
42
54
|
- `MotionPath` over `react-native-svg`. Animatable: `d` (element-wise scalar interpolation on structurally-compatible paths), `fill`, `stroke`, `strokeWidth`, opacities, `strokeDashoffset`. Source and target paths must share the same command sequence after implicit-repeat expansion; remount with `key` to switch shape.
|
|
43
55
|
|
|
44
|
-
[unreleased]: https://github.com/rootnative/inertia/compare/core+gestures+gradients+svg@0.0.
|
|
56
|
+
[unreleased]: https://github.com/rootnative/inertia/compare/core+gestures+gradients+svg@0.0.6...HEAD
|
|
57
|
+
[0.0.6]: https://github.com/rootnative/inertia/releases/tag/core+gestures+gradients+svg@0.0.6
|
|
58
|
+
[0.0.5]: https://github.com/rootnative/inertia/releases/tag/core+gestures+gradients+svg@0.0.5
|
|
45
59
|
[0.0.4]: https://github.com/rootnative/inertia/releases/tag/core+gestures+gradients+svg@0.0.4
|
|
46
60
|
[0.0.3]: https://github.com/rootnative/inertia/releases/tag/core+gestures+gradients+svg@0.0.3
|
|
47
61
|
[0.0.2]: https://github.com/rootnative/inertia/releases/tag/core+gestures+gradients+svg@0.0.2
|
package/dist/index.d.mts
CHANGED
|
@@ -92,8 +92,8 @@ type MotionSvgComponentProps<P, NK extends string, CK extends string, AK extends
|
|
|
92
92
|
* interpolation needs a stable slot count — a target with a different
|
|
93
93
|
* length throws in dev and is ignored in production.
|
|
94
94
|
* - Numeric keys engaged only via `animate` seed from `0`; color keys seed
|
|
95
|
-
* from
|
|
96
|
-
* mount animation should start elsewhere.
|
|
95
|
+
* from fully transparent black. Provide a static prop or `initial` value
|
|
96
|
+
* when the mount animation should start elsewhere.
|
|
97
97
|
*
|
|
98
98
|
* @example An animatable `<Ellipse>`
|
|
99
99
|
* ```tsx
|
package/dist/index.d.ts
CHANGED
|
@@ -92,8 +92,8 @@ type MotionSvgComponentProps<P, NK extends string, CK extends string, AK extends
|
|
|
92
92
|
* interpolation needs a stable slot count — a target with a different
|
|
93
93
|
* length throws in dev and is ignored in production.
|
|
94
94
|
* - Numeric keys engaged only via `animate` seed from `0`; color keys seed
|
|
95
|
-
* from
|
|
96
|
-
* mount animation should start elsewhere.
|
|
95
|
+
* from fully transparent black. Provide a static prop or `initial` value
|
|
96
|
+
* when the mount animation should start elsewhere.
|
|
97
97
|
*
|
|
98
98
|
* @example An animatable `<Ellipse>`
|
|
99
99
|
* ```tsx
|
package/dist/index.js
CHANGED
|
@@ -236,11 +236,9 @@ If you need to swap to a structurally different path, remount with key={...}.`
|
|
|
236
236
|
for (let i = 0; i < template.size; i++) {
|
|
237
237
|
paramSvs.push(Animated.useSharedValue(seedParams[i] ?? 0));
|
|
238
238
|
}
|
|
239
|
-
const fillSv = Animated.useSharedValue(
|
|
240
|
-
seedSource?.fill ?? fill ?? "transparent"
|
|
241
|
-
);
|
|
239
|
+
const fillSv = Animated.useSharedValue(seedSource?.fill ?? fill ?? inertia.TRANSPARENT);
|
|
242
240
|
const strokeSv = Animated.useSharedValue(
|
|
243
|
-
seedSource?.stroke ?? stroke ??
|
|
241
|
+
seedSource?.stroke ?? stroke ?? inertia.TRANSPARENT
|
|
244
242
|
);
|
|
245
243
|
const strokeWidthSv = Animated.useSharedValue(
|
|
246
244
|
seedSource?.strokeWidth ?? strokeWidth ?? 1
|
|
@@ -426,7 +424,7 @@ function createMotionSvgComponent(Component, config) {
|
|
|
426
424
|
const colorSvs = {};
|
|
427
425
|
for (const k of colorKeys) {
|
|
428
426
|
colorSvs[k] = Animated.useSharedValue(
|
|
429
|
-
seed?.[k] ?? statics[k] ??
|
|
427
|
+
seed?.[k] ?? statics[k] ?? inertia.TRANSPARENT
|
|
430
428
|
);
|
|
431
429
|
}
|
|
432
430
|
const arraySvs = {};
|
package/dist/index.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useRef, useEffect, useMemo } from 'react';
|
|
2
2
|
import { Path, Circle, Rect, Line } from 'react-native-svg';
|
|
3
3
|
import Animated, { useSharedValue, useAnimatedProps } from 'react-native-reanimated';
|
|
4
|
-
import { useShouldReduceMotion, useNamedTransitions, resolveTransition, resolveNamedTransition } from '@rootnative/inertia';
|
|
4
|
+
import { useShouldReduceMotion, useNamedTransitions, TRANSPARENT, resolveTransition, resolveNamedTransition } from '@rootnative/inertia';
|
|
5
5
|
import { jsx } from 'react/jsx-runtime';
|
|
6
6
|
|
|
7
7
|
// src/MotionPath.tsx
|
|
@@ -230,11 +230,9 @@ If you need to swap to a structurally different path, remount with key={...}.`
|
|
|
230
230
|
for (let i = 0; i < template.size; i++) {
|
|
231
231
|
paramSvs.push(useSharedValue(seedParams[i] ?? 0));
|
|
232
232
|
}
|
|
233
|
-
const fillSv = useSharedValue(
|
|
234
|
-
seedSource?.fill ?? fill ?? "transparent"
|
|
235
|
-
);
|
|
233
|
+
const fillSv = useSharedValue(seedSource?.fill ?? fill ?? TRANSPARENT);
|
|
236
234
|
const strokeSv = useSharedValue(
|
|
237
|
-
seedSource?.stroke ?? stroke ??
|
|
235
|
+
seedSource?.stroke ?? stroke ?? TRANSPARENT
|
|
238
236
|
);
|
|
239
237
|
const strokeWidthSv = useSharedValue(
|
|
240
238
|
seedSource?.strokeWidth ?? strokeWidth ?? 1
|
|
@@ -420,7 +418,7 @@ function createMotionSvgComponent(Component, config) {
|
|
|
420
418
|
const colorSvs = {};
|
|
421
419
|
for (const k of colorKeys) {
|
|
422
420
|
colorSvs[k] = useSharedValue(
|
|
423
|
-
seed?.[k] ?? statics[k] ??
|
|
421
|
+
seed?.[k] ?? statics[k] ?? TRANSPARENT
|
|
424
422
|
);
|
|
425
423
|
}
|
|
426
424
|
const arraySvs = {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rootnative/inertia-svg",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.6",
|
|
4
4
|
"description": "Animatable SVG primitives (path morphing, fill/stroke) for @rootnative/inertia, built on react-native-svg.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "RootNative",
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"!**/*.test.*"
|
|
51
51
|
],
|
|
52
52
|
"peerDependencies": {
|
|
53
|
-
"@rootnative/inertia": ">=0.0.
|
|
53
|
+
"@rootnative/inertia": ">=0.0.6",
|
|
54
54
|
"react": ">=19.0.0",
|
|
55
55
|
"react-native": ">=0.81.0",
|
|
56
56
|
"react-native-reanimated": ">=4.0.0",
|
|
@@ -69,7 +69,7 @@
|
|
|
69
69
|
"react-test-renderer": "19.1.0",
|
|
70
70
|
"tsup": "^8.3.5",
|
|
71
71
|
"typescript": "^5.7.3",
|
|
72
|
-
"@rootnative/inertia": "0.0.
|
|
72
|
+
"@rootnative/inertia": "0.0.6"
|
|
73
73
|
},
|
|
74
74
|
"publishConfig": {
|
|
75
75
|
"access": "public"
|
package/src/MotionPath.tsx
CHANGED
|
@@ -7,6 +7,7 @@ import Animated, {
|
|
|
7
7
|
} from 'react-native-reanimated'
|
|
8
8
|
import {
|
|
9
9
|
resolveTransition,
|
|
10
|
+
TRANSPARENT,
|
|
10
11
|
useShouldReduceMotion,
|
|
11
12
|
type TransitionConfig,
|
|
12
13
|
} from '@rootnative/inertia'
|
|
@@ -182,12 +183,12 @@ export function MotionPath(props: MotionPathProps) {
|
|
|
182
183
|
}
|
|
183
184
|
|
|
184
185
|
// Scalar property SVs. Strings (`fill`, `stroke`) use color seeds so
|
|
185
|
-
// Reanimated recognizes them as colors from frame 1
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
)
|
|
186
|
+
// Reanimated recognizes them as colors from frame 1 — which is exactly why
|
|
187
|
+
// the fallback is `TRANSPARENT` and not the `'transparent'` keyword, the one
|
|
188
|
+
// color name Reanimated's `isColor` rejects.
|
|
189
|
+
const fillSv = useSharedValue<string>(seedSource?.fill ?? fill ?? TRANSPARENT)
|
|
189
190
|
const strokeSv = useSharedValue<string>(
|
|
190
|
-
seedSource?.stroke ?? stroke ??
|
|
191
|
+
seedSource?.stroke ?? stroke ?? TRANSPARENT,
|
|
191
192
|
)
|
|
192
193
|
const strokeWidthSv = useSharedValue<number>(
|
|
193
194
|
seedSource?.strokeWidth ?? strokeWidth ?? 1,
|
|
@@ -7,6 +7,7 @@ import Animated, {
|
|
|
7
7
|
import {
|
|
8
8
|
resolveNamedTransition,
|
|
9
9
|
resolveTransition,
|
|
10
|
+
TRANSPARENT,
|
|
10
11
|
useNamedTransitions,
|
|
11
12
|
useShouldReduceMotion,
|
|
12
13
|
type NamedTransitions,
|
|
@@ -148,8 +149,8 @@ function pickTransition(
|
|
|
148
149
|
* interpolation needs a stable slot count — a target with a different
|
|
149
150
|
* length throws in dev and is ignored in production.
|
|
150
151
|
* - Numeric keys engaged only via `animate` seed from `0`; color keys seed
|
|
151
|
-
* from
|
|
152
|
-
* mount animation should start elsewhere.
|
|
152
|
+
* from fully transparent black. Provide a static prop or `initial` value
|
|
153
|
+
* when the mount animation should start elsewhere.
|
|
153
154
|
*
|
|
154
155
|
* @example An animatable `<Ellipse>`
|
|
155
156
|
* ```tsx
|
|
@@ -260,9 +261,12 @@ export function createMotionSvgComponent<
|
|
|
260
261
|
}
|
|
261
262
|
const colorSvs: Record<string, SharedValue<string>> = {}
|
|
262
263
|
for (const k of colorKeys) {
|
|
264
|
+
// `TRANSPARENT`, not the `'transparent'` keyword: Reanimated's color
|
|
265
|
+
// table maps the keyword to `undefined`, so a slot resting at it cannot
|
|
266
|
+
// be animated away from — under `withSpring` the animation never settles.
|
|
263
267
|
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
264
268
|
colorSvs[k] = useSharedValue<string>(
|
|
265
|
-
(seed?.[k] ?? statics[k] ??
|
|
269
|
+
(seed?.[k] ?? statics[k] ?? TRANSPARENT) as string,
|
|
266
270
|
)
|
|
267
271
|
}
|
|
268
272
|
const arraySvs: Record<string, SharedValue<number>[]> = {}
|