@adobe/alloy 2.24.0-beta.1 → 2.24.0-beta.2

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.
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+
3
+ exports.addPxIfMissing = void 0;
4
+ /*
5
+ Copyright 2024 Adobe. All rights reserved.
6
+ This file is licensed to you under the Apache License, Version 2.0 (the "License");
7
+ you may not use this file except in compliance with the License. You may obtain a copy
8
+ of the License at http://www.apache.org/licenses/LICENSE-2.0
9
+
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
+
16
+ const addPxIfMissing = value => {
17
+ const hasPx = ("" + value).endsWith("px");
18
+ return hasPx ? value : value + "px";
19
+ };
20
+ exports.addPxIfMissing = addPxIfMissing;
@@ -9,12 +9,14 @@ var _setText = require("./setText.js");
9
9
  var _setAttributes = require("./setAttributes.js");
10
10
  var _swapImage = require("./swapImage.js");
11
11
  var _setStyles = require("./setStyles.js");
12
+ var _move = require("./move.js");
12
13
  var _rearrangeChildren = require("./rearrangeChildren.js");
13
14
  var _insertHtmlAfter = require("./insertHtmlAfter.js");
14
15
  var _insertHtmlBefore = require("./insertHtmlBefore.js");
15
16
  var _replaceHtml = require("./replaceHtml.js");
16
17
  var _appendHtml = require("./appendHtml.js");
17
18
  var _collectInteractions = require("./collectInteractions.js");
19
+ var _resize = require("./resize.js");
18
20
  /*
19
21
  Copyright 2019 Adobe. All rights reserved.
20
22
  This file is licensed to you under the Apache License, Version 2.0 (the "License");
@@ -52,8 +54,8 @@ var _default = () => {
52
54
  [DOM_ACTION_SET_ATTRIBUTE]: (0, _action.createAction)(_setAttributes.default),
53
55
  [DOM_ACTION_SET_IMAGE_SOURCE]: (0, _action.createAction)(_swapImage.default),
54
56
  [DOM_ACTION_SET_STYLE]: (0, _action.createAction)(_setStyles.default),
55
- [DOM_ACTION_MOVE]: (0, _action.createAction)(_setStyles.default),
56
- [DOM_ACTION_RESIZE]: (0, _action.createAction)(_setStyles.default),
57
+ [DOM_ACTION_MOVE]: (0, _action.createAction)(_move.default),
58
+ [DOM_ACTION_RESIZE]: (0, _action.createAction)(_resize.default),
57
59
  [DOM_ACTION_REARRANGE]: (0, _action.createAction)(_rearrangeChildren.default),
58
60
  [DOM_ACTION_REMOVE]: (0, _action.createAction)(_index.removeNode),
59
61
  [DOM_ACTION_INSERT_AFTER]: (0, _action.createAction)(_insertHtmlAfter.default),
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+
3
+ exports.default = void 0;
4
+ var _index = require("./dom/index.js");
5
+ var _util = require("./dom/util.js");
6
+ /*
7
+ Copyright 2024 Adobe. All rights reserved.
8
+ This file is licensed to you under the Apache License, Version 2.0 (the "License");
9
+ you may not use this file except in compliance with the License. You may obtain a copy
10
+ of the License at http://www.apache.org/licenses/LICENSE-2.0
11
+
12
+ Unless required by applicable law or agreed to in writing, software distributed under
13
+ the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
14
+ OF ANY KIND, either express or implied. See the License for the specific language
15
+ governing permissions and limitations under the License.
16
+ */
17
+ var _default = (container, styles, decorateProposition) => {
18
+ const {
19
+ priority,
20
+ ...style
21
+ } = styles;
22
+ Object.keys(style).forEach(key => {
23
+ let value = style[key];
24
+ if (key === "left" || key === "top") {
25
+ value = (0, _util.addPxIfMissing)(value);
26
+ }
27
+ (0, _index.setStyle)(container, key, value, priority);
28
+ });
29
+ decorateProposition(container);
30
+ };
31
+ exports.default = _default;
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+
3
+ exports.default = void 0;
4
+ var _index = require("./dom/index.js");
5
+ var _util = require("./dom/util.js");
6
+ /*
7
+ Copyright 2024 Adobe. All rights reserved.
8
+ This file is licensed to you under the Apache License, Version 2.0 (the "License");
9
+ you may not use this file except in compliance with the License. You may obtain a copy
10
+ of the License at http://www.apache.org/licenses/LICENSE-2.0
11
+
12
+ Unless required by applicable law or agreed to in writing, software distributed under
13
+ the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
14
+ OF ANY KIND, either express or implied. See the License for the specific language
15
+ governing permissions and limitations under the License.
16
+ */
17
+ var _default = (container, styles, decorateProposition) => {
18
+ const {
19
+ priority,
20
+ ...style
21
+ } = styles;
22
+ Object.keys(style).forEach(key => {
23
+ let value = style[key];
24
+ if (key === "width" || key === "height") {
25
+ value = (0, _util.addPxIfMissing)(value);
26
+ }
27
+ (0, _index.setStyle)(container, key, value, priority);
28
+ });
29
+ decorateProposition(container);
30
+ };
31
+ exports.default = _default;
@@ -14,4 +14,4 @@ governing permissions and limitations under the License.
14
14
  */
