pds-dev-kit-web 2.2.49 → 2.2.50
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/DynamicLayout.d.ts +1 -1
- package/dist/src/sub/DynamicLayout/DynamicLayout.js +4 -3
- package/dist/src/sub/DynamicLayout/components/EditModeSectionMatcher/EditModeSectionMatcher.d.ts +3 -2
- package/dist/src/sub/DynamicLayout/components/EditModeSectionMatcher/EditModeSectionMatcher.js +18 -6
- package/dist/src/sub/DynamicLayout/components/Section/components/CustomSectionBackground.js +3 -2
- package/dist/src/sub/DynamicLayout/hooks/useCustomSectionShortcut/useCustomSectionShortcut.d.ts +6 -0
- package/dist/src/sub/DynamicLayout/hooks/useCustomSectionShortcut/useCustomSectionShortcut.js +50 -0
- package/dist/src/sub/DynamicLayout/pagesPreviewMock.d.ts +1236 -2
- package/dist/src/sub/DynamicLayout/pagesPreviewMock.js +2298 -6
- package/dist/src/sub/DynamicLayout/sectionActionTypes.d.ts +23 -1
- package/dist/src/sub/DynamicLayout/sections/CustomSection/CustomSection.d.ts +10 -2
- package/dist/src/sub/DynamicLayout/sections/CustomSection/CustomSection.js +273 -26
- 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 +11 -10
- 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 +4 -2
- 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 +5 -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/useGroupDrag/index.d.ts +1 -0
- package/dist/src/sub/DynamicLayout/sections/CustomSection/hooks/useGroupDrag/index.js +8 -0
- package/dist/src/sub/DynamicLayout/sections/CustomSection/hooks/useGroupDrag/useGroupDrag.d.ts +22 -0
- package/dist/src/sub/DynamicLayout/sections/CustomSection/hooks/useGroupDrag/useGroupDrag.js +273 -0
- package/dist/src/sub/DynamicLayout/sections/CustomSection/hooks/useGroupDrag/utils.d.ts +13 -0
- package/dist/src/sub/DynamicLayout/sections/CustomSection/hooks/useGroupDrag/utils.js +127 -0
- package/dist/src/sub/DynamicLayout/sections/CustomSection/hooks/useIntersectionObserver.d.ts +1 -1
- package/dist/src/sub/DynamicLayout/sections/CustomSection/hooks/useIntersectionObserver.js +21 -9
- package/dist/src/sub/DynamicLayout/sections/CustomSection/types.d.ts +29 -7
- package/dist/src/sub/DynamicLayout/sections/CustomSection/util/parseJsonProperties.d.ts +1 -1
- package/dist/src/sub/DynamicLayout/sections/CustomSection/util/parsePlacement.js +2 -2
- package/dist/src/sub/DynamicLayout/sections/CustomSection/util/types.d.ts +3 -0
- package/dist/src/sub/DynamicLayout/types.d.ts +25 -19
- package/dist/src/sub/DynamicLayout/utils/deepCopy.d.ts +1 -0
- package/dist/src/sub/DynamicLayout/utils/deepCopy.js +15 -0
- package/package.json +2 -2
- package/release-note.md +19 -25
- package/dist/src/sub/DynamicLayout/mock_customSection.d.ts +0 -2
- package/dist/src/sub/DynamicLayout/mock_customSection.js +0 -840
- package/dist/src/sub/DynamicLayout/nakedMocks.json +0 -847
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import type { DynamicLayoutProps } from './types';
|
|
3
|
-
declare function DynamicLayout({ device, mode, isPreview, sections, scrollDownTargetSectionId, editingSectionId, navigationHandler, sectionActionHandler, onClickEditSection, programmedSectionComponents }: DynamicLayoutProps): JSX.Element;
|
|
3
|
+
declare function DynamicLayout({ device, mode, isPreview, sections, scrollDownTargetSectionId, editingSectionId, navigationHandler, sectionActionHandler, onClickEditSection, programmedSectionComponents, shortcutKeyMode, dynamicLayoutRef }: DynamicLayoutProps): JSX.Element;
|
|
4
4
|
export default DynamicLayout;
|
|
@@ -25,7 +25,7 @@ var EditModeSectionMatcher_1 = require("./components/EditModeSectionMatcher");
|
|
|
25
25
|
var SectionMatcher_1 = require("./components/SectionMatcher");
|
|
26
26
|
var dynamicLayoutContext_1 = require("./dynamicLayoutContext");
|
|
27
27
|
function DynamicLayout(_a) {
|
|
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;
|
|
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;
|
|
29
29
|
var filteredSortedSection = __spreadArray([], sections, true).filter(function (section) { return section.display; })
|
|
30
30
|
.sort(function (a, b) { return a.order - b.order; });
|
|
31
31
|
var iframeSection = filteredSortedSection.find(function (section) { return section.manifest.schema === 'EXP_IFRAME' && section.display; });
|
|
@@ -36,8 +36,9 @@ function DynamicLayout(_a) {
|
|
|
36
36
|
navigationHandler: navigationHandler,
|
|
37
37
|
sectionActionHandler: sectionActionHandler,
|
|
38
38
|
editingSectionId: editingSectionId,
|
|
39
|
-
programmedSectionComponents: programmedSectionComponents
|
|
40
|
-
|
|
39
|
+
programmedSectionComponents: programmedSectionComponents,
|
|
40
|
+
shortcutKeyMode: shortcutKeyMode
|
|
41
|
+
} }, { children: [mode === 'EDIT' && onClickEditSection && ((0, jsx_runtime_1.jsx)(EditModeSectionMatcher_1.EditModeSectionMatcher, { dynamicLayoutRef: dynamicLayoutRef, editingSectionId: editingSectionId, scrollDownTargetSectionId: scrollDownTargetSectionId, filteredSortedSection: filteredSortedSection, onClickEditSection: onClickEditSection })), mode !== 'EDIT' &&
|
|
41
42
|
(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); })))] })));
|
|
42
43
|
}
|
|
43
44
|
exports.default = DynamicLayout;
|
package/dist/src/sub/DynamicLayout/components/EditModeSectionMatcher/EditModeSectionMatcher.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import type { ISection } from '../../types';
|
|
3
|
-
export default function EditModeSectionMatcher({ filteredSortedSection, scrollDownTargetSectionId, editingSectionId, onClickEditSection }: {
|
|
2
|
+
import type { DynamicLayoutProps, ISection } from '../../types';
|
|
3
|
+
export default function EditModeSectionMatcher({ filteredSortedSection, scrollDownTargetSectionId, editingSectionId, dynamicLayoutRef, onClickEditSection }: {
|
|
4
4
|
filteredSortedSection: ISection[];
|
|
5
5
|
scrollDownTargetSectionId?: number;
|
|
6
6
|
editingSectionId?: number;
|
|
7
|
+
dynamicLayoutRef: DynamicLayoutProps['dynamicLayoutRef'];
|
|
7
8
|
onClickEditSection: (section: ISection) => void;
|
|
8
9
|
}): JSX.Element;
|
package/dist/src/sub/DynamicLayout/components/EditModeSectionMatcher/EditModeSectionMatcher.js
CHANGED
|
@@ -26,19 +26,31 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
26
26
|
};
|
|
27
27
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
28
28
|
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
29
|
+
var react_1 = require("react");
|
|
29
30
|
var sections_1 = require("../../../DynamicLayout/sections");
|
|
30
31
|
var SectionBox_1 = __importDefault(require("./SectionBox"));
|
|
31
32
|
function EditModeSectionMatcher(_a) {
|
|
32
|
-
var filteredSortedSection = _a.filteredSortedSection, scrollDownTargetSectionId = _a.scrollDownTargetSectionId, editingSectionId = _a.editingSectionId, onClickEditSection = _a.onClickEditSection;
|
|
33
|
+
var filteredSortedSection = _a.filteredSortedSection, scrollDownTargetSectionId = _a.scrollDownTargetSectionId, editingSectionId = _a.editingSectionId, dynamicLayoutRef = _a.dynamicLayoutRef, onClickEditSection = _a.onClickEditSection;
|
|
33
34
|
var iframeSection = filteredSortedSection.find(function (section) { return section.manifest.schema === 'EXP_IFRAME' && section.display; });
|
|
34
|
-
|
|
35
|
+
var _b = (0, react_1.useState)(null), selectedSectionRef = _b[0], setSelectedSectionRef = _b[1];
|
|
36
|
+
var refCallback = (0, react_1.useCallback)(function (node) {
|
|
37
|
+
setSelectedSectionRef(node);
|
|
38
|
+
}, []);
|
|
39
|
+
(0, react_1.useImperativeHandle)(dynamicLayoutRef, function () {
|
|
40
|
+
return {
|
|
41
|
+
selectCB: function (cb) {
|
|
42
|
+
selectedSectionRef === null || selectedSectionRef === void 0 ? void 0 : selectedSectionRef.selectCB(cb);
|
|
43
|
+
},
|
|
44
|
+
selectCBInBulk: function (cbIds) {
|
|
45
|
+
selectedSectionRef === null || selectedSectionRef === void 0 ? void 0 : selectedSectionRef.selectCBInBulk(cbIds);
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
}, [selectedSectionRef]);
|
|
49
|
+
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)); })) }));
|
|
35
50
|
}
|
|
36
51
|
exports.default = EditModeSectionMatcher;
|
|
37
|
-
function
|
|
52
|
+
function DesignedSectionsMatcher(_a) {
|
|
38
53
|
var props = __rest(_a, []);
|
|
39
|
-
if (props.type === 'CUSTOM') {
|
|
40
|
-
return (0, jsx_runtime_1.jsx)(sections_1.CustomSection, __assign({}, props));
|
|
41
|
-
}
|
|
42
54
|
var schema = props.manifest.schema;
|
|
43
55
|
switch (schema) {
|
|
44
56
|
case 'BASE_INTRO':
|
|
@@ -30,8 +30,9 @@ function CustomSectionBackground(_a) {
|
|
|
30
30
|
var context = (0, react_1.useContext)(sectionContext_1.sectionContext);
|
|
31
31
|
var id = context.id, jsonProperties = context.jsonProperties;
|
|
32
32
|
var backgroundRef = (0, react_1.useRef)(null);
|
|
33
|
-
var
|
|
34
|
-
var
|
|
33
|
+
var data = jsonProperties.data;
|
|
34
|
+
var CB_STYLE_PROP_BGOVERLAY = data.CB_STYLE_PROP_BGOVERLAY, CB_STYLE_PROP_BGMEDIA = data.CB_STYLE_PROP_BGMEDIA;
|
|
35
|
+
var _c = (0, util_1.parseJsonProperties)(data, isMobile ? 'MOBILE' : 'DESKTOP'), style = _c.style, overlayStyle = _c.overlayStyle, effect = _c.effect;
|
|
35
36
|
var isOverlay = getIsOverlay(isMobile, CB_STYLE_PROP_BGOVERLAY);
|
|
36
37
|
var isBgMedia = getIsBgMedia(isMobile, CB_STYLE_PROP_BGMEDIA);
|
|
37
38
|
var mediaType = getMediaType(isMobile, CB_STYLE_PROP_BGMEDIA);
|
package/dist/src/sub/DynamicLayout/hooks/useCustomSectionShortcut/useCustomSectionShortcut.d.ts
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare const CUSTOMSECTION_SHORTCUT_KEYS: string[];
|
|
2
|
+
export type CustomSectionShortcutType = 'BULK_SELECT' | 'COLLISION_SELECT' | 'SELECT_ALL' | null;
|
|
3
|
+
declare function useCustomSectionShortcut(): {
|
|
4
|
+
shortcut: CustomSectionShortcutType;
|
|
5
|
+
};
|
|
6
|
+
export default useCustomSectionShortcut;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CUSTOMSECTION_SHORTCUT_KEYS = void 0;
|
|
4
|
+
var react_1 = require("react");
|
|
5
|
+
exports.CUSTOMSECTION_SHORTCUT_KEYS = ['Shift', 'Meta', 'A', 'ㅁ'];
|
|
6
|
+
function useCustomSectionShortcut() {
|
|
7
|
+
var _a = (0, react_1.useState)(null), shortcut = _a[0], setShortcut = _a[1];
|
|
8
|
+
(0, react_1.useEffect)(function () {
|
|
9
|
+
var keys = new Map();
|
|
10
|
+
function onKeyDown(e) {
|
|
11
|
+
if (!exports.CUSTOMSECTION_SHORTCUT_KEYS.includes(e.key)) {
|
|
12
|
+
return;
|
|
13
|
+
}
|
|
14
|
+
keys.set(e.key, true);
|
|
15
|
+
var isShiftOn = keys.get('Shift');
|
|
16
|
+
var isMetaOn = keys.get('Meta');
|
|
17
|
+
var isAOn = keys.get('A') || keys.get('ㅁ');
|
|
18
|
+
if (isShiftOn && isAOn) {
|
|
19
|
+
setShortcut('SELECT_ALL');
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
if (isShiftOn && isMetaOn) {
|
|
23
|
+
setShortcut('COLLISION_SELECT');
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
if (isShiftOn) {
|
|
27
|
+
setShortcut('BULK_SELECT');
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
function onKeyUp(e) {
|
|
31
|
+
if (e.key === 'a') {
|
|
32
|
+
keys.delete('A');
|
|
33
|
+
}
|
|
34
|
+
else {
|
|
35
|
+
keys.delete(e.key);
|
|
36
|
+
}
|
|
37
|
+
setShortcut(null);
|
|
38
|
+
}
|
|
39
|
+
document.addEventListener('keydown', onKeyDown);
|
|
40
|
+
document.addEventListener('keyup', onKeyUp);
|
|
41
|
+
return function () {
|
|
42
|
+
document.removeEventListener('keydown', onKeyDown);
|
|
43
|
+
document.removeEventListener('keyup', onKeyUp);
|
|
44
|
+
};
|
|
45
|
+
}, []);
|
|
46
|
+
return {
|
|
47
|
+
shortcut: shortcut
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
exports.default = useCustomSectionShortcut;
|