@getflip/swirl-components 0.173.3 → 0.174.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.
package/components.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "timestamp": "2024-03-21T12:26:41",
2
+ "timestamp": "2024-03-22T09:16:02",
3
3
  "compiler": {
4
4
  "name": "@stencil/core",
5
5
  "version": "3.3.1",
@@ -39210,6 +39210,15 @@
39210
39210
  }
39211
39211
  ],
39212
39212
  "events": [
39213
+ {
39214
+ "event": "appThemeUpdated",
39215
+ "detail": "void",
39216
+ "bubbles": true,
39217
+ "cancelable": true,
39218
+ "composed": true,
39219
+ "docs": "",
39220
+ "docsTags": []
39221
+ },
39213
39222
  {
39214
39223
  "event": "themeChange",
39215
39224
  "detail": "{ activeTheme: SwirlOSTheme; preferredTheme: SwirlOSTheme; }",
@@ -14,7 +14,6 @@ const SwirlLightbox = class {
14
14
  constructor(hostRef) {
15
15
  index.registerInstance(this, hostRef);
16
16
  this.dragging = false;
17
- this.mediaPlayers = [];
18
17
  this.onCloseButtonClick = () => {
19
18
  this.close();
20
19
  };
@@ -31,7 +30,6 @@ const SwirlLightbox = class {
31
30
  this.registerSlides = () => {
32
31
  this.slides = Array.from(this.el.children).filter((el) => el.tagName === "SWIRL-FILE-VIEWER");
33
32
  this.setSlideAttributes();
34
- this.updateMediaPlayers();
35
33
  };
36
34
  this.onPointerDown = (event) => {
37
35
  this.dragging = true;
@@ -186,7 +184,6 @@ const SwirlLightbox = class {
186
184
  });
187
185
  }, 300);
188
186
  this.stopAllMediaPlayers();
189
- this.updateMediaPlayers();
190
187
  this.resetImageZoom();
191
188
  }
192
189
  setSlideAttributes() {
@@ -217,12 +214,12 @@ const SwirlLightbox = class {
217
214
  unlockBodyScroll() {
218
215
  bodyScrollLock_esm.enableBodyScroll(this.el);
219
216
  }
220
- updateMediaPlayers() {
217
+ getMediaPlayers() {
221
218
  const mediaPlayers = utils.querySelectorAllDeep(this.el, "video");
222
- this.mediaPlayers = mediaPlayers;
219
+ return mediaPlayers;
223
220
  }
224
221
  stopAllMediaPlayers() {
225
- this.mediaPlayers.forEach((mediaPlayer) => mediaPlayer.pause());
222
+ this.getMediaPlayers().forEach((mediaPlayer) => mediaPlayer.pause());
226
223
  }
227
224
  resetImageZoom() {
228
225
  this.slides.forEach((slide) => {
@@ -10,6 +10,7 @@ const preferredThemeStorageKey = "swirl-preferred-theme";
10
10
  const SwirlThemeProvider = class {
11
11
  constructor(hostRef) {
12
12
  index.registerInstance(this, hostRef);
13
+ this.appThemeUpdated = index.createEvent(this, "appThemeUpdated", 7);
13
14
  this.themeChange = index.createEvent(this, "themeChange", 7);
14
15
  this.setDesignTokens = [];
15
16
  this.config = undefined;
@@ -105,6 +106,7 @@ const SwirlThemeProvider = class {
105
106
  this.recentOSThemeChangeEventData = themeChangeEventData;
106
107
  this.themeChange.emit(this.recentOSThemeChangeEventData);
107
108
  }
109
+ this.appThemeUpdated.emit();
108
110
  }
109
111
  updateTenantAssets() {
110
112
  const theme = this.resolvedConfig?.themes?.[this.appOSTheme];
@@ -6,7 +6,6 @@ import { querySelectorAllDeep } from "../../utils";
6
6
  export class SwirlLightbox {
7
7
  constructor() {
8
8
  this.dragging = false;
9
- this.mediaPlayers = [];
10
9
  this.onCloseButtonClick = () => {
11
10
  this.close();
12
11
  };
@@ -23,7 +22,6 @@ export class SwirlLightbox {
23
22
  this.registerSlides = () => {
24
23
  this.slides = Array.from(this.el.children).filter((el) => el.tagName === "SWIRL-FILE-VIEWER");
25
24
  this.setSlideAttributes();
26
- this.updateMediaPlayers();
27
25
  };
28
26
  this.onPointerDown = (event) => {
29
27
  this.dragging = true;
@@ -178,7 +176,6 @@ export class SwirlLightbox {
178
176
  });
179
177
  }, 300);
180
178
  this.stopAllMediaPlayers();
181
- this.updateMediaPlayers();
182
179
  this.resetImageZoom();
183
180
  }
184
181
  setSlideAttributes() {
@@ -209,12 +206,12 @@ export class SwirlLightbox {
209
206
  unlockBodyScroll() {
210
207
  enableBodyScroll(this.el);
211
208
  }
212
- updateMediaPlayers() {
209
+ getMediaPlayers() {
213
210
  const mediaPlayers = querySelectorAllDeep(this.el, "video");
214
- this.mediaPlayers = mediaPlayers;
211
+ return mediaPlayers;
215
212
  }
216
213
  stopAllMediaPlayers() {
217
- this.mediaPlayers.forEach((mediaPlayer) => mediaPlayer.pause());
214
+ this.getMediaPlayers().forEach((mediaPlayer) => mediaPlayer.pause());
218
215
  }
219
216
  resetImageZoom() {
220
217
  this.slides.forEach((slide) => {
@@ -96,6 +96,7 @@ export class SwirlThemeProvider {
96
96
  this.recentOSThemeChangeEventData = themeChangeEventData;
97
97
  this.themeChange.emit(this.recentOSThemeChangeEventData);
98
98
  }
99
+ this.appThemeUpdated.emit();
99
100
  }
100
101
  updateTenantAssets() {
101
102
  const theme = this.resolvedConfig?.themes?.[this.appOSTheme];
@@ -168,6 +169,21 @@ export class SwirlThemeProvider {
168
169
  }
169
170
  static get events() {
170
171
  return [{
172
+ "method": "appThemeUpdated",
173
+ "name": "appThemeUpdated",
174
+ "bubbles": true,
175
+ "cancelable": true,
176
+ "composed": true,
177
+ "docs": {
178
+ "tags": [],
179
+ "text": ""
180
+ },
181
+ "complexType": {
182
+ "original": "void",
183
+ "resolved": "void",
184
+ "references": {}
185
+ }
186
+ }, {
171
187
  "method": "themeChange",
172
188
  "name": "themeChange",
173
189
  "bubbles": true,