pds-dev-kit-web-test 2.5.64 → 2.5.65
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/sections/CustomSection/CustomSection.js +12 -13
- package/dist/src/sub/DynamicLayout/sections/CustomSection/FlexGridCustomSection.js +8 -5
- package/dist/src/sub/DynamicLayout/sections/CustomSection/FlexGridItem.d.ts +2 -1
- package/dist/src/sub/DynamicLayout/sections/CustomSection/FlexGridItem.js +7 -4
- package/dist/src/sub/DynamicLayout/sections/CustomSection/util/parsePlacement.d.ts +3 -2
- package/dist/src/sub/DynamicLayout/sections/CustomSection/util/parsePlacement.js +9 -5
- package/dist/src/sub/DynamicLayout/types.d.ts +2 -1
- package/package.json +1 -1
@@ -82,23 +82,23 @@ var CustomSection = (0, react_1.forwardRef)(function CustomSection(props, ref) {
|
|
82
82
|
setPedigreeState((_a = jsonProperties === null || jsonProperties === void 0 ? void 0 : jsonProperties.pedigree) !== null && _a !== void 0 ? _a : []);
|
83
83
|
setBlockIdMap((0, group_1.mapComponentBlockIdsToBlockIds)((_b = jsonProperties === null || jsonProperties === void 0 ? void 0 : jsonProperties.pedigree) !== null && _b !== void 0 ? _b : []));
|
84
84
|
}, [jsonProperties === null || jsonProperties === void 0 ? void 0 : jsonProperties.pedigree]);
|
85
|
-
var _g = jsonProperties.data, CB_PLACEMENT_PROP_SECTION =
|
86
|
-
var
|
85
|
+
var _g = jsonProperties, _h = _g.data, CB_PLACEMENT_PROP_SECTION = _h.CB_PLACEMENT_PROP_SECTION, CB_LAYOUT_PROP_PADDING = _h.CB_LAYOUT_PROP_PADDING, CB_CONTENT_PROP_SECTION = _h.CB_CONTENT_PROP_SECTION, zOrders = _g.zOrders;
|
86
|
+
var _j = (0, react_1.useState)(null), selectedBlockId = _j[0], setSelectedBlockId = _j[1];
|
87
87
|
var gleRef = (0, react_1.useRef)(null);
|
88
|
-
var
|
89
|
-
var
|
88
|
+
var _k = (0, react_1.useState)(50), rowHeight = _k[0], setRowHeight = _k[1];
|
89
|
+
var _l = (0, react_1.useState)(16), baseFontSize = _l[0], setBaseFontSize = _l[1];
|
90
90
|
var isMobile = device === 'MOBILE';
|
91
91
|
var isEditMode = mode === 'EDIT';
|
92
92
|
var layoutByDevice = device === 'DESKTOP' ? 'lg' : 'sm';
|
93
|
-
var
|
94
|
-
var _a = (0, util_1.parsePlacement)(componentBlocks !== null && componentBlocks !== void 0 ? componentBlocks : []), lg = _a.lg, sm = _a.sm;
|
93
|
+
var _m = (0, react_1.useState)(function () {
|
94
|
+
var _a = (0, util_1.parsePlacement)(componentBlocks !== null && componentBlocks !== void 0 ? componentBlocks : [], zOrders), lg = _a.lg, sm = _a.sm;
|
95
95
|
return {
|
96
96
|
lg: lg,
|
97
97
|
sm: sm
|
98
98
|
};
|
99
|
-
}), layouts =
|
100
|
-
var
|
101
|
-
var
|
99
|
+
}), layouts = _m[0], setLayouts = _m[1];
|
100
|
+
var _o = (0, react_1.useState)('ROOT'), editingGroupBlock = _o[0], setEditingGroupBlock = _o[1];
|
101
|
+
var _p = (0, react_1.useState)([]), bulkBlockIds = _p[0], setBulkBlockIds = _p[1];
|
102
102
|
var newblock = bulkBlockIds.length > 0
|
103
103
|
? (0, group_1.addBulkToTarget)(pedigreeState, editingGroupBlock, bulkBlockIds)
|
104
104
|
: pedigreeState;
|
@@ -118,7 +118,7 @@ var CustomSection = (0, react_1.forwardRef)(function CustomSection(props, ref) {
|
|
118
118
|
};
|
119
119
|
}, [componentBlocks]);
|
120
120
|
(0, react_1.useLayoutEffect)(function () {
|
121
|
-
var parsedLayouts = (0, util_1.parsePlacement)(componentBlocks !== null && componentBlocks !== void 0 ? componentBlocks : []);
|
121
|
+
var parsedLayouts = (0, util_1.parsePlacement)(componentBlocks !== null && componentBlocks !== void 0 ? componentBlocks : [], zOrders);
|
122
122
|
setLayouts(function (prev) {
|
123
123
|
var _a;
|
124
124
|
var _b;
|
@@ -161,7 +161,6 @@ var CustomSection = (0, react_1.forwardRef)(function CustomSection(props, ref) {
|
|
161
161
|
return;
|
162
162
|
}
|
163
163
|
if (shortcutKeyMode === 'MANUAL_BULK_BREAK') {
|
164
|
-
// breakGroupCB();
|
165
164
|
setBulkBlockIds([]);
|
166
165
|
setSelectedBlockId(null);
|
167
166
|
return;
|
@@ -198,10 +197,10 @@ var CustomSection = (0, react_1.forwardRef)(function CustomSection(props, ref) {
|
|
198
197
|
var allRootChildIds = (0, group_1.findAllChildrenIds)(pedigreeState, editingGroupBlock, 'current');
|
199
198
|
setBulkBlockIds(allRootChildIds);
|
200
199
|
};
|
201
|
-
var
|
200
|
+
var _q = (0, util_1.parseCustomSectionPlacement)({
|
202
201
|
isMobile: isMobile,
|
203
202
|
customSectionProps: CB_PLACEMENT_PROP_SECTION
|
204
|
-
}), rows =
|
203
|
+
}), rows = _q.rows, width = _q.width, minHeight = _q.minHeight, isFullWidth = _q.isFullWidth;
|
205
204
|
var customSectionStyles = {
|
206
205
|
minHeight: "".concat(minHeight, "vh"),
|
207
206
|
width: '100%',
|
@@ -62,10 +62,10 @@ var CustomSection = (0, react_1.forwardRef)(function CustomSection(props, ref) {
|
|
62
62
|
var _a;
|
63
63
|
var _b = (0, react_1.useContext)(dynamicLayoutContext_1.dynamicLayoutContext), device = _b.device, editingSectionId = _b.editingSectionId, mode = _b.mode, shortcutKeyMode = _b.shortcutKeyMode, sectionActionHandler = _b.sectionActionHandler;
|
64
64
|
var componentBlocks = props.componentBlocks, jsonProperties = props.jsonProperties;
|
65
|
-
var _c = jsonProperties.data, CB_PLACEMENT_PROP_SECTION =
|
65
|
+
var _c = jsonProperties, _d = _c.data, CB_PLACEMENT_PROP_SECTION = _d.CB_PLACEMENT_PROP_SECTION, CB_LAYOUT_PROP_PADDING = _d.CB_LAYOUT_PROP_PADDING, zOrders = _c.zOrders;
|
66
66
|
var containerRef = (0, react_1.useRef)(null);
|
67
67
|
var size = (0, useResizableObserver_1.useResizeObserver)({ ref: containerRef, box: 'border-box' });
|
68
|
-
var
|
68
|
+
var _e = (0, react_1.useState)(null), selectedCB = _e[0], setSelectedCB = _e[1];
|
69
69
|
var gleRef = (0, react_1.useRef)(null);
|
70
70
|
var isMobile = device === 'MOBILE';
|
71
71
|
var isEditMode = mode === 'EDIT';
|
@@ -124,10 +124,10 @@ var CustomSection = (0, react_1.forwardRef)(function CustomSection(props, ref) {
|
|
124
124
|
setSelectedCB('BULK');
|
125
125
|
}
|
126
126
|
}, [selectedCB, shortcutKeyMode, sectionActionHandler, setSelectedCB]);
|
127
|
-
var
|
127
|
+
var _f = (0, util_1.parseCustomSectionPlacement)({
|
128
128
|
isMobile: isMobile,
|
129
129
|
customSectionProps: CB_PLACEMENT_PROP_SECTION
|
130
|
-
}), width =
|
130
|
+
}), width = _f.width, minHeight = _f.minHeight, isFullWidth = _f.isFullWidth;
|
131
131
|
var customSectionStyles = {
|
132
132
|
minHeight: "".concat(minHeight, "vh"),
|
133
133
|
width: '100%',
|
@@ -195,7 +195,10 @@ var CustomSection = (0, react_1.forwardRef)(function CustomSection(props, ref) {
|
|
195
195
|
maxWidth: customSectionStyles.maxWidth,
|
196
196
|
minWidth: isMobile ? GLE_MIN_WIDTH_MOBILE_PX : GLE_MIN_WIDTH_DESKTOP_PX,
|
197
197
|
fontSize: "".concat(baseFontSize, "px")
|
198
|
-
} }, { children: (_a = props.componentBlocks) === null || _a === void 0 ? void 0 : _a.map(function (cb, index) {
|
198
|
+
} }, { children: (_a = props.componentBlocks) === null || _a === void 0 ? void 0 : _a.map(function (cb, index) {
|
199
|
+
var _a;
|
200
|
+
return ((0, jsx_runtime_1.jsx)(ErrorBoundary_1.ErrorBoundary, { children: (0, jsx_runtime_1.jsx)(FlexGridItem_1.default, { cb: cb, index: index, device: device, rowHeight: rowHeight, zIndex: (_a = zOrders === null || zOrders === void 0 ? void 0 : zOrders[device === 'DESKTOP' ? 'desktop' : 'mobile'][cb.id]) !== null && _a !== void 0 ? _a : 0 }) }, cb.id));
|
201
|
+
}) })) })) })) }) }));
|
199
202
|
});
|
200
203
|
var GridContainer = styled_components_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: grid; /* Space between grid items */\n gap: 10px;\n grid-auto-rows: minmax(", ", auto);\n grid-template-columns: repeat(", ", 1fr);\n grid-template-rows: repeat(\n ", ",\n minmax(", ", auto)\n );\n padding: 10px 10px;\n\n * {\n box-sizing: border-box;\n }\n"], ["\n display: grid; /* Space between grid items */\n gap: 10px;\n grid-auto-rows: minmax(", ", auto);\n grid-template-columns: repeat(", ", 1fr);\n grid-template-rows: repeat(\n ", ",\n minmax(", ", auto)\n );\n padding: 10px 10px;\n\n * {\n box-sizing: border-box;\n }\n"])), function (props) { return "".concat(props.rowHeight, "px"); }, function (props) { return props.cols; }, function (props) { return props.sectionRow; }, function (props) { return "".concat(props.rowHeight, "px"); });
|
201
204
|
var S_SectionWrapper = styled_components_1.default.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n position: relative;\n"], ["\n position: relative;\n"])));
|
@@ -6,6 +6,7 @@ type Props = {
|
|
6
6
|
index: number;
|
7
7
|
device: Device;
|
8
8
|
rowHeight: number;
|
9
|
+
zIndex: number;
|
9
10
|
};
|
10
|
-
declare function FlexGridItem({ cb, index, device, rowHeight }: Props): JSX.Element;
|
11
|
+
declare function FlexGridItem({ cb, index, device, rowHeight, zIndex }: Props): JSX.Element;
|
11
12
|
export default FlexGridItem;
|
@@ -23,13 +23,16 @@ var styled_components_1 = __importDefault(require("styled-components"));
|
|
23
23
|
var ComponentBlockMatcher_1 = __importDefault(require("./components/ComponentBlock/ComponentBlockMatcher"));
|
24
24
|
var gap = 10;
|
25
25
|
function FlexGridItem(_a) {
|
26
|
-
var cb = _a.cb, index = _a.index, device = _a.device, rowHeight = _a.rowHeight;
|
26
|
+
var cb = _a.cb, index = _a.index, device = _a.device, rowHeight = _a.rowHeight, zIndex = _a.zIndex;
|
27
27
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
28
28
|
var defaultHeight = getMaxHeight(cb.jsonProperties.data.CB_PLACEMENT_PROP_PLACEMENT, device, rowHeight);
|
29
29
|
var gridArea = getGridAreaFromCB(cb.jsonProperties.data.CB_PLACEMENT_PROP_PLACEMENT, device);
|
30
|
-
|
31
|
-
|
32
|
-
|
30
|
+
// const zIndex =
|
31
|
+
// device === 'DESKTOP'
|
32
|
+
// ? cb.jsonProperties.data.CB_PLACEMENT_PROP_PLACEMENT.CB_PLACEMENT_PROP_PLACEMENT_SPEC_ZINDEX
|
33
|
+
// : cb.jsonProperties.data.CB_PLACEMENT_PROP_PLACEMENT[
|
34
|
+
// 'CB_PLACEMENT_PROP_PLACEMENT_SPEC_ZINDEX:MOBILE'
|
35
|
+
// ];
|
33
36
|
return ((0, jsx_runtime_1.jsx)(GridItem, __assign({ style: {
|
34
37
|
zIndex: zIndex,
|
35
38
|
gridArea: gridArea
|
@@ -1,5 +1,6 @@
|
|
1
|
-
import
|
2
|
-
|
1
|
+
import { ComponentBlock } from '../types';
|
2
|
+
import type { SectionZOrder } from 'publ-echo-test/dist/lib/GridLayoutEditor/group';
|
3
|
+
export declare function parsePlacement(components: ComponentBlock[], zOrders: SectionZOrder): {
|
3
4
|
sm: {
|
4
5
|
i: string;
|
5
6
|
x: number;
|
@@ -1,4 +1,5 @@
|
|
1
1
|
"use strict";
|
2
|
+
/* eslint-disable no-console */
|
2
3
|
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
3
4
|
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
4
5
|
if (ar || !(i in from)) {
|
@@ -11,10 +12,13 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
11
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
12
13
|
exports.parsePlacement = void 0;
|
13
14
|
var types_1 = require("../types");
|
14
|
-
function parsePlacement(components) {
|
15
|
+
function parsePlacement(components, zOrders) {
|
16
|
+
if (!zOrders) {
|
17
|
+
console.error('Z-ORDER NOT FOUND');
|
18
|
+
}
|
15
19
|
return components.reduce(function (acc, cur) {
|
16
20
|
var id = cur.id, jsonProperties = cur.jsonProperties, componentBlockCode = cur.componentBlockCode;
|
17
|
-
var _a = parsePropPlacement(jsonProperties.data.CB_PLACEMENT_PROP_PLACEMENT, id, componentBlockCode), mobileLayout = _a.mobileLayout, desktopLayout = _a.desktopLayout;
|
21
|
+
var _a = parsePropPlacement(jsonProperties.data.CB_PLACEMENT_PROP_PLACEMENT, id, componentBlockCode, zOrders), mobileLayout = _a.mobileLayout, desktopLayout = _a.desktopLayout;
|
18
22
|
return {
|
19
23
|
sm: __spreadArray(__spreadArray([], acc.sm, true), [mobileLayout], false),
|
20
24
|
lg: __spreadArray(__spreadArray([], acc.lg, true), [desktopLayout], false)
|
@@ -22,14 +26,14 @@ function parsePlacement(components) {
|
|
22
26
|
}, { sm: [], lg: [] });
|
23
27
|
}
|
24
28
|
exports.parsePlacement = parsePlacement;
|
25
|
-
function parsePropPlacement(props, id, cbCode) {
|
29
|
+
function parsePropPlacement(props, id, cbCode, zOrders) {
|
26
30
|
var desktopLayout = {
|
27
31
|
i: id.toString(),
|
28
32
|
x: props.CB_PLACEMENT_PROP_PLACEMENT_SPEC_STARTX,
|
29
33
|
y: props.CB_PLACEMENT_PROP_PLACEMENT_SPEC_STARTY,
|
30
34
|
w: props.CB_PLACEMENT_PROP_PLACEMENT_SPEC_COLS,
|
31
35
|
h: props.CB_PLACEMENT_PROP_PLACEMENT_SPEC_ROWS,
|
32
|
-
z:
|
36
|
+
z: zOrders.desktop[id] + 500,
|
33
37
|
autoResize: cbCode === types_1.CB_ALL_CODES.CB_TEXT
|
34
38
|
};
|
35
39
|
var mobileLayout = {
|
@@ -38,7 +42,7 @@ function parsePropPlacement(props, id, cbCode) {
|
|
38
42
|
y: props['CB_PLACEMENT_PROP_PLACEMENT_SPEC_STARTY:MOBILE'],
|
39
43
|
w: props['CB_PLACEMENT_PROP_PLACEMENT_SPEC_COLS:MOBILE'],
|
40
44
|
h: props['CB_PLACEMENT_PROP_PLACEMENT_SPEC_ROWS:MOBILE'],
|
41
|
-
z:
|
45
|
+
z: zOrders.mobile[id] + 500,
|
42
46
|
autoResize: cbCode === types_1.CB_ALL_CODES.CB_TEXT
|
43
47
|
};
|
44
48
|
return {
|
@@ -6,7 +6,7 @@ import type { CB_EFFECT_PROP_ENTANIM_SPECS } from './sections/CustomSection/util
|
|
6
6
|
import type { CB_LAYOUT_PROP_PADDING_SPECS } from './sections/CustomSection/util/layoutPropParsers/parseLayoutPropPadding';
|
7
7
|
import type { CB_STYLE_PROP_BGCOLOR_SPECS } from './sections/CustomSection/util/stylePropParsers/parseStylePropBgColor';
|
8
8
|
import type { CB_STYLE_PROP_BGOVERLAY_SPECS } from './sections/CustomSection/util/stylePropParsers/parseStylePropBgOverlay';
|
9
|
-
import type { Block } from 'publ-echo-test/dist/lib/GridLayoutEditor/group';
|
9
|
+
import type { Block, SectionZOrder } from 'publ-echo-test/dist/lib/GridLayoutEditor/group';
|
10
10
|
import type { Ref } from 'react';
|
11
11
|
export { TypeOfSectionAction };
|
12
12
|
export type TypeOfSectionManifestSchema = 'BASE_INTRO' | 'BASE_CONTENTS' | 'BASE_CONTENTS_CAROUSEL' | 'BASE_FOOTER' | 'BASE_INFO_BOX' | 'EXP_IFRAME' | 'PRG_MEMBERSHIP_DISPLAY' | 'CUSTOM';
|
@@ -301,6 +301,7 @@ export type IMembershipDisplay = {
|
|
301
301
|
connectedMemberships: IConnectedMembership[];
|
302
302
|
};
|
303
303
|
export type ISectionJsonProperties = {
|
304
|
+
zOrders?: SectionZOrder;
|
304
305
|
pedigree?: SectionPedigree;
|
305
306
|
data: {
|
306
307
|
CB_CONTENT_PROP_SECTION: {
|