pds-dev-kit-web-test 2.7.318 → 2.7.319
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/CompositionRenderer/FlexGridItem.js +1 -1
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/types.d.ts +4 -0
- package/dist/src/sub/DynamicLayout/sections/CustomSection/util/parsePlacement.d.ts +4 -2
- package/dist/src/sub/DynamicLayout/sections/CustomSection/util/parsePlacement.js +31 -18
- package/package.json +2 -2
|
@@ -65,7 +65,7 @@ function FlexGridItem(_a) {
|
|
|
65
65
|
maxHeight: 'none'
|
|
66
66
|
};
|
|
67
67
|
};
|
|
68
|
-
return ((0, jsx_runtime_1.jsx)(GridItem, __assign({ style: __assign(__assign({ zIndex: zIndex, gridArea: gridArea, position: 'relative' }, style), getHeightStyles()), className: "flex-grid-item", "data-is-pinned": !isParentGroupPinned && isCBPinned, "data-show-pinned": showPinned }, { children: (0, jsx_runtime_1.jsx)(ComponentBlockMatcherWithCCB_1.default, { rowHeight: rowHeight, cbProps: cb, device: device, index: index }) })));
|
|
68
|
+
return ((0, jsx_runtime_1.jsx)(GridItem, __assign({ style: __assign(__assign({ zIndex: zIndex, gridArea: gridArea, position: 'relative' }, style), getHeightStyles()), className: "flex-grid-item", "data-is-pinned": !isParentGroupPinned && isCBPinned, "data-show-pinned": showPinned, "data-height-fit-content": "true" }, { children: (0, jsx_runtime_1.jsx)(ComponentBlockMatcherWithCCB_1.default, { rowHeight: rowHeight, cbProps: cb, device: device, index: index }) })));
|
|
69
69
|
}
|
|
70
70
|
var GridItem = styled_components_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n height: auto;\n word-break: break-word;\n"], ["\n height: auto;\n word-break: break-word;\n"])));
|
|
71
71
|
function getMaxHeight(props, device, rowHeight) {
|
|
@@ -83,6 +83,7 @@ export type CB_STYLE_PROP_TEXT_SPECS_BASE = {
|
|
|
83
83
|
CB_STYLE_PROP_TEXT_SPEC_HORIZONTAL: ENUM_STRING;
|
|
84
84
|
CB_STYLE_PROP_TEXT_SPEC_VERTICAL: ENUM_STRING;
|
|
85
85
|
CB_STYLE_PROP_TEXT_SPEC_ELLIPSIS: NUMBER_INTEGER;
|
|
86
|
+
CB_STYLE_PROP_TEXT_SPEC_FITCONTENT: boolean;
|
|
86
87
|
};
|
|
87
88
|
export type CB_STYLE_PROP_TEXT_SPECS = CB_STYLE_PROP_TEXT_SPECS_BASE & {
|
|
88
89
|
'CB_STYLE_PROP_TEXT_SPEC_TYPEFACE:HOVER': ENUM_STRING | null | undefined;
|
|
@@ -112,6 +113,9 @@ export type CB_STYLE_PROP_TEXT_SPECS = CB_STYLE_PROP_TEXT_SPECS_BASE & {
|
|
|
112
113
|
'CB_STYLE_PROP_TEXT_SPEC_ELLIPSIS:HOVER': NUMBER_INTEGER | null | undefined;
|
|
113
114
|
'CB_STYLE_PROP_TEXT_SPEC_ELLIPSIS:MOBILE': NUMBER_INTEGER | null | undefined;
|
|
114
115
|
'CB_STYLE_PROP_TEXT_SPEC_ELLIPSIS:MOBILE:HOVER': NUMBER_INTEGER | null | undefined;
|
|
116
|
+
'CB_STYLE_PROP_TEXT_SPEC_FITCONTENT:HOVER': boolean | null | undefined;
|
|
117
|
+
'CB_STYLE_PROP_TEXT_SPEC_FITCONTENT:MOBILE': boolean | null | undefined;
|
|
118
|
+
'CB_STYLE_PROP_TEXT_SPEC_FITCONTENT:MOBILE:HOVER': boolean | null | undefined;
|
|
115
119
|
};
|
|
116
120
|
export type CBColorPropsKeys = keyof CB_STYLE_PROP_COLOR_SPECS;
|
|
117
121
|
export type CBColorValueSetType = Partial<Record<keyof CB_STYLE_PROP_COLOR_SPECS, CB_STYLE_PROP_COLOR_ENUM_GRADIENT | NUMBER_INTEGER | ENUM_STRING | undefined>>;
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { type ComponentBlock } from '../types';
|
|
2
2
|
import type { PlaceRestrictionType } from '../../../../DynamicLayout/types';
|
|
3
3
|
import type { ZOrder } from 'publ-echo-test/dist/lib/GridLayoutEditor/group';
|
|
4
|
-
import type { ResizeHandleAxis } from 'publ-echo-test/dist/lib/Resizable/types';
|
|
5
4
|
import type { LayoutItem } from 'publ-echo/dist/lib';
|
|
6
|
-
export declare function
|
|
5
|
+
export declare function getHeightFitContent(cb: ComponentBlock): {
|
|
6
|
+
mobile: boolean;
|
|
7
|
+
desktop: boolean;
|
|
8
|
+
};
|
|
7
9
|
export declare function parsePlacement(components: ComponentBlock[], zOrders: ZOrder, placementRestriction?: PlaceRestrictionType): {
|
|
8
10
|
sm: LayoutItem[];
|
|
9
11
|
lg: LayoutItem[];
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
/* eslint-disable no-console */
|
|
3
2
|
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
4
3
|
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
5
4
|
if (ar || !(i in from)) {
|
|
@@ -10,32 +9,38 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
|
10
9
|
return to.concat(ar || Array.prototype.slice.call(from));
|
|
11
10
|
};
|
|
12
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
-
exports.parsePlacement = exports.
|
|
12
|
+
exports.parsePlacement = exports.getHeightFitContent = void 0;
|
|
14
13
|
var types_1 = require("../types");
|
|
15
|
-
function
|
|
16
|
-
var _a, _b;
|
|
14
|
+
function getHeightFitContent(cb) {
|
|
17
15
|
if (cb.componentBlockCode === types_1.CB_ALL_CODES.CB_TEXT) {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
16
|
+
var desktop = cb.jsonProperties.data.CB_STYLE_PROP_TEXT.CB_STYLE_PROP_TEXT_SPEC_FITCONTENT;
|
|
17
|
+
var mobile = !!(cb.jsonProperties.data.CB_STYLE_PROP_TEXT['CB_STYLE_PROP_TEXT_SPEC_FITCONTENT:MOBILE']);
|
|
18
|
+
return {
|
|
19
|
+
desktop: desktop,
|
|
20
|
+
mobile: mobile
|
|
21
|
+
};
|
|
22
22
|
}
|
|
23
23
|
if (cb.componentBlockCode === types_1.CB_ALL_CODES.CB_LIST) {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
24
|
+
var desktop = !!(cb.jsonProperties.data.CB_STYLE_PROP_CONTENTSLISTDESIGN.CB_STYLE_PROP_CONTENTSLISTDESIGN_SPEC_ITEMHEIGHTFITCONTENT);
|
|
25
|
+
var mobile = !!(cb.jsonProperties.data.CB_STYLE_PROP_CONTENTSLISTDESIGN['CB_STYLE_PROP_CONTENTSLISTDESIGN_SPEC_ITEMHEIGHTFITCONTENT:MOBILE']);
|
|
26
|
+
return {
|
|
27
|
+
desktop: desktop,
|
|
28
|
+
mobile: mobile
|
|
29
|
+
};
|
|
28
30
|
}
|
|
29
|
-
return
|
|
31
|
+
return {
|
|
32
|
+
desktop: false,
|
|
33
|
+
mobile: false,
|
|
34
|
+
};
|
|
30
35
|
}
|
|
31
|
-
exports.
|
|
36
|
+
exports.getHeightFitContent = getHeightFitContent;
|
|
32
37
|
function parsePlacement(components, zOrders, placementRestriction) {
|
|
33
38
|
if (!zOrders) {
|
|
34
39
|
console.error('Z-ORDER NOT FOUND');
|
|
35
40
|
}
|
|
36
41
|
return components.reduce(function (acc, cur) {
|
|
37
42
|
var id = cur.id, jsonProperties = cur.jsonProperties, componentBlockCode = cur.componentBlockCode;
|
|
38
|
-
var _a = parsePropPlacement(jsonProperties.data.CB_PLACEMENT_PROP_PLACEMENT, id, componentBlockCode, zOrders,
|
|
43
|
+
var _a = parsePropPlacement(jsonProperties.data.CB_PLACEMENT_PROP_PLACEMENT, id, componentBlockCode, zOrders, getHeightFitContent(cur), placementRestriction ? placementRestriction[componentBlockCode] : undefined), mobileLayout = _a.mobileLayout, desktopLayout = _a.desktopLayout;
|
|
39
44
|
return {
|
|
40
45
|
sm: __spreadArray(__spreadArray([], acc.sm, true), [mobileLayout], false),
|
|
41
46
|
lg: __spreadArray(__spreadArray([], acc.lg, true), [desktopLayout], false)
|
|
@@ -43,7 +48,7 @@ function parsePlacement(components, zOrders, placementRestriction) {
|
|
|
43
48
|
}, { sm: [], lg: [] });
|
|
44
49
|
}
|
|
45
50
|
exports.parsePlacement = parsePlacement;
|
|
46
|
-
function parsePropPlacement(props, id, cbCode, zOrders,
|
|
51
|
+
function parsePropPlacement(props, id, cbCode, zOrders, heightFitContent, cbRestriction) {
|
|
47
52
|
var _a, _b, _c, _d;
|
|
48
53
|
var desktopLayout = {
|
|
49
54
|
i: id.toString(),
|
|
@@ -55,7 +60,8 @@ function parsePropPlacement(props, id, cbCode, zOrders, handles, cbRestriction)
|
|
|
55
60
|
autoResize: AUTO_RESIZE_CODES.includes(cbCode),
|
|
56
61
|
minH: (_a = cbRestriction === null || cbRestriction === void 0 ? void 0 : cbRestriction.rowHMin) !== null && _a !== void 0 ? _a : 1,
|
|
57
62
|
minW: (_b = cbRestriction === null || cbRestriction === void 0 ? void 0 : cbRestriction.columnWMin) !== null && _b !== void 0 ? _b : 1,
|
|
58
|
-
resizeHandles:
|
|
63
|
+
resizeHandles: getResizeHandles(heightFitContent.desktop),
|
|
64
|
+
heightFitContent: heightFitContent.desktop,
|
|
59
65
|
};
|
|
60
66
|
var mobileLayout = {
|
|
61
67
|
i: id.toString(),
|
|
@@ -67,7 +73,8 @@ function parsePropPlacement(props, id, cbCode, zOrders, handles, cbRestriction)
|
|
|
67
73
|
autoResize: AUTO_RESIZE_CODES.includes(cbCode),
|
|
68
74
|
minH: (_c = cbRestriction === null || cbRestriction === void 0 ? void 0 : cbRestriction.rowHMin) !== null && _c !== void 0 ? _c : 1,
|
|
69
75
|
minW: (_d = cbRestriction === null || cbRestriction === void 0 ? void 0 : cbRestriction.mobileColumnWMin) !== null && _d !== void 0 ? _d : 1,
|
|
70
|
-
|
|
76
|
+
heightFitContent: heightFitContent.mobile,
|
|
77
|
+
resizeHandles: getResizeHandles(heightFitContent.mobile),
|
|
71
78
|
};
|
|
72
79
|
return {
|
|
73
80
|
mobileLayout: mobileLayout,
|
|
@@ -81,4 +88,10 @@ var AUTO_RESIZE_CODES = [
|
|
|
81
88
|
// CB_ALL_CODES.CB_CONTENTSCAROUSEL,
|
|
82
89
|
// CB_ALL_CODES.CB_SLIDEBANNER
|
|
83
90
|
];
|
|
91
|
+
function getResizeHandles(heightFitContent) {
|
|
92
|
+
if (heightFitContent) {
|
|
93
|
+
return ['e', 'w'];
|
|
94
|
+
}
|
|
95
|
+
return ["nw", "e", "n", "ne", "s", "se", "sw", "w"];
|
|
96
|
+
}
|
|
84
97
|
exports.default = parsePlacement;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pds-dev-kit-web-test",
|
|
3
|
-
"version": "2.7.
|
|
3
|
+
"version": "2.7.319",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"private": false,
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"lottie-react": "^2.3.1",
|
|
26
26
|
"nuka-carousel": "^4.8.4",
|
|
27
27
|
"publ-echo": "^0.0.120",
|
|
28
|
-
"publ-echo-test": "^0.0.
|
|
28
|
+
"publ-echo-test": "^0.0.353",
|
|
29
29
|
"react-hook-form": "^7.28.1",
|
|
30
30
|
"react-i18next": "^11.12.0",
|
|
31
31
|
"react-router-dom": "^5.2.0",
|