@nivaro/react 0.3.45 → 0.3.47

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.
Files changed (90) hide show
  1. package/dist/full.css +1 -1
  2. package/dist/hooks/useSessionRecorder.js +1 -1
  3. package/dist/index.d.ts +290 -23
  4. package/dist/index.js +679 -659
  5. package/dist/shared/components/BaseMap.js +149 -103
  6. package/dist/shared/components/CollectionBrowserView.js +813 -826
  7. package/dist/shared/components/ErrorNotice.js +169 -0
  8. package/dist/shared/components/ErrorSurface.js +23 -17
  9. package/dist/shared/components/ListLoadError.js +8 -29
  10. package/dist/shared/components/LoadErrorNote.js +38 -21
  11. package/dist/shared/components/QueryErrorState.js +8 -11
  12. package/dist/shared/components/ReportView.js +1320 -1291
  13. package/dist/shared/components/chat/ChannelArchive.js +60 -60
  14. package/dist/shared/components/chat/ChannelExtras.js +74 -74
  15. package/dist/shared/components/chat/ChatPanel.js +368 -367
  16. package/dist/shared/components/command-center/CommandCenterView.js +313 -69
  17. package/dist/shared/components/command-center/Customize.js +353 -0
  18. package/dist/shared/components/command-center/Header.js +279 -53
  19. package/dist/shared/components/command-center/KioskLinks.js +198 -0
  20. package/dist/shared/components/command-center/PeekPanel.js +144 -3
  21. package/dist/shared/components/command-center/announce.js +13 -0
  22. package/dist/shared/components/command-center/board-prefs.js +99 -0
  23. package/dist/shared/components/command-center/freshness.js +29 -0
  24. package/dist/shared/components/command-center/layout.js +56 -0
  25. package/dist/shared/components/command-center/panels/AttentionPanel.js +132 -3
  26. package/dist/shared/components/command-center/panels/Banner.js +75 -0
  27. package/dist/shared/components/command-center/panels/BoardSettings.js +224 -0
  28. package/dist/shared/components/command-center/panels/FeedPanel.js +145 -29
  29. package/dist/shared/components/command-center/panels/FlowPanel.js +154 -56
  30. package/dist/shared/components/command-center/panels/ForecastPanel.js +244 -3
  31. package/dist/shared/components/command-center/panels/MapLegend.js +266 -0
  32. package/dist/shared/components/command-center/panels/MapPanel.js +216 -66
  33. package/dist/shared/components/command-center/panels/PartnersPanel.js +49 -3
  34. package/dist/shared/components/command-center/panels/PeoplePanel.js +258 -40
  35. package/dist/shared/components/command-center/panels/RegionPicker.js +88 -3
  36. package/dist/shared/components/command-center/panels/SystemPanel.js +158 -38
  37. package/dist/shared/components/command-center/panels/ThroughputPanel.js +307 -3
  38. package/dist/shared/components/command-center/panels/TimeBar.js +227 -6
  39. package/dist/shared/components/command-center/panels/TrafficPanel.js +12 -8
  40. package/dist/shared/components/command-center/panels/WorkloadPanel.js +82 -3
  41. package/dist/shared/components/command-center/panels/attention-actions.js +267 -0
  42. package/dist/shared/components/command-center/panels/map-shared.js +95 -0
  43. package/dist/shared/components/command-center/panels/registry.js +87 -19
  44. package/dist/shared/components/command-center/shell-hooks.js +118 -0
  45. package/dist/shared/components/command-center/shortcuts.js +37 -0
  46. package/dist/shared/components/command-center/theme.js +39 -21
  47. package/dist/shared/components/command-center/time.js +52 -0
  48. package/dist/shared/components/command-center/url-state.js +54 -0
  49. package/dist/shared/components/command-center/work-links.js +32 -0
  50. package/dist/shared/components/help-videos/editor/ClipsPanel.js +49 -48
  51. package/dist/shared/components/help-videos/editor/PublishButton.js +37 -36
  52. package/dist/shared/components/help-videos/editor/StatsTab.js +45 -44
  53. package/dist/shared/components/help-videos/editor/VersionsTab.js +29 -28
  54. package/dist/shared/components/help-videos/library/AuthorRolesButton.js +19 -18
  55. package/dist/shared/components/help-videos/library/HelpVideoLibrary.js +132 -129
  56. package/dist/shared/components/help-videos/library/LearningPathsPanel.js +42 -41
  57. package/dist/shared/components/help-videos/settings/HouseStyleButton.js +21 -20
  58. package/dist/shared/components/help-videos/settings/RenderSettingsButton.js +22 -21
  59. package/dist/shared/components/import/DocumentAutofillButton.js +24 -20
  60. package/dist/shared/components/import/ImportFromFileButton.js +61 -60
  61. package/dist/shared/components/imports/ImportStalenessControl.js +20 -21
  62. package/dist/shared/components/imports/NewImportDialog.js +29 -28
  63. package/dist/shared/components/imports/RunDetailSheet.js +63 -63
  64. package/dist/shared/components/item-edit/FieldRow.js +329 -329
  65. package/dist/shared/components/item-edit/InlineTableField.js +898 -898
  66. package/dist/shared/components/item-edit/PersonalDefaultControl.js +57 -56
  67. package/dist/shared/components/item-edit/PlanGrid.js +220 -221
  68. package/dist/shared/components/item-edit/RecordGrantTools.js +49 -48
  69. package/dist/shared/components/item-edit/placement-behaviour.js +68 -67
  70. package/dist/shared/components/layout-editor/inspector/ColumnFit.js +24 -23
  71. package/dist/shared/components/layout-editor/inspector/PickerPreview.js +17 -16
  72. package/dist/shared/components/layout-editor/matrix/FieldStateMatrix.js +41 -41
  73. package/dist/shared/components/layout-editor/outputs/output-api.js +33 -31
  74. package/dist/shared/components/layout-editor/overview/overview-api.js +84 -83
  75. package/dist/shared/components/layout-editor/useLayoutDraft.js +47 -42
  76. package/dist/shared/components/monitoring/InactiveUserLinksView.js +10 -9
  77. package/dist/shared/components/monitoring/TrafficMiniMap.js +111 -70
  78. package/dist/shared/components/panels/SlaClock.js +35 -36
  79. package/dist/shared/components/pipeline/PipelineEditorView.js +311 -312
  80. package/dist/shared/components/pipeline/TeamSuggestions.js +31 -30
  81. package/dist/shared/components/profile/AgentsPanel.js +73 -72
  82. package/dist/shared/components/profile/MailSuppressedPill.js +22 -21
  83. package/dist/shared/components/support/SupportRequestDialog.js +85 -81
  84. package/dist/shared/components/support/SupportView.js +94 -87
  85. package/dist/shared/lib/autofill-poll.js +21 -18
  86. package/dist/shared/lib/error-actions.js +85 -0
  87. package/dist/shared/lib/error-message.js +223 -82
  88. package/dist/shared/lib/error-toast.js +71 -13
  89. package/dist/shared/lib/safe-error.js +136 -38
  90. package/package.json +1 -1
