@wildo-ai/saas-frontend-lib 1.1.16 → 1.1.17
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/esm/components/compliance/EmbeddedSigningFrame.d.ts.map +1 -1
- package/dist/esm/components/compliance/EmbeddedSigningFrame.js +17 -6
- package/dist/esm/components/compliance/EmbeddedSigningFrame.js.map +1 -1
- package/dist/esm/components/data-display/approval-seal.d.ts +7 -5
- package/dist/esm/components/data-display/approval-seal.d.ts.map +1 -1
- package/dist/esm/components/data-display/approval-seal.js +10 -4
- package/dist/esm/components/data-display/approval-seal.js.map +1 -1
- package/dist/esm/components/data-display/signature-requests.d.ts +81 -0
- package/dist/esm/components/data-display/signature-requests.d.ts.map +1 -0
- package/dist/esm/components/data-display/signature-requests.js +123 -0
- package/dist/esm/components/data-display/signature-requests.js.map +1 -0
- package/dist/esm/components/flows-actors/approval.d.ts.map +1 -1
- package/dist/esm/components/flows-actors/approval.js +8 -15
- package/dist/esm/components/flows-actors/approval.js.map +1 -1
- package/dist/esm/components/form/automated/ResourceAutomatedForm.d.ts.map +1 -1
- package/dist/esm/components/form/automated/ResourceAutomatedForm.js +44 -29
- package/dist/esm/components/form/automated/ResourceAutomatedForm.js.map +1 -1
- package/dist/esm/components/navigation/NavigationItemBadge.d.ts +16 -0
- package/dist/esm/components/navigation/NavigationItemBadge.d.ts.map +1 -1
- package/dist/esm/components/navigation/NavigationItemBadge.js +14 -2
- package/dist/esm/components/navigation/NavigationItemBadge.js.map +1 -1
- package/dist/esm/components/navigation/app-level/ApplicationLevel_NavigationBack.d.ts +3 -3
- package/dist/esm/components/navigation/app-level/ApplicationLevel_NavigationBack.js +3 -3
- package/dist/esm/components/navigation/app-level/ApplicationLevel_NavigationBack.js.map +1 -1
- package/dist/esm/components/navigation/app-level/SidebarResourceBrowser.d.ts +5 -13
- package/dist/esm/components/navigation/app-level/SidebarResourceBrowser.d.ts.map +1 -1
- package/dist/esm/components/navigation/app-level/SidebarResourceBrowser.js +30 -255
- package/dist/esm/components/navigation/app-level/SidebarResourceBrowser.js.map +1 -1
- package/dist/esm/components/navigation/app-level/useCommandMenuBehavior.d.ts +22 -1
- package/dist/esm/components/navigation/app-level/useCommandMenuBehavior.d.ts.map +1 -1
- package/dist/esm/components/navigation/app-level/useCommandMenuBehavior.js +57 -26
- package/dist/esm/components/navigation/app-level/useCommandMenuBehavior.js.map +1 -1
- package/dist/esm/components/navigation/app-level/useMenuBarBehavior.d.ts +1 -1
- package/dist/esm/components/navigation/app-level/useMenuBarBehavior.d.ts.map +1 -1
- package/dist/esm/components/navigation/app-level/useMenuBarBehavior.js +35 -1
- package/dist/esm/components/navigation/app-level/useMenuBarBehavior.js.map +1 -1
- package/dist/esm/components/navigation/app-level/useMenuUserOrgBehavior.d.ts +1 -1
- package/dist/esm/components/navigation/app-level/useMenuUserOrgBehavior.d.ts.map +1 -1
- package/dist/esm/components/navigation/app-level/useMenuUserOrgBehavior.js +26 -4
- package/dist/esm/components/navigation/app-level/useMenuUserOrgBehavior.js.map +1 -1
- package/dist/esm/components/navigation/app-level/useNavigationBackBehavior.d.ts +31 -0
- package/dist/esm/components/navigation/app-level/useNavigationBackBehavior.d.ts.map +1 -0
- package/dist/esm/components/navigation/app-level/useNavigationBackBehavior.js +42 -0
- package/dist/esm/components/navigation/app-level/useNavigationBackBehavior.js.map +1 -0
- package/dist/esm/components/navigation/app-level/useSidebarResourceBrowser.d.ts +76 -0
- package/dist/esm/components/navigation/app-level/useSidebarResourceBrowser.d.ts.map +1 -0
- package/dist/esm/components/navigation/app-level/useSidebarResourceBrowser.js +268 -0
- package/dist/esm/components/navigation/app-level/useSidebarResourceBrowser.js.map +1 -0
- package/dist/esm/components/navigation/command.d.ts +5 -0
- package/dist/esm/components/navigation/command.d.ts.map +1 -1
- package/dist/esm/components/navigation/command.js.map +1 -1
- package/dist/esm/components/resources/ResourceLayout_DangerZone.d.ts.map +1 -1
- package/dist/esm/components/resources/ResourceLayout_DangerZone.js +5 -2
- package/dist/esm/components/resources/ResourceLayout_DangerZone.js.map +1 -1
- package/dist/esm/components/resources/ResourceLayout_InsertedViews.d.ts.map +1 -1
- package/dist/esm/components/resources/ResourceLayout_InsertedViews.js +5 -1
- package/dist/esm/components/resources/ResourceLayout_InsertedViews.js.map +1 -1
- package/dist/esm/components/resources/ResourceLayout_List.d.ts.map +1 -1
- package/dist/esm/components/resources/ResourceLayout_List.js +4 -1
- package/dist/esm/components/resources/ResourceLayout_List.js.map +1 -1
- package/dist/esm/components/resources/ResourceLayout_RecordSharing.d.ts.map +1 -1
- package/dist/esm/components/resources/ResourceLayout_RecordSharing.js +4 -1
- package/dist/esm/components/resources/ResourceLayout_RecordSharing.js.map +1 -1
- package/dist/esm/components/resources/collection/board/ResourceCollectionBody_Board.d.ts.map +1 -1
- package/dist/esm/components/resources/collection/board/ResourceCollectionBody_Board.js +4 -1
- package/dist/esm/components/resources/collection/board/ResourceCollectionBody_Board.js.map +1 -1
- package/dist/esm/components/resources/collection/calendar/ResourceCollectionBody_Calendar.d.ts.map +1 -1
- package/dist/esm/components/resources/collection/calendar/ResourceCollectionBody_Calendar.js +4 -1
- package/dist/esm/components/resources/collection/calendar/ResourceCollectionBody_Calendar.js.map +1 -1
- package/dist/esm/components/resources/collection/timeline/ResourceCollectionBody_Timeline.d.ts.map +1 -1
- package/dist/esm/components/resources/collection/timeline/ResourceCollectionBody_Timeline.js +4 -1
- package/dist/esm/components/resources/collection/timeline/ResourceCollectionBody_Timeline.js.map +1 -1
- package/dist/esm/components/resources/skeleton/Group.d.ts.map +1 -1
- package/dist/esm/components/resources/skeleton/Group.js +4 -1
- package/dist/esm/components/resources/skeleton/Group.js.map +1 -1
- package/dist/esm/components/sections/ContentSectionContainer.d.ts.map +1 -1
- package/dist/esm/components/sections/ContentSectionContainer.js +11 -7
- package/dist/esm/components/sections/ContentSectionContainer.js.map +1 -1
- package/dist/esm/components/sections/content-section.d.ts +1 -3
- package/dist/esm/components/sections/content-section.d.ts.map +1 -1
- package/dist/esm/components/sections/content-section.js.map +1 -1
- package/dist/esm/components/settings/AppPage_AgentActivitySettings.d.ts.map +1 -1
- package/dist/esm/components/settings/AppPage_AgentActivitySettings.js +2 -1
- package/dist/esm/components/settings/AppPage_AgentActivitySettings.js.map +1 -1
- package/dist/esm/components/settings/AppPage_ConnectedAccountsSettings.d.ts +12 -0
- package/dist/esm/components/settings/AppPage_ConnectedAccountsSettings.d.ts.map +1 -1
- package/dist/esm/components/settings/AppPage_ConnectedAccountsSettings.js +28 -6
- package/dist/esm/components/settings/AppPage_ConnectedAccountsSettings.js.map +1 -1
- package/dist/esm/components/typography/document-heading-level.d.ts +28 -0
- package/dist/esm/components/typography/document-heading-level.d.ts.map +1 -0
- package/dist/esm/components/typography/document-heading-level.js +63 -0
- package/dist/esm/components/typography/document-heading-level.js.map +1 -0
- package/dist/esm/components/views/chart-view/ChartView.d.ts.map +1 -1
- package/dist/esm/components/views/chart-view/ChartView.js +20 -16
- package/dist/esm/components/views/chart-view/ChartView.js.map +1 -1
- package/dist/esm/components/views/chart-view/ChartView.labels.d.ts.map +1 -1
- package/dist/esm/components/views/chart-view/ChartView.labels.js +7 -0
- package/dist/esm/components/views/chart-view/ChartView.labels.js.map +1 -1
- package/dist/esm/components/views/chart-view/option-builder/builder-utils.d.ts +12 -3
- package/dist/esm/components/views/chart-view/option-builder/builder-utils.d.ts.map +1 -1
- package/dist/esm/components/views/chart-view/option-builder/builder-utils.js +18 -11
- package/dist/esm/components/views/chart-view/option-builder/builder-utils.js.map +1 -1
- package/dist/esm/components/views/chart-view/option-builder/builders/bar-family.builder.d.ts.map +1 -1
- package/dist/esm/components/views/chart-view/option-builder/builders/bar-family.builder.js +2 -1
- package/dist/esm/components/views/chart-view/option-builder/builders/bar-family.builder.js.map +1 -1
- package/dist/esm/components/views/chart-view/option-builder/builders/funnel.builder.d.ts.map +1 -1
- package/dist/esm/components/views/chart-view/option-builder/builders/funnel.builder.js +7 -3
- package/dist/esm/components/views/chart-view/option-builder/builders/funnel.builder.js.map +1 -1
- package/dist/esm/components/views/chart-view/option-builder/builders/gauge.builder.d.ts.map +1 -1
- package/dist/esm/components/views/chart-view/option-builder/builders/gauge.builder.js +6 -2
- package/dist/esm/components/views/chart-view/option-builder/builders/gauge.builder.js.map +1 -1
- package/dist/esm/components/views/chart-view/option-builder/builders/heatmap.builder.d.ts.map +1 -1
- package/dist/esm/components/views/chart-view/option-builder/builders/heatmap.builder.js +7 -1
- package/dist/esm/components/views/chart-view/option-builder/builders/heatmap.builder.js.map +1 -1
- package/dist/esm/components/views/chart-view/option-builder/builders/hierarchical-family.builder.d.ts.map +1 -1
- package/dist/esm/components/views/chart-view/option-builder/builders/hierarchical-family.builder.js +13 -9
- package/dist/esm/components/views/chart-view/option-builder/builders/hierarchical-family.builder.js.map +1 -1
- package/dist/esm/components/views/chart-view/option-builder/builders/line-family.builder.d.ts.map +1 -1
- package/dist/esm/components/views/chart-view/option-builder/builders/line-family.builder.js +2 -1
- package/dist/esm/components/views/chart-view/option-builder/builders/line-family.builder.js.map +1 -1
- package/dist/esm/components/views/chart-view/option-builder/builders/parallel.builder.d.ts.map +1 -1
- package/dist/esm/components/views/chart-view/option-builder/builders/parallel.builder.js +2 -1
- package/dist/esm/components/views/chart-view/option-builder/builders/parallel.builder.js.map +1 -1
- package/dist/esm/components/views/chart-view/option-builder/builders/pie-family.builder.d.ts.map +1 -1
- package/dist/esm/components/views/chart-view/option-builder/builders/pie-family.builder.js +4 -3
- package/dist/esm/components/views/chart-view/option-builder/builders/pie-family.builder.js.map +1 -1
- package/dist/esm/components/views/chart-view/option-builder/builders/radar.builder.d.ts.map +1 -1
- package/dist/esm/components/views/chart-view/option-builder/builders/radar.builder.js +2 -1
- package/dist/esm/components/views/chart-view/option-builder/builders/radar.builder.js.map +1 -1
- package/dist/esm/components/views/chart-view/option-builder/builders/sankey.builder.d.ts.map +1 -1
- package/dist/esm/components/views/chart-view/option-builder/builders/sankey.builder.js +5 -1
- package/dist/esm/components/views/chart-view/option-builder/builders/sankey.builder.js.map +1 -1
- package/dist/esm/components/views/chart-view/option-builder/builders/statistical-family.builder.d.ts.map +1 -1
- package/dist/esm/components/views/chart-view/option-builder/builders/statistical-family.builder.js +4 -3
- package/dist/esm/components/views/chart-view/option-builder/builders/statistical-family.builder.js.map +1 -1
- package/dist/esm/core/app-shell/app-shell.schemas.d.ts +87 -16
- package/dist/esm/core/app-shell/app-shell.schemas.d.ts.map +1 -1
- package/dist/esm/core/app-shell/app-shell.schemas.js +16 -0
- package/dist/esm/core/app-shell/app-shell.schemas.js.map +1 -1
- package/dist/esm/core/requests/wildo-http-client-manual-calls.frontend.service.d.ts +39 -4
- package/dist/esm/core/requests/wildo-http-client-manual-calls.frontend.service.d.ts.map +1 -1
- package/dist/esm/core/requests/wildo-http-client-manual-calls.frontend.service.js +33 -1
- package/dist/esm/core/requests/wildo-http-client-manual-calls.frontend.service.js.map +1 -1
- package/dist/esm/core/resources/hooks/useOperationEnabled.d.ts.map +1 -1
- package/dist/esm/core/resources/hooks/useOperationEnabled.js +41 -3
- package/dist/esm/core/resources/hooks/useOperationEnabled.js.map +1 -1
- package/dist/esm/core/search/command-score.d.ts +33 -0
- package/dist/esm/core/search/command-score.d.ts.map +1 -0
- package/dist/esm/core/search/command-score.js +109 -0
- package/dist/esm/core/search/command-score.js.map +1 -0
- package/dist/esm/index.d.ts +5 -0
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +5 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +6 -6
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
+
import { type NotificationBadgeDefinition } from '@wildo-ai/saas-models';
|
|
2
3
|
/**
|
|
3
4
|
* Resolves a nav item's typed `notificationBadgeRef` to a live indicator (R7).
|
|
4
5
|
*
|
|
@@ -29,6 +30,21 @@ export interface NavigationItemBadgeProps {
|
|
|
29
30
|
label?: string;
|
|
30
31
|
className?: string;
|
|
31
32
|
}
|
|
33
|
+
/** What a nav item's badge shows, resolved from its key (#1828): data only, for any renderer. */
|
|
34
|
+
export interface NavigationItemBadgeState {
|
|
35
|
+
mode: NotificationBadgeDefinition['display']['mode'];
|
|
36
|
+
tone: NotificationBadgeDefinition['display']['tone'];
|
|
37
|
+
count: number;
|
|
38
|
+
pulse: boolean;
|
|
39
|
+
/** The indicator's accessible name: the nav item's label, else the badge KEY verbatim (see below). */
|
|
40
|
+
accessibleName: string;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* The DATA half of {@link NavigationItemBadge} (#1828): the registered definition a badge key names, its live count and
|
|
44
|
+
* pulse, and the accessible name. `null` when the key is absent or names no definition. The component draws it; a
|
|
45
|
+
* renderer that is not the DOM reads the same state here.
|
|
46
|
+
*/
|
|
47
|
+
export declare function useNavigationItemBadge({ notificationBadgeRef, label, }: Pick<NavigationItemBadgeProps, 'notificationBadgeRef' | 'label'>): NavigationItemBadgeState | null;
|
|
32
48
|
export declare function NavigationItemBadge({ notificationBadgeRef, label, className, }: NavigationItemBadgeProps): React.JSX.Element | null;
|
|
33
49
|
export declare namespace NavigationItemBadge {
|
|
34
50
|
var displayName: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NavigationItemBadge.d.ts","sourceRoot":"","sources":["../../../../src/components/navigation/NavigationItemBadge.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"NavigationItemBadge.d.ts","sourceRoot":"","sources":["../../../../src/components/navigation/NavigationItemBadge.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,EAAgC,KAAK,2BAA2B,EAAE,MAAM,uBAAuB,CAAA;AAOtG;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,WAAW,wBAAwB;IACvC,6EAA6E;IAC7E,oBAAoB,CAAC,EAAE,MAAM,CAAA;IAC7B;;;;;;OAMG;IACH,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAED,iGAAiG;AACjG,MAAM,WAAW,wBAAwB;IACvC,IAAI,EAAE,2BAA2B,CAAC,SAAS,CAAC,CAAC,MAAM,CAAC,CAAA;IACpD,IAAI,EAAE,2BAA2B,CAAC,SAAS,CAAC,CAAC,MAAM,CAAC,CAAA;IACpD,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,OAAO,CAAA;IACd,sGAAsG;IACtG,cAAc,EAAE,MAAM,CAAA;CACvB;AAED;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,EACrC,oBAAoB,EACpB,KAAK,GACN,EAAE,IAAI,CAAC,wBAAwB,EAAE,sBAAsB,GAAG,OAAO,CAAC,GAAG,wBAAwB,GAAG,IAAI,CA4CpG;AAED,wBAAgB,mBAAmB,CAAC,EAClC,oBAAoB,EACpB,KAAK,EACL,SAAS,GACV,EAAE,wBAAwB,GAAG,KAAK,CAAC,GAAG,CAAC,OAAO,GAAG,IAAI,CAgBrD;yBApBe,mBAAmB"}
|
|
@@ -4,7 +4,12 @@ import { unresolvedLabel } from '../../core/i18n/I18nContext.js';
|
|
|
4
4
|
import { useResourceRegistry } from '../../core/resources/useResourceRegistry.js';
|
|
5
5
|
import { useNotificationBadges } from '../../core/requests/websockets/useNotificationBadges.js';
|
|
6
6
|
import { NotificationIndicator } from '../../components/data-display/notification-indicator.js';
|
|
7
|
-
|
|
7
|
+
/**
|
|
8
|
+
* The DATA half of {@link NavigationItemBadge} (#1828): the registered definition a badge key names, its live count and
|
|
9
|
+
* pulse, and the accessible name. `null` when the key is absent or names no definition. The component draws it; a
|
|
10
|
+
* renderer that is not the DOM reads the same state here.
|
|
11
|
+
*/
|
|
12
|
+
export function useNavigationItemBadge({ notificationBadgeRef, label, }) {
|
|
8
13
|
const { registry } = useResourceRegistry();
|
|
9
14
|
const { getBadgeState } = useNotificationBadges();
|
|
10
15
|
const definition = notificationBadgeRef
|
|
@@ -41,7 +46,14 @@ export function NavigationItemBadge({ notificationBadgeRef, label, className, })
|
|
|
41
46
|
const accessibleName = trimmedLabel
|
|
42
47
|
? label
|
|
43
48
|
: unresolvedLabel(notificationBadgeIdentityKey(definition));
|
|
44
|
-
return
|
|
49
|
+
return { mode: definition.display.mode, tone: definition.display.tone, count, pulse, accessibleName };
|
|
50
|
+
}
|
|
51
|
+
export function NavigationItemBadge({ notificationBadgeRef, label, className, }) {
|
|
52
|
+
const badge = useNavigationItemBadge({ notificationBadgeRef, label });
|
|
53
|
+
if (!badge) {
|
|
54
|
+
return null;
|
|
55
|
+
}
|
|
56
|
+
return (_jsx(NotificationIndicator, { mode: badge.mode, tone: badge.tone, count: badge.count, pulse: badge.pulse, label: badge.accessibleName, className: className }));
|
|
45
57
|
}
|
|
46
58
|
NavigationItemBadge.displayName = 'NavigationItemBadge';
|
|
47
59
|
//# sourceMappingURL=NavigationItemBadge.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NavigationItemBadge.js","sourceRoot":"","sources":["../../../../src/components/navigation/NavigationItemBadge.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,4BAA4B,
|
|
1
|
+
{"version":3,"file":"NavigationItemBadge.js","sourceRoot":"","sources":["../../../../src/components/navigation/NavigationItemBadge.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,4BAA4B,EAAoC,MAAM,uBAAuB,CAAA;AAEtG,OAAO,EAAE,eAAe,EAAE,MAAM,2CAA2C,CAAA;AAC3E,OAAO,EAAE,mBAAmB,EAAE,MAAM,wDAAwD,CAAA;AAC5F,OAAO,EAAE,qBAAqB,EAAE,MAAM,oEAAoE,CAAA;AAC1G,OAAO,EAAE,qBAAqB,EAAE,MAAM,oEAAoE,CAAA;AA2C1G;;;;GAIG;AACH,MAAM,UAAU,sBAAsB,CAAC,EACrC,oBAAoB,EACpB,KAAK,GA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,KAAK,CAAC,KAAK,EAClB,KAAK,EAAE,KAAK,CAAC,cAAc,EAC3B,SAAS,EAAE,SAAS,GACpB,CACH,CAAA;AACH,CAAC;AAED,mBAAmB,CAAC,WAAW,GAAG,qBAAqB,CAAA","sourcesContent":["import * as React from 'react'\n\nimport { notificationBadgeIdentityKey, type NotificationBadgeDefinition } from '@wildo-ai/saas-models'\n\nimport { unresolvedLabel } from '~wildo-frontend-lib/core/i18n/I18nContext'\nimport { useResourceRegistry } from '~wildo-frontend-lib/core/resources/useResourceRegistry'\nimport { useNotificationBadges } from '~wildo-frontend-lib/core/requests/websockets/useNotificationBadges'\nimport { NotificationIndicator } from '~wildo-frontend-lib/components/data-display/notification-indicator'\n\n/**\n * Resolves a nav item's typed `notificationBadgeRef` to a live indicator (R7).\n *\n * Looks the ref up in the registry's `notificationBadgeDefinitions` (the resolved\n * definition supplies mode / tone / pulse-trigger), reads the live count + pulse\n * from `useNotificationBadges`, and renders the `NotificationIndicator`. Renders\n * nothing when the ref is absent, unresolved, or the count is not worth showing\n * (the indicator itself suppresses `NONE` / zero).\n *\n * The ref is a badge KEY, `<scope>:<identifier>`, matched with the same\n * `notificationBadgeIdentityKey` the badge store indexes by. It used to be matched on the\n * `identifier` alone, which resolved a definition only by luck when two scopes declared one\n * identifier — the second was unreachable and drew the first's count.\n *\n * Note: each instance subscribes to the badge event stream; a sidebar has few\n * badges so this is fine. Hoist to a shared context if a surface renders many.\n */\nexport interface NavigationItemBadgeProps {\n /** A badge KEY (`<scope>:<identifier>`) naming one registered definition. */\n notificationBadgeRef?: string\n /**\n * Nav item label — the indicator's accessible name.\n *\n * Omitted (or empty), the name falls back to the badge KEY, verbatim. A badge definition carries\n * no label of its own, so this really is the only name available; the key is the honest statement\n * that none was supplied, never words invented from one.\n */\n label?: string\n className?: string\n}\n\n/** What a nav item's badge shows, resolved from its key (#1828): data only, for any renderer. */\nexport interface NavigationItemBadgeState {\n mode: NotificationBadgeDefinition['display']['mode']\n tone: NotificationBadgeDefinition['display']['tone']\n count: number\n pulse: boolean\n /** The indicator's accessible name: the nav item's label, else the badge KEY verbatim (see below). */\n accessibleName: string\n}\n\n/**\n * The DATA half of {@link NavigationItemBadge} (#1828): the registered definition a badge key names, its live count and\n * pulse, and the accessible name. `null` when the key is absent or names no definition. The component draws it; a\n * renderer that is not the DOM reads the same state here.\n */\nexport function useNavigationItemBadge({\n notificationBadgeRef,\n label,\n}: Pick<NavigationItemBadgeProps, 'notificationBadgeRef' | 'label'>): NavigationItemBadgeState | null {\n const { registry } = useResourceRegistry()\n const { getBadgeState } = useNotificationBadges()\n\n const definition = notificationBadgeRef\n ? registry.notificationBadgeDefinitions.find(\n (candidate) => notificationBadgeIdentityKey(candidate) === notificationBadgeRef,\n )\n : undefined\n\n if (!definition) {\n return null\n }\n\n const { count, pulse } = getBadgeState(definition)\n /*\n * With no nav label, the accessible name is the badge's KEY, rendered as-is.\n *\n * Two things were wrong with the `label ?? definition.identifier` this replaces, and neither is\n * the humanization `check:invented-display-text` looks for — that gate matches string\n * TRANSFORMATIONS, and this performs none, so it could never have fired here (verified against an\n * empty baseline, 2026-09-09). It is the sibling defect\n * `display-text-comes-from-i18n.md` governs: an identity handed to a person as a name.\n *\n * 1. The bare `identifier` is NOT an identity — this file's own header says so, and says it about\n * the LOOKUP one field over: \"it used to be matched on the `identifier` alone, which resolved a\n * definition only by luck when two scopes declared one identifier\". Two definitions sharing an\n * identifier across scopes therefore announced themselves identically to a screen reader, which\n * is the same ambiguity `notificationBadgeIdentityKey` exists to remove. The lookup was fixed\n * and the name was not.\n * 2. `??` does not catch `''`. A caller passing an empty label got an indicator with an EMPTY\n * accessible name — worse than a key, because there is then nothing at all to notice or grep.\n *\n * A badge definition carries no label of its own (`NotificationBadgeDefinition` has no such\n * field), so there is no i18n key to author here and no gap to make visible: the caller's label is\n * the only name that exists. Rendering the key is the honest statement that none was supplied, and\n * it goes through `unresolvedLabel` rather than being inlined so the convention keeps one home.\n */\n const trimmedLabel = label?.trim()\n const accessibleName = trimmedLabel\n ? label as string\n : unresolvedLabel(notificationBadgeIdentityKey(definition))\n\n return { mode: definition.display.mode, tone: definition.display.tone, count, pulse, accessibleName }\n}\n\nexport function NavigationItemBadge({\n notificationBadgeRef,\n label,\n className,\n}: NavigationItemBadgeProps): React.JSX.Element | null {\n const badge = useNavigationItemBadge({ notificationBadgeRef, label })\n if (!badge) {\n return null\n }\n\n return (\n <NotificationIndicator\n mode={badge.mode}\n tone={badge.tone}\n count={badge.count}\n pulse={badge.pulse}\n label={badge.accessibleName}\n className={className}\n />\n )\n}\n\nNavigationItemBadge.displayName = 'NavigationItemBadge'\n"]}
|
|
@@ -47,9 +47,9 @@ export declare function resolveApplicationLevelNavigationBackZone(navigationZone
|
|
|
47
47
|
*
|
|
48
48
|
* Both mounting layers resolve through this wrapper, so the gate lives here
|
|
49
49
|
* rather than in each host: a host cannot forget to check, and the two cannot
|
|
50
|
-
* drift into disagreeing about one application-wide policy.
|
|
51
|
-
*
|
|
52
|
-
* this decides "may THIS layer offer it at all".
|
|
50
|
+
* drift into disagreeing about one application-wide policy. "Is there anywhere
|
|
51
|
+
* to go back TO" (`canGoBack`) is `useNavigationBackBehavior`'s (#1828), which the
|
|
52
|
+
* preset reads; this decides "may THIS layer offer it at all".
|
|
53
53
|
*/
|
|
54
54
|
export declare function ApplicationLevel_NavigationBack({ preset, host, ...props }: ApplicationLevelProps_NavigationBack & ComponentPresetProps): React.JSX.Element | null;
|
|
55
55
|
//# sourceMappingURL=ApplicationLevel_NavigationBack.d.ts.map
|
|
@@ -37,9 +37,9 @@ export function resolveApplicationLevelNavigationBackZone(navigationZone, focuse
|
|
|
37
37
|
*
|
|
38
38
|
* Both mounting layers resolve through this wrapper, so the gate lives here
|
|
39
39
|
* rather than in each host: a host cannot forget to check, and the two cannot
|
|
40
|
-
* drift into disagreeing about one application-wide policy.
|
|
41
|
-
*
|
|
42
|
-
* this decides "may THIS layer offer it at all".
|
|
40
|
+
* drift into disagreeing about one application-wide policy. "Is there anywhere
|
|
41
|
+
* to go back TO" (`canGoBack`) is `useNavigationBackBehavior`'s (#1828), which the
|
|
42
|
+
* preset reads; this decides "may THIS layer offer it at all".
|
|
43
43
|
*/
|
|
44
44
|
export function ApplicationLevel_NavigationBack({ preset = CorePresetNames.DEFAULT, host = NavigationBackHost.SHELL, ...props }) {
|
|
45
45
|
// Read the UI context DEFENSIVELY rather than through `useUI()`, which THROWS
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ApplicationLevel_NavigationBack.js","sourceRoot":"","sources":["../../../../../src/components/navigation/app-level/ApplicationLevel_NavigationBack.tsx"],"names":[],"mappings":";AAAA,OAAc,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAK1C,OAAO,EAAE,uBAAuB,EAAE,MAAM,iFAAiF,CAAC;AAC1H,OAAO,EAAE,qBAAqB,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAC;AAE7F,OAAO,EACL,kBAAkB,EAClB,mCAAmC,EACnC,qCAAqC,GACtC,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,SAAS,EAAE,MAAM,uCAAuC,CAAC;AAGlE;;;;;GAKG;AACH,MAAM,CAAN,IAAY,kBAKX;AALD,WAAY,kBAAkB;IAC5B,4EAA4E;IAC5E,qCAAe,CAAA;IACf,4EAA4E;IAC5E,yCAAmB,CAAA;AACrB,CAAC,EALW,kBAAkB,KAAlB,kBAAkB,QAK7B;AAkBD;;;;;;;;;GASG;AACH,MAAM,UAAU,yCAAyC,CACvD,cAA0C,EAC1C,WAA+B,EAC/B,0BAAmC,IAAI;IAEvC,IAAI,cAAc;QAAE,OAAO,cAAc,CAAC;IAC1C,OAAO,uBAAuB,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,kBAAkB,CAAC,OAAO,CAAC;AAC5E,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,+BAA+B,CAAC,EAC9C,MAAM,GAAG,eAAe,CAAC,OAAO,EAChC,IAAI,GAAG,kBAAkB,CAAC,KAAK,EAC/B,GAAG,KAAK,EACoD;IAC5D,8EAA8E;IAC9E,4EAA4E;IAC5E,0EAA0E;IAC1E,4EAA4E;IAC5E,4EAA4E;IAC5E,4BAA4B;IAC5B,MAAM,SAAS,GAAG,UAAU,CAAC,SAAS,CAAC,CAAC;IACxC,MAAM,KAAK,GAAG,SAAS,EAAE,gBAAgB,EAAE,mBAAmB,CAAC;IAC/D,MAAM,QAAQ,GAAG,IAAI,KAAK,kBAAkB,CAAC,KAAK;QAChD,CAAC,CAAC,mCAAmC,CAAC,KAAK,CAAC;QAC5C,CAAC,CAAC,qCAAqC,CAAC,KAAK,CAAC,CAAC;IACjD,IAAI,CAAC,QAAQ,EAAE,CAAC;QACd,OAAO,IAAI,CAAC;IACd,CAAC;IAED,MAAM,SAAS,GAAG,uBAAuB,CACvC,qBAAqB,CAAC,iCAAiC,EACvD,iCAAiC,CAClC,CAAC,MAAM,CAAC,CAAC;IACV,OAAO,KAAC,SAAS,OAAK,KAAK,GAAI,CAAC;AAClC,CAAC","sourcesContent":["import React, { useContext } from 'react';\nimport { ApplicationLevelComponentType } from '~wildo-frontend-lib/core/config/app-level-components.frontend.schemas';\nimport { HorizontalPlacement, VerticalPlacement } from '@wildo-ai/presets-components-models';\n\nimport { ComponentPresetProps } from '~wildo-frontend-lib/core/components-registry/component-registry.frontend.schemas';\nimport { createComponentResolver } from '~wildo-frontend-lib/core/components-registry/component-resolver.frontend.helper';\nimport { FrontendComponentType, CorePresetNames } from '@wildo-ai/presets-components-models';\nimport type { NavigationZone } from '~wildo-frontend-lib/core/navigation/navigation.schemas';\nimport {\n NavigationZoneName,\n navigationBackAffordanceAdmitsShell,\n navigationBackAffordanceAdmitsSurface,\n} from '@wildo-ai/saas-models';\nimport { UIContext } from '~wildo-frontend-lib/core/ui/UIContext';\nimport type { BaseApplicationLevelProps } from './component-props.application-level.frontend.schemas';\n\n/**\n * Which LAYER is mounting this back control. The same component is mounted by\n * the app shell (the menubar's hosted navigation control) and by a surface's own\n * header, and {@link NavigationBackAffordanceOwner} decides which of them may\n * render — so each mount site must say who it is.\n */\nexport enum NavigationBackHost {\n /** The app shell's hosted navigation control (menubar / sidebar chrome). */\n SHELL = 'shell',\n /** A surface's own header — a resource or view header, beside its title. */\n SURFACE = 'surface',\n}\n\n// --- Contract ---\nexport interface ApplicationLevelProps_NavigationBack extends BaseApplicationLevelProps {\n navigationZone?: NavigationZone;\n containerType?: ApplicationLevelComponentType;\n containerPlacement?: HorizontalPlacement | VerticalPlacement;\n className?: string;\n ariaLabel?: string;\n /**\n * The mounting layer. Defaults to {@link NavigationBackHost.SHELL} because the\n * shell mounts this through the generic component registry, which passes only\n * the container props — it cannot name itself. Surface headers mount it\n * directly and therefore declare `SURFACE` explicitly.\n */\n host?: NavigationBackHost;\n}\n\n/**\n * Which zone the back control acts on.\n *\n * A surface header names its own zone. The SHELL's control cannot, so it acts on the zone the reader\n * last worked in — unless that zone holds nothing, in which case PRIMARY. Nothing reset the focused\n * zone when its pane closed, so after closing a detail pane with its own control the header's arrow\n * stayed enabled (an adjacent zone \"closes on back\") and clicking it did nothing: `goBack` on an\n * empty zone returns at once. The focus itself is left alone on purpose — a reader may genuinely\n * work in an empty `EMPTY_STATE` pane — so the question is answered here, where it is asked.\n */\nexport function resolveApplicationLevelNavigationBackZone(\n navigationZone: NavigationZone | undefined,\n focusedZone: NavigationZoneName,\n focusedZoneHoldsContent: boolean = true,\n): NavigationZone {\n if (navigationZone) return navigationZone;\n return focusedZoneHoldsContent ? focusedZone : NavigationZoneName.PRIMARY;\n}\n\n/**\n * Back-affordance OWNERSHIP GATE — the one place the policy is applied.\n *\n * Both mounting layers resolve through this wrapper, so the gate lives here\n * rather than in each host: a host cannot forget to check, and the two cannot\n * drift into disagreeing about one application-wide policy.
|
|
1
|
+
{"version":3,"file":"ApplicationLevel_NavigationBack.js","sourceRoot":"","sources":["../../../../../src/components/navigation/app-level/ApplicationLevel_NavigationBack.tsx"],"names":[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AqC,CAAC,KAAK,CAAC,CAAC;IACjD,IAAI,CAAC,QAAQ,EAAE,CAAC;QACd,OAAO,IAAI,CAAC;IACd,CAAC;IAED,MAAM,SAAS,GAAG,uBAAuB,CACvC,qBAAqB,CAAC,iCAAiC,EACvD,iCAAiC,CAClC,CAAC,MAAM,CAAC,CAAC;IACV,OAAO,KAAC,SAAS,OAAK,KAAK,GAAI,CAAC;AAClC,CAAC","sourcesContent":["import React, { useContext } from 'react';\nimport { ApplicationLevelComponentType } from '~wildo-frontend-lib/core/config/app-level-components.frontend.schemas';\nimport { HorizontalPlacement, VerticalPlacement } from '@wildo-ai/presets-components-models';\n\nimport { ComponentPresetProps } from '~wildo-frontend-lib/core/components-registry/component-registry.frontend.schemas';\nimport { createComponentResolver } from '~wildo-frontend-lib/core/components-registry/component-resolver.frontend.helper';\nimport { FrontendComponentType, CorePresetNames } from '@wildo-ai/presets-components-models';\nimport type { NavigationZone } from '~wildo-frontend-lib/core/navigation/navigation.schemas';\nimport {\n NavigationZoneName,\n navigationBackAffordanceAdmitsShell,\n navigationBackAffordanceAdmitsSurface,\n} from '@wildo-ai/saas-models';\nimport { UIContext } from '~wildo-frontend-lib/core/ui/UIContext';\nimport type { BaseApplicationLevelProps } from './component-props.application-level.frontend.schemas';\n\n/**\n * Which LAYER is mounting this back control. The same component is mounted by\n * the app shell (the menubar's hosted navigation control) and by a surface's own\n * header, and {@link NavigationBackAffordanceOwner} decides which of them may\n * render — so each mount site must say who it is.\n */\nexport enum NavigationBackHost {\n /** The app shell's hosted navigation control (menubar / sidebar chrome). */\n SHELL = 'shell',\n /** A surface's own header — a resource or view header, beside its title. */\n SURFACE = 'surface',\n}\n\n// --- Contract ---\nexport interface ApplicationLevelProps_NavigationBack extends BaseApplicationLevelProps {\n navigationZone?: NavigationZone;\n containerType?: ApplicationLevelComponentType;\n containerPlacement?: HorizontalPlacement | VerticalPlacement;\n className?: string;\n ariaLabel?: string;\n /**\n * The mounting layer. Defaults to {@link NavigationBackHost.SHELL} because the\n * shell mounts this through the generic component registry, which passes only\n * the container props — it cannot name itself. Surface headers mount it\n * directly and therefore declare `SURFACE` explicitly.\n */\n host?: NavigationBackHost;\n}\n\n/**\n * Which zone the back control acts on.\n *\n * A surface header names its own zone. The SHELL's control cannot, so it acts on the zone the reader\n * last worked in — unless that zone holds nothing, in which case PRIMARY. Nothing reset the focused\n * zone when its pane closed, so after closing a detail pane with its own control the header's arrow\n * stayed enabled (an adjacent zone \"closes on back\") and clicking it did nothing: `goBack` on an\n * empty zone returns at once. The focus itself is left alone on purpose — a reader may genuinely\n * work in an empty `EMPTY_STATE` pane — so the question is answered here, where it is asked.\n */\nexport function resolveApplicationLevelNavigationBackZone(\n navigationZone: NavigationZone | undefined,\n focusedZone: NavigationZoneName,\n focusedZoneHoldsContent: boolean = true,\n): NavigationZone {\n if (navigationZone) return navigationZone;\n return focusedZoneHoldsContent ? focusedZone : NavigationZoneName.PRIMARY;\n}\n\n/**\n * Back-affordance OWNERSHIP GATE — the one place the policy is applied.\n *\n * Both mounting layers resolve through this wrapper, so the gate lives here\n * rather than in each host: a host cannot forget to check, and the two cannot\n * drift into disagreeing about one application-wide policy. \"Is there anywhere\n * to go back TO\" (`canGoBack`) is `useNavigationBackBehavior`'s (#1828), which the\n * preset reads; this decides \"may THIS layer offer it at all\".\n */\nexport function ApplicationLevel_NavigationBack({\n preset = CorePresetNames.DEFAULT,\n host = NavigationBackHost.SHELL,\n ...props\n}: ApplicationLevelProps_NavigationBack & ComponentPresetProps): React.JSX.Element | null {\n // Read the UI context DEFENSIVELY rather than through `useUI()`, which THROWS\n // outside a `UIProvider`. This component previously needed no UI context at\n // all, so requiring one would turn every mount outside that provider — an\n // error surface, a public shell, a test harness — into a crash instead of a\n // back button. A chrome-ownership gate must fail to its documented DEFAULT,\n // never take the page down.\n const uiContext = useContext(UIContext);\n const owner = uiContext?.navigationLayout?.backAffordanceOwner;\n const admitted = host === NavigationBackHost.SHELL\n ? navigationBackAffordanceAdmitsShell(owner)\n : navigationBackAffordanceAdmitsSurface(owner);\n if (!admitted) {\n return null;\n }\n\n const Component = createComponentResolver<ApplicationLevelProps_NavigationBack>(\n FrontendComponentType.APPLICATION_LEVEL_NAVIGATION_BACK,\n 'ApplicationLevel_NavigationBack'\n )(preset);\n return <Component {...props} />;\n}\n"]}
|
|
@@ -1,16 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* SidebarResourceBrowser — renders a
|
|
3
|
-
* inside a sidebar section.
|
|
2
|
+
* SidebarResourceBrowser — renders a list of resource instances inside a sidebar section.
|
|
4
3
|
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
* Features:
|
|
10
|
-
* - Fetches instances via `doOperation` with scope-aware `contextualParameters`
|
|
11
|
-
* - Applies `instanceFilter` (client-side predicate) after fetching
|
|
12
|
-
* - `onInstanceClick` callback (default: navigate to instance)
|
|
13
|
-
* - Lightweight rendering for always-visible sidebar
|
|
4
|
+
* The DATA (which instances, their names, what selecting one does, and which state the browser is in) is
|
|
5
|
+
* `useSidebarResourceBrowser`'s (#1828): this component only draws it, so a renderer that is not the DOM lists the same
|
|
6
|
+
* instances through the hook. Lightweight rendering for an always-visible sidebar.
|
|
14
7
|
*/
|
|
15
8
|
import React from 'react';
|
|
16
9
|
import type { ResourceBrowserClickContext } from '../../../core/config/launcher-items.frontend.schemas';
|
|
@@ -25,8 +18,7 @@ export interface SidebarResourceBrowserProps {
|
|
|
25
18
|
isCollapsed?: boolean;
|
|
26
19
|
}
|
|
27
20
|
/**
|
|
28
|
-
* Sidebar resource browser —
|
|
29
|
-
* of resource instances for browsing within the sidebar.
|
|
21
|
+
* Sidebar resource browser — draws the instances `useSidebarResourceBrowser` lists.
|
|
30
22
|
*/
|
|
31
23
|
export declare const SidebarResourceBrowser: React.FC<SidebarResourceBrowserProps>;
|
|
32
24
|
//# sourceMappingURL=SidebarResourceBrowser.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SidebarResourceBrowser.d.ts","sourceRoot":"","sources":["../../../../../src/components/navigation/app-level/SidebarResourceBrowser.tsx"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"SidebarResourceBrowser.d.ts","sourceRoot":"","sources":["../../../../../src/components/navigation/app-level/SidebarResourceBrowser.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAA+B,MAAM,OAAO,CAAC;AAIpD,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,iEAAiE,CAAC;AAMnH,MAAM,WAAW,2BAA2B;IAC1C,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,wBAAwB,CAAC,EAAE,MAAM,CAAC;IAClC,cAAc,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,OAAO,CAAC;IAChE,eAAe,CAAC,EAAE,CAAC,OAAO,EAAE,2BAA2B,KAAK,IAAI,CAAC;IACjE,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED;;GAEG;AACH,eAAO,MAAM,sBAAsB,EAAE,KAAK,CAAC,EAAE,CAAC,2BAA2B,CAwFxE,CAAC"}
|
|
@@ -1,275 +1,50 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
/**
|
|
3
|
-
* SidebarResourceBrowser — renders a
|
|
4
|
-
* inside a sidebar section.
|
|
3
|
+
* SidebarResourceBrowser — renders a list of resource instances inside a sidebar section.
|
|
5
4
|
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
* Features:
|
|
11
|
-
* - Fetches instances via `doOperation` with scope-aware `contextualParameters`
|
|
12
|
-
* - Applies `instanceFilter` (client-side predicate) after fetching
|
|
13
|
-
* - `onInstanceClick` callback (default: navigate to instance)
|
|
14
|
-
* - Lightweight rendering for always-visible sidebar
|
|
5
|
+
* The DATA (which instances, their names, what selecting one does, and which state the browser is in) is
|
|
6
|
+
* `useSidebarResourceBrowser`'s (#1828): this component only draws it, so a renderer that is not the DOM lists the same
|
|
7
|
+
* instances through the hook. Lightweight rendering for an always-visible sidebar.
|
|
15
8
|
*/
|
|
16
|
-
import {
|
|
17
|
-
import { CoreResourceOperation, ResourcesConfig_OperationPathUtils, } from '@wildo-ai/saas-models';
|
|
18
|
-
import { ApplicationLevelComponentType } from '../../../core/config/app-level-components.frontend.schemas.js';
|
|
19
|
-
import { ScopeUtilsService } from '../../../core/scope/scope.utils.frontend.service.js';
|
|
20
|
-
import { useAppScopeSafe } from '../../../core/scope/useAppScope.js';
|
|
21
|
-
import { useResourceRegistry } from '../../../core/resources/useResourceRegistry.js';
|
|
22
|
-
import { frontendResourceUtils, FrontendResourceUtils } from '../../../core/resources/frontend-resource.utils.js';
|
|
23
|
-
import { FrontendComponentType } from '@wildo-ai/presets-components-models';
|
|
24
|
-
import { useI18n } from '../../../core/i18n/useI18n.js';
|
|
25
|
-
import { resolveResourceHeaderLabel } from '../../../core/i18n/component-label-resolution.utils.js';
|
|
26
|
-
import { resolveSidebarBrowserEmptyLabel } from '../../../components/navigation/app-level/sidebar-resource-browser-empty-label.js';
|
|
9
|
+
import { useCallback, useMemo } from 'react';
|
|
27
10
|
import { useIconRegistry } from '../../../core/icons/useIconRegistry.js';
|
|
28
|
-
import {
|
|
29
|
-
import { useNavigationController } from '../../../core/navigation/useNavigationController.js';
|
|
30
|
-
import { IconCategory, IconSize } from '../../../core/icons/icon-registry.frontend.schemas.js';
|
|
31
|
-
import { LoggerFrontendService } from '../../../core/monitoring/logger.frontend.service.js';
|
|
32
|
-
import { useUserFacingErrorMessage } from '../../../core/errors/useUserFacingErrorMessage.js';
|
|
11
|
+
import { IconSize } from '../../../core/icons/icon-registry.frontend.schemas.js';
|
|
33
12
|
import { LoadingGate } from '../../../core/loading/LoadingGate.js';
|
|
34
13
|
import { cn } from '../../../core/ui/cn.js';
|
|
35
14
|
import { focusIndicatorClasses, FocusIndicatorShape } from '../../../core/ui/themes/focus-indicator.js';
|
|
36
|
-
import {
|
|
37
|
-
import { buildResourceLoadingScope } from '../../../core/loading/loading-scope.frontend.utils.js';
|
|
38
|
-
const logger = LoggerFrontendService.getLogger();
|
|
39
|
-
const logDebug = logger.debugByType('sidebar-resource-browser');
|
|
40
|
-
logger.setDebugTypeLogging('sidebar-resource-browser', false);
|
|
41
|
-
/** Both bundles this browser reads: its own words, and the generic list's `noItems` empty-state default. */
|
|
42
|
-
const SIDEBAR_RESOURCE_BROWSER_LABEL_COMPONENTS = [
|
|
43
|
-
FrontendComponentType.APPLICATION_LEVEL_SIDEBAR,
|
|
44
|
-
FrontendComponentType.RESOURCES_LAYOUTS_LIST,
|
|
45
|
-
];
|
|
15
|
+
import { SidebarResourceBrowserState, useSidebarResourceBrowser } from './useSidebarResourceBrowser.js';
|
|
46
16
|
/**
|
|
47
|
-
* Sidebar resource browser —
|
|
48
|
-
* of resource instances for browsing within the sidebar.
|
|
17
|
+
* Sidebar resource browser — draws the instances `useSidebarResourceBrowser` lists.
|
|
49
18
|
*/
|
|
50
|
-
export const SidebarResourceBrowser = ({
|
|
51
|
-
const
|
|
52
|
-
const { navigateToResource } = useNavigationController();
|
|
53
|
-
const appScope = useAppScopeSafe();
|
|
54
|
-
const { tResourceHeader, tResourceEmptyState, t, tComponent, formatDate, formatDateTime } = useI18n({ resource: resourceType, component: SIDEBAR_RESOURCE_BROWSER_LABEL_COMPONENTS });
|
|
55
|
-
// Stable identity, so the fetch effect below may call it without listing it.
|
|
56
|
-
const toUserFacingErrorMessage = useUserFacingErrorMessage();
|
|
19
|
+
export const SidebarResourceBrowser = ({ isCollapsed = false, ...options }) => {
|
|
20
|
+
const behavior = useSidebarResourceBrowser(options);
|
|
57
21
|
const { renderIcon } = useIconRegistry();
|
|
58
|
-
const
|
|
59
|
-
const [isLoading, setIsLoading] = useState(true);
|
|
60
|
-
const [error, setError] = useState(null);
|
|
61
|
-
// A configuration problem, not a caught error: its words are a label, resolved at render.
|
|
62
|
-
const [operationUnresolvable, setOperationUnresolvable] = useState(false);
|
|
63
|
-
const doOperationRef = useRef(doOperation);
|
|
64
|
-
doOperationRef.current = doOperation;
|
|
65
|
-
const resourceConfig = registry.resourceConfigurations[resourceType];
|
|
66
|
-
const boundOperation = useMemo(() => {
|
|
67
|
-
if (!resourceConfig)
|
|
68
|
-
return undefined;
|
|
69
|
-
return resolveSidebarResourceBrowserOperation(resourceConfig, operation ?? CoreResourceOperation.LIST, operationVariant);
|
|
70
|
-
}, [resourceConfig, operation, operationVariant]);
|
|
71
|
-
const navigationOperationResolved = useMemo(() => {
|
|
72
|
-
if (!resourceConfig)
|
|
73
|
-
return undefined;
|
|
74
|
-
if (navigateOperation) {
|
|
75
|
-
return resolveSidebarResourceBrowserOperation(resourceConfig, navigateOperation, navigateOperationVariant);
|
|
76
|
-
}
|
|
77
|
-
if (operation && operation !== CoreResourceOperation.LIST) {
|
|
78
|
-
return resolveSidebarResourceBrowserOperation(resourceConfig, operation, operationVariant);
|
|
79
|
-
}
|
|
80
|
-
return (resolveSidebarResourceBrowserOperation(resourceConfig, CoreResourceOperation.READ) ??
|
|
81
|
-
boundOperation);
|
|
82
|
-
}, [resourceConfig, navigateOperation, navigateOperationVariant, operation, operationVariant, boundOperation]);
|
|
83
|
-
const scopedContextIdentifiers = useMemo(() => {
|
|
84
|
-
if (!resourceConfig)
|
|
85
|
-
return {};
|
|
86
|
-
const primaryScopeInitiatorIds = ScopeUtilsService.buildInitiatorIds({
|
|
87
|
-
userId: appScope?.currentUserId,
|
|
88
|
-
organizationId: appScope?.currentOrganizationId,
|
|
89
|
-
applicationId: appScope?.currentApplicationId,
|
|
90
|
-
anonymousUserId: appScope?.currentAnonymousUserId,
|
|
91
|
-
});
|
|
92
|
-
return {
|
|
93
|
-
...ScopeUtilsService.primaryScopeToContextIdentifiers(primaryScopeInitiatorIds, resourceConfig.resourcePrimaryScope),
|
|
94
|
-
...(appScope?.buildContextResourceIdentifiers() ?? {}),
|
|
95
|
-
};
|
|
96
|
-
}, [
|
|
97
|
-
resourceConfig,
|
|
98
|
-
appScope?.currentUserId,
|
|
99
|
-
appScope?.currentOrganizationId,
|
|
100
|
-
appScope?.currentApplicationId,
|
|
101
|
-
appScope?.currentAnonymousUserId,
|
|
102
|
-
appScope,
|
|
103
|
-
]);
|
|
104
|
-
const operationPathKey = useMemo(() => {
|
|
105
|
-
if (!boundOperation)
|
|
106
|
-
return null;
|
|
107
|
-
return ResourcesConfig_OperationPathUtils.createOperationPathKeyFromOperation(boundOperation);
|
|
108
|
-
}, [boundOperation]);
|
|
109
|
-
useEffect(() => {
|
|
110
|
-
setOperationUnresolvable(Boolean(resourceConfig) && !operationPathKey);
|
|
111
|
-
if (!operationPathKey || !resourceConfig) {
|
|
112
|
-
setInstances([]);
|
|
113
|
-
if (resourceConfig && !operationPathKey) {
|
|
114
|
-
const message = `Sidebar resource browser cannot resolve operation "${operation ?? CoreResourceOperation.LIST}" on resource "${resourceType}".`;
|
|
115
|
-
setError(null);
|
|
116
|
-
logger.warn(message, {
|
|
117
|
-
resourceType,
|
|
118
|
-
operationIdentifier: operation ?? CoreResourceOperation.LIST,
|
|
119
|
-
operationVariant,
|
|
120
|
-
});
|
|
121
|
-
}
|
|
122
|
-
else {
|
|
123
|
-
if (!resourceConfig) {
|
|
124
|
-
// The person reads the `resourceBrowserUnavailable` label; the identifier belongs in the log.
|
|
125
|
-
logger.warn(`Sidebar resource browser: resource type "${resourceType}" is not registered.`, { resourceType });
|
|
126
|
-
}
|
|
127
|
-
setError(null);
|
|
128
|
-
}
|
|
129
|
-
setIsLoading(false);
|
|
130
|
-
return;
|
|
131
|
-
}
|
|
132
|
-
let cancelled = false;
|
|
133
|
-
const fetchInstances = async () => {
|
|
134
|
-
setIsLoading(true);
|
|
135
|
-
setError(null);
|
|
136
|
-
try {
|
|
137
|
-
logDebug('Fetching resource instances', { resourceType, operationPathKey });
|
|
138
|
-
const result = await doOperationRef.current(operationPathKey, {
|
|
139
|
-
contextualParameters: scopedContextIdentifiers,
|
|
140
|
-
queryParameters: { limit: 100 },
|
|
141
|
-
});
|
|
142
|
-
if (cancelled)
|
|
143
|
-
return;
|
|
144
|
-
const items = Array.isArray(result) ? result : result?.data ?? [];
|
|
145
|
-
setInstances(items);
|
|
146
|
-
logDebug('Fetched instances', { count: items.length });
|
|
147
|
-
}
|
|
148
|
-
catch (err) {
|
|
149
|
-
if (cancelled)
|
|
150
|
-
return;
|
|
151
|
-
// Rendered to the person, so resolved to localized text — `extractErrorInfo(err).message` was the
|
|
152
|
-
// backend's i18n REFERENCE (#1160).
|
|
153
|
-
setError(toUserFacingErrorMessage(err));
|
|
154
|
-
logger.error('SidebarResourceBrowser fetch failed', { resourceType, error: err });
|
|
155
|
-
}
|
|
156
|
-
finally {
|
|
157
|
-
if (!cancelled)
|
|
158
|
-
setIsLoading(false);
|
|
159
|
-
}
|
|
160
|
-
};
|
|
161
|
-
fetchInstances();
|
|
162
|
-
return () => { cancelled = true; };
|
|
163
|
-
}, [operationPathKey, resourceType, resourceConfig, scopedContextIdentifiers, operation, operationVariant]);
|
|
164
|
-
const filteredInstances = useMemo(() => {
|
|
165
|
-
if (!instanceFilter)
|
|
166
|
-
return instances;
|
|
167
|
-
return instances.filter(instanceFilter);
|
|
168
|
-
}, [instances, instanceFilter]);
|
|
169
|
-
const resourceListAriaLabel = useMemo(() => resolveResourceHeaderLabel({
|
|
170
|
-
tResourceHeader,
|
|
171
|
-
resourceType,
|
|
172
|
-
key: 'title',
|
|
173
|
-
}), [resourceType, tResourceHeader]);
|
|
174
|
-
const handleInstanceClick = useCallback((instance) => {
|
|
175
|
-
const instanceId = (instance.id ?? instance._id ?? '');
|
|
176
|
-
if (onInstanceClick) {
|
|
177
|
-
onInstanceClick({
|
|
178
|
-
resourceType,
|
|
179
|
-
instanceId,
|
|
180
|
-
instanceData: instance,
|
|
181
|
-
});
|
|
182
|
-
return;
|
|
183
|
-
}
|
|
184
|
-
if (resourceConfig && navigationOperationResolved) {
|
|
185
|
-
const contextIdentifiers = {
|
|
186
|
-
...scopedContextIdentifiers,
|
|
187
|
-
[resourceType]: instanceId,
|
|
188
|
-
};
|
|
189
|
-
const parentResourcesRequirements = frontendResourceUtils.buildParentResourcesRequirements(resourceType, contextIdentifiers, registry);
|
|
190
|
-
const resourceContext = frontendResourceUtils.createFrontendResourceOperationContextFromOperation({
|
|
191
|
-
resourceType: resourceType,
|
|
192
|
-
operation: navigationOperationResolved,
|
|
193
|
-
contextResourceIdentifiers: contextIdentifiers,
|
|
194
|
-
parentResourcesRequirements,
|
|
195
|
-
});
|
|
196
|
-
navigateToResource(resourceContext, NavigationUtils.createAppLevelInitiator(ApplicationLevelComponentType.SIDEBAR));
|
|
197
|
-
return;
|
|
198
|
-
}
|
|
199
|
-
logger.warn('SidebarResourceBrowser navigation skipped: no navigation operation resolved', {
|
|
200
|
-
resourceType,
|
|
201
|
-
fetchOperationIdentifier: boundOperation?.operationIdentifier,
|
|
202
|
-
navigationOperationIdentifier: navigateOperation ?? CoreResourceOperation.READ,
|
|
203
|
-
navigationOperationVariant: navigateOperationVariant,
|
|
204
|
-
instanceId,
|
|
205
|
-
});
|
|
206
|
-
}, [
|
|
207
|
-
resourceType,
|
|
208
|
-
onInstanceClick,
|
|
209
|
-
resourceConfig,
|
|
210
|
-
navigationOperationResolved,
|
|
211
|
-
navigateOperation,
|
|
212
|
-
navigateOperationVariant,
|
|
213
|
-
scopedContextIdentifiers,
|
|
214
|
-
registry,
|
|
215
|
-
navigateToResource,
|
|
216
|
-
boundOperation,
|
|
217
|
-
]);
|
|
218
|
-
/*
|
|
219
|
-
* A record's name through the ONE shared resolver, like every other surface that names a record (#1851). This
|
|
220
|
-
* browser used to call the label callback itself with only `currentObject`, so a callback reading `t`, a date
|
|
221
|
-
* formatter or the resource type threw, and the catch fell back to `name`/`title`/`id` — a product showed its id
|
|
222
|
-
* here while its list row showed its word. The shared resolver's own fallback is the record's declared summary
|
|
223
|
-
* fields, then its id.
|
|
224
|
-
*/
|
|
225
|
-
const getInstanceLabel = useCallback((instance) => {
|
|
226
|
-
return FrontendResourceUtils.computeFrontendResourceLabel({
|
|
227
|
-
resourceType,
|
|
228
|
-
registry,
|
|
229
|
-
currentObject: instance,
|
|
230
|
-
t,
|
|
231
|
-
formatDate,
|
|
232
|
-
formatDateTime,
|
|
233
|
-
}) ?? String(instance._id ?? '');
|
|
234
|
-
}, [resourceType, registry, t, formatDate, formatDateTime]);
|
|
235
|
-
const resourceIcon = useMemo(() => {
|
|
236
|
-
return renderIcon({ category: IconCategory.RESOURCES, resourceType }, { size: IconSize.SM });
|
|
237
|
-
}, [renderIcon, resourceType]);
|
|
238
|
-
const loadingScopes = useMemo(() => {
|
|
239
|
-
if (!boundOperation)
|
|
240
|
-
return [];
|
|
241
|
-
return [
|
|
242
|
-
buildResourceLoadingScope({
|
|
243
|
-
resourceType,
|
|
244
|
-
operation: boundOperation.operationIdentifier,
|
|
245
|
-
}),
|
|
246
|
-
];
|
|
247
|
-
}, [resourceType, boundOperation]);
|
|
248
|
-
const i18nKeys = useMemo(() => [`resources.${resourceType}`], [resourceType]);
|
|
22
|
+
const resourceIcon = useMemo(() => renderIcon(behavior.resourceIconReference, { size: IconSize.SM }), [renderIcon, behavior.resourceIconReference]);
|
|
249
23
|
const renderSidebarSkeleton = useCallback(() => (_jsx("div", { className: "px-card-sm py-item-xs space-y-item-xs", role: "status", "aria-live": "polite", children: [1, 2, 3].map(i => (_jsx("div", { className: "animate-pulse motion-reduce:animate-none h-7 bg-surface-sunken-accent rounded", "aria-hidden": "true" }, i))) })), []);
|
|
250
|
-
if (
|
|
251
|
-
return (_jsx("div", { className: "px-card-sm py-item-xs text-xs text-destructive", children:
|
|
24
|
+
if (behavior.state === SidebarResourceBrowserState.UNREGISTERED) {
|
|
25
|
+
return (_jsx("div", { className: "px-card-sm py-item-xs text-xs text-destructive", children: behavior.unavailableLabel }));
|
|
252
26
|
}
|
|
253
27
|
const gatedContent = (() => {
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
28
|
+
switch (behavior.state) {
|
|
29
|
+
case SidebarResourceBrowserState.OPERATION_UNRESOLVABLE:
|
|
30
|
+
case SidebarResourceBrowserState.FAILED:
|
|
31
|
+
return (_jsx("div", { className: "px-card-sm py-item-xs text-xs text-destructive", children: behavior.state === SidebarResourceBrowserState.OPERATION_UNRESOLVABLE ? behavior.unavailableLabel : behavior.errorMessage }));
|
|
32
|
+
case SidebarResourceBrowserState.LOADING:
|
|
33
|
+
case SidebarResourceBrowserState.EMPTY:
|
|
34
|
+
// A first read (LOADING) is covered by the gate's skeleton; a re-read of an empty list keeps this under the gate's
|
|
35
|
+
// refresh overlay, as before (#1828 review F1).
|
|
36
|
+
return (_jsx("div", { className: "px-card-sm py-item-xs text-xs text-muted-foreground", children: behavior.emptyLabel }));
|
|
37
|
+
case SidebarResourceBrowserState.READY:
|
|
38
|
+
break;
|
|
259
39
|
}
|
|
260
40
|
if (isCollapsed) {
|
|
261
|
-
return (_jsxs("div", { className: "flex flex-col items-center gap-item-xs py-item-xs", children: [_jsx("span", { className: "flex-shrink-0", children: resourceIcon }), _jsx("span", { className: "text-[10px] text-muted-foreground", children:
|
|
41
|
+
return (_jsxs("div", { className: "flex flex-col items-center gap-item-xs py-item-xs", children: [_jsx("span", { className: "flex-shrink-0", children: resourceIcon }), _jsx("span", { className: "text-[10px] text-muted-foreground", children: behavior.instances.length })] }));
|
|
262
42
|
}
|
|
263
|
-
return (_jsx("div", { className: "space-y-item-xs", role: "listbox", "aria-label":
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
return (_jsxs("button", { type: "button", role: "option", onClick: () => handleInstanceClick(instance),
|
|
268
|
-
// The INSET focus shape of a packed sidebar item: these rows had no visible focus at all, so a keyboard
|
|
269
|
-
// user could not see which instance a press would open.
|
|
270
|
-
className: cn('w-full text-start px-card-sm py-item-xs text-sm rounded-sm hover:bg-surface-sunken-accent/50 transition-colors flex items-center gap-field-sm min-h-7', focusIndicatorClasses(FocusIndicatorShape.INSET)), children: [_jsx("span", { className: "flex-shrink-0", children: resourceIcon }), _jsx("span", { className: "truncate flex-1", children: label })] }, String(instanceKey)));
|
|
271
|
-
}) }));
|
|
43
|
+
return (_jsx("div", { className: "space-y-item-xs", role: "listbox", "aria-label": behavior.listAriaLabel, children: behavior.instances.map(instance => (_jsxs("button", { type: "button", role: "option", onClick: instance.onSelect,
|
|
44
|
+
// The INSET focus shape of a packed sidebar item: these rows had no visible focus at all, so a keyboard
|
|
45
|
+
// user could not see which instance a press would open.
|
|
46
|
+
className: cn('w-full text-start px-card-sm py-item-xs text-sm rounded-sm hover:bg-surface-sunken-accent/50 transition-colors flex items-center gap-field-sm min-h-7', focusIndicatorClasses(FocusIndicatorShape.INSET)), children: [_jsx("span", { className: "flex-shrink-0", children: resourceIcon }), _jsx("span", { className: "truncate flex-1", children: instance.label })] }, instance.key))) }));
|
|
272
47
|
})();
|
|
273
|
-
return (_jsx(LoadingGate, { i18nKeys: i18nKeys, loadingScopes: loadingScopes, readiness: [{ id: 'sidebar-resource-browser-data', isReady: !isLoading ||
|
|
48
|
+
return (_jsx(LoadingGate, { i18nKeys: behavior.i18nKeys, loadingScopes: behavior.loadingScopes, readiness: [{ id: 'sidebar-resource-browser-data', isReady: !behavior.isLoading || behavior.state === SidebarResourceBrowserState.FAILED }], renderLoading: renderSidebarSkeleton, children: gatedContent }));
|
|
274
49
|
};
|
|
275
50
|
//# sourceMappingURL=SidebarResourceBrowser.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SidebarResourceBrowser.js","sourceRoot":"","sources":["../../../../../src/components/navigation/app-level/SidebarResourceBrowser.tsx"],"names":[],"mappings":";AAAA;;;;;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AAC,CACjD,aAED,eAAM,SAAS,EAAC,eAAe,YAAE,YAAY,GAAQ,EACrD,eAAM,SAAS,EAAC,iBAAiB,YAAE,KAAK,GAAQ,KAZ3C,MAAM,CAAC,WAAW,CAAC,CAajB,CACV,CAAC;YACJ,CAAC,CAAC,GACE,CACP,CAAC;IACJ,CAAC,CAAC,EAAE,CAAC;IAEL,OAAO,CACL,KAAC,WAAW,IACV,QAAQ,EAAE,QAAQ,EAClB,aAAa,EAAE,aAAa,EAC5B,SAAS,EAAE,CAAC,EAAE,EAAE,EAAE,+BAA+B,EAAE,OAAO,EAAE,CAAC,SAAS,IAAI,KAAK,KAAK,IAAI,EAAE,CAAC,EAC3F,aAAa,EAAE,qBAAqB,YAEnC,YAAY,GACD,CACf,CAAC;AACJ,CAAC,CAAC","sourcesContent":["/**\n * SidebarResourceBrowser — renders a filterable list of resource instances\n * inside a sidebar section.\n *\n * Uses `useResourceRegistry()` → `doOperation()` for data fetching, following\n * the same pattern as `ResourceLayout_List.tsx`. The bound operation defaults\n * to `CoreResourceOperation.LIST` unless overridden in the section config.\n *\n * Features:\n * - Fetches instances via `doOperation` with scope-aware `contextualParameters`\n * - Applies `instanceFilter` (client-side predicate) after fetching\n * - `onInstanceClick` callback (default: navigate to instance)\n * - Lightweight rendering for always-visible sidebar\n */\n\nimport React, { useEffect, useState, useRef, useCallback, useMemo } from 'react';\n\nimport {\n CoreResourceOperation,\n ResourcesConfig_OperationPathUtils,\n} from '@wildo-ai/saas-models';\n\nimport { ApplicationLevelComponentType } from '~wildo-frontend-lib/core/config/app-level-components.frontend.schemas';\nimport { ScopeUtilsService } from '~wildo-frontend-lib/core/scope/scope.utils.frontend.service';\nimport { useAppScopeSafe } from '~wildo-frontend-lib/core/scope/useAppScope';\nimport { useResourceRegistry } from '~wildo-frontend-lib/core/resources/useResourceRegistry';\nimport { frontendResourceUtils, FrontendResourceUtils } from '~wildo-frontend-lib/core/resources/frontend-resource.utils';\nimport { FrontendComponentType } from '@wildo-ai/presets-components-models';\nimport { useI18n } from '~wildo-frontend-lib/core/i18n/useI18n';\nimport { resolveResourceHeaderLabel } from '~wildo-frontend-lib/core/i18n/component-label-resolution.utils';\nimport { resolveSidebarBrowserEmptyLabel } from '~wildo-frontend-lib/components/navigation/app-level/sidebar-resource-browser-empty-label';\nimport { useIconRegistry } from '~wildo-frontend-lib/core/icons/useIconRegistry';\nimport { NavigationUtils } from '~wildo-frontend-lib/core/navigation/navigation.utils';\nimport { useNavigationController } from '~wildo-frontend-lib/core/navigation/useNavigationController';\nimport { IconCategory, IconSize } from '~wildo-frontend-lib/core/icons/icon-registry.frontend.schemas';\nimport { LoggerFrontendService } from '~wildo-frontend-lib/core/monitoring/logger.frontend.service';\nimport { useUserFacingErrorMessage } from '~wildo-frontend-lib/core/errors/useUserFacingErrorMessage';\nimport type { ResourceBrowserClickContext } from '~wildo-frontend-lib/core/config/launcher-items.frontend.schemas';\nimport type { AnyFrontendResourceConfiguration, FrontendResourceConfiguration_Operation } from '~wildo-frontend-lib/core/resources/resources.frontend.schemas';\nimport { LoadingGate } from '~wildo-frontend-lib/core/loading/LoadingGate';\nimport { cn } from '~wildo-frontend-lib/core/ui/cn';\nimport { focusIndicatorClasses, FocusIndicatorShape } from '~wildo-frontend-lib/core/ui/themes/focus-indicator';\nimport { resolveSidebarResourceBrowserOperation } from '~wildo-frontend-lib/core/navigation/sidebar-resource-browser-operation';\nimport { buildResourceLoadingScope } from '~wildo-frontend-lib/core/loading/loading-scope.frontend.utils';\nimport type { LoadingScope } from '~wildo-frontend-lib/core/loading/loading-types.frontend.schemas';\n\nconst logger: LoggerFrontendService = LoggerFrontendService.getLogger();\nconst logDebug: (message: string, context?: Record<string, unknown>) => void = logger.debugByType('sidebar-resource-browser');\nlogger.setDebugTypeLogging('sidebar-resource-browser', false);\n\n/** Both bundles this browser reads: its own words, and the generic list's `noItems` empty-state default. */\nconst SIDEBAR_RESOURCE_BROWSER_LABEL_COMPONENTS = [\n FrontendComponentType.APPLICATION_LEVEL_SIDEBAR,\n FrontendComponentType.RESOURCES_LAYOUTS_LIST,\n];\n\nexport interface SidebarResourceBrowserProps {\n resourceType: string;\n operation?: string;\n operationVariant?: string;\n navigateOperation?: string;\n navigateOperationVariant?: string;\n instanceFilter?: (instance: Record<string, unknown>) => boolean;\n onInstanceClick?: (context: ResourceBrowserClickContext) => void;\n isCollapsed?: boolean;\n}\n\n/**\n * Sidebar resource browser — fetches and displays a lightweight list\n * of resource instances for browsing within the sidebar.\n */\nexport const SidebarResourceBrowser: React.FC<SidebarResourceBrowserProps> = ({\n resourceType,\n operation,\n operationVariant,\n navigateOperation,\n navigateOperationVariant,\n instanceFilter,\n onInstanceClick,\n isCollapsed = false,\n}) => {\n const { registry, doOperation } = useResourceRegistry();\n const { navigateToResource } = useNavigationController();\n const appScope = useAppScopeSafe();\n const { tResourceHeader, tResourceEmptyState, t, tComponent, formatDate, formatDateTime } = useI18n({ resource: resourceType, component: SIDEBAR_RESOURCE_BROWSER_LABEL_COMPONENTS });\n // Stable identity, so the fetch effect below may call it without listing it.\n const toUserFacingErrorMessage = useUserFacingErrorMessage();\n const { renderIcon } = useIconRegistry();\n\n const [instances, setInstances] = useState<Record<string, unknown>[]>([]);\n const [isLoading, setIsLoading] = useState(true);\n const [error, setError] = useState<string | null>(null);\n // A configuration problem, not a caught error: its words are a label, resolved at render.\n const [operationUnresolvable, setOperationUnresolvable] = useState(false);\n\n const doOperationRef = useRef(doOperation);\n doOperationRef.current = doOperation;\n\n const resourceConfig: AnyFrontendResourceConfiguration | undefined = registry.resourceConfigurations[resourceType];\n\n const boundOperation: FrontendResourceConfiguration_Operation<any, any, any> | undefined = useMemo(() => {\n if (!resourceConfig) return undefined;\n return resolveSidebarResourceBrowserOperation(resourceConfig, operation ?? CoreResourceOperation.LIST, operationVariant);\n }, [resourceConfig, operation, operationVariant]);\n\n const navigationOperationResolved: FrontendResourceConfiguration_Operation<any, any, any> | undefined = useMemo(() => {\n if (!resourceConfig) return undefined;\n\n if (navigateOperation) {\n return resolveSidebarResourceBrowserOperation(resourceConfig, navigateOperation, navigateOperationVariant);\n }\n\n if (operation && operation !== CoreResourceOperation.LIST) {\n return resolveSidebarResourceBrowserOperation(resourceConfig, operation, operationVariant);\n }\n\n return (\n resolveSidebarResourceBrowserOperation(resourceConfig, CoreResourceOperation.READ) ??\n boundOperation\n );\n }, [resourceConfig, navigateOperation, navigateOperationVariant, operation, operationVariant, boundOperation]);\n\n const scopedContextIdentifiers = useMemo((): Record<string, string> => {\n if (!resourceConfig) return {};\n\n const primaryScopeInitiatorIds = ScopeUtilsService.buildInitiatorIds({\n userId: appScope?.currentUserId,\n organizationId: appScope?.currentOrganizationId,\n applicationId: appScope?.currentApplicationId,\n anonymousUserId: appScope?.currentAnonymousUserId,\n });\n\n return {\n ...ScopeUtilsService.primaryScopeToContextIdentifiers(\n primaryScopeInitiatorIds,\n resourceConfig.resourcePrimaryScope,\n ),\n ...(appScope?.buildContextResourceIdentifiers() ?? {}),\n };\n }, [\n resourceConfig,\n appScope?.currentUserId,\n appScope?.currentOrganizationId,\n appScope?.currentApplicationId,\n appScope?.currentAnonymousUserId,\n appScope,\n ]);\n\n const operationPathKey = useMemo(() => {\n if (!boundOperation) return null;\n return ResourcesConfig_OperationPathUtils.createOperationPathKeyFromOperation(boundOperation);\n }, [boundOperation]);\n\n useEffect(() => {\n setOperationUnresolvable(Boolean(resourceConfig) && !operationPathKey);\n if (!operationPathKey || !resourceConfig) {\n setInstances([]);\n if (resourceConfig && !operationPathKey) {\n const message = `Sidebar resource browser cannot resolve operation \"${operation ?? CoreResourceOperation.LIST}\" on resource \"${resourceType}\".`;\n setError(null);\n logger.warn(message, {\n resourceType,\n operationIdentifier: operation ?? CoreResourceOperation.LIST,\n operationVariant,\n });\n } else {\n if (!resourceConfig) {\n // The person reads the `resourceBrowserUnavailable` label; the identifier belongs in the log.\n logger.warn(`Sidebar resource browser: resource type \"${resourceType}\" is not registered.`, { resourceType });\n }\n setError(null);\n }\n setIsLoading(false);\n return;\n }\n\n let cancelled = false;\n\n const fetchInstances = async () => {\n setIsLoading(true);\n setError(null);\n try {\n logDebug('Fetching resource instances', { resourceType, operationPathKey });\n const result = await doOperationRef.current(operationPathKey, {\n contextualParameters: scopedContextIdentifiers,\n queryParameters: { limit: 100 },\n });\n\n if (cancelled) return;\n\n const items = Array.isArray(result) ? result : (result as any)?.data ?? [];\n setInstances(items as Record<string, unknown>[]);\n logDebug('Fetched instances', { count: items.length });\n } catch (err) {\n if (cancelled) return;\n // Rendered to the person, so resolved to localized text — `extractErrorInfo(err).message` was the\n // backend's i18n REFERENCE (#1160).\n setError(toUserFacingErrorMessage(err));\n logger.error('SidebarResourceBrowser fetch failed', { resourceType, error: err });\n } finally {\n if (!cancelled) setIsLoading(false);\n }\n };\n\n fetchInstances();\n return () => { cancelled = true; };\n }, [operationPathKey, resourceType, resourceConfig, scopedContextIdentifiers, operation, operationVariant]);\n\n const filteredInstances = useMemo(() => {\n if (!instanceFilter) return instances;\n return instances.filter(instanceFilter);\n }, [instances, instanceFilter]);\n const resourceListAriaLabel = useMemo(\n () => resolveResourceHeaderLabel({\n tResourceHeader,\n resourceType,\n key: 'title',\n }),\n [resourceType, tResourceHeader],\n );\n\n const handleInstanceClick = useCallback((instance: Record<string, unknown>) => {\n const instanceId = (instance.id ?? instance._id ?? '') as string;\n\n if (onInstanceClick) {\n onInstanceClick({\n resourceType,\n instanceId,\n instanceData: instance,\n });\n return;\n }\n\n if (resourceConfig && navigationOperationResolved) {\n const contextIdentifiers: Record<string, string> = {\n ...scopedContextIdentifiers,\n [resourceType]: instanceId,\n };\n const parentResourcesRequirements = frontendResourceUtils.buildParentResourcesRequirements(\n resourceType as any,\n contextIdentifiers,\n registry,\n );\n\n const resourceContext = frontendResourceUtils.createFrontendResourceOperationContextFromOperation({\n resourceType: resourceType as any,\n operation: navigationOperationResolved,\n contextResourceIdentifiers: contextIdentifiers,\n parentResourcesRequirements,\n });\n navigateToResource(\n resourceContext,\n NavigationUtils.createAppLevelInitiator(ApplicationLevelComponentType.SIDEBAR),\n );\n return;\n }\n\n logger.warn('SidebarResourceBrowser navigation skipped: no navigation operation resolved', {\n resourceType,\n fetchOperationIdentifier: boundOperation?.operationIdentifier,\n navigationOperationIdentifier: navigateOperation ?? CoreResourceOperation.READ,\n navigationOperationVariant: navigateOperationVariant,\n instanceId,\n });\n }, [\n resourceType,\n onInstanceClick,\n resourceConfig,\n navigationOperationResolved,\n navigateOperation,\n navigateOperationVariant,\n scopedContextIdentifiers,\n registry,\n navigateToResource,\n boundOperation,\n ]);\n\n /*\n * A record's name through the ONE shared resolver, like every other surface that names a record (#1851). This\n * browser used to call the label callback itself with only `currentObject`, so a callback reading `t`, a date\n * formatter or the resource type threw, and the catch fell back to `name`/`title`/`id` — a product showed its id\n * here while its list row showed its word. The shared resolver's own fallback is the record's declared summary\n * fields, then its id.\n */\n const getInstanceLabel = useCallback((instance: Record<string, unknown>): string => {\n return FrontendResourceUtils.computeFrontendResourceLabel({\n resourceType,\n registry,\n currentObject: instance,\n t,\n formatDate,\n formatDateTime,\n }) ?? String(instance._id ?? '');\n }, [resourceType, registry, t, formatDate, formatDateTime]);\n\n const resourceIcon = useMemo(() => {\n return renderIcon(\n { category: IconCategory.RESOURCES, resourceType },\n { size: IconSize.SM },\n );\n }, [renderIcon, resourceType]);\n\n const loadingScopes = useMemo<LoadingScope[]>(() => {\n if (!boundOperation) return [];\n return [\n buildResourceLoadingScope({\n resourceType,\n operation: boundOperation.operationIdentifier,\n }),\n ];\n }, [resourceType, boundOperation]);\n\n const i18nKeys = useMemo(() => [`resources.${resourceType}`], [resourceType]);\n\n const renderSidebarSkeleton = useCallback(() => (\n <div className=\"px-card-sm py-item-xs space-y-item-xs\" role=\"status\" aria-live=\"polite\">\n {[1, 2, 3].map(i => (\n <div key={i} className=\"animate-pulse motion-reduce:animate-none h-7 bg-surface-sunken-accent rounded\" aria-hidden=\"true\" />\n ))}\n </div>\n ), []);\n\n if (!resourceConfig) {\n return (\n <div className=\"px-card-sm py-item-xs text-xs text-destructive\">\n {tComponent(FrontendComponentType.APPLICATION_LEVEL_SIDEBAR, 'resourceBrowserUnavailable')}\n </div>\n );\n }\n\n const gatedContent = (() => {\n if (operationUnresolvable || error) {\n return (\n <div className=\"px-card-sm py-item-xs text-xs text-destructive\">\n {operationUnresolvable ? tComponent(FrontendComponentType.APPLICATION_LEVEL_SIDEBAR, 'resourceBrowserUnavailable') : error}\n </div>\n );\n }\n\n if (filteredInstances.length === 0) {\n return (\n <div className=\"px-card-sm py-item-xs text-xs text-muted-foreground\">\n {resolveSidebarBrowserEmptyLabel({ resourceType, tResourceEmptyState, tComponent })}\n </div>\n );\n }\n\n if (isCollapsed) {\n return (\n <div className=\"flex flex-col items-center gap-item-xs py-item-xs\">\n <span className=\"flex-shrink-0\">{resourceIcon}</span>\n <span className=\"text-[10px] text-muted-foreground\">{filteredInstances.length}</span>\n </div>\n );\n }\n\n return (\n <div className=\"space-y-item-xs\" role=\"listbox\" aria-label={resourceListAriaLabel}>\n {filteredInstances.map((instance, idx) => {\n const label = getInstanceLabel(instance);\n const instanceId = (instance.id ?? instance._id ?? idx) as string;\n const instanceKey = instance.id ?? instance._id ?? `sidebar-resource-${idx}`;\n\n return (\n <button\n key={String(instanceKey)}\n type=\"button\"\n role=\"option\"\n onClick={() => handleInstanceClick(instance)}\n // The INSET focus shape of a packed sidebar item: these rows had no visible focus at all, so a keyboard\n // user could not see which instance a press would open.\n className={cn(\n 'w-full text-start px-card-sm py-item-xs text-sm rounded-sm hover:bg-surface-sunken-accent/50 transition-colors flex items-center gap-field-sm min-h-7',\n focusIndicatorClasses(FocusIndicatorShape.INSET),\n )}\n >\n <span className=\"flex-shrink-0\">{resourceIcon}</span>\n <span className=\"truncate flex-1\">{label}</span>\n </button>\n );\n })}\n </div>\n );\n })();\n\n return (\n <LoadingGate\n i18nKeys={i18nKeys}\n loadingScopes={loadingScopes}\n readiness={[{ id: 'sidebar-resource-browser-data', isReady: !isLoading || error !== null }]}\n renderLoading={renderSidebarSkeleton}\n >\n {gatedContent}\n </LoadingGate>\n );\n};\n"]}
|
|
1
|
+
{"version":3,"file":"SidebarResourceBrowser.js","sourceRoot":"","sources":["../../../../../src/components/navigation/app-level/SidebarResourceBrowser.tsx"],"names":[],"mappings":";AAAA;;;;;;GAMG;AAEH,OAAc,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAEpD,OAAO,EAAE,eAAe,EAAE,MAAM,gDAAgD,CAAC;AACjF,OAAO,EAAE,QAAQ,EAAE,MAAM,+DAA+D,CAAC;AAEzF,OAAO,EAAE,WAAW,EAAE,MAAM,8CAA8C,CAAC;AAC3E,OAAO,EAAE,EAAE,EAAE,MAAM,gCAAgC,CAAC;AACpD,OAAO,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,MAAM,oDAAoD,CAAC;AAChH,OAAO,EAAE,2BAA2B,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AAarG;;GAEG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAA0C,CAAC,EAAE,WAAW,GAAG,KAAK,EAAE,GAAG,OAAO,EAAE,EAAE,EAAE;IACnH,MAAM,QAAQ,GAAG,yBAAyB,CAAC,OAAO,CAAC,CAAC;IACpD,MAAM,EAAE,UAAU,EAAE,GAAG,eAAe,EAAE,CAAC;IACzC,MAAM,YAAY,GAAG,OAAO,CAC1B,GAAG,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC,qBAAqB,EAAE,EAAE,IAAI,EAAE,QAAQ,CAAC,EAAE,EAAE,CAAC,EACvE,CAAC,UAAU,EAAE,QAAQ,CAAC,qBAAqB,CAAC,CAC7C,CAAC;IAEF,MAAM,qBAAqB,GAAG,WAAW,CAAC,GAAG,EAAE,CAAC,CAC9C,cAAK,SAAS,EAAC,uCAAuC,EAAC,IAAI,EAAC,QAAQ,eAAW,QAAQ,YACpF,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,CAA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/E,QAAQ,CAAC,SAAS,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE,CAAC,CAClC,kBAEE,IAAI,EAAC,QAAQ,EACb,IAAI,EAAC,QAAQ,EACb,OAAO,EAAE,QAAQ,CAAC,QAAQ;gBAC1B,wGAAwG;gBACxG,wDAAwD;gBACxD,SAAS,EAAE,EAAE,CACX,uJAAuJ,EACvJ,qBAAqB,CAAC,mBAAmB,CAAC,KAAK,CAAC,CACjD,aAED,eAAM,SAAS,EAAC,eAAe,YAAE,YAAY,GAAQ,EACrD,eAAM,SAAS,EAAC,iBAAiB,YAAE,QAAQ,CAAC,KAAK,GAAQ,KAZpD,QAAQ,CAAC,GAAG,CAaV,CACV,CAAC,GACE,CACP,CAAC;IACJ,CAAC,CAAC,EAAE,CAAC;IAEL,OAAO,CACL,KAAC,WAAW,IACV,QAAQ,EAAE,QAAQ,CAAC,QAAQ,EAC3B,aAAa,EAAE,QAAQ,CAAC,aAAa,EACrC,SAAS,EAAE,CAAC,EAAE,EAAE,EAAE,+BAA+B,EAAE,OAAO,EAAE,CAAC,QAAQ,CAAC,SAAS,IAAI,QAAQ,CAAC,KAAK,KAAK,2BAA2B,CAAC,MAAM,EAAE,CAAC,EAC3I,aAAa,EAAE,qBAAqB,YAEnC,YAAY,GACD,CACf,CAAC;AACJ,CAAC,CAAC","sourcesContent":["/**\n * SidebarResourceBrowser — renders a list of resource instances inside a sidebar section.\n *\n * The DATA (which instances, their names, what selecting one does, and which state the browser is in) is\n * `useSidebarResourceBrowser`'s (#1828): this component only draws it, so a renderer that is not the DOM lists the same\n * instances through the hook. Lightweight rendering for an always-visible sidebar.\n */\n\nimport React, { useCallback, useMemo } from 'react';\n\nimport { useIconRegistry } from '~wildo-frontend-lib/core/icons/useIconRegistry';\nimport { IconSize } from '~wildo-frontend-lib/core/icons/icon-registry.frontend.schemas';\nimport type { ResourceBrowserClickContext } from '~wildo-frontend-lib/core/config/launcher-items.frontend.schemas';\nimport { LoadingGate } from '~wildo-frontend-lib/core/loading/LoadingGate';\nimport { cn } from '~wildo-frontend-lib/core/ui/cn';\nimport { focusIndicatorClasses, FocusIndicatorShape } from '~wildo-frontend-lib/core/ui/themes/focus-indicator';\nimport { SidebarResourceBrowserState, useSidebarResourceBrowser } from './useSidebarResourceBrowser';\n\nexport interface SidebarResourceBrowserProps {\n resourceType: string;\n operation?: string;\n operationVariant?: string;\n navigateOperation?: string;\n navigateOperationVariant?: string;\n instanceFilter?: (instance: Record<string, unknown>) => boolean;\n onInstanceClick?: (context: ResourceBrowserClickContext) => void;\n isCollapsed?: boolean;\n}\n\n/**\n * Sidebar resource browser — draws the instances `useSidebarResourceBrowser` lists.\n */\nexport const SidebarResourceBrowser: React.FC<SidebarResourceBrowserProps> = ({ isCollapsed = false, ...options }) => {\n const behavior = useSidebarResourceBrowser(options);\n const { renderIcon } = useIconRegistry();\n const resourceIcon = useMemo(\n () => renderIcon(behavior.resourceIconReference, { size: IconSize.SM }),\n [renderIcon, behavior.resourceIconReference],\n );\n\n const renderSidebarSkeleton = useCallback(() => (\n <div className=\"px-card-sm py-item-xs space-y-item-xs\" role=\"status\" aria-live=\"polite\">\n {[1, 2, 3].map(i => (\n <div key={i} className=\"animate-pulse motion-reduce:animate-none h-7 bg-surface-sunken-accent rounded\" aria-hidden=\"true\" />\n ))}\n </div>\n ), []);\n\n if (behavior.state === SidebarResourceBrowserState.UNREGISTERED) {\n return (\n <div className=\"px-card-sm py-item-xs text-xs text-destructive\">\n {behavior.unavailableLabel}\n </div>\n );\n }\n\n const gatedContent = (() => {\n switch (behavior.state) {\n case SidebarResourceBrowserState.OPERATION_UNRESOLVABLE:\n case SidebarResourceBrowserState.FAILED:\n return (\n <div className=\"px-card-sm py-item-xs text-xs text-destructive\">\n {behavior.state === SidebarResourceBrowserState.OPERATION_UNRESOLVABLE ? behavior.unavailableLabel : behavior.errorMessage}\n </div>\n );\n case SidebarResourceBrowserState.LOADING:\n case SidebarResourceBrowserState.EMPTY:\n // A first read (LOADING) is covered by the gate's skeleton; a re-read of an empty list keeps this under the gate's\n // refresh overlay, as before (#1828 review F1).\n return (\n <div className=\"px-card-sm py-item-xs text-xs text-muted-foreground\">\n {behavior.emptyLabel}\n </div>\n );\n case SidebarResourceBrowserState.READY:\n break;\n }\n\n if (isCollapsed) {\n return (\n <div className=\"flex flex-col items-center gap-item-xs py-item-xs\">\n <span className=\"flex-shrink-0\">{resourceIcon}</span>\n <span className=\"text-[10px] text-muted-foreground\">{behavior.instances.length}</span>\n </div>\n );\n }\n\n return (\n <div className=\"space-y-item-xs\" role=\"listbox\" aria-label={behavior.listAriaLabel}>\n {behavior.instances.map(instance => (\n <button\n key={instance.key}\n type=\"button\"\n role=\"option\"\n onClick={instance.onSelect}\n // The INSET focus shape of a packed sidebar item: these rows had no visible focus at all, so a keyboard\n // user could not see which instance a press would open.\n className={cn(\n 'w-full text-start px-card-sm py-item-xs text-sm rounded-sm hover:bg-surface-sunken-accent/50 transition-colors flex items-center gap-field-sm min-h-7',\n focusIndicatorClasses(FocusIndicatorShape.INSET),\n )}\n >\n <span className=\"flex-shrink-0\">{resourceIcon}</span>\n <span className=\"truncate flex-1\">{instance.label}</span>\n </button>\n ))}\n </div>\n );\n })();\n\n return (\n <LoadingGate\n i18nKeys={behavior.i18nKeys}\n loadingScopes={behavior.loadingScopes}\n readiness={[{ id: 'sidebar-resource-browser-data', isReady: !behavior.isLoading || behavior.state === SidebarResourceBrowserState.FAILED }]}\n renderLoading={renderSidebarSkeleton}\n >\n {gatedContent}\n </LoadingGate>\n );\n};\n"]}
|