@proveanything/smartlinks-utils-ui 0.4.2 → 0.6.0
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/{chunk-76Y4UTYQ.js → chunk-WB775Z2I.js} +66 -60
- package/dist/chunk-WB775Z2I.js.map +1 -0
- package/dist/components/RecordsAdmin/index.d.ts +133 -86
- package/dist/components/RecordsAdmin/index.js +266 -226
- package/dist/components/RecordsAdmin/index.js.map +1 -1
- package/dist/records-JWS6LKJ2.js +3 -0
- package/dist/{records-AUJWCB7Q.js.map → records-JWS6LKJ2.js.map} +1 -1
- package/package.json +6 -6
- package/dist/chunk-76Y4UTYQ.js.map +0 -1
- package/dist/records-AUJWCB7Q.js +0 -3
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import { ReactNode, ComponentType } from 'react';
|
|
3
|
-
import { FacetRule, MatchedAt,
|
|
3
|
+
import { FacetRule, MatchedAt, RecordTarget, AppRecord, MatchResult, ResolveAllEntry } from '@proveanything/smartlinks/dist/types/appObjects';
|
|
4
4
|
import { LucideIcon } from 'lucide-react';
|
|
5
5
|
import * as _tanstack_query_core from '@tanstack/query-core';
|
|
6
6
|
import * as _proveanything_smartlinks from '@proveanything/smartlinks';
|
|
@@ -25,7 +25,11 @@ type ScopeKind = 'collection' | 'product' | 'facet' | 'variant' | 'batch' | 'rul
|
|
|
25
25
|
interface ParsedRef {
|
|
26
26
|
/** Most-specific scope this ref points at. */
|
|
27
27
|
kind: ScopeKind | 'collection';
|
|
28
|
-
/**
|
|
28
|
+
/**
|
|
29
|
+
* Raw ref string, derived from anchors via `buildRef` for display /
|
|
30
|
+
* breadcrumb / URL purposes. Never used as a record-identity key
|
|
31
|
+
* internally — every record is addressed by its UUID `id`.
|
|
32
|
+
*/
|
|
29
33
|
raw: string;
|
|
30
34
|
collectionId?: string;
|
|
31
35
|
productId?: string;
|
|
@@ -34,19 +38,6 @@ interface ParsedRef {
|
|
|
34
38
|
variantId?: string;
|
|
35
39
|
batchId?: string;
|
|
36
40
|
proofId?: string;
|
|
37
|
-
/**
|
|
38
|
-
* Opaque id of a rule-targeted record (ref starts with `rule:`). Set when
|
|
39
|
-
* `kind === 'rule'`. The actual rule lives on the record's `facetRule`
|
|
40
|
-
* field — this is just the addressing handle used by the URL/refs layer.
|
|
41
|
-
*/
|
|
42
|
-
ruleId?: string;
|
|
43
|
-
/**
|
|
44
|
-
* For `collection` cardinality records: the per-item identifier within the
|
|
45
|
-
* scope. Singleton records leave this undefined. The full ref is
|
|
46
|
-
* `{scopeRef}/item:{itemId}`, or just `item:{itemId}` for collection-rooted
|
|
47
|
-
* items.
|
|
48
|
-
*/
|
|
49
|
-
itemId?: string;
|
|
50
41
|
}
|
|
51
42
|
|
|
52
43
|
type RecordSource = 'self' | 'inherited' | 'empty';
|
|
@@ -76,16 +67,17 @@ interface RecordSummary<TData = unknown> {
|
|
|
76
67
|
/** Optional small badges (e.g. "Draft", "12 items"). */
|
|
77
68
|
badges?: RecordBadge[];
|
|
78
69
|
/**
|
|
79
|
-
* For `collection` cardinality record types: the per-item identifier
|
|
80
|
-
*
|
|
81
|
-
*
|
|
70
|
+
* For `collection` cardinality record types: the per-item identifier.
|
|
71
|
+
* This is the record's UUID `id` (same value as `RecordSummary.id`),
|
|
72
|
+
* surfaced on a separate field so item renderers can stay type-clean.
|
|
73
|
+
* Singleton records leave this undefined.
|
|
82
74
|
*/
|
|
83
75
|
itemId?: string;
|
|
84
76
|
/**
|
|
85
|
-
* For rule-targeted records (
|
|
86
|
-
* the server uses to match this
|
|
87
|
-
* `null` for non-rule records. The
|
|
88
|
-
* rule summary as the row subtitle.
|
|
77
|
+
* For rule-targeted records (`facetRule != null` on the underlying
|
|
78
|
+
* `AppRecord`). The AND-of-OR clauses the server uses to match this
|
|
79
|
+
* record against a product's facets. `null` for non-rule records. The
|
|
80
|
+
* browser uses this to render a friendly rule summary as the row subtitle.
|
|
89
81
|
*/
|
|
90
82
|
facetRule?: FacetRule | null;
|
|
91
83
|
}
|
|
@@ -94,6 +86,12 @@ interface ResolvedRecord<TData = unknown> {
|
|
|
94
86
|
source: RecordSource;
|
|
95
87
|
/** Where the resolved value came from (own scope or parent ref). */
|
|
96
88
|
sourceRef?: string;
|
|
89
|
+
/**
|
|
90
|
+
* UUID of the resolved record (when `source === 'self'` or `'inherited'`).
|
|
91
|
+
* This is the SDK's stable identity; prefer it over `sourceRef` for any
|
|
92
|
+
* subsequent `update`/`remove` call. Absent when `source === 'empty'`.
|
|
93
|
+
*/
|
|
94
|
+
recordId?: string;
|
|
97
95
|
/** The parent value that would be inherited if this scope cleared its override. */
|
|
98
96
|
parentValue?: TData | null;
|
|
99
97
|
/**
|
|
@@ -108,7 +106,8 @@ interface ResolvedRecord<TData = unknown> {
|
|
|
108
106
|
* The `facetRule` attached to the winning record itself, if any. Distinct
|
|
109
107
|
* from `matchedRule` (which is set when the resolver classified the match
|
|
110
108
|
* as rule-based). For rule-targeted records (`source: 'self'` on a
|
|
111
|
-
* `
|
|
109
|
+
* record with `facetRule != null`) this is the rule the editor authors
|
|
110
|
+
* against.
|
|
112
111
|
*/
|
|
113
112
|
facetRule?: FacetRule | null;
|
|
114
113
|
}
|
|
@@ -399,8 +398,8 @@ type DeepLinkHistoryMode = 'push' | 'replace' | 'smart';
|
|
|
399
398
|
* a host already uses one of these keys for something else.
|
|
400
399
|
*/
|
|
401
400
|
interface DeepLinkParamNames {
|
|
402
|
-
/** Default `'
|
|
403
|
-
|
|
401
|
+
/** Default `'recordId'`. */
|
|
402
|
+
recordId?: string;
|
|
404
403
|
/** Default `'scope'`. */
|
|
405
404
|
scope?: string;
|
|
406
405
|
/** Default `'view'`. */
|
|
@@ -411,9 +410,9 @@ interface DeepLinkParamNames {
|
|
|
411
410
|
* `undefined` means "absent from the URL".
|
|
412
411
|
*/
|
|
413
412
|
interface DeepLinkState {
|
|
414
|
-
/**
|
|
415
|
-
|
|
416
|
-
/**
|
|
413
|
+
/** UUID of the record open in the editor (SDK-assigned). */
|
|
414
|
+
recordId?: string | null;
|
|
415
|
+
/** Anchor scope ref when no record is open and the user is browsing a list. */
|
|
417
416
|
scope?: string | null;
|
|
418
417
|
/** Right-pane view choice (`table` / `cards` / `gallery`). */
|
|
419
418
|
view?: string | null;
|
|
@@ -460,7 +459,7 @@ interface DeepLinkOptions {
|
|
|
460
459
|
* to avoid the optional-key ceremony.
|
|
461
460
|
*/
|
|
462
461
|
interface ResolvedDeepLinkParamNames {
|
|
463
|
-
|
|
462
|
+
recordId: string;
|
|
464
463
|
scope: string;
|
|
465
464
|
view: string;
|
|
466
465
|
}
|
|
@@ -911,7 +910,8 @@ interface RecordBrowserProps {
|
|
|
911
910
|
scopes: ScopeKind[];
|
|
912
911
|
activeScope: ScopeKind;
|
|
913
912
|
onActiveScopeChange: (s: ScopeKind) => void;
|
|
914
|
-
|
|
913
|
+
/** UUID of the highlighted row (matches `RecordSummary.id`). */
|
|
914
|
+
selectedId?: string;
|
|
915
915
|
onSelectRef: (item: RecordSummary) => void;
|
|
916
916
|
items: RecordSummary[];
|
|
917
917
|
counts: {
|
|
@@ -932,7 +932,7 @@ interface RecordBrowserProps {
|
|
|
932
932
|
scopesLoading?: boolean;
|
|
933
933
|
i18n: RecordsAdminI18n;
|
|
934
934
|
}
|
|
935
|
-
declare const RecordBrowser: ({ scopes, activeScope, onActiveScopeChange,
|
|
935
|
+
declare const RecordBrowser: ({ scopes, activeScope, onActiveScopeChange, selectedId, onSelectRef, items, counts, isLoading, error, filter, onFilterChange, search, onSearchChange, hasNextPage, isFetchingNextPage, onLoadMore, scopesLoading, i18n, }: RecordBrowserProps) => react_jsx_runtime.JSX.Element;
|
|
936
936
|
|
|
937
937
|
interface Props$g {
|
|
938
938
|
scopes: ScopeKind[];
|
|
@@ -988,10 +988,24 @@ declare const StatusFilterPills: ({ value, onChange, counts, i18n, hideZero }: P
|
|
|
988
988
|
|
|
989
989
|
interface Props$c {
|
|
990
990
|
items: RecordSummary[];
|
|
991
|
-
|
|
991
|
+
/**
|
|
992
|
+
* UUID of the currently-selected row. Matches `RecordSummary.id`. Records
|
|
993
|
+
* without an `id` (synthesised product/facet rows that don't yet have a
|
|
994
|
+
* server-side record) can never be the selection target — those tabs key
|
|
995
|
+
* highlighting off product/facet anchors via `selectedAnchorKey` instead.
|
|
996
|
+
*/
|
|
997
|
+
selectedId?: string;
|
|
998
|
+
/**
|
|
999
|
+
* Anchor-based highlight fallback for tabs whose rail rows are not backed
|
|
1000
|
+
* by AppRecords (Products, Facets). Compared against `RecordSummary.ref`
|
|
1001
|
+
* which for those tabs is a synthesised display-only anchor string.
|
|
1002
|
+
*/
|
|
1003
|
+
selectedAnchorKey?: string;
|
|
992
1004
|
onSelect: (item: RecordSummary) => void;
|
|
993
|
-
/**
|
|
994
|
-
|
|
1005
|
+
/** UUID of the row currently being edited with unsaved changes. */
|
|
1006
|
+
dirtyId?: string;
|
|
1007
|
+
/** Anchor-key equivalent of `dirtyId` for non-record-backed tabs. */
|
|
1008
|
+
dirtyAnchorKey?: string;
|
|
995
1009
|
/** Rail row density. Defaults to `list`. */
|
|
996
1010
|
presentation?: RecordPresentation;
|
|
997
1011
|
/** Optional custom row renderer (still dense — applied to both densities). */
|
|
@@ -1015,11 +1029,11 @@ interface Props$c {
|
|
|
1015
1029
|
clipboardSourceLabel?: string;
|
|
1016
1030
|
} | null;
|
|
1017
1031
|
}
|
|
1018
|
-
declare const RecordList: ({ items,
|
|
1019
|
-
declare const ProductList: ({ items,
|
|
1020
|
-
declare const FacetList: ({ items,
|
|
1021
|
-
declare const VariantList: ({ items,
|
|
1022
|
-
declare const BatchList: ({ items,
|
|
1032
|
+
declare const RecordList: ({ items, selectedId, selectedAnchorKey, onSelect, dirtyId, dirtyAnchorKey, presentation, renderListRow, groupBy, rowClipboard, }: Props$c) => react_jsx_runtime.JSX.Element;
|
|
1033
|
+
declare const ProductList: ({ items, selectedId, selectedAnchorKey, onSelect, dirtyId, dirtyAnchorKey, presentation, renderListRow, groupBy, rowClipboard, }: Props$c) => react_jsx_runtime.JSX.Element;
|
|
1034
|
+
declare const FacetList: ({ items, selectedId, selectedAnchorKey, onSelect, dirtyId, dirtyAnchorKey, presentation, renderListRow, groupBy, rowClipboard, }: Props$c) => react_jsx_runtime.JSX.Element;
|
|
1035
|
+
declare const VariantList: ({ items, selectedId, selectedAnchorKey, onSelect, dirtyId, dirtyAnchorKey, presentation, renderListRow, groupBy, rowClipboard, }: Props$c) => react_jsx_runtime.JSX.Element;
|
|
1036
|
+
declare const BatchList: ({ items, selectedId, selectedAnchorKey, onSelect, dirtyId, dirtyAnchorKey, presentation, renderListRow, groupBy, rowClipboard, }: Props$c) => react_jsx_runtime.JSX.Element;
|
|
1023
1037
|
|
|
1024
1038
|
interface DefaultRecordRowProps {
|
|
1025
1039
|
record: RecordSummary;
|
|
@@ -1285,6 +1299,27 @@ interface Props$6 {
|
|
|
1285
1299
|
}
|
|
1286
1300
|
declare const UtilityRow: ({ label, customLabel, introHidden, onShowIntro }: Props$6) => react_jsx_runtime.JSX.Element | null;
|
|
1287
1301
|
|
|
1302
|
+
/** Flat anchor shape — matches `UpsertRecordInput` / `BulkUpsertItem`. */
|
|
1303
|
+
interface RecordAnchors {
|
|
1304
|
+
productId?: string | null;
|
|
1305
|
+
variantId?: string | null;
|
|
1306
|
+
batchId?: string | null;
|
|
1307
|
+
proofId?: string | null;
|
|
1308
|
+
}
|
|
1309
|
+
/**
|
|
1310
|
+
* Project a `ParsedRef` to the flat anchor IDs the SDK writes. Facet
|
|
1311
|
+
* components on the ref are intentionally ignored — facet targeting now
|
|
1312
|
+
* lives on `facetRule` (rule records), not as a record anchor.
|
|
1313
|
+
*/
|
|
1314
|
+
declare const parsedRefToScope: (ref: ParsedRef) => RecordAnchors;
|
|
1315
|
+
declare const parsedRefToTarget: (ref: ParsedRef) => RecordTarget;
|
|
1316
|
+
/**
|
|
1317
|
+
* True when two anchor sets refer to the same node. Used to decide
|
|
1318
|
+
* "self" vs "inherited" when consuming `match()` results: compare the
|
|
1319
|
+
* winning record's flat anchor IDs against the editing scope.
|
|
1320
|
+
*/
|
|
1321
|
+
declare const scopesEqual: (a: RecordAnchors, b: RecordAnchors) => boolean;
|
|
1322
|
+
|
|
1288
1323
|
interface RecordsCtx {
|
|
1289
1324
|
SL: SmartLinksSDK;
|
|
1290
1325
|
collectionId: string;
|
|
@@ -1294,15 +1329,23 @@ interface RecordsCtx {
|
|
|
1294
1329
|
* and needs to query/scope by type. */
|
|
1295
1330
|
recordType?: string;
|
|
1296
1331
|
}
|
|
1297
|
-
/**
|
|
1332
|
+
/**
|
|
1333
|
+
* Shape of a single record write. SDK 1.10.2 takes flat anchor IDs
|
|
1334
|
+
* directly on the upsert payload (`productId`, `variantId`, `batchId`,
|
|
1335
|
+
* `proofId`); the legacy nested `scope` object is gone. Set `facetRule`
|
|
1336
|
+
* for rule records — mutually exclusive with anchor IDs.
|
|
1337
|
+
*/
|
|
1298
1338
|
interface RecordWrite<T = unknown> {
|
|
1299
|
-
/**
|
|
1339
|
+
/**
|
|
1340
|
+
* Optional caller-supplied external ref (e.g. a SKU or user-typed key).
|
|
1341
|
+
* When omitted the server addresses the record by anchors / facetRule
|
|
1342
|
+
* alone — we no longer synthesise one from anchor IDs client-side.
|
|
1343
|
+
*/
|
|
1300
1344
|
ref?: string;
|
|
1301
|
-
/**
|
|
1302
|
-
scope:
|
|
1345
|
+
/** Flat anchor IDs. Drives specificity and `match()` server-side. */
|
|
1346
|
+
scope: RecordAnchors;
|
|
1303
1347
|
data: T;
|
|
1304
1348
|
visibility?: 'public' | 'owner' | 'admin';
|
|
1305
|
-
productId?: string;
|
|
1306
1349
|
status?: string;
|
|
1307
1350
|
startsAt?: string | null;
|
|
1308
1351
|
expiresAt?: string | null;
|
|
@@ -1310,7 +1353,7 @@ interface RecordWrite<T = unknown> {
|
|
|
1310
1353
|
sourceSystem?: string;
|
|
1311
1354
|
/**
|
|
1312
1355
|
* Optional facet rule. When set, the record is targeted via this rule and
|
|
1313
|
-
*
|
|
1356
|
+
* anchor IDs must be empty (SDK enforces mutual exclusion). Used by
|
|
1314
1357
|
* the rule editor / Targeting section.
|
|
1315
1358
|
*/
|
|
1316
1359
|
facetRule?: FacetRule | null;
|
|
@@ -1327,17 +1370,26 @@ declare const listRecords: (ctx: RecordsCtx, params?: {
|
|
|
1327
1370
|
total: number;
|
|
1328
1371
|
hasMore: boolean;
|
|
1329
1372
|
}>;
|
|
1330
|
-
/** Look up a single record by its canonical ref. */
|
|
1331
|
-
declare const getRecordByRef: (ctx: RecordsCtx, ref: string) => Promise<AppRecord | null>;
|
|
1332
1373
|
/**
|
|
1333
|
-
*
|
|
1334
|
-
*
|
|
1374
|
+
* Look up a single record by its UUID id. The id-primary read path used by
|
|
1375
|
+
* deep-link restore (`?recordId=`).
|
|
1376
|
+
*/
|
|
1377
|
+
declare const getRecordById: (ctx: RecordsCtx, recordId: string) => Promise<AppRecord | null>;
|
|
1378
|
+
/**
|
|
1379
|
+
* Create-or-update by (anchors + recordType) — used when we don't yet know
|
|
1380
|
+
* the record's UUID id. The server addresses the row by anchors (or the
|
|
1381
|
+
* supplied `ref`/`facetRule`) and returns the row with its stable `id`.
|
|
1382
|
+
*
|
|
1383
|
+
* Prefer `updateRecord(ctx, id, …)` whenever an id is already in hand:
|
|
1384
|
+
* it's an unambiguous PATCH against a known row and never accidentally
|
|
1385
|
+
* resurrects a sibling at the same anchor.
|
|
1335
1386
|
*/
|
|
1336
1387
|
declare const upsertRecord: <T>(ctx: RecordsCtx, write: RecordWrite<T>) => Promise<{
|
|
1337
1388
|
record: AppRecord;
|
|
1338
1389
|
isCreate: boolean;
|
|
1339
1390
|
}>;
|
|
1340
|
-
|
|
1391
|
+
/** Delete a record by its UUID id. The id-primary delete path. */
|
|
1392
|
+
declare const removeRecord: (ctx: RecordsCtx, recordId: string) => Promise<void>;
|
|
1341
1393
|
/** Restore a soft-deleted record by ID (admin only). */
|
|
1342
1394
|
declare const restoreRecord: (ctx: RecordsCtx, recordId: string) => Promise<AppRecord>;
|
|
1343
1395
|
/**
|
|
@@ -1358,7 +1410,7 @@ declare const matchRecords: (ctx: RecordsCtx, target: RecordTarget, opts?: {
|
|
|
1358
1410
|
*/
|
|
1359
1411
|
declare const bulkUpsert: <T>(ctx: RecordsCtx, entries: Array<{
|
|
1360
1412
|
ref?: string;
|
|
1361
|
-
scope:
|
|
1413
|
+
scope: RecordAnchors;
|
|
1362
1414
|
data: T;
|
|
1363
1415
|
status?: string;
|
|
1364
1416
|
}>) => Promise<{
|
|
@@ -1372,7 +1424,7 @@ declare const bulkUpsert: <T>(ctx: RecordsCtx, entries: Array<{
|
|
|
1372
1424
|
declare const bulkDelete: (ctx: RecordsCtx, input: {
|
|
1373
1425
|
refs: string[];
|
|
1374
1426
|
} | {
|
|
1375
|
-
scope:
|
|
1427
|
+
scope: RecordAnchors;
|
|
1376
1428
|
}) => Promise<{
|
|
1377
1429
|
removed: number;
|
|
1378
1430
|
}>;
|
|
@@ -1459,12 +1511,12 @@ interface UseResolvedRecordArgs {
|
|
|
1459
1511
|
facetValue?: string;
|
|
1460
1512
|
proofId?: string;
|
|
1461
1513
|
/**
|
|
1462
|
-
*
|
|
1463
|
-
*
|
|
1464
|
-
*
|
|
1465
|
-
*
|
|
1514
|
+
* Direct UUID lookup. When set, the resolver bypasses the inheritance
|
|
1515
|
+
* chain and loads this record by id (used by `?recordId=` deep-links and
|
|
1516
|
+
* by rule-record edits — both cases where the row's identity is already
|
|
1517
|
+
* known and the resolver shouldn't run a `match()`).
|
|
1466
1518
|
*/
|
|
1467
|
-
|
|
1519
|
+
recordId?: string;
|
|
1468
1520
|
supportedScopes?: ScopeKind[];
|
|
1469
1521
|
enabled?: boolean;
|
|
1470
1522
|
withParent?: boolean;
|
|
@@ -1475,6 +1527,7 @@ declare function useResolvedRecord<T = unknown>(args: UseResolvedRecordArgs): {
|
|
|
1475
1527
|
data: T | null;
|
|
1476
1528
|
source: RecordSource;
|
|
1477
1529
|
sourceRef?: string;
|
|
1530
|
+
recordId?: string;
|
|
1478
1531
|
parentValue?: T | null | undefined;
|
|
1479
1532
|
matchedAt?: _proveanything_smartlinks.MatchedAt;
|
|
1480
1533
|
matchedRule?: _proveanything_smartlinks.FacetRule;
|
|
@@ -1485,8 +1538,8 @@ interface UseCollectionItemsArgs {
|
|
|
1485
1538
|
ctx: RecordsCtx;
|
|
1486
1539
|
/**
|
|
1487
1540
|
* Scope the items live under. Items at the collection root pass an empty
|
|
1488
|
-
* `scope.raw` (
|
|
1489
|
-
*
|
|
1541
|
+
* `scope.raw` (we then keep records with no anchors). Pass `null` to keep
|
|
1542
|
+
* the query disabled.
|
|
1490
1543
|
*/
|
|
1491
1544
|
scope: ParsedRef | null;
|
|
1492
1545
|
/** Per-page size requested from the SDK (default 100). */
|
|
@@ -1525,7 +1578,7 @@ declare function useCollectionItems<T = unknown>(args: UseCollectionItemsArgs):
|
|
|
1525
1578
|
* incremental" (replace) under `'smart'` history mode. The shell tags each
|
|
1526
1579
|
* emit with one of these.
|
|
1527
1580
|
*/
|
|
1528
|
-
type DeepLinkChangeKind = '
|
|
1581
|
+
type DeepLinkChangeKind = 'record.open' | 'record.close' | 'record.step' | 'scope' | 'view';
|
|
1529
1582
|
interface UseDeepLinkStateResult {
|
|
1530
1583
|
/** Latest snapshot read from the adapter. */
|
|
1531
1584
|
urlState: DeepLinkState;
|
|
@@ -1579,8 +1632,12 @@ interface UseResolveAllRecordsArgs {
|
|
|
1579
1632
|
staleTime?: number;
|
|
1580
1633
|
}
|
|
1581
1634
|
interface UseResolveAllResult {
|
|
1582
|
-
/**
|
|
1583
|
-
|
|
1635
|
+
/**
|
|
1636
|
+
* All matching records, sorted most-specific first. Each appears once.
|
|
1637
|
+
* SDK 1.10.2: `ResolveAllEntry` wraps `{ record: AppRecord, matchedAt,
|
|
1638
|
+
* specificity, matchedRule? }`.
|
|
1639
|
+
*/
|
|
1640
|
+
records: ResolveAllEntry[];
|
|
1584
1641
|
/** True when the result hit the `limit` safety cap. */
|
|
1585
1642
|
truncated: boolean;
|
|
1586
1643
|
isLoading: boolean;
|
|
@@ -1941,8 +1998,19 @@ declare function SiblingRail<T>({ items, selectedItemId, isLoading, error, onBac
|
|
|
1941
1998
|
|
|
1942
1999
|
interface ClipboardEntry<T = unknown> {
|
|
1943
2000
|
value: T;
|
|
1944
|
-
|
|
1945
|
-
|
|
2001
|
+
/**
|
|
2002
|
+
* The full parsed scope the value was copied from. Carries scope kind +
|
|
2003
|
+
* anchors so paste-compat can compare structurally without re-parsing a
|
|
2004
|
+
* string. The `raw` field is purely for friendly display (toasts).
|
|
2005
|
+
*/
|
|
2006
|
+
sourceScope: ParsedRef;
|
|
2007
|
+
/**
|
|
2008
|
+
* UUID of the source record, when the copy originated from a saved
|
|
2009
|
+
* AppRecord (records-driven rails, in-editor copy of a saved record).
|
|
2010
|
+
* Absent when copying from a synthesised anchor row (Products tab) or
|
|
2011
|
+
* a never-saved draft. Used for self-paste detection.
|
|
2012
|
+
*/
|
|
2013
|
+
sourceRecordId?: string;
|
|
1946
2014
|
/** Friendly label captured at copy time so paste targets can show
|
|
1947
2015
|
* "Paste from {sourceLabel}" without re-fetching the source. */
|
|
1948
2016
|
sourceLabel?: string;
|
|
@@ -2008,7 +2076,6 @@ interface BuildRefArgs {
|
|
|
2008
2076
|
variantId?: string;
|
|
2009
2077
|
batchId?: string;
|
|
2010
2078
|
proofId?: string;
|
|
2011
|
-
itemId?: string;
|
|
2012
2079
|
}
|
|
2013
2080
|
declare const buildRef: (a: BuildRefArgs) => string;
|
|
2014
2081
|
/**
|
|
@@ -2016,17 +2083,6 @@ declare const buildRef: (a: BuildRefArgs) => string;
|
|
|
2016
2083
|
* `supportedScopes` prunes scopes the app doesn't care about.
|
|
2017
2084
|
*/
|
|
2018
2085
|
declare const resolutionChain: (target: ParsedRef, supportedScopes: ScopeKind[]) => string[];
|
|
2019
|
-
/**
|
|
2020
|
-
* Strip the trailing `/item:{id}` (or leading `item:{id}`) from a ref and
|
|
2021
|
-
* return both halves. For singleton refs `itemId` is `undefined` and
|
|
2022
|
-
* `scopeRef` equals the input.
|
|
2023
|
-
*/
|
|
2024
|
-
declare const splitItemRef: (raw: string) => {
|
|
2025
|
-
scopeRef: string;
|
|
2026
|
-
itemId?: string;
|
|
2027
|
-
};
|
|
2028
|
-
/** Concatenate a scope ref (possibly empty for collection) and an itemId. */
|
|
2029
|
-
declare const buildItemRef: (scopeRef: string, itemId: string) => string;
|
|
2030
2086
|
|
|
2031
2087
|
interface ResolveArgs {
|
|
2032
2088
|
ctx: RecordsCtx;
|
|
@@ -2042,15 +2098,6 @@ interface ResolveArgs {
|
|
|
2042
2098
|
}
|
|
2043
2099
|
declare const resolveRecord: <T>(args: ResolveArgs) => Promise<ResolvedRecord<T>>;
|
|
2044
2100
|
|
|
2045
|
-
declare const parsedRefToScope: (ref: ParsedRef) => RecordScope;
|
|
2046
|
-
declare const parsedRefToTarget: (ref: ParsedRef) => RecordTarget;
|
|
2047
|
-
/**
|
|
2048
|
-
* Compare a winning record's scope against the editing scope.
|
|
2049
|
-
* Returns true when they refer to the same node — used to decide
|
|
2050
|
-
* "self" vs "inherited" when consuming `match()` results.
|
|
2051
|
-
*/
|
|
2052
|
-
declare const scopesEqual: (a: RecordScope, b: RecordScope) => boolean;
|
|
2053
|
-
|
|
2054
2101
|
interface ImportReport {
|
|
2055
2102
|
total: number;
|
|
2056
2103
|
saved: number;
|
|
@@ -2066,4 +2113,4 @@ declare const exportCsv: <T>(records: RecordSummary<T>[], schema: CsvSchema<T>)
|
|
|
2066
2113
|
declare const importCsv: <T>(file: File, schema: CsvSchema<T>, ctx: RecordsCtx) => Promise<ImportReport>;
|
|
2067
2114
|
declare const downloadBlob: (blob: Blob, filename: string) => void;
|
|
2068
2115
|
|
|
2069
|
-
export { ALL_ITEM_VIEWS, ALL_PRESENTATIONS, BatchList, BulkActionsMenu, type ClipboardEntry, type CollectedRecord, type CollectedSort, type CollectionRailMode, type CsvSchema, type CsvSchemaColumn, DEFAULT_DEEP_LINK_PARAM_NAMES, DEFAULT_I18N, DEFAULT_ICONS, type DeepLinkAdapter, type DeepLinkChangeKind, type DeepLinkHistoryMode, type DeepLinkOptions, type DeepLinkParamNames, type DeepLinkState, DefaultItemCards, DefaultItemTable, DefaultRecordCard, DefaultRecordRow, DeleteButton, type DirtyStrategy, DrawerPreview, type EditorContext, EditorItemNav, EmptyState, ErrorState, FacetList, InheritanceMarker, InheritanceProvider, InlinePreview, IntroCard, type ItemColumn, ItemListView, type ItemSlotContext, type ItemView, type ItemViewContext, ItemViewSwitcher, LoadingState, type MergeStrategy, type MergedRecord, type NavConfirmI18n, type ParsedRef, type PasteCompatibility, type PasteCompatibilityResult, PresentationSwitcher, type PreviewMode, PreviewScopePicker, PreviewToggleButton, type ProductBrowseItem, type ProductChildItem, ProductDrillDown, ProductList, type RecordBadge, RecordBrowser, type RecordCardinality, RecordEditor, RecordList, type RecordPresentation, type RecordSlotContext, type RecordSource, type RecordStatus, type RecordSummary, type RecordsAdminI18n, type RecordsAdminIcons, RecordsAdminShell, type RecordsAdminShellProps, type ResolvedDeepLinkParamNames, ResolvedPreview, type ResolvedRecord, ScopeBreadcrumb, type ScopeKind, ScopeTabs, SiblingRail, SidePreview, type SmartLinksSDK, StatusDot, StatusFilterPills, StatusIcon, type StatusTone, TabbedPreview, type TelemetryEvent, type UseCollectionItemsArgs, type UseRecordClipboardArgs, type UseRecordClipboardReturn, type UseResolveAllRecordsArgs, type UseResolveAllResult, type UseRulePreviewArgs, type UseRulePreviewResult, UtilityRow, VariantList,
|
|
2116
|
+
export { ALL_ITEM_VIEWS, ALL_PRESENTATIONS, BatchList, BulkActionsMenu, type ClipboardEntry, type CollectedRecord, type CollectedSort, type CollectionRailMode, type CsvSchema, type CsvSchemaColumn, DEFAULT_DEEP_LINK_PARAM_NAMES, DEFAULT_I18N, DEFAULT_ICONS, type DeepLinkAdapter, type DeepLinkChangeKind, type DeepLinkHistoryMode, type DeepLinkOptions, type DeepLinkParamNames, type DeepLinkState, DefaultItemCards, DefaultItemTable, DefaultRecordCard, DefaultRecordRow, DeleteButton, type DirtyStrategy, DrawerPreview, type EditorContext, EditorItemNav, EmptyState, ErrorState, FacetList, InheritanceMarker, InheritanceProvider, InlinePreview, IntroCard, type ItemColumn, ItemListView, type ItemSlotContext, type ItemView, type ItemViewContext, ItemViewSwitcher, LoadingState, type MergeStrategy, type MergedRecord, type NavConfirmI18n, type ParsedRef, type PasteCompatibility, type PasteCompatibilityResult, PresentationSwitcher, type PreviewMode, PreviewScopePicker, PreviewToggleButton, type ProductBrowseItem, type ProductChildItem, ProductDrillDown, ProductList, type RecordBadge, RecordBrowser, type RecordCardinality, RecordEditor, RecordList, type RecordPresentation, type RecordSlotContext, type RecordSource, type RecordStatus, type RecordSummary, type RecordsAdminI18n, type RecordsAdminIcons, RecordsAdminShell, type RecordsAdminShellProps, type ResolvedDeepLinkParamNames, ResolvedPreview, type ResolvedRecord, ScopeBreadcrumb, type ScopeKind, ScopeTabs, SiblingRail, SidePreview, type SmartLinksSDK, StatusDot, StatusFilterPills, StatusIcon, type StatusTone, TabbedPreview, type TelemetryEvent, type UseCollectionItemsArgs, type UseRecordClipboardArgs, type UseRecordClipboardReturn, type UseResolveAllRecordsArgs, type UseResolveAllResult, type UseRulePreviewArgs, type UseRulePreviewResult, UtilityRow, VariantList, buildRef, bulkDelete, bulkUpsert, checkPasteCompatibility, cloneValue, createDefaultDeepLinkAdapter, downloadBlob, exportCsv, getRecordById, importCsv, listRecords, matchRecords, mergeIcons, parseRef, parsedRefToScope, parsedRefToTarget, pickHeaderIcon, removeRecord, resolutionChain, resolveRecord, restoreRecord, scopesEqual, statusToneLabel, upsertRecord, useCollectedRecords, useCollectionItems, useDeepLinkState, useDirtyNavigation, useFacetBrowse, useIntroDismissed, useItemViewPref, useMergedRecord, usePresentationPref, useProductBrowse, useProductChildren, useRecordClipboard, useRecordEditor, useRecordList, useResolveAllRecords, useResolvedRecord, useRulePreview, useScopeProbe, useUnsavedGuard };
|