@trops/dash-core 0.1.235 → 0.1.239

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.js CHANGED
@@ -2773,9 +2773,9 @@ var LayoutContainer = function LayoutContainer(_ref) {
2773
2773
 
2774
2774
  function ownKeys$E(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; }
2775
2775
  function _objectSpread$E(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$E(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$E(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
2776
- function _createForOfIteratorHelper$g(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$g(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
2777
- function _unsupportedIterableToArray$g(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$g(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray$g(r, a) : void 0; } }
2778
- function _arrayLikeToArray$g(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
2776
+ function _createForOfIteratorHelper$h(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$h(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
2777
+ function _unsupportedIterableToArray$h(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$h(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray$h(r, a) : void 0; } }
2778
+ function _arrayLikeToArray$h(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
2779
2779
  /**
2780
2780
  * Layout template definitions for the dashboard template picker.
2781
2781
  *
@@ -3049,7 +3049,7 @@ function createLayoutFromTemplate(template) {
3049
3049
  cols: template.cols,
3050
3050
  gap: "gap-2"
3051
3051
  };
3052
- var _iterator = _createForOfIteratorHelper$g(template.cells),
3052
+ var _iterator = _createForOfIteratorHelper$h(template.cells),
3053
3053
  _step;
3054
3054
  try {
3055
3055
  for (_iterator.s(); !(_step = _iterator.n()).done;) {
@@ -3574,9 +3574,9 @@ var StarRating = function StarRating(_ref) {
3574
3574
  });
3575
3575
  };
3576
3576
 
3577
- function _createForOfIteratorHelper$f(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$f(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
3578
- function _unsupportedIterableToArray$f(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$f(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray$f(r, a) : void 0; } }
3579
- function _arrayLikeToArray$f(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
3577
+ function _createForOfIteratorHelper$g(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$g(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
3578
+ function _unsupportedIterableToArray$g(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$g(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray$g(r, a) : void 0; } }
3579
+ function _arrayLikeToArray$g(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
3580
3580
  function ownKeys$D(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; }
3581
3581
  function _objectSpread$D(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$D(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$D(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
3582
3582
  var RegistryDashboardDetail = function RegistryDashboardDetail(_ref) {
@@ -3828,7 +3828,7 @@ var RegistryDashboardDetail = function RegistryDashboardDetail(_ref) {
3828
3828
  toInstall = 0,
3829
3829
  unavailable = 0,
3830
3830
  hasUnavailableRequired = false;
3831
- var _iterator = _createForOfIteratorHelper$f(widgetDeps),
3831
+ var _iterator = _createForOfIteratorHelper$g(widgetDeps),
3832
3832
  _step;
3833
3833
  try {
3834
3834
  for (_iterator.s(); !(_step = _iterator.n()).done;) {
@@ -5506,9 +5506,9 @@ var LayoutQuickAddMenu = function LayoutQuickAddMenu(_ref) {
5506
5506
  });
5507
5507
  };
5508
5508
 
5509
- function _createForOfIteratorHelper$e(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$e(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
5510
- function _unsupportedIterableToArray$e(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$e(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray$e(r, a) : void 0; } }
5511
- function _arrayLikeToArray$e(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
5509
+ function _createForOfIteratorHelper$f(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$f(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
5510
+ function _unsupportedIterableToArray$f(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$f(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray$f(r, a) : void 0; } }
5511
+ function _arrayLikeToArray$f(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
5512
5512
 
5513
5513
  /**
5514
5514
  * useRegistrySearch — shared hook for browsing and installing registry packages.
@@ -5615,13 +5615,13 @@ var useRegistrySearch = function useRegistrySearch() {
5615
5615
  return c.toLowerCase();
5616
5616
  }));
5617
5617
  widgets = [];
5618
- _iterator = _createForOfIteratorHelper$e(pkgs);
5618
+ _iterator = _createForOfIteratorHelper$f(pkgs);
5619
5619
  try {
5620
5620
  for (_iterator.s(); !(_step = _iterator.n()).done;) {
5621
5621
  pkg = _step.value;
5622
5622
  // Compute missing APIs for the entire package
5623
5623
  allApiProviders = [];
5624
- _iterator2 = _createForOfIteratorHelper$e(pkg.providers || []);
5624
+ _iterator2 = _createForOfIteratorHelper$f(pkg.providers || []);
5625
5625
  try {
5626
5626
  for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
5627
5627
  p = _step2.value;
@@ -5634,11 +5634,11 @@ var useRegistrySearch = function useRegistrySearch() {
5634
5634
  } finally {
5635
5635
  _iterator2.f();
5636
5636
  }
5637
- _iterator3 = _createForOfIteratorHelper$e(pkg.widgets || []);
5637
+ _iterator3 = _createForOfIteratorHelper$f(pkg.widgets || []);
5638
5638
  try {
5639
5639
  for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
5640
5640
  w = _step3.value;
5641
- _iterator5 = _createForOfIteratorHelper$e(w.providers || []);
5641
+ _iterator5 = _createForOfIteratorHelper$f(w.providers || []);
5642
5642
  try {
5643
5643
  for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
5644
5644
  _p = _step5.value;
@@ -5660,7 +5660,7 @@ var useRegistrySearch = function useRegistrySearch() {
5660
5660
  missingApis = _toConsumableArray(new Set(allApiProviders)).filter(function (api) {
5661
5661
  return !capSet.has(api.toLowerCase());
5662
5662
  });
5663
- _iterator4 = _createForOfIteratorHelper$e(pkg.widgets || []);
5663
+ _iterator4 = _createForOfIteratorHelper$f(pkg.widgets || []);
5664
5664
  try {
5665
5665
  for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
5666
5666
  widget = _step4.value;
@@ -5672,6 +5672,7 @@ var useRegistrySearch = function useRegistrySearch() {
5672
5672
  providers: widget.providers || [],
5673
5673
  isRegistry: true,
5674
5674
  packageName: pkg.name,
5675
+ packageScope: pkg.scope || null,
5675
5676
  packageDisplayName: pkg.displayName || pkg.name,
5676
5677
  packageVersion: pkg.version,
5677
5678
  packageAuthor: pkg.author || "",
@@ -5734,7 +5735,7 @@ var useRegistrySearch = function useRegistrySearch() {
5734
5735
  }, [searchQuery, showAllPackages]);
5735
5736
  var installPackage = React.useCallback(/*#__PURE__*/function () {
5736
5737
  var _ref3 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2(widget) {
5737
- var packageName, downloadUrl, packageVersion, resolvedUrl, _t2;
5738
+ var packageName, packageScope, downloadUrl, packageVersion, scopedId, resolvedUrl, _t2;
5738
5739
  return _regeneratorRuntime.wrap(function (_context2) {
5739
5740
  while (1) switch (_context2.prev = _context2.next) {
5740
5741
  case 0:
@@ -5747,10 +5748,11 @@ var useRegistrySearch = function useRegistrySearch() {
5747
5748
  setIsInstalling(true);
5748
5749
  setInstallError(null);
5749
5750
  _context2.prev = 2;
5750
- packageName = widget.packageName, downloadUrl = widget.downloadUrl, packageVersion = widget.packageVersion; // Resolve placeholders in the download URL
5751
+ packageName = widget.packageName, packageScope = widget.packageScope, downloadUrl = widget.downloadUrl, packageVersion = widget.packageVersion; // Build scoped ID (e.g. "@trops/slack") for the install key
5752
+ scopedId = packageScope ? "@".concat(packageScope.replace(/^@/, ""), "/").concat(packageName) : packageName; // Resolve placeholders in the download URL
5751
5753
  resolvedUrl = downloadUrl.replace(/\{version\}/g, packageVersion).replace(/\{name\}/g, packageName);
5752
5754
  _context2.next = 3;
5753
- return window.mainApi.widgets.install(packageName, resolvedUrl);
5755
+ return window.mainApi.widgets.install(scopedId, resolvedUrl);
5754
5756
  case 3:
5755
5757
  _context2.next = 5;
5756
5758
  break;
@@ -6249,6 +6251,9 @@ function applyFilters(items, filters, mode) {
6249
6251
  });
6250
6252
  }
6251
6253
 
6254
+ function _createForOfIteratorHelper$e(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$e(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
6255
+ function _unsupportedIterableToArray$e(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$e(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray$e(r, a) : void 0; } }
6256
+ function _arrayLikeToArray$e(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
6252
6257
  function ownKeys$B(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; }
6253
6258
  function _objectSpread$B(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$B(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$B(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
6254
6259
  var WizardCustomizeStep = function WizardCustomizeStep(_ref) {
@@ -6344,7 +6349,7 @@ var WizardCustomizeStep = function WizardCustomizeStep(_ref) {
6344
6349
 
6345
6350
  // --- Create logic (DASH-191: moved above useEffect so ref captures actual function) ---
6346
6351
  var handleCreate = React.useCallback(/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
6347
- var _state$customization, name, menuId, theme, result, _window$mainApi, installResult, updatedWorkspace, _window$mainApi2, template, layoutObj, widgetOrder, cells, widgetItems, nextId, _loop, i, fullLayout, workspace, _t;
6352
+ var _state$customization, name, menuId, theme, result, _window$mainApi, installResult, updatedWorkspace, _window$mainApi2, _window$mainApi3, template, installedList, installedNames, _iterator, _step, widget, scopedId, resolvedUrl, layoutObj, widgetOrder, cells, widgetItems, nextId, _loop, i, fullLayout, workspace, _t, _t2, _t3;
6348
6353
  return _regeneratorRuntime.wrap(function (_context2) {
6349
6354
  while (1) switch (_context2.prev = _context2.next) {
6350
6355
  case 0:
@@ -6398,7 +6403,7 @@ var WizardCustomizeStep = function WizardCustomizeStep(_ref) {
6398
6403
  workspace: updatedWorkspace
6399
6404
  };
6400
6405
  case 6:
6401
- _context2.next = 15;
6406
+ _context2.next = 25;
6402
6407
  break;
6403
6408
  case 7:
6404
6409
  // Build-your-own path: create layout from template + place widgets
@@ -6411,6 +6416,66 @@ var WizardCustomizeStep = function WizardCustomizeStep(_ref) {
6411
6416
  }
6412
6417
  throw new Error("No layout template selected.");
6413
6418
  case 8:
6419
+ if (!((_window$mainApi2 = window.mainApi) !== null && _window$mainApi2 !== void 0 && _window$mainApi2.widgets)) {
6420
+ _context2.next = 18;
6421
+ break;
6422
+ }
6423
+ _context2.next = 9;
6424
+ return window.mainApi.widgets.list();
6425
+ case 9:
6426
+ _t = _context2.sent;
6427
+ if (_t) {
6428
+ _context2.next = 10;
6429
+ break;
6430
+ }
6431
+ _t = [];
6432
+ case 10:
6433
+ installedList = _t;
6434
+ installedNames = new Set(installedList.map(function (w) {
6435
+ return w.name;
6436
+ }));
6437
+ _iterator = _createForOfIteratorHelper$e(state.selectedWidgets);
6438
+ _context2.prev = 11;
6439
+ _iterator.s();
6440
+ case 12:
6441
+ if ((_step = _iterator.n()).done) {
6442
+ _context2.next = 15;
6443
+ break;
6444
+ }
6445
+ widget = _step.value;
6446
+ if (widget.isRegistry) {
6447
+ _context2.next = 13;
6448
+ break;
6449
+ }
6450
+ return _context2.abrupt("continue", 14);
6451
+ case 13:
6452
+ scopedId = widget.packageScope ? "@".concat(widget.packageScope.replace(/^@/, ""), "/").concat(widget.packageName) : widget.packageName;
6453
+ if (!(!installedNames.has(scopedId) && !installedNames.has(widget.packageName))) {
6454
+ _context2.next = 14;
6455
+ break;
6456
+ }
6457
+ resolvedUrl = (widget.downloadUrl || "").replace(/\{version\}/g, widget.packageVersion || "").replace(/\{name\}/g, widget.packageName || "");
6458
+ if (!resolvedUrl) {
6459
+ _context2.next = 14;
6460
+ break;
6461
+ }
6462
+ _context2.next = 14;
6463
+ return window.mainApi.widgets.install(scopedId, resolvedUrl);
6464
+ case 14:
6465
+ _context2.next = 12;
6466
+ break;
6467
+ case 15:
6468
+ _context2.next = 17;
6469
+ break;
6470
+ case 16:
6471
+ _context2.prev = 16;
6472
+ _t2 = _context2["catch"](11);
6473
+ _iterator.e(_t2);
6474
+ case 17:
6475
+ _context2.prev = 17;
6476
+ _iterator.f();
6477
+ return _context2.finish(17);
6478
+ case 18:
6414
6479
  layoutObj = createLayoutFromTemplate(template, menuId || 1); // Place widgets into grid cells as proper layout items
6415
6480
  widgetOrder = state.layout.widgetOrder || [];
6416
6481
  cells = template.cells.filter(function (c) {
@@ -6447,31 +6512,31 @@ var WizardCustomizeStep = function WizardCustomizeStep(_ref) {
6447
6512
  }, _loop);
6448
6513
  });
6449
6514
  i = 0;
6450
- case 9:
6515
+ case 19:
6451
6516
  if (!(i < widgetOrder.length && i < cells.length)) {
6452
- _context2.next = 11;
6517
+ _context2.next = 21;
6453
6518
  break;
6454
6519
  }
6455
- return _context2.delegateYield(_loop(i), "t0", 10);
6456
- case 10:
6520
+ return _context2.delegateYield(_loop(i), "t0", 20);
6521
+ case 20:
6457
6522
  i++;
6458
- _context2.next = 9;
6523
+ _context2.next = 19;
6459
6524
  break;
6460
- case 11:
6525
+ case 21:
6461
6526
  fullLayout = [layoutObj].concat(widgetItems);
6462
6527
  if (!onCreateWorkspace) {
6463
- _context2.next = 13;
6528
+ _context2.next = 23;
6464
6529
  break;
6465
6530
  }
6466
- _context2.next = 12;
6531
+ _context2.next = 22;
6467
6532
  return onCreateWorkspace(fullLayout, theme, name.trim());
6468
- case 12:
6533
+ case 22:
6469
6534
  result = _context2.sent;
6470
- _context2.next = 15;
6535
+ _context2.next = 25;
6471
6536
  break;
6472
- case 13:
6473
- if (!((_window$mainApi2 = window.mainApi) !== null && _window$mainApi2 !== void 0 && (_window$mainApi2 = _window$mainApi2.workspace) !== null && _window$mainApi2 !== void 0 && _window$mainApi2.saveWorkspaceForApplication)) {
6474
- _context2.next = 15;
6537
+ case 23:
6538
+ if (!((_window$mainApi3 = window.mainApi) !== null && _window$mainApi3 !== void 0 && (_window$mainApi3 = _window$mainApi3.workspace) !== null && _window$mainApi3 !== void 0 && _window$mainApi3.saveWorkspaceForApplication)) {
6539
+ _context2.next = 25;
6475
6540
  break;
6476
6541
  }
6477
6542
  workspace = {
@@ -6480,32 +6545,32 @@ var WizardCustomizeStep = function WizardCustomizeStep(_ref) {
6480
6545
  themeKey: theme,
6481
6546
  layout: fullLayout
6482
6547
  };
6483
- _context2.next = 14;
6548
+ _context2.next = 24;
6484
6549
  return window.mainApi.workspace.saveWorkspaceForApplication(appId, workspace);
6485
- case 14:
6550
+ case 24:
6486
6551
  result = {
6487
6552
  success: true,
6488
6553
  workspace: workspace
6489
6554
  };
6490
- case 15:
6555
+ case 25:
6491
6556
  if (result) {
6492
6557
  setCreatedDashboard(result.workspace || result);
6493
6558
  }
6494
- _context2.next = 17;
6559
+ _context2.next = 27;
6495
6560
  break;
6496
- case 16:
6497
- _context2.prev = 16;
6498
- _t = _context2["catch"](1);
6499
- setError(_t.message || "Failed to create dashboard.");
6500
- case 17:
6501
- _context2.prev = 17;
6561
+ case 26:
6562
+ _context2.prev = 26;
6563
+ _t3 = _context2["catch"](1);
6564
+ setError(_t3.message || "Failed to create dashboard.");
6565
+ case 27:
6566
+ _context2.prev = 27;
6502
6567
  setCreating(false);
6503
- return _context2.finish(17);
6504
- case 18:
6568
+ return _context2.finish(27);
6569
+ case 28:
6505
6570
  case "end":
6506
6571
  return _context2.stop();
6507
6572
  }
6508
- }, _callee, null, [[1, 16, 17, 18]]);
6573
+ }, _callee, null, [[1, 26, 27, 28], [11, 16, 17, 18]]);
6509
6574
  })), [state, isPrebuilt, onInstallDashboard, onCreateWorkspace, appId]);
6510
6575
 
6511
6576
  // Expose handleCreate and creating state to parent via ref (DASH-183)
@@ -43278,7 +43343,12 @@ var GeneralSection = function GeneralSection() {
43278
43343
 
43279
43344
  var InstalledWidgetDetail = function InstalledWidgetDetail(_ref) {
43280
43345
  var widget = _ref.widget,
43281
- onDelete = _ref.onDelete;
43346
+ onDelete = _ref.onDelete,
43347
+ _ref$updateInfo = _ref.updateInfo,
43348
+ updateInfo = _ref$updateInfo === void 0 ? null : _ref$updateInfo,
43349
+ onUpdate = _ref.onUpdate,
43350
+ _ref$isUpdating = _ref.isUpdating,
43351
+ isUpdating = _ref$isUpdating === void 0 ? false : _ref$isUpdating;
43282
43352
  var _useContext = React.useContext(DashReact.ThemeContext),
43283
43353
  currentTheme = _useContext.currentTheme;
43284
43354
  var panelStyles = DashReact.getStylesForItem(DashReact.themeObjects.PANEL, currentTheme, {
@@ -43311,7 +43381,19 @@ var InstalledWidgetDetail = function InstalledWidgetDetail(_ref) {
43311
43381
  children: [/*#__PURE__*/jsxRuntime.jsx("span", {
43312
43382
  className: "text-xs font-semibold opacity-50",
43313
43383
  children: "VERSION"
43314
- }), /*#__PURE__*/jsxRuntime.jsxs("span", {
43384
+ }), updateInfo ? /*#__PURE__*/jsxRuntime.jsxs("span", {
43385
+ className: "flex items-center gap-2 text-xs",
43386
+ children: [/*#__PURE__*/jsxRuntime.jsxs("span", {
43387
+ className: "px-2 py-0.5 rounded ".concat(currentTheme["bg-primary-medium"], " opacity-50 w-fit"),
43388
+ children: ["v", widget.version]
43389
+ }), /*#__PURE__*/jsxRuntime.jsx("span", {
43390
+ className: "opacity-40",
43391
+ children: "\u2192"
43392
+ }), /*#__PURE__*/jsxRuntime.jsxs("span", {
43393
+ className: "px-2 py-0.5 rounded bg-blue-900/30 text-blue-400 w-fit",
43394
+ children: ["v", updateInfo.latestVersion]
43395
+ })]
43396
+ }) : /*#__PURE__*/jsxRuntime.jsxs("span", {
43315
43397
  className: "text-xs px-2 py-0.5 rounded ".concat(currentTheme["bg-primary-medium"], " opacity-70 w-fit"),
43316
43398
  children: ["v", widget.version]
43317
43399
  })]
@@ -43379,7 +43461,14 @@ var InstalledWidgetDetail = function InstalledWidgetDetail(_ref) {
43379
43461
  })]
43380
43462
  }), widget.source !== "builtin" && /*#__PURE__*/jsxRuntime.jsxs("div", {
43381
43463
  className: "flex-shrink-0 flex flex-row justify-end gap-2 px-6 py-4 border-t ".concat(currentTheme["border-primary-medium"] || "border-white/10"),
43382
- children: [widget.path && /*#__PURE__*/jsxRuntime.jsx(DashReact.Button, {
43464
+ children: [updateInfo && /*#__PURE__*/jsxRuntime.jsx(DashReact.Button, {
43465
+ title: isUpdating ? "Updating..." : "Update to v".concat(updateInfo.latestVersion),
43466
+ onClick: function onClick() {
43467
+ return onUpdate(widget.name);
43468
+ },
43469
+ disabled: isUpdating,
43470
+ size: "sm"
43471
+ }), widget.path && /*#__PURE__*/jsxRuntime.jsx(DashReact.Button, {
43383
43472
  title: "Open in Finder",
43384
43473
  onClick: handleOpenInFinder,
43385
43474
  size: "sm"
@@ -44148,7 +44237,8 @@ var useInstalledWidgets = function useInstalledWidgets() {
44148
44237
  source: "installed",
44149
44238
  providers: (_w$providers = w.providers) !== null && _w$providers !== void 0 && _w$providers.length ? w.providers : (cm === null || cm === void 0 ? void 0 : cm.providers) || [],
44150
44239
  workspace: w.workspace || (cm === null || cm === void 0 ? void 0 : cm.workspace) || null,
44151
- componentNames: w.componentNames || (cmKey ? [cmKey] : [])
44240
+ componentNames: w.componentNames || (cmKey ? [cmKey] : []),
44241
+ packageId: w.packageId || w.name
44152
44242
  };
44153
44243
  });
44154
44244
  case 3:
@@ -44242,6 +44332,115 @@ var useInstalledWidgets = function useInstalledWidgets() {
44242
44332
  };
44243
44333
  };
44244
44334
 
44335
+ /**
44336
+ * useWidgetUpdates — checks the registry for newer versions of installed widgets
44337
+ * and provides a one-click update function.
44338
+ *
44339
+ * @param {Array} installedWidgets - Widgets from useInstalledWidgets()
44340
+ * @param {Function} onUpdated - Callback after a successful update (e.g. refresh)
44341
+ * @returns {{ updates: Map, isChecking: boolean, updateWidget: Function, isUpdating: string|null }}
44342
+ */
44343
+ function useWidgetUpdates() {
44344
+ var installedWidgets = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
44345
+ var onUpdated = arguments.length > 1 ? arguments[1] : undefined;
44346
+ var _useState = React.useState(new Map()),
44347
+ _useState2 = _slicedToArray(_useState, 2),
44348
+ updates = _useState2[0],
44349
+ setUpdates = _useState2[1];
44350
+ var _useState3 = React.useState(false),
44351
+ _useState4 = _slicedToArray(_useState3, 2),
44352
+ isChecking = _useState4[0],
44353
+ setIsChecking = _useState4[1];
44354
+ var _useState5 = React.useState(null),
44355
+ _useState6 = _slicedToArray(_useState5, 2),
44356
+ isUpdating = _useState6[0],
44357
+ setIsUpdating = _useState6[1];
44358
+ var checkedRef = React.useRef(false);
44359
+
44360
+ // Check for updates once when installed widgets are available
44361
+ React.useEffect(function () {
44362
+ var _window$mainApi;
44363
+ if (checkedRef.current) return;
44364
+ var installed = installedWidgets.filter(function (w) {
44365
+ return w.source === "installed" && w.version;
44366
+ });
44367
+ if (installed.length === 0) return;
44368
+ checkedRef.current = true;
44369
+ setIsChecking(true);
44370
+ var payload = installed.map(function (w) {
44371
+ return {
44372
+ name: w.name,
44373
+ version: w.version
44374
+ };
44375
+ });
44376
+ (_window$mainApi = window.mainApi) === null || _window$mainApi === void 0 || (_window$mainApi = _window$mainApi.registry) === null || _window$mainApi === void 0 || _window$mainApi.checkUpdates(payload).then(function (results) {
44377
+ if (Array.isArray(results) && results.length > 0) {
44378
+ var map = new Map();
44379
+ results.forEach(function (r) {
44380
+ return map.set(r.name, r);
44381
+ });
44382
+ setUpdates(map);
44383
+ }
44384
+ })["catch"](function (err) {
44385
+ })["finally"](function () {
44386
+ setIsChecking(false);
44387
+ });
44388
+ }, [installedWidgets]);
44389
+
44390
+ // Update a single widget by downloading the latest version
44391
+ var updateWidget = React.useCallback(/*#__PURE__*/function () {
44392
+ var _ref = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(name) {
44393
+ var info, resolvedUrl;
44394
+ return _regeneratorRuntime.wrap(function (_context) {
44395
+ while (1) switch (_context.prev = _context.next) {
44396
+ case 0:
44397
+ info = updates.get(name);
44398
+ if (!(!info || !info.downloadUrl)) {
44399
+ _context.next = 1;
44400
+ break;
44401
+ }
44402
+ return _context.abrupt("return");
44403
+ case 1:
44404
+ setIsUpdating(name);
44405
+ _context.prev = 2;
44406
+ resolvedUrl = info.downloadUrl.replace(/\{version\}/g, info.latestVersion).replace(/\{name\}/g, name);
44407
+ _context.next = 3;
44408
+ return window.mainApi.widgets.install(name, resolvedUrl);
44409
+ case 3:
44410
+ // Remove from updates map on success
44411
+ setUpdates(function (prev) {
44412
+ var next = new Map(prev);
44413
+ next["delete"](name);
44414
+ return next;
44415
+ });
44416
+ if (onUpdated) onUpdated();
44417
+ _context.next = 5;
44418
+ break;
44419
+ case 4:
44420
+ _context.prev = 4;
44421
+ _context["catch"](2);
44422
+ case 5:
44423
+ _context.prev = 5;
44424
+ setIsUpdating(null);
44425
+ return _context.finish(5);
44426
+ case 6:
44427
+ case "end":
44428
+ return _context.stop();
44429
+ }
44430
+ }, _callee, null, [[2, 4, 5, 6]]);
44431
+ }));
44432
+ return function (_x) {
44433
+ return _ref.apply(this, arguments);
44434
+ };
44435
+ }(), [updates, onUpdated]);
44436
+ return {
44437
+ updates: updates,
44438
+ isChecking: isChecking,
44439
+ updateWidget: updateWidget,
44440
+ isUpdating: isUpdating
44441
+ };
44442
+ }
44443
+
44245
44444
  function ownKeys$4(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; }
44246
44445
  function _objectSpread$4(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$4(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$4(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
44247
44446
  var WidgetsSection = function WidgetsSection(_ref) {
@@ -44263,6 +44462,10 @@ var WidgetsSection = function WidgetsSection(_ref) {
44263
44462
  error = _useInstalledWidgets.error,
44264
44463
  uninstallWidget = _useInstalledWidgets.uninstallWidget,
44265
44464
  refresh = _useInstalledWidgets.refresh;
44465
+ var _useWidgetUpdates = useWidgetUpdates(widgets, refresh),
44466
+ updates = _useWidgetUpdates.updates,
44467
+ updateWidget = _useWidgetUpdates.updateWidget,
44468
+ isUpdating = _useWidgetUpdates.isUpdating;
44266
44469
  var _useState = React.useState(null),
44267
44470
  _useState2 = _slicedToArray(_useState, 2),
44268
44471
  selectedWidgetName = _useState2[0],
@@ -44632,6 +44835,9 @@ var WidgetsSection = function WidgetsSection(_ref) {
44632
44835
  className: "flex items-center gap-2",
44633
44836
  children: [widget.displayName || widget.name, widget.source === "builtin" && /*#__PURE__*/jsxRuntime.jsx(DashReact.Tag3, {
44634
44837
  text: "Built-in"
44838
+ }), updates.has(widget.name) && /*#__PURE__*/jsxRuntime.jsx("span", {
44839
+ className: "text-[10px] text-blue-400 font-medium",
44840
+ children: "Update"
44635
44841
  })]
44636
44842
  })
44637
44843
  }, widget.name);
@@ -44726,9 +44932,9 @@ var WidgetsSection = function WidgetsSection(_ref) {
44726
44932
  })]
44727
44933
  }), /*#__PURE__*/jsxRuntime.jsx(DashReact.Sidebar.Content, {
44728
44934
  children: listBody
44729
- }), !isLoading && !error && widgets.length > 0 && /*#__PURE__*/jsxRuntime.jsx("div", {
44935
+ }), !isLoading && !error && widgets.length > 0 && /*#__PURE__*/jsxRuntime.jsxs("div", {
44730
44936
  className: "px-3 py-2 text-[10px] opacity-40 flex-shrink-0 border-t border-white/10",
44731
- children: function () {
44937
+ children: [function () {
44732
44938
  var builtinCount = widgets.filter(function (w) {
44733
44939
  return w.source === "builtin";
44734
44940
  }).length;
@@ -44739,7 +44945,10 @@ var WidgetsSection = function WidgetsSection(_ref) {
44739
44945
  if (builtinCount > 0) parts.push("".concat(builtinCount, " built-in"));
44740
44946
  if (installedCount > 0) parts.push("".concat(installedCount, " installed"));
44741
44947
  return parts.join(", ");
44742
- }()
44948
+ }(), updates.size > 0 && /*#__PURE__*/jsxRuntime.jsxs("span", {
44949
+ className: "text-blue-400 ml-1",
44950
+ children: [" \xB7 ", updates.size, " update", updates.size !== 1 ? "s" : "", " available"]
44951
+ })]
44743
44952
  })]
44744
44953
  });
44745
44954
 
@@ -44803,7 +45012,10 @@ var WidgetsSection = function WidgetsSection(_ref) {
44803
45012
  widget: selectedWidget,
44804
45013
  onDelete: function onDelete(w) {
44805
45014
  return handleDeleteRequest(w);
44806
- }
45015
+ },
45016
+ updateInfo: updates.get(selectedWidget === null || selectedWidget === void 0 ? void 0 : selectedWidget.name) || null,
45017
+ onUpdate: updateWidget,
45018
+ isUpdating: isUpdating === (selectedWidget === null || selectedWidget === void 0 ? void 0 : selectedWidget.name)
44807
45019
  });
44808
45020
  }
44809
45021
 
@@ -47707,55 +47919,6 @@ var WidgetSidebar = function WidgetSidebar(_ref4) {
47707
47919
  });
47708
47920
  };
47709
47921
 
47710
- var WELCOME_STORAGE_KEY = "dash:welcome-prompted";
47711
- function markPrompted() {
47712
- localStorage.setItem(WELCOME_STORAGE_KEY, "true");
47713
- }
47714
- var WelcomePrompt = function WelcomePrompt(_ref) {
47715
- var isOpen = _ref.isOpen,
47716
- onAccept = _ref.onAccept,
47717
- onDismiss = _ref.onDismiss;
47718
- var handleAccept = function handleAccept() {
47719
- markPrompted();
47720
- if (onAccept) onAccept();
47721
- };
47722
- var handleDismiss = function handleDismiss() {
47723
- markPrompted();
47724
- if (onDismiss) onDismiss();
47725
- };
47726
- return /*#__PURE__*/jsxRuntime.jsxs(DashReact.Modal, {
47727
- isOpen: isOpen,
47728
- setIsOpen: handleDismiss,
47729
- width: "w-[520px]",
47730
- height: "h-auto",
47731
- children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
47732
- className: "px-8 pt-8 pb-4 flex flex-col items-center text-center gap-4",
47733
- children: [/*#__PURE__*/jsxRuntime.jsx("div", {
47734
- className: "text-4xl opacity-60",
47735
- children: /*#__PURE__*/jsxRuntime.jsx(DashReact.FontAwesomeIcon, {
47736
- icon: "table-cells-large"
47737
- })
47738
- }), /*#__PURE__*/jsxRuntime.jsx(DashReact.SubHeading2, {
47739
- children: "Welcome to Dash!"
47740
- }), /*#__PURE__*/jsxRuntime.jsx(DashReact.Paragraph2, {
47741
- className: "max-w-sm",
47742
- children: "Get started with a sample dashboard that showcases widgets for AI chat, notes, GitHub, Slack, Gmail, Calendar, and more \u2014 all in a ready-made 4x3 grid."
47743
- })]
47744
- }), /*#__PURE__*/jsxRuntime.jsx(DashReact.Modal.Footer, {
47745
- children: /*#__PURE__*/jsxRuntime.jsxs("div", {
47746
- className: "flex flex-row gap-3 w-full justify-end",
47747
- children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.Button2, {
47748
- title: "Start Fresh",
47749
- onClick: handleDismiss
47750
- }), /*#__PURE__*/jsxRuntime.jsx(DashReact.Button, {
47751
- title: "Load Sample Dashboard",
47752
- onClick: handleAccept
47753
- })]
47754
- })
47755
- })]
47756
- });
47757
- };
47758
-
47759
47922
  function ownKeys$1(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; }
47760
47923
  function _objectSpread$1(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$1(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$1(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
47761
47924
  var DashboardStage = function DashboardStage(_ref) {
@@ -47770,21 +47933,18 @@ var DashboardStage = function DashboardStage(_ref) {
47770
47933
  _ref$popout = _ref.popout,
47771
47934
  popout = _ref$popout === void 0 ? false : _ref$popout,
47772
47935
  _ref$popoutWorkspaceI = _ref.popoutWorkspaceId,
47773
- popoutWorkspaceId = _ref$popoutWorkspaceI === void 0 ? null : _ref$popoutWorkspaceI,
47774
- _ref$showWelcomePromp = _ref.showWelcomePrompt,
47775
- showWelcomePrompt = _ref$showWelcomePromp === void 0 ? false : _ref$showWelcomePromp,
47776
- _ref$onAcceptWelcome = _ref.onAcceptWelcome,
47777
- onAcceptWelcome = _ref$onAcceptWelcome === void 0 ? null : _ref$onAcceptWelcome,
47778
- _ref$onDismissWelcome = _ref.onDismissWelcome,
47779
- onDismissWelcome = _ref$onDismissWelcome === void 0 ? null : _ref$onDismissWelcome;
47936
+ popoutWorkspaceId = _ref$popoutWorkspaceI === void 0 ? null : _ref$popoutWorkspaceI;
47937
+ _ref.showWelcomePrompt;
47938
+ _ref.onAcceptWelcome;
47939
+ _ref.onDismissWelcome;
47780
47940
  return /*#__PURE__*/jsxRuntime.jsx(React.Profiler, {
47781
47941
  id: "myapp",
47782
47942
  onRender: function onRender() {},
47783
- children: /*#__PURE__*/jsxRuntime.jsxs(DashboardWrapper, {
47943
+ children: /*#__PURE__*/jsxRuntime.jsx(DashboardWrapper, {
47784
47944
  dashApi: dashApi,
47785
47945
  credentials: credentials,
47786
47946
  backgroundColor: backgroundColor,
47787
- children: [/*#__PURE__*/jsxRuntime.jsx(DashboardStageInner, {
47947
+ children: /*#__PURE__*/jsxRuntime.jsx(DashboardStageInner, {
47788
47948
  dashApi: dashApi,
47789
47949
  credentials: credentials,
47790
47950
  workspace: workspace,
@@ -47792,11 +47952,7 @@ var DashboardStage = function DashboardStage(_ref) {
47792
47952
  backgroundColor: backgroundColor,
47793
47953
  popout: popout,
47794
47954
  popoutWorkspaceId: popoutWorkspaceId
47795
- }), /*#__PURE__*/jsxRuntime.jsx(WelcomePrompt, {
47796
- isOpen: showWelcomePrompt,
47797
- onAccept: onAcceptWelcome,
47798
- onDismiss: onDismissWelcome
47799
- })]
47955
+ })
47800
47956
  })
47801
47957
  });
47802
47958
  };
@@ -48856,6 +49012,55 @@ var DashboardStageInner = function DashboardStageInner(_ref2) {
48856
49012
  });
48857
49013
  };
48858
49014
 
49015
+ var WELCOME_STORAGE_KEY = "dash:welcome-prompted";
49016
+ function markPrompted() {
49017
+ localStorage.setItem(WELCOME_STORAGE_KEY, "true");
49018
+ }
49019
+ var WelcomePrompt = function WelcomePrompt(_ref) {
49020
+ var isOpen = _ref.isOpen,
49021
+ onAccept = _ref.onAccept,
49022
+ onDismiss = _ref.onDismiss;
49023
+ var handleAccept = function handleAccept() {
49024
+ markPrompted();
49025
+ if (onAccept) onAccept();
49026
+ };
49027
+ var handleDismiss = function handleDismiss() {
49028
+ markPrompted();
49029
+ if (onDismiss) onDismiss();
49030
+ };
49031
+ return /*#__PURE__*/jsxRuntime.jsxs(DashReact.Modal, {
49032
+ isOpen: isOpen,
49033
+ setIsOpen: handleDismiss,
49034
+ width: "w-[520px]",
49035
+ height: "h-auto",
49036
+ children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
49037
+ className: "px-8 pt-8 pb-4 flex flex-col items-center text-center gap-4",
49038
+ children: [/*#__PURE__*/jsxRuntime.jsx("div", {
49039
+ className: "text-4xl opacity-60",
49040
+ children: /*#__PURE__*/jsxRuntime.jsx(DashReact.FontAwesomeIcon, {
49041
+ icon: "table-cells-large"
49042
+ })
49043
+ }), /*#__PURE__*/jsxRuntime.jsx(DashReact.SubHeading2, {
49044
+ children: "Welcome to Dash!"
49045
+ }), /*#__PURE__*/jsxRuntime.jsx(DashReact.Paragraph2, {
49046
+ className: "max-w-sm",
49047
+ children: "Get started with a sample dashboard that showcases widgets for AI chat, notes, GitHub, Slack, Gmail, Calendar, and more \u2014 all in a ready-made 4x3 grid."
49048
+ })]
49049
+ }), /*#__PURE__*/jsxRuntime.jsx(DashReact.Modal.Footer, {
49050
+ children: /*#__PURE__*/jsxRuntime.jsxs("div", {
49051
+ className: "flex flex-row gap-3 w-full justify-end",
49052
+ children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.Button2, {
49053
+ title: "Start Fresh",
49054
+ onClick: handleDismiss
49055
+ }), /*#__PURE__*/jsxRuntime.jsx(DashReact.Button, {
49056
+ title: "Load Sample Dashboard",
49057
+ onClick: handleAccept
49058
+ })]
49059
+ })
49060
+ })]
49061
+ });
49062
+ };
49063
+
48859
49064
  var DashboardFooter = function DashboardFooter(_ref) {
48860
49065
  var workspace = _ref.workspace,
48861
49066
  preview = _ref.preview;