@micromag/viewer 0.4.49 → 0.4.50

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.
Files changed (2) hide show
  1. package/es/index.js +1145 -1010
  2. package/package.json +10 -10
package/es/index.js CHANGED
@@ -4,7 +4,7 @@ import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProper
4
4
  import { useRoutes, useUrlGenerator, useMemoryRouter, RoutesProvider } from '@folklore/routes';
5
5
  import isEmpty from 'lodash/isEmpty';
6
6
  import uniq from 'lodash/uniq';
7
- import React, { useEffect, useState, useCallback, useMemo, useRef } from 'react';
7
+ import { useEffect, useState, useCallback, useMemo, useRef } from 'react';
8
8
  import { Link, useLocation, Switch, Route, Router } from 'wouter';
9
9
  import { useViewerSize, usePlaybackContext, useViewerWebView, useViewerInteraction, useStory, StoryProvider, ScreenSizeProvider, ViewerProvider, SettingsProvider, GoogleKeysProvider, GoogleMapsClientProvider, ComponentsProvider, SCREENS_NAMESPACE, VisitorProvider, PlaybackProvider, TrackingProvider } from '@micromag/core/contexts';
10
10
  import { useIsVisible, useDimensionObserver, useTrackEvent, useDragProgress, useMediaProgress, useMediaCurrentTime, useMediaDuration, useMediaReady, useMediaState, useParsedStory, useLoadedFonts, useTrackScreenView, useScreenSizeFromElement, useFullscreen, useActivityDetector, useSupportsWebp } from '@micromag/core/hooks';
