@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.
Files changed (988) hide show
  1. package/dist/cjs/agent/AgentComponent.js +1 -1
  2. package/dist/cjs/agent/AgentComponent.js.map +1 -1
  3. package/dist/cjs/agent/base.js +25 -0
  4. package/dist/cjs/agent/base.js.map +1 -0
  5. package/dist/cjs/agent/catalog.js +0 -32
  6. package/dist/cjs/agent/catalog.js.map +1 -1
  7. package/dist/cjs/agent/core.js +22 -20
  8. package/dist/cjs/agent/core.js.map +1 -1
  9. package/dist/cjs/agent/index.js +6 -5
  10. package/dist/cjs/agent/index.js.map +1 -1
  11. package/dist/cjs/agent/manifests.js +81 -1
  12. package/dist/cjs/agent/manifests.js.map +1 -1
  13. package/dist/cjs/agent/result.js +6 -0
  14. package/dist/cjs/agent/result.js.map +1 -1
  15. package/dist/cjs/agent/search/document.js +50 -0
  16. package/dist/cjs/agent/search/document.js.map +1 -0
  17. package/dist/cjs/agent/search/embedding.js +107 -0
  18. package/dist/cjs/agent/search/embedding.js.map +1 -0
  19. package/dist/cjs/agent/search/index.js +25 -0
  20. package/dist/cjs/agent/search/index.js.map +1 -0
  21. package/dist/cjs/agent/search/lexical.js +28 -0
  22. package/dist/cjs/agent/search/lexical.js.map +1 -0
  23. package/dist/cjs/agent/search/normalize.js +15 -0
  24. package/dist/cjs/agent/search/normalize.js.map +1 -0
  25. package/dist/cjs/agent/search/search.js +123 -0
  26. package/dist/cjs/agent/search/search.js.map +1 -0
  27. package/dist/cjs/agent/search/searchIndex.js +120 -0
  28. package/dist/cjs/agent/search/searchIndex.js.map +1 -0
  29. package/dist/cjs/agent/search/types.js +8 -0
  30. package/dist/cjs/agent/search/types.js.map +1 -0
  31. package/dist/cjs/agent/search/weights.js +34 -0
  32. package/dist/cjs/agent/search/weights.js.map +1 -0
  33. package/dist/cjs/agent/search/wordvectors.json +1 -0
  34. package/dist/cjs/components/catalog.js +18 -0
  35. package/dist/cjs/components/catalog.js.map +1 -1
  36. package/dist/cjs/components/onboarding/animated-status/AnimatedStage.js +21 -0
  37. package/dist/cjs/components/onboarding/animated-status/AnimatedStage.js.map +1 -0
  38. package/dist/cjs/components/onboarding/animated-status/AnimatedStage.types.js +6 -0
  39. package/dist/cjs/components/onboarding/animated-status/AnimatedStage.types.js.map +1 -0
  40. package/dist/cjs/components/onboarding/animated-status/AnimatedStage.web.js +89 -0
  41. package/dist/cjs/components/onboarding/animated-status/AnimatedStage.web.js.map +1 -0
  42. package/dist/cjs/components/onboarding/animated-status/AnimatedStatusView.js +62 -0
  43. package/dist/cjs/components/onboarding/animated-status/AnimatedStatusView.js.map +1 -0
  44. package/dist/cjs/components/onboarding/animated-status/AnimatedStill.js +20 -0
  45. package/dist/cjs/components/onboarding/animated-status/AnimatedStill.js.map +1 -0
  46. package/dist/cjs/components/onboarding/animated-status/contract.js +87 -0
  47. package/dist/cjs/components/onboarding/animated-status/contract.js.map +1 -0
  48. package/dist/cjs/components/onboarding/animated-status/engine.js +40 -0
  49. package/dist/cjs/components/onboarding/animated-status/engine.js.map +1 -0
  50. package/dist/cjs/components/onboarding/animated-status/index.js +20 -0
  51. package/dist/cjs/components/onboarding/animated-status/index.js.map +1 -0
  52. package/dist/cjs/components/onboarding/animated-status/presets.json +126 -0
  53. package/dist/cjs/components/onboarding/animated-status/riv.js +7 -0
  54. package/dist/cjs/components/onboarding/animated-status/riv.js.map +1 -0
  55. package/dist/cjs/components/onboarding/index.js +4 -0
  56. package/dist/cjs/components/onboarding/index.js.map +1 -1
  57. package/dist/cjs/components/onboarding/presets.js +90 -84
  58. package/dist/cjs/components/onboarding/presets.js.map +1 -1
  59. package/dist/cjs/components/onboarding/receipt-printer/ReceiptStage.js +43 -6
  60. package/dist/cjs/components/onboarding/receipt-printer/ReceiptStage.js.map +1 -1
  61. package/dist/cjs/components/onboarding/send-completion/SendCompletionView.js +111 -0
  62. package/dist/cjs/components/onboarding/send-completion/SendCompletionView.js.map +1 -0
  63. package/dist/cjs/components/onboarding/send-completion/SendStage.js +37 -0
  64. package/dist/cjs/components/onboarding/send-completion/SendStage.js.map +1 -0
  65. package/dist/cjs/components/onboarding/send-completion/SendStage.types.js +6 -0
  66. package/dist/cjs/components/onboarding/send-completion/SendStage.types.js.map +1 -0
  67. package/dist/cjs/components/onboarding/send-completion/SendStage.web.js +107 -0
  68. package/dist/cjs/components/onboarding/send-completion/SendStage.web.js.map +1 -0
  69. package/dist/cjs/components/onboarding/send-completion/SendStill.js +17 -0
  70. package/dist/cjs/components/onboarding/send-completion/SendStill.js.map +1 -0
  71. package/dist/cjs/components/onboarding/send-completion/contract.js +83 -0
  72. package/dist/cjs/components/onboarding/send-completion/contract.js.map +1 -0
  73. package/dist/cjs/components/onboarding/send-completion/engine.js +32 -0
  74. package/dist/cjs/components/onboarding/send-completion/engine.js.map +1 -0
  75. package/dist/cjs/components/onboarding/send-completion/index.js +22 -0
  76. package/dist/cjs/components/onboarding/send-completion/index.js.map +1 -0
  77. package/dist/cjs/components/onboarding/send-completion/presets.json +132 -0
  78. package/dist/cjs/components/onboarding/send-completion/riv.js +7 -0
  79. package/dist/cjs/components/onboarding/send-completion/riv.js.map +1 -0
  80. package/dist/cjs/components/onboarding/shared/actions-data.js +2 -0
  81. package/dist/cjs/components/onboarding/shared/actions-data.js.map +1 -1
  82. package/dist/cjs/components/onboarding/shared/configColor.js +76 -0
  83. package/dist/cjs/components/onboarding/shared/configColor.js.map +1 -0
  84. package/dist/cjs/components/onboarding/shared/contract.js +4 -0
  85. package/dist/cjs/components/onboarding/shared/contract.js.map +1 -1
  86. package/dist/cjs/components/onboarding/shared/describe.js +1 -1
  87. package/dist/cjs/components/onboarding/shared/describe.js.map +1 -1
  88. package/dist/cjs/components/onboarding/shared/mock.js +2 -0
  89. package/dist/cjs/components/onboarding/shared/mock.js.map +1 -1
  90. package/dist/cjs/components/onboarding/views.js +8 -0
  91. package/dist/cjs/components/onboarding/views.js.map +1 -1
  92. package/dist/cjs/index.js +1 -1
  93. package/dist/cjs/index.js.map +1 -1
  94. package/dist/cjs/motion/MotionPlayer.js +42 -0
  95. package/dist/cjs/motion/MotionPlayer.js.map +1 -0
  96. package/dist/cjs/motion/agent.js +323 -0
  97. package/dist/cjs/motion/agent.js.map +1 -0
  98. package/dist/cjs/motion/cat/Cat.js +79 -0
  99. package/dist/cjs/motion/cat/Cat.js.map +1 -0
  100. package/dist/cjs/motion/cat/animation.js +204 -0
  101. package/dist/cjs/motion/cat/animation.js.map +1 -0
  102. package/dist/cjs/motion/cat/art.generated.js +37 -0
  103. package/dist/cjs/motion/cat/art.generated.js.map +1 -0
  104. package/dist/cjs/motion/cat/config.js +136 -0
  105. package/dist/cjs/motion/cat/config.js.map +1 -0
  106. package/dist/cjs/motion/cat/index.js +75 -0
  107. package/dist/cjs/motion/cat/index.js.map +1 -0
  108. package/dist/cjs/motion/cat/rig.js +99 -0
  109. package/dist/cjs/motion/cat/rig.js.map +1 -0
  110. package/dist/cjs/motion/cat/scene.js +148 -0
  111. package/dist/cjs/motion/cat/scene.js.map +1 -0
  112. package/dist/cjs/motion/configurable/config.js +477 -0
  113. package/dist/cjs/motion/configurable/config.js.map +1 -0
  114. package/dist/cjs/motion/configurable/controls.js +44 -0
  115. package/dist/cjs/motion/configurable/controls.js.map +1 -0
  116. package/dist/cjs/motion/easing.js +62 -0
  117. package/dist/cjs/motion/easing.js.map +1 -0
  118. package/dist/cjs/motion/fit.js +12 -0
  119. package/dist/cjs/motion/fit.js.map +1 -0
  120. package/dist/cjs/motion/index.js +101 -0
  121. package/dist/cjs/motion/index.js.map +1 -0
  122. package/dist/cjs/motion/neon/GlowRenderer.js +18 -0
  123. package/dist/cjs/motion/neon/GlowRenderer.js.map +1 -0
  124. package/dist/cjs/motion/neon/NeonCanvas.js +97 -0
  125. package/dist/cjs/motion/neon/NeonCanvas.js.map +1 -0
  126. package/dist/cjs/motion/neon/NeonText.js +108 -0
  127. package/dist/cjs/motion/neon/NeonText.js.map +1 -0
  128. package/dist/cjs/motion/neon/NeonTextFrame.js +36 -0
  129. package/dist/cjs/motion/neon/NeonTextFrame.js.map +1 -0
  130. package/dist/cjs/motion/neon/artwork.js +102 -0
  131. package/dist/cjs/motion/neon/artwork.js.map +1 -0
  132. package/dist/cjs/motion/neon/audio.js +165 -0
  133. package/dist/cjs/motion/neon/audio.js.map +1 -0
  134. package/dist/cjs/motion/neon/config.js +334 -0
  135. package/dist/cjs/motion/neon/config.js.map +1 -0
  136. package/dist/cjs/motion/neon/flicker.js +196 -0
  137. package/dist/cjs/motion/neon/flicker.js.map +1 -0
  138. package/dist/cjs/motion/neon/fonts.js +52 -0
  139. package/dist/cjs/motion/neon/fonts.js.map +1 -0
  140. package/dist/cjs/motion/neon/frame.js +24 -0
  141. package/dist/cjs/motion/neon/frame.js.map +1 -0
  142. package/dist/cjs/motion/neon/glitch.js +114 -0
  143. package/dist/cjs/motion/neon/glitch.js.map +1 -0
  144. package/dist/cjs/motion/neon/index.js +119 -0
  145. package/dist/cjs/motion/neon/index.js.map +1 -0
  146. package/dist/cjs/motion/neon/layers.js +68 -0
  147. package/dist/cjs/motion/neon/layers.js.map +1 -0
  148. package/dist/cjs/motion/neon/material.js +56 -0
  149. package/dist/cjs/motion/neon/material.js.map +1 -0
  150. package/dist/cjs/motion/neon/random.js +43 -0
  151. package/dist/cjs/motion/neon/random.js.map +1 -0
  152. package/dist/cjs/motion/neon/scene.js +549 -0
  153. package/dist/cjs/motion/neon/scene.js.map +1 -0
  154. package/dist/cjs/motion/neon/synth.js +213 -0
  155. package/dist/cjs/motion/neon/synth.js.map +1 -0
  156. package/dist/cjs/motion/neon/typography.js +81 -0
  157. package/dist/cjs/motion/neon/typography.js.map +1 -0
  158. package/dist/cjs/motion/neon/wall.js +113 -0
  159. package/dist/cjs/motion/neon/wall.js.map +1 -0
  160. package/dist/cjs/motion/paperfold/PaperFold.js +40 -0
  161. package/dist/cjs/motion/paperfold/PaperFold.js.map +1 -0
  162. package/dist/cjs/motion/paperfold/PaperFoldFrame.js +290 -0
  163. package/dist/cjs/motion/paperfold/PaperFoldFrame.js.map +1 -0
  164. package/dist/cjs/motion/paperfold/PaperFoldPlayer.js +59 -0
  165. package/dist/cjs/motion/paperfold/PaperFoldPlayer.js.map +1 -0
  166. package/dist/cjs/motion/paperfold/art.js +388 -0
  167. package/dist/cjs/motion/paperfold/art.js.map +1 -0
  168. package/dist/cjs/motion/paperfold/config.js +103 -0
  169. package/dist/cjs/motion/paperfold/config.js.map +1 -0
  170. package/dist/cjs/motion/paperfold/controls.js +493 -0
  171. package/dist/cjs/motion/paperfold/controls.js.map +1 -0
  172. package/dist/cjs/motion/paperfold/engine.js +722 -0
  173. package/dist/cjs/motion/paperfold/engine.js.map +1 -0
  174. package/dist/cjs/motion/paperfold/fonts.js +25 -0
  175. package/dist/cjs/motion/paperfold/fonts.js.map +1 -0
  176. package/dist/cjs/motion/paperfold/index.js +113 -0
  177. package/dist/cjs/motion/paperfold/index.js.map +1 -0
  178. package/dist/cjs/motion/paperfold/manipulate.js +170 -0
  179. package/dist/cjs/motion/paperfold/manipulate.js.map +1 -0
  180. package/dist/cjs/motion/paperfold/presets.js +119 -0
  181. package/dist/cjs/motion/paperfold/presets.js.map +1 -0
  182. package/dist/cjs/motion/paperfold/template.js +40 -0
  183. package/dist/cjs/motion/paperfold/template.js.map +1 -0
  184. package/dist/cjs/motion/player.js +203 -0
  185. package/dist/cjs/motion/player.js.map +1 -0
  186. package/dist/cjs/motion/promo/PromoFrame.js +293 -0
  187. package/dist/cjs/motion/promo/PromoFrame.js.map +1 -0
  188. package/dist/cjs/motion/promo/PromoShowcasePlayer.js +59 -0
  189. package/dist/cjs/motion/promo/PromoShowcasePlayer.js.map +1 -0
  190. package/dist/cjs/motion/promo/config.js +565 -0
  191. package/dist/cjs/motion/promo/config.js.map +1 -0
  192. package/dist/cjs/motion/promo/controls.js +571 -0
  193. package/dist/cjs/motion/promo/controls.js.map +1 -0
  194. package/dist/cjs/motion/promo/easing.js +35 -0
  195. package/dist/cjs/motion/promo/easing.js.map +1 -0
  196. package/dist/cjs/motion/promo/engine.js +567 -0
  197. package/dist/cjs/motion/promo/engine.js.map +1 -0
  198. package/dist/cjs/motion/promo/fonts.js +20 -0
  199. package/dist/cjs/motion/promo/fonts.js.map +1 -0
  200. package/dist/cjs/motion/promo/icons.js +29 -0
  201. package/dist/cjs/motion/promo/icons.js.map +1 -0
  202. package/dist/cjs/motion/promo/index.js +73 -0
  203. package/dist/cjs/motion/promo/index.js.map +1 -0
  204. package/dist/cjs/motion/promo/presets.js +44 -0
  205. package/dist/cjs/motion/promo/presets.js.map +1 -0
  206. package/dist/cjs/motion/promo/template.js +38 -0
  207. package/dist/cjs/motion/promo/template.js.map +1 -0
  208. package/dist/cjs/motion/replication2/Replication2Player.js +93 -0
  209. package/dist/cjs/motion/replication2/Replication2Player.js.map +1 -0
  210. package/dist/cjs/motion/replication2/config.js +352 -0
  211. package/dist/cjs/motion/replication2/config.js.map +1 -0
  212. package/dist/cjs/motion/replication2/controls.js +286 -0
  213. package/dist/cjs/motion/replication2/controls.js.map +1 -0
  214. package/dist/cjs/motion/replication2/driver.js +68 -0
  215. package/dist/cjs/motion/replication2/driver.js.map +1 -0
  216. package/dist/cjs/motion/replication2/easing.js +97 -0
  217. package/dist/cjs/motion/replication2/easing.js.map +1 -0
  218. package/dist/cjs/motion/replication2/engine.js +481 -0
  219. package/dist/cjs/motion/replication2/engine.js.map +1 -0
  220. package/dist/cjs/motion/replication2/html.js +88 -0
  221. package/dist/cjs/motion/replication2/html.js.map +1 -0
  222. package/dist/cjs/motion/replication2/index.js +61 -0
  223. package/dist/cjs/motion/replication2/index.js.map +1 -0
  224. package/dist/cjs/motion/replication2/measure.js +30 -0
  225. package/dist/cjs/motion/replication2/measure.js.map +1 -0
  226. package/dist/cjs/motion/replication2/metrics.js +10 -0
  227. package/dist/cjs/motion/replication2/metrics.js.map +1 -0
  228. package/dist/cjs/motion/replication2/presets.js +67 -0
  229. package/dist/cjs/motion/replication2/presets.js.map +1 -0
  230. package/dist/cjs/motion/replication2/riv.js +7 -0
  231. package/dist/cjs/motion/replication2/riv.js.map +1 -0
  232. package/dist/cjs/motion/replication2/rive-contract.js +158 -0
  233. package/dist/cjs/motion/replication2/rive-contract.js.map +1 -0
  234. package/dist/cjs/motion/replication2/template.js +35 -0
  235. package/dist/cjs/motion/replication2/template.js.map +1 -0
  236. package/dist/cjs/motion/sample.js +149 -0
  237. package/dist/cjs/motion/sample.js.map +1 -0
  238. package/dist/cjs/motion/templates/hey-template.js +1552 -0
  239. package/dist/cjs/motion/templates/hey-template.js.map +1 -0
  240. package/dist/cjs/motion/templates/index.js +22 -0
  241. package/dist/cjs/motion/templates/index.js.map +1 -0
  242. package/dist/cjs/motion/templates/word-motion.js +1165 -0
  243. package/dist/cjs/motion/templates/word-motion.js.map +1 -0
  244. package/dist/cjs/motion/types.js +3 -0
  245. package/dist/cjs/motion/types.js.map +1 -0
  246. package/dist/cjs/motion/typesurface/TypeSurfaceCanvas.js +62 -0
  247. package/dist/cjs/motion/typesurface/TypeSurfaceCanvas.js.map +1 -0
  248. package/dist/cjs/motion/typesurface/art.js +861 -0
  249. package/dist/cjs/motion/typesurface/art.js.map +1 -0
  250. package/dist/cjs/motion/typesurface/config.js +269 -0
  251. package/dist/cjs/motion/typesurface/config.js.map +1 -0
  252. package/dist/cjs/motion/typesurface/engine.js +607 -0
  253. package/dist/cjs/motion/typesurface/engine.js.map +1 -0
  254. package/dist/cjs/motion/typesurface/fonts.js +45 -0
  255. package/dist/cjs/motion/typesurface/fonts.js.map +1 -0
  256. package/dist/cjs/motion/typesurface/index.js +72 -0
  257. package/dist/cjs/motion/typesurface/index.js.map +1 -0
  258. package/dist/cjs/motion/typesurface/layout.js +130 -0
  259. package/dist/cjs/motion/typesurface/layout.js.map +1 -0
  260. package/dist/cjs/motion/typesurface/ops.js +175 -0
  261. package/dist/cjs/motion/typesurface/ops.js.map +1 -0
  262. package/dist/cjs/motion/typesurface/presets.js +192 -0
  263. package/dist/cjs/motion/typesurface/presets.js.map +1 -0
  264. package/dist/cjs/motion/typesurface/renderer.js +672 -0
  265. package/dist/cjs/motion/typesurface/renderer.js.map +1 -0
  266. package/dist/cjs/motion/typesurface/shaders.js +300 -0
  267. package/dist/cjs/motion/typesurface/shaders.js.map +1 -0
  268. package/dist/cjs/motion/typesurface/surfaces.js +156 -0
  269. package/dist/cjs/motion/typesurface/surfaces.js.map +1 -0
  270. package/dist/cjs/motion/typesurface/text.js +34 -0
  271. package/dist/cjs/motion/typesurface/text.js.map +1 -0
  272. package/dist/cjs/motion/typesurface/timeline.js +64 -0
  273. package/dist/cjs/motion/typesurface/timeline.js.map +1 -0
  274. package/dist/cjs/motion/validate.js +89 -0
  275. package/dist/cjs/motion/validate.js.map +1 -0
  276. package/dist/cjs/native/RiveReceiptStage.js +9 -150
  277. package/dist/cjs/native/RiveReceiptStage.js.map +1 -1
  278. package/dist/cjs/native/riveReceiptStageFactory.js +162 -0
  279. package/dist/cjs/native/riveReceiptStageFactory.js.map +1 -0
  280. package/dist/cjs/tokens/stage.js +10 -0
  281. package/dist/cjs/tokens/stage.js.map +1 -0
  282. package/dist/esm/agent/AgentComponent.js +1 -1
  283. package/dist/esm/agent/AgentComponent.js.map +1 -1
  284. package/dist/esm/agent/base.d.ts +11 -0
  285. package/dist/esm/agent/base.d.ts.map +1 -0
  286. package/dist/esm/agent/base.js +11 -0
  287. package/dist/esm/agent/base.js.map +1 -0
  288. package/dist/esm/agent/catalog.d.ts +0 -8
  289. package/dist/esm/agent/catalog.d.ts.map +1 -1
  290. package/dist/esm/agent/catalog.js +0 -31
  291. package/dist/esm/agent/catalog.js.map +1 -1
  292. package/dist/esm/agent/core.d.ts +6 -7
  293. package/dist/esm/agent/core.d.ts.map +1 -1
  294. package/dist/esm/agent/core.js +6 -7
  295. package/dist/esm/agent/core.js.map +1 -1
  296. package/dist/esm/agent/index.d.ts +6 -5
  297. package/dist/esm/agent/index.d.ts.map +1 -1
  298. package/dist/esm/agent/index.js +6 -5
  299. package/dist/esm/agent/index.js.map +1 -1
  300. package/dist/esm/agent/manifests.d.ts.map +1 -1
  301. package/dist/esm/agent/manifests.js +81 -1
  302. package/dist/esm/agent/manifests.js.map +1 -1
  303. package/dist/esm/agent/result.d.ts.map +1 -1
  304. package/dist/esm/agent/result.js +6 -0
  305. package/dist/esm/agent/result.js.map +1 -1
  306. package/dist/esm/agent/search/document.d.ts +6 -0
  307. package/dist/esm/agent/search/document.d.ts.map +1 -0
  308. package/dist/esm/agent/search/document.js +46 -0
  309. package/dist/esm/agent/search/document.js.map +1 -0
  310. package/dist/esm/agent/search/embedding.d.ts +31 -0
  311. package/dist/esm/agent/search/embedding.d.ts.map +1 -0
  312. package/dist/esm/agent/search/embedding.js +103 -0
  313. package/dist/esm/agent/search/embedding.js.map +1 -0
  314. package/dist/esm/agent/search/index.d.ts +10 -0
  315. package/dist/esm/agent/search/index.d.ts.map +1 -0
  316. package/dist/esm/agent/search/index.js +17 -0
  317. package/dist/esm/agent/search/index.js.map +1 -0
  318. package/dist/esm/agent/search/lexical.d.ts +3 -0
  319. package/dist/esm/agent/search/lexical.d.ts.map +1 -0
  320. package/dist/esm/agent/search/lexical.js +25 -0
  321. package/dist/esm/agent/search/lexical.js.map +1 -0
  322. package/dist/esm/agent/search/normalize.d.ts +13 -0
  323. package/dist/esm/agent/search/normalize.d.ts.map +1 -0
  324. package/dist/esm/agent/search/normalize.js +12 -0
  325. package/dist/esm/agent/search/normalize.js.map +1 -0
  326. package/dist/esm/agent/search/search.d.ts +42 -0
  327. package/dist/esm/agent/search/search.d.ts.map +1 -0
  328. package/dist/esm/agent/search/search.js +119 -0
  329. package/dist/esm/agent/search/search.js.map +1 -0
  330. package/dist/esm/agent/search/searchIndex.d.ts +42 -0
  331. package/dist/esm/agent/search/searchIndex.d.ts.map +1 -0
  332. package/dist/esm/agent/search/searchIndex.js +114 -0
  333. package/dist/esm/agent/search/searchIndex.js.map +1 -0
  334. package/dist/esm/agent/search/types.d.ts +67 -0
  335. package/dist/esm/agent/search/types.d.ts.map +1 -0
  336. package/dist/esm/agent/search/types.js +7 -0
  337. package/dist/esm/agent/search/types.js.map +1 -0
  338. package/dist/esm/agent/search/weights.d.ts +22 -0
  339. package/dist/esm/agent/search/weights.d.ts.map +1 -0
  340. package/dist/esm/agent/search/weights.js +31 -0
  341. package/dist/esm/agent/search/weights.js.map +1 -0
  342. package/dist/esm/agent/search/wordvectors.json +1 -0
  343. package/dist/esm/agent/types.d.ts +1 -1
  344. package/dist/esm/agent/types.d.ts.map +1 -1
  345. package/dist/esm/components/catalog.d.ts +1 -1
  346. package/dist/esm/components/catalog.d.ts.map +1 -1
  347. package/dist/esm/components/catalog.js +18 -0
  348. package/dist/esm/components/catalog.js.map +1 -1
  349. package/dist/esm/components/onboarding/animated-status/AnimatedStage.d.ts +9 -0
  350. package/dist/esm/components/onboarding/animated-status/AnimatedStage.d.ts.map +1 -0
  351. package/dist/esm/components/onboarding/animated-status/AnimatedStage.js +18 -0
  352. package/dist/esm/components/onboarding/animated-status/AnimatedStage.js.map +1 -0
  353. package/dist/esm/components/onboarding/animated-status/AnimatedStage.types.d.ts +31 -0
  354. package/dist/esm/components/onboarding/animated-status/AnimatedStage.types.d.ts.map +1 -0
  355. package/dist/esm/components/onboarding/animated-status/AnimatedStage.types.js +3 -0
  356. package/dist/esm/components/onboarding/animated-status/AnimatedStage.types.js.map +1 -0
  357. package/dist/esm/components/onboarding/animated-status/AnimatedStage.web.d.ts +4 -0
  358. package/dist/esm/components/onboarding/animated-status/AnimatedStage.web.d.ts.map +1 -0
  359. package/dist/esm/components/onboarding/animated-status/AnimatedStage.web.js +86 -0
  360. package/dist/esm/components/onboarding/animated-status/AnimatedStage.web.js.map +1 -0
  361. package/dist/esm/components/onboarding/animated-status/AnimatedStatusView.d.ts +32 -0
  362. package/dist/esm/components/onboarding/animated-status/AnimatedStatusView.d.ts.map +1 -0
  363. package/dist/esm/components/onboarding/animated-status/AnimatedStatusView.js +59 -0
  364. package/dist/esm/components/onboarding/animated-status/AnimatedStatusView.js.map +1 -0
  365. package/dist/esm/components/onboarding/animated-status/AnimatedStill.d.ts +8 -0
  366. package/dist/esm/components/onboarding/animated-status/AnimatedStill.d.ts.map +1 -0
  367. package/dist/esm/components/onboarding/animated-status/AnimatedStill.js +17 -0
  368. package/dist/esm/components/onboarding/animated-status/AnimatedStill.js.map +1 -0
  369. package/dist/esm/components/onboarding/animated-status/contract.d.ts +61 -0
  370. package/dist/esm/components/onboarding/animated-status/contract.d.ts.map +1 -0
  371. package/dist/esm/components/onboarding/animated-status/contract.js +78 -0
  372. package/dist/esm/components/onboarding/animated-status/contract.js.map +1 -0
  373. package/dist/esm/components/onboarding/animated-status/engine.d.ts +24 -0
  374. package/dist/esm/components/onboarding/animated-status/engine.d.ts.map +1 -0
  375. package/dist/esm/components/onboarding/animated-status/engine.js +32 -0
  376. package/dist/esm/components/onboarding/animated-status/engine.js.map +1 -0
  377. package/dist/esm/components/onboarding/animated-status/index.d.ts +5 -0
  378. package/dist/esm/components/onboarding/animated-status/index.d.ts.map +1 -0
  379. package/dist/esm/components/onboarding/animated-status/index.js +4 -0
  380. package/dist/esm/components/onboarding/animated-status/index.js.map +1 -0
  381. package/dist/esm/components/onboarding/animated-status/presets.json +126 -0
  382. package/dist/esm/components/onboarding/animated-status/riv.d.ts +3 -0
  383. package/dist/esm/components/onboarding/animated-status/riv.d.ts.map +1 -0
  384. package/dist/esm/components/onboarding/animated-status/riv.js +4 -0
  385. package/dist/esm/components/onboarding/animated-status/riv.js.map +1 -0
  386. package/dist/esm/components/onboarding/index.d.ts +2 -0
  387. package/dist/esm/components/onboarding/index.d.ts.map +1 -1
  388. package/dist/esm/components/onboarding/index.js +4 -0
  389. package/dist/esm/components/onboarding/index.js.map +1 -1
  390. package/dist/esm/components/onboarding/presets.d.ts.map +1 -1
  391. package/dist/esm/components/onboarding/presets.js +6 -0
  392. package/dist/esm/components/onboarding/presets.js.map +1 -1
  393. package/dist/esm/components/onboarding/receipt-printer/ReceiptStage.d.ts +4 -6
  394. package/dist/esm/components/onboarding/receipt-printer/ReceiptStage.d.ts.map +1 -1
  395. package/dist/esm/components/onboarding/receipt-printer/ReceiptStage.js +42 -6
  396. package/dist/esm/components/onboarding/receipt-printer/ReceiptStage.js.map +1 -1
  397. package/dist/esm/components/onboarding/send-completion/SendCompletionView.d.ts +47 -0
  398. package/dist/esm/components/onboarding/send-completion/SendCompletionView.d.ts.map +1 -0
  399. package/dist/esm/components/onboarding/send-completion/SendCompletionView.js +108 -0
  400. package/dist/esm/components/onboarding/send-completion/SendCompletionView.js.map +1 -0
  401. package/dist/esm/components/onboarding/send-completion/SendStage.d.ts +9 -0
  402. package/dist/esm/components/onboarding/send-completion/SendStage.d.ts.map +1 -0
  403. package/dist/esm/components/onboarding/send-completion/SendStage.js +34 -0
  404. package/dist/esm/components/onboarding/send-completion/SendStage.js.map +1 -0
  405. package/dist/esm/components/onboarding/send-completion/SendStage.types.d.ts +33 -0
  406. package/dist/esm/components/onboarding/send-completion/SendStage.types.d.ts.map +1 -0
  407. package/dist/esm/components/onboarding/send-completion/SendStage.types.js +3 -0
  408. package/dist/esm/components/onboarding/send-completion/SendStage.types.js.map +1 -0
  409. package/dist/esm/components/onboarding/send-completion/SendStage.web.d.ts +4 -0
  410. package/dist/esm/components/onboarding/send-completion/SendStage.web.d.ts.map +1 -0
  411. package/dist/esm/components/onboarding/send-completion/SendStage.web.js +104 -0
  412. package/dist/esm/components/onboarding/send-completion/SendStage.web.js.map +1 -0
  413. package/dist/esm/components/onboarding/send-completion/SendStill.d.ts +11 -0
  414. package/dist/esm/components/onboarding/send-completion/SendStill.d.ts.map +1 -0
  415. package/dist/esm/components/onboarding/send-completion/SendStill.js +14 -0
  416. package/dist/esm/components/onboarding/send-completion/SendStill.js.map +1 -0
  417. package/dist/esm/components/onboarding/send-completion/contract.d.ts +99 -0
  418. package/dist/esm/components/onboarding/send-completion/contract.d.ts.map +1 -0
  419. package/dist/esm/components/onboarding/send-completion/contract.js +76 -0
  420. package/dist/esm/components/onboarding/send-completion/contract.js.map +1 -0
  421. package/dist/esm/components/onboarding/send-completion/engine.d.ts +20 -0
  422. package/dist/esm/components/onboarding/send-completion/engine.d.ts.map +1 -0
  423. package/dist/esm/components/onboarding/send-completion/engine.js +28 -0
  424. package/dist/esm/components/onboarding/send-completion/engine.js.map +1 -0
  425. package/dist/esm/components/onboarding/send-completion/index.d.ts +6 -0
  426. package/dist/esm/components/onboarding/send-completion/index.d.ts.map +1 -0
  427. package/dist/esm/components/onboarding/send-completion/index.js +6 -0
  428. package/dist/esm/components/onboarding/send-completion/index.js.map +1 -0
  429. package/dist/esm/components/onboarding/send-completion/presets.json +132 -0
  430. package/dist/esm/components/onboarding/send-completion/riv.d.ts +3 -0
  431. package/dist/esm/components/onboarding/send-completion/riv.d.ts.map +1 -0
  432. package/dist/esm/components/onboarding/send-completion/riv.js +4 -0
  433. package/dist/esm/components/onboarding/send-completion/riv.js.map +1 -0
  434. package/dist/esm/components/onboarding/shared/actions-data.d.ts.map +1 -1
  435. package/dist/esm/components/onboarding/shared/actions-data.js +2 -0
  436. package/dist/esm/components/onboarding/shared/actions-data.js.map +1 -1
  437. package/dist/esm/components/onboarding/shared/configColor.d.ts +29 -0
  438. package/dist/esm/components/onboarding/shared/configColor.d.ts.map +1 -0
  439. package/dist/esm/components/onboarding/shared/configColor.js +69 -0
  440. package/dist/esm/components/onboarding/shared/configColor.js.map +1 -0
  441. package/dist/esm/components/onboarding/shared/contract.d.ts +1 -1
  442. package/dist/esm/components/onboarding/shared/contract.d.ts.map +1 -1
  443. package/dist/esm/components/onboarding/shared/contract.js +4 -0
  444. package/dist/esm/components/onboarding/shared/contract.js.map +1 -1
  445. package/dist/esm/components/onboarding/shared/describe.d.ts.map +1 -1
  446. package/dist/esm/components/onboarding/shared/describe.js +1 -1
  447. package/dist/esm/components/onboarding/shared/describe.js.map +1 -1
  448. package/dist/esm/components/onboarding/shared/mock.d.ts +2 -0
  449. package/dist/esm/components/onboarding/shared/mock.d.ts.map +1 -1
  450. package/dist/esm/components/onboarding/shared/mock.js +2 -0
  451. package/dist/esm/components/onboarding/shared/mock.js.map +1 -1
  452. package/dist/esm/components/onboarding/views.d.ts.map +1 -1
  453. package/dist/esm/components/onboarding/views.js +8 -0
  454. package/dist/esm/components/onboarding/views.js.map +1 -1
  455. package/dist/esm/index.js +1 -1
  456. package/dist/esm/index.js.map +1 -1
  457. package/dist/esm/motion/MotionPlayer.d.ts +22 -0
  458. package/dist/esm/motion/MotionPlayer.d.ts.map +1 -0
  459. package/dist/esm/motion/MotionPlayer.js +39 -0
  460. package/dist/esm/motion/MotionPlayer.js.map +1 -0
  461. package/dist/esm/motion/agent.d.ts +146 -0
  462. package/dist/esm/motion/agent.d.ts.map +1 -0
  463. package/dist/esm/motion/agent.js +278 -0
  464. package/dist/esm/motion/agent.js.map +1 -0
  465. package/dist/esm/motion/cat/Cat.d.ts +43 -0
  466. package/dist/esm/motion/cat/Cat.d.ts.map +1 -0
  467. package/dist/esm/motion/cat/Cat.js +74 -0
  468. package/dist/esm/motion/cat/Cat.js.map +1 -0
  469. package/dist/esm/motion/cat/animation.d.ts +86 -0
  470. package/dist/esm/motion/cat/animation.d.ts.map +1 -0
  471. package/dist/esm/motion/cat/animation.js +193 -0
  472. package/dist/esm/motion/cat/animation.js.map +1 -0
  473. package/dist/esm/motion/cat/art.generated.d.ts +53 -0
  474. package/dist/esm/motion/cat/art.generated.d.ts.map +1 -0
  475. package/dist/esm/motion/cat/art.generated.js +34 -0
  476. package/dist/esm/motion/cat/art.generated.js.map +1 -0
  477. package/dist/esm/motion/cat/config.d.ts +103 -0
  478. package/dist/esm/motion/cat/config.d.ts.map +1 -0
  479. package/dist/esm/motion/cat/config.js +129 -0
  480. package/dist/esm/motion/cat/config.js.map +1 -0
  481. package/dist/esm/motion/cat/index.d.ts +13 -0
  482. package/dist/esm/motion/cat/index.d.ts.map +1 -0
  483. package/dist/esm/motion/cat/index.js +13 -0
  484. package/dist/esm/motion/cat/index.js.map +1 -0
  485. package/dist/esm/motion/cat/rig.d.ts +44 -0
  486. package/dist/esm/motion/cat/rig.d.ts.map +1 -0
  487. package/dist/esm/motion/cat/rig.js +86 -0
  488. package/dist/esm/motion/cat/rig.js.map +1 -0
  489. package/dist/esm/motion/cat/scene.d.ts +66 -0
  490. package/dist/esm/motion/cat/scene.d.ts.map +1 -0
  491. package/dist/esm/motion/cat/scene.js +137 -0
  492. package/dist/esm/motion/cat/scene.js.map +1 -0
  493. package/dist/esm/motion/configurable/config.d.ts +80 -0
  494. package/dist/esm/motion/configurable/config.d.ts.map +1 -0
  495. package/dist/esm/motion/configurable/config.js +468 -0
  496. package/dist/esm/motion/configurable/config.js.map +1 -0
  497. package/dist/esm/motion/configurable/controls.d.ts +74 -0
  498. package/dist/esm/motion/configurable/controls.d.ts.map +1 -0
  499. package/dist/esm/motion/configurable/controls.js +38 -0
  500. package/dist/esm/motion/configurable/controls.js.map +1 -0
  501. package/dist/esm/motion/easing.d.ts +4 -0
  502. package/dist/esm/motion/easing.d.ts.map +1 -0
  503. package/dist/esm/motion/easing.js +58 -0
  504. package/dist/esm/motion/easing.js.map +1 -0
  505. package/dist/esm/motion/fit.d.ts +8 -0
  506. package/dist/esm/motion/fit.d.ts.map +1 -0
  507. package/dist/esm/motion/fit.js +8 -0
  508. package/dist/esm/motion/fit.js.map +1 -0
  509. package/dist/esm/motion/index.d.ts +27 -0
  510. package/dist/esm/motion/index.d.ts.map +1 -0
  511. package/dist/esm/motion/index.js +21 -0
  512. package/dist/esm/motion/index.js.map +1 -0
  513. package/dist/esm/motion/neon/GlowRenderer.d.ts +31 -0
  514. package/dist/esm/motion/neon/GlowRenderer.d.ts.map +1 -0
  515. package/dist/esm/motion/neon/GlowRenderer.js +14 -0
  516. package/dist/esm/motion/neon/GlowRenderer.js.map +1 -0
  517. package/dist/esm/motion/neon/NeonCanvas.d.ts +42 -0
  518. package/dist/esm/motion/neon/NeonCanvas.d.ts.map +1 -0
  519. package/dist/esm/motion/neon/NeonCanvas.js +92 -0
  520. package/dist/esm/motion/neon/NeonCanvas.js.map +1 -0
  521. package/dist/esm/motion/neon/NeonText.d.ts +26 -0
  522. package/dist/esm/motion/neon/NeonText.d.ts.map +1 -0
  523. package/dist/esm/motion/neon/NeonText.js +103 -0
  524. package/dist/esm/motion/neon/NeonText.js.map +1 -0
  525. package/dist/esm/motion/neon/NeonTextFrame.d.ts +29 -0
  526. package/dist/esm/motion/neon/NeonTextFrame.d.ts.map +1 -0
  527. package/dist/esm/motion/neon/NeonTextFrame.js +33 -0
  528. package/dist/esm/motion/neon/NeonTextFrame.js.map +1 -0
  529. package/dist/esm/motion/neon/artwork.d.ts +29 -0
  530. package/dist/esm/motion/neon/artwork.d.ts.map +1 -0
  531. package/dist/esm/motion/neon/artwork.js +98 -0
  532. package/dist/esm/motion/neon/artwork.js.map +1 -0
  533. package/dist/esm/motion/neon/audio.d.ts +49 -0
  534. package/dist/esm/motion/neon/audio.d.ts.map +1 -0
  535. package/dist/esm/motion/neon/audio.js +161 -0
  536. package/dist/esm/motion/neon/audio.js.map +1 -0
  537. package/dist/esm/motion/neon/config.d.ts +319 -0
  538. package/dist/esm/motion/neon/config.d.ts.map +1 -0
  539. package/dist/esm/motion/neon/config.js +319 -0
  540. package/dist/esm/motion/neon/config.js.map +1 -0
  541. package/dist/esm/motion/neon/flicker.d.ts +82 -0
  542. package/dist/esm/motion/neon/flicker.d.ts.map +1 -0
  543. package/dist/esm/motion/neon/flicker.js +187 -0
  544. package/dist/esm/motion/neon/flicker.js.map +1 -0
  545. package/dist/esm/motion/neon/fonts.d.ts +29 -0
  546. package/dist/esm/motion/neon/fonts.d.ts.map +1 -0
  547. package/dist/esm/motion/neon/fonts.js +47 -0
  548. package/dist/esm/motion/neon/fonts.js.map +1 -0
  549. package/dist/esm/motion/neon/frame.d.ts +22 -0
  550. package/dist/esm/motion/neon/frame.d.ts.map +1 -0
  551. package/dist/esm/motion/neon/frame.js +20 -0
  552. package/dist/esm/motion/neon/frame.js.map +1 -0
  553. package/dist/esm/motion/neon/glitch.d.ts +64 -0
  554. package/dist/esm/motion/neon/glitch.d.ts.map +1 -0
  555. package/dist/esm/motion/neon/glitch.js +108 -0
  556. package/dist/esm/motion/neon/glitch.js.map +1 -0
  557. package/dist/esm/motion/neon/index.d.ts +29 -0
  558. package/dist/esm/motion/neon/index.d.ts.map +1 -0
  559. package/dist/esm/motion/neon/index.js +28 -0
  560. package/dist/esm/motion/neon/index.js.map +1 -0
  561. package/dist/esm/motion/neon/layers.d.ts +56 -0
  562. package/dist/esm/motion/neon/layers.d.ts.map +1 -0
  563. package/dist/esm/motion/neon/layers.js +64 -0
  564. package/dist/esm/motion/neon/layers.js.map +1 -0
  565. package/dist/esm/motion/neon/material.d.ts +68 -0
  566. package/dist/esm/motion/neon/material.d.ts.map +1 -0
  567. package/dist/esm/motion/neon/material.js +51 -0
  568. package/dist/esm/motion/neon/material.js.map +1 -0
  569. package/dist/esm/motion/neon/random.d.ts +15 -0
  570. package/dist/esm/motion/neon/random.d.ts.map +1 -0
  571. package/dist/esm/motion/neon/random.js +37 -0
  572. package/dist/esm/motion/neon/random.js.map +1 -0
  573. package/dist/esm/motion/neon/scene.d.ts +255 -0
  574. package/dist/esm/motion/neon/scene.d.ts.map +1 -0
  575. package/dist/esm/motion/neon/scene.js +532 -0
  576. package/dist/esm/motion/neon/scene.js.map +1 -0
  577. package/dist/esm/motion/neon/synth.d.ts +18 -0
  578. package/dist/esm/motion/neon/synth.d.ts.map +1 -0
  579. package/dist/esm/motion/neon/synth.js +208 -0
  580. package/dist/esm/motion/neon/synth.js.map +1 -0
  581. package/dist/esm/motion/neon/typography.d.ts +53 -0
  582. package/dist/esm/motion/neon/typography.d.ts.map +1 -0
  583. package/dist/esm/motion/neon/typography.js +74 -0
  584. package/dist/esm/motion/neon/typography.js.map +1 -0
  585. package/dist/esm/motion/neon/wall.d.ts +62 -0
  586. package/dist/esm/motion/neon/wall.d.ts.map +1 -0
  587. package/dist/esm/motion/neon/wall.js +106 -0
  588. package/dist/esm/motion/neon/wall.js.map +1 -0
  589. package/dist/esm/motion/paperfold/PaperFold.d.ts +36 -0
  590. package/dist/esm/motion/paperfold/PaperFold.d.ts.map +1 -0
  591. package/dist/esm/motion/paperfold/PaperFold.js +37 -0
  592. package/dist/esm/motion/paperfold/PaperFold.js.map +1 -0
  593. package/dist/esm/motion/paperfold/PaperFoldFrame.d.ts +39 -0
  594. package/dist/esm/motion/paperfold/PaperFoldFrame.d.ts.map +1 -0
  595. package/dist/esm/motion/paperfold/PaperFoldFrame.js +283 -0
  596. package/dist/esm/motion/paperfold/PaperFoldFrame.js.map +1 -0
  597. package/dist/esm/motion/paperfold/PaperFoldPlayer.d.ts +27 -0
  598. package/dist/esm/motion/paperfold/PaperFoldPlayer.d.ts.map +1 -0
  599. package/dist/esm/motion/paperfold/PaperFoldPlayer.js +56 -0
  600. package/dist/esm/motion/paperfold/PaperFoldPlayer.js.map +1 -0
  601. package/dist/esm/motion/paperfold/art.d.ts +148 -0
  602. package/dist/esm/motion/paperfold/art.d.ts.map +1 -0
  603. package/dist/esm/motion/paperfold/art.js +374 -0
  604. package/dist/esm/motion/paperfold/art.js.map +1 -0
  605. package/dist/esm/motion/paperfold/config.d.ts +47 -0
  606. package/dist/esm/motion/paperfold/config.d.ts.map +1 -0
  607. package/dist/esm/motion/paperfold/config.js +96 -0
  608. package/dist/esm/motion/paperfold/config.js.map +1 -0
  609. package/dist/esm/motion/paperfold/controls.d.ts +57 -0
  610. package/dist/esm/motion/paperfold/controls.d.ts.map +1 -0
  611. package/dist/esm/motion/paperfold/controls.js +506 -0
  612. package/dist/esm/motion/paperfold/controls.js.map +1 -0
  613. package/dist/esm/motion/paperfold/engine.d.ts +397 -0
  614. package/dist/esm/motion/paperfold/engine.d.ts.map +1 -0
  615. package/dist/esm/motion/paperfold/engine.js +699 -0
  616. package/dist/esm/motion/paperfold/engine.js.map +1 -0
  617. package/dist/esm/motion/paperfold/fonts.d.ts +3 -0
  618. package/dist/esm/motion/paperfold/fonts.d.ts.map +1 -0
  619. package/dist/esm/motion/paperfold/fonts.js +21 -0
  620. package/dist/esm/motion/paperfold/fonts.js.map +1 -0
  621. package/dist/esm/motion/paperfold/index.d.ts +17 -0
  622. package/dist/esm/motion/paperfold/index.d.ts.map +1 -0
  623. package/dist/esm/motion/paperfold/index.js +17 -0
  624. package/dist/esm/motion/paperfold/index.js.map +1 -0
  625. package/dist/esm/motion/paperfold/manipulate.d.ts +59 -0
  626. package/dist/esm/motion/paperfold/manipulate.d.ts.map +1 -0
  627. package/dist/esm/motion/paperfold/manipulate.js +161 -0
  628. package/dist/esm/motion/paperfold/manipulate.js.map +1 -0
  629. package/dist/esm/motion/paperfold/presets.d.ts +9 -0
  630. package/dist/esm/motion/paperfold/presets.d.ts.map +1 -0
  631. package/dist/esm/motion/paperfold/presets.js +115 -0
  632. package/dist/esm/motion/paperfold/presets.js.map +1 -0
  633. package/dist/esm/motion/paperfold/template.d.ts +3 -0
  634. package/dist/esm/motion/paperfold/template.d.ts.map +1 -0
  635. package/dist/esm/motion/paperfold/template.js +37 -0
  636. package/dist/esm/motion/paperfold/template.js.map +1 -0
  637. package/dist/esm/motion/player.d.ts +35 -0
  638. package/dist/esm/motion/player.d.ts.map +1 -0
  639. package/dist/esm/motion/player.js +197 -0
  640. package/dist/esm/motion/player.js.map +1 -0
  641. package/dist/esm/motion/promo/PromoFrame.d.ts +31 -0
  642. package/dist/esm/motion/promo/PromoFrame.d.ts.map +1 -0
  643. package/dist/esm/motion/promo/PromoFrame.js +288 -0
  644. package/dist/esm/motion/promo/PromoFrame.js.map +1 -0
  645. package/dist/esm/motion/promo/PromoShowcasePlayer.d.ts +25 -0
  646. package/dist/esm/motion/promo/PromoShowcasePlayer.d.ts.map +1 -0
  647. package/dist/esm/motion/promo/PromoShowcasePlayer.js +56 -0
  648. package/dist/esm/motion/promo/PromoShowcasePlayer.js.map +1 -0
  649. package/dist/esm/motion/promo/config.d.ts +91 -0
  650. package/dist/esm/motion/promo/config.d.ts.map +1 -0
  651. package/dist/esm/motion/promo/config.js +550 -0
  652. package/dist/esm/motion/promo/config.js.map +1 -0
  653. package/dist/esm/motion/promo/controls.d.ts +86 -0
  654. package/dist/esm/motion/promo/controls.d.ts.map +1 -0
  655. package/dist/esm/motion/promo/controls.js +567 -0
  656. package/dist/esm/motion/promo/controls.js.map +1 -0
  657. package/dist/esm/motion/promo/easing.d.ts +3 -0
  658. package/dist/esm/motion/promo/easing.d.ts.map +1 -0
  659. package/dist/esm/motion/promo/easing.js +32 -0
  660. package/dist/esm/motion/promo/easing.js.map +1 -0
  661. package/dist/esm/motion/promo/engine.d.ts +205 -0
  662. package/dist/esm/motion/promo/engine.d.ts.map +1 -0
  663. package/dist/esm/motion/promo/engine.js +551 -0
  664. package/dist/esm/motion/promo/engine.js.map +1 -0
  665. package/dist/esm/motion/promo/fonts.d.ts +7 -0
  666. package/dist/esm/motion/promo/fonts.d.ts.map +1 -0
  667. package/dist/esm/motion/promo/fonts.js +16 -0
  668. package/dist/esm/motion/promo/fonts.js.map +1 -0
  669. package/dist/esm/motion/promo/icons.d.ts +7 -0
  670. package/dist/esm/motion/promo/icons.d.ts.map +1 -0
  671. package/dist/esm/motion/promo/icons.js +26 -0
  672. package/dist/esm/motion/promo/icons.js.map +1 -0
  673. package/dist/esm/motion/promo/index.d.ts +15 -0
  674. package/dist/esm/motion/promo/index.d.ts.map +1 -0
  675. package/dist/esm/motion/promo/index.js +15 -0
  676. package/dist/esm/motion/promo/index.js.map +1 -0
  677. package/dist/esm/motion/promo/presets.d.ts +13 -0
  678. package/dist/esm/motion/promo/presets.d.ts.map +1 -0
  679. package/dist/esm/motion/promo/presets.js +40 -0
  680. package/dist/esm/motion/promo/presets.js.map +1 -0
  681. package/dist/esm/motion/promo/template.d.ts +8 -0
  682. package/dist/esm/motion/promo/template.d.ts.map +1 -0
  683. package/dist/esm/motion/promo/template.js +35 -0
  684. package/dist/esm/motion/promo/template.js.map +1 -0
  685. package/dist/esm/motion/replication2/Replication2Player.d.ts +26 -0
  686. package/dist/esm/motion/replication2/Replication2Player.d.ts.map +1 -0
  687. package/dist/esm/motion/replication2/Replication2Player.js +90 -0
  688. package/dist/esm/motion/replication2/Replication2Player.js.map +1 -0
  689. package/dist/esm/motion/replication2/config.d.ts +78 -0
  690. package/dist/esm/motion/replication2/config.d.ts.map +1 -0
  691. package/dist/esm/motion/replication2/config.js +341 -0
  692. package/dist/esm/motion/replication2/config.js.map +1 -0
  693. package/dist/esm/motion/replication2/controls.d.ts +70 -0
  694. package/dist/esm/motion/replication2/controls.d.ts.map +1 -0
  695. package/dist/esm/motion/replication2/controls.js +283 -0
  696. package/dist/esm/motion/replication2/controls.js.map +1 -0
  697. package/dist/esm/motion/replication2/driver.d.ts +23 -0
  698. package/dist/esm/motion/replication2/driver.d.ts.map +1 -0
  699. package/dist/esm/motion/replication2/driver.js +65 -0
  700. package/dist/esm/motion/replication2/driver.js.map +1 -0
  701. package/dist/esm/motion/replication2/easing.d.ts +19 -0
  702. package/dist/esm/motion/replication2/easing.d.ts.map +1 -0
  703. package/dist/esm/motion/replication2/easing.js +92 -0
  704. package/dist/esm/motion/replication2/easing.js.map +1 -0
  705. package/dist/esm/motion/replication2/engine.d.ts +236 -0
  706. package/dist/esm/motion/replication2/engine.d.ts.map +1 -0
  707. package/dist/esm/motion/replication2/engine.js +470 -0
  708. package/dist/esm/motion/replication2/engine.js.map +1 -0
  709. package/dist/esm/motion/replication2/html.d.ts +30 -0
  710. package/dist/esm/motion/replication2/html.d.ts.map +1 -0
  711. package/dist/esm/motion/replication2/html.js +83 -0
  712. package/dist/esm/motion/replication2/html.js.map +1 -0
  713. package/dist/esm/motion/replication2/index.d.ts +15 -0
  714. package/dist/esm/motion/replication2/index.d.ts.map +1 -0
  715. package/dist/esm/motion/replication2/index.js +15 -0
  716. package/dist/esm/motion/replication2/index.js.map +1 -0
  717. package/dist/esm/motion/replication2/measure.d.ts +3 -0
  718. package/dist/esm/motion/replication2/measure.d.ts.map +1 -0
  719. package/dist/esm/motion/replication2/measure.js +27 -0
  720. package/dist/esm/motion/replication2/measure.js.map +1 -0
  721. package/dist/esm/motion/replication2/metrics.d.ts +6 -0
  722. package/dist/esm/motion/replication2/metrics.d.ts.map +1 -0
  723. package/dist/esm/motion/replication2/metrics.js +7 -0
  724. package/dist/esm/motion/replication2/metrics.js.map +1 -0
  725. package/dist/esm/motion/replication2/presets.d.ts +13 -0
  726. package/dist/esm/motion/replication2/presets.d.ts.map +1 -0
  727. package/dist/esm/motion/replication2/presets.js +63 -0
  728. package/dist/esm/motion/replication2/presets.js.map +1 -0
  729. package/dist/esm/motion/replication2/riv.d.ts +3 -0
  730. package/dist/esm/motion/replication2/riv.d.ts.map +1 -0
  731. package/dist/esm/motion/replication2/riv.js +4 -0
  732. package/dist/esm/motion/replication2/riv.js.map +1 -0
  733. package/dist/esm/motion/replication2/rive-contract.d.ts +27 -0
  734. package/dist/esm/motion/replication2/rive-contract.d.ts.map +1 -0
  735. package/dist/esm/motion/replication2/rive-contract.js +153 -0
  736. package/dist/esm/motion/replication2/rive-contract.js.map +1 -0
  737. package/dist/esm/motion/replication2/template.d.ts +8 -0
  738. package/dist/esm/motion/replication2/template.d.ts.map +1 -0
  739. package/dist/esm/motion/replication2/template.js +32 -0
  740. package/dist/esm/motion/replication2/template.js.map +1 -0
  741. package/dist/esm/motion/sample.d.ts +61 -0
  742. package/dist/esm/motion/sample.d.ts.map +1 -0
  743. package/dist/esm/motion/sample.js +138 -0
  744. package/dist/esm/motion/sample.js.map +1 -0
  745. package/dist/esm/motion/templates/hey-template.d.ts +3 -0
  746. package/dist/esm/motion/templates/hey-template.d.ts.map +1 -0
  747. package/dist/esm/motion/templates/hey-template.js +1549 -0
  748. package/dist/esm/motion/templates/hey-template.js.map +1 -0
  749. package/dist/esm/motion/templates/index.d.ts +22 -0
  750. package/dist/esm/motion/templates/index.d.ts.map +1 -0
  751. package/dist/esm/motion/templates/index.js +15 -0
  752. package/dist/esm/motion/templates/index.js.map +1 -0
  753. package/dist/esm/motion/templates/word-motion.d.ts +3 -0
  754. package/dist/esm/motion/templates/word-motion.d.ts.map +1 -0
  755. package/dist/esm/motion/templates/word-motion.js +1162 -0
  756. package/dist/esm/motion/templates/word-motion.js.map +1 -0
  757. package/dist/esm/motion/types.d.ts +192 -0
  758. package/dist/esm/motion/types.d.ts.map +1 -0
  759. package/dist/esm/motion/types.js +2 -0
  760. package/dist/esm/motion/types.js.map +1 -0
  761. package/dist/esm/motion/typesurface/TypeSurfaceCanvas.d.ts +22 -0
  762. package/dist/esm/motion/typesurface/TypeSurfaceCanvas.d.ts.map +1 -0
  763. package/dist/esm/motion/typesurface/TypeSurfaceCanvas.js +58 -0
  764. package/dist/esm/motion/typesurface/TypeSurfaceCanvas.js.map +1 -0
  765. package/dist/esm/motion/typesurface/art.d.ts +21 -0
  766. package/dist/esm/motion/typesurface/art.d.ts.map +1 -0
  767. package/dist/esm/motion/typesurface/art.js +854 -0
  768. package/dist/esm/motion/typesurface/art.js.map +1 -0
  769. package/dist/esm/motion/typesurface/config.d.ts +273 -0
  770. package/dist/esm/motion/typesurface/config.d.ts.map +1 -0
  771. package/dist/esm/motion/typesurface/config.js +260 -0
  772. package/dist/esm/motion/typesurface/config.js.map +1 -0
  773. package/dist/esm/motion/typesurface/engine.d.ts +94 -0
  774. package/dist/esm/motion/typesurface/engine.d.ts.map +1 -0
  775. package/dist/esm/motion/typesurface/engine.js +603 -0
  776. package/dist/esm/motion/typesurface/engine.js.map +1 -0
  777. package/dist/esm/motion/typesurface/fonts.d.ts +25 -0
  778. package/dist/esm/motion/typesurface/fonts.d.ts.map +1 -0
  779. package/dist/esm/motion/typesurface/fonts.js +40 -0
  780. package/dist/esm/motion/typesurface/fonts.js.map +1 -0
  781. package/dist/esm/motion/typesurface/index.d.ts +17 -0
  782. package/dist/esm/motion/typesurface/index.d.ts.map +1 -0
  783. package/dist/esm/motion/typesurface/index.js +17 -0
  784. package/dist/esm/motion/typesurface/index.js.map +1 -0
  785. package/dist/esm/motion/typesurface/layout.d.ts +57 -0
  786. package/dist/esm/motion/typesurface/layout.d.ts.map +1 -0
  787. package/dist/esm/motion/typesurface/layout.js +122 -0
  788. package/dist/esm/motion/typesurface/layout.js.map +1 -0
  789. package/dist/esm/motion/typesurface/ops.d.ts +70 -0
  790. package/dist/esm/motion/typesurface/ops.d.ts.map +1 -0
  791. package/dist/esm/motion/typesurface/ops.js +164 -0
  792. package/dist/esm/motion/typesurface/ops.js.map +1 -0
  793. package/dist/esm/motion/typesurface/presets.d.ts +33 -0
  794. package/dist/esm/motion/typesurface/presets.d.ts.map +1 -0
  795. package/dist/esm/motion/typesurface/presets.js +185 -0
  796. package/dist/esm/motion/typesurface/presets.js.map +1 -0
  797. package/dist/esm/motion/typesurface/renderer.d.ts +78 -0
  798. package/dist/esm/motion/typesurface/renderer.d.ts.map +1 -0
  799. package/dist/esm/motion/typesurface/renderer.js +666 -0
  800. package/dist/esm/motion/typesurface/renderer.js.map +1 -0
  801. package/dist/esm/motion/typesurface/shaders.d.ts +17 -0
  802. package/dist/esm/motion/typesurface/shaders.d.ts.map +1 -0
  803. package/dist/esm/motion/typesurface/shaders.js +297 -0
  804. package/dist/esm/motion/typesurface/shaders.js.map +1 -0
  805. package/dist/esm/motion/typesurface/surfaces.d.ts +81 -0
  806. package/dist/esm/motion/typesurface/surfaces.d.ts.map +1 -0
  807. package/dist/esm/motion/typesurface/surfaces.js +149 -0
  808. package/dist/esm/motion/typesurface/surfaces.js.map +1 -0
  809. package/dist/esm/motion/typesurface/text.d.ts +17 -0
  810. package/dist/esm/motion/typesurface/text.d.ts.map +1 -0
  811. package/dist/esm/motion/typesurface/text.js +28 -0
  812. package/dist/esm/motion/typesurface/text.js.map +1 -0
  813. package/dist/esm/motion/typesurface/timeline.d.ts +15 -0
  814. package/dist/esm/motion/typesurface/timeline.d.ts.map +1 -0
  815. package/dist/esm/motion/typesurface/timeline.js +57 -0
  816. package/dist/esm/motion/typesurface/timeline.js.map +1 -0
  817. package/dist/esm/motion/validate.d.ts +22 -0
  818. package/dist/esm/motion/validate.d.ts.map +1 -0
  819. package/dist/esm/motion/validate.js +84 -0
  820. package/dist/esm/motion/validate.js.map +1 -0
  821. package/dist/esm/native/RiveReceiptStage.d.ts +25 -2
  822. package/dist/esm/native/RiveReceiptStage.d.ts.map +1 -1
  823. package/dist/esm/native/RiveReceiptStage.js +7 -148
  824. package/dist/esm/native/RiveReceiptStage.js.map +1 -1
  825. package/dist/esm/native/riveReceiptStageFactory.d.ts +26 -0
  826. package/dist/esm/native/riveReceiptStageFactory.d.ts.map +1 -0
  827. package/dist/esm/native/riveReceiptStageFactory.js +159 -0
  828. package/dist/esm/native/riveReceiptStageFactory.js.map +1 -0
  829. package/dist/esm/tokens/stage.d.ts +7 -0
  830. package/dist/esm/tokens/stage.d.ts.map +1 -0
  831. package/dist/esm/tokens/stage.js +7 -0
  832. package/dist/esm/tokens/stage.js.map +1 -0
  833. package/package.json +36 -1
  834. package/spec/examples/components/onboarding/animated-status/case1.json +42 -0
  835. package/spec/examples/components/onboarding/animated-status/case2.json +42 -0
  836. package/spec/examples/components/onboarding/animated-status/case3.json +42 -0
  837. package/spec/examples/components/onboarding/animated-status/case4.json +42 -0
  838. package/spec/examples/components/onboarding/animated-status/case5.json +42 -0
  839. package/spec/examples/components/onboarding/send-completion/case1.json +48 -0
  840. package/spec/examples/components/onboarding/send-completion/case2.json +48 -0
  841. package/spec/examples/components/onboarding/send-completion/case3.json +48 -0
  842. package/spec/examples/components/onboarding/send-completion/case4.json +48 -0
  843. package/spec/examples/components/onboarding/send-completion/case5.json +48 -0
  844. package/spec/families/onboarding.schema.json +610 -1
  845. package/src/agent/AgentComponent.tsx +1 -1
  846. package/src/agent/base.ts +17 -0
  847. package/src/agent/catalog.ts +0 -32
  848. package/src/agent/core.ts +6 -14
  849. package/src/agent/index.ts +6 -5
  850. package/src/agent/manifests.ts +83 -1
  851. package/src/agent/result.ts +6 -0
  852. package/src/agent/search/document.ts +46 -0
  853. package/src/agent/search/embedding.ts +95 -0
  854. package/src/agent/search/index.ts +20 -0
  855. package/src/agent/search/lexical.ts +25 -0
  856. package/src/agent/search/normalize.ts +17 -0
  857. package/src/agent/search/search.ts +148 -0
  858. package/src/agent/search/searchIndex.ts +107 -0
  859. package/src/agent/search/types.ts +68 -0
  860. package/src/agent/search/weights.ts +32 -0
  861. package/src/agent/types.ts +1 -1
  862. package/src/components/catalog.ts +21 -1
  863. package/src/components/onboarding/animated-status/AnimatedStage.tsx +18 -0
  864. package/src/components/onboarding/animated-status/AnimatedStage.types.ts +30 -0
  865. package/src/components/onboarding/animated-status/AnimatedStage.web.tsx +99 -0
  866. package/src/components/onboarding/animated-status/AnimatedStatusView.tsx +109 -0
  867. package/src/components/onboarding/animated-status/AnimatedStill.tsx +23 -0
  868. package/src/components/onboarding/animated-status/contract.ts +105 -0
  869. package/src/components/onboarding/animated-status/engine.ts +49 -0
  870. package/src/components/onboarding/animated-status/index.ts +8 -0
  871. package/src/components/onboarding/animated-status/presets.json +126 -0
  872. package/src/components/onboarding/animated-status/riv.ts +4 -0
  873. package/src/components/onboarding/index.ts +4 -0
  874. package/src/components/onboarding/presets.ts +6 -0
  875. package/src/components/onboarding/receipt-printer/ReceiptStage.tsx +46 -7
  876. package/src/components/onboarding/send-completion/SendCompletionView.tsx +164 -0
  877. package/src/components/onboarding/send-completion/SendStage.tsx +27 -0
  878. package/src/components/onboarding/send-completion/SendStage.types.ts +32 -0
  879. package/src/components/onboarding/send-completion/SendStage.web.tsx +116 -0
  880. package/src/components/onboarding/send-completion/SendStill.tsx +19 -0
  881. package/src/components/onboarding/send-completion/contract.ts +127 -0
  882. package/src/components/onboarding/send-completion/engine.ts +37 -0
  883. package/src/components/onboarding/send-completion/index.ts +10 -0
  884. package/src/components/onboarding/send-completion/presets.json +132 -0
  885. package/src/components/onboarding/send-completion/riv.ts +4 -0
  886. package/src/components/onboarding/shared/actions-data.ts +2 -0
  887. package/src/components/onboarding/shared/configColor.ts +72 -0
  888. package/src/components/onboarding/shared/contract.ts +4 -0
  889. package/src/components/onboarding/shared/describe.ts +1 -1
  890. package/src/components/onboarding/shared/mock.ts +2 -0
  891. package/src/components/onboarding/views.ts +8 -0
  892. package/src/index.ts +1 -1
  893. package/src/motion/MotionPlayer.tsx +62 -0
  894. package/src/motion/agent.ts +288 -0
  895. package/src/motion/cat/Cat.tsx +118 -0
  896. package/src/motion/cat/animation.ts +206 -0
  897. package/src/motion/cat/art.generated.ts +44 -0
  898. package/src/motion/cat/config.ts +186 -0
  899. package/src/motion/cat/index.ts +26 -0
  900. package/src/motion/cat/rig.ts +102 -0
  901. package/src/motion/cat/scene.ts +181 -0
  902. package/src/motion/configurable/config.ts +420 -0
  903. package/src/motion/configurable/controls.ts +93 -0
  904. package/src/motion/easing.ts +55 -0
  905. package/src/motion/fit.ts +8 -0
  906. package/src/motion/index.ts +29 -0
  907. package/src/motion/neon/GlowRenderer.tsx +83 -0
  908. package/src/motion/neon/NeonCanvas.tsx +175 -0
  909. package/src/motion/neon/NeonText.tsx +113 -0
  910. package/src/motion/neon/NeonTextFrame.tsx +67 -0
  911. package/src/motion/neon/artwork.ts +95 -0
  912. package/src/motion/neon/audio.ts +162 -0
  913. package/src/motion/neon/config.ts +484 -0
  914. package/src/motion/neon/flicker.ts +225 -0
  915. package/src/motion/neon/fonts.ts +76 -0
  916. package/src/motion/neon/frame.ts +34 -0
  917. package/src/motion/neon/glitch.ts +142 -0
  918. package/src/motion/neon/index.ts +41 -0
  919. package/src/motion/neon/layers.tsx +209 -0
  920. package/src/motion/neon/material.ts +88 -0
  921. package/src/motion/neon/random.ts +40 -0
  922. package/src/motion/neon/scene.ts +610 -0
  923. package/src/motion/neon/synth.ts +188 -0
  924. package/src/motion/neon/typography.ts +102 -0
  925. package/src/motion/neon/wall.ts +157 -0
  926. package/src/motion/paperfold/PaperFold.tsx +45 -0
  927. package/src/motion/paperfold/PaperFoldFrame.tsx +576 -0
  928. package/src/motion/paperfold/PaperFoldPlayer.tsx +80 -0
  929. package/src/motion/paperfold/art.ts +455 -0
  930. package/src/motion/paperfold/config.ts +98 -0
  931. package/src/motion/paperfold/controls.ts +557 -0
  932. package/src/motion/paperfold/engine.ts +852 -0
  933. package/src/motion/paperfold/fonts.ts +21 -0
  934. package/src/motion/paperfold/index.ts +30 -0
  935. package/src/motion/paperfold/manipulate.ts +188 -0
  936. package/src/motion/paperfold/presets.ts +117 -0
  937. package/src/motion/paperfold/template.ts +38 -0
  938. package/src/motion/player.ts +207 -0
  939. package/src/motion/promo/PromoFrame.tsx +501 -0
  940. package/src/motion/promo/PromoShowcasePlayer.tsx +78 -0
  941. package/src/motion/promo/config.ts +479 -0
  942. package/src/motion/promo/controls.ts +643 -0
  943. package/src/motion/promo/easing.ts +36 -0
  944. package/src/motion/promo/engine.ts +587 -0
  945. package/src/motion/promo/fonts.ts +16 -0
  946. package/src/motion/promo/icons.tsx +29 -0
  947. package/src/motion/promo/index.ts +24 -0
  948. package/src/motion/promo/presets.ts +40 -0
  949. package/src/motion/promo/template.ts +36 -0
  950. package/src/motion/replication2/Replication2Player.tsx +115 -0
  951. package/src/motion/replication2/config.ts +323 -0
  952. package/src/motion/replication2/controls.ts +336 -0
  953. package/src/motion/replication2/driver.ts +92 -0
  954. package/src/motion/replication2/easing.ts +88 -0
  955. package/src/motion/replication2/engine.ts +539 -0
  956. package/src/motion/replication2/html.ts +87 -0
  957. package/src/motion/replication2/index.ts +14 -0
  958. package/src/motion/replication2/measure.ts +28 -0
  959. package/src/motion/replication2/metrics.ts +7 -0
  960. package/src/motion/replication2/presets.ts +63 -0
  961. package/src/motion/replication2/riv.ts +4 -0
  962. package/src/motion/replication2/rive-contract.ts +165 -0
  963. package/src/motion/replication2/template.ts +33 -0
  964. package/src/motion/sample.ts +173 -0
  965. package/src/motion/templates/hey-template.ts +1553 -0
  966. package/src/motion/templates/index.ts +17 -0
  967. package/src/motion/templates/word-motion.ts +1166 -0
  968. package/src/motion/types.ts +162 -0
  969. package/src/motion/typesurface/TypeSurfaceCanvas.tsx +73 -0
  970. package/src/motion/typesurface/art.ts +639 -0
  971. package/src/motion/typesurface/config.ts +486 -0
  972. package/src/motion/typesurface/engine.ts +586 -0
  973. package/src/motion/typesurface/fonts.ts +63 -0
  974. package/src/motion/typesurface/index.ts +16 -0
  975. package/src/motion/typesurface/layout.ts +133 -0
  976. package/src/motion/typesurface/ops.ts +196 -0
  977. package/src/motion/typesurface/presets.ts +199 -0
  978. package/src/motion/typesurface/renderer.ts +579 -0
  979. package/src/motion/typesurface/shaders.ts +303 -0
  980. package/src/motion/typesurface/surfaces.ts +223 -0
  981. package/src/motion/typesurface/text.ts +35 -0
  982. package/src/motion/typesurface/timeline.ts +58 -0
  983. package/src/motion/validate.ts +101 -0
  984. package/src/native/RiveReceiptStage.tsx +8 -155
  985. package/src/native/riveReceiptStageFactory.tsx +175 -0
  986. package/src/tokens/stage.ts +6 -0
  987. package/tools/ask/dist/components.mjs +7221 -44
  988. package/tools/ask/mcp.mjs +80 -1
