@cosmicdrift/kumiko-renderer 0.413.1 → 0.414.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 +30 -50
- package/dist/app/form-schema.d.ts +1 -0
- package/dist/app/form-schema.js +24 -0
- 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 +17 -3
- package/dist/app/named-filter-facet.js +88 -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 +101 -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 +75 -18
- 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 +19 -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 +25 -0
- package/dist/app/use-entity-list-payload.js +57 -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 +4 -4
- package/dist/app/use-projection-detail-actions.js +30 -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 +11 -0
- package/dist/app/use-row-decoration.js +55 -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/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 +8 -1
- package/dist/components/list-empty-state.js +4 -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 +8 -0
- package/dist/components/render-list-hint-columns.js +77 -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 +3 -0
- 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 +2 -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 +1 -0
- package/dist/headless/pwa-service-worker-meta.js +3 -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 +33 -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 +37 -2
- 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 +2 -0
- package/dist/primitives-record-guidance.d.ts +53 -0
- package/dist/primitives-record-guidance.js +1 -0
- package/dist/primitives.d.ts +41 -31
- 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 +149 -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 +6 -23
- package/dist/web/app/dashboard-panels.js +53 -123
- package/dist/web/app/dashboard-reference-list-table.d.ts +5 -1
- package/dist/web/app/dashboard-reference-list-table.js +12 -4
- package/dist/web/app/dashboard-shared.d.ts +23 -7
- package/dist/web/app/dashboard-shared.js +44 -17
- package/dist/web/app/dashboard-stat-group-panel.d.ts +13 -0
- package/dist/web/app/dashboard-stat-group-panel.js +67 -0
- package/dist/web/app/dashboard-text-panel.d.ts +12 -0
- package/dist/web/app/dashboard-text-panel.js +163 -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/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/index.d.ts +7 -1
- package/dist/web/index.js +5 -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 +5 -0
- package/dist/web/layout/nav-collapse-state.js +66 -0
- package/dist/web/layout/nav-tree.js +25 -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 +6 -5
- package/dist/web/layout/shell-focus.js +12 -9
- package/dist/web/layout/shell-header.js +38 -10
- 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.js +6 -4
- 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 +14 -6
- package/dist/web/primitives/calendar-day-picker.js +24 -5
- package/dist/web/primitives/card.js +1 -1
- package/dist/web/primitives/code-input.js +6 -1
- package/dist/web/primitives/data-table/actions-column.d.ts +1 -0
- package/dist/web/primitives/data-table/actions-column.js +4 -2
- package/dist/web/primitives/data-table/card-body.d.ts +5 -0
- package/dist/web/primitives/data-table/card-body.js +47 -5
- 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 +40 -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 +16 -0
- package/dist/web/primitives/data-table/hint-cell.js +74 -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/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 +10 -5
- 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 +17 -3
- package/dist/web/primitives/data-table/toolbar-end-cluster.js +1 -1
- package/dist/web/primitives/data-table/toolbar.js +31 -3
- package/dist/web/primitives/data-table/totals-footer.d.ts +20 -0
- package/dist/web/primitives/data-table/totals-footer.js +40 -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 +96 -19
- 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 +4 -2
- package/dist/web/primitives/facet-filter.js +26 -3
- package/dist/web/primitives/facet-search-filter.js +1 -1
- 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 +19 -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 +2 -2
- package/dist/web/primitives/metric.js +8 -6
- package/dist/web/primitives/page-header.d.ts +1 -1
- package/dist/web/primitives/page-header.js +8 -1
- package/dist/web/primitives/pager.js +29 -18
- 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 +45 -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 +5 -7
- package/dist/web/pwa/pwa-support.d.ts +4 -0
- package/dist/web/pwa/pwa-support.js +113 -0
- package/dist/web/sse/live-events.js +2 -2
- package/dist/web/tokens.js +0 -3
- 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 +54 -0
- package/dist/web/widgets/dashboard-list.d.ts +37 -5
- package/dist/web/widgets/dashboard-list.js +95 -20
- package/dist/web/widgets/drawer-sizing.js +1 -1
- 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/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/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 +10 -1
- package/dist/web/widgets/stat.js +14 -5
- 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/upload-zone.d.ts +8 -1
- package/dist/web/widgets/upload-zone.js +13 -3
- package/package.json +5 -5
- package/src/changes.json +217 -0
- package/src/web/styles.css +9 -0
|
@@ -18,15 +18,18 @@ function noticeOf(groups, totals) {
|
|
|
18
18
|
}
|
|
19
19
|
/** The groups and totals aggregate queries plus a refresh that reloads both. */
|
|
20
20
|
function useAggregateQueries(args) {
|
|
21
|
-
const { queryType, base, groupField, measures } = args;
|
|
21
|
+
const { queryType, base, groupField, measures, paused } = args;
|
|
22
22
|
const grouped = groupField !== undefined;
|
|
23
23
|
const withTotals = measures.length > 0;
|
|
24
24
|
const groupsPayload = useMemo(() => ({ ...base, aggregate: { groupBy: groupField, measures } }), [base, groupField, measures]);
|
|
25
25
|
const totalsPayload = useMemo(() => ({ ...base, aggregate: { measures } }), [base, measures]);
|
|
26
|
-
const groupsQuery = useQuery(queryType, groupsPayload, {
|
|
26
|
+
const groupsQuery = useQuery(queryType, groupsPayload, {
|
|
27
|
+
live: true,
|
|
28
|
+
enabled: grouped && !paused,
|
|
29
|
+
});
|
|
27
30
|
const totalsQuery = useQuery(queryType, totalsPayload, {
|
|
28
31
|
live: true,
|
|
29
|
-
enabled: withTotals,
|
|
32
|
+
enabled: withTotals && !paused,
|
|
30
33
|
});
|
|
31
34
|
const [refreshNonce, setRefreshNonce] = useState(0);
|
|
32
35
|
const refetchGroups = groupsQuery.refetch;
|
|
@@ -51,7 +54,7 @@ function useAggregateQueries(args) {
|
|
|
51
54
|
}
|
|
52
55
|
/** Server-side grouping and totals of a list: groups are the load unit, each open
|
|
53
56
|
* and visible group pages through its own rows; nothing is summed on the client. */
|
|
54
|
-
export function useListAggregates({ queryType, payload, table, groupField, pageSize, paging, translate, }) {
|
|
57
|
+
export function useListAggregates({ queryType, payload, table, groupField, pageSize, paging, translate, paused = false, }) {
|
|
55
58
|
const grouping = table?.grouping;
|
|
56
59
|
const totalSpecs = useMemo(() => table?.totals ?? [], [table?.totals]);
|
|
57
60
|
const base = useMemo(() => withoutListPaging(payload), [payload]);
|
|
@@ -63,6 +66,7 @@ export function useListAggregates({ queryType, payload, table, groupField, pageS
|
|
|
63
66
|
base,
|
|
64
67
|
groupField,
|
|
65
68
|
measures,
|
|
69
|
+
paused,
|
|
66
70
|
});
|
|
67
71
|
const { state, onToggle, onHeaderVisible, onLoadMore, onResult } = useGroupLoadState(`${groupField ?? ""}|${baseKey}`);
|
|
68
72
|
const active = groupField !== undefined && groupsAnswer !== undefined;
|
|
@@ -99,7 +103,7 @@ export function useListAggregates({ queryType, payload, table, groupField, pageS
|
|
|
99
103
|
...(serverGroups !== undefined && { serverGroups }),
|
|
100
104
|
...(totals !== undefined && { totals }),
|
|
101
105
|
...(notice !== undefined && { notice }),
|
|
102
|
-
groupPages: { queryType, requests, onResult, refreshNonce },
|
|
106
|
+
groupPages: { queryType, requests, onResult, refreshNonce, resetKey: state.resetKey },
|
|
103
107
|
refresh,
|
|
104
108
|
loading: grouped && groupsAnswer === undefined && groupsError === null,
|
|
105
109
|
error: groupsError,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ListTableOptions } from "@cosmicdrift/kumiko-types/screen";
|
|
1
|
+
import type { ListTableFrame, ListTableOptions } from "@cosmicdrift/kumiko-types/screen";
|
|
2
2
|
import type { DataTableExport, DataTableResetAll, DataTableViewOptions } from "../data-table-view-types.ts";
|
|
3
3
|
import { type ListViewSchemaColumn } from "./use-list-view-state.ts";
|
|
4
4
|
type ListTableArgs = {
|
|
@@ -28,6 +28,7 @@ export type ListTableProps = {
|
|
|
28
28
|
readonly resetAll?: DataTableResetAll;
|
|
29
29
|
readonly exportList?: DataTableExport;
|
|
30
30
|
readonly compactHeader?: boolean;
|
|
31
|
+
readonly frame?: ListTableFrame;
|
|
31
32
|
};
|
|
32
33
|
export type ListTableState = {
|
|
33
34
|
readonly props: ListTableProps;
|
|
@@ -4,13 +4,6 @@ import { useListStateStore } from "../components/list-state-store.js";
|
|
|
4
4
|
import { isListStateAtDefault, listResetUpdates } from "./list-reset.js";
|
|
5
5
|
import { useListViewState } from "./use-list-view-state.js";
|
|
6
6
|
const NO_TABLE_OPTIONS = {};
|
|
7
|
-
const PAGING_PAYLOAD_KEYS = ["limit", "offset", "cursor", "totalCount", "filter"];
|
|
8
|
-
function withoutPaging(payload) {
|
|
9
|
-
const kept = { ...payload };
|
|
10
|
-
for (const key of PAGING_PAYLOAD_KEYS)
|
|
11
|
-
delete kept[key];
|
|
12
|
-
return kept;
|
|
13
|
-
}
|
|
14
7
|
/** Props for the DataTable's `view` / `resetAll` from a screen's `table` block. */
|
|
15
8
|
export function useListTable({ storeKey, table, schemaColumns, url, local, exportSource, }) {
|
|
16
9
|
const nav = useNav();
|
|
@@ -79,14 +72,15 @@ export function useListTable({ storeKey, table, schemaColumns, url, local, expor
|
|
|
79
72
|
return undefined;
|
|
80
73
|
const ordered = viewColumns?.filter((column) => column.visible).map((column) => column.field) ??
|
|
81
74
|
schemaColumns.map((column) => column.field);
|
|
82
|
-
return { ...exportSource,
|
|
75
|
+
return { ...exportSource, columns: ordered };
|
|
83
76
|
}, [exportEnabled, exportSource, viewColumns, schemaColumns]);
|
|
84
77
|
const props = useMemo(() => ({
|
|
85
78
|
...(view !== undefined && { view }),
|
|
86
79
|
...(resetAll !== undefined && { resetAll }),
|
|
87
80
|
...(exportList !== undefined && { exportList }),
|
|
88
81
|
...(options.compactHeader === true && { compactHeader: true }),
|
|
89
|
-
|
|
82
|
+
...(options.frame !== undefined && { frame: options.frame }),
|
|
83
|
+
}), [view, resetAll, exportList, options.compactHeader, options.frame]);
|
|
90
84
|
const groupField = options.grouping !== undefined && viewState.groupBy !== "" ? viewState.groupBy : undefined;
|
|
91
85
|
return { props, groupField };
|
|
92
86
|
}
|
|
@@ -17,6 +17,8 @@ export type ListUrlState = {
|
|
|
17
17
|
readonly filters: Readonly<Record<string, readonly string[]>>;
|
|
18
18
|
/** Id of the active named list filter; undefined when none is set. */
|
|
19
19
|
readonly namedFilter: string | undefined;
|
|
20
|
+
/** The facet filters the list sends while `namedFilter` is the active named filter: author defaults apply only without one. */
|
|
21
|
+
readonly filtersFor: (namedFilter: string | undefined) => Readonly<Record<string, readonly string[]>>;
|
|
20
22
|
};
|
|
21
23
|
export type ListUrlStateApi = ListUrlState & {
|
|
22
24
|
/** Atomically sets sort + dir. null means unsorted and clears both keys. */
|
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
// flood the browser history.
|
|
19
19
|
import { useCallback, useMemo } from "react";
|
|
20
20
|
import { useNav } from "../app/nav.js";
|
|
21
|
+
import { NAMED_FILTER_PARAM_SUFFIX } from "./list-state-schema.js";
|
|
21
22
|
// A facet with a `defaultFilters` entry falls back to that default whenever
|
|
22
23
|
// its URL key is absent. Clearing it therefore has to leave a marker, or the
|
|
23
24
|
// default would come straight back.
|
|
@@ -42,7 +43,7 @@ export function listFilterUrlKey(screenId, field) {
|
|
|
42
43
|
}
|
|
43
44
|
/** URL key of the named list filter id. Distinct from the `f.` facet prefix. */
|
|
44
45
|
export function listNamedFilterUrlKey(screenId) {
|
|
45
|
-
return key(screenId,
|
|
46
|
+
return key(screenId, NAMED_FILTER_PARAM_SUFFIX);
|
|
46
47
|
}
|
|
47
48
|
function parseDir(value) {
|
|
48
49
|
return value === "asc" || value === "desc" ? value : undefined;
|
|
@@ -71,7 +72,7 @@ export function useListUrlState(screenId, defaultFilters) {
|
|
|
71
72
|
// The named filter defines the view, so author defaults must not narrow it further.
|
|
72
73
|
const effectiveDefaultFilters = namedFilter === undefined ? defaultFilters : undefined;
|
|
73
74
|
const filterPrefix = listFilterUrlKey(screenId, "");
|
|
74
|
-
const
|
|
75
|
+
const urlFilters = useMemo(() => {
|
|
75
76
|
const out = {};
|
|
76
77
|
for (const [k, v] of Object.entries(params)) {
|
|
77
78
|
if (!k.startsWith(filterPrefix) || v === "")
|
|
@@ -83,12 +84,18 @@ export function useListUrlState(screenId, defaultFilters) {
|
|
|
83
84
|
// commas; use repeated keys if comma-containing values are ever needed.
|
|
84
85
|
out[field] = v === NO_FILTER_URL_VALUE ? [] : v.split(",").filter((s) => s !== "");
|
|
85
86
|
}
|
|
86
|
-
|
|
87
|
+
return out;
|
|
88
|
+
}, [params, filterPrefix]);
|
|
89
|
+
const filtersWithDefaults = useMemo(() => {
|
|
90
|
+
const out = { ...urlFilters };
|
|
91
|
+
for (const [field, values] of Object.entries(defaultFilters ?? {})) {
|
|
87
92
|
if (!Object.hasOwn(out, field))
|
|
88
93
|
out[field] = values;
|
|
89
94
|
}
|
|
90
95
|
return out;
|
|
91
|
-
}, [
|
|
96
|
+
}, [urlFilters, defaultFilters]);
|
|
97
|
+
const filtersFor = useCallback((forNamedFilter) => forNamedFilter === undefined ? filtersWithDefaults : urlFilters, [filtersWithDefaults, urlFilters]);
|
|
98
|
+
const filters = filtersFor(namedFilter);
|
|
92
99
|
const clearedFilterValue = useCallback((field) => effectiveDefaultFilters !== undefined && Object.hasOwn(effectiveDefaultFilters, field)
|
|
93
100
|
? NO_FILTER_URL_VALUE
|
|
94
101
|
: null, [effectiveDefaultFilters]);
|
|
@@ -157,6 +164,7 @@ export function useListUrlState(screenId, defaultFilters) {
|
|
|
157
164
|
pageSize,
|
|
158
165
|
filters,
|
|
159
166
|
namedFilter,
|
|
167
|
+
filtersFor,
|
|
160
168
|
setSort,
|
|
161
169
|
setQ,
|
|
162
170
|
setPage,
|
|
@@ -36,6 +36,14 @@ function mergeSavedColumns(schema, saved) {
|
|
|
36
36
|
});
|
|
37
37
|
return merged;
|
|
38
38
|
}
|
|
39
|
+
// Only what differs from the schema defaults is stored, so a later schema change to
|
|
40
|
+
// an untouched pin or width still reaches users who merely changed something else.
|
|
41
|
+
function widthsDifferingFrom(widths, defaults) {
|
|
42
|
+
return Object.fromEntries(Object.entries(widths).filter(([field, w]) => defaults[field] !== w));
|
|
43
|
+
}
|
|
44
|
+
function hasEntries(record) {
|
|
45
|
+
return Object.keys(record).length > 0;
|
|
46
|
+
}
|
|
39
47
|
function sameColumns(a, b) {
|
|
40
48
|
return (a.length === b.length &&
|
|
41
49
|
a.every((c, i) => c.field === b[i]?.field && c.visible === b[i]?.visible));
|
|
@@ -110,12 +118,24 @@ export function useListViewState(args) {
|
|
|
110
118
|
view: {
|
|
111
119
|
...(columnPicker && { columns: next.columns }),
|
|
112
120
|
...(userChoosesDensity && { density: next.density }),
|
|
113
|
-
...(pinning && { pins: next.pins }),
|
|
114
|
-
...(resizing &&
|
|
121
|
+
...(pinning && !sameRecord(next.pins, defaults.pins) && { pins: next.pins }),
|
|
122
|
+
...(resizing &&
|
|
123
|
+
hasEntries(widthsDifferingFrom(next.widths, defaults.widths)) && {
|
|
124
|
+
widths: widthsDifferingFrom(next.widths, defaults.widths),
|
|
125
|
+
}),
|
|
115
126
|
...(userChoosesGroupBy && { groupBy: next.groupBy }),
|
|
116
127
|
},
|
|
117
128
|
});
|
|
118
|
-
}, [
|
|
129
|
+
}, [
|
|
130
|
+
store,
|
|
131
|
+
storeKey,
|
|
132
|
+
defaults,
|
|
133
|
+
columnPicker,
|
|
134
|
+
userChoosesDensity,
|
|
135
|
+
pinning,
|
|
136
|
+
resizing,
|
|
137
|
+
userChoosesGroupBy,
|
|
138
|
+
]);
|
|
119
139
|
const setColumns = useCallback((next) => {
|
|
120
140
|
// skip: a view must keep at least one visible column
|
|
121
141
|
if (!hasVisibleColumn(next))
|
|
@@ -40,13 +40,18 @@ export function referenceOptionSource(field, refFeature, refEntity) {
|
|
|
40
40
|
}
|
|
41
41
|
return referenceLookupSource(refFeature, refEntity, field.refLabelField ?? "id");
|
|
42
42
|
}
|
|
43
|
+
// The server rejects a list `limit` above its hard maximum, which would blank every
|
|
44
|
+
// label of a field holding more ids than that; the first page still resolves.
|
|
45
|
+
function byIdsLimit(ids, capLimit) {
|
|
46
|
+
return Math.min(Math.max(ids.length, capLimit), REFERENCE_LIST_LOOKUP_LIMIT);
|
|
47
|
+
}
|
|
43
48
|
// Asks a label source for exactly these rows, so a stored id cannot fall beyond a
|
|
44
49
|
// lookup cap: `ids` is the by-id input of directory sources, `filters` that of entity
|
|
45
50
|
// list handlers. Both only narrow the caller's own read scope. A hand-written handler
|
|
46
51
|
// that knows neither still answers its first `capLimit` rows, as before.
|
|
47
52
|
export function referenceRowsByIdsPayload(ids, capLimit) {
|
|
48
53
|
return {
|
|
49
|
-
limit:
|
|
54
|
+
limit: byIdsLimit(ids, capLimit),
|
|
50
55
|
ids,
|
|
51
56
|
filters: [{ field: "id", op: "in", value: ids }],
|
|
52
57
|
};
|
|
@@ -63,7 +68,7 @@ export function withUnlistedSelectedRows(listedRows, selectedRows) {
|
|
|
63
68
|
export function storedReferenceRowsPayload(field, ids, capLimit) {
|
|
64
69
|
return field.refOptionsQuery === undefined
|
|
65
70
|
? referenceRowsByIdsPayload(ids, capLimit)
|
|
66
|
-
: { limit:
|
|
71
|
+
: { limit: byIdsLimit(ids, capLimit), ids };
|
|
67
72
|
}
|
|
68
73
|
// A page with a continuation cursor is only a prefix of the referenced rows,
|
|
69
74
|
// so a missing id in it proves nothing about the row's existence.
|
|
@@ -8,6 +8,10 @@ type RememberedListParamsArgs = {
|
|
|
8
8
|
};
|
|
9
9
|
/** URL stays the source of truth: the stored list params are copied into the
|
|
10
10
|
* URL once when the screen opens without any, and every later URL change is
|
|
11
|
-
* written back. A link that already carries list params is never overridden.
|
|
12
|
-
|
|
11
|
+
* written back. A link that already carries list params is never overridden.
|
|
12
|
+
* Returns `restoring` while that copy is outstanding, so the list holds its
|
|
13
|
+
* queries instead of fetching once with the defaults. */
|
|
14
|
+
export declare function useRememberedListParams({ screenId, enabled, store, known, }: RememberedListParamsArgs): {
|
|
15
|
+
readonly restoring: boolean;
|
|
16
|
+
};
|
|
13
17
|
export {};
|
|
@@ -9,17 +9,31 @@ function stripScreenPrefix(params, screenId) {
|
|
|
9
9
|
return value === undefined ? [] : [[key.slice(prefix.length), value]];
|
|
10
10
|
}));
|
|
11
11
|
}
|
|
12
|
+
function storedParamsOf(store, screenId, known) {
|
|
13
|
+
const stored = sanitizeStoredListState(store.read(screenId), known)?.params;
|
|
14
|
+
return stored !== undefined && Object.keys(stored).length > 0 ? stored : undefined;
|
|
15
|
+
}
|
|
16
|
+
function hasRestorableParams(store, screenId, known) {
|
|
17
|
+
return storedParamsOf(store, screenId, known) !== undefined;
|
|
18
|
+
}
|
|
12
19
|
function sameParams(a, b) {
|
|
13
20
|
const keys = Object.keys(a);
|
|
14
21
|
return keys.length === Object.keys(b).length && keys.every((key) => a[key] === b[key]);
|
|
15
22
|
}
|
|
16
23
|
/** URL stays the source of truth: the stored list params are copied into the
|
|
17
24
|
* URL once when the screen opens without any, and every later URL change is
|
|
18
|
-
* written back. A link that already carries list params is never overridden.
|
|
25
|
+
* written back. A link that already carries list params is never overridden.
|
|
26
|
+
* Returns `restoring` while that copy is outstanding, so the list holds its
|
|
27
|
+
* queries instead of fetching once with the defaults. */
|
|
19
28
|
export function useRememberedListParams({ screenId, enabled, store, known, }) {
|
|
20
29
|
const nav = useNav();
|
|
21
30
|
const current = useMemo(() => stripScreenPrefix(nav.searchParams, screenId), [nav.searchParams, screenId]);
|
|
22
31
|
const phaseRef = useRef({ screenId, phase: "pending" });
|
|
32
|
+
const phaseNow = phaseRef.current.screenId === screenId ? phaseRef.current.phase : "pending";
|
|
33
|
+
const restoring = enabled &&
|
|
34
|
+
phaseNow !== "live" &&
|
|
35
|
+
Object.keys(current).length === 0 &&
|
|
36
|
+
hasRestorableParams(store, screenId, known);
|
|
23
37
|
useEffect(() => {
|
|
24
38
|
// skip: remembering is not enabled
|
|
25
39
|
if (!enabled)
|
|
@@ -29,8 +43,8 @@ export function useRememberedListParams({ screenId, enabled, store, known, }) {
|
|
|
29
43
|
const state = phaseRef.current;
|
|
30
44
|
const currentIsEmpty = Object.keys(current).length === 0;
|
|
31
45
|
if (state.phase === "pending" && currentIsEmpty) {
|
|
32
|
-
const stored =
|
|
33
|
-
if (stored !== undefined
|
|
46
|
+
const stored = storedParamsOf(store, screenId, known);
|
|
47
|
+
if (stored !== undefined) {
|
|
34
48
|
state.phase = "restoring";
|
|
35
49
|
nav.setSearchParams(Object.fromEntries(Object.entries(stored).map(([k, v]) => [`${screenId}.${k}`, v])));
|
|
36
50
|
// skip: restore started, effect reruns with the restored URL
|
|
@@ -50,4 +64,5 @@ export function useRememberedListParams({ screenId, enabled, store, known, }) {
|
|
|
50
64
|
return;
|
|
51
65
|
store.write(screenId, { ...existing, params: current });
|
|
52
66
|
}, [enabled, screenId, current, known, store, nav]);
|
|
67
|
+
return { restoring };
|
|
53
68
|
}
|
package/dist/hooks/use-store.js
CHANGED
|
@@ -12,7 +12,6 @@ import { useRef, useSyncExternalStore } from "react";
|
|
|
12
12
|
// render — useSyncExternalStore would interpret this as a change and enter
|
|
13
13
|
// a re-render loop. The `equals` argument handles this case: when the
|
|
14
14
|
// selection is equal, the cached identity is returned and no re-render occurs.
|
|
15
|
-
// @wrapper-known semantic-alias
|
|
16
15
|
export function useStore(store) {
|
|
17
16
|
return useSyncExternalStore(store.subscribe, store.getSnapshot, store.getSnapshot);
|
|
18
17
|
}
|
package/dist/i18n-defaults.js
CHANGED
|
@@ -29,6 +29,10 @@ export const kumikoDefaultTranslations = {
|
|
|
29
29
|
"kumiko.wizard.up-next": "Up next",
|
|
30
30
|
"kumiko.wizard.step-with-title": "Step {current} of {total} · {title}",
|
|
31
31
|
"kumiko.version.update-available": "A new version is available.",
|
|
32
|
+
"kumiko.pwa.dismiss": "Not now",
|
|
33
|
+
"kumiko.pwa.install": "Install",
|
|
34
|
+
"kumiko.pwa.install-hint": "Install this app on your device to open it like any other app.",
|
|
35
|
+
"kumiko.pwa.install-hint-ios": "To install this app, tap Share and then “Add to Home Screen”.",
|
|
32
36
|
"kumiko.toast.learn-more": "Learn more",
|
|
33
37
|
"kumiko.field.open-calendar": "Open calendar",
|
|
34
38
|
"kumiko.field.dateField.placeholderYear": "Y",
|
|
@@ -42,6 +46,7 @@ export const kumikoDefaultTranslations = {
|
|
|
42
46
|
"kumiko.field.file-list.download": "Download",
|
|
43
47
|
"kumiko.field.file-list.hidePreview": "Hide preview",
|
|
44
48
|
"kumiko.field.file-list.preview": "Preview",
|
|
49
|
+
"kumiko.field.file-list.view": "View",
|
|
45
50
|
"kumiko.field.fillAction.failed": "Could not fetch a suggestion.",
|
|
46
51
|
"kumiko.field.writeOnly.remove": "Remove stored value",
|
|
47
52
|
"kumiko.field.writeOnly.set": "Set",
|
|
@@ -78,10 +83,22 @@ export const kumikoDefaultTranslations = {
|
|
|
78
83
|
"kumiko.field.multiSelect.select-all": "Select all",
|
|
79
84
|
"kumiko.field.multiSelect.deselect-all": "Deselect all",
|
|
80
85
|
"kumiko.list.search-placeholder": "Search…",
|
|
86
|
+
"kumiko.list.hint.empty": "Nothing open",
|
|
87
|
+
"kumiko.list.hint.reason": "Why?",
|
|
88
|
+
"kumiko.detail.steps.title": "Next steps",
|
|
89
|
+
"kumiko.detail.steps.empty": "Nothing to do",
|
|
90
|
+
"kumiko.detail.progress.step-of": "Step {current} of {total}",
|
|
91
|
+
"kumiko.detail.steps.less": "Show fewer steps",
|
|
92
|
+
"kumiko.detail.steps.more.one": "1 more step",
|
|
93
|
+
"kumiko.detail.steps.more.other": "{count} more steps",
|
|
94
|
+
"kumiko.detail.steps.reason": "Why?",
|
|
95
|
+
"kumiko.detail.breadcrumb": "Path",
|
|
81
96
|
"kumiko.list.empty.title": "No entries yet.",
|
|
82
97
|
"kumiko.list.empty.filtered": "No entries match the current search or filters.",
|
|
83
98
|
"kumiko.list.empty.defaultFiltered": "No entries match the default filter. Show all to include entries outside it.",
|
|
84
99
|
"kumiko.list.empty.showAll": "Show all",
|
|
100
|
+
"kumiko.list.empty.resetFilter": "Reset filter",
|
|
101
|
+
"kumiko.list.named-filter.all": "All",
|
|
85
102
|
"kumiko.list.empty.hint": "Create the first one to get started.",
|
|
86
103
|
"kumiko.list.no-entries": "No entries.",
|
|
87
104
|
"kumiko.record.not-found.title": "This record was not found.",
|
|
@@ -90,6 +107,7 @@ export const kumikoDefaultTranslations = {
|
|
|
90
107
|
"kumiko.list.end-of-list": "— End of list —",
|
|
91
108
|
"kumiko.list.sort.label": "Sort",
|
|
92
109
|
"kumiko.list.sort.unsorted": "Unsorted",
|
|
110
|
+
"kumiko.list.filter.all": "All",
|
|
93
111
|
"kumiko.list.filter.reset": "Reset",
|
|
94
112
|
"kumiko.list.filter.toggle": "Filters",
|
|
95
113
|
"kumiko.list.reset-all": "Reset",
|
|
@@ -102,6 +120,7 @@ export const kumikoDefaultTranslations = {
|
|
|
102
120
|
"kumiko.list.view.density": "Density",
|
|
103
121
|
"kumiko.list.view.density.comfortable": "Comfortable",
|
|
104
122
|
"kumiko.list.view.density.compact": "Compact",
|
|
123
|
+
"kumiko.list.view.density.relaxed": "Relaxed",
|
|
105
124
|
"kumiko.list.view.reset": "Reset view",
|
|
106
125
|
"kumiko.list.group.by": "Group by",
|
|
107
126
|
"kumiko.list.group.none": "None",
|
|
@@ -135,7 +154,7 @@ export const kumikoDefaultTranslations = {
|
|
|
135
154
|
"kumiko.reference.system-user": "System",
|
|
136
155
|
"kumiko.reference.unknown-user": "Unknown",
|
|
137
156
|
"kumiko.pager.status": "{from}–{to} of {total}",
|
|
138
|
-
"kumiko.pager.
|
|
157
|
+
"kumiko.pager.goToPage": "Page {page}",
|
|
139
158
|
"kumiko.form.all-required": "All fields are required.",
|
|
140
159
|
"kumiko.pager.status.noun": "{from}–{to} of {total} {noun}",
|
|
141
160
|
"kumiko.pager.pageSize": "{size} per page",
|
|
@@ -172,6 +191,8 @@ export const kumikoDefaultTranslations = {
|
|
|
172
191
|
"kumiko.list.bulk.result.not-started": "Not run: {count}",
|
|
173
192
|
"kumiko.list.bulk.result.dismiss": "Dismiss",
|
|
174
193
|
"kumiko.list.sort.by": "Sorted by {column}",
|
|
194
|
+
"kumiko.list.sort.prefix": "Sorted by",
|
|
195
|
+
"kumiko.list.sort.summary": "Sorted by {sort} {direction} · {count} {noun}",
|
|
175
196
|
"kumiko.form.changed": "changed",
|
|
176
197
|
"kumiko.form.on-this-page": "On this page",
|
|
177
198
|
"kumiko.form.noUnsavedChanges": "No unsaved changes",
|
|
@@ -192,6 +213,10 @@ export const kumikoDefaultTranslations = {
|
|
|
192
213
|
"kumiko.dashboard.chart.forecast": "Forecast",
|
|
193
214
|
"kumiko.dashboard.chart.markers": "Events",
|
|
194
215
|
"kumiko.dashboard.filter.all": "All",
|
|
216
|
+
"kumiko.dashboard.list.line-more": "{count} more",
|
|
217
|
+
"kumiko.dashboard.list.more": "{count} more",
|
|
218
|
+
"kumiko.dashboard.list.open-row": "Open",
|
|
219
|
+
"kumiko.dashboard.list.shown-of-total": "{shown} of {total}",
|
|
195
220
|
"kumiko.dashboard.panel.error.isolated": "The other panels are not affected.",
|
|
196
221
|
"kumiko.dashboard.panel.error.retry": "Try again",
|
|
197
222
|
"kumiko.dashboard.panel.error.title": "{label} could not be loaded",
|
|
@@ -204,7 +229,6 @@ export const kumikoDefaultTranslations = {
|
|
|
204
229
|
"kumiko.dashboard.brush-end": "Window end",
|
|
205
230
|
"kumiko.dashboard.brush-start": "Window start",
|
|
206
231
|
"kumiko.dashboard.today": "Today",
|
|
207
|
-
"kumiko.dashboard.updated-at": "As of {time}",
|
|
208
232
|
"kumiko.app-boot.loading": "Loading…",
|
|
209
233
|
"kumiko.app-boot.unauthorized": "You need to sign in to see this.",
|
|
210
234
|
"kumiko.app-boot.failed": "Couldn't load the app. Check your connection and try again.",
|
|
@@ -231,6 +255,7 @@ export const kumikoDefaultTranslations = {
|
|
|
231
255
|
"kumiko.widget.upload.remove": "Remove file",
|
|
232
256
|
"kumiko.field.dropzone.title": "Drop files here or click to choose",
|
|
233
257
|
"kumiko.field.dropzone.limit-size": "up to {size} per file",
|
|
258
|
+
"kumiko.field.dropzone.file-unavailable": "File no longer available",
|
|
234
259
|
"kumiko.field.dropzone.limit-count": "up to {count} files",
|
|
235
260
|
"kumiko.widget.pdf-preview.loading": "Loading PDF…",
|
|
236
261
|
"kumiko.widget.pdf-preview.pageOf": "Page {page} of {pages}",
|
|
@@ -347,6 +372,16 @@ export const kumikoDefaultTranslations = {
|
|
|
347
372
|
"kumiko.contentEditor.heading2": "Heading 2",
|
|
348
373
|
"kumiko.contentEditor.bulletList": "Bullet list",
|
|
349
374
|
"kumiko.contentEditor.orderedList": "Numbered list",
|
|
375
|
+
"kumiko.editor.unsavedChanges": "Unsaved changes",
|
|
376
|
+
"kumiko.editor.savedAt": "Last saved {when}",
|
|
377
|
+
"kumiko.editor.publish": "Publish",
|
|
378
|
+
"kumiko.editor.noChanges": "No unsaved changes",
|
|
379
|
+
"kumiko.editor.modeSwitch": "Mode",
|
|
380
|
+
"kumiko.editor.localeSwitch": "Language",
|
|
381
|
+
"kumiko.editor.discard": "Discard changes",
|
|
382
|
+
"kumiko.editor.deviceSwitch": "Preview width",
|
|
383
|
+
"kumiko.editor.device.mobile": "Mobile 375 px",
|
|
384
|
+
"kumiko.editor.device.desktop": "Desktop",
|
|
350
385
|
"kumiko.config.source.user": "Your value",
|
|
351
386
|
"kumiko.config.source.tenant": "Tenant",
|
|
352
387
|
"kumiko.config.source.system": "Platform",
|
package/dist/index.d.ts
CHANGED
|
@@ -12,6 +12,8 @@ export type { ContentEditorComponent, ContentEditorProps, ContentEditorsMap, Con
|
|
|
12
12
|
export { CONTENT_EDITOR_ELEMENT_ID, ContentEditorsProvider, TextareaContentEditor, useContentEditor, } from "./app/content-editors.tsx";
|
|
13
13
|
export type { ContentPreviewProps } from "./app/content-preview.tsx";
|
|
14
14
|
export { ContentPreview, substituteVariables } from "./app/content-preview.tsx";
|
|
15
|
+
export type { ContentPreviewsMap, PreviewRenderer, PreviewRendererProps, PreviewSubject, PreviewTarget, } from "./app/content-previews.tsx";
|
|
16
|
+
export { ContentPreviewsProvider, PREVIEW_TARGETS, PreviewPane, TextPreviewRenderer, useContentPreview, } from "./app/content-previews.tsx";
|
|
15
17
|
export type { CustomScreensMap, CustomScreensProviderProps } from "./app/custom-screens.tsx";
|
|
16
18
|
export { CustomScreensProvider, useCustomScreenComponent } from "./app/custom-screens.tsx";
|
|
17
19
|
export type { DashboardBodyProps, DashboardBodyProviderProps } from "./app/dashboard-body.tsx";
|
|
@@ -41,7 +43,7 @@ export { useRecordActions } from "./app/use-record-actions.ts";
|
|
|
41
43
|
export type { VariableChipsProps } from "./app/variable-chips.tsx";
|
|
42
44
|
export { VariableChips } from "./app/variable-chips.tsx";
|
|
43
45
|
export { evalVisibleWhen, type VisibleWhenVerdict } from "./app/visible-when.ts";
|
|
44
|
-
export { dispatcherErrorText, WriteFailedError } from "./app/write-failed-error.ts";
|
|
46
|
+
export { dispatcherErrorText, dispatcherErrorTextWithFieldIssues, WriteFailedError, } from "./app/write-failed-error.ts";
|
|
45
47
|
export type { ErrorBoundaryFallbackProps, ErrorBoundaryProps, } from "./components/error-boundary.tsx";
|
|
46
48
|
export { ErrorBoundary } from "./components/error-boundary.tsx";
|
|
47
49
|
export { useTrackFormUpload } from "./components/form-pending-uploads.tsx";
|
|
@@ -60,6 +62,8 @@ export { DispatcherProvider, useDispatcher, useDispatcherStatus, useOptionalDisp
|
|
|
60
62
|
export type { DraftStorage, DraftStorageProviderProps } from "./context/draft-storage-context.tsx";
|
|
61
63
|
export { DraftStorageProvider, useDraftStorage } from "./context/draft-storage-context.tsx";
|
|
62
64
|
export { EmbeddedScreenProvider, useIsEmbeddedScreen } from "./context/embedded-screen-context.tsx";
|
|
65
|
+
export type { ScreenFocus } from "./context/screen-focus-context.tsx";
|
|
66
|
+
export { ScreenFocusProvider, useScreenFocus, useSetScreenFocus, } from "./context/screen-focus-context.tsx";
|
|
63
67
|
export type { UserRolesProviderProps } from "./context/user-roles-context.tsx";
|
|
64
68
|
export { UserRolesProvider, useUserRoles } from "./context/user-roles-context.tsx";
|
|
65
69
|
export type { CurrentUser } from "./current-user.tsx";
|
|
@@ -68,6 +72,7 @@ export { formatWhen } from "./format-when.ts";
|
|
|
68
72
|
export { REFERENCE_COMBOBOX_LIMIT, REFERENCE_LIST_LOOKUP_LIMIT, REFERENCE_SEARCH_DEBOUNCE_MS, } from "./hooks/reference-limits.ts";
|
|
69
73
|
export type { AiTextActionState, AiTextMode, AiTextRewriteStyle, AiTextRunPayload, AiTextRunResult, AiTextUsage, UseAiTextActionResult, UseCompletionResult, } from "./hooks/use-ai-text.ts";
|
|
70
74
|
export { AI_TEXT_RUN_QN, useAiTextAction, useCompletion } from "./hooks/use-ai-text.ts";
|
|
75
|
+
export { useDebouncedValue } from "./hooks/use-debounced-value.ts";
|
|
71
76
|
export type { UseDisclosureResult } from "./hooks/use-disclosure.ts";
|
|
72
77
|
export { useDisclosure } from "./hooks/use-disclosure.ts";
|
|
73
78
|
export type { UseFormOptions, UseFormResult } from "./hooks/use-form.ts";
|
|
@@ -89,7 +94,7 @@ export { InsideDrawerProvider, useInsideDrawer } from "./inside-drawer.ts";
|
|
|
89
94
|
export { hasUnsavedInput, registerUnsavedInputSource, requestLeave, setLeaveConfirmer, useUnsavedInputSource, } from "./leave-guard.ts";
|
|
90
95
|
export { LeaveGuardDialog } from "./leave-guard-dialog.tsx";
|
|
91
96
|
export { PageHeaderCompactProvider, PageHeaderSlotAvailableProvider, usePageHeaderCompact, usePageHeaderSlotAvailable, } from "./page-header-slot.ts";
|
|
92
|
-
export type { ActionMenuItemSpec, ActionOverflowMenuProps, AppPrimitives, BannerProps, BulkRowOutcome, ButtonProps, CardOptions, CardProps, CardSlots, CopyButtonProps, CorePrimitives, DataTableBulk, DataTableBulkAction, DataTableDateRangeFacet, DataTableFacet, DataTableFacetChip, DataTableProps, DataTableRowAction, DataTableRowActionMode, DataTableSort, DataTableSortDir, DialogProps, DrawerProps, EmbeddedListCellType, EmbeddedListColumn, EmbeddedListInputProps, EmbeddedListTotal, FieldCellWidth, FieldProps, FileValueListProps, FillContainerProps, FooterActionMarker, FooterActionRole, FormProps, FormSectionNavItem, FormWidth, GridCellProps, GridProps, HeadingProps, InputEndAction, InputFillAction, InputProps, JsonViewProps, LightboxImage, LightboxProps, LinkProps, MetricBandProps, MetricProps, ModalProps, PageHeaderProps, PickedFile, PrimitivesProviderProps, PrimitivesRegistry, ProgressProps, ProgressTone, PromoPanelAction, PromoPanelProps, RuntimeRenderer, SecretRevealProps, SecretRevealValue, SectionProps, ShareButtonProps, StatusBadgeProps, StatusTone, StepBarProps, StickyActionBarProps, StickyPrimaryActionMarker, TabsProps, TextProps, TrailingInputAction, WizardStepGroupProps, } from "./primitives.tsx";
|
|
97
|
+
export type { ActionMenuItemSpec, ActionOverflowMenuProps, AppPrimitives, BannerProps, BulkRowOutcome, ButtonProps, CardOptions, CardProps, CardSlots, CopyButtonProps, CorePrimitives, DataTableBulk, DataTableBulkAction, DataTableDateRangeFacet, DataTableFacet, DataTableFacetChip, DataTableProps, DataTableRowAction, DataTableRowActionMode, DataTableSort, DataTableSortDir, DialogProps, DrawerProps, EmbeddedListCellType, EmbeddedListColumn, EmbeddedListInputProps, EmbeddedListTotal, FieldCellWidth, FieldProps, FileValueListProps, FillContainerProps, FooterActionMarker, FooterActionRole, FormProps, FormSectionNavItem, FormWidth, GridCellProps, GridProps, HeadingProps, InputEndAction, InputFillAction, InputProps, JsonViewProps, LightboxImage, LightboxProps, LinkProps, MetricBandProps, MetricProps, ModalProps, PageHeaderProps, PickedFile, PrimitivesProviderProps, PrimitivesRegistry, ProgressProps, ProgressTone, PromoPanelAction, PromoPanelProps, RecordBreadcrumbProps, RecordStepsProps, RecordSummaryProps, RuntimeRenderer, SecretRevealProps, SecretRevealValue, SectionProps, ShareButtonProps, StatusBadgeProps, StatusTone, StepBarProps, StickyActionBarProps, StickyPrimaryActionMarker, TabsProps, TextProps, TrailingInputAction, WizardStepGroupProps, } from "./primitives.tsx";
|
|
93
98
|
export { FOOTER_ACTION_ROLE_PROP, NARROW_LABEL_PROP, PrimitivesProvider, STICKY_PRIMARY_ACTION_PROP, shouldRenderActionsIconOnly, statusToneForOptionTone, statusToneForValue, useOptionalPrimitives, usePrimitives, } from "./primitives.tsx";
|
|
94
99
|
export type { SessionEndedSignal, SessionEndedSignalProviderProps, } from "./session/session-ended.tsx";
|
|
95
100
|
export { createSessionEndedSignal, isSessionEndedError, SESSION_ENDED_ERROR_CODES, SessionEndedSignalProvider, useSessionEndedSignal, withSessionEndedDetection, } from "./session/session-ended.tsx";
|
package/dist/index.js
CHANGED
|
@@ -17,6 +17,7 @@ export { ActionNoticeProvider, ClientActionsProvider, runClientAction, useClient
|
|
|
17
17
|
export { ColumnRenderersProvider, useColumnRenderer } from "./app/column-renderers.js";
|
|
18
18
|
export { CONTENT_EDITOR_ELEMENT_ID, ContentEditorsProvider, TextareaContentEditor, useContentEditor, } from "./app/content-editors.js";
|
|
19
19
|
export { ContentPreview, substituteVariables } from "./app/content-preview.js";
|
|
20
|
+
export { ContentPreviewsProvider, PREVIEW_TARGETS, PreviewPane, TextPreviewRenderer, useContentPreview, } from "./app/content-previews.js";
|
|
20
21
|
export { CustomScreensProvider, useCustomScreenComponent } from "./app/custom-screens.js";
|
|
21
22
|
export { DashboardBodyProvider, useDashboardBody } from "./app/dashboard-body.js";
|
|
22
23
|
export { useTenantCurrency } from "./app/entity-edit-prefill.js";
|
|
@@ -35,7 +36,7 @@ export { useEmbeddedScreen } from "./app/use-embedded-screen.js";
|
|
|
35
36
|
export { useRecordActions } from "./app/use-record-actions.js";
|
|
36
37
|
export { VariableChips } from "./app/variable-chips.js";
|
|
37
38
|
export { evalVisibleWhen } from "./app/visible-when.js";
|
|
38
|
-
export { dispatcherErrorText, WriteFailedError } from "./app/write-failed-error.js";
|
|
39
|
+
export { dispatcherErrorText, dispatcherErrorTextWithFieldIssues, WriteFailedError, } from "./app/write-failed-error.js";
|
|
39
40
|
export { ErrorBoundary } from "./components/error-boundary.js";
|
|
40
41
|
export { useTrackFormUpload } from "./components/form-pending-uploads.js";
|
|
41
42
|
export { FormScreenLayout } from "./components/form-screen-layout.js";
|
|
@@ -47,11 +48,13 @@ export { RenderList } from "./components/render-list.js";
|
|
|
47
48
|
export { DispatcherProvider, useDispatcher, useDispatcherStatus, useOptionalDispatcher, } from "./context/dispatcher-context.js";
|
|
48
49
|
export { DraftStorageProvider, useDraftStorage } from "./context/draft-storage-context.js";
|
|
49
50
|
export { EmbeddedScreenProvider, useIsEmbeddedScreen } from "./context/embedded-screen-context.js";
|
|
51
|
+
export { ScreenFocusProvider, useScreenFocus, useSetScreenFocus, } from "./context/screen-focus-context.js";
|
|
50
52
|
export { UserRolesProvider, useUserRoles } from "./context/user-roles-context.js";
|
|
51
53
|
export { CurrentUserProvider, useOptionalCurrentUser } from "./current-user.js";
|
|
52
54
|
export { formatWhen } from "./format-when.js";
|
|
53
55
|
export { REFERENCE_COMBOBOX_LIMIT, REFERENCE_LIST_LOOKUP_LIMIT, REFERENCE_SEARCH_DEBOUNCE_MS, } from "./hooks/reference-limits.js";
|
|
54
56
|
export { AI_TEXT_RUN_QN, useAiTextAction, useCompletion } from "./hooks/use-ai-text.js";
|
|
57
|
+
export { useDebouncedValue } from "./hooks/use-debounced-value.js";
|
|
55
58
|
export { useDisclosure } from "./hooks/use-disclosure.js";
|
|
56
59
|
export { useForm } from "./hooks/use-form.js";
|
|
57
60
|
export { listFilterUrlKey, useListUrlState } from "./hooks/use-list-url-state.js";
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { createStore, generateRequestId, } from "../headless/index.js";
|
|
2
|
+
import { noteServerClock } from "../server-clock.js";
|
|
2
3
|
import { CSRF_HEADER_NAME, readCsrfToken } from "./csrf.js";
|
|
3
4
|
import { batchEnvelopeSchema, errorOnlyEnvelopeSchema, queryEnvelopeSchema, writeEnvelopeSchema, } from "./envelopes.js";
|
|
4
5
|
import { buildAbortError, buildNetworkError, mapServerError } from "./error-mapping.js";
|
|
@@ -70,6 +71,7 @@ export function createLiveDispatcher(options = {}) {
|
|
|
70
71
|
return { ok: false, networkFailure: buildNetworkError(e) };
|
|
71
72
|
}
|
|
72
73
|
observeNetworkOutcome(true);
|
|
74
|
+
noteServerClock(response.headers);
|
|
73
75
|
// JSON body parse. A server that returned a non-JSON body for any
|
|
74
76
|
// reason (HTML error page from a reverse-proxy, empty body on a
|
|
75
77
|
// weird 502) maps to network-error — structurally the same as a
|
package/dist/metric-types.d.ts
CHANGED
|
@@ -15,6 +15,8 @@ export type MetricProps = {
|
|
|
15
15
|
readonly tile?: boolean;
|
|
16
16
|
readonly tone?: DashboardStatTone;
|
|
17
17
|
readonly icon?: NavIconKey;
|
|
18
|
+
/** Small muted line under the value (see `MetricSpec.subField`). */
|
|
19
|
+
readonly sub?: string;
|
|
18
20
|
};
|
|
19
21
|
/** Band above the tabs of a record detail: optional subtitle line plus the
|
|
20
22
|
* metrics as a definition list. `children` are `Metric` tiles. */
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import type { SelectOptionTone } from "@cosmicdrift/kumiko-framework/ui-types";
|
|
2
|
+
import type { ReactNode } from "react";
|
|
3
|
+
import type { CellLink } from "./headless/index.ts";
|
|
4
|
+
/** Path above a record header; an item with a `link` is a link, the last item without one names the current record. */
|
|
5
|
+
export type RecordBreadcrumbProps = {
|
|
6
|
+
readonly items: readonly {
|
|
7
|
+
readonly label: string;
|
|
8
|
+
readonly link?: CellLink;
|
|
9
|
+
}[];
|
|
10
|
+
readonly ariaLabel: string;
|
|
11
|
+
readonly testId?: string;
|
|
12
|
+
};
|
|
13
|
+
/** One emphasized sentence below a record header; `tone` sets the accent color. */
|
|
14
|
+
export type RecordSummaryProps = {
|
|
15
|
+
readonly text: string;
|
|
16
|
+
/** Shown instead of `text` below the sm breakpoint. */
|
|
17
|
+
readonly narrowText?: string;
|
|
18
|
+
readonly tone?: SelectOptionTone;
|
|
19
|
+
readonly testId?: string;
|
|
20
|
+
};
|
|
21
|
+
/** "Next steps" panel; an item's `reason` sits behind a toggle labelled `reasonLabel`. */
|
|
22
|
+
export type RecordStepsProps = {
|
|
23
|
+
readonly title: string;
|
|
24
|
+
readonly subtitle?: string;
|
|
25
|
+
/** Shown instead of the list when there are no items. */
|
|
26
|
+
readonly emptyLabel: string;
|
|
27
|
+
readonly reasonLabel: string;
|
|
28
|
+
/** Below the sm breakpoint only this many steps show; the rest sits behind a toggle. */
|
|
29
|
+
readonly narrowLimit?: number;
|
|
30
|
+
/** Toggle label for the hidden steps; receives their count. */
|
|
31
|
+
readonly moreLabel?: (hiddenCount: number) => string;
|
|
32
|
+
readonly lessLabel?: string;
|
|
33
|
+
readonly items: readonly {
|
|
34
|
+
readonly id: string;
|
|
35
|
+
readonly title: string;
|
|
36
|
+
readonly detail?: string;
|
|
37
|
+
/** Replaces `detail` below the sm breakpoint. */
|
|
38
|
+
readonly narrowDetail?: string;
|
|
39
|
+
readonly tone?: SelectOptionTone;
|
|
40
|
+
readonly reason?: string;
|
|
41
|
+
/** With `reason`: the box stands open from `sm` up. */
|
|
42
|
+
readonly reasonOpen?: true;
|
|
43
|
+
/** Bold lead-in of the reason paragraph. */
|
|
44
|
+
readonly reasonTitle?: string;
|
|
45
|
+
/** Main action: a small button on the title row. */
|
|
46
|
+
readonly actions?: ReactNode;
|
|
47
|
+
/** Further actions as text links on the title row, before the main action; hidden below sm. */
|
|
48
|
+
readonly moreActions?: ReactNode;
|
|
49
|
+
}[];
|
|
50
|
+
/** Total number of steps, shown small beside the heading even when `narrowLimit` shortens the list. */
|
|
51
|
+
readonly count?: number;
|
|
52
|
+
readonly testId?: string;
|
|
53
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|