@trops/dash-core 0.1.415 → 0.1.417

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
@@ -40094,12 +40094,17 @@ function seedSelections(plan, dashboardVisibility) {
40094
40094
  if (!w.scope || !w.packageName) continue;
40095
40095
  var _key = "".concat(w.scope, "/").concat(w.packageName);
40096
40096
  var _reg = w.registry;
40097
- var _owned = (_reg === null || _reg === void 0 ? void 0 : _reg.ownedByMe) || !(_reg !== null && _reg !== void 0 && _reg.exists);
40097
+ // Widgets under a local-only scope (@ai-built/*) are always owned
40098
+ // by the publisher for the purposes of this flow — the backend
40099
+ // republishes them under the caller's scope. Force include=true.
40100
+ var _owned = w.requiresRepublish ? true : (_reg === null || _reg === void 0 ? void 0 : _reg.ownedByMe) || !(_reg !== null && _reg !== void 0 && _reg.exists);
40098
40101
  selections[_key] = {
40099
40102
  kind: "widget",
40100
40103
  owned: _owned,
40101
- // Default: include owned rows, skip third-party
40102
- include: !!_owned,
40104
+ // Default: include owned rows, skip third-party. Always include
40105
+ // when the widget requires republishing (can't ship a dashboard
40106
+ // pointing at a scope the installer can't resolve).
40107
+ include: w.requiresRepublish ? true : !!_owned,
40103
40108
  // Bump default: none if not yet in registry (publish local version as-is),
40104
40109
  // patch if already in registry at same version
40105
40110
  bump: !(_reg !== null && _reg !== void 0 && _reg.exists) || _reg.latestVersion !== w.localVersion ? "none" : "patch",
@@ -40246,6 +40251,16 @@ var PublishDashboardModal = function PublishDashboardModal(_ref) {
40246
40251
  visibility = _useState36[0],
40247
40252
  setVisibility = _useState36[1];
40248
40253
 
40254
+ // Dashboard version bump — chosen on the Details step. Defaults to
40255
+ // "patch" so repeat-publishes auto-increment the registry's
40256
+ // latestVersion. Without this, every republish used the same
40257
+ // version string, the registry never saw a new version, and update
40258
+ // notifications never fired on installers.
40259
+ var _useState37 = useState("patch"),
40260
+ _useState38 = _slicedToArray(_useState37, 2),
40261
+ dashboardBump = _useState38[0],
40262
+ setDashboardBump = _useState38[1];
40263
+
40249
40264
  // Fetch publish preview (widget names) on open
40250
40265
  useEffect(function () {
40251
40266
  if (!isOpen || !appId || !workspaceId) return;
@@ -40594,14 +40609,16 @@ var PublishDashboardModal = function PublishDashboardModal(_ref) {
40594
40609
  _context2.next = 23;
40595
40610
  break;
40596
40611
  }
40597
- _options = {
40612
+ _options = _objectSpread$q({
40598
40613
  authorName: authorName.trim(),
40599
40614
  description: description.trim() || undefined,
40600
40615
  tags: selectedTags,
40601
40616
  icon: icon || undefined,
40602
40617
  visibility: visibility,
40603
40618
  componentConfigs: collectComponentConfigs()
40604
- };
40619
+ }, dashboardBump && dashboardBump !== "none" ? {
40620
+ bump: dashboardBump
40621
+ } : {});
40605
40622
  _context2.next = 21;
40606
40623
  return window.mainApi.dashboardConfig.prepareDashboardForPublish(appId, workspaceId, _options);
40607
40624
  case 21:
@@ -40914,6 +40931,23 @@ var PublishDashboardModal = function PublishDashboardModal(_ref) {
40914
40931
  onChange: setDescription,
40915
40932
  placeholder: "A brief description of this dashboard...",
40916
40933
  rows: 3
40934
+ }), /*#__PURE__*/jsxs("div", {
40935
+ children: [/*#__PURE__*/jsx("label", {
40936
+ className: "block text-sm font-medium opacity-70 mb-2",
40937
+ children: "Version Bump"
40938
+ }), /*#__PURE__*/jsx("select", {
40939
+ value: dashboardBump,
40940
+ onChange: function onChange(e) {
40941
+ return setDashboardBump(e.target.value);
40942
+ },
40943
+ className: "w-full px-3 py-2 bg-white/5 border border-white/10 rounded-lg text-sm",
40944
+ children: BUMP_OPTIONS$1.map(function (opt) {
40945
+ return /*#__PURE__*/jsx("option", {
40946
+ value: opt.value,
40947
+ children: opt.label
40948
+ }, opt.value);
40949
+ })
40950
+ })]
40917
40951
  }), /*#__PURE__*/jsxs("div", {
40918
40952
  children: [/*#__PURE__*/jsx("label", {
40919
40953
  className: "block text-sm font-medium opacity-70 mb-2",
@@ -41347,7 +41381,13 @@ function DependencyTable(_ref4) {
41347
41381
  className: "flex items-start gap-3",
41348
41382
  children: [/*#__PURE__*/jsx("div", {
41349
41383
  className: "pt-0.5",
41350
- children: sel.owned ? /*#__PURE__*/jsx("input", {
41384
+ children: data !== null && data !== void 0 && data.requiresRepublish && sel.owned ? /*#__PURE__*/jsx("input", {
41385
+ type: "checkbox",
41386
+ checked: true,
41387
+ disabled: true,
41388
+ className: "h-4 w-4 accent-indigo-500 cursor-not-allowed opacity-80",
41389
+ title: "Required \u2014 this widget only exists under a local scope and must be republished under your registry scope for installers to resolve it."
41390
+ }) : sel.owned ? /*#__PURE__*/jsx("input", {
41351
41391
  type: "checkbox",
41352
41392
  checked: sel.include,
41353
41393
  onChange: function onChange(e) {
@@ -54366,6 +54406,24 @@ function _unsupportedIterableToArray$5(r, a) { if (r) { if ("string" == typeof r
54366
54406
  function _arrayLikeToArray$5(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; }
54367
54407
  var ALL_WIDGETS_ID = "__ALL__";
54368
54408
 
54409
+ /**
54410
+ * Build the scoped registry identifier for a widget. Surfaces the
54411
+ * `scope.packageName.component` triple in the settings UI so users
54412
+ * can verify what a widget's registry identity is — useful when
54413
+ * diagnosing dashboard-install warnings ("why didn't this widget
54414
+ * install?" → scoped id in the warning vs scoped id shown here).
54415
+ * Returns just the component name when scope/package metadata is
54416
+ * unavailable (e.g. bare built-ins).
54417
+ */
54418
+ function buildScopedId(widget) {
54419
+ if (!(widget !== null && widget !== void 0 && widget.component)) return null;
54420
+ var scope = widget.scope ? String(widget.scope).replace(/^@/, "") : null;
54421
+ var pkg = widget.packageName ? scope ? String(widget.packageName).replace(new RegExp("^@?".concat(scope, "/")), "") : String(widget.packageName).replace(/^@/, "") : null;
54422
+ if (scope && pkg) return "".concat(scope, ".").concat(pkg, ".").concat(widget.component);
54423
+ if (pkg) return "".concat(pkg, ".").concat(widget.component);
54424
+ return widget.component;
54425
+ }
54426
+
54369
54427
  /**
54370
54428
  * WidgetsTab
54371
54429
  *
@@ -54413,7 +54471,12 @@ var WidgetsTab = function WidgetsTab(_ref) {
54413
54471
  displayName: item.name || cfg.name || cfg.displayName || item.component,
54414
54472
  section: section,
54415
54473
  userConfig: cfg.userConfig || {},
54416
- userPrefs: item.userPrefs || {}
54474
+ userPrefs: item.userPrefs || {},
54475
+ // Identity fields for the registry-identifier label. Prefer
54476
+ // values from the widget's component manager entry since the
54477
+ // layout item itself often doesn't carry scope/packageName.
54478
+ scope: cfg.scope || item.scope || null,
54479
+ packageName: cfg.packageName || cfg.name || item.packageName || null
54417
54480
  });
54418
54481
  };
54419
54482
  };
@@ -54581,6 +54644,7 @@ function SingleWidgetPane(_ref4) {
54581
54644
  effectivePrefs = _ref4.effectivePrefs,
54582
54645
  onFieldChange = _ref4.onFieldChange;
54583
54646
  var hasFields = Object.keys(widget.userConfig).length > 0;
54647
+ var scopedId = buildScopedId(widget);
54584
54648
  return /*#__PURE__*/jsxs("div", {
54585
54649
  children: [/*#__PURE__*/jsxs("div", {
54586
54650
  className: "mb-3",
@@ -54590,6 +54654,10 @@ function SingleWidgetPane(_ref4) {
54590
54654
  }), /*#__PURE__*/jsxs("div", {
54591
54655
  className: "text-xs text-gray-500",
54592
54656
  children: [widget.component, " \xB7 ", widget.section]
54657
+ }), scopedId && scopedId !== widget.component && /*#__PURE__*/jsx("code", {
54658
+ className: "block mt-1 text-[11px] text-gray-500 font-mono truncate",
54659
+ title: scopedId,
54660
+ children: scopedId
54593
54661
  })]
54594
54662
  }), hasFields ? /*#__PURE__*/jsx(PanelEditForm, {
54595
54663
  userConfig: widget.userConfig,