@@ -20,6 +20,7 @@ import { Label, CloseIcon, ScreenPreview, Screen, ArrowIcon, Button as Button$1,
20
20
  import { getStyleFromColor, easings, getStyleFromText, getColorAsString, getDeviceScreens } from '@micromag/core/utils';
21
21
  import { ShareIncentive } from '@micromag/elements/all';
22
22
  import FocusLock from 'react-focus-lock';
23
+ import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
23
24
  import { useSpringRef, useSpring } from '@react-spring/core';
24
25
  import Scroll from '@micromag/element-scroll';
25
26
  import ShareOptions from '@micromag/element-share-options';
@@ -292,7 +293,9 @@ function Button(_ref) {
292
293
  refButton = _ref$refButton === void 0 ? null : _ref$refButton,
293
294
  props = _objectWithoutProperties(_ref, _excluded$a);
294
295
  var finalLabel = label || children;
295
- var text = finalLabel !== null ? /*#__PURE__*/React.createElement(Label, null, finalLabel) : null;
296
+ var text = finalLabel !== null ? /*#__PURE__*/jsx(Label, {
297
+ children: finalLabel
298
+ }) : null;
296
299
  var hasChildren = label !== null && children !== null;
297
300
  var hasIcon = icon !== null;
298
301
  var hasInlineIcon = hasIcon && (iconPosition === 'inline' || text === null);
@@ -306,39 +309,52 @@ function Button(_ref) {
306
309
  brandPrimaryColor = _ref4$primary === void 0 ? null : _ref4$primary;
307
310
  var primaryColor = getStyleFromColor(brandPrimaryColor, 'color');
308
311
  var buttonStyles = _objectSpread({}, primaryColor);
309
- var content = /*#__PURE__*/React.createElement(React.Fragment, null, hasInlineIcon ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("span", {
310
- className: classNames([styles$i.icon, iconClassName])
311
- }, icon), text !== null ? /*#__PURE__*/React.createElement("span", {
312
- className: classNames([styles$i.label, labelClassName])
313
- }, text) : null) : null, hasIconColumns ? /*#__PURE__*/React.createElement(React.Fragment, null, iconPosition === 'left' ? /*#__PURE__*/React.createElement("span", {
314
- className: classNames([styles$i.icon, styles$i.left, _defineProperty({}, iconClassName, iconClassName !== null && iconPosition === 'left')])
315
- }, icon) : null, /*#__PURE__*/React.createElement("span", {
316
- className: classNames([styles$i.center, styles$i.label, labelClassName])
317
- }, text), iconPosition === 'right' ? /*#__PURE__*/React.createElement("span", {
318
- className: classNames([styles$i.icon, styles$i.right, _defineProperty({}, iconClassName, iconClassName !== null && iconPosition === 'right')])
319
- }, icon) : null, hasChildren ? children : null) : null, !hasIcon ? text : null, hasChildren ? children : null);
312
+ var content = /*#__PURE__*/jsxs(Fragment, {
313
+ children: [hasInlineIcon ? /*#__PURE__*/jsxs(Fragment, {
314
+ children: [/*#__PURE__*/jsx("span", {
315
+ className: classNames([styles$i.icon, iconClassName]),
316
+ children: icon
317
+ }), text !== null ? /*#__PURE__*/jsx("span", {
318
+ className: classNames([styles$i.label, labelClassName]),
319
+ children: text
320
+ }) : null]
321
+ }) : null, hasIconColumns ? /*#__PURE__*/jsxs(Fragment, {
322
+ children: [iconPosition === 'left' ? /*#__PURE__*/jsx("span", {
323
+ className: classNames([styles$i.icon, styles$i.left, _defineProperty({}, iconClassName, iconClassName !== null && iconPosition === 'left')]),
324
+ children: icon
325
+ }) : null, /*#__PURE__*/jsx("span", {
326
+ className: classNames([styles$i.center, styles$i.label, labelClassName]),
327
+ children: text
328
+ }), iconPosition === 'right' ? /*#__PURE__*/jsx("span", {
329
+ className: classNames([styles$i.icon, styles$i.right, _defineProperty({}, iconClassName, iconClassName !== null && iconPosition === 'right')]),
330
+ children: icon
331
+ }) : null, hasChildren ? children : null]
332
+ }) : null, !hasIcon ? text : null, hasChildren ? children : null]
333
+ });
320
334
  if (href !== null) {
321
335
  var linkClassNames = classNames([buttonClassNames, _defineProperty({
322
336
  disabled: disabled
323
337
  }, styles$i.linkDisabled, disabled)]);
324
- return external || direct ? /*#__PURE__*/React.createElement("a", Object.assign({}, props, {
338
+ return external || direct ? /*#__PURE__*/jsx("a", _objectSpread(_objectSpread({}, props), {}, {
325
339
  href: disabled ? null : href,
326
340
  className: linkClassNames,
327
341
  style: buttonStyles,
328
342
  onClick: onClick,
329
343
  target: external ? target : null,
330
344
  ref: refButton,
331
- tabIndex: focusable ? '' : '-1'
332
- }), content) : /*#__PURE__*/React.createElement(Link, Object.assign({}, props, {
345
+ tabIndex: focusable ? '' : '-1',
346
+ children: content
347
+ })) : /*#__PURE__*/jsx(Link, _objectSpread(_objectSpread({}, props), {}, {
333
348
  href: href,
334
349
  className: linkClassNames,
335
350
  style: buttonStyles,
336
351
  onClick: onClick,
337
352
  ref: refButton,
338
- tabIndex: focusable ? '' : '-1'
339
- }), content);
353
+ tabIndex: focusable ? '' : '-1',
354
+ children: content
355
+ }));
340
356
  }
341
- return /*#__PURE__*/React.createElement("button", Object.assign({}, props, {
357
+ return /*#__PURE__*/jsx("button", _objectSpread(_objectSpread({}, props), {}, {
342
358
  type: type,
343
359
  className: buttonClassNames,
344
360
  style: buttonStyles,
@@ -346,8 +362,9 @@ function Button(_ref) {
346
362
  disabled: disabled || disableOnLoading && loading,
347
363
  ref: refButton,
348
364
  "aria-label": ariaLabel,
349
- tabIndex: focusable ? '0' : '-1'
350
- }), content);
365
+ tabIndex: focusable ? '0' : '-1',
366
+ children: content
367
+ }));
351
368
  }
352
369
 
353
370
  var styles$h = {"container":"micromag-viewer-buttons-icon-button-container","label":"micromag-viewer-buttons-icon-button-label","icon":"micromag-viewer-buttons-icon-button-icon"};
@@ -359,7 +376,7 @@ function IconButton(_ref) {
359
376
  _ref$className = _ref.className,
360
377
  className = _ref$className === void 0 ? null : _ref$className,
361
378
  props = _objectWithoutProperties(_ref, _excluded$9);
362
- return /*#__PURE__*/React.createElement(Button, Object.assign({
379
+ return /*#__PURE__*/jsx(Button, _objectSpread({
363
380
  className: classNames([styles$h.container, className]),
364
381
  labelClassName: styles$h.label,
365
382
  iconClassName: classNames([styles$h.icon, iconClassName])
@@ -374,7 +391,7 @@ function CloseMenuButton(_ref) {
374
391
  className = _ref$className === void 0 ? null : _ref$className,
375
392
  props = _objectWithoutProperties(_ref, _excluded$8);
376
393
  var intl = useIntl();
377
- return /*#__PURE__*/React.createElement(IconButton, Object.assign({
394
+ return /*#__PURE__*/jsx(IconButton, _objectSpread({
378
395
  className: classNames([className]),
379
396
  label: intl.formatMessage({
380
397
  id: "dIvwcD",
@@ -383,36 +400,40 @@ function CloseMenuButton(_ref) {
383
400
  "value": "Close"
384
401
  }]
385
402
  }),
386
- icon: /*#__PURE__*/React.createElement("svg", {
403
+ icon: /*#__PURE__*/jsxs("svg", {
387
404
  width: "19",
388
405
  height: "23",
389
406
  viewBox: "0 0 19 23",
390
407
  fill: "none",
391
- xmlns: "http://www.w3.org/2000/svg"
392
- }, !single ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("mask", {
393
- id: "path-1-inside-1_560_19911",
394
- fill: "currentColor"
395
- }, /*#__PURE__*/React.createElement("path", {
396
- 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"
397
- })), /*#__PURE__*/React.createElement("path", {
398
- 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",
399
- fill: "currentColor",
400
- mask: "url(#path-1-inside-1_560_19911)"
401
- })) : null, /*#__PURE__*/React.createElement("rect", {
402
- x: "3.5",
403
- y: "0.5",
404
- width: "15",
405
- height: "19",
406
- rx: "2.5",
407
- stroke: "currentColor"
408
- }), /*#__PURE__*/React.createElement("path", {
409
- d: "M7.35333 6.35333L14.6467 13.6467",
410
- stroke: "currentColor",
411
- strokeLinejoin: "round"
412
- }), /*#__PURE__*/React.createElement("path", {
413
- d: "M7.35333 13.6467L14.6467 6.35333",
414
- stroke: "currentColor"
415
- }))
408
+ xmlns: "http://www.w3.org/2000/svg",
409
+ children: [!single ? /*#__PURE__*/jsxs(Fragment, {
410
+ children: [/*#__PURE__*/jsx("mask", {
411
+ id: "path-1-inside-1_560_19911",
412
+ fill: "currentColor",
413
+ children: /*#__PURE__*/jsx("path", {
414
+ 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"
415
+ })
416
+ }), /*#__PURE__*/jsx("path", {
417
+ 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",
418
+ fill: "currentColor",
419
+ mask: "url(#path-1-inside-1_560_19911)"
420
+ })]
421
+ }) : null, /*#__PURE__*/jsx("rect", {
422
+ x: "3.5",
423
+ y: "0.5",
424
+ width: "15",
425
+ height: "19",
426
+ rx: "2.5",
427
+ stroke: "currentColor"
428
+ }), /*#__PURE__*/jsx("path", {
429
+ d: "M7.35333 6.35333L14.6467 13.6467",
430
+ stroke: "currentColor",
431
+ strokeLinejoin: "round"
432
+ }), /*#__PURE__*/jsx("path", {
433
+ d: "M7.35333 13.6467L14.6467 6.35333",
434
+ stroke: "currentColor"
435
+ })]
436
+ })
416
437
  }, props));
417
438
  }
418
439
 
@@ -423,7 +444,7 @@ function MenuButton(_ref) {
423
444
  _ref.iconClassName;
424
445
  var props = _objectWithoutProperties(_ref, _excluded$7);
425
446
  var intl = useIntl();
426
- return /*#__PURE__*/React.createElement(IconButton, Object.assign({
447
+ return /*#__PURE__*/jsx(IconButton, _objectSpread({
427
448
  className: classNames([className]),
428
449
  label: intl.formatMessage({
429
450
  id: "F/gl4b",
@@ -433,29 +454,31 @@ function MenuButton(_ref) {
433
454
  }]
434
455
  }),
435
456
  iconPosition: "right",
436
- icon: /*#__PURE__*/React.createElement("svg", {
457
+ icon: /*#__PURE__*/jsxs("svg", {
437
458
  width: "19",
438
459
  height: "23",
439
460
  viewBox: "0 0 19 23",
440
461
  fill: "none",
441
- xmlns: "http://www.w3.org/2000/svg"
442
- }, /*#__PURE__*/React.createElement("mask", {
443
- id: "path-1-inside-1_572_15622",
444
- fill: "currentColor"
445
- }, /*#__PURE__*/React.createElement("path", {
446
- 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"
447
- })), /*#__PURE__*/React.createElement("path", {
448
- 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",
449
- fill: "currentColor",
450
- mask: "url(#path-1-inside-1_572_15622)"
451
- }), /*#__PURE__*/React.createElement("rect", {
452
- x: "3.5",
453
- y: "0.5",
454
- width: "15",
455
- height: "19",
456
- rx: "2.5",
457
- stroke: "currentColor"
458
- }))
462
+ xmlns: "http://www.w3.org/2000/svg",
463
+ children: [/*#__PURE__*/jsx("mask", {
464
+ id: "path-1-inside-1_572_15622",
465
+ fill: "currentColor",
466
+ children: /*#__PURE__*/jsx("path", {
467
+ 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"
468
+ })
469
+ }), /*#__PURE__*/jsx("path", {
470
+ 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",
471
+ fill: "currentColor",
472
+ mask: "url(#path-1-inside-1_572_15622)"
473
+ }), /*#__PURE__*/jsx("rect", {
474
+ x: "3.5",
475
+ y: "0.5",
476
+ width: "15",
477
+ height: "19",
478
+ rx: "2.5",
479
+ stroke: "currentColor"
480
+ })]
481
+ })
459
482
  }, props));
460
483
  }
461
484
 
@@ -465,7 +488,7 @@ function ShareButton(_ref) {
465
488
  className = _ref$className === void 0 ? null : _ref$className,
466
489
  props = _objectWithoutProperties(_ref, _excluded$6);
467
490
  var intl = useIntl();
468
- return /*#__PURE__*/React.createElement(IconButton, Object.assign({
491
+ return /*#__PURE__*/jsx(IconButton, _objectSpread({
469
492
  className: classNames([className]),
470
493
  label: intl.formatMessage({
471
494
  id: "7tw6U2",
@@ -475,23 +498,24 @@ function ShareButton(_ref) {
475
498
  }]
476
499
  }),
477
500
  iconPosition: "left",
478
- icon: /*#__PURE__*/React.createElement("svg", {
501
+ icon: /*#__PURE__*/jsxs("svg", {
479
502
  width: "16",
480
503
  height: "22",
481
504
  viewBox: "0 0 16 22",
482
505
  fill: "none",
483
- xmlns: "http://www.w3.org/2000/svg"
484
- }, /*#__PURE__*/React.createElement("path", {
485
- fillRule: "evenodd",
486
- clipRule: "evenodd",
487
- 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",
488
- fill: "currentColor"
489
- }), /*#__PURE__*/React.createElement("path", {
490
- fillRule: "evenodd",
491
- clipRule: "evenodd",
492
- 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",
493
- fill: "currentColor"
494
- }))
506
+ xmlns: "http://www.w3.org/2000/svg",
507
+ children: [/*#__PURE__*/jsx("path", {
508
+ fillRule: "evenodd",
509
+ clipRule: "evenodd",
510
+ 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",
511
+ fill: "currentColor"
512
+ }), /*#__PURE__*/jsx("path", {
513
+ fillRule: "evenodd",
514
+ clipRule: "evenodd",
515
+ 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",
516
+ fill: "currentColor"
517
+ })]
518
+ })
495
519
  }, props));
496
520
  }
497
521
 
@@ -510,23 +534,26 @@ function ToggleButton(_ref) {
510
534
  _ref$toggledButtonCla = _ref.toggledButtonClassName,
511
535
  toggledButtonClassName = _ref$toggledButtonCla === void 0 ? null : _ref$toggledButtonCla;
512
536
  if (button === null) return null;
513
- return /*#__PURE__*/React.createElement("div", {
514
- className: classNames([styles$g.container, className])
515
- }, /*#__PURE__*/React.createElement(animated.div, {
516
- className: styles$g.normal,
517
- style: {
518
- transform: progressSpring.to(function (p) {
519
- return "translateY(".concat(p * -100, "%)");
520
- })
521
- }
522
- }, button), /*#__PURE__*/React.createElement(animated.div, {
523
- className: classNames([styles$g.toggled, toggledButtonClassName]),
524
- style: {
525
- transform: progressSpring.to(function (p) {
526
- return "translateY(".concat((p - 1) * -100, "%)");
527
- })
528
- }
529
- }, toggledButton));
537
+ return /*#__PURE__*/jsxs("div", {
538
+ className: classNames([styles$g.container, className]),
539
+ children: [/*#__PURE__*/jsx(animated.div, {
540
+ className: styles$g.normal,
541
+ style: {
542
+ transform: progressSpring.to(function (p) {
543
+ return "translateY(".concat(p * -100, "%)");
544
+ })
545
+ },
546
+ children: button
547
+ }), /*#__PURE__*/jsx(animated.div, {
548
+ className: classNames([styles$g.toggled, toggledButtonClassName]),
549
+ style: {
550
+ transform: progressSpring.to(function (p) {
551
+ return "translateY(".concat((p - 1) * -100, "%)");
552
+ })
553
+ },
554
+ children: toggledButton
555
+ })]
556
+ });
530
557
  }
531
558
 
532
559
  var styles$f = {"container":"micromag-viewer-menus-menu-container-container","heightContainer":"micromag-viewer-menus-menu-container-heightContainer","backdrop":"micromag-viewer-menus-menu-container-backdrop"};
@@ -547,33 +574,35 @@ function ViewerMenuContainer(_ref) {
547
574
  _ref3$color = _ref3.color,
548
575
  brandBackgroundColor = _ref3$color === void 0 ? null : _ref3$color;
549
576
  var backgroundColorStyle = getStyleFromColor(brandBackgroundColor, 'backgroundColor');
550
- return /*#__PURE__*/React.createElement("div", {
577
+ return /*#__PURE__*/jsxs("div", {
551
578
  className: classNames([styles$f.container, className]),
552
579
  style: {
553
580
  pointerEvents: 'none'
554
- }
555
- }, /*#__PURE__*/React.createElement(animated.div, {
556
- className: styles$f.heightContainer,
557
- style: _objectSpread({
558
- opacity: progressSpring,
559
- transform: progressSpring.to(function (p) {
560
- return "translateY(".concat((1 - p) * -2, "rem)");
561
- }),
562
- pointerEvents: progressSpring.to(function (p) {
563
- return p < 0.25 ? 'none' : 'auto';
564
- }),
565
- zIndex: progressSpring.to(function (p) {
566
- return Math.round(2 + p);
567
- })
568
- }, backgroundColorStyle)
569
- }, children), /*#__PURE__*/React.createElement(animated.div, {
570
- className: styles$f.backdrop,
571
- style: {
572
- opacity: progressSpring.to(function (p) {
573
- return easings.easeOutQuint(p);
574
- })
575
- }
576
- }));
581
+ },
582
+ children: [/*#__PURE__*/jsx(animated.div, {
583
+ className: styles$f.heightContainer,
584
+ style: _objectSpread({
585
+ opacity: progressSpring,
586
+ transform: progressSpring.to(function (p) {
587
+ return "translateY(".concat((1 - p) * -2, "rem)");
588
+ }),
589
+ pointerEvents: progressSpring.to(function (p) {
590
+ return p < 0.25 ? 'none' : 'auto';
591
+ }),
592
+ zIndex: progressSpring.to(function (p) {
593
+ return Math.round(2 + p);
594
+ })
595
+ }, backgroundColorStyle),
596
+ children: children
597
+ }), /*#__PURE__*/jsx(animated.div, {
598
+ className: styles$f.backdrop,
599
+ style: {
600
+ opacity: progressSpring.to(function (p) {
601
+ return easings.easeOutQuint(p);
602
+ })
603
+ }
604
+ })]
605
+ });
577
606
  }
578
607
 
579
608
  var styles$e = {"container":"micromag-viewer-menus-menu-dot-container","dot":"micromag-viewer-menus-menu-dot-dot","progress":"micromag-viewer-menus-menu-dot-progress","vertical":"micromag-viewer-menus-menu-dot-vertical"};
@@ -627,7 +656,7 @@ function ViewerMenuDot(_ref) {
627
656
  immediate: !current
628
657
  });
629
658
  }, [active, current, subIndex, count, setDotSpringProps]);
630
- return /*#__PURE__*/React.createElement("button", {
659
+ return /*#__PURE__*/jsx("button", {
631
660
  type: "button",
632
661
  className: classNames([styles$e.container, className, _defineProperty(_defineProperty({}, styles$e.active, current), styles$e.vertical, vertical)]),
633
662
  onClick: function onClick() {
@@ -640,18 +669,20 @@ function ViewerMenuDot(_ref) {
640
669
  }
641
670
  },
642
671
  tabIndex: "-1",
643
- "aria-hidden": "true"
644
- }, /*#__PURE__*/React.createElement("div", {
645
- className: styles$e.dot,
646
- style: {
647
- backgroundColor: secondary
648
- }
649
- }, /*#__PURE__*/React.createElement(animated.div, {
650
- className: styles$e.progress,
651
- style: _objectSpread(_objectSpread({}, dotSpringStyles), {}, {
652
- backgroundColor: primary
672
+ "aria-hidden": "true",
673
+ children: /*#__PURE__*/jsx("div", {
674
+ className: styles$e.dot,
675
+ style: {
676
+ backgroundColor: secondary
677
+ },
678
+ children: /*#__PURE__*/jsx(animated.div, {
679
+ className: styles$e.progress,
680
+ style: _objectSpread(_objectSpread({}, dotSpringStyles), {}, {
681
+ backgroundColor: primary
682
+ })
683
+ })
653
684
  })
654
- })));
685
+ });
655
686
  }
656
687
 
657
688
  var styles$d = {"container":"micromag-viewer-menus-menu-dots-container","dot":"micromag-viewer-menus-menu-dots-dot","withButtons":"micromag-viewer-menus-menu-dots-withButtons","closeButton":"micromag-viewer-menus-menu-dots-closeButton","buttons":"micromag-viewer-menus-menu-dots-buttons","vertical":"micromag-viewer-menus-menu-dots-vertical"};
@@ -693,7 +724,7 @@ function ViewerMenuDots(_ref) {
693
724
  });
694
725
  var _ref4 = props || {},
695
726
  style = _ref4.style;
696
- return /*#__PURE__*/React.createElement("nav", {
727
+ return /*#__PURE__*/jsxs("nav", {
697
728
  className: classNames([styles$d.container, _defineProperty(_defineProperty({}, styles$d.withButtons, closeable || buttons !== null), styles$d.vertical, direction === 'vertical'), className]),
698
729
  "aria-label": intl.formatMessage({
699
730
  id: "bLYuuN",
@@ -717,55 +748,58 @@ function ViewerMenuDots(_ref) {
717
748
  current: currentIndex + 1,
718
749
  total: items.length
719
750
  }),
720
- style: style
721
- }, items.map(function (item, index) {
722
- var _ref6 = item || {},
723
- _ref6$current = _ref6.current,
724
- current = _ref6$current === void 0 ? false : _ref6$current,
725
- _ref6$count = _ref6.count,
726
- count = _ref6$count === void 0 ? 1 : _ref6$count,
727
- _ref6$subIndex = _ref6.subIndex,
728
- subIndex = _ref6$subIndex === void 0 ? 0 : _ref6$subIndex;
729
- return /*#__PURE__*/React.createElement(ViewerMenuDot, {
730
- current: current,
731
- active: index <= currentIndex,
732
- colors: colors,
733
- count: count,
734
- subIndex: subIndex,
735
- className: styles$d.dot,
736
- onClick: function onClick() {
737
- if ((withItemClick || withoutScreensMenu) && onClickDot !== null) {
738
- onClickDot(item);
739
- } else if (!withItemClick && onClickScreensMenu !== null) {
740
- onClickScreensMenu();
741
- }
751
+ style: style,
752
+ children: [items.map(function (item, index) {
753
+ var _ref6 = item || {},
754
+ _ref6$current = _ref6.current,
755
+ current = _ref6$current === void 0 ? false : _ref6$current,
756
+ _ref6$count = _ref6.count,
757
+ count = _ref6$count === void 0 ? 1 : _ref6$count,
758
+ _ref6$subIndex = _ref6.subIndex,
759
+ subIndex = _ref6$subIndex === void 0 ? 0 : _ref6$subIndex;
760
+ return /*#__PURE__*/jsx(ViewerMenuDot, {
761
+ current: current,
762
+ active: index <= currentIndex,
763
+ colors: colors,
764
+ count: count,
765
+ subIndex: subIndex,
766
+ className: styles$d.dot,
767
+ onClick: function onClick() {
768
+ if ((withItemClick || withoutScreensMenu) && onClickDot !== null) {
769
+ onClickDot(item);
770
+ } else if (!withItemClick && onClickScreensMenu !== null) {
771
+ onClickScreensMenu();
772
+ }
773
+ },
774
+ vertical: direction === 'vertical'
775
+ });
776
+ }), closeable ? /*#__PURE__*/jsx("button", {
777
+ type: "button",
778
+ className: styles$d.closeButton,
779
+ onClick: onClose,
780
+ title: intl.formatMessage({
781
+ id: "dj/p/q",
782
+ defaultMessage: [{
783
+ "type": 0,
784
+ "value": "Close"
785
+ }]
786
+ }),
787
+ "aria-label": intl.formatMessage({
788
+ id: "dj/p/q",
789
+ defaultMessage: [{
790
+ "type": 0,
791
+ "value": "Close"
792
+ }]
793
+ }),
794
+ style: {
795
+ color: primary
742
796
  },
743
- vertical: direction === 'vertical'
744
- });
745
- }), closeable ? /*#__PURE__*/React.createElement("button", {
746
- type: "button",
747
- className: styles$d.closeButton,
748
- onClick: onClose,
749
- title: intl.formatMessage({
750
- id: "dj/p/q",
751
- defaultMessage: [{
752
- "type": 0,
753
- "value": "Close"
754
- }]
755
- }),
756
- "aria-label": intl.formatMessage({
757
- id: "dj/p/q",
758
- defaultMessage: [{
759
- "type": 0,
760
- "value": "Close"
761
- }]
762
- }),
763
- style: {
764
- color: primary
765
- }
766
- }, /*#__PURE__*/React.createElement(CloseIcon, null)) : null, buttons !== null ? /*#__PURE__*/React.createElement("div", {
767
- className: styles$d.buttons
768
- }, buttons) : null);
797
+ children: /*#__PURE__*/jsx(CloseIcon, {})
798
+ }) : null, buttons !== null ? /*#__PURE__*/jsx("div", {
799
+ className: styles$d.buttons,
800
+ children: buttons
801
+ }) : null]
802
+ });
769
803
  }
770
804
 
771
805
  function MicromagIcon(_ref) {
@@ -773,49 +807,50 @@ function MicromagIcon(_ref) {
773
807
  color = _ref$color === void 0 ? 'currentColor' : _ref$color,
774
808
  _ref$className = _ref.className,
775
809
  className = _ref$className === void 0 ? null : _ref$className;
776
- return /*#__PURE__*/React.createElement("svg", {
810
+ return /*#__PURE__*/jsxs("svg", {
777
811
  xmlns: "http://www.w3.org/2000/svg",
778
812
  viewBox: "0 0 315.77 56.94",
779
- className: className
780
- }, /*#__PURE__*/React.createElement("path", {
781
- fill: color,
782
- d: "m34.3.69v55.55h-10.42v-23.82l-4.31,23.82h-4.86l-4.31-23.82v23.82H0V.69h10.42l6.74,32.08L23.89.69h10.42Z"
783
- }), /*#__PURE__*/React.createElement("path", {
784
- fill: color,
785
- d: "m46.8.69v55.55h-10.42V.69h10.42Z"
786
- }), /*#__PURE__*/React.createElement("path", {
787
- fill: color,
788
- d: "m64.57,16.53c0-4.72-.35-6.11-2.64-6.11s-2.64,1.39-2.64,6.11v23.89c0,4.72.35,6.11,2.64,6.11s2.64-1.39,2.64-6.11v-6.74h10.42v7.43c0,11.18-4.65,15.83-13.05,15.83s-13.05-4.65-13.05-15.83V15.83c0-11.18,4.65-15.83,13.05-15.83s13.05,4.65,13.05,15.83v7.43h-10.42v-6.74Z"
789
- }), /*#__PURE__*/React.createElement("path", {
790
- fill: color,
791
- d: "m104.08,56.24h-10.42c-.69-.83-.76-2.85-.76-4.93v-10.69c0-4.03-1.39-4.72-5.42-4.72v20.35h-10.42V.69h10.42c11.87,0,15.83,3.96,15.83,15.14v4.93c0,6.11-1.87,10.07-5.14,12.43,3.54,1.46,5.14,4.31,5.14,9.51v8.61c0,2.08.07,4.1.76,4.93Zm-16.6-45.13v14.37c4.03,0,5.42-.69,5.42-4.72v-4.93c0-4.03-1.39-4.72-5.42-4.72Z"
792
- }), /*#__PURE__*/React.createElement("path", {
793
- fill: color,
794
- d: "m173.63.69v55.55h-10.42v-23.82l-4.31,23.82h-4.86l-4.31-23.82v23.82h-10.42V.69h10.42l6.74,32.08L163.22.69h10.42Z"
795
- }), /*#__PURE__*/React.createElement("path", {
796
- fill: color,
797
- d: "m191.68,46.8h-5.49l-.76,9.44h-10.42L181.82.69h14.23l6.81,55.55h-10.42l-.76-9.44Zm-.83-10.42l-1.87-24.65-1.94,24.65h3.82Z"
798
- }), /*#__PURE__*/React.createElement("path", {
799
- fill: color,
800
- d: "m219.25,23.26v-6.74c0-4.72-.42-6.11-2.64-6.11s-2.64,1.39-2.64,6.11v23.89c0,4.72.35,6.11,2.64,6.11s2.64-1.39,2.64-6.11v-2.57h-2.64v-10.42h13.05v28.82h-4.17l-1.67-3.96c-2.15,2.71-5.07,4.65-8.82,4.65-7.5,0-11.46-4.65-11.46-15.83V15.83c0-11.18,4.65-15.83,13.05-15.83s13.05,4.65,13.05,15.83v7.43h-10.42Z"
801
- }), /*#__PURE__*/React.createElement("rect", {
802
- fill: color,
803
- x: "105.65",
804
- y: ".69",
805
- width: "31.25",
806
- height: "55.55",
807
- rx: "3",
808
- ry: "3"
809
- }), /*#__PURE__*/React.createElement("path", {
810
- fill: color,
811
- d: "m304.96,7.72c-2.02,0-2.55,1.05-2.55,4.29v13.04c0,3.24.52,4.29,2.55,4.29s2.55-1.05,2.55-4.29v-13.04c0-3.24-.52-4.29-2.55-4.29Z"
812
- }), /*#__PURE__*/React.createElement("path", {
813
- fill: color,
814
- d: "m283.9,8.07h-.7v20.93h.7c3.42,0,4.46-.52,4.46-3.94v-13.04c0-3.42-1.05-3.94-4.46-3.94Z"
815
- }), /*#__PURE__*/React.createElement("path", {
816
- fill: color,
817
- d: "m313.68.68h-75.86c-1.15,0-2.08.93-2.08,2.08v31.54c0,1.15.93,2.08,2.08,2.08h75.86c1.15,0,2.08-.93,2.08-2.08V2.76c0-1.15-.93-2.08-2.08-2.08Zm-67,32.15c-4.53,0-6.31-2.34-6.31-9.87h3.49c0,5.34.77,6.38,2.83,6.38,1.64,0,2.27-.84,2.27-3.77s-.98-4.19-3.56-6.21c-2.48-1.92-4.85-3.84-4.85-8.41,0-4.12,1.74-6.73,5.79-6.73s5.93,2.62,5.93,8.48h-3.49c0-4.19-.94-4.99-2.44-4.99s-2.3.8-2.3,3.24,1.22,3.77,3.28,5.34c2.96,2.27,5.13,4.22,5.13,9.28,0,4.6-1.67,7.25-5.75,7.25Zm17.82-24.76h-3.94v24.41h-3.49V8.07h-3.94v-3.49h11.37v3.49Zm13.46,16.99c0,5.62-1.99,7.78-6.03,7.78s-6.03-2.16-6.03-7.78V4.58h3.49v20.47c0,3.24.52,4.29,2.55,4.29s2.55-1.05,2.55-4.29V4.58h3.49v20.47Zm13.88,0c0,6.03-2.34,7.43-7.95,7.43h-4.19V4.58h4.19c5.62,0,7.95,1.33,7.95,7.43v13.04Zm5.33,7.43h-3.49V4.58h3.49v27.9Zm13.81-7.43c0,5.62-1.99,7.78-6.03,7.78s-6.03-2.16-6.03-7.78v-13.04c0-5.62,1.99-7.78,6.03-7.78s6.03,2.16,6.03,7.78v13.04Z"
818
- }));
813
+ className: className,
814
+ children: [/*#__PURE__*/jsx("path", {
815
+ fill: color,
816
+ d: "m34.3.69v55.55h-10.42v-23.82l-4.31,23.82h-4.86l-4.31-23.82v23.82H0V.69h10.42l6.74,32.08L23.89.69h10.42Z"
817
+ }), /*#__PURE__*/jsx("path", {
818
+ fill: color,
819
+ d: "m46.8.69v55.55h-10.42V.69h10.42Z"
820
+ }), /*#__PURE__*/jsx("path", {
821
+ fill: color,
822
+ d: "m64.57,16.53c0-4.72-.35-6.11-2.64-6.11s-2.64,1.39-2.64,6.11v23.89c0,4.72.35,6.11,2.64,6.11s2.64-1.39,2.64-6.11v-6.74h10.42v7.43c0,11.18-4.65,15.83-13.05,15.83s-13.05-4.65-13.05-15.83V15.83c0-11.18,4.65-15.83,13.05-15.83s13.05,4.65,13.05,15.83v7.43h-10.42v-6.74Z"
823
+ }), /*#__PURE__*/jsx("path", {
824
+ fill: color,
825
+ d: "m104.08,56.24h-10.42c-.69-.83-.76-2.85-.76-4.93v-10.69c0-4.03-1.39-4.72-5.42-4.72v20.35h-10.42V.69h10.42c11.87,0,15.83,3.96,15.83,15.14v4.93c0,6.11-1.87,10.07-5.14,12.43,3.54,1.46,5.14,4.31,5.14,9.51v8.61c0,2.08.07,4.1.76,4.93Zm-16.6-45.13v14.37c4.03,0,5.42-.69,5.42-4.72v-4.93c0-4.03-1.39-4.72-5.42-4.72Z"
826
+ }), /*#__PURE__*/jsx("path", {
827
+ fill: color,
828
+ d: "m173.63.69v55.55h-10.42v-23.82l-4.31,23.82h-4.86l-4.31-23.82v23.82h-10.42V.69h10.42l6.74,32.08L163.22.69h10.42Z"
829
+ }), /*#__PURE__*/jsx("path", {
830
+ fill: color,
831
+ d: "m191.68,46.8h-5.49l-.76,9.44h-10.42L181.82.69h14.23l6.81,55.55h-10.42l-.76-9.44Zm-.83-10.42l-1.87-24.65-1.94,24.65h3.82Z"
832
+ }), /*#__PURE__*/jsx("path", {
833
+ fill: color,
834
+ d: "m219.25,23.26v-6.74c0-4.72-.42-6.11-2.64-6.11s-2.64,1.39-2.64,6.11v23.89c0,4.72.35,6.11,2.64,6.11s2.64-1.39,2.64-6.11v-2.57h-2.64v-10.42h13.05v28.82h-4.17l-1.67-3.96c-2.15,2.71-5.07,4.65-8.82,4.65-7.5,0-11.46-4.65-11.46-15.83V15.83c0-11.18,4.65-15.83,13.05-15.83s13.05,4.65,13.05,15.83v7.43h-10.42Z"
835
+ }), /*#__PURE__*/jsx("rect", {
836
+ fill: color,
837
+ x: "105.65",
838
+ y: ".69",
839
+ width: "31.25",
840
+ height: "55.55",
841
+ rx: "3",
842
+ ry: "3"
843
+ }), /*#__PURE__*/jsx("path", {
844
+ fill: color,
845
+ d: "m304.96,7.72c-2.02,0-2.55,1.05-2.55,4.29v13.04c0,3.24.52,4.29,2.55,4.29s2.55-1.05,2.55-4.29v-13.04c0-3.24-.52-4.29-2.55-4.29Z"
846
+ }), /*#__PURE__*/jsx("path", {
847
+ fill: color,
848
+ d: "m283.9,8.07h-.7v20.93h.7c3.42,0,4.46-.52,4.46-3.94v-13.04c0-3.42-1.05-3.94-4.46-3.94Z"
849
+ }), /*#__PURE__*/jsx("path", {
850
+ fill: color,
851
+ d: "m313.68.68h-75.86c-1.15,0-2.08.93-2.08,2.08v31.54c0,1.15.93,2.08,2.08,2.08h75.86c1.15,0,2.08-.93,2.08-2.08V2.76c0-1.15-.93-2.08-2.08-2.08Zm-67,32.15c-4.53,0-6.31-2.34-6.31-9.87h3.49c0,5.34.77,6.38,2.83,6.38,1.64,0,2.27-.84,2.27-3.77s-.98-4.19-3.56-6.21c-2.48-1.92-4.85-3.84-4.85-8.41,0-4.12,1.74-6.73,5.79-6.73s5.93,2.62,5.93,8.48h-3.49c0-4.19-.94-4.99-2.44-4.99s-2.3.8-2.3,3.24,1.22,3.77,3.28,5.34c2.96,2.27,5.13,4.22,5.13,9.28,0,4.6-1.67,7.25-5.75,7.25Zm17.82-24.76h-3.94v24.41h-3.49V8.07h-3.94v-3.49h11.37v3.49Zm13.46,16.99c0,5.62-1.99,7.78-6.03,7.78s-6.03-2.16-6.03-7.78V4.58h3.49v20.47c0,3.24.52,4.29,2.55,4.29s2.55-1.05,2.55-4.29V4.58h3.49v20.47Zm13.88,0c0,6.03-2.34,7.43-7.95,7.43h-4.19V4.58h4.19c5.62,0,7.95,1.33,7.95,7.43v13.04Zm5.33,7.43h-3.49V4.58h3.49v27.9Zm13.81-7.43c0,5.62-1.99,7.78-6.03,7.78s-6.03-2.16-6.03-7.78v-13.04c0-5.62,1.99-7.78,6.03-7.78s6.03,2.16,6.03,7.78v13.04Z"
852
+ })]
853
+ });
819
854
  }
820
855
 
821
856
  var styles$c = {"container":"micromag-viewer-partials-micromag-branding-container","link":"micromag-viewer-partials-micromag-branding-link","text":"micromag-viewer-partials-micromag-branding-text","icon":"micromag-viewer-partials-micromag-branding-icon"};
@@ -823,47 +858,51 @@ var styles$c = {"container":"micromag-viewer-partials-micromag-branding-containe
823
858
  function MicromagBranding(_ref) {
824
859
  var _ref$className = _ref.className,
825
860
  className = _ref$className === void 0 ? null : _ref$className;
826
- return /*#__PURE__*/React.createElement("div", {
827
- className: classNames([styles$c.container, className])
828
- }, /*#__PURE__*/React.createElement("a", {
829
- href: "https://micromag.media",
830
- target: "_blank",
831
- rel: "noopener noreferrer",
832
- className: styles$c.link
833
- }, /*#__PURE__*/React.createElement("span", {
834
- className: styles$c.text
835
- }, /*#__PURE__*/React.createElement(FormattedMessage, {
836
- id: "LiMAIC",
837
- defaultMessage: [{
838
- "type": 0,
839
- "value": "This Micromag was"
840
- }]
841
- }), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement(FormattedMessage, {
842
- id: "TDAOl2",
843
- defaultMessage: [{
844
- "type": 0,
845
- "value": "created with"
846
- }]
847
- })), /*#__PURE__*/React.createElement(MicromagIcon, {
848
- className: styles$c.icon
849
- })));
861
+ return /*#__PURE__*/jsx("div", {
862
+ className: classNames([styles$c.container, className]),
863
+ children: /*#__PURE__*/jsxs("a", {
864
+ href: "https://micromag.media",
865
+ target: "_blank",
866
+ rel: "noopener noreferrer",
867
+ className: styles$c.link,
868
+ children: [/*#__PURE__*/jsxs("span", {
869
+ className: styles$c.text,
870
+ children: [/*#__PURE__*/jsx(FormattedMessage, {
871
+ id: "LiMAIC",
872
+ defaultMessage: [{
873
+ "type": 0,
874
+ "value": "This Micromag was"
875
+ }]
876
+ }), /*#__PURE__*/jsx("br", {}), /*#__PURE__*/jsx(FormattedMessage, {
877
+ id: "TDAOl2",
878
+ defaultMessage: [{
879
+ "type": 0,
880
+ "value": "created with"
881
+ }]
882
+ })]
883
+ }), /*#__PURE__*/jsx(MicromagIcon, {
884
+ className: styles$c.icon
885
+ })]
886
+ })
887
+ });
850
888
  }
851
889
 
852
890
  function StackIcon(_ref) {
853
891
  var _ref$className = _ref.className,
854
892
  className = _ref$className === void 0 ? null : _ref$className;
855
- return /*#__PURE__*/React.createElement("svg", {
893
+ return /*#__PURE__*/jsxs("svg", {
856
894
  xmlns: "http://www.w3.org/2000/svg",
857
895
  width: "11.5px",
858
896
  height: "17.5px",
859
897
  viewBox: "0 0 11.5 17.5",
860
- className: classNames([className])
861
- }, /*#__PURE__*/React.createElement("rect", {
862
- width: "10",
863
- height: "16"
864
- }), /*#__PURE__*/React.createElement("polygon", {
865
- points: "10.5 1.5 10.5 16.5 1.5 16.5 1.5 17.5 11.5 17.5 11.5 1.5 10.5 1.5"
866
- }));
898
+ className: classNames([className]),
899
+ children: [/*#__PURE__*/jsx("rect", {
900
+ width: "10",
901
+ height: "16"
902
+ }), /*#__PURE__*/jsx("polygon", {
903
+ points: "10.5 1.5 10.5 16.5 1.5 16.5 1.5 17.5 11.5 17.5 11.5 1.5 10.5 1.5"
904
+ })]
905
+ });
867
906
  }
868
907
 
869
908
  var styles$b = {"container":"micromag-viewer-menus-menu-screen-container","button":"micromag-viewer-menus-menu-screen-button","isCurrent":"micromag-viewer-menus-menu-screen-isCurrent","inner":"micromag-viewer-menus-menu-screen-inner","subScreenBadge":"micromag-viewer-menus-menu-screen-subScreenBadge","subScreenCount":"micromag-viewer-menus-menu-screen-subScreenCount","subScreenIcon":"micromag-viewer-menus-menu-screen-subScreenIcon","screen":"micromag-viewer-menus-menu-screen-screen"};
@@ -918,43 +957,47 @@ function ViewerMenuScreen(_ref) {
918
957
  "value": "(current screen)"
919
958
  }]
920
959
  })) : '');
921
- return /*#__PURE__*/React.createElement("div", {
960
+ return /*#__PURE__*/jsxs("div", {
922
961
  className: classNames([styles$b.container, className, _defineProperty({}, styles$b.isCurrent, current)]),
923
962
  style: {
924
963
  paddingBottom: "".concat(screenHeight / screenWidth * 100, "%")
925
964
  },
926
- ref: refVisible
927
- }, /*#__PURE__*/React.createElement("button", {
928
- type: "button",
929
- className: styles$b.button,
930
- onClick: function onClick() {
931
- var e = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
932
- if (e !== null) {
933
- e.stopPropagation();
934
- }
935
- if (_onClick !== null) {
936
- _onClick(item);
937
- }
938
- },
939
- "aria-label": screenAriaLabel,
940
- tabIndex: focusable ? '0' : '-1'
941
- }), /*#__PURE__*/React.createElement("div", {
942
- className: styles$b.inner
943
- }, count > 1 ? /*#__PURE__*/React.createElement("div", {
944
- className: styles$b.subScreenBadge
945
- }, /*#__PURE__*/React.createElement("span", {
946
- className: styles$b.subScreenCount
947
- }, count), /*#__PURE__*/React.createElement(StackIcon, {
948
- className: styles$b.subScreenIcon
949
- })) : null, screenWidth > 0 && screenHeight > 0 && (visible || alwaysRender) ? /*#__PURE__*/React.createElement(ScreenPreview, {
950
- className: styles$b.screen,
951
- screenWidth: screenWidth,
952
- screenHeight: screenHeight,
953
- screen: screen,
954
- focusable: focusable,
955
- active: focusable,
956
- withSize: true
957
- }) : null));
965
+ ref: refVisible,
966
+ children: [/*#__PURE__*/jsx("button", {
967
+ type: "button",
968
+ className: styles$b.button,
969
+ onClick: function onClick() {
970
+ var e = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
971
+ if (e !== null) {
972
+ e.stopPropagation();
973
+ }
974
+ if (_onClick !== null) {
975
+ _onClick(item);
976
+ }
977
+ },
978
+ "aria-label": screenAriaLabel,
979
+ tabIndex: focusable ? '0' : '-1'
980
+ }), /*#__PURE__*/jsxs("div", {
981
+ className: styles$b.inner,
982
+ children: [count > 1 ? /*#__PURE__*/jsxs("div", {
983
+ className: styles$b.subScreenBadge,
984
+ children: [/*#__PURE__*/jsx("span", {
985
+ className: styles$b.subScreenCount,
986
+ children: count
987
+ }), /*#__PURE__*/jsx(StackIcon, {
988
+ className: styles$b.subScreenIcon
989
+ })]
990
+ }) : null, screenWidth > 0 && screenHeight > 0 && (visible || alwaysRender) ? /*#__PURE__*/jsx(ScreenPreview, {
991
+ className: styles$b.screen,
992
+ screenWidth: screenWidth,
993
+ screenHeight: screenHeight,
994
+ screen: screen,
995
+ focusable: focusable,
996
+ active: focusable,
997
+ withSize: true
998
+ }) : null]
999
+ })]
1000
+ });
958
1001
  }
959
1002
 
960
1003
  var styles$a = {"container":"micromag-viewer-menus-menu-preview-container","content":"micromag-viewer-menus-menu-preview-content","scroll":"micromag-viewer-menus-menu-preview-scroll","scrollee":"micromag-viewer-menus-menu-preview-scrollee","titleContainer":"micromag-viewer-menus-menu-preview-titleContainer","headerContainer":"micromag-viewer-menus-menu-preview-headerContainer","title":"micromag-viewer-menus-menu-preview-title","nav":"micromag-viewer-menus-menu-preview-nav","items":"micromag-viewer-menus-menu-preview-items","item":"micromag-viewer-menus-menu-preview-item","inner":"micromag-viewer-menus-menu-preview-inner","frame":"micromag-viewer-menus-menu-preview-frame","screen":"micromag-viewer-menus-menu-preview-screen","micromagBrandingSeparator":"micromag-viewer-menus-menu-preview-micromagBrandingSeparator","micromagBrandingContainer":"micromag-viewer-menus-menu-preview-micromagBrandingContainer"};
@@ -1031,72 +1074,84 @@ function ViewerMenuPreview(_ref) {
1031
1074
  // );
1032
1075
 
1033
1076
  var menuPaddingTop = paddingTop + 10;
1034
- return /*#__PURE__*/React.createElement("div", {
1077
+ return /*#__PURE__*/jsx("div", {
1035
1078
  className: classNames([styles$a.container, className]),
1036
1079
  style: _objectSpread(_objectSpread({}, brandImageStyle), {}, {
1037
1080
  width: menuWidth
1038
1081
  }),
1039
- "aria-hidden": focusable ? null : 'true'
1040
- }, /*#__PURE__*/React.createElement("div", {
1041
- className: styles$a.content,
1042
- ref: containerRef
1043
- }, /*#__PURE__*/React.createElement(Scroll, {
1044
- className: styles$a.scroll,
1045
- scrolleeClassName: styles$a.scrollee,
1046
- disabled: scrollDisabled
1047
- }, hasTitle && header === null ? /*#__PURE__*/React.createElement("div", {
1048
- className: styles$a.titleContainer,
1049
- style: {
1050
- paddingTop: menuPaddingTop
1051
- }
1052
- }, /*#__PURE__*/React.createElement("h1", {
1053
- className: styles$a.title,
1054
- style: _objectSpread({}, finalTitleStyles)
1055
- }, title)) : /*#__PURE__*/React.createElement("div", {
1056
- className: styles$a.headerContainer,
1057
- style: {
1058
- paddingTop: menuPaddingTop
1059
- }
1060
- }, header), /*#__PURE__*/React.createElement("nav", {
1061
- className: styles$a.nav,
1062
- style: !hasTitle ? {
1063
- paddingTop: paddingTop
1064
- } : null
1065
- }, /*#__PURE__*/React.createElement("ul", {
1066
- className: styles$a.items
1067
- }, items.map(function (item, index) {
1068
- var _ref7 = item || {},
1069
- screenId = _ref7.screenId;
1070
- var itemStyles = {
1071
- width: "".concat(100 / thumbsPerLine, "%")
1072
- };
1073
- var _ref8 = screenSize || {},
1074
- screenWidth = _ref8.width,
1075
- screenHeight = _ref8.height;
1076
- return /*#__PURE__*/React.createElement("li", {
1077
- key: "item-".concat(screenId),
1078
- className: styles$a.item,
1079
- style: itemStyles
1080
- }, /*#__PURE__*/React.createElement("div", {
1081
- className: styles$a.inner
1082
- }, /*#__PURE__*/React.createElement("div", {
1083
- className: classNames([styles$a.frame, _defineProperty({}, styles$a.isLoading, false)]),
1084
- style: {
1085
- paddingBottom: "".concat(screenHeight / screenWidth * 100, "%")
1086
- }
1087
- }, /*#__PURE__*/React.createElement(ViewerMenuScreen, {
1088
- className: styles$a.screen,
1089
- item: item,
1090
- index: index,
1091
- screenSize: screenSize,
1092
- onClick: onClickScreen,
1093
- focusable: focusable
1094
- }))));
1095
- }))), footer, withMicromagBranding ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
1096
- className: styles$a.micromagBrandingSeparator
1097
- }), /*#__PURE__*/React.createElement(MicromagBranding, {
1098
- className: styles$a.micromagBrandingContainer
1099
- })) : null)));
1082
+ "aria-hidden": focusable ? null : 'true',
1083
+ children: /*#__PURE__*/jsx("div", {
1084
+ className: styles$a.content,
1085
+ ref: containerRef,
1086
+ children: /*#__PURE__*/jsxs(Scroll, {
1087
+ className: styles$a.scroll,
1088
+ scrolleeClassName: styles$a.scrollee,
1089
+ disabled: scrollDisabled,
1090
+ children: [hasTitle && header === null ? /*#__PURE__*/jsx("div", {
1091
+ className: styles$a.titleContainer,
1092
+ style: {
1093
+ paddingTop: menuPaddingTop
1094
+ },
1095
+ children: /*#__PURE__*/jsx("h1", {
1096
+ className: styles$a.title,
1097
+ style: _objectSpread({}, finalTitleStyles),
1098
+ children: title
1099
+ })
1100
+ }) : /*#__PURE__*/jsx("div", {
1101
+ className: styles$a.headerContainer,
1102
+ style: {
1103
+ paddingTop: menuPaddingTop
1104
+ },
1105
+ children: header
1106
+ }), /*#__PURE__*/jsx("nav", {
1107
+ className: styles$a.nav,
1108
+ style: !hasTitle ? {
1109
+ paddingTop: paddingTop
1110
+ } : null,
1111
+ children: /*#__PURE__*/jsx("ul", {
1112
+ className: styles$a.items,
1113
+ children: items.map(function (item, index) {
1114
+ var _ref7 = item || {},
1115
+ screenId = _ref7.screenId;
1116
+ var itemStyles = {
1117
+ width: "".concat(100 / thumbsPerLine, "%")
1118
+ };
1119
+ var _ref8 = screenSize || {},
1120
+ screenWidth = _ref8.width,
1121
+ screenHeight = _ref8.height;
1122
+ return /*#__PURE__*/jsx("li", {
1123
+ className: styles$a.item,
1124
+ style: itemStyles,
1125
+ children: /*#__PURE__*/jsx("div", {
1126
+ className: styles$a.inner,
1127
+ children: /*#__PURE__*/jsx("div", {
1128
+ className: classNames([styles$a.frame, _defineProperty({}, styles$a.isLoading, false)]),
1129
+ style: {
1130
+ paddingBottom: "".concat(screenHeight / screenWidth * 100, "%")
1131
+ },
1132
+ children: /*#__PURE__*/jsx(ViewerMenuScreen, {
1133
+ className: styles$a.screen,
1134
+ item: item,
1135
+ index: index,
1136
+ screenSize: screenSize,
1137
+ onClick: onClickScreen,
1138
+ focusable: focusable
1139
+ })
1140
+ })
1141
+ })
1142
+ }, "item-".concat(screenId));
1143
+ })
1144
+ })
1145
+ }), footer, withMicromagBranding ? /*#__PURE__*/jsxs(Fragment, {
1146
+ children: [/*#__PURE__*/jsx("div", {
1147
+ className: styles$a.micromagBrandingSeparator
1148
+ }), /*#__PURE__*/jsx(MicromagBranding, {
1149
+ className: styles$a.micromagBrandingContainer
1150
+ })]
1151
+ }) : null]
1152
+ })
1153
+ })
1154
+ });
1100
1155
  }
1101
1156
 
1102
1157
  var styles$9 = {"container":"micromag-viewer-partials-micromag-preview-container","title":"micromag-viewer-partials-micromag-preview-title","cover":"micromag-viewer-partials-micromag-preview-cover","info":"micromag-viewer-partials-micromag-preview-info","url":"micromag-viewer-partials-micromag-preview-url"};
@@ -1112,22 +1167,29 @@ function MicromagPreview(_ref) {
1112
1167
  description = _ref$description === void 0 ? null : _ref$description,
1113
1168
  _ref$className = _ref.className,
1114
1169
  className = _ref$className === void 0 ? null : _ref$className;
1115
- return /*#__PURE__*/React.createElement("div", {
1116
- className: classNames([styles$9.container, className])
1117
- }, /*#__PURE__*/React.createElement("div", {
1118
- className: styles$9.cover
1119
- }, /*#__PURE__*/React.createElement(ScreenPreview, {
1120
- screen: screen,
1121
- width: 100,
1122
- height: 150,
1123
- withSize: true
1124
- })), /*#__PURE__*/React.createElement("div", {
1125
- className: styles$9.info
1126
- }, /*#__PURE__*/React.createElement("h3", {
1127
- className: styles$9.title
1128
- }, title), url ? /*#__PURE__*/React.createElement("div", {
1129
- className: styles$9.url
1130
- }, url) : null, /*#__PURE__*/React.createElement("p", null, description)));
1170
+ return /*#__PURE__*/jsxs("div", {
1171
+ className: classNames([styles$9.container, className]),
1172
+ children: [/*#__PURE__*/jsx("div", {
1173
+ className: styles$9.cover,
1174
+ children: /*#__PURE__*/jsx(ScreenPreview, {
1175
+ screen: screen,
1176
+ width: 100,
1177
+ height: 150,
1178
+ withSize: true
1179
+ })
1180
+ }), /*#__PURE__*/jsxs("div", {
1181
+ className: styles$9.info,
1182
+ children: [/*#__PURE__*/jsx("h3", {
1183
+ className: styles$9.title,
1184
+ children: title
1185
+ }), url ? /*#__PURE__*/jsx("div", {
1186
+ className: styles$9.url,
1187
+ children: url
1188
+ }) : null, /*#__PURE__*/jsx("p", {
1189
+ children: description
1190
+ })]
1191
+ })]
1192
+ });
1131
1193
  }
1132
1194
 
1133
1195
  var styles$8 = {"container":"micromag-viewer-menus-menu-share-container","content":"micromag-viewer-menus-menu-share-content","scroll":"micromag-viewer-menus-menu-share-scroll","inner":"micromag-viewer-menus-menu-share-inner","header":"micromag-viewer-menus-menu-share-header","mode":"micromag-viewer-menus-menu-share-mode","options":"micromag-viewer-menus-menu-share-options"};
@@ -1201,55 +1263,63 @@ function ViewerMenuShare(_ref) {
1201
1263
  var finalShareUrl = useMemo(function () {
1202
1264
  return shareCurrentScreen && currentScreenIndex !== 0 ? "".concat(shareUrl, "/").concat(currentScreenIndex + 1) : shareUrl;
1203
1265
  }, [shareUrl, shareCurrentScreen, currentScreenIndex]);
1204
- return /*#__PURE__*/React.createElement("div", {
1266
+ return /*#__PURE__*/jsx("div", {
1205
1267
  className: classNames([styles$8.container, className]),
1206
1268
  style: _objectSpread(_objectSpread({}, brandImageStyle), {}, {
1207
1269
  width: menuWidth
1208
1270
  }),
1209
- "aria-hidden": focusable ? null : 'true'
1210
- }, /*#__PURE__*/React.createElement("div", {
1211
- className: styles$8.content
1212
- }, /*#__PURE__*/React.createElement(Scroll, {
1213
- className: styles$8.scroll
1214
- }, /*#__PURE__*/React.createElement("div", {
1215
- className: styles$8.inner,
1216
- style: {
1217
- paddingTop: paddingTop
1218
- }
1219
- }, /*#__PURE__*/React.createElement("div", {
1220
- className: styles$8.header
1221
- }, /*#__PURE__*/React.createElement(MicromagPreview, {
1222
- className: styles$8.preview,
1223
- screen: shareCurrentScreen ? currentScreen : coverScreen,
1224
- title: title,
1225
- url: finalShareUrl,
1226
- description: description
1227
- }), currentScreenIndex !== 0 ? /*#__PURE__*/React.createElement("div", {
1228
- className: styles$8.mode
1229
- }, /*#__PURE__*/React.createElement("label", null, /*#__PURE__*/React.createElement("input", {
1230
- type: "checkbox",
1231
- name: "currentScreen",
1232
- value: "currentScreen",
1233
- onChange: onShareModeChange,
1234
- checked: shareCurrentScreen
1235
- }), /*#__PURE__*/React.createElement(FormattedMessage, {
1236
- id: "xuPbeq",
1237
- defaultMessage: [{
1238
- "type": 0,
1239
- "value": "Start from the current screen"
1240
- }]
1241
- }))) : null), /*#__PURE__*/React.createElement(ShareOptions, {
1242
- className: styles$8.options,
1243
- itemClassName: styles$8.optionItem,
1244
- buttonClassName: styles$8.optionButton,
1245
- title: title,
1246
- options: shareOptions,
1247
- url: finalShareUrl,
1248
- focusable: focusable,
1249
- onShare: onShare,
1250
- theme: viewerTheme,
1251
- shareCurrentScreen: shareCurrentScreen
1252
- })))));
1271
+ "aria-hidden": focusable ? null : 'true',
1272
+ children: /*#__PURE__*/jsx("div", {
1273
+ className: styles$8.content,
1274
+ children: /*#__PURE__*/jsx(Scroll, {
1275
+ className: styles$8.scroll,
1276
+ children: /*#__PURE__*/jsxs("div", {
1277
+ className: styles$8.inner,
1278
+ style: {
1279
+ paddingTop: paddingTop
1280
+ },
1281
+ children: [/*#__PURE__*/jsxs("div", {
1282
+ className: styles$8.header,
1283
+ children: [/*#__PURE__*/jsx(MicromagPreview, {
1284
+ className: styles$8.preview,
1285
+ screen: shareCurrentScreen ? currentScreen : coverScreen,
1286
+ title: title,
1287
+ url: finalShareUrl,
1288
+ description: description
1289
+ }), currentScreenIndex !== 0 ? /*#__PURE__*/jsx("div", {
1290
+ className: styles$8.mode,
1291
+ children: /*#__PURE__*/jsxs("label", {
1292
+ children: [/*#__PURE__*/jsx("input", {
1293
+ type: "checkbox",
1294
+ name: "currentScreen",
1295
+ value: "currentScreen",
1296
+ onChange: onShareModeChange,
1297
+ checked: shareCurrentScreen
1298
+ }), /*#__PURE__*/jsx(FormattedMessage, {
1299
+ id: "xuPbeq",
1300
+ defaultMessage: [{
1301
+ "type": 0,
1302
+ "value": "Start from the current screen"
1303
+ }]
1304
+ })]
1305
+ })
1306
+ }) : null]
1307
+ }), /*#__PURE__*/jsx(ShareOptions, {
1308
+ className: styles$8.options,
1309
+ itemClassName: styles$8.optionItem,
1310
+ buttonClassName: styles$8.optionButton,
1311
+ title: title,
1312
+ options: shareOptions,
1313
+ url: finalShareUrl,
1314
+ focusable: focusable,
1315
+ onShare: onShare,
1316
+ theme: viewerTheme,
1317
+ shareCurrentScreen: shareCurrentScreen
1318
+ })]
1319
+ })
1320
+ })
1321
+ })
1322
+ });
1253
1323
  }
1254
1324
 
1255
1325
  var styles$7 = {"container":"micromag-viewer-container","landscape":"micromag-viewer-landscape","screensFrame":"micromag-viewer-screensFrame","hideMenu":"micromag-viewer-hideMenu","menuNavContainer":"micromag-viewer-menuNavContainer","menuTopContainer":"micromag-viewer-menuTopContainer","dots":"micromag-viewer-dots","disableMenu":"micromag-viewer-disableMenu","content":"micromag-viewer-content","withoutGestures":"micromag-viewer-withoutGestures","ariaAnnouncement":"micromag-viewer-ariaAnnouncement","accessibilityLinks":"micromag-viewer-accessibilityLinks","accessibilityButton":"micromag-viewer-accessibilityButton","disabled":"micromag-viewer-disabled","tooltip":"micromag-viewer-tooltip","fadeMenu":"micromag-viewer-fadeMenu","withShadow":"micromag-viewer-withShadow","isOpened":"micromag-viewer-isOpened","menuItem":"micromag-viewer-menuItem","menuButton":"micromag-viewer-menuButton","slidingButton":"micromag-viewer-slidingButton","screensMenuButtonToggled":"micromag-viewer-screensMenuButtonToggled","menuContainer":"micromag-viewer-menuContainer","menuShare":"micromag-viewer-menuShare","menuPreview":"micromag-viewer-menuPreview","navButton":"micromag-viewer-navButton","previous":"micromag-viewer-previous","next":"micromag-viewer-next","screenContainer":"micromag-viewer-screenContainer","screen":"micromag-viewer-screen","preload":"micromag-viewer-preload","visible":"micromag-viewer-visible","current":"micromag-viewer-current","playbackControls":"micromag-viewer-playbackControls","navigationHint":"micromag-viewer-navigationHint","webView":"micromag-viewer-webView","shareIncentiveContainer":"micromag-viewer-shareIncentiveContainer","shareIncentive":"micromag-viewer-shareIncentive","shareIncentiveVisible":"micromag-viewer-shareIncentiveVisible"};
@@ -1558,134 +1628,148 @@ function ViewerMenu(_ref) {
1558
1628
  setMenuMounted(false);
1559
1629
  }
1560
1630
  }, [menuOpened, draggingMenu, menuMounted, setMenuMounted]);
1561
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
1562
- className: classNames([styles$7.menuNavContainer, _defineProperty(_defineProperty({}, styles$7.withShadow, withShadow), styles$7.isOpened, menuOpened || shareOpened)]),
1563
- ref: refDots,
1564
- style: {
1565
- width: menuWidth
1566
- }
1567
- }, /*#__PURE__*/React.createElement("nav", {
1568
- className: styles$7.menuTopContainer,
1569
- ref: navContainerRef
1570
- }, menuItems.map(function (item) {
1571
- if (item === 'share') {
1572
- return !withoutShareMenu || afterShareMenuButton !== null ? /*#__PURE__*/React.createElement("div", Object.assign({
1573
- className: styles$7.menuItem
1574
- }, bindShareDrag()), !withoutShareMenu ? /*#__PURE__*/React.createElement(ToggleButton, {
1575
- className: styles$7.slidingButton,
1576
- button: /*#__PURE__*/React.createElement(ShareButton, {
1577
- className: styles$7.menuButton,
1578
- onClick: onOpenShare,
1579
- theme: menuTheme,
1580
- iconPosition: "left",
1581
- focusable: !shareOpened
1582
- }),
1583
- toggledButton: /*#__PURE__*/React.createElement(FocusLock, {
1584
- group: "share",
1585
- disabled: !shareOpened,
1586
- returnFocus: true
1587
- }, /*#__PURE__*/React.createElement(CloseMenuButton, {
1588
- className: styles$7.menuButton,
1589
- onClick: onCloseShare,
1590
- theme: menuTheme,
1591
- iconPosition: "left",
1631
+ return /*#__PURE__*/jsxs(Fragment, {
1632
+ children: [/*#__PURE__*/jsxs("div", {
1633
+ className: classNames([styles$7.menuNavContainer, _defineProperty(_defineProperty({}, styles$7.withShadow, withShadow), styles$7.isOpened, menuOpened || shareOpened)]),
1634
+ ref: refDots,
1635
+ style: {
1636
+ width: menuWidth
1637
+ },
1638
+ children: [/*#__PURE__*/jsx("nav", {
1639
+ className: styles$7.menuTopContainer,
1640
+ ref: navContainerRef,
1641
+ children: menuItems.map(function (item) {
1642
+ if (item === 'share') {
1643
+ return !withoutShareMenu || afterShareMenuButton !== null ? /*#__PURE__*/jsxs("div", _objectSpread(_objectSpread({
1644
+ className: styles$7.menuItem
1645
+ }, bindShareDrag()), {}, {
1646
+ children: [!withoutShareMenu ? /*#__PURE__*/jsx(ToggleButton, {
1647
+ className: styles$7.slidingButton,
1648
+ button: /*#__PURE__*/jsx(ShareButton, {
1649
+ className: styles$7.menuButton,
1650
+ onClick: onOpenShare,
1651
+ theme: menuTheme,
1652
+ iconPosition: "left",
1653
+ focusable: !shareOpened
1654
+ }),
1655
+ toggledButton: /*#__PURE__*/jsx(FocusLock, {
1656
+ group: "share",
1657
+ disabled: !shareOpened,
1658
+ returnFocus: true,
1659
+ children: /*#__PURE__*/jsx(CloseMenuButton, {
1660
+ className: styles$7.menuButton,
1661
+ onClick: onCloseShare,
1662
+ theme: menuTheme,
1663
+ iconPosition: "left",
1664
+ focusable: shareOpened,
1665
+ single: true
1666
+ })
1667
+ }),
1668
+ progressSpring: shareOpenedProgress
1669
+ }) : null, afterShareMenuButton]
1670
+ })) : null;
1671
+ }
1672
+ if (item === 'main') {
1673
+ return !withoutScreensMenu || beforeScreensMenuButton !== null ? /*#__PURE__*/jsxs("div", _objectSpread(_objectSpread({
1674
+ className: styles$7.menuItem
1675
+ }, bindMenuDrag()), {}, {
1676
+ children: [beforeScreensMenuButton, !withoutScreensMenu ? /*#__PURE__*/jsx(ToggleButton, {
1677
+ className: styles$7.slidingButton,
1678
+ button: /*#__PURE__*/jsx(MenuButton, {
1679
+ className: styles$7.menuButton,
1680
+ iconClassName: styles$7.menuButtonIcon,
1681
+ onClick: onOpenMenu,
1682
+ theme: menuTheme,
1683
+ focusable: !menuOpened
1684
+ }),
1685
+ toggledButton: /*#__PURE__*/jsx(FocusLock, {
1686
+ group: "screens",
1687
+ disabled: !menuOpened,
1688
+ returnFocus: true,
1689
+ children: /*#__PURE__*/jsx(CloseMenuButton, {
1690
+ className: styles$7.menuButton,
1691
+ onClick: onCloseMenu,
1692
+ theme: menuTheme,
1693
+ iconPosition: "right",
1694
+ focusable: menuOpened
1695
+ })
1696
+ }),
1697
+ progressSpring: menuOpenedProgress,
1698
+ toggledButtonClassName: styles$7.screensMenuButtonToggled
1699
+ }) : null]
1700
+ })) : null;
1701
+ }
1702
+ return item || null;
1703
+ })
1704
+ }), /*#__PURE__*/jsx(ViewerMenuDots, _objectSpread(_objectSpread({}, menuTheme), {}, {
1705
+ direction: "horizontal",
1706
+ items: items,
1707
+ onClickDot: onClickScreen,
1708
+ onClickScreensMenu: onOpenMenu,
1709
+ buttons: menuDotsButtons,
1710
+ closeable: closeable,
1711
+ withItemClick: withDotItemClick,
1712
+ withoutScreensMenu: withoutScreensMenu,
1713
+ withoutShareMenu: withoutShareMenu,
1714
+ onClose: onClickCloseViewer,
1715
+ className: styles$7.dots
1716
+ }))]
1717
+ }), /*#__PURE__*/jsx(ViewerMenuContainer, {
1718
+ className: styles$7.menuContainer,
1719
+ progressSpring: shareOpenedProgress,
1720
+ theme: viewerTheme,
1721
+ children: draggingShare || shareOpened ? /*#__PURE__*/jsx(FocusLock, {
1722
+ group: "share",
1723
+ disabled: !shareOpened,
1724
+ returnFocus: true,
1725
+ children: /*#__PURE__*/jsx(ViewerMenuShare, {
1726
+ viewerTheme: viewerTheme,
1727
+ className: styles$7.menuShare,
1728
+ title: title,
1729
+ description: description,
1730
+ menuWidth: menuWidth,
1731
+ paddingTop: navContainerHeight,
1592
1732
  focusable: shareOpened,
1593
- single: true
1594
- })),
1595
- progressSpring: shareOpenedProgress
1596
- }) : null, afterShareMenuButton) : null;
1597
- }
1598
- if (item === 'main') {
1599
- return !withoutScreensMenu || beforeScreensMenuButton !== null ? /*#__PURE__*/React.createElement("div", Object.assign({
1600
- className: styles$7.menuItem
1601
- }, bindMenuDrag()), beforeScreensMenuButton, !withoutScreensMenu ? /*#__PURE__*/React.createElement(ToggleButton, {
1602
- className: styles$7.slidingButton,
1603
- button: /*#__PURE__*/React.createElement(MenuButton, {
1604
- className: styles$7.menuButton,
1605
- iconClassName: styles$7.menuButtonIcon,
1606
- onClick: onOpenMenu,
1607
- theme: menuTheme,
1608
- focusable: !menuOpened
1609
- }),
1610
- toggledButton: /*#__PURE__*/React.createElement(FocusLock, {
1611
- group: "screens",
1612
- disabled: !menuOpened,
1613
- returnFocus: true
1614
- }, /*#__PURE__*/React.createElement(CloseMenuButton, {
1615
- className: styles$7.menuButton,
1616
- onClick: onCloseMenu,
1617
- theme: menuTheme,
1618
- iconPosition: "right",
1619
- focusable: menuOpened
1620
- })),
1621
- progressSpring: menuOpenedProgress,
1622
- toggledButtonClassName: styles$7.screensMenuButtonToggled
1623
- }) : null) : null;
1624
- }
1625
- return item || null;
1626
- })), /*#__PURE__*/React.createElement(ViewerMenuDots, Object.assign({}, menuTheme, {
1627
- direction: "horizontal",
1628
- items: items,
1629
- onClickDot: onClickScreen,
1630
- onClickScreensMenu: onOpenMenu,
1631
- buttons: menuDotsButtons,
1632
- closeable: closeable,
1633
- withItemClick: withDotItemClick,
1634
- withoutScreensMenu: withoutScreensMenu,
1635
- withoutShareMenu: withoutShareMenu,
1636
- onClose: onClickCloseViewer,
1637
- className: styles$7.dots
1638
- }))), /*#__PURE__*/React.createElement(ViewerMenuContainer, {
1639
- className: styles$7.menuContainer,
1640
- progressSpring: shareOpenedProgress,
1641
- theme: viewerTheme
1642
- }, draggingShare || shareOpened ? /*#__PURE__*/React.createElement(FocusLock, {
1643
- group: "share",
1644
- disabled: !shareOpened,
1645
- returnFocus: true
1646
- }, /*#__PURE__*/React.createElement(ViewerMenuShare, {
1647
- viewerTheme: viewerTheme,
1648
- className: styles$7.menuShare,
1649
- title: title,
1650
- description: description,
1651
- menuWidth: menuWidth,
1652
- paddingTop: navContainerHeight,
1653
- focusable: shareOpened,
1654
- items: items,
1655
- shareOptions: shareOptions,
1656
- currentScreenIndex: currentScreenIndex,
1657
- shareUrl: shareUrl,
1658
- onShare: onShare,
1659
- onClose: onCloseShare
1660
- })) : null), /*#__PURE__*/React.createElement(ViewerMenuContainer, {
1661
- className: styles$7.menuContainer,
1662
- progressSpring: menuOpenedProgress,
1663
- theme: viewerTheme
1664
- }, menuMounted ? /*#__PURE__*/React.createElement(FocusLock, {
1665
- group: "screens",
1666
- disabled: !menuOpened,
1667
- returnFocus: true
1668
- }, /*#__PURE__*/React.createElement(ViewerMenuPreview, {
1669
- viewerTheme: viewerTheme,
1670
- header: previewHeader,
1671
- footer: previewFooter,
1672
- title: title,
1673
- className: styles$7.menuPreview,
1674
- screenSize: screenSize,
1675
- menuWidth: menuWidth,
1676
- paddingTop: navContainerHeight,
1677
- items: items,
1678
- currentScreenIndex: currentScreenIndex,
1679
- shareUrl: shareUrl,
1680
- onShare: onShare,
1681
- onClickScreen: onClickScreen,
1682
- onClose: onCloseMenu,
1683
- scrollDisabled: draggingMenu,
1684
- toggleFullscreen: toggleFullscreen,
1685
- fullscreenActive: fullscreenActive,
1686
- fullscreenEnabled: fullscreenEnabled,
1687
- withMicromagBranding: withMicromagBranding
1688
- })) : null));
1733
+ items: items,
1734
+ shareOptions: shareOptions,
1735
+ currentScreenIndex: currentScreenIndex,
1736
+ shareUrl: shareUrl,
1737
+ onShare: onShare,
1738
+ onClose: onCloseShare
1739
+ })
1740
+ }) : null
1741
+ }), /*#__PURE__*/jsx(ViewerMenuContainer, {
1742
+ className: styles$7.menuContainer,
1743
+ progressSpring: menuOpenedProgress,
1744
+ theme: viewerTheme,
1745
+ children: menuMounted ? /*#__PURE__*/jsx(FocusLock, {
1746
+ group: "screens",
1747
+ disabled: !menuOpened,
1748
+ returnFocus: true,
1749
+ children: /*#__PURE__*/jsx(ViewerMenuPreview, {
1750
+ viewerTheme: viewerTheme,
1751
+ header: previewHeader,
1752
+ footer: previewFooter,
1753
+ title: title,
1754
+ className: styles$7.menuPreview,
1755
+ screenSize: screenSize,
1756
+ menuWidth: menuWidth,
1757
+ paddingTop: navContainerHeight,
1758
+ items: items,
1759
+ currentScreenIndex: currentScreenIndex,
1760
+ shareUrl: shareUrl,
1761
+ onShare: onShare,
1762
+ onClickScreen: onClickScreen,
1763
+ onClose: onCloseMenu,
1764
+ scrollDisabled: draggingMenu,
1765
+ toggleFullscreen: toggleFullscreen,
1766
+ fullscreenActive: fullscreenActive,
1767
+ fullscreenEnabled: fullscreenEnabled,
1768
+ withMicromagBranding: withMicromagBranding
1769
+ })
1770
+ }) : null
1771
+ })]
1772
+ });
1689
1773
  }
