@pixodesk/svg-animator-web 1.0.43 → 1.0.45

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 CHANGED
@@ -92,7 +92,7 @@ animator.destroy(); // cleanup
92
92
  | `resetTimeline` | `boolean` | ignore the document's own timeline and start from the player's default timeline, with `timeline` on top |
93
93
  | `duration` · `delay` | `number` | Shortcuts for `timeline.duration` / `.delay` (ms) | <!-- px names=duration,delay -->
94
94
  | `iterations` | `number \| 'infinite'` | Shortcut for `timeline.iterations` |
95
- | `startOn` | `PxStartOn` | Shortcut for `timeline.trigger.startOn` |
95
+ | `start` | `PxTriggerStart` | Shortcut for `timeline.trigger.start` |
96
96
 
97
97
  The document plays the way it was designed with no configuration at all; `timeline` is for when
98
98
  one page needs it to play differently — the same file mounted twice at two speeds, or a file
@@ -102,7 +102,7 @@ that autostarts everywhere except inside your own transport UI:
102
102
  const animator = createAnimator({
103
103
  src: '/animation.json',
104
104
  container: '#box',
105
- timeline: { iterations: 'infinite', trigger: { startOn: 'programmatic' } },
105
+ timeline: { iterations: 'infinite', trigger: { start: 'none' } },
106
106
  });
107
107
  animator.play();
108
108
  ```
@@ -38,6 +38,16 @@ interface PxAnimatorOptions extends PxPlaybackOverride, PxAnimatorCallbacks {
38
38
  interface PxInternalAnimatorOptions extends PxAnimatorOptions {
39
39
  /** A custom render target for the frame-loop engine (`PxPlatformAdapter`). */
40
40
  adapter?: PxPlatformAdapter;
41
+ /**
42
+ * The root `<svg>` the CALLER rendered, when it renders the document itself (the React and
43
+ * Vue components). Triggers attach to it — pointer listeners, the visibility gate — and
44
+ * without one they are not wired at all, so even a `load` trigger never fires.
45
+ *
46
+ * Otherwise the engines look the root up as `#` + the document's root id, which finds
47
+ * nothing for the common document whose root `<svg>` has no id. The component already holds
48
+ * the element, so it hands it over rather than have it guessed.
49
+ */
50
+ rootElement?: Element;
41
51
  }
42
52
  /**
43
53
  * Creates an animator instance to control SVG animations.
@@ -38,6 +38,16 @@ interface PxAnimatorOptions extends PxPlaybackOverride, PxAnimatorCallbacks {
38
38
  interface PxInternalAnimatorOptions extends PxAnimatorOptions {
39
39
  /** A custom render target for the frame-loop engine (`PxPlatformAdapter`). */
40
40
  adapter?: PxPlatformAdapter;
41
+ /**
42
+ * The root `<svg>` the CALLER rendered, when it renders the document itself (the React and
43
+ * Vue components). Triggers attach to it — pointer listeners, the visibility gate — and
44
+ * without one they are not wired at all, so even a `load` trigger never fires.
45
+ *
46
+ * Otherwise the engines look the root up as `#` + the document's root id, which finds
47
+ * nothing for the common document whose root `<svg>` has no id. The component already holds
48
+ * the element, so it hands it over rather than have it guessed.
49
+ */
50
+ rootElement?: Element;
41
51
  }
42
52
  /**
43
53
  * Creates an animator instance to control SVG animations.