publ-echo-test 0.0.351 → 0.0.354

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.
@@ -30,7 +30,7 @@ import { Resizable } from "../Resizable";
30
30
  var GridItem = function (_a) {
31
31
  var _b;
32
32
  var children = _a.children, props = __rest(_a, ["children"]);
33
- var resizeHandle = props.resizeHandle, cols = props.cols, zOrder = props.zOrder, zOrderInternal = props.zOrderInternal, isDraggable = props.isDraggable, _c = props.transformScale, transformScale = _c === void 0 ? 1 : _c, isResizable = props.isResizable, useCSSTransforms = props.useCSSTransforms, className = props.className, _d = props.cancel, cancel = _d === void 0 ? "" : _d, _e = props.handle, handle = _e === void 0 ? "" : _e, x = props.x, y = props.y, z = props.z, w = props.w, h = props.h, _f = props.minH, minH = _f === void 0 ? 1 : _f, _g = props.minW, minW = _g === void 0 ? 1 : _g, _h = props.maxH, maxH = _h === void 0 ? Infinity : _h, _j = props.maxW, maxW = _j === void 0 ? Infinity : _j, i = props.i, _k = props.isHiddenVisibility, isHiddenVisibility = _k === void 0 ? false : _k, containerWidth = props.containerWidth, customColWidth = props.customColWidth, autoResize = props.autoResize;
33
+ var resizeHandle = props.resizeHandle, cols = props.cols, zOrder = props.zOrder, zOrderInternal = props.zOrderInternal, isDraggable = props.isDraggable, _c = props.transformScale, transformScale = _c === void 0 ? 1 : _c, isResizable = props.isResizable, useCSSTransforms = props.useCSSTransforms, className = props.className, _d = props.cancel, cancel = _d === void 0 ? "" : _d, _e = props.handle, handle = _e === void 0 ? "" : _e, x = props.x, y = props.y, z = props.z, w = props.w, h = props.h, _f = props.minH, minH = _f === void 0 ? 1 : _f, _g = props.minW, minW = _g === void 0 ? 1 : _g, _h = props.maxH, maxH = _h === void 0 ? Infinity : _h, _j = props.maxW, maxW = _j === void 0 ? Infinity : _j, i = props.i, _k = props.isHiddenVisibility, isHiddenVisibility = _k === void 0 ? false : _k, containerWidth = props.containerWidth, customColWidth = props.customColWidth, autoResize = props.autoResize, heightFitContent = props.heightFitContent;
34
34
  var _l = useState(), resizing = _l[0], setResizing = _l[1];
35
35
  var _m = useState(), dragging = _m[0], setDragging = _m[1];
36
36
  var _o = useState(), dragStart = _o[0], setDragStart = _o[1];
@@ -604,6 +604,7 @@ var GridItem = function (_a) {
604
604
  "data-z-index": z,
605
605
  "data-z-order": zOrder,
606
606
  "data-is-pinned": props.isPinned,
607
+ "data-height-fit-content": heightFitContent,
607
608
  "data-z-order-internal": zOrderInternal,
608
609
  className: classNames("react-grid-item", child.props.className, className, {
609
610
  static: props.static,
@@ -84,6 +84,7 @@ export type GridItemProps = {
84
84
  zOrder?: number;
85
85
  zOrderInternal?: string;
86
86
  isPinned: boolean;
87
+ heightFitContent: boolean;
87
88
  };
88
89
  export type GridItemDefaultProps = {
89
90
  className: string;
@@ -14,6 +14,7 @@ export function GridBackgroundPlaceholder(_a) {
14
14
  // 패턴은 colWidth + margin[0] 단위로 반복되므로, 마지막 열에서는 margin[0]이 필요 없습니다.
15
15
  // 또는, 마지막 요소에는 margin[0]이 없다고 가정하고 계산합니다.
16
16
  var gridContentWidth = totalCols * (colWidth + margin[0]) - margin[0];
17
+ var showActiveRows = !!activeDrag.heightFitContent && activeRows.length > 0;
17
18
  return (_jsx("div", { className: "grid-placeholder", style: {
18
19
  marginTop: margin[1] + "px",
19
20
  marginBottom: margin[1] + "px",
@@ -22,7 +23,7 @@ export function GridBackgroundPlaceholder(_a) {
22
23
  }, children: _jsxs("svg", { xmlns: "http://www.w3.org/2000/svg",
23
24
  // 💡 backgroundWidth는 string("100%")으로 사용하되,
24
25
  // 내부 요소 배치에는 gridContentWidth를 사용합니다.
25
- width: backgroundWidth, height: backgroundHeight, overflow: "visible", children: [_jsx("defs", { children: _jsx("pattern", { id: "grid-pattern", height: rowHeight + margin[1], width: colWidth + margin[0], patternUnits: "userSpaceOnUse", children: _jsx("rect", { x: 0.5, y: 0.5, className: "grid-pattern-rect", height: rowHeight, width: colWidth }) }) }), _jsx("rect", { width: gridContentWidth, height: "100%", fill: "url(#grid-pattern)" }), activeDrag &&
26
+ width: backgroundWidth, height: backgroundHeight, overflow: "visible", children: [_jsx("defs", { children: _jsx("pattern", { id: "grid-pattern", height: rowHeight + margin[1], width: colWidth + margin[0], patternUnits: "userSpaceOnUse", children: _jsx("rect", { x: 0.5, y: 0.5, className: "grid-pattern-rect", height: rowHeight, width: colWidth }) }) }), _jsx("rect", { width: gridContentWidth, height: "100%", fill: "url(#grid-pattern)" }), showActiveRows &&
26
27
  activeRows.map(function (row) {
27
28
  var y_top = row * (rowHeight + margin[1]) + 0.5;
28
29
  var y_center = y_top + rowHeight / 2;
@@ -533,7 +533,7 @@ var ReactGridLayout = function (_a) {
533
533
  if (!item) {
534
534
  return null;
535
535
  }
536
- return (_jsx(GridItem, { isPinned: false, w: activeDrag.w, h: activeDrag.h, x: activeDrag.x, y: activeDrag.y, z: zIndexMap.ISDRAGGING, i: activeDrag.i, className: "placeholder", containerWidth: width, cols: cols, margin: margin, containerPadding: containerPadding || margin, maxRows: maxRows, rowHeight: rowHeight, isDraggable: false, isResizable: false, isBounded: false, useCSSTransforms: useCSSTransforms, transformScale: transformScale, autoResize: !!l.autoResize, minH: l.minH, minW: l.minW, children: item && item }));
536
+ return (_jsx(GridItem, { isPinned: false, w: activeDrag.w, h: activeDrag.h, x: activeDrag.x, y: activeDrag.y, z: zIndexMap.ISDRAGGING, i: activeDrag.i, heightFitContent: false, className: "placeholder", containerWidth: width, cols: cols, margin: margin, containerPadding: containerPadding || margin, maxRows: maxRows, rowHeight: rowHeight, isDraggable: false, isResizable: false, isBounded: false, useCSSTransforms: useCSSTransforms, transformScale: transformScale, autoResize: !!l.autoResize, minH: l.minH, minW: l.minW, children: item && item }));
537
537
  };
538
538
  /**
539
539
  * Given a grid item, set its style attributes & surround in a <Draggable>.
@@ -608,7 +608,7 @@ var ReactGridLayout = function (_a) {
608
608
  y: l.y,
609
609
  i: l.i,
610
610
  });
611
- return (_jsx(GridItem, { isPinned: device === "DESKTOP"
611
+ return (_jsx(GridItem, { heightFitContent: !!(l === null || l === void 0 ? void 0 : l.heightFitContent), isPinned: device === "DESKTOP"
612
612
  ? !!block.isPinnedDesktop
613
613
  : !!block.isPinnedMobile, className: classNames({
614
614
  "editable-grid-item": !isRoot && editable,
@@ -740,7 +740,7 @@ var ReactGridLayout = function (_a) {
740
740
  var parent = blockStructure
741
741
  ? findParentGroupBlock(blockStructure, block.blockId)
742
742
  : null;
743
- return (_jsx(OutsideClickHandler, { onOutsideClick: onDoubleClickOutsideGroup, children: _jsx(GroupItem, { isPinned: device === "DESKTOP"
743
+ return (_jsx(OutsideClickHandler, { onOutsideClick: onDoubleClickOutsideGroup, children: _jsx(GroupItem, { heightFitContent: false, isPinned: device === "DESKTOP"
744
744
  ? !!block.isPinnedDesktop
745
745
  : !!block.isPinnedMobile, className: classNames({
746
746
  "bulk-child-item": isInBulk,
@@ -770,11 +770,8 @@ var ReactGridLayout = function (_a) {
770
770
  : null;
771
771
  var activeRows = activeDrag &&
772
772
  Array.from({ length: activeDrag.h }, function (_, i) { return activeDrag.y + i; });
773
- console.log("activeRows", activeRows);
774
773
  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" }), activeDrag && (_jsx(GridBackgroundPlaceholder, { backgroundWidth: getBackgroundWidth(), backgroundHeight: getBackgroundHeight(), margin: margin,
775
774
  // width={width}
776
- rowHeight: rowHeight, colWidth: colWidth, activeDrag: activeDrag, selectedBlockId: selectedBlockId, totalCols: cols })), selectedLayoutItem && (_jsx(GridBackgroundPlaceholder, { backgroundWidth: getBackgroundWidth(), backgroundHeight: getBackgroundHeight(), margin: margin,
777
- // width={width}
778
- rowHeight: rowHeight, colWidth: colWidth, activeDrag: selectedLayoutItem, selectedBlockId: selectedBlockId, totalCols: cols }))] }));
775
+ rowHeight: rowHeight, colWidth: colWidth, activeDrag: activeDrag, selectedBlockId: selectedBlockId, totalCols: cols })), selectedLayoutItem && !activeDrag && (_jsx(GridBackgroundPlaceholder, { backgroundWidth: getBackgroundWidth(), backgroundHeight: getBackgroundHeight(), margin: margin, rowHeight: rowHeight, colWidth: colWidth, activeDrag: selectedLayoutItem, selectedBlockId: selectedBlockId, totalCols: cols }))] }));
779
776
  };
780
777
  export default ReactGridLayout;
@@ -23,6 +23,7 @@ export type LayoutItem = {
23
23
  groupLayouts?: LayoutItem[];
24
24
  autoResize?: boolean;
25
25
  isPinned?: boolean;
26
+ heightFitContent?: boolean;
26
27
  };
27
28
  export type Layout = LayoutItem[];
28
29
  export type DroppedEvent = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "publ-echo-test",
3
- "version": "0.0.351",
3
+ "version": "0.0.354",
4
4
  "private": false,
5
5
  "main": "dist/lib/index.js",
6
6
  "types": "dist/lib/index.d.js",