1690
1774
 
1691
1775
  var styles$6 = {"container":"micromag-viewer-screen-container","inner":"micromag-viewer-screen-inner"};
@@ -1735,27 +1819,29 @@ function ViewerScreen(_ref) {
1735
1819
  if (!mounted && !current) {
1736
1820
  return null;
1737
1821
  }
1738
- return /*#__PURE__*/React.createElement("div", {
1739
- className: classNames([styles$6.container, className])
1740
- }, /*#__PURE__*/React.createElement("div", {
1741
- className: styles$6.inner,
1742
- style: {
1743
- width: width,
1744
- height: height,
1745
- transform: scale !== null ? "scale(".concat(scale, ")") : null,
1746
- transformOrigin: scale !== null ? '0 0' : null,
1747
- opacity: mounted ? 1 : null
1748
- }
1749
- }, mounted || current ? /*#__PURE__*/React.createElement(Screen, {
1750
- screen: screen,
1751
- renderContext: renderContext,
1752
- screenState: screenState,
1753
- index: index,
1754
- active: active,
1755
- preload: preload,
1756
- current: current,
1757
- mediaRef: mediaRef
1758
- }) : null));
1822
+ return /*#__PURE__*/jsx("div", {
1823
+ className: classNames([styles$6.container, className]),
1824
+ children: /*#__PURE__*/jsx("div", {
1825
+ className: styles$6.inner,
1826
+ style: {
1827
+ width: width,
1828
+ height: height,
1829
+ transform: scale !== null ? "scale(".concat(scale, ")") : null,
1830
+ transformOrigin: scale !== null ? '0 0' : null,
1831
+ opacity: mounted ? 1 : null
1832
+ },
1833
+ children: mounted || current ? /*#__PURE__*/jsx(Screen, {
1834
+ screen: screen,
1835
+ renderContext: renderContext,
1836
+ screenState: screenState,
1837
+ index: index,
1838
+ active: active,
1839
+ preload: preload,
1840
+ current: current,
1841
+ mediaRef: mediaRef
1842
+ }) : null
1843
+ })
1844
+ });
1759
1845
  }
