pds-dev-kit-web-test 2.2.48 → 2.2.61
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/common/assets/icons/fill/Home.d.ts +4 -0
- package/dist/src/common/assets/icons/fill/Home.js +30 -0
- package/dist/src/common/assets/icons/fill/PappType.d.ts +4 -0
- package/dist/src/common/assets/icons/fill/PappType.js +30 -0
- package/dist/src/common/assets/icons/fill/Plan.d.ts +4 -0
- package/dist/src/common/assets/icons/fill/Plan.js +30 -0
- package/dist/src/common/assets/icons/fill/Sales.d.ts +4 -0
- package/dist/src/common/assets/icons/fill/Sales.js +30 -0
- package/dist/src/common/assets/icons/fill/SellerIntro.d.ts +4 -0
- package/dist/src/common/assets/icons/fill/SellerIntro.js +30 -0
- package/dist/src/common/assets/icons/fill/Shoppingbag.d.ts +4 -0
- package/dist/src/common/assets/icons/fill/Shoppingbag.js +30 -0
- package/dist/src/common/assets/icons/fill/Site.d.ts +4 -0
- package/dist/src/common/assets/icons/fill/Site.js +30 -0
- package/dist/src/common/assets/icons/fill/StarShaped.d.ts +4 -0
- package/dist/src/common/assets/icons/fill/StarShaped.js +30 -0
- package/dist/src/common/assets/icons/fill/Target.d.ts +4 -0
- package/dist/src/common/assets/icons/fill/Target.js +30 -0
- package/dist/src/common/assets/icons/fill/User.d.ts +4 -0
- package/dist/src/common/assets/icons/fill/User.js +30 -0
- package/dist/src/common/assets/icons/fill/Xmark.d.ts +4 -0
- package/dist/src/common/assets/icons/fill/Xmark.js +30 -0
- package/dist/src/common/assets/icons/fill/index.d.ts +11 -0
- package/dist/src/common/assets/icons/fill/index.js +23 -1
- package/dist/src/common/assets/icons/line/Site.d.ts +4 -0
- package/dist/src/common/assets/icons/line/Site.js +30 -0
- package/dist/src/common/assets/icons/line/StarShaped.d.ts +4 -0
- package/dist/src/common/assets/icons/line/StarShaped.js +30 -0
- package/dist/src/common/assets/icons/line/Ticket.d.ts +4 -0
- package/dist/src/common/assets/icons/line/Ticket.js +30 -0
- package/dist/src/common/assets/icons/line/User.d.ts +4 -0
- package/dist/src/common/assets/icons/line/User.js +30 -0
- package/dist/src/common/assets/icons/line/index.d.ts +4 -0
- package/dist/src/common/assets/icons/line/index.js +8 -0
- package/dist/src/common/services/i18n/resources/en.json +2 -1
- package/dist/src/common/services/i18n/resources/es.json +2 -1
- package/dist/src/common/services/i18n/resources/fil.json +2 -1
- package/dist/src/common/services/i18n/resources/index.d.ts +7 -0
- package/dist/src/common/services/i18n/resources/ja.json +2 -1
- package/dist/src/common/services/i18n/resources/ko.json +2 -1
- package/dist/src/common/services/i18n/resources/zh-cn.json +2 -1
- package/dist/src/common/services/i18n/resources/zh-tw.json +2 -1
- package/dist/src/common/styles/colorSet/PaletteColor_Dark.json +6 -1
- package/dist/src/common/styles/colorSet/PaletteColor_light.json +7 -2
- package/dist/src/common/styles/colorSet/UIColor.json +8 -1
- package/dist/src/common/styles/colorSet/index.d.ts +19 -2
- package/dist/src/common/styles/colorSet/index.js +2 -2
- package/dist/src/common/styles/colorSet/ui-type.d.ts +7 -0
- package/dist/src/common/types/components.d.ts +1 -0
- package/dist/src/desktop/components/BasicListItem/RightBox/MainButton.js +1 -2
- package/dist/src/desktop/components/BasicListItem/RightBox/Switch.js +1 -1
- package/dist/src/desktop/components/ContextMenuItem/ContextMenuItem.js +17 -5
- package/dist/src/desktop/components/DesktopAlertDialog/DesktopAlertDialog.js +6 -1
- package/dist/src/desktop/components/DesktopHeaderBar/DesktopHeaderBar.js +1 -1
- package/dist/src/desktop/components/DynamicDesktopNavBar/blocks/SecondaryMenu.js +68 -3
- package/dist/src/desktop/components/DynamicDesktopNavBar/templates/DynamicDesktopNavBarTemplates.d.ts +0 -1
- package/dist/src/desktop/components/DynamicDesktopNavBar/templates/constants.d.ts +0 -1
- package/dist/src/desktop/components/DynamicDesktopNavBar/templates/constants.js +5 -6
- package/dist/src/desktop/components/TextButton/TextButton.d.ts +3 -2
- package/dist/src/desktop/components/TextButton/TextButton.js +15 -2
- package/dist/src/desktop/panels/DesktopTutorialModal/DesktopTutorialModal.d.ts +2 -1
- package/dist/src/desktop/panels/DesktopTutorialModal/DesktopTutorialModal.js +20 -9
- package/dist/src/mobile/components/BasicListItem/RightBox/MainButton.js +1 -2
- package/dist/src/mobile/components/BasicListItem/RightBox/Switch.js +1 -1
- package/dist/src/mobile/components/ContextMenuItem/ContextMenuItem.js +15 -3
- 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 +2467 -2
- package/dist/src/sub/DynamicLayout/pagesPreviewMock.js +4321 -15
- 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 +292 -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 +14 -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/Embed/Embed.d.ts +5 -0
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/Embed/Embed.js +48 -0
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/Embed/EmbedIframe.d.ts +8 -0
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/Embed/EmbedIframe.js +45 -0
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/Embed/IframeDenied.d.ts +3 -0
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/Embed/IframeDenied.js +21 -0
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/Embed/constant.d.ts +1 -0
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/Embed/constant.js +9 -0
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/Embed/types.d.ts +6 -0
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/Embed/types.js +2 -0
- 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 +6 -3
- 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/components/ComponentBlock/componentBlocks/types.d.ts +3 -0
- 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 +40 -11
- package/dist/src/sub/DynamicLayout/sections/CustomSection/types.js +1 -0
- 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/parseProperties.d.ts +2 -2
- package/dist/src/sub/DynamicLayout/sections/CustomSection/util/types.d.ts +14 -1
- 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 +6 -7
- 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
- package/webhook/node_modules/esrecurse/.babelrc +0 -3
|
@@ -0,0 +1,273 @@
|
|
|
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
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
14
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
15
|
+
if (ar || !(i in from)) {
|
|
16
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
17
|
+
ar[i] = from[i];
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
21
|
+
};
|
|
22
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
23
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.filterItemsById = exports.getGroupCB = void 0;
|
|
27
|
+
// eslint-disable-next-line import/no-extraneous-dependencies
|
|
28
|
+
var renderHelpers_1 = require("publ-echo/dist/lib/GridLayoutEditor/utils/renderHelpers");
|
|
29
|
+
var react_1 = require("react");
|
|
30
|
+
var deepCopy_1 = __importDefault(require("../../../../../DynamicLayout/utils/deepCopy"));
|
|
31
|
+
var utils_1 = require("./utils");
|
|
32
|
+
function useGroupDrag(_a) {
|
|
33
|
+
var device = _a.device, setLayouts = _a.setLayouts, sectionActionHandler = _a.sectionActionHandler;
|
|
34
|
+
var layoutByDevice = device === 'DESKTOP' ? 'lg' : 'sm';
|
|
35
|
+
function makeAllInOneGroup() {
|
|
36
|
+
setLayouts(function (prev) {
|
|
37
|
+
var _a, _b;
|
|
38
|
+
var _c;
|
|
39
|
+
// TODO: 임시용 카피
|
|
40
|
+
var currentLayoutCopy = (0, deepCopy_1.default)(prev[layoutByDevice]);
|
|
41
|
+
if (currentLayoutCopy.length === 0) {
|
|
42
|
+
return prev;
|
|
43
|
+
}
|
|
44
|
+
var groupIdx = currentLayoutCopy.findIndex(function (item) { return item.i === 'group'; });
|
|
45
|
+
// NOTE: 그룹이 없는 경우
|
|
46
|
+
if (groupIdx < 0) {
|
|
47
|
+
var group_1 = (0, utils_1.getGroupForMultiple)(currentLayoutCopy);
|
|
48
|
+
sectionActionHandler &&
|
|
49
|
+
sectionActionHandler({
|
|
50
|
+
type: '@CUSTOMSECTION/GROUP_CREATED',
|
|
51
|
+
payload: {
|
|
52
|
+
message: 'group generated',
|
|
53
|
+
data: group_1
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
return __assign(__assign({}, prev), (_a = {}, _a[layoutByDevice] = [group_1], _a));
|
|
57
|
+
}
|
|
58
|
+
// NOTE: 그룹이 이미 있는경우
|
|
59
|
+
var groupItem = currentLayoutCopy.splice(groupIdx, 1)[0];
|
|
60
|
+
if (!groupItem.groupLayouts) {
|
|
61
|
+
return prev;
|
|
62
|
+
}
|
|
63
|
+
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 : [];
|
|
64
|
+
currentLayoutCopy.push.apply(currentLayoutCopy, groupItems);
|
|
65
|
+
var group = (0, utils_1.getGroupForMultiple)(currentLayoutCopy);
|
|
66
|
+
sectionActionHandler &&
|
|
67
|
+
sectionActionHandler({
|
|
68
|
+
type: '@CUSTOMSECTION/GROUP_CREATED',
|
|
69
|
+
payload: {
|
|
70
|
+
message: 'group generated',
|
|
71
|
+
data: group
|
|
72
|
+
}
|
|
73
|
+
});
|
|
74
|
+
return __assign(__assign({}, prev), (_b = {}, _b[layoutByDevice] = [group], _b));
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
function escapeFromGroup(id) {
|
|
78
|
+
setLayouts(function (prev) {
|
|
79
|
+
var _a;
|
|
80
|
+
// TODO: 임시용 카피
|
|
81
|
+
var currentLayoutCopy = (0, deepCopy_1.default)(prev[layoutByDevice]);
|
|
82
|
+
var groupIdx = currentLayoutCopy.findIndex(function (item) { return item.i === 'group'; });
|
|
83
|
+
var group = currentLayoutCopy[groupIdx];
|
|
84
|
+
if (!group || !group.groupLayouts) {
|
|
85
|
+
return prev;
|
|
86
|
+
}
|
|
87
|
+
var escapeIndex = group.groupLayouts.findIndex(function (each) { return each.i === id; });
|
|
88
|
+
if (escapeIndex < 0) {
|
|
89
|
+
return prev;
|
|
90
|
+
}
|
|
91
|
+
var escapedItem = group.groupLayouts.splice(escapeIndex, 1)[0];
|
|
92
|
+
escapedItem.x += group.x;
|
|
93
|
+
escapedItem.y += group.y;
|
|
94
|
+
currentLayoutCopy.push(escapedItem);
|
|
95
|
+
var newGroup = (0, utils_1.recalculatedGroup)(group);
|
|
96
|
+
currentLayoutCopy.splice(groupIdx, 1, newGroup);
|
|
97
|
+
sectionActionHandler &&
|
|
98
|
+
sectionActionHandler({
|
|
99
|
+
type: '@CUSTOMSECTION/ESCAPE_ONE_FROM_GROUP',
|
|
100
|
+
payload: {
|
|
101
|
+
id: id
|
|
102
|
+
}
|
|
103
|
+
});
|
|
104
|
+
return __assign(__assign({}, prev), (_a = {}, _a[layoutByDevice] = currentLayoutCopy, _a));
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
function setGroupCB(selectedId, newId) {
|
|
108
|
+
setLayouts(function (prev) {
|
|
109
|
+
var _a;
|
|
110
|
+
var currentLayoutCopy = (0, deepCopy_1.default)(prev[layoutByDevice]);
|
|
111
|
+
var firstIdx = currentLayoutCopy.findIndex(function (item) {
|
|
112
|
+
if (selectedId === 'group') {
|
|
113
|
+
return item.i === 'group';
|
|
114
|
+
}
|
|
115
|
+
if (Number(item.i) === selectedId) {
|
|
116
|
+
return true;
|
|
117
|
+
}
|
|
118
|
+
return false;
|
|
119
|
+
});
|
|
120
|
+
var firstElem = currentLayoutCopy.splice(firstIdx, 1)[0];
|
|
121
|
+
var secondIdx = currentLayoutCopy.findIndex(function (item) { return Number(item.i) === newId; });
|
|
122
|
+
var secondElem = currentLayoutCopy.splice(secondIdx, 1)[0];
|
|
123
|
+
var group = (0, utils_1.getGroupData)(firstElem, secondElem);
|
|
124
|
+
currentLayoutCopy.unshift(group);
|
|
125
|
+
sectionActionHandler &&
|
|
126
|
+
sectionActionHandler({
|
|
127
|
+
type: '@CUSTOMSECTION/GROUP_CREATED',
|
|
128
|
+
payload: {
|
|
129
|
+
message: 'group generated',
|
|
130
|
+
data: group
|
|
131
|
+
}
|
|
132
|
+
});
|
|
133
|
+
return __assign(__assign({}, prev), (_a = {}, _a[layoutByDevice] = currentLayoutCopy, _a));
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
var breakGroupCB = (0, react_1.useCallback)(function () {
|
|
137
|
+
setLayouts(function (prev) {
|
|
138
|
+
var _a;
|
|
139
|
+
var _b;
|
|
140
|
+
// TODO: 임시용 카피
|
|
141
|
+
var currentLayoutCopy = (0, deepCopy_1.default)(prev[layoutByDevice]);
|
|
142
|
+
var groupIdx = currentLayoutCopy.findIndex(function (item) { return item.i === 'group'; });
|
|
143
|
+
if (groupIdx < 0) {
|
|
144
|
+
return prev;
|
|
145
|
+
}
|
|
146
|
+
var groupItem = currentLayoutCopy.splice(groupIdx, 1)[0];
|
|
147
|
+
if (!groupItem.groupLayouts) {
|
|
148
|
+
return prev;
|
|
149
|
+
}
|
|
150
|
+
var groupItems = (_b = groupItem.groupLayouts.map(function (each) { return (__assign(__assign({}, each), { x: groupItem.x + each.x, y: groupItem.y + each.y })); })) !== null && _b !== void 0 ? _b : [];
|
|
151
|
+
currentLayoutCopy.push.apply(currentLayoutCopy, groupItems);
|
|
152
|
+
return __assign(__assign({}, prev), (_a = {}, _a[layoutByDevice] = currentLayoutCopy, _a));
|
|
153
|
+
});
|
|
154
|
+
sectionActionHandler &&
|
|
155
|
+
sectionActionHandler({
|
|
156
|
+
type: '@CUSTOMSECTION/GROUP_DISMISSED',
|
|
157
|
+
payload: {
|
|
158
|
+
message: 'group dismissed'
|
|
159
|
+
}
|
|
160
|
+
});
|
|
161
|
+
}, []);
|
|
162
|
+
function makeCollisionGroup(id, selectedCBId) {
|
|
163
|
+
setLayouts(function (prev) {
|
|
164
|
+
var _a, _b;
|
|
165
|
+
var _c, _d;
|
|
166
|
+
var currentLayoutCopy = (0, deepCopy_1.default)(prev[layoutByDevice]);
|
|
167
|
+
var additionalSelectedCBLayout = (function () {
|
|
168
|
+
if (selectedCBId === undefined) {
|
|
169
|
+
return null;
|
|
170
|
+
}
|
|
171
|
+
if (id === selectedCBId) {
|
|
172
|
+
return null;
|
|
173
|
+
}
|
|
174
|
+
return (0, renderHelpers_1.getLayoutItem)(currentLayoutCopy, selectedCBId.toString());
|
|
175
|
+
})();
|
|
176
|
+
var layout = (0, renderHelpers_1.getLayoutItem)(currentLayoutCopy, id.toString());
|
|
177
|
+
if (!layout) {
|
|
178
|
+
return prev;
|
|
179
|
+
}
|
|
180
|
+
var prevGroupIdx = currentLayoutCopy.findIndex(function (item) { return item.i === 'group'; });
|
|
181
|
+
if (prevGroupIdx < 0) {
|
|
182
|
+
var collisions = (0, renderHelpers_1.getAllCollisions)(currentLayoutCopy, layout);
|
|
183
|
+
var groupLayouts = __spreadArray([layout], collisions, true);
|
|
184
|
+
if (collisions.length === 0 && !additionalSelectedCBLayout) {
|
|
185
|
+
sectionActionHandler &&
|
|
186
|
+
sectionActionHandler({
|
|
187
|
+
type: '@CUSTOMSECTION/COLLISION_NOT_FOUND',
|
|
188
|
+
payload: {
|
|
189
|
+
message: '겹치는 부분이 없어, 아무련 변화가 없습니다.'
|
|
190
|
+
}
|
|
191
|
+
});
|
|
192
|
+
return prev;
|
|
193
|
+
}
|
|
194
|
+
if (additionalSelectedCBLayout) {
|
|
195
|
+
var alreadyHas = collisions.some(function (each) { return each.i === additionalSelectedCBLayout.i; });
|
|
196
|
+
!alreadyHas && groupLayouts.push(additionalSelectedCBLayout);
|
|
197
|
+
}
|
|
198
|
+
var group_2 = (0, utils_1.getGroupForMultiple)(groupLayouts);
|
|
199
|
+
var filtered = currentLayoutCopy.filter(function (layout) { return !group_2.childrenIds.includes(layout.i); });
|
|
200
|
+
sectionActionHandler &&
|
|
201
|
+
sectionActionHandler({
|
|
202
|
+
type: '@CUSTOMSECTION/GROUP_CREATED',
|
|
203
|
+
payload: {
|
|
204
|
+
message: 'group generated with collision detect',
|
|
205
|
+
data: group_2
|
|
206
|
+
}
|
|
207
|
+
});
|
|
208
|
+
return __assign(__assign({}, prev), (_a = {}, _a[layoutByDevice] = __spreadArray([group_2], filtered, true), _a));
|
|
209
|
+
}
|
|
210
|
+
var groupItem = currentLayoutCopy.splice(prevGroupIdx, 1)[0];
|
|
211
|
+
if (groupItem) {
|
|
212
|
+
var collisions = (0, renderHelpers_1.getAllCollisions)(currentLayoutCopy, layout);
|
|
213
|
+
var groupItems = (_d = (_c = groupItem.groupLayouts) === null || _c === void 0 ? void 0 : _c.map(function (each) { return (__assign(__assign({}, each), { x: groupItem.x + each.x, y: groupItem.y + each.y })); })) !== null && _d !== void 0 ? _d : [];
|
|
214
|
+
var newGroup_1 = (0, utils_1.getGroupForMultiple)([layout].concat(collisions).concat(groupItems));
|
|
215
|
+
var filtered = currentLayoutCopy.filter(function (layout) { return !newGroup_1.childrenIds.includes(layout.i); });
|
|
216
|
+
sectionActionHandler &&
|
|
217
|
+
sectionActionHandler({
|
|
218
|
+
type: '@CUSTOMSECTION/GROUP_CREATED',
|
|
219
|
+
payload: {
|
|
220
|
+
message: 'group generated with collision detect',
|
|
221
|
+
data: newGroup_1
|
|
222
|
+
}
|
|
223
|
+
});
|
|
224
|
+
return __assign(__assign({}, prev), (_b = {}, _b[layoutByDevice] = __spreadArray([newGroup_1], filtered, true), _b));
|
|
225
|
+
}
|
|
226
|
+
return prev;
|
|
227
|
+
});
|
|
228
|
+
}
|
|
229
|
+
function makeCollisionOfBulk() {
|
|
230
|
+
setLayouts(function (prev) {
|
|
231
|
+
var _a;
|
|
232
|
+
var _b, _c;
|
|
233
|
+
var currentLayoutCopy = (0, deepCopy_1.default)(prev[layoutByDevice]);
|
|
234
|
+
var prevGroupIdx = currentLayoutCopy.findIndex(function (item) { return item.i === 'group'; });
|
|
235
|
+
var groupItem = currentLayoutCopy.splice(prevGroupIdx, 1)[0];
|
|
236
|
+
var collisions = (0, renderHelpers_1.getAllCollisions)(currentLayoutCopy, groupItem);
|
|
237
|
+
var groupItems = (_c = (_b = groupItem.groupLayouts) === null || _b === void 0 ? void 0 : _b.map(function (each) { return (__assign(__assign({}, each), { x: groupItem.x + each.x, y: groupItem.y + each.y })); })) !== null && _c !== void 0 ? _c : [];
|
|
238
|
+
var newGroup = (0, utils_1.getGroupForMultiple)(groupItems.concat(collisions));
|
|
239
|
+
var filtered = currentLayoutCopy.filter(function (layout) { return !newGroup.childrenIds.includes(layout.i); });
|
|
240
|
+
sectionActionHandler &&
|
|
241
|
+
sectionActionHandler({
|
|
242
|
+
type: '@CUSTOMSECTION/GROUP_CREATED',
|
|
243
|
+
payload: {
|
|
244
|
+
message: 'group generated with collision detect',
|
|
245
|
+
data: newGroup
|
|
246
|
+
}
|
|
247
|
+
});
|
|
248
|
+
return __assign(__assign({}, prev), (_a = {}, _a[layoutByDevice] = __spreadArray([newGroup], filtered, true), _a));
|
|
249
|
+
});
|
|
250
|
+
}
|
|
251
|
+
return {
|
|
252
|
+
setGroupCB: setGroupCB,
|
|
253
|
+
breakGroupCB: breakGroupCB,
|
|
254
|
+
makeAllInOneGroup: makeAllInOneGroup,
|
|
255
|
+
escapeFromGroup: escapeFromGroup,
|
|
256
|
+
makeCollisionGroup: makeCollisionGroup,
|
|
257
|
+
makeCollisionOfBulk: makeCollisionOfBulk
|
|
258
|
+
};
|
|
259
|
+
}
|
|
260
|
+
function getGroupCB(layout) {
|
|
261
|
+
var groupIdx = layout.findIndex(function (item) { return item.i === 'group'; });
|
|
262
|
+
if (groupIdx < 0) {
|
|
263
|
+
return null;
|
|
264
|
+
}
|
|
265
|
+
var groupItem = layout[groupIdx];
|
|
266
|
+
return groupItem;
|
|
267
|
+
}
|
|
268
|
+
exports.getGroupCB = getGroupCB;
|
|
269
|
+
var filterItemsById = function (layout, idsToRemove) {
|
|
270
|
+
return layout.filter(function (item) { return !idsToRemove.includes(item.i); });
|
|
271
|
+
};
|
|
272
|
+
exports.filterItemsById = filterItemsById;
|
|
273
|
+
exports.default = useGroupDrag;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { ComponentBlock } from '../../types';
|
|
2
|
+
import type { LayoutItem } from 'publ-echo/dist/lib';
|
|
3
|
+
export interface LayoutItemWithGroupType extends LayoutItem {
|
|
4
|
+
childrenIds: string[];
|
|
5
|
+
keepInLastIndex?: boolean;
|
|
6
|
+
}
|
|
7
|
+
export declare function getGroupData(elem1: LayoutItemWithGroupType, elem2: LayoutItemWithGroupType): LayoutItemWithGroupType;
|
|
8
|
+
export declare function recalculatedGroup(group: LayoutItemWithGroupType): LayoutItemWithGroupType;
|
|
9
|
+
export declare function getGroupForMultiple(elems: LayoutItem[]): LayoutItemWithGroupType;
|
|
10
|
+
export declare function splitComponentBlocksByGroup(componentBlocks: ComponentBlock[], groupIds: string[]): {
|
|
11
|
+
inGroup: ComponentBlock[];
|
|
12
|
+
notInGroup: ComponentBlock[];
|
|
13
|
+
};
|
|
@@ -0,0 +1,127 @@
|
|
|
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
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
14
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
15
|
+
if (ar || !(i in from)) {
|
|
16
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
17
|
+
ar[i] = from[i];
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
21
|
+
};
|
|
22
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
23
|
+
exports.splitComponentBlocksByGroup = exports.getGroupForMultiple = exports.recalculatedGroup = exports.getGroupData = void 0;
|
|
24
|
+
function getGroupData(elem1, elem2) {
|
|
25
|
+
var _a, _b;
|
|
26
|
+
var minX = Math.min(elem1.x, elem2.x);
|
|
27
|
+
var minY = Math.min(elem1.y, elem2.y);
|
|
28
|
+
var elem1W = elem1.x - minX + elem1.w;
|
|
29
|
+
var elem2W = elem2.x - minX + elem2.w;
|
|
30
|
+
var elem1H = elem1.y - minY + elem1.h;
|
|
31
|
+
var elem2H = elem2.y - minY + elem2.h;
|
|
32
|
+
// NOTE: maxW, maxH 이름 변경 필요.
|
|
33
|
+
var maxW = Math.max(elem1W, elem2W);
|
|
34
|
+
var maxH = Math.max(elem1H, elem2H);
|
|
35
|
+
var maxZ = Math.max((_a = elem1 === null || elem1 === void 0 ? void 0 : elem1.z) !== null && _a !== void 0 ? _a : 0, (_b = elem2 === null || elem2 === void 0 ? void 0 : elem2.z) !== null && _b !== void 0 ? _b : 0);
|
|
36
|
+
var elem1InnerData = __assign(__assign({}, elem1), { x: elem1.x - minX, y: elem1.y - minY });
|
|
37
|
+
var elem2InnerData = __assign(__assign({}, elem2), { x: elem2.x - minX, y: elem2.y - minY });
|
|
38
|
+
var groupLayouts = elem1.groupLayouts
|
|
39
|
+
? getAdaptedGroupLayouts(elem1.groupLayouts, elem2InnerData, elem1, minX, minY)
|
|
40
|
+
: [elem1InnerData, elem2InnerData];
|
|
41
|
+
var childrenIds = elem1.groupLayouts ? __spreadArray(__spreadArray([], elem1.childrenIds, true), [elem2.i], false) : [elem1.i, elem2.i];
|
|
42
|
+
return {
|
|
43
|
+
i: 'group',
|
|
44
|
+
x: minX,
|
|
45
|
+
y: minY,
|
|
46
|
+
w: maxW,
|
|
47
|
+
h: maxH,
|
|
48
|
+
z: maxZ,
|
|
49
|
+
groupLayouts: groupLayouts,
|
|
50
|
+
childrenIds: childrenIds
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
exports.getGroupData = getGroupData;
|
|
54
|
+
function recalculatedGroup(group) {
|
|
55
|
+
var _a;
|
|
56
|
+
if (!group.groupLayouts) {
|
|
57
|
+
return group;
|
|
58
|
+
}
|
|
59
|
+
var groupItemsWithOrgPlacement = (_a = group.groupLayouts.map(function (each) { return (__assign(__assign({}, each), { x: group.x + each.x, y: group.y + each.y })); })) !== null && _a !== void 0 ? _a : [];
|
|
60
|
+
return getGroupForMultiple(groupItemsWithOrgPlacement);
|
|
61
|
+
}
|
|
62
|
+
exports.recalculatedGroup = recalculatedGroup;
|
|
63
|
+
function getGroupForMultiple(elems) {
|
|
64
|
+
if (elems.length === 0) {
|
|
65
|
+
throw new Error('Array must contain at least one element.');
|
|
66
|
+
}
|
|
67
|
+
var _a = elems.reduce(function (acc, elem, idx, arr) {
|
|
68
|
+
var _a, _b;
|
|
69
|
+
if (idx === arr.length - 1) {
|
|
70
|
+
return acc;
|
|
71
|
+
}
|
|
72
|
+
var elem1 = idx === 0 ? elem : acc;
|
|
73
|
+
var elem2 = arr[idx + 1];
|
|
74
|
+
var minX = Math.min(elem1.x, elem2.x);
|
|
75
|
+
var minY = Math.min(elem1.y, elem2.y);
|
|
76
|
+
var elem1W = elem1.x - minX + elem1.w;
|
|
77
|
+
var elem2W = elem2.x - minX + elem2.w;
|
|
78
|
+
var elem1H = elem1.y - minY + elem1.h;
|
|
79
|
+
var elem2H = elem2.y - minY + elem2.h;
|
|
80
|
+
var maxZ = Math.max((_a = elem1 === null || elem1 === void 0 ? void 0 : elem1.z) !== null && _a !== void 0 ? _a : 0, (_b = elem2 === null || elem2 === void 0 ? void 0 : elem2.z) !== null && _b !== void 0 ? _b : 0);
|
|
81
|
+
return {
|
|
82
|
+
x: Math.min(elem1.x, elem2.x),
|
|
83
|
+
y: Math.min(elem1.y, elem2.y),
|
|
84
|
+
w: Math.max(elem1W, elem2W),
|
|
85
|
+
h: Math.max(elem1H, elem2H),
|
|
86
|
+
z: maxZ
|
|
87
|
+
};
|
|
88
|
+
}, { x: 0, y: 0, w: 0, h: 0, z: 0 }), minX = _a.x, minY = _a.y, maxW = _a.w, maxH = _a.h, maxZ = _a.z;
|
|
89
|
+
var groupLayouts = elems.map(function (elem) { return (__assign(__assign({}, elem), { x: elem.x - minX, y: elem.y - minY })); });
|
|
90
|
+
var childrenIds = elems.map(function (elem) { return elem.i; });
|
|
91
|
+
return {
|
|
92
|
+
i: 'group',
|
|
93
|
+
x: minX,
|
|
94
|
+
y: minY,
|
|
95
|
+
w: maxW,
|
|
96
|
+
h: maxH,
|
|
97
|
+
z: maxZ,
|
|
98
|
+
groupLayouts: groupLayouts,
|
|
99
|
+
childrenIds: childrenIds
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
exports.getGroupForMultiple = getGroupForMultiple;
|
|
103
|
+
function getAdaptedGroupLayouts(originals, comming, ogWrapper, minX, minY) {
|
|
104
|
+
var ogs = originals.map(function (og) {
|
|
105
|
+
var xNagativeGap = Math.max(0, ogWrapper.x - minX);
|
|
106
|
+
var yNagativeGap = Math.max(0, ogWrapper.y - minY);
|
|
107
|
+
return __assign(__assign({}, og), { x: og.x + xNagativeGap, y: og.y + yNagativeGap });
|
|
108
|
+
});
|
|
109
|
+
return __spreadArray(__spreadArray([], ogs, true), [comming], false);
|
|
110
|
+
}
|
|
111
|
+
function splitComponentBlocksByGroup(componentBlocks, groupIds) {
|
|
112
|
+
var inGroup = [];
|
|
113
|
+
var notInGroup = [];
|
|
114
|
+
componentBlocks.forEach(function (cb) {
|
|
115
|
+
if (groupIds.includes(cb.id.toString())) {
|
|
116
|
+
inGroup.push(cb);
|
|
117
|
+
}
|
|
118
|
+
else {
|
|
119
|
+
notInGroup.push(cb);
|
|
120
|
+
}
|
|
121
|
+
});
|
|
122
|
+
return {
|
|
123
|
+
inGroup: inGroup,
|
|
124
|
+
notInGroup: notInGroup
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
exports.splitComponentBlocksByGroup = splitComponentBlocksByGroup;
|
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,26 +1,38 @@
|
|
|
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
13
|
var react_1 = require("react");
|
|
5
|
-
function useIntersectionObserver(elementRef, _a) {
|
|
14
|
+
function useIntersectionObserver(elementRef, _a, deps) {
|
|
6
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;
|
|
7
16
|
var _f = (0, react_1.useState)(), entry = _f[0], setEntry = _f[1];
|
|
8
17
|
var frozen = (entry === null || entry === void 0 ? void 0 : entry.isIntersecting) && freezeOnceVisible;
|
|
9
|
-
|
|
10
|
-
var
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
18
|
+
(0, react_1.useLayoutEffect)(function () {
|
|
19
|
+
var updateEntry = function (_a) {
|
|
20
|
+
var entry = _a[0];
|
|
21
|
+
setEntry(entry);
|
|
22
|
+
};
|
|
14
23
|
var node = elementRef === null || elementRef === void 0 ? void 0 : elementRef.current; // DOM Ref
|
|
15
24
|
var hasIOSupport = !!window.IntersectionObserver;
|
|
16
|
-
if (!hasIOSupport || frozen || !node)
|
|
25
|
+
if (!hasIOSupport || frozen || !node) {
|
|
17
26
|
return;
|
|
27
|
+
}
|
|
18
28
|
var observerParams = { threshold: threshold, root: root, rootMargin: rootMargin };
|
|
19
29
|
var observer = new IntersectionObserver(updateEntry, observerParams);
|
|
20
30
|
observer.observe(node);
|
|
21
|
-
return function () {
|
|
31
|
+
return function () {
|
|
32
|
+
observer.disconnect();
|
|
33
|
+
};
|
|
22
34
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
23
|
-
}, [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));
|
|
24
36
|
return entry;
|
|
25
37
|
}
|
|
26
38
|
exports.useIntersectionObserver = useIntersectionObserver;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { CB_BTN_PROPERTIES_TYPE, CB_DIVIDER_PROPERTIES_TYPE, CB_IMG_PROPERTIES_TYPE, CB_RICHTEXT_PROPERTIES_TYPE, CB_TEXT_PROPERTIES_TYPE, CB_TWITTER_PROPERTIES_TYPE, CB_YOUTUBE_PROPERTIES_TYPE } from './util/types';
|
|
1
|
+
import type { CB_BTN_PROPERTIES_TYPE, CB_DIVIDER_PROPERTIES_TYPE, CB_EMBED_PROPERTIES_TYPE, CB_IMG_PROPERTIES_TYPE, CB_RICHTEXT_PROPERTIES_TYPE, CB_TEXT_PROPERTIES_TYPE, CB_TWITTER_PROPERTIES_TYPE, CB_YOUTUBE_PROPERTIES_TYPE } from './util/types';
|
|
2
2
|
export type CB_TYPES = 'GENERAL';
|
|
3
|
-
export type ComponentBlock = CB_TEXT_TYPE | CB_BTN_TYPE | CB_RICHTEXT | CB_DIVIDER | CB_IMG | CB_YOUTUBE | CB_TWITTER;
|
|
3
|
+
export type ComponentBlock = CB_TEXT_TYPE | CB_BTN_TYPE | CB_RICHTEXT | CB_DIVIDER | CB_IMG | CB_YOUTUBE | CB_TWITTER | CB_IFRAME;
|
|
4
4
|
type GeneralCustomSectionType = {
|
|
5
5
|
id: number;
|
|
6
6
|
type: 'GENERAL';
|
|
@@ -9,34 +9,62 @@ type GeneralCustomSectionType = {
|
|
|
9
9
|
queryableDefinitionPreset: string;
|
|
10
10
|
dynamicLayoutSectionId: number;
|
|
11
11
|
};
|
|
12
|
-
export type
|
|
12
|
+
export type GroupCustomSectionType = {
|
|
13
|
+
id: 'group';
|
|
14
|
+
type: 'GROUP';
|
|
15
|
+
availablePlugins: Array<string>;
|
|
16
|
+
queryableTapSrc: string;
|
|
17
|
+
queryableDefinitionPreset: string;
|
|
18
|
+
dynamicLayoutSectionId: number;
|
|
19
|
+
};
|
|
20
|
+
export type AllCBProperties = CB_TEXT_PROPERTIES_TYPE | CB_BTN_PROPERTIES_TYPE | CB_RICHTEXT_PROPERTIES_TYPE | CB_RICHTEXT_PROPERTIES_TYPE | CB_DIVIDER_PROPERTIES_TYPE | CB_YOUTUBE_PROPERTIES_TYPE | CB_IMG_PROPERTIES_TYPE | CB_TWITTER_PROPERTIES_TYPE | CB_EMBED_PROPERTIES_TYPE;
|
|
13
21
|
export type CB_TEXT_TYPE = GeneralCustomSectionType & {
|
|
14
22
|
componentBlockCode: CB_ALL_CODES.CB_TEXT;
|
|
15
|
-
|
|
23
|
+
jsonProperties: {
|
|
24
|
+
data: CB_TEXT_PROPERTIES_TYPE;
|
|
25
|
+
};
|
|
16
26
|
};
|
|
17
27
|
export type CB_BTN_TYPE = GeneralCustomSectionType & {
|
|
18
28
|
componentBlockCode: CB_ALL_CODES.CB_BTN;
|
|
19
|
-
|
|
29
|
+
jsonProperties: {
|
|
30
|
+
data: CB_BTN_PROPERTIES_TYPE;
|
|
31
|
+
};
|
|
20
32
|
};
|
|
21
33
|
export type CB_RICHTEXT = GeneralCustomSectionType & {
|
|
22
34
|
componentBlockCode: CB_ALL_CODES.CB_RICHTEXT;
|
|
23
|
-
|
|
35
|
+
jsonProperties: {
|
|
36
|
+
data: CB_RICHTEXT_PROPERTIES_TYPE;
|
|
37
|
+
};
|
|
24
38
|
};
|
|
25
39
|
export type CB_DIVIDER = GeneralCustomSectionType & {
|
|
26
40
|
componentBlockCode: CB_ALL_CODES.CB_DIVIDER;
|
|
27
|
-
|
|
41
|
+
jsonProperties: {
|
|
42
|
+
data: CB_DIVIDER_PROPERTIES_TYPE;
|
|
43
|
+
};
|
|
28
44
|
};
|
|
29
45
|
export type CB_IMG = GeneralCustomSectionType & {
|
|
30
46
|
componentBlockCode: CB_ALL_CODES.CB_IMG;
|
|
31
|
-
|
|
47
|
+
jsonProperties: {
|
|
48
|
+
data: CB_IMG_PROPERTIES_TYPE;
|
|
49
|
+
};
|
|
32
50
|
};
|
|
33
51
|
export type CB_YOUTUBE = GeneralCustomSectionType & {
|
|
34
52
|
componentBlockCode: CB_ALL_CODES.CB_YOUTUBE;
|
|
35
|
-
|
|
53
|
+
jsonProperties: {
|
|
54
|
+
data: CB_YOUTUBE_PROPERTIES_TYPE;
|
|
55
|
+
};
|
|
36
56
|
};
|
|
37
57
|
export type CB_TWITTER = GeneralCustomSectionType & {
|
|
38
58
|
componentBlockCode: CB_ALL_CODES.CB_TWITTER;
|
|
39
|
-
|
|
59
|
+
jsonProperties: {
|
|
60
|
+
data: CB_TWITTER_PROPERTIES_TYPE;
|
|
61
|
+
};
|
|
62
|
+
};
|
|
63
|
+
export type CB_IFRAME = GeneralCustomSectionType & {
|
|
64
|
+
componentBlockCode: CB_ALL_CODES.CB_EMBED;
|
|
65
|
+
jsonProperties: {
|
|
66
|
+
data: CB_TWITTER_PROPERTIES_TYPE;
|
|
67
|
+
};
|
|
40
68
|
};
|
|
41
69
|
export declare enum CB_ALL_CODES {
|
|
42
70
|
CB_TEXT = "CB_TEXT",
|
|
@@ -45,6 +73,7 @@ export declare enum CB_ALL_CODES {
|
|
|
45
73
|
CB_DIVIDER = "CB_DIVIDER",
|
|
46
74
|
CB_IMG = "CB_IMG",
|
|
47
75
|
CB_YOUTUBE = "CB_YOUTUBE",
|
|
48
|
-
CB_TWITTER = "CB_TWITTER"
|
|
76
|
+
CB_TWITTER = "CB_TWITTER",
|
|
77
|
+
CB_EMBED = "CB_EMBED"
|
|
49
78
|
}
|
|
50
79
|
export {};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { Device, JsonPropertiesParserResult } from './types';
|
|
2
2
|
import type { ISectionJsonProperties } from '../../../../DynamicLayout/types';
|
|
3
|
-
export default function parseJsonProperties(properties: ISectionJsonProperties | undefined, device: Device): JsonPropertiesParserResult;
|
|
3
|
+
export default function parseJsonProperties(properties: ISectionJsonProperties['data'] | undefined, device: Device): JsonPropertiesParserResult;
|
|
@@ -12,8 +12,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
12
12
|
exports.parsePlacement = void 0;
|
|
13
13
|
function parsePlacement(components) {
|
|
14
14
|
return components.reduce(function (acc, cur) {
|
|
15
|
-
var id = cur.id,
|
|
16
|
-
var _a = parsePropPlacement(
|
|
15
|
+
var id = cur.id, jsonProperties = cur.jsonProperties;
|
|
16
|
+
var _a = parsePropPlacement(jsonProperties.data.CB_PLACEMENT_PROP_PLACEMENT, id), mobileLayout = _a.mobileLayout, desktopLayout = _a.desktopLayout;
|
|
17
17
|
return {
|
|
18
18
|
sm: __spreadArray(__spreadArray([], acc.sm, true), [mobileLayout], false),
|
|
19
19
|
lg: __spreadArray(__spreadArray([], acc.lg, true), [desktopLayout], false)
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { CB_LAYOUT_PROP_KEYS } from './layoutPropParsers/types';
|
|
2
2
|
import { CB_STYLE_PROP_KEYS } from './stylePropParsers/types';
|
|
3
|
-
import type { Device, ParserResult, CB_TEXT_PROPERTIES_TYPE, CB_BTN_PROPERTIES_TYPE, CB_IMG_PROPERTIES_TYPE, CB_TWITTER_PROPERTIES_TYPE, CB_DIVIDER_PROPERTIES_TYPE, CB_YOUTUBE_PROPERTIES_TYPE, CB_RICHTEXT_PROPERTIES_TYPE } from './types';
|
|
3
|
+
import type { Device, ParserResult, CB_TEXT_PROPERTIES_TYPE, CB_BTN_PROPERTIES_TYPE, CB_IMG_PROPERTIES_TYPE, CB_TWITTER_PROPERTIES_TYPE, CB_DIVIDER_PROPERTIES_TYPE, CB_YOUTUBE_PROPERTIES_TYPE, CB_RICHTEXT_PROPERTIES_TYPE, CB_EMBED_PROPERTIES_TYPE } from './types';
|
|
4
4
|
export type specTypes = CB_LAYOUT_PROP_KEYS | CB_STYLE_PROP_KEYS;
|
|
5
|
-
export default function parseProperties(properties: CB_TEXT_PROPERTIES_TYPE | CB_BTN_PROPERTIES_TYPE | CB_IMG_PROPERTIES_TYPE | CB_TWITTER_PROPERTIES_TYPE | CB_DIVIDER_PROPERTIES_TYPE | CB_YOUTUBE_PROPERTIES_TYPE | CB_RICHTEXT_PROPERTIES_TYPE, device: Device): ParserResult;
|
|
5
|
+
export default function parseProperties(properties: CB_TEXT_PROPERTIES_TYPE | CB_BTN_PROPERTIES_TYPE | CB_IMG_PROPERTIES_TYPE | CB_TWITTER_PROPERTIES_TYPE | CB_DIVIDER_PROPERTIES_TYPE | CB_YOUTUBE_PROPERTIES_TYPE | CB_RICHTEXT_PROPERTIES_TYPE | CB_EMBED_PROPERTIES_TYPE, device: Device): ParserResult;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { CB_BTNTEXT_STYLE_PROPS, CB_STYLE_PROP_BTNCOLOR_SPECS } from '../components/ComponentBlock/componentBlocks/Button/btnTypes';
|
|
2
2
|
import type { CB_STYLE_PROP_TEXT_SPECS } from '../components/ComponentBlock/componentBlocks/Text/types';
|
|
3
3
|
import type { CB_TWITTER_STYLE_PROPS } from '../components/ComponentBlock/componentBlocks/Twitter/types';
|
|
4
|
-
import type { CB_CONTENT_PROP_CLINK, CB_CONTENT_PROP_IMAGE, CB_CONTENT_PROP_TEXT, CB_CONTENT_PROP_TWITTER } from '../components/ComponentBlock/componentBlocks/types';
|
|
4
|
+
import type { CB_CONTENT_PROP_CLINK, CB_CONTENT_PROP_CODEBLOCK, CB_CONTENT_PROP_IMAGE, CB_CONTENT_PROP_TEXT, CB_CONTENT_PROP_TWITTER } from '../components/ComponentBlock/componentBlocks/types';
|
|
5
5
|
import type { CB_CONTENT_PROP_YOUTUBE_TYPE, CB_STYLE_PROP_BGCOLOR_SPECS } from '../components/ComponentBlock/componentBlocks/Youtube/types';
|
|
6
6
|
import type { CB_CONTENT_PROP_VISIBILITY_SPECS } from './contentPropParsers/parseContentVisibility';
|
|
7
7
|
import type { CB_EFFECT_PROP_ENTANIM_SPECS } from './effectPropParsers/parseEffectPropEntAnim';
|
|
@@ -82,6 +82,16 @@ export type CB_TWITTER_PROPERTIES_TYPE = CB_GENERAL_PROPERTIES_TYPE & {
|
|
|
82
82
|
CB_LAYOUT_PROP_PADDING: CB_LAYOUT_PROP_PADDING_SPECS;
|
|
83
83
|
CB_EFFECT_PROP_ENTANIM: CB_EFFECT_PROP_ENTANIM_SPECS;
|
|
84
84
|
};
|
|
85
|
+
export type CB_EMBED_PROPERTIES_TYPE = CB_GENERAL_PROPERTIES_TYPE & {
|
|
86
|
+
CB_CONTENT_PROP_CODEBLOCK: CB_CONTENT_PROP_CODEBLOCK;
|
|
87
|
+
CB_CONTENT_PROP_VISIBILITY: CB_CONTENT_PROP_VISIBILITY_SPECS;
|
|
88
|
+
CB_STYLE_PROP_SHADOW: CB_STYLE_PROP_SHADOW_SPECS;
|
|
89
|
+
CB_STYLE_PROP_BGCOLOR: CB_STYLE_PROP_BGCOLOR_SPECS;
|
|
90
|
+
CB_STYLE_PROP_OPACITY: CB_STYLE_PROP_TEXT_OPACITY_SPECS;
|
|
91
|
+
CB_LAYOUT_PROP_PADDING: CB_LAYOUT_PROP_PADDING_SPECS;
|
|
92
|
+
CB_LAYOUT_PROP_ARRANGE: CB_LAYOUT_PROP_ARRANGE_SPECS;
|
|
93
|
+
CB_EFFECT_PROP_ENTANIM: CB_EFFECT_PROP_ENTANIM_SPECS;
|
|
94
|
+
};
|
|
85
95
|
export type CB_RICHTEXT_PROPERTIES_TYPE = CB_GENERAL_PROPERTIES_TYPE & {
|
|
86
96
|
CB_CONTENT_PROP_TEXTEDIT: {
|
|
87
97
|
CB_CONTENT_PROP_TEXTEDIT_SPEC_EDITOR: string;
|
|
@@ -132,3 +142,6 @@ export type ParserResult = {
|
|
|
132
142
|
};
|
|
133
143
|
export type JsonPropertiesParserResult = Omit<ParserResult, 'hoverStyle'> & OverlayStyle;
|
|
134
144
|
export type NamedPropAllTypes = NamedStylePropType | NamedLayoutPropType;
|
|
145
|
+
export type IndexForIntersection = {
|
|
146
|
+
index: number;
|
|
147
|
+
};
|