@nivaro/react 0.3.107 → 0.3.109
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/full.css +1 -1
- package/dist/hooks/useSessionRecorder.js +1 -1
- package/dist/index.d.ts +149 -0
- package/dist/index.js +742 -738
- package/dist/layout-editor.d.ts +4 -0
- package/dist/shared/components/CollectionBrowserView.js +410 -416
- package/dist/shared/components/ItemEditForm.js +2413 -2384
- package/dist/shared/components/collections-directory/CollectionHoverCard.js +177 -0
- package/dist/shared/components/collections-directory/CollectionRow.js +359 -0
- package/dist/shared/components/collections-directory/CollectionRowMenu.js +213 -0
- package/dist/shared/components/collections-directory/CollectionsDirectory.js +543 -0
- package/dist/shared/components/collections-directory/CollectionsToolbar.js +287 -0
- package/dist/shared/components/collections-directory/PinnedSection.js +97 -0
- package/dist/shared/components/collections-directory/directory-data.js +159 -0
- package/dist/shared/components/collections-directory/page-model.js +122 -0
- package/dist/shared/components/collections-directory/sections.js +108 -0
- package/dist/shared/components/collections-directory/shared-pins.js +70 -0
- package/dist/shared/components/imports/CollectionImportPanel.js +631 -595
- package/dist/shared/components/imports/import-picker-options.js +44 -0
- package/dist/shared/components/item-edit/InlineTableField.js +441 -438
- package/dist/shared/components/item-edit/NestedRelationEditor.js +36 -36
- package/dist/shared/components/item-edit/RelationCombobox.js +1 -1
- package/dist/shared/components/item-edit/StepsBar.js +24 -23
- package/dist/shared/components/item-edit/form-density.js +1 -0
- package/dist/shared/components/item-edit/section-rows.js +39 -0
- package/dist/shared/components/layout-editor/inspector/GroupInspector.js +88 -66
- package/dist/shared/components/layout-editor/parity-keys.json.js +1 -1
- package/dist/shared/lib/activity-sentence.js +4 -4
- package/dist/shared/lib/layout-ops.js +24 -22
- package/dist/shared/lib/template-paths.js +17 -0
- 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.
|
|
13
|
+
const ze = "nivaro-react@0.3.109", 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
|
|
|
@@ -3528,6 +3638,17 @@ export declare function ExternalRequestsChip({ collection, itemId }: {
|
|
|
3528
3638
|
/** Field paths an expression reads, without evaluating it. */
|
|
3529
3639
|
export declare function extractExpressionTokens(src: string): string[];
|
|
3530
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
|
+
|
|
3531
3652
|
/** Extract the slot key from an assignment field name, or null. */
|
|
3532
3653
|
export declare function extSlotKey(field: string): string | null;
|
|
3533
3654
|
|
|
@@ -3623,6 +3744,9 @@ declare interface FieldGroup {
|
|
|
3623
3744
|
summary_hide_empty?: boolean | number;
|
|
3624
3745
|
swap_config?: string | null;
|
|
3625
3746
|
skip_if_filled?: string[] | string | null;
|
|
3747
|
+
/** Record-form width of a top-level section (migration 526): 'half' pairs it with the
|
|
3748
|
+
* next half section on a wide form; anything else = full. Never read_width (read view). */
|
|
3749
|
+
form_width?: string | null;
|
|
3626
3750
|
}
|
|
3627
3751
|
|
|
3628
3752
|
export declare interface FieldInterfaceHandle {
|
|
@@ -3805,6 +3929,13 @@ export declare function focusRecordTarget(target: {
|
|
|
3805
3929
|
rowId?: string;
|
|
3806
3930
|
}): void;
|
|
3807
3931
|
|
|
3932
|
+
declare interface FolderOption {
|
|
3933
|
+
/** The folder's key (a `group` value). */
|
|
3934
|
+
key: string;
|
|
3935
|
+
label: string;
|
|
3936
|
+
color: string | null;
|
|
3937
|
+
}
|
|
3938
|
+
|
|
3808
3939
|
/** Case- and accent-folded text. */
|
|
3809
3940
|
export declare function foldSearchText(text: string): string;
|
|
3810
3941
|
|
|
@@ -10212,6 +10343,15 @@ declare interface RowMatchPanelConfig {
|
|
|
10212
10343
|
};
|
|
10213
10344
|
}
|
|
10214
10345
|
|
|
10346
|
+
/** One extra item in a row's ⋯ menu (host-supplied, e.g. the admin's Data model pages). */
|
|
10347
|
+
declare interface RowMenuLink {
|
|
10348
|
+
key: string;
|
|
10349
|
+
label: string;
|
|
10350
|
+
icon?: ReactNode;
|
|
10351
|
+
/** In-app path, opened through the host's navigation. */
|
|
10352
|
+
path: string;
|
|
10353
|
+
}
|
|
10354
|
+
|
|
10215
10355
|
/**
|
|
10216
10356
|
* "Who has this row open" on a list row (#2486): up to three 16px avatar discs, overlapping,
|
|
10217
10357
|
* then "+N" when more people are there; the names in the instant tooltip. People the viewer
|
|
@@ -12253,6 +12393,15 @@ export declare function useMyScopes(): {
|
|
|
12253
12393
|
ready: boolean;
|
|
12254
12394
|
};
|
|
12255
12395
|
|
|
12396
|
+
/**
|
|
12397
|
+
* The person's favorite collections when the host has no sidebar favorites of its own:
|
|
12398
|
+
* the same server store the admin sidebar uses (GET /users/me preferences, PATCH
|
|
12399
|
+
* /users/me/preferences {nav_favorites, nav_favorite_groups}), so a star here shows in the
|
|
12400
|
+
* admin's sidebar too and follows the person between apps and machines. Saves go out one
|
|
12401
|
+
* at a time; the star flips at once and falls back if the save fails.
|
|
12402
|
+
*/
|
|
12403
|
+
export declare function useNavFavoriteCollections(enabled?: boolean): CollectionFavorites;
|
|
12404
|
+
|
|
12256
12405
|
export declare function useNavigation(): NavigationContextValue;
|
|
12257
12406
|
|
|
12258
12407
|
/** The tab's trail, re-rendering on every change. */
|