pds-dev-kit-web-test 2.7.611 → 2.7.613

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.
@@ -24,7 +24,6 @@ var jsx_runtime_1 = require("react/jsx-runtime");
24
24
  var EditModeSectionMatcher_1 = require("./components/EditModeSectionMatcher");
25
25
  var SectionMatcher_1 = require("./components/SectionMatcher");
26
26
  var dynamicLayoutContext_1 = require("./dynamicLayoutContext");
27
- var IntersectionObserverContext_1 = require("./IntersectionObserverContext");
28
27
  function DynamicLayout(_a) {
29
28
  var device = _a.device, _b = _a.mode, mode = _b === void 0 ? 'NORMAL' : _b, isPreview = _a.isPreview, sections = _a.sections, scrollDownTargetSectionId = _a.scrollDownTargetSectionId, editingSectionId = _a.editingSectionId, navigationHandler = _a.navigationHandler, sectionActionHandler = _a.sectionActionHandler, onClickEditSection = _a.onClickEditSection, programmedSectionComponents = _a.programmedSectionComponents, shortcutKeyMode = _a.shortcutKeyMode, dynamicLayoutRef = _a.dynamicLayoutRef, zoomScale = _a.zoomScale, queryData = _a.queryData, placementRestriction = _a.placementRestriction;
30
29
  var filteredSortedSection = __spreadArray([], sections, true).filter(function (section) {
@@ -44,7 +43,7 @@ function DynamicLayout(_a) {
44
43
  .sort(function (a, b) { return a.order - b.order; });
45
44
  var iframeSection = filteredSortedSection.find(function (section) { return section.manifest.schema === 'EXP_IFRAME' && section.display; });
46
45
  var editorType = 'DYNAMIC_LAYOUT_EDITOR';
47
- return ((0, jsx_runtime_1.jsx)(dynamicLayoutContext_1.dynamicLayoutContext.Provider, __assign({ value: {
46
+ return ((0, jsx_runtime_1.jsxs)(dynamicLayoutContext_1.dynamicLayoutContext.Provider, __assign({ value: {
48
47
  device: device,
49
48
  mode: mode,
50
49
  isPreview: isPreview,
@@ -57,7 +56,7 @@ function DynamicLayout(_a) {
57
56
  queryData: queryData,
58
57
  placementRestriction: placementRestriction,
59
58
  editorType: editorType
60
- } }, { children: (0, jsx_runtime_1.jsxs)(IntersectionObserverContext_1.IntersectionObserverProvider, { children: [mode === 'EDIT' && onClickEditSection && ((0, jsx_runtime_1.jsx)(EditModeSectionMatcher_1.EditModeSectionMatcher, { dynamicLayoutRef: dynamicLayoutRef, editingSectionId: editingSectionId, scrollDownTargetSectionId: scrollDownTargetSectionId, filteredSortedSection: filteredSortedSection, onClickEditSection: onClickEditSection })), mode !== 'EDIT' &&
61
- (iframeSection ? ((0, jsx_runtime_1.jsx)(SectionMatcher_1.SectionMatcher, __assign({}, iframeSection), iframeSection.id)) : (filteredSortedSection.map(function (section) { return (0, jsx_runtime_1.jsx)(SectionMatcher_1.SectionMatcher, __assign({}, section), section.id); })))] }) })));
59
+ } }, { children: [mode === 'EDIT' && onClickEditSection && ((0, jsx_runtime_1.jsx)(EditModeSectionMatcher_1.EditModeSectionMatcher, { dynamicLayoutRef: dynamicLayoutRef, editingSectionId: editingSectionId, scrollDownTargetSectionId: scrollDownTargetSectionId, filteredSortedSection: filteredSortedSection, onClickEditSection: onClickEditSection })), mode !== 'EDIT' &&
60
+ (iframeSection ? ((0, jsx_runtime_1.jsx)(SectionMatcher_1.SectionMatcher, __assign({}, iframeSection), iframeSection.id)) : (filteredSortedSection.map(function (section) { return (0, jsx_runtime_1.jsx)(SectionMatcher_1.SectionMatcher, __assign({}, section), section.id); })))] })));
62
61
  }
63
62
  exports.default = DynamicLayout;
@@ -27,7 +27,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
27
27
  Object.defineProperty(exports, "__esModule", { value: true });
28
28
  var jsx_runtime_1 = require("react/jsx-runtime");
29
29
  var react_1 = require("react");
30
- var dynamicLayoutContext_1 = require("../../../DynamicLayout/dynamicLayoutContext");
31
30
  var sections_1 = require("../../../DynamicLayout/sections");
32
31
  var SectionBox_1 = __importDefault(require("./SectionBox"));
33
32
  function EditModeSectionMatcher(_a) {
@@ -53,17 +52,9 @@ function EditModeSectionMatcher(_a) {
53
52
  }
54
53
  };
55
54
  }, [selectedSectionRef]);
56
- return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: iframeSection ? ((0, jsx_runtime_1.jsx)(SectionBox_1.default, __assign({ isIframeSection: true, isEditing: editingSectionId === iframeSection.id, scrollIntoThisSection: iframeSection.id === scrollDownTargetSectionId, onClick: function () { return onClickEditSection(iframeSection); } }, { children: (0, jsx_runtime_1.jsx)(ContextWrapper, __assign({ isEditing: editingSectionId === iframeSection.id }, { children: (0, jsx_runtime_1.jsx)(DesignedSectionsMatcher, __assign({}, iframeSection)) })) }), iframeSection.id)) : (filteredSortedSection.map(function (section) { return ((0, jsx_runtime_1.jsx)(SectionBox_1.default, __assign({ isEditing: editingSectionId === section.id, scrollIntoThisSection: section.id === scrollDownTargetSectionId, onClick: function () { return onClickEditSection(section); } }, { children: (0, jsx_runtime_1.jsx)(ContextWrapper, __assign({ isEditing: editingSectionId === section.id }, { children: section.type === 'CUSTOM' ? ((0, jsx_runtime_1.jsx)(sections_1.CustomSection, __assign({}, section, { ref: editingSectionId === section.id ? refCallback : null }))) : ((0, jsx_runtime_1.jsx)(DesignedSectionsMatcher, __assign({}, section))) })) }), section.id)); })) }));
55
+ return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: iframeSection ? ((0, jsx_runtime_1.jsx)(SectionBox_1.default, __assign({ isIframeSection: true, isEditing: editingSectionId === iframeSection.id, scrollIntoThisSection: iframeSection.id === scrollDownTargetSectionId, onClick: function () { return onClickEditSection(iframeSection); } }, { children: (0, jsx_runtime_1.jsx)(DesignedSectionsMatcher, __assign({}, iframeSection)) }), iframeSection.id)) : (filteredSortedSection.map(function (section) { return ((0, jsx_runtime_1.jsx)(SectionBox_1.default, __assign({ isEditing: editingSectionId === section.id, scrollIntoThisSection: section.id === scrollDownTargetSectionId, onClick: function () { return onClickEditSection(section); } }, { children: section.type === 'CUSTOM' ? ((0, jsx_runtime_1.jsx)(sections_1.CustomSection, __assign({}, section, { ref: editingSectionId === section.id ? refCallback : null }))) : ((0, jsx_runtime_1.jsx)(DesignedSectionsMatcher, __assign({}, section))) }), section.id)); })) }));
57
56
  }