@@ -0,0 +1,80 @@
1
+ import { useEffect, useMemo, useRef, useState } from 'react';
2
+ import { getPath, validateConfig, type ConfigError, type PaperFoldConfig } from './config';
3
+ import { MOTION_FPS, timeline } from './engine';
4
+ import { installPaperFoldFonts } from './fonts';
5
+ import { PaperFoldFrame, type PaperFoldFrameProps } from './PaperFoldFrame';
6
+
7
+ export type PaperFoldPlayerProps = {
8
+ /** The canonical config (any subset; defaults fill the rest). Validated before anything is drawn. */
9
+ config: unknown;
10
+ autoPlay?: boolean;
11
+ /** Replay from the start when the timeline ends (default true). */
12
+ loop?: boolean;
13
+ /** Rendered width in CSS px; the height follows the config's aspect ratio. Defaults to 360. */
14
+ width?: number;
15
+ /** Seek to this authored motion frame and hold (scrubbing). */
16
+ frame?: number;
17
+ /** Development overlay: creases, panels, pivots, angles, anchors, frame. */
18
+ debug?: boolean;
19
+ onFrame?: (frame: number) => void;
20
+ onInvalid?: (errors: ConfigError[]) => void;
21
+ resolveAsset?: PaperFoldFrameProps['resolveAsset'];
22
+ className?: string;
23
+ };
24
+
25
+ const RATIO: Record<string, number> = { '9:16': 9 / 16, '16:9': 16 / 9, '1:1': 1 };
26
+
27
+ /**
28
+ * **paper-fold-promo in a React web app.** Validates the config, then draws each frame with the
29
+ * package's procedural renderer at the player's own size (vector, never a scaled bitmap). A rAF clock
30
+ * turns time into authored motion frames (× motion.speed); the engine does the rest. The drawing is
31
+ * `aria-hidden` inside a `role="img"` box labelled with the copy. Reduced motion shows the final frame.
32
+ */
33
+ export function PaperFoldPlayer({ config, autoPlay = true, loop = true, width = 360, frame, debug, onFrame, onInvalid, resolveAsset, className }: PaperFoldPlayerProps) {
34
+ const key = JSON.stringify(config ?? {});
35
+ const checked = useMemo(() => validateConfig(JSON.parse(key)), [key]);
36
+ const cfg = checked.config as PaperFoldConfig | undefined;
37
+ const [now, setNow] = useState(0);
38
+ const cb = useRef({ onFrame, onInvalid });
39
+ cb.current = { onFrame, onInvalid };
40
+ const aspect = cfg ? String(getPath(cfg, 'canvas.aspectRatio')) : '9:16';
41
+ const height = Math.round(width / (RATIO[aspect] ?? 9 / 16));
42
+
43
+ useEffect(() => installPaperFoldFonts(), []);
44
+ useEffect(() => { if (!checked.valid) cb.current.onInvalid?.(checked.errors); }, [checked]);
45
+ useEffect(() => {
46
+ if (!cfg) return;
47
+ const total = timeline(cfg).end;
48
+ const speed = getPath(cfg, 'motion.speed') as number;
49
+ const reduced = typeof window !== 'undefined' && window.matchMedia?.('(prefers-reduced-motion: reduce)').matches;
50
+ if (frame !== undefined || !autoPlay || reduced) { setNow(frame ?? (reduced ? total - 1 : 0)); return; }
51
+ let raf = 0;
52
+ const start = performance.now();
53
+ const tick = (t: number) => {
54
+ const m = ((t - start) / 1000) * MOTION_FPS * speed;
55
+ const f = loop ? m % total : Math.min(m, total - 1);
56
+ setNow(f);
57
+ cb.current.onFrame?.(f);
58
+ if (loop || m < total) raf = requestAnimationFrame(tick);
59
+ };
60
+ raf = requestAnimationFrame(tick);
61
+ return () => cancelAnimationFrame(raf);
62
+ }, [cfg, frame, autoPlay, loop]);
63
+
64
+ if (!checked.valid) {
65
+ return (
66
+ <div role="alert" className={className} style={{ width, padding: 12, font: '13px/1.4 system-ui', border: '1px solid currentColor' }}>
67
+ <strong>This paper-fold configuration is not valid.</strong>
68
+ <ul>{checked.errors.slice(0, 8).map((e) => <li key={e.path + e.message}>{e.message}</li>)}</ul>
69
+ </div>
70
+ );
71
+ }
72
+ const label = [getPath(cfg, 'content.logo'), getPath(cfg, 'content.top.headline'), getPath(cfg, 'content.middle.headline'), getPath(cfg, 'content.bottom.body'), getPath(cfg, 'content.cta.text')].filter(Boolean).join(' — ');
73
+ return (
74
+ <div role="img" aria-label={label} className={className} style={{ width, height, position: 'relative', overflow: 'hidden' }}>
75
+ <div aria-hidden="true">
76
+ <PaperFoldFrame config={cfg!} frame={now} width={width} height={height} debug={debug} resolveAsset={resolveAsset} />
77
+ </div>
78
+ </div>
79
+ );
80
+ }
@@ -0,0 +1,455 @@
1
+ /* eslint-disable comppack/no-raw-colour -- vector artwork: colours come from the config (hands.style, paperMaterial, logo); the literals are the reference defaults written into the exported SVG files. */
2
+ /**
3
+ * **The vector artwork of paper-fold-promo**, as data: SVG path geometry for each separately movable
4
+ * part. The renderer draws these paths inline (each part its own element, coloured from the config), and
5
+ * `tools/export-paper-fold-assets.ts` writes the same geometry out as standalone SVG files — so the files
6
+ * and the video cannot drift apart. Nothing here is traced from the reference raster.
7
+ *
8
+ * **Hands** are built from an anatomical skeleton and drawn as an editorial vector illustration:
9
+ * - a forearm that widens from the wrist to the muscle belly, sharing its wrist edge with the palm;
10
+ * - the back of the hand (palm) with the four knuckles (metacarpal heads) in an arc;
11
+ * - four fingers, each ONE continuous silhouette — its base inside the palm, the knuckle, three
12
+ * phalanges tapering to a rounded tip — with a knuckle bulge on the convex side of each bend and a
13
+ * slight pinch on the concave side, instead of drawn joint lines;
14
+ * - the thumb, an opposing digit rooted in the thenar region at the side of the palm;
15
+ * - layered shading: midtones on turned-away surfaces, shadows under and between fingers, under the
16
+ * thumb and at the wrist, highlights on knuckles and lit edges, subtle nails.
17
+ * Every part is named (forearm, palm, thumb, indexFinger, middleFinger, ringFinger, littleFinger,
18
+ * fingerShadows, palmShadow, highlights, nails) and placed `behind` the paper or in `front` of it.
19
+ *
20
+ * Hand coordinates are "hand units": the reference sheet is 600 units wide and the hand's grip anchor
21
+ * is (0, 0) — the point that sits on the paper's grip anchor. The renderer scales hand units with the
22
+ * sheet, so the hands keep their size relative to the paper in every layout.
23
+ */
24
+ export type P = [number, number];
25
+ export type HandPartName = 'forearm' | 'sleeve' | 'palm' | 'thumb' | 'indexFinger' | 'middleFinger' | 'ringFinger' | 'littleFinger' | 'fingerShadows' | 'palmShadow' | 'highlights' | 'nails';
26
+ export type HandFill = 'base' | 'midtone' | 'shadow' | 'highlight' | 'nail' | 'sleeve';
27
+ export type HandShape = { d: string; fill: HandFill; opacity?: number; /** Part of the silhouette (gets hands.style.outlineWidth). */ outline?: boolean };
28
+ /** `grips`: a digit holding the paper from behind it — once that panel turns over, it shows only where it lies on the panel. */
29
+ export type HandPart = { name: HandPartName; layer: 'behind' | 'front'; shapes: HandShape[]; grips?: boolean };
30
+ export type HandArt = {
31
+ /** In drawing order within each layer. */
32
+ parts: HandPart[];
33
+ /** Skeleton joints per digit (root in the palm, knuckle, two finger joints, tip), for tests and the debug overlay. */
34
+ joints: Record<string, P[]>;
35
+ /** The palm's outline points and the wrist edge it shares with the forearm. */
36
+ palmOutline: P[];
37
+ wristEdge: [P, P];
38
+ /** The forearm's wrist end (equal to wristEdge: the wrist flows into the forearm). */
39
+ forearmStart: [P, P];
40
+ /** The hand's grip anchor (always (0, 0)). */
41
+ gripAnchor: P;
42
+ wrist: { at: P; toward: P; width: number };
43
+ };
44
+ export type HandPose = {
45
+ armLength: number;
46
+ /** Degrees the gripping digit is opened away from the paper (the grip animation). */
47
+ open: number;
48
+ /** Degrees the hand turns against the forearm about the wrist. */
49
+ wrist: number;
50
+ fingerCurl: number;
51
+ thumbBend: number;
52
+ thumbRotation: number;
53
+ thumbScale: number;
54
+ thumbX: number;
55
+ thumbY: number;
56
+ nails: boolean;
57
+ nailScale: number;
58
+ };
59
+ export const DEFAULT_POSE: HandPose = { armLength: 1500, open: 0, wrist: 0, fingerCurl: 1, thumbBend: 0, thumbRotation: 0, thumbScale: 1, thumbX: 0, thumbY: 0, nails: true, nailScale: 1 };
60
+
61
+ const f = (v: number) => Math.round(v * 10) / 10;
62
+ const pt = ([x, y]: P) => `${f(x)} ${f(y)}`;
63
+ const unit = (x: number, y: number): P => { const l = Math.hypot(x, y) || 1; return [x / l, y / l]; };
64
+ const add = (a: P, b: P): P => [a[0] + b[0], a[1] + b[1]];
65
+ const sub = (a: P, b: P): P => [a[0] - b[0], a[1] - b[1]];
66
+ const mulv = (a: P, k: number): P => [a[0] * k, a[1] * k];
67
+ const dir = (deg: number): P => [Math.cos((deg * Math.PI) / 180), Math.sin((deg * Math.PI) / 180)];
68
+ const lerpP = (a: P, b: P, t: number): P => [a[0] + (b[0] - a[0]) * t, a[1] + (b[1] - a[1]) * t];
69
+ const rot = (p: P, about: P, deg: number): P => {
70
+ const c = Math.cos((deg * Math.PI) / 180), s = Math.sin((deg * Math.PI) / 180), d = sub(p, about);
71
+ return [about[0] + d[0] * c - d[1] * s, about[1] + d[0] * s + d[1] * c];
72
+ };
73
+
74
+ /** Cubic segments through `pts` (open Catmull–Rom), continuing a path already at pts[0]. */
75
+ function through(pts: P[]): string {
76
+ let d = '';
77
+ for (let i = 0; i < pts.length - 1; i++) {
78
+ const p0 = pts[Math.max(0, i - 1)]!, p1 = pts[i]!, p2 = pts[i + 1]!, p3 = pts[Math.min(pts.length - 1, i + 2)]!;
79
+ d += ` C ${pt(add(p1, mulv(sub(p2, p0), 1 / 6)))} ${pt(sub(p2, mulv(sub(p3, p1), 1 / 6)))} ${pt(p2)}`;
80
+ }
81
+ return d;
82
+ }
83
+ /** A smooth closed outline through `points`. */
84
+ function smoothClosed(points: P[]): string {
85
+ const k = points.length;
86
+ let d = `M ${pt(points[0]!)}`;
87
+ for (let i = 0; i < k; i++) {
88
+ const p0 = points[(i - 1 + k) % k]!, p1 = points[i]!, p2 = points[(i + 1) % k]!, p3 = points[(i + 2) % k]!;
89
+ d += ` C ${pt(add(p1, mulv(sub(p2, p0), 1 / 6)))} ${pt(sub(p2, mulv(sub(p3, p1), 1 / 6)))} ${pt(p2)}`;
90
+ }
91
+ return `${d} Z`;
92
+ }
93
+
94
+ /**
95
+ * The forearm: from the wrist's two sides (`a`, `b`) it widens quickly to the muscle belly (× `flare`, a
96
+ * quarter of the way along), then runs on almost straight to `length` along `toward` — narrowest at the
97
+ * wrist, fullest below the elbow. It starts exactly on the palm's wrist edge.
98
+ */
99
+ function forearm(a: P, b: P, toward: P, length: number, flare: number): string {
100
+ const [tx, ty] = toward;
101
+ const mid = lerpP(a, b, 0.5);
102
+ const half = Math.hypot(a[0] - b[0], a[1] - b[1]) / 2;
103
+ const nx = -ty, ny = tx;
104
+ const sa = Math.sign((a[0] - mid[0]) * nx + (a[1] - mid[1]) * ny) || 1;
105
+ const at = (along: number, side: number, w: number): P => [mid[0] + tx * along + nx * side * w, mid[1] + ty * along + ny * side * w];
106
+ const belly = Math.min(length * 0.25, half * 3.2);
107
+ return `M ${pt(a)} C ${pt(at(belly * 0.45, sa, half * 1.02))} ${pt(at(belly * 0.7, sa, half * flare))} ${pt(at(belly, sa, half * flare))}`
108
+ + ` L ${pt(at(length, sa, half * flare * 1.04))} L ${pt(at(length, -sa, half * flare * 1.04))} L ${pt(at(belly, -sa, half * flare))}`
109
+ + ` C ${pt(at(belly * 0.7, -sa, half * flare))} ${pt(at(belly * 0.45, -sa, half * 1.02))} ${pt(b)} Z`;
110
+ }
111
+
112
+ /* ─── digits ──────────────────────────────────────────────────────────────────────────────────── */
113
+ /** A digit's skeleton: its root (inside the palm), knuckle, and three segments by screen angle and length. */
114
+ type DigitSpec = { root: P; knuckle: P; angles: [number, number, number]; lengths: [number, number, number]; /** Half-widths at root, knuckle, the two joints, the tip. */ widths: [number, number, number, number, number] };
115
+ function joints(d: DigitSpec): P[] {
116
+ const out: P[] = [d.root, d.knuckle];
117
+ d.angles.forEach((a, i) => out.push(add(out[i + 1]!, mulv(dir(a), d.lengths[i]!))));
118
+ return out;
119
+ }
120
+ /**
121
+ * One continuous silhouette along joints J0..J4 with half-widths w0..w4: offsets along the bisecting
122
+ * normal at each joint, a knuckle bulge on the convex side of a bend and a slight pinch on the concave
123
+ * side, a rounded tip. `from`/`to` cut a sub-range (for a shading overlay on part of the digit); `side`
124
+ * keeps one side only, inset to `inset` of the width (a shading strip).
125
+ */
126
+ function digitOutline(j: P[], w: number[], opts: { from?: number; to?: number; side?: 1 | -1; inset?: number; tip?: boolean } = {}): string {
127
+ const n = j.length;
128
+ const from = opts.from ?? 0, to = opts.to ?? n - 1;
129
+ const normals: P[] = [], scaleL: number[] = [], scaleR: number[] = [];
130
+ for (let i = 0; i < n; i++) {
131
+ const a = i > 0 ? unit(...sub(j[i]!, j[i - 1]!)) : unit(...sub(j[1]!, j[0]!));
132
+ const b = i < n - 1 ? unit(...sub(j[i + 1]!, j[i]!)) : a;
133
+ const t = unit(a[0] + b[0], a[1] + b[1]);
134
+ normals.push([-t[1], t[0]]);
135
+ // Bend at this joint: its sign says which side is convex (the knuckle).
136
+ const cross = a[0] * b[1] - a[1] * b[0];
137
+ const bend = Math.min(1, Math.abs(Math.asin(Math.max(-1, Math.min(1, cross)))) / 1.2);
138
+ const miter = Math.min(1.35, 1 / Math.max(0.6, Math.cos(Math.acos(Math.max(-1, Math.min(1, a[0] * b[0] + a[1] * b[1]))) / 2)));
139
+ const convexLeft = cross < 0;
140
+ scaleL.push((convexLeft ? 1 + 0.12 * bend : 1 - 0.1 * bend) * (convexLeft ? miter : 1));
141
+ scaleR.push((convexLeft ? 1 - 0.1 * bend : 1 + 0.12 * bend) * (convexLeft ? 1 : miter));
142
+ }
143
+ const L: P[] = [], R: P[] = [];
144
+ for (let i = from; i <= to; i++) {
145
+ L.push(add(j[i]!, mulv(normals[i]!, w[i]! * scaleL[i]!)));
146
+ R.push(sub(j[i]!, mulv(normals[i]!, w[i]! * scaleR[i]!)));
147
+ }
148
+ if (opts.side) {
149
+ // A strip along one side: the edge and a line inset toward the axis.
150
+ const edge = opts.side === 1 ? L : R;
151
+ // The inner line meets the edge at both ends, so the strip tapers to a point instead of ending square.
152
+ const inner: P[] = [];
153
+ for (let i = from; i <= to; i++) {
154
+ const k = i === from || i === to ? 0.97 : (opts.inset ?? 0.4);
155
+ inner.push(add(j[i]!, mulv(normals[i]!, opts.side * w[i]! * k * (opts.side === 1 ? scaleL[i]! : scaleR[i]!))));
156
+ }
157
+ return `M ${pt(edge[0]!)}${through(edge)} L ${pt(inner.at(-1)!)}${through([...inner].reverse())} Z`;
158
+ }
159
+ const tipOn = opts.tip ?? to === n - 1;
160
+ const r = w[to]!;
161
+ let d = `M ${pt(R[0]!)}${through(R)}`;
162
+ if (tipOn) {
163
+ const u = unit(...sub(j[to]!, j[to - 1]!));
164
+ const cap = add(j[to]!, mulv(u, r));
165
+ // A rounded fingertip: two quarter curves around the tip.
166
+ d += ` C ${pt(add(R.at(-1)!, mulv(u, r * 0.55)))} ${pt(sub(cap, mulv(normals[to]!, -r * 0.55 * -1)))} ${pt(cap)}`;
167
+ d += ` C ${pt(add(cap, mulv(normals[to]!, r * 0.55)))} ${pt(add(L.at(-1)!, mulv(u, r * 0.55)))} ${pt(L.at(-1)!)}`;
168
+ } else d += ` L ${pt(L.at(-1)!)}`;
169
+ d += through([...L].reverse());
170
+ return `${d} Z`;
171
+ }
172
+ /** A fingernail on the last segment, facing the viewer: rounded, slightly narrower than the fingertip. */
173
+ function nail(j: P[], w: number[], scale: number): string {
174
+ const a = j[3]!, b = j[4]!, r = w[4]! * scale;
175
+ const u = unit(...sub(b, a)), nrm: P = [-u[1], u[0]];
176
+ const base = lerpP(a, b, 0.42), end = add(b, mulv(u, r * 0.55));
177
+ const hw = r * 0.62;
178
+ return `M ${pt(add(base, mulv(nrm, hw * 0.9)))} C ${pt(add(lerpP(base, end, 0.5), mulv(nrm, hw * 1.05)))} ${pt(add(end, mulv(nrm, hw * 0.9)))} ${pt(add(end, mulv(u, hw * 0.25)))}`
179
+ + ` C ${pt(sub(end, mulv(nrm, hw * 0.9)))} ${pt(sub(lerpP(base, end, 0.5), mulv(nrm, hw * 1.05)))} ${pt(sub(base, mulv(nrm, hw * 0.9)))}`
180
+ + ` Q ${pt(sub(base, mulv(u, hw * 0.35)))} ${pt(add(base, mulv(nrm, hw * 0.9)))} Z`;
181
+ }
182
+ /** A rotated ellipse (knuckle heads). */
183
+ function ellipse(c: P, rx: number, ry: number, deg: number): string {
184
+ const a = add(c, rot([rx, 0], [0, 0], deg)), b = sub(c, rot([rx, 0], [0, 0], deg));
185
+ return `M ${pt(a)} A ${f(rx)} ${f(ry)} ${f(deg)} 1 0 ${pt(b)} A ${f(rx)} ${f(ry)} ${f(deg)} 1 0 ${pt(a)} Z`;
186
+ }
187
+ /** Which side of a digit faces away from the light (the shadow side): +1 = its left offset, −1 = its right. */
188
+ function shadowSide(j: P[], light: P): 1 | -1 {
189
+ const u = unit(...sub(j[3]!, j[1]!));
190
+ const left: P = [-u[1], u[0]];
191
+ return left[0] * light[0] + left[1] * light[1] < 0 ? 1 : -1;
192
+ }
193
+
194
+ type HandSpec = {
195
+ wrist: [P, P]; toward: P; flare: number;
196
+ palm: P[];
197
+ knuckles: P[];
198
+ /** Index, middle, ring, little. */
199
+ fingers: Record<'indexFinger' | 'middleFinger' | 'ringFinger' | 'littleFinger', DigitSpec & { layer: 'behind' | 'front'; curled?: boolean; hidden?: boolean }>;
200
+ thumb: DigitSpec & { layer: 'behind' | 'front' };
201
+ light: P;
202
+ palmShadow: P[][];
203
+ palmHighlight: P[][];
204
+ /** The digit whose tip is the grip anchor, and where that tip sits relative to the anchor. */
205
+ anchor: { digit: 'indexFinger' | 'thumb'; offset: P };
206
+ /** Which way opening the grip turns the gripping digits (+1 clockwise on screen). */
207
+ openSign: 1 | -1;
208
+ gripping: ('indexFinger' | 'middleFinger' | 'thumb')[];
209
+ };
210
+
211
+ function pose(d: DigitSpec, curl: number, extraBend: number, openDeg: number, rotDeg = 0, scale = 1, shift: P = [0, 0]): DigitSpec {
212
+ const [a1, a2, a3] = d.angles;
213
+ const sign = Math.sign(a3 - a1) || 1;
214
+ const angles: [number, number, number] = [
215
+ a1 + openDeg + rotDeg,
216
+ a1 + (a2 - a1) * curl + sign * extraBend * 18 + openDeg + rotDeg,
217
+ a1 + (a3 - a1) * curl + sign * extraBend * 34 + openDeg + rotDeg,
218
+ ];
219
+ const knuckle = rot(add(d.knuckle, shift), add(d.root, shift), rotDeg);
220
+ return { root: add(d.root, shift), knuckle, angles, lengths: d.lengths.map((l) => l * scale) as DigitSpec['lengths'], widths: d.widths.map((w) => w * scale) as DigitSpec['widths'] };
221
+ }
222
+
223
+ /** The hand turned against the forearm about the wrist's centre: palm, knuckles, digits and shading. */
224
+ function bendWrist(spec: HandSpec, deg: number): HandSpec {
225
+ if (!deg) return spec;
226
+ const c = lerpP(spec.wrist[0], spec.wrist[1], 0.5);
227
+ const r = (q: P) => rot(q, c, deg);
228
+ const digit = <D extends DigitSpec>(d: D): D => ({ ...d, root: r(d.root), knuckle: r(d.knuckle), angles: d.angles.map((a) => a + deg) as DigitSpec['angles'] });
229
+ return {
230
+ ...spec,
231
+ wrist: [r(spec.wrist[0]), r(spec.wrist[1])],
232
+ palm: spec.palm.map(r), knuckles: spec.knuckles.map(r),
233
+ palmShadow: spec.palmShadow.map((q) => q.map(r)), palmHighlight: spec.palmHighlight.map((q) => q.map(r)),
234
+ fingers: Object.fromEntries(Object.entries(spec.fingers).map(([k, d]) => [k, digit(d)])) as HandSpec['fingers'],
235
+ thumb: digit(spec.thumb),
236
+ };
237
+ }
238
+
239
+ function build(rawSpec: HandSpec, p: HandPose): HandArt {
240
+ const spec = bendWrist(rawSpec, p.wrist);
241
+ const fingers = Object.fromEntries(Object.entries(spec.fingers).map(([name, d]) => {
242
+ const gripping = spec.gripping.includes(name as 'indexFinger');
243
+ return [name, { ...d, posed: pose(d, p.fingerCurl, 0, gripping ? spec.openSign * p.open : 0) }];
244
+ })) as Record<keyof HandSpec['fingers'], HandSpec['fingers'][keyof HandSpec['fingers']] & { posed: DigitSpec }>;
245
+ const thumbPosed = pose(spec.thumb, 1, p.thumbBend, spec.gripping.includes('thumb') ? spec.openSign * p.open : 0, p.thumbRotation, p.thumbScale, [p.thumbX, p.thumbY]);
246
+ // Place the grip anchor at (0, 0): shift everything so the anchoring tip — posed, with the grip
247
+ // closed — sits at its offset. Opening the grip then lifts the tip off the anchor, as it should.
248
+ const closed = spec.anchor.digit === 'thumb'
249
+ ? pose(spec.thumb, 1, p.thumbBend, 0, p.thumbRotation, p.thumbScale, [p.thumbX, p.thumbY])
250
+ : pose(spec.fingers[spec.anchor.digit], p.fingerCurl, 0, 0);
251
+ const shift = sub(spec.anchor.offset, joints(closed)[4]!);
252
+ const m = (q: P): P => add(q, shift);
253
+ const J = (d: DigitSpec) => joints(d).map(m);
254
+
255
+ const parts: HandPart[] = [];
256
+ const shapes = (name: HandPartName, layer: 'behind' | 'front', s: HandShape[], grips = false) => { if (s.length) parts.push({ name, layer, shapes: s, ...(grips ? { grips } : {}) }); };
257
+ const wrist: [P, P] = [m(spec.wrist[0]), m(spec.wrist[1])];
258
+ shapes('forearm', 'behind', [{ d: forearm(wrist[0], wrist[1], spec.toward, p.armLength, spec.flare), fill: 'base', outline: true }]);
259
+
260
+ const jointMap: Record<string, P[]> = {};
261
+ const fingerShadowsBehind: HandShape[] = [], fingerShadowsFront: HandShape[] = [];
262
+ const highlightsBehind: HandShape[] = [], highlightsFront: HandShape[] = [];
263
+ const nails: HandShape[] = [];
264
+ const digit = (name: HandPartName, d: DigitSpec, layer: 'behind' | 'front', kind: 'lit' | 'curled' | 'hidden', grips = false) => {
265
+ const j = J(d), w = d.widths;
266
+ jointMap[name] = j;
267
+ const out: HandShape[] = [{ d: digitOutline(j, w), fill: kind === 'hidden' ? 'shadow' : 'base', outline: kind !== 'hidden' }];
268
+ // Turned under past the middle joint: in half-shadow.
269
+ if (kind === 'curled') out.push({ d: digitOutline(j, w, { from: 2 }), fill: 'midtone' });
270
+ shapes(name, layer, out, grips);
271
+ const side = shadowSide(j, spec.light);
272
+ const own = { shadows: [] as HandShape[], lights: [] as HandShape[] };
273
+ const shadows = grips ? own.shadows : layer === 'front' ? fingerShadowsFront : fingerShadowsBehind;
274
+ const lights = grips ? own.lights : layer === 'front' ? highlightsFront : highlightsBehind;
275
+ const flush = () => { if (grips) { shapes('fingerShadows', layer, own.shadows, true); shapes('highlights', layer, own.lights, true); } };
276
+ if (kind === 'hidden') {
277
+ lights.push({ d: digitOutline(j, w, { from: 1, side: (-side) as 1 | -1, inset: 0.72 }), fill: 'midtone', opacity: 0.9 });
278
+ flush();
279
+ return;
280
+ }
281
+ shadows.push({ d: digitOutline(j, w, { from: 1, side, inset: 0.3 }), fill: 'midtone', opacity: 0.9 });
282
+ lights.push({ d: digitOutline(j, w, { from: 1, to: 3, side: (-side) as 1 | -1, inset: 0.66 }), fill: 'highlight', opacity: 0.5 });
283
+ if (layer === 'front' && p.nails) nails.push({ d: nail(j, w, p.nailScale), fill: 'nail' });
284
+ flush();
285
+ };
286
+
287
+ // Behind the paper, back to front: the thumb and folded fingers sit under the palm.
288
+ const behindFingers = (['littleFinger', 'ringFinger', 'middleFinger', 'indexFinger'] as const).filter((k) => fingers[k].layer === 'behind');
289
+ // Digits behind the sheet that are not folded into the palm are holding it from behind.
290
+ if (spec.thumb.layer === 'behind') digit('thumb', thumbPosed, 'behind', 'lit', true);
291
+ for (const k of behindFingers) digit(k, fingers[k].posed, 'behind', fingers[k].hidden ? 'hidden' : fingers[k].curled ? 'curled' : 'lit', !fingers[k].curled);
292
+ const palm = spec.palm.map(m);
293
+ shapes('palm', 'behind', [{ d: smoothClosed(palm), fill: 'base', outline: true }]);
294
+ shapes('palmShadow', 'behind', spec.palmShadow.map((q) => ({ d: smoothClosed(q.map(m)), fill: 'midtone' as HandFill, opacity: 0.85 })));
295
+ // Knuckles: the metacarpal heads catch the light on the back of the hand.
296
+ for (const k of spec.knuckles) highlightsBehind.push({ d: ellipse(add(m(k), mulv(spec.light, 5)), 12, 8, Math.atan2(spec.light[1], spec.light[0]) * 57.3 + 90), fill: 'highlight', opacity: 0.6 });
297
+ for (const q of spec.palmHighlight) highlightsBehind.push({ d: smoothClosed(q.map(m)), fill: 'highlight', opacity: 0.8 });
298
+ shapes('fingerShadows', 'behind', fingerShadowsBehind);
299
+ shapes('highlights', 'behind', highlightsBehind);
300
+
301
+ // In front of the paper: the gripping digits, their shading and nails.
302
+ if (spec.thumb.layer === 'front') digit('thumb', thumbPosed, 'front', 'lit');
303
+ for (const k of (['littleFinger', 'ringFinger', 'middleFinger', 'indexFinger'] as const).filter((q) => fingers[q].layer === 'front')) digit(k, fingers[k].posed, 'front', 'lit');
304
+ shapes('fingerShadows', 'front', fingerShadowsFront);
305
+ shapes('highlights', 'front', highlightsFront);
306
+ shapes('nails', 'front', nails);
307
+
308
+ return {
309
+ parts, joints: jointMap, palmOutline: palm, wristEdge: wrist, forearmStart: wrist, gripAnchor: [0, 0],
310
+ wrist: { at: lerpP(wrist[0], wrist[1], 0.5), toward: spec.toward, width: Math.hypot(...sub(wrist[0], wrist[1])) },
311
+ };
312
+ }
313
+
314
+ /**
315
+ * The top hand — a left hand seen from its back, reaching in from the upper left (the reference pose).
316
+ * Palm about as long as the middle finger; middle finger longest, index ≈ ring, little finger to the
317
+ * ring finger's last joint. Index and middle fingers curl over the sheet's top edge onto its front,
318
+ * nails toward the viewer; ring and little fingers fold into the palm; the thumb pinches from behind
319
+ * the sheet, rooted at the side of the palm.
320
+ */
321
+ const TOP: HandSpec = {
322
+ // Proportions after the reference sheet: a wrist about three quarters of the palm's width, a palm
323
+ // about as long as the middle finger, slender fingers (each about a quarter of the palm's width).
324
+ wrist: [[-236, -194], [-232, -122]], toward: unit(-0.93, 0.36), flare: 1.26,
325
+ palm: [[-236, -194], [-186, -214], [-116, -222], [-66, -214], [-42, -194], [-32, -160], [-34, -126], [-46, -100], [-86, -92], [-150, -98], [-200, -110], [-232, -122]],
326
+ knuckles: [[-54, -200], [-40, -172], [-34, -142], [-40, -112]],
327
+ fingers: {
328
+ littleFinger: { root: [-78, -198], knuckle: [-54, -200], angles: [26, 104, 176], lengths: [36, 24, 10], widths: [11.5, 12, 11, 10, 9], layer: 'behind', curled: true },
329
+ ringFinger: { root: [-64, -172], knuckle: [-40, -172], angles: [20, 98, 172], lengths: [46, 30, 14], widths: [13, 13.5, 12.5, 11.5, 10], layer: 'behind', curled: true },
330
+ middleFinger: { root: [-58, -142], knuckle: [-34, -142], angles: [16, 52, 80], lengths: [80, 56, 42], widths: [14, 14.5, 13.5, 12.5, 11], layer: 'front' },
331
+ indexFinger: { root: [-64, -112], knuckle: [-40, -112], angles: [22, 58, 86], lengths: [72, 50, 38], widths: [14, 14, 13, 12, 10.5], layer: 'front' },
332
+ },
333
+ thumb: { root: [-150, -108], knuckle: [-124, -100], angles: [36, 50, 62], lengths: [64, 50, 38], widths: [21, 20, 17.5, 15.5, 13.5], layer: 'behind' },
334
+ light: unit(-0.35, -1),
335
+ palmShadow: [
336
+ [[-232, -122], [-200, -110], [-150, -98], [-86, -92], [-46, -100], [-66, -110], [-130, -112], [-196, -124]],
337
+ ],
338
+ palmHighlight: [[[-222, -190], [-156, -212], [-80, -208], [-94, -198], [-156, -204], [-208, -184]]],
339
+ anchor: { digit: 'indexFinger', offset: [0, 16] },
340
+ openSign: -1,
341
+ gripping: ['indexFinger', 'middleFinger'],
342
+ };
343
+
344
+ /**
345
+ * The bottom hand — a right hand seen from its thumb side, rising from the lower left: the thumb up over
346
+ * the sheet's front (nail toward the viewer), rooted in the full thenar pad at the side of the palm;
347
+ * the four fingers behind the sheet, dark where their roots show below its edge.
348
+ */
349
+ const BOTTOM: HandSpec = {
350
+ wrist: [[-146, 334], [-22, 350]], toward: unit(-0.6, 0.8), flare: 1.12,
351
+ palm: [[-146, 334], [-150, 252], [-142, 198], [-104, 174], [-50, 162], [0, 158], [30, 176], [40, 230], [42, 296], [-22, 350]],
352
+ knuckles: [],
353
+ fingers: {
354
+ littleFinger: { root: [-122, 222], knuckle: [-120, 196], angles: [-100, -96, -94], lengths: [60, 38, 28], widths: [14, 14, 13, 12, 10.5], layer: 'behind', hidden: true },
355
+ ringFinger: { root: [-88, 206], knuckle: [-86, 180], angles: [-96, -94, -92], lengths: [74, 48, 34], widths: [15.5, 15.5, 14.5, 13, 11.5], layer: 'behind', hidden: true },
356
+ middleFinger: { root: [-52, 196], knuckle: [-50, 170], angles: [-94, -92, -90], lengths: [82, 54, 38], widths: [16, 16, 15, 13.5, 12], layer: 'behind', hidden: true },
357
+ indexFinger: { root: [-16, 192], knuckle: [-14, 166], angles: [-92, -90, -88], lengths: [74, 48, 34], widths: [15.5, 15.5, 14.5, 13, 11.5], layer: 'behind', hidden: true },
358
+ },
359
+ thumb: { root: [8, 300], knuckle: [34, 268], angles: [-66, -88, -96], lengths: [76, 58, 42], widths: [28, 30, 24.5, 21, 17], layer: 'front' },
360
+ light: unit(-0.6, -1),
361
+ palmShadow: [
362
+ [[-146, 334], [-150, 252], [-142, 198], [-116, 196], [-122, 270], [-118, 334]],
363
+ // Under the thumb, where it leaves the thenar pad.
364
+ [[24, 236], [34, 290], [18, 306], [12, 262]],
365
+ ],
366
+ palmHighlight: [[[20, 190], [34, 230], [36, 290], [24, 300], [26, 236]]],
367
+ anchor: { digit: 'thumb', offset: [0, -14] },
368
+ openSign: 1,
369
+ gripping: ['thumb'],
370
+ };
371
+
372
+ export const HAND_SPECS = { top: TOP, bottom: BOTTOM };
373
+ export function topHand(p: Partial<HandPose> = {}): HandArt { return build(TOP, { ...DEFAULT_POSE, ...p }); }
374
+ export function bottomHand(p: Partial<HandPose> = {}): HandArt { return build(BOTTOM, { ...DEFAULT_POSE, ...p }); }
375
+
376
+ /** A sleeve over the forearm: a band from the cuff (at `position` along the arm) to the arm's far end. */
377
+ export function sleevePath(art: HandArt, position: number, armLength: number): string {
378
+ const { at, toward, width } = art.wrist;
379
+ const [tx, ty] = toward, nx = -ty, ny = tx;
380
+ const d = position * armLength;
381
+ const h = (width / 2) * 1.5;
382
+ const c: P = [at[0] + tx * d, at[1] + ty * d];
383
+ const e: P = [at[0] + tx * (armLength + 40), at[1] + ty * (armLength + 40)];
384
+ const q = (o: P, s: number): P => [o[0] + nx * h * s, o[1] + ny * h * s];
385
+ return `M ${pt(q(c, 1))} L ${pt(q(e, 1.05))} L ${pt(q(e, -1.05))} L ${pt(q(c, -1))} Z`;
386
+ }
387
+
388
+ /* ─── standalone SVG assets (tools/export-paper-fold-assets.ts) ──────────────────────────────── */
389
+ export const REFERENCE_HAND_COLOURS: Record<HandFill, string> = { base: '#873a1c', midtone: '#7a3217', shadow: '#5e260b', highlight: '#9d4b26', nail: '#e57953', sleeve: '#1f2a44' };
390
+ const esc = (s: string) => s.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;').replace(/"/g, '&quot;');
391
+ const shapeSvg = (s: HandShape, colours: Record<HandFill, string>) => `<path d="${s.d}" fill="${colours[s.fill]}"${s.opacity !== undefined && s.opacity < 1 ? ` fill-opacity="${s.opacity}"` : ''}/>`;
392
+ const partSvg = (p: HandPart, colours: Record<HandFill, string>) => `<g id="${p.name}" data-layer="${p.layer}">${p.shapes.map((s) => shapeSvg(s, colours)).join('')}</g>`;
393
+ const svgDoc = (viewBox: string, body: string, title: string) =>
394
+ `<svg xmlns="http://www.w3.org/2000/svg" viewBox="${viewBox}"><title>${esc(title)}</title>${body}</svg>\n`;
395
+ const HAND_VIEW = { top: '-760 -300 900 520', bottom: '-420 -140 560 780' };
396
+
397
+ /** top-hand.svg / bottom-hand.svg: the whole hand, one group per anatomical part, behind-the-paper parts first. */
398
+ export function handSvg(which: 'top' | 'bottom', colours = REFERENCE_HAND_COLOURS): string {
399
+ const art = which === 'top' ? topHand({ armLength: 600 }) : bottomHand({ armLength: 520 });
400
+ const ordered = [...art.parts.filter((p) => p.layer === 'behind'), ...art.parts.filter((p) => p.layer === 'front')];
401
+ return svgDoc(HAND_VIEW[which], ordered.map((p) => partSvg(p, colours)).join(''), `paper-fold-promo — ${which} hand (grip anchor at 0,0)`);
402
+ }
403
+ /** hand-top.svg / hand-bottom.svg: only the parts behind the paper. */
404
+ export function handBodySvg(which: 'top' | 'bottom', colours = REFERENCE_HAND_COLOURS): string {
405
+ const art = which === 'top' ? topHand({ armLength: 600 }) : bottomHand({ armLength: 520 });
406
+ return svgDoc(HAND_VIEW[which], art.parts.filter((p) => p.layer === 'behind').map((p) => partSvg(p, colours)).join(''), `paper-fold-promo — ${which} hand, behind the paper`);
407
+ }
408
+ /** hand-top-finger.svg / hand-bottom-finger.svg: only the gripping digits in front of the paper. */
409
+ export function handFingerSvg(which: 'top' | 'bottom', colours = REFERENCE_HAND_COLOURS): string {
410
+ const art = which === 'top' ? topHand({ armLength: 600 }) : bottomHand({ armLength: 520 });
411
+ return svgDoc(HAND_VIEW[which], art.parts.filter((p) => p.layer === 'front').map((p) => partSvg(p, colours)).join(''), `paper-fold-promo — ${which} hand, gripping ${which === 'top' ? 'fingers' : 'thumb'} in front of the paper`);
412
+ }
413
+
414
+ /** The flat, open sheet in the reference proportions: 600 × 857 units, creases at 0.333 and 0.655. */
415
+ export const REFERENCE_SHEET = { width: 600, height: 857, creases: [0.333, 0.655] as const, colour: '#7b3fb9', secondary: '#7036ac', crease: '#2c0f52', highlight: '#c9a0ff' };
416
+ const creaseLines = (W: number, ys: number[]) => ys.map((y) => `<rect x="0" y="${f(y - 1.5)}" width="${W}" height="3" fill="${REFERENCE_SHEET.crease}" fill-opacity="0.45"/>`).join('');
417
+ /** paper-sheet.svg: ONE sheet — its three regions and two creases in the same coordinate system. */
418
+ export function paperSheetSvg(): string {
419
+ const { width: W, height: H, creases: [a, b], colour, secondary } = REFERENCE_SHEET;
420
+ return svgDoc(`0 0 ${W} ${H}`, [
421
+ `<defs><linearGradient id="g" x1="0" y1="0" x2="0.18" y2="1"><stop offset="0" stop-color="${colour}"/><stop offset="1" stop-color="${secondary}"/></linearGradient></defs>`,
422
+ `<g id="sheet"><rect width="${W}" height="${H}" rx="2" fill="url(#g)"/>`,
423
+ `<g id="regions"><rect id="top" x="0" y="0" width="${W}" height="${f(a * H)}" fill="none"/><rect id="middle" x="0" y="${f(a * H)}" width="${W}" height="${f((b - a) * H)}" fill="none"/><rect id="bottom" x="0" y="${f(b * H)}" width="${W}" height="${f((1 - b) * H)}" fill="none"/></g>`,
424
+ `<g id="creases">${creaseLines(W, [a * H, b * H])}</g></g>`,
425
+ ].join(''), 'paper-fold-promo — the open sheet (regions and creases)');
426
+ }
427
+ /** paper-top.svg / paper-middle.svg / paper-bottom.svg: one region, cut from the same sheet coordinates. */
428
+ export function paperSvg(part: 'base' | 'top' | 'middle' | 'bottom'): string {
429
+ if (part === 'base') return paperSheetSvg();
430
+ const { width: W, height: H, creases: [a, b], colour } = REFERENCE_SHEET;
431
+ const spans = { top: [0, a * H], middle: [a * H, b * H], bottom: [b * H, H] } as const;
432
+ const [y0, y1] = spans[part];
433
+ return svgDoc(`0 ${f(y0)} ${W} ${f(y1 - y0)}`, `<rect x="0" y="${f(y0)}" width="${W}" height="${f(y1 - y0)}" fill="${colour}"/>`, `paper-fold-promo — ${part} region of the sheet`);
434
+ }
435
+ export function creaseSvg(): string {
436
+ const { width: W, crease, highlight } = REFERENCE_SHEET;
437
+ return svgDoc(`0 -6 ${W} 12`, `<rect x="0" y="-1.5" width="${W}" height="3" fill="${crease}" fill-opacity="0.55"/><rect x="0" y="1.5" width="${W}" height="1.6" fill="${highlight}" fill-opacity="0.35"/>`, 'paper-fold-promo — crease (line and ridge highlight)');
438
+ }
439
+ /** The logo mark (a rounded gradient tile with a letter) beside a wordmark; text stays text. */
440
+ export function logoSvg(word = 'brand', letter = 'B', colours = { from: '#5e4de6', to: '#7a5cff', letter: '#ffffff', word: '#ffffff' }): string {
441
+ return svgDoc('0 0 330 64', [
442
+ `<defs><linearGradient id="m" x1="0" y1="0" x2="1" y2="1"><stop offset="0" stop-color="${colours.from}"/><stop offset="1" stop-color="${colours.to}"/></linearGradient></defs>`,
443
+ '<rect x="2" y="3" width="58" height="58" rx="15" fill="url(#m)"/>',
444
+ `<text x="31" y="47" text-anchor="middle" font-family="Inter, sans-serif" font-weight="800" font-size="42" fill="${colours.letter}">${esc(letter)}</text>`,
445
+ `<text x="72" y="47" font-family="Inter, sans-serif" font-weight="600" font-size="52" letter-spacing="-1" fill="${colours.word}">${esc(word)}</text>`,
446
+ ].join(''), 'paper-fold-promo — logo');
447
+ }
448
+ /** The background word in rows; text stays text. */
449
+ export function backgroundTypeSvg(word = 'PROMO', rows = 9, colour = '#a05ce7', background = '#b46cff'): string {
450
+ const size = 262, pitch = size * 0.8;
451
+ return svgDoc(`0 0 1080 1920`, [
452
+ `<rect width="1080" height="1920" fill="${background}"/>`,
453
+ ...Array.from({ length: rows }, (_, i) => `<text x="-16" y="${f(-42 + i * pitch + size * 0.86)}" font-family="Inter, sans-serif" font-weight="700" font-size="${size}" letter-spacing="-7.9" fill="${colour}">${esc(word)}</text>`),
454
+ ].join(''), 'paper-fold-promo — background typography');
455
+ }
@@ -0,0 +1,98 @@
1
+ import { createConfigApi, getPath, isAssetRef, type ConfigError, type ConfigPatch, type Obj, type PatchOp } from '../configurable/config';
2
+ import { CONTROLS, LISTS, type AspectRatio } from './controls';
3
+
4
+ /**
5
+ * **The canonical configuration** of paper-fold-promo — one nested JSON object built from the control
6
+ * table (`controls.ts`) by the shared configurable-motion machinery. People (the Remotion Studio, the
7
+ * site editor) and agents (patches) read and write this same object; nothing else exists.
8
+ */
9
+ export const CONFIG_SCHEMA_ID = 'paper-fold-promo/1';
10
+ export type PaperFoldConfig = { schema?: typeof CONFIG_SCHEMA_ID } & { [group: string]: unknown };
11
+ export type { ConfigError, ConfigPatch, PatchOp };
12
+ export { getPath, isAssetRef };
13
+ const NAME = 'paper-fold-promo';
14
+
15
+ const RATIOS: Record<AspectRatio, number> = { '9:16': 9 / 16, '16:9': 16 / 9, '1:1': 1 };
16
+
17
+ type Fold = { id: string; enabled: boolean; direction: 'down' | 'up'; delayFrames: number; durationFrames: number; unfoldDelayFrames: number; unfoldDurationFrames: number };
18
+
19
+ /** Cross-field rules: the canvas shape, crease order, one panel that stays put, stops in order, a sane timeline. */
20
+ function relations(cfg: PaperFoldConfig, errors: ConfigError[]) {
21
+ const n = (p: string) => getPath(cfg, p) as number;
22
+ const ratio = RATIOS[getPath(cfg, 'canvas.aspectRatio') as AspectRatio];
23
+ if (ratio) {
24
+ const actual = n('canvas.width') / n('canvas.height');
25
+ if (Math.abs(actual / ratio - 1) > 0.01) errors.push({ path: 'canvas.width', message: `canvas.width × canvas.height (${n('canvas.width')} × ${n('canvas.height')}) does not match canvas.aspectRatio ${String(getPath(cfg, 'canvas.aspectRatio'))}. Set all three together (the portrait, landscape and square presets do).` });
26
+ }
27
+ const c0 = n('creases.0.position'), c1 = n('creases.1.position');
28
+ if (c1 - c0 < 0.1) errors.push({ path: 'creases.1.position', message: `creases.bottom.position (${c1}) must be at least 0.1 below creases.top.position (${c0}): every panel needs height.` });
29
+ const [top, bottom] = getPath(cfg, 'folds') as Fold[];
30
+ if (top!.enabled && bottom!.enabled && top!.direction === 'up' && bottom!.direction === 'down') {
31
+ errors.push({ path: 'folds.1.direction', message: 'folds.top.direction "up" swings the middle panel from the top crease while folds.bottom.direction "down" swings it from the bottom crease: one panel has to stay put. Use top down + bottom up (the middle stays), top up + bottom up (the top stays) or top down + bottom down (the bottom stays).' });
32
+ }
33
+ const stops = getPath(cfg, 'background.gradient.stops') as { offset: number }[];
34
+ for (let i = 1; i < stops.length; i++) {
35
+ if (stops[i]!.offset < stops[i - 1]!.offset) errors.push({ path: `background.gradient.stops.${i}.offset`, message: `background.gradient.stops must be in order of offset: stop ${i} (${stops[i]!.offset}) comes before stop ${i - 1} (${stops[i - 1]!.offset}).` });
36
+ }
37
+ // Phases run in order. A negative delay overlaps the phase before, but a phase may not start before
38
+ // frame 0 or before the phase ahead of it starts, and an unfold may not start before its fold ends.
39
+ const spans = phaseSpans(cfg);
40
+ let prev = 0;
41
+ for (const s of spans) {
42
+ if (s.start < 0) errors.push({ path: s.delayPath, message: `${s.label} would start at frame ${s.start}, before the video starts. Raise ${s.delayPath}.` });
43
+ else if (s.start < prev) errors.push({ path: s.delayPath, message: `${s.label} would start at frame ${s.start}, before the phase ahead of it (frame ${prev}). Phases run in order; raise ${s.delayPath} or the phase's startFrame.` });
44
+ prev = Math.max(prev, s.start);
45
+ }
46
+ const at = (id: string) => spans.find((s) => s.id === id)!;
47
+ for (const [fold, unfold, key] of [['topFold', 'topUnfold', 'top'], ['bottomFold', 'bottomUnfold', 'bottom']] as const) {
48
+ if (at(unfold).start < at(fold).end) errors.push({ path: `folds.${key === 'top' ? 0 : 1}.unfoldDelayFrames`, message: `The ${key} fold would start unfolding (frame ${at(unfold).start}) before it has finished folding (frame ${at(fold).end}).` });
49
+ }
50
+ }
51
+
52
+ /**
53
+ * The seven phases in order with their start and end (60 fps motion frames, before motion.speed).
54
+ * Pure; also used by the engine, so the validator and the renderer agree on every phase boundary.
55
+ */
56
+ export function phaseSpans(cfg: PaperFoldConfig) {
57
+ const n = (p: string) => getPath(cfg, p) as number;
58
+ const folds = getPath(cfg, 'folds') as Fold[];
59
+ const fold = (k: 0 | 1) => folds[k]!;
60
+ const spec = [
61
+ { id: 'intro', label: 'INTRO', start: 'timeline.intro.startFrame', delay: 'timeline.intro.delayFrames', duration: () => n('timeline.intro.durationFrames') },
62
+ { id: 'topFold', label: 'TOP_FOLD', start: 'timeline.topFold.startFrame', delay: 'folds.0.delayFrames', duration: () => (fold(0).enabled ? fold(0).durationFrames : 0), enabled: fold(0).enabled },
63
+ { id: 'bottomFold', label: 'BOTTOM_FOLD', start: 'timeline.bottomFold.startFrame', delay: 'folds.1.delayFrames', duration: () => (fold(1).enabled ? fold(1).durationFrames : 0), enabled: fold(1).enabled },
64
+ { id: 'foldedHold', label: 'FOLDED_HOLD', start: 'timeline.foldedHold.startFrame', delay: 'timeline.foldedHold.delayFrames', duration: () => n('timeline.foldedHold.durationFrames') },
65
+ { id: 'bottomUnfold', label: 'BOTTOM_UNFOLD', start: 'timeline.bottomUnfold.startFrame', delay: 'folds.1.unfoldDelayFrames', duration: () => (fold(1).enabled ? fold(1).unfoldDurationFrames : 0), enabled: fold(1).enabled },
66
+ { id: 'topUnfold', label: 'TOP_UNFOLD', start: 'timeline.topUnfold.startFrame', delay: 'folds.0.unfoldDelayFrames', duration: () => (fold(0).enabled ? fold(0).unfoldDurationFrames : 0), enabled: fold(0).enabled },
67
+ { id: 'finalHold', label: 'FINAL_HOLD', start: 'timeline.finalHold.startFrame', delay: 'timeline.finalHold.delayFrames', duration: () => n('timeline.finalHold.durationFrames') },
68
+ ];
69
+ let end = 0;
70
+ return spec.map((s) => {
71
+ const explicit = n(s.start);
72
+ // A disabled fold's phases take no time and no delay.
73
+ const delay = s.enabled === false ? 0 : n(s.delay);
74
+ const start = (explicit >= 0 ? explicit : end) + delay;
75
+ const e = start + s.duration();
76
+ end = Math.max(end, e);
77
+ return { id: s.id, label: s.label, start, end: e, delayPath: s.delay, startPath: s.start };
78
+ });
79
+ }
80
+
81
+ const api = createConfigApi<PaperFoldConfig>({ name: NAME, schemaId: CONFIG_SCHEMA_ID, title: 'Paper fold promo configuration', controls: CONTROLS, lists: LISTS, relations });
82
+
83
+ export const { defaultItem, canonicalPath, controlAt, validateConfig, applyPatch, diffConfig, configJsonSchema } = api;
84
+ /** The neutral default config (no reference copy): every control and list at its default. A fresh copy each call. */
85
+ export const defaultConfig = api.defaultConfig;
86
+
87
+ /** A valid, complete config, or an error listing every problem. */
88
+ export class PaperFoldConfigError extends Error {
89
+ constructor(readonly errors: ConfigError[]) {
90
+ super(`Invalid ${NAME} configuration:\n${errors.map((e) => ` ${e.path || '(root)'}: ${e.message}`).join('\n')}`);
91
+ }
92
+ }
93
+ export function resolveConfig(input: unknown): PaperFoldConfig {
94
+ const r = validateConfig(input);
95
+ if (!r.valid) throw new PaperFoldConfigError(r.errors);
96
+ return r.config!;
97
+ }
98
+ export type { Obj };