@micromag/viewer 0.3.346 → 0.3.347

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 CHANGED
@@ -200,8 +200,8 @@ function useScreenInteraction() {
200
200
 
201
201
  var styles$g = {"container":"micromag-viewer-buttons-button-container","asLink":"micromag-viewer-buttons-button-asLink","icon":"micromag-viewer-buttons-button-icon","label":"micromag-viewer-buttons-button-label","withIcon":"micromag-viewer-buttons-button-withIcon","right":"micromag-viewer-buttons-button-right","icon-right":"micromag-viewer-buttons-button-icon-right","withIconColumns":"micromag-viewer-buttons-button-withIconColumns","linkDisabled":"micromag-viewer-buttons-button-linkDisabled"};
202
202
 
203
- var _excluded$8 = ["type", "theme", "size", "href", "external", "direct", "target", "label", "children", "focusable", "active", "icon", "iconPosition", "disabled", "loading", "disableOnLoading", "withoutTheme", "asLink", "onClick", "className", "iconClassName", "labelClassName", "refButton"];
204
- var propTypes$n = {
203
+ var _excluded$9 = ["type", "theme", "size", "href", "external", "direct", "target", "label", "children", "focusable", "active", "icon", "iconPosition", "disabled", "loading", "disableOnLoading", "withoutTheme", "asLink", "onClick", "className", "iconClassName", "labelClassName", "refButton"];
204
+ var propTypes$o = {
205
205
  type: PropTypes.string,
206
206
  theme: PropTypes$1.buttonTheme,
207
207
  size: PropTypes$1.buttonSize,
@@ -229,7 +229,7 @@ var propTypes$n = {
229
229
  })])
230
230
  };
231
231
 
232
- var defaultProps$n = {
232
+ var defaultProps$o = {
233
233
  type: 'button',
234
234
  theme: null,
235
235
  size: null,
@@ -279,7 +279,7 @@ var Button = function Button(_ref) {
279
279
  iconClassName = _ref.iconClassName,
280
280
  labelClassName = _ref.labelClassName,
281
281
  refButton = _ref.refButton,
282
- props = _objectWithoutProperties(_ref, _excluded$8);
282
+ props = _objectWithoutProperties(_ref, _excluded$9);
283
283
  var finalLabel = label || children;
284
284
  var text = finalLabel !== null ? /*#__PURE__*/React.createElement(Label, null, finalLabel) : null;
285
285
  var hasChildren = label !== null && children !== null;
@@ -337,40 +337,43 @@ var Button = function Button(_ref) {
337
337
  tabIndex: focusable ? '0' : '-1'
338
338
  }), content);
339
339
  };
340
- Button.propTypes = propTypes$n;
341
- Button.defaultProps = defaultProps$n;
340
+ Button.propTypes = propTypes$o;
341
+ Button.defaultProps = defaultProps$o;
342
342
 
343
- var styles$f = {"container":"micromag-viewer-buttons-icon-button-container","icon":"micromag-viewer-buttons-icon-button-icon","label":"micromag-viewer-buttons-icon-button-label"};
343
+ var styles$f = {"container":"micromag-viewer-buttons-icon-button-container","label":"micromag-viewer-buttons-icon-button-label","icon":"micromag-viewer-buttons-icon-button-icon"};
344
344
 
