@algorisys/tinyfly 0.64.0 → 0.66.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.
- package/README.md +66 -15
- package/lib/browser/tinyfly.iife.js +21 -2
- package/lib/browser/tinyfly.js +1331 -1122
- package/lib/browser/tinyfly.umd.js +21 -2
- package/lib/cli/tools.js +20 -3
- package/lib/embed/tinyfly-embed.iife.js +6 -3
- package/lib/embed/tinyfly-embed.js +444 -414
- package/lib/engine/tinyfly-engine.js +69 -55
- package/lib/engine/tinyfly-engine.umd.cjs +2 -2
- package/lib/player/tinyfly-player.es.js +86 -72
- package/lib/player/tinyfly-player.iife.js +2 -2
- package/lib/player/tinyfly-player.umd.js +2 -2
- package/lib/types/browser/index.d.ts +10 -0
- package/lib/types/embed/auto-mount.d.ts +7 -0
- package/lib/types/embed/controls.d.ts +5 -0
- package/lib/types/embed/mount.d.ts +2 -1
- package/lib/types/engine/core/timeline.d.ts +7 -2
- package/lib/types/player/player.d.ts +2 -1
- package/package.json +1 -1
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Mount every `[data-tinyfly-embed]` when the page is ready, if the script that
|
|
3
|
+
* is running now was loaded with `data-tinyfly-auto`. Call it at the top level of
|
|
4
|
+
* a bundle's entry: `document.currentScript` is only set while a classic script
|
|
5
|
+
* first runs.
|
|
6
|
+
*/
|
|
7
|
+
export declare function autoMountFromCurrentScript(): void;
|
|
@@ -25,6 +25,11 @@ export interface ControlLabels {
|
|
|
25
25
|
/** Announced before the step number, e.g. "Step" → "Step 2 of 5" */
|
|
26
26
|
step: string;
|
|
27
27
|
of: string;
|
|
28
|
+
/**
|
|
29
|
+
* The visible step counter, with `{index}` and `{total}`: `"{index} / {total}"`
|
|
30
|
+
* (default), `"Step {index} of {total}"`, `"第 {index} 步,共 {total} 步"`.
|
|
31
|
+
*/
|
|
32
|
+
stepFormat: string;
|
|
28
33
|
}
|
|
29
34
|
export declare const DEFAULT_LABELS: ControlLabels;
|
|
30
35
|
export interface ControlsOptions {
|
|
@@ -14,7 +14,8 @@ import { type Controls, type ControlsOptions } from './controls';
|
|
|
14
14
|
* <script src="…/tinyfly-embed.iife.js" data-tinyfly-auto></script>
|
|
15
15
|
*
|
|
16
16
|
* Or call `tinyfly.mountAll()` yourself. The timeline may also come from a URL
|
|
17
|
-
* (`data-src="slice.json"`).
|
|
17
|
+
* (`data-src="slice.json"`). A timeline without markers can take steps by time
|
|
18
|
+
* from `data-markers="0,2300,3800"`. Translated captions can sit beside it in a
|
|
18
19
|
* `<script type="application/json" data-tinyfly-captions>`. `data-controls="false"`
|
|
19
20
|
* leaves the controls out, and `data-labels` passes control labels as JSON.
|
|
20
21
|
*
|
|
@@ -41,8 +41,7 @@ export interface TimelineOptions {
|
|
|
41
41
|
export declare class Timeline {
|
|
42
42
|
readonly id: string;
|
|
43
43
|
readonly name?: string;
|
|
44
|
-
|
|
45
|
-
readonly captions?: Record<string, Record<string, string>>;
|
|
44
|
+
private _captions?;
|
|
46
45
|
private _tracks;
|
|
47
46
|
private _trackPlayers;
|
|
48
47
|
private _motionPathTracks;
|
|
@@ -187,6 +186,12 @@ export declare class Timeline {
|
|
|
187
186
|
get config(): Readonly<TimelineConfig>;
|
|
188
187
|
/** The timeline's markers, in time order (empty when it has none). */
|
|
189
188
|
get markers(): TimelineMarker[];
|
|
189
|
+
/** Replace the markers (kept in time order); an empty list removes them. */
|
|
190
|
+
setMarkers(markers: TimelineMarker[] | undefined): void;
|
|
191
|
+
/** Caption text per language, per marker id */
|
|
192
|
+
get captions(): Record<string, Record<string, string>> | undefined;
|
|
193
|
+
/** Replace the captions; languages with no captions are dropped. */
|
|
194
|
+
setCaptions(captions: Record<string, Record<string, string>> | undefined): void;
|
|
190
195
|
/** Start the between-iterations pause, if the timeline configures one. */
|
|
191
196
|
private _armRepeatDelay;
|
|
192
197
|
private _calculateDuration;
|
|
@@ -12,7 +12,8 @@ export interface PlayerOptions {
|
|
|
12
12
|
/**
|
|
13
13
|
* Which frame to show as soon as the animation loads, before anything plays:
|
|
14
14
|
* `'start'` (default), `'end'`, a time in milliseconds, or `'none'` to leave the
|
|
15
|
-
* markup as it is.
|
|
15
|
+
* markup as it is. Reduced motion takes precedence and shows the final frame
|
|
16
|
+
* (see `respectReducedMotion`).
|
|
16
17
|
*/
|
|
17
18
|
initialFrame?: 'start' | 'end' | 'none' | number;
|
|
18
19
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@algorisys/tinyfly",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.66.0",
|
|
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",
|