@rootnative/inertia 0.0.0-alpha.1 → 0.0.0-alpha.3
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/chunk-5RCMIJGZ.js +8 -0
- package/dist/chunk-6FENLMCA.mjs +257 -0
- package/dist/chunk-E4MDU4YV.mjs +6 -0
- package/dist/chunk-FSPQVLBF.mjs +6 -0
- package/dist/chunk-GJD4VVAS.mjs +103 -0
- package/dist/chunk-JWHKMNYA.js +112 -0
- package/dist/chunk-K7ICHCTZ.js +54 -0
- package/dist/chunk-KARV7QKF.mjs +6 -0
- package/dist/chunk-KVSJWO5X.js +1011 -0
- package/dist/chunk-NJYRN3WG.js +8 -0
- package/dist/chunk-R3ODWDTI.js +8 -0
- package/dist/chunk-RJNR7CFN.mjs +6 -0
- package/dist/chunk-S4AEU72O.js +8 -0
- package/dist/chunk-SFRNO6AW.js +267 -0
- package/dist/chunk-UM3WVSKQ.mjs +6 -0
- package/dist/chunk-UMFBAFZP.js +8 -0
- package/dist/chunk-UXK4YCT6.mjs +1003 -0
- package/dist/chunk-W6IS4HAK.mjs +52 -0
- package/dist/gestureLayer/index.d.mts +42 -2
- package/dist/gestureLayer/index.d.ts +42 -2
- package/dist/gestureLayer/index.js +28 -275
- package/dist/gestureLayer/index.mjs +23 -270
- package/dist/index.js +122 -1459
- package/dist/index.mjs +19 -1402
- package/dist/motion/Image.js +8 -1175
- package/dist/motion/Image.mjs +4 -1174
- package/dist/motion/Pressable.js +8 -1175
- package/dist/motion/Pressable.mjs +4 -1174
- package/dist/motion/ScrollView.js +8 -1175
- package/dist/motion/ScrollView.mjs +4 -1174
- package/dist/motion/Text.js +8 -1175
- package/dist/motion/Text.mjs +4 -1174
- package/dist/motion/View.js +8 -1175
- package/dist/motion/View.mjs +4 -1174
- package/dist/testing/index.js +0 -2
- package/dist/testing/index.mjs +0 -2
- package/dist/touch/index.js +3 -47
- package/dist/touch/index.mjs +2 -46
- package/llms.txt +2 -2
- package/package.json +2 -1
- package/src/gestureLayer/index.ts +1 -0
- package/src/gestureLayer/useGestureLayer.ts +60 -0
- package/dist/gestureLayer/index.js.map +0 -1
- package/dist/gestureLayer/index.mjs.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/index.mjs.map +0 -1
- package/dist/motion/Image.js.map +0 -1
- package/dist/motion/Image.mjs.map +0 -1
- package/dist/motion/Pressable.js.map +0 -1
- package/dist/motion/Pressable.mjs.map +0 -1
- package/dist/motion/ScrollView.js.map +0 -1
- package/dist/motion/ScrollView.mjs.map +0 -1
- package/dist/motion/Text.js.map +0 -1
- package/dist/motion/Text.mjs.map +0 -1
- package/dist/motion/View.js.map +0 -1
- package/dist/motion/View.mjs.map +0 -1
- package/dist/testing/index.js.map +0 -1
- package/dist/testing/index.mjs.map +0 -1
- package/dist/touch/index.js.map +0 -1
- package/dist/touch/index.mjs.map +0 -1
- package/src/__type-tests__/animate.test-d.tsx +0 -88
- package/src/__type-tests__/motion-value.test-d.ts +0 -39
- package/src/__type-tests__/variants.test-d.tsx +0 -67
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Compile-time gate for variant-key narrowing on `animate`.
|
|
3
|
-
*
|
|
4
|
-
* CLAUDE.md Principle 5 / line 43: "Variant string keys must autocomplete on
|
|
5
|
-
* `animate`." That requires the `variants` map to be inferred at the JSX call
|
|
6
|
-
* site and `animate`'s string form to be narrowed to its keys — so a key typo
|
|
7
|
-
* is a type error, not a silent runtime no-op. These assertions run under
|
|
8
|
-
* `tsc --noEmit` (the typecheck CI step); if a `@ts-expect-error` here stops
|
|
9
|
-
* being an error, tsc fails with "Unused '@ts-expect-error' directive" and the
|
|
10
|
-
* differentiator has regressed.
|
|
11
|
-
*
|
|
12
|
-
* Unlike `animate.test-d.tsx`, these MUST mount JSX: the narrowing depends on
|
|
13
|
-
* `V` being inferred from the `variants` prop at the call site, which only
|
|
14
|
-
* happens through the generic component call signature.
|
|
15
|
-
*/
|
|
16
|
-
|
|
17
|
-
import { Motion } from '../motion'
|
|
18
|
-
|
|
19
|
-
const variants = {
|
|
20
|
-
open: { opacity: 1, translateY: 0 },
|
|
21
|
-
closed: { opacity: 0, translateY: 100 },
|
|
22
|
-
} as const
|
|
23
|
-
|
|
24
|
-
// ─── Variant key narrowing ──────────────────────────────────────────────────
|
|
25
|
-
|
|
26
|
-
// A declared key is accepted (and `open` / `closed` autocomplete here).
|
|
27
|
-
const _acceptsKnownKey = <Motion.View variants={variants} animate="open" />
|
|
28
|
-
const _acceptsOtherKey = <Motion.View variants={variants} animate="closed" />
|
|
29
|
-
|
|
30
|
-
// A typo'd key is a compile error rather than a silent no-op.
|
|
31
|
-
// @ts-expect-error 'opne' is not a key of `variants`
|
|
32
|
-
const _rejectsTypoKey = <Motion.View variants={variants} animate="opne" />
|
|
33
|
-
|
|
34
|
-
// The style-object form still works alongside `variants` (escape hatch for a
|
|
35
|
-
// one-off target that isn't a named state).
|
|
36
|
-
const _acceptsStyleObject = (
|
|
37
|
-
<Motion.View variants={variants} animate={{ opacity: 0.5 }} />
|
|
38
|
-
)
|
|
39
|
-
|
|
40
|
-
// `as const` is NOT required — an inline object literal narrows just as well.
|
|
41
|
-
const inlineVariants = { a: { opacity: 1 }, b: { opacity: 0 } }
|
|
42
|
-
const _inlineVariantsNarrow = (
|
|
43
|
-
<Motion.View variants={inlineVariants} animate="a" />
|
|
44
|
-
)
|
|
45
|
-
const _inlineVariantsReject = (
|
|
46
|
-
// @ts-expect-error 'c' is not a key of the inline variants map
|
|
47
|
-
<Motion.View variants={inlineVariants} animate="c" />
|
|
48
|
-
)
|
|
49
|
-
|
|
50
|
-
// ─── No variants → string stays open (back-compat) ──────────────────────────
|
|
51
|
-
|
|
52
|
-
// Without `variants`, the string form is unconstrained, so this must NOT error
|
|
53
|
-
// (the variant-less call site is unchanged by the narrowing machinery).
|
|
54
|
-
const _noVariantsAnyString = <Motion.View animate="whatever" />
|
|
55
|
-
const _noVariantsStyleObject = <Motion.View animate={{ translateX: 10 }} />
|
|
56
|
-
|
|
57
|
-
// Silence "declared but never read" — these exist purely as type assertions.
|
|
58
|
-
export type _VariantTypeAssertions = [
|
|
59
|
-
typeof _acceptsKnownKey,
|
|
60
|
-
typeof _acceptsOtherKey,
|
|
61
|
-
typeof _rejectsTypoKey,
|
|
62
|
-
typeof _acceptsStyleObject,
|
|
63
|
-
typeof _inlineVariantsNarrow,
|
|
64
|
-
typeof _inlineVariantsReject,
|
|
65
|
-
typeof _noVariantsAnyString,
|
|
66
|
-
typeof _noVariantsStyleObject,
|
|
67
|
-
]
|