@nivaro/react 0.3.46 → 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 (57) hide show
  1. package/dist/full.css +1 -1
  2. package/dist/hooks/useSessionRecorder.js +1 -1
  3. package/dist/index.d.ts +248 -16
  4. package/dist/index.js +679 -659
  5. package/dist/shared/components/CollectionBrowserView.js +813 -826
  6. package/dist/shared/components/ErrorNotice.js +169 -0
  7. package/dist/shared/components/ErrorSurface.js +23 -17
  8. package/dist/shared/components/ListLoadError.js +8 -29
  9. package/dist/shared/components/LoadErrorNote.js +38 -21
  10. package/dist/shared/components/QueryErrorState.js +8 -11
  11. package/dist/shared/components/ReportView.js +1320 -1291
  12. package/dist/shared/components/chat/ChannelArchive.js +60 -60
  13. package/dist/shared/components/chat/ChannelExtras.js +74 -74
  14. package/dist/shared/components/chat/ChatPanel.js +368 -367
  15. package/dist/shared/components/command-center/PeekPanel.js +33 -32
  16. package/dist/shared/components/command-center/panels/BoardSettings.js +41 -40
  17. package/dist/shared/components/command-center/panels/PeoplePanel.js +32 -31
  18. package/dist/shared/components/help-videos/editor/ClipsPanel.js +49 -48
  19. package/dist/shared/components/help-videos/editor/PublishButton.js +37 -36
  20. package/dist/shared/components/help-videos/editor/StatsTab.js +45 -44
  21. package/dist/shared/components/help-videos/editor/VersionsTab.js +29 -28
  22. package/dist/shared/components/help-videos/library/AuthorRolesButton.js +19 -18
  23. package/dist/shared/components/help-videos/library/HelpVideoLibrary.js +132 -129
  24. package/dist/shared/components/help-videos/library/LearningPathsPanel.js +42 -41
  25. package/dist/shared/components/help-videos/settings/HouseStyleButton.js +21 -20
  26. package/dist/shared/components/help-videos/settings/RenderSettingsButton.js +22 -21
  27. package/dist/shared/components/import/DocumentAutofillButton.js +24 -20
  28. package/dist/shared/components/import/ImportFromFileButton.js +61 -60
  29. package/dist/shared/components/imports/ImportStalenessControl.js +20 -21
  30. package/dist/shared/components/imports/NewImportDialog.js +29 -28
  31. package/dist/shared/components/imports/RunDetailSheet.js +63 -63
  32. package/dist/shared/components/item-edit/FieldRow.js +329 -329
  33. package/dist/shared/components/item-edit/InlineTableField.js +898 -898
  34. package/dist/shared/components/item-edit/PersonalDefaultControl.js +57 -56
  35. package/dist/shared/components/item-edit/PlanGrid.js +220 -221
  36. package/dist/shared/components/item-edit/RecordGrantTools.js +49 -48
  37. package/dist/shared/components/item-edit/placement-behaviour.js +68 -67
  38. package/dist/shared/components/layout-editor/inspector/ColumnFit.js +24 -23
  39. package/dist/shared/components/layout-editor/inspector/PickerPreview.js +17 -16
  40. package/dist/shared/components/layout-editor/matrix/FieldStateMatrix.js +41 -41
  41. package/dist/shared/components/layout-editor/outputs/output-api.js +33 -31
  42. package/dist/shared/components/layout-editor/overview/overview-api.js +84 -83
  43. package/dist/shared/components/layout-editor/useLayoutDraft.js +47 -42
  44. package/dist/shared/components/monitoring/InactiveUserLinksView.js +10 -9
  45. package/dist/shared/components/panels/SlaClock.js +35 -36
  46. package/dist/shared/components/pipeline/PipelineEditorView.js +311 -312
  47. package/dist/shared/components/pipeline/TeamSuggestions.js +31 -30
  48. package/dist/shared/components/profile/AgentsPanel.js +73 -72
  49. package/dist/shared/components/profile/MailSuppressedPill.js +22 -21
  50. package/dist/shared/components/support/SupportRequestDialog.js +85 -81
  51. package/dist/shared/components/support/SupportView.js +94 -87
  52. package/dist/shared/lib/autofill-poll.js +21 -18
  53. package/dist/shared/lib/error-actions.js +85 -0
  54. package/dist/shared/lib/error-message.js +223 -82
  55. package/dist/shared/lib/error-toast.js +71 -13
  56. package/dist/shared/lib/safe-error.js +136 -38
  57. 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.46", 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';
