@shower/core 3.5.1 → 3.5.2

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.
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Core for Shower HTML presentation engine
3
- * @shower/core v3.5.0, https://github.com/shower/shower/tree/main/packages/core
3
+ * @shower/core v3.5.2, https://github.com/shower/shower/tree/main/packages/core
4
4
  * @copyright 2010–2026 Vadim Makeev, https://pepelsbey.dev
5
5
  * @license MIT
6
6
  */
@@ -350,7 +350,10 @@
350
350
  applyURLSlide();
351
351
  };
352
352
 
353
- applyURL();
353
+ // slide before mode, so full mode finds it instead of defaulting to first
354
+ applyURLSlide();
355
+ applyURLMode();
356
+
354
357
  window.addEventListener('popstate', applyURL);
355
358
 
356
359
  shower.addEventListener('start', () => {
@@ -661,11 +664,6 @@
661
664
  view(shower);
662
665
  touch(shower);
663
666
  mouse(shower);
664
-
665
- // maintains invariant: active slide always exists in `full` mode
666
- if (shower.isFullMode && !shower.activeSlide) {
667
- shower.first();
668
- }
669
667
  };
670
668
 
671
669
  class Shower extends EventTarget {
@@ -772,6 +770,10 @@
772
770
  * @emits Shower#modechange
773
771
  */
774
772
  enterFullMode() {
773
+ if (!this.activeSlide) {
774
+ this.first();
775
+ }
776
+
775
777
  this._setMode('full');
776
778
  }
777
779
 
@@ -22,9 +22,4 @@ export default (shower) => {
22
22
  view(shower);
23
23
  touch(shower);
24
24
  mouse(shower);
25
-
26
- // maintains invariant: active slide always exists in `full` mode
27
- if (shower.isFullMode && !shower.activeSlide) {
28
- shower.first();
29
- }
30
25
  };
@@ -33,7 +33,10 @@ export default (shower) => {
33
33
  applyURLSlide();
34
34
  };
35
35
 
36
- applyURL();
36
+ // slide before mode, so full mode finds it instead of defaulting to first
37
+ applyURLSlide();
38
+ applyURLMode();
39
+
37
40
  window.addEventListener('popstate', applyURL);
38
41
 
39
42
  shower.addEventListener('start', () => {
package/lib/shower.js CHANGED
@@ -107,6 +107,10 @@ class Shower extends EventTarget {
107
107
  * @emits Shower#modechange
108
108
  */
109
109
  enterFullMode() {
110
+ if (!this.activeSlide) {
111
+ this.first();
112
+ }
113
+
110
114
  this._setMode('full');
111
115
  }
112
116
 
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "type": "module",
3
3
  "name": "@shower/core",
4
4
  "description": "Core for Shower HTML presentation engine",
5
- "version": "3.5.1",
5
+ "version": "3.5.2",
6
6
  "publishConfig": {
7
7
  "access": "public"
8
8
  },