@micromag/core 0.4.45 → 0.4.48
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 +31 -34
- package/es/contexts.d.ts +98 -94
- package/es/contexts.js +70 -66
- package/es/hooks.d.ts +8 -1
- package/es/hooks.js +10 -3
- package/es/index.d.ts +223 -317
- package/es/index.js +1 -3
- package/es/utils.d.ts +7 -2
- package/es/utils.js +5 -1
- package/lib/components.js +31 -34
- package/lib/contexts.js +172 -168
- package/lib/hooks.js +10 -3
- package/lib/index.js +1 -3
- package/lib/utils.js +5 -0
- package/package.json +2 -2
- package/components.js +0 -1
- package/contexts.js +0 -1
- package/hooks.js +0 -1
- package/utils.js +0 -1
package/lib/hooks.js
CHANGED
|
@@ -19,6 +19,7 @@ var raf = require('raf');
|
|
|
19
19
|
var createDebug = require('debug');
|
|
20
20
|
var isString = require('lodash/isString');
|
|
21
21
|
var contexts = require('@micromag/core/contexts');
|
|
22
|
+
var isEmpty = require('lodash/isEmpty');
|
|
22
23
|
var hooks = require('@folklore/hooks');
|
|
23
24
|
var cssMediaquery = require('css-mediaquery');
|
|
24
25
|
var reactIntl = require('react-intl');
|
|
@@ -1942,9 +1943,15 @@ var useParsedStory = function useParsedStory(story) {
|
|
|
1942
1943
|
return newStory;
|
|
1943
1944
|
};
|
|
1944
1945
|
|
|
1945
|
-
|
|
1946
|
-
|
|
1947
|
-
|
|
1946
|
+
function usePlaceholderStyle(selector, placeholderStyle) {
|
|
1947
|
+
var styles = placeholderStyle !== null ? Object.keys(placeholderStyle).reduce(function (styles, key) {
|
|
1948
|
+
var value = placeholderStyle[key];
|
|
1949
|
+
return !isEmpty(value) ? _objectSpread(_objectSpread({}, styles), {}, _defineProperty({}, key.replace(/([a-z0-9])([A-Z])/g, '$1-$2').toLowerCase(), value)) : styles;
|
|
1950
|
+
}, {}) : null;
|
|
1951
|
+
return styles !== null && Object.keys(styles).length > 0 ? "\n ".concat(selector, "::placeholder {\n ").concat(Object.keys(styles).map(function (key) {
|
|
1952
|
+
return "".concat(key, ": ").concat(styles[key], ";");
|
|
1953
|
+
}).join('\n'), "\n }\n ") : null;
|
|
1954
|
+
}
|
|
1948
1955
|
|
|
1949
1956
|
function useProgressSteps() {
|
|
1950
1957
|
var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
package/lib/index.js
CHANGED
|
@@ -279,7 +279,7 @@ var ComponentsManager = /*#__PURE__*/function (_EventEmitter) {
|
|
|
279
279
|
var pattern = new RegExp("^".concat(namespace, "\\.(.*)$"));
|
|
280
280
|
var matches = pattern.exec(name);
|
|
281
281
|
return matches !== null ? _objectSpread(_objectSpread({}, componentsMap), {}, _defineProperty({}, matches[1], _this3.components[name])) : componentsMap;
|
|
282
|
-
},
|
|
282
|
+
}, {}) : this.components;
|
|
283
283
|
}
|
|
284
284
|
}, {
|
|
285
285
|
key: "hasComponent",
|
|
@@ -438,8 +438,6 @@ var FieldsManager = /*#__PURE__*/function (_DefinitionsManager) {
|
|
|
438
438
|
key: "filter",
|
|
439
439
|
value: function filter(_filter) {
|
|
440
440
|
return new FieldsManager(this.definitions.filter(_filter));
|
|
441
|
-
// this.definitions = this.definitions.filter(filter);
|
|
442
|
-
// return this;
|
|
443
441
|
}
|
|
444
442
|
}]);
|
|
445
443
|
}(DefinitionsManager);
|
package/lib/utils.js
CHANGED
|
@@ -173,6 +173,10 @@ var createUseEvent = function createUseEvent(eventsManager) {
|
|
|
173
173
|
};
|
|
174
174
|
};
|
|
175
175
|
|
|
176
|
+
function cssEscape(value) {
|
|
177
|
+
return typeof CSS !== 'undefined' && typeof CSS.escape === 'function' ? CSS.escape(value) : value.replace(/([^\x00-\x7F]|[!"#$%&'()*+,.\/:;<=>?@\[\\\]^`{|}~])/g, '\\$1');
|
|
178
|
+
}
|
|
179
|
+
|
|
176
180
|
/* eslint-disable */
|
|
177
181
|
var easings = {
|
|
178
182
|
linear: function linear(x) {
|
|
@@ -1217,6 +1221,7 @@ exports.convertStyleToString = convertStyleToString;
|
|
|
1217
1221
|
exports.copyToClipboard = copyToClipboard;
|
|
1218
1222
|
exports.createNullableOnChange = createNullableOnChange;
|
|
1219
1223
|
exports.createUseEvent = createUseEvent;
|
|
1224
|
+
exports.cssEscape = cssEscape;
|
|
1220
1225
|
exports.easings = easings;
|
|
1221
1226
|
exports.getColorAsString = getColorAsString;
|
|
1222
1227
|
exports.getComponentFromName = getComponentFromName;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@micromag/core",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.48",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "",
|
|
6
6
|
"keywords": [
|
|
@@ -161,6 +161,6 @@
|
|
|
161
161
|
"access": "public",
|
|
162
162
|
"registry": "https://registry.npmjs.org/"
|
|
163
163
|
},
|
|
164
|
-
"gitHead": "
|
|
164
|
+
"gitHead": "d6772865be1ee3f2d19288ebfbf4b9b6860f4cd7",
|
|
165
165
|
"types": "es/index.d.ts"
|
|
166
166
|
}
|
package/components.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
module.exports = require('./lib/components');
|
package/contexts.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
module.exports = require('./lib/contexts');
|
package/hooks.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
module.exports = require('./lib/hooks');
|
package/utils.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
module.exports = require('./lib/utils');
|