@times-components/tracking 2.10.3 → 2.12.0
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/CHANGELOG.md +30 -0
- package/babel.config.js +13 -2
- package/dist/resolve-attrs.js +10 -1
- package/dist/track-events.js +97 -1
- package/dist/track-scroll-depth.js +150 -1
- package/dist/tracking-context-types.js +17 -1
- package/dist/tracking-context.js +152 -1
- package/dist/tracking.js +31 -1
- package/package.json +17 -18
- package/rnw.js +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,36 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [2.12.0](https://github.com/newsuk/times-components/compare/@times-components/tracking@2.11.1...@times-components/tracking@2.12.0) (2022-08-18)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* **TDP-1712:** remove react-native foreverrrrr ([#3064](https://github.com/newsuk/times-components/issues/3064)) ([2a20cb5](https://github.com/newsuk/times-components/commit/2a20cb5abc10a4e7ca2d62487967f8fcf4eccb62)), closes [#3037](https://github.com/newsuk/times-components/issues/3037) [#3045](https://github.com/newsuk/times-components/issues/3045) [#3050](https://github.com/newsuk/times-components/issues/3050) [#3056](https://github.com/newsuk/times-components/issues/3056) [#3057](https://github.com/newsuk/times-components/issues/3057) [#3066](https://github.com/newsuk/times-components/issues/3066) [#3065](https://github.com/newsuk/times-components/issues/3065) [#3037](https://github.com/newsuk/times-components/issues/3037) [#3045](https://github.com/newsuk/times-components/issues/3045) [#3045](https://github.com/newsuk/times-components/issues/3045) [#3056](https://github.com/newsuk/times-components/issues/3056) [#3066](https://github.com/newsuk/times-components/issues/3066) [#3069](https://github.com/newsuk/times-components/issues/3069) [#3068](https://github.com/newsuk/times-components/issues/3068) [#3070](https://github.com/newsuk/times-components/issues/3070) [#3072](https://github.com/newsuk/times-components/issues/3072) [#3073](https://github.com/newsuk/times-components/issues/3073) [#3071](https://github.com/newsuk/times-components/issues/3071) [#3074](https://github.com/newsuk/times-components/issues/3074) [#3076](https://github.com/newsuk/times-components/issues/3076) [#3079](https://github.com/newsuk/times-components/issues/3079) [#3078](https://github.com/newsuk/times-components/issues/3078) [#3083](https://github.com/newsuk/times-components/issues/3083) [#3087](https://github.com/newsuk/times-components/issues/3087) [#3091](https://github.com/newsuk/times-components/issues/3091) [#3096](https://github.com/newsuk/times-components/issues/3096) [#3102](https://github.com/newsuk/times-components/issues/3102) [#3105](https://github.com/newsuk/times-components/issues/3105) [#3108](https://github.com/newsuk/times-components/issues/3108) [#3111](https://github.com/newsuk/times-components/issues/3111) [#3112](https://github.com/newsuk/times-components/issues/3112) [#3113](https://github.com/newsuk/times-components/issues/3113) [#3114](https://github.com/newsuk/times-components/issues/3114) [#3120](https://github.com/newsuk/times-components/issues/3120) [#3119](https://github.com/newsuk/times-components/issues/3119) [#3112](https://github.com/newsuk/times-components/issues/3112) [#3126](https://github.com/newsuk/times-components/issues/3126) [#3112](https://github.com/newsuk/times-components/issues/3112) [#3126](https://github.com/newsuk/times-components/issues/3126) [#3127](https://github.com/newsuk/times-components/issues/3127) [#3116](https://github.com/newsuk/times-components/issues/3116) [#3128](https://github.com/newsuk/times-components/issues/3128) [#3132](https://github.com/newsuk/times-components/issues/3132) [#3133](https://github.com/newsuk/times-components/issues/3133)
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
## [2.11.1](https://github.com/newsuk/times-components/compare/@times-components/tracking@2.11.0...@times-components/tracking@2.11.1) (2022-08-05)
|
|
18
|
+
|
|
19
|
+
**Note:** Version bump only for package @times-components/tracking
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
# [2.11.0](https://github.com/newsuk/times-components/compare/@times-components/tracking@2.10.3...@times-components/tracking@2.11.0) (2022-07-19)
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
### Features
|
|
29
|
+
|
|
30
|
+
* **tdp-1712:** updated jest configurator ([#3034](https://github.com/newsuk/times-components/issues/3034)) ([af6061a](https://github.com/newsuk/times-components/commit/af6061ae8f196b33e5d48e4e706526e71f1538f5))
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
6
36
|
## [2.10.3](https://github.com/newsuk/times-components/compare/@times-components/tracking@2.10.2...@times-components/tracking@2.10.3) (2022-07-14)
|
|
7
37
|
|
|
8
38
|
**Note:** Version bump only for package @times-components/tracking
|
package/babel.config.js
CHANGED
|
@@ -3,8 +3,19 @@ module.exports = api => {
|
|
|
3
3
|
return {
|
|
4
4
|
plugins: [
|
|
5
5
|
"babel-plugin-styled-components",
|
|
6
|
-
"@babel/plugin-
|
|
6
|
+
"@babel/plugin-proposal-class-properties"
|
|
7
7
|
],
|
|
8
|
-
presets: [
|
|
8
|
+
presets: [
|
|
9
|
+
[
|
|
10
|
+
"@babel/preset-env",
|
|
11
|
+
{
|
|
12
|
+
targets: {
|
|
13
|
+
node: "current"
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
],
|
|
17
|
+
"@babel/preset-react",
|
|
18
|
+
"@babel/preset-typescript"
|
|
19
|
+
]
|
|
9
20
|
};
|
|
10
21
|
};
|
package/dist/resolve-attrs.js
CHANGED
|
@@ -1 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
|
|
8
|
+
var _default = (getAttrs = () => ({}), props = {}, eventArgs = []) => typeof getAttrs === "function" ? getAttrs(props, eventArgs) : {};
|
|
9
|
+
|
|
10
|
+
exports.default = _default;
|
package/dist/track-events.js
CHANGED
|
@@ -1 +1,97 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
|
|
8
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
+
|
|
10
|
+
var _reactDisplayName = _interopRequireDefault(require("react-display-name"));
|
|
11
|
+
|
|
12
|
+
var _hoistNonReactStatics = _interopRequireDefault(require("hoist-non-react-statics"));
|
|
13
|
+
|
|
14
|
+
var _trackingContextTypes = _interopRequireDefault(require("./tracking-context-types"));
|
|
15
|
+
|
|
16
|
+
var _resolveAttrs = _interopRequireDefault(require("./resolve-attrs"));
|
|
17
|
+
|
|
18
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19
|
+
|
|
20
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
21
|
+
|
|
22
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
23
|
+
|
|
24
|
+
const validateEvents = (events, componentName) => {
|
|
25
|
+
const nameMap = new Set();
|
|
26
|
+
events.forEach((e, i) => {
|
|
27
|
+
if (e.eventName === undefined) {
|
|
28
|
+
throw new Error(`WithTrackEvents(${componentName}): Missing eventName at position ${i}, actionName ${e.actionName}`);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
if (e.actionName === undefined) {
|
|
32
|
+
throw new Error(`WithTrackEvents(${componentName}): Missing actionName at position ${i}, eventName ${e.eventName}`);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
if (nameMap.has(e.eventName)) {
|
|
36
|
+
throw new Error(`WithTrackEvents(${componentName}): Event ${e.eventName} was tracked multiple times`);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
nameMap.add(e.eventName);
|
|
40
|
+
});
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
var _default = (WrappedComponent, {
|
|
44
|
+
analyticsEvents = []
|
|
45
|
+
} = {}) => {
|
|
46
|
+
const componentName = (0, _reactDisplayName.default)(WrappedComponent);
|
|
47
|
+
validateEvents(analyticsEvents, componentName);
|
|
48
|
+
|
|
49
|
+
class WithTrackEvents extends _react.Component {
|
|
50
|
+
get wrappedAnalyticsEvents() {
|
|
51
|
+
const {
|
|
52
|
+
tracking
|
|
53
|
+
} = this.context;
|
|
54
|
+
return this.wrapWithTracking(analyticsEvents, (attrs, actionName, trackingName) => tracking && tracking.analytics({
|
|
55
|
+
action: actionName,
|
|
56
|
+
attrs,
|
|
57
|
+
component: trackingName || componentName
|
|
58
|
+
}));
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
wrapWithTracking(eventNames, tracking) {
|
|
62
|
+
return eventNames.reduce((wrappedFuncProps, {
|
|
63
|
+
eventName,
|
|
64
|
+
actionName,
|
|
65
|
+
getAttrs,
|
|
66
|
+
trackingName
|
|
67
|
+
}) => {
|
|
68
|
+
const funcWrapped = (...args) => {
|
|
69
|
+
const attrs = (0, _resolveAttrs.default)(getAttrs, this.props, args);
|
|
70
|
+
tracking(attrs, actionName, trackingName);
|
|
71
|
+
return this.props[eventName] && this.props[eventName](...args); // eslint-disable-line react/destructuring-assignment
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
return { ...wrappedFuncProps,
|
|
75
|
+
[eventName]: funcWrapped
|
|
76
|
+
};
|
|
77
|
+
}, {});
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
render() {
|
|
81
|
+
const wrappedProps = { ...this.props,
|
|
82
|
+
...this.wrappedAnalyticsEvents
|
|
83
|
+
};
|
|
84
|
+
return /*#__PURE__*/_react.default.createElement(WrappedComponent, wrappedProps);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
WithTrackEvents.contextTypes = _trackingContextTypes.default;
|
|
90
|
+
WithTrackEvents.displayName = `WithTrackEvents(${componentName})`;
|
|
91
|
+
WithTrackEvents.propTypes = WrappedComponent.propTypes;
|
|
92
|
+
WithTrackEvents.defaultProps = WrappedComponent.defaultProps;
|
|
93
|
+
(0, _hoistNonReactStatics.default)(WithTrackEvents, WrappedComponent);
|
|
94
|
+
return WithTrackEvents;
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
exports.default = _default;
|
|
@@ -1 +1,150 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
|
|
8
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
+
|
|
10
|
+
var _reactDisplayName = _interopRequireDefault(require("react-display-name"));
|
|
11
|
+
|
|
12
|
+
var _hoistNonReactStatics = _interopRequireDefault(require("hoist-non-react-statics"));
|
|
13
|
+
|
|
14
|
+
var _trackingContextTypes = _interopRequireDefault(require("./tracking-context-types"));
|
|
15
|
+
|
|
16
|
+
var _resolveAttrs = _interopRequireDefault(require("./resolve-attrs"));
|
|
17
|
+
|
|
18
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19
|
+
|
|
20
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
21
|
+
|
|
22
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
23
|
+
|
|
24
|
+
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
25
|
+
|
|
26
|
+
var _default = (WrappedComponent, {
|
|
27
|
+
trackingName,
|
|
28
|
+
getAttrs = () => ({})
|
|
29
|
+
} = {}) => {
|
|
30
|
+
const componentName = (0, _reactDisplayName.default)(WrappedComponent);
|
|
31
|
+
|
|
32
|
+
class WithTrackScrollDepth extends _react.Component {
|
|
33
|
+
constructor(props, context) {
|
|
34
|
+
super(props, context);
|
|
35
|
+
this.receiveChildList = this.receiveChildList.bind(this);
|
|
36
|
+
this.updateOnScroll = this.updateOnScroll.bind(this);
|
|
37
|
+
this.childData = {};
|
|
38
|
+
this.isOnScroll = false;
|
|
39
|
+
this.viewed = new Set();
|
|
40
|
+
|
|
41
|
+
if (typeof window !== "undefined" && window.IntersectionObserver) {
|
|
42
|
+
this.observer = new window.IntersectionObserver(this.onObserved.bind(this), {
|
|
43
|
+
root: null,
|
|
44
|
+
rootMargin: "0px",
|
|
45
|
+
threshold: 0.5
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
this.childList = [];
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
componentDidMount() {
|
|
53
|
+
window.addEventListener("scroll", this.updateOnScroll);
|
|
54
|
+
this.observeChildren();
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
componentDidUpdate() {
|
|
58
|
+
this.observeChildren();
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
componentWillUnmount() {
|
|
62
|
+
window.removeEventListener("scroll", this.updateOnScroll);
|
|
63
|
+
|
|
64
|
+
if (this.observer) {
|
|
65
|
+
this.observer.disconnect();
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
onObserved(observed = []) {
|
|
70
|
+
const {
|
|
71
|
+
tracking
|
|
72
|
+
} = this.context;
|
|
73
|
+
|
|
74
|
+
if (!tracking) {
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
observed.forEach(({
|
|
79
|
+
isIntersecting,
|
|
80
|
+
target
|
|
81
|
+
}) => {
|
|
82
|
+
if (this.isOnScroll && isIntersecting && !this.viewed.has(target.id)) {
|
|
83
|
+
this.viewed.add(target.id);
|
|
84
|
+
this.onChildView(this.childData[target.id]);
|
|
85
|
+
}
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
onChildView(childProps) {
|
|
90
|
+
const {
|
|
91
|
+
tracking
|
|
92
|
+
} = this.context;
|
|
93
|
+
tracking.analytics({
|
|
94
|
+
action: "Scrolled",
|
|
95
|
+
attrs: { ...(0, _resolveAttrs.default)(getAttrs, childProps),
|
|
96
|
+
scrollDepth: {
|
|
97
|
+
itemNumber: childProps.index + 1,
|
|
98
|
+
name: childProps.name,
|
|
99
|
+
total: childProps.total
|
|
100
|
+
}
|
|
101
|
+
},
|
|
102
|
+
component: childProps.eventNavigationName ? childProps.eventNavigationName : `${trackingName || componentName}Child`
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
updateOnScroll() {
|
|
107
|
+
this.isOnScroll = true;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
receiveChildList(childList) {
|
|
111
|
+
this.childList = childList;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
observeChildren() {
|
|
115
|
+
if (this.observer && this.childList) this.childList.forEach((props, index) => {
|
|
116
|
+
if (!this.childData[props.elementId]) {
|
|
117
|
+
this.observeChild({ ...props,
|
|
118
|
+
index,
|
|
119
|
+
total: this.childList.length
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
observeChild(props) {
|
|
126
|
+
const el = document.getElementById(props.elementId);
|
|
127
|
+
|
|
128
|
+
if (el) {
|
|
129
|
+
this.observer.observe(el);
|
|
130
|
+
this.childData[props.elementId] = props;
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
render() {
|
|
135
|
+
return /*#__PURE__*/_react.default.createElement(WrappedComponent, _extends({}, this.props, {
|
|
136
|
+
receiveChildList: this.receiveChildList
|
|
137
|
+
}));
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
WithTrackScrollDepth.contextTypes = _trackingContextTypes.default;
|
|
143
|
+
WithTrackScrollDepth.displayName = `WithTrackScrollDepth(${componentName})`;
|
|
144
|
+
WithTrackScrollDepth.propTypes = WrappedComponent.propTypes;
|
|
145
|
+
WithTrackScrollDepth.defaultProps = WrappedComponent.defaultProps;
|
|
146
|
+
(0, _hoistNonReactStatics.default)(WithTrackScrollDepth, WrappedComponent);
|
|
147
|
+
return WithTrackScrollDepth;
|
|
148
|
+
};
|
|
149
|
+
|
|
150
|
+
exports.default = _default;
|
|
@@ -1 +1,17 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
|
|
8
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
|
+
|
|
10
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
|
+
|
|
12
|
+
var _default = {
|
|
13
|
+
tracking: _propTypes.default.shape({
|
|
14
|
+
analytics: _propTypes.default.func
|
|
15
|
+
})
|
|
16
|
+
};
|
|
17
|
+
exports.default = _default;
|
package/dist/tracking-context.js
CHANGED
|
@@ -1 +1,152 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
|
|
8
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
+
|
|
10
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
|
+
|
|
12
|
+
var _reactDisplayName = _interopRequireDefault(require("react-display-name"));
|
|
13
|
+
|
|
14
|
+
var _lodash = _interopRequireDefault(require("lodash.get"));
|
|
15
|
+
|
|
16
|
+
var _hoistNonReactStatics = _interopRequireDefault(require("hoist-non-react-statics"));
|
|
17
|
+
|
|
18
|
+
var _trackingContextTypes = _interopRequireDefault(require("./tracking-context-types"));
|
|
19
|
+
|
|
20
|
+
var _resolveAttrs = _interopRequireDefault(require("./resolve-attrs"));
|
|
21
|
+
|
|
22
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
23
|
+
|
|
24
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
25
|
+
|
|
26
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
27
|
+
|
|
28
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
29
|
+
|
|
30
|
+
const withTrackingContext = (WrappedComponent, {
|
|
31
|
+
getAttrs = () => ({}),
|
|
32
|
+
trackingObjectName = "",
|
|
33
|
+
isDataReady = ({
|
|
34
|
+
isLoading
|
|
35
|
+
}) => !isLoading
|
|
36
|
+
} = {}) => {
|
|
37
|
+
const componentName = (0, _reactDisplayName.default)(WrappedComponent);
|
|
38
|
+
|
|
39
|
+
class WithTrackingContext extends _react.Component {
|
|
40
|
+
constructor(props, context) {
|
|
41
|
+
super(props, context);
|
|
42
|
+
|
|
43
|
+
_defineProperty(this, "fireAnalyticsEvent", ({
|
|
44
|
+
object,
|
|
45
|
+
component,
|
|
46
|
+
action,
|
|
47
|
+
attrs
|
|
48
|
+
}) => {
|
|
49
|
+
const decoratedEvent = {
|
|
50
|
+
action,
|
|
51
|
+
attrs: { ...(0, _resolveAttrs.default)(getAttrs, this.props),
|
|
52
|
+
...attrs
|
|
53
|
+
},
|
|
54
|
+
component,
|
|
55
|
+
object: trackingObjectName
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
if (object || trackingObjectName) {
|
|
59
|
+
decoratedEvent.object = object || trackingObjectName;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
if (this.isRootTrackingContext()) {
|
|
63
|
+
decoratedEvent.attrs.eventTime = new Date().toISOString();
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
if (attrs && attrs.isLocked) {
|
|
67
|
+
decoratedEvent.article_locked_status = attrs.isLocked;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
this.analyticsStream(decoratedEvent);
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
const {
|
|
74
|
+
analyticsStream
|
|
75
|
+
} = this.props;
|
|
76
|
+
this.pageEventTriggered = false;
|
|
77
|
+
|
|
78
|
+
if (this.isRootTrackingContext()) {
|
|
79
|
+
if (!trackingObjectName) {
|
|
80
|
+
throw new TypeError("Missing argument trackingObjectName of withTrackingContext()");
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
if (!analyticsStream) {
|
|
84
|
+
throw new TypeError("Missing prop analyticsStream of WithTrackingContext");
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
getChildContext() {
|
|
90
|
+
return {
|
|
91
|
+
tracking: {
|
|
92
|
+
analytics: this.fireAnalyticsEvent
|
|
93
|
+
}
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
componentDidMount() {
|
|
98
|
+
this.attemptTrackPageEvent(this.props);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
componentDidUpdate() {
|
|
102
|
+
this.attemptTrackPageEvent(this.props);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
attemptTrackPageEvent(props) {
|
|
106
|
+
if (isDataReady(props) && (this.isRootTrackingContext() || props.enforceTracking) && this.pageEventTriggered === false) {
|
|
107
|
+
this.pageEventTriggered = true;
|
|
108
|
+
this.fireAnalyticsEvent({
|
|
109
|
+
action: "Viewed",
|
|
110
|
+
attrs: (0, _resolveAttrs.default)(getAttrs, props),
|
|
111
|
+
component: "Page"
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
isRootTrackingContext() {
|
|
117
|
+
const {
|
|
118
|
+
tracking
|
|
119
|
+
} = this.context;
|
|
120
|
+
return !this.context || !tracking;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
analyticsStream(analyticsEvent) {
|
|
124
|
+
const {
|
|
125
|
+
analyticsStream
|
|
126
|
+
} = this.props;
|
|
127
|
+
const stream = (0, _lodash.default)(this.context, "tracking.analytics") || analyticsStream;
|
|
128
|
+
return stream && stream(analyticsEvent);
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
render() {
|
|
132
|
+
return /*#__PURE__*/_react.default.createElement(WrappedComponent, this.props);
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
_defineProperty(WithTrackingContext, "defaultProps", { ...WrappedComponent.defaultProps
|
|
138
|
+
});
|
|
139
|
+
|
|
140
|
+
WithTrackingContext.displayName = `WithTrackingContext(${componentName})`;
|
|
141
|
+
WithTrackingContext.contextTypes = _trackingContextTypes.default;
|
|
142
|
+
WithTrackingContext.childContextTypes = _trackingContextTypes.default;
|
|
143
|
+
WithTrackingContext.propTypes = {
|
|
144
|
+
analyticsStream: _propTypes.default.func,
|
|
145
|
+
...WrappedComponent.propTypes
|
|
146
|
+
};
|
|
147
|
+
(0, _hoistNonReactStatics.default)(WithTrackingContext, WrappedComponent);
|
|
148
|
+
return WithTrackingContext;
|
|
149
|
+
};
|
|
150
|
+
|
|
151
|
+
var _default = withTrackingContext;
|
|
152
|
+
exports.default = _default;
|
package/dist/tracking.js
CHANGED
|
@@ -1 +1,31 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "withTrackingContext", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function () {
|
|
9
|
+
return _trackingContext.default;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
Object.defineProperty(exports, "withTrackEvents", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function () {
|
|
15
|
+
return _trackEvents.default;
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
Object.defineProperty(exports, "withTrackScrollDepth", {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: function () {
|
|
21
|
+
return _trackScrollDepth.default;
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
var _trackingContext = _interopRequireDefault(require("./tracking-context"));
|
|
26
|
+
|
|
27
|
+
var _trackEvents = _interopRequireDefault(require("./track-events"));
|
|
28
|
+
|
|
29
|
+
var _trackScrollDepth = _interopRequireDefault(require("./track-scroll-depth"));
|
|
30
|
+
|
|
31
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@times-components/tracking",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.12.0",
|
|
4
4
|
"main": "dist/tracking",
|
|
5
5
|
"dev": "src/tracking",
|
|
6
6
|
"scripts": {
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"prettier:diff": "prettier --list-different '**/*.*'",
|
|
9
9
|
"depcheck": "depcheck --ignores='@babel/*,babel-*,depcheck,eslint,jest,prettier,webpack*' --ignore-bin-package=false --skip-missing",
|
|
10
10
|
"lint": "eslint . && yarn prettier:diff",
|
|
11
|
-
"test:web": "jest --config='./__tests__/
|
|
11
|
+
"test:web": "jest --config='./__tests__/jest.config.js'",
|
|
12
12
|
"prepublishOnly": "yarn transpile && yarn bundle",
|
|
13
13
|
"watch": "watch 'yarn bundle' ./src --ignoreDotFiles --ignoreUnreadable",
|
|
14
14
|
"cleanup-dist": "rm -rf dist",
|
|
@@ -20,10 +20,7 @@
|
|
|
20
20
|
"url": "git+https://github.com/newsuk/times-components.git"
|
|
21
21
|
},
|
|
22
22
|
"keywords": [
|
|
23
|
-
"react-native-web",
|
|
24
23
|
"react",
|
|
25
|
-
"native",
|
|
26
|
-
"web",
|
|
27
24
|
"tracking",
|
|
28
25
|
"component"
|
|
29
26
|
],
|
|
@@ -35,25 +32,23 @@
|
|
|
35
32
|
"devDependencies": {
|
|
36
33
|
"@babel/core": "7.4.4",
|
|
37
34
|
"@times-components/eslint-config-thetimes": "0.8.18",
|
|
38
|
-
"@times-components/jest-configurator": "
|
|
39
|
-
"@times-components/jest-serializer": "3.
|
|
40
|
-
"@times-components/storybook": "4.
|
|
41
|
-
"@times-components/tealium-utils": "0.
|
|
42
|
-
"@times-components/utils": "6.14.
|
|
35
|
+
"@times-components/jest-configurator-web": "0.8.0",
|
|
36
|
+
"@times-components/jest-serializer": "3.4.0",
|
|
37
|
+
"@times-components/storybook": "4.5.0",
|
|
38
|
+
"@times-components/tealium-utils": "0.8.0",
|
|
39
|
+
"@times-components/utils": "6.14.4",
|
|
43
40
|
"babel-jest": "24.8.0",
|
|
44
41
|
"babel-loader": "8.0.5",
|
|
45
|
-
"babel-plugin-add-react-displayname": "0.0.5",
|
|
46
|
-
"babel-plugin-styled-components": "1.10.6",
|
|
47
42
|
"depcheck": "0.6.9",
|
|
48
43
|
"enzyme": "3.9.0",
|
|
49
44
|
"eslint": "5.9.0",
|
|
50
45
|
"jest": "24.8.0",
|
|
51
46
|
"prettier": "1.14.3",
|
|
52
47
|
"react-test-renderer": "16.9.0",
|
|
53
|
-
"webpack": "4.30.0"
|
|
54
|
-
"webpack-cli": "3.3.1"
|
|
48
|
+
"webpack": "4.30.0"
|
|
55
49
|
},
|
|
56
50
|
"dependencies": {
|
|
51
|
+
"@times-components/utils": "6.15.0",
|
|
57
52
|
"hoist-non-react-statics": "3.3.2",
|
|
58
53
|
"lodash.get": "4.4.2",
|
|
59
54
|
"prop-types": "15.7.2",
|
|
@@ -65,12 +60,16 @@
|
|
|
65
60
|
},
|
|
66
61
|
"peerDependencies": {
|
|
67
62
|
"react": ">=16.9",
|
|
68
|
-
"react-dom": ">=16.9"
|
|
69
|
-
"react-native": ">=0.59",
|
|
70
|
-
"react-native-web": "0.11.4"
|
|
63
|
+
"react-dom": ">=16.9"
|
|
71
64
|
},
|
|
72
65
|
"publishConfig": {
|
|
73
66
|
"access": "public"
|
|
74
67
|
},
|
|
75
|
-
"
|
|
68
|
+
"eslintConfig": {
|
|
69
|
+
"extends": [
|
|
70
|
+
"react-app",
|
|
71
|
+
"react-app/jest"
|
|
72
|
+
]
|
|
73
|
+
},
|
|
74
|
+
"gitHead": "fe2f12b7448a88662c53f840772282cd97756c5c"
|
|
76
75
|
}
|
package/rnw.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
module.exports=function(t){var e={};function r(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)r.d(n,o,function(e){return t[e]}.bind(null,o));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=13)}([function(t,e){t.exports=require("@babel/runtime/helpers/interopRequireDefault")},function(t,e){t.exports=require("@babel/runtime/helpers/defineProperty")},function(t,e){t.exports=require("@babel/runtime/helpers/classCallCheck")},function(t,e){t.exports=require("@babel/runtime/helpers/createClass")},function(t,e){t.exports=require("@babel/runtime/helpers/inherits")},function(t,e){t.exports=require("@babel/runtime/helpers/possibleConstructorReturn")},function(t,e){t.exports=require("@babel/runtime/helpers/getPrototypeOf")},function(t,e){t.exports=require("react")},function(t,e){t.exports=require("react-display-name")},function(t,e){t.exports=require("hoist-non-react-statics")},function(t,e,r){var n=r(0);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var o=n(r(12)),i={tracking:o.default.shape({analytics:o.default.func})};e.default=i},function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;e.default=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(){return{}},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return"function"==typeof t?t(e,r):{}}},function(t,e){t.exports=require("prop-types")},function(t,e,r){var n=r(0);Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"withTrackingContext",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(e,"withTrackEvents",{enumerable:!0,get:function(){return i.default}}),Object.defineProperty(e,"withTrackScrollDepth",{enumerable:!0,get:function(){return a.default}});var o=n(r(14)),i=n(r(16)),a=n(r(17))},function(t,e,r){var n=r(0);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var o=n(r(1)),i=n(r(2)),a=n(r(3)),u=n(r(4)),c=n(r(5)),l=n(r(6)),f=function(t,e){if(!e&&t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var r=y(e);if(r&&r.has(t))return r.get(t);var n={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in t)if("default"!==i&&Object.prototype.hasOwnProperty.call(t,i)){var a=o?Object.getOwnPropertyDescriptor(t,i):null;a&&(a.get||a.set)?Object.defineProperty(n,i,a):n[i]=t[i]}n.default=t,r&&r.set(t,n);return n}(r(7)),s=(n(r(12)),n(r(8))),p=n(r(15)),d=n(r(9)),v=n(r(10)),h=n(r(11));function y(t){if("function"!=typeof WeakMap)return null;var e=new WeakMap,r=new WeakMap;return(y=function(t){return t?r:e})(t)}function b(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function g(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?b(Object(r),!0).forEach((function(e){(0,o.default)(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):b(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function O(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=(0,l.default)(t);if(e){var o=(0,l.default)(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return(0,c.default)(this,r)}}var m=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=e.getAttrs,n=void 0===r?function(){return{}}:r,o=e.trackingObjectName,c=void 0===o?"":o,l=e.isDataReady,y=void 0===l?function(t){return!t.isLoading}:l,b=(0,s.default)(t),m=function(e){(0,u.default)(o,e);var r=O(o);function o(t,e){var a;(0,i.default)(this,o),(a=r.call(this,t,e)).fireAnalyticsEvent=function(t){var e=t.object,r=t.component,o=t.action,i=t.attrs,u={action:o,attrs:g(g({},(0,h.default)(n,a.props)),i),component:r,object:c};(e||c)&&(u.object=e||c),a.isRootTrackingContext()&&(u.attrs.eventTime=(new Date).toISOString()),null!=i&&i.isLocked&&(u.article_locked_status=i.isLocked),a.analyticsStream(u)};var u=a.props.analyticsStream;if(a.pageEventTriggered=!1,a.isRootTrackingContext()){if(!c)throw new TypeError("Missing argument trackingObjectName of withTrackingContext()");if(!u)throw new TypeError("Missing prop analyticsStream of WithTrackingContext")}return a}return(0,a.default)(o,[{key:"getChildContext",value:function(){return{tracking:{analytics:this.fireAnalyticsEvent}}}},{key:"componentDidMount",value:function(){this.attemptTrackPageEvent(this.props)}},{key:"componentDidUpdate",value:function(){this.attemptTrackPageEvent(this.props)}},{key:"attemptTrackPageEvent",value:function(t){y(t)&&(this.isRootTrackingContext()||t.enforceTracking)&&!1===this.pageEventTriggered&&(this.pageEventTriggered=!0,this.fireAnalyticsEvent({action:"Viewed",attrs:(0,h.default)(n,t),component:"Page"}))}},{key:"isRootTrackingContext",value:function(){var t=this.context.tracking;return!this.context||!t}},{key:"analyticsStream",value:function(t){var e=this.props.analyticsStream,r=(0,p.default)(this.context,"tracking.analytics")||e;return r&&r(t)}},{key:"render",value:function(){return f.default.createElement(t,this.props)}}]),o}(f.Component);return m.defaultProps=g({},t.defaultProps),m.displayName="WithTrackingContext("+b+")",m.contextTypes=v.default,m.childContextTypes=v.default,(0,d.default)(m,t),m};e.default=m},function(t,e){var r=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,n=/^\w*$/,o=/^\./,i=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,a=/\\(\\)?/g,u=/^\[object .+?Constructor\]$/,c="object"==typeof global&&global&&global.Object===Object&&global,l="object"==typeof self&&self&&self.Object===Object&&self,f=c||l||Function("return this")();var s,p=Array.prototype,d=Function.prototype,v=Object.prototype,h=f["__core-js_shared__"],y=(s=/[^.]+$/.exec(h&&h.keys&&h.keys.IE_PROTO||""))?"Symbol(src)_1."+s:"",b=d.toString,g=v.hasOwnProperty,O=v.toString,m=RegExp("^"+b.call(g).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),_=f.Symbol,j=p.splice,w=R(f,"Map"),k=R(Object,"create"),P=_?_.prototype:void 0,x=P?P.toString:void 0;function E(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function S(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function T(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function C(t,e){for(var r,n,o=t.length;o--;)if((r=t[o][0])===(n=e)||r!=r&&n!=n)return o;return-1}function D(t,e){for(var o,i=0,a=(e=function(t,e){if(A(t))return!1;var o=typeof t;if("number"==o||"symbol"==o||"boolean"==o||null==t||$(t))return!0;return n.test(t)||!r.test(t)||null!=e&&t in Object(e)}(e,t)?[e]:A(o=e)?o:W(o)).length;null!=t&&i<a;)t=t[L(e[i++])];return i&&i==a?t:void 0}function M(t){return!(!I(t)||(e=t,y&&y in e))&&(function(t){var e=I(t)?O.call(t):"";return"[object Function]"==e||"[object GeneratorFunction]"==e}(t)||function(t){var e=!1;if(null!=t&&"function"!=typeof t.toString)try{e=!!(t+"")}catch(t){}return e}(t)?m:u).test(function(t){if(null!=t){try{return b.call(t)}catch(t){}try{return t+""}catch(t){}}return""}(t));var e}function N(t,e){var r,n,o=t.__data__;return("string"==(n=typeof(r=e))||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==r:null===r)?o["string"==typeof e?"string":"hash"]:o.map}function R(t,e){var r=function(t,e){return null==t?void 0:t[e]}(t,e);return M(r)?r:void 0}E.prototype.clear=function(){this.__data__=k?k(null):{}},E.prototype.delete=function(t){return this.has(t)&&delete this.__data__[t]},E.prototype.get=function(t){var e=this.__data__;if(k){var r=e[t];return"__lodash_hash_undefined__"===r?void 0:r}return g.call(e,t)?e[t]:void 0},E.prototype.has=function(t){var e=this.__data__;return k?void 0!==e[t]:g.call(e,t)},E.prototype.set=function(t,e){return this.__data__[t]=k&&void 0===e?"__lodash_hash_undefined__":e,this},S.prototype.clear=function(){this.__data__=[]},S.prototype.delete=function(t){var e=this.__data__,r=C(e,t);return!(r<0)&&(r==e.length-1?e.pop():j.call(e,r,1),!0)},S.prototype.get=function(t){var e=this.__data__,r=C(e,t);return r<0?void 0:e[r][1]},S.prototype.has=function(t){return C(this.__data__,t)>-1},S.prototype.set=function(t,e){var r=this.__data__,n=C(r,t);return n<0?r.push([t,e]):r[n][1]=e,this},T.prototype.clear=function(){this.__data__={hash:new E,map:new(w||S),string:new E}},T.prototype.delete=function(t){return N(this,t).delete(t)},T.prototype.get=function(t){return N(this,t).get(t)},T.prototype.has=function(t){return N(this,t).has(t)},T.prototype.set=function(t,e){return N(this,t).set(t,e),this};var W=q((function(t){var e;t=null==(e=t)?"":function(t){if("string"==typeof t)return t;if($(t))return x?x.call(t):"";var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}(e);var r=[];return o.test(t)&&r.push(""),t.replace(i,(function(t,e,n,o){r.push(n?o.replace(a,"$1"):e||t)})),r}));function L(t){if("string"==typeof t||$(t))return t;var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}function q(t,e){if("function"!=typeof t||e&&"function"!=typeof e)throw new TypeError("Expected a function");var r=function(){var n=arguments,o=e?e.apply(this,n):n[0],i=r.cache;if(i.has(o))return i.get(o);var a=t.apply(this,n);return r.cache=i.set(o,a),a};return r.cache=new(q.Cache||T),r}q.Cache=T;var A=Array.isArray;function I(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function $(t){return"symbol"==typeof t||function(t){return!!t&&"object"==typeof t}(t)&&"[object Symbol]"==O.call(t)}t.exports=function(t,e,r){var n=null==t?void 0:D(t,e);return void 0===n?r:n}},function(t,e,r){var n=r(0);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var o=n(r(1)),i=n(r(2)),a=n(r(3)),u=n(r(4)),c=n(r(5)),l=n(r(6)),f=function(t,e){if(!e&&t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var r=h(e);if(r&&r.has(t))return r.get(t);var n={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in t)if("default"!==i&&Object.prototype.hasOwnProperty.call(t,i)){var a=o?Object.getOwnPropertyDescriptor(t,i):null;a&&(a.get||a.set)?Object.defineProperty(n,i,a):n[i]=t[i]}n.default=t,r&&r.set(t,n);return n}(r(7)),s=n(r(8)),p=n(r(9)),d=n(r(10)),v=n(r(11));function h(t){if("function"!=typeof WeakMap)return null;var e=new WeakMap,r=new WeakMap;return(h=function(t){return t?r:e})(t)}function y(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function b(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?y(Object(r),!0).forEach((function(e){(0,o.default)(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):y(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function g(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=(0,l.default)(t);if(e){var o=(0,l.default)(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return(0,c.default)(this,r)}}var O=function(t,e){var r=new Set;t.forEach((function(t,n){if(void 0===t.eventName)throw new Error("WithTrackEvents("+e+"): Missing eventName at position "+n+", actionName "+t.actionName);if(void 0===t.actionName)throw new Error("WithTrackEvents("+e+"): Missing actionName at position "+n+", eventName "+t.eventName);if(r.has(t.eventName))throw new Error("WithTrackEvents("+e+"): Event "+t.eventName+" was tracked multiple times");r.add(t.eventName)}))};e.default=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=e.analyticsEvents,n=void 0===r?[]:r,c=(0,s.default)(t);O(n,c);var l=function(e){(0,u.default)(l,e);var r=g(l);function l(){return(0,i.default)(this,l),r.apply(this,arguments)}return(0,a.default)(l,[{key:"wrappedAnalyticsEvents",get:function(){var t=this.context.tracking;return this.wrapWithTracking(n,(function(e,r,n){return t&&t.analytics({action:r,attrs:e,component:n||c})}))}},{key:"wrapWithTracking",value:function(t,e){var r=this;return t.reduce((function(t,n){var i=n.eventName,a=n.actionName,u=n.getAttrs,c=n.trackingName;return b(b({},t),{},(0,o.default)({},i,(function(){for(var t,n=arguments.length,o=new Array(n),l=0;l<n;l++)o[l]=arguments[l];var f=(0,v.default)(u,r.props,o);return e(f,a,c),r.props[i]&&(t=r.props)[i].apply(t,o)})))}),{})}},{key:"render",value:function(){var e=b(b({},this.props),this.wrappedAnalyticsEvents);return f.default.createElement(t,e)}}]),l}(f.Component);return l.contextTypes=d.default,l.displayName="WithTrackEvents("+c+")",l.defaultProps=t.defaultProps,(0,p.default)(l,t),l}},function(t,e,r){var n=r(0);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var o=n(r(18)),i=n(r(1)),a=n(r(2)),u=n(r(3)),c=n(r(19)),l=n(r(4)),f=n(r(5)),s=n(r(6)),p=function(t,e){if(!e&&t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var r=b(e);if(r&&r.has(t))return r.get(t);var n={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in t)if("default"!==i&&Object.prototype.hasOwnProperty.call(t,i)){var a=o?Object.getOwnPropertyDescriptor(t,i):null;a&&(a.get||a.set)?Object.defineProperty(n,i,a):n[i]=t[i]}n.default=t,r&&r.set(t,n);return n}(r(7)),d=n(r(8)),v=n(r(9)),h=n(r(10)),y=n(r(11));function b(t){if("function"!=typeof WeakMap)return null;var e=new WeakMap,r=new WeakMap;return(b=function(t){return t?r:e})(t)}function g(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function O(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?g(Object(r),!0).forEach((function(e){(0,i.default)(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):g(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function m(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=(0,s.default)(t);if(e){var o=(0,s.default)(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return(0,f.default)(this,r)}}e.default=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=e.trackingName,n=e.getAttrs,i=void 0===n?function(){return{}}:n,f=(0,d.default)(t),s=function(e){(0,l.default)(s,e);var n=m(s);function s(t,e){var r;return(0,a.default)(this,s),(r=n.call(this,t,e)).receiveChildList=r.receiveChildList.bind((0,c.default)(r)),r.updateOnScroll=r.updateOnScroll.bind((0,c.default)(r)),r.childData={},r.isOnScroll=!1,r.viewed=new Set,"undefined"!=typeof window&&window.IntersectionObserver&&(r.observer=new window.IntersectionObserver(r.onObserved.bind((0,c.default)(r)),{root:null,rootMargin:"0px",threshold:.5})),r.childList=[],r}return(0,u.default)(s,[{key:"componentDidMount",value:function(){window.addEventListener("scroll",this.updateOnScroll),this.observeChildren()}},{key:"componentDidUpdate",value:function(){this.observeChildren()}},{key:"componentWillUnmount",value:function(){window.removeEventListener("scroll",this.updateOnScroll),this.observer&&this.observer.disconnect()}},{key:"onObserved",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],r=this.context.tracking;r&&e.forEach((function(e){var r=e.isIntersecting,n=e.target;t.isOnScroll&&r&&!t.viewed.has(n.id)&&(t.viewed.add(n.id),t.onChildView(t.childData[n.id]))}))}},{key:"onChildView",value:function(t){this.context.tracking.analytics({action:"Scrolled",attrs:O(O({},(0,y.default)(i,t)),{},{scrollDepth:{itemNumber:t.index+1,name:t.name,total:t.total}}),component:t.eventNavigationName?t.eventNavigationName:(r||f)+"Child"})}},{key:"updateOnScroll",value:function(){this.isOnScroll=!0}},{key:"receiveChildList",value:function(t){this.childList=t}},{key:"observeChildren",value:function(){var t=this;this.observer&&this.childList&&this.childList.forEach((function(e,r){t.childData[e.elementId]||t.observeChild(O(O({},e),{},{index:r,total:t.childList.length}))}))}},{key:"observeChild",value:function(t){var e=document.getElementById(t.elementId);e&&(this.observer.observe(e),this.childData[t.elementId]=t)}},{key:"render",value:function(){return p.default.createElement(t,(0,o.default)({},this.props,{receiveChildList:this.receiveChildList}))}}]),s}(p.Component);return s.contextTypes=h.default,s.displayName="WithTrackScrollDepth("+f+")",s.defaultProps=t.defaultProps,(0,v.default)(s,t),s}},function(t,e){t.exports=require("@babel/runtime/helpers/extends")},function(t,e){t.exports=require("@babel/runtime/helpers/assertThisInitialized")}]);
|
|
1
|
+
module.exports=function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=5)}([function(t,e){t.exports=require("react")},function(t,e){t.exports=require("react-display-name")},function(t,e){t.exports=require("hoist-non-react-statics")},function(t,e){t.exports=require("prop-types")},function(t,e){var n=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,r=/^\w*$/,i=/^\./,o=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,a=/\\(\\)?/g,s=/^\[object .+?Constructor\]$/,c="object"==typeof global&&global&&global.Object===Object&&global,l="object"==typeof self&&self&&self.Object===Object&&self,u=c||l||Function("return this")();var h,p=Array.prototype,d=Function.prototype,f=Object.prototype,v=u["__core-js_shared__"],y=(h=/[^.]+$/.exec(v&&v.keys&&v.keys.IE_PROTO||""))?"Symbol(src)_1."+h:"",g=d.toString,m=f.hasOwnProperty,_=f.toString,b=RegExp("^"+g.call(m).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),w=u.Symbol,x=p.splice,k=D(u,"Map"),O=D(Object,"create"),E=w?w.prototype:void 0,T=E?E.toString:void 0;function S(t){var e=-1,n=t?t.length:0;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function j(t){var e=-1,n=t?t.length:0;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function C(t){var e=-1,n=t?t.length:0;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function N(t,e){for(var n,r,i=t.length;i--;)if((n=t[i][0])===(r=e)||n!=n&&r!=r)return i;return-1}function P(t,e){for(var i,o=0,a=(e=function(t,e){if(I(t))return!1;var i=typeof t;if("number"==i||"symbol"==i||"boolean"==i||null==t||q(t))return!0;return r.test(t)||!n.test(t)||null!=e&&t in Object(e)}(e,t)?[e]:I(i=e)?i:M(i)).length;null!=t&&o<a;)t=t[A(e[o++])];return o&&o==a?t:void 0}function $(t){return!(!R(t)||(e=t,y&&y in e))&&(function(t){var e=R(t)?_.call(t):"";return"[object Function]"==e||"[object GeneratorFunction]"==e}(t)||function(t){var e=!1;if(null!=t&&"function"!=typeof t.toString)try{e=!!(t+"")}catch(t){}return e}(t)?b:s).test(function(t){if(null!=t){try{return g.call(t)}catch(t){}try{return t+""}catch(t){}}return""}(t));var e}function L(t,e){var n,r,i=t.__data__;return("string"==(r=typeof(n=e))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?i["string"==typeof e?"string":"hash"]:i.map}function D(t,e){var n=function(t,e){return null==t?void 0:t[e]}(t,e);return $(n)?n:void 0}S.prototype.clear=function(){this.__data__=O?O(null):{}},S.prototype.delete=function(t){return this.has(t)&&delete this.__data__[t]},S.prototype.get=function(t){var e=this.__data__;if(O){var n=e[t];return"__lodash_hash_undefined__"===n?void 0:n}return m.call(e,t)?e[t]:void 0},S.prototype.has=function(t){var e=this.__data__;return O?void 0!==e[t]:m.call(e,t)},S.prototype.set=function(t,e){return this.__data__[t]=O&&void 0===e?"__lodash_hash_undefined__":e,this},j.prototype.clear=function(){this.__data__=[]},j.prototype.delete=function(t){var e=this.__data__,n=N(e,t);return!(n<0)&&(n==e.length-1?e.pop():x.call(e,n,1),!0)},j.prototype.get=function(t){var e=this.__data__,n=N(e,t);return n<0?void 0:e[n][1]},j.prototype.has=function(t){return N(this.__data__,t)>-1},j.prototype.set=function(t,e){var n=this.__data__,r=N(n,t);return r<0?n.push([t,e]):n[r][1]=e,this},C.prototype.clear=function(){this.__data__={hash:new S,map:new(k||j),string:new S}},C.prototype.delete=function(t){return L(this,t).delete(t)},C.prototype.get=function(t){return L(this,t).get(t)},C.prototype.has=function(t){return L(this,t).has(t)},C.prototype.set=function(t,e){return L(this,t).set(t,e),this};var M=W((function(t){var e;t=null==(e=t)?"":function(t){if("string"==typeof t)return t;if(q(t))return T?T.call(t):"";var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}(e);var n=[];return i.test(t)&&n.push(""),t.replace(o,(function(t,e,r,i){n.push(r?i.replace(a,"$1"):e||t)})),n}));function A(t){if("string"==typeof t||q(t))return t;var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}function W(t,e){if("function"!=typeof t||e&&"function"!=typeof e)throw new TypeError("Expected a function");var n=function(){var r=arguments,i=e?e.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var a=t.apply(this,r);return n.cache=o.set(i,a),a};return n.cache=new(W.Cache||C),n}W.Cache=C;var I=Array.isArray;function R(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function q(t){return"symbol"==typeof t||function(t){return!!t&&"object"==typeof t}(t)&&"[object Symbol]"==_.call(t)}t.exports=function(t,e,n){var r=null==t?void 0:P(t,e);return void 0===r?n:r}},function(t,e,n){"use strict";n.r(e);var r=n(0),i=n.n(r),o=n(3),a=n.n(o),s=n(1),c=n.n(s),l=n(4),u=n.n(l),h=n(2),p=n.n(h),d={tracking:a.a.shape({analytics:a.a.func})},f=(t=(()=>({})),e={},n=[])=>"function"==typeof t?t(e,n):{};function v(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var y=(t,{getAttrs:e=(()=>({})),trackingObjectName:n="",isDataReady:o=(({isLoading:t})=>!t)}={})=>{const a=c()(t);class s extends r.Component{constructor(t,r){super(t,r),v(this,"fireAnalyticsEvent",({object:t,component:r,action:i,attrs:o})=>{const a={action:i,attrs:{...f(e,this.props),...o},component:r,object:n};(t||n)&&(a.object=t||n),this.isRootTrackingContext()&&(a.attrs.eventTime=(new Date).toISOString()),o&&o.isLocked&&(a.article_locked_status=o.isLocked),this.analyticsStream(a)});const{analyticsStream:i}=this.props;if(this.pageEventTriggered=!1,this.isRootTrackingContext()){if(!n)throw new TypeError("Missing argument trackingObjectName of withTrackingContext()");if(!i)throw new TypeError("Missing prop analyticsStream of WithTrackingContext")}}getChildContext(){return{tracking:{analytics:this.fireAnalyticsEvent}}}componentDidMount(){this.attemptTrackPageEvent(this.props)}componentDidUpdate(){this.attemptTrackPageEvent(this.props)}attemptTrackPageEvent(t){o(t)&&(this.isRootTrackingContext()||t.enforceTracking)&&!1===this.pageEventTriggered&&(this.pageEventTriggered=!0,this.fireAnalyticsEvent({action:"Viewed",attrs:f(e,t),component:"Page"}))}isRootTrackingContext(){const{tracking:t}=this.context;return!this.context||!t}analyticsStream(t){const{analyticsStream:e}=this.props,n=u()(this.context,"tracking.analytics")||e;return n&&n(t)}render(){return i.a.createElement(t,this.props)}}return v(s,"defaultProps",{...t.defaultProps}),s.displayName=`WithTrackingContext(${a})`,s.contextTypes=d,s.childContextTypes=d,p()(s,t),s};var g=(t,{analyticsEvents:e=[]}={})=>{const n=c()(t);((t,e)=>{const n=new Set;t.forEach((t,r)=>{if(void 0===t.eventName)throw new Error(`WithTrackEvents(${e}): Missing eventName at position ${r}, actionName ${t.actionName}`);if(void 0===t.actionName)throw new Error(`WithTrackEvents(${e}): Missing actionName at position ${r}, eventName ${t.eventName}`);if(n.has(t.eventName))throw new Error(`WithTrackEvents(${e}): Event ${t.eventName} was tracked multiple times`);n.add(t.eventName)})})(e,n);class o extends r.Component{get wrappedAnalyticsEvents(){const{tracking:t}=this.context;return this.wrapWithTracking(e,(e,r,i)=>t&&t.analytics({action:r,attrs:e,component:i||n}))}wrapWithTracking(t,e){return t.reduce((t,{eventName:n,actionName:r,getAttrs:i,trackingName:o})=>({...t,[n]:(...t)=>{const a=f(i,this.props,t);return e(a,r,o),this.props[n]&&this.props[n](...t)}}),{})}render(){const e={...this.props,...this.wrappedAnalyticsEvents};return i.a.createElement(t,e)}}return o.contextTypes=d,o.displayName=`WithTrackEvents(${n})`,o.defaultProps=t.defaultProps,p()(o,t),o};function m(){return(m=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t}).apply(this,arguments)}var _=(t,{trackingName:e,getAttrs:n=(()=>({}))}={})=>{const o=c()(t);class a extends r.Component{constructor(t,e){super(t,e),this.receiveChildList=this.receiveChildList.bind(this),this.updateOnScroll=this.updateOnScroll.bind(this),this.childData={},this.isOnScroll=!1,this.viewed=new Set,"undefined"!=typeof window&&window.IntersectionObserver&&(this.observer=new window.IntersectionObserver(this.onObserved.bind(this),{root:null,rootMargin:"0px",threshold:.5})),this.childList=[]}componentDidMount(){window.addEventListener("scroll",this.updateOnScroll),this.observeChildren()}componentDidUpdate(){this.observeChildren()}componentWillUnmount(){window.removeEventListener("scroll",this.updateOnScroll),this.observer&&this.observer.disconnect()}onObserved(t=[]){const{tracking:e}=this.context;e&&t.forEach(({isIntersecting:t,target:e})=>{this.isOnScroll&&t&&!this.viewed.has(e.id)&&(this.viewed.add(e.id),this.onChildView(this.childData[e.id]))})}onChildView(t){const{tracking:r}=this.context;r.analytics({action:"Scrolled",attrs:{...f(n,t),scrollDepth:{itemNumber:t.index+1,name:t.name,total:t.total}},component:t.eventNavigationName?t.eventNavigationName:(e||o)+"Child"})}updateOnScroll(){this.isOnScroll=!0}receiveChildList(t){this.childList=t}observeChildren(){this.observer&&this.childList&&this.childList.forEach((t,e)=>{this.childData[t.elementId]||this.observeChild({...t,index:e,total:this.childList.length})})}observeChild(t){const e=document.getElementById(t.elementId);e&&(this.observer.observe(e),this.childData[t.elementId]=t)}render(){return i.a.createElement(t,m({},this.props,{receiveChildList:this.receiveChildList}))}}return a.contextTypes=d,a.displayName=`WithTrackScrollDepth(${o})`,a.defaultProps=t.defaultProps,p()(a,t),a};n.d(e,"withTrackingContext",(function(){return y})),n.d(e,"withTrackEvents",(function(){return g})),n.d(e,"withTrackScrollDepth",(function(){return _}))}]);
|