@trops/dash-core 0.1.94 → 0.1.97

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  import _defineProperty from '@babel/runtime/helpers/defineProperty';
2
2
  import * as DashReact from '@trops/dash-react';
3
- import { isObject, ThemeContext, deepCopy, MainSection, getUUID, getStylesForItem, themeObjects, Heading, SubHeading3, InputText, Button, FontAwesomeIcon, Tag, SearchInput, ButtonIcon, Modal, Panel, Stepper, Paragraph, Heading3, MenuItem3, FormLabel, SelectMenu, CodeEditorInline, Sidebar, SettingsModal, SubHeading2, tailwindHeightFractions, Menu3, Panel3, DropdownPanel, MenuItem2, ButtonIcon2, DragComponent, ConfirmationModal, DropComponent, getStyleName, capitalizeFirstLetter, colorTypes, getCSSStyleForClassname, Panel2, Heading2, SubHeading, Paragraph2, Paragraph3, Button2, Button3, MenuItem, Tag2, Tag3, ButtonIcon3, DashPanel, colorNames, shades, themeVariants, Tabs3, DataList, Checkbox, Switch, StatCard, Card, Tabs, Accordion, Alert, Toast, ProgressBar, Toggle, Breadcrumbs, Card2, Tabs2, Accordion2, Alert2, Toast2, ProgressBar2, Toggle2, Breadcrumbs2, Card3, Accordion3, Alert3, Toast3, ProgressBar3, Toggle3, Breadcrumbs3, SelectInput, Icon2, AlgoliaSearchBox, CommandPalette, EmptyState, Navbar, withRouter, Menu as Menu$1 } from '@trops/dash-react';
3
+ import { isObject, ThemeContext, deepCopy, MainSection, getUUID, getStylesForItem, themeObjects, Heading, SearchInput, ButtonIcon, SubHeading3, InputText, Button, FontAwesomeIcon, Tag, Modal, Panel, Stepper, Paragraph, Heading3, MenuItem3, FormLabel, SelectMenu, CodeEditorInline, Sidebar, SettingsModal, SubHeading2, tailwindHeightFractions, Menu3, Panel3, DropdownPanel, MenuItem2, ButtonIcon2, DragComponent, ConfirmationModal, DropComponent, getStyleName, capitalizeFirstLetter, colorTypes, getCSSStyleForClassname, Panel2, Heading2, SubHeading, Paragraph2, Paragraph3, Button2, Button3, MenuItem, Tag2, Tag3, ButtonIcon3, DashPanel, colorNames, shades, themeVariants, Tabs3, DataList, Checkbox, Switch, StatCard, Card, Tabs, Accordion, Alert, Toast, ProgressBar, Toggle, Breadcrumbs, Card2, Tabs2, Accordion2, Alert2, Toast2, ProgressBar2, Toggle2, Breadcrumbs2, Card3, Accordion3, Alert3, Toast3, ProgressBar3, Toggle3, Breadcrumbs3, TextArea, SelectInput, Icon2, AlgoliaSearchBox, CommandPalette, EmptyState, Navbar, withRouter, Menu as Menu$1 } from '@trops/dash-react';
4
4
  export * from '@trops/dash-react';
5
5
  export { ThemeContext } from '@trops/dash-react';
6
6
  import _typeof from '@babel/runtime/helpers/typeof';
@@ -3163,26 +3163,27 @@ var IconPicker = function IconPicker(_ref) {
3163
3163
  })]
3164
3164
  });
3165
3165
  };
3166
- var FolderDetail = function FolderDetail(_ref2) {
3167
- var _ref2$menuItem = _ref2.menuItem,
3168
- menuItem = _ref2$menuItem === void 0 ? null : _ref2$menuItem,
3169
- _ref2$workspaces = _ref2.workspaces,
3170
- workspaces = _ref2$workspaces === void 0 ? [] : _ref2$workspaces,
3171
- _ref2$isEditing = _ref2.isEditing,
3172
- isEditing = _ref2$isEditing === void 0 ? false : _ref2$isEditing,
3173
- _ref2$isCreating = _ref2.isCreating,
3174
- isCreating = _ref2$isCreating === void 0 ? false : _ref2$isCreating,
3175
- _ref2$formName = _ref2.formName,
3176
- formName = _ref2$formName === void 0 ? "" : _ref2$formName,
3177
- setFormName = _ref2.setFormName,
3178
- _ref2$formIcon = _ref2.formIcon,
3179
- formIcon = _ref2$formIcon === void 0 ? "folder" : _ref2$formIcon,
3180
- setFormIcon = _ref2.setFormIcon,
3181
- onSaveEdit = _ref2.onSaveEdit,
3182
- onCancelEdit = _ref2.onCancelEdit,
3183
- onStartEdit = _ref2.onStartEdit,
3184
- onCreate = _ref2.onCreate,
3185
- onDelete = _ref2.onDelete;
3166
+
3167
+ var FolderDetail = function FolderDetail(_ref) {
3168
+ var _ref$menuItem = _ref.menuItem,
3169
+ menuItem = _ref$menuItem === void 0 ? null : _ref$menuItem,
3170
+ _ref$workspaces = _ref.workspaces,
3171
+ workspaces = _ref$workspaces === void 0 ? [] : _ref$workspaces,
3172
+ _ref$isEditing = _ref.isEditing,
3173
+ isEditing = _ref$isEditing === void 0 ? false : _ref$isEditing,
3174
+ _ref$isCreating = _ref.isCreating,
3175
+ isCreating = _ref$isCreating === void 0 ? false : _ref$isCreating,
3176
+ _ref$formName = _ref.formName,
3177
+ formName = _ref$formName === void 0 ? "" : _ref$formName,
3178
+ setFormName = _ref.setFormName,
3179
+ _ref$formIcon = _ref.formIcon,
3180
+ formIcon = _ref$formIcon === void 0 ? "folder" : _ref$formIcon,
3181
+ setFormIcon = _ref.setFormIcon,
3182
+ onSaveEdit = _ref.onSaveEdit,
3183
+ onCancelEdit = _ref.onCancelEdit,
3184
+ onStartEdit = _ref.onStartEdit,
3185
+ onCreate = _ref.onCreate,
3186
+ onDelete = _ref.onDelete;
3186
3187
  var isFormMode = isEditing || isCreating;
3187
3188
 
3188
3189
  // Get dashboards in this folder
@@ -26461,7 +26462,21 @@ var StarRating = function StarRating(_ref) {
26461
26462
  });
26462
26463
  };
