@trops/dash-core 0.1.461 → 0.1.463
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 +383 -387
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +383 -387
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -7146,262 +7146,263 @@ var WizardDiscoverStep = function WizardDiscoverStep(_ref) {
|
|
|
7146
7146
|
};
|
|
7147
7147
|
var sectionLabelClass = "text-xs font-semibold text-gray-400 uppercase tracking-wide px-3 mb-1";
|
|
7148
7148
|
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
7149
|
-
className: "flex flex-
|
|
7150
|
-
children: [/*#__PURE__*/jsxRuntime.jsxs("
|
|
7151
|
-
className: "flex-
|
|
7152
|
-
children: [
|
|
7153
|
-
|
|
7149
|
+
className: "flex flex-col gap-4",
|
|
7150
|
+
children: [!isAuthenticated && /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
7151
|
+
className: "flex items-center gap-3 px-4 py-2 rounded-lg bg-gray-800 text-gray-300",
|
|
7152
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.FontAwesomeIcon, {
|
|
7153
|
+
icon: "circle-info",
|
|
7154
|
+
className: "text-blue-400 text-sm flex-shrink-0"
|
|
7155
|
+
}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
7156
|
+
className: "flex-1 min-w-0 flex flex-col",
|
|
7154
7157
|
children: [/*#__PURE__*/jsxRuntime.jsx("span", {
|
|
7155
|
-
className: "text-
|
|
7158
|
+
className: "text-sm text-gray-200",
|
|
7156
7159
|
children: "Sign in to registry"
|
|
7157
7160
|
}), /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
7158
7161
|
className: "text-xs text-gray-400",
|
|
7159
7162
|
children: "See dashboards and widgets you have access to"
|
|
7160
|
-
}), !isAuthenticating ? /*#__PURE__*/jsxRuntime.jsx("button", {
|
|
7161
|
-
type: "button",
|
|
7162
|
-
onClick: handleSignIn,
|
|
7163
|
-
className: "mt-1 text-xs py-1.5 px-3 rounded bg-blue-600 text-white hover:bg-blue-500 transition-colors",
|
|
7164
|
-
children: "Sign in"
|
|
7165
|
-
}) : /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
7166
|
-
className: "mt-1 flex flex-col gap-1",
|
|
7167
|
-
children: [/*#__PURE__*/jsxRuntime.jsx("span", {
|
|
7168
|
-
className: "text-xs text-gray-400",
|
|
7169
|
-
children: "Waiting for browser\u2026"
|
|
7170
|
-
}), /*#__PURE__*/jsxRuntime.jsx("button", {
|
|
7171
|
-
type: "button",
|
|
7172
|
-
onClick: cancelAuth,
|
|
7173
|
-
className: "text-xs text-gray-400 hover:text-gray-200 underline self-start",
|
|
7174
|
-
children: "Cancel"
|
|
7175
|
-
})]
|
|
7176
|
-
}), authError && /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
7177
|
-
className: "text-xs text-red-400",
|
|
7178
|
-
children: authError
|
|
7179
|
-
})]
|
|
7180
|
-
}), isAuthenticated && /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
7181
|
-
className: "flex items-center gap-2 px-3 text-xs text-gray-500",
|
|
7182
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.FontAwesomeIcon, {
|
|
7183
|
-
icon: "circle-check",
|
|
7184
|
-
className: "text-green-400 text-xs"
|
|
7185
|
-
}), /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
7186
|
-
children: "Signed in"
|
|
7187
|
-
})]
|
|
7188
|
-
}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
7189
|
-
className: "flex flex-col",
|
|
7190
|
-
children: [/*#__PURE__*/jsxRuntime.jsx("span", {
|
|
7191
|
-
className: sectionLabelClass,
|
|
7192
|
-
children: "TYPE"
|
|
7193
|
-
}), TYPE_OPTIONS.map(function (opt) {
|
|
7194
|
-
var active = typeFilter === opt.key;
|
|
7195
|
-
var showBadge = opt.key === "widgets" && state.selectedWidgets.length > 0;
|
|
7196
|
-
return /*#__PURE__*/jsxRuntime.jsxs("button", {
|
|
7197
|
-
type: "button",
|
|
7198
|
-
onClick: function onClick() {
|
|
7199
|
-
return setTypeFilter(opt.key);
|
|
7200
|
-
},
|
|
7201
|
-
className: rowClass(active),
|
|
7202
|
-
children: [/*#__PURE__*/jsxRuntime.jsx("span", {
|
|
7203
|
-
children: opt.label
|
|
7204
|
-
}), showBadge && /*#__PURE__*/jsxRuntime.jsx(DashReact.Tag3, {
|
|
7205
|
-
text: "".concat(state.selectedWidgets.length, " selected")
|
|
7206
|
-
})]
|
|
7207
|
-
}, opt.key);
|
|
7208
|
-
})]
|
|
7209
|
-
}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
7210
|
-
className: "flex flex-col",
|
|
7211
|
-
children: [/*#__PURE__*/jsxRuntime.jsx("span", {
|
|
7212
|
-
className: sectionLabelClass,
|
|
7213
|
-
children: "CATEGORIES"
|
|
7214
|
-
}), DASHBOARD_TAGS$1.map(function (tag) {
|
|
7215
|
-
var active = filters.categories.includes(tag);
|
|
7216
|
-
return /*#__PURE__*/jsxRuntime.jsx("button", {
|
|
7217
|
-
type: "button",
|
|
7218
|
-
onClick: function onClick() {
|
|
7219
|
-
return handleToggleCategory(tag);
|
|
7220
|
-
},
|
|
7221
|
-
className: "".concat(rowClass(active), " capitalize"),
|
|
7222
|
-
children: /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
7223
|
-
children: tag
|
|
7224
|
-
})
|
|
7225
|
-
}, tag);
|
|
7226
7163
|
})]
|
|
7227
|
-
}), /*#__PURE__*/jsxRuntime.
|
|
7228
|
-
|
|
7164
|
+
}), !isAuthenticating ? /*#__PURE__*/jsxRuntime.jsx("button", {
|
|
7165
|
+
type: "button",
|
|
7166
|
+
onClick: handleSignIn,
|
|
7167
|
+
className: "flex-shrink-0 text-xs py-1.5 px-3 rounded bg-blue-600 text-white hover:bg-blue-500 transition-colors",
|
|
7168
|
+
children: "Sign in"
|
|
7169
|
+
}) : /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
7170
|
+
className: "flex items-center gap-2 flex-shrink-0",
|
|
7229
7171
|
children: [/*#__PURE__*/jsxRuntime.jsx("span", {
|
|
7230
|
-
className:
|
|
7231
|
-
children: "
|
|
7232
|
-
}),
|
|
7233
|
-
|
|
7234
|
-
|
|
7235
|
-
|
|
7236
|
-
|
|
7237
|
-
return handleToggleProvider(prov.key);
|
|
7238
|
-
},
|
|
7239
|
-
className: rowClass(active),
|
|
7240
|
-
children: /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
7241
|
-
children: prov.name
|
|
7242
|
-
})
|
|
7243
|
-
}, prov.key);
|
|
7172
|
+
className: "text-xs text-gray-400",
|
|
7173
|
+
children: "Waiting for browser\u2026"
|
|
7174
|
+
}), /*#__PURE__*/jsxRuntime.jsx("button", {
|
|
7175
|
+
type: "button",
|
|
7176
|
+
onClick: cancelAuth,
|
|
7177
|
+
className: "text-xs text-gray-400 hover:text-gray-200 underline",
|
|
7178
|
+
children: "Cancel"
|
|
7244
7179
|
})]
|
|
7180
|
+
}), authError && /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
7181
|
+
className: "flex-shrink-0 text-xs text-red-400",
|
|
7182
|
+
children: authError
|
|
7245
7183
|
})]
|
|
7246
7184
|
}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
7247
|
-
className: "flex
|
|
7248
|
-
children: [/*#__PURE__*/jsxRuntime.jsxs("
|
|
7249
|
-
className: "flex
|
|
7250
|
-
children: [/*#__PURE__*/jsxRuntime.
|
|
7251
|
-
className: "flex-
|
|
7252
|
-
children: /*#__PURE__*/jsxRuntime.jsx(
|
|
7253
|
-
|
|
7254
|
-
|
|
7255
|
-
|
|
7256
|
-
|
|
7257
|
-
|
|
7258
|
-
|
|
7259
|
-
|
|
7260
|
-
|
|
7261
|
-
|
|
7262
|
-
|
|
7263
|
-
|
|
7264
|
-
|
|
7265
|
-
|
|
7266
|
-
|
|
7267
|
-
|
|
7268
|
-
|
|
7269
|
-
|
|
7270
|
-
children: showDashboards ? "".concat(visibleDashboards.length, " dashboard").concat(visibleDashboards.length === 1 ? "" : "s") : "".concat(visibleWidgets.length, " widget").concat(visibleWidgets.length === 1 ? "" : "s")
|
|
7271
|
-
}), /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
7272
|
-
className: "flex flex-col gap-6",
|
|
7273
|
-
children: isLoading ? /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
7274
|
-
className: "flex flex-col items-center justify-center gap-2 py-12 text-gray-400",
|
|
7275
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.FontAwesomeIcon, {
|
|
7276
|
-
icon: "spinner",
|
|
7277
|
-
spin: true,
|
|
7278
|
-
fixedWidth: true
|
|
7279
|
-
}), /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
7280
|
-
children: "Searching registry..."
|
|
7185
|
+
className: "flex flex-row gap-4",
|
|
7186
|
+
children: [/*#__PURE__*/jsxRuntime.jsxs("aside", {
|
|
7187
|
+
className: "flex-shrink-0 w-56 flex flex-col gap-4 sticky top-0 self-start",
|
|
7188
|
+
children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
7189
|
+
className: "flex flex-col",
|
|
7190
|
+
children: [/*#__PURE__*/jsxRuntime.jsx("span", {
|
|
7191
|
+
className: sectionLabelClass,
|
|
7192
|
+
children: "TYPE"
|
|
7193
|
+
}), TYPE_OPTIONS.map(function (opt) {
|
|
7194
|
+
var active = typeFilter === opt.key;
|
|
7195
|
+
var showBadge = opt.key === "widgets" && state.selectedWidgets.length > 0;
|
|
7196
|
+
return /*#__PURE__*/jsxRuntime.jsxs("button", {
|
|
7197
|
+
type: "button",
|
|
7198
|
+
onClick: function onClick() {
|
|
7199
|
+
return setTypeFilter(opt.key);
|
|
7200
|
+
},
|
|
7201
|
+
className: rowClass(active),
|
|
7202
|
+
children: [/*#__PURE__*/jsxRuntime.jsx("span", {
|
|
7203
|
+
children: opt.label
|
|
7204
|
+
}), showBadge && /*#__PURE__*/jsxRuntime.jsx(DashReact.Tag3, {
|
|
7205
|
+
text: "".concat(state.selectedWidgets.length, " selected")
|
|
7206
|
+
})]
|
|
7207
|
+
}, opt.key);
|
|
7281
7208
|
})]
|
|
7282
|
-
})
|
|
7283
|
-
className: "flex
|
|
7284
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(
|
|
7285
|
-
|
|
7286
|
-
|
|
7287
|
-
}),
|
|
7288
|
-
|
|
7209
|
+
}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
7210
|
+
className: "flex flex-col",
|
|
7211
|
+
children: [/*#__PURE__*/jsxRuntime.jsx("span", {
|
|
7212
|
+
className: sectionLabelClass,
|
|
7213
|
+
children: "CATEGORIES"
|
|
7214
|
+
}), DASHBOARD_TAGS$1.map(function (tag) {
|
|
7215
|
+
var active = filters.categories.includes(tag);
|
|
7216
|
+
return /*#__PURE__*/jsxRuntime.jsx("button", {
|
|
7217
|
+
type: "button",
|
|
7218
|
+
onClick: function onClick() {
|
|
7219
|
+
return handleToggleCategory(tag);
|
|
7220
|
+
},
|
|
7221
|
+
className: "".concat(rowClass(active), " capitalize"),
|
|
7222
|
+
children: /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
7223
|
+
children: tag
|
|
7224
|
+
})
|
|
7225
|
+
}, tag);
|
|
7289
7226
|
})]
|
|
7290
|
-
})
|
|
7291
|
-
className: "flex flex-col
|
|
7292
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(
|
|
7293
|
-
|
|
7294
|
-
|
|
7295
|
-
}),
|
|
7296
|
-
|
|
7297
|
-
|
|
7298
|
-
|
|
7299
|
-
|
|
7227
|
+
}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
7228
|
+
className: "flex flex-col",
|
|
7229
|
+
children: [/*#__PURE__*/jsxRuntime.jsx("span", {
|
|
7230
|
+
className: sectionLabelClass,
|
|
7231
|
+
children: "PROVIDERS"
|
|
7232
|
+
}), KNOWN_PROVIDERS.map(function (prov) {
|
|
7233
|
+
var active = filters.providers.includes(prov.key);
|
|
7234
|
+
return /*#__PURE__*/jsxRuntime.jsx("button", {
|
|
7235
|
+
type: "button",
|
|
7236
|
+
onClick: function onClick() {
|
|
7237
|
+
return handleToggleProvider(prov.key);
|
|
7238
|
+
},
|
|
7239
|
+
className: rowClass(active),
|
|
7240
|
+
children: /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
7241
|
+
children: prov.name
|
|
7242
|
+
})
|
|
7243
|
+
}, prov.key);
|
|
7300
7244
|
})]
|
|
7301
|
-
})
|
|
7302
|
-
|
|
7303
|
-
|
|
7304
|
-
|
|
7305
|
-
|
|
7306
|
-
|
|
7307
|
-
|
|
7308
|
-
|
|
7309
|
-
|
|
7310
|
-
|
|
7311
|
-
|
|
7312
|
-
|
|
7313
|
-
|
|
7314
|
-
|
|
7315
|
-
|
|
7316
|
-
|
|
7317
|
-
|
|
7318
|
-
|
|
7319
|
-
|
|
7320
|
-
|
|
7321
|
-
|
|
7322
|
-
|
|
7245
|
+
})]
|
|
7246
|
+
}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
7247
|
+
className: "flex-1 min-w-0 flex flex-col gap-4",
|
|
7248
|
+
children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
7249
|
+
className: "flex items-center gap-3",
|
|
7250
|
+
children: [/*#__PURE__*/jsxRuntime.jsx("div", {
|
|
7251
|
+
className: "flex-1",
|
|
7252
|
+
children: /*#__PURE__*/jsxRuntime.jsx(DashReact.InputText, {
|
|
7253
|
+
value: searchQuery,
|
|
7254
|
+
onChange: handleSearchChange,
|
|
7255
|
+
placeholder: "Search registry..."
|
|
7256
|
+
})
|
|
7257
|
+
}), hasSelection && /*#__PURE__*/jsxRuntime.jsx(DashReact.Button, {
|
|
7258
|
+
onClick: handleClearSelection,
|
|
7259
|
+
title: "Clear Selection",
|
|
7260
|
+
textSize: "text-xs",
|
|
7261
|
+
padding: "py-1 px-3",
|
|
7262
|
+
backgroundColor: "bg-gray-700",
|
|
7263
|
+
textColor: "text-gray-400",
|
|
7264
|
+
hoverTextColor: "hover:text-white",
|
|
7265
|
+
hoverBackgroundColor: "hover:bg-gray-600",
|
|
7266
|
+
icon: "xmark"
|
|
7267
|
+
})]
|
|
7268
|
+
}), !isLoading && !error && /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
7269
|
+
className: "text-xs text-gray-500 px-1",
|
|
7270
|
+
children: showDashboards ? "".concat(visibleDashboards.length, " dashboard").concat(visibleDashboards.length === 1 ? "" : "s") : "".concat(visibleWidgets.length, " widget").concat(visibleWidgets.length === 1 ? "" : "s")
|
|
7271
|
+
}), /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
7272
|
+
className: "flex flex-col gap-6",
|
|
7273
|
+
children: isLoading ? /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
7274
|
+
className: "flex flex-col items-center justify-center gap-2 py-12 text-gray-400",
|
|
7275
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.FontAwesomeIcon, {
|
|
7276
|
+
icon: "spinner",
|
|
7277
|
+
spin: true,
|
|
7278
|
+
fixedWidth: true
|
|
7279
|
+
}), /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
7280
|
+
children: "Searching registry..."
|
|
7281
|
+
})]
|
|
7282
|
+
}) : error ? /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
7283
|
+
className: "flex items-center gap-2 text-red-400 py-4",
|
|
7284
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.FontAwesomeIcon, {
|
|
7285
|
+
icon: "circle-exclamation",
|
|
7286
|
+
fixedWidth: true
|
|
7287
|
+
}), /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
7288
|
+
children: error
|
|
7289
|
+
})]
|
|
7290
|
+
}) : !hasResults ? /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
7291
|
+
className: "flex flex-col items-center justify-center gap-2 py-12 text-gray-500",
|
|
7292
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.FontAwesomeIcon, {
|
|
7293
|
+
icon: "magnifying-glass",
|
|
7294
|
+
fixedWidth: true
|
|
7295
|
+
}), /*#__PURE__*/jsxRuntime.jsx("p", {
|
|
7296
|
+
children: "No results match your search."
|
|
7297
|
+
}), hasActiveFilters && /*#__PURE__*/jsxRuntime.jsx("p", {
|
|
7298
|
+
className: "text-xs text-gray-600",
|
|
7299
|
+
children: "Try removing some filters to see more results."
|
|
7300
|
+
})]
|
|
7301
|
+
}) : /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
7302
|
+
children: [showDashboards && visibleDashboards.length > 0 && /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
7303
|
+
className: "flex flex-col gap-3",
|
|
7304
|
+
children: /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
7305
|
+
className: "grid grid-cols-3 gap-3",
|
|
7306
|
+
children: visibleDashboards.map(function (dash) {
|
|
7307
|
+
var isSelected = state.selectedDashboard && state.selectedDashboard.name === dash.name;
|
|
7308
|
+
var widgetCount = (dash.widgets || []).length;
|
|
7309
|
+
var providerTags = (dash.providers || []).map(function (p) {
|
|
7310
|
+
return p.name || p.type;
|
|
7311
|
+
}).filter(Boolean);
|
|
7312
|
+
return /*#__PURE__*/jsxRuntime.jsxs(DashReact.Card2, {
|
|
7313
|
+
hover: true,
|
|
7314
|
+
selected: isSelected,
|
|
7315
|
+
padding: "p-5",
|
|
7316
|
+
rounded: "rounded-lg",
|
|
7317
|
+
className: "hover:shadow-lg",
|
|
7318
|
+
onClick: function onClick() {
|
|
7319
|
+
return handleSelectDashboard(dash);
|
|
7320
|
+
},
|
|
7323
7321
|
children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
7324
|
-
className: "
|
|
7325
|
-
children: [/*#__PURE__*/jsxRuntime.
|
|
7326
|
-
className: "
|
|
7327
|
-
children: /*#__PURE__*/jsxRuntime.jsx(
|
|
7328
|
-
|
|
7329
|
-
|
|
7330
|
-
|
|
7322
|
+
className: "flex flex-col items-center text-center gap-2",
|
|
7323
|
+
children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
7324
|
+
className: "relative",
|
|
7325
|
+
children: [/*#__PURE__*/jsxRuntime.jsx("span", {
|
|
7326
|
+
className: "text-2xl",
|
|
7327
|
+
children: /*#__PURE__*/jsxRuntime.jsx(DashReact.FontAwesomeIcon, {
|
|
7328
|
+
icon: resolveIcon(dash.icon || "grid-2"),
|
|
7329
|
+
fixedWidth: true,
|
|
7330
|
+
className: "text-gray-400"
|
|
7331
|
+
})
|
|
7332
|
+
}), isSelected && /*#__PURE__*/jsxRuntime.jsx(DashReact.FontAwesomeIcon, {
|
|
7333
|
+
icon: "circle-check",
|
|
7334
|
+
className: "absolute -top-1 -right-3 text-blue-400 text-xs"
|
|
7335
|
+
})]
|
|
7336
|
+
}), /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
7337
|
+
className: "text-sm font-semibold text-gray-200",
|
|
7338
|
+
children: dash.displayName || dash.name
|
|
7339
|
+
})]
|
|
7340
|
+
}), dash.description && /*#__PURE__*/jsxRuntime.jsx("p", {
|
|
7341
|
+
className: "text-xs text-gray-400 mt-2 line-clamp-2 text-center",
|
|
7342
|
+
children: dash.description
|
|
7343
|
+
}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
7344
|
+
className: "flex items-center justify-between mt-3 pt-2 border-t border-gray-700/50",
|
|
7345
|
+
children: [/*#__PURE__*/jsxRuntime.jsxs("span", {
|
|
7346
|
+
className: "text-xs text-gray-500",
|
|
7347
|
+
children: [widgetCount, " widget", widgetCount !== 1 ? "s" : ""]
|
|
7348
|
+
}), providerTags.length > 0 && /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
7349
|
+
className: "flex flex-wrap gap-1 justify-end",
|
|
7350
|
+
children: providerTags.slice(0, 3).map(function (tag) {
|
|
7351
|
+
return /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
7352
|
+
className: "text-xs px-1.5 py-0.5 rounded bg-gray-800 text-gray-400",
|
|
7353
|
+
children: tag
|
|
7354
|
+
}, tag);
|
|
7331
7355
|
})
|
|
7332
|
-
}), isSelected && /*#__PURE__*/jsxRuntime.jsx(DashReact.FontAwesomeIcon, {
|
|
7333
|
-
icon: "circle-check",
|
|
7334
|
-
className: "absolute -top-1 -right-3 text-blue-400 text-xs"
|
|
7335
7356
|
})]
|
|
7336
|
-
}), /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
7337
|
-
className: "text-sm font-semibold text-gray-200",
|
|
7338
|
-
children: dash.displayName || dash.name
|
|
7339
7357
|
})]
|
|
7340
|
-
}
|
|
7341
|
-
|
|
7342
|
-
children: dash.description
|
|
7343
|
-
}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
7344
|
-
className: "flex items-center justify-between mt-3 pt-2 border-t border-gray-700/50",
|
|
7345
|
-
children: [/*#__PURE__*/jsxRuntime.jsxs("span", {
|
|
7346
|
-
className: "text-xs text-gray-500",
|
|
7347
|
-
children: [widgetCount, " widget", widgetCount !== 1 ? "s" : ""]
|
|
7348
|
-
}), providerTags.length > 0 && /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
7349
|
-
className: "flex flex-wrap gap-1 justify-end",
|
|
7350
|
-
children: providerTags.slice(0, 3).map(function (tag) {
|
|
7351
|
-
return /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
7352
|
-
className: "text-xs px-1.5 py-0.5 rounded bg-gray-800 text-gray-400",
|
|
7353
|
-
children: tag
|
|
7354
|
-
}, tag);
|
|
7355
|
-
})
|
|
7356
|
-
})]
|
|
7357
|
-
})]
|
|
7358
|
-
}, dash.name);
|
|
7358
|
+
}, dash.name);
|
|
7359
|
+
})
|
|
7359
7360
|
})
|
|
7360
|
-
})
|
|
7361
|
-
|
|
7362
|
-
|
|
7363
|
-
|
|
7364
|
-
|
|
7365
|
-
|
|
7366
|
-
|
|
7367
|
-
|
|
7368
|
-
|
|
7369
|
-
|
|
7370
|
-
|
|
7371
|
-
|
|
7372
|
-
|
|
7373
|
-
|
|
7374
|
-
|
|
7375
|
-
},
|
|
7376
|
-
children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
7377
|
-
className: "flex items-start justify-between gap-2",
|
|
7361
|
+
}), showWidgets && visibleWidgets.length > 0 && /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
7362
|
+
className: "flex flex-col gap-3",
|
|
7363
|
+
children: /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
7364
|
+
className: "grid grid-cols-3 gap-3",
|
|
7365
|
+
children: visibleWidgets.map(function (widget) {
|
|
7366
|
+
var checked = isWidgetSelected(widget);
|
|
7367
|
+
return /*#__PURE__*/jsxRuntime.jsxs(DashReact.Card2, {
|
|
7368
|
+
hover: true,
|
|
7369
|
+
selected: checked,
|
|
7370
|
+
padding: "p-4",
|
|
7371
|
+
rounded: "rounded-lg",
|
|
7372
|
+
className: "hover:shadow-lg flex flex-col",
|
|
7373
|
+
onClick: function onClick() {
|
|
7374
|
+
return handleToggleWidget(widget);
|
|
7375
|
+
},
|
|
7378
7376
|
children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
7379
|
-
className: "flex items-
|
|
7380
|
-
children: [
|
|
7381
|
-
|
|
7377
|
+
className: "flex items-start justify-between gap-2",
|
|
7378
|
+
children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
7379
|
+
className: "flex items-center gap-1.5",
|
|
7380
|
+
children: [widget.icon && /*#__PURE__*/jsxRuntime.jsx(DashReact.FontAwesomeIcon, {
|
|
7381
|
+
icon: resolveIcon(widget.icon),
|
|
7382
|
+
fixedWidth: true,
|
|
7383
|
+
className: "text-gray-400 text-sm"
|
|
7384
|
+
}), /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
7385
|
+
className: "text-sm font-medium text-gray-200 truncate",
|
|
7386
|
+
children: widget.name
|
|
7387
|
+
})]
|
|
7388
|
+
}), /*#__PURE__*/jsxRuntime.jsx(DashReact.FontAwesomeIcon, {
|
|
7389
|
+
icon: checked ? "square-check" : "square",
|
|
7382
7390
|
fixedWidth: true,
|
|
7383
|
-
className: "text-
|
|
7384
|
-
}), /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
7385
|
-
className: "text-sm font-medium text-gray-200 truncate",
|
|
7386
|
-
children: widget.name
|
|
7391
|
+
className: checked ? "text-blue-400 flex-shrink-0" : "text-gray-500 flex-shrink-0"
|
|
7387
7392
|
})]
|
|
7388
|
-
}), /*#__PURE__*/jsxRuntime.jsx(
|
|
7389
|
-
|
|
7390
|
-
|
|
7391
|
-
|
|
7393
|
+
}), widget.description && /*#__PURE__*/jsxRuntime.jsx("p", {
|
|
7394
|
+
className: "text-xs text-gray-400 line-clamp-2 mt-1.5 flex-1",
|
|
7395
|
+
children: widget.description
|
|
7396
|
+
}), widget.packageDisplayName && /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
7397
|
+
className: "text-xs text-gray-500 mt-2 pt-1.5 border-t border-gray-700/50 truncate",
|
|
7398
|
+
children: widget.packageDisplayName
|
|
7392
7399
|
})]
|
|
7393
|
-
}
|
|
7394
|
-
|
|
7395
|
-
children: widget.description
|
|
7396
|
-
}), widget.packageDisplayName && /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
7397
|
-
className: "text-xs text-gray-500 mt-2 pt-1.5 border-t border-gray-700/50 truncate",
|
|
7398
|
-
children: widget.packageDisplayName
|
|
7399
|
-
})]
|
|
7400
|
-
}, widget.key);
|
|
7400
|
+
}, widget.key);
|
|
7401
|
+
})
|
|
7401
7402
|
})
|
|
7402
|
-
})
|
|
7403
|
-
})
|
|
7404
|
-
})
|
|
7403
|
+
})]
|
|
7404
|
+
})
|
|
7405
|
+
})]
|
|
7405
7406
|
})]
|
|
7406
7407
|
})]
|
|
7407
7408
|
});
|
|
@@ -7517,11 +7518,12 @@ var WizardCustomizeStep = function WizardCustomizeStep(_ref) {
|
|
|
7517
7518
|
};
|
|
7518
7519
|
}, []);
|
|
7519
7520
|
|
|
7520
|
-
//
|
|
7521
|
-
|
|
7522
|
-
|
|
7523
|
-
|
|
7524
|
-
|
|
7521
|
+
// Cycle 2: the inner pages were promoted to top-level wizard steps
|
|
7522
|
+
// (state.step 1=Name, 2=Folder, 3=Theme, 4=Review). The internal
|
|
7523
|
+
// mini-stepper from DASH-188 is gone — the modal footer's
|
|
7524
|
+
// Next/Back drives advancement now, and the wizard's per-step
|
|
7525
|
+
// canProceed gates each transition.
|
|
7526
|
+
|
|
7525
7527
|
var isPrebuilt = state.path === "prebuilt";
|
|
7526
7528
|
|
|
7527
7529
|
// Initialize customization defaults when stepping into this step
|
|
@@ -7826,7 +7828,6 @@ var WizardCustomizeStep = function WizardCustomizeStep(_ref) {
|
|
|
7826
7828
|
setIsCreatingFolder(false);
|
|
7827
7829
|
setNewFolderName("");
|
|
7828
7830
|
setNewFolderIcon(null);
|
|
7829
|
-
setSubStep(2); // Auto-advance to Theme
|
|
7830
7831
|
}, [dispatch]);
|
|
7831
7832
|
var handleThemeSelect = React.useCallback(function (key) {
|
|
7832
7833
|
dispatch({
|
|
@@ -7992,43 +7993,71 @@ var WizardCustomizeStep = function WizardCustomizeStep(_ref) {
|
|
|
7992
7993
|
return item.id === state.customization.menuId;
|
|
7993
7994
|
});
|
|
7994
7995
|
var selectedTheme = themes && state.customization.theme ? themes[state.customization.theme] : null;
|
|
7995
|
-
var SUB_STEPS = [{
|
|
7996
|
-
label: "Name",
|
|
7997
|
-
icon: "input-text"
|
|
7998
|
-
}, {
|
|
7999
|
-
label: "Folder",
|
|
8000
|
-
icon: "folder"
|
|
8001
|
-
}, {
|
|
8002
|
-
label: "Theme",
|
|
8003
|
-
icon: "palette"
|
|
8004
|
-
}];
|
|
8005
7996
|
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
8006
7997
|
className: "flex flex-col gap-4",
|
|
8007
7998
|
children: [/*#__PURE__*/jsxRuntime.jsx("h3", {
|
|
8008
7999
|
className: "text-lg font-semibold text-gray-200",
|
|
8009
8000
|
children: "Customize your dashboard"
|
|
8010
|
-
}), /*#__PURE__*/jsxRuntime.
|
|
8011
|
-
className: "flex
|
|
8012
|
-
children:
|
|
8013
|
-
|
|
8014
|
-
|
|
8015
|
-
|
|
8016
|
-
|
|
8017
|
-
|
|
8018
|
-
|
|
8019
|
-
|
|
8020
|
-
|
|
8021
|
-
|
|
8022
|
-
|
|
8023
|
-
|
|
8024
|
-
|
|
8025
|
-
|
|
8001
|
+
}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
8002
|
+
className: "rounded-lg border border-gray-700/50 bg-gray-800/50 p-4 flex flex-col gap-2",
|
|
8003
|
+
children: [/*#__PURE__*/jsxRuntime.jsx("span", {
|
|
8004
|
+
className: "text-sm font-semibold text-gray-300",
|
|
8005
|
+
children: "Summary"
|
|
8006
|
+
}), state.customization.name.trim() && /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
8007
|
+
className: "flex items-center gap-2 text-sm text-gray-300",
|
|
8008
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.FontAwesomeIcon, {
|
|
8009
|
+
icon: "clone",
|
|
8010
|
+
className: "text-blue-400"
|
|
8011
|
+
}), /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
8012
|
+
children: state.customization.name.trim()
|
|
8013
|
+
})]
|
|
8014
|
+
}), selectedFolder && /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
8015
|
+
className: "flex items-center gap-2 text-sm text-gray-300",
|
|
8016
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.FontAwesomeIcon, {
|
|
8017
|
+
icon: selectedFolder.icon || selectedFolder.folder || "folder",
|
|
8018
|
+
className: "text-blue-400"
|
|
8019
|
+
}), /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
8020
|
+
children: selectedFolder.name
|
|
8021
|
+
})]
|
|
8022
|
+
}), selectedTheme && /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
8023
|
+
className: "flex items-center gap-2 text-sm text-gray-300",
|
|
8024
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.FontAwesomeIcon, {
|
|
8025
|
+
icon: "palette",
|
|
8026
|
+
className: "text-blue-400"
|
|
8027
|
+
}), /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
8028
|
+
children: selectedTheme.name || state.customization.theme
|
|
8029
|
+
}), state.customization.theme === appThemeKey && /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
8030
|
+
className: "text-xs text-gray-500",
|
|
8031
|
+
children: "(default)"
|
|
8032
|
+
}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
8033
|
+
className: "flex flex-row space-x-1 ml-2",
|
|
8034
|
+
children: [selectedTheme.primary && /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
8035
|
+
className: "w-3 h-3 rounded bg-".concat(selectedTheme.primary, "-500")
|
|
8036
|
+
}), selectedTheme.secondary && /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
8037
|
+
className: "w-3 h-3 rounded bg-".concat(selectedTheme.secondary, "-500")
|
|
8026
8038
|
})]
|
|
8027
|
-
}
|
|
8028
|
-
})
|
|
8039
|
+
})]
|
|
8040
|
+
}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
8041
|
+
className: "flex items-center gap-2 text-sm text-gray-300",
|
|
8042
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.FontAwesomeIcon, {
|
|
8043
|
+
icon: isPrebuilt ? "box" : "grid-2",
|
|
8044
|
+
className: "text-blue-400"
|
|
8045
|
+
}), /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
8046
|
+
children: isPrebuilt ? ((_state$selectedDashbo = state.selectedDashboard) === null || _state$selectedDashbo === void 0 ? void 0 : _state$selectedDashbo.displayName) || ((_state$selectedDashbo2 = state.selectedDashboard) === null || _state$selectedDashbo2 === void 0 ? void 0 : _state$selectedDashbo2.name) || "Pre-built dashboard" : "".concat(state.selectedWidgets.length, " widget").concat(state.selectedWidgets.length !== 1 ? "s" : "")
|
|
8047
|
+
})]
|
|
8048
|
+
})]
|
|
8049
|
+
}), error && /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
8050
|
+
className: "rounded-lg border border-red-500 bg-red-900 p-3 flex items-start gap-2",
|
|
8051
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.FontAwesomeIcon, {
|
|
8052
|
+
icon: "circle-exclamation",
|
|
8053
|
+
className: "text-red-400 mt-0.5 flex-shrink-0"
|
|
8054
|
+
}), /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
8055
|
+
className: "text-sm text-red-200",
|
|
8056
|
+
children: error
|
|
8057
|
+
})]
|
|
8029
8058
|
}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
8030
8059
|
className: "flex flex-col gap-6",
|
|
8031
|
-
children: [
|
|
8060
|
+
children: [state.step === 1 && /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
8032
8061
|
className: "flex flex-col gap-3",
|
|
8033
8062
|
children: [/*#__PURE__*/jsxRuntime.jsxs("label", {
|
|
8034
8063
|
className: "flex items-center gap-2 text-sm font-semibold text-gray-300",
|
|
@@ -8041,24 +8070,8 @@ var WizardCustomizeStep = function WizardCustomizeStep(_ref) {
|
|
|
8041
8070
|
onChange: handleNameChange,
|
|
8042
8071
|
placeholder: "My Dashboard",
|
|
8043
8072
|
autoFocus: true
|
|
8044
|
-
}), /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
8045
|
-
className: "flex justify-end mt-2",
|
|
8046
|
-
children: /*#__PURE__*/jsxRuntime.jsx(DashReact.Button, {
|
|
8047
|
-
onClick: function onClick() {
|
|
8048
|
-
return setSubStep(1);
|
|
8049
|
-
},
|
|
8050
|
-
title: "Next",
|
|
8051
|
-
textSize: "text-sm",
|
|
8052
|
-
padding: "py-1.5 px-4",
|
|
8053
|
-
backgroundColor: state.customization.name.trim() ? "bg-blue-600" : "bg-gray-700",
|
|
8054
|
-
textColor: state.customization.name.trim() ? "text-white" : "text-gray-500",
|
|
8055
|
-
hoverTextColor: state.customization.name.trim() ? "hover:text-white" : "hover:text-gray-500",
|
|
8056
|
-
hoverBackgroundColor: state.customization.name.trim() ? "hover:bg-blue-500" : "hover:bg-gray-700",
|
|
8057
|
-
disabled: !state.customization.name.trim(),
|
|
8058
|
-
icon: "arrow-right"
|
|
8059
|
-
})
|
|
8060
8073
|
})]
|
|
8061
|
-
}),
|
|
8074
|
+
}), state.step === 2 && /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
8062
8075
|
className: "flex flex-col gap-3",
|
|
8063
8076
|
children: [/*#__PURE__*/jsxRuntime.jsxs("label", {
|
|
8064
8077
|
className: "flex items-center gap-2 text-sm font-semibold text-gray-300",
|
|
@@ -8150,23 +8163,8 @@ var WizardCustomizeStep = function WizardCustomizeStep(_ref) {
|
|
|
8150
8163
|
})
|
|
8151
8164
|
}, item.id);
|
|
8152
8165
|
})]
|
|
8153
|
-
}), /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
8154
|
-
className: "flex justify-end mt-2",
|
|
8155
|
-
children: /*#__PURE__*/jsxRuntime.jsx(DashReact.Button, {
|
|
8156
|
-
onClick: function onClick() {
|
|
8157
|
-
return setSubStep(2);
|
|
8158
|
-
},
|
|
8159
|
-
title: "Next",
|
|
8160
|
-
textSize: "text-sm",
|
|
8161
|
-
padding: "py-1.5 px-4",
|
|
8162
|
-
backgroundColor: "bg-blue-600",
|
|
8163
|
-
textColor: "text-white",
|
|
8164
|
-
hoverTextColor: "hover:text-white",
|
|
8165
|
-
hoverBackgroundColor: "hover:bg-blue-500",
|
|
8166
|
-
icon: "arrow-right"
|
|
8167
|
-
})
|
|
8168
8166
|
})]
|
|
8169
|
-
}),
|
|
8167
|
+
}), state.step === 3 && /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
8170
8168
|
className: "flex flex-col gap-3",
|
|
8171
8169
|
children: [/*#__PURE__*/jsxRuntime.jsxs("label", {
|
|
8172
8170
|
className: "flex items-center gap-2 text-sm font-semibold text-gray-300",
|
|
@@ -8257,50 +8255,20 @@ var WizardCustomizeStep = function WizardCustomizeStep(_ref) {
|
|
|
8257
8255
|
})]
|
|
8258
8256
|
})]
|
|
8259
8257
|
})]
|
|
8260
|
-
}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
8261
|
-
className: "
|
|
8262
|
-
children: [/*#__PURE__*/jsxRuntime.
|
|
8263
|
-
className: "text-sm font-semibold text-gray-300",
|
|
8264
|
-
children: "Summary"
|
|
8265
|
-
}), state.customization.name.trim() && /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
8266
|
-
className: "flex items-center gap-2 text-sm text-gray-300",
|
|
8267
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.FontAwesomeIcon, {
|
|
8268
|
-
icon: "clone",
|
|
8269
|
-
className: "text-blue-400"
|
|
8270
|
-
}), /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
8271
|
-
children: state.customization.name.trim()
|
|
8272
|
-
})]
|
|
8273
|
-
}), selectedFolder && /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
8274
|
-
className: "flex items-center gap-2 text-sm text-gray-300",
|
|
8275
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.FontAwesomeIcon, {
|
|
8276
|
-
icon: selectedFolder.icon || selectedFolder.folder || "folder",
|
|
8277
|
-
className: "text-blue-400"
|
|
8278
|
-
}), /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
8279
|
-
children: selectedFolder.name
|
|
8280
|
-
})]
|
|
8281
|
-
}), selectedTheme && /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
8282
|
-
className: "flex items-center gap-2 text-sm text-gray-300",
|
|
8283
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.FontAwesomeIcon, {
|
|
8284
|
-
icon: "palette",
|
|
8285
|
-
className: "text-blue-400"
|
|
8286
|
-
}), /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
8287
|
-
children: selectedTheme.name || state.customization.theme
|
|
8288
|
-
}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
8289
|
-
className: "flex flex-row space-x-1 ml-2",
|
|
8290
|
-
children: [selectedTheme.primary && /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
8291
|
-
className: "w-3 h-3 rounded bg-".concat(selectedTheme.primary, "-500")
|
|
8292
|
-
}), selectedTheme.secondary && /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
8293
|
-
className: "w-3 h-3 rounded bg-".concat(selectedTheme.secondary, "-500")
|
|
8294
|
-
})]
|
|
8295
|
-
})]
|
|
8296
|
-
}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
8297
|
-
className: "flex items-center gap-2 text-sm text-gray-300",
|
|
8258
|
+
}), state.step === 4 && /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
8259
|
+
className: "flex flex-col gap-3",
|
|
8260
|
+
children: [/*#__PURE__*/jsxRuntime.jsxs("label", {
|
|
8261
|
+
className: "flex items-center gap-2 text-sm font-semibold text-gray-300",
|
|
8298
8262
|
children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.FontAwesomeIcon, {
|
|
8299
|
-
icon:
|
|
8300
|
-
|
|
8301
|
-
}),
|
|
8302
|
-
|
|
8303
|
-
|
|
8263
|
+
icon: "circle-check",
|
|
8264
|
+
fixedWidth: true
|
|
8265
|
+
}), "Review"]
|
|
8266
|
+
}), /*#__PURE__*/jsxRuntime.jsxs("p", {
|
|
8267
|
+
className: "text-sm text-gray-400",
|
|
8268
|
+
children: ["Confirm the dashboard details above. Click", " ", /*#__PURE__*/jsxRuntime.jsx("strong", {
|
|
8269
|
+
className: "text-gray-200",
|
|
8270
|
+
children: "Create Dashboard"
|
|
8271
|
+
}), " when you're ready \u2014 the modal footer holds the action."]
|
|
8304
8272
|
})]
|
|
8305
8273
|
}), authNeeded && /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
8306
8274
|
className: "flex flex-col gap-3",
|
|
@@ -8365,7 +8333,7 @@ var WizardCustomizeStep = function WizardCustomizeStep(_ref) {
|
|
|
8365
8333
|
|
|
8366
8334
|
function ownKeys$U(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
8367
8335
|
function _objectSpread$U(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$U(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$U(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
8368
|
-
var TOTAL_STEPS =
|
|
8336
|
+
var TOTAL_STEPS = 5; // Steps 0-4: Discover, Name, Folder, Theme, Review
|
|
8369
8337
|
|
|
8370
8338
|
var initialState = {
|
|
8371
8339
|
step: 0,
|
|
@@ -8496,11 +8464,26 @@ function widgetCountToTemplate(count) {
|
|
|
8496
8464
|
return "three-by-three";
|
|
8497
8465
|
}
|
|
8498
8466
|
function getCanProceed(state) {
|
|
8467
|
+
// Step semantics (Cycle 2 restructure):
|
|
8468
|
+
// 0 = Discover (browse + select)
|
|
8469
|
+
// 1 = Name
|
|
8470
|
+
// 2 = Folder
|
|
8471
|
+
// 3 = Theme
|
|
8472
|
+
// 4 = Review (final — Create button replaces Next)
|
|
8499
8473
|
switch (state.step) {
|
|
8500
8474
|
case 0:
|
|
8501
8475
|
return state.selectedDashboard !== null || state.selectedWidgets.length > 0;
|
|
8502
8476
|
case 1:
|
|
8503
8477
|
return state.customization.name.trim().length > 0;
|
|
8478
|
+
case 2:
|
|
8479
|
+
return state.customization.menuId !== null;
|
|
8480
|
+
case 3:
|
|
8481
|
+
return !!state.customization.theme;
|
|
8482
|
+
case 4:
|
|
8483
|
+
// Review is the final step — there's no "next" beyond it. The
|
|
8484
|
+
// modal's footer swaps Next for Create on this step; the actual
|
|
8485
|
+
// gate for *firing* Create is composed there (`canCreate`).
|
|
8486
|
+
return true;
|
|
8504
8487
|
default:
|
|
8505
8488
|
return false;
|
|
8506
8489
|
}
|
|
@@ -8557,11 +8540,17 @@ var useWizardState = function useWizardState() {
|
|
|
8557
8540
|
};
|
|
8558
8541
|
|
|
8559
8542
|
var STEP_LABELS = [{
|
|
8560
|
-
label: "
|
|
8561
|
-
description: "
|
|
8543
|
+
label: "Name",
|
|
8544
|
+
description: "Pick a name"
|
|
8545
|
+
}, {
|
|
8546
|
+
label: "Folder",
|
|
8547
|
+
description: "Where it lives"
|
|
8548
|
+
}, {
|
|
8549
|
+
label: "Theme",
|
|
8550
|
+
description: "How it looks"
|
|
8562
8551
|
}, {
|
|
8563
|
-
label: "
|
|
8564
|
-
description: "
|
|
8552
|
+
label: "Review",
|
|
8553
|
+
description: "Confirm & create"
|
|
8565
8554
|
}];
|
|
8566
8555
|
|
|
8567
8556
|
/**
|
|
@@ -8617,10 +8606,17 @@ var DashboardWizardModal = function DashboardWizardModal(_ref) {
|
|
|
8617
8606
|
if (!canProceed) return;
|
|
8618
8607
|
nextStep();
|
|
8619
8608
|
}, [canProceed, nextStep]);
|
|
8620
|
-
var
|
|
8609
|
+
var isDiscover = state.step === 0;
|
|
8610
|
+
var isLastStep = state.step === 4;
|
|
8621
8611
|
var isCreating = (_createHandlerRef$cur = (_createHandlerRef$cur2 = createHandlerRef.current) === null || _createHandlerRef$cur2 === void 0 ? void 0 : _createHandlerRef$cur2.creating) !== null && _createHandlerRef$cur !== void 0 ? _createHandlerRef$cur : false;
|
|
8622
8612
|
var isCreated = !!((_createHandlerRef$cur3 = createHandlerRef.current) !== null && _createHandlerRef$cur3 !== void 0 && _createHandlerRef$cur3.createdDashboard);
|
|
8623
|
-
|
|
8613
|
+
// Create only fires when every prior step has been validated. The
|
|
8614
|
+
// Review step (canProceed=true by design) doesn't tell us whether
|
|
8615
|
+
// Name/Folder/Theme were filled, so we re-check the underlying
|
|
8616
|
+
// customization here — belt-and-suspenders for clicks that race
|
|
8617
|
+
// the stepper.
|
|
8618
|
+
var customizationComplete = state.customization.name.trim().length > 0 && state.customization.menuId !== null && !!state.customization.theme;
|
|
8619
|
+
var canCreate = customizationComplete && !isCreating;
|
|
8624
8620
|
return /*#__PURE__*/jsxRuntime.jsx(DashReact.Modal, {
|
|
8625
8621
|
isOpen: open,
|
|
8626
8622
|
setIsOpen: setIsOpen,
|
|
@@ -8652,43 +8648,43 @@ var DashboardWizardModal = function DashboardWizardModal(_ref) {
|
|
|
8652
8648
|
})]
|
|
8653
8649
|
}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
8654
8650
|
className: "flex flex-col flex-1 min-h-0 px-6 py-4",
|
|
8655
|
-
children: [/*#__PURE__*/jsxRuntime.
|
|
8656
|
-
|
|
8657
|
-
|
|
8651
|
+
children: [isDiscover ? /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
8652
|
+
className: "flex-1 min-h-0 overflow-y-auto",
|
|
8653
|
+
children: /*#__PURE__*/jsxRuntime.jsx(WizardDiscoverStep, {
|
|
8654
|
+
state: state,
|
|
8655
|
+
dispatch: dispatch
|
|
8656
|
+
})
|
|
8657
|
+
}) : /*#__PURE__*/jsxRuntime.jsx(DashReact.Stepper, {
|
|
8658
|
+
activeStep: state.step - 1,
|
|
8659
|
+
onStepChange: function onStepChange(s) {
|
|
8660
|
+
return handleStepChange(s + 1);
|
|
8661
|
+
},
|
|
8658
8662
|
showNavigation: false,
|
|
8659
8663
|
className: "flex-1 min-h-0",
|
|
8660
|
-
children:
|
|
8661
|
-
|
|
8662
|
-
|
|
8663
|
-
|
|
8664
|
-
|
|
8665
|
-
|
|
8666
|
-
|
|
8667
|
-
|
|
8668
|
-
|
|
8669
|
-
|
|
8670
|
-
|
|
8671
|
-
|
|
8672
|
-
|
|
8673
|
-
|
|
8674
|
-
|
|
8675
|
-
|
|
8676
|
-
|
|
8677
|
-
|
|
8678
|
-
|
|
8679
|
-
|
|
8680
|
-
|
|
8681
|
-
onInstallDashboard: onInstallDashboard,
|
|
8682
|
-
onOpenDashboard: function onOpenDashboard(ws) {
|
|
8683
|
-
handleClose();
|
|
8684
|
-
if (_onOpenDashboard) _onOpenDashboard(ws);
|
|
8685
|
-
if (onReloadWorkspaces) onReloadWorkspaces();
|
|
8686
|
-
},
|
|
8687
|
-
appId: appId,
|
|
8688
|
-
createHandlerRef: createHandlerRef
|
|
8664
|
+
children: STEP_LABELS.map(function (label) {
|
|
8665
|
+
return /*#__PURE__*/jsxRuntime.jsx(DashReact.Stepper.Step, {
|
|
8666
|
+
label: label.label,
|
|
8667
|
+
description: label.description,
|
|
8668
|
+
children: /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
8669
|
+
className: "flex-1 min-h-0 overflow-y-auto",
|
|
8670
|
+
children: /*#__PURE__*/jsxRuntime.jsx(WizardCustomizeStep, {
|
|
8671
|
+
state: state,
|
|
8672
|
+
dispatch: dispatch,
|
|
8673
|
+
menuItems: menuItems,
|
|
8674
|
+
onSaveMenuItem: onSaveMenuItem,
|
|
8675
|
+
onCreateWorkspace: onCreateWorkspace,
|
|
8676
|
+
onInstallDashboard: onInstallDashboard,
|
|
8677
|
+
onOpenDashboard: function onOpenDashboard(ws) {
|
|
8678
|
+
handleClose();
|
|
8679
|
+
if (_onOpenDashboard) _onOpenDashboard(ws);
|
|
8680
|
+
if (onReloadWorkspaces) onReloadWorkspaces();
|
|
8681
|
+
},
|
|
8682
|
+
appId: appId,
|
|
8683
|
+
createHandlerRef: createHandlerRef
|
|
8684
|
+
})
|
|
8689
8685
|
})
|
|
8690
|
-
})
|
|
8691
|
-
})
|
|
8686
|
+
}, label.label);
|
|
8687
|
+
})
|
|
8692
8688
|
}), !isCreated && /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
8693
8689
|
className: "flex flex-row justify-between items-center pt-4 mt-4 border-t border-gray-700/50",
|
|
8694
8690
|
children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.Button, {
|
|
@@ -8700,9 +8696,9 @@ var DashboardWizardModal = function DashboardWizardModal(_ref) {
|
|
|
8700
8696
|
textColor: "text-gray-300",
|
|
8701
8697
|
hoverTextColor: "hover:text-white",
|
|
8702
8698
|
hoverBackgroundColor: "hover:bg-gray-600"
|
|
8703
|
-
}), /*#__PURE__*/jsxRuntime.
|
|
8699
|
+
}), /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
8704
8700
|
className: "text-xs text-gray-500",
|
|
8705
|
-
children:
|
|
8701
|
+
children: isDiscover ? "Browse" : "Step ".concat(state.step, " of ").concat(STEP_LABELS.length)
|
|
8706
8702
|
}), isLastStep ? /*#__PURE__*/jsxRuntime.jsx(DashReact.Button, {
|
|
8707
8703
|
onClick: function onClick() {
|
|
8708
8704
|
var _createHandlerRef$cur4, _createHandlerRef$cur5;
|