@micromag/core 0.2.364 → 0.2.373
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/contexts.js +1 -7
- package/es/index.js +51 -25
- package/es/utils.js +1 -1
- package/lib/contexts.js +1 -7
- package/lib/index.js +51 -25
- package/lib/utils.js +1 -1
- package/package.json +11 -4
package/es/contexts.js
CHANGED
|
@@ -1030,7 +1030,6 @@ var ScreenSizeProvider = function ScreenSizeProvider(_ref) {
|
|
|
1030
1030
|
ScreenSizeProvider.propTypes = propTypes$4;
|
|
1031
1031
|
ScreenSizeProvider.defaultProps = defaultProps$4;
|
|
1032
1032
|
|
|
1033
|
-
/* eslint-disable react/jsx-props-no-spreading */
|
|
1034
1033
|
var useTracking = function useTracking() {
|
|
1035
1034
|
return useContext(TrackingContext);
|
|
1036
1035
|
};
|
|
@@ -1046,13 +1045,8 @@ var TrackingProvider = function TrackingProvider(_ref) {
|
|
|
1046
1045
|
children = _ref.children;
|
|
1047
1046
|
var contextTracking = useTracking() || null;
|
|
1048
1047
|
var tracking = useMemo(function () {
|
|
1049
|
-
if (contextTracking !== null) {
|
|
1050
|
-
contextTracking.setVariables(variables);
|
|
1051
|
-
return contextTracking;
|
|
1052
|
-
}
|
|
1053
|
-
|
|
1054
1048
|
return new Tracking({
|
|
1055
|
-
variables: variables
|
|
1049
|
+
variables: _objectSpread(_objectSpread({}, contextTracking !== null ? contextTracking.getVariables() : null), variables)
|
|
1056
1050
|
});
|
|
1057
1051
|
}, [contextTracking, variables]);
|
|
1058
1052
|
return /*#__PURE__*/React.createElement(TrackingContainer, {
|
package/es/index.js
CHANGED
|
@@ -1798,7 +1798,7 @@ var StoryParser = /*#__PURE__*/function () {
|
|
|
1798
1798
|
}();
|
|
1799
1799
|
|
|
1800
1800
|
var _excluded = ["value"],
|
|
1801
|
-
_excluded2 = ["value"];
|
|
1801
|
+
_excluded2 = ["value", "currentTime"];
|
|
1802
1802
|
|
|
1803
1803
|
var Tracking = /*#__PURE__*/function (_BaseTracking) {
|
|
1804
1804
|
_inherits(Tracking, _BaseTracking);
|
|
@@ -1816,6 +1816,7 @@ var Tracking = /*#__PURE__*/function (_BaseTracking) {
|
|
|
1816
1816
|
var _this$options$variabl = _this.options.variables,
|
|
1817
1817
|
variables = _this$options$variabl === void 0 ? null : _this$options$variabl;
|
|
1818
1818
|
_this.variables = null;
|
|
1819
|
+
_this.screensViewed = [];
|
|
1819
1820
|
|
|
1820
1821
|
if (variables !== null) {
|
|
1821
1822
|
_this.setVariables(variables);
|
|
@@ -1841,27 +1842,44 @@ var Tracking = /*#__PURE__*/function (_BaseTracking) {
|
|
|
1841
1842
|
}, {
|
|
1842
1843
|
key: "trackScreenView",
|
|
1843
1844
|
value: function trackScreenView(screen, screenIndex) {
|
|
1844
|
-
var _ref =
|
|
1845
|
-
_ref$
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
|
|
1845
|
+
var _ref = this.variables || {},
|
|
1846
|
+
_ref$screensCount = _ref.screensCount,
|
|
1847
|
+
screensCount = _ref$screensCount === void 0 ? null : _ref$screensCount;
|
|
1848
|
+
|
|
1849
|
+
var _ref2 = screen || {},
|
|
1850
|
+
_ref2$id = _ref2.id,
|
|
1851
|
+
screenId = _ref2$id === void 0 ? null : _ref2$id,
|
|
1852
|
+
_ref2$type = _ref2.type,
|
|
1853
|
+
screenType = _ref2$type === void 0 ? null : _ref2$type,
|
|
1854
|
+
_ref2$metadata = _ref2.metadata,
|
|
1855
|
+
metadata = _ref2$metadata === void 0 ? {} : _ref2$metadata;
|
|
1856
|
+
|
|
1857
|
+
var _ref3 = metadata || {},
|
|
1858
|
+
screenTitle = _ref3.title;
|
|
1859
|
+
|
|
1860
|
+
if (this.screensViewed.indexOf(screenId || index) !== -1) {
|
|
1861
|
+
this.screensViewed = [].concat(_toConsumableArray(this.screensViewed), [screenId || index]);
|
|
1862
|
+
}
|
|
1849
1863
|
|
|
1850
1864
|
var data = {
|
|
1851
1865
|
event: 'screenView',
|
|
1852
1866
|
screenId: screenId,
|
|
1853
1867
|
screenType: screenType,
|
|
1854
|
-
screenIndex: screenIndex
|
|
1868
|
+
screenIndex: screenIndex,
|
|
1869
|
+
screenTitle: screenTitle,
|
|
1870
|
+
screenProgress: screensCount !== null && screenIndex !== null ? (screenIndex + 1) / screensCount : null,
|
|
1871
|
+
screensViewed: this.screensViewed,
|
|
1872
|
+
screensViewedProgress: screensCount !== null ? this.screensViewed.length / screensCount : null
|
|
1855
1873
|
};
|
|
1856
1874
|
this.push(data);
|
|
1857
1875
|
}
|
|
1858
1876
|
}, {
|
|
1859
1877
|
key: "trackEvent",
|
|
1860
1878
|
value: function trackEvent(category, action, label) {
|
|
1861
|
-
var
|
|
1862
|
-
|
|
1863
|
-
value =
|
|
1864
|
-
opts = _objectWithoutProperties(
|
|
1879
|
+
var _ref4 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {},
|
|
1880
|
+
_ref4$value = _ref4.value,
|
|
1881
|
+
value = _ref4$value === void 0 ? null : _ref4$value,
|
|
1882
|
+
opts = _objectWithoutProperties(_ref4, _excluded);
|
|
1865
1883
|
|
|
1866
1884
|
var data = _objectSpread(_objectSpread({}, opts), {}, {
|
|
1867
1885
|
event: 'eventInteraction',
|
|
@@ -1876,20 +1894,28 @@ var Tracking = /*#__PURE__*/function (_BaseTracking) {
|
|
|
1876
1894
|
}, {
|
|
1877
1895
|
key: "trackMedia",
|
|
1878
1896
|
value: function trackMedia(type, media, action) {
|
|
1879
|
-
var
|
|
1880
|
-
|
|
1881
|
-
value =
|
|
1882
|
-
|
|
1883
|
-
|
|
1884
|
-
|
|
1885
|
-
|
|
1886
|
-
|
|
1887
|
-
|
|
1888
|
-
|
|
1889
|
-
|
|
1890
|
-
|
|
1891
|
-
|
|
1892
|
-
|
|
1897
|
+
var _ref5 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {},
|
|
1898
|
+
_ref5$value = _ref5.value,
|
|
1899
|
+
value = _ref5$value === void 0 ? null : _ref5$value,
|
|
1900
|
+
_ref5$currentTime = _ref5.currentTime,
|
|
1901
|
+
optsCurrentTime = _ref5$currentTime === void 0 ? null : _ref5$currentTime,
|
|
1902
|
+
opts = _objectWithoutProperties(_ref5, _excluded2);
|
|
1903
|
+
|
|
1904
|
+
var _ref6 = media || {},
|
|
1905
|
+
_ref6$id = _ref6.id,
|
|
1906
|
+
mediaId = _ref6$id === void 0 ? null : _ref6$id,
|
|
1907
|
+
_ref6$name = _ref6.name,
|
|
1908
|
+
name = _ref6$name === void 0 ? null : _ref6$name,
|
|
1909
|
+
_ref6$duration = _ref6.duration,
|
|
1910
|
+
rootDuration = _ref6$duration === void 0 ? null : _ref6$duration,
|
|
1911
|
+
_ref6$currentTime = _ref6.currentTime,
|
|
1912
|
+
currentTime = _ref6$currentTime === void 0 ? optsCurrentTime : _ref6$currentTime,
|
|
1913
|
+
_ref6$metadata = _ref6.metadata,
|
|
1914
|
+
metadata = _ref6$metadata === void 0 ? {} : _ref6$metadata;
|
|
1915
|
+
|
|
1916
|
+
var _ref7 = metadata || {},
|
|
1917
|
+
_ref7$duration = _ref7.duration,
|
|
1918
|
+
duration = _ref7$duration === void 0 ? rootDuration : _ref7$duration;
|
|
1893
1919
|
|
|
1894
1920
|
var label = name;
|
|
1895
1921
|
|
package/es/utils.js
CHANGED
|
@@ -411,7 +411,7 @@ var getStyleFromBorder = function getStyleFromBorder(value) {
|
|
|
411
411
|
_value$color = value.color,
|
|
412
412
|
color = _value$color === void 0 ? null : _value$color;
|
|
413
413
|
return _objectSpread(_objectSpread(_objectSpread({}, width !== null ? {
|
|
414
|
-
borderWidth:
|
|
414
|
+
borderWidth: width
|
|
415
415
|
} : null), borderStyle !== null ? {
|
|
416
416
|
borderStyle: borderStyle
|
|
417
417
|
} : null), getStyleFromColor(color, 'borderColor'));
|
package/lib/contexts.js
CHANGED
|
@@ -1064,7 +1064,6 @@ var ScreenSizeProvider = function ScreenSizeProvider(_ref) {
|
|
|
1064
1064
|
ScreenSizeProvider.propTypes = propTypes$4;
|
|
1065
1065
|
ScreenSizeProvider.defaultProps = defaultProps$4;
|
|
1066
1066
|
|
|
1067
|
-
/* eslint-disable react/jsx-props-no-spreading */
|
|
1068
1067
|
var useTracking = function useTracking() {
|
|
1069
1068
|
return React.useContext(tracking.TrackingContext);
|
|
1070
1069
|
};
|
|
@@ -1080,13 +1079,8 @@ var TrackingProvider = function TrackingProvider(_ref) {
|
|
|
1080
1079
|
children = _ref.children;
|
|
1081
1080
|
var contextTracking = useTracking() || null;
|
|
1082
1081
|
var tracking$1 = React.useMemo(function () {
|
|
1083
|
-
if (contextTracking !== null) {
|
|
1084
|
-
contextTracking.setVariables(variables);
|
|
1085
|
-
return contextTracking;
|
|
1086
|
-
}
|
|
1087
|
-
|
|
1088
1082
|
return new core.Tracking({
|
|
1089
|
-
variables: variables
|
|
1083
|
+
variables: _objectSpread__default["default"](_objectSpread__default["default"]({}, contextTracking !== null ? contextTracking.getVariables() : null), variables)
|
|
1090
1084
|
});
|
|
1091
1085
|
}, [contextTracking, variables]);
|
|
1092
1086
|
return /*#__PURE__*/React__default["default"].createElement(tracking.TrackingContainer, {
|
package/lib/index.js
CHANGED
|
@@ -1824,7 +1824,7 @@ var StoryParser = /*#__PURE__*/function () {
|
|
|
1824
1824
|
}();
|
|
1825
1825
|
|
|
1826
1826
|
var _excluded = ["value"],
|
|
1827
|
-
_excluded2 = ["value"];
|
|
1827
|
+
_excluded2 = ["value", "currentTime"];
|
|
1828
1828
|
|
|
1829
1829
|
var Tracking = /*#__PURE__*/function (_BaseTracking) {
|
|
1830
1830
|
_inherits__default["default"](Tracking, _BaseTracking);
|
|
@@ -1842,6 +1842,7 @@ var Tracking = /*#__PURE__*/function (_BaseTracking) {
|
|
|
1842
1842
|
var _this$options$variabl = _this.options.variables,
|
|
1843
1843
|
variables = _this$options$variabl === void 0 ? null : _this$options$variabl;
|
|
1844
1844
|
_this.variables = null;
|
|
1845
|
+
_this.screensViewed = [];
|
|
1845
1846
|
|
|
1846
1847
|
if (variables !== null) {
|
|
1847
1848
|
_this.setVariables(variables);
|
|
@@ -1867,27 +1868,44 @@ var Tracking = /*#__PURE__*/function (_BaseTracking) {
|
|
|
1867
1868
|
}, {
|
|
1868
1869
|
key: "trackScreenView",
|
|
1869
1870
|
value: function trackScreenView(screen, screenIndex) {
|
|
1870
|
-
var _ref =
|
|
1871
|
-
_ref$
|
|
1872
|
-
|
|
1873
|
-
|
|
1874
|
-
|
|
1871
|
+
var _ref = this.variables || {},
|
|
1872
|
+
_ref$screensCount = _ref.screensCount,
|
|
1873
|
+
screensCount = _ref$screensCount === void 0 ? null : _ref$screensCount;
|
|
1874
|
+
|
|
1875
|
+
var _ref2 = screen || {},
|
|
1876
|
+
_ref2$id = _ref2.id,
|
|
1877
|
+
screenId = _ref2$id === void 0 ? null : _ref2$id,
|
|
1878
|
+
_ref2$type = _ref2.type,
|
|
1879
|
+
screenType = _ref2$type === void 0 ? null : _ref2$type,
|
|
1880
|
+
_ref2$metadata = _ref2.metadata,
|
|
1881
|
+
metadata = _ref2$metadata === void 0 ? {} : _ref2$metadata;
|
|
1882
|
+
|
|
1883
|
+
var _ref3 = metadata || {},
|
|
1884
|
+
screenTitle = _ref3.title;
|
|
1885
|
+
|
|
1886
|
+
if (this.screensViewed.indexOf(screenId || index) !== -1) {
|
|
1887
|
+
this.screensViewed = [].concat(_toConsumableArray__default["default"](this.screensViewed), [screenId || index]);
|
|
1888
|
+
}
|
|
1875
1889
|
|
|
1876
1890
|
var data = {
|
|
1877
1891
|
event: 'screenView',
|
|
1878
1892
|
screenId: screenId,
|
|
1879
1893
|
screenType: screenType,
|
|
1880
|
-
screenIndex: screenIndex
|
|
1894
|
+
screenIndex: screenIndex,
|
|
1895
|
+
screenTitle: screenTitle,
|
|
1896
|
+
screenProgress: screensCount !== null && screenIndex !== null ? (screenIndex + 1) / screensCount : null,
|
|
1897
|
+
screensViewed: this.screensViewed,
|
|
1898
|
+
screensViewedProgress: screensCount !== null ? this.screensViewed.length / screensCount : null
|
|
1881
1899
|
};
|
|
1882
1900
|
this.push(data);
|
|
1883
1901
|
}
|
|
1884
1902
|
}, {
|
|
1885
1903
|
key: "trackEvent",
|
|
1886
1904
|
value: function trackEvent(category, action, label) {
|
|
1887
|
-
var
|
|
1888
|
-
|
|
1889
|
-
value =
|
|
1890
|
-
opts = _objectWithoutProperties__default["default"](
|
|
1905
|
+
var _ref4 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {},
|
|
1906
|
+
_ref4$value = _ref4.value,
|
|
1907
|
+
value = _ref4$value === void 0 ? null : _ref4$value,
|
|
1908
|
+
opts = _objectWithoutProperties__default["default"](_ref4, _excluded);
|
|
1891
1909
|
|
|
1892
1910
|
var data = _objectSpread__default["default"](_objectSpread__default["default"]({}, opts), {}, {
|
|
1893
1911
|
event: 'eventInteraction',
|
|
@@ -1902,20 +1920,28 @@ var Tracking = /*#__PURE__*/function (_BaseTracking) {
|
|
|
1902
1920
|
}, {
|
|
1903
1921
|
key: "trackMedia",
|
|
1904
1922
|
value: function trackMedia(type, media, action) {
|
|
1905
|
-
var
|
|
1906
|
-
|
|
1907
|
-
value =
|
|
1908
|
-
|
|
1909
|
-
|
|
1910
|
-
|
|
1911
|
-
|
|
1912
|
-
|
|
1913
|
-
|
|
1914
|
-
|
|
1915
|
-
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
|
|
1923
|
+
var _ref5 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {},
|
|
1924
|
+
_ref5$value = _ref5.value,
|
|
1925
|
+
value = _ref5$value === void 0 ? null : _ref5$value,
|
|
1926
|
+
_ref5$currentTime = _ref5.currentTime,
|
|
1927
|
+
optsCurrentTime = _ref5$currentTime === void 0 ? null : _ref5$currentTime,
|
|
1928
|
+
opts = _objectWithoutProperties__default["default"](_ref5, _excluded2);
|
|
1929
|
+
|
|
1930
|
+
var _ref6 = media || {},
|
|
1931
|
+
_ref6$id = _ref6.id,
|
|
1932
|
+
mediaId = _ref6$id === void 0 ? null : _ref6$id,
|
|
1933
|
+
_ref6$name = _ref6.name,
|
|
1934
|
+
name = _ref6$name === void 0 ? null : _ref6$name,
|
|
1935
|
+
_ref6$duration = _ref6.duration,
|
|
1936
|
+
rootDuration = _ref6$duration === void 0 ? null : _ref6$duration,
|
|
1937
|
+
_ref6$currentTime = _ref6.currentTime,
|
|
1938
|
+
currentTime = _ref6$currentTime === void 0 ? optsCurrentTime : _ref6$currentTime,
|
|
1939
|
+
_ref6$metadata = _ref6.metadata,
|
|
1940
|
+
metadata = _ref6$metadata === void 0 ? {} : _ref6$metadata;
|
|
1941
|
+
|
|
1942
|
+
var _ref7 = metadata || {},
|
|
1943
|
+
_ref7$duration = _ref7.duration,
|
|
1944
|
+
duration = _ref7$duration === void 0 ? rootDuration : _ref7$duration;
|
|
1919
1945
|
|
|
1920
1946
|
var label = name;
|
|
1921
1947
|
|
package/lib/utils.js
CHANGED
|
@@ -428,7 +428,7 @@ var getStyleFromBorder = function getStyleFromBorder(value) {
|
|
|
428
428
|
_value$color = value.color,
|
|
429
429
|
color = _value$color === void 0 ? null : _value$color;
|
|
430
430
|
return _objectSpread__default["default"](_objectSpread__default["default"](_objectSpread__default["default"]({}, width !== null ? {
|
|
431
|
-
borderWidth:
|
|
431
|
+
borderWidth: width
|
|
432
432
|
} : null), borderStyle !== null ? {
|
|
433
433
|
borderStyle: borderStyle
|
|
434
434
|
} : null), getStyleFromColor(color, 'borderColor'));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@micromag/core",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.373",
|
|
4
4
|
"description": "",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"javascript"
|
|
@@ -36,7 +36,14 @@
|
|
|
36
36
|
"./components": "./lib/components.js",
|
|
37
37
|
"./contexts": "./lib/contexts.js",
|
|
38
38
|
"./hooks": "./lib/hooks.js",
|
|
39
|
-
"./utils": "./lib/utils.js"
|
|
39
|
+
"./utils": "./lib/utils.js",
|
|
40
|
+
"./scss/mixins": "./scss/_mixins.scss",
|
|
41
|
+
"./scss/placeholders": "./scss/_placeholders.scss",
|
|
42
|
+
"./scss/theme": "./scss/_theme.scss",
|
|
43
|
+
"./scss/variables": "./scss/_variables.scss",
|
|
44
|
+
"./scss/styles": "./scss/styles.scss",
|
|
45
|
+
"./scss/upload": "./scss/upload.scss",
|
|
46
|
+
"./scss/vendor": "./scss/vendor.scss"
|
|
40
47
|
},
|
|
41
48
|
"browser": {
|
|
42
49
|
".": "./es/index.js",
|
|
@@ -98,7 +105,7 @@
|
|
|
98
105
|
"debug": "^4.3.1",
|
|
99
106
|
"flat": "^5.0.2",
|
|
100
107
|
"hoist-non-react-statics": "^3.3.2",
|
|
101
|
-
"lodash": "^4.17.
|
|
108
|
+
"lodash": "^4.17.21",
|
|
102
109
|
"param-case": "^3.0.4",
|
|
103
110
|
"prop-types": "^15.7.2",
|
|
104
111
|
"react-helmet": "^6.1.0",
|
|
@@ -117,5 +124,5 @@
|
|
|
117
124
|
"publishConfig": {
|
|
118
125
|
"access": "public"
|
|
119
126
|
},
|
|
120
|
-
"gitHead": "
|
|
127
|
+
"gitHead": "613451a824d273954763eaf3a739ec16ac6feb9b"
|
|
121
128
|
}
|