@declarion/react 0.445.0 → 0.516.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.
Files changed (43) hide show
  1. package/dist-lib/components/agents/AgentChatPanel.impl.js +349 -332
  2. package/dist-lib/components/detail-layout/DetailAuditStrip.js +1 -1
  3. package/dist-lib/components/detail-layout/EvidenceBlock.js +36 -24
  4. package/dist-lib/components/detail-layout/FieldRow.js +56 -60
  5. package/dist-lib/components/detail-layout/FieldsBlock.js +48 -47
  6. package/dist-lib/components/detail-layout/PropertiesBlock.js +42 -41
  7. package/dist-lib/components/detail-layout/labelLayout.js +35 -0
  8. package/dist-lib/components/fields/JsonField.js +128 -125
  9. package/dist-lib/components/fields/StringField.js +10 -25
  10. package/dist-lib/components/fields/StructureField.js +125 -167
  11. package/dist-lib/components/fields/ValueRows.js +114 -0
  12. package/dist-lib/components/fields/cells/factories/id.js +10 -0
  13. package/dist-lib/components/fields/cells/factories/nextRun.js +18 -27
  14. package/dist-lib/components/fields/cells/factories/refLink.js +15 -41
  15. package/dist-lib/components/fields/cells/registry.js +25 -23
  16. package/dist-lib/components/file-widgets/DocumentCard.js +142 -142
  17. package/dist-lib/components/file-widgets/helpers.js +32 -19
  18. package/dist-lib/components/file-widgets/host.js +4 -1
  19. package/dist-lib/components/list/PeekFieldCell.js +57 -55
  20. package/dist-lib/components/list/QuickPeek.js +109 -121
  21. package/dist-lib/components/pages/SmartDetailPage.impl.js +403 -400
  22. package/dist-lib/components/pages/SmartListPage.impl.js +260 -260
  23. package/dist-lib/components/pages/list/ListCardRow.js +101 -100
  24. package/dist-lib/components/pages/list/cardProjection.js +117 -112
  25. package/dist-lib/components/pages/list/useListQuery.js +1 -1
  26. package/dist-lib/components/pages/list/useListRowInteraction.js +68 -65
  27. package/dist-lib/components/primitives/IdBadge.js +27 -0
  28. package/dist-lib/components/primitives/RowField.js +11 -43
  29. package/dist-lib/components/shared/CopyButton.js +13 -18
  30. package/dist-lib/components/shared/RefChip.js +33 -0
  31. package/dist-lib/declarion-react.css +1 -1
  32. package/dist-lib/hooks/useAgentConversation.js +134 -110
  33. package/dist-lib/hooks/useCopy.js +18 -0
  34. package/dist-lib/index.d.ts +55 -20
  35. package/dist-lib/index.js +116 -111
  36. package/dist-lib/lib/realtime-reconcile.js +70 -59
  37. package/dist-lib/lib/reference.js +52 -34
  38. package/dist-lib/lib/short-id.js +12 -0
  39. package/dist-lib/testing.d.ts +1 -1
  40. package/dist-lib/types/schema.js +84 -80
  41. package/dist-lib/{useResponsiveMode-3hOLBkey.d.ts → useResponsiveMode-BObVfNyN.d.ts} +7 -2
  42. package/package.json +1 -1
  43. package/dist-lib/components/primitives/RecordIdBadge.js +0 -25
package/dist-lib/index.js CHANGED
@@ -22,114 +22,119 @@ import { useAllEntityData as J } from "./hooks/useAllEntityData.js";
22
22
  import { objectQueryKey as Y, useObject as X } from "./hooks/useObject.js";
23
23
  import { fileReferenceJSONQueryKey as Z, useFileReferenceJSON as Q } from "./hooks/useFileReferenceJSON.js";
24
24
  import { StructureField as $ } from "./components/fields/StructureField.js";