1760
1846
 
1761
1847
  var styles$5 = {"container":"micromag-viewer-buttons-navigation-button-container","arrow":"micromag-viewer-buttons-navigation-button-arrow","next":"micromag-viewer-buttons-navigation-button-next","previous":"micromag-viewer-buttons-navigation-button-previous"};
@@ -1769,23 +1855,24 @@ function NavigationButton(_ref) {
1769
1855
  _ref$className = _ref.className,
1770
1856
  className = _ref$className === void 0 ? null : _ref$className,
1771
1857
  props = _objectWithoutProperties(_ref, _excluded$3);
1772
- return /*#__PURE__*/React.createElement(IconButton, Object.assign({
1858
+ return /*#__PURE__*/jsx(IconButton, _objectSpread({
1773
1859
  className: classNames([styles$5.container, styles$5[direction], className]),
1774
1860
  onClick: function onClick(e) {
1775
1861
  e.stopPropagation();
1776
1862
  _onClick();
1777
1863
  },
1778
1864
  iconPosition: direction === 'next' ? 'right' : 'left',
1779
- icon: /*#__PURE__*/React.createElement("svg", {
1865
+ icon: /*#__PURE__*/jsx("svg", {
1780
1866
  className: styles$5.arrow,
1781
1867
  xmlns: "http://www.w3.org/2000/svg",
1782
1868
  width: "10",
1783
1869
  height: "16",
1784
1870
  viewBox: "0 0 10 16",
1785
- fill: "currentColor"
1786
- }, /*#__PURE__*/React.createElement("polygon", {
1787
- 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"
1788
- }))
1871
+ fill: "currentColor",
1872
+ children: /*#__PURE__*/jsx("polygon", {
1873
+ 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"
1874
+ })
1875
+ })
1789
1876
  }, props));
1790
1877
  }
1791
1878
 
@@ -1796,13 +1883,15 @@ function ArrowHint(_ref) {
1796
1883
  withoutShadow = _ref$withoutShadow === void 0 ? false : _ref$withoutShadow,
1797
1884
  _ref$className = _ref.className,
1798
1885
  className = _ref$className === void 0 ? null : _ref$className;
1799
- return /*#__PURE__*/React.createElement("div", {
1800
- className: classNames([styles$4.container, className, _defineProperty({}, styles$4.withoutShadow, withoutShadow)])
1801
- }, /*#__PURE__*/React.createElement("div", {
1802
- className: styles$4.inner
1803
- }, /*#__PURE__*/React.createElement(ArrowIcon, {
1804
- className: styles$4.arrow
1805
- })));
1886
+ return /*#__PURE__*/jsx("div", {
1887
+ className: classNames([styles$4.container, className, _defineProperty({}, styles$4.withoutShadow, withoutShadow)]),
1888
+ children: /*#__PURE__*/jsx("div", {
1889
+ className: styles$4.inner,
1890
+ children: /*#__PURE__*/jsx(ArrowIcon, {
1891
+ className: styles$4.arrow
1892
+ })
1893
+ })
1894
+ });
1806
1895
  }
1807
1896
 
1808
1897
  function HandIcon(_ref) {
@@ -1810,16 +1899,17 @@ function HandIcon(_ref) {
1810
1899
  color = _ref$color === void 0 ? 'currentColor' : _ref$color,
1811
1900
  _ref$className = _ref.className,
1812
1901
  className = _ref$className === void 0 ? null : _ref$className;
1813
- return /*#__PURE__*/React.createElement("svg", {
1902
+ return /*#__PURE__*/jsx("svg", {
1814
1903
  className: className,
1815
1904
  xmlns: "http://www.w3.org/2000/svg",
1816
- viewBox: "0 0 367.24 482.87"
1817
- }, /*#__PURE__*/React.createElement("path", {
1818
- d: "M488.84,255.91a44.68,44.68,0,0,0-19.15,4.3A44.77,44.77,0,0,0,406,226.49a44.75,44.75,0,0,0-62.67-32.66V105.4a44.81,44.81,0,1,0-89.61,0V265.17l-1.15-2.7a44.78,44.78,0,1,0-82.84,34.06l64.87,157.76.34.73a156.29,156.29,0,0,0,141.42,88.44c86.7,0,157.24-70.53,157.24-157.26V300.7a44.82,44.82,0,0,0-44.78-44.79ZM507.46,386.2c0,72.3-58.78,131.1-131.07,131.1a130.29,130.29,0,0,1-117.73-73.36L193.93,286.61a18.64,18.64,0,1,1,34.53-14.07L279.91,394V105.4a18.64,18.64,0,1,1,37.28,0v196a13.08,13.08,0,0,0,26.16,0V234.56a18.64,18.64,0,0,1,37.27,0v89.95a13.07,13.07,0,1,0,26.13,0V266.86a18.64,18.64,0,1,1,37.28,0v80.71h0s0,.08,0,.11a13.08,13.08,0,0,0,26.15,0v-47a18.63,18.63,0,1,1,37.26,0v85.5Z",
1819
- transform: "translate(-166.38 -60.59)",
1820
- fill: color,
1821
- fillRule: "evenodd"
1822
- }));
1905
+ viewBox: "0 0 367.24 482.87",
1906
+ children: /*#__PURE__*/jsx("path", {
1907
+ d: "M488.84,255.91a44.68,44.68,0,0,0-19.15,4.3A44.77,44.77,0,0,0,406,226.49a44.75,44.75,0,0,0-62.67-32.66V105.4a44.81,44.81,0,1,0-89.61,0V265.17l-1.15-2.7a44.78,44.78,0,1,0-82.84,34.06l64.87,157.76.34.73a156.29,156.29,0,0,0,141.42,88.44c86.7,0,157.24-70.53,157.24-157.26V300.7a44.82,44.82,0,0,0-44.78-44.79ZM507.46,386.2c0,72.3-58.78,131.1-131.07,131.1a130.29,130.29,0,0,1-117.73-73.36L193.93,286.61a18.64,18.64,0,1,1,34.53-14.07L279.91,394V105.4a18.64,18.64,0,1,1,37.28,0v196a13.08,13.08,0,0,0,26.16,0V234.56a18.64,18.64,0,0,1,37.27,0v89.95a13.07,13.07,0,1,0,26.13,0V266.86a18.64,18.64,0,1,1,37.28,0v80.71h0s0,.08,0,.11a13.08,13.08,0,0,0,26.15,0v-47a18.63,18.63,0,1,1,37.26,0v85.5Z",
1908
+ transform: "translate(-166.38 -60.59)",
1909
+ fill: color,
1910
+ fillRule: "evenodd"
1911
+ })
1912
+ });
1823
1913
  }
1824
1914
 
1825
1915
  var styles$3 = {"container":"micromag-viewer-partials-hand-tap-container","circle":"micromag-viewer-partials-hand-tap-circle","hand":"micromag-viewer-partials-hand-tap-hand","withoutShadow":"micromag-viewer-partials-hand-tap-withoutShadow","inner":"micromag-viewer-partials-hand-tap-inner"};
@@ -1829,15 +1919,17 @@ function HandTap(_ref) {
1829
1919
  withoutShadow = _ref$withoutShadow === void 0 ? false : _ref$withoutShadow,
1830
1920
  _ref$className = _ref.className,
1831
1921
  className = _ref$className === void 0 ? null : _ref$className;
1832
- return /*#__PURE__*/React.createElement("div", {
1833
- className: classNames([styles$3.container, className, _defineProperty({}, styles$3.withoutShadow, withoutShadow)])
1834
- }, /*#__PURE__*/React.createElement("div", {
1835
- className: styles$3.inner
1836
- }, /*#__PURE__*/React.createElement("div", {
1837
- className: styles$3.circle
1838
- }), /*#__PURE__*/React.createElement(HandIcon, {
1839
- className: styles$3.hand
1840
- })));
1922
+ return /*#__PURE__*/jsx("div", {
1923
+ className: classNames([styles$3.container, className, _defineProperty({}, styles$3.withoutShadow, withoutShadow)]),
1924
+ children: /*#__PURE__*/jsxs("div", {
1925
+ className: styles$3.inner,
1926
+ children: [/*#__PURE__*/jsx("div", {
1927
+ className: styles$3.circle
1928
+ }), /*#__PURE__*/jsx(HandIcon, {
1929
+ className: styles$3.hand
1930
+ })]
1931
+ })
1932
+ });
1841
1933
  }
1842
1934
 
1843
1935
  var styles$2 = {"inner":"micromag-viewer-partials-seek-bar-inner","progressBarContainer":"micromag-viewer-partials-seek-bar-progressBarContainer","progressBar":"micromag-viewer-partials-seek-bar-progressBar","progress":"micromag-viewer-partials-seek-bar-progress","track":"micromag-viewer-partials-seek-bar-track","playHead":"micromag-viewer-partials-seek-bar-playHead","withSeekHead":"micromag-viewer-partials-seek-bar-withSeekHead","scrubbedTime":"micromag-viewer-partials-seek-bar-scrubbedTime","showTimestamp":"micromag-viewer-partials-seek-bar-showTimestamp"};
@@ -1957,74 +2049,80 @@ function SeekBar(_ref3) {
1957
2049
  filterTaps: true
1958
2050
  }
1959
2051
  });
1960
- return /*#__PURE__*/React.createElement("div", Object.assign({
2052
+ return /*#__PURE__*/jsx("div", _objectSpread(_objectSpread({
1961
2053
  className: classNames([styles$2.container, className, _defineProperty(_defineProperty({}, styles$2.withSeekHead, withSeekHead), styles$2.showTimestamp, showTimestamp)])
1962
- }, stopDragEventsPropagation), /*#__PURE__*/React.createElement("div", {
1963
- className: styles$2.inner
1964
- }, /*#__PURE__*/React.createElement("div", {
1965
- className: styles$2.progressBarContainer
1966
- }, /*#__PURE__*/React.createElement("div", {
1967
- className: styles$2.progressBar,
1968
- style: {
1969
- backgroundColor: backgroundColor
1970
- }
1971
- }), /*#__PURE__*/React.createElement("div", {
1972
- className: styles$2.playHead,
1973
- style: {
1974
- left: "".concat(progress * 100, "%"),
1975
- backgroundColor: progressColor
1976
- }
1977
- }, /*#__PURE__*/React.createElement("div", {
1978
- className: styles$2.scrubbedTime,
1979
- style: {
1980
- borderColor: progressColor
1981
- }
1982
- }, getFormattedTimestamp(currentTime, duration < SHOW_MILLISECONDS_THRESHOLD))), /*#__PURE__*/React.createElement("div", {
1983
- className: styles$2.progress,
1984
- style: {
1985
- transform: "scaleX(".concat(progress, ")"),
1986
- backgroundColor: progressColor
1987
- }
1988
- })), /*#__PURE__*/React.createElement("button", Object.assign({}, bind(), {
1989
- type: "button",
1990
- role: "slider",
1991
- "aria-valuemin": 0,
1992
- "aria-valuemax": 100,
1993
- "aria-valuenow": progress,
1994
- "aria-valuetext": intl.formatMessage({
1995
- id: "C1VUEY",
1996
- defaultMessage: [{
1997
- "type": 1,
1998
- "value": "current"
1999
- }, {
2000
- "type": 0,
2001
- "value": " of "
2002
- }, {
2003
- "type": 1,
2004
- "value": "duration"
2005
- }]
2006
- }, {
2007
- current: getFormattedTimestamp(currentTime, duration < SHOW_MILLISECONDS_THRESHOLD),
2008
- duration: getFormattedTimestamp(duration, duration < SHOW_MILLISECONDS_THRESHOLD)
2009
- }),
2010
- "data-draggable": true,
2011
- className: styles$2.track,
2012
- title: intl.formatMessage({
2013
- id: "G1Gyjn",
2014
- defaultMessage: [{
2015
- "type": 0,
2016
- "value": "Seek"
2017
- }]
2018
- }),
2019
- "aria-label": intl.formatMessage({
2020
- id: "2prwZ7",
2021
- defaultMessage: [{
2022
- "type": 0,
2023
- "value": "Progress slider"
2024
- }]
2025
- }),
2026
- tabIndex: focusable ? '0' : '-1'
2027
- }))));
2054
+ }, stopDragEventsPropagation), {}, {
2055
+ children: /*#__PURE__*/jsxs("div", {
2056
+ className: styles$2.inner,
2057
+ children: [/*#__PURE__*/jsxs("div", {
2058
+ className: styles$2.progressBarContainer,
2059
+ children: [/*#__PURE__*/jsx("div", {
2060
+ className: styles$2.progressBar,
2061
+ style: {
2062
+ backgroundColor: backgroundColor
2063
+ }
2064
+ }), /*#__PURE__*/jsx("div", {
2065
+ className: styles$2.playHead,
2066
+ style: {
2067
+ left: "".concat(progress * 100, "%"),
2068
+ backgroundColor: progressColor
2069
+ },
2070
+ children: /*#__PURE__*/jsx("div", {
2071
+ className: styles$2.scrubbedTime,
2072
+ style: {
2073
+ borderColor: progressColor
2074
+ },
2075
+ children: getFormattedTimestamp(currentTime, duration < SHOW_MILLISECONDS_THRESHOLD)
2076
+ })
2077
+ }), /*#__PURE__*/jsx("div", {
2078
+ className: styles$2.progress,
2079
+ style: {
2080
+ transform: "scaleX(".concat(progress, ")"),
2081
+ backgroundColor: progressColor
2082
+ }
2083
+ })]
2084
+ }), /*#__PURE__*/jsx("button", _objectSpread(_objectSpread({}, bind()), {}, {
2085
+ type: "button",
2086
+ role: "slider",
2087
+ "aria-valuemin": 0,
2088
+ "aria-valuemax": 100,
2089
+ "aria-valuenow": progress,
2090
+ "aria-valuetext": intl.formatMessage({
2091
+ id: "C1VUEY",
2092
+ defaultMessage: [{
2093
+ "type": 1,
2094
+ "value": "current"
2095
+ }, {
2096
+ "type": 0,
2097
+ "value": " of "
2098
+ }, {
2099
+ "type": 1,
2100
+ "value": "duration"
2101
+ }]
2102
+ }, {
2103
+ current: getFormattedTimestamp(currentTime, duration < SHOW_MILLISECONDS_THRESHOLD),
2104
+ duration: getFormattedTimestamp(duration, duration < SHOW_MILLISECONDS_THRESHOLD)
2105
+ }),
2106
+ "data-draggable": true,
2107
+ className: styles$2.track,
2108
+ title: intl.formatMessage({
2109
+ id: "G1Gyjn",
2110
+ defaultMessage: [{
2111
+ "type": 0,
2112
+ "value": "Seek"
2113
+ }]
2114
+ }),
2115
+ "aria-label": intl.formatMessage({
2116
+ id: "2prwZ7",
2117
+ defaultMessage: [{
2118
+ "type": 0,
2119
+ "value": "Progress slider"
2120
+ }]
2121
+ }),
2122
+ tabIndex: focusable ? '0' : '-1'
2123
+ }))]
2124
+ })
2125
+ }));
2028
2126
  }
2029
2127
 
2030
2128
  var styles$1 = {"container":"micromag-viewer-partials-playback-controls-container","playPauseButton":"micromag-viewer-partials-playback-controls-playPauseButton","muteButton":"micromag-viewer-partials-playback-controls-muteButton","icon":"micromag-viewer-partials-playback-controls-icon","offset":"micromag-viewer-partials-playback-controls-offset","spinner":"micromag-viewer-partials-playback-controls-spinner","withPlayPause":"micromag-viewer-partials-playback-controls-withPlayPause","withSuggestPlay":"micromag-viewer-partials-playback-controls-withSuggestPlay","isCollapsed":"micromag-viewer-partials-playback-controls-isCollapsed","loading":"micromag-viewer-partials-playback-controls-loading","hidden":"micromag-viewer-partials-playback-controls-hidden","suggest":"micromag-viewer-partials-playback-controls-suggest","isMuted":"micromag-viewer-partials-playback-controls-isMuted","withMute":"micromag-viewer-partials-playback-controls-withMute","withSeekBar":"micromag-viewer-partials-playback-controls-withSeekBar","seekBar":"micromag-viewer-partials-playback-controls-seekBar","withSeekBarOnly":"micromag-viewer-partials-playback-controls-withSeekBarOnly","withoutShadow":"micromag-viewer-partials-playback-controls-withoutShadow"};
@@ -2179,98 +2277,99 @@ function PlaybackControls(_ref) {
2179
2277
  progressColor = _ref3.progressColor,
2180
2278
  seekBarOnly = _ref3.seekBarOnly;
2181
2279
  var isCollapsed = controls && !controlsVisible && playing || !controls && mediaHasAudio;
2182
- var playIcon = playing ? /*#__PURE__*/React.createElement(PauseIcon, {
2280
+ var playIcon = playing ? /*#__PURE__*/jsx(PauseIcon, {
2183
2281
  className: styles$1.icon,
2184
2282
  color: "currentColor"
2185
- }) : /*#__PURE__*/React.createElement(PlayIcon, {
2283
+ }) : /*#__PURE__*/jsx(PlayIcon, {
2186
2284
  className: styles$1.icon,
2187
2285
  color: "currentColor"
2188
2286
  });
2189
- return /*#__PURE__*/React.createElement("div", {
2190
- className: classNames([styles$1.container, className, isCollapsed ? collapsedClassName : null, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, styles$1.withPlayPause, controls && !seekBarOnly), styles$1.withSuggestPlay, controlsSuggestPlay), styles$1.withMute, hasMedia || controls), styles$1.withSeekBar, controls), styles$1.withSeekBarOnly, seekBarOnly), styles$1.isCollapsed, isCollapsed), styles$1.withoutShadow, withoutShadow), styles$1.isMuted, muted)])
2191
- }, controlsSuggestPlay && !finalShowLoading ? /*#__PURE__*/React.createElement(Button$1, {
2192
- className: classNames([styles$1.suggest]),
2193
- style: {
2194
- color: color
2195
- },
2196
- onClick: playing ? onPause : onPlay,
2197
- focusable: controlsVisible,
2198
- icon: /*#__PURE__*/React.createElement(PlayIcon, {
2199
- className: classNames([styles$1.icon, styles$1.offset]),
2200
- color: "currentColor"
2201
- }),
2202
- "aria-pressed": !playing,
2203
- "aria-label": intl.formatMessage({
2204
- id: "mTqcmA",
2205
- defaultMessage: [{
2206
- "type": 0,
2207
- "value": "Pause"
2208
- }]
2209
- }),
2210
- withoutBootstrapStyles: true
2211
- }) : null, /*#__PURE__*/React.createElement(Button$1, {
2212
- className: classNames([styles$1.playPauseButton, _defineProperty(_defineProperty({}, styles$1.hidden, controlsSuggestPlay && !controls), styles$1.loading, finalShowLoading)]),
2213
- style: {
2214
- color: color
2215
- },
2216
- onClick: playing ? onPause : onPlay,
2217
- focusable: controls && controlsVisible && (!seekBarOnly || !playing),
2218
- disabled: finalShowLoading,
2219
- icon: finalShowLoading ? /*#__PURE__*/React.createElement(Spinner, {
2220
- className: classNames([styles$1.spinner, styles$1.offset])
2221
- }) : playIcon,
2222
- "aria-pressed": !playing,
2223
- "aria-label": finalShowLoading ? intl.formatMessage({
2224
- id: "YyYrXp",
2225
- defaultMessage: [{
2226
- "type": 0,
2227
- "value": "Loading"
2228
- }]
2229
- }) : intl.formatMessage({
2230
- id: "mTqcmA",
2231
- defaultMessage: [{
2232
- "type": 0,
2233
- "value": "Pause"
2234
- }]
2235
- }),
2236
- withoutBootstrapStyles: true
2237
- }), /*#__PURE__*/React.createElement(SeekBar, {
2238
- className: styles$1.seekBar,
2239
- media: mediaElement,
2240
- playing: playing,
2241
- onClick: onSeekClick,
2242
- onSeek: onSeek,
2243
- onSeekStart: onSeekStart,
2244
- onSeekEnd: onSeekEnd,
2245
- focusable: controls && controlsVisible && !seekBarOnly,
2246
- collapsed: isCollapsed,
2247
- withSeekHead: !isCollapsed && !seekBarOnly,
2248
- backgroundColor: color,
2249
- progressColor: progressColor
2250
- }), /*#__PURE__*/React.createElement(Button$1, {
2251
- className: styles$1.muteButton,
2252
- style: {
2253
- color: color
2254
- },
2255
- onClick: muted ? onUnmute : onMute,
2256
- focusable: controlsVisible || mediaHasAudio,
2257
- icon: muted ? /*#__PURE__*/React.createElement(UnmuteIcon, {
2258
- className: styles$1.icon,
2259
- color: "currentColor"
2260
- }) : /*#__PURE__*/React.createElement(MuteIcon, {
2261
- className: styles$1.icon,
2262
- color: "currentColor"
2263
- }),
2264
- "aria-pressed": !muted,
2265
- "aria-label": intl.formatMessage({
2266
- id: "RK/QEY",
2267
- defaultMessage: [{
2268
- "type": 0,
2269
- "value": "Unmute"
2270
- }]
2271
- }),
2272
- withoutBootstrapStyles: true
2273
- }));
2287
+ return /*#__PURE__*/jsxs("div", {
2288
+ className: classNames([styles$1.container, className, isCollapsed ? collapsedClassName : null, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, styles$1.withPlayPause, controls && !seekBarOnly), styles$1.withSuggestPlay, controlsSuggestPlay), styles$1.withMute, hasMedia || controls), styles$1.withSeekBar, controls), styles$1.withSeekBarOnly, seekBarOnly), styles$1.isCollapsed, isCollapsed), styles$1.withoutShadow, withoutShadow), styles$1.isMuted, muted)]),
2289
+ children: [controlsSuggestPlay && !finalShowLoading ? /*#__PURE__*/jsx(Button$1, {
2290
+ className: classNames([styles$1.suggest]),
2291
+ style: {
2292
+ color: color
2293
+ },
2294
+ onClick: playing ? onPause : onPlay,
2295
+ focusable: controlsVisible,
2296
+ icon: /*#__PURE__*/jsx(PlayIcon, {
2297
+ className: classNames([styles$1.icon, styles$1.offset]),
2298
+ color: "currentColor"
2299
+ }),
2300
+ "aria-pressed": !playing,
2301
+ "aria-label": intl.formatMessage({
2302
+ id: "mTqcmA",
2303
+ defaultMessage: [{
2304
+ "type": 0,
2305
+ "value": "Pause"
2306
+ }]
2307
+ }),
2308
+ withoutBootstrapStyles: true
2309
+ }) : null, /*#__PURE__*/jsx(Button$1, {
2310
+ className: classNames([styles$1.playPauseButton, _defineProperty(_defineProperty({}, styles$1.hidden, controlsSuggestPlay && !controls), styles$1.loading, finalShowLoading)]),
2311
+ style: {
2312
+ color: color
2313
+ },
2314
+ onClick: playing ? onPause : onPlay,
2315
+ focusable: controls && controlsVisible && (!seekBarOnly || !playing),
2316
+ disabled: finalShowLoading,
2317
+ icon: finalShowLoading ? /*#__PURE__*/jsx(Spinner, {
2318
+ className: classNames([styles$1.spinner, styles$1.offset])
2319
+ }) : playIcon,
2320
+ "aria-pressed": !playing,
2321
+ "aria-label": finalShowLoading ? intl.formatMessage({
2322
+ id: "YyYrXp",
2323
+ defaultMessage: [{
2324
+ "type": 0,
2325
+ "value": "Loading"
2326
+ }]
2327
+ }) : intl.formatMessage({
2328
+ id: "mTqcmA",
2329
+ defaultMessage: [{
2330
+ "type": 0,
2331
+ "value": "Pause"
2332
+ }]
2333
+ }),
2334
+ withoutBootstrapStyles: true
2335
+ }), /*#__PURE__*/jsx(SeekBar, {
2336
+ className: styles$1.seekBar,
2337
+ media: mediaElement,
2338
+ playing: playing,
2339
+ onClick: onSeekClick,
2340
+ onSeek: onSeek,
2341
+ onSeekStart: onSeekStart,
2342
+ onSeekEnd: onSeekEnd,
2343
+ focusable: controls && controlsVisible && !seekBarOnly,
2344
+ collapsed: isCollapsed,
2345
+ withSeekHead: !isCollapsed && !seekBarOnly,
2346
+ backgroundColor: color,
2347
+ progressColor: progressColor
2348
+ }), /*#__PURE__*/jsx(Button$1, {
2349
+ className: styles$1.muteButton,
2350
+ style: {
2351
+ color: color
2352
+ },
2353
+ onClick: muted ? onUnmute : onMute,
2354
+ focusable: controlsVisible || mediaHasAudio,
2355
+ icon: muted ? /*#__PURE__*/jsx(UnmuteIcon, {
2356
+ className: styles$1.icon,
2357
+ color: "currentColor"
2358
+ }) : /*#__PURE__*/jsx(MuteIcon, {
2359
+ className: styles$1.icon,
2360
+ color: "currentColor"
2361
+ }),
2362
+ "aria-pressed": !muted,
2363
+ "aria-label": intl.formatMessage({
2364
+ id: "RK/QEY",
2365
+ defaultMessage: [{
2366
+ "type": 0,
2367
+ "value": "Unmute"
2368
+ }]
2369
+ }),
2370
+ withoutBootstrapStyles: true
2371
+ })]
2372
+ });
2274
2373
  }
