@micromag/core 0.3.181 → 0.3.186

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/es/components.js CHANGED
@@ -5,16 +5,15 @@ import PropTypes$1 from 'prop-types';
5
5
  import React, { useCallback, useState, useEffect, useRef, useMemo, Suspense } from 'react';
6
6
  import { Link as Link$1 } from 'react-router-dom';
7
7
  import { PropTypes } from '@micromag/core';
8
- import { FormattedMessage, useIntl, defineMessages, FormattedDate, FormattedTime } from 'react-intl';
8
+ import { FormattedMessage, defineMessages, FormattedDate, FormattedTime } from 'react-intl';
9
9
  import { isMessage, getFieldFromPath, getComponentFromName, setFieldValue, validateFields, getDisplayName, pascalCase, convertStyleToString } from '@micromag/core/utils';
10
10
  import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
11
11
  import { faAngleLeft } from '@fortawesome/free-solid-svg-icons/faAngleLeft';
12
- import _objectSpread from '@babel/runtime/helpers/objectSpread2';
13
- import 'snake-case';
14
12
  import _toConsumableArray from '@babel/runtime/helpers/toConsumableArray';
15
13
  import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
16
14
  import { useFieldsManager, useFieldComponent, FieldContextProvider, withModals, useModals, useUppy, withPanels, usePanels, ScreenSizeProvider, useScreenComponent, ScreenProvider, useScreenRenderContext, useScreenSize } from '@micromag/core/contexts';
17
15
  import { useForm, useDocumentEvent, useIntersectionObserver, useDimensionObserver } from '@micromag/core/hooks';
16
+ import _objectSpread from '@babel/runtime/helpers/objectSpread2';
18
17
  import get from 'lodash/get';
19
18
  import ReactDOM from 'react-dom';
20
19
  import isArray from 'lodash/isArray';
@@ -25,6 +24,7 @@ import throttle from 'lodash/throttle';
25
24
  import isObject from 'lodash/isObject';
26
25
  import { Helmet } from 'react-helmet';
27
26
  import isString from 'lodash/isString';
27
+ import 'snake-case';
28
28
  import { faAd } from '@fortawesome/free-solid-svg-icons/faAd';
29
29
  import { faImage } from '@fortawesome/free-solid-svg-icons/faImage';
30
30
  import { faMusic } from '@fortawesome/free-solid-svg-icons/faMusic';
@@ -44,13 +44,13 @@ import { useSpring } from '@react-spring/core';
44
44
  import { animated } from '@react-spring/web';
45
45
 
46
46
  /* eslint-disable react/jsx-props-no-spreading */
47
- var propTypes$O = {
47
+ var propTypes$L = {
48
48
  children: PropTypes.label.isRequired,
49
49
  isHtml: PropTypes$1.bool,
50
50
  values: PropTypes$1.object // eslint-disable-line react/forbid-prop-types
51
51
 
52
52
  };
53
- var defaultProps$O = {
53
+ var defaultProps$L = {
54
54
  isHtml: false,
55
55
  values: {}
56
56
  };
@@ -65,13 +65,13 @@ var Label = function Label(_ref) {
65
65
  }, children)) : children;
66
66
  };
67
67
 
68
- Label.propTypes = propTypes$O;
69
- Label.defaultProps = defaultProps$O;
68
+ Label.propTypes = propTypes$L;
69
+ Label.defaultProps = defaultProps$L;
70
70
 
71
- var styles$y = {"container":"micromag-core-buttons-button-container","asLink":"micromag-core-buttons-button-asLink","withoutStyle":"micromag-core-buttons-button-withoutStyle","icon":"micromag-core-buttons-button-icon","label":"micromag-core-buttons-button-label","withIcon":"micromag-core-buttons-button-withIcon","right":"micromag-core-buttons-button-right","withAnimations":"micromag-core-buttons-button-withAnimations","icon-right":"micromag-core-buttons-button-icon-right","withIconColumns":"micromag-core-buttons-button-withIconColumns","linkDisabled":"micromag-core-buttons-button-linkDisabled"};
71
+ var styles$w = {"container":"micromag-core-buttons-button-container","asLink":"micromag-core-buttons-button-asLink","withoutStyle":"micromag-core-buttons-button-withoutStyle","icon":"micromag-core-buttons-button-icon","label":"micromag-core-buttons-button-label","withIcon":"micromag-core-buttons-button-withIcon","right":"micromag-core-buttons-button-right","withAnimations":"micromag-core-buttons-button-withAnimations","icon-right":"micromag-core-buttons-button-icon-right","withIconColumns":"micromag-core-buttons-button-withIconColumns","linkDisabled":"micromag-core-buttons-button-linkDisabled"};
72
72
 
73
- 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", "withAnimations", "asLink", "outline", "onClick", "className", "iconClassName", "labelClassName", "refButton"];
74
- var propTypes$N = {
73
+ var _excluded$a = ["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"];
74
+ var propTypes$K = {
75
75
  type: PropTypes$1.string,
76
76
  theme: PropTypes.buttonTheme,
77
77
  size: PropTypes.buttonSize,
@@ -94,7 +94,6 @@ var propTypes$N = {
94
94
  withoutStyle: PropTypes$1.bool,
95
95
  withoutBootstrapStyles: PropTypes$1.bool,
96
96
  withoutTheme: PropTypes$1.bool,
97
- withAnimations: PropTypes$1.bool,
98
97
  outline: PropTypes$1.bool,
99
98
  asLink: PropTypes$1.bool,
100
99
  className: PropTypes$1.string,
@@ -106,7 +105,7 @@ var propTypes$N = {
106
105
 
107
106
  })])
108
107
  };
109
- var defaultProps$N = {
108
+ var defaultProps$K = {
110
109
  type: 'button',
111
110
  theme: null,
112
111
  size: null,
@@ -129,8 +128,6 @@ var defaultProps$N = {
129
128
  withoutStyle: false,
130
129
  withoutBootstrapStyles: false,
131
130
  withoutTheme: false,
132
- withAnimations: true,
133
- // @todo should be false by default, probably
134
131
  outline: false,
135
132
  asLink: false,
136
133
  className: null,
@@ -165,7 +162,6 @@ var Button$1 = function Button(_ref) {
165
162
  withoutStyle = _ref.withoutStyle,
166
163
  withoutBootstrapStyles = _ref.withoutBootstrapStyles,
167
164
  withoutTheme = _ref.withoutTheme,
168
- withAnimations = _ref.withAnimations,
169
165
  asLink = _ref.asLink,
170
166
  outline = _ref.outline,
171
167
  onClick = _ref.onClick,
@@ -173,7 +169,7 @@ var Button$1 = function Button(_ref) {
173
169
  iconClassName = _ref.iconClassName,
174
170
  labelClassName = _ref.labelClassName,
175
171
  refButton = _ref.refButton,
176
- props = _objectWithoutProperties(_ref, _excluded$c);
172
+ props = _objectWithoutProperties(_ref, _excluded$a);
177
173
 
178
174
  var finalLabel = label || children;
179
175
  var text = finalLabel !== null ? /*#__PURE__*/React.createElement(Label, null, finalLabel) : null;
@@ -182,25 +178,25 @@ var Button$1 = function Button(_ref) {
182
178
  var hasInlineIcon = hasIcon && (iconPosition === 'inline' || text === null);
183
179
  var hasIconColumns = hasIcon && !hasInlineIcon;
184
180
  var content = /*#__PURE__*/React.createElement(React.Fragment, null, hasInlineIcon ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("span", {
185
- className: classNames([styles$y.icon, _defineProperty({}, iconClassName, iconClassName !== null)])
181
+ className: classNames([styles$w.icon, _defineProperty({}, iconClassName, iconClassName !== null)])
186
182
  }, icon), text !== null ? /*#__PURE__*/React.createElement("span", {
187
- className: classNames([styles$y.label, _defineProperty({}, labelClassName, labelClassName !== null)])
183
+ className: classNames([styles$w.label, _defineProperty({}, labelClassName, labelClassName !== null)])
188
184
  }, text) : null) : null, hasIconColumns ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("span", {
189
- className: classNames([styles$y.icon, styles$y.left, _defineProperty({}, iconClassName, iconClassName !== null && iconPosition === 'left')])
185
+ className: classNames([styles$w.left, _defineProperty({}, iconClassName, iconClassName !== null && iconPosition === 'left')])
190
186
  }, iconPosition === 'left' ? icon : null), /*#__PURE__*/React.createElement("span", {
191
- className: classNames([styles$y.center, styles$y.label, _defineProperty({}, labelClassName, labelClassName !== null)])
187
+ className: classNames([styles$w.center, _defineProperty({}, labelClassName, labelClassName !== null)])
192
188
  }, text), /*#__PURE__*/React.createElement("span", {
193
- className: classNames([styles$y.icon, styles$y.right, _defineProperty({}, iconClassName, iconClassName !== null && iconPosition === 'right')])
189
+ className: classNames([styles$w.right, _defineProperty({}, iconClassName, iconClassName !== null && iconPosition === 'right')])
194
190
  }, iconPosition === 'right' ? icon : null), hasChildren ? children : null) : null, !hasIcon ? text : null, hasChildren ? children : null);
195
191
  var withStyle = !withoutTheme && !withoutStyle && !asLink;
196
192
  var buttonClassNames = classNames([!withoutBootstrapStyles ? (_ref7 = {
197
193
  btn: withStyle
198
- }, _defineProperty(_ref7, "btn-".concat(outline ? 'outline-' : '').concat(theme), withStyle && theme !== null), _defineProperty(_ref7, "btn-".concat(size), withStyle && size !== null), _defineProperty(_ref7, "active", !withoutStyle && active), _ref7) : null, styles$y.container, styles$y["icon-".concat(iconPosition)], (_ref8 = {}, _defineProperty(_ref8, styles$y.withoutStyle, withoutStyle), _defineProperty(_ref8, styles$y.withIcon, hasIcon), _defineProperty(_ref8, styles$y.withIconColumns, hasIconColumns), _defineProperty(_ref8, styles$y.withText, text !== null), _defineProperty(_ref8, styles$y.withShadow, withShadow), _defineProperty(_ref8, styles$y.withAnimations, withAnimations), _defineProperty(_ref8, styles$y.isSmall, small), _defineProperty(_ref8, styles$y.isBig, big), _defineProperty(_ref8, styles$y.isLink, href !== null), _defineProperty(_ref8, styles$y.asLink, asLink), _defineProperty(_ref8, styles$y.isDisabled, disabled), _defineProperty(_ref8, styles$y.isLoading, loading), _defineProperty(_ref8, className, className !== null), _ref8)]);
194
+ }, _defineProperty(_ref7, "btn-".concat(outline ? 'outline-' : '').concat(theme), withStyle && theme !== null), _defineProperty(_ref7, "btn-".concat(size), withStyle && size !== null), _defineProperty(_ref7, "active", !withoutStyle && active), _ref7) : null, styles$w.container, (_ref8 = {}, _defineProperty(_ref8, styles$w.withoutStyle, withoutStyle), _defineProperty(_ref8, styles$w.withIcon, hasIcon), _defineProperty(_ref8, styles$w.withIconColumns, hasIconColumns), _defineProperty(_ref8, styles$w.withText, text !== null), _defineProperty(_ref8, styles$w.withShadow, withShadow), _defineProperty(_ref8, styles$w.isSmall, small), _defineProperty(_ref8, styles$w.isBig, big), _defineProperty(_ref8, styles$w.isLink, href !== null), _defineProperty(_ref8, styles$w.asLink, asLink), _defineProperty(_ref8, styles$w.isDisabled, disabled), _defineProperty(_ref8, styles$w.isLoading, loading), _defineProperty(_ref8, className, className !== null), _ref8)]);
199
195
 
200
196
  if (href !== null) {
201
197
  var linkClassNames = classNames([buttonClassNames, _defineProperty({
202
198
  disabled: disabled
203
- }, styles$y.linkDisabled, disabled)]);
199
+ }, styles$w.linkDisabled, disabled)]);
204
200
  return external || direct ? /*#__PURE__*/React.createElement("a", Object.assign({}, props, {
205
201
  href: disabled ? null : href,
206
202
  className: linkClassNames,
@@ -208,13 +204,13 @@ var Button$1 = function Button(_ref) {
208
204
  target: external ? target : null,
209
205
  ref: refButton,
210
206
  tabIndex: focusable ? '' : '-1'
211
- }), content) : /*#__PURE__*/React.createElement(Link$1, Object.assign({}, props, {
207
+ }), content) : /*#__PURE__*/React.createElement(Link$1, {
212
208
  to: href,
213
209
  className: linkClassNames,
214
210
  onClick: onClick,
215
211
  ref: refButton,
216
212
  tabIndex: focusable ? '' : '-1'
217
- }), content);
213
+ }, content);
218
214
  }
219
215
 
220
216
  return /*#__PURE__*/React.createElement("button", Object.assign({}, props, {
@@ -227,13 +223,13 @@ var Button$1 = function Button(_ref) {
227
223
  }), content);
228
224
  };
229
225
 
