@burdenoff/fe-libs 2026.1115.9 → 2026.1115.10

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.
Files changed (36) hide show
  1. package/dist/chrome/globalSearch/ResultsList.js +39 -33
  2. package/dist/chrome/index.d.ts +1 -0
  3. package/dist/chrome/shell/ShellSidebar.js +287 -281
  4. package/dist/chrome/shell/shellSidebarWidth.d.ts +16 -0
  5. package/dist/chrome/shell/shellSidebarWidth.js +26 -0
  6. package/dist/chrome/shellLabelManifest.d.ts +8 -0
  7. package/dist/chrome.js +65 -63
  8. package/dist/shared/constants/shellCssVars.d.ts +9 -0
  9. package/dist/shared/constants/shellCssVars.js +3 -0
  10. package/dist/shared/events/sinks/RybbitSink.d.ts +13 -1
  11. package/dist/shared/events/sinks/RybbitSink.js +129 -121
  12. package/dist/shared/events/sinks/index.d.ts +1 -1
  13. package/dist/shared/pages/SearchPage.d.ts +17 -1
  14. package/dist/shared/pages/SearchPage.js +284 -243
  15. package/dist/shared/pages/searchPage/PageResultsGroup.d.ts +16 -0
  16. package/dist/shared/pages/searchPage/PageResultsGroup.js +29 -0
  17. package/dist/shared/pages/searchPage/ResultsList.d.ts +6 -1
  18. package/dist/shared/pages/searchPage/ResultsList.js +9 -53
  19. package/dist/shared/pages/searchPage/SearchResultCard.d.ts +14 -0
  20. package/dist/shared/pages/searchPage/SearchResultCard.js +57 -0
  21. package/dist/shared/providers/AppShellProvider.d.ts +8 -0
  22. package/dist/shared/providers/AppShellProvider.js +91 -89
  23. package/dist/shared/providers/shell/PersonaSurfaceProvider.d.ts +27 -1
  24. package/dist/shared/providers/shell/PersonaSurfaceProvider.js +214 -179
  25. package/dist/shared/providers/shell/index.d.ts +2 -0
  26. package/dist/shared/providers/shell/navIdMigration.d.ts +29 -0
  27. package/dist/shared/providers/shell/navIdMigration.js +57 -0
  28. package/dist/shared/providers/shell/personaSurfaceRemote.d.ts +7 -0
  29. package/dist/shared/providers/shell/personaSurfaceRemote.js +1 -1
  30. package/dist/shared/types/index.d.ts +11 -0
  31. package/dist/shared-providers-shell.js +13 -12
  32. package/dist/ui/access-needed-chip.d.ts +16 -0
  33. package/dist/ui/access-needed-chip.js +17 -0
  34. package/dist/ui/index.d.ts +1 -0
  35. package/dist/ui.js +50 -49
  36. package/package.json +1 -1
@@ -1,4 +1,5 @@
1
1
  import { ReactNode } from 'react';
