publ-echo-test 0.0.387 โ†’ 0.0.389

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.
@@ -12,7 +12,9 @@ type PlaceholderProps = {
12
12
  totalCols: number;
13
13
  activeRows: number[];
14
14
  activeBlock?: ComponentBlock | GroupBlock | null;
15
+ layout: LayoutItem[];
15
16
  };
16
17
  export declare function GridBackgroundPlaceholder({ device, margin, rowHeight, colWidth, backgroundWidth, backgroundHeight, activeDrag, selectedBlockId, activeRows, totalCols, // ๐Ÿ’ก ์ƒˆ๋กœ ๋ฐ›์€ totalCols ์‚ฌ์šฉ
17
- activeBlock, }: PlaceholderProps): import("react/jsx-runtime").JSX.Element;
18
+ activeBlock, layout, }: PlaceholderProps): import("react/jsx-runtime").JSX.Element;
19
+ export declare function getShowActiveRows(block: ComponentBlock | GroupBlock, layout: LayoutItem[]): boolean;
18
20
  export {};
@@ -1,4 +1,5 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { getLayoutItem } from "./utils/renderHelpers";
2
3
  export function GridBackgroundPlaceholder(_a) {
3
4
  // ํ™œ์„ฑํ™”๋œ ํ–‰(row) ์ธ๋ฑ์Šค ๋ฐฐ์—ด
4
5
  // const activeRows = Array.from(
@@ -8,7 +9,7 @@ export function GridBackgroundPlaceholder(_a) {
8
9
  var device = _a.device, margin = _a.margin,
9
10
  // width, // ๐Ÿšจ ์ œ๊ฑฐ
10
11
  rowHeight = _a.rowHeight, colWidth = _a.colWidth, backgroundWidth = _a.backgroundWidth, backgroundHeight = _a.backgroundHeight, activeDrag = _a.activeDrag, selectedBlockId = _a.selectedBlockId, activeRows = _a.activeRows, totalCols = _a.totalCols, // ๐Ÿ’ก ์ƒˆ๋กœ ๋ฐ›์€ totalCols ์‚ฌ์šฉ
11
- activeBlock = _a.activeBlock;
12
+ activeBlock = _a.activeBlock, layout = _a.layout;
12
13
  // ๐Ÿšจ activeCols๋„ totalCols prop์œผ๋กœ ๋ฐ›์•„์„œ ์‚ฌ์šฉ
13
14
  // const activeCols = Array.from({ length: 24 }, (_, i) => 0 + i);
14
15
  var activeCols = Array.from({ length: totalCols }, function (_, i) { return 0 + i; });
@@ -21,8 +22,10 @@ export function GridBackgroundPlaceholder(_a) {
21
22
  var isHeightVariable = device === "DESKTOP"
22
23
  ? !!(activeBlock === null || activeBlock === void 0 ? void 0 : activeBlock.isHeightVariableDesktop)
23
24
  : !!(activeBlock === null || activeBlock === void 0 ? void 0 : activeBlock.isHeightVariableMobile);
24
- var showActiveRows = !!activeDrag.heightFitContent || isHeightVariable;
25
- console.log("activeBlock", activeBlock);
25
+ // const showActiveRows = !!activeDrag.heightFitContent || isHeightVariable;
26
+ var showActiveRows = activeBlock && activeBlock.type === "GROUP_BLOCK"
27
+ ? getShowActiveRows(activeBlock, layout)
28
+ : !!activeDrag.heightFitContent || isHeightVariable;
26
29
  return (_jsx("div", { className: "grid-placeholder", style: {
27
30
  marginTop: margin[1] + "px",
28
31
  marginBottom: margin[1] + "px",
@@ -41,3 +44,19 @@ export function GridBackgroundPlaceholder(_a) {
41
44
  }), _jsx("foreignObject", { x: gridContentWidth + textPadding, y: y_top, width: colWidth, height: rowHeight, style: { overflow: "visible" }, children: _jsx("div", { className: "grid-indicator-text" }) })] }, "active-row-".concat(row)));
42
45
  })] }) }));
43
46
  }
47
+ export function getShowActiveRows(block, layout) {
48
+ if (block.type === "GROUP_BLOCK") {
49
+ var hasFitContentCB = block.children.some(function (child) {
50
+ if (child.type === "COMPONENT_BLOCK") {
51
+ var item = getLayoutItem(layout, child.componentBlockId.toString());
52
+ return (item === null || item === void 0 ? void 0 : item.heightFitContent) || false;
53
+ }
54
+ if (child.type === "GROUP_BLOCK") {
55
+ return getShowActiveRows(child, layout);
56
+ }
57
+ return false;
58
+ });
59
+ return hasFitContentCB;
60
+ }
61
+ return false;
62
+ }
@@ -41,7 +41,7 @@ import isEqual from "../../external-lib/lodash.isEqual";
41
41
  import { findAllChildrenCbIds, findBlockByBlockId, findDirectChildrenBlockIds, findDirectChildrenCbIds, findGroupBlocks, findParentGroupBlock, formatCbIdToBlockId, getBlockIdKind, getBlockSpecificType, zIndexMap, } from "./group";
