@trops/dash-core 0.1.226 → 0.1.227
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 +86 -67
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +86 -67
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -6275,73 +6275,7 @@ var WizardCustomizeStep = function WizardCustomizeStep(_ref) {
|
|
|
6275
6275
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
6276
6276
|
}, [state.step, state.selectedDashboard]);
|
|
6277
6277
|
|
|
6278
|
-
//
|
|
6279
|
-
React.useEffect(function () {
|
|
6280
|
-
if (createHandlerRef) {
|
|
6281
|
-
createHandlerRef.current = {
|
|
6282
|
-
handleCreate: handleCreate,
|
|
6283
|
-
creating: creating
|
|
6284
|
-
};
|
|
6285
|
-
}
|
|
6286
|
-
}, [createHandlerRef, handleCreate, creating]);
|
|
6287
|
-
var handleNameChange = React.useCallback(function (val) {
|
|
6288
|
-
dispatch({
|
|
6289
|
-
type: "SET_CUSTOMIZATION",
|
|
6290
|
-
payload: {
|
|
6291
|
-
name: val
|
|
6292
|
-
}
|
|
6293
|
-
});
|
|
6294
|
-
}, [dispatch]);
|
|
6295
|
-
var handleMenuSelect = React.useCallback(function (id) {
|
|
6296
|
-
dispatch({
|
|
6297
|
-
type: "SET_CUSTOMIZATION",
|
|
6298
|
-
payload: {
|
|
6299
|
-
menuId: id
|
|
6300
|
-
}
|
|
6301
|
-
});
|
|
6302
|
-
setIsCreatingFolder(false);
|
|
6303
|
-
setNewFolderName("");
|
|
6304
|
-
setNewFolderIcon(null);
|
|
6305
|
-
setSubStep(2); // Auto-advance to Theme
|
|
6306
|
-
}, [dispatch]);
|
|
6307
|
-
var handleThemeSelect = React.useCallback(function (key) {
|
|
6308
|
-
dispatch({
|
|
6309
|
-
type: "SET_CUSTOMIZATION",
|
|
6310
|
-
payload: {
|
|
6311
|
-
theme: key
|
|
6312
|
-
}
|
|
6313
|
-
});
|
|
6314
|
-
}, [dispatch]);
|
|
6315
|
-
function handleCancelNewFolder() {
|
|
6316
|
-
setIsCreatingFolder(false);
|
|
6317
|
-
setNewFolderName("");
|
|
6318
|
-
setNewFolderIcon(null);
|
|
6319
|
-
}
|
|
6320
|
-
function handleSaveNewFolder() {
|
|
6321
|
-
if (!newFolderName.trim() || !newFolderIcon) return;
|
|
6322
|
-
var newItem = {
|
|
6323
|
-
id: Date.now(),
|
|
6324
|
-
name: newFolderName.trim(),
|
|
6325
|
-
icon: newFolderIcon
|
|
6326
|
-
};
|
|
6327
|
-
setLocalMenuItems(function (prev) {
|
|
6328
|
-
return [].concat(_toConsumableArray(prev), [newItem]);
|
|
6329
|
-
});
|
|
6330
|
-
dispatch({
|
|
6331
|
-
type: "SET_CUSTOMIZATION",
|
|
6332
|
-
payload: {
|
|
6333
|
-
menuId: newItem.id
|
|
6334
|
-
}
|
|
6335
|
-
});
|
|
6336
|
-
if (onSaveMenuItem) {
|
|
6337
|
-
onSaveMenuItem(newItem);
|
|
6338
|
-
}
|
|
6339
|
-
setIsCreatingFolder(false);
|
|
6340
|
-
setNewFolderName("");
|
|
6341
|
-
setNewFolderIcon(null);
|
|
6342
|
-
}
|
|
6343
|
-
|
|
6344
|
-
// --- Create logic ---
|
|
6278
|
+
// --- Create logic (DASH-191: moved above useEffect so ref captures actual function) ---
|
|
6345
6279
|
var handleCreate = React.useCallback(/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
6346
6280
|
var _state$customization, name, menuId, theme, result, _window$mainApi, installResult, updatedWorkspace, _window$mainApi2, template, layoutObj, widgetOrder, cells, _loop, i, workspace, _t;
|
|
6347
6281
|
return _regeneratorRuntime.wrap(function (_context2) {
|
|
@@ -6493,6 +6427,72 @@ var WizardCustomizeStep = function WizardCustomizeStep(_ref) {
|
|
|
6493
6427
|
}, _callee, null, [[1, 16, 17, 18]]);
|
|
6494
6428
|
})), [state, isPrebuilt, onInstallDashboard, onCreateWorkspace, appId]);
|
|
6495
6429
|
|
|
6430
|
+
// Expose handleCreate and creating state to parent via ref (DASH-183)
|
|
6431
|
+
React.useEffect(function () {
|
|
6432
|
+
if (createHandlerRef) {
|
|
6433
|
+
createHandlerRef.current = {
|
|
6434
|
+
handleCreate: handleCreate,
|
|
6435
|
+
creating: creating
|
|
6436
|
+
};
|
|
6437
|
+
}
|
|
6438
|
+
}, [createHandlerRef, handleCreate, creating]);
|
|
6439
|
+
var handleNameChange = React.useCallback(function (val) {
|
|
6440
|
+
dispatch({
|
|
6441
|
+
type: "SET_CUSTOMIZATION",
|
|
6442
|
+
payload: {
|
|
6443
|
+
name: val
|
|
6444
|
+
}
|
|
6445
|
+
});
|
|
6446
|
+
}, [dispatch]);
|
|
6447
|
+
var handleMenuSelect = React.useCallback(function (id) {
|
|
6448
|
+
dispatch({
|
|
6449
|
+
type: "SET_CUSTOMIZATION",
|
|
6450
|
+
payload: {
|
|
6451
|
+
menuId: id
|
|
6452
|
+
}
|
|
6453
|
+
});
|
|
6454
|
+
setIsCreatingFolder(false);
|
|
6455
|
+
setNewFolderName("");
|
|
6456
|
+
setNewFolderIcon(null);
|
|
6457
|
+
setSubStep(2); // Auto-advance to Theme
|
|
6458
|
+
}, [dispatch]);
|
|
6459
|
+
var handleThemeSelect = React.useCallback(function (key) {
|
|
6460
|
+
dispatch({
|
|
6461
|
+
type: "SET_CUSTOMIZATION",
|
|
6462
|
+
payload: {
|
|
6463
|
+
theme: key
|
|
6464
|
+
}
|
|
6465
|
+
});
|
|
6466
|
+
}, [dispatch]);
|
|
6467
|
+
function handleCancelNewFolder() {
|
|
6468
|
+
setIsCreatingFolder(false);
|
|
6469
|
+
setNewFolderName("");
|
|
6470
|
+
setNewFolderIcon(null);
|
|
6471
|
+
}
|
|
6472
|
+
function handleSaveNewFolder() {
|
|
6473
|
+
if (!newFolderName.trim() || !newFolderIcon) return;
|
|
6474
|
+
var newItem = {
|
|
6475
|
+
id: Date.now(),
|
|
6476
|
+
name: newFolderName.trim(),
|
|
6477
|
+
icon: newFolderIcon
|
|
6478
|
+
};
|
|
6479
|
+
setLocalMenuItems(function (prev) {
|
|
6480
|
+
return [].concat(_toConsumableArray(prev), [newItem]);
|
|
6481
|
+
});
|
|
6482
|
+
dispatch({
|
|
6483
|
+
type: "SET_CUSTOMIZATION",
|
|
6484
|
+
payload: {
|
|
6485
|
+
menuId: newItem.id
|
|
6486
|
+
}
|
|
6487
|
+
});
|
|
6488
|
+
if (onSaveMenuItem) {
|
|
6489
|
+
onSaveMenuItem(newItem);
|
|
6490
|
+
}
|
|
6491
|
+
setIsCreatingFolder(false);
|
|
6492
|
+
setNewFolderName("");
|
|
6493
|
+
setNewFolderIcon(null);
|
|
6494
|
+
}
|
|
6495
|
+
|
|
6496
6496
|
// --- Success state ---
|
|
6497
6497
|
if (createdDashboard) {
|
|
6498
6498
|
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
@@ -6705,6 +6705,21 @@ var WizardCustomizeStep = function WizardCustomizeStep(_ref) {
|
|
|
6705
6705
|
})
|
|
6706
6706
|
}, item.id);
|
|
6707
6707
|
})]
|
|
6708
|
+
}), /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
6709
|
+
className: "flex justify-end mt-2",
|
|
6710
|
+
children: /*#__PURE__*/jsxRuntime.jsx(DashReact.Button, {
|
|
6711
|
+
onClick: function onClick() {
|
|
6712
|
+
return setSubStep(2);
|
|
6713
|
+
},
|
|
6714
|
+
title: "Next",
|
|
6715
|
+
textSize: "text-sm",
|
|
6716
|
+
padding: "py-1.5 px-4",
|
|
6717
|
+
backgroundColor: "bg-blue-600",
|
|
6718
|
+
textColor: "text-white",
|
|
6719
|
+
hoverTextColor: "hover:text-white",
|
|
6720
|
+
hoverBackgroundColor: "hover:bg-blue-500",
|
|
6721
|
+
icon: "arrow-right"
|
|
6722
|
+
})
|
|
6708
6723
|
})]
|
|
6709
6724
|
}), subStep === 2 && /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
6710
6725
|
className: "flex flex-col gap-3",
|
|
@@ -48109,6 +48124,10 @@ var DashboardStageInner = function DashboardStageInner(_ref2) {
|
|
|
48109
48124
|
handleOpenTab(newWorkspace);
|
|
48110
48125
|
setSidebarCollapsed(true);
|
|
48111
48126
|
setPreviewMode(false);
|
|
48127
|
+
return {
|
|
48128
|
+
success: true,
|
|
48129
|
+
workspace: newWorkspace
|
|
48130
|
+
};
|
|
48112
48131
|
} catch (e) {
|
|
48113
48132
|
}
|
|
48114
48133
|
}
|