@micromag/screen-keypad 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 +245 -223
  2. package/package.json +18 -18
package/es/index.js CHANGED
@@ -6,7 +6,7 @@ import { animated } from '@react-spring/web';
6
6
  import classNames from 'classnames';
7
7
  import isEmpty from 'lodash/isEmpty';
8
8
  import isString from 'lodash/isString';
9
- import React, { useRef, useMemo, useState, useCallback, useEffect } from 'react';
9
+ import { useRef, useMemo, useState, useCallback, useEffect } from 'react';
10
10
  import { Close, ScreenElement } from '@micromag/core/components';
11
11
  import { usePlaybackContext, usePlaybackMediaRef, useScreenState, useScreenSize, useViewerContext, useViewerWebView, useViewerInteraction, useScreenRenderContext } from '@micromag/core/contexts';
12
12
  import { useTrackScreenEvent, useDimensionObserver, useDragProgress } from '@micromag/core/hooks';
@@ -23,6 +23,7 @@ import Layout from '@micromag/element-layout';
23
23
  import Scroll from '@micromag/element-scroll';
24
24
  import Text from '@micromag/element-text';
25
25
  import Visual from '@micromag/element-visual';
26
+ import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
26
27
 
27
28
  var styles = {"container":"micromag-screen-keypad-container","isPlaceholder":"micromag-screen-keypad-isPlaceholder","layout":"micromag-screen-keypad-layout","background":"micromag-screen-keypad-background","fixedHeader":"micromag-screen-keypad-fixedHeader","open":"micromag-screen-keypad-open","close":"micromag-screen-keypad-close","closeIcon":"micromag-screen-keypad-closeIcon","header":"micromag-screen-keypad-header","footer":"micromag-screen-keypad-footer","inner":"micromag-screen-keypad-inner","title":"micromag-screen-keypad-title","subtitle":"micromag-screen-keypad-subtitle","emptyTitle":"micromag-screen-keypad-emptyTitle","emptyText":"micromag-screen-keypad-emptyText","grid":"micromag-screen-keypad-grid","item":"micromag-screen-keypad-item","button":"micromag-screen-keypad-button","withSquareItems":"micromag-screen-keypad-withSquareItems","isEmpty":"micromag-screen-keypad-isEmpty","disableHover":"micromag-screen-keypad-disableHover","isLink":"micromag-screen-keypad-isLink","imagePlaceholder":"micromag-screen-keypad-imagePlaceholder","buttonPlaceholder":"micromag-screen-keypad-buttonPlaceholder","buttonLabel":"micromag-screen-keypad-buttonLabel","empty":"micromag-screen-keypad-empty","emptyButtonVisual":"micromag-screen-keypad-emptyButtonVisual","emptyButtonLabel":"micromag-screen-keypad-emptyButtonLabel","popupBackdrop":"micromag-screen-keypad-popupBackdrop","popup":"micromag-screen-keypad-popup","popupButton":"micromag-screen-keypad-popupButton","popupScroll":"micromag-screen-keypad-popupScroll","popupInner":"micromag-screen-keypad-popupInner","withShadow":"micromag-screen-keypad-withShadow","popupContent":"micromag-screen-keypad-popupContent","popupVisualImage":"micromag-screen-keypad-popupVisualImage","popupVisualVideo":"micromag-screen-keypad-popupVisualVideo","placeholder":"micromag-screen-keypad-placeholder","popupHeading":"micromag-screen-keypad-popupHeading","popupVisual":"micromag-screen-keypad-popupVisual","contentSplit":"micromag-screen-keypad-contentSplit","emptyHeading":"micromag-screen-keypad-emptyHeading","emptyVisual":"micromag-screen-keypad-emptyVisual","emptyContent":"micromag-screen-keypad-emptyContent","emptyCTA":"micromag-screen-keypad-emptyCTA","popupCTA":"micromag-screen-keypad-popupCTA","contentBottom":"micromag-screen-keypad-contentBottom"};
28
29
 