345
- var _excluded$7 = ["className"];
346
- var propTypes$m = {
345
+ var _excluded$8 = ["iconClassName", "className"];
346
+ var propTypes$n = {
347
+ iconClassName: PropTypes.string,
347
348
  className: PropTypes.string
348
349
  };
349
- var defaultProps$m = {
350
+ var defaultProps$n = {
351
+ iconClassName: null,
350
352
  className: null
351
353
  };
352
354
  var IconButton = function IconButton(_ref) {
353
- var className = _ref.className,
354
- props = _objectWithoutProperties(_ref, _excluded$7);
355
+ var iconClassName = _ref.iconClassName,
356
+ className = _ref.className,
357
+ props = _objectWithoutProperties(_ref, _excluded$8);
355
358
  return /*#__PURE__*/React.createElement(Button, Object.assign({
356
359
  className: classNames([styles$f.container, _defineProperty({}, className, className !== null)]),
357
360
  labelClassName: styles$f.label,
358
- iconClassName: styles$f.icon
361
+ iconClassName: classNames([styles$f.icon, _defineProperty({}, iconClassName, iconClassName !== null)])
359
362
  }, props));
360
363
  };
361
- IconButton.propTypes = propTypes$m;
362
- IconButton.defaultProps = defaultProps$m;
364
+ IconButton.propTypes = propTypes$n;
365
+ IconButton.defaultProps = defaultProps$n;
363
366
 
364
- var _excluded$6 = ["className"];
365
- var propTypes$l = {
367
+ var _excluded$7 = ["className"];
368
+ var propTypes$m = {
366
369
  className: PropTypes.string
367
370
  };
368
- var defaultProps$l = {
371
+ var defaultProps$m = {
369
372
  className: null
370
373
  };
371
- var CloseButton = function CloseButton(_ref) {
374
+ var CloseButton$1 = function CloseButton(_ref) {
372
375
  var className = _ref.className,
373
- props = _objectWithoutProperties(_ref, _excluded$6);
376
+ props = _objectWithoutProperties(_ref, _excluded$7);
374
377
  var intl = useIntl();
375
378
  return /*#__PURE__*/React.createElement(IconButton, Object.assign({
376
379
  className: classNames([_defineProperty({}, className, className !== null)]),
@@ -392,6 +395,61 @@ var CloseButton = function CloseButton(_ref) {
392
395
  }))
393
396
  }, props));
394
397
  };
398
+ CloseButton$1.propTypes = propTypes$m;
399
+ CloseButton$1.defaultProps = defaultProps$m;
400
+
401
+ var _excluded$6 = ["className"];
402
+ var propTypes$l = {
403
+ className: PropTypes.string
404
+ };
405
+ var defaultProps$l = {
406
+ className: null
407
+ };
408
+ var CloseButton = function CloseButton(_ref) {
409
+ var className = _ref.className,
410
+ props = _objectWithoutProperties(_ref, _excluded$6);
411
+ var intl = useIntl();
412
+ return /*#__PURE__*/React.createElement(IconButton, Object.assign({
413
+ className: classNames([_defineProperty({}, className, className !== null)]),
414
+ label: intl.formatMessage({
415
+ id: "dj/p/q",
416
+ defaultMessage: [{
417
+ "type": 0,
418
+ "value": "Close"
419
+ }]
420
+ }),
421
+ icon: /*#__PURE__*/React.createElement("svg", {
422
+ width: "19",
423
+ height: "23",
424
+ viewBox: "0 0 19 23",
425
+ fill: "none",
426
+ xmlns: "http://www.w3.org/2000/svg"
427
+ }, /*#__PURE__*/React.createElement("mask", {
428
+ id: "path-1-inside-1_560_19911",
429
+ fill: "currentColor"
430
+ }, /*#__PURE__*/React.createElement("path", {
431
+ d: "M0 7C0 4.79086 1.79086 3 4 3H12C14.2091 3 16 4.79086 16 7V19C16 21.2091 14.2091 23 12 23H4C1.79086 23 0 21.2091 0 19V7Z"
432
+ })), /*#__PURE__*/React.createElement("path", {
433
+ d: "M0 3H16H0ZM16 19C16 21.7614 13.7614 24 11 24H4C1.23858 24 -1 21.7614 -1 19H1C1 20.6569 2.34315 22 4 22H12C14.2091 22 16 20.6569 16 19ZM4 24C1.23858 24 -1 21.7614 -1 19V8C-1 5.23858 1.23858 3 4 3C2.34315 3 1 4.79086 1 7V19C1 20.6569 2.34315 22 4 22V24ZM16 3V23V3Z",
434
+ fill: "currentColor",
435
+ mask: "url(#path-1-inside-1_560_19911)"
436
+ }), /*#__PURE__*/React.createElement("rect", {
437
+ x: "3.5",
438
+ y: "0.5",
439
+ width: "15",
440
+ height: "19",
441
+ rx: "2.5",
442
+ stroke: "currentColor"
443
+ }), /*#__PURE__*/React.createElement("path", {
444
+ d: "M7.35333 6.35333L14.6467 13.6467",
445
+ stroke: "currentColor",
446
+ strokeLinejoin: "round"
447
+ }), /*#__PURE__*/React.createElement("path", {
448
+ d: "M7.35333 13.6467L14.6467 6.35333",
449
+ stroke: "white"
450
+ }))
451
+ }, props));
452
+ };
395
453
  CloseButton.propTypes = propTypes$l;
396
454
  CloseButton.defaultProps = defaultProps$l;
397
455
 
@@ -420,15 +478,27 @@ var MenuButton = function MenuButton(_ref) {
420
478
  }),
421
479
  iconPosition: "right",
422
480
  icon: /*#__PURE__*/React.createElement("svg", {
423
- xmlns: "http://www.w3.org/2000/svg",
424
- width: "10",
425
- height: "16",
426
- viewBox: "0 0 10 16",
481
+ width: "19",
482
+ height: "23",
483
+ viewBox: "0 0 19 23",
484
+ fill: "none",
485
+ xmlns: "http://www.w3.org/2000/svg"
486
+ }, /*#__PURE__*/React.createElement("mask", {
487
+ id: "path-1-inside-1_572_15622",
427
488
  fill: "currentColor"
428
- // className={iconClassName}
429
- }, /*#__PURE__*/React.createElement("rect", {
430
- width: "10",
431
- height: "16"
489
+ }, /*#__PURE__*/React.createElement("path", {
490
+ d: "M0 7C0 4.79086 1.79086 3 4 3H12C14.2091 3 16 4.79086 16 7V19C16 21.2091 14.2091 23 12 23H4C1.79086 23 0 21.2091 0 19V7Z"
491
+ })), /*#__PURE__*/React.createElement("path", {
492
+ d: "M0 3H16H0ZM16 19C16 21.7614 13.7614 24 11 24H4C1.23858 24 -1 21.7614 -1 19H1C1 20.6569 2.34315 22 4 22H12C14.2091 22 16 20.6569 16 19ZM4 24C1.23858 24 -1 21.7614 -1 19V8C-1 5.23858 1.23858 3 4 3C2.34315 3 1 4.79086 1 7V19C1 20.6569 2.34315 22 4 22V24ZM16 3V23V3Z",
493
+ fill: "currentColor",
494
+ mask: "url(#path-1-inside-1_572_15622)"
495
+ }), /*#__PURE__*/React.createElement("rect", {
496
+ x: "3.5",
497
+ y: "0.5",
498
+ width: "15",
499
+ height: "19",
500
+ rx: "2.5",
501
+ stroke: "currentColor"
432
502
  }))
433
503
  }, props));
