@adobe/alloy 2.8.0-beta.0 → 2.8.0-beta.1

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.
@@ -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.8.0-beta.0";
18
+ var _default = "2.8.0-beta.1";
19
19
  exports.default = _default;
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+
3
+ exports.default = void 0;
4
+
5
+ /*
6
+ Copyright 2022 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 = ":shadow";
17
+ exports.default = _default;
@@ -24,6 +24,12 @@ Object.defineProperty(exports, "matchesSelector", {
24
24
  return _matchesSelector.default;
25
25
  }
26
26
  });
27
+ Object.defineProperty(exports, "querySelectorAll", {
28
+ enumerable: true,
29
+ get: function get() {
30
+ return _querySelectorAll.default;
31
+ }
32
+ });
27
33
  Object.defineProperty(exports, "removeNode", {
28
34
  enumerable: true,
29
35
  get: function get() {
@@ -36,6 +42,12 @@ Object.defineProperty(exports, "selectNodes", {
36
42
  return _selectNodes.default;
37
43
  }
38
44
  });
45
+ Object.defineProperty(exports, "selectNodesWithShadow", {
46
+ enumerable: true,
47
+ get: function get() {
48
+ return _selectNodesWithShadow.default;
49
+ }
50
+ });
39
51
 
40
52
  var _awaitSelector = require("./awaitSelector");
41
53
 
@@ -45,6 +57,10 @@ var _createNode = require("./createNode");
45
57
 
46
58
  var _matchesSelector = require("./matchesSelector");
47
59
 
60
+ var _querySelectorAll = require("./querySelectorAll");
61
+
48
62
  var _removeNode = require("./removeNode");
49
63
 
50
- var _selectNodes = require("./selectNodes");
64
+ var _selectNodes = require("./selectNodes");
65
+
66
+ var _selectNodesWithShadow = require("./selectNodesWithShadow");
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+
3
+ exports.default = void 0;
4
+
5
+ var _shadowSeparator = require("../../constants/shadowSeparator");
6
+
7
+ /*
8
+ Copyright 2022 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(str) {
19
+ return str.indexOf(_shadowSeparator.default) !== -1;
20
+ };
21
+
22
+ exports.default = _default;
@@ -2,7 +2,7 @@
2
2
 
3
3
  exports.default = void 0;
4
4
 
5
- var _toArray = require("../../../../utils/toArray");
5
+ var _toArray = require("../toArray");
6
6
 
7
7
  /*
8
8
  Copyright 2021 Adobe. All rights reserved.
@@ -2,9 +2,11 @@
2
2
 
3
3
  exports.default = void 0;
4
4
 
5
- var _querySelectorAll = require("../../components/Personalization/dom-actions/dom/querySelectorAll");
5
+ var _querySelectorAll = require("./querySelectorAll");
6
6
 
7
- var _selectNodesWithShadow = require("../../components/Personalization/dom-actions/dom/selectNodesWithShadow");
7
+ var _selectNodesWithShadow = require("./selectNodesWithShadow");
8
+
9
+ var _isShadowSelector = require("./isShadowSelector");
8
10
 
9
11
  /*
10
12
  Copyright 2019 Adobe. All rights reserved.
@@ -27,7 +29,7 @@ governing permissions and limitations under the License.
27
29
  var _default = function _default(selector) {
28
30
  var context = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : document;
29
31
 
30
- if (!(0, _selectNodesWithShadow.isShadowSelector)(selector)) {
32
+ if (!(0, _isShadowSelector.default)(selector)) {
31
33
  return (0, _querySelectorAll.default)(context, selector);
32
34
  }
33
35
 
@@ -1,10 +1,12 @@
1
1
  "use strict";
2
2
 
3
- exports.isShadowSelector = exports.default = void 0;
3
+ exports.default = void 0;
4
4
 
5
5
  var _querySelectorAll = require("./querySelectorAll");
6
6
 
7
- var _utils = require("../../../../utils");
7
+ var _startsWith = require("../startsWith");
8
+
9
+ var _shadowSeparator = require("../../constants/shadowSeparator");
8
10
 
9
11
  /*
10
12
  Copyright 2021 Adobe. All rights reserved.
@@ -17,15 +19,13 @@ the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTA
17
19
  OF ANY KIND, either express or implied. See the License for the specific language
18
20
  governing permissions and limitations under the License.
19
21
  */
20
- var SHADOW_SEPARATOR = ":shadow";
21
-
22
22
  var splitWithShadow = function splitWithShadow(selector) {
23
- return selector.split(SHADOW_SEPARATOR);
23
+ return selector.split(_shadowSeparator.default);
24
24
  };
25
25
 
