publ-echo-test 0.0.339 → 0.0.341
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.
- package/css/gle-styles.css +1 -0
- package/dist/lib/GridItem/GridItem.d.ts +3 -3
- package/dist/lib/GridItem/GridItem.js +239 -31
- package/dist/lib/GridItem/GridItemCopy.d.ts +5 -0
- package/dist/lib/GridItem/GridItemCopy.js +613 -0
- package/dist/lib/GridItem/GroupItem.d.ts +3 -3
- package/dist/lib/GridItem/GroupItem.js +37 -38
- package/dist/lib/GridItem/types.d.ts +5 -4
- package/dist/lib/GridLayoutEditor/ReactGridLayout.js +14 -6
- package/dist/lib/GridLayoutEditor/group.d.ts +8 -0
- package/dist/lib/GridLayoutEditor/group.js +3 -1
- package/dist/lib/GridLayoutEditor/types.d.ts +10 -9
- package/dist/lib/Resizable/Resizable.d.ts +3 -3
- package/dist/lib/Resizable/Resizable.js +132 -35
- package/package.json +1 -1
@@ -21,22 +21,22 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
21
21
|
return t;
|
22
22
|
};
|
23
23
|
import { jsx as _jsx } from "react/jsx-runtime";
|
24
|
-
import React, { useEffect, useRef, useState } from
|
25
|
-
import { DraggableCore } from
|
26
|
-
import classNames from
|
27
|
-
import { calcGridColWidth, calcGridItemPosition, calcGridItemWHPx, calcWH, calcXY, clamp, resolveRowHeight, } from
|
28
|
-
import { perc, setTopLeft, setTransform, } from
|
24
|
+
import React, { useEffect, useRef, useState } from "react";
|
25
|
+
import { DraggableCore } from "../Draggable";
|
26
|
+
import classNames from "../../external-lib/classnames";
|
27
|
+
import { calcGridColWidth, calcGridItemPosition, calcGridItemWHPx, calcWH, calcXY, clamp, resolveRowHeight, } from "./utils/calculateUtils";
|
28
|
+
import { perc, setTopLeft, setTransform, } from "../GridLayoutEditor/utils/renderHelpers";
|
29
29
|
var GroupItem = function (_a) {
|
30
30
|
var _b;
|
31
31
|
var children = _a.children, props = __rest(_a, ["children"]);
|
32
|
-
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 ?
|
32
|
+
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, minZ = props.minZ, onContextGroup = props.onContextGroup;
|
33
33
|
var _l = useState(), resizing = _l[0], setResizing = _l[1];
|
34
34
|
var _m = useState(), dragging = _m[0], setDragging = _m[1];
|
35
35
|
var _o = useState(), dragStart = _o[0], setDragStart = _o[1];
|
36
36
|
var _p = useState(false), isDragging = _p[0], setIsDragging = _p[1];
|
37
37
|
var _q = useState(false), isResizing = _q[0], setIsResizing = _q[1];
|
38
38
|
var elementRef = useRef(null);
|
39
|
-
var isSelected = (_b = elementRef.current) === null || _b === void 0 ? void 0 : _b.classList.contains(
|
39
|
+
var isSelected = (_b = elementRef.current) === null || _b === void 0 ? void 0 : _b.classList.contains("react-grid-item-selected");
|
40
40
|
useEffect(function () {
|
41
41
|
var _a;
|
42
42
|
if (!isSelected || !autoResize) {
|
@@ -54,7 +54,7 @@ var GroupItem = function (_a) {
|
|
54
54
|
var callback = function (mutationsList) {
|
55
55
|
for (var _i = 0, mutationsList_1 = mutationsList; _i < mutationsList_1.length; _i++) {
|
56
56
|
var mutation = mutationsList_1[_i];
|
57
|
-
var isCharacterChanged = mutation.type ===
|
57
|
+
var isCharacterChanged = mutation.type === "characterData";
|
58
58
|
var keepWidth = true;
|
59
59
|
var hasPaddingChanged = false;
|
60
60
|
var height = isCharacterChanged
|
@@ -85,14 +85,14 @@ var GroupItem = function (_a) {
|
|
85
85
|
var _a = calcWH(getPositionParams(), {
|
86
86
|
width: width,
|
87
87
|
height: height,
|
88
|
-
}, x, y,
|
88
|
+
}, x, y, "e", props.w, props.h, false), w_1 = _a.w, h_1 = _a.h;
|
89
89
|
if (keepWidth) {
|
90
90
|
w_1 = prevW;
|
91
91
|
}
|
92
92
|
if (prevH > h_1) {
|
93
93
|
h_1 = prevH;
|
94
94
|
}
|
95
|
-
var _b = getResizableXYPosition(
|
95
|
+
var _b = getResizableXYPosition("e", w_1, h_1, prevW, prevH), newX = _b.newX, newY = _b.newY;
|
96
96
|
if (prevH === h_1 && prevW === w_1 && newX === x && newY === y) {
|
97
97
|
return;
|
98
98
|
}
|
@@ -162,7 +162,7 @@ var GroupItem = function (_a) {
|
|
162
162
|
style = setTopLeft(pos);
|
163
163
|
if (usePercentages) {
|
164
164
|
if (containerWidth == null) {
|
165
|
-
throw new Error(
|
165
|
+
throw new Error("Container width is missing!");
|
166
166
|
}
|
167
167
|
style.left = perc(pos.left / containerWidth);
|
168
168
|
style.width = perc(pos.width / containerWidth);
|
@@ -176,7 +176,7 @@ var GroupItem = function (_a) {
|
|
176
176
|
* @return {Element} Child wrapped in Draggable.
|
177
177
|
*/
|
178
178
|
var mixinDraggable = function (child, isDraggable) {
|
179
|
-
return (_jsx(DraggableCore, { disabled: !isDraggable, onStart: onDragStart, onDrag: onDrag, onStop: onDragStop, handle: handle, cancel:
|
179
|
+
return (_jsx(DraggableCore, { disabled: !isDraggable, onStart: onDragStart, onDrag: onDrag, onStop: onDragStop, handle: handle, cancel: ".react-resizable-handle" + (cancel ? "," + cancel : ""), scale: transformScale, nodeRef: elementRef, children: child }));
|
180
180
|
};
|
181
181
|
// /**
|
182
182
|
// * Mix a Resizable instance into a child.
|
@@ -263,7 +263,7 @@ var GroupItem = function (_a) {
|
|
263
263
|
var onDrag = function (e, _a) {
|
264
264
|
var node = _a.node, deltaX = _a.deltaX, deltaY = _a.deltaY;
|
265
265
|
if (!dragging) {
|
266
|
-
throw new Error(
|
266
|
+
throw new Error("onDrag called before onDragStart.");
|
267
267
|
}
|
268
268
|
setIsDragging(true);
|
269
269
|
var top = dragging.top + deltaY;
|
@@ -278,7 +278,6 @@ var GroupItem = function (_a) {
|
|
278
278
|
var rowHeightNumber = resolveRowHeight(rowHeight, colWidth);
|
279
279
|
var bottomBoundary = offsetParent.clientHeight -
|
280
280
|
calcGridItemWHPx(h, rowHeightNumber, margin[1]);
|
281
|
-
console.log('bb', bottomBoundary);
|
282
281
|
top = clamp(top, 0, bottomBoundary);
|
283
282
|
var rightBoundary = containerWidth - calcGridItemWHPx(w, colWidth, margin[0]);
|
284
283
|
left = clamp(left, 0, rightBoundary);
|
@@ -297,7 +296,7 @@ var GroupItem = function (_a) {
|
|
297
296
|
var onDragStop = function (e, _a) {
|
298
297
|
var node = _a.node, deltaX = _a.deltaX, deltaY = _a.deltaY;
|
299
298
|
if (!dragging) {
|
300
|
-
throw new Error(
|
299
|
+
throw new Error("onDragEnd called before onDragStart.");
|
301
300
|
}
|
302
301
|
var w = props.w, h = props.h, i = props.i;
|
303
302
|
var left = dragging.left, top = dragging.top;
|
@@ -313,7 +312,7 @@ var GroupItem = function (_a) {
|
|
313
312
|
var getResizableXYPosition = function (handle, width, height, prevW, prevH) {
|
314
313
|
var newX = x;
|
315
314
|
var newY = y;
|
316
|
-
if (handle ===
|
315
|
+
if (handle === "nw") {
|
317
316
|
// NOTE - nw left(X)와 top(Y) 둘다 변경
|
318
317
|
if (width > prevW) {
|
319
318
|
newX = x - (width - prevW);
|
@@ -328,7 +327,7 @@ var GroupItem = function (_a) {
|
|
328
327
|
newY = y + (prevH - height);
|
329
328
|
}
|
330
329
|
}
|
331
|
-
if (handle ===
|
330
|
+
if (handle === "n" || handle === "ne") {
|
332
331
|
// NOTE - n, ne left(X) 고정 & top(Y) 변경
|
333
332
|
if (height > prevH) {
|
334
333
|
newY = y - (height - prevH);
|
@@ -337,7 +336,7 @@ var GroupItem = function (_a) {
|
|
337
336
|
newY = y + (prevH - height);
|
338
337
|
}
|
339
338
|
}
|
340
|
-
if (handle ===
|
339
|
+
if (handle === "w" || handle === "sw") {
|
341
340
|
// NOTE - s, sw left(X) 변경 top(Y) 고정
|
342
341
|
if (width > prevW) {
|
343
342
|
newX = x - (width - prevW);
|
@@ -354,7 +353,7 @@ var GroupItem = function (_a) {
|
|
354
353
|
* @param {Object} callbackData an object with node and size information
|
355
354
|
*/
|
356
355
|
var onResizeStart = function (e, callbackData) {
|
357
|
-
onResizeHandler(e, callbackData,
|
356
|
+
onResizeHandler(e, callbackData, "onResizeStart");
|
358
357
|
};
|
359
358
|
/**
|
360
359
|
* onResize event handler
|
@@ -363,7 +362,7 @@ var GroupItem = function (_a) {
|
|
363
362
|
*/
|
364
363
|
var onResize = function (e, callbackData) {
|
365
364
|
setIsResizing(true);
|
366
|
-
onResizeHandler(e, callbackData,
|
365
|
+
onResizeHandler(e, callbackData, "onResize");
|
367
366
|
};
|
368
367
|
/**
|
369
368
|
* onResizeStop event handler
|
@@ -372,7 +371,7 @@ var GroupItem = function (_a) {
|
|
372
371
|
*/
|
373
372
|
var onResizeStop = function (e, callbackData) {
|
374
373
|
setIsResizing(false);
|
375
|
-
onResizeHandler(e, callbackData,
|
374
|
+
onResizeHandler(e, callbackData, "onResizeStop");
|
376
375
|
};
|
377
376
|
/**
|
378
377
|
* Wrapper around drag events to provide more useful data.
|
@@ -406,7 +405,7 @@ var GroupItem = function (_a) {
|
|
406
405
|
// maxW = Math.min(maxW, cols - x);
|
407
406
|
w = clamp(w, minW, maxW);
|
408
407
|
h = clamp(h, tempMinH, maxH);
|
409
|
-
setResizing(handlerName ===
|
408
|
+
setResizing(handlerName === "onResizeStop" ? undefined : size);
|
410
409
|
var _d = getResizableXYPosition(handle, w, h, prevW, prevH), newX = _d.newX, newY = _d.newY;
|
411
410
|
handler(i, w, h, { e: e, node: node, size: size }, newX, newY);
|
412
411
|
};
|
@@ -415,22 +414,22 @@ var GroupItem = function (_a) {
|
|
415
414
|
var newChild = React.cloneElement(child, {
|
416
415
|
key: i,
|
417
416
|
ref: elementRef,
|
418
|
-
|
419
|
-
|
420
|
-
|
421
|
-
|
422
|
-
|
423
|
-
className: classNames(
|
417
|
+
"data-group-block-id": i,
|
418
|
+
"data-z-index": z,
|
419
|
+
"data-z-order": zOrder,
|
420
|
+
"data-z-order-internal": zOrderInternal,
|
421
|
+
"data-min-z": minZ,
|
422
|
+
className: classNames("react-group-block", child.props.className, className, {
|
424
423
|
static: props.static,
|
425
424
|
isResizing: Boolean(resizing) &&
|
426
425
|
Boolean(isResizing) &&
|
427
426
|
Boolean(isHiddenVisibility),
|
428
427
|
resizing: Boolean(resizing),
|
429
|
-
|
428
|
+
"react-draggable": isDraggable,
|
430
429
|
isDragging: Boolean(isDragging) &&
|
431
430
|
Boolean(dragging) &&
|
432
431
|
Boolean(isHiddenVisibility),
|
433
|
-
|
432
|
+
"react-draggable-dragging": Boolean(dragging),
|
434
433
|
// dropping: Boolean(droppingPosition),
|
435
434
|
cssTransforms: useCSSTransforms,
|
436
435
|
}),
|
@@ -444,25 +443,25 @@ var GroupItem = function (_a) {
|
|
444
443
|
}
|
445
444
|
// 일시적으로 pointer-events 비활성화
|
446
445
|
if (elementRef.current) {
|
447
|
-
elementRef.current.style.pointerEvents =
|
446
|
+
elementRef.current.style.pointerEvents = "none";
|
448
447
|
}
|
449
448
|
// 현재 마우스 위치에서 실제 요소 찾기
|
450
449
|
var underlyingElement = document.elementFromPoint(e.clientX, e.clientY);
|
451
450
|
// pointer-events 복구
|
452
451
|
if (elementRef.current) {
|
453
|
-
elementRef.current.style.pointerEvents =
|
452
|
+
elementRef.current.style.pointerEvents = "auto";
|
454
453
|
}
|
455
|
-
document.querySelectorAll(
|
456
|
-
el.classList.remove(
|
454
|
+
document.querySelectorAll(".cb-layout-box.hovered").forEach(function (el) {
|
455
|
+
el.classList.remove("hovered");
|
457
456
|
});
|
458
457
|
if (underlyingElement &&
|
459
|
-
underlyingElement.classList.contains(
|
460
|
-
underlyingElement.classList.add(
|
458
|
+
underlyingElement.classList.contains("cb-layout-box")) {
|
459
|
+
underlyingElement.classList.add("hovered");
|
461
460
|
}
|
462
461
|
},
|
463
462
|
onMouseLeave: function () {
|
464
|
-
document.querySelectorAll(
|
465
|
-
el.classList.remove(
|
463
|
+
document.querySelectorAll(".cb-layout-box.hovered").forEach(function (el) {
|
464
|
+
el.classList.remove("hovered");
|
466
465
|
});
|
467
466
|
},
|
468
467
|
});
|
@@ -1,6 +1,6 @@
|
|
1
|
-
import { DragEvent, SyntheticEvent } from
|
2
|
-
import { RowHeight } from
|
3
|
-
import { ResizeHandleAxis, ResizeHandleType } from
|
1
|
+
import { DragEvent, SyntheticEvent } from "react";
|
2
|
+
import { RowHeight } from "../GridLayoutEditor/types";
|
3
|
+
import { ResizeHandleAxis, ResizeHandleType } from "../Resizable/types";
|
4
4
|
export type PartialPosition = {
|
5
5
|
top: number;
|
6
6
|
left: number;
|
@@ -83,6 +83,7 @@ export type GridItemProps = {
|
|
83
83
|
autoResize: boolean;
|
84
84
|
zOrder?: number;
|
85
85
|
zOrderInternal?: string;
|
86
|
+
isPinned: boolean;
|
86
87
|
};
|
87
88
|
export type GridItemDefaultProps = {
|
88
89
|
className: string;
|
@@ -108,5 +109,5 @@ export type ReactDraggableCallbackData = {
|
|
108
109
|
lastX: number;
|
109
110
|
lastY: number;
|
110
111
|
};
|
111
|
-
export type ResizeHandlerNameType =
|
112
|
+
export type ResizeHandlerNameType = "onResizeStart" | "onResize" | "onResizeStop";
|
112
113
|
export {};
|
@@ -35,6 +35,7 @@ import { useState, useRef, useLayoutEffect } from "react";
|
|
35
35
|
import classNames from "../../external-lib/classnames";
|
36
36
|
import { bottom, cloneLayoutItem, compact, getAllCollisions, getBoundingArea, getLayoutItem, moveElement, noop, synchronizeLayoutWithChildren, withLayoutItem, } from "./utils/renderHelpers";
|
37
37
|
import { calcGridColWidth, calcXY, resolveRowHeight, } from "../GridItem/utils/calculateUtils";
|
38
|
+
// NOTE: 필수 변경하기
|
38
39
|
import GridItem from "../GridItem/GridItem";
|
39
40
|
import isEqual from "../../external-lib/lodash.isEqual";
|
40
41
|
import { findAllChildrenCbIds, findBlockByBlockId, findDirectChildrenBlockIds, findDirectChildrenCbIds, findGroupBlocks, findParentGroupBlock, formatCbIdToBlockId, getBlockSpecificType, zIndexMap, } from "./group";
|
@@ -59,6 +60,9 @@ var ReactGridLayout = function (_a) {
|
|
59
60
|
var _7 = useState(), droppingPosition = _7[0], setDroppingPosition = _7[1];
|
60
61
|
var _8 = useState(false), isMounted = _8[0], setIsMounted = _8[1];
|
61
62
|
var editorMode = props.isDraggable && props.isResizable ? "EDIT" : "VIEW";
|
63
|
+
var selectedBlock = blockStructure
|
64
|
+
? findBlockByBlockId(blockStructure, editingGroupBlock)
|
65
|
+
: null;
|
62
66
|
var editableBlockIds = blockStructure
|
63
67
|
? findDirectChildrenCbIds(blockStructure, editingGroupBlock)
|
64
68
|
: [];
|
@@ -528,7 +532,7 @@ var ReactGridLayout = function (_a) {
|
|
528
532
|
if (!item) {
|
529
533
|
return null;
|
530
534
|
}
|
531
|
-
return (_jsx(GridItem, { 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, children: item && item }));
|
535
|
+
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 }));
|
532
536
|
};
|
533
537
|
/**
|
534
538
|
* Given a grid item, set its style attributes & surround in a <Draggable>.
|
@@ -568,7 +572,7 @@ var ReactGridLayout = function (_a) {
|
|
568
572
|
var isInsideOfEditingGroup = editingGroupAllChildren.includes(l.i);
|
569
573
|
var editorZIndex = (function () {
|
570
574
|
if (isRoot && isInBulk) {
|
571
|
-
return
|
575
|
+
return z;
|
572
576
|
}
|
573
577
|
if (!isRoot && isInsideOfEditingGroup) {
|
574
578
|
return zIndexMap.CB_IN_EDITING_GROUP + z;
|
@@ -585,9 +589,11 @@ var ReactGridLayout = function (_a) {
|
|
585
589
|
return z;
|
586
590
|
})();
|
587
591
|
var zIndex = editorMode === "EDIT" ? editorZIndex : z;
|
588
|
-
return (_jsx(GridItem, {
|
592
|
+
return (_jsx(GridItem, { isPinned: device === "DESKTOP"
|
593
|
+
? !!block.isPinnedDesktop
|
594
|
+
: !!block.isPinnedMobile, className: classNames({
|
589
595
|
"editable-grid-item": !isRoot && editable,
|
590
|
-
"not-editable-grid-item": !editable,
|
596
|
+
"not-editable-grid-item": !isRoot && !editable,
|
591
597
|
"bulk-child-item": isInBulk,
|
592
598
|
"outside-of-editing-group": !isInsideOfEditingGroup,
|
593
599
|
}), z: zIndex, zOrder: l.z, zOrderInternal: parent
|
@@ -696,7 +702,7 @@ var ReactGridLayout = function (_a) {
|
|
696
702
|
return zIndexMap.EDITABLE_GROUP + internalZOrder;
|
697
703
|
}
|
698
704
|
if (type === "GROUP_BLOCK") {
|
699
|
-
return zIndexMap.
|
705
|
+
return zIndexMap.GROUP;
|
700
706
|
}
|
701
707
|
return -1; // NOTE: ERROR
|
702
708
|
})();
|
@@ -714,7 +720,9 @@ var ReactGridLayout = function (_a) {
|
|
714
720
|
var parent = blockStructure
|
715
721
|
? findParentGroupBlock(blockStructure, block.blockId)
|
716
722
|
: null;
|
717
|
-
return (_jsx(OutsideClickHandler, { onOutsideClick: onDoubleClickOutsideGroup, children: _jsx(GroupItem, {
|
723
|
+
return (_jsx(OutsideClickHandler, { onOutsideClick: onDoubleClickOutsideGroup, children: _jsx(GroupItem, { isPinned: device === "DESKTOP"
|
724
|
+
? !!block.isPinnedDesktop
|
725
|
+
: !!block.isPinnedMobile, className: classNames({
|
718
726
|
"bulk-child-item": isInBulk,
|
719
727
|
"grid-bulk-block": block.blockId === "BULK",
|
720
728
|
editing: editingGroupBlock === block.blockId,
|
@@ -22,6 +22,8 @@ export type ComponentBlock = {
|
|
22
22
|
zOrderDesktopInternal: number | null;
|
23
23
|
zOrderMobileInternal: number | null;
|
24
24
|
componentBlockId: number;
|
25
|
+
isPinnedDesktop: boolean;
|
26
|
+
isPinnedMobile: boolean;
|
25
27
|
};
|
26
28
|
export type GroupBlock = {
|
27
29
|
blockId: string;
|
@@ -29,6 +31,8 @@ export type GroupBlock = {
|
|
29
31
|
zOrderDesktopInternal: number | null;
|
30
32
|
zOrderMobileInternal: number | null;
|
31
33
|
children: (ComponentBlock | GroupBlock)[];
|
34
|
+
isPinnedDesktop: boolean;
|
35
|
+
isPinnedMobile: boolean;
|
32
36
|
};
|
33
37
|
export type RootBlock = {
|
34
38
|
blockId: "ROOT";
|
@@ -36,6 +40,8 @@ export type RootBlock = {
|
|
36
40
|
zOrderDesktopInternal: number | null;
|
37
41
|
zOrderMobileInternal: number | null;
|
38
42
|
children: (ComponentBlock | GroupBlock)[];
|
43
|
+
isPinnedDesktop: boolean;
|
44
|
+
isPinnedMobile: boolean;
|
39
45
|
};
|
40
46
|
export type BulkBlockInternal = {
|
41
47
|
blockId: "BULK";
|
@@ -43,6 +49,8 @@ export type BulkBlockInternal = {
|
|
43
49
|
zOrderDesktopInternal: number;
|
44
50
|
zOrderMobileInternal: number;
|
45
51
|
children: (ComponentBlock | GroupBlock)[];
|
52
|
+
isPinnedDesktop: boolean;
|
53
|
+
isPinnedMobile: boolean;
|
46
54
|
};
|
47
55
|
export declare const findBlockByBlockId: (block: Block, blockId: string) => Block | null;
|
48
56
|
export declare const findDirectChildrenCbIds: (block: Block, targetId: string) => number[];
|
@@ -15,7 +15,7 @@ export var zIndexMap = {
|
|
15
15
|
EDITING_GROUP: 9000,
|
16
16
|
GROUP: 5000,
|
17
17
|
CB: 0,
|
18
|
-
ROOT:
|
18
|
+
ROOT: 0, //?
|
19
19
|
};
|
20
20
|
export function getBlockSpecificType(block) {
|
21
21
|
if (block.blockId === "ROOT") {
|
@@ -217,6 +217,8 @@ export var addBulkToTarget = function (block, targetId, bulkBlockIds) {
|
|
217
217
|
zOrderDesktopInternal: zOrderDesktopInternal,
|
218
218
|
zOrderMobileInternal: zOrderMobileInternal,
|
219
219
|
children: bulkBlocks,
|
220
|
+
isPinnedDesktop: false,
|
221
|
+
isPinnedMobile: false,
|
220
222
|
};
|
221
223
|
// Add the bulkBlock to the target's children
|
222
224
|
targetBlock.children.push(bulkBlock);
|
@@ -1,8 +1,8 @@
|
|
1
|
-
import { DragEvent, ReactElement, RefObject } from
|
2
|
-
import { ResizeHandleAxis, ResizeHandleType } from
|
3
|
-
import { ResizeEventType } from
|
4
|
-
import { Block } from
|
5
|
-
export type CompactType =
|
1
|
+
import { DragEvent, ReactElement, RefObject } from "react";
|
2
|
+
import { ResizeHandleAxis, ResizeHandleType } from "../Resizable/types";
|
3
|
+
import { ResizeEventType } from "../GridItem/types";
|
4
|
+
import { Block } from "./group";
|
5
|
+
export type CompactType = "vertical" | "horizontal";
|
6
6
|
export type LayoutItem = {
|
7
7
|
w: number;
|
8
8
|
h: number;
|
@@ -22,6 +22,7 @@ export type LayoutItem = {
|
|
22
22
|
isBounded?: boolean;
|
23
23
|
groupLayouts?: LayoutItem[];
|
24
24
|
autoResize?: boolean;
|
25
|
+
isPinned?: boolean;
|
25
26
|
};
|
26
27
|
export type Layout = LayoutItem[];
|
27
28
|
export type DroppedEvent = {
|
@@ -82,8 +83,8 @@ export type ReactGridLayoutProps = {
|
|
82
83
|
onFitToContent?: OnFitContentCallBack;
|
83
84
|
blockStructure?: Block;
|
84
85
|
onDoubleClickGroup?: (e: React.MouseEvent, id: string, type: string) => void;
|
85
|
-
selectedGroupBlock?:
|
86
|
-
editingGroupBlock?:
|
86
|
+
selectedGroupBlock?: "ROOT" | string;
|
87
|
+
editingGroupBlock?: "ROOT" | string;
|
87
88
|
onClickGroup?: (e: React.MouseEvent, id: string, type: string) => void;
|
88
89
|
bulkIds?: string[];
|
89
90
|
onDoubleClickOutsideGroup: () => void;
|
@@ -143,7 +144,7 @@ export type ResponsiveGridLayoutStateType = {
|
|
143
144
|
layout: Layout;
|
144
145
|
layouts?: ResponsiveLayout<string>;
|
145
146
|
};
|
146
|
-
type CoreType = Omit<ReactGridLayoutProps,
|
147
|
+
type CoreType = Omit<ReactGridLayoutProps, "cols" | "layout" | "margin" | "containerPadding" | "transformScale" | "onLayoutChange" | "isHiddenVisibility">;
|
147
148
|
export type ResponsiveGridLayoutProps = {
|
148
149
|
breakpoint?: Breakpoint;
|
149
150
|
breakpoints?: Breakpoints<Breakpoint>;
|
@@ -157,7 +158,7 @@ export type ResponsiveGridLayoutProps = {
|
|
157
158
|
zoom?: number;
|
158
159
|
} & CoreType;
|
159
160
|
export type Breakpoint = string;
|
160
|
-
export type DefaultBreakpoints =
|
161
|
+
export type DefaultBreakpoints = "lg" | "md" | "sm" | "xs" | "xxs";
|
161
162
|
export type ResponsiveLayout<T extends Breakpoint> = Record<T, Layout>;
|
162
163
|
export type Breakpoints<T extends Breakpoint> = Record<T, number>;
|
163
164
|
export type OnLayoutChangeCallback = (properties: {
|
@@ -1,6 +1,6 @@
|
|
1
|
-
import React from
|
2
|
-
import { PropsWithChildren } from
|
3
|
-
import { ResizableProps } from
|
1
|
+
import React from "react";
|
2
|
+
import { PropsWithChildren } from "../Draggable/types";
|
3
|
+
import { ResizableProps } from "./types";
|
4
4
|
type Props = ResizableProps;
|
5
5
|
declare const Resizable: ({ children, axis, handleSize, lockAspectRatio, minConstraints, maxConstraints, resizeHandles, transformScale, isResizing, autoResize, colWidth, margin, ...props }: PropsWithChildren<Props>) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
|
6
6
|
export default Resizable;
|