publ-echo 0.0.132 → 0.0.134

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.
@@ -138,7 +138,6 @@ var GridItem = function (_a) {
138
138
  var callback = function (mutationsList) {
139
139
  for (var _i = 0, mutationsList_2 = mutationsList; _i < mutationsList_2.length; _i++) {
140
140
  var mutation = mutationsList_2[_i];
141
- console.log("mutation", mutation);
142
141
  // const isInitial = mutation.attributeName === "data-is-initialized";
143
142
  var isSizeChanged = mutation.attributeName === "data-min-width" ||
144
143
  mutation.attributeName === "data-min-height";
@@ -313,7 +312,6 @@ var GridItem = function (_a) {
313
312
  // h = prevH;
314
313
  // }
315
314
  // if (prevH === h && prevW === w) {
316
- // console.log("cancelled 3");
317
315
  // return;
318
316
  // }
319
317
  // props.onFitToContent &&
@@ -302,7 +302,6 @@ var GridItem = function (_a) {
302
302
  // h = prevH;
303
303
  // }
304
304
  // if (prevH === h && prevW === w) {
305
- // console.log("cancelled 3");
306
305
  // return;
307
306
  // }
308
307
  // props.onFitToContent &&
@@ -1,4 +1,5 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { getIsHeightVariable } from "./ReactGridLayout";
2
3
  import { getLayoutItem } from "./utils/renderHelpers";
3
4
  export function GridBackgroundPlaceholder(_a) {
4
5
  // 활성화된 행(row) 인덱스 배열
@@ -19,10 +20,9 @@ export function GridBackgroundPlaceholder(_a) {
19
20
  // 패턴은 colWidth + margin[0] 단위로 반복되므로, 마지막 열에서는 margin[0]이 필요 없습니다.
20
21
  // 또는, 마지막 요소에는 margin[0]이 없다고 가정하고 계산합니다.
21
22
  var gridContentWidth = totalCols * (colWidth + margin[0]) - margin[0];
22
- var isHeightVariable = device === "DESKTOP"
23
- ? !!(activeBlock === null || activeBlock === void 0 ? void 0 : activeBlock.isHeightVariableDesktop)
24
- : !!(activeBlock === null || activeBlock === void 0 ? void 0 : activeBlock.isHeightVariableMobile);
25
- // const showActiveRows = !!activeDrag.heightFitContent || isHeightVariable;
23
+ var isHeightVariable = activeBlock
24
+ ? getIsHeightVariable(activeBlock, device)
25
+ : false;
26
26
  var showActiveRows = activeBlock && activeBlock.type === "GROUP_BLOCK"
27
27
  ? getShowActiveRows(activeBlock, layout)
28
28
  : !!activeDrag.heightFitContent || isHeightVariable;
@@ -2,5 +2,7 @@ import * as React from "react";
2
2
  import type { ReactElement } from "react";
3
3
  import { PropsWithChildren } from "../types";
4
4
  import { ReactGridLayoutProps } from "./types";
5
+ import { Block } from "./group";
5
6
  declare const ReactGridLayout: ({ children, ...props }: PropsWithChildren<ReactGridLayoutProps>) => React.ReactElement;
7
+ export declare function getIsHeightVariable(block: Block, device: "DESKTOP" | "MOBILE"): boolean;
6
8
  export default ReactGridLayout;
@@ -773,7 +773,7 @@ var ReactGridLayout = function (_a) {
773
773
  y: groupItem.y,
774
774
  i: block.blockId,
775
775
  });
776
- var showBlockData = !isInBulk && overlapsActiveRows;
776
+ var showBlockData = overlapsActiveRows;
777
777
  return (_jsx(OutsideClickHandler, { onOutsideClick: onDoubleClickOutsideGroup, onMouseEnter: function () {
778
778
  setHoveredGroupId(block.blockId);
779
779
  }, onMouseLeave: function () {
@@ -835,7 +835,7 @@ var ReactGridLayout = function (_a) {
835
835
  // width={width}
836
836
  rowHeight: rowHeight, activeRows: activeRowsFiltered !== null && activeRowsFiltered !== void 0 ? activeRowsFiltered : [], colWidth: colWidth, activeDrag: activeDragItemOrSelectedItem, activeBlock: activeBlock, selectedBlockId: selectedBlockId, totalCols: cols, layout: layout }))] }));
837
837
  };
838
- function getIsHeightVariable(block, device) {
838
+ export function getIsHeightVariable(block, device) {
839
839
  var heightVariable = device === "DESKTOP"
840
840
  ? block === null || block === void 0 ? void 0 : block.isHeightVariableDesktop
841
841
  : block === null || block === void 0 ? void 0 : block.isHeightVariableMobile;
@@ -22,8 +22,8 @@ export type ComponentBlock = {
22
22
  zOrderDesktopInternal: number | null;
23
23
  zOrderMobileInternal: number | null;
24
24
  componentBlockId: number;
25
- isHeightVariableDesktop: boolean;
26
- isHeightVariableMobile: boolean;
25
+ isHeightVariableDesktop: boolean | null;
26
+ isHeightVariableMobile: boolean | null;
27
27
  };
28
28
  export type GroupBlock = {
29
29
  blockId: string;
@@ -31,8 +31,8 @@ export type GroupBlock = {
31
31
  zOrderDesktopInternal: number | null;
32
32
  zOrderMobileInternal: number | null;
33
33
  children: (ComponentBlock | GroupBlock)[];
34
- isHeightVariableDesktop: boolean;
35
- isHeightVariableMobile: boolean;
34
+ isHeightVariableDesktop: boolean | null;
35
+ isHeightVariableMobile: boolean | null;
36
36
  };
37
37
  export type RootBlock = {
38
38
  blockId: "ROOT";
@@ -40,8 +40,8 @@ export type RootBlock = {
40
40
  zOrderDesktopInternal: number | null;
41
41
  zOrderMobileInternal: number | null;
42
42
  children: (ComponentBlock | GroupBlock)[];
43
- isHeightVariableDesktop: boolean;
44
- isHeightVariableMobile: boolean;
43
+ isHeightVariableDesktop: boolean | null;
44
+ isHeightVariableMobile: boolean | null;
45
45
  };
46
46
  export type BulkBlockInternal = {
47
47
  blockId: "BULK";
@@ -49,8 +49,8 @@ export type BulkBlockInternal = {
49
49
  zOrderDesktopInternal: number;
50
50
  zOrderMobileInternal: number;
51
51
  children: (ComponentBlock | GroupBlock)[];
52
- isHeightVariableDesktop: boolean;
53
- isHeightVariableMobile: boolean;
52
+ isHeightVariableDesktop: boolean | null;
53
+ isHeightVariableMobile: boolean | null;
54
54
  };
55
55
  export declare const findBlockByBlockId: (block: Block, blockId: string) => Block | null;
56
56
  export declare const findDirectChildrenCbIds: (block: Block, targetId: string) => number[];
@@ -251,6 +251,13 @@ export function formatCbIdToBlockId(cbId) {
251
251
  return "CB_".concat(cbId);
252
252
  }
253
253
  export function getBlockIdKind(blockId) {
254
+ if (blockId === "BULK") {
255
+ return {
256
+ type: "GB",
257
+ cbId: null,
258
+ blockId: blockId,
259
+ };
260
+ }
254
261
  if (/^GB_.+$/i.test(blockId)) {
255
262
  return {
256
263
  type: "GB",
@@ -265,6 +272,13 @@ export function getBlockIdKind(blockId) {
265
272
  blockId: blockId,
266
273
  };
267
274
  }
275
+ if (Number.isInteger(Number(blockId))) {
276
+ return {
277
+ type: "CB",
278
+ cbId: Number(blockId).toString(),
279
+ blockId: formatCbIdToBlockId(Number(blockId)),
280
+ };
281
+ }
268
282
  return null;
269
283
  }
270
284
  // export const findAccessibleChildrenBlocks = (
@@ -157,9 +157,6 @@ var Resizable = function (_a) {
157
157
  if (contentsWrapper) {
158
158
  var gridWrapperInnerH = contentsWrapper.clientHeight;
159
159
  var oneCompositionH = oneComposition.scrollHeight;
160
- console.log("scrollHeight", oneCompositionH);
161
- console.log("clientHeight", oneComposition.clientHeight);
162
- console.log("gap", oneCompositionH - oneComposition.clientHeight);
163
160
  var compositionBGwrapperPaddingT = Number(oneComposition.getAttribute("data-wrapper-paddingt"));
164
161
  var compositionBGwrapperPaddingB = Number(oneComposition.getAttribute("data-wrapper-paddingb"));
165
162
  var compositionBGwrapperPaddingL = Number(oneComposition.getAttribute("data-wrapper-paddingl"));
@@ -238,7 +235,6 @@ var Resizable = function (_a) {
238
235
  height = Math.min(maxConstraints[1], height);
239
236
  }
240
237
  slack.current = [slackW + (oldW - width), slackH + (oldH - height)];
241
- console.log("minH", minHeight.current);
242
238
  return [width, height];
243
239
  };
244
240
  var checkTopLeft = function (deltaX, deltaY, top, left, width, height, handleAxis) {
@@ -310,7 +306,6 @@ var Resizable = function (_a) {
310
306
  // if (lastHandleRectRef.current !== null) {
311
307
  // if (axisH === "w") {
312
308
  // const deltaLeftSinceLast = handleRect.left - lastHandleRectRef.current.left;
313
- // console.log('delta, :', deltaLeftSinceLast);
314
309
  // deltaX += deltaLeftSinceLast;
315
310
  // }
316
311
  // if (axisV === "n") {
@@ -339,7 +334,6 @@ var Resizable = function (_a) {
339
334
  if (autoResize && minHeight.current === height) {
340
335
  handleAxis = removeNorthHandle(handleAxis);
341
336
  }
342
- console.log("deltax deltay", deltaX, deltaY);
343
337
  _c = checkTopLeft(deltaX, deltaY, top, left, width, height, handleAxis), top = _c[0], left = _c[1];
344
338
  var isDimensionsChanged = width !== props.width || height !== props.height;
345
339
  var cb = typeof props[handlerName] === "function" ? props[handlerName] : null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "publ-echo",
3
- "version": "0.0.132",
3
+ "version": "0.0.134",
4
4
  "private": false,
5
5
  "main": "dist/lib/index.js",
6
6
  "types": "dist/lib/index.d.js",