motionary 10.0.0 → 10.2.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 (287) hide show
  1. package/AGENTS.md +61 -0
  2. package/CHANGELOG.md +36 -0
  3. package/README.md +82 -0
  4. package/bin/create-motionary-plugin.mjs +124 -0
  5. package/dist/chunks/keyframes-W-474DMc.js +183 -0
  6. package/dist/chunks/keyframes-W-474DMc.js.map +1 -0
  7. package/dist/chunks/keyframes-ZheOkpt0.cjs +187 -0
  8. package/dist/chunks/keyframes-ZheOkpt0.cjs.map +1 -0
  9. package/dist/chunks/registry-BIEjKngP.js +69 -0
  10. package/dist/chunks/registry-BIEjKngP.js.map +1 -0
  11. package/dist/chunks/registry-eJgpFAzI.cjs +81 -0
  12. package/dist/chunks/registry-eJgpFAzI.cjs.map +1 -0
  13. package/dist/chunks/ticker-CM_56oVy.js +70 -0
  14. package/dist/chunks/ticker-CM_56oVy.js.map +1 -0
  15. package/dist/chunks/ticker-D4o6enH0.cjs +72 -0
  16. package/dist/chunks/ticker-D4o6enH0.cjs.map +1 -0
  17. package/dist/chunks/tween-CBuWYpI-.cjs +487 -0
  18. package/dist/chunks/tween-CBuWYpI-.cjs.map +1 -0
  19. package/dist/chunks/tween-CqX1JBuj.js +476 -0
  20. package/dist/chunks/tween-CqX1JBuj.js.map +1 -0
  21. package/dist/components/core.cjs +106 -0
  22. package/dist/components/core.cjs.map +1 -1
  23. package/dist/components/core.d.cts +44 -2
  24. package/dist/components/core.d.ts +44 -2
  25. package/dist/components/core.js +105 -1
  26. package/dist/components/core.js.map +1 -1
  27. package/dist/components/marketplace.cjs +104 -0
  28. package/dist/components/marketplace.cjs.map +1 -1
  29. package/dist/components/marketplace.d.cts +33 -2
  30. package/dist/components/marketplace.d.ts +33 -2
  31. package/dist/components/marketplace.js +101 -1
  32. package/dist/components/marketplace.js.map +1 -1
  33. package/dist/components/widgets.cjs +623 -199
  34. package/dist/components/widgets.cjs.map +1 -1
  35. package/dist/components/widgets.d.cts +186 -2
  36. package/dist/components/widgets.d.ts +186 -2
  37. package/dist/components/widgets.js +620 -201
  38. package/dist/components/widgets.js.map +1 -1
  39. package/dist/llms-full.txt +3115 -0
  40. package/dist/llms.txt +211 -0
  41. package/dist/manifest.json +7820 -0
  42. package/dist/manifest.schema.json +85 -0
  43. package/dist/runtime/format-css.cjs +185 -0
  44. package/dist/runtime/format-css.cjs.map +1 -0
  45. package/dist/runtime/format-css.d.cts +174 -0
  46. package/dist/runtime/format-css.d.ts +174 -0
  47. package/dist/runtime/format-css.iife.js +2 -0
  48. package/dist/runtime/format-css.iife.js.map +1 -0
  49. package/dist/runtime/format-css.js +177 -0
  50. package/dist/runtime/format-css.js.map +1 -0
  51. package/dist/runtime/format-motion.cjs +139 -0
  52. package/dist/runtime/format-motion.cjs.map +1 -0
  53. package/dist/runtime/format-motion.d.cts +208 -0
  54. package/dist/runtime/format-motion.d.ts +208 -0
  55. package/dist/runtime/format-motion.iife.js +2 -0
  56. package/dist/runtime/format-motion.iife.js.map +1 -0
  57. package/dist/runtime/format-motion.js +133 -0
  58. package/dist/runtime/format-motion.js.map +1 -0
  59. package/dist/runtime/format-svg.cjs +457 -0
  60. package/dist/runtime/format-svg.cjs.map +1 -0
  61. package/dist/runtime/format-svg.d.cts +214 -0
  62. package/dist/runtime/format-svg.d.ts +214 -0
  63. package/dist/runtime/format-svg.iife.js +2 -0
  64. package/dist/runtime/format-svg.iife.js.map +1 -0
  65. package/dist/runtime/format-svg.js +446 -0
  66. package/dist/runtime/format-svg.js.map +1 -0
  67. package/dist/runtime/scroll.cjs +301 -0
  68. package/dist/runtime/scroll.cjs.map +1 -0
  69. package/dist/runtime/scroll.d.cts +236 -0
  70. package/dist/runtime/scroll.d.ts +236 -0
  71. package/dist/runtime/scroll.iife.js +2 -0
  72. package/dist/runtime/scroll.iife.js.map +1 -0
  73. package/dist/runtime/scroll.js +292 -0
  74. package/dist/runtime/scroll.js.map +1 -0
  75. package/dist/runtime.cjs +79 -0
  76. package/dist/runtime.cjs.map +1 -0
  77. package/dist/runtime.d.cts +236 -0
  78. package/dist/runtime.d.ts +236 -0
  79. package/dist/runtime.iife.js +2 -0
  80. package/dist/runtime.iife.js.map +1 -0
  81. package/dist/runtime.js +55 -0
  82. package/dist/runtime.js.map +1 -0
  83. package/dist/widgets.umd.js +1 -1
  84. package/dist/widgets.umd.js.map +1 -1
  85. package/docs/ROADMAP.md +69 -38
  86. package/docs/ai-prompt-guide.md +54 -0
  87. package/docs/components/README.md +253 -0
  88. package/docs/components/usa-accordion.md +38 -0
  89. package/docs/components/usa-acrylic.md +38 -0
  90. package/docs/components/usa-add-to-cart.md +40 -0
  91. package/docs/components/usa-ambient.md +32 -0
  92. package/docs/components/usa-anim-icon.md +34 -0
  93. package/docs/components/usa-audio.md +38 -0
  94. package/docs/components/usa-aurora.md +36 -0
  95. package/docs/components/usa-auto-animate.md +44 -0
  96. package/docs/components/usa-auto-skeleton.md +38 -0
  97. package/docs/components/usa-avatar-stack.md +38 -0
  98. package/docs/components/usa-back-to-top.md +32 -0
  99. package/docs/components/usa-badge-wall.md +39 -0
  100. package/docs/components/usa-badge.md +36 -0
  101. package/docs/components/usa-bar-chart.md +33 -0
  102. package/docs/components/usa-bg-generator.md +32 -0
  103. package/docs/components/usa-blobs.md +32 -0
  104. package/docs/components/usa-bottom-sheet.md +32 -0
  105. package/docs/components/usa-button.md +78 -0
  106. package/docs/components/usa-card-stack.md +40 -0
  107. package/docs/components/usa-card.md +94 -0
  108. package/docs/components/usa-carousel-3d.md +40 -0
  109. package/docs/components/usa-carousel.md +40 -0
  110. package/docs/components/usa-cart-drawer.md +33 -0
  111. package/docs/components/usa-chapter-nav.md +40 -0
  112. package/docs/components/usa-chat-composer.md +33 -0
  113. package/docs/components/usa-check.md +32 -0
  114. package/docs/components/usa-checkbox.md +32 -0
  115. package/docs/components/usa-click.md +36 -0
  116. package/docs/components/usa-clock-control.md +37 -0
  117. package/docs/components/usa-code-export.md +36 -0
  118. package/docs/components/usa-color-picker.md +32 -0
  119. package/docs/components/usa-command-palette.md +39 -0
  120. package/docs/components/usa-compare.md +38 -0
  121. package/docs/components/usa-countdown.md +32 -0
  122. package/docs/components/usa-counter.md +32 -0
  123. package/docs/components/usa-cube-gallery.md +40 -0
  124. package/docs/components/usa-cube.md +36 -0
  125. package/docs/components/usa-cursor.md +32 -0
  126. package/docs/components/usa-date-picker.md +32 -0
  127. package/docs/components/usa-depth.md +44 -0
  128. package/docs/components/usa-dialog.md +40 -0
  129. package/docs/components/usa-disclosure.md +38 -0
  130. package/docs/components/usa-distort.md +36 -0
  131. package/docs/components/usa-dock.md +40 -0
  132. package/docs/components/usa-dot-network.md +32 -0
  133. package/docs/components/usa-double-tap.md +36 -0
  134. package/docs/components/usa-draggable.md +38 -0
  135. package/docs/components/usa-draw.md +36 -0
  136. package/docs/components/usa-drawer.md +34 -0
  137. package/docs/components/usa-equalizer.md +33 -0
  138. package/docs/components/usa-fab.md +40 -0
  139. package/docs/components/usa-festival-banner.md +32 -0
  140. package/docs/components/usa-field.md +34 -0
  141. package/docs/components/usa-file-drop.md +35 -0
  142. package/docs/components/usa-fullpage.md +38 -0
  143. package/docs/components/usa-fx.md +851 -0
  144. package/docs/components/usa-gauge.md +32 -0
  145. package/docs/components/usa-gen-art.md +32 -0
  146. package/docs/components/usa-gesture-fx.md +36 -0
  147. package/docs/components/usa-gesture-sticker.md +36 -0
  148. package/docs/components/usa-glitch.md +32 -0
  149. package/docs/components/usa-globe.md +33 -0
  150. package/docs/components/usa-gradient-text.md +32 -0
  151. package/docs/components/usa-grain.md +36 -0
  152. package/docs/components/usa-grid-glow.md +36 -0
  153. package/docs/components/usa-gyro-card.md +38 -0
  154. package/docs/components/usa-handwriting.md +32 -0
  155. package/docs/components/usa-hero-video.md +38 -0
  156. package/docs/components/usa-hold.md +32 -0
  157. package/docs/components/usa-hud-panel.md +38 -0
  158. package/docs/components/usa-hydrate.md +42 -0
  159. package/docs/components/usa-icon-morph.md +34 -0
  160. package/docs/components/usa-install-button.md +32 -0
  161. package/docs/components/usa-kanban.md +46 -0
  162. package/docs/components/usa-keyframe-editor.md +37 -0
  163. package/docs/components/usa-kpi.md +32 -0
  164. package/docs/components/usa-leaderboard.md +41 -0
  165. package/docs/components/usa-like.md +32 -0
  166. package/docs/components/usa-liquid-nav.md +36 -0
  167. package/docs/components/usa-liquid.md +36 -0
  168. package/docs/components/usa-loading-bar.md +35 -0
  169. package/docs/components/usa-location-card.md +34 -0
  170. package/docs/components/usa-lottie-icon.md +34 -0
  171. package/docs/components/usa-lottie.md +32 -0
  172. package/docs/components/usa-lyrics.md +38 -0
  173. package/docs/components/usa-magnetic.md +32 -0
  174. package/docs/components/usa-marquee.md +38 -0
  175. package/docs/components/usa-mask-reveal.md +36 -0
  176. package/docs/components/usa-masonry-flow.md +42 -0
  177. package/docs/components/usa-masonry.md +38 -0
  178. package/docs/components/usa-menu-toggle.md +34 -0
  179. package/docs/components/usa-menu.md +44 -0
  180. package/docs/components/usa-message-list.md +39 -0
  181. package/docs/components/usa-milestones.md +40 -0
  182. package/docs/components/usa-modal.md +42 -0
  183. package/docs/components/usa-morph.md +34 -0
  184. package/docs/components/usa-motion-inspector.md +32 -0
  185. package/docs/components/usa-motion-prefs.md +32 -0
  186. package/docs/components/usa-motion-spec.md +32 -0
  187. package/docs/components/usa-motion-switch.md +34 -0
  188. package/docs/components/usa-motion-theme.md +40 -0
  189. package/docs/components/usa-motion.md +42 -0
  190. package/docs/components/usa-music-player.md +36 -0
  191. package/docs/components/usa-native-preview.md +36 -0
  192. package/docs/components/usa-nav-morph.md +40 -0
  193. package/docs/components/usa-navbar.md +36 -0
  194. package/docs/components/usa-notification-bell.md +37 -0
  195. package/docs/components/usa-odometer.md +34 -0
  196. package/docs/components/usa-organic-card.md +36 -0
  197. package/docs/components/usa-otp.md +33 -0
  198. package/docs/components/usa-overscroll.md +36 -0
  199. package/docs/components/usa-pack.md +111 -0
  200. package/docs/components/usa-pagination.md +32 -0
  201. package/docs/components/usa-panorama.md +32 -0
  202. package/docs/components/usa-particles.md +32 -0
  203. package/docs/components/usa-pause-all.md +32 -0
  204. package/docs/components/usa-perf-monitor.md +32 -0
  205. package/docs/components/usa-pinch-zoom.md +36 -0
  206. package/docs/components/usa-player.md +38 -0
  207. package/docs/components/usa-plugin-card.md +61 -0
  208. package/docs/components/usa-plugin-store.md +36 -0
  209. package/docs/components/usa-popover.md +38 -0
  210. package/docs/components/usa-post-fx.md +36 -0
  211. package/docs/components/usa-presence.md +36 -0
  212. package/docs/components/usa-press.md +32 -0
  213. package/docs/components/usa-prize-wheel.md +32 -0
  214. package/docs/components/usa-product-gallery.md +40 -0
  215. package/docs/components/usa-progress-ring.md +38 -0
  216. package/docs/components/usa-progress.md +34 -0
  217. package/docs/components/usa-prop-panel.md +34 -0
  218. package/docs/components/usa-pull-cord.md +32 -0
  219. package/docs/components/usa-pull-refresh.md +37 -0
  220. package/docs/components/usa-radar.md +32 -0
  221. package/docs/components/usa-reactions.md +32 -0
  222. package/docs/components/usa-red-envelope.md +32 -0
  223. package/docs/components/usa-retro-button.md +34 -0
  224. package/docs/components/usa-reveal.md +36 -0
  225. package/docs/components/usa-ripple.md +32 -0
  226. package/docs/components/usa-scene.md +38 -0
  227. package/docs/components/usa-scramble.md +32 -0
  228. package/docs/components/usa-scroll-highlight.md +34 -0
  229. package/docs/components/usa-scroll-progress.md +36 -0
  230. package/docs/components/usa-scroll-scene.md +66 -0
  231. package/docs/components/usa-scrolly.md +40 -0
  232. package/docs/components/usa-segmented.md +40 -0
  233. package/docs/components/usa-shader.md +74 -0
  234. package/docs/components/usa-sheet.md +42 -0
  235. package/docs/components/usa-shimmer-text.md +32 -0
  236. package/docs/components/usa-shortcut.md +34 -0
  237. package/docs/components/usa-skeleton-reveal.md +42 -0
  238. package/docs/components/usa-skeleton.md +36 -0
  239. package/docs/components/usa-sketch-chart.md +32 -0
  240. package/docs/components/usa-slider.md +32 -0
  241. package/docs/components/usa-sparkline.md +32 -0
  242. package/docs/components/usa-spatial-card.md +40 -0
  243. package/docs/components/usa-spinner.md +34 -0
  244. package/docs/components/usa-splash.md +36 -0
  245. package/docs/components/usa-split-text.md +32 -0
  246. package/docs/components/usa-spotlight.md +40 -0
  247. package/docs/components/usa-spring.md +42 -0
  248. package/docs/components/usa-stagger.md +40 -0
  249. package/docs/components/usa-star-rating.md +34 -0
  250. package/docs/components/usa-stepper.md +42 -0
  251. package/docs/components/usa-sticky-stack.md +40 -0
  252. package/docs/components/usa-sticky-wall.md +40 -0
  253. package/docs/components/usa-stories.md +38 -0
  254. package/docs/components/usa-story.md +80 -0
  255. package/docs/components/usa-suggestion-chips.md +32 -0
  256. package/docs/components/usa-swipe-deck.md +40 -0
  257. package/docs/components/usa-swipeable.md +36 -0
  258. package/docs/components/usa-switch.md +32 -0
  259. package/docs/components/usa-tab-bar.md +46 -0
  260. package/docs/components/usa-tabs.md +40 -0
  261. package/docs/components/usa-terminal.md +38 -0
  262. package/docs/components/usa-text-rotate.md +32 -0
  263. package/docs/components/usa-theme-surface.md +36 -0
  264. package/docs/components/usa-theme-switcher.md +32 -0
  265. package/docs/components/usa-tilt.md +36 -0
  266. package/docs/components/usa-timeline.md +40 -0
  267. package/docs/components/usa-tip.md +44 -0
  268. package/docs/components/usa-toast-stack.md +36 -0
  269. package/docs/components/usa-toaster.md +36 -0
  270. package/docs/components/usa-typewriter.md +32 -0
  271. package/docs/components/usa-upload-progress.md +33 -0
  272. package/docs/components/usa-video-card.md +40 -0
  273. package/docs/components/usa-view-switch.md +38 -0
  274. package/docs/components/usa-voice-button.md +33 -0
  275. package/docs/components/usa-volume-knob.md +32 -0
  276. package/docs/components/usa-water-ripple.md +36 -0
  277. package/docs/components/usa-wave-text.md +32 -0
  278. package/docs/components/usa-weather-card.md +32 -0
  279. package/docs/components/usa-worker-canvas.md +32 -0
  280. package/docs/components/usa-xp-bar.md +33 -0
  281. package/docs/components.md +105 -0
  282. package/docs/runtime/core.md +55 -0
  283. package/docs/runtime/format-css.md +59 -0
  284. package/docs/runtime/format-motion.md +56 -0
  285. package/docs/runtime/format-svg.md +62 -0
  286. package/docs/runtime/scroll.md +61 -0
  287. package/package.json +71 -7
