publ-echo-test 0.0.386 โ†’ 0.0.388

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,8 @@ 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;
18
19
  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,7 +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
+ // const showActiveRows = !!activeDrag.heightFitContent || isHeightVariable;
26
+ var showActiveRows = activeBlock && activeBlock.type === "GROUP_BLOCK"
27
+ ? getShowActiveRows(activeBlock, layout)
28
+ : !!activeDrag.heightFitContent || isHeightVariable;
25
29
  return (_jsx("div", { className: "grid-placeholder", style: {
26
30
  marginTop: margin[1] + "px",
27
31
  marginBottom: margin[1] + "px",
@@ -40,3 +44,19 @@ export function GridBackgroundPlaceholder(_a) {
40
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)));
41
45
  })] }) }));
42
46
  }
47
+ 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
+ }
@@ -786,6 +786,6 @@ var ReactGridLayout = function (_a) {
786
786
  : activeRows;
787
787
  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
788
  // width={width}
789
- rowHeight: rowHeight, activeRows: activeRowsFiltered !== null && activeRowsFiltered !== void 0 ? activeRowsFiltered : [], colWidth: colWidth, activeDrag: activeDragItemOrSelectedItem, activeBlock: activeBlock, selectedBlockId: selectedBlockId, totalCols: cols }))] }));
789
+ rowHeight: rowHeight, activeRows: activeRowsFiltered !== null && activeRowsFiltered !== void 0 ? activeRowsFiltered : [], colWidth: colWidth, activeDrag: activeDragItemOrSelectedItem, activeBlock: activeBlock, selectedBlockId: selectedBlockId, totalCols: cols, layout: layout }))] }));
790
790
  };
791
791
  export default ReactGridLayout;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "publ-echo-test",
3
- "version": "0.0.386",
3
+ "version": "0.0.388",
4
4
  "private": false,
5
5
  "main": "dist/lib/index.js",
6
6
  "types": "dist/lib/index.d.js",