@unlk/keymaster 1.3.6 → 1.3.8

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/js/video-modal.js CHANGED
@@ -17,7 +17,11 @@ const youTubeAPIInitPromise = new Promise((resolve) => {
17
17
  youTubeAPIReady = true;
18
18
  resolve();
19
19
  } else {
20
+ const prev = window.onYouTubeIframeAPIReady;
20
21
  window.onYouTubeIframeAPIReady = () => {
22
+ try {
23
+ if (typeof prev === 'function') prev();
24
+ } catch {}
21
25
  youTubeAPIReady = true;
22
26
  resolve();
23
27
  };
@@ -78,10 +82,15 @@ class VideoModal extends BaseComponent {
78
82
  if (this._vimeoUrl) {
79
83
  await vimeoAPIInitPromise;
80
84
  const vimeoId = this._getVimeoId(this._vimeoUrl);
85
+
81
86
  this._vimeoPlayer = new window.Vimeo.Player(this._container, {
82
87
  id: vimeoId,
83
88
  autoplay: true
84
89
  });
90
+
91
+ this._element.dataset.vimeoId = String(vimeoId);
92
+ this._element.__unlkVimeoPlayer = this._vimeoPlayer;
93
+
85
94
  return;
86
95
  }
87
96
 
@@ -89,10 +98,14 @@ class VideoModal extends BaseComponent {
89
98
  await youTubeAPIInitPromise;
90
99
  const youtubeId = this._getYouTubeId(this._youtubeSrc);
91
100
  const playerDiv = this._container.querySelector(`#${playerID}`);
101
+
92
102
  this._youtubePlayer = new window.YT.Player(playerDiv, {
93
103
  videoId: youtubeId,
94
104
  playerVars: { autoplay: 1, rel: 0 }
95
105
  });
106
+
107
+ this._element.dataset.ytId = youtubeId;
108
+ this._element.__unlkYtPlayer = this._youtubePlayer;
96
109
  }
97
110
  }
98
111
 
@@ -106,12 +119,15 @@ class VideoModal extends BaseComponent {
106
119
  this._youtubePlayer.destroy();
107
120
  this._youtubePlayer = null;
108
121
  }
122
+
123
+ delete this._element.__unlkYtPlayer;
124
+ delete this._element.dataset.ytId;
125
+ delete this._element.__unlkVimeoPlayer;
126
+ delete this._element.dataset.vimeoId;
109
127
  }
110
128
 
111
129
  _getYouTubeId(url) {
112
- const match = url.match(
113
- /(?:youtube\.com\/(?:watch\?v=|embed\/|v\/)|youtu\.be\/)([\w-]{11})/
114
- );
130
+ const match = url.match(/(?:youtube\.com\/(?:watch\?v=|embed\/|v\/)|youtu\.be\/)([\w-]{11})/);
115
131
  return match ? match[1] : '';
116
132
  }
117
133
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unlk/keymaster",
3
- "version": "1.3.6",
3
+ "version": "1.3.8",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -8,8 +8,6 @@
8
8
  &::before {
9
9
  position: absolute;
10
10
  inset: 0;
11
-
12
- /* polygon converted from your yellow <polygon> */
13
11
  clip-path:
14
12
  polygon(
15
13
  50% 47.36%,
@@ -20,15 +18,12 @@
20
18
  50% 47.36%
21
19
  );
22
20
  content: "";
23
-
24
21
  background: $sunglow;
25
22
  }
26
23
 
27
24
  &::after {
28
25
  position: absolute;
29
26
  inset: 0;
30
-
31
- /* polygon converted from your blue <polygon> */
32
27
  clip-path:
33
28
  polygon(
34
29
  72.28% 0%,
@@ -40,7 +35,6 @@
40
35
  72.28% 0%
41
36
  );
42
37
  content: "";
43
-
44
38
  background: $electric;
45
39
  }
46
40
  }
@@ -448,3 +448,7 @@ $pagination-hover-color: $body-color !default;
448
448
  $pagination-hover-bg: var(--#{$prefix}secondary) !default;
449
449
  $pagination-active-color: $body-color !default;
450
450
  $pagination-active-bg: var(--#{$prefix}secondary) !default;
451
+
452
+ // Form Range
453
+ $form-range-thumb-width: 1.25rem !default;
454
+ $form-range-thumb-height: 1.25rem !default;
@@ -1,2 +1,2 @@
1
1
  // GENERATED FILE – do not edit manually
2
- $km-version: "1.3.6" !default;
2
+ $km-version: "1.3.8" !default;