@burdenoff/fe-libs 2026.1023.5 → 2026.1023.7

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/chrome.js CHANGED
@@ -9,43 +9,43 @@ import { PluginFooterStrip as d } from "./chrome/PluginFooterStrip.js";
9
9
  import { DEFAULT_FOOTER_COLUMNS as f, DEFAULT_SOCIAL_LINKS as p, Footer as m } from "./chrome/Footer.js";
10
10
  import { SideNavigation as h } from "./chrome/SideNavigation.js";
11
11
  import { GlobalSearch as g } from "./chrome/GlobalSearch.js";
12
- import { CommandPalette as _ } from "./chrome/CommandPalette.js";
13
- import { Breadcrumbs as v } from "./chrome/Breadcrumbs.js";
14
- import { NavLink as y } from "./chrome/NavLink.js";
15
- import { Tabs as b } from "./chrome/Tabs.js";
16
- import { Sidebar as x } from "./chrome/Sidebar.js";
17
- import { ProfileSwitcher as S } from "./chrome/ProfileSwitcher.js";
18
- import { ProductSwitcher as C } from "./chrome/ProductSwitcher.js";
19
- import { LanguageSwitcher as w } from "./chrome/LanguageSwitcher.js";
20
- import { ContextSwitcher as T } from "./chrome/ContextSwitcher.js";
21
- import { GeographySwitcher as E } from "./chrome/GeographySwitcher.js";
22
- import { PushOptInToggle as D } from "./chrome/notificationCenter/PushOptInToggle.js";
23
- import { NotificationCenter as O } from "./chrome/NotificationCenter.js";
24
- import { LanguagePickerSheet as k } from "./chrome/LanguagePickerSheet.js";
25
- import { ProductPickerSheet as A } from "./chrome/ProductPickerSheet.js";
26
- import { AccountSwitcher as j } from "./chrome/AccountSwitcher.js";
27
- import { firstProjectOfWorkspace as M, switchOrganization as N, switchWorkspace as P } from "./chrome/contextSwitcher/contextSwitch.js";
28
- import { resolveSwitchTarget as F, sectionLandingRule as I } from "./chrome/contextSwitcher/resolveSwitchTarget.js";
29
- import { useContextSwitchController as L } from "./chrome/contextSwitcher/useContextSwitchController.js";
30
- import { AutoBreadcrumbs as R, registerBreadcrumbName as z, unregisterBreadcrumbName as B } from "./chrome/AutoBreadcrumbs.js";
31
- import { NavCustomizeDialog as V } from "./chrome/NavCustomizeDialog.js";
32
- import { PersonaSimulationPill as H, PersonaSurfaceControls as U } from "./chrome/PersonaSurfaceControls.js";
33
- import { ProductSideNav as W } from "./chrome/ProductSideNav.js";
34
- import { BrandMark as G } from "./chrome/BrandMark.js";
35
- import { DynamicFooter as K } from "./chrome/DynamicFooter.js";
36
- import { PanelTabs as q } from "./chrome/PanelTabs.js";
37
- import { PanelContainer as J } from "./chrome/PanelContainer.js";
38
- import { StatusBar as Y } from "./chrome/StatusBar.js";
39
- import { PluginRoutes as X } from "./chrome/PluginRoutes.js";
40
- import { PluginSettingsPage as Z } from "./chrome/PluginSettingsPage.js";
41
- import { PluginToolbar as Q } from "./chrome/PluginToolbar.js";
42
- import { PluginWidgetGrid as $ } from "./chrome/PluginWidgetGrid.js";
43
- import { PluginContextMenuTarget as ee } from "./chrome/PluginContextMenuTarget.js";
44
- import { selectMobileTabs as te } from "./chrome/mobileTabBar/selectTabs.js";
45
- import { useMobileTabBarVisible as ne } from "./chrome/mobileTabBar/useMobileTabBarVisible.js";
46
- import { MobileTabBar as re } from "./chrome/MobileTabBar.js";
47
- import { NativeTopBar as ie } from "./chrome/NativeTopBar.js";
48
- import { SwipeNavigation as ae } from "./chrome/SwipeNavigation.js";
49
- import { NativePageTransition as oe } from "./chrome/NativePageTransition.js";
50
- import { findNavTitle as se, useNativeTopBarTitle as ce } from "./chrome/nativeTopBarTitle.js";
51
- export { j as AccountSwitcher, s as AppShellLayout, R as AutoBreadcrumbs, G as BrandMark, v as Breadcrumbs, _ as CommandPalette, T as ContextSwitcher, f as DEFAULT_FOOTER_COLUMNS, p as DEFAULT_SOCIAL_LINKS, K as DynamicFooter, m as Footer, u as FooterBar, E as GeographySwitcher, g as GlobalSearch, l as HeaderBar, k as LanguagePickerSheet, w as LanguageSwitcher, re as MobileTabBar, n as NAV_MORE_ID_PREFIX, oe as NativePageTransition, ie as NativeTopBar, V as NavCustomizeDialog, y as NavLink, O as NotificationCenter, c as PageHeader, J as PanelContainer, q as PanelTabs, H as PersonaSimulationPill, U as PersonaSurfaceControls, ee as PluginContextMenuTarget, d as PluginFooterStrip, X as PluginRoutes, Z as PluginSettingsPage, Q as PluginToolbar, $ as PluginWidgetGrid, A as ProductPickerSheet, W as ProductSideNav, C as ProductSwitcher, S as ProfileSwitcher, D as PushOptInToggle, t as ShortcutHelpDialog, h as SideNavigation, x as Sidebar, Y as StatusBar, ae as SwipeNavigation, b as Tabs, e as ThemePreferences, r as applyNavVisibility, i as applyPermissionFilter, a as applySurfaceVisibility, se as findNavTitle, M as firstProjectOfWorkspace, o as isItemEffectivelyShown, z as registerBreadcrumbName, F as resolveSwitchTarget, I as sectionLandingRule, te as selectMobileTabs, N as switchOrganization, P as switchWorkspace, B as unregisterBreadcrumbName, L as useContextSwitchController, ne as useMobileTabBarVisible, ce as useNativeTopBarTitle };
12
+ import { COMMAND_PALETTE_HELP_SHORTCUT as _, COMMAND_PALETTE_SHORTCUT as v, CommandPalette as y } from "./chrome/CommandPalette.js";
13
+ import { Breadcrumbs as b } from "./chrome/Breadcrumbs.js";
14
+ import { NavLink as x } from "./chrome/NavLink.js";
15
+ import { Tabs as S } from "./chrome/Tabs.js";
16
+ import { Sidebar as C } from "./chrome/Sidebar.js";
17
+ import { ProfileSwitcher as w } from "./chrome/ProfileSwitcher.js";
18
+ import { ProductSwitcher as T } from "./chrome/ProductSwitcher.js";
19
+ import { LanguageSwitcher as E } from "./chrome/LanguageSwitcher.js";
20
+ import { ContextSwitcher as D } from "./chrome/ContextSwitcher.js";
21
+ import { GeographySwitcher as O } from "./chrome/GeographySwitcher.js";
22
+ import { PushOptInToggle as k } from "./chrome/notificationCenter/PushOptInToggle.js";
23
+ import { NotificationCenter as A } from "./chrome/NotificationCenter.js";
24
+ import { LanguagePickerSheet as j } from "./chrome/LanguagePickerSheet.js";
25
+ import { ProductPickerSheet as M } from "./chrome/ProductPickerSheet.js";
26
+ import { AccountSwitcher as N } from "./chrome/AccountSwitcher.js";
27
+ import { firstProjectOfWorkspace as P, switchOrganization as F, switchWorkspace as I } from "./chrome/contextSwitcher/contextSwitch.js";
28
+ import { resolveSwitchTarget as L, sectionLandingRule as R } from "./chrome/contextSwitcher/resolveSwitchTarget.js";
29
+ import { useContextSwitchController as z } from "./chrome/contextSwitcher/useContextSwitchController.js";
30
+ import { AutoBreadcrumbs as B, registerBreadcrumbName as V, unregisterBreadcrumbName as H } from "./chrome/AutoBreadcrumbs.js";
31
+ import { NavCustomizeDialog as U } from "./chrome/NavCustomizeDialog.js";
32
+ import { PersonaSimulationPill as W, PersonaSurfaceControls as G } from "./chrome/PersonaSurfaceControls.js";
33
+ import { ProductSideNav as K } from "./chrome/ProductSideNav.js";
34
+ import { BrandMark as q } from "./chrome/BrandMark.js";
35
+ import { DynamicFooter as J } from "./chrome/DynamicFooter.js";
36
+ import { PanelTabs as Y } from "./chrome/PanelTabs.js";
37
+ import { PanelContainer as X } from "./chrome/PanelContainer.js";
38
+ import { StatusBar as Z } from "./chrome/StatusBar.js";
39
+ import { PluginRoutes as Q } from "./chrome/PluginRoutes.js";
40
+ import { PluginSettingsPage as $ } from "./chrome/PluginSettingsPage.js";
41
+ import { PluginToolbar as ee } from "./chrome/PluginToolbar.js";
42
+ import { PluginWidgetGrid as te } from "./chrome/PluginWidgetGrid.js";
43
+ import { PluginContextMenuTarget as ne } from "./chrome/PluginContextMenuTarget.js";
44
+ import { selectMobileTabs as re } from "./chrome/mobileTabBar/selectTabs.js";
45
+ import { useMobileTabBarVisible as ie } from "./chrome/mobileTabBar/useMobileTabBarVisible.js";
46
+ import { MobileTabBar as ae } from "./chrome/MobileTabBar.js";
47
+ import { NativeTopBar as oe } from "./chrome/NativeTopBar.js";
48
+ import { SwipeNavigation as se } from "./chrome/SwipeNavigation.js";
49
+ import { NativePageTransition as ce } from "./chrome/NativePageTransition.js";
50
+ import { findNavTitle as le, useNativeTopBarTitle as ue } from "./chrome/nativeTopBarTitle.js";
51
+ export { N as AccountSwitcher, s as AppShellLayout, B as AutoBreadcrumbs, q as BrandMark, b as Breadcrumbs, _ as COMMAND_PALETTE_HELP_SHORTCUT, v as COMMAND_PALETTE_SHORTCUT, y as CommandPalette, D as ContextSwitcher, f as DEFAULT_FOOTER_COLUMNS, p as DEFAULT_SOCIAL_LINKS, J as DynamicFooter, m as Footer, u as FooterBar, O as GeographySwitcher, g as GlobalSearch, l as HeaderBar, j as LanguagePickerSheet, E as LanguageSwitcher, ae as MobileTabBar, n as NAV_MORE_ID_PREFIX, ce as NativePageTransition, oe as NativeTopBar, U as NavCustomizeDialog, x as NavLink, A as NotificationCenter, c as PageHeader, X as PanelContainer, Y as PanelTabs, W as PersonaSimulationPill, G as PersonaSurfaceControls, ne as PluginContextMenuTarget, d as PluginFooterStrip, Q as PluginRoutes, $ as PluginSettingsPage, ee as PluginToolbar, te as PluginWidgetGrid, M as ProductPickerSheet, K as ProductSideNav, T as ProductSwitcher, w as ProfileSwitcher, k as PushOptInToggle, t as ShortcutHelpDialog, h as SideNavigation, C as Sidebar, Z as StatusBar, se as SwipeNavigation, S as Tabs, e as ThemePreferences, r as applyNavVisibility, i as applyPermissionFilter, a as applySurfaceVisibility, le as findNavTitle, P as firstProjectOfWorkspace, o as isItemEffectivelyShown, V as registerBreadcrumbName, L as resolveSwitchTarget, R as sectionLandingRule, re as selectMobileTabs, F as switchOrganization, I as switchWorkspace, H as unregisterBreadcrumbName, z as useContextSwitchController, ie as useMobileTabBarVisible, ue as useNativeTopBarTitle };
@@ -1,45 +1,49 @@
1
1
  import { graphqlFetch as e } from "../graphql/fetch.js";
