@micromag/core 0.4.71 → 0.4.77

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/lib/components.js DELETED
@@ -1,3404 +0,0 @@
1
- 'use strict';
2
-
3
- var jsxRuntime = require('react/jsx-runtime');
4
- var _objectSpread = require('@babel/runtime/helpers/objectSpread2');
5
- var _objectWithoutProperties = require('@babel/runtime/helpers/objectWithoutProperties');
6
- var faAngleLeft = require('@fortawesome/free-solid-svg-icons/faAngleLeft');
7
- var reactFontawesome = require('@fortawesome/react-fontawesome');
8
- var classNames = require('classnames');
9
- var _defineProperty = require('@babel/runtime/helpers/defineProperty');
10
- var wouter = require('wouter');
11
- var reactIntl = require('react-intl');
12
- var utils = require('@micromag/core/utils');
13
- var faClose = require('@fortawesome/free-solid-svg-icons/faClose');
14
- var _slicedToArray = require('@babel/runtime/helpers/slicedToArray');
15
- var faAngleDown = require('@fortawesome/free-solid-svg-icons/faAngleDown');
16
- var faAngleUp = require('@fortawesome/free-solid-svg-icons/faAngleUp');
17
- var React = require('react');
18
- var dayjs = require('dayjs');
19
- var throttle = require('lodash/throttle');
20
- var hooks = require('@micromag/core/hooks');
21
- var get = require('lodash/get');
22
- var contexts = require('@micromag/core/contexts');
23
- var _toConsumableArray = require('@babel/runtime/helpers/toConsumableArray');
24
- var isObject = require('lodash/isObject');
25
- var isArray = require('lodash/isArray');
26
- var isString = require('lodash/isString');
27
- var reactDom = require('react-dom');
28
- var queryString = require('query-string');
29
- var faAd = require('@fortawesome/free-solid-svg-icons/faAd');
30
- var faImage = require('@fortawesome/free-solid-svg-icons/faImage');
31
- var faMusic = require('@fortawesome/free-solid-svg-icons/faMusic');
32
- var isNumber = require('lodash/isNumber');
33
- var faMapMarkerAlt = require('@fortawesome/free-solid-svg-icons/faMapMarkerAlt');
34
- var faMapMarkedAlt = require('@fortawesome/free-solid-svg-icons/faMapMarkedAlt');
35
- var faVideo = require('@fortawesome/free-solid-svg-icons/faVideo');
36
- var faPlay = require('@fortawesome/free-solid-svg-icons/faPlay');
37
- var faRedo = require('@fortawesome/free-solid-svg-icons/faRedo');
38
- var faCommentDots = require('@fortawesome/free-solid-svg-icons/faCommentDots');
39
- var faCheck = require('@fortawesome/free-solid-svg-icons/faCheck');
40
- var faTimes = require('@fortawesome/free-solid-svg-icons/faTimes');
41
- var faCircle = require('@fortawesome/free-solid-svg-icons/faCircle');
42
- var faPercent = require('@fortawesome/free-solid-svg-icons/faPercent');
43
- var size = require('@folklore/size');
44
- var core = require('@react-spring/core');
45
- var web = require('@react-spring/web');
46
-
47
- var emptyObject$2 = {};
48
- function Label(_ref) {
49
- var children = _ref.children,
50
- _ref$isHtml = _ref.isHtml,
51
- isHtml = _ref$isHtml === void 0 ? false : _ref$isHtml,
52
- _ref$values = _ref.values,
53
- values = _ref$values === void 0 ? emptyObject$2 : _ref$values;
54
- var Message = isHtml ? reactIntl.FormattedMessage : reactIntl.FormattedMessage;
55
- return utils.isMessage(children) ? /*#__PURE__*/jsxRuntime.jsx(Message, _objectSpread({
56
- values: values
57
- }, children)) : children;
58
- }
59
-
60
- var styles$y = {"container":"micromag-core-buttons-button-container","icon":"micromag-core-buttons-button-icon","label":"micromag-core-buttons-button-label","withoutStyle":"micromag-core-buttons-button-withoutStyle","asLink":"micromag-core-buttons-button-asLink","withIcon":"micromag-core-buttons-button-withIcon","right":"micromag-core-buttons-button-right","withIconColumns":"micromag-core-buttons-button-withIconColumns","linkDisabled":"micromag-core-buttons-button-linkDisabled"};
61
-
62
- var _excluded$c = ["type", "theme", "size", "href", "external", "direct", "target", "label", "children", "focusable", "active", "icon", "iconPosition", "disabled", "loading", "disableOnLoading", "small", "big", "withShadow", "withoutStyle", "withoutBootstrapStyles", "withoutTheme", "asLink", "outline", "onClick", "className", "iconClassName", "labelClassName", "refButton"];
63
- function Button$1(_ref) {
64
- var _ref3;
65
- var _ref$type = _ref.type,
66
- type = _ref$type === void 0 ? 'button' : _ref$type,
67
- _ref$theme = _ref.theme,
68
- theme = _ref$theme === void 0 ? null : _ref$theme,
69
- _ref$size = _ref.size,
70
- size = _ref$size === void 0 ? null : _ref$size,
71
- _ref$href = _ref.href,
72
- href = _ref$href === void 0 ? null : _ref$href,
73
- _ref$external = _ref.external,
74
- external = _ref$external === void 0 ? false : _ref$external,
75
- _ref$direct = _ref.direct,
76
- direct = _ref$direct === void 0 ? false : _ref$direct,
77
- _ref$target = _ref.target,
78
- target = _ref$target === void 0 ? '_blank' : _ref$target,
79
- _ref$label = _ref.label,
80
- label = _ref$label === void 0 ? null : _ref$label,
81
- _ref$children = _ref.children,
82
- children = _ref$children === void 0 ? null : _ref$children,
83
- _ref$focusable = _ref.focusable,
84
- focusable = _ref$focusable === void 0 ? true : _ref$focusable,
85
- _ref$active = _ref.active,
86
- active = _ref$active === void 0 ? false : _ref$active,
87
- _ref$icon = _ref.icon,
88
- icon = _ref$icon === void 0 ? null : _ref$icon,
89
- _ref$iconPosition = _ref.iconPosition,
90
- iconPosition = _ref$iconPosition === void 0 ? 'inline' : _ref$iconPosition,
91
- _ref$disabled = _ref.disabled,
92
- disabled = _ref$disabled === void 0 ? false : _ref$disabled,
93
- _ref$loading = _ref.loading,
94
- loading = _ref$loading === void 0 ? false : _ref$loading,
95
- _ref$disableOnLoading = _ref.disableOnLoading,
96
- disableOnLoading = _ref$disableOnLoading === void 0 ? true : _ref$disableOnLoading,
97
- _ref$small = _ref.small,
98
- small = _ref$small === void 0 ? false : _ref$small,
99
- _ref$big = _ref.big,
100
- big = _ref$big === void 0 ? false : _ref$big,
101
- _ref$withShadow = _ref.withShadow,
102
- withShadow = _ref$withShadow === void 0 ? false : _ref$withShadow,
103
- _ref$withoutStyle = _ref.withoutStyle,
104
- withoutStyle = _ref$withoutStyle === void 0 ? false : _ref$withoutStyle,
105
- _ref$withoutBootstrap = _ref.withoutBootstrapStyles,
106
- withoutBootstrapStyles = _ref$withoutBootstrap === void 0 ? false : _ref$withoutBootstrap,
107
- _ref$withoutTheme = _ref.withoutTheme,
108
- withoutTheme = _ref$withoutTheme === void 0 ? false : _ref$withoutTheme,
109
- _ref$asLink = _ref.asLink,
110
- asLink = _ref$asLink === void 0 ? false : _ref$asLink,
111
- _ref$outline = _ref.outline,
112
- outline = _ref$outline === void 0 ? false : _ref$outline,
113
- _ref$onClick = _ref.onClick,
114
- onClick = _ref$onClick === void 0 ? null : _ref$onClick,
115
- _ref$className = _ref.className,
116
- className = _ref$className === void 0 ? null : _ref$className,
117
- _ref$iconClassName = _ref.iconClassName,
118
- iconClassName = _ref$iconClassName === void 0 ? null : _ref$iconClassName,
119
- _ref$labelClassName = _ref.labelClassName,
120
- labelClassName = _ref$labelClassName === void 0 ? null : _ref$labelClassName,
121
- _ref$refButton = _ref.refButton,
122
- refButton = _ref$refButton === void 0 ? null : _ref$refButton,
123
- props = _objectWithoutProperties(_ref, _excluded$c);
124
- var finalLabel = label || children;
125
- var text = finalLabel !== null ? /*#__PURE__*/jsxRuntime.jsx(Label, {
126
- children: finalLabel
127
- }) : null;
128
- var hasChildren = label !== null && children !== null;
129
- var hasIcon = icon !== null;
130
- var hasInlineIcon = hasIcon && (iconPosition === 'inline' || text === null);
131
- var hasIconColumns = hasIcon && !hasInlineIcon;
132
- var content = /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
133
- children: [hasInlineIcon ? /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
134
- children: [/*#__PURE__*/jsxRuntime.jsx("span", {
135
- className: classNames([styles$y.icon, iconClassName]),
136
- children: icon
137
- }), text !== null ? /*#__PURE__*/jsxRuntime.jsx("span", {
138
- className: classNames([styles$y.label, labelClassName]),
139
- children: text
140
- }) : null]
141
- }) : null, hasIconColumns ? /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
142
- children: [/*#__PURE__*/jsxRuntime.jsx("span", {
143
- className: classNames([styles$y.left, iconPosition === 'left' ? iconClassName : null]),
144
- children: iconPosition === 'left' ? icon : null
145
- }), /*#__PURE__*/jsxRuntime.jsx("span", {
146
- className: classNames([styles$y.center, labelClassName]),
147
- children: text
148
- }), /*#__PURE__*/jsxRuntime.jsx("span", {
149
- className: classNames([styles$y.right, iconPosition === 'right' ? iconClassName : null]),
150
- children: iconPosition === 'right' ? icon : null
151
- }), hasChildren ? children : null]
152
- }) : null, !hasIcon ? text : null, hasChildren ? children : null]
153
- });
154
- var withStyle = !withoutTheme && !withoutStyle && !asLink;
155
- var buttonClassNames = classNames([!withoutBootstrapStyles ? _defineProperty(_defineProperty(_defineProperty({
156
- btn: withStyle
157
- }, "btn-".concat(outline ? 'outline-' : '').concat(theme), withStyle && theme !== null), "btn-".concat(size), withStyle && size !== null), "active", !withoutStyle && active) : null, styles$y.container, (_ref3 = {}, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_ref3, styles$y.withoutStyle, withoutStyle), styles$y.withIcon, hasIcon), styles$y.withIconColumns, hasIconColumns), styles$y.withText, text !== null), styles$y.withShadow, withShadow), styles$y.isSmall, small), styles$y.isBig, big), styles$y.isLink, href !== null), styles$y.asLink, asLink), styles$y.isDisabled, disabled), _defineProperty(_ref3, styles$y.isLoading, loading)), className]);
158
- if (href !== null) {
159
- var linkClassNames = classNames([buttonClassNames, _defineProperty({
160
- disabled: disabled
161
- }, styles$y.linkDisabled, disabled)]);
162
- return external || direct ? /*#__PURE__*/jsxRuntime.jsx("a", _objectSpread(_objectSpread({}, props), {}, {
163
- href: !disabled ? href : undefined,
164
- className: linkClassNames,
165
- onClick: onClick,
166
- target: external ? target : undefined,
167
- ref: refButton,
168
- tabIndex: !focusable ? -1 : undefined,
169
- children: content
170
- })) : /*#__PURE__*/jsxRuntime.jsx(wouter.Link, {
171
- href: href,
172
- className: linkClassNames,
173
- onClick: onClick,
174
- ref: refButton,
175
- tabIndex: focusable ? '' : '-1',
176
- children: content
177
- });
178
- }
179
- return /*#__PURE__*/jsxRuntime.jsx("button", _objectSpread(_objectSpread({}, props), {}, {
180
- type: type,
181
- className: buttonClassNames,
182
- onClick: onClick,
183
- disabled: disabled || disableOnLoading && loading,
184
- ref: refButton,
185
- tabIndex: !focusable ? -1 : undefined,
186
- children: content
187
- }));
188
- }
189
-
190
- var styles$x = {"container":"micromag-core-buttons-container"};
191
-
192
- var _excluded$b = ["id", "name", "className", "onClick", "theme"];
193
- var emptyArray$9 = [];
194
- function Buttons(_ref) {
195
- var _ref$buttons = _ref.buttons,
196
- buttons = _ref$buttons === void 0 ? emptyArray$9 : _ref$buttons,
197
- _ref$size = _ref.size,
198
- size = _ref$size === void 0 ? null : _ref$size,
199
- _ref$theme = _ref.theme,
200
- theme = _ref$theme === void 0 ? undefined : _ref$theme,
201
- _ref$renderButton = _ref.renderButton,
202
- renderButton = _ref$renderButton === void 0 ? null : _ref$renderButton,
203
- _ref$onClickButton = _ref.onClickButton,
204
- onClickButton = _ref$onClickButton === void 0 ? null : _ref$onClickButton,
205
- _ref$buttonClassName = _ref.buttonClassName,
206
- buttonClassName = _ref$buttonClassName === void 0 ? null : _ref$buttonClassName,
207
- _ref$className = _ref.className,
208
- className = _ref$className === void 0 ? null : _ref$className;
209
- return /*#__PURE__*/jsxRuntime.jsx("div", {
210
- className: classNames(['btn-group', _defineProperty({}, "btn-group-".concat(size), size !== null), styles$x.container, className]),
211
- role: "group",
212
- children: buttons.map(function (button, index) {
213
- var id = button.id;
214
- button.name;
215
- var _button$className = button.className,
216
- customClassName = _button$className === void 0 ? null : _button$className,
217
- _button$onClick = button.onClick,
218
- _onClick = _button$onClick === void 0 ? null : _button$onClick,
219
- _button$theme = button.theme,
220
- buttonTheme = _button$theme === void 0 ? null : _button$theme,
221
- buttonProps = _objectWithoutProperties(button, _excluded$b);
222
- var fixedProps = {
223
- className: classNames([styles$x.button, customClassName, buttonClassName, {}]),
224
- onClick: function onClick(e) {
225
- if (_onClick !== null) {
226
- _onClick(e, button, index);
227
- }
228
- if (onClickButton !== null) {
229
- onClickButton(e, button, index);
230
- }
231
- },
232
- theme: buttonTheme || theme
233
- };
234
- var buttonKey = id || "button-".concat(index);
235
- return renderButton !== null ? renderButton(button, index, _objectSpread({
236
- key: buttonKey
237
- }, fixedProps)) : /*#__PURE__*/jsxRuntime.jsx(Button$1, _objectSpread(_objectSpread({}, fixedProps), buttonProps), buttonKey);
238
- })
239
- });
240
- }
241
-
242
- var _excluded$a = ["className"];
243
- function BackButton(_ref) {
244
- var _ref$className = _ref.className,
245
- className = _ref$className === void 0 ? null : _ref$className,
246
- props = _objectWithoutProperties(_ref, _excluded$a);
247
- return /*#__PURE__*/jsxRuntime.jsx(Button$1, _objectSpread({
248
- className: classNames(['px-2', className]),
249
- size: "sm",
250
- icon: /*#__PURE__*/jsxRuntime.jsx(reactFontawesome.FontAwesomeIcon, {
251
- icon: faAngleLeft.faAngleLeft,
252
- size: "lg"
253
- })
254
- }, props));
255
- }
256
-
257
- var styles$w = {"container":"micromag-core-buttons-clear-container","icon":"micromag-core-buttons-clear-icon"};
258
-
259
- var _excluded$9 = ["onClick", "className"];
260
- function ClearButton(_ref) {
261
- var _ref$onClick = _ref.onClick,
262
- onClick = _ref$onClick === void 0 ? null : _ref$onClick,
263
- _ref$className = _ref.className,
264
- className = _ref$className === void 0 ? null : _ref$className,
265
- props = _objectWithoutProperties(_ref, _excluded$9);
266
- return /*#__PURE__*/jsxRuntime.jsx("button", _objectSpread(_objectSpread({
267
- className: classNames([styles$w.container, className]),
268
- onClick: onClick
269
- }, props), {}, {
270
- children: /*#__PURE__*/jsxRuntime.jsx(reactFontawesome.FontAwesomeIcon, {
271
- className: styles$w.icon,
272
- icon: faClose.faClose,
273
- size: "md"
274
- })
275
- }));
276
- }
277
-
278
- var _excluded$8 = ["type"],
279
- _excluded2 = ["component", "id", "settings"];
280
- var emptyArray$8 = [];
281
- var emptyObject$1 = {};
282
- function FieldForm(_ref) {
283
- var _ref$name = _ref.name,
284
- name = _ref$name === void 0 ? null : _ref$name,
285
- _ref$value = _ref.value,
286
- value = _ref$value === void 0 ? null : _ref$value,
287
- _ref$form = _ref.form,
288
- form = _ref$form === void 0 ? null : _ref$form,
289
- _ref$formComponents = _ref.formComponents,
290
- formComponents = _ref$formComponents === void 0 ? emptyObject$1 : _ref$formComponents,
291
- _ref$fields = _ref.fields,
292
- fields = _ref$fields === void 0 ? emptyArray$8 : _ref$fields,
293
- _ref$className = _ref.className,
294
- className = _ref$className === void 0 ? null : _ref$className,
295
- _ref$onChange = _ref.onChange,
296
- onChange = _ref$onChange === void 0 ? null : _ref$onChange,
297
- gotoFieldForm = _ref.gotoFieldForm,
298
- closeFieldForm = _ref.closeFieldForm,
299
- _ref$fieldContext = _ref.fieldContext,
300
- fieldContext = _ref$fieldContext === void 0 ? null : _ref$fieldContext;
301
- var fieldsManager = contexts.useFieldsManager();
302
- var field = utils.getFieldFromPath(name.split('.'), fields, fieldsManager);
303
- var parentField = name.match(/\.[0-9]+$/) !== null ? utils.getFieldFromPath(name.split('.').slice(0, -1), fields, fieldsManager) : null;
304
- var _ref2 = field || {},
305
- _ref2$type = _ref2.type,
306
- type = _ref2$type === void 0 ? null : _ref2$type,
307
- fieldProps = _objectWithoutProperties(_ref2, _excluded$8);
308
- var fieldDefinition = fieldsManager.getDefinition(type) || null;
309
- var fieldData = fieldDefinition || _objectSpread({}, field);
310
- var _ref3 = fieldData || {},
311
- _ref3$component = _ref3.component,
312
- fieldComponent = _ref3$component === void 0 ? null : _ref3$component;
313
- _ref3.id;
314
- _ref3.settings;
315
- var definitionProps = _objectWithoutProperties(_ref3, _excluded2);
316
- var FieldComponent = contexts.useFieldComponent(fieldComponent);
317
- var FormComponent = utils.getComponentFromName(form, formComponents);
318
- var fieldValue = get(value, name, null);
319
- var onFieldChange = function onFieldChange(newFieldValue) {
320
- // const { name, fields: subFields = null } = field || {};
321
- var newValue = utils.setFieldValue(value, name.split('.'), newFieldValue
322
- // field === null || subFields !== null ? newFieldValue : newFieldValue[name],
323
- );
324
- if (onChange !== null) {
325
- onChange(newValue);
326
- }
327
- };
328
- var closeForm = React.useCallback(function () {
329
- return closeFieldForm(name, form);
330
- }, [name, form, closeFieldForm]);
331
- var formProps = {
332
- name: name,
333
- value: fieldValue,
334
- onChange: onFieldChange,
335
- gotoFieldForm: gotoFieldForm,
336
- closeFieldForm: closeFieldForm,
337
- closeForm: closeForm
338
- };
339
- if (form !== null) {
340
- return FormComponent !== null ? /*#__PURE__*/jsxRuntime.jsx(contexts.FieldContextProvider, {
341
- context: fieldContext,
342
- children: /*#__PURE__*/jsxRuntime.jsx(FormComponent, _objectSpread(_objectSpread({
343
- field: field
344
- }, formProps), {}, {
345
- className: className
346
- }))
347
- }) : null;
348
- }
349
- var _ref4 = parentField || {},
350
- itemsProps = _ref4.itemsProps;
351
-
352
- // Use field component with isForm props
353
- return FieldComponent !== null ? /*#__PURE__*/jsxRuntime.jsx(contexts.FieldContextProvider, {
354
- context: fieldContext,
355
- children: /*#__PURE__*/jsxRuntime.jsx(FieldComponent, _objectSpread(_objectSpread(_objectSpread(_objectSpread({
356
- className: className
357
- }, definitionProps), fieldProps), itemsProps), {}, {
358
- isForm: true
359
- }, formProps))
360
- }) : null;
361
- }
362
-
363
- var styles$v = {"container":"micromag-core-forms-form-container","panel":"micromag-core-forms-form-panel","actions":"micromag-core-forms-form-actions","left":"micromag-core-forms-form-left","right":"micromag-core-forms-form-right"};
364
-
365
- var emptyArray$7 = [];
366
- function Form(_ref) {
367
- var action = _ref.action,
368
- _ref$method = _ref.method,
369
- method = _ref$method === void 0 ? 'POST' : _ref$method,
370
- _ref$fields = _ref.fields,
371
- initialFields = _ref$fields === void 0 ? emptyArray$7 : _ref$fields,
372
- _ref$initialValue = _ref.initialValue,
373
- initialValue = _ref$initialValue === void 0 ? null : _ref$initialValue,
374
- _ref$postForm = _ref.postForm,
375
- postForm = _ref$postForm === void 0 ? null : _ref$postForm,
376
- _ref$submitButtonLabe = _ref.submitButtonLabel,
377
- submitButtonLabel = _ref$submitButtonLabe === void 0 ? /*#__PURE__*/jsxRuntime.jsx(reactIntl.FormattedMessage, {
378
- id: "ZLDmja",
379
- defaultMessage: [{
380
- "type": 0,
381
- "value": "Submit"
382
- }]
383
- }) : _ref$submitButtonLabe,
384
- _ref$submitButtonLoad = _ref.submitButtonLoadingLabel,
385
- submitButtonLoadingLabel = _ref$submitButtonLoad === void 0 ? null : _ref$submitButtonLoad,
386
- _ref$submitButtonThem = _ref.submitButtonTheme,
387
- submitButtonTheme = _ref$submitButtonThem === void 0 ? null : _ref$submitButtonThem,
388
- _ref$cancelButtonThem = _ref.cancelButtonTheme,
389
- cancelButtonTheme = _ref$cancelButtonThem === void 0 ? null : _ref$cancelButtonThem,
390
- _ref$buttons = _ref.buttons,
391
- buttons = _ref$buttons === void 0 ? null : _ref$buttons,
392
- _ref$children = _ref.children,
393
- children = _ref$children === void 0 ? null : _ref$children,
394
- _ref$actionsAlign = _ref.actionsAlign,
395
- actionsAlign = _ref$actionsAlign === void 0 ? 'left' : _ref$actionsAlign,
396
- _ref$withoutActions = _ref.withoutActions,
397
- withoutActions = _ref$withoutActions === void 0 ? false : _ref$withoutActions,
398
- _ref$withoutComplete = _ref.withoutComplete,
399
- withoutComplete = _ref$withoutComplete === void 0 ? false : _ref$withoutComplete,
400
- _ref$withoutBackButto = _ref.withoutBackButton,
401
- withoutBackButton = _ref$withoutBackButto === void 0 ? false : _ref$withoutBackButto,
402
- _ref$onComplete = _ref.onComplete,
403
- onComplete = _ref$onComplete === void 0 ? null : _ref$onComplete,
404
- _ref$onResponse = _ref.onResponse,
405
- onResponse = _ref$onResponse === void 0 ? null : _ref$onResponse,
406
- _ref$onMessage = _ref.onMessage,
407
- onMessage = _ref$onMessage === void 0 ? null : _ref$onMessage,
408
- _ref$onCancel = _ref.onCancel,
409
- onCancel = _ref$onCancel === void 0 ? null : _ref$onCancel,
410
- _ref$onCancelHref = _ref.onCancelHref,
411
- onCancelHref = _ref$onCancelHref === void 0 ? null : _ref$onCancelHref,
412
- _ref$onOpenFieldForm = _ref.onOpenFieldForm,
413
- onOpenFieldForm = _ref$onOpenFieldForm === void 0 ? null : _ref$onOpenFieldForm,
414
- _ref$onCloseFieldForm = _ref.onCloseFieldForm,
415
- onCloseFieldForm = _ref$onCloseFieldForm === void 0 ? null : _ref$onCloseFieldForm,
416
- _ref$className = _ref.className,
417
- className = _ref$className === void 0 ? null : _ref$className,
418
- _ref$fieldsClassName = _ref.fieldsClassName,
419
- fieldsClassName = _ref$fieldsClassName === void 0 ? null : _ref$fieldsClassName,
420
- _ref$actionsClassName = _ref.actionsClassName,
421
- actionsClassName = _ref$actionsClassName === void 0 ? null : _ref$actionsClassName,
422
- _ref$cancelClassName = _ref.cancelClassName,
423
- cancelClassName = _ref$cancelClassName === void 0 ? null : _ref$cancelClassName;
424
- var _useState = React.useState(false),
425
- _useState2 = _slicedToArray(_useState, 2),
426
- complete = _useState2[0],
427
- setComplete = _useState2[1];
428
- React.useEffect(function () {
429
- var id = null;
430
- if (complete) {
431
- id = setTimeout(function () {
432
- setComplete(false);
433
- }, 3000);
434
- }
435
- return function () {
436
- clearTimeout(id);
437
- };
438
- }, [complete]);
439
- var onCompleteForm = React.useCallback(function (data) {
440
- if (onComplete !== null) {
441
- onComplete(data);
442
- }
443
- if (!withoutComplete) {
444
- setComplete(true);
445
- }
446
- }, [onComplete, setComplete]);
447
- var _useForm = hooks.useForm({
448
- value: initialValue,
449
- action: action,
450
- fields: initialFields,
451
- postForm: postForm,
452
- onComplete: onCompleteForm
453
- }),
454
- onSubmit = _useForm.onSubmit,
455
- fields = _useForm.fields,
456
- status = _useForm.status,
457
- value = _useForm.value,
458
- setValue = _useForm.setValue,
459
- errors = _useForm.errors,
460
- response = _useForm.response,
461
- generalError = _useForm.generalError;
462
- var FieldsComponent = contexts.useFieldComponent('fields');
463
- React.useEffect(function () {
464
- if (onResponse !== null) {
465
- onResponse(response);
466
- if (onMessage !== null && response && response.message) {
467
- onMessage(response.message);
468
- }
469
- }
470
- }, [response, onResponse, onMessage]);
471
- var canSave = utils.validateFields(fields, value);
472
- var fieldContext = contexts.useFieldContext();
473
- var _useState3 = React.useState([]),
474
- _useState4 = _slicedToArray(_useState3, 2),
475
- fieldPaths = _useState4[0],
476
- setFieldPaths = _useState4[1];
477
- var gotoFieldForm = React.useCallback(function (field) {
478
- var formName = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
479
- var fieldKey = "".concat(field).concat(formName !== null ? ":".concat(formName) : '');
480
- setFieldPaths([].concat(_toConsumableArray(fieldPaths), [fieldKey]));
481
- if (onOpenFieldForm !== null) {
482
- onOpenFieldForm();
483
- }
484
- }, [fieldPaths, setFieldPaths]);
485
- var closeFieldForm = React.useCallback(function () {
486
- var newFields = _toConsumableArray(fieldPaths);
487
- newFields.pop();
488
- setFieldPaths(_toConsumableArray(newFields));
489
- if (onCloseFieldForm !== null) {
490
- onCloseFieldForm();
491
- }
492
- }, [fieldPaths, setFieldPaths]);
493
-
494
- // The last path
495
- var fieldParams = fieldPaths.length > 0 ? fieldPaths[fieldPaths.length - 1] : null;
496
- var fieldName = fieldParams !== null ? fieldParams.replace(/\//g, '.') : null;
497
-
498
- // Get transition value
499
- // const { name: transitionName, timeout: transitionTimeout } = useFormTransition(
500
- // fieldPaths,
501
- // styles,
502
- // );
503
-
504
- return /*#__PURE__*/jsxRuntime.jsxs("form", {
505
- action: action,
506
- className: classNames([styles$v.container, className, {
507
- // 'was-validated': status !== null,
508
- }]),
509
- method: method,
510
- onSubmit: onSubmit,
511
- children: [!withoutBackButton && fields !== null && fields.length > 0 && fieldParams !== null ? /*#__PURE__*/jsxRuntime.jsx("div", {
512
- className: "mb-2",
513
- children: /*#__PURE__*/jsxRuntime.jsx(BackButton, {
514
- theme: "secondary",
515
- outline: true,
516
- onClick: closeFieldForm
517
- })
518
- }) : null, fields !== null && fields.length > 0 && fieldParams !== null ? /*#__PURE__*/jsxRuntime.jsx("div", {
519
- className: classNames(['w-100', styles$v.panel]),
520
- children: /*#__PURE__*/jsxRuntime.jsx(FieldForm, {
521
- name: fieldName,
522
- fields: fields,
523
- value: value,
524
- onChange: setValue,
525
- gotoFieldForm: gotoFieldForm,
526
- closeFieldForm: closeFieldForm,
527
- fieldContext: fieldContext
528
- })
529
- }, "field") : null, FieldsComponent && fields !== null && fields.length > 0 && fieldParams === null ? /*#__PURE__*/jsxRuntime.jsx(FieldsComponent, {
530
- fields: fields,
531
- value: value,
532
- errors: errors,
533
- onChange: setValue,
534
- gotoFieldForm: gotoFieldForm,
535
- closeFieldForm: closeFieldForm,
536
- className: classNames([styles$v.fields, fieldsClassName])
537
- }) : null, generalError ? /*#__PURE__*/jsxRuntime.jsx("p", {
538
- className: "text-danger my-1",
539
- children: generalError
540
- }) : null, children, !withoutActions && fieldParams === null ? /*#__PURE__*/jsxRuntime.jsxs("div", {
541
- className: classNames([styles$v.actions, actionsClassName, _defineProperty({}, styles$v[actionsAlign], actionsAlign)]),
542
- children: [onCancel !== null || onCancelHref !== null ? /*#__PURE__*/jsxRuntime.jsx(Button$1, {
543
- type: "button",
544
- onClick: onCancel,
545
- href: onCancelHref,
546
- theme: cancelButtonTheme || 'secondary',
547
- outline: true,
548
- disabled: status === 'loading',
549
- className: classNames(['me-2', cancelClassName]),
550
- children: /*#__PURE__*/jsxRuntime.jsx(reactIntl.FormattedMessage, {
551
- id: "PyxZY2",
552
- defaultMessage: [{
553
- "type": 0,
554
- "value": "Cancel"
555
- }]
556
- })
557
- }) : null, buttons !== null ? /*#__PURE__*/jsxRuntime.jsx(Buttons, {
558
- buttons: buttons,
559
- className: styles$v.buttons
560
- }) : /*#__PURE__*/jsxRuntime.jsx(Button$1, {
561
- type: "submit",
562
- theme: submitButtonTheme || 'primary',
563
- disabled: status === 'loading' || !canSave,
564
- children: status === 'loading' ? submitButtonLoadingLabel || submitButtonLabel : submitButtonLabel
565
- }), complete ? /*#__PURE__*/jsxRuntime.jsx("p", {
566
- className: "text-success mx-2 my-1",
567
- children: /*#__PURE__*/jsxRuntime.jsx(reactIntl.FormattedMessage, {
568
- id: "BpZoQZ",
569
- defaultMessage: [{
570
- "type": 0,
571
- "value": "Success"
572
- }]
573
- })
574
- }) : null]
575
- }) : null]
576
- });
577
- }
578
-
579
- var styles$u = {"withoutStyle":"micromag-core-partials-link-withoutStyle"};
580
-
581
- var _excluded$7 = ["href", "external", "children", "target", "rel", "className", "withoutStyle"];
582
- function Link(_ref) {
583
- var _ref$href = _ref.href,
584
- href = _ref$href === void 0 ? '' : _ref$href,
585
- _ref$external = _ref.external,
586
- external = _ref$external === void 0 ? false : _ref$external,
587
- _ref$children = _ref.children,
588
- children = _ref$children === void 0 ? null : _ref$children,
589
- _ref$target = _ref.target,
590
- target = _ref$target === void 0 ? '_blank' : _ref$target,
591
- _ref$rel = _ref.rel,
592
- rel = _ref$rel === void 0 ? 'noopener noreferrer' : _ref$rel,
593
- _ref$className = _ref.className,
594
- className = _ref$className === void 0 ? null : _ref$className,
595
- _ref$withoutStyle = _ref.withoutStyle,
596
- withoutStyle = _ref$withoutStyle === void 0 ? false : _ref$withoutStyle,
597
- props = _objectWithoutProperties(_ref, _excluded$7);
598
- return external ? /*#__PURE__*/jsxRuntime.jsx("a", _objectSpread(_objectSpread({
599
- className: classNames([className, _defineProperty({}, styles$u.withoutStyle, withoutStyle)]),
600
- href: href,
601
- target: target,
602
- rel: rel
603
- }, props), {}, {
604
- children: /*#__PURE__*/jsxRuntime.jsx(Label, {
605
- children: children
606
- })
607
- })) : /*#__PURE__*/jsxRuntime.jsx(wouter.Link, _objectSpread(_objectSpread({
608
- className: classNames([className, _defineProperty({}, styles$u.withoutStyle, withoutStyle)]),
609
- href: href
610
- }, props), {}, {
611
- children: /*#__PURE__*/jsxRuntime.jsx(Label, {
612
- children: children
613
- })
614
- }));
615
- }
616
-
617
- var _excluded$6 = ["label", "className"];
618
- function Card(_ref) {
619
- var _ref$href = _ref.href,
620
- href = _ref$href === void 0 ? null : _ref$href,
621
- _ref$header = _ref.header,
622
- header = _ref$header === void 0 ? null : _ref$header,
623
- _ref$image = _ref.image,
624
- image = _ref$image === void 0 ? null : _ref$image,
625
- _ref$imageAlt = _ref.imageAlt,
626
- imageAlt = _ref$imageAlt === void 0 ? null : _ref$imageAlt,
627
- _ref$imageOverlay = _ref.imageOverlay,
628
- imageOverlay = _ref$imageOverlay === void 0 ? false : _ref$imageOverlay,
629
- _ref$beforeBody = _ref.beforeBody,
630
- beforeBody = _ref$beforeBody === void 0 ? null : _ref$beforeBody,
631
- _ref$title = _ref.title,
632
- title = _ref$title === void 0 ? null : _ref$title,
633
- _ref$subtitle = _ref.subtitle,
634
- subtitle = _ref$subtitle === void 0 ? null : _ref$subtitle,
635
- _ref$children = _ref.children,
636
- children = _ref$children === void 0 ? null : _ref$children,
637
- _ref$afterBody = _ref.afterBody,
638
- afterBody = _ref$afterBody === void 0 ? null : _ref$afterBody,
639
- _ref$links = _ref.links,
640
- links = _ref$links === void 0 ? null : _ref$links,
641
- _ref$linksInSameBody = _ref.linksInSameBody,
642
- linksInSameBody = _ref$linksInSameBody === void 0 ? false : _ref$linksInSameBody,
643
- _ref$footer = _ref.footer,
644
- footer = _ref$footer === void 0 ? null : _ref$footer,
645
- _ref$theme = _ref.theme,
646
- theme = _ref$theme === void 0 ? null : _ref$theme,
647
- _ref$className = _ref.className,
648
- className = _ref$className === void 0 ? null : _ref$className,
649
- _ref$imageClassName = _ref.imageClassName,
650
- imageClassName = _ref$imageClassName === void 0 ? null : _ref$imageClassName,
651
- _ref$headerClassName = _ref.headerClassName,
652
- headerClassName = _ref$headerClassName === void 0 ? null : _ref$headerClassName,
653
- _ref$titleClassName = _ref.titleClassName,
654
- titleClassName = _ref$titleClassName === void 0 ? null : _ref$titleClassName,
655
- _ref$subtitleClassNam = _ref.subtitleClassName,
656
- subtitleClassName = _ref$subtitleClassNam === void 0 ? null : _ref$subtitleClassNam,
657
- _ref$bodyClassName = _ref.bodyClassName,
658
- bodyClassName = _ref$bodyClassName === void 0 ? null : _ref$bodyClassName,
659
- _ref$footerClassName = _ref.footerClassName,
660
- footerClassName = _ref$footerClassName === void 0 ? null : _ref$footerClassName,
661
- _ref$onClick = _ref.onClick,
662
- onClick = _ref$onClick === void 0 ? null : _ref$onClick,
663
- _ref$onClickBody = _ref.onClickBody,
664
- onClickBody = _ref$onClickBody === void 0 ? null : _ref$onClickBody,
665
- _ref$onClickFooter = _ref.onClickFooter,
666
- onClickFooter = _ref$onClickFooter === void 0 ? null : _ref$onClickFooter;
667
- var linksElements = (links || []).map(function (_ref2, index) {
668
- var label = _ref2.label,
669
- _ref2$className = _ref2.className,
670
- linkClassName = _ref2$className === void 0 ? null : _ref2$className,
671
- linkProps = _objectWithoutProperties(_ref2, _excluded$6);
672
- return /*#__PURE__*/jsxRuntime.jsx(Link, _objectSpread(_objectSpread({
673
- className: classNames(['card-link', linkClassName])
674
- }, linkProps), {}, {
675
- children: label
676
- }), "link-".concat(label, "-").concat(index));
677
- });
678
- var bodyInner = title !== null || subtitle !== null || children !== null || links !== null && linksInSameBody ? /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
679
- children: [title !== null ? /*#__PURE__*/jsxRuntime.jsx("h5", {
680
- className: classNames(['card-title', titleClassName]),
681
- children: /*#__PURE__*/jsxRuntime.jsx(Label, {
682
- children: title
683
- })
684
- }) : null, subtitle !== null ? /*#__PURE__*/jsxRuntime.jsx("h6", {
685
- className: classNames(['card-subtitle', subtitleClassName]),
686
- children: /*#__PURE__*/jsxRuntime.jsx(Label, {
687
- children: subtitle
688
- })
689
- }) : null, children, links !== null && linksInSameBody ? /*#__PURE__*/jsxRuntime.jsx("div", {
690
- className: "d-flex",
691
- children: linksElements
692
- }) : null]
693
- }) : null;
694
- var cardInner = /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
695
- children: [header !== null ? /*#__PURE__*/jsxRuntime.jsx("div", {
696
- className: classNames(['card-header', headerClassName]),
697
- children: /*#__PURE__*/jsxRuntime.jsx(Label, {
698
- children: header
699
- })
700
- }) : null, typeof image === 'string' ? /*#__PURE__*/jsxRuntime.jsx("img", {
701
- src: image,
702
- alt: imageAlt,
703
- className: classNames(['card-img-top', imageClassName])
704
- }) : image, beforeBody, bodyInner !== null ? onClickBody !== null ? /*#__PURE__*/jsxRuntime.jsx("button", {
705
- type: "button",
706
- className: classNames([bodyClassName, {
707
- 'card-body': !imageOverlay,
708
- 'card-img-overlay': imageOverlay
709
- }]),
710
- onClick: onClickBody,
711
- children: bodyInner
712
- }) : /*#__PURE__*/jsxRuntime.jsx("div", {
713
- className: classNames([bodyClassName, {
714
- 'card-body': !imageOverlay,
715
- 'card-img-overlay': imageOverlay
716
- }]),
717
- children: bodyInner
718
- }) : null, afterBody, links !== null && linksElements !== null && !linksInSameBody ? /*#__PURE__*/jsxRuntime.jsx("div", {
719
- className: "card-body",
720
- children: linksElements
721
- }) : null, footer !== null ? onClickFooter !== null ? /*#__PURE__*/jsxRuntime.jsx("button", {
722
- type: "button",
723
- className: classNames(['card-footer', footerClassName]),
724
- onClick: onClickFooter,
725
- children: /*#__PURE__*/jsxRuntime.jsx(Label, {
726
- children: footer
727
- })
728
- }) : /*#__PURE__*/jsxRuntime.jsx("div", {
729
- className: classNames(['card-footer', footerClassName]),
730
- children: /*#__PURE__*/jsxRuntime.jsx(Label, {
731
- children: footer
732
- })
733
- }) : null]
734
- });
735
- var cardClassName = classNames(['card', _defineProperty(_defineProperty(_defineProperty(_defineProperty({}, "bg-".concat(theme), !imageOverlay && theme !== 'dark'), 'bg-dark', imageOverlay || theme === 'dark'), 'text-dark', theme === 'light'), 'text-light', imageOverlay || theme === 'dark' || theme === 'primary'), className]);
736
- if (href !== null) {
737
- return /*#__PURE__*/jsxRuntime.jsx(Link, {
738
- href: href,
739
- className: cardClassName,
740
- children: cardInner
741
- });
742
- }
743
- if (onClick !== null) {
744
- return /*#__PURE__*/jsxRuntime.jsx("button", {
745
- type: "button",
746
- className: classNames(['p-0', 'text-start', cardClassName]),
747
- onClick: onClick,
748
- children: cardInner
749
- });
750
- }
751
- return /*#__PURE__*/jsxRuntime.jsx("div", {
752
- className: cardClassName,
753
- children: cardInner
754
- });
755
- }
756
-
757
- var styles$t = {"container":"micromag-core-partials-spinner-container","path":"micromag-core-partials-spinner-path","animated":"micromag-core-partials-spinner-animated"};
758
-
759
- function Spinner(_ref) {
760
- var _ref$animated = _ref.animated,
761
- animated = _ref$animated === void 0 ? true : _ref$animated,
762
- _ref$color = _ref.color,
763
- color = _ref$color === void 0 ? 'currentColor' : _ref$color,
764
- _ref$strokeWidth = _ref.strokeWidth,
765
- strokeWidth = _ref$strokeWidth === void 0 ? 3 : _ref$strokeWidth,
766
- _ref$className = _ref.className,
767
- className = _ref$className === void 0 ? null : _ref$className;
768
- return /*#__PURE__*/jsxRuntime.jsx("svg", {
769
- className: classNames([styles$t.container, className, _defineProperty({}, styles$t.animated, animated)]),
770
- width: "40",
771
- height: "40",
772
- viewBox: "0 0 40 40",
773
- xmlns: "http://www.w3.org/2000/svg",
774
- children: /*#__PURE__*/jsxRuntime.jsx("circle", {
775
- className: styles$t.path,
776
- cx: "20",
777
- cy: "20",
778
- r: "12",
779
- fill: "none",
780
- stroke: color,
781
- strokeWidth: strokeWidth
782
- })
783
- });
784
- }
785
-
786
- var styles$s = {"container":"micromag-core-forms-form-panel-container"};
787
-
788
- var _excluded$5 = ["description", "loading", "children", "className"];
789
- function FormPanel(_ref) {
790
- var _ref$description = _ref.description,
791
- description = _ref$description === void 0 ? null : _ref$description,
792
- _ref$loading = _ref.loading,
793
- loading = _ref$loading === void 0 ? false : _ref$loading,
794
- _ref$children = _ref.children,
795
- children = _ref$children === void 0 ? null : _ref$children,
796
- _ref$className = _ref.className,
797
- className = _ref$className === void 0 ? null : _ref$className,
798
- props = _objectWithoutProperties(_ref, _excluded$5);
799
- return /*#__PURE__*/jsxRuntime.jsxs(Card, _objectSpread(_objectSpread({
800
- className: classNames([styles$s.container, className])
801
- }, props), {}, {
802
- children: [description, loading ? /*#__PURE__*/jsxRuntime.jsx(Spinner, {}) : children]
803
- }));
804
- }
805
-
806
- function ArrowIcon(_ref) {
807
- var _ref$color = _ref.color,
808
- color = _ref$color === void 0 ? '#fff' : _ref$color,
809
- _ref$className = _ref.className,
810
- className = _ref$className === void 0 ? null : _ref$className;
811
- return /*#__PURE__*/jsxRuntime.jsx("svg", {
812
- width: "20",
813
- height: "14",
814
- viewBox: "0 0 20 14",
815
- fill: "none",
816
- xmlns: "http://www.w3.org/2000/svg",
817
- className: className,
818
- children: /*#__PURE__*/jsxRuntime.jsx("path", {
819
- fillRule: "evenodd",
820
- clipRule: "evenodd",
821
- d: "M13.353 0.371014L19.319 6.33704C19.6851 6.70314 19.6851 7.29671 19.319 7.66282L13.353 13.6288C12.9869 13.9949 12.3933 13.9949 12.0272 13.6288C11.6611 13.2627 11.6611 12.6692 12.0272 12.3031L16.3929 7.9374H0V6.06246H16.3929L12.0272 1.6968C11.6611 1.33069 11.6611 0.737119 12.0272 0.371014C12.3933 0.0049094 12.9869 0.0049094 13.353 0.371014Z",
822
- fill: color
823
- })
824
- });
825
- }
826
-
827
- function CloseIcon(_ref) {
828
- var _ref$color = _ref.color,
829
- color = _ref$color === void 0 ? '#fff' : _ref$color,
830
- _ref$className = _ref.className,
831
- className = _ref$className === void 0 ? null : _ref$className;
832
- return /*#__PURE__*/jsxRuntime.jsxs("svg", {
833
- width: "22",
834
- height: "22",
835
- viewBox: "0 0 22 22",
836
- fill: "none",
837
- xmlns: "http://www.w3.org/2000/svg",
838
- className: className,
839
- children: [/*#__PURE__*/jsxRuntime.jsx("path", {
840
- d: "M1 1L21 21",
841
- stroke: color,
842
- strokeWidth: "1.5",
843
- strokeLinecap: "round"
844
- }), /*#__PURE__*/jsxRuntime.jsx("path", {
845
- d: "M1 21L21 0.999998",
846
- stroke: color,
847
- strokeWidth: "1.5",
848
- strokeLinecap: "round"
849
- })]
850
- });
851
- }
852
-
853
- function FullscreenIcon(_ref) {
854
- var _ref$color = _ref.color,
855
- color = _ref$color === void 0 ? '#fff' : _ref$color,
856
- _ref$className = _ref.className,
857
- className = _ref$className === void 0 ? null : _ref$className;
858
- return /*#__PURE__*/jsxRuntime.jsx("svg", {
859
- width: "16",
860
- height: "14",
861
- viewBox: "0 0 16 14",
862
- fill: "none",
863
- xmlns: "http://www.w3.org/2000/svg",
864
- className: className,
865
- children: /*#__PURE__*/jsxRuntime.jsx("path", {
866
- d: "M11.2 0H16V4.66667H14.4V1.55556H11.2V0ZM0 0H4.8V1.55556H1.6V4.66667H0V0ZM14.4 12.4444V9.33333H16V14H11.2V12.4444H14.4ZM1.6 12.4444H4.8V14H0V9.33333H1.6V12.4444Z",
867
- fill: color
868
- })
869
- });
870
- }
871
-
872
- function LinkIcon(_ref) {
873
- var _ref$color = _ref.color,
874
- color = _ref$color === void 0 ? '#fff' : _ref$color,
875
- _ref$className = _ref.className,
876
- className = _ref$className === void 0 ? null : _ref$className;
877
- return /*#__PURE__*/jsxRuntime.jsxs("svg", {
878
- width: "16",
879
- height: "16",
880
- viewBox: "0 0 16 16",
881
- fill: "none",
882
- xmlns: "http://www.w3.org/2000/svg",
883
- className: className,
884
- children: [/*#__PURE__*/jsxRuntime.jsx("path", {
885
- d: "M6.60207 8.70208C7.75493 10.2515 9.95019 10.5697 11.4965 9.40761C11.6277 9.31077 11.7589 9.2001 11.8762 9.08251L13.9749 6.97975C15.3417 5.61018 15.3417 3.39674 13.9749 2.02717C12.608 0.657609 10.3989 0.657609 9.03205 2.02717L7.83086 3.22381",
886
- stroke: color,
887
- strokeWidth: "1.25",
888
- strokeLinecap: "round",
889
- strokeLinejoin: "round"
890
- }), /*#__PURE__*/jsxRuntime.jsx("path", {
891
- d: "M9.39793 7.29793C8.24507 5.74852 6.04981 5.43034 4.50345 6.59239C4.37229 6.68923 4.24113 6.7999 4.12377 6.91749L2.02515 9.02026C0.658284 10.3898 0.658284 12.6033 2.02515 13.9728C3.39201 15.3424 5.60109 15.3424 6.96795 13.9728L8.16223 12.7762",
892
- stroke: color,
893
- strokeWidth: "1.25",
894
- strokeLinecap: "round",
895
- strokeLinejoin: "round"
896
- })]
897
- });
898
- }
899
-
900
- function MuteIcon(_ref) {
901
- var _ref$color = _ref.color,
902
- color = _ref$color === void 0 ? '#fff' : _ref$color,
903
- _ref$className = _ref.className,
904
- className = _ref$className === void 0 ? null : _ref$className;
905
- return /*#__PURE__*/jsxRuntime.jsxs("svg", {
906
- width: "26",
907
- height: "26",
908
- viewBox: "0 0 26 26",
909
- fill: "none",
910
- xmlns: "http://www.w3.org/2000/svg",
911
- className: className,
912
- children: [/*#__PURE__*/jsxRuntime.jsx("path", {
913
- d: "M7.09929 8.77987H1C0.447715 8.77987 0 9.22758 0 9.77987V15.7799C0 16.3322 0.447715 16.7799 1 16.7799H7.1076C7.35984 16.7799 7.60276 16.8752 7.78768 17.0467L14.3199 23.1062C14.9599 23.6999 16 23.246 16 22.3731V3.00199C16 2.12221 14.9458 1.67117 14.3095 2.2787L7.78983 8.50316C7.6038 8.68077 7.35649 8.77987 7.09929 8.77987Z",
914
- fill: color
915
- }), /*#__PURE__*/jsxRuntime.jsx("path", {
916
- d: "M18 18.6875C21.3137 18.6875 24 16.0012 24 12.6875C24 9.37379 21.3137 6.6875 18 6.6875",
917
- stroke: color
918
- }), /*#__PURE__*/jsxRuntime.jsx("path", {
919
- d: "M18 15.6875C19.6569 15.6875 21 14.3444 21 12.6875C21 11.0306 19.6569 9.6875 18 9.6875",
920
- stroke: color
921
- })]
922
- });
923
- }
924
-
925
- function PauseIcon(_ref) {
926
- var _ref$color = _ref.color,
927
- color = _ref$color === void 0 ? '#fff' : _ref$color,
928
- _ref$className = _ref.className,
929
- className = _ref$className === void 0 ? null : _ref$className;
930
- return /*#__PURE__*/jsxRuntime.jsxs("svg", {
931
- className: className,
932
- width: "14",
933
- height: "18",
934
- viewBox: "0 0 14 18",
935
- fill: "none",
936
- xmlns: "http://www.w3.org/2000/svg",
937
- children: [/*#__PURE__*/jsxRuntime.jsx("rect", {
938
- width: "6",
939
- height: "18",
940
- rx: "2",
941
- fill: color
942
- }), /*#__PURE__*/jsxRuntime.jsx("rect", {
943
- x: "8",
944
- width: "6",
945
- height: "18",
946
- rx: "2",
947
- fill: color
948
- })]
949
- });
950
- }
951
-
952
- function PlayIcon(_ref) {
953
- var _ref$color = _ref.color,
954
- color = _ref$color === void 0 ? '#fff' : _ref$color,
955
- _ref$className = _ref.className,
956
- className = _ref$className === void 0 ? null : _ref$className;
957
- return /*#__PURE__*/jsxRuntime.jsx("svg", {
958
- width: "40",
959
- height: "45.1",
960
- viewBox: "0 0 40 45.1",
961
- fill: "none",
962
- xmlns: "http://www.w3.org/2000/svg",
963
- className: className,
964
- children: /*#__PURE__*/jsxRuntime.jsx("path", {
965
- d: "M38.2,25.7L5.5,44.6C3,46,0,44.2,0,41.4L0,3.6c0-2.8,3-4.5,5.5-3.1l32.7,18.9C40.6,20.8,40.6,24.3,38.2,25.7z",
966
- fill: color,
967
- stroke: color
968
- })
969
- });
970
- }
971
-
972
- function UnmuteIcon(_ref) {
973
- var _ref$color = _ref.color,
974
- color = _ref$color === void 0 ? '#fff' : _ref$color,
975
- _ref$className = _ref.className,
976
- className = _ref$className === void 0 ? null : _ref$className;
977
- return /*#__PURE__*/jsxRuntime.jsxs("svg", {
978
- width: "26",
979
- height: "26",
980
- viewBox: "0 0 26 26",
981
- fill: "none",
982
- xmlns: "http://www.w3.org/2000/svg",
983
- className: className,
984
- children: [/*#__PURE__*/jsxRuntime.jsx("path", {
985
- d: "M7.09929 8.77987H1C0.447715 8.77987 0 9.22758 0 9.77987V15.7799C0 16.3322 0.447715 16.7799 1 16.7799H7.1076C7.35984 16.7799 7.60276 16.8752 7.78768 17.0467L14.3199 23.1062C14.9599 23.6999 16 23.246 16 22.3731V3.00199C16 2.12221 14.9458 1.67117 14.3095 2.2787L7.78983 8.50316C7.6038 8.68077 7.35649 8.77987 7.09929 8.77987Z",
986
- fill: color
987
- }), /*#__PURE__*/jsxRuntime.jsx("path", {
988
- fillRule: "evenodd",
989
- clipRule: "evenodd",
990
- d: "M20.8536 13.3946L23 15.5411L23.7071 14.834L21.5607 12.6875L23.7071 10.5411L23 9.83398L20.8536 11.9804L18.7071 9.83398L18 10.5411L20.1464 12.6875L18 14.834L18.7071 15.5411L20.8536 13.3946Z",
991
- fill: color
992
- })]
993
- });
994
- }
995
-
996
- var styles$r = {"container":"micromag-core-menus-breadcrumb-container","arrow":"micromag-core-menus-breadcrumb-arrow"};
997
-
998
- var emptyArray$6 = [];
999
- function Breadcrumb(_ref) {
1000
- var _ref$items = _ref.items,
1001
- items = _ref$items === void 0 ? emptyArray$6 : _ref$items,
1002
- _ref$theme = _ref.theme,
1003
- theme = _ref$theme === void 0 ? null : _ref$theme,
1004
- _ref$separator = _ref.separator,
1005
- separator = _ref$separator === void 0 ? null : _ref$separator,
1006
- _ref$withoutBar = _ref.withoutBar,
1007
- withoutBar = _ref$withoutBar === void 0 ? false : _ref$withoutBar,
1008
- _ref$noWrap = _ref.noWrap,
1009
- noWrap = _ref$noWrap === void 0 ? false : _ref$noWrap,
1010
- _ref$className = _ref.className,
1011
- className = _ref$className === void 0 ? null : _ref$className;
1012
- return /*#__PURE__*/jsxRuntime.jsx("nav", {
1013
- className: className,
1014
- children: /*#__PURE__*/jsxRuntime.jsx("ol", {
1015
- className: classNames([styles$r.container, 'breadcrumb', 'mb-0', {
1016
- 'p-0': withoutBar,
1017
- 'bg-transparent': withoutBar,
1018
- 'rounded-0': withoutBar,
1019
- 'flex-nowrap': noWrap
1020
- }]),
1021
- children: items.map(function (_ref2, index) {
1022
- var url = _ref2.url,
1023
- label = _ref2.label,
1024
- _ref2$active = _ref2.active,
1025
- active = _ref2$active === void 0 ? false : _ref2$active,
1026
- _ref2$onClick = _ref2.onClick,
1027
- onClick = _ref2$onClick === void 0 ? null : _ref2$onClick;
1028
- return /*#__PURE__*/jsxRuntime.jsxs("li", {
1029
- className: classNames(['breadcrumb-item', _defineProperty(_defineProperty({
1030
- active: active
1031
- }, styles$r.arrow, separator === 'arrow'), "text-".concat(theme), active && theme !== null)]),
1032
- children: [active ? /*#__PURE__*/jsxRuntime.jsx(Label, {
1033
- children: label
1034
- }) : null, !active && url ? /*#__PURE__*/jsxRuntime.jsx(wouter.Link, {
1035
- href: url,
1036
- onClick: onClick,
1037
- className: classNames(['font-weight-bold', 'text-decoration-none', _defineProperty({}, "text-".concat(theme), theme !== null)]),
1038
- children: /*#__PURE__*/jsxRuntime.jsx(Label, {
1039
- children: label
1040
- })
1041
- }) : null, !active && onClick ? /*#__PURE__*/jsxRuntime.jsx(Button$1, {
1042
- onClick: onClick,
1043
- className: classNames(['font-weight-bold', 'text-decoration-none', _defineProperty({}, "text-".concat(theme), theme !== null)]),
1044
- children: /*#__PURE__*/jsxRuntime.jsx(Label, {
1045
- children: label
1046
- })
1047
- }) : null]
1048
- }, "item-".concat(index));
1049
- })
1050
- })
1051
- });
1052
- }
1053
-
1054
- var _excluded$4 = ["type", "className", "label", "children", "onClick", "active"];
1055
- var emptyArray$5 = [];
1056
- function Dropdown(_ref) {
1057
- var _ref$items = _ref.items,
1058
- items = _ref$items === void 0 ? emptyArray$5 : _ref$items,
1059
- _ref$children = _ref.children,
1060
- children = _ref$children === void 0 ? null : _ref$children,
1061
- _ref$visible = _ref.visible,
1062
- visible = _ref$visible === void 0 ? false : _ref$visible,
1063
- _ref$align = _ref.align,
1064
- align = _ref$align === void 0 ? null : _ref$align,
1065
- _ref$className = _ref.className,
1066
- className = _ref$className === void 0 ? null : _ref$className,
1067
- _ref$itemClassName = _ref.itemClassName,
1068
- itemClassName = _ref$itemClassName === void 0 ? null : _ref$itemClassName,
1069
- _ref$onClickItem = _ref.onClickItem,
1070
- onClickItem = _ref$onClickItem === void 0 ? null : _ref$onClickItem,
1071
- _ref$onClickOutside = _ref.onClickOutside,
1072
- onClickOutside = _ref$onClickOutside === void 0 ? null : _ref$onClickOutside;
1073
- var refContainer = React.useRef(null);
1074
- var _useState = React.useState(visible),
1075
- _useState2 = _slicedToArray(_useState, 2),
1076
- enabled = _useState2[0],
1077
- setEnabled = _useState2[1];
1078
- var onDocumentClick = React.useCallback(function (e) {
1079
- if (refContainer.current && !refContainer.current.contains(e.currentTarget) && !refContainer.current.contains(e.target) && onClickOutside !== null) {
1080
- onClickOutside(e);
1081
- }
1082
- }, [refContainer.current, onClickOutside]);
1083
- hooks.useDocumentEvent('click', onDocumentClick, enabled);
1084
-
1085
- // Delay the outside click detection
1086
- React.useEffect(function () {
1087
- var id = setTimeout(function () {
1088
- setEnabled(visible);
1089
- }, 100);
1090
- return function () {
1091
- clearTimeout(id);
1092
- };
1093
- }, [visible, setEnabled]);
1094
- return /*#__PURE__*/jsxRuntime.jsx("div", {
1095
- className: classNames(['dropdown-menu', _defineProperty(_defineProperty({}, "dropdown-menu-".concat(align), align !== null), "show", visible), className]),
1096
- ref: refContainer,
1097
- children: children !== null ? children : items.map(function (it, index) {
1098
- var _it$type = it.type,
1099
- type = _it$type === void 0 ? 'link' : _it$type,
1100
- _it$className = it.className,
1101
- customClassName = _it$className === void 0 ? null : _it$className,
1102
- _it$label = it.label,
1103
- label = _it$label === void 0 ? null : _it$label,
1104
- _it$children = it.children,
1105
- itemChildren = _it$children === void 0 ? null : _it$children,
1106
- _it$onClick = it.onClick,
1107
- customOnClick = _it$onClick === void 0 ? null : _it$onClick,
1108
- _it$active = it.active,
1109
- active = _it$active === void 0 ? false : _it$active,
1110
- itemProps = _objectWithoutProperties(it, _excluded$4);
1111
- var ItemComponent = 'div';
1112
- if (type === 'link') {
1113
- ItemComponent = Link;
1114
- } else if (type === 'button') {
1115
- ItemComponent = 'button';
1116
- } else if (type === 'header') {
1117
- ItemComponent = 'h6';
1118
- } else if (type === 'divider') {
1119
- ItemComponent = 'hr';
1120
- }
1121
- var finalOnClickItem = customOnClick !== null || type === 'link' && onClickItem !== null ? function (e) {
1122
- if (customOnClick !== null) {
1123
- customOnClick(e);
1124
- }
1125
- if (type === 'link' && onClickItem !== null) {
1126
- onClickItem(e);
1127
- }
1128
- } : null;
1129
- return ItemComponent !== null ? /*#__PURE__*/jsxRuntime.jsx("div", {
1130
- children: /*#__PURE__*/jsxRuntime.jsx(ItemComponent, _objectSpread(_objectSpread({
1131
- className: classNames([customClassName, itemClassName, {
1132
- 'dropdown-item': type === 'link' || type === 'button',
1133
- 'dropdown-divider': type === 'divider',
1134
- 'dropdown-header': type === 'header',
1135
- active: active
1136
- }]),
1137
- onClick: finalOnClickItem
1138
- }, itemProps), {}, {
1139
- children: label !== null ? /*#__PURE__*/jsxRuntime.jsx(Label, {
1140
- children: label
1141
- }) : itemChildren
1142
- }))
1143
- }, "item-".concat(index + 1, "-").concat(label, "-").concat(type)) : null;
1144
- })
1145
- });
1146
- }
1147
-
1148
- var _excluded$3 = ["id", "className", "linkClassName", "href", "label", "external", "items", "dropdown", "active", "onClick"];
1149
- var emptyArray$4 = [];
1150
- function Menu(_ref) {
1151
- var _ref$items = _ref.items,
1152
- items = _ref$items === void 0 ? emptyArray$4 : _ref$items,
1153
- _ref$tagName = _ref.tagName,
1154
- tagName = _ref$tagName === void 0 ? 'ul' : _ref$tagName,
1155
- _ref$itemTagName = _ref.itemTagName,
1156
- itemTagName = _ref$itemTagName === void 0 ? 'li' : _ref$itemTagName,
1157
- _ref$children = _ref.children,
1158
- children = _ref$children === void 0 ? null : _ref$children,
1159
- _ref$linkAsItem = _ref.linkAsItem,
1160
- linkAsItem = _ref$linkAsItem === void 0 ? false : _ref$linkAsItem,
1161
- _ref$className = _ref.className,
1162
- className = _ref$className === void 0 ? null : _ref$className,
1163
- _ref$itemClassName = _ref.itemClassName,
1164
- itemClassName = _ref$itemClassName === void 0 ? null : _ref$itemClassName,
1165
- _ref$linkClassName = _ref.linkClassName,
1166
- linkClassName = _ref$linkClassName === void 0 ? null : _ref$linkClassName,
1167
- _ref$hasSubMenuClassN = _ref.hasSubMenuClassName,
1168
- hasSubMenuClassName = _ref$hasSubMenuClassN === void 0 ? null : _ref$hasSubMenuClassN,
1169
- _ref$subMenuClassName = _ref.subMenuClassName,
1170
- subMenuClassName = _ref$subMenuClassName === void 0 ? null : _ref$subMenuClassName,
1171
- _ref$subMenuItemClass = _ref.subMenuItemClassName,
1172
- subMenuItemClassName = _ref$subMenuItemClass === void 0 ? null : _ref$subMenuItemClass,
1173
- _ref$subMenuLinkClass = _ref.subMenuLinkClassName,
1174
- subMenuLinkClassName = _ref$subMenuLinkClass === void 0 ? null : _ref$subMenuLinkClass,
1175
- _ref$hasDropdownClass = _ref.hasDropdownClassName,
1176
- hasDropdownClassName = _ref$hasDropdownClass === void 0 ? null : _ref$hasDropdownClass,
1177
- _ref$dropdownClassNam = _ref.dropdownClassName,
1178
- dropdownClassName = _ref$dropdownClassNam === void 0 ? null : _ref$dropdownClassNam,
1179
- _ref$dropdownItemClas = _ref.dropdownItemClassName,
1180
- dropdownItemClassName = _ref$dropdownItemClas === void 0 ? null : _ref$dropdownItemClas,
1181
- _ref$dropdownLinkClas = _ref.dropdownLinkClassName,
1182
- dropdownLinkClassName = _ref$dropdownLinkClas === void 0 ? null : _ref$dropdownLinkClas,
1183
- _ref$dropdownAlign = _ref.dropdownAlign,
1184
- dropdownAlign = _ref$dropdownAlign === void 0 ? null : _ref$dropdownAlign;
1185
- var _useState = React.useState(items.map(function () {
1186
- return false;
1187
- })),
1188
- _useState2 = _slicedToArray(_useState, 2),
1189
- dropdownsVisible = _useState2[0],
1190
- setDropdownsVisible = _useState2[1];
1191
- var ListComponent = linkAsItem ? 'div' : tagName;
1192
- return /*#__PURE__*/jsxRuntime.jsx(ListComponent, {
1193
- className: className,
1194
- children: children !== null ? children : items.map(function (it, index) {
1195
- var id = it.id,
1196
- _it$className = it.className,
1197
- customClassName = _it$className === void 0 ? null : _it$className,
1198
- _it$linkClassName = it.linkClassName,
1199
- customLinkClassName = _it$linkClassName === void 0 ? null : _it$linkClassName,
1200
- _it$href = it.href,
1201
- href = _it$href === void 0 ? null : _it$href,
1202
- label = it.label,
1203
- _it$external = it.external,
1204
- external = _it$external === void 0 ? false : _it$external,
1205
- _it$items = it.items,
1206
- subItems = _it$items === void 0 ? null : _it$items,
1207
- _it$dropdown = it.dropdown,
1208
- dropdown = _it$dropdown === void 0 ? null : _it$dropdown,
1209
- _it$active = it.active,
1210
- active = _it$active === void 0 ? false : _it$active,
1211
- _it$onClick = it.onClick,
1212
- customOnClick = _it$onClick === void 0 ? null : _it$onClick,
1213
- itemProps = _objectWithoutProperties(it, _excluded$3);
1214
- var onClickItem = dropdown !== null ? function (e) {
1215
- e.preventDefault();
1216
- setDropdownsVisible([].concat(_toConsumableArray(dropdownsVisible.slice(0, index)), [!(dropdownsVisible[index] || false)], _toConsumableArray(dropdownsVisible.slice(index + 1))));
1217
- if (customOnClick !== null) {
1218
- customOnClick(e);
1219
- }
1220
- } : customOnClick;
1221
- var closeDropdown = dropdown !== null ? function () {
1222
- setDropdownsVisible([].concat(_toConsumableArray(dropdownsVisible.slice(0, index)), [false], _toConsumableArray(dropdownsVisible.slice(index + 1))));
1223
- } : null;
1224
- var ItemComponent = itemTagName;
1225
- return linkAsItem ? /*#__PURE__*/React.createElement(Link, _objectSpread(_objectSpread({}, itemProps), {}, {
1226
- key: "item-".concat(id || index),
1227
- onClick: onClickItem,
1228
- href: href,
1229
- external: external,
1230
- className: classNames([itemClassName, customClassName, linkClassName, customLinkClassName, {
1231
- active: active
1232
- }])
1233
- }), label) : /*#__PURE__*/jsxRuntime.jsxs(ItemComponent, {
1234
- className: classNames([itemClassName, customClassName, _defineProperty(_defineProperty({
1235
- dropdown: dropdown !== null,
1236
- active: active
1237
- }, hasSubMenuClassName, subItems !== null && hasSubMenuClassName !== null), hasDropdownClassName, subItems !== null && hasDropdownClassName !== null)]),
1238
- children: [href !== null ? /*#__PURE__*/jsxRuntime.jsx(Link, _objectSpread(_objectSpread({}, itemProps), {}, {
1239
- onClick: onClickItem,
1240
- href: href,
1241
- external: external,
1242
- className: classNames([linkClassName, customLinkClassName, {
1243
- 'dropdown-toggle': dropdown !== null
1244
- }]),
1245
- children: label
1246
- })) : null, href === null && onClickItem !== null ? /*#__PURE__*/jsxRuntime.jsx(Button$1, _objectSpread(_objectSpread({}, itemProps), {}, {
1247
- onClick: onClickItem,
1248
- className: classNames([linkClassName, customLinkClassName, {
1249
- 'dropdown-toggle': dropdown !== null
1250
- }]),
1251
- children: label
1252
- })) : null, subItems !== null ? /*#__PURE__*/jsxRuntime.jsx(Menu, {
1253
- items: subItems,
1254
- className: subMenuClassName,
1255
- itemClassName: classNames([subMenuItemClassName, _defineProperty({}, itemClassName, subMenuItemClassName === null && itemClassName !== null)]),
1256
- linkClassName: classNames([subMenuLinkClassName, _defineProperty({}, linkClassName, subMenuLinkClassName === null && linkClassName !== null)])
1257
- }) : null, dropdown !== null ? /*#__PURE__*/jsxRuntime.jsx(Dropdown, {
1258
- items: dropdown,
1259
- visible: dropdownsVisible[index] || false,
1260
- className: dropdownClassName,
1261
- itemClassName: classNames([dropdownItemClassName, _defineProperty({}, itemClassName, dropdownItemClassName === null && itemClassName !== null)]),
1262
- linkClassName: classNames([dropdownLinkClassName, _defineProperty({}, linkClassName, dropdownLinkClassName === null && linkClassName !== null)]),
1263
- align: dropdownAlign,
1264
- onClickItem: closeDropdown,
1265
- onClickOutside: closeDropdown
1266
- }) : null]
1267
- }, "item-".concat(id || index));
1268
- })
1269
- });
1270
- }
1271
-
1272
- var styles$q = {"collapse":"micromag-core-menus-navbar-collapse"};
1273
-
1274
- function Navbar(_ref) {
1275
- var _ref$brand = _ref.brand,
1276
- brand = _ref$brand === void 0 ? null : _ref$brand,
1277
- _ref$brandLink = _ref.brandLink,
1278
- brandLink = _ref$brandLink === void 0 ? null : _ref$brandLink,
1279
- _ref$breadcrumbs = _ref.breadcrumbs,
1280
- breadcrumbs = _ref$breadcrumbs === void 0 ? null : _ref$breadcrumbs,
1281
- _ref$theme = _ref.theme,
1282
- theme = _ref$theme === void 0 ? null : _ref$theme,
1283
- _ref$size = _ref.size,
1284
- size = _ref$size === void 0 ? 'md' : _ref$size,
1285
- _ref$compact = _ref.compact,
1286
- compact = _ref$compact === void 0 ? false : _ref$compact,
1287
- _ref$noWrap = _ref.noWrap,
1288
- noWrap = _ref$noWrap === void 0 ? false : _ref$noWrap,
1289
- _ref$withoutCollapse = _ref.withoutCollapse,
1290
- withoutCollapse = _ref$withoutCollapse === void 0 ? false : _ref$withoutCollapse,
1291
- _ref$withoutCollapseT = _ref.withoutCollapseToggle,
1292
- withoutCollapseToggle = _ref$withoutCollapseT === void 0 ? false : _ref$withoutCollapseT,
1293
- _ref$children = _ref.children,
1294
- children = _ref$children === void 0 ? null : _ref$children,
1295
- _ref$className = _ref.className,
1296
- className = _ref$className === void 0 ? null : _ref$className,
1297
- _ref$brandClassName = _ref.brandClassName,
1298
- brandClassName = _ref$brandClassName === void 0 ? null : _ref$brandClassName,
1299
- _ref$breadCrumbsClass = _ref.breadCrumbsClassName,
1300
- breadCrumbsClassName = _ref$breadCrumbsClass === void 0 ? null : _ref$breadCrumbsClass,
1301
- _ref$collapseClassNam = _ref.collapseClassName,
1302
- collapseClassName = _ref$collapseClassNam === void 0 ? null : _ref$collapseClassNam;
1303
- var _useState = React.useState(false),
1304
- _useState2 = _slicedToArray(_useState, 2),
1305
- menuVisible = _useState2[0],
1306
- setMenuVisible = _useState2[1];
1307
- var onClickMenu = React.useCallback(function () {
1308
- return setMenuVisible(!menuVisible);
1309
- }, [setMenuVisible, menuVisible]);
1310
- return /*#__PURE__*/jsxRuntime.jsx("nav", {
1311
- className: classNames(['navbar', _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, "bg-".concat(theme), theme !== null), "navbar-".concat(theme === 'light' ? 'light' : 'dark'), theme !== null), "text-".concat(theme === 'light' ? 'dark' : 'light'), theme !== null), "navbar-expand-".concat(size), !withoutCollapse), 'navbar-expand', withoutCollapse), 'py-2', compact), 'px-2', compact), 'flex-nowrap', noWrap), className]),
1312
- children: /*#__PURE__*/jsxRuntime.jsxs("div", {
1313
- className: classNames(['container-fluid', {
1314
- 'px-0': compact
1315
- }]),
1316
- children: [brand !== null && brandLink !== null ? /*#__PURE__*/jsxRuntime.jsx(Link, {
1317
- className: classNames(['navbar-brand', brandClassName, {
1318
- 'py-0': compact
1319
- }]),
1320
- href: brandLink,
1321
- children: brand
1322
- }) : null, brand !== null && brandLink === null ? /*#__PURE__*/jsxRuntime.jsx("span", {
1323
- className: classNames(['navbar-brand', brandClassName, {
1324
- 'py-0': compact
1325
- }]),
1326
- children: brand
1327
- }) : null, breadcrumbs !== null ? /*#__PURE__*/jsxRuntime.jsx("span", {
1328
- className: classNames(['navbar-breadcrumbs', breadCrumbsClassName, {
1329
- 'py-0': compact
1330
- }]),
1331
- children: breadcrumbs
1332
- }) : null, !withoutCollapse && !withoutCollapseToggle ? /*#__PURE__*/jsxRuntime.jsx(Button$1, {
1333
- className: "navbar-toggler",
1334
- onClick: onClickMenu,
1335
- withoutTheme: true,
1336
- "aria-controls": "navbarSupportedContent",
1337
- "aria-expanded": "false",
1338
- "aria-label": "Toggle navigation",
1339
- children: /*#__PURE__*/jsxRuntime.jsx("span", {
1340
- className: "navbar-toggler-icon"
1341
- })
1342
- }) : null, !withoutCollapse ? /*#__PURE__*/jsxRuntime.jsx("div", {
1343
- className: classNames(['navbar-collapse', 'collapse', styles$q.collapse, collapseClassName, {
1344
- show: menuVisible
1345
- }]),
1346
- children: children
1347
- }) : children]
1348
- })
1349
- });
1350
- }
1351
-
1352
- var styles$p = {"container":"micromag-core-menus-pagination-container"};
1353
-
1354
- var messages = reactIntl.defineMessages({
1355
- previous: {
1356
- id: "menus.pagination.previous",
1357
- defaultMessage: [{
1358
- "type": 0,
1359
- "value": "Previous"
1360
- }]
1361
- },
1362
- next: {
1363
- id: "menus.pagination.next",
1364
- defaultMessage: [{
1365
- "type": 0,
1366
- "value": "next"
1367
- }]
1368
- }
1369
- });
1370
- function PaginationMenu(_ref) {
1371
- var _ref$page = _ref.page,
1372
- parentPage = _ref$page === void 0 ? 1 : _ref$page,
1373
- _ref$lastPage = _ref.lastPage,
1374
- parentLastPage = _ref$lastPage === void 0 ? 1 : _ref$lastPage,
1375
- _ref$maxPages = _ref.maxPages,
1376
- parentMaxPages = _ref$maxPages === void 0 ? 10 : _ref$maxPages,
1377
- _ref$total = _ref.total,
1378
- parentTotal = _ref$total === void 0 ? 1 : _ref$total,
1379
- _ref$url = _ref.url,
1380
- url = _ref$url === void 0 ? null : _ref$url,
1381
- _ref$query = _ref.query,
1382
- query = _ref$query === void 0 ? null : _ref$query,
1383
- _ref$withPreviousNext = _ref.withPreviousNext,
1384
- withPreviousNext = _ref$withPreviousNext === void 0 ? false : _ref$withPreviousNext,
1385
- _ref$className = _ref.className,
1386
- className = _ref$className === void 0 ? null : _ref$className,
1387
- _ref$paginationClassN = _ref.paginationClassName,
1388
- paginationClassName = _ref$paginationClassN === void 0 ? null : _ref$paginationClassN,
1389
- _ref$itemClassName = _ref.itemClassName,
1390
- itemClassName = _ref$itemClassName === void 0 ? null : _ref$itemClassName,
1391
- _ref$linkClassName = _ref.linkClassName,
1392
- linkClassName = _ref$linkClassName === void 0 ? null : _ref$linkClassName,
1393
- _ref$onClickPage = _ref.onClickPage,
1394
- onClickPage = _ref$onClickPage === void 0 ? null : _ref$onClickPage;
1395
- var getUrl = React.useCallback(function (currentPage) {
1396
- return url !== null ? "".concat(url, "?").concat(queryString.stringify(_objectSpread(_objectSpread({}, query), {}, {
1397
- page: currentPage
1398
- }), {
1399
- arrayFormat: 'bracket'
1400
- })) : null;
1401
- }, [url, query]);
1402
-
1403
- // TODO: test this
1404
- // const pages = [...Array(total).keys()].map((it) => it + 1);
1405
-
1406
- var page = parseInt(parentPage, 10);
1407
- var total = parseInt(parentTotal, 10);
1408
- var maxPages = parseInt(parentMaxPages, 10);
1409
- var lastPage = parseInt(parentLastPage, 10);
1410
- var pageNumbers = Array.from({
1411
- length: parseInt(lastPage, 10)
1412
- }, function (_, i) {
1413
- return i + 1;
1414
- });
1415
- var stripPages = maxPages !== null && lastPage > maxPages;
1416
- var startPage = stripPages ? Math.min(Math.max(page - maxPages / 2, 1), lastPage - maxPages) : null;
1417
- var endPage = stripPages ? startPage + maxPages : null;
1418
- var strippedPages = stripPages ? pageNumbers.reduce(function (selectedPages, pageNumber) {
1419
- if (pageNumber === 1 && startPage - 1 > 1) {
1420
- return [pageNumber, '...'];
1421
- }
1422
- if (pageNumber === lastPage && endPage + 1 < lastPage) {
1423
- return [].concat(_toConsumableArray(selectedPages), ['...', pageNumber]);
1424
- }
1425
- return pageNumber >= startPage && pageNumber <= endPage ? [].concat(_toConsumableArray(selectedPages), [pageNumber]) : selectedPages;
1426
- }, []) : pageNumbers;
1427
- var pages = strippedPages.length > 0 ? strippedPages : [1];
1428
- return /*#__PURE__*/jsxRuntime.jsx("nav", {
1429
- className: classNames([styles$p.container, className]),
1430
- children: /*#__PURE__*/jsxRuntime.jsxs("ul", {
1431
- className: classNames(['pagination', paginationClassName]),
1432
- children: [withPreviousNext ? /*#__PURE__*/jsxRuntime.jsx("li", {
1433
- className: classNames(['page-item', itemClassName, {
1434
- disabled: page <= 1
1435
- }]),
1436
- children: page > 1 ? /*#__PURE__*/jsxRuntime.jsx(Link, {
1437
- className: classNames(['page-link', linkClassName]),
1438
- href: getUrl(page - 1),
1439
- onClick: onClickPage !== null ? function () {
1440
- return onClickPage(page - 1);
1441
- } : null,
1442
- children: messages.previous
1443
- }) : /*#__PURE__*/jsxRuntime.jsx("span", {
1444
- className: classNames(['page-link', linkClassName]),
1445
- children: /*#__PURE__*/jsxRuntime.jsx(Label, {
1446
- children: messages.previous
1447
- })
1448
- })
1449
- }) : null, pages.map(function (pageNumber) {
1450
- return /*#__PURE__*/jsxRuntime.jsx("li", {
1451
- className: classNames(['page-item', itemClassName, {
1452
- active: pageNumber === page
1453
- }]),
1454
- children: /*#__PURE__*/jsxRuntime.jsx(Link, {
1455
- className: classNames(['page-link', linkClassName]),
1456
- href: getUrl(pageNumber),
1457
- onClick: onClickPage !== null ? function () {
1458
- return onClickPage(pageNumber);
1459
- } : null,
1460
- children: pageNumber
1461
- })
1462
- }, "page-".concat(pageNumber));
1463
- }), withPreviousNext ? /*#__PURE__*/jsxRuntime.jsx("li", {
1464
- className: classNames(['page-item', itemClassName, {
1465
- disabled: page >= total
1466
- }]),
1467
- children: page < total ? /*#__PURE__*/jsxRuntime.jsx(Link, {
1468
- className: classNames(['page-link', linkClassName]),
1469
- href: getUrl(page + 1),
1470
- onClick: onClickPage !== null ? function () {
1471
- return onClickPage(page + 1);
1472
- } : null,
1473
- children: messages.next
1474
- }) : /*#__PURE__*/jsxRuntime.jsx("span", {
1475
- className: classNames(['page-link', linkClassName]),
1476
- children: /*#__PURE__*/jsxRuntime.jsx(Label, {
1477
- children: messages.next
1478
- })
1479
- })
1480
- }) : null]
1481
- })
1482
- });
1483
- }
1484
-
1485
- var styles$o = {"container":"micromag-core-menus-tabs-container"};
1486
-
1487
- /* eslint-disable react/no-array-index-key, react/jsx-props-no-spreading */
1488
- var emptyArray$3 = [];
1489
- function TabsMenu(_ref) {
1490
- var _ref$items = _ref.items,
1491
- items = _ref$items === void 0 ? emptyArray$3 : _ref$items,
1492
- _ref$size = _ref.size,
1493
- size = _ref$size === void 0 ? null : _ref$size,
1494
- _ref$theme = _ref.theme,
1495
- theme = _ref$theme === void 0 ? 'secondary' : _ref$theme,
1496
- _ref$renderItemButton = _ref.renderItemButton,
1497
- renderItemButton = _ref$renderItemButton === void 0 ? null : _ref$renderItemButton,
1498
- _ref$buttonClassName = _ref.buttonClassName,
1499
- buttonClassName = _ref$buttonClassName === void 0 ? null : _ref$buttonClassName,
1500
- _ref$className = _ref.className,
1501
- className = _ref$className === void 0 ? null : _ref$className,
1502
- _ref$onClickItem = _ref.onClickItem,
1503
- onClickItem = _ref$onClickItem === void 0 ? null : _ref$onClickItem;
1504
- return /*#__PURE__*/jsxRuntime.jsx("div", {
1505
- className: classNames([styles$o.container, className]),
1506
- children: /*#__PURE__*/jsxRuntime.jsx(Buttons, {
1507
- buttons: items,
1508
- size: size,
1509
- theme: theme,
1510
- renderButton: renderItemButton,
1511
- onClickButton: onClickItem,
1512
- className: styles$o.buttons,
1513
- buttonClassName: classNames([styles$o.button, buttonClassName])
1514
- })
1515
- });
1516
- }
1517
-
1518
- var styles$n = {"container":"micromag-core-modals-container","modals":"micromag-core-modals-modals","hasModals":"micromag-core-modals-hasModals"};
1519
-
1520
- function ModalsContainer(_ref) {
1521
- var modals = _ref.modals,
1522
- setModalsContainer = _ref.setModalsContainer,
1523
- _ref$className = _ref.className,
1524
- className = _ref$className === void 0 ? null : _ref$className;
1525
- var containerRef = React.useRef(null);
1526
- React.useEffect(function () {
1527
- setModalsContainer(containerRef.current);
1528
- }, []);
1529
- return /*#__PURE__*/jsxRuntime.jsx("div", {
1530
- className: classNames([styles$n.container, className]),
1531
- children: /*#__PURE__*/jsxRuntime.jsx("div", {
1532
- className: classNames([styles$n.modals, _defineProperty({}, styles$n.hasModals, modals.length > 0)]),
1533
- ref: containerRef
1534
- })
1535
- });
1536
- }
1537
- var Modals = contexts.withModals(ModalsContainer);
1538
-
1539
- /* eslint-disable react/no-array-index-key, react/jsx-props-no-spreading */
1540
- function ElementPortal(_ref) {
1541
- var _ref$id = _ref.id,
1542
- id = _ref$id === void 0 ? null : _ref$id,
1543
- _ref$data = _ref.data,
1544
- data = _ref$data === void 0 ? null : _ref$data,
1545
- _ref$children = _ref.children,
1546
- children = _ref$children === void 0 ? null : _ref$children,
1547
- _ref$container = _ref.container,
1548
- container = _ref$container === void 0 ? null : _ref$container,
1549
- _ref$register = _ref.register,
1550
- register = _ref$register === void 0 ? null : _ref$register,
1551
- _ref$unregister = _ref.unregister,
1552
- unregister = _ref$unregister === void 0 ? null : _ref$unregister;
1553
- var finalId = React.useMemo(function () {
1554
- return id || "element-".concat(new Date().getTime());
1555
- }, [id]);
1556
- React.useEffect(function () {
1557
- if (register !== null) {
1558
- register(finalId, data);
1559
- }
1560
- return function () {
1561
- if (unregister !== null) {
1562
- unregister(finalId);
1563
- }
1564
- };
1565
- }, [finalId, data]);
1566
- return container !== null ? /*#__PURE__*/reactDom.createPortal(children, container) : null;
1567
- }
1568
-
1569
- /* eslint-disable react/no-array-index-key, react/jsx-props-no-spreading */
1570
- function ModalPortal(_ref) {
1571
- var _ref$id = _ref.id,
1572
- id = _ref$id === void 0 ? null : _ref$id,
1573
- _ref$data = _ref.data,
1574
- data = _ref$data === void 0 ? null : _ref$data,
1575
- _ref$children = _ref.children,
1576
- children = _ref$children === void 0 ? null : _ref$children;
1577
- var _useModals = contexts.useModals(),
1578
- container = _useModals.container,
1579
- _useModals$register = _useModals.register,
1580
- register = _useModals$register === void 0 ? null : _useModals$register,
1581
- _useModals$unregister = _useModals.unregister,
1582
- unregister = _useModals$unregister === void 0 ? null : _useModals$unregister;
1583
- return /*#__PURE__*/jsxRuntime.jsx(ElementPortal, {
1584
- id: id,
1585
- data: data,
1586
- container: container,
1587
- register: register,
1588
- unregister: unregister,
1589
- children: children
1590
- });
1591
- }
1592
-
1593
- var styles$m = {"container":"micromag-core-modals-modal-container","center":"micromag-core-modals-modal-center","inner":"micromag-core-modals-modal-inner","top":"micromag-core-modals-modal-top"};
1594
-
1595
- function Modal(_ref) {
1596
- var _ref$id = _ref.id,
1597
- id = _ref$id === void 0 ? null : _ref$id,
1598
- _ref$children = _ref.children,
1599
- children = _ref$children === void 0 ? null : _ref$children,
1600
- _ref$position = _ref.position,
1601
- position = _ref$position === void 0 ? 'center' : _ref$position,
1602
- _ref$title = _ref.title,
1603
- title = _ref$title === void 0 ? null : _ref$title;
1604
- var finalId = React.useMemo(function () {
1605
- return id || utils.getDisplayName(children.type);
1606
- }, [id, children.type]);
1607
- var data = React.useMemo(function () {
1608
- return {
1609
- title: title
1610
- };
1611
- }, [title]);
1612
- return /*#__PURE__*/jsxRuntime.jsx(ModalPortal, {
1613
- id: finalId,
1614
- data: data,
1615
- children: /*#__PURE__*/jsxRuntime.jsx("div", {
1616
- className: classNames([styles$m.container, _defineProperty({}, styles$m[position], position !== null)]),
1617
- children: /*#__PURE__*/jsxRuntime.jsx("div", {
1618
- className: classNames([styles$m.inner, 'bg-dark', 'rounded']),
1619
- children: children
1620
- })
1621
- })
1622
- });
1623
- }
1624
-
1625
- var styles$l = {"container":"micromag-core-modals-dialog-container"};
1626
-
1627
- function ModalDialog(_ref) {
1628
- var _ref$title = _ref.title,
1629
- title = _ref$title === void 0 ? null : _ref$title,
1630
- _ref$header = _ref.header,
1631
- header = _ref$header === void 0 ? null : _ref$header,
1632
- _ref$children = _ref.children,
1633
- children = _ref$children === void 0 ? null : _ref$children,
1634
- _ref$buttons = _ref.buttons,
1635
- buttons = _ref$buttons === void 0 ? null : _ref$buttons,
1636
- _ref$footer = _ref.footer,
1637
- footer = _ref$footer === void 0 ? null : _ref$footer,
1638
- _ref$size = _ref.size,
1639
- size = _ref$size === void 0 ? null : _ref$size,
1640
- _ref$onClose = _ref.onClose,
1641
- onClose = _ref$onClose === void 0 ? null : _ref$onClose,
1642
- _ref$className = _ref.className,
1643
- className = _ref$className === void 0 ? null : _ref$className,
1644
- _ref$bodyClassName = _ref.bodyClassName,
1645
- bodyClassName = _ref$bodyClassName === void 0 ? null : _ref$bodyClassName;
1646
- return /*#__PURE__*/jsxRuntime.jsx("div", {
1647
- className: classNames([styles$l.container, 'modal-dialog', className, _defineProperty({}, "modal-".concat(size), size !== null)]),
1648
- role: "dialog",
1649
- children: /*#__PURE__*/jsxRuntime.jsxs("div", {
1650
- className: "modal-content",
1651
- children: [header || /*#__PURE__*/jsxRuntime.jsxs("div", {
1652
- className: classNames(['modal-header', 'p-2', 'd-flex', 'justify-content-between', styles$l.header]),
1653
- children: [/*#__PURE__*/jsxRuntime.jsx("h5", {
1654
- className: "modal-title",
1655
- children: /*#__PURE__*/jsxRuntime.jsx(Label, {
1656
- children: title
1657
- })
1658
- }), /*#__PURE__*/jsxRuntime.jsx("button", {
1659
- type: "button",
1660
- className: "btn btn-close p-2",
1661
- "aria-label": "Close",
1662
- onClick: onClose
1663
- })]
1664
- }), /*#__PURE__*/jsxRuntime.jsx("div", {
1665
- className: classNames(['modal-body', 'p-2', bodyClassName]),
1666
- children: children
1667
- }), footer !== null || buttons !== null ? /*#__PURE__*/jsxRuntime.jsxs("div", {
1668
- className: classNames(['modal-footer', 'p-2', styles$l.footer]),
1669
- children: [footer, buttons !== null ? /*#__PURE__*/jsxRuntime.jsx(Buttons, {
1670
- buttons: buttons,
1671
- className: styles$l.buttons
1672
- }) : null]
1673
- }) : null]
1674
- })
1675
- });
1676
- }
1677
-
1678
- var styles$k = {"container":"micromag-core-panels-container"};
1679
-
1680
- var emptyArray$2 = [];
1681
- function PanelsContainer(_ref) {
1682
- var _ref$panels = _ref.panels,
1683
- panels = _ref$panels === void 0 ? emptyArray$2 : _ref$panels,
1684
- _ref$setPanelsContain = _ref.setPanelsContainer,
1685
- setPanelsContainer = _ref$setPanelsContain === void 0 ? null : _ref$setPanelsContain,
1686
- _ref$className = _ref.className,
1687
- className = _ref$className === void 0 ? null : _ref$className;
1688
- var containerRef = React.useRef(null);
1689
- React.useEffect(function () {
1690
- setPanelsContainer(containerRef.current);
1691
- }, []);
1692
- return /*#__PURE__*/jsxRuntime.jsx("div", {
1693
- className: classNames([styles$k.container, className]),
1694
- children: /*#__PURE__*/jsxRuntime.jsx("div", {
1695
- className: classNames([styles$k.panels, _defineProperty({}, styles$k.hasPanels, panels.length > 0)]),
1696
- ref: containerRef
1697
- })
1698
- });
1699
- }
1700
- var Panels = contexts.withPanels(PanelsContainer);
1701
-
1702
- /* eslint-disable react/no-array-index-key, react/jsx-props-no-spreading */
1703
- function PanelPortal(_ref) {
1704
- var _ref$id = _ref.id,
1705
- id = _ref$id === void 0 ? null : _ref$id,
1706
- _ref$data = _ref.data,
1707
- data = _ref$data === void 0 ? null : _ref$data,
1708
- _ref$children = _ref.children,
1709
- children = _ref$children === void 0 ? null : _ref$children;
1710
- var _usePanels = contexts.usePanels(),
1711
- _usePanels$panels = _usePanels.panels,
1712
- panels = _usePanels$panels === void 0 ? null : _usePanels$panels,
1713
- container = _usePanels.container,
1714
- _usePanels$register = _usePanels.register,
1715
- register = _usePanels$register === void 0 ? null : _usePanels$register,
1716
- _usePanels$unregister = _usePanels.unregister,
1717
- unregister = _usePanels$unregister === void 0 ? null : _usePanels$unregister;
1718
- if (panels === null) {
1719
- return children;
1720
- }
1721
- return /*#__PURE__*/jsxRuntime.jsx(ElementPortal, {
1722
- id: id,
1723
- data: data,
1724
- container: container,
1725
- register: register,
1726
- unregister: unregister,
1727
- children: children
1728
- });
1729
- }
1730
-
1731
- var styles$j = {"container":"micromag-core-panels-panel-container"};
1732
-
1733
- /* eslint-disable react/no-array-index-key, react/jsx-props-no-spreading */
1734
- function Panel(_ref) {
1735
- var _ref$id = _ref.id,
1736
- id = _ref$id === void 0 ? null : _ref$id,
1737
- _ref$children = _ref.children,
1738
- children = _ref$children === void 0 ? null : _ref$children,
1739
- _ref$title = _ref.title,
1740
- title = _ref$title === void 0 ? null : _ref$title;
1741
- var finalId = React.useMemo(function () {
1742
- return id || utils.getDisplayName(children.type);
1743
- }, [id, children.type]);
1744
- var data = React.useMemo(function () {
1745
- return {
1746
- title: title
1747
- };
1748
- }, [title]);
1749
- return /*#__PURE__*/jsxRuntime.jsx(PanelPortal, {
1750
- id: finalId,
1751
- data: data,
1752
- children: /*#__PURE__*/jsxRuntime.jsx("div", {
1753
- className: styles$j.container,
1754
- children: children
1755
- })
1756
- });
1757
- }
1758
-
1759
- var styles$i = {"container":"micromag-core-partials-collapsable-panel-container","top":"micromag-core-partials-collapsable-panel-top","button":"micromag-core-partials-collapsable-panel-button","label":"micromag-core-partials-collapsable-panel-label","content":"micromag-core-partials-collapsable-panel-content","isOpened":"micromag-core-partials-collapsable-panel-isOpened"};
1760
-
1761
- function CollapsablePanel(_ref) {
1762
- var _ref$title = _ref.title,
1763
- title = _ref$title === void 0 ? null : _ref$title,
1764
- _ref$children = _ref.children,
1765
- children = _ref$children === void 0 ? null : _ref$children,
1766
- _ref$className = _ref.className,
1767
- className = _ref$className === void 0 ? null : _ref$className,
1768
- _ref$topClassName = _ref.topClassName,
1769
- topClassName = _ref$topClassName === void 0 ? null : _ref$topClassName,
1770
- _ref$contentClassName = _ref.contentClassName,
1771
- contentClassName = _ref$contentClassName === void 0 ? null : _ref$contentClassName,
1772
- _ref$openedClassName = _ref.openedClassName,
1773
- openedClassName = _ref$openedClassName === void 0 ? null : _ref$openedClassName,
1774
- _ref$buttonClassName = _ref.buttonClassName,
1775
- buttonClassName = _ref$buttonClassName === void 0 ? null : _ref$buttonClassName;
1776
- var _useState = React.useState(false),
1777
- _useState2 = _slicedToArray(_useState, 2),
1778
- opened = _useState2[0],
1779
- setOpened = _useState2[1];
1780
- var onClick = React.useCallback(function () {
1781
- return setOpened(!opened);
1782
- }, [opened, setOpened]);
1783
- return /*#__PURE__*/jsxRuntime.jsxs("div", {
1784
- className: classNames([styles$i.container, className, _defineProperty(_defineProperty({}, styles$i.isOpened, opened), openedClassName, opened && openedClassName !== null)]),
1785
- children: [/*#__PURE__*/jsxRuntime.jsx("div", {
1786
- className: classNames([styles$i.top, topClassName]),
1787
- children: /*#__PURE__*/jsxRuntime.jsx(Button$1, {
1788
- withoutStyle: true,
1789
- className: classNames([styles$i.button, buttonClassName]),
1790
- icon: /*#__PURE__*/jsxRuntime.jsx(reactFontawesome.FontAwesomeIcon, {
1791
- icon: opened ? faAngleUp.faAngleUp : faAngleDown.faAngleDown,
1792
- className: styles$i.icon
1793
- }),
1794
- iconPosition: "right",
1795
- labelClassName: styles$i.label,
1796
- onClick: onClick,
1797
- children: title
1798
- })
1799
- }), /*#__PURE__*/jsxRuntime.jsx("div", {
1800
- className: classNames([styles$i.content, contentClassName]),
1801
- children: children
1802
- })]
1803
- });
1804
- }
1805
-
1806
- function Close(_ref) {
1807
- var _ref$stroke = _ref.stroke,
1808
- stroke = _ref$stroke === void 0 ? 'currentColor' : _ref$stroke,
1809
- _ref$border = _ref.border,
1810
- border = _ref$border === void 0 ? 'rgba(0,0,0,0.67)' : _ref$border,
1811
- _ref$fill = _ref.fill,
1812
- fill = _ref$fill === void 0 ? '#fff' : _ref$fill,
1813
- _ref$className = _ref.className,
1814
- className = _ref$className === void 0 ? null : _ref$className;
1815
- return /*#__PURE__*/jsxRuntime.jsx("svg", {
1816
- xmlns: "http://www.w3.org/2000/svg",
1817
- width: "42.9",
1818
- height: "42.9",
1819
- viewBox: "0 0 42.9 42.9",
1820
- className: className,
1821
- children: /*#__PURE__*/jsxRuntime.jsxs("g", {
1822
- transform: "translate(-352.531 -47.531)",
1823
- children: [border ? /*#__PURE__*/jsxRuntime.jsx("path", {
1824
- fill: border,
1825
- d: "M374,47.5c11.9,0,21.5,9.6,21.5,21.5s-9.6,21.5-21.5,21.5s-21.5-9.6-21.5-21.5c0,0,0,0,0,0 C352.5,57.1,362.1,47.5,374,47.5z"
1826
- }) : null, /*#__PURE__*/jsxRuntime.jsx("path", {
1827
- fill: fill,
1828
- d: "M374,50c10.5,0,19,8.5,19,19s-8.5,19-19,19s-19-8.5-19-19S363.5,50,374,50z"
1829
- }), /*#__PURE__*/jsxRuntime.jsx("g", {
1830
- transform: "translate(366.893 61.893)",
1831
- children: /*#__PURE__*/jsxRuntime.jsxs("g", {
1832
- transform: "translate(0 0)",
1833
- children: [/*#__PURE__*/jsxRuntime.jsx("path", {
1834
- fill: fill,
1835
- stroke: stroke,
1836
- strokeWidth: "2",
1837
- strokeLinecap: "round",
1838
- d: "M14.2,0.3L0,13.9"
1839
- }), /*#__PURE__*/jsxRuntime.jsx("path", {
1840
- fill: fill,
1841
- stroke: stroke,
1842
- strokeWidth: "2",
1843
- strokeLinecap: "round",
1844
- d: "M0.3,0l13.7,14.2"
1845
- })]
1846
- })
1847
- })]
1848
- })
1849
- });
1850
- }
1851
-
1852
- /* eslint-disable react/jsx-props-no-spreading */
1853
- function Date$1(_ref) {
1854
- var _ref$date = _ref.date,
1855
- date = _ref$date === void 0 ? null : _ref$date,
1856
- _ref$withTime = _ref.withTime,
1857
- withTime = _ref$withTime === void 0 ? false : _ref$withTime,
1858
- _ref$timeSeparator = _ref.timeSeparator,
1859
- timeSeparator = _ref$timeSeparator === void 0 ? ', ' : _ref$timeSeparator;
1860
- var dateObject = React.useMemo(function () {
1861
- return dayjs(date).toDate();
1862
- }, [date]);
1863
- return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
1864
- children: [/*#__PURE__*/jsxRuntime.jsx(reactIntl.FormattedDate, {
1865
- value: dateObject,
1866
- year: "numeric",
1867
- month: "long",
1868
- day: "2-digit"
1869
- }), withTime ? timeSeparator : null, withTime ? /*#__PURE__*/jsxRuntime.jsx(reactIntl.FormattedTime, {
1870
- value: dateObject
1871
- }) : null]
1872
- });
1873
- }
1874
-
1875
- /* eslint-disable react/no-danger */
1876
- function Detector(_ref) {
1877
- var _ref$throttleDelay = _ref.throttleDelay,
1878
- throttleDelay = _ref$throttleDelay === void 0 ? null : _ref$throttleDelay,
1879
- _ref$threshold = _ref.threshold,
1880
- threshold = _ref$threshold === void 0 ? undefined : _ref$threshold,
1881
- _ref$onEnter = _ref.onEnter,
1882
- onEnter = _ref$onEnter === void 0 ? null : _ref$onEnter,
1883
- _ref$onLeave = _ref.onLeave,
1884
- onLeave = _ref$onLeave === void 0 ? null : _ref$onLeave,
1885
- _ref$onChange = _ref.onChange,
1886
- onChange = _ref$onChange === void 0 ? null : _ref$onChange,
1887
- _ref$disabled = _ref.disabled,
1888
- disabled = _ref$disabled === void 0 ? false : _ref$disabled,
1889
- _ref$children = _ref.children,
1890
- children = _ref$children === void 0 ? null : _ref$children,
1891
- _ref$className = _ref.className,
1892
- className = _ref$className === void 0 ? null : _ref$className;
1893
- var _useIntersectionObser = hooks.useIntersectionObserver({
1894
- threshold: threshold
1895
- }),
1896
- ref = _useIntersectionObser.ref,
1897
- isIntersecting = _useIntersectionObser.entry.isIntersecting;
1898
- var enteredRef = React.useRef(false);
1899
- var triggerChange = React.useMemo(function () {
1900
- var callback = function callback(intersecting) {
1901
- var entered = enteredRef.current;
1902
- if (onEnter !== null && intersecting && !entered) {
1903
- onEnter();
1904
- }
1905
- if (onLeave !== null && !intersecting && entered) {
1906
- onLeave();
1907
- }
1908
- if (onChange !== null) {
1909
- onChange(intersecting);
1910
- }
1911
- if (intersecting && !entered) {
1912
- enteredRef.current = true;
1913
- } else if (!intersecting && entered) {
1914
- enteredRef.current = false;
1915
- }
1916
- };
1917
- return throttleDelay !== null ? throttle(callback, throttleDelay, {
1918
- trailing: true,
1919
- leading: true
1920
- }) : callback;
1921
- }, [throttleDelay, onEnter, onLeave, onChange]);
1922
- React.useEffect(function () {
1923
- if (disabled) {
1924
- return function () {};
1925
- }
1926
- triggerChange(isIntersecting);
1927
- return function () {
1928
- if (throttleDelay !== null) {
1929
- triggerChange.cancel();
1930
- }
1931
- };
1932
- }, [throttleDelay, isIntersecting, disabled, triggerChange]);
1933
- return /*#__PURE__*/jsxRuntime.jsx("div", {
1934
- className: className,
1935
- ref: ref,
1936
- children: children
1937
- });
1938
- }
1939
-
1940
- var styles$h = {"container":"micromag-core-partials-placeholder-block-container","outline":"micromag-core-partials-placeholder-block-outline","withInvertedColors":"micromag-core-partials-placeholder-block-withInvertedColors","box":"micromag-core-partials-placeholder-block-box"};
1941
-
1942
- function PlaceholderBlock(_ref) {
1943
- var _ref$width = _ref.width,
1944
- width = _ref$width === void 0 ? '100%' : _ref$width,
1945
- _ref$height = _ref.height,
1946
- height = _ref$height === void 0 ? '3em' : _ref$height,
1947
- _ref$outline = _ref.outline,
1948
- outline = _ref$outline === void 0 ? false : _ref$outline,
1949
- _ref$className = _ref.className,
1950
- className = _ref$className === void 0 ? null : _ref$className,
1951
- _ref$boxClassName = _ref.boxClassName,
1952
- boxClassName = _ref$boxClassName === void 0 ? null : _ref$boxClassName,
1953
- _ref$withInvertedColo = _ref.withInvertedColors,
1954
- withInvertedColors = _ref$withInvertedColo === void 0 ? true : _ref$withInvertedColo,
1955
- _ref$children = _ref.children,
1956
- children = _ref$children === void 0 ? null : _ref$children;
1957
- return /*#__PURE__*/jsxRuntime.jsx("div", {
1958
- className: classNames([styles$h.container, className, _defineProperty(_defineProperty({}, styles$h.outline, outline), styles$h.withInvertedColors, withInvertedColors)]),
1959
- children: /*#__PURE__*/jsxRuntime.jsx("div", {
1960
- className: classNames([styles$h.box, boxClassName]),
1961
- style: {
1962
- width: width,
1963
- height: height
1964
- },
1965
- children: children
1966
- })
1967
- });
1968
- }
1969
-
1970
- var emptyObject = {};
1971
- function ElementComponent(_ref) {
1972
- var name = _ref.name,
1973
- components = _ref.components,
1974
- _ref$props = _ref.props,
1975
- props = _ref$props === void 0 ? emptyObject : _ref$props,
1976
- _ref$isPlaceholder = _ref.isPlaceholder,
1977
- isPlaceholder = _ref$isPlaceholder === void 0 ? false : _ref$isPlaceholder,
1978
- _ref$className = _ref.className,
1979
- className = _ref$className === void 0 ? null : _ref$className,
1980
- _ref$placeholderProps = _ref.placeholderProps,
1981
- placeholderProps = _ref$placeholderProps === void 0 ? null : _ref$placeholderProps;
1982
- if (!name) {
1983
- return 'Bad component name';
1984
- }
1985
- if (isPlaceholder) {
1986
- // TODO: figure out what this did
1987
- // const PlaceholderComponent = Placeholders[pascalCase(name)];
1988
- return /*#__PURE__*/jsxRuntime.jsx(PlaceholderBlock, _objectSpread({}, placeholderProps));
1989
- }
1990
- var RealComponent = components[utils.pascalCase(name)];
1991
- if (!RealComponent) {
1992
- return 'Bad component';
1993
- }
1994
- return /*#__PURE__*/jsxRuntime.jsx(RealComponent, _objectSpread(_objectSpread({}, props), {}, {
1995
- className: className
1996
- }));
1997
- }
1998
-
1999
- var styles$g = {"container":"micromag-core-partials-empty-container","middle":"micromag-core-partials-empty-middle","withoutBorder":"micromag-core-partials-empty-withoutBorder"};
2000
-
2001
- function Empty(_ref) {
2002
- var _ref$children = _ref.children,
2003
- children = _ref$children === void 0 ? null : _ref$children,
2004
- _ref$withoutBorder = _ref.withoutBorder,
2005
- withoutBorder = _ref$withoutBorder === void 0 ? false : _ref$withoutBorder,
2006
- _ref$light = _ref.light,
2007
- light = _ref$light === void 0 ? false : _ref$light,
2008
- _ref$className = _ref.className,
2009
- className = _ref$className === void 0 ? null : _ref$className;
2010
- return /*#__PURE__*/jsxRuntime.jsx("div", {
2011
- className: classNames([styles$g.container, className, _defineProperty(_defineProperty({}, styles$g.withoutBorder, withoutBorder), styles$g.light, light)]),
2012
- children: /*#__PURE__*/jsxRuntime.jsx("div", {
2013
- className: styles$g.middle,
2014
- children: /*#__PURE__*/jsxRuntime.jsx(Label, {
2015
- children: children
2016
- })
2017
- })
2018
- });
2019
- }
2020
-
2021
- var emptyArray$1 = [];
2022
- var defaultFormats = ['eot', 'woff2', 'woff', {
2023
- name: 'otf',
2024
- format: 'opentype'
2025
- }, {
2026
- name: 'ttf',
2027
- format: 'truetype'
2028
- }, 'svg'];
2029
- var getUrlsFromMedia = function getUrlsFromMedia(media, formats) {
2030
- var _ref = media || {},
2031
- _ref$files = _ref.files,
2032
- files = _ref$files === void 0 ? {} : _ref$files;
2033
- var _ref2 = files || {},
2034
- _ref2$original = _ref2.original,
2035
- originalFile = _ref2$original === void 0 ? null : _ref2$original;
2036
- var _ref3 = originalFile || {},
2037
- _ref3$name = _ref3.name,
2038
- originalName = _ref3$name === void 0 ? null : _ref3$name,
2039
- _ref3$mime = _ref3.mime,
2040
- originalMime = _ref3$mime === void 0 ? null : _ref3$mime;
2041
- var urls = formats.reduce(function (currentUrls, format) {
2042
- var finalFormat = isObject(format) ? format.format : format;
2043
- var formatExtension = isObject(format) ? format.name : format;
2044
- var file = files["webfonts.".concat(formatExtension)] || files[formatExtension] || null;
2045
- if (file !== null) {
2046
- return [].concat(_toConsumableArray(currentUrls), ["url(\"".concat(file.url, "?\") format(\"").concat(finalFormat, "\")")]);
2047
- }
2048
- var extensionRegExp = new RegExp(".".concat(formatExtension, "$"), 'i');
2049
- var mimeRegExp = new RegExp("".concat(finalFormat), 'i');
2050
- if (originalName !== null && originalName.match(extensionRegExp) !== null || originalMime !== null && originalMime.match(mimeRegExp) !== null) {
2051
- return [].concat(_toConsumableArray(currentUrls), ["url(\"".concat(originalFile.url, "?\") format(\"").concat(finalFormat, "\")")]);
2052
- }
2053
- return currentUrls;
2054
- }, []);
2055
- return urls;
2056
- };
2057
- function FontFaces(_ref4) {
2058
- var _ref4$fonts = _ref4.fonts,
2059
- fonts = _ref4$fonts === void 0 ? emptyArray$1 : _ref4$fonts,
2060
- _ref4$formats = _ref4.formats,
2061
- formats = _ref4$formats === void 0 ? defaultFormats : _ref4$formats;
2062
- var fontFaces = (fonts || []).filter(function (it) {
2063
- return isObject(it) && it.type === 'custom' && (it.media || null) !== null;
2064
- }).reduce(function (fontFontFaces, _ref5) {
2065
- var _ref5$name = _ref5.name,
2066
- name = _ref5$name === void 0 ? null : _ref5$name,
2067
- _ref5$media = _ref5.media,
2068
- media = _ref5$media === void 0 ? null : _ref5$media,
2069
- _ref5$variants = _ref5.variants,
2070
- variants = _ref5$variants === void 0 ? [] : _ref5$variants;
2071
- if (name === null) {
2072
- return fontFontFaces;
2073
- }
2074
- var urls = media !== null ? getUrlsFromMedia(media, formats) : null;
2075
- var fontKey = name.toLowerCase();
2076
- return _objectSpread(_objectSpread({}, fontFontFaces), {}, _defineProperty({}, fontKey, urls !== null && urls.length > 0 ? "\n @font-face {\n font-family: \"".concat(name, "\";\n src: ").concat(urls.join(','), ";\n }\n ") : null), variants.reduce(function (variantFontFaces, _ref6) {
2077
- var weight = _ref6.weight,
2078
- style = _ref6.style,
2079
- _ref6$media = _ref6.media,
2080
- variantMedia = _ref6$media === void 0 ? null : _ref6$media;
2081
- if (variantMedia == null) {
2082
- return variantFontFaces;
2083
- }
2084
- var variantUrls = getUrlsFromMedia(variantMedia, formats);
2085
- var variantKey = "".concat(fontKey, "-").concat(weight !== null ? weight : 'normal', "-").concat(style !== null ? style : 'normal');
2086
- return _objectSpread(_objectSpread({}, variantFontFaces), {}, _defineProperty({}, variantKey, variantUrls !== null && variantUrls.length > 0 ? "\n @font-face {\n font-family: \"".concat(name, "\";\n ").concat(weight !== null ? "font-weight: ".concat(weight, ";") : '', "\n ").concat(style !== null ? "font-style: ".concat(style, ";") : '', "\n src: ").concat(variantUrls.join(','), ";\n }\n ") : null));
2087
- }, {}));
2088
-
2089
- // return [
2090
- // ...fontFontFaces,
2091
- // urls !== null && urls.length > 0
2092
- // ? `
2093
- // @font-face {
2094
- // font-family: "${name}";
2095
- // src: ${urls.join(',')};
2096
- // }
2097
- // `
2098
- // : null,
2099
- // ...(variants || []).map(({ weight, style, media: variantMedia = null }) => {
2100
- // if (variantMedia == null) {
2101
- // return null;
2102
- // }
2103
- // const variantUrls = getUrlsFromMedia(variantMedia, formats);
2104
- // return variantUrls !== null && variantUrls.length > 0
2105
- // ? `
2106
- // @font-face {
2107
- // font-family: "${name}";
2108
- // ${weight !== null ? `font-weight: ${weight};` : ''}
2109
- // ${style !== null ? `font-style: ${style};` : ''}
2110
- // src: ${variantUrls.join(',')};
2111
- // }
2112
- // `
2113
- // : null;
2114
- // }),
2115
- // ];
2116
- }, {});
2117
- return Object.keys(fontFaces).length > 0 ? /*#__PURE__*/jsxRuntime.jsx("style", {
2118
- type: "text/css",
2119
- dangerouslySetInnerHTML: {
2120
- __html: Object.keys(fontFaces).map(function (it) {
2121
- return fontFaces[it];
2122
- }).filter(function (it) {
2123
- return it !== null;
2124
- }).join('\n')
2125
- }
2126
- }) : null;
2127
- }
2128
-
2129
- var styles$f = {"container":"micromag-core-partials-media-container"};
2130
-
2131
- /* eslint-disable react/jsx-props-no-spreading */
2132
- function Media(_ref) {
2133
- var _ref$thumbnail = _ref.thumbnail,
2134
- thumbnail = _ref$thumbnail === void 0 ? null : _ref$thumbnail,
2135
- _ref$thumbnailAlign = _ref.thumbnailAlign,
2136
- thumbnailAlign = _ref$thumbnailAlign === void 0 ? 'top' : _ref$thumbnailAlign,
2137
- _ref$children = _ref.children,
2138
- children = _ref$children === void 0 ? null : _ref$children,
2139
- _ref$title = _ref.title,
2140
- title = _ref$title === void 0 ? null : _ref$title,
2141
- _ref$className = _ref.className,
2142
- className = _ref$className === void 0 ? null : _ref$className,
2143
- _ref$thumbnailClassNa = _ref.thumbnailClassName,
2144
- thumbnailClassName = _ref$thumbnailClassNa === void 0 ? null : _ref$thumbnailClassNa,
2145
- _ref$bodyClassName = _ref.bodyClassName,
2146
- bodyClassName = _ref$bodyClassName === void 0 ? null : _ref$bodyClassName,
2147
- _ref$titleClassName = _ref.titleClassName,
2148
- titleClassName = _ref$titleClassName === void 0 ? null : _ref$titleClassName;
2149
- return /*#__PURE__*/jsxRuntime.jsxs("div", {
2150
- className: classNames(['card', styles$f.container, className]),
2151
- children: [typeof thumbnail === 'string' ? /*#__PURE__*/jsxRuntime.jsx("img", {
2152
- src: thumbnail,
2153
- alt: title,
2154
- className: classNames(['me-3', styles$f.thumbnail, thumbnailClassName, {
2155
- 'align-self-start': thumbnailAlign === 'top',
2156
- 'align-self-center': thumbnailAlign === 'center',
2157
- 'align-self-end': thumbnailAlign === 'bottom'
2158
- }])
2159
- }) : thumbnail, title !== null || children !== null ? /*#__PURE__*/jsxRuntime.jsxs("div", {
2160
- className: classNames(['card-body', styles$f.body, bodyClassName]),
2161
- children: [title !== null ? /*#__PURE__*/jsxRuntime.jsx("h5", {
2162
- className: classNames(['mt-0', 'text-truncate', styles$f.title, titleClassName]),
2163
- children: /*#__PURE__*/jsxRuntime.jsx(Label, {
2164
- children: title
2165
- })
2166
- }) : null, children]
2167
- }) : null]
2168
- });
2169
- }
2170
-
2171
- /* eslint-disable react/no-array-index-key */
2172
- function Meta(_ref) {
2173
- var _ref$title = _ref.title,
2174
- title = _ref$title === void 0 ? null : _ref$title,
2175
- _ref$url = _ref.url,
2176
- url = _ref$url === void 0 ? null : _ref$url,
2177
- _ref$metadata = _ref.metadata,
2178
- metadata = _ref$metadata === void 0 ? null : _ref$metadata,
2179
- _ref$fullTitle = _ref.fullTitle,
2180
- fullTitle = _ref$fullTitle === void 0 ? null : _ref$fullTitle,
2181
- _ref$suffix = _ref.suffix,
2182
- suffix = _ref$suffix === void 0 ? 'Micromag' : _ref$suffix,
2183
- _ref$children = _ref.children,
2184
- children = _ref$children === void 0 ? null : _ref$children;
2185
- var _ref2 = metadata || {},
2186
- _ref2$canonical = _ref2.canonical,
2187
- canonical = _ref2$canonical === void 0 ? null : _ref2$canonical,
2188
- _ref2$description = _ref2.description,
2189
- description = _ref2$description === void 0 ? null : _ref2$description,
2190
- _ref2$keywords = _ref2.keywords,
2191
- keywords = _ref2$keywords === void 0 ? null : _ref2$keywords,
2192
- _ref2$image = _ref2.image,
2193
- image = _ref2$image === void 0 ? null : _ref2$image,
2194
- _ref2$favicon = _ref2.favicon,
2195
- favicon = _ref2$favicon === void 0 ? null : _ref2$favicon,
2196
- _ref2$rssUrl = _ref2.rssUrl,
2197
- rssUrl = _ref2$rssUrl === void 0 ? null : _ref2$rssUrl,
2198
- _ref2$atomUrl = _ref2.atomUrl,
2199
- atomUrl = _ref2$atomUrl === void 0 ? null : _ref2$atomUrl,
2200
- _ref2$microformats = _ref2.microformats,
2201
- microformats = _ref2$microformats === void 0 ? null : _ref2$microformats,
2202
- _ref2$language = _ref2.language,
2203
- language = _ref2$language === void 0 ? null : _ref2$language;
2204
- var realTitle = title !== null ? "".concat(title, " | ").concat(suffix) : fullTitle;
2205
- var _ref3 = image || {},
2206
- _ref3$url = _ref3.url,
2207
- imageUrl = _ref3$url === void 0 ? null : _ref3$url,
2208
- _ref3$metadata = _ref3.metadata,
2209
- imageMetadata = _ref3$metadata === void 0 ? null : _ref3$metadata;
2210
- var _ref4 = imageMetadata || {},
2211
- _ref4$width = _ref4.width,
2212
- imageWidth = _ref4$width === void 0 ? null : _ref4$width,
2213
- _ref4$height = _ref4.height,
2214
- imageHeight = _ref4$height === void 0 ? null : _ref4$height;
2215
- var _ref5 = favicon || {},
2216
- _ref5$url = _ref5.url,
2217
- faviconUrl = _ref5$url === void 0 ? null : _ref5$url;
2218
- return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
2219
- children: [/*#__PURE__*/jsxRuntime.jsx("title", {
2220
- children: realTitle !== null && realTitle.length > 0 ? realTitle : 'Micromag'
2221
- }), description !== null ? /*#__PURE__*/jsxRuntime.jsx("meta", {
2222
- name: "description",
2223
- content: description
2224
- }) : null, language !== null ? /*#__PURE__*/jsxRuntime.jsx("meta", {
2225
- name: "language",
2226
- content: language
2227
- }) : null, keywords !== null && isString(keywords) ? /*#__PURE__*/jsxRuntime.jsx("meta", {
2228
- name: "keywords",
2229
- content: keywords
2230
- }) : null, keywords !== null && isArray(keywords) ? /*#__PURE__*/jsxRuntime.jsx("meta", {
2231
- name: "keywords",
2232
- content: keywords.join(',')
2233
- }) : null, canonical !== null ? /*#__PURE__*/jsxRuntime.jsx("link", {
2234
- rel: "canonical",
2235
- href: canonical
2236
- }) : null, faviconUrl !== null ? /*#__PURE__*/jsxRuntime.jsx("link", {
2237
- rel: "icon",
2238
- type: "image/png",
2239
- href: faviconUrl
2240
- }) : null, rssUrl !== null ? /*#__PURE__*/jsxRuntime.jsx("link", {
2241
- rel: "alternate",
2242
- type: "application/rss+xml",
2243
- href: rssUrl
2244
- }) : null, atomUrl !== null ? /*#__PURE__*/jsxRuntime.jsx("link", {
2245
- rel: "alternate",
2246
- type: "application/atom+xml",
2247
- href: atomUrl
2248
- }) : null, imageUrl !== null ? /*#__PURE__*/jsxRuntime.jsx("meta", {
2249
- property: "og:image",
2250
- content: imageUrl
2251
- }) : null, imageUrl !== null ? /*#__PURE__*/jsxRuntime.jsx("meta", {
2252
- property: "og:image:url",
2253
- content: imageUrl
2254
- }) : null, imageWidth !== null ? /*#__PURE__*/jsxRuntime.jsx("meta", {
2255
- property: "og:image:width",
2256
- content: imageWidth
2257
- }) : null, imageHeight !== null ? /*#__PURE__*/jsxRuntime.jsx("meta", {
2258
- property: "og:image:height",
2259
- content: imageHeight
2260
- }) : null, realTitle !== null ? /*#__PURE__*/jsxRuntime.jsx("meta", {
2261
- property: "og:title",
2262
- content: realTitle
2263
- }) : null, description !== null ? /*#__PURE__*/jsxRuntime.jsx("meta", {
2264
- property: "og:description",
2265
- content: description
2266
- }) : null, url !== null ? /*#__PURE__*/jsxRuntime.jsx("meta", {
2267
- property: "og:url",
2268
- content: url
2269
- }) : null, /*#__PURE__*/jsxRuntime.jsx("meta", {
2270
- name: "twitter:card",
2271
- content: imageUrl !== null ? 'summary_large_image' : 'summary'
2272
- }), realTitle !== null ? /*#__PURE__*/jsxRuntime.jsx("meta", {
2273
- name: "twitter:title",
2274
- content: realTitle
2275
- }) : null, description !== null ? /*#__PURE__*/jsxRuntime.jsx("meta", {
2276
- name: "twitter:description",
2277
- content: description
2278
- }) : null, imageUrl !== null ? /*#__PURE__*/jsxRuntime.jsx("meta", {
2279
- name: "twitter:image",
2280
- content: imageUrl
2281
- }) : null, (microformats || []).map(function (it) {
2282
- return /*#__PURE__*/jsxRuntime.jsx("script", {
2283
- type: "application/ld+json",
2284
- id: "".concat(it["@type"], "-").concat(it.identifier),
2285
- async: true,
2286
- children: JSON.stringify(it)
2287
- }, "microformat-".concat(it["@type"], "-").concat(it.identifier));
2288
- }), children]
2289
- });
2290
- }
2291
-
2292
- var styles$e = {"container":"micromag-core-partials-slideshow-container","items":"micromag-core-partials-slideshow-items","item":"micromag-core-partials-slideshow-item","prev":"micromag-core-partials-slideshow-prev","current":"micromag-core-partials-slideshow-current","next":"micromag-core-partials-slideshow-next"};
2293
-
2294
- var emptyArray = [];
2295
- function Slideshow(_ref) {
2296
- var _ref$items = _ref.items,
2297
- items = _ref$items === void 0 ? emptyArray : _ref$items,
2298
- _ref$auto = _ref.auto,
2299
- auto = _ref$auto === void 0 ? true : _ref$auto,
2300
- _ref$delay = _ref.delay,
2301
- delay = _ref$delay === void 0 ? 5000 : _ref$delay,
2302
- _ref$width = _ref.width,
2303
- width = _ref$width === void 0 ? null : _ref$width,
2304
- _ref$height = _ref.height,
2305
- height = _ref$height === void 0 ? null : _ref$height,
2306
- _ref$className = _ref.className,
2307
- className = _ref$className === void 0 ? null : _ref$className,
2308
- _ref$children = _ref.children,
2309
- children = _ref$children === void 0 ? null : _ref$children;
2310
- var _useState = React.useState(0),
2311
- _useState2 = _slicedToArray(_useState, 2),
2312
- index = _useState2[0],
2313
- setIndex = _useState2[1];
2314
- React.useEffect(function () {
2315
- var id = null;
2316
- if (auto) {
2317
- id = setTimeout(function () {
2318
- if (index < items.length - 1) {
2319
- setIndex(function (i) {
2320
- return i + 1;
2321
- });
2322
- } else {
2323
- setIndex(0);
2324
- }
2325
- }, delay);
2326
- }
2327
- return function () {
2328
- clearTimeout(id);
2329
- };
2330
- }, [index, items, auto, delay]);
2331
- var style = {
2332
- width: width,
2333
- height: height
2334
- };
2335
- return /*#__PURE__*/jsxRuntime.jsxs("div", {
2336
- className: classNames([styles$e.container, className]),
2337
- style: style,
2338
- children: [/*#__PURE__*/jsxRuntime.jsx("div", {
2339
- className: styles$e.items,
2340
- children: items.map(function (it, i) {
2341
- return /*#__PURE__*/jsxRuntime.jsx("div", {
2342
- className: classNames([styles$e.item, _defineProperty(_defineProperty(_defineProperty({}, styles$e.prev, i < index), styles$e.current, i === index), styles$e.next, i > index)]),
2343
- children: it
2344
- }, "slide-".concat(i + 1));
2345
- })
2346
- }), children]
2347
- });
2348
- }
2349
-
2350
- var styles$d = {"icon":"micromag-core-placeholders-icon"};
2351
-
2352
- /* eslint-disable react/prop-types */
2353
- function AdFrame(_ref) {
2354
- var width = _ref.width,
2355
- height = _ref.height,
2356
- className = _ref.className;
2357
- return /*#__PURE__*/jsxRuntime.jsx(PlaceholderBlock, {
2358
- width: width,
2359
- height: height,
2360
- className: className,
2361
- children: /*#__PURE__*/jsxRuntime.jsx(reactFontawesome.FontAwesomeIcon, {
2362
- icon: faAd.faAd,
2363
- className: styles$d.icon
2364
- })
2365
- });
2366
- }
2367
-
2368
- /* eslint-disable react/prop-types */
2369
- function AdImage(_ref) {
2370
- var width = _ref.width,
2371
- height = _ref.height,
2372
- className = _ref.className;
2373
- return /*#__PURE__*/jsxRuntime.jsx(PlaceholderBlock, {
2374
- width: width,
2375
- height: height,
2376
- className: className,
2377
- children: /*#__PURE__*/jsxRuntime.jsx(reactFontawesome.FontAwesomeIcon, {
2378
- icon: faImage.faImage,
2379
- className: styles$d.icon
2380
- })
2381
- });
2382
- }
2383
-
2384
- /* eslint-disable react/destructuring-assignment, react/prop-types */
2385
- function Audio(_ref) {
2386
- var _ref$width = _ref.width,
2387
- width = _ref$width === void 0 ? '100%' : _ref$width,
2388
- _ref$height = _ref.height,
2389
- height = _ref$height === void 0 ? '2em' : _ref$height,
2390
- className = _ref.className;
2391
- return /*#__PURE__*/jsxRuntime.jsx(PlaceholderBlock, {
2392
- width: width,
2393
- height: height,
2394
- className: className,
2395
- children: /*#__PURE__*/jsxRuntime.jsx(reactFontawesome.FontAwesomeIcon, {
2396
- icon: faMusic.faMusic,
2397
- className: styles$d.icon
2398
- })
2399
- });
2400
- }
2401
-
2402
- var styles$c = {"container":"micromag-core-partials-placeholder-text-container","withInvertedColors":"micromag-core-partials-placeholder-text-withInvertedColors","line":"micromag-core-partials-placeholder-text-line"};
2403
-
2404
- function PlaceholderText(_ref) {
2405
- var _ref$lines = _ref.lines,
2406
- lines = _ref$lines === void 0 ? 1 : _ref$lines,
2407
- _ref$lineMargin = _ref.lineMargin,
2408
- lineMargin = _ref$lineMargin === void 0 ? 1 : _ref$lineMargin,
2409
- _ref$width = _ref.width,
2410
- width = _ref$width === void 0 ? '100%' : _ref$width,
2411
- _ref$height = _ref.height,
2412
- height = _ref$height === void 0 ? null : _ref$height,
2413
- _ref$fontSize = _ref.fontSize,
2414
- fontSize = _ref$fontSize === void 0 ? 16 : _ref$fontSize,
2415
- _ref$className = _ref.className,
2416
- className = _ref$className === void 0 ? null : _ref$className,
2417
- _ref$withInvertedColo = _ref.withInvertedColors,
2418
- withInvertedColors = _ref$withInvertedColo === void 0 ? true : _ref$withInvertedColo;
2419
- var lineHeight = height !== null && isNumber(height) ? "".concat(Math.round(height * fontSize), "px") : height;
2420
- var oddWidth = isNumber(width) ? width * 0.9 : '80%';
2421
- return /*#__PURE__*/jsxRuntime.jsx("div", {
2422
- className: classNames([styles$c.container, className, _defineProperty({}, styles$c.withInvertedColors, withInvertedColors)]),
2423
- children: _toConsumableArray(Array(lines)).map(function (e, index) {
2424
- return /*#__PURE__*/jsxRuntime.jsx("div", {
2425
- className: styles$c.line,
2426
- style: {
2427
- width: index % 2 === 0 ? width : oddWidth,
2428
- height: lineHeight,
2429
- marginTop: lineMargin,
2430
- marginBottom: lineMargin
2431
- }
2432
- }, "line-".concat(index));
2433
- })
2434
- });
2435
- }
2436
-
2437
- /* eslint-disable react/destructuring-assignment, react/prop-types */
2438
- function Button(_ref) {
2439
- var _ref$width = _ref.width,
2440
- width = _ref$width === void 0 ? '75%' : _ref$width,
2441
- _ref$height = _ref.height,
2442
- height = _ref$height === void 0 ? '0.4em' : _ref$height,
2443
- className = _ref.className;
2444
- return /*#__PURE__*/jsxRuntime.jsx(PlaceholderBlock, {
2445
- outline: true,
2446
- width: width,
2447
- height: height,
2448
- className: className,
2449
- children: /*#__PURE__*/jsxRuntime.jsx(PlaceholderText, {
2450
- line: 1,
2451
- height: "0.1em"
2452
- })
2453
- });
2454
- }
2455
-
2456
- var _excluded$2 = ["width", "height", "className"];
2457
- function Image(_ref) {
2458
- var width = _ref.width,
2459
- height = _ref.height,
2460
- className = _ref.className,
2461
- props = _objectWithoutProperties(_ref, _excluded$2);
2462
- return /*#__PURE__*/jsxRuntime.jsx(PlaceholderBlock, _objectSpread(_objectSpread({}, props), {}, {
2463
- width: width,
2464
- height: height,
2465
- className: className,
2466
- children: /*#__PURE__*/jsxRuntime.jsx(reactFontawesome.FontAwesomeIcon, {
2467
- icon: faImage.faImage,
2468
- className: styles$d.icon
2469
- })
2470
- }));
2471
- }
2472
-
2473
- function Line(props) {
2474
- return /*#__PURE__*/jsxRuntime.jsx(PlaceholderText, _objectSpread(_objectSpread({}, props), {}, {
2475
- className: classNames([props.className, styles$d.shortText]),
2476
- height: 0.2,
2477
- lines: 1
2478
- }));
2479
- }
2480
-
2481
- var styles$b = {"container":"micromag-core-placeholders-map-container","icon":"micromag-core-placeholders-map-icon"};
2482
-
2483
- function Map(props) {
2484
- return /*#__PURE__*/jsxRuntime.jsxs(PlaceholderBlock, _objectSpread(_objectSpread({}, props), {}, {
2485
- width: "100%",
2486
- height: "100%",
2487
- className: classNames([styles$b.container, _defineProperty({}, props.className, props.className !== null)]),
2488
- children: [/*#__PURE__*/jsxRuntime.jsx(reactFontawesome.FontAwesomeIcon, {
2489
- icon: props.withImages ? faImage.faImage : faMapMarkerAlt.faMapMarkerAlt,
2490
- className: styles$b.icon
2491
- }), /*#__PURE__*/jsxRuntime.jsx(reactFontawesome.FontAwesomeIcon, {
2492
- icon: props.withImages ? faImage.faImage : faMapMarkerAlt.faMapMarkerAlt,
2493
- className: styles$b.icon
2494
- }), /*#__PURE__*/jsxRuntime.jsx(reactFontawesome.FontAwesomeIcon, {
2495
- icon: props.withImages ? faImage.faImage : faMapMarkerAlt.faMapMarkerAlt,
2496
- className: styles$b.icon
2497
- }), /*#__PURE__*/jsxRuntime.jsx(reactFontawesome.FontAwesomeIcon, {
2498
- icon: props.withImages ? faImage.faImage : faMapMarkerAlt.faMapMarkerAlt,
2499
- className: styles$b.icon
2500
- })]
2501
- }));
2502
- }
2503
-
2504
- function MapPath(props) {
2505
- return /*#__PURE__*/jsxRuntime.jsx(PlaceholderBlock, _objectSpread(_objectSpread({}, props), {}, {
2506
- width: "100%",
2507
- height: "70%",
2508
- className: classNames([props.className, styles$d.mapPath]),
2509
- children: /*#__PURE__*/jsxRuntime.jsx(reactFontawesome.FontAwesomeIcon, {
2510
- icon: faMapMarkedAlt.faMapMarkedAlt,
2511
- size: "lg",
2512
- className: styles$d.icon
2513
- })
2514
- }));
2515
- }
2516
-
2517
- function Quote(props) {
2518
- return /*#__PURE__*/jsxRuntime.jsx(PlaceholderText, _objectSpread(_objectSpread({}, props), {}, {
2519
- className: classNames([props.className, styles$d.subtitle]),
2520
- height: 0.5,
2521
- lines: 6
2522
- }));
2523
- }
2524
-
2525
- function ShortText(props) {
2526
- return /*#__PURE__*/jsxRuntime.jsx(PlaceholderText, _objectSpread(_objectSpread({}, props), {}, {
2527
- className: classNames([props.className, styles$d.shortText]),
2528
- height: 0.2,
2529
- lines: 2
2530
- }));
2531
- }
2532
-
2533
- function Subtitle(props) {
2534
- return /*#__PURE__*/jsxRuntime.jsx(PlaceholderText, _objectSpread(_objectSpread({}, props), {}, {
2535
- className: classNames([props.className, styles$d.subtitle]),
2536
- height: 0.3,
2537
- lines: 1
2538
- }));
2539
- }
2540
-
2541
- function TextPlaceholder(props) {
2542
- var _props$className = props.className,
2543
- className = _props$className === void 0 ? null : _props$className,
2544
- _props$height = props.height,
2545
- height = _props$height === void 0 ? 0.2 : _props$height,
2546
- _props$lines = props.lines,
2547
- lines = _props$lines === void 0 ? 4 : _props$lines,
2548
- _props$lineMargin = props.lineMargin,
2549
- lineMargin = _props$lineMargin === void 0 ? 2 : _props$lineMargin;
2550
- return /*#__PURE__*/jsxRuntime.jsx(PlaceholderText, _objectSpread(_objectSpread({}, props), {}, {
2551
- height: height,
2552
- lines: lines,
2553
- lineMargin: lineMargin,
2554
- className: classNames([className, styles$d.text])
2555
- }));
2556
- }
2557
-
2558
- function Timeline(props) {
2559
- return /*#__PURE__*/jsxRuntime.jsx(PlaceholderText, _objectSpread(_objectSpread({}, props), {}, {
2560
- className: classNames([props.className, styles$d.timeline])
2561
- }));
2562
- }
2563
-
2564
- function Title$1(props) {
2565
- var _props$height = props.height,
2566
- height = _props$height === void 0 ? 0.5 : _props$height,
2567
- _props$lines = props.lines,
2568
- lines = _props$lines === void 0 ? 2 : _props$lines,
2569
- _props$lineMargin = props.lineMargin,
2570
- lineMargin = _props$lineMargin === void 0 ? 2 : _props$lineMargin;
2571
- return /*#__PURE__*/jsxRuntime.jsx(PlaceholderText, _objectSpread(_objectSpread({}, props), {}, {
2572
- className: classNames([props.className, styles$d.title]),
2573
- height: height,
2574
- lines: lines,
2575
- lineMargin: lineMargin
2576
- }));
2577
- }
2578
-
2579
- /* eslint-disable react/prop-types */
2580
- function Video(_ref) {
2581
- var width = _ref.width,
2582
- height = _ref.height,
2583
- className = _ref.className;
2584
- return /*#__PURE__*/jsxRuntime.jsx(PlaceholderBlock, {
2585
- width: width,
2586
- height: height,
2587
- className: className,
2588
- children: /*#__PURE__*/jsxRuntime.jsx(reactFontawesome.FontAwesomeIcon, {
2589
- icon: faVideo.faVideo,
2590
- className: styles$d.icon
2591
- })
2592
- });
2593
- }
2594
-
2595
- var styles$a = {"container":"micromag-core-placeholders-video-360-container","box":"micromag-core-placeholders-video-360-box","icon":"micromag-core-placeholders-video-360-icon","label":"micromag-core-placeholders-video-360-label"};
2596
-
2597
- /* eslint-disable react/prop-types */
2598
- function Video360(_ref) {
2599
- var width = _ref.width,
2600
- height = _ref.height,
2601
- className = _ref.className;
2602
- return /*#__PURE__*/jsxRuntime.jsxs(PlaceholderBlock, {
2603
- width: width,
2604
- height: height,
2605
- className: classNames([styles$a.container, className]),
2606
- boxClassName: styles$a.box,
2607
- children: [/*#__PURE__*/jsxRuntime.jsx(reactFontawesome.FontAwesomeIcon, {
2608
- icon: faVideo.faVideo,
2609
- className: styles$a.icon
2610
- }), /*#__PURE__*/jsxRuntime.jsx("div", {
2611
- className: styles$a.label,
2612
- children: "360"
2613
- })]
2614
- });
2615
- }
2616
-
2617
- /* eslint-disable react/prop-types */
2618
- function VideoLoop(_ref) {
2619
- var width = _ref.width,
2620
- height = _ref.height,
2621
- className = _ref.className;
2622
- return /*#__PURE__*/jsxRuntime.jsxs(PlaceholderBlock, {
2623
- width: width,
2624
- height: height,
2625
- className: className,
2626
- children: [/*#__PURE__*/jsxRuntime.jsx(reactFontawesome.FontAwesomeIcon, {
2627
- icon: faPlay.faPlay,
2628
- className: styles$d.icon
2629
- }), /*#__PURE__*/jsxRuntime.jsx(reactFontawesome.FontAwesomeIcon, {
2630
- icon: faRedo.faRedo,
2631
- className: styles$d.icon
2632
- })]
2633
- });
2634
- }
2635
-
2636
- var styles$9 = {"container":"micromag-core-screens-screen-sizer-container","frame":"micromag-core-screens-screen-sizer-frame","screen":"micromag-core-screens-screen-sizer-screen"};
2637
-
2638
- /* eslint-disable react/jsx-props-no-spreading */
2639
- function ScreenSizer(_ref) {
2640
- var _ref$width = _ref.width,
2641
- width = _ref$width === void 0 ? null : _ref$width,
2642
- _ref$height = _ref.height,
2643
- height = _ref$height === void 0 ? null : _ref$height,
2644
- _ref$fit = _ref.fit,
2645
- fit = _ref$fit === void 0 ? null : _ref$fit,
2646
- _ref$screenWidth = _ref.screenWidth,
2647
- screenWidth = _ref$screenWidth === void 0 ? 320 : _ref$screenWidth,
2648
- _ref$screenHeight = _ref.screenHeight,
2649
- screenHeight = _ref$screenHeight === void 0 ? 480 : _ref$screenHeight,
2650
- _ref$className = _ref.className,
2651
- className = _ref$className === void 0 ? null : _ref$className,
2652
- children = _ref.children;
2653
- var hasSize = width !== null || height !== null;
2654
- //
2655
- var _useDimensionObserver = hooks.useDimensionObserver(),
2656
- refContainer = _useDimensionObserver.ref,
2657
- _useDimensionObserver2 = _useDimensionObserver.width,
2658
- calculatedWidth = _useDimensionObserver2 === void 0 ? 0 : _useDimensionObserver2,
2659
- _useDimensionObserver3 = _useDimensionObserver.height,
2660
- calculatedHeight = _useDimensionObserver3 === void 0 ? 0 : _useDimensionObserver3;
2661
- var _useMemo = React.useMemo(function () {
2662
- var containerWidth = width || calculatedWidth || null;
2663
- var containerHeight = height || calculatedHeight || null;
2664
- if (containerWidth === null && containerHeight === null) {
2665
- return {};
2666
- }
2667
- var screenRatio = screenWidth / screenHeight;
2668
- var finalContainerWidth = hasSize ? width || containerHeight * screenRatio : containerWidth;
2669
- var finalContainerHeight = hasSize ? height || containerWidth / screenRatio : containerWidth / screenRatio;
2670
- if (fit === null) {
2671
- var _screenScale = finalContainerWidth / screenWidth;
2672
- return {
2673
- width: finalContainerWidth,
2674
- height: finalContainerHeight,
2675
- scale: _screenScale,
2676
- transform: "scale(".concat(_screenScale, ")")
2677
- };
2678
- }
2679
- var _getSizeWithinBounds = size.getSizeWithinBounds(screenWidth, screenHeight, finalContainerWidth, finalContainerHeight, {
2680
- cover: fit === 'cover'
2681
- }),
2682
- screenScaledWidth = _getSizeWithinBounds.width,
2683
- screenScaledHeight = _getSizeWithinBounds.height,
2684
- screenScale = _getSizeWithinBounds.scale;
2685
- var x = (finalContainerWidth - screenScaledWidth) / 2;
2686
- var y = (finalContainerHeight - screenScaledHeight) / 2;
2687
- return {
2688
- width: finalContainerWidth,
2689
- height: finalContainerHeight,
2690
- scale: screenScale,
2691
- transform: "scale(".concat(screenScale, ") translate(").concat(x, "px, ").concat(y, "px)")
2692
- };
2693
- }, [screenWidth, screenHeight, width, height, fit, calculatedWidth, calculatedHeight, hasSize]),
2694
- _useMemo$width = _useMemo.width,
2695
- frameWidth = _useMemo$width === void 0 ? null : _useMemo$width,
2696
- _useMemo$height = _useMemo.height,
2697
- frameHeight = _useMemo$height === void 0 ? null : _useMemo$height,
2698
- _useMemo$scale = _useMemo.scale,
2699
- frameScale = _useMemo$scale === void 0 ? null : _useMemo$scale,
2700
- _useMemo$transform = _useMemo.transform,
2701
- screenTransform = _useMemo$transform === void 0 ? null : _useMemo$transform;
2702
- var devicePixelRatio = hooks.useDevicePixelRatio();
2703
- var screenSize = React.useMemo(function () {
2704
- return {
2705
- screen: 'mobile',
2706
- screens: ['mobile'],
2707
- width: screenWidth,
2708
- height: screenHeight,
2709
- resolution: frameScale !== null ? frameScale * devicePixelRatio : devicePixelRatio
2710
- };
2711
- }, [screenWidth, screenHeight, frameScale]);
2712
- var hasFrameSize = frameWidth !== null && frameHeight !== null;
2713
- return /*#__PURE__*/jsxRuntime.jsx("div", {
2714
- className: classNames([styles$9.container, className]),
2715
- ref: !hasSize ? refContainer : null,
2716
- children: hasFrameSize ? /*#__PURE__*/jsxRuntime.jsx("div", {
2717
- className: styles$9.frame,
2718
- style: {
2719
- width: frameWidth,
2720
- height: frameHeight
2721
- },
2722
- children: /*#__PURE__*/jsxRuntime.jsx("div", {
2723
- className: styles$9.screen,
2724
- style: {
2725
- width: screenWidth,
2726
- height: screenHeight,
2727
- transform: screenTransform
2728
- },
2729
- children: /*#__PURE__*/jsxRuntime.jsx(contexts.ScreenSizeProvider, {
2730
- size: screenSize,
2731
- children: /*#__PURE__*/React.cloneElement(children, {
2732
- width: screenWidth,
2733
- height: screenHeight
2734
- })
2735
- })
2736
- })
2737
- }) : null
2738
- });
2739
- }
2740
-
2741
- var styles$8 = {"container":"micromag-core-screens-screen-container"};
2742
-
2743
- function Screen(_ref) {
2744
- var screen = _ref.screen,
2745
- _ref$renderContext = _ref.renderContext,
2746
- renderContext = _ref$renderContext === void 0 ? null : _ref$renderContext,
2747
- _ref$screenState = _ref.screenState,
2748
- screenState = _ref$screenState === void 0 ? null : _ref$screenState,
2749
- _ref$index = _ref.index,
2750
- index = _ref$index === void 0 ? null : _ref$index,
2751
- _ref$active = _ref.active,
2752
- active = _ref$active === void 0 ? true : _ref$active,
2753
- _ref$current = _ref.current,
2754
- current = _ref$current === void 0 ? false : _ref$current,
2755
- _ref$preload = _ref.preload,
2756
- preload = _ref$preload === void 0 ? true : _ref$preload,
2757
- _ref$components = _ref.components,
2758
- components = _ref$components === void 0 ? null : _ref$components,
2759
- _ref$component = _ref.component,
2760
- component = _ref$component === void 0 ? null : _ref$component,
2761
- _ref$className = _ref.className,
2762
- className = _ref$className === void 0 ? null : _ref$className,
2763
- _ref$mediaRef = _ref.mediaRef,
2764
- mediaRef = _ref$mediaRef === void 0 ? null : _ref$mediaRef;
2765
- var _ref2 = screen || {},
2766
- _ref2$type = _ref2.type,
2767
- type = _ref2$type === void 0 ? null : _ref2$type;
2768
- var CustomScreenComponent = components !== null ? utils.getComponentFromName(type, components) || null : null;
2769
- var ContextScreenComponent = contexts.useScreenComponent(type);
2770
- var ScreenComponent = CustomScreenComponent || ContextScreenComponent;
2771
- return /*#__PURE__*/jsxRuntime.jsx(contexts.ScreenProvider, {
2772
- data: screen,
2773
- renderContext: renderContext,
2774
- screenState: screenState,
2775
- children: ScreenComponent !== null ? /*#__PURE__*/jsxRuntime.jsx("div", {
2776
- className: classNames([styles$8.container, className]),
2777
- children: /*#__PURE__*/jsxRuntime.jsx(ScreenComponent, _objectSpread(_objectSpread({}, screen), {}, {
2778
- index: index,
2779
- active: active,
2780
- current: current,
2781
- preload: preload,
2782
- mediaRef: mediaRef
2783
- }))
2784
- }) : /*#__PURE__*/jsxRuntime.jsx("div", {
2785
- className: className,
2786
- children: component
2787
- })
2788
- });
2789
- }
2790
-
2791
- var styles$7 = {"screen":"micromag-core-screens-screen-placeholder-screen"};
2792
-
2793
- var _excluded$1 = ["screen", "layout", "screenWidth", "screenHeight", "screenState", "withSize", "className"];
2794
- function ScreenPlaceholder(_ref) {
2795
- var screen = _ref.screen,
2796
- _ref$layout = _ref.layout,
2797
- layout = _ref$layout === void 0 ? undefined : _ref$layout,
2798
- _ref$screenWidth = _ref.screenWidth,
2799
- screenWidth = _ref$screenWidth === void 0 ? 100 : _ref$screenWidth,
2800
- _ref$screenHeight = _ref.screenHeight,
2801
- screenHeight = _ref$screenHeight === void 0 ? 150 : _ref$screenHeight,
2802
- _ref$screenState = _ref.screenState,
2803
- screenState = _ref$screenState === void 0 ? null : _ref$screenState,
2804
- _ref$withSize = _ref.withSize,
2805
- withSize = _ref$withSize === void 0 ? false : _ref$withSize,
2806
- _ref$className = _ref.className,
2807
- className = _ref$className === void 0 ? null : _ref$className,
2808
- props = _objectWithoutProperties(_ref, _excluded$1);
2809
- var screenElement = /*#__PURE__*/jsxRuntime.jsx(Screen, _objectSpread({
2810
- screen: screen,
2811
- renderContext: "placeholder",
2812
- screenState: screenState,
2813
- layout: layout,
2814
- className: classNames([styles$7.screen, _defineProperty({}, className, !withSize)])
2815
- }, props));
2816
- return withSize ? /*#__PURE__*/jsxRuntime.jsx(ScreenSizer, {
2817
- className: className,
2818
- screenWidth: screenWidth,
2819
- screenHeight: screenHeight,
2820
- children: screenElement
2821
- }) : screenElement;
2822
- }
2823
-
2824
- var styles$6 = {"screen":"micromag-core-screens-preview-screen"};
2825
-
2826
- var _excluded = ["screen", "screenState", "width", "height", "screenWidth", "screenHeight", "className", "withSize", "fit", "hidden"];
2827
- function ScreenPreview(_ref) {
2828
- var screen = _ref.screen,
2829
- _ref$screenState = _ref.screenState,
2830
- screenState = _ref$screenState === void 0 ? null : _ref$screenState,
2831
- _ref$width = _ref.width,
2832
- width = _ref$width === void 0 ? undefined : _ref$width,
2833
- _ref$height = _ref.height,
2834
- height = _ref$height === void 0 ? undefined : _ref$height,
2835
- _ref$screenWidth = _ref.screenWidth,
2836
- screenWidth = _ref$screenWidth === void 0 ? undefined : _ref$screenWidth,
2837
- _ref$screenHeight = _ref.screenHeight,
2838
- screenHeight = _ref$screenHeight === void 0 ? undefined : _ref$screenHeight,
2839
- _ref$className = _ref.className,
2840
- className = _ref$className === void 0 ? null : _ref$className,
2841
- _ref$withSize = _ref.withSize,
2842
- withSize = _ref$withSize === void 0 ? false : _ref$withSize,
2843
- fit = _ref.fit,
2844
- _ref$hidden = _ref.hidden,
2845
- hidden = _ref$hidden === void 0 ? false : _ref$hidden,
2846
- props = _objectWithoutProperties(_ref, _excluded);
2847
- var screenElement = /*#__PURE__*/jsxRuntime.jsx(Screen, _objectSpread({
2848
- screen: screen,
2849
- renderContext: "preview",
2850
- screenState: screenState,
2851
- width: !withSize ? width : undefined,
2852
- height: !withSize ? height : undefined,
2853
- className: classNames([styles$6.screen, _defineProperty({}, className, !withSize)])
2854
- }, props));
2855
- var element = !hidden ? screenElement : /*#__PURE__*/jsxRuntime.jsx("div", {});
2856
- var screenWithSize = withSize ? /*#__PURE__*/jsxRuntime.jsx(ScreenSizer, {
2857
- className: className,
2858
- screenWidth: screenWidth,
2859
- screenHeight: screenHeight,
2860
- width: width,
2861
- height: height,
2862
- fit: fit,
2863
- children: element
2864
- }) : element;
2865
- return screenWithSize;
2866
- }
2867
-
2868
- var styles$5 = {"container":"micromag-core-placeholders-conversation-container","icon":"micromag-core-placeholders-conversation-icon","message":"micromag-core-placeholders-conversation-message","placeholderMessage0":"micromag-core-placeholders-conversation-placeholderMessage0","placeholderMessage1":"micromag-core-placeholders-conversation-placeholderMessage1","placeholderMessage2":"micromag-core-placeholders-conversation-placeholderMessage2","placeholderMessage3":"micromag-core-placeholders-conversation-placeholderMessage3"};
2869
-
2870
- function Conversation() {
2871
- return /*#__PURE__*/jsxRuntime.jsxs("div", {
2872
- className: styles$5.container,
2873
- children: [_toConsumableArray(Array(4)).map(function (e, idx) {
2874
- return /*#__PURE__*/jsxRuntime.jsx("div", {
2875
- className: classNames([styles$5.message, styles$5["placeholderMessage".concat(idx)]])
2876
- }, "message-".concat(idx + 1));
2877
- }), /*#__PURE__*/jsxRuntime.jsx(reactFontawesome.FontAwesomeIcon, {
2878
- icon: faCommentDots.faCommentDots,
2879
- className: styles$5.icon
2880
- })]
2881
- });
2882
- }
2883
-
2884
- /* eslint-disable react/prop-types */
2885
- function InputText(_ref) {
2886
- var _ref$width = _ref.width,
2887
- width = _ref$width === void 0 ? '75%' : _ref$width,
2888
- _ref$height = _ref.height,
2889
- height = _ref$height === void 0 ? '0.5em' : _ref$height,
2890
- className = _ref.className;
2891
- return /*#__PURE__*/jsxRuntime.jsx(PlaceholderBlock, {
2892
- outline: true,
2893
- width: width,
2894
- height: height,
2895
- className: className
2896
- });
2897
- }
2898
-
2899
- var styles$4 = {"container":"micromag-core-placeholders-quiz-answer-container","block":"micromag-core-placeholders-quiz-answer-block","answer":"micromag-core-placeholders-quiz-answer-answer","answerIcon":"micromag-core-placeholders-quiz-answer-answerIcon","good":"micromag-core-placeholders-quiz-answer-good"};
2900
-
2901
- function Answer$1(_ref) {
2902
- var _ref$width = _ref.width,
2903
- width = _ref$width === void 0 ? '75%' : _ref$width,
2904
- _ref$height = _ref.height,
2905
- height = _ref$height === void 0 ? '0.3em' : _ref$height,
2906
- className = _ref.className,
2907
- _ref$good = _ref.good,
2908
- good = _ref$good === void 0 ? true : _ref$good;
2909
- return /*#__PURE__*/jsxRuntime.jsxs("div", {
2910
- className: classNames([styles$4.container, className, _defineProperty({}, styles$4.good, good)]),
2911
- children: [/*#__PURE__*/jsxRuntime.jsx("div", {
2912
- className: styles$4.answer,
2913
- children: /*#__PURE__*/jsxRuntime.jsx(reactFontawesome.FontAwesomeIcon, {
2914
- className: styles$4.answerIcon,
2915
- icon: good ? faCheck.faCheck : faTimes.faTimes
2916
- })
2917
- }), /*#__PURE__*/jsxRuntime.jsx(PlaceholderBlock, {
2918
- outline: true,
2919
- width: width,
2920
- height: height,
2921
- className: styles$4.block,
2922
- children: /*#__PURE__*/jsxRuntime.jsx(PlaceholderText, {
2923
- line: 1,
2924
- height: "0.2em"
2925
- })
2926
- })]
2927
- });
2928
- }
2929
-
2930
- var styles$3 = {"container":"micromag-core-placeholders-share-options-container","box":"micromag-core-placeholders-share-options-box","icon":"micromag-core-placeholders-share-options-icon","item":"micromag-core-placeholders-share-options-item"};
2931
-
2932
- function Title(props) {
2933
- return /*#__PURE__*/jsxRuntime.jsxs(PlaceholderBlock, _objectSpread(_objectSpread({}, props), {}, {
2934
- width: "100%",
2935
- height: "100%",
2936
- className: classNames([styles$3.container, _defineProperty({}, props.className, props.className !== null)]),
2937
- boxClassName: styles$3.box,
2938
- children: [/*#__PURE__*/jsxRuntime.jsx("div", {
2939
- className: styles$3.item,
2940
- children: /*#__PURE__*/jsxRuntime.jsx(reactFontawesome.FontAwesomeIcon, {
2941
- icon: faCircle.faCircle,
2942
- className: styles$3.icon
2943
- })
2944
- }), /*#__PURE__*/jsxRuntime.jsx("div", {
2945
- className: styles$3.item,
2946
- children: /*#__PURE__*/jsxRuntime.jsx(reactFontawesome.FontAwesomeIcon, {
2947
- icon: faCircle.faCircle,
2948
- className: styles$3.icon
2949
- })
2950
- }), /*#__PURE__*/jsxRuntime.jsx("div", {
2951
- className: styles$3.item,
2952
- children: /*#__PURE__*/jsxRuntime.jsx(reactFontawesome.FontAwesomeIcon, {
2953
- icon: faCircle.faCircle,
2954
- className: styles$3.icon
2955
- })
2956
- })]
2957
- }));
2958
- }
2959
-
2960
- var styles$2 = {"container":"micromag-core-placeholders-survey-answer-container","block":"micromag-core-placeholders-survey-answer-block","percent":"micromag-core-placeholders-survey-answer-percent","percentIcon":"micromag-core-placeholders-survey-answer-percentIcon"};
2961
-
2962
- /* eslint-disable react/destructuring-assignment, react/prop-types */
2963
- function Answer(_ref) {
2964
- var _ref$width = _ref.width,
2965
- width = _ref$width === void 0 ? '75%' : _ref$width,
2966
- _ref$height = _ref.height,
2967
- height = _ref$height === void 0 ? '0.3em' : _ref$height,
2968
- className = _ref.className;
2969
- return /*#__PURE__*/jsxRuntime.jsxs("div", {
2970
- className: classNames([styles$2.container, className]),
2971
- children: [/*#__PURE__*/jsxRuntime.jsx(PlaceholderBlock, {
2972
- outline: true,
2973
- width: width,
2974
- height: height,
2975
- className: styles$2.block,
2976
- children: /*#__PURE__*/jsxRuntime.jsx(PlaceholderText, {
2977
- line: 1,
2978
- height: "0.2em"
2979
- })
2980
- }), /*#__PURE__*/jsxRuntime.jsx("div", {
2981
- className: styles$2.percent,
2982
- children: /*#__PURE__*/jsxRuntime.jsx(reactFontawesome.FontAwesomeIcon, {
2983
- className: styles$2.percentIcon,
2984
- icon: faPercent.faPercent
2985
- })
2986
- })]
2987
- });
2988
- }
2989
-
2990
- var Placeholders = /*#__PURE__*/Object.freeze({
2991
- __proto__: null,
2992
- AdFrame: AdFrame,
2993
- AdImage: AdImage,
2994
- Audio: Audio,
2995
- Button: Button,
2996
- Conversation: Conversation,
2997
- Image: Image,
2998
- InputText: InputText,
2999
- Line: Line,
3000
- Map: Map,
3001
- MapPath: MapPath,
3002
- QuizAnswer: Answer$1,
3003
- Quote: Quote,
3004
- ShareOptions: Title,
3005
- ShortText: ShortText,
3006
- Subtitle: Subtitle,
3007
- SurveyAnswer: Answer,
3008
- Text: TextPlaceholder,
3009
- Timeline: Timeline,
3010
- Title: Title$1,
3011
- Video: Video,
3012
- Video360: Video360,
3013
- VideoLoop: VideoLoop
3014
- });
3015
-
3016
- function ScreenElement(_ref) {
3017
- var _ref$children = _ref.children,
3018
- children = _ref$children === void 0 ? null : _ref$children,
3019
- _ref$placeholder = _ref.placeholder,
3020
- placeholder = _ref$placeholder === void 0 ? null : _ref$placeholder,
3021
- _ref$empty = _ref.empty,
3022
- empty = _ref$empty === void 0 ? null : _ref$empty,
3023
- _ref$emptyLabel = _ref.emptyLabel,
3024
- emptyLabel = _ref$emptyLabel === void 0 ? null : _ref$emptyLabel,
3025
- _ref$preview = _ref.preview,
3026
- preview = _ref$preview === void 0 ? null : _ref$preview,
3027
- _ref$isEmpty = _ref.isEmpty,
3028
- isEmpty = _ref$isEmpty === void 0 ? false : _ref$isEmpty,
3029
- _ref$placeholderProps = _ref.placeholderProps,
3030
- placeholderProps = _ref$placeholderProps === void 0 ? null : _ref$placeholderProps,
3031
- _ref$emptyClassName = _ref.emptyClassName,
3032
- emptyClassName = _ref$emptyClassName === void 0 ? null : _ref$emptyClassName;
3033
- var _useScreenRenderConte = contexts.useScreenRenderContext(),
3034
- isPlaceholder = _useScreenRenderConte.isPlaceholder,
3035
- isEdit = _useScreenRenderConte.isEdit,
3036
- isPreview = _useScreenRenderConte.isPreview;
3037
- if (isPlaceholder) {
3038
- var PlaceholderComponent = isString(placeholder) ? utils.getComponentFromName(placeholder, Placeholders) : null;
3039
- return PlaceholderComponent !== null ? /*#__PURE__*/jsxRuntime.jsx(PlaceholderComponent, _objectSpread({}, placeholderProps)) : placeholder;
3040
- }
3041
- if (isEdit && isEmpty) {
3042
- return empty !== null ? empty : /*#__PURE__*/jsxRuntime.jsx(Empty, {
3043
- className: emptyClassName,
3044
- children: emptyLabel
3045
- });
3046
- }
3047
- if (isPreview && preview !== null) {
3048
- return preview;
3049
- }
3050
- return children;
3051
- }
3052
-
3053
- var styles$1 = {"container":"micromag-core-screens-container","screen":"micromag-core-screens-screen","visible":"micromag-core-screens-visible"};
3054
-
3055
- function Screens(_ref) {
3056
- var screens = _ref.screens,
3057
- _ref$screen = _ref.screen,
3058
- screenId = _ref$screen === void 0 ? null : _ref$screen,
3059
- _ref$className = _ref.className,
3060
- className = _ref$className === void 0 ? null : _ref$className;
3061
- return /*#__PURE__*/jsxRuntime.jsx("div", {
3062
- className: classNames([styles$1.container, className]),
3063
- children: screens.map(function (screen) {
3064
- var id = screen.id;
3065
- return /*#__PURE__*/jsxRuntime.jsx(Screen, {
3066
- screen: screen,
3067
- className: classNames([styles$1.screen, _defineProperty({}, styles$1.visible, screenId === id)])
3068
- }, "screen-".concat(id));
3069
- })
3070
- });
3071
- }
3072
-
3073
- var styles = {"container":"micromag-core-transitions-transition-container","fullscreen":"micromag-core-transitions-transition-fullscreen"};
3074
-
3075
- function Transition(_ref) {
3076
- var _ref$fullscreen = _ref.fullscreen,
3077
- fullscreen = _ref$fullscreen === void 0 ? false : _ref$fullscreen,
3078
- _ref$from = _ref.from,
3079
- from = _ref$from === void 0 ? null : _ref$from,
3080
- _ref$to = _ref.to,
3081
- to = _ref$to === void 0 ? null : _ref$to,
3082
- _ref$playing = _ref.playing,
3083
- playing = _ref$playing === void 0 ? false : _ref$playing,
3084
- _ref$direction = _ref.direction,
3085
- direction = _ref$direction === void 0 ? null : _ref$direction,
3086
- _ref$delay = _ref.delay,
3087
- delay = _ref$delay === void 0 ? 0 : _ref$delay,
3088
- _ref$reversible = _ref.reversible,
3089
- reversible = _ref$reversible === void 0 ? true : _ref$reversible,
3090
- _ref$duration = _ref.duration,
3091
- duration = _ref$duration === void 0 ? undefined : _ref$duration,
3092
- _ref$easing = _ref.easing,
3093
- easing = _ref$easing === void 0 ? undefined : _ref$easing,
3094
- _ref$config = _ref.config,
3095
- config = _ref$config === void 0 ? null : _ref$config,
3096
- _ref$children = _ref.children,
3097
- children = _ref$children === void 0 ? null : _ref$children,
3098
- _ref$className = _ref.className,
3099
- className = _ref$className === void 0 ? null : _ref$className,
3100
- _ref$onStart = _ref.onStart,
3101
- onStart = _ref$onStart === void 0 ? null : _ref$onStart,
3102
- _ref$onComplete = _ref.onComplete,
3103
- onComplete = _ref$onComplete === void 0 ? null : _ref$onComplete;
3104
- // In react-spring v10, useSpring(fn) without deps resets the spring on every render
3105
- // via a layout effect. Passing a SpringRef prevents this reset behavior.
3106
- var springRef = core.useSpringRef();
3107
- var _useSpring = core.useSpring(function () {
3108
- return {
3109
- ref: springRef
3110
- };
3111
- }),
3112
- _useSpring2 = _slicedToArray(_useSpring, 2),
3113
- springProps = _useSpring2[0],
3114
- setSpringProps = _useSpring2[1];
3115
- React.useEffect(function () {
3116
- var immediate = !playing && direction === 'in' || playing && direction === 'out';
3117
- var finalPlaying = immediate || playing;
3118
- var reset = reversible && playing && !immediate;
3119
- var finalDuration = duration !== null ? duration : undefined;
3120
- var withDelay = delay > 0 && playing && direction !== 'out';
3121
- var finalConfig = easing !== null && web.config[easing] ? web.config[easing] || null : config;
3122
- var props = {
3123
- from: finalPlaying ? from : to,
3124
- to: finalPlaying ? to : from,
3125
- immediate: immediate,
3126
- delay: withDelay ? delay : null,
3127
- reset: reset,
3128
- onStart: onStart,
3129
- onRest: onComplete,
3130
- config: finalConfig !== null ? finalConfig : {
3131
- duration: immediate ? 0 : finalDuration
3132
- }
3133
- };
3134
- // Reversible always toggles between from-to (playing) to-from (!playing)
3135
- if (finalPlaying || reversible) {
3136
- setSpringProps.start(props);
3137
- }
3138
- // console.log('fx', { reset, finalPlaying, immediate, reversible });
3139
- }, [playing, direction, delay, duration, reversible, easing, config, from, to, setSpringProps, onStart, onComplete]);
3140
- return /*#__PURE__*/jsxRuntime.jsx(web.animated.div, {
3141
- style: _objectSpread({}, springProps),
3142
- className: classNames([styles.container, className, _defineProperty({}, styles.fullscreen, fullscreen)]),
3143
- children: children
3144
- });
3145
- }
3146
-
3147
- function Fade(props) {
3148
- var from = React.useMemo(function () {
3149
- return {
3150
- opacity: 0
3151
- };
3152
- }, []);
3153
- var to = React.useMemo(function () {
3154
- return {
3155
- opacity: 1
3156
- };
3157
- }, []);
3158
- return /*#__PURE__*/jsxRuntime.jsx(Transition, _objectSpread(_objectSpread({}, props), {}, {
3159
- from: from,
3160
- to: to
3161
- }));
3162
- }
3163
-
3164
- function Scale(props) {
3165
- var from = React.useMemo(function () {
3166
- return {
3167
- transform: 'scale(0)'
3168
- };
3169
- }, []);
3170
- var to = React.useMemo(function () {
3171
- return {
3172
- transform: 'scale(1)'
3173
- };
3174
- }, []);
3175
- return /*#__PURE__*/jsxRuntime.jsx(Transition, _objectSpread(_objectSpread({}, props), {}, {
3176
- from: from,
3177
- to: to
3178
- }));
3179
- }
3180
-
3181
- var TransitionComponents = {
3182
- Fade: Fade,
3183
- Scale: Scale
3184
- };
3185
-
3186
- function Transitions(_ref) {
3187
- var _ref$fullscreen = _ref.fullscreen,
3188
- fullscreen = _ref$fullscreen === void 0 ? false : _ref$fullscreen,
3189
- _ref$playing = _ref.playing,
3190
- playing = _ref$playing === void 0 ? false : _ref$playing,
3191
- _ref$delay = _ref.delay,
3192
- delay = _ref$delay === void 0 ? 0 : _ref$delay,
3193
- _ref$transitions = _ref.transitions,
3194
- transitions = _ref$transitions === void 0 ? null : _ref$transitions,
3195
- _ref$onComplete = _ref.onComplete,
3196
- onComplete = _ref$onComplete === void 0 ? null : _ref$onComplete,
3197
- _ref$disabled = _ref.disabled,
3198
- disabled = _ref$disabled === void 0 ? false : _ref$disabled,
3199
- _ref$children = _ref.children,
3200
- children = _ref$children === void 0 ? null : _ref$children;
3201
- var _useScreenSize = contexts.useScreenSize(),
3202
- _useScreenSize$landsc = _useScreenSize.landscape,
3203
- landscape = _useScreenSize$landsc === void 0 ? true : _useScreenSize$landsc;
3204
- var finalPlaying = playing || landscape;
3205
- var finalTransitions = {
3206
- "in": null,
3207
- out: null
3208
- };
3209
- var defaultTransitions = {
3210
- "in": 'fade',
3211
- out: 'fade'
3212
- };
3213
- var transitionsObject = transitions !== null ? transitions : defaultTransitions;
3214
- Object.keys(transitionsObject).forEach(function (transitionKey) {
3215
- var currentTransition = transitionsObject[transitionKey];
3216
- finalTransitions[transitionKey] = typeof currentTransition === 'string' ? {
3217
- name: currentTransition
3218
- } : currentTransition;
3219
- });
3220
- var _finalTransitions$in = finalTransitions["in"],
3221
- transitionIn = _finalTransitions$in === void 0 ? null : _finalTransitions$in,
3222
- _finalTransitions$out = finalTransitions.out,
3223
- transitionOut = _finalTransitions$out === void 0 ? null : _finalTransitions$out;
3224
- var finalTransitionIn = transitionIn !== null ? transitionIn : transitionOut;
3225
- var finalTransitionOut = transitionOut !== null ? transitionOut : transitionIn;
3226
- var _ref2 = finalTransitionIn || {},
3227
- _ref2$name = _ref2.name,
3228
- transitionInName = _ref2$name === void 0 ? null : _ref2$name;
3229
- var _ref3 = finalTransitionOut || {},
3230
- _ref3$name = _ref3.name,
3231
- transitionOutName = _ref3$name === void 0 ? null : _ref3$name;
3232
- var sameTransitionInOut = transitionInName === transitionOutName;
3233
- var TransitionIn = finalTransitionIn !== null ? utils.getComponentFromName(transitionInName, TransitionComponents, null) : null;
3234
- var TransitionOut = finalTransitionOut !== null && !sameTransitionInOut ? utils.getComponentFromName(transitionOutName, TransitionComponents, null) : null;
3235
- var transitionInProps = finalTransitionIn !== null ? _objectSpread(_objectSpread({}, finalTransitionIn), {}, {
3236
- name: undefined,
3237
- delay: delay,
3238
- onComplete: onComplete
3239
- }) : null;
3240
- var transitionOutProps = finalTransitionOut !== null ? _objectSpread(_objectSpread({}, finalTransitionOut), {}, {
3241
- name: undefined,
3242
- delay: delay,
3243
- onComplete: onComplete
3244
- }) : null;
3245
- var renderTransitionOut = TransitionOut !== null && !disabled ? /*#__PURE__*/jsxRuntime.jsx(TransitionOut, _objectSpread(_objectSpread({
3246
- fullscreen: fullscreen,
3247
- playing: finalPlaying,
3248
- direction: "out"
3249
- }, transitionOutProps), {}, {
3250
- children: children
3251
- })) : children;
3252
- return TransitionIn !== null && !disabled ? /*#__PURE__*/jsxRuntime.jsx(TransitionIn, _objectSpread(_objectSpread({
3253
- fullscreen: fullscreen,
3254
- playing: finalPlaying,
3255
- direction: !sameTransitionInOut ? 'in' : null
3256
- }, transitionInProps), {}, {
3257
- children: renderTransitionOut
3258
- })) : renderTransitionOut;
3259
- }
3260
-
3261
- function TransitionsStagger(_ref) {
3262
- var _ref$transitions = _ref.transitions,
3263
- transitions = _ref$transitions === void 0 ? null : _ref$transitions,
3264
- _ref$stagger = _ref.stagger,
3265
- stagger = _ref$stagger === void 0 ? 0 : _ref$stagger,
3266
- _ref$playing = _ref.playing,
3267
- playing = _ref$playing === void 0 ? false : _ref$playing,
3268
- _ref$disabled = _ref.disabled,
3269
- disabled = _ref$disabled === void 0 ? false : _ref$disabled,
3270
- _ref$delay = _ref.delay,
3271
- delay = _ref$delay === void 0 ? 0 : _ref$delay,
3272
- _ref$fullscreen = _ref.fullscreen,
3273
- fullscreen = _ref$fullscreen === void 0 ? false : _ref$fullscreen,
3274
- _ref$children = _ref.children,
3275
- children = _ref$children === void 0 ? null : _ref$children;
3276
- var validIndex = 0;
3277
- var elements = React.Children.map(children, function (child) {
3278
- if (!child) {
3279
- return null;
3280
- }
3281
- var _child$type = child.type,
3282
- type = _child$type === void 0 ? null : _child$type;
3283
- var _ref2 = type || {},
3284
- _ref2$withoutTransiti = _ref2.withoutTransitionsWrapper,
3285
- withoutTransitionsWrapper = _ref2$withoutTransiti === void 0 ? false : _ref2$withoutTransiti;
3286
- if (disabled || withoutTransitionsWrapper) {
3287
- return child;
3288
- }
3289
- var el = /*#__PURE__*/jsxRuntime.jsx(Transitions, {
3290
- transitions: transitions,
3291
- delay: delay + validIndex * stagger,
3292
- playing: playing,
3293
- fullscreen: fullscreen,
3294
- children: child
3295
- });
3296
- validIndex += 1;
3297
- return el;
3298
- });
3299
- return elements;
3300
- }
3301
-
3302
- function HighlightStyle(_ref) {
3303
- var _ref$selector = _ref.selector,
3304
- selector = _ref$selector === void 0 ? null : _ref$selector,
3305
- _ref$highlightSelecto = _ref.highlightSelector,
3306
- highlightSelector = _ref$highlightSelecto === void 0 ? 'mark' : _ref$highlightSelecto,
3307
- _ref$style = _ref.style,
3308
- style = _ref$style === void 0 ? null : _ref$style;
3309
- return style !== null ? /*#__PURE__*/jsxRuntime.jsx("style", {
3310
- type: "text/css",
3311
- dangerouslySetInnerHTML: {
3312
- __html: "".concat([selector, highlightSelector].filter(function (it) {
3313
- return it !== null;
3314
- }).join(' '), "{").concat(utils.convertStyleToString(style), "}")
3315
- }
3316
- }) : null;
3317
- }
3318
-
3319
- function LinkStyle(_ref) {
3320
- var _ref$selector = _ref.selector,
3321
- selector = _ref$selector === void 0 ? null : _ref$selector,
3322
- _ref$linkSelector = _ref.linkSelector,
3323
- linkSelector = _ref$linkSelector === void 0 ? 'a' : _ref$linkSelector,
3324
- _ref$style = _ref.style,
3325
- style = _ref$style === void 0 ? null : _ref$style;
3326
- return style !== null ? /*#__PURE__*/jsxRuntime.jsx("style", {
3327
- type: "text/css",
3328
- dangerouslySetInnerHTML: {
3329
- __html: "".concat([selector, linkSelector].filter(function (it) {
3330
- return it !== null;
3331
- }).join(' '), "{").concat(utils.convertStyleToString(style), "}")
3332
- }
3333
- }) : null;
3334
- }
3335
-
3336
- exports.ArrowIcon = ArrowIcon;
3337
- exports.BackButton = BackButton;
3338
- exports.Breadcrumb = Breadcrumb;
3339
- exports.Button = Button$1;
3340
- exports.Buttons = Buttons;
3341
- exports.Card = Card;
3342
- exports.ClearButton = ClearButton;
3343
- exports.Close = Close;
3344
- exports.CloseIcon = CloseIcon;
3345
- exports.CollapsablePanel = CollapsablePanel;
3346
- exports.Date = Date$1;
3347
- exports.Detector = Detector;
3348
- exports.DropdownMenu = Dropdown;
3349
- exports.Element = ElementComponent;
3350
- exports.Empty = Empty;
3351
- exports.FieldForm = FieldForm;
3352
- exports.FontFaces = FontFaces;
3353
- exports.Form = Form;
3354
- exports.FormPanel = FormPanel;
3355
- exports.FullscreenIcon = FullscreenIcon;
3356
- exports.HighlightStyle = HighlightStyle;
3357
- exports.Label = Label;
3358
- exports.Link = Link;
3359
- exports.LinkIcon = LinkIcon;
3360
- exports.LinkStyle = LinkStyle;
3361
- exports.Media = Media;
3362
- exports.Menu = Menu;
3363
- exports.Meta = Meta;
3364
- exports.Modal = Modal;
3365
- exports.ModalDialog = ModalDialog;
3366
- exports.ModalPortal = ModalPortal;
3367
- exports.Modals = Modals;
3368
- exports.MuteIcon = MuteIcon;
3369
- exports.Navbar = Navbar;
3370
- exports.Pagination = PaginationMenu;
3371
- exports.Panel = Panel;
3372
- exports.PanelPortal = PanelPortal;
3373
- exports.Panels = Panels;
3374
- exports.PauseIcon = PauseIcon;
3375
- exports.PlaceholderAdFrame = AdFrame;
3376
- exports.PlaceholderAdImage = AdImage;
3377
- exports.PlaceholderAudio = Audio;
3378
- exports.PlaceholderButton = Button;
3379
- exports.PlaceholderImage = Image;
3380
- exports.PlaceholderLine = Line;
3381
- exports.PlaceholderMap = Map;
3382
- exports.PlaceholderMapPath = MapPath;
3383
- exports.PlaceholderQuote = Quote;
3384
- exports.PlaceholderShortText = ShortText;
3385
- exports.PlaceholderSubtitle = Subtitle;
3386
- exports.PlaceholderText = TextPlaceholder;
3387
- exports.PlaceholderTimeline = Timeline;
3388
- exports.PlaceholderTitle = Title$1;
3389
- exports.PlaceholderVideo = Video;
3390
- exports.PlaceholderVideo360 = Video360;
3391
- exports.PlaceholderVideoLoop = VideoLoop;
3392
- exports.PlayIcon = PlayIcon;
3393
- exports.Screen = Screen;
3394
- exports.ScreenElement = ScreenElement;
3395
- exports.ScreenPlaceholder = ScreenPlaceholder;
3396
- exports.ScreenPreview = ScreenPreview;
3397
- exports.ScreenSizer = ScreenSizer;
3398
- exports.Screens = Screens;
3399
- exports.Slideshow = Slideshow;
3400
- exports.Spinner = Spinner;
3401
- exports.Tabs = TabsMenu;
3402
- exports.Transitions = Transitions;
3403
- exports.TransitionsStagger = TransitionsStagger;
3404
- exports.UnmuteIcon = UnmuteIcon;