@hkdigital/lib-sveltekit 0.1.19 → 0.1.20

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 (48) hide show
  1. package/dist/components/layout/index.d.ts +0 -4
  2. package/dist/components/layout/index.js +0 -10
  3. package/dist/components/rows/panel-grid-row/PanelGridRow.svelte.d.ts +2 -2
  4. package/dist/components/rows/panel-row-2/PanelRow2.svelte.d.ts +2 -2
  5. package/dist/themes/hkdev/theme-ext.js +1 -1
  6. package/dist/widgets/button-group/ButtonGroup.svelte +62 -0
  7. package/dist/widgets/button-group/ButtonGroup.svelte.d.ts +41 -0
  8. package/dist/{components/layout → widgets}/game-box/GameBox.svelte +1 -1
  9. package/dist/widgets/index.d.ts +9 -0
  10. package/dist/widgets/index.js +18 -0
  11. package/dist/widgets/presenter/ImageSlide.svelte +13 -0
  12. package/dist/widgets/presenter/ImageSlide.svelte.d.ts +6 -0
  13. package/dist/widgets/presenter/Presenter.state.svelte.d.ts +83 -0
  14. package/dist/widgets/presenter/Presenter.state.svelte.js +530 -0
  15. package/dist/widgets/presenter/Presenter.svelte +125 -0
  16. package/dist/widgets/presenter/Presenter.svelte.d.ts +20 -0
  17. package/dist/widgets/presenter/constants.d.ts +3 -0
  18. package/dist/widgets/presenter/constants.js +4 -0
  19. package/dist/widgets/presenter/index.d.ts +6 -0
  20. package/dist/widgets/presenter/index.js +15 -0
  21. package/dist/widgets/presenter/typedef.d.ts +58 -0
  22. package/dist/widgets/presenter/typedef.js +75 -0
  23. package/dist/widgets/presenter/util.d.ts +56 -0
  24. package/dist/widgets/presenter/util.js +188 -0
  25. package/dist/{components/layout → widgets}/virtual-viewport/VirtualViewport.svelte +1 -1
  26. package/package.json +1 -1
  27. package/dist/components/widgets/scale-control/ScaleControl.svelte +0 -0
  28. package/dist/components/widgets/scale-control/ScaleControl.svelte.d.ts +0 -26
  29. package/dist/components/widgets/scale-control/index.d.ts +0 -1
  30. package/dist/components/widgets/scale-control/index.js +0 -1
  31. /package/dist/{components/widgets → widgets}/compare-left-right/CompareLeftRight.svelte +0 -0
  32. /package/dist/{components/widgets → widgets}/compare-left-right/CompareLeftRight.svelte.d.ts +0 -0
  33. /package/dist/{components/widgets → widgets}/compare-left-right/index.d.ts +0 -0
  34. /package/dist/{components/widgets → widgets}/compare-left-right/index.js +0 -0
  35. /package/dist/{components/layout → widgets}/game-box/GameBox.svelte.d.ts +0 -0
  36. /package/dist/{components/layout → widgets}/game-box/gamebox.util.d.ts +0 -0
  37. /package/dist/{components/layout → widgets}/game-box/gamebox.util.js +0 -0
  38. /package/dist/{components/layout → widgets/hk-app-layout}/HkAppLayout.state.svelte.d.ts +0 -0
  39. /package/dist/{components/layout → widgets/hk-app-layout}/HkAppLayout.state.svelte.js +0 -0
  40. /package/dist/{components/layout → widgets/hk-app-layout}/HkAppLayout.svelte +0 -0
  41. /package/dist/{components/layout → widgets/hk-app-layout}/HkAppLayout.svelte.d.ts +0 -0
  42. /package/dist/{components/image → widgets/image-box}/ImageBox.svelte +0 -0
  43. /package/dist/{components/image → widgets/image-box}/ImageBox.svelte.d.ts +0 -0
  44. /package/dist/{components/image → widgets/image-box}/index.d.ts +0 -0
  45. /package/dist/{components/image → widgets/image-box}/index.js +0 -0
  46. /package/dist/{components/image → widgets/image-box}/typedef.d.ts +0 -0
  47. /package/dist/{components/image → widgets/image-box}/typedef.js +0 -0
  48. /package/dist/{components/layout → widgets}/virtual-viewport/VirtualViewport.svelte.d.ts +0 -0