434
504
  };
@@ -457,15 +527,21 @@ var ShareButton = function ShareButton(_ref) {
457
527
  }),
458
528
  iconPosition: "left",
459
529
  icon: /*#__PURE__*/React.createElement("svg", {
460
- xmlns: "http://www.w3.org/2000/svg",
461
- width: "10px",
462
- height: "16px",
463
- viewBox: "0 0 10 16",
530
+ width: "16",
531
+ height: "22",
532
+ viewBox: "0 0 16 22",
533
+ fill: "none",
534
+ xmlns: "http://www.w3.org/2000/svg"
535
+ }, /*#__PURE__*/React.createElement("path", {
536
+ fillRule: "evenodd",
537
+ clipRule: "evenodd",
538
+ d: "M7.55806 0.183058C7.80213 -0.0610194 8.19786 -0.0610194 8.44194 0.183058L12.4194 4.16053C12.6635 4.40461 12.6635 4.80034 12.4194 5.04442C12.1753 5.2885 11.7796 5.2885 11.5355 5.04442L8.625 2.13388V11.25H7.375V2.13388L4.46446 5.04442C4.22039 5.2885 3.82466 5.2885 3.58058 5.04442C3.3365 4.80034 3.3365 4.40461 3.58058 4.16053L7.55806 0.183058Z",
539
+ fill: "currentColor"
540
+ }), /*#__PURE__*/React.createElement("path", {
541
+ fillRule: "evenodd",
542
+ clipRule: "evenodd",
543
+ d: "M16 18.25V10.25C16 8.59315 14.6569 7.25 13 7.25C14.1046 7.25 15 8.59315 15 10.25V18.25C15 19.3546 14.1046 20.25 13 20.25H3C1.89543 20.25 1 19.3546 1 18.25V10.25C1 8.59315 1.89543 7.25 3 7.25C1.34315 7.25 0 8.59315 0 10.25V18.25C0 19.9069 1.34315 21.25 3 21.25H13C14.6569 21.25 16 19.9069 16 18.25Z",
464
544
  fill: "currentColor"
465
- }, /*#__PURE__*/React.createElement("polygon", {
466
- points: "8.5 14.5 1.5 14.5 1.5 8 0 8 0 16 10 16 10 8 8.5 8 8.5 14.5"
467
- }), /*#__PURE__*/React.createElement("polygon", {
468
- points: "9.62 4.62 5 0 0.38 4.62 1.44 5.68 4.25 2.87 4.25 11.26 5.75 11.26 5.75 2.87 8.56 5.68 9.62 4.62"
469
545
  }))
470
546
  }, props));