@@ -425,31 +426,31 @@ function KeypadScreen(_ref) {
425
426
  var itemIsEmpty = finalBody === null && visual === null;
426
427
  var isExternalLink = url !== null && !inWebView;
427
428
  var isPopupEmpty = (heading === null || headingBody === null || headingBody === '') && (content === null || contentBody === null || contentBody === '') && popupLargeVisual === null;
428
- return /*#__PURE__*/React.createElement("div", {
429
- key: key,
430
- className: styles.item
431
- }, /*#__PURE__*/React.createElement(RichButton, {
432
- className: classNames([styles.button, _defineProperty(_defineProperty(_defineProperty({}, styles.isEmpty, itemIsEmpty), styles.isLink, url !== null), styles.disableHover, isPopupEmpty && url === null)]),
433
- layout: buttonLayout || null,
434
- external: isExternalLink,
435
- href: isExternalLink ? url : null,
436
- focusable: current,
437
- onClick: !isPopupEmpty || url !== null && !isExternalLink ? function (e) {
438
- return onItemClick(e, item, index);
439
- } : null
440
- // style={{
441
- // ...getStyleFromAlignment(alignment, true, 'flex-start'),
442
- // }}
443
- ,
444
- textStyle: _objectSpread(_objectSpread({}, buttonTextStyle), finalLabelTextStyle),
445
- buttonStyle: _objectSpread(_objectSpread({}, buttonBoxStyle), boxStyle),
446
- label: finalLabel,
447
- labelBoxStyle: buttonLabelBoxStyle,
448
- visual: visual,
449
- visualWidth: buttonVisualWidth !== null ? "".concat(buttonVisualWidth, "%") : null,
450
- resolution: resolution,
451
- textClassName: styles.buttonLabel
452
- }));
429
+ return /*#__PURE__*/jsx("div", {
430
+ className: styles.item,
431
+ children: /*#__PURE__*/jsx(RichButton, {
432
+ className: classNames([styles.button, _defineProperty(_defineProperty(_defineProperty({}, styles.isEmpty, itemIsEmpty), styles.isLink, url !== null), styles.disableHover, isPopupEmpty && url === null)]),
433
+ layout: buttonLayout || null,
434
+ external: isExternalLink,
435
+ href: isExternalLink ? url : null,
436
+ focusable: current,
437
+ onClick: !isPopupEmpty || url !== null && !isExternalLink ? function (e) {
438
+ return onItemClick(e, item, index);
439
+ } : null
440
+ // style={{
441
+ // ...getStyleFromAlignment(alignment, true, 'flex-start'),
442
+ // }}
443
+ ,
444
+ textStyle: _objectSpread(_objectSpread({}, buttonTextStyle), finalLabelTextStyle),
445
+ buttonStyle: _objectSpread(_objectSpread({}, buttonBoxStyle), boxStyle),
446
+ label: finalLabel,
447
+ labelBoxStyle: buttonLabelBoxStyle,
448
+ visual: visual,
449
+ visualWidth: buttonVisualWidth !== null ? "".concat(buttonVisualWidth, "%") : null,
450
+ resolution: resolution,
451
+ textClassName: styles.buttonLabel
452
+ })
453
+ }, key);
453
454
  });
454
455
  }, [items, screenState, buttonBoxStyle, buttonTextStyle, buttonLayout, isNotInteractive]);
455
456
  useEffect(function () {
@@ -472,206 +473,227 @@ function KeypadScreen(_ref) {
472
473
  setShowPopup(false);
473
474
  }
474
475
  }, [screenState, items, isView, showPopup, setPopup, setShowPopup]);
