@trops/dash-core 0.1.94 → 0.1.96
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/electron/index.js +20 -23
- package/dist/electron/index.js.map +1 -1
- package/dist/index.esm.js +396 -89
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +395 -88
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -3080,7 +3080,7 @@ var LayoutManagerPicker = function LayoutManagerPicker(_ref2) {
|
|
|
3080
3080
|
});
|
|
3081
3081
|
};
|
|
3082
3082
|
|
|
3083
|
-
var FOLDER_ICONS = [
|
|
3083
|
+
var FOLDER_ICONS$1 = [
|
|
3084
3084
|
// General / UI
|
|
3085
3085
|
"home", "folder", "star", "heart", "bookmark", "tag", "flag", "bell", "circle", "square", "circle-check", "thumbs-up", "clone", "signal",
|
|
3086
3086
|
// Communication
|
|
@@ -3103,7 +3103,7 @@ var FOLDER_ICONS = [
|
|
|
3103
3103
|
"file", "file-code", "clipboard", "book", "pen", "pencil",
|
|
3104
3104
|
// Misc
|
|
3105
3105
|
"magnifying-glass", "eye", "lock", "key", "shield", "clock", "calendar", "link"];
|
|
3106
|
-
var ALL_ICON_NAMES = Object.keys(DashReact__namespace).filter(function (key) {
|
|
3106
|
+
var ALL_ICON_NAMES$1 = Object.keys(DashReact__namespace).filter(function (key) {
|
|
3107
3107
|
return key.startsWith("fa") && key !== "fas";
|
|
3108
3108
|
}).map(function (key) {
|
|
3109
3109
|
var _DashReact$key;
|
|
@@ -3111,8 +3111,8 @@ var ALL_ICON_NAMES = Object.keys(DashReact__namespace).filter(function (key) {
|
|
|
3111
3111
|
}).filter(Boolean).filter(function (name, index, arr) {
|
|
3112
3112
|
return arr.indexOf(name) === index;
|
|
3113
3113
|
}).sort();
|
|
3114
|
-
var CURATED_SET = new Set(FOLDER_ICONS);
|
|
3115
|
-
var IconPicker = function IconPicker(_ref) {
|
|
3114
|
+
var CURATED_SET$1 = new Set(FOLDER_ICONS$1);
|
|
3115
|
+
var IconPicker$1 = function IconPicker(_ref) {
|
|
3116
3116
|
var selectedIcon = _ref.selectedIcon,
|
|
3117
3117
|
onSelectIcon = _ref.onSelectIcon;
|
|
3118
3118
|
var _useState = React.useState(""),
|
|
@@ -3121,13 +3121,13 @@ var IconPicker = function IconPicker(_ref) {
|
|
|
3121
3121
|
setSearch = _useState2[1];
|
|
3122
3122
|
var query = search.trim().toLowerCase();
|
|
3123
3123
|
var filteredCurated = React.useMemo(function () {
|
|
3124
|
-
return query ? FOLDER_ICONS.filter(function (name) {
|
|
3124
|
+
return query ? FOLDER_ICONS$1.filter(function (name) {
|
|
3125
3125
|
return name.includes(query);
|
|
3126
|
-
}) : FOLDER_ICONS;
|
|
3126
|
+
}) : FOLDER_ICONS$1;
|
|
3127
3127
|
}, [query]);
|
|
3128
3128
|
var remainingIcons = React.useMemo(function () {
|
|
3129
|
-
var all = ALL_ICON_NAMES.filter(function (name) {
|
|
3130
|
-
return !CURATED_SET.has(name);
|
|
3129
|
+
var all = ALL_ICON_NAMES$1.filter(function (name) {
|
|
3130
|
+
return !CURATED_SET$1.has(name);
|
|
3131
3131
|
});
|
|
3132
3132
|
return query ? all.filter(function (name) {
|
|
3133
3133
|
return name.includes(query);
|
|
@@ -3228,7 +3228,7 @@ var FolderDetail = function FolderDetail(_ref2) {
|
|
|
3228
3228
|
children: [/*#__PURE__*/jsxRuntime.jsx("span", {
|
|
3229
3229
|
className: "flex-shrink-0 text-sm font-medium opacity-70",
|
|
3230
3230
|
children: "Icon"
|
|
3231
|
-
}), /*#__PURE__*/jsxRuntime.jsx(IconPicker, {
|
|
3231
|
+
}), /*#__PURE__*/jsxRuntime.jsx(IconPicker$1, {
|
|
3232
3232
|
selectedIcon: formIcon,
|
|
3233
3233
|
onSelectIcon: setFormIcon
|
|
3234
3234
|
})]
|
|
@@ -3519,7 +3519,7 @@ var LayoutManagerModal = function LayoutManagerModal(_ref) {
|
|
|
3519
3519
|
placeholder: "Folder name"
|
|
3520
3520
|
}), /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
3521
3521
|
className: "grid grid-cols-10 gap-2",
|
|
3522
|
-
children: FOLDER_ICONS.map(function (icon) {
|
|
3522
|
+
children: FOLDER_ICONS$1.map(function (icon) {
|
|
3523
3523
|
var isIconSelected = icon === newFolderIcon;
|
|
3524
3524
|
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
3525
3525
|
className: "flex items-center justify-center p-2 rounded cursor-pointer transition-all ".concat(isIconSelected ? "bg-blue-600 ring-2 ring-blue-400 text-white" : "bg-gray-700 text-gray-400 hover:bg-gray-600 hover:text-gray-200"),
|
|
@@ -26480,6 +26480,121 @@ var StarRating = function StarRating(_ref) {
|
|
|
26480
26480
|
});
|
|
26481
26481
|
};
|
|
26482
26482
|
|
|
26483
|
+
var FOLDER_ICONS = [
|
|
26484
|
+
// General / UI
|
|
26485
|
+
"home", "folder", "star", "heart", "bookmark", "tag", "flag", "bell", "circle", "square", "circle-check", "thumbs-up", "clone", "signal",
|
|
26486
|
+
// Communication
|
|
26487
|
+
"phone", "envelope", "comment", "message", "paper-plane",
|
|
26488
|
+
// Media
|
|
26489
|
+
"image", "camera", "music", "video", "film", "headphones",
|
|
26490
|
+
// Tech
|
|
26491
|
+
"code", "terminal", "database", "server", "wifi", "plug", "robot", "microchip", "globe",
|
|
26492
|
+
// Nature
|
|
26493
|
+
"leaf", "seedling", "tree", "sun", "moon", "cloud", "bolt", "fire", "snowflake", "water",
|
|
26494
|
+
// Objects
|
|
26495
|
+
"hammer", "wrench", "gear", "briefcase", "cart-shopping", "truck", "car", "plane", "rocket",
|
|
26496
|
+
// People / Activity
|
|
26497
|
+
"user", "users", "trophy", "gamepad", "dumbbell", "graduation-cap", "baby", "baby-carriage",
|
|
26498
|
+
// Arrows / Navigation
|
|
26499
|
+
"arrow-up", "arrow-down", "arrow-left", "arrow-right", "arrows-up-down", "arrows-left-right", "minus",
|
|
26500
|
+
// Data / Charts
|
|
26501
|
+
"chart-bar", "chart-line", "chart-pie", "table", "list", "layer-group",
|
|
26502
|
+
// Files
|
|
26503
|
+
"file", "file-code", "clipboard", "book", "pen", "pencil",
|
|
26504
|
+
// Misc
|
|
26505
|
+
"magnifying-glass", "eye", "lock", "key", "shield", "clock", "calendar", "link"];
|
|
26506
|
+
var ALL_ICON_NAMES = Object.keys(DashReact__namespace).filter(function (key) {
|
|
26507
|
+
return key.startsWith("fa") && key !== "fas";
|
|
26508
|
+
}).map(function (key) {
|
|
26509
|
+
var _DashReact$key;
|
|
26510
|
+
return (_DashReact$key = DashReact__namespace[key]) === null || _DashReact$key === void 0 ? void 0 : _DashReact$key.iconName;
|
|
26511
|
+
}).filter(Boolean).filter(function (name, index, arr) {
|
|
26512
|
+
return arr.indexOf(name) === index;
|
|
26513
|
+
}).sort();
|
|
26514
|
+
var CURATED_SET = new Set(FOLDER_ICONS);
|
|
26515
|
+
var IconPicker = function IconPicker(_ref) {
|
|
26516
|
+
var selectedIcon = _ref.selectedIcon,
|
|
26517
|
+
onSelectIcon = _ref.onSelectIcon;
|
|
26518
|
+
var _useState = React.useState(""),
|
|
26519
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
26520
|
+
search = _useState2[0],
|
|
26521
|
+
setSearch = _useState2[1];
|
|
26522
|
+
var query = search.trim().toLowerCase();
|
|
26523
|
+
var filteredCurated = React.useMemo(function () {
|
|
26524
|
+
return query ? FOLDER_ICONS.filter(function (name) {
|
|
26525
|
+
return name.includes(query);
|
|
26526
|
+
}) : FOLDER_ICONS;
|
|
26527
|
+
}, [query]);
|
|
26528
|
+
var remainingIcons = React.useMemo(function () {
|
|
26529
|
+
var all = ALL_ICON_NAMES.filter(function (name) {
|
|
26530
|
+
return !CURATED_SET.has(name);
|
|
26531
|
+
});
|
|
26532
|
+
return query ? all.filter(function (name) {
|
|
26533
|
+
return name.includes(query);
|
|
26534
|
+
}) : all;
|
|
26535
|
+
}, [query]);
|
|
26536
|
+
var hasResults = filteredCurated.length > 0 || remainingIcons.length > 0;
|
|
26537
|
+
var renderIcon = function renderIcon(icon) {
|
|
26538
|
+
return /*#__PURE__*/jsxRuntime.jsx(DashReact.ButtonIcon, {
|
|
26539
|
+
icon: icon,
|
|
26540
|
+
selected: icon === selectedIcon,
|
|
26541
|
+
onClick: function onClick() {
|
|
26542
|
+
return onSelectIcon(icon);
|
|
26543
|
+
},
|
|
26544
|
+
iconSize: "h-6 w-6",
|
|
26545
|
+
backgroundColor: "transparent",
|
|
26546
|
+
className: icon !== selectedIcon ? "opacity-50 hover:!opacity-80" : ""
|
|
26547
|
+
}, icon);
|
|
26548
|
+
};
|
|
26549
|
+
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
26550
|
+
className: "flex flex-col flex-1 min-h-0 space-y-3",
|
|
26551
|
+
children: [/*#__PURE__*/jsxRuntime.jsx("div", {
|
|
26552
|
+
className: "flex-shrink-0",
|
|
26553
|
+
children: /*#__PURE__*/jsxRuntime.jsx(DashReact.SearchInput, {
|
|
26554
|
+
value: search,
|
|
26555
|
+
onChange: setSearch,
|
|
26556
|
+
placeholder: "Search icons..."
|
|
26557
|
+
})
|
|
26558
|
+
}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
26559
|
+
className: "flex-1 min-h-0 overflow-y-auto space-y-3",
|
|
26560
|
+
children: [!hasResults && /*#__PURE__*/jsxRuntime.jsxs("span", {
|
|
26561
|
+
className: "text-sm opacity-50 py-2",
|
|
26562
|
+
children: ["No icons match \"", search, "\""]
|
|
26563
|
+
}), filteredCurated.length > 0 && /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
26564
|
+
className: "flex flex-col space-y-1.5",
|
|
26565
|
+
children: [/*#__PURE__*/jsxRuntime.jsx("span", {
|
|
26566
|
+
className: "text-xs font-medium opacity-50",
|
|
26567
|
+
children: "Suggested"
|
|
26568
|
+
}), /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
26569
|
+
className: "grid grid-cols-6 gap-2",
|
|
26570
|
+
children: filteredCurated.map(renderIcon)
|
|
26571
|
+
})]
|
|
26572
|
+
}), remainingIcons.length > 0 && /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
26573
|
+
className: "flex flex-col space-y-1.5",
|
|
26574
|
+
children: [/*#__PURE__*/jsxRuntime.jsx("span", {
|
|
26575
|
+
className: "text-xs font-medium opacity-50",
|
|
26576
|
+
children: "All Icons"
|
|
26577
|
+
}), /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
26578
|
+
className: "grid grid-cols-6 gap-2",
|
|
26579
|
+
children: remainingIcons.map(renderIcon)
|
|
26580
|
+
})]
|
|
26581
|
+
})]
|
|
26582
|
+
})]
|
|
26583
|
+
});
|
|
26584
|
+
};
|
|
26585
|
+
|
|
26586
|
+
var DASHBOARD_TAGS = ["productivity", "monitoring", "analytics", "communication", "developer", "sales", "marketing", "finance", "project-management", "social", "news", "utilities"];
|
|
26587
|
+
|
|
26588
|
+
/**
|
|
26589
|
+
* PublishDashboardModal — multi-step stepper for preparing a dashboard
|
|
26590
|
+
* for registry publishing.
|
|
26591
|
+
*
|
|
26592
|
+
* Steps:
|
|
26593
|
+
* 1. Details — Author name (required) + description (textarea)
|
|
26594
|
+
* 2. Tags — Predefined tag selection with toggle-pill styling
|
|
26595
|
+
* 3. Icon — Full icon picker with search
|
|
26596
|
+
* 4. Publish — Review summary, publish action, result display
|
|
26597
|
+
*/
|
|
26483
26598
|
var PublishDashboardModal = function PublishDashboardModal(_ref) {
|
|
26484
26599
|
var isOpen = _ref.isOpen,
|
|
26485
26600
|
setIsOpen = _ref.setIsOpen,
|
|
@@ -26491,36 +26606,67 @@ var PublishDashboardModal = function PublishDashboardModal(_ref) {
|
|
|
26491
26606
|
var panelStyles = DashReact.getStylesForItem(DashReact.themeObjects.PANEL, currentTheme, {
|
|
26492
26607
|
grow: false
|
|
26493
26608
|
});
|
|
26494
|
-
|
|
26609
|
+
// Stepper state
|
|
26610
|
+
var _useState = React.useState(0),
|
|
26495
26611
|
_useState2 = _slicedToArray(_useState, 2),
|
|
26496
|
-
|
|
26497
|
-
|
|
26612
|
+
step = _useState2[0],
|
|
26613
|
+
setStep = _useState2[1];
|
|
26614
|
+
|
|
26615
|
+
// Step 1: Details
|
|
26498
26616
|
var _useState3 = React.useState(""),
|
|
26499
26617
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
26500
|
-
|
|
26501
|
-
|
|
26618
|
+
authorName = _useState4[0],
|
|
26619
|
+
setAuthorName = _useState4[1];
|
|
26502
26620
|
var _useState5 = React.useState(""),
|
|
26503
26621
|
_useState6 = _slicedToArray(_useState5, 2),
|
|
26504
|
-
|
|
26505
|
-
|
|
26506
|
-
|
|
26622
|
+
description = _useState6[0],
|
|
26623
|
+
setDescription = _useState6[1];
|
|
26624
|
+
|
|
26625
|
+
// Step 2: Tags
|
|
26626
|
+
var _useState7 = React.useState([]),
|
|
26507
26627
|
_useState8 = _slicedToArray(_useState7, 2),
|
|
26508
|
-
|
|
26509
|
-
|
|
26510
|
-
|
|
26628
|
+
selectedTags = _useState8[0],
|
|
26629
|
+
setSelectedTags = _useState8[1];
|
|
26630
|
+
|
|
26631
|
+
// Step 3: Icon
|
|
26632
|
+
var _useState9 = React.useState("grip"),
|
|
26511
26633
|
_useState0 = _slicedToArray(_useState9, 2),
|
|
26512
|
-
|
|
26513
|
-
|
|
26634
|
+
icon = _useState0[0],
|
|
26635
|
+
setIcon = _useState0[1];
|
|
26636
|
+
|
|
26637
|
+
// Step 4: Publish
|
|
26638
|
+
var _useState1 = React.useState(false),
|
|
26639
|
+
_useState10 = _slicedToArray(_useState1, 2),
|
|
26640
|
+
isPublishing = _useState10[0],
|
|
26641
|
+
setIsPublishing = _useState10[1];
|
|
26642
|
+
var _useState11 = React.useState(null),
|
|
26643
|
+
_useState12 = _slicedToArray(_useState11, 2),
|
|
26644
|
+
result = _useState12[0],
|
|
26645
|
+
setResult = _useState12[1];
|
|
26646
|
+
function resetState() {
|
|
26647
|
+
setStep(0);
|
|
26648
|
+
setAuthorName("");
|
|
26649
|
+
setDescription("");
|
|
26650
|
+
setSelectedTags([]);
|
|
26651
|
+
setIcon("grip");
|
|
26652
|
+
setIsPublishing(false);
|
|
26653
|
+
setResult(null);
|
|
26654
|
+
}
|
|
26514
26655
|
function handleClose() {
|
|
26515
26656
|
setIsOpen(false);
|
|
26516
|
-
|
|
26517
|
-
|
|
26518
|
-
|
|
26519
|
-
|
|
26520
|
-
|
|
26521
|
-
|
|
26522
|
-
|
|
26523
|
-
|
|
26657
|
+
setTimeout(resetState, 200);
|
|
26658
|
+
}
|
|
26659
|
+
function handleStepChange(nextStep) {
|
|
26660
|
+
if (step === 0 && nextStep > 0 && !authorName.trim()) return;
|
|
26661
|
+
if (step === 1 && nextStep > 1 && selectedTags.length === 0) return;
|
|
26662
|
+
setStep(nextStep);
|
|
26663
|
+
}
|
|
26664
|
+
function toggleTag(tag) {
|
|
26665
|
+
setSelectedTags(function (prev) {
|
|
26666
|
+
return prev.includes(tag) ? prev.filter(function (t) {
|
|
26667
|
+
return t !== tag;
|
|
26668
|
+
}) : [].concat(_toConsumableArray(prev), [tag]);
|
|
26669
|
+
});
|
|
26524
26670
|
}
|
|
26525
26671
|
function handlePublish() {
|
|
26526
26672
|
return _handlePublish.apply(this, arguments);
|
|
@@ -26541,11 +26687,10 @@ var PublishDashboardModal = function PublishDashboardModal(_ref) {
|
|
|
26541
26687
|
setResult(null);
|
|
26542
26688
|
_context.prev = 2;
|
|
26543
26689
|
options = {
|
|
26690
|
+
authorName: authorName.trim(),
|
|
26544
26691
|
description: description.trim() || undefined,
|
|
26545
|
-
tags:
|
|
26546
|
-
|
|
26547
|
-
}).filter(Boolean),
|
|
26548
|
-
icon: icon.trim() || undefined
|
|
26692
|
+
tags: selectedTags,
|
|
26693
|
+
icon: icon || undefined
|
|
26549
26694
|
};
|
|
26550
26695
|
_context.next = 3;
|
|
26551
26696
|
return window.mainApi.dashboardConfig.prepareDashboardForPublish(appId, workspaceId, options);
|
|
@@ -26573,64 +26718,226 @@ var PublishDashboardModal = function PublishDashboardModal(_ref) {
|
|
|
26573
26718
|
}));
|
|
26574
26719
|
return _handlePublish.apply(this, arguments);
|
|
26575
26720
|
}
|
|
26576
|
-
|
|
26721
|
+
var isLastStep = step === 3;
|
|
26722
|
+
var canAdvance = step === 0 ? !!authorName.trim() : step === 1 ? selectedTags.length > 0 : true;
|
|
26723
|
+
return /*#__PURE__*/jsxRuntime.jsx(DashReact.Modal, {
|
|
26577
26724
|
isOpen: isOpen,
|
|
26578
26725
|
setIsOpen: handleClose,
|
|
26579
|
-
|
|
26580
|
-
|
|
26581
|
-
|
|
26582
|
-
|
|
26583
|
-
|
|
26584
|
-
|
|
26585
|
-
|
|
26586
|
-
|
|
26587
|
-
|
|
26588
|
-
|
|
26589
|
-
|
|
26590
|
-
|
|
26591
|
-
className: "
|
|
26592
|
-
children:
|
|
26593
|
-
|
|
26594
|
-
|
|
26595
|
-
|
|
26596
|
-
placeholder: "A brief description of this dashboard..."
|
|
26597
|
-
}), /*#__PURE__*/jsxRuntime.jsx(DashReact.InputText, {
|
|
26598
|
-
label: "Tags (comma-separated)",
|
|
26599
|
-
value: tags,
|
|
26600
|
-
onChange: setTags,
|
|
26601
|
-
placeholder: "productivity, slack, monitoring"
|
|
26602
|
-
}), /*#__PURE__*/jsxRuntime.jsx(DashReact.InputText, {
|
|
26603
|
-
label: "Icon (FontAwesome name)",
|
|
26604
|
-
value: icon,
|
|
26605
|
-
onChange: setIcon,
|
|
26606
|
-
placeholder: "chart-line"
|
|
26607
|
-
})]
|
|
26726
|
+
width: "w-full max-w-2xl",
|
|
26727
|
+
height: "h-[70vh]",
|
|
26728
|
+
children: /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
26729
|
+
className: "flex flex-col h-full rounded-lg overflow-clip border ".concat(panelStyles.backgroundColor || "", " ").concat(panelStyles.borderColor || "", " ").concat(panelStyles.textColor || ""),
|
|
26730
|
+
children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
26731
|
+
className: "flex-shrink-0 flex flex-row items-center justify-between p-4 border-b border-white/10",
|
|
26732
|
+
children: [/*#__PURE__*/jsxRuntime.jsxs("span", {
|
|
26733
|
+
className: "text-lg font-semibold",
|
|
26734
|
+
children: ["Publish \"", workspaceName || "Dashboard", "\""]
|
|
26735
|
+
}), /*#__PURE__*/jsxRuntime.jsx("button", {
|
|
26736
|
+
type: "button",
|
|
26737
|
+
onClick: handleClose,
|
|
26738
|
+
className: "opacity-50 hover:opacity-100 transition-opacity cursor-pointer",
|
|
26739
|
+
children: /*#__PURE__*/jsxRuntime.jsx(DashReact.FontAwesomeIcon, {
|
|
26740
|
+
icon: "xmark",
|
|
26741
|
+
className: "h-5 w-5"
|
|
26742
|
+
})
|
|
26608
26743
|
})]
|
|
26609
|
-
})
|
|
26610
|
-
|
|
26611
|
-
|
|
26612
|
-
|
|
26613
|
-
|
|
26614
|
-
|
|
26615
|
-
|
|
26616
|
-
|
|
26617
|
-
className: "
|
|
26618
|
-
children: "
|
|
26619
|
-
|
|
26620
|
-
|
|
26621
|
-
|
|
26622
|
-
|
|
26744
|
+
}), /*#__PURE__*/jsxRuntime.jsxs(DashReact.Stepper, {
|
|
26745
|
+
activeStep: step,
|
|
26746
|
+
onStepChange: handleStepChange,
|
|
26747
|
+
showNavigation: false,
|
|
26748
|
+
className: "flex-1 min-h-0 flex flex-col px-6 pt-2",
|
|
26749
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.Stepper.Step, {
|
|
26750
|
+
label: "Details",
|
|
26751
|
+
children: /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
26752
|
+
className: "flex-1 min-h-0 overflow-y-auto pb-4 space-y-5",
|
|
26753
|
+
children: [/*#__PURE__*/jsxRuntime.jsx("p", {
|
|
26754
|
+
className: "text-sm opacity-70",
|
|
26755
|
+
children: "Provide details about your dashboard for the registry listing."
|
|
26756
|
+
}), /*#__PURE__*/jsxRuntime.jsx(DashReact.InputText, {
|
|
26757
|
+
label: "Author Name *",
|
|
26758
|
+
value: authorName,
|
|
26759
|
+
onChange: setAuthorName,
|
|
26760
|
+
placeholder: "Your name"
|
|
26761
|
+
}), /*#__PURE__*/jsxRuntime.jsx(DashReact.TextArea, {
|
|
26762
|
+
label: "Description",
|
|
26763
|
+
value: description,
|
|
26764
|
+
onChange: setDescription,
|
|
26765
|
+
placeholder: "A brief description of this dashboard...",
|
|
26766
|
+
rows: 3
|
|
26767
|
+
})]
|
|
26768
|
+
})
|
|
26769
|
+
}), /*#__PURE__*/jsxRuntime.jsx(DashReact.Stepper.Step, {
|
|
26770
|
+
label: "Tags",
|
|
26771
|
+
children: /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
26772
|
+
className: "flex-1 min-h-0 overflow-y-auto pb-4 space-y-5",
|
|
26773
|
+
children: [/*#__PURE__*/jsxRuntime.jsx("p", {
|
|
26774
|
+
className: "text-sm opacity-70",
|
|
26775
|
+
children: "Select at least one tag to categorize your dashboard."
|
|
26776
|
+
}), /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
26777
|
+
className: "grid grid-cols-3 gap-2",
|
|
26778
|
+
children: DASHBOARD_TAGS.map(function (tag) {
|
|
26779
|
+
var isSelected = selectedTags.includes(tag);
|
|
26780
|
+
return /*#__PURE__*/jsxRuntime.jsx("button", {
|
|
26781
|
+
type: "button",
|
|
26782
|
+
onClick: function onClick() {
|
|
26783
|
+
return toggleTag(tag);
|
|
26784
|
+
},
|
|
26785
|
+
className: "px-3 py-1.5 rounded-full text-sm border transition-colors cursor-pointer ".concat(isSelected ? "bg-white/15 border-white/30 text-white" : "bg-transparent border-white/10 text-white/60 hover:border-white/20 hover:text-white/80"),
|
|
26786
|
+
children: tag
|
|
26787
|
+
}, tag);
|
|
26788
|
+
})
|
|
26789
|
+
})]
|
|
26790
|
+
})
|
|
26791
|
+
}), /*#__PURE__*/jsxRuntime.jsx(DashReact.Stepper.Step, {
|
|
26792
|
+
label: "Icon",
|
|
26793
|
+
children: /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
26794
|
+
className: "flex-1 min-h-0 flex flex-col pb-4",
|
|
26795
|
+
children: /*#__PURE__*/jsxRuntime.jsx(IconPicker, {
|
|
26796
|
+
selectedIcon: icon,
|
|
26797
|
+
onSelectIcon: setIcon
|
|
26798
|
+
})
|
|
26799
|
+
})
|
|
26800
|
+
}), /*#__PURE__*/jsxRuntime.jsx(DashReact.Stepper.Step, {
|
|
26801
|
+
label: "Publish",
|
|
26802
|
+
children: /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
26803
|
+
className: "flex-1 min-h-0 overflow-y-auto pb-4 space-y-4",
|
|
26804
|
+
children: !result ? /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
26805
|
+
children: [/*#__PURE__*/jsxRuntime.jsx("p", {
|
|
26806
|
+
className: "text-sm opacity-70",
|
|
26807
|
+
children: "Review your dashboard details before publishing."
|
|
26808
|
+
}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
26809
|
+
className: "bg-white/5 border border-white/10 rounded-lg p-4 space-y-2 text-sm",
|
|
26810
|
+
children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
26811
|
+
className: "flex gap-2",
|
|
26812
|
+
children: [/*#__PURE__*/jsxRuntime.jsx("span", {
|
|
26813
|
+
className: "opacity-50 w-20 flex-shrink-0",
|
|
26814
|
+
children: "Author"
|
|
26815
|
+
}), /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
26816
|
+
children: authorName
|
|
26817
|
+
})]
|
|
26818
|
+
}), description.trim() && /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
26819
|
+
className: "flex gap-2",
|
|
26820
|
+
children: [/*#__PURE__*/jsxRuntime.jsx("span", {
|
|
26821
|
+
className: "opacity-50 w-20 flex-shrink-0",
|
|
26822
|
+
children: "Description"
|
|
26823
|
+
}), /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
26824
|
+
children: description
|
|
26825
|
+
})]
|
|
26826
|
+
}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
26827
|
+
className: "flex gap-2",
|
|
26828
|
+
children: [/*#__PURE__*/jsxRuntime.jsx("span", {
|
|
26829
|
+
className: "opacity-50 w-20 flex-shrink-0",
|
|
26830
|
+
children: "Tags"
|
|
26831
|
+
}), /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
26832
|
+
children: selectedTags.length > 0 ? selectedTags.join(", ") : "None"
|
|
26833
|
+
})]
|
|
26834
|
+
}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
26835
|
+
className: "flex gap-2 items-center",
|
|
26836
|
+
children: [/*#__PURE__*/jsxRuntime.jsx("span", {
|
|
26837
|
+
className: "opacity-50 w-20 flex-shrink-0",
|
|
26838
|
+
children: "Icon"
|
|
26839
|
+
}), /*#__PURE__*/jsxRuntime.jsx(DashReact.FontAwesomeIcon, {
|
|
26840
|
+
icon: icon || "grip",
|
|
26841
|
+
className: "h-4 w-4"
|
|
26842
|
+
}), /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
26843
|
+
className: "opacity-70",
|
|
26844
|
+
children: icon || "grip"
|
|
26845
|
+
})]
|
|
26846
|
+
})]
|
|
26847
|
+
})]
|
|
26848
|
+
}) : result.success ? /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
26849
|
+
className: "space-y-3",
|
|
26850
|
+
children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
26851
|
+
className: "flex items-center gap-2",
|
|
26852
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.FontAwesomeIcon, {
|
|
26853
|
+
icon: "circle-check",
|
|
26854
|
+
className: "h-4 w-4 text-green-400"
|
|
26855
|
+
}), /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
26856
|
+
className: "text-sm",
|
|
26857
|
+
children: "Dashboard prepared for publishing."
|
|
26858
|
+
})]
|
|
26859
|
+
}), result.filePath && /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
26860
|
+
className: "text-xs opacity-50 break-all",
|
|
26861
|
+
children: ["Saved to: ", result.filePath]
|
|
26862
|
+
}), result.warnings && result.warnings.length > 0 && /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
26863
|
+
className: "bg-amber-500/10 border border-amber-500/20 rounded-lg p-3 space-y-2",
|
|
26864
|
+
children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
26865
|
+
className: "flex items-start gap-2",
|
|
26866
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.FontAwesomeIcon, {
|
|
26867
|
+
icon: "triangle-exclamation",
|
|
26868
|
+
className: "h-3.5 w-3.5 text-amber-400 mt-0.5 flex-shrink-0"
|
|
26869
|
+
}), /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
26870
|
+
className: "text-xs text-amber-300/90",
|
|
26871
|
+
children: "The following widgets are not currently on the registry. This may be intentional if they are private. Dashboards referencing these widgets can only be installed by users who already have them."
|
|
26872
|
+
})]
|
|
26873
|
+
}), /*#__PURE__*/jsxRuntime.jsx("ul", {
|
|
26874
|
+
className: "text-xs opacity-60 pl-5 list-disc space-y-0.5",
|
|
26875
|
+
children: result.warnings.map(function (w) {
|
|
26876
|
+
return /*#__PURE__*/jsxRuntime.jsx("li", {
|
|
26877
|
+
children: w
|
|
26878
|
+
}, w);
|
|
26879
|
+
})
|
|
26880
|
+
})]
|
|
26881
|
+
}), result.registryCheckFailed && /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
26882
|
+
className: "bg-amber-500/10 border border-amber-500/20 rounded-lg p-3",
|
|
26883
|
+
children: /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
26884
|
+
className: "flex items-start gap-2",
|
|
26885
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.FontAwesomeIcon, {
|
|
26886
|
+
icon: "triangle-exclamation",
|
|
26887
|
+
className: "h-3.5 w-3.5 text-amber-400 mt-0.5 flex-shrink-0"
|
|
26888
|
+
}), /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
26889
|
+
className: "text-xs text-amber-300/90",
|
|
26890
|
+
children: "Unable to reach the registry to verify widget availability. Your dashboard was still prepared successfully."
|
|
26891
|
+
})]
|
|
26892
|
+
})
|
|
26893
|
+
})]
|
|
26894
|
+
}) : /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
26895
|
+
className: "flex items-center gap-2",
|
|
26896
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.FontAwesomeIcon, {
|
|
26897
|
+
icon: "circle-xmark",
|
|
26898
|
+
className: "h-4 w-4 text-red-400"
|
|
26899
|
+
}), /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
26900
|
+
className: "text-sm text-red-400",
|
|
26901
|
+
children: result.error || "Publish preparation failed."
|
|
26902
|
+
})]
|
|
26903
|
+
})
|
|
26904
|
+
})
|
|
26623
26905
|
})]
|
|
26624
|
-
})
|
|
26625
|
-
className: "flex items-center
|
|
26626
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(
|
|
26627
|
-
|
|
26628
|
-
|
|
26629
|
-
|
|
26630
|
-
|
|
26631
|
-
|
|
26906
|
+
}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
26907
|
+
className: "flex-shrink-0 flex flex-row items-center px-6 py-4 border-t border-white/10",
|
|
26908
|
+
children: [/*#__PURE__*/jsxRuntime.jsx("div", {
|
|
26909
|
+
className: "flex flex-row gap-2",
|
|
26910
|
+
children: /*#__PURE__*/jsxRuntime.jsx(DashReact.Button3, {
|
|
26911
|
+
title: step === 0 ? "Cancel" : "Back",
|
|
26912
|
+
onClick: step === 0 ? handleClose : function () {
|
|
26913
|
+
return setStep(step - 1);
|
|
26914
|
+
},
|
|
26915
|
+
disabled: isPublishing
|
|
26916
|
+
})
|
|
26917
|
+
}), /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
26918
|
+
className: "flex-1 text-center",
|
|
26919
|
+
children: /*#__PURE__*/jsxRuntime.jsxs("span", {
|
|
26920
|
+
className: "text-xs opacity-40",
|
|
26921
|
+
children: ["Step ", step + 1, " of 4"]
|
|
26922
|
+
})
|
|
26923
|
+
}), /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
26924
|
+
className: "flex flex-row gap-2",
|
|
26925
|
+
children: result !== null && result !== void 0 && result.success ? /*#__PURE__*/jsxRuntime.jsx(DashReact.Button2, {
|
|
26926
|
+
title: "Done",
|
|
26927
|
+
onClick: handleClose
|
|
26928
|
+
}) : isLastStep ? /*#__PURE__*/jsxRuntime.jsx(DashReact.Button2, {
|
|
26929
|
+
title: isPublishing ? "Preparing..." : "Publish",
|
|
26930
|
+
onClick: handlePublish,
|
|
26931
|
+
disabled: isPublishing
|
|
26932
|
+
}) : /*#__PURE__*/jsxRuntime.jsx(DashReact.Button2, {
|
|
26933
|
+
title: "Next",
|
|
26934
|
+
onClick: function onClick() {
|
|
26935
|
+
return handleStepChange(step + 1);
|
|
26936
|
+
},
|
|
26937
|
+
disabled: !canAdvance
|
|
26938
|
+
})
|
|
26632
26939
|
})]
|
|
26633
|
-
})
|
|
26940
|
+
})]
|
|
26634
26941
|
})
|
|
26635
26942
|
});
|
|
26636
26943
|
};
|