@micromag/core 0.3.660 → 0.3.667
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 +168 -16
- package/package.json +2 -2
package/es/index.js
CHANGED
|
@@ -1200,8 +1200,8 @@ var FieldsManager = /*#__PURE__*/function (_DefinitionsManager) {
|
|
|
1200
1200
|
}]);
|
|
1201
1201
|
}(DefinitionsManager);
|
|
1202
1202
|
|
|
1203
|
-
var _excluded$
|
|
1204
|
-
_excluded2$
|
|
1203
|
+
var _excluded$8 = ["medias"],
|
|
1204
|
+
_excluded2$4 = ["medias"];
|
|
1205
1205
|
var MediasParser = /*#__PURE__*/function () {
|
|
1206
1206
|
function MediasParser(_ref) {
|
|
1207
1207
|
var fieldsManager = _ref.fieldsManager,
|
|
@@ -1220,7 +1220,7 @@ var MediasParser = /*#__PURE__*/function () {
|
|
|
1220
1220
|
if (typeof this.parsedThemesCache[storyId] === 'undefined') {
|
|
1221
1221
|
var _this$toPath = this.toPath(theme),
|
|
1222
1222
|
themeMedias = _this$toPath.medias,
|
|
1223
|
-
newTheme = _objectWithoutProperties(_this$toPath, _excluded$
|
|
1223
|
+
newTheme = _objectWithoutProperties(_this$toPath, _excluded$8);
|
|
1224
1224
|
this.parsedThemesCache[storyId] = {
|
|
1225
1225
|
themeMedias: themeMedias,
|
|
1226
1226
|
newTheme: newTheme
|
|
@@ -1274,7 +1274,7 @@ var MediasParser = /*#__PURE__*/function () {
|
|
|
1274
1274
|
if (theme !== null) {
|
|
1275
1275
|
var _this$getParsedStoryT = this.getParsedStoryTheme(storyId, theme),
|
|
1276
1276
|
themeMedias = _this$getParsedStoryT.medias,
|
|
1277
|
-
newTheme = _objectWithoutProperties(_this$getParsedStoryT, _excluded2$
|
|
1277
|
+
newTheme = _objectWithoutProperties(_this$getParsedStoryT, _excluded2$4);
|
|
1278
1278
|
return medias !== null || themeMedias !== null ? _objectSpread(_objectSpread({}, story), {}, {
|
|
1279
1279
|
theme: newTheme,
|
|
1280
1280
|
components: newComponents,
|
|
@@ -1526,7 +1526,7 @@ var ScreensManager = /*#__PURE__*/function (_DefinitionsManager) {
|
|
|
1526
1526
|
}]);
|
|
1527
1527
|
}(DefinitionsManager);
|
|
1528
1528
|
|
|
1529
|
-
var _excluded$
|
|
1529
|
+
var _excluded$7 = ["fonts"];
|
|
1530
1530
|
var FontsParser = /*#__PURE__*/function () {
|
|
1531
1531
|
function FontsParser(_ref) {
|
|
1532
1532
|
var fieldsManager = _ref.fieldsManager,
|
|
@@ -1575,7 +1575,7 @@ var FontsParser = /*#__PURE__*/function () {
|
|
|
1575
1575
|
var _this$parse = this.parse(theme),
|
|
1576
1576
|
_this$parse$fonts = _this$parse.fonts,
|
|
1577
1577
|
themeFonts = _this$parse$fonts === void 0 ? [] : _this$parse$fonts,
|
|
1578
|
-
newTheme = _objectWithoutProperties(_this$parse, _excluded$
|
|
1578
|
+
newTheme = _objectWithoutProperties(_this$parse, _excluded$7);
|
|
1579
1579
|
return fonts.length > 0 || themeFonts.length > 0 ? _objectSpread(_objectSpread({}, story), {}, {
|
|
1580
1580
|
theme: newTheme,
|
|
1581
1581
|
fonts: uniq([].concat(_toConsumableArray(themeFonts), _toConsumableArray(fonts)), 'name')
|
|
@@ -1651,7 +1651,7 @@ var FontsParser = /*#__PURE__*/function () {
|
|
|
1651
1651
|
}]);
|
|
1652
1652
|
}();
|
|
1653
1653
|
|
|
1654
|
-
var _excluded$
|
|
1654
|
+
var _excluded$6 = ["shareIncentive", "callToAction"];
|
|
1655
1655
|
/* eslint-disable class-methods-use-this */
|
|
1656
1656
|
var ShareCall = /*#__PURE__*/function () {
|
|
1657
1657
|
function ShareCall() {
|
|
@@ -1678,7 +1678,7 @@ var ShareCall = /*#__PURE__*/function () {
|
|
|
1678
1678
|
shareIncentive = _ref2$shareIncentive === void 0 ? null : _ref2$shareIncentive,
|
|
1679
1679
|
_ref2$callToAction = _ref2.callToAction,
|
|
1680
1680
|
callToAction = _ref2$callToAction === void 0 ? null : _ref2$callToAction,
|
|
1681
|
-
restScreen = _objectWithoutProperties(_ref2, _excluded$
|
|
1681
|
+
restScreen = _objectWithoutProperties(_ref2, _excluded$6);
|
|
1682
1682
|
var _ref3 = screen || {},
|
|
1683
1683
|
_ref3$header = _ref3.header,
|
|
1684
1684
|
header = _ref3$header === void 0 ? null : _ref3$header,
|
|
@@ -1705,9 +1705,10 @@ var ShareCall = /*#__PURE__*/function () {
|
|
|
1705
1705
|
}
|
|
1706
1706
|
}]);
|
|
1707
1707
|
}();
|
|
1708
|
+
ShareCall.prototype.priority = 0;
|
|
1708
1709
|
|
|
1709
|
-
var _excluded$
|
|
1710
|
-
_excluded2$
|
|
1710
|
+
var _excluded$5 = ["answers"],
|
|
1711
|
+
_excluded2$3 = ["customAnswerLabel"];
|
|
1711
1712
|
/* eslint-disable class-methods-use-this */
|
|
1712
1713
|
var CustomAnswerLabel = /*#__PURE__*/function () {
|
|
1713
1714
|
function CustomAnswerLabel() {
|
|
@@ -1737,7 +1738,7 @@ var CustomAnswerLabel = /*#__PURE__*/function () {
|
|
|
1737
1738
|
var _ref2 = screen || {},
|
|
1738
1739
|
_ref2$answers = _ref2.answers,
|
|
1739
1740
|
answers = _ref2$answers === void 0 ? null : _ref2$answers,
|
|
1740
|
-
restScreen = _objectWithoutProperties(_ref2, _excluded$
|
|
1741
|
+
restScreen = _objectWithoutProperties(_ref2, _excluded$5);
|
|
1741
1742
|
return _objectSpread(_objectSpread({}, restScreen), {}, {
|
|
1742
1743
|
answers: answers.map(function () {
|
|
1743
1744
|
var answer = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
|
|
@@ -1746,7 +1747,7 @@ var CustomAnswerLabel = /*#__PURE__*/function () {
|
|
|
1746
1747
|
}
|
|
1747
1748
|
var _ref3 = answer || {},
|
|
1748
1749
|
customAnswerLabel = _ref3.customAnswerLabel,
|
|
1749
|
-
restAnswer = _objectWithoutProperties(_ref3, _excluded2$
|
|
1750
|
+
restAnswer = _objectWithoutProperties(_ref3, _excluded2$3);
|
|
1750
1751
|
return _objectSpread(_objectSpread({}, restAnswer), {}, {
|
|
1751
1752
|
result: customAnswerLabel
|
|
1752
1753
|
});
|
|
@@ -1755,9 +1756,10 @@ var CustomAnswerLabel = /*#__PURE__*/function () {
|
|
|
1755
1756
|
}
|
|
1756
1757
|
}]);
|
|
1757
1758
|
}();
|
|
1759
|
+
CustomAnswerLabel.prototype.priority = 1;
|
|
1758
1760
|
|
|
1759
|
-
var _excluded$
|
|
1760
|
-
_excluded2$
|
|
1761
|
+
var _excluded$4 = ["items"],
|
|
1762
|
+
_excluded2$2 = ["label", "textStyle"];
|
|
1761
1763
|
|
|
1762
1764
|
/* eslint-disable class-methods-use-this */
|
|
1763
1765
|
var KeypadItemLabel = /*#__PURE__*/function () {
|
|
@@ -1790,7 +1792,7 @@ var KeypadItemLabel = /*#__PURE__*/function () {
|
|
|
1790
1792
|
var _ref2 = screen || {},
|
|
1791
1793
|
_ref2$items = _ref2.items,
|
|
1792
1794
|
items = _ref2$items === void 0 ? null : _ref2$items,
|
|
1793
|
-
restScreen = _objectWithoutProperties(_ref2, _excluded$
|
|
1795
|
+
restScreen = _objectWithoutProperties(_ref2, _excluded$4);
|
|
1794
1796
|
return _objectSpread(_objectSpread({}, restScreen), {}, {
|
|
1795
1797
|
items: items.map(function () {
|
|
1796
1798
|
var item = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
|
|
@@ -1800,7 +1802,7 @@ var KeypadItemLabel = /*#__PURE__*/function () {
|
|
|
1800
1802
|
var _ref3 = item || {},
|
|
1801
1803
|
label = _ref3.label,
|
|
1802
1804
|
textStyle = _ref3.textStyle,
|
|
1803
|
-
restAnswer = _objectWithoutProperties(_ref3, _excluded2$
|
|
1805
|
+
restAnswer = _objectWithoutProperties(_ref3, _excluded2$2);
|
|
1804
1806
|
return _objectSpread(_objectSpread({}, restAnswer), {}, {
|
|
1805
1807
|
label: {
|
|
1806
1808
|
body: label,
|
|
@@ -1812,9 +1814,150 @@ var KeypadItemLabel = /*#__PURE__*/function () {
|
|
|
1812
1814
|
}
|
|
1813
1815
|
}]);
|
|
1814
1816
|
}();
|
|
1817
|
+
KeypadItemLabel.prototype.priority = 1;
|
|
1818
|
+
|
|
1819
|
+
var _excluded$3 = ["footer", "header"],
|
|
1820
|
+
_excluded2$1 = ["badge"],
|
|
1821
|
+
_excluded3 = ["callToAction"];
|
|
1822
|
+
/* eslint-disable class-methods-use-this */
|
|
1823
|
+
var testPadding = function testPadding(element) {
|
|
1824
|
+
var _ref = element || {},
|
|
1825
|
+
_ref$boxStyle = _ref.boxStyle,
|
|
1826
|
+
boxStyle = _ref$boxStyle === void 0 ? null : _ref$boxStyle,
|
|
1827
|
+
_ref$label = _ref.label,
|
|
1828
|
+
label = _ref$label === void 0 ? null : _ref$label;
|
|
1829
|
+
if (boxStyle === null) {
|
|
1830
|
+
return false;
|
|
1831
|
+
}
|
|
1832
|
+
var _ref2 = label || {},
|
|
1833
|
+
_ref2$textStyle = _ref2.textStyle,
|
|
1834
|
+
textStyle = _ref2$textStyle === void 0 ? null : _ref2$textStyle;
|
|
1835
|
+
var _ref3 = textStyle || {},
|
|
1836
|
+
_ref3$fontFamily = _ref3.fontFamily,
|
|
1837
|
+
fontFamily = _ref3$fontFamily === void 0 ? null : _ref3$fontFamily;
|
|
1838
|
+
var _ref4 = fontFamily || {},
|
|
1839
|
+
_ref4$name = _ref4.name,
|
|
1840
|
+
fontName = _ref4$name === void 0 ? null : _ref4$name;
|
|
1841
|
+
if (fontName !== 'Agrandir Tight') {
|
|
1842
|
+
return false;
|
|
1843
|
+
}
|
|
1844
|
+
var _ref5 = boxStyle || {},
|
|
1845
|
+
_ref5$padding = _ref5.padding,
|
|
1846
|
+
padding = _ref5$padding === void 0 ? null : _ref5$padding;
|
|
1847
|
+
if (padding === null) {
|
|
1848
|
+
return false;
|
|
1849
|
+
}
|
|
1850
|
+
var _ref6 = padding || {},
|
|
1851
|
+
_ref6$top = _ref6.top,
|
|
1852
|
+
top = _ref6$top === void 0 ? null : _ref6$top,
|
|
1853
|
+
_ref6$bottom = _ref6.bottom,
|
|
1854
|
+
bottom = _ref6$bottom === void 0 ? null : _ref6$bottom;
|
|
1855
|
+
if (top === null || bottom === null) {
|
|
1856
|
+
return false;
|
|
1857
|
+
}
|
|
1858
|
+
if (top < bottom - 2) {
|
|
1859
|
+
return true;
|
|
1860
|
+
}
|
|
1861
|
+
return true;
|
|
1862
|
+
};
|
|
1863
|
+
var parsePadding = function parsePadding(element) {
|
|
1864
|
+
var _ref7 = element || {},
|
|
1865
|
+
_ref7$boxStyle = _ref7.boxStyle,
|
|
1866
|
+
boxStyle = _ref7$boxStyle === void 0 ? null : _ref7$boxStyle;
|
|
1867
|
+
if (boxStyle === null) {
|
|
1868
|
+
return element;
|
|
1869
|
+
}
|
|
1870
|
+
var _ref8 = boxStyle || {},
|
|
1871
|
+
_ref8$padding = _ref8.padding,
|
|
1872
|
+
padding = _ref8$padding === void 0 ? null : _ref8$padding;
|
|
1873
|
+
if (padding === null) {
|
|
1874
|
+
return element;
|
|
1875
|
+
}
|
|
1876
|
+
var _ref9 = padding || {},
|
|
1877
|
+
_ref9$bottom = _ref9.bottom,
|
|
1878
|
+
bottom = _ref9$bottom === void 0 ? null : _ref9$bottom;
|
|
1879
|
+
if (bottom === null) {
|
|
1880
|
+
return element;
|
|
1881
|
+
}
|
|
1882
|
+
return _objectSpread(_objectSpread({}, element), {}, {
|
|
1883
|
+
boxStyle: _objectSpread(_objectSpread({}, boxStyle), {}, {
|
|
1884
|
+
padding: _objectSpread(_objectSpread({}, padding), {}, {
|
|
1885
|
+
top: bottom,
|
|
1886
|
+
bottom: bottom
|
|
1887
|
+
})
|
|
1888
|
+
})
|
|
1889
|
+
});
|
|
1890
|
+
};
|
|
1891
|
+
var ButtonPadding = /*#__PURE__*/function () {
|
|
1892
|
+
function ButtonPadding() {
|
|
1893
|
+
_classCallCheck(this, ButtonPadding);
|
|
1894
|
+
}
|
|
1895
|
+
return _createClass(ButtonPadding, [{
|
|
1896
|
+
key: "test",
|
|
1897
|
+
value: function test(screen) {
|
|
1898
|
+
var _ref10 = screen || {},
|
|
1899
|
+
_ref10$footer = _ref10.footer,
|
|
1900
|
+
footer = _ref10$footer === void 0 ? null : _ref10$footer,
|
|
1901
|
+
_ref10$header = _ref10.header,
|
|
1902
|
+
header = _ref10$header === void 0 ? null : _ref10$header;
|
|
1903
|
+
if (header === null || footer === null) {
|
|
1904
|
+
return false;
|
|
1905
|
+
}
|
|
1906
|
+
var _ref11 = header || {},
|
|
1907
|
+
_ref11$badge = _ref11.badge,
|
|
1908
|
+
badge = _ref11$badge === void 0 ? null : _ref11$badge;
|
|
1909
|
+
var _ref12 = footer || {},
|
|
1910
|
+
_ref12$callToAction = _ref12.callToAction,
|
|
1911
|
+
callToAction = _ref12$callToAction === void 0 ? null : _ref12$callToAction;
|
|
1912
|
+
if (callToAction === null) {
|
|
1913
|
+
return false;
|
|
1914
|
+
}
|
|
1915
|
+
if (badge === null) {
|
|
1916
|
+
return false;
|
|
1917
|
+
}
|
|
1918
|
+
var callHasPadding = testPadding(callToAction);
|
|
1919
|
+
if (callHasPadding) {
|
|
1920
|
+
return true;
|
|
1921
|
+
}
|
|
1922
|
+
var badgeHasPadding = testPadding(badge);
|
|
1923
|
+
if (badgeHasPadding) {
|
|
1924
|
+
return true;
|
|
1925
|
+
}
|
|
1926
|
+
return false;
|
|
1927
|
+
}
|
|
1928
|
+
}, {
|
|
1929
|
+
key: "parse",
|
|
1930
|
+
value: function parse(screen) {
|
|
1931
|
+
var _ref13 = screen || {},
|
|
1932
|
+
_ref13$footer = _ref13.footer,
|
|
1933
|
+
footer = _ref13$footer === void 0 ? null : _ref13$footer,
|
|
1934
|
+
_ref13$header = _ref13.header,
|
|
1935
|
+
header = _ref13$header === void 0 ? null : _ref13$header,
|
|
1936
|
+
restScreen = _objectWithoutProperties(_ref13, _excluded$3);
|
|
1937
|
+
var _ref14 = header || {},
|
|
1938
|
+
_ref14$badge = _ref14.badge,
|
|
1939
|
+
badge = _ref14$badge === void 0 ? null : _ref14$badge,
|
|
1940
|
+
restHeader = _objectWithoutProperties(_ref14, _excluded2$1);
|
|
1941
|
+
var _ref15 = footer || {},
|
|
1942
|
+
_ref15$callToAction = _ref15.callToAction,
|
|
1943
|
+
callToAction = _ref15$callToAction === void 0 ? null : _ref15$callToAction,
|
|
1944
|
+
restFooter = _objectWithoutProperties(_ref15, _excluded3);
|
|
1945
|
+
return _objectSpread(_objectSpread({}, restScreen), {}, {
|
|
1946
|
+
header: _objectSpread(_objectSpread({}, restHeader), badge !== null ? {
|
|
1947
|
+
badge: parsePadding(badge)
|
|
1948
|
+
} : null),
|
|
1949
|
+
footer: _objectSpread(_objectSpread({}, restFooter), callToAction !== null ? {
|
|
1950
|
+
callToAction: parsePadding(callToAction)
|
|
1951
|
+
} : null)
|
|
1952
|
+
});
|
|
1953
|
+
}
|
|
1954
|
+
}]);
|
|
1955
|
+
}();
|
|
1956
|
+
ButtonPadding.prototype.priority = 1;
|
|
1815
1957
|
|
|
1816
1958
|
var migrations = /*#__PURE__*/Object.freeze({
|
|
1817
1959
|
__proto__: null,
|
|
1960
|
+
ButtonPadding: ButtonPadding,
|
|
1818
1961
|
CustomAnswerLabel: CustomAnswerLabel,
|
|
1819
1962
|
KeypadItemLabel: KeypadItemLabel,
|
|
1820
1963
|
ShareCall: ShareCall
|
|
@@ -1829,6 +1972,15 @@ var MigrationsParser = /*#__PURE__*/function () {
|
|
|
1829
1972
|
this.parsers = Object.keys(migrations).map(function (migration) {
|
|
1830
1973
|
return new migrations[migration]();
|
|
1831
1974
|
});
|
|
1975
|
+
this.parsers.sort(function (a, b) {
|
|
1976
|
+
if (a.priority === undefined || b.priority === undefined) {
|
|
1977
|
+
return 0;
|
|
1978
|
+
}
|
|
1979
|
+
if (a.priority === b.priority) {
|
|
1980
|
+
return 0;
|
|
1981
|
+
}
|
|
1982
|
+
return a.priority < b.priority ? -1 : 1;
|
|
1983
|
+
});
|
|
1832
1984
|
}
|
|
1833
1985
|
|
|
1834
1986
|
// eslint-disable-next-line class-methods-use-this
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@micromag/core",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.667",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "",
|
|
6
6
|
"keywords": [
|
|
@@ -144,5 +144,5 @@
|
|
|
144
144
|
"access": "public",
|
|
145
145
|
"registry": "https://registry.npmjs.org/"
|
|
146
146
|
},
|
|
147
|
-
"gitHead": "
|
|
147
|
+
"gitHead": "8974de0b7dbe3ab5d632d0449b7a25ee20336a1c"
|
|
148
148
|
}
|