@appinternalleads/ui 0.3.0 → 0.4.1
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/dist/cjs/agent/AgentComponent.js +1 -1
- package/dist/cjs/agent/AgentComponent.js.map +1 -1
- package/dist/cjs/agent/base.js +25 -0
- package/dist/cjs/agent/base.js.map +1 -0
- package/dist/cjs/agent/catalog.js +0 -32
- package/dist/cjs/agent/catalog.js.map +1 -1
- package/dist/cjs/agent/core.js +22 -20
- package/dist/cjs/agent/core.js.map +1 -1
- package/dist/cjs/agent/index.js +6 -5
- package/dist/cjs/agent/index.js.map +1 -1
- package/dist/cjs/agent/manifests.js +81 -1
- package/dist/cjs/agent/manifests.js.map +1 -1
- package/dist/cjs/agent/result.js +6 -0
- package/dist/cjs/agent/result.js.map +1 -1
- package/dist/cjs/agent/search/document.js +50 -0
- package/dist/cjs/agent/search/document.js.map +1 -0
- package/dist/cjs/agent/search/embedding.js +107 -0
- package/dist/cjs/agent/search/embedding.js.map +1 -0
- package/dist/cjs/agent/search/index.js +25 -0
- package/dist/cjs/agent/search/index.js.map +1 -0
- package/dist/cjs/agent/search/lexical.js +28 -0
- package/dist/cjs/agent/search/lexical.js.map +1 -0
- package/dist/cjs/agent/search/normalize.js +15 -0
- package/dist/cjs/agent/search/normalize.js.map +1 -0
- package/dist/cjs/agent/search/search.js +123 -0
- package/dist/cjs/agent/search/search.js.map +1 -0
- package/dist/cjs/agent/search/searchIndex.js +120 -0
- package/dist/cjs/agent/search/searchIndex.js.map +1 -0
- package/dist/cjs/agent/search/types.js +8 -0
- package/dist/cjs/agent/search/types.js.map +1 -0
- package/dist/cjs/agent/search/weights.js +34 -0
- package/dist/cjs/agent/search/weights.js.map +1 -0
- package/dist/cjs/agent/search/wordvectors.json +1 -0
- package/dist/cjs/components/catalog.js +18 -0
- package/dist/cjs/components/catalog.js.map +1 -1
- package/dist/cjs/components/onboarding/animated-status/AnimatedStage.js +21 -0
- package/dist/cjs/components/onboarding/animated-status/AnimatedStage.js.map +1 -0
- package/dist/cjs/components/onboarding/animated-status/AnimatedStage.types.js +6 -0
- package/dist/cjs/components/onboarding/animated-status/AnimatedStage.types.js.map +1 -0
- package/dist/cjs/components/onboarding/animated-status/AnimatedStage.web.js +89 -0
- package/dist/cjs/components/onboarding/animated-status/AnimatedStage.web.js.map +1 -0
- package/dist/cjs/components/onboarding/animated-status/AnimatedStatusView.js +62 -0
- package/dist/cjs/components/onboarding/animated-status/AnimatedStatusView.js.map +1 -0
- package/dist/cjs/components/onboarding/animated-status/AnimatedStill.js +20 -0
- package/dist/cjs/components/onboarding/animated-status/AnimatedStill.js.map +1 -0
- package/dist/cjs/components/onboarding/animated-status/contract.js +87 -0
- package/dist/cjs/components/onboarding/animated-status/contract.js.map +1 -0
- package/dist/cjs/components/onboarding/animated-status/engine.js +40 -0
- package/dist/cjs/components/onboarding/animated-status/engine.js.map +1 -0
- package/dist/cjs/components/onboarding/animated-status/index.js +20 -0
- package/dist/cjs/components/onboarding/animated-status/index.js.map +1 -0
- package/dist/cjs/components/onboarding/animated-status/presets.json +126 -0
- package/dist/cjs/components/onboarding/animated-status/riv.js +7 -0
- package/dist/cjs/components/onboarding/animated-status/riv.js.map +1 -0
- package/dist/cjs/components/onboarding/index.js +4 -0
- package/dist/cjs/components/onboarding/index.js.map +1 -1
- package/dist/cjs/components/onboarding/presets.js +90 -84
- package/dist/cjs/components/onboarding/presets.js.map +1 -1
- package/dist/cjs/components/onboarding/receipt-printer/ReceiptStage.js +43 -6
- package/dist/cjs/components/onboarding/receipt-printer/ReceiptStage.js.map +1 -1
- package/dist/cjs/components/onboarding/send-completion/SendCompletionView.js +111 -0
- package/dist/cjs/components/onboarding/send-completion/SendCompletionView.js.map +1 -0
- package/dist/cjs/components/onboarding/send-completion/SendStage.js +37 -0
- package/dist/cjs/components/onboarding/send-completion/SendStage.js.map +1 -0
- package/dist/cjs/components/onboarding/send-completion/SendStage.types.js +6 -0
- package/dist/cjs/components/onboarding/send-completion/SendStage.types.js.map +1 -0
- package/dist/cjs/components/onboarding/send-completion/SendStage.web.js +107 -0
- package/dist/cjs/components/onboarding/send-completion/SendStage.web.js.map +1 -0
- package/dist/cjs/components/onboarding/send-completion/SendStill.js +17 -0
- package/dist/cjs/components/onboarding/send-completion/SendStill.js.map +1 -0
- package/dist/cjs/components/onboarding/send-completion/contract.js +83 -0
- package/dist/cjs/components/onboarding/send-completion/contract.js.map +1 -0
- package/dist/cjs/components/onboarding/send-completion/engine.js +32 -0
- package/dist/cjs/components/onboarding/send-completion/engine.js.map +1 -0
- package/dist/cjs/components/onboarding/send-completion/index.js +22 -0
- package/dist/cjs/components/onboarding/send-completion/index.js.map +1 -0
- package/dist/cjs/components/onboarding/send-completion/presets.json +132 -0
- package/dist/cjs/components/onboarding/send-completion/riv.js +7 -0
- package/dist/cjs/components/onboarding/send-completion/riv.js.map +1 -0
- package/dist/cjs/components/onboarding/shared/actions-data.js +2 -0
- package/dist/cjs/components/onboarding/shared/actions-data.js.map +1 -1
- package/dist/cjs/components/onboarding/shared/configColor.js +76 -0
- package/dist/cjs/components/onboarding/shared/configColor.js.map +1 -0
- package/dist/cjs/components/onboarding/shared/contract.js +4 -0
- package/dist/cjs/components/onboarding/shared/contract.js.map +1 -1
- package/dist/cjs/components/onboarding/shared/describe.js +1 -1
- package/dist/cjs/components/onboarding/shared/describe.js.map +1 -1
- package/dist/cjs/components/onboarding/shared/mock.js +2 -0
- package/dist/cjs/components/onboarding/shared/mock.js.map +1 -1
- package/dist/cjs/components/onboarding/views.js +8 -0
- package/dist/cjs/components/onboarding/views.js.map +1 -1
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/motion/MotionPlayer.js +42 -0
- package/dist/cjs/motion/MotionPlayer.js.map +1 -0
- package/dist/cjs/motion/agent.js +323 -0
- package/dist/cjs/motion/agent.js.map +1 -0
- package/dist/cjs/motion/cat/Cat.js +79 -0
- package/dist/cjs/motion/cat/Cat.js.map +1 -0
- package/dist/cjs/motion/cat/animation.js +204 -0
- package/dist/cjs/motion/cat/animation.js.map +1 -0
- package/dist/cjs/motion/cat/art.generated.js +37 -0
- package/dist/cjs/motion/cat/art.generated.js.map +1 -0
- package/dist/cjs/motion/cat/config.js +136 -0
- package/dist/cjs/motion/cat/config.js.map +1 -0
- package/dist/cjs/motion/cat/index.js +75 -0
- package/dist/cjs/motion/cat/index.js.map +1 -0
- package/dist/cjs/motion/cat/rig.js +99 -0
- package/dist/cjs/motion/cat/rig.js.map +1 -0
- package/dist/cjs/motion/cat/scene.js +148 -0
- package/dist/cjs/motion/cat/scene.js.map +1 -0
- package/dist/cjs/motion/configurable/config.js +477 -0
- package/dist/cjs/motion/configurable/config.js.map +1 -0
- package/dist/cjs/motion/configurable/controls.js +44 -0
- package/dist/cjs/motion/configurable/controls.js.map +1 -0
- package/dist/cjs/motion/easing.js +62 -0
- package/dist/cjs/motion/easing.js.map +1 -0
- package/dist/cjs/motion/fit.js +12 -0
- package/dist/cjs/motion/fit.js.map +1 -0
- package/dist/cjs/motion/index.js +101 -0
- package/dist/cjs/motion/index.js.map +1 -0
- package/dist/cjs/motion/neon/GlowRenderer.js +18 -0
- package/dist/cjs/motion/neon/GlowRenderer.js.map +1 -0
- package/dist/cjs/motion/neon/NeonCanvas.js +97 -0
- package/dist/cjs/motion/neon/NeonCanvas.js.map +1 -0
- package/dist/cjs/motion/neon/NeonText.js +108 -0
- package/dist/cjs/motion/neon/NeonText.js.map +1 -0
- package/dist/cjs/motion/neon/NeonTextFrame.js +36 -0
- package/dist/cjs/motion/neon/NeonTextFrame.js.map +1 -0
- package/dist/cjs/motion/neon/artwork.js +102 -0
- package/dist/cjs/motion/neon/artwork.js.map +1 -0
- package/dist/cjs/motion/neon/audio.js +165 -0
- package/dist/cjs/motion/neon/audio.js.map +1 -0
- package/dist/cjs/motion/neon/config.js +334 -0
- package/dist/cjs/motion/neon/config.js.map +1 -0
- package/dist/cjs/motion/neon/flicker.js +196 -0
- package/dist/cjs/motion/neon/flicker.js.map +1 -0
- package/dist/cjs/motion/neon/fonts.js +52 -0
- package/dist/cjs/motion/neon/fonts.js.map +1 -0
- package/dist/cjs/motion/neon/frame.js +24 -0
- package/dist/cjs/motion/neon/frame.js.map +1 -0
- package/dist/cjs/motion/neon/glitch.js +114 -0
- package/dist/cjs/motion/neon/glitch.js.map +1 -0
- package/dist/cjs/motion/neon/index.js +119 -0
- package/dist/cjs/motion/neon/index.js.map +1 -0
- package/dist/cjs/motion/neon/layers.js +68 -0
- package/dist/cjs/motion/neon/layers.js.map +1 -0
- package/dist/cjs/motion/neon/material.js +56 -0
- package/dist/cjs/motion/neon/material.js.map +1 -0
- package/dist/cjs/motion/neon/random.js +43 -0
- package/dist/cjs/motion/neon/random.js.map +1 -0
- package/dist/cjs/motion/neon/scene.js +549 -0
- package/dist/cjs/motion/neon/scene.js.map +1 -0
- package/dist/cjs/motion/neon/synth.js +213 -0
- package/dist/cjs/motion/neon/synth.js.map +1 -0
- package/dist/cjs/motion/neon/typography.js +81 -0
- package/dist/cjs/motion/neon/typography.js.map +1 -0
- package/dist/cjs/motion/neon/wall.js +113 -0
- package/dist/cjs/motion/neon/wall.js.map +1 -0
- package/dist/cjs/motion/paperfold/PaperFold.js +40 -0
- package/dist/cjs/motion/paperfold/PaperFold.js.map +1 -0
- package/dist/cjs/motion/paperfold/PaperFoldFrame.js +290 -0
- package/dist/cjs/motion/paperfold/PaperFoldFrame.js.map +1 -0
- package/dist/cjs/motion/paperfold/PaperFoldPlayer.js +59 -0
- package/dist/cjs/motion/paperfold/PaperFoldPlayer.js.map +1 -0
- package/dist/cjs/motion/paperfold/art.js +388 -0
- package/dist/cjs/motion/paperfold/art.js.map +1 -0
- package/dist/cjs/motion/paperfold/config.js +103 -0
- package/dist/cjs/motion/paperfold/config.js.map +1 -0
- package/dist/cjs/motion/paperfold/controls.js +493 -0
- package/dist/cjs/motion/paperfold/controls.js.map +1 -0
- package/dist/cjs/motion/paperfold/engine.js +722 -0
- package/dist/cjs/motion/paperfold/engine.js.map +1 -0
- package/dist/cjs/motion/paperfold/fonts.js +25 -0
- package/dist/cjs/motion/paperfold/fonts.js.map +1 -0
- package/dist/cjs/motion/paperfold/index.js +113 -0
- package/dist/cjs/motion/paperfold/index.js.map +1 -0
- package/dist/cjs/motion/paperfold/manipulate.js +170 -0
- package/dist/cjs/motion/paperfold/manipulate.js.map +1 -0
- package/dist/cjs/motion/paperfold/presets.js +119 -0
- package/dist/cjs/motion/paperfold/presets.js.map +1 -0
- package/dist/cjs/motion/paperfold/template.js +40 -0
- package/dist/cjs/motion/paperfold/template.js.map +1 -0
- package/dist/cjs/motion/player.js +203 -0
- package/dist/cjs/motion/player.js.map +1 -0
- package/dist/cjs/motion/promo/PromoFrame.js +293 -0
- package/dist/cjs/motion/promo/PromoFrame.js.map +1 -0
- package/dist/cjs/motion/promo/PromoShowcasePlayer.js +59 -0
- package/dist/cjs/motion/promo/PromoShowcasePlayer.js.map +1 -0
- package/dist/cjs/motion/promo/config.js +565 -0
- package/dist/cjs/motion/promo/config.js.map +1 -0
- package/dist/cjs/motion/promo/controls.js +571 -0
- package/dist/cjs/motion/promo/controls.js.map +1 -0
- package/dist/cjs/motion/promo/easing.js +35 -0
- package/dist/cjs/motion/promo/easing.js.map +1 -0
- package/dist/cjs/motion/promo/engine.js +567 -0
- package/dist/cjs/motion/promo/engine.js.map +1 -0
- package/dist/cjs/motion/promo/fonts.js +20 -0
- package/dist/cjs/motion/promo/fonts.js.map +1 -0
- package/dist/cjs/motion/promo/icons.js +29 -0
- package/dist/cjs/motion/promo/icons.js.map +1 -0
- package/dist/cjs/motion/promo/index.js +73 -0
- package/dist/cjs/motion/promo/index.js.map +1 -0
- package/dist/cjs/motion/promo/presets.js +44 -0
- package/dist/cjs/motion/promo/presets.js.map +1 -0
- package/dist/cjs/motion/promo/template.js +38 -0
- package/dist/cjs/motion/promo/template.js.map +1 -0
- package/dist/cjs/motion/replication2/Replication2Player.js +93 -0
- package/dist/cjs/motion/replication2/Replication2Player.js.map +1 -0
- package/dist/cjs/motion/replication2/config.js +352 -0
- package/dist/cjs/motion/replication2/config.js.map +1 -0
- package/dist/cjs/motion/replication2/controls.js +286 -0
- package/dist/cjs/motion/replication2/controls.js.map +1 -0
- package/dist/cjs/motion/replication2/driver.js +68 -0
- package/dist/cjs/motion/replication2/driver.js.map +1 -0
- package/dist/cjs/motion/replication2/easing.js +97 -0
- package/dist/cjs/motion/replication2/easing.js.map +1 -0
- package/dist/cjs/motion/replication2/engine.js +481 -0
- package/dist/cjs/motion/replication2/engine.js.map +1 -0
- package/dist/cjs/motion/replication2/html.js +88 -0
- package/dist/cjs/motion/replication2/html.js.map +1 -0
- package/dist/cjs/motion/replication2/index.js +61 -0
- package/dist/cjs/motion/replication2/index.js.map +1 -0
- package/dist/cjs/motion/replication2/measure.js +30 -0
- package/dist/cjs/motion/replication2/measure.js.map +1 -0
- package/dist/cjs/motion/replication2/metrics.js +10 -0
- package/dist/cjs/motion/replication2/metrics.js.map +1 -0
- package/dist/cjs/motion/replication2/presets.js +67 -0
- package/dist/cjs/motion/replication2/presets.js.map +1 -0
- package/dist/cjs/motion/replication2/riv.js +7 -0
- package/dist/cjs/motion/replication2/riv.js.map +1 -0
- package/dist/cjs/motion/replication2/rive-contract.js +158 -0
- package/dist/cjs/motion/replication2/rive-contract.js.map +1 -0
- package/dist/cjs/motion/replication2/template.js +35 -0
- package/dist/cjs/motion/replication2/template.js.map +1 -0
- package/dist/cjs/motion/sample.js +149 -0
- package/dist/cjs/motion/sample.js.map +1 -0
- package/dist/cjs/motion/templates/hey-template.js +1552 -0
- package/dist/cjs/motion/templates/hey-template.js.map +1 -0
- package/dist/cjs/motion/templates/index.js +22 -0
- package/dist/cjs/motion/templates/index.js.map +1 -0
- package/dist/cjs/motion/templates/word-motion.js +1165 -0
- package/dist/cjs/motion/templates/word-motion.js.map +1 -0
- package/dist/cjs/motion/types.js +3 -0
- package/dist/cjs/motion/types.js.map +1 -0
- package/dist/cjs/motion/typesurface/TypeSurfaceCanvas.js +62 -0
- package/dist/cjs/motion/typesurface/TypeSurfaceCanvas.js.map +1 -0
- package/dist/cjs/motion/typesurface/art.js +861 -0
- package/dist/cjs/motion/typesurface/art.js.map +1 -0
- package/dist/cjs/motion/typesurface/config.js +269 -0
- package/dist/cjs/motion/typesurface/config.js.map +1 -0
- package/dist/cjs/motion/typesurface/engine.js +607 -0
- package/dist/cjs/motion/typesurface/engine.js.map +1 -0
- package/dist/cjs/motion/typesurface/fonts.js +45 -0
- package/dist/cjs/motion/typesurface/fonts.js.map +1 -0
- package/dist/cjs/motion/typesurface/index.js +72 -0
- package/dist/cjs/motion/typesurface/index.js.map +1 -0
- package/dist/cjs/motion/typesurface/layout.js +130 -0
- package/dist/cjs/motion/typesurface/layout.js.map +1 -0
- package/dist/cjs/motion/typesurface/ops.js +175 -0
- package/dist/cjs/motion/typesurface/ops.js.map +1 -0
- package/dist/cjs/motion/typesurface/presets.js +192 -0
- package/dist/cjs/motion/typesurface/presets.js.map +1 -0
- package/dist/cjs/motion/typesurface/renderer.js +672 -0
- package/dist/cjs/motion/typesurface/renderer.js.map +1 -0
- package/dist/cjs/motion/typesurface/shaders.js +300 -0
- package/dist/cjs/motion/typesurface/shaders.js.map +1 -0
- package/dist/cjs/motion/typesurface/surfaces.js +156 -0
- package/dist/cjs/motion/typesurface/surfaces.js.map +1 -0
- package/dist/cjs/motion/typesurface/text.js +34 -0
- package/dist/cjs/motion/typesurface/text.js.map +1 -0
- package/dist/cjs/motion/typesurface/timeline.js +64 -0
- package/dist/cjs/motion/typesurface/timeline.js.map +1 -0
- package/dist/cjs/motion/validate.js +89 -0
- package/dist/cjs/motion/validate.js.map +1 -0
- package/dist/cjs/native/RiveReceiptStage.js +9 -150
- package/dist/cjs/native/RiveReceiptStage.js.map +1 -1
- package/dist/cjs/native/riveReceiptStageFactory.js +162 -0
- package/dist/cjs/native/riveReceiptStageFactory.js.map +1 -0
- package/dist/cjs/tokens/stage.js +10 -0
- package/dist/cjs/tokens/stage.js.map +1 -0
- package/dist/esm/agent/AgentComponent.js +1 -1
- package/dist/esm/agent/AgentComponent.js.map +1 -1
- package/dist/esm/agent/base.d.ts +11 -0
- package/dist/esm/agent/base.d.ts.map +1 -0
- package/dist/esm/agent/base.js +11 -0
- package/dist/esm/agent/base.js.map +1 -0
- package/dist/esm/agent/catalog.d.ts +0 -8
- package/dist/esm/agent/catalog.d.ts.map +1 -1
- package/dist/esm/agent/catalog.js +0 -31
- package/dist/esm/agent/catalog.js.map +1 -1
- package/dist/esm/agent/core.d.ts +6 -7
- package/dist/esm/agent/core.d.ts.map +1 -1
- package/dist/esm/agent/core.js +6 -7
- package/dist/esm/agent/core.js.map +1 -1
- package/dist/esm/agent/index.d.ts +6 -5
- package/dist/esm/agent/index.d.ts.map +1 -1
- package/dist/esm/agent/index.js +6 -5
- package/dist/esm/agent/index.js.map +1 -1
- package/dist/esm/agent/manifests.d.ts.map +1 -1
- package/dist/esm/agent/manifests.js +81 -1
- package/dist/esm/agent/manifests.js.map +1 -1
- package/dist/esm/agent/result.d.ts.map +1 -1
- package/dist/esm/agent/result.js +6 -0
- package/dist/esm/agent/result.js.map +1 -1
- package/dist/esm/agent/search/document.d.ts +6 -0
- package/dist/esm/agent/search/document.d.ts.map +1 -0
- package/dist/esm/agent/search/document.js +46 -0
- package/dist/esm/agent/search/document.js.map +1 -0
- package/dist/esm/agent/search/embedding.d.ts +31 -0
- package/dist/esm/agent/search/embedding.d.ts.map +1 -0
- package/dist/esm/agent/search/embedding.js +103 -0
- package/dist/esm/agent/search/embedding.js.map +1 -0
- package/dist/esm/agent/search/index.d.ts +10 -0
- package/dist/esm/agent/search/index.d.ts.map +1 -0
- package/dist/esm/agent/search/index.js +17 -0
- package/dist/esm/agent/search/index.js.map +1 -0
- package/dist/esm/agent/search/lexical.d.ts +3 -0
- package/dist/esm/agent/search/lexical.d.ts.map +1 -0
- package/dist/esm/agent/search/lexical.js +25 -0
- package/dist/esm/agent/search/lexical.js.map +1 -0
- package/dist/esm/agent/search/normalize.d.ts +13 -0
- package/dist/esm/agent/search/normalize.d.ts.map +1 -0
- package/dist/esm/agent/search/normalize.js +12 -0
- package/dist/esm/agent/search/normalize.js.map +1 -0
- package/dist/esm/agent/search/search.d.ts +42 -0
- package/dist/esm/agent/search/search.d.ts.map +1 -0
- package/dist/esm/agent/search/search.js +119 -0
- package/dist/esm/agent/search/search.js.map +1 -0
- package/dist/esm/agent/search/searchIndex.d.ts +42 -0
- package/dist/esm/agent/search/searchIndex.d.ts.map +1 -0
- package/dist/esm/agent/search/searchIndex.js +114 -0
- package/dist/esm/agent/search/searchIndex.js.map +1 -0
- package/dist/esm/agent/search/types.d.ts +67 -0
- package/dist/esm/agent/search/types.d.ts.map +1 -0
- package/dist/esm/agent/search/types.js +7 -0
- package/dist/esm/agent/search/types.js.map +1 -0
- package/dist/esm/agent/search/weights.d.ts +22 -0
- package/dist/esm/agent/search/weights.d.ts.map +1 -0
- package/dist/esm/agent/search/weights.js +31 -0
- package/dist/esm/agent/search/weights.js.map +1 -0
- package/dist/esm/agent/search/wordvectors.json +1 -0
- package/dist/esm/agent/types.d.ts +1 -1
- package/dist/esm/agent/types.d.ts.map +1 -1
- package/dist/esm/components/catalog.d.ts +1 -1
- package/dist/esm/components/catalog.d.ts.map +1 -1
- package/dist/esm/components/catalog.js +18 -0
- package/dist/esm/components/catalog.js.map +1 -1
- package/dist/esm/components/onboarding/animated-status/AnimatedStage.d.ts +9 -0
- package/dist/esm/components/onboarding/animated-status/AnimatedStage.d.ts.map +1 -0
- package/dist/esm/components/onboarding/animated-status/AnimatedStage.js +18 -0
- package/dist/esm/components/onboarding/animated-status/AnimatedStage.js.map +1 -0
- package/dist/esm/components/onboarding/animated-status/AnimatedStage.types.d.ts +31 -0
- package/dist/esm/components/onboarding/animated-status/AnimatedStage.types.d.ts.map +1 -0
- package/dist/esm/components/onboarding/animated-status/AnimatedStage.types.js +3 -0
- package/dist/esm/components/onboarding/animated-status/AnimatedStage.types.js.map +1 -0
- package/dist/esm/components/onboarding/animated-status/AnimatedStage.web.d.ts +4 -0
- package/dist/esm/components/onboarding/animated-status/AnimatedStage.web.d.ts.map +1 -0
- package/dist/esm/components/onboarding/animated-status/AnimatedStage.web.js +86 -0
- package/dist/esm/components/onboarding/animated-status/AnimatedStage.web.js.map +1 -0
- package/dist/esm/components/onboarding/animated-status/AnimatedStatusView.d.ts +32 -0
- package/dist/esm/components/onboarding/animated-status/AnimatedStatusView.d.ts.map +1 -0
- package/dist/esm/components/onboarding/animated-status/AnimatedStatusView.js +59 -0
- package/dist/esm/components/onboarding/animated-status/AnimatedStatusView.js.map +1 -0
- package/dist/esm/components/onboarding/animated-status/AnimatedStill.d.ts +8 -0
- package/dist/esm/components/onboarding/animated-status/AnimatedStill.d.ts.map +1 -0
- package/dist/esm/components/onboarding/animated-status/AnimatedStill.js +17 -0
- package/dist/esm/components/onboarding/animated-status/AnimatedStill.js.map +1 -0
- package/dist/esm/components/onboarding/animated-status/contract.d.ts +61 -0
- package/dist/esm/components/onboarding/animated-status/contract.d.ts.map +1 -0
- package/dist/esm/components/onboarding/animated-status/contract.js +78 -0
- package/dist/esm/components/onboarding/animated-status/contract.js.map +1 -0
- package/dist/esm/components/onboarding/animated-status/engine.d.ts +24 -0
- package/dist/esm/components/onboarding/animated-status/engine.d.ts.map +1 -0
- package/dist/esm/components/onboarding/animated-status/engine.js +32 -0
- package/dist/esm/components/onboarding/animated-status/engine.js.map +1 -0
- package/dist/esm/components/onboarding/animated-status/index.d.ts +5 -0
- package/dist/esm/components/onboarding/animated-status/index.d.ts.map +1 -0
- package/dist/esm/components/onboarding/animated-status/index.js +4 -0
- package/dist/esm/components/onboarding/animated-status/index.js.map +1 -0
- package/dist/esm/components/onboarding/animated-status/presets.json +126 -0
- package/dist/esm/components/onboarding/animated-status/riv.d.ts +3 -0
- package/dist/esm/components/onboarding/animated-status/riv.d.ts.map +1 -0
- package/dist/esm/components/onboarding/animated-status/riv.js +4 -0
- package/dist/esm/components/onboarding/animated-status/riv.js.map +1 -0
- package/dist/esm/components/onboarding/index.d.ts +2 -0
- package/dist/esm/components/onboarding/index.d.ts.map +1 -1
- package/dist/esm/components/onboarding/index.js +4 -0
- package/dist/esm/components/onboarding/index.js.map +1 -1
- package/dist/esm/components/onboarding/presets.d.ts.map +1 -1
- package/dist/esm/components/onboarding/presets.js +6 -0
- package/dist/esm/components/onboarding/presets.js.map +1 -1
- package/dist/esm/components/onboarding/receipt-printer/ReceiptStage.d.ts +4 -6
- package/dist/esm/components/onboarding/receipt-printer/ReceiptStage.d.ts.map +1 -1
- package/dist/esm/components/onboarding/receipt-printer/ReceiptStage.js +42 -6
- package/dist/esm/components/onboarding/receipt-printer/ReceiptStage.js.map +1 -1
- package/dist/esm/components/onboarding/send-completion/SendCompletionView.d.ts +47 -0
- package/dist/esm/components/onboarding/send-completion/SendCompletionView.d.ts.map +1 -0
- package/dist/esm/components/onboarding/send-completion/SendCompletionView.js +108 -0
- package/dist/esm/components/onboarding/send-completion/SendCompletionView.js.map +1 -0
- package/dist/esm/components/onboarding/send-completion/SendStage.d.ts +9 -0
- package/dist/esm/components/onboarding/send-completion/SendStage.d.ts.map +1 -0
- package/dist/esm/components/onboarding/send-completion/SendStage.js +34 -0
- package/dist/esm/components/onboarding/send-completion/SendStage.js.map +1 -0
- package/dist/esm/components/onboarding/send-completion/SendStage.types.d.ts +33 -0
- package/dist/esm/components/onboarding/send-completion/SendStage.types.d.ts.map +1 -0
- package/dist/esm/components/onboarding/send-completion/SendStage.types.js +3 -0
- package/dist/esm/components/onboarding/send-completion/SendStage.types.js.map +1 -0
- package/dist/esm/components/onboarding/send-completion/SendStage.web.d.ts +4 -0
- package/dist/esm/components/onboarding/send-completion/SendStage.web.d.ts.map +1 -0
- package/dist/esm/components/onboarding/send-completion/SendStage.web.js +104 -0
- package/dist/esm/components/onboarding/send-completion/SendStage.web.js.map +1 -0
- package/dist/esm/components/onboarding/send-completion/SendStill.d.ts +11 -0
- package/dist/esm/components/onboarding/send-completion/SendStill.d.ts.map +1 -0
- package/dist/esm/components/onboarding/send-completion/SendStill.js +14 -0
- package/dist/esm/components/onboarding/send-completion/SendStill.js.map +1 -0
- package/dist/esm/components/onboarding/send-completion/contract.d.ts +99 -0
- package/dist/esm/components/onboarding/send-completion/contract.d.ts.map +1 -0
- package/dist/esm/components/onboarding/send-completion/contract.js +76 -0
- package/dist/esm/components/onboarding/send-completion/contract.js.map +1 -0
- package/dist/esm/components/onboarding/send-completion/engine.d.ts +20 -0
- package/dist/esm/components/onboarding/send-completion/engine.d.ts.map +1 -0
- package/dist/esm/components/onboarding/send-completion/engine.js +28 -0
- package/dist/esm/components/onboarding/send-completion/engine.js.map +1 -0
- package/dist/esm/components/onboarding/send-completion/index.d.ts +6 -0
- package/dist/esm/components/onboarding/send-completion/index.d.ts.map +1 -0
- package/dist/esm/components/onboarding/send-completion/index.js +6 -0
- package/dist/esm/components/onboarding/send-completion/index.js.map +1 -0
- package/dist/esm/components/onboarding/send-completion/presets.json +132 -0
- package/dist/esm/components/onboarding/send-completion/riv.d.ts +3 -0
- package/dist/esm/components/onboarding/send-completion/riv.d.ts.map +1 -0
- package/dist/esm/components/onboarding/send-completion/riv.js +4 -0
- package/dist/esm/components/onboarding/send-completion/riv.js.map +1 -0
- package/dist/esm/components/onboarding/shared/actions-data.d.ts.map +1 -1
- package/dist/esm/components/onboarding/shared/actions-data.js +2 -0
- package/dist/esm/components/onboarding/shared/actions-data.js.map +1 -1
- package/dist/esm/components/onboarding/shared/configColor.d.ts +29 -0
- package/dist/esm/components/onboarding/shared/configColor.d.ts.map +1 -0
- package/dist/esm/components/onboarding/shared/configColor.js +69 -0
- package/dist/esm/components/onboarding/shared/configColor.js.map +1 -0
- package/dist/esm/components/onboarding/shared/contract.d.ts +1 -1
- package/dist/esm/components/onboarding/shared/contract.d.ts.map +1 -1
- package/dist/esm/components/onboarding/shared/contract.js +4 -0
- package/dist/esm/components/onboarding/shared/contract.js.map +1 -1
- package/dist/esm/components/onboarding/shared/describe.d.ts.map +1 -1
- package/dist/esm/components/onboarding/shared/describe.js +1 -1
- package/dist/esm/components/onboarding/shared/describe.js.map +1 -1
- package/dist/esm/components/onboarding/shared/mock.d.ts +2 -0
- package/dist/esm/components/onboarding/shared/mock.d.ts.map +1 -1
- package/dist/esm/components/onboarding/shared/mock.js +2 -0
- package/dist/esm/components/onboarding/shared/mock.js.map +1 -1
- package/dist/esm/components/onboarding/views.d.ts.map +1 -1
- package/dist/esm/components/onboarding/views.js +8 -0
- package/dist/esm/components/onboarding/views.js.map +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/motion/MotionPlayer.d.ts +22 -0
- package/dist/esm/motion/MotionPlayer.d.ts.map +1 -0
- package/dist/esm/motion/MotionPlayer.js +39 -0
- package/dist/esm/motion/MotionPlayer.js.map +1 -0
- package/dist/esm/motion/agent.d.ts +146 -0
- package/dist/esm/motion/agent.d.ts.map +1 -0
- package/dist/esm/motion/agent.js +278 -0
- package/dist/esm/motion/agent.js.map +1 -0
- package/dist/esm/motion/cat/Cat.d.ts +43 -0
- package/dist/esm/motion/cat/Cat.d.ts.map +1 -0
- package/dist/esm/motion/cat/Cat.js +74 -0
- package/dist/esm/motion/cat/Cat.js.map +1 -0
- package/dist/esm/motion/cat/animation.d.ts +86 -0
- package/dist/esm/motion/cat/animation.d.ts.map +1 -0
- package/dist/esm/motion/cat/animation.js +193 -0
- package/dist/esm/motion/cat/animation.js.map +1 -0
- package/dist/esm/motion/cat/art.generated.d.ts +53 -0
- package/dist/esm/motion/cat/art.generated.d.ts.map +1 -0
- package/dist/esm/motion/cat/art.generated.js +34 -0
- package/dist/esm/motion/cat/art.generated.js.map +1 -0
- package/dist/esm/motion/cat/config.d.ts +103 -0
- package/dist/esm/motion/cat/config.d.ts.map +1 -0
- package/dist/esm/motion/cat/config.js +129 -0
- package/dist/esm/motion/cat/config.js.map +1 -0
- package/dist/esm/motion/cat/index.d.ts +13 -0
- package/dist/esm/motion/cat/index.d.ts.map +1 -0
- package/dist/esm/motion/cat/index.js +13 -0
- package/dist/esm/motion/cat/index.js.map +1 -0
- package/dist/esm/motion/cat/rig.d.ts +44 -0
- package/dist/esm/motion/cat/rig.d.ts.map +1 -0
- package/dist/esm/motion/cat/rig.js +86 -0
- package/dist/esm/motion/cat/rig.js.map +1 -0
- package/dist/esm/motion/cat/scene.d.ts +66 -0
- package/dist/esm/motion/cat/scene.d.ts.map +1 -0
- package/dist/esm/motion/cat/scene.js +137 -0
- package/dist/esm/motion/cat/scene.js.map +1 -0
- package/dist/esm/motion/configurable/config.d.ts +80 -0
- package/dist/esm/motion/configurable/config.d.ts.map +1 -0
- package/dist/esm/motion/configurable/config.js +468 -0
- package/dist/esm/motion/configurable/config.js.map +1 -0
- package/dist/esm/motion/configurable/controls.d.ts +74 -0
- package/dist/esm/motion/configurable/controls.d.ts.map +1 -0
- package/dist/esm/motion/configurable/controls.js +38 -0
- package/dist/esm/motion/configurable/controls.js.map +1 -0
- package/dist/esm/motion/easing.d.ts +4 -0
- package/dist/esm/motion/easing.d.ts.map +1 -0
- package/dist/esm/motion/easing.js +58 -0
- package/dist/esm/motion/easing.js.map +1 -0
- package/dist/esm/motion/fit.d.ts +8 -0
- package/dist/esm/motion/fit.d.ts.map +1 -0
- package/dist/esm/motion/fit.js +8 -0
- package/dist/esm/motion/fit.js.map +1 -0
- package/dist/esm/motion/index.d.ts +27 -0
- package/dist/esm/motion/index.d.ts.map +1 -0
- package/dist/esm/motion/index.js +21 -0
- package/dist/esm/motion/index.js.map +1 -0
- package/dist/esm/motion/neon/GlowRenderer.d.ts +31 -0
- package/dist/esm/motion/neon/GlowRenderer.d.ts.map +1 -0
- package/dist/esm/motion/neon/GlowRenderer.js +14 -0
- package/dist/esm/motion/neon/GlowRenderer.js.map +1 -0
- package/dist/esm/motion/neon/NeonCanvas.d.ts +42 -0
- package/dist/esm/motion/neon/NeonCanvas.d.ts.map +1 -0
- package/dist/esm/motion/neon/NeonCanvas.js +92 -0
- package/dist/esm/motion/neon/NeonCanvas.js.map +1 -0
- package/dist/esm/motion/neon/NeonText.d.ts +26 -0
- package/dist/esm/motion/neon/NeonText.d.ts.map +1 -0
- package/dist/esm/motion/neon/NeonText.js +103 -0
- package/dist/esm/motion/neon/NeonText.js.map +1 -0
- package/dist/esm/motion/neon/NeonTextFrame.d.ts +29 -0
- package/dist/esm/motion/neon/NeonTextFrame.d.ts.map +1 -0
- package/dist/esm/motion/neon/NeonTextFrame.js +33 -0
- package/dist/esm/motion/neon/NeonTextFrame.js.map +1 -0
- package/dist/esm/motion/neon/artwork.d.ts +29 -0
- package/dist/esm/motion/neon/artwork.d.ts.map +1 -0
- package/dist/esm/motion/neon/artwork.js +98 -0
- package/dist/esm/motion/neon/artwork.js.map +1 -0
- package/dist/esm/motion/neon/audio.d.ts +49 -0
- package/dist/esm/motion/neon/audio.d.ts.map +1 -0
- package/dist/esm/motion/neon/audio.js +161 -0
- package/dist/esm/motion/neon/audio.js.map +1 -0
- package/dist/esm/motion/neon/config.d.ts +319 -0
- package/dist/esm/motion/neon/config.d.ts.map +1 -0
- package/dist/esm/motion/neon/config.js +319 -0
- package/dist/esm/motion/neon/config.js.map +1 -0
- package/dist/esm/motion/neon/flicker.d.ts +82 -0
- package/dist/esm/motion/neon/flicker.d.ts.map +1 -0
- package/dist/esm/motion/neon/flicker.js +187 -0
- package/dist/esm/motion/neon/flicker.js.map +1 -0
- package/dist/esm/motion/neon/fonts.d.ts +29 -0
- package/dist/esm/motion/neon/fonts.d.ts.map +1 -0
- package/dist/esm/motion/neon/fonts.js +47 -0
- package/dist/esm/motion/neon/fonts.js.map +1 -0
- package/dist/esm/motion/neon/frame.d.ts +22 -0
- package/dist/esm/motion/neon/frame.d.ts.map +1 -0
- package/dist/esm/motion/neon/frame.js +20 -0
- package/dist/esm/motion/neon/frame.js.map +1 -0
- package/dist/esm/motion/neon/glitch.d.ts +64 -0
- package/dist/esm/motion/neon/glitch.d.ts.map +1 -0
- package/dist/esm/motion/neon/glitch.js +108 -0
- package/dist/esm/motion/neon/glitch.js.map +1 -0
- package/dist/esm/motion/neon/index.d.ts +29 -0
- package/dist/esm/motion/neon/index.d.ts.map +1 -0
- package/dist/esm/motion/neon/index.js +28 -0
- package/dist/esm/motion/neon/index.js.map +1 -0
- package/dist/esm/motion/neon/layers.d.ts +56 -0
- package/dist/esm/motion/neon/layers.d.ts.map +1 -0
- package/dist/esm/motion/neon/layers.js +64 -0
- package/dist/esm/motion/neon/layers.js.map +1 -0
- package/dist/esm/motion/neon/material.d.ts +68 -0
- package/dist/esm/motion/neon/material.d.ts.map +1 -0
- package/dist/esm/motion/neon/material.js +51 -0
- package/dist/esm/motion/neon/material.js.map +1 -0
- package/dist/esm/motion/neon/random.d.ts +15 -0
- package/dist/esm/motion/neon/random.d.ts.map +1 -0
- package/dist/esm/motion/neon/random.js +37 -0
- package/dist/esm/motion/neon/random.js.map +1 -0
- package/dist/esm/motion/neon/scene.d.ts +255 -0
- package/dist/esm/motion/neon/scene.d.ts.map +1 -0
- package/dist/esm/motion/neon/scene.js +532 -0
- package/dist/esm/motion/neon/scene.js.map +1 -0
- package/dist/esm/motion/neon/synth.d.ts +18 -0
- package/dist/esm/motion/neon/synth.d.ts.map +1 -0
- package/dist/esm/motion/neon/synth.js +208 -0
- package/dist/esm/motion/neon/synth.js.map +1 -0
- package/dist/esm/motion/neon/typography.d.ts +53 -0
- package/dist/esm/motion/neon/typography.d.ts.map +1 -0
- package/dist/esm/motion/neon/typography.js +74 -0
- package/dist/esm/motion/neon/typography.js.map +1 -0
- package/dist/esm/motion/neon/wall.d.ts +62 -0
- package/dist/esm/motion/neon/wall.d.ts.map +1 -0
- package/dist/esm/motion/neon/wall.js +106 -0
- package/dist/esm/motion/neon/wall.js.map +1 -0
- package/dist/esm/motion/paperfold/PaperFold.d.ts +36 -0
- package/dist/esm/motion/paperfold/PaperFold.d.ts.map +1 -0
- package/dist/esm/motion/paperfold/PaperFold.js +37 -0
- package/dist/esm/motion/paperfold/PaperFold.js.map +1 -0
- package/dist/esm/motion/paperfold/PaperFoldFrame.d.ts +39 -0
- package/dist/esm/motion/paperfold/PaperFoldFrame.d.ts.map +1 -0
- package/dist/esm/motion/paperfold/PaperFoldFrame.js +283 -0
- package/dist/esm/motion/paperfold/PaperFoldFrame.js.map +1 -0
- package/dist/esm/motion/paperfold/PaperFoldPlayer.d.ts +27 -0
- package/dist/esm/motion/paperfold/PaperFoldPlayer.d.ts.map +1 -0
- package/dist/esm/motion/paperfold/PaperFoldPlayer.js +56 -0
- package/dist/esm/motion/paperfold/PaperFoldPlayer.js.map +1 -0
- package/dist/esm/motion/paperfold/art.d.ts +148 -0
- package/dist/esm/motion/paperfold/art.d.ts.map +1 -0
- package/dist/esm/motion/paperfold/art.js +374 -0
- package/dist/esm/motion/paperfold/art.js.map +1 -0
- package/dist/esm/motion/paperfold/config.d.ts +47 -0
- package/dist/esm/motion/paperfold/config.d.ts.map +1 -0
- package/dist/esm/motion/paperfold/config.js +96 -0
- package/dist/esm/motion/paperfold/config.js.map +1 -0
- package/dist/esm/motion/paperfold/controls.d.ts +57 -0
- package/dist/esm/motion/paperfold/controls.d.ts.map +1 -0
- package/dist/esm/motion/paperfold/controls.js +506 -0
- package/dist/esm/motion/paperfold/controls.js.map +1 -0
- package/dist/esm/motion/paperfold/engine.d.ts +397 -0
- package/dist/esm/motion/paperfold/engine.d.ts.map +1 -0
- package/dist/esm/motion/paperfold/engine.js +699 -0
- package/dist/esm/motion/paperfold/engine.js.map +1 -0
- package/dist/esm/motion/paperfold/fonts.d.ts +3 -0
- package/dist/esm/motion/paperfold/fonts.d.ts.map +1 -0
- package/dist/esm/motion/paperfold/fonts.js +21 -0
- package/dist/esm/motion/paperfold/fonts.js.map +1 -0
- package/dist/esm/motion/paperfold/index.d.ts +17 -0
- package/dist/esm/motion/paperfold/index.d.ts.map +1 -0
- package/dist/esm/motion/paperfold/index.js +17 -0
- package/dist/esm/motion/paperfold/index.js.map +1 -0
- package/dist/esm/motion/paperfold/manipulate.d.ts +59 -0
- package/dist/esm/motion/paperfold/manipulate.d.ts.map +1 -0
- package/dist/esm/motion/paperfold/manipulate.js +161 -0
- package/dist/esm/motion/paperfold/manipulate.js.map +1 -0
- package/dist/esm/motion/paperfold/presets.d.ts +9 -0
- package/dist/esm/motion/paperfold/presets.d.ts.map +1 -0
- package/dist/esm/motion/paperfold/presets.js +115 -0
- package/dist/esm/motion/paperfold/presets.js.map +1 -0
- package/dist/esm/motion/paperfold/template.d.ts +3 -0
- package/dist/esm/motion/paperfold/template.d.ts.map +1 -0
- package/dist/esm/motion/paperfold/template.js +37 -0
- package/dist/esm/motion/paperfold/template.js.map +1 -0
- package/dist/esm/motion/player.d.ts +35 -0
- package/dist/esm/motion/player.d.ts.map +1 -0
- package/dist/esm/motion/player.js +197 -0
- package/dist/esm/motion/player.js.map +1 -0
- package/dist/esm/motion/promo/PromoFrame.d.ts +31 -0
- package/dist/esm/motion/promo/PromoFrame.d.ts.map +1 -0
- package/dist/esm/motion/promo/PromoFrame.js +288 -0
- package/dist/esm/motion/promo/PromoFrame.js.map +1 -0
- package/dist/esm/motion/promo/PromoShowcasePlayer.d.ts +25 -0
- package/dist/esm/motion/promo/PromoShowcasePlayer.d.ts.map +1 -0
- package/dist/esm/motion/promo/PromoShowcasePlayer.js +56 -0
- package/dist/esm/motion/promo/PromoShowcasePlayer.js.map +1 -0
- package/dist/esm/motion/promo/config.d.ts +91 -0
- package/dist/esm/motion/promo/config.d.ts.map +1 -0
- package/dist/esm/motion/promo/config.js +550 -0
- package/dist/esm/motion/promo/config.js.map +1 -0
- package/dist/esm/motion/promo/controls.d.ts +86 -0
- package/dist/esm/motion/promo/controls.d.ts.map +1 -0
- package/dist/esm/motion/promo/controls.js +567 -0
- package/dist/esm/motion/promo/controls.js.map +1 -0
- package/dist/esm/motion/promo/easing.d.ts +3 -0
- package/dist/esm/motion/promo/easing.d.ts.map +1 -0
- package/dist/esm/motion/promo/easing.js +32 -0
- package/dist/esm/motion/promo/easing.js.map +1 -0
- package/dist/esm/motion/promo/engine.d.ts +205 -0
- package/dist/esm/motion/promo/engine.d.ts.map +1 -0
- package/dist/esm/motion/promo/engine.js +551 -0
- package/dist/esm/motion/promo/engine.js.map +1 -0
- package/dist/esm/motion/promo/fonts.d.ts +7 -0
- package/dist/esm/motion/promo/fonts.d.ts.map +1 -0
- package/dist/esm/motion/promo/fonts.js +16 -0
- package/dist/esm/motion/promo/fonts.js.map +1 -0
- package/dist/esm/motion/promo/icons.d.ts +7 -0
- package/dist/esm/motion/promo/icons.d.ts.map +1 -0
- package/dist/esm/motion/promo/icons.js +26 -0
- package/dist/esm/motion/promo/icons.js.map +1 -0
- package/dist/esm/motion/promo/index.d.ts +15 -0
- package/dist/esm/motion/promo/index.d.ts.map +1 -0
- package/dist/esm/motion/promo/index.js +15 -0
- package/dist/esm/motion/promo/index.js.map +1 -0
- package/dist/esm/motion/promo/presets.d.ts +13 -0
- package/dist/esm/motion/promo/presets.d.ts.map +1 -0
- package/dist/esm/motion/promo/presets.js +40 -0
- package/dist/esm/motion/promo/presets.js.map +1 -0
- package/dist/esm/motion/promo/template.d.ts +8 -0
- package/dist/esm/motion/promo/template.d.ts.map +1 -0
- package/dist/esm/motion/promo/template.js +35 -0
- package/dist/esm/motion/promo/template.js.map +1 -0
- package/dist/esm/motion/replication2/Replication2Player.d.ts +26 -0
- package/dist/esm/motion/replication2/Replication2Player.d.ts.map +1 -0
- package/dist/esm/motion/replication2/Replication2Player.js +90 -0
- package/dist/esm/motion/replication2/Replication2Player.js.map +1 -0
- package/dist/esm/motion/replication2/config.d.ts +78 -0
- package/dist/esm/motion/replication2/config.d.ts.map +1 -0
- package/dist/esm/motion/replication2/config.js +341 -0
- package/dist/esm/motion/replication2/config.js.map +1 -0
- package/dist/esm/motion/replication2/controls.d.ts +70 -0
- package/dist/esm/motion/replication2/controls.d.ts.map +1 -0
- package/dist/esm/motion/replication2/controls.js +283 -0
- package/dist/esm/motion/replication2/controls.js.map +1 -0
- package/dist/esm/motion/replication2/driver.d.ts +23 -0
- package/dist/esm/motion/replication2/driver.d.ts.map +1 -0
- package/dist/esm/motion/replication2/driver.js +65 -0
- package/dist/esm/motion/replication2/driver.js.map +1 -0
- package/dist/esm/motion/replication2/easing.d.ts +19 -0
- package/dist/esm/motion/replication2/easing.d.ts.map +1 -0
- package/dist/esm/motion/replication2/easing.js +92 -0
- package/dist/esm/motion/replication2/easing.js.map +1 -0
- package/dist/esm/motion/replication2/engine.d.ts +236 -0
- package/dist/esm/motion/replication2/engine.d.ts.map +1 -0
- package/dist/esm/motion/replication2/engine.js +470 -0
- package/dist/esm/motion/replication2/engine.js.map +1 -0
- package/dist/esm/motion/replication2/html.d.ts +30 -0
- package/dist/esm/motion/replication2/html.d.ts.map +1 -0
- package/dist/esm/motion/replication2/html.js +83 -0
- package/dist/esm/motion/replication2/html.js.map +1 -0
- package/dist/esm/motion/replication2/index.d.ts +15 -0
- package/dist/esm/motion/replication2/index.d.ts.map +1 -0
- package/dist/esm/motion/replication2/index.js +15 -0
- package/dist/esm/motion/replication2/index.js.map +1 -0
- package/dist/esm/motion/replication2/measure.d.ts +3 -0
- package/dist/esm/motion/replication2/measure.d.ts.map +1 -0
- package/dist/esm/motion/replication2/measure.js +27 -0
- package/dist/esm/motion/replication2/measure.js.map +1 -0
- package/dist/esm/motion/replication2/metrics.d.ts +6 -0
- package/dist/esm/motion/replication2/metrics.d.ts.map +1 -0
- package/dist/esm/motion/replication2/metrics.js +7 -0
- package/dist/esm/motion/replication2/metrics.js.map +1 -0
- package/dist/esm/motion/replication2/presets.d.ts +13 -0
- package/dist/esm/motion/replication2/presets.d.ts.map +1 -0
- package/dist/esm/motion/replication2/presets.js +63 -0
- package/dist/esm/motion/replication2/presets.js.map +1 -0
- package/dist/esm/motion/replication2/riv.d.ts +3 -0
- package/dist/esm/motion/replication2/riv.d.ts.map +1 -0
- package/dist/esm/motion/replication2/riv.js +4 -0
- package/dist/esm/motion/replication2/riv.js.map +1 -0
- package/dist/esm/motion/replication2/rive-contract.d.ts +27 -0
- package/dist/esm/motion/replication2/rive-contract.d.ts.map +1 -0
- package/dist/esm/motion/replication2/rive-contract.js +153 -0
- package/dist/esm/motion/replication2/rive-contract.js.map +1 -0
- package/dist/esm/motion/replication2/template.d.ts +8 -0
- package/dist/esm/motion/replication2/template.d.ts.map +1 -0
- package/dist/esm/motion/replication2/template.js +32 -0
- package/dist/esm/motion/replication2/template.js.map +1 -0
- package/dist/esm/motion/sample.d.ts +61 -0
- package/dist/esm/motion/sample.d.ts.map +1 -0
- package/dist/esm/motion/sample.js +138 -0
- package/dist/esm/motion/sample.js.map +1 -0
- package/dist/esm/motion/templates/hey-template.d.ts +3 -0
- package/dist/esm/motion/templates/hey-template.d.ts.map +1 -0
- package/dist/esm/motion/templates/hey-template.js +1549 -0
- package/dist/esm/motion/templates/hey-template.js.map +1 -0
- package/dist/esm/motion/templates/index.d.ts +22 -0
- package/dist/esm/motion/templates/index.d.ts.map +1 -0
- package/dist/esm/motion/templates/index.js +15 -0
- package/dist/esm/motion/templates/index.js.map +1 -0
- package/dist/esm/motion/templates/word-motion.d.ts +3 -0
- package/dist/esm/motion/templates/word-motion.d.ts.map +1 -0
- package/dist/esm/motion/templates/word-motion.js +1162 -0
- package/dist/esm/motion/templates/word-motion.js.map +1 -0
- package/dist/esm/motion/types.d.ts +192 -0
- package/dist/esm/motion/types.d.ts.map +1 -0
- package/dist/esm/motion/types.js +2 -0
- package/dist/esm/motion/types.js.map +1 -0
- package/dist/esm/motion/typesurface/TypeSurfaceCanvas.d.ts +22 -0
- package/dist/esm/motion/typesurface/TypeSurfaceCanvas.d.ts.map +1 -0
- package/dist/esm/motion/typesurface/TypeSurfaceCanvas.js +58 -0
- package/dist/esm/motion/typesurface/TypeSurfaceCanvas.js.map +1 -0
- package/dist/esm/motion/typesurface/art.d.ts +21 -0
- package/dist/esm/motion/typesurface/art.d.ts.map +1 -0
- package/dist/esm/motion/typesurface/art.js +854 -0
- package/dist/esm/motion/typesurface/art.js.map +1 -0
- package/dist/esm/motion/typesurface/config.d.ts +273 -0
- package/dist/esm/motion/typesurface/config.d.ts.map +1 -0
- package/dist/esm/motion/typesurface/config.js +260 -0
- package/dist/esm/motion/typesurface/config.js.map +1 -0
- package/dist/esm/motion/typesurface/engine.d.ts +94 -0
- package/dist/esm/motion/typesurface/engine.d.ts.map +1 -0
- package/dist/esm/motion/typesurface/engine.js +603 -0
- package/dist/esm/motion/typesurface/engine.js.map +1 -0
- package/dist/esm/motion/typesurface/fonts.d.ts +25 -0
- package/dist/esm/motion/typesurface/fonts.d.ts.map +1 -0
- package/dist/esm/motion/typesurface/fonts.js +40 -0
- package/dist/esm/motion/typesurface/fonts.js.map +1 -0
- package/dist/esm/motion/typesurface/index.d.ts +17 -0
- package/dist/esm/motion/typesurface/index.d.ts.map +1 -0
- package/dist/esm/motion/typesurface/index.js +17 -0
- package/dist/esm/motion/typesurface/index.js.map +1 -0
- package/dist/esm/motion/typesurface/layout.d.ts +57 -0
- package/dist/esm/motion/typesurface/layout.d.ts.map +1 -0
- package/dist/esm/motion/typesurface/layout.js +122 -0
- package/dist/esm/motion/typesurface/layout.js.map +1 -0
- package/dist/esm/motion/typesurface/ops.d.ts +70 -0
- package/dist/esm/motion/typesurface/ops.d.ts.map +1 -0
- package/dist/esm/motion/typesurface/ops.js +164 -0
- package/dist/esm/motion/typesurface/ops.js.map +1 -0
- package/dist/esm/motion/typesurface/presets.d.ts +33 -0
- package/dist/esm/motion/typesurface/presets.d.ts.map +1 -0
- package/dist/esm/motion/typesurface/presets.js +185 -0
- package/dist/esm/motion/typesurface/presets.js.map +1 -0
- package/dist/esm/motion/typesurface/renderer.d.ts +78 -0
- package/dist/esm/motion/typesurface/renderer.d.ts.map +1 -0
- package/dist/esm/motion/typesurface/renderer.js +666 -0
- package/dist/esm/motion/typesurface/renderer.js.map +1 -0
- package/dist/esm/motion/typesurface/shaders.d.ts +17 -0
- package/dist/esm/motion/typesurface/shaders.d.ts.map +1 -0
- package/dist/esm/motion/typesurface/shaders.js +297 -0
- package/dist/esm/motion/typesurface/shaders.js.map +1 -0
- package/dist/esm/motion/typesurface/surfaces.d.ts +81 -0
- package/dist/esm/motion/typesurface/surfaces.d.ts.map +1 -0
- package/dist/esm/motion/typesurface/surfaces.js +149 -0
- package/dist/esm/motion/typesurface/surfaces.js.map +1 -0
- package/dist/esm/motion/typesurface/text.d.ts +17 -0
- package/dist/esm/motion/typesurface/text.d.ts.map +1 -0
- package/dist/esm/motion/typesurface/text.js +28 -0
- package/dist/esm/motion/typesurface/text.js.map +1 -0
- package/dist/esm/motion/typesurface/timeline.d.ts +15 -0
- package/dist/esm/motion/typesurface/timeline.d.ts.map +1 -0
- package/dist/esm/motion/typesurface/timeline.js +57 -0
- package/dist/esm/motion/typesurface/timeline.js.map +1 -0
- package/dist/esm/motion/validate.d.ts +22 -0
- package/dist/esm/motion/validate.d.ts.map +1 -0
- package/dist/esm/motion/validate.js +84 -0
- package/dist/esm/motion/validate.js.map +1 -0
- package/dist/esm/native/RiveReceiptStage.d.ts +25 -2
- package/dist/esm/native/RiveReceiptStage.d.ts.map +1 -1
- package/dist/esm/native/RiveReceiptStage.js +7 -148
- package/dist/esm/native/RiveReceiptStage.js.map +1 -1
- package/dist/esm/native/riveReceiptStageFactory.d.ts +26 -0
- package/dist/esm/native/riveReceiptStageFactory.d.ts.map +1 -0
- package/dist/esm/native/riveReceiptStageFactory.js +159 -0
- package/dist/esm/native/riveReceiptStageFactory.js.map +1 -0
- package/dist/esm/tokens/stage.d.ts +7 -0
- package/dist/esm/tokens/stage.d.ts.map +1 -0
- package/dist/esm/tokens/stage.js +7 -0
- package/dist/esm/tokens/stage.js.map +1 -0
- package/package.json +36 -1
- package/spec/examples/components/onboarding/animated-status/case1.json +42 -0
- package/spec/examples/components/onboarding/animated-status/case2.json +42 -0
- package/spec/examples/components/onboarding/animated-status/case3.json +42 -0
- package/spec/examples/components/onboarding/animated-status/case4.json +42 -0
- package/spec/examples/components/onboarding/animated-status/case5.json +42 -0
- package/spec/examples/components/onboarding/send-completion/case1.json +48 -0
- package/spec/examples/components/onboarding/send-completion/case2.json +48 -0
- package/spec/examples/components/onboarding/send-completion/case3.json +48 -0
- package/spec/examples/components/onboarding/send-completion/case4.json +48 -0
- package/spec/examples/components/onboarding/send-completion/case5.json +48 -0
- package/spec/families/onboarding.schema.json +610 -1
- package/src/agent/AgentComponent.tsx +1 -1
- package/src/agent/base.ts +17 -0
- package/src/agent/catalog.ts +0 -32
- package/src/agent/core.ts +6 -14
- package/src/agent/index.ts +6 -5
- package/src/agent/manifests.ts +83 -1
- package/src/agent/result.ts +6 -0
- package/src/agent/search/document.ts +46 -0
- package/src/agent/search/embedding.ts +95 -0
- package/src/agent/search/index.ts +20 -0
- package/src/agent/search/lexical.ts +25 -0
- package/src/agent/search/normalize.ts +17 -0
- package/src/agent/search/search.ts +148 -0
- package/src/agent/search/searchIndex.ts +107 -0
- package/src/agent/search/types.ts +68 -0
- package/src/agent/search/weights.ts +32 -0
- package/src/agent/types.ts +1 -1
- package/src/components/catalog.ts +21 -1
- package/src/components/onboarding/animated-status/AnimatedStage.tsx +18 -0
- package/src/components/onboarding/animated-status/AnimatedStage.types.ts +30 -0
- package/src/components/onboarding/animated-status/AnimatedStage.web.tsx +99 -0
- package/src/components/onboarding/animated-status/AnimatedStatusView.tsx +109 -0
- package/src/components/onboarding/animated-status/AnimatedStill.tsx +23 -0
- package/src/components/onboarding/animated-status/contract.ts +105 -0
- package/src/components/onboarding/animated-status/engine.ts +49 -0
- package/src/components/onboarding/animated-status/index.ts +8 -0
- package/src/components/onboarding/animated-status/presets.json +126 -0
- package/src/components/onboarding/animated-status/riv.ts +4 -0
- package/src/components/onboarding/index.ts +4 -0
- package/src/components/onboarding/presets.ts +6 -0
- package/src/components/onboarding/receipt-printer/ReceiptStage.tsx +46 -7
- package/src/components/onboarding/send-completion/SendCompletionView.tsx +164 -0
- package/src/components/onboarding/send-completion/SendStage.tsx +27 -0
- package/src/components/onboarding/send-completion/SendStage.types.ts +32 -0
- package/src/components/onboarding/send-completion/SendStage.web.tsx +116 -0
- package/src/components/onboarding/send-completion/SendStill.tsx +19 -0
- package/src/components/onboarding/send-completion/contract.ts +127 -0
- package/src/components/onboarding/send-completion/engine.ts +37 -0
- package/src/components/onboarding/send-completion/index.ts +10 -0
- package/src/components/onboarding/send-completion/presets.json +132 -0
- package/src/components/onboarding/send-completion/riv.ts +4 -0
- package/src/components/onboarding/shared/actions-data.ts +2 -0
- package/src/components/onboarding/shared/configColor.ts +72 -0
- package/src/components/onboarding/shared/contract.ts +4 -0
- package/src/components/onboarding/shared/describe.ts +1 -1
- package/src/components/onboarding/shared/mock.ts +2 -0
- package/src/components/onboarding/views.ts +8 -0
- package/src/index.ts +1 -1
- package/src/motion/MotionPlayer.tsx +62 -0
- package/src/motion/agent.ts +288 -0
- package/src/motion/cat/Cat.tsx +118 -0
- package/src/motion/cat/animation.ts +206 -0
- package/src/motion/cat/art.generated.ts +44 -0
- package/src/motion/cat/config.ts +186 -0
- package/src/motion/cat/index.ts +26 -0
- package/src/motion/cat/rig.ts +102 -0
- package/src/motion/cat/scene.ts +181 -0
- package/src/motion/configurable/config.ts +420 -0
- package/src/motion/configurable/controls.ts +93 -0
- package/src/motion/easing.ts +55 -0
- package/src/motion/fit.ts +8 -0
- package/src/motion/index.ts +29 -0
- package/src/motion/neon/GlowRenderer.tsx +83 -0
- package/src/motion/neon/NeonCanvas.tsx +175 -0
- package/src/motion/neon/NeonText.tsx +113 -0
- package/src/motion/neon/NeonTextFrame.tsx +67 -0
- package/src/motion/neon/artwork.ts +95 -0
- package/src/motion/neon/audio.ts +162 -0
- package/src/motion/neon/config.ts +484 -0
- package/src/motion/neon/flicker.ts +225 -0
- package/src/motion/neon/fonts.ts +76 -0
- package/src/motion/neon/frame.ts +34 -0
- package/src/motion/neon/glitch.ts +142 -0
- package/src/motion/neon/index.ts +41 -0
- package/src/motion/neon/layers.tsx +209 -0
- package/src/motion/neon/material.ts +88 -0
- package/src/motion/neon/random.ts +40 -0
- package/src/motion/neon/scene.ts +610 -0
- package/src/motion/neon/synth.ts +188 -0
- package/src/motion/neon/typography.ts +102 -0
- package/src/motion/neon/wall.ts +157 -0
- package/src/motion/paperfold/PaperFold.tsx +45 -0
- package/src/motion/paperfold/PaperFoldFrame.tsx +576 -0
- package/src/motion/paperfold/PaperFoldPlayer.tsx +80 -0
- package/src/motion/paperfold/art.ts +455 -0
- package/src/motion/paperfold/config.ts +98 -0
- package/src/motion/paperfold/controls.ts +557 -0
- package/src/motion/paperfold/engine.ts +852 -0
- package/src/motion/paperfold/fonts.ts +21 -0
- package/src/motion/paperfold/index.ts +30 -0
- package/src/motion/paperfold/manipulate.ts +188 -0
- package/src/motion/paperfold/presets.ts +117 -0
- package/src/motion/paperfold/template.ts +38 -0
- package/src/motion/player.ts +207 -0
- package/src/motion/promo/PromoFrame.tsx +501 -0
- package/src/motion/promo/PromoShowcasePlayer.tsx +78 -0
- package/src/motion/promo/config.ts +479 -0
- package/src/motion/promo/controls.ts +643 -0
- package/src/motion/promo/easing.ts +36 -0
- package/src/motion/promo/engine.ts +587 -0
- package/src/motion/promo/fonts.ts +16 -0
- package/src/motion/promo/icons.tsx +29 -0
- package/src/motion/promo/index.ts +24 -0
- package/src/motion/promo/presets.ts +40 -0
- package/src/motion/promo/template.ts +36 -0
- package/src/motion/replication2/Replication2Player.tsx +115 -0
- package/src/motion/replication2/config.ts +323 -0
- package/src/motion/replication2/controls.ts +336 -0
- package/src/motion/replication2/driver.ts +92 -0
- package/src/motion/replication2/easing.ts +88 -0
- package/src/motion/replication2/engine.ts +539 -0
- package/src/motion/replication2/html.ts +87 -0
- package/src/motion/replication2/index.ts +14 -0
- package/src/motion/replication2/measure.ts +28 -0
- package/src/motion/replication2/metrics.ts +7 -0
- package/src/motion/replication2/presets.ts +63 -0
- package/src/motion/replication2/riv.ts +4 -0
- package/src/motion/replication2/rive-contract.ts +165 -0
- package/src/motion/replication2/template.ts +33 -0
- package/src/motion/sample.ts +173 -0
- package/src/motion/templates/hey-template.ts +1553 -0
- package/src/motion/templates/index.ts +17 -0
- package/src/motion/templates/word-motion.ts +1166 -0
- package/src/motion/types.ts +162 -0
- package/src/motion/typesurface/TypeSurfaceCanvas.tsx +73 -0
- package/src/motion/typesurface/art.ts +639 -0
- package/src/motion/typesurface/config.ts +486 -0
- package/src/motion/typesurface/engine.ts +586 -0
- package/src/motion/typesurface/fonts.ts +63 -0
- package/src/motion/typesurface/index.ts +16 -0
- package/src/motion/typesurface/layout.ts +133 -0
- package/src/motion/typesurface/ops.ts +196 -0
- package/src/motion/typesurface/presets.ts +199 -0
- package/src/motion/typesurface/renderer.ts +579 -0
- package/src/motion/typesurface/shaders.ts +303 -0
- package/src/motion/typesurface/surfaces.ts +223 -0
- package/src/motion/typesurface/text.ts +35 -0
- package/src/motion/typesurface/timeline.ts +58 -0
- package/src/motion/validate.ts +101 -0
- package/src/native/RiveReceiptStage.tsx +8 -155
- package/src/native/riveReceiptStageFactory.tsx +175 -0
- package/src/tokens/stage.ts +6 -0
- package/tools/ask/dist/components.mjs +7221 -44
- package/tools/ask/mcp.mjs +80 -1
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
import { BODY_D, CAT_CREDIT, CAT_VIEWBOX, DETAIL_D, HEAD_D, HEAD_PIVOT, MUZZLE_D, type DetailId, type PathCommand } from './art.generated';
|
|
2
|
+
import { buildAnimationDocument, catPose, documentDuration, type CatAnimationDocument, type CatPose } from './animation';
|
|
3
|
+
import type { CatConfig, PartId } from './config';
|
|
4
|
+
import { IDENTITY, applyMat, mul, pathD, posedTailCommands, rotateAbout, type Mat } from './rig';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* **The scene graph** — the rig as a tree of groups and paths, built from a config and a pose. Both
|
|
8
|
+
* renderers walk this one tree: `catSvg` writes it as SVG text (static or SMIL-animated), and the React
|
|
9
|
+
* `<Cat>` renders it as elements. The hierarchy:
|
|
10
|
+
*
|
|
11
|
+
* cat whole-cat transform, fur colour
|
|
12
|
+
* └─ cat-body body offset; carries the tail and head
|
|
13
|
+
* ├─ cat-tail the tail's own transform → cat-tail-shape (the skinned outline)
|
|
14
|
+
* ├─ cat-body-shape body and legs (one contour in the source)
|
|
15
|
+
* ├─ cat-legs the white leg lines
|
|
16
|
+
* └─ cat-head head rotation about the neck
|
|
17
|
+
* ├─ cat-muzzle the white under the nose and mouth cut-outs
|
|
18
|
+
* ├─ cat-head-shape head and ears
|
|
19
|
+
* ├─ cat-ears the white ear lines
|
|
20
|
+
* └─ cat-eyes eyes and brow
|
|
21
|
+
*/
|
|
22
|
+
export type SceneNode =
|
|
23
|
+
| { kind: 'g'; id: string; transform?: Mat; fill?: string; children: SceneNode[] }
|
|
24
|
+
| { kind: 'path'; id: string; commands: PathCommand[]; fill?: string };
|
|
25
|
+
|
|
26
|
+
const cache = new Map<string, PathCommand[]>();
|
|
27
|
+
/** Parse the generated path data (absolute M / L / C / Z only). */
|
|
28
|
+
export function parseD(d: string): PathCommand[] {
|
|
29
|
+
const hit = cache.get(d);
|
|
30
|
+
if (hit) return hit;
|
|
31
|
+
const out: PathCommand[] = [];
|
|
32
|
+
/* An exec loop, not matchAll: older mobile browsers (Safari before 13) lack matchAll. */
|
|
33
|
+
const re = /([MLCZ])([^MLCZ]*)/g;
|
|
34
|
+
for (let m = re.exec(d); m; m = re.exec(d)) {
|
|
35
|
+
const n = m[2]!.trim() ? m[2]!.trim().split(/[\s,]+/).map(Number) : [];
|
|
36
|
+
out.push([m[1], ...n] as PathCommand);
|
|
37
|
+
}
|
|
38
|
+
cache.set(d, out);
|
|
39
|
+
return out;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export const VIEW_CENTRE: [number, number] = [CAT_VIEWBOX.x + CAT_VIEWBOX.width / 2, CAT_VIEWBOX.y + CAT_VIEWBOX.height / 2];
|
|
43
|
+
const translate = (x: number, y: number): Mat => [1, 0, 0, 1, x, y];
|
|
44
|
+
const scaleAbout = (s: number, cx: number, cy: number): Mat => [s, 0, 0, s, cx - s * cx, cy - s * cy];
|
|
45
|
+
const isIdentity = (m: Mat) => m.every((v, i) => Math.abs(v - IDENTITY[i]!) < 1e-9);
|
|
46
|
+
|
|
47
|
+
/** The tail group's transform: move, then turn and scale about the origin. */
|
|
48
|
+
export const tailMatrix = (t: CatPose['tail']): Mat =>
|
|
49
|
+
mul(translate(t.x, t.y), mul(rotateAbout(t.rotate, t.origin.x, t.origin.y), scaleAbout(t.scale, t.origin.x, t.origin.y)));
|
|
50
|
+
export const catMatrix = (t: CatPose['transform']): Mat =>
|
|
51
|
+
mul(translate(t.x, t.y), mul(rotateAbout(t.rotate, ...VIEW_CENTRE), scaleAbout(t.scale, ...VIEW_CENTRE)));
|
|
52
|
+
export const bodyMatrix = (b: CatPose['body']): Mat => translate(b.x, b.y);
|
|
53
|
+
export const headMatrix = (h: CatPose['head']): Mat => rotateAbout(h.rotate, HEAD_PIVOT[0], HEAD_PIVOT[1]);
|
|
54
|
+
|
|
55
|
+
export function catScene(config: CatConfig, pose: CatPose): SceneNode {
|
|
56
|
+
const part = (id: PartId) => config.parts[id] ?? {};
|
|
57
|
+
const shown = (id: PartId) => part(id).visible !== false;
|
|
58
|
+
const withMat = (m: Mat) => (isIdentity(m) ? undefined : m);
|
|
59
|
+
const path = (id: string, d: string | PathCommand[], fill?: string): SceneNode => ({
|
|
60
|
+
kind: 'path', id, commands: typeof d === 'string' ? parseD(d) : d, fill: part(id as PartId).fill ?? fill,
|
|
61
|
+
});
|
|
62
|
+
const details = (id: PartId, ids: DetailId[]): SceneNode[] =>
|
|
63
|
+
shown(id) ? [{ kind: 'g', id, fill: part(id).fill ?? config.detailColor, children: ids.filter((d) => shown(d as PartId)).map((d) => path(d, DETAIL_D[d])) }] : [];
|
|
64
|
+
|
|
65
|
+
const children: SceneNode[] = [];
|
|
66
|
+
if (pose.tail.visible && shown('cat-tail')) {
|
|
67
|
+
children.push({ kind: 'g', id: 'cat-tail', transform: withMat(tailMatrix(pose.tail)), fill: part('cat-tail').fill, children: [path('cat-tail-shape', posedTailCommands(pose.tail.bones))] });
|
|
68
|
+
}
|
|
69
|
+
if (shown('cat-body-shape')) children.push(path('cat-body-shape', BODY_D));
|
|
70
|
+
children.push(...details('cat-legs', ['cat-leg-front-line', 'cat-leg-rear-line']));
|
|
71
|
+
if (shown('cat-head')) {
|
|
72
|
+
children.push({
|
|
73
|
+
kind: 'g', id: 'cat-head', transform: withMat(headMatrix(pose.head)), fill: part('cat-head').fill,
|
|
74
|
+
children: [
|
|
75
|
+
...(shown('cat-muzzle') ? [path('cat-muzzle', MUZZLE_D, config.detailColor)] : []),
|
|
76
|
+
...(shown('cat-head-shape') ? [path('cat-head-shape', HEAD_D)] : []),
|
|
77
|
+
...details('cat-ears', ['cat-ear-left-inner', 'cat-ear-right-inner', 'cat-ear-right-edge']),
|
|
78
|
+
...details('cat-eyes', ['cat-eye-left', 'cat-eye-right', 'cat-brow-right']),
|
|
79
|
+
],
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
return {
|
|
83
|
+
kind: 'g', id: 'cat', transform: withMat(catMatrix(pose.transform)), fill: config.color,
|
|
84
|
+
children: [{ kind: 'g', id: 'cat-body', transform: withMat(bodyMatrix(pose.body)), children }],
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
/* ---------- SVG text ---------- */
|
|
89
|
+
const num = (v: number) => String(Math.round(v * 1000) / 1000);
|
|
90
|
+
export const matrixAttr = (m: Mat) => `matrix(${m.map(num).join(' ')})`;
|
|
91
|
+
const esc = (s: string) => s.replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>').replace(/"/g, '"');
|
|
92
|
+
const transformCommands = (m: Mat, cmds: PathCommand[]): PathCommand[] =>
|
|
93
|
+
cmds.map((c): PathCommand => {
|
|
94
|
+
if (c[0] === 'Z') return c;
|
|
95
|
+
const pts: number[] = [];
|
|
96
|
+
for (let i = 1; i < c.length; i += 2) pts.push(...applyMat(m, c[i] as number, c[i + 1] as number));
|
|
97
|
+
return [c[0], ...pts] as PathCommand;
|
|
98
|
+
});
|
|
99
|
+
|
|
100
|
+
function nodeSvg(node: SceneNode, prefix: string, animatedD?: Map<string, string>): string {
|
|
101
|
+
const fill = node.fill ? ` fill="${esc(node.fill)}"` : '';
|
|
102
|
+
if (node.kind === 'path') {
|
|
103
|
+
const extra = animatedD?.get(node.id) ?? '';
|
|
104
|
+
return extra ? `<path id="${prefix}${node.id}"${fill}>${extra}</path>` : `<path id="${prefix}${node.id}"${fill} d="${pathD(node.commands)}"/>`;
|
|
105
|
+
}
|
|
106
|
+
const t = node.transform ? ` transform="${matrixAttr(node.transform)}"` : '';
|
|
107
|
+
return `<g id="${prefix}${node.id}"${fill}${t}>${node.children.map((c) => nodeSvg(c, prefix, animatedD)).join('')}</g>`;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
/** Every path of a scene with its transform baked in (the groups' matrices applied to its points). */
|
|
111
|
+
function flatPaths(node: SceneNode, parent: Mat = IDENTITY, out = new Map<string, PathCommand[]>()) {
|
|
112
|
+
if (node.kind === 'path') out.set(node.id, transformCommands(parent, node.commands));
|
|
113
|
+
else {
|
|
114
|
+
const m = node.transform ? mul(parent, node.transform) : parent;
|
|
115
|
+
node.children.forEach((c) => flatPaths(c, m, out));
|
|
116
|
+
}
|
|
117
|
+
return out;
|
|
118
|
+
}
|
|
119
|
+
/** A scene with every group transform removed (for the animated export, whose paths carry baked geometry). */
|
|
120
|
+
function stripTransforms(node: SceneNode): SceneNode {
|
|
121
|
+
return node.kind === 'path' ? node : { ...node, transform: undefined, children: node.children.map(stripTransforms) };
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
export type CatSvgOptions = {
|
|
125
|
+
/** The pose at this time (ms) — for a static export. */
|
|
126
|
+
timeMs?: number;
|
|
127
|
+
/** Animation model to sample; defaults to the one the config builds. */
|
|
128
|
+
animation?: CatAnimationDocument;
|
|
129
|
+
/** Write a self-playing SVG (SMIL `<animate>` on each moving path) instead of one frame. */
|
|
130
|
+
animated?: boolean;
|
|
131
|
+
/** Samples per second baked into an animated SVG. */
|
|
132
|
+
fps?: number;
|
|
133
|
+
/** Prepended to every id, so several cats can share a page. */
|
|
134
|
+
idPrefix?: string;
|
|
135
|
+
width?: number;
|
|
136
|
+
height?: number;
|
|
137
|
+
/** Embed the config and animation JSON in <metadata>, so the file can be read back. Default true. */
|
|
138
|
+
metadata?: boolean;
|
|
139
|
+
};
|
|
140
|
+
|
|
141
|
+
/**
|
|
142
|
+
* **A standalone SVG file** of the cat: pure vector, no raster, no script. Static: the pose at
|
|
143
|
+
* `timeMs`, with the rig's groups and transforms kept (open it in any editor and the tail is still a
|
|
144
|
+
* group). Animated: every path that moves carries an `<animate attributeName="d">` sampled from the
|
|
145
|
+
* animation model at `fps`, so it plays by itself in a browser — no JavaScript.
|
|
146
|
+
*/
|
|
147
|
+
export function catSvg(config: CatConfig, opts: CatSvgOptions = {}): string {
|
|
148
|
+
const doc = opts.animation ?? buildAnimationDocument(config);
|
|
149
|
+
const prefix = opts.idPrefix ?? '';
|
|
150
|
+
const { x, y, width, height } = CAT_VIEWBOX;
|
|
151
|
+
const w = opts.width ?? Math.round(width / 4), h = opts.height ?? Math.round(height / 4);
|
|
152
|
+
const duration = documentDuration(doc);
|
|
153
|
+
const anims = Object.values(doc.animations);
|
|
154
|
+
let body: string;
|
|
155
|
+
if (opts.animated && duration > 0) {
|
|
156
|
+
const loop = anims.every((a) => a.loop);
|
|
157
|
+
const frames = Math.max(2, Math.round((duration / 1000) * (opts.fps ?? 60)));
|
|
158
|
+
const samples = Array.from({ length: frames + 1 }, (_, k) => flatPaths(catScene(config, catPose(config, (k * duration) / frames, doc))));
|
|
159
|
+
const animatedD = new Map<string, string>();
|
|
160
|
+
for (const id of samples[0]!.keys()) {
|
|
161
|
+
const values = samples.map((s) => pathD(s.get(id)!));
|
|
162
|
+
animatedD.set(id, values.every((v) => v === values[0])
|
|
163
|
+
? ''
|
|
164
|
+
: `<animate attributeName="d" dur="${duration}ms" repeatCount="${loop ? 'indefinite' : '1'}" fill="freeze" calcMode="linear" values="${values.join(';')}"/>`);
|
|
165
|
+
}
|
|
166
|
+
const first = samples[0]!;
|
|
167
|
+
const scene = stripTransforms(catScene(config, catPose(config, 0, doc)));
|
|
168
|
+
const bake = (n: SceneNode): SceneNode => (n.kind === 'path' ? { ...n, commands: first.get(n.id)! } : { ...n, children: n.children.map(bake) });
|
|
169
|
+
body = nodeSvg(bake(scene), prefix, new Map([...animatedD].filter(([, v]) => v)));
|
|
170
|
+
} else {
|
|
171
|
+
body = nodeSvg(catScene(config, catPose(config, opts.timeMs ?? 0, doc)), prefix);
|
|
172
|
+
}
|
|
173
|
+
const bg = config.background ? `<rect id="${prefix}cat-background" x="${x}" y="${y}" width="${width}" height="${height}" fill="${esc(config.background)}"/>` : '';
|
|
174
|
+
const meta = opts.metadata === false ? '' : `<metadata id="${prefix}cat-rig">${esc(JSON.stringify({ config, animation: doc }))}</metadata>`;
|
|
175
|
+
return [
|
|
176
|
+
`<svg xmlns="http://www.w3.org/2000/svg" viewBox="${x} ${y} ${width} ${height}" width="${w}" height="${h}">`,
|
|
177
|
+
`<title>Cat</title><desc>${esc(CAT_CREDIT)}</desc>${meta}`,
|
|
178
|
+
bg + body,
|
|
179
|
+
'</svg>',
|
|
180
|
+
].join('\n') + '\n';
|
|
181
|
+
}
|
|
@@ -0,0 +1,420 @@
|
|
|
1
|
+
import type { Control, ListSpec } from './controls';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* **The canonical-config machinery of a configurable-motion template** — defaults, validation, patches,
|
|
5
|
+
* diffs and the JSON Schema, all derived from the template's control table. People (the Remotion
|
|
6
|
+
* Studio, the site editor) and agents (patches) read and write the same object through these functions.
|
|
7
|
+
*
|
|
8
|
+
* Generalized from promo-product-showcase (`../promo/config.ts`, which keeps its own copy for its scene
|
|
9
|
+
* overrides). Pure: no React, no DOM. Nothing here throws on bad input — validation returns errors.
|
|
10
|
+
*/
|
|
11
|
+
export type ConfigError = { path: string; message: string };
|
|
12
|
+
export type Obj = Record<string, unknown>;
|
|
13
|
+
export type PatchOp =
|
|
14
|
+
| { op: 'replace'; path: string; value: unknown }
|
|
15
|
+
| { op: 'merge'; path: string; value: Obj }
|
|
16
|
+
| { op: 'remove'; path: string };
|
|
17
|
+
/** Either a list of operations or the flat form `{ patch: { 'content.top.headline': '…' } }` (all replaces). */
|
|
18
|
+
export type ConfigPatch = PatchOp[] | { patch: Record<string, unknown> };
|
|
19
|
+
export type PatchResult<C> = { valid: true; config: C; changed: string[] } | { valid: false; errors: ConfigError[] };
|
|
20
|
+
|
|
21
|
+
export const isObj = (v: unknown): v is Obj => typeof v === 'object' && v !== null && !Array.isArray(v);
|
|
22
|
+
export const clone = <T>(v: T): T => (v === undefined ? v : JSON.parse(JSON.stringify(v)));
|
|
23
|
+
|
|
24
|
+
/** Read a dotted path; numeric segments index arrays (`folds.0.peakAngle`). */
|
|
25
|
+
export function getPath(obj: unknown, path: string): unknown {
|
|
26
|
+
if (path === '') return obj;
|
|
27
|
+
let cur: unknown = obj;
|
|
28
|
+
for (const k of path.split('.')) {
|
|
29
|
+
if (Array.isArray(cur) && /^\d+$/.test(k)) cur = cur[Number(k)];
|
|
30
|
+
else if (isObj(cur)) cur = cur[k];
|
|
31
|
+
else return undefined;
|
|
32
|
+
}
|
|
33
|
+
return cur;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export function setPath(obj: Obj, path: string, value: unknown) {
|
|
37
|
+
const keys = path.split('.');
|
|
38
|
+
let cur: Obj | unknown[] = obj;
|
|
39
|
+
for (const k of keys.slice(0, -1)) {
|
|
40
|
+
const next: unknown = Array.isArray(cur) ? cur[Number(k)] : cur[k];
|
|
41
|
+
if (!isObj(next) && !Array.isArray(next)) {
|
|
42
|
+
const made = {};
|
|
43
|
+
if (Array.isArray(cur)) cur[Number(k)] = made; else cur[k] = made;
|
|
44
|
+
cur = made;
|
|
45
|
+
} else cur = next as Obj | unknown[];
|
|
46
|
+
}
|
|
47
|
+
const last = keys.at(-1)!;
|
|
48
|
+
if (Array.isArray(cur)) cur[Number(last)] = value; else cur[last] = value;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
const HEX = /^#[0-9a-fA-F]{6}$/;
|
|
52
|
+
// eslint-disable-next-line no-control-regex -- rejecting control characters is the point
|
|
53
|
+
const UNSAFE_TEXT = /[\u0000-\u001f\u007f]/;
|
|
54
|
+
// eslint-disable-next-line no-control-regex -- as above, but a line break is allowed in multiline text
|
|
55
|
+
const UNSAFE_MULTILINE = /[\u0000-\u0009\u000b-\u001f\u007f]/;
|
|
56
|
+
/**
|
|
57
|
+
* An asset is a reference, never markup: a file in the render's public folder (`static:`), an https
|
|
58
|
+
* URL, or a raster data URL. SVG (which can carry script) and every other scheme are refused.
|
|
59
|
+
*/
|
|
60
|
+
const ASSET = /^(static:[A-Za-z0-9._\-/]+|https:\/\/[^\s"'<>\\]+|data:image\/(png|jpeg|webp);base64,[A-Za-z0-9+/=]+)$/;
|
|
61
|
+
export function isAssetRef(v: string) {
|
|
62
|
+
return v === '' || (ASSET.test(v) && !v.includes('..'));
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export type ConfigApiSpec<C> = {
|
|
66
|
+
/** Template id, used in messages. */
|
|
67
|
+
name: string;
|
|
68
|
+
/** The `schema` value a config may carry (`paper-fold-promo/1`). */
|
|
69
|
+
schemaId: string;
|
|
70
|
+
title: string;
|
|
71
|
+
controls: readonly Control[];
|
|
72
|
+
lists: readonly ListSpec[];
|
|
73
|
+
/** Cross-field rules, run on a complete config whose every leaf is valid. */
|
|
74
|
+
relations?: (config: C, errors: ConfigError[]) => void;
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
/** Build the config API of one template from its control table. */
|
|
78
|
+
export function createConfigApi<C extends Obj>(spec: ConfigApiSpec<C>) {
|
|
79
|
+
const { name: NAME, schemaId, controls: CONTROLS, lists: LISTS } = spec;
|
|
80
|
+
const CONTROL_BY_PATH = new Map(CONTROLS.map((c) => [c.path, c]));
|
|
81
|
+
const LIST_BY_PATH = new Map(LISTS.map((l) => [l.path, l]));
|
|
82
|
+
const isPrimitive = (l: ListSpec) => l.item.length === 1 && l.item[0]!.path === '';
|
|
83
|
+
|
|
84
|
+
function defaultItem(list: ListSpec): unknown {
|
|
85
|
+
if (isPrimitive(list)) return clone(list.item[0]!.default);
|
|
86
|
+
const out: Obj = {};
|
|
87
|
+
for (const c of list.item) out[c.path] = clone(c.default);
|
|
88
|
+
return out;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
/** The reference config: every control and list at its default. A fresh copy each call. */
|
|
92
|
+
function defaultConfig(): C {
|
|
93
|
+
const out: Obj = { schema: schemaId };
|
|
94
|
+
for (const c of CONTROLS) setPath(out, c.path, clone(c.default));
|
|
95
|
+
for (const l of LISTS) setPath(out, l.path, clone(l.default));
|
|
96
|
+
return out as C;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
/** `folds.top.peakAngle` → `folds.0.peakAngle` for keyed lists; any other path is returned as is. */
|
|
100
|
+
function canonicalPath(path: string): string {
|
|
101
|
+
for (const l of LISTS) {
|
|
102
|
+
if (!l.keys || !path.startsWith(`${l.path}.`)) continue;
|
|
103
|
+
const [key, ...rest] = path.slice(l.path.length + 1).split('.');
|
|
104
|
+
const i = l.keys.indexOf(key!);
|
|
105
|
+
if (i >= 0) return [l.path, String(i), ...rest].join('.');
|
|
106
|
+
}
|
|
107
|
+
return path;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
function checkLeaf(c: Control, p: string, v: unknown, errors: ConfigError[]) {
|
|
111
|
+
switch (c.type) {
|
|
112
|
+
case 'number':
|
|
113
|
+
case 'integer': {
|
|
114
|
+
if (typeof v !== 'number' || !Number.isFinite(v)) return void errors.push({ path: p, message: `${p} must be a finite number (got ${JSON.stringify(v)}).` });
|
|
115
|
+
if (c.type === 'integer' && !Number.isInteger(v)) return void errors.push({ path: p, message: `${p} must be a whole number (got ${v}).` });
|
|
116
|
+
if (v < c.min! || v > c.max!) errors.push({ path: p, message: `${p} must be between ${c.min} and ${c.max}${c.unit && !['fraction', 'factor'].includes(c.unit) ? ` ${c.unit}` : ''} (got ${v}).` });
|
|
117
|
+
return;
|
|
118
|
+
}
|
|
119
|
+
case 'boolean':
|
|
120
|
+
if (typeof v !== 'boolean') errors.push({ path: p, message: `${p} must be true or false.` });
|
|
121
|
+
return;
|
|
122
|
+
case 'color':
|
|
123
|
+
if (typeof v !== 'string' || !HEX.test(v)) errors.push({ path: p, message: `${p} must be a hex colour in the form #rrggbb (got ${JSON.stringify(v)}).` });
|
|
124
|
+
return;
|
|
125
|
+
case 'enum':
|
|
126
|
+
case 'easing':
|
|
127
|
+
if (!c.options!.includes(v as string | number)) errors.push({ path: p, message: `${p} must be one of ${c.options!.map((o) => JSON.stringify(o)).join(', ')} (got ${JSON.stringify(v)}).` });
|
|
128
|
+
return;
|
|
129
|
+
case 'text': {
|
|
130
|
+
if (typeof v !== 'string') return void errors.push({ path: p, message: `${p} must be a string.` });
|
|
131
|
+
if ((c.multiline ? UNSAFE_MULTILINE : UNSAFE_TEXT).test(v)) {
|
|
132
|
+
return void errors.push({ path: p, message: c.multiline ? `${p} must be plain text (line breaks are allowed; other control characters are not).` : `${p} must be a single line of plain text (no control characters or line breaks).` });
|
|
133
|
+
}
|
|
134
|
+
if (v.trim().length < (c.minLength ?? 0)) errors.push({ path: p, message: `${p} must not be empty.` });
|
|
135
|
+
if (v.length > c.maxLength!) errors.push({ path: p, message: `${p} accepts at most ${c.maxLength} characters (got ${v.length}).` });
|
|
136
|
+
return;
|
|
137
|
+
}
|
|
138
|
+
case 'asset':
|
|
139
|
+
if (typeof v !== 'string' || v.length > c.maxLength! || !isAssetRef(v)) errors.push({ path: p, message: `${p} must be an asset reference: "" (procedural), "static:<file>", "https://…" or a PNG/JPEG/WebP data: URL (got ${JSON.stringify(typeof v === 'string' ? v.slice(0, 60) : v)}).` });
|
|
140
|
+
return;
|
|
141
|
+
case 'overrides':
|
|
142
|
+
if (!isObj(v)) errors.push({ path: p, message: `${p} must be an object.` });
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
/** Resolve a concrete config path (with list indexes or keys) to its control. */
|
|
147
|
+
function controlAt(rawPath: string): { control: Control; list?: ListSpec; index?: number } | undefined {
|
|
148
|
+
const path = canonicalPath(rawPath);
|
|
149
|
+
const direct = CONTROL_BY_PATH.get(path);
|
|
150
|
+
if (direct) return { control: direct };
|
|
151
|
+
for (const l of LISTS) {
|
|
152
|
+
if (!path.startsWith(`${l.path}.`)) continue;
|
|
153
|
+
const [idx, ...rest] = path.slice(l.path.length + 1).split('.');
|
|
154
|
+
if (!/^\d+$/.test(idx!)) return undefined;
|
|
155
|
+
const field = rest.join('.');
|
|
156
|
+
const control = l.item.find((c) => c.path === field);
|
|
157
|
+
return control ? { control, list: l, index: Number(idx) } : undefined;
|
|
158
|
+
}
|
|
159
|
+
return undefined;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
function checkList(l: ListSpec, v: unknown, errors: ConfigError[]): unknown[] | undefined {
|
|
163
|
+
const p = l.path;
|
|
164
|
+
if (!Array.isArray(v)) return void errors.push({ path: p, message: `${p} must be an array (${l.minItems}–${l.maxItems} items).` });
|
|
165
|
+
if (v.length < l.minItems || v.length > l.maxItems) errors.push({ path: p, message: l.minItems === l.maxItems ? `${p} must have exactly ${l.minItems} items (got ${v.length}).` : `${p} must have ${l.minItems}–${l.maxItems} items (got ${v.length}).` });
|
|
166
|
+
const out: unknown[] = [];
|
|
167
|
+
v.forEach((item, i) => {
|
|
168
|
+
const ip = `${p}.${i}`;
|
|
169
|
+
if (isPrimitive(l)) {
|
|
170
|
+
checkLeaf(l.item[0]!, ip, item, errors);
|
|
171
|
+
out.push(clone(item));
|
|
172
|
+
return;
|
|
173
|
+
}
|
|
174
|
+
if (!isObj(item)) return void errors.push({ path: ip, message: `${ip} must be an object.` });
|
|
175
|
+
const extra = Object.keys(item).filter((k) => !l.item.some((c) => c.path === k));
|
|
176
|
+
for (const k of extra) errors.push({ path: `${ip}.${k}`, message: `${ip}.${k} is not a field of ${p} items (fields: ${l.item.map((c) => c.path).join(', ')}). No code, CSS, SVG, HTML or shader can be set.` });
|
|
177
|
+
const merged = (l.keys && l.default[i] ? clone(l.default[i]) : defaultItem(l)) as Obj;
|
|
178
|
+
for (const c of l.item) {
|
|
179
|
+
if (item[c.path] === undefined) continue;
|
|
180
|
+
const before = errors.length;
|
|
181
|
+
checkLeaf(c, `${ip}.${c.path}`, item[c.path], errors);
|
|
182
|
+
if (errors.length === before) merged[c.path] = clone(item[c.path]);
|
|
183
|
+
}
|
|
184
|
+
out.push(merged);
|
|
185
|
+
});
|
|
186
|
+
if (l.keys && l.keyField) {
|
|
187
|
+
out.forEach((item, i) => {
|
|
188
|
+
const key = (item as Obj)[l.keyField!];
|
|
189
|
+
if (key !== l.keys![i]) errors.push({ path: `${p}.${i}.${l.keyField}`, message: `${p}.${i}.${l.keyField} must be "${l.keys![i]}": ${p} always lists ${l.keys!.map((k) => `"${k}"`).join(', ')} in that order.` });
|
|
190
|
+
});
|
|
191
|
+
}
|
|
192
|
+
return out;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
const isGroupPath = (path: string) => CONTROLS.some((c) => c.path.startsWith(`${path}.`)) || LISTS.some((l) => l.path.startsWith(`${path}.`));
|
|
196
|
+
|
|
197
|
+
/** Keys in `value` that no control, list or group declares, as dotted paths. */
|
|
198
|
+
function unknownKeys(value: Obj, prefix = ''): string[] {
|
|
199
|
+
const out: string[] = [];
|
|
200
|
+
for (const [k, v] of Object.entries(value)) {
|
|
201
|
+
const path = prefix ? `${prefix}.${k}` : k;
|
|
202
|
+
if (!prefix && k === 'schema') continue;
|
|
203
|
+
if (CONTROL_BY_PATH.has(path) || LIST_BY_PATH.has(path)) continue;
|
|
204
|
+
if (!isGroupPath(path)) out.push(path);
|
|
205
|
+
else if (isObj(v)) out.push(...unknownKeys(v, path));
|
|
206
|
+
else out.push(path);
|
|
207
|
+
}
|
|
208
|
+
return out;
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
/**
|
|
212
|
+
* Check a config. Partial configs are allowed (missing values take their defaults); anything present
|
|
213
|
+
* must be a known control with a valid value. Never throws.
|
|
214
|
+
*/
|
|
215
|
+
function validateConfig(input: unknown): { valid: boolean; errors: ConfigError[]; config?: C } {
|
|
216
|
+
const errors: ConfigError[] = [];
|
|
217
|
+
if (!isObj(input)) return { valid: false, errors: [{ path: '', message: 'The configuration must be a JSON object.' }] };
|
|
218
|
+
if (input.schema !== undefined && input.schema !== schemaId) errors.push({ path: 'schema', message: `schema must be "${schemaId}" (got ${JSON.stringify(input.schema)}).` });
|
|
219
|
+
for (const path of unknownKeys(input)) {
|
|
220
|
+
errors.push({ path, message: `${path} is not a ${NAME} control. Only the values in the schema can be set — no code, CSS, SVG, HTML or shader of any kind.` });
|
|
221
|
+
}
|
|
222
|
+
const merged = defaultConfig() as Obj;
|
|
223
|
+
for (const c of CONTROLS) {
|
|
224
|
+
const v = getPath(input, c.path);
|
|
225
|
+
if (v === undefined) continue;
|
|
226
|
+
const before = errors.length;
|
|
227
|
+
checkLeaf(c, c.path, v, errors);
|
|
228
|
+
if (errors.length === before) setPath(merged, c.path, clone(v));
|
|
229
|
+
}
|
|
230
|
+
for (const l of LISTS) {
|
|
231
|
+
const v = getPath(input, l.path);
|
|
232
|
+
if (v === undefined) continue;
|
|
233
|
+
const items = checkList(l, v, errors);
|
|
234
|
+
if (items) setPath(merged, l.path, items);
|
|
235
|
+
}
|
|
236
|
+
if (!errors.length) spec.relations?.(merged as C, errors);
|
|
237
|
+
return errors.length ? { valid: false, errors } : { valid: true, errors, config: merged as C };
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
/** A path to one list item: `<list>.<index>` or `<list>.<key>`. */
|
|
241
|
+
function listItemAt(rawPath: string): { list: ListSpec; index: number } | undefined {
|
|
242
|
+
const path = canonicalPath(rawPath);
|
|
243
|
+
for (const l of LISTS) {
|
|
244
|
+
const m = path.startsWith(`${l.path}.`) ? /^(\d+)$/.exec(path.slice(l.path.length + 1)) : null;
|
|
245
|
+
if (m) return { list: l, index: Number(m[1]) };
|
|
246
|
+
}
|
|
247
|
+
return undefined;
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
/**
|
|
251
|
+
* Apply a patch and validate the result. The input is never modified. Nothing is applied unless
|
|
252
|
+
* every operation is well formed and the result is valid.
|
|
253
|
+
*/
|
|
254
|
+
function applyPatch(config: unknown, patch: unknown): PatchResult<C> {
|
|
255
|
+
const start = validateConfig(config);
|
|
256
|
+
if (!start.valid) return { valid: false, errors: start.errors.map((e) => ({ ...e, message: `(before the patch) ${e.message}` })) };
|
|
257
|
+
let ops: PatchOp[];
|
|
258
|
+
if (Array.isArray(patch)) ops = patch as PatchOp[];
|
|
259
|
+
else if (isObj(patch) && isObj(patch.patch) && Object.keys(patch).length === 1) ops = Object.entries(patch.patch).map(([path, value]) => ({ op: 'replace', path, value }));
|
|
260
|
+
else return { valid: false, errors: [{ path: '', message: 'A patch is a list of { op, path, value } operations, or { "patch": { "<path>": value } }.' }] };
|
|
261
|
+
|
|
262
|
+
const next = clone(start.config!) as Obj;
|
|
263
|
+
const errors: ConfigError[] = [];
|
|
264
|
+
const changed: string[] = [];
|
|
265
|
+
const replace = (rawPath: string, value: unknown): string | undefined => {
|
|
266
|
+
const path = canonicalPath(rawPath);
|
|
267
|
+
if (CONTROL_BY_PATH.has(path) || LIST_BY_PATH.has(path)) { setPath(next, path, clone(value)); return; }
|
|
268
|
+
const item = listItemAt(path);
|
|
269
|
+
if (item) {
|
|
270
|
+
const arr = getPath(next, item.list.path) as unknown[];
|
|
271
|
+
if (item.index > arr.length) return `${rawPath}: ${item.list.path} has ${arr.length} items; use index ${arr.length} to add one.`;
|
|
272
|
+
arr[item.index] = isPrimitive(item.list) ? clone(value) : isObj(value) ? { ...(defaultItem(item.list) as Obj), ...clone(value) } : value;
|
|
273
|
+
return;
|
|
274
|
+
}
|
|
275
|
+
const hit = controlAt(path);
|
|
276
|
+
if (hit?.list) {
|
|
277
|
+
const arr = getPath(next, hit.list.path) as Obj[];
|
|
278
|
+
if (hit.index! >= arr.length) {
|
|
279
|
+
if (hit.index! > arr.length) return `${rawPath}: ${hit.list.path} has ${arr.length} items; use index ${arr.length} to add one.`;
|
|
280
|
+
arr.push(defaultItem(hit.list) as Obj);
|
|
281
|
+
}
|
|
282
|
+
setPath(next, path, clone(value));
|
|
283
|
+
return;
|
|
284
|
+
}
|
|
285
|
+
return `${rawPath} is not a ${NAME} control${isGroupPath(path) ? ' (it is a group: use "merge")' : ''}.`;
|
|
286
|
+
};
|
|
287
|
+
ops.forEach((o, i) => {
|
|
288
|
+
const where = `patch[${i}]`;
|
|
289
|
+
if (!isObj(o) || typeof o.path !== 'string') return void errors.push({ path: where, message: `${where} must be { op, path, value } with a dotted path.` });
|
|
290
|
+
const extra = Object.keys(o).filter((k) => !['op', 'path', 'value'].includes(k));
|
|
291
|
+
if (extra.length) return void errors.push({ path: where, message: `${where}: ${extra.join(', ')} ${extra.length === 1 ? 'is' : 'are'} not part of a patch operation.` });
|
|
292
|
+
if (o.op === 'replace') {
|
|
293
|
+
const err = replace(o.path, o.value);
|
|
294
|
+
if (err) errors.push({ path: o.path, message: err }); else changed.push(canonicalPath(o.path));
|
|
295
|
+
} else if (o.op === 'merge') {
|
|
296
|
+
if (!isObj(o.value)) return void errors.push({ path: o.path, message: 'merge needs an object value.' });
|
|
297
|
+
const path = canonicalPath(o.path);
|
|
298
|
+
if (!isGroupPath(path) && !listItemAt(path)) return void errors.push({ path: o.path, message: `merge needs a group path (such as "content.top") or a list item (such as "folds.0").` });
|
|
299
|
+
const walk = (value: Obj, prefix: string) => {
|
|
300
|
+
for (const [k, v] of Object.entries(value)) {
|
|
301
|
+
const p = `${prefix}.${k}`;
|
|
302
|
+
if (isObj(v) && !controlAt(p) && isGroupPath(canonicalPath(p))) { walk(v, p); continue; }
|
|
303
|
+
const err = replace(p, v);
|
|
304
|
+
if (err) errors.push({ path: p, message: err }); else changed.push(canonicalPath(p));
|
|
305
|
+
}
|
|
306
|
+
};
|
|
307
|
+
walk(o.value, path);
|
|
308
|
+
} else if (o.op === 'remove') {
|
|
309
|
+
const path = canonicalPath(o.path);
|
|
310
|
+
const item = listItemAt(path);
|
|
311
|
+
if (item) {
|
|
312
|
+
const arr = getPath(next, item.list.path) as unknown[];
|
|
313
|
+
if (item.index >= arr.length) return void errors.push({ path: o.path, message: `${o.path}: there is no item ${item.index} in ${item.list.path}.` });
|
|
314
|
+
if (item.list.keys) {
|
|
315
|
+
// A keyed list keeps its items: removing one resets it to its default.
|
|
316
|
+
arr[item.index] = clone(item.list.default[item.index]);
|
|
317
|
+
} else arr.splice(item.index, 1);
|
|
318
|
+
changed.push(path);
|
|
319
|
+
return;
|
|
320
|
+
}
|
|
321
|
+
const itemField = controlAt(path);
|
|
322
|
+
if (itemField?.list) {
|
|
323
|
+
const arr = getPath(next, itemField.list.path) as Obj[];
|
|
324
|
+
const def = (itemField.list.keys ? itemField.list.default[itemField.index!] : defaultItem(itemField.list)) as Obj;
|
|
325
|
+
if (arr[itemField.index!]) { arr[itemField.index!]![itemField.control.path] = clone(def[itemField.control.path]); changed.push(path); }
|
|
326
|
+
return;
|
|
327
|
+
}
|
|
328
|
+
const hits = CONTROLS.filter((c) => c.path === path || c.path.startsWith(`${path}.`));
|
|
329
|
+
const lists = LISTS.filter((l) => l.path === path || l.path.startsWith(`${path}.`));
|
|
330
|
+
if (!hits.length && !lists.length) return void errors.push({ path: o.path, message: `${o.path} is not a ${NAME} control, list or group.` });
|
|
331
|
+
for (const c of hits) { setPath(next, c.path, clone(c.default)); changed.push(c.path); }
|
|
332
|
+
for (const l of lists) { setPath(next, l.path, clone(l.default)); changed.push(l.path); }
|
|
333
|
+
} else {
|
|
334
|
+
errors.push({ path: where, message: `${where}.op must be "replace", "merge" or "remove".` });
|
|
335
|
+
}
|
|
336
|
+
});
|
|
337
|
+
if (errors.length) return { valid: false, errors };
|
|
338
|
+
const end = validateConfig(next);
|
|
339
|
+
if (!end.valid) return { valid: false, errors: end.errors };
|
|
340
|
+
return { valid: true, config: end.config!, changed };
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
/** The difference between two configs as a flat patch (only what changed). Lists that change length are replaced whole. */
|
|
344
|
+
function diffConfig(from: unknown, to: unknown): { patch: Record<string, unknown> } {
|
|
345
|
+
const patch: Record<string, unknown> = {};
|
|
346
|
+
for (const c of CONTROLS) {
|
|
347
|
+
const a = getPath(from, c.path) ?? c.default, b = getPath(to, c.path) ?? c.default;
|
|
348
|
+
if (JSON.stringify(a) !== JSON.stringify(b)) patch[c.path] = clone(b);
|
|
349
|
+
}
|
|
350
|
+
for (const l of LISTS) {
|
|
351
|
+
const a = getPath(from, l.path) ?? l.default, b = getPath(to, l.path) ?? l.default;
|
|
352
|
+
if (JSON.stringify(a) === JSON.stringify(b)) continue;
|
|
353
|
+
const aa = a as unknown[], bb = b as unknown[];
|
|
354
|
+
if (aa.length !== bb.length || isPrimitive(l)) { patch[l.path] = clone(b); continue; }
|
|
355
|
+
bb.forEach((item, i) => {
|
|
356
|
+
for (const c of l.item) {
|
|
357
|
+
const x = (aa[i] as Obj)[c.path], y = (item as Obj)[c.path];
|
|
358
|
+
if (JSON.stringify(x) !== JSON.stringify(y)) patch[`${l.path}.${i}.${c.path}`] = clone(y);
|
|
359
|
+
}
|
|
360
|
+
});
|
|
361
|
+
}
|
|
362
|
+
return { patch };
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
function leafSchema(c: Control): Obj {
|
|
366
|
+
const meta = { description: c.description, default: c.default, 'x-group': c.group, 'x-userEditable': c.userEditable, 'x-agentEditable': c.agentEditable, ...(c.unit ? { 'x-unit': c.unit } : {}) };
|
|
367
|
+
switch (c.type) {
|
|
368
|
+
case 'number': return { type: 'number', minimum: c.min, maximum: c.max, ...meta };
|
|
369
|
+
case 'integer': return { type: 'integer', minimum: c.min, maximum: c.max, ...meta };
|
|
370
|
+
case 'boolean': return { type: 'boolean', ...meta };
|
|
371
|
+
case 'color': return { type: 'string', pattern: '^#[0-9a-fA-F]{6}$', format: 'hex-color', ...meta };
|
|
372
|
+
case 'enum': return { enum: [...c.options!], ...meta };
|
|
373
|
+
case 'easing': return { enum: [...c.options!], ...meta };
|
|
374
|
+
case 'text': return { type: 'string', minLength: c.minLength ?? 0, maxLength: c.maxLength, pattern: c.multiline ? '^[^\\u0000-\\u0009\\u000b-\\u001f\\u007f]*$' : '^[^\\u0000-\\u001f\\u007f]*$', ...(c.multiline ? { 'x-multiline': true } : {}), ...meta };
|
|
375
|
+
case 'asset': return { type: 'string', maxLength: c.maxLength, pattern: ASSET.source.replace(/^\^\(/, '^$|^(').replace(/\)\$$/, ')$'), 'x-asset': true, ...meta };
|
|
376
|
+
case 'overrides': return { type: 'object', ...meta };
|
|
377
|
+
}
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
function listSchema(l: ListSpec): Obj {
|
|
381
|
+
const items = isPrimitive(l) ? leafSchema(l.item[0]!) : {
|
|
382
|
+
type: 'object', additionalProperties: false,
|
|
383
|
+
properties: Object.fromEntries(l.item.map((c) => [c.path, leafSchema(c)])),
|
|
384
|
+
};
|
|
385
|
+
return {
|
|
386
|
+
type: 'array', minItems: l.minItems, maxItems: l.maxItems, items, default: l.default, description: l.description, 'x-group': l.group,
|
|
387
|
+
...(l.keys ? { 'x-keys': l.keys, 'x-keyField': l.keyField } : {}),
|
|
388
|
+
};
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
/** JSON Schema 2020-12 of the whole config. Every property is optional (defaults fill the gaps). */
|
|
392
|
+
function configJsonSchema(): Obj {
|
|
393
|
+
const root: Obj = {
|
|
394
|
+
$schema: 'https://json-schema.org/draft/2020-12/schema',
|
|
395
|
+
$id: `https://comppack.vercel.app/schemas/${NAME}.json`,
|
|
396
|
+
title: spec.title,
|
|
397
|
+
description: `The one canonical configuration of the ${NAME} configurable-motion template. People and agents edit the same object; only these values exist.`,
|
|
398
|
+
type: 'object', additionalProperties: false,
|
|
399
|
+
properties: { schema: { const: schemaId } },
|
|
400
|
+
};
|
|
401
|
+
const place = (path: string, schema: Obj) => {
|
|
402
|
+
let node = root;
|
|
403
|
+
const keys = path.split('.');
|
|
404
|
+
for (const k of keys.slice(0, -1)) {
|
|
405
|
+
const props = node.properties as Obj;
|
|
406
|
+
props[k] ??= { type: 'object', additionalProperties: false, properties: {} };
|
|
407
|
+
node = props[k] as Obj;
|
|
408
|
+
}
|
|
409
|
+
(node.properties as Obj)[keys.at(-1)!] = schema;
|
|
410
|
+
};
|
|
411
|
+
for (const c of CONTROLS) place(c.path, leafSchema(c));
|
|
412
|
+
for (const l of LISTS) place(l.path, listSchema(l));
|
|
413
|
+
return root;
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
return {
|
|
417
|
+
CONTROL_BY_PATH, LIST_BY_PATH, getPath, defaultItem, defaultConfig, canonicalPath, controlAt,
|
|
418
|
+
validateConfig, applyPatch, diffConfig, configJsonSchema,
|
|
419
|
+
};
|
|
420
|
+
}
|