58
57
  exports.default = EditModeSectionMatcher;
59
- function ContextWrapper(_a) {
60
- var children = _a.children, isEditing = _a.isEditing;
61
- var contextValue = (0, react_1.useContext)(dynamicLayoutContext_1.dynamicLayoutContext);
62
- if (isEditing) {
63
- return (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: children });
64
- }
65
- return ((0, jsx_runtime_1.jsx)(dynamicLayoutContext_1.dynamicLayoutContext.Provider, __assign({ value: __assign(__assign({}, contextValue), { mode: 'PREVIEW' }) }, { children: children })));
66
- }
67
58
  function DesignedSectionsMatcher(_a) {
68
59
  var props = __rest(_a, []);
69
60
  var schema = props.manifest.schema;
@@ -51,7 +51,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
51
51
  };
52
52
  Object.defineProperty(exports, "__esModule", { value: true });
53
53
  var jsx_runtime_1 = require("react/jsx-runtime");
54
- var publ_echo_1 = require("publ-echo");
54
+ var publ_echo_test_1 = require("publ-echo-test");
55
55
  var group_1 = require("publ-echo/dist/lib/GridLayoutEditor/group");
56
56
  var renderHelpers_1 = require("publ-echo/dist/lib/GridLayoutEditor/utils/renderHelpers");
