@algorisys/tinyfly 0.66.0 → 0.66.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +48 -21
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -135,6 +135,13 @@ npm install @algorisys/tinyfly
135
135
 
136
136
  Or use it with no build step from the [GitHub CDN](#use-from-a-script-tag-no-build-step).
137
137
 
138
+ It also installs a `tinyfly` command for teaching figures in build pipelines:
139
+
140
+ ```bash
141
+ npx tinyfly validate figure.json --markup figure.svg # fails the build on broken figures
142
+ npx tinyfly render figure.json figure.svg --at end > end.svg # a static frame for RSS, email, print
143
+ ```
144
+
138
145
  The package ships these entry points. Each is tree-shakeable, so you pay only
139
146
  for what you import:
140
147
 
@@ -169,6 +176,7 @@ live.to('.box', { x: 200, duration: 1, ease: 'power2.out' })
169
176
 
170
177
  ```jsx
171
178
  // React: everything the setup creates is reverted when the component unmounts
179
+ import { useRef } from 'react'
172
180
  import { useTinyfly } from '@algorisys/tinyfly/react'
173
181
 
174
182
  function Hero() {
@@ -195,7 +203,7 @@ GSAP-shaped functions at the top level. Teaching embeds are included: add
195
203
  itself.
196
204
 
197
205
  ```html
198
- <script src="https://cdn.jsdelivr.net/gh/algorisys-oss/tinyfly@v0.66.0/cdn/tinyfly.iife.js"></script>
206
+ <script src="https://cdn.jsdelivr.net/gh/algorisys-oss/tinyfly@v0.66.1/cdn/tinyfly.iife.js"></script>
199
207
  <script>
200
208
  tinyfly.to('.box', { x: 200, rotate: 90, duration: 1, ease: 'power2.out' })
201
209
 
@@ -217,9 +225,24 @@ itself.
217
225
  | `cdn/tinyfly-player.iife.js` | Player only (~17 KB gzipped), for playing editor exports |
218
226
  | `cdn/tinyfly-embed.iife.js` | Only teaching figures (~19 KB gzipped): player, step controls, auto-mount |
219
227
 
220
- Replace `@v0.59.0` with the version you want. **Pin a version in production**:
221
- a tag's files never change. `@main` follows the latest release, which jsDelivr
222
- caches for up to a day. Load one `tinyfly` global, not both.
228
+ Replace `@v0.66.1` with the version you want. **Pin a version in production**:
229
+ a tag's files never change, and each release's `cdn/README.md` lists an SRI hash
230
+ for `integrity=`. `@main` follows the latest release, which jsDelivr caches for up
231
+ to a day. Loading more than one bundle is safe: they add to the same `tinyfly`
232
+ global.
233
+
234
+ A teaching figure needs no code at all:
235
+
236
+ ```html
237
+ <figure data-tinyfly-embed data-options='{"stepMode": true}'>
238
+ <svg viewBox="0 0 720 200">…<rect data-tinyfly="cell-3" …/>…</svg>
239
+ <script type="application/json" data-tinyfly-timeline>{ …timeline JSON with markers… }</script>
240
+ <figcaption>Appending to a full slice</figcaption>
241
+ </figure>
242
+ <script src="https://cdn.jsdelivr.net/gh/algorisys-oss/tinyfly@v0.66.1/cdn/tinyfly.iife.js" data-tinyfly-auto></script>
243
+ ```
244
+
245
+ See [Teaching Animations](docs/teaching.md).
223
246
 
224
247
  Every card on the [Examples page](docs/editor-guide.md#examples) has **Copy code**, which gives you a
225
248
  complete HTML page already using these URLs.
@@ -234,7 +257,9 @@ This produces:
234
257
 
235
258
  - `lib/engine/tinyfly-engine.js` (ESM) and `.umd.cjs` — the engine
236
259
  - `lib/player/tinyfly-player.{es,umd,iife}.js` — the standalone DOM player
237
- - `lib/addons/{adapters,export,gsap-compat,drivers,interaction}.js` — the optional entry points
260
+ - `lib/addons/{adapters,export,gsap-compat,drivers,interaction,teach}.js` — the optional entry points
261
+ - `lib/frameworks/{react,vue,svelte,solid}.js` — the framework hooks
262
+ - `lib/embed/tinyfly-embed.{iife.js,js}` — teaching embeds; `lib/cli/tools.js` — the `tinyfly` command
238
263
  - `lib/browser/tinyfly.{iife,umd}.js` and `tinyfly.js` — the all-in-one bundle
239
264
  - `lib/types/**` — TypeScript declarations
240
265
 
@@ -294,26 +319,28 @@ animate();
294
319
 
295
320
  ### Embedding Animations
296
321
 
322
+ With a bundler (Vite, webpack, Next.js…):
323
+
324
+ ```js
325
+ import { play } from '@algorisys/tinyfly/player'
326
+
327
+ // Load from a JSON file (e.g. exported from the studio)
328
+ play('#animation', './animation.json', { loop: -1 })
329
+
330
+ // Or pass the JSON directly
331
+ play('#animation', { id: 'my-animation', config: { duration: 1000 }, tracks: [/* … */] })
332
+ ```
333
+
334
+ Without a build step, the player bundle puts the same functions on a `tinyfly` global:
335
+
297
336
  ```html
298
337
  <div id="animation">
299
338
  <div data-tinyfly="box" style="width: 60px; height: 60px; background: #4a9eff;"></div>
300
339
  </div>
301
340
 
302
- <script type="module">
303
- import { play } from '@algorisys/tinyfly/player';
304
-
305
- // Load from JSON file
306
- play('#animation', './animation.json', {
307
- loop: -1,
308
- autoplay: true
309
- });
310
-
311
- // Or use inline JSON
312
- play('#animation', {
313
- id: 'my-animation',
314
- config: { duration: 1000 },
315
- tracks: [...]
316
- });
341
+ <script src="https://cdn.jsdelivr.net/gh/algorisys-oss/tinyfly@v0.66.1/cdn/tinyfly-player.iife.js"></script>
342
+ <script>
343
+ tinyfly.play('#animation', './animation.json', { loop: -1 })
317
344
  </script>
318
345
  ```
319
346
 
@@ -420,7 +447,7 @@ Or skip the code entirely with declarative embeds (see [Teaching Animations](doc
420
447
  <svg viewBox="0 0 720 200">…</svg>
421
448
  <script type="application/json" data-tinyfly-timeline>{ …timeline JSON… }</script>
422
449
  </figure>
423
- <script src="https://cdn.jsdelivr.net/gh/algorisys-oss/tinyfly@v0.66.0/cdn/tinyfly-embed.iife.js" data-tinyfly-auto></script>
450
+ <script src="https://cdn.jsdelivr.net/gh/algorisys-oss/tinyfly@v0.66.1/cdn/tinyfly-embed.iife.js" data-tinyfly-auto></script>
424
451
  ```
425
452
 
426
453
  ### Audio / Video Sync
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@algorisys/tinyfly",
3
- "version": "0.66.0",
3
+ "version": "0.66.1",
4
4
  "type": "module",
5
5
  "description": "Lightweight, API-driven animation engine and editor. The engine is framework-agnostic and runs in browsers, Web Workers, and Node.",
6
6
  "license": "MIT",