@trops/dash-core 0.1.725 → 0.1.726
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/dist/index.esm.js +372 -332
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +371 -331
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -20,7 +20,7 @@ import { EllipsisVerticalIcon } from '@heroicons/react/20/solid';
|
|
|
20
20
|
import { findIconDefinition } from '@fortawesome/fontawesome-svg-core';
|
|
21
21
|
import deepEqual from 'deep-equal';
|
|
22
22
|
import clsx from 'clsx';
|
|
23
|
-
import { DndProvider, useDrag, useDrop } from 'react-dnd';
|
|
23
|
+
import { DndProvider, useDrag, useDrop, DndContext } from 'react-dnd';
|
|
24
24
|
import { HTML5Backend } from 'react-dnd-html5-backend';
|
|
25
25
|
import _possibleConstructorReturn from '@babel/runtime/helpers/possibleConstructorReturn';
|
|
26
26
|
import _getPrototypeOf from '@babel/runtime/helpers/getPrototypeOf';
|
|
@@ -6239,7 +6239,7 @@ var Layout = function Layout(_ref) {
|
|
|
6239
6239
|
});
|
|
6240
6240
|
};
|
|
6241
6241
|
|
|
6242
|
-
var _excluded$6 = ["id", "children", "direction", "className", "scrollable", "width", "height", "space", "grow", "debug", "onClick", "padding", "prefix"];
|
|
6242
|
+
var _excluded$6 = ["id", "children", "direction", "className", "scrollable", "width", "height", "space", "grow", "debug", "onClick", "padding", "prefix", "style"];
|
|
6243
6243
|
var LayoutContainer = function LayoutContainer(_ref) {
|
|
6244
6244
|
var id = _ref.id,
|
|
6245
6245
|
children = _ref.children,
|
|
@@ -6265,6 +6265,8 @@ var LayoutContainer = function LayoutContainer(_ref) {
|
|
|
6265
6265
|
padding = _ref$padding === void 0 ? "" : _ref$padding,
|
|
6266
6266
|
_ref$prefix = _ref.prefix,
|
|
6267
6267
|
prefix = _ref$prefix === void 0 ? "layout-container" : _ref$prefix,
|
|
6268
|
+
_ref$style = _ref.style,
|
|
6269
|
+
style = _ref$style === void 0 ? undefined : _ref$style,
|
|
6268
6270
|
props = _objectWithoutProperties(_ref, _excluded$6);
|
|
6269
6271
|
var containerId = "uuid" in props ? props["uuid"] : getUUID(id, prefix);
|
|
6270
6272
|
|
|
@@ -6301,6 +6303,7 @@ var LayoutContainer = function LayoutContainer(_ref) {
|
|
|
6301
6303
|
// id={`LayoutContainer-${containerId}-${id}`}
|
|
6302
6304
|
id: containerId,
|
|
6303
6305
|
className: "flex ".concat(classString, " ").concat(className),
|
|
6306
|
+
style: style,
|
|
6304
6307
|
onClick: onClick,
|
|
6305
6308
|
children: [debug === false && children, debug === true && renderDebugger(children, styles.string)]
|
|
6306
6309
|
});
|
|
@@ -22926,7 +22929,7 @@ var LayoutBuilder = function LayoutBuilder(_ref) {
|
|
|
22926
22929
|
className: "flex flex-col w-full h-full overflow-clip",
|
|
22927
22930
|
children: [/*#__PURE__*/jsx("div", {
|
|
22928
22931
|
className: "flex flex-row w-full h-full overflow-clip",
|
|
22929
|
-
children: /*#__PURE__*/
|
|
22932
|
+
children: /*#__PURE__*/jsx(LayoutContainer, {
|
|
22930
22933
|
id: "search-layout-builder",
|
|
22931
22934
|
scrollable: !preview,
|
|
22932
22935
|
direction: "col",
|
|
@@ -22934,45 +22937,7 @@ var LayoutBuilder = function LayoutBuilder(_ref) {
|
|
|
22934
22937
|
height: "h-full",
|
|
22935
22938
|
grow: true,
|
|
22936
22939
|
space: preview,
|
|
22937
|
-
children:
|
|
22938
|
-
dashboardId: dashboardId,
|
|
22939
|
-
isDraggable: true,
|
|
22940
|
-
workspace: currentWorkspace,
|
|
22941
|
-
header: currentWorkspace["name"],
|
|
22942
|
-
layout: currentWorkspace["layout"],
|
|
22943
|
-
parentKey: 0,
|
|
22944
|
-
debugMode: debugMode,
|
|
22945
|
-
previewMode: preview,
|
|
22946
|
-
onClickAdd: onClickAdd,
|
|
22947
|
-
onClickQuickAdd: onClickQuickAdd,
|
|
22948
|
-
onClickRemove: onClickRemove,
|
|
22949
|
-
onClickShrink: onClickShrink,
|
|
22950
|
-
onClickExpand: onClickExpand,
|
|
22951
|
-
onClickEmptyCell: handleOnClickEmptyCell,
|
|
22952
|
-
onSelectWidgetForCell: handleSelectWidgetForCell,
|
|
22953
|
-
onChangeDirection: onChangeDirection,
|
|
22954
|
-
onChangeOrder: onChangeOrder,
|
|
22955
|
-
onDropItem: onDropItem,
|
|
22956
|
-
onDragItem: onDragItem,
|
|
22957
|
-
onOpenConfig: handleClickEditItem,
|
|
22958
|
-
onOpenEvents: handleClickEvents,
|
|
22959
|
-
onSaveConfiguration: handleSaveConfiguration,
|
|
22960
|
-
onProviderSelect: handleSelectProvider,
|
|
22961
|
-
onCreateProvider: handleOpenProviderModal,
|
|
22962
|
-
onClickEdit: onTogglePreview,
|
|
22963
|
-
onSplitCell: handleSplitCell,
|
|
22964
|
-
onMergeCells: handleMergeCells,
|
|
22965
|
-
onAddGridRow: handleAddGridRow,
|
|
22966
|
-
onDeleteGridRow: handleDeleteGridRow,
|
|
22967
|
-
onAddGridColumn: handleAddGridColumn,
|
|
22968
|
-
onDeleteGridColumn: handleDeleteGridColumn,
|
|
22969
|
-
onChangeRowHeight: handleChangeRowHeight,
|
|
22970
|
-
onChangeRowMode: handleChangeRowMode,
|
|
22971
|
-
onChangeRowSizing: handleChangeRowSizing,
|
|
22972
|
-
onChangeColMode: handleChangeColMode,
|
|
22973
|
-
onMoveWidgetToCell: handleMoveWidgetToCell,
|
|
22974
|
-
onWidgetPopout: onWidgetPopout
|
|
22975
|
-
}, "layout-drag-".concat(dashboardId)), preview === false && editMode === "all" && /*#__PURE__*/jsx(LayoutDragBuilderEdit, {
|
|
22940
|
+
children: (preview === true || editMode === "all") && /*#__PURE__*/jsx(LayoutDragBuilderEdit, {
|
|
22976
22941
|
dashboardId: dashboardId,
|
|
22977
22942
|
isDraggable: true,
|
|
22978
22943
|
workspace: currentWorkspace,
|
|
@@ -23019,8 +22984,9 @@ var LayoutBuilder = function LayoutBuilder(_ref) {
|
|
|
23019
22984
|
onChangeRowSizing: handleChangeRowSizing,
|
|
23020
22985
|
onChangeColMode: handleChangeColMode,
|
|
23021
22986
|
onMoveWidgetToCell: handleMoveWidgetToCell,
|
|
23022
|
-
onDropWidgetFromSidebar: handleDropWidgetFromSidebar
|
|
23023
|
-
|
|
22987
|
+
onDropWidgetFromSidebar: handleDropWidgetFromSidebar,
|
|
22988
|
+
onWidgetPopout: onWidgetPopout
|
|
22989
|
+
}, "layout-drag-".concat(dashboardId))
|
|
23024
22990
|
}, "search-layout-builder")
|
|
23025
22991
|
}), /*#__PURE__*/jsxs(AppThemeScope, {
|
|
23026
22992
|
children: [showWidgetDropdown && /*#__PURE__*/jsx(EnhancedWidgetDropdown, {
|
|
@@ -23239,7 +23205,9 @@ var LayoutDragBuilderEdit = function LayoutDragBuilderEdit(_ref) {
|
|
|
23239
23205
|
_ref$onMoveWidgetToCe = _ref.onMoveWidgetToCell,
|
|
23240
23206
|
onMoveWidgetToCell = _ref$onMoveWidgetToCe === void 0 ? null : _ref$onMoveWidgetToCe,
|
|
23241
23207
|
_ref$onDropWidgetFrom = _ref.onDropWidgetFromSidebar,
|
|
23242
|
-
onDropWidgetFromSidebar = _ref$onDropWidgetFrom === void 0 ? null : _ref$onDropWidgetFrom
|
|
23208
|
+
onDropWidgetFromSidebar = _ref$onDropWidgetFrom === void 0 ? null : _ref$onDropWidgetFrom,
|
|
23209
|
+
_ref$onWidgetPopout = _ref.onWidgetPopout,
|
|
23210
|
+
onWidgetPopout = _ref$onWidgetPopout === void 0 ? null : _ref$onWidgetPopout;
|
|
23243
23211
|
// DndProvider is supplied by DashboardStage — no local provider needed.
|
|
23244
23212
|
return _renderLayout({
|
|
23245
23213
|
dashboardId: dashboardId,
|
|
@@ -23278,7 +23246,8 @@ var LayoutDragBuilderEdit = function LayoutDragBuilderEdit(_ref) {
|
|
|
23278
23246
|
onChangeRowSizing: onChangeRowSizing,
|
|
23279
23247
|
onChangeColMode: onChangeColMode,
|
|
23280
23248
|
onMoveWidgetToCell: onMoveWidgetToCell,
|
|
23281
|
-
onDropWidgetFromSidebar: onDropWidgetFromSidebar
|
|
23249
|
+
onDropWidgetFromSidebar: onDropWidgetFromSidebar,
|
|
23250
|
+
onWidgetPopout: onWidgetPopout
|
|
23282
23251
|
});
|
|
23283
23252
|
};
|
|
23284
23253
|
|
|
@@ -26273,6 +26242,45 @@ var ExternalWidget = function ExternalWidget(_ref) {
|
|
|
26273
26242
|
});
|
|
26274
26243
|
};
|
|
26275
26244
|
|
|
26245
|
+
function GridCellFrame(_ref) {
|
|
26246
|
+
var editing = _ref.editing,
|
|
26247
|
+
_ref$header = _ref.header,
|
|
26248
|
+
header = _ref$header === void 0 ? null : _ref$header,
|
|
26249
|
+
_ref$footer = _ref.footer,
|
|
26250
|
+
footer = _ref$footer === void 0 ? null : _ref$footer,
|
|
26251
|
+
_ref$onPopout = _ref.onPopout,
|
|
26252
|
+
onPopout = _ref$onPopout === void 0 ? null : _ref$onPopout,
|
|
26253
|
+
children = _ref.children;
|
|
26254
|
+
var _useState = useState(false),
|
|
26255
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
26256
|
+
hovered = _useState2[0],
|
|
26257
|
+
setHovered = _useState2[1];
|
|
26258
|
+
var showPopout = !editing && typeof onPopout === "function";
|
|
26259
|
+
return /*#__PURE__*/jsxs("div", {
|
|
26260
|
+
className: editing ? "flex flex-col w-full h-full min-h-0 overflow-hidden rounded border border-dashed border-gray-700" : "relative w-full h-full",
|
|
26261
|
+
onMouseEnter: function onMouseEnter() {
|
|
26262
|
+
return setHovered(true);
|
|
26263
|
+
},
|
|
26264
|
+
onMouseLeave: function onMouseLeave() {
|
|
26265
|
+
return setHovered(false);
|
|
26266
|
+
},
|
|
26267
|
+
children: [editing ? header : null, children, editing ? footer : null, showPopout ? /*#__PURE__*/jsx("button", {
|
|
26268
|
+
type: "button",
|
|
26269
|
+
"aria-label": "Pop out widget",
|
|
26270
|
+
title: "Pop out widget",
|
|
26271
|
+
className: "absolute top-1 right-1 p-1 rounded transition-opacity bg-black/60 hover:bg-black/80 text-gray-300 hover:text-white z-10 ".concat(hovered ? "opacity-100" : "opacity-0 pointer-events-none"),
|
|
26272
|
+
onClick: function onClick(e) {
|
|
26273
|
+
e.stopPropagation();
|
|
26274
|
+
onPopout();
|
|
26275
|
+
},
|
|
26276
|
+
children: /*#__PURE__*/jsx(FontAwesomeIcon, {
|
|
26277
|
+
icon: "arrow-up-right-from-square",
|
|
26278
|
+
className: "h-3 w-3"
|
|
26279
|
+
})
|
|
26280
|
+
}) : null]
|
|
26281
|
+
});
|
|
26282
|
+
}
|
|
26283
|
+
|
|
26276
26284
|
var GRID_CELL_WIDGET_TYPE = "grid-cell-widget";
|
|
26277
26285
|
var SIDEBAR_WIDGET_TYPE = "sidebar-widget";
|
|
26278
26286
|
|
|
@@ -26288,14 +26296,36 @@ function _objectSpread$13(e) { for (var r = 1; r < arguments.length; r++) { var
|
|
|
26288
26296
|
// the sidebar's LayoutBuilder with value "sidebar"; everything else
|
|
26289
26297
|
// defaults to "main".
|
|
26290
26298
|
var WorkspaceScopeContext = /*#__PURE__*/React__default.createContext("main");
|
|
26291
|
-
var DraggableDroppableCellBody = function DraggableDroppableCellBody(
|
|
26292
|
-
var
|
|
26293
|
-
|
|
26294
|
-
|
|
26295
|
-
|
|
26296
|
-
|
|
26297
|
-
|
|
26298
|
-
padding = _ref.padding
|
|
26299
|
+
var DraggableDroppableCellBody = function DraggableDroppableCellBody(props) {
|
|
26300
|
+
var dnd = useContext(DndContext);
|
|
26301
|
+
return dnd && dnd.dragDropManager ? /*#__PURE__*/jsx(DndCellBody, _objectSpread$13({}, props)) : /*#__PURE__*/jsx(PlainCellBody, _objectSpread$13({}, props));
|
|
26302
|
+
};
|
|
26303
|
+
var PlainCellBody = function PlainCellBody(_ref) {
|
|
26304
|
+
var _ref$enabled = _ref.enabled,
|
|
26305
|
+
enabled = _ref$enabled === void 0 ? true : _ref$enabled,
|
|
26306
|
+
_ref$padding = _ref.padding,
|
|
26307
|
+
padding = _ref$padding === void 0 ? "" : _ref$padding,
|
|
26308
|
+
children = _ref.children;
|
|
26309
|
+
return enabled ? /*#__PURE__*/jsx("div", {
|
|
26310
|
+
className: "flex-1 min-h-0 overflow-auto relative ".concat(padding),
|
|
26311
|
+
children: children
|
|
26312
|
+
}) : /*#__PURE__*/jsx("div", {
|
|
26313
|
+
style: {
|
|
26314
|
+
display: "contents"
|
|
26315
|
+
},
|
|
26316
|
+
children: children
|
|
26317
|
+
});
|
|
26318
|
+
};
|
|
26319
|
+
var DndCellBody = function DndCellBody(_ref2) {
|
|
26320
|
+
var _ref2$enabled = _ref2.enabled,
|
|
26321
|
+
enabled = _ref2$enabled === void 0 ? true : _ref2$enabled,
|
|
26322
|
+
cellNumber = _ref2.cellNumber,
|
|
26323
|
+
gridContainerId = _ref2.gridContainerId,
|
|
26324
|
+
onMoveWidgetToCell = _ref2.onMoveWidgetToCell,
|
|
26325
|
+
onDropWidgetFromSidebar = _ref2.onDropWidgetFromSidebar,
|
|
26326
|
+
hasSpan = _ref2.hasSpan,
|
|
26327
|
+
children = _ref2.children,
|
|
26328
|
+
padding = _ref2.padding;
|
|
26299
26329
|
var workspaceScope = useContext(WorkspaceScopeContext);
|
|
26300
26330
|
var _useDrag = useDrag(function () {
|
|
26301
26331
|
return {
|
|
@@ -26306,13 +26336,16 @@ var DraggableDroppableCellBody = function DraggableDroppableCellBody(_ref) {
|
|
|
26306
26336
|
hasSpan: hasSpan,
|
|
26307
26337
|
workspaceScope: workspaceScope
|
|
26308
26338
|
},
|
|
26339
|
+
canDrag: function canDrag() {
|
|
26340
|
+
return enabled;
|
|
26341
|
+
},
|
|
26309
26342
|
collect: function collect(monitor) {
|
|
26310
26343
|
return {
|
|
26311
26344
|
isDragging: monitor.isDragging()
|
|
26312
26345
|
};
|
|
26313
26346
|
}
|
|
26314
26347
|
};
|
|
26315
|
-
}, [cellNumber, gridContainerId, hasSpan, workspaceScope]),
|
|
26348
|
+
}, [cellNumber, gridContainerId, hasSpan, workspaceScope, enabled]),
|
|
26316
26349
|
_useDrag2 = _slicedToArray(_useDrag, 2),
|
|
26317
26350
|
isDragging = _useDrag2[0].isDragging,
|
|
26318
26351
|
drag = _useDrag2[1];
|
|
@@ -26320,6 +26353,7 @@ var DraggableDroppableCellBody = function DraggableDroppableCellBody(_ref) {
|
|
|
26320
26353
|
return {
|
|
26321
26354
|
accept: [GRID_CELL_WIDGET_TYPE, SIDEBAR_WIDGET_TYPE],
|
|
26322
26355
|
canDrop: function canDrop(dragItem, monitor) {
|
|
26356
|
+
if (!enabled) return false;
|
|
26323
26357
|
var itemType = monitor.getItemType();
|
|
26324
26358
|
if (itemType === SIDEBAR_WIDGET_TYPE) return true;
|
|
26325
26359
|
// Allow cross-scope drops (sidebar ↔ main dashboard). Same-scope
|
|
@@ -26366,7 +26400,7 @@ var DraggableDroppableCellBody = function DraggableDroppableCellBody(_ref) {
|
|
|
26366
26400
|
};
|
|
26367
26401
|
}
|
|
26368
26402
|
};
|
|
26369
|
-
}, [cellNumber, gridContainerId, onMoveWidgetToCell, onDropWidgetFromSidebar, hasSpan, workspaceScope]),
|
|
26403
|
+
}, [cellNumber, gridContainerId, onMoveWidgetToCell, onDropWidgetFromSidebar, hasSpan, workspaceScope, enabled]),
|
|
26370
26404
|
_useDrop2 = _slicedToArray(_useDrop, 2),
|
|
26371
26405
|
_useDrop2$ = _useDrop2[0],
|
|
26372
26406
|
isOver = _useDrop2$.isOver,
|
|
@@ -26374,6 +26408,17 @@ var DraggableDroppableCellBody = function DraggableDroppableCellBody(_ref) {
|
|
|
26374
26408
|
itemType = _useDrop2$.itemType,
|
|
26375
26409
|
drop = _useDrop2[1];
|
|
26376
26410
|
var isSidebarDrop = itemType === SIDEBAR_WIDGET_TYPE;
|
|
26411
|
+
if (!enabled) {
|
|
26412
|
+
return /*#__PURE__*/jsx("div", {
|
|
26413
|
+
ref: function ref(node) {
|
|
26414
|
+
return drag(drop(node));
|
|
26415
|
+
},
|
|
26416
|
+
style: {
|
|
26417
|
+
display: "contents"
|
|
26418
|
+
},
|
|
26419
|
+
children: children
|
|
26420
|
+
});
|
|
26421
|
+
}
|
|
26377
26422
|
return /*#__PURE__*/jsxs("div", {
|
|
26378
26423
|
ref: function ref(node) {
|
|
26379
26424
|
return drag(drop(node));
|
|
@@ -26391,12 +26436,12 @@ var DraggableDroppableCellBody = function DraggableDroppableCellBody(_ref) {
|
|
|
26391
26436
|
})]
|
|
26392
26437
|
});
|
|
26393
26438
|
};
|
|
26394
|
-
var DroppableEmptyCell = function DroppableEmptyCell(
|
|
26395
|
-
var cellNumber =
|
|
26396
|
-
gridContainerId =
|
|
26397
|
-
onMoveWidgetToCell =
|
|
26398
|
-
onDropWidgetFromSidebar =
|
|
26399
|
-
children =
|
|
26439
|
+
var DroppableEmptyCell = function DroppableEmptyCell(_ref3) {
|
|
26440
|
+
var cellNumber = _ref3.cellNumber,
|
|
26441
|
+
gridContainerId = _ref3.gridContainerId,
|
|
26442
|
+
onMoveWidgetToCell = _ref3.onMoveWidgetToCell,
|
|
26443
|
+
onDropWidgetFromSidebar = _ref3.onDropWidgetFromSidebar,
|
|
26444
|
+
children = _ref3.children;
|
|
26400
26445
|
var workspaceScope = useContext(WorkspaceScopeContext);
|
|
26401
26446
|
var _useDrop3 = useDrop(function () {
|
|
26402
26447
|
return {
|
|
@@ -26454,67 +26499,68 @@ var DroppableEmptyCell = function DroppableEmptyCell(_ref2) {
|
|
|
26454
26499
|
})]
|
|
26455
26500
|
});
|
|
26456
26501
|
};
|
|
26457
|
-
var LayoutGridContainer = /*#__PURE__*/memo(function (
|
|
26458
|
-
var
|
|
26459
|
-
|
|
26460
|
-
|
|
26461
|
-
preview =
|
|
26462
|
-
|
|
26463
|
-
|
|
26464
|
-
|
|
26465
|
-
|
|
26466
|
-
|
|
26467
|
-
|
|
26468
|
-
|
|
26469
|
-
|
|
26470
|
-
|
|
26471
|
-
|
|
26472
|
-
|
|
26473
|
-
|
|
26474
|
-
|
|
26475
|
-
|
|
26476
|
-
|
|
26477
|
-
|
|
26478
|
-
|
|
26479
|
-
|
|
26480
|
-
|
|
26481
|
-
|
|
26482
|
-
|
|
26483
|
-
|
|
26484
|
-
|
|
26485
|
-
|
|
26486
|
-
|
|
26487
|
-
|
|
26488
|
-
|
|
26489
|
-
|
|
26490
|
-
|
|
26491
|
-
|
|
26492
|
-
|
|
26493
|
-
|
|
26494
|
-
|
|
26495
|
-
|
|
26496
|
-
|
|
26497
|
-
onMergeCells =
|
|
26498
|
-
|
|
26499
|
-
onAddGridRow =
|
|
26500
|
-
|
|
26501
|
-
onDeleteGridRow =
|
|
26502
|
-
|
|
26503
|
-
onAddGridColumn =
|
|
26504
|
-
|
|
26505
|
-
|
|
26506
|
-
|
|
26507
|
-
|
|
26508
|
-
|
|
26509
|
-
|
|
26510
|
-
|
|
26511
|
-
onChangeColMode =
|
|
26512
|
-
|
|
26513
|
-
|
|
26514
|
-
|
|
26515
|
-
|
|
26516
|
-
|
|
26517
|
-
onWidgetPopout =
|
|
26502
|
+
var LayoutGridContainer = /*#__PURE__*/memo(function (_ref4) {
|
|
26503
|
+
var _item$grid3, _item$grid4, _item$grid5;
|
|
26504
|
+
var item = _ref4.item,
|
|
26505
|
+
workspace = _ref4.workspace,
|
|
26506
|
+
_ref4$preview = _ref4.preview,
|
|
26507
|
+
preview = _ref4$preview === void 0 ? false : _ref4$preview,
|
|
26508
|
+
id = _ref4.id;
|
|
26509
|
+
_ref4.parent;
|
|
26510
|
+
var scrollable = _ref4.scrollable;
|
|
26511
|
+
_ref4.space;
|
|
26512
|
+
var grow = _ref4.grow;
|
|
26513
|
+
_ref4.order;
|
|
26514
|
+
var _ref4$children = _ref4.children,
|
|
26515
|
+
children = _ref4$children === void 0 ? null : _ref4$children,
|
|
26516
|
+
onClickAdd = _ref4.onClickAdd;
|
|
26517
|
+
_ref4.onClickQuickAdd;
|
|
26518
|
+
var onClickRemove = _ref4.onClickRemove;
|
|
26519
|
+
_ref4.onChangeDirection;
|
|
26520
|
+
_ref4.onChangeOrder;
|
|
26521
|
+
_ref4.onClickExpand;
|
|
26522
|
+
_ref4.onClickShrink;
|
|
26523
|
+
var onOpenConfig = _ref4.onOpenConfig;
|
|
26524
|
+
_ref4.onOpenEvents;
|
|
26525
|
+
var _ref4$onProviderSelec = _ref4.onProviderSelect,
|
|
26526
|
+
onProviderSelect = _ref4$onProviderSelec === void 0 ? null : _ref4$onProviderSelec,
|
|
26527
|
+
_ref4$onCreateProvide = _ref4.onCreateProvider,
|
|
26528
|
+
onCreateProvider = _ref4$onCreateProvide === void 0 ? null : _ref4$onCreateProvide;
|
|
26529
|
+
_ref4.width;
|
|
26530
|
+
var _ref4$height = _ref4.height,
|
|
26531
|
+
height = _ref4$height === void 0 ? "h-full" : _ref4$height,
|
|
26532
|
+
direction = _ref4.direction,
|
|
26533
|
+
onDropItem = _ref4.onDropItem;
|
|
26534
|
+
_ref4.onDragItem;
|
|
26535
|
+
_ref4.editMode;
|
|
26536
|
+
_ref4.uuid;
|
|
26537
|
+
var layout = _ref4.layout;
|
|
26538
|
+
_ref4.component;
|
|
26539
|
+
_ref4.isDraggable;
|
|
26540
|
+
var _ref4$onSplitCell = _ref4.onSplitCell,
|
|
26541
|
+
onSplitCell = _ref4$onSplitCell === void 0 ? null : _ref4$onSplitCell,
|
|
26542
|
+
_ref4$onMergeCells = _ref4.onMergeCells,
|
|
26543
|
+
onMergeCells = _ref4$onMergeCells === void 0 ? null : _ref4$onMergeCells,
|
|
26544
|
+
_ref4$onAddGridRow = _ref4.onAddGridRow,
|
|
26545
|
+
onAddGridRow = _ref4$onAddGridRow === void 0 ? null : _ref4$onAddGridRow,
|
|
26546
|
+
_ref4$onDeleteGridRow = _ref4.onDeleteGridRow,
|
|
26547
|
+
onDeleteGridRow = _ref4$onDeleteGridRow === void 0 ? null : _ref4$onDeleteGridRow,
|
|
26548
|
+
_ref4$onAddGridColumn = _ref4.onAddGridColumn,
|
|
26549
|
+
onAddGridColumn = _ref4$onAddGridColumn === void 0 ? null : _ref4$onAddGridColumn,
|
|
26550
|
+
_ref4$onDeleteGridCol = _ref4.onDeleteGridColumn,
|
|
26551
|
+
onDeleteGridColumn = _ref4$onDeleteGridCol === void 0 ? null : _ref4$onDeleteGridCol;
|
|
26552
|
+
_ref4.onChangeRowHeight;
|
|
26553
|
+
_ref4.onChangeRowMode;
|
|
26554
|
+
var _ref4$onChangeRowSizi = _ref4.onChangeRowSizing,
|
|
26555
|
+
onChangeRowSizing = _ref4$onChangeRowSizi === void 0 ? null : _ref4$onChangeRowSizi,
|
|
26556
|
+
_ref4$onChangeColMode = _ref4.onChangeColMode,
|
|
26557
|
+
onChangeColMode = _ref4$onChangeColMode === void 0 ? null : _ref4$onChangeColMode,
|
|
26558
|
+
_ref4$onMoveWidgetToC = _ref4.onMoveWidgetToCell,
|
|
26559
|
+
onMoveWidgetToCell = _ref4$onMoveWidgetToC === void 0 ? null : _ref4$onMoveWidgetToC,
|
|
26560
|
+
_ref4$onDropWidgetFro = _ref4.onDropWidgetFromSidebar,
|
|
26561
|
+
onDropWidgetFromSidebar = _ref4$onDropWidgetFro === void 0 ? null : _ref4$onDropWidgetFro,
|
|
26562
|
+
_ref4$onWidgetPopout = _ref4.onWidgetPopout,
|
|
26563
|
+
onWidgetPopout = _ref4$onWidgetPopout === void 0 ? null : _ref4$onWidgetPopout;
|
|
26518
26564
|
// Get providers from AppContext (not DashboardContext, which has a structural
|
|
26519
26565
|
// issue where providers from AppWrapper don't flow through DashboardWrapper)
|
|
26520
26566
|
var appCtx = useContext(AppContext);
|
|
@@ -26522,10 +26568,10 @@ var LayoutGridContainer = /*#__PURE__*/memo(function (_ref3) {
|
|
|
26522
26568
|
|
|
26523
26569
|
// Convert providers object to array format expected by WidgetCardHeader
|
|
26524
26570
|
// Providers from context are stored as: { "provider-name": { name, type, credentials, ... }, ... }
|
|
26525
|
-
var availableProviders = providersObj && _typeof(providersObj) === "object" ? Object.entries(providersObj).map(function (
|
|
26526
|
-
var
|
|
26527
|
-
id =
|
|
26528
|
-
provider =
|
|
26571
|
+
var availableProviders = providersObj && _typeof(providersObj) === "object" ? Object.entries(providersObj).map(function (_ref5) {
|
|
26572
|
+
var _ref6 = _slicedToArray(_ref5, 2),
|
|
26573
|
+
id = _ref6[0],
|
|
26574
|
+
provider = _ref6[1];
|
|
26529
26575
|
return _objectSpread$13({
|
|
26530
26576
|
id: id
|
|
26531
26577
|
}, provider);
|
|
@@ -27325,44 +27371,13 @@ var LayoutGridContainer = /*#__PURE__*/memo(function (_ref3) {
|
|
|
27325
27371
|
className: "flex w-full ".concat(heightClass, " min-h-0 min-w-0 overflow-hidden relative ").concat(isCellSelected ? "ring-2 ring-blue-500 ring-inset rounded" : ""),
|
|
27326
27372
|
"data-cell": cellNumber,
|
|
27327
27373
|
style: spanStyle,
|
|
27328
|
-
children: preview ? cellDef.component ? renderCellComponent(cellDef.component) : renderPreviewEmptyCell(cellNumber) : renderEditCell(cellNumber, cellDef, selectableSet)
|
|
27374
|
+
children: preview ? cellDef.component ? renderCellComponent(cellDef.component, cellNumber) : renderPreviewEmptyCell(cellNumber) : renderEditCell(cellNumber, cellDef, selectableSet)
|
|
27329
27375
|
}, cellNumber));
|
|
27330
27376
|
}
|
|
27331
27377
|
}
|
|
27332
27378
|
return cells;
|
|
27333
27379
|
}
|
|
27334
27380
|
|
|
27335
|
-
// Hover-based popout overlay — avoids Tailwind named groups (requires v3.4+)
|
|
27336
|
-
function PopoutOverlay(_ref6) {
|
|
27337
|
-
var children = _ref6.children,
|
|
27338
|
-
onPopout = _ref6.onPopout;
|
|
27339
|
-
var _React$useState = React__default.useState(false),
|
|
27340
|
-
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
27341
|
-
hovered = _React$useState2[0],
|
|
27342
|
-
setHovered = _React$useState2[1];
|
|
27343
|
-
return /*#__PURE__*/jsxs("div", {
|
|
27344
|
-
className: "relative w-full h-full",
|
|
27345
|
-
onMouseEnter: function onMouseEnter() {
|
|
27346
|
-
return setHovered(true);
|
|
27347
|
-
},
|
|
27348
|
-
onMouseLeave: function onMouseLeave() {
|
|
27349
|
-
return setHovered(false);
|
|
27350
|
-
},
|
|
27351
|
-
children: [children, /*#__PURE__*/jsx("button", {
|
|
27352
|
-
className: "absolute top-1 right-1 p-1 rounded transition-opacity bg-black/60 hover:bg-black/80 text-gray-300 hover:text-white z-10 ".concat(hovered ? "opacity-100" : "opacity-0 pointer-events-none"),
|
|
27353
|
-
onClick: function onClick(e) {
|
|
27354
|
-
e.stopPropagation();
|
|
27355
|
-
onPopout();
|
|
27356
|
-
},
|
|
27357
|
-
title: "Pop out widget",
|
|
27358
|
-
children: /*#__PURE__*/jsx(FontAwesomeIcon, {
|
|
27359
|
-
icon: "arrow-up-right-from-square",
|
|
27360
|
-
className: "h-3 w-3"
|
|
27361
|
-
})
|
|
27362
|
-
})]
|
|
27363
|
-
});
|
|
27364
|
-
}
|
|
27365
|
-
|
|
27366
27381
|
// Render component inside a grid cell (preview mode only)
|
|
27367
27382
|
function renderCellComponent(componentId, cellNumber, selectableSet) {
|
|
27368
27383
|
if (!layout || !workspace) {
|
|
@@ -27375,21 +27390,29 @@ var LayoutGridContainer = /*#__PURE__*/memo(function (_ref3) {
|
|
|
27375
27390
|
return null;
|
|
27376
27391
|
}
|
|
27377
27392
|
var rendered = renderComponent(cellComponent.component, cellComponent.id, cellComponent, null);
|
|
27378
|
-
|
|
27379
|
-
|
|
27380
|
-
|
|
27381
|
-
|
|
27382
|
-
|
|
27383
|
-
|
|
27384
|
-
|
|
27385
|
-
|
|
27386
|
-
|
|
27387
|
-
|
|
27388
|
-
|
|
27393
|
+
|
|
27394
|
+
// Prefer uuid over id — uuid is `${dashboardId}-${component}-${id}`
|
|
27395
|
+
// which is globally unique, while id is only unique within a
|
|
27396
|
+
// single page/container. Passing bare id causes WidgetPopoutStage
|
|
27397
|
+
// to find-first-match across layout/pages and render the wrong
|
|
27398
|
+
// widget when two pages share the same numeric id.
|
|
27399
|
+
var popoutKey = cellComponent.uuid || cellComponent.id;
|
|
27400
|
+
var onPopout = onWidgetPopout && cellComponent.component ? function () {
|
|
27401
|
+
return onWidgetPopout(popoutKey);
|
|
27402
|
+
} : null;
|
|
27403
|
+
|
|
27404
|
+
// Same frame and body types as edit mode (renderEditCell), so the
|
|
27405
|
+
// widget stays mounted across view ↔ edit (phase 1c).
|
|
27406
|
+
return /*#__PURE__*/jsx(GridCellFrame, {
|
|
27407
|
+
editing: false,
|
|
27408
|
+
onPopout: onPopout,
|
|
27409
|
+
children: /*#__PURE__*/jsx(DraggableDroppableCellBody, {
|
|
27410
|
+
enabled: false,
|
|
27411
|
+
cellNumber: cellNumber,
|
|
27412
|
+
gridContainerId: id,
|
|
27389
27413
|
children: rendered
|
|
27390
|
-
})
|
|
27391
|
-
}
|
|
27392
|
-
return rendered;
|
|
27414
|
+
})
|
|
27415
|
+
});
|
|
27393
27416
|
}
|
|
27394
27417
|
|
|
27395
27418
|
// Render empty cell in preview mode
|
|
@@ -27460,69 +27483,88 @@ var LayoutGridContainer = /*#__PURE__*/memo(function (_ref3) {
|
|
|
27460
27483
|
renderedWidget = renderComponent(cellComponent.component, cellComponent.id, cellComponent, null);
|
|
27461
27484
|
}
|
|
27462
27485
|
}
|
|
27486
|
+
var header = /*#__PURE__*/jsx(WidgetCard.Header, {
|
|
27487
|
+
item: cellComponent,
|
|
27488
|
+
cellNumber: cellNumber,
|
|
27489
|
+
providers: cellComponent ? availableProviders || [] : [],
|
|
27490
|
+
selectedProviders: ((_cellComponent = cellComponent) === null || _cellComponent === void 0 ? void 0 : _cellComponent.selectedProviders) || {},
|
|
27491
|
+
isSelected: isCellSelected,
|
|
27492
|
+
isSelectable: isCellSelectable,
|
|
27493
|
+
onToggleSelect: function onToggleSelect() {
|
|
27494
|
+
return handleToggleCellSelection(cellNumber);
|
|
27495
|
+
},
|
|
27496
|
+
onSplitHorizontal: function onSplitHorizontal() {
|
|
27497
|
+
return handleInstantSplit(cellNumber, "horizontal");
|
|
27498
|
+
},
|
|
27499
|
+
onSplitVertical: function onSplitVertical() {
|
|
27500
|
+
return handleInstantSplit(cellNumber, "vertical");
|
|
27501
|
+
},
|
|
27502
|
+
onProviderChange: cellComponent ? function (providerType, providerId, isCreateNew) {
|
|
27503
|
+
if (isCreateNew) {
|
|
27504
|
+
if (onCreateProvider) {
|
|
27505
|
+
onCreateProvider(cellComponent.id, providerType, true);
|
|
27506
|
+
}
|
|
27507
|
+
} else {
|
|
27508
|
+
if (onProviderSelect) {
|
|
27509
|
+
onProviderSelect(cellComponent.id, providerType, providerId);
|
|
27510
|
+
}
|
|
27511
|
+
}
|
|
27512
|
+
} : undefined,
|
|
27513
|
+
onConfigure: cellComponent ? function (widgetItem, section) {
|
|
27514
|
+
if (onOpenConfig) onOpenConfig(cellComponent, section);
|
|
27515
|
+
} : undefined,
|
|
27516
|
+
onDelete: cellComponent ? function () {
|
|
27517
|
+
if (onClickRemove) onClickRemove(cellComponent.id);
|
|
27518
|
+
} : undefined,
|
|
27519
|
+
onEditWithAI: cellComponent ? function () {
|
|
27520
|
+
var _ComponentManager$con;
|
|
27521
|
+
window.dispatchEvent(new CustomEvent("dash:edit-widget-with-ai", {
|
|
27522
|
+
detail: {
|
|
27523
|
+
cellNumber: cellNumber,
|
|
27524
|
+
gridItemId: item.id,
|
|
27525
|
+
workspaceId: workspace === null || workspace === void 0 ? void 0 : workspace.id,
|
|
27526
|
+
widgetComponentName: cellComponent.component,
|
|
27527
|
+
widgetId: cellComponent.id,
|
|
27528
|
+
selectedProviders: cellComponent.selectedProviders || null,
|
|
27529
|
+
// Pass the live widget's userPrefs so the
|
|
27530
|
+
// preview renders the same configured state
|
|
27531
|
+
// the user sees on the dashboard (titles,
|
|
27532
|
+
// defaults, etc.) instead of blank values.
|
|
27533
|
+
userPrefs: cellComponent.userPrefs || null,
|
|
27534
|
+
sourcePackage: ((_ComponentManager$con = ComponentManager.config(cellComponent.component, cellComponent)) === null || _ComponentManager$con === void 0 ? void 0 : _ComponentManager$con._sourcePackage) || null
|
|
27535
|
+
}
|
|
27536
|
+
}));
|
|
27537
|
+
} : undefined
|
|
27538
|
+
});
|
|
27539
|
+
var footer = cellComponent ? /*#__PURE__*/jsx(WidgetCard.Footer, {
|
|
27540
|
+
item: cellComponent,
|
|
27541
|
+
onConfigure: function onConfigure(item, section) {
|
|
27542
|
+
return onOpenConfig && onOpenConfig(item, section);
|
|
27543
|
+
}
|
|
27544
|
+
}) : null;
|
|
27545
|
+
|
|
27546
|
+
// An occupied cell uses GridCellFrame — the same element tree as view
|
|
27547
|
+
// mode — so its widget stays mounted across view ↔ edit (phase 1c).
|
|
27548
|
+
if (cellComponent && ComponentManager.config(cellComponent.component, cellComponent)) {
|
|
27549
|
+
return /*#__PURE__*/jsx(GridCellFrame, {
|
|
27550
|
+
editing: true,
|
|
27551
|
+
header: header,
|
|
27552
|
+
footer: footer,
|
|
27553
|
+
children: /*#__PURE__*/jsx(DraggableDroppableCellBody, {
|
|
27554
|
+
enabled: true,
|
|
27555
|
+
cellNumber: cellNumber,
|
|
27556
|
+
gridContainerId: id,
|
|
27557
|
+
onMoveWidgetToCell: onMoveWidgetToCell,
|
|
27558
|
+
onDropWidgetFromSidebar: onDropWidgetFromSidebar,
|
|
27559
|
+
hasSpan: !!(cellDef.span && (cellDef.span.row && cellDef.span.row > 1 || cellDef.span.col && cellDef.span.col > 1)),
|
|
27560
|
+
padding: "p-3",
|
|
27561
|
+
children: renderedWidget
|
|
27562
|
+
})
|
|
27563
|
+
});
|
|
27564
|
+
}
|
|
27463
27565
|
return /*#__PURE__*/jsxs(WidgetCard, {
|
|
27464
27566
|
preview: false,
|
|
27465
|
-
children: [/*#__PURE__*/jsx(
|
|
27466
|
-
item: cellComponent,
|
|
27467
|
-
cellNumber: cellNumber,
|
|
27468
|
-
providers: cellComponent ? availableProviders || [] : [],
|
|
27469
|
-
selectedProviders: ((_cellComponent = cellComponent) === null || _cellComponent === void 0 ? void 0 : _cellComponent.selectedProviders) || {},
|
|
27470
|
-
isSelected: isCellSelected,
|
|
27471
|
-
isSelectable: isCellSelectable,
|
|
27472
|
-
onToggleSelect: function onToggleSelect() {
|
|
27473
|
-
return handleToggleCellSelection(cellNumber);
|
|
27474
|
-
},
|
|
27475
|
-
onSplitHorizontal: function onSplitHorizontal() {
|
|
27476
|
-
return handleInstantSplit(cellNumber, "horizontal");
|
|
27477
|
-
},
|
|
27478
|
-
onSplitVertical: function onSplitVertical() {
|
|
27479
|
-
return handleInstantSplit(cellNumber, "vertical");
|
|
27480
|
-
},
|
|
27481
|
-
onProviderChange: cellComponent ? function (providerType, providerId, isCreateNew) {
|
|
27482
|
-
if (isCreateNew) {
|
|
27483
|
-
if (onCreateProvider) {
|
|
27484
|
-
onCreateProvider(cellComponent.id, providerType, true);
|
|
27485
|
-
}
|
|
27486
|
-
} else {
|
|
27487
|
-
if (onProviderSelect) {
|
|
27488
|
-
onProviderSelect(cellComponent.id, providerType, providerId);
|
|
27489
|
-
}
|
|
27490
|
-
}
|
|
27491
|
-
} : undefined,
|
|
27492
|
-
onConfigure: cellComponent ? function (widgetItem, section) {
|
|
27493
|
-
if (onOpenConfig) onOpenConfig(cellComponent, section);
|
|
27494
|
-
} : undefined,
|
|
27495
|
-
onDelete: cellComponent ? function () {
|
|
27496
|
-
if (onClickRemove) onClickRemove(cellComponent.id);
|
|
27497
|
-
} : undefined,
|
|
27498
|
-
onEditWithAI: cellComponent ? function () {
|
|
27499
|
-
var _ComponentManager$con;
|
|
27500
|
-
window.dispatchEvent(new CustomEvent("dash:edit-widget-with-ai", {
|
|
27501
|
-
detail: {
|
|
27502
|
-
cellNumber: cellNumber,
|
|
27503
|
-
gridItemId: item.id,
|
|
27504
|
-
workspaceId: workspace === null || workspace === void 0 ? void 0 : workspace.id,
|
|
27505
|
-
widgetComponentName: cellComponent.component,
|
|
27506
|
-
widgetId: cellComponent.id,
|
|
27507
|
-
selectedProviders: cellComponent.selectedProviders || null,
|
|
27508
|
-
// Pass the live widget's userPrefs so the
|
|
27509
|
-
// preview renders the same configured state
|
|
27510
|
-
// the user sees on the dashboard (titles,
|
|
27511
|
-
// defaults, etc.) instead of blank values.
|
|
27512
|
-
userPrefs: cellComponent.userPrefs || null,
|
|
27513
|
-
sourcePackage: ((_ComponentManager$con = ComponentManager.config(cellComponent.component, cellComponent)) === null || _ComponentManager$con === void 0 ? void 0 : _ComponentManager$con._sourcePackage) || null
|
|
27514
|
-
}
|
|
27515
|
-
}));
|
|
27516
|
-
} : undefined
|
|
27517
|
-
}), cellComponent && ComponentManager.config(cellComponent.component, cellComponent) ? /*#__PURE__*/jsx(DraggableDroppableCellBody, {
|
|
27518
|
-
cellNumber: cellNumber,
|
|
27519
|
-
gridContainerId: id,
|
|
27520
|
-
onMoveWidgetToCell: onMoveWidgetToCell,
|
|
27521
|
-
onDropWidgetFromSidebar: onDropWidgetFromSidebar,
|
|
27522
|
-
hasSpan: !!(cellDef.span && (cellDef.span.row && cellDef.span.row > 1 || cellDef.span.col && cellDef.span.col > 1)),
|
|
27523
|
-
padding: "p-3",
|
|
27524
|
-
children: renderedWidget
|
|
27525
|
-
}) : /*#__PURE__*/jsx(DroppableEmptyCell, {
|
|
27567
|
+
children: [header, /*#__PURE__*/jsx(DroppableEmptyCell, {
|
|
27526
27568
|
cellNumber: cellNumber,
|
|
27527
27569
|
gridContainerId: id,
|
|
27528
27570
|
onMoveWidgetToCell: onMoveWidgetToCell,
|
|
@@ -27536,12 +27578,7 @@ var LayoutGridContainer = /*#__PURE__*/memo(function (_ref3) {
|
|
|
27536
27578
|
padding: "p-0",
|
|
27537
27579
|
children: renderEmptyCellContent(cellNumber)
|
|
27538
27580
|
})
|
|
27539
|
-
}),
|
|
27540
|
-
item: cellComponent,
|
|
27541
|
-
onConfigure: function onConfigure(item, section) {
|
|
27542
|
-
return onOpenConfig && onOpenConfig(item, section);
|
|
27543
|
-
}
|
|
27544
|
-
})]
|
|
27581
|
+
}), footer]
|
|
27545
27582
|
});
|
|
27546
27583
|
}
|
|
27547
27584
|
function handleClickAdd() {
|
|
@@ -27614,20 +27651,36 @@ var LayoutGridContainer = /*#__PURE__*/memo(function (_ref3) {
|
|
|
27614
27651
|
}
|
|
27615
27652
|
return item["parentWorkspaceName"];
|
|
27616
27653
|
}
|
|
27617
|
-
|
|
27618
|
-
|
|
27619
|
-
//
|
|
27620
|
-
|
|
27654
|
+
|
|
27655
|
+
// Grid layout: ONE element tree for view and edit (create-entry phase
|
|
27656
|
+
// 1c), so widgets stay mounted across modes. Edit-only parts (gutters,
|
|
27657
|
+
// merge/split UI, modals) render only while editing; edit-only wrappers
|
|
27658
|
+
// become display: contents in view mode, leaving view layout unchanged.
|
|
27659
|
+
var editing = preview === false;
|
|
27660
|
+
var hidden = editing ? undefined : {
|
|
27661
|
+
display: "contents"
|
|
27662
|
+
};
|
|
27663
|
+
var viewGridStyle = function viewGridStyle(overflow, rows) {
|
|
27664
|
+
return {
|
|
27665
|
+
gridTemplateRows: rows,
|
|
27666
|
+
gridTemplateColumns: hasExplicitColModes() ? getColTemplate(item.grid) : "repeat(".concat(item.grid.cols, ", 1fr)"),
|
|
27667
|
+
overflow: overflow
|
|
27668
|
+
};
|
|
27669
|
+
};
|
|
27670
|
+
var viewGap = "".concat(!((_item$grid3 = item.grid) !== null && _item$grid3 !== void 0 && _item$grid3.gap) || ((_item$grid4 = item.grid) === null || _item$grid4 === void 0 ? void 0 : _item$grid4.gap) === "gap-2" ? "dr-grid-gap" : "", " ").concat(((_item$grid5 = item.grid) === null || _item$grid5 === void 0 ? void 0 : _item$grid5.gap) || "gap-2");
|
|
27671
|
+
return useGridLayout ? /*#__PURE__*/jsxs(LayoutContainer, {
|
|
27672
|
+
style: hidden,
|
|
27621
27673
|
id: "grid-container-parent-".concat(id),
|
|
27622
27674
|
direction: "col",
|
|
27623
27675
|
width: "w-full",
|
|
27624
27676
|
height: "h-full",
|
|
27625
27677
|
scrollable: false,
|
|
27626
|
-
className: "rounded overflow-x-clip border-2 rounded ".concat(getContainerBorderColor(item), " ").concat(getBorderStyle(), " min-h-24 z-10"),
|
|
27678
|
+
className: editing ? "rounded overflow-x-clip border-2 rounded ".concat(getContainerBorderColor(item), " ").concat(getBorderStyle(), " min-h-24 z-10") : "",
|
|
27627
27679
|
space: false,
|
|
27628
27680
|
children: [/*#__PURE__*/jsxs("div", {
|
|
27629
|
-
className: "flex flex-col flex-1 min-h-0 pt-2",
|
|
27630
|
-
|
|
27681
|
+
className: editing ? "flex flex-col flex-1 min-h-0 pt-2" : undefined,
|
|
27682
|
+
style: hidden,
|
|
27683
|
+
children: [editing && /*#__PURE__*/jsx(ConfirmationModal, {
|
|
27631
27684
|
isOpen: selectedCellsForMerge.length >= 2,
|
|
27632
27685
|
setIsOpen: function setIsOpen() {
|
|
27633
27686
|
return setSelectedCellsForMerge([]);
|
|
@@ -27651,83 +27704,88 @@ var LayoutGridContainer = /*#__PURE__*/memo(function (_ref3) {
|
|
|
27651
27704
|
onCancel: function onCancel() {
|
|
27652
27705
|
return setSelectedCellsForMerge([]);
|
|
27653
27706
|
}
|
|
27654
|
-
}), renderColumnGutter(), scrollable ? /*#__PURE__*/jsx("div", {
|
|
27655
|
-
className: "relative flex-1 min-h-0",
|
|
27707
|
+
}), editing ? renderColumnGutter() : null, scrollable ? /*#__PURE__*/jsx("div", {
|
|
27708
|
+
className: editing ? "relative flex-1 min-h-0" : undefined,
|
|
27709
|
+
style: hidden,
|
|
27656
27710
|
children: /*#__PURE__*/jsxs("div", {
|
|
27657
|
-
className: "absolute inset-0 flex flex-row overflow-y-auto items-start",
|
|
27658
|
-
|
|
27711
|
+
className: editing ? "absolute inset-0 flex flex-row overflow-y-auto items-start" : undefined,
|
|
27712
|
+
style: hidden,
|
|
27713
|
+
children: [editing ? renderRowGutter() : null, /*#__PURE__*/jsx("div", {
|
|
27659
27714
|
id: "grid-container-".concat(id),
|
|
27660
|
-
className: "grid flex-1 min-h-24 p-4 gap-5",
|
|
27661
|
-
style: {
|
|
27715
|
+
className: editing ? "grid flex-1 min-h-24 p-4 gap-5" : "dr-grid ".concat(viewGap, " grid w-full min-h-24 p-3"),
|
|
27716
|
+
style: editing ? {
|
|
27662
27717
|
gridTemplateRows: getRowTemplate(item.grid),
|
|
27663
27718
|
gridTemplateColumns: hasExplicitColModes() ? getColTemplate(item.grid) : "repeat(".concat(item.grid.cols, ", 1fr)")
|
|
27664
|
-
},
|
|
27719
|
+
} : viewGridStyle("auto", getRowTemplate(item.grid)),
|
|
27665
27720
|
children: renderGridCells()
|
|
27666
27721
|
})]
|
|
27667
27722
|
})
|
|
27668
27723
|
}) : /*#__PURE__*/jsx("div", {
|
|
27669
|
-
className: "relative flex-1 min-h-0",
|
|
27724
|
+
className: editing ? "relative flex-1 min-h-0" : "relative w-full ".concat(height, " min-h-24"),
|
|
27670
27725
|
children: /*#__PURE__*/jsxs("div", {
|
|
27671
|
-
className: "absolute inset-0 flex flex-row overflow-hidden",
|
|
27672
|
-
|
|
27726
|
+
className: editing ? "absolute inset-0 flex flex-row overflow-hidden" : undefined,
|
|
27727
|
+
style: hidden,
|
|
27728
|
+
children: [editing ? renderRowGutter() : null, /*#__PURE__*/jsx("div", {
|
|
27673
27729
|
id: "grid-container-".concat(id),
|
|
27674
|
-
className: "grid flex-1 p-4 gap-5",
|
|
27675
|
-
style: {
|
|
27730
|
+
className: editing ? "grid flex-1 p-4 gap-5" : "dr-grid ".concat(viewGap, " absolute inset-0 grid p-3"),
|
|
27731
|
+
style: editing ? {
|
|
27676
27732
|
gridTemplateRows: hasExplicitRowModes() ? getRowTemplate(item.grid) : "repeat(".concat(item.grid.rows, ", minmax(0, 1fr))"),
|
|
27677
27733
|
gridTemplateColumns: hasExplicitColModes() ? getColTemplate(item.grid) : "repeat(".concat(item.grid.cols, ", 1fr)"),
|
|
27678
27734
|
overflow: "hidden"
|
|
27679
|
-
},
|
|
27735
|
+
} : viewGridStyle("hidden", hasExplicitRowModes() ? getRowTemplate(item.grid) : "repeat(".concat(item.grid.rows, ", minmax(0, 1fr))")),
|
|
27680
27736
|
children: renderGridCells()
|
|
27681
27737
|
})]
|
|
27682
27738
|
})
|
|
27683
27739
|
})]
|
|
27684
|
-
}), /*#__PURE__*/
|
|
27685
|
-
|
|
27686
|
-
|
|
27687
|
-
|
|
27688
|
-
|
|
27689
|
-
|
|
27690
|
-
|
|
27691
|
-
|
|
27692
|
-
|
|
27693
|
-
|
|
27694
|
-
|
|
27695
|
-
|
|
27696
|
-
|
|
27697
|
-
|
|
27698
|
-
|
|
27699
|
-
|
|
27700
|
-
|
|
27701
|
-
children: [/*#__PURE__*/jsxs("button", {
|
|
27702
|
-
className: "w-full text-left px-4 py-2 text-sm text-gray-200 hover:bg-gray-700 flex items-center",
|
|
27703
|
-
onClick: function onClick() {
|
|
27704
|
-
handleInstantSplit(contextMenuCell, "horizontal");
|
|
27705
|
-
handleCloseContextMenu();
|
|
27706
|
-
},
|
|
27707
|
-
children: [/*#__PURE__*/jsx(FontAwesomeIcon, {
|
|
27708
|
-
icon: "arrows-left-right",
|
|
27709
|
-
className: "mr-2"
|
|
27710
|
-
}), "Split Horizontal"]
|
|
27711
|
-
}), /*#__PURE__*/jsxs("button", {
|
|
27712
|
-
className: "w-full text-left px-4 py-2 text-sm text-gray-200 hover:bg-gray-700 flex items-center",
|
|
27713
|
-
onClick: function onClick() {
|
|
27714
|
-
handleInstantSplit(contextMenuCell, "vertical");
|
|
27715
|
-
handleCloseContextMenu();
|
|
27716
|
-
},
|
|
27717
|
-
children: [/*#__PURE__*/jsx(FontAwesomeIcon, {
|
|
27718
|
-
icon: "arrows-up-down",
|
|
27719
|
-
className: "mr-2"
|
|
27720
|
-
}), "Split Vertical"]
|
|
27721
|
-
}), /*#__PURE__*/jsxs("button", {
|
|
27722
|
-
className: "w-full text-left px-4 py-2 text-sm text-gray-200 hover:bg-gray-700 flex items-center",
|
|
27723
|
-
onClick: function onClick() {
|
|
27724
|
-
handleClickAdd();
|
|
27725
|
-
handleCloseContextMenu();
|
|
27740
|
+
}), editing && /*#__PURE__*/jsxs(Fragment, {
|
|
27741
|
+
children: [/*#__PURE__*/jsx(MergeCellsModal, {
|
|
27742
|
+
open: mergeModalOpen,
|
|
27743
|
+
setIsOpen: setMergeModalOpen,
|
|
27744
|
+
cellNumbers: selectedCellsForMerge,
|
|
27745
|
+
gridContainer: item,
|
|
27746
|
+
conflictingComponents: getConflictingComponents(selectedCellsForMerge),
|
|
27747
|
+
onConfirm: handleMergeCellsConfirm
|
|
27748
|
+
}), contextMenuCell && /*#__PURE__*/jsxs(Fragment, {
|
|
27749
|
+
children: [/*#__PURE__*/jsx("div", {
|
|
27750
|
+
className: "fixed inset-0 z-40",
|
|
27751
|
+
onClick: handleCloseContextMenu
|
|
27752
|
+
}), /*#__PURE__*/jsxs("div", {
|
|
27753
|
+
className: "fixed z-50 bg-gray-800 border border-gray-600 rounded shadow-lg py-1 min-w-48",
|
|
27754
|
+
style: {
|
|
27755
|
+
left: "".concat(contextMenuPosition.x, "px"),
|
|
27756
|
+
top: "".concat(contextMenuPosition.y, "px")
|
|
27726
27757
|
},
|
|
27727
|
-
children: [/*#__PURE__*/
|
|
27728
|
-
|
|
27729
|
-
|
|
27730
|
-
|
|
27758
|
+
children: [/*#__PURE__*/jsxs("button", {
|
|
27759
|
+
className: "w-full text-left px-4 py-2 text-sm text-gray-200 hover:bg-gray-700 flex items-center",
|
|
27760
|
+
onClick: function onClick() {
|
|
27761
|
+
handleInstantSplit(contextMenuCell, "horizontal");
|
|
27762
|
+
handleCloseContextMenu();
|
|
27763
|
+
},
|
|
27764
|
+
children: [/*#__PURE__*/jsx(FontAwesomeIcon, {
|
|
27765
|
+
icon: "arrows-left-right",
|
|
27766
|
+
className: "mr-2"
|
|
27767
|
+
}), "Split Horizontal"]
|
|
27768
|
+
}), /*#__PURE__*/jsxs("button", {
|
|
27769
|
+
className: "w-full text-left px-4 py-2 text-sm text-gray-200 hover:bg-gray-700 flex items-center",
|
|
27770
|
+
onClick: function onClick() {
|
|
27771
|
+
handleInstantSplit(contextMenuCell, "vertical");
|
|
27772
|
+
handleCloseContextMenu();
|
|
27773
|
+
},
|
|
27774
|
+
children: [/*#__PURE__*/jsx(FontAwesomeIcon, {
|
|
27775
|
+
icon: "arrows-up-down",
|
|
27776
|
+
className: "mr-2"
|
|
27777
|
+
}), "Split Vertical"]
|
|
27778
|
+
}), /*#__PURE__*/jsxs("button", {
|
|
27779
|
+
className: "w-full text-left px-4 py-2 text-sm text-gray-200 hover:bg-gray-700 flex items-center",
|
|
27780
|
+
onClick: function onClick() {
|
|
27781
|
+
handleClickAdd();
|
|
27782
|
+
handleCloseContextMenu();
|
|
27783
|
+
},
|
|
27784
|
+
children: [/*#__PURE__*/jsx(FontAwesomeIcon, {
|
|
27785
|
+
icon: "plus",
|
|
27786
|
+
className: "mr-2"
|
|
27787
|
+
}), "Add Widget"]
|
|
27788
|
+
})]
|
|
27731
27789
|
})]
|
|
27732
27790
|
})]
|
|
27733
27791
|
})]
|
|
@@ -27769,27 +27827,6 @@ var LayoutGridContainer = /*#__PURE__*/memo(function (_ref3) {
|
|
|
27769
27827
|
})
|
|
27770
27828
|
})
|
|
27771
27829
|
})
|
|
27772
|
-
}) : useGridLayout ? scrollable ? /*#__PURE__*/jsx("div", {
|
|
27773
|
-
id: "grid-container-".concat(id),
|
|
27774
|
-
className: "dr-grid ".concat(!item.grid.gap || item.grid.gap === "gap-2" ? "dr-grid-gap" : "", " grid w-full min-h-24 p-3 ").concat(item.grid.gap || "gap-2"),
|
|
27775
|
-
style: {
|
|
27776
|
-
gridTemplateRows: getRowTemplate(item.grid),
|
|
27777
|
-
gridTemplateColumns: hasExplicitColModes() ? getColTemplate(item.grid) : "repeat(".concat(item.grid.cols, ", 1fr)"),
|
|
27778
|
-
overflow: "auto"
|
|
27779
|
-
},
|
|
27780
|
-
children: renderGridCells()
|
|
27781
|
-
}) : /*#__PURE__*/jsx("div", {
|
|
27782
|
-
className: "relative w-full ".concat(height, " min-h-24"),
|
|
27783
|
-
children: /*#__PURE__*/jsx("div", {
|
|
27784
|
-
id: "grid-container-".concat(id),
|
|
27785
|
-
className: "dr-grid ".concat(!item.grid.gap || item.grid.gap === "gap-2" ? "dr-grid-gap" : "", " absolute inset-0 grid p-3 ").concat(item.grid.gap || "gap-2"),
|
|
27786
|
-
style: {
|
|
27787
|
-
gridTemplateRows: hasExplicitRowModes() ? getRowTemplate(item.grid) : "repeat(".concat(item.grid.rows, ", minmax(0, 1fr))"),
|
|
27788
|
-
gridTemplateColumns: hasExplicitColModes() ? getColTemplate(item.grid) : "repeat(".concat(item.grid.cols, ", 1fr)"),
|
|
27789
|
-
overflow: "hidden"
|
|
27790
|
-
},
|
|
27791
|
-
children: renderGridCells()
|
|
27792
|
-
})
|
|
27793
27830
|
}) : renderComponentContainer(children);
|
|
27794
27831
|
});
|
|
27795
27832
|
|
|
@@ -27916,7 +27953,10 @@ var _renderLayout = function renderLayout(_ref) {
|
|
|
27916
27953
|
|
|
27917
27954
|
// if (gridLayout) console.log("rendering grid ", child, childLayout);
|
|
27918
27955
|
|
|
27919
|
-
return hasChildren === 1 && canHaveChildren === true || component === "LayoutGridContainer" ? /*#__PURE__*/jsx(LayoutGridContainer
|
|
27956
|
+
return hasChildren === 1 && canHaveChildren === true || component === "LayoutGridContainer" ? /*#__PURE__*/jsx(LayoutGridContainer
|
|
27957
|
+
// No mode in the key: switching view ↔ edit must not remount the
|
|
27958
|
+
// grid and every widget in it (create-entry phase 1c).
|
|
27959
|
+
, {
|
|
27920
27960
|
uuid: uuid,
|
|
27921
27961
|
id: id,
|
|
27922
27962
|
item: childLayout,
|
|
@@ -28001,7 +28041,7 @@ var _renderLayout = function renderLayout(_ref) {
|
|
|
28001
28041
|
onDropWidgetFromSidebar: onDropWidgetFromSidebar,
|
|
28002
28042
|
onWidgetPopout: onWidgetPopout
|
|
28003
28043
|
})
|
|
28004
|
-
}, "grid-container-".concat(uuid
|
|
28044
|
+
}, "grid-container-".concat(uuid)) : /*#__PURE__*/jsx(LayoutBuilderGridItem, {
|
|
28005
28045
|
uuid: uuid,
|
|
28006
28046
|
item: childLayout,
|
|
28007
28047
|
layout: layout,
|
|
@@ -28038,7 +28078,7 @@ var _renderLayout = function renderLayout(_ref) {
|
|
|
28038
28078
|
onOpenEvents: onOpenEvents,
|
|
28039
28079
|
isDraggable: isDraggable,
|
|
28040
28080
|
workspace: workspace
|
|
28041
|
-
}, "grid-item-".concat(uuid
|
|
28081
|
+
}, "grid-item-".concat(uuid));
|
|
28042
28082
|
});
|
|
28043
28083
|
} catch (e) {
|
|
28044
28084
|
}
|
|
@@ -28118,7 +28158,7 @@ function renderGridLayout(gridLayout, args) {
|
|
|
28118
28158
|
onOpenEvents: onOpenEvents,
|
|
28119
28159
|
isDraggable: isDraggable,
|
|
28120
28160
|
workspace: workspace
|
|
28121
|
-
}, "grid-item-".concat(uuid
|
|
28161
|
+
}, "grid-item-".concat(uuid)));
|
|
28122
28162
|
}
|
|
28123
28163
|
} else {
|
|
28124
28164
|
if (previewMode === false) {
|
|
@@ -28343,7 +28383,7 @@ function renderGridCell(_ref3) {
|
|
|
28343
28383
|
onOpenEvents: onOpenEvents,
|
|
28344
28384
|
isDraggable: isDraggable,
|
|
28345
28385
|
workspace: workspace
|
|
28346
|
-
}, "grid-item-".concat(uuid
|
|
28386
|
+
}, "grid-item-".concat(uuid))
|
|
28347
28387
|
})
|
|
28348
28388
|
});
|
|
28349
28389
|
}
|