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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5d697262a722f7882d1d7b21809cdd51e1bb6475dd137f085e3e6fcd6a6f19f1
4
- data.tar.gz: f6f9cb865b7ba25161aafb1ec85cc665f88890b0845f8cd2e08f82ef89984cb6
3
+ metadata.gz: 0d45a9f85dc076cd8cb17996e84e0d75298a87ef7c8450d557371b3e680f546f
4
+ data.tar.gz: a59eeb936e87a39814699ea2fa08cad1706c0fe74f4a0b1b87a5946bdd4bb45a
5
5
  SHA512:
6
- metadata.gz: c1823bec93a21b7d361805c6e0f6f35512d5a91a524ef05a8837c9fbdac36091afacd689c311f2f664efb9f7f5c5dc02a3f27caa2cdfbcce6d5937d9ea0f2206
7
- data.tar.gz: efe1d9bc5bd918a498f7e395e466abdbcae60cc5896c8ac3c75b76fd952ca4b459b0479cb1c3df5618e3f4fc072eaa0c7db5e0376f82675a6951bcf8e2e94fe9
6
+ metadata.gz: 2b562e56d739200c76ecb6028376a68f0f5c7a728c24c8547b583a28e73bf3f2ec4229caaf8d3db6b296cf3b93bba55b27f48a22bf8fc535eb00ecac25fb720e
7
+ data.tar.gz: 4b649beb7cac24750123ccc3eeaed62377d73326e4030e82c0a086a257a1dfce4d2d2d6be9e15005e1837d991cb675fc6a71f943e3c1ea89113d4edcfa75937a
checksums.yaml.gz.sig CHANGED
Binary file
@@ -5,5 +5,5 @@
5
5
 
6
6
  # @namespace
7
7
  module Presently
8
- VERSION = "0.24.1"
8
+ VERSION = "0.25.1"
9
9
  end
@@ -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
  }
@@ -24,6 +24,10 @@ html, body {
24
24
  overflow: hidden;
25
25
  }
26
26
 
27
+ a {
28
+ color: var(--accent-light);
29
+ }
30
+
27
31
  /* ========================
28
32
  SHARED INTERFACE COMPONENTS
29
33
  ======================== */
@@ -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
- stopCurrent();
78
+ stopAudio();
74
79
 
75
80
  try {
76
81
  return await activateFrame(index, {transition});
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: presently
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.24.1
4
+ version: 0.25.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Williams
metadata.gz.sig CHANGED
@@ -1,3 +1,2 @@
1
- ���T���2�����YJ'`�n���<�L��M�iF~�p�ʬ�9�d�~�
2
- Y�6���r��P��9L@�y��<fnH�Qƍ5O-ˈ
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