2
+ import { NavIdAliases, NavItemsAddedAt } from './navIdMigration';
2
3
  export interface PersonaSurfaceDefinition {
3
4
  /** Stable surface id, e.g. "farmer". Must not be "everything" (reserved). */
4
5
  id: string;
@@ -46,6 +47,10 @@ export interface PersonaCustomView {
46
47
  name: string;
47
48
  visibleItems: string[];
48
49
  homePath: string | null;
50
+ /** When the view was created (ISO date-time), when the server says. */
51
+ createdAt?: string | null;
52
+ /** When the view was last saved (ISO date-time), when the server says. */
53
+ updatedAt?: string | null;
49
54
  }
50
55
  export interface SimulatableRole {
51
56
  id: string;
@@ -163,8 +168,29 @@ export interface PersonaSurfaceProviderProps {
163
168
  * @default 'role'
164
169
  */
165
170
  defaultSurface?: 'role' | 'everything';
171
+ /**
172
+ * Opt-in (BOFF-11842): nav item ids that changed, old id → new id, for a
173
+ * rename or a regroup. Saved views written before the change still resolve:
174
+ * a custom view's `visibleItems` and every view's per-item overrides are
175
+ * read through this table, so the page the person chose stays where they
176
+ * put it. Chains (a → b, b → c) are followed. Keep entries for as long as a
177
+ * saved view might still name the old id. Pass a module-level constant;
178
+ * an inline literal works too (it is compared by content).
179
+ */
180
+ navIdAliases?: NavIdAliases;
181
+ /**
182
+ * Opt-in (BOFF-11842): nav item id → when that page first shipped (ISO date
183
+ * or date-time). A user-created custom view is an allow-list, so without
184
+ * this a page added after the view was saved lands behind "N more…" as if
185
+ * its owner had hidden it. With it, a page that shipped after the view was
186
+ * last saved (the server's `updatedAt`, else `createdAt`) is shown in that
187
+ * view by default. The owner's explicit "hidden" override still wins, a
188
+ * view with no server timestamps is left as saved, and product-defined
189
+ * surfaces (maintained in code with the nav) are not affected.
190
+ */
191
+ navItemsAddedAt?: NavItemsAddedAt;
166
192
  }
167
- export declare function PersonaSurfaceProvider({ children, surfaces, productKey, gateway, persistence, defaultSurface, }: PersonaSurfaceProviderProps): import('react').JSX.Element;
193
+ export declare function PersonaSurfaceProvider({ children, surfaces, productKey, gateway, persistence, defaultSurface, navIdAliases: navIdAliasesProp, navItemsAddedAt: navItemsAddedAtProp, }: PersonaSurfaceProviderProps): import('react').JSX.Element;
168
194
  /** Access the persona surface context; throws outside the provider. */
169
195
  export declare function usePersonaSurface(): PersonaSurfaceContextValue;
170
196
  /**
@@ -1,20 +1,21 @@
1
1
  import { useHasAuthToken as e } from "../../graphql/useHasAuthToken.js";
2
2
  import { useSafePermissions as t } from "./PermissionProvider.js";
3
3
  import { createNavView as n, deleteNavView as r, fetchSimulatableRoles as i, updateNavView as ee } from "./personaSurfaceRemote.js";
4
- import { useRemoteNavPreferences as te } from "./useRemoteNavPreferences.js";
5
- import { createContext as a, use as o, useCallback as s, useEffect as c, useMemo as l, useState as u } from "react";
6
- import { jsx as ne } from "react/jsx-runtime";
7
- import { useQuery as re } from "@tanstack/react-query";
4
+ import { useRemoteNavPreferences as a } from "./useRemoteNavPreferences.js";
5
+ import { remapNavIds as te, remapNavOverrideBuckets as o, showNavItemsAddedSince as ne } from "./navIdMigration.js";
6
+ import { createContext as s, use as c, useCallback as l, useEffect as u, useMemo as d, useState as f } from "react";
7
+ import { jsx as re } from "react/jsx-runtime";
8
+ import { useQuery as ie } from "@tanstack/react-query";
8
9
  // src/shared/providers/shell/PersonaSurfaceProvider.tsx
9
- var d = "everything", f = a(null), p = [
10
+ var p = "everything", m = s(null), h = [
10
11
  "read",
11
12
  "list",
12
13
  "download",
13
14
  "join",
14
15
  "leave",
15
16
  "vote"
16
- ], m = [
17
- ...p,
17
+ ], g = [
18
+ ...h,
18
19
  "create",
19
20
  "update",
20
21
  "share",
@@ -28,7 +29,7 @@ var d = "everything", f = a(null), p = [
28
29
  "upload",
29
30
  "sync"
30
31
  ];
31
- function h(e) {
32
+ function _(e) {
32
33
  let t = [];
33
34
  for (let n of e.defaultPermissions) {
34
35
  if (n.level === "NONE") continue;
@@ -36,123 +37,154 @@ function h(e) {
36
37
  t.push(`${n.resourceType}:*`);
37
38
  continue;
38
39
  }
39
- let e = n.level === "EDITOR" ? m : p;
40
+ let e = n.level === "EDITOR" ? g : h;
40
41
  for (let r of e) t.push(`${n.resourceType}:${r}`);
41
42
  }
42
43
  return t;
43
44
  }
44
- function g(e, t) {
45
- if (t.length === 0) return d;
45
+ function v(e, t) {
46
+ if (t.length === 0) return p;
46
47
  let n = new Set(t);
47
48
  for (let t of e) if (t.roleNames.some((e) => n.has(e))) return t.id;
48
- return d;
49
+ return p;
49
50
  }
50
- function ie(e, t) {
51
+ function ae(e, t) {
51
52
  if (t.templateKey) {
52
53
  for (let n of e) if (n.templateKeys?.includes(t.templateKey)) return n.id;
53
54
  }
54
- return g(e, [t.roleName]);
55
+ return v(e, [t.roleName]);
55
56
  }
56
- function ae(e, t) {
57
+ function oe(e, t) {
57
58
  return `boff-persona:${e}:${t ?? "no-scope"}`;
58
59
  }
59
- function _(e) {
60
+ function se(e, t) {
60
61
  if (typeof window > "u") return {};
61
62
  try {
62
- let t = window.localStorage.getItem(e);
63
- if (!t) return {};
64
- let n = JSON.parse(t);
65
- return !n || typeof n != "object" ? {} : n;
63
+ let n = window.localStorage.getItem(e);
64
+ if (!n) return {};
65
+ let r = JSON.parse(n);
66
+ return !r || typeof r != "object" ? {} : y(r, t);
66
67
  } catch {
67
68
  return {};
68
69
  }
69
70
  }
70
- function v(e, t) {
71
+ function y(e, t) {
72
+ let n = e.overridesBySurface;
73
+ if (!t || !n) return e;
74
+ let r = o(n, t);
75
+ return r === n ? e : {
76
+ ...e,
77
+ overridesBySurface: r
78
+ };
79
+ }
80
+ function b(e) {
81
+ let t = e ? JSON.stringify(Object.entries(e).sort(([e], [t]) => e < t ? -1 : +(e > t))) : "";
82
+ return d(() => t ? Object.fromEntries(JSON.parse(t)) : void 0, [t]);
83
+ }
84
+ function x(e, t) {
71
85
  if (typeof window < "u") try {
72
86
  let n = Object.values(t.overridesBySurface ?? {}).some((e) => Object.keys(e).length > 0);
73
87
  !t.surfaceId && !n ? window.localStorage.removeItem(e) : window.localStorage.setItem(e, JSON.stringify(t));
74
88
  } catch {}
75
89
  }
76
- function y({ children: a, surfaces: o, productKey: p, gateway: m = "workspace", persistence: y = "local", defaultSurface: b = "role" }) {
77
- let x = t(), S = x?.scopeId ?? null, C = ae(p, S), w = y === "remote", [T, E] = u(() => _(C));
78
- c(() => {
79
- E(_(C));
80
- }, [C]);
81
- let [D, O] = u([]);
82
- c(() => {
83
- O([]);
84
- }, [S]);
85
- let oe = e(), { data: k, schedulePush: A } = te({
86
- gateway: m,
87
- scopeId: S,
88
- productKey: p,
89
- enabled: w && !!S && !!x && oe
90
+ function ce({ children: o, surfaces: s, productKey: c, gateway: h = "workspace", persistence: g = "local", defaultSurface: ce = "role", navIdAliases: le, navItemsAddedAt: S }) {
91
+ let C = t(), w = C?.scopeId ?? null, T = oe(c, w), E = g === "remote", D = b(le), O = b(S), [k, A] = f(() => se(T, D));
92
+ u(() => {
93
+ A(se(T, D));
94
+ }, [T, D]);
95
+ let [j, M] = f([]);
96
+ u(() => {
97
+ M([]);
98
+ }, [w]);
99
+ let ue = e(), { data: N, schedulePush: P } = a({
100
+ gateway: h,
101
+ scopeId: w,
102
+ productKey: c,
103
+ enabled: E && !!w && !!C && ue
90
104
  });
91
- c(() => {
92
- if (!k) return;
93
- let e = {
94
- surfaceId: k.activeViewId ?? void 0,
95
- overridesBySurface: k.overridesByView
96
- };
97
- E(e), v(C, e), O(k.customViews);
98
- }, [k, C]);
99
- let j = s((e) => {
100
- w && S && A({
105
+ u(() => {
106
+ if (!N) return;
107
+ let e = y({
108
+ surfaceId: N.activeViewId ?? void 0,
109
+ overridesBySurface: N.overridesByView
110
+ }, D);
111
+ A(e), x(T, e), M(N.customViews);
112
+ }, [
113
+ N,
114
+ T,
115
+ D
116
+ ]);
117
+ let F = d(() => {
118
+ if (!D && !O) return j;
119
+ let e = !1, t = j.map((t) => {
120
+ let n = te(t.visibleItems, D), r = ne(n, O, t.updatedAt ?? t.createdAt);
121
+ return r === t.visibleItems ? t : (e = !0, {
122
+ ...t,
123
+ visibleItems: [...r]
124
+ });
125
+ });
126
+ return e ? t : j;
127
+ }, [
128
+ j,
129
+ D,
130
+ O
131
+ ]), I = l((e) => {
132
+ E && w && P({
101
133
  activeViewId: e.surfaceId ?? null,
102
134
  overridesByView: e.overridesBySurface ?? {}
103
135
  });
104
136
  }, [
137
+ E,
105
138
  w,
106
- S,
107
- A
108
- ]), M = s((e) => {
109
- E((t) => {
139
+ P
140
+ ]), L = l((e) => {
141
+ A((t) => {
110
142
  let n = e(t);
111
- return v(C, n), j(n), n;
143
+ return x(T, n), I(n), n;
112
144
  });
113
- }, [C, j]), [N, P] = u(null), [F, I] = u(!1);
114
- c(() => {
115
- P(null), I(!1);
116
- }, [S]);
117
- let L = x?.isSuperAdmin ?? !1, R = !!x && (L || x.hasPermission("rbac:read")), z = re({
145
+ }, [T, I]), [R, z] = f(null), [B, V] = f(!1);
146
+ u(() => {
147
+ z(null), V(!1);
148
+ }, [w]);
149
+ let H = C?.isSuperAdmin ?? !1, U = !!C && (H || C.hasPermission("rbac:read")), W = ie({
118
150
  queryKey: [
119
151
  "persona-simulatable-roles",
120
- m,
121
- S,
122
- p
152
+ h,
153
+ w,
154
+ c
123
155
  ],
124
- queryFn: ({ signal: e }) => i(m, S, p, e),
125
- enabled: F && R && !!S,
156
+ queryFn: ({ signal: e }) => i(h, w, c, e),
157
+ enabled: B && U && !!w,
126
158
  staleTime: 3e5
127
- }), B = s(() => {
128
- I(!0);
129
- }, []), V = s((e) => {
130
- P({
159
+ }), G = l(() => {
160
+ V(!0);
161
+ }, []), K = l((e) => {
162
+ z({
131
163
  roleId: e.id,
132
164
  roleName: e.name,
133
165
  templateKey: e.templateKey,
134
- permissionStrings: h(e)
166
+ permissionStrings: _(e)
135
167
  });
136
- }, []), H = s(() => {
137
- P(null);
138
- }, []), U = l(() => x?.permissions?.roles ?? [], [x?.permissions?.roles]), W = l(() => N ? ie(o, N) : g(o, U), [
139
- o,
140
- N,
141
- U
142
- ]), se = Object.keys(T.overridesBySurface?.[W] ?? {}).length > 0, G = b === "everything" && !N && !se ? d : W, K = l(() => {
143
- if (N) return G;
144
- let e = T.surfaceId;
145
- return e && (e === "everything" || o.some((t) => t.id === e) || D.some((t) => t.id === e)) ? e : G;
168
+ }, []), q = l(() => {
169
+ z(null);
170
+ }, []), J = d(() => C?.permissions?.roles ?? [], [C?.permissions?.roles]), Y = d(() => R ? ae(s, R) : v(s, J), [
171
+ s,
172
+ R,
173
+ J
174
+ ]), de = Object.keys(k.overridesBySurface?.[Y] ?? {}).length > 0, X = ce === "everything" && !R && !de ? p : Y, Z = d(() => {
175
+ if (R) return X;
176
+ let e = k.surfaceId;
177
+ return e && (e === "everything" || s.some((t) => t.id === e) || j.some((t) => t.id === e)) ? e : X;
146
178
  }, [
147
- N,
148
- G,
149
- T.surfaceId,
150
- o,
151
- D
152
- ]), q = l(() => {
153
- let e = o.find((e) => e.id === K);
179
+ R,
180
+ X,
181
+ k.surfaceId,
182
+ s,
183
+ j
184
+ ]), fe = d(() => {
185
+ let e = s.find((e) => e.id === Z);
154
186
  if (e) return e;
155
- let t = D.find((e) => e.id === K);
187
+ let t = F.find((e) => e.id === Z);
156
188
  return t ? {
157
189
  id: t.id,
158
190
  label: t.name,
@@ -161,48 +193,48 @@ function y({ children: a, surfaces: o, productKey: p, gateway: m = "workspace",
161
193
  homePath: t.homePath ?? void 0
162
194
  } : null;
163
195
  }, [
164
- o,
165
- D,
166
- K
167
- ]), J = l(() => {
168
- let e = new Set(U);
169
- return [...o.filter((t) => L || t.roleNames.some((t) => e.has(t))).map((e) => e.id), d];
196
+ s,
197
+ F,
198
+ Z
199
+ ]), pe = d(() => {
200
+ let e = new Set(J);
201
+ return [...s.filter((t) => H || t.roleNames.some((t) => e.has(t))).map((e) => e.id), p];
170
202
  }, [
171
- o,
172
- L,
173
- U
174
- ]), Y = s((e) => {
175
- M((t) => ({
203
+ s,
204
+ H,
205
+ J
206
+ ]), Q = l((e) => {
207
+ L((t) => ({
176
208
  ...t,
177
209
  surfaceId: e ?? void 0
178
210
  }));
179
- }, [M]), X = l(() => T.overridesBySurface?.[K] ?? {}, [T.overridesBySurface, K]), Z = s((e, t) => {
180
- M((n) => {
181
- let r = { ...n.overridesBySurface ?? {} }, i = { ...r[K] ?? {} };
182
- return t === null ? delete i[e] : i[e] = t, Object.keys(i).length === 0 ? delete r[K] : r[K] = i, {
211
+ }, [L]), me = d(() => k.overridesBySurface?.[Z] ?? {}, [k.overridesBySurface, Z]), he = l((e, t) => {
212
+ L((n) => {
213
+ let r = { ...n.overridesBySurface ?? {} }, i = { ...r[Z] ?? {} };
214
+ return t === null ? delete i[e] : i[e] = t, Object.keys(i).length === 0 ? delete r[Z] : r[Z] = i, {
183
215
  ...n,
184
216
  overridesBySurface: r
185
217
  };
186
218
  });
187
- }, [M, K]), Q = s(() => {
188
- M((e) => {
219
+ }, [L, Z]), ge = l(() => {
220
+ L((e) => {
189
221
  let t = { ...e.overridesBySurface ?? {} };
190
- return delete t[K], {
222
+ return delete t[Z], {
191
223
  ...e,
192
224
  overridesBySurface: t
193
225
  };
194
226
  });
195
- }, [M, K]), [$, ce] = u(!1), le = w && !!S && !!k, ue = s(async (e, t, r) => {
196
- if (!w || !S) return null;
227
+ }, [L, Z]), [_e, ve] = f(!1), ye = E && !!w && !!N, be = l(async (e, t, r) => {
228
+ if (!E || !w) return null;
197
229
  try {
198
- let i = await n(m, {
199
- workspaceId: S,
200
- productSlug: p,
230
+ let i = await n(h, {
231
+ workspaceId: w,
232
+ productSlug: c,
201
233
  name: e,
202
234
  visibleItems: t,
203
235
  homePath: r ?? null
204
236
  });
205
- return O((e) => [...e, i]), M((e) => ({
237
+ return M((e) => [...e, i]), L((e) => ({
206
238
  ...e,
207
239
  surfaceId: i.id
208
240
  })), i;
@@ -210,33 +242,36 @@ function y({ children: a, surfaces: o, productKey: p, gateway: m = "workspace",
210
242
  return null;
211
243
  }
212
244
  }, [
245
+ E,
213
246
  w,
214
- S,
215
- m,
216
- p,
217
- M
218
- ]), de = s(async (e, t) => {
219
- if (!w || !S) return !1;
247
+ h,
248
+ c,
249
+ L
250
+ ]), xe = l(async (e, t) => {
251
+ if (!E || !w) return !1;
220
252
  try {
221
- let n = await ee(m, e, {
222
- workspaceId: S,
223
- name: t
253
+ let n = j.find((t) => t.id === e), r = F.find((t) => t.id === e), i = n && r && r.visibleItems !== n.visibleItems ? [...r.visibleItems] : void 0, a = await ee(h, e, {
254
+ workspaceId: w,
255
+ name: t,
256
+ ...i ? { visibleItems: i } : {}
224
257
  });
225
- return O((t) => t.map((t) => t.id === e ? {
258
+ return M((t) => t.map((t) => t.id === e ? {
226
259
  ...t,
227
- name: n.name
260
+ ...a
228
261
  } : t)), !0;
229
262
  } catch {
230
263
  return !1;
231
264
  }
232
265
  }, [
266
+ E,
233
267
  w,
234
- S,
235
- m
236
- ]), fe = s(async (e) => {
237
- if (!w || !S) return !1;
268
+ h,
269
+ j,
270
+ F
271
+ ]), $ = l(async (e) => {
272
+ if (!E || !w) return !1;
238
273
  try {
239
- return await r(m, e, S), O((t) => t.filter((t) => t.id !== e)), M((t) => {
274
+ return await r(h, e, w), M((t) => t.filter((t) => t.id !== e)), L((t) => {
240
275
  let n = { ...t.overridesBySurface ?? {} };
241
276
  return delete n[e], {
242
277
  surfaceId: t.surfaceId === e ? void 0 : t.surfaceId,
@@ -247,72 +282,72 @@ function y({ children: a, surfaces: o, productKey: p, gateway: m = "workspace",
247
282
  return !1;
248
283
  }
249
284
  }, [
285
+ E,
250
286
  w,
251
- S,
252
- m,
253
- M
254
- ]), pe = l(() => ({
255
- surfaces: o,
256
- activeSurfaceId: K,
257
- activeSurface: q,
258
- resolvedSurfaceId: G,
259
- roleSurfaceId: W,
260
- availableSurfaceIds: J,
261
- setSurfaceId: Y,
262
- overrides: X,
263
- setItemOverride: Z,
264
- resetOverrides: Q,
265
- customizeOpen: $,
266
- setCustomizeOpen: ce,
267
- canSimulate: R,
268
- simulation: N,
269
- startSimulation: V,
270
- stopSimulation: H,
271
- simulatableRoles: z.data ?? [],
272
- simulatableRolesLoading: z.isLoading && F,
273
- loadSimulatableRoles: B,
274
- customViews: D,
275
- canManageViews: le,
276
- createCustomView: ue,
277
- renameCustomView: de,
278
- deleteCustomView: fe
287
+ h,
288
+ L
289
+ ]), Se = d(() => ({
290
+ surfaces: s,
291
+ activeSurfaceId: Z,
292
+ activeSurface: fe,
293
+ resolvedSurfaceId: X,
294
+ roleSurfaceId: Y,
295
+ availableSurfaceIds: pe,
296
+ setSurfaceId: Q,
297
+ overrides: me,
298
+ setItemOverride: he,
299
+ resetOverrides: ge,
300
+ customizeOpen: _e,
301
+ setCustomizeOpen: ve,
302
+ canSimulate: U,
303
+ simulation: R,
304
+ startSimulation: K,
305
+ stopSimulation: q,
306
+ simulatableRoles: W.data ?? [],
307
+ simulatableRolesLoading: W.isLoading && B,
308
+ loadSimulatableRoles: G,
309
+ customViews: F,
310
+ canManageViews: ye,
311
+ createCustomView: be,
312
+ renameCustomView: xe,
313
+ deleteCustomView: $
279
314
  }), [
280
- o,
281
- K,
282
- q,
283
- G,
284
- W,
285
- J,
286
- Y,
287
- X,
315
+ s,
288
316
  Z,
317
+ fe,
318
+ X,
319
+ Y,
320
+ pe,
289
321
  Q,
290
- $,
322
+ me,
323
+ he,
324
+ ge,
325
+ _e,
326
+ U,
291
327
  R,
292
- N,
293
- V,
294
- H,
295
- z.data,
296
- z.isLoading,
297
- F,
328
+ K,
329
+ q,
330
+ W.data,
331
+ W.isLoading,
298
332
  B,
299
- D,
300
- le,
301
- ue,
302
- de,
303
- fe
333
+ G,
334
+ F,
335
+ ye,
336
+ be,
337
+ xe,
338
+ $
304
339
  ]);
305
- return /* @__PURE__ */ ne(f.Provider, {
306
- value: pe,
307
- children: a
340
+ return /* @__PURE__ */ re(m.Provider, {
341
+ value: Se,
342
+ children: o
308
343
  });
309
344
  }
310
- function b() {
311
- let e = o(f);
345
+ function le() {
346
+ let e = c(m);
312
347
  if (!e) throw Error("usePersonaSurface must be used within a PersonaSurfaceProvider");
313
348
  return e;
314
349
  }
315
- function x() {
316
- return o(f);
350
+ function S() {
351
+ return c(m);
317
352
  }
318
- export { d as EVERYTHING_SURFACE_ID, y as PersonaSurfaceProvider, g as resolveSurfaceForRoles, h as synthesizeSimulatedPermissionStrings, b as usePersonaSurface, x as useSafePersonaSurface };
353
+ export { p as EVERYTHING_SURFACE_ID, ce as PersonaSurfaceProvider, v as resolveSurfaceForRoles, _ as synthesizeSimulatedPermissionStrings, le as usePersonaSurface, S as useSafePersonaSurface };
@@ -29,6 +29,8 @@ export { PermissionProvider, usePermissions, useSafePermissions, usePermission,
29
29
  export type { EffectivePermissions, EffectiveResourcePermission, MyRolesResult, RoleInfo, PermissionCheckOptions, PermissionContextValue, PermissionProviderProps, } from './PermissionProvider';
30
30
  export { PersonaSurfaceProvider, usePersonaSurface, useSafePersonaSurface, resolveSurfaceForRoles, synthesizeSimulatedPermissionStrings, EVERYTHING_SURFACE_ID, } from './PersonaSurfaceProvider';
31
31
  export type { PersonaSurfaceDefinition, PersonaSurfaceContextValue, PersonaSurfaceProviderProps, PersonaCustomView, NavItemOverrideState, SimulatableRole, SimulationState, } from './PersonaSurfaceProvider';
32
+ export { resolveNavIdAlias, remapNavIds, remapNavOverrides, remapNavOverrideBuckets, showNavItemsAddedSince, } from './navIdMigration';
33
+ export type { NavIdAliases, NavItemsAddedAt } from './navIdMigration';
32
34
  export { AuthTokenProvider, useAuthToken, useAuthTokenOrNull } from './AuthTokenProvider';
33
35
  export type { AuthTokenContextValue, AuthTokenProviderProps } from './AuthTokenProvider';
34
36
  export { MultiGatewayProvider } from './MultiGatewayProvider';
@@ -0,0 +1,29 @@
1
+ import { NavItemOverrideState } from './PersonaSurfaceProvider';
2
+ /** Old nav item id → new nav item id. */
3
+ export type NavIdAliases = Readonly<Record<string, string>>;
4
+ /**
5
+ * Nav item id → when that page first shipped, as an ISO 8601 date or date-time
6
+ * ("2026-11-20" or "2026-11-20T10:00:00Z").
7
+ */
8
+ export type NavItemsAddedAt = Readonly<Record<string, string>>;
9
+ /** The id an alias table resolves `id` to: itself when it has no alias. */
10
+ export declare function resolveNavIdAlias(id: string, aliases: NavIdAliases | undefined): string;
11
+ /** `ids` with every aliased id replaced, duplicates dropped, order kept. */
12
+ export declare function remapNavIds(ids: readonly string[], aliases: NavIdAliases | undefined): readonly string[];
13
+ /**
14
+ * One override map with its keys remapped. When an old id and its new id both
15
+ * carry an override, the one saved under the new id wins: it was set after
16
+ * the change, so it is the person's latest choice.
17
+ */
18
+ export declare function remapNavOverrides(overrides: Readonly<Record<string, NavItemOverrideState>>, aliases: NavIdAliases | undefined): Readonly<Record<string, NavItemOverrideState>>;
19
+ /** Every view's override map remapped (the view ids themselves are not nav ids). */
20
+ export declare function remapNavOverrideBuckets(buckets: Readonly<Record<string, Readonly<Record<string, NavItemOverrideState>>>>, aliases: NavIdAliases | undefined): Readonly<Record<string, Readonly<Record<string, NavItemOverrideState>>>>;
21
+ /**
22
+ * A saved allow-list plus every page that shipped after it was saved.
23
+ *
24
+ * `savedAt` is when the view's item list was last written (the server's
25
+ * `updatedAt`, else `createdAt`). Without it nothing is added: a view whose
26
+ * age is unknown keeps exactly the list it has. A page is added when its
27
+ * shipping time is strictly later than `savedAt`.
28
+ */
29
+ export declare function showNavItemsAddedSince(visibleItems: readonly string[], addedAt: NavItemsAddedAt | undefined, savedAt: string | null | undefined): readonly string[];
@@ -0,0 +1,57 @@
1
+ // src/shared/providers/shell/navIdMigration.ts
2
+ function e(e, t) {
3
+ if (!t) return e;
4
+ let n = e, r = /* @__PURE__ */ new Set([n]);
5
+ for (;;) {
6
+ let e = Object.prototype.hasOwnProperty.call(t, n) ? t[n] : void 0;
7
+ if (e === void 0 || e === "" || r.has(e)) return n;
8
+ r.add(e), n = e;
9
+ }
10
+ }
11
+ function t(t, n) {
12
+ if (!n || Object.keys(n).length === 0) return t;
13
+ let r = !1, i = /* @__PURE__ */ new Set(), a = [];
14
+ for (let o of t) {
15
+ let t = e(o, n);
16
+ t !== o && (r = !0), i.has(t) ? r = !0 : (i.add(t), a.push(t));
17
+ }
18
+ return r ? a : t;
19
+ }
20
+ function n(t, n) {
21
+ if (!n || Object.keys(n).length === 0) return t;
22
+ let r = Object.keys(t);
23
+ if (!r.some((t) => e(t, n) !== t)) return t;
24
+ let i = {};
25
+ for (let a of r) {
26
+ let r = e(a, n);
27
+ r !== a && (i[r] = t[a]);
28
+ }
29
+ for (let a of r) e(a, n) === a && (i[a] = t[a]);
30
+ return i;
31
+ }
32
+ function r(e, t) {
33
+ if (!t || Object.keys(t).length === 0) return e;
34
+ let r = !1, i = {};
35
+ for (let [a, o] of Object.entries(e)) {
36
+ let e = n(o, t);
37
+ e !== o && (r = !0), i[a] = e;
38
+ }
39
+ return r ? i : e;
40
+ }
41
+ function i(e) {
42
+ if (!e) return null;
43
+ let t = Date.parse(e);
44
+ return Number.isFinite(t) ? t : null;
45
+ }
46
+ function a(e, t, n) {
47
+ if (!t) return e;
48
+ let r = i(n);
49
+ if (r === null) return e;
50
+ let a = new Set(e), o = [];
51
+ for (let [e, n] of Object.entries(t)) {
52
+ let t = i(n);
53
+ t !== null && t > r && !a.has(e) && (o.push(e), a.add(e));
54
+ }
55
+ return o.length > 0 ? [...e, ...o] : e;
56
+ }
57
+ export { t as remapNavIds, r as remapNavOverrideBuckets, n as remapNavOverrides, e as resolveNavIdAlias, a as showNavItemsAddedSince };