2
2
  import "../../shared-graphql.js";
3
3
  import "./quota.js";
4
+ import { assistantProductHeaders as t } from "./productContext.js";
4
5
  //#region src/shared/assistant/gatewayClient.ts
5
- function t() {
6
+ function n() {
6
7
  try {
7
8
  return `bf-assistant-${crypto.randomUUID()}`;
8
9
  } catch {
9
10
  return `bf-assistant-${Date.now()}-${Math.random().toString(36).slice(2)}`;
10
11
  }
11
12
  }
12
- function n(e, t) {
13
+ function r(e, t) {
13
14
  return {
14
15
  workspaceId: e,
15
16
  ...t?.organizationId ? { custom: { organizationId: t.organizationId } } : {}
16
17
  };
17
18
  }
18
- async function r(n) {
19
- let r = await e({
19
+ async function i(r) {
20
+ let i = await e({
20
21
  gateway: "workspace",
21
- query: n.query,
22
- operationName: n.operationName,
23
- variables: n.variables,
24
- ...n.signal ? { signal: n.signal } : {},
25
- authToken: n.authContext?.accessToken ?? void 0,
22
+ query: r.query,
23
+ operationName: r.operationName,
24
+ variables: r.variables,
25
+ ...r.signal ? { signal: r.signal } : {},
26
+ authToken: r.authContext?.accessToken ?? void 0,
26
27
  workspaceToken: !0,
27
- workspaceId: n.workspaceId,
28
- organizationId: n.authContext?.organizationId ?? !0,
28
+ workspaceId: r.workspaceId,
29
+ organizationId: r.authContext?.organizationId ?? !0,
29
30
  suppressGlobalErrorEvent: !0,
30
- extraHeaders: { "x-request-id": t() }
31
+ extraHeaders: {
32
+ "x-request-id": n(),
33
+ ...t()
34
+ }
31
35
  });
32
- if (r.errors?.length) {
33
- let e = r.errors[0], t = Error(e.message);
36
+ if (i.errors?.length) {
37
+ let e = i.errors[0], t = Error(e.message);
34
38
  throw t.extensions = e.extensions, t;
35
39
  }
36
- if (r.data == null) throw Error("Sandbox GraphQL returned no data");
37
- return r.data;
40
+ if (i.data == null) throw Error("Sandbox GraphQL returned no data");
41
+ return i.data;
38
42
  }
39
- async function i(e) {
43
+ async function a(e) {
40
44
  let t;
41
45
  for (let n = 0; n < 3; n++) try {
42
- return await r(e);
46
+ return await i(e);
43
47
  } catch (e) {
44
48
  t = e;
45
49
  let r = e instanceof Error ? e.message.toLowerCase() : String(e).toLowerCase();
@@ -49,4 +53,4 @@ async function i(e) {
49
53
  throw t;
50
54
  }
51
55
  //#endregion
52
- export { n as buildSandboxContextInput, r as executeAssistantGraphQLOnce, i as executeSandboxGraphQL };
56
+ export { r as buildSandboxContextInput, i as executeAssistantGraphQLOnce, a as executeSandboxGraphQL };
@@ -33,6 +33,7 @@ export * from './useSandboxAssistantTransport';
33
33
  export * from './createSandboxAssistantTransport';
34
34
  export * from './runtime';
35
35
  export * from './gatewayClient';
36
+ export * from './productContext';
36
37
  export * from './progress';
37
38
  export * from './streamBudget';
38
39
  export * from './api';
@@ -0,0 +1,16 @@
1
+ /**
2
+ * The product the assistant runs in, sent as `x-product-id` on every
3
+ * assistant gateway call.
4
+ *
5
+ * The session relay re-sends the assistant's reads to the gateway with this
6
+ * product, and product-scoped services (wspace-workflow-svc) answer a read only
7
+ * when it names one: without it every FluidGrids read came back
8
+ * BAD_USER_INPUT. The shell registers its product while it is mounted
9
+ * (AppShellProvider), so the assistant code itself never names a product.
10
+ */
11
+ /** Register the shell's product; returns a disposer that clears it if it is still the one set. */
12
+ export declare function setAssistantProductId(productId: string | null | undefined): () => void;
13
+ /** The registered product, or null outside a shell (an MFE in isolation, a test). */
14
+ export declare function getAssistantProductId(): string | null;
15
+ /** The headers that carry the product, when one is registered. */
16
+ export declare function assistantProductHeaders(): Record<string, string>;
@@ -0,0 +1,16 @@
1
+ //#region src/shared/assistant/productContext.ts
2
+ var e = /^[a-z0-9](?:[a-z0-9-]{0,62}[a-z0-9])?$/, t = null;
3
+ function n(n) {
4
+ let r = typeof n == "string" && e.test(n) ? n : null;
5
+ return t = r, () => {
6
+ t === r && (t = null);
7
+ };
8
+ }
9
+ function r() {
10
+ return t;
11
+ }
12
+ function i() {
13
+ return t ? { "x-product-id": t } : {};
14
+ }
15
+ //#endregion
16
+ export { i as assistantProductHeaders, r as getAssistantProductId, n as setAssistantProductId };
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Why a search could not run. `search()` throws it so the search UI shows an
3
+ * error instead of an empty "No results found" that hides a backend outage.
4
+ * `reason` is `NO_WORKSPACE_CONTEXT` without an active workspace, `UNAVAILABLE`
5
+ * when the search request failed; `detail` keeps the backend message for logs.
6
+ */
7
+ export declare class GlobalSearchError extends Error {
8
+ readonly reason: "NO_WORKSPACE_CONTEXT" | "UNAVAILABLE";
9
+ readonly detail: string;
10
+ constructor(reason: "NO_WORKSPACE_CONTEXT" | "UNAVAILABLE", detail: string);
11
+ }
@@ -0,0 +1,10 @@
1
+ //#region src/shared/hooks/shell/globalSearchError.ts
2
+ var e = class extends Error {
3
+ reason;
4
+ detail;
5
+ constructor(e, t) {
6
+ super(e === "NO_WORKSPACE_CONTEXT" ? "Select a workspace to search it." : "Search is unavailable right now. Try again in a moment."), this.name = "GlobalSearchError", this.reason = e, this.detail = t;
7
+ }
8
+ };
9
+ //#endregion
10
+ export { e as GlobalSearchError };
@@ -1,4 +1,6 @@
1
1
  import { SearchResult, SearchResponse } from '../../types';
2
+ import { GlobalSearchError } from './globalSearchError';
3
+ export { GlobalSearchError };
2
4
  export type MetadataOperator = 'EQUALS' | 'NOT_EQUALS' | 'CONTAINS' | 'STARTS_WITH';
3
5
  /** Metadata condition for filtering search results */
4
6
  export interface MetadataCondition {
@@ -1,8 +1,9 @@
1
1
  import { graphqlFetch as e } from "../../graphql/fetch.js";
2
2
  import { useActiveContext as t } from "../../providers/shell/ActiveContextProvider.js";
3
- import { useCallback as n, useRef as r, useState as i } from "react";
3
+ import { GlobalSearchError as n } from "./globalSearchError.js";
4
+ import { useCallback as r, useRef as i, useState as a } from "react";
4
5
  //#region src/shared/hooks/shell/useGlobalSearch.ts
5
- var a = "\n query GlobalSearch(\n $query: String!\n $searchMode: GraphSearchMode\n $entityTypes: [String!]\n $excludeEntityTypes: [String!]\n $productSources: [String!]\n $workspaceId: ID\n $projectId: ID\n $createdBy: ID\n $updatedBy: ID\n $dateRange: GraphDateRangeInput\n $updatedDateRange: GraphDateRangeInput\n $metadataConditions: [GraphMetadataConditionInput!]\n $tagFilter: GraphTagFilterInput\n $excludeIds: [ID!]\n $sortBy: GraphSearchSortBy\n $limit: Int\n $offset: Int\n ) {\n globalSearch(\n query: $query\n searchMode: $searchMode\n entityTypes: $entityTypes\n excludeEntityTypes: $excludeEntityTypes\n productSources: $productSources\n workspaceId: $workspaceId\n projectId: $projectId\n createdBy: $createdBy\n updatedBy: $updatedBy\n dateRange: $dateRange\n updatedDateRange: $updatedDateRange\n metadataConditions: $metadataConditions\n tagFilter: $tagFilter\n excludeIds: $excludeIds\n sortBy: $sortBy\n limit: $limit\n offset: $offset\n ) {\n results {\n entityId\n entityType\n productSource\n title\n description\n score\n workspaceId\n projectId\n createdBy\n updatedBy\n metadata\n }\n total\n hasMore\n facets {\n byType { type count }\n byProduct { product count }\n byWorkspace { workspaceId count }\n }\n searchTimeMs\n }\n }\n", o = {
6
+ var o = "\n query GlobalSearch(\n $query: String!\n $searchMode: GraphSearchMode\n $entityTypes: [String!]\n $excludeEntityTypes: [String!]\n $productSources: [String!]\n $workspaceId: ID\n $projectId: ID\n $createdBy: ID\n $updatedBy: ID\n $dateRange: GraphDateRangeInput\n $updatedDateRange: GraphDateRangeInput\n $metadataConditions: [GraphMetadataConditionInput!]\n $tagFilter: GraphTagFilterInput\n $excludeIds: [ID!]\n $sortBy: GraphSearchSortBy\n $limit: Int\n $offset: Int\n ) {\n globalSearch(\n query: $query\n searchMode: $searchMode\n entityTypes: $entityTypes\n excludeEntityTypes: $excludeEntityTypes\n productSources: $productSources\n workspaceId: $workspaceId\n projectId: $projectId\n createdBy: $createdBy\n updatedBy: $updatedBy\n dateRange: $dateRange\n updatedDateRange: $updatedDateRange\n metadataConditions: $metadataConditions\n tagFilter: $tagFilter\n excludeIds: $excludeIds\n sortBy: $sortBy\n limit: $limit\n offset: $offset\n ) {\n results {\n entityId\n entityType\n productSource\n title\n description\n score\n workspaceId\n projectId\n createdBy\n updatedBy\n metadata\n }\n total\n hasMore\n facets {\n byType { type count }\n byProduct { product count }\n byWorkspace { workspaceId count }\n }\n searchTimeMs\n }\n }\n", s = {
6
7
  workspaces: ["workspace"],
7
8
  projects: ["project"],
8
9
  members: ["member", "user"],
@@ -151,16 +152,16 @@ var a = "\n query GlobalSearch(\n $query: String!\n $searchMode: GraphSea
151
152
  "ecoalertthreshold"
152
153
  ]
153
154
  };
154
- function s(e) {
155
- if (e) return o[e];
155
+ function c(e) {
156
+ if (e) return s[e];
156
157
  }
157
- var c = new Set([
158
+ var l = new Set([
158
159
  "datatable",
159
160
  "scheduledjob",
160
161
  "eventregistration",
161
162
  "variable"
162
163
  ]);
163
- function l(e, t) {
164
+ function u(e, t) {
164
165
  if (t?.productSource !== "module-workflow") return;
165
166
  let n = t.metadata?.workflowId;
166
167
  switch (e) {
@@ -171,8 +172,8 @@ function l(e, t) {
171
172
  default: return;
172
173
  }
173
174
  }
174
- function u(e, t, n, r) {
175
- let i = l(e.toLowerCase(), r);
175
+ function d(e, t, n, r) {
176
+ let i = u(e.toLowerCase(), r);
176
177
  if (i) return i;
177
178
  switch (e.toLowerCase()) {
178
179
  case "agent": return `/vibecontrols/agents/${t}`;
@@ -241,8 +242,8 @@ function u(e, t, n, r) {
241
242
  default: return `/entities/${e}/${t}`;
242
243
  }
243
244
  }
244
- function d(e, t) {
245
- if (t === "module-workflow" && c.has(e.toLowerCase())) return "workflows";
245
+ function f(e, t) {
246
+ if (t === "module-workflow" && l.has(e.toLowerCase())) return "workflows";
246
247
  switch (e.toLowerCase()) {
247
248
  case "workspace": return "workspaces";
248
249
  case "project": return "projects";
@@ -302,35 +303,35 @@ function d(e, t) {
302
303
  default: return e;
303
304
  }
304
305
  }
305
- var f = 20;
306
- function p() {
307
- let [o, c] = i(!1), l = r(null), { workspaceId: p } = t(), m = n(async (t, n, r) => {
306
+ var p = 20;
307
+ function m() {
308
+ let [s, l] = a(!1), u = i(null), { workspaceId: m } = t(), h = r(async (t, n, r) => {
308
309
  let i = t.trim();
309
310
  if (!i) return {
310
311
  results: [],
311
312
  total: 0,
312
313
  hasMore: !1
313
314
  };
314
- if (!p) return console.warn("[useGlobalSearch] No workspace context available — search requires an active workspace"), {
315
+ if (!m) return console.warn("[useGlobalSearch] No workspace context available — search requires an active workspace"), {
315
316
  results: [],
316
317
  total: 0,
317
318
  hasMore: !1,
318
319
  error: "NO_WORKSPACE_CONTEXT"
319
320
  };
320
- l.current && l.current.abort();
321
- let o = new AbortController();
322
- l.current = o, c(!0);
321
+ u.current && u.current.abort();
322
+ let a = new AbortController();
323
+ u.current = a, l(!0);
323
324
  try {
324
- let t = n ? s(n) : r?.entityTypes, c = await e({
325
+ let t = n ? c(n) : r?.entityTypes, s = await e({
325
326
  gateway: "workspace",
326
- query: a,
327
+ query: o,
327
328
  variables: {
328
329
  query: i,
329
330
  searchMode: r?.searchMode ?? "PARTIAL",
330
331
  entityTypes: t ?? void 0,
331
332
  excludeEntityTypes: r?.excludeEntityTypes ?? void 0,
332
333
  productSources: r?.productSources ?? void 0,
333
- workspaceId: p,
334
+ workspaceId: m,
334
335
  projectId: r?.projectId ?? void 0,
335
336
  createdBy: r?.createdBy ?? void 0,
336
337
  updatedBy: r?.updatedBy ?? void 0,
@@ -340,27 +341,27 @@ function p() {
340
341
  tagFilter: r?.tagFilter ?? void 0,
341
342
  excludeIds: r?.excludeIds ?? void 0,
342
343
  sortBy: r?.sortBy ?? void 0,
343
- limit: r?.limit ?? f,
344
+ limit: r?.limit ?? p,
344
345
  offset: r?.offset ?? 0
345
346
  },
346
347
  workspaceToken: !0,
347
- workspaceId: p,
348
- signal: o.signal
348
+ workspaceId: m,
349
+ signal: a.signal
349
350
  });
350
- if (c.errors?.length) return console.warn("[useGlobalSearch] GraphQL errors:", JSON.stringify(c.errors)), {
351
+ if (s.errors?.length) return console.warn("[useGlobalSearch] GraphQL errors:", JSON.stringify(s.errors)), {
351
352
  results: [],
352
353
  total: 0,
353
354
  hasMore: !1,
354
- error: c.errors.map((e) => e.message).join("; ")
355
+ error: s.errors.map((e) => e.message).join("; ")
355
356
  };
356
- let l = c.data?.globalSearch, m = (l?.results ?? []).map((e) => ({
357
+ let l = s.data?.globalSearch, u = (l?.results ?? []).map((e) => ({
357
358
  id: e.entityId,
358
359
  title: e.title,
359
360
  description: e.description ?? void 0,
360
- category: d(e.entityType, e.productSource),
361
+ category: f(e.entityType, e.productSource),
361
362
  entityType: e.entityType,
362
363
  productSource: e.productSource,
363
- href: u(e.entityType, e.entityId, e.workspaceId, {
364
+ href: d(e.entityType, e.entityId, e.workspaceId, {
364
365
  productSource: e.productSource,
365
366
  metadata: e.metadata
366
367
  }),
@@ -380,27 +381,36 @@ function p() {
380
381
  byWorkspace: l.facets.byWorkspace ?? []
381
382
  } : void 0;
382
383
  return {
383
- results: m,
384
- total: l?.total ?? m.length,
384
+ results: u,
385
+ total: l?.total ?? u.length,
385
386
  hasMore: l?.hasMore ?? !1,
386
387
  facets: h,
387
388
  searchTimeMs: l?.searchTimeMs ?? void 0
388
389
  };
389
390
  } catch (e) {
390
- return e instanceof DOMException && e.name === "AbortError" || console.warn("[useGlobalSearch] Search failed:", e), {
391
+ return e instanceof DOMException && e.name === "AbortError" ? {
391
392
  results: [],
392
393
  total: 0,
393
394
  hasMore: !1
394
- };
395
+ } : (console.warn("[useGlobalSearch] Search failed:", e), {
396
+ results: [],
397
+ total: 0,
398
+ hasMore: !1,
399
+ error: e instanceof Error ? e.message : String(e)
400
+ });
395
401
  } finally {
396
- l.current === o && c(!1);
402
+ u.current === a && l(!1);
397
403
  }
398
- }, [p]);
404
+ }, [m]);
399
405
  return {
400
- searchFull: m,
401
- search: n(async (e, t, n) => (await m(e, t, n)).results, [m]),
402
- isSearching: o
406
+ searchFull: h,
407
+ search: r(async (e, t, r) => {
408
+ let i = await h(e, t, r);
409
+ if (i.error) throw new n(i.error === "NO_WORKSPACE_CONTEXT" ? "NO_WORKSPACE_CONTEXT" : "UNAVAILABLE", i.error);
410
+ return i.results;
411
+ }, [h]),
412
+ isSearching: s
403
413
  };
404
414
  }
405
415
  //#endregion
406
- export { p as useGlobalSearch };
416
+ export { m as useGlobalSearch };
@@ -0,0 +1,33 @@
1
+ /**
2
+ * Same-origin, in-app navigation helpers with no native dependency, so the
3
+ * shell chrome (statically imported by microfrontends) can use them without
4
+ * pulling `@capacitor/*` in. `shell-native` deep links share `isSafeInAppPath`.
5
+ */
6
+ /**
7
+ * True for a same-origin, in-app path: `/x`, `/x?y#z`. Refuses protocol-relative
8
+ * (`//host`, `/\host`) and anything that is not a rooted path, so a deep link or
9
+ * a notification payload can never steer the page to another origin.
10
+ */
11
+ export declare function isSafeInAppPath(path: string): boolean;
12
+ /**
13
+ * The in-app path a link points at, or null when it leaves the app: a rooted
14
+ * path is taken as is; an absolute URL only when its origin is `origin`.
15
+ */
16
+ export declare function toInAppPath(url: string, origin: string): string | null;
17
+ /** The window members in-app navigation uses (a seam for tests). */
18
+ export interface InAppNavigationWindow {
19
+ location: {
20
+ origin: string;
21
+ };
22
+ history: {
23
+ pushState: (data: unknown, unused: string, url?: string | null) => void;
24
+ };
25
+ dispatchEvent: (event: Event) => boolean;
26
+ }
27
+ /**
28
+ * Navigate inside the app without a reload: push the path and announce it with
29
+ * `popstate`, which React Router's browser history and `ActiveContextProvider`
30
+ * (for `?org/workspace/project/tenant`) both listen to. Returns false, and does
31
+ * nothing, when `url` leaves the app — the caller then opens it in a new tab.
32
+ */
33
+ export declare function navigateInApp(url: string, win?: InAppNavigationWindow | undefined): boolean;
@@ -0,0 +1,32 @@
1
+ //#region src/shared/navigation/inAppPath.ts
2
+ function e(e) {
3
+ if (typeof e != "string" || !e.startsWith("/") || e.startsWith("//") || e.startsWith("/\\")) return !1;
4
+ for (let t = 0; t < e.length; t += 1) {
5
+ let n = e.charCodeAt(t);
6
+ if (n < 32 || n === 127) return !1;
7
+ }
8
+ return !0;
9
+ }
10
+ function t(t, n) {
11
+ if (typeof t != "string" || t.length === 0) return null;
12
+ if (t.startsWith("/")) return e(t) ? t : null;
13
+ let r;
14
+ try {
15
+ r = new URL(t);
16
+ } catch {
17
+ return null;
18
+ }
19
+ if (r.origin !== n) return null;
20
+ let i = `${r.pathname || "/"}${r.search}${r.hash}`;
21
+ return e(i) ? i : null;
22
+ }
23
+ function n(e, n = globalThis.window) {
24
+ if (!n) return !1;
25
+ let r = t(e, n.location.origin);
26
+ if (r === null) return !1;
27
+ n.history.pushState(null, "", r);
28
+ let i = typeof PopStateEvent == "function" ? new PopStateEvent("popstate", { state: null }) : new Event("popstate");
29
+ return n.dispatchEvent(i), !0;
30
+ }
31
+ //#endregion
32
+ export { e as isSafeInAppPath, n as navigateInApp };