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,903 @@
|
|
|
1
|
+
import { SPEC_KEYS } from '../types.js';
|
|
2
|
+
import { suggest } from '../utils/levenshtein.js';
|
|
3
|
+
import { COMMON_PROPS, TABLE_COLUMN_PROPS } from '../renderer/prop-schemas.js';
|
|
4
|
+
import { validateIdentityTokens } from './identity-token-validator.js';
|
|
5
|
+
/** Expression handler rules: required properties and operation-specific requirements */
|
|
6
|
+
const EXPRESSION_RULES = {
|
|
7
|
+
$state: { required: ['$state'] },
|
|
8
|
+
$bindState: { required: ['$bindState'] },
|
|
9
|
+
$token: { required: ['$token'] },
|
|
10
|
+
$template: { required: ['$template'] },
|
|
11
|
+
$computed: { required: ['$computed'] },
|
|
12
|
+
$ref: { required: ['$ref'] },
|
|
13
|
+
$item: { required: ['$item'] },
|
|
14
|
+
$index: {},
|
|
15
|
+
$bindItem: { required: ['$bindItem'] },
|
|
16
|
+
$prop: { required: ['$prop'] },
|
|
17
|
+
$i18n: { required: ['$i18n'] },
|
|
18
|
+
$not: { required: ['$not'] },
|
|
19
|
+
$and: { required: ['$and'] },
|
|
20
|
+
$or: { required: ['$or'] },
|
|
21
|
+
$breakpoint: { required: ['$breakpoint'] },
|
|
22
|
+
$cond: { required: ['$cond', '$then', '$else'] },
|
|
23
|
+
$switch: { required: ['$switch', 'cases', 'default'] },
|
|
24
|
+
$group: { required: ['$group'] },
|
|
25
|
+
$selection: { required: ['$selection'] },
|
|
26
|
+
$uniqueId: { required: ['$uniqueId', 'source'] },
|
|
27
|
+
$let: { required: ['$let', '$in'] },
|
|
28
|
+
$format: { required: ['$format', 'value'] },
|
|
29
|
+
$math: {
|
|
30
|
+
required: ['$math'],
|
|
31
|
+
operations: {
|
|
32
|
+
add: { required: ['args'] }, subtract: { required: ['args'] }, multiply: { required: ['args'] },
|
|
33
|
+
divide: { required: ['args'] }, mod: { required: ['args'] }, min: { required: ['args'] }, max: { required: ['args'] },
|
|
34
|
+
round: { required: ['value'] }, floor: { required: ['value'] }, ceil: { required: ['value'] }, abs: { required: ['value'] },
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
$date: {
|
|
38
|
+
required: ['$date'],
|
|
39
|
+
operations: {
|
|
40
|
+
now: {}, today: {},
|
|
41
|
+
age: { required: ['from'] }, diff: { required: ['from'] },
|
|
42
|
+
format: { required: ['value'] }, add: { required: ['value', 'amount'] },
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
$array: {
|
|
46
|
+
required: ['$array', 'source'],
|
|
47
|
+
operations: {
|
|
48
|
+
count: {}, length: {}, first: {}, last: {}, slice: {}, filter: {},
|
|
49
|
+
sum: { required: ['field'] }, sumProduct: { required: ['field1', 'field2'] },
|
|
50
|
+
remove: { required: ['where'] }, replace: { required: ['where', 'value'] },
|
|
51
|
+
append: { required: ['value'] }, toggle: { required: ['value'] },
|
|
52
|
+
search: { required: ['query'] }, includes: { required: ['value'] },
|
|
53
|
+
sort: { required: ['field'] }, map: { required: ['field'] }, find: { required: ['where'] },
|
|
54
|
+
},
|
|
55
|
+
},
|
|
56
|
+
};
|
|
57
|
+
/** Required params per built-in action */
|
|
58
|
+
const ACTION_REQUIRED_PARAMS = {
|
|
59
|
+
setState: ['statePath'],
|
|
60
|
+
fetch: ['url'],
|
|
61
|
+
submitForm: ['url'],
|
|
62
|
+
navigate: ['screen'],
|
|
63
|
+
setLocale: ['locale'],
|
|
64
|
+
uploadFile: ['bucket', 'target'],
|
|
65
|
+
deleteFile: ['path', 'bucket'],
|
|
66
|
+
export: ['source', 'columns', 'filename'],
|
|
67
|
+
editorCommit: ['session', 'changes'],
|
|
68
|
+
editorUndo: ['session'],
|
|
69
|
+
editorRedo: ['session'],
|
|
70
|
+
editorMarkSaved: ['session'],
|
|
71
|
+
editorSave: ['session'],
|
|
72
|
+
editorDiscard: ['session'],
|
|
73
|
+
editorValidate: ['session'],
|
|
74
|
+
};
|
|
75
|
+
function validateExpression(expr, elementId, exprPath, errors) {
|
|
76
|
+
if (expr === null || expr === undefined || typeof expr !== 'object')
|
|
77
|
+
return;
|
|
78
|
+
if (Array.isArray(expr)) {
|
|
79
|
+
for (let i = 0; i < expr.length; i++) {
|
|
80
|
+
validateExpression(expr[i], elementId, `${exprPath}.${i}`, errors);
|
|
81
|
+
}
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
84
|
+
const obj = expr;
|
|
85
|
+
const exprKey = Object.keys(obj).find((k) => k.startsWith('$') && EXPRESSION_RULES[k]);
|
|
86
|
+
if (!exprKey) {
|
|
87
|
+
for (const [key, val] of Object.entries(obj)) {
|
|
88
|
+
if (val && typeof val === 'object') {
|
|
89
|
+
validateExpression(val, elementId, `${exprPath}.${key}`, errors);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
return;
|
|
93
|
+
}
|
|
94
|
+
const rules = EXPRESSION_RULES[exprKey];
|
|
95
|
+
if (rules.required) {
|
|
96
|
+
for (const prop of rules.required) {
|
|
97
|
+
if (obj[prop] === undefined) {
|
|
98
|
+
errors.push({
|
|
99
|
+
message: `Element "${elementId}": ${exprKey} at ${exprPath} requires "${prop}" property`,
|
|
100
|
+
elementId,
|
|
101
|
+
path: `/elements/${elementId}/${exprPath.replace(/\./g, '/')}`,
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
if (exprKey === '$state' && obj.$state !== undefined && typeof obj.$state !== 'string') {
|
|
107
|
+
errors.push({
|
|
108
|
+
message: `Element "${elementId}": $state at ${exprPath} requires a string path`,
|
|
109
|
+
elementId,
|
|
110
|
+
path: `/elements/${elementId}/${exprPath.replace(/\./g, '/')}/$state`,
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
if (rules.operations) {
|
|
114
|
+
const operation = obj[exprKey];
|
|
115
|
+
if (typeof operation === 'string' && rules.operations[operation]) {
|
|
116
|
+
const opRules = rules.operations[operation];
|
|
117
|
+
if (opRules.required) {
|
|
118
|
+
for (const prop of opRules.required) {
|
|
119
|
+
if (obj[prop] === undefined) {
|
|
120
|
+
errors.push({
|
|
121
|
+
message: `Element "${elementId}": ${exprKey} "${operation}" at ${exprPath} requires "${prop}" property`,
|
|
122
|
+
elementId,
|
|
123
|
+
path: `/elements/${elementId}/${exprPath.replace(/\./g, '/')}`,
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
for (const [key, val] of Object.entries(obj)) {
|
|
131
|
+
if (key !== exprKey && val && typeof val === 'object') {
|
|
132
|
+
validateExpression(val, elementId, `${exprPath}.${key}`, errors);
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
function validateActionBinding(binding, elementId, eventPath, errors, spec) {
|
|
137
|
+
if (!binding || typeof binding !== 'object')
|
|
138
|
+
return;
|
|
139
|
+
if ('transaction' in binding)
|
|
140
|
+
return;
|
|
141
|
+
const b = binding;
|
|
142
|
+
const action = b.action;
|
|
143
|
+
if (!action)
|
|
144
|
+
return;
|
|
145
|
+
const requiredParams = ACTION_REQUIRED_PARAMS[action];
|
|
146
|
+
if (b.params && typeof b.params === 'object') {
|
|
147
|
+
const params = b.params;
|
|
148
|
+
if (requiredParams) {
|
|
149
|
+
for (const param of requiredParams) {
|
|
150
|
+
if (params[param] === undefined) {
|
|
151
|
+
errors.push({
|
|
152
|
+
message: `Element "${elementId}": action "${action}" at ${eventPath} requires "${param}" param`,
|
|
153
|
+
elementId,
|
|
154
|
+
path: `/elements/${elementId}/${eventPath.replace(/\./g, '/')}`,
|
|
155
|
+
});
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
for (const [paramName, paramValue] of Object.entries(params)) {
|
|
160
|
+
validateExpression(paramValue, elementId, `${eventPath}.params.${paramName}`, errors);
|
|
161
|
+
}
|
|
162
|
+
validateEditorSaveAction(action, params, elementId, eventPath, errors, spec);
|
|
163
|
+
}
|
|
164
|
+
else if (requiredParams) {
|
|
165
|
+
for (const param of requiredParams) {
|
|
166
|
+
errors.push({
|
|
167
|
+
message: `Element "${elementId}": action "${action}" at ${eventPath} requires "${param}" param`,
|
|
168
|
+
elementId,
|
|
169
|
+
path: `/elements/${elementId}/${eventPath.replace(/\./g, '/')}`,
|
|
170
|
+
});
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
function validateEditorSaveAction(action, params, elementId, eventPath, errors, spec) {
|
|
175
|
+
if (action !== 'editorSave')
|
|
176
|
+
return;
|
|
177
|
+
if (typeof params.session !== 'string' || !params.session)
|
|
178
|
+
return;
|
|
179
|
+
const sessionId = params.session;
|
|
180
|
+
const sessions = spec?.editorSessions;
|
|
181
|
+
const session = sessions?.[sessionId];
|
|
182
|
+
if (!session) {
|
|
183
|
+
errors.push({
|
|
184
|
+
message: `Element "${elementId}": editorSave at ${eventPath} references unknown editor session "${sessionId}"`,
|
|
185
|
+
elementId,
|
|
186
|
+
path: `/elements/${elementId}/${eventPath.replace(/\./g, '/')}/params/session`,
|
|
187
|
+
});
|
|
188
|
+
return;
|
|
189
|
+
}
|
|
190
|
+
if (!session.persistence && params.url === undefined) {
|
|
191
|
+
errors.push({
|
|
192
|
+
message: `Element "${elementId}": editorSave at ${eventPath} requires session persistence or params.url`,
|
|
193
|
+
elementId,
|
|
194
|
+
path: `/elements/${elementId}/${eventPath.replace(/\./g, '/')}/params`,
|
|
195
|
+
});
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
/**
|
|
199
|
+
* Lint walker — detects `$row` literal usage in spec values.
|
|
200
|
+
*
|
|
201
|
+
* `$row` is not a valid expression handler in Mythik — it was a historical doc lie
|
|
202
|
+
* removed in v49 Item B. AI consumers may still generate it from training data.
|
|
203
|
+
* Runtime resolves to undefined silently; lint catches at validate/push/lint time.
|
|
204
|
+
*
|
|
205
|
+
* Emits warnings to the provided array with `ruleId: 'spec-row-literal'`.
|
|
206
|
+
* Suggested fix: replace `{ $row: 'X' }` with `{ $state: '/ui/selectedRow/X' }`.
|
|
207
|
+
*/
|
|
208
|
+
function validateEditorSessions(spec, errors) {
|
|
209
|
+
const sessions = spec.editorSessions;
|
|
210
|
+
if (sessions === undefined)
|
|
211
|
+
return;
|
|
212
|
+
if (!sessions || typeof sessions !== 'object' || Array.isArray(sessions)) {
|
|
213
|
+
errors.push({ message: 'editorSessions must be an object keyed by session id', path: '/editorSessions' });
|
|
214
|
+
return;
|
|
215
|
+
}
|
|
216
|
+
for (const [sessionId, rawConfig] of Object.entries(sessions)) {
|
|
217
|
+
const basePath = `/editorSessions/${sessionId}`;
|
|
218
|
+
if (!rawConfig || typeof rawConfig !== 'object' || Array.isArray(rawConfig)) {
|
|
219
|
+
errors.push({ message: `editorSession "${sessionId}" must be an object`, path: basePath });
|
|
220
|
+
continue;
|
|
221
|
+
}
|
|
222
|
+
const config = rawConfig;
|
|
223
|
+
const paths = config.paths;
|
|
224
|
+
if (!Array.isArray(paths) || paths.length === 0) {
|
|
225
|
+
errors.push({ message: `editorSession "${sessionId}" requires at least one path`, path: `${basePath}/paths` });
|
|
226
|
+
}
|
|
227
|
+
else {
|
|
228
|
+
paths.forEach((path, index) => {
|
|
229
|
+
if (typeof path !== 'string' || !path.startsWith('/')) {
|
|
230
|
+
errors.push({
|
|
231
|
+
message: `editorSession "${sessionId}" path must start with "/"`,
|
|
232
|
+
path: `${basePath}/paths/${index}`,
|
|
233
|
+
});
|
|
234
|
+
}
|
|
235
|
+
if (path === '/ui' || (typeof path === 'string' && path.startsWith('/ui/'))) {
|
|
236
|
+
errors.push({
|
|
237
|
+
message: `editorSession "${sessionId}" should not track transient /ui paths`,
|
|
238
|
+
path: `${basePath}/paths/${index}`,
|
|
239
|
+
});
|
|
240
|
+
}
|
|
241
|
+
});
|
|
242
|
+
}
|
|
243
|
+
if (config.maxHistory !== undefined
|
|
244
|
+
&& (!Number.isInteger(config.maxHistory) || config.maxHistory < 1)) {
|
|
245
|
+
errors.push({ message: `editorSession "${sessionId}" maxHistory must be a positive integer`, path: `${basePath}/maxHistory` });
|
|
246
|
+
}
|
|
247
|
+
const persistence = config.persistence;
|
|
248
|
+
if (persistence !== undefined) {
|
|
249
|
+
if (!persistence || typeof persistence !== 'object' || Array.isArray(persistence)) {
|
|
250
|
+
errors.push({ message: `editorSession "${sessionId}" persistence must be an object`, path: `${basePath}/persistence` });
|
|
251
|
+
}
|
|
252
|
+
else {
|
|
253
|
+
const rawPersistence = persistence;
|
|
254
|
+
if (rawPersistence.url === undefined) {
|
|
255
|
+
errors.push({ message: `editorSession "${sessionId}" persistence requires url`, path: `${basePath}/persistence/url` });
|
|
256
|
+
}
|
|
257
|
+
if (rawPersistence.method !== undefined
|
|
258
|
+
&& !['POST', 'PUT', 'PATCH'].includes(String(rawPersistence.method))) {
|
|
259
|
+
errors.push({ message: `editorSession "${sessionId}" persistence method must be POST, PUT, or PATCH`, path: `${basePath}/persistence/method` });
|
|
260
|
+
}
|
|
261
|
+
if (rawPersistence.body !== undefined
|
|
262
|
+
&& rawPersistence.body !== 'trackedPaths'
|
|
263
|
+
&& rawPersistence.body !== 'snapshot'
|
|
264
|
+
&& (typeof rawPersistence.body !== 'object' || rawPersistence.body === null || Array.isArray(rawPersistence.body))) {
|
|
265
|
+
errors.push({ message: `editorSession "${sessionId}" persistence body must be "trackedPaths", "snapshot", or an object`, path: `${basePath}/persistence/body` });
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
function walkForRowLiteral(value, jsonPath, warnings) {
|
|
272
|
+
if (value === null || value === undefined)
|
|
273
|
+
return;
|
|
274
|
+
if (typeof value !== 'object')
|
|
275
|
+
return;
|
|
276
|
+
if (Array.isArray(value)) {
|
|
277
|
+
for (let i = 0; i < value.length; i++) {
|
|
278
|
+
walkForRowLiteral(value[i], `${jsonPath}/${i}`, warnings);
|
|
279
|
+
}
|
|
280
|
+
return;
|
|
281
|
+
}
|
|
282
|
+
const obj = value;
|
|
283
|
+
if ('$row' in obj) {
|
|
284
|
+
const rowValue = obj.$row;
|
|
285
|
+
const inferredKey = typeof rowValue === 'string' ? rowValue : '<key>';
|
|
286
|
+
warnings.push({
|
|
287
|
+
message: `$row is not a valid expression handler — use $state with /ui/selectedRow path`,
|
|
288
|
+
path: jsonPath,
|
|
289
|
+
ruleId: 'spec-row-literal',
|
|
290
|
+
suggestedFixes: [{
|
|
291
|
+
patch: { op: 'replace', path: jsonPath, value: { $state: `/ui/selectedRow/${inferredKey}` } },
|
|
292
|
+
confidence: 'high',
|
|
293
|
+
description: `Replace $row with /ui/selectedRow/${inferredKey}`,
|
|
294
|
+
}],
|
|
295
|
+
});
|
|
296
|
+
return; // Don't descend into the $row object itself
|
|
297
|
+
}
|
|
298
|
+
for (const [key, val] of Object.entries(obj)) {
|
|
299
|
+
walkForRowLiteral(val, `${jsonPath}/${key}`, warnings);
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
/**
|
|
303
|
+
* Validates a Spec structure before rendering.
|
|
304
|
+
* With primitiveRegistry: also validates primitive types, expressions, and action params.
|
|
305
|
+
*/
|
|
306
|
+
export function validateSpec(spec, context = {}) {
|
|
307
|
+
const errors = [];
|
|
308
|
+
const warnings = [];
|
|
309
|
+
const doFixes = context.generateFixes !== false;
|
|
310
|
+
if (!spec || typeof spec !== 'object') {
|
|
311
|
+
return { valid: false, errors: [{ message: 'Spec must be an object' }] };
|
|
312
|
+
}
|
|
313
|
+
const s = spec;
|
|
314
|
+
if (!s.root || typeof s.root !== 'string') {
|
|
315
|
+
errors.push({ message: 'Spec must have a "root" string property' });
|
|
316
|
+
}
|
|
317
|
+
if (!s.elements || typeof s.elements !== 'object' || Array.isArray(s.elements)) {
|
|
318
|
+
errors.push({ message: 'Spec must have an "elements" object property' });
|
|
319
|
+
}
|
|
320
|
+
if (errors.length > 0)
|
|
321
|
+
return { valid: false, errors };
|
|
322
|
+
// Warn on unknown top-level properties (typo detection)
|
|
323
|
+
const specKeySet = new Set(SPEC_KEYS);
|
|
324
|
+
for (const key of Object.keys(s)) {
|
|
325
|
+
if (!specKeySet.has(key)) {
|
|
326
|
+
const warning = {
|
|
327
|
+
message: `Unknown top-level property "${key}"`,
|
|
328
|
+
path: `/${key}`,
|
|
329
|
+
};
|
|
330
|
+
if (doFixes) {
|
|
331
|
+
const suggested = suggest(key, SPEC_KEYS);
|
|
332
|
+
if (suggested) {
|
|
333
|
+
warning.suggestedFixes = [{
|
|
334
|
+
patch: { op: 'remove', path: `/${key}` },
|
|
335
|
+
confidence: 'high',
|
|
336
|
+
description: `did you mean '${suggested}'?`,
|
|
337
|
+
}];
|
|
338
|
+
}
|
|
339
|
+
}
|
|
340
|
+
warnings.push(warning);
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
validateEditorSessions(s, errors);
|
|
344
|
+
const elements = s.elements;
|
|
345
|
+
const root = s.root;
|
|
346
|
+
if (s.tokens && typeof s.tokens === 'object' && !Array.isArray(s.tokens)) {
|
|
347
|
+
const tokens = s.tokens;
|
|
348
|
+
if (tokens.identity !== undefined) {
|
|
349
|
+
validateIdentityTokens(tokens.identity, '/tokens/identity', errors);
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
if (!elements[root]) {
|
|
353
|
+
errors.push({ message: `Root element "${root}" not found in elements` });
|
|
354
|
+
}
|
|
355
|
+
// Collect orphan child errors per parent for descending index ordering
|
|
356
|
+
const orphanErrors = [];
|
|
357
|
+
for (const [id, element] of Object.entries(elements)) {
|
|
358
|
+
if (!element || typeof element !== 'object') {
|
|
359
|
+
errors.push({ message: `Element "${id}" must be an object`, elementId: id });
|
|
360
|
+
continue;
|
|
361
|
+
}
|
|
362
|
+
const el = element;
|
|
363
|
+
if (!el.type || typeof el.type !== 'string') {
|
|
364
|
+
errors.push({ message: `Element "${id}" must have a "type" string property`, elementId: id, path: `/elements/${id}/type` });
|
|
365
|
+
}
|
|
366
|
+
// Validate primitive type exists in registry — auto-fix #1
|
|
367
|
+
// Also accept Layer 3 custom elements registered via ElementRegistry.
|
|
368
|
+
if (context.primitiveRegistry && el.type && typeof el.type === 'string') {
|
|
369
|
+
const isPrimitive = context.primitiveRegistry.has(el.type);
|
|
370
|
+
const isCustomElement = context.elementRegistry?.has(el.type) ?? false;
|
|
371
|
+
if (!isPrimitive && !isCustomElement) {
|
|
372
|
+
const error = {
|
|
373
|
+
message: `Element "${id}": unknown primitive type "${el.type}"`,
|
|
374
|
+
elementId: id,
|
|
375
|
+
path: `/elements/${id}/type`,
|
|
376
|
+
};
|
|
377
|
+
if (doFixes) {
|
|
378
|
+
const candidates = [
|
|
379
|
+
...context.primitiveRegistry.keys(),
|
|
380
|
+
...(context.elementRegistry ? [...context.elementRegistry.getAll().keys()] : []),
|
|
381
|
+
];
|
|
382
|
+
const suggested = suggest(el.type, candidates);
|
|
383
|
+
if (suggested) {
|
|
384
|
+
error.suggestedFixes = [{
|
|
385
|
+
patch: { op: 'replace', path: `/elements/${id}/type`, value: suggested },
|
|
386
|
+
confidence: 'high',
|
|
387
|
+
description: `type '${el.type}' → '${suggested}' (Levenshtein match)`,
|
|
388
|
+
}];
|
|
389
|
+
}
|
|
390
|
+
}
|
|
391
|
+
errors.push(error);
|
|
392
|
+
}
|
|
393
|
+
}
|
|
394
|
+
// Children — orphan detection with auto-fix #2
|
|
395
|
+
if (el.children !== undefined) {
|
|
396
|
+
if (!Array.isArray(el.children)) {
|
|
397
|
+
errors.push({ message: `Element "${id}": "children" must be an array`, elementId: id, path: `/elements/${id}/children` });
|
|
398
|
+
}
|
|
399
|
+
else {
|
|
400
|
+
for (let i = 0; i < el.children.length; i++) {
|
|
401
|
+
const childId = el.children[i];
|
|
402
|
+
if (typeof childId !== 'string') {
|
|
403
|
+
errors.push({ message: `Element "${id}": children must be strings (element IDs)`, elementId: id, path: `/elements/${id}/children/${i}` });
|
|
404
|
+
}
|
|
405
|
+
else if (!elements[childId]) {
|
|
406
|
+
const error = {
|
|
407
|
+
message: `Element "${id}": child "${childId}" not found in elements`,
|
|
408
|
+
elementId: id,
|
|
409
|
+
path: `/elements/${id}/children/${i}`,
|
|
410
|
+
};
|
|
411
|
+
if (doFixes) {
|
|
412
|
+
error.suggestedFixes = [{
|
|
413
|
+
patch: { op: 'remove', path: `/elements/${id}/children/${i}` },
|
|
414
|
+
confidence: 'high',
|
|
415
|
+
description: `remove orphan child '${childId}' at index ${i}`,
|
|
416
|
+
}];
|
|
417
|
+
}
|
|
418
|
+
orphanErrors.push(error);
|
|
419
|
+
}
|
|
420
|
+
}
|
|
421
|
+
}
|
|
422
|
+
}
|
|
423
|
+
if (el.props !== undefined && (typeof el.props !== 'object' || Array.isArray(el.props))) {
|
|
424
|
+
errors.push({ message: `Element "${id}": "props" must be an object`, elementId: id, path: `/elements/${id}/props` });
|
|
425
|
+
}
|
|
426
|
+
if (el.style !== undefined && (typeof el.style !== 'object' || Array.isArray(el.style))) {
|
|
427
|
+
errors.push({ message: `Element "${id}": "style" must be an object`, elementId: id, path: `/elements/${id}/style` });
|
|
428
|
+
}
|
|
429
|
+
if (el.props && typeof el.props === 'object' && !Array.isArray(el.props)) {
|
|
430
|
+
for (const [propName, propVal] of Object.entries(el.props)) {
|
|
431
|
+
if (propVal && typeof propVal === 'object') {
|
|
432
|
+
validateExpression(propVal, id, `props.${propName}`, errors);
|
|
433
|
+
}
|
|
434
|
+
}
|
|
435
|
+
// Validate prop names against primitive schema
|
|
436
|
+
if (context.propSchemas && el.type && typeof el.type === 'string') {
|
|
437
|
+
const knownProps = context.propSchemas[el.type]?.validProps;
|
|
438
|
+
if (knownProps) {
|
|
439
|
+
for (const propName of Object.keys(el.props)) {
|
|
440
|
+
if (COMMON_PROPS.has(propName))
|
|
441
|
+
continue;
|
|
442
|
+
if (!knownProps.includes(propName)) {
|
|
443
|
+
const warning = {
|
|
444
|
+
message: `Element "${id}": unknown prop "${propName}" for type "${el.type}"`,
|
|
445
|
+
elementId: id,
|
|
446
|
+
path: `/elements/${id}/props/${propName}`,
|
|
447
|
+
};
|
|
448
|
+
if (doFixes) {
|
|
449
|
+
const suggested = suggest(propName, knownProps);
|
|
450
|
+
if (suggested) {
|
|
451
|
+
warning.suggestedFixes = [{
|
|
452
|
+
patch: { op: 'replace', path: `/elements/${id}/props/${propName}`, value: suggested },
|
|
453
|
+
confidence: 'high',
|
|
454
|
+
description: `did you mean '${suggested}'?`,
|
|
455
|
+
}];
|
|
456
|
+
}
|
|
457
|
+
}
|
|
458
|
+
warnings.push(warning);
|
|
459
|
+
}
|
|
460
|
+
}
|
|
461
|
+
}
|
|
462
|
+
}
|
|
463
|
+
// Validate table column props
|
|
464
|
+
if (el.type === 'table' && context.propSchemas) {
|
|
465
|
+
const cols = el.props?.columns;
|
|
466
|
+
if (Array.isArray(cols)) {
|
|
467
|
+
const colKeySet = new Set(TABLE_COLUMN_PROPS);
|
|
468
|
+
for (let ci = 0; ci < cols.length; ci++) {
|
|
469
|
+
const col = cols[ci];
|
|
470
|
+
if (col && typeof col === 'object' && !Array.isArray(col)) {
|
|
471
|
+
for (const colKey of Object.keys(col)) {
|
|
472
|
+
if (!colKeySet.has(colKey)) {
|
|
473
|
+
const warning = {
|
|
474
|
+
message: `Element "${id}": unknown column prop "${colKey}" at columns[${ci}]`,
|
|
475
|
+
elementId: id,
|
|
476
|
+
path: `/elements/${id}/props/columns/${ci}/${colKey}`,
|
|
477
|
+
};
|
|
478
|
+
if (doFixes) {
|
|
479
|
+
const suggested = suggest(colKey, TABLE_COLUMN_PROPS);
|
|
480
|
+
if (suggested) {
|
|
481
|
+
warning.suggestedFixes = [{
|
|
482
|
+
patch: { op: 'replace', path: `/elements/${id}/props/columns/${ci}/${colKey}`, value: suggested },
|
|
483
|
+
confidence: 'high',
|
|
484
|
+
description: `did you mean '${suggested}'?`,
|
|
485
|
+
}];
|
|
486
|
+
}
|
|
487
|
+
}
|
|
488
|
+
warnings.push(warning);
|
|
489
|
+
}
|
|
490
|
+
}
|
|
491
|
+
}
|
|
492
|
+
}
|
|
493
|
+
}
|
|
494
|
+
}
|
|
495
|
+
}
|
|
496
|
+
if (el.style && typeof el.style === 'object' && !Array.isArray(el.style)) {
|
|
497
|
+
for (const [styleProp, styleVal] of Object.entries(el.style)) {
|
|
498
|
+
if (styleVal && typeof styleVal === 'object') {
|
|
499
|
+
validateExpression(styleVal, id, `style.${styleProp}`, errors);
|
|
500
|
+
}
|
|
501
|
+
}
|
|
502
|
+
}
|
|
503
|
+
if (el.visible && typeof el.visible === 'object') {
|
|
504
|
+
validateExpression(el.visible, id, 'visible', errors);
|
|
505
|
+
}
|
|
506
|
+
if (el.on !== undefined && (typeof el.on !== 'object' || Array.isArray(el.on))) {
|
|
507
|
+
errors.push({ message: `Element "${id}": "on" must be an object`, elementId: id, path: `/elements/${id}/on` });
|
|
508
|
+
}
|
|
509
|
+
if (el.on && typeof el.on === 'object' && !Array.isArray(el.on)) {
|
|
510
|
+
for (const [eventName, binding] of Object.entries(el.on)) {
|
|
511
|
+
if (binding && typeof binding === 'object' && !Array.isArray(binding) && 'transaction' in binding) {
|
|
512
|
+
const tx = binding.transaction;
|
|
513
|
+
if (!tx || typeof tx !== 'object' || Array.isArray(tx)) {
|
|
514
|
+
errors.push({ message: `Element "${id}": on.${eventName}.transaction must be an object`, elementId: id, path: `/elements/${id}/on/${eventName}/transaction` });
|
|
515
|
+
continue;
|
|
516
|
+
}
|
|
517
|
+
const txObj = tx;
|
|
518
|
+
if (!txObj.confirm || !Array.isArray(txObj.confirm) || txObj.confirm.length === 0) {
|
|
519
|
+
errors.push({ message: `Element "${id}": on.${eventName}.transaction.confirm is required and must be a non-empty array`, elementId: id, path: `/elements/${id}/on/${eventName}/transaction/confirm` });
|
|
520
|
+
}
|
|
521
|
+
for (const phase of ['before', 'optimistic', 'onSuccess', 'onError']) {
|
|
522
|
+
if (txObj[phase] !== undefined && !Array.isArray(txObj[phase])) {
|
|
523
|
+
errors.push({ message: `Element "${id}": on.${eventName}.transaction.${phase} must be an array`, elementId: id, path: `/elements/${id}/on/${eventName}/transaction/${phase}` });
|
|
524
|
+
}
|
|
525
|
+
}
|
|
526
|
+
if (txObj.timeout !== undefined) {
|
|
527
|
+
if (typeof txObj.timeout !== 'number' || txObj.timeout <= 0) {
|
|
528
|
+
errors.push({ message: `Element "${id}": on.${eventName}.transaction.timeout must be a positive number`, elementId: id, path: `/elements/${id}/on/${eventName}/transaction/timeout` });
|
|
529
|
+
}
|
|
530
|
+
}
|
|
531
|
+
for (const phase of ['before', 'optimistic', 'confirm', 'onSuccess', 'onError']) {
|
|
532
|
+
if (Array.isArray(txObj[phase])) {
|
|
533
|
+
for (const action of txObj[phase]) {
|
|
534
|
+
if (action && typeof action === 'object' && 'transaction' in action) {
|
|
535
|
+
errors.push({ message: `Element "${id}": on.${eventName}.transaction.${phase} cannot contain nested transactions`, elementId: id, path: `/elements/${id}/on/${eventName}/transaction/${phase}` });
|
|
536
|
+
}
|
|
537
|
+
validateActionBinding(action, id, `on.${eventName}.transaction.${phase}`, errors, s);
|
|
538
|
+
}
|
|
539
|
+
}
|
|
540
|
+
}
|
|
541
|
+
}
|
|
542
|
+
else if (Array.isArray(binding)) {
|
|
543
|
+
for (const action of binding) {
|
|
544
|
+
validateActionBinding(action, id, `on.${eventName}`, errors, s);
|
|
545
|
+
}
|
|
546
|
+
}
|
|
547
|
+
else if (binding && typeof binding === 'object') {
|
|
548
|
+
validateActionBinding(binding, id, `on.${eventName}`, errors, s);
|
|
549
|
+
}
|
|
550
|
+
}
|
|
551
|
+
}
|
|
552
|
+
if (el.repeat !== undefined) {
|
|
553
|
+
const repeat = el.repeat;
|
|
554
|
+
if (!repeat.statePath && !repeat.source && !repeat.count) {
|
|
555
|
+
errors.push({ message: `Element "${id}": "repeat" must have "statePath", "source", or "count"`, elementId: id, path: `/elements/${id}/repeat` });
|
|
556
|
+
}
|
|
557
|
+
}
|
|
558
|
+
if (context.cssHoverTypes && el.type && typeof el.type === 'string') {
|
|
559
|
+
const hasCssInteraction = el.hover || el.active || el.focus;
|
|
560
|
+
if (hasCssInteraction && !context.cssHoverTypes.has(el.type)) {
|
|
561
|
+
const fields = [el.hover && 'hover', el.active && 'active', el.focus && 'focus'].filter(Boolean).join(', ');
|
|
562
|
+
errors.push({ message: `Element "${id}": has ${fields} but type "${el.type}" does not support CSS className — interaction will be silently ignored. Use transform-based props (scale, y, rotate) for Motion wrapper, or add className support to the primitive`, elementId: id, path: `/elements/${id}` });
|
|
563
|
+
}
|
|
564
|
+
}
|
|
565
|
+
// Toast-container validation — auto-fix #3
|
|
566
|
+
if (el.type === 'toast-container' && el.props && typeof el.props === 'object') {
|
|
567
|
+
const props = el.props;
|
|
568
|
+
const validPositions = ['top-right', 'top-left', 'top-center', 'bottom-right', 'bottom-left', 'bottom-center'];
|
|
569
|
+
if (props.position !== undefined && !validPositions.includes(props.position)) {
|
|
570
|
+
const error = {
|
|
571
|
+
message: `Element "${id}": toast-container position must be one of: ${validPositions.join(', ')}`,
|
|
572
|
+
elementId: id,
|
|
573
|
+
path: `/elements/${id}/props/position`,
|
|
574
|
+
};
|
|
575
|
+
if (doFixes) {
|
|
576
|
+
const suggested = suggest(props.position, validPositions);
|
|
577
|
+
if (suggested) {
|
|
578
|
+
error.suggestedFixes = [{
|
|
579
|
+
patch: { op: 'replace', path: `/elements/${id}/props/position`, value: suggested },
|
|
580
|
+
confidence: 'high',
|
|
581
|
+
description: `position '${props.position}' → '${suggested}' (Levenshtein match)`,
|
|
582
|
+
}];
|
|
583
|
+
}
|
|
584
|
+
}
|
|
585
|
+
errors.push(error);
|
|
586
|
+
}
|
|
587
|
+
if (props.duration !== undefined && props.duration !== null && typeof props.duration !== 'number') {
|
|
588
|
+
errors.push({ message: `Element "${id}": toast-container duration must be a number or null`, elementId: id, path: `/elements/${id}/props/duration` });
|
|
589
|
+
}
|
|
590
|
+
if (props.maxVisible !== undefined && (typeof props.maxVisible !== 'number' || props.maxVisible < 1)) {
|
|
591
|
+
errors.push({ message: `Element "${id}": toast-container maxVisible must be a positive number`, elementId: id, path: `/elements/${id}/props/maxVisible` });
|
|
592
|
+
}
|
|
593
|
+
}
|
|
594
|
+
if (el.type === 'table' && el.props && typeof el.props === 'object') {
|
|
595
|
+
const props = el.props;
|
|
596
|
+
if (props.sorting && typeof props.sorting === 'object') {
|
|
597
|
+
const sorting = props.sorting;
|
|
598
|
+
if (sorting.enabled && sorting.mode === 'server' && !sorting.state) {
|
|
599
|
+
errors.push({ message: `Element "${id}": table sorting.mode "server" requires "state" path`, elementId: id, path: `/elements/${id}/props/sorting/state` });
|
|
600
|
+
}
|
|
601
|
+
}
|
|
602
|
+
if (props.pagination && typeof props.pagination === 'object') {
|
|
603
|
+
const pagination = props.pagination;
|
|
604
|
+
if (pagination.enabled && pagination.mode === 'server' && !pagination.state) {
|
|
605
|
+
errors.push({ message: `Element "${id}": table pagination.mode "server" requires "state" path`, elementId: id, path: `/elements/${id}/props/pagination/state` });
|
|
606
|
+
}
|
|
607
|
+
}
|
|
608
|
+
}
|
|
609
|
+
// File-upload validation
|
|
610
|
+
if (el.type === 'file-upload' && el.props && typeof el.props === 'object') {
|
|
611
|
+
const props = el.props;
|
|
612
|
+
if (props.maxSize !== undefined && (typeof props.maxSize !== 'number' || props.maxSize <= 0)) {
|
|
613
|
+
errors.push({ message: `Element "${id}": file-upload maxSize must be a positive number`, elementId: id, path: `/elements/${id}/props/maxSize` });
|
|
614
|
+
}
|
|
615
|
+
if (props.maxFiles !== undefined && (typeof props.maxFiles !== 'number' || props.maxFiles <= 0 || !Number.isInteger(props.maxFiles))) {
|
|
616
|
+
errors.push({ message: `Element "${id}": file-upload maxFiles must be a positive integer`, elementId: id, path: `/elements/${id}/props/maxFiles` });
|
|
617
|
+
}
|
|
618
|
+
}
|
|
619
|
+
// Skeleton validation
|
|
620
|
+
if (el.type === 'skeleton' && el.props && typeof el.props === 'object') {
|
|
621
|
+
const props = el.props;
|
|
622
|
+
const validVariants = ['text', 'circle', 'rect'];
|
|
623
|
+
if (props.variant !== undefined && !validVariants.includes(props.variant)) {
|
|
624
|
+
errors.push({ message: `Element "${id}": skeleton variant must be one of ${validVariants.join(', ')}`, elementId: id, path: `/elements/${id}/props/variant` });
|
|
625
|
+
}
|
|
626
|
+
if (props.height !== undefined && (typeof props.height !== 'number' || props.height <= 0)) {
|
|
627
|
+
errors.push({ message: `Element "${id}": skeleton height must be a positive number`, elementId: id, path: `/elements/${id}/props/height` });
|
|
628
|
+
}
|
|
629
|
+
if (props.count !== undefined && (typeof props.count !== 'number' || props.count <= 0 || !Number.isInteger(props.count))) {
|
|
630
|
+
errors.push({ message: `Element "${id}": skeleton count must be a positive integer`, elementId: id, path: `/elements/${id}/props/count` });
|
|
631
|
+
}
|
|
632
|
+
if (props.gap !== undefined && (typeof props.gap !== 'number' || props.gap < 0)) {
|
|
633
|
+
errors.push({ message: `Element "${id}": skeleton gap must be a non-negative number`, elementId: id, path: `/elements/${id}/props/gap` });
|
|
634
|
+
}
|
|
635
|
+
}
|
|
636
|
+
// Variant validation
|
|
637
|
+
if (el.props && typeof el.props === 'object') {
|
|
638
|
+
const props = el.props;
|
|
639
|
+
const variantVal = props.variant;
|
|
640
|
+
if (variantVal && typeof variantVal === 'string' && context?.variantTokens) {
|
|
641
|
+
const components = context.variantTokens.components;
|
|
642
|
+
if (components) {
|
|
643
|
+
const elType = el.type;
|
|
644
|
+
const typeVariants = components[elType];
|
|
645
|
+
if (!typeVariants || !typeVariants[variantVal]) {
|
|
646
|
+
errors.push({
|
|
647
|
+
message: `Element "${id}": variant "${variantVal}" not found in tokens.components.${elType}`,
|
|
648
|
+
elementId: id,
|
|
649
|
+
path: `/elements/${id}/props/variant`,
|
|
650
|
+
});
|
|
651
|
+
}
|
|
652
|
+
}
|
|
653
|
+
}
|
|
654
|
+
}
|
|
655
|
+
}
|
|
656
|
+
// Add orphan errors sorted by descending index (for safe sequential patch application)
|
|
657
|
+
orphanErrors.sort((a, b) => {
|
|
658
|
+
const idxA = parseInt(a.path.split('/').pop(), 10);
|
|
659
|
+
const idxB = parseInt(b.path.split('/').pop(), 10);
|
|
660
|
+
return idxB - idxA;
|
|
661
|
+
});
|
|
662
|
+
errors.push(...orphanErrors);
|
|
663
|
+
// Lint rule: spec-row-literal — walk all elements for $row literal usage.
|
|
664
|
+
for (const [id, element] of Object.entries(elements)) {
|
|
665
|
+
if (element && typeof element === 'object') {
|
|
666
|
+
walkForRowLiteral(element, `/elements/${id}`, warnings);
|
|
667
|
+
}
|
|
668
|
+
}
|
|
669
|
+
// Validate derive section
|
|
670
|
+
if (s.derive && typeof s.derive === 'object' && !Array.isArray(s.derive)) {
|
|
671
|
+
const derive = s.derive;
|
|
672
|
+
const derivePaths = new Set(Object.keys(derive));
|
|
673
|
+
const deriveDeps = new Map();
|
|
674
|
+
for (const [derivePath, expr] of Object.entries(derive)) {
|
|
675
|
+
const deps = new Set();
|
|
676
|
+
function walkDerive(v) {
|
|
677
|
+
if (v === null || v === undefined || typeof v !== 'object')
|
|
678
|
+
return;
|
|
679
|
+
if (Array.isArray(v)) {
|
|
680
|
+
for (const item of v)
|
|
681
|
+
walkDerive(item);
|
|
682
|
+
return;
|
|
683
|
+
}
|
|
684
|
+
const obj = v;
|
|
685
|
+
if ('$state' in obj && typeof obj.$state === 'string')
|
|
686
|
+
deps.add(obj.$state);
|
|
687
|
+
for (const val of Object.values(obj))
|
|
688
|
+
walkDerive(val);
|
|
689
|
+
}
|
|
690
|
+
walkDerive(expr);
|
|
691
|
+
deriveDeps.set(derivePath, deps);
|
|
692
|
+
validateExpression(expr, `derive:${derivePath}`, 'derive', errors);
|
|
693
|
+
}
|
|
694
|
+
const dVisited = new Set();
|
|
695
|
+
const dVisiting = new Set();
|
|
696
|
+
function visitDerive(derivePath) {
|
|
697
|
+
if (dVisited.has(derivePath))
|
|
698
|
+
return;
|
|
699
|
+
if (dVisiting.has(derivePath)) {
|
|
700
|
+
errors.push({ message: `Derive circular dependency: "${derivePath}" depends on itself (direct or indirect cycle)` });
|
|
701
|
+
return;
|
|
702
|
+
}
|
|
703
|
+
dVisiting.add(derivePath);
|
|
704
|
+
const deps = deriveDeps.get(derivePath) ?? new Set();
|
|
705
|
+
for (const dep of deps) {
|
|
706
|
+
if (derivePaths.has(dep))
|
|
707
|
+
visitDerive(dep);
|
|
708
|
+
}
|
|
709
|
+
dVisiting.delete(derivePath);
|
|
710
|
+
dVisited.add(derivePath);
|
|
711
|
+
}
|
|
712
|
+
for (const derivePath of derivePaths)
|
|
713
|
+
visitDerive(derivePath);
|
|
714
|
+
}
|
|
715
|
+
// Validate dataSources
|
|
716
|
+
if (s.dataSources && typeof s.dataSources === 'object') {
|
|
717
|
+
for (const [dsId, ds] of Object.entries(s.dataSources)) {
|
|
718
|
+
if (!ds.url)
|
|
719
|
+
errors.push({ message: `dataSource "${dsId}" requires "url"`, path: `/dataSources/${dsId}/url` });
|
|
720
|
+
if (!ds.target)
|
|
721
|
+
errors.push({ message: `dataSource "${dsId}" requires "target"`, path: `/dataSources/${dsId}/target` });
|
|
722
|
+
}
|
|
723
|
+
}
|
|
724
|
+
// Validate templates
|
|
725
|
+
if (s.templates && typeof s.templates === 'object') {
|
|
726
|
+
for (const [tmplId, tmpl] of Object.entries(s.templates)) {
|
|
727
|
+
if (!tmpl.type || typeof tmpl.type !== 'string') {
|
|
728
|
+
errors.push({ message: `template "${tmplId}" requires "type" string`, path: `/templates/${tmplId}/type` });
|
|
729
|
+
}
|
|
730
|
+
}
|
|
731
|
+
}
|
|
732
|
+
// Validate forms config — auto-fix #4
|
|
733
|
+
if (s.forms && typeof s.forms === 'object') {
|
|
734
|
+
const knownValidators = new Set([
|
|
735
|
+
'required', 'email', 'minLength', 'maxLength', 'pattern',
|
|
736
|
+
'min', 'max', 'numeric', 'url', 'matches', 'equalTo',
|
|
737
|
+
'lessThan', 'greaterThan', 'requiredIf',
|
|
738
|
+
]);
|
|
739
|
+
for (const [formId, form] of Object.entries(s.forms)) {
|
|
740
|
+
if (!form.fields || typeof form.fields !== 'object') {
|
|
741
|
+
errors.push({ message: `form "${formId}" requires "fields" object`, path: `/forms/${formId}/fields` });
|
|
742
|
+
continue;
|
|
743
|
+
}
|
|
744
|
+
for (const [fieldId, field] of Object.entries(form.fields)) {
|
|
745
|
+
if (!field.statePath || typeof field.statePath !== 'string') {
|
|
746
|
+
errors.push({ message: `form "${formId}" field "${fieldId}" requires "statePath" string`, path: `/forms/${formId}/fields/${fieldId}/statePath` });
|
|
747
|
+
}
|
|
748
|
+
if (field.rules && Array.isArray(field.rules)) {
|
|
749
|
+
for (let i = 0; i < field.rules.length; i++) {
|
|
750
|
+
const rule = field.rules[i];
|
|
751
|
+
if (rule.type && typeof rule.type === 'string' && !knownValidators.has(rule.type)) {
|
|
752
|
+
const error = {
|
|
753
|
+
message: `form "${formId}" field "${fieldId}": unknown validator type "${rule.type}"`,
|
|
754
|
+
path: `/forms/${formId}/fields/${fieldId}/rules/${i}/type`,
|
|
755
|
+
};
|
|
756
|
+
if (doFixes) {
|
|
757
|
+
const suggested = suggest(rule.type, Array.from(knownValidators));
|
|
758
|
+
if (suggested) {
|
|
759
|
+
error.suggestedFixes = [{
|
|
760
|
+
patch: { op: 'replace', path: `/forms/${formId}/fields/${fieldId}/rules/${i}/type`, value: suggested },
|
|
761
|
+
confidence: 'high',
|
|
762
|
+
description: `validator '${rule.type}' → '${suggested}' (Levenshtein match)`,
|
|
763
|
+
}];
|
|
764
|
+
}
|
|
765
|
+
}
|
|
766
|
+
errors.push(error);
|
|
767
|
+
}
|
|
768
|
+
}
|
|
769
|
+
}
|
|
770
|
+
}
|
|
771
|
+
}
|
|
772
|
+
}
|
|
773
|
+
// Check for circular references
|
|
774
|
+
function checkCircular(id, ancestors) {
|
|
775
|
+
if (ancestors.has(id)) {
|
|
776
|
+
errors.push({ message: `Circular reference detected: element "${id}" references itself in its children chain`, elementId: id });
|
|
777
|
+
return;
|
|
778
|
+
}
|
|
779
|
+
const el = elements[id];
|
|
780
|
+
if (el?.children && Array.isArray(el.children)) {
|
|
781
|
+
const newAncestors = new Set(ancestors);
|
|
782
|
+
newAncestors.add(id);
|
|
783
|
+
for (const childId of el.children) {
|
|
784
|
+
if (elements[childId]) {
|
|
785
|
+
checkCircular(childId, newAncestors);
|
|
786
|
+
}
|
|
787
|
+
}
|
|
788
|
+
}
|
|
789
|
+
}
|
|
790
|
+
if (elements[root]) {
|
|
791
|
+
checkCircular(root, new Set());
|
|
792
|
+
}
|
|
793
|
+
// ── v49 Item E: derive + dataSources structural checks ──
|
|
794
|
+
// (Cycle detection in derive is handled inline above; these add 7 additional checks.)
|
|
795
|
+
const DEFAULT_PROTECTED_PATTERNS = ['/tx/*', '/ui/forms/*', '/auth/*'];
|
|
796
|
+
function isUnderProtectedPattern(path) {
|
|
797
|
+
return DEFAULT_PROTECTED_PATTERNS.some((pattern) => {
|
|
798
|
+
if (pattern.endsWith('/*')) {
|
|
799
|
+
const prefix = pattern.slice(0, -1); // e.g. "/auth/"
|
|
800
|
+
if (path.startsWith(prefix))
|
|
801
|
+
return true;
|
|
802
|
+
// Also match the bare prefix without trailing slash (e.g. "/auth")
|
|
803
|
+
if (path === pattern.slice(0, -2))
|
|
804
|
+
return true;
|
|
805
|
+
return false;
|
|
806
|
+
}
|
|
807
|
+
return path === pattern;
|
|
808
|
+
});
|
|
809
|
+
}
|
|
810
|
+
function isUrlTemplateWellFormed(url) {
|
|
811
|
+
let i = 0;
|
|
812
|
+
while (i < url.length) {
|
|
813
|
+
const open = url.indexOf('${', i);
|
|
814
|
+
if (open === -1)
|
|
815
|
+
return true;
|
|
816
|
+
const close = url.indexOf('}', open + 2);
|
|
817
|
+
if (close === -1)
|
|
818
|
+
return false; // unclosed
|
|
819
|
+
if (close === open + 2)
|
|
820
|
+
return false; // empty ${}
|
|
821
|
+
i = close + 1;
|
|
822
|
+
}
|
|
823
|
+
return true;
|
|
824
|
+
}
|
|
825
|
+
function containsTemplatePattern(s) {
|
|
826
|
+
return /\$\{[^}]+\}/.test(s);
|
|
827
|
+
}
|
|
828
|
+
if (s.derive && typeof s.derive === 'object' && !Array.isArray(s.derive)) {
|
|
829
|
+
const derive = s.derive;
|
|
830
|
+
// Check 1: empty derive entries (undefined value)
|
|
831
|
+
for (const [path, expr] of Object.entries(derive)) {
|
|
832
|
+
if (expr === undefined) {
|
|
833
|
+
errors.push({ message: `Derive path "${path}" has empty (undefined) expression` });
|
|
834
|
+
}
|
|
835
|
+
}
|
|
836
|
+
// Check 3: derive path under default protected pattern
|
|
837
|
+
for (const path of Object.keys(derive)) {
|
|
838
|
+
if (isUnderProtectedPattern(path)) {
|
|
839
|
+
errors.push({ message: `Derive path "${path}" is under a default protected pattern (/tx/*, /ui/forms/*, /auth/*) and cannot be used as a derive target` });
|
|
840
|
+
}
|
|
841
|
+
}
|
|
842
|
+
}
|
|
843
|
+
if (s.dataSources && typeof s.dataSources === 'object' && !Array.isArray(s.dataSources)) {
|
|
844
|
+
const dataSources = s.dataSources;
|
|
845
|
+
// Check 4: derive path conflicts with dataSources target
|
|
846
|
+
if (s.derive && typeof s.derive === 'object') {
|
|
847
|
+
const derivePaths = new Set(Object.keys(s.derive));
|
|
848
|
+
for (const [id, ds] of Object.entries(dataSources)) {
|
|
849
|
+
if (typeof ds.target === 'string' && derivePaths.has(ds.target)) {
|
|
850
|
+
errors.push({ message: `Derive path "${ds.target}" conflicts with dataSources["${id}"].target — both want to write the same path` });
|
|
851
|
+
}
|
|
852
|
+
}
|
|
853
|
+
}
|
|
854
|
+
for (const [id, ds] of Object.entries(dataSources)) {
|
|
855
|
+
// Check 5: object-form $template syntax
|
|
856
|
+
if (ds.url && typeof ds.url === 'object' && !Array.isArray(ds.url)) {
|
|
857
|
+
const urlObj = ds.url;
|
|
858
|
+
if (typeof urlObj.$template === 'string' && !isUrlTemplateWellFormed(urlObj.$template)) {
|
|
859
|
+
errors.push({ message: `dataSources["${id}"].url has malformed $template (unclosed \${ or empty \${}): "${urlObj.$template}"` });
|
|
860
|
+
}
|
|
861
|
+
}
|
|
862
|
+
// Check 8 (NEW v49 Item E): plain-string URL containing ${...} — resolver does NOT substitute
|
|
863
|
+
if (typeof ds.url === 'string' && containsTemplatePattern(ds.url)) {
|
|
864
|
+
errors.push({ message: `dataSources["${id}"].url is a plain string containing \${...} which the resolver does NOT substitute. Wrap in $template: { $template: "${ds.url}" } to enable templating.` });
|
|
865
|
+
}
|
|
866
|
+
// Check 6: target validation
|
|
867
|
+
if (typeof ds.target === 'string') {
|
|
868
|
+
if (!ds.target.startsWith('/')) {
|
|
869
|
+
errors.push({ message: `dataSources["${id}"].target must start with "/" — got "${ds.target}"` });
|
|
870
|
+
}
|
|
871
|
+
if (isUnderProtectedPattern(ds.target)) {
|
|
872
|
+
errors.push({ message: `dataSources["${id}"].target "${ds.target}" is under a default protected pattern and cannot be used as a write target` });
|
|
873
|
+
}
|
|
874
|
+
}
|
|
875
|
+
}
|
|
876
|
+
}
|
|
877
|
+
// Check 7: setState action targeting a derive path (read-only at runtime)
|
|
878
|
+
if (s.derive && typeof s.derive === 'object') {
|
|
879
|
+
const derivePaths = new Set(Object.keys(s.derive));
|
|
880
|
+
function walkBindingsForSetState(obj) {
|
|
881
|
+
if (!obj || typeof obj !== 'object')
|
|
882
|
+
return;
|
|
883
|
+
if (Array.isArray(obj)) {
|
|
884
|
+
obj.forEach(walkBindingsForSetState);
|
|
885
|
+
return;
|
|
886
|
+
}
|
|
887
|
+
const o = obj;
|
|
888
|
+
if (o.action === 'setState' && o.params && typeof o.params === 'object') {
|
|
889
|
+
const path = o.params.statePath;
|
|
890
|
+
if (typeof path === 'string' && derivePaths.has(path)) {
|
|
891
|
+
errors.push({ message: `setState action targets derive path "${path}" — derive paths are read-only at runtime` });
|
|
892
|
+
}
|
|
893
|
+
}
|
|
894
|
+
for (const v of Object.values(o))
|
|
895
|
+
walkBindingsForSetState(v);
|
|
896
|
+
}
|
|
897
|
+
walkBindingsForSetState(s.elements);
|
|
898
|
+
if (s.initialActions)
|
|
899
|
+
walkBindingsForSetState(s.initialActions);
|
|
900
|
+
}
|
|
901
|
+
return { valid: errors.length === 0, errors, ...(warnings.length > 0 ? { warnings } : {}) };
|
|
902
|
+
}
|
|
903
|
+
//# sourceMappingURL=spec-validator.js.map
|