pds-dev-kit-web-test 0.3.27 → 0.3.29

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.
Files changed (28) hide show
  1. package/dist/src/sub/DynamicLayout/pagesPreviewMock.d.ts +817 -0
  2. package/dist/src/sub/DynamicLayout/pagesPreviewMock.js +1424 -1
  3. package/dist/src/sub/DynamicLayout/sections/CustomSection/CustomSection.js +18 -7
  4. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/ComponentBlock.d.ts +2 -1
  5. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/ComponentBlock.js +2 -2
  6. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/ComponentBlockMatcher.d.ts +2 -1
  7. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/ComponentBlockMatcher.js +9 -8
  8. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/Button/Button.d.ts +2 -2
  9. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/Button/Button.js +4 -2
  10. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/Divider/Divider.d.ts +2 -2
  11. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/Divider/Divider.js +4 -2
  12. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/Image/Image.d.ts +2 -2
  13. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/Image/Image.js +4 -2
  14. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/RichText/RichText.d.ts +2 -2
  15. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/RichText/RichText.js +4 -2
  16. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/Text/Text.d.ts +2 -2
  17. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/Text/Text.js +4 -2
  18. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/Twitter/Twitter.d.ts +2 -2
  19. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/Twitter/Twitter.js +4 -2
  20. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/Youtube/Youtube.d.ts +2 -2
  21. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/Youtube/Youtube.js +5 -3
  22. package/dist/src/sub/DynamicLayout/sections/CustomSection/hooks/useGroupDrag/useGroupDrag.js +16 -2
  23. package/dist/src/sub/DynamicLayout/sections/CustomSection/hooks/useGroupDrag/utils.d.ts +1 -1
  24. package/dist/src/sub/DynamicLayout/sections/CustomSection/hooks/useIntersectionObserver.d.ts +1 -1
  25. package/dist/src/sub/DynamicLayout/sections/CustomSection/hooks/useIntersectionObserver.js +12 -4
  26. package/dist/src/sub/DynamicLayout/sections/CustomSection/util/types.d.ts +3 -0
  27. package/package.json +2 -2
  28. package/release-note.md +2 -3
@@ -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)) {
@@ -18,11 +18,25 @@ function useGroupDrag(_a) {
18
18
  var layoutByDevice = device === 'DESKTOP' ? 'lg' : 'sm';
19
19
  function makeAllInOneGroup() {
20
20
  setLayouts(function (prev) {
21
- var _a;
21
+ var _a, _b;
22
+ var _c;
22
23
  // TODO: 임시용 카피
23
24
  var currentLayoutCopy = JSON.parse(JSON.stringify(prev[layoutByDevice]));
25
+ var groupIdx = currentLayoutCopy.findIndex(function (item) { return item.i === 'group'; });
26
+ // NOTE: 그룹이 없는 경우
27
+ if (groupIdx < 0) {
28
+ var group_1 = (0, utils_1.getGroupForMultiple)(currentLayoutCopy);
29
+ return __assign(__assign({}, prev), (_a = {}, _a[layoutByDevice] = [group_1], _a));
30
+ }
31
+ // NOTE: 그룹이 이미 있는경우
32
+ var groupItem = currentLayoutCopy.splice(groupIdx, 1)[0];
33
+ if (!groupItem.groupLayouts) {
34
+ return prev;
35
+ }
36
+ var groupItems = (_c = groupItem.groupLayouts.map(function (each) { return (__assign(__assign({}, each), { x: groupItem.x + each.x, y: groupItem.y + each.y })); })) !== null && _c !== void 0 ? _c : [];
37
+ currentLayoutCopy.push.apply(currentLayoutCopy, groupItems);
24
38
  var group = (0, utils_1.getGroupForMultiple)(currentLayoutCopy);
25
- return __assign(__assign({}, prev), (_a = {}, _a[layoutByDevice] = [group], _a));
39
+ return __assign(__assign({}, prev), (_b = {}, _b[layoutByDevice] = [group], _b));
26
40
  });
27
41
  sectionActionHandler &&
28
42
  sectionActionHandler({
@@ -4,7 +4,7 @@ export interface LayoutItemWithGroupType extends LayoutItem {
4
4
  childrenIds: string[];
5
5
  }
6
6
  export declare function getGroupData(elem1: LayoutItemWithGroupType, elem2: LayoutItemWithGroupType): LayoutItemWithGroupType;
7
- export declare function getGroupForMultiple(elems: LayoutItemWithGroupType[]): LayoutItemWithGroupType;
7
+ export declare function getGroupForMultiple(elems: LayoutItem[]): LayoutItemWithGroupType;
8
8
  export declare function splitComponentBlocksByGroup(componentBlocks: ComponentBlock[], groupIds: string[]): {
9
9
  inGroup: ComponentBlock[];
10
10
  notInGroup: ComponentBlock[];
@@ -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.useEffect)(function () {
18
+ (0, react_1.useLayoutEffect)(function () {
11
19
  var updateEntry = function (_a) {
12
20
  var entry = _a[0];
13
21
  setEntry(entry);
@@ -24,7 +32,7 @@ function useIntersectionObserver(elementRef, _a) {
24
32
  observer.disconnect();
25
33
  };
26
34
  // eslint-disable-next-line react-hooks/exhaustive-deps
27
- }, [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));
28
36
  return entry;
29
37
  }
30
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.27",
3
+ "version": "0.3.29",
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.30",
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
@@ -1,7 +1,6 @@
1
1
  # pds-dev-kit-web-test Release Notes
2
- ## [v0.3.27]
2
+ ## [v0.3.29]
3
3
  ## 기준 pds-dev-kit-web 버전 @2.2.41
4
4
  ### sub
5
5
  * DynamicLayout
6
- * GROUP - PERSIST
7
- * [POC] 그룹은 cb 변화로 rerender되어도 깨지지 않도록 관리
6
+ * 애니메이션 이슈 픽스