15
15
  // The __VERSION__ keyword will be replace at alloy build time with the package.json version.
16
16
  // see babel-plugin-version
17
- var _default = exports.default = "2.24.0-beta.1";
17
+ var _default = exports.default = "2.24.0-beta.2";
@@ -0,0 +1,16 @@
1
+ /*
2
+ Copyright 2024 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
+
13
+ export const addPxIfMissing = value => {
14
+ const hasPx = ("" + value).endsWith("px");
15
+ return hasPx ? value : `${value}px`;
16
+ };
@@ -18,12 +18,14 @@ import setText from "./setText.js";
18
18
  import setAttributes from "./setAttributes.js";
19
19
  import swapImage from "./swapImage.js";
20
20
  import setStyles from "./setStyles.js";
21
+ import move from "./move.js";
21
22
  import rearrangeChildren from "./rearrangeChildren.js";
22
23
  import insertHtmlAfter from "./insertHtmlAfter.js";
23
24
  import insertHtmlBefore from "./insertHtmlBefore.js";
24
25
  import replaceHtml from "./replaceHtml.js";
25
26
  import appendHtml from "./appendHtml.js";
26
27
  import collectInteractions from "./collectInteractions.js";
28
+ import resize from "./resize.js";
27
29
  export const DOM_ACTION_SET_HTML = "setHtml";
28
30
  export const DOM_ACTION_CUSTOM_CODE = "customCode";
29
31
  export const DOM_ACTION_SET_TEXT = "setText";
@@ -49,8 +51,8 @@ export default () => {
49
51
  [DOM_ACTION_SET_ATTRIBUTE]: createAction(setAttributes),
50
52
  [DOM_ACTION_SET_IMAGE_SOURCE]: createAction(swapImage),
51
53
  [DOM_ACTION_SET_STYLE]: createAction(setStyles),
52
- [DOM_ACTION_MOVE]: createAction(setStyles),
53
- [DOM_ACTION_RESIZE]: createAction(setStyles),
54
+ [DOM_ACTION_MOVE]: createAction(move),
55
+ [DOM_ACTION_RESIZE]: createAction(resize),
54
56
  [DOM_ACTION_REARRANGE]: createAction(rearrangeChildren),
55
57
  [DOM_ACTION_REMOVE]: createAction(removeNode),
56
58
  [DOM_ACTION_INSERT_AFTER]: createAction(insertHtmlAfter),
@@ -0,0 +1,28 @@
1
+ /*
2
+ Copyright 2024 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
+
13
+ import { setStyle } from "./dom/index.js";
14
+ import { addPxIfMissing } from "./dom/util.js";
15
+ export default (container, styles, decorateProposition) => {
16
+ const {
17
+ priority,
18
+ ...style
19
+ } = styles;
20
+ Object.keys(style).forEach(key => {
21
+ let value = style[key];
22
+ if (key === "left" || key === "top") {
23
+ value = addPxIfMissing(value);
24
+ }
25
+ setStyle(container, key, value, priority);
26
+ });
27
+ decorateProposition(container);
28
+ };
@@ -0,0 +1,28 @@
1
+ /*
2
+ Copyright 2024 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
+
13
+ import { setStyle } from "./dom/index.js";
14
+ import { addPxIfMissing } from "./dom/util.js";
15
+ export default (container, styles, decorateProposition) => {
16
+ const {
17
+ priority,
18
+ ...style
19
+ } = styles;
20
+ Object.keys(style).forEach(key => {
21
+ let value = style[key];
22
+ if (key === "width" || key === "height") {
23
+ value = addPxIfMissing(value);
24
+ }
25
+ setStyle(container, key, value, priority);
26
+ });
27
+ decorateProposition(container);
28
+ };
@@ -13,4 +13,4 @@ governing permissions and limitations under the License.
13
13
  // The __VERSION__ keyword will be replace at alloy build time with the package.json version.
14
14
  // see babel-plugin-version
15
15
 
16
- export default "2.24.0-beta.1";
16
+ export default "2.24.0-beta.2";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adobe/alloy",
3
- "version": "2.24.0-beta.1",
3
+ "version": "2.24.0-beta.2",
4
4
  "description": "Adobe Experience Platform Web SDK",
5
5
  "type": "module",
6
6
  "main": "libEs5/index.js",
@@ -94,7 +94,7 @@
94
94
  "uuid": "^11.0.1"
95
95
  },
96
96
  "devDependencies": {
97
- "@adobe/alloy": "^2.24.0-beta.0",
97
+ "@adobe/alloy": "^2.24.0-beta.1",
98
98
  "@babel/cli": "^7.25.9",
99
99
  "@babel/plugin-transform-runtime": "^7.25.9",
100
100
  "@eslint/js": "^9.13.0",