2275
2374
 
2276
2375
  var styles = {"container":"micromag-viewer-partials-web-view-container","opened":"micromag-viewer-partials-web-view-opened","webView":"micromag-viewer-partials-web-view-webView"};
@@ -2371,23 +2470,23 @@ function WebViewContainer(_ref) {
2371
2470
  utm_campaign: storyTitle
2372
2471
  }, currentQueryString))) : url;
2373
2472
  }, [webViewUrl, source]);
2374
- return /*#__PURE__*/React.createElement("div", {
2473
+ return /*#__PURE__*/jsx("div", {
2375
2474
  className: classNames([styles.container, className, _defineProperty({}, styles.opened, opened)]),
2376
2475
  style: style,
2377
2476
  onTransitionEnd: onTransitionEnd,
2378
- ref: ref
2379
- }, /*#__PURE__*/React.createElement(WebView, Object.assign({
2380
- url: finalUrl,
2381
- source: source
2382
- }, webViewProps, {
2383
- closeable: opened,
2384
- focusable: opened,
2385
- className: styles.webView,
2386
- onClose: close
2387
- })));
2477
+ ref: ref,
2478
+ children: /*#__PURE__*/jsx(WebView, _objectSpread(_objectSpread({
2479
+ url: finalUrl,
2480
+ source: source
2481
+ }, webViewProps), {}, {
2482
+ closeable: opened,
2483
+ focusable: opened,
2484
+ className: styles.webView,
2485
+ onClose: close
2486
+ }))
2487
+ });
2388
2488
  }
