@trops/dash-core 0.1.247 → 0.1.250

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
@@ -23132,6 +23132,395 @@ var ExternalWidget = function ExternalWidget(_ref) {
23132
23132
  });
23133
23133
  };
23134
23134
 
23135
+ var RegistryPackageDetail = function RegistryPackageDetail(_ref) {
23136
+ var widget = _ref.widget,
23137
+ onInstall = _ref.onInstall,
23138
+ _ref$isInstalling = _ref.isInstalling,
23139
+ isInstalling = _ref$isInstalling === void 0 ? false : _ref$isInstalling,
23140
+ _ref$installError = _ref.installError,
23141
+ installError = _ref$installError === void 0 ? null : _ref$installError,
23142
+ _ref$isInstalled = _ref.isInstalled,
23143
+ isInstalled = _ref$isInstalled === void 0 ? false : _ref$isInstalled;
23144
+ var _useContext = React.useContext(DashReact.ThemeContext),
23145
+ currentTheme = _useContext.currentTheme;
23146
+ var panelStyles = DashReact.getStylesForItem(DashReact.themeObjects.PANEL, currentTheme, {
23147
+ grow: false
23148
+ });
23149
+ if (!widget) return null;
23150
+ return /*#__PURE__*/jsxRuntime.jsxs("div", {
23151
+ className: "flex flex-col flex-1 min-h-0",
23152
+ children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
23153
+ className: "flex-1 min-h-0 overflow-y-auto p-6 space-y-6 ".concat(panelStyles.textColor || "text-gray-200"),
23154
+ children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
23155
+ className: "flex flex-row items-center gap-3",
23156
+ children: [/*#__PURE__*/jsxRuntime.jsx("div", {
23157
+ className: "h-5 w-5 flex-shrink-0 flex items-center justify-center",
23158
+ children: /*#__PURE__*/jsxRuntime.jsx(DashReact.FontAwesomeIcon, {
23159
+ icon: widget.icon || "cube",
23160
+ className: "h-5 w-5"
23161
+ })
23162
+ }), /*#__PURE__*/jsxRuntime.jsxs("div", {
23163
+ children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
23164
+ className: "flex items-center gap-2",
23165
+ children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.SubHeading3, {
23166
+ title: widget.packageDisplayName,
23167
+ padding: false
23168
+ }), isInstalled && /*#__PURE__*/jsxRuntime.jsx("span", {
23169
+ className: "text-[10px] px-1.5 py-0.5 rounded bg-emerald-500/20 text-emerald-400 flex-shrink-0",
23170
+ children: "Installed"
23171
+ })]
23172
+ }), /*#__PURE__*/jsxRuntime.jsxs("div", {
23173
+ className: "flex items-center gap-2 mt-0.5",
23174
+ children: [/*#__PURE__*/jsxRuntime.jsxs("span", {
23175
+ className: "text-sm opacity-60",
23176
+ children: ["by ", widget.packageAuthor || "Unknown"]
23177
+ }), /*#__PURE__*/jsxRuntime.jsxs("span", {
23178
+ className: "text-xs px-2 py-0.5 rounded ".concat(currentTheme["bg-primary-medium"], " opacity-70"),
23179
+ children: ["v", widget.packageVersion]
23180
+ })]
23181
+ })]
23182
+ })]
23183
+ }), /*#__PURE__*/jsxRuntime.jsx("hr", {
23184
+ className: currentTheme["border-primary-medium"]
23185
+ }), widget.packageDescription && /*#__PURE__*/jsxRuntime.jsx("p", {
23186
+ className: "text-sm",
23187
+ children: widget.packageDescription
23188
+ }), widget.packageTags && widget.packageTags.length > 0 && /*#__PURE__*/jsxRuntime.jsx("div", {
23189
+ className: "flex flex-wrap gap-1",
23190
+ children: widget.packageTags.map(function (tag) {
23191
+ return /*#__PURE__*/jsxRuntime.jsx("span", {
23192
+ className: "text-xs px-2 py-0.5 rounded ".concat(currentTheme["bg-primary-medium"], " opacity-60"),
23193
+ children: tag
23194
+ }, tag);
23195
+ })
23196
+ }), /*#__PURE__*/jsxRuntime.jsxs("div", {
23197
+ children: [/*#__PURE__*/jsxRuntime.jsx("span", {
23198
+ className: "text-xs font-semibold opacity-50 mb-1 block",
23199
+ children: "INCLUDED WIDGETS"
23200
+ }), /*#__PURE__*/jsxRuntime.jsx("div", {
23201
+ className: "space-y-1.5",
23202
+ children: (widget.packageWidgets || []).map(function (w, idx) {
23203
+ return /*#__PURE__*/jsxRuntime.jsxs("div", {
23204
+ className: "p-2 rounded ".concat(currentTheme["bg-primary-medium"]),
23205
+ children: [/*#__PURE__*/jsxRuntime.jsx("div", {
23206
+ className: "text-sm font-medium",
23207
+ children: w.displayName || w.name
23208
+ }), w.description && /*#__PURE__*/jsxRuntime.jsx("div", {
23209
+ className: "text-xs opacity-50 mt-0.5",
23210
+ children: w.description
23211
+ }), getUserConfigurableProviders(w.providers).length > 0 && /*#__PURE__*/jsxRuntime.jsxs("div", {
23212
+ className: "space-y-1 mt-1",
23213
+ children: [/*#__PURE__*/jsxRuntime.jsx("div", {
23214
+ className: "flex gap-1 flex-wrap",
23215
+ children: getUserConfigurableProviders(w.providers).map(function (p, pidx) {
23216
+ return /*#__PURE__*/jsxRuntime.jsxs("span", {
23217
+ className: "text-xs px-1.5 py-0.5 rounded bg-blue-900/30 text-blue-400",
23218
+ children: [p.type, p.required ? " *" : ""]
23219
+ }, pidx);
23220
+ })
23221
+ }), getUserConfigurableProviders(w.providers).some(function (p) {
23222
+ var _p$requiredTools;
23223
+ return ((_p$requiredTools = p.requiredTools) === null || _p$requiredTools === void 0 ? void 0 : _p$requiredTools.length) > 0;
23224
+ }) && /*#__PURE__*/jsxRuntime.jsx("div", {
23225
+ className: "flex flex-wrap gap-1 ml-1",
23226
+ children: getUserConfigurableProviders(w.providers).filter(function (p) {
23227
+ var _p$requiredTools2;
23228
+ return ((_p$requiredTools2 = p.requiredTools) === null || _p$requiredTools2 === void 0 ? void 0 : _p$requiredTools2.length) > 0;
23229
+ }).flatMap(function (p) {
23230
+ return p.requiredTools.map(function (tool) {
23231
+ return /*#__PURE__*/jsxRuntime.jsx("span", {
23232
+ className: "text-[10px] font-mono px-1.5 py-0.5 rounded bg-white/5 opacity-60",
23233
+ children: tool
23234
+ }, "".concat(p.type, "-").concat(tool));
23235
+ });
23236
+ })
23237
+ })]
23238
+ })]
23239
+ }, idx);
23240
+ })
23241
+ })]
23242
+ }), widget.appOrigin && /*#__PURE__*/jsxRuntime.jsxs("div", {
23243
+ className: "flex items-center gap-1.5 text-xs opacity-50",
23244
+ children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.FontAwesomeIcon, {
23245
+ icon: "laptop",
23246
+ className: "h-3 w-3"
23247
+ }), /*#__PURE__*/jsxRuntime.jsxs("span", {
23248
+ children: ["Built for ", widget.appOrigin]
23249
+ })]
23250
+ }), widget.missingApis && widget.missingApis.length > 0 && /*#__PURE__*/jsxRuntime.jsx("div", {
23251
+ className: "p-2 rounded bg-yellow-900/30 border border-yellow-700",
23252
+ children: /*#__PURE__*/jsxRuntime.jsxs("p", {
23253
+ className: "text-xs text-yellow-400",
23254
+ children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.FontAwesomeIcon, {
23255
+ icon: "triangle-exclamation",
23256
+ className: "mr-1"
23257
+ }), "Incompatible \u2014 requires ", widget.missingApis.join(", "), " API", widget.missingApis.length !== 1 ? "s" : ""]
23258
+ })
23259
+ }), widget.repository && /*#__PURE__*/jsxRuntime.jsxs("div", {
23260
+ children: [/*#__PURE__*/jsxRuntime.jsx("span", {
23261
+ className: "text-xs font-semibold opacity-50 mb-1 block",
23262
+ children: "REPOSITORY"
23263
+ }), /*#__PURE__*/jsxRuntime.jsx("button", {
23264
+ type: "button",
23265
+ onClick: function onClick() {
23266
+ var _window$mainApi;
23267
+ return (_window$mainApi = window.mainApi) === null || _window$mainApi === void 0 || (_window$mainApi = _window$mainApi.shell) === null || _window$mainApi === void 0 ? void 0 : _window$mainApi.openExternal(widget.repository);
23268
+ },
23269
+ className: "text-sm text-blue-400 hover:text-blue-300 hover:underline transition-colors break-all text-left",
23270
+ children: widget.repository
23271
+ })]
23272
+ }), installError && /*#__PURE__*/jsxRuntime.jsx("div", {
23273
+ className: "p-2 rounded bg-red-900/30 border border-red-700",
23274
+ children: /*#__PURE__*/jsxRuntime.jsx("p", {
23275
+ className: "text-xs text-red-400",
23276
+ children: installError
23277
+ })
23278
+ })]
23279
+ }), /*#__PURE__*/jsxRuntime.jsx("div", {
23280
+ className: "flex items-center justify-end px-6 py-3 border-t ".concat(currentTheme["border-primary-medium"]),
23281
+ children: /*#__PURE__*/jsxRuntime.jsx(DashReact.Button, {
23282
+ title: isInstalled ? "Installed" : isInstalling ? "Installing..." : "Install Package",
23283
+ bgColor: isInstalled ? "bg-emerald-600/50" : "bg-blue-600",
23284
+ hoverBackgroundColor: isInstalled || isInstalling ? "" : "hover:bg-blue-700",
23285
+ textSize: "text-sm",
23286
+ padding: "py-1.5 px-4",
23287
+ onClick: onInstall,
23288
+ disabled: isInstalling || isInstalled
23289
+ })
23290
+ })]
23291
+ });
23292
+ };
23293
+
23294
+ function getWidgetSearchQuery(componentKey) {
23295
+ var parts = componentKey.split(".");
23296
+ if (parts.length >= 3) {
23297
+ return {
23298
+ packageName: parts[1],
23299
+ widgetName: parts[2],
23300
+ scope: parts[0]
23301
+ };
23302
+ }
23303
+ return {
23304
+ packageName: null,
23305
+ widgetName: componentKey,
23306
+ scope: null
23307
+ };
23308
+ }
23309
+
23310
+ /**
23311
+ * Convert a raw registry package object into the flat widget shape
23312
+ * expected by RegistryPackageDetail.
23313
+ */
23314
+ function packageToFlatWidget(pkg) {
23315
+ return {
23316
+ key: "".concat(pkg.name, "/0"),
23317
+ name: pkg.displayName || pkg.name,
23318
+ icon: pkg.icon || null,
23319
+ isRegistry: true,
23320
+ packageName: pkg.name,
23321
+ packageScope: pkg.scope || null,
23322
+ packageDisplayName: pkg.displayName || pkg.name,
23323
+ packageVersion: pkg.version,
23324
+ packageAuthor: pkg.author || "",
23325
+ packageDescription: pkg.description || "",
23326
+ packageTags: pkg.tags || [],
23327
+ packageCategory: pkg.category || "",
23328
+ downloadUrl: pkg.downloadUrl || "",
23329
+ repository: pkg.repository || "",
23330
+ publishedAt: pkg.publishedAt || "",
23331
+ packageWidgets: pkg.widgets || [],
23332
+ appOrigin: pkg.appOrigin || null,
23333
+ packageProviders: pkg.providers || [],
23334
+ missingApis: []
23335
+ };
23336
+ }
23337
+
23338
+ /**
23339
+ * WidgetNotFound — rendered in place of an unresolvable widget.
23340
+ *
23341
+ * Shows the existing "Widget Not Found" error display and adds a
23342
+ * "Find in Registry" button that does an exact registry lookup and
23343
+ * opens an install modal.
23344
+ */
23345
+ var WidgetNotFound = function WidgetNotFound(_ref) {
23346
+ var component = _ref.component;
23347
+ var _useState = React.useState(false),
23348
+ _useState2 = _slicedToArray(_useState, 2),
23349
+ showModal = _useState2[0],
23350
+ setShowModal = _useState2[1];
23351
+ var _useState3 = React.useState(null),
23352
+ _useState4 = _slicedToArray(_useState3, 2),
23353
+ registryWidget = _useState4[0],
23354
+ setRegistryWidget = _useState4[1];
23355
+ var _useState5 = React.useState(false),
23356
+ _useState6 = _slicedToArray(_useState5, 2),
23357
+ isLoading = _useState6[0],
23358
+ setIsLoading = _useState6[1];
23359
+ var _useState7 = React.useState(false),
23360
+ _useState8 = _slicedToArray(_useState7, 2),
23361
+ notFound = _useState8[0],
23362
+ setNotFound = _useState8[1];
23363
+ var _useState9 = React.useState(false),
23364
+ _useState0 = _slicedToArray(_useState9, 2),
23365
+ isInstalling = _useState0[0],
23366
+ setIsInstalling = _useState0[1];
23367
+ var _useState1 = React.useState(null),
23368
+ _useState10 = _slicedToArray(_useState1, 2),
23369
+ installError = _useState10[0],
23370
+ setInstallError = _useState10[1];
23371
+ var lookupWidget = React.useCallback(/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
23372
+ var _getWidgetSearchQuery, packageName, widgetName, pkg, result;
23373
+ return _regeneratorRuntime.wrap(function (_context) {
23374
+ while (1) switch (_context.prev = _context.next) {
23375
+ case 0:
23376
+ setShowModal(true);
23377
+ setIsLoading(true);
23378
+ setNotFound(false);
23379
+ setRegistryWidget(null);
23380
+ setInstallError(null);
23381
+ _getWidgetSearchQuery = getWidgetSearchQuery(component), packageName = _getWidgetSearchQuery.packageName, widgetName = _getWidgetSearchQuery.widgetName;
23382
+ _context.prev = 1;
23383
+ pkg = null; // Scoped ID — exact package lookup
23384
+ if (!packageName) {
23385
+ _context.next = 3;
23386
+ break;
23387
+ }
23388
+ _context.next = 2;
23389
+ return window.mainApi.registry.getPackage(packageName);
23390
+ case 2:
23391
+ pkg = _context.sent;
23392
+ case 3:
23393
+ if (pkg) {
23394
+ _context.next = 5;
23395
+ break;
23396
+ }
23397
+ _context.next = 4;
23398
+ return window.mainApi.registry.search(widgetName);
23399
+ case 4:
23400
+ result = _context.sent;
23401
+ pkg = (result.packages || []).find(function (p) {
23402
+ return (p.widgets || []).some(function (w) {
23403
+ return w.name === widgetName;
23404
+ });
23405
+ });
23406
+ case 5:
23407
+ if (pkg) {
23408
+ setRegistryWidget(packageToFlatWidget(pkg));
23409
+ } else {
23410
+ setNotFound(true);
23411
+ }
23412
+ _context.next = 7;
23413
+ break;
23414
+ case 6:
23415
+ _context.prev = 6;
23416
+ _context["catch"](1);
23417
+ setNotFound(true);
23418
+ case 7:
23419
+ setIsLoading(false);
23420
+ case 8:
23421
+ case "end":
23422
+ return _context.stop();
23423
+ }
23424
+ }, _callee, null, [[1, 6]]);
23425
+ })), [component]);
23426
+ var handleInstall = React.useCallback(/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
23427
+ var packageName, packageScope, downloadUrl, packageVersion, scopedId, resolvedUrl, _t2;
23428
+ return _regeneratorRuntime.wrap(function (_context2) {
23429
+ while (1) switch (_context2.prev = _context2.next) {
23430
+ case 0:
23431
+ if (registryWidget) {
23432
+ _context2.next = 1;
23433
+ break;
23434
+ }
23435
+ return _context2.abrupt("return");
23436
+ case 1:
23437
+ setIsInstalling(true);
23438
+ setInstallError(null);
23439
+ _context2.prev = 2;
23440
+ packageName = registryWidget.packageName, packageScope = registryWidget.packageScope, downloadUrl = registryWidget.downloadUrl, packageVersion = registryWidget.packageVersion;
23441
+ scopedId = packageScope ? "@".concat(packageScope.replace(/^@/, ""), "/").concat(packageName) : packageName;
23442
+ resolvedUrl = downloadUrl.replace(/\{version\}/g, packageVersion).replace(/\{name\}/g, packageName);
23443
+ _context2.next = 3;
23444
+ return window.mainApi.widgets.install(scopedId, resolvedUrl);
23445
+ case 3:
23446
+ setShowModal(false);
23447
+ _context2.next = 5;
23448
+ break;
23449
+ case 4:
23450
+ _context2.prev = 4;
23451
+ _t2 = _context2["catch"](2);
23452
+ setInstallError(_t2.message || "Failed to install package");
23453
+ case 5:
23454
+ setIsInstalling(false);
23455
+ case 6:
23456
+ case "end":
23457
+ return _context2.stop();
23458
+ }
23459
+ }, _callee2, null, [[2, 4]]);
23460
+ })), [registryWidget]);
23461
+ return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
23462
+ children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
23463
+ className: "flex flex-col h-full justify-center items-center w-full z-10 gap-2 p-4 text-center",
23464
+ children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.FontAwesomeIcon, {
23465
+ icon: "triangle-exclamation",
23466
+ className: "h-6 w-6 text-amber-500"
23467
+ }), /*#__PURE__*/jsxRuntime.jsx("div", {
23468
+ className: "text-sm font-semibold text-gray-300",
23469
+ children: "Widget Not Found"
23470
+ }), /*#__PURE__*/jsxRuntime.jsx("div", {
23471
+ className: "text-xs text-gray-500 font-mono",
23472
+ children: component
23473
+ }), /*#__PURE__*/jsxRuntime.jsx("div", {
23474
+ className: "text-xs text-gray-600 mt-1",
23475
+ children: "This widget may have been uninstalled or renamed."
23476
+ }), /*#__PURE__*/jsxRuntime.jsxs("button", {
23477
+ type: "button",
23478
+ className: "flex items-center gap-1.5 text-xs text-blue-400 hover:text-blue-300 transition-colors mt-2",
23479
+ onClick: lookupWidget,
23480
+ children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.FontAwesomeIcon, {
23481
+ icon: "magnifying-glass",
23482
+ className: "h-3 w-3"
23483
+ }), "Find in Registry"]
23484
+ })]
23485
+ }), /*#__PURE__*/jsxRuntime.jsxs(DashReact.Modal, {
23486
+ isOpen: showModal,
23487
+ setIsOpen: setShowModal,
23488
+ width: "w-1/3",
23489
+ height: "auto",
23490
+ children: [isLoading && /*#__PURE__*/jsxRuntime.jsx("div", {
23491
+ className: "flex items-center justify-center p-12",
23492
+ children: /*#__PURE__*/jsxRuntime.jsx(DashReact.FontAwesomeIcon, {
23493
+ icon: "spinner",
23494
+ className: "h-5 w-5 text-gray-400 animate-spin"
23495
+ })
23496
+ }), !isLoading && registryWidget && /*#__PURE__*/jsxRuntime.jsx(RegistryPackageDetail, {
23497
+ widget: registryWidget,
23498
+ onInstall: handleInstall,
23499
+ isInstalling: isInstalling,
23500
+ installError: installError
23501
+ }), !isLoading && notFound && /*#__PURE__*/jsxRuntime.jsxs("div", {
23502
+ className: "flex flex-col items-center justify-center gap-3 p-12 text-center",
23503
+ children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.FontAwesomeIcon, {
23504
+ icon: "triangle-exclamation",
23505
+ className: "h-6 w-6 text-amber-500"
23506
+ }), /*#__PURE__*/jsxRuntime.jsx("div", {
23507
+ className: "text-sm text-gray-400",
23508
+ children: "This widget is not available in the registry."
23509
+ }), /*#__PURE__*/jsxRuntime.jsx(DashReact.Button, {
23510
+ title: "Close",
23511
+ bgColor: "bg-gray-600",
23512
+ hoverBackgroundColor: "hover:bg-gray-700",
23513
+ textSize: "text-sm",
23514
+ padding: "py-1.5 px-4",
23515
+ onClick: function onClick() {
23516
+ return setShowModal(false);
23517
+ }
23518
+ })]
23519
+ })]
23520
+ })]
23521
+ });
23522
+ };
23523
+
23135
23524
  var GRID_CELL_WIDGET_TYPE = "grid-cell-widget";
