@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.js CHANGED
@@ -40112,12 +40112,17 @@ function seedSelections(plan, dashboardVisibility) {
40112
40112
  if (!w.scope || !w.packageName) continue;
40113
40113
  var _key = "".concat(w.scope, "/").concat(w.packageName);
40114
40114
  var _reg = w.registry;
40115
- var _owned = (_reg === null || _reg === void 0 ? void 0 : _reg.ownedByMe) || !(_reg !== null && _reg !== void 0 && _reg.exists);
40115
+ // Widgets under a local-only scope (@ai-built/*) are always owned
40116
+ // by the publisher for the purposes of this flow — the backend
40117
+ // republishes them under the caller's scope. Force include=true.
40118
+ var _owned = w.requiresRepublish ? true : (_reg === null || _reg === void 0 ? void 0 : _reg.ownedByMe) || !(_reg !== null && _reg !== void 0 && _reg.exists);
40116
40119
  selections[_key] = {
40117
40120
  kind: "widget",
40118
40121
  owned: _owned,
40119
- // Default: include owned rows, skip third-party
40120
- include: !!_owned,
40122
+ // Default: include owned rows, skip third-party. Always include
40123
+ // when the widget requires republishing (can't ship a dashboard
40124
+ // pointing at a scope the installer can't resolve).
40125
+ include: w.requiresRepublish ? true : !!_owned,
40121
40126
  // Bump default: none if not yet in registry (publish local version as-is),
40122
40127
  // patch if already in registry at same version
40123
40128
  bump: !(_reg !== null && _reg !== void 0 && _reg.exists) || _reg.latestVersion !== w.localVersion ? "none" : "patch",
@@ -40264,6 +40269,16 @@ var PublishDashboardModal = function PublishDashboardModal(_ref) {
40264
40269
  visibility = _useState36[0],
40265
40270
  setVisibility = _useState36[1];
40266
40271
 
40272
+ // Dashboard version bump — chosen on the Details step. Defaults to
40273
+ // "patch" so repeat-publishes auto-increment the registry's
40274
+ // latestVersion. Without this, every republish used the same
40275
+ // version string, the registry never saw a new version, and update
40276
+ // notifications never fired on installers.
40277
+ var _useState37 = React.useState("patch"),
40278
+ _useState38 = _slicedToArray(_useState37, 2),
40279
+ dashboardBump = _useState38[0],
40280
+ setDashboardBump = _useState38[1];
40281
+
40267
40282
  // Fetch publish preview (widget names) on open
40268
40283
  React.useEffect(function () {
40269
40284
  if (!isOpen || !appId || !workspaceId) return;
@@ -40612,14 +40627,16 @@ var PublishDashboardModal = function PublishDashboardModal(_ref) {
40612
40627
  _context2.next = 23;
40613
40628
  break;
40614
40629
  }
40615
- _options = {
40630
+ _options = _objectSpread$q({
40616
40631
  authorName: authorName.trim(),
40617
40632
  description: description.trim() || undefined,
40618
40633
  tags: selectedTags,
40619
40634
  icon: icon || undefined,
40620
40635
  visibility: visibility,
40621
40636
  componentConfigs: collectComponentConfigs()
40622
- };
40637
+ }, dashboardBump && dashboardBump !== "none" ? {
40638
+ bump: dashboardBump
40639
+ } : {});
40623
40640
  _context2.next = 21;
40624
40641
  return window.mainApi.dashboardConfig.prepareDashboardForPublish(appId, workspaceId, _options);
40625
40642
  case 21:
@@ -40932,6 +40949,23 @@ var PublishDashboardModal = function PublishDashboardModal(_ref) {
40932
40949
  onChange: setDescription,
40933
40950
  placeholder: "A brief description of this dashboard...",
40934
40951
  rows: 3
40952
+ }), /*#__PURE__*/jsxRuntime.jsxs("div", {
40953
+ children: [/*#__PURE__*/jsxRuntime.jsx("label", {
40954
+ className: "block text-sm font-medium opacity-70 mb-2",
40955
+ children: "Version Bump"
40956
+ }), /*#__PURE__*/jsxRuntime.jsx("select", {
40957
+ value: dashboardBump,
40958
+ onChange: function onChange(e) {
40959
+ return setDashboardBump(e.target.value);
40960
+ },
40961
+ className: "w-full px-3 py-2 bg-white/5 border border-white/10 rounded-lg text-sm",
40962
+ children: BUMP_OPTIONS$1.map(function (opt) {
40963
+ return /*#__PURE__*/jsxRuntime.jsx("option", {
40964
+ value: opt.value,
40965
+ children: opt.label
40966
+ }, opt.value);
40967
+ })
40968
+ })]
40935
40969
  }), /*#__PURE__*/jsxRuntime.jsxs("div", {
40936
40970
  children: [/*#__PURE__*/jsxRuntime.jsx("label", {
40937
40971
  className: "block text-sm font-medium opacity-70 mb-2",
@@ -41365,7 +41399,13 @@ function DependencyTable(_ref4) {
41365
41399
  className: "flex items-start gap-3",
41366
41400
  children: [/*#__PURE__*/jsxRuntime.jsx("div", {
41367
41401
  className: "pt-0.5",
41368
- children: sel.owned ? /*#__PURE__*/jsxRuntime.jsx("input", {
41402
+ children: data !== null && data !== void 0 && data.requiresRepublish && sel.owned ? /*#__PURE__*/jsxRuntime.jsx("input", {
41403
+ type: "checkbox",
41404
+ checked: true,
41405
+ disabled: true,
41406
+ className: "h-4 w-4 accent-indigo-500 cursor-not-allowed opacity-80",
41407
+ title: "Required \u2014 this widget only exists under a local scope and must be republished under your registry scope for installers to resolve it."
41408
+ }) : sel.owned ? /*#__PURE__*/jsxRuntime.jsx("input", {
41369
41409
  type: "checkbox",
41370
41410
  checked: sel.include,
41371
41411
  onChange: function onChange(e) {
@@ -54384,6 +54424,24 @@ function _unsupportedIterableToArray$5(r, a) { if (r) { if ("string" == typeof r
54384
54424
  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; }
54385
54425
  var ALL_WIDGETS_ID = "__ALL__";
54386
54426
 
54427
+ /**
54428
+ * Build the scoped registry identifier for a widget. Surfaces the
54429
+ * `scope.packageName.component` triple in the settings UI so users
54430
+ * can verify what a widget's registry identity is — useful when
54431
+ * diagnosing dashboard-install warnings ("why didn't this widget
54432
+ * install?" → scoped id in the warning vs scoped id shown here).
54433
+ * Returns just the component name when scope/package metadata is
54434
+ * unavailable (e.g. bare built-ins).
54435
+ */
54436
+ function buildScopedId(widget) {
54437
+ if (!(widget !== null && widget !== void 0 && widget.component)) return null;
54438
+ var scope = widget.scope ? String(widget.scope).replace(/^@/, "") : null;
54439
+ var pkg = widget.packageName ? scope ? String(widget.packageName).replace(new RegExp("^@?".concat(scope, "/")), "") : String(widget.packageName).replace(/^@/, "") : null;
54440
+ if (scope && pkg) return "".concat(scope, ".").concat(pkg, ".").concat(widget.component);
54441
+ if (pkg) return "".concat(pkg, ".").concat(widget.component);
54442
+ return widget.component;
54443
+ }
54444
+
54387
54445
  /**
54388
54446
  * WidgetsTab
54389
54447
  *
@@ -54431,7 +54489,12 @@ var WidgetsTab = function WidgetsTab(_ref) {
54431
54489
  displayName: item.name || cfg.name || cfg.displayName || item.component,
54432
54490
  section: section,
54433
54491
  userConfig: cfg.userConfig || {},
54434
- userPrefs: item.userPrefs || {}
54492
+ userPrefs: item.userPrefs || {},
54493
+ // Identity fields for the registry-identifier label. Prefer
54494
+ // values from the widget's component manager entry since the
54495
+ // layout item itself often doesn't carry scope/packageName.
54496
+ scope: cfg.scope || item.scope || null,
54497
+ packageName: cfg.packageName || cfg.name || item.packageName || null
54435
54498
  });
54436
54499
  };
54437
54500
  };
@@ -54599,6 +54662,7 @@ function SingleWidgetPane(_ref4) {
54599
54662
  effectivePrefs = _ref4.effectivePrefs,
54600
54663
  onFieldChange = _ref4.onFieldChange;
54601
54664
  var hasFields = Object.keys(widget.userConfig).length > 0;
54665
+ var scopedId = buildScopedId(widget);
54602
54666
  return /*#__PURE__*/jsxRuntime.jsxs("div", {
54603
54667
  children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
54604
54668
  className: "mb-3",
@@ -54608,6 +54672,10 @@ function SingleWidgetPane(_ref4) {
54608
54672
  }), /*#__PURE__*/jsxRuntime.jsxs("div", {
54609
54673
  className: "text-xs text-gray-500",
54610
54674
  children: [widget.component, " \xB7 ", widget.section]
54675
+ }), scopedId && scopedId !== widget.component && /*#__PURE__*/jsxRuntime.jsx("code", {
54676
+ className: "block mt-1 text-[11px] text-gray-500 font-mono truncate",
54677
+ title: scopedId,
54678
+ children: scopedId
54611
54679
  })]
54612
54680
  }), hasFields ? /*#__PURE__*/jsxRuntime.jsx(PanelEditForm, {
54613
54681
  userConfig: widget.userConfig,