26463
26464
 
26465
+ var DASHBOARD_TAGS = ["productivity", "monitoring", "analytics", "communication", "developer", "sales", "marketing", "finance", "project-management", "social", "news", "utilities"];
26466
+
26467
+ /**
26468
+ * PublishDashboardModal — multi-step stepper for preparing a dashboard
26469
+ * for registry publishing.
26470
+ *
26471
+ * Steps:
26472
+ * 0. Account — Auth check, sign-in prompt, profile display
26473
+ * 1. Details — Author name (pre-filled from profile) + description (textarea)
26474
+ * 2. Tags — Predefined tag selection with toggle-pill styling
26475
+ * 3. Icon — Full icon picker with search
26476
+ * 4. Publish — Review summary, publish action, result display
26477
+ */
26464
26478
  var PublishDashboardModal = function PublishDashboardModal(_ref) {
26479
+ var _result$registrySubmi, _result$registrySubmi2;
26465
26480
  var isOpen = _ref.isOpen,
26466
26481
  setIsOpen = _ref.setIsOpen,
26467
26482
  appId = _ref.appId,
@@ -26472,146 +26487,657 @@ var PublishDashboardModal = function PublishDashboardModal(_ref) {
26472
26487
  var panelStyles = getStylesForItem(themeObjects.PANEL, currentTheme, {
26473
26488
  grow: false
26474
26489
  });
26475
- var _useState = useState(""),
26490
+ // Stepper state
26491
+ var _useState = useState(0),
26476
26492
  _useState2 = _slicedToArray(_useState, 2),
26477
- description = _useState2[0],
26478
- setDescription = _useState2[1];
26479
- var _useState3 = useState(""),
26493
+ step = _useState2[0],
26494
+ setStep = _useState2[1];
26495
+
26496
+ // Step 0: Account / Auth
26497
+ var _useState3 = useState("loading"),
26480
26498
  _useState4 = _slicedToArray(_useState3, 2),
26481
- tags = _useState4[0],
26482
- setTags = _useState4[1];
26483
- var _useState5 = useState(""),
26499
+ authStatus = _useState4[0],
26500
+ setAuthStatus = _useState4[1]; // "loading" | "authenticated" | "unauthenticated"
26501
+ var _useState5 = useState(null),
26484
26502
  _useState6 = _slicedToArray(_useState5, 2),
26485
- icon = _useState6[0],
26486
- setIcon = _useState6[1];
26487
- var _useState7 = useState(false),
26503
+ profile = _useState6[0],
26504
+ setProfile = _useState6[1];
26505
+ var _useState7 = useState(null),
26488
26506
  _useState8 = _slicedToArray(_useState7, 2),
26489
- isPublishing = _useState8[0],
26490
- setIsPublishing = _useState8[1];
26491
- var _useState9 = useState(null),
26507
+ authFlow = _useState8[0],
26508
+ setAuthFlow = _useState8[1];
26509
+ var _useState9 = useState(false),
26492
26510
  _useState0 = _slicedToArray(_useState9, 2),
26493
- result = _useState0[0],
26494
- setResult = _useState0[1];
26511
+ isPolling = _useState0[0],
26512
+ setIsPolling = _useState0[1];
26513
+
26514
+ // Step 1: Details
26515
+ var _useState1 = useState(""),
26516
+ _useState10 = _slicedToArray(_useState1, 2),
26517
+ authorName = _useState10[0],
26518
+ setAuthorName = _useState10[1];
26519
+ var _useState11 = useState(""),
26520
+ _useState12 = _slicedToArray(_useState11, 2),
26521
+ description = _useState12[0],
26522
+ setDescription = _useState12[1];
26523
+
26524
+ // Step 2: Tags
26525
+ var _useState13 = useState([]),
26526
+ _useState14 = _slicedToArray(_useState13, 2),
26527
+ selectedTags = _useState14[0],
26528
+ setSelectedTags = _useState14[1];
26529
+
26530
+ // Step 3: Icon
26531
+ var _useState15 = useState("grip"),
26532
+ _useState16 = _slicedToArray(_useState15, 2),
26533
+ icon = _useState16[0],
26534
+ setIcon = _useState16[1];
26535
+
26536
+ // Step 4: Publish
26537
+ var _useState17 = useState(false),
26538
+ _useState18 = _slicedToArray(_useState17, 2),
26539
+ isPublishing = _useState18[0],
26540
+ setIsPublishing = _useState18[1];
26541
+ var _useState19 = useState(null),
26542
+ _useState20 = _slicedToArray(_useState19, 2),
26543
+ result = _useState20[0],
26544
+ setResult = _useState20[1];
26545
+
26546
+ // Check auth status on mount
26547
+ useEffect(function () {
26548
+ if (!isOpen) return;
26549
+ var cancelled = false;
26550
+ function checkAuth() {
26551
+ return _checkAuth.apply(this, arguments);
26552
+ }
26553
+ function _checkAuth() {
26554
+ _checkAuth = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
26555
+ var status, userProfile;
26556
+ return _regeneratorRuntime.wrap(function (_context) {
26557
+ while (1) switch (_context.prev = _context.next) {
26558
+ case 0:
26559
+ _context.prev = 0;
26560
+ _context.next = 1;
26561
+ return window.mainApi.registryAuth.getStatus();
26562
+ case 1:
26563
+ status = _context.sent;
26564
+ if (!cancelled) {
26565
+ _context.next = 2;
26566
+ break;
26567
+ }
26568
+ return _context.abrupt("return");
26569
+ case 2:
26570
+ if (!status.authenticated) {
26571
+ _context.next = 5;
26572
+ break;
26573
+ }
26574
+ _context.next = 3;
26575
+ return window.mainApi.registryAuth.getProfile();
26576
+ case 3:
26577
+ userProfile = _context.sent;
26578
+ if (!cancelled) {
26579
+ _context.next = 4;
26580
+ break;
26581
+ }
26582
+ return _context.abrupt("return");
26583
+ case 4:
26584
+ setProfile(userProfile);
26585
+ setAuthStatus("authenticated");
26586
+ if (userProfile !== null && userProfile !== void 0 && userProfile.displayName && !authorName) {
26587
+ setAuthorName(userProfile.displayName);
26588
+ }
26589
+ _context.next = 6;
26590
+ break;
26591
+ case 5:
26592
+ setAuthStatus("unauthenticated");
26593
+ case 6:
26594
+ _context.next = 8;
26595
+ break;
26596
+ case 7:
26597
+ _context.prev = 7;
26598
+ _context["catch"](0);
26599
+ if (!cancelled) setAuthStatus("unauthenticated");
26600
+ case 8:
26601
+ case "end":
26602
+ return _context.stop();
26603
+ }
26604
+ }, _callee, null, [[0, 7]]);
26605
+ }));
26606
+ return _checkAuth.apply(this, arguments);
26607
+ }
26608
+ checkAuth();
26609
+ return function () {
26610
+ cancelled = true;
26611
+ };
26612
+ }, [isOpen]);
26613
+ function resetState() {
26614
+ setStep(0);
26615
+ setAuthStatus("loading");
26616
+ setProfile(null);
26617
+ setAuthFlow(null);
26618
+ setIsPolling(false);
26619
+ setAuthorName("");
26620
+ setDescription("");
26621
+ setSelectedTags([]);
26622
+ setIcon("grip");
26623
+ setIsPublishing(false);
26624
+ setResult(null);
26625
+ }
26495
26626
  function handleClose() {
26496
26627
  setIsOpen(false);
26497
- // Reset state after a brief delay to avoid flash
26498
- setTimeout(function () {
26499
- setDescription("");
26500
- setTags("");
26501
- setIcon("");
26502
- setIsPublishing(false);
26503
- setResult(null);
26504
- }, 200);
26628
+ setTimeout(resetState, 200);
26629
+ }
26630
+ function handleStepChange(nextStep) {
26631
+ if (step === 0 && nextStep > 0 && authStatus !== "authenticated") return;
26632
+ if (step === 1 && nextStep > 1 && !authorName.trim()) return;
26633
+ if (step === 2 && nextStep > 2 && selectedTags.length === 0) return;
26634
+ setStep(nextStep);
26635
+ }
26636
+ function toggleTag(tag) {
26637
+ setSelectedTags(function (prev) {
26638
+ return prev.includes(tag) ? prev.filter(function (t) {
26639
+ return t !== tag;
26640
+ }) : [].concat(_toConsumableArray(prev), [tag]);
26641
+ });
26505
26642
  }
