@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
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
exports.
|
|
3
|
+
exports.urlStartsWithScheme = exports.isSupportedAnchorElement = exports.isExitLink = exports.isDownloadLink = exports.getAbsoluteUrlFromAnchorElement = void 0;
|
|
4
4
|
|
|
5
5
|
/*
|
|
6
6
|
Copyright 2019 Adobe. All rights reserved.
|
|
@@ -6,6 +6,8 @@ var _utils = require("../../utils");
|
|
|
6
6
|
|
|
7
7
|
var _injectProcessDestinations = require("./injectProcessDestinations");
|
|
8
8
|
|
|
9
|
+
var _injectProcessResponse = require("./injectProcessResponse");
|
|
10
|
+
|
|
9
11
|
/*
|
|
10
12
|
Copyright 2019 Adobe. All rights reserved.
|
|
11
13
|
This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
@@ -23,16 +25,12 @@ var createAudiences = function createAudiences(_ref) {
|
|
|
23
25
|
fireReferrerHideableImage: _utils.fireReferrerHideableImage,
|
|
24
26
|
logger: logger
|
|
25
27
|
});
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
var destinations = response.getPayloadsByType("activation:push");
|
|
30
|
-
return processDestinations(destinations);
|
|
31
|
-
};
|
|
32
|
-
|
|
28
|
+
var processResponse = (0, _injectProcessResponse.default)({
|
|
29
|
+
processDestinations: processDestinations
|
|
30
|
+
});
|
|
33
31
|
return {
|
|
34
32
|
lifecycle: {
|
|
35
|
-
onResponse:
|
|
33
|
+
onResponse: processResponse
|
|
36
34
|
},
|
|
37
35
|
commands: {}
|
|
38
36
|
};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
exports.default = void 0;
|
|
4
|
+
|
|
5
|
+
/*
|
|
6
|
+
Copyright 2021 Adobe. All rights reserved.
|
|
7
|
+
This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
8
|
+
you may not use this file except in compliance with the License. You may obtain a copy
|
|
9
|
+
of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
|
|
11
|
+
Unless required by applicable law or agreed to in writing, software distributed under
|
|
12
|
+
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
13
|
+
OF ANY KIND, either express or implied. See the License for the specific language
|
|
14
|
+
governing permissions and limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
var _default = function _default(_ref) {
|
|
17
|
+
var processDestinations = _ref.processDestinations;
|
|
18
|
+
|
|
19
|
+
var processPushDestinations = function processPushDestinations(_ref2) {
|
|
20
|
+
var response = _ref2.response;
|
|
21
|
+
var destinations = response.getPayloadsByType("activation:push");
|
|
22
|
+
return processDestinations(destinations);
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
var retrievePullDestinations = function retrievePullDestinations(_ref3) {
|
|
26
|
+
var response = _ref3.response;
|
|
27
|
+
return {
|
|
28
|
+
destinations: response.getPayloadsByType("activation:pull")
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
return function (_ref4) {
|
|
33
|
+
var response = _ref4.response;
|
|
34
|
+
return processPushDestinations({
|
|
35
|
+
response: response
|
|
36
|
+
}).then(function () {
|
|
37
|
+
return retrievePullDestinations({
|
|
38
|
+
response: response
|
|
39
|
+
});
|
|
40
|
+
});
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
exports.default = _default;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
exports.default = void 0;
|
|
4
|
+
|
|
5
|
+
var _processResponse = require("./processResponse");
|
|
6
|
+
|
|
7
|
+
/*
|
|
8
|
+
Copyright 2021 Adobe. All rights reserved.
|
|
9
|
+
This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
10
|
+
you may not use this file except in compliance with the License. You may obtain a copy
|
|
11
|
+
of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
12
|
+
|
|
13
|
+
Unless required by applicable law or agreed to in writing, software distributed under
|
|
14
|
+
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
15
|
+
OF ANY KIND, either express or implied. See the License for the specific language
|
|
16
|
+
governing permissions and limitations under the License.
|
|
17
|
+
*/
|
|
18
|
+
var createMachineLearning = function createMachineLearning() {
|
|
19
|
+
return {
|
|
20
|
+
lifecycle: {
|
|
21
|
+
onResponse: _processResponse.default
|
|
22
|
+
},
|
|
23
|
+
commands: {}
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
createMachineLearning.namespace = "MachineLearning";
|
|
28
|
+
createMachineLearning.configValidators = {};
|
|
29
|
+
var _default = createMachineLearning;
|
|
30
|
+
exports.default = _default;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
exports.default = void 0;
|
|
4
|
+
|
|
5
|
+
/*
|
|
6
|
+
Copyright 2021 Adobe. All rights reserved.
|
|
7
|
+
This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
8
|
+
you may not use this file except in compliance with the License. You may obtain a copy
|
|
9
|
+
of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
Unless required by applicable law or agreed to in writing, software distributed under
|
|
11
|
+
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
12
|
+
OF ANY KIND, either express or implied. See the License for the specific language
|
|
13
|
+
governing permissions and limitations under the License.
|
|
14
|
+
*/
|
|
15
|
+
var _default = function _default(_ref) {
|
|
16
|
+
var response = _ref.response;
|
|
17
|
+
return {
|
|
18
|
+
inferences: response.getPayloadsByType("rtml:inferences")
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
exports.default = _default;
|
|
@@ -23,7 +23,7 @@ var _default = function _default(_ref) {
|
|
|
23
23
|
documentMayUnload = _ref2$documentMayUnlo === void 0 ? false : _ref2$documentMayUnlo;
|
|
24
24
|
var event = eventManager.createEvent();
|
|
25
25
|
event.mergeXdm({
|
|
26
|
-
eventType: "
|
|
26
|
+
eventType: "decisioning.propositionDisplay"
|
|
27
27
|
});
|
|
28
28
|
mergeDecisionsMeta(event, decisionsMeta);
|
|
29
29
|
|
|
@@ -1,78 +1,78 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
Object.defineProperty(exports, "
|
|
3
|
+
Object.defineProperty(exports, "appendHtml", {
|
|
4
4
|
enumerable: true,
|
|
5
5
|
get: function get() {
|
|
6
|
-
return
|
|
6
|
+
return _appendHtml.default;
|
|
7
7
|
}
|
|
8
8
|
});
|
|
9
|
-
Object.defineProperty(exports, "
|
|
9
|
+
Object.defineProperty(exports, "click", {
|
|
10
10
|
enumerable: true,
|
|
11
11
|
get: function get() {
|
|
12
|
-
return
|
|
12
|
+
return _click.default;
|
|
13
13
|
}
|
|
14
14
|
});
|
|
15
|
-
|
|
15
|
+
exports.createAction = void 0;
|
|
16
|
+
Object.defineProperty(exports, "insertHtmlAfter", {
|
|
16
17
|
enumerable: true,
|
|
17
18
|
get: function get() {
|
|
18
|
-
return
|
|
19
|
+
return _insertHtmlAfter.default;
|
|
19
20
|
}
|
|
20
21
|
});
|
|
21
|
-
Object.defineProperty(exports, "
|
|
22
|
+
Object.defineProperty(exports, "insertHtmlBefore", {
|
|
22
23
|
enumerable: true,
|
|
23
24
|
get: function get() {
|
|
24
|
-
return
|
|
25
|
+
return _insertHtmlBefore.default;
|
|
25
26
|
}
|
|
26
27
|
});
|
|
27
|
-
Object.defineProperty(exports, "
|
|
28
|
+
Object.defineProperty(exports, "prependHtml", {
|
|
28
29
|
enumerable: true,
|
|
29
30
|
get: function get() {
|
|
30
|
-
return
|
|
31
|
+
return _prependHtml.default;
|
|
31
32
|
}
|
|
32
33
|
});
|
|
33
|
-
Object.defineProperty(exports, "
|
|
34
|
+
Object.defineProperty(exports, "rearrangeChildren", {
|
|
34
35
|
enumerable: true,
|
|
35
36
|
get: function get() {
|
|
36
|
-
return
|
|
37
|
+
return _rearrangeChildren.default;
|
|
37
38
|
}
|
|
38
39
|
});
|
|
39
|
-
Object.defineProperty(exports, "
|
|
40
|
+
Object.defineProperty(exports, "replaceHtml", {
|
|
40
41
|
enumerable: true,
|
|
41
42
|
get: function get() {
|
|
42
|
-
return
|
|
43
|
+
return _replaceHtml.default;
|
|
43
44
|
}
|
|
44
45
|
});
|
|
45
|
-
Object.defineProperty(exports, "
|
|
46
|
+
Object.defineProperty(exports, "setAttributes", {
|
|
46
47
|
enumerable: true,
|
|
47
48
|
get: function get() {
|
|
48
|
-
return
|
|
49
|
+
return _setAttributes.default;
|
|
49
50
|
}
|
|
50
51
|
});
|
|
51
|
-
Object.defineProperty(exports, "
|
|
52
|
+
Object.defineProperty(exports, "setHtml", {
|
|
52
53
|
enumerable: true,
|
|
53
54
|
get: function get() {
|
|
54
|
-
return
|
|
55
|
+
return _setHtml.default;
|
|
55
56
|
}
|
|
56
57
|
});
|
|
57
|
-
Object.defineProperty(exports, "
|
|
58
|
+
Object.defineProperty(exports, "setStyles", {
|
|
58
59
|
enumerable: true,
|
|
59
60
|
get: function get() {
|
|
60
|
-
return
|
|
61
|
+
return _setStyles.default;
|
|
61
62
|
}
|
|
62
63
|
});
|
|
63
|
-
Object.defineProperty(exports, "
|
|
64
|
+
Object.defineProperty(exports, "setText", {
|
|
64
65
|
enumerable: true,
|
|
65
66
|
get: function get() {
|
|
66
|
-
return
|
|
67
|
+
return _setText.default;
|
|
67
68
|
}
|
|
68
69
|
});
|
|
69
|
-
Object.defineProperty(exports, "
|
|
70
|
+
Object.defineProperty(exports, "swapImage", {
|
|
70
71
|
enumerable: true,
|
|
71
72
|
get: function get() {
|
|
72
|
-
return
|
|
73
|
+
return _swapImage.default;
|
|
73
74
|
}
|
|
74
75
|
});
|
|
75
|
-
exports.createAction = void 0;
|
|
76
76
|
|
|
77
77
|
var _dom = require("../../../utils/dom");
|
|
78
78
|
|
|
@@ -33,7 +33,7 @@ var _default = function _default(container, html) {
|
|
|
33
33
|
elements.forEach(function (element) {
|
|
34
34
|
(0, _dom.appendNode)(container, element);
|
|
35
35
|
});
|
|
36
|
-
(0, _scripts.executeInlineScripts)(container, scripts
|
|
36
|
+
(0, _scripts.executeInlineScripts)(container, scripts);
|
|
37
37
|
return (0, _scripts.executeRemoteScripts)(scriptsUrls);
|
|
38
38
|
};
|
|
39
39
|
|
|
@@ -6,82 +6,82 @@ Object.defineProperty(exports, "createFragment", {
|
|
|
6
6
|
return _createFragment.default;
|
|
7
7
|
}
|
|
8
8
|
});
|
|
9
|
-
Object.defineProperty(exports, "
|
|
9
|
+
Object.defineProperty(exports, "getAttribute", {
|
|
10
10
|
enumerable: true,
|
|
11
11
|
get: function get() {
|
|
12
|
-
return
|
|
12
|
+
return _getAttribute.default;
|
|
13
13
|
}
|
|
14
14
|
});
|
|
15
|
-
Object.defineProperty(exports, "
|
|
15
|
+
Object.defineProperty(exports, "getChildNodes", {
|
|
16
16
|
enumerable: true,
|
|
17
17
|
get: function get() {
|
|
18
|
-
return
|
|
18
|
+
return _getChildNodes.default;
|
|
19
19
|
}
|
|
20
20
|
});
|
|
21
|
-
Object.defineProperty(exports, "
|
|
21
|
+
Object.defineProperty(exports, "getChildren", {
|
|
22
22
|
enumerable: true,
|
|
23
23
|
get: function get() {
|
|
24
|
-
return
|
|
24
|
+
return _getChildren.default;
|
|
25
25
|
}
|
|
26
26
|
});
|
|
27
|
-
Object.defineProperty(exports, "
|
|
27
|
+
Object.defineProperty(exports, "getElementById", {
|
|
28
28
|
enumerable: true,
|
|
29
29
|
get: function get() {
|
|
30
|
-
return
|
|
30
|
+
return _getElementById.default;
|
|
31
31
|
}
|
|
32
32
|
});
|
|
33
|
-
Object.defineProperty(exports, "
|
|
33
|
+
Object.defineProperty(exports, "getFirstChild", {
|
|
34
34
|
enumerable: true,
|
|
35
35
|
get: function get() {
|
|
36
|
-
return
|
|
36
|
+
return _getFirstChild.default;
|
|
37
37
|
}
|
|
38
38
|
});
|
|
39
|
-
Object.defineProperty(exports, "
|
|
39
|
+
Object.defineProperty(exports, "getNextSibling", {
|
|
40
40
|
enumerable: true,
|
|
41
41
|
get: function get() {
|
|
42
|
-
return
|
|
42
|
+
return _getNextSibling.default;
|
|
43
43
|
}
|
|
44
44
|
});
|
|
45
|
-
Object.defineProperty(exports, "
|
|
45
|
+
Object.defineProperty(exports, "getNonce", {
|
|
46
46
|
enumerable: true,
|
|
47
47
|
get: function get() {
|
|
48
|
-
return
|
|
48
|
+
return _getNonce.default;
|
|
49
49
|
}
|
|
50
50
|
});
|
|
51
|
-
Object.defineProperty(exports, "
|
|
51
|
+
Object.defineProperty(exports, "insertAfter", {
|
|
52
52
|
enumerable: true,
|
|
53
53
|
get: function get() {
|
|
54
|
-
return
|
|
54
|
+
return _insertAfter.default;
|
|
55
55
|
}
|
|
56
56
|
});
|
|
57
|
-
Object.defineProperty(exports, "
|
|
57
|
+
Object.defineProperty(exports, "insertBefore", {
|
|
58
58
|
enumerable: true,
|
|
59
59
|
get: function get() {
|
|
60
|
-
return
|
|
60
|
+
return _insertBefore.default;
|
|
61
61
|
}
|
|
62
62
|
});
|
|
63
|
-
Object.defineProperty(exports, "
|
|
63
|
+
Object.defineProperty(exports, "removeAttribute", {
|
|
64
64
|
enumerable: true,
|
|
65
65
|
get: function get() {
|
|
66
|
-
return
|
|
66
|
+
return _removeAttribute.default;
|
|
67
67
|
}
|
|
68
68
|
});
|
|
69
|
-
Object.defineProperty(exports, "
|
|
69
|
+
Object.defineProperty(exports, "selectNodesWithEq", {
|
|
70
70
|
enumerable: true,
|
|
71
71
|
get: function get() {
|
|
72
|
-
return
|
|
72
|
+
return _selectNodesWithEq.selectNodesWithEq;
|
|
73
73
|
}
|
|
74
74
|
});
|
|
75
|
-
Object.defineProperty(exports, "
|
|
75
|
+
Object.defineProperty(exports, "setAttribute", {
|
|
76
76
|
enumerable: true,
|
|
77
77
|
get: function get() {
|
|
78
|
-
return
|
|
78
|
+
return _setAttribute.default;
|
|
79
79
|
}
|
|
80
80
|
});
|
|
81
|
-
Object.defineProperty(exports, "
|
|
81
|
+
Object.defineProperty(exports, "setStyle", {
|
|
82
82
|
enumerable: true,
|
|
83
83
|
get: function get() {
|
|
84
|
-
return
|
|
84
|
+
return _setStyle.default;
|
|
85
85
|
}
|
|
86
86
|
});
|
|
87
87
|
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
exports.default = void 0;
|
|
4
|
+
|
|
5
|
+
var _toArray = require("../../../../utils/toArray");
|
|
6
|
+
|
|
7
|
+
/*
|
|
8
|
+
Copyright 2021 Adobe. All rights reserved.
|
|
9
|
+
This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
10
|
+
you may not use this file except in compliance with the License. You may obtain a copy
|
|
11
|
+
of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
12
|
+
|
|
13
|
+
Unless required by applicable law or agreed to in writing, software distributed under
|
|
14
|
+
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
15
|
+
OF ANY KIND, either express or implied. See the License for the specific language
|
|
16
|
+
governing permissions and limitations under the License.
|
|
17
|
+
*/
|
|
18
|
+
var _default = function _default(context, selector) {
|
|
19
|
+
return (0, _toArray.default)(context.querySelectorAll(selector));
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
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
|
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
exports.isShadowSelector = exports.default = void 0;
|
|
4
|
+
|
|
5
|
+
var _querySelectorAll = require("./querySelectorAll");
|
|
6
|
+
|
|
7
|
+
var _utils = require("../../../../utils");
|
|
8
|
+
|
|
9
|
+
/*
|
|
10
|
+
Copyright 2021 Adobe. All rights reserved.
|
|
11
|
+
This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
12
|
+
you may not use this file except in compliance with the License. You may obtain a copy
|
|
13
|
+
of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
14
|
+
|
|
15
|
+
Unless required by applicable law or agreed to in writing, software distributed under
|
|
16
|
+
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
17
|
+
OF ANY KIND, either express or implied. See the License for the specific language
|
|
18
|
+
governing permissions and limitations under the License.
|
|
19
|
+
*/
|
|
20
|
+
var SHADOW_SEPARATOR = ":shadow";
|
|
21
|
+
|
|
22
|
+
var splitWithShadow = function splitWithShadow(selector) {
|
|
23
|
+
return selector.split(SHADOW_SEPARATOR);
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
var transformPrefix = function transformPrefix(parent, selector) {
|
|
27
|
+
var result = selector.trim();
|
|
28
|
+
var hasChildCombinatorPrefix = (0, _utils.startsWith)(result, ">");
|
|
29
|
+
|
|
30
|
+
if (!hasChildCombinatorPrefix) {
|
|
31
|
+
return result;
|
|
32
|
+
} // IE doesn't support :scope
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
if (window.document.documentMode) {
|
|
36
|
+
return result.substring(1).trim();
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
var prefix = parent instanceof Element || parent instanceof HTMLDocument ? ":scope" : ":host"; // see https://bugs.webkit.org/show_bug.cgi?id=233380
|
|
40
|
+
|
|
41
|
+
return prefix + " " + result;
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
var isShadowSelector = function isShadowSelector(str) {
|
|
45
|
+
return str.indexOf(SHADOW_SEPARATOR) !== -1;
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
exports.isShadowSelector = isShadowSelector;
|
|
49
|
+
|
|
50
|
+
var _default = function _default(context, selector) {
|
|
51
|
+
// Shadow DOM should be supported
|
|
52
|
+
if (!window.document.documentElement.attachShadow) {
|
|
53
|
+
return (0, _querySelectorAll.default)(context, selector.replace(SHADOW_SEPARATOR, ""));
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
var parts = splitWithShadow(selector);
|
|
57
|
+
|
|
58
|
+
if (parts.length < 2) {
|
|
59
|
+
return (0, _querySelectorAll.default)(context, selector);
|
|
60
|
+
} // split the selector into parts separated by :shadow pseudo-selectors
|
|
61
|
+
// find each subselector element based on the previously selected node's shadowRoot
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
var parent = context;
|
|
65
|
+
|
|
66
|
+
for (var i = 0; i < parts.length; i += 1) {
|
|
67
|
+
var part = transformPrefix(parent, parts[i]);
|
|
68
|
+
var partNode = (0, _querySelectorAll.default)(parent, part);
|
|
69
|
+
|
|
70
|
+
if (partNode.length === 0 || !partNode[0] || !partNode[0].shadowRoot) {
|
|
71
|
+
return partNode;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
parent = partNode[0].shadowRoot;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
return undefined;
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
exports.default = _default;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
Object.defineProperty(exports, "
|
|
3
|
+
Object.defineProperty(exports, "executeActions", {
|
|
4
4
|
enumerable: true,
|
|
5
5
|
get: function get() {
|
|
6
|
-
return
|
|
6
|
+
return _executeActions.default;
|
|
7
7
|
}
|
|
8
8
|
});
|
|
9
|
-
Object.defineProperty(exports, "
|
|
9
|
+
Object.defineProperty(exports, "initDomActionsModules", {
|
|
10
10
|
enumerable: true,
|
|
11
11
|
get: function get() {
|
|
12
|
-
return
|
|
12
|
+
return _initDomActionsModules.default;
|
|
13
13
|
}
|
|
14
14
|
});
|
|
15
15
|
|
|
@@ -31,7 +31,7 @@ var _default = function _default(container, html) {
|
|
|
31
31
|
elements.forEach(function (element) {
|
|
32
32
|
(0, _dom.insertAfter)(container, element);
|
|
33
33
|
});
|
|
34
|
-
(0, _scripts.executeInlineScripts)(container, scripts
|
|
34
|
+
(0, _scripts.executeInlineScripts)(container, scripts);
|
|
35
35
|
return (0, _scripts.executeRemoteScripts)(scriptsUrls);
|
|
36
36
|
};
|
|
37
37
|
|
|
@@ -31,7 +31,7 @@ var _default = function _default(container, html) {
|
|
|
31
31
|
elements.forEach(function (element) {
|
|
32
32
|
(0, _dom.insertBefore)(container, element);
|
|
33
33
|
});
|
|
34
|
-
(0, _scripts.executeInlineScripts)(container, scripts
|
|
34
|
+
(0, _scripts.executeInlineScripts)(container, scripts);
|
|
35
35
|
return (0, _scripts.executeRemoteScripts)(scriptsUrls);
|
|
36
36
|
};
|
|
37
37
|
|
|
@@ -47,7 +47,7 @@ var _default = function _default(container, html) {
|
|
|
47
47
|
i -= 1;
|
|
48
48
|
}
|
|
49
49
|
|
|
50
|
-
(0, _scripts.executeInlineScripts)(container, scripts
|
|
50
|
+
(0, _scripts.executeInlineScripts)(container, scripts);
|
|
51
51
|
return (0, _scripts.executeRemoteScripts)(scriptsUrls);
|
|
52
52
|
};
|
|
53
53
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
exports.
|
|
3
|
+
exports.is = exports.getRemoteScriptsUrls = exports.getInlineScripts = exports.executeRemoteScripts = exports.executeInlineScripts = void 0;
|
|
4
4
|
|
|
5
5
|
var _reactorLoadScript = require("@adobe/reactor-load-script");
|
|
6
6
|
|
|
@@ -10,9 +10,9 @@ var _tagName = require("../../../constants/tagName");
|
|
|
10
10
|
|
|
11
11
|
var _dom2 = require("./dom");
|
|
12
12
|
|
|
13
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object);
|
|
13
|
+
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; }
|
|
14
14
|
|
|
15
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]
|
|
15
|
+
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; }
|
|
16
16
|
|
|
17
17
|
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; }
|
|
18
18
|
|
|
@@ -96,9 +96,10 @@ var getRemoteScriptsUrls = function getRemoteScriptsUrls(fragment) {
|
|
|
96
96
|
|
|
97
97
|
exports.getRemoteScriptsUrls = getRemoteScriptsUrls;
|
|
98
98
|
|
|
99
|
-
var executeInlineScripts = function executeInlineScripts(
|
|
99
|
+
var executeInlineScripts = function executeInlineScripts(parent, scripts) {
|
|
100
100
|
scripts.forEach(function (script) {
|
|
101
|
-
|
|
101
|
+
parent.appendChild(script);
|
|
102
|
+
parent.removeChild(script);
|
|
102
103
|
});
|
|
103
104
|
};
|
|
104
105
|
|
|
@@ -4,13 +4,15 @@ exports.default = void 0;
|
|
|
4
4
|
|
|
5
5
|
var _dom = require("./dom");
|
|
6
6
|
|
|
7
|
+
var _excluded = ["priority"];
|
|
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; }
|
|
10
12
|
|
|
11
13
|
var _default = function _default(container, styles) {
|
|
12
14
|
var priority = styles.priority,
|
|
13
|
-
style = _objectWithoutProperties(styles,
|
|
15
|
+
style = _objectWithoutProperties(styles, _excluded);
|
|
14
16
|
|
|
15
17
|
Object.keys(style).forEach(function (key) {
|
|
16
18
|
(0, _dom.setStyle)(container, key, style[key], priority);
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
exports.mergeQuery = exports.mergeDecisionsMeta = void 0;
|
|
4
4
|
|
|
5
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object);
|
|
5
|
+
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; }
|
|
6
6
|
|
|
7
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]
|
|
7
|
+
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; }
|
|
8
8
|
|
|
9
9
|
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; }
|
|
10
10
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
exports.
|
|
3
|
+
exports.showElements = exports.showContainers = exports.hideElements = exports.hideContainers = void 0;
|
|
4
4
|
|
|
5
5
|
var _dom = require("../../../utils/dom");
|
|
6
6
|
|
|
@@ -8,9 +8,9 @@ var _tagName = require("../../../constants/tagName");
|
|
|
8
8
|
|
|
9
9
|
var _dom2 = require("../dom-actions/dom");
|
|
10
10
|
|
|
11
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object);
|
|
11
|
+
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; }
|
|
12
12
|
|
|
13
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]
|
|
13
|
+
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; }
|
|
14
14
|
|
|
15
15
|
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; }
|
|
16
16
|
|