@reuters-graphics/graphics-components 3.0.12 → 3.0.13

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 (75) hide show
  1. package/dist/components/@types/global.d.ts +45 -0
  2. package/dist/components/Scroller/Scroller.mdx +2 -2
  3. package/dist/components/ScrollerBase/ScrollerBase.mdx +0 -5
  4. package/dist/components/ScrollerVideo/Debug.svelte +207 -0
  5. package/dist/components/ScrollerVideo/Debug.svelte.d.ts +5 -0
  6. package/dist/components/ScrollerVideo/ScrollerVideo.mdx +462 -0
  7. package/dist/components/ScrollerVideo/ScrollerVideo.stories.svelte +190 -0
  8. package/dist/components/ScrollerVideo/ScrollerVideo.stories.svelte.d.ts +19 -0
  9. package/dist/components/ScrollerVideo/ScrollerVideo.svelte +292 -0
  10. package/dist/components/ScrollerVideo/ScrollerVideo.svelte.d.ts +58 -0
  11. package/dist/components/ScrollerVideo/ScrollerVideoForeground.svelte +164 -0
  12. package/dist/components/ScrollerVideo/ScrollerVideoForeground.svelte.d.ts +17 -0
  13. package/dist/components/ScrollerVideo/demo/AdvancedUsecases.svelte +114 -0
  14. package/dist/components/ScrollerVideo/demo/AdvancedUsecases.svelte.d.ts +3 -0
  15. package/dist/components/ScrollerVideo/demo/Embedded.svelte +94 -0
  16. package/dist/components/ScrollerVideo/demo/Embedded.svelte.d.ts +3 -0
  17. package/dist/components/ScrollerVideo/demo/WithAi2svelteForegrounds.svelte +117 -0
  18. package/dist/components/ScrollerVideo/demo/WithAi2svelteForegrounds.svelte.d.ts +3 -0
  19. package/dist/components/ScrollerVideo/demo/WithScrollerBase.svelte +80 -0
  20. package/dist/components/ScrollerVideo/demo/WithScrollerBase.svelte.d.ts +3 -0
  21. package/dist/components/ScrollerVideo/demo/WithTextForegrounds.svelte +72 -0
  22. package/dist/components/ScrollerVideo/demo/WithTextForegrounds.svelte.d.ts +18 -0
  23. package/dist/components/ScrollerVideo/demo/graphic/ai2svelte/ai-chart.svelte +631 -0
  24. package/dist/components/ScrollerVideo/demo/graphic/ai2svelte/ai-chart.svelte.d.ts +3 -0
  25. package/dist/components/ScrollerVideo/demo/graphic/ai2svelte/annotation1.svelte +428 -0
  26. package/dist/components/ScrollerVideo/demo/graphic/ai2svelte/annotation1.svelte.d.ts +26 -0
  27. package/dist/components/ScrollerVideo/demo/graphic/ai2svelte/annotation2.svelte +402 -0
  28. package/dist/components/ScrollerVideo/demo/graphic/ai2svelte/annotation2.svelte.d.ts +26 -0
  29. package/dist/components/ScrollerVideo/demo/graphic/ai2svelte/annotation3.svelte +398 -0
  30. package/dist/components/ScrollerVideo/demo/graphic/ai2svelte/annotation3.svelte.d.ts +26 -0
  31. package/dist/components/ScrollerVideo/demo/graphic/ai2svelte/annotation4.svelte +360 -0
  32. package/dist/components/ScrollerVideo/demo/graphic/ai2svelte/annotation4.svelte.d.ts +26 -0
  33. package/dist/components/ScrollerVideo/demo/graphic/imgs/ai-chart-md.png +0 -0
  34. package/dist/components/ScrollerVideo/demo/graphic/imgs/ai-chart-sm.png +0 -0
  35. package/dist/components/ScrollerVideo/demo/graphic/imgs/ai-chart-xs.png +0 -0
  36. package/dist/components/ScrollerVideo/demo/graphic/imgs/annotation1-lg.png +0 -0
  37. package/dist/components/ScrollerVideo/demo/graphic/imgs/annotation1-md.png +0 -0
  38. package/dist/components/ScrollerVideo/demo/graphic/imgs/annotation1-sm.png +0 -0
  39. package/dist/components/ScrollerVideo/demo/graphic/imgs/annotation1-xl.png +0 -0
  40. package/dist/components/ScrollerVideo/demo/graphic/imgs/annotation1-xs.png +0 -0
  41. package/dist/components/ScrollerVideo/demo/graphic/imgs/annotation2-lg.png +0 -0
  42. package/dist/components/ScrollerVideo/demo/graphic/imgs/annotation2-md.png +0 -0
  43. package/dist/components/ScrollerVideo/demo/graphic/imgs/annotation2-sm.png +0 -0
  44. package/dist/components/ScrollerVideo/demo/graphic/imgs/annotation2-xl.png +0 -0
  45. package/dist/components/ScrollerVideo/demo/graphic/imgs/annotation2-xs.png +0 -0
  46. package/dist/components/ScrollerVideo/demo/graphic/imgs/annotation3-lg.png +0 -0
  47. package/dist/components/ScrollerVideo/demo/graphic/imgs/annotation3-md.png +0 -0
  48. package/dist/components/ScrollerVideo/demo/graphic/imgs/annotation3-sm.png +0 -0
  49. package/dist/components/ScrollerVideo/demo/graphic/imgs/annotation3-xl.png +0 -0
  50. package/dist/components/ScrollerVideo/demo/graphic/imgs/annotation3-xs.png +0 -0
  51. package/dist/components/ScrollerVideo/demo/graphic/imgs/annotation4-lg.png +0 -0
  52. package/dist/components/ScrollerVideo/demo/graphic/imgs/annotation4-md.png +0 -0
  53. package/dist/components/ScrollerVideo/demo/graphic/imgs/annotation4-sm.png +0 -0
  54. package/dist/components/ScrollerVideo/demo/graphic/imgs/annotation4-xl.png +0 -0
  55. package/dist/components/ScrollerVideo/demo/graphic/imgs/annotation4-xs.png +0 -0
  56. package/dist/components/ScrollerVideo/ts/ScrollerVideo.d.ts +248 -0
  57. package/dist/components/ScrollerVideo/ts/ScrollerVideo.js +762 -0
  58. package/dist/components/ScrollerVideo/ts/mp4box.d.ts +137 -0
  59. package/dist/components/ScrollerVideo/ts/state.svelte.d.ts +51 -0
  60. package/dist/components/ScrollerVideo/ts/state.svelte.js +25 -0
  61. package/dist/components/ScrollerVideo/ts/utils.d.ts +70 -0
  62. package/dist/components/ScrollerVideo/ts/utils.js +92 -0
  63. package/dist/components/ScrollerVideo/ts/videoDecoder.d.ts +11 -0
  64. package/dist/components/ScrollerVideo/ts/videoDecoder.js +193 -0
  65. package/dist/components/ScrollerVideo/videos/HPO.mp4 +0 -0
  66. package/dist/components/ScrollerVideo/videos/drone.mp4 +0 -0
  67. package/dist/components/ScrollerVideo/videos/goldengate.mp4 +0 -0
  68. package/dist/components/ScrollerVideo/videos/tennis.mp4 +0 -0
  69. package/dist/components/ScrollerVideo/videos/waves_lg.mp4 +0 -0
  70. package/dist/components/ScrollerVideo/videos/waves_md.mp4 +0 -0
  71. package/dist/components/ScrollerVideo/videos/waves_sm.mp4 +0 -0
  72. package/dist/components/SiteHeadline/SiteHeadline.mdx +4 -1
  73. package/dist/index.d.ts +3 -1
  74. package/dist/index.js +2 -0
  75. package/package.json +3 -1
