@adobe/alloy 2.6.4-beta.4 → 2.8.0-beta.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/libEs5/components/ActivityCollector/utils.js +1 -1
- package/libEs5/components/Audiences/index.js +6 -8
- package/libEs5/components/Audiences/injectProcessResponse.js +44 -0
- package/libEs5/components/MachineLearning/index.js +30 -0
- package/libEs5/components/MachineLearning/processResponse.js +22 -0
- package/libEs5/components/Personalization/createCollect.js +1 -1
- package/libEs5/components/Personalization/createOnClickHandler.js +1 -1
- package/libEs5/components/Personalization/createViewCollect.js +1 -1
- package/libEs5/components/Personalization/dom-actions/action.js +25 -25
- package/libEs5/components/Personalization/dom-actions/appendHtml.js +1 -1
- package/libEs5/components/Personalization/dom-actions/dom/index.js +26 -26
- package/libEs5/components/Personalization/dom-actions/dom/querySelectorAll.js +22 -0
- package/libEs5/components/Personalization/dom-actions/dom/selectNodesWithEq.js +1 -1
- package/libEs5/components/Personalization/dom-actions/dom/selectNodesWithShadow.js +80 -0
- package/libEs5/components/Personalization/dom-actions/index.js +4 -4
- package/libEs5/components/Personalization/dom-actions/insertHtmlAfter.js +1 -1
- package/libEs5/components/Personalization/dom-actions/insertHtmlBefore.js +1 -1
- package/libEs5/components/Personalization/dom-actions/prependHtml.js +1 -1
- package/libEs5/components/Personalization/dom-actions/scripts.js +6 -5
- package/libEs5/components/Personalization/dom-actions/setStyles.js +3 -1
- package/libEs5/components/Personalization/event.js +2 -2
- package/libEs5/components/Personalization/flicker/index.js +3 -3
- package/libEs5/components/Personalization/groupDecisions.js +1 -1
- package/libEs5/components/Privacy/computeConsentHash.js +1 -1
- package/libEs5/components/Privacy/createConsentHashStore.js +3 -1
- package/libEs5/components/Privacy/parseConsentCookie.js +1 -1
- package/libEs5/constants/cookieNameKey.js +1 -1
- package/libEs5/constants/httpHeaderNames.js +1 -1
- package/libEs5/constants/httpStatusCode.js +1 -1
- package/libEs5/constants/libraryVersion.js +1 -1
- package/libEs5/constants/tagName.js +1 -1
- package/libEs5/core/componentCreators.js +3 -1
- package/libEs5/core/consent/createConsentStateMachine.js +1 -1
- package/libEs5/core/network/injectSendNetworkRequest.js +2 -2
- package/libEs5/utils/convertTimes.js +1 -1
- package/libEs5/utils/dom/awaitSelector.js +1 -1
- package/libEs5/utils/dom/index.js +4 -4
- package/libEs5/utils/dom/selectNodes.js +9 -2
- package/libEs5/utils/fireReferrerHideableImage.js +1 -1
- package/libEs5/utils/index.js +20 -20
- package/libEs5/utils/isObject.js +1 -1
- package/libEs5/utils/validation/index.js +1 -1
- package/libEs6/components/Audiences/index.js +5 -9
- package/libEs6/components/Audiences/injectProcessResponse.js +39 -0
- package/libEs6/components/MachineLearning/index.js +25 -0
- package/libEs6/components/MachineLearning/processResponse.js +17 -0
- package/libEs6/components/Personalization/createCollect.js +1 -1
- package/libEs6/components/Personalization/createOnClickHandler.js +1 -1
- package/libEs6/components/Personalization/createViewCollect.js +1 -1
- package/libEs6/components/Personalization/dom-actions/appendHtml.js +1 -1
- package/libEs6/components/Personalization/dom-actions/dom/querySelectorAll.js +13 -0
- package/libEs6/components/Personalization/dom-actions/dom/selectNodesWithShadow.js +67 -0
- package/libEs6/components/Personalization/dom-actions/insertHtmlAfter.js +1 -1
- package/libEs6/components/Personalization/dom-actions/insertHtmlBefore.js +1 -1
- package/libEs6/components/Personalization/dom-actions/prependHtml.js +1 -1
- package/libEs6/components/Personalization/dom-actions/scripts.js +5 -2
- package/libEs6/constants/libraryVersion.js +1 -1
- package/libEs6/core/componentCreators.js +3 -2
- package/libEs6/utils/dom/selectNodes.js +7 -2
- package/package.json +10 -9
|
@@ -16,7 +16,7 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
|
|
|
16
16
|
|
|
17
17
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
18
18
|
|
|
19
|
-
function _iterableToArrayLimit(arr, i) { var _i = arr
|
|
19
|
+
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
20
20
|
|
|
21
21
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
22
22
|
|
|
@@ -4,7 +4,7 @@ exports.default = void 0;
|
|
|
4
4
|
|
|
5
5
|
var _utils = require("../../utils");
|
|
6
6
|
|
|
7
|
-
function _typeof(obj) { "@babel/helpers - typeof";
|
|
7
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
8
8
|
|
|
9
9
|
// serialize an object with a consistent ordering
|
|
10
10
|
var serialize = function serialize(obj) {
|
|
@@ -4,6 +4,8 @@ exports.default = void 0;
|
|
|
4
4
|
|
|
5
5
|
var _computeConsentHash = require("./computeConsentHash");
|
|
6
6
|
|
|
7
|
+
var _excluded = ["standard", "version"];
|
|
8
|
+
|
|
7
9
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
8
10
|
|
|
9
11
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
@@ -28,7 +30,7 @@ var _default = function _default(_ref2) {
|
|
|
28
30
|
|
|
29
31
|
var standard = consentObject.standard,
|
|
30
32
|
version = consentObject.version,
|
|
31
|
-
rest = _objectWithoutProperties(consentObject,
|
|
33
|
+
rest = _objectWithoutProperties(consentObject, _excluded);
|
|
32
34
|
|
|
33
35
|
if (!currentHashes[key]) {
|
|
34
36
|
currentHashes[key] = (0, _computeConsentHash.default)(rest).toString();
|
|
@@ -10,7 +10,7 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
|
|
|
10
10
|
|
|
11
11
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
12
12
|
|
|
13
|
-
function _iterableToArrayLimit(arr, i) { var _i = arr
|
|
13
|
+
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
14
14
|
|
|
15
15
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
16
16
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
exports.
|
|
3
|
+
exports.TOO_MANY_REQUESTS = exports.SERVICE_UNAVAILABLE = exports.NO_CONTENT = exports.GATEWAY_TIMEOUT = exports.BAD_GATEWAY = void 0;
|
|
4
4
|
|
|
5
5
|
/*
|
|
6
6
|
Copyright 2020 Adobe. All rights reserved.
|
|
@@ -15,5 +15,5 @@ governing permissions and limitations under the License.
|
|
|
15
15
|
*/
|
|
16
16
|
// The __VERSION__ keyword will be replace at alloy build time with the package.json version.
|
|
17
17
|
// see babel-plugin-version
|
|
18
|
-
var _default = "2.
|
|
18
|
+
var _default = "2.8.0-beta.0";
|
|
19
19
|
exports.default = _default;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
exports.
|
|
3
|
+
exports.STYLE = exports.SRC = exports.SCRIPT = exports.IMG = exports.IFRAME = exports.HEAD = exports.DIV = exports.BODY = void 0;
|
|
4
4
|
|
|
5
5
|
/*
|
|
6
6
|
Copyright 2019 Adobe. All rights reserved.
|
|
@@ -20,6 +20,8 @@ var _EventMerge = require("../components/EventMerge");
|
|
|
20
20
|
|
|
21
21
|
var _LibraryInfo = require("../components/LibraryInfo");
|
|
22
22
|
|
|
23
|
+
var _MachineLearning = require("../components/MachineLearning");
|
|
24
|
+
|
|
23
25
|
/*
|
|
24
26
|
Copyright 2019 Adobe. All rights reserved.
|
|
25
27
|
This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
@@ -33,5 +35,5 @@ governing permissions and limitations under the License.
|
|
|
33
35
|
*/
|
|
34
36
|
// TODO: Register the Components here statically for now. They might be registered differently.
|
|
35
37
|
// TODO: Figure out how sub-components will be made available/registered
|
|
36
|
-
var _default = [_DataCollector.default, _ActivityCollector.default, _Identity.default, _Audiences.default, _Personalization.default, _Context.default, _Privacy.default, _EventMerge.default, _LibraryInfo.default];
|
|
38
|
+
var _default = [_DataCollector.default, _ActivityCollector.default, _Identity.default, _Audiences.default, _Personalization.default, _Context.default, _Privacy.default, _EventMerge.default, _LibraryInfo.default, _MachineLearning.default];
|
|
37
39
|
exports.default = _default;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
exports.default = exports.
|
|
3
|
+
exports.default = exports.DECLINED_CONSENT_ERROR_CODE = exports.DECLINED_CONSENT = exports.CONSENT_SOURCE_NEW = exports.CONSENT_SOURCE_INITIAL = exports.CONSENT_SOURCE_DEFAULT = void 0;
|
|
4
4
|
|
|
5
5
|
var _utils = require("../../utils");
|
|
6
6
|
|
|
@@ -4,9 +4,9 @@ exports.default = void 0;
|
|
|
4
4
|
|
|
5
5
|
var _utils = require("../../utils");
|
|
6
6
|
|
|
7
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object);
|
|
7
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
8
8
|
|
|
9
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]
|
|
9
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
10
10
|
|
|
11
11
|
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; }
|
|
12
12
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
exports.default = exports.YEAR = exports.
|
|
3
|
+
exports.default = exports.YEAR = exports.WEEK = exports.SECOND = exports.MONTH = exports.MINUTE = exports.MILLISECOND = exports.HOUR = exports.DAY = void 0;
|
|
4
4
|
|
|
5
5
|
/*
|
|
6
6
|
Copyright 2019 Adobe. All rights reserved.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
exports.default = exports.
|
|
3
|
+
exports.default = exports.canUseRequestAnimationFrame = exports.canUseMutationObserver = exports.awaitUsingTimer = exports.awaitUsingRequestAnimation = exports.awaitUsingMutationObserver = void 0;
|
|
4
4
|
|
|
5
5
|
var _isFunction = require("../isFunction");
|
|
6
6
|
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
Object.defineProperty(exports, "
|
|
3
|
+
Object.defineProperty(exports, "appendNode", {
|
|
4
4
|
enumerable: true,
|
|
5
5
|
get: function get() {
|
|
6
|
-
return
|
|
6
|
+
return _appendNode.default;
|
|
7
7
|
}
|
|
8
8
|
});
|
|
9
|
-
Object.defineProperty(exports, "
|
|
9
|
+
Object.defineProperty(exports, "awaitSelector", {
|
|
10
10
|
enumerable: true,
|
|
11
11
|
get: function get() {
|
|
12
|
-
return
|
|
12
|
+
return _awaitSelector.default;
|
|
13
13
|
}
|
|
14
14
|
});
|
|
15
15
|
Object.defineProperty(exports, "createNode", {
|
|
@@ -2,7 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
exports.default = void 0;
|
|
4
4
|
|
|
5
|
-
var
|
|
5
|
+
var _querySelectorAll = require("../../components/Personalization/dom-actions/dom/querySelectorAll");
|
|
6
|
+
|
|
7
|
+
var _selectNodesWithShadow = require("../../components/Personalization/dom-actions/dom/selectNodesWithShadow");
|
|
6
8
|
|
|
7
9
|
/*
|
|
8
10
|
Copyright 2019 Adobe. All rights reserved.
|
|
@@ -24,7 +26,12 @@ governing permissions and limitations under the License.
|
|
|
24
26
|
*/
|
|
25
27
|
var _default = function _default(selector) {
|
|
26
28
|
var context = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : document;
|
|
27
|
-
|
|
29
|
+
|
|
30
|
+
if (!(0, _selectNodesWithShadow.isShadowSelector)(selector)) {
|
|
31
|
+
return (0, _querySelectorAll.default)(context, selector);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
return (0, _selectNodesWithShadow.default)(context, selector);
|
|
28
35
|
};
|
|
29
36
|
|
|
30
37
|
exports.default = _default;
|
|
@@ -16,7 +16,7 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
|
|
|
16
16
|
|
|
17
17
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
18
18
|
|
|
19
|
-
function _iterableToArrayLimit(arr, i) { var _i = arr
|
|
19
|
+
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
20
20
|
|
|
21
21
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
22
22
|
|
package/libEs5/utils/index.js
CHANGED
|
@@ -36,10 +36,10 @@ Object.defineProperty(exports, "cookieJar", {
|
|
|
36
36
|
return _cookieJar.default;
|
|
37
37
|
}
|
|
38
38
|
});
|
|
39
|
-
Object.defineProperty(exports, "
|
|
39
|
+
Object.defineProperty(exports, "crc32", {
|
|
40
40
|
enumerable: true,
|
|
41
41
|
get: function get() {
|
|
42
|
-
return
|
|
42
|
+
return _crc.default;
|
|
43
43
|
}
|
|
44
44
|
});
|
|
45
45
|
Object.defineProperty(exports, "createCallbackAggregator", {
|
|
@@ -48,28 +48,28 @@ Object.defineProperty(exports, "createCallbackAggregator", {
|
|
|
48
48
|
return _createCallbackAggregator.default;
|
|
49
49
|
}
|
|
50
50
|
});
|
|
51
|
-
Object.defineProperty(exports, "
|
|
51
|
+
Object.defineProperty(exports, "createMerger", {
|
|
52
52
|
enumerable: true,
|
|
53
53
|
get: function get() {
|
|
54
|
-
return
|
|
54
|
+
return _createMerger.default;
|
|
55
55
|
}
|
|
56
56
|
});
|
|
57
|
-
Object.defineProperty(exports, "
|
|
57
|
+
Object.defineProperty(exports, "createTaskQueue", {
|
|
58
58
|
enumerable: true,
|
|
59
59
|
get: function get() {
|
|
60
|
-
return
|
|
60
|
+
return _createTaskQueue.default;
|
|
61
61
|
}
|
|
62
62
|
});
|
|
63
|
-
Object.defineProperty(exports, "
|
|
63
|
+
Object.defineProperty(exports, "deepAssign", {
|
|
64
64
|
enumerable: true,
|
|
65
65
|
get: function get() {
|
|
66
|
-
return
|
|
66
|
+
return _deepAssign.default;
|
|
67
67
|
}
|
|
68
68
|
});
|
|
69
|
-
Object.defineProperty(exports, "
|
|
69
|
+
Object.defineProperty(exports, "defer", {
|
|
70
70
|
enumerable: true,
|
|
71
71
|
get: function get() {
|
|
72
|
-
return
|
|
72
|
+
return _defer.default;
|
|
73
73
|
}
|
|
74
74
|
});
|
|
75
75
|
Object.defineProperty(exports, "endsWith", {
|
|
@@ -180,22 +180,22 @@ Object.defineProperty(exports, "isNamespacedCookieName", {
|
|
|
180
180
|
return _isNamespacedCookieName.default;
|
|
181
181
|
}
|
|
182
182
|
});
|
|
183
|
-
Object.defineProperty(exports, "
|
|
183
|
+
Object.defineProperty(exports, "isNil", {
|
|
184
184
|
enumerable: true,
|
|
185
185
|
get: function get() {
|
|
186
|
-
return
|
|
186
|
+
return _isNil.default;
|
|
187
187
|
}
|
|
188
188
|
});
|
|
189
|
-
Object.defineProperty(exports, "
|
|
189
|
+
Object.defineProperty(exports, "isNonEmptyArray", {
|
|
190
190
|
enumerable: true,
|
|
191
191
|
get: function get() {
|
|
192
|
-
return
|
|
192
|
+
return _isNonEmptyArray.default;
|
|
193
193
|
}
|
|
194
194
|
});
|
|
195
|
-
Object.defineProperty(exports, "
|
|
195
|
+
Object.defineProperty(exports, "isNonEmptyString", {
|
|
196
196
|
enumerable: true,
|
|
197
197
|
get: function get() {
|
|
198
|
-
return
|
|
198
|
+
return _isNonEmptyString.default;
|
|
199
199
|
}
|
|
200
200
|
});
|
|
201
201
|
Object.defineProperty(exports, "isNumber", {
|
|
@@ -282,16 +282,16 @@ Object.defineProperty(exports, "toISOStringLocal", {
|
|
|
282
282
|
return _toISOStringLocal.default;
|
|
283
283
|
}
|
|
284
284
|
});
|
|
285
|
-
Object.defineProperty(exports, "
|
|
285
|
+
Object.defineProperty(exports, "updateErrorMessage", {
|
|
286
286
|
enumerable: true,
|
|
287
287
|
get: function get() {
|
|
288
|
-
return
|
|
288
|
+
return _updateErrorMessage.default;
|
|
289
289
|
}
|
|
290
290
|
});
|
|
291
|
-
Object.defineProperty(exports, "
|
|
291
|
+
Object.defineProperty(exports, "uuid", {
|
|
292
292
|
enumerable: true,
|
|
293
293
|
get: function get() {
|
|
294
|
-
return
|
|
294
|
+
return _uuid.default;
|
|
295
295
|
}
|
|
296
296
|
});
|
|
297
297
|
Object.defineProperty(exports, "validateIdentityMap", {
|
package/libEs5/utils/isObject.js
CHANGED
|
@@ -4,7 +4,7 @@ exports.default = void 0;
|
|
|
4
4
|
|
|
5
5
|
var _isNil = require("./isNil");
|
|
6
6
|
|
|
7
|
-
function _typeof(obj) { "@babel/helpers - typeof";
|
|
7
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* Returns whether the value is an object.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
exports.
|
|
3
|
+
exports.string = exports.objectOf = exports.number = exports.mapOfValues = exports.literal = exports.enumOf = exports.callback = exports.boolean = exports.arrayOf = exports.anything = exports.anyOf = void 0;
|
|
4
4
|
|
|
5
5
|
var _chain = require("./chain");
|
|
6
6
|
|
|
@@ -11,6 +11,7 @@ governing permissions and limitations under the License.
|
|
|
11
11
|
*/
|
|
12
12
|
import { fireReferrerHideableImage } from "../../utils";
|
|
13
13
|
import injectProcessDestinations from "./injectProcessDestinations";
|
|
14
|
+
import injectProcessResponse from "./injectProcessResponse";
|
|
14
15
|
|
|
15
16
|
const createAudiences = ({
|
|
16
17
|
logger
|
|
@@ -19,17 +20,12 @@ const createAudiences = ({
|
|
|
19
20
|
fireReferrerHideableImage,
|
|
20
21
|
logger
|
|
21
22
|
});
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
}) => {
|
|
26
|
-
const destinations = response.getPayloadsByType("activation:push");
|
|
27
|
-
return processDestinations(destinations);
|
|
28
|
-
};
|
|
29
|
-
|
|
23
|
+
const processResponse = injectProcessResponse({
|
|
24
|
+
processDestinations
|
|
25
|
+
});
|
|
30
26
|
return {
|
|
31
27
|
lifecycle: {
|
|
32
|
-
onResponse:
|
|
28
|
+
onResponse: processResponse
|
|
33
29
|
},
|
|
34
30
|
commands: {}
|
|
35
31
|
};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2021 Adobe. All rights reserved.
|
|
3
|
+
This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
you may not use this file except in compliance with the License. You may obtain a copy
|
|
5
|
+
of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
+
|
|
7
|
+
Unless required by applicable law or agreed to in writing, software distributed under
|
|
8
|
+
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
9
|
+
OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
|
+
governing permissions and limitations under the License.
|
|
11
|
+
*/
|
|
12
|
+
export default (({
|
|
13
|
+
processDestinations
|
|
14
|
+
}) => {
|
|
15
|
+
const processPushDestinations = ({
|
|
16
|
+
response
|
|
17
|
+
}) => {
|
|
18
|
+
const destinations = response.getPayloadsByType("activation:push");
|
|
19
|
+
return processDestinations(destinations);
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
const retrievePullDestinations = ({
|
|
23
|
+
response
|
|
24
|
+
}) => {
|
|
25
|
+
return {
|
|
26
|
+
destinations: response.getPayloadsByType("activation:pull")
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
return ({
|
|
31
|
+
response
|
|
32
|
+
}) => {
|
|
33
|
+
return processPushDestinations({
|
|
34
|
+
response
|
|
35
|
+
}).then(() => retrievePullDestinations({
|
|
36
|
+
response
|
|
37
|
+
}));
|
|
38
|
+
};
|
|
39
|
+
});
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2021 Adobe. All rights reserved.
|
|
3
|
+
This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
you may not use this file except in compliance with the License. You may obtain a copy
|
|
5
|
+
of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
+
|
|
7
|
+
Unless required by applicable law or agreed to in writing, software distributed under
|
|
8
|
+
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
9
|
+
OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
|
+
governing permissions and limitations under the License.
|
|
11
|
+
*/
|
|
12
|
+
import processResponse from "./processResponse";
|
|
13
|
+
|
|
14
|
+
const createMachineLearning = () => {
|
|
15
|
+
return {
|
|
16
|
+
lifecycle: {
|
|
17
|
+
onResponse: processResponse
|
|
18
|
+
},
|
|
19
|
+
commands: {}
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
createMachineLearning.namespace = "MachineLearning";
|
|
24
|
+
createMachineLearning.configValidators = {};
|
|
25
|
+
export default createMachineLearning;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2021 Adobe. All rights reserved.
|
|
3
|
+
This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
you may not use this file except in compliance with the License. You may obtain a copy
|
|
5
|
+
of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
+
Unless required by applicable law or agreed to in writing, software distributed under
|
|
7
|
+
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
8
|
+
OF ANY KIND, either express or implied. See the License for the specific language
|
|
9
|
+
governing permissions and limitations under the License.
|
|
10
|
+
*/
|
|
11
|
+
export default (({
|
|
12
|
+
response
|
|
13
|
+
}) => {
|
|
14
|
+
return {
|
|
15
|
+
inferences: response.getPayloadsByType("rtml:inferences")
|
|
16
|
+
};
|
|
17
|
+
});
|
|
@@ -24,6 +24,6 @@ export default ((container, html) => {
|
|
|
24
24
|
elements.forEach(element => {
|
|
25
25
|
appendNode(container, element);
|
|
26
26
|
});
|
|
27
|
-
executeInlineScripts(container, scripts
|
|
27
|
+
executeInlineScripts(container, scripts);
|
|
28
28
|
return executeRemoteScripts(scriptsUrls);
|
|
29
29
|
});
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2021 Adobe. All rights reserved.
|
|
3
|
+
This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
you may not use this file except in compliance with the License. You may obtain a copy
|
|
5
|
+
of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
+
|
|
7
|
+
Unless required by applicable law or agreed to in writing, software distributed under
|
|
8
|
+
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
9
|
+
OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
|
+
governing permissions and limitations under the License.
|
|
11
|
+
*/
|
|
12
|
+
import toArray from "../../../../utils/toArray";
|
|
13
|
+
export default ((context, selector) => toArray(context.querySelectorAll(selector)));
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2021 Adobe. All rights reserved.
|
|
3
|
+
This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
you may not use this file except in compliance with the License. You may obtain a copy
|
|
5
|
+
of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
+
|
|
7
|
+
Unless required by applicable law or agreed to in writing, software distributed under
|
|
8
|
+
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
9
|
+
OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
|
+
governing permissions and limitations under the License.
|
|
11
|
+
*/
|
|
12
|
+
import querySelectorAll from "./querySelectorAll";
|
|
13
|
+
import { startsWith } from "../../../../utils";
|
|
14
|
+
const SHADOW_SEPARATOR = ":shadow";
|
|
15
|
+
|
|
16
|
+
const splitWithShadow = selector => {
|
|
17
|
+
return selector.split(SHADOW_SEPARATOR);
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
const transformPrefix = (parent, selector) => {
|
|
21
|
+
const result = selector.trim();
|
|
22
|
+
const hasChildCombinatorPrefix = startsWith(result, ">");
|
|
23
|
+
|
|
24
|
+
if (!hasChildCombinatorPrefix) {
|
|
25
|
+
return result;
|
|
26
|
+
} // IE doesn't support :scope
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
if (window.document.documentMode) {
|
|
30
|
+
return result.substring(1).trim();
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
const prefix = parent instanceof Element || parent instanceof HTMLDocument ? ":scope" : ":host"; // see https://bugs.webkit.org/show_bug.cgi?id=233380
|
|
34
|
+
|
|
35
|
+
return `${prefix} ${result}`;
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
export const isShadowSelector = str => str.indexOf(SHADOW_SEPARATOR) !== -1;
|
|
39
|
+
export default ((context, selector) => {
|
|
40
|
+
// Shadow DOM should be supported
|
|
41
|
+
if (!window.document.documentElement.attachShadow) {
|
|
42
|
+
return querySelectorAll(context, selector.replace(SHADOW_SEPARATOR, ""));
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
const parts = splitWithShadow(selector);
|
|
46
|
+
|
|
47
|
+
if (parts.length < 2) {
|
|
48
|
+
return querySelectorAll(context, selector);
|
|
49
|
+
} // split the selector into parts separated by :shadow pseudo-selectors
|
|
50
|
+
// find each subselector element based on the previously selected node's shadowRoot
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
let parent = context;
|
|
54
|
+
|
|
55
|
+
for (let i = 0; i < parts.length; i += 1) {
|
|
56
|
+
const part = transformPrefix(parent, parts[i]);
|
|
57
|
+
const partNode = querySelectorAll(parent, part);
|
|
58
|
+
|
|
59
|
+
if (partNode.length === 0 || !partNode[0] || !partNode[0].shadowRoot) {
|
|
60
|
+
return partNode;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
parent = partNode[0].shadowRoot;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
return undefined;
|
|
67
|
+
});
|
|
@@ -23,6 +23,6 @@ export default ((container, html) => {
|
|
|
23
23
|
elements.forEach(element => {
|
|
24
24
|
insertAfter(container, element);
|
|
25
25
|
});
|
|
26
|
-
executeInlineScripts(container, scripts
|
|
26
|
+
executeInlineScripts(container, scripts);
|
|
27
27
|
return executeRemoteScripts(scriptsUrls);
|
|
28
28
|
});
|
|
@@ -23,6 +23,6 @@ export default ((container, html) => {
|
|
|
23
23
|
elements.forEach(element => {
|
|
24
24
|
insertBefore(container, element);
|
|
25
25
|
});
|
|
26
|
-
executeInlineScripts(container, scripts
|
|
26
|
+
executeInlineScripts(container, scripts);
|
|
27
27
|
return executeRemoteScripts(scriptsUrls);
|
|
28
28
|
});
|
|
@@ -84,8 +84,11 @@ export const getRemoteScriptsUrls = fragment => {
|
|
|
84
84
|
|
|
85
85
|
return result;
|
|
86
86
|
};
|
|
87
|
-
export const executeInlineScripts = (
|
|
88
|
-
scripts.forEach(script =>
|
|
87
|
+
export const executeInlineScripts = (parent, scripts) => {
|
|
88
|
+
scripts.forEach(script => {
|
|
89
|
+
parent.appendChild(script);
|
|
90
|
+
parent.removeChild(script);
|
|
91
|
+
});
|
|
89
92
|
};
|
|
90
93
|
export const executeRemoteScripts = urls => {
|
|
91
94
|
return Promise.all(urls.map(loadScript));
|
|
@@ -17,7 +17,8 @@ import createPersonalization from "../components/Personalization";
|
|
|
17
17
|
import createContext from "../components/Context";
|
|
18
18
|
import createPrivacy from "../components/Privacy";
|
|
19
19
|
import createEventMerge from "../components/EventMerge";
|
|
20
|
-
import createLibraryInfo from "../components/LibraryInfo";
|
|
20
|
+
import createLibraryInfo from "../components/LibraryInfo";
|
|
21
|
+
import createMachineLearning from "../components/MachineLearning"; // TODO: Register the Components here statically for now. They might be registered differently.
|
|
21
22
|
// TODO: Figure out how sub-components will be made available/registered
|
|
22
23
|
|
|
23
|
-
export default [createDataCollector, createActivityCollector, createIdentity, createAudiences, createPersonalization, createContext, createPrivacy, createEventMerge, createLibraryInfo];
|
|
24
|
+
export default [createDataCollector, createActivityCollector, createIdentity, createAudiences, createPersonalization, createContext, createPrivacy, createEventMerge, createLibraryInfo, createMachineLearning];
|