pds-dev-kit-web-test 2.7.173 → 2.7.175

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.
@@ -1,6 +1,7 @@
1
1
  /// <reference types="react" />
2
2
  import type { ComponentBlock } from '../sections/CustomSection/types';
3
3
  import type { CB_PLACEMENT_PROP_SPECS, Device } from '../sections/CustomSection/util/types';
4
+ import type { Block } from 'publ-echo-test/dist/lib/GridLayoutEditor/group';
4
5
  type Props = {
5
6
  cb: ComponentBlock;
6
7
  index: number;
@@ -10,7 +11,8 @@ type Props = {
10
11
  showPinned?: boolean;
11
12
  style?: React.CSSProperties;
12
13
  isParentGroupPinned: boolean;
14
+ block: Block;
13
15
  };
14
- declare function FlexGridItem({ cb, index, device, rowHeight, zIndex, showPinned, style, isParentGroupPinned }: Props): JSX.Element;
16
+ declare function FlexGridItem({ cb, index, device, rowHeight, zIndex, showPinned, block, style, isParentGroupPinned }: Props): JSX.Element;
15
17
  export declare function getGridAreaFromCB(props: CB_PLACEMENT_PROP_SPECS, device: Device): string;
16
18
  export default FlexGridItem;
@@ -20,18 +20,17 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
20
20
  Object.defineProperty(exports, "__esModule", { value: true });
21
21
  exports.getGridAreaFromCB = void 0;
22
22
  var jsx_runtime_1 = require("react/jsx-runtime");
23
- var react_1 = require("react");
24
23
  var styled_components_1 = __importDefault(require("styled-components"));
25
24
  var ComponentBlockMatcherWithCCB_1 = __importDefault(require("../sections/CustomSection/components/ComponentBlock/ComponentBlockMatcherWithCCB"));
26
25
  var gap = 10;
27
26
  function FlexGridItem(_a) {
28
- var cb = _a.cb, index = _a.index, device = _a.device, rowHeight = _a.rowHeight, zIndex = _a.zIndex, showPinned = _a.showPinned, style = _a.style, isParentGroupPinned = _a.isParentGroupPinned;
27
+ var cb = _a.cb, index = _a.index, device = _a.device, rowHeight = _a.rowHeight, zIndex = _a.zIndex, showPinned = _a.showPinned, block = _a.block, style = _a.style, isParentGroupPinned = _a.isParentGroupPinned;
29
28
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
30
29
  var defaultHeight = getMaxHeight(cb.jsonProperties.data.CB_PLACEMENT_PROP_PLACEMENT, device, rowHeight);
31
30
  var gridArea = getGridAreaFromCB(cb.jsonProperties.data.CB_PLACEMENT_PROP_PLACEMENT, device);
32
- var _b = (0, react_1.useState)(false), isCBPinned = _b[0], setIsCBPinned = _b[1];
31
+ var isCBPinned = device === 'DESKTOP' ? block.isPinnedDesktop : block.isPinnedMobile;
33
32
  var isPinned = isParentGroupPinned || isCBPinned;
34
- return ((0, jsx_runtime_1.jsx)(GridItem, __assign({ style: __assign({ zIndex: zIndex, gridArea: gridArea, position: 'relative', maxHeight: isPinned ? defaultHeight : 'none' }, style) }, { children: (0, jsx_runtime_1.jsx)(ComponentBlockMatcherWithCCB_1.default, { rowHeight: rowHeight, cbProps: cb, device: device, index: index }) })));
33
+ return ((0, jsx_runtime_1.jsx)(GridItem, __assign({ style: __assign({ zIndex: zIndex, gridArea: gridArea, position: 'relative', maxHeight: isPinned ? defaultHeight : 'none' }, style), className: "flex-grid-item", "data-is-pinned": isPinned, "data-show-pinned": showPinned }, { children: (0, jsx_runtime_1.jsx)(ComponentBlockMatcherWithCCB_1.default, { rowHeight: rowHeight, cbProps: cb, device: device, index: index }) })));
35
34
  }
36
35
  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"])));
37
36
  function getMaxHeight(props, device, rowHeight) {
@@ -313,7 +313,9 @@ function GroupBlockRender(_a) {
313
313
  right: 0,
314
314
  bottom: 0,
315
315
  boxShadow: '0 0 0 3px #e602ff'
316
- } }), children === null || children === void 0 ? void 0 : children.map(function (cb, index) { return ((0, jsx_runtime_1.jsx)(ErrorBoundary_1.ErrorBoundary, { children: (0, jsx_runtime_1.jsx)(FlexGridItem_1.default, { cb: cb, index: index, device: "DESKTOP", rowHeight: 50, zIndex: 0, style: { pointerEvents: 'none', opacity: isEditing ? 1 : 0.3 }, showPinned: isEditing, isParentGroupPinned: isPinned }) }, cb.id)); })] })));
316
+ } }), children === null || children === void 0 ? void 0 : children.map(function (cb, index) { return ((0, jsx_runtime_1.jsx)(ErrorBoundary_1.ErrorBoundary, { children: (0, jsx_runtime_1.jsx)(FlexGridItem_1.default, { cb: cb, index: index, device: "DESKTOP", rowHeight: 50, zIndex: 0, style: { pointerEvents: 'none', opacity: isEditing ? 1 : 0.3 },
317
+ // showPinned={isEditing}
318
+ block: block, isParentGroupPinned: isPinned }) }, cb.id)); })] })));
317
319
  }