23136
23525
  var SIDEBAR_WIDGET_TYPE = "sidebar-widget";
23137
23526
 
@@ -25156,21 +25545,8 @@ function renderComponent(component, id) {
25156
25545
  // WidgetFactory.render() always returns a React element (truthy),
25157
25546
  // so the old ternary fallback could never fire.
25158
25547
  if (!isWidgetResolvable(component)) {
25159
- return /*#__PURE__*/jsxRuntime.jsxs("div", {
25160
- className: "flex flex-col h-full justify-center items-center w-full z-10 gap-2 p-4 text-center",
25161
- children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.FontAwesomeIcon, {
25162
- icon: "triangle-exclamation",
25163
- className: "h-6 w-6 text-amber-500"
25164
- }), /*#__PURE__*/jsxRuntime.jsx("div", {
25165
- className: "text-sm font-semibold text-gray-300",
25166
- children: "Widget Not Found"
25167
- }), /*#__PURE__*/jsxRuntime.jsx("div", {
25168
- className: "text-xs text-gray-500 font-mono",
25169
- children: component
25170
- }), /*#__PURE__*/jsxRuntime.jsx("div", {
25171
- className: "text-xs text-gray-600 mt-1",
25172
- children: "This widget may have been uninstalled or renamed."
25173
- })]
25548
+ return /*#__PURE__*/jsxRuntime.jsx(WidgetNotFound, {
25549
+ component: component
25174
25550
  });
25175
25551
  }
25176
25552
  if ("height" in params) {
@@ -43928,165 +44304,6 @@ var InstallWidgetPicker = function InstallWidgetPicker(_ref2) {
43928
44304
  });
43929
44305
  };
