@nivaro/react 0.3.106 → 0.3.108

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.
@@ -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.106", 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.108", 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
@@ -2205,6 +2205,16 @@ export declare interface CollectionBrowserViewProps {
2205
2205
  className?: string;
2206
2206
  }
2207
2207
 
2208
+ /**
2209
+ * The person's own favorite collections — the star. The admin app passes its sidebar
2210
+ * favorites (so a star also lands in the sidebar); without one the directory reads and writes
2211
+ * the same store itself (users.preferences.nav_favorites, `/collections/<name>` paths).
2212
+ */
2213
+ export declare interface CollectionFavorites {
2214
+ favorite: Set<string>;
2215
+ toggle: (collection: string, label: string) => unknown;
2216
+ }
2217
+
2208
2218
  export declare function CollectionImportPanel({ initialJobId, onJobOpen }: {
2209
2219
  /** Deep link: open this job's detail on mount. */
2210
2220
  initialJobId?: string | null;
@@ -2216,6 +2226,86 @@ declare interface CollectionNames {
2216
2226
  plural?: string | null;
2217
2227
  }
2218
2228
 
2229
+ export declare function CollectionsDirectory({ isAdmin, title, collectionPath, include, favorites: hostFavorites, admin }: CollectionsDirectoryProps): JSX.Element;
2230
+
2231
+ /**
2232
+ * Editing tools only the admin app offers (efp-new passes none): each one switches its part
2233
+ * of the page on. Everything else — Pinned, My favorites, Recent, the views, chips, folders,
2234
+ * Jump to, the switches, the hover card, search — is the same in every host.
2235
+ */
2236
+ export declare interface CollectionsDirectoryAdminTools {
2237
+ /** Toolbar buttons before Arrange / Select (new table, schema views, proposals). */
2238
+ toolbarActions?: ReactNode;
2239
+ /** Panels shown above the list (create a table, describe, proposals). */
2240
+ panels?: ReactNode;
2241
+ /** ✏ on each row: where the collection's editor lives. */
2242
+ editPath?: (collection: string) => string;
2243
+ /** An extra group in each row's ⋯ menu. */
2244
+ rowMenu?: {
2245
+ heading: string;
2246
+ items: (collection: string) => RowMenuLink[];
2247
+ };
2248
+ /** Move collections into a folder (null = out of every folder). Turns on the row menu's
2249
+ * "Move to folder" (and, with `renderMoveDialog`, Select). */
2250
+ moveCollections?: (names: string[], group: string | null) => Promise<unknown>;
2251
+ /** Select mode's "Move to folder…" dialog. */
2252
+ renderMoveDialog?: (p: {
2253
+ open: boolean;
2254
+ onOpenChange: (open: boolean) => void;
2255
+ names: string[];
2256
+ folders: FolderOption[];
2257
+ onMoved: () => void;
2258
+ }) => ReactNode;
2259
+ /** Save a new folder / collection order. Turns on Arrange. */
2260
+ reorder?: (items: Array<{
2261
+ collection: string;
2262
+ sort: number;
2263
+ }>) => Promise<unknown>;
2264
+ /** Shown above the folders in the Folders view while nothing is filtered (suggested folders). */
2265
+ renderSuggestions?: (ctx: {
2266
+ real: DirectoryCollection[];
2267
+ folders: FolderOption[];
2268
+ refresh: () => void;
2269
+ }) => ReactNode;
2270
+ /** Extra folded sections under the list (unregistered / system tables). */
2271
+ renderExtraSections?: (ctx: {
2272
+ filter: string;
2273
+ collapsed: Record<string, boolean>;
2274
+ onToggle: (key: string) => void;
2275
+ renderSection: (s: ExtraSectionSpec) => ReactNode;
2276
+ }) => ReactNode;
2277
+ /** "Create a table" on an empty search. */
2278
+ onCreate?: () => void;
2279
+ }
2280
+
2281
+ /**
2282
+ * The collections directory — every registered collection, findable. One page for every host:
2283
+ * the admin app's /collections and efp-new's /admin/data render this.
2284
+ *
2285
+ * Folders (a registry row other rows name as their `group`) hold the curated part; everything
2286
+ * else sits in "Not in a folder", A–Z. Hidden collections and link tables are folded away by
2287
+ * default. Views other than Folders are one flat sorted list. "Pinned" is the shared list an
2288
+ * administrator puts at the top for everyone (shared-pins.ts); "My favorites" are the person's
2289
+ * own stars (= the admin sidebar's favorites); Recent / Most used are this browser's own.
2290
+ * Administrators also get counts, last change, badges, the hover card and pin for everyone.
2291
+ * Editing tools (Arrange, Select → Move to folder, folder suggestions, schema tools, ✏ Edit,
2292
+ * the Data model menu) come only from the host's `admin` prop.
2293
+ */
2294
+ export declare interface CollectionsDirectoryProps {
2295
+ /** The reader is an administrator (stats, admin views, hover card, pin for everyone). */
2296
+ isAdmin: boolean;
2297
+ /** The page's name in the toolbar (default "Collections"). */
2298
+ title?: string;
2299
+ /** Where a collection's records open in this app (default `/collections/<name>`). */
2300
+ collectionPath?: (collection: string) => string;
2301
+ /** Leave collections out of the directory (efp-new: system tables). */
2302
+ include?: (c: DirectoryCollection) => boolean;
2303
+ /** The person's favorites; default = the shared store the admin sidebar uses. */
2304
+ favorites?: CollectionFavorites;
2305
+ /** Host-only editing tools (the admin app). */
2306
+ admin?: CollectionsDirectoryAdminTools;
2307
+ }
2308
+
2219
2309
  /**
2220
2310
  * Realtime sprint client contract. A HOST (admin, a portal app) owns the actual
2221
2311
  * Socket.io connection and provides this to shared components; components
@@ -2856,6 +2946,26 @@ declare interface DirectoryChannel {
2856
2946
  color?: string | null;
2857
2947
  }
2858
2948
 
2949
+ /**
2950
+ * The collections directory (admin /collections, efp-new /admin/data): one shared page that
2951
+ * lists every registered collection. The page (CollectionsDirectory.tsx) owns the state;
2952
+ * the parts in this folder render it. Host-only edit tools come in through
2953
+ * `CollectionsDirectoryAdminTools`, so a host that passes none gets the plain directory.
2954
+ */
2955
+ /** A row of GET /api/collections — only the columns the directory reads. */
2956
+ export declare interface DirectoryCollection {
2957
+ collection: string;
2958
+ display_name?: string | null;
2959
+ icon?: string | null;
2960
+ color?: string | null;
2961
+ note?: string | null;
2962
+ hidden?: boolean | null;
2963
+ singleton?: boolean | null;
2964
+ sort?: number | null;
2965
+ /** The folder it sits in (another row's `collection`). */
2966
+ group?: string | null;
2967
+ }
2968
+
2859
2969
  /** Forget a run: stops watching it (the server run continues on its own). */
2860
2970
  export declare function dismissAutofillRun(id: string): void;
2861
2971
 
@@ -3167,6 +3277,51 @@ export declare function encodePrefill(values: Record<string, unknown>): string;
3167
3277
 
3168
3278
  export declare function endHelpVideoWalk(): void;
3169
3279
 
3280
+ /** The band itself (also the live preview in Settings → This Instance). */
3281
+ export declare function EnvironmentBand({ label, message, productionUrl, preview }: {
3282
+ label: string;
3283
+ message: string;
3284
+ productionUrl: string | null;
3285
+ /** A preview (Settings): no alert role, the link does not navigate. */
3286
+ preview?: boolean;
3287
+ }): JSX.Element;
3288
+
3289
+ /**
3290
+ * Inside the signed-in admin app (when the notice says so): a tape edge along the very top of the window plus a small tag,
3291
+ * and the tab title starts with the environment. Takes no layout space and no clicks.
3292
+ */
3293
+ export declare function EnvironmentEdge({ apiBase }: {
3294
+ apiBase?: string;
3295
+ }): JSX.Element | null;
3296
+
3297
+ /**
3298
+ * "This is not production" (Rob 2026-11-13: people signed in to staging thinking it was the
3299
+ * real portal). Each environment configures its own notice in Settings → This Instance; the
3300
+ * instance hands it out on the public GET /api/app-info (`environment_notice`), before anyone
3301
+ * signs in. No notice, an unknown answer or a failed read show nothing.
3302
+ *
3303
+ * Hazard-tape yellow and ink, the same in light and dark: no app theme uses that pairing, so it
3304
+ * never reads as brand colour (EFP's light accent is amber).
3305
+ */
3306
+ export declare interface EnvironmentInfo {
3307
+ /** The big word ("Staging"). */
3308
+ label: string;
3309
+ /** The sentence beside it. */
3310
+ message: string;
3311
+ /** "Go to production" target (https), or null. */
3312
+ productionUrl: string | null;
3313
+ /** Also mark the signed-in admin app. */
3314
+ inAdminApp: boolean;
3315
+ }
3316
+
3317
+ /**
3318
+ * The sign-in page band: full width across the top, impossible to miss. Says what this is,
3319
+ * that nothing here reaches production, and (when the server knows it) where production is.
3320
+ */
3321
+ export declare function EnvironmentLoginBanner({ apiBase }: {
3322
+ apiBase?: string;
3323
+ }): JSX.Element | null;
3324
+
3170
3325
  export declare function ErpFailureBanner({ collection, itemId }: {
3171
3326
  collection: string;
3172
3327
  itemId: string;
@@ -3483,6 +3638,17 @@ export declare function ExternalRequestsChip({ collection, itemId }: {
3483
3638
  /** Field paths an expression reads, without evaluating it. */
3484
3639
  export declare function extractExpressionTokens(src: string): string[];
3485
3640
 
3641
+ /** A folded section the host adds under the list (the admin's unregistered/system tables). */
3642
+ declare interface ExtraSectionSpec {
3643
+ key: string;
3644
+ label: string;
3645
+ icon?: ReactNode;
3646
+ count: number | null;
3647
+ open: boolean;
3648
+ onToggle: () => void;
3649
+ body: ReactNode;
3650
+ }
3651
+
3486
3652
  /** Extract the slot key from an assignment field name, or null. */
3487
3653
  export declare function extSlotKey(field: string): string | null;
3488
3654
 
@@ -3760,6 +3926,13 @@ export declare function focusRecordTarget(target: {
3760
3926
  rowId?: string;
3761
3927
  }): void;
3762
3928
 
3929
+ declare interface FolderOption {
3930
+ /** The folder's key (a `group` value). */
3931
+ key: string;
3932
+ label: string;
3933
+ color: string | null;
3934
+ }
3935
+
3763
3936
  /** Case- and accent-folded text. */
3764
3937
  export declare function foldSearchText(text: string): string;
3765
3938
 
@@ -10167,6 +10340,15 @@ declare interface RowMatchPanelConfig {
10167
10340
  };
10168
10341
  }
10169
10342
 
10343
+ /** One extra item in a row's ⋯ menu (host-supplied, e.g. the admin's Data model pages). */
10344
+ declare interface RowMenuLink {
10345
+ key: string;
10346
+ label: string;
10347
+ icon?: ReactNode;
10348
+ /** In-app path, opened through the host's navigation. */
10349
+ path: string;
10350
+ }
10351
+
10170
10352
  /**
10171
10353
  * "Who has this row open" on a list row (#2486): up to three 16px avatar discs, overlapping,
10172
10354
  * then "+N" when more people are there; the names in the instant tooltip. People the viewer
@@ -12087,6 +12269,8 @@ export declare function useIdleNextPage(opts: {
12087
12269
 
12088
12270
  export declare function useImportHealth(): UseQueryResult<NoInfer<ImportHealth>, Error>;
12089
12271
 
12272
+ export declare function useInstanceEnvironment(apiBase?: string): EnvironmentInfo | null;
12273
+
12090
12274
  /** Mount once in an app shell (inside the QueryClientProvider). */
12091
12275
  export declare function useIntentPrefetch(opts: IntentPrefetchOptions & {
12092
12276
  enabled?: boolean;
@@ -12206,6 +12390,15 @@ export declare function useMyScopes(): {
12206
12390
  ready: boolean;
12207
12391
  };
12208
12392
 
12393
+ /**
12394
+ * The person's favorite collections when the host has no sidebar favorites of its own:
12395
+ * the same server store the admin sidebar uses (GET /users/me preferences, PATCH
12396
+ * /users/me/preferences {nav_favorites, nav_favorite_groups}), so a star here shows in the
12397
+ * admin's sidebar too and follows the person between apps and machines. Saves go out one
12398
+ * at a time; the star flips at once and falls back if the save fails.
12399
+ */
12400
+ export declare function useNavFavoriteCollections(enabled?: boolean): CollectionFavorites;
12401
+
12209
12402
  export declare function useNavigation(): NavigationContextValue;
12210
12403
 
12211
12404
  /** The tab's trail, re-rendering on every change. */