25
- import { useLiveObject as ee } from "./hooks/useLiveObject.js";
26
- import { ACTION_DATA_CURSOR_KEY as te, ACTION_DATA_KEY as ne, actionDataQueryKey as re, cursorActionDataQueryKey as ie, useActionData as ae, useCursorActionData as oe } from "./hooks/useActionData.js";
27
- import { useCreateObject as se, useDeleteObject as ce, useUpdateObject as le } from "./hooks/useMutations.js";
28
- import { useDebounce as ue } from "./hooks/useDebounce.js";
29
- import { ResponsiveModeProvider as de, useResponsiveMode as fe } from "./hooks/useResponsiveMode.js";
30
- import { DEFAULT_RESPONSIVE_BREAKPOINTS as pe, resolveViewportCategory as me } from "./lib/viewport-category.js";
31
- import { useEffectiveParam as he, useParam as ge, usePublicParams as _e, useResolvedParam as ve } from "./hooks/useParams.js";
32
- import { useSetStatus as ye } from "./hooks/useObjectStatus.js";
33
- import { useDeleteProperty as be, useSetProperty as xe } from "./hooks/useProperties.js";
34
- import { useFilters as Se } from "./hooks/useFilters.js";
35
- import { useColumns as Ce } from "./hooks/useColumns.js";
36
- import { useViews as we } from "./hooks/useViews.js";
37
- import { registerScreen as Te } from "./stores/screen-registry.js";
38
- import { getIcon as Ee, setIconRegistry as De } from "./stores/icon-registry.js";
39
- import { getLayoutWidget as Oe, hasLayoutWidget as ke, registerLayoutWidget as Ae } from "./components/detail-layout/widgets/registry.js";
40
- import { reresolveLanguage as je, useDeploymentLanguage as Me, useLanguage as Ne } from "./hooks/useLanguage.js";
41
- import { useText as Pe } from "./hooks/useText.js";
42
- import { MANDATORY_LANGUAGE as Fe, makeTextFn as Ie, pickLocalized as Le, pluralText as Re, textWithNodes as ze } from "./lib/language.js";
43
- import { failureTitle as Be } from "./lib/failure.js";
44
- import { readDisplayState as Ve } from "./lib/read-display-state.js";
45
- import { useTabStore as He } from "./stores/tabs.js";
46
- import { useTabNavigate as Ue } from "./hooks/useTabNavigate.js";
47
- import { useScreenBack as We } from "./hooks/useScreenBack.js";
48
- import { usePageState as Ge } from "./hooks/usePageState.js";
49
- import { canonicalUrl as Ke } from "./lib/canonical-url.js";
50
- import { useRegisterRetainedQuery as qe } from "./hooks/usePageStateRuntime.js";
51
- import { PAGE_STATE_TTL_PARAM as Je, usePageStateTtl as Ye } from "./hooks/usePageStateTtl.js";
52
- import { useScreenTab as Xe } from "./hooks/useScreenTab.js";
53
- import { useTabSearchMirror as Ze } from "./hooks/useTabSearchMirror.js";
54
- import { SCROLL_STATE_KEY as Qe, usePlainScrollRestoration as $e, useSavedScrollOffset as et, useVirtualScrollRestoration as tt } from "./lib/scroll-restoration.js";
55
- import { SmartListPage as nt } from "./components/pages/SmartListPage.js";
56
- import { SmartDetailPage as rt } from "./components/pages/SmartDetailPage.js";
57
- import { SmartRecordListPage as it } from "./components/pages/SmartRecordListPage.js";
58
- import { DynamicIcon as at } from "./components/shared/DynamicIcon.js";
59
- import { PageHeader as ot } from "./components/chrome/PageHeader.js";
60
- import { EmptyState as st } from "./components/shared/EmptyState.js";
61
- import { ConfirmDialog as ct } from "./components/shared/ConfirmDialog.js";
62
- import { FilterDrawer as lt } from "./components/filters/FilterDrawer.js";
63
- import { FilterChips as ut } from "./components/filters/FilterChips.js";
64
- import { ColumnPicker as dt } from "./components/list/ColumnPicker.js";
65
- import { ViewSwitcher as ft } from "./components/list/ViewSwitcher.js";
66
- import { ActionRunnerProvider as pt, useActionRunner as mt } from "./components/actions/ActionRunner.js";
67
- import { ObjectActionBar as ht, useObjectActions as gt } from "./components/actions/ObjectActionBar.js";
68
- import { RefreshControl as _t } from "./components/shared/RefreshControl.js";
69
- import { RefCombobox as vt } from "./components/fields/RefCombobox.js";
70
- import { QEField as yt, QuickPeek as bt } from "./components/list/QuickPeek.js";
71
- import { InlineEditCell as xt } from "./components/list/InlineEditCell.js";
72
- import { SignIn as St } from "./components/pages/auth/SignIn.js";
73
- import { SignUp as Ct } from "./components/pages/auth/SignUp.js";
74
- import { Forgot as wt } from "./components/pages/auth/Forgot.js";
75
- import { Reset as Tt } from "./components/pages/auth/Reset.js";
76
- import { TwoFA as Et } from "./components/pages/auth/TwoFA.js";
77
- import { AuthShell as Dt } from "./components/pages/auth/AuthShell.js";
78
- import { Profile as Ot } from "./components/pages/profile/Profile.js";
79
- import { Preferences as kt } from "./components/pages/profile/Preferences.js";
80
- import { ChangePasswordDialog as At } from "./components/shared/ChangePasswordDialog.js";
81
- import { Icon as jt } from "./components/primitives/Icons.js";
82
- import { Btn as Mt } from "./components/primitives/Btn.js";
83
- import { IconBtn as Nt } from "./components/primitives/IconBtn.js";
84
- import { PILL_TONES as Pt, Pill as Ft, pillColor as It, pillForeground as Lt, pillToneStyle as Rt } from "./components/primitives/Pill.js";
85
- import { Kbd as zt } from "./components/primitives/Kbd.js";
86
- import { Avatar as Bt } from "./components/primitives/Avatar.js";
87
- import { BrandGlyph as Vt } from "./components/primitives/BrandGlyph.js";
88
- import { Dropdown as Ht } from "./components/primitives/Dropdown.js";
89
- import { HoverCard as Ut } from "./components/primitives/HoverCard.js";
90
- import { InfoTooltip as Wt, Tooltip as Gt } from "./components/primitives/Tooltip.js";
91
- import { Chip as Kt } from "./components/primitives/Chip.js";
92
- import { SectionCard as qt } from "./components/primitives/SectionCard.js";
93
- import { StatTile as Jt } from "./components/primitives/StatTile.js";
94
- import { RecordIdBadge as Yt } from "./components/primitives/RecordIdBadge.js";
95
- import { RowField as Xt } from "./components/primitives/RowField.js";
96
- import { BoolToggle as Zt } from "./components/primitives/BoolToggle.js";
97
- import { MenuItem as Qt } from "./components/primitives/MenuItem.js";
98
- import { Check as $t } from "./components/primitives/Check.js";
99
- import { Spinner as en } from "./components/primitives/Spinner.js";
100
- import { DateInput as tn, FieldLabel as nn, JsonField as rn, MultiSelect as an, PasswordInput as on, QuickEditCell as sn, RefField as cn, Select as ln, TagsInput as un, TextArea as dn, TextInput as fn, ViewField as pn } from "./components/primitives/Fields.js";
101
- import { SquareImage as mn } from "./components/file-widgets/SquareImage.js";
102
- import { CircleImage as hn } from "./components/file-widgets/CircleImage.js";
103
- import { WideBanner as gn } from "./components/file-widgets/WideBanner.js";
104
- import { getFileWidget as _n, hasFileWidget as vn, registerFileWidget as yn } from "./components/file-widgets/registry.js";
105
- import { UploadError as bn, discardFile as xn, formatBytes as Sn, uploadFile as Cn, validateClientSide as wn } from "./components/file-widgets/upload.js";
106
- import { getImageCropper as Tn, setImageCropper as En } from "./components/file-widgets/cropper.js";
107
- import { FileDraftScope as Dn, useDraftRegistration as On, useFileDraftScope as kn } from "./components/file-widgets/draft-scope.js";
108
- import { fileSelectionReducer as An, summarizeFileSelections as jn, useFileSelection as Mn } from "./components/file-widgets/useFileSelection.js";
109
- import { Rail as Nn } from "./components/layout/Rail.js";
110
- import { Sidebar as Pn, buildSections as Fn } from "./components/layout/Sidebar.js";
111
- import { TopBar as In } from "./components/layout/TopBar.js";
112
- import { TenantChip as Ln, envTone as Rn } from "./components/layout/TenantChip.js";
113
- import { TabStrip as zn } from "./components/layout/TabStrip.js";
114
- import { ImpersonationBanner as Bn } from "./components/layout/ImpersonationBanner.js";
115
- import { ImpersonationFrame as Vn } from "./components/layout/ImpersonationFrame.js";
116
- import { ImpersonationStartModal as Hn } from "./components/layout/ImpersonationStartModal.js";
117
- import { useImpersonation as Un } from "./hooks/useImpersonation.js";
118
- import { CommandPalette as Wn } from "./components/layout/CommandPalette.js";
119
- import { AgentChatPanel as Gn } from "./components/agents/AgentChatPanel.js";
120
- import { AgentElicitForm as Kn } from "./components/agents/AgentElicitForm.js";
121
- import { AgentPicker as qn } from "./components/agents/AgentPicker.js";
122
- import { AgentConversationDrawer as Jn } from "./components/agents/AgentConversationDrawer.js";
123
- import { useAgentConversation as Yn } from "./hooks/useAgentConversation.js";
124
- import { answerQuestion as Xn, approveInvocation as Zn, cancelConversation as Qn, cancelInvocation as $n, createConversation as er, listAvailableAgents as tr, listConversations as nr, loadConversationInvocations as rr, loadConversationTurns as ir, loadHistory as ar, rejectInvocation as or, sendElicitResponse as sr, sendMessage as cr } from "./api/agents.js";
125
- import { Breadcrumbs as lr } from "./components/chrome/Breadcrumbs.js";
126
- import { NO_VALUE_OPS as ur, OP_LABELS as dr, countActiveFilters as fr, hasOrGroups as pr, parseFilterURLState as mr, parseFiltersFromURL as hr, setFiltersInURL as gr } from "./lib/filters.js";
127
- import { evaluateFilterTree as _r } from "./lib/filter-evaluator.js";
128
- import { commonVariantActionCodes as vr, effectiveScreenForRecord as yr, resolveEntityVariantCode as br, resolveScreenVariantCode as xr, variantActionCodesForRecord as Sr } from "./lib/variants.js";
129
- import { formatCount as Cr, formatEstimatedCount as wr, formatExactCount as Tr } from "./lib/format-count.js";
130
- import { buildMassEditTargets as Er, parseTargetFilter as Dr } from "./lib/mass-edit.js";
131
- import { MULTIPLE_VALUES as Or, PropertyGridEditor as kr, detectCommonValue as Ar } from "./components/actions/PropertyGridEditor.js";
132
- import { ClassifiedFieldLocked as jr } from "./components/primitives/ClassifiedFieldLocked.js";
133
- import { classificationTier as Mr, fieldAccessInfo as Nr, fieldClassification as Pr, fieldRequiredPermission as Fr, isFieldReadable as Ir, isFieldSoDProtected as Lr, isFieldWritable as Rr } from "./lib/field-classification.js";
134
- import { useLocation as zr, useNavigate as Br, useParams as Vr, useSearchParams as Hr } from "react-router";
135
- export { te as ACTION_DATA_CURSOR_KEY, ne as ACTION_DATA_KEY, E as ActionBatchError, pt as ActionRunnerProvider, Gn as AgentChatPanel, Jn as AgentConversationDrawer, Kn as AgentElicitForm, qn as AgentPicker, e as App, Dt as AuthShell, Bt as Avatar, j as Batch, Zt as BoolToggle, Vt as BrandGlyph, lr as Breadcrumbs, Mt as Btn, p as CURSOR_LANGUAGE_CHANGED, m as CURSOR_SEMANTICS_MISMATCH, At as ChangePasswordDialog, $t as Check, Kt as Chip, hn as CircleImage, jr as ClassifiedFieldLocked, dt as ColumnPicker, Wn as CommandPalette, ct as ConfirmDialog, R as CurrentScreenProvider, pe as DEFAULT_RESPONSIVE_BREAKPOINTS, tn as DateInput, e as Declarion, Ht as Dropdown, at as DynamicIcon, st as EmptyState, C as EntityClient, nn as FieldLabel, Dn as FileDraftScope, ut as FilterChips, lt as FilterDrawer, wt as Forgot, Ut as HoverCard, jt as Icon, Nt as IconBtn, Bn as ImpersonationBanner, Vn as ImpersonationFrame, Hn as ImpersonationStartModal, Wt as InfoTooltip, xt as InlineEditCell, rn as JsonField, zt as Kbd, Fe as MANDATORY_LANGUAGE, Or as MULTIPLE_VALUES, Qt as MenuItem, an as MultiSelect, ur as NO_VALUE_OPS, dr as OP_LABELS, ht as ObjectActionBar, t as OrderedMap, Je as PAGE_STATE_TTL_PARAM, Pt as PILL_TONES, ot as PageHeader, on as PasswordInput, Ft as Pill, kt as Preferences, Ot as Profile, kr as PropertyGridEditor, yt as QEField, sn as QuickEditCell, bt as QuickPeek, Nn as Rail, Yt as RecordIdBadge, w as RefCache, vt as RefCombobox, cn as RefField, _t as RefreshControl, Tt as Reset, de as ResponsiveModeProvider, Xt as RowField, Qe as SCROLL_STATE_KEY, qt as SectionCard, ln as Select, Pn as Sidebar, St as SignIn, Ct as SignUp, rt as SmartDetailPage, nt as SmartListPage, it as SmartRecordListPage, en as Spinner, mn as SquareImage, Jt as StatTile, $ as StructureField, zn as TabStrip, un as TagsInput, Ln as TenantChip, dn as TextArea, fn as TextInput, Gt as Tooltip, In as TopBar, Et as TwoFA, bn as UploadError, pn as ViewField, ft as ViewSwitcher, gn as WideBanner, re as actionDataQueryKey, Xn as answerQuestion, Zn as approveInvocation, D as buildActionBody, n as buildDetailHrefFromId, r as buildEntityDetailHref, Er as buildMassEditTargets, i as buildRowDetailHref, Fn as buildSections, Qn as cancelConversation, $n as cancelInvocation, Ke as canonicalUrl, Mr as classificationTier, _ as coerceDisplayString, vr as commonVariantActionCodes, fr as countActiveFilters, er as createConversation, ie as cursorActionDataQueryKey, G as cursorEntityDataQueryKey, K as cursorEntityStableKey, O as deleteObject, Ar as detectCommonValue, xn as discardFile, v as editorWallClock, y as editorWireValue, yr as effectiveScreenForRecord, T as entityClient, V as entityDataQueryKey, Rn as envTone, h as errorCodeOf, _r as evaluateFilterTree, k as executeAction, a as extractPkValues, Be as failureTitle, Nr as fieldAccessInfo, Pr as fieldClassification, o as fieldDisplayName, Fr as fieldRequiredPermission, Z as fileReferenceJSONQueryKey, An as fileSelectionReducer, Sn as formatBytes, Cr as formatCount, wr as formatEstimatedCount, Tr as formatExactCount, S as formatMoneyText, b as formatOffsetTimestamp, _n as getFileWidget, Ee as getIcon, Tn as getImageCropper, Oe as getLayoutWidget, s as getPrimaryKeyFields, vn as hasFileWidget, ke as hasLayoutWidget, pr as hasOrGroups, g as isCursorStaleError, Ir as isFieldReadable, Lr as isFieldSoDProtected, Rr as isFieldWritable, tr as listAvailableAgents, nr as listConversations, rr as loadConversationInvocations, ir as loadConversationTurns, ar as loadHistory, Ie as makeTextFn, Y as objectQueryKey, mr as parseFilterURLState, hr as parseFiltersFromURL, Dr as parseTargetFilter, Le as pickLocalized, It as pillColor, Lt as pillForeground, Rt as pillToneStyle, c as pkValuePartsToId, l as pkValuesFromId, u as pkValuesToDetailId, d as pkValuesToId, Re as pluralText, Ve as readDisplayState, yn as registerFileWidget, Ae as registerLayoutWidget, Te as registerScreen, or as rejectInvocation, je as reresolveLanguage, f as resolveDetailRoute, br as resolveEntityVariantCode, xr as resolveScreenVariantCode, me as resolveViewportCategory, A as restoreObject, sr as sendElicitResponse, cr as sendMessage, gr as setFiltersInURL, De as setIconRegistry, En as setImageCropper, jn as summarizeFileSelections, ze as textWithNodes, Cn as uploadFile, ae as useActionData, mt as useActionRunner, Yn as useAgentConversation, W as useAggregate, J as useAllEntityData, B as useAuth, Ce as useColumns, se as useCreateObject, z as useCurrentScreen, oe as useCursorActionData, q as useCursorEntityData, ue as useDebounce, N as useDeclaredEnum, P as useDeclaredField, F as useDeclaredStatuses, ce as useDeleteObject, be as useDeleteProperty, Me as useDeploymentLanguage, On as useDraftRegistration, he as useEffectiveParam, I as useEntity, H as useEntityCount, U as useEntityData, kn as useFileDraftScope, Q as useFileReferenceJSON, Mn as useFileSelection, Se as useFilters, Un as useImpersonation, Ne as useLanguage, ee as useLiveObject, zr as useLocation, Br as useNavigate, X as useObject, gt as useObjectActions, Ge as usePageState, Ye as usePageStateTtl, ge as useParam, Vr as useParams, $e as usePlainScrollRestoration, _e as usePublicParams, qe as useRegisterRetainedQuery, ve as useResolvedParam, fe as useResponsiveMode, et as useSavedScrollOffset, M as useSchema, L as useScreen, We as useScreenBack, Xe as useScreenTab, Hr as useSearchParams, xe as useSetProperty, ye as useSetStatus, Ue as useTabNavigate, Ze as useTabSearchMirror, He as useTabStore, Pe as useText, le as useUpdateObject, we as useViews, tt as useVirtualScrollRestoration, wn as validateClientSide, Sr as variantActionCodesForRecord, x as zoneMark };
25
+ import { ValueRows as ee } from "./components/fields/ValueRows.js";
26
+ import { shortId as te } from "./lib/short-id.js";
27
+ import { useCopy as ne } from "./hooks/useCopy.js";
28
+ import { isNestable as re, jsonRows as ie, parseJsonText as ae } from "./components/fields/JsonField.js";
29
+ import { FieldRow as oe, FieldsGrid as se } from "./components/detail-layout/FieldRow.js";
30
+ import { useLiveObject as ce } from "./hooks/useLiveObject.js";
31
+ import { ACTION_DATA_CURSOR_KEY as le, ACTION_DATA_KEY as ue, actionDataQueryKey as de, cursorActionDataQueryKey as fe, useActionData as pe, useCursorActionData as me } from "./hooks/useActionData.js";
32
+ import { useCreateObject as he, useDeleteObject as ge, useUpdateObject as _e } from "./hooks/useMutations.js";
33
+ import { useDebounce as ve } from "./hooks/useDebounce.js";
34
+ import { ResponsiveModeProvider as ye, useResponsiveMode as be } from "./hooks/useResponsiveMode.js";
35
+ import { useEffectiveParam as xe, useParam as Se, usePublicParams as Ce, useResolvedParam as we } from "./hooks/useParams.js";
36
+ import { useSetStatus as Te } from "./hooks/useObjectStatus.js";
37
+ import { useDeleteProperty as Ee, useSetProperty as De } from "./hooks/useProperties.js";
38
+ import { useFilters as Oe } from "./hooks/useFilters.js";
39
+ import { useColumns as ke } from "./hooks/useColumns.js";
40
+ import { useViews as Ae } from "./hooks/useViews.js";
41
+ import { registerScreen as je } from "./stores/screen-registry.js";
42
+ import { getIcon as Me, setIconRegistry as Ne } from "./stores/icon-registry.js";
43
+ import { getLayoutWidget as Pe, hasLayoutWidget as Fe, registerLayoutWidget as Ie } from "./components/detail-layout/widgets/registry.js";
44
+ import { reresolveLanguage as Le, useDeploymentLanguage as Re, useLanguage as ze } from "./hooks/useLanguage.js";
45
+ import { useText as Be } from "./hooks/useText.js";
46
+ import { MANDATORY_LANGUAGE as Ve, makeTextFn as He, pickLocalized as Ue, pluralText as We, textWithNodes as Ge } from "./lib/language.js";
47
+ import { failureTitle as Ke } from "./lib/failure.js";
48
+ import { readDisplayState as qe } from "./lib/read-display-state.js";
49
+ import { useTabStore as Je } from "./stores/tabs.js";
50
+ import { useTabNavigate as Ye } from "./hooks/useTabNavigate.js";
51
+ import { DEFAULT_RESPONSIVE_BREAKPOINTS as Xe, resolveViewportCategory as Ze } from "./lib/viewport-category.js";
52
+ import { useScreenBack as Qe } from "./hooks/useScreenBack.js";
53
+ import { usePageState as $e } from "./hooks/usePageState.js";
54
+ import { canonicalUrl as et } from "./lib/canonical-url.js";
55
+ import { useRegisterRetainedQuery as tt } from "./hooks/usePageStateRuntime.js";
56
+ import { PAGE_STATE_TTL_PARAM as nt, usePageStateTtl as rt } from "./hooks/usePageStateTtl.js";
57
+ import { useScreenTab as it } from "./hooks/useScreenTab.js";
58
+ import { useTabSearchMirror as at } from "./hooks/useTabSearchMirror.js";
59
+ import { SCROLL_STATE_KEY as ot, usePlainScrollRestoration as st, useSavedScrollOffset as ct, useVirtualScrollRestoration as lt } from "./lib/scroll-restoration.js";
60
+ import { SmartListPage as ut } from "./components/pages/SmartListPage.js";
61
+ import { SmartDetailPage as dt } from "./components/pages/SmartDetailPage.js";
62
+ import { SmartRecordListPage as ft } from "./components/pages/SmartRecordListPage.js";
63
+ import { DynamicIcon as pt } from "./components/shared/DynamicIcon.js";
64
+ import { PageHeader as mt } from "./components/chrome/PageHeader.js";
65
+ import { EmptyState as ht } from "./components/shared/EmptyState.js";
66
+ import { ConfirmDialog as gt } from "./components/shared/ConfirmDialog.js";
67
+ import { FilterDrawer as _t } from "./components/filters/FilterDrawer.js";
68
+ import { FilterChips as vt } from "./components/filters/FilterChips.js";
69
+ import { ColumnPicker as yt } from "./components/list/ColumnPicker.js";
70
+ import { ViewSwitcher as bt } from "./components/list/ViewSwitcher.js";
71
+ import { ActionRunnerProvider as xt, useActionRunner as St } from "./components/actions/ActionRunner.js";
72
+ import { ObjectActionBar as Ct, useObjectActions as wt } from "./components/actions/ObjectActionBar.js";
73
+ import { RefreshControl as Tt } from "./components/shared/RefreshControl.js";
74
+ import { RefCombobox as Et } from "./components/fields/RefCombobox.js";
75
+ import { QuickPeek as Dt } from "./components/list/QuickPeek.js";
76
+ import { InlineEditCell as Ot } from "./components/list/InlineEditCell.js";
77
+ import { SignIn as kt } from "./components/pages/auth/SignIn.js";
78
+ import { SignUp as At } from "./components/pages/auth/SignUp.js";
79
+ import { Forgot as jt } from "./components/pages/auth/Forgot.js";
80
+ import { Reset as Mt } from "./components/pages/auth/Reset.js";
81
+ import { TwoFA as Nt } from "./components/pages/auth/TwoFA.js";
82
+ import { AuthShell as Pt } from "./components/pages/auth/AuthShell.js";
83
+ import { Profile as Ft } from "./components/pages/profile/Profile.js";
84
+ import { Preferences as It } from "./components/pages/profile/Preferences.js";
85
+ import { ChangePasswordDialog as Lt } from "./components/shared/ChangePasswordDialog.js";
86
+ import { Icon as Rt } from "./components/primitives/Icons.js";
87
+ import { Btn as zt } from "./components/primitives/Btn.js";
88
+ import { IconBtn as Bt } from "./components/primitives/IconBtn.js";
89
+ import { PILL_TONES as Vt, Pill as Ht, pillColor as Ut, pillForeground as Wt, pillToneStyle as Gt } from "./components/primitives/Pill.js";
90
+ import { Kbd as Kt } from "./components/primitives/Kbd.js";
91
+ import { Avatar as qt } from "./components/primitives/Avatar.js";
92
+ import { BrandGlyph as Jt } from "./components/primitives/BrandGlyph.js";
93
+ import { Dropdown as Yt } from "./components/primitives/Dropdown.js";
94
+ import { HoverCard as Xt } from "./components/primitives/HoverCard.js";
95
+ import { InfoTooltip as Zt, Tooltip as Qt } from "./components/primitives/Tooltip.js";
96
+ import { Chip as $t } from "./components/primitives/Chip.js";
97
+ import { SectionCard as en } from "./components/primitives/SectionCard.js";
98
+ import { StatTile as tn } from "./components/primitives/StatTile.js";
99
+ import { IdBadge as nn } from "./components/primitives/IdBadge.js";
100
+ import { RowField as rn } from "./components/primitives/RowField.js";
101
+ import { BoolToggle as an } from "./components/primitives/BoolToggle.js";
102
+ import { MenuItem as on } from "./components/primitives/MenuItem.js";
103
+ import { Check as sn } from "./components/primitives/Check.js";
104
+ import { Spinner as cn } from "./components/primitives/Spinner.js";
105
+ import { DateInput as ln, FieldLabel as un, JsonField as dn, MultiSelect as fn, PasswordInput as pn, QuickEditCell as mn, RefField as hn, Select as gn, TagsInput as _n, TextArea as vn, TextInput as yn, ViewField as bn } from "./components/primitives/Fields.js";
106
+ import { SquareImage as xn } from "./components/file-widgets/SquareImage.js";
107
+ import { CircleImage as Sn } from "./components/file-widgets/CircleImage.js";
108
+ import { WideBanner as Cn } from "./components/file-widgets/WideBanner.js";
109
+ import { getFileWidget as wn, hasFileWidget as Tn, registerFileWidget as En } from "./components/file-widgets/registry.js";
110
+ import { UploadError as Dn, discardFile as On, formatBytes as kn, uploadFile as An, validateClientSide as jn } from "./components/file-widgets/upload.js";
111
+ import { getImageCropper as Mn, setImageCropper as Nn } from "./components/file-widgets/cropper.js";
112
+ import { FileDraftScope as Pn, useDraftRegistration as Fn, useFileDraftScope as In } from "./components/file-widgets/draft-scope.js";
113
+ import { fileSelectionReducer as Ln, summarizeFileSelections as Rn, useFileSelection as zn } from "./components/file-widgets/useFileSelection.js";
114
+ import { Rail as Bn } from "./components/layout/Rail.js";
115
+ import { Sidebar as Vn, buildSections as Hn } from "./components/layout/Sidebar.js";
116
+ import { TopBar as Un } from "./components/layout/TopBar.js";
117
+ import { TenantChip as Wn, envTone as Gn } from "./components/layout/TenantChip.js";
118
+ import { TabStrip as Kn } from "./components/layout/TabStrip.js";
119
+ import { ImpersonationBanner as qn } from "./components/layout/ImpersonationBanner.js";
120
+ import { ImpersonationFrame as Jn } from "./components/layout/ImpersonationFrame.js";
121
+ import { ImpersonationStartModal as Yn } from "./components/layout/ImpersonationStartModal.js";
122
+ import { useImpersonation as Xn } from "./hooks/useImpersonation.js";
123
+ import { CommandPalette as Zn } from "./components/layout/CommandPalette.js";
124
+ import { AgentChatPanel as Qn } from "./components/agents/AgentChatPanel.js";
125
+ import { AgentElicitForm as $n } from "./components/agents/AgentElicitForm.js";
126
+ import { AgentPicker as er } from "./components/agents/AgentPicker.js";
127
+ import { AgentConversationDrawer as tr } from "./components/agents/AgentConversationDrawer.js";
128
+ import { useAgentConversation as nr } from "./hooks/useAgentConversation.js";
129
+ import { answerQuestion as rr, approveInvocation as ir, cancelConversation as ar, cancelInvocation as or, createConversation as sr, listAvailableAgents as cr, listConversations as lr, loadConversationInvocations as ur, loadConversationTurns as dr, loadHistory as fr, rejectInvocation as pr, sendElicitResponse as mr, sendMessage as hr } from "./api/agents.js";
130
+ import { Breadcrumbs as gr } from "./components/chrome/Breadcrumbs.js";
131
+ import { NO_VALUE_OPS as _r, OP_LABELS as vr, countActiveFilters as yr, hasOrGroups as br, parseFilterURLState as xr, parseFiltersFromURL as Sr, setFiltersInURL as Cr } from "./lib/filters.js";
132
+ import { evaluateFilterTree as wr } from "./lib/filter-evaluator.js";
133
+ import { commonVariantActionCodes as Tr, effectiveScreenForRecord as Er, resolveEntityVariantCode as Dr, resolveScreenVariantCode as Or, variantActionCodesForRecord as kr } from "./lib/variants.js";
134
+ import { formatCount as Ar, formatEstimatedCount as jr, formatExactCount as Mr } from "./lib/format-count.js";
135
+ import { buildMassEditTargets as Nr, parseTargetFilter as Pr } from "./lib/mass-edit.js";
136
+ import { MULTIPLE_VALUES as Fr, PropertyGridEditor as Ir, detectCommonValue as Lr } from "./components/actions/PropertyGridEditor.js";
137
+ import { ClassifiedFieldLocked as Rr } from "./components/primitives/ClassifiedFieldLocked.js";
138
+ import { classificationTier as zr, fieldAccessInfo as Br, fieldClassification as Vr, fieldRequiredPermission as Hr, isFieldReadable as Ur, isFieldSoDProtected as Wr, isFieldWritable as Gr } from "./lib/field-classification.js";
139
+ import { useLocation as Kr, useNavigate as qr, useParams as Jr, useSearchParams as Yr } from "react-router";
140
+ export { le as ACTION_DATA_CURSOR_KEY, ue as ACTION_DATA_KEY, E as ActionBatchError, xt as ActionRunnerProvider, Qn as AgentChatPanel, tr as AgentConversationDrawer, $n as AgentElicitForm, er as AgentPicker, e as App, Pt as AuthShell, qt as Avatar, j as Batch, an as BoolToggle, Jt as BrandGlyph, gr as Breadcrumbs, zt as Btn, p as CURSOR_LANGUAGE_CHANGED, m as CURSOR_SEMANTICS_MISMATCH, Lt as ChangePasswordDialog, sn as Check, $t as Chip, Sn as CircleImage, Rr as ClassifiedFieldLocked, yt as ColumnPicker, Zn as CommandPalette, gt as ConfirmDialog, R as CurrentScreenProvider, Xe as DEFAULT_RESPONSIVE_BREAKPOINTS, ln as DateInput, e as Declarion, Yt as Dropdown, pt as DynamicIcon, ht as EmptyState, C as EntityClient, un as FieldLabel, oe as FieldRow, se as FieldsGrid, Pn as FileDraftScope, vt as FilterChips, _t as FilterDrawer, jt as Forgot, Xt as HoverCard, Rt as Icon, Bt as IconBtn, nn as IdBadge, qn as ImpersonationBanner, Jn as ImpersonationFrame, Yn as ImpersonationStartModal, Zt as InfoTooltip, Ot as InlineEditCell, dn as JsonField, Kt as Kbd, Ve as MANDATORY_LANGUAGE, Fr as MULTIPLE_VALUES, on as MenuItem, fn as MultiSelect, _r as NO_VALUE_OPS, vr as OP_LABELS, Ct as ObjectActionBar, t as OrderedMap, nt as PAGE_STATE_TTL_PARAM, Vt as PILL_TONES, mt as PageHeader, pn as PasswordInput, Ht as Pill, It as Preferences, Ft as Profile, Ir as PropertyGridEditor, mn as QuickEditCell, Dt as QuickPeek, Bn as Rail, w as RefCache, Et as RefCombobox, hn as RefField, Tt as RefreshControl, Mt as Reset, ye as ResponsiveModeProvider, rn as RowField, ot as SCROLL_STATE_KEY, en as SectionCard, gn as Select, Vn as Sidebar, kt as SignIn, At as SignUp, dt as SmartDetailPage, ut as SmartListPage, ft as SmartRecordListPage, cn as Spinner, xn as SquareImage, tn as StatTile, $ as StructureField, Kn as TabStrip, _n as TagsInput, Wn as TenantChip, vn as TextArea, yn as TextInput, Qt as Tooltip, Un as TopBar, Nt as TwoFA, Dn as UploadError, ee as ValueRows, bn as ViewField, bt as ViewSwitcher, Cn as WideBanner, de as actionDataQueryKey, rr as answerQuestion, ir as approveInvocation, D as buildActionBody, n as buildDetailHrefFromId, r as buildEntityDetailHref, Nr as buildMassEditTargets, i as buildRowDetailHref, Hn as buildSections, ar as cancelConversation, or as cancelInvocation, et as canonicalUrl, zr as classificationTier, _ as coerceDisplayString, Tr as commonVariantActionCodes, yr as countActiveFilters, sr as createConversation, fe as cursorActionDataQueryKey, G as cursorEntityDataQueryKey, K as cursorEntityStableKey, O as deleteObject, Lr as detectCommonValue, On as discardFile, v as editorWallClock, y as editorWireValue, Er as effectiveScreenForRecord, T as entityClient, V as entityDataQueryKey, Gn as envTone, h as errorCodeOf, wr as evaluateFilterTree, k as executeAction, a as extractPkValues, Ke as failureTitle, Br as fieldAccessInfo, Vr as fieldClassification, o as fieldDisplayName, Hr as fieldRequiredPermission, Z as fileReferenceJSONQueryKey, Ln as fileSelectionReducer, kn as formatBytes, Ar as formatCount, jr as formatEstimatedCount, Mr as formatExactCount, S as formatMoneyText, b as formatOffsetTimestamp, wn as getFileWidget, Me as getIcon, Mn as getImageCropper, Pe as getLayoutWidget, s as getPrimaryKeyFields, Tn as hasFileWidget, Fe as hasLayoutWidget, br as hasOrGroups, g as isCursorStaleError, Ur as isFieldReadable, Wr as isFieldSoDProtected, Gr as isFieldWritable, re as isNestable, ie as jsonRows, cr as listAvailableAgents, lr as listConversations, ur as loadConversationInvocations, dr as loadConversationTurns, fr as loadHistory, He as makeTextFn, Y as objectQueryKey, xr as parseFilterURLState, Sr as parseFiltersFromURL, ae as parseJsonText, Pr as parseTargetFilter, Ue as pickLocalized, Ut as pillColor, Wt as pillForeground, Gt as pillToneStyle, c as pkValuePartsToId, l as pkValuesFromId, u as pkValuesToDetailId, d as pkValuesToId, We as pluralText, qe as readDisplayState, En as registerFileWidget, Ie as registerLayoutWidget, je as registerScreen, pr as rejectInvocation, Le as reresolveLanguage, f as resolveDetailRoute, Dr as resolveEntityVariantCode, Or as resolveScreenVariantCode, Ze as resolveViewportCategory, A as restoreObject, mr as sendElicitResponse, hr as sendMessage, Cr as setFiltersInURL, Ne as setIconRegistry, Nn as setImageCropper, te as shortId, Rn as summarizeFileSelections, Ge as textWithNodes, An as uploadFile, pe as useActionData, St as useActionRunner, nr as useAgentConversation, W as useAggregate, J as useAllEntityData, B as useAuth, ke as useColumns, ne as useCopy, he as useCreateObject, z as useCurrentScreen, me as useCursorActionData, q as useCursorEntityData, ve as useDebounce, N as useDeclaredEnum, P as useDeclaredField, F as useDeclaredStatuses, ge as useDeleteObject, Ee as useDeleteProperty, Re as useDeploymentLanguage, Fn as useDraftRegistration, xe as useEffectiveParam, I as useEntity, H as useEntityCount, U as useEntityData, In as useFileDraftScope, Q as useFileReferenceJSON, zn as useFileSelection, Oe as useFilters, Xn as useImpersonation, ze as useLanguage, ce as useLiveObject, Kr as useLocation, qr as useNavigate, X as useObject, wt as useObjectActions, $e as usePageState, rt as usePageStateTtl, Se as useParam, Jr as useParams, st as usePlainScrollRestoration, Ce as usePublicParams, tt as useRegisterRetainedQuery, we as useResolvedParam, be as useResponsiveMode, ct as useSavedScrollOffset, M as useSchema, L as useScreen, Qe as useScreenBack, it as useScreenTab, Yr as useSearchParams, De as useSetProperty, Te as useSetStatus, Ye as useTabNavigate, at as useTabSearchMirror, Je as useTabStore, Be as useText, _e as useUpdateObject, Ae as useViews, lt as useVirtualScrollRestoration, jn as validateClientSide, kr as variantActionCodesForRecord, x as zoneMark };
@@ -1,36 +1,37 @@
1
1
  import { listEntities as e } from "../api/data.js";
