mythik 0.0.1 → 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 +201 -0
- package/NOTICE +4 -0
- package/README.md +97 -2
- package/dist/actions/dispatcher.d.ts +46 -0
- package/dist/actions/dispatcher.d.ts.map +1 -0
- package/dist/actions/dispatcher.js +366 -0
- package/dist/actions/dispatcher.js.map +1 -0
- package/dist/actions/middleware.d.ts +27 -0
- package/dist/actions/middleware.d.ts.map +1 -0
- package/dist/actions/middleware.js +37 -0
- package/dist/actions/middleware.js.map +1 -0
- package/dist/actions/transaction-engine.d.ts +13 -0
- package/dist/actions/transaction-engine.d.ts.map +1 -0
- package/dist/actions/transaction-engine.js +96 -0
- package/dist/actions/transaction-engine.js.map +1 -0
- package/dist/app/app-engine.d.ts +106 -0
- package/dist/app/app-engine.d.ts.map +1 -0
- package/dist/app/app-engine.js +413 -0
- package/dist/app/app-engine.js.map +1 -0
- package/dist/auth/cross-tab.d.ts +24 -0
- package/dist/auth/cross-tab.d.ts.map +1 -0
- package/dist/auth/cross-tab.js +117 -0
- package/dist/auth/cross-tab.js.map +1 -0
- package/dist/auth/engine.d.ts +16 -0
- package/dist/auth/engine.d.ts.map +1 -0
- package/dist/auth/engine.js +225 -0
- package/dist/auth/engine.js.map +1 -0
- package/dist/auth/persistence.d.ts +21 -0
- package/dist/auth/persistence.d.ts.map +1 -0
- package/dist/auth/persistence.js +97 -0
- package/dist/auth/persistence.js.map +1 -0
- package/dist/auth/providers/custom-jwt.d.ts +41 -0
- package/dist/auth/providers/custom-jwt.d.ts.map +1 -0
- package/dist/auth/providers/custom-jwt.js +165 -0
- package/dist/auth/providers/custom-jwt.js.map +1 -0
- package/dist/auth/providers/mock.d.ts +7 -0
- package/dist/auth/providers/mock.d.ts.map +1 -0
- package/dist/auth/providers/mock.js +52 -0
- package/dist/auth/providers/mock.js.map +1 -0
- package/dist/auth/providers/supabase.d.ts +90 -0
- package/dist/auth/providers/supabase.d.ts.map +1 -0
- package/dist/auth/providers/supabase.js +102 -0
- package/dist/auth/providers/supabase.js.map +1 -0
- package/dist/auth/rate-limiter.d.ts +29 -0
- package/dist/auth/rate-limiter.d.ts.map +1 -0
- package/dist/auth/rate-limiter.js +67 -0
- package/dist/auth/rate-limiter.js.map +1 -0
- package/dist/auth/refresh-engine.d.ts +25 -0
- package/dist/auth/refresh-engine.d.ts.map +1 -0
- package/dist/auth/refresh-engine.js +59 -0
- package/dist/auth/refresh-engine.js.map +1 -0
- package/dist/auth/types.d.ts +89 -0
- package/dist/auth/types.d.ts.map +1 -0
- package/dist/auth/types.js +2 -0
- package/dist/auth/types.js.map +1 -0
- package/dist/contract/endpoint-map.d.ts +20 -0
- package/dist/contract/endpoint-map.d.ts.map +1 -0
- package/dist/contract/endpoint-map.js +57 -0
- package/dist/contract/endpoint-map.js.map +1 -0
- package/dist/contract/engine.d.ts +12 -0
- package/dist/contract/engine.d.ts.map +1 -0
- package/dist/contract/engine.js +80 -0
- package/dist/contract/engine.js.map +1 -0
- package/dist/contract/extractor.d.ts +7 -0
- package/dist/contract/extractor.d.ts.map +1 -0
- package/dist/contract/extractor.js +133 -0
- package/dist/contract/extractor.js.map +1 -0
- package/dist/contract/index.d.ts +4 -0
- package/dist/contract/index.d.ts.map +1 -0
- package/dist/contract/index.js +2 -0
- package/dist/contract/index.js.map +1 -0
- package/dist/contract/matcher.d.ts +13 -0
- package/dist/contract/matcher.d.ts.map +1 -0
- package/dist/contract/matcher.js +57 -0
- package/dist/contract/matcher.js.map +1 -0
- package/dist/contract/rules/endpoints-exist.d.ts +3 -0
- package/dist/contract/rules/endpoints-exist.d.ts.map +1 -0
- package/dist/contract/rules/endpoints-exist.js +29 -0
- package/dist/contract/rules/endpoints-exist.js.map +1 -0
- package/dist/contract/rules/fields-valid.d.ts +3 -0
- package/dist/contract/rules/fields-valid.d.ts.map +1 -0
- package/dist/contract/rules/fields-valid.js +39 -0
- package/dist/contract/rules/fields-valid.js.map +1 -0
- package/dist/contract/rules/params-match.d.ts +3 -0
- package/dist/contract/rules/params-match.d.ts.map +1 -0
- package/dist/contract/rules/params-match.js +40 -0
- package/dist/contract/rules/params-match.js.map +1 -0
- package/dist/contract/rules/permissions-consistent.d.ts +3 -0
- package/dist/contract/rules/permissions-consistent.d.ts.map +1 -0
- package/dist/contract/rules/permissions-consistent.js +52 -0
- package/dist/contract/rules/permissions-consistent.js.map +1 -0
- package/dist/contract/types.d.ts +66 -0
- package/dist/contract/types.d.ts.map +1 -0
- package/dist/contract/types.js +2 -0
- package/dist/contract/types.js.map +1 -0
- package/dist/data/data-sources.d.ts +26 -0
- package/dist/data/data-sources.d.ts.map +1 -0
- package/dist/data/data-sources.js +218 -0
- package/dist/data/data-sources.js.map +1 -0
- package/dist/data/fetch.d.ts +29 -0
- package/dist/data/fetch.d.ts.map +1 -0
- package/dist/data/fetch.js +63 -0
- package/dist/data/fetch.js.map +1 -0
- package/dist/data/offline.d.ts +29 -0
- package/dist/data/offline.d.ts.map +1 -0
- package/dist/data/offline.js +48 -0
- package/dist/data/offline.js.map +1 -0
- package/dist/data/realtime.d.ts +21 -0
- package/dist/data/realtime.d.ts.map +1 -0
- package/dist/data/realtime.js +40 -0
- package/dist/data/realtime.js.map +1 -0
- package/dist/derive/evaluator.d.ts +19 -0
- package/dist/derive/evaluator.d.ts.map +1 -0
- package/dist/derive/evaluator.js +59 -0
- package/dist/derive/evaluator.js.map +1 -0
- package/dist/derive/topo-sort.d.ts +10 -0
- package/dist/derive/topo-sort.d.ts.map +1 -0
- package/dist/derive/topo-sort.js +36 -0
- package/dist/derive/topo-sort.js.map +1 -0
- package/dist/design/animation/cascade-types.d.ts +23 -0
- package/dist/design/animation/cascade-types.d.ts.map +1 -0
- package/dist/design/animation/cascade-types.js +2 -0
- package/dist/design/animation/cascade-types.js.map +1 -0
- package/dist/design/animation/cascade.d.ts +4 -0
- package/dist/design/animation/cascade.d.ts.map +1 -0
- package/dist/design/animation/cascade.js +73 -0
- package/dist/design/animation/cascade.js.map +1 -0
- package/dist/design/animation/css-keyframes.d.ts +8 -0
- package/dist/design/animation/css-keyframes.d.ts.map +1 -0
- package/dist/design/animation/css-keyframes.js +72 -0
- package/dist/design/animation/css-keyframes.js.map +1 -0
- package/dist/design/animation/index.d.ts +14 -0
- package/dist/design/animation/index.d.ts.map +1 -0
- package/dist/design/animation/index.js +9 -0
- package/dist/design/animation/index.js.map +1 -0
- package/dist/design/animation/keyframes-builder.d.ts +40 -0
- package/dist/design/animation/keyframes-builder.d.ts.map +1 -0
- package/dist/design/animation/keyframes-builder.js +140 -0
- package/dist/design/animation/keyframes-builder.js.map +1 -0
- package/dist/design/animation/reanimated-spec.d.ts +16 -0
- package/dist/design/animation/reanimated-spec.d.ts.map +1 -0
- package/dist/design/animation/reanimated-spec.js +162 -0
- package/dist/design/animation/reanimated-spec.js.map +1 -0
- package/dist/design/animation/reduced-motion.d.ts +3 -0
- package/dist/design/animation/reduced-motion.d.ts.map +1 -0
- package/dist/design/animation/reduced-motion.js +54 -0
- package/dist/design/animation/reduced-motion.js.map +1 -0
- package/dist/design/animation/resolver.d.ts +3 -0
- package/dist/design/animation/resolver.d.ts.map +1 -0
- package/dist/design/animation/resolver.js +86 -0
- package/dist/design/animation/resolver.js.map +1 -0
- package/dist/design/animation/types.d.ts +109 -0
- package/dist/design/animation/types.d.ts.map +1 -0
- package/dist/design/animation/types.js +7 -0
- package/dist/design/animation/types.js.map +1 -0
- package/dist/design/animation/validator.d.ts +44 -0
- package/dist/design/animation/validator.d.ts.map +1 -0
- package/dist/design/animation/validator.js +169 -0
- package/dist/design/animation/validator.js.map +1 -0
- package/dist/design/background/blobs/catalog.d.ts +10 -0
- package/dist/design/background/blobs/catalog.d.ts.map +1 -0
- package/dist/design/background/blobs/catalog.js +63 -0
- package/dist/design/background/blobs/catalog.js.map +1 -0
- package/dist/design/background/blobs/index.d.ts +4 -0
- package/dist/design/background/blobs/index.d.ts.map +1 -0
- package/dist/design/background/blobs/index.js +5 -0
- package/dist/design/background/blobs/index.js.map +1 -0
- package/dist/design/background/blobs/resolver.d.ts +16 -0
- package/dist/design/background/blobs/resolver.d.ts.map +1 -0
- package/dist/design/background/blobs/resolver.js +301 -0
- package/dist/design/background/blobs/resolver.js.map +1 -0
- package/dist/design/background/blobs/types.d.ts +112 -0
- package/dist/design/background/blobs/types.d.ts.map +1 -0
- package/dist/design/background/blobs/types.js +27 -0
- package/dist/design/background/blobs/types.js.map +1 -0
- package/dist/design/background/grain.d.ts +3 -0
- package/dist/design/background/grain.d.ts.map +1 -0
- package/dist/design/background/grain.js +23 -0
- package/dist/design/background/grain.js.map +1 -0
- package/dist/design/background/index.d.ts +8 -0
- package/dist/design/background/index.d.ts.map +1 -0
- package/dist/design/background/index.js +8 -0
- package/dist/design/background/index.js.map +1 -0
- package/dist/design/background/layers.d.ts +3 -0
- package/dist/design/background/layers.d.ts.map +1 -0
- package/dist/design/background/layers.js +23 -0
- package/dist/design/background/layers.js.map +1 -0
- package/dist/design/background/patterns/chevron.d.ts +8 -0
- package/dist/design/background/patterns/chevron.d.ts.map +1 -0
- package/dist/design/background/patterns/chevron.js +10 -0
- package/dist/design/background/patterns/chevron.js.map +1 -0
- package/dist/design/background/patterns/crosshatch.d.ts +8 -0
- package/dist/design/background/patterns/crosshatch.d.ts.map +1 -0
- package/dist/design/background/patterns/crosshatch.js +12 -0
- package/dist/design/background/patterns/crosshatch.js.map +1 -0
- package/dist/design/background/patterns/diagonal.d.ts +8 -0
- package/dist/design/background/patterns/diagonal.d.ts.map +1 -0
- package/dist/design/background/patterns/diagonal.js +7 -0
- package/dist/design/background/patterns/diagonal.js.map +1 -0
- package/dist/design/background/patterns/dots.d.ts +7 -0
- package/dist/design/background/patterns/dots.d.ts.map +1 -0
- package/dist/design/background/patterns/dots.js +9 -0
- package/dist/design/background/patterns/dots.js.map +1 -0
- package/dist/design/background/patterns/grid.d.ts +7 -0
- package/dist/design/background/patterns/grid.d.ts.map +1 -0
- package/dist/design/background/patterns/grid.js +8 -0
- package/dist/design/background/patterns/grid.js.map +1 -0
- package/dist/design/background/patterns/index.d.ts +8 -0
- package/dist/design/background/patterns/index.d.ts.map +1 -0
- package/dist/design/background/patterns/index.js +8 -0
- package/dist/design/background/patterns/index.js.map +1 -0
- package/dist/design/background/patterns/iso.d.ts +7 -0
- package/dist/design/background/patterns/iso.d.ts.map +1 -0
- package/dist/design/background/patterns/iso.js +11 -0
- package/dist/design/background/patterns/iso.js.map +1 -0
- package/dist/design/background/patterns/resolver.d.ts +3 -0
- package/dist/design/background/patterns/resolver.d.ts.map +1 -0
- package/dist/design/background/patterns/resolver.js +56 -0
- package/dist/design/background/patterns/resolver.js.map +1 -0
- package/dist/design/background/primitives/gradient.d.ts +3 -0
- package/dist/design/background/primitives/gradient.d.ts.map +1 -0
- package/dist/design/background/primitives/gradient.js +68 -0
- package/dist/design/background/primitives/gradient.js.map +1 -0
- package/dist/design/background/primitives/image.d.ts +3 -0
- package/dist/design/background/primitives/image.d.ts.map +1 -0
- package/dist/design/background/primitives/image.js +12 -0
- package/dist/design/background/primitives/image.js.map +1 -0
- package/dist/design/background/primitives/index.d.ts +4 -0
- package/dist/design/background/primitives/index.d.ts.map +1 -0
- package/dist/design/background/primitives/index.js +4 -0
- package/dist/design/background/primitives/index.js.map +1 -0
- package/dist/design/background/primitives/solid.d.ts +8 -0
- package/dist/design/background/primitives/solid.d.ts.map +1 -0
- package/dist/design/background/primitives/solid.js +15 -0
- package/dist/design/background/primitives/solid.js.map +1 -0
- package/dist/design/background/resolver.d.ts +3 -0
- package/dist/design/background/resolver.d.ts.map +1 -0
- package/dist/design/background/resolver.js +20 -0
- package/dist/design/background/resolver.js.map +1 -0
- package/dist/design/background/sanitizer.d.ts +2 -0
- package/dist/design/background/sanitizer.d.ts.map +1 -0
- package/dist/design/background/sanitizer.js +54 -0
- package/dist/design/background/sanitizer.js.map +1 -0
- package/dist/design/deep-tokens.d.ts +125 -0
- package/dist/design/deep-tokens.d.ts.map +1 -0
- package/dist/design/deep-tokens.js +115 -0
- package/dist/design/deep-tokens.js.map +1 -0
- package/dist/design/dna.d.ts +7 -0
- package/dist/design/dna.d.ts.map +1 -0
- package/dist/design/dna.js +210 -0
- package/dist/design/dna.js.map +1 -0
- package/dist/design/identity/color.d.ts +8 -0
- package/dist/design/identity/color.d.ts.map +1 -0
- package/dist/design/identity/color.js +64 -0
- package/dist/design/identity/color.js.map +1 -0
- package/dist/design/identity/elevation.d.ts +8 -0
- package/dist/design/identity/elevation.d.ts.map +1 -0
- package/dist/design/identity/elevation.js +31 -0
- package/dist/design/identity/elevation.js.map +1 -0
- package/dist/design/identity/index.d.ts +12 -0
- package/dist/design/identity/index.d.ts.map +1 -0
- package/dist/design/identity/index.js +14 -0
- package/dist/design/identity/index.js.map +1 -0
- package/dist/design/identity/shape.d.ts +4 -0
- package/dist/design/identity/shape.d.ts.map +1 -0
- package/dist/design/identity/shape.js +23 -0
- package/dist/design/identity/shape.js.map +1 -0
- package/dist/design/identity/surface.d.ts +18 -0
- package/dist/design/identity/surface.d.ts.map +1 -0
- package/dist/design/identity/surface.js +125 -0
- package/dist/design/identity/surface.js.map +1 -0
- package/dist/design/identity/types.d.ts +280 -0
- package/dist/design/identity/types.d.ts.map +1 -0
- package/dist/design/identity/types.js +21 -0
- package/dist/design/identity/types.js.map +1 -0
- package/dist/design/identity/typography.d.ts +7 -0
- package/dist/design/identity/typography.d.ts.map +1 -0
- package/dist/design/identity/typography.js +42 -0
- package/dist/design/identity/typography.js.map +1 -0
- package/dist/design/identity-resolver.d.ts +15 -0
- package/dist/design/identity-resolver.d.ts.map +1 -0
- package/dist/design/identity-resolver.js +52 -0
- package/dist/design/identity-resolver.js.map +1 -0
- package/dist/design/oklch.d.ts +10 -0
- package/dist/design/oklch.d.ts.map +1 -0
- package/dist/design/oklch.js +61 -0
- package/dist/design/oklch.js.map +1 -0
- package/dist/design/palette.d.ts +26 -0
- package/dist/design/palette.d.ts.map +1 -0
- package/dist/design/palette.js +73 -0
- package/dist/design/palette.js.map +1 -0
- package/dist/design/presets.d.ts +18 -0
- package/dist/design/presets.d.ts.map +1 -0
- package/dist/design/presets.js +2 -0
- package/dist/design/presets.js.map +1 -0
- package/dist/design/recipes/animations.d.ts +11 -0
- package/dist/design/recipes/animations.d.ts.map +1 -0
- package/dist/design/recipes/animations.js +180 -0
- package/dist/design/recipes/animations.js.map +1 -0
- package/dist/design/recipes/backgrounds.d.ts +3 -0
- package/dist/design/recipes/backgrounds.d.ts.map +1 -0
- package/dist/design/recipes/backgrounds.js +152 -0
- package/dist/design/recipes/backgrounds.js.map +1 -0
- package/dist/design/recipes/index.d.ts +2 -0
- package/dist/design/recipes/index.d.ts.map +1 -0
- package/dist/design/recipes/index.js +2 -0
- package/dist/design/recipes/index.js.map +1 -0
- package/dist/design/surface-to-css.d.ts +57 -0
- package/dist/design/surface-to-css.d.ts.map +1 -0
- package/dist/design/surface-to-css.js +130 -0
- package/dist/design/surface-to-css.js.map +1 -0
- package/dist/design/surface-to-rn.d.ts +57 -0
- package/dist/design/surface-to-rn.d.ts.map +1 -0
- package/dist/design/surface-to-rn.js +133 -0
- package/dist/design/surface-to-rn.js.map +1 -0
- package/dist/design/tokens.d.ts +67 -0
- package/dist/design/tokens.d.ts.map +1 -0
- package/dist/design/tokens.js +36 -0
- package/dist/design/tokens.js.map +1 -0
- package/dist/device/context.d.ts +13 -0
- package/dist/device/context.d.ts.map +1 -0
- package/dist/device/context.js +2 -0
- package/dist/device/context.js.map +1 -0
- package/dist/editor-session/clone.d.ts +4 -0
- package/dist/editor-session/clone.d.ts.map +1 -0
- package/dist/editor-session/clone.js +55 -0
- package/dist/editor-session/clone.js.map +1 -0
- package/dist/editor-session/engine.d.ts +21 -0
- package/dist/editor-session/engine.d.ts.map +1 -0
- package/dist/editor-session/engine.js +375 -0
- package/dist/editor-session/engine.js.map +1 -0
- package/dist/editor-session/persistence.d.ts +8 -0
- package/dist/editor-session/persistence.d.ts.map +1 -0
- package/dist/editor-session/persistence.js +89 -0
- package/dist/editor-session/persistence.js.map +1 -0
- package/dist/editor-session/types.d.ts +90 -0
- package/dist/editor-session/types.d.ts.map +1 -0
- package/dist/editor-session/types.js +2 -0
- package/dist/editor-session/types.js.map +1 -0
- package/dist/editor-session/validators.d.ts +5 -0
- package/dist/editor-session/validators.d.ts.map +1 -0
- package/dist/editor-session/validators.js +106 -0
- package/dist/editor-session/validators.js.map +1 -0
- package/dist/elements/composer.d.ts +109 -0
- package/dist/elements/composer.d.ts.map +1 -0
- package/dist/elements/composer.js +129 -0
- package/dist/elements/composer.js.map +1 -0
- package/dist/export/csv.d.ts +3 -0
- package/dist/export/csv.d.ts.map +1 -0
- package/dist/export/csv.js +16 -0
- package/dist/export/csv.js.map +1 -0
- package/dist/export/download.d.ts +2 -0
- package/dist/export/download.d.ts.map +1 -0
- package/dist/export/download.js +13 -0
- package/dist/export/download.js.map +1 -0
- package/dist/export/format.d.ts +3 -0
- package/dist/export/format.d.ts.map +1 -0
- package/dist/export/format.js +43 -0
- package/dist/export/format.js.map +1 -0
- package/dist/export/types.d.ts +22 -0
- package/dist/export/types.d.ts.map +1 -0
- package/dist/export/types.js +2 -0
- package/dist/export/types.js.map +1 -0
- package/dist/expressions/deep-resolve.d.ts +4 -0
- package/dist/expressions/deep-resolve.d.ts.map +1 -0
- package/dist/expressions/deep-resolve.js +20 -0
- package/dist/expressions/deep-resolve.js.map +1 -0
- package/dist/expressions/handlers/array.d.ts +19 -0
- package/dist/expressions/handlers/array.d.ts.map +1 -0
- package/dist/expressions/handlers/array.js +161 -0
- package/dist/expressions/handlers/array.js.map +1 -0
- package/dist/expressions/handlers/auth.d.ts +13 -0
- package/dist/expressions/handlers/auth.d.ts.map +1 -0
- package/dist/expressions/handlers/auth.js +90 -0
- package/dist/expressions/handlers/auth.js.map +1 -0
- package/dist/expressions/handlers/bind.d.ts +22 -0
- package/dist/expressions/handlers/bind.d.ts.map +1 -0
- package/dist/expressions/handlers/bind.js +57 -0
- package/dist/expressions/handlers/bind.js.map +1 -0
- package/dist/expressions/handlers/breakpoint.d.ts +10 -0
- package/dist/expressions/handlers/breakpoint.d.ts.map +1 -0
- package/dist/expressions/handlers/breakpoint.js +39 -0
- package/dist/expressions/handlers/breakpoint.js.map +1 -0
- package/dist/expressions/handlers/computed.d.ts +3 -0
- package/dist/expressions/handlers/computed.d.ts.map +1 -0
- package/dist/expressions/handlers/computed.js +20 -0
- package/dist/expressions/handlers/computed.js.map +1 -0
- package/dist/expressions/handlers/cond.d.ts +3 -0
- package/dist/expressions/handlers/cond.d.ts.map +1 -0
- package/dist/expressions/handlers/cond.js +57 -0
- package/dist/expressions/handlers/cond.js.map +1 -0
- package/dist/expressions/handlers/date.d.ts +14 -0
- package/dist/expressions/handlers/date.d.ts.map +1 -0
- package/dist/expressions/handlers/date.js +95 -0
- package/dist/expressions/handlers/date.js.map +1 -0
- package/dist/expressions/handlers/format.d.ts +19 -0
- package/dist/expressions/handlers/format.d.ts.map +1 -0
- package/dist/expressions/handlers/format.js +93 -0
- package/dist/expressions/handlers/format.js.map +1 -0
- package/dist/expressions/handlers/group.d.ts +25 -0
- package/dist/expressions/handlers/group.d.ts.map +1 -0
- package/dist/expressions/handlers/group.js +85 -0
- package/dist/expressions/handlers/group.js.map +1 -0
- package/dist/expressions/handlers/i18n.d.ts +8 -0
- package/dist/expressions/handlers/i18n.d.ts.map +1 -0
- package/dist/expressions/handlers/i18n.js +35 -0
- package/dist/expressions/handlers/i18n.js.map +1 -0
- package/dist/expressions/handlers/index.d.ts +4 -0
- package/dist/expressions/handlers/index.d.ts.map +1 -0
- package/dist/expressions/handlers/index.js +52 -0
- package/dist/expressions/handlers/index.js.map +1 -0
- package/dist/expressions/handlers/let.d.ts +4 -0
- package/dist/expressions/handlers/let.d.ts.map +1 -0
- package/dist/expressions/handlers/let.js +36 -0
- package/dist/expressions/handlers/let.js.map +1 -0
- package/dist/expressions/handlers/logic.d.ts +27 -0
- package/dist/expressions/handlers/logic.d.ts.map +1 -0
- package/dist/expressions/handlers/logic.js +52 -0
- package/dist/expressions/handlers/logic.js.map +1 -0
- package/dist/expressions/handlers/math.d.ts +13 -0
- package/dist/expressions/handlers/math.d.ts.map +1 -0
- package/dist/expressions/handlers/math.js +58 -0
- package/dist/expressions/handlers/math.js.map +1 -0
- package/dist/expressions/handlers/platform.d.ts +13 -0
- package/dist/expressions/handlers/platform.d.ts.map +1 -0
- package/dist/expressions/handlers/platform.js +37 -0
- package/dist/expressions/handlers/platform.js.map +1 -0
- package/dist/expressions/handlers/prop.d.ts +10 -0
- package/dist/expressions/handlers/prop.d.ts.map +1 -0
- package/dist/expressions/handlers/prop.js +18 -0
- package/dist/expressions/handlers/prop.js.map +1 -0
- package/dist/expressions/handlers/selection.d.ts +10 -0
- package/dist/expressions/handlers/selection.d.ts.map +1 -0
- package/dist/expressions/handlers/selection.js +33 -0
- package/dist/expressions/handlers/selection.js.map +1 -0
- package/dist/expressions/handlers/state.d.ts +3 -0
- package/dist/expressions/handlers/state.d.ts.map +1 -0
- package/dist/expressions/handlers/state.js +8 -0
- package/dist/expressions/handlers/state.js.map +1 -0
- package/dist/expressions/handlers/switch.d.ts +15 -0
- package/dist/expressions/handlers/switch.d.ts.map +1 -0
- package/dist/expressions/handlers/switch.js +31 -0
- package/dist/expressions/handlers/switch.js.map +1 -0
- package/dist/expressions/handlers/template.d.ts +3 -0
- package/dist/expressions/handlers/template.d.ts.map +1 -0
- package/dist/expressions/handlers/template.js +23 -0
- package/dist/expressions/handlers/template.js.map +1 -0
- package/dist/expressions/handlers/token.d.ts +3 -0
- package/dist/expressions/handlers/token.d.ts.map +1 -0
- package/dist/expressions/handlers/token.js +40 -0
- package/dist/expressions/handlers/token.js.map +1 -0
- package/dist/expressions/handlers/unique-id.d.ts +11 -0
- package/dist/expressions/handlers/unique-id.d.ts.map +1 -0
- package/dist/expressions/handlers/unique-id.js +52 -0
- package/dist/expressions/handlers/unique-id.js.map +1 -0
- package/dist/expressions/registry.d.ts +8 -0
- package/dist/expressions/registry.d.ts.map +1 -0
- package/dist/expressions/registry.js +35 -0
- package/dist/expressions/registry.js.map +1 -0
- package/dist/expressions/resolver.d.ts +15 -0
- package/dist/expressions/resolver.d.ts.map +1 -0
- package/dist/expressions/resolver.js +56 -0
- package/dist/expressions/resolver.js.map +1 -0
- package/dist/factory.d.ts +56 -0
- package/dist/factory.d.ts.map +1 -0
- package/dist/factory.js +265 -0
- package/dist/factory.js.map +1 -0
- package/dist/fetch/framework-fetch.d.ts +12 -0
- package/dist/fetch/framework-fetch.d.ts.map +1 -0
- package/dist/fetch/framework-fetch.js +36 -0
- package/dist/fetch/framework-fetch.js.map +1 -0
- package/dist/fetch/interceptors/auth.d.ts +19 -0
- package/dist/fetch/interceptors/auth.d.ts.map +1 -0
- package/dist/fetch/interceptors/auth.js +66 -0
- package/dist/fetch/interceptors/auth.js.map +1 -0
- package/dist/fetch/interceptors/logging.d.ts +8 -0
- package/dist/fetch/interceptors/logging.d.ts.map +1 -0
- package/dist/fetch/interceptors/logging.js +40 -0
- package/dist/fetch/interceptors/logging.js.map +1 -0
- package/dist/fetch/interceptors/retry.d.ts +20 -0
- package/dist/fetch/interceptors/retry.d.ts.map +1 -0
- package/dist/fetch/interceptors/retry.js +34 -0
- package/dist/fetch/interceptors/retry.js.map +1 -0
- package/dist/fetch/interceptors/timeout.d.ts +7 -0
- package/dist/fetch/interceptors/timeout.d.ts.map +1 -0
- package/dist/fetch/interceptors/timeout.js +20 -0
- package/dist/fetch/interceptors/timeout.js.map +1 -0
- package/dist/fetch/types.d.ts +30 -0
- package/dist/fetch/types.d.ts.map +1 -0
- package/dist/fetch/types.js +2 -0
- package/dist/fetch/types.js.map +1 -0
- package/dist/forms/engine.d.ts +3 -0
- package/dist/forms/engine.d.ts.map +1 -0
- package/dist/forms/engine.js +167 -0
- package/dist/forms/engine.js.map +1 -0
- package/dist/forms/types.d.ts +30 -0
- package/dist/forms/types.d.ts.map +1 -0
- package/dist/forms/types.js +2 -0
- package/dist/forms/types.js.map +1 -0
- package/dist/i18n/engine.d.ts +15 -0
- package/dist/i18n/engine.d.ts.map +1 -0
- package/dist/i18n/engine.js +61 -0
- package/dist/i18n/engine.js.map +1 -0
- package/dist/index.d.ts +161 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +106 -0
- package/dist/index.js.map +1 -0
- package/dist/interactions/data-operations.d.ts +51 -0
- package/dist/interactions/data-operations.d.ts.map +1 -0
- package/dist/interactions/data-operations.js +64 -0
- package/dist/interactions/data-operations.js.map +1 -0
- package/dist/interactions/drag-drop.d.ts +14 -0
- package/dist/interactions/drag-drop.d.ts.map +1 -0
- package/dist/interactions/drag-drop.js +35 -0
- package/dist/interactions/drag-drop.js.map +1 -0
- package/dist/interactions/export.d.ts +24 -0
- package/dist/interactions/export.d.ts.map +1 -0
- package/dist/interactions/export.js +44 -0
- package/dist/interactions/export.js.map +1 -0
- package/dist/interactions/history.d.ts +16 -0
- package/dist/interactions/history.d.ts.map +1 -0
- package/dist/interactions/history.js +52 -0
- package/dist/interactions/history.js.map +1 -0
- package/dist/motion/engine.d.ts +47 -0
- package/dist/motion/engine.d.ts.map +1 -0
- package/dist/motion/engine.js +81 -0
- package/dist/motion/engine.js.map +1 -0
- package/dist/navigation/router.d.ts +36 -0
- package/dist/navigation/router.d.ts.map +1 -0
- package/dist/navigation/router.js +51 -0
- package/dist/navigation/router.js.map +1 -0
- package/dist/permissions/evaluator.d.ts +15 -0
- package/dist/permissions/evaluator.d.ts.map +1 -0
- package/dist/permissions/evaluator.js +32 -0
- package/dist/permissions/evaluator.js.map +1 -0
- package/dist/plugins/loader.d.ts +30 -0
- package/dist/plugins/loader.d.ts.map +1 -0
- package/dist/plugins/loader.js +87 -0
- package/dist/plugins/loader.js.map +1 -0
- package/dist/reference/generator.d.ts +25 -0
- package/dist/reference/generator.d.ts.map +1 -0
- package/dist/reference/generator.js +808 -0
- package/dist/reference/generator.js.map +1 -0
- package/dist/renderer/deps.d.ts +24 -0
- package/dist/renderer/deps.d.ts.map +1 -0
- package/dist/renderer/deps.js +150 -0
- package/dist/renderer/deps.js.map +1 -0
- package/dist/renderer/engine.d.ts +15 -0
- package/dist/renderer/engine.d.ts.map +1 -0
- package/dist/renderer/engine.js +1097 -0
- package/dist/renderer/engine.js.map +1 -0
- package/dist/renderer/lazy-paths.d.ts +14 -0
- package/dist/renderer/lazy-paths.d.ts.map +1 -0
- package/dist/renderer/lazy-paths.js +63 -0
- package/dist/renderer/lazy-paths.js.map +1 -0
- package/dist/renderer/prop-schemas.d.ts +17 -0
- package/dist/renderer/prop-schemas.d.ts.map +1 -0
- package/dist/renderer/prop-schemas.js +81 -0
- package/dist/renderer/prop-schemas.js.map +1 -0
- package/dist/renderer/registry.d.ts +10 -0
- package/dist/renderer/registry.d.ts.map +1 -0
- package/dist/renderer/registry.js +22 -0
- package/dist/renderer/registry.js.map +1 -0
- package/dist/renderer/variants.d.ts +54 -0
- package/dist/renderer/variants.d.ts.map +1 -0
- package/dist/renderer/variants.js +105 -0
- package/dist/renderer/variants.js.map +1 -0
- package/dist/runtime/mount-spec-runtime.d.ts +59 -0
- package/dist/runtime/mount-spec-runtime.d.ts.map +1 -0
- package/dist/runtime/mount-spec-runtime.js +73 -0
- package/dist/runtime/mount-spec-runtime.js.map +1 -0
- package/dist/security/api-spec-validator.d.ts +13 -0
- package/dist/security/api-spec-validator.d.ts.map +1 -0
- package/dist/security/api-spec-validator.js +347 -0
- package/dist/security/api-spec-validator.js.map +1 -0
- package/dist/security/app-spec-validator.d.ts +4 -0
- package/dist/security/app-spec-validator.d.ts.map +1 -0
- package/dist/security/app-spec-validator.js +200 -0
- package/dist/security/app-spec-validator.js.map +1 -0
- package/dist/security/identifier-guard.d.ts +3 -0
- package/dist/security/identifier-guard.d.ts.map +1 -0
- package/dist/security/identifier-guard.js +15 -0
- package/dist/security/identifier-guard.js.map +1 -0
- package/dist/security/identity-token-validator.d.ts +3 -0
- package/dist/security/identity-token-validator.d.ts.map +1 -0
- package/dist/security/identity-token-validator.js +121 -0
- package/dist/security/identity-token-validator.js.map +1 -0
- package/dist/security/index.d.ts +14 -0
- package/dist/security/index.d.ts.map +1 -0
- package/dist/security/index.js +8 -0
- package/dist/security/index.js.map +1 -0
- package/dist/security/protection-registry.d.ts +24 -0
- package/dist/security/protection-registry.d.ts.map +1 -0
- package/dist/security/protection-registry.js +35 -0
- package/dist/security/protection-registry.js.map +1 -0
- package/dist/security/rate-limiter.d.ts +23 -0
- package/dist/security/rate-limiter.d.ts.map +1 -0
- package/dist/security/rate-limiter.js +44 -0
- package/dist/security/rate-limiter.js.map +1 -0
- package/dist/security/spec-signing.d.ts +23 -0
- package/dist/security/spec-signing.d.ts.map +1 -0
- package/dist/security/spec-signing.js +62 -0
- package/dist/security/spec-signing.js.map +1 -0
- package/dist/security/spec-validator.d.ts +60 -0
- package/dist/security/spec-validator.d.ts.map +1 -0
- package/dist/security/spec-validator.js +903 -0
- package/dist/security/spec-validator.js.map +1 -0
- package/dist/security/state-protection.d.ts +23 -0
- package/dist/security/state-protection.d.ts.map +1 -0
- package/dist/security/state-protection.js +49 -0
- package/dist/security/state-protection.js.map +1 -0
- package/dist/security/url-whitelist.d.ts +14 -0
- package/dist/security/url-whitelist.d.ts.map +1 -0
- package/dist/security/url-whitelist.js +37 -0
- package/dist/security/url-whitelist.js.map +1 -0
- package/dist/server.d.ts +6 -0
- package/dist/server.d.ts.map +1 -0
- package/dist/server.js +8 -0
- package/dist/server.js.map +1 -0
- package/dist/spec-engine/app-elements.d.ts +5 -0
- package/dist/spec-engine/app-elements.d.ts.map +1 -0
- package/dist/spec-engine/app-elements.js +36 -0
- package/dist/spec-engine/app-elements.js.map +1 -0
- package/dist/spec-engine/app-manifest.d.ts +3 -0
- package/dist/spec-engine/app-manifest.d.ts.map +1 -0
- package/dist/spec-engine/app-manifest.js +132 -0
- package/dist/spec-engine/app-manifest.js.map +1 -0
- package/dist/spec-engine/elements.d.ts +8 -0
- package/dist/spec-engine/elements.d.ts.map +1 -0
- package/dist/spec-engine/elements.js +18 -0
- package/dist/spec-engine/elements.js.map +1 -0
- package/dist/spec-engine/engine.d.ts +3 -0
- package/dist/spec-engine/engine.d.ts.map +1 -0
- package/dist/spec-engine/engine.js +76 -0
- package/dist/spec-engine/engine.js.map +1 -0
- package/dist/spec-engine/handlers/api-handler.d.ts +5 -0
- package/dist/spec-engine/handlers/api-handler.d.ts.map +1 -0
- package/dist/spec-engine/handlers/api-handler.js +111 -0
- package/dist/spec-engine/handlers/api-handler.js.map +1 -0
- package/dist/spec-engine/handlers/app-handler.d.ts +4 -0
- package/dist/spec-engine/handlers/app-handler.d.ts.map +1 -0
- package/dist/spec-engine/handlers/app-handler.js +41 -0
- package/dist/spec-engine/handlers/app-handler.js.map +1 -0
- package/dist/spec-engine/handlers/index.d.ts +8 -0
- package/dist/spec-engine/handlers/index.d.ts.map +1 -0
- package/dist/spec-engine/handlers/index.js +17 -0
- package/dist/spec-engine/handlers/index.js.map +1 -0
- package/dist/spec-engine/handlers/screen-handler.d.ts +4 -0
- package/dist/spec-engine/handlers/screen-handler.d.ts.map +1 -0
- package/dist/spec-engine/handlers/screen-handler.js +34 -0
- package/dist/spec-engine/handlers/screen-handler.js.map +1 -0
- package/dist/spec-engine/manifest.d.ts +11 -0
- package/dist/spec-engine/manifest.d.ts.map +1 -0
- package/dist/spec-engine/manifest.js +76 -0
- package/dist/spec-engine/manifest.js.map +1 -0
- package/dist/spec-engine/types.d.ts +61 -0
- package/dist/spec-engine/types.d.ts.map +1 -0
- package/dist/spec-engine/types.js +2 -0
- package/dist/spec-engine/types.js.map +1 -0
- package/dist/spec-stores/file.d.ts +12 -0
- package/dist/spec-stores/file.d.ts.map +1 -0
- package/dist/spec-stores/file.js +32 -0
- package/dist/spec-stores/file.js.map +1 -0
- package/dist/spec-stores/memory-versioned.d.ts +22 -0
- package/dist/spec-stores/memory-versioned.d.ts.map +1 -0
- package/dist/spec-stores/memory-versioned.js +125 -0
- package/dist/spec-stores/memory-versioned.js.map +1 -0
- package/dist/spec-stores/memory.d.ts +10 -0
- package/dist/spec-stores/memory.d.ts.map +1 -0
- package/dist/spec-stores/memory.js +31 -0
- package/dist/spec-stores/memory.js.map +1 -0
- package/dist/spec-stores/sqlserver-versioned.d.ts +44 -0
- package/dist/spec-stores/sqlserver-versioned.d.ts.map +1 -0
- package/dist/spec-stores/sqlserver-versioned.js +253 -0
- package/dist/spec-stores/sqlserver-versioned.js.map +1 -0
- package/dist/spec-stores/sqlserver.d.ts +27 -0
- package/dist/spec-stores/sqlserver.d.ts.map +1 -0
- package/dist/spec-stores/sqlserver.js +78 -0
- package/dist/spec-stores/sqlserver.js.map +1 -0
- package/dist/spec-stores/supabase-versioned.d.ts +38 -0
- package/dist/spec-stores/supabase-versioned.d.ts.map +1 -0
- package/dist/spec-stores/supabase-versioned.js +197 -0
- package/dist/spec-stores/supabase-versioned.js.map +1 -0
- package/dist/spec-stores/supabase.d.ts +18 -0
- package/dist/spec-stores/supabase.d.ts.map +1 -0
- package/dist/spec-stores/supabase.js +68 -0
- package/dist/spec-stores/supabase.js.map +1 -0
- package/dist/state/reserved-paths.d.ts +41 -0
- package/dist/state/reserved-paths.d.ts.map +1 -0
- package/dist/state/reserved-paths.js +40 -0
- package/dist/state/reserved-paths.js.map +1 -0
- package/dist/state/store.d.ts +18 -0
- package/dist/state/store.d.ts.map +1 -0
- package/dist/state/store.js +114 -0
- package/dist/state/store.js.map +1 -0
- package/dist/storage/supabase.d.ts +37 -0
- package/dist/storage/supabase.d.ts.map +1 -0
- package/dist/storage/supabase.js +22 -0
- package/dist/storage/supabase.js.map +1 -0
- package/dist/storage/types.d.ts +22 -0
- package/dist/storage/types.d.ts.map +1 -0
- package/dist/storage/types.js +2 -0
- package/dist/storage/types.js.map +1 -0
- package/dist/storage/upload-action.d.ts +22 -0
- package/dist/storage/upload-action.d.ts.map +1 -0
- package/dist/storage/upload-action.js +117 -0
- package/dist/storage/upload-action.js.map +1 -0
- package/dist/storage/url.d.ts +17 -0
- package/dist/storage/url.d.ts.map +1 -0
- package/dist/storage/url.js +48 -0
- package/dist/storage/url.js.map +1 -0
- package/dist/streaming/compiler.d.ts +26 -0
- package/dist/streaming/compiler.d.ts.map +1 -0
- package/dist/streaming/compiler.js +54 -0
- package/dist/streaming/compiler.js.map +1 -0
- package/dist/streaming/patch.d.ts +19 -0
- package/dist/streaming/patch.d.ts.map +1 -0
- package/dist/streaming/patch.js +139 -0
- package/dist/streaming/patch.js.map +1 -0
- package/dist/types.d.ts +443 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +8 -0
- package/dist/types.js.map +1 -0
- package/dist/util/to-array.d.ts +2 -0
- package/dist/util/to-array.d.ts.map +1 -0
- package/dist/util/to-array.js +14 -0
- package/dist/util/to-array.js.map +1 -0
- package/dist/utils/levenshtein.d.ts +3 -0
- package/dist/utils/levenshtein.d.ts.map +1 -0
- package/dist/utils/levenshtein.js +29 -0
- package/dist/utils/levenshtein.js.map +1 -0
- package/dist/validation/validators.d.ts +20 -0
- package/dist/validation/validators.d.ts.map +1 -0
- package/dist/validation/validators.js +138 -0
- package/dist/validation/validators.js.map +1 -0
- package/dist/versioning/compute-patches.d.ts +7 -0
- package/dist/versioning/compute-patches.d.ts.map +1 -0
- package/dist/versioning/compute-patches.js +62 -0
- package/dist/versioning/compute-patches.js.map +1 -0
- package/dist/versioning/index.d.ts +12 -0
- package/dist/versioning/index.d.ts.map +1 -0
- package/dist/versioning/index.js +7 -0
- package/dist/versioning/index.js.map +1 -0
- package/dist/versioning/promote-gate.d.ts +12 -0
- package/dist/versioning/promote-gate.d.ts.map +1 -0
- package/dist/versioning/promote-gate.js +166 -0
- package/dist/versioning/promote-gate.js.map +1 -0
- package/dist/versioning/rollback.d.ts +26 -0
- package/dist/versioning/rollback.d.ts.map +1 -0
- package/dist/versioning/rollback.js +67 -0
- package/dist/versioning/rollback.js.map +1 -0
- package/dist/versioning/structural-diff.d.ts +8 -0
- package/dist/versioning/structural-diff.d.ts.map +1 -0
- package/dist/versioning/structural-diff.js +287 -0
- package/dist/versioning/structural-diff.js.map +1 -0
- package/dist/versioning/types.d.ts +90 -0
- package/dist/versioning/types.d.ts.map +1 -0
- package/dist/versioning/types.js +2 -0
- package/dist/versioning/types.js.map +1 -0
- package/dist/visibility/evaluator.d.ts +12 -0
- package/dist/visibility/evaluator.d.ts.map +1 -0
- package/dist/visibility/evaluator.js +76 -0
- package/dist/visibility/evaluator.js.map +1 -0
- package/dist/watchers/engine.d.ts +19 -0
- package/dist/watchers/engine.d.ts.map +1 -0
- package/dist/watchers/engine.js +24 -0
- package/dist/watchers/engine.js.map +1 -0
- package/docs/consumer/README.md +44 -0
- package/docs/consumer/WHERE-TO-LOOK.md +94 -0
- package/docs/consumer/ai-context-api.md +195 -0
- package/docs/consumer/ai-context-custom-elements.md +249 -0
- package/docs/consumer/ai-context-patterns.md +254 -0
- package/docs/consumer/ai-context-primitives.md +839 -0
- package/docs/consumer/ai-context-runtime-semantics.md +1075 -0
- package/docs/consumer/ai-context.md +1374 -0
- package/docs/consumer/reference-doc.md +3201 -0
- package/docs/llms.txt +17 -0
- package/docs/wiki/compiled/README.md +33 -0
- package/docs/wiki/compiled/_gaps.md +52 -0
- package/docs/wiki/compiled/_index.md +354 -0
- package/docs/wiki/compiled/_inventory.md +2986 -0
- package/docs/wiki/compiled/_lint.md +66 -0
- package/docs/wiki/compiled/_unmapped.md +3 -0
- package/docs/wiki/compiled/action-apply-preset.md +63 -0
- package/docs/wiki/compiled/action-copy-clipboard.md +45 -0
- package/docs/wiki/compiled/action-drawer.md +50 -0
- package/docs/wiki/compiled/action-export.md +66 -0
- package/docs/wiki/compiled/action-fetch.md +87 -0
- package/docs/wiki/compiled/action-form-control.md +55 -0
- package/docs/wiki/compiled/action-login.md +71 -0
- package/docs/wiki/compiled/action-modal.md +61 -0
- package/docs/wiki/compiled/action-navigate.md +72 -0
- package/docs/wiki/compiled/action-open-url.md +38 -0
- package/docs/wiki/compiled/action-refresh-data-source.md +51 -0
- package/docs/wiki/compiled/action-selection.md +55 -0
- package/docs/wiki/compiled/action-set-locale.md +44 -0
- package/docs/wiki/compiled/action-set-state.md +61 -0
- package/docs/wiki/compiled/action-show-notification.md +65 -0
- package/docs/wiki/compiled/action-submit-form.md +69 -0
- package/docs/wiki/compiled/action-toggle-theme.md +50 -0
- package/docs/wiki/compiled/action-update-tokens.md +63 -0
- package/docs/wiki/compiled/action-upload-file.md +87 -0
- package/docs/wiki/compiled/antipattern-action-chain-no-stop.md +49 -0
- package/docs/wiki/compiled/antipattern-all-filter-wildcard.md +59 -0
- package/docs/wiki/compiled/antipattern-auth-domains-port.md +47 -0
- package/docs/wiki/compiled/antipattern-background-blobs-prop.md +62 -0
- package/docs/wiki/compiled/antipattern-background-css-token.md +53 -0
- package/docs/wiki/compiled/antipattern-checkbox-toggle-value.md +42 -0
- package/docs/wiki/compiled/antipattern-crud-id-collision.md +66 -0
- package/docs/wiki/compiled/antipattern-derive-server-pagination.md +58 -0
- package/docs/wiki/compiled/antipattern-element-variant-top-level.md +57 -0
- package/docs/wiki/compiled/antipattern-event-expression.md +55 -0
- package/docs/wiki/compiled/antipattern-input-type-name.md +43 -0
- package/docs/wiki/compiled/antipattern-mix-fetch-and-datasources.md +48 -0
- package/docs/wiki/compiled/antipattern-modal-drawer-visible.md +57 -0
- package/docs/wiki/compiled/antipattern-motion-entrance-token.md +53 -0
- package/docs/wiki/compiled/antipattern-overflow-hidden-with-shadow.md +50 -0
- package/docs/wiki/compiled/antipattern-required-if-equals.md +59 -0
- package/docs/wiki/compiled/antipattern-row-literal.md +70 -0
- package/docs/wiki/compiled/antipattern-row-template-capture.md +42 -0
- package/docs/wiki/compiled/antipattern-store-save-bypass.md +72 -0
- package/docs/wiki/compiled/antipattern-style-block-duplication.md +56 -0
- package/docs/wiki/compiled/antipattern-submit-form-in-tx-confirm.md +56 -0
- package/docs/wiki/compiled/cli-app-spec.md +53 -0
- package/docs/wiki/compiled/cli-config.md +46 -0
- package/docs/wiki/compiled/cli-contract.md +73 -0
- package/docs/wiki/compiled/cli-delete.md +37 -0
- package/docs/wiki/compiled/cli-docs.md +44 -0
- package/docs/wiki/compiled/cli-elements.md +39 -0
- package/docs/wiki/compiled/cli-existing-spec-edit-loop.md +24 -0
- package/docs/wiki/compiled/cli-history.md +38 -0
- package/docs/wiki/compiled/cli-lint.md +77 -0
- package/docs/wiki/compiled/cli-manifest.md +43 -0
- package/docs/wiki/compiled/cli-overview.md +77 -0
- package/docs/wiki/compiled/cli-patch.md +85 -0
- package/docs/wiki/compiled/cli-programmatic-api.md +73 -0
- package/docs/wiki/compiled/cli-pull.md +39 -0
- package/docs/wiki/compiled/cli-push.md +91 -0
- package/docs/wiki/compiled/cli-tokens.md +38 -0
- package/docs/wiki/compiled/cli-toon.md +44 -0
- package/docs/wiki/compiled/cli-validate.md +52 -0
- package/docs/wiki/compiled/cli-versioning-author.md +58 -0
- package/docs/wiki/compiled/concept-action-chains.md +65 -0
- package/docs/wiki/compiled/concept-action-middleware.md +55 -0
- package/docs/wiki/compiled/concept-animation-build-css.md +43 -0
- package/docs/wiki/compiled/concept-animation-build-rn.md +44 -0
- package/docs/wiki/compiled/concept-animation-caps.md +38 -0
- package/docs/wiki/compiled/concept-animation-cascade.md +89 -0
- package/docs/wiki/compiled/concept-animation-null-semantics.md +55 -0
- package/docs/wiki/compiled/concept-animation-recipes.md +67 -0
- package/docs/wiki/compiled/concept-animation-triggers.md +54 -0
- package/docs/wiki/compiled/concept-animations-engine.md +78 -0
- package/docs/wiki/compiled/concept-api-audit.md +67 -0
- package/docs/wiki/compiled/concept-api-auth.md +67 -0
- package/docs/wiki/compiled/concept-api-catalogs.md +44 -0
- package/docs/wiki/compiled/concept-api-crud-endpoint.md +90 -0
- package/docs/wiki/compiled/concept-api-endpoint-properties.md +40 -0
- package/docs/wiki/compiled/concept-api-endpoints-overview.md +57 -0
- package/docs/wiki/compiled/concept-api-handler-endpoint.md +56 -0
- package/docs/wiki/compiled/concept-api-login-body-contract.md +47 -0
- package/docs/wiki/compiled/concept-api-param-properties.md +44 -0
- package/docs/wiki/compiled/concept-api-public-endpoint.md +33 -0
- package/docs/wiki/compiled/concept-api-query-endpoint.md +53 -0
- package/docs/wiki/compiled/concept-api-scope-filter.md +59 -0
- package/docs/wiki/compiled/concept-api-spec.md +70 -0
- package/docs/wiki/compiled/concept-app-auto-state-paths.md +59 -0
- package/docs/wiki/compiled/concept-app-spec.md +89 -0
- package/docs/wiki/compiled/concept-auth-config.md +71 -0
- package/docs/wiki/compiled/concept-auth-domains.md +55 -0
- package/docs/wiki/compiled/concept-auth-security.md +58 -0
- package/docs/wiki/compiled/concept-auth-state-paths.md +48 -0
- package/docs/wiki/compiled/concept-auto-dark-mode.md +55 -0
- package/docs/wiki/compiled/concept-background-caps.md +42 -0
- package/docs/wiki/compiled/concept-background-layer-kinds.md +80 -0
- package/docs/wiki/compiled/concept-background-recipes.md +53 -0
- package/docs/wiki/compiled/concept-background-stack.md +55 -0
- package/docs/wiki/compiled/concept-blob-layer.md +92 -0
- package/docs/wiki/compiled/concept-blob-motion.md +58 -0
- package/docs/wiki/compiled/concept-blob-shapes-catalog.md +45 -0
- package/docs/wiki/compiled/concept-cli-tokens-inspect.md +38 -0
- package/docs/wiki/compiled/concept-component-variants.md +89 -0
- package/docs/wiki/compiled/concept-cross-tab-sync.md +35 -0
- package/docs/wiki/compiled/concept-css-vs-motion.md +46 -0
- package/docs/wiki/compiled/concept-custom-detection-pattern.md +49 -0
- package/docs/wiki/compiled/concept-custom-element-action-props.md +81 -0
- package/docs/wiki/compiled/concept-custom-element-black-box.md +56 -0
- package/docs/wiki/compiled/concept-custom-element-cache.md +39 -0
- package/docs/wiki/compiled/concept-custom-element-error-boundary.md +33 -0
- package/docs/wiki/compiled/concept-custom-element-prop-cascade.md +60 -0
- package/docs/wiki/compiled/concept-custom-element-repeat.md +53 -0
- package/docs/wiki/compiled/concept-custom-elements.md +71 -0
- package/docs/wiki/compiled/concept-custom-jwt-provider.md +63 -0
- package/docs/wiki/compiled/concept-customize-action.md +33 -0
- package/docs/wiki/compiled/concept-customize-cli-lint-rule.md +30 -0
- package/docs/wiki/compiled/concept-customize-expression-handler.md +30 -0
- package/docs/wiki/compiled/concept-customize-plugin.md +43 -0
- package/docs/wiki/compiled/concept-customize-server-middleware.md +36 -0
- package/docs/wiki/compiled/concept-customize-spec-store.md +42 -0
- package/docs/wiki/compiled/concept-customize-validator-rule.md +35 -0
- package/docs/wiki/compiled/concept-customize-versioned-store.md +37 -0
- package/docs/wiki/compiled/concept-data-sources-lifecycle.md +61 -0
- package/docs/wiki/compiled/concept-data-sources.md +96 -0
- package/docs/wiki/compiled/concept-debugging-runtime-pointers.md +45 -0
- package/docs/wiki/compiled/concept-derive-datasources-mount-order.md +72 -0
- package/docs/wiki/compiled/concept-derive.md +67 -0
- package/docs/wiki/compiled/concept-dna-seeds.md +79 -0
- package/docs/wiki/compiled/concept-editor-commit.md +37 -0
- package/docs/wiki/compiled/concept-editor-save.md +18 -0
- package/docs/wiki/compiled/concept-editor-sessions.md +23 -0
- package/docs/wiki/compiled/concept-element-children-slot.md +54 -0
- package/docs/wiki/compiled/concept-element-definition.md +60 -0
- package/docs/wiki/compiled/concept-element-key.md +56 -0
- package/docs/wiki/compiled/concept-element-prop-definition.md +54 -0
- package/docs/wiki/compiled/concept-element-properties.md +81 -0
- package/docs/wiki/compiled/concept-element-render-node.md +62 -0
- package/docs/wiki/compiled/concept-element-variants.md +67 -0
- package/docs/wiki/compiled/concept-environment-store.md +46 -0
- package/docs/wiki/compiled/concept-export-action.md +56 -0
- package/docs/wiki/compiled/concept-expression-contexts.md +56 -0
- package/docs/wiki/compiled/concept-expression-timing.md +56 -0
- package/docs/wiki/compiled/concept-fetch-interceptors.md +49 -0
- package/docs/wiki/compiled/concept-file-upload-overview.md +55 -0
- package/docs/wiki/compiled/concept-fire-and-forget.md +45 -0
- package/docs/wiki/compiled/concept-font-loading.md +52 -0
- package/docs/wiki/compiled/concept-form-state-paths.md +55 -0
- package/docs/wiki/compiled/concept-forms.md +89 -0
- package/docs/wiki/compiled/concept-identity-accent-application.md +48 -0
- package/docs/wiki/compiled/concept-identity-animations.md +48 -0
- package/docs/wiki/compiled/concept-identity-border-elevation-override.md +56 -0
- package/docs/wiki/compiled/concept-identity-color-scheme.md +74 -0
- package/docs/wiki/compiled/concept-identity-color-weight.md +50 -0
- package/docs/wiki/compiled/concept-identity-glass-rn.md +46 -0
- package/docs/wiki/compiled/concept-identity-gradients.md +56 -0
- package/docs/wiki/compiled/concept-identity-heading-color.md +40 -0
- package/docs/wiki/compiled/concept-identity-helpers.md +61 -0
- package/docs/wiki/compiled/concept-identity-icons.md +46 -0
- package/docs/wiki/compiled/concept-identity-images.md +36 -0
- package/docs/wiki/compiled/concept-identity-label-style.md +36 -0
- package/docs/wiki/compiled/concept-identity-overview.md +72 -0
- package/docs/wiki/compiled/concept-identity-radius-pattern.md +39 -0
- package/docs/wiki/compiled/concept-identity-surface.md +62 -0
- package/docs/wiki/compiled/concept-identity-text-decoration.md +48 -0
- package/docs/wiki/compiled/concept-identity-typography-hierarchy.md +40 -0
- package/docs/wiki/compiled/concept-initial-actions.md +82 -0
- package/docs/wiki/compiled/concept-interactive-states.md +72 -0
- package/docs/wiki/compiled/concept-keyframe-snapshot.md +52 -0
- package/docs/wiki/compiled/concept-layer-background.md +80 -0
- package/docs/wiki/compiled/concept-motion-field.md +77 -0
- package/docs/wiki/compiled/concept-mount-spec-runtime.md +47 -0
- package/docs/wiki/compiled/concept-mythik-renderer.md +76 -0
- package/docs/wiki/compiled/concept-navigation-dirty-guard.md +23 -0
- package/docs/wiki/compiled/concept-navigation.md +75 -0
- package/docs/wiki/compiled/concept-package-layout.md +35 -0
- package/docs/wiki/compiled/concept-path-references.md +53 -0
- package/docs/wiki/compiled/concept-pattern-primitives.md +54 -0
- package/docs/wiki/compiled/concept-preset-dropdown-pattern.md +52 -0
- package/docs/wiki/compiled/concept-presets.md +49 -0
- package/docs/wiki/compiled/concept-primitive-prop-schemas.md +53 -0
- package/docs/wiki/compiled/concept-primitives-overview.md +49 -0
- package/docs/wiki/compiled/concept-promote-gate.md +47 -0
- package/docs/wiki/compiled/concept-prop-cascade.md +76 -0
- package/docs/wiki/compiled/concept-public-package-names.md +33 -0
- package/docs/wiki/compiled/concept-query-envelope.md +55 -0
- package/docs/wiki/compiled/concept-reduced-motion.md +38 -0
- package/docs/wiki/compiled/concept-register-presets.md +44 -0
- package/docs/wiki/compiled/concept-render-error-visibility.md +57 -0
- package/docs/wiki/compiled/concept-repeat-grouped.md +72 -0
- package/docs/wiki/compiled/concept-repeat-selection.md +61 -0
- package/docs/wiki/compiled/concept-repeat.md +81 -0
- package/docs/wiki/compiled/concept-role-access.md +61 -0
- package/docs/wiki/compiled/concept-rollback.md +36 -0
- package/docs/wiki/compiled/concept-rules-catalog.md +49 -0
- package/docs/wiki/compiled/concept-screen-definition.md +51 -0
- package/docs/wiki/compiled/concept-screen-outlet.md +46 -0
- package/docs/wiki/compiled/concept-session-persistence.md +41 -0
- package/docs/wiki/compiled/concept-shape-animations.md +66 -0
- package/docs/wiki/compiled/concept-skeleton-auto.md +58 -0
- package/docs/wiki/compiled/concept-skeleton-manual.md +47 -0
- package/docs/wiki/compiled/concept-source-of-truth-references.md +37 -0
- package/docs/wiki/compiled/concept-source-reading-misleading.md +37 -0
- package/docs/wiki/compiled/concept-spatial-map-editor.md +22 -0
- package/docs/wiki/compiled/concept-spatial-map-zones.md +18 -0
- package/docs/wiki/compiled/concept-spec-engine.md +47 -0
- package/docs/wiki/compiled/concept-spec-store-interface.md +59 -0
- package/docs/wiki/compiled/concept-spec-store-layering.md +51 -0
- package/docs/wiki/compiled/concept-spec-stores-catalog.md +66 -0
- package/docs/wiki/compiled/concept-spec-structure.md +94 -0
- package/docs/wiki/compiled/concept-spec-types.md +76 -0
- package/docs/wiki/compiled/concept-state-change-animation.md +73 -0
- package/docs/wiki/compiled/concept-state-policies.md +44 -0
- package/docs/wiki/compiled/concept-state-protection.md +51 -0
- package/docs/wiki/compiled/concept-storage-adapter.md +69 -0
- package/docs/wiki/compiled/concept-storage-custom-names.md +69 -0
- package/docs/wiki/compiled/concept-storage-evolution.md +32 -0
- package/docs/wiki/compiled/concept-storage-idempotency.md +35 -0
- package/docs/wiki/compiled/concept-storage-overview.md +81 -0
- package/docs/wiki/compiled/concept-storage-postgres-jsonb.md +53 -0
- package/docs/wiki/compiled/concept-storage-postgres-triggers.md +60 -0
- package/docs/wiki/compiled/concept-storage-table-environments.md +40 -0
- package/docs/wiki/compiled/concept-storage-table-screens.md +44 -0
- package/docs/wiki/compiled/concept-storage-table-versions.md +50 -0
- package/docs/wiki/compiled/concept-storage-verification.md +57 -0
- package/docs/wiki/compiled/concept-template-children-marker.md +56 -0
- package/docs/wiki/compiled/concept-template-interpolation.md +60 -0
- package/docs/wiki/compiled/concept-templates-vs-variants.md +80 -0
- package/docs/wiki/compiled/concept-templates.md +93 -0
- package/docs/wiki/compiled/concept-token-categories.md +58 -0
- package/docs/wiki/compiled/concept-token-system.md +61 -0
- package/docs/wiki/compiled/concept-transaction-phase-timing.md +47 -0
- package/docs/wiki/compiled/concept-transaction-rollback.md +38 -0
- package/docs/wiki/compiled/concept-transaction-snapshot.md +37 -0
- package/docs/wiki/compiled/concept-transactions.md +72 -0
- package/docs/wiki/compiled/concept-validation-checks.md +63 -0
- package/docs/wiki/compiled/concept-validators-catalog.md +76 -0
- package/docs/wiki/compiled/concept-versioned-store.md +65 -0
- package/docs/wiki/compiled/concept-versioning-snapshots-patches.md +61 -0
- package/docs/wiki/compiled/concept-visibility.md +55 -0
- package/docs/wiki/compiled/concept-web-only-recipes.md +37 -0
- package/docs/wiki/compiled/concept-where-to-look.md +78 -0
- package/docs/wiki/compiled/expression-and-or-not.md +68 -0
- package/docs/wiki/compiled/expression-array.md +111 -0
- package/docs/wiki/compiled/expression-auth.md +83 -0
- package/docs/wiki/compiled/expression-binditem.md +52 -0
- package/docs/wiki/compiled/expression-bindstate.md +63 -0
- package/docs/wiki/compiled/expression-breakpoint.md +71 -0
- package/docs/wiki/compiled/expression-computed.md +52 -0
- package/docs/wiki/compiled/expression-cond.md +78 -0
- package/docs/wiki/compiled/expression-date.md +66 -0
- package/docs/wiki/compiled/expression-format.md +79 -0
- package/docs/wiki/compiled/expression-group.md +84 -0
- package/docs/wiki/compiled/expression-i18n.md +53 -0
- package/docs/wiki/compiled/expression-item-index.md +72 -0
- package/docs/wiki/compiled/expression-let-ref.md +87 -0
- package/docs/wiki/compiled/expression-math.md +67 -0
- package/docs/wiki/compiled/expression-platform.md +68 -0
- package/docs/wiki/compiled/expression-prop.md +89 -0
- package/docs/wiki/compiled/expression-selection.md +58 -0
- package/docs/wiki/compiled/expression-state.md +70 -0
- package/docs/wiki/compiled/expression-switch.md +68 -0
- package/docs/wiki/compiled/expression-template.md +71 -0
- package/docs/wiki/compiled/expression-token.md +67 -0
- package/docs/wiki/compiled/path-app-screens.md +55 -0
- package/docs/wiki/compiled/path-data-source-paths.md +44 -0
- package/docs/wiki/compiled/path-forms.md +38 -0
- package/docs/wiki/compiled/path-login.md +57 -0
- package/docs/wiki/compiled/path-navigation.md +62 -0
- package/docs/wiki/compiled/path-presets-available.md +44 -0
- package/docs/wiki/compiled/path-tokens.md +56 -0
- package/docs/wiki/compiled/path-tx-result-error.md +56 -0
- package/docs/wiki/compiled/path-ui-device.md +53 -0
- package/docs/wiki/compiled/path-ui-loading-error.md +40 -0
- package/docs/wiki/compiled/path-ui-modals-drawers.md +46 -0
- package/docs/wiki/compiled/path-ui-selected-row.md +92 -0
- package/docs/wiki/compiled/path-uploads.md +32 -0
- package/docs/wiki/compiled/pattern-cross-screen-data-flow.md +83 -0
- package/docs/wiki/compiled/pattern-fetch-vs-datasources.md +63 -0
- package/docs/wiki/compiled/pattern-file-upload-auto.md +61 -0
- package/docs/wiki/compiled/pattern-file-upload-manual.md +59 -0
- package/docs/wiki/compiled/pattern-form-validation-cross-field.md +58 -0
- package/docs/wiki/compiled/pattern-form-validation.md +58 -0
- package/docs/wiki/compiled/pattern-fullstack-coherence.md +49 -0
- package/docs/wiki/compiled/pattern-git-vs-db-versioning.md +55 -0
- package/docs/wiki/compiled/pattern-identity-aware-spec.md +70 -0
- package/docs/wiki/compiled/pattern-loading-content-empty.md +66 -0
- package/docs/wiki/compiled/pattern-login-body-template.md +47 -0
- package/docs/wiki/compiled/pattern-login-screen.md +83 -0
- package/docs/wiki/compiled/pattern-push-vs-patch.md +54 -0
- package/docs/wiki/compiled/pattern-reusable-components.md +67 -0
- package/docs/wiki/compiled/pattern-tx-create.md +76 -0
- package/docs/wiki/compiled/pattern-tx-delete.md +50 -0
- package/docs/wiki/compiled/pattern-tx-toggle.md +45 -0
- package/docs/wiki/compiled/pattern-tx-update.md +68 -0
- package/docs/wiki/compiled/primitive-accordion.md +46 -0
- package/docs/wiki/compiled/primitive-area-chart.md +35 -0
- package/docs/wiki/compiled/primitive-audio-player.md +27 -0
- package/docs/wiki/compiled/primitive-bar-chart.md +34 -0
- package/docs/wiki/compiled/primitive-box.md +58 -0
- package/docs/wiki/compiled/primitive-button.md +55 -0
- package/docs/wiki/compiled/primitive-camera.md +39 -0
- package/docs/wiki/compiled/primitive-checkbox.md +62 -0
- package/docs/wiki/compiled/primitive-divider.md +31 -0
- package/docs/wiki/compiled/primitive-drawer.md +44 -0
- package/docs/wiki/compiled/primitive-file-upload.md +65 -0
- package/docs/wiki/compiled/primitive-grid.md +48 -0
- package/docs/wiki/compiled/primitive-icon.md +106 -0
- package/docs/wiki/compiled/primitive-image.md +49 -0
- package/docs/wiki/compiled/primitive-input.md +81 -0
- package/docs/wiki/compiled/primitive-kanban-board.md +30 -0
- package/docs/wiki/compiled/primitive-line-chart.md +33 -0
- package/docs/wiki/compiled/primitive-list.md +34 -0
- package/docs/wiki/compiled/primitive-modal.md +51 -0
- package/docs/wiki/compiled/primitive-pie-chart.md +32 -0
- package/docs/wiki/compiled/primitive-screen-outlet.md +42 -0
- package/docs/wiki/compiled/primitive-screen.md +43 -0
- package/docs/wiki/compiled/primitive-scroll.md +33 -0
- package/docs/wiki/compiled/primitive-select.md +76 -0
- package/docs/wiki/compiled/primitive-signature.md +40 -0
- package/docs/wiki/compiled/primitive-skeleton.md +48 -0
- package/docs/wiki/compiled/primitive-slider.md +47 -0
- package/docs/wiki/compiled/primitive-spacer.md +33 -0
- package/docs/wiki/compiled/primitive-spatial-map.md +26 -0
- package/docs/wiki/compiled/primitive-stack.md +46 -0
- package/docs/wiki/compiled/primitive-table.md +127 -0
- package/docs/wiki/compiled/primitive-tabs.md +52 -0
- package/docs/wiki/compiled/primitive-text.md +59 -0
- package/docs/wiki/compiled/primitive-textarea.md +44 -0
- package/docs/wiki/compiled/primitive-toast-container.md +44 -0
- package/docs/wiki/compiled/primitive-toggle.md +46 -0
- package/docs/wiki/compiled/primitive-touchable.md +40 -0
- package/docs/wiki/compiled/primitive-wizard.md +43 -0
- package/package.json +58 -8
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import type { ElementAnimations } from './types.js';
|
|
2
|
+
import type { BlobInstance } from '../background/blobs/types.js';
|
|
3
|
+
/**
|
|
4
|
+
* Hard cap on animations per trigger (array length). Exported for consumers
|
|
5
|
+
* that need to allocate per-trigger pools matching the validator (e.g. RN
|
|
6
|
+
* runners using `useSharedValueArray(HARD_PER_TRIGGER)`) — centralizing
|
|
7
|
+
* here prevents pool/validator drift when the cap changes.
|
|
8
|
+
*/
|
|
9
|
+
export declare const HARD_PER_TRIGGER = 6;
|
|
10
|
+
export type AnimationValidationResult = {
|
|
11
|
+
warnings: string[];
|
|
12
|
+
errors: string[];
|
|
13
|
+
};
|
|
14
|
+
export declare function validateAnimationCaps(animations: ElementAnimations): AnimationValidationResult;
|
|
15
|
+
/**
|
|
16
|
+
* Input surface for validateBackgroundCaps. Deliberately narrower than the
|
|
17
|
+
* full LayerBackground type — we only need counts and per-blob cap-relevant
|
|
18
|
+
* fields. Callers pass the relevant slice of their background config.
|
|
19
|
+
*/
|
|
20
|
+
export interface BackgroundValidationInput {
|
|
21
|
+
blobs?: readonly BlobInstance[];
|
|
22
|
+
/**
|
|
23
|
+
* Background layers. Only the length is examined; the `type` tag is kept
|
|
24
|
+
* in the type to keep the input surface self-documenting (it's always a
|
|
25
|
+
* LayerBackground.layers slice in practice).
|
|
26
|
+
*/
|
|
27
|
+
layers?: ReadonlyArray<{
|
|
28
|
+
type: string;
|
|
29
|
+
}>;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Validate a background-layer spec against per-layer and per-blob caps.
|
|
33
|
+
*
|
|
34
|
+
* Threshold semantics: strictly-over (`>` not `>=`). `blobsSoft=8` means
|
|
35
|
+
* "up to 8 blobs is fine; 9+ warns"; `blobsHard=16` means "up to 16 is
|
|
36
|
+
* tolerable; 17+ errors". See file-header note on why this differs from
|
|
37
|
+
* validateAnimationCaps' `>=` convention.
|
|
38
|
+
*
|
|
39
|
+
* Motion-dimension hard cap (3) is effectively unreachable via a
|
|
40
|
+
* well-typed BlobInstance.motion (which admits only 3 keys) — kept for
|
|
41
|
+
* pattern symmetry and as a sentinel if a future dimension is added.
|
|
42
|
+
*/
|
|
43
|
+
export declare function validateBackgroundCaps(input: BackgroundValidationInput): AnimationValidationResult;
|
|
44
|
+
//# sourceMappingURL=validator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validator.d.ts","sourceRoot":"","sources":["../../../src/design/animation/validator.ts"],"names":[],"mappings":"AA4BA,OAAO,KAAK,EAAE,iBAAiB,EAAwD,MAAM,YAAY,CAAC;AAC1G,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAiBjE;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,IAAI,CAAC;AAIlC,MAAM,MAAM,yBAAyB,GAAG;IACtC,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB,CAAC;AAEF,wBAAgB,qBAAqB,CAAC,UAAU,EAAE,iBAAiB,GAAG,yBAAyB,CA+C9F;AAID;;;;GAIG;AACH,MAAM,WAAW,yBAAyB;IACxC,KAAK,CAAC,EAAE,SAAS,YAAY,EAAE,CAAC;IAChC;;;;OAIG;IACH,MAAM,CAAC,EAAE,aAAa,CAAC;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CAC1C;AA0BD;;;;;;;;;;;GAWG;AACH,wBAAgB,sBAAsB,CACpC,KAAK,EAAE,yBAAyB,GAC/B,yBAAyB,CA+D3B"}
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
// Validator — soft/hard performance gates per master design spec.
|
|
2
|
+
//
|
|
3
|
+
// Two separate exported functions (same file, shared result shape):
|
|
4
|
+
//
|
|
5
|
+
// - validateAnimationCaps: per-element animation caps
|
|
6
|
+
// animations per trigger (array length): soft=3, hard=6 (>= semantics)
|
|
7
|
+
// triggers with animations per element: soft=5, hard=7 (= all triggers)
|
|
8
|
+
// Also: web-only-recipe discoverability warnings.
|
|
9
|
+
//
|
|
10
|
+
// - validateBackgroundCaps (Task 9): per-background-layer caps
|
|
11
|
+
// blobs per background: soft=8, hard=16 (> semantics)
|
|
12
|
+
// layers per background: soft=6, hard=10 (> semantics)
|
|
13
|
+
// custom-svg path length (chars): soft=500, hard=2000 (> semantics)
|
|
14
|
+
// motion dimensions per blob: soft=2, hard=3 (> semantics)
|
|
15
|
+
//
|
|
16
|
+
// Note the threshold semantics asymmetry:
|
|
17
|
+
// validateAnimationCaps uses `length >= CAP` (at-or-over the cap triggers).
|
|
18
|
+
// validateBackgroundCaps uses `length > CAP` (strictly above the cap
|
|
19
|
+
// triggers). The design spec tables for plan 2 vs plan 3 name the caps
|
|
20
|
+
// differently: plan 2's SOFT_PER_TRIGGER=3 means "at length 3, warn"
|
|
21
|
+
// (so length 2 is fine); plan 3's blobsSoft=8 means "up to 8 is fine,
|
|
22
|
+
// 9+ warn" (so length 8 is at the cap, not over). Keeping both literal
|
|
23
|
+
// per their specs; the soft/hard field names document the boundary in
|
|
24
|
+
// each context.
|
|
25
|
+
//
|
|
26
|
+
// The caller decides whether to log warnings, throw on errors, or fail the
|
|
27
|
+
// spec (e.g. `mythik validate` typically logs warnings and errors both).
|
|
28
|
+
import { WEB_ONLY_RECIPES } from '../recipes/animations.js';
|
|
29
|
+
function collectRecipeNames(value) {
|
|
30
|
+
const items = Array.isArray(value) ? value : [value];
|
|
31
|
+
const names = [];
|
|
32
|
+
for (const item of items) {
|
|
33
|
+
// AnimationRef and StateChangeAnimation both have an optional `recipe` field
|
|
34
|
+
const recipe = item.recipe;
|
|
35
|
+
if (typeof recipe === 'string')
|
|
36
|
+
names.push(recipe);
|
|
37
|
+
}
|
|
38
|
+
return names;
|
|
39
|
+
}
|
|
40
|
+
const SOFT_PER_TRIGGER = 3;
|
|
41
|
+
/**
|
|
42
|
+
* Hard cap on animations per trigger (array length). Exported for consumers
|
|
43
|
+
* that need to allocate per-trigger pools matching the validator (e.g. RN
|
|
44
|
+
* runners using `useSharedValueArray(HARD_PER_TRIGGER)`) — centralizing
|
|
45
|
+
* here prevents pool/validator drift when the cap changes.
|
|
46
|
+
*/
|
|
47
|
+
export const HARD_PER_TRIGGER = 6;
|
|
48
|
+
const SOFT_TRIGGERS = 5;
|
|
49
|
+
const HARD_TRIGGERS = 7;
|
|
50
|
+
export function validateAnimationCaps(animations) {
|
|
51
|
+
const warnings = [];
|
|
52
|
+
const errors = [];
|
|
53
|
+
const triggers = [
|
|
54
|
+
'mount', 'unmount', 'hover', 'focus', 'active', 'ambient', 'stateChange',
|
|
55
|
+
];
|
|
56
|
+
let activeTriggerCount = 0;
|
|
57
|
+
for (const t of triggers) {
|
|
58
|
+
const val = animations[t];
|
|
59
|
+
if (val === undefined || val === null)
|
|
60
|
+
continue;
|
|
61
|
+
activeTriggerCount++;
|
|
62
|
+
const length = Array.isArray(val) ? val.length : 1;
|
|
63
|
+
if (length >= HARD_PER_TRIGGER) {
|
|
64
|
+
errors.push(`trigger '${t}' has ${length} animations — hard-cap (${HARD_PER_TRIGGER}) exceeded; split into multiple elements or compose into a single animation with more keyframes`);
|
|
65
|
+
}
|
|
66
|
+
else if (length >= SOFT_PER_TRIGGER) {
|
|
67
|
+
warnings.push(`trigger '${t}' has ${length} animations — soft-cap (${SOFT_PER_TRIGGER}) reached; review whether all are necessary`);
|
|
68
|
+
}
|
|
69
|
+
// Web-only recipe warning — silent no-op on RN until plan-3+ adds mapping.
|
|
70
|
+
for (const recipe of collectRecipeNames(val)) {
|
|
71
|
+
if (WEB_ONLY_RECIPES.has(recipe)) {
|
|
72
|
+
warnings.push(`trigger '${t}' uses web-only recipe '${recipe}' — no visual effect on React Native until per-platform shadow/filter mapping is added`);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
if (activeTriggerCount >= HARD_TRIGGERS) {
|
|
77
|
+
errors.push(`element has ${activeTriggerCount} triggers with animations — hard-cap (${HARD_TRIGGERS}) exceeded; remove non-essential triggers`);
|
|
78
|
+
}
|
|
79
|
+
else if (activeTriggerCount >= SOFT_TRIGGERS) {
|
|
80
|
+
warnings.push(`element has ${activeTriggerCount} triggers with animations — soft-cap (${SOFT_TRIGGERS}) reached; consider consolidating`);
|
|
81
|
+
}
|
|
82
|
+
return { warnings, errors };
|
|
83
|
+
}
|
|
84
|
+
const BG_CAPS = {
|
|
85
|
+
blobsSoft: 8,
|
|
86
|
+
blobsHard: 16,
|
|
87
|
+
layersSoft: 6,
|
|
88
|
+
layersHard: 10,
|
|
89
|
+
customSvgPathSoft: 500,
|
|
90
|
+
customSvgPathHard: 2000,
|
|
91
|
+
motionDimsSoft: 2,
|
|
92
|
+
motionDimsHard: 3,
|
|
93
|
+
};
|
|
94
|
+
function countMotionDimensions(motion) {
|
|
95
|
+
if (!motion)
|
|
96
|
+
return 0;
|
|
97
|
+
// Explicit field checks (not `Object.values(motion).filter(Boolean)`)
|
|
98
|
+
// because the union admits only three keys — a literal check is both
|
|
99
|
+
// exhaustive and survives schema evolution (missing a new key here would
|
|
100
|
+
// need an intentional update, not silently undercount).
|
|
101
|
+
let n = 0;
|
|
102
|
+
if (motion.drift)
|
|
103
|
+
n++;
|
|
104
|
+
if (motion.rotate)
|
|
105
|
+
n++;
|
|
106
|
+
if (motion.scale)
|
|
107
|
+
n++;
|
|
108
|
+
return n;
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Validate a background-layer spec against per-layer and per-blob caps.
|
|
112
|
+
*
|
|
113
|
+
* Threshold semantics: strictly-over (`>` not `>=`). `blobsSoft=8` means
|
|
114
|
+
* "up to 8 blobs is fine; 9+ warns"; `blobsHard=16` means "up to 16 is
|
|
115
|
+
* tolerable; 17+ errors". See file-header note on why this differs from
|
|
116
|
+
* validateAnimationCaps' `>=` convention.
|
|
117
|
+
*
|
|
118
|
+
* Motion-dimension hard cap (3) is effectively unreachable via a
|
|
119
|
+
* well-typed BlobInstance.motion (which admits only 3 keys) — kept for
|
|
120
|
+
* pattern symmetry and as a sentinel if a future dimension is added.
|
|
121
|
+
*/
|
|
122
|
+
export function validateBackgroundCaps(input) {
|
|
123
|
+
const warnings = [];
|
|
124
|
+
const errors = [];
|
|
125
|
+
const blobs = input.blobs ?? [];
|
|
126
|
+
if (blobs.length > BG_CAPS.blobsHard) {
|
|
127
|
+
errors.push(`blobs per background: ${blobs.length} exceeds hard-cap (${BG_CAPS.blobsHard}); split across multiple backgrounds or reduce count`);
|
|
128
|
+
}
|
|
129
|
+
else if (blobs.length > BG_CAPS.blobsSoft) {
|
|
130
|
+
warnings.push(`blobs per background: ${blobs.length} exceeds soft-cap (${BG_CAPS.blobsSoft}); review whether all are necessary`);
|
|
131
|
+
}
|
|
132
|
+
const layers = input.layers ?? [];
|
|
133
|
+
if (layers.length > BG_CAPS.layersHard) {
|
|
134
|
+
errors.push(`layers per background: ${layers.length} exceeds hard-cap (${BG_CAPS.layersHard}); consolidate layers or split across backgrounds`);
|
|
135
|
+
}
|
|
136
|
+
else if (layers.length > BG_CAPS.layersSoft) {
|
|
137
|
+
warnings.push(`layers per background: ${layers.length} exceeds soft-cap (${BG_CAPS.layersSoft}); review whether all are necessary`);
|
|
138
|
+
}
|
|
139
|
+
for (const blob of blobs) {
|
|
140
|
+
// custom-svg path length — only meaningful when the path came from a
|
|
141
|
+
// consumer. Curated shapes have their own catalog-sourced paths whose
|
|
142
|
+
// length is controlled by the framework, not the spec author.
|
|
143
|
+
if (blob.shape === 'custom-svg' && typeof blob.path === 'string') {
|
|
144
|
+
const len = blob.path.length;
|
|
145
|
+
if (len > BG_CAPS.customSvgPathHard) {
|
|
146
|
+
errors.push(`custom-svg path length: ${len} chars exceeds hard-cap (${BG_CAPS.customSvgPathHard}); simplify the path geometry`);
|
|
147
|
+
}
|
|
148
|
+
else if (len > BG_CAPS.customSvgPathSoft) {
|
|
149
|
+
warnings.push(`custom-svg path length: ${len} chars exceeds soft-cap (${BG_CAPS.customSvgPathSoft}); consider simplifying the path`);
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
const dims = countMotionDimensions(blob.motion);
|
|
153
|
+
// The hard-cap branch below is structurally unreachable via a
|
|
154
|
+
// well-typed BlobMotion (only three keys exist, so `dims` maxes at 3,
|
|
155
|
+
// equal to motionDimsHard; `>` requires strictly greater). Kept as a
|
|
156
|
+
// sentinel: if a future contributor adds a fourth motion dimension,
|
|
157
|
+
// bumping motionDimsHard here is the natural next step, and the
|
|
158
|
+
// path activates immediately.
|
|
159
|
+
/* c8 ignore next 4 — unreachable via well-typed input; sentinel branch */
|
|
160
|
+
if (dims > BG_CAPS.motionDimsHard) {
|
|
161
|
+
errors.push(`motion dimensions per blob: ${dims} exceeds hard-cap (${BG_CAPS.motionDimsHard}); remove non-essential motion`);
|
|
162
|
+
}
|
|
163
|
+
else if (dims > BG_CAPS.motionDimsSoft) {
|
|
164
|
+
warnings.push(`motion dimensions per blob: ${dims} exceeds soft-cap (${BG_CAPS.motionDimsSoft}); drift+rotate+scale together is visually heavy`);
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
return { warnings, errors };
|
|
168
|
+
}
|
|
169
|
+
//# sourceMappingURL=validator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validator.js","sourceRoot":"","sources":["../../../src/design/animation/validator.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export type BlobShapeName = 'organic-1' | 'organic-2' | 'organic-3' | 'organic-4' | 'organic-5' | 'circle' | 'custom-svg';
|
|
2
|
+
/** Names of catalog-backed shapes (excludes the user-provided `custom-svg`). */
|
|
3
|
+
export type CuratedBlobName = Exclude<BlobShapeName, 'custom-svg'>;
|
|
4
|
+
export interface BlobShapeDef {
|
|
5
|
+
name: BlobShapeName;
|
|
6
|
+
viewBox: string;
|
|
7
|
+
path: string;
|
|
8
|
+
}
|
|
9
|
+
export declare const BLOB_CATALOG: Record<CuratedBlobName, BlobShapeDef>;
|
|
10
|
+
//# sourceMappingURL=catalog.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"catalog.d.ts","sourceRoot":"","sources":["../../../../src/design/background/blobs/catalog.ts"],"names":[],"mappings":"AAuBA,MAAM,MAAM,aAAa,GACrB,WAAW,GACX,WAAW,GACX,WAAW,GACX,WAAW,GACX,WAAW,GACX,QAAQ,GACR,YAAY,CAAC;AAEjB,gFAAgF;AAChF,MAAM,MAAM,eAAe,GAAG,OAAO,CAAC,aAAa,EAAE,YAAY,CAAC,CAAC;AAEnE,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,aAAa,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;CACd;AAED,eAAO,MAAM,YAAY,EAAE,MAAM,CAAC,eAAe,EAAE,YAAY,CAuC9D,CAAC"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
// Blob v2 — curated SVG shape catalog (plan 3 Task 5).
|
|
2
|
+
//
|
|
3
|
+
// Five hand-curated organic shapes + a perfect circle. `custom-svg` is a
|
|
4
|
+
// sentinel value for the `BlobShapeName` union; it does NOT appear in this
|
|
5
|
+
// catalog map — callers passing `shape: 'custom-svg'` must supply their own
|
|
6
|
+
// path + viewBox (sanitized by resolveBlobLayer).
|
|
7
|
+
//
|
|
8
|
+
// Coordinate system: every curated shape uses the canonical `0 0 100 100`
|
|
9
|
+
// viewBox so that `size` (px/%) scales predictably. Paths always close with
|
|
10
|
+
// `Z` to guarantee fill behavior is well-defined regardless of the renderer.
|
|
11
|
+
//
|
|
12
|
+
// Aesthetic intent (informal — no literal copies of third-party assets):
|
|
13
|
+
// organic-1 → balanced rounded blob (four convex cubic segments)
|
|
14
|
+
// organic-2 → elongated diagonal blob (offset center of mass)
|
|
15
|
+
// organic-3 → asymmetric multi-lobe (all-cubic to avoid T-reflection cusps)
|
|
16
|
+
// organic-4 → horizontal flowing ribbon
|
|
17
|
+
// organic-5 → sharply asymmetric with one extended lobe
|
|
18
|
+
//
|
|
19
|
+
// Adding a new curated shape requires:
|
|
20
|
+
// 1. Adding the member to `BlobShapeName` (union)
|
|
21
|
+
// 2. Adding the catalog entry (viewBox + path)
|
|
22
|
+
// 3. The type system enforces the map key matches `BlobShapeName` minus 'custom-svg'
|
|
23
|
+
export const BLOB_CATALOG = {
|
|
24
|
+
'organic-1': {
|
|
25
|
+
name: 'organic-1',
|
|
26
|
+
viewBox: '0 0 100 100',
|
|
27
|
+
path: 'M50,10 C70,10 90,25 90,50 C90,70 75,90 55,90 C30,90 10,75 10,50 C10,28 28,10 50,10 Z',
|
|
28
|
+
},
|
|
29
|
+
'organic-2': {
|
|
30
|
+
name: 'organic-2',
|
|
31
|
+
viewBox: '0 0 100 100',
|
|
32
|
+
path: 'M20,25 C35,10 65,15 80,30 C90,45 85,65 70,80 C55,95 30,90 15,75 C5,55 10,40 20,25 Z',
|
|
33
|
+
},
|
|
34
|
+
// All-cubic path — avoids T-reflection cusp at the closure point that the
|
|
35
|
+
// previous Q+T variant risked producing. Asymmetric bounding box still
|
|
36
|
+
// yields a distinctive multi-lobe silhouette.
|
|
37
|
+
'organic-3': {
|
|
38
|
+
name: 'organic-3',
|
|
39
|
+
viewBox: '0 0 100 100',
|
|
40
|
+
path: 'M60,12 C82,18 92,36 84,58 C78,82 50,92 35,82 C18,72 12,50 22,34 C30,22 46,8 60,12 Z',
|
|
41
|
+
},
|
|
42
|
+
'organic-4': {
|
|
43
|
+
name: 'organic-4',
|
|
44
|
+
viewBox: '0 0 100 100',
|
|
45
|
+
path: 'M10,45 C25,25 45,35 55,50 C65,65 85,55 90,70 C75,90 45,85 30,75 C15,70 5,60 10,45 Z',
|
|
46
|
+
},
|
|
47
|
+
// Sharply asymmetric — one extended lower-right lobe reaching to x=95,
|
|
48
|
+
// compensated by an inset at upper-right (x=62). Intentionally reads as a
|
|
49
|
+
// distinct silhouette from organic-1 (which is near-convex and balanced).
|
|
50
|
+
'organic-5': {
|
|
51
|
+
name: 'organic-5',
|
|
52
|
+
viewBox: '0 0 100 100',
|
|
53
|
+
path: 'M18,20 C40,8 62,16 70,30 C58,42 70,58 95,68 C82,88 50,90 32,78 C12,66 5,42 18,20 Z',
|
|
54
|
+
},
|
|
55
|
+
// Single-subpath canonical circle. M moves to the leftmost point, two
|
|
56
|
+
// relative arcs each trace 180°; Z is meaningful (returns to M).
|
|
57
|
+
circle: {
|
|
58
|
+
name: 'circle',
|
|
59
|
+
viewBox: '0 0 100 100',
|
|
60
|
+
path: 'M5,50 a45,45 0 1,0 90,0 a45,45 0 1,0 -90,0 Z',
|
|
61
|
+
},
|
|
62
|
+
};
|
|
63
|
+
//# sourceMappingURL=catalog.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"catalog.js","sourceRoot":"","sources":["../../../../src/design/background/blobs/catalog.ts"],"names":[],"mappings":"AAAA,uDAAuD;AACvD,EAAE;AACF,yEAAyE;AACzE,2EAA2E;AAC3E,4EAA4E;AAC5E,kDAAkD;AAClD,EAAE;AACF,0EAA0E;AAC1E,4EAA4E;AAC5E,6EAA6E;AAC7E,EAAE;AACF,yEAAyE;AACzE,mEAAmE;AACnE,gEAAgE;AAChE,8EAA8E;AAC9E,0CAA0C;AAC1C,0DAA0D;AAC1D,EAAE;AACF,uCAAuC;AACvC,oDAAoD;AACpD,iDAAiD;AACjD,uFAAuF;AAoBvF,MAAM,CAAC,MAAM,YAAY,GAA0C;IACjE,WAAW,EAAE;QACX,IAAI,EAAE,WAAW;QACjB,OAAO,EAAE,aAAa;QACtB,IAAI,EAAE,sFAAsF;KAC7F;IACD,WAAW,EAAE;QACX,IAAI,EAAE,WAAW;QACjB,OAAO,EAAE,aAAa;QACtB,IAAI,EAAE,qFAAqF;KAC5F;IACD,0EAA0E;IAC1E,uEAAuE;IACvE,8CAA8C;IAC9C,WAAW,EAAE;QACX,IAAI,EAAE,WAAW;QACjB,OAAO,EAAE,aAAa;QACtB,IAAI,EAAE,qFAAqF;KAC5F;IACD,WAAW,EAAE;QACX,IAAI,EAAE,WAAW;QACjB,OAAO,EAAE,aAAa;QACtB,IAAI,EAAE,qFAAqF;KAC5F;IACD,uEAAuE;IACvE,0EAA0E;IAC1E,0EAA0E;IAC1E,WAAW,EAAE;QACX,IAAI,EAAE,WAAW;QACjB,OAAO,EAAE,aAAa;QACtB,IAAI,EAAE,oFAAoF;KAC3F;IACD,sEAAsE;IACtE,iEAAiE;IACjE,MAAM,EAAE;QACN,IAAI,EAAE,QAAQ;QACd,OAAO,EAAE,aAAa;QACtB,IAAI,EAAE,8CAA8C;KACrD;CACF,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/design/background/blobs/index.ts"],"names":[],"mappings":"AACA,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/design/background/blobs/index.ts"],"names":[],"mappings":"AAAA,qCAAqC;AACrC,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { BlobSpec, BlobV2Config } from './types.js';
|
|
2
|
+
interface Palette {
|
|
3
|
+
primary: string;
|
|
4
|
+
accent: string;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Convert a BlobV2Config into an array of render-ready BlobSpec entries.
|
|
8
|
+
*
|
|
9
|
+
* Ordering: explicit-form blobs are emitted in the same order as the input
|
|
10
|
+
* array. Preset-form blobs are emitted in preset-defined order (Task 8).
|
|
11
|
+
*
|
|
12
|
+
* Ambiguous inputs ({ preset, blobs } both set): preset wins, dev warning.
|
|
13
|
+
*/
|
|
14
|
+
export declare function resolveBlobLayer(config: BlobV2Config, palette: Palette): BlobSpec[];
|
|
15
|
+
export {};
|
|
16
|
+
//# sourceMappingURL=resolver.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolver.d.ts","sourceRoot":"","sources":["../../../../src/design/background/blobs/resolver.ts"],"names":[],"mappings":"AAoDA,OAAO,KAAK,EAMV,QAAQ,EACR,YAAY,EACb,MAAM,YAAY,CAAC;AASpB,UAAU,OAAO;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;CAChB;AAqND;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAC9B,MAAM,EAAE,YAAY,EACpB,OAAO,EAAE,OAAO,GACf,QAAQ,EAAE,CAuEZ"}
|
|
@@ -0,0 +1,301 @@
|
|
|
1
|
+
// Blob v2 — resolver (plan 3 Task 7 + 8).
|
|
2
|
+
//
|
|
3
|
+
// Pure function that converts a BlobV2Config into an array of BlobSpec ready
|
|
4
|
+
// to render. Two input forms:
|
|
5
|
+
//
|
|
6
|
+
// 1. Explicit form (BlobV2Config.blobs[]): consumer declares each blob. The
|
|
7
|
+
// resolver applies defaults (opacity 1, blur 0), resolves palette
|
|
8
|
+
// keywords, looks up catalog shapes, and converts motion dimensions
|
|
9
|
+
// into ElementAnimations.ambient entries (Task 8).
|
|
10
|
+
//
|
|
11
|
+
// 2. Preset form (BlobV2Config.preset + palette + motion preset): framework
|
|
12
|
+
// picks the shape/position/size composition from a small curated
|
|
13
|
+
// registry. Motion preset identifiers ('drift-gentle'/'drift-fluid'/
|
|
14
|
+
// 'drift-snappy'/'static') map to concrete BlobMotion values applied
|
|
15
|
+
// uniformly to every blob in the preset (Task 8).
|
|
16
|
+
//
|
|
17
|
+
// Ambiguous combinations ({ preset, blobs } both set): resolver prefers
|
|
18
|
+
// `preset` and logs a dev warning. Documented in types.ts.
|
|
19
|
+
//
|
|
20
|
+
// Motion → ElementAnimations.ambient conversion (Task 8):
|
|
21
|
+
// Each of the three independent motion dimensions (drift / rotate / scale)
|
|
22
|
+
// becomes one InlineAnimation:
|
|
23
|
+
// - drift: keyframes [0%/50%/100%] on translateX/Y; returns to origin via
|
|
24
|
+
// `direction: alternate` — symmetric (no visible snap-back).
|
|
25
|
+
// - rotate: keyframes [0%/100%] on rotate; alternate to avoid spinning.
|
|
26
|
+
// - scale: keyframes [0%/100%] on scale; alternate to breathe.
|
|
27
|
+
// All three use `iterations: 'infinite'` because blob motion is ambient
|
|
28
|
+
// (cosmetic, non-interactive, always on). When multiple dimensions are set
|
|
29
|
+
// we emit them as an array so the Layer 3 runner composes each on its own
|
|
30
|
+
// timeline. Single-dimension motion returns a scalar for ergonomics — the
|
|
31
|
+
// `AnimationRef | AnimationRef[]` union accepts both.
|
|
32
|
+
//
|
|
33
|
+
// Error policy (matches design spec "Error handling" table):
|
|
34
|
+
//
|
|
35
|
+
// - `shape: 'custom-svg'` requires both `path` and `viewBox`. Dev: throws
|
|
36
|
+
// with field-specific message to surface the bug immediately. Prod:
|
|
37
|
+
// skips the malformed blob + console.warn — preserves app stability.
|
|
38
|
+
// Rationale: specs in prod come from the DB (should have passed
|
|
39
|
+
// validation); a crash would take the whole app down over one bad blob.
|
|
40
|
+
//
|
|
41
|
+
// - Ambiguous { preset, blobs } both set: dev-only console.warn (no
|
|
42
|
+
// throw). Severity is lower than the custom-svg case because there's a
|
|
43
|
+
// defensible winner (preset), and no rendering is broken — just one
|
|
44
|
+
// of the two inputs is ignored. Contrast with useElementAnimations'
|
|
45
|
+
// mixed-key throw (Task 4): there, no defensible winner exists since
|
|
46
|
+
// trigger keys and context keys both carry meaning.
|
|
47
|
+
//
|
|
48
|
+
// - Everything else is permissive: missing palette entries, out-of-range
|
|
49
|
+
// opacities, etc. are passed through unmodified; validator (Task 9)
|
|
50
|
+
// catches caps.
|
|
51
|
+
import { BLOB_CATALOG } from './catalog.js';
|
|
52
|
+
const IS_DEV = process.env.NODE_ENV !== 'production';
|
|
53
|
+
function resolveColor(color, palette) {
|
|
54
|
+
if (color === 'primary')
|
|
55
|
+
return palette.primary;
|
|
56
|
+
if (color === 'accent')
|
|
57
|
+
return palette.accent;
|
|
58
|
+
return color;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Resolve a blob instance's shape to a complete BlobShapeDef.
|
|
62
|
+
*
|
|
63
|
+
* @returns BlobShapeDef on success.
|
|
64
|
+
* @returns null when the instance is malformed (custom-svg missing path or
|
|
65
|
+
* viewBox) in production — caller should skip this blob. In dev,
|
|
66
|
+
* throws instead to surface the malformation immediately.
|
|
67
|
+
*/
|
|
68
|
+
function resolveShape(instance) {
|
|
69
|
+
if (instance.shape === 'custom-svg') {
|
|
70
|
+
if (!instance.path) {
|
|
71
|
+
const msg = `resolveBlobLayer: shape='custom-svg' requires a non-empty path. ` +
|
|
72
|
+
`Got path=${JSON.stringify(instance.path)}.`;
|
|
73
|
+
if (IS_DEV)
|
|
74
|
+
throw new Error(msg);
|
|
75
|
+
// eslint-disable-next-line no-console
|
|
76
|
+
console.warn(msg);
|
|
77
|
+
return null;
|
|
78
|
+
}
|
|
79
|
+
if (!instance.viewBox) {
|
|
80
|
+
const msg = `resolveBlobLayer: shape='custom-svg' requires a non-empty viewBox. ` +
|
|
81
|
+
`Got viewBox=${JSON.stringify(instance.viewBox)}.`;
|
|
82
|
+
if (IS_DEV)
|
|
83
|
+
throw new Error(msg);
|
|
84
|
+
// eslint-disable-next-line no-console
|
|
85
|
+
console.warn(msg);
|
|
86
|
+
return null;
|
|
87
|
+
}
|
|
88
|
+
return {
|
|
89
|
+
name: 'custom-svg',
|
|
90
|
+
path: instance.path,
|
|
91
|
+
viewBox: instance.viewBox,
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
// Curated shape — catalog lookup is total over BlobShapeName minus
|
|
95
|
+
// 'custom-svg'. TS narrows `instance.shape` here.
|
|
96
|
+
return BLOB_CATALOG[instance.shape];
|
|
97
|
+
}
|
|
98
|
+
function resolveStyle(instance, palette) {
|
|
99
|
+
return {
|
|
100
|
+
position: instance.position,
|
|
101
|
+
size: instance.size,
|
|
102
|
+
rotation: instance.rotation,
|
|
103
|
+
color: resolveColor(instance.color, palette),
|
|
104
|
+
// `??` preserves explicit 0 (not treated as missing); 1 default matches
|
|
105
|
+
// "fully opaque" intuition. `?? 0` for blur aligns with "no blur by default".
|
|
106
|
+
opacity: instance.opacity ?? 1,
|
|
107
|
+
blur: instance.blur ?? 0,
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
// --- Motion → ElementAnimations.ambient conversion ------------------------
|
|
111
|
+
//
|
|
112
|
+
// Each dimension produces one InlineAnimation. All three use
|
|
113
|
+
// `direction: 'alternate'` for contract uniformity, but the effect differs:
|
|
114
|
+
//
|
|
115
|
+
// - drift: keyframes are already symmetric (0%→origin, 50%→max, 100%→origin).
|
|
116
|
+
// `alternate` reverses odd iterations; reversing a symmetric curve gives
|
|
117
|
+
// the same trajectory, so it's a no-op for drift *trajectory*. Kept for
|
|
118
|
+
// uniform contract across dimensions and to match the plan 2 reduced-
|
|
119
|
+
// motion semantics ("disable entirely" is the only binary switch needed).
|
|
120
|
+
//
|
|
121
|
+
// - rotate + scale: 2-point keyframes (from → to). Without `alternate`,
|
|
122
|
+
// iteration 2 would snap back to `from` and jump to `to` again — visible
|
|
123
|
+
// flicker. `alternate` plays iteration 2 as `to → from` reversed, giving
|
|
124
|
+
// a smooth breathing/oscillation cycle.
|
|
125
|
+
//
|
|
126
|
+
// Perceived cycle duration:
|
|
127
|
+
// - drift: 1 × `duration` (full symmetric out-and-back in one iteration).
|
|
128
|
+
// - rotate/scale: 2 × `duration` (iteration 1 forward + iteration 2 reverse
|
|
129
|
+
// completes the visible cycle).
|
|
130
|
+
//
|
|
131
|
+
// This asymmetry is intentional: `duration` names "the time the animation's
|
|
132
|
+
// own keyframe timeline takes", not "the visual cycle length". Consumers who
|
|
133
|
+
// want comparable cadence across dimensions should halve rotate/scale
|
|
134
|
+
// durations relative to drift.
|
|
135
|
+
function driftToInline(d) {
|
|
136
|
+
return {
|
|
137
|
+
keyframes: [
|
|
138
|
+
{ at: '0%', transform: { translateX: 0, translateY: 0 } },
|
|
139
|
+
{ at: '50%', transform: { translateX: d.range.x, translateY: d.range.y } },
|
|
140
|
+
{ at: '100%', transform: { translateX: 0, translateY: 0 } },
|
|
141
|
+
],
|
|
142
|
+
duration: d.duration,
|
|
143
|
+
easing: d.easing ?? 'ease-in-out',
|
|
144
|
+
iterations: 'infinite',
|
|
145
|
+
direction: 'alternate',
|
|
146
|
+
};
|
|
147
|
+
}
|
|
148
|
+
function rotateToInline(r) {
|
|
149
|
+
return {
|
|
150
|
+
keyframes: [
|
|
151
|
+
{ at: '0%', transform: { rotate: r.from } },
|
|
152
|
+
{ at: '100%', transform: { rotate: r.to } },
|
|
153
|
+
],
|
|
154
|
+
duration: r.duration,
|
|
155
|
+
easing: 'linear',
|
|
156
|
+
iterations: 'infinite',
|
|
157
|
+
direction: 'alternate',
|
|
158
|
+
};
|
|
159
|
+
}
|
|
160
|
+
function scaleToInline(s) {
|
|
161
|
+
return {
|
|
162
|
+
keyframes: [
|
|
163
|
+
{ at: '0%', transform: { scale: s.from } },
|
|
164
|
+
{ at: '100%', transform: { scale: s.to } },
|
|
165
|
+
],
|
|
166
|
+
duration: s.duration,
|
|
167
|
+
easing: 'ease-in-out',
|
|
168
|
+
iterations: 'infinite',
|
|
169
|
+
direction: 'alternate',
|
|
170
|
+
};
|
|
171
|
+
}
|
|
172
|
+
/**
|
|
173
|
+
* Convert a BlobMotion (or undefined) to ElementAnimations with only the
|
|
174
|
+
* `ambient` trigger populated. Returns null when there is no motion to emit
|
|
175
|
+
* so the caller can set `BlobSpec.animations = null` directly.
|
|
176
|
+
*
|
|
177
|
+
* Emission order is stable: drift → rotate → scale. Single-dimension motion
|
|
178
|
+
* returns a scalar `AnimationRef` (not a 1-element array) — `AnimationRef |
|
|
179
|
+
* AnimationRef[]` accepts both, and scalar is the more ergonomic default.
|
|
180
|
+
*/
|
|
181
|
+
function motionToAnimations(motion) {
|
|
182
|
+
if (!motion)
|
|
183
|
+
return null;
|
|
184
|
+
const entries = [];
|
|
185
|
+
if (motion.drift)
|
|
186
|
+
entries.push(driftToInline(motion.drift));
|
|
187
|
+
if (motion.rotate)
|
|
188
|
+
entries.push(rotateToInline(motion.rotate));
|
|
189
|
+
if (motion.scale)
|
|
190
|
+
entries.push(scaleToInline(motion.scale));
|
|
191
|
+
if (entries.length === 0)
|
|
192
|
+
return null;
|
|
193
|
+
return { ambient: entries.length === 1 ? entries[0] : entries };
|
|
194
|
+
}
|
|
195
|
+
const PRESET_SEEDS = {
|
|
196
|
+
'organic-duo': [
|
|
197
|
+
{ shape: 'organic-1', position: { x: '10%', y: '20%' }, size: { width: '420px', height: '360px' } },
|
|
198
|
+
{ shape: 'organic-3', position: { x: '60%', y: '55%' }, size: { width: '380px', height: '320px' } },
|
|
199
|
+
],
|
|
200
|
+
'organic-trio': [
|
|
201
|
+
{ shape: 'organic-1', position: { x: '5%', y: '15%' }, size: { width: '400px', height: '340px' } },
|
|
202
|
+
{ shape: 'organic-4', position: { x: '55%', y: '40%' }, size: { width: '360px', height: '300px' } },
|
|
203
|
+
{ shape: 'organic-5', position: { x: '30%', y: '70%' }, size: { width: '340px', height: '280px' } },
|
|
204
|
+
],
|
|
205
|
+
'circle-pair': [
|
|
206
|
+
{ shape: 'circle', position: { x: '15%', y: '25%' }, size: { width: '320px', height: '320px' } },
|
|
207
|
+
{ shape: 'circle', position: { x: '65%', y: '60%' }, size: { width: '280px', height: '280px' } },
|
|
208
|
+
],
|
|
209
|
+
};
|
|
210
|
+
// Motion presets — curated triples of (duration, range, easing). Design
|
|
211
|
+
// intent per preset:
|
|
212
|
+
// - drift-gentle: slow, small amplitude, default ease-in-out (organic feel).
|
|
213
|
+
// Ambient background, does not pull attention.
|
|
214
|
+
// - drift-fluid: medium-fast, wider amplitude, default ease-in-out.
|
|
215
|
+
// Lively but still organic (Stripe/Linear aesthetic).
|
|
216
|
+
// - drift-snappy: fast, medium amplitude, `linear` easing (mechanical/
|
|
217
|
+
// constant-velocity feel). Contrasts the gentle/fluid organic curves.
|
|
218
|
+
// drift-gentle and drift-fluid deliberately omit `easing` to inherit the
|
|
219
|
+
// ease-in-out default; drift-snappy overrides with linear.
|
|
220
|
+
const PRESET_MOTION = {
|
|
221
|
+
'drift-gentle': { drift: { duration: '28s', range: { x: 4, y: 3 } } },
|
|
222
|
+
'drift-fluid': { drift: { duration: '20s', range: { x: 8, y: 5 } } },
|
|
223
|
+
'drift-snappy': { drift: { duration: '14s', range: { x: 6, y: 4 }, easing: 'linear' } },
|
|
224
|
+
};
|
|
225
|
+
function resolvePresetMotion(preset) {
|
|
226
|
+
if (!preset || preset === 'static')
|
|
227
|
+
return undefined;
|
|
228
|
+
return PRESET_MOTION[preset];
|
|
229
|
+
}
|
|
230
|
+
/**
|
|
231
|
+
* Convert a BlobV2Config into an array of render-ready BlobSpec entries.
|
|
232
|
+
*
|
|
233
|
+
* Ordering: explicit-form blobs are emitted in the same order as the input
|
|
234
|
+
* array. Preset-form blobs are emitted in preset-defined order (Task 8).
|
|
235
|
+
*
|
|
236
|
+
* Ambiguous inputs ({ preset, blobs } both set): preset wins, dev warning.
|
|
237
|
+
*/
|
|
238
|
+
export function resolveBlobLayer(config, palette) {
|
|
239
|
+
// Preset form takes precedence when both are set. Dev warns on ambiguity.
|
|
240
|
+
if (config.preset !== undefined) {
|
|
241
|
+
if (IS_DEV &&
|
|
242
|
+
config.blobs !== undefined &&
|
|
243
|
+
config.blobs.length > 0) {
|
|
244
|
+
// eslint-disable-next-line no-console
|
|
245
|
+
console.warn("resolveBlobLayer: both 'preset' and 'blobs' are set; preset takes precedence and blobs are ignored. " +
|
|
246
|
+
'Remove one to silence this warning.');
|
|
247
|
+
}
|
|
248
|
+
const seeds = PRESET_SEEDS[config.preset];
|
|
249
|
+
const paletteNames = config.palette ?? ['primary'];
|
|
250
|
+
// Defensive: `paletteNames` is typed non-empty in spirit but a consumer
|
|
251
|
+
// could pass an empty array at runtime — fall back to ['primary'] so
|
|
252
|
+
// modulo arithmetic below stays sound (n % 0 = NaN). Dev-warn because
|
|
253
|
+
// `palette: []` is almost always a bug (consumer meant to omit the
|
|
254
|
+
// field entirely); silent fallback would hide it. Severity matches the
|
|
255
|
+
// existing ambiguous {preset,blobs} dev-warn above — defensible winner,
|
|
256
|
+
// no rendering broken.
|
|
257
|
+
if (IS_DEV && paletteNames.length === 0) {
|
|
258
|
+
// eslint-disable-next-line no-console
|
|
259
|
+
console.warn("resolveBlobLayer: preset 'palette' is an empty array; falling back to ['primary']. " +
|
|
260
|
+
'Omit the field or pass at least one palette keyword to silence.');
|
|
261
|
+
}
|
|
262
|
+
const safePaletteNames = paletteNames.length > 0 ? paletteNames : ['primary'];
|
|
263
|
+
const motion = resolvePresetMotion(config.motion);
|
|
264
|
+
const animations = motionToAnimations(motion);
|
|
265
|
+
return seeds.map((seed, i) => {
|
|
266
|
+
const colorName = safePaletteNames[i % safePaletteNames.length];
|
|
267
|
+
const instance = {
|
|
268
|
+
...seed,
|
|
269
|
+
color: colorName,
|
|
270
|
+
opacity: config.opacity,
|
|
271
|
+
};
|
|
272
|
+
// Preset seeds are curated — PresetSeed's shape type excludes
|
|
273
|
+
// 'custom-svg' so catalog lookup is total. Going direct avoids the
|
|
274
|
+
// `BlobShapeDef | null` union of resolveShape (which is needed only
|
|
275
|
+
// for the explicit `blobs[]` path where custom-svg is allowed).
|
|
276
|
+
const shape = BLOB_CATALOG[seed.shape];
|
|
277
|
+
return {
|
|
278
|
+
shape,
|
|
279
|
+
style: resolveStyle(instance, palette),
|
|
280
|
+
animations,
|
|
281
|
+
};
|
|
282
|
+
});
|
|
283
|
+
}
|
|
284
|
+
// Explicit form
|
|
285
|
+
if (!config.blobs || config.blobs.length === 0) {
|
|
286
|
+
return [];
|
|
287
|
+
}
|
|
288
|
+
const specs = [];
|
|
289
|
+
for (const instance of config.blobs) {
|
|
290
|
+
const shape = resolveShape(instance);
|
|
291
|
+
if (shape === null)
|
|
292
|
+
continue; // prod-mode skip for malformed custom-svg
|
|
293
|
+
specs.push({
|
|
294
|
+
shape,
|
|
295
|
+
style: resolveStyle(instance, palette),
|
|
296
|
+
animations: motionToAnimations(instance.motion),
|
|
297
|
+
});
|
|
298
|
+
}
|
|
299
|
+
return specs;
|
|
300
|
+
}
|
|
301
|
+
//# sourceMappingURL=resolver.js.map
|