@micromag/core 0.3.25 → 0.3.32
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 +2 -2
- package/es/contexts.js +0 -1
- package/es/index.js +2 -2
- package/es/utils.js +17 -1
- package/lib/components.js +2 -2
- package/lib/contexts.js +0 -1
- package/lib/index.js +2 -2
- package/lib/utils.js +17 -0
- package/package.json +2 -2
package/es/components.js
CHANGED
|
@@ -1107,7 +1107,7 @@ var Dropdown = function Dropdown(_ref) {
|
|
|
1107
1107
|
onClickItem(e);
|
|
1108
1108
|
}
|
|
1109
1109
|
} : null;
|
|
1110
|
-
return ItemComponent !== null ? /*#__PURE__*/React.createElement("
|
|
1110
|
+
return ItemComponent !== null ? /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(ItemComponent, Object.assign({
|
|
1111
1111
|
key: "item-".concat(index, "-").concat(label),
|
|
1112
1112
|
className: classNames([(_ref3 = {
|
|
1113
1113
|
'dropdown-item': type === 'link' || type === 'button',
|
|
@@ -2307,7 +2307,7 @@ var Media = function Media(_ref) {
|
|
|
2307
2307
|
}) : thumbnail, title !== null || children !== null ? /*#__PURE__*/React.createElement("div", {
|
|
2308
2308
|
className: classNames(['card-body', styles$e.body, _defineProperty({}, bodyClassName, bodyClassName !== null)])
|
|
2309
2309
|
}, title !== null ? /*#__PURE__*/React.createElement("h5", {
|
|
2310
|
-
className: classNames(['mt-0', styles$e.title, _defineProperty({}, titleClassName, titleClassName !== null)])
|
|
2310
|
+
className: classNames(['mt-0', 'text-truncate', styles$e.title, _defineProperty({}, titleClassName, titleClassName !== null)])
|
|
2311
2311
|
}, /*#__PURE__*/React.createElement(Label, null, title)) : null, children) : null);
|
|
2312
2312
|
};
|
|
2313
2313
|
|
package/es/contexts.js
CHANGED
package/es/index.js
CHANGED
|
@@ -1864,8 +1864,8 @@ var Tracking = /*#__PURE__*/function (_BaseTracking) {
|
|
|
1864
1864
|
var _ref3 = metadata || {},
|
|
1865
1865
|
screenTitle = _ref3.title;
|
|
1866
1866
|
|
|
1867
|
-
if (this.screensViewed.indexOf(screenId ||
|
|
1868
|
-
this.screensViewed = [].concat(_toConsumableArray(this.screensViewed), [screenId ||
|
|
1867
|
+
if (this.screensViewed.indexOf(screenId || screenIndex) !== -1) {
|
|
1868
|
+
this.screensViewed = [].concat(_toConsumableArray(this.screensViewed), [screenId || screenIndex]);
|
|
1869
1869
|
}
|
|
1870
1870
|
|
|
1871
1871
|
var data = {
|
package/es/utils.js
CHANGED
|
@@ -739,4 +739,20 @@ var validateFields = function validateFields(fields, value) {
|
|
|
739
739
|
}, true);
|
|
740
740
|
};
|
|
741
741
|
|
|
742
|
-
|
|
742
|
+
var getContrastingColor = function getContrastingColor(backgroundColor) {
|
|
743
|
+
var _ref = backgroundColor || {},
|
|
744
|
+
_ref$color = _ref.color,
|
|
745
|
+
color = _ref$color === void 0 ? 'white' : _ref$color;
|
|
746
|
+
|
|
747
|
+
if (tinycolor.equals(color, tinycolor('white'))) {
|
|
748
|
+
return 'lightblue';
|
|
749
|
+
}
|
|
750
|
+
|
|
751
|
+
if (tinycolor.equals(color, tinycolor('black'))) {
|
|
752
|
+
return 'white';
|
|
753
|
+
}
|
|
754
|
+
|
|
755
|
+
return tinycolor(color).spin(30).toString();
|
|
756
|
+
};
|
|
757
|
+
|
|
758
|
+
export { convertStyleToString, createNullableOnChange, createUseEvent, getColorAsString, getComponentFromName, getContrastingColor, getDeviceScreens, getDisplayName, getFieldByName, getFieldFromPath, getFileName, getFontFamily as getFontFamilyFromFont, getGridLayoutName, largestRemainderRound as getLargestRemainderRound, getLayersFromBackground, getLayoutParts, getMediaFilesAsArray, getOptimalImageUrl, getScreenExtraField, getSecondsFromTime, getStyleFromBorder, getStyleFromBox, getStyleFromColor, getStyleFromContainer, getStyleFromHighlight, getStyleFromImage, getStyleFromLink, getStyleFromMargin, getStyleFromText, isImageFilled, isIos, isTextFilled$1 as isLabelFilled, isMessage, isTextFilled, isValidUrl, schemaId, setValue as setFieldValue, slug, unique, validateFields };
|
package/lib/components.js
CHANGED
|
@@ -1130,7 +1130,7 @@ var Dropdown = function Dropdown(_ref) {
|
|
|
1130
1130
|
onClickItem(e);
|
|
1131
1131
|
}
|
|
1132
1132
|
} : null;
|
|
1133
|
-
return ItemComponent !== null ? /*#__PURE__*/React__default["default"].createElement("
|
|
1133
|
+
return ItemComponent !== null ? /*#__PURE__*/React__default["default"].createElement("div", null, /*#__PURE__*/React__default["default"].createElement(ItemComponent, Object.assign({
|
|
1134
1134
|
key: "item-".concat(index, "-").concat(label),
|
|
1135
1135
|
className: classNames__default["default"]([(_ref3 = {
|
|
1136
1136
|
'dropdown-item': type === 'link' || type === 'button',
|
|
@@ -2330,7 +2330,7 @@ var Media = function Media(_ref) {
|
|
|
2330
2330
|
}) : thumbnail, title !== null || children !== null ? /*#__PURE__*/React__default["default"].createElement("div", {
|
|
2331
2331
|
className: classNames__default["default"](['card-body', styles$e.body, _defineProperty__default["default"]({}, bodyClassName, bodyClassName !== null)])
|
|
2332
2332
|
}, title !== null ? /*#__PURE__*/React__default["default"].createElement("h5", {
|
|
2333
|
-
className: classNames__default["default"](['mt-0', styles$e.title, _defineProperty__default["default"]({}, titleClassName, titleClassName !== null)])
|
|
2333
|
+
className: classNames__default["default"](['mt-0', 'text-truncate', styles$e.title, _defineProperty__default["default"]({}, titleClassName, titleClassName !== null)])
|
|
2334
2334
|
}, /*#__PURE__*/React__default["default"].createElement(Label, null, title)) : null, children) : null);
|
|
2335
2335
|
};
|
|
2336
2336
|
|
package/lib/contexts.js
CHANGED
package/lib/index.js
CHANGED
|
@@ -1890,8 +1890,8 @@ var Tracking = /*#__PURE__*/function (_BaseTracking) {
|
|
|
1890
1890
|
var _ref3 = metadata || {},
|
|
1891
1891
|
screenTitle = _ref3.title;
|
|
1892
1892
|
|
|
1893
|
-
if (this.screensViewed.indexOf(screenId ||
|
|
1894
|
-
this.screensViewed = [].concat(_toConsumableArray__default["default"](this.screensViewed), [screenId ||
|
|
1893
|
+
if (this.screensViewed.indexOf(screenId || screenIndex) !== -1) {
|
|
1894
|
+
this.screensViewed = [].concat(_toConsumableArray__default["default"](this.screensViewed), [screenId || screenIndex]);
|
|
1895
1895
|
}
|
|
1896
1896
|
|
|
1897
1897
|
var data = {
|
package/lib/utils.js
CHANGED
|
@@ -756,6 +756,22 @@ var validateFields = function validateFields(fields, value) {
|
|
|
756
756
|
}, true);
|
|
757
757
|
};
|
|
758
758
|
|
|
759
|
+
var getContrastingColor = function getContrastingColor(backgroundColor) {
|
|
760
|
+
var _ref = backgroundColor || {},
|
|
761
|
+
_ref$color = _ref.color,
|
|
762
|
+
color = _ref$color === void 0 ? 'white' : _ref$color;
|
|
763
|
+
|
|
764
|
+
if (tinycolor__default["default"].equals(color, tinycolor__default["default"]('white'))) {
|
|
765
|
+
return 'lightblue';
|
|
766
|
+
}
|
|
767
|
+
|
|
768
|
+
if (tinycolor__default["default"].equals(color, tinycolor__default["default"]('black'))) {
|
|
769
|
+
return 'white';
|
|
770
|
+
}
|
|
771
|
+
|
|
772
|
+
return tinycolor__default["default"](color).spin(30).toString();
|
|
773
|
+
};
|
|
774
|
+
|
|
759
775
|
Object.defineProperty(exports, 'pascalCase', {
|
|
760
776
|
enumerable: true,
|
|
761
777
|
get: function () { return changeCase.pascalCase; }
|
|
@@ -769,6 +785,7 @@ exports.createNullableOnChange = createNullableOnChange;
|
|
|
769
785
|
exports.createUseEvent = createUseEvent;
|
|
770
786
|
exports.getColorAsString = getColorAsString;
|
|
771
787
|
exports.getComponentFromName = getComponentFromName;
|
|
788
|
+
exports.getContrastingColor = getContrastingColor;
|
|
772
789
|
exports.getDeviceScreens = getDeviceScreens;
|
|
773
790
|
exports.getDisplayName = getDisplayName;
|
|
774
791
|
exports.getFieldByName = getFieldByName;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@micromag/core",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.32",
|
|
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": "fff733f2cf1fea7ffc64179d7da0c9601d61e23e"
|
|
136
136
|
}
|