pds-dev-kit-web-test 0.3.28 → 0.3.30
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/dist/src/sub/DynamicLayout/pagesPreviewMock.d.ts +817 -0
- package/dist/src/sub/DynamicLayout/pagesPreviewMock.js +1424 -1
- package/dist/src/sub/DynamicLayout/sections/CustomSection/CustomSection.js +29 -8
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/ComponentBlock.d.ts +2 -1
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/ComponentBlock.js +2 -2
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/ComponentBlockMatcher.d.ts +2 -1
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/ComponentBlockMatcher.js +9 -8
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/Button/Button.d.ts +2 -2
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/Button/Button.js +5 -3
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/Divider/Divider.d.ts +2 -2
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/Divider/Divider.js +4 -2
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/Image/Image.d.ts +2 -2
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/Image/Image.js +4 -2
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/RichText/RichText.d.ts +2 -2
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/RichText/RichText.js +4 -2
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/Text/Text.d.ts +2 -2
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/Text/Text.js +4 -2
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/Twitter/Twitter.d.ts +2 -2
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/Twitter/Twitter.js +4 -2
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/Youtube/Youtube.d.ts +2 -2
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/Youtube/Youtube.js +5 -3
- package/dist/src/sub/DynamicLayout/sections/CustomSection/hooks/useIntersectionObserver.d.ts +1 -1
- package/dist/src/sub/DynamicLayout/sections/CustomSection/hooks/useIntersectionObserver.js +12 -9
- package/dist/src/sub/DynamicLayout/sections/CustomSection/util/types.d.ts +3 -0
- package/package.json +2 -2
- package/release-note.md +2 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import type { CB_TWITTER_PROPERTIES_TYPE } from '../../../../util/types';
|
|
3
|
-
type Props = CB_TWITTER_PROPERTIES_TYPE;
|
|
2
|
+
import type { CB_TWITTER_PROPERTIES_TYPE, IndexForIntersection } from '../../../../util/types';
|
|
3
|
+
type Props = CB_TWITTER_PROPERTIES_TYPE & IndexForIntersection;
|
|
4
4
|
declare function Twitter(props: Props): JSX.Element;
|
|
5
5
|
export default Twitter;
|
|
@@ -22,7 +22,7 @@ var S_CB_BoxWithShadow_1 = require("../components/S_CB_BoxWithShadow");
|
|
|
22
22
|
function Twitter(props) {
|
|
23
23
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
24
24
|
var _a = (0, react_1.useContext)(DynamicLayout_1.dynamicLayoutContext), device = _a.device, mode = _a.mode;
|
|
25
|
-
var CB_EFFECT_PROP_ENTANIM = props.CB_EFFECT_PROP_ENTANIM;
|
|
25
|
+
var CB_EFFECT_PROP_ENTANIM = props.CB_EFFECT_PROP_ENTANIM, index = props.index;
|
|
26
26
|
var CB_CONTENT_PROP_TWITTER_SPEC_SRC = props.CB_CONTENT_PROP_TWITTER.CB_CONTENT_PROP_TWITTER_SPEC_SRC, CB_STYLE_PROP_TWITTER_SPEC_THEME = props.CB_STYLE_PROP_TWITTER.CB_STYLE_PROP_TWITTER_SPEC_THEME, CB_STYLE_PROP_SHADOW = props.CB_STYLE_PROP_SHADOW;
|
|
27
27
|
var _b = (0, util_1.parseProperties)(props, device), style = _b.style, hoverStyle = _b.hoverStyle, layout = _b.layout, effect = _b.effect;
|
|
28
28
|
var userId = CB_CONTENT_PROP_TWITTER_SPEC_SRC.replace('https://twitter.com/', '');
|
|
@@ -37,7 +37,9 @@ function Twitter(props) {
|
|
|
37
37
|
delete layout.justifyContent;
|
|
38
38
|
}
|
|
39
39
|
var cbRef = (0, react_1.useRef)(null);
|
|
40
|
-
var entry = (0, hooks_1.useIntersectionObserver)(cbRef, { threshold: 0.2, freezeOnceVisible: false }
|
|
40
|
+
var entry = (0, hooks_1.useIntersectionObserver)(cbRef, { threshold: 0.2, freezeOnceVisible: false }, [
|
|
41
|
+
index
|
|
42
|
+
]);
|
|
41
43
|
var isVisible = !!(entry === null || entry === void 0 ? void 0 : entry.isIntersecting);
|
|
42
44
|
var effectCssProperties = isVisible ? effect : {};
|
|
43
45
|
var editModeStyle = mode === 'EDIT' ? { pointerEvents: 'none' } : {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import type { CB_YOUTUBE_PROPERTIES_TYPE } from '../../../../../../../DynamicLayout/sections/CustomSection/util/types';
|
|
3
|
-
type Props = CB_YOUTUBE_PROPERTIES_TYPE;
|
|
2
|
+
import type { CB_YOUTUBE_PROPERTIES_TYPE, IndexForIntersection } from '../../../../../../../DynamicLayout/sections/CustomSection/util/types';
|
|
3
|
+
type Props = CB_YOUTUBE_PROPERTIES_TYPE & IndexForIntersection;
|
|
4
4
|
export type YOUTUBE_AUTOPLAY_TRIGGER_POINT = 'ALWAYS' | 'VIEWPORT-FREEZE' | 'VIEWPORT';
|
|
5
5
|
declare function Youtube(props: Props): JSX.Element;
|
|
6
6
|
export default Youtube;
|
|
@@ -32,7 +32,7 @@ var parseYoutubeContentProp_1 = __importDefault(require("./parseYoutubeContentPr
|
|
|
32
32
|
var YOUTUBE_AUTOPLAY_TRIGGER_POINT = 'VIEWPORT';
|
|
33
33
|
function Youtube(props) {
|
|
34
34
|
var _a = (0, react_1.useContext)(DynamicLayout_1.dynamicLayoutContext), device = _a.device, mode = _a.mode;
|
|
35
|
-
var CB_CONTENT_PROP_YOUTUBE = props.CB_CONTENT_PROP_YOUTUBE, CB_STYLE_PROP_BGCOLOR = props.CB_STYLE_PROP_BGCOLOR, CB_STYLE_PROP_SHADOW = props.CB_STYLE_PROP_SHADOW, CB_EFFECT_PROP_ENTANIM = props.CB_EFFECT_PROP_ENTANIM;
|
|
35
|
+
var index = props.index, CB_CONTENT_PROP_YOUTUBE = props.CB_CONTENT_PROP_YOUTUBE, CB_STYLE_PROP_BGCOLOR = props.CB_STYLE_PROP_BGCOLOR, CB_STYLE_PROP_SHADOW = props.CB_STYLE_PROP_SHADOW, CB_EFFECT_PROP_ENTANIM = props.CB_EFFECT_PROP_ENTANIM;
|
|
36
36
|
var _b = (0, parseYoutubeContentProp_1.default)(CB_CONTENT_PROP_YOUTUBE, device, YOUTUBE_AUTOPLAY_TRIGGER_POINT), youtubeSrc = _b.youtubeSrc, thumbnailSrc = _b.thumbnailSrc, id = _b.id, cbAutoplayMode = _b.cbAutoplayMode;
|
|
37
37
|
var isEditMode = mode === 'EDIT';
|
|
38
38
|
var _c = getBGColorStyles(CB_STYLE_PROP_BGCOLOR, device), bgColorStyle = _c.style, bgColorHoverStyle = _c.hoverStyle;
|
|
@@ -42,7 +42,9 @@ function Youtube(props) {
|
|
|
42
42
|
propsStyle.visibility = 'visible';
|
|
43
43
|
}
|
|
44
44
|
var cbRef = (0, react_1.useRef)(null);
|
|
45
|
-
var entry = (0, hooks_1.useIntersectionObserver)(cbRef, { threshold: 0.2, freezeOnceVisible: false }
|
|
45
|
+
var entry = (0, hooks_1.useIntersectionObserver)(cbRef, { threshold: 0.2, freezeOnceVisible: false }, [
|
|
46
|
+
index
|
|
47
|
+
]);
|
|
46
48
|
var isVisible = !!(entry === null || entry === void 0 ? void 0 : entry.isIntersecting);
|
|
47
49
|
var effectCssProperties = isVisible ? effect : {};
|
|
48
50
|
var isNoneEffectType = device === 'DESKTOP'
|
|
@@ -54,7 +56,7 @@ function Youtube(props) {
|
|
|
54
56
|
var autoplayRef = (0, react_1.useRef)(null);
|
|
55
57
|
var autoplayEntry = (0, hooks_1.useIntersectionObserver)(autoplayRef, {
|
|
56
58
|
freezeOnceVisible: YOUTUBE_AUTOPLAY_TRIGGER_POINT === 'VIEWPORT-FREEZE' ? true : false
|
|
57
|
-
});
|
|
59
|
+
}, [index]);
|
|
58
60
|
var onLoadIframe = function () {
|
|
59
61
|
var _a;
|
|
60
62
|
if (!((_a = iframeRef.current) === null || _a === void 0 ? void 0 : _a.contentWindow)) {
|
package/dist/src/sub/DynamicLayout/sections/CustomSection/hooks/useIntersectionObserver.d.ts
CHANGED
|
@@ -2,5 +2,5 @@ import { RefObject } from 'react';
|
|
|
2
2
|
interface Args extends IntersectionObserverInit {
|
|
3
3
|
freezeOnceVisible?: boolean;
|
|
4
4
|
}
|
|
5
|
-
export declare function useIntersectionObserver(elementRef: RefObject<Element>, { threshold, root, rootMargin, freezeOnceVisible }: Args): IntersectionObserverEntry | undefined;
|
|
5
|
+
export declare function useIntersectionObserver(elementRef: RefObject<Element>, { threshold, root, rootMargin, freezeOnceVisible }: Args, deps: any[]): IntersectionObserverEntry | undefined;
|
|
6
6
|
export {};
|
|
@@ -1,13 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
3
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
4
|
+
if (ar || !(i in from)) {
|
|
5
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
6
|
+
ar[i] = from[i];
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
10
|
+
};
|
|
2
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
12
|
exports.useIntersectionObserver = void 0;
|
|
4
|
-
/* eslint-disable no-console */
|
|
5
13
|
var react_1 = require("react");
|
|
6
|
-
function useIntersectionObserver(elementRef, _a) {
|
|
14
|
+
function useIntersectionObserver(elementRef, _a, deps) {
|
|
7
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;
|
|
8
16
|
var _f = (0, react_1.useState)(), entry = _f[0], setEntry = _f[1];
|
|
9
17
|
var frozen = (entry === null || entry === void 0 ? void 0 : entry.isIntersecting) && freezeOnceVisible;
|
|
10
|
-
(0, react_1.
|
|
18
|
+
(0, react_1.useLayoutEffect)(function () {
|
|
11
19
|
var updateEntry = function (_a) {
|
|
12
20
|
var entry = _a[0];
|
|
13
21
|
setEntry(entry);
|
|
@@ -15,21 +23,16 @@ function useIntersectionObserver(elementRef, _a) {
|
|
|
15
23
|
var node = elementRef === null || elementRef === void 0 ? void 0 : elementRef.current; // DOM Ref
|
|
16
24
|
var hasIOSupport = !!window.IntersectionObserver;
|
|
17
25
|
if (!hasIOSupport || frozen || !node) {
|
|
18
|
-
console.error('no node!', node);
|
|
19
26
|
return;
|
|
20
27
|
}
|
|
21
28
|
var observerParams = { threshold: threshold, root: root, rootMargin: rootMargin };
|
|
22
29
|
var observer = new IntersectionObserver(updateEntry, observerParams);
|
|
23
30
|
observer.observe(node);
|
|
24
|
-
console.log('observer-connected', node);
|
|
25
|
-
var rect = node.getBoundingClientRect();
|
|
26
|
-
console.log('rect:', { x: rect.x, y: rect.y, top: rect.top, bottom: rect.bottom });
|
|
27
31
|
return function () {
|
|
28
|
-
console.log('observer-disconnected');
|
|
29
32
|
observer.disconnect();
|
|
30
33
|
};
|
|
31
34
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
32
|
-
}, [elementRef === null || elementRef === void 0 ? void 0 : elementRef.current, JSON.stringify(threshold), root, rootMargin, frozen]);
|
|
35
|
+
}, __spreadArray([elementRef === null || elementRef === void 0 ? void 0 : elementRef.current, JSON.stringify(threshold), root, rootMargin, frozen], deps, true));
|
|
33
36
|
return entry;
|
|
34
37
|
}
|
|
35
38
|
exports.useIntersectionObserver = useIntersectionObserver;
|
|
@@ -132,3 +132,6 @@ export type ParserResult = {
|
|
|
132
132
|
};
|
|
133
133
|
export type JsonPropertiesParserResult = Omit<ParserResult, 'hoverStyle'> & OverlayStyle;
|
|
134
134
|
export type NamedPropAllTypes = NamedStylePropType | NamedLayoutPropType;
|
|
135
|
+
export type IndexForIntersection = {
|
|
136
|
+
index: number;
|
|
137
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pds-dev-kit-web-test",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.30",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"private": false,
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"i18next-intervalplural-postprocessor": "^3.0.0",
|
|
23
23
|
"lottie-react": "^2.3.1",
|
|
24
24
|
"nuka-carousel": "^4.8.4",
|
|
25
|
-
"publ-echo": "^0.0.
|
|
25
|
+
"publ-echo": "^0.0.31",
|
|
26
26
|
"react-hook-form": "^7.28.1",
|
|
27
27
|
"react-i18next": "^11.12.0",
|
|
28
28
|
"react-router-dom": "^5.2.0",
|
package/release-note.md
CHANGED