@unrulysystems/native-motion-core 0.1.0-alpha.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/CHANGELOG.md +9 -0
- package/LICENSE +21 -0
- package/README.md +48 -0
- package/dist/clock.cjs +71 -0
- package/dist/clock.d.cts +23 -0
- package/dist/clock.d.ts +23 -0
- package/dist/clock.js +66 -0
- package/dist/collect-reads.cjs +68 -0
- package/dist/collect-reads.d.cts +23 -0
- package/dist/collect-reads.d.ts +23 -0
- package/dist/collect-reads.js +62 -0
- package/dist/component/boundedArray.cjs +74 -0
- package/dist/component/boundedArray.d.cts +25 -0
- package/dist/component/boundedArray.d.ts +25 -0
- package/dist/component/boundedArray.js +68 -0
- package/dist/component/index.cjs +57 -0
- package/dist/component/index.d.cts +12 -0
- package/dist/component/index.d.ts +12 -0
- package/dist/component/index.js +22 -0
- package/dist/component/orchestration.cjs +129 -0
- package/dist/component/orchestration.d.cts +66 -0
- package/dist/component/orchestration.d.ts +66 -0
- package/dist/component/orchestration.js +124 -0
- package/dist/component/resolve.cjs +104 -0
- package/dist/component/resolve.d.cts +11 -0
- package/dist/component/resolve.d.ts +11 -0
- package/dist/component/resolve.js +97 -0
- package/dist/component/transition.cjs +352 -0
- package/dist/component/transition.d.cts +33 -0
- package/dist/component/transition.d.ts +33 -0
- package/dist/component/transition.js +339 -0
- package/dist/component/types.cjs +114 -0
- package/dist/component/types.d.cts +60 -0
- package/dist/component/types.d.ts +60 -0
- package/dist/component/types.js +111 -0
- package/dist/component/validate.cjs +1015 -0
- package/dist/component/validate.d.cts +37 -0
- package/dist/component/validate.d.ts +37 -0
- package/dist/component/validate.js +1002 -0
- package/dist/component/variants.cjs +333 -0
- package/dist/component/variants.d.cts +106 -0
- package/dist/component/variants.d.ts +106 -0
- package/dist/component/variants.js +321 -0
- package/dist/config/constants.cjs +41 -0
- package/dist/config/constants.d.cts +29 -0
- package/dist/config/constants.d.ts +29 -0
- package/dist/config/constants.js +38 -0
- package/dist/delay.cjs +72 -0
- package/dist/delay.d.cts +26 -0
- package/dist/delay.d.ts +26 -0
- package/dist/delay.js +70 -0
- package/dist/derived.cjs +143 -0
- package/dist/derived.d.cts +41 -0
- package/dist/derived.d.ts +41 -0
- package/dist/derived.js +139 -0
- package/dist/driver/index.cjs +22 -0
- package/dist/driver/index.d.cts +7 -0
- package/dist/driver/index.d.ts +7 -0
- package/dist/driver/index.js +14 -0
- package/dist/driver/keyframeTiming.cjs +130 -0
- package/dist/driver/keyframeTiming.d.cts +18 -0
- package/dist/driver/keyframeTiming.d.ts +18 -0
- package/dist/driver/keyframeTiming.js +124 -0
- package/dist/driver/keyframeTimingConfig.cjs +24 -0
- package/dist/driver/keyframeTimingConfig.d.cts +5 -0
- package/dist/driver/keyframeTimingConfig.d.ts +5 -0
- package/dist/driver/keyframeTimingConfig.js +22 -0
- package/dist/driver/prepare.cjs +459 -0
- package/dist/driver/prepare.d.cts +4 -0
- package/dist/driver/prepare.d.ts +4 -0
- package/dist/driver/prepare.js +454 -0
- package/dist/driver/reference.cjs +762 -0
- package/dist/driver/reference.d.cts +53 -0
- package/dist/driver/reference.d.ts +53 -0
- package/dist/driver/reference.js +757 -0
- package/dist/driver/step.cjs +55 -0
- package/dist/driver/step.d.cts +9 -0
- package/dist/driver/step.d.ts +9 -0
- package/dist/driver/step.js +52 -0
- package/dist/driver/tiers.cjs +40 -0
- package/dist/driver/tiers.d.cts +2 -0
- package/dist/driver/tiers.d.ts +2 -0
- package/dist/driver/tiers.js +37 -0
- package/dist/driver/types.cjs +9 -0
- package/dist/driver/types.d.cts +68 -0
- package/dist/driver/types.d.ts +68 -0
- package/dist/driver/types.js +8 -0
- package/dist/external-animation-ledger.cjs +1250 -0
- package/dist/external-animation-ledger.d.cts +416 -0
- package/dist/external-animation-ledger.d.ts +416 -0
- package/dist/external-animation-ledger.js +1243 -0
- package/dist/gesture/directionLock.cjs +25 -0
- package/dist/gesture/directionLock.d.cts +8 -0
- package/dist/gesture/directionLock.d.ts +8 -0
- package/dist/gesture/directionLock.js +21 -0
- package/dist/gesture/dragConfig.cjs +634 -0
- package/dist/gesture/dragConfig.d.cts +298 -0
- package/dist/gesture/dragConfig.d.ts +298 -0
- package/dist/gesture/dragConfig.js +624 -0
- package/dist/gesture/elastic.cjs +44 -0
- package/dist/gesture/elastic.d.cts +4 -0
- package/dist/gesture/elastic.d.ts +4 -0
- package/dist/gesture/elastic.js +39 -0
- package/dist/gesture/handoffSession.cjs +161 -0
- package/dist/gesture/handoffSession.d.cts +35 -0
- package/dist/gesture/handoffSession.d.ts +35 -0
- package/dist/gesture/handoffSession.js +158 -0
- package/dist/gesture/index.cjs +37 -0
- package/dist/gesture/index.d.cts +12 -0
- package/dist/gesture/index.d.ts +12 -0
- package/dist/gesture/index.js +11 -0
- package/dist/gesture/projection.cjs +95 -0
- package/dist/gesture/projection.d.cts +7 -0
- package/dist/gesture/projection.d.ts +7 -0
- package/dist/gesture/projection.js +87 -0
- package/dist/gesture/session.cjs +162 -0
- package/dist/gesture/session.d.cts +29 -0
- package/dist/gesture/session.d.ts +29 -0
- package/dist/gesture/session.js +158 -0
- package/dist/gesture/types.cjs +5 -0
- package/dist/gesture/types.d.cts +13 -0
- package/dist/gesture/types.d.ts +13 -0
- package/dist/gesture/types.js +4 -0
- package/dist/gesture/viewportConstraints.cjs +38 -0
- package/dist/gesture/viewportConstraints.d.cts +6 -0
- package/dist/gesture/viewportConstraints.d.ts +6 -0
- package/dist/gesture/viewportConstraints.js +34 -0
- package/dist/graph.cjs +226 -0
- package/dist/graph.d.cts +2 -0
- package/dist/graph.d.ts +2 -0
- package/dist/graph.js +223 -0
- package/dist/index.cjs +140 -0
- package/dist/index.d.cts +33 -0
- package/dist/index.d.ts +33 -0
- package/dist/index.js +70 -0
- package/dist/inertia.cjs +214 -0
- package/dist/inertia.d.cts +53 -0
- package/dist/inertia.d.ts +53 -0
- package/dist/inertia.js +212 -0
- package/dist/instant.cjs +66 -0
- package/dist/instant.d.cts +16 -0
- package/dist/instant.d.ts +16 -0
- package/dist/instant.js +63 -0
- package/dist/internal-driver.cjs +81 -0
- package/dist/internal-driver.d.cts +19 -0
- package/dist/internal-driver.d.ts +19 -0
- package/dist/internal-driver.js +35 -0
- package/dist/keyframes.cjs +191 -0
- package/dist/keyframes.d.cts +13 -0
- package/dist/keyframes.d.ts +13 -0
- package/dist/keyframes.js +188 -0
- package/dist/layout/commitDetector.cjs +67 -0
- package/dist/layout/commitDetector.d.cts +21 -0
- package/dist/layout/commitDetector.d.ts +21 -0
- package/dist/layout/commitDetector.js +64 -0
- package/dist/layout/compose.cjs +67 -0
- package/dist/layout/compose.d.cts +30 -0
- package/dist/layout/compose.d.ts +30 -0
- package/dist/layout/compose.js +65 -0
- package/dist/layout/constants.cjs +13 -0
- package/dist/layout/constants.d.cts +6 -0
- package/dist/layout/constants.d.ts +6 -0
- package/dist/layout/constants.js +10 -0
- package/dist/layout/identity.cjs +700 -0
- package/dist/layout/identity.d.cts +67 -0
- package/dist/layout/identity.d.ts +67 -0
- package/dist/layout/identity.js +698 -0
- package/dist/layout/index.cjs +36 -0
- package/dist/layout/index.d.cts +18 -0
- package/dist/layout/index.d.ts +18 -0
- package/dist/layout/index.js +13 -0
- package/dist/layout/measure.cjs +81 -0
- package/dist/layout/measure.d.cts +43 -0
- package/dist/layout/measure.d.ts +43 -0
- package/dist/layout/measure.js +78 -0
- package/dist/layout/projection.cjs +99 -0
- package/dist/layout/projection.d.cts +23 -0
- package/dist/layout/projection.d.ts +23 -0
- package/dist/layout/projection.js +97 -0
- package/dist/layout/scroll.cjs +27 -0
- package/dist/layout/scroll.d.cts +13 -0
- package/dist/layout/scroll.d.ts +13 -0
- package/dist/layout/scroll.js +24 -0
- package/dist/layout/session.cjs +207 -0
- package/dist/layout/session.d.cts +73 -0
- package/dist/layout/session.d.ts +73 -0
- package/dist/layout/session.js +205 -0
- package/dist/layout/tree.cjs +826 -0
- package/dist/layout/tree.d.cts +70 -0
- package/dist/layout/tree.d.ts +70 -0
- package/dist/layout/tree.js +823 -0
- package/dist/layout/types.cjs +36 -0
- package/dist/layout/types.d.cts +31 -0
- package/dist/layout/types.d.ts +31 -0
- package/dist/layout/types.js +35 -0
- package/dist/motion-arc.cjs +184 -0
- package/dist/motion-arc.d.cts +78 -0
- package/dist/motion-arc.d.ts +78 -0
- package/dist/motion-arc.js +183 -0
- package/dist/motion-mix.cjs +205 -0
- package/dist/motion-mix.d.cts +3 -0
- package/dist/motion-mix.d.ts +3 -0
- package/dist/motion-mix.js +202 -0
- package/dist/motion-value-driver-port.cjs +636 -0
- package/dist/motion-value-driver-port.d.cts +406 -0
- package/dist/motion-value-driver-port.d.ts +406 -0
- package/dist/motion-value-driver-port.js +627 -0
- package/dist/motion-value.cjs +189 -0
- package/dist/motion-value.d.cts +51 -0
- package/dist/motion-value.d.ts +51 -0
- package/dist/motion-value.js +185 -0
- package/dist/presence/controller.cjs +657 -0
- package/dist/presence/controller.d.cts +6 -0
- package/dist/presence/controller.d.ts +6 -0
- package/dist/presence/controller.js +652 -0
- package/dist/presence/index.cjs +19 -0
- package/dist/presence/index.d.cts +4 -0
- package/dist/presence/index.d.ts +4 -0
- package/dist/presence/index.js +12 -0
- package/dist/presence/machine.cjs +50 -0
- package/dist/presence/machine.d.cts +10 -0
- package/dist/presence/machine.d.ts +10 -0
- package/dist/presence/machine.js +46 -0
- package/dist/presence/types.cjs +6 -0
- package/dist/presence/types.d.cts +32 -0
- package/dist/presence/types.d.ts +32 -0
- package/dist/presence/types.js +5 -0
- package/dist/repeat.cjs +311 -0
- package/dist/repeat.d.cts +174 -0
- package/dist/repeat.d.ts +174 -0
- package/dist/repeat.js +300 -0
- package/dist/spring.cjs +128 -0
- package/dist/spring.d.cts +18 -0
- package/dist/spring.d.ts +18 -0
- package/dist/spring.js +125 -0
- package/dist/subscriptions.cjs +74 -0
- package/dist/subscriptions.d.cts +19 -0
- package/dist/subscriptions.d.ts +19 -0
- package/dist/subscriptions.js +69 -0
- package/dist/subset/index.cjs +23 -0
- package/dist/subset/index.d.cts +6 -0
- package/dist/subset/index.d.ts +6 -0
- package/dist/subset/index.js +13 -0
- package/dist/subset/normalize.cjs +90 -0
- package/dist/subset/normalize.d.cts +10 -0
- package/dist/subset/normalize.d.ts +10 -0
- package/dist/subset/normalize.js +85 -0
- package/dist/subset/registry.cjs +259 -0
- package/dist/subset/registry.d.cts +25 -0
- package/dist/subset/registry.d.ts +25 -0
- package/dist/subset/registry.js +256 -0
- package/dist/subset/resolve.cjs +98 -0
- package/dist/subset/resolve.d.cts +24 -0
- package/dist/subset/resolve.d.ts +24 -0
- package/dist/subset/resolve.js +90 -0
- package/dist/timing.cjs +206 -0
- package/dist/timing.d.cts +17 -0
- package/dist/timing.d.ts +17 -0
- package/dist/timing.js +201 -0
- package/dist/transformTemplate.cjs +219 -0
- package/dist/transformTemplate.d.cts +29 -0
- package/dist/transformTemplate.d.ts +29 -0
- package/dist/transformTemplate.js +215 -0
- package/dist/transition.cjs +231 -0
- package/dist/transition.d.cts +89 -0
- package/dist/transition.d.ts +89 -0
- package/dist/transition.js +223 -0
- package/dist/types.cjs +4 -0
- package/dist/types.d.cts +175 -0
- package/dist/types.d.ts +175 -0
- package/dist/types.js +3 -0
- package/dist/value-types/color.cjs +220 -0
- package/dist/value-types/color.d.cts +19 -0
- package/dist/value-types/color.d.ts +19 -0
- package/dist/value-types/color.js +218 -0
- package/dist/value-types/complex.cjs +160 -0
- package/dist/value-types/complex.d.cts +19 -0
- package/dist/value-types/complex.d.ts +19 -0
- package/dist/value-types/complex.js +155 -0
- package/dist/value-types/constants.cjs +15 -0
- package/dist/value-types/constants.d.cts +6 -0
- package/dist/value-types/constants.d.ts +6 -0
- package/dist/value-types/constants.js +12 -0
- package/dist/value-types/discrete.cjs +62 -0
- package/dist/value-types/discrete.d.cts +4 -0
- package/dist/value-types/discrete.d.ts +4 -0
- package/dist/value-types/discrete.js +56 -0
- package/dist/value-types/index.cjs +59 -0
- package/dist/value-types/index.d.cts +14 -0
- package/dist/value-types/index.d.ts +14 -0
- package/dist/value-types/index.js +24 -0
- package/dist/value-types/measure-resolve.cjs +325 -0
- package/dist/value-types/measure-resolve.d.cts +91 -0
- package/dist/value-types/measure-resolve.d.ts +91 -0
- package/dist/value-types/measure-resolve.js +313 -0
- package/dist/value-types/mix.cjs +90 -0
- package/dist/value-types/mix.d.cts +27 -0
- package/dist/value-types/mix.d.ts +27 -0
- package/dist/value-types/mix.js +85 -0
- package/dist/value-types/named-colors.cjs +61 -0
- package/dist/value-types/named-colors.d.cts +2 -0
- package/dist/value-types/named-colors.d.ts +2 -0
- package/dist/value-types/named-colors.js +58 -0
- package/dist/value-types/numeric.cjs +86 -0
- package/dist/value-types/numeric.d.cts +16 -0
- package/dist/value-types/numeric.d.ts +16 -0
- package/dist/value-types/numeric.js +79 -0
- package/dist/worklet-layout/config/constants.js +39 -0
- package/dist/worklet-layout/layout/constants.js +11 -0
- package/dist/worklet-layout/layout/identity.js +699 -0
- package/dist/worklet-layout/layout/projection.js +98 -0
- package/dist/worklet-layout/layout/session.js +206 -0
- package/dist/worklet-layout/layout/tree.js +824 -0
- package/dist/worklet-layout/layout/types.js +36 -0
- package/dist/worklet-layout/spring.js +125 -0
- package/dist/worklet-layout/timing.js +201 -0
- package/dist/worklet-layout/transition.js +223 -0
- package/dist/worklet-layout.cjs +47 -0
- package/dist/worklet-layout.d.cts +15 -0
- package/dist/worklet-layout.d.ts +15 -0
- package/dist/worklet-layout.js +28 -0
- package/dist/wrap.cjs +7 -0
- package/dist/wrap.d.cts +1 -0
- package/dist/wrap.d.ts +1 -0
- package/dist/wrap.js +4 -0
- package/package.json +45 -0
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
// Complex/compound value types (SPEC-VALUE-TYPES §3, REQ-VALUETYPE-007/008). Tokenize a compound string
|
|
2
|
+
// (borderRadius, box-shadow, transform lists) into an ordered list of typed slots (number+unit or color)
|
|
3
|
+
// plus the literal separators between them, mix positionally, and recompose using the TARGET's separators.
|
|
4
|
+
// Host-agnostic (REQ-VALUETYPE-011). Native TIGHTENS motion-dom: exact-count shape compatibility (motion
|
|
5
|
+
// allows origin.count >= target.count), a per-slot unit-identity check (motion folds units into its split
|
|
6
|
+
// template and silently re-applies the target's), and a loud throw where motion warns + snaps
|
|
7
|
+
// (mixImmediate). motion carries bare numbers + a unit-bearing split; Native carries number+unit slots +
|
|
8
|
+
// unit-free separators — the recompose STRING is byte-identical either way.
|
|
9
|
+
import { KNOWN_UNITS } from "./constants.js";
|
|
10
|
+
import { mixColor, parseColor, transformColor } from "./color.js";
|
|
11
|
+
import { mixNumeric } from "./numeric.js";
|
|
12
|
+
// Longest-match-first token recognizers (REQ-VALUETYPE-007). Sticky (`y`) so each is anchored at the
|
|
13
|
+
// cursor. The hex branch grabs the WHOLE `#…` alphanumeric run (not a fixed 3/4/6/8 length) so a
|
|
14
|
+
// malformed hex like `#12` or `#1234567` is captured in full and handed to parseColor, which throws
|
|
15
|
+
// (REQ-VALUETYPE-008) — rather than the old fixed-length regex silently matching the `#123456` prefix and
|
|
16
|
+
// leaving a stray `7` to tokenize as a bogus number. A bare `#` (no alnum after) is caught by an explicit
|
|
17
|
+
// guard in the scan loop.
|
|
18
|
+
const COLOR_TOKEN_RE = /#[0-9a-z]+|(?:rgba?|hsla?)\([^)]*\)/iy;
|
|
19
|
+
const NUMBER_TOKEN_RE = /[-+]?(?:\d+\.?\d*|\.\d+)(?:e[-+]?\d+)?/iy;
|
|
20
|
+
const VAR_TOKEN_RE = /var\(\s*--[^)]*\)/iy;
|
|
21
|
+
// A color-function SIGIL (`rgb(`/`rgba(`/`hsl(`/`hsla(`). Non-sticky, tested against the remaining slice:
|
|
22
|
+
// if a sigil is present but COLOR_TOKEN_RE could not consume a complete function, the function is
|
|
23
|
+
// unclosed/malformed and must fail loud rather than silently tokenizing its interior numbers.
|
|
24
|
+
const COLOR_SIGIL_RE = /^(?:rgba?|hsla?)\(/i;
|
|
25
|
+
function matchStickyAt(re, raw, at) {
|
|
26
|
+
re.lastIndex = at;
|
|
27
|
+
const m = re.exec(raw);
|
|
28
|
+
return m !== null && m.index === at ? m[0] : null;
|
|
29
|
+
}
|
|
30
|
+
// A number token plus an optional trailing KNOWN unit. A non-KNOWN suffix (e.g. `em`) is left in the
|
|
31
|
+
// template, matching motion — REQ-VALUETYPE-004's unit check only governs the units this subsystem owns.
|
|
32
|
+
function matchNumberAt(raw, at) {
|
|
33
|
+
const numStr = matchStickyAt(NUMBER_TOKEN_RE, raw, at);
|
|
34
|
+
if (numStr === null)
|
|
35
|
+
return null;
|
|
36
|
+
const rest = raw.slice(at + numStr.length);
|
|
37
|
+
let unit = '';
|
|
38
|
+
for (const u of KNOWN_UNITS) {
|
|
39
|
+
if (rest.startsWith(u)) {
|
|
40
|
+
unit = u;
|
|
41
|
+
break;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
return { value: Number.parseFloat(numStr), unit, length: numStr.length + unit.length };
|
|
45
|
+
}
|
|
46
|
+
export function parseComplex(raw) {
|
|
47
|
+
const slots = [];
|
|
48
|
+
const template = [];
|
|
49
|
+
let cursor = 0;
|
|
50
|
+
let literalStart = 0;
|
|
51
|
+
while (cursor < raw.length) {
|
|
52
|
+
// var() is web-only (REQ-VALUETYPE-007): on the native runtime it fails loud at parse, never silently
|
|
53
|
+
// becomes a literal.
|
|
54
|
+
if (matchStickyAt(VAR_TOKEN_RE, raw, cursor) !== null) {
|
|
55
|
+
throw new Error(`CSS variable tokens are web-only and cannot be parsed on the native runtime: ${JSON.stringify(raw)}`);
|
|
56
|
+
}
|
|
57
|
+
// color BEFORE number (longest-match-first): rgba(…) wins over the bare `0` at its opening paren.
|
|
58
|
+
const color = matchStickyAt(COLOR_TOKEN_RE, raw, cursor);
|
|
59
|
+
if (color !== null) {
|
|
60
|
+
template.push(raw.slice(literalStart, cursor));
|
|
61
|
+
slots.push({ kind: 'color', value: parseColor(color) });
|
|
62
|
+
cursor += color.length;
|
|
63
|
+
literalStart = cursor;
|
|
64
|
+
continue;
|
|
65
|
+
}
|
|
66
|
+
const num = matchNumberAt(raw, cursor);
|
|
67
|
+
if (num !== null) {
|
|
68
|
+
template.push(raw.slice(literalStart, cursor));
|
|
69
|
+
slots.push({ kind: 'number', value: num.value, unit: num.unit });
|
|
70
|
+
cursor += num.length;
|
|
71
|
+
literalStart = cursor;
|
|
72
|
+
continue;
|
|
73
|
+
}
|
|
74
|
+
// A color SIGIL the color branch could not accept — a bare/malformed `#`, or an unclosed/malformed
|
|
75
|
+
// `rgb()`/`hsl()` — is a malformed color, never literal template filler: fail loud (REQ-VALUETYPE-008)
|
|
76
|
+
// so it can never silently split into a `#`/`rgb(` literal plus bogus downstream numbers. An unknown
|
|
77
|
+
// keyword WITHOUT a sigil (`solid`, `inset`, `rgbicon`) stays a legitimate literal.
|
|
78
|
+
if (raw.charAt(cursor) === '#' || COLOR_SIGIL_RE.test(raw.slice(cursor))) {
|
|
79
|
+
throw new Error(`Malformed color token at index ${cursor} in complex value ${JSON.stringify(raw)}`);
|
|
80
|
+
}
|
|
81
|
+
cursor++;
|
|
82
|
+
}
|
|
83
|
+
template.push(raw.slice(literalStart));
|
|
84
|
+
if (slots.length === 0) {
|
|
85
|
+
throw new Error(`No animatable tokens (number/color) in complex value ${JSON.stringify(raw)}`);
|
|
86
|
+
}
|
|
87
|
+
return { slots, template };
|
|
88
|
+
}
|
|
89
|
+
// motion's mixComplex recompose runs each interpolated number through `sanitize` (round to 5 decimals) —
|
|
90
|
+
// note this is a DIVERGENCE from motion's STANDALONE number/unit transform, which is raw (see numeric.ts).
|
|
91
|
+
// Native mirrors motion per-path for byte-parity: raw standalone (transformNumeric), sanitized in complex.
|
|
92
|
+
function sanitize(v) {
|
|
93
|
+
return Math.round(v * 1e5) / 1e5;
|
|
94
|
+
}
|
|
95
|
+
function transformSlot(slot) {
|
|
96
|
+
if (slot.kind === 'color')
|
|
97
|
+
return transformColor(slot.value);
|
|
98
|
+
const v = sanitize(slot.value);
|
|
99
|
+
return slot.unit === '' ? String(v) : `${v}${slot.unit}`;
|
|
100
|
+
}
|
|
101
|
+
export function transformComplex(v) {
|
|
102
|
+
let out = v.template[0] ?? '';
|
|
103
|
+
for (let i = 0; i < v.slots.length; i++) {
|
|
104
|
+
const slot = v.slots[i];
|
|
105
|
+
if (slot === undefined)
|
|
106
|
+
continue; // unreachable: i < slots.length
|
|
107
|
+
out += transformSlot(slot) + (v.template[i + 1] ?? '');
|
|
108
|
+
}
|
|
109
|
+
return out;
|
|
110
|
+
}
|
|
111
|
+
function countByKind(v) {
|
|
112
|
+
let number = 0;
|
|
113
|
+
let color = 0;
|
|
114
|
+
for (const s of v.slots) {
|
|
115
|
+
if (s.kind === 'color')
|
|
116
|
+
color++;
|
|
117
|
+
else
|
|
118
|
+
number++;
|
|
119
|
+
}
|
|
120
|
+
return { number, color };
|
|
121
|
+
}
|
|
122
|
+
// Exact-count shape compatibility (REQ-VALUETYPE-007): motion mixes when origin.count >= target.count and
|
|
123
|
+
// snaps the excess; Native requires the counts to match exactly and fails loud otherwise.
|
|
124
|
+
function assertShapeCompatible(from, to) {
|
|
125
|
+
const cf = countByKind(from);
|
|
126
|
+
const ct = countByKind(to);
|
|
127
|
+
if (cf.number !== ct.number || cf.color !== ct.color) {
|
|
128
|
+
throw new Error(`Complex values are shape-incompatible: origin ${JSON.stringify(transformComplex(from))} has ` +
|
|
129
|
+
`${cf.number} number(s)/${cf.color} color(s), target ${JSON.stringify(transformComplex(to))} has ` +
|
|
130
|
+
`${ct.number} number(s)/${ct.color} color(s) — counts must match exactly`);
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
// Positionally mix each slot: numbers via mixNumeric (which enforces the per-slot unit-identity check,
|
|
134
|
+
// REQ-VALUETYPE-004), colors via the gamma-aware mixColor. Recompose with the TARGET's template
|
|
135
|
+
// (REQ-VALUETYPE-007). A same-count but positional type mismatch (number vs color at a slot) is a loud
|
|
136
|
+
// failure (REQ-VALUETYPE-008).
|
|
137
|
+
export function mixComplex(from, to, progress) {
|
|
138
|
+
assertShapeCompatible(from, to);
|
|
139
|
+
const slots = to.slots.map((toSlot, i) => {
|
|
140
|
+
const fromSlot = from.slots[i];
|
|
141
|
+
if (fromSlot === undefined) {
|
|
142
|
+
throw new Error(`Missing origin slot ${i} for complex mix`); // unreachable after shape check
|
|
143
|
+
}
|
|
144
|
+
if (fromSlot.kind === 'number' && toSlot.kind === 'number') {
|
|
145
|
+
const mixed = mixNumeric({ value: fromSlot.value, unit: fromSlot.unit }, { value: toSlot.value, unit: toSlot.unit }, progress);
|
|
146
|
+
return { kind: 'number', value: mixed.value, unit: mixed.unit };
|
|
147
|
+
}
|
|
148
|
+
if (fromSlot.kind === 'color' && toSlot.kind === 'color') {
|
|
149
|
+
return { kind: 'color', value: mixColor(fromSlot.value, toSlot.value, progress) };
|
|
150
|
+
}
|
|
151
|
+
throw new Error(`Type mismatch at slot ${i}: origin is ${fromSlot.kind}, target is ${toSlot.kind} — ` +
|
|
152
|
+
`${JSON.stringify(transformComplex(from))} vs ${JSON.stringify(transformComplex(to))}`);
|
|
153
|
+
});
|
|
154
|
+
return { slots, template: to.template };
|
|
155
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.KNOWN_UNITS = exports.EPS_COLOR_CHANNEL = exports.EPS_UNITLESS = exports.EPS_ANGLE = exports.EPS_LENGTH = void 0;
|
|
4
|
+
// Ratified normalization floors (SPEC-VALUE-TYPES §5), adopted VERBATIM from REQ-SUBSET-016 so this
|
|
5
|
+
// subsystem's internal golden-vector floor and the cross-engine comparator's floor never drift apart as
|
|
6
|
+
// two independently-set numbers. Never widened to force a red assertion green.
|
|
7
|
+
exports.EPS_LENGTH = 0.5; // length-unit-equivalent (px, vw, vh)
|
|
8
|
+
exports.EPS_ANGLE = 1e-3; // deg (and the `rad` extension)
|
|
9
|
+
exports.EPS_UNITLESS = 1e-4; // plain numbers, %
|
|
10
|
+
exports.EPS_COLOR_CHANNEL = 1 / 255; // per-channel RGBA (Milestone 2)
|
|
11
|
+
// The unit tokens this subsystem recognizes (REQ-VALUETYPE-002). `px`/`%`/`deg`/`vw`/`vh` mirror
|
|
12
|
+
// motion-dom's unit value types; `rad` is a Native-only extension for React Native's radian `rotate`
|
|
13
|
+
// (no motion counterpart — its web mapping is degrees-conversion in the shim, not here). Listed
|
|
14
|
+
// longest-first so suffix detection is unambiguous even if a future unit is a suffix of another.
|
|
15
|
+
exports.KNOWN_UNITS = ['deg', 'rad', 'px', 'vw', 'vh', '%'];
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare const EPS_LENGTH = 0.5;
|
|
2
|
+
export declare const EPS_ANGLE = 0.001;
|
|
3
|
+
export declare const EPS_UNITLESS = 0.0001;
|
|
4
|
+
export declare const EPS_COLOR_CHANNEL: number;
|
|
5
|
+
export declare const KNOWN_UNITS: readonly ["deg", "rad", "px", "vw", "vh", "%"];
|
|
6
|
+
export type KnownUnit = (typeof KNOWN_UNITS)[number];
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare const EPS_LENGTH = 0.5;
|
|
2
|
+
export declare const EPS_ANGLE = 0.001;
|
|
3
|
+
export declare const EPS_UNITLESS = 0.0001;
|
|
4
|
+
export declare const EPS_COLOR_CHANNEL: number;
|
|
5
|
+
export declare const KNOWN_UNITS: readonly ["deg", "rad", "px", "vw", "vh", "%"];
|
|
6
|
+
export type KnownUnit = (typeof KNOWN_UNITS)[number];
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// Ratified normalization floors (SPEC-VALUE-TYPES §5), adopted VERBATIM from REQ-SUBSET-016 so this
|
|
2
|
+
// subsystem's internal golden-vector floor and the cross-engine comparator's floor never drift apart as
|
|
3
|
+
// two independently-set numbers. Never widened to force a red assertion green.
|
|
4
|
+
export const EPS_LENGTH = 0.5; // length-unit-equivalent (px, vw, vh)
|
|
5
|
+
export const EPS_ANGLE = 1e-3; // deg (and the `rad` extension)
|
|
6
|
+
export const EPS_UNITLESS = 1e-4; // plain numbers, %
|
|
7
|
+
export const EPS_COLOR_CHANNEL = 1 / 255; // per-channel RGBA (Milestone 2)
|
|
8
|
+
// The unit tokens this subsystem recognizes (REQ-VALUETYPE-002). `px`/`%`/`deg`/`vw`/`vh` mirror
|
|
9
|
+
// motion-dom's unit value types; `rad` is a Native-only extension for React Native's radian `rotate`
|
|
10
|
+
// (no motion counterpart — its web mapping is degrees-conversion in the shim, not here). Listed
|
|
11
|
+
// longest-first so suffix detection is unambiguous even if a future unit is a suffix of another.
|
|
12
|
+
export const KNOWN_UNITS = ['deg', 'rad', 'px', 'vw', 'vh', '%'];
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// The DISCRETE keyword family (T23 B; pin motion-dom mix/visibility.ts and mix/complex.ts):
|
|
3
|
+
// single-keyword zero-token strings — CSS keywords like display/visibility values — that are not
|
|
4
|
+
// auto/calc/numeric/color.
|
|
5
|
+
//
|
|
6
|
+
// The pin answers this family through TWO paths, and which one it takes is not a property of the
|
|
7
|
+
// keywords alone (H3, REQ-VALUETYPE-015):
|
|
8
|
+
//
|
|
9
|
+
// 1. `mixVisibility` — taken only when an endpoint is in {none, hidden} AND its COUNTERPART has
|
|
10
|
+
// zero interpolable values. That is the step law: an invisible ORIGIN shows the target once
|
|
11
|
+
// p > 0, an invisible TARGET holds the origin until p >= 1, and the origin arm is checked
|
|
12
|
+
// first, so a both-invisible pair takes it.
|
|
13
|
+
// 2. Otherwise `mixComplex`'s ordinary path, where `canInterpolate` holds and the transformer is
|
|
14
|
+
// built from the TARGET. With zero target slots it has nothing to substitute, so it publishes
|
|
15
|
+
// the target as a CONSTANT — at every progress, in or out of range.
|
|
16
|
+
//
|
|
17
|
+
// A both-visible pair takes (2). It is a constant, NOT a step: at p <= 0 it already reads the
|
|
18
|
+
// target, which is what separates it from `mixImmediate` and from either visibility arm. Native
|
|
19
|
+
// refused this pair until H3; refusing it was native being stricter than the pin, which the
|
|
20
|
+
// fidelity doctrine does not permit.
|
|
21
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22
|
+
exports.INVISIBLE_DISCRETE_VALUES = void 0;
|
|
23
|
+
exports.isDiscreteKeyword = isDiscreteKeyword;
|
|
24
|
+
exports.mixDiscrete = mixDiscrete;
|
|
25
|
+
exports.transformDiscrete = transformDiscrete;
|
|
26
|
+
// The pin set (mix/visibility.ts invisibleValues), exactly.
|
|
27
|
+
exports.INVISIBLE_DISCRETE_VALUES = new Set(['none', 'hidden']);
|
|
28
|
+
const DISCRETE_KEYWORD_PATTERN = /^[a-zA-Z-]+$/;
|
|
29
|
+
// A single-keyword shape. Callers order this AFTER auto/calc/numeric/color detection — the
|
|
30
|
+
// pattern alone would also match 'auto' and named colors, whose families win by parse order.
|
|
31
|
+
function isDiscreteKeyword(raw) {
|
|
32
|
+
return DISCRETE_KEYWORD_PATTERN.test(raw);
|
|
33
|
+
}
|
|
34
|
+
// The pin's two paths, in its own branch order. The visibility arms come first and the ORIGIN arm
|
|
35
|
+
// before the TARGET arm, exactly like `mixVisibility`, so a both-invisible pair takes the origin
|
|
36
|
+
// arm. Progress arrives unclamped; the pin compares p <= 0 / p >= 1.
|
|
37
|
+
//
|
|
38
|
+
// Both endpoints visible falls through to the zero-slot constant. Every discrete keyword has zero
|
|
39
|
+
// interpolable slots by construction (`isDiscreteKeyword` is a single bare keyword), so the
|
|
40
|
+
// target's transformer can only ever be the target itself — there is no progress at which this
|
|
41
|
+
// answers anything else, and no clamping to do.
|
|
42
|
+
function mixDiscrete(from, to, progress) {
|
|
43
|
+
// Both endpoints must actually BE discrete keywords. The arms below are total over that family,
|
|
44
|
+
// so without this an out-of-family endpoint would fall through the visibility arms and be
|
|
45
|
+
// returned silently — the class of quiet acceptance this engine refuses everywhere. The seam one
|
|
46
|
+
// level up (parseValue → mix) already refuses cross-family pairs, so this guards the EXPORTED
|
|
47
|
+
// symbol against a direct call rather than any product path. A plain Error: an unknown shape is
|
|
48
|
+
// an authoring error at a boundary that has already typed its own refusals.
|
|
49
|
+
if (!isDiscreteKeyword(from) || !isDiscreteKeyword(to)) {
|
|
50
|
+
throw new Error(`mixDiscrete: both endpoints must be discrete keywords — got "${from}" → "${to}"`);
|
|
51
|
+
}
|
|
52
|
+
if (exports.INVISIBLE_DISCRETE_VALUES.has(from)) {
|
|
53
|
+
return progress <= 0 ? from : to;
|
|
54
|
+
}
|
|
55
|
+
if (exports.INVISIBLE_DISCRETE_VALUES.has(to)) {
|
|
56
|
+
return progress >= 1 ? to : from;
|
|
57
|
+
}
|
|
58
|
+
return to;
|
|
59
|
+
}
|
|
60
|
+
function transformDiscrete(value) {
|
|
61
|
+
return value;
|
|
62
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare const INVISIBLE_DISCRETE_VALUES: ReadonlySet<string>;
|
|
2
|
+
export declare function isDiscreteKeyword(raw: string): boolean;
|
|
3
|
+
export declare function mixDiscrete(from: string, to: string, progress: number): string;
|
|
4
|
+
export declare function transformDiscrete(value: string): string;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare const INVISIBLE_DISCRETE_VALUES: ReadonlySet<string>;
|
|
2
|
+
export declare function isDiscreteKeyword(raw: string): boolean;
|
|
3
|
+
export declare function mixDiscrete(from: string, to: string, progress: number): string;
|
|
4
|
+
export declare function transformDiscrete(value: string): string;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
// The DISCRETE keyword family (T23 B; pin motion-dom mix/visibility.ts and mix/complex.ts):
|
|
2
|
+
// single-keyword zero-token strings — CSS keywords like display/visibility values — that are not
|
|
3
|
+
// auto/calc/numeric/color.
|
|
4
|
+
//
|
|
5
|
+
// The pin answers this family through TWO paths, and which one it takes is not a property of the
|
|
6
|
+
// keywords alone (H3, REQ-VALUETYPE-015):
|
|
7
|
+
//
|
|
8
|
+
// 1. `mixVisibility` — taken only when an endpoint is in {none, hidden} AND its COUNTERPART has
|
|
9
|
+
// zero interpolable values. That is the step law: an invisible ORIGIN shows the target once
|
|
10
|
+
// p > 0, an invisible TARGET holds the origin until p >= 1, and the origin arm is checked
|
|
11
|
+
// first, so a both-invisible pair takes it.
|
|
12
|
+
// 2. Otherwise `mixComplex`'s ordinary path, where `canInterpolate` holds and the transformer is
|
|
13
|
+
// built from the TARGET. With zero target slots it has nothing to substitute, so it publishes
|
|
14
|
+
// the target as a CONSTANT — at every progress, in or out of range.
|
|
15
|
+
//
|
|
16
|
+
// A both-visible pair takes (2). It is a constant, NOT a step: at p <= 0 it already reads the
|
|
17
|
+
// target, which is what separates it from `mixImmediate` and from either visibility arm. Native
|
|
18
|
+
// refused this pair until H3; refusing it was native being stricter than the pin, which the
|
|
19
|
+
// fidelity doctrine does not permit.
|
|
20
|
+
// The pin set (mix/visibility.ts invisibleValues), exactly.
|
|
21
|
+
export const INVISIBLE_DISCRETE_VALUES = new Set(['none', 'hidden']);
|
|
22
|
+
const DISCRETE_KEYWORD_PATTERN = /^[a-zA-Z-]+$/;
|
|
23
|
+
// A single-keyword shape. Callers order this AFTER auto/calc/numeric/color detection — the
|
|
24
|
+
// pattern alone would also match 'auto' and named colors, whose families win by parse order.
|
|
25
|
+
export function isDiscreteKeyword(raw) {
|
|
26
|
+
return DISCRETE_KEYWORD_PATTERN.test(raw);
|
|
27
|
+
}
|
|
28
|
+
// The pin's two paths, in its own branch order. The visibility arms come first and the ORIGIN arm
|
|
29
|
+
// before the TARGET arm, exactly like `mixVisibility`, so a both-invisible pair takes the origin
|
|
30
|
+
// arm. Progress arrives unclamped; the pin compares p <= 0 / p >= 1.
|
|
31
|
+
//
|
|
32
|
+
// Both endpoints visible falls through to the zero-slot constant. Every discrete keyword has zero
|
|
33
|
+
// interpolable slots by construction (`isDiscreteKeyword` is a single bare keyword), so the
|
|
34
|
+
// target's transformer can only ever be the target itself — there is no progress at which this
|
|
35
|
+
// answers anything else, and no clamping to do.
|
|
36
|
+
export function mixDiscrete(from, to, progress) {
|
|
37
|
+
// Both endpoints must actually BE discrete keywords. The arms below are total over that family,
|
|
38
|
+
// so without this an out-of-family endpoint would fall through the visibility arms and be
|
|
39
|
+
// returned silently — the class of quiet acceptance this engine refuses everywhere. The seam one
|
|
40
|
+
// level up (parseValue → mix) already refuses cross-family pairs, so this guards the EXPORTED
|
|
41
|
+
// symbol against a direct call rather than any product path. A plain Error: an unknown shape is
|
|
42
|
+
// an authoring error at a boundary that has already typed its own refusals.
|
|
43
|
+
if (!isDiscreteKeyword(from) || !isDiscreteKeyword(to)) {
|
|
44
|
+
throw new Error(`mixDiscrete: both endpoints must be discrete keywords — got "${from}" → "${to}"`);
|
|
45
|
+
}
|
|
46
|
+
if (INVISIBLE_DISCRETE_VALUES.has(from)) {
|
|
47
|
+
return progress <= 0 ? from : to;
|
|
48
|
+
}
|
|
49
|
+
if (INVISIBLE_DISCRETE_VALUES.has(to)) {
|
|
50
|
+
return progress >= 1 ? to : from;
|
|
51
|
+
}
|
|
52
|
+
return to;
|
|
53
|
+
}
|
|
54
|
+
export function transformDiscrete(value) {
|
|
55
|
+
return value;
|
|
56
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Public surface of the SPEC-VALUE-TYPES subsystem: the unified mix() seam plus the per-family
|
|
3
|
+
// parse/transform/mix functions and their typed value shapes. Host-agnostic (REQ-VALUETYPE-011) — drivers
|
|
4
|
+
// (native + web shim) depend on this; it depends on no host. Re-exported additively from the core index.
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.resolveLengthToPx = exports.POSITIONAL_LENGTH_AXES = exports.parseLengthTarget = exports.needsLengthMeasureResolve = exports.MeasureResolveContextError = exports.isPositionalLengthAxis = exports.isLengthTarget = exports.isCalc = exports.isAuto = exports.transformValue = exports.parseValue = exports.mix = exports.transformDiscrete = exports.mixDiscrete = exports.isDiscreteKeyword = exports.transformComplex = exports.parseComplex = exports.mixComplex = exports.NAMED_COLORS = exports.transformColor = exports.parseColor = exports.mixColor = exports.isColor = exports.transformNumeric = exports.parseNumeric = exports.mixNumeric = exports.isNumeric = exports.KNOWN_UNITS = exports.EPS_UNITLESS = exports.EPS_LENGTH = exports.EPS_COLOR_CHANNEL = exports.EPS_ANGLE = void 0;
|
|
7
|
+
var constants_1 = require("./constants.cjs");
|
|
8
|
+
Object.defineProperty(exports, "EPS_ANGLE", { enumerable: true, get: function () { return constants_1.EPS_ANGLE; } });
|
|
9
|
+
Object.defineProperty(exports, "EPS_COLOR_CHANNEL", { enumerable: true, get: function () { return constants_1.EPS_COLOR_CHANNEL; } });
|
|
10
|
+
Object.defineProperty(exports, "EPS_LENGTH", { enumerable: true, get: function () { return constants_1.EPS_LENGTH; } });
|
|
11
|
+
Object.defineProperty(exports, "EPS_UNITLESS", { enumerable: true, get: function () { return constants_1.EPS_UNITLESS; } });
|
|
12
|
+
Object.defineProperty(exports, "KNOWN_UNITS", { enumerable: true, get: function () { return constants_1.KNOWN_UNITS; } });
|
|
13
|
+
// The verdict-shaped parse forms are CORE-INTERNAL (M3 r8 major 4a5b686f1f5f / r9 major
|
|
14
|
+
// 9245b65f280e): the ratified VALUE-TYPES public seam enumerates the throwing parse APIs
|
|
15
|
+
// only — internal consumers import the verdicts from the modules directly, and
|
|
16
|
+
// publicSurface.test.ts pins their absence from this barrel.
|
|
17
|
+
var numeric_1 = require("./numeric.cjs");
|
|
18
|
+
Object.defineProperty(exports, "isNumeric", { enumerable: true, get: function () { return numeric_1.isNumeric; } });
|
|
19
|
+
Object.defineProperty(exports, "mixNumeric", { enumerable: true, get: function () { return numeric_1.mixNumeric; } });
|
|
20
|
+
Object.defineProperty(exports, "parseNumeric", { enumerable: true, get: function () { return numeric_1.parseNumeric; } });
|
|
21
|
+
Object.defineProperty(exports, "transformNumeric", { enumerable: true, get: function () { return numeric_1.transformNumeric; } });
|
|
22
|
+
var color_1 = require("./color.cjs");
|
|
23
|
+
Object.defineProperty(exports, "isColor", { enumerable: true, get: function () { return color_1.isColor; } });
|
|
24
|
+
Object.defineProperty(exports, "mixColor", { enumerable: true, get: function () { return color_1.mixColor; } });
|
|
25
|
+
Object.defineProperty(exports, "parseColor", { enumerable: true, get: function () { return color_1.parseColor; } });
|
|
26
|
+
Object.defineProperty(exports, "transformColor", { enumerable: true, get: function () { return color_1.transformColor; } });
|
|
27
|
+
var named_colors_1 = require("./named-colors.cjs");
|
|
28
|
+
Object.defineProperty(exports, "NAMED_COLORS", { enumerable: true, get: function () { return named_colors_1.NAMED_COLORS; } });
|
|
29
|
+
var complex_1 = require("./complex.cjs");
|
|
30
|
+
Object.defineProperty(exports, "mixComplex", { enumerable: true, get: function () { return complex_1.mixComplex; } });
|
|
31
|
+
Object.defineProperty(exports, "parseComplex", { enumerable: true, get: function () { return complex_1.parseComplex; } });
|
|
32
|
+
Object.defineProperty(exports, "transformComplex", { enumerable: true, get: function () { return complex_1.transformComplex; } });
|
|
33
|
+
// T23 B: the discrete keyword family's shape guard + mix/transform join the seam surface (the
|
|
34
|
+
// native projection parity test + the native controller's discrete lane consume them); the
|
|
35
|
+
// invisible-set constant stays module-internal per this barrel's own law until a consumer
|
|
36
|
+
// ratifies it.
|
|
37
|
+
var discrete_1 = require("./discrete.cjs");
|
|
38
|
+
Object.defineProperty(exports, "isDiscreteKeyword", { enumerable: true, get: function () { return discrete_1.isDiscreteKeyword; } });
|
|
39
|
+
Object.defineProperty(exports, "mixDiscrete", { enumerable: true, get: function () { return discrete_1.mixDiscrete; } });
|
|
40
|
+
Object.defineProperty(exports, "transformDiscrete", { enumerable: true, get: function () { return discrete_1.transformDiscrete; } });
|
|
41
|
+
var mix_1 = require("./mix.cjs");
|
|
42
|
+
Object.defineProperty(exports, "mix", { enumerable: true, get: function () { return mix_1.mix; } });
|
|
43
|
+
Object.defineProperty(exports, "parseValue", { enumerable: true, get: function () { return mix_1.parseValue; } });
|
|
44
|
+
Object.defineProperty(exports, "transformValue", { enumerable: true, get: function () { return mix_1.transformValue; } });
|
|
45
|
+
// R13 value-breadth (REQ-VALUETYPE-013/014): positional measure-resolve pure seam.
|
|
46
|
+
// Throwing + type public surface only — verdict helpers stay module-internal (same law as
|
|
47
|
+
// parseNumericVerdict): internal consumers import from `./measure-resolve` directly, and the
|
|
48
|
+
// key-aware executable-matrix WALKER (a string|null refusal — verdict-shaped by this barrel's
|
|
49
|
+
// own law, review ab7c5370fc5a) rides the internal-driver seam, never this barrel.
|
|
50
|
+
var measure_resolve_1 = require("./measure-resolve.cjs");
|
|
51
|
+
Object.defineProperty(exports, "isAuto", { enumerable: true, get: function () { return measure_resolve_1.isAuto; } });
|
|
52
|
+
Object.defineProperty(exports, "isCalc", { enumerable: true, get: function () { return measure_resolve_1.isCalc; } });
|
|
53
|
+
Object.defineProperty(exports, "isLengthTarget", { enumerable: true, get: function () { return measure_resolve_1.isLengthTarget; } });
|
|
54
|
+
Object.defineProperty(exports, "isPositionalLengthAxis", { enumerable: true, get: function () { return measure_resolve_1.isPositionalLengthAxis; } });
|
|
55
|
+
Object.defineProperty(exports, "MeasureResolveContextError", { enumerable: true, get: function () { return measure_resolve_1.MeasureResolveContextError; } });
|
|
56
|
+
Object.defineProperty(exports, "needsLengthMeasureResolve", { enumerable: true, get: function () { return measure_resolve_1.needsLengthMeasureResolve; } });
|
|
57
|
+
Object.defineProperty(exports, "parseLengthTarget", { enumerable: true, get: function () { return measure_resolve_1.parseLengthTarget; } });
|
|
58
|
+
Object.defineProperty(exports, "POSITIONAL_LENGTH_AXES", { enumerable: true, get: function () { return measure_resolve_1.POSITIONAL_LENGTH_AXES; } });
|
|
59
|
+
Object.defineProperty(exports, "resolveLengthToPx", { enumerable: true, get: function () { return measure_resolve_1.resolveLengthToPx; } });
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export { EPS_ANGLE, EPS_COLOR_CHANNEL, EPS_LENGTH, EPS_UNITLESS, KNOWN_UNITS } from "./constants.cjs";
|
|
2
|
+
export type { KnownUnit } from "./constants.cjs";
|
|
3
|
+
export { isNumeric, mixNumeric, parseNumeric, transformNumeric } from "./numeric.cjs";
|
|
4
|
+
export type { NumericValue } from "./numeric.cjs";
|
|
5
|
+
export { isColor, mixColor, parseColor, transformColor } from "./color.cjs";
|
|
6
|
+
export type { RGBA } from "./color.cjs";
|
|
7
|
+
export { NAMED_COLORS } from "./named-colors.cjs";
|
|
8
|
+
export { mixComplex, parseComplex, transformComplex } from "./complex.cjs";
|
|
9
|
+
export type { ComplexValue, Slot } from "./complex.cjs";
|
|
10
|
+
export { isDiscreteKeyword, mixDiscrete, transformDiscrete } from "./discrete.cjs";
|
|
11
|
+
export { mix, parseValue, transformValue } from "./mix.cjs";
|
|
12
|
+
export type { TypedValue } from "./mix.cjs";
|
|
13
|
+
export { isAuto, isCalc, isLengthTarget, isPositionalLengthAxis, MeasureResolveContextError, needsLengthMeasureResolve, parseLengthTarget, POSITIONAL_LENGTH_AXES, resolveLengthToPx, } from "./measure-resolve.cjs";
|
|
14
|
+
export type { LengthLayoutContext, MeasureResolveContextReason, ParsedLengthTarget, PositionalLengthAxis, } from "./measure-resolve.cjs";
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export { EPS_ANGLE, EPS_COLOR_CHANNEL, EPS_LENGTH, EPS_UNITLESS, KNOWN_UNITS } from "./constants.js";
|
|
2
|
+
export type { KnownUnit } from "./constants.js";
|
|
3
|
+
export { isNumeric, mixNumeric, parseNumeric, transformNumeric } from "./numeric.js";
|
|
4
|
+
export type { NumericValue } from "./numeric.js";
|
|
5
|
+
export { isColor, mixColor, parseColor, transformColor } from "./color.js";
|
|
6
|
+
export type { RGBA } from "./color.js";
|
|
7
|
+
export { NAMED_COLORS } from "./named-colors.js";
|
|
8
|
+
export { mixComplex, parseComplex, transformComplex } from "./complex.js";
|
|
9
|
+
export type { ComplexValue, Slot } from "./complex.js";
|
|
10
|
+
export { isDiscreteKeyword, mixDiscrete, transformDiscrete } from "./discrete.js";
|
|
11
|
+
export { mix, parseValue, transformValue } from "./mix.js";
|
|
12
|
+
export type { TypedValue } from "./mix.js";
|
|
13
|
+
export { isAuto, isCalc, isLengthTarget, isPositionalLengthAxis, MeasureResolveContextError, needsLengthMeasureResolve, parseLengthTarget, POSITIONAL_LENGTH_AXES, resolveLengthToPx, } from "./measure-resolve.js";
|
|
14
|
+
export type { LengthLayoutContext, MeasureResolveContextReason, ParsedLengthTarget, PositionalLengthAxis, } from "./measure-resolve.js";
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
// Public surface of the SPEC-VALUE-TYPES subsystem: the unified mix() seam plus the per-family
|
|
2
|
+
// parse/transform/mix functions and their typed value shapes. Host-agnostic (REQ-VALUETYPE-011) — drivers
|
|
3
|
+
// (native + web shim) depend on this; it depends on no host. Re-exported additively from the core index.
|
|
4
|
+
export { EPS_ANGLE, EPS_COLOR_CHANNEL, EPS_LENGTH, EPS_UNITLESS, KNOWN_UNITS } from "./constants.js";
|
|
5
|
+
// The verdict-shaped parse forms are CORE-INTERNAL (M3 r8 major 4a5b686f1f5f / r9 major
|
|
6
|
+
// 9245b65f280e): the ratified VALUE-TYPES public seam enumerates the throwing parse APIs
|
|
7
|
+
// only — internal consumers import the verdicts from the modules directly, and
|
|
8
|
+
// publicSurface.test.ts pins their absence from this barrel.
|
|
9
|
+
export { isNumeric, mixNumeric, parseNumeric, transformNumeric } from "./numeric.js";
|
|
10
|
+
export { isColor, mixColor, parseColor, transformColor } from "./color.js";
|
|
11
|
+
export { NAMED_COLORS } from "./named-colors.js";
|
|
12
|
+
export { mixComplex, parseComplex, transformComplex } from "./complex.js";
|
|
13
|
+
// T23 B: the discrete keyword family's shape guard + mix/transform join the seam surface (the
|
|
14
|
+
// native projection parity test + the native controller's discrete lane consume them); the
|
|
15
|
+
// invisible-set constant stays module-internal per this barrel's own law until a consumer
|
|
16
|
+
// ratifies it.
|
|
17
|
+
export { isDiscreteKeyword, mixDiscrete, transformDiscrete } from "./discrete.js";
|
|
18
|
+
export { mix, parseValue, transformValue } from "./mix.js";
|
|
19
|
+
// R13 value-breadth (REQ-VALUETYPE-013/014): positional measure-resolve pure seam.
|
|
20
|
+
// Throwing + type public surface only — verdict helpers stay module-internal (same law as
|
|
21
|
+
// parseNumericVerdict): internal consumers import from `./measure-resolve` directly, and the
|
|
22
|
+
// key-aware executable-matrix WALKER (a string|null refusal — verdict-shaped by this barrel's
|
|
23
|
+
// own law, review ab7c5370fc5a) rides the internal-driver seam, never this barrel.
|
|
24
|
+
export { isAuto, isCalc, isLengthTarget, isPositionalLengthAxis, MeasureResolveContextError, needsLengthMeasureResolve, parseLengthTarget, POSITIONAL_LENGTH_AXES, resolveLengthToPx, } from "./measure-resolve.js";
|