@micromag/core 0.3.507 → 0.3.509
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/css/styles.css +12 -12
- package/assets/css/vendor.css +1 -1
- package/es/components.js +11 -6
- package/es/contexts.js +69 -611
- package/es/index.js +3 -2
- package/es/utils.js +3 -3
- package/lib/components.js +590 -11
- package/lib/contexts.js +72 -617
- package/lib/index.js +105 -70
- package/lib/utils.js +127 -89
- package/package.json +13 -23
- package/scss/_theme.scss +43 -30
- package/scss/vendor.scss +14 -0
package/es/components.js
CHANGED
|
@@ -3,7 +3,7 @@ import PropTypes$1 from 'prop-types';
|
|
|
3
3
|
import React, { useCallback, useState, useEffect, useRef, useMemo, Suspense } from 'react';
|
|
4
4
|
import { PropTypes } from '@micromag/core';
|
|
5
5
|
import { isMessage, getFieldFromPath, getComponentFromName, setFieldValue, validateFields, getDisplayName, pascalCase, convertStyleToString } from '@micromag/core/utils';
|
|
6
|
-
import { useFieldsManager, useFieldComponent, FieldContextProvider, withModals, useModals,
|
|
6
|
+
import { useFieldsManager, useFieldComponent, FieldContextProvider, withModals, useModals, withPanels, usePanels, ScreenSizeProvider, useScreenComponent, ScreenProvider, useScreenRenderContext, useScreenSize } from '@micromag/core/contexts';
|
|
7
7
|
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
8
8
|
import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
|
|
9
9
|
import { useSpring } from '@react-spring/core';
|
|
@@ -20,6 +20,7 @@ import get from 'lodash/get';
|
|
|
20
20
|
import queryString from 'query-string';
|
|
21
21
|
import ReactDOM from 'react-dom';
|
|
22
22
|
import isArray from 'lodash/isArray';
|
|
23
|
+
import { useUppy } from '@panneau/uppy';
|
|
23
24
|
import { faAngleDown } from '@fortawesome/free-solid-svg-icons/faAngleDown';
|
|
24
25
|
import { faAngleUp } from '@fortawesome/free-solid-svg-icons/faAngleUp';
|
|
25
26
|
import dayjs from 'dayjs';
|
|
@@ -66,7 +67,7 @@ Label.propTypes = propTypes$T;
|
|
|
66
67
|
Label.defaultProps = defaultProps$T;
|
|
67
68
|
var Label$1 = Label;
|
|
68
69
|
|
|
69
|
-
var styles$x = {"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"
|
|
70
|
+
var styles$x = {"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"};
|
|
70
71
|
|
|
71
72
|
var _excluded$b = ["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"];
|
|
72
73
|
var propTypes$S = {
|
|
@@ -1882,6 +1883,7 @@ var propTypes$r = {
|
|
|
1882
1883
|
header: PropTypes$1.node,
|
|
1883
1884
|
children: PropTypes$1.node,
|
|
1884
1885
|
footer: PropTypes$1.node,
|
|
1886
|
+
size: PropTypes$1.string,
|
|
1885
1887
|
buttons: PropTypes.buttons,
|
|
1886
1888
|
// theme: PropTypes.oneOf([null, 'dark', 'light']),
|
|
1887
1889
|
onClickClose: PropTypes$1.func,
|
|
@@ -1893,6 +1895,7 @@ var defaultProps$r = {
|
|
|
1893
1895
|
header: null,
|
|
1894
1896
|
children: null,
|
|
1895
1897
|
footer: null,
|
|
1898
|
+
size: null,
|
|
1896
1899
|
buttons: null,
|
|
1897
1900
|
// theme: 'dark',
|
|
1898
1901
|
onClickClose: null,
|
|
@@ -1905,11 +1908,12 @@ var ModalDialog = function ModalDialog(_ref) {
|
|
|
1905
1908
|
children = _ref.children,
|
|
1906
1909
|
buttons = _ref.buttons,
|
|
1907
1910
|
footer = _ref.footer,
|
|
1911
|
+
size = _ref.size,
|
|
1908
1912
|
onClickClose = _ref.onClickClose,
|
|
1909
1913
|
className = _ref.className,
|
|
1910
1914
|
bodyClassName = _ref.bodyClassName;
|
|
1911
1915
|
return /*#__PURE__*/React.createElement("div", {
|
|
1912
|
-
className: classNames(['modal-dialog',
|
|
1916
|
+
className: classNames([styles$l.container, 'modal-dialog', _defineProperty(_defineProperty({}, "modal-".concat(size), size !== null), className, className)]),
|
|
1913
1917
|
role: "dialog"
|
|
1914
1918
|
}, /*#__PURE__*/React.createElement("div", {
|
|
1915
1919
|
className: "modal-content"
|
|
@@ -1927,7 +1931,7 @@ var ModalDialog = function ModalDialog(_ref) {
|
|
|
1927
1931
|
"aria-label": "Close",
|
|
1928
1932
|
onClick: onClickClose
|
|
1929
1933
|
})), /*#__PURE__*/React.createElement("div", {
|
|
1930
|
-
className: classNames(['modal-body', 'p-2',
|
|
1934
|
+
className: classNames(['modal-body', 'p-2', _defineProperty({}, bodyClassName, bodyClassName !== null)])
|
|
1931
1935
|
}, children), footer !== null || buttons !== null ? /*#__PURE__*/React.createElement("div", {
|
|
1932
1936
|
className: classNames(['modal-footer', styles$l.footer])
|
|
1933
1937
|
}, footer, buttons !== null ? /*#__PURE__*/React.createElement(Buttons$1, {
|
|
@@ -1991,7 +1995,7 @@ var UploadModal = function UploadModal(_ref2) {
|
|
|
1991
1995
|
});
|
|
1992
1996
|
useEffect(function () {
|
|
1993
1997
|
if (uppy !== null && !opened) {
|
|
1994
|
-
uppy.
|
|
1998
|
+
uppy.cancelAll();
|
|
1995
1999
|
}
|
|
1996
2000
|
}, [uppy, opened]);
|
|
1997
2001
|
return uppy !== null ? /*#__PURE__*/React.createElement(Suspense, {
|
|
@@ -2766,10 +2770,11 @@ PropTypes$1.shape({
|
|
|
2766
2770
|
var font = PropTypes$1.oneOfType([PropTypes$1.object, PropTypes$1.string]);
|
|
2767
2771
|
PropTypes$1.arrayOf(font);
|
|
2768
2772
|
var textAlign = PropTypes$1.oneOf(['left', 'right', 'center']);
|
|
2769
|
-
var
|
|
2773
|
+
var colorObject = PropTypes$1.shape({
|
|
2770
2774
|
color: PropTypes$1.string,
|
|
2771
2775
|
alpha: PropTypes$1.number
|
|
2772
2776
|
});
|
|
2777
|
+
var color = PropTypes$1.oneOfType([colorObject, PropTypes$1.string]);
|
|
2773
2778
|
var textStyle = PropTypes$1.shape({
|
|
2774
2779
|
fontFamily: font,
|
|
2775
2780
|
fontSize: PropTypes$1.number,
|