@cosmicdrift/kumiko-renderer 0.413.1 → 0.415.0
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/app/action-form-support.js +4 -0
- package/dist/app/content-previews.d.ts +39 -0
- package/dist/app/content-previews.js +28 -0
- package/dist/app/entity-edit-screen.js +2 -5
- package/dist/app/entity-list-screen.js +42 -59
- package/dist/app/form-schema.d.ts +1 -0
- package/dist/app/form-schema.js +24 -0
- package/dist/app/list-facets.d.ts +1 -0
- package/dist/app/list-facets.js +10 -1
- package/dist/app/list-sort-options.d.ts +4 -0
- package/dist/app/list-sort-options.js +11 -0
- package/dist/app/named-filter-facet.d.ts +16 -3
- package/dist/app/named-filter-facet.js +97 -5
- package/dist/app/projection-detail-body.d.ts +2 -4
- package/dist/app/projection-detail-body.js +7 -1
- package/dist/app/projection-detail-guidance-data.d.ts +7 -0
- package/dist/app/projection-detail-guidance-data.js +103 -0
- package/dist/app/projection-detail-guidance.d.ts +13 -0
- package/dist/app/projection-detail-guidance.js +197 -0
- package/dist/app/projection-detail-header-model.d.ts +1 -3
- package/dist/app/projection-detail-header-model.js +4 -8
- package/dist/app/projection-detail-header-region.d.ts +2 -1
- package/dist/app/projection-detail-header-region.js +63 -23
- package/dist/app/projection-detail-header.d.ts +6 -1
- package/dist/app/projection-detail-header.js +76 -18
- package/dist/app/projection-detail-navigation.d.ts +2 -0
- package/dist/app/projection-detail-navigation.js +13 -3
- package/dist/app/projection-detail-states.d.ts +3 -3
- package/dist/app/projection-list-body.js +4 -2
- package/dist/app/projection-list-render.js +3 -1
- package/dist/app/projection-list-shim.d.ts +4 -1
- package/dist/app/projection-list-shim.js +35 -8
- package/dist/app/reference-link.d.ts +3 -2
- package/dist/app/reference-link.js +19 -4
- package/dist/app/row-actions.js +3 -3
- package/dist/app/screen-access.d.ts +4 -0
- package/dist/app/screen-access.js +18 -0
- package/dist/app/screen-shared.js +3 -1
- package/dist/app/unique-label-keys.d.ts +1 -0
- package/dist/app/unique-label-keys.js +9 -0
- package/dist/app/use-entity-list-payload.d.ts +26 -0
- package/dist/app/use-entity-list-payload.js +59 -0
- package/dist/app/use-entity-range-facets.js +2 -3
- package/dist/app/use-facet-counts.d.ts +5 -0
- package/dist/app/use-facet-counts.js +7 -0
- package/dist/app/use-list-summary-row.d.ts +10 -0
- package/dist/app/use-list-summary-row.js +33 -0
- package/dist/app/use-named-filter-queue.d.ts +20 -0
- package/dist/app/use-named-filter-queue.js +9 -0
- package/dist/app/use-projection-detail-actions.d.ts +5 -4
- package/dist/app/use-projection-detail-actions.js +42 -1
- package/dist/app/use-projection-list-data.d.ts +5 -0
- package/dist/app/use-projection-list-data.js +35 -6
- package/dist/app/use-projection-list-query.d.ts +2 -0
- package/dist/app/use-projection-list-query.js +29 -16
- package/dist/app/use-related-list-tab-counts.js +5 -1
- package/dist/app/use-row-decoration.d.ts +13 -0
- package/dist/app/use-row-decoration.js +103 -0
- package/dist/app/use-screen-list-rows.d.ts +4 -1
- package/dist/app/use-screen-list-rows.js +14 -5
- package/dist/app/use-screen-list-table.d.ts +3 -1
- package/dist/app/use-screen-list-table.js +10 -1
- package/dist/app/write-failed-error.d.ts +1 -0
- package/dist/app/write-failed-error.js +10 -0
- package/dist/card-options.d.ts +25 -0
- package/dist/card-options.js +1 -0
- package/dist/compact-tap-classes.d.ts +1 -0
- package/dist/compact-tap-classes.js +3 -0
- package/dist/components/embedded-list-field.js +13 -12
- package/dist/components/list-empty-state.d.ts +13 -1
- package/dist/components/list-empty-state.js +20 -1
- package/dist/components/list-group-page-bridges.d.ts +1 -1
- package/dist/components/list-group-page-bridges.js +2 -2
- package/dist/components/related-list-section.js +4 -22
- package/dist/components/render-edit-action-button.d.ts +3 -1
- package/dist/components/render-edit-action-button.js +5 -3
- package/dist/components/render-edit-render-model.d.ts +2 -2
- package/dist/components/render-edit-types.d.ts +4 -2
- package/dist/components/render-edit.js +3 -1
- package/dist/components/render-list-hint-columns.d.ts +9 -0
- package/dist/components/render-list-hint-columns.js +87 -0
- package/dist/components/render-list-reference-columns.js +4 -2
- package/dist/components/render-list-row-tone.d.ts +3 -0
- package/dist/components/render-list-row-tone.js +10 -0
- package/dist/components/render-list-table-props.d.ts +9 -1
- package/dist/components/render-list-table-props.js +4 -1
- package/dist/components/render-list-toolbar-action.d.ts +1 -2
- package/dist/components/render-list-toolbar-model.d.ts +4 -1
- package/dist/components/render-list-toolbar-model.js +21 -6
- package/dist/components/render-list-toolbar.d.ts +3 -2
- package/dist/components/render-list-toolbar.js +8 -6
- package/dist/components/render-list-types.d.ts +6 -1
- package/dist/components/render-list.js +26 -7
- package/dist/components/use-render-edit-controlled-sync.js +3 -5
- package/dist/components/use-render-edit-draft-save.js +7 -9
- package/dist/components/use-render-edit-schema.d.ts +3 -0
- package/dist/components/use-render-edit-schema.js +15 -0
- package/dist/components/use-render-edit-state.d.ts +1 -0
- package/dist/components/use-render-edit-state.js +4 -1
- package/dist/components/use-render-edit-steps.js +2 -3
- package/dist/components/use-render-list-columns.d.ts +3 -1
- package/dist/components/use-render-list-columns.js +22 -10
- package/dist/context/screen-focus-context.d.ts +14 -0
- package/dist/context/screen-focus-context.js +28 -0
- package/dist/data-table-facet-types.d.ts +6 -0
- package/dist/data-table-view-types.d.ts +20 -1
- package/dist/headless/form/form-controller.js +3 -1
- package/dist/headless/form/zod-bridge.d.ts +7 -1
- package/dist/headless/form/zod-bridge.js +10 -0
- package/dist/headless/index.d.ts +2 -1
- package/dist/headless/index.js +1 -0
- package/dist/headless/pwa-service-worker-meta.d.ts +4 -0
- package/dist/headless/pwa-service-worker-meta.js +13 -0
- package/dist/headless/view-model/index.d.ts +1 -1
- package/dist/headless/view-model/list-file-display.js +3 -2
- package/dist/headless/view-model/list.js +16 -0
- package/dist/headless/view-model/types.d.ts +37 -0
- package/dist/hooks/list-column-layout.js +2 -1
- package/dist/hooks/list-server-groups.js +14 -1
- package/dist/hooks/list-state-schema.d.ts +1 -0
- package/dist/hooks/list-state-schema.js +9 -1
- package/dist/hooks/use-debounced-value.d.ts +1 -0
- package/dist/hooks/use-debounced-value.js +11 -0
- package/dist/hooks/use-list-aggregates.d.ts +5 -1
- package/dist/hooks/use-list-aggregates.js +9 -5
- package/dist/hooks/use-list-table.d.ts +2 -1
- package/dist/hooks/use-list-table.js +3 -9
- package/dist/hooks/use-list-url-state.d.ts +2 -0
- package/dist/hooks/use-list-url-state.js +12 -4
- package/dist/hooks/use-list-view-state.js +23 -3
- package/dist/hooks/use-reference-lookup.js +7 -2
- package/dist/hooks/use-remembered-list-params.d.ts +6 -2
- package/dist/hooks/use-remembered-list-params.js +18 -3
- package/dist/hooks/use-store.js +0 -1
- package/dist/i18n-defaults.js +39 -3
- package/dist/index.d.ts +7 -2
- package/dist/index.js +4 -1
- package/dist/live/dispatcher-live.js +2 -0
- package/dist/metric-types.d.ts +4 -0
- package/dist/primitives-record-guidance.d.ts +55 -0
- package/dist/primitives-record-guidance.js +1 -0
- package/dist/primitives.d.ts +47 -54
- package/dist/server-clock.d.ts +6 -0
- package/dist/server-clock.js +20 -0
- package/dist/session/session-ended.d.ts +1 -0
- package/dist/session/session-ended.js +2 -2
- package/dist/status-tone.d.ts +1 -0
- package/dist/status-tone.js +5 -0
- package/dist/web/app/browser-locale.js +1 -1
- package/dist/web/app/client-plugin.d.ts +6 -1
- package/dist/web/app/create-app.d.ts +2 -1
- package/dist/web/app/create-app.js +15 -5
- package/dist/web/app/dashboard-body.js +25 -11
- package/dist/web/app/dashboard-header.d.ts +2 -1
- package/dist/web/app/dashboard-header.js +19 -7
- package/dist/web/app/dashboard-list-panel.d.ts +12 -0
- package/dist/web/app/dashboard-list-panel.js +144 -0
- package/dist/web/app/dashboard-narrow-gate.d.ts +6 -0
- package/dist/web/app/dashboard-narrow-gate.js +6 -0
- package/dist/web/app/dashboard-narrow-order.d.ts +3 -0
- package/dist/web/app/dashboard-narrow-order.js +6 -0
- package/dist/web/app/dashboard-navigation-link.d.ts +12 -0
- package/dist/web/app/dashboard-navigation-link.js +21 -0
- package/dist/web/app/dashboard-panels.d.ts +7 -23
- package/dist/web/app/dashboard-panels.js +55 -123
- package/dist/web/app/dashboard-reference-list-table.d.ts +5 -1
- package/dist/web/app/dashboard-reference-list-table.js +13 -4
- package/dist/web/app/dashboard-shared.d.ts +23 -7
- package/dist/web/app/dashboard-shared.js +45 -17
- package/dist/web/app/dashboard-stat-group-panel.d.ts +14 -0
- package/dist/web/app/dashboard-stat-group-panel.js +74 -0
- package/dist/web/app/dashboard-text-panel.d.ts +12 -0
- package/dist/web/app/dashboard-text-panel.js +167 -0
- package/dist/web/app/dashboard-text.d.ts +2 -0
- package/dist/web/app/dashboard-text.js +1 -1
- package/dist/web/app/dashboard-visibility.js +1 -1
- package/dist/web/app/relative-time.js +2 -1
- package/dist/web/drawn-icons.d.ts +6 -0
- package/dist/web/drawn-icons.js +30 -0
- package/dist/web/editor/editor-footer.d.ts +28 -0
- package/dist/web/editor/editor-footer.js +23 -0
- package/dist/web/editor/editor-frame.d.ts +23 -0
- package/dist/web/editor/editor-frame.js +24 -0
- package/dist/web/editor/editor-header.d.ts +36 -0
- package/dist/web/editor/editor-header.js +30 -0
- package/dist/web/editor/editor-rail.d.ts +32 -0
- package/dist/web/editor/editor-rail.js +37 -0
- package/dist/web/editor/editor-workbench.d.ts +34 -0
- package/dist/web/editor/editor-workbench.js +19 -0
- package/dist/web/editor/index.d.ts +6 -0
- package/dist/web/editor/index.js +6 -0
- package/dist/web/editor/relative-when.d.ts +1 -0
- package/dist/web/editor/relative-when.js +18 -0
- package/dist/web/icons.js +6 -5
- package/dist/web/index.d.ts +9 -1
- package/dist/web/index.js +7 -1
- package/dist/web/layout/default-app-shell.js +6 -4
- package/dist/web/layout/focus-aware-sidebar.d.ts +4 -7
- package/dist/web/layout/focus-aware-sidebar.js +5 -7
- package/dist/web/layout/header-action-pinned.d.ts +8 -0
- package/dist/web/layout/header-action-pinned.js +25 -0
- package/dist/web/layout/nav-collapse-state.d.ts +7 -0
- package/dist/web/layout/nav-collapse-state.js +76 -0
- package/dist/web/layout/nav-tree.js +71 -28
- package/dist/web/layout/notification-bell.d.ts +7 -2
- package/dist/web/layout/notification-bell.js +16 -5
- package/dist/web/layout/page-header-slot.d.ts +2 -0
- package/dist/web/layout/page-header-slot.js +4 -0
- package/dist/web/layout/screen-focus.d.ts +8 -0
- package/dist/web/layout/screen-focus.js +42 -0
- package/dist/web/layout/shell-focus.d.ts +5 -4
- package/dist/web/layout/shell-focus.js +14 -7
- package/dist/web/layout/shell-header.d.ts +2 -1
- package/dist/web/layout/shell-header.js +84 -27
- package/dist/web/layout/shell-style.d.ts +3 -0
- package/dist/web/layout/shell-style.js +6 -0
- package/dist/web/layout/sidebar-open-state.d.ts +6 -0
- package/dist/web/layout/sidebar-open-state.js +28 -0
- package/dist/web/layout/uniform-bar-controls.d.ts +2 -2
- package/dist/web/layout/uniform-bar-controls.js +4 -3
- package/dist/web/layout/use-in-app-inbox.js +8 -1
- package/dist/web/layout/workspace-shell.d.ts +11 -1
- package/dist/web/layout/workspace-shell.js +9 -5
- package/dist/web/lib/upload-file-ref.d.ts +2 -2
- package/dist/web/lib/upload-file-ref.js +4 -9
- package/dist/web/presence/use-presence.js +7 -2
- package/dist/web/primitives/banner.d.ts +1 -1
- package/dist/web/primitives/banner.js +22 -9
- package/dist/web/primitives/calendar-day-picker.js +24 -5
- package/dist/web/primitives/card.js +18 -8
- package/dist/web/primitives/code-input.js +6 -1
- package/dist/web/primitives/data-table/actions-column.d.ts +2 -1
- package/dist/web/primitives/data-table/actions-column.js +7 -3
- package/dist/web/primitives/data-table/card-body.d.ts +6 -1
- package/dist/web/primitives/data-table/card-body.js +53 -6
- package/dist/web/primitives/data-table/card-frame.d.ts +8 -0
- package/dist/web/primitives/data-table/card-frame.js +9 -0
- package/dist/web/primitives/data-table/card-row.js +44 -7
- package/dist/web/primitives/data-table/card-sort-select.d.ts +6 -2
- package/dist/web/primitives/data-table/card-sort-select.js +10 -7
- package/dist/web/primitives/data-table/card-view.js +12 -2
- package/dist/web/primitives/data-table/column-picker-section.js +9 -2
- package/dist/web/primitives/data-table/column-resize-handle.js +3 -4
- package/dist/web/primitives/data-table/column-role.d.ts +1 -0
- package/dist/web/primitives/data-table/column-role.js +1 -0
- package/dist/web/primitives/data-table/data-cell-props.d.ts +5 -0
- package/dist/web/primitives/data-table/data-cell-props.js +5 -0
- package/dist/web/primitives/data-table/density.js +1 -0
- package/dist/web/primitives/data-table/facet-cluster.d.ts +2 -1
- package/dist/web/primitives/data-table/facet-cluster.js +2 -2
- package/dist/web/primitives/data-table/group-band.js +4 -0
- package/dist/web/primitives/data-table/hint-cell.d.ts +14 -0
- package/dist/web/primitives/data-table/hint-cell.js +68 -0
- package/dist/web/primitives/data-table/hint-column-width.d.ts +3 -0
- package/dist/web/primitives/data-table/hint-column-width.js +11 -0
- package/dist/web/primitives/data-table/measure-value.js +2 -3
- package/dist/web/primitives/data-table/row-action-column.d.ts +3 -0
- package/dist/web/primitives/data-table/row-action-column.js +4 -0
- package/dist/web/primitives/data-table/row-render-parts.d.ts +1 -1
- package/dist/web/primitives/data-table/row-render-parts.js +3 -2
- package/dist/web/primitives/data-table/sort-options-select.d.ts +22 -0
- package/dist/web/primitives/data-table/sort-options-select.js +46 -0
- package/dist/web/primitives/data-table/sortable-header.d.ts +3 -1
- package/dist/web/primitives/data-table/sortable-header.js +5 -3
- package/dist/web/primitives/data-table/table-body.d.ts +1 -1
- package/dist/web/primitives/data-table/table-body.js +5 -3
- package/dist/web/primitives/data-table/table-chrome.js +3 -1
- package/dist/web/primitives/data-table/table-content.js +12 -7
- package/dist/web/primitives/data-table/table-data-cell.js +9 -3
- package/dist/web/primitives/data-table/table-header-row.js +5 -2
- package/dist/web/primitives/data-table/table-view.js +22 -3
- package/dist/web/primitives/data-table/toolbar-end-cluster.js +1 -1
- package/dist/web/primitives/data-table/toolbar.d.ts +2 -0
- package/dist/web/primitives/data-table/toolbar.js +70 -7
- package/dist/web/primitives/data-table/totals-footer.d.ts +20 -0
- package/dist/web/primitives/data-table/totals-footer.js +41 -9
- package/dist/web/primitives/data-table/use-bulk-selection.js +2 -1
- package/dist/web/primitives/data-table/use-column-pins.js +4 -0
- package/dist/web/primitives/data-table/use-data-table-state.d.ts +1 -0
- package/dist/web/primitives/data-table/use-data-table-state.js +9 -5
- package/dist/web/primitives/data-table/use-measured-column-widths.js +5 -4
- package/dist/web/primitives/data-table/use-row-selection.js +22 -11
- package/dist/web/primitives/data-table/view-menu.js +7 -1
- package/dist/web/primitives/data-table-cell.d.ts +21 -2
- package/dist/web/primitives/data-table-cell.js +129 -26
- package/dist/web/primitives/embedded-file-cell.js +3 -2
- package/dist/web/primitives/embedded-list-cards.js +3 -4
- package/dist/web/primitives/facet-filter.d.ts +5 -3
- package/dist/web/primitives/facet-filter.js +36 -5
- package/dist/web/primitives/facet-search-filter.d.ts +2 -1
- package/dist/web/primitives/facet-search-filter.js +3 -2
- package/dist/web/primitives/facet-trigger-label.d.ts +8 -0
- package/dist/web/primitives/facet-trigger-label.js +9 -0
- package/dist/web/primitives/file-thumbnail.d.ts +6 -2
- package/dist/web/primitives/file-thumbnail.js +13 -6
- package/dist/web/primitives/file-upload.js +3 -2
- package/dist/web/primitives/file-view-action.d.ts +6 -0
- package/dist/web/primitives/file-view-action.js +22 -0
- package/dist/web/primitives/files-dropzone.js +20 -9
- package/dist/web/primitives/form-footer-parts.d.ts +0 -1
- package/dist/web/primitives/form.js +0 -1
- package/dist/web/primitives/hint-reason-row.d.ts +32 -0
- package/dist/web/primitives/hint-reason-row.js +45 -0
- package/dist/web/primitives/index.js +6 -0
- package/dist/web/primitives/layout-elements.d.ts +1 -1
- package/dist/web/primitives/layout-elements.js +3 -3
- package/dist/web/primitives/metric.js +20 -6
- package/dist/web/primitives/page-header.d.ts +1 -1
- package/dist/web/primitives/page-header.js +10 -2
- package/dist/web/primitives/pager.d.ts +3 -2
- package/dist/web/primitives/pager.js +31 -24
- package/dist/web/primitives/reason-box.d.ts +20 -0
- package/dist/web/primitives/reason-box.js +13 -0
- package/dist/web/primitives/record-breadcrumb.d.ts +3 -0
- package/dist/web/primitives/record-breadcrumb.js +11 -0
- package/dist/web/primitives/record-steps.d.ts +3 -0
- package/dist/web/primitives/record-steps.js +50 -0
- package/dist/web/primitives/record-summary.d.ts +3 -0
- package/dist/web/primitives/record-summary.js +18 -0
- package/dist/web/primitives/row-actions.d.ts +3 -1
- package/dist/web/primitives/row-actions.js +14 -5
- package/dist/web/primitives/segmented-select.js +10 -9
- package/dist/web/primitives/tabs.js +6 -1
- package/dist/web/pwa/pwa-support.d.ts +4 -0
- package/dist/web/pwa/pwa-support.js +131 -0
- package/dist/web/sse/live-events.js +2 -2
- package/dist/web/tokens.js +0 -3
- package/dist/web/ui/sidebar.d.ts +2 -1
- package/dist/web/ui/sidebar.js +4 -3
- package/dist/web/widgets/ai-text-field.js +3 -2
- package/dist/web/widgets/chart-parts.d.ts +7 -1
- package/dist/web/widgets/chart-parts.js +10 -4
- package/dist/web/widgets/collapsible-section.js +1 -1
- package/dist/web/widgets/dashboard-list-cards.d.ts +17 -0
- package/dist/web/widgets/dashboard-list-cards.js +46 -0
- package/dist/web/widgets/dashboard-list.d.ts +45 -5
- package/dist/web/widgets/dashboard-list.js +126 -25
- package/dist/web/widgets/drawer-panel-class.d.ts +1 -0
- package/dist/web/widgets/drawer-panel-class.js +9 -1
- package/dist/web/widgets/drawer-sizing.js +1 -1
- package/dist/web/widgets/drawer.js +2 -2
- package/dist/web/widgets/floating-panel.js +4 -2
- package/dist/web/widgets/index.d.ts +2 -0
- package/dist/web/widgets/index.js +2 -0
- package/dist/web/widgets/infinity-list.js +18 -11
- package/dist/web/widgets/pdf-viewer-toolbar.js +3 -2
- package/dist/web/widgets/preview-width-frame.d.ts +7 -0
- package/dist/web/widgets/preview-width-frame.js +10 -0
- package/dist/web/widgets/section-card.d.ts +1 -1
- package/dist/web/widgets/sheet-parts.js +3 -1
- package/dist/web/widgets/stacked-area-chrome.js +3 -3
- package/dist/web/widgets/stacked-area-tooltip.js +2 -10
- package/dist/web/widgets/stat-box-cell.d.ts +19 -0
- package/dist/web/widgets/stat-box-cell.js +10 -0
- package/dist/web/widgets/stat.d.ts +16 -1
- package/dist/web/widgets/stat.js +24 -7
- package/dist/web/widgets/status-badge.d.ts +7 -5
- package/dist/web/widgets/status-badge.js +2 -2
- package/dist/web/widgets/step-bar.d.ts +1 -1
- package/dist/web/widgets/step-bar.js +37 -7
- package/dist/web/widgets/step-list-row.d.ts +4 -0
- package/dist/web/widgets/step-list-row.js +22 -14
- package/dist/web/widgets/step-list.d.ts +12 -4
- package/dist/web/widgets/step-list.js +38 -20
- package/dist/web/widgets/upload-zone.d.ts +8 -1
- package/dist/web/widgets/upload-zone.js +13 -3
- package/package.json +5 -5
- package/src/changes.json +289 -0
- package/src/web/styles.css +15 -0
|
@@ -18,6 +18,7 @@ export function PageHeaderSlotProvider({ children }) {
|
|
|
18
18
|
const [actionsElement, setActionsElement] = useState(null);
|
|
19
19
|
const [title, setTitle] = useState(undefined);
|
|
20
20
|
const [recordTitle, setRecordTitle] = useState(undefined);
|
|
21
|
+
const [bodyTitle, setBodyTitle] = useState(false);
|
|
21
22
|
const [breadcrumbHidden, setBreadcrumbHidden] = useState(false);
|
|
22
23
|
const [breadcrumbScreenId, setBreadcrumbScreenId] = useState(undefined);
|
|
23
24
|
const [overflowItems, setOverflowItems] = useState(undefined);
|
|
@@ -31,6 +32,8 @@ export function PageHeaderSlotProvider({ children }) {
|
|
|
31
32
|
setTitle,
|
|
32
33
|
recordTitle,
|
|
33
34
|
setRecordTitle,
|
|
35
|
+
bodyTitle,
|
|
36
|
+
setBodyTitle,
|
|
34
37
|
breadcrumbHidden,
|
|
35
38
|
setBreadcrumbHidden,
|
|
36
39
|
breadcrumbScreenId,
|
|
@@ -42,6 +45,7 @@ export function PageHeaderSlotProvider({ children }) {
|
|
|
42
45
|
actionsElement,
|
|
43
46
|
title,
|
|
44
47
|
recordTitle,
|
|
48
|
+
bodyTitle,
|
|
45
49
|
breadcrumbHidden,
|
|
46
50
|
breadcrumbScreenId,
|
|
47
51
|
overflowItems,
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { ScreenDefinition } from "@cosmicdrift/kumiko-framework/ui-types";
|
|
2
|
+
import type { ReactNode } from "react";
|
|
3
|
+
/** Applies a screen's declarative `focus`: focused shell chrome on desktop, a MobileTopBar on phones. */
|
|
4
|
+
export declare function ScreenFocus({ screen, screens, children, }: {
|
|
5
|
+
readonly screen: ScreenDefinition;
|
|
6
|
+
readonly screens: readonly ScreenDefinition[];
|
|
7
|
+
readonly children: ReactNode;
|
|
8
|
+
}): ReactNode;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { lastSegment, useNav, useTranslation } from "../../index.js";
|
|
3
|
+
import { ActionOverflowMenu } from "../primitives/row-actions.js";
|
|
4
|
+
import { useIsNarrowViewport } from "../primitives/use-narrow-viewport.js";
|
|
5
|
+
import { MobileTopBar } from "../widgets/mobile-top-bar.js";
|
|
6
|
+
import { usePageHeaderSlot } from "./page-header-slot.js";
|
|
7
|
+
import { resolveParentScreenId, screenTitleKey } from "./shell-breadcrumb.js";
|
|
8
|
+
import { useShellFocused, useShellFocusMode, useShellTopbarActions } from "./shell-focus.js";
|
|
9
|
+
function wantsShellFocus(screen) {
|
|
10
|
+
return ((screen.type === "projectionDetail" || screen.type === "entityEdit") && screen.focus === true);
|
|
11
|
+
}
|
|
12
|
+
function FocusedScreenFrame({ screen, screens, children, }) {
|
|
13
|
+
useShellFocusMode();
|
|
14
|
+
const focused = useShellFocused();
|
|
15
|
+
const nav = useNav();
|
|
16
|
+
const t = useTranslation();
|
|
17
|
+
const slot = usePageHeaderSlot();
|
|
18
|
+
const shortId = lastSegment(screen.id);
|
|
19
|
+
const parentScreenId = resolveParentScreenId(screens, shortId);
|
|
20
|
+
const shellTopbarActions = useShellTopbarActions();
|
|
21
|
+
// The bar is CSS-hidden on wide viewports, where the focused shell deliberately drops the
|
|
22
|
+
// app actions; mounting them there would leave hidden duplicates (same test ids) in the DOM.
|
|
23
|
+
const topbarActions = useIsNarrowViewport() ? shellTopbarActions : undefined;
|
|
24
|
+
const overflowItems = slot?.overflowItems ?? [];
|
|
25
|
+
const hasActions = topbarActions !== undefined || overflowItems.length > 0;
|
|
26
|
+
return (_jsxs(_Fragment, { children: [focused && (_jsx(MobileTopBar, { label: parentScreenId !== undefined
|
|
27
|
+
? t(screenTitleKey(parentScreenId))
|
|
28
|
+
: (slot?.recordTitle ?? slot?.title ?? t(screenTitleKey(shortId))), back: {
|
|
29
|
+
label: t("kumiko.actions.back"),
|
|
30
|
+
onClick: () => parentScreenId !== undefined
|
|
31
|
+
? nav.navigate({ screenId: parentScreenId })
|
|
32
|
+
: window.history.back(),
|
|
33
|
+
}, ...(hasActions && {
|
|
34
|
+
actions: (_jsxs(_Fragment, { children: [topbarActions, overflowItems.length > 0 && (_jsx(ActionOverflowMenu, { items: overflowItems, label: t("kumiko.page-header.actions"), testId: "mobile-top-bar-actions" }))] })),
|
|
35
|
+
}) })), children] }));
|
|
36
|
+
}
|
|
37
|
+
/** Applies a screen's declarative `focus`: focused shell chrome on desktop, a MobileTopBar on phones. */
|
|
38
|
+
export function ScreenFocus({ screen, screens, children, }) {
|
|
39
|
+
if (!wantsShellFocus(screen))
|
|
40
|
+
return children;
|
|
41
|
+
return (_jsx(FocusedScreenFrame, { screen: screen, screens: screens, children: children }));
|
|
42
|
+
}
|
|
@@ -1,19 +1,20 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
1
2
|
type ShellFocusContextValue = {
|
|
2
3
|
readonly focused: boolean;
|
|
3
4
|
readonly register: () => () => void;
|
|
4
5
|
};
|
|
5
6
|
export declare const ShellFocusProvider: import("react").Provider<ShellFocusContextValue | null>;
|
|
7
|
+
export declare const ShellTopbarActionsProvider: import("react").Provider<ReactNode>;
|
|
6
8
|
export type ShellFocusHost = {
|
|
7
9
|
readonly focused: boolean;
|
|
8
|
-
/** Rail expansion while focused; kept apart from the user's own sidebar state so leaving restores it. */
|
|
9
|
-
readonly railOpen: boolean;
|
|
10
|
-
readonly setRailOpen: (open: boolean) => void;
|
|
11
10
|
readonly value: ShellFocusContextValue;
|
|
12
11
|
};
|
|
13
|
-
/** Shell side: holds the focus counter
|
|
12
|
+
/** Shell side: holds the focus counter. */
|
|
14
13
|
export declare function useShellFocusHost(): ShellFocusHost;
|
|
15
14
|
/** True while any mounted screen holds focus mode (always false outside DefaultAppShell). */
|
|
16
15
|
export declare function useShellFocused(): boolean;
|
|
16
|
+
/** The shell's topbarActions, for focused screens whose MobileTopBar replaces the shell header. */
|
|
17
|
+
export declare function useShellTopbarActions(): ReactNode | undefined;
|
|
17
18
|
/** Screen side: call while the screen is mounted to get the focused shell. No-op without a DefaultAppShell. */
|
|
18
19
|
export declare function useShellFocusMode(): void;
|
|
19
20
|
export {};
|
|
@@ -1,28 +1,35 @@
|
|
|
1
|
-
// Per-screen focused shell: while a screen holds focus mode,
|
|
2
|
-
//
|
|
1
|
+
// Per-screen focused shell: while a screen holds focus mode, ShellHeader reduces itself to the
|
|
2
|
+
// screen's own PageHeader content and a collapsed sidebar shows the focus rail. The sidebar's
|
|
3
|
+
// expanded state is never changed by focus mode; only the user's own clicks change it.
|
|
3
4
|
//
|
|
4
5
|
// Why register/unregister instead of a prop: the shell sits above every screen and cannot
|
|
5
6
|
// know which one wants the focused chrome; the screen opts in by mounting the hook.
|
|
6
|
-
import { createContext, useCallback, useContext, useLayoutEffect, useMemo, useState } from "react";
|
|
7
|
+
import { createContext, useCallback, useContext, useLayoutEffect, useMemo, useState, } from "react";
|
|
7
8
|
const ShellFocusContext = createContext(null);
|
|
8
9
|
export const ShellFocusProvider = ShellFocusContext.Provider;
|
|
9
|
-
|
|
10
|
+
// Own context: the shell builds this element anew on every render, which would otherwise
|
|
11
|
+
// re-render every ShellFocusContext consumer along with it.
|
|
12
|
+
const ShellTopbarActionsContext = createContext(undefined);
|
|
13
|
+
export const ShellTopbarActionsProvider = ShellTopbarActionsContext.Provider;
|
|
14
|
+
/** Shell side: holds the focus counter. */
|
|
10
15
|
export function useShellFocusHost() {
|
|
11
16
|
const [holders, setHolders] = useState(0);
|
|
12
|
-
const [railOpen, setRailOpen] = useState(false);
|
|
13
17
|
const register = useCallback(() => {
|
|
14
|
-
setRailOpen(false);
|
|
15
18
|
setHolders((count) => count + 1);
|
|
16
19
|
return () => setHolders((count) => count - 1);
|
|
17
20
|
}, []);
|
|
18
21
|
const focused = holders > 0;
|
|
19
22
|
const value = useMemo(() => ({ focused, register }), [focused, register]);
|
|
20
|
-
return { focused,
|
|
23
|
+
return { focused, value };
|
|
21
24
|
}
|
|
22
25
|
/** True while any mounted screen holds focus mode (always false outside DefaultAppShell). */
|
|
23
26
|
export function useShellFocused() {
|
|
24
27
|
return useContext(ShellFocusContext)?.focused ?? false;
|
|
25
28
|
}
|
|
29
|
+
/** The shell's topbarActions, for focused screens whose MobileTopBar replaces the shell header. */
|
|
30
|
+
export function useShellTopbarActions() {
|
|
31
|
+
return useContext(ShellTopbarActionsContext);
|
|
32
|
+
}
|
|
26
33
|
/** Screen side: call while the screen is mounted to get the focused shell. No-op without a DefaultAppShell. */
|
|
27
34
|
export function useShellFocusMode() {
|
|
28
35
|
const register = useContext(ShellFocusContext)?.register;
|
|
@@ -4,10 +4,11 @@ type ShellHeaderUser = {
|
|
|
4
4
|
readonly id: string;
|
|
5
5
|
readonly roles: readonly string[];
|
|
6
6
|
};
|
|
7
|
-
export declare function ShellHeader({ schema, user, headerActions: appHeaderActions, allowedNavQns, }: {
|
|
7
|
+
export declare function ShellHeader({ schema, user, headerActions: appHeaderActions, allowedNavQns, notificationBellPlacement, }: {
|
|
8
8
|
readonly schema: AppSchema | FeatureSchema;
|
|
9
9
|
readonly user?: ShellHeaderUser;
|
|
10
10
|
readonly headerActions?: ReactNode;
|
|
11
11
|
readonly allowedNavQns?: ReadonlySet<string>;
|
|
12
|
+
readonly notificationBellPlacement?: "header" | "overflow";
|
|
12
13
|
}): ReactNode;
|
|
13
14
|
export {};
|
|
@@ -1,14 +1,6 @@
|
|
|
1
1
|
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
// ShellHeader — inset header bar for sidebar-based shells: SidebarTrigger
|
|
3
|
-
// (rail/mobile-sheet toggle), breadcrumb of the active screen, optional
|
|
4
|
-
// right-aligned headerActions. Shared by DefaultAppShell and WorkspaceShell so
|
|
5
|
-
// both carry the same header (h-14, also with a collapsed icon rail).
|
|
6
|
-
//
|
|
7
|
-
// The `data-kumiko-layout="shell-header"` marker drives `--shell-header-height`
|
|
8
|
-
// in styles.css (:has() selector) — the single source for the header height
|
|
9
|
-
// that Drawer's `belowHeader` prop also reads.
|
|
10
2
|
import { IN_APP_NOTIFICATION_FEATURE } from "@cosmicdrift/kumiko-types/in-app-notification-types";
|
|
11
|
-
import { MoreHorizontal } from "lucide-react";
|
|
3
|
+
import { ChevronLeft, MoreHorizontal } from "lucide-react";
|
|
12
4
|
import { Fragment, useEffect, useId, useMemo, useRef, useState, } from "react";
|
|
13
5
|
import { resolveNavigation } from "../../headless/index.js";
|
|
14
6
|
import { toAppSchema, useNav, usePageHeaderCompact, useTranslation, } from "../../index.js";
|
|
@@ -16,18 +8,25 @@ import { Icon, NAV_ICONS } from "../icons.js";
|
|
|
16
8
|
import { cn } from "../lib/cn.js";
|
|
17
9
|
import { Breadcrumb, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, } from "../ui/breadcrumb.js";
|
|
18
10
|
import { SidebarTrigger } from "../ui/sidebar.js";
|
|
11
|
+
import { collectPinnedHeaderActions, isOnlyPinnedHeaderActions } from "./header-action-pinned.js";
|
|
19
12
|
import { HeaderOverflowMenuContext, headerOverflowMenuItemClass } from "./header-overflow-menu.js";
|
|
20
13
|
import { buildNavRegistrySliceForApp } from "./nav-tree.js";
|
|
21
14
|
import { NotificationBell } from "./notification-bell.js";
|
|
22
15
|
import { usePageHeaderSlot } from "./page-header-slot.js";
|
|
23
16
|
import { activeNavLabel, resolveDetailBreadcrumb, screenTitleKey, } from "./shell-breadcrumb.js";
|
|
24
17
|
import { useShellFocused } from "./shell-focus.js";
|
|
18
|
+
import { useShellNavStyle } from "./shell-style.js";
|
|
25
19
|
import { SHELL_HEADER_CONTROLS_CLASSES } from "./uniform-bar-controls.js";
|
|
26
|
-
export function ShellHeader({ schema, user, headerActions: appHeaderActions, allowedNavQns, }) {
|
|
20
|
+
export function ShellHeader({ schema, user, headerActions: appHeaderActions, allowedNavQns, notificationBellPlacement = "header", }) {
|
|
27
21
|
const nav = useNav();
|
|
28
22
|
const t = useTranslation();
|
|
29
23
|
const focused = useShellFocused();
|
|
30
|
-
const
|
|
24
|
+
const plainNav = useShellNavStyle() === "plain";
|
|
25
|
+
// The app's headerActions (the assistant button) stay in focus mode: they are not navigation,
|
|
26
|
+
// and a focused screen must not cut the user off from them. The notification bell is rendered
|
|
27
|
+
// by this header itself, not passed in, and stays hidden; so does the sidebar trigger, except
|
|
28
|
+
// with the plain nav style, whose panel symbol stays visible in focus mode.
|
|
29
|
+
const headerActions = appHeaderActions;
|
|
31
30
|
const appSchema = toAppSchema(schema);
|
|
32
31
|
const tree = useMemo(() => {
|
|
33
32
|
const source = buildNavRegistrySliceForApp(appSchema);
|
|
@@ -68,29 +67,72 @@ export function ShellHeader({ schema, user, headerActions: appHeaderActions, all
|
|
|
68
67
|
const titleOverride = slot?.title;
|
|
69
68
|
const recordTitle = slot?.recordTitle;
|
|
70
69
|
const compact = usePageHeaderCompact();
|
|
71
|
-
const
|
|
72
|
-
const
|
|
70
|
+
const showsBell = !focused && user !== undefined && hasInAppChannel;
|
|
71
|
+
const bellInOverflow = showsBell && notificationBellPlacement === "overflow";
|
|
73
72
|
// A stand-in without a translated title must not surface the raw i18n key.
|
|
74
73
|
const standInUntitled = standInScreenId !== undefined && crumbs?.at(-1)?.label === screenTitleKey(standInScreenId);
|
|
75
|
-
const
|
|
74
|
+
const bodyTitle = slot?.bodyTitle === true;
|
|
75
|
+
const baseCrumbs = (slot?.breadcrumbHidden === true && standInScreenId === undefined) || standInUntitled
|
|
76
76
|
? undefined
|
|
77
|
-
: crumbs
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
77
|
+
: crumbs;
|
|
78
|
+
const visibleCrumbs = baseCrumbs !== undefined && recordTitle !== undefined && baseCrumbs.length > 0
|
|
79
|
+
? [...baseCrumbs.slice(0, -1), { label: recordTitle }, ...baseCrumbs.slice(-1)]
|
|
80
|
+
: baseCrumbs;
|
|
81
|
+
// The screen's own title block is the h1, so the bar names the list the record belongs to. It is
|
|
82
|
+
// picked from the nav crumbs, not from visibleCrumbs: a record title inserted there must not
|
|
83
|
+
// take the parent's place.
|
|
84
|
+
// Phone: only "‹ parent", never the screen's own title (the body shows it). Desktop: "parent › record title".
|
|
85
|
+
// A screen that draws its own breadcrumb hides the bar's crumbs, but its parent link stays.
|
|
86
|
+
const titleCrumbs = standInUntitled ? undefined : crumbs;
|
|
87
|
+
const parentCrumb = titleCrumbs !== undefined && titleCrumbs.length > 1 ? titleCrumbs.at(-2) : undefined;
|
|
88
|
+
const parentOnly = bodyTitle && compact && parentCrumb !== undefined;
|
|
89
|
+
const bodyTitleCrumbs = () => {
|
|
90
|
+
if (compact)
|
|
91
|
+
return parentCrumb === undefined ? [] : [parentCrumb];
|
|
92
|
+
const ownTitle = recordTitle ?? titleCrumbs?.at(-1)?.label;
|
|
93
|
+
return [
|
|
94
|
+
...(parentCrumb === undefined ? [] : [parentCrumb]),
|
|
95
|
+
...(ownTitle === undefined ? [] : [{ label: ownTitle }]),
|
|
96
|
+
];
|
|
97
|
+
};
|
|
98
|
+
const shownCrumbs = bodyTitle ? bodyTitleCrumbs() : visibleCrumbs;
|
|
99
|
+
return (_jsxs("header", { "data-kumiko-layout": "shell-header", ...(plainNav && { "data-nav-style": "plain" }), className: cn("flex h-14 shrink-0 items-center gap-3 border-b border-border pl-1.5 pr-3 md:pl-4 md:pr-6", plainNav && "h-[58px] md:gap-2.5 md:px-5", (compact || bellInOverflow) && "relative", focused && "max-md:hidden"), children: [_jsxs("div", { className: "@container flex min-w-0 flex-1 items-center gap-3", children: [_jsx(ShellSidebarTrigger, { focused: focused, plainNav: plainNav }), _jsxs("div", { className: cn("flex min-w-0", compact ? "flex-col justify-center" : "items-center gap-3"), children: [_jsx(ShellBreadcrumb, { crumbs: shownCrumbs, parentOnly: parentOnly, bodyTitle: bodyTitle, titleOverride: titleOverride }), _jsx("div", { ref: setStatusElement, "data-kumiko-layout": "page-header-status", className: cn("flex items-center gap-2 empty:hidden", compact ? "min-w-0 max-w-full overflow-hidden whitespace-nowrap text-xs" : "shrink-0") })] })] }), _jsx(ShellHeaderEnd, { compact: compact, actionsRef: setActionsElement, headerActions: headerActions, overflowItems: slot?.overflowItems ?? [], bellScreens: showsBell ? allScreens : undefined, bellInOverflow: bellInOverflow })] }));
|
|
100
|
+
}
|
|
101
|
+
function foldsIntoOverflow(overflowItems, headerActions) {
|
|
102
|
+
if (overflowItems.length > 0)
|
|
103
|
+
return true;
|
|
104
|
+
return headerActions !== undefined && !isOnlyPinnedHeaderActions(headerActions);
|
|
105
|
+
}
|
|
106
|
+
// On a phone the app's headerActions fold into the menu, except the ones wrapped in HeaderActionPinned.
|
|
107
|
+
function VisibleHeaderActions({ compact, headerActions, }) {
|
|
108
|
+
if (!compact) {
|
|
109
|
+
if (headerActions === undefined)
|
|
110
|
+
return null;
|
|
111
|
+
return (_jsx("div", { "data-kumiko-layout": "header-actions", className: "flex items-center gap-2", children: headerActions }));
|
|
112
|
+
}
|
|
113
|
+
const pinnedActions = collectPinnedHeaderActions(headerActions);
|
|
114
|
+
if (pinnedActions.length === 0)
|
|
115
|
+
return null;
|
|
116
|
+
return (_jsx("div", { "data-kumiko-layout": "header-actions-pinned", className: "flex items-center gap-2", children: pinnedActions }));
|
|
117
|
+
}
|
|
118
|
+
function ShellHeaderEnd({ compact, actionsRef, headerActions, overflowItems, bellScreens, bellInOverflow, }) {
|
|
119
|
+
const hasOverflow = bellInOverflow || (compact && foldsIntoOverflow(overflowItems, headerActions));
|
|
120
|
+
return (_jsxs("div", { className: cn("ml-auto flex items-center gap-2", compact ? "min-w-0 max-w-[60%]" : "min-w-0 max-w-[50%] shrink-0 sm:max-w-none"), children: [_jsx("div", { ref: actionsRef, "data-kumiko-layout": "page-header-actions", className: cn(SHELL_HEADER_CONTROLS_CLASSES, "flex min-w-0 items-center gap-2 empty:hidden [&_*]:min-w-0 [&_*]:max-w-full [&_button]:overflow-hidden [&_button]:whitespace-nowrap", compact && "overflow-hidden") }), bellScreens !== undefined && !bellInOverflow && _jsx(NotificationBell, { screens: bellScreens }), _jsx(VisibleHeaderActions, { compact: compact, headerActions: headerActions }), hasOverflow && (_jsx(HeaderOverflow, { items: compact ? overflowItems : [], headerActions: compact ? headerActions : undefined, ...(bellInOverflow && bellScreens !== undefined && { bellScreens }) }))] }));
|
|
121
|
+
}
|
|
122
|
+
function ShellSidebarTrigger({ focused, plainNav, }) {
|
|
123
|
+
const t = useTranslation();
|
|
124
|
+
if (focused && !plainNav)
|
|
125
|
+
return null;
|
|
126
|
+
return (_jsx(SidebarTrigger, { label: t("kumiko.sidebar.toggle"), ...(plainNav && { icon: "panel-all-widths" }) }));
|
|
88
127
|
}
|
|
89
128
|
// A hand-rolled menu instead of Radix DropdownMenu: app headerActions are opaque
|
|
90
129
|
// nodes with their own popovers, and the panel stays mounted while closed so their
|
|
91
130
|
// effects (shortcut listeners) keep running.
|
|
92
131
|
const MENU_ITEM_SELECTOR = '[role="menuitem"]:not(:disabled)';
|
|
93
|
-
function
|
|
132
|
+
function OverflowBellEntry({ screens, anchorRef, onSelect, separated, }) {
|
|
133
|
+
return (_jsxs(_Fragment, { children: [_jsx(NotificationBell, { screens: screens, menuEntry: { anchorRef, onSelect } }), separated && _jsx("hr", { className: "-mx-1 my-1 border-t border-border" })] }));
|
|
134
|
+
}
|
|
135
|
+
function HeaderOverflow({ items, headerActions, bellScreens, }) {
|
|
94
136
|
const t = useTranslation();
|
|
95
137
|
const [open, setOpen] = useState(false);
|
|
96
138
|
const panelId = useId();
|
|
@@ -154,7 +196,7 @@ function HeaderOverflow({ items, headerActions, }) {
|
|
|
154
196
|
event.preventDefault();
|
|
155
197
|
menuItems[next]?.focus();
|
|
156
198
|
};
|
|
157
|
-
return (_jsxs(_Fragment, { children: [_jsx("button", { ref: triggerRef, type: "button", "aria-label": t("kumiko.page-header.actions"), "aria-haspopup": "menu", "aria-expanded": open, "aria-controls": panelId, "data-testid": "shell-header-overflow-trigger", onClick: () => setOpen((wasOpen) => !wasOpen), className: "inline-flex size-10 shrink-0 items-center justify-center rounded-md border border-input bg-background text-foreground shadow-xs hover:bg-accent focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring", children: _jsx(MoreHorizontal, { className: "size-4", "aria-hidden": "true" }) }), _jsxs("div", { ref: panelRef, id: panelId, role: "menu", "aria-label": t("kumiko.page-header.actions"), hidden: !open, onKeyDown: onPanelKeyDown, "data-testid": "shell-header-overflow", className: "absolute right-2 top-full z-30 mt-1 w-max min-w-[8rem] max-w-[calc(100vw-1rem)] rounded-md border bg-popover p-1 text-popover-foreground shadow-md", children: [items.length > 0 && (_jsx("div", { className: "flex flex-col", children: items.map((item) => (_jsxs("button", { type: "button", role: "menuitem", disabled: item.disabled === true, "data-testid": item.testId ?? `shell-header-overflow-item-${item.id}`, onClick: () => {
|
|
199
|
+
return (_jsxs(_Fragment, { children: [_jsx("button", { ref: triggerRef, type: "button", "aria-label": t("kumiko.page-header.actions"), "aria-haspopup": "menu", "aria-expanded": open, "aria-controls": panelId, "data-testid": "shell-header-overflow-trigger", onClick: () => setOpen((wasOpen) => !wasOpen), className: "inline-flex size-10 shrink-0 items-center justify-center rounded-md border border-input bg-background text-foreground shadow-xs hover:bg-accent focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring", children: _jsx(MoreHorizontal, { className: "size-4", "aria-hidden": "true" }) }), _jsxs("div", { ref: panelRef, id: panelId, role: "menu", "aria-label": t("kumiko.page-header.actions"), hidden: !open, onKeyDown: onPanelKeyDown, "data-testid": "shell-header-overflow", className: "absolute right-2 top-full z-30 mt-1 w-max min-w-[8rem] max-w-[calc(100vw-1rem)] rounded-md border bg-popover p-1 text-popover-foreground shadow-md", children: [bellScreens !== undefined && (_jsx(OverflowBellEntry, { screens: bellScreens, anchorRef: triggerRef, onSelect: () => setOpen(false), separated: items.length > 0 || headerActions !== undefined })), items.length > 0 && (_jsx("div", { className: "flex flex-col", children: items.map((item) => (_jsxs("button", { type: "button", role: "menuitem", disabled: item.disabled === true, "data-testid": item.testId ?? `shell-header-overflow-item-${item.id}`, onClick: () => {
|
|
158
200
|
setOpen(false);
|
|
159
201
|
item.onSelect();
|
|
160
202
|
}, className: cn(headerOverflowMenuItemClass, item.variant === "danger" && "text-destructive"), children: [item.icon !== undefined && Object.hasOwn(NAV_ICONS, item.icon) && (_jsx(Icon, { name: item.icon, className: "size-4 shrink-0" })), item.label] }, item.id))) })), items.length > 0 && headerActions !== undefined && (_jsx("hr", { className: "-mx-1 my-1 border-t border-border" })), headerActions !== undefined && (_jsx("div", { "data-kumiko-layout": "header-actions",
|
|
@@ -162,3 +204,18 @@ function HeaderOverflow({ items, headerActions, }) {
|
|
|
162
204
|
// being restyled through a child selector that reaches into their markup.
|
|
163
205
|
className: "flex flex-col items-stretch gap-1", onClick: () => setOpen(false), children: _jsx(HeaderOverflowMenuContext.Provider, { value: true, children: headerActions }) }))] })] }));
|
|
164
206
|
}
|
|
207
|
+
// The bar's breadcrumb: only the page title truncates, parents stay whole and leave when the space is too narrow.
|
|
208
|
+
function ShellBreadcrumb({ crumbs, parentOnly, bodyTitle, titleOverride, }) {
|
|
209
|
+
const nav = useNav();
|
|
210
|
+
const t = useTranslation();
|
|
211
|
+
if (crumbs === undefined || crumbs.length === 0)
|
|
212
|
+
return null;
|
|
213
|
+
return (_jsx(Breadcrumb, { className: "min-w-0", "aria-label": t("kumiko.breadcrumb.label"), children: _jsx(BreadcrumbList, { className: "flex-nowrap gap-1.5 sm:gap-1.5", children: crumbs.map((crumb, index) => {
|
|
214
|
+
const screenId = crumb.screenId;
|
|
215
|
+
const isLast = index === crumbs.length - 1;
|
|
216
|
+
return (_jsxs(Fragment, { children: [index > 0 && (_jsx(BreadcrumbSeparator, { className: "hidden text-muted-foreground @xs:inline-flex [&>svg]:size-3.5" })), _jsx(BreadcrumbItem, { className: cn(isLast ? "min-w-0" : "hidden shrink-0 @xs:inline-flex"), children: screenId !== undefined && (!isLast || parentOnly) ? (_jsxs(BreadcrumbLink, { href: "#", className: cn("whitespace-nowrap text-foreground-secondary", parentOnly && "text-[17px] font-semibold text-foreground"), onClick: (e) => {
|
|
217
|
+
e.preventDefault();
|
|
218
|
+
nav.navigate({ screenId });
|
|
219
|
+
}, children: [parentOnly && (_jsx(ChevronLeft, { className: "me-0.5 inline size-4 align-text-bottom", "aria-hidden": "true" })), crumb.label] })) : isLast && bodyTitle ? (_jsx("span", { className: "truncate text-lg font-semibold text-foreground", children: crumb.label })) : isLast ? (_jsx("h1", { "aria-current": "page", title: titleOverride ?? crumb.label, className: "truncate text-lg font-semibold text-foreground", children: titleOverride ?? crumb.label })) : (_jsx(BreadcrumbPage, { className: "whitespace-nowrap text-foreground-secondary", children: crumb.label })) })] }, screenId ?? crumb.label));
|
|
220
|
+
}) }) }));
|
|
221
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export type PersistedSidebarOpen = {
|
|
2
|
+
readonly open: boolean;
|
|
3
|
+
readonly setOpen: (open: boolean) => void;
|
|
4
|
+
};
|
|
5
|
+
/** The sidebar's expanded state, changed only by user actions and kept across screens and reloads. */
|
|
6
|
+
export declare function usePersistedSidebarOpen(): PersistedSidebarOpen;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { useCallback, useState } from "react";
|
|
2
|
+
const STORAGE_KEY = "kumiko.sidebar.open";
|
|
3
|
+
// Expanded unless the user collapsed it; storage failures (privacy mode, SSR) fall back to expanded.
|
|
4
|
+
function readStoredOpen() {
|
|
5
|
+
try {
|
|
6
|
+
return window.localStorage.getItem(STORAGE_KEY) !== "false";
|
|
7
|
+
}
|
|
8
|
+
catch {
|
|
9
|
+
return true;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
function writeStoredOpen(open) {
|
|
13
|
+
try {
|
|
14
|
+
window.localStorage.setItem(STORAGE_KEY, String(open));
|
|
15
|
+
}
|
|
16
|
+
catch {
|
|
17
|
+
// storage unavailable: the choice just stops surviving a reload
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
/** The sidebar's expanded state, changed only by user actions and kept across screens and reloads. */
|
|
21
|
+
export function usePersistedSidebarOpen() {
|
|
22
|
+
const [open, setOpenState] = useState(readStoredOpen);
|
|
23
|
+
const setOpen = useCallback((next) => {
|
|
24
|
+
setOpenState(next);
|
|
25
|
+
writeStoredOpen(next);
|
|
26
|
+
}, []);
|
|
27
|
+
return { open, setOpen };
|
|
28
|
+
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const UNIFORM_BAR_CONTROLS_CLASSES = "[&_[data-slot=button]:not([data-size^=icon])]:h-9 [&_[data-slot=input]]:h-9";
|
|
2
|
-
export declare const SHELL_HEADER_CONTROLS_CLASSES = "[&_[data-slot=button]:not([data-size^=icon])]:h-8 [&_[data-slot=input]]:h-8";
|
|
1
|
+
export declare const UNIFORM_BAR_CONTROLS_CLASSES = "[&_[data-slot=button]:not([data-size^=icon])]:h-9 [&_[data-slot=input]]:h-9 max-md:[&_[data-slot=button]:not([data-size^=icon])]:h-11 max-md:[&_[data-slot=input]]:h-11";
|
|
2
|
+
export declare const SHELL_HEADER_CONTROLS_CLASSES = "[&_[data-slot=button]:not([data-size^=icon])]:h-8 [&_[data-slot=input]]:h-8 max-md:[&_[data-slot=button]:not([data-size^=icon])]:h-11 max-md:[&_[data-slot=input]]:h-11";
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
// Header and toolbar controls share one height whatever size a screen, app or
|
|
2
2
|
// primitive asked for: the descendant selector outranks the button's own
|
|
3
|
-
// size utilities. Icon-only buttons keep their square size.
|
|
4
|
-
|
|
3
|
+
// size utilities. Icon-only buttons keep their square size. The max-md variants have
|
|
4
|
+
// the same specificity and come later, so phones keep the 44 px touch height.
|
|
5
|
+
export const UNIFORM_BAR_CONTROLS_CLASSES = "[&_[data-slot=button]:not([data-size^=icon])]:h-9 [&_[data-slot=input]]:h-9 max-md:[&_[data-slot=button]:not([data-size^=icon])]:h-11 max-md:[&_[data-slot=input]]:h-11";
|
|
5
6
|
// The shell header's own controls (workspace and tenant switcher, language, theme) are h-8,
|
|
6
7
|
// so screen actions portalled next to them get h-8 too instead of the toolbar's h-9.
|
|
7
|
-
export const SHELL_HEADER_CONTROLS_CLASSES = "[&_[data-slot=button]:not([data-size^=icon])]:h-8 [&_[data-slot=input]]:h-8";
|
|
8
|
+
export const SHELL_HEADER_CONTROLS_CLASSES = "[&_[data-slot=button]:not([data-size^=icon])]:h-8 [&_[data-slot=input]]:h-8 max-md:[&_[data-slot=button]:not([data-size^=icon])]:h-11 max-md:[&_[data-slot=input]]:h-11";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { IN_APP_NOTIFICATION_DELIVERED_EVENT, IN_APP_NOTIFICATION_QUERIES, IN_APP_NOTIFICATION_WRITES, } from "@cosmicdrift/kumiko-types/in-app-notification-types";
|
|
2
|
-
import { useCallback, useEffect, useState } from "react";
|
|
2
|
+
import { useCallback, useEffect, useRef, useState } from "react";
|
|
3
3
|
import { useDispatcher } from "../../context/dispatcher-context.js";
|
|
4
4
|
import { useMutation } from "../../hooks/use-mutation.js";
|
|
5
5
|
import { useQuery } from "../../hooks/use-query.js";
|
|
@@ -18,7 +18,10 @@ export function useInAppInbox(open) {
|
|
|
18
18
|
const markAllReadWrite = useMutation(IN_APP_NOTIFICATION_WRITES.markAllRead);
|
|
19
19
|
const refetchCount = count.refetch;
|
|
20
20
|
const refetchFirstPage = firstPage.refetch;
|
|
21
|
+
// Bumped by every refetch so a loadMore started before it cannot append stale rows afterwards.
|
|
22
|
+
const generation = useRef(0);
|
|
21
23
|
const refetchAll = useCallback(async () => {
|
|
24
|
+
generation.current += 1;
|
|
22
25
|
setOlderRows([]);
|
|
23
26
|
setOlderCursor(undefined);
|
|
24
27
|
await Promise.all([refetchCount(), open ? refetchFirstPage() : Promise.resolve()]);
|
|
@@ -30,6 +33,7 @@ export function useInAppInbox(open) {
|
|
|
30
33
|
// skip: no older page left
|
|
31
34
|
if (nextCursor === null)
|
|
32
35
|
return;
|
|
36
|
+
const startedAt = generation.current;
|
|
33
37
|
const result = await dispatcher.query(IN_APP_NOTIFICATION_QUERIES.inbox, {
|
|
34
38
|
limit: IN_APP_INBOX_PAGE_SIZE,
|
|
35
39
|
cursor: nextCursor,
|
|
@@ -37,6 +41,9 @@ export function useInAppInbox(open) {
|
|
|
37
41
|
// skip: keep the loaded rows, the next click retries
|
|
38
42
|
if (!result.isSuccess)
|
|
39
43
|
return;
|
|
44
|
+
// skip: a refetch reset the list while this page was in flight
|
|
45
|
+
if (generation.current !== startedAt)
|
|
46
|
+
return;
|
|
40
47
|
setOlderRows((previous) => [...previous, ...result.data.rows]);
|
|
41
48
|
setOlderCursor(result.data.nextCursor);
|
|
42
49
|
}, [dispatcher, nextCursor]);
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { type ReactNode } from "react";
|
|
2
2
|
import type { AppSchema, FeatureSchema, WorkspaceSchema } from "../../index.ts";
|
|
3
|
+
import { type ShellNavStyle } from "./shell-style.tsx";
|
|
3
4
|
export type WorkspaceShellUser = {
|
|
4
5
|
readonly id: string;
|
|
5
6
|
readonly roles: readonly string[];
|
|
@@ -34,10 +35,19 @@ export type WorkspaceShellProps = {
|
|
|
34
35
|
* scrolls INSIDE instead of the whole page. Default true — set
|
|
35
36
|
* `fill={false}` to opt back into page scroll. */
|
|
36
37
|
readonly fill?: boolean;
|
|
38
|
+
/** Surface behind the screen content. `"card"` (default) keeps the inset on `bg-card`;
|
|
39
|
+
* `"background"` lets the page background show through so cards stand out from it. */
|
|
40
|
+
readonly contentSurface?: "card" | "background";
|
|
41
|
+
/** `"plain"` renders the sidebar without leading icons while expanded (the focus rail and the
|
|
42
|
+
* collapsed rail keep them), with uppercase group labels, quiet active entries, a panel-symbol
|
|
43
|
+
* sidebar trigger and a 58px title bar. `"default"` keeps the icon navigation. */
|
|
44
|
+
readonly navStyle?: ShellNavStyle;
|
|
45
|
+
/** `"header"` (default) draws the notification bell in the title bar; `"overflow"` moves it into the "…" menu, which then shows on every width. */
|
|
46
|
+
readonly notificationBellPlacement?: "header" | "overflow";
|
|
37
47
|
/** Screen content. */
|
|
38
48
|
readonly children: ReactNode;
|
|
39
49
|
};
|
|
40
|
-
export declare function WorkspaceShell({ brand, schema, topbarActions, user, initialWorkspaceId, sidebarFooter, focusRailNavQns, navBadges, fill, children, }: WorkspaceShellProps): ReactNode;
|
|
50
|
+
export declare function WorkspaceShell({ brand, schema, topbarActions, user, initialWorkspaceId, sidebarFooter, focusRailNavQns, navBadges, fill, contentSurface, navStyle, notificationBellPlacement, children, }: WorkspaceShellProps): ReactNode;
|
|
41
51
|
export declare function filterByAccess(workspaces: readonly WorkspaceSchema[], userRoles: readonly string[] | undefined): readonly WorkspaceSchema[];
|
|
42
52
|
/** Returns the short screen-id of the first nav-member that points at
|
|
43
53
|
* a screen. Walks the workspace's nav-list in order and skips section
|
|
@@ -31,20 +31,23 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
31
31
|
// rule that NavDefinition.access follows)
|
|
32
32
|
import { isUiAccessGranted } from "@cosmicdrift/kumiko-framework/ui-types";
|
|
33
33
|
import { useCallback, useLayoutEffect, useMemo } from "react";
|
|
34
|
-
import { qualifyNavId, toAppSchema, UserRolesProvider, useNav, useTranslation, } from "../../index.js";
|
|
34
|
+
import { qualifyNavId, ScreenFocusProvider, toAppSchema, UserRolesProvider, useNav, useTranslation, } from "../../index.js";
|
|
35
35
|
import { useResolvers } from "../app/resolvers-context.js";
|
|
36
|
+
import { cn } from "../lib/cn.js";
|
|
36
37
|
import { Sidebar, SidebarContent, SidebarFooter, SidebarHeader, SidebarInset, SidebarProvider, SidebarRail, } from "../ui/sidebar.js";
|
|
37
38
|
import { EditorPanel } from "./editor-panel.js";
|
|
38
39
|
import { fillClasses } from "./fill-classes.js";
|
|
39
|
-
import { FocusAwareSidebarBody,
|
|
40
|
+
import { FocusAwareSidebarBody, sidebarProviderProps } from "./focus-aware-sidebar.js";
|
|
40
41
|
import { lastSegment, NavTree } from "./nav-tree.js";
|
|
41
42
|
import { PageHeaderSlotProvider } from "./page-header-slot.js";
|
|
42
|
-
import { ShellFocusProvider, useShellFocusHost } from "./shell-focus.js";
|
|
43
|
+
import { ShellFocusProvider, ShellTopbarActionsProvider, useShellFocusHost, } from "./shell-focus.js";
|
|
43
44
|
import { ShellHeader } from "./shell-header.js";
|
|
45
|
+
import { ShellNavStyleProvider } from "./shell-style.js";
|
|
46
|
+
import { usePersistedSidebarOpen } from "./sidebar-open-state.js";
|
|
44
47
|
import { SidebarPanelProvider, useSidebarPanelHost } from "./sidebar-panel.js";
|
|
45
48
|
import { parseTargetFromSearchParams } from "./target-url.js";
|
|
46
49
|
import { WorkspaceSwitcher } from "./workspace-switcher.js";
|
|
47
|
-
export function WorkspaceShell({ brand, schema, topbarActions, user, initialWorkspaceId, sidebarFooter, focusRailNavQns, navBadges, fill = true, children, }) {
|
|
50
|
+
export function WorkspaceShell({ brand, schema, topbarActions, user, initialWorkspaceId, sidebarFooter, focusRailNavQns, navBadges, fill = true, contentSurface = "card", navStyle = "default", notificationBellPlacement = "header", children, }) {
|
|
48
51
|
const app = useMemo(() => toAppSchema(schema), [schema]);
|
|
49
52
|
const visible = useMemo(() => filterByAccess(app.workspaces ?? [], user?.roles), [app.workspaces, user?.roles]);
|
|
50
53
|
const nav = useNav();
|
|
@@ -153,7 +156,8 @@ export function WorkspaceShell({ brand, schema, topbarActions, user, initialWork
|
|
|
153
156
|
// otherwise every other screen would have an empty strip beside the navigation.
|
|
154
157
|
const panel = useSidebarPanelHost();
|
|
155
158
|
const focus = useShellFocusHost();
|
|
156
|
-
|
|
159
|
+
const sidebarOpen = usePersistedSidebarOpen();
|
|
160
|
+
return (_jsx(ShellNavStyleProvider, { value: navStyle, children: _jsx(ScreenFocusProvider, { children: _jsx(SidebarProvider, { ...fillCls.provider, ...sidebarProviderProps(focus, sidebarOpen), children: _jsx(ShellFocusProvider, { value: focus.value, children: _jsx(ShellTopbarActionsProvider, { value: topbarActions, children: _jsxs(SidebarPanelProvider, { value: panel.value, children: [_jsxs(Sidebar, { collapsible: "icon", mobileTitle: t("kumiko.sidebar.title"), mobileDescription: t("kumiko.sidebar.description"), children: [_jsxs(FocusAwareSidebarBody, { focused: focus.focused, brand: brand, schema: app, user: user, allowedNavQns: allowedNavQns, railNavQns: focusRailNavQns, footer: sidebarFooter, children: [_jsxs(SidebarHeader, { "data-kumiko-layout": "sidebar-header", children: [brand, switcher] }), _jsx(SidebarContent, { "data-kumiko-layout": "sidebar-nav", children: sidebarContent }), sidebarFooter !== undefined && (_jsx(SidebarFooter, { "data-kumiko-layout": "sidebar-footer", className: "border-t border-sidebar-border", children: sidebarFooter }))] }), _jsx(SidebarRail, { "aria-label": t("kumiko.sidebar.toggle"), title: t("kumiko.sidebar.toggle") })] }), _jsx("div", { ref: panel.ref, "data-kumiko-layout": "sidebar-panel", className: panel.occupied ? "flex h-svh shrink-0 flex-col" : "hidden" }), _jsx(SidebarInset, { className: cn(fillCls.inset, contentSurface === "background" && "bg-background"), children: _jsxs(PageHeaderSlotProvider, { children: [_jsx(ShellHeader, { schema: app, ...(user !== undefined && { user }), ...(allowedNavQns !== undefined && { allowedNavQns }), ...(topbarActions !== undefined && { headerActions: topbarActions }), notificationBellPlacement: notificationBellPlacement }), _jsx("main", { className: fillCls.main, children: activeTarget !== undefined ? (_jsx(EditorPanel, { resolvers: resolvers })) : (_jsx(UserRolesProvider, { roles: user?.roles, children: children })) })] }) })] }) }) }) }) }) }));
|
|
157
161
|
}
|
|
158
162
|
// --- helpers (exported for tests) ---
|
|
159
163
|
export function filterByAccess(workspaces, userRoles) {
|
|
@@ -7,6 +7,6 @@ export declare class FileUploadFailedError extends Error {
|
|
|
7
7
|
readonly code?: string | undefined;
|
|
8
8
|
constructor(message: string, fromServer: boolean, httpStatus?: number | undefined, code?: string | undefined);
|
|
9
9
|
}
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
/** Posts one file to the stack's file endpoint (double-submit CSRF) and returns the new FileRef id,
|
|
11
|
+
* or the claim handle when the server issued one (anonymous uploads), which a save must submit. */
|
|
12
12
|
export declare function uploadFileRef(file: Blob, target?: FileRefTarget): Promise<string>;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { propertyOf } from "@cosmicdrift/kumiko-types/type-guards";
|
|
2
2
|
import { CSRF_HEADER_NAME, readCsrfToken } from "../../live/index.js";
|
|
3
|
-
import { isSessionEndedError } from "../../session/session-ended.js";
|
|
4
3
|
import { buildFileUploadFormData } from "./file-upload-form-data.js";
|
|
5
4
|
/** Carries the server's own `error` message when the upload endpoint sent one. */
|
|
6
5
|
export class FileUploadFailedError extends Error {
|
|
@@ -14,13 +13,8 @@ export class FileUploadFailedError extends Error {
|
|
|
14
13
|
this.code = code;
|
|
15
14
|
}
|
|
16
15
|
}
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
cause.code !== undefined &&
|
|
20
|
-
cause.httpStatus !== undefined &&
|
|
21
|
-
isSessionEndedError({ code: cause.code, httpStatus: cause.httpStatus }));
|
|
22
|
-
}
|
|
23
|
-
/** Posts one file to the stack's file endpoint (double-submit CSRF) and returns the new FileRef id. */
|
|
16
|
+
/** Posts one file to the stack's file endpoint (double-submit CSRF) and returns the new FileRef id,
|
|
17
|
+
* or the claim handle when the server issued one (anonymous uploads), which a save must submit. */
|
|
24
18
|
export async function uploadFileRef(file, target) {
|
|
25
19
|
const csrf = readCsrfToken();
|
|
26
20
|
const res = await fetch("/api/files", {
|
|
@@ -30,6 +24,7 @@ export async function uploadFileRef(file, target) {
|
|
|
30
24
|
});
|
|
31
25
|
const json = await res.json().catch(() => ({}));
|
|
32
26
|
const id = propertyOf(json, "id");
|
|
27
|
+
const handle = propertyOf(json, "handle");
|
|
33
28
|
if (!res.ok || typeof id !== "string") {
|
|
34
29
|
const message = propertyOf(json, "error");
|
|
35
30
|
const code = propertyOf(json, "code");
|
|
@@ -37,5 +32,5 @@ export async function uploadFileRef(file, target) {
|
|
|
37
32
|
? new FileUploadFailedError(message, true, res.status, typeof code === "string" ? code : undefined)
|
|
38
33
|
: new FileUploadFailedError(`upload failed (${res.status})`, false, res.status);
|
|
39
34
|
}
|
|
40
|
-
return id;
|
|
35
|
+
return typeof handle === "string" ? handle : id;
|
|
41
36
|
}
|
|
@@ -25,6 +25,7 @@ export function usePresence({ entity, id, activity, focus, enabled = true, }) {
|
|
|
25
25
|
return;
|
|
26
26
|
let stopped = false;
|
|
27
27
|
let timer;
|
|
28
|
+
let latestRequest = 0;
|
|
28
29
|
const stop = () => {
|
|
29
30
|
stopped = true;
|
|
30
31
|
if (timer !== undefined)
|
|
@@ -37,6 +38,7 @@ export function usePresence({ entity, id, activity, focus, enabled = true, }) {
|
|
|
37
38
|
return;
|
|
38
39
|
const current = latest.current;
|
|
39
40
|
lastSentKey.current = stateKey(current.activity, current.focus);
|
|
41
|
+
const request = ++latestRequest;
|
|
40
42
|
const result = await dispatcher.write(PRESENCE_WRITES.heartbeat, {
|
|
41
43
|
entity,
|
|
42
44
|
id,
|
|
@@ -46,8 +48,11 @@ export function usePresence({ entity, id, activity, focus, enabled = true, }) {
|
|
|
46
48
|
// skip: the answer belongs to a record that is no longer open
|
|
47
49
|
if (stopped)
|
|
48
50
|
return;
|
|
49
|
-
|
|
50
|
-
|
|
51
|
+
// An older answer arriving after a newer one would show a stale roster until the next beat.
|
|
52
|
+
if (result.isSuccess) {
|
|
53
|
+
if (request === latestRequest)
|
|
54
|
+
setOthers(result.data.others);
|
|
55
|
+
}
|
|
51
56
|
else if (isPermanentPresenceFailure(result.error))
|
|
52
57
|
stop();
|
|
53
58
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { ReactNode } from "react";
|
|
2
2
|
import type { BannerProps } from "../../index.ts";
|
|
3
3
|
import "../react-css-custom-properties.ts";
|
|
4
|
-
export declare function DefaultBanner({ variant, density, icon, title, titleTestId, children, parts, actions, actionsPlacement, padded, testId, id, }: BannerProps): ReactNode;
|
|
4
|
+
export declare function DefaultBanner({ variant, density, icon, title, narrowTitle, narrowText, titleTestId, children, parts, actions, actionsPlacement, padded, inline, testId, id, }: BannerProps): ReactNode;
|