@@ -2341,6 +2342,11 @@ declare interface CopyAsSnippets {
2341
2342
  graphql: string;
2342
2343
  }
2343
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
+
2344
2350
  /**
2345
2351
  * `opts.open` is the gate's state AT CONSTRUCTION. A host that starts a
2346
2352
  * hidden tab must pass `false` here rather than calling `setOpen(false)`
@@ -2619,6 +2625,21 @@ export declare function deriveGroupKey<T extends QueueGroupingRow>(row: T, attri
2619
2625
 
2620
2626
  export declare function describeCron(cron: string): string;
2621
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
+
2622
2643
  /**
2623
2644
  * Drag and drop state for design nodes. Plain functions, no hooks: inside a
2624
2645
  * LayoutDndProvider every DesignNode registers through the provider's store
@@ -3070,6 +3091,124 @@ export declare interface ErpSubmission {
3070
3091
  explanation?: IntegrationErrorExplanation | null;
3071
3092
  }
3072
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
+
3073
3212
  export declare interface ErrorReplayLink {
3074
3213
  recording_id: string;
3075
3214
  /** Milliseconds into the recording where the error happened. Null for
@@ -3077,18 +3216,27 @@ export declare interface ErrorReplayLink {
3077
3216
  offset_ms: number | null;
3078
3217
  }
3079
3218
 
3080
- /**
3081
- * Error surface family (#324): 403/404/500 as one designed system — a name
3082
- * for what happened, an honest cause line, and the one right action. The
3083
- * smart-404 (#219) and AccessDeniedPanel remain the record-scoped variants;
3084
- * this is the page-level chrome.
3085
- */
3086
- 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 }: {
3087
3223
  variant: '403' | '404' | '500';
3088
3224
  detail?: string;
3225
+ error?: unknown;
3089
3226
  action?: ReactNode;
3090
3227
  }): JSX.Element;
3091
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
+
3092
3240
  /** Boolean convenience — for guards and conditions. */
3093
3241
  export declare function evaluateBoolean(src: string, row: TokenResolver | Record<string, unknown>, opts?: EvaluateOptions): boolean;
3094
3242
 
@@ -3940,6 +4088,19 @@ export declare function groupActivity<T extends ActivityEntryInput>(entries: T[]
3940
4088
  windowMs?: number;
3941
4089
  }): ActivityGroup<T>[];
3942
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
+
3943
4104
  /**
3944
4105
  * Run one identity call through the gate: `blocked()` answers without a request while the tab
3945
4106
  * is signed out (outside its probe window); a success opens the gate, a signed-out 401 closes it.
@@ -5454,6 +5615,14 @@ export declare function isCodeError(err: unknown): boolean;
5454
5615
  */
5455
5616
  export declare function isListTimeout(err: unknown): boolean;
5456
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
+
5457
5626
  export declare function isReloadingForUpdate(): boolean;
5458
5627
 
5459
5628
  /** True once a 401 said this tab is signed out, until a sign-in is heard. */
@@ -6038,10 +6207,11 @@ export declare function listFieldInterfaces(): string[];
6038
6207
 
6039
6208
  /**
6040
6209
  * A list read that failed — a 503 list timeout ("This search took too long to
6041
- * finish…"), a busy server, anything else — said in place of the rows, with
6042
- * Retry. Never the empty sentence: a failed read has no answer to borrow one
6043
- * from. Rendered by the list itself above its table, not through the table's
6044
- * 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.
6045
6215
  */