475
- return /*#__PURE__*/React.createElement("div", {
476
+ return /*#__PURE__*/jsxs("div", {
476
477
  ref: containerRef,
477
478
  className: classNames([styles.container, className, _defineProperty(_defineProperty({}, styles.isPlaceholder, isPlaceholder), styles.withSquareItems, withSquareItems)]),
478
- "data-screen-ready": true
479
- }, !isPlaceholder ? /*#__PURE__*/React.createElement(Background, {
480
- background: background,
481
- width: width,
482
- height: height,
483
- resolution: resolution,
484
- playing: backgroundPlaying,
485
- muted: muted,
486
- shouldLoad: mediaShouldLoad,
487
- mediaRef: mediaRef,
488
- className: styles.background
489
- }) : null, isView && !isPlaceholder && !withoutCloseButton ? /*#__PURE__*/React.createElement(animated.div, {
490
- className: classNames([styles.fixedHeader, _defineProperty({}, styles.open, showPopup)])
491
- }, /*#__PURE__*/React.createElement("div", {
492
- className: styles.buttons
493
- }, /*#__PURE__*/React.createElement(Button, {
494
- className: styles.close,
495
- onClick: onClickClose,
496
- focusable: !isPreview && !isPlaceholder && showPopup,
497
- withoutStyle: true
498
- }, /*#__PURE__*/React.createElement(Close, {
499
- color: "#000",
500
- className: styles.closeIcon
501
- })))) : null, /*#__PURE__*/React.createElement(Container, {
502
- width: width,
503
- height: height,
504
- className: styles.inner
505
- }, /*#__PURE__*/React.createElement(Scroll, {
506
- width: width,
507
- height: height,
508
- verticalAlign: layout,
509
- withArrow: !showPopup,
510
- withShadow: !showPopup,
511
- disabled: isPreview || isPlaceholder || showPopup,
512
- onScrolledTrigger: onScrolledTrigger
513
- }, /*#__PURE__*/React.createElement(Layout, {
514
- className: styles.layout,
515
- verticalAlign: layout,
516
- width: width,
517
- style: !isPlaceholder ? {
518
- padding: spacing,
519
- paddingTop: (hasHeader ? headerHeight : spacing) + (current && !isPreview ? viewerTopHeight : 0),
520
- paddingBottom: (hasFooter ? footerHeight : spacing) + (current && !isPreview ? viewerBottomHeight : 0)
521
- } : null
522
- }, !isPlaceholder && hasHeader ? /*#__PURE__*/React.createElement("div", {
523
- ref: headerRef,
524
- className: styles.header,
525
- style: {
526
- paddingTop: spacing / 2,
527
- paddingLeft: spacing,
528
- paddingRight: spacing,
529
- paddingBottom: spacing,
530
- transform: !isPreview ? "translate(0, ".concat(viewerTopHeight, "px)") : null
531
- }
532
- }, /*#__PURE__*/React.createElement(Header, header)) : null, /*#__PURE__*/React.createElement(ScreenElement, {
533
- placeholder: "Title",
534
- emptyLabel: /*#__PURE__*/React.createElement(FormattedMessage, {
535
- id: "BSTWf8",
536
- defaultMessage: [{
537
- "type": 0,
538
- "value": "Title"
539
- }]
540
- }),
541
- emptyClassName: classNames([styles.empty, styles.emptyHeading]),
542
- isEmpty: !hasTitle
543
- }, hasTitle ? /*#__PURE__*/React.createElement(Heading, Object.assign({
544
- className: styles.title
545
- }, title, {
546
- textStyle: titleTextStyle
547
- })) : null), /*#__PURE__*/React.createElement(ScreenElement, {
548
- placeholder: "Subtitle",
549
- emptyLabel: /*#__PURE__*/React.createElement(FormattedMessage, {
550
- id: "ZG8/oK",
551
- defaultMessage: [{
552
- "type": 0,
553
- "value": "Subtitle"
554
- }]
555
- }),
556
- emptyClassName: classNames([styles.empty, styles.emptyHeading]),
557
- isEmpty: !hasSubtitle
558
- }, hasSubtitle ? /*#__PURE__*/React.createElement(Text, Object.assign({
559
- className: styles.subtitle
560
- }, subtitle)) : null), /*#__PURE__*/React.createElement(Keypad, {
561
- className: classNames([styles.grid, _defineProperty({}, styles.gridPlaceholder, isPlaceholder)]),
562
- align: columnAlign,
563
- columns: isPlaceholder ? 3 : columns,
564
- spacing: isPlaceholder ? 2 : columnSpacing,
565
- items: gridItems
566
- })), popup !== null ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(animated.div, {
567
- className: classNames([styles.popupBackdrop]),
568
- style: {
569
- opacity: popupSpring.to(function (p) {
570
- return 1 - Math.abs(p);
571
- })
572
- }
573
- }), /*#__PURE__*/React.createElement(animated.div, Object.assign({
574
- className: styles.popup,
575
- style: {
576
- transform: popupSpring.to(function (p) {
577
- return "translateY(".concat(100 * p, "%) scale(").concat(1 - Math.abs(p * 0.5), ")");
578
- }),
579
- pointerEvents: popupSpring.to(function (p) {
580
- return Math.abs(p) > 0.5 ? 'none' : 'auto';
479
+ "data-screen-ready": true,
480
+ children: [!isPlaceholder ? /*#__PURE__*/jsx(Background, {
481
+ background: background,
482
+ width: width,
483
+ height: height,
484
+ resolution: resolution,
485
+ playing: backgroundPlaying,
486
+ muted: muted,
487
+ shouldLoad: mediaShouldLoad,
488
+ mediaRef: mediaRef,
489
+ className: styles.background
490
+ }) : null, isView && !isPlaceholder && !withoutCloseButton ? /*#__PURE__*/jsx(animated.div, {
491
+ className: classNames([styles.fixedHeader, _defineProperty({}, styles.open, showPopup)]),
492
+ children: /*#__PURE__*/jsx("div", {
493
+ className: styles.buttons,
494
+ children: /*#__PURE__*/jsx(Button, {
495
+ className: styles.close,
496
+ onClick: onClickClose,
497
+ focusable: !isPreview && !isPlaceholder && showPopup,
498
+ withoutStyle: true,
499
+ children: /*#__PURE__*/jsx(Close, {
500
+ color: "#000",
501
+ className: styles.closeIcon
502
+ })
503
+ })
581
504
  })
582
- }
583
- }, bindPopupDrag()), /*#__PURE__*/React.createElement(Scroll, {
584
- disabled: isPreview || isPlaceholder,
585
- verticalAlign: "middle",
586
- withArrow: false,
587
- scrollPosition: !showPopup ? 1 : null,
588
- onScrolledBottom: onPopupScrollBottom,
589
- onScrolledNotBottom: onPopupScrollNotBottom,
590
- onScrollHeightChange: onPopupScrollHeightChange,
591
- className: styles.popupScroll,
592
- withShadow: true
593
- }, /*#__PURE__*/React.createElement("div", {
594
- ref: popupInnerRef,
595
- className: classNames([styles.popupInner, styles[popupLayoutClassName], _defineProperty({}, styles.withShadow, popupBoxStyle === null)]),
596
- style: _objectSpread(_objectSpread(_objectSpread({}, getStyleFromBox(placeholderPopupBoxStyles)), getStyleFromBox(popupBoxStyle)), getStyleFromBox(singlePopupBoxStyle))
597
- }, /*#__PURE__*/React.createElement(ScreenElement, {
598
- emptyLabel: /*#__PURE__*/React.createElement(FormattedMessage, {
599
- id: "IE7U/Q",
600
- defaultMessage: [{
601
- "type": 0,
602
- "value": "Heading"
603
- }]
604
- }),
605
- emptyClassName: classNames([styles.empty, styles.emptyHeading]),
606
- isEmpty: !hasPopupHeading
607
- }, hasPopupHeading ? /*#__PURE__*/React.createElement(Heading, Object.assign({
608
- className: styles.popupHeading
609
- }, popupHeading, {
610
- textStyle: _objectSpread(_objectSpread({}, headingTextStyle), popupHeadingTextStyle)
611
- })) : null), /*#__PURE__*/React.createElement(ScreenElement, {
612
- placeholder: "popupContent",
613
- emptyLabel: /*#__PURE__*/React.createElement(FormattedMessage, {
614
- id: "JRZoe6",
615
- defaultMessage: [{
616
- "type": 0,
617
- "value": "Content"
618
- }]
619
- }),
620
- emptyClassName: classNames([styles.empty, styles.emptyContent]),
621
- isEmpty: !hasPopupContent
622
- }, hasPopupContent ? /*#__PURE__*/React.createElement(Text, Object.assign({
623
- className: styles.popupContent
624
- }, popupContent, {
625
- textStyle: _objectSpread(_objectSpread({}, contentTextStyle), popupContentTextStyle)
626
- })) : null), /*#__PURE__*/React.createElement(ScreenElement, {
627
- placeholder: "image",
628
- emptyLabel: /*#__PURE__*/React.createElement(FormattedMessage, {
629
- id: "z4Pr+g",
630
- defaultMessage: [{
631
- "type": 0,
632
- "value": "Visual (Image or Video)"
633
- }]
634
- }),
635
- emptyClassName: classNames([styles.empty, styles.emptyVisual]),
636
- isEmpty: largeVisual === null
637
- }, largeVisual !== null ? /*#__PURE__*/React.createElement(Visual, {
638
- className: styles.popupVisual,
639
- imageClassName: styles.popupVisualImage,
640
- videoClassName: styles.popupVisualVideo,
641
- media: largeVisual,
642
- resolution: resolution,
643
- width: "100%"
644
- }) : null), /*#__PURE__*/React.createElement(ScreenElement, {
645
- placeholder: "button",
646
- emptyLabel: /*#__PURE__*/React.createElement(FormattedMessage, {
647
- id: "N7Kj8z",
648
- defaultMessage: [{
649
- "type": 0,
650
- "value": "Button"
651
- }]
652
- }),
653
- emptyClassName: classNames([styles.empty, styles.emptyCTA]),
654
- isEmpty: popupButton === null
655
- }, popupButton !== null ? /*#__PURE__*/React.createElement(CallToAction, {
656
- className: styles.popupCTA,
657
- label: _objectSpread(_objectSpread({}, popupButtonsTextStyle), buttonLabel),
658
- url: buttonUrl,
659
- onClick: onClickCta,
660
- inWebView: popupInWebView,
661
- openWebView: openWebView,
662
- type: "click",
663
- boxStyle: _objectSpread(_objectSpread({}, popupButtonsBoxStyle), popupButtonBoxStyle)
664
- }) : null))))) : null), !isPlaceholder && hasFooter ? /*#__PURE__*/React.createElement("div", {
665
- ref: footerRef,
666
- className: styles.footer,
667
- style: {
668
- transform: current && !isPreview ? "translate(0, -".concat(viewerBottomHeight, "px)") : null,
669
- paddingLeft: Math.max(spacing / 2, viewerBottomSidesWidth),
670
- paddingRight: Math.max(spacing / 2, viewerBottomSidesWidth),
671
- paddingBottom: spacing / 2,
672
- paddingTop: spacing
673
- }
674
- }, /*#__PURE__*/React.createElement(Footer, footerProps)) : null));
505
+ }) : null, /*#__PURE__*/jsxs(Container, {
506
+ width: width,
507
+ height: height,
508
+ className: styles.inner,
509
+ children: [/*#__PURE__*/jsxs(Scroll, {
510
+ width: width,
511
+ height: height,
512
+ verticalAlign: layout,
513
+ withArrow: !showPopup,
514
+ withShadow: !showPopup,
515
+ disabled: isPreview || isPlaceholder || showPopup,
516
+ onScrolledTrigger: onScrolledTrigger,
517
+ children: [/*#__PURE__*/jsxs(Layout, {
518
+ className: styles.layout,
519
+ verticalAlign: layout,
520
+ width: width,
521
+ style: !isPlaceholder ? {
522
+ padding: spacing,
523
+ paddingTop: (hasHeader ? headerHeight : spacing) + (current && !isPreview ? viewerTopHeight : 0),
524
+ paddingBottom: (hasFooter ? footerHeight : spacing) + (current && !isPreview ? viewerBottomHeight : 0)
525
+ } : null,
526
+ children: [!isPlaceholder && hasHeader ? /*#__PURE__*/jsx("div", {
527
+ ref: headerRef,
528
+ className: styles.header,
529
+ style: {
530
+ paddingTop: spacing / 2,
531
+ paddingLeft: spacing,
532
+ paddingRight: spacing,
533
+ paddingBottom: spacing,
534
+ transform: !isPreview ? "translate(0, ".concat(viewerTopHeight, "px)") : null
535
+ },
536
+ children: /*#__PURE__*/jsx(Header, _objectSpread({}, header))
537
+ }) : null, /*#__PURE__*/jsx(ScreenElement, {
538
+ placeholder: "Title",
539
+ emptyLabel: /*#__PURE__*/jsx(FormattedMessage, {
540
+ id: "BSTWf8",
541
+ defaultMessage: [{
542
+ "type": 0,
543
+ "value": "Title"
544
+ }]
545
+ }),
546
+ emptyClassName: classNames([styles.empty, styles.emptyHeading]),
547
+ isEmpty: !hasTitle,
548
+ children: hasTitle ? /*#__PURE__*/jsx(Heading, _objectSpread(_objectSpread({
549
+ className: styles.title
550
+ }, title), {}, {
551
+ textStyle: titleTextStyle
552
+ })) : null
553
+ }), /*#__PURE__*/jsx(ScreenElement, {
554
+ placeholder: "Subtitle",
555
+ emptyLabel: /*#__PURE__*/jsx(FormattedMessage, {
556
+ id: "ZG8/oK",
557
+ defaultMessage: [{
558
+ "type": 0,
559
+ "value": "Subtitle"
560
+ }]
561
+ }),
562
+ emptyClassName: classNames([styles.empty, styles.emptyHeading]),
563
+ isEmpty: !hasSubtitle,
564
+ children: hasSubtitle ? /*#__PURE__*/jsx(Text, _objectSpread({
565
+ className: styles.subtitle
566
+ }, subtitle)) : null
567
+ }), /*#__PURE__*/jsx(Keypad, {
568
+ className: classNames([styles.grid, _defineProperty({}, styles.gridPlaceholder, isPlaceholder)]),
569
+ align: columnAlign,
570
+ columns: isPlaceholder ? 3 : columns,
571
+ spacing: isPlaceholder ? 2 : columnSpacing,
572
+ items: gridItems
573
+ })]
574
+ }), popup !== null ? /*#__PURE__*/jsxs(Fragment, {
575
+ children: [/*#__PURE__*/jsx(animated.div, {
576
+ className: classNames([styles.popupBackdrop]),
577
+ style: {
578
+ opacity: popupSpring.to(function (p) {
579
+ return 1 - Math.abs(p);
580
+ })
581
+ }
582
+ }), /*#__PURE__*/jsx(animated.div, _objectSpread(_objectSpread({
583
+ className: styles.popup,
584
+ style: {
585
+ transform: popupSpring.to(function (p) {
586
+ return "translateY(".concat(100 * p, "%) scale(").concat(1 - Math.abs(p * 0.5), ")");
587
+ }),
588
+ pointerEvents: popupSpring.to(function (p) {
589
+ return Math.abs(p) > 0.5 ? 'none' : 'auto';
590
+ })
591
+ }
592
+ }, bindPopupDrag()), {}, {
593
+ children: /*#__PURE__*/jsx(Scroll, {
594
+ disabled: isPreview || isPlaceholder,
595
+ verticalAlign: "middle",
596
+ withArrow: false,
597
+ scrollPosition: !showPopup ? 1 : null,
598
+ onScrolledBottom: onPopupScrollBottom,
599
+ onScrolledNotBottom: onPopupScrollNotBottom,
600
+ onScrollHeightChange: onPopupScrollHeightChange,
601
+ className: styles.popupScroll,
602
+ withShadow: true,
603
+ children: /*#__PURE__*/jsxs("div", {
604
+ ref: popupInnerRef,
605
+ className: classNames([styles.popupInner, styles[popupLayoutClassName], _defineProperty({}, styles.withShadow, popupBoxStyle === null)]),
606
+ style: _objectSpread(_objectSpread(_objectSpread({}, getStyleFromBox(placeholderPopupBoxStyles)), getStyleFromBox(popupBoxStyle)), getStyleFromBox(singlePopupBoxStyle)),
607
+ children: [/*#__PURE__*/jsx(ScreenElement, {
608
+ emptyLabel: /*#__PURE__*/jsx(FormattedMessage, {
609
+ id: "IE7U/Q",
610
+ defaultMessage: [{
611
+ "type": 0,
612
+ "value": "Heading"
613
+ }]
614
+ }),
615
+ emptyClassName: classNames([styles.empty, styles.emptyHeading]),
616
+ isEmpty: !hasPopupHeading,
617
+ children: hasPopupHeading ? /*#__PURE__*/jsx(Heading, _objectSpread(_objectSpread({
618
+ className: styles.popupHeading
619
+ }, popupHeading), {}, {
620
+ textStyle: _objectSpread(_objectSpread({}, headingTextStyle), popupHeadingTextStyle)
621
+ })) : null
622
+ }), /*#__PURE__*/jsx(ScreenElement, {
623
+ placeholder: "popupContent",
624
+ emptyLabel: /*#__PURE__*/jsx(FormattedMessage, {
625
+ id: "JRZoe6",
626
+ defaultMessage: [{
627
+ "type": 0,
628
+ "value": "Content"
629
+ }]
630
+ }),
631
+ emptyClassName: classNames([styles.empty, styles.emptyContent]),
632
+ isEmpty: !hasPopupContent,
633
+ children: hasPopupContent ? /*#__PURE__*/jsx(Text, _objectSpread(_objectSpread({
634
+ className: styles.popupContent
635
+ }, popupContent), {}, {
636
+ textStyle: _objectSpread(_objectSpread({}, contentTextStyle), popupContentTextStyle)
637
+ })) : null
638
+ }), /*#__PURE__*/jsx(ScreenElement, {
639
+ placeholder: "image",
640
+ emptyLabel: /*#__PURE__*/jsx(FormattedMessage, {
641
+ id: "z4Pr+g",
642
+ defaultMessage: [{
643
+ "type": 0,
644
+ "value": "Visual (Image or Video)"
645
+ }]
646
+ }),
647
+ emptyClassName: classNames([styles.empty, styles.emptyVisual]),
648
+ isEmpty: largeVisual === null,
649
+ children: largeVisual !== null ? /*#__PURE__*/jsx(Visual, {
650
+ className: styles.popupVisual,
651
+ imageClassName: styles.popupVisualImage,
652
+ videoClassName: styles.popupVisualVideo,
653
+ media: largeVisual,
654
+ resolution: resolution,
655
+ width: "100%"
656
+ }) : null
657
+ }), /*#__PURE__*/jsx(ScreenElement, {
658
+ placeholder: "button",
659
+ emptyLabel: /*#__PURE__*/jsx(FormattedMessage, {
660
+ id: "N7Kj8z",
661
+ defaultMessage: [{
662
+ "type": 0,
663
+ "value": "Button"
664
+ }]
665
+ }),
666
+ emptyClassName: classNames([styles.empty, styles.emptyCTA]),
667
+ isEmpty: popupButton === null,
668
+ children: popupButton !== null ? /*#__PURE__*/jsx(CallToAction, {
669
+ className: styles.popupCTA,
670
+ label: _objectSpread(_objectSpread({}, popupButtonsTextStyle), buttonLabel),
671
+ url: buttonUrl,
672
+ onClick: onClickCta,
673
+ inWebView: popupInWebView,
674
+ openWebView: openWebView,
675
+ type: "click",
676
+ boxStyle: _objectSpread(_objectSpread({}, popupButtonsBoxStyle), popupButtonBoxStyle)
677
+ }) : null
678
+ })]
679
+ })
680
+ })
681
+ }))]
682
+ }) : null]
683
+ }), !isPlaceholder && hasFooter ? /*#__PURE__*/jsx("div", {
684
+ ref: footerRef,
685
+ className: styles.footer,
686
+ style: {
687
+ transform: current && !isPreview ? "translate(0, -".concat(viewerBottomHeight, "px)") : null,
688
+ paddingLeft: Math.max(spacing / 2, viewerBottomSidesWidth),
689
+ paddingRight: Math.max(spacing / 2, viewerBottomSidesWidth),
690
+ paddingBottom: spacing / 2,
691
+ paddingTop: spacing
692
+ },
693
+ children: /*#__PURE__*/jsx(Footer, _objectSpread({}, footerProps))
694
+ }) : null]
695
+ })]
696
+ });
675
697
  }