@@ -0,0 +1,530 @@
1
+ import { defineStateContext } from '../../util/svelte/state-context/index.js';
2
+
3
+ import { findFirst } from '../../util/array/index.js';
4
+
5
+ import { untrack } from 'svelte';
6
+
7
+ import { HkPromise } from '../../classes/promise/index.js';
8
+
9
+ /* ----------------------------------------------------------------- typedefs */
10
+
11
+ /**
12
+ * @typedef {import("./typedef").Slide} Slide
13
+ */
14
+
15
+ /**
16
+ * @typedef {import("./typedef").Transition} Transition
17
+ */
18
+
19
+ /**
20
+ * @typedef {import("./typedef").Layer} Layer
21
+ */
22
+
23
+ /**
24
+ * @typedef {Object} LoadController
25
+ * @property {() => void} loaded - Function to call when loading is complete
26
+ * @property {() => void} cancel - Function to return to the previous slide
27
+ */
28
+
29
+ /* -------------------------------------------------------------- Constants */
30
+
31
+ const Z_BACK = 0;
32
+ const Z_FRONT = 10;
33
+
34
+ const LABEL_A = 'A';
35
+ const LABEL_B = 'B';
36
+
37
+ /* ------------------------------------------------------- Define state class */
38
+
39
+ export class PresenterState {
40
+ /** @type {Slide[]} */
41
+ slides = $state.raw([]);
42
+
43
+ /** @type {Layer} */
44
+ layerA = $state.raw({ z: Z_BACK, visible: false, stageIdle: true });
45
+
46
+ /** @type {Layer} */
47
+ layerB = $state.raw({ z: Z_FRONT, visible: false, stageIdle: true });
48
+
49
+ /** @type {Slide|null} */
50
+ slideA = $state.raw(null);
51
+
52
+ /** @type {Slide|null} */
53
+ slideB = $state.raw(null);
54
+
55
+ /** @type {string} */
56
+ currentLayerLabel = $state(LABEL_B);
57
+
58
+ /** @type {string} */
59
+ nextLayerLabel = $state(LABEL_A);
60
+
61
+ /** @type {HkPromise[]} */
62
+ transitionPromises = $state.raw([]);
63
+
64
+ /** @type {boolean} */
65
+ isSlideLoading = $state(false);
66
+
67
+ /** @type {boolean} */
68
+ controllerRequested = $state(false);
69
+
70
+ /** @type {number} Loading timeout in milliseconds (0 = disabled) */
71
+ loadingTimeout = $state(1000);
72
+
73
+ /** @type {boolean} */
74
+ busy = $derived.by(() => {
75
+ const { layerA, layerB } = this;
76
+ const layerAStable =
77
+ layerA.stageShow || layerA.stageAfter || layerA.stageIdle;
78
+ const layerBStable =
79
+ layerB.stageShow || layerB.stageAfter || layerB.stageIdle;
80
+
81
+ return !(layerAStable && layerBStable);
82
+ });
83
+
84
+ /** @type {string} */
85
+ currentSlideName = $derived.by(() => {
86
+ const currentSlide = this.#getSlide(this.currentLayerLabel);
87
+ return currentSlide?.name || '';
88
+ });
89
+
90
+ /**
91
+ * Initialize the presenter state and set up reactivity
92
+ */
93
+ constructor() {
94
+ this.#setupStageTransitions();
95
+ this.#setupTransitionTracking();
96
+ this.#setupLoadingTransitions();
97
+ }
98
+
99
+ /**
100
+ * Set up reactivity for stage transitions between the before/after states
101
+ * This handles the animation timing for both layers
102
+ */
103
+ #setupStageTransitions() {
104
+ // Handle layer A stage transitions
105
+ $effect(() => {
106
+ if (this.layerA.stageBeforeIn || this.layerA.stageBeforeOut) {
107
+ this.layerA = this.#processStageTransition(this.layerA);
108
+ }
109
+ });
110
+
111
+ // Handle layer B stage transitions
112
+ $effect(() => {
113
+ if (this.layerB.stageBeforeIn || this.layerB.stageBeforeOut) {
114
+ this.layerB = this.#processStageTransition(this.layerB);
115
+ }
116
+ });
117
+ }
118
+
119
+ /**
120
+ * Process a single stage transition for a layer
121
+ *
122
+ * @param {Layer} layer - The layer to process
123
+ * @returns {Layer} - The updated layer with new stage
124
+ */
125
+ #processStageTransition(layer) {
126
+ const updatedLayer = { ...layer };
127
+
128
+ if (updatedLayer.stageBeforeIn) {
129
+ delete updatedLayer.stageBeforeIn;
130
+ updatedLayer.stageIn = true;
131
+ } else if (updatedLayer.stageBeforeOut) {
132
+ delete updatedLayer.stageBeforeOut;
133
+ updatedLayer.stageOut = true;
134
+ }
135
+
136
+ return updatedLayer;
137
+ }
138
+
139
+ /**
140
+ * Set up reactivity for tracking transition promises
141
+ * This handles the completion of animations and layer swapping
142
+ */
143
+ #setupTransitionTracking() {
144
+ $effect(() => {
145
+ const promises = this.transitionPromises;
146
+
147
+ if (promises.length > 0) {
148
+ const nextSlide = this.#getSlide(this.nextLayerLabel);
149
+
150
+ if (!nextSlide) {
151
+ return;
152
+ }
153
+
154
+ untrack(() => {
155
+ this.#executeTransition(promises);
156
+ });
157
+ }
158
+ });
159
+ }
160
+
161
+ /**
162
+ * Set up reactivity to start transitions after component loading is complete
163
+ */
164
+ #setupLoadingTransitions() {
165
+ $effect(() => {
166
+ // Only start transitions when loading is complete and we have a next slide
167
+ if (!this.isSlideLoading && this.#getSlide(this.nextLayerLabel)) {
168
+ const currentSlide = this.#getSlide(this.currentLayerLabel);
169
+ const nextSlide = this.#getSlide(this.nextLayerLabel);
170
+
171
+ // Prepare the next layer for its entrance transition
172
+ this.#updateLayer(this.nextLayerLabel, {
173
+ z: Z_FRONT,
174
+ visible: true,
175
+ stageBeforeIn: true,
176
+ transitions: nextSlide?.intro ?? []
177
+ });
178
+
179
+ // Prepare the current layer for its exit transition
180
+ this.#updateLayer(this.currentLayerLabel, {
181
+ z: Z_BACK,
182
+ visible: true,
183
+ stageBeforeOut: true,
184
+ transitions: currentSlide?.outro ?? []
185
+ });
186
+
187
+ // Start transitions
188
+ this.#applyTransitions();
189
+ }
190
+ });
191
+ }
192
+
193
+ /**
194
+ * Execute the transition by waiting for all promises and then
195
+ * completing the transition
196
+ *
197
+ * @param {HkPromise[]} promises - Array of transition promises to wait for
198
+ */
199
+ async #executeTransition(promises) {
200
+ try {
201
+ await Promise.allSettled(promises);
202
+
203
+ untrack(() => {
204
+ this.#completeTransition();
205
+ });
206
+ } catch (error) {
207
+ console.log('transition promises cancelled', error);
208
+ }
209
+ }
210
+
211
+ /**
212
+ * Complete the transition by updating layers and swapping them
213
+ */
214
+ #completeTransition() {
215
+ // Hide current layer and set stage to AFTER
216
+ this.#updateLayer(this.currentLayerLabel, {
217
+ z: Z_BACK,
218
+ visible: false,
219
+ stageAfter: true
220
+ });
221
+
222
+ // Set next layer stage to SHOW
223
+ this.#updateLayer(this.nextLayerLabel, {
224
+ z: Z_FRONT,
225
+ visible: true,
226
+ stageShow: true
227
+ });
228
+
229
+ // Remove slide from current layer
230
+ this.#updateSlide(this.currentLayerLabel, null);
231
+
232
+ // Swap current and next layer labels
233
+ this.#swapLayers();
234
+ }
235
+
236
+ /**
237
+ * Swap the current and next layer labels
238
+ */
239
+ #swapLayers() {
240
+ if (this.currentLayerLabel === LABEL_A) {
241
+ this.currentLayerLabel = LABEL_B;
242
+ this.nextLayerLabel = LABEL_A;
243
+ } else {
244
+ this.currentLayerLabel = LABEL_A;
245
+ this.nextLayerLabel = LABEL_B;
246
+ }
247
+ }
248
+
249
+ /**
250
+ * Mark the slide as loaded, which triggers transitions to begin
251
+ */
252
+ finishSlideLoading() {
253
+ this.isSlideLoading = false;
254
+ }
255
+
256
+ /**
257
+ * Returns a controller object for managing manual loading
258
+ * Components can use this to signal when they're done loading
259
+ * or to cancel and go back to the previous slide
260
+ *
261
+ * @returns {LoadController} Object with loaded() and cancel() methods
262
+ */
263
+ getLoadingController() {
264
+ // Mark that the controller was requested
265
+ this.controllerRequested = true;
266
+
267
+ return {
268
+ /**
269
+ * Call when component has finished loading
270
+ */
271
+ loaded: () => {
272
+ this.finishSlideLoading();
273
+ },
274
+
275
+ /**
276
+ * Call to cancel loading and return to previous slide
277
+ */
278
+ cancel: () => {
279
+ // Return to previous slide if available
280
+ const currentSlideName = this.currentSlideName;
281
+ if (currentSlideName) {
282
+ this.gotoSlide(currentSlideName);
283
+ } else if (this.slides.length > 0) {
284
+ // Fallback to first slide if no current slide
285
+ this.gotoSlide(this.slides[0].name);
286
+ }
287
+ }
288
+ };
289
+ }
290
+
291
+ /**
292
+ * Configure the presentation
293
+ *
294
+ * @param {object} _
295
+ * @param {boolean} [_.autostart=false] - Whether to start automatically
296
+ * @param {string} [_.startSlide] - Name of the slide to start with
297
+ * @param {Slide[]} [_.slides] - Array of slides for the presentation
298
+ */
299
+ configure({ slides, autostart = true, startSlide }) {
300
+ untrack(() => {
301
+ if (slides) {
302
+ // Only update slides if provided
303
+ this.slides = slides;
304
+ }
305
+
306
+ if ((autostart || startSlide) && this.slides?.length) {
307
+ if (startSlide) {
308
+ this.gotoSlide(startSlide);
309
+ } else {
310
+ this.#gotoSlide(this.slides[0]);
311
+ }
312
+ }
313
+ });
314
+ }
315
+
316
+ /**
317
+ * Configure the presentation slides
318
+ *
319
+ * @param {Slide[]} slides - Array of slides for the presentation
320
+ */
321
+ configureSlides(slides) {
322
+ this.slides = slides ?? [];
323
+ }
324
+
325
+ /**
326
+ * Transition to another slide by name
327
+ *
328
+ * @param {string} name - Name of the slide to transition to
329
+ */
330
+ async gotoSlide(name) {
331
+ untrack(() => {
332
+ const slide = findFirst(this.slides, { name });
333
+
334
+ if (!slide) {
335
+ console.log('available slides', this.slides);
336
+ throw new Error(`Slide [${name}] has not been defined`);
337
+ }
338
+
339
+ this.#gotoSlide(slide);
340
+ });
341
+ }
342
+
343
+ /**
344
+ * Internal method to transition to another slide
345
+ *
346
+ * @param {Slide} slide - The slide to transition to
347
+ */
348
+ async #gotoSlide(slide) {
349
+ if (this.busy) {
350
+ throw new Error('Transition in progress');
351
+ }
352
+
353
+ // Reset controller requested flag
354
+ this.controllerRequested = false;
355
+
356
+ // Set loading state to true before starting transition
357
+ this.isSlideLoading = true;
358
+
359
+ // Add controller function to slide props if it has a component
360
+ if (slide.data?.component) {
361
+ // Create a copy of the slide to avoid mutating the original
362
+ const slideWithController = {
363
+ ...slide,
364
+ data: {
365
+ ...slide.data,
366
+ props: {
367
+ ...(slide.data.props || {}),
368
+ getLoadingController: () => this.getLoadingController()
369
+ }
370
+ }
371
+ };
372
+
373
+ // Add next slide to next layer with controller included
374
+ this.#updateSlide(this.nextLayerLabel, slideWithController);
375
+
376
+ // If a timeout is configured, automatically finish loading after delay
377
+ if (this.loadingTimeout > 0) {
378
+ setTimeout(() => {
379
+ // Only auto-finish if the controller wasn't requested
380
+ if (!this.controllerRequested && this.isSlideLoading) {
381
+ // console.log(
382
+ // `Slide '${slide.name}' didn't request loading controller, auto-finishing.`
383
+ // );
384
+ this.finishSlideLoading();
385
+ }
386
+ }, this.loadingTimeout);
387
+ }
388
+ } else {
389
+ // No component, so just use the slide as is
390
+ this.#updateSlide(this.nextLayerLabel, slide);
391
+ // No component to load, so finish loading immediately
392
+ this.finishSlideLoading();
393
+ }
394
+
395
+ // Make next layer visible, move to front
396
+ this.#updateLayer(this.nextLayerLabel, {
397
+ z: Z_FRONT,
398
+ visible: true
399
+ });
400
+ }
401
+
402
+ /**
403
+ * Apply transitions between current and next slide
404
+ */
405
+ #applyTransitions() {
406
+ // Cancel existing transitions
407
+ let transitionPromises = this.transitionPromises;
408
+
409
+ for (const current of transitionPromises) {
410
+ current.tryCancel();
411
+ }
412
+
413
+ // Start new transitions
414
+ transitionPromises = [];
415
+
416
+ const currentSlide = this.#getSlide(this.currentLayerLabel);
417
+ const nextSlide = this.#getSlide(this.nextLayerLabel);
418
+
419
+ // Apply transitions `out` from currentslide
420
+ const transitionsOut = currentSlide?.outro;
421
+
422
+ if (transitionsOut) {
423
+ for (const transition of transitionsOut) {
424
+ const promise = this.#applyTransition(transition);
425
+ transitionPromises.push(promise);
426
+ }
427
+ }
428
+
429
+ // Apply transitions `in` from next slide
430
+ const transitionsIn = nextSlide?.intro;
431
+
432
+ if (transitionsIn) {
433
+ for (const transition of transitionsIn) {
434
+ const promise = this.#applyTransition(transition);
435
+ transitionPromises.push(promise);
436
+ }
437
+ }
438
+
439
+ this.transitionPromises = transitionPromises;
440
+ }
441
+
442
+ /**
443
+ * Apply a transition and return a transition promise
444
+ *
445
+ * @param {Transition} transition - The transition to apply
446
+ * @returns {HkPromise} Promise that resolves when transition completes
447
+ */
448
+ #applyTransition(transition) {
449
+ const delay = (transition.delay ?? 0) + (transition.duration ?? 0);
450
+
451
+ if (0 === delay) {
452
+ const promise = new HkPromise(() => {});
453
+ promise.resolve(true);
454
+ return promise;
455
+ }
456
+
457
+ let promise = new HkPromise((/** @type {function} */ resolve) => {
458
+ if (delay) {
459
+ setTimeout(() => {
460
+ resolve(true);
461
+ }, delay);
462
+ }
463
+ });
464
+
465
+ return promise;
466
+ }
467
+
468
+ /**
469
+ * Get slide by layer label
470
+ *
471
+ * @param {string} label - Layer label (A or B)
472
+ * @returns {Slide|null} The slide for the specified layer or null
473
+ */
474
+ #getSlide(label) {
475
+ if (label === LABEL_A) {
476
+ return this.slideA;
477
+ }
478
+
479
+ if (label === LABEL_B) {
480
+ return this.slideB;
481
+ }
482
+
483
+ return null;
484
+ }
485
+
486
+ /**
487
+ * Update layer by label
488
+ *
489
+ * @param {string} label - Layer label (A or B)
490
+ * @param {Layer} data - Layer data to update
491
+ */
492
+ #updateLayer(label, data) {
493
+ if (label === LABEL_A) {
494
+ this.layerA = data;
495
+ return;
496
+ }
497
+
498
+ if (label === LABEL_B) {
499
+ this.layerB = data;
500
+ return;
501
+ }
502
+
503
+ throw new Error(`Missing layer [${label}]`);
504
+ }
505
+
506
+ /**
507
+ * Update slide by label
508
+ *
509
+ * @param {string} label - Layer label (A or B)
510
+ * @param {Slide|null} data - Slide data to update or null to clear
511
+ */
512
+ #updateSlide(label, data) {
513
+ if (label === LABEL_A) {
514
+ this.slideA = data;
515
+ return;
516
+ }
517
+
518
+ if (label === LABEL_B) {
519
+ this.slideB = data;
520
+ return;
521
+ }
522
+
523
+ throw new Error(`Missing slide [${label}]`);
524
+ }
525
+ }
526
+
527
+ /* -------------------------------------- Export create & get state functions */
528
+
529
+ export const [createOrGetState, createState, getState] =
530
+ defineStateContext(PresenterState);
@@ -0,0 +1,125 @@
1
+ <script>
2
+ /* ---------------------------------------------------------------- Imports */
3
+
4
+ import { GridLayers } from '../../components/layout/index.js';
5
+
6
+ import { createOrGetPresenterState } from './index.js';
7
+ import { cssBefore, cssDuring } from './util.js';
8
+
9
+ /* ------------------------------------------------------------------ Props */
10
+
11
+ /**
12
+ * @typedef {import("./typedef.js").Slide} Slide
13
+ */
14
+
15
+ /**
16
+ * @typedef {import("./typedef.js").Layer} Layer
17
+ */
18
+
19
+ /**
20
+ * @type {{
21
+ * classes?: string,
22
+ * slides?: import("./typedef.js").Slide[],
23
+ * autostart?: boolean,
24
+ * startSlide?: string,
25
+ * instanceKey?: Symbol | string,
26
+ * layoutSnippet: import('svelte').Snippet<[Slide|null, Layer]>
27
+ * }}
28
+ */
29
+ let {
30
+ // > Style
31
+ classes,
32
+
33
+ // > Functional
34
+ slides,
35
+ autostart = false,
36
+ startSlide,
37
+
38
+ // State
39
+ instanceKey,
40
+
41
+ // Snippets
42
+ layoutSnippet
43
+ } = $props();
44
+
45
+ /* ------------------------------------------------------------------ State */
46
+
47
+ const presenter = createOrGetPresenterState(instanceKey);
48
+
49
+ $effect.pre(() => {
50
+ // Configure presenter with slides if provided
51
+ presenter.configure({ slides, autostart, startSlide });
52
+ });
53
+
54
+ let classesA = $state('');
55
+ let classesB = $state('');
56
+
57
+ let stylesA = $state('');
58
+ let stylesB = $state('');
59
+
60
+ //> Apply stage classes and styles
61
+
62
+ $effect(() => {
63
+ // > layerA
64
+
65
+ const { stageBeforeIn, stageIn, stageBeforeOut, stageOut, transitions } =
66
+ presenter.layerA;
67
+
68
+ if (transitions && transitions.length) {
69
+ if (stageBeforeIn || stageBeforeOut) {
70
+ ({ style: stylesA, classes: classesA } = cssBefore(transitions));
71
+ } else if (stageIn || stageOut) {
72
+ setTimeout(() => {
73
+ ({ style: stylesA, classes: classesA } = cssDuring(transitions));
74
+ });
75
+ }
76
+ } else {
77
+ stylesA = '';
78
+ classesA = '';
79
+ }
80
+ });
81
+
82
+ $effect(() => {
83
+ // > layerB
84
+
85
+ const { stageBeforeIn, stageIn, stageBeforeOut, stageOut, transitions } =
86
+ presenter.layerB;
87
+
88
+ if (transitions) {
89
+ if (stageBeforeIn || stageBeforeOut) {
90
+ ({ style: stylesB, classes: classesB } = cssBefore(transitions));
91
+ } else if (stageIn || stageOut) {
92
+ setTimeout(() => {
93
+ ({ style: stylesB, classes: classesB } = cssDuring(transitions));
94
+ });
95
+ }
96
+ } else {
97
+ stylesB = '';
98
+ classesB = '';
99
+ }
100
+ });
101
+ </script>
102
+
103
+ <GridLayers data-component="presenter" {classes}>
104
+ <div
105
+ style:z-index={presenter.layerA.z}
106
+ style:visibility={presenter.layerA.visible ? 'visible' : 'hidden'}
107
+ inert={presenter.busy}
108
+ class="justify-self-stretch self-stretch overflow-hidden"
109
+ >
110
+ <div class={classesA} style={stylesA}>
111
+ {@render layoutSnippet(presenter.slideA, presenter.layerA)}
112
+ </div>
113
+ </div>
114
+
115
+ <div
116
+ style:z-index={presenter.layerB.z}
117
+ style:visibility={presenter.layerB.visible ? 'visible' : 'hidden'}
118
+ inert={presenter.busy}
119
+ class="justify-self-stretch self-stretch overflow-hidden"
120
+ >
121
+ <div class={classesB} style={stylesB}>
122
+ {@render layoutSnippet(presenter.slideB, presenter.layerB)}
123
+ </div>
124
+ </div>
125
+ </GridLayers>
@@ -0,0 +1,20 @@
1
+ export default Presenter;
2
+ type Presenter = {
3
+ $on?(type: string, callback: (e: any) => void): () => void;
4
+ $set?(props: Partial<{
5
+ classes?: string;
6
+ slides?: Slide[];
7
+ autostart?: boolean;
8
+ startSlide?: string;
9
+ instanceKey?: string | Symbol;
10
+ layoutSnippet: Snippet<[Slide, Layer]>;
11
+ }>): void;
12
+ };
13
+ declare const Presenter: import("svelte").Component<{
14
+ classes?: string;
15
+ slides?: import("./typedef.js").Slide[];
16
+ autostart?: boolean;
17
+ startSlide?: string;
18
+ instanceKey?: Symbol | string;
19
+ layoutSnippet: import("svelte").Snippet<[import("./typedef.js").Slide | null, import("./typedef.js").Layer]>;
20
+ }, {}, "">;
@@ -0,0 +1,3 @@
1
+ export const TRANSITION_CSS: "css";
2
+ export const FADE_IN: "fade-in";
3
+ export const FADE_OUT: "fade-out";
@@ -0,0 +1,4 @@
1
+ export const TRANSITION_CSS = 'css';
2
+
3
+ export const FADE_IN = 'fade-in';
4
+ export const FADE_OUT = 'fade-out';
@@ -0,0 +1,6 @@
1
+ export { default as Presenter } from "./Presenter.svelte";
2
+ export { default as ImageSlide } from "./ImageSlide.svelte";
3
+ export * from "./typedef.js";
4
+ export * from "./constants.js";
5
+ export * from "./util.js";
6
+ export { PresenterState, createOrGetState as createOrGetPresenterState, createState as createPresenterState, getState as getPresenterState } from "./Presenter.state.svelte.js";
@@ -0,0 +1,15 @@
1
+ export { default as Presenter } from './Presenter.svelte';
2
+ export { default as ImageSlide } from './ImageSlide.svelte';
3
+
4
+ export {
5
+ PresenterState,
6
+ createOrGetState as createOrGetPresenterState,
7
+ createState as createPresenterState,
8
+ getState as getPresenterState
9
+ } from './Presenter.state.svelte.js';
10
+
11
+ export * from './typedef.js';
12
+ export * from './constants.js';
13
+
14
+ // @ts-ignore
15
+ export * from './util.js';