2389
2489
 
2390
- // @todo export from somewhere else; or use as props in possible component for screen transitions
2391
2490
  var SPRING_CONFIG_TIGHT = {
2392
2491
  tension: 300,
2393
2492
  friction: 35
@@ -2999,7 +3098,7 @@ function Viewer(_ref) {
2999
3098
  }
3000
3099
  return true;
3001
3100
  }, [landscape]);
3002
- var overscrollStyle = /*#__PURE__*/React.createElement("style", {
3101
+ var overscrollStyle = /*#__PURE__*/jsx("style", {
3003
3102
  type: "text/css",
3004
3103
  href: "data-viewer-overscroll",
3005
3104
  precedence: "medium",
@@ -3141,210 +3240,228 @@ function Viewer(_ref) {
3141
3240
  // console.log('mediaCompleted', mediaCompleted, playbackMedia);
3142
3241
  // console.log('activityDetected', activityDetected);
3143
3242
 
3144
- return /*#__PURE__*/React.createElement(StoryProvider, {
3145
- story: parsedStory
3146
- }, /*#__PURE__*/React.createElement(ScreenSizeProvider, {
3147
- size: screenSize
3148
- }, /*#__PURE__*/React.createElement(ViewerProvider, {
3149
- containerRef: containerRef,
3150
- events: eventsManager,
3151
- menuVisible: menuVisible,
3152
- menuOverScreen: menuOverScreen,
3153
- width: viewerWidth,
3154
- height: viewerHeight,
3155
- topHeight: topHeight,
3156
- bottomHeight: bottomHeight,
3157
- bottomSidesWidth: (playbackControlsVisible || !playing || playbackMedia !== null) && currentScreenInteractionEnabled ? 60 / screenScale : 0,
3158
- gotoPreviousScreen: gotoPreviousScreen,
3159
- gotoNextScreen: gotoNextScreen,
3160
- disableInteraction: disableInteraction,
3161
- enableInteraction: enableInteraction
3162
- }, withMetadata ? /*#__PURE__*/React.createElement(Meta, {
3163
- title: finalTitle,
3164
- metadata: finalMetadata
3165
- }, overscrollStyle) : overscrollStyle, /*#__PURE__*/React.createElement(FontFaces, {
3166
- fonts: finalFonts
3167
- }), /*#__PURE__*/React.createElement("div", {
3168
- className: classNames([styles$7.container, screenSize.screens.map(function (screenName) {
3169
- return "story-screen-".concat(screenName);
3170
- }), className, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, styles$7.landscape, landscape), styles$7.withoutGestures, withoutGestures), styles$7.hideMenu, !menuVisible), styles$7.disableMenu, navigationDisabled), styles$7.fadeMenu, playing && playbackControls && !playbackControlsVisible), styles$7.ready, ready || withoutScreensTransforms), styles$7.hasInteracted, hasInteracted), styles$7.isDragging, isDragging)]),
3171
- ref: containerRef,
3172
- onContextMenu: onContextMenu
3173
- }, /*#__PURE__*/React.createElement("div", {
3174
- className: styles$7.ariaAnnouncement,
3175
- id: "announce",
3176
- "aria-live": "polite"
3177
- }, /*#__PURE__*/React.createElement(FormattedMessage, {
3178
- id: "AIr8rM",
3179
- defaultMessage: [{
3180
- "type": 0,
3181
- "value": "Screen "
3182
- }, {
3183
- "type": 1,
3184
- "value": "current"
3185
- }, {
3186
- "type": 0,
3187
- "value": " of "
3188
- }, {
3189
- "type": 1,
3190
- "value": "length"
3191
- }],
3192
- values: {
3193
- current: screenIndex + 1,
3194
- length: screens.length
3195
- }
3196
- })), /*#__PURE__*/React.createElement("nav", {
3197
- "aria-label": intl.formatMessage({
3198
- id: "gfZs4J",
3199
- defaultMessage: [{
3200
- "type": 0,
3201
- "value": "Skip Links"
3202
- }]
3203
- }),
3204
- className: styles$7.accessibilityLinks
3205
- }, playbackHelpVisible ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Button, {
3206
- onClick: onClickSkipToPlaybackControls,
3207
- "aria-disabled": withoutPlaybackControls || !playbackControlsVisible,
3208
- "aria-describedby": "disabledReason",
3209
- className: classNames([styles$7.accessibilityButton, _defineProperty({}, styles$7.disabled, withoutPlaybackControls || !playbackControlsVisible)])
3210
- }, /*#__PURE__*/React.createElement(FormattedMessage, {
3211
- id: "CnVj9r",
3212
- defaultMessage: [{
3213
- "type": 0,
3214
- "value": "Skip to controls"
3215
- }]
3216
- })), withoutPlaybackControls || !playbackControlsVisible ? /*#__PURE__*/React.createElement("div", {
3217
- role: "tooltip",
3218
- className: styles$7.tooltipBox,
3219
- id: "disabledReason"
3220
- }, /*#__PURE__*/React.createElement("span", {
3221
- className: styles$7.tooltip
3222
- }, /*#__PURE__*/React.createElement(FormattedMessage, {
3223
- id: "YXhRxW",
3224
- defaultMessage: [{
3225
- "type": 0,
3226
- "value": "No controls available"
3227
- }]
3228
- }))) : null) : null), !withoutMenu ? /*#__PURE__*/React.createElement(ViewerMenu, {
3243
+ return /*#__PURE__*/jsx(StoryProvider, {
3229
3244
  story: parsedStory,
3230
- currentScreenIndex: screenIndex,
3231
- withShadow: menuOverScreen && !withoutMenuShadow,
3232
- toggleFullscreen: toggleFullscreen,
3233
- fullscreenActive: fullscreenActive,
3234
- fullscreenEnabled: fullscreenEnabled,
3235
- menuDotsButtons: menuDotsButtons,
3236
- closeable: closeable,
3237
- shareBasePath: shareBasePath || basePath,
3238
- shareOptions: shareOptions,
3239
- screenSize: screenSize,
3240
- menuWidth: menuIsScreenWidth ? screenContainerWidth : null,
3241
- theme: viewerTheme,
3242
- previewHeader: menuHeader,
3243
- previewFooter: menuFooter,
3244
- trackingEnabled: trackingEnabled,
3245
- onClickScreen: onClickScreen,
3246
- onClickCloseViewer: onCloseViewer,
3247
- onChange: onMenuChange,
3248
- withDotItemClick: screenContainerWidth > 400,
3249
- withoutScreensMenu: withoutScreensMenu,
3250
- withoutShareMenu: withoutShareMenu,
3251
- menuItems: menuItems,
3252
- afterShareMenuButton: afterShareMenuButton,
3253
- beforeScreensMenuButton: beforeScreensMenuButton,
3254
- withMicromagBranding: withMicromagBranding,
3255
- refDots: menuDotsContainerRef
3256
- }) : null, ready || withoutScreensTransforms ? /*#__PURE__*/React.createElement("div", Object.assign({
3257
- className: styles$7.content
3258
- }, clickableAwareBindings), !withoutNavigationArrow && !withNeighborScreens && !navigationDisabled && screenIndex > 0 && screens.length > 1 ? /*#__PURE__*/React.createElement(NavigationButton, {
3259
- direction: "previous",
3260
- className: classNames([styles$7.navButton, styles$7.previous]),
3261
- onClick: gotoPreviousScreen,
3262
- ariaLabel: intl.formatMessage({
3263
- id: "zYH/31",
3264
- defaultMessage: [{
3265
- "type": 0,
3266
- "value": "Go to previous screen"
3267
- }]
3268
- })
3269
- }) : null, /*#__PURE__*/React.createElement("div", {
3270
- className: styles$7.screensFrame,
3271
- style: {
3272
- width: screenContainerWidth,
3273
- height: screenContainerHeight,
3274
- overflow: !withNeighborScreens ? 'hidden' : null
3275
- }
3276
- }, screens.map(function (screen, i) {
3277
- var current = screenIndex === i;
3278
- var isBefore = i < screenIndex;
3279
- var isAfter = i > screenIndex;
3280
- var isNext = transitionDirection !== 0 && i === screenIndex + transitionDirection;
3281
- var activeRange = neighborScreensActive;
3282
- var isInActiveRange = Math.abs(i - screenIndex) <= activeRange;
3283
- var preloadRange = neighborPreloadScreens !== null ? neighborPreloadScreens : neighborScreensActive;
3284
- var isInPreloadRange = Math.abs(i - screenIndex) <= preloadRange;
3285
- var active = current || isInActiveRange || isNext;
3286
- var preload = current || preloadNeighbors && (isAfter && isInPreloadRange || neighborPreloadBackward && isBefore && isInPreloadRange) || isNext;
3287
- var screenStyles = getScreenStylesByIndex(i, progressSpring);
3288
- var isVisible = current || isDragging && isNext || transitionDirection !== 0 && !isDragging && i === screenIndex - transitionDirection || withNeighborScreens && active;
3289
- return /*#__PURE__*/React.createElement(animated.div, {
3290
- key: "screen-viewer-".concat(screen.id || '', "-").concat(i + 1),
3291
- id: current ? 'content' : null,
3292
- "aria-hidden": !current,
3293
- style: screenStyles,
3294
- tabIndex: current ? 0 : -1,
3295
- className: classNames([styles$7.screenContainer, _defineProperty(_defineProperty(_defineProperty({}, styles$7.visible, isVisible), styles$7.preload, preload), styles$7.current, current && !transitioning)])
3296
- }, screen !== null ? /*#__PURE__*/React.createElement(ViewerScreen, {
3297
- className: styles$7.screen,
3298
- screen: screen,
3299
- screenState: current ? screenState : null,
3300
- index: i,
3301
- current: current,
3302
- active: active || current,
3303
- ready: current && transitioned,
3304
- preload: preload || current,
3305
- mediaRef: function mediaRef(ref) {
3306
- screensMediasRef.current[i] = ref;
3307
- },
3308
- renderContext: renderContext,
3309
- width: screenWidth,
3310
- height: screenHeight,
3311
- scale: screenScale
3312
- }) : null);
3313
- })), !withoutNavigationArrow && !withNeighborScreens && !navigationDisabled && screenIndex < screens.length - 1 ? /*#__PURE__*/React.createElement(NavigationButton, {
3314
- direction: "next",
3315
- className: classNames([styles$7.navButton, styles$7.next]),
3316
- onClick: gotoNextScreen,
3317
- ariaLabel: intl.formatMessage({
3318
- id: "v9bqYj",
3319
- defaultMessage: [{
3320
- "type": 0,
3321
- "value": "Go to next screen"
3322
- }]
3245
+ children: /*#__PURE__*/jsx(ScreenSizeProvider, {
3246
+ size: screenSize,
3247
+ children: /*#__PURE__*/jsxs(ViewerProvider, {
3248
+ containerRef: containerRef,
3249
+ events: eventsManager,
3250
+ menuVisible: menuVisible,
3251
+ menuOverScreen: menuOverScreen,
3252
+ width: viewerWidth,
3253
+ height: viewerHeight,
3254
+ topHeight: topHeight,
3255
+ bottomHeight: bottomHeight,
3256
+ bottomSidesWidth: (playbackControlsVisible || !playing || playbackMedia !== null) && currentScreenInteractionEnabled ? 60 / screenScale : 0,
3257
+ gotoPreviousScreen: gotoPreviousScreen,
3258
+ gotoNextScreen: gotoNextScreen,
3259
+ disableInteraction: disableInteraction,
3260
+ enableInteraction: enableInteraction,
3261
+ children: [withMetadata ? /*#__PURE__*/jsx(Meta, {
3262
+ title: finalTitle,
3263
+ metadata: finalMetadata,
3264
+ children: overscrollStyle
3265
+ }) : overscrollStyle, /*#__PURE__*/jsx(FontFaces, {
3266
+ fonts: finalFonts
3267
+ }), /*#__PURE__*/jsxs("div", {
3268
+ className: classNames([styles$7.container, screenSize.screens.map(function (screenName) {
3269
+ return "story-screen-".concat(screenName);
3270
+ }), className, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, styles$7.landscape, landscape), styles$7.withoutGestures, withoutGestures), styles$7.hideMenu, !menuVisible), styles$7.disableMenu, navigationDisabled), styles$7.fadeMenu, playing && playbackControls && !playbackControlsVisible), styles$7.ready, ready || withoutScreensTransforms), styles$7.hasInteracted, hasInteracted), styles$7.isDragging, isDragging)]),
3271
+ ref: containerRef,
3272
+ onContextMenu: onContextMenu,
3273
+ children: [/*#__PURE__*/jsx("div", {
3274
+ className: styles$7.ariaAnnouncement,
3275
+ id: "announce",
3276
+ "aria-live": "polite",
3277
+ children: /*#__PURE__*/jsx(FormattedMessage, {
3278
+ id: "AIr8rM",
3279
+ defaultMessage: [{
3280
+ "type": 0,
3281
+ "value": "Screen "
3282
+ }, {
3283
+ "type": 1,
3284
+ "value": "current"
3285
+ }, {
3286
+ "type": 0,
3287
+ "value": " of "
3288
+ }, {
3289
+ "type": 1,
3290
+ "value": "length"
3291
+ }],
3292
+ values: {
3293
+ current: screenIndex + 1,
3294
+ length: screens.length
3295
+ }
3296
+ })
3297
+ }), /*#__PURE__*/jsx("nav", {
3298
+ "aria-label": intl.formatMessage({
3299
+ id: "gfZs4J",
3300
+ defaultMessage: [{
3301
+ "type": 0,
3302
+ "value": "Skip Links"
3303
+ }]
3304
+ }),
3305
+ className: styles$7.accessibilityLinks,
3306
+ children: playbackHelpVisible ? /*#__PURE__*/jsxs(Fragment, {
3307
+ children: [/*#__PURE__*/jsx(Button, {
3308
+ onClick: onClickSkipToPlaybackControls,
3309
+ "aria-disabled": withoutPlaybackControls || !playbackControlsVisible,
3310
+ "aria-describedby": "disabledReason",
3311
+ className: classNames([styles$7.accessibilityButton, _defineProperty({}, styles$7.disabled, withoutPlaybackControls || !playbackControlsVisible)]),
3312
+ children: /*#__PURE__*/jsx(FormattedMessage, {
3313
+ id: "CnVj9r",
3314
+ defaultMessage: [{
3315
+ "type": 0,
3316
+ "value": "Skip to controls"
3317
+ }]
3318
+ })
3319
+ }), withoutPlaybackControls || !playbackControlsVisible ? /*#__PURE__*/jsx("div", {
3320
+ role: "tooltip",
3321
+ className: styles$7.tooltipBox,
3322
+ id: "disabledReason",
3323
+ children: /*#__PURE__*/jsx("span", {
3324
+ className: styles$7.tooltip,
3325
+ children: /*#__PURE__*/jsx(FormattedMessage, {
3326
+ id: "YXhRxW",
3327
+ defaultMessage: [{
3328
+ "type": 0,
3329
+ "value": "No controls available"
3330
+ }]
3331
+ })
3332
+ })
3333
+ }) : null]
3334
+ }) : null
3335
+ }), !withoutMenu ? /*#__PURE__*/jsx(ViewerMenu, {
3336
+ story: parsedStory,
3337
+ currentScreenIndex: screenIndex,
3338
+ withShadow: menuOverScreen && !withoutMenuShadow,
3339
+ toggleFullscreen: toggleFullscreen,
3340
+ fullscreenActive: fullscreenActive,
3341
+ fullscreenEnabled: fullscreenEnabled,
3342
+ menuDotsButtons: menuDotsButtons,
3343
+ closeable: closeable,
3344
+ shareBasePath: shareBasePath || basePath,
3345
+ shareOptions: shareOptions,
3346
+ screenSize: screenSize,
3347
+ menuWidth: menuIsScreenWidth ? screenContainerWidth : null,
3348
+ theme: viewerTheme,
3349
+ previewHeader: menuHeader,
3350
+ previewFooter: menuFooter,
3351
+ trackingEnabled: trackingEnabled,
3352
+ onClickScreen: onClickScreen,
3353
+ onClickCloseViewer: onCloseViewer,
3354
+ onChange: onMenuChange,
3355
+ withDotItemClick: screenContainerWidth > 400,
3356
+ withoutScreensMenu: withoutScreensMenu,
3357
+ withoutShareMenu: withoutShareMenu,
3358
+ menuItems: menuItems,
3359
+ afterShareMenuButton: afterShareMenuButton,
3360
+ beforeScreensMenuButton: beforeScreensMenuButton,
3361
+ withMicromagBranding: withMicromagBranding,
3362
+ refDots: menuDotsContainerRef
3363
+ }) : null, ready || withoutScreensTransforms ? /*#__PURE__*/jsxs("div", _objectSpread(_objectSpread({
3364
+ className: styles$7.content
3365
+ }, clickableAwareBindings), {}, {
3366
+ children: [!withoutNavigationArrow && !withNeighborScreens && !navigationDisabled && screenIndex > 0 && screens.length > 1 ? /*#__PURE__*/jsx(NavigationButton, {
3367
+ direction: "previous",
3368
+ className: classNames([styles$7.navButton, styles$7.previous]),
3369
+ onClick: gotoPreviousScreen,
3370
+ ariaLabel: intl.formatMessage({
3371
+ id: "zYH/31",
3372
+ defaultMessage: [{
3373
+ "type": 0,
3374
+ "value": "Go to previous screen"
3375
+ }]
3376
+ })
3377
+ }) : null, /*#__PURE__*/jsx("div", {
3378
+ className: styles$7.screensFrame,
3379
+ style: {
3380
+ width: screenContainerWidth,
3381
+ height: screenContainerHeight,
3382
+ overflow: !withNeighborScreens ? 'hidden' : null
3383
+ },
3384
+ children: screens.map(function (screen, i) {
3385
+ var current = screenIndex === i;
3386
+ var isBefore = i < screenIndex;
3387
+ var isAfter = i > screenIndex;
3388
+ var isNext = transitionDirection !== 0 && i === screenIndex + transitionDirection;
3389
+ var activeRange = neighborScreensActive;
3390
+ var isInActiveRange = Math.abs(i - screenIndex) <= activeRange;
3391
+ var preloadRange = neighborPreloadScreens !== null ? neighborPreloadScreens : neighborScreensActive;
3392
+ var isInPreloadRange = Math.abs(i - screenIndex) <= preloadRange;
3393
+ var active = current || isInActiveRange || isNext;
3394
+ var preload = current || preloadNeighbors && (isAfter && isInPreloadRange || neighborPreloadBackward && isBefore && isInPreloadRange) || isNext;
3395
+ var screenStyles = getScreenStylesByIndex(i, progressSpring);
3396
+ var isVisible = current || isDragging && isNext || transitionDirection !== 0 && !isDragging && i === screenIndex - transitionDirection || withNeighborScreens && active;
3397
+ return /*#__PURE__*/jsx(animated.div, {
3398
+ id: current ? 'content' : null,
3399
+ "aria-hidden": !current,
3400
+ style: screenStyles,
3401
+ tabIndex: current ? 0 : -1,
3402
+ className: classNames([styles$7.screenContainer, _defineProperty(_defineProperty(_defineProperty({}, styles$7.visible, isVisible), styles$7.preload, preload), styles$7.current, current && !transitioning)]),
3403
+ children: screen !== null ? /*#__PURE__*/jsx(ViewerScreen, {
3404
+ className: styles$7.screen,
3405
+ screen: screen,
3406
+ screenState: current ? screenState : null,
3407
+ index: i,
3408
+ current: current,
3409
+ active: active || current,
3410
+ ready: current && transitioned,
3411
+ preload: preload || current,
3412
+ mediaRef: function mediaRef(ref) {
3413
+ screensMediasRef.current[i] = ref;
3414
+ },
3415
+ renderContext: renderContext,
3416
+ width: screenWidth,
3417
+ height: screenHeight,
3418
+ scale: screenScale
3419
+ }) : null
3420
+ }, "screen-viewer-".concat(screen.id || '', "-").concat(i + 1));
3421
+ })
3422
+ }), !withoutNavigationArrow && !withNeighborScreens && !navigationDisabled && screenIndex < screens.length - 1 ? /*#__PURE__*/jsx(NavigationButton, {
3423
+ direction: "next",
3424
+ className: classNames([styles$7.navButton, styles$7.next]),
3425
+ onClick: gotoNextScreen,
3426
+ ariaLabel: intl.formatMessage({
3427
+ id: "v9bqYj",
3428
+ defaultMessage: [{
3429
+ "type": 0,
3430
+ "value": "Go to next screen"
3431
+ }]
3432
+ })
3433
+ }) : null, !withoutPlaybackControls ? /*#__PURE__*/jsx("div", _objectSpread(_objectSpread({
3434
+ className: styles$7.playbackControls,
3435
+ id: "controls",
3436
+ ref: playbackControlsContainerRef
3437
+ }, stopDragEventsPropagation), {}, {
3438
+ children: /*#__PURE__*/jsx(PlaybackControls, {
3439
+ className: styles$7.controls,
3440
+ withoutShadow: withoutMenuShadow
3441
+ })
3442
+ })) : null, withNavigationHint !== false && !withNeighborScreens && !navigationDisabled && screenIndex === 0 && !hasInteracted ? /*#__PURE__*/jsx(NavigationHint, {
3443
+ className: styles$7.navigationHint,
3444
+ withoutShadow: withoutMenuShadow
3445
+ }) : null]
3446
+ })) : null, /*#__PURE__*/jsx("div", {
3447
+ className: classNames([styles$7.shareIncentiveContainer, _defineProperty({}, styles$7.shareIncentiveVisible, hasShareIncentive && shareIncentiveVisible)]),
3448
+ style: {
3449
+ top: isEditor ? 10 : menuDotsContainerHeight - 10
3450
+ },
3451
+ children: /*#__PURE__*/jsx(ShareIncentive, _objectSpread({
3452
+ className: styles$7.shareIncentive
3453
+ }, currentShareIncentive))
3454
+ }), /*#__PURE__*/jsx(WebViewContainer, {
3455
+ className: styles$7.webView,
3456
+ trackingEnabled: trackingEnabled,
3457
+ style: {
3458
+ maxWidth: withFullscreenWebView ? null : Math.max(screenContainerWidth, 600)
3459
+ }
3460
+ })]
3461
+ })]
3462
+ })
3323
3463
  })
