@appinternalleads/ui 0.4.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/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/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/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/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/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/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 +35 -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/manifests.ts +83 -1
- package/src/agent/result.ts +6 -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/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 +6887 -46
- package/tools/ask/mcp.mjs +80 -1
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { FONT_FAMILIES } from './controls';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* The registered typefaces (all OFL, from Google Fonts), upright and italic where the family has an
|
|
5
|
+
* italic. Remotion loads them with `@remotion/google-fonts`; the web player adds this stylesheet once.
|
|
6
|
+
*/
|
|
7
|
+
const ITALIC = new Set(['Inter', 'Manrope', 'DM Sans', 'Plus Jakarta Sans']);
|
|
8
|
+
const RANGE: Record<string, string> = { Inter: '300..900', Manrope: '300..800', 'DM Sans': '300..900', 'Plus Jakarta Sans': '300..800', 'Space Grotesk': '300..700' };
|
|
9
|
+
export const PAPER_FOLD_FONTS_CSS = `https://fonts.googleapis.com/css2?${FONT_FAMILIES.map((f) => {
|
|
10
|
+
const r = RANGE[f] ?? '300..800';
|
|
11
|
+
return `family=${f.replace(/ /g, '+')}:${ITALIC.has(f) ? `ital,wght@0,${r};1,${r}` : `wght@${r}`}`;
|
|
12
|
+
}).join('&')}&display=swap`;
|
|
13
|
+
|
|
14
|
+
export function installPaperFoldFonts(doc: Document | undefined = typeof document === 'undefined' ? undefined : document) {
|
|
15
|
+
if (!doc || doc.querySelector('link[data-paper-fold-fonts]')) return;
|
|
16
|
+
const link = doc.createElement('link');
|
|
17
|
+
link.rel = 'stylesheet';
|
|
18
|
+
link.href = PAPER_FOLD_FONTS_CSS;
|
|
19
|
+
link.setAttribute('data-paper-fold-fonts', '');
|
|
20
|
+
doc.head.appendChild(link);
|
|
21
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* **paper-fold-promo — a configurable-motion template drawn procedurally and rendered by Remotion.**
|
|
3
|
+
* One canonical config (the control table), a pure engine that folds three hinged panels in
|
|
4
|
+
* perspective and poses two vector hands, and a React/DOM renderer that draws it. `docs/MOTION-TEMPLATES.md`.
|
|
5
|
+
*/
|
|
6
|
+
export {
|
|
7
|
+
CONTROLS, CONTROL_BY_PATH, LISTS, LIST_BY_PATH, GROUPS, EASING_NAMES, ASPECT_RATIOS, FPS_OPTIONS, FONT_FAMILIES, FONT_WEIGHTS,
|
|
8
|
+
PANELS, FOLD_KEYS, HANDS, FOLD_DIRECTIONS, FOLD_SIDES, PHASES, PHASE_LABEL, PAPER_TEXT, LAYOUT_FOR, allControls,
|
|
9
|
+
type Control, type ListSpec, type Group, type EasingName, type AspectRatio, type PhaseId, type PanelId, type FoldKey, type HandId, type PaperTextId,
|
|
10
|
+
} from './controls';
|
|
11
|
+
export {
|
|
12
|
+
CONFIG_SCHEMA_ID, defaultConfig, defaultItem, validateConfig, resolveConfig, applyPatch, diffConfig, configJsonSchema, getPath, controlAt, canonicalPath,
|
|
13
|
+
phaseSpans, isAssetRef, PaperFoldConfigError, type PaperFoldConfig, type ConfigError, type ConfigPatch, type PatchOp,
|
|
14
|
+
} from './config';
|
|
15
|
+
export { PRESET_PATCHES, presetConfig, type PresetName } from './presets';
|
|
16
|
+
export {
|
|
17
|
+
frameState, timeline, layout, foldState, anchorOf, moversOf, outputDuration, outputFrameToMotion, motionToOutputFrame, phaseAt, stageFrames,
|
|
18
|
+
cssMatrix, project, mul, apply, seeded, mixHex, rgba, stripAt, manualFolds, EDGE_LIFT_SEGMENTS, textFits, estimateLines, BEND_SEGMENTS, MOTION_FPS,
|
|
19
|
+
type FrameState, type StripState, type Strip, type Sheet, type TextFit, type Timeline, type PhaseSpan, type Layout, type FoldState, type PanelState, type HandState, type EdgeFx, type Anchor, type Mat,
|
|
20
|
+
} from './engine';
|
|
21
|
+
export {
|
|
22
|
+
topHand, bottomHand, sleevePath, handSvg, handBodySvg, handFingerSvg, paperSheetSvg, paperSvg, creaseSvg, logoSvg, backgroundTypeSvg, HAND_SPECS, DEFAULT_POSE,
|
|
23
|
+
REFERENCE_HAND_COLOURS, REFERENCE_SHEET, type P, type HandArt, type HandPart, type HandShape, type HandPose, type HandPartName, type HandFill,
|
|
24
|
+
} from './art';
|
|
25
|
+
export { PAPER_FOLD_FONTS_CSS, installPaperFoldFonts } from './fonts';
|
|
26
|
+
export { PaperFoldFrame, FONT_STACK, handArt, handTransform, type PaperFoldFrameProps, type ImageProps } from './PaperFoldFrame';
|
|
27
|
+
export { PaperFoldPlayer, type PaperFoldPlayerProps } from './PaperFoldPlayer';
|
|
28
|
+
export { PaperFold, type PaperFoldProps, type HandPoseProps } from './PaperFold';
|
|
29
|
+
export { hitTest, handlesFor, dragPatch, canvasToSheet, handToScene, squareToQuad, quadToSquare, type Selection, type Handles } from './manipulate';
|
|
30
|
+
export { paperFoldPromo } from './template';
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
import { getPath, type PaperFoldConfig } from './config';
|
|
2
|
+
import type { FrameState, HandState } from './engine';
|
|
3
|
+
import type { HandArt, P } from './art';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* **Direct manipulation of paper-fold-promo** — pure geometry for an editor laid over the player:
|
|
7
|
+
* what is under the pointer (a gripping finger, a hand, a fold axis, a panel), its bounding box,
|
|
8
|
+
* transform origin and rotation handle, and the config patch a drag produces. Every edit is a patch of
|
|
9
|
+
* the same controls an agent sets, validated by the same `applyPatch`; the editor never moves
|
|
10
|
+
* pixels on its own.
|
|
11
|
+
*/
|
|
12
|
+
export type Selection =
|
|
13
|
+
| { kind: 'panel'; id: 'top' | 'middle' | 'bottom' }
|
|
14
|
+
| { kind: 'axis'; id: 0 | 1 }
|
|
15
|
+
| { kind: 'hand'; id: 'top' | 'bottom' }
|
|
16
|
+
| { kind: 'finger'; id: 'top' | 'bottom'; digit: string };
|
|
17
|
+
|
|
18
|
+
type Quad = [number, number][];
|
|
19
|
+
const dist = (a: P, b: P) => Math.hypot(a[0] - b[0], a[1] - b[1]);
|
|
20
|
+
const clamp = (v: number, lo: number, hi: number) => (v < lo ? lo : v > hi ? hi : v);
|
|
21
|
+
|
|
22
|
+
/** The 3×3 homography taking the unit square (0,0)(1,0)(1,1)(0,1) onto `q` (a projected quad). */
|
|
23
|
+
export function squareToQuad(q: Quad): number[] {
|
|
24
|
+
const [[x0, y0], [x1, y1], [x2, y2], [x3, y3]] = q as [P, P, P, P];
|
|
25
|
+
const dx1 = x1 - x2, dx2 = x3 - x2, dy1 = y1 - y2, dy2 = y3 - y2;
|
|
26
|
+
const sx = x0 - x1 + x2 - x3, sy = y0 - y1 + y2 - y3;
|
|
27
|
+
const den = dx1 * dy2 - dx2 * dy1;
|
|
28
|
+
const g = den ? (sx * dy2 - dx2 * sy) / den : 0, h = den ? (dx1 * sy - sx * dy1) / den : 0;
|
|
29
|
+
return [x1 - x0 + g * x1, x3 - x0 + h * x3, x0, y1 - y0 + g * y1, y3 - y0 + h * y3, y0, g, h, 1];
|
|
30
|
+
}
|
|
31
|
+
/** Where canvas point `p` lies in quad `q`, as (u, v) in the unit square (outside it when outside the quad). */
|
|
32
|
+
export function quadToSquare(q: Quad, p: P): P {
|
|
33
|
+
const [a, b, c, d, e, f, g, h] = squareToQuad(q) as [number, number, number, number, number, number, number, number];
|
|
34
|
+
// Inverse of [[a,b,c],[d,e,f],[g,h,1]] applied to (x, y, 1).
|
|
35
|
+
const A = e - f * h, B = c * h - b, C = b * f - c * e, D = f * g - d, E = a - c * g, F = c * d - a * f, G = d * h - e * g, H = b * g - a * h, K = a * e - b * d;
|
|
36
|
+
const [x, y] = p;
|
|
37
|
+
const w = G * x + H * y + K;
|
|
38
|
+
return [(A * x + B * y + C) / w, (D * x + E * y + F) / w];
|
|
39
|
+
}
|
|
40
|
+
const insideQuad = (q: Quad, p: P) => { const [u, v] = quadToSquare(q, p); return u >= 0 && u <= 1 && v >= 0 && v <= 1; };
|
|
41
|
+
|
|
42
|
+
/** The camera's 2D transform (it is applied to the whole scene), as a function canvas-of-scene → canvas. */
|
|
43
|
+
function cameraMap(st: FrameState): { fwd: (p: P) => P; inv: (p: P) => P } {
|
|
44
|
+
const cfg = st.cfg, n = (k: string) => getPath(cfg, k) as number;
|
|
45
|
+
const W = st.size.width, H = st.size.height, u = st.size.unit, z = st.camera.zoom, r = (n('camera.rotation') * Math.PI) / 180;
|
|
46
|
+
const cx = W / 2, cy = H / 2, px = n('camera.x') * u, py = n('camera.y') * u, c = Math.cos(r), s = Math.sin(r);
|
|
47
|
+
return {
|
|
48
|
+
fwd: ([x, y]) => { const X = x - cx - px, Y = y - cy - py; return [cx + z * (c * X - s * Y), cy + z * (s * X + c * Y)]; },
|
|
49
|
+
inv: ([x, y]) => { const X = (x - cx) / z, Y = (y - cy) / z; return [cx + px + c * X + s * Y, cy + py - s * X + c * Y]; },
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/** A point in hand units through the hand's transform (as `handTransform`), onto the scene. */
|
|
54
|
+
export function handToScene(h: HandState, [x, y]: P): P {
|
|
55
|
+
const k = h.unitScale * h.scale;
|
|
56
|
+
let X = (x + h.offsetX) * k, Y = (y + h.offsetY) * k;
|
|
57
|
+
const ty = Math.tan((h.skewY * Math.PI) / 180), tx = Math.tan((h.skewX * Math.PI) / 180);
|
|
58
|
+
// As SVG applies them: skewY first, then skewX.
|
|
59
|
+
Y += ty * X;
|
|
60
|
+
X += tx * Y;
|
|
61
|
+
const r = (h.rotation * Math.PI) / 180, c = Math.cos(r), s = Math.sin(r);
|
|
62
|
+
return [h.x + c * X - s * Y, h.y + s * X + c * Y];
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/** A canvas point on the sheet, as normalized sheet coordinates (0‥1 across and down), or undefined off it. */
|
|
66
|
+
export function canvasToSheet(st: FrameState, p: P): P | undefined {
|
|
67
|
+
const q = cameraMap(st).inv(p);
|
|
68
|
+
// The front-most strip under the point wins.
|
|
69
|
+
const hit = [...st.strips].sort((a, b) => b.z - a.z).find((s) => insideQuad(s.corners, q));
|
|
70
|
+
if (!hit) return undefined;
|
|
71
|
+
const [u, v] = quadToSquare(hit.corners, q);
|
|
72
|
+
return [u, (hit.y0 + v * (hit.y1 - hit.y0)) / st.size.paper.height];
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export type Handles = {
|
|
76
|
+
/** Axis-aligned bounds on the canvas. */
|
|
77
|
+
box: { x: number; y: number; width: number; height: number };
|
|
78
|
+
/** The outline drawn for the selection (a quad, a line, or the hand's silhouette points). */
|
|
79
|
+
outline: P[];
|
|
80
|
+
origin: P;
|
|
81
|
+
/** Where the rotation handle sits (none for a fold axis, which drags along the sheet). */
|
|
82
|
+
rotate?: P;
|
|
83
|
+
label: string;
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
/** Bounding box, transform origin and rotation handle of a selection, in canvas px. */
|
|
87
|
+
export function handlesFor(st: FrameState, sel: Selection, art: Record<'top' | 'bottom', HandArt>): Handles {
|
|
88
|
+
const cam = cameraMap(st).fwd;
|
|
89
|
+
const bounds = (pts: P[]) => {
|
|
90
|
+
const xs = pts.map((p) => p[0]), ys = pts.map((p) => p[1]);
|
|
91
|
+
return { x: Math.min(...xs), y: Math.min(...ys), width: Math.max(...xs) - Math.min(...xs), height: Math.max(...ys) - Math.min(...ys) };
|
|
92
|
+
};
|
|
93
|
+
if (sel.kind === 'panel') {
|
|
94
|
+
const p = st.panels.find((x) => x.id === sel.id)!;
|
|
95
|
+
const outline = p.corners.map(cam) as P[];
|
|
96
|
+
// A panel turns about its crease: the top panel about its bottom edge, the bottom panel about its top edge.
|
|
97
|
+
const axis = sel.id === 'top' ? st.debug.creases[0]! : st.debug.creases[1]!;
|
|
98
|
+
const origin = cam([(axis.from[0] + axis.to[0]) / 2, (axis.from[1] + axis.to[1]) / 2]);
|
|
99
|
+
// The handle sits on the edge opposite the panel's axis: the edge that travels as it folds.
|
|
100
|
+
const far = sel.id === 'bottom' ? [outline[3]!, outline[2]!] : [outline[0]!, outline[1]!];
|
|
101
|
+
const rotate: P = [(far[0]![0] + far[1]![0]) / 2, (far[0]![1] + far[1]![1]) / 2];
|
|
102
|
+
return { box: bounds(outline), outline, origin, rotate, label: `${sel.id.toUpperCase()} PANEL — drag the handle to fold` };
|
|
103
|
+
}
|
|
104
|
+
if (sel.kind === 'axis') {
|
|
105
|
+
const c = st.debug.creases[sel.id]!;
|
|
106
|
+
const outline = [cam(c.from), cam(c.to)];
|
|
107
|
+
return { box: bounds(outline), outline, origin: cam([(c.from[0] + c.to[0]) / 2, (c.from[1] + c.to[1]) / 2]), label: `FOLD AXIS ${c.id.toUpperCase()} · ${c.position.toFixed(3)} · ${c.angle.toFixed(0)}° — drag up or down` };
|
|
108
|
+
}
|
|
109
|
+
const h = st.hands.find((x) => x.id === sel.id)!;
|
|
110
|
+
const a = art[sel.id];
|
|
111
|
+
if (sel.kind === 'finger') {
|
|
112
|
+
const j = (a.joints[sel.digit] ?? []).map((q) => cam(handToScene(h, q)));
|
|
113
|
+
const knuckle = j[1] ?? j[0]!;
|
|
114
|
+
return { box: bounds(j), outline: j, origin: knuckle, rotate: j.at(-1), label: `${sel.id} ${sel.digit} — drag its tip to curl` };
|
|
115
|
+
}
|
|
116
|
+
const pts = [...a.palmOutline, ...Object.values(a.joints).flat()].map((q) => cam(handToScene(h, q)));
|
|
117
|
+
const origin = cam([h.x, h.y]);
|
|
118
|
+
const box = bounds(pts);
|
|
119
|
+
return { box, outline: [[box.x, box.y], [box.x + box.width, box.y], [box.x + box.width, box.y + box.height], [box.x, box.y + box.height]], origin, rotate: [box.x + box.width / 2, box.y - 24], label: `${sel.id.toUpperCase()} HAND — drag to move its grip, the handle to rotate` };
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
/** What is under canvas point `p`: gripping fingers first, then hands, fold axes, panels. */
|
|
123
|
+
export function hitTest(st: FrameState, p: P, art: Record<'top' | 'bottom', HandArt>, tolerance = 10): Selection | undefined {
|
|
124
|
+
const cam = cameraMap(st).fwd;
|
|
125
|
+
for (const h of st.hands) {
|
|
126
|
+
if (!h.enabled) continue;
|
|
127
|
+
for (const digit of ['thumb', 'indexFinger', 'middleFinger']) {
|
|
128
|
+
const j = art[h.id].joints[digit];
|
|
129
|
+
if (j && j.slice(2).some((q) => dist(cam(handToScene(h, q)), p) < tolerance * 1.4)) return { kind: 'finger', id: h.id, digit };
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
for (const h of st.hands) {
|
|
133
|
+
if (!h.enabled) continue;
|
|
134
|
+
const palm = art[h.id].palmOutline.map((q) => cam(handToScene(h, q)));
|
|
135
|
+
const xs = palm.map((q) => q[0]), ys = palm.map((q) => q[1]);
|
|
136
|
+
if (p[0] >= Math.min(...xs) && p[0] <= Math.max(...xs) && p[1] >= Math.min(...ys) && p[1] <= Math.max(...ys)) return { kind: 'hand', id: h.id };
|
|
137
|
+
}
|
|
138
|
+
for (const k of [0, 1] as const) {
|
|
139
|
+
const c = st.debug.creases[k]!;
|
|
140
|
+
const a = cam(c.from), b = cam(c.to);
|
|
141
|
+
const t = clamp(((p[0] - a[0]) * (b[0] - a[0]) + (p[1] - a[1]) * (b[1] - a[1])) / (dist(a, b) ** 2 || 1), 0, 1);
|
|
142
|
+
if (dist(p, [a[0] + t * (b[0] - a[0]), a[1] + t * (b[1] - a[1])]) < tolerance) return { kind: 'axis', id: k };
|
|
143
|
+
}
|
|
144
|
+
const panel = [...st.panels].sort((a, b) => b.z - a.z).find((x) => insideQuad(x.corners.map(cam) as Quad, p));
|
|
145
|
+
return panel ? { kind: 'panel', id: panel.id } : undefined;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
/**
|
|
149
|
+
* The patch a drag produces: from where it started (`from`) to where the pointer is (`to`), both canvas
|
|
150
|
+
* px, against the state at drag start. Values are clamped to their controls' ranges.
|
|
151
|
+
*/
|
|
152
|
+
export function dragPatch(cfg: PaperFoldConfig, st: FrameState, sel: Selection, from: P, to: P, handle: 'body' | 'rotate'): Record<string, unknown> {
|
|
153
|
+
const n = (k: string) => getPath(cfg, k) as number;
|
|
154
|
+
const dy = to[1] - from[1];
|
|
155
|
+
const scale = st.size.paper.height;
|
|
156
|
+
if (sel.kind === 'panel') {
|
|
157
|
+
// Folding by hand: the far edge's handle travels toward the crease → more fold (manual FOLD PROGRESS).
|
|
158
|
+
const base = getPath(cfg, 'motion.progressMode') === 'manual' ? n('motion.foldProgress') : 0;
|
|
159
|
+
const dir = sel.id === 'top' ? 1 : -1;
|
|
160
|
+
const range = sel.id === 'middle' ? 1 : 0.5;
|
|
161
|
+
const delta = (dir * dy) / (scale * 0.6) * range;
|
|
162
|
+
const lo = sel.id === 'bottom' ? 0.5 : 0, hi = sel.id === 'top' ? 0.5 : 1;
|
|
163
|
+
return { 'motion.progressMode': 'manual', 'motion.foldProgress': Math.round(clamp(clamp(base, lo, hi) + delta, lo, hi) * 1000) / 1000 };
|
|
164
|
+
}
|
|
165
|
+
if (sel.kind === 'axis') {
|
|
166
|
+
const at = canvasToSheet(st, to);
|
|
167
|
+
const pos = at ? at[1] : n(`creases.${sel.id}.position`) + dy / scale;
|
|
168
|
+
const other = n(`creases.${sel.id === 0 ? 1 : 0}.position`);
|
|
169
|
+
// Keep every panel at least 0.1 of the sheet tall (the validator's rule).
|
|
170
|
+
// (A thousandth of margin, so rounding never lands a hair inside the 0.1 limit.)
|
|
171
|
+
const v = sel.id === 0 ? clamp(pos, 0.1, other - 0.101) : clamp(pos, other + 0.101, 0.9);
|
|
172
|
+
return { [`creases.${sel.id}.position`]: sel.id === 0 ? Math.floor(v * 1000) / 1000 : Math.ceil(v * 1000) / 1000 };
|
|
173
|
+
}
|
|
174
|
+
const H = `hands.${sel.id}`;
|
|
175
|
+
if (sel.kind === 'finger') {
|
|
176
|
+
const path = sel.digit === 'thumb' ? `${H}.pose.thumbBend` : `${H}.pose.fingerCurl`;
|
|
177
|
+
const [lo, hi] = sel.digit === 'thumb' ? [-1, 1] : [0.3, 1.4];
|
|
178
|
+
return { [path]: Math.round(clamp(n(path) + dy / 150, lo, hi) * 100) / 100 };
|
|
179
|
+
}
|
|
180
|
+
if (handle === 'rotate') {
|
|
181
|
+
const h = st.hands.find((x) => x.id === sel.id)!;
|
|
182
|
+
const a0 = Math.atan2(from[1] - h.y, from[0] - h.x), a1 = Math.atan2(to[1] - h.y, to[0] - h.x);
|
|
183
|
+
return { [`${H}.rotation`]: Math.round(clamp(n(`${H}.rotation`) + ((a1 - a0) * 180) / Math.PI, -180, 180) * 10) / 10 };
|
|
184
|
+
}
|
|
185
|
+
const at = canvasToSheet(st, to);
|
|
186
|
+
if (!at) return {};
|
|
187
|
+
return { [`${H}.x`]: Math.round(clamp(at[0], 0, 1) * 1000) / 1000, [`${H}.y`]: Math.round(clamp(at[1], 0, 1) * 1000) / 1000 };
|
|
188
|
+
}
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
/* eslint-disable comppack/no-raw-colour -- preset colours are content, set through the same config as any edit (DECISIONS §25–§27). */
|
|
2
|
+
import { applyPatch, defaultConfig, type PaperFoldConfig } from './config';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* **Presets** — named patches over the neutral default config. Applying one is the same operation as
|
|
6
|
+
* any agent or person edit. The reference copy (the tixdoor launch) exists only here, in the
|
|
7
|
+
* `reference` patch, never in the implementation.
|
|
8
|
+
*/
|
|
9
|
+
const REFERENCE: Record<string, unknown> = {
|
|
10
|
+
'content.logo': 'tixdoor',
|
|
11
|
+
'logo.markText': 'T',
|
|
12
|
+
'content.top.headline': 'We are launching soon',
|
|
13
|
+
'content.middle.headline': 'Ready for a Better Way to Attend Events?',
|
|
14
|
+
'content.bottom.body': 'We\'re building the smarter way to discover, create, and attend events.',
|
|
15
|
+
'content.cta.text': 'Join Our Waitlist',
|
|
16
|
+
'background.backgroundTypography.text': 'LAUNCH',
|
|
17
|
+
};
|
|
18
|
+
const canvas = (aspectRatio: string, width: number, height: number) => ({ 'canvas.aspectRatio': aspectRatio, 'canvas.width': width, 'canvas.height': height });
|
|
19
|
+
|
|
20
|
+
/** A second campaign on the same template: different words, palette, background word, hands, speed and CTA. */
|
|
21
|
+
const DEMO: Record<string, unknown> = {
|
|
22
|
+
'content.logo': 'Northstar',
|
|
23
|
+
'logo.markText': 'N',
|
|
24
|
+
'logo.markColor': '#ffcc4d',
|
|
25
|
+
'logo.markColorEnd': '#ff9f1c',
|
|
26
|
+
'logo.markTextColor': '#10324a',
|
|
27
|
+
'content.top.headline': 'Your next idea starts here',
|
|
28
|
+
'content.middle.headline': 'Design. Build. Launch.',
|
|
29
|
+
'content.bottom.body': 'Everything you need to move from concept to product.',
|
|
30
|
+
'content.back.text': 'Northstar',
|
|
31
|
+
'content.back.panel': 'top',
|
|
32
|
+
'content.cta.text': 'Get Started',
|
|
33
|
+
'typography.topHeadline.color': '#10324a',
|
|
34
|
+
'typography.topHeadline.fontStyle': 'normal',
|
|
35
|
+
'typography.topHeadline.fontWeight': 800,
|
|
36
|
+
'typography.topHeadline.skew': 0,
|
|
37
|
+
'typography.topHeadline.fontFamily': 'Space Grotesk',
|
|
38
|
+
'typography.topHeadline.fontSize': 96,
|
|
39
|
+
'typography.middleHeadline.color': '#10324a',
|
|
40
|
+
'typography.middleHeadline.fontFamily': 'Space Grotesk',
|
|
41
|
+
'typography.middleHeadline.fontWeight': 700,
|
|
42
|
+
'typography.middleHeadline.fontSize': 92,
|
|
43
|
+
'typography.middleHeadline.maxWidth': 0.62,
|
|
44
|
+
'typography.bottomBody.color': '#2b4a60',
|
|
45
|
+
'typography.bottomBody.fontStyle': 'normal',
|
|
46
|
+
'typography.back.color': '#10324a',
|
|
47
|
+
'typography.back.fontFamily': 'Space Grotesk',
|
|
48
|
+
'typography.logo.fontFamily': 'Space Grotesk',
|
|
49
|
+
'typography.logo.fontWeight': 700,
|
|
50
|
+
'typography.cta.color': '#10324a',
|
|
51
|
+
'typography.cta.fontWeight': 700,
|
|
52
|
+
'foldLighting.ambient': 0.62,
|
|
53
|
+
'foldLighting.diffuse': 0.46,
|
|
54
|
+
'paperMaterial.baseColor': '#f3ede2',
|
|
55
|
+
'paperMaterial.backColor': '#e4d8c4',
|
|
56
|
+
'paperMaterial.secondaryColor': '#ece3d3',
|
|
57
|
+
'paperMaterial.textureOpacity': 0.12,
|
|
58
|
+
'paperMaterial.edgeShadow': 0.12,
|
|
59
|
+
'creases.0.color': '#9c8d74',
|
|
60
|
+
'creases.1.color': '#9c8d74',
|
|
61
|
+
'creases.0.highlightColor': '#ffffff',
|
|
62
|
+
'creases.1.highlightColor': '#ffffff',
|
|
63
|
+
'paper.shadow.color': '#04121c',
|
|
64
|
+
'paper.shadow.opacity': 0.45,
|
|
65
|
+
'background.baseColor': '#10324a',
|
|
66
|
+
'background.gradient.stops': [{ offset: 0, color: '#123a55' }, { offset: 1, color: '#0a2233' }],
|
|
67
|
+
'background.backgroundTypography.text': 'CREATE',
|
|
68
|
+
'background.backgroundTypography.color': '#174765',
|
|
69
|
+
'background.backgroundTypography.weight': 800,
|
|
70
|
+
'background.backgroundTypography.fontFamily': 'Space Grotesk',
|
|
71
|
+
'background.backgroundTypography.drift': 24,
|
|
72
|
+
'background.backgroundTypography.repeat': 2,
|
|
73
|
+
'background.glow.color': '#3fb6c9',
|
|
74
|
+
'background.glow.opacity': 0.22,
|
|
75
|
+
'hands.style.baseColor': '#d9976f',
|
|
76
|
+
'hands.style.midtoneColor': '#b9744c',
|
|
77
|
+
'hands.style.shadowColor': '#8a4f31',
|
|
78
|
+
'hands.style.highlightColor': '#eab08a',
|
|
79
|
+
'hands.style.nailColor': '#f5cdb7',
|
|
80
|
+
'hands.style.sleeve.enabled': true,
|
|
81
|
+
'hands.style.sleeve.color': '#2f6f8f',
|
|
82
|
+
'hands.top.x': 0.62,
|
|
83
|
+
'hands.bottom.x': 0.34,
|
|
84
|
+
'folds.0.peakAngle': 170,
|
|
85
|
+
'folds.0.durationFrames': 40,
|
|
86
|
+
'folds.0.unfoldDurationFrames': 36,
|
|
87
|
+
'folds.0.easing': 'easeInOutQuart',
|
|
88
|
+
'folds.1.peakAngle': 164,
|
|
89
|
+
'folds.1.durationFrames': 38,
|
|
90
|
+
'folds.1.unfoldDurationFrames': 34,
|
|
91
|
+
'folds.1.easing': 'easeInOutQuart',
|
|
92
|
+
'timeline.foldedHold.durationFrames': 48,
|
|
93
|
+
'cta.backgroundColor': '#ffcc4d',
|
|
94
|
+
'cta.borderColor': '#ffcc4d',
|
|
95
|
+
'cta.rotation': 3,
|
|
96
|
+
'cta.radius': 40,
|
|
97
|
+
'cta.shadowColor': '#04121c',
|
|
98
|
+
'cta.shadowOpacity': 0.35,
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
export const PRESET_PATCHES: Record<string, { description: string; patch: Record<string, unknown> }> = {
|
|
102
|
+
reference: { description: 'The reference: a purple tixdoor launch sheet, Z-folded by two brown hands in front of a LAUNCH wall, 9:16 at 2160 × 3840, 60 fps.', patch: REFERENCE },
|
|
103
|
+
portrait: { description: '9:16, 2160 × 3840 (layout.portrait) — the reference shape.', patch: { ...REFERENCE, ...canvas('9:16', 2160, 3840) } },
|
|
104
|
+
landscape: { description: '16:9, 3840 × 2160 (layout.landscape): the sheet on the left, the logo and CTA on the right.', patch: { ...REFERENCE, ...canvas('16:9', 3840, 2160) } },
|
|
105
|
+
square: { description: '1:1, 2160 × 2160 (layout.square).', patch: { ...REFERENCE, ...canvas('1:1', 2160, 2160) } },
|
|
106
|
+
demo: { description: 'Northstar: a cream sheet on deep teal, CREATE drifting behind, lighter hands in sleeves, deeper and quicker folds, a yellow Get Started button.', patch: DEMO },
|
|
107
|
+
};
|
|
108
|
+
export type PresetName = keyof typeof PRESET_PATCHES;
|
|
109
|
+
|
|
110
|
+
/** A preset as a complete, valid config. */
|
|
111
|
+
export function presetConfig(name: string): PaperFoldConfig {
|
|
112
|
+
const p = PRESET_PATCHES[name];
|
|
113
|
+
if (!p) throw new Error(`Unknown paper-fold-promo preset "${name}". Available: ${Object.keys(PRESET_PATCHES).join(', ')}.`);
|
|
114
|
+
const r = applyPatch(defaultConfig(), { patch: p.patch });
|
|
115
|
+
if (!r.valid) throw new Error(`Preset "${name}" is invalid: ${r.errors.map((e) => e.message).join(' ')}`);
|
|
116
|
+
return r.config;
|
|
117
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { ConfigurableMotionTemplate } from '../types';
|
|
2
|
+
import { configJsonSchema } from './config';
|
|
3
|
+
import { allControls, GROUPS } from './controls';
|
|
4
|
+
import { outputDuration } from './engine';
|
|
5
|
+
import { PRESET_PATCHES, presetConfig } from './presets';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* **paper-fold-promo in the motion registry.** A configurable-motion template (DECISIONS §25–§27) drawn
|
|
9
|
+
* procedurally by React/DOM — three perspective panels hinged at real creases, vector hands, live
|
|
10
|
+
* text — and rendered to video by Remotion. People and agents edit the same canonical config. Plain
|
|
11
|
+
* data — safe to JSON-serialise.
|
|
12
|
+
*/
|
|
13
|
+
const reference = presetConfig('reference');
|
|
14
|
+
export const paperFoldPromo: ConfigurableMotionTemplate = {
|
|
15
|
+
id: 'paper-fold-promo',
|
|
16
|
+
version: '1.0.0',
|
|
17
|
+
kind: 'configurableMotion',
|
|
18
|
+
renderer: 'remotion',
|
|
19
|
+
title: 'Paper fold promo — a printed sheet folded and opened by two hands',
|
|
20
|
+
description: 'A vertical promotional sheet in three panels, held by two illustrated hands in front of a wall of large type. The top panel folds over along its crease in true perspective, then the bottom one; the paper holds folded, then unfolds back to the open sheet. Every word, colour, crease, fold angle, timing, easing, hand pose and light is configurable; 9:16, 16:9 and 1:1 each have their own layout.',
|
|
21
|
+
fps: 60,
|
|
22
|
+
formats: [
|
|
23
|
+
{ id: 'portrait', aspectRatio: '9:16', width: 2160, height: 3840 },
|
|
24
|
+
{ id: 'landscape', aspectRatio: '16:9', width: 3840, height: 2160 },
|
|
25
|
+
{ id: 'square', aspectRatio: '1:1', width: 2160, height: 2160 },
|
|
26
|
+
],
|
|
27
|
+
durationInFrames: outputDuration(reference),
|
|
28
|
+
groups: [...GROUPS],
|
|
29
|
+
controls: allControls(),
|
|
30
|
+
schema: configJsonSchema(),
|
|
31
|
+
presets: PRESET_PATCHES,
|
|
32
|
+
remotion: {
|
|
33
|
+
project: 'remotion-prototype',
|
|
34
|
+
compositions: ['PaperFoldPromoPortrait', 'PaperFoldPromoLandscape', 'PaperFoldPromoSquare'],
|
|
35
|
+
reference: 'remotion-prototype/content/paper-fold-promo/reference.json',
|
|
36
|
+
},
|
|
37
|
+
exampleContent: reference,
|
|
38
|
+
};
|
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* **The HTML runtime** — plays a motion template in any web page.
|
|
3
|
+
*
|
|
4
|
+
* content JSON → validate against the template's schema → template markup → bind [data-content]
|
|
5
|
+
* → apply theme → fit text → animate [data-target] from the motion contract
|
|
6
|
+
*
|
|
7
|
+
* It knows nothing about any particular template. Content is written with `textContent` only, so text
|
|
8
|
+
* from an agent can never become markup; theme values are checked hex colours.
|
|
9
|
+
*/
|
|
10
|
+
import { fitScale } from './fit';
|
|
11
|
+
import { createSampler, durationFor, formatFor, itemScene, sceneAt, themeVariables } from './sample';
|
|
12
|
+
import type { MotionTemplate } from './types';
|
|
13
|
+
import { validateMotionContent, type MotionContentError } from './validate';
|
|
14
|
+
|
|
15
|
+
export class MotionContentValidationError extends Error {
|
|
16
|
+
constructor(readonly errors: MotionContentError[]) {
|
|
17
|
+
super(`Invalid content:\n${errors.map((e) => ` - ${e.message}`).join('\n')}`);
|
|
18
|
+
this.name = 'MotionContentValidationError';
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export type MotionController = {
|
|
23
|
+
seek(frame: number): void;
|
|
24
|
+
play(): void;
|
|
25
|
+
pause(): void;
|
|
26
|
+
readonly frame: number;
|
|
27
|
+
readonly playing: boolean;
|
|
28
|
+
readonly fps: number;
|
|
29
|
+
readonly durationInFrames: number;
|
|
30
|
+
/** The canvas this content plays on (its format's size). */
|
|
31
|
+
readonly width: number;
|
|
32
|
+
readonly height: number;
|
|
33
|
+
/** Resolves once fonts are loaded and text has been fitted. Seek/play are safe before it. */
|
|
34
|
+
readonly ready: Promise<void>;
|
|
35
|
+
destroy(): void;
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
const read = (content: unknown, path: string) =>
|
|
39
|
+
path.split('.').reduce<unknown>((v, k) => (v && typeof v === 'object' ? (v as Record<string, unknown>)[k] : undefined), content);
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Add the template's font and style sheets to the document once. Resolves when the font faces are
|
|
43
|
+
* usable: text is measured for auto-fit, and a measurement taken in a fallback font would be wrong.
|
|
44
|
+
*/
|
|
45
|
+
export function installMotionStyles(template: MotionTemplate, doc: Document = document): Promise<void> {
|
|
46
|
+
const loads: Promise<unknown>[] = [];
|
|
47
|
+
for (const f of template.fonts) {
|
|
48
|
+
const key = `font:${f.family}`;
|
|
49
|
+
let link = doc.head.querySelector<HTMLLinkElement>(`[data-motion-styles="${key}"]`);
|
|
50
|
+
if (!link) {
|
|
51
|
+
link = Object.assign(doc.createElement('link'), { rel: 'stylesheet', href: f.css });
|
|
52
|
+
link.dataset.motionStyles = key;
|
|
53
|
+
link.dataset.loaded = 'false';
|
|
54
|
+
link.addEventListener('load', () => (link!.dataset.loaded = 'true'), { once: true });
|
|
55
|
+
doc.head.append(link);
|
|
56
|
+
}
|
|
57
|
+
if (link.dataset.loaded === 'false') {
|
|
58
|
+
const l = link;
|
|
59
|
+
loads.push(new Promise((r) => { l.addEventListener('load', r, { once: true }); l.addEventListener('error', r, { once: true }); }));
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
const key = `${template.id}@${template.version}`;
|
|
63
|
+
if (!doc.head.querySelector(`[data-motion-styles="${key}"]`)) {
|
|
64
|
+
const style = Object.assign(doc.createElement('style'), { textContent: template.styles });
|
|
65
|
+
style.dataset.motionStyles = key;
|
|
66
|
+
doc.head.append(style);
|
|
67
|
+
}
|
|
68
|
+
if (!doc.fonts) return Promise.resolve();
|
|
69
|
+
return Promise.all(loads)
|
|
70
|
+
.then(() => Promise.all(template.fonts.flatMap((f) => f.weights.map((w) => doc.fonts.load(`${w} ${f.stretch ? `${f.stretch} ` : ''}16px "${f.family}"`)))))
|
|
71
|
+
.then(() => doc.fonts.ready)
|
|
72
|
+
.then(() => undefined, () => undefined);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export type MountOptions = { loop?: boolean; autoPlay?: boolean; onFrame?: (frame: number) => void; onEnd?: () => void };
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* A sequence template's markup holds ONE item scene, `[data-scene="<list>.$"]`. It is cloned once per
|
|
79
|
+
* item, in order: `$` in `data-scene` and `data-content` becomes the index, and each item choice is
|
|
80
|
+
* written as `data-<field>` (a validated enum value; unset choices get the schema default). Parts
|
|
81
|
+
* marked `data-when="<field>=<value>"` stay only in items with that choice.
|
|
82
|
+
*/
|
|
83
|
+
function expandSequence(canvas: HTMLElement, template: MotionTemplate, content: unknown) {
|
|
84
|
+
const seq = template.motion.sequence!;
|
|
85
|
+
const proto = canvas.querySelector<HTMLElement>(`[data-scene="${seq.path}.$"]`);
|
|
86
|
+
if (!proto) return;
|
|
87
|
+
const items = (read(content, seq.path) as Record<string, unknown>[] | undefined) ?? [];
|
|
88
|
+
const defaults = Object.fromEntries((template.choices ?? []).map((c) => [c.field, c.default]));
|
|
89
|
+
const clones = items.map((item, i) => {
|
|
90
|
+
const el = proto.cloneNode(true) as HTMLElement;
|
|
91
|
+
el.dataset.scene = `${seq.path}.${i}`;
|
|
92
|
+
for (const field of Object.keys(seq.options)) {
|
|
93
|
+
const v = field === seq.motionField ? itemScene(template.motion, item) : item[field] ?? defaults[field];
|
|
94
|
+
if (v !== undefined) el.setAttribute(`data-${field}`, String(v));
|
|
95
|
+
}
|
|
96
|
+
/* `data-when="field=value"` keeps a part only for items that chose that value (e.g. a layout). */
|
|
97
|
+
for (const part of Array.from(el.querySelectorAll<HTMLElement>('[data-when]'))) {
|
|
98
|
+
const [field, value] = part.dataset.when!.split('=') as [string, string];
|
|
99
|
+
if (el.getAttribute(`data-${field}`) !== value) part.remove();
|
|
100
|
+
}
|
|
101
|
+
for (const node of [el, ...Array.from(el.querySelectorAll<HTMLElement>('[data-content],[data-if]'))]) {
|
|
102
|
+
if (node.dataset.content) node.dataset.content = node.dataset.content.replace(`${seq.path}.$.`, `${seq.path}.${i}.`);
|
|
103
|
+
if (node.dataset.if) node.dataset.if = node.dataset.if.replace(`${seq.path}.$.`, `${seq.path}.${i}.`);
|
|
104
|
+
}
|
|
105
|
+
return el;
|
|
106
|
+
});
|
|
107
|
+
proto.replaceWith(...clones);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
/** Mount a template into `root` with validated content. Throws `MotionContentValidationError`. */
|
|
111
|
+
export function mountMotion(root: HTMLElement, template: MotionTemplate, content: unknown, options: MountOptions = {}): MotionController {
|
|
112
|
+
const result = validateMotionContent(template.schema, content);
|
|
113
|
+
if (!result.valid) throw new MotionContentValidationError(result.errors);
|
|
114
|
+
const stylesReady = installMotionStyles(template, root.ownerDocument);
|
|
115
|
+
|
|
116
|
+
root.innerHTML = template.template;
|
|
117
|
+
const canvas = root.firstElementChild as HTMLElement;
|
|
118
|
+
const { motion } = template;
|
|
119
|
+
const format = formatFor(motion, content);
|
|
120
|
+
if (motion.formats) canvas.dataset.format = format.id;
|
|
121
|
+
for (const [k, v] of Object.entries(themeVariables((content as { theme?: Record<string, string> }).theme))) canvas.style.setProperty(k, v);
|
|
122
|
+
if (motion.sequence) expandSequence(canvas, template, content);
|
|
123
|
+
/* An optional part whose content is absent is removed (`data-if` names the content path). */
|
|
124
|
+
for (const el of Array.from(root.querySelectorAll<HTMLElement>('[data-if]'))) {
|
|
125
|
+
const v = read(content, el.dataset.if!);
|
|
126
|
+
if (v === undefined || v === null || v === '' || v === false) el.remove();
|
|
127
|
+
}
|
|
128
|
+
for (const el of Array.from(root.querySelectorAll<HTMLElement>('[data-content]'))) el.textContent = String(read(content, el.dataset.content!) ?? '');
|
|
129
|
+
|
|
130
|
+
const sample = createSampler(motion);
|
|
131
|
+
const durationInFrames = durationFor(motion, content);
|
|
132
|
+
const scenes = Array.from(root.querySelectorAll<HTMLElement>('[data-scene]'));
|
|
133
|
+
const targets = new Map(scenes.map((s) => [s.dataset.scene!, Array.from(s.querySelectorAll<HTMLElement>('[data-target]'))]));
|
|
134
|
+
/* Fit widths may differ per format: `data-fit-<format id>` overrides `data-fit`. */
|
|
135
|
+
const fitKey = `fit${format.id.charAt(0).toUpperCase()}${format.id.slice(1)}`;
|
|
136
|
+
|
|
137
|
+
let current = 0;
|
|
138
|
+
let destroyed = false;
|
|
139
|
+
const seek = (frame: number) => {
|
|
140
|
+
const f = Math.max(0, Math.min(durationInFrames - 1, Math.floor(frame)));
|
|
141
|
+
current = f;
|
|
142
|
+
const at = sceneAt(motion, f, content);
|
|
143
|
+
for (const s of scenes) s.style.display = s.dataset.scene === at?.id ? '' : 'none';
|
|
144
|
+
for (const el of (at && targets.get(at.id)) ?? []) {
|
|
145
|
+
el.removeAttribute('style');
|
|
146
|
+
Object.assign(el.style, sample(el.dataset.target!, at!.frame, at!.scene));
|
|
147
|
+
}
|
|
148
|
+
options.onFrame?.(f);
|
|
149
|
+
};
|
|
150
|
+
|
|
151
|
+
/* Fit needs real layout: show every scene for the measurement, then put the frame back. */
|
|
152
|
+
const fit = () => {
|
|
153
|
+
if (destroyed) return;
|
|
154
|
+
for (const s of scenes) s.style.display = '';
|
|
155
|
+
const spans = Array.from(root.querySelectorAll<HTMLElement>('[data-fit]'));
|
|
156
|
+
for (const el of spans) el.style.removeProperty('--fit');
|
|
157
|
+
const scales = spans.map((el) => fitScale(el.offsetWidth, Number(el.dataset[fitKey] ?? el.dataset.fit)));
|
|
158
|
+
spans.forEach((el, i) => scales[i]! < 1 && el.style.setProperty('--fit', String(scales[i])));
|
|
159
|
+
seek(current);
|
|
160
|
+
};
|
|
161
|
+
|
|
162
|
+
let raf = 0;
|
|
163
|
+
let startedAt = 0;
|
|
164
|
+
const tick = (now: number) => {
|
|
165
|
+
const frame = Math.floor(((now - startedAt) / 1000) * motion.fps);
|
|
166
|
+
if (frame >= durationInFrames && !options.loop) {
|
|
167
|
+
seek(durationInFrames - 1);
|
|
168
|
+
raf = 0;
|
|
169
|
+
options.onEnd?.();
|
|
170
|
+
return;
|
|
171
|
+
}
|
|
172
|
+
seek(frame % durationInFrames);
|
|
173
|
+
raf = requestAnimationFrame(tick);
|
|
174
|
+
};
|
|
175
|
+
const play = () => {
|
|
176
|
+
if (raf || destroyed) return;
|
|
177
|
+
if (current >= durationInFrames - 1) current = 0;
|
|
178
|
+
startedAt = performance.now() - (current / motion.fps) * 1000;
|
|
179
|
+
raf = requestAnimationFrame(tick);
|
|
180
|
+
};
|
|
181
|
+
const pause = () => {
|
|
182
|
+
cancelAnimationFrame(raf);
|
|
183
|
+
raf = 0;
|
|
184
|
+
};
|
|
185
|
+
|
|
186
|
+
seek(0);
|
|
187
|
+
const ready = stylesReady.then(() => fit());
|
|
188
|
+
if (options.autoPlay) void ready.then(play);
|
|
189
|
+
|
|
190
|
+
return {
|
|
191
|
+
seek,
|
|
192
|
+
play,
|
|
193
|
+
pause,
|
|
194
|
+
get frame() { return current; },
|
|
195
|
+
get playing() { return raf !== 0; },
|
|
196
|
+
fps: motion.fps,
|
|
197
|
+
durationInFrames,
|
|
198
|
+
width: format.width,
|
|
199
|
+
height: format.height,
|
|
200
|
+
ready,
|
|
201
|
+
destroy() {
|
|
202
|
+
destroyed = true;
|
|
203
|
+
pause();
|
|
204
|
+
root.innerHTML = '';
|
|
205
|
+
},
|
|
206
|
+
};
|
|
207
|
+
}
|