@micromag/core 0.3.731 → 0.3.733
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/index.js +19 -154
- package/package.json +2 -2
package/es/index.js
CHANGED
|
@@ -1207,8 +1207,8 @@ var FieldsManager = /*#__PURE__*/function (_DefinitionsManager) {
|
|
|
1207
1207
|
}]);
|
|
1208
1208
|
}(DefinitionsManager);
|
|
1209
1209
|
|
|
1210
|
-
var _excluded$
|
|
1211
|
-
_excluded2$
|
|
1210
|
+
var _excluded$7 = ["medias"],
|
|
1211
|
+
_excluded2$3 = ["medias"];
|
|
1212
1212
|
var MediasParser = /*#__PURE__*/function () {
|
|
1213
1213
|
function MediasParser(_ref) {
|
|
1214
1214
|
var fieldsManager = _ref.fieldsManager,
|
|
@@ -1227,7 +1227,7 @@ var MediasParser = /*#__PURE__*/function () {
|
|
|
1227
1227
|
if (typeof this.parsedThemesCache[storyId] === 'undefined') {
|
|
1228
1228
|
var _this$toPath = this.toPath(theme),
|
|
1229
1229
|
themeMedias = _this$toPath.medias,
|
|
1230
|
-
newTheme = _objectWithoutProperties(_this$toPath, _excluded$
|
|
1230
|
+
newTheme = _objectWithoutProperties(_this$toPath, _excluded$7);
|
|
1231
1231
|
this.parsedThemesCache[storyId] = {
|
|
1232
1232
|
themeMedias: themeMedias,
|
|
1233
1233
|
newTheme: newTheme
|
|
@@ -1281,7 +1281,7 @@ var MediasParser = /*#__PURE__*/function () {
|
|
|
1281
1281
|
if (theme !== null) {
|
|
1282
1282
|
var _this$getParsedStoryT = this.getParsedStoryTheme(storyId, theme),
|
|
1283
1283
|
themeMedias = _this$getParsedStoryT.medias,
|
|
1284
|
-
newTheme = _objectWithoutProperties(_this$getParsedStoryT, _excluded2$
|
|
1284
|
+
newTheme = _objectWithoutProperties(_this$getParsedStoryT, _excluded2$3);
|
|
1285
1285
|
return medias !== null || themeMedias !== null ? _objectSpread(_objectSpread({}, story), {}, {
|
|
1286
1286
|
theme: newTheme,
|
|
1287
1287
|
components: newComponents,
|
|
@@ -1533,7 +1533,7 @@ var ScreensManager = /*#__PURE__*/function (_DefinitionsManager) {
|
|
|
1533
1533
|
}]);
|
|
1534
1534
|
}(DefinitionsManager);
|
|
1535
1535
|
|
|
1536
|
-
var _excluded$
|
|
1536
|
+
var _excluded$6 = ["fonts"];
|
|
1537
1537
|
var FontsParser = /*#__PURE__*/function () {
|
|
1538
1538
|
function FontsParser(_ref) {
|
|
1539
1539
|
var fieldsManager = _ref.fieldsManager,
|
|
@@ -1582,7 +1582,7 @@ var FontsParser = /*#__PURE__*/function () {
|
|
|
1582
1582
|
var _this$parse = this.parse(theme),
|
|
1583
1583
|
_this$parse$fonts = _this$parse.fonts,
|
|
1584
1584
|
themeFonts = _this$parse$fonts === void 0 ? [] : _this$parse$fonts,
|
|
1585
|
-
newTheme = _objectWithoutProperties(_this$parse, _excluded$
|
|
1585
|
+
newTheme = _objectWithoutProperties(_this$parse, _excluded$6);
|
|
1586
1586
|
return fonts.length > 0 || themeFonts.length > 0 ? _objectSpread(_objectSpread({}, story), {}, {
|
|
1587
1587
|
theme: newTheme,
|
|
1588
1588
|
fonts: uniq([].concat(_toConsumableArray(themeFonts), _toConsumableArray(fonts)), 'name')
|
|
@@ -1658,7 +1658,7 @@ var FontsParser = /*#__PURE__*/function () {
|
|
|
1658
1658
|
}]);
|
|
1659
1659
|
}();
|
|
1660
1660
|
|
|
1661
|
-
var _excluded$
|
|
1661
|
+
var _excluded$5 = ["shareIncentive", "callToAction"];
|
|
1662
1662
|
/* eslint-disable class-methods-use-this */
|
|
1663
1663
|
var ShareCall = /*#__PURE__*/function () {
|
|
1664
1664
|
function ShareCall() {
|
|
@@ -1685,7 +1685,7 @@ var ShareCall = /*#__PURE__*/function () {
|
|
|
1685
1685
|
shareIncentive = _ref2$shareIncentive === void 0 ? null : _ref2$shareIncentive,
|
|
1686
1686
|
_ref2$callToAction = _ref2.callToAction,
|
|
1687
1687
|
callToAction = _ref2$callToAction === void 0 ? null : _ref2$callToAction,
|
|
1688
|
-
restScreen = _objectWithoutProperties(_ref2, _excluded$
|
|
1688
|
+
restScreen = _objectWithoutProperties(_ref2, _excluded$5);
|
|
1689
1689
|
var _ref3 = screen || {},
|
|
1690
1690
|
_ref3$header = _ref3.header,
|
|
1691
1691
|
header = _ref3$header === void 0 ? null : _ref3$header,
|
|
@@ -1714,8 +1714,8 @@ var ShareCall = /*#__PURE__*/function () {
|
|
|
1714
1714
|
}();
|
|
1715
1715
|
ShareCall.prototype.priority = 0;
|
|
1716
1716
|
|
|
1717
|
-
var _excluded$
|
|
1718
|
-
_excluded2$
|
|
1717
|
+
var _excluded$4 = ["answers"],
|
|
1718
|
+
_excluded2$2 = ["customAnswerLabel"];
|
|
1719
1719
|
/* eslint-disable class-methods-use-this */
|
|
1720
1720
|
var CustomAnswerLabel = /*#__PURE__*/function () {
|
|
1721
1721
|
function CustomAnswerLabel() {
|
|
@@ -1745,7 +1745,7 @@ var CustomAnswerLabel = /*#__PURE__*/function () {
|
|
|
1745
1745
|
var _ref2 = screen || {},
|
|
1746
1746
|
_ref2$answers = _ref2.answers,
|
|
1747
1747
|
answers = _ref2$answers === void 0 ? null : _ref2$answers,
|
|
1748
|
-
restScreen = _objectWithoutProperties(_ref2, _excluded$
|
|
1748
|
+
restScreen = _objectWithoutProperties(_ref2, _excluded$4);
|
|
1749
1749
|
return _objectSpread(_objectSpread({}, restScreen), {}, {
|
|
1750
1750
|
answers: answers.map(function () {
|
|
1751
1751
|
var answer = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
|
|
@@ -1754,7 +1754,7 @@ var CustomAnswerLabel = /*#__PURE__*/function () {
|
|
|
1754
1754
|
}
|
|
1755
1755
|
var _ref3 = answer || {},
|
|
1756
1756
|
customAnswerLabel = _ref3.customAnswerLabel,
|
|
1757
|
-
restAnswer = _objectWithoutProperties(_ref3, _excluded2$
|
|
1757
|
+
restAnswer = _objectWithoutProperties(_ref3, _excluded2$2);
|
|
1758
1758
|
return _objectSpread(_objectSpread({}, restAnswer), {}, {
|
|
1759
1759
|
result: customAnswerLabel
|
|
1760
1760
|
});
|
|
@@ -1765,8 +1765,8 @@ var CustomAnswerLabel = /*#__PURE__*/function () {
|
|
|
1765
1765
|
}();
|
|
1766
1766
|
CustomAnswerLabel.prototype.priority = 1;
|
|
1767
1767
|
|
|
1768
|
-
var _excluded$
|
|
1769
|
-
_excluded2$
|
|
1768
|
+
var _excluded$3 = ["items"],
|
|
1769
|
+
_excluded2$1 = ["label", "textStyle"];
|
|
1770
1770
|
|
|
1771
1771
|
/* eslint-disable class-methods-use-this */
|
|
1772
1772
|
var KeypadItemLabel = /*#__PURE__*/function () {
|
|
@@ -1799,7 +1799,7 @@ var KeypadItemLabel = /*#__PURE__*/function () {
|
|
|
1799
1799
|
var _ref2 = screen || {},
|
|
1800
1800
|
_ref2$items = _ref2.items,
|
|
1801
1801
|
items = _ref2$items === void 0 ? null : _ref2$items,
|
|
1802
|
-
restScreen = _objectWithoutProperties(_ref2, _excluded$
|
|
1802
|
+
restScreen = _objectWithoutProperties(_ref2, _excluded$3);
|
|
1803
1803
|
return _objectSpread(_objectSpread({}, restScreen), {}, {
|
|
1804
1804
|
items: items.map(function () {
|
|
1805
1805
|
var item = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
|
|
@@ -1809,7 +1809,7 @@ var KeypadItemLabel = /*#__PURE__*/function () {
|
|
|
1809
1809
|
var _ref3 = item || {},
|
|
1810
1810
|
label = _ref3.label,
|
|
1811
1811
|
textStyle = _ref3.textStyle,
|
|
1812
|
-
restAnswer = _objectWithoutProperties(_ref3, _excluded2$
|
|
1812
|
+
restAnswer = _objectWithoutProperties(_ref3, _excluded2$1);
|
|
1813
1813
|
return _objectSpread(_objectSpread({}, restAnswer), {}, {
|
|
1814
1814
|
label: {
|
|
1815
1815
|
body: label,
|
|
@@ -1823,145 +1823,10 @@ var KeypadItemLabel = /*#__PURE__*/function () {
|
|
|
1823
1823
|
}();
|
|
1824
1824
|
KeypadItemLabel.prototype.priority = 1;
|
|
1825
1825
|
|
|
1826
|
-
|
|
1827
|
-
_excluded2$1 = ["badge"],
|
|
1828
|
-
_excluded3 = ["callToAction"];
|
|
1829
|
-
/* eslint-disable class-methods-use-this */
|
|
1830
|
-
var testPadding = function testPadding(element) {
|
|
1831
|
-
var _ref = element || {},
|
|
1832
|
-
_ref$boxStyle = _ref.boxStyle,
|
|
1833
|
-
boxStyle = _ref$boxStyle === void 0 ? null : _ref$boxStyle,
|
|
1834
|
-
_ref$label = _ref.label,
|
|
1835
|
-
label = _ref$label === void 0 ? null : _ref$label;
|
|
1836
|
-
if (boxStyle === null) {
|
|
1837
|
-
return false;
|
|
1838
|
-
}
|
|
1839
|
-
var _ref2 = label || {},
|
|
1840
|
-
_ref2$textStyle = _ref2.textStyle,
|
|
1841
|
-
textStyle = _ref2$textStyle === void 0 ? null : _ref2$textStyle;
|
|
1842
|
-
var _ref3 = textStyle || {},
|
|
1843
|
-
_ref3$fontFamily = _ref3.fontFamily,
|
|
1844
|
-
fontFamily = _ref3$fontFamily === void 0 ? null : _ref3$fontFamily;
|
|
1845
|
-
var _ref4 = fontFamily || {},
|
|
1846
|
-
_ref4$name = _ref4.name,
|
|
1847
|
-
fontName = _ref4$name === void 0 ? null : _ref4$name;
|
|
1848
|
-
if (fontName !== 'Agrandir Tight') {
|
|
1849
|
-
return false;
|
|
1850
|
-
}
|
|
1851
|
-
var _ref5 = boxStyle || {},
|
|
1852
|
-
_ref5$padding = _ref5.padding,
|
|
1853
|
-
padding = _ref5$padding === void 0 ? null : _ref5$padding;
|
|
1854
|
-
if (padding === null) {
|
|
1855
|
-
return false;
|
|
1856
|
-
}
|
|
1857
|
-
var _ref6 = padding || {},
|
|
1858
|
-
_ref6$top = _ref6.top,
|
|
1859
|
-
top = _ref6$top === void 0 ? null : _ref6$top,
|
|
1860
|
-
_ref6$bottom = _ref6.bottom,
|
|
1861
|
-
bottom = _ref6$bottom === void 0 ? null : _ref6$bottom;
|
|
1862
|
-
if (top === null || bottom === null) {
|
|
1863
|
-
return false;
|
|
1864
|
-
}
|
|
1865
|
-
if (top <= bottom - 2) {
|
|
1866
|
-
return true;
|
|
1867
|
-
}
|
|
1868
|
-
return true;
|
|
1869
|
-
};
|
|
1870
|
-
var parsePadding = function parsePadding(element) {
|
|
1871
|
-
var _ref7 = element || {},
|
|
1872
|
-
_ref7$boxStyle = _ref7.boxStyle,
|
|
1873
|
-
boxStyle = _ref7$boxStyle === void 0 ? null : _ref7$boxStyle;
|
|
1874
|
-
if (boxStyle === null) {
|
|
1875
|
-
return element;
|
|
1876
|
-
}
|
|
1877
|
-
var _ref8 = boxStyle || {},
|
|
1878
|
-
_ref8$padding = _ref8.padding,
|
|
1879
|
-
padding = _ref8$padding === void 0 ? null : _ref8$padding;
|
|
1880
|
-
if (padding === null) {
|
|
1881
|
-
return element;
|
|
1882
|
-
}
|
|
1883
|
-
var _ref9 = padding || {},
|
|
1884
|
-
_ref9$bottom = _ref9.bottom,
|
|
1885
|
-
bottom = _ref9$bottom === void 0 ? null : _ref9$bottom;
|
|
1886
|
-
if (bottom === null) {
|
|
1887
|
-
return element;
|
|
1888
|
-
}
|
|
1889
|
-
return _objectSpread(_objectSpread({}, element), {}, {
|
|
1890
|
-
boxStyle: _objectSpread(_objectSpread({}, boxStyle), {}, {
|
|
1891
|
-
padding: _objectSpread({}, padding)
|
|
1892
|
-
})
|
|
1893
|
-
});
|
|
1894
|
-
};
|
|
1895
|
-
var ButtonPadding = /*#__PURE__*/function () {
|
|
1896
|
-
function ButtonPadding() {
|
|
1897
|
-
_classCallCheck(this, ButtonPadding);
|
|
1898
|
-
}
|
|
1899
|
-
return _createClass(ButtonPadding, [{
|
|
1900
|
-
key: "test",
|
|
1901
|
-
value: function test(screen) {
|
|
1902
|
-
var _ref0 = screen || {},
|
|
1903
|
-
_ref0$footer = _ref0.footer,
|
|
1904
|
-
footer = _ref0$footer === void 0 ? null : _ref0$footer,
|
|
1905
|
-
_ref0$header = _ref0.header,
|
|
1906
|
-
header = _ref0$header === void 0 ? null : _ref0$header;
|
|
1907
|
-
if (header === null || footer === null) {
|
|
1908
|
-
return false;
|
|
1909
|
-
}
|
|
1910
|
-
var _ref1 = header || {},
|
|
1911
|
-
_ref1$badge = _ref1.badge,
|
|
1912
|
-
badge = _ref1$badge === void 0 ? null : _ref1$badge;
|
|
1913
|
-
var _ref10 = footer || {},
|
|
1914
|
-
_ref10$callToAction = _ref10.callToAction,
|
|
1915
|
-
callToAction = _ref10$callToAction === void 0 ? null : _ref10$callToAction;
|
|
1916
|
-
if (callToAction === null) {
|
|
1917
|
-
return false;
|
|
1918
|
-
}
|
|
1919
|
-
if (badge === null) {
|
|
1920
|
-
return false;
|
|
1921
|
-
}
|
|
1922
|
-
var callHasPadding = testPadding(callToAction);
|
|
1923
|
-
if (callHasPadding) {
|
|
1924
|
-
return true;
|
|
1925
|
-
}
|
|
1926
|
-
var badgeHasPadding = testPadding(badge);
|
|
1927
|
-
if (badgeHasPadding) {
|
|
1928
|
-
return true;
|
|
1929
|
-
}
|
|
1930
|
-
return false;
|
|
1931
|
-
}
|
|
1932
|
-
}, {
|
|
1933
|
-
key: "parse",
|
|
1934
|
-
value: function parse(screen) {
|
|
1935
|
-
var _ref11 = screen || {},
|
|
1936
|
-
_ref11$footer = _ref11.footer,
|
|
1937
|
-
footer = _ref11$footer === void 0 ? null : _ref11$footer,
|
|
1938
|
-
_ref11$header = _ref11.header,
|
|
1939
|
-
header = _ref11$header === void 0 ? null : _ref11$header,
|
|
1940
|
-
restScreen = _objectWithoutProperties(_ref11, _excluded$3);
|
|
1941
|
-
var _ref12 = header || {},
|
|
1942
|
-
_ref12$badge = _ref12.badge,
|
|
1943
|
-
badge = _ref12$badge === void 0 ? null : _ref12$badge,
|
|
1944
|
-
restHeader = _objectWithoutProperties(_ref12, _excluded2$1);
|
|
1945
|
-
var _ref13 = footer || {},
|
|
1946
|
-
_ref13$callToAction = _ref13.callToAction,
|
|
1947
|
-
callToAction = _ref13$callToAction === void 0 ? null : _ref13$callToAction,
|
|
1948
|
-
restFooter = _objectWithoutProperties(_ref13, _excluded3);
|
|
1949
|
-
return _objectSpread(_objectSpread({}, restScreen), {}, {
|
|
1950
|
-
header: _objectSpread(_objectSpread({}, restHeader), badge !== null ? {
|
|
1951
|
-
badge: parsePadding(badge)
|
|
1952
|
-
} : null),
|
|
1953
|
-
footer: _objectSpread(_objectSpread({}, restFooter), callToAction !== null ? {
|
|
1954
|
-
callToAction: parsePadding(callToAction)
|
|
1955
|
-
} : null)
|
|
1956
|
-
});
|
|
1957
|
-
}
|
|
1958
|
-
}]);
|
|
1959
|
-
}();
|
|
1960
|
-
ButtonPadding.prototype.priority = 1;
|
|
1826
|
+
// export { default as ButtonPadding } from './ButtonPadding';
|
|
1961
1827
|
|
|
1962
1828
|
var migrations = /*#__PURE__*/Object.freeze({
|
|
1963
1829
|
__proto__: null,
|
|
1964
|
-
ButtonPadding: ButtonPadding,
|
|
1965
1830
|
CustomAnswerLabel: CustomAnswerLabel,
|
|
1966
1831
|
KeypadItemLabel: KeypadItemLabel,
|
|
1967
1832
|
ShareCall: ShareCall
|
|
@@ -2001,8 +1866,8 @@ var MigrationsParser = /*#__PURE__*/function () {
|
|
|
2001
1866
|
restStory = _objectWithoutProperties(_ref2, _excluded$2);
|
|
2002
1867
|
var finalComponents = components.reduce(function (currentComponents, screen) {
|
|
2003
1868
|
var newScreen = _this.parsers.reduce(function (currentScreen, parser) {
|
|
2004
|
-
if (parser.test(currentScreen)) {
|
|
2005
|
-
return parser.parse(currentScreen);
|
|
1869
|
+
if (parser.test(currentScreen, story)) {
|
|
1870
|
+
return parser.parse(currentScreen, story);
|
|
2006
1871
|
}
|
|
2007
1872
|
return currentScreen;
|
|
2008
1873
|
}, screen);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@micromag/core",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.733",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "",
|
|
6
6
|
"keywords": [
|
|
@@ -145,5 +145,5 @@
|
|
|
145
145
|
"access": "public",
|
|
146
146
|
"registry": "https://registry.npmjs.org/"
|
|
147
147
|
},
|
|
148
|
-
"gitHead": "
|
|
148
|
+
"gitHead": "9dae26b19bddd5767d8c65c62aad0e51d5a90680"
|
|
149
149
|
}
|