@micromag/core 0.3.651 → 0.3.656
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 +81 -81
- package/es/contexts.js +29 -29
- package/es/hooks.js +138 -138
- package/es/index.js +105 -105
- package/es/utils.js +121 -113
- package/package.json +2 -2
package/es/components.js
CHANGED
|
@@ -251,11 +251,11 @@ var Buttons = function Buttons(_ref) {
|
|
|
251
251
|
role: "group"
|
|
252
252
|
}, buttons.map(function (button, index) {
|
|
253
253
|
var _button$className = button.className,
|
|
254
|
-
customClassName = _button$className ===
|
|
254
|
+
customClassName = _button$className === void 0 ? null : _button$className,
|
|
255
255
|
_button$onClick = button.onClick,
|
|
256
|
-
_onClick = _button$onClick ===
|
|
256
|
+
_onClick = _button$onClick === void 0 ? null : _button$onClick,
|
|
257
257
|
_button$theme = button.theme,
|
|
258
|
-
buttonTheme = _button$theme ===
|
|
258
|
+
buttonTheme = _button$theme === void 0 ? null : _button$theme,
|
|
259
259
|
buttonProps = _objectWithoutProperties(button, _excluded$b);
|
|
260
260
|
var fixedProps = {
|
|
261
261
|
key: "button-".concat(index),
|
|
@@ -365,13 +365,13 @@ var FieldForm = function FieldForm(_ref) {
|
|
|
365
365
|
var field = getFieldFromPath(name.split('.'), fields, fieldsManager);
|
|
366
366
|
var _ref2 = field || {},
|
|
367
367
|
_ref2$type = _ref2.type,
|
|
368
|
-
type = _ref2$type ===
|
|
368
|
+
type = _ref2$type === void 0 ? null : _ref2$type,
|
|
369
369
|
fieldProps = _objectWithoutProperties(_ref2, _excluded$8);
|
|
370
370
|
var fieldDefinition = fieldsManager.getDefinition(type) || null;
|
|
371
371
|
var fieldData = fieldDefinition || _objectSpread({}, field);
|
|
372
372
|
var _ref3 = fieldData || {},
|
|
373
373
|
_ref3$component = _ref3.component,
|
|
374
|
-
fieldComponent = _ref3$component ===
|
|
374
|
+
fieldComponent = _ref3$component === void 0 ? null : _ref3$component;
|
|
375
375
|
_ref3.id;
|
|
376
376
|
_ref3.settings;
|
|
377
377
|
var definitionProps = _objectWithoutProperties(_ref3, _excluded2);
|
|
@@ -784,7 +784,7 @@ var Card = function Card(_ref) {
|
|
|
784
784
|
var linksElements = (links || []).map(function (_ref2, index) {
|
|
785
785
|
var label = _ref2.label,
|
|
786
786
|
_ref2$className = _ref2.className,
|
|
787
|
-
linkClassName = _ref2$className ===
|
|
787
|
+
linkClassName = _ref2$className === void 0 ? null : _ref2$className,
|
|
788
788
|
linkProps = _objectWithoutProperties(_ref2, _excluded$6);
|
|
789
789
|
return /*#__PURE__*/React.createElement(Link, Object.assign({
|
|
790
790
|
key: "link-".concat(label, "-").concat(index),
|
|
@@ -1196,9 +1196,9 @@ var Breadcrumb = function Breadcrumb(_ref) {
|
|
|
1196
1196
|
var url = _ref2.url,
|
|
1197
1197
|
label = _ref2.label,
|
|
1198
1198
|
_ref2$active = _ref2.active,
|
|
1199
|
-
active = _ref2$active ===
|
|
1199
|
+
active = _ref2$active === void 0 ? false : _ref2$active,
|
|
1200
1200
|
_ref2$onClick = _ref2.onClick,
|
|
1201
|
-
onClick = _ref2$onClick ===
|
|
1201
|
+
onClick = _ref2$onClick === void 0 ? null : _ref2$onClick;
|
|
1202
1202
|
return /*#__PURE__*/React.createElement("li", {
|
|
1203
1203
|
className: classNames(['breadcrumb-item', _defineProperty(_defineProperty({
|
|
1204
1204
|
active: active
|
|
@@ -1273,17 +1273,17 @@ var Dropdown = function Dropdown(_ref) {
|
|
|
1273
1273
|
ref: refContainer
|
|
1274
1274
|
}, children !== null ? children : items.map(function (it, index) {
|
|
1275
1275
|
var _it$type = it.type,
|
|
1276
|
-
type = _it$type ===
|
|
1276
|
+
type = _it$type === void 0 ? 'link' : _it$type,
|
|
1277
1277
|
_it$className = it.className,
|
|
1278
|
-
customClassName = _it$className ===
|
|
1278
|
+
customClassName = _it$className === void 0 ? null : _it$className,
|
|
1279
1279
|
_it$label = it.label,
|
|
1280
|
-
label = _it$label ===
|
|
1280
|
+
label = _it$label === void 0 ? null : _it$label,
|
|
1281
1281
|
_it$children = it.children,
|
|
1282
|
-
itemChildren = _it$children ===
|
|
1282
|
+
itemChildren = _it$children === void 0 ? null : _it$children,
|
|
1283
1283
|
_it$onClick = it.onClick,
|
|
1284
|
-
customOnClick = _it$onClick ===
|
|
1284
|
+
customOnClick = _it$onClick === void 0 ? null : _it$onClick,
|
|
1285
1285
|
_it$active = it.active,
|
|
1286
|
-
active = _it$active ===
|
|
1286
|
+
active = _it$active === void 0 ? false : _it$active,
|
|
1287
1287
|
itemProps = _objectWithoutProperties(it, _excluded$4);
|
|
1288
1288
|
var ItemComponent = 'div';
|
|
1289
1289
|
if (type === 'link') {
|
|
@@ -1388,22 +1388,22 @@ var _Menu = function Menu(_ref) {
|
|
|
1388
1388
|
}, children !== null ? children : items.map(function (it, index) {
|
|
1389
1389
|
var id = it.id,
|
|
1390
1390
|
_it$className = it.className,
|
|
1391
|
-
customClassName = _it$className ===
|
|
1391
|
+
customClassName = _it$className === void 0 ? null : _it$className,
|
|
1392
1392
|
_it$linkClassName = it.linkClassName,
|
|
1393
|
-
customLinkClassName = _it$linkClassName ===
|
|
1393
|
+
customLinkClassName = _it$linkClassName === void 0 ? null : _it$linkClassName,
|
|
1394
1394
|
_it$href = it.href,
|
|
1395
|
-
href = _it$href ===
|
|
1395
|
+
href = _it$href === void 0 ? null : _it$href,
|
|
1396
1396
|
label = it.label,
|
|
1397
1397
|
_it$external = it.external,
|
|
1398
|
-
external = _it$external ===
|
|
1398
|
+
external = _it$external === void 0 ? false : _it$external,
|
|
1399
1399
|
_it$items = it.items,
|
|
1400
|
-
subItems = _it$items ===
|
|
1400
|
+
subItems = _it$items === void 0 ? null : _it$items,
|
|
1401
1401
|
_it$dropdown = it.dropdown,
|
|
1402
|
-
dropdown = _it$dropdown ===
|
|
1402
|
+
dropdown = _it$dropdown === void 0 ? null : _it$dropdown,
|
|
1403
1403
|
_it$active = it.active,
|
|
1404
|
-
active = _it$active ===
|
|
1404
|
+
active = _it$active === void 0 ? false : _it$active,
|
|
1405
1405
|
_it$onClick = it.onClick,
|
|
1406
|
-
customOnClick = _it$onClick ===
|
|
1406
|
+
customOnClick = _it$onClick === void 0 ? null : _it$onClick,
|
|
1407
1407
|
itemProps = _objectWithoutProperties(it, _excluded$3);
|
|
1408
1408
|
var onClickItem = dropdown !== null ? function (e) {
|
|
1409
1409
|
e.preventDefault();
|
|
@@ -1823,9 +1823,9 @@ var ModalPortal = function ModalPortal(_ref) {
|
|
|
1823
1823
|
var _useModals = useModals(),
|
|
1824
1824
|
container = _useModals.container,
|
|
1825
1825
|
_useModals$register = _useModals.register,
|
|
1826
|
-
register = _useModals$register ===
|
|
1826
|
+
register = _useModals$register === void 0 ? null : _useModals$register,
|
|
1827
1827
|
_useModals$unregister = _useModals.unregister,
|
|
1828
|
-
unregister = _useModals$unregister ===
|
|
1828
|
+
unregister = _useModals$unregister === void 0 ? null : _useModals$unregister;
|
|
1829
1829
|
return /*#__PURE__*/React.createElement(ElementPortal, {
|
|
1830
1830
|
id: id,
|
|
1831
1831
|
data: data,
|
|
@@ -1985,12 +1985,12 @@ var PanelPortal = function PanelPortal(_ref) {
|
|
|
1985
1985
|
children = _ref.children;
|
|
1986
1986
|
var _usePanels = usePanels(),
|
|
1987
1987
|
_usePanels$panels = _usePanels.panels,
|
|
1988
|
-
panels = _usePanels$panels ===
|
|
1988
|
+
panels = _usePanels$panels === void 0 ? null : _usePanels$panels,
|
|
1989
1989
|
container = _usePanels.container,
|
|
1990
1990
|
_usePanels$register = _usePanels.register,
|
|
1991
|
-
register = _usePanels$register ===
|
|
1991
|
+
register = _usePanels$register === void 0 ? null : _usePanels$register,
|
|
1992
1992
|
_usePanels$unregister = _usePanels.unregister,
|
|
1993
|
-
unregister = _usePanels$unregister ===
|
|
1993
|
+
unregister = _usePanels$unregister === void 0 ? null : _usePanels$unregister;
|
|
1994
1994
|
if (panels === null) {
|
|
1995
1995
|
return children;
|
|
1996
1996
|
}
|
|
@@ -2374,15 +2374,15 @@ Empty.defaultProps = defaultProps$g;
|
|
|
2374
2374
|
var getUrlsFromMedia = function getUrlsFromMedia(media, formats) {
|
|
2375
2375
|
var _ref = media || {},
|
|
2376
2376
|
_ref$files = _ref.files,
|
|
2377
|
-
files = _ref$files ===
|
|
2377
|
+
files = _ref$files === void 0 ? {} : _ref$files;
|
|
2378
2378
|
var _ref2 = files || {},
|
|
2379
2379
|
_ref2$original = _ref2.original,
|
|
2380
|
-
originalFile = _ref2$original ===
|
|
2380
|
+
originalFile = _ref2$original === void 0 ? null : _ref2$original;
|
|
2381
2381
|
var _ref3 = originalFile || {},
|
|
2382
2382
|
_ref3$name = _ref3.name,
|
|
2383
|
-
originalName = _ref3$name ===
|
|
2383
|
+
originalName = _ref3$name === void 0 ? null : _ref3$name,
|
|
2384
2384
|
_ref3$mime = _ref3.mime,
|
|
2385
|
-
originalMime = _ref3$mime ===
|
|
2385
|
+
originalMime = _ref3$mime === void 0 ? null : _ref3$mime;
|
|
2386
2386
|
var urls = formats.reduce(function (currentUrls, format) {
|
|
2387
2387
|
var finalFormat = isObject(format) ? format.format : format;
|
|
2388
2388
|
var formatExtension = isObject(format) ? format.name : format;
|
|
@@ -2423,11 +2423,11 @@ var FontFaces = function FontFaces(_ref4) {
|
|
|
2423
2423
|
return isObject(it) && it.type === 'custom' && (it.media || null) !== null;
|
|
2424
2424
|
}).reduce(function (fontFontFaces, _ref5) {
|
|
2425
2425
|
var _ref5$name = _ref5.name,
|
|
2426
|
-
name = _ref5$name ===
|
|
2426
|
+
name = _ref5$name === void 0 ? null : _ref5$name,
|
|
2427
2427
|
_ref5$media = _ref5.media,
|
|
2428
|
-
media = _ref5$media ===
|
|
2428
|
+
media = _ref5$media === void 0 ? null : _ref5$media,
|
|
2429
2429
|
_ref5$variants = _ref5.variants,
|
|
2430
|
-
variants = _ref5$variants ===
|
|
2430
|
+
variants = _ref5$variants === void 0 ? [] : _ref5$variants;
|
|
2431
2431
|
if (name === null) {
|
|
2432
2432
|
return fontFontFaces;
|
|
2433
2433
|
}
|
|
@@ -2436,7 +2436,7 @@ var FontFaces = function FontFaces(_ref4) {
|
|
|
2436
2436
|
var weight = _ref6.weight,
|
|
2437
2437
|
style = _ref6.style,
|
|
2438
2438
|
_ref6$media = _ref6.media,
|
|
2439
|
-
variantMedia = _ref6$media ===
|
|
2439
|
+
variantMedia = _ref6$media === void 0 ? null : _ref6$media;
|
|
2440
2440
|
if (variantMedia == null) {
|
|
2441
2441
|
return null;
|
|
2442
2442
|
}
|
|
@@ -3126,37 +3126,37 @@ var Meta = function Meta(_ref) {
|
|
|
3126
3126
|
children = _ref.children;
|
|
3127
3127
|
var _ref2 = metadata || {},
|
|
3128
3128
|
_ref2$canonical = _ref2.canonical,
|
|
3129
|
-
canonical = _ref2$canonical ===
|
|
3129
|
+
canonical = _ref2$canonical === void 0 ? null : _ref2$canonical,
|
|
3130
3130
|
_ref2$description = _ref2.description,
|
|
3131
|
-
description = _ref2$description ===
|
|
3131
|
+
description = _ref2$description === void 0 ? null : _ref2$description,
|
|
3132
3132
|
_ref2$keywords = _ref2.keywords,
|
|
3133
|
-
keywords = _ref2$keywords ===
|
|
3133
|
+
keywords = _ref2$keywords === void 0 ? null : _ref2$keywords,
|
|
3134
3134
|
_ref2$image = _ref2.image,
|
|
3135
|
-
image = _ref2$image ===
|
|
3135
|
+
image = _ref2$image === void 0 ? null : _ref2$image,
|
|
3136
3136
|
_ref2$favicon = _ref2.favicon,
|
|
3137
|
-
favicon = _ref2$favicon ===
|
|
3137
|
+
favicon = _ref2$favicon === void 0 ? null : _ref2$favicon,
|
|
3138
3138
|
_ref2$rssUrl = _ref2.rssUrl,
|
|
3139
|
-
rssUrl = _ref2$rssUrl ===
|
|
3139
|
+
rssUrl = _ref2$rssUrl === void 0 ? null : _ref2$rssUrl,
|
|
3140
3140
|
_ref2$atomUrl = _ref2.atomUrl,
|
|
3141
|
-
atomUrl = _ref2$atomUrl ===
|
|
3141
|
+
atomUrl = _ref2$atomUrl === void 0 ? null : _ref2$atomUrl,
|
|
3142
3142
|
_ref2$microformats = _ref2.microformats,
|
|
3143
|
-
microformats = _ref2$microformats ===
|
|
3143
|
+
microformats = _ref2$microformats === void 0 ? [] : _ref2$microformats,
|
|
3144
3144
|
_ref2$language = _ref2.language,
|
|
3145
|
-
language = _ref2$language ===
|
|
3145
|
+
language = _ref2$language === void 0 ? null : _ref2$language;
|
|
3146
3146
|
var realTitle = title !== null ? "".concat(title, " | ").concat(suffix) : fullTitle;
|
|
3147
3147
|
var _ref3 = image || {},
|
|
3148
3148
|
_ref3$url = _ref3.url,
|
|
3149
|
-
imageUrl = _ref3$url ===
|
|
3149
|
+
imageUrl = _ref3$url === void 0 ? null : _ref3$url,
|
|
3150
3150
|
_ref3$metadata = _ref3.metadata,
|
|
3151
|
-
imageMetadata = _ref3$metadata ===
|
|
3151
|
+
imageMetadata = _ref3$metadata === void 0 ? {} : _ref3$metadata;
|
|
3152
3152
|
var _ref4 = imageMetadata || {},
|
|
3153
3153
|
_ref4$width = _ref4.width,
|
|
3154
|
-
imageWidth = _ref4$width ===
|
|
3154
|
+
imageWidth = _ref4$width === void 0 ? null : _ref4$width,
|
|
3155
3155
|
_ref4$height = _ref4.height,
|
|
3156
|
-
imageHeight = _ref4$height ===
|
|
3156
|
+
imageHeight = _ref4$height === void 0 ? null : _ref4$height;
|
|
3157
3157
|
var _ref5 = favicon || {},
|
|
3158
3158
|
_ref5$url = _ref5.url,
|
|
3159
|
-
faviconUrl = _ref5$url ===
|
|
3159
|
+
faviconUrl = _ref5$url === void 0 ? null : _ref5$url;
|
|
3160
3160
|
return /*#__PURE__*/React.createElement(Helmet, null, /*#__PURE__*/React.createElement("title", null, realTitle !== null && realTitle.length > 0 ? realTitle : 'Micromag'), description !== null ? /*#__PURE__*/React.createElement("meta", {
|
|
3161
3161
|
name: "description",
|
|
3162
3162
|
content: description
|
|
@@ -3331,9 +3331,9 @@ var AdImage = function AdImage(_ref) {
|
|
|
3331
3331
|
/* eslint-disable react/destructuring-assignment, react/prop-types */
|
|
3332
3332
|
var Audio = function Audio(_ref) {
|
|
3333
3333
|
var _ref$width = _ref.width,
|
|
3334
|
-
width = _ref$width ===
|
|
3334
|
+
width = _ref$width === void 0 ? '100%' : _ref$width,
|
|
3335
3335
|
_ref$height = _ref.height,
|
|
3336
|
-
height = _ref$height ===
|
|
3336
|
+
height = _ref$height === void 0 ? '2em' : _ref$height,
|
|
3337
3337
|
className = _ref.className;
|
|
3338
3338
|
return /*#__PURE__*/React.createElement(PlaceholderBlock, {
|
|
3339
3339
|
width: width,
|
|
@@ -3396,9 +3396,9 @@ PlaceholderText.defaultProps = defaultProps$b;
|
|
|
3396
3396
|
/* eslint-disable react/destructuring-assignment, react/prop-types */
|
|
3397
3397
|
var Button = function Button(_ref) {
|
|
3398
3398
|
var _ref$width = _ref.width,
|
|
3399
|
-
width = _ref$width ===
|
|
3399
|
+
width = _ref$width === void 0 ? '75%' : _ref$width,
|
|
3400
3400
|
_ref$height = _ref.height,
|
|
3401
|
-
height = _ref$height ===
|
|
3401
|
+
height = _ref$height === void 0 ? '0.4em' : _ref$height,
|
|
3402
3402
|
className = _ref.className;
|
|
3403
3403
|
return /*#__PURE__*/React.createElement(PlaceholderBlock, {
|
|
3404
3404
|
outline: true,
|
|
@@ -3501,13 +3501,13 @@ var Subtitle = function Subtitle(props) {
|
|
|
3501
3501
|
/* eslint-disable react/jsx-props-no-spreading, react/destructuring-assignment, react/prop-types */
|
|
3502
3502
|
var TextPlaceholder = function TextPlaceholder(props) {
|
|
3503
3503
|
var _props$className = props.className,
|
|
3504
|
-
className = _props$className ===
|
|
3504
|
+
className = _props$className === void 0 ? null : _props$className,
|
|
3505
3505
|
_props$height = props.height,
|
|
3506
|
-
height = _props$height ===
|
|
3506
|
+
height = _props$height === void 0 ? 0.2 : _props$height,
|
|
3507
3507
|
_props$lines = props.lines,
|
|
3508
|
-
lines = _props$lines ===
|
|
3508
|
+
lines = _props$lines === void 0 ? 4 : _props$lines,
|
|
3509
3509
|
_props$lineMargin = props.lineMargin,
|
|
3510
|
-
lineMargin = _props$lineMargin ===
|
|
3510
|
+
lineMargin = _props$lineMargin === void 0 ? 2 : _props$lineMargin;
|
|
3511
3511
|
return /*#__PURE__*/React.createElement(PlaceholderText, Object.assign({}, props, {
|
|
3512
3512
|
height: height,
|
|
3513
3513
|
lines: lines,
|
|
@@ -3526,11 +3526,11 @@ var Timeline = function Timeline(props) {
|
|
|
3526
3526
|
/* eslint-disable react/jsx-props-no-spreading, react/destructuring-assignment, react/prop-types */
|
|
3527
3527
|
var Title$1 = function Title(props) {
|
|
3528
3528
|
var _props$height = props.height,
|
|
3529
|
-
height = _props$height ===
|
|
3529
|
+
height = _props$height === void 0 ? 0.5 : _props$height,
|
|
3530
3530
|
_props$lines = props.lines,
|
|
3531
|
-
lines = _props$lines ===
|
|
3531
|
+
lines = _props$lines === void 0 ? 2 : _props$lines,
|
|
3532
3532
|
_props$lineMargin = props.lineMargin,
|
|
3533
|
-
lineMargin = _props$lineMargin ===
|
|
3533
|
+
lineMargin = _props$lineMargin === void 0 ? 2 : _props$lineMargin;
|
|
3534
3534
|
return /*#__PURE__*/React.createElement(PlaceholderText, Object.assign({}, props, {
|
|
3535
3535
|
className: classNames([props.className, styles$d.title]),
|
|
3536
3536
|
height: height,
|
|
@@ -3623,9 +3623,9 @@ var ScreenSizer = function ScreenSizer(_ref) {
|
|
|
3623
3623
|
var _useDimensionObserver = useDimensionObserver(),
|
|
3624
3624
|
refContainer = _useDimensionObserver.ref,
|
|
3625
3625
|
_useDimensionObserver2 = _useDimensionObserver.width,
|
|
3626
|
-
calculatedWidth = _useDimensionObserver2 ===
|
|
3626
|
+
calculatedWidth = _useDimensionObserver2 === void 0 ? 0 : _useDimensionObserver2,
|
|
3627
3627
|
_useDimensionObserver3 = _useDimensionObserver.height,
|
|
3628
|
-
calculatedHeight = _useDimensionObserver3 ===
|
|
3628
|
+
calculatedHeight = _useDimensionObserver3 === void 0 ? 0 : _useDimensionObserver3;
|
|
3629
3629
|
var _useMemo = useMemo(function () {
|
|
3630
3630
|
var containerWidth = width || calculatedWidth || null;
|
|
3631
3631
|
var containerHeight = height || calculatedHeight || null;
|
|
@@ -3660,13 +3660,13 @@ var ScreenSizer = function ScreenSizer(_ref) {
|
|
|
3660
3660
|
};
|
|
3661
3661
|
}, [screenWidth, screenHeight, width, height, fit, calculatedWidth, calculatedHeight, hasSize]),
|
|
3662
3662
|
_useMemo$width = _useMemo.width,
|
|
3663
|
-
frameWidth = _useMemo$width ===
|
|
3663
|
+
frameWidth = _useMemo$width === void 0 ? null : _useMemo$width,
|
|
3664
3664
|
_useMemo$height = _useMemo.height,
|
|
3665
|
-
frameHeight = _useMemo$height ===
|
|
3665
|
+
frameHeight = _useMemo$height === void 0 ? null : _useMemo$height,
|
|
3666
3666
|
_useMemo$scale = _useMemo.scale,
|
|
3667
|
-
frameScale = _useMemo$scale ===
|
|
3667
|
+
frameScale = _useMemo$scale === void 0 ? null : _useMemo$scale,
|
|
3668
3668
|
_useMemo$transform = _useMemo.transform,
|
|
3669
|
-
screenTransform = _useMemo$transform ===
|
|
3669
|
+
screenTransform = _useMemo$transform === void 0 ? null : _useMemo$transform;
|
|
3670
3670
|
var screenSize = useMemo(function () {
|
|
3671
3671
|
return {
|
|
3672
3672
|
screen: 'mobile',
|
|
@@ -3744,7 +3744,7 @@ var Screen = function Screen(_ref) {
|
|
|
3744
3744
|
mediaRef = _ref.mediaRef;
|
|
3745
3745
|
var _ref2 = screen || {},
|
|
3746
3746
|
_ref2$type = _ref2.type,
|
|
3747
|
-
type = _ref2$type ===
|
|
3747
|
+
type = _ref2$type === void 0 ? null : _ref2$type;
|
|
3748
3748
|
var CustomScreenComponent = components !== null ? getComponentFromName(type, components) || null : null;
|
|
3749
3749
|
var ContextScreenComponent = useScreenComponent(type);
|
|
3750
3750
|
var ScreenComponent = CustomScreenComponent || ContextScreenComponent;
|
|
@@ -3892,9 +3892,9 @@ var Conversation = function Conversation() {
|
|
|
3892
3892
|
/* eslint-disable react/prop-types */
|
|
3893
3893
|
var InputText = function InputText(_ref) {
|
|
3894
3894
|
var _ref$width = _ref.width,
|
|
3895
|
-
width = _ref$width ===
|
|
3895
|
+
width = _ref$width === void 0 ? '75%' : _ref$width,
|
|
3896
3896
|
_ref$height = _ref.height,
|
|
3897
|
-
height = _ref$height ===
|
|
3897
|
+
height = _ref$height === void 0 ? '0.5em' : _ref$height,
|
|
3898
3898
|
className = _ref.className;
|
|
3899
3899
|
return /*#__PURE__*/React.createElement(PlaceholderBlock, {
|
|
3900
3900
|
outline: true,
|
|
@@ -3908,12 +3908,12 @@ var styles$4 = {"container":"micromag-core-placeholders-quiz-answer-container","
|
|
|
3908
3908
|
|
|
3909
3909
|
var Answer$1 = function Answer(_ref) {
|
|
3910
3910
|
var _ref$width = _ref.width,
|
|
3911
|
-
width = _ref$width ===
|
|
3911
|
+
width = _ref$width === void 0 ? '75%' : _ref$width,
|
|
3912
3912
|
_ref$height = _ref.height,
|
|
3913
|
-
height = _ref$height ===
|
|
3913
|
+
height = _ref$height === void 0 ? '0.3em' : _ref$height,
|
|
3914
3914
|
className = _ref.className,
|
|
3915
3915
|
_ref$good = _ref.good,
|
|
3916
|
-
good = _ref$good ===
|
|
3916
|
+
good = _ref$good === void 0 ? true : _ref$good;
|
|
3917
3917
|
return /*#__PURE__*/React.createElement("div", {
|
|
3918
3918
|
className: classNames([styles$4.container, _defineProperty(_defineProperty({}, className, className !== null), styles$4.good, good)])
|
|
3919
3919
|
}, /*#__PURE__*/React.createElement("div", {
|
|
@@ -3962,9 +3962,9 @@ var styles$2 = {"container":"micromag-core-placeholders-survey-answer-container"
|
|
|
3962
3962
|
|
|
3963
3963
|
var Answer = function Answer(_ref) {
|
|
3964
3964
|
var _ref$width = _ref.width,
|
|
3965
|
-
width = _ref$width ===
|
|
3965
|
+
width = _ref$width === void 0 ? '75%' : _ref$width,
|
|
3966
3966
|
_ref$height = _ref.height,
|
|
3967
|
-
height = _ref$height ===
|
|
3967
|
+
height = _ref$height === void 0 ? '0.3em' : _ref$height,
|
|
3968
3968
|
className = _ref.className;
|
|
3969
3969
|
return /*#__PURE__*/React.createElement("div", {
|
|
3970
3970
|
className: classNames([styles$2.container, _defineProperty({}, className, className !== null)])
|
|
@@ -4254,7 +4254,7 @@ function Transitions(_ref) {
|
|
|
4254
4254
|
children = _ref.children;
|
|
4255
4255
|
var _useScreenSize = useScreenSize(),
|
|
4256
4256
|
_useScreenSize$landsc = _useScreenSize.landscape,
|
|
4257
|
-
landscape = _useScreenSize$landsc ===
|
|
4257
|
+
landscape = _useScreenSize$landsc === void 0 ? true : _useScreenSize$landsc;
|
|
4258
4258
|
var finalPlaying = playing || landscape;
|
|
4259
4259
|
var finalTransitions = {
|
|
4260
4260
|
"in": null,
|
|
@@ -4272,17 +4272,17 @@ function Transitions(_ref) {
|
|
|
4272
4272
|
} : currentTransition;
|
|
4273
4273
|
});
|
|
4274
4274
|
var _finalTransitions$in = finalTransitions["in"],
|
|
4275
|
-
transitionIn = _finalTransitions$in ===
|
|
4275
|
+
transitionIn = _finalTransitions$in === void 0 ? null : _finalTransitions$in,
|
|
4276
4276
|
_finalTransitions$out = finalTransitions.out,
|
|
4277
|
-
transitionOut = _finalTransitions$out ===
|
|
4277
|
+
transitionOut = _finalTransitions$out === void 0 ? null : _finalTransitions$out;
|
|
4278
4278
|
var finalTransitionIn = transitionIn !== null ? transitionIn : transitionOut;
|
|
4279
4279
|
var finalTransitionOut = transitionOut !== null ? transitionOut : transitionIn;
|
|
4280
4280
|
var _ref2 = finalTransitionIn || {},
|
|
4281
4281
|
_ref2$name = _ref2.name,
|
|
4282
|
-
transitionInName = _ref2$name ===
|
|
4282
|
+
transitionInName = _ref2$name === void 0 ? null : _ref2$name;
|
|
4283
4283
|
var _ref3 = finalTransitionOut || {},
|
|
4284
4284
|
_ref3$name = _ref3.name,
|
|
4285
|
-
transitionOutName = _ref3$name ===
|
|
4285
|
+
transitionOutName = _ref3$name === void 0 ? null : _ref3$name;
|
|
4286
4286
|
var sameTransitionInOut = transitionInName === transitionOutName;
|
|
4287
4287
|
var TransitionIn = finalTransitionIn !== null ? getComponentFromName(transitionInName, TransitionComponents, null) : null;
|
|
4288
4288
|
var TransitionOut = finalTransitionOut !== null && !sameTransitionInOut ? getComponentFromName(transitionOutName, TransitionComponents, null) : null;
|
|
@@ -4342,10 +4342,10 @@ var TransitionsStagger = function TransitionsStagger(_ref) {
|
|
|
4342
4342
|
return null;
|
|
4343
4343
|
}
|
|
4344
4344
|
var _child$type = child.type,
|
|
4345
|
-
type = _child$type ===
|
|
4345
|
+
type = _child$type === void 0 ? null : _child$type;
|
|
4346
4346
|
var _ref2 = type || {},
|
|
4347
4347
|
_ref2$withoutTransiti = _ref2.withoutTransitionsWrapper,
|
|
4348
|
-
withoutTransitionsWrapper = _ref2$withoutTransiti ===
|
|
4348
|
+
withoutTransitionsWrapper = _ref2$withoutTransiti === void 0 ? false : _ref2$withoutTransiti;
|
|
4349
4349
|
if (disabled || withoutTransitionsWrapper) {
|
|
4350
4350
|
return child;
|
|
4351
4351
|
}
|
package/es/contexts.js
CHANGED
|
@@ -238,7 +238,7 @@ var ScreensProvider = function ScreensProvider(_ref) {
|
|
|
238
238
|
if (filterNamespaces) {
|
|
239
239
|
newManager = previousManager.filter(function (_ref2) {
|
|
240
240
|
var _ref2$namespaces = _ref2.namespaces,
|
|
241
|
-
screenGroups = _ref2$namespaces ===
|
|
241
|
+
screenGroups = _ref2$namespaces === void 0 ? null : _ref2$namespaces;
|
|
242
242
|
return screenGroups === null || namespaces !== null && screenGroups.reduce(function (acc, id) {
|
|
243
243
|
return acc || namespaces.indexOf(id) !== -1;
|
|
244
244
|
}, false);
|
|
@@ -304,7 +304,7 @@ var useEditor = function useEditor() {
|
|
|
304
304
|
var useGetColors = function useGetColors() {
|
|
305
305
|
var _ref = useEditor() || {},
|
|
306
306
|
_ref$getColors = _ref.getColors,
|
|
307
|
-
getColors = _ref$getColors ===
|
|
307
|
+
getColors = _ref$getColors === void 0 ? function () {
|
|
308
308
|
return [];
|
|
309
309
|
} : _ref$getColors;
|
|
310
310
|
return getColors;
|
|
@@ -426,9 +426,9 @@ var FontsContext = /*#__PURE__*/React.createContext({
|
|
|
426
426
|
var useGoogleFonts = function useGoogleFonts() {
|
|
427
427
|
var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
|
428
428
|
_ref$disabled = _ref.disabled,
|
|
429
|
-
disabled = _ref$disabled ===
|
|
429
|
+
disabled = _ref$disabled === void 0 ? false : _ref$disabled,
|
|
430
430
|
_ref$setFonts = _ref.setFonts,
|
|
431
|
-
setFonts = _ref$setFonts ===
|
|
431
|
+
setFonts = _ref$setFonts === void 0 ? null : _ref$setFonts;
|
|
432
432
|
var _useGoogleKeys = useGoogleKeys(),
|
|
433
433
|
apiKey = _useGoogleKeys.apiKey;
|
|
434
434
|
var _useState = useState(null),
|
|
@@ -440,7 +440,7 @@ var useGoogleFonts = function useGoogleFonts() {
|
|
|
440
440
|
if (apiKey !== null && !disabled) {
|
|
441
441
|
getJSON("https://www.googleapis.com/webfonts/v1/webfonts?key=".concat(apiKey, "&sort=popularity")).then(function (_ref2) {
|
|
442
442
|
var _ref2$items = _ref2.items,
|
|
443
|
-
items = _ref2$items ===
|
|
443
|
+
items = _ref2$items === void 0 ? [] : _ref2$items;
|
|
444
444
|
if (!canceled) {
|
|
445
445
|
var newFonts = items.map(function (it) {
|
|
446
446
|
return {
|
|
@@ -466,16 +466,16 @@ var useGoogleFonts = function useGoogleFonts() {
|
|
|
466
466
|
var useFonts = function useFonts() {
|
|
467
467
|
var _ref3 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
|
468
468
|
_ref3$withoutGoogleFo = _ref3.withoutGoogleFonts,
|
|
469
|
-
withoutGoogleFonts = _ref3$withoutGoogleFo ===
|
|
469
|
+
withoutGoogleFonts = _ref3$withoutGoogleFo === void 0 ? false : _ref3$withoutGoogleFo;
|
|
470
470
|
var _useContext = useContext(FontsContext),
|
|
471
471
|
_useContext$setGoogle = _useContext.setGoogleFonts,
|
|
472
|
-
setGoogleFonts = _useContext$setGoogle ===
|
|
472
|
+
setGoogleFonts = _useContext$setGoogle === void 0 ? null : _useContext$setGoogle,
|
|
473
473
|
_useContext$systemFon = _useContext.systemFonts,
|
|
474
|
-
systemFonts = _useContext$systemFon ===
|
|
474
|
+
systemFonts = _useContext$systemFon === void 0 ? null : _useContext$systemFon,
|
|
475
475
|
_useContext$googleFon = _useContext.googleFonts,
|
|
476
|
-
googleFonts = _useContext$googleFon ===
|
|
476
|
+
googleFonts = _useContext$googleFon === void 0 ? null : _useContext$googleFon,
|
|
477
477
|
_useContext$customFon = _useContext.customFonts,
|
|
478
|
-
customFonts = _useContext$customFon ===
|
|
478
|
+
customFonts = _useContext$customFon === void 0 ? null : _useContext$customFon;
|
|
479
479
|
useGoogleFonts({
|
|
480
480
|
disabled: withoutGoogleFonts || googleFonts !== null && googleFonts.length > 0,
|
|
481
481
|
setFonts: setGoogleFonts
|
|
@@ -504,9 +504,9 @@ var FontsProvider = function FontsProvider(_ref4) {
|
|
|
504
504
|
children = _ref4.children;
|
|
505
505
|
var _useFonts = useFonts(),
|
|
506
506
|
_useFonts$systemFonts = _useFonts.systemFonts,
|
|
507
|
-
previousSystemFonts = _useFonts$systemFonts ===
|
|
507
|
+
previousSystemFonts = _useFonts$systemFonts === void 0 ? null : _useFonts$systemFonts,
|
|
508
508
|
_useFonts$googleFonts = _useFonts.googleFonts,
|
|
509
|
-
previousGoogleFonts = _useFonts$googleFonts ===
|
|
509
|
+
previousGoogleFonts = _useFonts$googleFonts === void 0 ? null : _useFonts$googleFonts,
|
|
510
510
|
previousCustomFonts = _useFonts.customFonts;
|
|
511
511
|
var _useState3 = useState(null),
|
|
512
512
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
@@ -540,9 +540,9 @@ var useGoogleApiClient = function useGoogleApiClient() {
|
|
|
540
540
|
var withGoogleApiClient = function withGoogleApiClient(WrappedComponent) {
|
|
541
541
|
var getDisplayName = function getDisplayName(_ref) {
|
|
542
542
|
var _ref$displayName = _ref.displayName,
|
|
543
|
-
displayName = _ref$displayName ===
|
|
543
|
+
displayName = _ref$displayName === void 0 ? null : _ref$displayName,
|
|
544
544
|
_ref$name = _ref.name,
|
|
545
|
-
name = _ref$name ===
|
|
545
|
+
name = _ref$name === void 0 ? null : _ref$name;
|
|
546
546
|
return displayName || name || 'Component';
|
|
547
547
|
};
|
|
548
548
|
var WithGoogleApiClientComponent = function WithGoogleApiClientComponent(props) {
|
|
@@ -592,9 +592,9 @@ var useGoogleMapsClient = function useGoogleMapsClient() {
|
|
|
592
592
|
var withGoogleMapsClient = function withGoogleMapsClient(WrappedComponent) {
|
|
593
593
|
var getDisplayName = function getDisplayName(_ref) {
|
|
594
594
|
var _ref$displayName = _ref.displayName,
|
|
595
|
-
displayName = _ref$displayName ===
|
|
595
|
+
displayName = _ref$displayName === void 0 ? null : _ref$displayName,
|
|
596
596
|
_ref$name = _ref.name,
|
|
597
|
-
name = _ref$name ===
|
|
597
|
+
name = _ref$name === void 0 ? null : _ref$name;
|
|
598
598
|
return displayName || name || 'Component';
|
|
599
599
|
};
|
|
600
600
|
var WithGoogleMapsClientComponent = function WithGoogleMapsClientComponent(props) {
|
|
@@ -1009,14 +1009,14 @@ var useRoutePush = function useRoutePush() {
|
|
|
1009
1009
|
args[_key - 2] = arguments[_key];
|
|
1010
1010
|
}
|
|
1011
1011
|
if (isString(route)) {
|
|
1012
|
-
navigate.apply(
|
|
1012
|
+
navigate.apply(void 0, [url(route, data)].concat(args));
|
|
1013
1013
|
} else {
|
|
1014
1014
|
var _ref = route || {},
|
|
1015
1015
|
_ref$pathname = _ref.pathname,
|
|
1016
|
-
pathname = _ref$pathname ===
|
|
1016
|
+
pathname = _ref$pathname === void 0 ? null : _ref$pathname,
|
|
1017
1017
|
_ref$search = _ref.search,
|
|
1018
|
-
search = _ref$search ===
|
|
1019
|
-
navigate.apply(
|
|
1018
|
+
search = _ref$search === void 0 ? null : _ref$search;
|
|
1019
|
+
navigate.apply(void 0, ["".concat(url(pathname, data)).concat(search !== null ? "?".concat(search) : '')].concat(args));
|
|
1020
1020
|
}
|
|
1021
1021
|
}, [navigate, url]);
|
|
1022
1022
|
return push;
|
|
@@ -1044,10 +1044,10 @@ var useScreenDefinition = function useScreenDefinition() {
|
|
|
1044
1044
|
var intl = useIntl();
|
|
1045
1045
|
var _ref = useScreen() || {},
|
|
1046
1046
|
_ref$definition = _ref.definition,
|
|
1047
|
-
definition = _ref$definition ===
|
|
1047
|
+
definition = _ref$definition === void 0 ? null : _ref$definition;
|
|
1048
1048
|
var _ref2 = definition || {},
|
|
1049
1049
|
_ref2$fields = _ref2.fields,
|
|
1050
|
-
fields = _ref2$fields ===
|
|
1050
|
+
fields = _ref2$fields === void 0 ? null : _ref2$fields;
|
|
1051
1051
|
var finalFields = useMemo(function () {
|
|
1052
1052
|
return fields !== null ? [].concat(_toConsumableArray(fields), [getScreenExtraField(intl)]) : null;
|
|
1053
1053
|
}, [fields]);
|
|
@@ -1063,7 +1063,7 @@ var useScreenData = function useScreenData() {
|
|
|
1063
1063
|
var useScreenRenderContext = function useScreenRenderContext() {
|
|
1064
1064
|
var _ref4 = useScreen() || {},
|
|
1065
1065
|
_ref4$renderContext = _ref4.renderContext,
|
|
1066
|
-
renderContext = _ref4$renderContext ===
|
|
1066
|
+
renderContext = _ref4$renderContext === void 0 ? 'view' : _ref4$renderContext;
|
|
1067
1067
|
var isPlaceholder = renderContext === 'placeholder';
|
|
1068
1068
|
var isPreview = renderContext === 'preview';
|
|
1069
1069
|
var isEdit = renderContext === 'edit';
|
|
@@ -1106,17 +1106,17 @@ var ScreenProvider = function ScreenProvider(_ref6) {
|
|
|
1106
1106
|
children = _ref6.children;
|
|
1107
1107
|
var _ref7 = useScreen() || {},
|
|
1108
1108
|
_ref7$data = _ref7.data,
|
|
1109
|
-
previousData = _ref7$data ===
|
|
1109
|
+
previousData = _ref7$data === void 0 ? null : _ref7$data,
|
|
1110
1110
|
_ref7$definition = _ref7.definition,
|
|
1111
|
-
previousDefinition = _ref7$definition ===
|
|
1111
|
+
previousDefinition = _ref7$definition === void 0 ? null : _ref7$definition,
|
|
1112
1112
|
_ref7$renderContext = _ref7.renderContext,
|
|
1113
|
-
previousContext = _ref7$renderContext ===
|
|
1113
|
+
previousContext = _ref7$renderContext === void 0 ? null : _ref7$renderContext,
|
|
1114
1114
|
_ref7$screenState = _ref7.screenState,
|
|
1115
|
-
previousScreenState = _ref7$screenState ===
|
|
1115
|
+
previousScreenState = _ref7$screenState === void 0 ? null : _ref7$screenState;
|
|
1116
1116
|
var finalData = data || previousData || null;
|
|
1117
1117
|
var _ref8 = finalData || {},
|
|
1118
1118
|
_ref8$type = _ref8.type,
|
|
1119
|
-
type = _ref8$type ===
|
|
1119
|
+
type = _ref8$type === void 0 ? null : _ref8$type;
|
|
1120
1120
|
var screensManager = useScreensManager();
|
|
1121
1121
|
var contextDefinition = screensManager !== null ? screensManager.getDefinition(type) : null;
|
|
1122
1122
|
var finalDefinition = definition || contextDefinition || previousDefinition;
|
|
@@ -1263,7 +1263,7 @@ var useViewerEvents = function useViewerEvents() {
|
|
|
1263
1263
|
var useViewerContainer = function useViewerContainer() {
|
|
1264
1264
|
var _useViewerContext4 = useViewerContext(),
|
|
1265
1265
|
_useViewerContext4$co = _useViewerContext4.containerRef,
|
|
1266
|
-
containerRef = _useViewerContext4$co ===
|
|
1266
|
+
containerRef = _useViewerContext4$co === void 0 ? null : _useViewerContext4$co;
|
|
1267
1267
|
return containerRef !== null ? containerRef.current : null;
|
|
1268
1268
|
};
|
|
1269
1269
|
var useViewerInteraction = function useViewerInteraction() {
|