3324
- }) : null, !withoutPlaybackControls ? /*#__PURE__*/React.createElement("div", Object.assign({
3325
- className: styles$7.playbackControls,
3326
- id: "controls",
3327
- ref: playbackControlsContainerRef
3328
- }, stopDragEventsPropagation), /*#__PURE__*/React.createElement(PlaybackControls, {
3329
- className: styles$7.controls,
3330
- withoutShadow: withoutMenuShadow
3331
- })) : null, withNavigationHint !== false && !withNeighborScreens && !navigationDisabled && screenIndex === 0 && !hasInteracted ? /*#__PURE__*/React.createElement(NavigationHint, {
3332
- className: styles$7.navigationHint,
3333
- withoutShadow: withoutMenuShadow
3334
- }) : null) : null, /*#__PURE__*/React.createElement("div", {
3335
- className: classNames([styles$7.shareIncentiveContainer, _defineProperty({}, styles$7.shareIncentiveVisible, hasShareIncentive && shareIncentiveVisible)]),
3336
- style: {
3337
- top: isEditor ? 10 : menuDotsContainerHeight - 10
3338
- }
3339
- }, /*#__PURE__*/React.createElement(ShareIncentive, Object.assign({
3340
- className: styles$7.shareIncentive
3341
- }, currentShareIncentive))), /*#__PURE__*/React.createElement(WebViewContainer, {
3342
- className: styles$7.webView,
3343
- trackingEnabled: trackingEnabled,
3344
- style: {
3345
- maxWidth: withFullscreenWebView ? null : Math.max(screenContainerWidth, 600)
3346
- }
3347
- })))));
3464
+ });
3348
3465
  }