471
547
  };
@@ -1559,7 +1635,7 @@ var ViewerMenu = function ViewerMenu(_ref) {
1559
1635
  iconPosition: "left",
1560
1636
  focusable: !shareOpened
1561
1637
  }),
1562
- toggledButton: /*#__PURE__*/React.createElement(CloseButton, {
1638
+ toggledButton: /*#__PURE__*/React.createElement(CloseButton$1, {
1563
1639
  className: styles$6.menuButton,
1564
1640
  onClick: onCloseShare,
1565
1641
  theme: menuTheme,
@@ -1795,17 +1871,17 @@ var ArrowHint = function ArrowHint(_ref) {
1795
1871
  }, /*#__PURE__*/React.createElement("div", {
1796
1872
  className: styles$3.inner
1797
1873
  }, /*#__PURE__*/React.createElement("svg", {
1798
- className: styles$3.arrow,
1874
+ width: "20",
1875
+ height: "14",
1876
+ viewBox: "0 0 20 14",
1877
+ fill: "none",
1799
1878
  xmlns: "http://www.w3.org/2000/svg",
1800
- xmlnsXlink: "http://www.w3.org/1999/xlink",
1801
- x: "0px",
1802
- y: "0px",
1803
- width: "10px",
1804
- height: "16px",
1805
- viewBox: "0 0 10 16",
1879
+ className: styles$3.arrow
1880
+ }, /*#__PURE__*/React.createElement("path", {
1881
+ fillRule: "evenodd",
1882
+ clipRule: "evenodd",
1883
+ d: "M13.353 0.371014L19.319 6.33704C19.6851 6.70314 19.6851 7.29671 19.319 7.66282L13.353 13.6288C12.9869 13.9949 12.3933 13.9949 12.0272 13.6288C11.6611 13.2627 11.6611 12.6692 12.0272 12.3031L16.3929 7.9374H0V6.06246H16.3929L12.0272 1.6968C11.6611 1.33069 11.6611 0.737119 12.0272 0.371014C12.3933 0.0049094 12.9869 0.0049094 13.353 0.371014Z",
1806
1884
  fill: "currentColor"
1807
- }, /*#__PURE__*/React.createElement("polygon", {
1808
- points: "9.62 4.62 5 0 0.38 4.62 1.44 5.68 4.25 2.87 4.25 14.39 5.75 14.39 5.75 2.87 8.56 5.68 9.62 4.62"
1809
1885
  }))));
1810
1886
  };
1811
1887
  ArrowHint.propTypes = propTypes$6;
@@ -2144,39 +2220,33 @@ function PlaybackControls(_ref) {
2144
2220
  var isCollapsed = controls && !controlsVisible && playing || !controls && mediaHasAudio;
2145
2221
  var icon = playing ? /*#__PURE__*/React.createElement("svg", {
2146
2222
  className: styles$1.icon,
2147
- xmlns: "http://www.w3.org/2000/svg",
2148
- xmlnsXlink: "http://www.w3.org/1999/xlink",
2149
- x: "0px",
2150
- y: "0px",
2151
- width: "10px",
2152
- height: "16px",
2153
- viewBox: "0 0 10 16",
2154
- xmlSpace: "preserve"
2223
+ width: "14",
2224
+ height: "18",
2225
+ viewBox: "0 0 14 18",
2226
+ fill: "none",
2227
+ xmlns: "http://www.w3.org/2000/svg"
2155
2228
  }, /*#__PURE__*/React.createElement("rect", {
2156
- fill: color,
2157
- x: "1",
2158
- y: "3.27",
2159
- width: "3",
2160
- height: "9.69"
2229
+ width: "6",
2230
+ height: "18",
2231
+ rx: "2",
2232
+ fill: color
2161
2233
  }), /*#__PURE__*/React.createElement("rect", {
2162
- fill: color,
2163
- x: "6",
2164
- y: "3.27",
2165
- width: "3",
2166
- height: "9.69"
2234
+ x: "8",
2235
+ width: "6",
2236
+ height: "18",
2237
+ rx: "2",
2238
+ fill: color
2167
2239
  })) : /*#__PURE__*/React.createElement("svg", {
2168
- className: styles$1.icon,
2240
+ width: "20",
2241
+ height: "23",
2242
+ viewBox: "0 0 20 23",
2243
+ fill: "none",
2169
2244
  xmlns: "http://www.w3.org/2000/svg",
2170
- xmlnsXlink: "http://www.w3.org/1999/xlink",
2171
- x: "0px",
2172
- y: "0px",
2173
- width: "10px",
2174
- height: "16px",
2175
- viewBox: "0 0 10 16",
2176
- xmlSpace: "preserve"
2245
+ className: styles$1.icon
2177
2246
  }, /*#__PURE__*/React.createElement("path", {
2247
+ d: "M16.25 12.5574L2.74999 20.3516C1.74999 20.9289 0.499993 20.2073 0.499993 19.0526L0.499994 3.4641C0.499994 2.3094 1.74999 1.58771 2.74999 2.16506L16.25 9.95929C17.25 10.5366 17.25 11.98 16.25 12.5574Z",
2178
2248
  fill: color,
2179
- d: "M1,3.16V12.84l8-4.84L1,3.16"
2249
+ stroke: color
2180
2250
  }));
2181
2251
  return /*#__PURE__*/React.createElement("div", {
2182
2252
  className: classNames([styles$1.container, (_ref4 = {}, _defineProperty(_ref4, className, className !== null), _defineProperty(_ref4, styles$1.withPlayPause, controls && !seekBarOnly), _defineProperty(_ref4, styles$1.withMute, hasMedia || controls), _defineProperty(_ref4, styles$1.withSeekBar, controls), _defineProperty(_ref4, styles$1.withSeekBarOnly, seekBarOnly), _defineProperty(_ref4, styles$1.isCollapsed, isCollapsed), _defineProperty(_ref4, styles$1.isMuted, muted), _defineProperty(_ref4, collapsedClassName, collapsedClassName !== null && isCollapsed), _ref4)])
@@ -2227,42 +2297,36 @@ function PlaybackControls(_ref) {
2227
2297
  onClick: muted ? onUnmute : onMute,
2228
2298
  focusable: controlsVisible || mediaHasAudio,
2229
2299
  icon: muted ? /*#__PURE__*/React.createElement("svg", {
2300
+ width: "26",
2301
+ height: "26",
2302
+ viewBox: "0 0 26 26",
2303
+ fill: "none",
2230
2304
  xmlns: "http://www.w3.org/2000/svg",
2231
- xmlnsXlink: "http://www.w3.org/1999/xlink",
2232
- x: "0px",
2233
- y: "0px",
2234
- width: "10px",
2235
- height: "16px",
2236
- viewBox: "0 0 10 16",
2237
- xmlSpace: "preserve",
2238
2305
  className: styles$1.icon
2239
- }, /*#__PURE__*/React.createElement("polygon", {
2240
- fill: color,
2241
- points: "2.75 4.63 1.24 6 0 6 0 10 1.24 10 4.54 13 4.54 3 2.75 4.63"
2242
- }), /*#__PURE__*/React.createElement("polygon", {
2243
- fill: color,
2244
- points: "10 6.63 8.94 5.57 7.58 6.93 6.21 5.57 5.15 6.63 6.52 7.99 5.15 9.35 6.21 10.43 7.58 9.06 8.94 10.43 10 9.35 8.64 7.99 10 6.63"
2306
+ }, /*#__PURE__*/React.createElement("path", {
2307
+ d: "M7.09929 8.77987H1C0.447715 8.77987 0 9.22758 0 9.77987V15.7799C0 16.3322 0.447715 16.7799 1 16.7799H7.1076C7.35984 16.7799 7.60276 16.8752 7.78768 17.0467L14.3199 23.1062C14.9599 23.6999 16 23.246 16 22.3731V3.00199C16 2.12221 14.9458 1.67117 14.3095 2.2787L7.78983 8.50316C7.6038 8.68077 7.35649 8.77987 7.09929 8.77987Z",
2308
+ fill: color
2309
+ }), /*#__PURE__*/React.createElement("path", {
2310
+ fillRule: "evenodd",
2311
+ clipRule: "evenodd",
2312
+ d: "M20.8536 13.3946L23 15.5411L23.7071 14.834L21.5607 12.6875L23.7071 10.5411L23 9.83398L20.8536 11.9804L18.7071 9.83398L18 10.5411L20.1464 12.6875L18 14.834L18.7071 15.5411L20.8536 13.3946Z",
2313
+ fill: color
2245
2314
  })) : /*#__PURE__*/React.createElement("svg", {
2315
+ width: "26",
2316
+ height: "26",
2317
+ viewBox: "0 0 26 26",
2318
+ fill: "none",
2246
2319
  xmlns: "http://www.w3.org/2000/svg",
2247
- xmlnsXlink: "http://www.w3.org/1999/xlink",
2248
- x: "0px",
2249
- y: "0px",
2250
- width: "10px",
2251
- height: "16px",
2252
- viewBox: "0 0 10 16",
2253
- xmlSpace: "preserve",
2254
2320
  className: styles$1.icon
2255
- }, /*#__PURE__*/React.createElement("polygon", {
2256
- fill: color,
2257
- points: "2.75 4.63 1.24 6 0 6 0 10 1.24 10 4.54 13 4.54 3 2.75 4.63"
2258
- }), /*#__PURE__*/React.createElement("circle", {
2259
- fill: color,
2260
- cx: "6.14",
2261
- cy: "8",
2262
- r: ".99"
2321
+ }, /*#__PURE__*/React.createElement("path", {
2322
+ d: "M7.09929 8.77987H1C0.447715 8.77987 0 9.22758 0 9.77987V15.7799C0 16.3322 0.447715 16.7799 1 16.7799H7.1076C7.35984 16.7799 7.60276 16.8752 7.78768 17.0467L14.3199 23.1062C14.9599 23.6999 16 23.246 16 22.3731V3.00199C16 2.12221 14.9458 1.67117 14.3095 2.2787L7.78983 8.50316C7.6038 8.68077 7.35649 8.77987 7.09929 8.77987Z",
2323
+ fill: color
2324
+ }), /*#__PURE__*/React.createElement("path", {
2325
+ d: "M18 18.6875C21.3137 18.6875 24 16.0012 24 12.6875C24 9.37379 21.3137 6.6875 18 6.6875",
2326
+ stroke: color
2263
2327
  }), /*#__PURE__*/React.createElement("path", {
2264
- fill: color,
2265
- d: "M6.14,11.88v-1.5c1.31,0,2.38-1.07,2.38-2.38s-1.07-2.38-2.38-2.38v-1.5c2.14,0,3.88,1.74,3.88,3.88s-1.74,3.88-3.88,3.88Z"
2328
+ d: "M18 15.6875C19.6569 15.6875 21 14.3444 21 12.6875C21 11.0306 19.6569 9.6875 18 9.6875",
2329
+ stroke: color
2266
2330
  })),
2267
2331
  "aria-label": muted ? intl.formatMessage({
2268
2332
  id: "RK/QEY",