@micromag/viewer 0.4.86 → 0.4.88
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/es/index.js +125 -113
- package/package.json +10 -10
package/es/index.js
CHANGED
|
@@ -123,7 +123,7 @@ function checkClickable(el, options = {}, parentDistance = 1) {
|
|
|
123
123
|
}
|
|
124
124
|
|
|
125
125
|
function useScreenInteraction(t0) {
|
|
126
|
-
const $ = c(
|
|
126
|
+
const $ = c(29);
|
|
127
127
|
const {
|
|
128
128
|
screens,
|
|
129
129
|
screenIndex,
|
|
@@ -161,56 +161,75 @@ function useScreenInteraction(t0) {
|
|
|
161
161
|
id: screenId
|
|
162
162
|
} = t7;
|
|
163
163
|
const currentScreenInteractionEnabled = screenId ? screensInteractionEnabled[screenId] ?? true : true;
|
|
164
|
+
const screenIdRef = useRef(screenId);
|
|
164
165
|
let t8;
|
|
165
|
-
|
|
166
|
-
|
|
166
|
+
let t9;
|
|
167
|
+
if ($[5] !== screenId) {
|
|
168
|
+
t8 = () => {
|
|
169
|
+
screenIdRef.current = screenId;
|
|
170
|
+
};
|
|
171
|
+
t9 = [screenId];
|
|
172
|
+
$[5] = screenId;
|
|
173
|
+
$[6] = t8;
|
|
174
|
+
$[7] = t9;
|
|
175
|
+
} else {
|
|
176
|
+
t8 = $[6];
|
|
177
|
+
t9 = $[7];
|
|
178
|
+
}
|
|
179
|
+
useEffect(t8, t9);
|
|
180
|
+
let t10;
|
|
181
|
+
if ($[8] !== screens) {
|
|
182
|
+
t10 = newValue => {
|
|
167
183
|
setScreensInteractionEnabled(prev => {
|
|
168
|
-
const currentValue = prev?.[
|
|
184
|
+
const currentValue = prev?.[screenIdRef.current] ?? true;
|
|
169
185
|
if (currentValue === newValue) {
|
|
170
186
|
return prev;
|
|
171
187
|
}
|
|
172
|
-
return screens.reduce((map_0,
|
|
188
|
+
return screens.reduce((map_0, t11) => {
|
|
173
189
|
const {
|
|
174
190
|
id: id_0
|
|
175
|
-
} =
|
|
176
|
-
return
|
|
191
|
+
} = t11;
|
|
192
|
+
return screenIdRef.current === id_0 ? {
|
|
177
193
|
...map_0,
|
|
178
194
|
[id_0]: newValue
|
|
179
195
|
} : {
|
|
180
196
|
...map_0,
|
|
181
|
-
[id_0]:
|
|
197
|
+
[id_0]: prev?.[id_0] ?? true
|
|
182
198
|
};
|
|
183
199
|
}, {});
|
|
184
200
|
});
|
|
185
201
|
};
|
|
186
|
-
$[
|
|
187
|
-
$[
|
|
188
|
-
$[7] = t8;
|
|
189
|
-
} else {
|
|
190
|
-
t8 = $[7];
|
|
191
|
-
}
|
|
192
|
-
const updateInteraction = t8;
|
|
193
|
-
let t9;
|
|
194
|
-
if ($[8] !== updateInteraction) {
|
|
195
|
-
t9 = () => updateInteraction(true);
|
|
196
|
-
$[8] = updateInteraction;
|
|
197
|
-
$[9] = t9;
|
|
202
|
+
$[8] = screens;
|
|
203
|
+
$[9] = t10;
|
|
198
204
|
} else {
|
|
199
|
-
|
|
205
|
+
t10 = $[9];
|
|
200
206
|
}
|
|
201
|
-
const
|
|
202
|
-
let
|
|
207
|
+
const updateInteraction = t10;
|
|
208
|
+
let t11;
|
|
203
209
|
if ($[10] !== updateInteraction) {
|
|
204
|
-
|
|
210
|
+
t11 = () => {
|
|
211
|
+
updateInteraction(true);
|
|
212
|
+
};
|
|
205
213
|
$[10] = updateInteraction;
|
|
206
|
-
$[11] =
|
|
214
|
+
$[11] = t11;
|
|
207
215
|
} else {
|
|
208
|
-
|
|
216
|
+
t11 = $[11];
|
|
209
217
|
}
|
|
210
|
-
const
|
|
211
|
-
let
|
|
212
|
-
if ($[12] !==
|
|
213
|
-
|
|
218
|
+
const enableInteraction = t11;
|
|
219
|
+
let t12;
|
|
220
|
+
if ($[12] !== updateInteraction) {
|
|
221
|
+
t12 = () => {
|
|
222
|
+
updateInteraction(false);
|
|
223
|
+
};
|
|
224
|
+
$[12] = updateInteraction;
|
|
225
|
+
$[13] = t12;
|
|
226
|
+
} else {
|
|
227
|
+
t12 = $[13];
|
|
228
|
+
}
|
|
229
|
+
const disableInteraction = t12;
|
|
230
|
+
let t13;
|
|
231
|
+
if ($[14] !== clickOnSiblings || $[15] !== currentScreenInteractionEnabled || $[16] !== disableCurrentScreenNavigation || $[17] !== nextScreenWidthPercent || $[18] !== onInteract || $[19] !== onNavigate || $[20] !== screenIndex || $[21] !== screenWidth || $[22] !== screens.length) {
|
|
232
|
+
t13 = t14 => {
|
|
214
233
|
const {
|
|
215
234
|
event,
|
|
216
235
|
target,
|
|
@@ -218,7 +237,7 @@ function useScreenInteraction(t0) {
|
|
|
218
237
|
x,
|
|
219
238
|
y,
|
|
220
239
|
index
|
|
221
|
-
} =
|
|
240
|
+
} = t14;
|
|
222
241
|
if (onInteract !== null) {
|
|
223
242
|
onInteract({
|
|
224
243
|
event,
|
|
@@ -259,37 +278,37 @@ function useScreenInteraction(t0) {
|
|
|
259
278
|
});
|
|
260
279
|
}
|
|
261
280
|
};
|
|
262
|
-
$[
|
|
263
|
-
$[
|
|
264
|
-
$[
|
|
265
|
-
$[
|
|
266
|
-
$[
|
|
267
|
-
$[
|
|
268
|
-
$[
|
|
269
|
-
$[
|
|
270
|
-
$[
|
|
271
|
-
$[
|
|
272
|
-
} else {
|
|
273
|
-
|
|
274
|
-
}
|
|
275
|
-
const interact =
|
|
276
|
-
let
|
|
277
|
-
if ($[
|
|
278
|
-
|
|
281
|
+
$[14] = clickOnSiblings;
|
|
282
|
+
$[15] = currentScreenInteractionEnabled;
|
|
283
|
+
$[16] = disableCurrentScreenNavigation;
|
|
284
|
+
$[17] = nextScreenWidthPercent;
|
|
285
|
+
$[18] = onInteract;
|
|
286
|
+
$[19] = onNavigate;
|
|
287
|
+
$[20] = screenIndex;
|
|
288
|
+
$[21] = screenWidth;
|
|
289
|
+
$[22] = screens.length;
|
|
290
|
+
$[23] = t13;
|
|
291
|
+
} else {
|
|
292
|
+
t13 = $[23];
|
|
293
|
+
}
|
|
294
|
+
const interact = t13;
|
|
295
|
+
let t14;
|
|
296
|
+
if ($[24] !== currentScreenInteractionEnabled || $[25] !== disableInteraction || $[26] !== enableInteraction || $[27] !== interact) {
|
|
297
|
+
t14 = {
|
|
279
298
|
interact,
|
|
280
299
|
currentScreenInteractionEnabled,
|
|
281
300
|
enableInteraction,
|
|
282
301
|
disableInteraction
|
|
283
302
|
};
|
|
284
|
-
$[
|
|
285
|
-
$[
|
|
286
|
-
$[
|
|
287
|
-
$[
|
|
288
|
-
$[
|
|
303
|
+
$[24] = currentScreenInteractionEnabled;
|
|
304
|
+
$[25] = disableInteraction;
|
|
305
|
+
$[26] = enableInteraction;
|
|
306
|
+
$[27] = interact;
|
|
307
|
+
$[28] = t14;
|
|
289
308
|
} else {
|
|
290
|
-
|
|
309
|
+
t14 = $[28];
|
|
291
310
|
}
|
|
292
|
-
return
|
|
311
|
+
return t14;
|
|
293
312
|
}
|
|
294
313
|
function _temp$7(map, t0) {
|
|
295
314
|
const {
|
|
@@ -4965,7 +4984,7 @@ function PlaybackControls(t0) {
|
|
|
4965
4984
|
var styles = {"container":"micromag-viewer-partials-web-view-container","opened":"micromag-viewer-partials-web-view-opened","webView":"micromag-viewer-partials-web-view-webView"};
|
|
4966
4985
|
|
|
4967
4986
|
function WebViewContainer(t0) {
|
|
4968
|
-
const $ = c(
|
|
4987
|
+
const $ = c(51);
|
|
4969
4988
|
const {
|
|
4970
4989
|
onChange: t1,
|
|
4971
4990
|
trackingEnabled: t2,
|
|
@@ -5081,23 +5100,16 @@ function WebViewContainer(t0) {
|
|
|
5081
5100
|
t9 = $[17];
|
|
5082
5101
|
}
|
|
5083
5102
|
let t10;
|
|
5084
|
-
if ($[18] !==
|
|
5085
|
-
t10 = [opened
|
|
5086
|
-
$[18] =
|
|
5087
|
-
$[19] =
|
|
5088
|
-
$[20] = hideControls;
|
|
5089
|
-
$[21] = opened;
|
|
5090
|
-
$[22] = playing;
|
|
5091
|
-
$[23] = setPlaying;
|
|
5092
|
-
$[24] = showControls;
|
|
5093
|
-
$[25] = trackEvent;
|
|
5094
|
-
$[26] = t10;
|
|
5103
|
+
if ($[18] !== opened) {
|
|
5104
|
+
t10 = [opened];
|
|
5105
|
+
$[18] = opened;
|
|
5106
|
+
$[19] = t10;
|
|
5095
5107
|
} else {
|
|
5096
|
-
t10 = $[
|
|
5108
|
+
t10 = $[19];
|
|
5097
5109
|
}
|
|
5098
5110
|
useEffect(t9, t10);
|
|
5099
5111
|
let t11;
|
|
5100
|
-
if ($[
|
|
5112
|
+
if ($[20] !== currentUrl || $[21] !== opened || $[22] !== source || $[23] !== trackEvent || $[24] !== trackingEnabled) {
|
|
5101
5113
|
t11 = () => {
|
|
5102
5114
|
if (!trackingEnabled || currentUrl === null) {
|
|
5103
5115
|
return;
|
|
@@ -5106,42 +5118,42 @@ function WebViewContainer(t0) {
|
|
|
5106
5118
|
source
|
|
5107
5119
|
});
|
|
5108
5120
|
};
|
|
5109
|
-
$[
|
|
5110
|
-
$[
|
|
5111
|
-
$[
|
|
5112
|
-
$[
|
|
5113
|
-
$[
|
|
5114
|
-
$[
|
|
5121
|
+
$[20] = currentUrl;
|
|
5122
|
+
$[21] = opened;
|
|
5123
|
+
$[22] = source;
|
|
5124
|
+
$[23] = trackEvent;
|
|
5125
|
+
$[24] = trackingEnabled;
|
|
5126
|
+
$[25] = t11;
|
|
5115
5127
|
} else {
|
|
5116
|
-
t11 = $[
|
|
5128
|
+
t11 = $[25];
|
|
5117
5129
|
}
|
|
5118
5130
|
let t12;
|
|
5119
|
-
if ($[
|
|
5131
|
+
if ($[26] !== currentUrl || $[27] !== opened || $[28] !== trackingEnabled) {
|
|
5120
5132
|
t12 = [trackingEnabled, currentUrl, opened];
|
|
5121
|
-
$[
|
|
5122
|
-
$[
|
|
5123
|
-
$[
|
|
5124
|
-
$[
|
|
5133
|
+
$[26] = currentUrl;
|
|
5134
|
+
$[27] = opened;
|
|
5135
|
+
$[28] = trackingEnabled;
|
|
5136
|
+
$[29] = t12;
|
|
5125
5137
|
} else {
|
|
5126
|
-
t12 = $[
|
|
5138
|
+
t12 = $[29];
|
|
5127
5139
|
}
|
|
5128
5140
|
useEffect(t11, t12);
|
|
5129
5141
|
let t13;
|
|
5130
|
-
if ($[
|
|
5142
|
+
if ($[30] !== close) {
|
|
5131
5143
|
t13 = {
|
|
5132
5144
|
escape: () => {
|
|
5133
5145
|
close();
|
|
5134
5146
|
}
|
|
5135
5147
|
};
|
|
5136
|
-
$[
|
|
5137
|
-
$[
|
|
5148
|
+
$[30] = close;
|
|
5149
|
+
$[31] = t13;
|
|
5138
5150
|
} else {
|
|
5139
|
-
t13 = $[
|
|
5151
|
+
t13 = $[31];
|
|
5140
5152
|
}
|
|
5141
5153
|
useKeyboardShortcuts(t13);
|
|
5142
5154
|
const webViewUrl = url || currentUrl;
|
|
5143
5155
|
let t14;
|
|
5144
|
-
if ($[
|
|
5156
|
+
if ($[32] !== source || $[33] !== storyTitle || $[34] !== url || $[35] !== webViewUrl) {
|
|
5145
5157
|
const currentQueryString = queryString.parse(webViewUrl !== null && webViewUrl.indexOf("?") !== -1 ? webViewUrl.split("?")[1] : "");
|
|
5146
5158
|
t14 = webViewUrl !== null ? `${webViewUrl.split("?")[0]}?${queryString.stringify({
|
|
5147
5159
|
utm_source: "Micromag",
|
|
@@ -5149,28 +5161,28 @@ function WebViewContainer(t0) {
|
|
|
5149
5161
|
utm_campaign: storyTitle,
|
|
5150
5162
|
...currentQueryString
|
|
5151
5163
|
})}` : url;
|
|
5152
|
-
$[
|
|
5153
|
-
$[
|
|
5154
|
-
$[
|
|
5155
|
-
$[
|
|
5156
|
-
$[
|
|
5164
|
+
$[32] = source;
|
|
5165
|
+
$[33] = storyTitle;
|
|
5166
|
+
$[34] = url;
|
|
5167
|
+
$[35] = webViewUrl;
|
|
5168
|
+
$[36] = t14;
|
|
5157
5169
|
} else {
|
|
5158
|
-
t14 = $[
|
|
5170
|
+
t14 = $[36];
|
|
5159
5171
|
}
|
|
5160
5172
|
const finalUrl = t14;
|
|
5161
5173
|
let t15;
|
|
5162
|
-
if ($[
|
|
5174
|
+
if ($[37] !== className || $[38] !== opened) {
|
|
5163
5175
|
t15 = classNames([styles.container, className, {
|
|
5164
5176
|
[styles.opened]: opened
|
|
5165
5177
|
}]);
|
|
5166
|
-
$[
|
|
5167
|
-
$[
|
|
5168
|
-
$[
|
|
5178
|
+
$[37] = className;
|
|
5179
|
+
$[38] = opened;
|
|
5180
|
+
$[39] = t15;
|
|
5169
5181
|
} else {
|
|
5170
|
-
t15 = $[
|
|
5182
|
+
t15 = $[39];
|
|
5171
5183
|
}
|
|
5172
5184
|
let t16;
|
|
5173
|
-
if ($[
|
|
5185
|
+
if ($[40] !== close || $[41] !== finalUrl || $[42] !== opened || $[43] !== source || $[44] !== webViewProps) {
|
|
5174
5186
|
t16 = /*#__PURE__*/jsx(WebView, {
|
|
5175
5187
|
url: finalUrl,
|
|
5176
5188
|
source: source,
|
|
@@ -5180,17 +5192,17 @@ function WebViewContainer(t0) {
|
|
|
5180
5192
|
className: styles.webView,
|
|
5181
5193
|
onClose: close
|
|
5182
5194
|
});
|
|
5183
|
-
$[
|
|
5184
|
-
$[
|
|
5185
|
-
$[
|
|
5186
|
-
$[
|
|
5187
|
-
$[
|
|
5188
|
-
$[
|
|
5195
|
+
$[40] = close;
|
|
5196
|
+
$[41] = finalUrl;
|
|
5197
|
+
$[42] = opened;
|
|
5198
|
+
$[43] = source;
|
|
5199
|
+
$[44] = webViewProps;
|
|
5200
|
+
$[45] = t16;
|
|
5189
5201
|
} else {
|
|
5190
|
-
t16 = $[
|
|
5202
|
+
t16 = $[45];
|
|
5191
5203
|
}
|
|
5192
5204
|
let t17;
|
|
5193
|
-
if ($[
|
|
5205
|
+
if ($[46] !== onTransitionEnd || $[47] !== style || $[48] !== t15 || $[49] !== t16) {
|
|
5194
5206
|
t17 = /*#__PURE__*/jsx("div", {
|
|
5195
5207
|
className: t15,
|
|
5196
5208
|
style: style,
|
|
@@ -5198,13 +5210,13 @@ function WebViewContainer(t0) {
|
|
|
5198
5210
|
ref: ref,
|
|
5199
5211
|
children: t16
|
|
5200
5212
|
});
|
|
5201
|
-
$[
|
|
5202
|
-
$[
|
|
5203
|
-
$[
|
|
5204
|
-
$[
|
|
5205
|
-
$[
|
|
5213
|
+
$[46] = onTransitionEnd;
|
|
5214
|
+
$[47] = style;
|
|
5215
|
+
$[48] = t15;
|
|
5216
|
+
$[49] = t16;
|
|
5217
|
+
$[50] = t17;
|
|
5206
5218
|
} else {
|
|
5207
|
-
t17 = $[
|
|
5219
|
+
t17 = $[50];
|
|
5208
5220
|
}
|
|
5209
5221
|
return t17;
|
|
5210
5222
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@micromag/viewer",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.88",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "",
|
|
6
6
|
"keywords": [
|
|
@@ -64,14 +64,14 @@
|
|
|
64
64
|
"dependencies": {
|
|
65
65
|
"@babel/runtime": "^7.28.6",
|
|
66
66
|
"@folklore/routes": "^0.4.4",
|
|
67
|
-
"@micromag/core": "^0.4.
|
|
68
|
-
"@micromag/element-badge": "^0.4.
|
|
69
|
-
"@micromag/element-scroll": "^0.4.
|
|
70
|
-
"@micromag/element-share-options": "^0.4.
|
|
71
|
-
"@micromag/element-webview": "^0.4.
|
|
72
|
-
"@micromag/elements": "^0.4.
|
|
73
|
-
"@micromag/intl": "^0.4.
|
|
74
|
-
"@micromag/screens": "^0.4.
|
|
67
|
+
"@micromag/core": "^0.4.88",
|
|
68
|
+
"@micromag/element-badge": "^0.4.88",
|
|
69
|
+
"@micromag/element-scroll": "^0.4.88",
|
|
70
|
+
"@micromag/element-share-options": "^0.4.88",
|
|
71
|
+
"@micromag/element-webview": "^0.4.88",
|
|
72
|
+
"@micromag/elements": "^0.4.88",
|
|
73
|
+
"@micromag/intl": "^0.4.88",
|
|
74
|
+
"@micromag/screens": "^0.4.88",
|
|
75
75
|
"@react-spring/core": "^10.0.3",
|
|
76
76
|
"@react-spring/web": "^10.0.3",
|
|
77
77
|
"@use-gesture/react": "^10.3.0",
|
|
@@ -90,6 +90,6 @@
|
|
|
90
90
|
"access": "public",
|
|
91
91
|
"registry": "https://registry.npmjs.org/"
|
|
92
92
|
},
|
|
93
|
-
"gitHead": "
|
|
93
|
+
"gitHead": "cf331286bb6037d61e664cd5c961955c136719c6",
|
|
94
94
|
"types": "es/index.d.ts"
|
|
95
95
|
}
|