@@ -0,0 +1,187 @@
1
+ 'use strict';
2
+
3
+ var tween = require('./tween-CBuWYpI-.cjs');
4
+
5
+ /**
6
+ * Normalised keyframes shared by the format loaders: a list of frames with
7
+ * offsets in [0, 1], camelCase props and an optional per-segment easing,
8
+ * played as a runtime `Timeline` (one tween per segment).
9
+ */
10
+ const camelProp = (k) => (k.startsWith('--') ? k : k.trim().replace(/-([a-z])/g, (_, c) => c.toUpperCase()));
11
+ /** Fill in missing offsets (spaced evenly between known ones, first 0 / last 1), as the WAAPI does. */
12
+ function distributeOffsets(frames) {
13
+ const out = frames.map((f) => ({ ...f }));
14
+ if (!out.length)
15
+ return out;
16
+ if (out[0].offset == null)
17
+ out[0].offset = out.length === 1 ? 1 : 0;
18
+ if (out[out.length - 1].offset == null)
19
+ out[out.length - 1].offset = 1;
20
+ let i = 0;
21
+ while (i < out.length) {
22
+ if (out[i].offset != null) {
23
+ i++;
24
+ continue;
25
+ }
26
+ const a = i - 1;
27
+ let b = i;
28
+ while (out[b].offset == null)
29
+ b++;
30
+ const from = out[a].offset, to = out[b].offset;
31
+ for (let k = i; k < b; k++)
32
+ out[k].offset = from + ((to - from) * (k - a)) / (b - a);
33
+ i = b;
34
+ }
35
+ return out;
36
+ }
37
+ /** CSS transform functions → runtime transform shorthands (translate/rotate/scale/skew); null when not representable (matrix, 3D, …). */
38
+ function transformToProps(t) {
39
+ if (!t || t === 'none')
40
+ return { x: 0, y: 0, rotate: 0, scale: 1 };
41
+ const out = {};
42
+ const re = /([a-zA-Z][a-zA-Z0-9]*)\(([^)]*)\)/g;
43
+ let m;
44
+ let rest = t;
45
+ while ((m = re.exec(t))) {
46
+ rest = rest.replace(m[0], '');
47
+ const args = m[2].split(/[\s,]+/).filter(Boolean);
48
+ switch (m[1]) {
49
+ case 'translate':
50
+ out.x = args[0];
51
+ out.y = args[1] ?? 0;
52
+ break;
53
+ case 'translateX':
54
+ out.x = args[0];
55
+ break;
56
+ case 'translateY':
57
+ out.y = args[0];
58
+ break;
59
+ case 'translate3d':
60
+ if (parseFloat(args[2] || '0') !== 0)
61
+ return null;
62
+ out.x = args[0];
63
+ out.y = args[1] ?? 0;
64
+ break;
65
+ case 'scale3d':
66
+ if (parseFloat(args[2] ?? '1') !== 1)
67
+ return null;
68
+ if (args[1] !== undefined && args[1] !== args[0]) {
69
+ out.scaleX = +args[0];
70
+ out.scaleY = +args[1];
71
+ }
72
+ else
73
+ out.scale = +args[0];
74
+ break;
75
+ case 'rotate':
76
+ case 'rotateZ':
77
+ out.rotate = args[0];
78
+ break;
79
+ case 'scale':
80
+ if (args[1] !== undefined && args[1] !== args[0]) {
81
+ out.scaleX = +args[0];
82
+ out.scaleY = +args[1];
83
+ }
84
+ else
85
+ out.scale = +args[0];
86
+ break;
87
+ case 'scaleX':
88
+ out.scaleX = +args[0];
89
+ break;
90
+ case 'scaleY':
91
+ out.scaleY = +args[0];
92
+ break;
93
+ case 'skewX':
94
+ out.skewX = args[0];
95
+ break;
96
+ case 'skewY':
97
+ out.skewY = args[0];
98
+ break;
99
+ default: return null;
100
+ }
101
+ }
102
+ return rest.trim() ? null : out;
103
+ }
104
+ /** Expand `transform` into shorthands where possible (kept as a discrete prop otherwise). */
105
+ function expandProps(props) {
106
+ const out = {};
107
+ for (const [k, v] of Object.entries(props)) {
108
+ if (k === 'transform' && typeof v === 'string') {
109
+ const t = transformToProps(v);
110
+ if (t) {
111
+ Object.assign(out, t);
112
+ continue;
113
+ }
114
+ }
115
+ out[k] = v;
116
+ }
117
+ return out;
118
+ }
119
+ const tweenable = (v) => {
120
+ try {
121
+ tween.parseValue(v);
122
+ return true;
123
+ }
124
+ catch {
125
+ return false;
126
+ }
127
+ };
128
+ /**
129
+ * Play frames on a target as a `Timeline` (paused unless `paused: false`).
130
+ * Props missing from a frame hold their previous value; non-numeric values
131
+ * (e.g. `display`, `matrix(...)`) switch discretely at the segment midpoint.
132
+ */
133
+ function framesToTimeline(target, frames, o = {}) {
134
+ const dur = o.duration ?? 1000;
135
+ const fs = [...frames].sort((a, b) => a.offset - b.offset).map((f) => ({ ...f, props: expandProps(f.props) }));
136
+ const tl = new tween.Timeline({ repeat: o.repeat, yoyo: o.yoyo, delay: o.delay, onUpdate: o.onUpdate, onComplete: o.onComplete });
137
+ const keys = Array.from(new Set(fs.flatMap((f) => Object.keys(f.props))));
138
+ // carry values forward / backward so every frame has every key
139
+ const filled = fs.map((f) => ({ ...f, props: { ...f.props } }));
140
+ for (const k of keys) {
141
+ let last;
142
+ for (const f of filled) {
143
+ if (k in f.props)
144
+ last = f.props[k];
145
+ else if (last !== undefined)
146
+ f.props[k] = last;
147
+ }
148
+ let next;
149
+ for (let i = filled.length - 1; i >= 0; i--) {
150
+ if (k in filled[i].props)
151
+ next = filled[i].props[k];
152
+ else if (next !== undefined)
153
+ filled[i].props[k] = next;
154
+ }
155
+ }
156
+ const def = o.ease ?? 'linear';
157
+ if (filled.length === 1)
158
+ filled.unshift({ ...filled[0], offset: 0 });
159
+ for (let i = 0; i < filled.length - 1; i++) {
160
+ const a = filled[i], b = filled[i + 1];
161
+ const segDur = Math.max(0, (b.offset - a.offset) * dur);
162
+ const from = {}, to = {};
163
+ const discrete = [];
164
+ for (const k of keys) {
165
+ if (tweenable(a.props[k]) && tweenable(b.props[k])) {
166
+ from[k] = a.props[k];
167
+ to[k] = b.props[k];
168
+ }
169
+ else
170
+ discrete.push([k, b.props[k]]);
171
+ }
172
+ tl.add(new tween.Tween(target, { from, to, duration: segDur, ease: a.easing ? tween.parseEase(a.easing) : def, paused: true }), a.offset * dur);
173
+ for (const [k, v] of discrete)
174
+ tl.call(() => { if (target.style)
175
+ target.style.setProperty(k.replace(/[A-Z]/g, (c) => '-' + c.toLowerCase()), String(v));
176
+ else
177
+ target[k] = v; }, a.offset * dur + segDur / 2);
178
+ }
179
+ if (o.paused === false)
180
+ tl.play();
181
+ return tl;
182
+ }
183
+
184
+ exports.camelProp = camelProp;
185
+ exports.distributeOffsets = distributeOffsets;
186
+ exports.framesToTimeline = framesToTimeline;
187
+ //# sourceMappingURL=keyframes-ZheOkpt0.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"keyframes-ZheOkpt0.cjs","sources":["../../src/runtime/keyframes.ts"],"sourcesContent":["/**\n * Normalised keyframes shared by the format loaders: a list of frames with\n * offsets in [0, 1], camelCase props and an optional per-segment easing,\n * played as a runtime `Timeline` (one tween per segment).\n */\nimport { Timeline, Tween, parseValue, type Target, type PlayOptions } from './tween';\nimport { parseEase, type Ease } from './ease';\n\nexport interface Frame {\n offset: number;\n props: Record<string, string | number>;\n /** Easing from this frame to the next. */\n easing?: string;\n}\n\nexport interface KeyframesPlayOptions extends PlayOptions {\n /** ms (default 1000). */\n duration?: number;\n /** Default easing for segments without their own (default 'linear', as in CSS / WAAPI keyframes). */\n ease?: string | Ease;\n}\n\nexport const camelProp = (k: string): string => (k.startsWith('--') ? k : k.trim().replace(/-([a-z])/g, (_, c: string) => c.toUpperCase()));\n\n/** Fill in missing offsets (spaced evenly between known ones, first 0 / last 1), as the WAAPI does. */\nexport function distributeOffsets<T extends { offset?: number | null }>(frames: T[]): (T & { offset: number })[] {\n const out = frames.map((f) => ({ ...f })) as (T & { offset: number })[];\n if (!out.length) return out;\n if (out[0].offset == null) out[0].offset = out.length === 1 ? 1 : 0;\n if (out[out.length - 1].offset == null) out[out.length - 1].offset = 1;\n let i = 0;\n while (i < out.length) {\n if (out[i].offset != null) { i++; continue; }\n const a = i - 1;\n let b = i;\n while (out[b].offset == null) b++;\n const from = out[a].offset, to = out[b].offset;\n for (let k = i; k < b; k++) out[k].offset = from + ((to - from) * (k - a)) / (b - a);\n i = b;\n }\n return out;\n}\n\n/** CSS transform functions → runtime transform shorthands (translate/rotate/scale/skew); null when not representable (matrix, 3D, …). */\nexport function transformToProps(t: string): Record<string, string | number> | null {\n if (!t || t === 'none') return { x: 0, y: 0, rotate: 0, scale: 1 };\n const out: Record<string, string | number> = {};\n const re = /([a-zA-Z][a-zA-Z0-9]*)\\(([^)]*)\\)/g;\n let m: RegExpExecArray | null;\n let rest = t;\n while ((m = re.exec(t))) {\n rest = rest.replace(m[0], '');\n const args = m[2].split(/[\\s,]+/).filter(Boolean);\n switch (m[1]) {\n case 'translate': out.x = args[0]; out.y = args[1] ?? 0; break;\n case 'translateX': out.x = args[0]; break;\n case 'translateY': out.y = args[0]; break;\n case 'translate3d': if (parseFloat(args[2] || '0') !== 0) return null; out.x = args[0]; out.y = args[1] ?? 0; break;\n case 'scale3d': if (parseFloat(args[2] ?? '1') !== 1) return null; if (args[1] !== undefined && args[1] !== args[0]) { out.scaleX = +args[0]; out.scaleY = +args[1]; } else out.scale = +args[0]; break;\n case 'rotate': case 'rotateZ': out.rotate = args[0]; break;\n case 'scale': if (args[1] !== undefined && args[1] !== args[0]) { out.scaleX = +args[0]; out.scaleY = +args[1]; } else out.scale = +args[0]; break;\n case 'scaleX': out.scaleX = +args[0]; break;\n case 'scaleY': out.scaleY = +args[0]; break;\n case 'skewX': out.skewX = args[0]; break;\n case 'skewY': out.skewY = args[0]; break;\n default: return null;\n }\n }\n return rest.trim() ? null : out;\n}\n\n/** Expand `transform` into shorthands where possible (kept as a discrete prop otherwise). */\nexport function expandProps(props: Record<string, string | number>): Record<string, string | number> {\n const out: Record<string, string | number> = {};\n for (const [k, v] of Object.entries(props)) {\n if (k === 'transform' && typeof v === 'string') {\n const t = transformToProps(v);\n if (t) { Object.assign(out, t); continue; }\n }\n out[k] = v;\n }\n return out;\n}\n\nconst tweenable = (v: string | number): boolean => {\n try { parseValue(v); return true; } catch { return false; }\n};\n\n/**\n * Play frames on a target as a `Timeline` (paused unless `paused: false`).\n * Props missing from a frame hold their previous value; non-numeric values\n * (e.g. `display`, `matrix(...)`) switch discretely at the segment midpoint.\n */\nexport function framesToTimeline(target: Target, frames: Frame[], o: KeyframesPlayOptions = {}): Timeline {\n const dur = o.duration ?? 1000;\n const fs = [...frames].sort((a, b) => a.offset - b.offset).map((f) => ({ ...f, props: expandProps(f.props) }));\n const tl = new Timeline({ repeat: o.repeat, yoyo: o.yoyo, delay: o.delay, onUpdate: o.onUpdate, onComplete: o.onComplete });\n const keys = Array.from(new Set(fs.flatMap((f) => Object.keys(f.props))));\n // carry values forward / backward so every frame has every key\n const filled = fs.map((f) => ({ ...f, props: { ...f.props } }));\n for (const k of keys) {\n let last: string | number | undefined;\n for (const f of filled) { if (k in f.props) last = f.props[k]; else if (last !== undefined) f.props[k] = last; }\n let next: string | number | undefined;\n for (let i = filled.length - 1; i >= 0; i--) { if (k in filled[i].props) next = filled[i].props[k]; else if (next !== undefined) filled[i].props[k] = next; }\n }\n const def = o.ease ?? 'linear';\n if (filled.length === 1) filled.unshift({ ...filled[0], offset: 0 });\n for (let i = 0; i < filled.length - 1; i++) {\n const a = filled[i], b = filled[i + 1];\n const segDur = Math.max(0, (b.offset - a.offset) * dur);\n const from: Record<string, string | number> = {}, to: Record<string, string | number> = {};\n const discrete: [string, string | number][] = [];\n for (const k of keys) {\n if (tweenable(a.props[k]) && tweenable(b.props[k])) { from[k] = a.props[k]; to[k] = b.props[k]; }\n else discrete.push([k, b.props[k]]);\n }\n tl.add(new Tween(target, { from, to, duration: segDur, ease: a.easing ? parseEase(a.easing) : def, paused: true }), a.offset * dur);\n for (const [k, v] of discrete) tl.call(() => { if ((target as any).style) (target as HTMLElement).style.setProperty(k.replace(/[A-Z]/g, (c) => '-' + c.toLowerCase()), String(v)); else (target as any)[k] = v; }, a.offset * dur + segDur / 2);\n }\n if (o.paused === false) tl.play();\n return tl;\n}\n"],"names":["parseValue","Timeline","Tween","parseEase"],"mappings":";;;;AAAA;;;;AAIG;MAkBU,SAAS,GAAG,CAAC,CAAS,MAAc,CAAC,CAAC,UAAU,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE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CAAC;gBAAE,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;YAAE;;AAC3F,gBAAA,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;QACrC;QACA,EAAE,CAAC,GAAG,CAAC,IAAIC,WAAK,CAAC,MAAM,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,MAAM,GAAGC,eAAS,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC,CAAC,MAAM,GAAG,GAAG,CAAC;AACnI,QAAA,KAAK,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,IAAI,QAAQ;YAAE,EAAE,CAAC,IAAI,CAAC,MAAK,EAAG,IAAK,MAAc,CAAC,KAAK;AAAG,gBAAA,MAAsB,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC,KAAK,GAAG,GAAG,CAAC,CAAC,WAAW,EAAE,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC;;AAAQ,gBAAA,MAAc,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,MAAM,GAAG,GAAG,GAAG,MAAM,GAAG,CAAC,CAAC;IACjP;AACA,IAAA,IAAI,CAAC,CAAC,MAAM,KAAK,KAAK;QAAE,EAAE,CAAC,IAAI,EAAE;AACjC,IAAA,OAAO,EAAE;AACX;;;;;;"}
@@ -0,0 +1,69 @@
1
+ /**
2
+ * Module registry shared by every copy of `motionary/runtime` on the page
3
+ * (ESM, CJS and the CDN IIFE builds all read the same `globalThis` slot),
4
+ * so a component never needs to import the runtime itself — it asks for a
5
+ * module with `requireModule()` and gets a clear error when it is missing.
6
+ * Nothing here touches `window` / `document`: safe to import during SSR and
7
+ * inside Web Workers.
8
+ */
9
+ /** Runtime version (kept in sync with the package version by the release script). */
10
+ const RUNTIME_VERSION = '10.2.0';
11
+ /** Where the CDN builds live (major-pinned). */
12
+ const RUNTIME_CDN = 'https://cdn.jsdelivr.net/npm/motionary@10/dist/';
13
+ const KEY = Symbol.for('motionary.runtime');
14
+ /** The page-wide registry (created on first use). */
15
+ function registry() {
16
+ const g = globalThis;
17
+ return (g[KEY] || (g[KEY] = { version: RUNTIME_VERSION, modules: new Map(), slots: {} }));
18
+ }
19
+ /** The import path of a module id. */
20
+ const modulePath = (id) => (id === 'core' ? 'motionary/runtime' : `motionary/runtime/${id}`);
21
+ /** The CDN IIFE file of a module id. */
22
+ const moduleCdn = (id) => RUNTIME_CDN + (id === 'core' ? 'runtime.iife.js' : `runtime/${id}.iife.js`);
23
+ /** The text of the "module missing" error (shared with the components). */
24
+ function missingMessage(id, who = 'This feature') {
25
+ const path = modulePath(id);
26
+ const reg = id === 'core' ? `import { use } from 'motionary/runtime'; use();` : `import { use } from 'motionary/runtime'; import { ${camel(id)} } from '${path}'; use(${camel(id)});`;
27
+ const cdn = id === 'core' ? `<script src="${moduleCdn('core')}"></script>` : `<script src="${moduleCdn('core')}"></script><script src="${moduleCdn(id)}"></script>`;
28
+ return `[motionary] ${who} requires ${path}. Install once: npm i motionary — then register it before the component mounts: ${reg} Or from a CDN (core first): ${cdn} Docs: https://github.com/HarrisonCN/Motionary/blob/main/docs/runtime/${id}.md`;
29
+ }
30
+ /** 'format-css' → 'formatCss' (the module object's export name). */
31
+ const camel = (id) => id.replace(/-(\w)/g, (_, c) => c.toUpperCase());
32
+ /** Thrown by `requireModule()` when a module is not registered. */
33
+ class RuntimeModuleError extends Error {
34
+ constructor(id, who) {
35
+ super(missingMessage(id, who));
36
+ this.name = 'RuntimeModuleError';
37
+ this.module = id;
38
+ }
39
+ }
40
+ /** Register modules (each once; re-registering the same id keeps the first). Returns the registry. */
41
+ function register(...mods) {
42
+ const r = registry();
43
+ for (const m of mods) {
44
+ if (!m || typeof m.id !== 'string')
45
+ throw new TypeError('[motionary] use(): not a runtime module — pass the object exported by motionary/runtime/<module>');
46
+ if (r.modules.has(m.id))
47
+ continue;
48
+ for (const dep of m.requires || [])
49
+ if (!r.modules.has(dep))
50
+ throw new RuntimeModuleError(dep, `motionary/runtime/${m.id}`);
51
+ r.modules.set(m.id, m);
52
+ m.setup?.(r);
53
+ }
54
+ return r;
55
+ }
56
+ /** Is a module registered? */
57
+ const hasModule = (id) => registry().modules.has(id);
58
+ /** The API of a registered module, or a `RuntimeModuleError` with install / import / CDN instructions. */
59
+ function requireModule(id, who) {
60
+ const m = registry().modules.get(id);
61
+ if (!m)
62
+ throw new RuntimeModuleError(id, who);
63
+ return m.api;
64
+ }
65
+ /** Ids of the registered modules. */
66
+ const registeredModules = () => Array.from(registry().modules.keys());
67
+
68
+ export { RUNTIME_VERSION as R, RUNTIME_CDN as a, RuntimeModuleError as b, moduleCdn as c, modulePath as d, registeredModules as e, registry as f, requireModule as g, hasModule as h, missingMessage as m, register as r };
69
+ //# sourceMappingURL=registry-BIEjKngP.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"registry-BIEjKngP.js","sources":["../../src/runtime/registry.ts"],"sourcesContent":["/**\n * Module registry shared by every copy of `motionary/runtime` on the page\n * (ESM, CJS and the CDN IIFE builds all read the same `globalThis` slot),\n * so a component never needs to import the runtime itself — it asks for a\n * module with `requireModule()` and gets a clear error when it is missing.\n * Nothing here touches `window` / `document`: safe to import during SSR and\n * inside Web Workers.\n */\n\n/** Runtime version (kept in sync with the package version by the release script). */\nexport const RUNTIME_VERSION = '10.2.0';\n\n/** Where the CDN builds live (major-pinned). */\nexport const RUNTIME_CDN = 'https://cdn.jsdelivr.net/npm/motionary@10/dist/';\n\n/** A runtime module: `{ id, version, api }`, registered with `use()`. */\nexport interface RuntimeModule<A = unknown> {\n /** Module id: 'core', 'format-css', 'scroll', … (import path `motionary/runtime/<id>`). */\n id: string;\n version: string;\n /** Other modules this one needs (registered first by `use()` callers). */\n requires?: string[];\n /** The module's public API (what `requireModule(id)` returns). */\n api: A;\n /** Optional one-time setup, called on first registration. */\n setup?(registry: RuntimeRegistry): void;\n}\n\nexport interface RuntimeRegistry {\n version: string;\n modules: Map<string, RuntimeModule>;\n /** Shared per-page state slots (the ticker lives here). */\n slots: Record<string, unknown>;\n}\n\nconst KEY = Symbol.for('motionary.runtime');\n\n/** The page-wide registry (created on first use). */\nexport function registry(): RuntimeRegistry {\n const g = globalThis as unknown as Record<symbol, RuntimeRegistry | undefined>;\n return (g[KEY] ||= { version: RUNTIME_VERSION, modules: new Map(), slots: {} });\n}\n\n/** The import path of a module id. */\nexport const modulePath = (id: string): string => (id === 'core' ? 'motionary/runtime' : `motionary/runtime/${id}`);\n\n/** The CDN IIFE file of a module id. */\nexport const moduleCdn = (id: string): string => RUNTIME_CDN + (id === 'core' ? 'runtime.iife.js' : `runtime/${id}.iife.js`);\n\n/** The text of the \"module missing\" error (shared with the components). */\nexport function missingMessage(id: string, who = 'This feature'): string {\n const path = modulePath(id);\n const reg = id === 'core' ? `import { use } from 'motionary/runtime'; use();` : `import { use } from 'motionary/runtime'; import { ${camel(id)} } from '${path}'; use(${camel(id)});`;\n const cdn = id === 'core' ? `<script src=\"${moduleCdn('core')}\"></script>` : `<script src=\"${moduleCdn('core')}\"></script><script src=\"${moduleCdn(id)}\"></script>`;\n return `[motionary] ${who} requires ${path}. Install once: npm i motionary — then register it before the component mounts: ${reg} Or from a CDN (core first): ${cdn} Docs: https://github.com/HarrisonCN/Motionary/blob/main/docs/runtime/${id}.md`;\n}\n\n/** 'format-css' → 'formatCss' (the module object's export name). */\nexport const camel = (id: string): string => id.replace(/-(\\w)/g, (_, c: string) => c.toUpperCase());\n\n/** Thrown by `requireModule()` when a module is not registered. */\nexport class RuntimeModuleError extends Error {\n readonly module: string;\n constructor(id: string, who?: string) {\n super(missingMessage(id, who));\n this.name = 'RuntimeModuleError';\n this.module = id;\n }\n}\n\n/** Register modules (each once; re-registering the same id keeps the first). Returns the registry. */\nexport function register(...mods: RuntimeModule[]): RuntimeRegistry {\n const r = registry();\n for (const m of mods) {\n if (!m || typeof m.id !== 'string') throw new TypeError('[motionary] use(): not a runtime module — pass the object exported by motionary/runtime/<module>');\n if (r.modules.has(m.id)) continue;\n for (const dep of m.requires || []) if (!r.modules.has(dep)) throw new RuntimeModuleError(dep, `motionary/runtime/${m.id}`);\n r.modules.set(m.id, m as RuntimeModule);\n m.setup?.(r);\n }\n return r;\n}\n\n/** Is a module registered? */\nexport const hasModule = (id: string): boolean => registry().modules.has(id);\n\n/** The API of a registered module, or a `RuntimeModuleError` with install / import / CDN instructions. */\nexport function requireModule<A = unknown>(id: string, who?: string): A {\n const m = registry().modules.get(id);\n if (!m) throw new RuntimeModuleError(id, who);\n return m.api as A;\n}\n\n/** Ids of the registered modules. */\nexport const registeredModules = (): string[] => Array.from(registry().modules.keys());\n"],"names":[],"mappings":"AAAA;;;;;;;AAOG;AAEH;AACO,MAAM,eAAe,GAAG;AAE/B;AACO,MAAM,WAAW,GAAG;AAsB3B,MAAM,GAAG,GAAG,MAAM,CAAC,GAAG,CAAC,mBAAmB,CAAC;AAE3C;SACgB,QAAQ,GAAA;IACtB,MAAM,CAAC,GAAG,UAAoE;IAC9E,QAAQ,CAAC,CAAC,GAAG,CAAA,KAAL,CAAC,CAAC,GAAG,CAAA,GAAM,EAAE,OAAO,EAAE,eAAe,EAAE,OAAO,EAAE,IAAI,GAAG,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,CAAA;AAChF;AAEA;AACO,MAAM,UAAU,GAAG,CAAC,EAAU,MAAc,EAAE,KAAK,MAAM,GAAG,mBAAmB,GAAG,CAAA,kBAAA,EAAqB,EAAE,CAAA,CAAE;AAElH;AACO,MAAM,SAAS,GAAG,CAAC,EAAU,KAAa,WAAW,IAAI,EAAE,KAAK,MAAM,GAAG,iBAAiB,GAAG,CAAA,QAAA,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,MAAM,CAAC,IAAI,IAAI,EAAE;QACpB,IAAI,CAAC,CAAC,IAAI,OAAO,CAAC,CAAC,EAAE,KAAK,QAAQ;AAAE,YAAA,MAAM,IAAI,SAAS,CAAC,kGAAkG,CAAC;QAC3J,IAAI,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;YAAE;AACzB,QAAA,KAAK,MAAM,GAAG,IAAI,CAAC,CAAC,QAAQ,IAAI,EAAE;YAAE,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC;gBAAE,MAAM,IAAI,kBAAkB,CAAC,GAAG,EAAE,CAAA,kBAAA,EAAqB,CAAC,CAAC,EAAE,CAAA,CAAE,CAAC;QAC3H,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAkB,CAAC;AACvC,QAAA,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC;IACd;AACA,IAAA,OAAO,CAAC;AACV;AAEA;AACO,MAAM,SAAS,GAAG,CAAC,EAAU,KAAc,QAAQ,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE;AAE3E;AACM,SAAU,aAAa,CAAc,EAAU,EAAE,GAAY,EAAA;IACjE,MAAM,CAAC,GAAG,QAAQ,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC;AACpC,IAAA,IAAI,CAAC,CAAC;AAAE,QAAA,MAAM,IAAI,kBAAkB,CAAC,EAAE,EAAE,GAAG,CAAC;IAC7C,OAAO,CAAC,CAAC,GAAQ;AACnB;AAEA;AACO,MAAM,iBAAiB,GAAG,MAAgB,KAAK,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,IAAI,EAAE;;;;"}
@@ -0,0 +1,81 @@
1
+ 'use strict';
2
+
3
+ /**
4
+ * Module registry shared by every copy of `motionary/runtime` on the page
5
+ * (ESM, CJS and the CDN IIFE builds all read the same `globalThis` slot),
6
+ * so a component never needs to import the runtime itself — it asks for a
7
+ * module with `requireModule()` and gets a clear error when it is missing.
8
+ * Nothing here touches `window` / `document`: safe to import during SSR and
9
+ * inside Web Workers.
10
+ */
11
+ /** Runtime version (kept in sync with the package version by the release script). */
12
+ const RUNTIME_VERSION = '10.2.0';
13
+ /** Where the CDN builds live (major-pinned). */
14
+ const RUNTIME_CDN = 'https://cdn.jsdelivr.net/npm/motionary@10/dist/';
15
+ const KEY = Symbol.for('motionary.runtime');
16
+ /** The page-wide registry (created on first use). */
17
+ function registry() {
18
+ const g = globalThis;
19
+ return (g[KEY] || (g[KEY] = { version: RUNTIME_VERSION, modules: new Map(), slots: {} }));
20
+ }
21
+ /** The import path of a module id. */
22
+ const modulePath = (id) => (id === 'core' ? 'motionary/runtime' : `motionary/runtime/${id}`);
23
+ /** The CDN IIFE file of a module id. */
24
+ const moduleCdn = (id) => RUNTIME_CDN + (id === 'core' ? 'runtime.iife.js' : `runtime/${id}.iife.js`);
25
+ /** The text of the "module missing" error (shared with the components). */
26
+ function missingMessage(id, who = 'This feature') {
27
+ const path = modulePath(id);
28
+ const reg = id === 'core' ? `import { use } from 'motionary/runtime'; use();` : `import { use } from 'motionary/runtime'; import { ${camel(id)} } from '${path}'; use(${camel(id)});`;
29
+ const cdn = id === 'core' ? `<script src="${moduleCdn('core')}"></script>` : `<script src="${moduleCdn('core')}"></script><script src="${moduleCdn(id)}"></script>`;
30
+ return `[motionary] ${who} requires ${path}. Install once: npm i motionary — then register it before the component mounts: ${reg} Or from a CDN (core first): ${cdn} Docs: https://github.com/HarrisonCN/Motionary/blob/main/docs/runtime/${id}.md`;
31
+ }
32
+ /** 'format-css' → 'formatCss' (the module object's export name). */
33
+ const camel = (id) => id.replace(/-(\w)/g, (_, c) => c.toUpperCase());
34
+ /** Thrown by `requireModule()` when a module is not registered. */
35
+ class RuntimeModuleError extends Error {
36
+ constructor(id, who) {
37
+ super(missingMessage(id, who));
38
+ this.name = 'RuntimeModuleError';
39
+ this.module = id;
40
+ }
41
+ }
42
+ /** Register modules (each once; re-registering the same id keeps the first). Returns the registry. */
43
+ function register(...mods) {
44
+ const r = registry();
45
+ for (const m of mods) {
46
+ if (!m || typeof m.id !== 'string')
47
+ throw new TypeError('[motionary] use(): not a runtime module — pass the object exported by motionary/runtime/<module>');
48
+ if (r.modules.has(m.id))
49
+ continue;
50
+ for (const dep of m.requires || [])
51
+ if (!r.modules.has(dep))
52
+ throw new RuntimeModuleError(dep, `motionary/runtime/${m.id}`);
53
+ r.modules.set(m.id, m);
54
+ m.setup?.(r);
55
+ }
56
+ return r;
57
+ }
58
+ /** Is a module registered? */
59
+ const hasModule = (id) => registry().modules.has(id);
60
+ /** The API of a registered module, or a `RuntimeModuleError` with install / import / CDN instructions. */
61
+ function requireModule(id, who) {
62
+ const m = registry().modules.get(id);
63
+ if (!m)
64
+ throw new RuntimeModuleError(id, who);
65
+ return m.api;
66
+ }
67
+ /** Ids of the registered modules. */
68
+ const registeredModules = () => Array.from(registry().modules.keys());
69
+
70
+ exports.RUNTIME_CDN = RUNTIME_CDN;
71
+ exports.RUNTIME_VERSION = RUNTIME_VERSION;
72
+ exports.RuntimeModuleError = RuntimeModuleError;
73
+ exports.hasModule = hasModule;
74
+ exports.missingMessage = missingMessage;
75
+ exports.moduleCdn = moduleCdn;
76
+ exports.modulePath = modulePath;
77
+ exports.register = register;
78
+ exports.registeredModules = registeredModules;
79
+ exports.registry = registry;
80
+ exports.requireModule = requireModule;
81
+ //# sourceMappingURL=registry-eJgpFAzI.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"registry-eJgpFAzI.cjs","sources":["../../src/runtime/registry.ts"],"sourcesContent":["/**\n * Module registry shared by every copy of `motionary/runtime` on the page\n * (ESM, CJS and the CDN IIFE builds all read the same `globalThis` slot),\n * so a component never needs to import the runtime itself — it asks for a\n * module with `requireModule()` and gets a clear error when it is missing.\n * Nothing here touches `window` / `document`: safe to import during SSR and\n * inside Web Workers.\n */\n\n/** Runtime version (kept in sync with the package version by the release script). */\nexport const RUNTIME_VERSION = '10.2.0';\n\n/** Where the CDN builds live (major-pinned). */\nexport const RUNTIME_CDN = 'https://cdn.jsdelivr.net/npm/motionary@10/dist/';\n\n/** A runtime module: `{ id, version, api }`, registered with `use()`. */\nexport interface RuntimeModule<A = unknown> {\n /** Module id: 'core', 'format-css', 'scroll', … (import path `motionary/runtime/<id>`). */\n id: string;\n version: string;\n /** Other modules this one needs (registered first by `use()` callers). */\n requires?: string[];\n /** The module's public API (what `requireModule(id)` returns). */\n api: A;\n /** Optional one-time setup, called on first registration. */\n setup?(registry: RuntimeRegistry): void;\n}\n\nexport interface RuntimeRegistry {\n version: string;\n modules: Map<string, RuntimeModule>;\n /** Shared per-page state slots (the ticker lives here). */\n slots: Record<string, unknown>;\n}\n\nconst KEY = Symbol.for('motionary.runtime');\n\n/** The page-wide registry (created on first use). */\nexport function registry(): RuntimeRegistry {\n const g = globalThis as unknown as Record<symbol, RuntimeRegistry | undefined>;\n return (g[KEY] ||= { version: RUNTIME_VERSION, modules: new Map(), slots: {} });\n}\n\n/** The import path of a module id. */\nexport const modulePath = (id: string): string => (id === 'core' ? 'motionary/runtime' : `motionary/runtime/${id}`);\n\n/** The CDN IIFE file of a module id. */\nexport const moduleCdn = (id: string): string => RUNTIME_CDN + (id === 'core' ? 'runtime.iife.js' : `runtime/${id}.iife.js`);\n\n/** The text of the \"module missing\" error (shared with the components). */\nexport function missingMessage(id: string, who = 'This feature'): string {\n const path = modulePath(id);\n const reg = id === 'core' ? `import { use } from 'motionary/runtime'; use();` : `import { use } from 'motionary/runtime'; import { ${camel(id)} } from '${path}'; use(${camel(id)});`;\n const cdn = id === 'core' ? `<script src=\"${moduleCdn('core')}\"></script>` : `<script src=\"${moduleCdn('core')}\"></script><script src=\"${moduleCdn(id)}\"></script>`;\n return `[motionary] ${who} requires ${path}. Install once: npm i motionary — then register it before the component mounts: ${reg} Or from a CDN (core first): ${cdn} Docs: https://github.com/HarrisonCN/Motionary/blob/main/docs/runtime/${id}.md`;\n}\n\n/** 'format-css' → 'formatCss' (the module object's export name). */\nexport const camel = (id: string): string => id.replace(/-(\\w)/g, (_, c: string) => c.toUpperCase());\n\n/** Thrown by `requireModule()` when a module is not registered. */\nexport class RuntimeModuleError extends Error {\n readonly module: string;\n constructor(id: string, who?: string) {\n super(missingMessage(id, who));\n this.name = 'RuntimeModuleError';\n this.module = id;\n }\n}\n\n/** Register modules (each once; re-registering the same id keeps the first). Returns the registry. */\nexport function register(...mods: RuntimeModule[]): RuntimeRegistry {\n const r = registry();\n for (const m of mods) {\n if (!m || typeof m.id !== 'string') throw new TypeError('[motionary] use(): not a runtime module — pass the object exported by motionary/runtime/<module>');\n if (r.modules.has(m.id)) continue;\n for (const dep of m.requires || []) if (!r.modules.has(dep)) throw new RuntimeModuleError(dep, `motionary/runtime/${m.id}`);\n r.modules.set(m.id, m as RuntimeModule);\n m.setup?.(r);\n }\n return r;\n}\n\n/** Is a module registered? */\nexport const hasModule = (id: string): boolean => registry().modules.has(id);\n\n/** The API of a registered module, or a `RuntimeModuleError` with install / import / CDN instructions. */\nexport function requireModule<A = unknown>(id: string, who?: string): A {\n const m = registry().modules.get(id);\n if (!m) throw new RuntimeModuleError(id, who);\n return m.api as A;\n}\n\n/** Ids of the registered modules. */\nexport const registeredModules = (): string[] => Array.from(registry().modules.keys());\n"],"names":[],"mappings":";;AAAA;;;;;;;AAOG;AAEH;AACO,MAAM,eAAe,GAAG;AAE/B;AACO,MAAM,WAAW,GAAG;AAsB3B,MAAM,GAAG,GAAG,MAAM,CAAC,GAAG,CAAC,mBAAmB,CAAC;AAE3C;SACgB,QAAQ,GAAA;IACtB,MAAM,CAAC,GAAG,UAAoE;IAC9E,QAAQ,CAAC,CAAC,GAAG,CAAA,KAAL,CAAC,CAAC,GAAG,CAAA,GAAM,EAAE,OAAO,EAAE,eAAe,EAAE,OAAO,EAAE,IAAI,GAAG,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,CAAA;AAChF;AA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M,iBAAiB,GAAG,MAAgB,KAAK,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,IAAI,EAAE;;;;;;;;;;;;;;"}
@@ -0,0 +1,70 @@
1
+ import { f as registry } from './registry-BIEjKngP.js';
2
+
3
+ /**
4
+ * The shared ticker: one requestAnimationFrame loop per page (or worker) for
5
+ * every runtime animation, with lag smoothing and a frame budget readout.
6
+ * Falls back to a 16 ms timer where rAF is missing (Node, some workers).
7
+ * Nothing runs until the first listener is added (SSR-safe).
8
+ */
9
+ function createTicker() {
10
+ const fns = new Set();
11
+ let time = 0, last = -1, fps = 60, maxDelta = 100, handle = null;
12
+ const g = globalThis;
13
+ const now = () => (g.performance?.now ? g.performance.now() : Date.now());
14
+ const raf = (cb) => (typeof g.requestAnimationFrame === 'function' ? g.requestAnimationFrame(cb) : setTimeout(() => cb(now()), 16));
15
+ const caf = (h) => (typeof g.cancelAnimationFrame === 'function' ? g.cancelAnimationFrame(h) : clearTimeout(h));
16
+ const run = (dt, cap = true) => {
17
+ const d = (cap ? Math.min(dt, maxDelta) : dt) * t.timeScale;
18
+ time += d;
19
+ for (const fn of Array.from(fns))
20
+ fn(time, d);
21
+ };
22
+ const frame = (ts) => {
23
+ handle = null;
24
+ if (!fns.size)
25
+ return;
26
+ const n = typeof ts === 'number' && ts > 0 ? ts : now();
27
+ const dt = last < 0 ? 0 : n - last;
28
+ last = n;
29
+ if (dt > 0)
30
+ fps = fps * 0.9 + (1000 / dt) * 0.1;
31
+ run(dt);
32
+ if (fns.size)
33
+ handle = raf(frame);
34
+ };
35
+ const wake = () => {
36
+ if (handle === null && fns.size) {
37
+ last = -1;
38
+ handle = raf(frame);
39
+ }
40
+ };
41
+ const t = {
42
+ add(fn) {
43
+ fns.add(fn);
44
+ wake();
45
+ return () => t.remove(fn);
46
+ },
47
+ remove(fn) {
48
+ fns.delete(fn);
49
+ if (!fns.size && handle !== null) {
50
+ caf(handle);
51
+ handle = null;
52
+ }
53
+ },
54
+ get time() { return time; },
55
+ get fps() { return Math.round(fps); },
56
+ get size() { return fns.size; },
57
+ lagSmoothing(ms) { maxDelta = ms > 0 ? ms : Infinity; },
58
+ timeScale: 1,
59
+ step(ms) { run(ms, false); },
60
+ };
61
+ return t;
62
+ }
63
+ /** The page-wide ticker (shared across every copy of the runtime). */
64
+ function getTicker() {
65
+ const s = registry().slots;
66
+ return (s.ticker || (s.ticker = createTicker()));
67
+ }
68
+
69
+ export { getTicker as g };
70
+ //# sourceMappingURL=ticker-CM_56oVy.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ticker-CM_56oVy.js","sources":["../../src/runtime/ticker.ts"],"sourcesContent":["/**\n * The shared ticker: one requestAnimationFrame loop per page (or worker) for\n * every runtime animation, with lag smoothing and a frame budget readout.\n * Falls back to a 16 ms timer where rAF is missing (Node, some workers).\n * Nothing runs until the first listener is added (SSR-safe).\n */\nimport { registry } from './registry';\n\nexport type TickFn = (time: number, delta: number) => void;\n\nexport interface Ticker {\n /** Add a listener; returns a remover. */\n add(fn: TickFn): () => void;\n remove(fn: TickFn): void;\n /** ms since the ticker started (frozen while sleeping). */\n readonly time: number;\n /** Smoothed frames per second. */\n readonly fps: number;\n /** Listener count (0 = asleep). */\n readonly size: number;\n /** Cap a single frame's delta (default 100 ms) so a background tab does not jump animations. */\n lagSmoothing(maxDelta: number): void;\n /** Global time scale (1 = normal, 0.5 = half speed, 0 = frozen). */\n timeScale: number;\n /** Advance by `ms` synchronously (tests, offline rendering, worker loops). */\n step(ms: number): void;\n}\n\nfunction createTicker(): Ticker {\n const fns = new Set<TickFn>();\n let time = 0, last = -1, fps = 60, maxDelta = 100, handle: unknown = null;\n const g = globalThis as any;\n const now = (): number => (g.performance?.now ? g.performance.now() : Date.now());\n const raf = (cb: (t: number) => void): unknown => (typeof g.requestAnimationFrame === 'function' ? g.requestAnimationFrame(cb) : setTimeout(() => cb(now()), 16));\n const caf = (h: unknown): void => (typeof g.cancelAnimationFrame === 'function' ? g.cancelAnimationFrame(h) : clearTimeout(h as any));\n const run = (dt: number, cap = true): void => {\n const d = (cap ? Math.min(dt, maxDelta) : dt) * t.timeScale;\n time += d;\n for (const fn of Array.from(fns)) fn(time, d);\n };\n const frame = (ts: number): void => {\n handle = null;\n if (!fns.size) return;\n const n = typeof ts === 'number' && ts > 0 ? ts : now();\n const dt = last < 0 ? 0 : n - last;\n last = n;\n if (dt > 0) fps = fps * 0.9 + (1000 / dt) * 0.1;\n run(dt);\n if (fns.size) handle = raf(frame);\n };\n const wake = (): void => {\n if (handle === null && fns.size) {\n last = -1;\n handle = raf(frame);\n }\n };\n const t: Ticker = {\n add(fn) {\n fns.add(fn);\n wake();\n return () => t.remove(fn);\n },\n remove(fn) {\n fns.delete(fn);\n if (!fns.size && handle !== null) {\n caf(handle);\n handle = null;\n }\n },\n get time() { return time; },\n get fps() { return Math.round(fps); },\n get size() { return fns.size; },\n lagSmoothing(ms) { maxDelta = ms > 0 ? ms : Infinity; },\n timeScale: 1,\n step(ms) { run(ms, false); },\n };\n return t;\n}\n\n/** The page-wide ticker (shared across every copy of the runtime). */\nexport function getTicker(): Ticker {\n const s = registry().slots;\n return (s.ticker ||= createTicker()) as Ticker;\n}\n"],"names":[],"mappings":";;AAAA;;;;;AAKG;AAuBH,SAAS,YAAY,GAAA;AACnB,IAAA,MAAM,GAAG,GAAG,IAAI,GAAG,EAAU;IAC7B,IAAI,IAAI,GAAG,CAAC,EAAE,IAAI,GAAG,EAAE,EAAE,GAAG,GAAG,EAAE,EAAE,QAAQ,GAAG,GAAG,EAAE,MAAM,GAAY,IAAI;IACzE,MAAM,CAAC,GAAG,UAAiB;AAC3B,IAAA,MAAM,GAAG,GAAG,OAAe,CAAC,CAAC,WAAW,EAAE,GAAG,GAAG,CAAC,CAAC,WAAW,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;AACjF,IAAA,MAAM,GAAG,GAAG,CAAC,EAAuB,MAAe,OAAO,CAAC,CAAC,qBAAqB,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,GAAK,YAAY,EAAE,CAAA;AACrC;;;;"}
@@ -0,0 +1,72 @@
1
+ 'use strict';
2
+
3
+ var registry = require('./registry-eJgpFAzI.cjs');
4
+
5
+ /**
6
+ * The shared ticker: one requestAnimationFrame loop per page (or worker) for
7
+ * every runtime animation, with lag smoothing and a frame budget readout.
8
+ * Falls back to a 16 ms timer where rAF is missing (Node, some workers).
9
+ * Nothing runs until the first listener is added (SSR-safe).
10
+ */
11
+ function createTicker() {
12
+ const fns = new Set();
13
+ let time = 0, last = -1, fps = 60, maxDelta = 100, handle = null;
14
+ const g = globalThis;
15
+ const now = () => (g.performance?.now ? g.performance.now() : Date.now());
16
+ const raf = (cb) => (typeof g.requestAnimationFrame === 'function' ? g.requestAnimationFrame(cb) : setTimeout(() => cb(now()), 16));
17
+ const caf = (h) => (typeof g.cancelAnimationFrame === 'function' ? g.cancelAnimationFrame(h) : clearTimeout(h));
18
+ const run = (dt, cap = true) => {
19
+ const d = (cap ? Math.min(dt, maxDelta) : dt) * t.timeScale;
20
+ time += d;
21
+ for (const fn of Array.from(fns))
22
+ fn(time, d);
23
+ };
24
+ const frame = (ts) => {
25
+ handle = null;
26
+ if (!fns.size)
27
+ return;
28
+ const n = typeof ts === 'number' && ts > 0 ? ts : now();
29
+ const dt = last < 0 ? 0 : n - last;
30
+ last = n;
31
+ if (dt > 0)
32
+ fps = fps * 0.9 + (1000 / dt) * 0.1;
33
+ run(dt);
34
+ if (fns.size)
35
+ handle = raf(frame);
36
+ };
37
+ const wake = () => {
38
+ if (handle === null && fns.size) {
39
+ last = -1;
40
+ handle = raf(frame);
41
+ }
42
+ };
43
+ const t = {
44
+ add(fn) {
45
+ fns.add(fn);
46
+ wake();
47
+ return () => t.remove(fn);
48
+ },
49
+ remove(fn) {
50
+ fns.delete(fn);
51
+ if (!fns.size && handle !== null) {
52
+ caf(handle);
53
+ handle = null;
54
+ }
55
+ },
56
+ get time() { return time; },
57
+ get fps() { return Math.round(fps); },
58
+ get size() { return fns.size; },
59
+ lagSmoothing(ms) { maxDelta = ms > 0 ? ms : Infinity; },
60
+ timeScale: 1,
61
+ step(ms) { run(ms, false); },
62
+ };
63
+ return t;
64
+ }
65
+ /** The page-wide ticker (shared across every copy of the runtime). */
66
+ function getTicker() {
67
+ const s = registry.registry().slots;
68
+ return (s.ticker || (s.ticker = createTicker()));
69
+ }
70
+
71
+ exports.getTicker = getTicker;
72
+ //# sourceMappingURL=ticker-D4o6enH0.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ticker-D4o6enH0.cjs","sources":["../../src/runtime/ticker.ts"],"sourcesContent":["/**\n * The shared ticker: one requestAnimationFrame loop per page (or worker) for\n * every runtime animation, with lag smoothing and a frame budget readout.\n * Falls back to a 16 ms timer where rAF is missing (Node, some workers).\n * Nothing runs until the first listener is added (SSR-safe).\n */\nimport { registry } from './registry';\n\nexport type TickFn = (time: number, delta: number) => void;\n\nexport interface Ticker {\n /** Add a listener; returns a remover. */\n add(fn: TickFn): () => void;\n remove(fn: TickFn): void;\n /** ms since the ticker started (frozen while sleeping). */\n readonly time: number;\n /** Smoothed frames per second. */\n readonly fps: number;\n /** Listener count (0 = asleep). */\n readonly size: number;\n /** Cap a single frame's delta (default 100 ms) so a background tab does not jump animations. */\n lagSmoothing(maxDelta: number): void;\n /** Global time scale (1 = normal, 0.5 = half speed, 0 = frozen). */\n timeScale: number;\n /** Advance by `ms` synchronously (tests, offline rendering, worker loops). */\n step(ms: number): void;\n}\n\nfunction createTicker(): Ticker {\n const fns = new Set<TickFn>();\n let time = 0, last = -1, fps = 60, maxDelta = 100, handle: unknown = null;\n const g = globalThis as any;\n const now = (): number => (g.performance?.now ? g.performance.now() : Date.now());\n const raf = (cb: (t: number) => void): unknown => (typeof g.requestAnimationFrame === 'function' ? g.requestAnimationFrame(cb) : setTimeout(() => cb(now()), 16));\n const caf = (h: unknown): void => (typeof g.cancelAnimationFrame === 'function' ? g.cancelAnimationFrame(h) : clearTimeout(h as any));\n const run = (dt: number, cap = true): void => {\n const d = (cap ? Math.min(dt, maxDelta) : dt) * t.timeScale;\n time += d;\n for (const fn of Array.from(fns)) fn(time, d);\n };\n const frame = (ts: number): void => {\n handle = null;\n if (!fns.size) return;\n const n = typeof ts === 'number' && ts > 0 ? ts : now();\n const dt = last < 0 ? 0 : n - last;\n last = n;\n if (dt > 0) fps = fps * 0.9 + (1000 / dt) * 0.1;\n run(dt);\n if (fns.size) handle = raf(frame);\n };\n const wake = (): void => {\n if (handle === null && fns.size) {\n last = -1;\n handle = raf(frame);\n }\n };\n const t: Ticker = {\n add(fn) {\n fns.add(fn);\n wake();\n return () => t.remove(fn);\n },\n remove(fn) {\n fns.delete(fn);\n if (!fns.size && handle !== null) {\n caf(handle);\n handle = null;\n }\n },\n get time() { return time; },\n get fps() { return Math.round(fps); },\n get size() { return fns.size; },\n lagSmoothing(ms) { maxDelta = ms > 0 ? ms : Infinity; },\n timeScale: 1,\n step(ms) { run(ms, false); },\n };\n return t;\n}\n\n/** The page-wide ticker (shared across every copy of the runtime). */\nexport function getTicker(): Ticker {\n const s = registry().slots;\n return (s.ticker ||= createTicker()) as Ticker;\n}\n"],"names":["registry"],"mappings":";;;;AAAA;;;;;AAKG;AAuBH,SAAS,YAAY,GAAA;AACnB,IAAA,MAAM,GAAG,GAAG,IAAI,GAAG,EAAU;IAC7B,IAAI,IAAI,GAAG,CAAC,EAAE,IAAI,GAAG,EAAE,EAAE,GAAG,GAAG,EAAE,EAAE,QAAQ,GAAG,GAAG,EAAE,MAAM,GAAY,IAAI;IACzE,MAAM,CAAC,GAAG,UAAiB;AAC3B,IAAA,MAAM,GAAG,GAAG,OAAe,CAAC,CAAC,WAAW,EAAE,GAAG,GAAG,CAAC,CAAC,WAAW,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;AACjF,IAAA,MAAM,GAAG,GAAG,CAAC,EAAuB,MAAe,OAAO,CAAC,CAAC,qBAAqB,KAAK,UAAU,GAAG,CAAC,CAAC,qBA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