42
42
  import GroupItem from "../GridItem/GroupItem";
43
43
  import OutsideClickHandler from "../GridItem/OutsideClickHandler";
44
- import { GridBackgroundPlaceholder } from "./Placeholder";
44
+ import { getShowActiveRows, GridBackgroundPlaceholder } from "./Placeholder";
45
45
  var layoutClassName = "react-grid-layout";
46
46
  var ReactGridLayout = function (_a) {
47
47
  var children = _a.children, props = __rest(_a, ["children"]);
@@ -573,11 +573,19 @@ var ReactGridLayout = function (_a) {
573
573
  var zIndex = editorMode === "EDIT" ? editorZIndex : z;
574
574
  // Check if a layout item overlaps any of the activeRows (vertical overlap)
575
575
  var isOverlappingActiveRows = function (item) {
576
- if ((parsedSelectedBlockId === null || parsedSelectedBlockId === void 0 ? void 0 : parsedSelectedBlockId.cbId) === item.i) {
577
- return false;
576
+ if ((activeBlock === null || activeBlock === void 0 ? void 0 : activeBlock.type) === "COMPONENT_BLOCK") {
577
+ if ((parsedSelectedBlockId === null || parsedSelectedBlockId === void 0 ? void 0 : parsedSelectedBlockId.cbId) === item.i) {
578
+ return false;
579
+ }
580
+ if (!(activeDragItemOrSelectedItem === null || activeDragItemOrSelectedItem === void 0 ? void 0 : activeDragItemOrSelectedItem.heightFitContent)) {
581
+ return false;
582
+ }
578
583
  }
579
- if (!(activeDragItemOrSelectedItem === null || activeDragItemOrSelectedItem === void 0 ? void 0 : activeDragItemOrSelectedItem.heightFitContent)) {
580
- return false;
584
+ if ((activeBlock === null || activeBlock === void 0 ? void 0 : activeBlock.type) === "GROUP_BLOCK") {
585
+ var hasFitContentCB = getShowActiveRows(activeBlock, layout);
586
+ if (!hasFitContentCB) {
587
+ return false;
588
+ }
581
589
  }
582
590
  if (!activeRows || activeRows.length === 0) {
583
591
  return false;
@@ -786,6 +794,6 @@ var ReactGridLayout = function (_a) {
786
794
  : activeRows;
787
795
  return (_jsxs("div", { ref: innerRef, className: mergedClassName, style: mergedStyle, onDrop: isDroppable ? onDropHandler : noop, onDragLeave: isDroppable ? onDragLeaveHandler : noop, onDragEnter: isDroppable ? onDragEnterHandler : noop, onDragOver: isDroppable ? onDragOverHandler : noop, "data-grid-row-height": rowHeight, "data-grid-cols": cols, "data-section-id": sectionId, children: [currentGroupBlocks.map(function (each) { return processGroup(each); }), React.Children.map(children, function (child) { return processGridItem(child); }), placeholder(), activeDrag && _jsx("div", { className: "grid-guide-line-center" }), activeDragItemOrSelectedItem && (_jsx(GridBackgroundPlaceholder, { device: device, backgroundWidth: getBackgroundWidth(), backgroundHeight: getBackgroundHeight(), margin: margin,
788
796
  // width={width}
789
- rowHeight: rowHeight, activeRows: activeRowsFiltered !== null && activeRowsFiltered !== void 0 ? activeRowsFiltered : [], colWidth: colWidth, activeDrag: activeDragItemOrSelectedItem, activeBlock: activeBlock, selectedBlockId: selectedBlockId, totalCols: cols }))] }));
797
+ rowHeight: rowHeight, activeRows: activeRowsFiltered !== null && activeRowsFiltered !== void 0 ? activeRowsFiltered : [], colWidth: colWidth, activeDrag: activeDragItemOrSelectedItem, activeBlock: activeBlock, selectedBlockId: selectedBlockId, totalCols: cols, layout: layout }))] }));
790
798
  };
791
799
  export default ReactGridLayout;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "publ-echo-test",
3
- "version": "0.0.387",
3
+ "version": "0.0.389",
4
4
  "private": false,
5
5
  "main": "dist/lib/index.js",
6
6
  "types": "dist/lib/index.d.js",