@micromag/core 0.3.18 → 0.3.23
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 +0 -1
- package/es/components.js +25 -7
- package/es/contexts.js +9 -4
- package/es/index.js +1 -1
- package/lib/components.js +25 -7
- package/lib/contexts.js +9 -4
- package/lib/index.js +1 -1
- package/package.json +2 -2
package/assets/css/styles.css
CHANGED
|
@@ -5,7 +5,6 @@
|
|
|
5
5
|
|
|
6
6
|
.micromag-core-menus-breadcrumb-container .micromag-core-menus-breadcrumb-arrow+.micromag-core-menus-breadcrumb-arrow:before{content:">"}
|
|
7
7
|
|
|
8
|
-
|
|
9
8
|
.micromag-core-menus-tabs-container{display:inline-block;position:relative}
|
|
10
9
|
.micromag-core-modals-container{position:static}.micromag-core-modals-modals.micromag-core-modals-hasModals{position:fixed;z-index:1000;top:0;right:0;bottom:0;left:0;background-color:rgba(28,28,28,.2)}
|
|
11
10
|
.micromag-core-modals-modal-container{position:absolute;top:0;left:0;width:100%;height:100%;display:-webkit-flex;display:-ms-flexbox;display:flex;overflow-y:auto}.micromag-core-modals-modal-container.micromag-core-modals-modal-center>.micromag-core-modals-modal-inner{margin:auto}.micromag-core-modals-modal-container.micromag-core-modals-modal-top>.micromag-core-modals-modal-inner{margin:0 auto;padding:1.75rem 0}
|
package/es/components.js
CHANGED
|
@@ -1011,7 +1011,7 @@ var Breadcrumb = function Breadcrumb(_ref) {
|
|
|
1011
1011
|
Breadcrumb.propTypes = propTypes$A;
|
|
1012
1012
|
Breadcrumb.defaultProps = defaultProps$A;
|
|
1013
1013
|
|
|
1014
|
-
var _excluded$3 = ["
|
|
1014
|
+
var _excluded$3 = ["type", "className", "label", "children", "onClick", "active"];
|
|
1015
1015
|
var propTypes$z = {
|
|
1016
1016
|
items: PropTypes.menuItems,
|
|
1017
1017
|
children: PropTypes$1.node,
|
|
@@ -1045,20 +1045,34 @@ var Dropdown = function Dropdown(_ref) {
|
|
|
1045
1045
|
onClickItem = _ref.onClickItem,
|
|
1046
1046
|
onClickOutside = _ref.onClickOutside;
|
|
1047
1047
|
var refContainer = useRef(null);
|
|
1048
|
+
|
|
1049
|
+
var _useState = useState(visible),
|
|
1050
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
1051
|
+
enabled = _useState2[0],
|
|
1052
|
+
setEnabled = _useState2[1];
|
|
1053
|
+
|
|
1048
1054
|
var onDocumentClick = useCallback(function (e) {
|
|
1049
1055
|
if (refContainer.current && !refContainer.current.contains(e.currentTarget) && onClickOutside !== null) {
|
|
1050
1056
|
onClickOutside(e);
|
|
1051
1057
|
}
|
|
1052
1058
|
}, [refContainer.current, onClickOutside]);
|
|
1053
|
-
useDocumentEvent('click', onDocumentClick,
|
|
1059
|
+
useDocumentEvent('click', onDocumentClick, enabled); // Delay the outside click detection
|
|
1060
|
+
|
|
1061
|
+
useEffect(function () {
|
|
1062
|
+
var id = setTimeout(function () {
|
|
1063
|
+
setEnabled(visible);
|
|
1064
|
+
}, 100);
|
|
1065
|
+
return function () {
|
|
1066
|
+
clearTimeout(id);
|
|
1067
|
+
};
|
|
1068
|
+
}, [visible, setEnabled]);
|
|
1054
1069
|
return /*#__PURE__*/React.createElement("div", {
|
|
1055
1070
|
className: classNames(['dropdown-menu', (_ref2 = {}, _defineProperty(_ref2, "dropdown-menu-".concat(align), align !== null), _defineProperty(_ref2, "show", visible), _defineProperty(_ref2, className, className !== null), _ref2)]),
|
|
1056
1071
|
ref: refContainer
|
|
1057
1072
|
}, children !== null ? children : items.map(function (it, index) {
|
|
1058
1073
|
var _ref3;
|
|
1059
1074
|
|
|
1060
|
-
it.
|
|
1061
|
-
var _it$type = it.type,
|
|
1075
|
+
var _it$type = it.type,
|
|
1062
1076
|
type = _it$type === void 0 ? 'link' : _it$type,
|
|
1063
1077
|
_it$className = it.className,
|
|
1064
1078
|
customClassName = _it$className === void 0 ? null : _it$className,
|
|
@@ -1094,7 +1108,7 @@ var Dropdown = function Dropdown(_ref) {
|
|
|
1094
1108
|
}
|
|
1095
1109
|
} : null;
|
|
1096
1110
|
return ItemComponent !== null ? /*#__PURE__*/React.createElement("li", null, /*#__PURE__*/React.createElement(ItemComponent, Object.assign({
|
|
1097
|
-
key: "item-".concat(index),
|
|
1111
|
+
key: "item-".concat(index, "-").concat(label),
|
|
1098
1112
|
className: classNames([(_ref3 = {
|
|
1099
1113
|
'dropdown-item': type === 'link' || type === 'button',
|
|
1100
1114
|
'dropdown-divider': type === 'divider',
|
|
@@ -2740,7 +2754,7 @@ PropTypes$1.shape({
|
|
|
2740
2754
|
screens: PropTypes$1.arrayOf(PropTypes$1.string),
|
|
2741
2755
|
width: PropTypes$1.number,
|
|
2742
2756
|
height: PropTypes$1.number,
|
|
2743
|
-
landscape: PropTypes$1.
|
|
2757
|
+
landscape: PropTypes$1.bool
|
|
2744
2758
|
});
|
|
2745
2759
|
PropTypes$1.oneOf(['view', 'placeholder', 'edit', 'preview', 'static', 'capture']);
|
|
2746
2760
|
/**
|
|
@@ -3495,7 +3509,11 @@ var Screen = function Screen(_ref) {
|
|
|
3495
3509
|
onEnableInteraction = _ref.onEnableInteraction,
|
|
3496
3510
|
onDisableInteraction = _ref.onDisableInteraction,
|
|
3497
3511
|
getMediaRef = _ref.getMediaRef;
|
|
3498
|
-
|
|
3512
|
+
|
|
3513
|
+
var _ref2 = screen || {},
|
|
3514
|
+
_ref2$type = _ref2.type,
|
|
3515
|
+
type = _ref2$type === void 0 ? null : _ref2$type;
|
|
3516
|
+
|
|
3499
3517
|
var CustomScreenComponent = components !== null ? getComponentFromName(type, components) || null : null;
|
|
3500
3518
|
var ContextScreenComponent = useScreenComponent(type);
|
|
3501
3519
|
var ScreenComponent = CustomScreenComponent || ContextScreenComponent;
|
package/es/contexts.js
CHANGED
|
@@ -1095,7 +1095,8 @@ var useUppyCore = function useUppyCore() {
|
|
|
1095
1095
|
"package": packageCache
|
|
1096
1096
|
}),
|
|
1097
1097
|
_useState2 = _slicedToArray(_useState, 2),
|
|
1098
|
-
|
|
1098
|
+
_useState2$0$package = _useState2[0]["package"],
|
|
1099
|
+
loadedPackage = _useState2$0$package === void 0 ? null : _useState2$0$package,
|
|
1099
1100
|
setLoadedPackage = _useState2[1];
|
|
1100
1101
|
|
|
1101
1102
|
useEffect(function () {
|
|
@@ -1147,7 +1148,8 @@ var useUppyLocale = function useUppyLocale(locale) {
|
|
|
1147
1148
|
"package": packagesCache$2[locale] || null
|
|
1148
1149
|
}),
|
|
1149
1150
|
_useState2 = _slicedToArray(_useState, 2),
|
|
1150
|
-
|
|
1151
|
+
_useState2$0$package = _useState2[0]["package"],
|
|
1152
|
+
loadedPackage = _useState2$0$package === void 0 ? null : _useState2$0$package,
|
|
1151
1153
|
setLoadedPackage = _useState2[1];
|
|
1152
1154
|
|
|
1153
1155
|
var packageLoader = packagesMap[locale] || null;
|
|
@@ -1219,7 +1221,8 @@ var useUppySources = function useUppySources(sources) {
|
|
|
1219
1221
|
}, null)
|
|
1220
1222
|
}),
|
|
1221
1223
|
_useState2 = _slicedToArray(_useState, 2),
|
|
1222
|
-
|
|
1224
|
+
_useState2$0$packages = _useState2[0].packages,
|
|
1225
|
+
loadedPackages = _useState2$0$packages === void 0 ? [] : _useState2$0$packages,
|
|
1223
1226
|
setLoadedPackages = _useState2[1];
|
|
1224
1227
|
|
|
1225
1228
|
var sourcesToLoad = useMemo(function () {
|
|
@@ -1301,7 +1304,8 @@ var useUppyTransport = function useUppyTransport(transport) {
|
|
|
1301
1304
|
"package": packagesCache[transport] || null
|
|
1302
1305
|
}),
|
|
1303
1306
|
_useState2 = _slicedToArray(_useState, 2),
|
|
1304
|
-
|
|
1307
|
+
_useState2$0$package = _useState2[0]["package"],
|
|
1308
|
+
loadedPackage = _useState2$0$package === void 0 ? null : _useState2$0$package,
|
|
1305
1309
|
setLoadedPackage = _useState2[1];
|
|
1306
1310
|
|
|
1307
1311
|
var packageLoader = packagesMap[transport] || null;
|
|
@@ -1554,6 +1558,7 @@ var UppyProvider = function UppyProvider(_ref5) {
|
|
|
1554
1558
|
return null;
|
|
1555
1559
|
}
|
|
1556
1560
|
|
|
1561
|
+
console.log('up', Uppy);
|
|
1557
1562
|
return function () {
|
|
1558
1563
|
var opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
1559
1564
|
|
package/es/index.js
CHANGED
|
@@ -472,7 +472,7 @@ var screenSize = PropTypes$1.shape({
|
|
|
472
472
|
screens: PropTypes$1.arrayOf(PropTypes$1.string),
|
|
473
473
|
width: PropTypes$1.number,
|
|
474
474
|
height: PropTypes$1.number,
|
|
475
|
-
landscape: PropTypes$1.
|
|
475
|
+
landscape: PropTypes$1.bool
|
|
476
476
|
});
|
|
477
477
|
var renderContext = PropTypes$1.oneOf(['view', 'placeholder', 'edit', 'preview', 'static', 'capture']);
|
|
478
478
|
/**
|
package/lib/components.js
CHANGED
|
@@ -1034,7 +1034,7 @@ var Breadcrumb = function Breadcrumb(_ref) {
|
|
|
1034
1034
|
Breadcrumb.propTypes = propTypes$A;
|
|
1035
1035
|
Breadcrumb.defaultProps = defaultProps$A;
|
|
1036
1036
|
|
|
1037
|
-
var _excluded$3 = ["
|
|
1037
|
+
var _excluded$3 = ["type", "className", "label", "children", "onClick", "active"];
|
|
1038
1038
|
var propTypes$z = {
|
|
1039
1039
|
items: core.PropTypes.menuItems,
|
|
1040
1040
|
children: PropTypes__default["default"].node,
|
|
@@ -1068,20 +1068,34 @@ var Dropdown = function Dropdown(_ref) {
|
|
|
1068
1068
|
onClickItem = _ref.onClickItem,
|
|
1069
1069
|
onClickOutside = _ref.onClickOutside;
|
|
1070
1070
|
var refContainer = React.useRef(null);
|
|
1071
|
+
|
|
1072
|
+
var _useState = React.useState(visible),
|
|
1073
|
+
_useState2 = _slicedToArray__default["default"](_useState, 2),
|
|
1074
|
+
enabled = _useState2[0],
|
|
1075
|
+
setEnabled = _useState2[1];
|
|
1076
|
+
|
|
1071
1077
|
var onDocumentClick = React.useCallback(function (e) {
|
|
1072
1078
|
if (refContainer.current && !refContainer.current.contains(e.currentTarget) && onClickOutside !== null) {
|
|
1073
1079
|
onClickOutside(e);
|
|
1074
1080
|
}
|
|
1075
1081
|
}, [refContainer.current, onClickOutside]);
|
|
1076
|
-
hooks.useDocumentEvent('click', onDocumentClick,
|
|
1082
|
+
hooks.useDocumentEvent('click', onDocumentClick, enabled); // Delay the outside click detection
|
|
1083
|
+
|
|
1084
|
+
React.useEffect(function () {
|
|
1085
|
+
var id = setTimeout(function () {
|
|
1086
|
+
setEnabled(visible);
|
|
1087
|
+
}, 100);
|
|
1088
|
+
return function () {
|
|
1089
|
+
clearTimeout(id);
|
|
1090
|
+
};
|
|
1091
|
+
}, [visible, setEnabled]);
|
|
1077
1092
|
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
1078
1093
|
className: classNames__default["default"](['dropdown-menu', (_ref2 = {}, _defineProperty__default["default"](_ref2, "dropdown-menu-".concat(align), align !== null), _defineProperty__default["default"](_ref2, "show", visible), _defineProperty__default["default"](_ref2, className, className !== null), _ref2)]),
|
|
1079
1094
|
ref: refContainer
|
|
1080
1095
|
}, children !== null ? children : items.map(function (it, index) {
|
|
1081
1096
|
var _ref3;
|
|
1082
1097
|
|
|
1083
|
-
it.
|
|
1084
|
-
var _it$type = it.type,
|
|
1098
|
+
var _it$type = it.type,
|
|
1085
1099
|
type = _it$type === void 0 ? 'link' : _it$type,
|
|
1086
1100
|
_it$className = it.className,
|
|
1087
1101
|
customClassName = _it$className === void 0 ? null : _it$className,
|
|
@@ -1117,7 +1131,7 @@ var Dropdown = function Dropdown(_ref) {
|
|
|
1117
1131
|
}
|
|
1118
1132
|
} : null;
|
|
1119
1133
|
return ItemComponent !== null ? /*#__PURE__*/React__default["default"].createElement("li", null, /*#__PURE__*/React__default["default"].createElement(ItemComponent, Object.assign({
|
|
1120
|
-
key: "item-".concat(index),
|
|
1134
|
+
key: "item-".concat(index, "-").concat(label),
|
|
1121
1135
|
className: classNames__default["default"]([(_ref3 = {
|
|
1122
1136
|
'dropdown-item': type === 'link' || type === 'button',
|
|
1123
1137
|
'dropdown-divider': type === 'divider',
|
|
@@ -2763,7 +2777,7 @@ PropTypes__default["default"].shape({
|
|
|
2763
2777
|
screens: PropTypes__default["default"].arrayOf(PropTypes__default["default"].string),
|
|
2764
2778
|
width: PropTypes__default["default"].number,
|
|
2765
2779
|
height: PropTypes__default["default"].number,
|
|
2766
|
-
landscape: PropTypes__default["default"].
|
|
2780
|
+
landscape: PropTypes__default["default"].bool
|
|
2767
2781
|
});
|
|
2768
2782
|
PropTypes__default["default"].oneOf(['view', 'placeholder', 'edit', 'preview', 'static', 'capture']);
|
|
2769
2783
|
/**
|
|
@@ -3518,7 +3532,11 @@ var Screen = function Screen(_ref) {
|
|
|
3518
3532
|
onEnableInteraction = _ref.onEnableInteraction,
|
|
3519
3533
|
onDisableInteraction = _ref.onDisableInteraction,
|
|
3520
3534
|
getMediaRef = _ref.getMediaRef;
|
|
3521
|
-
|
|
3535
|
+
|
|
3536
|
+
var _ref2 = screen || {},
|
|
3537
|
+
_ref2$type = _ref2.type,
|
|
3538
|
+
type = _ref2$type === void 0 ? null : _ref2$type;
|
|
3539
|
+
|
|
3522
3540
|
var CustomScreenComponent = components !== null ? utils.getComponentFromName(type, components) || null : null;
|
|
3523
3541
|
var ContextScreenComponent = contexts.useScreenComponent(type);
|
|
3524
3542
|
var ScreenComponent = CustomScreenComponent || ContextScreenComponent;
|
package/lib/contexts.js
CHANGED
|
@@ -1130,7 +1130,8 @@ var useUppyCore = function useUppyCore() {
|
|
|
1130
1130
|
"package": packageCache
|
|
1131
1131
|
}),
|
|
1132
1132
|
_useState2 = _slicedToArray__default["default"](_useState, 2),
|
|
1133
|
-
|
|
1133
|
+
_useState2$0$package = _useState2[0]["package"],
|
|
1134
|
+
loadedPackage = _useState2$0$package === void 0 ? null : _useState2$0$package,
|
|
1134
1135
|
setLoadedPackage = _useState2[1];
|
|
1135
1136
|
|
|
1136
1137
|
React.useEffect(function () {
|
|
@@ -1182,7 +1183,8 @@ var useUppyLocale = function useUppyLocale(locale) {
|
|
|
1182
1183
|
"package": packagesCache$2[locale] || null
|
|
1183
1184
|
}),
|
|
1184
1185
|
_useState2 = _slicedToArray__default["default"](_useState, 2),
|
|
1185
|
-
|
|
1186
|
+
_useState2$0$package = _useState2[0]["package"],
|
|
1187
|
+
loadedPackage = _useState2$0$package === void 0 ? null : _useState2$0$package,
|
|
1186
1188
|
setLoadedPackage = _useState2[1];
|
|
1187
1189
|
|
|
1188
1190
|
var packageLoader = packagesMap[locale] || null;
|
|
@@ -1254,7 +1256,8 @@ var useUppySources = function useUppySources(sources) {
|
|
|
1254
1256
|
}, null)
|
|
1255
1257
|
}),
|
|
1256
1258
|
_useState2 = _slicedToArray__default["default"](_useState, 2),
|
|
1257
|
-
|
|
1259
|
+
_useState2$0$packages = _useState2[0].packages,
|
|
1260
|
+
loadedPackages = _useState2$0$packages === void 0 ? [] : _useState2$0$packages,
|
|
1258
1261
|
setLoadedPackages = _useState2[1];
|
|
1259
1262
|
|
|
1260
1263
|
var sourcesToLoad = React.useMemo(function () {
|
|
@@ -1336,7 +1339,8 @@ var useUppyTransport = function useUppyTransport(transport) {
|
|
|
1336
1339
|
"package": packagesCache[transport] || null
|
|
1337
1340
|
}),
|
|
1338
1341
|
_useState2 = _slicedToArray__default["default"](_useState, 2),
|
|
1339
|
-
|
|
1342
|
+
_useState2$0$package = _useState2[0]["package"],
|
|
1343
|
+
loadedPackage = _useState2$0$package === void 0 ? null : _useState2$0$package,
|
|
1340
1344
|
setLoadedPackage = _useState2[1];
|
|
1341
1345
|
|
|
1342
1346
|
var packageLoader = packagesMap[transport] || null;
|
|
@@ -1589,6 +1593,7 @@ var UppyProvider = function UppyProvider(_ref5) {
|
|
|
1589
1593
|
return null;
|
|
1590
1594
|
}
|
|
1591
1595
|
|
|
1596
|
+
console.log('up', Uppy);
|
|
1592
1597
|
return function () {
|
|
1593
1598
|
var opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
1594
1599
|
|
package/lib/index.js
CHANGED
|
@@ -498,7 +498,7 @@ var screenSize = PropTypes__default["default"].shape({
|
|
|
498
498
|
screens: PropTypes__default["default"].arrayOf(PropTypes__default["default"].string),
|
|
499
499
|
width: PropTypes__default["default"].number,
|
|
500
500
|
height: PropTypes__default["default"].number,
|
|
501
|
-
landscape: PropTypes__default["default"].
|
|
501
|
+
landscape: PropTypes__default["default"].bool
|
|
502
502
|
});
|
|
503
503
|
var renderContext = PropTypes__default["default"].oneOf(['view', 'placeholder', 'edit', 'preview', 'static', 'capture']);
|
|
504
504
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@micromag/core",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.23",
|
|
4
4
|
"description": "",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"javascript"
|
|
@@ -132,5 +132,5 @@
|
|
|
132
132
|
"publishConfig": {
|
|
133
133
|
"access": "public"
|
|
134
134
|
},
|
|
135
|
-
"gitHead": "
|
|
135
|
+
"gitHead": "0b692c48b420a885265c7d0ccdfcb207dda89e33"
|
|
136
136
|
}
|