@trops/dash-core 0.1.537 → 0.1.538

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
@@ -55411,17 +55411,17 @@ var PermissionsTab = function PermissionsTab(_ref) {
55411
55411
  setBusy = _useState8[1];
55412
55412
 
55413
55413
  // Build the set of widget identifiers in this workspace. Walk every
55414
- // layout location (main, pages, sidebar) — same coverage as the
55415
- // publish flow's collectComponentNamesFromWorkspace, but here we
55416
- // need the dotted scoped id to match the grant store's keying.
55414
+ // layout location (main, pages, sidebar). `pickWidgetRef` returns
55415
+ // the dotted scoped id string (`scope.package.component`) — exactly
55416
+ // what the runtime grant store keys grants under, so we can join
55417
+ // directly against `widgetMcp.listAll` without further translation.
55417
55418
  var dashboardWidgetIds = useMemo(function () {
55418
55419
  var ids = new Set();
55419
55420
  if (!workspace) return ids;
55420
55421
  forEachWidget(workspace, function (w) {
55421
55422
  if (!isUserWidget(w)) return;
55422
- var ref = pickWidgetRef(w);
55423
- var dottedId = buildDottedId(ref);
55424
- if (dottedId) ids.add(dottedId);
55423
+ var dottedId = pickWidgetRef(w);
55424
+ if (typeof dottedId === "string" && dottedId) ids.add(dottedId);
55425
55425
  });
55426
55426
  return ids;
55427
55427
  }, [workspace]);
@@ -55971,21 +55971,6 @@ var PermissionsTab = function PermissionsTab(_ref) {
55971
55971
  });
55972
55972
  };
55973
55973
 
55974
- /**
55975
- * Construct the dotted scoped widget id used by the grant store
55976
- * (`<scope>.<package>.<component>`). Mirrors WidgetsTab's buildScopedId
55977
- * so this tab joins against the same key the runtime gate writes
55978
- * grants under.
55979
- */
55980
- function buildDottedId(ref) {
55981
- if (!(ref !== null && ref !== void 0 && ref.component)) return null;
55982
- var scope = ref.scope ? String(ref.scope).replace(/^@/, "") : null;
55983
- var pkg = ref.packageName ? scope ? String(ref.packageName).replace(new RegExp("^@?".concat(scope, "/")), "") : String(ref.packageName).replace(/^@/, "") : null;
55984
- if (scope && pkg) return "".concat(scope, ".").concat(pkg, ".").concat(ref.component);
55985
- if (pkg) return "".concat(pkg, ".").concat(ref.component);
55986
- return ref.component;
55987
- }
55988
-
55989
55974
  function _createForOfIteratorHelper$6(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$6(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; } } }; }
55990
55975
  function _unsupportedIterableToArray$6(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$6(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$6(r, a) : void 0; } }
55991
55976
  function _arrayLikeToArray$6(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; }