@bydiorama/motion 0.0.0-stage → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (354) hide show
  1. package/CREDITS.md +62 -0
  2. package/LICENSE +21 -0
  3. package/README.md +142 -2
  4. package/catalog.json +4697 -0
  5. package/dist/npm/brief/brief.d.ts +28 -0
  6. package/dist/npm/brief/brief.js +159 -0
  7. package/dist/npm/brief/types.d.ts +75 -0
  8. package/dist/npm/brief/types.js +2 -0
  9. package/dist/npm/browser/motion.js +1039 -0
  10. package/dist/npm/browser/page.js +4821 -0
  11. package/dist/npm/browser/wizard.js +1511 -0
  12. package/dist/npm/build/design.d.ts +54 -0
  13. package/dist/npm/build/design.js +91 -0
  14. package/dist/npm/build/index.d.ts +39 -0
  15. package/dist/npm/build/index.js +66 -0
  16. package/dist/npm/build/iso.d.ts +41 -0
  17. package/dist/npm/build/iso.js +71 -0
  18. package/dist/npm/catalog.d.ts +24 -0
  19. package/dist/npm/catalog.js +23 -0
  20. package/dist/npm/cli/browser.d.ts +26 -0
  21. package/dist/npm/cli/browser.js +66 -0
  22. package/dist/npm/cli/capture.d.ts +26 -0
  23. package/dist/npm/cli/capture.js +94 -0
  24. package/dist/npm/cli/files.d.ts +14 -0
  25. package/dist/npm/cli/files.js +87 -0
  26. package/dist/npm/cli/frames.d.ts +27 -0
  27. package/dist/npm/cli/frames.js +125 -0
  28. package/dist/npm/cli/guard.d.ts +23 -0
  29. package/dist/npm/cli/guard.js +158 -0
  30. package/dist/npm/cli/library.d.ts +2 -0
  31. package/dist/npm/cli/library.js +55 -0
  32. package/dist/npm/cli/main.d.ts +17 -0
  33. package/dist/npm/cli/main.js +964 -0
  34. package/dist/npm/cli/motion.d.ts +2 -0
  35. package/dist/npm/cli/motion.js +6 -0
  36. package/dist/npm/cli/record.d.ts +36 -0
  37. package/dist/npm/cli/record.js +142 -0
  38. package/dist/npm/cli/review.d.ts +45 -0
  39. package/dist/npm/cli/review.js +139 -0
  40. package/dist/npm/cli/schema.d.ts +852 -0
  41. package/dist/npm/cli/schema.js +120 -0
  42. package/dist/npm/cli/server.d.ts +17 -0
  43. package/dist/npm/cli/server.js +135 -0
  44. package/dist/npm/core/ease.d.ts +39 -0
  45. package/dist/npm/core/ease.js +176 -0
  46. package/dist/npm/core/frame.d.ts +52 -0
  47. package/dist/npm/core/frame.js +60 -0
  48. package/dist/npm/core/shapes.d.ts +8 -0
  49. package/dist/npm/core/shapes.js +88 -0
  50. package/dist/npm/core/stagger.d.ts +19 -0
  51. package/dist/npm/core/stagger.js +77 -0
  52. package/dist/npm/core/tap.d.ts +19 -0
  53. package/dist/npm/core/tap.js +42 -0
  54. package/dist/npm/core/track.d.ts +4 -0
  55. package/dist/npm/core/track.js +23 -0
  56. package/dist/npm/dom/mount.d.ts +127 -0
  57. package/dist/npm/dom/mount.js +950 -0
  58. package/dist/npm/dom/page.d.ts +37 -0
  59. package/dist/npm/dom/page.js +77 -0
  60. package/dist/npm/dom/soundtrack.d.ts +13 -0
  61. package/dist/npm/dom/soundtrack.js +37 -0
  62. package/dist/npm/dom/stage.css.d.ts +1 -0
  63. package/dist/npm/dom/stage.css.js +44 -0
  64. package/dist/npm/dom/tokens.d.ts +10 -0
  65. package/dist/npm/dom/tokens.js +38 -0
  66. package/dist/npm/dom/ui-themes.css.d.ts +8 -0
  67. package/dist/npm/dom/ui-themes.css.js +9 -0
  68. package/dist/npm/film/beats.d.ts +64 -0
  69. package/dist/npm/film/beats.js +282 -0
  70. package/dist/npm/film/pace.d.ts +94 -0
  71. package/dist/npm/film/pace.js +396 -0
  72. package/dist/npm/film/resolve.d.ts +16 -0
  73. package/dist/npm/film/resolve.js +997 -0
  74. package/dist/npm/film/tempo.d.ts +19 -0
  75. package/dist/npm/film/tempo.js +34 -0
  76. package/dist/npm/film/tune.d.ts +17 -0
  77. package/dist/npm/film/tune.js +68 -0
  78. package/dist/npm/film/types.d.ts +416 -0
  79. package/dist/npm/film/types.js +16 -0
  80. package/dist/npm/index.d.ts +18 -0
  81. package/dist/npm/index.js +11 -0
  82. package/dist/npm/primitives/blur.d.ts +14 -0
  83. package/dist/npm/primitives/blur.js +59 -0
  84. package/dist/npm/primitives/canvas.d.ts +5 -0
  85. package/dist/npm/primitives/canvas.js +13 -0
  86. package/dist/npm/primitives/el/box.d.ts +2 -0
  87. package/dist/npm/primitives/el/box.js +24 -0
  88. package/dist/npm/primitives/el/frames.d.ts +15 -0
  89. package/dist/npm/primitives/el/frames.js +71 -0
  90. package/dist/npm/primitives/el/html.d.ts +2 -0
  91. package/dist/npm/primitives/el/html.js +14 -0
  92. package/dist/npm/primitives/el/image.d.ts +2 -0
  93. package/dist/npm/primitives/el/image.js +43 -0
  94. package/dist/npm/primitives/el/slot.d.ts +2 -0
  95. package/dist/npm/primitives/el/slot.js +25 -0
  96. package/dist/npm/primitives/el/text.d.ts +2 -0
  97. package/dist/npm/primitives/el/text.js +13 -0
  98. package/dist/npm/primitives/el/video.d.ts +6 -0
  99. package/dist/npm/primitives/el/video.js +179 -0
  100. package/dist/npm/primitives/fx/counter-roll.d.ts +2 -0
  101. package/dist/npm/primitives/fx/counter-roll.js +32 -0
  102. package/dist/npm/primitives/fx/depth-drift.d.ts +2 -0
  103. package/dist/npm/primitives/fx/depth-drift.js +44 -0
  104. package/dist/npm/primitives/fx/grid-ripple.d.ts +2 -0
  105. package/dist/npm/primitives/fx/grid-ripple.js +59 -0
  106. package/dist/npm/primitives/fx/odometer.d.ts +2 -0
  107. package/dist/npm/primitives/fx/odometer.js +80 -0
  108. package/dist/npm/primitives/fx/pan-across.d.ts +17 -0
  109. package/dist/npm/primitives/fx/pan-across.js +76 -0
  110. package/dist/npm/primitives/fx/path-draw.d.ts +2 -0
  111. package/dist/npm/primitives/fx/path-draw.js +105 -0
  112. package/dist/npm/primitives/fx/pin-drop.d.ts +2 -0
  113. package/dist/npm/primitives/fx/pin-drop.js +92 -0
  114. package/dist/npm/primitives/fx/shape-morph.d.ts +2 -0
  115. package/dist/npm/primitives/fx/shape-morph.js +65 -0
  116. package/dist/npm/primitives/fx/slow-push.d.ts +13 -0
  117. package/dist/npm/primitives/fx/slow-push.js +56 -0
  118. package/dist/npm/primitives/fx/stagger-fill.d.ts +2 -0
  119. package/dist/npm/primitives/fx/stagger-fill.js +33 -0
  120. package/dist/npm/primitives/index.d.ts +4 -0
  121. package/dist/npm/primitives/index.js +78 -0
  122. package/dist/npm/primitives/rig/browser-window.d.ts +2 -0
  123. package/dist/npm/primitives/rig/browser-window.js +142 -0
  124. package/dist/npm/primitives/rig/camera.d.ts +36 -0
  125. package/dist/npm/primitives/rig/camera.js +81 -0
  126. package/dist/npm/primitives/rig/footage-plane.d.ts +27 -0
  127. package/dist/npm/primitives/rig/footage-plane.js +257 -0
  128. package/dist/npm/primitives/rig/layer-stack.d.ts +39 -0
  129. package/dist/npm/primitives/rig/layer-stack.js +276 -0
  130. package/dist/npm/primitives/rig/orbit-ring.d.ts +2 -0
  131. package/dist/npm/primitives/rig/orbit-ring.js +59 -0
  132. package/dist/npm/primitives/rig/tab-stack.d.ts +9 -0
  133. package/dist/npm/primitives/rig/tab-stack.js +143 -0
  134. package/dist/npm/primitives/scene/bar-chart.d.ts +2 -0
  135. package/dist/npm/primitives/scene/bar-chart.js +83 -0
  136. package/dist/npm/primitives/scene/bento-grid.d.ts +49 -0
  137. package/dist/npm/primitives/scene/bento-grid.js +293 -0
  138. package/dist/npm/primitives/scene/grid-wall.d.ts +18 -0
  139. package/dist/npm/primitives/scene/grid-wall.js +110 -0
  140. package/dist/npm/primitives/scene/line-chart.d.ts +2 -0
  141. package/dist/npm/primitives/scene/line-chart.js +121 -0
  142. package/dist/npm/primitives/scene/logo-reveal.d.ts +2 -0
  143. package/dist/npm/primitives/scene/logo-reveal.js +117 -0
  144. package/dist/npm/primitives/scene/marquee-wall.d.ts +2 -0
  145. package/dist/npm/primitives/scene/marquee-wall.js +82 -0
  146. package/dist/npm/primitives/scene/post-carousel.d.ts +16 -0
  147. package/dist/npm/primitives/scene/post-carousel.js +195 -0
  148. package/dist/npm/primitives/scene/strip-cycle.d.ts +49 -0
  149. package/dist/npm/primitives/scene/strip-cycle.js +237 -0
  150. package/dist/npm/primitives/split.d.ts +34 -0
  151. package/dist/npm/primitives/split.js +105 -0
  152. package/dist/npm/primitives/texture/beat-field.d.ts +13 -0
  153. package/dist/npm/primitives/texture/beat-field.js +113 -0
  154. package/dist/npm/primitives/texture/gradient-drift.d.ts +2 -0
  155. package/dist/npm/primitives/texture/gradient-drift.js +56 -0
  156. package/dist/npm/primitives/texture/grain.d.ts +2 -0
  157. package/dist/npm/primitives/texture/grain.js +54 -0
  158. package/dist/npm/primitives/texture/halftone-field.d.ts +2 -0
  159. package/dist/npm/primitives/texture/halftone-field.js +36 -0
  160. package/dist/npm/primitives/texture/signal-field.d.ts +4 -0
  161. package/dist/npm/primitives/texture/signal-field.js +107 -0
  162. package/dist/npm/primitives/texture/vignette.d.ts +2 -0
  163. package/dist/npm/primitives/texture/vignette.js +23 -0
  164. package/dist/npm/primitives/transition/band-sweep.d.ts +22 -0
  165. package/dist/npm/primitives/transition/band-sweep.js +111 -0
  166. package/dist/npm/primitives/transition/beat-cut.d.ts +2 -0
  167. package/dist/npm/primitives/transition/beat-cut.js +10 -0
  168. package/dist/npm/primitives/transition/blur-dissolve.d.ts +2 -0
  169. package/dist/npm/primitives/transition/blur-dissolve.js +28 -0
  170. package/dist/npm/primitives/transition/camera-travel.d.ts +2 -0
  171. package/dist/npm/primitives/transition/camera-travel.js +69 -0
  172. package/dist/npm/primitives/transition/cover-reveal.d.ts +2 -0
  173. package/dist/npm/primitives/transition/cover-reveal.js +52 -0
  174. package/dist/npm/primitives/transition/curtain.d.ts +2 -0
  175. package/dist/npm/primitives/transition/curtain.js +40 -0
  176. package/dist/npm/primitives/transition/dive-in.d.ts +2 -0
  177. package/dist/npm/primitives/transition/dive-in.js +52 -0
  178. package/dist/npm/primitives/transition/fly-past.d.ts +2 -0
  179. package/dist/npm/primitives/transition/fly-past.js +87 -0
  180. package/dist/npm/primitives/transition/iris.d.ts +2 -0
  181. package/dist/npm/primitives/transition/iris.js +38 -0
  182. package/dist/npm/primitives/transition/overlay.d.ts +4 -0
  183. package/dist/npm/primitives/transition/overlay.js +24 -0
  184. package/dist/npm/primitives/transition/push.d.ts +2 -0
  185. package/dist/npm/primitives/transition/push.js +35 -0
  186. package/dist/npm/primitives/transition/signal-wipe.d.ts +2 -0
  187. package/dist/npm/primitives/transition/signal-wipe.js +67 -0
  188. package/dist/npm/primitives/transition/slant-wipe.d.ts +2 -0
  189. package/dist/npm/primitives/transition/slant-wipe.js +30 -0
  190. package/dist/npm/primitives/transition/stack-over.d.ts +2 -0
  191. package/dist/npm/primitives/transition/stack-over.js +38 -0
  192. package/dist/npm/primitives/transition/step-wipe.d.ts +2 -0
  193. package/dist/npm/primitives/transition/step-wipe.js +29 -0
  194. package/dist/npm/primitives/transition/strip-wipe.d.ts +40 -0
  195. package/dist/npm/primitives/transition/strip-wipe.js +121 -0
  196. package/dist/npm/primitives/transition/whip-pan.d.ts +2 -0
  197. package/dist/npm/primitives/transition/whip-pan.js +45 -0
  198. package/dist/npm/primitives/type/block-reveal.d.ts +2 -0
  199. package/dist/npm/primitives/type/block-reveal.js +61 -0
  200. package/dist/npm/primitives/type/char-cascade.d.ts +2 -0
  201. package/dist/npm/primitives/type/char-cascade.js +45 -0
  202. package/dist/npm/primitives/type/echo.d.ts +2 -0
  203. package/dist/npm/primitives/type/echo.js +57 -0
  204. package/dist/npm/primitives/type/fill-text.d.ts +14 -0
  205. package/dist/npm/primitives/type/fill-text.js +82 -0
  206. package/dist/npm/primitives/type/mask-reveal.d.ts +2 -0
  207. package/dist/npm/primitives/type/mask-reveal.js +58 -0
  208. package/dist/npm/primitives/type/scramble.d.ts +2 -0
  209. package/dist/npm/primitives/type/scramble.js +34 -0
  210. package/dist/npm/primitives/type/scribble-highlight.d.ts +2 -0
  211. package/dist/npm/primitives/type/scribble-highlight.js +84 -0
  212. package/dist/npm/primitives/type/shimmer.d.ts +2 -0
  213. package/dist/npm/primitives/type/shimmer.js +35 -0
  214. package/dist/npm/primitives/type/tracking-in.d.ts +2 -0
  215. package/dist/npm/primitives/type/tracking-in.js +37 -0
  216. package/dist/npm/primitives/type/typed-title.d.ts +2 -0
  217. package/dist/npm/primitives/type/typed-title.js +33 -0
  218. package/dist/npm/primitives/type/word-build.d.ts +2 -0
  219. package/dist/npm/primitives/type/word-build.js +44 -0
  220. package/dist/npm/primitives/type/word-roller.d.ts +2 -0
  221. package/dist/npm/primitives/type/word-roller.js +80 -0
  222. package/dist/npm/primitives/types.d.ts +183 -0
  223. package/dist/npm/primitives/types.js +5 -0
  224. package/dist/npm/primitives/ui/cursor-click.d.ts +4 -0
  225. package/dist/npm/primitives/ui/cursor-click.js +68 -0
  226. package/dist/npm/primitives/ui/page-scroll.d.ts +17 -0
  227. package/dist/npm/primitives/ui/page-scroll.js +98 -0
  228. package/dist/npm/review/fft.d.ts +4 -0
  229. package/dist/npm/review/fft.js +71 -0
  230. package/dist/npm/review/measure.d.ts +170 -0
  231. package/dist/npm/review/measure.js +577 -0
  232. package/dist/npm/tokens.d.ts +50 -0
  233. package/dist/npm/tokens.js +49 -0
  234. package/dist/npm/version.d.ts +1 -0
  235. package/dist/npm/version.js +1 -0
  236. package/examples/builder.film.mjs +18 -0
  237. package/films/feature-announcement.film.json +70 -0
  238. package/library/narratives/app-demo.md +64 -0
  239. package/library/narratives/brand-identity.md +78 -0
  240. package/library/narratives/capability-through-type.md +53 -0
  241. package/library/narratives/data-story.md +59 -0
  242. package/library/narratives/explainer.md +64 -0
  243. package/library/narratives/feature-announcement.md +68 -0
  244. package/library/narratives/infinite-loop.md +28 -0
  245. package/library/narratives/platform-launch.md +81 -0
  246. package/library/narratives/social-teaser.md +45 -0
  247. package/library/narratives/title-sequence.md +55 -0
  248. package/library/narratives/website-launch.md +65 -0
  249. package/library/primitives/fx/card-arrangements.md +26 -0
  250. package/library/primitives/fx/counter-roll.md +27 -0
  251. package/library/primitives/fx/depth-drift.md +32 -0
  252. package/library/primitives/fx/grid-ripple.md +58 -0
  253. package/library/primitives/fx/letter-interleave.md +26 -0
  254. package/library/primitives/fx/marquee-highlight.md +27 -0
  255. package/library/primitives/fx/mosaic-fill.md +23 -0
  256. package/library/primitives/fx/odometer.md +44 -0
  257. package/library/primitives/fx/pan-across.md +63 -0
  258. package/library/primitives/fx/path-draw.md +54 -0
  259. package/library/primitives/fx/pin-drop.md +51 -0
  260. package/library/primitives/fx/radial-burst.md +33 -0
  261. package/library/primitives/fx/shape-morph.md +45 -0
  262. package/library/primitives/fx/slow-push.md +63 -0
  263. package/library/primitives/fx/stagger-fill.md +28 -0
  264. package/library/primitives/rig/browser-window.md +113 -0
  265. package/library/primitives/rig/flip-ticker.md +26 -0
  266. package/library/primitives/rig/footage-plane.md +90 -0
  267. package/library/primitives/rig/layer-stack.md +168 -0
  268. package/library/primitives/rig/orbit-ring.md +43 -0
  269. package/library/primitives/rig/rolodex.md +31 -0
  270. package/library/primitives/rig/tab-stack.md +116 -0
  271. package/library/primitives/rig/tumbling-object.md +27 -0
  272. package/library/primitives/scene/bar-chart.md +49 -0
  273. package/library/primitives/scene/bento-grid.md +74 -0
  274. package/library/primitives/scene/end-card.md +28 -0
  275. package/library/primitives/scene/grid-wall.md +61 -0
  276. package/library/primitives/scene/hero-object.md +33 -0
  277. package/library/primitives/scene/kinetic-headline.md +34 -0
  278. package/library/primitives/scene/line-chart.md +47 -0
  279. package/library/primitives/scene/logo-reveal.md +53 -0
  280. package/library/primitives/scene/marquee-wall.md +33 -0
  281. package/library/primitives/scene/mosaic.md +28 -0
  282. package/library/primitives/scene/post-carousel.md +68 -0
  283. package/library/primitives/scene/specimen-grid.md +28 -0
  284. package/library/primitives/scene/stat-with-evidence.md +34 -0
  285. package/library/primitives/scene/strip-cycle.md +122 -0
  286. package/library/primitives/scene/zoomed-ui.md +29 -0
  287. package/library/primitives/texture/ascii.md +22 -0
  288. package/library/primitives/texture/beat-field.md +85 -0
  289. package/library/primitives/texture/depth-fade.md +23 -0
  290. package/library/primitives/texture/dither.md +27 -0
  291. package/library/primitives/texture/gradient-drift.md +50 -0
  292. package/library/primitives/texture/grain.md +39 -0
  293. package/library/primitives/texture/halftone-field.md +26 -0
  294. package/library/primitives/texture/signal-field.md +61 -0
  295. package/library/primitives/texture/vignette.md +53 -0
  296. package/library/primitives/transition/band-sweep.md +63 -0
  297. package/library/primitives/transition/beat-cut.md +27 -0
  298. package/library/primitives/transition/blur-dissolve.md +36 -0
  299. package/library/primitives/transition/camera-travel.md +57 -0
  300. package/library/primitives/transition/collapse-to-anchor.md +27 -0
  301. package/library/primitives/transition/cover-reveal.md +47 -0
  302. package/library/primitives/transition/curtain.md +42 -0
  303. package/library/primitives/transition/dive-in.md +51 -0
  304. package/library/primitives/transition/fly-past.md +51 -0
  305. package/library/primitives/transition/iris.md +49 -0
  306. package/library/primitives/transition/layout-locked-swap.md +28 -0
  307. package/library/primitives/transition/light-dark-flip.md +27 -0
  308. package/library/primitives/transition/push.md +47 -0
  309. package/library/primitives/transition/signal-wipe.md +52 -0
  310. package/library/primitives/transition/slant-wipe.md +44 -0
  311. package/library/primitives/transition/stack-over.md +51 -0
  312. package/library/primitives/transition/step-wipe.md +32 -0
  313. package/library/primitives/transition/strip-wipe.md +80 -0
  314. package/library/primitives/transition/torn-edge.md +26 -0
  315. package/library/primitives/transition/whip-pan.md +47 -0
  316. package/library/primitives/transition/zoom-through-letter.md +27 -0
  317. package/library/primitives/type/accent-number.md +22 -0
  318. package/library/primitives/type/block-reveal.md +41 -0
  319. package/library/primitives/type/char-cascade.md +65 -0
  320. package/library/primitives/type/echo.md +44 -0
  321. package/library/primitives/type/fill-text.md +63 -0
  322. package/library/primitives/type/focus-blur.md +22 -0
  323. package/library/primitives/type/inline-chips.md +27 -0
  324. package/library/primitives/type/mask-reveal.md +65 -0
  325. package/library/primitives/type/parting.md +23 -0
  326. package/library/primitives/type/per-word-restyle.md +28 -0
  327. package/library/primitives/type/scramble.md +26 -0
  328. package/library/primitives/type/scribble-highlight.md +47 -0
  329. package/library/primitives/type/shimmer.md +39 -0
  330. package/library/primitives/type/split-flap.md +26 -0
  331. package/library/primitives/type/style-multiply.md +23 -0
  332. package/library/primitives/type/tracking-in.md +40 -0
  333. package/library/primitives/type/typed-title.md +27 -0
  334. package/library/primitives/type/word-build.md +37 -0
  335. package/library/primitives/type/word-roller.md +52 -0
  336. package/library/primitives/type/writing-ticker.md +27 -0
  337. package/library/primitives/ui/collab-cursors.md +27 -0
  338. package/library/primitives/ui/cursor-click.md +61 -0
  339. package/library/primitives/ui/page-scroll.md +58 -0
  340. package/library/primitives/ui/prompt-typing.md +29 -0
  341. package/library/primitives/ui/streamed-result.md +23 -0
  342. package/library/primitives/ui/tour-hold.md +27 -0
  343. package/library/styles/brand-system.md +49 -0
  344. package/library/styles/clean-explainer.md +42 -0
  345. package/library/styles/dark-showcase.md +48 -0
  346. package/library/styles/editorial-type.md +37 -0
  347. package/library/styles/kinetic-poster.md +54 -0
  348. package/library/styles/product-ui.md +44 -0
  349. package/library/styles/studio-loop.md +41 -0
  350. package/library.json +1467 -0
  351. package/package.json +64 -4
  352. package/schema/film.schema.json +1316 -0
  353. package/showcase/vendor/DIALKIT-LICENSE +21 -0
  354. package/src/studio/theme/fonts/OFL.txt +94 -0