@@ -0,0 +1,360 @@
1
+ <script>
2
+ // @ts-ignore img
3
+ import chartXs from '../imgs/annotation4-xs.png';
4
+ // @ts-ignore img
5
+ import chartSm from '../imgs/annotation4-sm.png';
6
+ // @ts-ignore img
7
+ import chartMd from '../imgs/annotation4-md.png';
8
+ // @ts{width}mg
9
+ import chartLg from '../imgs/annotation4-md.png';
10
+ // @ts-ignore img
11
+ import chartXl from '../imgs/annotation4-xl.png';
12
+
13
+ let width = null;
14
+ </script>
15
+
16
+ <div id="g-annotation4-box" bind:clientWidth={width}>
17
+ <!-- Artboard: xs -->
18
+ {#if width && width >= 0 && width < 510}
19
+ <div id="g-annotation4-xs" class="g-artboard" style="">
20
+ <div style="padding: 0 0 187.8788% 0;"></div>
21
+ <div
22
+ id="g-annotation4-xs-img"
23
+ class="g-aiImg"
24
+ style={`background-image: url(${chartXs});`}
25
+ ></div>
26
+ <div
27
+ id="g-ai0-1"
28
+ class="g-text g-aiAbs"
29
+ style="top:9.5161%;left:16.1999%;width:61.5152%;"
30
+ >
31
+ <p>The wave path is a short one, only about 100 yards long</p>
32
+ </div>
33
+ <div
34
+ id="g-ai0-2"
35
+ class="g-text g-aiAbs"
36
+ style="top:73.871%;left:16.1999%;width:61.5152%;"
37
+ >
38
+ <p>
39
+ Fierro exits the barrel with a score of 9.33 out of 10, as she was
40
+ deep in the tube, had good speed and went over the foam ball on her
41
+ exit
42
+ </p>
43
+ </div>
44
+ </div>
45
+ {/if}
46
+ <!-- Artboard: sm -->
47
+ {#if width && width >= 510 && width < 660}
48
+ <div id="g-annotation4-sm" class="g-artboard" style="">
49
+ <div style="padding: 0 0 56.2745% 0;"></div>
50
+ <div
51
+ id="g-annotation4-sm-img"
52
+ class="g-aiImg"
53
+ style={`background-image: url(${chartSm});`}
54
+ ></div>
55
+ <div
56
+ id="g-ai1-1"
57
+ class="g-text g-aiAbs"
58
+ style="top:8.3624%;left:8.9136%;width:39.8039%;"
59
+ >
60
+ <p>The wave path is a short one, only about 100 yards long</p>
61
+ </div>
62
+ <div
63
+ id="g-ai1-2"
64
+ class="g-text g-aiAbs"
65
+ style="top:34.8432%;left:62.1168%;width:32.3529%;"
66
+ >
67
+ <p>
68
+ Fierro exits the barrel with a score of 9.33 out of 10, as she was
69
+ deep in the tube, had good speed and went over the foam ball on her
70
+ exit
71
+ </p>
72
+ </div>
73
+ <div
74
+ id="g-ai1-3"
75
+ class="g-text g-aiAbs"
76
+ style="top:68.9895%;left:9.1341%;width:47.2549%;"
77
+ >
78
+ <p>
79
+ The wave heaves so quickly that as it forms, it pulls water off the
80
+ reef, creating a ride that is often below sea level - seen as the
81
+ surfer exits up and over the wave to higher water
82
+ </p>
83
+ </div>
84
+ </div>
85
+ {/if}
86
+ <!-- Artboard: md -->
87
+ {#if width && width >= 660 && width < 930}
88
+ <div id="g-annotation4-md" class="g-artboard" style="">
89
+ <div style="padding: 0 0 56.3636% 0;"></div>
90
+ <div
91
+ id="g-annotation4-md-img"
92
+ class="g-aiImg"
93
+ style={`background-image: url(${chartMd});`}
94
+ ></div>
95
+ <div
96
+ id="g-ai2-1"
97
+ class="g-text g-aiAbs"
98
+ style="top:9.6774%;left:17.6103%;width:30%;"
99
+ >
100
+ <p>The wave path is a short one, only about 100 yards long</p>
101
+ </div>
102
+ <div
103
+ id="g-ai2-2"
104
+ class="g-text g-aiAbs"
105
+ style="top:37.3656%;left:62.5253%;width:30.303%;"
106
+ >
107
+ <p>
108
+ Fierro exits the barrel with a score of 9.33 out of 10, as she was
109
+ deep in the tube, had good speed and went over the foam ball on her
110
+ exit
111
+ </p>
112
+ </div>
113
+ <div
114
+ id="g-ai2-3"
115
+ class="g-text g-aiAbs"
116
+ style="top:71.2366%;left:15.8065%;width:36.8182%;"
117
+ >
118
+ <p>
119
+ The wave heaves so quickly that as it forms, it pulls water off the
120
+ reef, creating a ride that is often below sea level - seen as the
121
+ surfer exits up and over the wave to higher water
122
+ </p>
123
+ </div>
124
+ </div>
125
+ {/if}
126
+ <!-- Artboard: lg -->
127
+ {#if width && width >= 930 && width < 1200}
128
+ <div id="g-annotation4-lg" class="g-artboard" style="">
129
+ <div style="padding: 0 0 56.0215% 0;"></div>
130
+ <div
131
+ id="g-annotation4-lg-img"
132
+ class="g-aiImg"
133
+ style={`background-image: url(${chartLg});`}
134
+ ></div>
135
+ <div
136
+ id="g-ai3-1"
137
+ class="g-text g-aiAbs"
138
+ style="top:15.3551%;left:24.4264%;width:23.2258%;"
139
+ >
140
+ <p>The wave path is a short one,</p>
141
+ <p>only about 100 yards long</p>
142
+ </div>
143
+ <div
144
+ id="g-ai3-2"
145
+ class="g-text g-aiAbs"
146
+ style="top:38.5797%;left:69.5876%;width:25.3763%;"
147
+ >
148
+ <p>
149
+ Fierro exits the barrel with a score of 9.33 out of 10, as she was
150
+ deep in the tube, had good speed and went over the foam ball on her
151
+ exit
152
+ </p>
153
+ </div>
154
+ <div
155
+ id="g-ai3-3"
156
+ class="g-text g-aiAbs"
157
+ style="top:77.1593%;left:30.5554%;width:26.0215%;"
158
+ >
159
+ <p>
160
+ The wave heaves so quickly that as it forms, it pulls water off the
161
+ reef, creating a ride that is often below sea level - seen as the
162
+ surfer exits up and over the wave to higher water
163
+ </p>
164
+ </div>
165
+ </div>
166
+ {/if}
167
+ <!-- Artboard: xl -->
168
+ {#if width && width >= 1200}
169
+ <div id="g-annotation4-xl" class="g-artboard" style="">
170
+ <div style="padding: 0 0 51.6667% 0;"></div>
171
+ <div
172
+ id="g-annotation4-xl-img"
173
+ class="g-aiImg"
174
+ style={`background-image: url(${chartXl});`}
175
+ ></div>
176
+ <div
177
+ id="g-ai4-1"
178
+ class="g-text g-aiAbs g-aiPointText"
179
+ style="top:19.5123%;margin-top:-17px;left:27.8891%;width:218px;"
180
+ >
181
+ <p class="g-pstyle0">The wave path is a short one,</p>
182
+ <p class="g-pstyle0">only about 100 yards long</p>
183
+ </div>
184
+ <div
185
+ id="g-ai4-2"
186
+ class="g-text g-aiAbs g-aiPointText"
187
+ style="top:60.48%;margin-top:-33px;left:68.0232%;width:274px;"
188
+ >
189
+ <p class="g-pstyle0">Fierro exits the barrel with a score of</p>
190
+ <p class="g-pstyle0">9.33 out of 10, as she was deep in the</p>
191
+ <p class="g-pstyle0">tube, had good speed and went over</p>
192
+ <p class="g-pstyle0">the foam ball on her exit</p>
193
+ </div>
194
+ <div
195
+ id="g-ai4-3"
196
+ class="g-text g-aiAbs g-aiPointText"
197
+ style="top:82.5768%;margin-top:-33px;left:38.7732%;width:319px;"
198
+ >
199
+ <p class="g-pstyle0">The wave heaves so quickly that as it forms,</p>
200
+ <p class="g-pstyle0">
201
+ it pulls water off the reef, creating a rid e that
202
+ </p>
203
+ <p class="g-pstyle0">is often below sea level - seen as the surfer</p>
204
+ <p class="g-pstyle0">exits up and over the wave to higher water</p>
205
+ </div>
206
+ </div>
207
+ {/if}
208
+ </div>
209
+
210
+ <!-- End ai2html - 2024-07-19 13:16 -->
211
+
212
+ <!-- Generated by ai2html v0.100.0 - 2024-07-19 13:16 -->
213
+ <!-- ai file: annotation4.ai -->
214
+ <style>#g-annotation4-box,
215
+ #g-annotation4-box .g-artboard {
216
+ margin: 0 auto;
217
+ }
218
+
219
+ #g-annotation4-box p {
220
+ margin: 0;
221
+ }
222
+
223
+ #g-annotation4-box .g-aiAbs {
224
+ position: absolute;
225
+ }
226
+
227
+ #g-annotation4-box .g-aiImg {
228
+ position: absolute;
229
+ top: 0;
230
+ display: block;
231
+ width: 100% !important;
232
+ height: 100%;
233
+ background-size: contain;
234
+ background-repeat: no-repeat;
235
+ }
236
+
237
+ #g-annotation4-box .g-aiPointText p {
238
+ white-space: nowrap;
239
+ }
240
+
241
+ #g-annotation4-xs {
242
+ position: relative;
243
+ overflow: hidden;
244
+ }
245
+
246
+ #g-annotation4-xs p {
247
+ font-family: "Source Sans Pro", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Helvetica, Arial, sans-serif;
248
+ font-weight: 400;
249
+ line-height: 16px;
250
+ opacity: 1;
251
+ letter-spacing: 0em;
252
+ font-size: 16px;
253
+ text-align: left;
254
+ color: rgb(255, 255, 255);
255
+ text-transform: none;
256
+ padding-bottom: 0;
257
+ padding-top: 0;
258
+ mix-blend-mode: normal;
259
+ font-style: normal;
260
+ height: auto;
261
+ position: static;
262
+ }
263
+
264
+ #g-annotation4-sm {
265
+ position: relative;
266
+ overflow: hidden;
267
+ }
268
+
269
+ #g-annotation4-sm p {
270
+ font-family: "Source Sans Pro", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Helvetica, Arial, sans-serif;
271
+ font-weight: 400;
272
+ line-height: 16px;
273
+ opacity: 1;
274
+ letter-spacing: 0em;
275
+ font-size: 16px;
276
+ text-align: left;
277
+ color: rgb(255, 255, 255);
278
+ text-transform: none;
279
+ padding-bottom: 0;
280
+ padding-top: 0;
281
+ mix-blend-mode: normal;
282
+ font-style: normal;
283
+ height: auto;
284
+ position: static;
285
+ }
286
+
287
+ #g-annotation4-md {
288
+ position: relative;
289
+ overflow: hidden;
290
+ }
291
+
292
+ #g-annotation4-md p {
293
+ font-family: "Source Sans Pro", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Helvetica, Arial, sans-serif;
294
+ font-weight: 400;
295
+ line-height: 16px;
296
+ opacity: 1;
297
+ letter-spacing: 0em;
298
+ font-size: 16px;
299
+ text-align: left;
300
+ color: rgb(255, 255, 255);
301
+ text-transform: none;
302
+ padding-bottom: 0;
303
+ padding-top: 0;
304
+ mix-blend-mode: normal;
305
+ font-style: normal;
306
+ height: auto;
307
+ position: static;
308
+ }
309
+
310
+ #g-annotation4-lg {
311
+ position: relative;
312
+ overflow: hidden;
313
+ }
314
+
315
+ #g-annotation4-lg p {
316
+ font-family: "Source Sans Pro", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Helvetica, Arial, sans-serif;
317
+ font-weight: 400;
318
+ line-height: 16px;
319
+ opacity: 1;
320
+ letter-spacing: 0em;
321
+ font-size: 16px;
322
+ text-align: left;
323
+ color: rgb(255, 255, 255);
324
+ text-transform: none;
325
+ padding-bottom: 0;
326
+ padding-top: 0;
327
+ mix-blend-mode: normal;
328
+ font-style: normal;
329
+ height: auto;
330
+ position: static;
331
+ }
332
+
333
+ #g-annotation4-xl {
334
+ position: relative;
335
+ overflow: hidden;
336
+ }
337
+
338
+ #g-annotation4-xl p {
339
+ font-family: "Source Sans Pro", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Helvetica, Arial, sans-serif;
340
+ font-weight: 400;
341
+ line-height: 16px;
342
+ height: auto;
343
+ opacity: 1;
344
+ letter-spacing: 0em;
345
+ font-size: 16px;
346
+ text-align: left;
347
+ color: rgb(255, 255, 255);
348
+ text-transform: none;
349
+ padding-bottom: 0;
350
+ padding-top: 0;
351
+ mix-blend-mode: normal;
352
+ font-style: normal;
353
+ position: static;
354
+ }
355
+
356
+ #g-annotation4-xl .g-pstyle0 {
357
+ height: 16px;
358
+ }
359
+
360
+ /* Custom CSS */</style>
@@ -0,0 +1,26 @@
1
+ export default Annotation4;
2
+ type Annotation4 = SvelteComponent<{
3
+ [x: string]: never;
4
+ }, {
5
+ [evt: string]: CustomEvent<any>;
6
+ }, {}> & {
7
+ $$bindings?: string | undefined;
8
+ };
9
+ declare const Annotation4: $$__sveltets_2_IsomorphicComponent<{
10
+ [x: string]: never;
11
+ }, {
12
+ [evt: string]: CustomEvent<any>;
13
+ }, {}, {}, string>;
14
+ interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
15
+ new (options: import("svelte").ComponentConstructorOptions<Props>): import("svelte").SvelteComponent<Props, Events, Slots> & {
16
+ $$bindings?: Bindings;
17
+ } & Exports;
18
+ (internal: unknown, props: {
19
+ $$events?: Events;
20
+ $$slots?: Slots;
21
+ }): Exports & {
22
+ $set?: any;
23
+ $on?: any;
24
+ };
25
+ z_$$bindings?: Bindings;
26
+ }
@@ -0,0 +1,248 @@
1
+ import { type ScrollerVideoState } from './state.svelte';
2
+ interface ScrollerVideoArgs {
3
+ src: string;
4
+ scrollerVideoContainer: HTMLElement | string;
5
+ objectFit?: string;
6
+ sticky?: boolean;
7
+ full?: boolean;
8
+ trackScroll?: boolean;
9
+ lockScroll?: boolean;
10
+ transitionSpeed?: number;
11
+ frameThreshold?: number;
12
+ useWebCodecs?: boolean;
13
+ onReady?: () => void;
14
+ onChange?: (percentage?: number) => void;
15
+ debug?: boolean;
16
+ autoplay?: boolean;
17
+ setVideoPercentage?: (percentage: number, options?: TransitionOptions) => void;
18
+ resize?: () => void;
19
+ }
20
+ export interface TransitionOptions {
21
+ jump: boolean;
22
+ transitionSpeed?: number;
23
+ easing?: ((progress: number) => number) | null;
24
+ autoplay?: boolean;
25
+ }
26
+ /**
27
+ * ScrollerVideo class for scroll-driven or programmatic video playback with Svelte integration.
28
+ */
29
+ declare class ScrollerVideo {
30
+ /**
31
+ * The container element for the video or canvas.
32
+ * @type {HTMLElement | null}
33
+ */
34
+ container: HTMLElement | null;
35
+ /**
36
+ * The original container argument (element or string ID).
37
+ * @type {Element | string | undefined}
38
+ */
39
+ scrollerVideoContainer: Element | string | undefined;
40
+ /**
41
+ * Video source URL.
42
+ * @type {string}
43
+ */
44
+ src: string;
45
+ /**
46
+ * Speed of transitions.
47
+ * @type {number}
48
+ */
49
+ transitionSpeed: number;
50
+ /**
51
+ * Threshold for frame transitions.
52
+ * @type {number}
53
+ */
54
+ frameThreshold: number;
55
+ /**
56
+ * Whether to use WebCodecs for decoding.
57
+ * @type {boolean}
58
+ */
59
+ useWebCodecs: boolean;
60
+ /**
61
+ * CSS object-fit property for video/canvas.
62
+ * @type {string}
63
+ */
64
+ objectFit: string;
65
+ /**
66
+ * Whether to use sticky positioning.
67
+ * @type {boolean}
68
+ */
69
+ sticky: boolean;
70
+ /**
71
+ * Whether to track scroll position.
72
+ * @type {boolean}
73
+ */
74
+ trackScroll: boolean;
75
+ /**
76
+ * Callback when ready.
77
+ * @type {() => void}
78
+ */
79
+ onReady: () => void;
80
+ /**
81
+ * Callback on scroll percentage change.
82
+ * @type {(percentage?: number) => void}
83
+ */
84
+ onChange: (percentage?: number) => void;
85
+ /**
86
+ * Enable debug logging.
87
+ * @type {boolean}
88
+ */
89
+ debug: boolean;
90
+ /**
91
+ * Enable autoplay.
92
+ * @type {boolean}
93
+ */
94
+ autoplay: boolean;
95
+ /**
96
+ * The HTML video element.
97
+ * @type {HTMLVideoElement | undefined}
98
+ */
99
+ video: HTMLVideoElement | undefined;
100
+ /**
101
+ * Current scroll/video percentage (0-1).
102
+ * @type {number}
103
+ */
104
+ videoPercentage: number;
105
+ /**
106
+ * True if browser is Safari.
107
+ * @type {boolean}
108
+ */
109
+ isSafari: boolean;
110
+ /**
111
+ * Current video time in seconds.
112
+ * @type {number}
113
+ */
114
+ currentTime: number;
115
+ /**
116
+ * Target video time in seconds.
117
+ * @type {number}
118
+ */
119
+ targetTime: number;
120
+ /**
121
+ * Canvas for rendering frames (if using WebCodecs).
122
+ * @type {HTMLCanvasElement | null}
123
+ */
124
+ canvas: HTMLCanvasElement | null;
125
+ /**
126
+ * 2D context for the canvas.
127
+ * @type {CanvasRenderingContext2D | null}
128
+ */
129
+ context: CanvasRenderingContext2D | null;
130
+ /**
131
+ * Decoded video frames (if using WebCodecs).
132
+ * @type {ImageBitmap[] | null}
133
+ */
134
+ frames: ImageBitmap[] | null;
135
+ /**
136
+ * Video frame rate.
137
+ * @type {number}
138
+ */
139
+ frameRate: number;
140
+ /**
141
+ * Target scroll position in pixels, if set.
142
+ * @type {number | null}
143
+ */
144
+ targetScrollPosition: number | null;
145
+ /**
146
+ * Current frame index (if using WebCodecs).
147
+ * @type {number}
148
+ */
149
+ currentFrame: number;
150
+ /**
151
+ * True if using WebCodecs for decoding.
152
+ * @type {boolean}
153
+ */
154
+ usingWebCodecs: boolean;
155
+ /**
156
+ * Total video duration in seconds.
157
+ * @type {number}
158
+ */
159
+ totalTime: number;
160
+ /**
161
+ * RequestAnimationFrame ID for transitions.
162
+ * @type {number | null}
163
+ */
164
+ transitioningRaf: number | null;
165
+ /**
166
+ * State object for component-level state.
167
+ * @type {ScrollerVideoState}
168
+ */
169
+ componentState: ScrollerVideoState;
170
+ /**
171
+ * Function to update scroll percentage (set in constructor).
172
+ * @type {((jump: boolean) => void) | undefined}
173
+ */
174
+ updateScrollPercentage: ((jump: boolean) => void) | undefined;
175
+ /**
176
+ * Function to handle resize events (set in constructor).
177
+ * @type {(() => void) | undefined}
178
+ */
179
+ resize: (() => void) | undefined;
180
+ /**
181
+ * Creates a new ScrollerVideo instance.
182
+ * @param {ScrollerVideoArgs} args - The arguments for initialization.
183
+ */
184
+ constructor({ src, scrollerVideoContainer, objectFit, sticky, full, trackScroll, lockScroll, transitionSpeed, frameThreshold, useWebCodecs, onReady, onChange, debug, autoplay, }: ScrollerVideoArgs);
185
+ /**
186
+ * Sets the currentTime of the video as a specified percentage of its total duration.
187
+ *
188
+ * @param percentage - The percentage of the video duration to set as the current time.
189
+ * @param options - Configuration options for adjusting the video playback.
190
+ * - autoplay: boolean - If true, the video will start playing immediately after setting the percentage. Default is false.
191
+ * - jump: boolean - If true, the video currentTime will jump directly to the specified percentage. If false, the change will be animated over time.
192
+ * - transitionSpeed: number - Defines the speed of the transition when `jump` is false. Represents the duration of the transition in milliseconds. Default is 8.
193
+ * - easing: (progress: number) => number - A function that defines the easing curve for the transition. It takes the progress ratio (a number between 0 and 1) as an argument and returns the eased value, affecting the playback speed during the transition.
194
+ */
195
+ setVideoPercentage(percentage: number, options?: TransitionOptions): void;
196
+ /**
197
+ * Sets the style of the video or canvas to "cover" its container.
198
+ * @param {HTMLElement | HTMLCanvasElement | undefined} el - The element to style.
199
+ */
200
+ setCoverStyle(el: HTMLElement | HTMLCanvasElement | undefined): void;
201
+ /**
202
+ * Uses webCodecs to decode the video into frames.
203
+ * @returns {Promise<void>} Resolves when decoding is complete.
204
+ */
205
+ decodeVideo(): Promise<void>;
206
+ /**
207
+ * Paints the frame to the canvas.
208
+ * @param {number} frameNum - The frame index to paint.
209
+ */
210
+ paintCanvasFrame(frameNum: number): void;
211
+ /**
212
+ * Transitions the video or the canvas to the proper frame.
213
+ *
214
+ * @param options - Configuration options for adjusting the video playback.
215
+ * - jump: boolean - If true, the video currentTime will jump directly to the specified percentage. If false, the change will be animated over time.
216
+ * - transitionSpeed: number - Defines the speed of the transition when `jump` is false. Represents the duration of the transition in milliseconds. Default is 8.
217
+ * - easing: (progress: number) => number - A function that defines the easing curve for the transition. It takes the progress ratio (a number between 0 and 1) as an argument and returns the eased value, affecting the playback speed during the transition.
218
+ */
219
+ transitionToTargetTime({ jump, transitionSpeed, easing, }: TransitionOptions): void;
220
+ /**
221
+ * Sets the currentTime of the video as a specified percentage of its total duration.
222
+ *
223
+ * @param percentage - The percentage of the video duration to set as the current time.
224
+ * @param options - Configuration options for adjusting the video playback.
225
+ * - jump: boolean - If true, the video currentTime will jump directly to the specified percentage. If false, the change will be animated over time.
226
+ * - transitionSpeed: number - Defines the speed of the transition when `jump` is false. Represents the duration of the transition in milliseconds. Default is 8.
227
+ * - easing: (progress: number) => number - A function that defines the easing curve for the transition. It takes the progress ratio (a number between 0 and 1) as an argument and returns the eased value, affecting the playback speed during the transition.
228
+ */
229
+ setTargetTimePercent(percentage: number, options?: TransitionOptions): void;
230
+ /**
231
+ * Simulate trackScroll programmatically (scrolls on page by percentage of video).
232
+ * @param {number} percentage - The percentage of the video to scroll to.
233
+ */
234
+ setScrollPercent(percentage: number): void;
235
+ /**
236
+ * Call to destroy this ScrollerVideo object.
237
+ */
238
+ destroy(): void;
239
+ /**
240
+ * Autoplay the video by scrolling to the end.
241
+ */
242
+ autoplayScroll(): void;
243
+ /**
244
+ * Updates debug information in the component state.
245
+ */
246
+ updateDebugInfo(): void;
247
+ }
248
+ export default ScrollerVideo;