676
698
 
677
699
  var definition = [{
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@micromag/screen-keypad",
3
- "version": "0.4.49",
3
+ "version": "0.4.50",
4
4
  "private": false,
5
5
  "description": "",
6
6
  "keywords": [
@@ -66,22 +66,22 @@
66
66
  },
67
67
  "dependencies": {
68
68
  "@babel/runtime": "^7.28.6",
69
- "@micromag/core": "^0.4.49",
70
- "@micromag/element-background": "^0.4.49",
71
- "@micromag/element-button": "^0.4.49",
72
- "@micromag/element-call-to-action": "^0.4.49",
73
- "@micromag/element-container": "^0.4.49",
74
- "@micromag/element-footer": "^0.4.49",
75
- "@micromag/element-grid": "^0.4.49",
76
- "@micromag/element-header": "^0.4.49",
77
- "@micromag/element-heading": "^0.4.49",
78
- "@micromag/element-keypad": "^0.4.49",
79
- "@micromag/element-layout": "^0.4.49",
80
- "@micromag/element-scroll": "^0.4.49",
81
- "@micromag/element-text": "^0.4.49",
82
- "@micromag/element-urbania-author": "^0.4.49",
83
- "@micromag/element-visual": "^0.4.49",
84
- "@micromag/transforms": "^0.4.49",
69
+ "@micromag/core": "^0.4.50",
70
+ "@micromag/element-background": "^0.4.50",
71
+ "@micromag/element-button": "^0.4.50",
72
+ "@micromag/element-call-to-action": "^0.4.50",
73
+ "@micromag/element-container": "^0.4.50",
74
+ "@micromag/element-footer": "^0.4.50",
75
+ "@micromag/element-grid": "^0.4.50",
76
+ "@micromag/element-header": "^0.4.50",
77
+ "@micromag/element-heading": "^0.4.50",
78
+ "@micromag/element-keypad": "^0.4.50",
79
+ "@micromag/element-layout": "^0.4.50",
80
+ "@micromag/element-scroll": "^0.4.50",
81
+ "@micromag/element-text": "^0.4.50",
82
+ "@micromag/element-urbania-author": "^0.4.50",
83
+ "@micromag/element-visual": "^0.4.50",
84
+ "@micromag/transforms": "^0.4.50",
85
85
  "@react-spring/core": "^10.0.3",
86
86
  "@react-spring/web": "^10.0.3",
87
87
  "@use-gesture/react": "^10.3.0",
@@ -94,6 +94,6 @@
94
94
  "access": "public",
95
95
  "registry": "https://registry.npmjs.org/"
96
96
  },
97
- "gitHead": "0a225ff29387217cccb0fcc5a731e23c74bd202e",
97
+ "gitHead": "940d5ca98f8f448b79eaa3e2fa685c3ee95185b8",
98
98
  "types": "es/index.d.ts"
99
99
  }