@nivaro/react 0.3.110 → 0.3.112

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 (77) hide show
  1. package/dist/full.css +1 -1
  2. package/dist/hooks/useSessionRecorder.js +1 -1
  3. package/dist/index.d.ts +170 -2
  4. package/dist/index.js +745 -728
  5. package/dist/shared/components/CollectionBrowserView.js +3097 -2972
  6. package/dist/shared/components/CollectionImportBanner.js +135 -0
  7. package/dist/shared/components/ItemEditForm.js +2235 -2218
  8. package/dist/shared/components/JobsTray.js +54 -47
  9. package/dist/shared/components/TipLayer.js +61 -54
  10. package/dist/shared/components/ViewAsPersonButton.js +109 -0
  11. package/dist/shared/components/bulk/BulkFieldUpdate.js +228 -150
  12. package/dist/shared/components/bulk/BulkFieldUpdateButton.js +35 -41
  13. package/dist/shared/components/bulk/BulkLinksValue.js +91 -0
  14. package/dist/shared/components/bulk/bulk-field-options.js +20 -19
  15. package/dist/shared/components/bulk/bulk-update-preview.js +39 -0
  16. package/dist/shared/components/cbv/ColumnHeaderMenu.js +113 -0
  17. package/dist/shared/components/cbv/column-totals.js +66 -0
  18. package/dist/shared/components/collections-directory/CollectionHoverCard.js +108 -81
  19. package/dist/shared/components/collections-directory/CollectionRow.js +164 -148
  20. package/dist/shared/components/collections-directory/CollectionsDirectory.js +167 -166
  21. package/dist/shared/components/collections-directory/directory-data.js +70 -58
  22. package/dist/shared/components/imports/CollectionImportPanel.js +120 -118
  23. package/dist/shared/components/imports/DefinitionsPanel.js +24 -24
  24. package/dist/shared/components/imports/ImportDuplicatesNotice.js +65 -0
  25. package/dist/shared/components/item-edit/CatalogPickerField.js +631 -639
  26. package/dist/shared/components/item-edit/DuplicateNotice.js +168 -0
  27. package/dist/shared/components/item-edit/FieldRow.js +248 -246
  28. package/dist/shared/components/item-edit/InlineGridField.js +34 -33
  29. package/dist/shared/components/item-edit/InlineTableField.js +3064 -2882
  30. package/dist/shared/components/item-edit/MembershipSetField.js +165 -169
  31. package/dist/shared/components/item-edit/NestedRelationEditor.js +184 -189
  32. package/dist/shared/components/item-edit/PlanGrid.js +2 -1
  33. package/dist/shared/components/item-edit/QuickPickerDialog.js +35 -34
  34. package/dist/shared/components/item-edit/RecordLiveSync.js +32 -30
  35. package/dist/shared/components/item-edit/RelationCombobox.js +101 -100
  36. package/dist/shared/components/item-edit/RowHistorySheet.js +28 -27
  37. package/dist/shared/components/item-edit/SummaryPanel.js +133 -135
  38. package/dist/shared/components/item-edit/ViewAsRole.js +129 -52
  39. package/dist/shared/components/item-edit/grid-search.js +345 -0
  40. package/dist/shared/components/item-edit/render-stability.js +61 -54
  41. package/dist/shared/components/notifications/NotificationRulesEditor.js +25 -20
  42. package/dist/shared/components/ops-report/DigestSections.js +163 -144
  43. package/dist/shared/components/ops-report/drill.js +97 -97
  44. package/dist/shared/components/panels/AddendumLinesDiff.js +52 -51
  45. package/dist/shared/components/panels/AddendumPanel.js +92 -91
  46. package/dist/shared/components/panels/AsyncUserPicker.js +108 -0
  47. package/dist/shared/components/panels/BlockedMove.js +73 -0
  48. package/dist/shared/components/panels/CommentPanel.js +265 -252
  49. package/dist/shared/components/panels/OwnersSlot.js +47 -35
  50. package/dist/shared/components/panels/PipelineInsight.js +186 -0
  51. package/dist/shared/components/panels/PipelinePanel.js +1573 -1475
  52. package/dist/shared/components/panels/RecordIntegrityBanner.js +39 -38
  53. package/dist/shared/components/panels/RevisionsPanel.js +261 -260
  54. package/dist/shared/components/pipeline/FieldPicker.js +41 -40
  55. package/dist/shared/components/pipeline/OwnerMatrix.js +829 -700
  56. package/dist/shared/components/pipeline/OwnerRecordTrial.js +362 -0
  57. package/dist/shared/components/pipeline/PipelineEditorView.js +483 -467
  58. package/dist/shared/components/pipeline/PipelineStateOwners.js +65 -64
  59. package/dist/shared/components/pipeline/owner-matrix-draft.js +178 -0
  60. package/dist/shared/components/profile/MyDefaultsCard.js +36 -35
  61. package/dist/shared/components/profile/PersonHeader.js +29 -29
  62. package/dist/shared/components/profile/PersonProfile.js +30 -28
  63. package/dist/shared/components/profile/SlowScreensCard.js +286 -0
  64. package/dist/shared/components/queue/QueueWorklist.js +1090 -1071
  65. package/dist/shared/components/quick-filters/useQuickFilterEditing.js +45 -44
  66. package/dist/shared/components/support/TicketDetailSheet.js +25 -16
  67. package/dist/shared/components/support/TicketSlowScreens.js +32 -0
  68. package/dist/shared/lib/activity-sentence.js +224 -178
  69. package/dist/shared/lib/collection-import-banner.js +27 -0
  70. package/dist/shared/lib/crash-report.js +112 -0
  71. package/dist/shared/lib/export-runs.js +99 -0
  72. package/dist/shared/lib/jobs-tray.js +89 -67
  73. package/dist/shared/lib/list-link.js +76 -69
  74. package/dist/shared/lib/nav-trail.js +180 -76
  75. package/dist/shared/lib/query-keys.js +26 -0
  76. package/dist/shared/lib/view-as.js +16 -11
  77. package/package.json +1 -1
