@micromag/viewer 0.3.173 → 0.3.179
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/css/styles.css +3 -3
- package/es/index.js +256 -221
- package/lib/index.js +256 -221
- package/package.json +10 -10
package/es/index.js
CHANGED
|
@@ -15,20 +15,20 @@ import _toConsumableArray from '@babel/runtime/helpers/toConsumableArray';
|
|
|
15
15
|
import { useDrag, useGesture } from '@use-gesture/react';
|
|
16
16
|
import classNames from 'classnames';
|
|
17
17
|
import { Helmet } from 'react-helmet';
|
|
18
|
-
import {
|
|
18
|
+
import { FormattedMessage, useIntl } from 'react-intl';
|
|
19
19
|
import EventEmitter from 'wolfy87-eventemitter';
|
|
20
20
|
import { Button, Close, ScreenPreview, Screen, Meta, FontFaces } from '@micromag/core/components';
|
|
21
21
|
import { useDocumentEvent, useDimensionObserver, useTrackEvent, useMediaProgress, useParsedStory, useLoadedFonts, useTrackScreenView, useScreenSizeFromElement, useFullscreen } from '@micromag/core/hooks';
|
|
22
22
|
import { getStyleFromColor, getStyleFromText, getColorAsString, getDeviceScreens } from '@micromag/core/utils';
|
|
23
23
|
import { useSpring, config } from '@react-spring/core';
|
|
24
24
|
import { animated } from '@react-spring/web';
|
|
25
|
+
import { faShare } from '@fortawesome/free-solid-svg-icons/faShare';
|
|
25
26
|
import { faTimes } from '@fortawesome/free-solid-svg-icons/faTimes';
|
|
26
27
|
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
|
28
|
+
import ShareOptions from '@micromag/element-share-options';
|
|
27
29
|
import { faCompress } from '@fortawesome/free-solid-svg-icons/faCompress';
|
|
28
30
|
import { faExpand } from '@fortawesome/free-solid-svg-icons/faExpand';
|
|
29
|
-
import { faShare } from '@fortawesome/free-solid-svg-icons/faShare';
|
|
30
31
|
import Scroll from '@micromag/element-scroll';
|
|
31
|
-
import ShareOptions from '@micromag/element-share-options';
|
|
32
32
|
import { faArrowLeft } from '@fortawesome/free-solid-svg-icons/faArrowLeft';
|
|
33
33
|
import { faArrowRight } from '@fortawesome/free-solid-svg-icons/faArrowRight';
|
|
34
34
|
import { faPause } from '@fortawesome/free-solid-svg-icons/faPause';
|
|
@@ -222,11 +222,171 @@ function useScreenInteraction() {
|
|
|
222
222
|
};
|
|
223
223
|
}
|
|
224
224
|
|
|
225
|
-
var styles$c = {"
|
|
226
|
-
|
|
227
|
-
var styles$b = {"container":"micromag-viewer-menus-menu-dot-container","button":"micromag-viewer-menus-menu-dot-button","dot":"micromag-viewer-menus-menu-dot-dot","subDot":"micromag-viewer-menus-menu-dot-subDot","dots":"micromag-viewer-menus-menu-dot-dots","vertical":"micromag-viewer-menus-menu-dot-vertical"};
|
|
225
|
+
var styles$c = {"close":"micromag-viewer-partials-share-modal-close","container":"micromag-viewer-partials-share-modal-container","opened":"micromag-viewer-partials-share-modal-opened","modal":"micromag-viewer-partials-share-modal-modal","header":"micromag-viewer-partials-share-modal-header","heading":"micromag-viewer-partials-share-modal-heading","closeIcon":"micromag-viewer-partials-share-modal-closeIcon","shareOptions":"micromag-viewer-partials-share-modal-shareOptions"};
|
|
228
226
|
|
|
229
227
|
var propTypes$h = {
|
|
228
|
+
url: PropTypes.string,
|
|
229
|
+
title: PropTypes.string,
|
|
230
|
+
opened: PropTypes.bool,
|
|
231
|
+
className: PropTypes.string,
|
|
232
|
+
onShare: PropTypes.func,
|
|
233
|
+
onCancel: PropTypes.func
|
|
234
|
+
};
|
|
235
|
+
var defaultProps$h = {
|
|
236
|
+
url: null,
|
|
237
|
+
title: null,
|
|
238
|
+
opened: false,
|
|
239
|
+
className: null,
|
|
240
|
+
onShare: null,
|
|
241
|
+
onCancel: null
|
|
242
|
+
};
|
|
243
|
+
|
|
244
|
+
var ShareModal = function ShareModal(_ref) {
|
|
245
|
+
var _ref3;
|
|
246
|
+
|
|
247
|
+
var url = _ref.url,
|
|
248
|
+
title = _ref.title,
|
|
249
|
+
opened = _ref.opened,
|
|
250
|
+
className = _ref.className,
|
|
251
|
+
onShare = _ref.onShare,
|
|
252
|
+
onCancel = _ref.onCancel;
|
|
253
|
+
var modalRef = useRef();
|
|
254
|
+
var onDocumentClick = useCallback(function (e) {
|
|
255
|
+
var _ref2 = e || {},
|
|
256
|
+
target = _ref2.target;
|
|
257
|
+
|
|
258
|
+
if (!modalRef.current || modalRef.current.contains(target)) {
|
|
259
|
+
return;
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
onCancel();
|
|
263
|
+
}, [opened, onCancel]);
|
|
264
|
+
useDocumentEvent('click', onDocumentClick, opened);
|
|
265
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
266
|
+
className: classNames([styles$c.container, (_ref3 = {}, _defineProperty(_ref3, className, className), _defineProperty(_ref3, styles$c.opened, opened), _ref3)]),
|
|
267
|
+
"aria-hidden": opened ? null : '-1'
|
|
268
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
269
|
+
className: styles$c.modal,
|
|
270
|
+
ref: modalRef
|
|
271
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
272
|
+
className: styles$c.header
|
|
273
|
+
}, /*#__PURE__*/React.createElement("h2", {
|
|
274
|
+
className: styles$c.heading
|
|
275
|
+
}, /*#__PURE__*/React.createElement(FormattedMessage, {
|
|
276
|
+
id: "oL4ueH",
|
|
277
|
+
defaultMessage: [{
|
|
278
|
+
"type": 0,
|
|
279
|
+
"value": "Share"
|
|
280
|
+
}]
|
|
281
|
+
})), /*#__PURE__*/React.createElement(Button, {
|
|
282
|
+
className: styles$c.close,
|
|
283
|
+
onClick: onCancel,
|
|
284
|
+
focusable: opened
|
|
285
|
+
}, /*#__PURE__*/React.createElement(Close, {
|
|
286
|
+
className: styles$c.closeIcon,
|
|
287
|
+
border: "none"
|
|
288
|
+
}))), /*#__PURE__*/React.createElement("div", {
|
|
289
|
+
className: styles$c.content
|
|
290
|
+
}, /*#__PURE__*/React.createElement(ShareOptions, {
|
|
291
|
+
className: styles$c.shareOptions,
|
|
292
|
+
title: title,
|
|
293
|
+
url: url,
|
|
294
|
+
focusable: opened,
|
|
295
|
+
onShare: onShare,
|
|
296
|
+
onClose: onCancel
|
|
297
|
+
}))));
|
|
298
|
+
};
|
|
299
|
+
|
|
300
|
+
ShareModal.propTypes = propTypes$h;
|
|
301
|
+
ShareModal.defaultProps = defaultProps$h;
|
|
302
|
+
|
|
303
|
+
var styles$b = {"container":"micromag-viewer-partials-share-button-container"};
|
|
304
|
+
|
|
305
|
+
var propTypes$g = {
|
|
306
|
+
title: PropTypes.string,
|
|
307
|
+
url: PropTypes.string,
|
|
308
|
+
className: PropTypes.string,
|
|
309
|
+
buttonClassName: PropTypes.string,
|
|
310
|
+
onShare: PropTypes.func,
|
|
311
|
+
children: PropTypes.node,
|
|
312
|
+
focusable: PropTypes.bool
|
|
313
|
+
};
|
|
314
|
+
var defaultProps$g = {
|
|
315
|
+
title: null,
|
|
316
|
+
url: null,
|
|
317
|
+
className: null,
|
|
318
|
+
buttonClassName: null,
|
|
319
|
+
onShare: null,
|
|
320
|
+
children: null,
|
|
321
|
+
focusable: false
|
|
322
|
+
};
|
|
323
|
+
|
|
324
|
+
var ShareButton = function ShareButton(_ref) {
|
|
325
|
+
var title = _ref.title,
|
|
326
|
+
url = _ref.url,
|
|
327
|
+
className = _ref.className,
|
|
328
|
+
buttonClassName = _ref.buttonClassName,
|
|
329
|
+
onShare = _ref.onShare,
|
|
330
|
+
children = _ref.children,
|
|
331
|
+
focusable = _ref.focusable;
|
|
332
|
+
var intl = useIntl();
|
|
333
|
+
|
|
334
|
+
var _useState = useState(false),
|
|
335
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
336
|
+
storyShareModalOpened = _useState2[0],
|
|
337
|
+
setStoryShareModalOpened = _useState2[1];
|
|
338
|
+
|
|
339
|
+
var onShareIconClick = useCallback(function () {
|
|
340
|
+
setStoryShareModalOpened(function (opened) {
|
|
341
|
+
return !opened;
|
|
342
|
+
});
|
|
343
|
+
}, [setStoryShareModalOpened, storyShareModalOpened]);
|
|
344
|
+
var onStoryShared = useCallback(function (type) {
|
|
345
|
+
setStoryShareModalOpened(false);
|
|
346
|
+
|
|
347
|
+
if (onShare !== null) {
|
|
348
|
+
onShare(type);
|
|
349
|
+
}
|
|
350
|
+
}, [setStoryShareModalOpened, onShare]);
|
|
351
|
+
var onStoryShareCanceled = useCallback(function () {
|
|
352
|
+
setStoryShareModalOpened(false);
|
|
353
|
+
}, [setStoryShareModalOpened]);
|
|
354
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
355
|
+
className: classNames([styles$b.container, _defineProperty({}, className, className !== null)])
|
|
356
|
+
}, /*#__PURE__*/React.createElement(Button, {
|
|
357
|
+
className: classNames([_defineProperty({}, buttonClassName, buttonClassName !== null)]),
|
|
358
|
+
onClick: onShareIconClick,
|
|
359
|
+
title: intl.formatMessage({
|
|
360
|
+
id: "7tw6U2",
|
|
361
|
+
defaultMessage: [{
|
|
362
|
+
"type": 0,
|
|
363
|
+
"value": "Share"
|
|
364
|
+
}]
|
|
365
|
+
}),
|
|
366
|
+
"aria-label": intl.formatMessage({
|
|
367
|
+
id: "7tw6U2",
|
|
368
|
+
defaultMessage: [{
|
|
369
|
+
"type": 0,
|
|
370
|
+
"value": "Share"
|
|
371
|
+
}]
|
|
372
|
+
}),
|
|
373
|
+
focusable: focusable
|
|
374
|
+
}, children), /*#__PURE__*/React.createElement(ShareModal, {
|
|
375
|
+
className: styles$b.shareModal,
|
|
376
|
+
opened: storyShareModalOpened,
|
|
377
|
+
title: title,
|
|
378
|
+
url: url,
|
|
379
|
+
onShare: onStoryShared,
|
|
380
|
+
onCancel: onStoryShareCanceled
|
|
381
|
+
}));
|
|
382
|
+
};
|
|
383
|
+
|
|
384
|
+
ShareButton.propTypes = propTypes$g;
|
|
385
|
+
ShareButton.defaultProps = defaultProps$g;
|
|
386
|
+
|
|
387
|
+
var styles$a = {"container":"micromag-viewer-menus-menu-dot-container","button":"micromag-viewer-menus-menu-dot-button","dot":"micromag-viewer-menus-menu-dot-dot","subDot":"micromag-viewer-menus-menu-dot-subDot","dots":"micromag-viewer-menus-menu-dot-dots","vertical":"micromag-viewer-menus-menu-dot-vertical"};
|
|
388
|
+
|
|
389
|
+
var propTypes$f = {
|
|
230
390
|
current: PropTypes.bool,
|
|
231
391
|
active: PropTypes.bool,
|
|
232
392
|
colors: PropTypes.shape({
|
|
@@ -239,7 +399,7 @@ var propTypes$h = {
|
|
|
239
399
|
onClick: PropTypes.func,
|
|
240
400
|
className: PropTypes.string
|
|
241
401
|
};
|
|
242
|
-
var defaultProps$
|
|
402
|
+
var defaultProps$f = {
|
|
243
403
|
current: false,
|
|
244
404
|
active: false,
|
|
245
405
|
colors: null,
|
|
@@ -302,44 +462,44 @@ var ViewerMenuDot = function ViewerMenuDot(_ref) {
|
|
|
302
462
|
});
|
|
303
463
|
}, [playing, duration, currentTime, setSpringProps]);
|
|
304
464
|
var inner = current && count > 1 ? /*#__PURE__*/React.createElement("span", {
|
|
305
|
-
className: styles$
|
|
465
|
+
className: styles$a.dots
|
|
306
466
|
}, _toConsumableArray(Array(count).keys()).map(function (i) {
|
|
307
467
|
return /*#__PURE__*/React.createElement("span", {
|
|
308
|
-
className: classNames([styles$
|
|
468
|
+
className: classNames([styles$a.dot, styles$a.subDot]),
|
|
309
469
|
style: {
|
|
310
470
|
width: "".concat(parseFloat(1 / count * 100).toFixed(2), "%"),
|
|
311
471
|
backgroundColor: active && i <= subIndex ? primary : secondary
|
|
312
472
|
}
|
|
313
473
|
});
|
|
314
474
|
})) : /*#__PURE__*/React.createElement("span", {
|
|
315
|
-
className: styles$
|
|
475
|
+
className: styles$a.dot,
|
|
316
476
|
style: {
|
|
317
477
|
backgroundColor: active ? primary : secondary
|
|
318
478
|
}
|
|
319
479
|
});
|
|
320
480
|
return /*#__PURE__*/React.createElement("li", {
|
|
321
|
-
className: classNames([styles$
|
|
481
|
+
className: classNames([styles$a.container, (_ref3 = {}, _defineProperty(_ref3, styles$a.active, current), _defineProperty(_ref3, styles$a.vertical, vertical), _defineProperty(_ref3, className, className !== null), _ref3)]),
|
|
322
482
|
"aria-hidden": "true"
|
|
323
483
|
}, /*#__PURE__*/React.createElement("button", {
|
|
324
484
|
type: "button",
|
|
325
|
-
className: styles$
|
|
485
|
+
className: styles$a.button,
|
|
326
486
|
onClick: onClick,
|
|
327
487
|
tabIndex: "-1"
|
|
328
488
|
}, inner));
|
|
329
489
|
};
|
|
330
490
|
|
|
331
|
-
ViewerMenuDot.propTypes = propTypes$
|
|
332
|
-
ViewerMenuDot.defaultProps = defaultProps$
|
|
491
|
+
ViewerMenuDot.propTypes = propTypes$f;
|
|
492
|
+
ViewerMenuDot.defaultProps = defaultProps$f;
|
|
333
493
|
|
|
334
|
-
var styles$
|
|
494
|
+
var styles$9 = {};
|
|
335
495
|
|
|
336
|
-
var propTypes$
|
|
496
|
+
var propTypes$e = {
|
|
337
497
|
size: PropTypes.number,
|
|
338
498
|
spacing: PropTypes.number,
|
|
339
499
|
color: PropTypes.string,
|
|
340
500
|
className: PropTypes.string
|
|
341
501
|
};
|
|
342
|
-
var defaultProps$
|
|
502
|
+
var defaultProps$e = {
|
|
343
503
|
size: 100,
|
|
344
504
|
spacing: 8,
|
|
345
505
|
color: 'white',
|
|
@@ -353,7 +513,7 @@ var MenuIcon = function MenuIcon(_ref) {
|
|
|
353
513
|
className = _ref.className;
|
|
354
514
|
var squareSize = (size - 2 * spacing) / 3;
|
|
355
515
|
return /*#__PURE__*/React.createElement("svg", {
|
|
356
|
-
className: classNames([styles$
|
|
516
|
+
className: classNames([styles$9.container, _defineProperty({}, className, className !== null)]),
|
|
357
517
|
xmlns: "http://www.w3.org/2000/svg",
|
|
358
518
|
viewBox: "0 0 ".concat(size, " ").concat(size),
|
|
359
519
|
"aria-hidden": "true"
|
|
@@ -371,13 +531,18 @@ var MenuIcon = function MenuIcon(_ref) {
|
|
|
371
531
|
}));
|
|
372
532
|
};
|
|
373
533
|
|
|
374
|
-
MenuIcon.propTypes = propTypes$
|
|
375
|
-
MenuIcon.defaultProps = defaultProps$
|
|
534
|
+
MenuIcon.propTypes = propTypes$e;
|
|
535
|
+
MenuIcon.defaultProps = defaultProps$e;
|
|
376
536
|
|
|
377
|
-
var
|
|
537
|
+
var styles$8 = {"container":"micromag-viewer-menus-menu-dots-container","closeButton":"micromag-viewer-menus-menu-dots-closeButton","menuButton":"micromag-viewer-menus-menu-dots-menuButton","item":"micromag-viewer-menus-menu-dots-item","items":"micromag-viewer-menus-menu-dots-items","menu":"micromag-viewer-menus-menu-dots-menu","menuIcon":"micromag-viewer-menus-menu-dots-menuIcon","vertical":"micromag-viewer-menus-menu-dots-vertical","withShadow":"micromag-viewer-menus-menu-dots-withShadow"};
|
|
538
|
+
|
|
539
|
+
var propTypes$d = {
|
|
378
540
|
direction: PropTypes.oneOf(['horizontal', 'vertical']),
|
|
379
541
|
withShadow: PropTypes.bool,
|
|
542
|
+
title: PropTypes.string,
|
|
380
543
|
items: PropTypes$1.menuItems,
|
|
544
|
+
shareUrl: PropTypes.string,
|
|
545
|
+
onShare: PropTypes.func,
|
|
381
546
|
onClickItem: PropTypes.func,
|
|
382
547
|
onClickMenu: PropTypes.func,
|
|
383
548
|
colors: PropTypes.shape({
|
|
@@ -387,19 +552,24 @@ var propTypes$f = {
|
|
|
387
552
|
closeable: PropTypes.bool,
|
|
388
553
|
withItemClick: PropTypes.bool,
|
|
389
554
|
withoutScreensMenu: PropTypes.bool,
|
|
555
|
+
withoutShareMenu: PropTypes.bool,
|
|
390
556
|
onClose: PropTypes.func,
|
|
391
557
|
className: PropTypes.string
|
|
392
558
|
};
|
|
393
|
-
var defaultProps$
|
|
559
|
+
var defaultProps$d = {
|
|
394
560
|
direction: 'horizontal',
|
|
395
561
|
withShadow: false,
|
|
562
|
+
title: null,
|
|
396
563
|
items: [],
|
|
564
|
+
shareUrl: null,
|
|
565
|
+
onShare: null,
|
|
397
566
|
onClickItem: null,
|
|
398
567
|
onClickMenu: null,
|
|
399
568
|
colors: null,
|
|
400
569
|
closeable: false,
|
|
401
570
|
withItemClick: false,
|
|
402
571
|
withoutScreensMenu: false,
|
|
572
|
+
withoutShareMenu: false,
|
|
403
573
|
onClose: null,
|
|
404
574
|
className: null
|
|
405
575
|
};
|
|
@@ -409,13 +579,17 @@ var ViewerMenuDots = function ViewerMenuDots(_ref) {
|
|
|
409
579
|
|
|
410
580
|
var direction = _ref.direction,
|
|
411
581
|
withShadow = _ref.withShadow,
|
|
582
|
+
title = _ref.title,
|
|
412
583
|
items = _ref.items,
|
|
584
|
+
shareUrl = _ref.shareUrl,
|
|
585
|
+
onShare = _ref.onShare,
|
|
413
586
|
onClickItem = _ref.onClickItem,
|
|
414
587
|
onClickMenu = _ref.onClickMenu,
|
|
415
588
|
colors = _ref.colors,
|
|
416
589
|
closeable = _ref.closeable,
|
|
417
590
|
withItemClick = _ref.withItemClick,
|
|
418
591
|
withoutScreensMenu = _ref.withoutScreensMenu,
|
|
592
|
+
withoutShareMenu = _ref.withoutShareMenu,
|
|
419
593
|
onClose = _ref.onClose,
|
|
420
594
|
className = _ref.className;
|
|
421
595
|
|
|
@@ -430,7 +604,7 @@ var ViewerMenuDots = function ViewerMenuDots(_ref) {
|
|
|
430
604
|
return current;
|
|
431
605
|
});
|
|
432
606
|
return /*#__PURE__*/React.createElement("nav", {
|
|
433
|
-
className: classNames([styles$
|
|
607
|
+
className: classNames([styles$8.container, (_ref4 = {}, _defineProperty(_ref4, className, className !== null), _defineProperty(_ref4, styles$8.vertical, direction === 'vertical'), _defineProperty(_ref4, styles$8.withShadow, withShadow), _ref4)]),
|
|
434
608
|
"aria-label": intl.formatMessage({
|
|
435
609
|
id: "bLYuuN",
|
|
436
610
|
defaultMessage: [{
|
|
@@ -454,7 +628,7 @@ var ViewerMenuDots = function ViewerMenuDots(_ref) {
|
|
|
454
628
|
total: items.length
|
|
455
629
|
})
|
|
456
630
|
}, /*#__PURE__*/React.createElement("ul", {
|
|
457
|
-
className: styles$
|
|
631
|
+
className: styles$8.items
|
|
458
632
|
}, items.map(function (item, index) {
|
|
459
633
|
var _ref5 = item || {},
|
|
460
634
|
_ref5$current = _ref5.current,
|
|
@@ -480,10 +654,21 @@ var ViewerMenuDots = function ViewerMenuDots(_ref) {
|
|
|
480
654
|
},
|
|
481
655
|
vertical: direction === 'vertical'
|
|
482
656
|
});
|
|
483
|
-
}), !
|
|
484
|
-
className: styles$
|
|
657
|
+
}), !withoutShareMenu ? /*#__PURE__*/React.createElement("li", {
|
|
658
|
+
className: styles$8.menu
|
|
659
|
+
}, /*#__PURE__*/React.createElement(ShareButton, {
|
|
660
|
+
className: styles$8.shareButton,
|
|
661
|
+
buttonClassName: styles$8.menuButton,
|
|
662
|
+
onShare: onShare,
|
|
663
|
+
url: shareUrl,
|
|
664
|
+
title: title
|
|
665
|
+
}, /*#__PURE__*/React.createElement(FontAwesomeIcon, {
|
|
666
|
+
className: styles$8.icon,
|
|
667
|
+
icon: faShare
|
|
668
|
+
}))) : null, !withoutScreensMenu ? /*#__PURE__*/React.createElement("li", {
|
|
669
|
+
className: styles$8.menu
|
|
485
670
|
}, /*#__PURE__*/React.createElement(MenuIcon, {
|
|
486
|
-
className: styles$
|
|
671
|
+
className: styles$8.menuIcon,
|
|
487
672
|
color: primary
|
|
488
673
|
}), /*#__PURE__*/React.createElement("button", {
|
|
489
674
|
type: "button",
|
|
@@ -501,16 +686,16 @@ var ViewerMenuDots = function ViewerMenuDots(_ref) {
|
|
|
501
686
|
"value": "Menu"
|
|
502
687
|
}]
|
|
503
688
|
}),
|
|
504
|
-
className: styles$
|
|
689
|
+
className: styles$8.menuButton,
|
|
505
690
|
onClick: onClickMenu
|
|
506
691
|
})) : null, closeable ? /*#__PURE__*/React.createElement("li", {
|
|
507
|
-
className: styles$
|
|
692
|
+
className: styles$8.closeButton,
|
|
508
693
|
style: {
|
|
509
694
|
color: primary
|
|
510
695
|
}
|
|
511
696
|
}, /*#__PURE__*/React.createElement("button", {
|
|
512
697
|
type: "button",
|
|
513
|
-
className: styles$
|
|
698
|
+
className: styles$8.closeButton,
|
|
514
699
|
onClick: onClose,
|
|
515
700
|
title: intl.formatMessage({
|
|
516
701
|
id: "dj/p/q",
|
|
@@ -531,13 +716,13 @@ var ViewerMenuDots = function ViewerMenuDots(_ref) {
|
|
|
531
716
|
}))) : null));
|
|
532
717
|
};
|
|
533
718
|
|
|
534
|
-
ViewerMenuDots.propTypes = propTypes$
|
|
535
|
-
ViewerMenuDots.defaultProps = defaultProps$
|
|
719
|
+
ViewerMenuDots.propTypes = propTypes$d;
|
|
720
|
+
ViewerMenuDots.defaultProps = defaultProps$d;
|
|
536
721
|
|
|
537
|
-
var propTypes$
|
|
722
|
+
var propTypes$c = {
|
|
538
723
|
className: PropTypes.string
|
|
539
724
|
};
|
|
540
|
-
var defaultProps$
|
|
725
|
+
var defaultProps$c = {
|
|
541
726
|
className: null
|
|
542
727
|
};
|
|
543
728
|
|
|
@@ -554,170 +739,8 @@ var StackIcon = function StackIcon(_ref) {
|
|
|
554
739
|
}));
|
|
555
740
|
};
|
|
556
741
|
|
|
557
|
-
StackIcon.propTypes = propTypes$
|
|
558
|
-
StackIcon.defaultProps = defaultProps$
|
|
559
|
-
|
|
560
|
-
var styles$9 = {"close":"micromag-viewer-partials-share-modal-close","container":"micromag-viewer-partials-share-modal-container","opened":"micromag-viewer-partials-share-modal-opened","modal":"micromag-viewer-partials-share-modal-modal","header":"micromag-viewer-partials-share-modal-header","heading":"micromag-viewer-partials-share-modal-heading","closeIcon":"micromag-viewer-partials-share-modal-closeIcon","shareOptions":"micromag-viewer-partials-share-modal-shareOptions"};
|
|
561
|
-
|
|
562
|
-
var propTypes$d = {
|
|
563
|
-
url: PropTypes.string,
|
|
564
|
-
title: PropTypes.string,
|
|
565
|
-
opened: PropTypes.bool,
|
|
566
|
-
className: PropTypes.string,
|
|
567
|
-
onShare: PropTypes.func,
|
|
568
|
-
onCancel: PropTypes.func
|
|
569
|
-
};
|
|
570
|
-
var defaultProps$d = {
|
|
571
|
-
url: null,
|
|
572
|
-
title: null,
|
|
573
|
-
opened: false,
|
|
574
|
-
className: null,
|
|
575
|
-
onShare: null,
|
|
576
|
-
onCancel: null
|
|
577
|
-
};
|
|
578
|
-
|
|
579
|
-
var ShareModal = function ShareModal(_ref) {
|
|
580
|
-
var _ref3;
|
|
581
|
-
|
|
582
|
-
var url = _ref.url,
|
|
583
|
-
title = _ref.title,
|
|
584
|
-
opened = _ref.opened,
|
|
585
|
-
className = _ref.className,
|
|
586
|
-
onShare = _ref.onShare,
|
|
587
|
-
onCancel = _ref.onCancel;
|
|
588
|
-
var modalRef = useRef();
|
|
589
|
-
var onDocumentClick = useCallback(function (e) {
|
|
590
|
-
var _ref2 = e || {},
|
|
591
|
-
target = _ref2.target;
|
|
592
|
-
|
|
593
|
-
if (!modalRef.current || modalRef.current.contains(target)) {
|
|
594
|
-
return;
|
|
595
|
-
}
|
|
596
|
-
|
|
597
|
-
onCancel();
|
|
598
|
-
}, [opened, onCancel]);
|
|
599
|
-
useDocumentEvent('click', onDocumentClick, opened);
|
|
600
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
601
|
-
className: classNames([styles$9.container, (_ref3 = {}, _defineProperty(_ref3, className, className), _defineProperty(_ref3, styles$9.opened, opened), _ref3)]),
|
|
602
|
-
"aria-hidden": opened ? null : '-1'
|
|
603
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
604
|
-
className: styles$9.modal,
|
|
605
|
-
ref: modalRef
|
|
606
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
607
|
-
className: styles$9.header
|
|
608
|
-
}, /*#__PURE__*/React.createElement("h2", {
|
|
609
|
-
className: styles$9.heading
|
|
610
|
-
}, /*#__PURE__*/React.createElement(FormattedMessage, {
|
|
611
|
-
id: "oL4ueH",
|
|
612
|
-
defaultMessage: [{
|
|
613
|
-
"type": 0,
|
|
614
|
-
"value": "Share"
|
|
615
|
-
}]
|
|
616
|
-
})), /*#__PURE__*/React.createElement(Button, {
|
|
617
|
-
className: styles$9.close,
|
|
618
|
-
onClick: onCancel,
|
|
619
|
-
focusable: opened
|
|
620
|
-
}, /*#__PURE__*/React.createElement(Close, {
|
|
621
|
-
className: styles$9.closeIcon,
|
|
622
|
-
border: "none"
|
|
623
|
-
}))), /*#__PURE__*/React.createElement("div", {
|
|
624
|
-
className: styles$9.content
|
|
625
|
-
}, /*#__PURE__*/React.createElement(ShareOptions, {
|
|
626
|
-
className: styles$9.shareOptions,
|
|
627
|
-
title: title,
|
|
628
|
-
url: url,
|
|
629
|
-
focusable: opened,
|
|
630
|
-
onShare: onShare,
|
|
631
|
-
onClose: onCancel
|
|
632
|
-
}))));
|
|
633
|
-
};
|
|
634
|
-
|
|
635
|
-
ShareModal.propTypes = propTypes$d;
|
|
636
|
-
ShareModal.defaultProps = defaultProps$d;
|
|
637
|
-
|
|
638
|
-
var styles$8 = {"container":"micromag-viewer-partials-share-button-container"};
|
|
639
|
-
|
|
640
|
-
var propTypes$c = {
|
|
641
|
-
title: PropTypes.string,
|
|
642
|
-
url: PropTypes.string,
|
|
643
|
-
className: PropTypes.string,
|
|
644
|
-
buttonClassName: PropTypes.string,
|
|
645
|
-
onShare: PropTypes.func,
|
|
646
|
-
children: PropTypes.node,
|
|
647
|
-
focusable: PropTypes.bool
|
|
648
|
-
};
|
|
649
|
-
var defaultProps$c = {
|
|
650
|
-
title: null,
|
|
651
|
-
url: null,
|
|
652
|
-
className: null,
|
|
653
|
-
buttonClassName: null,
|
|
654
|
-
onShare: null,
|
|
655
|
-
children: null,
|
|
656
|
-
focusable: false
|
|
657
|
-
};
|
|
658
|
-
|
|
659
|
-
var ShareButton = function ShareButton(_ref) {
|
|
660
|
-
var title = _ref.title,
|
|
661
|
-
url = _ref.url,
|
|
662
|
-
className = _ref.className,
|
|
663
|
-
buttonClassName = _ref.buttonClassName,
|
|
664
|
-
onShare = _ref.onShare,
|
|
665
|
-
children = _ref.children,
|
|
666
|
-
focusable = _ref.focusable;
|
|
667
|
-
var intl = useIntl();
|
|
668
|
-
|
|
669
|
-
var _useState = useState(false),
|
|
670
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
671
|
-
storyShareModalOpened = _useState2[0],
|
|
672
|
-
setStoryShareModalOpened = _useState2[1];
|
|
673
|
-
|
|
674
|
-
var onShareIconClick = useCallback(function () {
|
|
675
|
-
setStoryShareModalOpened(function (opened) {
|
|
676
|
-
return !opened;
|
|
677
|
-
});
|
|
678
|
-
}, [setStoryShareModalOpened, storyShareModalOpened]);
|
|
679
|
-
var onStoryShared = useCallback(function (type) {
|
|
680
|
-
setStoryShareModalOpened(false);
|
|
681
|
-
|
|
682
|
-
if (onShare !== null) {
|
|
683
|
-
onShare(type);
|
|
684
|
-
}
|
|
685
|
-
}, [setStoryShareModalOpened, onShare]);
|
|
686
|
-
var onStoryShareCanceled = useCallback(function () {
|
|
687
|
-
setStoryShareModalOpened(false);
|
|
688
|
-
}, [setStoryShareModalOpened]);
|
|
689
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
690
|
-
className: classNames([styles$8.container, _defineProperty({}, className, className !== null)])
|
|
691
|
-
}, /*#__PURE__*/React.createElement(Button, {
|
|
692
|
-
className: classNames([_defineProperty({}, buttonClassName, buttonClassName !== null)]),
|
|
693
|
-
onClick: onShareIconClick,
|
|
694
|
-
title: intl.formatMessage({
|
|
695
|
-
id: "7tw6U2",
|
|
696
|
-
defaultMessage: [{
|
|
697
|
-
"type": 0,
|
|
698
|
-
"value": "Share"
|
|
699
|
-
}]
|
|
700
|
-
}),
|
|
701
|
-
"aria-label": intl.formatMessage({
|
|
702
|
-
id: "7tw6U2",
|
|
703
|
-
defaultMessage: [{
|
|
704
|
-
"type": 0,
|
|
705
|
-
"value": "Share"
|
|
706
|
-
}]
|
|
707
|
-
}),
|
|
708
|
-
focusable: focusable
|
|
709
|
-
}, children), /*#__PURE__*/React.createElement(ShareModal, {
|
|
710
|
-
className: styles$8.shareModal,
|
|
711
|
-
opened: storyShareModalOpened,
|
|
712
|
-
title: title,
|
|
713
|
-
url: url,
|
|
714
|
-
onShare: onStoryShared,
|
|
715
|
-
onCancel: onStoryShareCanceled
|
|
716
|
-
}));
|
|
717
|
-
};
|
|
718
|
-
|
|
719
|
-
ShareButton.propTypes = propTypes$c;
|
|
720
|
-
ShareButton.defaultProps = defaultProps$c;
|
|
742
|
+
StackIcon.propTypes = propTypes$c;
|
|
743
|
+
StackIcon.defaultProps = defaultProps$c;
|
|
721
744
|
|
|
722
745
|
var styles$7 = {"container":"micromag-viewer-menus-menu-preview-container","screenButton":"micromag-viewer-menus-menu-preview-screenButton","activeScreenBorder":"micromag-viewer-menus-menu-preview-activeScreenBorder","scroll":"micromag-viewer-menus-menu-preview-scroll","header":"micromag-viewer-menus-menu-preview-header","button":"micromag-viewer-menus-menu-preview-button","shareButton":"micromag-viewer-menus-menu-preview-shareButton","disabled":"micromag-viewer-menus-menu-preview-disabled","icon":"micromag-viewer-menus-menu-preview-icon","buttons":"micromag-viewer-menus-menu-preview-buttons","organisation":"micromag-viewer-menus-menu-preview-organisation","title":"micromag-viewer-menus-menu-preview-title","content":"micromag-viewer-menus-menu-preview-content","nav":"micromag-viewer-menus-menu-preview-nav","item":"micromag-viewer-menus-menu-preview-item","items":"micromag-viewer-menus-menu-preview-items","active":"micromag-viewer-menus-menu-preview-active","itemContent":"micromag-viewer-menus-menu-preview-itemContent","screenContainer":"micromag-viewer-menus-menu-preview-screenContainer","subScreenBadge":"micromag-viewer-menus-menu-preview-subScreenBadge","subScreenCount":"micromag-viewer-menus-menu-preview-subScreenCount","subScreenIcon":"micromag-viewer-menus-menu-preview-subScreenIcon","screenContent":"micromag-viewer-menus-menu-preview-screenContent"};
|
|
723
746
|
|
|
@@ -726,13 +749,11 @@ var propTypes$b = {
|
|
|
726
749
|
screenSize: PropTypes$1.screenSize,
|
|
727
750
|
menuWidth: PropTypes.number,
|
|
728
751
|
title: PropTypes.string,
|
|
729
|
-
shareUrl: PropTypes.string,
|
|
730
752
|
items: PropTypes$1.menuItems,
|
|
731
753
|
focusable: PropTypes.bool,
|
|
732
754
|
shouldLoad: PropTypes.bool,
|
|
733
755
|
onClickItem: PropTypes.func,
|
|
734
756
|
onClose: PropTypes.func,
|
|
735
|
-
onShare: PropTypes.func,
|
|
736
757
|
maxThumbsWidth: PropTypes.number,
|
|
737
758
|
toggleFullscreen: PropTypes.func,
|
|
738
759
|
fullscreenActive: PropTypes.bool,
|
|
@@ -744,13 +765,11 @@ var defaultProps$b = {
|
|
|
744
765
|
screenSize: null,
|
|
745
766
|
menuWidth: null,
|
|
746
767
|
title: null,
|
|
747
|
-
shareUrl: null,
|
|
748
768
|
items: [],
|
|
749
769
|
focusable: true,
|
|
750
770
|
shouldLoad: true,
|
|
751
771
|
onClickItem: null,
|
|
752
772
|
onClose: null,
|
|
753
|
-
onShare: null,
|
|
754
773
|
maxThumbsWidth: 140,
|
|
755
774
|
toggleFullscreen: null,
|
|
756
775
|
fullscreenActive: false,
|
|
@@ -763,12 +782,10 @@ var ViewerMenuPreview = function ViewerMenuPreview(_ref) {
|
|
|
763
782
|
screenSize = _ref.screenSize,
|
|
764
783
|
menuWidth = _ref.menuWidth,
|
|
765
784
|
title = _ref.title,
|
|
766
|
-
shareUrl = _ref.shareUrl,
|
|
767
785
|
items = _ref.items,
|
|
768
786
|
focusable = _ref.focusable,
|
|
769
787
|
onClickItem = _ref.onClickItem,
|
|
770
788
|
onClose = _ref.onClose,
|
|
771
|
-
onShare = _ref.onShare,
|
|
772
789
|
maxThumbsWidth = _ref.maxThumbsWidth,
|
|
773
790
|
toggleFullscreen = _ref.toggleFullscreen,
|
|
774
791
|
fullscreenActive = _ref.fullscreenActive,
|
|
@@ -883,17 +900,7 @@ var ViewerMenuPreview = function ViewerMenuPreview(_ref) {
|
|
|
883
900
|
}, title), /*#__PURE__*/React.createElement("div", {
|
|
884
901
|
className: styles$7.buttons,
|
|
885
902
|
style: colorSecondaryColorStyle
|
|
886
|
-
}, /*#__PURE__*/React.createElement(
|
|
887
|
-
className: styles$7.shareButton,
|
|
888
|
-
buttonClassName: styles$7.button,
|
|
889
|
-
onShare: onShare,
|
|
890
|
-
url: shareUrl,
|
|
891
|
-
title: title,
|
|
892
|
-
focusable: focusable
|
|
893
|
-
}, /*#__PURE__*/React.createElement(FontAwesomeIcon, {
|
|
894
|
-
className: styles$7.icon,
|
|
895
|
-
icon: faShare
|
|
896
|
-
})), fullscreenEnabled ? /*#__PURE__*/React.createElement(Button, {
|
|
903
|
+
}, fullscreenEnabled ? /*#__PURE__*/React.createElement(Button, {
|
|
897
904
|
className: styles$7.button,
|
|
898
905
|
onClick: toggleFullscreen,
|
|
899
906
|
title: intl.formatMessage({
|
|
@@ -1039,6 +1046,7 @@ var propTypes$a = {
|
|
|
1039
1046
|
menuWidth: PropTypes.number,
|
|
1040
1047
|
withDotItemClick: PropTypes.bool,
|
|
1041
1048
|
withoutScreensMenu: PropTypes.bool,
|
|
1049
|
+
withoutShareMenu: PropTypes.bool,
|
|
1042
1050
|
onRequestOpen: PropTypes.func,
|
|
1043
1051
|
onRequestClose: PropTypes.func,
|
|
1044
1052
|
onClickItem: PropTypes.func,
|
|
@@ -1064,6 +1072,7 @@ var defaultProps$a = {
|
|
|
1064
1072
|
menuWidth: null,
|
|
1065
1073
|
withDotItemClick: false,
|
|
1066
1074
|
withoutScreensMenu: false,
|
|
1075
|
+
withoutShareMenu: false,
|
|
1067
1076
|
onRequestOpen: null,
|
|
1068
1077
|
onRequestClose: null,
|
|
1069
1078
|
onClickItem: null,
|
|
@@ -1088,6 +1097,7 @@ var ViewerMenu = function ViewerMenu(_ref) {
|
|
|
1088
1097
|
menuWidth = _ref.menuWidth,
|
|
1089
1098
|
withDotItemClick = _ref.withDotItemClick,
|
|
1090
1099
|
withoutScreensMenu = _ref.withoutScreensMenu,
|
|
1100
|
+
withoutShareMenu = _ref.withoutShareMenu,
|
|
1091
1101
|
onRequestOpen = _ref.onRequestOpen,
|
|
1092
1102
|
onRequestClose = _ref.onRequestClose,
|
|
1093
1103
|
customOnClickItem = _ref.onClickItem,
|
|
@@ -1273,11 +1283,15 @@ var ViewerMenu = function ViewerMenu(_ref) {
|
|
|
1273
1283
|
direction: "horizontal",
|
|
1274
1284
|
withShadow: withShadow,
|
|
1275
1285
|
items: items,
|
|
1286
|
+
title: title,
|
|
1287
|
+
shareUrl: shareUrl,
|
|
1288
|
+
onShare: onClickShare,
|
|
1276
1289
|
onClickItem: onClickItem,
|
|
1277
1290
|
onClickMenu: onClickMenu,
|
|
1278
1291
|
closeable: closeable,
|
|
1279
1292
|
withItemClick: withDotItemClick,
|
|
1280
1293
|
withoutScreensMenu: withoutScreensMenu,
|
|
1294
|
+
withoutShareMenu: withoutShareMenu,
|
|
1281
1295
|
onClose: onClickCloseViewer,
|
|
1282
1296
|
className: styles$6.menuDots
|
|
1283
1297
|
}))), /*#__PURE__*/React.createElement(animated.div, {
|
|
@@ -1286,8 +1300,6 @@ var ViewerMenu = function ViewerMenu(_ref) {
|
|
|
1286
1300
|
ref: menuPreviewContainerRef
|
|
1287
1301
|
}, /*#__PURE__*/React.createElement(ViewerMenuPreview, {
|
|
1288
1302
|
viewerTheme: viewerTheme,
|
|
1289
|
-
title: title,
|
|
1290
|
-
shareUrl: shareUrl,
|
|
1291
1303
|
className: styles$6.menuPreview,
|
|
1292
1304
|
screenSize: screenSize,
|
|
1293
1305
|
menuWidth: menuWidth,
|
|
@@ -1295,7 +1307,6 @@ var ViewerMenu = function ViewerMenu(_ref) {
|
|
|
1295
1307
|
items: items,
|
|
1296
1308
|
onClickItem: onClickItem,
|
|
1297
1309
|
onClose: onClickClose,
|
|
1298
|
-
onShare: onClickShare,
|
|
1299
1310
|
toggleFullscreen: toggleFullscreen,
|
|
1300
1311
|
fullscreenActive: fullscreenActive,
|
|
1301
1312
|
fullscreenEnabled: fullscreenEnabled
|
|
@@ -1884,13 +1895,16 @@ var propTypes$2 = {
|
|
|
1884
1895
|
neighborScreensMounted: PropTypes.number,
|
|
1885
1896
|
storyIsParsed: PropTypes.bool,
|
|
1886
1897
|
landscapeScreenMargin: PropTypes.number,
|
|
1898
|
+
landscapeSmallScreenScale: PropTypes.number,
|
|
1887
1899
|
withMetadata: PropTypes.bool,
|
|
1888
1900
|
withoutMenu: PropTypes.bool,
|
|
1889
1901
|
withoutScreensMenu: PropTypes.bool,
|
|
1902
|
+
withoutShareMenu: PropTypes.bool,
|
|
1890
1903
|
withoutMenuShadow: PropTypes.bool,
|
|
1891
1904
|
withoutFullscreen: PropTypes.bool,
|
|
1892
1905
|
withLandscapeSiblingsScreens: PropTypes.bool,
|
|
1893
1906
|
withNavigationHint: PropTypes.bool,
|
|
1907
|
+
withoutPlaybackControls: PropTypes.bool,
|
|
1894
1908
|
closeable: PropTypes.bool,
|
|
1895
1909
|
onClose: PropTypes.func,
|
|
1896
1910
|
onInteraction: PropTypes.func,
|
|
@@ -1923,13 +1937,16 @@ var defaultProps$2 = {
|
|
|
1923
1937
|
neighborScreensMounted: 1,
|
|
1924
1938
|
storyIsParsed: false,
|
|
1925
1939
|
landscapeScreenMargin: 20,
|
|
1940
|
+
landscapeSmallScreenScale: 0.9,
|
|
1926
1941
|
withMetadata: false,
|
|
1927
1942
|
withoutMenu: false,
|
|
1928
1943
|
withoutScreensMenu: false,
|
|
1944
|
+
withoutShareMenu: false,
|
|
1929
1945
|
withoutMenuShadow: false,
|
|
1930
1946
|
withoutFullscreen: false,
|
|
1931
1947
|
withLandscapeSiblingsScreens: false,
|
|
1932
1948
|
withNavigationHint: false,
|
|
1949
|
+
withoutPlaybackControls: false,
|
|
1933
1950
|
menuIsScreenWidth: false,
|
|
1934
1951
|
closeable: false,
|
|
1935
1952
|
onClose: null,
|
|
@@ -1960,13 +1977,16 @@ var Viewer = function Viewer(_ref) {
|
|
|
1960
1977
|
neighborScreensMounted = _ref.neighborScreensMounted,
|
|
1961
1978
|
storyIsParsed = _ref.storyIsParsed,
|
|
1962
1979
|
landscapeScreenMargin = _ref.landscapeScreenMargin,
|
|
1980
|
+
landscapeSmallScreenScale = _ref.landscapeSmallScreenScale,
|
|
1963
1981
|
withMetadata = _ref.withMetadata,
|
|
1964
1982
|
withoutMenu = _ref.withoutMenu,
|
|
1965
1983
|
withoutScreensMenu = _ref.withoutScreensMenu,
|
|
1984
|
+
withoutShareMenu = _ref.withoutShareMenu,
|
|
1966
1985
|
withoutMenuShadow = _ref.withoutMenuShadow;
|
|
1967
1986
|
_ref.withoutFullscreen;
|
|
1968
1987
|
var withLandscapeSiblingsScreens = _ref.withLandscapeSiblingsScreens,
|
|
1969
1988
|
withNavigationHint = _ref.withNavigationHint,
|
|
1989
|
+
withoutPlaybackControls = _ref.withoutPlaybackControls,
|
|
1970
1990
|
menuIsScreenWidth = _ref.menuIsScreenWidth,
|
|
1971
1991
|
closeable = _ref.closeable,
|
|
1972
1992
|
onCloseViewer = _ref.onClose,
|
|
@@ -2394,6 +2414,7 @@ var Viewer = function Viewer(_ref) {
|
|
|
2394
2414
|
onRequestClose: onMenuRequestClose,
|
|
2395
2415
|
withDotItemClick: screenContainerWidth > 400,
|
|
2396
2416
|
withoutScreensMenu: withoutScreensMenu,
|
|
2417
|
+
withoutShareMenu: withoutShareMenu,
|
|
2397
2418
|
refDots: menuDotsContainerRef
|
|
2398
2419
|
}) : null, ready || withoutScreensTransforms ? /*#__PURE__*/React.createElement("div", Object.assign({
|
|
2399
2420
|
ref: contentRef,
|
|
@@ -2407,7 +2428,21 @@ var Viewer = function Viewer(_ref) {
|
|
|
2407
2428
|
var screenTransform = null;
|
|
2408
2429
|
|
|
2409
2430
|
if (landscape) {
|
|
2410
|
-
|
|
2431
|
+
var max = i - screenIndex;
|
|
2432
|
+
var distance = (screenContainerWidth + landscapeScreenMargin) * max; // Compensates for scaling
|
|
2433
|
+
|
|
2434
|
+
if (max !== 0) {
|
|
2435
|
+
var halfMargin = screenContainerWidth * (1 - landscapeSmallScreenScale) / 2;
|
|
2436
|
+
distance -= halfMargin * max;
|
|
2437
|
+
|
|
2438
|
+
if (max < -1) {
|
|
2439
|
+
distance -= halfMargin * (max + 1);
|
|
2440
|
+
} else if (max > 1) {
|
|
2441
|
+
distance -= halfMargin * (max - 1);
|
|
2442
|
+
}
|
|
2443
|
+
}
|
|
2444
|
+
|
|
2445
|
+
screenTransform = withLandscapeSiblingsScreens ? "translateX(calc(".concat(distance, "px - 50%)) scale(").concat(current ? 1 : landscapeSmallScreenScale, ")") : null;
|
|
2411
2446
|
} else {
|
|
2412
2447
|
screenTransform = "translateX(".concat(current ? 0 : '100%', ")");
|
|
2413
2448
|
}
|
|
@@ -2463,7 +2498,7 @@ var Viewer = function Viewer(_ref) {
|
|
|
2463
2498
|
className: classNames([styles$6.navButton, styles$6.next]),
|
|
2464
2499
|
onClick: gotoNextScreen
|
|
2465
2500
|
}) : null));
|
|
2466
|
-
}), /*#__PURE__*/React.createElement("div", {
|
|
2501
|
+
}), !withoutPlaybackControls ? /*#__PURE__*/React.createElement("div", {
|
|
2467
2502
|
className: styles$6.playbackControls,
|
|
2468
2503
|
ref: playbackControlsContainerRef
|
|
2469
2504
|
}, /*#__PURE__*/React.createElement("div", {
|
|
@@ -2473,7 +2508,7 @@ var Viewer = function Viewer(_ref) {
|
|
|
2473
2508
|
}
|
|
2474
2509
|
}, /*#__PURE__*/React.createElement(PlaybackControls, {
|
|
2475
2510
|
className: styles$6.controls
|
|
2476
|
-
})))) : null, /*#__PURE__*/React.createElement(WebViewContainer, {
|
|
2511
|
+
}))) : null) : null, /*#__PURE__*/React.createElement(WebViewContainer, {
|
|
2477
2512
|
className: styles$6.webView,
|
|
2478
2513
|
style: {
|
|
2479
2514
|
maxWidth: Math.max(screenContainerWidth, 600)
|