@trops/dash-core 0.1.35 → 0.1.37
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 +124 -61
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +124 -61
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -7912,7 +7912,7 @@ var EnhancedWidgetDropdown = function EnhancedWidgetDropdown(_ref) {
|
|
|
7912
7912
|
}), selectedWidget.packageDescription && /*#__PURE__*/jsx("div", {
|
|
7913
7913
|
className: "mb-2",
|
|
7914
7914
|
children: /*#__PURE__*/jsx(Paragraph, {
|
|
7915
|
-
padding:
|
|
7915
|
+
padding: "py-2",
|
|
7916
7916
|
className: "text-sm",
|
|
7917
7917
|
children: selectedWidget.packageDescription
|
|
7918
7918
|
})
|
|
@@ -8225,7 +8225,7 @@ var EnhancedWidgetDropdown = function EnhancedWidgetDropdown(_ref) {
|
|
|
8225
8225
|
}), selectedWidget.description && /*#__PURE__*/jsx("div", {
|
|
8226
8226
|
className: "mb-2",
|
|
8227
8227
|
children: /*#__PURE__*/jsx(Paragraph, {
|
|
8228
|
-
padding:
|
|
8228
|
+
padding: "py-2",
|
|
8229
8229
|
className: "text-sm",
|
|
8230
8230
|
children: selectedWidget.description
|
|
8231
8231
|
})
|
|
@@ -30676,7 +30676,11 @@ var DashboardStage = function DashboardStage(_ref) {
|
|
|
30676
30676
|
_ref$preview = _ref.preview,
|
|
30677
30677
|
preview = _ref$preview === void 0 ? true : _ref$preview,
|
|
30678
30678
|
_ref$backgroundColor = _ref.backgroundColor,
|
|
30679
|
-
backgroundColor = _ref$backgroundColor === void 0 ? null : _ref$backgroundColor
|
|
30679
|
+
backgroundColor = _ref$backgroundColor === void 0 ? null : _ref$backgroundColor,
|
|
30680
|
+
_ref$popout = _ref.popout,
|
|
30681
|
+
popout = _ref$popout === void 0 ? false : _ref$popout,
|
|
30682
|
+
_ref$popoutWorkspaceI = _ref.popoutWorkspaceId,
|
|
30683
|
+
popoutWorkspaceId = _ref$popoutWorkspaceI === void 0 ? null : _ref$popoutWorkspaceI;
|
|
30680
30684
|
return /*#__PURE__*/jsx(Profiler, {
|
|
30681
30685
|
id: "myapp",
|
|
30682
30686
|
onRender: function onRender() {},
|
|
@@ -30689,7 +30693,9 @@ var DashboardStage = function DashboardStage(_ref) {
|
|
|
30689
30693
|
credentials: credentials,
|
|
30690
30694
|
workspace: workspace,
|
|
30691
30695
|
preview: preview,
|
|
30692
|
-
backgroundColor: backgroundColor
|
|
30696
|
+
backgroundColor: backgroundColor,
|
|
30697
|
+
popout: popout,
|
|
30698
|
+
popoutWorkspaceId: popoutWorkspaceId
|
|
30693
30699
|
})
|
|
30694
30700
|
})
|
|
30695
30701
|
});
|
|
@@ -30703,6 +30709,10 @@ var DashboardStageInner = function DashboardStageInner(_ref2) {
|
|
|
30703
30709
|
_ref2$preview = _ref2.preview,
|
|
30704
30710
|
preview = _ref2$preview === void 0 ? true : _ref2$preview;
|
|
30705
30711
|
_ref2.backgroundColor;
|
|
30712
|
+
var _ref2$popout = _ref2.popout,
|
|
30713
|
+
popout = _ref2$popout === void 0 ? false : _ref2$popout,
|
|
30714
|
+
_ref2$popoutWorkspace = _ref2.popoutWorkspaceId,
|
|
30715
|
+
popoutWorkspaceId = _ref2$popoutWorkspace === void 0 ? null : _ref2$popoutWorkspace;
|
|
30706
30716
|
var _useContext = useContext(DashboardContext),
|
|
30707
30717
|
pub = _useContext.pub;
|
|
30708
30718
|
var appContext = useContext(AppContext);
|
|
@@ -30817,6 +30827,41 @@ var DashboardStageInner = function DashboardStageInner(_ref2) {
|
|
|
30817
30827
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
30818
30828
|
}, [workspace]);
|
|
30819
30829
|
|
|
30830
|
+
// ─── Popout: auto-load workspace by ID ──────────────────────────
|
|
30831
|
+
useEffect(function () {
|
|
30832
|
+
if (!popout || popoutWorkspaceId === null) return;
|
|
30833
|
+
if (workspaceConfig.length === 0) return;
|
|
30834
|
+
var target = workspaceConfig.find(function (ws) {
|
|
30835
|
+
return ws.id === popoutWorkspaceId;
|
|
30836
|
+
});
|
|
30837
|
+
if (target) {
|
|
30838
|
+
var _window$mainApi;
|
|
30839
|
+
handleOpenTab(target);
|
|
30840
|
+
if ((_window$mainApi = window.mainApi) !== null && _window$mainApi !== void 0 && (_window$mainApi = _window$mainApi.popout) !== null && _window$mainApi !== void 0 && _window$mainApi.setTitle) {
|
|
30841
|
+
window.mainApi.popout.setTitle(popoutWorkspaceId, target.name || "Untitled");
|
|
30842
|
+
}
|
|
30843
|
+
}
|
|
30844
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
30845
|
+
}, [popout, popoutWorkspaceId, workspaceConfig]);
|
|
30846
|
+
|
|
30847
|
+
// ─── Popout: listen for workspace:saved broadcasts ─────────────
|
|
30848
|
+
useEffect(function () {
|
|
30849
|
+
var _window$mainApi2;
|
|
30850
|
+
if (!popout) return;
|
|
30851
|
+
if (!((_window$mainApi2 = window.mainApi) !== null && _window$mainApi2 !== void 0 && _window$mainApi2.on)) return;
|
|
30852
|
+
var handler = function handler() {
|
|
30853
|
+
loadWorkspaces();
|
|
30854
|
+
};
|
|
30855
|
+
window.mainApi.on("workspace:saved", handler);
|
|
30856
|
+
return function () {
|
|
30857
|
+
var _window$mainApi3;
|
|
30858
|
+
if ((_window$mainApi3 = window.mainApi) !== null && _window$mainApi3 !== void 0 && _window$mainApi3.removeListener) {
|
|
30859
|
+
window.mainApi.removeListener("workspace:saved", handler);
|
|
30860
|
+
}
|
|
30861
|
+
};
|
|
30862
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
30863
|
+
}, [popout]);
|
|
30864
|
+
|
|
30820
30865
|
// ─── Tab Handlers ─────────────────────────────────────────────────
|
|
30821
30866
|
|
|
30822
30867
|
function handleOpenTab(workspaceItem) {
|
|
@@ -31192,6 +31237,12 @@ var DashboardStageInner = function DashboardStageInner(_ref2) {
|
|
|
31192
31237
|
function handleToggleThemeVariant() {
|
|
31193
31238
|
changeThemeVariant(themeVariant === "dark" ? "light" : "dark");
|
|
31194
31239
|
}
|
|
31240
|
+
function handlePopout() {
|
|
31241
|
+
var _window$mainApi4;
|
|
31242
|
+
if (workspaceSelected && (_window$mainApi4 = window.mainApi) !== null && _window$mainApi4 !== void 0 && (_window$mainApi4 = _window$mainApi4.popout) !== null && _window$mainApi4 !== void 0 && _window$mainApi4.open) {
|
|
31243
|
+
window.mainApi.popout.open(workspaceSelected.id);
|
|
31244
|
+
}
|
|
31245
|
+
}
|
|
31195
31246
|
return /*#__PURE__*/jsxs(LayoutContainer, {
|
|
31196
31247
|
padding: false,
|
|
31197
31248
|
space: false,
|
|
@@ -31204,7 +31255,7 @@ var DashboardStageInner = function DashboardStageInner(_ref2) {
|
|
|
31204
31255
|
backend: HTML5Backend,
|
|
31205
31256
|
children: [/*#__PURE__*/jsxs("div", {
|
|
31206
31257
|
className: "flex flex-row flex-1 overflow-hidden",
|
|
31207
|
-
children: [/*#__PURE__*/jsx(DashSidebar, {
|
|
31258
|
+
children: [!popout && /*#__PURE__*/jsx(DashSidebar, {
|
|
31208
31259
|
collapsed: sidebarCollapsed,
|
|
31209
31260
|
onCollapsedChange: setSidebarCollapsed,
|
|
31210
31261
|
workspaces: workspaceConfig,
|
|
@@ -31235,23 +31286,24 @@ var DashboardStageInner = function DashboardStageInner(_ref2) {
|
|
|
31235
31286
|
children: workspaceSelected !== null ? /*#__PURE__*/jsxs(Fragment, {
|
|
31236
31287
|
children: [/*#__PURE__*/jsx(DashboardHeader, {
|
|
31237
31288
|
workspace: workspaceSelected,
|
|
31238
|
-
preview: previewMode,
|
|
31289
|
+
preview: popout ? true : previewMode,
|
|
31239
31290
|
onNameChange: handleWorkspaceNameChange,
|
|
31240
|
-
onClickEdit: handleToggleEditMode,
|
|
31241
|
-
|
|
31291
|
+
onClickEdit: popout ? null : handleToggleEditMode,
|
|
31292
|
+
onPopout: popout ? null : handlePopout,
|
|
31293
|
+
onSaveChanges: popout ? null : handleClickSaveWorkspace,
|
|
31242
31294
|
menuItems: menuItems,
|
|
31243
31295
|
themes: themes || {},
|
|
31244
|
-
onFolderChange: handleWorkspaceFolderChange,
|
|
31245
|
-
onThemeChange: handleWorkspaceThemeChange,
|
|
31296
|
+
onFolderChange: popout ? null : handleWorkspaceFolderChange,
|
|
31297
|
+
onThemeChange: popout ? null : handleWorkspaceThemeChange,
|
|
31246
31298
|
scrollableEnabled: getRootScrollable(),
|
|
31247
|
-
onScrollableChange: handleScrollableChange
|
|
31299
|
+
onScrollableChange: popout ? null : handleScrollableChange
|
|
31248
31300
|
}), /*#__PURE__*/jsx(DashboardThemeProvider, {
|
|
31249
31301
|
themeKey: workspaceSelected === null || workspaceSelected === void 0 ? void 0 : workspaceSelected.themeKey,
|
|
31250
31302
|
children: /*#__PURE__*/jsx("div", {
|
|
31251
|
-
className: "flex flex-col w-full flex-1 ".concat(previewMode === true ? "overflow-y-auto" : "overflow-clip"),
|
|
31303
|
+
className: "flex flex-col w-full flex-1 ".concat(popout || previewMode === true ? "overflow-y-auto" : "overflow-clip"),
|
|
31252
31304
|
children: renderComponent(workspaceSelected)
|
|
31253
31305
|
})
|
|
31254
|
-
}), /*#__PURE__*/jsx(DashTabBar, {
|
|
31306
|
+
}), !popout && /*#__PURE__*/jsx(DashTabBar, {
|
|
31255
31307
|
tabs: openTabs,
|
|
31256
31308
|
activeTabId: activeTabId,
|
|
31257
31309
|
onSwitchTab: handleSwitchTab,
|
|
@@ -31264,9 +31316,9 @@ var DashboardStageInner = function DashboardStageInner(_ref2) {
|
|
|
31264
31316
|
icon: "clone",
|
|
31265
31317
|
className: "h-12 w-12"
|
|
31266
31318
|
}),
|
|
31267
|
-
title: "No dashboards open",
|
|
31268
|
-
description: "Press \u2318K to search dashboards, or create a new one.",
|
|
31269
|
-
children: /*#__PURE__*/jsxs("div", {
|
|
31319
|
+
title: popout ? "Dashboard not found" : "No dashboards open",
|
|
31320
|
+
description: popout ? "The requested dashboard could not be loaded." : "Press \u2318K to search dashboards, or create a new one.",
|
|
31321
|
+
children: !popout && /*#__PURE__*/jsxs("div", {
|
|
31270
31322
|
className: "flex flex-row gap-2",
|
|
31271
31323
|
children: [/*#__PURE__*/jsx(ButtonIcon, {
|
|
31272
31324
|
icon: "magnifying-glass",
|
|
@@ -31284,51 +31336,53 @@ var DashboardStageInner = function DashboardStageInner(_ref2) {
|
|
|
31284
31336
|
})
|
|
31285
31337
|
})
|
|
31286
31338
|
})
|
|
31287
|
-
}), !previewMode && workspaceSelected && /*#__PURE__*/jsx(WidgetSidebar, {
|
|
31339
|
+
}), !popout && !previewMode && workspaceSelected && /*#__PURE__*/jsx(WidgetSidebar, {
|
|
31288
31340
|
collapsed: widgetSidebarCollapsed,
|
|
31289
31341
|
onCollapsedChange: setWidgetSidebarCollapsed
|
|
31290
31342
|
})]
|
|
31291
|
-
}), /*#__PURE__*/
|
|
31292
|
-
|
|
31293
|
-
|
|
31294
|
-
|
|
31295
|
-
|
|
31296
|
-
|
|
31297
|
-
|
|
31298
|
-
|
|
31299
|
-
|
|
31300
|
-
|
|
31301
|
-
|
|
31302
|
-
|
|
31303
|
-
|
|
31304
|
-
|
|
31305
|
-
|
|
31306
|
-
|
|
31307
|
-
|
|
31308
|
-
|
|
31309
|
-
|
|
31310
|
-
|
|
31311
|
-
|
|
31312
|
-
|
|
31313
|
-
|
|
31314
|
-
|
|
31315
|
-
|
|
31316
|
-
|
|
31317
|
-
|
|
31318
|
-
|
|
31319
|
-
|
|
31320
|
-
|
|
31321
|
-
|
|
31322
|
-
|
|
31323
|
-
|
|
31324
|
-
|
|
31325
|
-
|
|
31326
|
-
|
|
31327
|
-
|
|
31328
|
-
|
|
31329
|
-
|
|
31343
|
+
}), !popout && /*#__PURE__*/jsxs(Fragment, {
|
|
31344
|
+
children: [/*#__PURE__*/jsx(AppSettingsModal, {
|
|
31345
|
+
isOpen: isAppSettingsOpen,
|
|
31346
|
+
setIsOpen: setIsAppSettingsOpen,
|
|
31347
|
+
initialSection: appSettingsInitialSection,
|
|
31348
|
+
workspaces: workspaceConfig,
|
|
31349
|
+
menuItems: menuItems,
|
|
31350
|
+
dashApi: dashApi,
|
|
31351
|
+
credentials: credentials,
|
|
31352
|
+
onReloadWorkspaces: loadWorkspaces,
|
|
31353
|
+
onReloadMenuItems: loadMenuItems,
|
|
31354
|
+
onOpenThemeEditor: function onOpenThemeEditor() {
|
|
31355
|
+
setIsAppSettingsOpen(false);
|
|
31356
|
+
setIsThemeManagerOpen(true);
|
|
31357
|
+
}
|
|
31358
|
+
}), /*#__PURE__*/jsx(ThemeManagerModal, {
|
|
31359
|
+
open: isThemeManagerOpen,
|
|
31360
|
+
setIsOpen: function setIsOpen() {
|
|
31361
|
+
return setIsThemeManagerOpen(!isThemeManagerOpen);
|
|
31362
|
+
},
|
|
31363
|
+
onSave: function onSave(themeKey) {
|
|
31364
|
+
changeCurrentTheme(themeKey);
|
|
31365
|
+
setIsThemeManagerOpen(function () {
|
|
31366
|
+
return false;
|
|
31367
|
+
});
|
|
31368
|
+
}
|
|
31369
|
+
}), /*#__PURE__*/jsx(DashboardLoaderModal, {
|
|
31370
|
+
open: isDashboardLoaderOpen,
|
|
31371
|
+
setIsOpen: setIsDashboardLoaderOpen,
|
|
31372
|
+
workspaces: workspaceConfig,
|
|
31373
|
+
onSelecDashboard: handleSelectLoadDashboard,
|
|
31374
|
+
onClose: function onClose() {
|
|
31375
|
+
return handleCloseDashboardLoader();
|
|
31376
|
+
}
|
|
31377
|
+
}), /*#__PURE__*/jsx(LayoutManagerModal, {
|
|
31378
|
+
open: isLayoutPickerOpen,
|
|
31379
|
+
setIsOpen: setIsLayoutPickerOpen,
|
|
31380
|
+
onCreateWorkspace: handleCreateFromTemplate,
|
|
31381
|
+
menuItems: menuItems,
|
|
31382
|
+
onSaveMenuItem: handleSaveNewMenuItem
|
|
31383
|
+
})]
|
|
31330
31384
|
})]
|
|
31331
|
-
}), /*#__PURE__*/jsx(DashCommandPalette, {
|
|
31385
|
+
}), !popout && /*#__PURE__*/jsx(DashCommandPalette, {
|
|
31332
31386
|
isOpen: isCommandPaletteOpen,
|
|
31333
31387
|
setIsOpen: setIsCommandPaletteOpen,
|
|
31334
31388
|
workspaces: workspaceConfig,
|
|
@@ -31461,6 +31515,8 @@ var DashboardHeader = function DashboardHeader(_ref) {
|
|
|
31461
31515
|
preview = _ref.preview,
|
|
31462
31516
|
_ref$onClickEdit = _ref.onClickEdit,
|
|
31463
31517
|
onClickEdit = _ref$onClickEdit === void 0 ? null : _ref$onClickEdit,
|
|
31518
|
+
_ref$onPopout = _ref.onPopout,
|
|
31519
|
+
onPopout = _ref$onPopout === void 0 ? null : _ref$onPopout,
|
|
31464
31520
|
onNameChange = _ref.onNameChange,
|
|
31465
31521
|
_ref$onSaveChanges = _ref.onSaveChanges,
|
|
31466
31522
|
onSaveChanges = _ref$onSaveChanges === void 0 ? null : _ref$onSaveChanges,
|
|
@@ -31500,10 +31556,17 @@ var DashboardHeader = function DashboardHeader(_ref) {
|
|
|
31500
31556
|
}),
|
|
31501
31557
|
padding: false,
|
|
31502
31558
|
className: "font-bold text-base"
|
|
31503
|
-
}),
|
|
31504
|
-
|
|
31505
|
-
|
|
31506
|
-
|
|
31559
|
+
}), /*#__PURE__*/jsxs("div", {
|
|
31560
|
+
className: "flex flex-row items-center gap-1",
|
|
31561
|
+
children: [onPopout !== null && /*#__PURE__*/jsx(ButtonIcon, {
|
|
31562
|
+
icon: "arrow-up-right-from-square",
|
|
31563
|
+
onClick: onPopout,
|
|
31564
|
+
hoverBackgroundColor: "hover:bg-indigo-700"
|
|
31565
|
+
}), onClickEdit !== null && /*#__PURE__*/jsx(ButtonIcon, {
|
|
31566
|
+
icon: "pencil",
|
|
31567
|
+
onClick: onClickEdit,
|
|
31568
|
+
hoverBackgroundColor: "hover:bg-indigo-700"
|
|
31569
|
+
})]
|
|
31507
31570
|
})]
|
|
31508
31571
|
}) : /*#__PURE__*/jsxs(Fragment, {
|
|
31509
31572
|
children: [/*#__PURE__*/jsxs("div", {
|