@aarsteinmedia/dotlottie-player 6.5.2 → 6.5.4

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.
@@ -1,4 +1,4 @@
1
- import { HTMLBooleanAttribute, AnimationData, AnimationDirection, AddAnimationParams, Result, ConvertParams, AnimationItem, LottieManifest, AnimationSettings, AnimationConfiguration, Vector2 } from '@aarsteinmedia/lottie-web';
1
+ import { HTMLBooleanAttribute, AnimationData, AnimationDirection, AnimationItem, AddAnimationParams, Result, ConvertParams, LottieManifest, AnimationSettings, AnimationConfiguration, Vector2 } from '@aarsteinmedia/lottie-web';
2
2
  import { PlayMode, PreserveAspectRatio, RendererType } from '@aarsteinmedia/lottie-web/utils';
3
3
 
4
4
  declare abstract class PropertyCallbackElement extends HTMLElement {
@@ -7,8 +7,6 @@ declare abstract class PropertyCallbackElement extends HTMLElement {
7
7
  propertyChangedCallback(_name: string, _oldValue: unknown, _value: unknown): void;
8
8
  }
9
9
 
10
- declare function renderPlayer(this: DotLottiePlayerBase): Promise<void>;
11
-
12
10
  declare enum MouseOut {
13
11
  Pause = "pause",
14
12
  Reverse = "reverse",
@@ -26,15 +24,9 @@ declare enum PlayerState {
26
24
  Stopped = "stopped"
27
25
  }
28
26
 
29
- declare abstract class DotLottiePlayerBase extends PropertyCallbackElement {
30
- static get observedAttributes(): readonly ["animateOnScroll", "autoplay", "controls", "direction", "hover", "loop", "mode", "playOnClick", "playOnVisible", "selector", "speed", "src", "subframe"];
31
- static get observedProperties(): readonly ["playerState", "_isSettingsOpen", "_seeker", "_currentAnimation", "_animations"];
27
+ declare abstract class BaseElement extends PropertyCallbackElement {
32
28
  static get styles(): () => Promise<CSSStyleSheet>;
33
- isLight: boolean;
34
29
  playerState: PlayerState;
35
- shadow: ShadowRoot | undefined;
36
- source?: string;
37
- template?: HTMLTemplateElement;
38
30
  set animateOnScroll(value: HTMLBooleanAttribute);
39
31
  get animateOnScroll(): HTMLBooleanAttribute;
40
32
  get animations(): AnimationData[];
@@ -59,7 +51,6 @@ declare abstract class DotLottiePlayerBase extends PropertyCallbackElement {
59
51
  get hover(): HTMLBooleanAttribute;
60
52
  set intermission(value: number);
61
53
  get intermission(): number;
62
- get isDotLottie(): boolean;
63
54
  set loop(value: HTMLBooleanAttribute);
64
55
  get loop(): HTMLBooleanAttribute;
65
56
  set mode(value: PlayMode);
@@ -90,10 +81,12 @@ declare abstract class DotLottiePlayerBase extends PropertyCallbackElement {
90
81
  get src(): string | null;
91
82
  set subframe(value: HTMLBooleanAttribute);
92
83
  get subframe(): HTMLBooleanAttribute;
84
+ protected _animations: AnimationData[];
93
85
  protected _container: HTMLElement | null;
86
+ protected _currentAnimation: number;
94
87
  protected _errorMessage: string;
95
88
  protected _identifier: string;
96
- protected _isSettingsOpen: boolean;
89
+ protected _lottieInstance: AnimationItem | null;
97
90
  protected _playerState: {
98
91
  prev: PlayerState;
99
92
  count: number;
@@ -102,20 +95,49 @@ declare abstract class DotLottiePlayerBase extends PropertyCallbackElement {
102
95
  frame: number;
103
96
  playTimeout: ReturnType<typeof setTimeout> | null;
104
97
  };
98
+ private _toLog;
99
+ clearDevLog(): void;
100
+ devLog(toLog: unknown, type?: 'error' | 'info' | 'warn'): void;
101
+ play(): void;
102
+ protected _freeze(): void;
103
+ }
104
+
105
+ declare abstract class ScrollElement extends BaseElement {
106
+ isIntersecting: boolean;
107
+ private _intersectionObserver?;
108
+ private _scrollProbe?;
109
+ applyScrollProgress(): void;
110
+ cancelIntersectionObserver(): void;
111
+ cancelScrollProbe(): void;
112
+ scrollLoop(): void;
113
+ startScrollLoop(): void;
114
+ stopScrollLoop(): void;
115
+ protected _addIntersectionObserver(): void;
116
+ private _canDriveTimeline;
117
+ private _getGeometricScrollProgress;
118
+ private _getScrollProgress;
119
+ private _observeIntersectionTarget;
120
+ }
121
+
122
+ declare function renderPlayer(this: DotLottiePlayerBase): Promise<void>;
123
+
124
+ declare abstract class DotLottiePlayerBase extends ScrollElement {
125
+ static get observedAttributes(): readonly ["animateOnScroll", "autoplay", "controls", "direction", "hover", "loop", "mode", "playOnClick", "playOnVisible", "selector", "speed", "src", "subframe"];
126
+ static get observedProperties(): readonly ["playerState", "_isSettingsOpen", "_seeker", "_currentAnimation", "_animations"];
127
+ isLight: boolean;
128
+ shadow: ShadowRoot | undefined;
129
+ source?: string;
130
+ template?: HTMLTemplateElement;
131
+ get isDotLottie(): boolean;
132
+ protected _isSettingsOpen: boolean;
105
133
  protected _render: typeof renderPlayer;
106
134
  protected _seeker: number;
107
- private _animations;
108
135
  private _controlsLoadId;
109
- private _currentAnimation;
110
136
  private _errorLoadId;
111
- private _intersectionObserver?;
112
137
  private _isBounce;
113
138
  private _isDotLottie;
114
- private _isIntersecting;
115
- private _lottieInstance;
116
139
  private _manifest?;
117
140
  private _multiAnimationSettings;
118
- private _scrollProbe?;
119
141
  private _segment?;
120
142
  constructor();
121
143
  addAnimation(_params: AddAnimationParams): Promise<Result>;
@@ -165,9 +187,6 @@ declare abstract class DotLottiePlayerBase extends PropertyCallbackElement {
165
187
  preserveAspectRatio: PreserveAspectRatio;
166
188
  }): AnimationConfiguration;
167
189
  private _addEventListeners;
168
- private _addIntersectionObserver;
169
- private _applyScrollProgress;
170
- private _cancelScrollProbe;
171
190
  private _clearPrevious;
172
191
  private _complete;
173
192
  private _dataFailed;
@@ -175,7 +194,6 @@ declare abstract class DotLottiePlayerBase extends PropertyCallbackElement {
175
194
  private _DOMLoaded;
176
195
  private _enterFrame;
177
196
  private _getOptions;
178
- private _getScrollProgress;
179
197
  private _handleError;
180
198
  private _handleLdScript;
181
199
  private _handleSelector;
@@ -185,9 +203,6 @@ declare abstract class DotLottiePlayerBase extends PropertyCallbackElement {
185
203
  private _mouseLeave;
186
204
  private _onVisibilityChange;
187
205
  private _removeEventListeners;
188
- private _scrollLoop;
189
- private _startScrollLoop;
190
- private _stopScrollLoop;
191
206
  private _switchInstance;
192
207
  private _toggleEventListeners;
193
208
  private _toggleSettings;
package/dist/full.d.ts CHANGED
@@ -2,8 +2,8 @@ import { RendererType, PreserveAspectRatio } from '@aarsteinmedia/lottie-web/uti
2
2
  export { PlayMode, PlayerEvent, RendererType } from '@aarsteinmedia/lottie-web/utils';
3
3
  import * as _aarsteinmedia_lottie_web from '@aarsteinmedia/lottie-web';
4
4
  import { AddAnimationParams, ConvertParams, AnimationConfiguration, Vector2 } from '@aarsteinmedia/lottie-web';
5
- import { D as DotLottiePlayerBase } from './chunks/constants.d-D4NjmiZl.js';
6
- export { M as MouseOut, P as PlayerState, t as tagName } from './chunks/constants.d-D4NjmiZl.js';
5
+ import { D as DotLottiePlayerBase } from './chunks/constants.d-D18TmCtN.js';
6
+ export { M as MouseOut, P as PlayerState, t as tagName } from './chunks/constants.d-D18TmCtN.js';
7
7
 
8
8
  declare class DotLottiePlayer extends DotLottiePlayerBase {
9
9
  addAnimation(params: AddAnimationParams): Promise<_aarsteinmedia_lottie_web.Result>;
package/dist/full.js CHANGED
@@ -1,8 +1,8 @@
1
1
  import { RendererType, isServer } from '@aarsteinmedia/lottie-web/utils';
2
2
  export { PlayMode, PlayerEvent, RendererType } from '@aarsteinmedia/lottie-web/utils';
3
3
  import { loadAnimation } from '@aarsteinmedia/lottie-web';
4
- import { D as DotLottiePlayerBase, l as loadDotLottieTools, t as tagName } from './chunks/DotLottiePlayerBase-BFDljHjF.js';
5
- export { M as MouseOut, P as PlayerState } from './chunks/DotLottiePlayerBase-BFDljHjF.js';
4
+ import { D as DotLottiePlayerBase, l as loadDotLottieTools, t as tagName } from './chunks/DotLottiePlayerBase-D2f8vWzM.js';
5
+ export { M as MouseOut, P as PlayerState } from './chunks/DotLottiePlayerBase-D2f8vWzM.js';
6
6
  import '@aarsteinmedia/lottie-web/dotlottie';
7
7
 
8
8
  /**
package/dist/light.d.ts CHANGED
@@ -2,8 +2,8 @@ import { RendererType, PreserveAspectRatio } from '@aarsteinmedia/lottie-web/uti
2
2
  export { PlayMode, PlayerEvent, RendererType } from '@aarsteinmedia/lottie-web/utils';
3
3
  import * as _aarsteinmedia_lottie_web from '@aarsteinmedia/lottie-web';
4
4
  import { AnimationConfiguration, Vector2 } from '@aarsteinmedia/lottie-web';
5
- import { D as DotLottiePlayerBase } from './chunks/constants.d-D4NjmiZl.js';
6
- export { M as MouseOut, P as PlayerState, t as tagName } from './chunks/constants.d-D4NjmiZl.js';
5
+ import { D as DotLottiePlayerBase } from './chunks/constants.d-D18TmCtN.js';
6
+ export { M as MouseOut, P as PlayerState, t as tagName } from './chunks/constants.d-D18TmCtN.js';
7
7
 
8
8
  declare class DotLottiePlayerLight extends DotLottiePlayerBase {
9
9
  get renderer(): RendererType;
package/dist/light.js CHANGED
@@ -1,8 +1,8 @@
1
1
  import { RendererType, isServer } from '@aarsteinmedia/lottie-web/utils';
2
2
  export { PlayMode, PlayerEvent, RendererType } from '@aarsteinmedia/lottie-web/utils';
3
3
  import { loadAnimation } from '@aarsteinmedia/lottie-web/light';
4
- import { D as DotLottiePlayerBase, t as tagName } from './chunks/DotLottiePlayerBase-BFDljHjF.js';
5
- export { M as MouseOut, P as PlayerState } from './chunks/DotLottiePlayerBase-BFDljHjF.js';
4
+ import { D as DotLottiePlayerBase, t as tagName } from './chunks/DotLottiePlayerBase-D2f8vWzM.js';
5
+ export { M as MouseOut, P as PlayerState } from './chunks/DotLottiePlayerBase-D2f8vWzM.js';
6
6
  import '@aarsteinmedia/lottie-web/dotlottie';
7
7
 
8
8
  /**
package/dist/svg.d.ts CHANGED
@@ -2,8 +2,8 @@ import { RendererType, PreserveAspectRatio } from '@aarsteinmedia/lottie-web/uti
2
2
  export { PlayMode, PlayerEvent, RendererType } from '@aarsteinmedia/lottie-web/utils';
3
3
  import * as _aarsteinmedia_lottie_web from '@aarsteinmedia/lottie-web';
4
4
  import { AnimationConfiguration, Vector2 } from '@aarsteinmedia/lottie-web';
5
- import { D as DotLottiePlayerBase } from './chunks/constants.d-D4NjmiZl.js';
6
- export { M as MouseOut, P as PlayerState, t as tagName } from './chunks/constants.d-D4NjmiZl.js';
5
+ import { D as DotLottiePlayerBase } from './chunks/constants.d-D18TmCtN.js';
6
+ export { M as MouseOut, P as PlayerState, t as tagName } from './chunks/constants.d-D18TmCtN.js';
7
7
 
8
8
  declare class DotLottiePlayerSVG extends DotLottiePlayerBase {
9
9
  get renderer(): RendererType;
package/dist/svg.js CHANGED
@@ -1,8 +1,8 @@
1
1
  import { RendererType, isServer } from '@aarsteinmedia/lottie-web/utils';
2
2
  export { PlayMode, PlayerEvent, RendererType } from '@aarsteinmedia/lottie-web/utils';
3
3
  import { loadAnimation } from '@aarsteinmedia/lottie-web/svg';
4
- import { D as DotLottiePlayerBase, t as tagName } from './chunks/DotLottiePlayerBase-BFDljHjF.js';
5
- export { M as MouseOut, P as PlayerState } from './chunks/DotLottiePlayerBase-BFDljHjF.js';
4
+ import { D as DotLottiePlayerBase, t as tagName } from './chunks/DotLottiePlayerBase-D2f8vWzM.js';
5
+ export { M as MouseOut, P as PlayerState } from './chunks/DotLottiePlayerBase-D2f8vWzM.js';
6
6
  import '@aarsteinmedia/lottie-web/dotlottie';
7
7
 
8
8
  /**