2
2
  import { entityCountQueryKey as t } from "../hooks/useEntityData.js";
3
- import { parseSort as n } from "./sort.js";
4
- import { isListCacheKey as r, isRefetchOnlyListKey as i } from "./realtime-query-keys.js";
5
- import { openResync as a } from "./realtime-resync.js";
6
- import { refetchWhenIdle as o } from "./refetch-when-idle.js";
7
- import { ApiError as s } from "../types/api.js";
3
+ import { bindRowReferences as n, bindUnboundRowReferences as r } from "./reference.js";
4
+ import { parseSort as i } from "./sort.js";
5
+ import { isListCacheKey as a, isRefetchOnlyListKey as o } from "./realtime-query-keys.js";
6
+ import { openResync as s } from "./realtime-resync.js";
7
+ import { refetchWhenIdle as c } from "./refetch-when-idle.js";
8
+ import { ApiError as l } from "../types/api.js";
8
9
  // src/lib/realtime-reconcile.ts
9
- async function c(e, t, n, a) {
10
- let s = e.getQueryCache().findAll({ predicate: (e) => r(e.queryKey) && e.queryKey[1] === t }), c = !1, u = [];
11
- for (let r of s) r.state.data !== void 0 && (r.getObserversCount() === 0 ? e.invalidateQueries({
12
- queryKey: r.queryKey,
10
+ async function u(e, t, n, r) {
11
+ let i = e.getQueryCache().findAll({ predicate: (e) => a(e.queryKey) && e.queryKey[1] === t }), s = !1, l = [];
12
+ for (let a of i) a.state.data !== void 0 && (a.getObserversCount() === 0 ? e.invalidateQueries({
13
+ queryKey: a.queryKey,
13
14
  refetchType: "none"
14
- }) : i(r.queryKey) ? o(e, r) : u.push(l(e, r, t, n, a).then((e) => {
15
- e.refetchCount && (c = !0);
15
+ }) : o(a.queryKey) ? c(e, a) : l.push(d(e, a, t, n, r).then((e) => {
16
+ e.refetchCount && (s = !0);
16
17
  })));
17
- return await Promise.all(u), c;
18
+ return await Promise.all(l), s;
18
19
  }
19
- async function l(n, r, i, s, c) {
20
+ async function d(n, r, i, a, o) {
20
21
  let l = r.state.data;
21
- if (!l || !Array.isArray(l.data)) return o(n, r), {
22
+ if (!l || !Array.isArray(l.data)) return c(n, r), {
22
23
  refetchWindow: !0,
23
24
  refetchCount: !0
24
25
  };
25
- let d = y(r), f = d.per_page ?? l.data.length;
26
- if (s.length > f) return p(n, r);
27
- let h, g = S(r), _ = r.state.dataUpdateCount;
26
+ let u = S(r), d = u.per_page ?? l.data.length;
27
+ if (a.length > d) return g(n, r);
28
+ let p, m = T(r), h = r.state.dataUpdateCount;
28
29
  try {
29
- h = await e(i, m(d, s), { signal: c });
30
+ p = await e(i, _(u, a), { signal: o });
30
31
  } catch (e) {
31
- return b(e) ? (a(n, {
32
+ return C(e) ? (s(n, {
32
33
  scope: { kind: "keys" },
33
- keys: [r.queryKey, t(i, d)],
34
+ keys: [r.queryKey, t(i, u)],
34
35
  standing: !0
35
36
  }), n.invalidateQueries({
36
37
  queryKey: r.queryKey,
@@ -38,56 +39,66 @@ async function l(n, r, i, s, c) {
38
39
  }), {
39
40
  refetchWindow: !1,
40
41
  refetchCount: !1
41
- }) : p(n, r);
42
+ }) : g(n, r);
42
43
  }
43
- return h.meta?.has_more || r.state.dataUpdateCount !== _ ? p(n, r) : u(n, r, l, d, s, h, g);
44
+ return p.meta?.has_more || r.state.dataUpdateCount !== h ? g(n, r) : f(n, r, l, u, a, p, m);
44
45
  }
45
- function u(e, t, r, i, a, s, c) {
46
- let l = n(i.sort).map((e) => e.field), u = v(t, i), f = {
46
+ function f(e, t, n, r, a, o, s) {
47
+ let l = i(r.sort).map((e) => e.field), u = x(t, r), d = {
47
48
  refetchWindow: !1,
48
49
  refetchCount: !1
49
- }, p = [], m = [];
50
+ }, f = [], m = [];
50
51
  for (let e of a) {
51
- let t = s.data.find((t) => _(t, e.pk)), n = r.data.findIndex((t) => _(t, e.pk));
52
- t && n >= 0 ? g(l, r.data[n], t) ? f.refetchWindow = !0 : p.push({
52
+ let t = o.data.find((t) => b(t, e.pk)), r = n.data.findIndex((t) => b(t, e.pk));
53
+ t && r >= 0 ? y(l, n.data[r], t) ? d.refetchWindow = !0 : f.push({
53
54
  pk: e.pk,
54
55
  row: t
55
- }) : t ? (f.refetchWindow = !0, f.refetchCount = !0) : n >= 0 ? (m.push(e.pk), f.refetchWindow = !0, f.refetchCount = !0) : e.createdOnly || (f.refetchCount = !0, u || (f.refetchWindow = !0));
56
+ }) : t ? (d.refetchWindow = !0, d.refetchCount = !0) : r >= 0 ? (m.push(e.pk), d.refetchWindow = !0, d.refetchCount = !0) : e.createdOnly || (d.refetchCount = !0, u || (d.refetchWindow = !0));
56
57
  }
57
- return (m.length > 0 || p.length > 0 && !f.refetchWindow) && d(e, t, p, m, s, c), f.refetchWindow && o(e, t), f;
58
+ return (m.length > 0 || f.length > 0 && !d.refetchWindow) && p(e, t, f, m, o, s), d.refetchWindow && c(e, t), d;
58
59
  }
59
- function d(e, t, n, r, i, a) {
60
- C(t, a) && e.setQueryData(t.queryKey, (e) => {
60
+ function p(e, t, i, a, o, s) {
61
+ E(t, s) && e.setQueryData(t.queryKey, (e) => {
61
62
  if (!e || !Array.isArray(e.data)) return e;
62
- let t = e.data.map((e) => {
63
- let t = n.find((t) => _(e, t.pk));
64
- return t ? t.row : e;
63
+ let t = e.data.map((t) => {
64
+ let a = i.find((e) => b(t, e.pk));
65
+ return a ? n([a.row], o.$refs)[0] : r([t], e.$refs)[0];
65
66
  });
66
- return r.length > 0 && (t = t.filter((e) => !r.some((t) => _(e, t)))), {
67
+ return a.length > 0 && (t = t.filter((e) => !a.some((t) => b(e, t)))), {
67
68
  ...e,
68
69
  data: t,
69
- $refs: f(e.$refs, i.$refs)
70
+ $refs: m(e.$refs, o.$refs)
70
71
  };
71
72
  });
72
73
  }
73
- function f(e, t) {
74
+ function m(e, t) {
74
75
  if (!t) return e;
75
76
  if (!e) return t;
76
77
  let n = { ...e };
77
- for (let [e, r] of Object.entries(t)) n[e] = {
78
- ...n[e] ?? {},
79
- ...r
80
- };
78
+ for (let [e, r] of Object.entries(t)) {
79
+ let t = { ...n[e] ?? {} };
80
+ for (let [e, n] of Object.entries(r)) {
81
+ let r = t[e];
82
+ t[e] = r && h(r, n) ? {
83
+ ...r,
84
+ ...n
85
+ } : n;
86
+ }
87
+ n[e] = t;
88
+ }
81
89
  return n;
82
90
  }
83
- function p(e, t) {
84
- return o(e, t), {
91
+ function h(e, t) {
92
+ return e.id != null && e.id === t.id;
93
+ }
94
+ function g(e, t) {
95
+ return c(e, t), {
85
96
  refetchWindow: !0,
86
97
  refetchCount: !0
87
98
  };
88
99
  }
89
- function m(e, t) {
90
- let n = [...e.filters ?? [], h(t)];
100
+ function _(e, t) {
101
+ let n = [...e.filters ?? [], v(t)];
91
102
  return {
92
103
  ...e,
93
104
  filters: n,
@@ -96,7 +107,7 @@ function m(e, t) {
96
107
  count: "window"
97
108
  };
98
109
  }
99
- function h(e) {
110
+ function v(e) {
100
111
  let t = Object.keys(e[0]?.pk ?? {}).sort();
101
112
  if (t.length === 1) {
102
113
  let n = t[0];
@@ -112,36 +123,36 @@ function h(e) {
112
123
  value: e.pk[t]
113
124
  })) })) };
114
125
  }
115
- function g(e, t, n) {
126
+ function y(e, t, n) {
116
127
  for (let r of e) {
117
128
  let e = t[r], i = n[r];
118
129
  if (e === void 0 || i === void 0 || !Object.is(e, i) && JSON.stringify(e) !== JSON.stringify(i)) return !0;
119
130
  }
120
131
  return !1;
121
132
  }
122
- function _(e, t) {
133
+ function b(e, t) {
123
134
  for (let [n, r] of Object.entries(t)) {
124
135
  let t = e[n];
125
136
  if (typeof t != "string" && typeof t != "number" || String(t) !== r) return !1;
126
137
  }
127
138
  return !0;
128
139
  }
129
- function v(e, t) {
140
+ function x(e, t) {
130
141
  return e.queryKey[0] === "entity-data-all" || (t.page ?? 1) === 1;
131
142
  }
132
- function y(e) {
143
+ function S(e) {
133
144
  let t = e.queryKey[2];
134
145
  return t && typeof t == "object" ? { ...t } : {};
135
146
  }
136
- function b(e) {
137
- return e instanceof s && e.status === 429;
147
+ function C(e) {
148
+ return e instanceof l && e.status === 429;
138
149
  }
139
- var x = /* @__PURE__ */ new WeakMap();
140
- function S(e) {
141
- let t = (x.get(e) ?? 0) + 1;
142
- return x.set(e, t), t;
150
+ var w = /* @__PURE__ */ new WeakMap();
151
+ function T(e) {
152
+ let t = (w.get(e) ?? 0) + 1;
153
+ return w.set(e, t), t;
143
154
  }
144
- function C(e, t) {
145
- return (x.get(e) ?? 0) === t;
155
+ function E(e, t) {
156
+ return (w.get(e) ?? 0) === t;
146
157
  }
147
- export { m as narrowedParams, c as reconcileListCaches };
158
+ export { m as mergeResponseRefs, _ as narrowedParams, u as reconcileListCaches };
@@ -1,53 +1,71 @@
1
1
  import { coerceDisplayString as e } from "./display-value.js";
2
- import { DISPLAY_KEY as t, getPrimaryKeyFields as n, resolveRefRecordLabel as r } from "../types/schema.js";
2
+ import { DISPLAY_KEY as t, getPrimaryKeyFields as n, refRecordHasLabel as r, resolveRefRecordLabel as i } from "../types/schema.js";
3
3
  // src/lib/reference.ts
4
- var i = /* @__PURE__ */ new WeakMap();
5
- function a(e) {
4
+ var a = /* @__PURE__ */ new WeakMap();
5
+ function o(e) {
6
6
  return e.includes("@");
7
7
  }
8
- function o(e, t) {
9
- for (let n of e) i.set(n, t);
10
- return e;
11
- }
12
8
  function s(e, t) {
13
- return i.has(e) && i.set(t, i.get(e)), t;
9
+ for (let n of e) a.set(n, t);
10
+ return e;
14
11
  }
15
12
  function c(e, t) {
16
- return e && Object.hasOwn(e, t) ? e[t] : void 0;
13
+ for (let n of e) a.has(n) || a.set(n, t);
14
+ return e;
17
15
  }
18
16
  function l(e, t) {
19
- return i.has(e) ? i.get(e) : c(e, "$refs") ?? t;
20
- }
21
- function u(i) {
22
- let a = i.field.ref, o = !!a?.entity_field, s = /* @__PURE__ */ new Map();
23
- function u(e) {
24
- let t = s.get(e);
25
- if (t) return t;
26
- let r = c(i.entities, e), a = i.detailScreen || r?.detail_screen, l = a ? c(i.screens, a) : void 0, u = {
27
- route: o && (!r || l?.entity !== e || l.type !== "detail") ? void 0 : l?.route,
28
- icon: r?.display?.icon,
29
- key: r ? n(r)[0] ?? "id" : "id"
17
+ return a.has(e) && a.set(t, a.get(e)), t;
18
+ }
19
+ function u(e, t) {
20
+ return e && Object.hasOwn(e, t) ? e[t] : void 0;
21
+ }
22
+ function d(e, t) {
23
+ return a.has(e) ? a.get(e) : u(e, "$refs") ?? t;
24
+ }
25
+ function f(e, n, a, o, s) {
26
+ let c = u(u(n, a), s);
27
+ if (!c) return {
28
+ label: s,
29
+ resolved: !1,
30
+ labelled: !1
31
+ };
32
+ let l = u(e.entities, o), d = e.detailScreen || l?.detail_screen, f = d ? u(e.screens, d) : void 0, p = l && f?.entity === o && f.type === "detail" ? f.route : void 0, m = s !== "new" && s !== "." && s !== ".." && !s.includes("%2F") && !!p?.split("/").includes(":id");
33
+ return {
34
+ label: i(e.t, c, t, s),
35
+ resolved: !0,
36
+ labelled: r(e.t, c, t),
37
+ icon: l?.display?.icon,
38
+ href: m ? p.replace(":id", encodeURIComponent(s)) : void 0
39
+ };
40
+ }
41
+ function p(t) {
42
+ let a = t.field.ref, o = !!a?.entity_field, s = /* @__PURE__ */ new Map();
43
+ function c(e) {
44
+ let r = s.get(e);
45
+ if (r) return r;
46
+ let i = u(t.entities, e), a = t.detailScreen || i?.detail_screen, o = {
47
+ route: (a ? u(t.screens, a) : void 0)?.route,
48
+ icon: i?.display?.icon,
49
+ key: i ? n(i)[0] ?? "id" : "id"
30
50
  };
31
- return s.set(e, u), u;
51
+ return s.set(e, o), o;
32
52
  }
33
- return (n, s, d) => {
34
- let f = n == null || n === "" ? "" : e(n), p = a?.entity_field ? c(s, a.entity_field) : a?.entity;
35
- if (!f || typeof p != "string" || !p) return {
36
- label: f || "—",
37
- resolved: !1
38
- };
39
- let m = o ? `${i.fieldName}@${p}` : p, h = c(c(o ? l(s, d) : d, m), f);
40
- if (o && !h) return {
41
- label: f,
42
- resolved: !1
53
+ return (n, s, l) => {
54
+ let p = n == null || n === "" ? "" : e(n), m = a?.entity_field ? u(s, a.entity_field) : a?.entity;
55
+ if (!p || typeof m != "string" || !m) return {
56
+ label: p || "—",
57
+ resolved: !1,
58
+ labelled: !1
43
59
  };
44
- let g = o ? t : i.field.display?.ref_display_field || "$display", _ = h ? r(i.t, h, g, f) : f, v = u(p), y = h ? c(h, v.key) : void 0, b = o || y == null ? f : e(y), x = !o || b !== "new" && b !== "." && b !== ".." && !b.includes("%2F") && v.route?.split("/").includes(":id");
60
+ if (o) return f(t, d(s, l), `${t.fieldName}@${m}`, m, p);
61
+ let h = u(u(l, m), p), g = t.field.display?.ref_display_field || "$display", _ = h ? i(t.t, h, g, p) : p, v = c(m), y = h ? u(h, v.key) : void 0, b = y == null ? p : e(y);
45
62
  return {
46
63
  label: _,
47
64
  resolved: !!h,
65
+ labelled: !!h && r(t.t, h, g),
48
66
  icon: v.icon,
49
- href: x ? v.route?.replace(":id", encodeURIComponent(b)) : void 0
67
+ href: v.route?.replace(":id", encodeURIComponent(b))
50
68
  };
51
69
  };
52
70
  }
53
- export { o as bindRowReferences, s as inheritRowReferences, a as isPolymorphicReferenceBucket, l as referenceBucketsForRow, u as referenceResolver };
71
+ export { s as bindRowReferences, c as bindUnboundRowReferences, f as bucketReference, l as inheritRowReferences, o as isPolymorphicReferenceBucket, d as referenceBucketsForRow, p as referenceResolver };
@@ -0,0 +1,12 @@
1
+ import { isUuid as e } from "./uuid.js";
2
+ // src/lib/short-id.ts
3
+ var t = 8, n = /^(0x)?[0-9a-f]{16,}$/i, r = "sha256:", i = /^[0-9A-HJKMNP-TV-Z]{26}$/;
4
+ function a(a) {
5
+ let o = a.startsWith(r) ? a.slice(7) : a;
6
+ if (e(o) || n.test(o) || i.test(o)) {
7
+ let e = o.startsWith("0x") ? 2 : 0;
8
+ return `${o.slice(0, e + t)}…`;
9
+ }
10
+ return a;
11
+ }
12
+ export { a as shortId };