@appinternalleads/ui 0.4.0 → 0.4.2

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 (901) hide show
  1. package/README.md +92 -0
  2. package/dist/cjs/agent/AgentComponent.js +1 -1
  3. package/dist/cjs/agent/AgentComponent.js.map +1 -1
  4. package/dist/cjs/agent/manifests.js +81 -1
  5. package/dist/cjs/agent/manifests.js.map +1 -1
  6. package/dist/cjs/agent/result.js +6 -0
  7. package/dist/cjs/agent/result.js.map +1 -1
  8. package/dist/cjs/components/catalog.js +18 -0
  9. package/dist/cjs/components/catalog.js.map +1 -1
  10. package/dist/cjs/components/onboarding/animated-status/AnimatedStage.js +21 -0
  11. package/dist/cjs/components/onboarding/animated-status/AnimatedStage.js.map +1 -0
  12. package/dist/cjs/components/onboarding/animated-status/AnimatedStage.types.js +6 -0
  13. package/dist/cjs/components/onboarding/animated-status/AnimatedStage.types.js.map +1 -0
  14. package/dist/cjs/components/onboarding/animated-status/AnimatedStage.web.js +89 -0
  15. package/dist/cjs/components/onboarding/animated-status/AnimatedStage.web.js.map +1 -0
  16. package/dist/cjs/components/onboarding/animated-status/AnimatedStatusView.js +62 -0
  17. package/dist/cjs/components/onboarding/animated-status/AnimatedStatusView.js.map +1 -0
  18. package/dist/cjs/components/onboarding/animated-status/AnimatedStill.js +20 -0
  19. package/dist/cjs/components/onboarding/animated-status/AnimatedStill.js.map +1 -0
  20. package/dist/cjs/components/onboarding/animated-status/contract.js +87 -0
  21. package/dist/cjs/components/onboarding/animated-status/contract.js.map +1 -0
  22. package/dist/cjs/components/onboarding/animated-status/engine.js +40 -0
  23. package/dist/cjs/components/onboarding/animated-status/engine.js.map +1 -0
  24. package/dist/cjs/components/onboarding/animated-status/index.js +20 -0
  25. package/dist/cjs/components/onboarding/animated-status/index.js.map +1 -0
  26. package/dist/cjs/components/onboarding/animated-status/presets.json +126 -0
  27. package/dist/cjs/components/onboarding/animated-status/riv.js +7 -0
  28. package/dist/cjs/components/onboarding/animated-status/riv.js.map +1 -0
  29. package/dist/cjs/components/onboarding/index.js +4 -0
  30. package/dist/cjs/components/onboarding/index.js.map +1 -1
  31. package/dist/cjs/components/onboarding/presets.js +90 -84
  32. package/dist/cjs/components/onboarding/presets.js.map +1 -1
  33. package/dist/cjs/components/onboarding/receipt-printer/ReceiptStage.js +43 -6
  34. package/dist/cjs/components/onboarding/receipt-printer/ReceiptStage.js.map +1 -1
  35. package/dist/cjs/components/onboarding/send-completion/SendCompletionView.js +111 -0
  36. package/dist/cjs/components/onboarding/send-completion/SendCompletionView.js.map +1 -0
  37. package/dist/cjs/components/onboarding/send-completion/SendStage.js +37 -0
  38. package/dist/cjs/components/onboarding/send-completion/SendStage.js.map +1 -0
  39. package/dist/cjs/components/onboarding/send-completion/SendStage.types.js +6 -0
  40. package/dist/cjs/components/onboarding/send-completion/SendStage.types.js.map +1 -0
  41. package/dist/cjs/components/onboarding/send-completion/SendStage.web.js +107 -0
  42. package/dist/cjs/components/onboarding/send-completion/SendStage.web.js.map +1 -0
  43. package/dist/cjs/components/onboarding/send-completion/SendStill.js +17 -0
  44. package/dist/cjs/components/onboarding/send-completion/SendStill.js.map +1 -0
  45. package/dist/cjs/components/onboarding/send-completion/contract.js +83 -0
  46. package/dist/cjs/components/onboarding/send-completion/contract.js.map +1 -0
  47. package/dist/cjs/components/onboarding/send-completion/engine.js +32 -0
  48. package/dist/cjs/components/onboarding/send-completion/engine.js.map +1 -0
  49. package/dist/cjs/components/onboarding/send-completion/index.js +22 -0
  50. package/dist/cjs/components/onboarding/send-completion/index.js.map +1 -0
  51. package/dist/cjs/components/onboarding/send-completion/presets.json +132 -0
  52. package/dist/cjs/components/onboarding/send-completion/riv.js +7 -0
  53. package/dist/cjs/components/onboarding/send-completion/riv.js.map +1 -0
  54. package/dist/cjs/components/onboarding/shared/actions-data.js +2 -0
  55. package/dist/cjs/components/onboarding/shared/actions-data.js.map +1 -1
  56. package/dist/cjs/components/onboarding/shared/configColor.js +76 -0
  57. package/dist/cjs/components/onboarding/shared/configColor.js.map +1 -0
  58. package/dist/cjs/components/onboarding/shared/contract.js +4 -0
  59. package/dist/cjs/components/onboarding/shared/contract.js.map +1 -1
  60. package/dist/cjs/components/onboarding/shared/describe.js +1 -1
  61. package/dist/cjs/components/onboarding/shared/describe.js.map +1 -1
  62. package/dist/cjs/components/onboarding/shared/mock.js +2 -0
  63. package/dist/cjs/components/onboarding/shared/mock.js.map +1 -1
  64. package/dist/cjs/components/onboarding/views.js +8 -0
  65. package/dist/cjs/components/onboarding/views.js.map +1 -1
  66. package/dist/cjs/motion/MotionPlayer.js +42 -0
  67. package/dist/cjs/motion/MotionPlayer.js.map +1 -0
  68. package/dist/cjs/motion/agent.js +323 -0
  69. package/dist/cjs/motion/agent.js.map +1 -0
  70. package/dist/cjs/motion/cat/Cat.js +79 -0
  71. package/dist/cjs/motion/cat/Cat.js.map +1 -0
  72. package/dist/cjs/motion/cat/animation.js +204 -0
  73. package/dist/cjs/motion/cat/animation.js.map +1 -0
  74. package/dist/cjs/motion/cat/art.generated.js +37 -0
  75. package/dist/cjs/motion/cat/art.generated.js.map +1 -0
  76. package/dist/cjs/motion/cat/config.js +136 -0
  77. package/dist/cjs/motion/cat/config.js.map +1 -0
  78. package/dist/cjs/motion/cat/index.js +75 -0
  79. package/dist/cjs/motion/cat/index.js.map +1 -0
  80. package/dist/cjs/motion/cat/rig.js +99 -0
  81. package/dist/cjs/motion/cat/rig.js.map +1 -0
  82. package/dist/cjs/motion/cat/scene.js +148 -0
  83. package/dist/cjs/motion/cat/scene.js.map +1 -0
  84. package/dist/cjs/motion/configurable/config.js +477 -0
  85. package/dist/cjs/motion/configurable/config.js.map +1 -0
  86. package/dist/cjs/motion/configurable/controls.js +44 -0
  87. package/dist/cjs/motion/configurable/controls.js.map +1 -0
  88. package/dist/cjs/motion/easing.js +62 -0
  89. package/dist/cjs/motion/easing.js.map +1 -0
  90. package/dist/cjs/motion/fit.js +12 -0
  91. package/dist/cjs/motion/fit.js.map +1 -0
  92. package/dist/cjs/motion/index.js +101 -0
  93. package/dist/cjs/motion/index.js.map +1 -0
  94. package/dist/cjs/motion/neon/GlowRenderer.js +18 -0
  95. package/dist/cjs/motion/neon/GlowRenderer.js.map +1 -0
  96. package/dist/cjs/motion/neon/NeonCanvas.js +97 -0
  97. package/dist/cjs/motion/neon/NeonCanvas.js.map +1 -0
  98. package/dist/cjs/motion/neon/NeonText.js +108 -0
  99. package/dist/cjs/motion/neon/NeonText.js.map +1 -0
  100. package/dist/cjs/motion/neon/NeonTextFrame.js +36 -0
  101. package/dist/cjs/motion/neon/NeonTextFrame.js.map +1 -0
  102. package/dist/cjs/motion/neon/artwork.js +102 -0
  103. package/dist/cjs/motion/neon/artwork.js.map +1 -0
  104. package/dist/cjs/motion/neon/audio.js +165 -0
  105. package/dist/cjs/motion/neon/audio.js.map +1 -0
  106. package/dist/cjs/motion/neon/config.js +334 -0
  107. package/dist/cjs/motion/neon/config.js.map +1 -0
  108. package/dist/cjs/motion/neon/flicker.js +196 -0
  109. package/dist/cjs/motion/neon/flicker.js.map +1 -0
  110. package/dist/cjs/motion/neon/fonts.js +52 -0
  111. package/dist/cjs/motion/neon/fonts.js.map +1 -0
  112. package/dist/cjs/motion/neon/frame.js +24 -0
  113. package/dist/cjs/motion/neon/frame.js.map +1 -0
  114. package/dist/cjs/motion/neon/glitch.js +114 -0
  115. package/dist/cjs/motion/neon/glitch.js.map +1 -0
  116. package/dist/cjs/motion/neon/index.js +119 -0
  117. package/dist/cjs/motion/neon/index.js.map +1 -0
  118. package/dist/cjs/motion/neon/layers.js +68 -0
  119. package/dist/cjs/motion/neon/layers.js.map +1 -0
  120. package/dist/cjs/motion/neon/material.js +56 -0
  121. package/dist/cjs/motion/neon/material.js.map +1 -0
  122. package/dist/cjs/motion/neon/random.js +43 -0
  123. package/dist/cjs/motion/neon/random.js.map +1 -0
  124. package/dist/cjs/motion/neon/scene.js +549 -0
  125. package/dist/cjs/motion/neon/scene.js.map +1 -0
  126. package/dist/cjs/motion/neon/synth.js +213 -0
  127. package/dist/cjs/motion/neon/synth.js.map +1 -0
  128. package/dist/cjs/motion/neon/typography.js +81 -0
  129. package/dist/cjs/motion/neon/typography.js.map +1 -0
  130. package/dist/cjs/motion/neon/wall.js +113 -0
  131. package/dist/cjs/motion/neon/wall.js.map +1 -0
  132. package/dist/cjs/motion/paperfold/PaperFold.js +40 -0
  133. package/dist/cjs/motion/paperfold/PaperFold.js.map +1 -0
  134. package/dist/cjs/motion/paperfold/PaperFoldFrame.js +290 -0
  135. package/dist/cjs/motion/paperfold/PaperFoldFrame.js.map +1 -0
  136. package/dist/cjs/motion/paperfold/PaperFoldPlayer.js +59 -0
  137. package/dist/cjs/motion/paperfold/PaperFoldPlayer.js.map +1 -0
  138. package/dist/cjs/motion/paperfold/art.js +388 -0
  139. package/dist/cjs/motion/paperfold/art.js.map +1 -0
  140. package/dist/cjs/motion/paperfold/config.js +103 -0
  141. package/dist/cjs/motion/paperfold/config.js.map +1 -0
  142. package/dist/cjs/motion/paperfold/controls.js +493 -0
  143. package/dist/cjs/motion/paperfold/controls.js.map +1 -0
  144. package/dist/cjs/motion/paperfold/engine.js +722 -0
  145. package/dist/cjs/motion/paperfold/engine.js.map +1 -0
  146. package/dist/cjs/motion/paperfold/fonts.js +25 -0
  147. package/dist/cjs/motion/paperfold/fonts.js.map +1 -0
  148. package/dist/cjs/motion/paperfold/index.js +113 -0
  149. package/dist/cjs/motion/paperfold/index.js.map +1 -0
  150. package/dist/cjs/motion/paperfold/manipulate.js +170 -0
  151. package/dist/cjs/motion/paperfold/manipulate.js.map +1 -0
  152. package/dist/cjs/motion/paperfold/presets.js +119 -0
  153. package/dist/cjs/motion/paperfold/presets.js.map +1 -0
  154. package/dist/cjs/motion/paperfold/template.js +40 -0
  155. package/dist/cjs/motion/paperfold/template.js.map +1 -0
  156. package/dist/cjs/motion/player.js +203 -0
  157. package/dist/cjs/motion/player.js.map +1 -0
  158. package/dist/cjs/motion/promo/PromoFrame.js +293 -0
  159. package/dist/cjs/motion/promo/PromoFrame.js.map +1 -0
  160. package/dist/cjs/motion/promo/PromoShowcasePlayer.js +59 -0
  161. package/dist/cjs/motion/promo/PromoShowcasePlayer.js.map +1 -0
  162. package/dist/cjs/motion/promo/config.js +565 -0
  163. package/dist/cjs/motion/promo/config.js.map +1 -0
  164. package/dist/cjs/motion/promo/controls.js +571 -0
  165. package/dist/cjs/motion/promo/controls.js.map +1 -0
  166. package/dist/cjs/motion/promo/easing.js +35 -0
  167. package/dist/cjs/motion/promo/easing.js.map +1 -0
  168. package/dist/cjs/motion/promo/engine.js +567 -0
  169. package/dist/cjs/motion/promo/engine.js.map +1 -0
  170. package/dist/cjs/motion/promo/fonts.js +20 -0
  171. package/dist/cjs/motion/promo/fonts.js.map +1 -0
  172. package/dist/cjs/motion/promo/icons.js +29 -0
  173. package/dist/cjs/motion/promo/icons.js.map +1 -0
  174. package/dist/cjs/motion/promo/index.js +73 -0
  175. package/dist/cjs/motion/promo/index.js.map +1 -0
  176. package/dist/cjs/motion/promo/presets.js +44 -0
  177. package/dist/cjs/motion/promo/presets.js.map +1 -0
  178. package/dist/cjs/motion/promo/template.js +38 -0
  179. package/dist/cjs/motion/promo/template.js.map +1 -0
  180. package/dist/cjs/motion/replication2/Replication2Player.js +93 -0
  181. package/dist/cjs/motion/replication2/Replication2Player.js.map +1 -0
  182. package/dist/cjs/motion/replication2/config.js +352 -0
  183. package/dist/cjs/motion/replication2/config.js.map +1 -0
  184. package/dist/cjs/motion/replication2/controls.js +286 -0
  185. package/dist/cjs/motion/replication2/controls.js.map +1 -0
  186. package/dist/cjs/motion/replication2/driver.js +68 -0
  187. package/dist/cjs/motion/replication2/driver.js.map +1 -0
  188. package/dist/cjs/motion/replication2/easing.js +97 -0
  189. package/dist/cjs/motion/replication2/easing.js.map +1 -0
  190. package/dist/cjs/motion/replication2/engine.js +481 -0
  191. package/dist/cjs/motion/replication2/engine.js.map +1 -0
  192. package/dist/cjs/motion/replication2/html.js +88 -0
  193. package/dist/cjs/motion/replication2/html.js.map +1 -0
  194. package/dist/cjs/motion/replication2/index.js +61 -0
  195. package/dist/cjs/motion/replication2/index.js.map +1 -0
  196. package/dist/cjs/motion/replication2/measure.js +30 -0
  197. package/dist/cjs/motion/replication2/measure.js.map +1 -0
  198. package/dist/cjs/motion/replication2/metrics.js +10 -0
  199. package/dist/cjs/motion/replication2/metrics.js.map +1 -0
  200. package/dist/cjs/motion/replication2/presets.js +67 -0
  201. package/dist/cjs/motion/replication2/presets.js.map +1 -0
  202. package/dist/cjs/motion/replication2/riv.js +7 -0
  203. package/dist/cjs/motion/replication2/riv.js.map +1 -0
  204. package/dist/cjs/motion/replication2/rive-contract.js +158 -0
  205. package/dist/cjs/motion/replication2/rive-contract.js.map +1 -0
  206. package/dist/cjs/motion/replication2/template.js +35 -0
  207. package/dist/cjs/motion/replication2/template.js.map +1 -0
  208. package/dist/cjs/motion/sample.js +149 -0
  209. package/dist/cjs/motion/sample.js.map +1 -0
  210. package/dist/cjs/motion/templates/hey-template.js +1552 -0
  211. package/dist/cjs/motion/templates/hey-template.js.map +1 -0
  212. package/dist/cjs/motion/templates/index.js +22 -0
  213. package/dist/cjs/motion/templates/index.js.map +1 -0
  214. package/dist/cjs/motion/templates/word-motion.js +1165 -0
  215. package/dist/cjs/motion/templates/word-motion.js.map +1 -0
  216. package/dist/cjs/motion/types.js +3 -0
  217. package/dist/cjs/motion/types.js.map +1 -0
  218. package/dist/cjs/motion/typesurface/TypeSurfaceCanvas.js +85 -0
  219. package/dist/cjs/motion/typesurface/TypeSurfaceCanvas.js.map +1 -0
  220. package/dist/cjs/motion/typesurface/art.js +861 -0
  221. package/dist/cjs/motion/typesurface/art.js.map +1 -0
  222. package/dist/cjs/motion/typesurface/config.js +289 -0
  223. package/dist/cjs/motion/typesurface/config.js.map +1 -0
  224. package/dist/cjs/motion/typesurface/construct.js +875 -0
  225. package/dist/cjs/motion/typesurface/construct.js.map +1 -0
  226. package/dist/cjs/motion/typesurface/engine.js +631 -0
  227. package/dist/cjs/motion/typesurface/engine.js.map +1 -0
  228. package/dist/cjs/motion/typesurface/fonts.js +45 -0
  229. package/dist/cjs/motion/typesurface/fonts.js.map +1 -0
  230. package/dist/cjs/motion/typesurface/index.js +80 -0
  231. package/dist/cjs/motion/typesurface/index.js.map +1 -0
  232. package/dist/cjs/motion/typesurface/layout.js +130 -0
  233. package/dist/cjs/motion/typesurface/layout.js.map +1 -0
  234. package/dist/cjs/motion/typesurface/ops.js +175 -0
  235. package/dist/cjs/motion/typesurface/ops.js.map +1 -0
  236. package/dist/cjs/motion/typesurface/presets.js +259 -0
  237. package/dist/cjs/motion/typesurface/presets.js.map +1 -0
  238. package/dist/cjs/motion/typesurface/renderer.js +738 -0
  239. package/dist/cjs/motion/typesurface/renderer.js.map +1 -0
  240. package/dist/cjs/motion/typesurface/shaders.js +322 -0
  241. package/dist/cjs/motion/typesurface/shaders.js.map +1 -0
  242. package/dist/cjs/motion/typesurface/surfaces.js +225 -0
  243. package/dist/cjs/motion/typesurface/surfaces.js.map +1 -0
  244. package/dist/cjs/motion/typesurface/text.js +34 -0
  245. package/dist/cjs/motion/typesurface/text.js.map +1 -0
  246. package/dist/cjs/motion/typesurface/timeline.js +64 -0
  247. package/dist/cjs/motion/typesurface/timeline.js.map +1 -0
  248. package/dist/cjs/motion/validate.js +89 -0
  249. package/dist/cjs/motion/validate.js.map +1 -0
  250. package/dist/cjs/native/RiveReceiptStage.js +9 -150
  251. package/dist/cjs/native/RiveReceiptStage.js.map +1 -1
  252. package/dist/cjs/native/riveReceiptStageFactory.js +162 -0
  253. package/dist/cjs/native/riveReceiptStageFactory.js.map +1 -0
  254. package/dist/cjs/tokens/stage.js +10 -0
  255. package/dist/cjs/tokens/stage.js.map +1 -0
  256. package/dist/esm/agent/AgentComponent.js +1 -1
  257. package/dist/esm/agent/AgentComponent.js.map +1 -1
  258. package/dist/esm/agent/manifests.d.ts.map +1 -1
  259. package/dist/esm/agent/manifests.js +81 -1
  260. package/dist/esm/agent/manifests.js.map +1 -1
  261. package/dist/esm/agent/result.d.ts.map +1 -1
  262. package/dist/esm/agent/result.js +6 -0
  263. package/dist/esm/agent/result.js.map +1 -1
  264. package/dist/esm/agent/types.d.ts +1 -1
  265. package/dist/esm/agent/types.d.ts.map +1 -1
  266. package/dist/esm/components/catalog.d.ts +1 -1
  267. package/dist/esm/components/catalog.d.ts.map +1 -1
  268. package/dist/esm/components/catalog.js +18 -0
  269. package/dist/esm/components/catalog.js.map +1 -1
  270. package/dist/esm/components/onboarding/animated-status/AnimatedStage.d.ts +9 -0
  271. package/dist/esm/components/onboarding/animated-status/AnimatedStage.d.ts.map +1 -0
  272. package/dist/esm/components/onboarding/animated-status/AnimatedStage.js +18 -0
  273. package/dist/esm/components/onboarding/animated-status/AnimatedStage.js.map +1 -0
  274. package/dist/esm/components/onboarding/animated-status/AnimatedStage.types.d.ts +31 -0
  275. package/dist/esm/components/onboarding/animated-status/AnimatedStage.types.d.ts.map +1 -0
  276. package/dist/esm/components/onboarding/animated-status/AnimatedStage.types.js +3 -0
  277. package/dist/esm/components/onboarding/animated-status/AnimatedStage.types.js.map +1 -0
  278. package/dist/esm/components/onboarding/animated-status/AnimatedStage.web.d.ts +4 -0
  279. package/dist/esm/components/onboarding/animated-status/AnimatedStage.web.d.ts.map +1 -0
  280. package/dist/esm/components/onboarding/animated-status/AnimatedStage.web.js +86 -0
  281. package/dist/esm/components/onboarding/animated-status/AnimatedStage.web.js.map +1 -0
  282. package/dist/esm/components/onboarding/animated-status/AnimatedStatusView.d.ts +32 -0
  283. package/dist/esm/components/onboarding/animated-status/AnimatedStatusView.d.ts.map +1 -0
  284. package/dist/esm/components/onboarding/animated-status/AnimatedStatusView.js +59 -0
  285. package/dist/esm/components/onboarding/animated-status/AnimatedStatusView.js.map +1 -0
  286. package/dist/esm/components/onboarding/animated-status/AnimatedStill.d.ts +8 -0
  287. package/dist/esm/components/onboarding/animated-status/AnimatedStill.d.ts.map +1 -0
  288. package/dist/esm/components/onboarding/animated-status/AnimatedStill.js +17 -0
  289. package/dist/esm/components/onboarding/animated-status/AnimatedStill.js.map +1 -0
  290. package/dist/esm/components/onboarding/animated-status/contract.d.ts +61 -0
  291. package/dist/esm/components/onboarding/animated-status/contract.d.ts.map +1 -0
  292. package/dist/esm/components/onboarding/animated-status/contract.js +78 -0
  293. package/dist/esm/components/onboarding/animated-status/contract.js.map +1 -0
  294. package/dist/esm/components/onboarding/animated-status/engine.d.ts +24 -0
  295. package/dist/esm/components/onboarding/animated-status/engine.d.ts.map +1 -0
  296. package/dist/esm/components/onboarding/animated-status/engine.js +32 -0
  297. package/dist/esm/components/onboarding/animated-status/engine.js.map +1 -0
  298. package/dist/esm/components/onboarding/animated-status/index.d.ts +5 -0
  299. package/dist/esm/components/onboarding/animated-status/index.d.ts.map +1 -0
  300. package/dist/esm/components/onboarding/animated-status/index.js +4 -0
  301. package/dist/esm/components/onboarding/animated-status/index.js.map +1 -0
  302. package/dist/esm/components/onboarding/animated-status/presets.json +126 -0
  303. package/dist/esm/components/onboarding/animated-status/riv.d.ts +3 -0
  304. package/dist/esm/components/onboarding/animated-status/riv.d.ts.map +1 -0
  305. package/dist/esm/components/onboarding/animated-status/riv.js +4 -0
  306. package/dist/esm/components/onboarding/animated-status/riv.js.map +1 -0
  307. package/dist/esm/components/onboarding/index.d.ts +2 -0
  308. package/dist/esm/components/onboarding/index.d.ts.map +1 -1
  309. package/dist/esm/components/onboarding/index.js +4 -0
  310. package/dist/esm/components/onboarding/index.js.map +1 -1
  311. package/dist/esm/components/onboarding/presets.d.ts.map +1 -1
  312. package/dist/esm/components/onboarding/presets.js +6 -0
  313. package/dist/esm/components/onboarding/presets.js.map +1 -1
  314. package/dist/esm/components/onboarding/receipt-printer/ReceiptStage.d.ts +4 -6
  315. package/dist/esm/components/onboarding/receipt-printer/ReceiptStage.d.ts.map +1 -1
  316. package/dist/esm/components/onboarding/receipt-printer/ReceiptStage.js +42 -6
  317. package/dist/esm/components/onboarding/receipt-printer/ReceiptStage.js.map +1 -1
  318. package/dist/esm/components/onboarding/send-completion/SendCompletionView.d.ts +47 -0
  319. package/dist/esm/components/onboarding/send-completion/SendCompletionView.d.ts.map +1 -0
  320. package/dist/esm/components/onboarding/send-completion/SendCompletionView.js +108 -0
  321. package/dist/esm/components/onboarding/send-completion/SendCompletionView.js.map +1 -0
  322. package/dist/esm/components/onboarding/send-completion/SendStage.d.ts +9 -0
  323. package/dist/esm/components/onboarding/send-completion/SendStage.d.ts.map +1 -0
  324. package/dist/esm/components/onboarding/send-completion/SendStage.js +34 -0
  325. package/dist/esm/components/onboarding/send-completion/SendStage.js.map +1 -0
  326. package/dist/esm/components/onboarding/send-completion/SendStage.types.d.ts +33 -0
  327. package/dist/esm/components/onboarding/send-completion/SendStage.types.d.ts.map +1 -0
  328. package/dist/esm/components/onboarding/send-completion/SendStage.types.js +3 -0
  329. package/dist/esm/components/onboarding/send-completion/SendStage.types.js.map +1 -0
  330. package/dist/esm/components/onboarding/send-completion/SendStage.web.d.ts +4 -0
  331. package/dist/esm/components/onboarding/send-completion/SendStage.web.d.ts.map +1 -0
  332. package/dist/esm/components/onboarding/send-completion/SendStage.web.js +104 -0
  333. package/dist/esm/components/onboarding/send-completion/SendStage.web.js.map +1 -0
  334. package/dist/esm/components/onboarding/send-completion/SendStill.d.ts +11 -0
  335. package/dist/esm/components/onboarding/send-completion/SendStill.d.ts.map +1 -0
  336. package/dist/esm/components/onboarding/send-completion/SendStill.js +14 -0
  337. package/dist/esm/components/onboarding/send-completion/SendStill.js.map +1 -0
  338. package/dist/esm/components/onboarding/send-completion/contract.d.ts +99 -0
  339. package/dist/esm/components/onboarding/send-completion/contract.d.ts.map +1 -0
  340. package/dist/esm/components/onboarding/send-completion/contract.js +76 -0
  341. package/dist/esm/components/onboarding/send-completion/contract.js.map +1 -0
  342. package/dist/esm/components/onboarding/send-completion/engine.d.ts +20 -0
  343. package/dist/esm/components/onboarding/send-completion/engine.d.ts.map +1 -0
  344. package/dist/esm/components/onboarding/send-completion/engine.js +28 -0
  345. package/dist/esm/components/onboarding/send-completion/engine.js.map +1 -0
  346. package/dist/esm/components/onboarding/send-completion/index.d.ts +6 -0
  347. package/dist/esm/components/onboarding/send-completion/index.d.ts.map +1 -0
  348. package/dist/esm/components/onboarding/send-completion/index.js +6 -0
  349. package/dist/esm/components/onboarding/send-completion/index.js.map +1 -0
  350. package/dist/esm/components/onboarding/send-completion/presets.json +132 -0
  351. package/dist/esm/components/onboarding/send-completion/riv.d.ts +3 -0
  352. package/dist/esm/components/onboarding/send-completion/riv.d.ts.map +1 -0
  353. package/dist/esm/components/onboarding/send-completion/riv.js +4 -0
  354. package/dist/esm/components/onboarding/send-completion/riv.js.map +1 -0
  355. package/dist/esm/components/onboarding/shared/actions-data.d.ts.map +1 -1
  356. package/dist/esm/components/onboarding/shared/actions-data.js +2 -0
  357. package/dist/esm/components/onboarding/shared/actions-data.js.map +1 -1
  358. package/dist/esm/components/onboarding/shared/configColor.d.ts +29 -0
  359. package/dist/esm/components/onboarding/shared/configColor.d.ts.map +1 -0
  360. package/dist/esm/components/onboarding/shared/configColor.js +69 -0
  361. package/dist/esm/components/onboarding/shared/configColor.js.map +1 -0
  362. package/dist/esm/components/onboarding/shared/contract.d.ts +1 -1
  363. package/dist/esm/components/onboarding/shared/contract.d.ts.map +1 -1
  364. package/dist/esm/components/onboarding/shared/contract.js +4 -0
  365. package/dist/esm/components/onboarding/shared/contract.js.map +1 -1
  366. package/dist/esm/components/onboarding/shared/describe.d.ts.map +1 -1
  367. package/dist/esm/components/onboarding/shared/describe.js +1 -1
  368. package/dist/esm/components/onboarding/shared/describe.js.map +1 -1
  369. package/dist/esm/components/onboarding/shared/mock.d.ts +2 -0
  370. package/dist/esm/components/onboarding/shared/mock.d.ts.map +1 -1
  371. package/dist/esm/components/onboarding/shared/mock.js +2 -0
  372. package/dist/esm/components/onboarding/shared/mock.js.map +1 -1
  373. package/dist/esm/components/onboarding/views.d.ts.map +1 -1
  374. package/dist/esm/components/onboarding/views.js +8 -0
  375. package/dist/esm/components/onboarding/views.js.map +1 -1
  376. package/dist/esm/motion/MotionPlayer.d.ts +22 -0
  377. package/dist/esm/motion/MotionPlayer.d.ts.map +1 -0
  378. package/dist/esm/motion/MotionPlayer.js +39 -0
  379. package/dist/esm/motion/MotionPlayer.js.map +1 -0
  380. package/dist/esm/motion/agent.d.ts +146 -0
  381. package/dist/esm/motion/agent.d.ts.map +1 -0
  382. package/dist/esm/motion/agent.js +278 -0
  383. package/dist/esm/motion/agent.js.map +1 -0
  384. package/dist/esm/motion/cat/Cat.d.ts +43 -0
  385. package/dist/esm/motion/cat/Cat.d.ts.map +1 -0
  386. package/dist/esm/motion/cat/Cat.js +74 -0
  387. package/dist/esm/motion/cat/Cat.js.map +1 -0
  388. package/dist/esm/motion/cat/animation.d.ts +86 -0
  389. package/dist/esm/motion/cat/animation.d.ts.map +1 -0
  390. package/dist/esm/motion/cat/animation.js +193 -0
  391. package/dist/esm/motion/cat/animation.js.map +1 -0
  392. package/dist/esm/motion/cat/art.generated.d.ts +53 -0
  393. package/dist/esm/motion/cat/art.generated.d.ts.map +1 -0
  394. package/dist/esm/motion/cat/art.generated.js +34 -0
  395. package/dist/esm/motion/cat/art.generated.js.map +1 -0
  396. package/dist/esm/motion/cat/config.d.ts +103 -0
  397. package/dist/esm/motion/cat/config.d.ts.map +1 -0
  398. package/dist/esm/motion/cat/config.js +129 -0
  399. package/dist/esm/motion/cat/config.js.map +1 -0
  400. package/dist/esm/motion/cat/index.d.ts +13 -0
  401. package/dist/esm/motion/cat/index.d.ts.map +1 -0
  402. package/dist/esm/motion/cat/index.js +13 -0
  403. package/dist/esm/motion/cat/index.js.map +1 -0
  404. package/dist/esm/motion/cat/rig.d.ts +44 -0
  405. package/dist/esm/motion/cat/rig.d.ts.map +1 -0
  406. package/dist/esm/motion/cat/rig.js +86 -0
  407. package/dist/esm/motion/cat/rig.js.map +1 -0
  408. package/dist/esm/motion/cat/scene.d.ts +66 -0
  409. package/dist/esm/motion/cat/scene.d.ts.map +1 -0
  410. package/dist/esm/motion/cat/scene.js +137 -0
  411. package/dist/esm/motion/cat/scene.js.map +1 -0
  412. package/dist/esm/motion/configurable/config.d.ts +80 -0
  413. package/dist/esm/motion/configurable/config.d.ts.map +1 -0
  414. package/dist/esm/motion/configurable/config.js +468 -0
  415. package/dist/esm/motion/configurable/config.js.map +1 -0
  416. package/dist/esm/motion/configurable/controls.d.ts +74 -0
  417. package/dist/esm/motion/configurable/controls.d.ts.map +1 -0
  418. package/dist/esm/motion/configurable/controls.js +38 -0
  419. package/dist/esm/motion/configurable/controls.js.map +1 -0
  420. package/dist/esm/motion/easing.d.ts +4 -0
  421. package/dist/esm/motion/easing.d.ts.map +1 -0
  422. package/dist/esm/motion/easing.js +58 -0
  423. package/dist/esm/motion/easing.js.map +1 -0
  424. package/dist/esm/motion/fit.d.ts +8 -0
  425. package/dist/esm/motion/fit.d.ts.map +1 -0
  426. package/dist/esm/motion/fit.js +8 -0
  427. package/dist/esm/motion/fit.js.map +1 -0
  428. package/dist/esm/motion/index.d.ts +27 -0
  429. package/dist/esm/motion/index.d.ts.map +1 -0
  430. package/dist/esm/motion/index.js +21 -0
  431. package/dist/esm/motion/index.js.map +1 -0
  432. package/dist/esm/motion/neon/GlowRenderer.d.ts +31 -0
  433. package/dist/esm/motion/neon/GlowRenderer.d.ts.map +1 -0
  434. package/dist/esm/motion/neon/GlowRenderer.js +14 -0
  435. package/dist/esm/motion/neon/GlowRenderer.js.map +1 -0
  436. package/dist/esm/motion/neon/NeonCanvas.d.ts +42 -0
  437. package/dist/esm/motion/neon/NeonCanvas.d.ts.map +1 -0
  438. package/dist/esm/motion/neon/NeonCanvas.js +92 -0
  439. package/dist/esm/motion/neon/NeonCanvas.js.map +1 -0
  440. package/dist/esm/motion/neon/NeonText.d.ts +26 -0
  441. package/dist/esm/motion/neon/NeonText.d.ts.map +1 -0
  442. package/dist/esm/motion/neon/NeonText.js +103 -0
  443. package/dist/esm/motion/neon/NeonText.js.map +1 -0
  444. package/dist/esm/motion/neon/NeonTextFrame.d.ts +29 -0
  445. package/dist/esm/motion/neon/NeonTextFrame.d.ts.map +1 -0
  446. package/dist/esm/motion/neon/NeonTextFrame.js +33 -0
  447. package/dist/esm/motion/neon/NeonTextFrame.js.map +1 -0
  448. package/dist/esm/motion/neon/artwork.d.ts +29 -0
  449. package/dist/esm/motion/neon/artwork.d.ts.map +1 -0
  450. package/dist/esm/motion/neon/artwork.js +98 -0
  451. package/dist/esm/motion/neon/artwork.js.map +1 -0
  452. package/dist/esm/motion/neon/audio.d.ts +49 -0
  453. package/dist/esm/motion/neon/audio.d.ts.map +1 -0
  454. package/dist/esm/motion/neon/audio.js +161 -0
  455. package/dist/esm/motion/neon/audio.js.map +1 -0
  456. package/dist/esm/motion/neon/config.d.ts +319 -0
  457. package/dist/esm/motion/neon/config.d.ts.map +1 -0
  458. package/dist/esm/motion/neon/config.js +319 -0
  459. package/dist/esm/motion/neon/config.js.map +1 -0
  460. package/dist/esm/motion/neon/flicker.d.ts +82 -0
  461. package/dist/esm/motion/neon/flicker.d.ts.map +1 -0
  462. package/dist/esm/motion/neon/flicker.js +187 -0
  463. package/dist/esm/motion/neon/flicker.js.map +1 -0
  464. package/dist/esm/motion/neon/fonts.d.ts +29 -0
  465. package/dist/esm/motion/neon/fonts.d.ts.map +1 -0
  466. package/dist/esm/motion/neon/fonts.js +47 -0
  467. package/dist/esm/motion/neon/fonts.js.map +1 -0
  468. package/dist/esm/motion/neon/frame.d.ts +22 -0
  469. package/dist/esm/motion/neon/frame.d.ts.map +1 -0
  470. package/dist/esm/motion/neon/frame.js +20 -0
  471. package/dist/esm/motion/neon/frame.js.map +1 -0
  472. package/dist/esm/motion/neon/glitch.d.ts +64 -0
  473. package/dist/esm/motion/neon/glitch.d.ts.map +1 -0
  474. package/dist/esm/motion/neon/glitch.js +108 -0
  475. package/dist/esm/motion/neon/glitch.js.map +1 -0
  476. package/dist/esm/motion/neon/index.d.ts +29 -0
  477. package/dist/esm/motion/neon/index.d.ts.map +1 -0
  478. package/dist/esm/motion/neon/index.js +28 -0
  479. package/dist/esm/motion/neon/index.js.map +1 -0
  480. package/dist/esm/motion/neon/layers.d.ts +56 -0
  481. package/dist/esm/motion/neon/layers.d.ts.map +1 -0
  482. package/dist/esm/motion/neon/layers.js +64 -0
  483. package/dist/esm/motion/neon/layers.js.map +1 -0
  484. package/dist/esm/motion/neon/material.d.ts +68 -0
  485. package/dist/esm/motion/neon/material.d.ts.map +1 -0
  486. package/dist/esm/motion/neon/material.js +51 -0
  487. package/dist/esm/motion/neon/material.js.map +1 -0
  488. package/dist/esm/motion/neon/random.d.ts +15 -0
  489. package/dist/esm/motion/neon/random.d.ts.map +1 -0
  490. package/dist/esm/motion/neon/random.js +37 -0
  491. package/dist/esm/motion/neon/random.js.map +1 -0
  492. package/dist/esm/motion/neon/scene.d.ts +255 -0
  493. package/dist/esm/motion/neon/scene.d.ts.map +1 -0
  494. package/dist/esm/motion/neon/scene.js +532 -0
  495. package/dist/esm/motion/neon/scene.js.map +1 -0
  496. package/dist/esm/motion/neon/synth.d.ts +18 -0
  497. package/dist/esm/motion/neon/synth.d.ts.map +1 -0
  498. package/dist/esm/motion/neon/synth.js +208 -0
  499. package/dist/esm/motion/neon/synth.js.map +1 -0
  500. package/dist/esm/motion/neon/typography.d.ts +53 -0
  501. package/dist/esm/motion/neon/typography.d.ts.map +1 -0
  502. package/dist/esm/motion/neon/typography.js +74 -0
  503. package/dist/esm/motion/neon/typography.js.map +1 -0
  504. package/dist/esm/motion/neon/wall.d.ts +62 -0
  505. package/dist/esm/motion/neon/wall.d.ts.map +1 -0
  506. package/dist/esm/motion/neon/wall.js +106 -0
  507. package/dist/esm/motion/neon/wall.js.map +1 -0
  508. package/dist/esm/motion/paperfold/PaperFold.d.ts +36 -0
  509. package/dist/esm/motion/paperfold/PaperFold.d.ts.map +1 -0
  510. package/dist/esm/motion/paperfold/PaperFold.js +37 -0
  511. package/dist/esm/motion/paperfold/PaperFold.js.map +1 -0
  512. package/dist/esm/motion/paperfold/PaperFoldFrame.d.ts +39 -0
  513. package/dist/esm/motion/paperfold/PaperFoldFrame.d.ts.map +1 -0
  514. package/dist/esm/motion/paperfold/PaperFoldFrame.js +283 -0
  515. package/dist/esm/motion/paperfold/PaperFoldFrame.js.map +1 -0
  516. package/dist/esm/motion/paperfold/PaperFoldPlayer.d.ts +27 -0
  517. package/dist/esm/motion/paperfold/PaperFoldPlayer.d.ts.map +1 -0
  518. package/dist/esm/motion/paperfold/PaperFoldPlayer.js +56 -0
  519. package/dist/esm/motion/paperfold/PaperFoldPlayer.js.map +1 -0
  520. package/dist/esm/motion/paperfold/art.d.ts +148 -0
  521. package/dist/esm/motion/paperfold/art.d.ts.map +1 -0
  522. package/dist/esm/motion/paperfold/art.js +374 -0
  523. package/dist/esm/motion/paperfold/art.js.map +1 -0
  524. package/dist/esm/motion/paperfold/config.d.ts +47 -0
  525. package/dist/esm/motion/paperfold/config.d.ts.map +1 -0
  526. package/dist/esm/motion/paperfold/config.js +96 -0
  527. package/dist/esm/motion/paperfold/config.js.map +1 -0
  528. package/dist/esm/motion/paperfold/controls.d.ts +57 -0
  529. package/dist/esm/motion/paperfold/controls.d.ts.map +1 -0
  530. package/dist/esm/motion/paperfold/controls.js +506 -0
  531. package/dist/esm/motion/paperfold/controls.js.map +1 -0
  532. package/dist/esm/motion/paperfold/engine.d.ts +397 -0
  533. package/dist/esm/motion/paperfold/engine.d.ts.map +1 -0
  534. package/dist/esm/motion/paperfold/engine.js +699 -0
  535. package/dist/esm/motion/paperfold/engine.js.map +1 -0
  536. package/dist/esm/motion/paperfold/fonts.d.ts +3 -0
  537. package/dist/esm/motion/paperfold/fonts.d.ts.map +1 -0
  538. package/dist/esm/motion/paperfold/fonts.js +21 -0
  539. package/dist/esm/motion/paperfold/fonts.js.map +1 -0
  540. package/dist/esm/motion/paperfold/index.d.ts +17 -0
  541. package/dist/esm/motion/paperfold/index.d.ts.map +1 -0
  542. package/dist/esm/motion/paperfold/index.js +17 -0
  543. package/dist/esm/motion/paperfold/index.js.map +1 -0
  544. package/dist/esm/motion/paperfold/manipulate.d.ts +59 -0
  545. package/dist/esm/motion/paperfold/manipulate.d.ts.map +1 -0
  546. package/dist/esm/motion/paperfold/manipulate.js +161 -0
  547. package/dist/esm/motion/paperfold/manipulate.js.map +1 -0
  548. package/dist/esm/motion/paperfold/presets.d.ts +9 -0
  549. package/dist/esm/motion/paperfold/presets.d.ts.map +1 -0
  550. package/dist/esm/motion/paperfold/presets.js +115 -0
  551. package/dist/esm/motion/paperfold/presets.js.map +1 -0
  552. package/dist/esm/motion/paperfold/template.d.ts +3 -0
  553. package/dist/esm/motion/paperfold/template.d.ts.map +1 -0
  554. package/dist/esm/motion/paperfold/template.js +37 -0
  555. package/dist/esm/motion/paperfold/template.js.map +1 -0
  556. package/dist/esm/motion/player.d.ts +35 -0
  557. package/dist/esm/motion/player.d.ts.map +1 -0
  558. package/dist/esm/motion/player.js +197 -0
  559. package/dist/esm/motion/player.js.map +1 -0
  560. package/dist/esm/motion/promo/PromoFrame.d.ts +31 -0
  561. package/dist/esm/motion/promo/PromoFrame.d.ts.map +1 -0
  562. package/dist/esm/motion/promo/PromoFrame.js +288 -0
  563. package/dist/esm/motion/promo/PromoFrame.js.map +1 -0
  564. package/dist/esm/motion/promo/PromoShowcasePlayer.d.ts +25 -0
  565. package/dist/esm/motion/promo/PromoShowcasePlayer.d.ts.map +1 -0
  566. package/dist/esm/motion/promo/PromoShowcasePlayer.js +56 -0
  567. package/dist/esm/motion/promo/PromoShowcasePlayer.js.map +1 -0
  568. package/dist/esm/motion/promo/config.d.ts +91 -0
  569. package/dist/esm/motion/promo/config.d.ts.map +1 -0
  570. package/dist/esm/motion/promo/config.js +550 -0
  571. package/dist/esm/motion/promo/config.js.map +1 -0
  572. package/dist/esm/motion/promo/controls.d.ts +86 -0
  573. package/dist/esm/motion/promo/controls.d.ts.map +1 -0
  574. package/dist/esm/motion/promo/controls.js +567 -0
  575. package/dist/esm/motion/promo/controls.js.map +1 -0
  576. package/dist/esm/motion/promo/easing.d.ts +3 -0
  577. package/dist/esm/motion/promo/easing.d.ts.map +1 -0
  578. package/dist/esm/motion/promo/easing.js +32 -0
  579. package/dist/esm/motion/promo/easing.js.map +1 -0
  580. package/dist/esm/motion/promo/engine.d.ts +205 -0
  581. package/dist/esm/motion/promo/engine.d.ts.map +1 -0
  582. package/dist/esm/motion/promo/engine.js +551 -0
  583. package/dist/esm/motion/promo/engine.js.map +1 -0
  584. package/dist/esm/motion/promo/fonts.d.ts +7 -0
  585. package/dist/esm/motion/promo/fonts.d.ts.map +1 -0
  586. package/dist/esm/motion/promo/fonts.js +16 -0
  587. package/dist/esm/motion/promo/fonts.js.map +1 -0
  588. package/dist/esm/motion/promo/icons.d.ts +7 -0
  589. package/dist/esm/motion/promo/icons.d.ts.map +1 -0
  590. package/dist/esm/motion/promo/icons.js +26 -0
  591. package/dist/esm/motion/promo/icons.js.map +1 -0
  592. package/dist/esm/motion/promo/index.d.ts +15 -0
  593. package/dist/esm/motion/promo/index.d.ts.map +1 -0
  594. package/dist/esm/motion/promo/index.js +15 -0
  595. package/dist/esm/motion/promo/index.js.map +1 -0
  596. package/dist/esm/motion/promo/presets.d.ts +13 -0
  597. package/dist/esm/motion/promo/presets.d.ts.map +1 -0
  598. package/dist/esm/motion/promo/presets.js +40 -0
  599. package/dist/esm/motion/promo/presets.js.map +1 -0
  600. package/dist/esm/motion/promo/template.d.ts +8 -0
  601. package/dist/esm/motion/promo/template.d.ts.map +1 -0
  602. package/dist/esm/motion/promo/template.js +35 -0
  603. package/dist/esm/motion/promo/template.js.map +1 -0
  604. package/dist/esm/motion/replication2/Replication2Player.d.ts +26 -0
  605. package/dist/esm/motion/replication2/Replication2Player.d.ts.map +1 -0
  606. package/dist/esm/motion/replication2/Replication2Player.js +90 -0
  607. package/dist/esm/motion/replication2/Replication2Player.js.map +1 -0
  608. package/dist/esm/motion/replication2/config.d.ts +78 -0
  609. package/dist/esm/motion/replication2/config.d.ts.map +1 -0
  610. package/dist/esm/motion/replication2/config.js +341 -0
  611. package/dist/esm/motion/replication2/config.js.map +1 -0
  612. package/dist/esm/motion/replication2/controls.d.ts +70 -0
  613. package/dist/esm/motion/replication2/controls.d.ts.map +1 -0
  614. package/dist/esm/motion/replication2/controls.js +283 -0
  615. package/dist/esm/motion/replication2/controls.js.map +1 -0
  616. package/dist/esm/motion/replication2/driver.d.ts +23 -0
  617. package/dist/esm/motion/replication2/driver.d.ts.map +1 -0
  618. package/dist/esm/motion/replication2/driver.js +65 -0
  619. package/dist/esm/motion/replication2/driver.js.map +1 -0
  620. package/dist/esm/motion/replication2/easing.d.ts +19 -0
  621. package/dist/esm/motion/replication2/easing.d.ts.map +1 -0
  622. package/dist/esm/motion/replication2/easing.js +92 -0
  623. package/dist/esm/motion/replication2/easing.js.map +1 -0
  624. package/dist/esm/motion/replication2/engine.d.ts +236 -0
  625. package/dist/esm/motion/replication2/engine.d.ts.map +1 -0
  626. package/dist/esm/motion/replication2/engine.js +470 -0
  627. package/dist/esm/motion/replication2/engine.js.map +1 -0
  628. package/dist/esm/motion/replication2/html.d.ts +30 -0
  629. package/dist/esm/motion/replication2/html.d.ts.map +1 -0
  630. package/dist/esm/motion/replication2/html.js +83 -0
  631. package/dist/esm/motion/replication2/html.js.map +1 -0
  632. package/dist/esm/motion/replication2/index.d.ts +15 -0
  633. package/dist/esm/motion/replication2/index.d.ts.map +1 -0
  634. package/dist/esm/motion/replication2/index.js +15 -0
  635. package/dist/esm/motion/replication2/index.js.map +1 -0
  636. package/dist/esm/motion/replication2/measure.d.ts +3 -0
  637. package/dist/esm/motion/replication2/measure.d.ts.map +1 -0
  638. package/dist/esm/motion/replication2/measure.js +27 -0
  639. package/dist/esm/motion/replication2/measure.js.map +1 -0
  640. package/dist/esm/motion/replication2/metrics.d.ts +6 -0
  641. package/dist/esm/motion/replication2/metrics.d.ts.map +1 -0
  642. package/dist/esm/motion/replication2/metrics.js +7 -0
  643. package/dist/esm/motion/replication2/metrics.js.map +1 -0
  644. package/dist/esm/motion/replication2/presets.d.ts +13 -0
  645. package/dist/esm/motion/replication2/presets.d.ts.map +1 -0
  646. package/dist/esm/motion/replication2/presets.js +63 -0
  647. package/dist/esm/motion/replication2/presets.js.map +1 -0
  648. package/dist/esm/motion/replication2/riv.d.ts +3 -0
  649. package/dist/esm/motion/replication2/riv.d.ts.map +1 -0
  650. package/dist/esm/motion/replication2/riv.js +4 -0
  651. package/dist/esm/motion/replication2/riv.js.map +1 -0
  652. package/dist/esm/motion/replication2/rive-contract.d.ts +27 -0
  653. package/dist/esm/motion/replication2/rive-contract.d.ts.map +1 -0
  654. package/dist/esm/motion/replication2/rive-contract.js +153 -0
  655. package/dist/esm/motion/replication2/rive-contract.js.map +1 -0
  656. package/dist/esm/motion/replication2/template.d.ts +8 -0
  657. package/dist/esm/motion/replication2/template.d.ts.map +1 -0
  658. package/dist/esm/motion/replication2/template.js +32 -0
  659. package/dist/esm/motion/replication2/template.js.map +1 -0
  660. package/dist/esm/motion/sample.d.ts +61 -0
  661. package/dist/esm/motion/sample.d.ts.map +1 -0
  662. package/dist/esm/motion/sample.js +138 -0
  663. package/dist/esm/motion/sample.js.map +1 -0
  664. package/dist/esm/motion/templates/hey-template.d.ts +3 -0
  665. package/dist/esm/motion/templates/hey-template.d.ts.map +1 -0
  666. package/dist/esm/motion/templates/hey-template.js +1549 -0
  667. package/dist/esm/motion/templates/hey-template.js.map +1 -0
  668. package/dist/esm/motion/templates/index.d.ts +22 -0
  669. package/dist/esm/motion/templates/index.d.ts.map +1 -0
  670. package/dist/esm/motion/templates/index.js +15 -0
  671. package/dist/esm/motion/templates/index.js.map +1 -0
  672. package/dist/esm/motion/templates/word-motion.d.ts +3 -0
  673. package/dist/esm/motion/templates/word-motion.d.ts.map +1 -0
  674. package/dist/esm/motion/templates/word-motion.js +1162 -0
  675. package/dist/esm/motion/templates/word-motion.js.map +1 -0
  676. package/dist/esm/motion/types.d.ts +192 -0
  677. package/dist/esm/motion/types.d.ts.map +1 -0
  678. package/dist/esm/motion/types.js +2 -0
  679. package/dist/esm/motion/types.js.map +1 -0
  680. package/dist/esm/motion/typesurface/TypeSurfaceCanvas.d.ts +32 -0
  681. package/dist/esm/motion/typesurface/TypeSurfaceCanvas.d.ts.map +1 -0
  682. package/dist/esm/motion/typesurface/TypeSurfaceCanvas.js +81 -0
  683. package/dist/esm/motion/typesurface/TypeSurfaceCanvas.js.map +1 -0
  684. package/dist/esm/motion/typesurface/art.d.ts +21 -0
  685. package/dist/esm/motion/typesurface/art.d.ts.map +1 -0
  686. package/dist/esm/motion/typesurface/art.js +854 -0
  687. package/dist/esm/motion/typesurface/art.js.map +1 -0
  688. package/dist/esm/motion/typesurface/config.d.ts +284 -0
  689. package/dist/esm/motion/typesurface/config.d.ts.map +1 -0
  690. package/dist/esm/motion/typesurface/config.js +280 -0
  691. package/dist/esm/motion/typesurface/config.js.map +1 -0
  692. package/dist/esm/motion/typesurface/construct.d.ts +284 -0
  693. package/dist/esm/motion/typesurface/construct.d.ts.map +1 -0
  694. package/dist/esm/motion/typesurface/construct.js +866 -0
  695. package/dist/esm/motion/typesurface/construct.js.map +1 -0
  696. package/dist/esm/motion/typesurface/engine.d.ts +102 -0
  697. package/dist/esm/motion/typesurface/engine.d.ts.map +1 -0
  698. package/dist/esm/motion/typesurface/engine.js +627 -0
  699. package/dist/esm/motion/typesurface/engine.js.map +1 -0
  700. package/dist/esm/motion/typesurface/fonts.d.ts +25 -0
  701. package/dist/esm/motion/typesurface/fonts.d.ts.map +1 -0
  702. package/dist/esm/motion/typesurface/fonts.js +40 -0
  703. package/dist/esm/motion/typesurface/fonts.js.map +1 -0
  704. package/dist/esm/motion/typesurface/index.d.ts +21 -0
  705. package/dist/esm/motion/typesurface/index.d.ts.map +1 -0
  706. package/dist/esm/motion/typesurface/index.js +21 -0
  707. package/dist/esm/motion/typesurface/index.js.map +1 -0
  708. package/dist/esm/motion/typesurface/layout.d.ts +57 -0
  709. package/dist/esm/motion/typesurface/layout.d.ts.map +1 -0
  710. package/dist/esm/motion/typesurface/layout.js +122 -0
  711. package/dist/esm/motion/typesurface/layout.js.map +1 -0
  712. package/dist/esm/motion/typesurface/ops.d.ts +70 -0
  713. package/dist/esm/motion/typesurface/ops.d.ts.map +1 -0
  714. package/dist/esm/motion/typesurface/ops.js +164 -0
  715. package/dist/esm/motion/typesurface/ops.js.map +1 -0
  716. package/dist/esm/motion/typesurface/presets.d.ts +51 -0
  717. package/dist/esm/motion/typesurface/presets.d.ts.map +1 -0
  718. package/dist/esm/motion/typesurface/presets.js +250 -0
  719. package/dist/esm/motion/typesurface/presets.js.map +1 -0
  720. package/dist/esm/motion/typesurface/renderer.d.ts +88 -0
  721. package/dist/esm/motion/typesurface/renderer.d.ts.map +1 -0
  722. package/dist/esm/motion/typesurface/renderer.js +732 -0
  723. package/dist/esm/motion/typesurface/renderer.js.map +1 -0
  724. package/dist/esm/motion/typesurface/shaders.d.ts +17 -0
  725. package/dist/esm/motion/typesurface/shaders.d.ts.map +1 -0
  726. package/dist/esm/motion/typesurface/shaders.js +319 -0
  727. package/dist/esm/motion/typesurface/shaders.js.map +1 -0
  728. package/dist/esm/motion/typesurface/surfaces.d.ts +108 -0
  729. package/dist/esm/motion/typesurface/surfaces.d.ts.map +1 -0
  730. package/dist/esm/motion/typesurface/surfaces.js +216 -0
  731. package/dist/esm/motion/typesurface/surfaces.js.map +1 -0
  732. package/dist/esm/motion/typesurface/text.d.ts +17 -0
  733. package/dist/esm/motion/typesurface/text.d.ts.map +1 -0
  734. package/dist/esm/motion/typesurface/text.js +28 -0
  735. package/dist/esm/motion/typesurface/text.js.map +1 -0
  736. package/dist/esm/motion/typesurface/timeline.d.ts +15 -0
  737. package/dist/esm/motion/typesurface/timeline.d.ts.map +1 -0
  738. package/dist/esm/motion/typesurface/timeline.js +57 -0
  739. package/dist/esm/motion/typesurface/timeline.js.map +1 -0
  740. package/dist/esm/motion/validate.d.ts +22 -0
  741. package/dist/esm/motion/validate.d.ts.map +1 -0
  742. package/dist/esm/motion/validate.js +84 -0
  743. package/dist/esm/motion/validate.js.map +1 -0
  744. package/dist/esm/native/RiveReceiptStage.d.ts +25 -2
  745. package/dist/esm/native/RiveReceiptStage.d.ts.map +1 -1
  746. package/dist/esm/native/RiveReceiptStage.js +7 -148
  747. package/dist/esm/native/RiveReceiptStage.js.map +1 -1
  748. package/dist/esm/native/riveReceiptStageFactory.d.ts +26 -0
  749. package/dist/esm/native/riveReceiptStageFactory.d.ts.map +1 -0
  750. package/dist/esm/native/riveReceiptStageFactory.js +159 -0
  751. package/dist/esm/native/riveReceiptStageFactory.js.map +1 -0
  752. package/dist/esm/tokens/stage.d.ts +7 -0
  753. package/dist/esm/tokens/stage.d.ts.map +1 -0
  754. package/dist/esm/tokens/stage.js +7 -0
  755. package/dist/esm/tokens/stage.js.map +1 -0
  756. package/docs/TYPE-SURFACE.md +183 -0
  757. package/package.json +38 -2
  758. package/spec/examples/components/onboarding/animated-status/case1.json +42 -0
  759. package/spec/examples/components/onboarding/animated-status/case2.json +42 -0
  760. package/spec/examples/components/onboarding/animated-status/case3.json +42 -0
  761. package/spec/examples/components/onboarding/animated-status/case4.json +42 -0
  762. package/spec/examples/components/onboarding/animated-status/case5.json +42 -0
  763. package/spec/examples/components/onboarding/send-completion/case1.json +48 -0
  764. package/spec/examples/components/onboarding/send-completion/case2.json +48 -0
  765. package/spec/examples/components/onboarding/send-completion/case3.json +48 -0
  766. package/spec/examples/components/onboarding/send-completion/case4.json +48 -0
  767. package/spec/examples/components/onboarding/send-completion/case5.json +48 -0
  768. package/spec/families/onboarding.schema.json +610 -1
  769. package/src/agent/AgentComponent.tsx +1 -1
  770. package/src/agent/manifests.ts +83 -1
  771. package/src/agent/result.ts +6 -0
  772. package/src/agent/types.ts +1 -1
  773. package/src/components/catalog.ts +21 -1
  774. package/src/components/onboarding/animated-status/AnimatedStage.tsx +18 -0
  775. package/src/components/onboarding/animated-status/AnimatedStage.types.ts +30 -0
  776. package/src/components/onboarding/animated-status/AnimatedStage.web.tsx +99 -0
  777. package/src/components/onboarding/animated-status/AnimatedStatusView.tsx +109 -0
  778. package/src/components/onboarding/animated-status/AnimatedStill.tsx +23 -0
  779. package/src/components/onboarding/animated-status/contract.ts +105 -0
  780. package/src/components/onboarding/animated-status/engine.ts +49 -0
  781. package/src/components/onboarding/animated-status/index.ts +8 -0
  782. package/src/components/onboarding/animated-status/presets.json +126 -0
  783. package/src/components/onboarding/animated-status/riv.ts +4 -0
  784. package/src/components/onboarding/index.ts +4 -0
  785. package/src/components/onboarding/presets.ts +6 -0
  786. package/src/components/onboarding/receipt-printer/ReceiptStage.tsx +46 -7
  787. package/src/components/onboarding/send-completion/SendCompletionView.tsx +164 -0
  788. package/src/components/onboarding/send-completion/SendStage.tsx +27 -0
  789. package/src/components/onboarding/send-completion/SendStage.types.ts +32 -0
  790. package/src/components/onboarding/send-completion/SendStage.web.tsx +116 -0
  791. package/src/components/onboarding/send-completion/SendStill.tsx +19 -0
  792. package/src/components/onboarding/send-completion/contract.ts +127 -0
  793. package/src/components/onboarding/send-completion/engine.ts +37 -0
  794. package/src/components/onboarding/send-completion/index.ts +10 -0
  795. package/src/components/onboarding/send-completion/presets.json +132 -0
  796. package/src/components/onboarding/send-completion/riv.ts +4 -0
  797. package/src/components/onboarding/shared/actions-data.ts +2 -0
  798. package/src/components/onboarding/shared/configColor.ts +72 -0
  799. package/src/components/onboarding/shared/contract.ts +4 -0
  800. package/src/components/onboarding/shared/describe.ts +1 -1
  801. package/src/components/onboarding/shared/mock.ts +2 -0
  802. package/src/components/onboarding/views.ts +8 -0
  803. package/src/motion/MotionPlayer.tsx +62 -0
  804. package/src/motion/agent.ts +288 -0
  805. package/src/motion/cat/Cat.tsx +118 -0
  806. package/src/motion/cat/animation.ts +206 -0
  807. package/src/motion/cat/art.generated.ts +44 -0
  808. package/src/motion/cat/config.ts +186 -0
  809. package/src/motion/cat/index.ts +26 -0
  810. package/src/motion/cat/rig.ts +102 -0
  811. package/src/motion/cat/scene.ts +181 -0
  812. package/src/motion/configurable/config.ts +420 -0
  813. package/src/motion/configurable/controls.ts +93 -0
  814. package/src/motion/easing.ts +55 -0
  815. package/src/motion/fit.ts +8 -0
  816. package/src/motion/index.ts +29 -0
  817. package/src/motion/neon/GlowRenderer.tsx +83 -0
  818. package/src/motion/neon/NeonCanvas.tsx +175 -0
  819. package/src/motion/neon/NeonText.tsx +113 -0
  820. package/src/motion/neon/NeonTextFrame.tsx +67 -0
  821. package/src/motion/neon/artwork.ts +95 -0
  822. package/src/motion/neon/audio.ts +162 -0
  823. package/src/motion/neon/config.ts +484 -0
  824. package/src/motion/neon/flicker.ts +225 -0
  825. package/src/motion/neon/fonts.ts +76 -0
  826. package/src/motion/neon/frame.ts +34 -0
  827. package/src/motion/neon/glitch.ts +142 -0
  828. package/src/motion/neon/index.ts +41 -0
  829. package/src/motion/neon/layers.tsx +209 -0
  830. package/src/motion/neon/material.ts +88 -0
  831. package/src/motion/neon/random.ts +40 -0
  832. package/src/motion/neon/scene.ts +610 -0
  833. package/src/motion/neon/synth.ts +188 -0
  834. package/src/motion/neon/typography.ts +102 -0
  835. package/src/motion/neon/wall.ts +157 -0
  836. package/src/motion/paperfold/PaperFold.tsx +45 -0
  837. package/src/motion/paperfold/PaperFoldFrame.tsx +576 -0
  838. package/src/motion/paperfold/PaperFoldPlayer.tsx +80 -0
  839. package/src/motion/paperfold/art.ts +455 -0
  840. package/src/motion/paperfold/config.ts +98 -0
  841. package/src/motion/paperfold/controls.ts +557 -0
  842. package/src/motion/paperfold/engine.ts +852 -0
  843. package/src/motion/paperfold/fonts.ts +21 -0
  844. package/src/motion/paperfold/index.ts +30 -0
  845. package/src/motion/paperfold/manipulate.ts +188 -0
  846. package/src/motion/paperfold/presets.ts +117 -0
  847. package/src/motion/paperfold/template.ts +38 -0
  848. package/src/motion/player.ts +207 -0
  849. package/src/motion/promo/PromoFrame.tsx +501 -0
  850. package/src/motion/promo/PromoShowcasePlayer.tsx +78 -0
  851. package/src/motion/promo/config.ts +479 -0
  852. package/src/motion/promo/controls.ts +643 -0
  853. package/src/motion/promo/easing.ts +36 -0
  854. package/src/motion/promo/engine.ts +587 -0
  855. package/src/motion/promo/fonts.ts +16 -0
  856. package/src/motion/promo/icons.tsx +29 -0
  857. package/src/motion/promo/index.ts +24 -0
  858. package/src/motion/promo/presets.ts +40 -0
  859. package/src/motion/promo/template.ts +36 -0
  860. package/src/motion/replication2/Replication2Player.tsx +115 -0
  861. package/src/motion/replication2/config.ts +323 -0
  862. package/src/motion/replication2/controls.ts +336 -0
  863. package/src/motion/replication2/driver.ts +92 -0
  864. package/src/motion/replication2/easing.ts +88 -0
  865. package/src/motion/replication2/engine.ts +539 -0
  866. package/src/motion/replication2/html.ts +87 -0
  867. package/src/motion/replication2/index.ts +14 -0
  868. package/src/motion/replication2/measure.ts +28 -0
  869. package/src/motion/replication2/metrics.ts +7 -0
  870. package/src/motion/replication2/presets.ts +63 -0
  871. package/src/motion/replication2/riv.ts +4 -0
  872. package/src/motion/replication2/rive-contract.ts +165 -0
  873. package/src/motion/replication2/template.ts +33 -0
  874. package/src/motion/sample.ts +173 -0
  875. package/src/motion/templates/hey-template.ts +1553 -0
  876. package/src/motion/templates/index.ts +17 -0
  877. package/src/motion/templates/word-motion.ts +1166 -0
  878. package/src/motion/types.ts +162 -0
  879. package/src/motion/typesurface/TypeSurfaceCanvas.tsx +101 -0
  880. package/src/motion/typesurface/art.ts +639 -0
  881. package/src/motion/typesurface/config.ts +512 -0
  882. package/src/motion/typesurface/construct.ts +828 -0
  883. package/src/motion/typesurface/engine.ts +612 -0
  884. package/src/motion/typesurface/fonts.ts +63 -0
  885. package/src/motion/typesurface/index.ts +20 -0
  886. package/src/motion/typesurface/layout.ts +133 -0
  887. package/src/motion/typesurface/ops.ts +196 -0
  888. package/src/motion/typesurface/presets.ts +271 -0
  889. package/src/motion/typesurface/renderer.ts +639 -0
  890. package/src/motion/typesurface/shaders.ts +325 -0
  891. package/src/motion/typesurface/surfaces.ts +300 -0
  892. package/src/motion/typesurface/text.ts +35 -0
  893. package/src/motion/typesurface/timeline.ts +58 -0
  894. package/src/motion/validate.ts +101 -0
  895. package/src/native/RiveReceiptStage.tsx +8 -155
  896. package/src/native/riveReceiptStageFactory.tsx +175 -0
  897. package/src/tokens/stage.ts +6 -0
  898. package/tools/ask/dist/components.mjs +8010 -88
  899. package/tools/ask/dist/neon.js +69 -0
  900. package/tools/ask/mcp.mjs +166 -2
  901. package/tools/ask/neon-render.mjs +143 -0