26506
26643
  function handlePublish() {
26507
26644
  return _handlePublish.apply(this, arguments);
26508
26645
  }
26509
26646
  function _handlePublish() {
26510
- _handlePublish = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
26511
- var options, res, _t;
26512
- return _regeneratorRuntime.wrap(function (_context) {
26513
- while (1) switch (_context.prev = _context.next) {
26647
+ _handlePublish = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
26648
+ var options, res, _t2;
26649
+ return _regeneratorRuntime.wrap(function (_context2) {
26650
+ while (1) switch (_context2.prev = _context2.next) {
26514
26651
  case 0:
26515
26652
  if (!(!appId || !workspaceId)) {
26516
- _context.next = 1;
26653
+ _context2.next = 1;
26517
26654
  break;
26518
26655
  }
26519
- return _context.abrupt("return");
26656
+ return _context2.abrupt("return");
26520
26657
  case 1:
26521
26658
  setIsPublishing(true);
26522
26659
  setResult(null);
26523
- _context.prev = 2;
26660
+ _context2.prev = 2;
26524
26661
  options = {
26662
+ authorName: authorName.trim(),
26525
26663
  description: description.trim() || undefined,
26526
- tags: tags.split(",").map(function (t) {
26527
- return t.trim();
26528
- }).filter(Boolean),
26529
- icon: icon.trim() || undefined
26664
+ tags: selectedTags,
26665
+ icon: icon || undefined
26530
26666
  };
26531
- _context.next = 3;
26667
+ _context2.next = 3;
26532
26668
  return window.mainApi.dashboardConfig.prepareDashboardForPublish(appId, workspaceId, options);
26533
26669
  case 3:
26534
- res = _context.sent;
26670
+ res = _context2.sent;
26535
26671
  setResult(res);
26536
- _context.next = 5;
26672
+ _context2.next = 5;
26537
26673
  break;
26538
26674
  case 4:
26539
- _context.prev = 4;
26540
- _t = _context["catch"](2);
26675
+ _context2.prev = 4;
26676
+ _t2 = _context2["catch"](2);
26541
26677
  setResult({
26542
26678
  success: false,
26543
- error: _t.message || "Failed to prepare dashboard for publish."
26679
+ error: _t2.message || "Failed to prepare dashboard for publish."
26544
26680
  });
26545
26681
  case 5:
26546
- _context.prev = 5;
26682
+ _context2.prev = 5;
26547
26683
  setIsPublishing(false);
26548
- return _context.finish(5);
26684
+ return _context2.finish(5);
26549
26685
  case 6:
26550
26686
  case "end":
26551
- return _context.stop();
26687
+ return _context2.stop();
26552
26688
  }
26553
- }, _callee, null, [[2, 4, 5, 6]]);
26689
+ }, _callee2, null, [[2, 4, 5, 6]]);
26554
26690
  }));