6046
6216
  export declare function ListLoadError({ error, onRetry, className }: {
6047
6217
  error: unknown;
@@ -6266,9 +6436,15 @@ export declare function liveRefetchInterval(live: boolean, base: number | false
6266
6436
  /**
6267
6437
  * The degraded state for a widget or panel whose data did not load (#2858): what happened in
6268
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.
6269
6443
  */
6270
- export declare function LoadErrorNote({ message, onRetry, className, centered }: {
6271
- message: string;
6444
+ export declare function LoadErrorNote({ message, error, what, onRetry, className, centered }: {
6445
+ message?: string;
6446
+ error?: unknown;
6447
+ what?: string;
6272
6448
  onRetry?: () => void;
6273
6449
  className?: string;
6274
6450
  centered?: boolean;
@@ -7105,6 +7281,11 @@ export declare function openClientChaosToolbar(): void;
7105
7281
 
7106
7282
  export declare function openDmWith(userId: string, displayName?: string): void;
7107
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
+
7108
7289
  declare interface OpenverseSearch {
7109
7290
  /** False when the instance switched Openverse off (HELP_VIDEO_OPENVERSE=off). */
7110
7291
  enabled: boolean;
@@ -7692,6 +7873,14 @@ export declare function PipelineTransitionButtons({ collection, item, onBeforeTr
7692
7873
  wrap?: boolean;
7693
7874
  }): JSX.Element | null;
7694
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
+
7695
7884
  export declare interface PlanGridHost {
7696
7885
  renderRowHistory?: (args: PlanGridRowHistoryArgs) => ReactNode | null;
7697
7886
  }
@@ -7984,6 +8173,20 @@ declare type QueryCacheLike = {
7984
8173
  }) => void): () => void;
7985
8174
  };
7986
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
+
7987
8190
  declare type QueryRowClick = {
7988
8191
  picker?: {
7989
8192
  collection: string;
@@ -8199,11 +8402,13 @@ declare interface QueryTableConfig {
8199
8402
  };
8200
8403
  }
8201
8404
 
8202
- export declare function QueryWidgetBody({ cfg, dateRange, entityFilters, refetchInterval, onStatus, onDrill }: {
8405
+ export declare function QueryWidgetBody({ cfg, dateRange, entityFilters, refetchInterval, onStatus, onDrill, deferred }: {
8203
8406
  cfg: ReportQueryWidgetConfig;
8204
8407
  dateRange: ReportDateRange | null;
8205
8408
  entityFilters: ReportEntityFilter[];
8206
8409
  refetchInterval?: number;
8410
+ /** Not near the viewport yet: hold the query (and show the loading line) until it is. */
8411
+ deferred?: boolean;
8207
8412
  onStatus?: (s: {
8208
8413
  isFetching: boolean;
8209
8414
  refetch: () => void;
@@ -9702,6 +9907,12 @@ export declare function rumWidget(opts: {
9702
9907
  paintMs: number;
9703
9908
  }): void;
9704
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
+
9705
9916
  /** Convenience: run a resolved target (navigate, open the chat room, or open
9706
9917
  * a foreign-app URL in a new tab). */
9707
9918
  export declare function runNotificationTarget(target: NotificationTarget, navigate: (path: string) => void): boolean;
@@ -9845,6 +10056,8 @@ export declare interface SessionRecorderOptions {
9845
10056
 
9846
10057
  export declare function setDisplayTimezone(tz: string | null): void;
9847
10058
 
10059
+ export declare function setErrorActionHost(next: ErrorActionHost): void;
10060
+
9848
10061
  /**
9849
10062
  * Fiscal calendar helpers (#343). The instance's fiscal-year start month
9850
10063
  * lives on nivaro_settings.fiscal_year_start_month; hosts hydrate it via
@@ -10481,13 +10694,16 @@ export declare interface SupportCategory {
10481
10694
  * that moment) and a text attachment with the page, the console tail and the
10482
10695
  * last twenty requests. Nothing uploads unless the request is sent.
10483
10696
  */
10484
- export declare function SupportRequestDialog({ open, onOpenChange, collection, item, recordLabel, onCreated }: {
10697
+ export declare function SupportRequestDialog({ open, onOpenChange, collection, item, recordLabel, initialTitle, initialDescription, onCreated }: {
10485
10698
  open: boolean;
10486
10699
  onOpenChange: (open: boolean) => void;
10487
10700
  collection?: string | null;
10488
10701
  item?: string | number | null;
10489
10702
  /** Friendly id of the record ("CM26-79811"), shown in the title. */
10490
10703
  recordLabel?: string | null;
10704
+ /** Prefill (an error's "Get help": what happened and its reference). */
10705
+ initialTitle?: string;
10706
+ initialDescription?: string;
10491
10707
  onCreated?: (ticket: SupportTicket) => void;
10492
10708
  }): JSX.Element;
10493
10709
 
@@ -10767,6 +10983,21 @@ export declare function TipLayer(): ReactPortal | null;
10767
10983
 
10768
10984
  export declare function titleCase(str: string): string;
10769
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
+
10770
11001
  /** Typed text → tokens: whitespace-split words, "quoted phrases" kept whole; folded, unique. */
10771
11002
  export declare function tokenize(q: string | null | undefined): string[];
10772
11003
 
@@ -11773,7 +12004,8 @@ export declare function useRequiredVideos(): UseQueryResult<NoInfer<HelpVideoDto
11773
12004
  /**
11774
12005
  * The sentence to show for a failed action: the server's explanation when it
11775
12006
  * gave one, the plain "something went wrong" for a code error, else the
11776
- * 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.
11777
12009
  */
11778
12010
  export declare function userErrorMessage(err: unknown, fallback?: string): string;
11779
12011