3349
3466
 
3350
3467
  var _excluded$1 = ["story", "pathWithIndex", "children", "onScreenChange"];
@@ -3377,22 +3494,27 @@ function ViewerRoutes(_ref) {
3377
3494
  onScreenChange(it);
3378
3495
  }
3379
3496
  }, [navigate, url, pathWithIndex, screens, onScreenChange]);
3380
- return /*#__PURE__*/React.createElement(Switch, null, /*#__PURE__*/React.createElement(Route, {
3381
- path: routes.screen
3382
- }, function (_ref3) {
3383
- var _ref3$screen = _ref3.screen,
3384
- screenParam = _ref3$screen === void 0 ? null : _ref3$screen;
3385
- var screenFromIndex = pathWithIndex && screenParam !== null ? screens[parseInt(screenParam, 10) - 1] || null : null;
3386
- var screenId = pathWithIndex ? (screenFromIndex || {}).id || null : screenParam;
3387
- return /*#__PURE__*/React.createElement(Viewer, Object.assign({}, otherProps, {
3388
- story: story,
3389
- screen: screenId,
3390
- onScreenChange: finalOnScreenChange
3391
- }));
3392
- }), /*#__PURE__*/React.createElement(Route, null, /*#__PURE__*/React.createElement(Viewer, Object.assign({}, otherProps, {
3393
- story: story,
3394
- onScreenChange: finalOnScreenChange
3395
- }))));
3497
+ return /*#__PURE__*/jsxs(Switch, {
3498
+ children: [/*#__PURE__*/jsx(Route, {
3499
+ path: routes.screen,
3500
+ children: function children(_ref3) {
3501
+ var _ref3$screen = _ref3.screen,
3502
+ screenParam = _ref3$screen === void 0 ? null : _ref3$screen;
3503
+ var screenFromIndex = pathWithIndex && screenParam !== null ? screens[parseInt(screenParam, 10) - 1] || null : null;
3504
+ var screenId = pathWithIndex ? (screenFromIndex || {}).id || null : screenParam;
3505
+ return /*#__PURE__*/jsx(Viewer, _objectSpread(_objectSpread({}, otherProps), {}, {
3506
+ story: story,
3507
+ screen: screenId,
3508
+ onScreenChange: finalOnScreenChange
3509
+ }));
3510
+ }
3511
+ }), /*#__PURE__*/jsx(Route, {
3512
+ children: /*#__PURE__*/jsx(Viewer, _objectSpread(_objectSpread({}, otherProps), {}, {
3513
+ story: story,
3514
+ onScreenChange: finalOnScreenChange
3515
+ }))
3516
+ })]
3517
+ });
3396
3518
  }
3397
3519
 
3398
3520
  var home = "/";
@@ -3500,36 +3622,46 @@ function ViewerContainer(_ref) {
3500
3622
  supportsWebp: supportsWebp
3501
3623
  }, settings);
3502
3624
  }, [settings, supportsWebp]);
3503
- var content = /*#__PURE__*/React.createElement(SettingsProvider, {
3504
- settings: finalSettings
3505
- }, /*#__PURE__*/React.createElement(IntlProvider, {
3506
- locale: finalLocale,
3507
- locales: locales,
3508
- extraMessages: translations
3509
- }, /*#__PURE__*/React.createElement(GoogleKeysProvider, {
3510
- apiKey: googleApiKey
3511
- }, /*#__PURE__*/React.createElement(GoogleMapsClientProvider, {
3512
- locale: finalLocale
3513
- }, /*#__PURE__*/React.createElement(ScreensProvider, null, /*#__PURE__*/React.createElement(ComponentsProvider, {
3514
- namespace: SCREENS_NAMESPACE,
3515
- components: screenComponents || emptyComponents
3516
- }, /*#__PURE__*/React.createElement(VisitorProvider, {
3517
- visitor: visitor
3518
- }, /*#__PURE__*/React.createElement(PlaybackProvider, {
3519
- paused: paused,
3520
- muted: muted
3521
- }, /*#__PURE__*/React.createElement(TrackingProvider, {
3522
- variables: finalTrackingVariables,
3523
- disabled: trackingDisabled,
3524
- paused: trackingPaused
3525
- }, withoutRouter ? /*#__PURE__*/React.createElement(Viewer, Object.assign({
3526
- story: story,
3527
- basePath: basePath
3528
- }, otherProps)) : /*#__PURE__*/React.createElement(ViewerRoutes, Object.assign({
3529
- story: story,
3530
- basePath: basePath,
3531
- pathWithIndex: pathWithIndex
3532
- }, otherProps)))))))))));
3625
+ var content = /*#__PURE__*/jsx(SettingsProvider, {
3626
+ settings: finalSettings,
3627
+ children: /*#__PURE__*/jsx(IntlProvider, {
3628
+ locale: finalLocale,
3629
+ locales: locales,
3630
+ extraMessages: translations,
3631
+ children: /*#__PURE__*/jsx(GoogleKeysProvider, {
3632
+ apiKey: googleApiKey,
3633
+ children: /*#__PURE__*/jsx(GoogleMapsClientProvider, {
3634
+ locale: finalLocale,
3635
+ children: /*#__PURE__*/jsx(ScreensProvider, {
3636
+ children: /*#__PURE__*/jsx(ComponentsProvider, {
3637
+ namespace: SCREENS_NAMESPACE,
3638
+ components: screenComponents || emptyComponents,
3639
+ children: /*#__PURE__*/jsx(VisitorProvider, {
3640
+ visitor: visitor,
3641
+ children: /*#__PURE__*/jsx(PlaybackProvider, {
3642
+ paused: paused,
3643
+ muted: muted,
3644
+ children: /*#__PURE__*/jsx(TrackingProvider, {
3645
+ variables: finalTrackingVariables,
3646
+ disabled: trackingDisabled,
3647
+ paused: trackingPaused,
3648
+ children: withoutRouter ? /*#__PURE__*/jsx(Viewer, _objectSpread({
3649
+ story: story,
3650
+ basePath: basePath
3651
+ }, otherProps)) : /*#__PURE__*/jsx(ViewerRoutes, _objectSpread({
3652
+ story: story,
3653
+ basePath: basePath,
3654
+ pathWithIndex: pathWithIndex
3655
+ }, otherProps))
3656
+ })
3657
+ })
3658
+ })
3659
+ })
3660
+ })
3661
+ })
3662
+ })
3663
+ })
3664
+ });
3533
3665
  var _useMemoryRouter = useMemoryRouter(),
3534
3666
  memoryRouterHook = _useMemoryRouter.hook,
3535
3667
  memoryRouterSearchHook = _useMemoryRouter.searchHook;
@@ -3540,9 +3672,12 @@ function ViewerContainer(_ref) {
3540
3672
  base: !memoryRouter ? basePath : null
3541
3673
  };
3542
3674
  }, [basePath, memoryRouter]);
3543
- return withoutRouter ? content : /*#__PURE__*/React.createElement(Router, routerProps, /*#__PURE__*/React.createElement(RoutesProvider, {
3544
- routes: routes
3545
- }, content));
3675
+ return withoutRouter ? content : /*#__PURE__*/jsx(Router, _objectSpread(_objectSpread({}, routerProps), {}, {
3676
+ children: /*#__PURE__*/jsx(RoutesProvider, {
3677
+ routes: routes,
3678
+ children: content
3679
+ })
3680
+ }));
3546
3681
  }
3547
3682
 
3548
3683
  export { Viewer, ViewerContainer as default };