pds-dev-kit-web-test 2.4.20 → 2.4.22

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.
@@ -157,7 +157,7 @@ exports.sampleCustomsection1 = {
157
157
  CB_CONTENT_PROP_HOVER_SPEC_MUSE: true
158
158
  },
159
159
  CB_CONTENT_PROP_TEXT: {
160
- CB_CONTENT_PROP_TEXT_SPEC_TEXT: '{"scrollId": "airpods", "totalImages": 64, "baseURL": "https://www.apple.com/105/media/us/airpods-pro/2022/d2deeb8e-83eb-48ea-9721-f567cf0fffa8/anim/hero/medium", "type": "png", "startShowingImages": 0,"endShowingImages": 1000}'
160
+ CB_CONTENT_PROP_TEXT_SPEC_TEXT: '{"scrollId": "airpods", "totalImages": 64, "baseURL": "https://www.apple.com/105/media/us/airpods-pro/2022/d2deeb8e-83eb-48ea-9721-f567cf0fffa8/anim/hero/medium", "type": "png", "startShowingImages": 0,"endShowingImages": 1000, "bodySelector": ".sc-bdfBQB"}'
161
161
  },
162
162
  CB_CONTENT_PROP_VISIBILITY: {
163
163
  CB_CONTENT_PROP_VISIBILITY_SPEC_DESKTOP: true,
@@ -427,7 +427,7 @@ var CustomSection = (0, react_1.forwardRef)(function CustomSection(props, ref) {
427
427
  maxWidth: customSectionStyles.maxWidth,
428
428
  minWidth: isMobile ? GLE_MIN_WIDTH_MOBILE_PX : GLE_MIN_WIDTH_DESKTOP_PX,
429
429
  fontSize: "".concat(baseFontSize, "px")
430
- }, onLayoutChange: onLayoutChange, onDragStop: onDragStop, onResizeStop: onResizeStop, onWidthChange: onWidthChange, minNbRow: rows, isDraggable: isEditMode, isResizable: isEditMode }, { children: keepSimilarOrderToPreventRerender(layouts[layoutByDevice]).map(function (each, index) {
430
+ }, onLayoutChange: onLayoutChange, onDragStop: onDragStop, onResizeStop: onResizeStop, onWidthChange: onWidthChange, minNbRow: rows, isDraggable: isEditMode, isResizable: isEditMode, useCSSTransforms: mode === 'EDIT' ? true : false }, { children: keepSimilarOrderToPreventRerender(layouts[layoutByDevice]).map(function (each, index) {
431
431
  var _a;
432
432
  if (each === null) {
433
433
  return (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, {});
@@ -73,7 +73,7 @@ function TextPropToAnim(props) {
73
73
  var json = JSON.parse(props.CB_CONTENT_PROP_TEXT.CB_CONTENT_PROP_TEXT_SPEC_TEXT);
74
74
  var hasAllProp = validateAnimationProps(json);
75
75
  if (!hasAllProp) {
76
- return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: "MUST HAVE ALL PROPS: scrollId, totalImages, baseURL, type, startShowingImages, endShowingImages," }));
76
+ return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: "MUST HAVE ALL PROPS: scrollId, totalImages, baseURL, type, startShowingImages, endShowingImages, bodySelector" }));
77
77
  }
78
78
  return (0, jsx_runtime_1.jsx)(ScrollAnimation_1.default, __assign({}, json));
79
79
  }
@@ -84,7 +84,8 @@ var validateAnimationProps = function (json) {
84
84
  'baseURL',
85
85
  'type',
86
86
  'startShowingImages',
87
- 'endShowingImages'
87
+ 'endShowingImages',
88
+ 'bodySelector'
88
89
  ];
89
90
  return requiredProps.every(function (prop) { return prop in json; });
90
91
  };
@@ -1,3 +1,3 @@
1
1
  /// <reference types="react" />
2
- declare const AirpodsAnimation: ({ scrollId, totalImages, baseURL, type, startShowingImages, endShowingImages }: any) => JSX.Element;
2
+ declare const AirpodsAnimation: ({ bodySelector, scrollId, totalImages, baseURL, type, startShowingImages, endShowingImages }: any) => JSX.Element;
3
3
  export default AirpodsAnimation;
@@ -52,15 +52,19 @@ var jsx_runtime_1 = require("react/jsx-runtime");
52
52
  /* eslint-disable no-plusplus */
53
53
  var react_1 = require("react");
54
54
  var AirpodsAnimation = function (_a) {
55
- var scrollId = _a.scrollId, totalImages = _a.totalImages, baseURL = _a.baseURL, type = _a.type, startShowingImages = _a.startShowingImages, endShowingImages = _a.endShowingImages;
55
+ var bodySelector = _a.bodySelector, scrollId = _a.scrollId, totalImages = _a.totalImages, baseURL = _a.baseURL, type = _a.type, startShowingImages = _a.startShowingImages, endShowingImages = _a.endShowingImages;
56
56
  var canvasRef = (0, react_1.useRef)(null);
57
57
  var _b = (0, react_1.useState)([]), images = _b[0], setImages = _b[1];
58
58
  var _c = (0, react_1.useState)(0), loadedImages = _c[0], setLoadedImages = _c[1];
59
59
  var _d = (0, react_1.useState)(0), currentFrameIndex = _d[0], setCurrentFrameIndex = _d[1];
60
- var mainBody = (0, react_1.useState)(function () {
61
- var box = document.querySelector('.sc-bdfBQB');
60
+ var _e = (0, react_1.useState)(function () {
61
+ var box = document.querySelector(bodySelector);
62
62
  return box;
63
- })[0];
63
+ }), mainBody = _e[0], setMainBody = _e[1];
64
+ (0, react_1.useEffect)(function () {
65
+ var box = document.querySelector(bodySelector);
66
+ setMainBody(box);
67
+ }, [bodySelector]);
64
68
  (0, react_1.useEffect)(function () {
65
69
  var loadImage = function (i) {
66
70
  return new Promise(function (resolve) {
@@ -127,7 +131,7 @@ var AirpodsAnimation = function (_a) {
127
131
  return function () {
128
132
  mainBody.removeEventListener('scroll', handleScroll);
129
133
  };
130
- }, [totalImages, images, startShowingImages, endShowingImages]);
134
+ }, [totalImages, images, startShowingImages, endShowingImages, mainBody]);
131
135
  (0, react_1.useEffect)(function () {
132
136
  if (images.length === totalImages) {
133
137
  render();
@@ -175,7 +179,8 @@ var AirpodsAnimation = function (_a) {
175
179
  };
176
180
  return ((0, jsx_runtime_1.jsxs)("div", __assign({ id: "main", style: {
177
181
  width: '100vw',
178
- position: 'fixed'
182
+ position: 'fixed',
183
+ pointerEvents: 'none'
179
184
  /* height: 500vh; */
180
185
  } }, { children: [(0, jsx_runtime_1.jsx)("h1", __assign({ style: {
181
186
  position: 'fixed',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pds-dev-kit-web-test",
3
- "version": "2.4.20",
3
+ "version": "2.4.22",
4
4
  "license": "MIT",
5
5
  "private": false,
6
6
  "main": "dist/index.js",