@@ -10,7 +10,7 @@ import { noteReplayEvent as Fe, createReplayCheckoutState as Me } from "../share
10
10
  import { emitReplayTap as Ne, setReplayRecorderMode as O, registerReplayCapture as Oe, clipEndOffset as Ue, withClipKind as We } from "../shared/lib/replay-capture.js";
11
11
  import { instrumentConsole as He, instrumentRequests as Ke, redactSecrets as $e } from "../shared/lib/replay-context.js";
12
12
  import { instrumentSocket as Be } from "../shared/lib/replay-socket.js";
13
- const ze = "nivaro-react@0.3.110", Q = 1e4, Ye = 150, xe = 3e3, je = 600, Ge = (o) => `nvr_replay_resume${o ? `:${o}` : ""}`, V = () => typeof navigator > "u" || navigator.onLine !== !1;
13
+ const ze = "nivaro-react@0.3.112", Q = 1e4, Ye = 150, xe = 3e3, je = 600, Ge = (o) => `nvr_replay_resume${o ? `:${o}` : ""}`, V = () => typeof navigator > "u" || navigator.onLine !== !1;
14
14
  function Je(o) {
15
15
  return typeof o.url != "string" || typeof fetch != "function" ? null : (f, u) => {
16
16
  const l = typeof o.getToken == "function" ? o.getToken() : void 0, d = { "Content-Type": "application/json" };
package/dist/index.d.ts CHANGED
@@ -1170,6 +1170,14 @@ export declare function buildClientCrashBody(error: unknown, info: {
1170
1170
 
1171
1171
  export declare function buildCopyAs(input: CopyAsInput): CopyAsSnippets;
1172
1172
 
1173
+ export declare function buildCrashBody(err: Error, kind: CrashKind, ctx: {
1174
+ app: string;
1175
+ screen: string;
1176
+ release?: string;
1177
+ componentStack?: string | null;
1178
+ replay?: ReplayLink | null;
1179
+ }): CrashBody;
1180
+
1173
1181
  export declare function buildGroups<T extends QueueGroupingRow>(rows: T[], attribute: string): QueueGroup<T>[];
1174
1182
 
1175
1183
  /** The POST /support/report-problem body (exported for tests). */
@@ -2524,6 +2532,76 @@ export declare function copyErrorDetails(input: ErrorDescription | unknown, extr
2524
2532
  action?: string;
2525
2533
  }): Promise<boolean>;
2526
2534
 
2535
+ export declare interface CrashBody {
2536
+ message: string;
2537
+ name: string;
2538
+ stack?: string;
2539
+ kind: CrashKind;
2540
+ app: string;
2541
+ screen: string;
2542
+ /** Kept for servers before crash grouping (they file by `url`); a route pattern too. */
2543
+ url: string;
2544
+ release?: string;
2545
+ recording_id?: string;
2546
+ recording_offset_ms?: number | null;
2547
+ }
2548
+
2549
+ /** The per-tab dedupe key: name, message and the first stack frame. */
2550
+ export declare function crashKey(err: Error): string;
2551
+
2552
+ /**
2553
+ * Front-end crash reporter (Issue Log → Crashes). One per tab: every uncaught render error (an
2554
+ * error boundary calls `report(err, 'render', componentStack)`), window `error` and
2555
+ * `unhandledrejection` becomes ONE POST /issues/client with:
2556
+ *
2557
+ * message, name, stack (scrubbed), kind, app, screen (route PATTERN, never ids or query),
2558
+ * release (the build), and the replay link when error replay is on.
2559
+ *
2560
+ * The server groups by signature + screen + release, counts people and alerts admins when a
2561
+ * release brings a new crash (api services/crash-tracking.ts) — this side only decides what is
2562
+ * worth sending:
2563
+ *
2564
+ * - window errors and rejections only when they are bugs in our code: an Error that is not the
2565
+ * network, carries no HTTP status and is not an abort/cancel (the server already logged its
2566
+ * own answers). Render errors always are.
2567
+ * - never a browser extension's script, never a cross-origin "Script error." without an Error.
2568
+ * - deduped per tab: the same error is re-sent at most once per `dedupeMs` (5 minutes), so a
2569
+ * render loop is one report and a crash that keeps happening still counts.
2570
+ * - rate-limited per tab: at most `maxPerMinute` (6) a minute and `maxPerTab` (30) per page load.
2571
+ * - scrubbed (`scrubCrashText`): tokens, passwords, emails, long opaque strings, URL query strings
2572
+ * and quoted values that are not identifiers. Form values never leave the tab. The server
2573
+ * scrubs again; its pass is the one that counts.
2574
+ *
2575
+ * Never throws; a failed send is dropped.
2576
+ */
2577
+ export declare type CrashKind = 'render' | 'error' | 'rejection';
2578
+
2579
+ export declare interface CrashReporter {
2580
+ /** File one crash; false when it was dropped (not worth it, a repeat, or over the limit). */
2581
+ report(err: unknown, kind: CrashKind, componentStack?: string | null): boolean;
2582
+ /** Window `error` + `unhandledrejection` listeners; returns the uninstaller. */
2583
+ install(target?: Window): () => void;
2584
+ /** Tests: how many reports this tab has sent. */
2585
+ readonly sent: number;
2586
+ }
2587
+
2588
+ export declare interface CrashReporterOptions {
2589
+ app: string;
2590
+ /** The build this tab runs (also sent as x-nivaro-client by the page-context fetch). */
2591
+ release?: string | (() => string | undefined);
2592
+ send: (body: CrashBody) => Promise<unknown>;
2593
+ /** The error replay clip (or live recording offset); null when replay is off. */
2594
+ captureReplay?: () => Promise<ReplayLink | null>;
2595
+ /** The current screen's route pattern; default `pagePattern(location.pathname)`. */
2596
+ screen?: () => string;
2597
+ maxPerMinute?: number;
2598
+ maxPerTab?: number;
2599
+ dedupeMs?: number;
2600
+ now?: () => number;
2601
+ }
2602
+
2603
+ export declare function createCrashReporter(opts: CrashReporterOptions): CrashReporter;
2604
+
2527
2605
  /**
2528
2606
  * `opts.open` is the gate's state AT CONSTRUCTION. A host that starts a
2529
2607
  * hidden tab must pass `false` here rather than calling `setOpen(false)`
@@ -4316,6 +4394,8 @@ declare type GetLoader = <T>(path: string, read: BatchedGet<T>) => Promise<T>;
4316
4394
 
4317
4395
  export declare function getMentionQuery(text: string, cursorPos: number): string | null;
4318
4396
 
4397
+ export declare function getNavTrail(): TrailState;
4398
+
4319
4399
  /** A copy of the rings, oldest first. */
4320
4400
  export declare function getReplayTail(): ReplayTail;
4321
4401
 
@@ -5957,6 +6037,9 @@ export declare function isCleanRecording(): boolean;
5957
6037
  /** A bug in our own code (not the server's answer, not the network). */
5958
6038
  export declare function isCodeError(err: unknown): boolean;
5959
6039
 
6040
+ /** Is a window error / unhandled rejection a crash in our own code worth filing? */
6041
+ export declare function isCrashWorthy(err: unknown): err is Error;
6042
+
5960
6043
  /**
5961
6044
  * A list or search the server gave up on: 503 with code LIST_TIMEOUT, or (5xx
5962
6045
  * bodies carry no code) its "took too long" sentence. Distinct from the busy
@@ -6553,6 +6636,13 @@ export declare function LearningPathCard({ className }: {
6553
6636
  className?: string;
6554
6637
  }): JSX.Element;
6555
6638
 
6639
+ /**
6640
+ * Fired on `window` after a list rewrote its address (replaceListLinkParam), with
6641
+ * `detail.path` = the new pathname + search + hash. Hosts that remember "where a record was
6642
+ * opened from" (efp-new lib/back.ts) re-read the address on it: the router never saw it.
6643
+ */
6644
+ export declare const LIST_ADDRESS_EVENT = "nvr:list-address";
6645
+
6556
6646
  declare type Listener = (...args: any[]) => void;
6557
6647
 
6558
6648
  export declare function listFieldInterfaces(): string[];
@@ -6617,6 +6707,18 @@ export declare function ListSkeleton({ columns, rows, header, rowClassName, clas
6617
6707
  className?: string;
6618
6708
  }): JSX.Element;
6619
6709
 
6710
+ /**
6711
+ * The words a list adds after its name in a crumb / back link: the saved view (else the
6712
+ * scope it shows), the search, how many filters when no view names them, and the page past
6713
+ * the first — "My open · “pump” · page 3". '' when the list is in its plain state.
6714
+ */
6715
+ export declare function listTrailDetail(p: {
6716
+ view?: string | null;
6717
+ search?: string | null;
6718
+ filters?: number;
6719
+ page?: number;
6720
+ }): string;
6721
+
6620
6722
  /**
6621
6723
  * Query-key heads of surfaces that keep themselves live with their own socket handlers (record
6622
6724
  * pages — RECORD_QUERY_HEADS in item-edit/RecordLiveSync — the collection browser's row reads,
@@ -7272,6 +7374,13 @@ export declare function noteCredentialChanged(): void;
7272
7374
  */
7273
7375
  export declare function noteSignedIn(): void;
7274
7376
 
7377
+ /**
7378
+ * The current entry's address changed outside the router (a list writing its state into
7379
+ * `?lv=` with history.replaceState): keep the trail's copy in step, so a crumb's link (new
7380
+ * tab, copied) carries it and a POP back is recognised as the same entry. Same page only.
7381
+ */
7382
+ export declare function noteTrailAddress(path: string): void;
7383
+
7275
7384
  /**
7276
7385
  * A 401 from the API: close the gate and push the next probe further out. `escalate: false`
7277
7386
  * (a refusal from an ordinary read) only closes an open gate — it never lengthens the wait.
@@ -8222,7 +8331,7 @@ declare type PipelineOwnerDimension = {
8222
8331
  cascade?: DimensionCascadeRule[] | null;
8223
8332
  };
8224
8333
 
8225
- export declare function PipelinePanel({ collection, item, defaultExpanded, title, showApprovalChain, hideActionsCollapsed, hideActionsExpanded, onBeforeTransition, addendumPending, addendumView, asRole }: {
8334
+ export declare function PipelinePanel({ collection, item, defaultExpanded, title, showApprovalChain, hideActionsCollapsed, hideActionsExpanded, onBeforeTransition, addendumPending, addendumView, asRole, asUser }: {
8226
8335
  collection: string;
8227
8336
  item: string;
8228
8337
  defaultExpanded?: boolean;
@@ -8230,6 +8339,9 @@ export declare function PipelinePanel({ collection, item, defaultExpanded, title
8230
8339
  showApprovalChain?: boolean;
8231
8340
  /** Admin "view as role" (#8): evaluate available transitions for this role instead of the caller. */
8232
8341
  asRole?: string | null;
8342
+ /** Admin "view as person": the moves, blocked moves and owner checks judged as
8343
+ * this person (`?as_user=`). A preview: nothing is pressed from it. */
8344
+ asUser?: string | null;
8233
8345
  /** Layout-configurable: suppress the transition buttons inside the slot
8234
8346
  * (collapsed header row / expanded body) — redundant when the record header
8235
8347
  * already renders PipelineTransitionButtons. */
@@ -8262,7 +8374,7 @@ declare type PipelineState = {
8262
8374
  external_label?: string | null;
8263
8375
  };
8264
8376
 
8265
- export declare function PipelineTransitionButtons({ collection, item, onBeforeTransition, wrap }: {
8377
+ export declare function PipelineTransitionButtons({ collection, item, onBeforeTransition, wrap, asRole, asUser }: {
8266
8378
  collection: string;
8267
8379
  item: string;
8268
8380
  onBeforeTransition?: () => boolean | Promise<boolean>;
@@ -8271,6 +8383,10 @@ export declare function PipelineTransitionButtons({ collection, item, onBeforeTr
8271
8383
  * the header row still overflows with its tool strip folded, the buttons
8272
8384
  * fold into one "Actions" menu so every step stays reachable. */
8273
8385
  wrap?: boolean;
8386
+ /** Admin preview (same as PipelinePanel): the buttons this role / person
8387
+ * would get, drawn exactly — never pressed. */
8388
+ asRole?: string | null;
8389
+ asUser?: string | null;
8274
8390
  }): JSX.Element | null;
8275
8391
 
8276
8392
  /**
@@ -10023,6 +10139,13 @@ export declare function restoreMetadata(qc: MetadataQueryClient, id: MetadataIde
10023
10139
  now?: () => number;
10024
10140
  }): Promise<number>;
10025
10141
 
10142
+ /**
10143
+ * Put remembered scroll positions back, retrying while the page loads its data
10144
+ * (a list is short until its rows arrive). Gives up after `timeoutMs`, or as
10145
+ * soon as the person scrolls themselves. Returns a cancel function.
10146
+ */
10147
+ export declare function restoreTrailScroll(root: Element, scroll: TrailScroll[], timeoutMs?: number): () => void;
10148
+
10026
10149
  /** A request to bring `target` into view; `seq` changes on every request. */
10027
10150
  declare interface RevealSignal {
10028
10151
  target: DesignTarget;
@@ -10462,6 +10585,28 @@ declare interface ScopeDimensionLite {
10462
10585
  display_field?: string | null;
10463
10586
  }
10464
10587
 
10588
+ /** A child's position under `root` as child indexes ('0.2.1'); '' = root itself. */
10589
+ export declare function scrollPathOf(root: Element, el: Element): string | null;
10590
+
10591
+ /**
10592
+ * The scroll to put back on arriving at the current entry: its own remembered scroll on a
10593
+ * POP (Back / a crumb); on a "return to the list" PUSH (a record's back arrow — efp-new opens
10594
+ * the list as a NEW entry, LIST_RETURN_STATE), the newest earlier visit of the same page.
10595
+ * Null = nothing to restore.
10596
+ */
10597
+ export declare function scrollToRestore(state: TrailState, arrival: {
10598
+ action: TrailAction;
10599
+ idx: number;
10600
+ path: string;
10601
+ returning?: boolean;
10602
+ }): TrailScroll[] | null;
10603
+
10604
+ /**
10605
+ * Text with secrets and typed values replaced, capped at `max`. Twin of api
10606
+ * services/crash-signature.ts `scrubCrashText` (keep the rules the same).
10607
+ */
10608
+ export declare function scrubCrashText(text: string | null | undefined, max?: number): string;
10609
+
10465
10610
  /**
10466
10611
  * Text with the typed search marked (lib/search-text.ts `highlightParts`):
10467
10612
  * every token and synonym, case- and accent-insensitive. The mark keeps the
@@ -10618,6 +10763,13 @@ export declare function setServerClockOffset(ms: number): void;
10618
10763
 
10619
10764
  export declare function setTimeDisplay(mode: string | null | undefined): void;
10620
10765
 
10766
+ /**
10767
+ * What a list shows right now, for the crumb / back link that returns to it ("My open ·
10768
+ * page 3" → "Back to Workflows · My open · page 3"). The list component calls it on every
10769
+ * change; '' clears it. Lands on the current entry only.
10770
+ */
10771
+ export declare function setTrailDetail(detail: string | null | undefined): void;
10772
+
10621
10773
  /**
10622
10774
  * Name a page in the trail (what later crumbs will show for it): the current
10623
10775
  * entry — and, when a key is given, only while that key is still current (a
@@ -10625,6 +10777,9 @@ export declare function setTimeDisplay(mode: string | null | undefined): void;
10625
10777
  */
10626
10778
  export declare function setTrailLabel(label: string | null | undefined, key?: string): void;
10627
10779
 
10780
+ /** Remember the current page's scroll positions (restored on a POP back to it). */
10781
+ export declare function setTrailScroll(scroll: TrailScroll[]): void;
10782
+
10628
10783
  /** True when this browser can share a socket between tabs. */
10629
10784
  export declare function sharedWorkerSupported(): boolean;
10630
10785
 
@@ -11689,16 +11844,23 @@ declare interface TrailCrumb {
11689
11844
  key: string;
11690
11845
  path: string;
11691
11846
  label?: string;
11847
+ /** What a list showed when it was left ("My open · page 3"). */
11848
+ detail?: string;
11692
11849
  /** History steps to go back to reach it (negative). */
11693
11850
  delta: number;
11694
11851
  }
11695
11852
 
11853
+ /** A crumb's full name: its label and, for a list, what it showed. */
11854
+ export declare function trailCrumbText(label: string, detail?: string | null): string;
11855
+
11696
11856
  declare interface TrailEntry {
11697
11857
  key: string;
11698
11858
  idx: number;
11699
11859
  /** pathname + search + hash */
11700
11860
  path: string;
11701
11861
  label?: string;
11862
+ /** What the page showed, for a list: "My open · page 3" (setTrailDetail). */
11863
+ detail?: string;
11702
11864
  scroll?: TrailScroll[];
11703
11865
  at: number;
11704
11866
  }
@@ -12957,6 +13119,7 @@ export declare interface VideoEdits {
12957
13119
  export declare function viewAs(person: {
12958
13120
  id: string;
12959
13121
  name: string;
13122
+ path?: string;
12960
13123
  }): void | Promise<void>;
12961
13124
 
12962
13125
  /**
@@ -12965,10 +13128,15 @@ export declare function viewAs(person: {
12965
13128
  * admin opens a new tab on a per-tab masquerade token; a host without the
12966
13129
  * idea never registers and the button never shows. Same shape as the chat
12967
13130
  * DM opener registry.
13131
+ *
13132
+ * `path` (Rob 2026-11-13, "See this record as <person>"): the page the View-as
13133
+ * tab opens on — an app-relative path like `/collections/requests/42`. A host
13134
+ * that does not read it opens its home page, as before.
12968
13135
  */
12969
13136
  declare type ViewAsOpener = (person: {
12970
13137
  id: string;
12971
13138
  name: string;
13139
+ path?: string;
12972
13140
  }) => void | Promise<void>;
12973
13141
 
12974
13142
  declare type Visibility = {