presently 0.24.1 → 0.25.1
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.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/lib/presently/version.rb +1 -1
- data/public/_components/@socketry/presently/Presently/SlideRendering.js +16 -1
- data/public/_static/index.css +4 -0
- data/public/application.js +1 -3
- data/public/playback.js +6 -1
- data.tar.gz.sig +0 -0
- metadata +1 -1
- metadata.gz.sig +2 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 0d45a9f85dc076cd8cb17996e84e0d75298a87ef7c8450d557371b3e680f546f
|
|
4
|
+
data.tar.gz: a59eeb936e87a39814699ea2fa08cad1706c0fe74f4a0b1b87a5946bdd4bb45a
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 2b562e56d739200c76ecb6028376a68f0f5c7a728c24c8547b583a28e73bf3f2ec4229caaf8d3db6b296cf3b93bba55b27f48a22bf8fc535eb00ecac25fb720e
|
|
7
|
+
data.tar.gz: 4b649beb7cac24750123ccc3eeaed62377d73326e4030e82c0a086a257a1dfce4d2d2d6be9e15005e1837d991cb675fc6a71f943e3c1ea89113d4edcfa75937a
|
checksums.yaml.gz.sig
CHANGED
|
Binary file
|
data/lib/presently/version.rb
CHANGED
|
@@ -17,9 +17,17 @@ export class SlideRendering {
|
|
|
17
17
|
#slides = [];
|
|
18
18
|
#disposed = false;
|
|
19
19
|
|
|
20
|
-
constructor(view, {transition = null} = {}) {
|
|
20
|
+
constructor(view, {transition = null, previous = null} = {}) {
|
|
21
21
|
this.#view = view;
|
|
22
22
|
this.#transitionName = transition;
|
|
23
|
+
|
|
24
|
+
if (previous) {
|
|
25
|
+
// Cancel stale rendering work immediately, but retain the visible slides
|
|
26
|
+
// until the browser has captured the outgoing transition snapshot.
|
|
27
|
+
this.#slides = previous.#slides;
|
|
28
|
+
previous.#slides = [];
|
|
29
|
+
previous.dispose();
|
|
30
|
+
}
|
|
23
31
|
}
|
|
24
32
|
|
|
25
33
|
// Initialize the slides already rendered within the view.
|
|
@@ -50,6 +58,9 @@ export class SlideRendering {
|
|
|
50
58
|
const render = async () => {
|
|
51
59
|
if (this.#disposed) return;
|
|
52
60
|
|
|
61
|
+
// View transitions invoke this callback after capturing the old state.
|
|
62
|
+
// Revert outgoing animations before updating potentially reused DOM nodes.
|
|
63
|
+
this.#disposeSlides();
|
|
53
64
|
update(this.#view);
|
|
54
65
|
initialized = await this.initialize();
|
|
55
66
|
};
|
|
@@ -108,6 +119,10 @@ export class SlideRendering {
|
|
|
108
119
|
delete document.documentElement.dataset.transition;
|
|
109
120
|
}
|
|
110
121
|
|
|
122
|
+
this.#disposeSlides();
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
#disposeSlides() {
|
|
111
126
|
this.#slides.forEach(slide => slide.dispose());
|
|
112
127
|
this.#slides = [];
|
|
113
128
|
}
|
data/public/_static/index.css
CHANGED
data/public/application.js
CHANGED
|
@@ -10,10 +10,8 @@ let live = null;
|
|
|
10
10
|
let activeRendering = null;
|
|
11
11
|
|
|
12
12
|
function activateRendering(view, {transition = null} = {}) {
|
|
13
|
-
const rendering = new SlideRendering(view, {transition});
|
|
14
|
-
const previousRendering = activeRendering;
|
|
13
|
+
const rendering = new SlideRendering(view, {transition, previous: activeRendering});
|
|
15
14
|
activeRendering = rendering;
|
|
16
|
-
previousRendering?.dispose();
|
|
17
15
|
|
|
18
16
|
return rendering;
|
|
19
17
|
}
|
data/public/playback.js
CHANGED
|
@@ -36,6 +36,10 @@ function stopCurrent() {
|
|
|
36
36
|
currentRendering?.dispose();
|
|
37
37
|
currentRendering = null;
|
|
38
38
|
|
|
39
|
+
stopAudio();
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
function stopAudio() {
|
|
39
43
|
if (currentAudio) {
|
|
40
44
|
currentAudio.pause();
|
|
41
45
|
currentAudio.removeEventListener('ended', handleEnded);
|
|
@@ -55,6 +59,7 @@ async function activateFrame(index, {transition = true} = {}) {
|
|
|
55
59
|
|
|
56
60
|
const rendering = new SlideRendering(frame, {
|
|
57
61
|
transition: transition ? slideTemplate.dataset.transition : null,
|
|
62
|
+
previous: currentRendering,
|
|
58
63
|
});
|
|
59
64
|
currentRendering = rendering;
|
|
60
65
|
|
|
@@ -70,7 +75,7 @@ async function show(index, {transition = true} = {}) {
|
|
|
70
75
|
if (transitioning || index < 0 || index >= slideTemplates.length) return false;
|
|
71
76
|
|
|
72
77
|
transitioning = true;
|
|
73
|
-
|
|
78
|
+
stopAudio();
|
|
74
79
|
|
|
75
80
|
try {
|
|
76
81
|
return await activateFrame(index, {transition});
|
data.tar.gz.sig
CHANGED
|
Binary file
|
metadata
CHANGED
metadata.gz.sig
CHANGED
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
��xܖ�y5�+-�3u�*B���=�ϲ�痦_�p��[F���RL;I��A�l����d���롊���C{���f�j_mS~��
|
|
1
|
+
4��繼=��h��R4-w4a�E�~9FOTuB��!xb1���u���Ι����y�)ҿ��a�)Ү�.���[Śb��K2��vE_�?�Rٝ�A�Q�6JV�]G8Wĩ��Zn�m��p�2���ݿ���#���o@3��n�t��&�*Z�#�˕d�G���'fZS$�Dc��}�N��1%� �'xJ��>�U��?TC���8�y[����r+U
|
|
2
|
+
�d�)??u�]���!��|����&��y@��]->[�?U���E�{*a�q�Uvp����s=_���
|
|
4
3
|
7St�ϫQ:��H�B�� M��8r\}�9Ҫ ��`e�w�
|