26
26
  var transformPrefix = function transformPrefix(parent, selector) {
27
27
  var result = selector.trim();
28
- var hasChildCombinatorPrefix = (0, _utils.startsWith)(result, ">");
28
+ var hasChildCombinatorPrefix = (0, _startsWith.default)(result, ">");
29
29
 
30
30
  if (!hasChildCombinatorPrefix) {
31
31
  return result;
@@ -41,16 +41,10 @@ var transformPrefix = function transformPrefix(parent, selector) {
41
41
  return prefix + " " + result;
42
42
  };
43
43
 
44
- var isShadowSelector = function isShadowSelector(str) {
45
- return str.indexOf(SHADOW_SEPARATOR) !== -1;
46
- };
47
-
48
- exports.isShadowSelector = isShadowSelector;
49
-
50
44
  var _default = function _default(context, selector) {
51
45
  // Shadow DOM should be supported
52
46
  if (!window.document.documentElement.attachShadow) {
53
- return (0, _querySelectorAll.default)(context, selector.replace(SHADOW_SEPARATOR, ""));
47
+ return (0, _querySelectorAll.default)(context, selector.replace(_shadowSeparator.default, ""));
54
48
  }
55
49
 
56
50
  var parts = splitWithShadow(selector);
@@ -11,4 +11,4 @@ governing permissions and limitations under the License.
11
11
  */
12
12
  // The __VERSION__ keyword will be replace at alloy build time with the package.json version.
13
13
  // see babel-plugin-version
14
- export default "2.8.0-beta.0";
14
+ export default "2.8.0-beta.1";
@@ -0,0 +1,12 @@
1
+ /*
2
+ Copyright 2022 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 ":shadow";
@@ -13,5 +13,7 @@ export { default as awaitSelector } from "./awaitSelector";
13
13
  export { default as appendNode } from "./appendNode";
14
14
  export { default as createNode } from "./createNode";
15
15
  export { default as matchesSelector } from "./matchesSelector";
16
+ export { default as querySelectorAll } from "./querySelectorAll";
16
17
  export { default as removeNode } from "./removeNode";
17
- export { default as selectNodes } from "./selectNodes";
18
+ export { default as selectNodes } from "./selectNodes";
19
+ export { default as selectNodesWithShadow } from "./selectNodesWithShadow";
@@ -0,0 +1,13 @@
1
+ /*
2
+ Copyright 2022 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 SHADOW_SEPARATOR from "../../constants/shadowSeparator";
13
+ export default (str => str.indexOf(SHADOW_SEPARATOR) !== -1);
@@ -9,5 +9,5 @@ the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTA
9
9
  OF ANY KIND, either express or implied. See the License for the specific language
10
10
  governing permissions and limitations under the License.
11
11
  */
12
- import toArray from "../../../../utils/toArray";
12
+ import toArray from "../toArray";
13
13
  export default ((context, selector) => toArray(context.querySelectorAll(selector)));
@@ -9,8 +9,9 @@ the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTA
9
9
  OF ANY KIND, either express or implied. See the License for the specific language
10
10
  governing permissions and limitations under the License.
11
11
  */
12
- import querySelectorAll from "../../components/Personalization/dom-actions/dom/querySelectorAll";
13
- import selectNodesWithShadow, { isShadowSelector } from "../../components/Personalization/dom-actions/dom/selectNodesWithShadow";
12
+ import querySelectorAll from "./querySelectorAll";
13
+ import selectNodesWithShadow from "./selectNodesWithShadow";
14
+ import isShadowSelector from "./isShadowSelector";
14
15
  /**
15
16
  * Returns an array of matched DOM nodes.
16
17
  * @param {String} selector
@@ -10,8 +10,8 @@ OF ANY KIND, either express or implied. See the License for the specific languag
10
10
  governing permissions and limitations under the License.
11
11
  */
12
12
  import querySelectorAll from "./querySelectorAll";
13
- import { startsWith } from "../../../../utils";
14
- const SHADOW_SEPARATOR = ":shadow";
13
+ import startsWith from "../startsWith";
14
+ import SHADOW_SEPARATOR from "../../constants/shadowSeparator";
15
15
 
16
16
  const splitWithShadow = selector => {
17
17
  return selector.split(SHADOW_SEPARATOR);
@@ -35,7 +35,6 @@ const transformPrefix = (parent, selector) => {
35
35
  return `${prefix} ${result}`;
36
36
  };
37
37
 
38
- export const isShadowSelector = str => str.indexOf(SHADOW_SEPARATOR) !== -1;
39
38
  export default ((context, selector) => {
40
39
  // Shadow DOM should be supported
41
40
  if (!window.document.documentElement.attachShadow) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adobe/alloy",
3
- "version": "2.8.0-beta.0",
3
+ "version": "2.8.0-beta.1",
4
4
  "description": "Adobe Experience Platform Web SDK",
5
5
  "main": "libEs5/index.js",
6
6
  "module": "libEs6/index.js",
@@ -64,7 +64,7 @@
64
64
  "uuid": "^3.3.2"
65
65
  },
66
66
  "devDependencies": {
67
- "@adobe/alloy": "^2.7.0",
67
+ "@adobe/alloy": "^2.8.0-beta.0",
68
68
  "@babel/cli": "^7.12.8",
69
69
  "@babel/core": "^7.2.2",
70
70
  "@babel/plugin-proposal-object-rest-spread": "^7.3.2",