publ-echo-test 0.0.365 β†’ 0.0.367

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,5 +1,6 @@
1
1
  import { LayoutItem } from "./types";
2
2
  type PlaceholderProps = {
3
+ device: "DESKTOP" | "MOBILE";
3
4
  margin: [number, number];
4
5
  rowHeight: number;
5
6
  colWidth: number;
@@ -10,5 +11,5 @@ type PlaceholderProps = {
10
11
  totalCols: number;
11
12
  activeRows: number[];
12
13
  };
13
- export declare function GridBackgroundPlaceholder({ margin, rowHeight, colWidth, backgroundWidth, backgroundHeight, activeDrag, selectedBlockId, activeRows, totalCols, }: PlaceholderProps): import("react/jsx-runtime").JSX.Element;
14
+ export declare function GridBackgroundPlaceholder({ device, margin, rowHeight, colWidth, backgroundWidth, backgroundHeight, activeDrag, selectedBlockId, activeRows, totalCols, }: PlaceholderProps): import("react/jsx-runtime").JSX.Element;
14
15
  export {};
@@ -5,7 +5,7 @@ export function GridBackgroundPlaceholder(_a) {
5
5
  // { length: activeDrag.h },
6
6
  // (_, i) => activeDrag.y + i
7
7
  // );
8
- var margin = _a.margin,
8
+ var device = _a.device, margin = _a.margin,
9
9
  // width, // 🚨 제거
10
10
  rowHeight = _a.rowHeight, colWidth = _a.colWidth, backgroundWidth = _a.backgroundWidth, backgroundHeight = _a.backgroundHeight, activeDrag = _a.activeDrag, selectedBlockId = _a.selectedBlockId, activeRows = _a.activeRows, totalCols = _a.totalCols;
11
11
  // 🚨 activeCols도 totalCols prop으둜 λ°›μ•„μ„œ μ‚¬μš©
@@ -17,9 +17,13 @@ export function GridBackgroundPlaceholder(_a) {
17
17
  // νŒ¨ν„΄μ€ colWidth + margin[0] λ‹¨μœ„λ‘œ λ°˜λ³΅λ˜λ―€λ‘œ, λ§ˆμ§€λ§‰ μ—΄μ—μ„œλŠ” margin[0]이 ν•„μš” μ—†μŠ΅λ‹ˆλ‹€.
18
18
  // λ˜λŠ”, λ§ˆμ§€λ§‰ μš”μ†Œμ—λŠ” margin[0]이 μ—†λ‹€κ³  κ°€μ •ν•˜κ³  κ³„μ‚°ν•©λ‹ˆλ‹€.
19
19
  var gridContentWidth = totalCols * (colWidth + margin[0]) - margin[0];
20
- // const showActiveRows =
21
- // !!activeDrag.heightFitContent || !!activeDrag.isHeightVariable;
22
- var showActiveRows = true;
20
+ var isHeightVariable = device === "DESKTOP"
21
+ ? !!activeDrag.isHeightVariableDesktop
22
+ : !!activeDrag.isHeightVariableMobile;
23
+ var showActiveRows = !!activeDrag.heightFitContent || isHeightVariable;
24
+ console.log("activeDrag in Placeholder", activeDrag); // --- IGNORE ---
25
+ console.log("isHeightVariable in Placeholder", isHeightVariable); // --- IGNORE ---
26
+ console.log("showActiveRows in Placeholder", showActiveRows); // --- IGNORE ---
23
27
  return (_jsx("div", { className: "grid-placeholder", style: {
24
28
  marginTop: margin[1] + "px",
25
29
  marginBottom: margin[1] + "px",
@@ -219,17 +219,7 @@ var ReactGridLayout = function (_a) {
219
219
  }
220
220
  var xgap = x - oldDragItem.x;
221
221
  var ygap = y - oldDragItem.y;
222
- var placeholder = {
223
- w: l.w,
224
- h: l.h,
225
- x: l.x,
226
- y: l.y,
227
- z: l.z,
228
- placeholder: true,
229
- i: i,
230
- heightFitContent: l.heightFitContent,
231
- isHeightVariable: l.isHeightVariable,
232
- };
222
+ var placeholder = __assign(__assign({}, l), { w: l.w, h: l.h, x: l.x, y: l.y, z: l.z, placeholder: true, i: i, heightFitContent: l.heightFitContent });
233
223
  var isUserAction = true;
234
224
  var newLayout = isGroup
235
225
  ? layout
@@ -431,17 +421,7 @@ var ReactGridLayout = function (_a) {
431
421
  }), newLayout = _b[0], l = _b[1];
432
422
  if (!l)
433
423
  return;
434
- var placeholder = {
435
- w: l.w,
436
- h: l.h,
437
- x: l.x,
438
- y: l.y,
439
- z: l.z,
440
- static: true,
441
- i: i,
442
- heightFitContent: l.heightFitContent,
443
- isHeightVariable: l.isHeightVariable,
444
- };
424
+ var placeholder = __assign(__assign({}, l), { w: l.w, h: l.h, x: l.x, y: l.y, z: l.z, static: true, i: i, heightFitContent: l.heightFitContent });
445
425
  props.onResize &&
446
426
  props.onResize({
447
427
  layout: newLayout,
@@ -791,11 +771,7 @@ var ReactGridLayout = function (_a) {
791
771
  var activeRowsFiltered = shouldShowAllHeightVariableRows
792
772
  ? heightVariableRows
793
773
  : activeRows;
794
- console.log("activeBlock", activeBlock);
795
- console.log("activeDrag", activeDrag);
796
- console.log("shouldShowAllHeightVariableRows", shouldShowAllHeightVariableRows);
797
- console.log("heightVariableRows", heightVariableRows);
798
- 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, { backgroundWidth: getBackgroundWidth(), backgroundHeight: getBackgroundHeight(), margin: margin,
774
+ 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,
799
775
  // width={width}
800
776
  rowHeight: rowHeight, activeRows: activeRowsFiltered !== null && activeRowsFiltered !== void 0 ? activeRowsFiltered : [], colWidth: colWidth, activeDrag: activeDragItemOrSelectedItem, selectedBlockId: selectedBlockId, totalCols: cols }))] }));
801
777
  };
@@ -22,7 +22,8 @@ export type LayoutItem = {
22
22
  isBounded?: boolean;
23
23
  groupLayouts?: LayoutItem[];
24
24
  autoResize?: boolean;
25
- isHeightVariable?: boolean;
25
+ isHeightVariableDesktop?: boolean;
26
+ isHeightVariableMobile?: boolean;
26
27
  heightFitContent?: boolean;
27
28
  };
28
29
  export type Layout = LayoutItem[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "publ-echo-test",
3
- "version": "0.0.365",
3
+ "version": "0.0.367",
4
4
  "private": false,
5
5
  "main": "dist/lib/index.js",
6
6
  "types": "dist/lib/index.d.js",