@trops/dash-core 0.1.416 → 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) {