43930
44306
 
43931
- var RegistryPackageDetail = function RegistryPackageDetail(_ref) {
43932
- var widget = _ref.widget,
43933
- onInstall = _ref.onInstall,
43934
- _ref$isInstalling = _ref.isInstalling,
43935
- isInstalling = _ref$isInstalling === void 0 ? false : _ref$isInstalling,
43936
- _ref$installError = _ref.installError,
43937
- installError = _ref$installError === void 0 ? null : _ref$installError,
43938
- _ref$isInstalled = _ref.isInstalled,
43939
- isInstalled = _ref$isInstalled === void 0 ? false : _ref$isInstalled;
43940
- var _useContext = React.useContext(DashReact.ThemeContext),
43941
- currentTheme = _useContext.currentTheme;
43942
- var panelStyles = DashReact.getStylesForItem(DashReact.themeObjects.PANEL, currentTheme, {
43943
- grow: false
43944
- });
43945
- if (!widget) return null;
43946
- return /*#__PURE__*/jsxRuntime.jsxs("div", {
43947
- className: "flex flex-col flex-1 min-h-0",
43948
- children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
43949
- className: "flex-1 min-h-0 overflow-y-auto p-6 space-y-6 ".concat(panelStyles.textColor || "text-gray-200"),
43950
- children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
43951
- className: "flex flex-row items-center gap-3",
43952
- children: [/*#__PURE__*/jsxRuntime.jsx("div", {
43953
- className: "h-5 w-5 flex-shrink-0 flex items-center justify-center",
43954
- children: /*#__PURE__*/jsxRuntime.jsx(DashReact.FontAwesomeIcon, {
43955
- icon: widget.icon || "cube",
43956
- className: "h-5 w-5"
43957
- })
43958
- }), /*#__PURE__*/jsxRuntime.jsxs("div", {
43959
- children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
43960
- className: "flex items-center gap-2",
43961
- children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.SubHeading3, {
43962
- title: widget.packageDisplayName,
43963
- padding: false
43964
- }), isInstalled && /*#__PURE__*/jsxRuntime.jsx("span", {
43965
- className: "text-[10px] px-1.5 py-0.5 rounded bg-emerald-500/20 text-emerald-400 flex-shrink-0",
43966
- children: "Installed"
43967
- })]
43968
- }), /*#__PURE__*/jsxRuntime.jsxs("div", {
43969
- className: "flex items-center gap-2 mt-0.5",
43970
- children: [/*#__PURE__*/jsxRuntime.jsxs("span", {
43971
- className: "text-sm opacity-60",
43972
- children: ["by ", widget.packageAuthor || "Unknown"]
43973
- }), /*#__PURE__*/jsxRuntime.jsxs("span", {
43974
- className: "text-xs px-2 py-0.5 rounded ".concat(currentTheme["bg-primary-medium"], " opacity-70"),
43975
- children: ["v", widget.packageVersion]
43976
- })]
43977
- })]
43978
- })]
43979
- }), /*#__PURE__*/jsxRuntime.jsx("hr", {
43980
- className: currentTheme["border-primary-medium"]
43981
- }), widget.packageDescription && /*#__PURE__*/jsxRuntime.jsx("p", {
43982
- className: "text-sm",
43983
- children: widget.packageDescription
43984
- }), widget.packageTags && widget.packageTags.length > 0 && /*#__PURE__*/jsxRuntime.jsx("div", {
43985
- className: "flex flex-wrap gap-1",
43986
- children: widget.packageTags.map(function (tag) {
43987
- return /*#__PURE__*/jsxRuntime.jsx("span", {
43988
- className: "text-xs px-2 py-0.5 rounded ".concat(currentTheme["bg-primary-medium"], " opacity-60"),
43989
- children: tag
43990
- }, tag);
43991
- })
43992
- }), /*#__PURE__*/jsxRuntime.jsxs("div", {
43993
- children: [/*#__PURE__*/jsxRuntime.jsx("span", {
43994
- className: "text-xs font-semibold opacity-50 mb-1 block",
43995
- children: "INCLUDED WIDGETS"
43996
- }), /*#__PURE__*/jsxRuntime.jsx("div", {
43997
- className: "space-y-1.5",
43998
- children: (widget.packageWidgets || []).map(function (w, idx) {
43999
- return /*#__PURE__*/jsxRuntime.jsxs("div", {
44000
- className: "p-2 rounded ".concat(currentTheme["bg-primary-medium"]),
44001
- children: [/*#__PURE__*/jsxRuntime.jsx("div", {
44002
- className: "text-sm font-medium",
44003
- children: w.displayName || w.name
44004
- }), w.description && /*#__PURE__*/jsxRuntime.jsx("div", {
44005
- className: "text-xs opacity-50 mt-0.5",
44006
- children: w.description
44007
- }), getUserConfigurableProviders(w.providers).length > 0 && /*#__PURE__*/jsxRuntime.jsxs("div", {
44008
- className: "space-y-1 mt-1",
44009
- children: [/*#__PURE__*/jsxRuntime.jsx("div", {
44010
- className: "flex gap-1 flex-wrap",
44011
- children: getUserConfigurableProviders(w.providers).map(function (p, pidx) {
44012
- return /*#__PURE__*/jsxRuntime.jsxs("span", {
44013
- className: "text-xs px-1.5 py-0.5 rounded bg-blue-900/30 text-blue-400",
44014
- children: [p.type, p.required ? " *" : ""]
44015
- }, pidx);
44016
- })
44017
- }), getUserConfigurableProviders(w.providers).some(function (p) {
44018
- var _p$requiredTools;
44019
- return ((_p$requiredTools = p.requiredTools) === null || _p$requiredTools === void 0 ? void 0 : _p$requiredTools.length) > 0;
44020
- }) && /*#__PURE__*/jsxRuntime.jsx("div", {
44021
- className: "flex flex-wrap gap-1 ml-1",
44022
- children: getUserConfigurableProviders(w.providers).filter(function (p) {
44023
- var _p$requiredTools2;
44024
- return ((_p$requiredTools2 = p.requiredTools) === null || _p$requiredTools2 === void 0 ? void 0 : _p$requiredTools2.length) > 0;
44025
- }).flatMap(function (p) {
44026
- return p.requiredTools.map(function (tool) {
44027
- return /*#__PURE__*/jsxRuntime.jsx("span", {
44028
- className: "text-[10px] font-mono px-1.5 py-0.5 rounded bg-white/5 opacity-60",
44029
- children: tool
44030
- }, "".concat(p.type, "-").concat(tool));
44031
- });
44032
- })
44033
- })]
44034
- })]
44035
- }, idx);
44036
- })
44037
- })]
44038
- }), widget.appOrigin && /*#__PURE__*/jsxRuntime.jsxs("div", {
44039
- className: "flex items-center gap-1.5 text-xs opacity-50",
44040
- children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.FontAwesomeIcon, {
44041
- icon: "laptop",
44042
- className: "h-3 w-3"
44043
- }), /*#__PURE__*/jsxRuntime.jsxs("span", {
44044
- children: ["Built for ", widget.appOrigin]
44045
- })]
44046
- }), widget.missingApis && widget.missingApis.length > 0 && /*#__PURE__*/jsxRuntime.jsx("div", {
44047
- className: "p-2 rounded bg-yellow-900/30 border border-yellow-700",
44048
- children: /*#__PURE__*/jsxRuntime.jsxs("p", {
44049
- className: "text-xs text-yellow-400",
44050
- children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.FontAwesomeIcon, {
44051
- icon: "triangle-exclamation",
44052
- className: "mr-1"
44053
- }), "Incompatible \u2014 requires ", widget.missingApis.join(", "), " API", widget.missingApis.length !== 1 ? "s" : ""]
44054
- })
44055
- }), widget.repository && /*#__PURE__*/jsxRuntime.jsxs("div", {
44056
- children: [/*#__PURE__*/jsxRuntime.jsx("span", {
44057
- className: "text-xs font-semibold opacity-50 mb-1 block",
44058
- children: "REPOSITORY"
44059
- }), /*#__PURE__*/jsxRuntime.jsx("button", {
44060
- type: "button",
44061
- onClick: function onClick() {
44062
- var _window$mainApi;
44063
- return (_window$mainApi = window.mainApi) === null || _window$mainApi === void 0 || (_window$mainApi = _window$mainApi.shell) === null || _window$mainApi === void 0 ? void 0 : _window$mainApi.openExternal(widget.repository);
44064
- },
44065
- className: "text-sm text-blue-400 hover:text-blue-300 hover:underline transition-colors break-all text-left",
44066
- children: widget.repository
44067
- })]
44068
- }), installError && /*#__PURE__*/jsxRuntime.jsx("div", {
44069
- className: "p-2 rounded bg-red-900/30 border border-red-700",
44070
- children: /*#__PURE__*/jsxRuntime.jsx("p", {
44071
- className: "text-xs text-red-400",
44072
- children: installError
44073
- })
44074
- })]
44075
- }), /*#__PURE__*/jsxRuntime.jsx("div", {
44076
- className: "flex items-center justify-end px-6 py-3 border-t ".concat(currentTheme["border-primary-medium"]),
44077
- children: /*#__PURE__*/jsxRuntime.jsx(DashReact.Button, {
44078
- title: isInstalled ? "Installed" : isInstalling ? "Installing..." : "Install Package",
44079
- bgColor: isInstalled ? "bg-emerald-600/50" : "bg-blue-600",
44080
- hoverBackgroundColor: isInstalled || isInstalling ? "" : "hover:bg-blue-700",
44081
- textSize: "text-sm",
44082
- padding: "py-1.5 px-4",
44083
- onClick: onInstall,
44084
- disabled: isInstalling || isInstalled
44085
- })
44086
- })]
44087
- });
44088
- };
44089
-
44090
44307
  function _createForOfIteratorHelper$2(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$2(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; } } }; }
44091
44308
  function _unsupportedIterableToArray$2(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$2(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$2(r, a) : void 0; } }
44092
44309
  function _arrayLikeToArray$2(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; }
@@ -50991,6 +51208,7 @@ exports.WidgetApi = WidgetApi;
50991
51208
  exports.WidgetConfigPanel = WidgetConfigPanel;
50992
51209
  exports.WidgetContext = WidgetContext;
50993
51210
  exports.WidgetFactory = WidgetFactory;
51211
+ exports.WidgetNotFound = WidgetNotFound;
50994
51212
  exports.WidgetPopoutStage = WidgetPopoutStage;
50995
51213
  exports.WidgetProviderWrapper = WidgetProviderWrapper;
50996
51214
  exports.WidgetSidebar = WidgetSidebar;