@micromag/editor 0.3.832 → 0.4.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/css/styles.css +19 -19
- package/es/index.d.ts +59 -0
- package/es/index.js +549 -836
- package/es/styles.css +19 -0
- package/package.json +19 -22
- package/scss/styles.scss +0 -6
package/es/index.js
CHANGED
|
@@ -2,10 +2,8 @@ import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
|
2
2
|
import _objectSpread from '@babel/runtime/helpers/objectSpread2';
|
|
3
3
|
import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
|
|
4
4
|
import classNames from 'classnames';
|
|
5
|
-
import PropTypes from 'prop-types';
|
|
6
5
|
import React, { useMemo, useRef, useCallback, useState, forwardRef, useEffect } from 'react';
|
|
7
6
|
import { useIntl, FormattedMessage } from 'react-intl';
|
|
8
|
-
import { PropTypes as PropTypes$1 } from '@micromag/core';
|
|
9
7
|
import { Button, FieldForm, BackButton, Breadcrumb as Breadcrumb$1, Modal, ModalDialog, Label, Navbar, DropdownMenu, Empty, Tabs, ScreenPlaceholder, ScreenPreview, Modals } from '@micromag/core/components';
|
|
10
8
|
import { useRoutes, useScreenDefinition, useFormsComponents, useScreensManager, useFieldsManager, useFieldsComponentsManager, useUrlGenerator, useRoutePush, ScreenProvider, useScreenSize, PlaybackProvider, ModalsProvider, PanelsProvider, ScreenSizeProvider, useFieldComponent, ComponentsProvider, FORMS_NAMESPACE, StoryProvider, GoogleKeysProvider, GoogleMapsClientProvider, FontsProvider, EditorProvider, VisitorProvider, ComponentsContext, RoutesProvider } from '@micromag/core/contexts';
|
|
11
9
|
import { useIsVisible, useParsedStory, useDimensionObserver, useScreenSizeFromElement, useMediasParser } from '@micromag/core/hooks';
|
|
@@ -13,7 +11,7 @@ import { getScreenFieldsWithStates, getScreenExtraField, isMessage, slug, getCom
|
|
|
13
11
|
import { useRouteMatcher, useMemoryRouter, createPathToRegexpParser } from '@folklore/routes';
|
|
14
12
|
import { useLocation, Switch, Route, Router } from 'wouter';
|
|
15
13
|
import _toConsumableArray from '@babel/runtime/helpers/toConsumableArray';
|
|
16
|
-
import {
|
|
14
|
+
import { easings, useTransition, animated } from '@react-spring/web';
|
|
17
15
|
import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
|
|
18
16
|
import { faCogs } from '@fortawesome/free-solid-svg-icons/faCogs';
|
|
19
17
|
import { faEllipsisV } from '@fortawesome/free-solid-svg-icons/faEllipsisV';
|
|
@@ -150,12 +148,12 @@ var createScreen = function createScreen(definition) {
|
|
|
150
148
|
});
|
|
151
149
|
};
|
|
152
150
|
|
|
153
|
-
var _excluded$
|
|
151
|
+
var _excluded$d = ["components"];
|
|
154
152
|
var deleteScreen = function deleteScreen(story, screenId) {
|
|
155
153
|
var _ref = story || {},
|
|
156
154
|
_ref$components = _ref.components,
|
|
157
155
|
components = _ref$components === void 0 ? [] : _ref$components,
|
|
158
|
-
currentValue = _objectWithoutProperties(_ref, _excluded$
|
|
156
|
+
currentValue = _objectWithoutProperties(_ref, _excluded$d);
|
|
159
157
|
return _objectSpread(_objectSpread({}, currentValue), {}, {
|
|
160
158
|
components: components.filter(function (_ref2) {
|
|
161
159
|
var id = _ref2.id;
|
|
@@ -164,13 +162,13 @@ var deleteScreen = function deleteScreen(story, screenId) {
|
|
|
164
162
|
});
|
|
165
163
|
};
|
|
166
164
|
|
|
167
|
-
var _excluded$
|
|
165
|
+
var _excluded$c = ["components"];
|
|
168
166
|
var duplicateScreen = function duplicateScreen(story, screenId) {
|
|
169
167
|
var screenIndex = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
|
|
170
168
|
var _ref = story || {},
|
|
171
169
|
_ref$components = _ref.components,
|
|
172
170
|
components = _ref$components === void 0 ? [] : _ref$components,
|
|
173
|
-
currentValue = _objectWithoutProperties(_ref, _excluded$
|
|
171
|
+
currentValue = _objectWithoutProperties(_ref, _excluded$c);
|
|
174
172
|
var screen = components.find(function (it) {
|
|
175
173
|
return it.id === screenId;
|
|
176
174
|
}) || null;
|
|
@@ -183,13 +181,13 @@ var duplicateScreen = function duplicateScreen(story, screenId) {
|
|
|
183
181
|
});
|
|
184
182
|
};
|
|
185
183
|
|
|
186
|
-
var _excluded$
|
|
184
|
+
var _excluded$b = ["components"];
|
|
187
185
|
var updateScreen = function updateScreen(story, newScreenValue) {
|
|
188
186
|
var newScreenId = newScreenValue.id;
|
|
189
187
|
var _ref = story || {},
|
|
190
188
|
_ref$components = _ref.components,
|
|
191
189
|
components = _ref$components === void 0 ? [] : _ref$components,
|
|
192
|
-
currentValue = _objectWithoutProperties(_ref, _excluded$
|
|
190
|
+
currentValue = _objectWithoutProperties(_ref, _excluded$b);
|
|
193
191
|
var index = components.findIndex(function (it) {
|
|
194
192
|
return it.id === newScreenId;
|
|
195
193
|
});
|
|
@@ -214,19 +212,13 @@ var _getFieldByName = function getFieldByName(fields, name) {
|
|
|
214
212
|
}, null);
|
|
215
213
|
};
|
|
216
214
|
|
|
217
|
-
var _excluded$
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
className: null
|
|
225
|
-
};
|
|
226
|
-
var SettingsButton = function SettingsButton(_ref) {
|
|
227
|
-
var className = _ref.className,
|
|
228
|
-
dots = _ref.dots,
|
|
229
|
-
props = _objectWithoutProperties(_ref, _excluded$9);
|
|
215
|
+
var _excluded$a = ["className", "dots"];
|
|
216
|
+
function SettingsButton(_ref) {
|
|
217
|
+
var _ref$className = _ref.className,
|
|
218
|
+
className = _ref$className === void 0 ? null : _ref$className,
|
|
219
|
+
_ref$dots = _ref.dots,
|
|
220
|
+
dots = _ref$dots === void 0 ? false : _ref$dots,
|
|
221
|
+
props = _objectWithoutProperties(_ref, _excluded$a);
|
|
230
222
|
return /*#__PURE__*/React.createElement(Button, Object.assign({
|
|
231
223
|
className: className,
|
|
232
224
|
theme: "secondary",
|
|
@@ -235,25 +227,15 @@ var SettingsButton = function SettingsButton(_ref) {
|
|
|
235
227
|
icon: dots ? faEllipsisV : faCogs
|
|
236
228
|
})
|
|
237
229
|
}, props));
|
|
238
|
-
}
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
var
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
};
|
|
248
|
-
var defaultProps$n = {
|
|
249
|
-
name: null,
|
|
250
|
-
form: null,
|
|
251
|
-
children: null
|
|
252
|
-
};
|
|
253
|
-
var FieldWithContexts = function FieldWithContexts(_ref) {
|
|
254
|
-
var name = _ref.name,
|
|
255
|
-
form = _ref.form,
|
|
256
|
-
props = _objectWithoutProperties(_ref, _excluded$8);
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
var _excluded$9 = ["name", "form"];
|
|
233
|
+
function FieldWithContexts(_ref) {
|
|
234
|
+
var _ref$name = _ref.name,
|
|
235
|
+
name = _ref$name === void 0 ? null : _ref$name,
|
|
236
|
+
_ref$form = _ref.form,
|
|
237
|
+
form = _ref$form === void 0 ? null : _ref$form,
|
|
238
|
+
props = _objectWithoutProperties(_ref, _excluded$9);
|
|
257
239
|
var definition = useScreenDefinition() || null;
|
|
258
240
|
var _definition$states = definition.states,
|
|
259
241
|
states = _definition$states === void 0 ? null : _definition$states;
|
|
@@ -295,32 +277,19 @@ var FieldWithContexts = function FieldWithContexts(_ref) {
|
|
|
295
277
|
}, props)) : /*#__PURE__*/React.createElement(Fields, Object.assign({
|
|
296
278
|
fields: stateFields
|
|
297
279
|
}, props))) : null;
|
|
298
|
-
}
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
gotoFieldForm: PropTypes.func.isRequired,
|
|
308
|
-
closeFieldForm: PropTypes.func.isRequired,
|
|
309
|
-
onChange: PropTypes.func
|
|
310
|
-
// onClickDelete: PropTypes.func,
|
|
311
|
-
};
|
|
312
|
-
var defaultProps$m = {
|
|
313
|
-
value: null,
|
|
314
|
-
className: null,
|
|
315
|
-
onChange: null
|
|
316
|
-
// onClickDelete: null,
|
|
317
|
-
};
|
|
318
|
-
var ScreenForm = function ScreenForm(_ref) {
|
|
319
|
-
var value = _ref.value,
|
|
320
|
-
className = _ref.className,
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
var styles$i = {"container":"container","inner":"inner"};
|
|
283
|
+
|
|
284
|
+
function ScreenForm(_ref) {
|
|
285
|
+
var _ref$value = _ref.value,
|
|
286
|
+
value = _ref$value === void 0 ? null : _ref$value,
|
|
287
|
+
_ref$className = _ref.className,
|
|
288
|
+
className = _ref$className === void 0 ? null : _ref$className,
|
|
321
289
|
gotoFieldForm = _ref.gotoFieldForm,
|
|
322
290
|
closeFieldForm = _ref.closeFieldForm,
|
|
323
|
-
onChange = _ref.onChange
|
|
291
|
+
_ref$onChange = _ref.onChange,
|
|
292
|
+
onChange = _ref$onChange === void 0 ? null : _ref$onChange;
|
|
324
293
|
var _useScreenDefinition = useScreenDefinition(),
|
|
325
294
|
_useScreenDefinition$ = _useScreenDefinition.fields,
|
|
326
295
|
fields = _useScreenDefinition$ === void 0 ? [] : _useScreenDefinition$;
|
|
@@ -349,34 +318,22 @@ var ScreenForm = function ScreenForm(_ref) {
|
|
|
349
318
|
gotoFieldForm: gotoFieldForm,
|
|
350
319
|
closeFieldForm: closeFieldForm
|
|
351
320
|
}) : null));
|
|
352
|
-
}
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
};
|
|
366
|
-
var defaultProps$l = {
|
|
367
|
-
story: null,
|
|
368
|
-
screenId: null,
|
|
369
|
-
field: null,
|
|
370
|
-
form: null,
|
|
371
|
-
className: null
|
|
372
|
-
};
|
|
373
|
-
var Breadcrumb = function Breadcrumb(_ref) {
|
|
374
|
-
var story = _ref.story,
|
|
375
|
-
screenId = _ref.screenId,
|
|
376
|
-
field = _ref.field,
|
|
377
|
-
form = _ref.form,
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
var styles$h = {"container":"container"};
|
|
324
|
+
|
|
325
|
+
function Breadcrumb(_ref) {
|
|
326
|
+
var _ref$story = _ref.story,
|
|
327
|
+
story = _ref$story === void 0 ? null : _ref$story,
|
|
328
|
+
_ref$screenId = _ref.screenId,
|
|
329
|
+
screenId = _ref$screenId === void 0 ? null : _ref$screenId,
|
|
330
|
+
_ref$field = _ref.field,
|
|
331
|
+
field = _ref$field === void 0 ? null : _ref$field,
|
|
332
|
+
_ref$form = _ref.form,
|
|
333
|
+
form = _ref$form === void 0 ? null : _ref$form,
|
|
378
334
|
url = _ref.url,
|
|
379
|
-
className = _ref.className
|
|
335
|
+
_ref$className = _ref.className,
|
|
336
|
+
className = _ref$className === void 0 ? null : _ref$className;
|
|
380
337
|
var intl = useIntl();
|
|
381
338
|
var _ref2 = story || {},
|
|
382
339
|
_ref2$components = _ref2.components,
|
|
@@ -581,26 +538,17 @@ var Breadcrumb = function Breadcrumb(_ref) {
|
|
|
581
538
|
noWrap: true,
|
|
582
539
|
className: classNames([styles$h.container, 'text-truncate', _defineProperty({}, className, className !== null)])
|
|
583
540
|
}));
|
|
584
|
-
}
|
|
585
|
-
Breadcrumb.propTypes = propTypes$l;
|
|
586
|
-
Breadcrumb.defaultProps = defaultProps$l;
|
|
541
|
+
}
|
|
587
542
|
|
|
588
|
-
var styles$g = {"container":"
|
|
543
|
+
var styles$g = {"container":"container","description":"description","actions":"actions"};
|
|
589
544
|
|
|
590
|
-
|
|
591
|
-
className
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
onConfirm: null,
|
|
598
|
-
onCancel: null
|
|
599
|
-
};
|
|
600
|
-
var DeleteScreenModal = function DeleteScreenModal(_ref) {
|
|
601
|
-
var className = _ref.className,
|
|
602
|
-
onConfirm = _ref.onConfirm,
|
|
603
|
-
onCancel = _ref.onCancel;
|
|
545
|
+
function DeleteScreenModal(_ref) {
|
|
546
|
+
var _ref$className = _ref.className,
|
|
547
|
+
className = _ref$className === void 0 ? null : _ref$className,
|
|
548
|
+
_ref$onConfirm = _ref.onConfirm,
|
|
549
|
+
onConfirm = _ref$onConfirm === void 0 ? null : _ref$onConfirm,
|
|
550
|
+
_ref$onCancel = _ref.onCancel,
|
|
551
|
+
onCancel = _ref$onCancel === void 0 ? null : _ref$onCancel;
|
|
604
552
|
return /*#__PURE__*/React.createElement(Modal, null, /*#__PURE__*/React.createElement(ModalDialog, {
|
|
605
553
|
title: /*#__PURE__*/React.createElement(FormattedMessage, {
|
|
606
554
|
id: "p6q/+/",
|
|
@@ -641,29 +589,19 @@ var DeleteScreenModal = function DeleteScreenModal(_ref) {
|
|
|
641
589
|
}]
|
|
642
590
|
})
|
|
643
591
|
}))));
|
|
644
|
-
}
|
|
645
|
-
DeleteScreenModal.propTypes = propTypes$k;
|
|
646
|
-
DeleteScreenModal.defaultProps = defaultProps$k;
|
|
647
|
-
|
|
648
|
-
var styles$f = {"panel":"micromag-editor-form-panel","exit":"micromag-editor-form-exit","content":"micromag-editor-form-content","navbar":"micromag-editor-form-navbar","enterRight":"micromag-editor-form-enterRight","enterLeft":"micromag-editor-form-enterLeft","enterTop":"micromag-editor-form-enterTop","enterBottom":"micromag-editor-form-enterBottom","enterActiveHorizontal":"micromag-editor-form-enterActiveHorizontal","enterActiveVertical":"micromag-editor-form-enterActiveVertical","exitActiveRight":"micromag-editor-form-exitActiveRight","exitActiveLeft":"micromag-editor-form-exitActiveLeft","exitActiveTop":"micromag-editor-form-exitActiveTop","exitActiveBottom":"micromag-editor-form-exitActiveBottom"};
|
|
592
|
+
}
|
|
649
593
|
|
|
650
|
-
var
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
};
|
|
662
|
-
var EditForm = function EditForm(_ref) {
|
|
663
|
-
var value = _ref.value,
|
|
664
|
-
isTheme = _ref.isTheme,
|
|
665
|
-
className = _ref.className,
|
|
666
|
-
onChange = _ref.onChange;
|
|
594
|
+
var styles$f = {"content":"content","navbar":"navbar","panel":"panel"};
|
|
595
|
+
|
|
596
|
+
function EditForm(_ref) {
|
|
597
|
+
var _ref$value = _ref.value,
|
|
598
|
+
value = _ref$value === void 0 ? null : _ref$value,
|
|
599
|
+
_ref$isTheme = _ref.isTheme,
|
|
600
|
+
isTheme = _ref$isTheme === void 0 ? false : _ref$isTheme,
|
|
601
|
+
_ref$className = _ref.className,
|
|
602
|
+
className = _ref$className === void 0 ? null : _ref$className,
|
|
603
|
+
_ref$onChange = _ref.onChange,
|
|
604
|
+
onChange = _ref$onChange === void 0 ? null : _ref$onChange;
|
|
667
605
|
// Match routes
|
|
668
606
|
var _useLocation = useLocation(),
|
|
669
607
|
_useLocation2 = _slicedToArray(_useLocation, 2),
|
|
@@ -694,10 +632,9 @@ var EditForm = function EditForm(_ref) {
|
|
|
694
632
|
return definition != null ? getScreenFieldsWithStates(definition) : [];
|
|
695
633
|
}, [screensManager, screen]);
|
|
696
634
|
|
|
697
|
-
// Get transition
|
|
635
|
+
// Get transition direction
|
|
698
636
|
var _useFormTransition = useFormTransition(url, screenIndex, styles$f),
|
|
699
|
-
|
|
700
|
-
transitionTimeout = _useFormTransition.timeout;
|
|
637
|
+
direction = _useFormTransition.direction;
|
|
701
638
|
var _useState = useState(false),
|
|
702
639
|
_useState2 = _slicedToArray(_useState, 2),
|
|
703
640
|
screenSettingsOpened = _useState2[0],
|
|
@@ -715,6 +652,73 @@ var EditForm = function EditForm(_ref) {
|
|
|
715
652
|
fieldContext = _useState8[0],
|
|
716
653
|
setFieldContext = _useState8[1];
|
|
717
654
|
|
|
655
|
+
// Compute panel transition
|
|
656
|
+
var transitionItem = useMemo(function () {
|
|
657
|
+
return screen !== null ? {
|
|
658
|
+
key: fieldParams !== null ? "field-".concat(fieldParams, "-").concat(formParams) : "screen-".concat(screen.id),
|
|
659
|
+
isField: fieldParams !== null,
|
|
660
|
+
screen: screen,
|
|
661
|
+
fieldParams: fieldParams,
|
|
662
|
+
formParams: formParams
|
|
663
|
+
} : null;
|
|
664
|
+
}, [screen, fieldParams, formParams]);
|
|
665
|
+
var fromTransform = useMemo(function () {
|
|
666
|
+
switch (direction) {
|
|
667
|
+
case 'right':
|
|
668
|
+
return 'translateX(100%)';
|
|
669
|
+
case 'left':
|
|
670
|
+
return 'translateX(-100%)';
|
|
671
|
+
case 'top':
|
|
672
|
+
return 'translateY(-100%)';
|
|
673
|
+
case 'bottom':
|
|
674
|
+
return 'translateY(100%)';
|
|
675
|
+
default:
|
|
676
|
+
return 'translateX(0%)';
|
|
677
|
+
}
|
|
678
|
+
}, [direction]);
|
|
679
|
+
var leaveTransform = useMemo(function () {
|
|
680
|
+
switch (direction) {
|
|
681
|
+
case 'right':
|
|
682
|
+
return 'translateX(-100%)';
|
|
683
|
+
case 'left':
|
|
684
|
+
return 'translateX(100%)';
|
|
685
|
+
case 'top':
|
|
686
|
+
return 'translateY(100%)';
|
|
687
|
+
case 'bottom':
|
|
688
|
+
return 'translateY(-100%)';
|
|
689
|
+
default:
|
|
690
|
+
return 'translateX(0%)';
|
|
691
|
+
}
|
|
692
|
+
}, [direction]);
|
|
693
|
+
var isHorizontal = direction === 'left' || direction === 'right';
|
|
694
|
+
var springConfig = useMemo(function () {
|
|
695
|
+
return direction !== null ? {
|
|
696
|
+
duration: isHorizontal ? 200 : 500,
|
|
697
|
+
easing: easings.easeOutSine
|
|
698
|
+
} : {
|
|
699
|
+
duration: 0
|
|
700
|
+
};
|
|
701
|
+
}, [direction, isHorizontal]);
|
|
702
|
+
var panelTransitions = useTransition(transitionItem, {
|
|
703
|
+
keys: function keys(item) {
|
|
704
|
+
var _item$key;
|
|
705
|
+
return (_item$key = item === null || item === void 0 ? void 0 : item.key) !== null && _item$key !== void 0 ? _item$key : 'none';
|
|
706
|
+
},
|
|
707
|
+
from: {
|
|
708
|
+
transform: fromTransform,
|
|
709
|
+
opacity: direction !== null ? 0.5 : 1
|
|
710
|
+
},
|
|
711
|
+
enter: {
|
|
712
|
+
transform: 'translateX(0%)',
|
|
713
|
+
opacity: 1
|
|
714
|
+
},
|
|
715
|
+
leave: {
|
|
716
|
+
transform: leaveTransform,
|
|
717
|
+
opacity: direction !== null ? 0.5 : 0
|
|
718
|
+
},
|
|
719
|
+
config: springConfig
|
|
720
|
+
});
|
|
721
|
+
|
|
718
722
|
// Callbacks
|
|
719
723
|
var gotoFieldForm = useCallback(function () {
|
|
720
724
|
var field = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
|
|
@@ -859,45 +863,43 @@ var EditForm = function EditForm(_ref) {
|
|
|
859
863
|
onClickOutside: onDropdownClickOutside
|
|
860
864
|
})) : null) : null, /*#__PURE__*/React.createElement("div", {
|
|
861
865
|
className: classNames(['flex-grow-1', 'd-flex', 'w-100', styles$f.content])
|
|
862
|
-
}, screen !== null ? /*#__PURE__*/React.createElement(
|
|
866
|
+
}, screen !== null ? /*#__PURE__*/React.createElement("div", {
|
|
863
867
|
className: "w-100 flex-grow-1",
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
classNames: transitionClassNames
|
|
867
|
-
});
|
|
868
|
+
style: {
|
|
869
|
+
position: 'relative'
|
|
868
870
|
}
|
|
869
|
-
},
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
}))
|
|
871
|
+
}, panelTransitions(function (springStyle, item) {
|
|
872
|
+
return item !== null ? /*#__PURE__*/React.createElement(animated.div, {
|
|
873
|
+
className: classNames(['w-100', styles$f.panel]),
|
|
874
|
+
style: _objectSpread(_objectSpread({}, springStyle), item.key !== (transitionItem === null || transitionItem === void 0 ? void 0 : transitionItem.key) ? {
|
|
875
|
+
position: 'absolute',
|
|
876
|
+
top: 0,
|
|
877
|
+
left: 0,
|
|
878
|
+
width: '100%',
|
|
879
|
+
zIndex: 0
|
|
880
|
+
} : {
|
|
881
|
+
position: 'relative',
|
|
882
|
+
zIndex: 1
|
|
883
|
+
})
|
|
884
|
+
}, /*#__PURE__*/React.createElement(ScreenProvider, {
|
|
885
|
+
data: item.screen
|
|
886
|
+
}, item.isField ? /*#__PURE__*/React.createElement(FieldWithContexts, {
|
|
887
|
+
name: item.fieldParams.replace(/\//g, '.'),
|
|
888
|
+
value: item.screen,
|
|
889
|
+
form: item.formParams,
|
|
890
|
+
className: styles$f.form,
|
|
891
|
+
gotoFieldForm: gotoFieldForm,
|
|
892
|
+
closeFieldForm: closeFieldForm,
|
|
893
|
+
fieldContext: fieldContext,
|
|
894
|
+
onChange: onScreenFormChange
|
|
895
|
+
}) : /*#__PURE__*/React.createElement(ScreenForm, {
|
|
896
|
+
value: item.screen,
|
|
897
|
+
className: styles$f.form,
|
|
898
|
+
onChange: onScreenFormChange,
|
|
899
|
+
gotoFieldForm: gotoFieldForm,
|
|
900
|
+
closeFieldForm: closeFieldForm
|
|
901
|
+
}))) : null;
|
|
902
|
+
})) : /*#__PURE__*/React.createElement(Empty, {
|
|
901
903
|
className: "w-100 m-2"
|
|
902
904
|
}, /*#__PURE__*/React.createElement(FormattedMessage, {
|
|
903
905
|
id: "QfpTKK",
|
|
@@ -910,9 +912,7 @@ var EditForm = function EditForm(_ref) {
|
|
|
910
912
|
onConfirm: onDeleteScreenConfirm,
|
|
911
913
|
onCancel: onDeleteScreenCancel
|
|
912
914
|
}) : null);
|
|
913
|
-
}
|
|
914
|
-
EditForm.propTypes = propTypes$j;
|
|
915
|
-
EditForm.defaultProps = defaultProps$j;
|
|
915
|
+
}
|
|
916
916
|
|
|
917
917
|
function useScreenStates(screen) {
|
|
918
918
|
var _ref = screen || {},
|
|
@@ -928,7 +928,7 @@ function useScreenStates(screen) {
|
|
|
928
928
|
return states;
|
|
929
929
|
}
|
|
930
930
|
|
|
931
|
-
var _excluded$
|
|
931
|
+
var _excluded$8 = ["components"];
|
|
932
932
|
var useThemeValue = function useThemeValue(value) {
|
|
933
933
|
var isTheme = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
934
934
|
var valueWithTheme = useMemo(function () {
|
|
@@ -937,7 +937,7 @@ var useThemeValue = function useThemeValue(value) {
|
|
|
937
937
|
}
|
|
938
938
|
var _ref = value || {};
|
|
939
939
|
_ref.components;
|
|
940
|
-
var themeValue = _objectWithoutProperties(_ref, _excluded$
|
|
940
|
+
var themeValue = _objectWithoutProperties(_ref, _excluded$8);
|
|
941
941
|
return value !== null ? _objectSpread({
|
|
942
942
|
theme: themeValue
|
|
943
943
|
}, value) : value;
|
|
@@ -945,20 +945,12 @@ var useThemeValue = function useThemeValue(value) {
|
|
|
945
945
|
return valueWithTheme;
|
|
946
946
|
};
|
|
947
947
|
|
|
948
|
-
var styles$e = {"container":"micromag-editor-menus-devices-container","button":"micromag-editor-menus-devices-button"};
|
|
949
|
-
|
|
950
948
|
/* eslint-disable react/button-has-type, react/jsx-props-no-spreading */
|
|
951
|
-
|
|
952
|
-
color
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
color: 'currentColor',
|
|
957
|
-
className: null
|
|
958
|
-
};
|
|
959
|
-
var DesktopIcon = function DesktopIcon(_ref) {
|
|
960
|
-
var color = _ref.color,
|
|
961
|
-
className = _ref.className;
|
|
949
|
+
function DesktopIcon(_ref) {
|
|
950
|
+
var _ref$color = _ref.color,
|
|
951
|
+
color = _ref$color === void 0 ? 'currentColor' : _ref$color,
|
|
952
|
+
_ref$className = _ref.className,
|
|
953
|
+
className = _ref$className === void 0 ? null : _ref$className;
|
|
962
954
|
return /*#__PURE__*/React.createElement("svg", {
|
|
963
955
|
xmlns: "http://www.w3.org/2000/svg",
|
|
964
956
|
xmlnsXlink: "http://www.w3.org/1999/xlink",
|
|
@@ -974,22 +966,14 @@ var DesktopIcon = function DesktopIcon(_ref) {
|
|
|
974
966
|
fill: color,
|
|
975
967
|
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"
|
|
976
968
|
}));
|
|
977
|
-
}
|
|
978
|
-
DesktopIcon.propTypes = propTypes$i;
|
|
979
|
-
DesktopIcon.defaultProps = defaultProps$i;
|
|
969
|
+
}
|
|
980
970
|
|
|
981
971
|
/* eslint-disable react/button-has-type, react/jsx-props-no-spreading */
|
|
982
|
-
|
|
983
|
-
color
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
color: 'currentColor',
|
|
988
|
-
className: null
|
|
989
|
-
};
|
|
990
|
-
var MobileIcon = function MobileIcon(_ref) {
|
|
991
|
-
var color = _ref.color,
|
|
992
|
-
className = _ref.className;
|
|
972
|
+
function MobileIcon(_ref) {
|
|
973
|
+
var _ref$color = _ref.color,
|
|
974
|
+
color = _ref$color === void 0 ? 'currentColor' : _ref$color,
|
|
975
|
+
_ref$className = _ref.className,
|
|
976
|
+
className = _ref$className === void 0 ? null : _ref$className;
|
|
993
977
|
return /*#__PURE__*/React.createElement("svg", {
|
|
994
978
|
xmlns: "http://www.w3.org/2000/svg",
|
|
995
979
|
xmlnsXlink: "http://www.w3.org/1999/xlink",
|
|
@@ -1005,9 +989,7 @@ var MobileIcon = function MobileIcon(_ref) {
|
|
|
1005
989
|
fill: color,
|
|
1006
990
|
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"
|
|
1007
991
|
}));
|
|
1008
|
-
}
|
|
1009
|
-
MobileIcon.propTypes = propTypes$h;
|
|
1010
|
-
MobileIcon.defaultProps = defaultProps$h;
|
|
992
|
+
}
|
|
1011
993
|
|
|
1012
994
|
var DeviceIcons = /*#__PURE__*/Object.freeze({
|
|
1013
995
|
__proto__: null,
|
|
@@ -1015,108 +997,76 @@ var DeviceIcons = /*#__PURE__*/Object.freeze({
|
|
|
1015
997
|
Mobile: MobileIcon
|
|
1016
998
|
});
|
|
1017
999
|
|
|
1018
|
-
var styles$
|
|
1000
|
+
var styles$e = {"container":"container","icon":"icon"};
|
|
1019
1001
|
|
|
1020
|
-
var _excluded$
|
|
1021
|
-
|
|
1022
|
-
device: PropTypes.string.isRequired,
|
|
1023
|
-
iconComponents: PropTypes$1.components,
|
|
1024
|
-
className: PropTypes.string
|
|
1025
|
-
};
|
|
1026
|
-
var defaultProps$g = {
|
|
1027
|
-
iconComponents: DeviceIcons,
|
|
1028
|
-
className: null
|
|
1029
|
-
};
|
|
1030
|
-
var DeviceButton = function DeviceButton(_ref) {
|
|
1002
|
+
var _excluded$7 = ["device", "className", "iconComponents"];
|
|
1003
|
+
function DeviceButton(_ref) {
|
|
1031
1004
|
var device = _ref.device,
|
|
1032
|
-
className = _ref.className,
|
|
1033
|
-
|
|
1034
|
-
|
|
1005
|
+
_ref$className = _ref.className,
|
|
1006
|
+
className = _ref$className === void 0 ? null : _ref$className,
|
|
1007
|
+
_ref$iconComponents = _ref.iconComponents,
|
|
1008
|
+
iconComponents = _ref$iconComponents === void 0 ? DeviceIcons : _ref$iconComponents,
|
|
1009
|
+
props = _objectWithoutProperties(_ref, _excluded$7);
|
|
1035
1010
|
var DeviceIcon = getComponentFromName(device, iconComponents, DesktopIcon);
|
|
1036
1011
|
return /*#__PURE__*/React.createElement(Button, Object.assign({
|
|
1037
|
-
className: classNames([styles$
|
|
1012
|
+
className: classNames([styles$e.container, _defineProperty({}, className, className !== null)])
|
|
1038
1013
|
}, props), /*#__PURE__*/React.createElement(DeviceIcon, {
|
|
1039
|
-
className: styles$
|
|
1014
|
+
className: styles$e.icon
|
|
1040
1015
|
}));
|
|
1041
|
-
}
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
var _excluded$
|
|
1046
|
-
|
|
1047
|
-
items
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
className: null,
|
|
1054
|
-
onClickItem: null
|
|
1055
|
-
};
|
|
1056
|
-
var DevicesMenu = function DevicesMenu(_ref) {
|
|
1057
|
-
var items = _ref.items,
|
|
1058
|
-
className = _ref.className,
|
|
1059
|
-
onClickItem = _ref.onClickItem;
|
|
1016
|
+
}
|
|
1017
|
+
|
|
1018
|
+
var styles$d = {"container":"container","button":"button"};
|
|
1019
|
+
|
|
1020
|
+
var _excluded$6 = ["id"];
|
|
1021
|
+
function DevicesMenu(_ref) {
|
|
1022
|
+
var _ref$items = _ref.items,
|
|
1023
|
+
items = _ref$items === void 0 ? [] : _ref$items,
|
|
1024
|
+
_ref$className = _ref.className,
|
|
1025
|
+
className = _ref$className === void 0 ? null : _ref$className,
|
|
1026
|
+
_ref$onClickItem = _ref.onClickItem,
|
|
1027
|
+
onClickItem = _ref$onClickItem === void 0 ? null : _ref$onClickItem;
|
|
1060
1028
|
return /*#__PURE__*/React.createElement(Tabs, {
|
|
1061
1029
|
items: items,
|
|
1062
1030
|
theme: "outline-secondary",
|
|
1063
|
-
className: classNames([styles$
|
|
1031
|
+
className: classNames([styles$d.container, _defineProperty({}, className, className !== null)]),
|
|
1064
1032
|
renderItemButton: function renderItemButton(item, index, props) {
|
|
1065
1033
|
var id = item.id,
|
|
1066
|
-
itemProps = _objectWithoutProperties(item, _excluded$
|
|
1034
|
+
itemProps = _objectWithoutProperties(item, _excluded$6);
|
|
1067
1035
|
return /*#__PURE__*/React.createElement(DeviceButton, Object.assign({
|
|
1068
1036
|
device: id
|
|
1069
1037
|
}, props, itemProps, {
|
|
1070
|
-
className: styles$
|
|
1038
|
+
className: styles$d.button,
|
|
1071
1039
|
onClick: function onClick(e) {
|
|
1072
1040
|
return onClickItem !== null ? onClickItem(e, item, index) : null;
|
|
1073
1041
|
}
|
|
1074
1042
|
}));
|
|
1075
1043
|
}
|
|
1076
1044
|
});
|
|
1077
|
-
}
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
icon: null,
|
|
1103
|
-
title: null,
|
|
1104
|
-
onClick: null,
|
|
1105
|
-
children: null,
|
|
1106
|
-
refButton: null,
|
|
1107
|
-
className: null
|
|
1108
|
-
};
|
|
1109
|
-
var ScreenButton = function ScreenButton(_ref) {
|
|
1110
|
-
var active = _ref.active,
|
|
1111
|
-
id = _ref.id,
|
|
1112
|
-
href = _ref.href,
|
|
1113
|
-
className = _ref.className,
|
|
1114
|
-
label = _ref.label,
|
|
1115
|
-
icon = _ref.icon,
|
|
1116
|
-
children = _ref.children,
|
|
1117
|
-
title = _ref.title,
|
|
1118
|
-
onClick = _ref.onClick,
|
|
1119
|
-
refButton = _ref.refButton;
|
|
1045
|
+
}
|
|
1046
|
+
|
|
1047
|
+
var styles$c = {"container":"container","button":"button","border":"border","screen":"screen","inner":"inner","icon":"icon","label":"label","active":"active"};
|
|
1048
|
+
|
|
1049
|
+
function ScreenButton(_ref) {
|
|
1050
|
+
var _ref$active = _ref.active,
|
|
1051
|
+
active = _ref$active === void 0 ? false : _ref$active,
|
|
1052
|
+
_ref$id = _ref.id,
|
|
1053
|
+
id = _ref$id === void 0 ? null : _ref$id,
|
|
1054
|
+
_ref$href = _ref.href,
|
|
1055
|
+
href = _ref$href === void 0 ? null : _ref$href,
|
|
1056
|
+
_ref$className = _ref.className,
|
|
1057
|
+
className = _ref$className === void 0 ? null : _ref$className,
|
|
1058
|
+
_ref$label = _ref.label,
|
|
1059
|
+
label = _ref$label === void 0 ? null : _ref$label,
|
|
1060
|
+
_ref$icon = _ref.icon,
|
|
1061
|
+
icon = _ref$icon === void 0 ? null : _ref$icon,
|
|
1062
|
+
_ref$children = _ref.children,
|
|
1063
|
+
children = _ref$children === void 0 ? null : _ref$children,
|
|
1064
|
+
_ref$title = _ref.title,
|
|
1065
|
+
title = _ref$title === void 0 ? null : _ref$title,
|
|
1066
|
+
_ref$onClick = _ref.onClick,
|
|
1067
|
+
onClick = _ref$onClick === void 0 ? null : _ref$onClick,
|
|
1068
|
+
_ref$refButton = _ref.refButton,
|
|
1069
|
+
refButton = _ref$refButton === void 0 ? null : _ref$refButton;
|
|
1120
1070
|
return /*#__PURE__*/React.createElement("div", {
|
|
1121
1071
|
className: classNames([styles$c.container, 'rounded', _defineProperty(_defineProperty({}, styles$c.active, active), className, className !== null)])
|
|
1122
1072
|
}, children !== null ? children : /*#__PURE__*/React.createElement("div", {
|
|
@@ -1138,63 +1088,43 @@ var ScreenButton = function ScreenButton(_ref) {
|
|
|
1138
1088
|
}, /*#__PURE__*/React.createElement("span", {
|
|
1139
1089
|
className: classNames([styles$c.border, 'rounded'])
|
|
1140
1090
|
})));
|
|
1141
|
-
}
|
|
1142
|
-
ScreenButton.propTypes = propTypes$e;
|
|
1143
|
-
ScreenButton.defaultProps = defaultProps$e;
|
|
1091
|
+
}
|
|
1144
1092
|
var ScreenButton$1 = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
1145
1093
|
return /*#__PURE__*/React.createElement(ScreenButton, Object.assign({}, props, {
|
|
1146
1094
|
refButton: ref
|
|
1147
1095
|
}));
|
|
1148
1096
|
});
|
|
1149
1097
|
|
|
1150
|
-
var styles$b = {"button":"
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
screen
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
title: PropTypes.string,
|
|
1158
|
-
active: PropTypes.bool,
|
|
1159
|
-
withPlaceholder: PropTypes.bool,
|
|
1160
|
-
withIndexIndicator: PropTypes.bool,
|
|
1161
|
-
withName: PropTypes.bool,
|
|
1162
|
-
withDeleteButtonOnRepeatables: PropTypes.bool,
|
|
1163
|
-
onClick: PropTypes.func,
|
|
1164
|
-
onClickItem: PropTypes.func,
|
|
1165
|
-
onDeleteButtonClick: PropTypes.func,
|
|
1166
|
-
className: PropTypes.string
|
|
1167
|
-
};
|
|
1168
|
-
var defaultProps$d = {
|
|
1169
|
-
screen: null,
|
|
1170
|
-
screenState: null,
|
|
1171
|
-
title: null,
|
|
1172
|
-
href: null,
|
|
1173
|
-
active: false,
|
|
1174
|
-
withPlaceholder: false,
|
|
1175
|
-
withIndexIndicator: false,
|
|
1176
|
-
withName: false,
|
|
1177
|
-
withDeleteButtonOnRepeatables: false,
|
|
1178
|
-
onClick: null,
|
|
1179
|
-
onClickItem: null,
|
|
1180
|
-
onDeleteButtonClick: null,
|
|
1181
|
-
className: null
|
|
1182
|
-
};
|
|
1183
|
-
var ScreenWithPreview = function ScreenWithPreview(_ref) {
|
|
1184
|
-
var screen = _ref.screen,
|
|
1185
|
-
screenState = _ref.screenState,
|
|
1098
|
+
var styles$b = {"button":"button","index":"index","name":"name","deleteButton":"deleteButton","withIndex":"withIndex"};
|
|
1099
|
+
|
|
1100
|
+
function ScreenWithPreview(_ref) {
|
|
1101
|
+
var _ref$screen = _ref.screen,
|
|
1102
|
+
screen = _ref$screen === void 0 ? null : _ref$screen,
|
|
1103
|
+
_ref$screenState = _ref.screenState,
|
|
1104
|
+
screenState = _ref$screenState === void 0 ? null : _ref$screenState,
|
|
1186
1105
|
index = _ref.index,
|
|
1187
|
-
title = _ref.title,
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1106
|
+
_ref$title = _ref.title,
|
|
1107
|
+
title = _ref$title === void 0 ? null : _ref$title,
|
|
1108
|
+
_ref$href = _ref.href,
|
|
1109
|
+
href = _ref$href === void 0 ? null : _ref$href,
|
|
1110
|
+
_ref$active = _ref.active,
|
|
1111
|
+
active = _ref$active === void 0 ? false : _ref$active,
|
|
1112
|
+
_ref$className = _ref.className,
|
|
1113
|
+
className = _ref$className === void 0 ? null : _ref$className,
|
|
1114
|
+
_ref$onClick = _ref.onClick,
|
|
1115
|
+
_onClick = _ref$onClick === void 0 ? null : _ref$onClick,
|
|
1116
|
+
_ref$onClickItem = _ref.onClickItem,
|
|
1117
|
+
onClickItem = _ref$onClickItem === void 0 ? null : _ref$onClickItem,
|
|
1118
|
+
_ref$withName = _ref.withName,
|
|
1119
|
+
withName = _ref$withName === void 0 ? false : _ref$withName,
|
|
1120
|
+
_ref$withPlaceholder = _ref.withPlaceholder,
|
|
1121
|
+
withPlaceholder = _ref$withPlaceholder === void 0 ? false : _ref$withPlaceholder,
|
|
1122
|
+
_ref$withIndexIndicat = _ref.withIndexIndicator,
|
|
1123
|
+
withIndexIndicator = _ref$withIndexIndicat === void 0 ? false : _ref$withIndexIndicat,
|
|
1124
|
+
_ref$withDeleteButton = _ref.withDeleteButtonOnRepeatables,
|
|
1125
|
+
withDeleteButtonOnRepeatables = _ref$withDeleteButton === void 0 ? false : _ref$withDeleteButton,
|
|
1126
|
+
_ref$onDeleteButtonCl = _ref.onDeleteButtonClick,
|
|
1127
|
+
onDeleteButtonClick = _ref$onDeleteButtonCl === void 0 ? null : _ref$onDeleteButtonCl;
|
|
1198
1128
|
var intl = useIntl();
|
|
1199
1129
|
var _useIsVisible = useIsVisible({
|
|
1200
1130
|
threshold: 0.1
|
|
@@ -1234,29 +1164,17 @@ var ScreenWithPreview = function ScreenWithPreview(_ref) {
|
|
|
1234
1164
|
}, /*#__PURE__*/React.createElement(FontAwesomeIcon, {
|
|
1235
1165
|
icon: faTimesCircle
|
|
1236
1166
|
})) : null));
|
|
1237
|
-
}
|
|
1238
|
-
ScreenWithPreview.propTypes = propTypes$d;
|
|
1239
|
-
ScreenWithPreview.defaultProps = defaultProps$d;
|
|
1167
|
+
}
|
|
1240
1168
|
|
|
1241
|
-
var styles$a = {"container":"
|
|
1169
|
+
var styles$a = {"container":"container","button":"button","addButton":"addButton","title":"title"};
|
|
1242
1170
|
|
|
1243
|
-
var propTypes$c = {
|
|
1244
|
-
screen: PropTypes$1.screen.isRequired,
|
|
1245
|
-
screenState: PropTypes.string,
|
|
1246
|
-
value: PropTypes$1.story.isRequired,
|
|
1247
|
-
className: PropTypes.string,
|
|
1248
|
-
onChange: PropTypes.func
|
|
1249
|
-
};
|
|
1250
|
-
var defaultProps$c = {
|
|
1251
|
-
screenState: null,
|
|
1252
|
-
className: null,
|
|
1253
|
-
onChange: null
|
|
1254
|
-
};
|
|
1255
1171
|
function ScreenStates(_ref) {
|
|
1256
1172
|
var screen = _ref.screen,
|
|
1257
1173
|
value = _ref.value,
|
|
1258
|
-
className = _ref.className,
|
|
1259
|
-
|
|
1174
|
+
_ref$className = _ref.className,
|
|
1175
|
+
className = _ref$className === void 0 ? null : _ref$className,
|
|
1176
|
+
_ref$onChange = _ref.onChange,
|
|
1177
|
+
onChange = _ref$onChange === void 0 ? null : _ref$onChange;
|
|
1260
1178
|
var url = useUrlGenerator();
|
|
1261
1179
|
var push = useRoutePush();
|
|
1262
1180
|
var _useRouteParams = useRouteParams(),
|
|
@@ -1403,51 +1321,36 @@ function ScreenStates(_ref) {
|
|
|
1403
1321
|
}));
|
|
1404
1322
|
})));
|
|
1405
1323
|
}
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
}
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
className: null,
|
|
1437
|
-
onScreenChange: null,
|
|
1438
|
-
onChange: null,
|
|
1439
|
-
withoutDevicesSizes: true
|
|
1440
|
-
};
|
|
1441
|
-
var EditorPreview = function EditorPreview(_ref) {
|
|
1442
|
-
var value = _ref.value,
|
|
1443
|
-
viewerTheme = _ref.viewerTheme,
|
|
1444
|
-
isTheme = _ref.isTheme,
|
|
1445
|
-
devices = _ref.devices,
|
|
1446
|
-
initialDevice = _ref.device,
|
|
1447
|
-
className = _ref.className,
|
|
1448
|
-
onScreenChange = _ref.onScreenChange,
|
|
1449
|
-
onChange = _ref.onChange,
|
|
1450
|
-
withoutDevicesSizes = _ref.withoutDevicesSizes;
|
|
1324
|
+
|
|
1325
|
+
var styles$9 = {"container":"container","inner":"inner","top":"top","bottom":"bottom","preview":"preview","viewerContainer":"viewerContainer","deviceMenu":"deviceMenu","devices":"devices","noStory":"noStory","story":"story"};
|
|
1326
|
+
|
|
1327
|
+
function EditorPreview(_ref) {
|
|
1328
|
+
var _ref$value = _ref.value,
|
|
1329
|
+
value = _ref$value === void 0 ? null : _ref$value,
|
|
1330
|
+
_ref$viewerTheme = _ref.viewerTheme,
|
|
1331
|
+
viewerTheme = _ref$viewerTheme === void 0 ? null : _ref$viewerTheme,
|
|
1332
|
+
_ref$isTheme = _ref.isTheme,
|
|
1333
|
+
isTheme = _ref$isTheme === void 0 ? false : _ref$isTheme,
|
|
1334
|
+
_ref$devices = _ref.devices,
|
|
1335
|
+
devices = _ref$devices === void 0 ? [{
|
|
1336
|
+
id: 'mobile',
|
|
1337
|
+
width: 320,
|
|
1338
|
+
height: 480
|
|
1339
|
+
}, {
|
|
1340
|
+
id: 'desktop',
|
|
1341
|
+
width: 1200,
|
|
1342
|
+
height: 900
|
|
1343
|
+
}] : _ref$devices,
|
|
1344
|
+
_ref$device = _ref.device,
|
|
1345
|
+
initialDevice = _ref$device === void 0 ? 'mobile' : _ref$device,
|
|
1346
|
+
_ref$className = _ref.className,
|
|
1347
|
+
className = _ref$className === void 0 ? null : _ref$className,
|
|
1348
|
+
_ref$onScreenChange = _ref.onScreenChange,
|
|
1349
|
+
onScreenChange = _ref$onScreenChange === void 0 ? null : _ref$onScreenChange,
|
|
1350
|
+
_ref$onChange = _ref.onChange,
|
|
1351
|
+
onChange = _ref$onChange === void 0 ? null : _ref$onChange,
|
|
1352
|
+
_ref$withoutDevicesSi = _ref.withoutDevicesSizes,
|
|
1353
|
+
withoutDevicesSizes = _ref$withoutDevicesSi === void 0 ? true : _ref$withoutDevicesSi;
|
|
1451
1354
|
var _useRouteParams = useRouteParams(),
|
|
1452
1355
|
_useRouteParams$scree = _useRouteParams.screen,
|
|
1453
1356
|
screenId = _useRouteParams$scree === void 0 ? null : _useRouteParams$scree,
|
|
@@ -1577,9 +1480,7 @@ var EditorPreview = function EditorPreview(_ref) {
|
|
|
1577
1480
|
onClickItem: onClickDeviceItem,
|
|
1578
1481
|
className: styles$9.devices
|
|
1579
1482
|
})) : null));
|
|
1580
|
-
}
|
|
1581
|
-
EditorPreview.propTypes = propTypes$b;
|
|
1582
|
-
EditorPreview.defaultProps = defaultProps$b;
|
|
1483
|
+
}
|
|
1583
1484
|
|
|
1584
1485
|
var iOS = /iPad|iPhone|iPod/.test(navigator.platform);
|
|
1585
1486
|
function getDragDepth(offset, indentationWidth) {
|
|
@@ -1929,83 +1830,48 @@ var sortableTreeKeyboardCoordinates = function sortableTreeKeyboardCoordinates(c
|
|
|
1929
1830
|
};
|
|
1930
1831
|
};
|
|
1931
1832
|
|
|
1932
|
-
var styles$8 = {"wrapper":"
|
|
1933
|
-
|
|
1934
|
-
var _excluded$
|
|
1935
|
-
var propTypes$a = {
|
|
1936
|
-
childCount: PropTypes.number,
|
|
1937
|
-
clone: PropTypes.bool,
|
|
1938
|
-
collapsed: PropTypes.bool,
|
|
1939
|
-
depth: PropTypes.number.isRequired,
|
|
1940
|
-
disableInteraction: PropTypes.bool,
|
|
1941
|
-
disableSelection: PropTypes.bool,
|
|
1942
|
-
ghost: PropTypes.bool,
|
|
1943
|
-
// eslint-disable-next-line react/forbid-prop-types
|
|
1944
|
-
handleProps: PropTypes.any,
|
|
1945
|
-
indicator: PropTypes.bool,
|
|
1946
|
-
indentationWidth: PropTypes.number.isRequired,
|
|
1947
|
-
value: PropTypes.string,
|
|
1948
|
-
onCollapse: PropTypes.func,
|
|
1949
|
-
onRemove: PropTypes.func,
|
|
1950
|
-
onClick: PropTypes.func,
|
|
1951
|
-
// eslint-disable-next-line react/forbid-prop-types
|
|
1952
|
-
wrapperRef: PropTypes.any,
|
|
1953
|
-
style: PropTypes.shape({
|
|
1954
|
-
width: PropTypes.number.isRequired,
|
|
1955
|
-
height: PropTypes.number.isRequired,
|
|
1956
|
-
transform: PropTypes.string.isRequired
|
|
1957
|
-
}),
|
|
1958
|
-
showId: PropTypes.bool,
|
|
1959
|
-
showCount: PropTypes.bool,
|
|
1960
|
-
showCollapsedCount: PropTypes.bool,
|
|
1961
|
-
children: PropTypes.node,
|
|
1962
|
-
// eslint-disable-next-line react/forbid-prop-types
|
|
1963
|
-
containerRef: PropTypes.any
|
|
1964
|
-
};
|
|
1965
|
-
var defaultProps$a = {
|
|
1966
|
-
childCount: null,
|
|
1967
|
-
clone: false,
|
|
1968
|
-
collapsed: false,
|
|
1969
|
-
disableInteraction: false,
|
|
1970
|
-
disableSelection: false,
|
|
1971
|
-
ghost: false,
|
|
1972
|
-
handleProps: null,
|
|
1973
|
-
indicator: false,
|
|
1974
|
-
value: null,
|
|
1975
|
-
onCollapse: null,
|
|
1976
|
-
onRemove: null,
|
|
1977
|
-
onClick: null,
|
|
1978
|
-
wrapperRef: null,
|
|
1979
|
-
style: null,
|
|
1980
|
-
showId: false,
|
|
1981
|
-
showCount: false,
|
|
1982
|
-
showCollapsedCount: false,
|
|
1983
|
-
children: null,
|
|
1984
|
-
containerRef: null
|
|
1985
|
-
};
|
|
1833
|
+
var styles$8 = {"wrapper":"wrapper","inner":"inner","button":"button","handle":"handle","icon":"icon","count":"count","collapsedCount":"collapsedCount","disableInteraction":"disableInteraction","disableSelection":"disableSelection","clone":"clone","collapse":"collapse","collapsed":"collapsed","children":"children","withChildren":"withChildren","ghost":"ghost","indicator":"indicator"};
|
|
1834
|
+
|
|
1835
|
+
var _excluded$5 = ["childCount", "clone", "depth", "disableSelection", "disableInteraction", "ghost", "handleProps", "indentationWidth", "indicator", "collapsed", "onCollapse", "onRemove", "onClick", "style", "value", "wrapperRef", "showId", "showCount", "showCollapsedCount", "children", "containerRef"];
|
|
1986
1836
|
var SortableTreeItemActions = function SortableTreeItemActions(_ref) {
|
|
1987
|
-
var childCount = _ref.childCount,
|
|
1988
|
-
|
|
1837
|
+
var _ref$childCount = _ref.childCount,
|
|
1838
|
+
childCount = _ref$childCount === void 0 ? null : _ref$childCount,
|
|
1839
|
+
_ref$clone = _ref.clone,
|
|
1840
|
+
clone = _ref$clone === void 0 ? false : _ref$clone,
|
|
1989
1841
|
depth = _ref.depth,
|
|
1990
|
-
disableSelection = _ref.disableSelection,
|
|
1991
|
-
|
|
1992
|
-
|
|
1993
|
-
|
|
1842
|
+
_ref$disableSelection = _ref.disableSelection,
|
|
1843
|
+
disableSelection = _ref$disableSelection === void 0 ? false : _ref$disableSelection,
|
|
1844
|
+
_ref$disableInteracti = _ref.disableInteraction,
|
|
1845
|
+
disableInteraction = _ref$disableInteracti === void 0 ? false : _ref$disableInteracti,
|
|
1846
|
+
_ref$ghost = _ref.ghost,
|
|
1847
|
+
ghost = _ref$ghost === void 0 ? false : _ref$ghost,
|
|
1848
|
+
_ref$handleProps = _ref.handleProps,
|
|
1849
|
+
handleProps = _ref$handleProps === void 0 ? null : _ref$handleProps,
|
|
1994
1850
|
indentationWidth = _ref.indentationWidth,
|
|
1995
|
-
indicator = _ref.indicator,
|
|
1996
|
-
|
|
1997
|
-
|
|
1998
|
-
|
|
1851
|
+
_ref$indicator = _ref.indicator,
|
|
1852
|
+
indicator = _ref$indicator === void 0 ? false : _ref$indicator,
|
|
1853
|
+
_ref$collapsed = _ref.collapsed,
|
|
1854
|
+
collapsed = _ref$collapsed === void 0 ? false : _ref$collapsed,
|
|
1855
|
+
_ref$onCollapse = _ref.onCollapse,
|
|
1856
|
+
onCollapse = _ref$onCollapse === void 0 ? null : _ref$onCollapse,
|
|
1857
|
+
_ref$onRemove = _ref.onRemove,
|
|
1858
|
+
onRemove = _ref$onRemove === void 0 ? null : _ref$onRemove;
|
|
1999
1859
|
_ref.onClick;
|
|
2000
|
-
var style = _ref.style
|
|
1860
|
+
var _ref$style = _ref.style,
|
|
1861
|
+
style = _ref$style === void 0 ? null : _ref$style;
|
|
2001
1862
|
_ref.value;
|
|
2002
|
-
var wrapperRef = _ref.wrapperRef
|
|
1863
|
+
var _ref$wrapperRef = _ref.wrapperRef,
|
|
1864
|
+
wrapperRef = _ref$wrapperRef === void 0 ? null : _ref$wrapperRef;
|
|
2003
1865
|
_ref.showId;
|
|
2004
|
-
var showCount = _ref.showCount,
|
|
2005
|
-
|
|
2006
|
-
|
|
2007
|
-
|
|
2008
|
-
|
|
1866
|
+
var _ref$showCount = _ref.showCount,
|
|
1867
|
+
showCount = _ref$showCount === void 0 ? false : _ref$showCount,
|
|
1868
|
+
_ref$showCollapsedCou = _ref.showCollapsedCount,
|
|
1869
|
+
showCollapsedCount = _ref$showCollapsedCou === void 0 ? false : _ref$showCollapsedCou,
|
|
1870
|
+
_ref$children = _ref.children,
|
|
1871
|
+
children = _ref$children === void 0 ? null : _ref$children,
|
|
1872
|
+
_ref$containerRef = _ref.containerRef,
|
|
1873
|
+
containerRef = _ref$containerRef === void 0 ? null : _ref$containerRef,
|
|
1874
|
+
props = _objectWithoutProperties(_ref, _excluded$5);
|
|
2009
1875
|
return /*#__PURE__*/React.createElement("div", Object.assign({
|
|
2010
1876
|
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)]),
|
|
2011
1877
|
ref: wrapperRef,
|
|
@@ -2042,70 +1908,40 @@ var SortableTreeItemActions = function SortableTreeItemActions(_ref) {
|
|
|
2042
1908
|
className: styles$8.children
|
|
2043
1909
|
}, children)));
|
|
2044
1910
|
};
|
|
2045
|
-
SortableTreeItemActions.propTypes = propTypes$a;
|
|
2046
|
-
SortableTreeItemActions.defaultProps = defaultProps$a;
|
|
2047
1911
|
var SortableTreeItemActions$1 = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
2048
1912
|
return /*#__PURE__*/React.createElement(SortableTreeItemActions, Object.assign({}, props, {
|
|
2049
1913
|
containerRef: ref
|
|
2050
1914
|
}));
|
|
2051
1915
|
});
|
|
2052
1916
|
|
|
2053
|
-
var styles$7 = {"container":"
|
|
2054
|
-
|
|
2055
|
-
var _excluded$
|
|
2056
|
-
var propTypes$9 = {
|
|
2057
|
-
id: PropTypes.string.isRequired,
|
|
2058
|
-
index: PropTypes.number.isRequired,
|
|
2059
|
-
depth: PropTypes.number.isRequired,
|
|
2060
|
-
component: PropTypes.func,
|
|
2061
|
-
// eslint-disable-next-line react/forbid-prop-types
|
|
2062
|
-
value: PropTypes.object,
|
|
2063
|
-
style: PropTypes.shape({
|
|
2064
|
-
width: PropTypes.number.isRequired,
|
|
2065
|
-
height: PropTypes.number.isRequired,
|
|
2066
|
-
scaledWidth: PropTypes.number.isRequired,
|
|
2067
|
-
scaledHeight: PropTypes.number.isRequired,
|
|
2068
|
-
transform: PropTypes.string.isRequired,
|
|
2069
|
-
scale: PropTypes.number.isRequired
|
|
2070
|
-
}),
|
|
2071
|
-
smallScale: PropTypes.number,
|
|
2072
|
-
collapsed: PropTypes.bool,
|
|
2073
|
-
onCollapse: PropTypes.func,
|
|
2074
|
-
onClickItem: PropTypes.func,
|
|
2075
|
-
// eslint-disable-next-line react/forbid-prop-types
|
|
2076
|
-
childValue: PropTypes.object,
|
|
2077
|
-
isLastChild: PropTypes.bool
|
|
2078
|
-
};
|
|
2079
|
-
var defaultProps$9 = {
|
|
2080
|
-
component: null,
|
|
2081
|
-
value: null,
|
|
2082
|
-
style: null,
|
|
2083
|
-
smallScale: 0.75,
|
|
2084
|
-
collapsed: false,
|
|
2085
|
-
onCollapse: null,
|
|
2086
|
-
onClickItem: null,
|
|
2087
|
-
childValue: null,
|
|
2088
|
-
isLastChild: false
|
|
2089
|
-
};
|
|
1917
|
+
var styles$7 = {"container":"container","parent":"parent","child":"child"};
|
|
1918
|
+
|
|
1919
|
+
var _excluded$4 = ["id", "index", "depth", "component", "value", "style", "smallScale", "collapsed", "onCollapse", "onClickItem", "childValue", "isLastChild"];
|
|
2090
1920
|
var animateLayoutChanges = function animateLayoutChanges(_ref) {
|
|
2091
1921
|
var isSorting = _ref.isSorting,
|
|
2092
1922
|
wasDragging = _ref.wasDragging;
|
|
2093
1923
|
return !(isSorting || wasDragging);
|
|
2094
1924
|
};
|
|
2095
|
-
|
|
1925
|
+
function SortableTreeItem(_ref2) {
|
|
2096
1926
|
var id = _ref2.id,
|
|
2097
1927
|
index = _ref2.index,
|
|
2098
1928
|
depth = _ref2.depth,
|
|
2099
|
-
|
|
2100
|
-
|
|
1929
|
+
_ref2$component = _ref2.component,
|
|
1930
|
+
Component = _ref2$component === void 0 ? null : _ref2$component,
|
|
1931
|
+
_ref2$value = _ref2.value,
|
|
1932
|
+
value = _ref2$value === void 0 ? null : _ref2$value;
|
|
2101
1933
|
_ref2.style;
|
|
2102
1934
|
_ref2.smallScale;
|
|
2103
|
-
var collapsed = _ref2.collapsed,
|
|
2104
|
-
|
|
2105
|
-
|
|
2106
|
-
|
|
1935
|
+
var _ref2$collapsed = _ref2.collapsed,
|
|
1936
|
+
collapsed = _ref2$collapsed === void 0 ? false : _ref2$collapsed,
|
|
1937
|
+
_ref2$onCollapse = _ref2.onCollapse,
|
|
1938
|
+
onCollapse = _ref2$onCollapse === void 0 ? null : _ref2$onCollapse,
|
|
1939
|
+
_ref2$onClickItem = _ref2.onClickItem,
|
|
1940
|
+
onClickItem = _ref2$onClickItem === void 0 ? null : _ref2$onClickItem,
|
|
1941
|
+
_ref2$childValue = _ref2.childValue,
|
|
1942
|
+
childValue = _ref2$childValue === void 0 ? null : _ref2$childValue;
|
|
2107
1943
|
_ref2.isLastChild;
|
|
2108
|
-
var props = _objectWithoutProperties(_ref2, _excluded$
|
|
1944
|
+
var props = _objectWithoutProperties(_ref2, _excluded$4);
|
|
2109
1945
|
var _useSortable = useSortable({
|
|
2110
1946
|
id: id,
|
|
2111
1947
|
animateLayoutChanges: animateLayoutChanges
|
|
@@ -2171,11 +2007,9 @@ var SortableTreeItem = function SortableTreeItem(_ref2) {
|
|
|
2171
2007
|
}, /*#__PURE__*/React.createElement(Component, value)) : null, childValue !== null ? /*#__PURE__*/React.createElement("div", {
|
|
2172
2008
|
className: styles$7.child
|
|
2173
2009
|
}, /*#__PURE__*/React.createElement(Component, childValue)) : null));
|
|
2174
|
-
}
|
|
2175
|
-
SortableTreeItem.propTypes = propTypes$9;
|
|
2176
|
-
SortableTreeItem.defaultProps = defaultProps$9;
|
|
2010
|
+
}
|
|
2177
2011
|
|
|
2178
|
-
var styles$6 = {"item":"
|
|
2012
|
+
var styles$6 = {"item":"item","parent":"parent","group":"group","isLastChild":"isLastChild"};
|
|
2179
2013
|
|
|
2180
2014
|
var initialItems = [{
|
|
2181
2015
|
id: 'Home',
|
|
@@ -2210,36 +2044,23 @@ var adjustTranslate = function adjustTranslate(_ref) {
|
|
|
2210
2044
|
y: transform.y - 25
|
|
2211
2045
|
});
|
|
2212
2046
|
};
|
|
2213
|
-
|
|
2214
|
-
collapsible
|
|
2215
|
-
|
|
2216
|
-
|
|
2217
|
-
|
|
2218
|
-
|
|
2219
|
-
|
|
2220
|
-
|
|
2221
|
-
|
|
2222
|
-
|
|
2223
|
-
|
|
2224
|
-
|
|
2225
|
-
|
|
2226
|
-
|
|
2227
|
-
|
|
2228
|
-
|
|
2229
|
-
|
|
2230
|
-
component: null,
|
|
2231
|
-
onClickItem: null,
|
|
2232
|
-
onChange: null
|
|
2233
|
-
};
|
|
2234
|
-
var SortableTree = function SortableTree(_ref2) {
|
|
2235
|
-
var collapsible = _ref2.collapsible,
|
|
2236
|
-
defaultItems = _ref2.items,
|
|
2237
|
-
indicator = _ref2.indicator,
|
|
2238
|
-
indentationWidth = _ref2.indentationWidth,
|
|
2239
|
-
removable = _ref2.removable,
|
|
2240
|
-
component = _ref2.component,
|
|
2241
|
-
onClickItem = _ref2.onClickItem,
|
|
2242
|
-
onChange = _ref2.onChange;
|
|
2047
|
+
function SortableTree(_ref2) {
|
|
2048
|
+
var _ref2$collapsible = _ref2.collapsible,
|
|
2049
|
+
collapsible = _ref2$collapsible === void 0 ? true : _ref2$collapsible,
|
|
2050
|
+
_ref2$items = _ref2.items,
|
|
2051
|
+
defaultItems = _ref2$items === void 0 ? initialItems : _ref2$items,
|
|
2052
|
+
_ref2$indicator = _ref2.indicator,
|
|
2053
|
+
indicator = _ref2$indicator === void 0 ? false : _ref2$indicator,
|
|
2054
|
+
_ref2$indentationWidt = _ref2.indentationWidth,
|
|
2055
|
+
indentationWidth = _ref2$indentationWidt === void 0 ? 30 : _ref2$indentationWidt,
|
|
2056
|
+
_ref2$removable = _ref2.removable,
|
|
2057
|
+
removable = _ref2$removable === void 0 ? false : _ref2$removable,
|
|
2058
|
+
_ref2$component = _ref2.component,
|
|
2059
|
+
component = _ref2$component === void 0 ? null : _ref2$component,
|
|
2060
|
+
_ref2$onClickItem = _ref2.onClickItem,
|
|
2061
|
+
onClickItem = _ref2$onClickItem === void 0 ? null : _ref2$onClickItem,
|
|
2062
|
+
_ref2$onChange = _ref2.onChange,
|
|
2063
|
+
onChange = _ref2$onChange === void 0 ? null : _ref2$onChange;
|
|
2243
2064
|
var _useState = useState(function () {
|
|
2244
2065
|
return buildTree(defaultItems);
|
|
2245
2066
|
}),
|
|
@@ -2591,64 +2412,43 @@ var SortableTree = function SortableTree(_ref2) {
|
|
|
2591
2412
|
return activeId === id;
|
|
2592
2413
|
})
|
|
2593
2414
|
})) : null), document.body)));
|
|
2594
|
-
}
|
|
2595
|
-
SortableTree.propTypes = propTypes$8;
|
|
2596
|
-
SortableTree.defaultProps = defaultProps$8;
|
|
2415
|
+
}
|
|
2597
2416
|
|
|
2598
|
-
var styles$5 = {"
|
|
2417
|
+
var styles$5 = {"items":"items","item":"item","container":"container","settings":"settings","noWrap":"noWrap","isVertical":"isVertical","withPlaceholder":"withPlaceholder"};
|
|
2599
2418
|
|
|
2600
|
-
var _excluded$
|
|
2419
|
+
var _excluded$3 = ["className", "screen", "type", "title", "onClick", "active", "href"],
|
|
2601
2420
|
_excluded2 = ["id", "screen", "href"];
|
|
2602
|
-
|
|
2603
|
-
items
|
|
2604
|
-
|
|
2605
|
-
|
|
2606
|
-
|
|
2607
|
-
|
|
2608
|
-
|
|
2609
|
-
|
|
2610
|
-
|
|
2611
|
-
|
|
2612
|
-
|
|
2613
|
-
|
|
2614
|
-
|
|
2615
|
-
|
|
2616
|
-
|
|
2617
|
-
|
|
2618
|
-
|
|
2619
|
-
|
|
2620
|
-
|
|
2621
|
-
|
|
2622
|
-
|
|
2623
|
-
|
|
2624
|
-
|
|
2625
|
-
|
|
2626
|
-
|
|
2627
|
-
|
|
2628
|
-
|
|
2629
|
-
|
|
2630
|
-
|
|
2631
|
-
|
|
2632
|
-
|
|
2633
|
-
onClickItem: null,
|
|
2634
|
-
onOrderChange: null
|
|
2635
|
-
};
|
|
2636
|
-
var ScreensMenu = function ScreensMenu(_ref) {
|
|
2637
|
-
var items = _ref.items,
|
|
2638
|
-
withPreview = _ref.withPreview,
|
|
2639
|
-
withPlaceholder = _ref.withPlaceholder,
|
|
2640
|
-
withName = _ref.withName,
|
|
2641
|
-
settings = _ref.settings,
|
|
2642
|
-
isVertical = _ref.isVertical,
|
|
2643
|
-
noWrap = _ref.noWrap,
|
|
2644
|
-
className = _ref.className,
|
|
2645
|
-
itemClassName = _ref.itemClassName,
|
|
2646
|
-
buttonClassName = _ref.buttonClassName,
|
|
2647
|
-
settingsClassName = _ref.settingsClassName,
|
|
2648
|
-
sortable = _ref.sortable,
|
|
2649
|
-
isTree = _ref.isTree,
|
|
2650
|
-
onClickItem = _ref.onClickItem,
|
|
2651
|
-
onOrderChange = _ref.onOrderChange;
|
|
2421
|
+
function ScreensMenu(_ref) {
|
|
2422
|
+
var _ref$items = _ref.items,
|
|
2423
|
+
items = _ref$items === void 0 ? [] : _ref$items,
|
|
2424
|
+
_ref$withPreview = _ref.withPreview,
|
|
2425
|
+
withPreview = _ref$withPreview === void 0 ? false : _ref$withPreview,
|
|
2426
|
+
_ref$withPlaceholder = _ref.withPlaceholder,
|
|
2427
|
+
withPlaceholder = _ref$withPlaceholder === void 0 ? false : _ref$withPlaceholder,
|
|
2428
|
+
_ref$withName = _ref.withName,
|
|
2429
|
+
withName = _ref$withName === void 0 ? false : _ref$withName,
|
|
2430
|
+
_ref$settings = _ref.settings,
|
|
2431
|
+
settings = _ref$settings === void 0 ? null : _ref$settings,
|
|
2432
|
+
_ref$isVertical = _ref.isVertical,
|
|
2433
|
+
isVertical = _ref$isVertical === void 0 ? false : _ref$isVertical,
|
|
2434
|
+
_ref$noWrap = _ref.noWrap,
|
|
2435
|
+
noWrap = _ref$noWrap === void 0 ? false : _ref$noWrap,
|
|
2436
|
+
_ref$className = _ref.className,
|
|
2437
|
+
className = _ref$className === void 0 ? null : _ref$className,
|
|
2438
|
+
_ref$itemClassName = _ref.itemClassName,
|
|
2439
|
+
itemClassName = _ref$itemClassName === void 0 ? null : _ref$itemClassName,
|
|
2440
|
+
_ref$buttonClassName = _ref.buttonClassName,
|
|
2441
|
+
buttonClassName = _ref$buttonClassName === void 0 ? null : _ref$buttonClassName,
|
|
2442
|
+
_ref$settingsClassNam = _ref.settingsClassName,
|
|
2443
|
+
settingsClassName = _ref$settingsClassNam === void 0 ? null : _ref$settingsClassNam,
|
|
2444
|
+
_ref$sortable = _ref.sortable,
|
|
2445
|
+
sortable = _ref$sortable === void 0 ? false : _ref$sortable,
|
|
2446
|
+
_ref$isTree = _ref.isTree,
|
|
2447
|
+
isTree = _ref$isTree === void 0 ? false : _ref$isTree,
|
|
2448
|
+
_ref$onClickItem = _ref.onClickItem,
|
|
2449
|
+
onClickItem = _ref$onClickItem === void 0 ? null : _ref$onClickItem,
|
|
2450
|
+
_ref$onOrderChange = _ref.onOrderChange,
|
|
2451
|
+
onOrderChange = _ref$onOrderChange === void 0 ? null : _ref$onOrderChange;
|
|
2652
2452
|
var itemsElements = !isTree ? items.map(function (_ref2, index) {
|
|
2653
2453
|
var _ref2$className = _ref2.className,
|
|
2654
2454
|
itemCustomClassName = _ref2$className === void 0 ? null : _ref2$className,
|
|
@@ -2659,7 +2459,7 @@ var ScreensMenu = function ScreensMenu(_ref) {
|
|
|
2659
2459
|
onClick = _ref2$onClick === void 0 ? null : _ref2$onClick,
|
|
2660
2460
|
active = _ref2.active,
|
|
2661
2461
|
href = _ref2.href,
|
|
2662
|
-
item = _objectWithoutProperties(_ref2, _excluded$
|
|
2462
|
+
item = _objectWithoutProperties(_ref2, _excluded$3);
|
|
2663
2463
|
return /*#__PURE__*/React.createElement("li", {
|
|
2664
2464
|
key: item.id,
|
|
2665
2465
|
className: classNames([styles$5.item, _defineProperty(_defineProperty({}, itemClassName, itemClassName !== null), itemCustomClassName, itemCustomClassName !== null)]),
|
|
@@ -2731,34 +2531,31 @@ var ScreensMenu = function ScreensMenu(_ref) {
|
|
|
2731
2531
|
}, itemsElements) : null, !isTree && (!sortable || items.length < 1) ? /*#__PURE__*/React.createElement("ul", {
|
|
2732
2532
|
className: styles$5.items
|
|
2733
2533
|
}, itemsElements) : null);
|
|
2734
|
-
}
|
|
2735
|
-
ScreensMenu.propTypes = propTypes$7;
|
|
2736
|
-
ScreensMenu.defaultProps = defaultProps$7;
|
|
2737
|
-
|
|
2738
|
-
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"};
|
|
2534
|
+
}
|
|
2739
2535
|
|
|
2740
|
-
var
|
|
2741
|
-
|
|
2742
|
-
|
|
2743
|
-
|
|
2744
|
-
|
|
2745
|
-
|
|
2746
|
-
|
|
2747
|
-
|
|
2748
|
-
|
|
2749
|
-
|
|
2750
|
-
|
|
2751
|
-
|
|
2752
|
-
|
|
2753
|
-
var screens = _ref.screens,
|
|
2754
|
-
selectedTypes = _ref.selectedTypes,
|
|
2755
|
-
className = _ref.className,
|
|
2756
|
-
onClickItem = _ref.onClickItem;
|
|
2536
|
+
var styles$4 = {"container":"container","row":"row","screen":"screen","button":"button"};
|
|
2537
|
+
|
|
2538
|
+
function ScreenTypes(_ref) {
|
|
2539
|
+
var _ref$screens = _ref.screens,
|
|
2540
|
+
screens = _ref$screens === void 0 ? null : _ref$screens,
|
|
2541
|
+
_ref$selectedTypes = _ref.selectedTypes,
|
|
2542
|
+
selectedTypes = _ref$selectedTypes === void 0 ? null : _ref$selectedTypes,
|
|
2543
|
+
_ref$legacyTypes = _ref.legacyTypes,
|
|
2544
|
+
legacyTypes = _ref$legacyTypes === void 0 ? ['video-360', 'urbania-trivia', 'urbania-article'] : _ref$legacyTypes,
|
|
2545
|
+
_ref$className = _ref.className,
|
|
2546
|
+
className = _ref$className === void 0 ? null : _ref$className,
|
|
2547
|
+
_ref$onClickItem = _ref.onClickItem,
|
|
2548
|
+
onClickItem = _ref$onClickItem === void 0 ? null : _ref$onClickItem;
|
|
2757
2549
|
var intl = useIntl();
|
|
2758
2550
|
var screensManager = useScreensManager();
|
|
2759
2551
|
var screenDefinitions = screens || screensManager.getDefinitions();
|
|
2760
2552
|
var finalDefinitions = (screenDefinitions || []).filter(function (s) {
|
|
2761
2553
|
return s !== null;
|
|
2554
|
+
}).filter(function (s) {
|
|
2555
|
+
var _ref2 = s || {},
|
|
2556
|
+
_ref2$id = _ref2.id,
|
|
2557
|
+
id = _ref2$id === void 0 ? null : _ref2$id;
|
|
2558
|
+
return legacyTypes === null || legacyTypes.indexOf(id) === -1;
|
|
2762
2559
|
});
|
|
2763
2560
|
var groups = useMemo(function () {
|
|
2764
2561
|
var groupItems = finalDefinitions.reduce(function (allGroups, definition) {
|
|
@@ -2766,28 +2563,28 @@ var ScreenTypes = function ScreenTypes(_ref) {
|
|
|
2766
2563
|
title = definition.title,
|
|
2767
2564
|
_definition$group = definition.group,
|
|
2768
2565
|
group = _definition$group === void 0 ? {} : _definition$group;
|
|
2769
|
-
var
|
|
2770
|
-
|
|
2771
|
-
order =
|
|
2772
|
-
|
|
2773
|
-
label =
|
|
2774
|
-
|
|
2775
|
-
hidden =
|
|
2776
|
-
var
|
|
2777
|
-
|
|
2778
|
-
messageId =
|
|
2566
|
+
var _ref3 = group || {},
|
|
2567
|
+
_ref3$order = _ref3.order,
|
|
2568
|
+
order = _ref3$order === void 0 ? 0 : _ref3$order,
|
|
2569
|
+
_ref3$label = _ref3.label,
|
|
2570
|
+
label = _ref3$label === void 0 ? {} : _ref3$label,
|
|
2571
|
+
_ref3$hidden = _ref3.hidden,
|
|
2572
|
+
hidden = _ref3$hidden === void 0 ? false : _ref3$hidden;
|
|
2573
|
+
var _ref4 = label || {},
|
|
2574
|
+
_ref4$id = _ref4.id,
|
|
2575
|
+
messageId = _ref4$id === void 0 ? null : _ref4$id;
|
|
2779
2576
|
if (hidden) {
|
|
2780
2577
|
return allGroups;
|
|
2781
2578
|
}
|
|
2782
|
-
var
|
|
2579
|
+
var _ref5 = isMessage(label) ? {
|
|
2783
2580
|
id: messageId || id,
|
|
2784
2581
|
name: group
|
|
2785
2582
|
} : {
|
|
2786
2583
|
id: messageId || id,
|
|
2787
2584
|
name: title
|
|
2788
2585
|
},
|
|
2789
|
-
groupId =
|
|
2790
|
-
groupName =
|
|
2586
|
+
groupId = _ref5.id,
|
|
2587
|
+
groupName = _ref5.name;
|
|
2791
2588
|
var groupIndex = allGroups.findIndex(function (it) {
|
|
2792
2589
|
return it.id === groupId;
|
|
2793
2590
|
});
|
|
@@ -2817,10 +2614,10 @@ var ScreenTypes = function ScreenTypes(_ref) {
|
|
|
2817
2614
|
className: classNames([styles$4.container, _defineProperty({}, className, className)])
|
|
2818
2615
|
}, /*#__PURE__*/React.createElement("div", {
|
|
2819
2616
|
className: styles$4.rows
|
|
2820
|
-
}, groups.map(function (
|
|
2821
|
-
var id =
|
|
2822
|
-
name =
|
|
2823
|
-
items =
|
|
2617
|
+
}, groups.map(function (_ref7) {
|
|
2618
|
+
var id = _ref7.id,
|
|
2619
|
+
name = _ref7.name,
|
|
2620
|
+
items = _ref7.items;
|
|
2824
2621
|
return /*#__PURE__*/React.createElement("div", {
|
|
2825
2622
|
key: "group-".concat(id),
|
|
2826
2623
|
className: styles$4.row
|
|
@@ -2840,29 +2637,19 @@ var ScreenTypes = function ScreenTypes(_ref) {
|
|
|
2840
2637
|
onClickItem: onClickItem
|
|
2841
2638
|
})));
|
|
2842
2639
|
})));
|
|
2843
|
-
}
|
|
2844
|
-
ScreenTypes.propTypes = propTypes$6;
|
|
2845
|
-
ScreenTypes.defaultProps = defaultProps$6;
|
|
2846
|
-
|
|
2847
|
-
var styles$3 = {"container":"micromag-editor-modals-screen-types-container"};
|
|
2640
|
+
}
|
|
2848
2641
|
|
|
2849
|
-
var
|
|
2850
|
-
|
|
2851
|
-
|
|
2852
|
-
|
|
2853
|
-
|
|
2854
|
-
|
|
2855
|
-
|
|
2856
|
-
|
|
2857
|
-
|
|
2858
|
-
|
|
2859
|
-
|
|
2860
|
-
};
|
|
2861
|
-
var ScreenTypesModal = function ScreenTypesModal(_ref) {
|
|
2862
|
-
var selectedTypes = _ref.selectedTypes,
|
|
2863
|
-
className = _ref.className,
|
|
2864
|
-
onRequestClose = _ref.onRequestClose,
|
|
2865
|
-
onClickScreenType = _ref.onClickScreenType;
|
|
2642
|
+
var styles$3 = {"container":"container"};
|
|
2643
|
+
|
|
2644
|
+
function ScreenTypesModal(_ref) {
|
|
2645
|
+
var _ref$selectedTypes = _ref.selectedTypes,
|
|
2646
|
+
selectedTypes = _ref$selectedTypes === void 0 ? null : _ref$selectedTypes,
|
|
2647
|
+
_ref$className = _ref.className,
|
|
2648
|
+
className = _ref$className === void 0 ? null : _ref$className,
|
|
2649
|
+
_ref$onRequestClose = _ref.onRequestClose,
|
|
2650
|
+
onRequestClose = _ref$onRequestClose === void 0 ? null : _ref$onRequestClose,
|
|
2651
|
+
_ref$onClickScreenTyp = _ref.onClickScreenType,
|
|
2652
|
+
onClickScreenType = _ref$onClickScreenTyp === void 0 ? null : _ref$onClickScreenTyp;
|
|
2866
2653
|
return /*#__PURE__*/React.createElement(Modal, null, /*#__PURE__*/React.createElement(ModalDialog, {
|
|
2867
2654
|
title: /*#__PURE__*/React.createElement(FormattedMessage, {
|
|
2868
2655
|
id: "QBaiO0",
|
|
@@ -2878,45 +2665,30 @@ var ScreenTypesModal = function ScreenTypesModal(_ref) {
|
|
|
2878
2665
|
className: styles$3.menu,
|
|
2879
2666
|
onClickItem: onClickScreenType
|
|
2880
2667
|
})));
|
|
2881
|
-
}
|
|
2882
|
-
|
|
2883
|
-
|
|
2884
|
-
|
|
2885
|
-
var
|
|
2886
|
-
|
|
2887
|
-
var
|
|
2888
|
-
|
|
2889
|
-
|
|
2890
|
-
|
|
2891
|
-
|
|
2892
|
-
|
|
2893
|
-
|
|
2894
|
-
|
|
2895
|
-
|
|
2896
|
-
|
|
2897
|
-
|
|
2898
|
-
|
|
2899
|
-
|
|
2900
|
-
|
|
2901
|
-
|
|
2902
|
-
|
|
2903
|
-
|
|
2904
|
-
|
|
2905
|
-
isTree: false,
|
|
2906
|
-
onClickScreen: null,
|
|
2907
|
-
onChange: null,
|
|
2908
|
-
className: null
|
|
2909
|
-
};
|
|
2910
|
-
var EditorScreens = function EditorScreens(_ref) {
|
|
2911
|
-
var unparsedValue = _ref.value,
|
|
2912
|
-
isTheme = _ref.isTheme,
|
|
2913
|
-
isVertical = _ref.isVertical,
|
|
2914
|
-
isCreateOpened = _ref.isCreateOpened,
|
|
2915
|
-
isParsed = _ref.isParsed,
|
|
2916
|
-
isTree = _ref.isTree,
|
|
2917
|
-
onClickScreen = _ref.onClickScreen,
|
|
2918
|
-
onChange = _ref.onChange,
|
|
2919
|
-
className = _ref.className;
|
|
2668
|
+
}
|
|
2669
|
+
|
|
2670
|
+
var styles$2 = {"container":"container","navbar":"navbar"};
|
|
2671
|
+
|
|
2672
|
+
var _excluded$2 = ["id"];
|
|
2673
|
+
function EditorScreens(_ref) {
|
|
2674
|
+
var _ref$value = _ref.value,
|
|
2675
|
+
unparsedValue = _ref$value === void 0 ? null : _ref$value,
|
|
2676
|
+
_ref$isTheme = _ref.isTheme,
|
|
2677
|
+
isTheme = _ref$isTheme === void 0 ? false : _ref$isTheme,
|
|
2678
|
+
_ref$isVertical = _ref.isVertical,
|
|
2679
|
+
isVertical = _ref$isVertical === void 0 ? false : _ref$isVertical,
|
|
2680
|
+
_ref$isCreateOpened = _ref.isCreateOpened,
|
|
2681
|
+
isCreateOpened = _ref$isCreateOpened === void 0 ? false : _ref$isCreateOpened,
|
|
2682
|
+
_ref$isParsed = _ref.isParsed,
|
|
2683
|
+
isParsed = _ref$isParsed === void 0 ? false : _ref$isParsed,
|
|
2684
|
+
_ref$isTree = _ref.isTree,
|
|
2685
|
+
isTree = _ref$isTree === void 0 ? false : _ref$isTree,
|
|
2686
|
+
_ref$onClickScreen = _ref.onClickScreen,
|
|
2687
|
+
onClickScreen = _ref$onClickScreen === void 0 ? null : _ref$onClickScreen,
|
|
2688
|
+
_ref$onChange = _ref.onChange,
|
|
2689
|
+
onChange = _ref$onChange === void 0 ? null : _ref$onChange,
|
|
2690
|
+
_ref$className = _ref.className,
|
|
2691
|
+
className = _ref$className === void 0 ? null : _ref$className;
|
|
2920
2692
|
var valueWithTheme = useThemeValue(unparsedValue, isTheme);
|
|
2921
2693
|
var value = isParsed ? unparsedValue : useParsedStory(valueWithTheme, {
|
|
2922
2694
|
withMedias: false
|
|
@@ -3009,7 +2781,7 @@ var EditorScreens = function EditorScreens(_ref) {
|
|
|
3009
2781
|
}).map(function (_ref13) {
|
|
3010
2782
|
var _screenProps$find;
|
|
3011
2783
|
var id = _ref13.id,
|
|
3012
|
-
props = _objectWithoutProperties(_ref13, _excluded$
|
|
2784
|
+
props = _objectWithoutProperties(_ref13, _excluded$2);
|
|
3013
2785
|
return _objectSpread(_objectSpread({
|
|
3014
2786
|
id: id
|
|
3015
2787
|
}, props), (_screenProps$find = screenProps.find(function (_ref14) {
|
|
@@ -3140,44 +2912,29 @@ var EditorScreens = function EditorScreens(_ref) {
|
|
|
3140
2912
|
onClickScreenType: onClickScreenType,
|
|
3141
2913
|
onRequestClose: onCreateModalRequestClose
|
|
3142
2914
|
}) : null);
|
|
3143
|
-
}
|
|
3144
|
-
|
|
3145
|
-
|
|
3146
|
-
|
|
3147
|
-
|
|
3148
|
-
|
|
3149
|
-
|
|
3150
|
-
|
|
3151
|
-
|
|
3152
|
-
|
|
3153
|
-
|
|
3154
|
-
|
|
3155
|
-
|
|
3156
|
-
|
|
3157
|
-
|
|
3158
|
-
|
|
3159
|
-
|
|
3160
|
-
|
|
3161
|
-
|
|
3162
|
-
|
|
3163
|
-
|
|
3164
|
-
|
|
3165
|
-
|
|
3166
|
-
isTheme: false,
|
|
3167
|
-
isCreateOpened: false,
|
|
3168
|
-
onChange: null,
|
|
3169
|
-
className: null
|
|
3170
|
-
};
|
|
3171
|
-
var Editor = function Editor(_ref) {
|
|
3172
|
-
var value = _ref.value,
|
|
3173
|
-
viewerTheme = _ref.viewerTheme,
|
|
3174
|
-
isTheme = _ref.isTheme,
|
|
3175
|
-
isCreateOpened = _ref.isCreateOpened,
|
|
3176
|
-
deviceScreens = _ref.deviceScreens,
|
|
3177
|
-
initialMobileView = _ref.mobileView,
|
|
3178
|
-
onChange = _ref.onChange,
|
|
3179
|
-
fullscreen = _ref.fullscreen,
|
|
3180
|
-
className = _ref.className;
|
|
2915
|
+
}
|
|
2916
|
+
|
|
2917
|
+
var styles$1 = {"container":"container","inner":"inner","left":"left","center":"center","right":"right","visible":"visible","preview":"preview","fullscreen":"fullscreen","top":"top"};
|
|
2918
|
+
|
|
2919
|
+
function Editor(_ref) {
|
|
2920
|
+
var _ref$value = _ref.value,
|
|
2921
|
+
value = _ref$value === void 0 ? null : _ref$value,
|
|
2922
|
+
_ref$viewerTheme = _ref.viewerTheme,
|
|
2923
|
+
viewerTheme = _ref$viewerTheme === void 0 ? null : _ref$viewerTheme,
|
|
2924
|
+
_ref$isTheme = _ref.isTheme,
|
|
2925
|
+
isTheme = _ref$isTheme === void 0 ? false : _ref$isTheme,
|
|
2926
|
+
_ref$isCreateOpened = _ref.isCreateOpened,
|
|
2927
|
+
isCreateOpened = _ref$isCreateOpened === void 0 ? false : _ref$isCreateOpened,
|
|
2928
|
+
_ref$deviceScreens = _ref.deviceScreens,
|
|
2929
|
+
deviceScreens = _ref$deviceScreens === void 0 ? getDeviceScreens() : _ref$deviceScreens,
|
|
2930
|
+
_ref$mobileView = _ref.mobileView,
|
|
2931
|
+
initialMobileView = _ref$mobileView === void 0 ? 'preview' : _ref$mobileView,
|
|
2932
|
+
_ref$onChange = _ref.onChange,
|
|
2933
|
+
onChange = _ref$onChange === void 0 ? null : _ref$onChange,
|
|
2934
|
+
_ref$fullscreen = _ref.fullscreen,
|
|
2935
|
+
fullscreen = _ref$fullscreen === void 0 ? false : _ref$fullscreen,
|
|
2936
|
+
_ref$className = _ref.className,
|
|
2937
|
+
className = _ref$className === void 0 ? null : _ref$className;
|
|
3181
2938
|
var push = useRoutePush();
|
|
3182
2939
|
var refScreensContainer = useRef(null);
|
|
3183
2940
|
var _useRouteParams = useRouteParams({
|
|
@@ -3346,44 +3103,23 @@ var Editor = function Editor(_ref) {
|
|
|
3346
3103
|
onChange: onStoryChange,
|
|
3347
3104
|
className: styles$1.inner
|
|
3348
3105
|
}))), /*#__PURE__*/React.createElement(Modals, null)))));
|
|
3349
|
-
}
|
|
3350
|
-
Editor.propTypes = propTypes$3;
|
|
3351
|
-
Editor.defaultProps = defaultProps$3;
|
|
3352
|
-
|
|
3353
|
-
// eslint-disable-next-line import/prefer-default-export
|
|
3354
|
-
var routes = PropTypes.shape({
|
|
3355
|
-
home: PropTypes.string.isRequired,
|
|
3356
|
-
screen: PropTypes.string.isRequired,
|
|
3357
|
-
'screen.field': PropTypes.string.isRequired,
|
|
3358
|
-
'screen.field.form': PropTypes.string.isRequired
|
|
3359
|
-
});
|
|
3360
|
-
|
|
3361
|
-
var styles = {"container":"micromag-editor-forms-settings-container","inner":"micromag-editor-forms-settings-inner"};
|
|
3106
|
+
}
|
|
3362
3107
|
|
|
3363
|
-
var
|
|
3364
|
-
|
|
3365
|
-
|
|
3366
|
-
|
|
3367
|
-
|
|
3368
|
-
|
|
3369
|
-
|
|
3370
|
-
|
|
3371
|
-
|
|
3372
|
-
|
|
3373
|
-
|
|
3374
|
-
field: null,
|
|
3375
|
-
value: null,
|
|
3376
|
-
className: null,
|
|
3377
|
-
onChange: null
|
|
3378
|
-
};
|
|
3379
|
-
var SettingsForm = function SettingsForm(_ref) {
|
|
3380
|
-
var name = _ref.name,
|
|
3381
|
-
field = _ref.field,
|
|
3382
|
-
value = _ref.value,
|
|
3383
|
-
className = _ref.className,
|
|
3108
|
+
var styles = {"container":"container","inner":"inner"};
|
|
3109
|
+
|
|
3110
|
+
function SettingsForm(_ref) {
|
|
3111
|
+
var _ref$name = _ref.name,
|
|
3112
|
+
name = _ref$name === void 0 ? null : _ref$name,
|
|
3113
|
+
_ref$field = _ref.field,
|
|
3114
|
+
field = _ref$field === void 0 ? null : _ref$field,
|
|
3115
|
+
_ref$value = _ref.value,
|
|
3116
|
+
value = _ref$value === void 0 ? null : _ref$value,
|
|
3117
|
+
_ref$className = _ref.className,
|
|
3118
|
+
className = _ref$className === void 0 ? null : _ref$className,
|
|
3384
3119
|
gotoFieldForm = _ref.gotoFieldForm,
|
|
3385
3120
|
closeFieldForm = _ref.closeFieldForm,
|
|
3386
|
-
onChange = _ref.onChange
|
|
3121
|
+
_ref$onChange = _ref.onChange,
|
|
3122
|
+
onChange = _ref$onChange === void 0 ? null : _ref$onChange;
|
|
3387
3123
|
if (field === null) return false;
|
|
3388
3124
|
var _ref2 = field || {},
|
|
3389
3125
|
_ref2$type = _ref2.type,
|
|
@@ -3418,9 +3154,7 @@ var SettingsForm = function SettingsForm(_ref) {
|
|
|
3418
3154
|
closeFieldForm: closeFieldForm,
|
|
3419
3155
|
fieldsProps: fieldsProps
|
|
3420
3156
|
})));
|
|
3421
|
-
}
|
|
3422
|
-
SettingsForm.propTypes = propTypes$2;
|
|
3423
|
-
SettingsForm.defaultProps = defaultProps$2;
|
|
3157
|
+
}
|
|
3424
3158
|
|
|
3425
3159
|
// eslint-disable-next-line import/prefer-default-export
|
|
3426
3160
|
|
|
@@ -3429,21 +3163,16 @@ var FormsComponents = /*#__PURE__*/Object.freeze({
|
|
|
3429
3163
|
Settings: SettingsForm
|
|
3430
3164
|
});
|
|
3431
3165
|
|
|
3432
|
-
|
|
3433
|
-
|
|
3434
|
-
children
|
|
3435
|
-
|
|
3436
|
-
|
|
3437
|
-
children: null
|
|
3438
|
-
};
|
|
3439
|
-
var FormsProvider = function FormsProvider(props) {
|
|
3166
|
+
var _excluded$1 = ["children"];
|
|
3167
|
+
function FormsProvider(_ref) {
|
|
3168
|
+
var _ref$children = _ref.children,
|
|
3169
|
+
children = _ref$children === void 0 ? null : _ref$children,
|
|
3170
|
+
props = _objectWithoutProperties(_ref, _excluded$1);
|
|
3440
3171
|
return /*#__PURE__*/React.createElement(ComponentsProvider, Object.assign({
|
|
3441
3172
|
namespace: FORMS_NAMESPACE,
|
|
3442
3173
|
components: FormsComponents
|
|
3443
|
-
}, props));
|
|
3444
|
-
}
|
|
3445
|
-
FormsProvider.propTypes = propTypes$1;
|
|
3446
|
-
FormsProvider.defaultProps = defaultProps$1;
|
|
3174
|
+
}, props), children);
|
|
3175
|
+
}
|
|
3447
3176
|
|
|
3448
3177
|
var home = "/";
|
|
3449
3178
|
var screen_wildcard = "/:screen/(.*)?";
|
|
@@ -3458,37 +3187,23 @@ var defaultRoutes = {
|
|
|
3458
3187
|
|
|
3459
3188
|
var _excluded = ["value", "memoryRouter", "routes", "basePath", "uppy", "googleApiKey", "googleMapsLibraries", "screenNamespaces"];
|
|
3460
3189
|
var pathToRegexpParser = createPathToRegexpParser();
|
|
3461
|
-
|
|
3462
|
-
|
|
3463
|
-
|
|
3464
|
-
|
|
3465
|
-
|
|
3466
|
-
|
|
3467
|
-
|
|
3468
|
-
|
|
3469
|
-
|
|
3470
|
-
|
|
3471
|
-
|
|
3472
|
-
|
|
3473
|
-
|
|
3474
|
-
|
|
3475
|
-
|
|
3476
|
-
|
|
3477
|
-
|
|
3478
|
-
uppy: null,
|
|
3479
|
-
googleApiKey: null,
|
|
3480
|
-
googleMapsLibraries: ['places'],
|
|
3481
|
-
screenNamespaces: null
|
|
3482
|
-
};
|
|
3483
|
-
var EditorContainer = function EditorContainer(_ref) {
|
|
3484
|
-
var value = _ref.value,
|
|
3485
|
-
memoryRouter = _ref.memoryRouter,
|
|
3486
|
-
routes = _ref.routes,
|
|
3487
|
-
basePath = _ref.basePath,
|
|
3488
|
-
uppy = _ref.uppy,
|
|
3489
|
-
googleApiKey = _ref.googleApiKey,
|
|
3490
|
-
googleMapsLibraries = _ref.googleMapsLibraries,
|
|
3491
|
-
screenNamespaces = _ref.screenNamespaces,
|
|
3190
|
+
function EditorContainer(_ref) {
|
|
3191
|
+
var _ref$value = _ref.value,
|
|
3192
|
+
value = _ref$value === void 0 ? null : _ref$value,
|
|
3193
|
+
_ref$memoryRouter = _ref.memoryRouter,
|
|
3194
|
+
memoryRouter = _ref$memoryRouter === void 0 ? false : _ref$memoryRouter,
|
|
3195
|
+
_ref$routes = _ref.routes,
|
|
3196
|
+
routes = _ref$routes === void 0 ? defaultRoutes : _ref$routes,
|
|
3197
|
+
_ref$basePath = _ref.basePath,
|
|
3198
|
+
basePath = _ref$basePath === void 0 ? null : _ref$basePath,
|
|
3199
|
+
_ref$uppy = _ref.uppy,
|
|
3200
|
+
uppy = _ref$uppy === void 0 ? null : _ref$uppy,
|
|
3201
|
+
_ref$googleApiKey = _ref.googleApiKey,
|
|
3202
|
+
googleApiKey = _ref$googleApiKey === void 0 ? null : _ref$googleApiKey,
|
|
3203
|
+
_ref$googleMapsLibrar = _ref.googleMapsLibraries,
|
|
3204
|
+
googleMapsLibraries = _ref$googleMapsLibrar === void 0 ? ['places'] : _ref$googleMapsLibrar,
|
|
3205
|
+
_ref$screenNamespaces = _ref.screenNamespaces,
|
|
3206
|
+
screenNamespaces = _ref$screenNamespaces === void 0 ? null : _ref$screenNamespaces,
|
|
3492
3207
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
3493
3208
|
var _useIntl = useIntl(),
|
|
3494
3209
|
locale = _useIntl.locale;
|
|
@@ -3528,8 +3243,6 @@ var EditorContainer = function EditorContainer(_ref) {
|
|
|
3528
3243
|
value: value
|
|
3529
3244
|
}, props)));
|
|
3530
3245
|
}))))))))))));
|
|
3531
|
-
}
|
|
3532
|
-
EditorContainer.propTypes = propTypes;
|
|
3533
|
-
EditorContainer.defaultProps = defaultProps;
|
|
3246
|
+
}
|
|
3534
3247
|
|
|
3535
3248
|
export { Editor, ScreenTypes, ScreensMenu as Screens, createScreen, EditorContainer as default };
|