@@ -9,7 +9,7 @@ import { noteReplayEvent as _e, createReplayCheckoutState as De } from "../share
9
9
  import { emitReplayTap as Te, setReplayRecorderMode as N, registerReplayCapture as qe, clipEndOffset as Le, withClipKind as Pe } from "../shared/lib/replay-capture.js";
10
10
  import { instrumentConsole as Ne, instrumentRequests as Fe, redactSecrets as Me } from "../shared/lib/replay-context.js";
11
11
  import { instrumentSocket as Oe } from "../shared/lib/replay-socket.js";
12
- const Ue = "nivaro-react@0.3.45", j = 1e4, We = 150, He = 3e3, Ke = 600, $e = (n) => `nvr_replay_resume${n ? `:${n}` : ""}`, G = () => typeof navigator > "u" || navigator.onLine !== !1;
12
+ const Ue = "nivaro-react@0.3.47", j = 1e4, We = 150, He = 3e3, Ke = 600, $e = (n) => `nvr_replay_resume${n ? `:${n}` : ""}`, G = () => typeof navigator > "u" || navigator.onLine !== !1;
13
13
  function Be(n) {
14
14
  return typeof n.url != "string" || typeof fetch != "function" ? null : (f, a) => {
15
15
  const u = typeof n.getToken == "function" ? n.getToken() : void 0, d = { "Content-Type": "application/json" };
package/dist/index.d.ts CHANGED
@@ -27,6 +27,7 @@ import { ReportDateRange } from '@nivaro/sdk';
27
27
  import { ReportEntityFilter } from '@nivaro/sdk';
28
28
  import { ReportQueryWidgetConfig } from '@nivaro/sdk';
29
29
  import { ReportWidget } from '@nivaro/sdk';
30
+ import { toast } from 'sonner';
30
31
  import { UseMutationResult } from '@tanstack/react-query';
31
32
  import { UseQueryResult } from '@tanstack/react-query';
32
33
  import { UserScopesInfo } from '@nivaro/sdk';
@@ -1002,7 +1003,7 @@ export declare interface BannerLine {
1002
1003
  * banner AND anywhere else that ends up wanting the same sentence. */
1003
1004
  export declare function bannerLines(rows: Row[], now?: Date): BannerLine[];
1004
1005
 
1005
- export declare function BaseMap({ pins, bubbles, statusLine, onPinClick, onBubbleClick, minHeight, focus }: {
1006
+ export declare function BaseMap({ pins, bubbles, statusLine, onPinClick, onBubbleClick, minHeight, focus, clusterColor, dots, onDotClick }: {
1006
1007
  pins: BaseMapPin[];
1007
1008
  bubbles?: BaseMapBubble[];
1008
1009
  /** Bottom-left caption ("214 pinned · © OpenStreetMap"). */
@@ -1018,6 +1019,12 @@ export declare function BaseMap({ pins, bubbles, statusLine, onPinClick, onBubbl
1018
1019
  zoom?: number;
1019
1020
  nonce: number;
1020
1021
  } | null;
1022
+ /** Colour of a cluster disc from its pins (e.g. the worst child's); default: red when any
1023
+ * pin pulses, else the first pin's colour. */
1024
+ clusterColor?: (pins: BaseMapPin[]) => string;
1025
+ /** Extra point layer (see BaseMapDot). */
1026
+ dots?: BaseMapDot[];
1027
+ onDotClick?: (id: string) => void;
1021
1028
  }): JSX.Element;
1022
1029
 
1023
1030
  export declare interface BaseMapBubble {
@@ -1029,6 +1036,17 @@ export declare interface BaseMapBubble {
1029
1036
  color?: string;
1030
1037
  }
1031
1038
 
1039
+ /** A light point layer (heat / activity / people out) — never clustered, drawn under pins. */
1040
+ declare interface BaseMapDot {
1041
+ id: string;
1042
+ lat: number;
1043
+ lng: number;
1044
+ label: string;
1045
+ color: string;
1046
+ /** 0..1 — size and opacity. */
1047
+ weight?: number;
1048
+ }
1049
+
1032
1050
  export declare interface BaseMapPin {
1033
1051
  id: string;
1034
1052
  lat: number;
@@ -1065,6 +1083,12 @@ declare interface Blur {
1065
1083
  strength: number;
1066
1084
  }
1067
1085
 
1086
+ /** How the board reads and replaces the URL's query string. */
1087
+ declare interface BoardUrlAdapter {
1088
+ read: () => string;
1089
+ replace: (search: string) => void;
1090
+ }
1091
+
1068
1092
  export declare function BooleanField({ field, value, onChange, error, disabled, readOnly, inputId, errorId }: FieldComponentProps): JSX.Element;
1069
1093
 
1070
1094
  export declare function BroadcastView({ className }: {
@@ -2173,21 +2197,30 @@ declare interface ColumnPreset {
2173
2197
  * someone (attention), who's on (people) and a one-line system status that hands off to the
2174
2198
  * Traffic Map (the machine's own board). Every number clicks through to its real surface.
2175
2199
  *
2176
- * Structure: this shell owns the board state (state.tsx) and lays out the panel registry
2177
- * (panels/registry.ts); each panel is its own module reading useCc() + useCcQuery(). The
2178
- * contract with the API is types.ts.
2200
+ * Structure: this shell owns the board state (state.tsx), the lenses in the URL (url-state.ts),
2201
+ * the person's prefs (board-prefs.ts), keyboard shortcuts, TV / full screen and the layout
2202
+ * (layout.ts arrangeBoard places the panel registry for the screen size); each panel is its own
2203
+ * module reading useCc() + useCcQuery(). The contract with the API is types.ts.
2179
2204
  *
2180
- * Hosts: NivaroProvider + NavigationContext required.
2205
+ * Layout — "what needs someone right now" leads at every size:
2206
+ * ≥1800px three columns: Needs attention + Workload | map (+ live feed under it) | rail
2207
+ * ≥1280px map (+ feed) | rail opening with Needs attention, beside the map's top edge
2208
+ * <1280px one column: attention first, then the map (on a phone behind "Show map"), the rest
2209
+ *
2210
+ * Hosts: NivaroProvider + NavigationContext required. A wallboard link (`kiosk`) shows the
2211
+ * board read-only, always dark and in TV mode, with no prefs, no URL writes and no navigation.
2181
2212
  */
2182
2213
  export declare function CommandCenterView({
2183
2214
  /** Fallback map collections when the instance has no Command Center config yet. */
2184
- geoCollections, recordUrl, isAdmin, kiosk }: {
2215
+ geoCollections, recordUrl, isAdmin, kiosk, urlAdapter }: {
2185
2216
  geoCollections?: string[];
2186
2217
  /** Host route for a record — defaults to the admin shape. */
2187
2218
  recordUrl?: (collection: string, id: string) => string;
2188
2219
  isAdmin?: boolean;
2189
2220
  /** Wallboard link token (read-only board). */
2190
2221
  kiosk?: string | null;
2222
+ /** How the board reads/replaces the query string; default history.replaceState. */
2223
+ urlAdapter?: BoardUrlAdapter;
2191
2224
  }): JSX.Element;
2192
2225
 
2193
2226
  export declare function CommentPanel({ collection, item, title, defaultExpanded, queuedComments, onQueueComment }: {
@@ -2309,6 +2342,11 @@ declare interface CopyAsSnippets {
2309
2342
  graphql: string;
2310
2343
  }
2311
2344
 
2345
+ /** Copy the details; resolves false when the clipboard refused. Never throws. */
2346
+ export declare function copyErrorDetails(input: ErrorDescription | unknown, extra?: {
2347
+ action?: string;
2348
+ }): Promise<boolean>;
2349
+
2312
2350
  /**
2313
2351
  * `opts.open` is the gate's state AT CONSTRUCTION. A host that starts a
2314
2352
  * hidden tab must pass `false` here rather than calling `setOpen(false)`
@@ -2587,6 +2625,21 @@ export declare function deriveGroupKey<T extends QueueGroupingRow>(row: T, attri
2587
2625
 
2588
2626
  export declare function describeCron(cron: string): string;
2589
2627
 
2628
+ /** The plain reading of a failed request. `fallback` is the title when nothing says more. */
2629
+ export declare function describeError(err: unknown, fallback?: string, opts?: DescribeErrorOptions): ErrorDescription;
2630
+
2631
+ export declare interface DescribeErrorOptions {
2632
+ /** Field labels for a refusal that names fields: key → "Supplier site". */
2633
+ fieldLabels?: Record<string, string> | ((key: string) => string | null | undefined);
2634
+ }
2635
+
2636
+ /**
2637
+ * A read that failed, said for its place: "Couldn’t load the dashboard" with
2638
+ * what to do, where the generic reading would only say "Something went wrong".
2639
+ * Signed out, no access, not found, offline and the like keep their own words.
2640
+ */
2641
+ export declare function describeLoadError(err: unknown, what?: string, opts?: DescribeErrorOptions): ErrorDescription;
2642
+
2590
2643
  /**
2591
2644
  * Drag and drop state for design nodes. Plain functions, no hooks: inside a
2592
2645
  * LayoutDndProvider every DesignNode registers through the provider's store
@@ -3038,6 +3091,124 @@ export declare interface ErpSubmission {
3038
3091
  explanation?: IntegrationErrorExplanation | null;
3039
3092
  }
3040
3093
 
3094
+ export declare interface ErrorAction {
3095
+ label: string;
3096
+ kind: ErrorActionKind;
3097
+ }
3098
+
3099
+ /**
3100
+ * The one button an error offers, made to do the thing it says:
3101
+ *
3102
+ * retry the caller's retry (refetch, send again); without one, a reload
3103
+ * reload reload the page (someone else's changes, maintenance over)
3104
+ * sign-in the app's sign-in page, coming back here afterwards
3105
+ * go-back one step back in the app's history, else home
3106
+ * contact the Support page in a new tab, a new request already filled in
3107
+ * with what happened and the reference — the work on this page
3108
+ * stays where it is
3109
+ *
3110
+ * Hosts may point these elsewhere with `setErrorActionHost` (an SPA navigate,
3111
+ * another sign-in path); the defaults work in any app that serves /login and
3112
+ * /support.
3113
+ */
3114
+ export declare interface ErrorActionHost {
3115
+ /** In-app navigation; window.location otherwise. */
3116
+ navigate?: (path: string) => void;
3117
+ /** Default '/login' (the page reads ?redirect=). */
3118
+ signInPath?: string;
3119
+ /** Default '/support' (the shared SupportView picks up the prepared request). */
3120
+ supportPath?: string;
3121
+ /** Replaces the sign-in default entirely. */
3122
+ signIn?: () => void;
3123
+ }
3124
+
3125
+ /**
3126
+ * One reading of a failed request for every screen: what happened, what to do,
3127
+ * the one action that helps, which fields it is about, and the reference
3128
+ * "Details for support" carries.
3129
+ *
3130
+ * Works on the SDK's errors (`{status, response: body}`, and NivaroError's
3131
+ * `code` / `requestId`), axios errors (`response.data`, the request id header),
3132
+ * a portal's own ApiError (`status`, `response`), a GraphQL error
3133
+ * (`extensions.code`), a plain body, or anything thrown.
3134
+ *
3135
+ * title what happened, in plain words: the server's own sentence when it
3136
+ * wrote one for people; else a plain status sentence ("Someone else
3137
+ * changed this", never "Request failed with status code 409")
3138
+ * hint what to do: the answer's `hint` (or `explanation`) exactly as
3139
+ * sent, else the shared table by code, then by status
3140
+ * (lib/error-hints.ts, twin of the API's); 422s list the fields
3141
+ * action the one button that helps: retry, sign in, reload, ask for help,
3142
+ * go back (lib/error-actions.ts runs it)
3143
+ * fields field keys the refusal names, for the form to mark
3144
+ *
3145
+ * Never in the title or hint: a status code, a stack, SQL, a driver or
3146
+ * JavaScript error, an internal id. Those stay in `technical`, `code`,
3147
+ * `status` and `requestId`, which only the collapsed "Details for support"
3148
+ * shows and copies.
3149
+ */
3150
+ export declare type ErrorActionKind = 'retry' | 'sign-in' | 'reload' | 'contact' | 'go-back';
3151
+
3152
+ export declare interface ErrorDescription {
3153
+ title: string;
3154
+ hint?: string;
3155
+ action?: ErrorAction;
3156
+ kind?: ErrorKind;
3157
+ fields?: string[];
3158
+ requestId?: string;
3159
+ code?: string;
3160
+ status?: number;
3161
+ /** The raw text the error carried, for the support copy only — never shown as the title. */
3162
+ technical?: string;
3163
+ }
3164
+
3165
+ /**
3166
+ * The collapsed "Details for support": the reference (request id), the code
3167
+ * and status, a Copy button and a way to ask for help with all of it filled
3168
+ * in. Closed by default — the person reads what happened and what to do; the
3169
+ * reference is there for whoever helps them.
3170
+ */
3171
+ export declare function ErrorDetails({ description: d, action, className }: {
3172
+ description: ErrorDescription;
3173
+ /** What the person was doing ("Save record"), for the copy. */
3174
+ action?: string;
3175
+ className?: string;
3176
+ }): JSX.Element | null;
3177
+
3178
+ export declare type ErrorKind = 'offline' | 'network' | 'timeout' | 'signed-out' | 'forbidden' | 'not-found' | 'conflict' | 'locked' | 'too-large' | 'validation' | 'rate-limited' | 'maintenance' | 'unavailable' | 'server' | 'bug' | 'refused' | 'unknown';
3179
+
3180
+ /**
3181
+ * Any failure, said for a person: what happened, what to do, ONE button that
3182
+ * does it, and the reference tucked into "Details for support". Pass the
3183
+ * error itself (`error`) — or an already-read `description` — never its text.
3184
+ *
3185
+ * variant 'inline' a panel or widget's degraded state (default)
3186
+ * 'page' fills the area the content would have used
3187
+ * 'banner' a strip above a list or form
3188
+ *
3189
+ * `onRetry` makes "Try again" re-run the read or the action; without it a
3190
+ * retry reloads the page. `what` reads a failed load ("Couldn’t load the
3191
+ * dashboard") instead of a failed action.
3192
+ */
3193
+ export declare function ErrorNotice({ error, description, what, fallback, onRetry, actionLabel, action: actionOverride, variant, centered: centeredProp, fieldLabels, className }: {
3194
+ error?: unknown;
3195
+ description?: ErrorDescription;
3196
+ /** For a failed read: lower-case noun, "the dashboard", "this list". */
3197
+ what?: string;
3198
+ /** Title when nothing says more ("Could not save"). */
3199
+ fallback?: string;
3200
+ onRetry?: () => void;
3201
+ /** What the person was doing, for the support copy ("Save record"). */
3202
+ actionLabel?: string;
3203
+ /** Replace the offered action (or `null` for none). */
3204
+ action?: ErrorAction | null;
3205
+ variant?: 'inline' | 'page' | 'banner';
3206
+ /** Inline only: stack and centre it (a widget's empty body). */
3207
+ centered?: boolean;
3208
+ fieldLabels?: DescribeErrorOptions['fieldLabels'];
3209
+ className?: string;
3210
+ }): JSX.Element;
3211
+
3041
3212
  export declare interface ErrorReplayLink {
3042
3213
  recording_id: string;
3043
3214
  /** Milliseconds into the recording where the error happened. Null for
@@ -3045,18 +3216,27 @@ export declare interface ErrorReplayLink {
3045
3216
  offset_ms: number | null;
3046
3217
  }
3047
3218
 
3048
- /**
3049
- * Error surface family (#324): 403/404/500 as one designed system — a name
3050
- * for what happened, an honest cause line, and the one right action. The
3051
- * smart-404 (#219) and AccessDeniedPanel remain the record-scoped variants;
3052
- * this is the page-level chrome.
3053
- */
3054
- export declare function ErrorSurface({ variant, detail, action }: {
3219
+ /** Title and hint as one sentence pair, for places with room for a single line. */
3220
+ export declare function errorSentence(err: unknown, fallback?: string): string;
3221
+
3222
+ export declare function ErrorSurface({ variant, detail, error, action }: {
3055
3223
  variant: '403' | '404' | '500';
3056
3224
  detail?: string;
3225
+ error?: unknown;
3057
3226
  action?: ReactNode;
3058
3227
  }): JSX.Element;
3059
3228
 
3229
+ /**
3230
+ * Toast options for a failed request: the hint as the description and the
3231
+ * one button that helps — for `toast.error(userErrorMessage(err, …),
3232
+ * errorToastOptions(err))` where the title is already chosen, or through
3233
+ * `toastError` below.
3234
+ */
3235
+ export declare function errorToastOptions(input: unknown, opts?: ToastErrorOpts): {
3236
+ description?: string;
3237
+ action?: ToastButton;
3238
+ };
3239
+
3060
3240
  /** Boolean convenience — for guards and conditions. */
3061
3241
  export declare function evaluateBoolean(src: string, row: TokenResolver | Record<string, unknown>, opts?: EvaluateOptions): boolean;
3062
3242
 
@@ -3908,6 +4088,19 @@ export declare function groupActivity<T extends ActivityEntryInput>(entries: T[]
3908
4088
  windowMs?: number;
3909
4089
  }): ActivityGroup<T>[];
3910
4090
 
4091
+ /**
4092
+ * The last line of defence (installed once by the host at boot): an error
4093
+ * toast whose title or description is raw — "Request failed with status code
4094
+ * 500", "HTTP 403", SQL, a stack, a driver or JavaScript error, an internal
4095
+ * id — shows what it means instead, with the status's hint. An Error object
4096
+ * handed straight to `toast.error` is read through `describeError`. Plain
4097
+ * sentences pass through untouched. Call sites should still say it well
4098
+ * (`toastError`); this only makes sure nothing raw ever reaches a person.
4099
+ */
4100
+ export declare function guardErrorToasts(target?: {
4101
+ error: typeof toast.error;
4102
+ }): void;
4103
+
3911
4104
  /**
3912
4105
  * Run one identity call through the gate: `blocked()` answers without a request while the tab
3913
4106
  * is signed out (outside its probe window); a success opens the gate, a signed-out 401 closes it.
@@ -5422,6 +5615,14 @@ export declare function isCodeError(err: unknown): boolean;
5422
5615
  */
5423
5616
  export declare function isListTimeout(err: unknown): boolean;
5424
5617
 
5618
+ /**
5619
+ * Text a person should never see: a bare status line, a JavaScript or driver
5620
+ * error, a stack, SQL or the database's own names, or an internal id. The
5621
+ * reader shows what it means instead (`plainErrorText`) and keeps the text
5622
+ * itself for the "Details for support" copy.
5623
+ */
5624
+ export declare function isRawErrorText(text: unknown): boolean;
5625
+
5425
5626
  export declare function isReloadingForUpdate(): boolean;
5426
5627
 
5427
5628
  /** True once a 401 said this tab is signed out, until a sign-in is heard. */
@@ -6006,10 +6207,11 @@ export declare function listFieldInterfaces(): string[];
6006
6207
 
6007
6208
  /**
6008
6209
  * A list read that failed — a 503 list timeout ("This search took too long to
6009
- * finish…"), a busy server, anything else — said in place of the rows, with
6010
- * Retry. Never the empty sentence: a failed read has no answer to borrow one
6011
- * from. Rendered by the list itself above its table, not through the table's
6012
- * empty slot.
6210
+ * finish…"), a busy server, signed out, no access, anything else — said in
6211
+ * place of the rows with what to do and the one button that helps (usually
6212
+ * Try again). Never the empty sentence: a failed read has no answer to borrow
6213
+ * one from. Rendered by the list itself above its table, not through the
6214
+ * table's empty slot.
6013
6215
  */
6014
6216
  export declare function ListLoadError({ error, onRetry, className }: {
6015
6217
  error: unknown;
@@ -6234,9 +6436,15 @@ export declare function liveRefetchInterval(live: boolean, base: number | false
6234
6436
  /**
6235
6437
  * The degraded state for a widget or panel whose data did not load (#2858): what happened in
6236
6438
  * plain words and a way to try again, instead of a blank box, "No data" or a raw error string.
6439
+ *
6440
+ * Pass the `error` itself (with `what`, "this widget") to get the full reading — what to do,
6441
+ * the one right button (Sign in again, Ask for access…) and "Details for support". A `message`
6442
+ * alone still works; raw text in it ("Request failed with status code 500") is never shown.
6237
6443
  */
6238
- export declare function LoadErrorNote({ message, onRetry, className, centered }: {
6239
- message: string;
6444
+ export declare function LoadErrorNote({ message, error, what, onRetry, className, centered }: {
6445
+ message?: string;
6446
+ error?: unknown;
6447
+ what?: string;
6240
6448
  onRetry?: () => void;
6241
6449
  className?: string;
6242
6450
  centered?: boolean;
@@ -7073,6 +7281,11 @@ export declare function openClientChaosToolbar(): void;
7073
7281
 
7074
7282
  export declare function openDmWith(userId: string, displayName?: string): void;
7075
7283
 
7284
+ /** Open Support with the request filled in, in a new tab; this page keeps its work. */
7285
+ export declare function openSupportForError(d: ErrorDescription, extra?: {
7286
+ action?: string;
7287
+ }): void;
7288
+
7076
7289
  declare interface OpenverseSearch {
7077
7290
  /** False when the instance switched Openverse off (HELP_VIDEO_OPENVERSE=off). */
7078
7291
  enabled: boolean;
@@ -7660,6 +7873,14 @@ export declare function PipelineTransitionButtons({ collection, item, onBeforeTr
7660
7873
  wrap?: boolean;
7661
7874
  }): JSX.Element | null;
7662
7875
 
7876
+ /**
7877
+ * A message as a person may read it: unchanged when it is plain; the plain
7878
+ * part kept when only its tail is raw ("Not saved — Request failed (500)" →
7879
+ * "Not saved"); else what its status means ("Request failed with status code
7880
+ * 403" → "You do not have access to do this"), else `fallback`.
7881
+ */
7882
+ export declare function plainErrorText(text: unknown, fallback?: string, status?: number | null): string;
7883
+
7663
7884
  export declare interface PlanGridHost {
7664
7885
  renderRowHistory?: (args: PlanGridRowHistoryArgs) => ReactNode | null;
7665
7886
  }
@@ -7952,6 +8173,20 @@ declare type QueryCacheLike = {
7952
8173
  }) => void): () => void;
7953
8174
  };
7954
8175
 
8176
+ /**
8177
+ * The page-level error state for a read that failed (#2857): "Couldn't load <thing>" with what
8178
+ * to do and the one button that helps (Try again, Sign in again, Ask for access…), in place of a
8179
+ * blank screen, an empty state that reads as "no data" or a skeleton that never ends. Fill the
8180
+ * area the content would have used. The reference stays in "Details for support".
8181
+ */
8182
+ export declare function QueryErrorState({ error, what, onRetry, className }: {
8183
+ error: unknown;
8184
+ /** Lower-case noun for the sentence: "files", "this dashboard". */
8185
+ what: string;
8186
+ onRetry?: () => void;
8187
+ className?: string;
8188
+ }): JSX.Element;
8189
+
7955
8190
  declare type QueryRowClick = {
7956
8191
  picker?: {
7957
8192
  collection: string;
@@ -8167,11 +8402,13 @@ declare interface QueryTableConfig {
8167
8402
  };
8168
8403
  }
8169
8404
 
8170
- export declare function QueryWidgetBody({ cfg, dateRange, entityFilters, refetchInterval, onStatus, onDrill }: {
8405
+ export declare function QueryWidgetBody({ cfg, dateRange, entityFilters, refetchInterval, onStatus, onDrill, deferred }: {
8171
8406
  cfg: ReportQueryWidgetConfig;
8172
8407
  dateRange: ReportDateRange | null;
8173
8408
  entityFilters: ReportEntityFilter[];
8174
8409
  refetchInterval?: number;
8410
+ /** Not near the viewport yet: hold the query (and show the loading line) until it is. */
8411
+ deferred?: boolean;
8175
8412
  onStatus?: (s: {
8176
8413
  isFetching: boolean;
8177
8414
  refetch: () => void;
@@ -9670,6 +9907,12 @@ export declare function rumWidget(opts: {
9670
9907
  paintMs: number;
9671
9908
  }): void;
9672
9909
 
9910
+ /** Run the action an error offers. `retry` is the caller's own (refetch, send again). */
9911
+ export declare function runErrorAction(kind: ErrorActionKind, d: ErrorDescription, opts?: {
9912
+ retry?: () => void;
9913
+ action?: string;
9914
+ }): void;
9915
+
9673
9916
  /** Convenience: run a resolved target (navigate, open the chat room, or open
9674
9917
  * a foreign-app URL in a new tab). */
9675
9918
  export declare function runNotificationTarget(target: NotificationTarget, navigate: (path: string) => void): boolean;
@@ -9813,6 +10056,8 @@ export declare interface SessionRecorderOptions {
9813
10056
 
9814
10057
  export declare function setDisplayTimezone(tz: string | null): void;
9815
10058
 
10059
+ export declare function setErrorActionHost(next: ErrorActionHost): void;
10060
+
9816
10061
  /**
9817
10062
  * Fiscal calendar helpers (#343). The instance's fiscal-year start month
9818
10063
  * lives on nivaro_settings.fiscal_year_start_month; hosts hydrate it via
@@ -10449,13 +10694,16 @@ export declare interface SupportCategory {
10449
10694
  * that moment) and a text attachment with the page, the console tail and the
10450
10695
  * last twenty requests. Nothing uploads unless the request is sent.
10451
10696
  */
10452
- export declare function SupportRequestDialog({ open, onOpenChange, collection, item, recordLabel, onCreated }: {
10697
+ export declare function SupportRequestDialog({ open, onOpenChange, collection, item, recordLabel, initialTitle, initialDescription, onCreated }: {
10453
10698
  open: boolean;
10454
10699
  onOpenChange: (open: boolean) => void;
10455
10700
  collection?: string | null;
10456
10701
  item?: string | number | null;
10457
10702
  /** Friendly id of the record ("CM26-79811"), shown in the title. */
10458
10703
  recordLabel?: string | null;
10704
+ /** Prefill (an error's "Get help": what happened and its reference). */
10705
+ initialTitle?: string;
10706
+ initialDescription?: string;
10459
10707
  onCreated?: (ticket: SupportTicket) => void;
10460
10708
  }): JSX.Element;
10461
10709
 
@@ -10735,6 +10983,21 @@ export declare function TipLayer(): ReactPortal | null;
10735
10983
 
10736
10984
  export declare function titleCase(str: string): string;
10737
10985
 
10986
+ declare type ToastButton = {
10987
+ label: string;
10988
+ onClick: () => void;
10989
+ };
10990
+
10991
+ /** One error toast: what happened, what to do, and the one button. Returns the reading. */
10992
+ export declare function toastError(err: unknown, fallback?: string, opts?: ToastErrorOpts): ErrorDescription;
10993
+
10994
+ declare interface ToastErrorOpts {
10995
+ /** What the person was doing ("Save record"), for the support copy. */
10996
+ action?: string;
10997
+ /** Send it again: makes "Try again" the toast's button. */
10998
+ retry?: () => void;
10999
+ }
11000
+
10738
11001
  /** Typed text → tokens: whitespace-split words, "quoted phrases" kept whole; folded, unique. */
10739
11002
  export declare function tokenize(q: string | null | undefined): string[];
10740
11003
 
@@ -10761,7 +11024,7 @@ declare interface TopicPresence {
10761
11024
  /** Install the listeners. Safe to call more than once. */
10762
11025
  export declare function trackActivity(): void;
10763
11026
 
10764
- export declare function TrafficMiniMap({ window: win, tone, href, refreshMs, className }: {
11027
+ export declare function TrafficMiniMap({ window: win, tone, href, refreshMs, className, onPickTime }: {
10765
11028
  window?: 60 | 300 | 900;
10766
11029
  tone?: 'auto' | 'dark';
10767
11030
  /** Where "Open" goes. An absolute URL (another app's admin) opens in a new tab; default
@@ -10769,6 +11032,9 @@ export declare function TrafficMiniMap({ window: win, tone, href, refreshMs, cla
10769
11032
  href?: string;
10770
11033
  refreshMs?: number;
10771
11034
  className?: string;
11035
+ /** When set, each lane's sparkline is a button: clicking a point (or Enter = the lane's
11036
+ * spike) hands back that minute — the Command Center rewinds to it. */
11037
+ onPickTime?: (ms: number) => void;
10772
11038
  }): JSX.Element | null;
10773
11039
 
10774
11040
  /**
@@ -11738,7 +12004,8 @@ export declare function useRequiredVideos(): UseQueryResult<NoInfer<HelpVideoDto
11738
12004
  /**
11739
12005
  * The sentence to show for a failed action: the server's explanation when it
11740
12006
  * gave one, the plain "something went wrong" for a code error, else the
11741
- * error's own message (or `fallback`).
12007
+ * error's own message (or `fallback`). Never raw text: a status line, a
12008
+ * stack, SQL, a driver error or a JavaScript error reads as what it means.
11742
12009
  */
11743
12010
  export declare function userErrorMessage(err: unknown, fallback?: string): string;
11744
12011