@micromag/editor 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 +943 -806
  2. package/package.json +7 -7
package/es/index.js CHANGED
@@ -16,6 +16,7 @@ import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProper
16
16
  import { faCogs } from '@fortawesome/free-solid-svg-icons/faCogs';
17
17
  import { faEllipsisV } from '@fortawesome/free-solid-svg-icons/faEllipsisV';
18
18
  import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
19
+ import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
19
20
  import { Fields, FieldsProvider } from '@micromag/fields';
20
21
  import { v1 } from 'uuid';
21
22
  import { getSizeWithinBounds } from '@folklore/size';
@@ -219,11 +220,11 @@ function SettingsButton(_ref) {
219
220
  _ref$dots = _ref.dots,
220
221
  dots = _ref$dots === void 0 ? false : _ref$dots,
221
222
  props = _objectWithoutProperties(_ref, _excluded$a);
222
- return /*#__PURE__*/React.createElement(Button, Object.assign({
223
+ return /*#__PURE__*/jsx(Button, _objectSpread({
223
224
  className: className,
224
225
  theme: "secondary",
225
226
  size: "sm",
226
- icon: /*#__PURE__*/React.createElement(FontAwesomeIcon, {
227
+ icon: /*#__PURE__*/jsx(FontAwesomeIcon, {
227
228
  icon: dots ? faEllipsisV : faCogs
228
229
  })
229
230
  }, props));
@@ -265,18 +266,19 @@ function FieldWithContexts(_ref) {
265
266
  finalNameParts = (repeatable || fieldName !== null) && nameParts.length <= (repeatable ? 2 : 1) ? [fieldName || stateId].concat(_toConsumableArray(nameParts.slice(1))) : nameParts.slice(1);
266
267
  }
267
268
  var formComponents = useFormsComponents();
268
- return definition !== null ? /*#__PURE__*/React.createElement("div", {
269
+ return definition !== null ? /*#__PURE__*/jsx("div", {
269
270
  className: classNames({
270
271
  'p-2': form === null
271
- })
272
- }, finalNameParts.length > 0 ? /*#__PURE__*/React.createElement(FieldForm, Object.assign({
273
- fields: finalScreenFields,
274
- formComponents: formComponents,
275
- name: finalNameParts.join('.'),
276
- form: form
277
- }, props)) : /*#__PURE__*/React.createElement(Fields, Object.assign({
278
- fields: stateFields
279
- }, props))) : null;
272
+ }),
273
+ children: finalNameParts.length > 0 ? /*#__PURE__*/jsx(FieldForm, _objectSpread({
274
+ fields: finalScreenFields,
275
+ formComponents: formComponents,
276
+ name: finalNameParts.join('.'),
277
+ form: form
278
+ }, props)) : /*#__PURE__*/jsx(Fields, _objectSpread({
279
+ fields: stateFields
280
+ }, props))
281
+ }) : null;
280
282
  }
281
283
 
282
284
  var styles$i = {"container":"micromag-editor-forms-screen-container","inner":"micromag-editor-forms-screen-inner"};
@@ -308,17 +310,19 @@ function ScreenForm(_ref) {
308
310
  // onClickDelete(value);
309
311
  // }
310
312
  // }, [intl, onClickDelete, value]);
311
- return /*#__PURE__*/React.createElement("div", {
312
- className: classNames([styles$i.container, className])
313
- }, /*#__PURE__*/React.createElement("div", {
314
- className: styles$i.inner
315
- }, fields !== null ? /*#__PURE__*/React.createElement(Fields, {
316
- fields: fields,
317
- value: value,
318
- onChange: onChange,
319
- gotoFieldForm: gotoFieldForm,
320
- closeFieldForm: closeFieldForm
321
- }) : null));
313
+ return /*#__PURE__*/jsx("div", {
314
+ className: classNames([styles$i.container, className]),
315
+ children: /*#__PURE__*/jsx("div", {
316
+ className: styles$i.inner,
317
+ children: fields !== null ? /*#__PURE__*/jsx(Fields, {
318
+ fields: fields,
319
+ value: value,
320
+ onChange: onChange,
321
+ gotoFieldForm: gotoFieldForm,
322
+ closeFieldForm: closeFieldForm
323
+ }) : null
324
+ })
325
+ });
322
326
  }
323
327
 
324
328
  var styles$h = {"container":"micromag-editor-menus-breadcrumb-container"};
@@ -495,7 +499,7 @@ function Breadcrumb(_ref) {
495
499
  var _ref10 = metadata || {},
496
500
  _ref10$title = _ref10.title,
497
501
  title = _ref10$title === void 0 ? null : _ref10$title;
498
- var typeTitle = screenTitle !== null ? /*#__PURE__*/React.createElement(FormattedMessage, screenTitle) : null;
502
+ var typeTitle = screenTitle !== null ? /*#__PURE__*/jsx(FormattedMessage, _objectSpread({}, screenTitle)) : null;
499
503
  var parametersMessage = intl.formatMessage({
500
504
  id: "AHvHaY",
501
505
  defaultMessage: [{
@@ -529,16 +533,18 @@ function Breadcrumb(_ref) {
529
533
  setLocation(items[itemsLength - 2].url);
530
534
  }, [items, setLocation, itemsLength]);
531
535
  var withBack = itemsLength > 1;
532
- return /*#__PURE__*/React.createElement(React.Fragment, null, withBack ? /*#__PURE__*/React.createElement(BackButton, {
533
- onClick: onClickBack,
534
- className: "me-2 py-0"
535
- }) : null, /*#__PURE__*/React.createElement(Breadcrumb$1, {
536
- items: items,
537
- theme: "secondary",
538
- withoutBar: true,
539
- noWrap: true,
540
- className: classNames([styles$h.container, 'text-truncate', className])
541
- }));
536
+ return /*#__PURE__*/jsxs(Fragment, {
537
+ children: [withBack ? /*#__PURE__*/jsx(BackButton, {
538
+ onClick: onClickBack,
539
+ className: "me-2 py-0"
540
+ }) : null, /*#__PURE__*/jsx(Breadcrumb$1, {
541
+ items: items,
542
+ theme: "secondary",
543
+ withoutBar: true,
544
+ noWrap: true,
545
+ className: classNames([styles$h.container, 'text-truncate', className])
546
+ })]
547
+ });
542
548
  }
543
549
 
544
550
  var styles$g = {"container":"micromag-editor-modals-delete-screen-container","description":"micromag-editor-modals-delete-screen-description","actions":"micromag-editor-modals-delete-screen-actions"};
@@ -551,46 +557,56 @@ function DeleteScreenModal(_ref) {
551
557
  onConfirm = _ref$onConfirm === void 0 ? null : _ref$onConfirm,
552
558
  _ref$onCancel = _ref.onCancel,
553
559
  onCancel = _ref$onCancel === void 0 ? null : _ref$onCancel;
554
- return /*#__PURE__*/React.createElement(Modal, null, /*#__PURE__*/React.createElement(ModalDialog, {
555
- title: /*#__PURE__*/React.createElement(FormattedMessage, {
556
- id: "p6q/+/",
557
- defaultMessage: [{
558
- "type": 0,
559
- "value": "Delete screen"
560
- }]
561
- }),
562
- className: classNames([styles$g.container, className]),
563
- onClose: onCancel
564
- }, /*#__PURE__*/React.createElement("div", {
565
- className: styles$g.description
566
- }, /*#__PURE__*/React.createElement(Label, null, /*#__PURE__*/React.createElement(FormattedMessage, {
567
- id: "q/tLk0",
568
- defaultMessage: [{
569
- "type": 0,
570
- "value": "Are you sure you want to delete this screen?"
571
- }]
572
- }))), /*#__PURE__*/React.createElement("div", {
573
- className: styles$g.actions
574
- }, /*#__PURE__*/React.createElement(Button, {
575
- onClick: onCancel,
576
- className: "btn-outline-secondary me-2"
577
- }, /*#__PURE__*/React.createElement(Label, null, /*#__PURE__*/React.createElement(FormattedMessage, {
578
- id: "0GT0SI",
579
- defaultMessage: [{
580
- "type": 0,
581
- "value": "Cancel"
582
- }]
583
- }))), /*#__PURE__*/React.createElement(Button, {
584
- onClick: onConfirm,
585
- theme: "danger",
586
- label: /*#__PURE__*/React.createElement(FormattedMessage, {
587
- id: "gRxcTc",
588
- defaultMessage: [{
589
- "type": 0,
590
- "value": "Delete screen"
591
- }]
560
+ return /*#__PURE__*/jsx(Modal, {
561
+ children: /*#__PURE__*/jsxs(ModalDialog, {
562
+ title: /*#__PURE__*/jsx(FormattedMessage, {
563
+ id: "p6q/+/",
564
+ defaultMessage: [{
565
+ "type": 0,
566
+ "value": "Delete screen"
567
+ }]
568
+ }),
569
+ className: classNames([styles$g.container, className]),
570
+ onClose: onCancel,
571
+ children: [/*#__PURE__*/jsx("div", {
572
+ className: styles$g.description,
573
+ children: /*#__PURE__*/jsx(Label, {
574
+ children: /*#__PURE__*/jsx(FormattedMessage, {
575
+ id: "q/tLk0",
576
+ defaultMessage: [{
577
+ "type": 0,
578
+ "value": "Are you sure you want to delete this screen?"
579
+ }]
580
+ })
581
+ })
582
+ }), /*#__PURE__*/jsxs("div", {
583
+ className: styles$g.actions,
584
+ children: [/*#__PURE__*/jsx(Button, {
585
+ onClick: onCancel,
586
+ className: "btn-outline-secondary me-2",
587
+ children: /*#__PURE__*/jsx(Label, {
588
+ children: /*#__PURE__*/jsx(FormattedMessage, {
589
+ id: "0GT0SI",
590
+ defaultMessage: [{
591
+ "type": 0,
592
+ "value": "Cancel"
593
+ }]
594
+ })
595
+ })
596
+ }), /*#__PURE__*/jsx(Button, {
597
+ onClick: onConfirm,
598
+ theme: "danger",
599
+ label: /*#__PURE__*/jsx(FormattedMessage, {
600
+ id: "gRxcTc",
601
+ defaultMessage: [{
602
+ "type": 0,
603
+ "value": "Delete screen"
604
+ }]
605
+ })
606
+ })]
607
+ })]
592
608
  })
593
- }))));
609
+ });
594
610
  }
595
611
 
596
612
  var styles$f = {"content":"micromag-editor-form-content","navbar":"micromag-editor-form-navbar","panel":"micromag-editor-form-panel"};
@@ -815,7 +831,7 @@ function EditForm(_ref) {
815
831
  var dropdownItems = [!isTheme ? {
816
832
  id: 'duplicate',
817
833
  type: 'button',
818
- label: /*#__PURE__*/React.createElement(FormattedMessage, {
834
+ label: /*#__PURE__*/jsx(FormattedMessage, {
819
835
  id: "IBjY5r",
820
836
  defaultMessage: [{
821
837
  "type": 0,
@@ -826,7 +842,7 @@ function EditForm(_ref) {
826
842
  } : null, {
827
843
  id: 'delete',
828
844
  type: 'button',
829
- label: /*#__PURE__*/React.createElement(FormattedMessage, {
845
+ label: /*#__PURE__*/jsx(FormattedMessage, {
830
846
  id: "hpiKce",
831
847
  defaultMessage: [{
832
848
  "type": 0,
@@ -837,83 +853,91 @@ function EditForm(_ref) {
837
853
  }].filter(function (it) {
838
854
  return it !== null;
839
855
  });
840
- return /*#__PURE__*/React.createElement("div", {
841
- className: classNames(['d-flex', 'flex-column', className])
842
- }, screenId !== null ? /*#__PURE__*/React.createElement(Navbar, {
843
- compact: true,
844
- noWrap: true,
845
- withoutCollapse: true,
846
- className: classNames(['sticky-top', 'border-bottom', 'border-dark', styles$f.navbar])
847
- }, /*#__PURE__*/React.createElement(Breadcrumb, {
848
- story: value,
849
- url: url,
850
- screenId: screenId,
851
- field: fieldParams,
852
- form: formParams,
853
- className: "me-auto"
854
- }), fieldParams === null ? /*#__PURE__*/React.createElement("div", {
855
- className: "dropdown"
856
- }, /*#__PURE__*/React.createElement(SettingsButton, {
857
- onClick: onSettingsClick,
858
- dots: true,
859
- className: "py-0",
860
- theme: "default"
861
- }), /*#__PURE__*/React.createElement(DropdownMenu, {
862
- align: "end",
863
- items: dropdownItems,
864
- visible: screenSettingsOpened,
865
- onClickOutside: onDropdownClickOutside
866
- })) : null) : null, /*#__PURE__*/React.createElement("div", {
867
- className: classNames(['flex-grow-1', 'd-flex', 'w-100', styles$f.content])
868
- }, screen !== null ? /*#__PURE__*/React.createElement("div", {
869
- className: "w-100 flex-grow-1",
870
- style: {
871
- position: 'relative'
872
- }
873
- }, panelTransitions(function (springStyle, item) {
874
- return item !== null ? /*#__PURE__*/React.createElement(animated.div, {
875
- className: classNames(['w-100', styles$f.panel]),
876
- style: _objectSpread(_objectSpread({}, springStyle), item.key !== (transitionItem === null || transitionItem === void 0 ? void 0 : transitionItem.key) ? {
877
- position: 'absolute',
878
- top: 0,
879
- left: 0,
880
- width: '100%',
881
- zIndex: 0
882
- } : {
883
- position: 'relative',
884
- zIndex: 1
856
+ return /*#__PURE__*/jsxs("div", {
857
+ className: classNames(['d-flex', 'flex-column', className]),
858
+ children: [screenId !== null ? /*#__PURE__*/jsxs(Navbar, {
859
+ compact: true,
860
+ noWrap: true,
861
+ withoutCollapse: true,
862
+ className: classNames(['sticky-top', 'border-bottom', 'border-dark', styles$f.navbar]),
863
+ children: [/*#__PURE__*/jsx(Breadcrumb, {
864
+ story: value,
865
+ url: url,
866
+ screenId: screenId,
867
+ field: fieldParams,
868
+ form: formParams,
869
+ className: "me-auto"
870
+ }), fieldParams === null ? /*#__PURE__*/jsxs("div", {
871
+ className: "dropdown",
872
+ children: [/*#__PURE__*/jsx(SettingsButton, {
873
+ onClick: onSettingsClick,
874
+ dots: true,
875
+ className: "py-0",
876
+ theme: "default"
877
+ }), /*#__PURE__*/jsx(DropdownMenu, {
878
+ align: "end",
879
+ items: dropdownItems,
880
+ visible: screenSettingsOpened,
881
+ onClickOutside: onDropdownClickOutside
882
+ })]
883
+ }) : null]
884
+ }) : null, /*#__PURE__*/jsx("div", {
885
+ className: classNames(['flex-grow-1', 'd-flex', 'w-100', styles$f.content]),
886
+ children: screen !== null ? /*#__PURE__*/jsx("div", {
887
+ className: "w-100 flex-grow-1",
888
+ style: {
889
+ position: 'relative'
890
+ },
891
+ children: panelTransitions(function (springStyle, item) {
892
+ return item !== null ? /*#__PURE__*/jsx(animated.div, {
893
+ className: classNames(['w-100', styles$f.panel]),
894
+ style: _objectSpread(_objectSpread({}, springStyle), item.key !== (transitionItem === null || transitionItem === void 0 ? void 0 : transitionItem.key) ? {
895
+ position: 'absolute',
896
+ top: 0,
897
+ left: 0,
898
+ width: '100%',
899
+ zIndex: 0
900
+ } : {
901
+ position: 'relative',
902
+ zIndex: 1
903
+ }),
904
+ children: /*#__PURE__*/jsx(ScreenProvider, {
905
+ data: item.screen,
906
+ children: item.isField ? /*#__PURE__*/jsx(FieldWithContexts, {
907
+ name: item.fieldParams.replace(/\//g, '.'),
908
+ value: item.screen,
909
+ form: item.formParams,
910
+ className: styles$f.form,
911
+ gotoFieldForm: gotoFieldForm,
912
+ closeFieldForm: closeFieldForm,
913
+ fieldContext: fieldContext,
914
+ onChange: onScreenFormChange
915
+ }) : /*#__PURE__*/jsx(ScreenForm, {
916
+ value: item.screen,
917
+ className: styles$f.form,
918
+ onChange: onScreenFormChange,
919
+ gotoFieldForm: gotoFieldForm,
920
+ closeFieldForm: closeFieldForm
921
+ })
922
+ })
923
+ }) : null;
924
+ })
925
+ }) : /*#__PURE__*/jsx(Empty, {
926
+ className: "w-100 m-2",
927
+ children: /*#__PURE__*/jsx(FormattedMessage, {
928
+ id: "QfpTKK",
929
+ defaultMessage: [{
930
+ "type": 0,
931
+ "value": "Select a screen..."
932
+ }],
933
+ decription: "Indication to select a screen to view the form"
934
+ })
885
935
  })
886
- }, /*#__PURE__*/React.createElement(ScreenProvider, {
887
- data: item.screen
888
- }, item.isField ? /*#__PURE__*/React.createElement(FieldWithContexts, {
889
- name: item.fieldParams.replace(/\//g, '.'),
890
- value: item.screen,
891
- form: item.formParams,
892
- className: styles$f.form,
893
- gotoFieldForm: gotoFieldForm,
894
- closeFieldForm: closeFieldForm,
895
- fieldContext: fieldContext,
896
- onChange: onScreenFormChange
897
- }) : /*#__PURE__*/React.createElement(ScreenForm, {
898
- value: item.screen,
899
- className: styles$f.form,
900
- onChange: onScreenFormChange,
901
- gotoFieldForm: gotoFieldForm,
902
- closeFieldForm: closeFieldForm
903
- }))) : null;
904
- })) : /*#__PURE__*/React.createElement(Empty, {
905
- className: "w-100 m-2"
906
- }, /*#__PURE__*/React.createElement(FormattedMessage, {
907
- id: "QfpTKK",
908
- defaultMessage: [{
909
- "type": 0,
910
- "value": "Select a screen..."
911
- }],
912
- decription: "Indication to select a screen to view the form"
913
- }))), deleteScreenModalOpened ? /*#__PURE__*/React.createElement(DeleteScreenModal, {
914
- onConfirm: onDeleteScreenConfirm,
915
- onCancel: onDeleteScreenCancel
916
- }) : null);
936
+ }), deleteScreenModalOpened ? /*#__PURE__*/jsx(DeleteScreenModal, {
937
+ onConfirm: onDeleteScreenConfirm,
938
+ onCancel: onDeleteScreenCancel
939
+ }) : null]
940
+ });
917
941
  }
918
942
 
919
943
  function useScreenStates(screen) {
@@ -953,7 +977,7 @@ function DesktopIcon(_ref) {
953
977
  color = _ref$color === void 0 ? 'currentColor' : _ref$color,
954
978
  _ref$className = _ref.className,
955
979
  className = _ref$className === void 0 ? null : _ref$className;
956
- return /*#__PURE__*/React.createElement("svg", {
980
+ return /*#__PURE__*/jsx("svg", {
957
981
  xmlns: "http://www.w3.org/2000/svg",
958
982
  xmlnsXlink: "http://www.w3.org/1999/xlink",
959
983
  version: "1.1",
@@ -963,11 +987,12 @@ function DesktopIcon(_ref) {
963
987
  height: "100px",
964
988
  viewBox: "0 0 100 100",
965
989
  xmlSpace: "preserve",
966
- className: className
967
- }, /*#__PURE__*/React.createElement("path", {
968
- fill: color,
969
- d: "M84 17H16c-3.3 0-6 2.7-6 6v42c0 3.3 2.7 6 6 6h22v4.2c-.1.4-.9 1.5-1.3 2-1.1 1.4-2.2 2.8-1.4 4.4.3.7 1.1 1.4 2.7 1.4h23c1 0 3.3 0 4.1-1.8.8-1.8-.6-3.2-1.8-4.5-.4-.5-1.1-1.2-1.3-1.6V71h22c3.3 0 6-2.7 6-6V23c0-3.3-2.7-6-6-6zM40.3 79c.9-1.1 1.7-2.4 1.7-3.8V71h16v4.2c0 1.4 1 2.7 2 3.8H40.3zM86 65c0 1.1-.9 2-2 2H16c-1.1 0-2-.9-2-2v-6h72v6zm0-10H14V23c0-1.1.9-2 2-2h68c1.1 0 2 .9 2 2v32z"
970
- }));
990
+ className: className,
991
+ children: /*#__PURE__*/jsx("path", {
992
+ fill: color,
993
+ d: "M84 17H16c-3.3 0-6 2.7-6 6v42c0 3.3 2.7 6 6 6h22v4.2c-.1.4-.9 1.5-1.3 2-1.1 1.4-2.2 2.8-1.4 4.4.3.7 1.1 1.4 2.7 1.4h23c1 0 3.3 0 4.1-1.8.8-1.8-.6-3.2-1.8-4.5-.4-.5-1.1-1.2-1.3-1.6V71h22c3.3 0 6-2.7 6-6V23c0-3.3-2.7-6-6-6zM40.3 79c.9-1.1 1.7-2.4 1.7-3.8V71h16v4.2c0 1.4 1 2.7 2 3.8H40.3zM86 65c0 1.1-.9 2-2 2H16c-1.1 0-2-.9-2-2v-6h72v6zm0-10H14V23c0-1.1.9-2 2-2h68c1.1 0 2 .9 2 2v32z"
994
+ })
995
+ });
971
996
  }
972
997
 
973
998
  /* eslint-disable react/button-has-type, react/jsx-props-no-spreading */
@@ -976,7 +1001,7 @@ function MobileIcon(_ref) {
976
1001
  color = _ref$color === void 0 ? 'currentColor' : _ref$color,
977
1002
  _ref$className = _ref.className,
978
1003
  className = _ref$className === void 0 ? null : _ref$className;
979
- return /*#__PURE__*/React.createElement("svg", {
1004
+ return /*#__PURE__*/jsx("svg", {
980
1005
  xmlns: "http://www.w3.org/2000/svg",
981
1006
  xmlnsXlink: "http://www.w3.org/1999/xlink",
982
1007
  version: "1.1",
@@ -986,11 +1011,12 @@ function MobileIcon(_ref) {
986
1011
  height: "100px",
987
1012
  viewBox: "0 0 100 100",
988
1013
  xmlSpace: "preserve",
989
- className: className
990
- }, /*#__PURE__*/React.createElement("path", {
991
- fill: color,
992
- d: "M66 11H34c-3.3 0-6 2.7-6 6v66c0 3.3 2.7 6 6 6h32c3.3 0 6-2.7 6-6V17c0-3.3-2.7-6-6-6zm2 72c0 1.1-.9 2-2 2H34c-1.1 0-2-.9-2-2v-4h36v4zm0-8H32V25h36v50zm0-54H32v-4c0-1.1.9-2 2-2h32c1.1 0 2 .9 2 2v4z"
993
- }));
1014
+ className: className,
1015
+ children: /*#__PURE__*/jsx("path", {
1016
+ fill: color,
1017
+ d: "M66 11H34c-3.3 0-6 2.7-6 6v66c0 3.3 2.7 6 6 6h32c3.3 0 6-2.7 6-6V17c0-3.3-2.7-6-6-6zm2 72c0 1.1-.9 2-2 2H34c-1.1 0-2-.9-2-2v-4h36v4zm0-8H32V25h36v50zm0-54H32v-4c0-1.1.9-2 2-2h32c1.1 0 2 .9 2 2v4z"
1018
+ })
1019
+ });
994
1020
  }
995
1021
 
996
1022
  var DeviceIcons = /*#__PURE__*/Object.freeze({
@@ -1010,10 +1036,12 @@ function DeviceButton(_ref) {
1010
1036
  iconComponents = _ref$iconComponents === void 0 ? DeviceIcons : _ref$iconComponents,
1011
1037
  props = _objectWithoutProperties(_ref, _excluded$7);
1012
1038
  var DeviceIcon = getComponentFromName(device, iconComponents, DesktopIcon);
1013
- return /*#__PURE__*/React.createElement(Button, Object.assign({
1039
+ return /*#__PURE__*/jsx(Button, _objectSpread(_objectSpread({
1014
1040
  className: classNames([styles$e.container, className])
1015
- }, props), /*#__PURE__*/React.createElement(DeviceIcon, {
1016
- className: styles$e.icon
1041
+ }, props), {}, {
1042
+ children: /*#__PURE__*/jsx(DeviceIcon, {
1043
+ className: styles$e.icon
1044
+ })
1017
1045
  }));
1018
1046
  }
1019
1047
 
@@ -1028,16 +1056,16 @@ function DevicesMenu(_ref) {
1028
1056
  className = _ref$className === void 0 ? null : _ref$className,
1029
1057
  _ref$onClickItem = _ref.onClickItem,
1030
1058
  onClickItem = _ref$onClickItem === void 0 ? null : _ref$onClickItem;
1031
- return /*#__PURE__*/React.createElement(Tabs, {
1059
+ return /*#__PURE__*/jsx(Tabs, {
1032
1060
  items: items,
1033
1061
  theme: "outline-secondary",
1034
1062
  className: classNames([styles$d.container, className]),
1035
1063
  renderItemButton: function renderItemButton(item, index, props) {
1036
1064
  var id = item.id,
1037
1065
  itemProps = _objectWithoutProperties(item, _excluded$6);
1038
- return /*#__PURE__*/React.createElement(DeviceButton, Object.assign({
1066
+ return /*#__PURE__*/jsx(DeviceButton, _objectSpread(_objectSpread(_objectSpread({
1039
1067
  device: id
1040
- }, props, itemProps, {
1068
+ }, props), itemProps), {}, {
1041
1069
  className: styles$d.button,
1042
1070
  onClick: function onClick(e) {
1043
1071
  return onClickItem !== null ? onClickItem(e, item, index) : null;
@@ -1070,30 +1098,36 @@ function ScreenButton(_ref) {
1070
1098
  onClick = _ref$onClick === void 0 ? null : _ref$onClick,
1071
1099
  _ref$refButton = _ref.refButton,
1072
1100
  refButton = _ref$refButton === void 0 ? null : _ref$refButton;
1073
- return /*#__PURE__*/React.createElement("div", {
1074
- className: classNames([styles$c.container, 'rounded', className, _defineProperty({}, styles$c.active, active)])
1075
- }, children !== null ? children : /*#__PURE__*/React.createElement("div", {
1076
- className: styles$c.screen
1077
- }, /*#__PURE__*/React.createElement("div", {
1078
- className: styles$c.inner
1079
- }, icon !== null ? /*#__PURE__*/React.createElement("div", {
1080
- className: styles$c.icon
1081
- }, icon) : null, label !== null ? /*#__PURE__*/React.createElement("div", {
1082
- className: styles$c.label
1083
- }, label) : null)), /*#__PURE__*/React.createElement(Button, {
1084
- className: styles$c.button,
1085
- withoutStyle: true,
1086
- id: id,
1087
- href: href,
1088
- title: title,
1089
- onClick: onClick,
1090
- refButton: refButton
1091
- }, /*#__PURE__*/React.createElement("span", {
1092
- className: classNames([styles$c.border, 'rounded'])
1093
- })));
1101
+ return /*#__PURE__*/jsxs("div", {
1102
+ className: classNames([styles$c.container, 'rounded', className, _defineProperty({}, styles$c.active, active)]),
1103
+ children: [children !== null ? children : /*#__PURE__*/jsx("div", {
1104
+ className: styles$c.screen,
1105
+ children: /*#__PURE__*/jsxs("div", {
1106
+ className: styles$c.inner,
1107
+ children: [icon !== null ? /*#__PURE__*/jsx("div", {
1108
+ className: styles$c.icon,
1109
+ children: icon
1110
+ }) : null, label !== null ? /*#__PURE__*/jsx("div", {
1111
+ className: styles$c.label,
1112
+ children: label
1113
+ }) : null]
1114
+ })
1115
+ }), /*#__PURE__*/jsx(Button, {
1116
+ className: styles$c.button,
1117
+ withoutStyle: true,
1118
+ id: id,
1119
+ href: href,
1120
+ title: title,
1121
+ onClick: onClick,
1122
+ refButton: refButton,
1123
+ children: /*#__PURE__*/jsx("span", {
1124
+ className: classNames([styles$c.border, 'rounded'])
1125
+ })
1126
+ })]
1127
+ });
1094
1128
  }
1095
1129
  var ScreenButton$1 = /*#__PURE__*/React.forwardRef(function (props, ref) {
1096
- return /*#__PURE__*/React.createElement(ScreenButton, Object.assign({}, props, {
1130
+ return /*#__PURE__*/jsx(ScreenButton, _objectSpread(_objectSpread({}, props), {}, {
1097
1131
  refButton: ref
1098
1132
  }));
1099
1133
  });
@@ -1136,37 +1170,42 @@ function ScreenWithPreview(_ref) {
1136
1170
  visible = _useIsVisible.visible;
1137
1171
  var ScreenComponent = withPlaceholder ? ScreenPlaceholder : ScreenPreview;
1138
1172
  var finalTitle = isMessage(title) ? intl.formatMessage(title) : title || null;
1139
- return /*#__PURE__*/React.createElement("div", {
1140
- ref: ref
1141
- }, /*#__PURE__*/React.createElement(ScreenButton$1, {
1142
- href: href,
1143
- active: active,
1144
- className: classNames([styles$b.button, className, _defineProperty({}, styles$b.withIndex, withIndexIndicator || withName)]),
1145
- title: finalTitle,
1146
- onClick: function onClick() {
1147
- if (_onClick !== null) {
1148
- _onClick(screen, index);
1149
- }
1150
- if (onClickItem !== null) {
1151
- onClickItem(screen, index);
1152
- }
1153
- }
1154
- }, /*#__PURE__*/React.createElement(ScreenComponent, {
1155
- screen: screen,
1156
- screenState: screenState,
1157
- className: styles$b.screen,
1158
- hidden: !visible,
1159
- withSize: true
1160
- }), index !== null && withIndexIndicator ? /*#__PURE__*/React.createElement("div", {
1161
- className: styles$b.index
1162
- }, index + 1) : null, withName && !withIndexIndicator ? /*#__PURE__*/React.createElement("div", {
1163
- className: styles$b.name
1164
- }, finalTitle || null) : null, withDeleteButtonOnRepeatables ? /*#__PURE__*/React.createElement("div", {
1165
- className: styles$b.deleteButton,
1166
- onClick: onDeleteButtonClick
1167
- }, /*#__PURE__*/React.createElement(FontAwesomeIcon, {
1168
- icon: faTimesCircle
1169
- })) : null));
1173
+ return /*#__PURE__*/jsx("div", {
1174
+ ref: ref,
1175
+ children: /*#__PURE__*/jsxs(ScreenButton$1, {
1176
+ href: href,
1177
+ active: active,
1178
+ className: classNames([styles$b.button, className, _defineProperty({}, styles$b.withIndex, withIndexIndicator || withName)]),
1179
+ title: finalTitle,
1180
+ onClick: function onClick() {
1181
+ if (_onClick !== null) {
1182
+ _onClick(screen, index);
1183
+ }
1184
+ if (onClickItem !== null) {
1185
+ onClickItem(screen, index);
1186
+ }
1187
+ },
1188
+ children: [/*#__PURE__*/jsx(ScreenComponent, {
1189
+ screen: screen,
1190
+ screenState: screenState,
1191
+ className: styles$b.screen,
1192
+ hidden: !visible,
1193
+ withSize: true
1194
+ }), index !== null && withIndexIndicator ? /*#__PURE__*/jsx("div", {
1195
+ className: styles$b.index,
1196
+ children: index + 1
1197
+ }) : null, withName && !withIndexIndicator ? /*#__PURE__*/jsx("div", {
1198
+ className: styles$b.name,
1199
+ children: finalTitle || null
1200
+ }) : null, withDeleteButtonOnRepeatables ? /*#__PURE__*/jsx("div", {
1201
+ className: styles$b.deleteButton,
1202
+ onClick: onDeleteButtonClick,
1203
+ children: /*#__PURE__*/jsx(FontAwesomeIcon, {
1204
+ icon: faTimesCircle
1205
+ })
1206
+ }) : null]
1207
+ })
1208
+ });
1170
1209
  }
1171
1210
 
1172
1211
  var styles$a = {"container":"micromag-editor-partials-screen-states-container","button":"micromag-editor-partials-screen-states-button","addButton":"micromag-editor-partials-screen-states-addButton","title":"micromag-editor-partials-screen-states-title","settings":"micromag-editor-partials-screen-states-settings"};
@@ -1198,131 +1237,140 @@ function ScreenStates(_ref) {
1198
1237
  var id = _ref4.id;
1199
1238
  return id === stateParam;
1200
1239
  }) !== -1 ? stateParam : null;
1201
- return /*#__PURE__*/React.createElement("div", {
1202
- className: classNames([styles$a.container, className])
1203
- }, /*#__PURE__*/React.createElement("div", {
1204
- className: "d-flex align-items-end m-n1"
1205
- }, /*#__PURE__*/React.createElement("div", {
1206
- className: classNames(['p-1 align-self-stretch d-flex flex-column', styles$a.settings])
1207
- }, /*#__PURE__*/React.createElement("h6", {
1208
- className: classNames(['fw-normal', 'invisible', styles$a.title])
1209
- }, "Settings"), /*#__PURE__*/React.createElement(Button, {
1210
- className: classNames([styles$a.button, 'p-0', 'flex-grow-1', 'justify-content-center']),
1211
- theme: screenParam !== null && field === null ? 'primary' : 'secondary',
1212
- outline: screenParam === null || field !== null,
1213
- size: "lg",
1214
- icon: /*#__PURE__*/React.createElement(FontAwesomeIcon, {
1215
- icon: faCogs
1216
- }),
1217
- href: url('screen', {
1218
- screen: screen.id
1240
+ return /*#__PURE__*/jsx("div", {
1241
+ className: classNames([styles$a.container, className]),
1242
+ children: /*#__PURE__*/jsxs("div", {
1243
+ className: "d-flex align-items-end m-n1",
1244
+ children: [/*#__PURE__*/jsxs("div", {
1245
+ className: classNames(['p-1 align-self-stretch d-flex flex-column', styles$a.settings]),
1246
+ children: [/*#__PURE__*/jsx("h6", {
1247
+ className: classNames(['fw-normal', 'invisible', styles$a.title]),
1248
+ children: "Settings"
1249
+ }), /*#__PURE__*/jsx(Button, {
1250
+ className: classNames([styles$a.button, 'p-0', 'flex-grow-1', 'justify-content-center']),
1251
+ theme: screenParam !== null && field === null ? 'primary' : 'secondary',
1252
+ outline: screenParam === null || field !== null,
1253
+ size: "lg",
1254
+ icon: /*#__PURE__*/jsx(FontAwesomeIcon, {
1255
+ icon: faCogs
1256
+ }),
1257
+ href: url('screen', {
1258
+ screen: screen.id
1259
+ })
1260
+ })]
1261
+ }), states.map(function (state) {
1262
+ var id = state.id,
1263
+ _state$label = state.label,
1264
+ label = _state$label === void 0 ? null : _state$label,
1265
+ _state$repeatable = state.repeatable,
1266
+ repeatable = _state$repeatable === void 0 ? false : _state$repeatable,
1267
+ _state$withoutCreate = state.withoutCreate,
1268
+ withoutCreate = _state$withoutCreate === void 0 ? false : _state$withoutCreate,
1269
+ _state$fieldName = state.fieldName,
1270
+ fieldName = _state$fieldName === void 0 ? null : _state$fieldName;
1271
+ var repeatableItems = repeatable ? screen[fieldName || id] || [] : null;
1272
+ var onClickAdd = function onClickAdd() {
1273
+ var _ref5 = value || {},
1274
+ _ref5$components = _ref5.components,
1275
+ currentComponentsValue = _ref5$components === void 0 ? [] : _ref5$components;
1276
+ var currentScreenIndex = currentComponentsValue.findIndex(function (_ref6) {
1277
+ var screenId = _ref6.id;
1278
+ return screen.id === screenId;
1279
+ });
1280
+ var currentScreenValue = currentComponentsValue[currentScreenIndex] || {};
1281
+ var currentFieldValue = currentScreenValue[fieldName || id] || [];
1282
+ var newValue = _objectSpread(_objectSpread({}, value), {}, {
1283
+ components: [].concat(_toConsumableArray(currentComponentsValue.slice(0, currentScreenIndex)), [_objectSpread(_objectSpread({}, currentScreenValue), {}, _defineProperty({}, fieldName || id, [].concat(_toConsumableArray(currentFieldValue), [{}])))], _toConsumableArray(currentComponentsValue.slice(currentScreenIndex + 1)))
1284
+ });
1285
+ if (onChange !== null) {
1286
+ onChange(newValue);
1287
+ }
1288
+ push('screen.field', {
1289
+ screen: screen.id,
1290
+ field: [id, currentFieldValue.length]
1291
+ });
1292
+ };
1293
+ var onClickDelete = function onClickDelete(indexToDelete) {
1294
+ var _ref7 = value || {},
1295
+ _ref7$components = _ref7.components,
1296
+ currentComponentsValue = _ref7$components === void 0 ? [] : _ref7$components;
1297
+ var currentScreenIndex = currentComponentsValue.findIndex(function (_ref8) {
1298
+ var screenId = _ref8.id;
1299
+ return screen.id === screenId;
1300
+ });
1301
+ var currentScreenValue = currentComponentsValue[currentScreenIndex] || {};
1302
+ currentScreenValue[fieldName || id] || [];
1303
+ var newValue = _objectSpread(_objectSpread({}, value), {}, {
1304
+ components: [].concat(_toConsumableArray(currentComponentsValue.slice(0, currentScreenIndex)), [_objectSpread(_objectSpread({}, currentScreenValue), {}, _defineProperty({}, fieldName || id, (currentScreenValue[fieldName || id] || []).filter(function (_, index) {
1305
+ return index !== indexToDelete;
1306
+ })))], _toConsumableArray(currentComponentsValue.slice(currentScreenIndex + 1)))
1307
+ });
1308
+ if (onChange !== null) {
1309
+ onChange(newValue);
1310
+ }
1311
+ push('screen', {
1312
+ screen: screen.id
1313
+ });
1314
+ };
1315
+ return /*#__PURE__*/jsxs("div", {
1316
+ className: "p-1 align-self-stretch d-flex flex-column",
1317
+ children: [/*#__PURE__*/jsx("h6", {
1318
+ className: classNames(['fw-normal', 'text-body-secondary', styles$a.title]),
1319
+ children: /*#__PURE__*/jsx(FormattedMessage, _objectSpread({}, label))
1320
+ }), repeatable ? /*#__PURE__*/jsxs("ul", {
1321
+ className: "d-flex list-unstyled m-n1 flex-grow-1",
1322
+ children: [repeatableItems.map(function (item, index) {
1323
+ return /*#__PURE__*/jsx("li", {
1324
+ className: "p-1",
1325
+ children: /*#__PURE__*/jsx(ScreenWithPreview, {
1326
+ index: index,
1327
+ withIndexIndicator: true,
1328
+ withDeleteButtonOnRepeatables: true,
1329
+ screen: screen,
1330
+ screenState: "".concat(id, ".").concat(index),
1331
+ className: styles$a.button,
1332
+ active: currentState !== null && id === currentState.split('.')[0] && stateIndex !== null && parseInt(stateIndex, 10) === index,
1333
+ href: url('screen.field', {
1334
+ screen: screen.id,
1335
+ field: [id, index]
1336
+ }),
1337
+ onDeleteButtonClick: function onDeleteButtonClick() {
1338
+ return onClickDelete(index);
1339
+ }
1340
+ })
1341
+ });
1342
+ }), !withoutCreate ? /*#__PURE__*/jsx("li", {
1343
+ className: "p-1",
1344
+ children: /*#__PURE__*/jsx(Button, {
1345
+ className: classNames([styles$a.button, styles$a.addButton, 'h-100', 'p-0', 'justify-content-center']),
1346
+ theme: "secondary",
1347
+ outline: true,
1348
+ size: "lg",
1349
+ icon: /*#__PURE__*/jsx(FontAwesomeIcon, {
1350
+ icon: faPlus
1351
+ }),
1352
+ onClick: onClickAdd
1353
+ })
1354
+ }) : null]
1355
+ }) : /*#__PURE__*/jsx(ScreenWithPreview, {
1356
+ screen: screen,
1357
+ screenState: id,
1358
+ className: styles$a.button,
1359
+ active: id === currentState,
1360
+ href: url('screen.field', {
1361
+ screen: screen.id,
1362
+ field: id
1363
+ })
1364
+ // onClick={() => {
1365
+ // if (onStateChange !== null) {
1366
+ // onStateChange(id);
1367
+ // }
1368
+ // }}
1369
+ })]
1370
+ });
1371
+ })]
1219
1372
  })
1220
- })), states.map(function (state) {
1221
- var id = state.id,
1222
- _state$label = state.label,
1223
- label = _state$label === void 0 ? null : _state$label,
1224
- _state$repeatable = state.repeatable,
1225
- repeatable = _state$repeatable === void 0 ? false : _state$repeatable,
1226
- _state$withoutCreate = state.withoutCreate,
1227
- withoutCreate = _state$withoutCreate === void 0 ? false : _state$withoutCreate,
1228
- _state$fieldName = state.fieldName,
1229
- fieldName = _state$fieldName === void 0 ? null : _state$fieldName;
1230
- var repeatableItems = repeatable ? screen[fieldName || id] || [] : null;
1231
- var onClickAdd = function onClickAdd() {
1232
- var _ref5 = value || {},
1233
- _ref5$components = _ref5.components,
1234
- currentComponentsValue = _ref5$components === void 0 ? [] : _ref5$components;
1235
- var currentScreenIndex = currentComponentsValue.findIndex(function (_ref6) {
1236
- var screenId = _ref6.id;
1237
- return screen.id === screenId;
1238
- });
1239
- var currentScreenValue = currentComponentsValue[currentScreenIndex] || {};
1240
- var currentFieldValue = currentScreenValue[fieldName || id] || [];
1241
- var newValue = _objectSpread(_objectSpread({}, value), {}, {
1242
- components: [].concat(_toConsumableArray(currentComponentsValue.slice(0, currentScreenIndex)), [_objectSpread(_objectSpread({}, currentScreenValue), {}, _defineProperty({}, fieldName || id, [].concat(_toConsumableArray(currentFieldValue), [{}])))], _toConsumableArray(currentComponentsValue.slice(currentScreenIndex + 1)))
1243
- });
1244
- if (onChange !== null) {
1245
- onChange(newValue);
1246
- }
1247
- push('screen.field', {
1248
- screen: screen.id,
1249
- field: [id, currentFieldValue.length]
1250
- });
1251
- };
1252
- var onClickDelete = function onClickDelete(indexToDelete) {
1253
- var _ref7 = value || {},
1254
- _ref7$components = _ref7.components,
1255
- currentComponentsValue = _ref7$components === void 0 ? [] : _ref7$components;
1256
- var currentScreenIndex = currentComponentsValue.findIndex(function (_ref8) {
1257
- var screenId = _ref8.id;
1258
- return screen.id === screenId;
1259
- });
1260
- var currentScreenValue = currentComponentsValue[currentScreenIndex] || {};
1261
- currentScreenValue[fieldName || id] || [];
1262
- var newValue = _objectSpread(_objectSpread({}, value), {}, {
1263
- components: [].concat(_toConsumableArray(currentComponentsValue.slice(0, currentScreenIndex)), [_objectSpread(_objectSpread({}, currentScreenValue), {}, _defineProperty({}, fieldName || id, (currentScreenValue[fieldName || id] || []).filter(function (_, index) {
1264
- return index !== indexToDelete;
1265
- })))], _toConsumableArray(currentComponentsValue.slice(currentScreenIndex + 1)))
1266
- });
1267
- if (onChange !== null) {
1268
- onChange(newValue);
1269
- }
1270
- push('screen', {
1271
- screen: screen.id
1272
- });
1273
- };
1274
- return /*#__PURE__*/React.createElement("div", {
1275
- className: "p-1 align-self-stretch d-flex flex-column"
1276
- }, /*#__PURE__*/React.createElement("h6", {
1277
- className: classNames(['fw-normal', 'text-body-secondary', styles$a.title])
1278
- }, /*#__PURE__*/React.createElement(FormattedMessage, label)), repeatable ? /*#__PURE__*/React.createElement("ul", {
1279
- className: "d-flex list-unstyled m-n1 flex-grow-1"
1280
- }, repeatableItems.map(function (item, index) {
1281
- return /*#__PURE__*/React.createElement("li", {
1282
- className: "p-1"
1283
- }, /*#__PURE__*/React.createElement(ScreenWithPreview, {
1284
- index: index,
1285
- withIndexIndicator: true,
1286
- withDeleteButtonOnRepeatables: true,
1287
- screen: screen,
1288
- screenState: "".concat(id, ".").concat(index),
1289
- className: styles$a.button,
1290
- active: currentState !== null && id === currentState.split('.')[0] && stateIndex !== null && parseInt(stateIndex, 10) === index,
1291
- href: url('screen.field', {
1292
- screen: screen.id,
1293
- field: [id, index]
1294
- }),
1295
- onDeleteButtonClick: function onDeleteButtonClick() {
1296
- return onClickDelete(index);
1297
- }
1298
- }));
1299
- }), !withoutCreate ? /*#__PURE__*/React.createElement("li", {
1300
- className: "p-1"
1301
- }, /*#__PURE__*/React.createElement(Button, {
1302
- className: classNames([styles$a.button, styles$a.addButton, 'h-100', 'p-0', 'justify-content-center']),
1303
- theme: "secondary",
1304
- outline: true,
1305
- size: "lg",
1306
- icon: /*#__PURE__*/React.createElement(FontAwesomeIcon, {
1307
- icon: faPlus
1308
- }),
1309
- onClick: onClickAdd
1310
- })) : null) : /*#__PURE__*/React.createElement(ScreenWithPreview, {
1311
- screen: screen,
1312
- screenState: id,
1313
- className: styles$a.button,
1314
- active: id === currentState,
1315
- href: url('screen.field', {
1316
- screen: screen.id,
1317
- field: id
1318
- })
1319
- // onClick={() => {
1320
- // if (onStateChange !== null) {
1321
- // onStateChange(id);
1322
- // }
1323
- // }}
1324
- }));
1325
- })));
1373
+ });
1326
1374
  }
1327
1375
 
1328
1376
  var styles$9 = {"container":"micromag-editor-preview-container","inner":"micromag-editor-preview-inner","top":"micromag-editor-preview-top","bottom":"micromag-editor-preview-bottom","preview":"micromag-editor-preview-preview","viewerContainer":"micromag-editor-preview-viewerContainer","deviceMenu":"micromag-editor-preview-deviceMenu","devices":"micromag-editor-preview-devices","noStory":"micromag-editor-preview-noStory","story":"micromag-editor-preview-story"};
@@ -1434,55 +1482,65 @@ function EditorPreview(_ref) {
1434
1482
  var currentScreenStateId = currentScreenState !== null && repeatable ? "".concat(screenStateId, ".").concat(fieldParam.split('/').find(function (it) {
1435
1483
  return it.match(/^[0-9]+$/) !== null;
1436
1484
  }) || 0) : screenStateId;
1437
- return /*#__PURE__*/React.createElement("div", {
1485
+ return /*#__PURE__*/jsx("div", {
1438
1486
  className: classNames([styles$9.container, screens.map(function (screenName) {
1439
1487
  return styles$9["screen-".concat(screenName)];
1440
- }), className, _defineProperty({}, styles$9.withoutDevicesSizes, withoutDevicesSizes)])
1441
- }, /*#__PURE__*/React.createElement("div", {
1442
- className: styles$9.inner
1443
- }, currentScreenStates !== null && currentScreen !== null ? /*#__PURE__*/React.createElement("div", {
1444
- className: classNames([styles$9.top, 'px-1'])
1445
- }, /*#__PURE__*/React.createElement(ScreenStates, {
1446
- screen: currentScreen,
1447
- screenState: currentScreenStateId,
1448
- value: value,
1449
- onChange: onChange
1450
- })) : null, /*#__PURE__*/React.createElement("div", {
1451
- className: styles$9.bottom
1452
- }, /*#__PURE__*/React.createElement("div", {
1453
- className: styles$9.inner,
1454
- ref: bottomRef
1455
- }, /*#__PURE__*/React.createElement("div", {
1456
- className: styles$9.preview,
1457
- style: previewStyle
1458
- }, /*#__PURE__*/React.createElement("div", {
1459
- className: styles$9.viewerContainer
1460
- }, /*#__PURE__*/React.createElement(PlaybackProvider, null, /*#__PURE__*/React.createElement(Viewer, {
1461
- story: valueParsed,
1462
- storyIsParsed: true,
1463
- screen: screenId,
1464
- screenState: currentScreenStateId,
1465
- className: styles$9.story,
1466
- theme: viewerTheme,
1467
- interactions: null,
1468
- renderContext: "edit",
1469
- onScreenChange: onScreenChange,
1470
- withNavigationHint: false,
1471
- withoutNavigationArrow: true,
1472
- withoutTransitions: true,
1473
- withoutGestures: true,
1474
- withoutMenu: true
1475
- })))))), !withoutDevicesSizes ? /*#__PURE__*/React.createElement("div", {
1476
- className: styles$9.deviceMenu
1477
- }, /*#__PURE__*/React.createElement(DevicesMenu, {
1478
- items: devices.map(function (it) {
1479
- return _objectSpread(_objectSpread({}, it), {}, {
1480
- active: it.id === deviceId
1481
- });
1482
- }),
1483
- onClickItem: onClickDeviceItem,
1484
- className: styles$9.devices
1485
- })) : null));
1488
+ }), className, _defineProperty({}, styles$9.withoutDevicesSizes, withoutDevicesSizes)]),
1489
+ children: /*#__PURE__*/jsxs("div", {
1490
+ className: styles$9.inner,
1491
+ children: [currentScreenStates !== null && currentScreen !== null ? /*#__PURE__*/jsx("div", {
1492
+ className: classNames([styles$9.top, 'px-1']),
1493
+ children: /*#__PURE__*/jsx(ScreenStates, {
1494
+ screen: currentScreen,
1495
+ screenState: currentScreenStateId,
1496
+ value: value,
1497
+ onChange: onChange
1498
+ })
1499
+ }) : null, /*#__PURE__*/jsx("div", {
1500
+ className: styles$9.bottom,
1501
+ children: /*#__PURE__*/jsx("div", {
1502
+ className: styles$9.inner,
1503
+ ref: bottomRef,
1504
+ children: /*#__PURE__*/jsx("div", {
1505
+ className: styles$9.preview,
1506
+ style: previewStyle,
1507
+ children: /*#__PURE__*/jsx("div", {
1508
+ className: styles$9.viewerContainer,
1509
+ children: /*#__PURE__*/jsx(PlaybackProvider, {
1510
+ children: /*#__PURE__*/jsx(Viewer, {
1511
+ story: valueParsed,
1512
+ storyIsParsed: true,
1513
+ screen: screenId,
1514
+ screenState: currentScreenStateId,
1515
+ className: styles$9.story,
1516
+ theme: viewerTheme,
1517
+ interactions: null,
1518
+ renderContext: "edit",
1519
+ onScreenChange: onScreenChange,
1520
+ withNavigationHint: false,
1521
+ withoutNavigationArrow: true,
1522
+ withoutTransitions: true,
1523
+ withoutGestures: true,
1524
+ withoutMenu: true
1525
+ })
1526
+ })
1527
+ })
1528
+ })
1529
+ })
1530
+ }), !withoutDevicesSizes ? /*#__PURE__*/jsx("div", {
1531
+ className: styles$9.deviceMenu,
1532
+ children: /*#__PURE__*/jsx(DevicesMenu, {
1533
+ items: devices.map(function (it) {
1534
+ return _objectSpread(_objectSpread({}, it), {}, {
1535
+ active: it.id === deviceId
1536
+ });
1537
+ }),
1538
+ onClickItem: onClickDeviceItem,
1539
+ className: styles$9.devices
1540
+ })
1541
+ }) : null]
1542
+ })
1543
+ });
1486
1544
  }
1487
1545
 
1488
1546
  var iOS = /iPad|iPhone|iPod/.test(navigator.platform);
@@ -1875,44 +1933,54 @@ var SortableTreeItemActions = function SortableTreeItemActions(_ref) {
1875
1933
  _ref$containerRef = _ref.containerRef,
1876
1934
  containerRef = _ref$containerRef === void 0 ? null : _ref$containerRef,
1877
1935
  props = _objectWithoutProperties(_ref, _excluded$5);
1878
- return /*#__PURE__*/React.createElement("div", Object.assign({
1936
+ return /*#__PURE__*/jsx("div", _objectSpread(_objectSpread({
1879
1937
  className: classNames([styles$8.wrapper, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, styles$8.clone, clone), styles$8.ghost, ghost), styles$8.indicator, indicator), styles$8.disableSelection, disableSelection), styles$8.disableInteraction, disableInteraction), styles$8.withChildren, onCollapse !== null)]),
1880
1938
  ref: wrapperRef,
1881
1939
  style: {
1882
1940
  marginLeft: "".concat(indentationWidth * depth, "px"),
1883
1941
  marginRight: "".concat(5 * depth, "px")
1884
1942
  }
1885
- }, props), /*#__PURE__*/React.createElement("div", {
1886
- className: styles$8.inner,
1887
- ref: containerRef,
1888
- style: style
1889
- }, /*#__PURE__*/React.createElement("button", Object.assign({
1890
- className: classNames([styles$8.button, styles$8.handle]),
1891
- type: "button"
1892
- }, handleProps), /*#__PURE__*/React.createElement(FontAwesomeIcon, {
1893
- className: styles$8.icon,
1894
- icon: faGripLines
1895
- })), !clone && onRemove ? /*#__PURE__*/React.createElement("button", {
1896
- type: "button",
1897
- onClick: onRemove
1898
- }, /*#__PURE__*/React.createElement(FontAwesomeIcon, {
1899
- icon: faTimes
1900
- })) : null, clone && showCount && childCount && childCount > 1 ? /*#__PURE__*/React.createElement("span", {
1901
- className: styles$8.count
1902
- }, childCount) : null, showCollapsedCount && onCollapse && collapsed && childCount !== null && childCount > 0 ? /*#__PURE__*/React.createElement("span", {
1903
- className: styles$8.collapsedCount
1904
- }, childCount) : null, onCollapse && depth === 0 ? /*#__PURE__*/React.createElement("button", {
1905
- type: "button",
1906
- onClick: onCollapse,
1907
- className: classNames(styles$8.button, styles$8.collapse, collapsed && styles$8.collapsed)
1908
- }, /*#__PURE__*/React.createElement(FontAwesomeIcon, {
1909
- icon: faAngleDown
1910
- })) : null, /*#__PURE__*/React.createElement("div", {
1911
- className: styles$8.children
1912
- }, children)));
1943
+ }, props), {}, {
1944
+ children: /*#__PURE__*/jsxs("div", {
1945
+ className: styles$8.inner,
1946
+ ref: containerRef,
1947
+ style: style,
1948
+ children: [/*#__PURE__*/jsx("button", _objectSpread(_objectSpread({
1949
+ className: classNames([styles$8.button, styles$8.handle]),
1950
+ type: "button"
1951
+ }, handleProps), {}, {
1952
+ children: /*#__PURE__*/jsx(FontAwesomeIcon, {
1953
+ className: styles$8.icon,
1954
+ icon: faGripLines
1955
+ })
1956
+ })), !clone && onRemove ? /*#__PURE__*/jsx("button", {
1957
+ type: "button",
1958
+ onClick: onRemove,
1959
+ children: /*#__PURE__*/jsx(FontAwesomeIcon, {
1960
+ icon: faTimes
1961
+ })
1962
+ }) : null, clone && showCount && childCount && childCount > 1 ? /*#__PURE__*/jsx("span", {
1963
+ className: styles$8.count,
1964
+ children: childCount
1965
+ }) : null, showCollapsedCount && onCollapse && collapsed && childCount !== null && childCount > 0 ? /*#__PURE__*/jsx("span", {
1966
+ className: styles$8.collapsedCount,
1967
+ children: childCount
1968
+ }) : null, onCollapse && depth === 0 ? /*#__PURE__*/jsx("button", {
1969
+ type: "button",
1970
+ onClick: onCollapse,
1971
+ className: classNames(styles$8.button, styles$8.collapse, collapsed && styles$8.collapsed),
1972
+ children: /*#__PURE__*/jsx(FontAwesomeIcon, {
1973
+ icon: faAngleDown
1974
+ })
1975
+ }) : null, /*#__PURE__*/jsx("div", {
1976
+ className: styles$8.children,
1977
+ children: children
1978
+ })]
1979
+ })
1980
+ }));
1913
1981
  };
1914
1982
  var SortableTreeItemActions$1 = /*#__PURE__*/forwardRef(function (props, ref) {
1915
- return /*#__PURE__*/React.createElement(SortableTreeItemActions, Object.assign({}, props, {
1983
+ return /*#__PURE__*/jsx(SortableTreeItemActions, _objectSpread(_objectSpread({}, props), {}, {
1916
1984
  containerRef: ref
1917
1985
  }));
1918
1986
  });
@@ -1989,27 +2057,32 @@ function SortableTreeItem(_ref2) {
1989
2057
  onPointerUp(e);
1990
2058
  }
1991
2059
  }, [onPointerUp]);
1992
- return /*#__PURE__*/React.createElement("div", {
1993
- className: classNames([styles$7.container])
1994
- }, /*#__PURE__*/React.createElement(SortableTreeItemActions$1, Object.assign({
1995
- ref: setDraggableNodeRef,
1996
- wrapperRef: setDroppableNodeRef,
1997
- style: actionsStyle,
1998
- depth: depth,
1999
- ghost: isDragging,
2000
- disableSelection: iOS,
2001
- disableInteraction: isSorting,
2002
- handleProps: _objectSpread(_objectSpread(_objectSpread({}, attributes), listeners), {}, {
2003
- onPointerDown: onClickAction,
2004
- onPointerUp: cancellingPointerUp
2005
- }),
2006
- collapsed: collapsed,
2007
- onCollapse: onCollapse
2008
- }, props), Component !== null ? /*#__PURE__*/React.createElement("div", {
2009
- className: styles$7.parent
2010
- }, /*#__PURE__*/React.createElement(Component, value)) : null, childValue !== null ? /*#__PURE__*/React.createElement("div", {
2011
- className: styles$7.child
2012
- }, /*#__PURE__*/React.createElement(Component, childValue)) : null));
2060
+ return /*#__PURE__*/jsx("div", {
2061
+ className: classNames([styles$7.container]),
2062
+ children: /*#__PURE__*/jsxs(SortableTreeItemActions$1, _objectSpread(_objectSpread({
2063
+ ref: setDraggableNodeRef,
2064
+ wrapperRef: setDroppableNodeRef,
2065
+ style: actionsStyle,
2066
+ depth: depth,
2067
+ ghost: isDragging,
2068
+ disableSelection: iOS,
2069
+ disableInteraction: isSorting,
2070
+ handleProps: _objectSpread(_objectSpread(_objectSpread({}, attributes), listeners), {}, {
2071
+ onPointerDown: onClickAction,
2072
+ onPointerUp: cancellingPointerUp
2073
+ }),
2074
+ collapsed: collapsed,
2075
+ onCollapse: onCollapse
2076
+ }, props), {}, {
2077
+ children: [Component !== null ? /*#__PURE__*/jsx("div", {
2078
+ className: styles$7.parent,
2079
+ children: /*#__PURE__*/jsx(Component, _objectSpread({}, value))
2080
+ }) : null, childValue !== null ? /*#__PURE__*/jsx("div", {
2081
+ className: styles$7.child,
2082
+ children: /*#__PURE__*/jsx(Component, _objectSpread({}, childValue))
2083
+ }) : null]
2084
+ }))
2085
+ });
2013
2086
  }
2014
2087
 
2015
2088
  var styles$6 = {"item":"micromag-editor-sortable-sortable-tree-item","parent":"micromag-editor-sortable-sortable-tree-parent","group":"micromag-editor-sortable-sortable-tree-group","isLastChild":"micromag-editor-sortable-sortable-tree-isLastChild"};
@@ -2333,7 +2406,7 @@ function SortableTree(_ref2) {
2333
2406
  });
2334
2407
  });
2335
2408
  }, [setItems, setProperty]);
2336
- return /*#__PURE__*/React.createElement(DndContext, {
2409
+ return /*#__PURE__*/jsx(DndContext, {
2337
2410
  accessibility: {
2338
2411
  announcements: announcements
2339
2412
  }
@@ -2346,75 +2419,77 @@ function SortableTree(_ref2) {
2346
2419
  onDragMove: handleDragMove,
2347
2420
  onDragOver: handleDragOver,
2348
2421
  onDragEnd: handleDragEnd,
2349
- onDragCancel: handleDragCancel
2350
- }, /*#__PURE__*/React.createElement(SortableContext, {
2351
- items: sortedIds,
2352
- strategy: verticalListSortingStrategy
2353
- }, flattenedItems.map(function (_ref17, idx) {
2354
- var _flattenedItems;
2355
- var id = _ref17.id,
2356
- _ref17$children = _ref17.children,
2357
- children = _ref17$children === void 0 ? [] : _ref17$children,
2358
- collapsed = _ref17.collapsed,
2359
- depth = _ref17.depth;
2360
- var screenValue = defaultItems.find(function (_ref18) {
2361
- var _ref18$id = _ref18.id,
2362
- defaultId = _ref18$id === void 0 ? null : _ref18$id;
2363
- return defaultId === id;
2364
- });
2365
- var next = ((_flattenedItems = flattenedItems[idx + 1]) === null || _flattenedItems === void 0 ? void 0 : _flattenedItems.parentId) || null;
2366
- var isCollapsed = collapsed && children.length > 0;
2367
- var onCollapse = collapsible && children.length ? function () {
2368
- return handleCollapse(id);
2369
- } : null;
2370
- var currentDepth = id === activeId && projected ? projected.depth : depth;
2371
- var childCount = getChildCount(items, id);
2372
- var childValue = childCount > 0 && collapsed ? defaultItems.slice().reverse().find(function (_ref19) {
2373
- var _ref19$parentId = _ref19.parentId,
2374
- parentId = _ref19$parentId === void 0 ? null : _ref19$parentId;
2375
- return parentId === id;
2376
- }) : null;
2377
- return /*#__PURE__*/React.createElement("div", {
2378
- className: classNames([styles$6.item, _defineProperty(_defineProperty(_defineProperty({}, styles$6.parent, onCollapse !== null && !collapsed), styles$6.group, depth === 1), styles$6.isLastChild, next === null)]),
2379
- key: id
2380
- }, /*#__PURE__*/React.createElement(SortableTreeItem, {
2381
- key: id,
2382
- id: id,
2383
- depth: currentDepth,
2384
- indentationWidth: indentationWidth,
2385
- indicator: indicator,
2386
- collapsed: isCollapsed,
2387
- onCollapse: onCollapse,
2388
- onRemove: removable ? function () {
2389
- return handleRemove(id);
2390
- } : undefined,
2391
- childCount: childCount,
2392
- component: component,
2393
- value: (screenValue === null || screenValue === void 0 ? void 0 : screenValue.value) || null,
2394
- onClickItem: onClickItem,
2395
- index: idx,
2396
- childValue: (childValue === null || childValue === void 0 ? void 0 : childValue.value) || null
2397
- }));
2398
- }), /*#__PURE__*/createPortal(/*#__PURE__*/React.createElement(DragOverlay, {
2399
- dropAnimation: dropAnimation,
2400
- modifiers: indicator ? [adjustTranslate] : undefined
2401
- }, activeId && activeItem ? /*#__PURE__*/React.createElement("div", {
2402
- className: styles$6.item,
2403
- key: activeId
2404
- }, /*#__PURE__*/React.createElement(SortableTreeItem, {
2405
- id: activeId,
2406
- depth: activeItem.depth,
2407
- clone: true,
2408
- childCount: getChildCount(items, activeId) + 1,
2409
- indentationWidth: indentationWidth,
2410
- component: component,
2411
- value: activeValue === null || activeValue === void 0 ? void 0 : activeValue.value,
2412
- onClickItem: onClickItem,
2413
- index: flattenedItems.findIndex(function (_ref21) {
2414
- var id = _ref21.id;
2415
- return activeId === id;
2422
+ onDragCancel: handleDragCancel,
2423
+ children: /*#__PURE__*/jsxs(SortableContext, {
2424
+ items: sortedIds,
2425
+ strategy: verticalListSortingStrategy,
2426
+ children: [flattenedItems.map(function (_ref17, idx) {
2427
+ var _flattenedItems;
2428
+ var id = _ref17.id,
2429
+ _ref17$children = _ref17.children,
2430
+ children = _ref17$children === void 0 ? [] : _ref17$children,
2431
+ collapsed = _ref17.collapsed,
2432
+ depth = _ref17.depth;
2433
+ var screenValue = defaultItems.find(function (_ref18) {
2434
+ var _ref18$id = _ref18.id,
2435
+ defaultId = _ref18$id === void 0 ? null : _ref18$id;
2436
+ return defaultId === id;
2437
+ });
2438
+ var next = ((_flattenedItems = flattenedItems[idx + 1]) === null || _flattenedItems === void 0 ? void 0 : _flattenedItems.parentId) || null;
2439
+ var isCollapsed = collapsed && children.length > 0;
2440
+ var onCollapse = collapsible && children.length ? function () {
2441
+ return handleCollapse(id);
2442
+ } : null;
2443
+ var currentDepth = id === activeId && projected ? projected.depth : depth;
2444
+ var childCount = getChildCount(items, id);
2445
+ var childValue = childCount > 0 && collapsed ? defaultItems.slice().reverse().find(function (_ref19) {
2446
+ var _ref19$parentId = _ref19.parentId,
2447
+ parentId = _ref19$parentId === void 0 ? null : _ref19$parentId;
2448
+ return parentId === id;
2449
+ }) : null;
2450
+ return /*#__PURE__*/jsx("div", {
2451
+ className: classNames([styles$6.item, _defineProperty(_defineProperty(_defineProperty({}, styles$6.parent, onCollapse !== null && !collapsed), styles$6.group, depth === 1), styles$6.isLastChild, next === null)]),
2452
+ children: /*#__PURE__*/jsx(SortableTreeItem, {
2453
+ id: id,
2454
+ depth: currentDepth,
2455
+ indentationWidth: indentationWidth,
2456
+ indicator: indicator,
2457
+ collapsed: isCollapsed,
2458
+ onCollapse: onCollapse,
2459
+ onRemove: removable ? function () {
2460
+ return handleRemove(id);
2461
+ } : undefined,
2462
+ childCount: childCount,
2463
+ component: component,
2464
+ value: (screenValue === null || screenValue === void 0 ? void 0 : screenValue.value) || null,
2465
+ onClickItem: onClickItem,
2466
+ index: idx,
2467
+ childValue: (childValue === null || childValue === void 0 ? void 0 : childValue.value) || null
2468
+ }, id)
2469
+ }, id);
2470
+ }), /*#__PURE__*/createPortal(/*#__PURE__*/jsx(DragOverlay, {
2471
+ dropAnimation: dropAnimation,
2472
+ modifiers: indicator ? [adjustTranslate] : undefined,
2473
+ children: activeId && activeItem ? /*#__PURE__*/jsx("div", {
2474
+ className: styles$6.item,
2475
+ children: /*#__PURE__*/jsx(SortableTreeItem, {
2476
+ id: activeId,
2477
+ depth: activeItem.depth,
2478
+ clone: true,
2479
+ childCount: getChildCount(items, activeId) + 1,
2480
+ indentationWidth: indentationWidth,
2481
+ component: component,
2482
+ value: activeValue === null || activeValue === void 0 ? void 0 : activeValue.value,
2483
+ onClickItem: onClickItem,
2484
+ index: flattenedItems.findIndex(function (_ref21) {
2485
+ var id = _ref21.id;
2486
+ return activeId === id;
2487
+ })
2488
+ })
2489
+ }, activeId) : null
2490
+ }), document.body)]
2416
2491
  })
2417
- })) : null), document.body)));
2492
+ });
2418
2493
  }
2419
2494
 
2420
2495
  var styles$5 = {"items":"micromag-editor-menus-screens-items","item":"micromag-editor-menus-screens-item","container":"micromag-editor-menus-screens-container","settings":"micromag-editor-menus-screens-settings","noWrap":"micromag-editor-menus-screens-noWrap","isVertical":"micromag-editor-menus-screens-isVertical","withPlaceholder":"micromag-editor-menus-screens-withPlaceholder"};
@@ -2464,27 +2539,28 @@ function ScreensMenu(_ref) {
2464
2539
  active = _ref2.active,
2465
2540
  href = _ref2.href,
2466
2541
  item = _objectWithoutProperties(_ref2, _excluded$3);
2467
- return /*#__PURE__*/React.createElement("li", {
2468
- key: item.id,
2542
+ return /*#__PURE__*/jsxs("li", {
2469
2543
  className: classNames([styles$5.item, itemCustomClassName, itemClassName, {}]),
2470
- "data-screen-id": item.id
2471
- }, /*#__PURE__*/React.createElement(ScreenWithPreview, {
2472
- index: index,
2473
- screen: withPlaceholder ? _objectSpread(_objectSpread({}, screen), {}, {
2474
- type: type
2475
- }) : screen,
2476
- href: href,
2477
- className: buttonClassName,
2478
- title: title,
2479
- active: active,
2480
- withPreview: withPreview,
2481
- withPlaceholder: withPlaceholder,
2482
- withName: withName,
2483
- onClick: onClick,
2484
- onClickItem: onClickItem
2485
- }), settings !== null ? /*#__PURE__*/React.createElement("div", {
2486
- className: classNames([settingsClassName, styles$5.settings, 'p-2'])
2487
- }, isFunction(settings) ? settings(index) : settings) : null);
2544
+ "data-screen-id": item.id,
2545
+ children: [/*#__PURE__*/jsx(ScreenWithPreview, {
2546
+ index: index,
2547
+ screen: withPlaceholder ? _objectSpread(_objectSpread({}, screen), {}, {
2548
+ type: type
2549
+ }) : screen,
2550
+ href: href,
2551
+ className: buttonClassName,
2552
+ title: title,
2553
+ active: active,
2554
+ withPreview: withPreview,
2555
+ withPlaceholder: withPlaceholder,
2556
+ withName: withName,
2557
+ onClick: onClick,
2558
+ onClickItem: onClickItem
2559
+ }), settings !== null ? /*#__PURE__*/jsx("div", {
2560
+ className: classNames([settingsClassName, styles$5.settings, 'p-2']),
2561
+ children: isFunction(settings) ? settings(index) : settings
2562
+ }) : null]
2563
+ }, item.id);
2488
2564
  }) : [];
2489
2565
  var sortableItems = useMemo(function () {
2490
2566
  return isTree ? items.map(function (_ref3) {
@@ -2517,24 +2593,27 @@ function ScreensMenu(_ref) {
2517
2593
  };
2518
2594
  });
2519
2595
  }, [items, isTree, items.length]);
2520
- return /*#__PURE__*/React.createElement("div", {
2521
- className: classNames([styles$5.container, className, _defineProperty(_defineProperty(_defineProperty(_defineProperty({}, styles$5.noWrap, noWrap), styles$5.isVertical, isVertical), styles$5.isTree, isTree), styles$5.withPlaceholder, withPlaceholder)])
2522
- }, isTree && !sortable ? /*#__PURE__*/React.createElement(SortableTree, {
2523
- items: sortableItems,
2524
- component: ScreenWithPreview,
2525
- onClickItem: onClickItem,
2526
- onChange: onOrderChange
2527
- }) : null, !isTree && sortable && items.length > 1 ? /*#__PURE__*/React.createElement(ReactSortable, {
2528
- list: sortableItems,
2529
- setList: onOrderChange,
2530
- animation: 200,
2531
- delayOnTouchStart: true,
2532
- delay: 2,
2533
- tag: "ul",
2534
- className: styles$5.items
2535
- }, itemsElements) : null, !isTree && (!sortable || items.length < 1) ? /*#__PURE__*/React.createElement("ul", {
2536
- className: styles$5.items
2537
- }, itemsElements) : null);
2596
+ return /*#__PURE__*/jsxs("div", {
2597
+ className: classNames([styles$5.container, className, _defineProperty(_defineProperty(_defineProperty(_defineProperty({}, styles$5.noWrap, noWrap), styles$5.isVertical, isVertical), styles$5.isTree, isTree), styles$5.withPlaceholder, withPlaceholder)]),
2598
+ children: [isTree && !sortable ? /*#__PURE__*/jsx(SortableTree, {
2599
+ items: sortableItems,
2600
+ component: ScreenWithPreview,
2601
+ onClickItem: onClickItem,
2602
+ onChange: onOrderChange
2603
+ }) : null, !isTree && sortable && items.length > 1 ? /*#__PURE__*/jsx(ReactSortable, {
2604
+ list: sortableItems,
2605
+ setList: onOrderChange,
2606
+ animation: 200,
2607
+ delayOnTouchStart: true,
2608
+ delay: 2,
2609
+ tag: "ul",
2610
+ className: styles$5.items,
2611
+ children: itemsElements
2612
+ }) : null, !isTree && (!sortable || items.length < 1) ? /*#__PURE__*/jsx("ul", {
2613
+ className: styles$5.items,
2614
+ children: itemsElements
2615
+ }) : null]
2616
+ });
2538
2617
  }
2539
2618
 
2540
2619
  var styles$4 = {"container":"micromag-editor-menus-screen-types-container","row":"micromag-editor-menus-screen-types-row","screen":"micromag-editor-menus-screen-types-screen","button":"micromag-editor-menus-screen-types-button"};
@@ -2614,33 +2693,38 @@ function ScreenTypes(_ref) {
2614
2693
  }, []);
2615
2694
  return orderBy(groupItems, ['order', 'name'], ['asc', 'asc']);
2616
2695
  }, [finalDefinitions, selectedTypes]);
2617
- return /*#__PURE__*/React.createElement("div", {
2618
- className: classNames([styles$4.container, className])
2619
- }, /*#__PURE__*/React.createElement("div", {
2620
- className: styles$4.rows
2621
- }, groups.map(function (_ref6) {
2622
- var id = _ref6.id,
2623
- name = _ref6.name,
2624
- items = _ref6.items;
2625
- return /*#__PURE__*/React.createElement("div", {
2626
- key: "group-".concat(id),
2627
- className: styles$4.row
2628
- }, /*#__PURE__*/React.createElement(Label, null, name), /*#__PURE__*/React.createElement("div", {
2629
- className: styles$4.layouts
2630
- }, /*#__PURE__*/React.createElement(ScreensMenu, {
2631
- items: items,
2632
- withPlaceholder: true,
2633
- withName: true,
2634
- itemClassName: classNames([styles$4.screen, 'border', 'rounded', {
2635
- 'border-secondary': selectedTypes === null,
2636
- 'border-dark': selectedTypes !== null,
2637
- 'bg-secondary': selectedTypes === null,
2638
- 'text-secondary': selectedTypes !== null
2639
- }]),
2640
- buttonClassName: styles$4.button,
2641
- onClickItem: onClickItem
2642
- })));
2643
- })));
2696
+ return /*#__PURE__*/jsx("div", {
2697
+ className: classNames([styles$4.container, className]),
2698
+ children: /*#__PURE__*/jsx("div", {
2699
+ className: styles$4.rows,
2700
+ children: groups.map(function (_ref6) {
2701
+ var id = _ref6.id,
2702
+ name = _ref6.name,
2703
+ items = _ref6.items;
2704
+ return /*#__PURE__*/jsxs("div", {
2705
+ className: styles$4.row,
2706
+ children: [/*#__PURE__*/jsx(Label, {
2707
+ children: name
2708
+ }), /*#__PURE__*/jsx("div", {
2709
+ className: styles$4.layouts,
2710
+ children: /*#__PURE__*/jsx(ScreensMenu, {
2711
+ items: items,
2712
+ withPlaceholder: true,
2713
+ withName: true,
2714
+ itemClassName: classNames([styles$4.screen, 'border', 'rounded', {
2715
+ 'border-secondary': selectedTypes === null,
2716
+ 'border-dark': selectedTypes !== null,
2717
+ 'bg-secondary': selectedTypes === null,
2718
+ 'text-secondary': selectedTypes !== null
2719
+ }]),
2720
+ buttonClassName: styles$4.button,
2721
+ onClickItem: onClickItem
2722
+ })
2723
+ })]
2724
+ }, "group-".concat(id));
2725
+ })
2726
+ })
2727
+ });
2644
2728
  }
2645
2729
 
2646
2730
  var styles$3 = {"container":"micromag-editor-modals-screen-types-container"};
@@ -2655,21 +2739,24 @@ function ScreenTypesModal(_ref) {
2655
2739
  onRequestClose = _ref$onRequestClose === void 0 ? null : _ref$onRequestClose,
2656
2740
  _ref$onClickScreenTyp = _ref.onClickScreenType,
2657
2741
  onClickScreenType = _ref$onClickScreenTyp === void 0 ? null : _ref$onClickScreenTyp;
2658
- return /*#__PURE__*/React.createElement(Modal, null, /*#__PURE__*/React.createElement(ModalDialog, {
2659
- title: /*#__PURE__*/React.createElement(FormattedMessage, {
2660
- id: "QBaiO0",
2661
- defaultMessage: [{
2662
- "type": 0,
2663
- "value": "Add a screen"
2664
- }]
2665
- }),
2666
- className: classNames([styles$3.container, className]),
2667
- onClose: onRequestClose
2668
- }, /*#__PURE__*/React.createElement(ScreenTypes, {
2669
- selectedTypes: selectedTypes,
2670
- className: styles$3.menu,
2671
- onClickItem: onClickScreenType
2672
- })));
2742
+ return /*#__PURE__*/jsx(Modal, {
2743
+ children: /*#__PURE__*/jsx(ModalDialog, {
2744
+ title: /*#__PURE__*/jsx(FormattedMessage, {
2745
+ id: "QBaiO0",
2746
+ defaultMessage: [{
2747
+ "type": 0,
2748
+ "value": "Add a screen"
2749
+ }]
2750
+ }),
2751
+ className: classNames([styles$3.container, className]),
2752
+ onClose: onRequestClose,
2753
+ children: /*#__PURE__*/jsx(ScreenTypes, {
2754
+ selectedTypes: selectedTypes,
2755
+ className: styles$3.menu,
2756
+ onClickItem: onClickScreenType
2757
+ })
2758
+ })
2759
+ });
2673
2760
  }
2674
2761
 
2675
2762
  var styles$2 = {"container":"micromag-editor-screens-container","navbar":"micromag-editor-screens-navbar"};
@@ -2821,102 +2908,115 @@ function EditorScreens(_ref) {
2821
2908
  var onCreateModalRequestClose = useCallback(function () {
2822
2909
  return setCreateModalOpened(false);
2823
2910
  }, [setCreateModalOpened]);
2824
- return /*#__PURE__*/React.createElement("div", {
2825
- className: classNames(['d-flex', 'flex-column', styles$2.container, className])
2826
- }, /*#__PURE__*/React.createElement(Navbar, {
2827
- compact: true,
2828
- noWrap: true,
2829
- withoutCollapse: true,
2830
- className: classNames(['sticky-top', styles$2.navbar])
2831
- }, /*#__PURE__*/React.createElement("strong", {
2832
- className: "mb-0 me-auto"
2833
- }, /*#__PURE__*/React.createElement(FormattedMessage, {
2834
- id: "jf+4Hq",
2835
- defaultMessage: [{
2836
- "type": 0,
2837
- "value": "Screens"
2838
- }]
2839
- })), /*#__PURE__*/React.createElement(Button, {
2840
- theme: "primary",
2841
- size: "sm",
2842
- onClick: onClickAdd,
2843
- icon: /*#__PURE__*/React.createElement(FontAwesomeIcon, {
2844
- icon: faPlus
2845
- })
2846
- })), /*#__PURE__*/React.createElement("div", {
2847
- className: "flex-grow-1 d-flex w-100 p-2"
2848
- }, /*#__PURE__*/React.createElement(Switch, null, /*#__PURE__*/React.createElement(Route, {
2849
- path: "".concat(routes.screen, "/(.*)?")
2850
- }, function (_ref16) {
2851
- var _ref16$screen = _ref16.screen,
2852
- screenId = _ref16$screen === void 0 ? null : _ref16$screen;
2853
- return screens.length > 0 ? /*#__PURE__*/React.createElement(ScreensMenu, {
2854
- items: screens.map(function (it) {
2855
- return {
2856
- id: it.id,
2857
- screen: it,
2858
- href: url('screen', {
2859
- screen: it.id
2860
- }),
2861
- active: it.id === screenId
2862
- };
2863
- }),
2864
- isVertical: isVertical,
2865
- withPreview: true,
2866
- sortable: !isTree,
2867
- className: "w-100",
2868
- onClickItem: onClickScreen,
2869
- onOrderChange: onOrderChange,
2870
- isTree: isTree
2871
- }) : /*#__PURE__*/React.createElement(Empty, {
2872
- className: "flex-grow-1 p-2"
2873
- }, /*#__PURE__*/React.createElement(Button, {
2874
- theme: "primary",
2875
- onClick: onClickAdd
2876
- }, /*#__PURE__*/React.createElement(FormattedMessage, {
2877
- id: "JoWKee",
2878
- defaultMessage: [{
2879
- "type": 0,
2880
- "value": "Create your first screen"
2881
- }]
2882
- })));
2883
- }), /*#__PURE__*/React.createElement(Route, null, screens.length > 0 ? /*#__PURE__*/React.createElement(ScreensMenu, {
2884
- items: screens.map(function (it) {
2885
- return {
2886
- id: it.id,
2887
- screen: it,
2888
- href: url('screen', {
2889
- screen: it.id
2890
- }),
2891
- active: false
2892
- };
2893
- }),
2894
- isVertical: isVertical,
2895
- withPreview: true,
2896
- sortable: !isTree,
2897
- className: "w-100",
2898
- onClickItem: onClickScreen,
2899
- onOrderChange: onOrderChange,
2900
- isTree: isTree
2901
- }) : /*#__PURE__*/React.createElement(Empty, {
2902
- className: "flex-grow-1 p-2"
2903
- }, /*#__PURE__*/React.createElement(Button, {
2904
- theme: "primary",
2905
- onClick: onClickAdd
2906
- }, /*#__PURE__*/React.createElement(FormattedMessage, {
2907
- id: "JoWKee",
2908
- defaultMessage: [{
2909
- "type": 0,
2910
- "value": "Create your first screen"
2911
- }]
2912
- })))))), createModalOpened ? /*#__PURE__*/React.createElement(ScreenTypesModal, {
2913
- selectedTypes: isTheme ? screens.map(function (_ref17) {
2914
- var type = _ref17.type;
2915
- return type;
2916
- }) : [],
2917
- onClickScreenType: onClickScreenType,
2918
- onRequestClose: onCreateModalRequestClose
2919
- }) : null);
2911
+ return /*#__PURE__*/jsxs("div", {
2912
+ className: classNames(['d-flex', 'flex-column', styles$2.container, className]),
2913
+ children: [/*#__PURE__*/jsxs(Navbar, {
2914
+ compact: true,
2915
+ noWrap: true,
2916
+ withoutCollapse: true,
2917
+ className: classNames(['sticky-top', styles$2.navbar]),
2918
+ children: [/*#__PURE__*/jsx("strong", {
2919
+ className: "mb-0 me-auto",
2920
+ children: /*#__PURE__*/jsx(FormattedMessage, {
2921
+ id: "jf+4Hq",
2922
+ defaultMessage: [{
2923
+ "type": 0,
2924
+ "value": "Screens"
2925
+ }]
2926
+ })
2927
+ }), /*#__PURE__*/jsx(Button, {
2928
+ theme: "primary",
2929
+ size: "sm",
2930
+ onClick: onClickAdd,
2931
+ icon: /*#__PURE__*/jsx(FontAwesomeIcon, {
2932
+ icon: faPlus
2933
+ })
2934
+ })]
2935
+ }), /*#__PURE__*/jsx("div", {
2936
+ className: "flex-grow-1 d-flex w-100 p-2",
2937
+ children: /*#__PURE__*/jsxs(Switch, {
2938
+ children: [/*#__PURE__*/jsx(Route, {
2939
+ path: "".concat(routes.screen, "/(.*)?"),
2940
+ children: function children(_ref16) {
2941
+ var _ref16$screen = _ref16.screen,
2942
+ screenId = _ref16$screen === void 0 ? null : _ref16$screen;
2943
+ return screens.length > 0 ? /*#__PURE__*/jsx(ScreensMenu, {
2944
+ items: screens.map(function (it) {
2945
+ return {
2946
+ id: it.id,
2947
+ screen: it,
2948
+ href: url('screen', {
2949
+ screen: it.id
2950
+ }),
2951
+ active: it.id === screenId
2952
+ };
2953
+ }),
2954
+ isVertical: isVertical,
2955
+ withPreview: true,
2956
+ sortable: !isTree,
2957
+ className: "w-100",
2958
+ onClickItem: onClickScreen,
2959
+ onOrderChange: onOrderChange,
2960
+ isTree: isTree
2961
+ }) : /*#__PURE__*/jsx(Empty, {
2962
+ className: "flex-grow-1 p-2",
2963
+ children: /*#__PURE__*/jsx(Button, {
2964
+ theme: "primary",
2965
+ onClick: onClickAdd,
2966
+ children: /*#__PURE__*/jsx(FormattedMessage, {
2967
+ id: "JoWKee",
2968
+ defaultMessage: [{
2969
+ "type": 0,
2970
+ "value": "Create your first screen"
2971
+ }]
2972
+ })
2973
+ })
2974
+ });
2975
+ }
2976
+ }), /*#__PURE__*/jsx(Route, {
2977
+ children: screens.length > 0 ? /*#__PURE__*/jsx(ScreensMenu, {
2978
+ items: screens.map(function (it) {
2979
+ return {
2980
+ id: it.id,
2981
+ screen: it,
2982
+ href: url('screen', {
2983
+ screen: it.id
2984
+ }),
2985
+ active: false
2986
+ };
2987
+ }),
2988
+ isVertical: isVertical,
2989
+ withPreview: true,
2990
+ sortable: !isTree,
2991
+ className: "w-100",
2992
+ onClickItem: onClickScreen,
2993
+ onOrderChange: onOrderChange,
2994
+ isTree: isTree
2995
+ }) : /*#__PURE__*/jsx(Empty, {
2996
+ className: "flex-grow-1 p-2",
2997
+ children: /*#__PURE__*/jsx(Button, {
2998
+ theme: "primary",
2999
+ onClick: onClickAdd,
3000
+ children: /*#__PURE__*/jsx(FormattedMessage, {
3001
+ id: "JoWKee",
3002
+ defaultMessage: [{
3003
+ "type": 0,
3004
+ "value": "Create your first screen"
3005
+ }]
3006
+ })
3007
+ })
3008
+ })
3009
+ })]
3010
+ })
3011
+ }), createModalOpened ? /*#__PURE__*/jsx(ScreenTypesModal, {
3012
+ selectedTypes: isTheme ? screens.map(function (_ref17) {
3013
+ var type = _ref17.type;
3014
+ return type;
3015
+ }) : [],
3016
+ onClickScreenType: onClickScreenType,
3017
+ onRequestClose: onCreateModalRequestClose
3018
+ }) : null]
3019
+ });
2920
3020
  }
2921
3021
 
2922
3022
  var styles$1 = {"container":"micromag-editor-container","inner":"micromag-editor-inner","left":"micromag-editor-left","center":"micromag-editor-center","right":"micromag-editor-right","visible":"micromag-editor-visible","preview":"micromag-editor-preview","fullscreen":"micromag-editor-fullscreen","top":"micromag-editor-top"};
@@ -3031,83 +3131,96 @@ function Editor(_ref) {
3031
3131
  screens.scrollTop = cnt.offsetTop + item.offsetTop + item.offsetHeight / 2 - screens.clientHeight / 2;
3032
3132
  }
3033
3133
  }, [screenId]);
3034
- return /*#__PURE__*/React.createElement(ModalsProvider, null, /*#__PURE__*/React.createElement(PanelsProvider, null, /*#__PURE__*/React.createElement(ScreenSizeProvider, {
3035
- size: screenSize
3036
- }, /*#__PURE__*/React.createElement("div", {
3037
- className: classNames([styles$1.container, screenSize !== null ? screenSize.screens.map(function (screenName) {
3038
- return styles$1["screen-".concat(screenName)];
3039
- }) : null, className, _defineProperty({}, styles$1.fullscreen, fullscreen)]),
3040
- ref: refContainer
3041
- }, /*#__PURE__*/React.createElement(Navbar, {
3042
- theme: "light",
3043
- compact: true,
3044
- noWrap: true,
3045
- withoutCollapse: true,
3046
- className: styles$1.top
3047
- }, mobileView !== 'screens' ? /*#__PURE__*/React.createElement(Button, {
3048
- size: "sm",
3049
- theme: "secondary",
3050
- onClick: onClickScreens,
3051
- className: "me-auto"
3052
- }, /*#__PURE__*/React.createElement(FormattedMessage, {
3053
- id: "wkysUu",
3054
- defaultMessage: [{
3055
- "type": 0,
3056
- "value": "Screens"
3057
- }]
3058
- })) : /*#__PURE__*/React.createElement("span", null), mobileView !== 'form' ? /*#__PURE__*/React.createElement(Button, {
3059
- size: "sm",
3060
- theme: "primary",
3061
- onClick: onClickEdit
3062
- }, /*#__PURE__*/React.createElement(FormattedMessage, {
3063
- id: "HseFdk",
3064
- defaultMessage: [{
3065
- "type": 0,
3066
- "value": "Edit"
3067
- }]
3068
- })) : null, mobileView === 'form' ? /*#__PURE__*/React.createElement(Button, {
3069
- size: "sm",
3070
- theme: "primary",
3071
- onClick: onClickViewScreen
3072
- }, /*#__PURE__*/React.createElement(FormattedMessage, {
3073
- id: "4POR3B",
3074
- defaultMessage: [{
3075
- "type": 0,
3076
- "value": "View screen"
3077
- }]
3078
- })) : null), /*#__PURE__*/React.createElement("div", {
3079
- className: styles$1.inner
3080
- }, /*#__PURE__*/React.createElement("div", {
3081
- className: classNames([styles$1.left, _defineProperty({}, styles$1.visible, !isMobile || mobileView === 'screens')]),
3082
- ref: refScreensContainer
3083
- }, /*#__PURE__*/React.createElement(EditorScreens, {
3084
- value: story,
3085
- isTheme: isTheme,
3086
- isCreateOpened: isCreateOpened,
3087
- isParsed: true,
3088
- onChange: onStoryChange,
3089
- onClickScreen: onClickScreen,
3090
- isVertical: !isMobile,
3091
- className: styles$1.inner,
3092
- isTree: true
3093
- })), /*#__PURE__*/React.createElement("div", {
3094
- className: classNames([styles$1.center, _defineProperty({}, styles$1.visible, !isMobile || mobileView === 'preview')])
3095
- }, /*#__PURE__*/React.createElement(EditorPreview, {
3096
- value: story,
3097
- isTheme: isTheme,
3098
- viewerTheme: viewerTheme,
3099
- className: styles$1.preview,
3100
- onScreenChange: onPreviewScreenChange,
3101
- onChange: onStoryChange
3102
- })), /*#__PURE__*/React.createElement("div", {
3103
- className: classNames([styles$1.right, _defineProperty({}, styles$1.visible, !isMobile || mobileView === 'form')])
3104
- }, /*#__PURE__*/React.createElement(EditForm, {
3105
- key: screenId,
3106
- value: story,
3107
- isTheme: isTheme,
3108
- onChange: onStoryChange,
3109
- className: styles$1.inner
3110
- }))), /*#__PURE__*/React.createElement(Modals, null)))));
3134
+ return /*#__PURE__*/jsx(ModalsProvider, {
3135
+ children: /*#__PURE__*/jsx(PanelsProvider, {
3136
+ children: /*#__PURE__*/jsx(ScreenSizeProvider, {
3137
+ size: screenSize,
3138
+ children: /*#__PURE__*/jsxs("div", {
3139
+ className: classNames([styles$1.container, screenSize !== null ? screenSize.screens.map(function (screenName) {
3140
+ return styles$1["screen-".concat(screenName)];
3141
+ }) : null, className, _defineProperty({}, styles$1.fullscreen, fullscreen)]),
3142
+ ref: refContainer,
3143
+ children: [/*#__PURE__*/jsxs(Navbar, {
3144
+ theme: "light",
3145
+ compact: true,
3146
+ noWrap: true,
3147
+ withoutCollapse: true,
3148
+ className: styles$1.top,
3149
+ children: [mobileView !== 'screens' ? /*#__PURE__*/jsx(Button, {
3150
+ size: "sm",
3151
+ theme: "secondary",
3152
+ onClick: onClickScreens,
3153
+ className: "me-auto",
3154
+ children: /*#__PURE__*/jsx(FormattedMessage, {
3155
+ id: "wkysUu",
3156
+ defaultMessage: [{
3157
+ "type": 0,
3158
+ "value": "Screens"
3159
+ }]
3160
+ })
3161
+ }) : /*#__PURE__*/jsx("span", {}), mobileView !== 'form' ? /*#__PURE__*/jsx(Button, {
3162
+ size: "sm",
3163
+ theme: "primary",
3164
+ onClick: onClickEdit,
3165
+ children: /*#__PURE__*/jsx(FormattedMessage, {
3166
+ id: "HseFdk",
3167
+ defaultMessage: [{
3168
+ "type": 0,
3169
+ "value": "Edit"
3170
+ }]
3171
+ })
3172
+ }) : null, mobileView === 'form' ? /*#__PURE__*/jsx(Button, {
3173
+ size: "sm",
3174
+ theme: "primary",
3175
+ onClick: onClickViewScreen,
3176
+ children: /*#__PURE__*/jsx(FormattedMessage, {
3177
+ id: "4POR3B",
3178
+ defaultMessage: [{
3179
+ "type": 0,
3180
+ "value": "View screen"
3181
+ }]
3182
+ })
3183
+ }) : null]
3184
+ }), /*#__PURE__*/jsxs("div", {
3185
+ className: styles$1.inner,
3186
+ children: [/*#__PURE__*/jsx("div", {
3187
+ className: classNames([styles$1.left, _defineProperty({}, styles$1.visible, !isMobile || mobileView === 'screens')]),
3188
+ ref: refScreensContainer,
3189
+ children: /*#__PURE__*/jsx(EditorScreens, {
3190
+ value: story,
3191
+ isTheme: isTheme,
3192
+ isCreateOpened: isCreateOpened,
3193
+ isParsed: true,
3194
+ onChange: onStoryChange,
3195
+ onClickScreen: onClickScreen,
3196
+ isVertical: !isMobile,
3197
+ className: styles$1.inner,
3198
+ isTree: true
3199
+ })
3200
+ }), /*#__PURE__*/jsx("div", {
3201
+ className: classNames([styles$1.center, _defineProperty({}, styles$1.visible, !isMobile || mobileView === 'preview')]),
3202
+ children: /*#__PURE__*/jsx(EditorPreview, {
3203
+ value: story,
3204
+ isTheme: isTheme,
3205
+ viewerTheme: viewerTheme,
3206
+ className: styles$1.preview,
3207
+ onScreenChange: onPreviewScreenChange,
3208
+ onChange: onStoryChange
3209
+ })
3210
+ }), /*#__PURE__*/jsx("div", {
3211
+ className: classNames([styles$1.right, _defineProperty({}, styles$1.visible, !isMobile || mobileView === 'form')]),
3212
+ children: /*#__PURE__*/jsx(EditForm, {
3213
+ value: story,
3214
+ isTheme: isTheme,
3215
+ onChange: onStoryChange,
3216
+ className: styles$1.inner
3217
+ }, screenId)
3218
+ })]
3219
+ }), /*#__PURE__*/jsx(Modals, {})]
3220
+ })
3221
+ })
3222
+ })
3223
+ });
3111
3224
  }
3112
3225
 
3113
3226
  var styles = {"container":"micromag-editor-forms-settings-container","inner":"micromag-editor-forms-settings-inner"};
@@ -3145,20 +3258,22 @@ function SettingsForm(_ref) {
3145
3258
  onChange(newValue);
3146
3259
  }
3147
3260
  }, [value, onChange]);
3148
- return /*#__PURE__*/React.createElement("div", {
3149
- className: classNames([styles.container, className])
3150
- }, /*#__PURE__*/React.createElement("div", {
3151
- className: styles.inner
3152
- }, /*#__PURE__*/React.createElement(SettingsComponent, {
3153
- name: name,
3154
- field: field,
3155
- fields: settings,
3156
- value: value,
3157
- onChange: onSettingsChange,
3158
- gotoFieldForm: gotoFieldForm,
3159
- closeFieldForm: closeFieldForm,
3160
- fieldsProps: fieldsProps
3161
- })));
3261
+ return /*#__PURE__*/jsx("div", {
3262
+ className: classNames([styles.container, className]),
3263
+ children: /*#__PURE__*/jsx("div", {
3264
+ className: styles.inner,
3265
+ children: /*#__PURE__*/jsx(SettingsComponent, {
3266
+ name: name,
3267
+ field: field,
3268
+ fields: settings,
3269
+ value: value,
3270
+ onChange: onSettingsChange,
3271
+ gotoFieldForm: gotoFieldForm,
3272
+ closeFieldForm: closeFieldForm,
3273
+ fieldsProps: fieldsProps
3274
+ })
3275
+ })
3276
+ });
3162
3277
  }
3163
3278
 
3164
3279
  // eslint-disable-next-line import/prefer-default-export
@@ -3173,10 +3288,12 @@ function FormsProvider(_ref) {
3173
3288
  var _ref$children = _ref.children,
3174
3289
  children = _ref$children === void 0 ? null : _ref$children,
3175
3290
  props = _objectWithoutProperties(_ref, _excluded$1);
3176
- return /*#__PURE__*/React.createElement(ComponentsProvider, Object.assign({
3291
+ return /*#__PURE__*/jsx(ComponentsProvider, _objectSpread(_objectSpread({
3177
3292
  namespace: FORMS_NAMESPACE,
3178
3293
  components: FormsComponents
3179
- }, props), children);
3294
+ }, props), {}, {
3295
+ children: children
3296
+ }));
3180
3297
  }
3181
3298
 
3182
3299
  var home = "/";
@@ -3223,31 +3340,51 @@ function EditorContainer(_ref) {
3223
3340
  base: !memoryRouter ? basePath : null
3224
3341
  };
3225
3342
  }, [basePath, memoryRouter]);
3226
- return /*#__PURE__*/React.createElement(Router, routerProps, /*#__PURE__*/React.createElement(UppyProvider, uppy, /*#__PURE__*/React.createElement(StoryProvider, {
3227
- story: value
3228
- }, /*#__PURE__*/React.createElement(ScreensProvider, {
3229
- filterNamespaces: true,
3230
- namespaces: screenNamespaces
3231
- }, /*#__PURE__*/React.createElement(GoogleKeysProvider, {
3232
- apiKey: googleApiKey
3233
- }, /*#__PURE__*/React.createElement(GoogleMapsClientProvider, {
3234
- locale: locale,
3235
- libraries: googleMapsLibraries
3236
- }, /*#__PURE__*/React.createElement(FontsProvider, null, /*#__PURE__*/React.createElement(FieldsProvider, null, /*#__PURE__*/React.createElement(FormsProvider, null, /*#__PURE__*/React.createElement(EditorProvider, null, /*#__PURE__*/React.createElement(VisitorProvider, {
3237
- visitor: "editor"
3238
- }, /*#__PURE__*/React.createElement(ComponentsContext.Consumer, null, function (manager) {
3239
- var formComponents = manager.getComponents(FORMS_NAMESPACE);
3240
- var formRegEx = formComponents !== null ? Object.keys(formComponents).map(function (name) {
3241
- return slug(name);
3242
- }).join('|') : null;
3243
- return /*#__PURE__*/React.createElement(RoutesProvider, {
3244
- routes: _objectSpread(_objectSpread({}, routes), {}, {
3245
- 'screen.field.form': routes['screen.field.form'].replace(/:form$/, ":form(".concat(formRegEx, ")"))
3343
+ return /*#__PURE__*/jsx(Router, _objectSpread(_objectSpread({}, routerProps), {}, {
3344
+ children: /*#__PURE__*/jsx(UppyProvider, _objectSpread(_objectSpread({}, uppy), {}, {
3345
+ children: /*#__PURE__*/jsx(StoryProvider, {
3346
+ story: value,
3347
+ children: /*#__PURE__*/jsx(ScreensProvider, {
3348
+ filterNamespaces: true,
3349
+ namespaces: screenNamespaces,
3350
+ children: /*#__PURE__*/jsx(GoogleKeysProvider, {
3351
+ apiKey: googleApiKey,
3352
+ children: /*#__PURE__*/jsx(GoogleMapsClientProvider, {
3353
+ locale: locale,
3354
+ libraries: googleMapsLibraries,
3355
+ children: /*#__PURE__*/jsx(FontsProvider, {
3356
+ children: /*#__PURE__*/jsx(FieldsProvider, {
3357
+ children: /*#__PURE__*/jsx(FormsProvider, {
3358
+ children: /*#__PURE__*/jsx(EditorProvider, {
3359
+ children: /*#__PURE__*/jsx(VisitorProvider, {
3360
+ visitor: "editor",
3361
+ children: /*#__PURE__*/jsx(ComponentsContext.Consumer, {
3362
+ children: function children(manager) {
3363
+ var formComponents = manager.getComponents(FORMS_NAMESPACE);
3364
+ var formRegEx = formComponents !== null ? Object.keys(formComponents).map(function (name) {
3365
+ return slug(name);
3366
+ }).join('|') : null;
3367
+ return /*#__PURE__*/jsx(RoutesProvider, {
3368
+ routes: _objectSpread(_objectSpread({}, routes), {}, {
3369
+ 'screen.field.form': routes['screen.field.form'].replace(/:form$/, ":form(".concat(formRegEx, ")"))
3370
+ }),
3371
+ children: /*#__PURE__*/jsx(Editor, _objectSpread({
3372
+ value: value
3373
+ }, props))
3374
+ });
3375
+ }
3376
+ })
3377
+ })
3378
+ })
3379
+ })
3380
+ })
3381
+ })
3382
+ })
3383
+ })
3384
+ })
3246
3385
  })
3247
- }, /*#__PURE__*/React.createElement(Editor, Object.assign({
3248
- value: value
3249
- }, props)));
3250
- }))))))))))));
3386
+ }))
3387
+ }));
3251
3388
  }
3252
3389
 
3253
3390
  export { Editor, ScreenTypes, ScreensMenu as Screens, createScreen, EditorContainer as default };