@@ -0,0 +1,19 @@
1
+ export interface Tempo {
2
+ /** Beats per minute. */
3
+ bpm: number;
4
+ /** Beats in a bar. */
5
+ bar: number;
6
+ }
7
+ /** A length in beats or bars: `2b`, `0.5 beat`, `1bar`, `2 bars`. */
8
+ export declare const BEAT_UNIT: RegExp;
9
+ export declare const isBeats: (v: unknown) => v is string;
10
+ /** Seconds in one beat. */
11
+ export declare const beatLength: (t: Tempo) => number;
12
+ /** Seconds for `2b`, `1bar` and the like; undefined when the text is not a beat length. */
13
+ export declare function beatsToSeconds(v: string, tempo: Tempo): number | undefined;
14
+ /** Frames in one beat at this frame rate; whole when the beat falls on a frame. */
15
+ export declare const framesPerBeat: (t: Tempo, fps: number) => number;
16
+ /** Tempos near `bpm` whose beat is a whole number of frames, nearest first. */
17
+ export declare function wholeFrameTempos(bpm: number, fps: number, count?: number): number[];
18
+ /** Where t sits on the grid of `step` seconds: distance to the nearest line, in seconds. */
19
+ export declare const offGrid: (t: number, step: number) => number;
@@ -0,0 +1,34 @@
1
+ // Tempo: one pulse for the whole film. With a tempo set, any time in a film can
2
+ // be written in beats or bars ("2b", "1bar", "headline.end + 1b") and the pace
3
+ // check measures every cut and change against the grid. Change the bpm and the
4
+ // whole film follows, in proportion.
5
+ /** A length in beats or bars: `2b`, `0.5 beat`, `1bar`, `2 bars`. */
6
+ export const BEAT_UNIT = /^\s*(\d+(?:\.\d+)?)\s*(b|beats?|bars?)\s*$/;
7
+ export const isBeats = (v) => typeof v === 'string' && BEAT_UNIT.test(v);
8
+ /** Seconds in one beat. */
9
+ export const beatLength = (t) => 60 / t.bpm;
10
+ /** Seconds for `2b`, `1bar` and the like; undefined when the text is not a beat length. */
11
+ export function beatsToSeconds(v, tempo) {
12
+ const m = BEAT_UNIT.exec(v);
13
+ if (!m)
14
+ return undefined;
15
+ const n = Number(m[1]);
16
+ return m[2].startsWith('bar') ? n * tempo.bar * beatLength(tempo) : n * beatLength(tempo);
17
+ }
18
+ /** Frames in one beat at this frame rate; whole when the beat falls on a frame. */
19
+ export const framesPerBeat = (t, fps) => (fps * 60) / t.bpm;
20
+ /** Tempos near `bpm` whose beat is a whole number of frames, nearest first. */
21
+ export function wholeFrameTempos(bpm, fps, count = 3) {
22
+ const out = [];
23
+ for (let frames = 1; frames <= fps * 2; frames++) {
24
+ const b = (fps * 60) / frames;
25
+ if (b >= 40 && b <= 240 && Number.isInteger(Math.round(b * 1000) / 1000))
26
+ out.push(Math.round(b * 1000) / 1000);
27
+ }
28
+ return out.sort((a, b) => Math.abs(a - bpm) - Math.abs(b - bpm)).slice(0, count);
29
+ }
30
+ /** Where t sits on the grid of `step` seconds: distance to the nearest line, in seconds. */
31
+ export const offGrid = (t, step) => {
32
+ const r = ((t % step) + step) % step;
33
+ return Math.min(r, step - r);
34
+ };
@@ -0,0 +1,17 @@
1
+ import type { Film, Tune } from './types.ts';
2
+ export interface TuneResult {
3
+ film: Film;
4
+ /** Paths that no longer point at anything in the film. */
5
+ orphans: string[];
6
+ applied: string[];
7
+ }
8
+ /** Returns a copy of the film with the tune's overrides applied. `null` removes a value. */
9
+ export declare function applyTune(film: Film, tune: Tune | undefined): TuneResult;
10
+ /** Reads the value at a path, using the same addressing as overrides. */
11
+ export declare function getPath(root: unknown, path: string): unknown;
12
+ /** Writes the overrides into the film itself: what a person does once the tuning is agreed. */
13
+ export declare function bake(film: Film, tune: Tune | undefined): {
14
+ film: Film;
15
+ tune: Tune;
16
+ orphans: string[];
17
+ };
@@ -0,0 +1,68 @@
1
+ const isObject = (v) => !!v && typeof v === 'object' && !Array.isArray(v);
2
+ /** Arrays in a film whose items are found by `id`. */
3
+ const ID_LISTS = new Set(['scenes', 'layers']);
4
+ function setPath(root, path, value) {
5
+ const parts = path.split('.');
6
+ let cur = root;
7
+ for (let i = 0; i < parts.length; i++) {
8
+ const key = parts[i];
9
+ const last = i === parts.length - 1;
10
+ if (Array.isArray(cur)) {
11
+ // Inside scenes or layers: the segment is an id.
12
+ const found = cur.find((item) => isObject(item) && item.id === key);
13
+ if (!found)
14
+ return false;
15
+ if (last)
16
+ return false; // an override may change a scene or layer, not replace it
17
+ cur = found;
18
+ continue;
19
+ }
20
+ if (!isObject(cur))
21
+ return false;
22
+ if (last) {
23
+ if (value === null)
24
+ delete cur[key];
25
+ else
26
+ cur[key] = value;
27
+ return true;
28
+ }
29
+ if (cur[key] === undefined) {
30
+ if (ID_LISTS.has(key))
31
+ return false;
32
+ cur[key] = {};
33
+ }
34
+ // A move written as a bare name ("rise") opens up into its full form when part of it is tuned.
35
+ if ((key === 'enter' || key === 'exit') && typeof cur[key] === 'string')
36
+ cur[key] = { move: cur[key] };
37
+ cur = cur[key];
38
+ }
39
+ return false;
40
+ }
41
+ /** Returns a copy of the film with the tune's overrides applied. `null` removes a value. */
42
+ export function applyTune(film, tune) {
43
+ const out = structuredClone(film);
44
+ const orphans = [], applied = [];
45
+ for (const [path, value] of Object.entries(tune?.set ?? {})) {
46
+ (setPath(out, path, structuredClone(value)) ? applied : orphans).push(path);
47
+ }
48
+ return { film: out, orphans, applied };
49
+ }
50
+ /** Reads the value at a path, using the same addressing as overrides. */
51
+ export function getPath(root, path) {
52
+ let cur = root;
53
+ for (const key of path.split('.')) {
54
+ if (Array.isArray(cur))
55
+ cur = cur.find((item) => isObject(item) && item.id === key);
56
+ else if (isObject(cur))
57
+ cur = cur[key];
58
+ else
59
+ return undefined;
60
+ }
61
+ return cur;
62
+ }
63
+ /** Writes the overrides into the film itself: what a person does once the tuning is agreed. */
64
+ export function bake(film, tune) {
65
+ const { film: baked, orphans } = applyTune(film, tune);
66
+ const keep = Object.fromEntries(Object.entries(tune?.set ?? {}).filter(([p]) => orphans.includes(p)));
67
+ return { film: baked, tune: { set: keep, notes: tune?.notes ?? [] }, orphans };
68
+ }
@@ -0,0 +1,416 @@
1
+ import type { EaseSpec } from '../core/ease.ts';
2
+ import type { Key } from '../core/track.ts';
3
+ import type { TokenOverrides } from '../tokens.ts';
4
+ import type { Tempo } from './tempo.ts';
5
+ import type { Cue } from '../primitives/types.ts';
6
+ /**
7
+ * Seconds from the scene start, or `"<layer id>.start|end"` / `"scene.end"`, optionally
8
+ * `± seconds` or `± beats` (`"title.end + 1b"`). With a tempo, `"4b"` alone is a time too.
9
+ */
10
+ export type TimeRef = number | string;
11
+ export type TrackProp = 'x' | 'y' | 'scale' | 'rotate' | 'opacity' | 'blur' | 'rotateX' | 'rotateY' | 'skew';
12
+ export declare const TRACK_PROPS: readonly TrackProp[];
13
+ export type Tracks = Partial<Record<TrackProp, Key[]>>;
14
+ /**
15
+ * Enter and exit moves for any layer.
16
+ * fade, rise, drop, slide-*: opacity with a travel in px.
17
+ * scale: grows from slightly small. zoom: settles from slightly large. pop: grows with an overshoot.
18
+ * blur: comes into focus. focus: comes into focus while rising (a soft arrival).
19
+ * mask-up, mask-down: slides out from under its own edge, without fading (a line reveal).
20
+ * wipe-*: an edge travels across the layer and uncovers it, without moving it.
21
+ * swing: turns in on a horizontal hinge, in perspective.
22
+ * slot-up: rises `amount` px into its own box, cut off at the box's bottom edge, no
23
+ * fade: a picture settling into a slot that was already there.
24
+ * wipe: like wipe-*, along any `angle`; it can also travel `amount` px that way as it is
25
+ * uncovered, so a band unrolls along its own slant.
26
+ * slide: like slide-*, along any `angle`.
27
+ * pop-check: a success mark arriving: grows from a third of its size while turning in from
28
+ * -80° and coming into focus, past its mark and back (bounce.out, 0.5 s). `amount` is the
29
+ * scale offset (0.65).
30
+ */
31
+ export type MoveName = 'fade' | 'rise' | 'drop' | 'scale' | 'blur' | 'slide-left' | 'slide-right' | 'zoom' | 'pop' | 'focus' | 'mask-up' | 'mask-down' | 'wipe-up' | 'wipe-down' | 'wipe-left' | 'wipe-right' | 'swing' | 'slot-up' | 'wipe' | 'slide' | 'pop-check';
32
+ export declare const MOVE_NAMES: readonly MoveName[];
33
+ /** Moves that take an `angle`. */
34
+ export declare const ANGLED_MOVES: readonly MoveName[];
35
+ export interface Move {
36
+ move: MoveName;
37
+ /** Seconds, or a token such as `"$duration.base"`. */
38
+ duration?: number | string;
39
+ ease?: EaseSpec;
40
+ /** Travel in px for rise, drop, slide and focus; scale offset for scale, zoom and pop; px for blur; degrees for swing; travel along the angle for wipe. Masks and wipe-* ignore it. */
41
+ amount?: number;
42
+ /** For wipe and slide: the direction the edge or the layer travels, in degrees. 0 is rightwards, 90 downwards, 180 leftwards, 270 upwards. */
43
+ angle?: number;
44
+ /**
45
+ * For mask-* and wipe-*: a soft edge instead of a hard line, in px, or `true` for a tenth of
46
+ * the layer's line height. The ramp sits outside the edge, so nothing changes when the move ends.
47
+ */
48
+ feather?: boolean | number;
49
+ }
50
+ export interface ExitMove extends Move {
51
+ /** When the exit starts. Defaults to the scene end minus the exit duration. */
52
+ at?: TimeRef;
53
+ }
54
+ export type TextSize = 'hero' | 'headline' | 'title' | 'body' | 'caption';
55
+ export declare const TEXT_SIZES: readonly TextSize[];
56
+ export type Tone = 'primary' | 'secondary' | 'muted' | 'accent' | 'inverse' | 'on-accent';
57
+ export declare const TONES: readonly Tone[];
58
+ export interface LayerStyle {
59
+ size?: TextSize;
60
+ color?: Tone;
61
+ font?: 'display' | 'body' | 'mono';
62
+ weight?: number;
63
+ align?: 'left' | 'center' | 'right';
64
+ /** Max width as a percentage of the stage width. */
65
+ width?: number;
66
+ /** Escape hatch: raw inline CSS, for a person's last-mile fixes. */
67
+ css?: Record<string, string>;
68
+ }
69
+ export interface Place {
70
+ /** Measured to the layer's anchor: percent of the stage, or with `unit: "px"` pixels of the scene's artboard. */
71
+ x: number;
72
+ y: number;
73
+ anchor?: 'center' | 'top-left' | 'top' | 'top-right' | 'left' | 'right' | 'bottom-left' | 'bottom' | 'bottom-right';
74
+ /**
75
+ * `%` (the default): percent of the stage. `px`: pixels of the scene's artboard, the
76
+ * design the layer was taken from; the layer sits on the artboard and is scaled with it,
77
+ * so its size, tracks and move amounts are design pixels too. Without an artboard, px are
78
+ * the stage's own.
79
+ */
80
+ unit?: '%' | 'px';
81
+ }
82
+ export declare const ANCHORS: readonly ["center", "top-left", "top", "top-right", "left", "right", "bottom-left", "bottom", "bottom-right"];
83
+ export declare const PLACE_UNITS: readonly ["%", "px"];
84
+ /**
85
+ * A design's own frame, laid on the stage: a 1920×1080 slide or a 4:5 post rebuilt from its
86
+ * layers. Layers placed in `px` keep the design's coordinates and sizes, and the artboard
87
+ * is scaled to the stage as one.
88
+ */
89
+ export interface Artboard {
90
+ /** The design's size in its own pixels. */
91
+ width: number;
92
+ height: number;
93
+ /**
94
+ * How it meets the stage: `cover` fills it and lets the rest fall off (the default),
95
+ * `contain` shows all of it, `width` and `height` match that side.
96
+ */
97
+ fit?: 'cover' | 'contain' | 'width' | 'height';
98
+ /** Where it sits when it does not match the stage: percent along each side, [0, 0] top-left. Default [50, 50]. */
99
+ align?: [number, number];
100
+ }
101
+ export interface Parallax {
102
+ depth: number;
103
+ home?: TimeRef;
104
+ }
105
+ export declare const ARTBOARD_FITS: readonly ["cover", "contain", "width", "height"];
106
+ export interface Layer {
107
+ id: string;
108
+ /** Primitive slug, e.g. `type/word-build`. See catalog.json. */
109
+ use: string;
110
+ /** Content: the words, numbers and media. Written by the agent or a copywriter. */
111
+ props?: Record<string, unknown>;
112
+ /** Motion values. Each has a default and a range in the catalog; these are what a person tunes. */
113
+ params?: Record<string, unknown>;
114
+ at?: TimeRef;
115
+ style?: LayerStyle;
116
+ /** Absolute placement. Without it the layer joins the scene's stack. */
117
+ place?: Place;
118
+ enter?: MoveName | Move;
119
+ exit?: MoveName | ExitMove;
120
+ /** Keyframes in seconds from the layer start. */
121
+ tracks?: Tracks;
122
+ /**
123
+ * Depth against the scene's camera, so layers of one picture travel at different speeds
124
+ * (parallax). 1 travels with the scene, above 1 is nearer and faster, below 1 farther and
125
+ * slower, 0 holds still on the stage. A number, or `{ depth, home }`, where `home` is the
126
+ * moment the layer sits exactly where it is placed (default: the scene's end, the frame
127
+ * the camera arrives at). It follows the camera's x and y travel.
128
+ */
129
+ parallax?: number | Parallax;
130
+ /**
131
+ * Motion blur while the layer moves: `true` for a half-frame shutter, or the
132
+ * share of a frame the shutter is open (0–1). Smears along the path only and
133
+ * is gone when the layer stops.
134
+ */
135
+ motionBlur?: boolean | number;
136
+ /**
137
+ * Fixed to the screen: the layer is drawn outside the scene's camera, so the camera's travel,
138
+ * zoom and tilt leave it where it is. For a vignette, a frame, a caption bar.
139
+ */
140
+ screen?: boolean;
141
+ /**
142
+ * Taps on the layer, as a viewer reads one: it goes down under the finger, landing on
143
+ * each time, comes back up past rest, and a thin accent ring leaves it in its own shape.
144
+ * A time, or `{ at, ring }`, where `ring` is the id of another layer to draw the ring
145
+ * around (a button inside a card) or false for none.
146
+ */
147
+ taps?: (TimeRef | Tap)[];
148
+ /**
149
+ * How the layer's room in the scene's stack comes and goes. `glide`: it takes no room until
150
+ * it enters and gives its room up as it leaves, and the layers around it glide over to make
151
+ * or close the gap (0.45 s, quick then settling), with transforms only, so no text re-wraps.
152
+ * Without it a layer keeps its room the whole scene, even while hidden.
153
+ */
154
+ reflow?: 'glide';
155
+ }
156
+ export interface Tap {
157
+ at: TimeRef;
158
+ /** The layer to draw the ring around: this one by default, another one's id, or false for no ring. */
159
+ ring?: string | false;
160
+ /**
161
+ * On a rig/footage-plane: a mark recorded with its footage (`motion record --marks`). The ring
162
+ * goes round it where it is in the picture at that moment; the press is already in the footage.
163
+ */
164
+ mark?: string;
165
+ }
166
+ export type Surface = 'base' | 'surface' | 'sunken' | 'accent' | 'inverse';
167
+ export declare const SURFACES: readonly Surface[];
168
+ export interface SceneLayout {
169
+ align?: 'start' | 'center' | 'end';
170
+ justify?: 'start' | 'center' | 'end' | 'between';
171
+ /** px on the stage */
172
+ gap?: number;
173
+ padding?: number;
174
+ }
175
+ export interface Transition {
176
+ /** Transition slug, e.g. `transition/blur-dissolve`. */
177
+ use: string;
178
+ duration?: number | string;
179
+ params?: Record<string, unknown>;
180
+ }
181
+ /**
182
+ * The camera follows the tip of a line as it draws: the tip is held at `at`
183
+ * on stage while the scene's own camera tracks still set zoom and rotation.
184
+ */
185
+ export interface Follow {
186
+ /** Id of a layer in this scene whose primitive has a tip, e.g. fx/path-draw. */
187
+ layer: string;
188
+ /** Where on stage the tip is held, in % of the stage. Default [50, 50]. */
189
+ at?: [number, number];
190
+ /** Seconds the camera trails the tip by, averaged so it moves smoothly. Default 0. */
191
+ lag?: number;
192
+ /** Seconds to hand over from the scene's own x and y tracks to following, from the layer's start. Default 0.6. */
193
+ blend?: number;
194
+ }
195
+ /** One key of the framing camera. Anything left out is kept from the key before. */
196
+ export interface CameraKey {
197
+ /** When the camera arrives: seconds from the scene start, or beats (`"2b"`). */
198
+ at: number | string;
199
+ /** What to frame: a layer id, or a point `[x, y]` in % of the stage. The first key defaults to the stage centre. */
200
+ frame?: string | [number, number];
201
+ /** The point of the layer's box to frame, as shares of its width and height. Default `[0.5, 0.5]`. */
202
+ point?: [number, number];
203
+ /** Px added to the framed point, in the layout. */
204
+ offset?: [number, number];
205
+ /** Size: 1 is the stage as laid out, 2 shows it twice as big. */
206
+ zoom?: number;
207
+ /** Where the framed point sits on the screen, in % of the stage. Default `[50, 50]`. */
208
+ anchor?: [number, number];
209
+ /** Degrees about x and y: the picture turned in depth, about the anchor. */
210
+ tilt?: [number, number];
211
+ /** Degrees in the plane of the screen. */
212
+ rotate?: number;
213
+ /** The ease of the move arriving at this key. Default: the film's move ease. */
214
+ ease?: EaseSpec;
215
+ /** On the last key: zoom per second, linear, to the end of the scene, so the shot never comes to rest. */
216
+ drift?: number;
217
+ }
218
+ /** A camera key with every value filled in, its time in seconds. */
219
+ export interface ResolvedCameraKey {
220
+ t: number;
221
+ frame: string | [number, number];
222
+ point: [number, number];
223
+ offset: [number, number];
224
+ zoom: number;
225
+ anchor: [number, number];
226
+ tilt: [number, number];
227
+ rotate: number;
228
+ ease?: EaseSpec;
229
+ drift: number;
230
+ }
231
+ export interface Scene {
232
+ id: string;
233
+ /** Seconds, or beats (`"8b"`, `"2bars"`). Left out, the scene lasts until its last layer ends, plus `hold`. */
234
+ length?: number | string;
235
+ /** Seconds of stillness after the last layer ends, or a token such as `"$hold_end"`. Defaults to the `hold` token. */
236
+ hold?: number | string;
237
+ /** A surface name, or any CSS colour. */
238
+ background?: Surface | string;
239
+ scheme?: 'light' | 'dark';
240
+ layout?: SceneLayout;
241
+ /** A design's frame for layers placed in `px`. */
242
+ artboard?: Artboard;
243
+ layers: Layer[];
244
+ /** Camera: keyframes in seconds from the scene start, applied to the whole scene. */
245
+ tracks?: Tracks;
246
+ /** Camera follows the tip of a line being drawn. Replaces the x and y tracks while it follows. */
247
+ follow?: Follow;
248
+ /**
249
+ * The framing camera: keys that put a layer (or a point) at a place on the screen, this big,
250
+ * tilted so. The camera's translation is solved every frame, so the framed point stays on its
251
+ * anchor through a move; zoom travels in log space. Replaces the x, y and scale tracks.
252
+ */
253
+ camera?: CameraKey[];
254
+ /** Px from the viewer to the stage for the camera's tilt: smaller is a wider lens. Default 1.2 × the stage width. */
255
+ perspective?: number;
256
+ /** Motion blur on the camera's moves: `true` for a half-frame shutter, or the share of a frame (0–1). */
257
+ motionBlur?: boolean | number;
258
+ /** How this scene hands over to the next. The two scenes overlap by the duration. */
259
+ out?: Transition;
260
+ /** Vocabulary slugs this scene is built from. Informational; checked against the library. */
261
+ uses?: string[];
262
+ /** A note for the next reader, agent or person. */
263
+ intent?: string;
264
+ }
265
+ /** The bydiorama/ui themes a stage can wear (`theme.ui`). */
266
+ export declare const UI_THEME_NAMES: readonly ["zero", "graphite", "hockney"];
267
+ export interface Theme {
268
+ scheme?: 'light' | 'dark';
269
+ /** The accent colour, as any CSS colour. Left out, it comes from the page theme. */
270
+ accent?: string;
271
+ /** Text colour on the accent. Defaults to white or near-black, whichever reads better. */
272
+ onAccent?: string;
273
+ /**
274
+ * A bydiorama/ui theme on the stage: its fonts (Aspekta), colour roles and radii
275
+ * become the stage's --ui-* tokens, which the --m-* roles read. `accent` and
276
+ * `vars` still win over it.
277
+ */
278
+ ui?: (typeof UI_THEME_NAMES)[number];
279
+ /** CSS custom properties set on the stage, e.g. `{"--ui-bg-accent": "#2440F0"}`. */
280
+ vars?: Record<string, string>;
281
+ }
282
+ export interface Film {
283
+ /** Library version this film was written for. */
284
+ motion: string;
285
+ title?: string;
286
+ /** Stage size in px. Every px value in the film is on this canvas. */
287
+ size: [number, number];
288
+ fps?: number;
289
+ seed?: number;
290
+ /** Still frame used under reduced motion and as the cover. Seconds. */
291
+ poster?: number;
292
+ loop?: boolean;
293
+ narrative?: string;
294
+ style?: string;
295
+ tokens?: TokenOverrides;
296
+ /**
297
+ * One pulse for the whole film. With it, times can be written in beats and bars
298
+ * ("2b", "1bar") and `motion pace` checks cuts and changes against the grid.
299
+ */
300
+ tempo?: {
301
+ bpm: number;
302
+ bar?: number;
303
+ };
304
+ /**
305
+ * A soundtrack: film time 0 plays the file from `from` seconds. The studio plays it
306
+ * in step with the playhead and `render` lays it under the video. With music, set
307
+ * `tempo` to the track's own and `from` on one of its downbeats.
308
+ */
309
+ audio?: FilmAudio;
310
+ theme?: Theme;
311
+ scenes: Scene[];
312
+ }
313
+ export interface FilmAudio {
314
+ /** Path to the file, relative to the film, like any picture. */
315
+ src: string;
316
+ /** Seconds into the file that film time 0 plays. */
317
+ from?: number;
318
+ /** Level in dB, -30 to 6. */
319
+ gain?: number;
320
+ /** Seconds the sound fades in at the start and out at the end. A loop keeps them short, so the seam does not dip. */
321
+ fade_in?: number;
322
+ fade_out?: number;
323
+ }
324
+ export interface Note {
325
+ id: string;
326
+ /** Film time in seconds the note was pinned at. */
327
+ t: number;
328
+ scene?: string;
329
+ layer?: string;
330
+ text: string;
331
+ status: 'open' | 'done';
332
+ /** What was changed in answer to the note. Filled in by whoever resolves it. */
333
+ reply?: string;
334
+ }
335
+ export interface Tune {
336
+ /** Overrides by path, e.g. `"scenes.title.layers.headline.params.stagger": 0.12`. */
337
+ set?: Record<string, unknown>;
338
+ notes?: Note[];
339
+ }
340
+ export interface ResolvedMove {
341
+ move: MoveName;
342
+ /** Seconds from the scene start. */
343
+ start: number;
344
+ duration: number;
345
+ ease: EaseSpec;
346
+ amount?: number;
347
+ /** Degrees, for wipe and slide. */
348
+ angle?: number;
349
+ /** A soft edge for masks and straight wipes: px, or true for a tenth of the line height. */
350
+ feather?: number | true;
351
+ }
352
+ export interface ResolvedLayer {
353
+ id: string;
354
+ use: string;
355
+ /** Seconds from the scene start. */
356
+ start: number;
357
+ /** Length of the primitive's own animation. */
358
+ duration: number;
359
+ end: number;
360
+ props: Record<string, unknown>;
361
+ /** Defaults, then the film's values, with token references replaced. */
362
+ params: Record<string, unknown>;
363
+ enter?: ResolvedMove;
364
+ exit?: ResolvedMove;
365
+ /** Changes inside the primitive's own run (a picture swap, a turn), from the layer start. */
366
+ cues?: Cue[];
367
+ /** Fastest travel of the layer's picture across the stage, px a second, when the primitive reports it. */
368
+ speed?: number;
369
+ /** Depth against the camera, and the scene time it sits where it is placed. */
370
+ parallax?: {
371
+ depth: number;
372
+ home: number;
373
+ };
374
+ /** Taps, in scene seconds, each with the layer its ring is drawn around (null: none). */
375
+ taps?: {
376
+ t: number;
377
+ ring: string | null;
378
+ mark?: string;
379
+ }[];
380
+ source: Layer;
381
+ }
382
+ export interface ResolvedScene {
383
+ id: string;
384
+ /** Film time in seconds. */
385
+ start: number;
386
+ length: number;
387
+ end: number;
388
+ layers: ResolvedLayer[];
389
+ out?: {
390
+ use: string;
391
+ duration: number;
392
+ params: Record<string, unknown>;
393
+ };
394
+ /** The framing camera's keys, in order, every value filled in. */
395
+ camera?: ResolvedCameraKey[];
396
+ source: Scene;
397
+ }
398
+ export interface Issue {
399
+ level: 'error' | 'warning';
400
+ code: string;
401
+ /** Where in the film, e.g. `scenes.title.layers.headline.params.stagger`. */
402
+ path: string;
403
+ message: string;
404
+ /** What to do about it. */
405
+ hint?: string;
406
+ }
407
+ export interface Timeline {
408
+ duration: number;
409
+ fps: number;
410
+ frames: number;
411
+ size: [number, number];
412
+ scenes: ResolvedScene[];
413
+ tempo?: Tempo;
414
+ loop?: boolean;
415
+ audio?: Required<FilmAudio>;
416
+ }
@@ -0,0 +1,16 @@
1
+ export const TRACK_PROPS = ['x', 'y', 'scale', 'rotate', 'opacity', 'blur', 'rotateX', 'rotateY', 'skew'];
2
+ export const MOVE_NAMES = [
3
+ 'fade', 'rise', 'drop', 'scale', 'blur', 'slide-left', 'slide-right',
4
+ 'zoom', 'pop', 'focus', 'mask-up', 'mask-down', 'wipe-up', 'wipe-down', 'wipe-left', 'wipe-right', 'swing', 'slot-up',
5
+ 'wipe', 'slide', 'pop-check',
6
+ ];
7
+ /** Moves that take an `angle`. */
8
+ export const ANGLED_MOVES = ['wipe', 'slide'];
9
+ export const TEXT_SIZES = ['hero', 'headline', 'title', 'body', 'caption'];
10
+ export const TONES = ['primary', 'secondary', 'muted', 'accent', 'inverse', 'on-accent'];
11
+ export const ANCHORS = ['center', 'top-left', 'top', 'top-right', 'left', 'right', 'bottom-left', 'bottom', 'bottom-right'];
12
+ export const PLACE_UNITS = ['%', 'px'];
13
+ export const ARTBOARD_FITS = ['cover', 'contain', 'width', 'height'];
14
+ export const SURFACES = ['base', 'surface', 'sunken', 'accent', 'inverse'];
15
+ /** The bydiorama/ui themes a stage can wear (`theme.ui`). */
16
+ export const UI_THEME_NAMES = ['zero', 'graphite', 'hockney'];
@@ -0,0 +1,18 @@
1
+ export { bezier, clamp, EASE_NAMES, lerp, progress, resolveEase, rng, spring, UI_EASE } from './core/ease.ts';
2
+ export type { Bezier, EaseSpec, SpringSpec } from './core/ease.ts';
3
+ export { track } from './core/track.ts';
4
+ export { staggerByDistance, staggerDelays, staggerSteps } from './core/stagger.ts';
5
+ export type { Key } from './core/track.ts';
6
+ export { DEFAULT_TOKENS, mergeTokens } from './tokens.ts';
7
+ export type { TokenOverrides, Tokens } from './tokens.ts';
8
+ export { describeTimeline, resolveFilm } from './film/resolve.ts';
9
+ export type { Resolution } from './film/resolve.ts';
10
+ export { applyTune, bake, getPath } from './film/tune.ts';
11
+ export type * from './film/types.ts';
12
+ export { PRIMITIVES, TRANSITIONS } from './primitives/index.ts';
13
+ export type { Ctx, ParamSpec, Primitive, PropSpec, TransitionPrimitive } from './primitives/index.ts';
14
+ export { buildCatalog } from './catalog.ts';
15
+ export { FilmError, mount } from './dom/mount.ts';
16
+ export type { LayerBox, Mounted, MountOptions } from './dom/mount.ts';
17
+ export { createPlayer, startPage } from './dom/page.ts';
18
+ export type { PageOptions, Player } from './dom/page.ts';
@@ -0,0 +1,11 @@
1
+ // @bydiorama/motion: films as data.
2
+ export { bezier, clamp, EASE_NAMES, lerp, progress, resolveEase, rng, spring, UI_EASE } from "./core/ease.js";
3
+ export { track } from "./core/track.js";
4
+ export { staggerByDistance, staggerDelays, staggerSteps } from "./core/stagger.js";
5
+ export { DEFAULT_TOKENS, mergeTokens } from "./tokens.js";
6
+ export { describeTimeline, resolveFilm } from "./film/resolve.js";
7
+ export { applyTune, bake, getPath } from "./film/tune.js";
8
+ export { PRIMITIVES, TRANSITIONS } from "./primitives/index.js";
9
+ export { buildCatalog } from "./catalog.js";
10
+ export { FilmError, mount } from "./dom/mount.js";
11
+ export { createPlayer, startPage } from "./dom/page.js";
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Gaussian deviation, in px, of the streak left by something moving `speed` px
3
+ * per frame, seen through a shutter open for `shutter` of a frame (0.5 is the
4
+ * 180° film shutter). A streak of length L is a box, whose deviation is L/√12.
5
+ */
6
+ export declare const streak: (speed: number, shutter: number) => number;
7
+ /** Below this deviation the smear is invisible, so no filter is set. */
8
+ export declare const MIN_BLUR = 0.25;
9
+ /**
10
+ * A CSS `filter` value that smears `el` by deviations `sx` across and `sy` down
11
+ * (px), or '' when both are too small to see. Combine it with other filters by
12
+ * joining with a space.
13
+ */
14
+ export declare function directionalBlur(el: HTMLElement, sx: number, sy: number, max?: number): string;