230
- Button$1.propTypes = propTypes$N;
231
- Button$1.defaultProps = defaultProps$N;
226
+ Button$1.propTypes = propTypes$K;
227
+ Button$1.defaultProps = defaultProps$K;
232
228
 
233
- var styles$x = {};
229
+ var styles$v = {};
234
230
 
235
- var _excluded$b = ["className", "onClick", "theme"];
236
- var propTypes$M = {
231
+ var _excluded$9 = ["className", "onClick", "theme"];
232
+ var propTypes$J = {
237
233
  buttons: PropTypes.buttons,
238
234
  size: PropTypes.buttonSize,
239
235
  theme: PropTypes.buttonTheme,
@@ -242,7 +238,7 @@ var propTypes$M = {
242
238
  className: PropTypes$1.string,
243
239
  buttonClassName: PropTypes$1.string
244
240
  };
245
- var defaultProps$M = {
241
+ var defaultProps$J = {
246
242
  buttons: [],
247
243
  size: null,
248
244
  theme: undefined,
@@ -261,7 +257,7 @@ var Buttons = function Buttons(_ref) {
261
257
  buttonClassName = _ref.buttonClassName,
262
258
  className = _ref.className;
263
259
  return /*#__PURE__*/React.createElement("div", {
264
- className: classNames(['btn-group', _defineProperty({}, "btn-group-".concat(size), size !== null), styles$x.container, _defineProperty({}, className, className !== null)]),
260
+ className: classNames(['btn-group', _defineProperty({}, "btn-group-".concat(size), size !== null), styles$v.container, _defineProperty({}, className, className !== null)]),
265
261
  role: "group"
266
262
  }, buttons.map(function (button, index) {
267
263
  var _ref4;
@@ -272,11 +268,11 @@ var Buttons = function Buttons(_ref) {
272
268
  _onClick = _button$onClick === void 0 ? null : _button$onClick,
273
269
  _button$theme = button.theme,
274
270
  buttonTheme = _button$theme === void 0 ? null : _button$theme,
275
- buttonProps = _objectWithoutProperties(button, _excluded$b);
271
+ buttonProps = _objectWithoutProperties(button, _excluded$9);
276
272
 
277
273
  var fixedProps = {
278
274
  key: "button-".concat(index),
279
- className: classNames([styles$x.button, (_ref4 = {}, _defineProperty(_ref4, buttonClassName, buttonClassName !== null), _defineProperty(_ref4, customClassName, customClassName !== null), _ref4)]),
275
+ className: classNames([styles$v.button, (_ref4 = {}, _defineProperty(_ref4, buttonClassName, buttonClassName !== null), _defineProperty(_ref4, customClassName, customClassName !== null), _ref4)]),
280
276
  onClick: function onClick(e) {
281
277
  if (_onClick !== null) {
282
278
  _onClick(e, button, index);
@@ -292,20 +288,20 @@ var Buttons = function Buttons(_ref) {
292
288
  }));
293
289
  };
294
290
 
295
- Buttons.propTypes = propTypes$M;
296
- Buttons.defaultProps = defaultProps$M;
291
+ Buttons.propTypes = propTypes$J;
292
+ Buttons.defaultProps = defaultProps$J;
297
293
 
298
- var _excluded$a = ["className"];
299
- var propTypes$L = {
294
+ var _excluded$8 = ["className"];
295
+ var propTypes$I = {
300
296
  className: PropTypes$1.string
301
297
  };
302
- var defaultProps$L = {
298
+ var defaultProps$I = {
303
299
  className: null
304
300
  };
305
301
 
306
302
  var BackButton = function BackButton(_ref) {
307
303
  var className = _ref.className,
308
- props = _objectWithoutProperties(_ref, _excluded$a);
304
+ props = _objectWithoutProperties(_ref, _excluded$8);
309
305
 
310
306
  return /*#__PURE__*/React.createElement(Button$1, Object.assign({
311
307
  className: classNames(['px-2', _defineProperty({}, className, className)]),
@@ -317,799 +313,112 @@ var BackButton = function BackButton(_ref) {
317
313
  }, props));
318
314
  };
319
315
 
320
- BackButton.propTypes = propTypes$L;
321
- BackButton.defaultProps = defaultProps$L;
316
+ BackButton.propTypes = propTypes$I;
317
+ BackButton.defaultProps = defaultProps$I;
322
318
 
323
- var styles$w = {"container":"micromag-core-buttons-icon-button-container","icon":"micromag-core-buttons-icon-button-icon","label":"micromag-core-buttons-icon-button-label"};
319
+ var styles$u = {"actions":"micromag-core-forms-form-actions","left":"micromag-core-forms-form-left","right":"micromag-core-forms-form-right"};
324
320
 
325
- var _excluded$9 = ["className", "onClick", "label", "icon", "theme"];
326
- var propTypes$K = {
321
+ var _excluded$7 = ["type"],
322
+ _excluded2 = ["component", "id", "settings"];
323
+ var propTypes$H = {
324
+ name: PropTypes$1.string,
325
+ // .isRequired,
326
+ value: PropTypes.component,
327
+ form: PropTypes$1.string,
328
+ formComponents: PropTypes.components,
329
+ fields: PropTypes.fields,
327
330
  className: PropTypes$1.string,
328
- onClick: null,
329
- label: PropTypes$1.node,
330
- icon: PropTypes$1.node,
331
- theme: PropTypes.viewerTheme
331
+ onChange: PropTypes$1.func,
332
+ gotoFieldForm: PropTypes$1.func.isRequired,
333
+ closeFieldForm: PropTypes$1.func.isRequired,
334
+ fieldContext: PropTypes$1.any // eslint-disable-line react/forbid-prop-types
335
+
332
336
  };
333
- var defaultProps$K = {
337
+ var defaultProps$H = {
338
+ name: null,
339
+ form: null,
340
+ formComponents: {},
341
+ fields: [],
342
+ value: null,
334
343
  className: null,
335
- onClick: null,
336
- label: null,
337
- icon: null,
338
- theme: null
344
+ onChange: null,
345
+ fieldContext: null
339
346
  };
340
347
 
341
- var IconButton = function IconButton(_ref) {
342
- var className = _ref.className,
343
- onClick = _ref.onClick,
344
- label = _ref.label,
345
- icon = _ref.icon;
346
- _ref.theme;
347
- var props = _objectWithoutProperties(_ref, _excluded$9);
348
+ var FieldForm = function FieldForm(_ref) {
349
+ var name = _ref.name,
350
+ value = _ref.value,
351
+ form = _ref.form,
352
+ formComponents = _ref.formComponents,
353
+ fields = _ref.fields,
354
+ className = _ref.className,
355
+ onChange = _ref.onChange,
356
+ gotoFieldForm = _ref.gotoFieldForm,
357
+ closeFieldForm = _ref.closeFieldForm,
358
+ fieldContext = _ref.fieldContext;
359
+ var fieldsManager = useFieldsManager();
360
+ var field = getFieldFromPath(name.split('.'), fields, fieldsManager);
348
361
 
349
- return /*#__PURE__*/React.createElement(Button$1, Object.assign({
350
- className: classNames([styles$w.container, _defineProperty({}, className, className !== null)]),
351
- labelClassName: styles$w.label,
352
- iconClassName: styles$w.icon,
353
- label: label,
354
- icon: icon,
355
- onClick: onClick,
356
- withoutBootstrapStyles: true
357
- }, props));
358
- };
362
+ var _ref2 = field || {},
363
+ _ref2$type = _ref2.type,
364
+ type = _ref2$type === void 0 ? null : _ref2$type,
365
+ fieldProps = _objectWithoutProperties(_ref2, _excluded$7);
359
366
 
360
- IconButton.propTypes = propTypes$K;
361
- IconButton.defaultProps = defaultProps$K;
367
+ var fieldDefinition = fieldsManager.getDefinition(type) || null;
362
368
 
363
- /**
364
- * Core
365
- */
369
+ var fieldData = fieldDefinition || _objectSpread({}, field);
366
370
 
367
- PropTypes$1.shape({
368
- listen: PropTypes$1.func.isRequired,
369
- push: PropTypes$1.func.isRequired
370
- });
371
- PropTypes$1.shape({
372
- pathname: PropTypes$1.string,
373
- search: PropTypes$1.string
374
- });
375
- PropTypes$1.shape({
376
- locale: PropTypes$1.string.isRequired,
377
- formatMessage: PropTypes$1.func.isRequired
378
- });
379
- var defaultMessageContent = PropTypes$1.shape({
380
- type: PropTypes$1.number,
381
- value: PropTypes$1.string
382
- });
383
- var defaultMessage = PropTypes$1.oneOfType([PropTypes$1.string, PropTypes$1.arrayOf(defaultMessageContent)]);
384
- var message = PropTypes$1.shape({
385
- id: PropTypes$1.string,
386
- defaultMessage: defaultMessage.isRequired,
387
- description: PropTypes$1.string
388
- });
389
- var text = PropTypes$1.oneOfType([message, PropTypes$1.string]);
390
- var label = PropTypes$1.oneOfType([message, PropTypes$1.node]);
391
- PropTypes$1.oneOf([401, 403, 404, 500]);
392
- PropTypes$1.oneOfType([PropTypes$1.shape({
393
- current: PropTypes$1.any // eslint-disable-line react/forbid-prop-types
371
+ var _ref3 = fieldData || {},
372
+ _ref3$component = _ref3.component,
373
+ fieldComponent = _ref3$component === void 0 ? null : _ref3$component;
374
+ _ref3.id;
375
+ _ref3.settings;
376
+ var definitionProps = _objectWithoutProperties(_ref3, _excluded2);
394
377
 
395
- }), PropTypes$1.func]);
396
- var target = PropTypes$1.oneOf(['_blank', '_self', '_parent']);
397
- var interaction = PropTypes$1.oneOf(['tap', 'swipe']);
398
- PropTypes$1.arrayOf(interaction);
399
- PropTypes$1.objectOf(PropTypes$1.oneOfType([PropTypes$1.string, PropTypes$1.number, PropTypes$1.array]));
400
- PropTypes$1.shape({
401
- currentTime: PropTypes$1.number,
402
- duration: PropTypes$1.number
403
- });
404
- /**
405
- * Site
406
- */
378
+ var FieldComponent = useFieldComponent(fieldComponent);
379
+ var FormComponent = getComponentFromName(form, formComponents);
380
+ var fieldValue = get(value, name, null);
407
381
 
408
- PropTypes$1.shape({
409
- id: PropTypes$1.number,
410
- firstname: PropTypes$1.string,
411
- lastname: PropTypes$1.string,
412
- email: PropTypes$1.string,
413
- gender: PropTypes$1.string,
414
- birthdate: PropTypes$1.string
415
- });
416
- var menuItem = PropTypes$1.shape({
417
- id: PropTypes$1.oneOfType([PropTypes$1.number, PropTypes$1.string]),
418
- label: label,
419
- url: PropTypes$1.string,
420
- external: PropTypes$1.bool,
421
- active: PropTypes$1.bool
422
- });
423
- PropTypes$1.arrayOf(menuItem);
424
- var breadcrumb = PropTypes$1.shape({
425
- label: label,
426
- url: PropTypes$1.string
427
- });
428
- PropTypes$1.arrayOf(breadcrumb);
429
- var device = PropTypes$1.shape({
430
- id: PropTypes$1.string.isRequired
431
- });
432
- PropTypes$1.arrayOf(device);
433
- var modal = PropTypes$1.shape({
434
- id: PropTypes$1.string.isRequired
435
- });
436
- PropTypes$1.arrayOf(modal);
437
- var panel = PropTypes$1.shape({
438
- id: PropTypes$1.string.isRequired
439
- });
440
- PropTypes$1.arrayOf(panel);
441
- var button = PropTypes$1.shape({
442
- label: label,
443
- onClick: PropTypes$1.func
444
- });
445
- PropTypes$1.arrayOf(button);
446
- var bootstrapThemeStrings = ['primary', 'secondary', 'success', 'danger', 'warning', 'info', 'light', 'dark'];
447
- PropTypes$1.oneOf(bootstrapThemeStrings);
448
- PropTypes$1.oneOf([].concat(bootstrapThemeStrings, ['outline-primary', 'outline-secondary', 'outline-success', 'outline-danger', 'outline-warning', 'outline-info', 'outline-light', 'outline-dark', 'outline-link', null]));
449
- PropTypes$1.oneOf(['lg', 'sm', null]);
450
- PropTypes$1.oneOf(['lg', 'sm', null]);
451
- PropTypes$1.oneOf(['start', 'end']);
452
- var component = PropTypes$1.oneOfType([PropTypes$1.object, PropTypes$1.func]);
453
- PropTypes$1.objectOf(component);
454
- /**
455
- * Forms
456
- */
382
+ var onFieldChange = function onFieldChange(newFieldValue) {
383
+ // const { name, fields: subFields = null } = field || {};
384
+ var newValue = setFieldValue(value, name.split('.'), newFieldValue // field === null || subFields !== null ? newFieldValue : newFieldValue[name],
385
+ );
457
386
 
458
- var errors = PropTypes$1.oneOfType([PropTypes$1.string, PropTypes$1.arrayOf(PropTypes$1.string)]);
459
- PropTypes$1.objectOf(errors);
460
- var selectOption = PropTypes$1.oneOfType([PropTypes$1.string, PropTypes$1.shape({
461
- value: PropTypes$1.any,
462
- // eslint-disable-line
463
- label: label
464
- })]);
465
- PropTypes$1.arrayOf(selectOption);
466
- var formField = PropTypes$1.shape({
467
- name: PropTypes$1.string,
468
- component: component
469
- });
470
- PropTypes$1.arrayOf(formField);
471
- /**
472
- * Medias
473
- */
387
+ if (onChange !== null) {
388
+ onChange(newValue);
389
+ }
390
+ };
474
391
 
475
- var mediaMetadataShape = {
476
- filename: PropTypes$1.string,
477
- size: PropTypes$1.number,
478
- mime: PropTypes$1.string
479
- };
480
- var mediaFile = PropTypes$1.shape({
481
- id: PropTypes$1.string,
482
- handle: PropTypes$1.string,
483
- type: PropTypes$1.string,
484
- mime: PropTypes$1.string,
485
- url: PropTypes$1.string
486
- });
487
- var mediaShape = {
488
- id: PropTypes$1.string,
489
- type: PropTypes$1.string.isRequired,
490
- url: PropTypes$1.string,
491
- // .isRequired,
492
- thumbnail_url: PropTypes$1.string,
493
- name: PropTypes$1.string,
494
- metadata: PropTypes$1.shape(_objectSpread({}, mediaMetadataShape)),
495
- files: PropTypes$1.objectOf(mediaFile)
496
- };
497
- var media = PropTypes$1.shape(mediaShape);
498
- PropTypes$1.arrayOf(media);
499
- PropTypes$1.oneOf(['image', 'video', 'audio', 'closed-captions', 'font']);
500
- var imageMedia = PropTypes$1.shape(_objectSpread(_objectSpread({}, mediaShape), {}, {
501
- type: PropTypes$1.oneOf(['image', 'video']),
502
- metadata: PropTypes$1.shape(_objectSpread(_objectSpread({}, mediaMetadataShape), {}, {
503
- width: PropTypes$1.number,
504
- height: PropTypes$1.number
505
- }))
506
- }));
507
- PropTypes$1.arrayOf(imageMedia);
508
- var fontMedia = PropTypes$1.shape(_objectSpread(_objectSpread({}, mediaShape), {}, {
509
- type: PropTypes$1.oneOf(['font']),
510
- metadata: PropTypes$1.shape(_objectSpread({}, mediaMetadataShape))
511
- }));
512
- PropTypes$1.arrayOf(fontMedia);
513
- var videoMedia = PropTypes$1.shape(_objectSpread(_objectSpread({}, mediaShape), {}, {
514
- type: PropTypes$1.oneOf(['video']),
515
- metadata: PropTypes$1.shape(_objectSpread(_objectSpread({}, mediaMetadataShape), {}, {
516
- width: PropTypes$1.number,
517
- height: PropTypes$1.number,
518
- duration: PropTypes$1.number
519
- }))
520
- }));
521
- PropTypes$1.arrayOf(videoMedia);
522
- var audioMedia = PropTypes$1.shape(_objectSpread(_objectSpread({}, mediaShape), {}, {
523
- type: PropTypes$1.oneOf(['audio']),
524
- metadata: PropTypes$1.shape(_objectSpread(_objectSpread({}, mediaMetadataShape), {}, {
525
- duration: PropTypes$1.number
526
- }))
527
- }));
528
- PropTypes$1.arrayOf(audioMedia);
529
- var closedCaptionsMedia = PropTypes$1.shape(_objectSpread(_objectSpread({}, mediaShape), {}, {
530
- type: PropTypes$1.oneOf(['closed-captions'])
531
- }));
532
- /**
533
- * Style
534
- */
535
-
536
- var font = PropTypes$1.oneOfType([PropTypes$1.string, PropTypes$1.shape({
537
- type: PropTypes$1.oneOf(['system', 'google', 'custom']),
538
- name: PropTypes$1.string,
539
- media: fontMedia
540
- })]);
541
- PropTypes$1.arrayOf(font);
542
- var textAlign = PropTypes$1.oneOf(['left', 'right', 'center']);
543
- var color = PropTypes$1.shape({
544
- color: PropTypes$1.string,
545
- alpha: PropTypes$1.number
546
- });
547
- var textStyle = PropTypes$1.shape({
548
- fontFamily: font,
549
- fontSize: PropTypes$1.number,
550
- fontStyle: PropTypes$1.shape({
551
- bold: PropTypes$1.bool,
552
- italic: PropTypes$1.bool,
553
- underline: PropTypes$1.bool,
554
- upperCase: PropTypes$1.bool
555
- }),
556
- align: textAlign,
557
- color: color,
558
- letterSpacing: PropTypes$1.number,
559
- lineHeight: PropTypes$1.number
560
- });
561
- var borderTypes = PropTypes$1.oneOf(['dotted', 'dashed', 'solid', 'double', 'groove', 'ridge', 'inset', 'outset', 'hidden']);
562
- var shadowType = PropTypes$1.shape({
563
- shadowDistance: PropTypes$1.number,
564
- shadowBlur: PropTypes$1.number,
565
- shadowColor: color
566
- });
567
- PropTypes$1.shape({
568
- width: PropTypes$1.number,
569
- style: borderTypes,
570
- radius: PropTypes$1.number,
571
- color: color
572
- });
573
- var boxStyle = PropTypes$1.shape({
574
- backgroundColor: color,
575
- borderRadius: PropTypes$1.number,
576
- borderWidth: PropTypes$1.number,
577
- borderColor: color,
578
- borderStyle: borderTypes,
579
- shadow: shadowType
580
- });
581
- PropTypes$1.shape({
582
- top: PropTypes$1.number,
583
- bottom: PropTypes$1.number
584
- });
585
- PropTypes$1.arrayOf(PropTypes$1.shape({
586
- rows: PropTypes$1.oneOfType([PropTypes$1.number, PropTypes$1.arrayOf(PropTypes$1.number)]),
587
- columns: PropTypes$1.oneOfType([PropTypes$1.number, PropTypes$1.arrayOf(PropTypes$1.number)])
588
- }));
589
- var objectFitSize = PropTypes$1.oneOf(['cover', 'contain', null]);
590
- PropTypes$1.shape({
591
- fit: objectFitSize,
592
- horizontalPosition: PropTypes$1.oneOf(['left', 'center', 'right']),
593
- verticalPosition: PropTypes$1.oneOf(['top', 'center', 'bottom'])
594
- });
595
- /**
596
- * Elements
597
- */
598
-
599
- var textElement = PropTypes$1.shape({
600
- body: PropTypes$1.string,
601
- textStyle: textStyle
602
- });
603
- var headingElement = textElement;
604
- PropTypes$1.shape({
605
- label: PropTypes$1.string,
606
- textStyle: textStyle
607
- });
608
- var imageElement = PropTypes$1.shape({
609
- media: imageMedia
610
- });
611
- PropTypes$1.arrayOf(imageElement);
612
- PropTypes$1.shape({
613
- media: videoMedia,
614
- autoPlay: PropTypes$1.bool,
615
- loop: PropTypes$1.bool,
616
- closedCaptions: closedCaptionsMedia,
617
- withSeekBar: PropTypes$1.bool,
618
- withControls: PropTypes$1.bool
619
- });
620
- var visualElement = PropTypes$1.shape({
621
- media: imageMedia
622
- });
623
- PropTypes$1.arrayOf(visualElement);
624
- PropTypes$1.shape({
625
- media: audioMedia,
626
- autoPlay: PropTypes$1.bool,
627
- loop: PropTypes$1.bool,
628
- closedCaptions: closedCaptionsMedia,
629
- withPlayPause: PropTypes$1.bool
630
- });
631
- PropTypes$1.shape({
632
- media: closedCaptionsMedia
633
- });
634
- var backgroundElement = PropTypes$1.shape({
635
- color: color,
636
- image: imageMedia,
637
- video: videoMedia
638
- });
639
- var imageElementWithCaption = PropTypes$1.shape({
640
- image: imageMedia,
641
- caption: textElement
642
- });
643
- PropTypes$1.arrayOf(imageElementWithCaption);
644
- var stackDirection = PropTypes$1.oneOf(['horizontal', 'vertical']);
645
- var stackAlign = PropTypes$1.oneOf(['start', 'center', 'end']);
646
- var stackSpacing = PropTypes$1.oneOfType([PropTypes$1.number, PropTypes$1.oneOf(['between', 'evenly', 'around'])]);
647
- PropTypes$1.shape({
648
- direction: stackDirection,
649
- align: stackAlign,
650
- width: PropTypes$1.number,
651
- height: PropTypes$1.number,
652
- spacing: stackSpacing,
653
- reverse: PropTypes$1.bool
654
- });
655
- PropTypes$1.shape({
656
- layout: PropTypes$1.arrayOf(PropTypes$1.string),
657
- spacing: PropTypes$1.number
658
- });
659
- var geoPosition = PropTypes$1.shape({
660
- lat: PropTypes$1.number,
661
- lng: PropTypes$1.number
662
- });
663
- var markerShape = {
664
- id: PropTypes$1.number,
665
- geoPosition: geoPosition,
666
- title: headingElement,
667
- subtitle: headingElement,
668
- description: textElement
669
- };
670
- var marker = PropTypes$1.shape(_objectSpread({}, markerShape));
671
- PropTypes$1.arrayOf(marker);
672
- var markerWithImage = PropTypes$1.shape(_objectSpread(_objectSpread({}, markerShape), {}, {
673
- image: imageMedia
674
- }));
675
- PropTypes$1.arrayOf(markerWithImage);
676
- var answerShape = {
677
- id: PropTypes$1.string,
678
- label: textElement
679
- };
680
- var answer = PropTypes$1.shape(_objectSpread({}, answerShape));
681
- var quizAnswer = PropTypes$1.shape(_objectSpread(_objectSpread({}, answerShape), {}, {
682
- good: PropTypes$1.bool
683
- }));
684
- PropTypes$1.arrayOf(answer);
685
- PropTypes$1.arrayOf(quizAnswer);
686
- var callToActionTypes = PropTypes$1.oneOf(['swipe-up', 'button']);
687
- PropTypes$1.shape({
688
- active: PropTypes$1.bool,
689
- type: callToActionTypes,
690
- url: PropTypes$1.string,
691
- label: textElement,
692
- buttonStyle: boxStyle
693
- });
694
- var speaker = PropTypes$1.shape({
695
- id: PropTypes$1.string,
696
- name: PropTypes$1.string,
697
- avatar: imageMedia,
698
- side: PropTypes$1.oneOf(['left', 'right']),
699
- color: color
700
- });
701
- var speakers = PropTypes$1.arrayOf(speaker);
702
- var conversationMessage = PropTypes$1.shape({
703
- speaker: PropTypes$1.string,
704
- message: PropTypes$1.string,
705
- image: imageMedia
706
- });
707
- var conversationMessages = PropTypes$1.arrayOf(conversationMessage);
708
- PropTypes$1.shape({
709
- speakers: speakers,
710
- textStyle: textStyle,
711
- messages: conversationMessages
712
- });
713
- /**
714
- * Definitions
715
- */
716
-
717
- var fieldShape = {
718
- name: PropTypes$1.string,
719
- type: PropTypes$1.string.isRequired,
720
- label: text
721
- };
722
- var field = PropTypes$1.shape(_objectSpread(_objectSpread({}, fieldShape), {}, {
723
- isSection: PropTypes$1.bool,
724
- fields: PropTypes$1.arrayOf(PropTypes$1.shape(fieldShape))
725
- }));
726
- var fields = PropTypes$1.arrayOf(field);
727
- var screenDefinition = PropTypes$1.shape({
728
- id: PropTypes$1.string.isRequired,
729
- type: PropTypes$1.oneOf(['screen']).isRequired,
730
- title: text.isRequired,
731
- layouts: PropTypes$1.arrayOf(PropTypes$1.string),
732
- fields: fields
733
- });
734
- PropTypes$1.arrayOf(screenDefinition);
735
- var fieldDefinition = PropTypes$1.shape({
736
- id: PropTypes$1.string.isRequired,
737
- type: PropTypes$1.oneOf(['field']).isRequired,
738
- title: text.isRequired,
739
- fields: fields
740
- });
741
- PropTypes$1.arrayOf(fieldDefinition);
742
- /**
743
- * Components
744
- */
745
-
746
- var storyComponentShape = {
747
- type: PropTypes$1.string.isRequired
748
- };
749
- var storyComponent = PropTypes$1.shape(_objectSpread({}, storyComponentShape));
750
- PropTypes$1.arrayOf(storyComponent);
751
- var screenComponent = PropTypes$1.shape(_objectSpread({}, storyComponentShape));
752
- var screenComponents = PropTypes$1.arrayOf(screenComponent);
753
-
754
- /**
755
- * Theme
756
- */
757
-
758
- var theme = PropTypes$1.shape({
759
- id: PropTypes$1.string,
760
- textStyles: PropTypes$1.objectOf(textStyle),
761
- // renamed to textstyles
762
- background: backgroundElement,
763
- colors: PropTypes$1.objectOf(color),
764
- components: screenComponents
765
- });
766
- var viewerTheme = PropTypes$1.shape(_objectSpread({
767
- logo: imageMedia
768
- }, theme));
769
- /**
770
- * Branding
771
- */
772
- // export const branding = PropTypes.shape({
773
- // logo: imageMedia,
774
- // primaryColor: color,
775
- // secondaryColor: color,
776
- // backgroundColor: color,
777
- // textStyle,
778
- // });
779
-
780
- /**
781
- * Metadata
782
- */
783
-
784
- var metadata = PropTypes$1.shape({
785
- description: PropTypes$1.string,
786
- shareUrl: PropTypes$1.string,
787
- shareImage: imageMedia,
788
- favIcon: imageMedia
789
- });
790
- /**
791
- * Story
792
- */
793
-
794
- PropTypes$1.shape({
795
- id: PropTypes$1.string,
796
- theme: theme,
797
- components: screenComponents,
798
- metadata: metadata
799
- });
800
- /**
801
- * Render
802
- */
803
-
804
- var deviceScreen = PropTypes$1.shape({
805
- name: PropTypes$1.string.isRequired,
806
- mediaQuery: PropTypes$1.string
807
- });
808
- PropTypes$1.arrayOf(deviceScreen);
809
- PropTypes$1.shape({
810
- screen: PropTypes$1.string,
811
- screens: PropTypes$1.arrayOf(PropTypes$1.string),
812
- width: PropTypes$1.number,
813
- height: PropTypes$1.number,
814
- landscape: PropTypes$1.bool
815
- });
816
- PropTypes$1.oneOf(['view', 'placeholder', 'edit', 'preview', 'static', 'capture']);
817
- /**
818
- * Screens
819
- */
820
-
821
- PropTypes$1.shape({
822
- width: PropTypes$1.number,
823
- height: PropTypes$1.number
824
- });
825
- PropTypes$1.shape({
826
- width: PropTypes$1.number,
827
- height: PropTypes$1.number,
828
- url: PropTypes$1.string,
829
- target: target,
830
- iframe: PropTypes$1.string,
831
- image: imageMedia
832
- });
833
- PropTypes$1.shape({
834
- src: PropTypes$1.string,
835
- track: PropTypes$1.string,
836
- trackLng: PropTypes$1.number,
837
- controls: PropTypes$1.bool
838
- });
839
- var slide = PropTypes$1.shape({
840
- image: imageMedia,
841
- text: PropTypes$1.string
842
- });
843
- PropTypes$1.arrayOf(slide); // export const imageStyle = PropTypes.shape({
844
- // alt: PropTypes.string,
845
- // fit: PropTypes.object,
846
- // });
847
-
848
- PropTypes$1.shape({});
849
- /**
850
- * Transitions
851
- */
852
-
853
- var transitionName = PropTypes$1.oneOf(['fade', 'scale', 'slide']);
854
- var transitionParams = {
855
- duration: PropTypes$1.number,
856
- easing: PropTypes$1.oneOf(['ease', 'ease-in', 'ease-out', 'ease-in-out', 'linear'])
857
- };
858
- var transition = PropTypes$1.oneOfType([transitionName.isRequired, PropTypes$1.shape(_objectSpread({
859
- name: transitionName.isRequired
860
- }, transitionParams))]);
861
- PropTypes$1.shape({
862
- "in": transition,
863
- out: transition
864
- });
865
- /**
866
- * Search
867
- */
868
-
869
- var searchFilter = PropTypes$1.shape({
870
- type: PropTypes$1.string,
871
- value: PropTypes$1.oneOf([PropTypes$1.string, PropTypes$1.number])
872
- });
873
- PropTypes$1.arrayOf(searchFilter);
874
- /**
875
- * Payments
876
- */
877
-
878
- var paymentItem = PropTypes$1.shape({
879
- id: PropTypes$1.oneOfType([PropTypes$1.string, PropTypes$1.number]),
880
- date: PropTypes$1.string,
881
- type: PropTypes$1.string,
882
- invoice_link: PropTypes$1.string,
883
- amount: PropTypes$1.oneOfType([PropTypes$1.string, PropTypes$1.number])
884
- });
885
- PropTypes$1.arrayOf(paymentItem);
886
- /**
887
- * Page Metadada
888
- */
889
-
890
- var pageMetadata = PropTypes$1.shape({
891
- canonical: PropTypes$1.string,
892
- description: PropTypes$1.string,
893
- keywords: PropTypes$1.oneOfType([PropTypes$1.string, PropTypes$1.array]),
894
- image: PropTypes$1.shape({
895
- url: PropTypes$1.string
896
- }),
897
- favicon: PropTypes$1.shape({
898
- url: PropTypes$1.string
899
- }),
900
- rssUrl: PropTypes$1.string,
901
- atomUrl: PropTypes$1.string,
902
- microformats: PropTypes$1.arrayOf(PropTypes$1.shape({}))
903
- });
904
- PropTypes$1.shape({
905
- name: textElement,
906
- avatar: PropTypes$1.shape({
907
- url: PropTypes$1.string
908
- })
909
- });
910
- PropTypes$1.shape({
911
- id: PropTypes$1.oneOfType([PropTypes$1.string, PropTypes$1.number]),
912
- name: PropTypes$1.string
913
- });
914
-
915
- var _excluded$8 = ["className", "onClick", "theme"];
916
- var propTypes$J = {
917
- className: PropTypes$1.string,
918
- onClick: PropTypes$1.func,
919
- theme: viewerTheme
920
- };
921
- var defaultProps$J = {
922
- className: null,
923
- onClick: null,
924
- theme: null
925
- };
926
-
927
- var CloseButton = function CloseButton(_ref) {
928
- var className = _ref.className,
929
- onClick = _ref.onClick;
930
- _ref.theme;
931
- var props = _objectWithoutProperties(_ref, _excluded$8);
932
-
933
- var intl = useIntl();
934
- return /*#__PURE__*/React.createElement(IconButton, Object.assign({
935
- className: classNames([_defineProperty({}, className, className !== null)]),
936
- label: intl.formatMessage({
937
- id: "dj/p/q",
938
- defaultMessage: [{
939
- "type": 0,
940
- "value": "Close"
941
- }]
942
- }),
943
- icon: /*#__PURE__*/React.createElement("svg", {
944
- xmlns: "http://www.w3.org/2000/svg",
945
- width: "10",
946
- height: "16",
947
- viewBox: "0 0 10 16",
948
- fill: "currentColor"
949
- }, /*#__PURE__*/React.createElement("polygon", {
950
- points: "9.95 4.11 8.89 3.05 5 6.94 1.11 3.05 0.05 4.11 3.94 8 0.05 11.89 1.11 12.95 5 9.06 8.89 12.95 9.95 11.89 6.06 8 9.95 4.11"
951
- })),
952
- onClick: onClick
953
- }, props));
954
- };
955
-
956
- CloseButton.propTypes = propTypes$J;
957
- CloseButton.defaultProps = defaultProps$J;
958
-
959
- var styles$v = {"container":"micromag-core-buttons-sliding-buttons-container","additional":"micromag-core-buttons-sliding-buttons-additional"};
960
-
961
- var propTypes$I = {
962
- className: PropTypes$1.string,
963
- current: PropTypes$1.number,
964
- buttons: PropTypes$1.arrayOf(PropTypes$1.node),
965
- buttonsProps: PropTypes$1.arrayOf(PropTypes$1.objectOf(PropTypes$1.any)) // eslint-disable-line
966
-
967
- };
968
- var defaultProps$I = {
969
- className: null,
970
- current: 0,
971
- buttons: null,
972
- buttonsProps: null
973
- };
974
-
975
- var SlidingButtons = function SlidingButtons(_ref) {
976
- var className = _ref.className,
977
- current = _ref.current,
978
- buttons = _ref.buttons,
979
- buttonsProps = _ref.buttonsProps;
980
- if (buttons === null) return false;
981
-
982
- var getSlidingButtonStyles = function getSlidingButtonStyles(p, i) {
983
- var t = i - p;
984
- return {
985
- transform: "translateY(".concat(t * -100, "%)")
986
- };
987
- };
988
-
989
- return /*#__PURE__*/React.createElement("div", {
990
- className: classNames([styles$v.container, _defineProperty({}, className, className !== null)])
991
- }, buttons.map(function (b, i) {
992
- var SlidingButton = b;
993
- var buttonProps = buttonsProps[i] || {};
994
- var extraProps = buttonsProps !== null ? buttonProps : null;
995
-
996
- var _ref3 = extraProps || {},
997
- _ref3$className = _ref3.className,
998
- extraClassNames = _ref3$className === void 0 ? null : _ref3$className;
999
-
1000
- return /*#__PURE__*/React.createElement(SlidingButton, Object.assign({}, extraProps, {
1001
- className: classNames([styles$v.icon, extraClassNames, _defineProperty({}, styles$v.additional, i > 0)]),
1002
- style: getSlidingButtonStyles(current, i)
1003
- }));
1004
- }));
1005
- };
1006
-
1007
- SlidingButtons.propTypes = propTypes$I;
1008
- SlidingButtons.defaultProps = defaultProps$I;
1009
-
1010
- var styles$u = {"actions":"micromag-core-forms-form-actions","left":"micromag-core-forms-form-left","right":"micromag-core-forms-form-right"};
1011
-
1012
- var _excluded$7 = ["type"],
1013
- _excluded2 = ["component", "id", "settings"];
1014
- var propTypes$H = {
1015
- name: PropTypes$1.string,
1016
- // .isRequired,
1017
- value: PropTypes.component,
1018
- form: PropTypes$1.string,
1019
- formComponents: PropTypes.components,
1020
- fields: PropTypes.fields,
1021
- className: PropTypes$1.string,
1022
- onChange: PropTypes$1.func,
1023
- gotoFieldForm: PropTypes$1.func.isRequired,
1024
- closeFieldForm: PropTypes$1.func.isRequired,
1025
- fieldContext: PropTypes$1.any // eslint-disable-line react/forbid-prop-types
1026
-
1027
- };
1028
- var defaultProps$H = {
1029
- name: null,
1030
- form: null,
1031
- formComponents: {},
1032
- fields: [],
1033
- value: null,
1034
- className: null,
1035
- onChange: null,
1036
- fieldContext: null
1037
- };
1038
-
1039
- var FieldForm = function FieldForm(_ref) {
1040
- var name = _ref.name,
1041
- value = _ref.value,
1042
- form = _ref.form,
1043
- formComponents = _ref.formComponents,
1044
- fields = _ref.fields,
1045
- className = _ref.className,
1046
- onChange = _ref.onChange,
1047
- gotoFieldForm = _ref.gotoFieldForm,
1048
- closeFieldForm = _ref.closeFieldForm,
1049
- fieldContext = _ref.fieldContext;
1050
- var fieldsManager = useFieldsManager();
1051
- var field = getFieldFromPath(name.split('.'), fields, fieldsManager);
1052
-
1053
- var _ref2 = field || {},
1054
- _ref2$type = _ref2.type,
1055
- type = _ref2$type === void 0 ? null : _ref2$type,
1056
- fieldProps = _objectWithoutProperties(_ref2, _excluded$7);
1057
-
1058
- var fieldDefinition = fieldsManager.getDefinition(type) || null;
1059
-
1060
- var fieldData = fieldDefinition || _objectSpread({}, field);
1061
-
1062
- var _ref3 = fieldData || {},
1063
- _ref3$component = _ref3.component,
1064
- fieldComponent = _ref3$component === void 0 ? null : _ref3$component;
1065
- _ref3.id;
1066
- _ref3.settings;
1067
- var definitionProps = _objectWithoutProperties(_ref3, _excluded2);
1068
-
1069
- var FieldComponent = useFieldComponent(fieldComponent);
1070
- var FormComponent = getComponentFromName(form, formComponents);
1071
- var fieldValue = get(value, name, null);
1072
-
1073
- var onFieldChange = function onFieldChange(newFieldValue) {
1074
- // const { name, fields: subFields = null } = field || {};
1075
- var newValue = setFieldValue(value, name.split('.'), newFieldValue // field === null || subFields !== null ? newFieldValue : newFieldValue[name],
1076
- );
1077
-
1078
- if (onChange !== null) {
1079
- onChange(newValue);
1080
- }
1081
- };
1082
-
1083
- var closeForm = useCallback(function () {
1084
- return closeFieldForm(name, form);
1085
- }, [name, form, closeFieldForm]);
1086
- var formProps = {
1087
- name: name,
1088
- value: fieldValue,
1089
- onChange: onFieldChange,
1090
- gotoFieldForm: gotoFieldForm,
1091
- closeFieldForm: closeFieldForm,
1092
- closeForm: closeForm
1093
- };
1094
-
1095
- if (form !== null) {
1096
- return FormComponent !== null ? /*#__PURE__*/React.createElement(FieldContextProvider, {
1097
- context: fieldContext
1098
- }, /*#__PURE__*/React.createElement(FormComponent, Object.assign({
1099
- field: field
1100
- }, formProps, {
1101
- className: className
1102
- }))) : null;
1103
- } // Use field component with isForm props
1104
-
1105
-
1106
- return FieldComponent !== null ? /*#__PURE__*/React.createElement(FieldContextProvider, {
1107
- context: fieldContext
1108
- }, /*#__PURE__*/React.createElement(FieldComponent, Object.assign({
1109
- className: className
1110
- }, definitionProps, fieldProps, {
1111
- isForm: true
1112
- }, formProps))) : null;
392
+ var closeForm = useCallback(function () {
393
+ return closeFieldForm(name, form);
394
+ }, [name, form, closeFieldForm]);
395
+ var formProps = {
396
+ name: name,
397
+ value: fieldValue,
398
+ onChange: onFieldChange,
399
+ gotoFieldForm: gotoFieldForm,
400
+ closeFieldForm: closeFieldForm,
401
+ closeForm: closeForm
402
+ };
403
+
404
+ if (form !== null) {
405
+ return FormComponent !== null ? /*#__PURE__*/React.createElement(FieldContextProvider, {
406
+ context: fieldContext
407
+ }, /*#__PURE__*/React.createElement(FormComponent, Object.assign({
408
+ field: field
409
+ }, formProps, {
410
+ className: className
411
+ }))) : null;
412
+ } // Use field component with isForm props
413
+
414
+
415
+ return FieldComponent !== null ? /*#__PURE__*/React.createElement(FieldContextProvider, {
416
+ context: fieldContext
417
+ }, /*#__PURE__*/React.createElement(FieldComponent, Object.assign({
418
+ className: className
419
+ }, definitionProps, fieldProps, {
420
+ isForm: true
421
+ }, formProps))) : null;
1113
422
  };
1114
423
 
1115
424
  FieldForm.propTypes = propTypes$H;
@@ -2914,237 +2223,789 @@ var PlaceholderBlock = function PlaceholderBlock(_ref) {
2914
2223
  PlaceholderBlock.propTypes = propTypes$i;
2915
2224
  PlaceholderBlock.defaultProps = defaultProps$i;
2916
2225
 
2917
- /* eslint-disable react/jsx-props-no-spreading */
2226
+ /* eslint-disable react/jsx-props-no-spreading */
2227
+
2228
+ var propTypes$h = {
2229
+ name: PropTypes$1.string.isRequired,
2230
+ components: PropTypes$1.object.isRequired,
2231
+ // eslint-disable-line
2232
+ props: PropTypes$1.object,
2233
+ // eslint-disable-line
2234
+ isPlaceholder: PropTypes$1.bool,
2235
+ className: PropTypes$1.string,
2236
+ placeholderProps: PropTypes$1.object // eslint-disable-line
2237
+
2238
+ };
2239
+ var defaultProps$h = {
2240
+ props: {},
2241
+ isPlaceholder: false,
2242
+ className: null,
2243
+ placeholderProps: null
2244
+ };
2245
+
2246
+ var ElementComponent = function ElementComponent(_ref) {
2247
+ var name = _ref.name,
2248
+ components = _ref.components,
2249
+ props = _ref.props,
2250
+ isPlaceholder = _ref.isPlaceholder,
2251
+ className = _ref.className,
2252
+ placeholderProps = _ref.placeholderProps;
2253
+
2254
+ if (!name) {
2255
+ return 'Bad component name';
2256
+ }
2257
+
2258
+ if (isPlaceholder) {
2259
+ // TODO: figure out what this did
2260
+ // const PlaceholderComponent = Placeholders[pascalCase(name)];
2261
+ return /*#__PURE__*/React.createElement(PlaceholderBlock, placeholderProps);
2262
+ }
2263
+
2264
+ var RealComponent = components[pascalCase(name)];
2265
+
2266
+ if (!RealComponent) {
2267
+ return 'Bad component';
2268
+ }
2269
+
2270
+ return /*#__PURE__*/React.createElement(RealComponent, Object.assign({}, props, {
2271
+ className: className
2272
+ }));
2273
+ };
2274
+
2275
+ ElementComponent.propTypes = propTypes$h;
2276
+ ElementComponent.defaultProps = defaultProps$h;
2277
+
2278
+ var styles$g = {"container":"micromag-core-partials-empty-container","middle":"micromag-core-partials-empty-middle","withoutBorder":"micromag-core-partials-empty-withoutBorder","invertColor":"micromag-core-partials-empty-invertColor"};
2279
+
2280
+ var propTypes$g = {
2281
+ children: PropTypes$1.node,
2282
+ withoutBorder: PropTypes$1.bool,
2283
+ light: PropTypes$1.bool,
2284
+ className: PropTypes$1.string
2285
+ };
2286
+ var defaultProps$g = {
2287
+ children: null,
2288
+ withoutBorder: false,
2289
+ light: false,
2290
+ className: null
2291
+ };
2292
+
2293
+ var Empty = function Empty(_ref) {
2294
+ var _ref2;
2295
+
2296
+ var children = _ref.children,
2297
+ withoutBorder = _ref.withoutBorder,
2298
+ light = _ref.light,
2299
+ className = _ref.className;
2300
+ return /*#__PURE__*/React.createElement("div", {
2301
+ className: classNames([styles$g.container, (_ref2 = {}, _defineProperty(_ref2, styles$g.withoutBorder, withoutBorder), _defineProperty(_ref2, styles$g.light, light), _defineProperty(_ref2, className, className), _ref2)])
2302
+ }, /*#__PURE__*/React.createElement("div", {
2303
+ className: styles$g.middle
2304
+ }, /*#__PURE__*/React.createElement(Label, null, children)));
2305
+ };
2306
+
2307
+ Empty.propTypes = propTypes$g;
2308
+ Empty.defaultProps = defaultProps$g;
2309
+
2310
+ var getUrlsFromMedia = function getUrlsFromMedia(media, formats) {
2311
+ var _ref = media || {},
2312
+ _ref$files = _ref.files,
2313
+ files = _ref$files === void 0 ? {} : _ref$files;
2314
+
2315
+ var _ref2 = files || {},
2316
+ _ref2$original = _ref2.original,
2317
+ originalFile = _ref2$original === void 0 ? null : _ref2$original;
2318
+
2319
+ var _ref3 = originalFile || {},
2320
+ _ref3$name = _ref3.name,
2321
+ originalName = _ref3$name === void 0 ? null : _ref3$name,
2322
+ _ref3$mime = _ref3.mime,
2323
+ originalMime = _ref3$mime === void 0 ? null : _ref3$mime;
2324
+
2325
+ var urls = formats.reduce(function (currentUrls, format) {
2326
+ var finalFormat = isObject(format) ? format.format : format;
2327
+ var formatExtension = isObject(format) ? format.name : format;
2328
+ var file = files["webfonts.".concat(formatExtension)] || files[formatExtension] || null;
2329
+
2330
+ if (file !== null) {
2331
+ return [].concat(_toConsumableArray(currentUrls), ["url(\"".concat(file.url, "?\") format(\"").concat(finalFormat, "\")")]);
2332
+ }
2333
+
2334
+ var extensionRegExp = new RegExp(".".concat(formatExtension, "$"), 'i');
2335
+ var mimeRegExp = new RegExp("".concat(finalFormat), 'i');
2336
+
2337
+ if (originalName !== null && originalName.match(extensionRegExp) !== null || originalMime !== null && originalMime.match(mimeRegExp) !== null) {
2338
+ return [].concat(_toConsumableArray(currentUrls), ["url(\"".concat(originalFile.url, "?\") format(\"").concat(finalFormat, "\")")]);
2339
+ }
2340
+
2341
+ return currentUrls;
2342
+ }, []);
2343
+ return urls;
2344
+ };
2345
+
2346
+ var propTypes$f = {
2347
+ fonts: PropTypes.fonts,
2348
+ formats: PropTypes$1.arrayOf(PropTypes$1.oneOfType([PropTypes$1.string, PropTypes$1.shape({
2349
+ name: PropTypes$1.string,
2350
+ format: PropTypes$1.string
2351
+ })]))
2352
+ };
2353
+ var defaultProps$f = {
2354
+ fonts: [],
2355
+ formats: ['eot', 'woff2', 'woff', {
2356
+ name: 'otf',
2357
+ format: 'opentype'
2358
+ }, {
2359
+ name: 'ttf',
2360
+ format: 'truetype'
2361
+ }, 'svg']
2362
+ };
2363
+
2364
+ var FontFaces = function FontFaces(_ref4) {
2365
+ var fonts = _ref4.fonts,
2366
+ formats = _ref4.formats;
2367
+ var fontFaces = (fonts || []).filter(function (it) {
2368
+ return isObject(it) && it.type === 'custom' && (it.media || null) !== null;
2369
+ }).reduce(function (fontFontFaces, _ref5) {
2370
+ var _ref5$name = _ref5.name,
2371
+ name = _ref5$name === void 0 ? null : _ref5$name,
2372
+ _ref5$media = _ref5.media,
2373
+ media = _ref5$media === void 0 ? null : _ref5$media,
2374
+ _ref5$variants = _ref5.variants,
2375
+ variants = _ref5$variants === void 0 ? [] : _ref5$variants;
2376
+
2377
+ if (name === null) {
2378
+ return fontFontFaces;
2379
+ }
2380
+
2381
+ var urls = media !== null ? getUrlsFromMedia(media, formats) : null;
2382
+ return [].concat(_toConsumableArray(fontFontFaces), [urls !== null && urls.length > 0 ? "\n @font-face {\n font-family: \"".concat(name, "\";\n src: ").concat(urls.join(','), ";\n }\n ") : null], _toConsumableArray((variants || []).map(function (_ref6) {
2383
+ var weight = _ref6.weight,
2384
+ style = _ref6.style,
2385
+ _ref6$media = _ref6.media,
2386
+ variantMedia = _ref6$media === void 0 ? null : _ref6$media;
2387
+
2388
+ if (variantMedia == null) {
2389
+ return null;
2390
+ }
2391
+
2392
+ var variantUrls = getUrlsFromMedia(variantMedia, formats);
2393
+ return 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;
2394
+ })));
2395
+ }, []).filter(function (it) {
2396
+ return it !== null;
2397
+ });
2398
+ return fontFaces.length > 0 ? /*#__PURE__*/React.createElement("style", {
2399
+ type: "text/css"
2400
+ }, fontFaces.join('\n')) : null;
2401
+ };
2402
+
2403
+ FontFaces.propTypes = propTypes$f;
2404
+ FontFaces.defaultProps = defaultProps$f;
2918
2405
 
2919
- var propTypes$h = {
2920
- name: PropTypes$1.string.isRequired,
2921
- components: PropTypes$1.object.isRequired,
2922
- // eslint-disable-line
2923
- props: PropTypes$1.object,
2924
- // eslint-disable-line
2925
- isPlaceholder: PropTypes$1.bool,
2926
- className: PropTypes$1.string,
2927
- placeholderProps: PropTypes$1.object // eslint-disable-line
2406
+ var styles$f = {};
2928
2407
 
2408
+ var propTypes$e = {
2409
+ thumbnail: PropTypes$1.node,
2410
+ thumbnailAlign: PropTypes$1.oneOf(['top', 'center', 'bottom']),
2411
+ children: PropTypes$1.node,
2412
+ title: PropTypes.label,
2413
+ className: PropTypes$1.string,
2414
+ thumbnailClassName: PropTypes$1.string,
2415
+ bodyClassName: PropTypes$1.string,
2416
+ titleClassName: PropTypes$1.string
2929
2417
  };
2930
- var defaultProps$h = {
2931
- props: {},
2932
- isPlaceholder: false,
2418
+ var defaultProps$e = {
2419
+ thumbnail: null,
2420
+ thumbnailAlign: 'top',
2421
+ children: null,
2422
+ title: null,
2933
2423
  className: null,
2934
- placeholderProps: null
2424
+ thumbnailClassName: null,
2425
+ bodyClassName: null,
2426
+ titleClassName: null
2935
2427
  };
2936
2428
 
2937
- var ElementComponent = function ElementComponent(_ref) {
2938
- var name = _ref.name,
2939
- components = _ref.components,
2940
- props = _ref.props,
2941
- isPlaceholder = _ref.isPlaceholder,
2429
+ var Media = function Media(_ref) {
2430
+ var thumbnail = _ref.thumbnail,
2431
+ thumbnailAlign = _ref.thumbnailAlign,
2432
+ children = _ref.children,
2433
+ title = _ref.title,
2942
2434
  className = _ref.className,
2943
- placeholderProps = _ref.placeholderProps;
2944
-
2945
- if (!name) {
2946
- return 'Bad component name';
2947
- }
2435
+ thumbnailClassName = _ref.thumbnailClassName,
2436
+ bodyClassName = _ref.bodyClassName,
2437
+ titleClassName = _ref.titleClassName;
2438
+ return /*#__PURE__*/React.createElement("div", {
2439
+ className: classNames(['card', styles$f.container, _defineProperty({}, className, className !== null)])
2440
+ }, typeof thumbnail === 'string' ? /*#__PURE__*/React.createElement("img", {
2441
+ src: thumbnail,
2442
+ alt: title,
2443
+ className: classNames(['me-3', styles$f.thumbnail, _defineProperty({
2444
+ 'align-self-start': thumbnailAlign === 'top',
2445
+ 'align-self-center': thumbnailAlign === 'center',
2446
+ 'align-self-end': thumbnailAlign === 'bottom'
2447
+ }, thumbnailClassName, thumbnailClassName !== null)])
2448
+ }) : thumbnail, title !== null || children !== null ? /*#__PURE__*/React.createElement("div", {
2449
+ className: classNames(['card-body', styles$f.body, _defineProperty({}, bodyClassName, bodyClassName !== null)])
2450
+ }, title !== null ? /*#__PURE__*/React.createElement("h5", {
2451
+ className: classNames(['mt-0', 'text-truncate', styles$f.title, _defineProperty({}, titleClassName, titleClassName !== null)])
2452
+ }, /*#__PURE__*/React.createElement(Label, null, title)) : null, children) : null);
2453
+ };
2948
2454
 
2949
- if (isPlaceholder) {
2950
- // TODO: figure out what this did
2951
- // const PlaceholderComponent = Placeholders[pascalCase(name)];
2952
- return /*#__PURE__*/React.createElement(PlaceholderBlock, placeholderProps);
2953
- }
2455
+ Media.propTypes = propTypes$e;
2456
+ Media.defaultProps = defaultProps$e;
2954
2457
 
2955
- var RealComponent = components[pascalCase(name)];
2458
+ /**
2459
+ * Core
2460
+ */
2956
2461
 
2957
- if (!RealComponent) {
2958
- return 'Bad component';
2959
- }
2462
+ PropTypes$1.shape({
2463
+ listen: PropTypes$1.func.isRequired,
2464
+ push: PropTypes$1.func.isRequired
2465
+ });
2466
+ PropTypes$1.shape({
2467
+ pathname: PropTypes$1.string,
2468
+ search: PropTypes$1.string
2469
+ });
2470
+ PropTypes$1.shape({
2471
+ locale: PropTypes$1.string.isRequired,
2472
+ formatMessage: PropTypes$1.func.isRequired
2473
+ });
2474
+ var defaultMessageContent = PropTypes$1.shape({
2475
+ type: PropTypes$1.number,
2476
+ value: PropTypes$1.string
2477
+ });
2478
+ var defaultMessage = PropTypes$1.oneOfType([PropTypes$1.string, PropTypes$1.arrayOf(defaultMessageContent)]);
2479
+ var message = PropTypes$1.shape({
2480
+ id: PropTypes$1.string,
2481
+ defaultMessage: defaultMessage.isRequired,
2482
+ description: PropTypes$1.string
2483
+ });
2484
+ var text = PropTypes$1.oneOfType([message, PropTypes$1.string]);
2485
+ var label = PropTypes$1.oneOfType([message, PropTypes$1.node]);
2486
+ PropTypes$1.oneOf([401, 403, 404, 500]);
2487
+ PropTypes$1.oneOfType([PropTypes$1.shape({
2488
+ current: PropTypes$1.any // eslint-disable-line react/forbid-prop-types
2960
2489
 
2961
- return /*#__PURE__*/React.createElement(RealComponent, Object.assign({}, props, {
2962
- className: className
2963
- }));
2964
- };
2490
+ }), PropTypes$1.func]);
2491
+ var target = PropTypes$1.oneOf(['_blank', '_self', '_parent']);
2492
+ var interaction = PropTypes$1.oneOf(['tap', 'swipe']);
2493
+ PropTypes$1.arrayOf(interaction);
2494
+ PropTypes$1.objectOf(PropTypes$1.oneOfType([PropTypes$1.string, PropTypes$1.number, PropTypes$1.array]));
2495
+ PropTypes$1.shape({
2496
+ currentTime: PropTypes$1.number,
2497
+ duration: PropTypes$1.number
2498
+ });
2499
+ /**
2500
+ * Site
2501
+ */
2965
2502
 
2966
- ElementComponent.propTypes = propTypes$h;
2967
- ElementComponent.defaultProps = defaultProps$h;
2503
+ PropTypes$1.shape({
2504
+ id: PropTypes$1.number,
2505
+ firstname: PropTypes$1.string,
2506
+ lastname: PropTypes$1.string,
2507
+ email: PropTypes$1.string,
2508
+ gender: PropTypes$1.string,
2509
+ birthdate: PropTypes$1.string
2510
+ });
2511
+ var menuItem = PropTypes$1.shape({
2512
+ id: PropTypes$1.oneOfType([PropTypes$1.number, PropTypes$1.string]),
2513
+ label: label,
2514
+ url: PropTypes$1.string,
2515
+ external: PropTypes$1.bool,
2516
+ active: PropTypes$1.bool
2517
+ });
2518
+ PropTypes$1.arrayOf(menuItem);
2519
+ var breadcrumb = PropTypes$1.shape({
2520
+ label: label,
2521
+ url: PropTypes$1.string
2522
+ });
2523
+ PropTypes$1.arrayOf(breadcrumb);
2524
+ var device = PropTypes$1.shape({
2525
+ id: PropTypes$1.string.isRequired
2526
+ });
2527
+ PropTypes$1.arrayOf(device);
2528
+ var modal = PropTypes$1.shape({
2529
+ id: PropTypes$1.string.isRequired
2530
+ });
2531
+ PropTypes$1.arrayOf(modal);
2532
+ var panel = PropTypes$1.shape({
2533
+ id: PropTypes$1.string.isRequired
2534
+ });
2535
+ PropTypes$1.arrayOf(panel);
2536
+ var button = PropTypes$1.shape({
2537
+ label: label,
2538
+ onClick: PropTypes$1.func
2539
+ });
2540
+ PropTypes$1.arrayOf(button);
2541
+ var bootstrapThemeStrings = ['primary', 'secondary', 'success', 'danger', 'warning', 'info', 'light', 'dark'];
2542
+ PropTypes$1.oneOf(bootstrapThemeStrings);
2543
+ PropTypes$1.oneOf([].concat(bootstrapThemeStrings, ['outline-primary', 'outline-secondary', 'outline-success', 'outline-danger', 'outline-warning', 'outline-info', 'outline-light', 'outline-dark', 'outline-link', null]));
2544
+ PropTypes$1.oneOf(['lg', 'sm', null]);
2545
+ PropTypes$1.oneOf(['lg', 'sm', null]);
2546
+ PropTypes$1.oneOf(['start', 'end']);
2547
+ var component = PropTypes$1.oneOfType([PropTypes$1.object, PropTypes$1.func]);
2548
+ PropTypes$1.objectOf(component);
2549
+ /**
2550
+ * Forms
2551
+ */
2968
2552
 
2969
- var styles$g = {"container":"micromag-core-partials-empty-container","middle":"micromag-core-partials-empty-middle","withoutBorder":"micromag-core-partials-empty-withoutBorder","invertColor":"micromag-core-partials-empty-invertColor"};
2553
+ var errors = PropTypes$1.oneOfType([PropTypes$1.string, PropTypes$1.arrayOf(PropTypes$1.string)]);
2554
+ PropTypes$1.objectOf(errors);
2555
+ var selectOption = PropTypes$1.oneOfType([PropTypes$1.string, PropTypes$1.shape({
2556
+ value: PropTypes$1.any,
2557
+ // eslint-disable-line
2558
+ label: label
2559
+ })]);
2560
+ PropTypes$1.arrayOf(selectOption);
2561
+ var formField = PropTypes$1.shape({
2562
+ name: PropTypes$1.string,
2563
+ component: component
2564
+ });
2565
+ PropTypes$1.arrayOf(formField);
2566
+ /**
2567
+ * Medias
2568
+ */
2970
2569
 
2971
- var propTypes$g = {
2972
- children: PropTypes$1.node,
2973
- withoutBorder: PropTypes$1.bool,
2974
- light: PropTypes$1.bool,
2975
- className: PropTypes$1.string
2570
+ var mediaMetadataShape = {
2571
+ filename: PropTypes$1.string,
2572
+ size: PropTypes$1.number,
2573
+ mime: PropTypes$1.string
2976
2574
  };
2977
- var defaultProps$g = {
2978
- children: null,
2979
- withoutBorder: false,
2980
- light: false,
2981
- className: null
2575
+ var mediaFile = PropTypes$1.shape({
2576
+ id: PropTypes$1.string,
2577
+ handle: PropTypes$1.string,
2578
+ type: PropTypes$1.string,
2579
+ mime: PropTypes$1.string,
2580
+ url: PropTypes$1.string
2581
+ });
2582
+ var mediaShape = {
2583
+ id: PropTypes$1.string,
2584
+ type: PropTypes$1.string.isRequired,
2585
+ url: PropTypes$1.string,
2586
+ // .isRequired,
2587
+ thumbnail_url: PropTypes$1.string,
2588
+ name: PropTypes$1.string,
2589
+ metadata: PropTypes$1.shape(_objectSpread({}, mediaMetadataShape)),
2590
+ files: PropTypes$1.objectOf(mediaFile)
2982
2591
  };
2592
+ var media = PropTypes$1.shape(mediaShape);
2593
+ PropTypes$1.arrayOf(media);
2594
+ PropTypes$1.oneOf(['image', 'video', 'audio', 'closed-captions', 'font']);
2595
+ var imageMedia = PropTypes$1.shape(_objectSpread(_objectSpread({}, mediaShape), {}, {
2596
+ type: PropTypes$1.oneOf(['image', 'video']),
2597
+ metadata: PropTypes$1.shape(_objectSpread(_objectSpread({}, mediaMetadataShape), {}, {
2598
+ width: PropTypes$1.number,
2599
+ height: PropTypes$1.number
2600
+ }))
2601
+ }));
2602
+ PropTypes$1.arrayOf(imageMedia);
2603
+ var fontMedia = PropTypes$1.shape(_objectSpread(_objectSpread({}, mediaShape), {}, {
2604
+ type: PropTypes$1.oneOf(['font']),
2605
+ metadata: PropTypes$1.shape(_objectSpread({}, mediaMetadataShape))
2606
+ }));
2607
+ PropTypes$1.arrayOf(fontMedia);
2608
+ var videoMedia = PropTypes$1.shape(_objectSpread(_objectSpread({}, mediaShape), {}, {
2609
+ type: PropTypes$1.oneOf(['video']),
2610
+ metadata: PropTypes$1.shape(_objectSpread(_objectSpread({}, mediaMetadataShape), {}, {
2611
+ width: PropTypes$1.number,
2612
+ height: PropTypes$1.number,
2613
+ duration: PropTypes$1.number
2614
+ }))
2615
+ }));
2616
+ PropTypes$1.arrayOf(videoMedia);
2617
+ var audioMedia = PropTypes$1.shape(_objectSpread(_objectSpread({}, mediaShape), {}, {
2618
+ type: PropTypes$1.oneOf(['audio']),
2619
+ metadata: PropTypes$1.shape(_objectSpread(_objectSpread({}, mediaMetadataShape), {}, {
2620
+ duration: PropTypes$1.number
2621
+ }))
2622
+ }));
2623
+ PropTypes$1.arrayOf(audioMedia);
2624
+ var closedCaptionsMedia = PropTypes$1.shape(_objectSpread(_objectSpread({}, mediaShape), {}, {
2625
+ type: PropTypes$1.oneOf(['closed-captions'])
2626
+ }));
2627
+ /**
2628
+ * Style
2629
+ */
2983
2630
 
2984
- var Empty = function Empty(_ref) {
2985
- var _ref2;
2631
+ var font = PropTypes$1.oneOfType([PropTypes$1.string, PropTypes$1.shape({
2632
+ type: PropTypes$1.oneOf(['system', 'google', 'custom']),
2633
+ name: PropTypes$1.string,
2634
+ media: fontMedia
2635
+ })]);
2636
+ PropTypes$1.arrayOf(font);
2637
+ var textAlign = PropTypes$1.oneOf(['left', 'right', 'center']);
2638
+ var color = PropTypes$1.shape({
2639
+ color: PropTypes$1.string,
2640
+ alpha: PropTypes$1.number
2641
+ });
2642
+ var textStyle = PropTypes$1.shape({
2643
+ fontFamily: font,
2644
+ fontSize: PropTypes$1.number,
2645
+ fontStyle: PropTypes$1.shape({
2646
+ bold: PropTypes$1.bool,
2647
+ italic: PropTypes$1.bool,
2648
+ underline: PropTypes$1.bool,
2649
+ upperCase: PropTypes$1.bool
2650
+ }),
2651
+ align: textAlign,
2652
+ color: color,
2653
+ letterSpacing: PropTypes$1.number,
2654
+ lineHeight: PropTypes$1.number
2655
+ });
2656
+ var borderTypes = PropTypes$1.oneOf(['dotted', 'dashed', 'solid', 'double', 'groove', 'ridge', 'inset', 'outset', 'hidden']);
2657
+ var shadowType = PropTypes$1.shape({
2658
+ shadowDistance: PropTypes$1.number,
2659
+ shadowBlur: PropTypes$1.number,
2660
+ shadowColor: color
2661
+ });
2662
+ PropTypes$1.shape({
2663
+ width: PropTypes$1.number,
2664
+ style: borderTypes,
2665
+ radius: PropTypes$1.number,
2666
+ color: color
2667
+ });
2668
+ var boxStyle = PropTypes$1.shape({
2669
+ backgroundColor: color,
2670
+ borderRadius: PropTypes$1.number,
2671
+ borderWidth: PropTypes$1.number,
2672
+ borderColor: color,
2673
+ borderStyle: borderTypes,
2674
+ shadow: shadowType
2675
+ });
2676
+ PropTypes$1.shape({
2677
+ top: PropTypes$1.number,
2678
+ bottom: PropTypes$1.number
2679
+ });
2680
+ PropTypes$1.arrayOf(PropTypes$1.shape({
2681
+ rows: PropTypes$1.oneOfType([PropTypes$1.number, PropTypes$1.arrayOf(PropTypes$1.number)]),
2682
+ columns: PropTypes$1.oneOfType([PropTypes$1.number, PropTypes$1.arrayOf(PropTypes$1.number)])
2683
+ }));
2684
+ var objectFitSize = PropTypes$1.oneOf(['cover', 'contain', null]);
2685
+ PropTypes$1.shape({
2686
+ fit: objectFitSize,
2687
+ horizontalPosition: PropTypes$1.oneOf(['left', 'center', 'right']),
2688
+ verticalPosition: PropTypes$1.oneOf(['top', 'center', 'bottom'])
2689
+ });
2690
+ /**
2691
+ * Elements
2692
+ */
2986
2693
 
2987
- var children = _ref.children,
2988
- withoutBorder = _ref.withoutBorder,
2989
- light = _ref.light,
2990
- className = _ref.className;
2991
- return /*#__PURE__*/React.createElement("div", {
2992
- className: classNames([styles$g.container, (_ref2 = {}, _defineProperty(_ref2, styles$g.withoutBorder, withoutBorder), _defineProperty(_ref2, styles$g.light, light), _defineProperty(_ref2, className, className), _ref2)])
2993
- }, /*#__PURE__*/React.createElement("div", {
2994
- className: styles$g.middle
2995
- }, /*#__PURE__*/React.createElement(Label, null, children)));
2694
+ var textElement = PropTypes$1.shape({
2695
+ body: PropTypes$1.string,
2696
+ textStyle: textStyle
2697
+ });
2698
+ var headingElement = textElement;
2699
+ PropTypes$1.shape({
2700
+ label: PropTypes$1.string,
2701
+ textStyle: textStyle
2702
+ });
2703
+ var imageElement = PropTypes$1.shape({
2704
+ media: imageMedia
2705
+ });
2706
+ PropTypes$1.arrayOf(imageElement);
2707
+ PropTypes$1.shape({
2708
+ media: videoMedia,
2709
+ autoPlay: PropTypes$1.bool,
2710
+ loop: PropTypes$1.bool,
2711
+ closedCaptions: closedCaptionsMedia,
2712
+ withSeekBar: PropTypes$1.bool,
2713
+ withControls: PropTypes$1.bool
2714
+ });
2715
+ var visualElement = PropTypes$1.shape({
2716
+ media: imageMedia
2717
+ });
2718
+ PropTypes$1.arrayOf(visualElement);
2719
+ PropTypes$1.shape({
2720
+ media: audioMedia,
2721
+ autoPlay: PropTypes$1.bool,
2722
+ loop: PropTypes$1.bool,
2723
+ closedCaptions: closedCaptionsMedia,
2724
+ withPlayPause: PropTypes$1.bool
2725
+ });
2726
+ PropTypes$1.shape({
2727
+ media: closedCaptionsMedia
2728
+ });
2729
+ var backgroundElement = PropTypes$1.shape({
2730
+ color: color,
2731
+ image: imageMedia,
2732
+ video: videoMedia
2733
+ });
2734
+ var imageElementWithCaption = PropTypes$1.shape({
2735
+ image: imageMedia,
2736
+ caption: textElement
2737
+ });
2738
+ PropTypes$1.arrayOf(imageElementWithCaption);
2739
+ var stackDirection = PropTypes$1.oneOf(['horizontal', 'vertical']);
2740
+ var stackAlign = PropTypes$1.oneOf(['start', 'center', 'end']);
2741
+ var stackSpacing = PropTypes$1.oneOfType([PropTypes$1.number, PropTypes$1.oneOf(['between', 'evenly', 'around'])]);
2742
+ PropTypes$1.shape({
2743
+ direction: stackDirection,
2744
+ align: stackAlign,
2745
+ width: PropTypes$1.number,
2746
+ height: PropTypes$1.number,
2747
+ spacing: stackSpacing,
2748
+ reverse: PropTypes$1.bool
2749
+ });
2750
+ PropTypes$1.shape({
2751
+ layout: PropTypes$1.arrayOf(PropTypes$1.string),
2752
+ spacing: PropTypes$1.number
2753
+ });
2754
+ var geoPosition = PropTypes$1.shape({
2755
+ lat: PropTypes$1.number,
2756
+ lng: PropTypes$1.number
2757
+ });
2758
+ var markerShape = {
2759
+ id: PropTypes$1.number,
2760
+ geoPosition: geoPosition,
2761
+ title: headingElement,
2762
+ subtitle: headingElement,
2763
+ description: textElement
2996
2764
  };
2765
+ var marker = PropTypes$1.shape(_objectSpread({}, markerShape));
2766
+ PropTypes$1.arrayOf(marker);
2767
+ var markerWithImage = PropTypes$1.shape(_objectSpread(_objectSpread({}, markerShape), {}, {
2768
+ image: imageMedia
2769
+ }));
2770
+ PropTypes$1.arrayOf(markerWithImage);
2771
+ var answerShape = {
2772
+ id: PropTypes$1.string,
2773
+ label: textElement
2774
+ };
2775
+ var answer = PropTypes$1.shape(_objectSpread({}, answerShape));
2776
+ var quizAnswer = PropTypes$1.shape(_objectSpread(_objectSpread({}, answerShape), {}, {
2777
+ good: PropTypes$1.bool
2778
+ }));
2779
+ PropTypes$1.arrayOf(answer);
2780
+ PropTypes$1.arrayOf(quizAnswer);
2781
+ var callToActionTypes = PropTypes$1.oneOf(['swipe-up', 'button']);
2782
+ PropTypes$1.shape({
2783
+ active: PropTypes$1.bool,
2784
+ type: callToActionTypes,
2785
+ url: PropTypes$1.string,
2786
+ label: textElement,
2787
+ buttonStyle: boxStyle
2788
+ });
2789
+ var speaker = PropTypes$1.shape({
2790
+ id: PropTypes$1.string,
2791
+ name: PropTypes$1.string,
2792
+ avatar: imageMedia,
2793
+ side: PropTypes$1.oneOf(['left', 'right']),
2794
+ color: color
2795
+ });
2796
+ var speakers = PropTypes$1.arrayOf(speaker);
2797
+ var conversationMessage = PropTypes$1.shape({
2798
+ speaker: PropTypes$1.string,
2799
+ message: PropTypes$1.string,
2800
+ image: imageMedia
2801
+ });
2802
+ var conversationMessages = PropTypes$1.arrayOf(conversationMessage);
2803
+ PropTypes$1.shape({
2804
+ speakers: speakers,
2805
+ textStyle: textStyle,
2806
+ messages: conversationMessages
2807
+ });
2808
+ /**
2809
+ * Definitions
2810
+ */
2997
2811
 
2998
- Empty.propTypes = propTypes$g;
2999
- Empty.defaultProps = defaultProps$g;
3000
-
3001
- var getUrlsFromMedia = function getUrlsFromMedia(media, formats) {
3002
- var _ref = media || {},
3003
- _ref$files = _ref.files,
3004
- files = _ref$files === void 0 ? {} : _ref$files;
3005
-
3006
- var _ref2 = files || {},
3007
- _ref2$original = _ref2.original,
3008
- originalFile = _ref2$original === void 0 ? null : _ref2$original;
3009
-
3010
- var _ref3 = originalFile || {},
3011
- _ref3$name = _ref3.name,
3012
- originalName = _ref3$name === void 0 ? null : _ref3$name,
3013
- _ref3$mime = _ref3.mime,
3014
- originalMime = _ref3$mime === void 0 ? null : _ref3$mime;
3015
-
3016
- var urls = formats.reduce(function (currentUrls, format) {
3017
- var finalFormat = isObject(format) ? format.format : format;
3018
- var formatExtension = isObject(format) ? format.name : format;
3019
- var file = files["webfonts.".concat(formatExtension)] || files[formatExtension] || null;
3020
-
3021
- if (file !== null) {
3022
- return [].concat(_toConsumableArray(currentUrls), ["url(\"".concat(file.url, "?\") format(\"").concat(finalFormat, "\")")]);
3023
- }
3024
-
3025
- var extensionRegExp = new RegExp(".".concat(formatExtension, "$"), 'i');
3026
- var mimeRegExp = new RegExp("".concat(finalFormat), 'i');
3027
-
3028
- if (originalName !== null && originalName.match(extensionRegExp) !== null || originalMime !== null && originalMime.match(mimeRegExp) !== null) {
3029
- return [].concat(_toConsumableArray(currentUrls), ["url(\"".concat(originalFile.url, "?\") format(\"").concat(finalFormat, "\")")]);
3030
- }
3031
-
3032
- return currentUrls;
3033
- }, []);
3034
- return urls;
2812
+ var fieldShape = {
2813
+ name: PropTypes$1.string,
2814
+ type: PropTypes$1.string.isRequired,
2815
+ label: text
3035
2816
  };
2817
+ var field = PropTypes$1.shape(_objectSpread(_objectSpread({}, fieldShape), {}, {
2818
+ isSection: PropTypes$1.bool,
2819
+ fields: PropTypes$1.arrayOf(PropTypes$1.shape(fieldShape))
2820
+ }));
2821
+ var fields = PropTypes$1.arrayOf(field);
2822
+ var screenDefinition = PropTypes$1.shape({
2823
+ id: PropTypes$1.string.isRequired,
2824
+ type: PropTypes$1.oneOf(['screen']).isRequired,
2825
+ title: text.isRequired,
2826
+ layouts: PropTypes$1.arrayOf(PropTypes$1.string),
2827
+ fields: fields
2828
+ });
2829
+ PropTypes$1.arrayOf(screenDefinition);
2830
+ var fieldDefinition = PropTypes$1.shape({
2831
+ id: PropTypes$1.string.isRequired,
2832
+ type: PropTypes$1.oneOf(['field']).isRequired,
2833
+ title: text.isRequired,
2834
+ fields: fields
2835
+ });
2836
+ PropTypes$1.arrayOf(fieldDefinition);
2837
+ /**
2838
+ * Components
2839
+ */
3036
2840
 
3037
- var propTypes$f = {
3038
- fonts: PropTypes.fonts,
3039
- formats: PropTypes$1.arrayOf(PropTypes$1.oneOfType([PropTypes$1.string, PropTypes$1.shape({
3040
- name: PropTypes$1.string,
3041
- format: PropTypes$1.string
3042
- })]))
3043
- };
3044
- var defaultProps$f = {
3045
- fonts: [],
3046
- formats: ['eot', 'woff2', 'woff', {
3047
- name: 'otf',
3048
- format: 'opentype'
3049
- }, {
3050
- name: 'ttf',
3051
- format: 'truetype'
3052
- }, 'svg']
2841
+ var storyComponentShape = {
2842
+ type: PropTypes$1.string.isRequired
3053
2843
  };
2844
+ var storyComponent = PropTypes$1.shape(_objectSpread({}, storyComponentShape));
2845
+ PropTypes$1.arrayOf(storyComponent);
2846
+ var screenComponent = PropTypes$1.shape(_objectSpread({}, storyComponentShape));
2847
+ var screenComponents = PropTypes$1.arrayOf(screenComponent);
3054
2848
 
3055
- var FontFaces = function FontFaces(_ref4) {
3056
- var fonts = _ref4.fonts,
3057
- formats = _ref4.formats;
3058
- var fontFaces = (fonts || []).filter(function (it) {
3059
- return isObject(it) && it.type === 'custom' && (it.media || null) !== null;
3060
- }).reduce(function (fontFontFaces, _ref5) {
3061
- var _ref5$name = _ref5.name,
3062
- name = _ref5$name === void 0 ? null : _ref5$name,
3063
- _ref5$media = _ref5.media,
3064
- media = _ref5$media === void 0 ? null : _ref5$media,
3065
- _ref5$variants = _ref5.variants,
3066
- variants = _ref5$variants === void 0 ? [] : _ref5$variants;
2849
+ /**
2850
+ * Theme
2851
+ */
3067
2852
 
3068
- if (name === null) {
3069
- return fontFontFaces;
3070
- }
2853
+ var theme = PropTypes$1.shape({
2854
+ id: PropTypes$1.string,
2855
+ textStyles: PropTypes$1.objectOf(textStyle),
2856
+ // renamed to textstyles
2857
+ background: backgroundElement,
2858
+ colors: PropTypes$1.objectOf(color),
2859
+ components: screenComponents
2860
+ });
2861
+ PropTypes$1.shape(_objectSpread({
2862
+ logo: imageMedia
2863
+ }, theme));
2864
+ /**
2865
+ * Branding
2866
+ */
2867
+ // export const branding = PropTypes.shape({
2868
+ // logo: imageMedia,
2869
+ // primaryColor: color,
2870
+ // secondaryColor: color,
2871
+ // backgroundColor: color,
2872
+ // textStyle,
2873
+ // });
3071
2874
 
3072
- var urls = media !== null ? getUrlsFromMedia(media, formats) : null;
3073
- return [].concat(_toConsumableArray(fontFontFaces), [urls !== null && urls.length > 0 ? "\n @font-face {\n font-family: \"".concat(name, "\";\n src: ").concat(urls.join(','), ";\n }\n ") : null], _toConsumableArray((variants || []).map(function (_ref6) {
3074
- var weight = _ref6.weight,
3075
- style = _ref6.style,
3076
- _ref6$media = _ref6.media,
3077
- variantMedia = _ref6$media === void 0 ? null : _ref6$media;
2875
+ /**
2876
+ * Metadata
2877
+ */
3078
2878
 
3079
- if (variantMedia == null) {
3080
- return null;
3081
- }
2879
+ var metadata = PropTypes$1.shape({
2880
+ description: PropTypes$1.string,
2881
+ shareUrl: PropTypes$1.string,
2882
+ shareImage: imageMedia,
2883
+ favIcon: imageMedia
2884
+ });
2885
+ /**
2886
+ * Story
2887
+ */
3082
2888
 
3083
- var variantUrls = getUrlsFromMedia(variantMedia, formats);
3084
- return 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;
3085
- })));
3086
- }, []).filter(function (it) {
3087
- return it !== null;
3088
- });
3089
- return fontFaces.length > 0 ? /*#__PURE__*/React.createElement("style", {
3090
- type: "text/css"
3091
- }, fontFaces.join('\n')) : null;
3092
- };
2889
+ PropTypes$1.shape({
2890
+ id: PropTypes$1.string,
2891
+ theme: theme,
2892
+ components: screenComponents,
2893
+ metadata: metadata
2894
+ });
2895
+ /**
2896
+ * Render
2897
+ */
3093
2898
 
3094
- FontFaces.propTypes = propTypes$f;
3095
- FontFaces.defaultProps = defaultProps$f;
2899
+ var deviceScreen = PropTypes$1.shape({
2900
+ name: PropTypes$1.string.isRequired,
2901
+ mediaQuery: PropTypes$1.string
2902
+ });
2903
+ PropTypes$1.arrayOf(deviceScreen);
2904
+ PropTypes$1.shape({
2905
+ screen: PropTypes$1.string,
2906
+ screens: PropTypes$1.arrayOf(PropTypes$1.string),
2907
+ width: PropTypes$1.number,
2908
+ height: PropTypes$1.number,
2909
+ landscape: PropTypes$1.bool
2910
+ });
2911
+ PropTypes$1.oneOf(['view', 'placeholder', 'edit', 'preview', 'static', 'capture']);
2912
+ /**
2913
+ * Screens
2914
+ */
3096
2915
 
3097
- var styles$f = {};
2916
+ PropTypes$1.shape({
2917
+ width: PropTypes$1.number,
2918
+ height: PropTypes$1.number
2919
+ });
2920
+ PropTypes$1.shape({
2921
+ width: PropTypes$1.number,
2922
+ height: PropTypes$1.number,
2923
+ url: PropTypes$1.string,
2924
+ target: target,
2925
+ iframe: PropTypes$1.string,
2926
+ image: imageMedia
2927
+ });
2928
+ PropTypes$1.shape({
2929
+ src: PropTypes$1.string,
2930
+ track: PropTypes$1.string,
2931
+ trackLng: PropTypes$1.number,
2932
+ controls: PropTypes$1.bool
2933
+ });
2934
+ var slide = PropTypes$1.shape({
2935
+ image: imageMedia,
2936
+ text: PropTypes$1.string
2937
+ });
2938
+ PropTypes$1.arrayOf(slide); // export const imageStyle = PropTypes.shape({
2939
+ // alt: PropTypes.string,
2940
+ // fit: PropTypes.object,
2941
+ // });
3098
2942
 
3099
- var propTypes$e = {
3100
- thumbnail: PropTypes$1.node,
3101
- thumbnailAlign: PropTypes$1.oneOf(['top', 'center', 'bottom']),
3102
- children: PropTypes$1.node,
3103
- title: PropTypes.label,
3104
- className: PropTypes$1.string,
3105
- thumbnailClassName: PropTypes$1.string,
3106
- bodyClassName: PropTypes$1.string,
3107
- titleClassName: PropTypes$1.string
3108
- };
3109
- var defaultProps$e = {
3110
- thumbnail: null,
3111
- thumbnailAlign: 'top',
3112
- children: null,
3113
- title: null,
3114
- className: null,
3115
- thumbnailClassName: null,
3116
- bodyClassName: null,
3117
- titleClassName: null
3118
- };
2943
+ PropTypes$1.shape({});
2944
+ /**
2945
+ * Transitions
2946
+ */
3119
2947
 
3120
- var Media = function Media(_ref) {
3121
- var thumbnail = _ref.thumbnail,
3122
- thumbnailAlign = _ref.thumbnailAlign,
3123
- children = _ref.children,
3124
- title = _ref.title,
3125
- className = _ref.className,
3126
- thumbnailClassName = _ref.thumbnailClassName,
3127
- bodyClassName = _ref.bodyClassName,
3128
- titleClassName = _ref.titleClassName;
3129
- return /*#__PURE__*/React.createElement("div", {
3130
- className: classNames(['card', styles$f.container, _defineProperty({}, className, className !== null)])
3131
- }, typeof thumbnail === 'string' ? /*#__PURE__*/React.createElement("img", {
3132
- src: thumbnail,
3133
- alt: title,
3134
- className: classNames(['me-3', styles$f.thumbnail, _defineProperty({
3135
- 'align-self-start': thumbnailAlign === 'top',
3136
- 'align-self-center': thumbnailAlign === 'center',
3137
- 'align-self-end': thumbnailAlign === 'bottom'
3138
- }, thumbnailClassName, thumbnailClassName !== null)])
3139
- }) : thumbnail, title !== null || children !== null ? /*#__PURE__*/React.createElement("div", {
3140
- className: classNames(['card-body', styles$f.body, _defineProperty({}, bodyClassName, bodyClassName !== null)])
3141
- }, title !== null ? /*#__PURE__*/React.createElement("h5", {
3142
- className: classNames(['mt-0', 'text-truncate', styles$f.title, _defineProperty({}, titleClassName, titleClassName !== null)])
3143
- }, /*#__PURE__*/React.createElement(Label, null, title)) : null, children) : null);
2948
+ var transitionName = PropTypes$1.oneOf(['fade', 'scale', 'slide']);
2949
+ var transitionParams = {
2950
+ duration: PropTypes$1.number,
2951
+ easing: PropTypes$1.oneOf(['ease', 'ease-in', 'ease-out', 'ease-in-out', 'linear'])
3144
2952
  };
2953
+ var transition = PropTypes$1.oneOfType([transitionName.isRequired, PropTypes$1.shape(_objectSpread({
2954
+ name: transitionName.isRequired
2955
+ }, transitionParams))]);
2956
+ PropTypes$1.shape({
2957
+ "in": transition,
2958
+ out: transition
2959
+ });
2960
+ /**
2961
+ * Search
2962
+ */
3145
2963
 
3146
- Media.propTypes = propTypes$e;
3147
- Media.defaultProps = defaultProps$e;
2964
+ var searchFilter = PropTypes$1.shape({
2965
+ type: PropTypes$1.string,
2966
+ value: PropTypes$1.oneOf([PropTypes$1.string, PropTypes$1.number])
2967
+ });
2968
+ PropTypes$1.arrayOf(searchFilter);
2969
+ /**
2970
+ * Payments
2971
+ */
2972
+
2973
+ var paymentItem = PropTypes$1.shape({
2974
+ id: PropTypes$1.oneOfType([PropTypes$1.string, PropTypes$1.number]),
2975
+ date: PropTypes$1.string,
2976
+ type: PropTypes$1.string,
2977
+ invoice_link: PropTypes$1.string,
2978
+ amount: PropTypes$1.oneOfType([PropTypes$1.string, PropTypes$1.number])
2979
+ });
2980
+ PropTypes$1.arrayOf(paymentItem);
2981
+ /**
2982
+ * Page Metadada
2983
+ */
2984
+
2985
+ var pageMetadata = PropTypes$1.shape({
2986
+ canonical: PropTypes$1.string,
2987
+ description: PropTypes$1.string,
2988
+ keywords: PropTypes$1.oneOfType([PropTypes$1.string, PropTypes$1.array]),
2989
+ image: PropTypes$1.shape({
2990
+ url: PropTypes$1.string
2991
+ }),
2992
+ favicon: PropTypes$1.shape({
2993
+ url: PropTypes$1.string
2994
+ }),
2995
+ rssUrl: PropTypes$1.string,
2996
+ atomUrl: PropTypes$1.string,
2997
+ microformats: PropTypes$1.arrayOf(PropTypes$1.shape({}))
2998
+ });
2999
+ PropTypes$1.shape({
3000
+ name: textElement,
3001
+ avatar: PropTypes$1.shape({
3002
+ url: PropTypes$1.string
3003
+ })
3004
+ });
3005
+ PropTypes$1.shape({
3006
+ id: PropTypes$1.oneOfType([PropTypes$1.string, PropTypes$1.number]),
3007
+ name: PropTypes$1.string
3008
+ });
3148
3009
 
3149
3010
  /* eslint-disable react/no-array-index-key */
3150
3011
  var propTypes$d = {
@@ -3994,7 +3855,7 @@ var Answer$1 = function Answer(_ref) {
3994
3855
  })));
3995
3856
  };
3996
3857
 
3997
- 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"};
3858
+ 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","button":"micromag-core-placeholders-share-options-button"};
3998
3859
 
3999
3860
  var Title = function Title(props) {
4000
3861
  return /*#__PURE__*/React.createElement(PlaceholderBlock, Object.assign({}, props, {
@@ -4499,4 +4360,4 @@ var LinkStyle = function LinkStyle(_ref) {
4499
4360
  LinkStyle.propTypes = propTypes;
4500
4361
  LinkStyle.defaultProps = defaultProps;
4501
4362
 
4502
- export { BackButton, Breadcrumb, Button$1 as Button, Buttons, Card, Close, CloseButton, CollapsablePanel, Date$1 as Date, Detector, Dropdown as DropdownMenu, ElementComponent as Element, Empty, FieldForm, FontFaces, Form, FormPanel, HighlightStyle, IconButton, Label, Link, LinkStyle, Media, Menu, Meta, Modal, ModalDialog, ModalPortal, Modals, Navbar, PaginationMenu as Pagination, Panel, PanelPortal, Panels, AdFrame as PlaceholderAdFrame, AdImage as PlaceholderAdImage, Audio as PlaceholderAudio, Button as PlaceholderButton, Image as PlaceholderImage, Line as PlaceholderLine, Map as PlaceholderMap, MapPath as PlaceholderMapPath, Quote as PlaceholderQuote, ShortText as PlaceholderShortText, Subtitle as PlaceholderSubtitle, TextPlaceholder as PlaceholderText, Timeline as PlaceholderTimeline, Title$1 as PlaceholderTitle, Video as PlaceholderVideo, Video360 as PlaceholderVideo360, VideoLoop as PlaceholderVideoLoop, Screen$1 as Screen, ScreenElement, Placeholder as ScreenPlaceholder, Preview as ScreenPreview, ScreenSizer, Screens, Slideshow, SlidingButtons, Spinner, TabsMenu as Tabs, Transitions, TransitionsStagger, UploadModal };
4363
+ export { BackButton, Breadcrumb, Button$1 as Button, Buttons, Card, Close, CollapsablePanel, Date$1 as Date, Detector, Dropdown as DropdownMenu, ElementComponent as Element, Empty, FieldForm, FontFaces, Form, FormPanel, HighlightStyle, Label, Link, LinkStyle, Media, Menu, Meta, Modal, ModalDialog, ModalPortal, Modals, Navbar, PaginationMenu as Pagination, Panel, PanelPortal, Panels, AdFrame as PlaceholderAdFrame, AdImage as PlaceholderAdImage, Audio as PlaceholderAudio, Button as PlaceholderButton, Image as PlaceholderImage, Line as PlaceholderLine, Map as PlaceholderMap, MapPath as PlaceholderMapPath, Quote as PlaceholderQuote, ShortText as PlaceholderShortText, Subtitle as PlaceholderSubtitle, TextPlaceholder as PlaceholderText, Timeline as PlaceholderTimeline, Title$1 as PlaceholderTitle, Video as PlaceholderVideo, Video360 as PlaceholderVideo360, VideoLoop as PlaceholderVideoLoop, Screen$1 as Screen, ScreenElement, Placeholder as ScreenPlaceholder, Preview as ScreenPreview, ScreenSizer, Screens, Slideshow, Spinner, TabsMenu as Tabs, Transitions, TransitionsStagger, UploadModal };