@@ -0,0 +1,612 @@
1
+ /**
2
+ * **The geometry engine.** One surface, one mesh, evaluated for a config at a moment:
3
+ *
4
+ * sheet the surface through its own shape → wrinkles → crumple → folds → roll → cylinder,
5
+ * then the rigid turns of the whole object (horizontal/vertical distortion)
6
+ * stack the pages under a newspaper's top sheet, offset along its normals
7
+ * text a mesh made of the SHEET'S OWN CELLS under the text block. Each vertex blends from
8
+ * its floating position (flat, above everything) to the sheet vertex it belongs to, so
9
+ * conformed letters lie on exactly the paper's triangles, crease for crease
10
+ * prop a solid the surface wraps (the bottle)
11
+ * guides fold lines, the roll line, the text outline and baselines, for the debug view
12
+ *
13
+ * Everything is written into buffers allocated once per surface, so a frame allocates nothing.
14
+ * Pure: no DOM, no React. The renderer uploads what this returns.
15
+ */
16
+ import { DEFAULT_TYPE_SURFACE, TS_FOLD_KEYS, TS_WRAP_KEYS, type TSFold, type TSWrap, type TypeSurfaceConfig } from './config';
17
+ import { glyphAt, morphGap, type TSTextLayout } from './layout';
18
+ import { bend, bendDistance, crumpleCreases, crumpleField, cylinder, roll, rotate, smoothstep, type Bend, type Crease, type Roll, type Vec3 } from './ops';
19
+ import type { ResolvedMaterial } from './construct';
20
+ import type { SurfaceDef } from './surfaces';
21
+
22
+ const DEG = Math.PI / 180;
23
+ const clamp01 = (v: number) => (v < 0 ? 0 : v > 1 ? 1 : v);
24
+ const sstep = (v: number) => { const t = clamp01(v); return t * t * (3 - 2 * t); };
25
+
26
+ export type TextMesh = {
27
+ positions: Float32Array;
28
+ normals: Float32Array;
29
+ /** The sheet's uv under each vertex: the text samples the paper it sits on. */
30
+ uvs: Float32Array;
31
+ /** Block coordinates, 0–1 across and down the text block. */
32
+ tuv: Float32Array;
33
+ /** Per vertex: conform (0 floating … 1 on the surface), crease light, cavity, flight. */
34
+ attrs: Float32Array;
35
+ indices: Uint32Array;
36
+ vertexCount: number;
37
+ indexCount: number;
38
+ /** Changes whenever `indices` does. */
39
+ indexVersion: number;
40
+ };
41
+
42
+ /** A solid's triangles that share one look: the wine bottle (`material: null`), or one part of a constructed object. */
43
+ export type PropRange = { start: number; count: number; material: ResolvedMaterial | null };
44
+ export type PropMesh = { positions: Float32Array; normals: Float32Array; attrs: Float32Array; indices: Uint32Array; vertexCount: number; ranges: PropRange[] };
45
+
46
+ export type Guides = {
47
+ folds: Float32Array[];
48
+ foldZones: Float32Array[];
49
+ roll: Float32Array | null;
50
+ textOutline: Float32Array | null;
51
+ baselines: Float32Array[];
52
+ /** Control points: text anchor and corners, crease ends. xyz triples. */
53
+ anchors: Float32Array;
54
+ };
55
+
56
+ export type SceneGeometry = {
57
+ def: SurfaceDef;
58
+ nu: number;
59
+ nv: number;
60
+ /** Sheet uv (static) and triangles (static). */
61
+ uvs: Float32Array;
62
+ indices: Uint32Array;
63
+ sheet: { positions: Float32Array; normals: Float32Array; attrs: Float32Array };
64
+ stack: Float32Array[];
65
+ loose: { positions: Float32Array; normals: Float32Array; uvs: Float32Array; indices: Uint32Array } | null;
66
+ text: TextMesh | null;
67
+ prop: PropMesh | null;
68
+ bounds: { min: Vec3; max: Vec3 };
69
+ tableZ: number;
70
+ target: Vec3;
71
+ /** Radius that frames the surface at rest (camera fit). */
72
+ radius: number;
73
+ guides: Guides | null;
74
+ };
75
+
76
+ export type GeometryEngine = {
77
+ def: SurfaceDef;
78
+ evaluate(config: TypeSurfaceConfig, timeMs: number, layout: TSTextLayout | null, opts?: { guides?: boolean }): SceneGeometry;
79
+ /** A sheet point (u, v in 0–1, v down) where it is right now, in world space. */
80
+ mapUv(u: number, v: number, out?: Vec3): Vec3;
81
+ };
82
+
83
+ type BendSpec = { b: Bend; infl: number; zone: number };
84
+
85
+ /** Normals by central differences over a grid, and cavity (how much a vertex sits in a valley). */
86
+ function gridNormals(pos: Float32Array, nrm: Float32Array, ni: number, nj: number, cav: Float32Array | null, cavStride: number, cavOffset: number, h: number): void {
87
+ for (let j = 0; j < nj; j++) {
88
+ const jp = j > 0 ? j - 1 : j, jm = j < nj - 1 ? j + 1 : j;
89
+ for (let i = 0; i < ni; i++) {
90
+ const ip = i < ni - 1 ? i + 1 : i, im = i > 0 ? i - 1 : i;
91
+ const a = (j * ni + ip) * 3, b = (j * ni + im) * 3, c = (jp * ni + i) * 3, d = (jm * ni + i) * 3;
92
+ const tx0 = pos[a]! - pos[b]!, tx1 = pos[a + 1]! - pos[b + 1]!, tx2 = pos[a + 2]! - pos[b + 2]!;
93
+ const ty0 = pos[c]! - pos[d]!, ty1 = pos[c + 1]! - pos[d + 1]!, ty2 = pos[c + 2]! - pos[d + 2]!;
94
+ let nx = tx1 * ty2 - tx2 * ty1, ny = tx2 * ty0 - tx0 * ty2, nz = tx0 * ty1 - tx1 * ty0;
95
+ const l = Math.hypot(nx, ny, nz) || 1;
96
+ nx /= l; ny /= l; nz /= l;
97
+ const k = (j * ni + i) * 3;
98
+ nrm[k] = nx; nrm[k + 1] = ny; nrm[k + 2] = nz;
99
+ if (cav) {
100
+ let v = 0;
101
+ if (i > 0 && i < ni - 1 && j > 0 && j < nj - 1) {
102
+ const lx = (pos[a]! + pos[b]! + pos[c]! + pos[d]!) / 4 - pos[k]!;
103
+ const ly = (pos[a + 1]! + pos[b + 1]! + pos[c + 1]! + pos[d + 1]!) / 4 - pos[k + 1]!;
104
+ const lz = (pos[a + 2]! + pos[b + 2]! + pos[c + 2]! + pos[d + 2]!) / 4 - pos[k + 2]!;
105
+ v = Math.max(-1, Math.min(1, ((lx * nx + ly * ny + lz * nz) / h) * 2.5));
106
+ }
107
+ cav[(j * ni + i) * cavStride + cavOffset] = v;
108
+ }
109
+ }
110
+ }
111
+ }
112
+
113
+ /** Two triangles per cell; the diagonal alternates by the SHEET's cell parity, so a sub-grid shares it. */
114
+ function gridIndices(ni: number, nj: number, i0: number, j0: number, out?: Uint32Array): Uint32Array {
115
+ const idx = out ?? new Uint32Array((ni - 1) * (nj - 1) * 6);
116
+ let o = 0;
117
+ for (let j = 0; j < nj - 1; j++) {
118
+ for (let i = 0; i < ni - 1; i++) {
119
+ const a = j * ni + i, b = a + 1, c = a + ni, d = c + 1;
120
+ if (((i + i0 + j + j0) & 1) === 1) { idx[o++] = a; idx[o++] = c; idx[o++] = b; idx[o++] = b; idx[o++] = c; idx[o++] = d; }
121
+ else { idx[o++] = a; idx[o++] = c; idx[o++] = d; idx[o++] = a; idx[o++] = d; idx[o++] = b; }
122
+ }
123
+ }
124
+ return idx;
125
+ }
126
+
127
+ /**
128
+ * A wine bottle of glass radius `radius`, revolved about the LABEL's axis (parallel to y at z = −axis),
129
+ * so a wrapped label sits exactly `axis − radius` off the glass all the way round.
130
+ */
131
+ function bottleMesh(radius: number, axis: number): { positions: Float32Array; normals: Float32Array; attrs: Float32Array; indices: Uint32Array; count: number } {
132
+ // (r, y) from the centre of the base to the centre of the lip, label-centred coordinates, drawn at
133
+ // a 0.36 body radius and scaled to `radius`.
134
+ const scale = radius / 0.36;
135
+ const key: [number, number][] = [
136
+ [0, -0.93], [0.2, -0.95], [0.31, -0.955], [0.345, -0.94], [0.36, -0.9], [0.36, 0.7], [0.352, 0.8], [0.32, 0.9], [0.26, 0.98], [0.19, 1.05],
137
+ [0.145, 1.12], [0.128, 1.2], [0.125, 1.3], [0.126, 1.55], [0.14, 1.565], [0.142, 1.63], [0.12, 1.645], [0, 1.65],
138
+ ];
139
+ // Densify so the shoulder is smooth.
140
+ const prof: [number, number][] = [];
141
+ for (let k = 0; k < key.length - 1; k++) {
142
+ const [r0, y0] = key[k]!, [r1, y1] = key[k + 1]!;
143
+ const steps = Math.max(1, Math.round(Math.hypot(r1 - r0, y1 - y0) / 0.04));
144
+ for (let s = 0; s < steps; s++) prof.push([r0 + ((r1 - r0) * s) / steps, y0 + ((y1 - y0) * s) / steps]);
145
+ }
146
+ prof.push(key[key.length - 1]!);
147
+ const segs = 96;
148
+ const np = prof.length;
149
+ const count = np * (segs + 1);
150
+ const positions = new Float32Array(count * 3), normals = new Float32Array(count * 3), attrs = new Float32Array(count * 4);
151
+ for (let p = 0; p < np; p++) {
152
+ const r = prof[p]![0] * scale, y = prof[p]![1];
153
+ const [ra, ya] = prof[Math.max(0, p - 1)]!, [rb, yb] = prof[Math.min(np - 1, p + 1)]!;
154
+ let n0 = yb - ya, n1 = -(rb - ra);
155
+ const l = Math.hypot(n0, n1) || 1;
156
+ n0 /= l; n1 /= l;
157
+ for (let q = 0; q <= segs; q++) {
158
+ const a = (q / segs) * Math.PI * 2;
159
+ const k = p * (segs + 1) + q;
160
+ positions[k * 3] = r * Math.sin(a);
161
+ positions[k * 3 + 1] = y;
162
+ positions[k * 3 + 2] = -axis + r * Math.cos(a);
163
+ normals[k * 3] = n0 * Math.sin(a);
164
+ normals[k * 3 + 1] = n1;
165
+ normals[k * 3 + 2] = n0 * Math.cos(a);
166
+ attrs[k * 4] = y > 1.2 ? 1 : 0; // 1: foil capsule
167
+ }
168
+ }
169
+ const idx: number[] = [];
170
+ for (let p = 0; p < np - 1; p++) {
171
+ for (let q = 0; q < segs; q++) {
172
+ const a = p * (segs + 1) + q, b = a + 1, c = a + segs + 1, d = c + 1;
173
+ idx.push(a, b, c, b, d, c);
174
+ }
175
+ }
176
+ return { positions, normals, attrs, indices: new Uint32Array(idx), count };
177
+ }
178
+
179
+ /** Build the engine for one surface. Allocates its buffers once. */
180
+ export function createGeometryEngine(def: SurfaceDef): GeometryEngine {
181
+ const [nu, nv] = def.grid;
182
+ const N = nu * nv;
183
+ const W = def.width;
184
+ const Hs = def.height / def.width;
185
+ const h = W / (nu - 1);
186
+
187
+ const sx = new Float32Array(N), sy = new Float32Array(N);
188
+ const uvs = new Float32Array(N * 2);
189
+ for (let j = 0; j < nv; j++) {
190
+ for (let i = 0; i < nu; i++) {
191
+ const k = j * nu + i;
192
+ sx[k] = i / (nu - 1) - 0.5;
193
+ sy[k] = (0.5 - j / (nv - 1)) * Hs;
194
+ uvs[k * 2] = i / (nu - 1);
195
+ uvs[k * 2 + 1] = j / (nv - 1);
196
+ }
197
+ }
198
+ const indices = gridIndices(nu, nv, 0, 0);
199
+
200
+ const pos = new Float32Array(N * 3), nrm = new Float32Array(N * 3), attrs = new Float32Array(N * 4);
201
+ const stack = Array.from({ length: def.stack?.sheets ?? 0 }, () => new Float32Array(N * 3));
202
+
203
+ // Crumple fields, cached per (seed, scale): a whole-sheet evaluation is ~20 ms, a frame reuses it.
204
+ const fieldCache = new Map<string, { creases: Crease[]; full: Float32Array; fine: Float32Array }>();
205
+ const fieldFor = (seed: number, scale: number) => {
206
+ const key = `${seed}:${scale.toFixed(3)}`;
207
+ let f = fieldCache.get(key);
208
+ if (!f) {
209
+ const creases = crumpleCreases(seed, scale, Hs);
210
+ const full = new Float32Array(N * 3), fine = new Float32Array(N);
211
+ const o: Vec3 = [0, 0, 0];
212
+ for (let k = 0; k < N; k++) {
213
+ crumpleField(creases, sx[k]!, sy[k]!, o);
214
+ full[k * 3] = o[0]; full[k * 3 + 1] = o[1]; full[k * 3 + 2] = o[2];
215
+ crumpleField(creases, sx[k]!, sy[k]!, o, true);
216
+ fine[k] = o[2];
217
+ }
218
+ if (fieldCache.size > 6) fieldCache.clear();
219
+ f = { creases, full, fine };
220
+ fieldCache.set(key, f);
221
+ }
222
+ return f;
223
+ };
224
+
225
+ const text: TextMesh = {
226
+ positions: new Float32Array(N * 3), normals: new Float32Array(N * 3), uvs: new Float32Array(N * 2), tuv: new Float32Array(N * 2),
227
+ attrs: new Float32Array(N * 4), indices: new Uint32Array((nu - 1) * (nv - 1) * 6), vertexCount: 0, indexCount: 0, indexVersion: 0,
228
+ };
229
+ let textRect = '';
230
+
231
+ // The solid the sheet wraps: the wine bottle, or a constructed object's parts.
232
+ const bottle = def.prop === 'bottle' ? bottleMesh(def.curveRadius - 0.0025, def.curveRadius)
233
+ : def.solid ? { ...def.solid, attrs: new Float32Array(def.solid.count * 4) } : null;
234
+ const prop: PropMesh | null = bottle
235
+ ? {
236
+ positions: new Float32Array(bottle.count * 3), normals: new Float32Array(bottle.count * 3), attrs: bottle.attrs, indices: bottle.indices, vertexCount: bottle.count,
237
+ ranges: def.solid?.ranges ?? [{ start: 0, count: bottle.indices.length, material: null }],
238
+ }
239
+ : null;
240
+ const solid = !!(def.prop || def.solid);
241
+
242
+ const loose = def.looseSheet
243
+ ? { positions: new Float32Array(12), normals: new Float32Array([0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1]), uvs: new Float32Array([0, 0, 1, 0, 0, 1, 1, 1]), indices: new Uint32Array([0, 2, 1, 1, 2, 3]) }
244
+ : null;
245
+
246
+ // ---- the frame's parameters, set by `evaluate`, read by `pipe` ----
247
+ let F = {
248
+ d: DEFAULT_TYPE_SURFACE.deformation, t: 0, motion: 1, skew: 0, crumpleA: 0, shrink: 1, bowl: 0, wrinkleA: 0,
249
+ bends: [] as BendSpec[], roll: null as Roll | null, kappa: 0, spin: 0,
250
+ rotA: 0, rotB: 0, rotC: 0, shiftX: 0, shiftY: 0,
251
+ creases: [] as Crease[],
252
+ };
253
+
254
+ /** One sheet point through the surface's operators (before the object's rigid turns). Returns crease light. */
255
+ const pipe = (x0: number, y0: number, fx: number, fy: number, fz: number, gz: number, p: Vec3): number => {
256
+ const x = x0 * W, y = y0 * W;
257
+ p[0] = x + F.skew * 0.35 * y; p[1] = y; p[2] = 0;
258
+ def.shape?.(p, x0, y0, F.d, F.t, F.motion);
259
+ if (F.wrinkleA) p[2] += gz * W * F.wrinkleA;
260
+ if (F.crumpleA) {
261
+ p[0] += fx * W * F.crumpleA; p[1] += fy * W * F.crumpleA; p[2] += fz * W * F.crumpleA;
262
+ p[0] *= F.shrink; p[1] *= F.shrink;
263
+ if (F.bowl) p[2] += F.bowl * W * ((p[0] / W) ** 2 + (p[1] / W) ** 2);
264
+ }
265
+ let crease = 0;
266
+ for (const s of F.bends) {
267
+ const dist = bendDistance(p[0], p[1], s.b);
268
+ crease += s.infl * Math.exp(-((dist / s.zone) ** 2));
269
+ bend(p, s.b);
270
+ }
271
+ if (F.roll) roll(p, F.roll);
272
+ if (F.kappa) {
273
+ cylinder(p, F.kappa);
274
+ if (def.radiusAt) {
275
+ // Follow the part's own radius at this height (a taper, a bulge), about the cylinder's axis.
276
+ const k = 1 + (def.radiusAt(p[1]) / def.curveRadius - 1) * F.d.curve, A = 1 / F.kappa;
277
+ p[0] *= k;
278
+ p[2] = (p[2] + A) * k - A;
279
+ }
280
+ if (F.spin) {
281
+ const R = def.curveRadius;
282
+ const zz = p[2] + R, c = Math.cos(F.spin), s = Math.sin(F.spin);
283
+ const xx = p[0] * c + zz * s;
284
+ p[2] = -p[0] * s + zz * c - R;
285
+ p[0] = xx;
286
+ }
287
+ }
288
+ return crease;
289
+ };
290
+ const place = (p: Vec3) => {
291
+ rotate(p, F.rotA, F.rotB, F.rotC);
292
+ p[0] += F.shiftX; p[1] += F.shiftY;
293
+ };
294
+
295
+ const fieldAt = (x0: number, y0: number, o: Vec3, g: Vec3) => {
296
+ if (F.crumpleA) crumpleField(F.creases, x0, y0, o); else { o[0] = 0; o[1] = 0; o[2] = 0; }
297
+ if (F.wrinkleA) crumpleField(F.creases, x0, y0, g, true); else g[2] = 0;
298
+ };
299
+ const mapSheet = (x0: number, y0: number, out: Vec3): Vec3 => {
300
+ const o: Vec3 = [0, 0, 0], g: Vec3 = [0, 0, 0];
301
+ fieldAt(x0, y0, o, g);
302
+ pipe(x0, y0, o[0], o[1], o[2], g[2], out);
303
+ place(out);
304
+ return out;
305
+ };
306
+
307
+ /** A crease line; `near` flips which side moves. */
308
+ const creaseLine = (position: number, orientation: TSFold['orientation'], side: TSFold['side'], shrink: number) => {
309
+ const flip = side === 'near' ? -1 : 1;
310
+ return orientation === 'vertical'
311
+ ? { px: (position - 0.5) * W * shrink, py: 0, dx: 0, dy: flip }
312
+ : { px: 0, py: (0.5 - position) * def.height * shrink, dx: flip, dy: 0 };
313
+ };
314
+ const foldBend = (f: TSFold, shrink: number): BendSpec | null => {
315
+ if (f.amount <= 0.0005) return null;
316
+ const theta = f.angle * f.amount * DEG * (f.direction === 'over' ? 1 : -1);
317
+ const width = Math.max(0.002, f.width * W);
318
+ const b: Bend = { ...creaseLine(f.position, f.orientation, f.side ?? 'far', shrink), theta, width };
319
+ return { b, infl: f.influence * Math.min(1, f.amount * 2.5), zone: width * 0.8 + 0.004 };
320
+ };
321
+ /** A wrap is a bend whose zone is a rod: its width grows with the angle so the radius stays put. */
322
+ const wrapBend = (w: TSWrap, shrink: number): BendSpec | null => {
323
+ if (w.amount <= 0.0005) return null;
324
+ const turn = w.angle * w.amount * DEG;
325
+ const theta = turn * (w.direction === 'over' ? 1 : -1);
326
+ const b: Bend = { ...creaseLine(w.position, w.orientation, w.side ?? 'far', shrink), theta, width: Math.max(0.002, turn * w.radius * W) };
327
+ return { b, infl: 0, zone: 1 };
328
+ };
329
+
330
+ const scratch: Vec3 = [0, 0, 0];
331
+ /** The solid turns with its label, about the wrap axis (a mug's handle comes round with the words). */
332
+ const spinSolid = (p: Vec3, direction = false) => {
333
+ if (!F.spin) return;
334
+ const R = direction ? 0 : def.curveRadius;
335
+ const zz = p[2] + R, c = Math.cos(F.spin), s = Math.sin(F.spin);
336
+ const xx = p[0] * c + zz * s;
337
+ p[2] = -p[0] * s + zz * c - R;
338
+ p[0] = xx;
339
+ };
340
+
341
+ const evaluate: GeometryEngine['evaluate'] = (cfg, timeMs, layout, opts) => {
342
+ const d = cfg.deformation;
343
+ const c = d.crumple.amount;
344
+ const field = c > 0 || d.wrinkle > 0 ? fieldFor(cfg.surface.seed, d.crumple.scale) : null;
345
+ const shrink = 1 - 0.06 * c - 0.2 * smoothstep(0.55, 1, c);
346
+ const bends = [...TS_FOLD_KEYS.map((k) => foldBend(d[k], shrink)), ...TS_WRAP_KEYS.map((k) => wrapBend(d[k], shrink))].filter((x): x is BendSpec => !!x);
347
+ // A later crease in the same direction wraps the layers the earlier one laid on its inner side.
348
+ for (let i = 1; i < bends.length; i++) {
349
+ for (let k = 0; k < i; k++) {
350
+ const a = bends[k]!.b, b = bends[i]!.b;
351
+ if (Math.sign(a.theta) === Math.sign(b.theta)) b.core = (b.core ?? 0) + (2 * a.width / Math.abs(a.theta)) * Math.min(1, Math.abs(a.theta) / Math.PI);
352
+ else if (Math.abs(a.theta) > Math.PI) b.core = (b.core ?? 0) + (a.width / Math.abs(a.theta)) * 2;
353
+ }
354
+ }
355
+ let rl: Roll | null = null;
356
+ if (d.roll.amount > 0.0005) {
357
+ const edge = d.roll.edge;
358
+ const vertical = edge === 'bottom' || edge === 'top';
359
+ const len = (vertical ? def.height : W) * shrink;
360
+ const sgn = edge === 'bottom' || edge === 'left' ? -1 : 1;
361
+ const radius = d.roll.radius * W;
362
+ rl = {
363
+ ox: vertical ? 0 : (sgn * W * shrink) / 2, oy: vertical ? (sgn * def.height * shrink) / 2 : 0,
364
+ ex: vertical ? 0 : -sgn, ey: vertical ? -sgn : 0,
365
+ reach: d.roll.amount * len, radius, inner: radius * 0.45, length: len, sign: d.roll.direction === 'under' ? -1 : 1,
366
+ };
367
+ }
368
+ const kappa = def.curveMode === 'cylinder' && d.curve > 0.0005 ? d.curve / def.curveRadius : 0;
369
+ F = {
370
+ d, t: timeMs, motion: cfg.view.motion, skew: d.skew,
371
+ crumpleA: c > 0 ? c * (0.5 + 0.5 * smoothstep(0.5, 1, c)) : 0, shrink: c > 0 ? shrink : 1, bowl: 0.35 * smoothstep(0.55, 1, c),
372
+ wrinkleA: d.wrinkle > 0 ? d.wrinkle * def.wrinkleDepth * 60 : 0,
373
+ bends, roll: rl, kappa,
374
+ spin: solid ? d.curve * cfg.view.motion * 0.5 * Math.sin((2 * Math.PI * timeMs) / 10000) : 0,
375
+ rotA: d.tiltX * 0.6, rotB: -d.tiltY * 0.6, rotC: cfg.view.roll * DEG, shiftX: 0, shiftY: 0,
376
+ creases: field?.creases ?? [],
377
+ };
378
+
379
+ // ---- the sheet ----
380
+ let zTop = -Infinity;
381
+ const min: Vec3 = [Infinity, Infinity, Infinity], max: Vec3 = [-Infinity, -Infinity, -Infinity];
382
+ for (let k = 0; k < N; k++) {
383
+ const x0 = sx[k]!, y0 = sy[k]!;
384
+ const crease = pipe(x0, y0, field ? field.full[k * 3]! : 0, field ? field.full[k * 3 + 1]! : 0, field ? field.full[k * 3 + 2]! : 0, field ? field.fine[k]! : 0, scratch);
385
+ if (scratch[2] > zTop) zTop = scratch[2];
386
+ const fxw = x0 * W + F.skew * 0.35 * y0 * W;
387
+ attrs[k * 4] = Math.min(1, crease);
388
+ attrs[k * 4 + 2] = Math.hypot(scratch[0] - fxw, scratch[1] - y0 * W, scratch[2]) / W;
389
+ rotate(scratch, F.rotA, F.rotB, F.rotC);
390
+ pos[k * 3] = scratch[0]; pos[k * 3 + 1] = scratch[1]; pos[k * 3 + 2] = scratch[2];
391
+ for (let a = 0; a < 3; a++) { const v = scratch[a]!; if (v < min[a]!) min[a] = v; if (v > max[a]!) max[a] = v; }
392
+ }
393
+ if (prop && bottle) {
394
+ for (let k = 0; k < bottle.count; k++) {
395
+ scratch[0] = bottle.positions[k * 3]!; scratch[1] = bottle.positions[k * 3 + 1]!; scratch[2] = bottle.positions[k * 3 + 2]!;
396
+ spinSolid(scratch);
397
+ rotate(scratch, F.rotA, F.rotB, F.rotC);
398
+ prop.positions.set(scratch, k * 3);
399
+ for (let a = 0; a < 3; a++) { const v = scratch[a]!; if (v < min[a]!) min[a] = v; if (v > max[a]!) max[a] = v; }
400
+ scratch[0] = bottle.normals[k * 3]!; scratch[1] = bottle.normals[k * 3 + 1]!; scratch[2] = bottle.normals[k * 3 + 2]!;
401
+ spinSolid(scratch, true);
402
+ rotate(scratch, F.rotA, F.rotB, F.rotC);
403
+ prop.normals.set(scratch, k * 3);
404
+ }
405
+ }
406
+ if (cfg.view.autoCenter) {
407
+ F.shiftX = -(min[0] + max[0]) / 2;
408
+ F.shiftY = -(min[1] + max[1]) / 2;
409
+ for (let k = 0; k < N; k++) { pos[k * 3] = pos[k * 3]! + F.shiftX; pos[k * 3 + 1] = pos[k * 3 + 1]! + F.shiftY; }
410
+ if (prop) for (let k = 0; k < prop.vertexCount; k++) { prop.positions[k * 3] = prop.positions[k * 3]! + F.shiftX; prop.positions[k * 3 + 1] = prop.positions[k * 3 + 1]! + F.shiftY; }
411
+ min[0] += F.shiftX; max[0] += F.shiftX; min[1] += F.shiftY; max[1] += F.shiftY;
412
+ }
413
+ gridNormals(pos, nrm, nu, nv, attrs, 4, 1, h);
414
+
415
+ // ---- the pages under it: offset along the normal, edges not quite aligned ----
416
+ const st = def.stack;
417
+ stack.forEach((out, si) => {
418
+ const gap = (st?.gap ?? 0.003) * (si + 1);
419
+ const ext = si === 0 ? [0.004, 0.007, 0.003, 0.009] : [0.009, 0.003, 0.006, 0.004]; // left, right, top, bottom
420
+ for (let j = 0; j < nv; j++) {
421
+ for (let i = 0; i < nu; i++) {
422
+ const k = j * nu + i;
423
+ let x = pos[k * 3]! - nrm[k * 3]! * gap, y = pos[k * 3 + 1]! - nrm[k * 3 + 1]! * gap, z = pos[k * 3 + 2]! - nrm[k * 3 + 2]! * gap;
424
+ const push = (to: number, e: number) => {
425
+ const tx = pos[k * 3]! - pos[to * 3]!, ty = pos[k * 3 + 1]! - pos[to * 3 + 1]!, tz = pos[k * 3 + 2]! - pos[to * 3 + 2]!;
426
+ const l = Math.hypot(tx, ty, tz) || 1;
427
+ x += (tx / l) * e * W; y += (ty / l) * e * W; z += (tz / l) * e * W;
428
+ };
429
+ if (i === 0) push(k + 1, ext[0]!);
430
+ if (i === nu - 1) push(k - 1, ext[1]!);
431
+ if (j === 0) push(k + nu, ext[2]!);
432
+ if (j === nv - 1) push(k - nu, ext[3]!);
433
+ out[k * 3] = x; out[k * 3 + 1] = y; out[k * 3 + 2] = z;
434
+ if (z < min[2]) min[2] = z;
435
+ }
436
+ }
437
+ });
438
+ const tableZ = min[2] - 0.004 * W;
439
+
440
+ if (loose) {
441
+ const a = -7 * DEG, cx = 0.2 * W + (cfg.view.autoCenter ? F.shiftX : 0), cy = -0.12 * W + (cfg.view.autoCenter ? F.shiftY : 0);
442
+ const hw = W / 2, hh = def.height / 2;
443
+ const corners: [number, number][] = [[-hw, hh], [hw, hh], [-hw, -hh], [hw, -hh]];
444
+ corners.forEach(([x, y], k) => {
445
+ loose.positions[k * 3] = cx + x * Math.cos(a) - y * Math.sin(a);
446
+ loose.positions[k * 3 + 1] = cy + x * Math.sin(a) + y * Math.cos(a);
447
+ loose.positions[k * 3 + 2] = tableZ + 0.0008;
448
+ });
449
+ }
450
+
451
+ // ---- the text: the sheet's own cells under the block ----
452
+ let textOut: TextMesh | null = null;
453
+ if (layout) {
454
+ const pl = cfg.placement;
455
+ const fs = layout.fontSize;
456
+ const gap = morphGap(d.morph, layout);
457
+ const most = Math.max(1, ...layout.lines.map((l) => l.glyphs.length));
458
+ const spread = (gap * (most - 1)) / 2 + fs * 0.1;
459
+ const rot = pl.rotation * DEG;
460
+ const ax = [Math.cos(rot), -Math.sin(rot)], ay = [-Math.sin(rot), -Math.cos(rot)]; // block x, block y (down) on the sheet
461
+ const cx = pl.x - 0.5, cy = (0.5 - pl.y) * Hs;
462
+ const bw = layout.width, bh = layout.height;
463
+ let iMin = nu, iMax = 0, jMin = nv, jMax = 0;
464
+ for (const [bx, by] of [[-spread, 0], [bw + spread, 0], [-spread, bh], [bw + spread, bh]] as const) {
465
+ const ux = cx + (ax[0]! * (bx - bw / 2) + ay[0]! * (by - bh / 2)) / 1000;
466
+ const uy = cy + (ax[1]! * (bx - bw / 2) + ay[1]! * (by - bh / 2)) / 1000;
467
+ const fi = (ux + 0.5) * (nu - 1), fj = (0.5 - uy / Hs) * (nv - 1);
468
+ iMin = Math.min(iMin, Math.floor(fi) - 1); iMax = Math.max(iMax, Math.ceil(fi) + 1);
469
+ jMin = Math.min(jMin, Math.floor(fj) - 1); jMax = Math.max(jMax, Math.ceil(fj) + 1);
470
+ }
471
+ iMin = Math.max(0, iMin); jMin = Math.max(0, jMin); iMax = Math.min(nu - 1, iMax); jMax = Math.min(nv - 1, jMax);
472
+ if (iMax > iMin && jMax > jMin) {
473
+ const ni = iMax - iMin + 1, nj = jMax - jMin + 1;
474
+ const rect = `${iMin},${jMin},${ni},${nj}`;
475
+ if (rect !== textRect) {
476
+ textRect = rect;
477
+ gridIndices(ni, nj, iMin, jMin, text.indices);
478
+ text.indexCount = (ni - 1) * (nj - 1) * 6;
479
+ text.indexVersion++;
480
+ }
481
+ text.vertexCount = ni * nj;
482
+ const liftH = cfg.material.lift * W;
483
+ const eps = 0.0009 * W;
484
+ const S = 1.6;
485
+ const denom = Math.max(1, layout.glyphCount - 1);
486
+ const rp = text.positions, rn = text.normals;
487
+ for (let j = 0; j < nj; j++) {
488
+ for (let i = 0; i < ni; i++) {
489
+ const t = j * ni + i;
490
+ const k = (j + jMin) * nu + (i + iMin);
491
+ const rx = sx[k]! - cx, ry = sy[k]! - cy;
492
+ const bx = (rx * ax[0]! + ry * ax[1]!) * 1000 + bw / 2;
493
+ const by = (rx * ay[0]! + ry * ay[1]!) * 1000 + bh / 2;
494
+ const tu = bx / bw, tv = by / bh;
495
+ text.tuv[t * 2] = tu; text.tuv[t * 2 + 1] = tv;
496
+ text.uvs[t * 2] = uvs[k * 2]!; text.uvs[t * 2 + 1] = uvs[k * 2 + 1]!;
497
+ const wrapW = sstep(d.wrap * 1.3 - clamp01(tu) * 0.3);
498
+ let mg = 0;
499
+ if (d.morph > 0) {
500
+ const g = glyphAt(layout, bx, by, gap);
501
+ const o = g ? Math.min(1, g.glyph.order / denom) : 0;
502
+ mg = sstep(d.morph * (1 + S) - o * S);
503
+ }
504
+ const w = 1 - (1 - wrapW) * (1 - mg);
505
+ const flight = 4 * mg * (1 - mg) * (1 - wrapW);
506
+ // Floating position: the flat sheet, lifted above everything, then the same rigid turns.
507
+ scratch[0] = sx[k]! * W + F.skew * 0.35 * sy[k]! * W; scratch[1] = sy[k]! * W; scratch[2] = zTop + liftH * (1 + flight * 0.6);
508
+ place(scratch);
509
+ const sxp = pos[k * 3]! + nrm[k * 3]! * eps, syp = pos[k * 3 + 1]! + nrm[k * 3 + 1]! * eps, szp = pos[k * 3 + 2]! + nrm[k * 3 + 2]! * eps;
510
+ rp[t * 3] = scratch[0] + (sxp - scratch[0]) * w;
511
+ rp[t * 3 + 1] = scratch[1] + (syp - scratch[1]) * w;
512
+ rp[t * 3 + 2] = scratch[2] + (szp - scratch[2]) * w;
513
+ text.attrs[t * 4] = w;
514
+ text.attrs[t * 4 + 1] = attrs[k * 4]!;
515
+ text.attrs[t * 4 + 2] = attrs[k * 4 + 1]!;
516
+ text.attrs[t * 4 + 3] = flight;
517
+ }
518
+ }
519
+ gridNormals(rp, rn, ni, nj, null, 0, 0, h);
520
+ textOut = text;
521
+ }
522
+ }
523
+
524
+ // ---- debug guides ----
525
+ let guides: Guides | null = null;
526
+ if (opts?.guides) {
527
+ const line = (from: [number, number], to: [number, number], steps = 80) => {
528
+ const out = new Float32Array((steps + 1) * 3);
529
+ const p: Vec3 = [0, 0, 0];
530
+ for (let s = 0; s <= steps; s++) {
531
+ const f = s / steps;
532
+ mapSheet(from[0] + (to[0] - from[0]) * f, from[1] + (to[1] - from[1]) * f, p);
533
+ out.set(p, s * 3);
534
+ }
535
+ return out;
536
+ };
537
+ const half = Hs / 2;
538
+ const folds: Float32Array[] = [], zones: Float32Array[] = [];
539
+ const anchors: number[] = [];
540
+ for (const f of [...TS_FOLD_KEYS.map((k) => d[k]), ...TS_WRAP_KEYS.map((k) => ({ ...d[k], width: d[k].angle * DEG * d[k].amount * d[k].radius }))]) {
541
+ if (f.amount <= 0.0005) continue;
542
+ const wz = f.width * ((f.side ?? 'far') === 'near' ? -1 : 1);
543
+ if (f.orientation === 'vertical') {
544
+ const x = f.position - 0.5;
545
+ folds.push(line([x, -half], [x, half]));
546
+ zones.push(line([x + wz, -half], [x + wz, half]));
547
+ } else {
548
+ const y = (0.5 - f.position) * Hs;
549
+ folds.push(line([-0.5, y], [0.5, y]));
550
+ zones.push(line([-0.5, y - wz], [0.5, y - wz]));
551
+ }
552
+ const fl = folds[folds.length - 1]!;
553
+ anchors.push(fl[0]!, fl[1]!, fl[2]!, fl[fl.length - 3]!, fl[fl.length - 2]!, fl[fl.length - 1]!);
554
+ }
555
+ let rollLine: Float32Array | null = null;
556
+ if (d.roll.amount > 0.0005) {
557
+ const e = d.roll.edge, a = d.roll.amount;
558
+ rollLine = e === 'bottom' ? line([-0.5, -half + a * Hs], [0.5, -half + a * Hs]) : e === 'top' ? line([-0.5, half - a * Hs], [0.5, half - a * Hs])
559
+ : e === 'left' ? line([-0.5 + a, -half], [-0.5 + a, half]) : line([0.5 - a, -half], [0.5 - a, half]);
560
+ }
561
+ let outline: Float32Array | null = null;
562
+ const baselines: Float32Array[] = [];
563
+ if (layout) {
564
+ const pl = cfg.placement, rot = pl.rotation * DEG;
565
+ const ax = [Math.cos(rot), -Math.sin(rot)], ay = [-Math.sin(rot), -Math.cos(rot)];
566
+ const cx = pl.x - 0.5, cy = (0.5 - pl.y) * Hs;
567
+ const toSheet = (bx: number, by: number): [number, number] => [
568
+ cx + (ax[0]! * (bx - layout.width / 2) + ay[0]! * (by - layout.height / 2)) / 1000,
569
+ cy + (ax[1]! * (bx - layout.width / 2) + ay[1]! * (by - layout.height / 2)) / 1000,
570
+ ];
571
+ const p = layout.pad;
572
+ const c0 = toSheet(p, p), c1 = toSheet(layout.width - p, p), c2 = toSheet(layout.width - p, layout.height - p), c3 = toSheet(p, layout.height - p);
573
+ const parts = [line(c0, c1, 40), line(c1, c2, 20), line(c2, c3, 40), line(c3, c0, 20)];
574
+ outline = new Float32Array(parts.reduce((n, a) => n + a.length, 0));
575
+ let o = 0;
576
+ for (const a of parts) { outline.set(a, o); o += a.length; }
577
+ for (const l of layout.lines) baselines.push(line(toSheet(l.left, l.baseline), toSheet(l.left + l.width, l.baseline), 40));
578
+ const mid = mapSheet(cx, cy, [0, 0, 0]);
579
+ anchors.push(...mid, ...outline.subarray(0, 3));
580
+ }
581
+ guides = { folds, foldZones: zones, roll: rollLine, textOutline: outline, baselines, anchors: new Float32Array(anchors) };
582
+ }
583
+
584
+ const radius = def.frameRadius ?? (def.prop === 'bottle' ? 1.45 : 0.5 * Math.hypot(W, def.height) * 1.04);
585
+ return {
586
+ def, nu, nv, uvs, indices,
587
+ sheet: { positions: pos, normals: nrm, attrs },
588
+ stack, loose, text: textOut, prop,
589
+ bounds: { min, max }, tableZ,
590
+ target: [0, 0, (min[2] + max[2]) / 2],
591
+ radius, guides,
592
+ };
593
+ };
594
+
595
+ return {
596
+ def,
597
+ evaluate,
598
+ mapUv: (u, v, out = [0, 0, 0]) => mapSheet(u - 0.5, (0.5 - v) * Hs, out),
599
+ };
600
+ }
601
+
602
+ /** Which sheet vertex a text vertex sits on (exposed for tests: conformed text is the sheet). */
603
+ export function textVertexOnSheet(geometry: SceneGeometry, textVertex: number): number {
604
+ const t = geometry.text;
605
+ if (!t) return -1;
606
+ // The text mesh is a sub-grid; recover its origin from its first uv.
607
+ const i0 = Math.round(t.uvs[0]! * (geometry.nu - 1)), j0 = Math.round(t.uvs[1]! * (geometry.nv - 1));
608
+ const iEnd = Math.round(t.uvs[(t.vertexCount - 1) * 2]! * (geometry.nu - 1));
609
+ const ni = iEnd - i0 + 1;
610
+ const i = textVertex % ni, j = Math.floor(textVertex / ni);
611
+ return (j + j0) * geometry.nu + (i + i0);
612
+ }
@@ -0,0 +1,63 @@
1
+ /**
2
+ * **Fonts for the lab.** Seven categories, because deformation reads differently on each: a thin
3
+ * serif's hairlines vanish into a crease where a condensed display face's slabs don't, and a
4
+ * monospace line lands letter by letter at an even beat. The page loads them with one Google Fonts
5
+ * stylesheet (`typeSurfaceFontsUrl`); the artwork's own faces (masthead, body copy) are in it too.
6
+ */
7
+ export type TSFontCategory = 'sans' | 'serif' | 'condensed' | 'display' | 'italic' | 'mono' | 'decorative';
8
+
9
+ export type TSFont = {
10
+ id: string;
11
+ name: string;
12
+ category: TSFontCategory;
13
+ /** CSS font-family list. */
14
+ family: string;
15
+ weights: number[];
16
+ italic: boolean;
17
+ /** Google Fonts css2 `family=` value. */
18
+ google: string;
19
+ };
20
+
21
+ const f = (id: string, name: string, category: TSFontCategory, fallback: string, weights: number[], italic: boolean): TSFont => {
22
+ const plus = name.replace(/ /g, '+');
23
+ const google = weights.length === 1 && !italic
24
+ ? plus
25
+ : italic
26
+ ? `${plus}:ital,wght@${[...weights.map((w) => `0,${w}`), ...weights.map((w) => `1,${w}`)].join(';')}`
27
+ : `${plus}:wght@${weights.join(';')}`;
28
+ return { id, name, category, family: `'${name}', ${fallback}`, weights, italic, google };
29
+ };
30
+
31
+ export const TS_FONT_CATEGORIES: Record<TSFontCategory, string> = {
32
+ sans: 'Sans serif', serif: 'Serif', condensed: 'Condensed', display: 'Bold display', italic: 'Italic', mono: 'Monospace', decorative: 'Decorative',
33
+ };
34
+
35
+ export const TS_FONTS: TSFont[] = [
36
+ f('inter', 'Inter', 'sans', 'system-ui, sans-serif', [400, 600, 800, 900], false),
37
+ f('archivo-black', 'Archivo Black', 'sans', 'Arial Black, sans-serif', [400], false),
38
+ f('playfair', 'Playfair Display', 'serif', 'Georgia, serif', [400, 700, 900], true),
39
+ f('old-standard', 'Old Standard TT', 'serif', 'Times New Roman, serif', [400, 700], true),
40
+ f('anton', 'Anton', 'condensed', 'Impact, sans-serif', [400], false),
41
+ f('oswald', 'Oswald', 'condensed', 'Arial Narrow, sans-serif', [300, 500, 700], false),
42
+ f('bebas', 'Bebas Neue', 'condensed', 'Impact, sans-serif', [400], false),
43
+ f('abril', 'Abril Fatface', 'display', 'Georgia, serif', [400], false),
44
+ f('dm-serif', 'DM Serif Display', 'display', 'Georgia, serif', [400], true),
45
+ f('libre-baskerville', 'Libre Baskerville', 'italic', 'Georgia, serif', [400, 700], true),
46
+ f('ibm-plex-mono', 'IBM Plex Mono', 'mono', 'ui-monospace, monospace', [400, 700], true),
47
+ f('space-mono', 'Space Mono', 'mono', 'ui-monospace, monospace', [400, 700], false),
48
+ f('lobster', 'Lobster', 'decorative', 'cursive', [400], false),
49
+ f('permanent-marker', 'Permanent Marker', 'decorative', 'cursive', [400], false),
50
+ f('unifraktur', 'UnifrakturMaguntia', 'decorative', 'serif', [400], false),
51
+ f('monoton', 'Monoton', 'decorative', 'cursive', [400], false),
52
+ ];
53
+
54
+ /** Find a font by id, name or family ("Anton", "anton", "'Anton', Impact"). */
55
+ export function findTypeSurfaceFont(q: string): TSFont | undefined {
56
+ const s = q.trim().toLowerCase().replace(/^'|'.*$/g, '');
57
+ return TS_FONTS.find((x) => x.id === s || x.name.toLowerCase() === s || x.family.toLowerCase().startsWith(`'${s}'`));
58
+ }
59
+
60
+ /** One stylesheet URL for every lab font. */
61
+ export function typeSurfaceFontsUrl(): string {
62
+ return `https://fonts.googleapis.com/css2?${TS_FONTS.map((x) => `family=${x.google}`).join('&')}&display=swap`;
63
+ }