57
57
  var react_1 = __importStar(require("react"));
@@ -67,7 +67,7 @@ var clsx_1 = require("./newUtils/clsx");
67
67
  var group_2 = require("./newUtils/group");
68
68
  var util_1 = require("./util");
69
69
  var parseSectionPadding_1 = __importDefault(require("./util/layoutPropParsers/parseSectionPadding"));
70
- var Responsive = (0, publ_echo_1.WidthProvider)(publ_echo_1.ResponsiveGridEditor);
70
+ var Responsive = (0, publ_echo_test_1.WidthProvider)(publ_echo_test_1.ResponsiveGridEditor);
71
71
  var GRID_CELL_MIN = 24;
72
72
  var DESKTOP_GRID_COLS = 24;
73
73
  var MOBILE_GRID_COLS = 8;
@@ -72,11 +72,9 @@ function ContentsCarousel(props) {
72
72
  var _d = (0, react_1.useContext)(dynamicLayoutContext_1.dynamicLayoutContext), device = _d.device, mode = _d.mode, queryData = _d.queryData, navigationHandler = _d.navigationHandler;
73
73
  var compositions = props.compositions, index = props.index, _e = props.CB_CONTENT_PROP_CONTENTSCAROUSEL, CB_CONTENT_PROP_CONTENTSCAROUSEL_SPEC_DISPLAYCOUNTS = _e.CB_CONTENT_PROP_CONTENTSCAROUSEL_SPEC_DISPLAYCOUNTS, CB_CONTENT_PROP_CONTENTSCAROUSEL_SPEC_ITEMCOUNTS = _e.CB_CONTENT_PROP_CONTENTSCAROUSEL_SPEC_ITEMCOUNTS, CB_CONTENT_PROP_CONTENTSCAROUSEL_SPEC_MDISPLAYCOUNTS = _e.CB_CONTENT_PROP_CONTENTSCAROUSEL_SPEC_MDISPLAYCOUNTS, CB_CONTENT_PROP_CONTENTSCAROUSEL_SPEC_VALUETYPE = _e.CB_CONTENT_PROP_CONTENTSCAROUSEL_SPEC_VALUETYPE, CB_CONTENT_PROP_CONTENTSCAROUSEL_SPEC_CONNECTDATA = _e.CB_CONTENT_PROP_CONTENTSCAROUSEL_SPEC_CONNECTDATA, CB_CONTENT_PROP_CONTENTSCAROUSEL_SPEC_DATASORTING = _e.CB_CONTENT_PROP_CONTENTSCAROUSEL_SPEC_DATASORTING, CB_CONTENT_PROP_CONTENTSCAROUSEL_SPEC_DATAOFFSET = _e.CB_CONTENT_PROP_CONTENTSCAROUSEL_SPEC_DATAOFFSET, CB_CONTENT_PROP_CONTENTSCAROUSEL_SPEC_MANUALITEMS = _e.CB_CONTENT_PROP_CONTENTSCAROUSEL_SPEC_MANUALITEMS, CB_STYLE_PROP_CONTENTSCAROUSELDESIGN = props.CB_STYLE_PROP_CONTENTSCAROUSELDESIGN, CB_STYLE_PROP_CONTENTSCAROUSELPLAYBACKMETHOD = props.CB_STYLE_PROP_CONTENTSCAROUSELPLAYBACKMETHOD, CB_STYLE_PROP_CONTENTSCAROUSELBUTTON = props.CB_STYLE_PROP_CONTENTSCAROUSELBUTTON, CB_STYLE_PROP_CONTENTSCAROUSELPROGRESSBAR = props.CB_STYLE_PROP_CONTENTSCAROUSELPROGRESSBAR, CB_STYLE_PROP_SHADOW = props.CB_STYLE_PROP_SHADOW, CB_EFFECT_PROP_ENTANIM = props.CB_EFFECT_PROP_ENTANIM, CB_STYLE_PROP_BGMEDIA = props.CB_STYLE_PROP_BGMEDIA, CB_EFFECT_PROP_CONTENTSCAROUSEL_SPEC_TRANSITIONTYPE = props.CB_EFFECT_PROP_CONTENTSCAROUSEL.CB_EFFECT_PROP_CONTENTSCAROUSEL_SPEC_TRANSITIONTYPE;
74
74
  var CB_STYLE_PROP_CONTENTSCAROUSEL = __assign(__assign(__assign(__assign({}, CB_STYLE_PROP_CONTENTSCAROUSELDESIGN), CB_STYLE_PROP_CONTENTSCAROUSELPLAYBACKMETHOD), CB_STYLE_PROP_CONTENTSCAROUSELBUTTON), CB_STYLE_PROP_CONTENTSCAROUSELPROGRESSBAR);
75
- var autoPlayEnabled = mode === 'EDIT'
76
- ? false
77
- : device === 'DESKTOP'
78
- ? CB_STYLE_PROP_CONTENTSCAROUSELPLAYBACKMETHOD.CB_STYLE_PROP_CONTENTSCAROUSELPLAYBACKMETHOD_SPEC_AUTOPLAYUSE
79
- : (_a = CB_STYLE_PROP_CONTENTSCAROUSELPLAYBACKMETHOD['CB_STYLE_PROP_CONTENTSCAROUSELPLAYBACKMETHOD_SPEC_AUTOPLAYUSE:MOBILE']) !== null && _a !== void 0 ? _a : CB_STYLE_PROP_CONTENTSCAROUSELPLAYBACKMETHOD.CB_STYLE_PROP_CONTENTSCAROUSELPLAYBACKMETHOD_SPEC_AUTOPLAYUSE;
75
+ var autoPlayEnabled = device === 'DESKTOP'
76
+ ? CB_STYLE_PROP_CONTENTSCAROUSELPLAYBACKMETHOD.CB_STYLE_PROP_CONTENTSCAROUSELPLAYBACKMETHOD_SPEC_AUTOPLAYUSE
77
+ : (_a = CB_STYLE_PROP_CONTENTSCAROUSELPLAYBACKMETHOD['CB_STYLE_PROP_CONTENTSCAROUSELPLAYBACKMETHOD_SPEC_AUTOPLAYUSE:MOBILE']) !== null && _a !== void 0 ? _a : CB_STYLE_PROP_CONTENTSCAROUSELPLAYBACKMETHOD.CB_STYLE_PROP_CONTENTSCAROUSELPLAYBACKMETHOD_SPEC_AUTOPLAYUSE;
80
78
  var displayCounts = device === 'DESKTOP'
81
79
  ? CB_CONTENT_PROP_CONTENTSCAROUSEL_SPEC_DISPLAYCOUNTS
82
80
  : CB_CONTENT_PROP_CONTENTSCAROUSEL_SPEC_MDISPLAYCOUNTS !== null && CB_CONTENT_PROP_CONTENTSCAROUSEL_SPEC_MDISPLAYCOUNTS !== void 0 ? CB_CONTENT_PROP_CONTENTSCAROUSEL_SPEC_MDISPLAYCOUNTS : CB_CONTENT_PROP_CONTENTSCAROUSEL_SPEC_MANUALITEMS.length;
@@ -113,7 +111,7 @@ function ContentsCarousel(props) {
113
111
  var childrenLength = CB_CONTENT_PROP_CONTENTSCAROUSEL_SPEC_VALUETYPE === 'VALUE'
114
112
  ? orderedCompositions.length
115
113
  : Math.min((_b = queryDataToRender === null || queryDataToRender === void 0 ? void 0 : queryDataToRender.length) !== null && _b !== void 0 ? _b : 0, CB_CONTENT_PROP_CONTENTSCAROUSEL_SPEC_ITEMCOUNTS);
116
- var loop = mode === 'EDIT' ? false : contentsCarouselNormalStyle.loop && childrenLength >= displayCounts;
114
+ var loop = contentsCarouselNormalStyle.loop && childrenLength >= displayCounts;
117
115
  // NOTE: edit모드에서는 그리드의 이벤트만 작동하도록 CB의 포인터 이벤트는 막습니다.
118
116
  var editModeStyle = mode === 'EDIT' ? { pointerEvents: 'none' } : {};
119
117
  // NOTE: EFFECT와 관련된 함수들입니다.
@@ -76,11 +76,9 @@ function SlideBanner(props) {
76
76
  var index = props.index, _c = props.CB_CONTENT_PROP_SLIDEBANNER, CB_CONTENT_PROP_SLIDEBANNER_SPEC_ITEMCOUNTS = _c.CB_CONTENT_PROP_SLIDEBANNER_SPEC_ITEMCOUNTS, CB_CONTENT_PROP_SLIDEBANNER_SPEC_VALUETYPE = _c.CB_CONTENT_PROP_SLIDEBANNER_SPEC_VALUETYPE, CB_CONTENT_PROP_SLIDEBANNER_SPEC_CONNECTDATA = _c.CB_CONTENT_PROP_SLIDEBANNER_SPEC_CONNECTDATA, CB_CONTENT_PROP_SLIDEBANNER_SPEC_DATASORTING = _c.CB_CONTENT_PROP_SLIDEBANNER_SPEC_DATASORTING, CB_CONTENT_PROP_SLIDEBANNER_SPEC_DATAOFFSET = _c.CB_CONTENT_PROP_SLIDEBANNER_SPEC_DATAOFFSET, CB_CONTENT_PROP_SLIDEBANNER_SPEC_MANUALITEMS = _c.CB_CONTENT_PROP_SLIDEBANNER_SPEC_MANUALITEMS, CB_STYLE_PROP_SLIDEBANNERDESIGN = props.CB_STYLE_PROP_SLIDEBANNERDESIGN, CB_STYLE_PROP_SLIDEBANNERPAGINATION = props.CB_STYLE_PROP_SLIDEBANNERPAGINATION, CB_STYLE_PROP_SLIDEBANNERBUTTON = props.CB_STYLE_PROP_SLIDEBANNERBUTTON, CB_STYLE_PROP_SLIDEBANNERPLAYBACKMETHOD = props.CB_STYLE_PROP_SLIDEBANNERPLAYBACKMETHOD, CB_STYLE_PROP_SLIDEBANNERPROGRESSBAR = props.CB_STYLE_PROP_SLIDEBANNERPROGRESSBAR, CB_STYLE_PROP_SHADOW = props.CB_STYLE_PROP_SHADOW, CB_EFFECT_PROP_ENTANIM = props.CB_EFFECT_PROP_ENTANIM, CB_STYLE_PROP_BGMEDIA = props.CB_STYLE_PROP_BGMEDIA, CB_EFFECT_PROP_SLIDEBANNER_SPEC_TRANSITIONTYPE = props.CB_EFFECT_PROP_SLIDEBANNER.CB_EFFECT_PROP_SLIDEBANNER_SPEC_TRANSITIONTYPE;
77
77
  var compositions = props.compositions;
78
78
  var CB_STYLE_PROP_SLIDEBANNER = __assign(__assign(__assign(__assign(__assign({}, CB_STYLE_PROP_SLIDEBANNERDESIGN), CB_STYLE_PROP_SLIDEBANNERPAGINATION), CB_STYLE_PROP_SLIDEBANNERBUTTON), CB_STYLE_PROP_SLIDEBANNERPLAYBACKMETHOD), CB_STYLE_PROP_SLIDEBANNERPROGRESSBAR);
79
- var autoPlayEnabled = mode === 'EDIT'
80
- ? false
81
- : device === 'DESKTOP'
82
- ? CB_STYLE_PROP_SLIDEBANNERPLAYBACKMETHOD.CB_STYLE_PROP_SLIDEBANNERPLAYBACKMETHOD_SPEC_AUTOPLAYUSE
83
- : (_a = CB_STYLE_PROP_SLIDEBANNERPLAYBACKMETHOD['CB_STYLE_PROP_SLIDEBANNERPLAYBACKMETHOD_SPEC_AUTOPLAYUSE:MOBILE']) !== null && _a !== void 0 ? _a : CB_STYLE_PROP_SLIDEBANNERPLAYBACKMETHOD.CB_STYLE_PROP_SLIDEBANNERPLAYBACKMETHOD_SPEC_AUTOPLAYUSE;
79
+ var autoPlayEnabled = device === 'DESKTOP'
80
+ ? CB_STYLE_PROP_SLIDEBANNERPLAYBACKMETHOD.CB_STYLE_PROP_SLIDEBANNERPLAYBACKMETHOD_SPEC_AUTOPLAYUSE
81
+ : (_a = CB_STYLE_PROP_SLIDEBANNERPLAYBACKMETHOD['CB_STYLE_PROP_SLIDEBANNERPLAYBACKMETHOD_SPEC_AUTOPLAYUSE:MOBILE']) !== null && _a !== void 0 ? _a : CB_STYLE_PROP_SLIDEBANNERPLAYBACKMETHOD.CB_STYLE_PROP_SLIDEBANNERPLAYBACKMETHOD_SPEC_AUTOPLAYUSE;
84
82
  var _d = (0, util_1.parseProperties)(props, device), style = _d.style, hoverStyle = _d.hoverStyle, layout = _d.layout, overlayStyle = _d.overlayStyle, effect = _d.effect;
85
83
  var _e = (0, slideBannerUtils_1.parseSlideBannerStyleToSlideBannerCoreProp)({
86
84
  props: CB_STYLE_PROP_SLIDEBANNER,
@@ -100,11 +98,7 @@ function SlideBanner(props) {
100
98
  }), customProgressbarNormalStyle = _h.normalStyle, customProgressbarHoverStyle = _h.hoverStyle;
101
99
  var _j = (0, useSwiper_1.useSwiper)(), swiperRef = _j.swiperRef, progressRef = _j.progressRef, leftTimeMsRef = _j.leftTimeMsRef, currentSlide = _j.currentSlide, isBeginning = _j.isBeginning, isEnd = _j.isEnd, onSwiper = _j.onSwiper, onSlideChangeTransitionEnd = _j.onSlideChangeTransitionEnd, onAutoplayTimeLeft = _j.onAutoplayTimeLeft, onClickBullet = _j.onClickBullet, onClickPrevBtn = _j.onClickPrevBtn, onClickNextBtn = _j.onClickNextBtn, resetSwiper = _j.resetSwiper;
102
100
  var _k = (0, react_1.useState)(false), isHovered = _k[0], setIsHovered = _k[1];
103
- var loop = mode === 'EDIT'
104
- ? false
105
- : isHovered
106
- ? slideBannerNormalStyle.loop
107
- : slideBannerHoverStyle.loop;
101
+ var loop = isHovered ? slideBannerNormalStyle.loop : slideBannerHoverStyle.loop;
108
102
  // NOTE: edit모드에서는 그리드의 이벤트만 작동하도록 CB의 포인터 이벤트는 막습니다.
109
103
  var editModeStyle = mode === 'EDIT' ? { pointerEvents: 'none' } : {};
110
104
  // NOTE: EFFECT와 관련된 함수들입니다.
@@ -11,11 +11,9 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.useIntersectionObserver = void 0;
13
13
  var react_1 = require("react");
14
- var IntersectionObserverContext_1 = require("../../../IntersectionObserverContext");
15
14
  function useIntersectionObserver(elementRef, _a, deps) {
16
15
  var _b = _a.threshold, threshold = _b === void 0 ? 0 : _b, _c = _a.root, root = _c === void 0 ? null : _c, _d = _a.rootMargin, rootMargin = _d === void 0 ? '0%' : _d, _e = _a.freezeOnceVisible, freezeOnceVisible = _e === void 0 ? false : _e;
17
16
  var _f = (0, react_1.useState)(), entry = _f[0], setEntry = _f[1];
18
- var context = (0, IntersectionObserverContext_1.useIntersectionObserverContext)();
19
17
  var frozen = (entry === null || entry === void 0 ? void 0 : entry.isIntersecting) && freezeOnceVisible;
20
18
  (0, react_1.useLayoutEffect)(function () {
21
19
  var updateEntry = function (_a) {
@@ -28,12 +26,6 @@ function useIntersectionObserver(elementRef, _a, deps) {
28
26
  return;
29
27
  }
30
28
  var observerParams = { threshold: threshold, root: root, rootMargin: rootMargin };
31
- if (context) {
32
- context.observe(node, updateEntry, observerParams);
33
- return function () {
34
- context.unobserve(node, observerParams);
35
- };
36
- }
37
29
  var observer = new IntersectionObserver(updateEntry, observerParams);
38
30
  observer.observe(node);
39
31
  return function () {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pds-dev-kit-web-test",
3
- "version": "2.7.611",
3
+ "version": "2.7.613",
4
4
  "license": "MIT",
5
5
  "private": false,
6
6
  "main": "dist/index.js",
@@ -25,6 +25,7 @@
25
25
  "lottie-react": "^2.3.1",
26
26
  "nuka-carousel": "^4.8.4",
27
27
  "publ-echo": "^0.0.133",
28
+ "publ-echo-test": "^0.0.401",
28
29
  "react-hook-form": "^7.28.1",
29
30
  "react-i18next": "^11.12.0",
30
31
  "react-router-dom": "^5.2.0",
@@ -1,15 +0,0 @@
1
- import React from 'react';
2
- type ObservationOptions = {
3
- root?: Element | Document | null;
4
- rootMargin?: string;
5
- threshold?: number | number[];
6
- };
7
- type IntersectionObserverContextType = {
8
- observe: (element: Element, callback: IntersectionObserverCallback, options?: ObservationOptions) => void;
9
- unobserve: (element: Element, options?: ObservationOptions) => void;
10
- };
11
- export declare const useIntersectionObserverContext: () => IntersectionObserverContextType | null;
12
- export declare function IntersectionObserverProvider({ children }: {
13
- children: React.ReactNode;
14
- }): JSX.Element;
15
- export {};
@@ -1,96 +0,0 @@
1
- "use strict";
2
- var __assign = (this && this.__assign) || function () {
3
- __assign = Object.assign || function(t) {
4
- for (var s, i = 1, n = arguments.length; i < n; i++) {
5
- s = arguments[i];
6
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
- t[p] = s[p];
8
- }
9
- return t;
10
- };
11
- return __assign.apply(this, arguments);
12
- };
13
- Object.defineProperty(exports, "__esModule", { value: true });
14
- exports.IntersectionObserverProvider = exports.useIntersectionObserverContext = void 0;
15
- var jsx_runtime_1 = require("react/jsx-runtime");
16
- var react_1 = require("react");
17
- var IntersectionObserverContext = (0, react_1.createContext)(null);
18
- var useIntersectionObserverContext = function () { return (0, react_1.useContext)(IntersectionObserverContext); };
19
- exports.useIntersectionObserverContext = useIntersectionObserverContext;
20
- function IntersectionObserverProvider(_a) {
21
- var children = _a.children;
22
- // Map of options hash -> IntersectionObserver instance
23
- var observers = (0, react_1.useRef)(new Map());
24
- // Map of options hash -> Map of Element -> Callback
25
- var callbacks = (0, react_1.useRef)(new Map());
26
- var getOptionsHash = function (options) {
27
- var _a = options || {}, _b = _a.root, root = _b === void 0 ? null : _b, _c = _a.rootMargin, rootMargin = _c === void 0 ? '0px' : _c, _d = _a.threshold, threshold = _d === void 0 ? 0 : _d;
28
- // Note: 'root' element reference cannot be easily hashed if it's not null/window.
29
- // Ideally we assume root is usually viewport (null). If root is an element, this simplistic hashing might fail if we have multiple roots.
30
- // For this specific use case (DynamicLayout), root is usually viewport.
31
- // If specific root handling is needed, we need a better way to map it.
32
- // For now, let's treat root object as 'null' in hash if it is object, or use a WeakMap if strictness is needed.
33
- // However, typical usage here is viewport.
34
- return JSON.stringify({
35
- root: root ? 'element' : 'null',
36
- rootMargin: rootMargin,
37
- threshold: threshold
38
- });
39
- };
40
- var observe = function (element, callback, options) {
41
- var hash = getOptionsHash(options);
42
- if (!observers.current.has(hash)) {
43
- var observerCallback = function (entries, observer) {
44
- var hashCallbacks = callbacks.current.get(hash);
45
- if (!hashCallbacks)
46
- return;
47
- entries.forEach(function (entry) {
48
- var cb = hashCallbacks.get(entry.target);
49
- if (cb) {
50
- cb([entry], observer);
51
- }
52
- });
53
- };
54
- var newObserver = new IntersectionObserver(observerCallback, options);
55
- observers.current.set(hash, newObserver);
56
- callbacks.current.set(hash, new Map());
57
- }
58
- var observer = observers.current.get(hash);
59
- var hashCallbacks = callbacks.current.get(hash);
60
- if (!hashCallbacks.has(element)) {
61
- hashCallbacks.set(element, callback);
62
- observer.observe(element);
63
- }
64
- };
65
- var unobserve = function (element, options) {
66
- var hash = getOptionsHash(options);
67
- var observer = observers.current.get(hash);
68
- var hashCallbacks = callbacks.current.get(hash);
69
- if (observer && hashCallbacks) {
70
- if (hashCallbacks.has(element)) {
71
- hashCallbacks.delete(element);
72
- observer.unobserve(element);
73
- }
74
- // Optional: Cleanup observer if no elements
75
- if (hashCallbacks.size === 0) {
76
- observer.disconnect();
77
- observers.current.delete(hash);
78
- callbacks.current.delete(hash);
79
- }
80
- }
81
- };
82
- var value = (0, react_1.useMemo)(function () { return ({
83
- observe: observe,
84
- unobserve: unobserve
85
- }); }, []);
86
- (0, react_1.useEffect)(function () {
87
- return function () {
88
- // Cleanup all observers on unmount
89
- observers.current.forEach(function (observer) { return observer.disconnect(); });
90
- observers.current.clear();
91
- callbacks.current.clear();
92
- };
93
- }, []);
94
- return ((0, jsx_runtime_1.jsx)(IntersectionObserverContext.Provider, __assign({ value: value }, { children: children })));
95
- }
96
- exports.IntersectionObserverProvider = IntersectionObserverProvider;