pds-dev-kit-web-test 0.3.39 → 0.3.41
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/components/Section/components/CustomSectionBackground.js +3 -2
- package/dist/src/sub/DynamicLayout/sections/CustomSection/CustomSection.js +8 -4
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/ComponentBlockMatcher.js +2 -2
- package/dist/src/sub/DynamicLayout/sections/CustomSection/hooks/useGroupDrag/useGroupDrag.js +3 -2
- package/dist/src/sub/DynamicLayout/sections/CustomSection/types.d.ts +21 -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/types.d.ts +20 -18
- package/package.json +1 -1
- package/release-note.md +2 -3
- 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
|
@@ -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);
|
|
@@ -75,7 +75,7 @@ var GLE_MIN_WIDTH_MOBILE_PX = "".concat(GRID_CELL_MIN * MOBILE_GRID_COLS, "px");
|
|
|
75
75
|
function CustomSection(props) {
|
|
76
76
|
var _a = (0, react_1.useContext)(dynamicLayoutContext_1.dynamicLayoutContext), device = _a.device, editingSectionId = _a.editingSectionId, mode = _a.mode, sectionActionHandler = _a.sectionActionHandler, shortcutKeyMode = _a.shortcutKeyMode;
|
|
77
77
|
var componentBlocks = props.componentBlocks, jsonProperties = props.jsonProperties;
|
|
78
|
-
var _b = jsonProperties, CB_PLACEMENT_PROP_SECTION = _b.CB_PLACEMENT_PROP_SECTION, CB_LAYOUT_PROP_PADDING = _b.CB_LAYOUT_PROP_PADDING, CB_CONTENT_PROP_SECTION = _b.CB_CONTENT_PROP_SECTION;
|
|
78
|
+
var _b = jsonProperties.data, CB_PLACEMENT_PROP_SECTION = _b.CB_PLACEMENT_PROP_SECTION, CB_LAYOUT_PROP_PADDING = _b.CB_LAYOUT_PROP_PADDING, CB_CONTENT_PROP_SECTION = _b.CB_CONTENT_PROP_SECTION;
|
|
79
79
|
var _c = (0, react_1.useState)(null), selectedCB = _c[0], setSelectedCB = _c[1];
|
|
80
80
|
var gleRef = (0, react_1.useRef)(null);
|
|
81
81
|
var _d = (0, react_1.useState)(50), rowHeight = _d[0], setRowHeight = _d[1];
|
|
@@ -128,15 +128,19 @@ function CustomSection(props) {
|
|
|
128
128
|
if (props.id !== editingSectionId) {
|
|
129
129
|
return;
|
|
130
130
|
}
|
|
131
|
+
if (!shortcutKeyMode) {
|
|
132
|
+
return;
|
|
133
|
+
}
|
|
131
134
|
if (shortcutKeyMode === 'SELECT_ALL') {
|
|
132
135
|
makeAllInOneGroup();
|
|
133
136
|
return;
|
|
134
137
|
}
|
|
135
138
|
if (shortcutKeyMode === 'MANUAL_BULK_BREAK') {
|
|
136
139
|
breakGroupCB();
|
|
140
|
+
setSelectedCB(null);
|
|
137
141
|
return;
|
|
138
142
|
}
|
|
139
|
-
}, [shortcutKeyMode]);
|
|
143
|
+
}, [shortcutKeyMode, setSelectedCB, breakGroupCB]);
|
|
140
144
|
(0, react_1.useLayoutEffect)(function () {
|
|
141
145
|
if (props.id !== editingSectionId) {
|
|
142
146
|
return;
|
|
@@ -368,9 +372,9 @@ function CustomSection(props) {
|
|
|
368
372
|
return (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, {});
|
|
369
373
|
}
|
|
370
374
|
var cbCopy = (0, deepCopy_1.default)(matchedCB);
|
|
371
|
-
cbCopy.
|
|
375
|
+
cbCopy.jsonProperties.data.CB_EFFECT_PROP_ENTANIM.CB_EFFECT_PROP_ENTANIM_SPEC_TYPE =
|
|
372
376
|
'NONE';
|
|
373
|
-
cbCopy.
|
|
377
|
+
cbCopy.jsonProperties.data.CB_EFFECT_PROP_ENTANIM['CB_EFFECT_PROP_ENTANIM_SPEC_TYPE:MOBILE'] = 'NONE';
|
|
374
378
|
return ((0, jsx_runtime_1.jsx)("div", __assign({ className: "cb-box-in-group", onClick: function (e) {
|
|
375
379
|
e.stopPropagation();
|
|
376
380
|
clickGroupedOne(matchedCB.id, array);
|
|
@@ -27,8 +27,8 @@ var Twitter_1 = __importDefault(require("./componentBlocks/Twitter/Twitter"));
|
|
|
27
27
|
var Youtube_1 = require("./componentBlocks/Youtube");
|
|
28
28
|
function ComponentBlockMatcher(_a) {
|
|
29
29
|
var cbProps = _a.cbProps, device = _a.device, index = _a.index;
|
|
30
|
-
var componentBlockCode = cbProps.componentBlockCode,
|
|
31
|
-
var propsWithValue = device === 'MOBILE' ? (0, newUtils_1.replaceUndefinedValues)(
|
|
30
|
+
var componentBlockCode = cbProps.componentBlockCode, data = cbProps.jsonProperties.data;
|
|
31
|
+
var propsWithValue = device === 'MOBILE' ? (0, newUtils_1.replaceUndefinedValues)(data) : data;
|
|
32
32
|
switch (componentBlockCode) {
|
|
33
33
|
case types_1.CB_ALL_CODES.CB_BTN:
|
|
34
34
|
return (0, jsx_runtime_1.jsx)(Button_1.default, __assign({}, propsWithValue, { index: index }));
|
package/dist/src/sub/DynamicLayout/sections/CustomSection/hooks/useGroupDrag/useGroupDrag.js
CHANGED
|
@@ -26,6 +26,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
26
26
|
exports.filterItemsById = exports.getGroupCB = void 0;
|
|
27
27
|
// eslint-disable-next-line import/no-extraneous-dependencies
|
|
28
28
|
var renderHelpers_1 = require("publ-echo/dist/lib/GridLayoutEditor/utils/renderHelpers");
|
|
29
|
+
var react_1 = require("react");
|
|
29
30
|
var deepCopy_1 = __importDefault(require("../../../../../DynamicLayout/utils/deepCopy"));
|
|
30
31
|
var utils_1 = require("./utils");
|
|
31
32
|
function useGroupDrag(_a) {
|
|
@@ -115,7 +116,7 @@ function useGroupDrag(_a) {
|
|
|
115
116
|
}
|
|
116
117
|
});
|
|
117
118
|
}
|
|
118
|
-
|
|
119
|
+
var breakGroupCB = (0, react_1.useCallback)(function () {
|
|
119
120
|
setLayouts(function (prev) {
|
|
120
121
|
var _a;
|
|
121
122
|
var _b;
|
|
@@ -140,7 +141,7 @@ function useGroupDrag(_a) {
|
|
|
140
141
|
message: 'group dismissed'
|
|
141
142
|
}
|
|
142
143
|
});
|
|
143
|
-
}
|
|
144
|
+
}, []);
|
|
144
145
|
function makeCollisionGroup(id, selectedCBId) {
|
|
145
146
|
setLayouts(function (prev) {
|
|
146
147
|
var _a, _b;
|
|
@@ -20,31 +20,45 @@ export type GroupCustomSectionType = {
|
|
|
20
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;
|
|
21
21
|
export type CB_TEXT_TYPE = GeneralCustomSectionType & {
|
|
22
22
|
componentBlockCode: CB_ALL_CODES.CB_TEXT;
|
|
23
|
-
|
|
23
|
+
jsonProperties: {
|
|
24
|
+
data: CB_TEXT_PROPERTIES_TYPE;
|
|
25
|
+
};
|
|
24
26
|
};
|
|
25
27
|
export type CB_BTN_TYPE = GeneralCustomSectionType & {
|
|
26
28
|
componentBlockCode: CB_ALL_CODES.CB_BTN;
|
|
27
|
-
|
|
29
|
+
jsonProperties: {
|
|
30
|
+
data: CB_BTN_PROPERTIES_TYPE;
|
|
31
|
+
};
|
|
28
32
|
};
|
|
29
33
|
export type CB_RICHTEXT = GeneralCustomSectionType & {
|
|
30
34
|
componentBlockCode: CB_ALL_CODES.CB_RICHTEXT;
|
|
31
|
-
|
|
35
|
+
jsonProperties: {
|
|
36
|
+
data: CB_RICHTEXT_PROPERTIES_TYPE;
|
|
37
|
+
};
|
|
32
38
|
};
|
|
33
39
|
export type CB_DIVIDER = GeneralCustomSectionType & {
|
|
34
40
|
componentBlockCode: CB_ALL_CODES.CB_DIVIDER;
|
|
35
|
-
|
|
41
|
+
jsonProperties: {
|
|
42
|
+
data: CB_DIVIDER_PROPERTIES_TYPE;
|
|
43
|
+
};
|
|
36
44
|
};
|
|
37
45
|
export type CB_IMG = GeneralCustomSectionType & {
|
|
38
46
|
componentBlockCode: CB_ALL_CODES.CB_IMG;
|
|
39
|
-
|
|
47
|
+
jsonProperties: {
|
|
48
|
+
data: CB_IMG_PROPERTIES_TYPE;
|
|
49
|
+
};
|
|
40
50
|
};
|
|
41
51
|
export type CB_YOUTUBE = GeneralCustomSectionType & {
|
|
42
52
|
componentBlockCode: CB_ALL_CODES.CB_YOUTUBE;
|
|
43
|
-
|
|
53
|
+
jsonProperties: {
|
|
54
|
+
data: CB_YOUTUBE_PROPERTIES_TYPE;
|
|
55
|
+
};
|
|
44
56
|
};
|
|
45
57
|
export type CB_TWITTER = GeneralCustomSectionType & {
|
|
46
58
|
componentBlockCode: CB_ALL_CODES.CB_TWITTER;
|
|
47
|
-
|
|
59
|
+
jsonProperties: {
|
|
60
|
+
data: CB_TWITTER_PROPERTIES_TYPE;
|
|
61
|
+
};
|
|
48
62
|
};
|
|
49
63
|
export declare enum CB_ALL_CODES {
|
|
50
64
|
CB_TEXT = "CB_TEXT",
|
|
@@ -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)
|
|
@@ -297,25 +297,27 @@ export type IMembershipDisplay = {
|
|
|
297
297
|
connectedMemberships: IConnectedMembership[];
|
|
298
298
|
};
|
|
299
299
|
export type ISectionJsonProperties = {
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
300
|
+
data: {
|
|
301
|
+
CB_CONTENT_PROP_SECTION: {
|
|
302
|
+
CB_CONTENT_PROP_SECTION_SPEC_VARIABLEROOTFONTSIZE: boolean;
|
|
303
|
+
};
|
|
304
|
+
CB_CONTENT_PROP_VISIBILITY: CB_CONTENT_PROP_VISIBILITY_SPECS;
|
|
305
|
+
CB_EFFECT_PROP_ENTANIM: CB_EFFECT_PROP_ENTANIM_SPECS;
|
|
306
|
+
CB_LAYOUT_PROP_PADDING?: CB_LAYOUT_PROP_PADDING_SPECS;
|
|
307
|
+
CB_PLACEMENT_PROP_SECTION: {
|
|
308
|
+
CB_PLACEMENT_PROP_SECTION_SPEC_FULLWIDTH: boolean;
|
|
309
|
+
'CB_PLACEMENT_PROP_SECTION_SPEC_FULLWIDTH:MOBILE': boolean | null | undefined;
|
|
310
|
+
CB_PLACEMENT_PROP_SECTION_SPEC_MINHEIGHT: number;
|
|
311
|
+
'CB_PLACEMENT_PROP_SECTION_SPEC_MINHEIGHT:MOBILE': number | null | undefined;
|
|
312
|
+
CB_PLACEMENT_PROP_SECTION_SPEC_ROWS: number;
|
|
313
|
+
'CB_PLACEMENT_PROP_SECTION_SPEC_ROWS:MOBILE': number | null | undefined;
|
|
314
|
+
CB_PLACEMENT_PROP_SECTION_SPEC_WIDTH: number;
|
|
315
|
+
'CB_PLACEMENT_PROP_SECTION_SPEC_WIDTH:MOBILE': number | null | undefined;
|
|
316
|
+
};
|
|
317
|
+
CB_STYLE_PROP_BGCOLOR?: CB_STYLE_PROP_BGCOLOR_SPECS;
|
|
318
|
+
CB_STYLE_PROP_BGMEDIA?: CB_STYLE_PROP_BGMEDIA_SPECS;
|
|
319
|
+
CB_STYLE_PROP_BGOVERLAY?: CB_STYLE_PROP_BGOVERLAY_SPECS;
|
|
315
320
|
};
|
|
316
|
-
CB_STYLE_PROP_BGCOLOR?: CB_STYLE_PROP_BGCOLOR_SPECS;
|
|
317
|
-
CB_STYLE_PROP_BGMEDIA?: CB_STYLE_PROP_BGMEDIA_SPECS;
|
|
318
|
-
CB_STYLE_PROP_BGOVERLAY?: CB_STYLE_PROP_BGOVERLAY_SPECS;
|
|
319
321
|
};
|
|
320
322
|
export type CB_STYLE_PROP_BGMEDIA_SPECS_BASE = {
|
|
321
323
|
CB_STYLE_PROP_BGMEDIA_SPEC_YSRC: string;
|
package/package.json
CHANGED
package/release-note.md
CHANGED