26555
26691
  return _handlePublish.apply(this, arguments);
26556
26692
  }
26557
- return /*#__PURE__*/jsx(ConfirmationModal, {
26693
+ function handleSignIn() {
26694
+ return _handleSignIn.apply(this, arguments);
26695
+ }
26696
+ function _handleSignIn() {
26697
+ _handleSignIn = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee4() {
26698
+ var flow, interval, poll;
26699
+ return _regeneratorRuntime.wrap(function (_context4) {
26700
+ while (1) switch (_context4.prev = _context4.next) {
26701
+ case 0:
26702
+ _context4.prev = 0;
26703
+ _context4.next = 1;
26704
+ return window.mainApi.registryAuth.initiateLogin();
26705
+ case 1:
26706
+ flow = _context4.sent;
26707
+ setAuthFlow(flow);
26708
+
26709
+ // Open verification URL in browser
26710
+ if (flow.verificationUrlComplete) {
26711
+ window.mainApi.shell.openExternal(flow.verificationUrlComplete);
26712
+ }
26713
+
26714
+ // Start polling
26715
+ setIsPolling(true);
26716
+ interval = (flow.interval || 5) * 1000;
26717
+ poll = setInterval(/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee3() {
26718
+ var pollResult, userProfile;
26719
+ return _regeneratorRuntime.wrap(function (_context3) {
26720
+ while (1) switch (_context3.prev = _context3.next) {
26721
+ case 0:
26722
+ _context3.prev = 0;
26723
+ _context3.next = 1;
26724
+ return window.mainApi.registryAuth.pollToken(flow.deviceCode);
26725
+ case 1:
26726
+ pollResult = _context3.sent;
26727
+ if (!(pollResult.status === "authorized")) {
26728
+ _context3.next = 3;
26729
+ break;
26730
+ }
26731
+ clearInterval(poll);
26732
+ setIsPolling(false);
26733
+ setAuthFlow(null);
26734
+ // Fetch profile and update auth state
26735
+ _context3.next = 2;
26736
+ return window.mainApi.registryAuth.getProfile();
26737
+ case 2:
26738
+ userProfile = _context3.sent;
26739
+ setProfile(userProfile);
26740
+ setAuthStatus("authenticated");
26741
+ if (userProfile !== null && userProfile !== void 0 && userProfile.displayName && !authorName) {
26742
+ setAuthorName(userProfile.displayName);
26743
+ }
26744
+ _context3.next = 4;
26745
+ break;
26746
+ case 3:
26747
+ if (pollResult.status === "expired") {
26748
+ clearInterval(poll);
26749
+ setIsPolling(false);
26750
+ setAuthFlow(null);
26751
+ }
26752
+ case 4:
26753
+ _context3.next = 6;
26754
+ break;
26755
+ case 5:
26756
+ _context3.prev = 5;
26757
+ _context3["catch"](0);
26758
+ clearInterval(poll);
26759
+ setIsPolling(false);
26760
+ case 6:
26761
+ case "end":
26762
+ return _context3.stop();
26763
+ }
26764
+ }, _callee3, null, [[0, 5]]);
26765
+ })), interval);
26766
+ _context4.next = 3;
26767
+ break;
26768
+ case 2:
26769
+ _context4.prev = 2;
26770
+ _context4["catch"](0);
26771
+ case 3:
26772
+ case "end":
26773
+ return _context4.stop();
26774
+ }
26775
+ }, _callee4, null, [[0, 2]]);
26776
+ }));
26777
+ return _handleSignIn.apply(this, arguments);
26778
+ }
26779
+ function handleSignOut() {
26780
+ return _handleSignOut.apply(this, arguments);
26781
+ }
26782
+ function _handleSignOut() {
26783
+ _handleSignOut = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee5() {
26784
+ return _regeneratorRuntime.wrap(function (_context5) {
26785
+ while (1) switch (_context5.prev = _context5.next) {
26786
+ case 0:
26787
+ _context5.prev = 0;
26788
+ _context5.next = 1;
26789
+ return window.mainApi.registryAuth.logout();
26790
+ case 1:
26791
+ setAuthStatus("unauthenticated");
26792
+ setProfile(null);
26793
+ _context5.next = 3;
26794
+ break;
26795
+ case 2:
26796
+ _context5.prev = 2;
26797
+ _context5["catch"](0);
26798
+ case 3:
26799
+ case "end":
26800
+ return _context5.stop();
26801
+ }
26802
+ }, _callee5, null, [[0, 2]]);
26803
+ }));
26804
+ return _handleSignOut.apply(this, arguments);
26805
+ }
26806
+ var isLastStep = step === 4;
26807
+ var canAdvance = step === 0 ? authStatus === "authenticated" : step === 1 ? !!authorName.trim() : step === 2 ? selectedTags.length > 0 : true;
26808
+ return /*#__PURE__*/jsx(Modal, {
26558
26809
  isOpen: isOpen,
26559
26810
  setIsOpen: handleClose,
26560
- title: "Publish \"".concat(workspaceName || "Dashboard", "\""),
26561
- confirmLabel: isPublishing ? "Preparing..." : "Prepare for Publish",
26562
- onConfirm: result ? handleClose : handlePublish,
26563
- onCancel: handleClose,
26564
- disabled: isPublishing,
26565
- children: /*#__PURE__*/jsx("div", {
26566
- className: "space-y-4 ".concat(panelStyles.textColor || "text-gray-200"),
26567
- children: !result ? /*#__PURE__*/jsxs(Fragment, {
26568
- children: [/*#__PURE__*/jsx("p", {
26569
- className: "text-sm opacity-70",
26570
- children: "This will create a publish-ready ZIP file that can be submitted to the dashboard registry."
26571
- }), /*#__PURE__*/jsxs("div", {
26572
- className: "space-y-3",
26573
- children: [/*#__PURE__*/jsx(InputText, {
26574
- label: "Description",
26575
- value: description,
26576
- onChange: setDescription,
26577
- placeholder: "A brief description of this dashboard..."
26578
- }), /*#__PURE__*/jsx(InputText, {
26579
- label: "Tags (comma-separated)",
26580
- value: tags,
26581
- onChange: setTags,
26582
- placeholder: "productivity, slack, monitoring"
26583
- }), /*#__PURE__*/jsx(InputText, {
26584
- label: "Icon (FontAwesome name)",
26585
- value: icon,
26586
- onChange: setIcon,
26587
- placeholder: "chart-line"
26588
- })]
26811
+ width: "w-full max-w-2xl",
26812
+ height: "h-[70vh]",
26813
+ children: /*#__PURE__*/jsxs("div", {
26814
+ className: "flex flex-col h-full rounded-lg overflow-clip border ".concat(panelStyles.backgroundColor || "", " ").concat(panelStyles.borderColor || "", " ").concat(panelStyles.textColor || ""),
26815
+ children: [/*#__PURE__*/jsxs("div", {
26816
+ className: "flex-shrink-0 flex flex-row items-center justify-between p-4 border-b border-white/10",
26817
+ children: [/*#__PURE__*/jsxs("span", {
26818
+ className: "text-lg font-semibold",
26819
+ children: ["Publish \"", workspaceName || "Dashboard", "\""]
26820
+ }), /*#__PURE__*/jsx("button", {
26821
+ type: "button",
26822
+ onClick: handleClose,
26823
+ className: "opacity-50 hover:opacity-100 transition-opacity cursor-pointer",
26824
+ children: /*#__PURE__*/jsx(FontAwesomeIcon, {
26825
+ icon: "xmark",
26826
+ className: "h-5 w-5"
26827
+ })
26589
26828
  })]
26590
- }) : result.success ? /*#__PURE__*/jsxs("div", {
26591
- className: "space-y-3",
26592
- children: [/*#__PURE__*/jsxs("div", {
26593
- className: "flex items-center gap-2",
26594
- children: [/*#__PURE__*/jsx(FontAwesomeIcon, {
26595
- icon: "circle-check",
26596
- className: "h-4 w-4 text-green-400"
26597
- }), /*#__PURE__*/jsx("span", {
26598
- className: "text-sm",
26599
- children: "Dashboard prepared for publishing."
26600
- })]
26601
- }), result.filePath && /*#__PURE__*/jsxs("div", {
26602
- className: "text-xs opacity-50 break-all",
26603
- children: ["Saved to: ", result.filePath]
26829
+ }), /*#__PURE__*/jsxs(Stepper, {
26830
+ activeStep: step,
26831
+ onStepChange: handleStepChange,
26832
+ showNavigation: false,
26833
+ className: "flex-1 min-h-0 flex flex-col px-6 pt-2",
26834
+ children: [/*#__PURE__*/jsx(Stepper.Step, {
26835
+ label: "Account",
26836
+ children: /*#__PURE__*/jsxs("div", {
26837
+ className: "flex-1 min-h-0 overflow-y-auto pb-4 space-y-5",
26838
+ children: [authStatus === "loading" && /*#__PURE__*/jsx("div", {
26839
+ className: "flex items-center justify-center py-12",
26840
+ children: /*#__PURE__*/jsxs("div", {
26841
+ className: "flex items-center gap-3 text-sm opacity-60",
26842
+ children: [/*#__PURE__*/jsx(FontAwesomeIcon, {
26843
+ icon: "spinner",
26844
+ className: "h-4 w-4 animate-spin"
26845
+ }), /*#__PURE__*/jsx("span", {
26846
+ children: "Checking account status..."
26847
+ })]
26848
+ })
26849
+ }), authStatus === "authenticated" && profile && /*#__PURE__*/jsxs("div", {
26850
+ className: "space-y-4",
26851
+ children: [/*#__PURE__*/jsx("p", {
26852
+ className: "text-sm opacity-70",
26853
+ children: "You're signed in and ready to publish."
26854
+ }), /*#__PURE__*/jsxs("div", {
26855
+ className: "bg-white/5 border border-white/10 rounded-lg p-4 flex items-center gap-4",
26856
+ children: [/*#__PURE__*/jsx("div", {
26857
+ className: "flex items-center justify-center h-10 w-10 rounded-full bg-green-500/20 border border-green-500/30",
26858
+ children: /*#__PURE__*/jsx(FontAwesomeIcon, {
26859
+ icon: "circle-check",
26860
+ className: "h-5 w-5 text-green-400"
26861
+ })
26862
+ }), /*#__PURE__*/jsxs("div", {
26863
+ className: "flex-1 min-w-0",
26864
+ children: [/*#__PURE__*/jsx("div", {
26865
+ className: "text-sm font-medium truncate",
26866
+ children: profile.displayName || profile.username
26867
+ }), /*#__PURE__*/jsxs("div", {
26868
+ className: "text-xs opacity-50 truncate",
26869
+ children: ["@", profile.username]
26870
+ })]
26871
+ })]
26872
+ }), /*#__PURE__*/jsx("button", {
26873
+ type: "button",
26874
+ onClick: handleSignOut,
26875
+ className: "text-xs opacity-40 hover:opacity-70 transition-opacity cursor-pointer",
26876
+ children: "Sign out"
26877
+ })]
26878
+ }), authStatus === "unauthenticated" && /*#__PURE__*/jsxs("div", {
26879
+ className: "space-y-4",
26880
+ children: [/*#__PURE__*/jsx("p", {
26881
+ className: "text-sm opacity-70",
26882
+ children: "Sign in to the Dash Registry to publish your dashboard."
26883
+ }), !authFlow && !isPolling && /*#__PURE__*/jsx("button", {
26884
+ type: "button",
26885
+ onClick: handleSignIn,
26886
+ className: "px-4 py-2 rounded-lg text-sm bg-blue-500/20 border border-blue-500/30 text-blue-300 hover:bg-blue-500/30 transition-colors cursor-pointer",
26887
+ children: "Sign in to Registry"
26888
+ }), authFlow && isPolling && /*#__PURE__*/jsxs("div", {
26889
+ className: "bg-blue-500/10 border border-blue-500/20 rounded-lg p-4 space-y-3",
26890
+ children: [/*#__PURE__*/jsx("p", {
26891
+ className: "text-xs text-blue-300/90",
26892
+ children: "Enter this code in your browser:"
26893
+ }), /*#__PURE__*/jsx("div", {
26894
+ className: "text-center",
26895
+ children: /*#__PURE__*/jsx("span", {
26896
+ className: "text-2xl font-mono font-bold tracking-widest text-white",
26897
+ children: authFlow.userCode
26898
+ })
26899
+ }), /*#__PURE__*/jsx("p", {
26900
+ className: "text-xs text-blue-300/70 text-center",
26901
+ children: "Waiting for authorization..."
26902
+ })]
26903
+ })]
26904
+ })]
26905
+ })
26906
+ }), /*#__PURE__*/jsx(Stepper.Step, {
26907
+ label: "Details",
26908
+ children: /*#__PURE__*/jsxs("div", {
26909
+ className: "flex-1 min-h-0 overflow-y-auto pb-4 space-y-5",
26910
+ children: [/*#__PURE__*/jsx("p", {
26911
+ className: "text-sm opacity-70",
26912
+ children: "Provide details about your dashboard for the registry listing."
26913
+ }), /*#__PURE__*/jsx(InputText, {
26914
+ label: "Author Name *",
26915
+ value: authorName,
26916
+ onChange: setAuthorName,
26917
+ placeholder: "Your name"
26918
+ }), /*#__PURE__*/jsx(TextArea, {
26919
+ label: "Description",
26920
+ value: description,
26921
+ onChange: setDescription,
26922
+ placeholder: "A brief description of this dashboard...",
26923
+ rows: 3
26924
+ })]
26925
+ })
26926
+ }), /*#__PURE__*/jsx(Stepper.Step, {
26927
+ label: "Tags",
26928
+ children: /*#__PURE__*/jsxs("div", {
26929
+ className: "flex-1 min-h-0 overflow-y-auto pb-4 space-y-5",
26930
+ children: [/*#__PURE__*/jsx("p", {
26931
+ className: "text-sm opacity-70",
26932
+ children: "Select at least one tag to categorize your dashboard."
26933
+ }), /*#__PURE__*/jsx("div", {
26934
+ className: "grid grid-cols-3 gap-2",
26935
+ children: DASHBOARD_TAGS.map(function (tag) {
26936
+ var isSelected = selectedTags.includes(tag);
26937
+ return /*#__PURE__*/jsx("button", {
26938
+ type: "button",
26939
+ onClick: function onClick() {
26940
+ return toggleTag(tag);
26941
+ },
26942
+ 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"),
26943
+ children: tag
26944
+ }, tag);
26945
+ })
26946
+ })]
26947
+ })
26948
+ }), /*#__PURE__*/jsx(Stepper.Step, {
26949
+ label: "Icon",
26950
+ children: /*#__PURE__*/jsx("div", {
26951
+ className: "flex-1 min-h-0 flex flex-col pb-4",
26952
+ children: /*#__PURE__*/jsx(IconPicker, {
26953
+ selectedIcon: icon,
26954
+ onSelectIcon: setIcon
26955
+ })
26956
+ })
26957
+ }), /*#__PURE__*/jsx(Stepper.Step, {
26958
+ label: "Publish",
26959
+ children: /*#__PURE__*/jsx("div", {
26960
+ className: "flex-1 min-h-0 overflow-y-auto pb-4 space-y-4",
26961
+ children: !result ? /*#__PURE__*/jsxs(Fragment, {
26962
+ children: [/*#__PURE__*/jsx("p", {
26963
+ className: "text-sm opacity-70",
26964
+ children: "Review your dashboard details before publishing."
26965
+ }), /*#__PURE__*/jsxs("div", {
26966
+ className: "bg-white/5 border border-white/10 rounded-lg p-4 space-y-2 text-sm",
26967
+ children: [/*#__PURE__*/jsxs("div", {
26968
+ className: "flex gap-2",
26969
+ children: [/*#__PURE__*/jsx("span", {
26970
+ className: "opacity-50 w-20 flex-shrink-0",
26971
+ children: "Author"
26972
+ }), /*#__PURE__*/jsx("span", {
26973
+ children: authorName
26974
+ })]
26975
+ }), description.trim() && /*#__PURE__*/jsxs("div", {
26976
+ className: "flex gap-2",
26977
+ children: [/*#__PURE__*/jsx("span", {
26978
+ className: "opacity-50 w-20 flex-shrink-0",
26979
+ children: "Description"
26980
+ }), /*#__PURE__*/jsx("span", {
26981
+ children: description
26982
+ })]
26983
+ }), /*#__PURE__*/jsxs("div", {
26984
+ className: "flex gap-2",
26985
+ children: [/*#__PURE__*/jsx("span", {
26986
+ className: "opacity-50 w-20 flex-shrink-0",
26987
+ children: "Tags"
26988
+ }), /*#__PURE__*/jsx("span", {
26989
+ children: selectedTags.length > 0 ? selectedTags.join(", ") : "None"
26990
+ })]
26991
+ }), /*#__PURE__*/jsxs("div", {
26992
+ className: "flex gap-2 items-center",
26993
+ children: [/*#__PURE__*/jsx("span", {
26994
+ className: "opacity-50 w-20 flex-shrink-0",
26995
+ children: "Icon"
26996
+ }), /*#__PURE__*/jsx(FontAwesomeIcon, {
26997
+ icon: icon || "grip",
26998
+ className: "h-4 w-4"
26999
+ }), /*#__PURE__*/jsx("span", {
27000
+ className: "opacity-70",
27001
+ children: icon || "grip"
27002
+ })]
27003
+ })]
27004
+ })]
27005
+ }) : result.success ? /*#__PURE__*/jsxs("div", {
27006
+ className: "space-y-3",
27007
+ children: [(_result$registrySubmi = result.registrySubmission) !== null && _result$registrySubmi !== void 0 && _result$registrySubmi.success ? /*#__PURE__*/jsxs("div", {
27008
+ className: "space-y-3",
27009
+ children: [/*#__PURE__*/jsxs("div", {
27010
+ className: "flex items-center gap-2",
27011
+ children: [/*#__PURE__*/jsx(FontAwesomeIcon, {
27012
+ icon: "circle-check",
27013
+ className: "h-4 w-4 text-green-400"
27014
+ }), /*#__PURE__*/jsx("span", {
27015
+ className: "text-sm",
27016
+ children: "Published to Dash Registry"
27017
+ })]
27018
+ }), result.registrySubmission.registryUrl && /*#__PURE__*/jsxs("div", {
27019
+ className: "bg-white/5 border border-white/10 rounded-lg p-3",
27020
+ children: [/*#__PURE__*/jsx("div", {
27021
+ className: "text-xs opacity-50 mb-1",
27022
+ children: "Shareable Link"
27023
+ }), /*#__PURE__*/jsx("button", {
27024
+ type: "button",
27025
+ onClick: function onClick() {
27026
+ return window.mainApi.shell.openExternal(result.registrySubmission.registryUrl);
27027
+ },
27028
+ className: "text-sm text-blue-400 hover:underline cursor-pointer break-all text-left",
27029
+ children: result.registrySubmission.registryUrl
27030
+ })]
27031
+ }), result.registrySubmission.version && /*#__PURE__*/jsxs("div", {
27032
+ className: "text-xs opacity-50",
27033
+ children: ["Version: v", result.registrySubmission.version]
27034
+ })]
27035
+ }) : /*#__PURE__*/jsxs("div", {
27036
+ className: "space-y-3",
27037
+ children: [/*#__PURE__*/jsxs("div", {
27038
+ className: "flex items-center gap-2",
27039
+ children: [/*#__PURE__*/jsx(FontAwesomeIcon, {
27040
+ icon: "circle-check",
27041
+ className: "h-4 w-4 text-green-400"
27042
+ }), /*#__PURE__*/jsx("span", {
27043
+ className: "text-sm",
27044
+ children: "Dashboard prepared for publishing."
27045
+ })]
27046
+ }), ((_result$registrySubmi2 = result.registrySubmission) === null || _result$registrySubmi2 === void 0 ? void 0 : _result$registrySubmi2.error) && /*#__PURE__*/jsx("div", {
27047
+ className: "bg-amber-500/10 border border-amber-500/20 rounded-lg p-3",
27048
+ children: /*#__PURE__*/jsxs("div", {
27049
+ className: "flex items-start gap-2",
27050
+ children: [/*#__PURE__*/jsx(FontAwesomeIcon, {
27051
+ icon: "triangle-exclamation",
27052
+ className: "h-3.5 w-3.5 text-amber-400 mt-0.5 flex-shrink-0"
27053
+ }), /*#__PURE__*/jsxs("span", {
27054
+ className: "text-xs text-amber-300/90",
27055
+ children: ["Registry upload failed:", " ", result.registrySubmission.error, ". Your dashboard was saved locally."]
27056
+ })]
27057
+ })
27058
+ })]
27059
+ }), result.filePath && /*#__PURE__*/jsxs("div", {
27060
+ className: "text-xs opacity-50 break-all",
27061
+ children: ["Saved to: ", result.filePath]
27062
+ }), result.warnings && result.warnings.length > 0 && /*#__PURE__*/jsxs("div", {
27063
+ className: "bg-amber-500/10 border border-amber-500/20 rounded-lg p-3 space-y-2",
27064
+ children: [/*#__PURE__*/jsxs("div", {
27065
+ className: "flex items-start gap-2",
27066
+ children: [/*#__PURE__*/jsx(FontAwesomeIcon, {
27067
+ icon: "triangle-exclamation",
27068
+ className: "h-3.5 w-3.5 text-amber-400 mt-0.5 flex-shrink-0"
27069
+ }), /*#__PURE__*/jsx("span", {
27070
+ className: "text-xs text-amber-300/90",
27071
+ 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."
27072
+ })]
27073
+ }), /*#__PURE__*/jsx("ul", {
27074
+ className: "text-xs opacity-60 pl-5 list-disc space-y-0.5",
27075
+ children: result.warnings.map(function (w) {
27076
+ return /*#__PURE__*/jsx("li", {
27077
+ children: w
27078
+ }, w);
27079
+ })
27080
+ })]
27081
+ }), result.registryCheckFailed && /*#__PURE__*/jsx("div", {
27082
+ className: "bg-amber-500/10 border border-amber-500/20 rounded-lg p-3",
27083
+ children: /*#__PURE__*/jsxs("div", {
27084
+ className: "flex items-start gap-2",
27085
+ children: [/*#__PURE__*/jsx(FontAwesomeIcon, {
27086
+ icon: "triangle-exclamation",
27087
+ className: "h-3.5 w-3.5 text-amber-400 mt-0.5 flex-shrink-0"
27088
+ }), /*#__PURE__*/jsx("span", {
27089
+ className: "text-xs text-amber-300/90",
27090
+ children: "Unable to reach the registry to verify widget availability. Your dashboard was still prepared successfully."
27091
+ })]
27092
+ })
27093
+ })]
27094
+ }) : /*#__PURE__*/jsxs("div", {
27095
+ className: "flex items-center gap-2",
27096
+ children: [/*#__PURE__*/jsx(FontAwesomeIcon, {
27097
+ icon: "circle-xmark",
27098
+ className: "h-4 w-4 text-red-400"
27099
+ }), /*#__PURE__*/jsx("span", {
27100
+ className: "text-sm text-red-400",
27101
+ children: result.error || "Publish preparation failed."
27102
+ })]
27103
+ })
27104
+ })
26604
27105
  })]
26605
- }) : /*#__PURE__*/jsxs("div", {
26606
- className: "flex items-center gap-2",
26607
- children: [/*#__PURE__*/jsx(FontAwesomeIcon, {
26608
- icon: "circle-xmark",
26609
- className: "h-4 w-4 text-red-400"
26610
- }), /*#__PURE__*/jsx("span", {
26611
- className: "text-sm text-red-400",
26612
- children: result.error || "Publish preparation failed."
27106
+ }), /*#__PURE__*/jsxs("div", {
27107
+ className: "flex-shrink-0 flex flex-row items-center px-6 py-4 border-t border-white/10",
27108
+ children: [/*#__PURE__*/jsx("div", {
27109
+ className: "flex flex-row gap-2",
27110
+ children: /*#__PURE__*/jsx(Button3, {
27111
+ title: step === 0 ? "Cancel" : "Back",
27112
+ onClick: step === 0 ? handleClose : function () {
27113
+ return setStep(step - 1);
27114
+ },
27115
+ disabled: isPublishing
27116
+ })
27117
+ }), /*#__PURE__*/jsx("div", {
27118
+ className: "flex-1 text-center",
27119
+ children: /*#__PURE__*/jsxs("span", {
27120
+ className: "text-xs opacity-40",
27121
+ children: ["Step ", step + 1, " of 5"]
27122
+ })
27123
+ }), /*#__PURE__*/jsx("div", {
27124
+ className: "flex flex-row gap-2",
27125
+ children: result !== null && result !== void 0 && result.success ? /*#__PURE__*/jsx(Button2, {
27126
+ title: "Done",
27127
+ onClick: handleClose
27128
+ }) : isLastStep ? /*#__PURE__*/jsx(Button2, {
27129
+ title: isPublishing ? "Publishing..." : "Publish",
27130
+ onClick: handlePublish,
27131
+ disabled: isPublishing
27132
+ }) : /*#__PURE__*/jsx(Button2, {
27133
+ title: "Next",
27134
+ onClick: function onClick() {
27135
+ return handleStepChange(step + 1);
27136
+ },
27137
+ disabled: !canAdvance
27138
+ })
26613
27139
  })]
26614
- })
27140
+ })]
26615
27141
  })
26616
27142
  });
26617
27143
  };
@@ -27582,7 +28108,7 @@ var DashboardsSection = function DashboardsSection(_ref) {
27582
28108
  return window.mainApi.dashboardConfig.importDashboardConfig(appId);
27583
28109
  case 3:
27584
28110
  result = _context.sent;
27585
- if (result) {
28111
+ if (!(!result || result.canceled)) {
27586
28112
  _context.next = 4;
27587
28113
  break;
27588
28114
  }
@@ -27633,7 +28159,9 @@ var DashboardsSection = function DashboardsSection(_ref) {
27633
28159
  }),
27634
28160
  active: isSelected,
27635
28161
  onClick: function onClick() {
27636
- return setSelectedId(ws.id);
28162
+ setSelectedId(ws.id);
28163
+ setInstallMode(null);
28164
+ setImportResult(null);
27637
28165
  },
27638
28166
  badge: String(widgetCount),
27639
28167
  className: isSelected ? "bg-white/10 opacity-100" : "",