@burdenoff/fe-libs 2026.1021.15 → 2026.1022.1
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.
|
@@ -71,16 +71,25 @@ export interface UseGlobalSearchReturn {
|
|
|
71
71
|
*/
|
|
72
72
|
export declare const CATEGORY_ENTITY_TYPE_MAP: Record<string, string[]>;
|
|
73
73
|
export declare function resolveEntityTypesForCategory(category?: string): string[] | undefined;
|
|
74
|
+
/** Product source of the FluidGrids entities wspace-workflow-svc indexes. */
|
|
75
|
+
export declare const FLUIDGRIDS_SEARCH_PRODUCT_SOURCE = "module-workflow";
|
|
76
|
+
/** Optional result context some product entities need to build their link. */
|
|
77
|
+
export interface SearchHrefContext {
|
|
78
|
+
/** `productSource` of the result: disambiguates entity type names shared across products. */
|
|
79
|
+
productSource?: string | null;
|
|
80
|
+
/** The result's search metadata (whitelisted entity fields). */
|
|
81
|
+
metadata?: Record<string, unknown> | null;
|
|
82
|
+
}
|
|
74
83
|
/**
|
|
75
84
|
* Derive a navigation href from an entity type and ID.
|
|
76
85
|
* Follows the shell's route structure. Exported for unit testing.
|
|
77
86
|
*/
|
|
78
|
-
export declare function buildHref(entityType: string, entityId: string, workspaceId?: string | null): string;
|
|
87
|
+
export declare function buildHref(entityType: string, entityId: string, workspaceId?: string | null, context?: SearchHrefContext): string;
|
|
79
88
|
/**
|
|
80
89
|
* Map backend entity type to a human-readable category label for grouping.
|
|
81
90
|
* Exported for unit testing.
|
|
82
91
|
*/
|
|
83
|
-
export declare function mapEntityTypeToCategory(entityType: string): string;
|
|
92
|
+
export declare function mapEntityTypeToCategory(entityType: string, productSource?: string | null): string;
|
|
84
93
|
/**
|
|
85
94
|
* Global search hook — single entry point for all search operations.
|
|
86
95
|
*
|
|
@@ -52,6 +52,14 @@ var a = "\n query GlobalSearch(\n $query: String!\n $searchMode: GraphSea
|
|
|
52
52
|
actions: ["Action", "action"],
|
|
53
53
|
vibedecks: ["VibeDeck", "vibedeck"],
|
|
54
54
|
security: ["vault", "secret"],
|
|
55
|
+
workflows: [
|
|
56
|
+
"WorkflowDefinition",
|
|
57
|
+
"WorkflowRun",
|
|
58
|
+
"DataTable",
|
|
59
|
+
"ScheduledJob",
|
|
60
|
+
"EventRegistration",
|
|
61
|
+
"Variable"
|
|
62
|
+
],
|
|
55
63
|
providers: [
|
|
56
64
|
"SubProvider",
|
|
57
65
|
"subProvider",
|
|
@@ -146,7 +154,26 @@ var a = "\n query GlobalSearch(\n $query: String!\n $searchMode: GraphSea
|
|
|
146
154
|
function s(e) {
|
|
147
155
|
if (e) return o[e];
|
|
148
156
|
}
|
|
149
|
-
|
|
157
|
+
var c = new Set([
|
|
158
|
+
"datatable",
|
|
159
|
+
"scheduledjob",
|
|
160
|
+
"eventregistration",
|
|
161
|
+
"variable"
|
|
162
|
+
]);
|
|
163
|
+
function l(e, t) {
|
|
164
|
+
if (t?.productSource !== "module-workflow") return;
|
|
165
|
+
let n = t.metadata?.workflowId;
|
|
166
|
+
switch (e) {
|
|
167
|
+
case "datatable": return "/workflows/data-tables";
|
|
168
|
+
case "variable": return "/workflows/variables";
|
|
169
|
+
case "scheduledjob":
|
|
170
|
+
case "eventregistration": return typeof n == "string" && n ? `/workflows/resolve/${encodeURIComponent(n)}` : "/workflows/list";
|
|
171
|
+
default: return;
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
function u(e, t, n, r) {
|
|
175
|
+
let i = l(e.toLowerCase(), r);
|
|
176
|
+
if (i) return i;
|
|
150
177
|
switch (e.toLowerCase()) {
|
|
151
178
|
case "agent": return `/vibecontrols/agents/${t}`;
|
|
152
179
|
case "vibe": return `/vibecontrols/vibes/${t}`;
|
|
@@ -214,7 +241,8 @@ function c(e, t, n) {
|
|
|
214
241
|
default: return `/entities/${e}/${t}`;
|
|
215
242
|
}
|
|
216
243
|
}
|
|
217
|
-
function
|
|
244
|
+
function d(e, t) {
|
|
245
|
+
if (t === "module-workflow" && c.has(e.toLowerCase())) return "workflows";
|
|
218
246
|
switch (e.toLowerCase()) {
|
|
219
247
|
case "workspace": return "workspaces";
|
|
220
248
|
case "project": return "projects";
|
|
@@ -274,9 +302,9 @@ function l(e) {
|
|
|
274
302
|
default: return e;
|
|
275
303
|
}
|
|
276
304
|
}
|
|
277
|
-
var
|
|
278
|
-
function
|
|
279
|
-
let [o,
|
|
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) => {
|
|
280
308
|
let i = t.trim();
|
|
281
309
|
if (!i) return {
|
|
282
310
|
results: [],
|
|
@@ -289,11 +317,11 @@ function d() {
|
|
|
289
317
|
hasMore: !1,
|
|
290
318
|
error: "NO_WORKSPACE_CONTEXT"
|
|
291
319
|
};
|
|
292
|
-
|
|
320
|
+
l.current && l.current.abort();
|
|
293
321
|
let o = new AbortController();
|
|
294
|
-
|
|
322
|
+
l.current = o, c(!0);
|
|
295
323
|
try {
|
|
296
|
-
let t = n ? s(n) : r?.entityTypes,
|
|
324
|
+
let t = n ? s(n) : r?.entityTypes, c = await e({
|
|
297
325
|
gateway: "workspace",
|
|
298
326
|
query: a,
|
|
299
327
|
variables: {
|
|
@@ -312,27 +340,30 @@ function d() {
|
|
|
312
340
|
tagFilter: r?.tagFilter ?? void 0,
|
|
313
341
|
excludeIds: r?.excludeIds ?? void 0,
|
|
314
342
|
sortBy: r?.sortBy ?? void 0,
|
|
315
|
-
limit: r?.limit ??
|
|
343
|
+
limit: r?.limit ?? f,
|
|
316
344
|
offset: r?.offset ?? 0
|
|
317
345
|
},
|
|
318
346
|
workspaceToken: !0,
|
|
319
347
|
workspaceId: p,
|
|
320
348
|
signal: o.signal
|
|
321
349
|
});
|
|
322
|
-
if (
|
|
350
|
+
if (c.errors?.length) return console.warn("[useGlobalSearch] GraphQL errors:", JSON.stringify(c.errors)), {
|
|
323
351
|
results: [],
|
|
324
352
|
total: 0,
|
|
325
353
|
hasMore: !1,
|
|
326
|
-
error:
|
|
354
|
+
error: c.errors.map((e) => e.message).join("; ")
|
|
327
355
|
};
|
|
328
|
-
let
|
|
356
|
+
let l = c.data?.globalSearch, m = (l?.results ?? []).map((e) => ({
|
|
329
357
|
id: e.entityId,
|
|
330
358
|
title: e.title,
|
|
331
359
|
description: e.description ?? void 0,
|
|
332
|
-
category:
|
|
360
|
+
category: d(e.entityType, e.productSource),
|
|
333
361
|
entityType: e.entityType,
|
|
334
362
|
productSource: e.productSource,
|
|
335
|
-
href:
|
|
363
|
+
href: u(e.entityType, e.entityId, e.workspaceId, {
|
|
364
|
+
productSource: e.productSource,
|
|
365
|
+
metadata: e.metadata
|
|
366
|
+
}),
|
|
336
367
|
score: e.score,
|
|
337
368
|
workspaceId: e.workspaceId ?? void 0,
|
|
338
369
|
createdBy: e.createdBy ?? void 0,
|
|
@@ -343,17 +374,17 @@ function d() {
|
|
|
343
374
|
author: e.metadata.author ?? void 0,
|
|
344
375
|
tags: e.metadata.tags ?? void 0
|
|
345
376
|
} : void 0
|
|
346
|
-
})), h =
|
|
347
|
-
byType:
|
|
348
|
-
byProduct:
|
|
349
|
-
byWorkspace:
|
|
377
|
+
})), h = l?.facets ? {
|
|
378
|
+
byType: l.facets.byType ?? [],
|
|
379
|
+
byProduct: l.facets.byProduct ?? [],
|
|
380
|
+
byWorkspace: l.facets.byWorkspace ?? []
|
|
350
381
|
} : void 0;
|
|
351
382
|
return {
|
|
352
383
|
results: m,
|
|
353
|
-
total:
|
|
354
|
-
hasMore:
|
|
384
|
+
total: l?.total ?? m.length,
|
|
385
|
+
hasMore: l?.hasMore ?? !1,
|
|
355
386
|
facets: h,
|
|
356
|
-
searchTimeMs:
|
|
387
|
+
searchTimeMs: l?.searchTimeMs ?? void 0
|
|
357
388
|
};
|
|
358
389
|
} catch (e) {
|
|
359
390
|
return e instanceof DOMException && e.name === "AbortError" || console.warn("[useGlobalSearch] Search failed:", e), {
|
|
@@ -362,7 +393,7 @@ function d() {
|
|
|
362
393
|
hasMore: !1
|
|
363
394
|
};
|
|
364
395
|
} finally {
|
|
365
|
-
|
|
396
|
+
l.current === o && c(!1);
|
|
366
397
|
}
|
|
367
398
|
}, [p]);
|
|
368
399
|
return {
|
|
@@ -372,4 +403,4 @@ function d() {
|
|
|
372
403
|
};
|
|
373
404
|
}
|
|
374
405
|
//#endregion
|
|
375
|
-
export {
|
|
406
|
+
export { p as useGlobalSearch };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@burdenoff/fe-libs",
|
|
3
|
-
"version": "2026.
|
|
3
|
+
"version": "2026.1022.1",
|
|
4
4
|
"description": "Burdenoff frontend primitives and domain libraries",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -330,7 +330,7 @@
|
|
|
330
330
|
"test:package-livekit-optional": "node scripts/validate-livekit-optional.mjs",
|
|
331
331
|
"verify:package": "node scripts/verify-package-contents.mjs",
|
|
332
332
|
"test:handsfree-browser": "node scripts/handsfree-browser-run.mjs",
|
|
333
|
-
"test": "bun test scripts/graphql-schema-drift/__tests__ scripts/a11y-audit/__tests__ scripts/i18n/__tests__ src/credentials src/connections src/storage src/shared/assistant src/shared/feature-flags src/platform-pages src/admin-overview src/shared/components src/shared/graphql/links/sse-link.test.ts src/shared/graphql/fetch.test.ts src/shared/graphql/prepareWorkspaceRequest.test.ts src/shared/graphql/client.test.ts src/shared/utils/apollo.test.ts src/shared/utils/canvasTokens.test.ts src/shared/graphql/tourWorkspaceAuth.test.ts src/shared/config/gatewayUrls.test.ts src/shared/config/authBridgeUrls.test.ts src/shared/config/shellRoutes.test.ts src/shared/config/gatewayFallback.test.ts scripts/__tests__ src/shared/config/products.test.ts src/shared/config/docsUrls.test.ts src/shared/config/productSlug.test.ts src/shared/hooks/shell/useProducts.test.ts src/shared/providers/shell/brandAttribute.test.ts src/chrome/ProductSwitcher.test.ts src/shared/utils/gatewayFetchRewrite.test.ts src/shared/utils/authCookie.test.ts src/shared/utils/redirectAllowlist.test.ts src/shared/providers/shell/ProfileStorageManager.test.ts src/shared/providers/AppShellProvider.test.ts src/shared/providers/shell/interpolate.test.ts src/shared/providers/shell/resolveTranslation.test.ts src/shared/providers/shell/I18nProvider.render.test.tsx src/shared/providers/shell/I18nProvider.client.test.tsx src/shared/providers/shell/translationStore.test.ts src/shared/providers/shell/translationLayers.test.ts src/shared/providers/shell/directionMode.test.ts src/shared/providers/shell/authProvider/ssoRelay.test.ts src/shared/providers/shell/authProvider/useAuthActions.signOut.test.tsx src/shared/providers/shell/personaSurfaceRemote.test.ts src/shared/providers/shell/workspaceSwitch.client.test.tsx src/shared/events/sinks/RybbitSink.test.ts src/shared/events/sinks/RybbitSink.client.test.tsx src/shell-native src/shared/native src/shared/navigation src/shared/tours src/chrome/__tests__ src/ui/__tests__",
|
|
333
|
+
"test": "bun test scripts/graphql-schema-drift/__tests__ scripts/a11y-audit/__tests__ scripts/i18n/__tests__ src/credentials src/connections src/storage src/shared/assistant src/shared/feature-flags src/platform-pages src/admin-overview src/shared/components src/shared/graphql/links/sse-link.test.ts src/shared/graphql/fetch.test.ts src/shared/graphql/prepareWorkspaceRequest.test.ts src/shared/graphql/client.test.ts src/shared/utils/apollo.test.ts src/shared/utils/canvasTokens.test.ts src/shared/graphql/tourWorkspaceAuth.test.ts src/shared/config/gatewayUrls.test.ts src/shared/config/authBridgeUrls.test.ts src/shared/config/shellRoutes.test.ts src/shared/config/gatewayFallback.test.ts scripts/__tests__ src/shared/config/products.test.ts src/shared/config/docsUrls.test.ts src/shared/config/productSlug.test.ts src/shared/hooks/shell/useProducts.test.ts src/shared/hooks/shell/useGlobalSearch.test.ts src/shared/providers/shell/brandAttribute.test.ts src/chrome/ProductSwitcher.test.ts src/shared/utils/gatewayFetchRewrite.test.ts src/shared/utils/authCookie.test.ts src/shared/utils/redirectAllowlist.test.ts src/shared/providers/shell/ProfileStorageManager.test.ts src/shared/providers/AppShellProvider.test.ts src/shared/providers/shell/interpolate.test.ts src/shared/providers/shell/resolveTranslation.test.ts src/shared/providers/shell/I18nProvider.render.test.tsx src/shared/providers/shell/I18nProvider.client.test.tsx src/shared/providers/shell/translationStore.test.ts src/shared/providers/shell/translationLayers.test.ts src/shared/providers/shell/directionMode.test.ts src/shared/providers/shell/authProvider/ssoRelay.test.ts src/shared/providers/shell/authProvider/useAuthActions.signOut.test.tsx src/shared/providers/shell/personaSurfaceRemote.test.ts src/shared/providers/shell/workspaceSwitch.client.test.tsx src/shared/events/sinks/RybbitSink.test.ts src/shared/events/sinks/RybbitSink.client.test.tsx src/shell-native src/shared/native src/shared/navigation src/shared/tours src/chrome/__tests__ src/ui/__tests__",
|
|
334
334
|
"sanity": "bash scripts/build-limits.sh --gate bash -c 'bun run lint:sanity && bun run format && bun run type:check && bun run test && bun run build && bun run verify:package'",
|
|
335
335
|
"switch:status": "bun scripts/deps-mode.ts status",
|
|
336
336
|
"switch:remote": "bun scripts/deps-mode.ts remote",
|