318
320
  var S_Pinned = styled_components_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n pointer-events: auto;\n position: absolute;\n right: 0;\n top: 0;\n z-index: 9999999;\n"], ["\n pointer-events: auto;\n position: absolute;\n right: 0;\n top: 0;\n z-index: 9999999;\n"])));
319
321
  function getGridAreaFromGroup(position) {
@@ -112,7 +112,7 @@ function RenderPedigreeRecursively(_a) {
112
112
  ? block.zOrderDesktopInternal
113
113
  : block.zOrderMobileInternal,
114
114
  maxHeight: isGBPinned_1 ? defaultHeight : 'none'
115
- } }, { children: block.children.map(function (child) { return ((0, jsx_runtime_1.jsx)(RenderPedigreeRecursively, { rowHeight: rowHeight, block: child, layoutItems: layoutItems, cbs: cbs, parentGroupArea: gridArea_1, device: device, selectedRows: relativeSelectedRows_1,
115
+ }, className: "flex-grid-item", "data-is-pinned": isGBPinned_1, "data-show-pinned": isEditMode }, { children: block.children.map(function (child) { return ((0, jsx_runtime_1.jsx)(RenderPedigreeRecursively, { rowHeight: rowHeight, block: child, layoutItems: layoutItems, cbs: cbs, parentGroupArea: gridArea_1, device: device, selectedRows: relativeSelectedRows_1,
116
116
  // pinnedGBs={pinnedGBs}
117
117
  // onToggleGBPinned={onToggleGBPinned}
118
118
  isEditMode: isEditMode, isParentGroupPinned: isGBPinned_1 }, child.blockId)); }) })));
@@ -137,13 +137,15 @@ function RenderPedigreeRecursively(_a) {
137
137
  // data-og-grid-area={originalGridAreaString}
138
138
  // data-rel-grid-area={gridAreaObjToString(relativeGridArea)}
139
139
  // >
140
- (0, jsx_runtime_1.jsx)(ErrorBoundary_1.ErrorBoundary, { children: (0, jsx_runtime_1.jsx)(FlexGridItem_1.default, { cb: cb, index: cbIndex, device: device, rowHeight: rowHeight, zIndex: device === 'DESKTOP'
140
+ (0, jsx_runtime_1.jsx)(ErrorBoundary_1.ErrorBoundary, { children: (0, jsx_runtime_1.jsx)(FlexGridItem_1.default, { cb: cb, index: cbIndex, device: device, rowHeight: rowHeight, block: block, zIndex: device === 'DESKTOP'
141
141
  ? block.zOrderDesktopInternal
142
142
  : block.zOrderMobileInternal, style: {
143
143
  gridArea: gridAreaObjToString(relativeGridArea),
144
144
  pointerEvents: isEditMode ? 'none' : 'auto',
145
145
  boxShadow: isEditMode ? '0 0 0 2px red' : ''
146
- }, showPinned: isEditMode && !parentGroupArea, isParentGroupPinned: isParentGroupPinned }) }, cb.id)
146
+ },
147
+ // showPinned={isEditMode && !parentGroupArea}
148
+ isParentGroupPinned: isParentGroupPinned }) }, cb.id)
147
149
  // </S_GridItem>
148
150
  );
149
151
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pds-dev-kit-web-test",
3
- "version": "2.7.173",
3
+ "version": "2.7.175",
4
4
  "license": "MIT",
5
5
  "private": false,
6
6
  "main": "dist/index.js",