@declarion/react 0.53.0 → 0.54.1

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 (63) hide show
  1. package/dist-lib/{DraggableChildrenTable-BQZTvZaU.js → DraggableChildrenTable-Djc7QDzR.js} +32 -32
  2. package/dist-lib/{Grid-B9Tiytbd.js → Grid-Bd2r0_4J.js} +45 -45
  3. package/dist-lib/{LayoutRenderer-D_v9OD_A.js → LayoutRenderer-V6nf9aa_.js} +716 -714
  4. package/dist-lib/{ListCardsBody-dRnXsQ7A.js → ListCardsBody-Cdsvu0Vs.js} +29 -29
  5. package/dist-lib/{MarkdownRenderer-BCyrsLrd.js → MarkdownRenderer-CZo5ZgM7.js} +1 -1
  6. package/dist-lib/{RefreshControl-CV8nGACW.js → RefreshControl-CJm3vz9p.js} +40 -40
  7. package/dist-lib/{SmartDetailPage.impl-DWprVNMb.js → SmartDetailPage.impl-DoIjCzjQ.js} +492 -492
  8. package/dist-lib/{SmartListPage.impl-BwWURGwa.js → SmartListPage.impl-DnM8e14t.js} +743 -742
  9. package/dist-lib/{SmartRecordListPage.impl-BKKBShAg.js → SmartRecordListPage.impl-BmHGYbD9.js} +128 -128
  10. package/dist-lib/{SortHeaderMenu-pgi4sxMs.js → SortHeaderMenu-CA53NerB.js} +1 -1
  11. package/dist-lib/{action-dispatch-DlHTYag7.js → action-dispatch-JcUrLFaW.js} +177 -177
  12. package/dist-lib/api/agents.d.ts +0 -1
  13. package/dist-lib/api/events.d.ts +13 -4
  14. package/dist-lib/{cardProjection-C7Orz841.js → cardProjection-Q2kwqv8V.js} +19 -19
  15. package/dist-lib/components/actions/ObjectActionBar.d.ts +1 -1
  16. package/dist-lib/components/chrome/Breadcrumbs.d.ts +1 -1
  17. package/dist-lib/components/detail-layout/DetailAuditStrip.d.ts +1 -1
  18. package/dist-lib/components/detail-layout/DetailHighlights.d.ts +1 -1
  19. package/dist-lib/components/detail-layout/DraggableChildrenTable.d.ts +1 -1
  20. package/dist-lib/components/detail-layout/EditableChildrenTable.d.ts +1 -1
  21. package/dist-lib/components/detail-layout/LayoutRenderer.d.ts +1 -1
  22. package/dist-lib/components/file-widgets/host.d.ts +1 -1
  23. package/dist-lib/components/layout/Layout.d.ts +1 -1
  24. package/dist-lib/components/layout/TopBar.d.ts +1 -1
  25. package/dist-lib/components/list/InlineEditCell.d.ts +1 -1
  26. package/dist-lib/components/list/PeekFieldCell.d.ts +1 -1
  27. package/dist-lib/components/list/QuickPeek.d.ts +1 -1
  28. package/dist-lib/components/pages/auth/AuthShell.d.ts +1 -1
  29. package/dist-lib/components/pages/list/ListCardRow.d.ts +1 -1
  30. package/dist-lib/components/pages/list/ListCardsBody.d.ts +1 -1
  31. package/dist-lib/components/pages/list/ListFloatbar.d.ts +1 -1
  32. package/dist-lib/components/pages/list/ListHeader.d.ts +1 -1
  33. package/dist-lib/components/pages/list/ListToolbar.d.ts +5 -3
  34. package/dist-lib/components/pages/list/columns.d.ts +1 -1
  35. package/dist-lib/components/pages/list/filter-meta.d.ts +1 -1
  36. package/dist-lib/components/pages/list/use-filter-value-labels.d.ts +1 -1
  37. package/dist-lib/components/pages/list/useListQuery.d.ts +1 -5
  38. package/dist-lib/components/pages/list/useListRowInteraction.d.ts +1 -1
  39. package/dist-lib/components/pages/list/useListViews.d.ts +1 -1
  40. package/dist-lib/components/pages/list/useRowMenu.d.ts +1 -1
  41. package/dist-lib/{field-classification-EY8CFF3P.js → field-classification-ssZvtr8J.js} +268 -397
  42. package/dist-lib/{format-count-BHkaDr9V.js → format-count-DHuivNT7.js} +236 -236
  43. package/dist-lib/hooks/useEntityData.d.ts +7 -0
  44. package/dist-lib/hooks/useRealtimeThresholds.d.ts +1 -0
  45. package/dist-lib/hooks/useSSE.d.ts +0 -1
  46. package/dist-lib/index.js +1039 -1020
  47. package/dist-lib/lib/action-dispatch.d.ts +1 -1
  48. package/dist-lib/lib/realtime-query-keys.d.ts +22 -0
  49. package/dist-lib/lib/realtime-reconcile.d.ts +0 -9
  50. package/dist-lib/lib/realtime-resync.d.ts +23 -0
  51. package/dist-lib/{peekDraftStore-1pIajluX.js → peekDraftStore-lm9ViVLA.js} +17 -17
  52. package/dist-lib/{registry-C5ug25M8.js → registry-DsQFhEAD.js} +511 -511
  53. package/dist-lib/stores/realtime.d.ts +86 -19
  54. package/dist-lib/testing.js +40 -40
  55. package/dist-lib/types/api.d.ts +8 -4
  56. package/dist-lib/types/schema.d.ts +6 -0
  57. package/dist-lib/{useCurrentScreen-BdnZq8vZ.js → useCurrentScreen-aHx9HH1m.js} +2473 -1960
  58. package/dist-lib/useListQuery-DZn2BAxY.js +96 -0
  59. package/dist-lib/{useProperties-Bhi9Wn5O.js → useProperties-CAqKmUKg.js} +25 -25
  60. package/dist-lib/{useTabSearchMirror-Dl5x0xKu.js → useTabSearchMirror-DYW9WoK7.js} +10 -10
  61. package/dist-lib/{value-Rp-5W3o8.js → value-CzKQPJOp.js} +4 -4
  62. package/package.json +10 -10
  63. package/dist-lib/useListQuery-BxgrPZIB.js +0 -90
@@ -110,7 +110,6 @@ export interface AgentConversation {
110
110
  in?: number;
111
111
  out?: number;
112
112
  cached_in?: number;
113
- cost_cents?: number;
114
113
  };
115
114
  }
116
115
  export interface AvailableAgent {
@@ -29,15 +29,19 @@ export type SSEEvent = {
29
29
  } | {
30
30
  type: "replay_complete";
31
31
  seq?: number;
32
+ } | {
33
+ type: "snapshot_complete";
34
+ known: boolean;
35
+ asOf?: number;
36
+ } | {
37
+ type: "realtime_streaming";
38
+ eventID?: string;
39
+ degraded: string[];
32
40
  } | {
33
41
  type: "realtime_degraded";
34
42
  eventID?: string;
35
43
  entity: string;
36
44
  degradedSeq?: number;
37
- } | {
38
- type: "realtime_restored";
39
- eventID?: string;
40
- restoredSeq?: number;
41
45
  } | {
42
46
  type: "cache_reset";
43
47
  eventID?: string;
@@ -78,5 +82,10 @@ export interface StreamEventsOptions {
78
82
  * header, so a sent cookie would bypass the scoped embed token.
79
83
  */
80
84
  credentials?: RequestCredentials;
85
+ /**
86
+ * Called for every chunk read from the stream, heartbeat comments included:
87
+ * what proves the connection is still alive on a tenant with nothing to say.
88
+ */
89
+ onActivity?: () => void;
81
90
  }
82
91
  export declare function streamEvents(options?: StreamEventsOptions): AsyncGenerator<SSEEvent>;
@@ -1,5 +1,5 @@
1
- import { Xn as e, f as t, gt as n, ht as r } from "./useCurrentScreen-BdnZq8vZ.js";
2
- import { d as i, f as a, u as o } from "./action-dispatch-DlHTYag7.js";
1
+ import { h as e, mt as t, pt as n, tr as r } from "./useCurrentScreen-aHx9HH1m.js";
2
+ import { d as i, f as a, u as o } from "./action-dispatch-JcUrLFaW.js";
3
3
  import { Fragment as s, jsx as c, jsxs as l } from "react/jsx-runtime";
4
4
  //#region src/components/file-widgets/payload.ts
5
5
  function u(e) {
@@ -75,9 +75,9 @@ function v(e) {
75
75
  for (let n of Object.values(e)) for (let e of n.set ?? []) t.push(e.file_id);
76
76
  return t;
77
77
  }
78
- function y(e, t) {
78
+ function y(e, r) {
79
79
  if (e.mode !== "rich_text_inline") return { clear: !0 };
80
- let i = r(n(t));
80
+ let i = n(t(r));
81
81
  return i.length === 0 ? { clear: !0 } : { set: i.map((e, t) => ({
82
82
  file_id: e,
83
83
  position: t
@@ -474,17 +474,17 @@ function K(e, t) {
474
474
  let n = Q(e, t);
475
475
  return n.kind === "file" ? n.file.mode !== "single" : n.kind === "field" && re.has(n.field.type);
476
476
  }
477
- function se(t, n) {
478
- if (!t) return [];
479
- let r = new $();
480
- for (let i of e(t)) r.add(i), n.addField(i, "identity");
481
- let i = L(t, t.display.display_field, { explicit: !0 });
482
- i && (r.add(i), n.addField(i, "display"), Z(t, i, n, "display"));
483
- for (let e of ce(t.display.display_template)) {
484
- let i = L(t, e, { explicit: !0 });
485
- i && (r.add(i), n.addField(i, "display_template"), Z(t, i, n, "display_template"));
477
+ function se(e, t) {
478
+ if (!e) return [];
479
+ let n = new $();
480
+ for (let i of r(e)) n.add(i), t.addField(i, "identity");
481
+ let i = L(e, e.display.display_field, { explicit: !0 });
482
+ i && (n.add(i), t.addField(i, "display"), Z(e, i, t, "display"));
483
+ for (let r of ce(e.display.display_template)) {
484
+ let i = L(e, r, { explicit: !0 });
485
+ i && (n.add(i), t.addField(i, "display_template"), Z(e, i, t, "display_template"));
486
486
  }
487
- return r.values();
487
+ return n.values();
488
488
  }
489
489
  function ce(e) {
490
490
  if (!e) return [];
@@ -548,11 +548,11 @@ function de(e, t, n) {
548
548
  }
549
549
  return r.values();
550
550
  }
551
- function fe(e, n, r) {
552
- let i = typeof n == "string" ? t(n) : n ?? [], a = new $();
553
- for (let t of i) {
554
- let n = L(e, t.field, { explicit: !0 });
555
- n && (a.add(n), r.addField(n, "sort"), Z(e, n, r, "sort"));
551
+ function fe(t, n, r) {
552
+ let i = typeof n == "string" ? e(n) : n ?? [], a = new $();
553
+ for (let e of i) {
554
+ let n = L(t, e.field, { explicit: !0 });
555
+ n && (a.add(n), r.addField(n, "sort"), Z(t, n, r, "sort"));
556
556
  }
557
557
  return a.values();
558
558
  }
@@ -1,7 +1,7 @@
1
1
  import { type ReactNode } from "react";
2
2
  import { type ResolvedActionLayoutNode } from "../../lib/actions";
3
3
  import { type Action } from "../../types/schema";
4
- import { type WidgetContext } from "../../components/actions/ResponsiveActionBar";
4
+ import { type WidgetContext } from "./ResponsiveActionBar";
5
5
  export type ObjectActionBarSlot = "detail" | "detail_toolbar" | "list_row" | "quick_peek";
6
6
  export type ObjectActionSelection = {
7
7
  include: string[];
@@ -1,4 +1,4 @@
1
- import { type IconName } from "../../components/primitives";
1
+ import { type IconName } from "../primitives";
2
2
  export interface Crumb {
3
3
  label: string;
4
4
  icon?: IconName | (string & {});
@@ -1,5 +1,5 @@
1
1
  import type { Entity, Schema, Screen } from "../../types/schema";
2
- import type { Refs } from "../../components/fields";
2
+ import type { Refs } from "../fields";
3
3
  interface DetailAuditStripProps {
4
4
  screen: Screen;
5
5
  entity: Entity;
@@ -1,6 +1,6 @@
1
1
  import type { Entity, Schema, Screen } from "../../types/schema";
2
2
  import type { StatusInfo } from "../../types/api";
3
- import type { Refs } from "../../components/fields";
3
+ import type { Refs } from "../fields";
4
4
  interface DetailHighlightsProps {
5
5
  screen: Screen;
6
6
  entity: Entity;
@@ -1,5 +1,5 @@
1
1
  import type { Entity, Schema } from "../../types/schema";
2
- import type { Refs } from "../../components/fields";
2
+ import type { Refs } from "../fields";
3
3
  import type { PendingChildRow } from "./LayoutRenderer";
4
4
  import type { ResolvedChildConfig } from "../../lib/child-config";
5
5
  interface DraggableChildrenTableProps {
@@ -1,5 +1,5 @@
1
1
  import type { Entity, Schema } from "../../types/schema";
2
- import type { Refs } from "../../components/fields";
2
+ import type { Refs } from "../fields";
3
3
  import type { PendingChildRow } from "./LayoutRenderer";
4
4
  import type { ResolvedChildConfig } from "../../lib/child-config";
5
5
  interface EditableChildrenTableProps {
@@ -1,6 +1,6 @@
1
1
  import type { Entity, LayoutNode, Schema } from "../../types/schema";
2
2
  import type { StatusInfo, PropertyValue } from "../../types/api";
3
- import type { Refs } from "../../components/fields";
3
+ import type { Refs } from "../fields";
4
4
  export interface PendingChildRow {
5
5
  _key: string;
6
6
  _deleted?: boolean;
@@ -1,7 +1,7 @@
1
1
  import type { ReactNode } from "react";
2
2
  import type { Entity, Screen } from "../../types/schema";
3
3
  import type { FileFieldDef, FileFieldValue } from "../../types/files";
4
- import type { Refs } from "../../components/fields";
4
+ import type { Refs } from "../fields";
5
5
  export declare function getEntityFileField(entity: Pick<Entity, "files">, fieldName: string): FileFieldDef | undefined;
6
6
  export declare function getFileFieldValue(record: Record<string, unknown>, fieldName: string): FileFieldValue;
7
7
  export declare function getSchemaFieldValue(entity: Pick<Entity, "fields" | "files">, record: Record<string, unknown>, fieldName: string): unknown;
@@ -1,5 +1,5 @@
1
1
  import { useTabStore } from "../../stores/tabs";
2
2
  import { type NavNode, type Screen } from "../../types/schema";
3
- import type { Crumb } from "../../components/chrome/Breadcrumbs";
3
+ import type { Crumb } from "../chrome/Breadcrumbs";
4
4
  export declare function Layout(): import("react").JSX.Element | null;
5
5
  export declare function buildCrumbs(nodes: NavNode[], screens: Record<string, Screen>, pathname: string, tabs: ReturnType<typeof useTabStore.getState>["tabs"], activeTabId: string | null, topLevelNavigate: (to: string) => void): Crumb[];
@@ -1,5 +1,5 @@
1
1
  import { type RefObject } from "react";
2
- import { type Crumb } from "../../components/chrome/Breadcrumbs";
2
+ import { type Crumb } from "../chrome/Breadcrumbs";
3
3
  export interface TopBarProps {
4
4
  breadcrumbs?: Crumb[];
5
5
  onCrumbClick?: (c: Crumb) => void;
@@ -1,4 +1,4 @@
1
- import { type SelectOption } from "../../components/primitives";
1
+ import { type SelectOption } from "../primitives";
2
2
  export type InlineEditTrigger = "dblclick" | "enter" | "always";
3
3
  export type InlineEditKind = "text" | "select" | "bool";
4
4
  export interface InlineEditCellProps {
@@ -1,4 +1,4 @@
1
- import { type Refs } from "../../components/fields";
1
+ import { type Refs } from "../fields";
2
2
  import type { EntityField } from "../../types/schema";
3
3
  export interface PeekFieldCellProps {
4
4
  field: EntityField;
@@ -1,6 +1,6 @@
1
1
  import { type ReactNode } from "react";
2
2
  import { type Action, type Entity, type EntityField, type Screen } from "../../types/schema";
3
- import type { Refs } from "../../components/fields";
3
+ import type { Refs } from "../fields";
4
4
  import { type ResolvedActionLayoutNode } from "../../lib/actions";
5
5
  export interface QuickPeekRegularFieldSpec {
6
6
  key: string;
@@ -1,5 +1,5 @@
1
1
  import { type ReactNode } from "react";
2
- import { Icon } from "../../../components/primitives/Icons";
2
+ import { Icon } from "../../primitives/Icons";
3
3
  export type AuthShellProps = {
4
4
  children: ReactNode;
5
5
  /**
@@ -1,7 +1,7 @@
1
1
  import type { ListRow } from "./table-features";
2
2
  import type { ListResponse, RowData } from "../../../types/api";
3
3
  import { type Action, type Entity, type Screen } from "../../../types/schema";
4
- import type { resolveCellRenderer } from "../../../components/fields/cells/registry";
4
+ import type { resolveCellRenderer } from "../../fields/cells/registry";
5
5
  import type { RowInteraction } from "./useListRowInteraction";
6
6
  type CellRenderer = ReturnType<typeof resolveCellRenderer>;
7
7
  interface ListCardRowProps {
@@ -1,7 +1,7 @@
1
1
  import type { ListRow } from "./table-features";
2
2
  import type { Virtualizer } from "@tanstack/react-virtual";
3
3
  import type { ListResponse, RowData } from "../../../types/api";
4
- import type { resolveCellRenderer } from "../../../components/fields/cells/registry";
4
+ import type { resolveCellRenderer } from "../../fields/cells/registry";
5
5
  import type { Action, Entity, Screen } from "../../../types/schema";
6
6
  import type { RowInteraction } from "./useListRowInteraction";
7
7
  interface ListCardsBodyProps {
@@ -1,5 +1,5 @@
1
1
  import { type ResolvedActionLayoutNode } from "../../../lib/actions";
2
- import { type WidgetContext } from "../../../components/actions/ResponsiveActionBar";
2
+ import { type WidgetContext } from "../../actions/ResponsiveActionBar";
3
3
  import type { Action, Entity, Screen } from "../../../types/schema";
4
4
  export interface ListFloatbarProps {
5
5
  selectedIds: string[];
@@ -1,5 +1,5 @@
1
1
  import { type ResolvedActionLayoutNode } from "../../../lib/actions";
2
- import { type WidgetContext } from "../../../components/actions/ResponsiveActionBar";
2
+ import { type WidgetContext } from "../../actions/ResponsiveActionBar";
3
3
  import type { Action } from "../../../types/schema";
4
4
  export interface ListHeaderProps {
5
5
  title: string;
@@ -35,9 +35,11 @@ interface ListToolbarProps {
35
35
  includeDeleted: boolean;
36
36
  canViewDeleted: boolean;
37
37
  onToggleDeleted: () => void;
38
- /** The entity auto-updates from the CDC relay, so the refresh control shows
39
- * the Live indicator instead of the button alone. */
38
+ /** The entity is declared `realtime: true`, so the refresh control carries
39
+ * the indicator in every state. */
40
+ realtime: boolean;
41
+ /** The screen is current - useScreenIsLive. */
40
42
  isLive: boolean;
41
43
  }
42
- export declare function ListToolbar({ screen, entity, entityCode, schema, screenCode, screenName, locale, isPhone, isCardsPresentation, sort, columns, views, query, selection, filters, searchValue, onSearchChange, onSaveView, page, perPage, includeDeleted, canViewDeleted, onToggleDeleted, isLive, }: ListToolbarProps): import("react").JSX.Element;
44
+ export declare function ListToolbar({ screen, entity, entityCode, schema, screenCode, screenName, locale, isPhone, isCardsPresentation, sort, columns, views, query, selection, filters, searchValue, onSearchChange, onSaveView, page, perPage, includeDeleted, canViewDeleted, onToggleDeleted, realtime, isLive, }: ListToolbarProps): import("react").JSX.Element;
43
45
  export {};
@@ -1,6 +1,6 @@
1
1
  import { type RefObject } from "react";
2
2
  import type { ListColumnDef } from "./table-features";
3
- import { type Refs } from "../../../components/fields/cells/registry";
3
+ import { type Refs } from "../../fields/cells/registry";
4
4
  import type { Action, Entity, Screen } from "../../../types/schema";
5
5
  import type { RowData } from "../../../types/api";
6
6
  type SchemaMaps = {
@@ -1,5 +1,5 @@
1
1
  import type { Entity, Screen, ScreenFilterSpecialValues } from "../../../types/schema";
2
- import type { FilterFieldMeta } from "../../../components/filters/FilterDrawer";
2
+ import type { FilterFieldMeta } from "../../filters/FilterDrawer";
3
3
  /**
4
4
  * Build FilterFieldMeta array from screen + entity for the FilterDrawer.
5
5
  *
@@ -1,6 +1,6 @@
1
1
  import { type FilterNode, type FilterValueResolver } from "../../../lib/filters";
2
2
  import type { Entity } from "../../../types/schema";
3
- import type { FilterFieldMeta } from "../../../components/filters/FilterDrawer";
3
+ import type { FilterFieldMeta } from "../../filters/FilterDrawer";
4
4
  import type { Refs } from "../../../types/api";
5
5
  /**
6
6
  * useFilterValueLabels - the single source of human labels for stored filter
@@ -39,11 +39,7 @@ export interface ListQueryResult {
39
39
  error: unknown;
40
40
  /** True while a load has been running long enough to be worth saying so. */
41
41
  isLoadingStale: boolean;
42
- /**
43
- * Cancels this query's in-flight fetch and refetches it, resolving when both
44
- * have settled - in that order. Returning nothing made every completion-based
45
- * state silently instant, so a control that waited on it never waited.
46
- */
42
+ /** Refetches this list's window and count, resolving when both have settled. */
47
43
  retry: () => Promise<void>;
48
44
  /** The total, and how it was produced. Undefined while the count is in flight
49
45
  * or after it failed - a caller degrades to the loaded row count. */
@@ -1,5 +1,5 @@
1
1
  import type { MouseEvent as ReactMouseEvent } from "react";
2
- import type { QuickPeekFieldSpec } from "../../../components/list/QuickPeek";
2
+ import type { QuickPeekFieldSpec } from "../../list/QuickPeek";
3
3
  import { useLongPress } from "../../../hooks/useLongPress";
4
4
  import type { RowData } from "../../../types/api";
5
5
  import { type Action, type Entity, type Screen } from "../../../types/schema";
@@ -1,6 +1,6 @@
1
1
  import type { FilterNode } from "../../../lib/filters";
2
2
  import { type Screen } from "../../../types/schema";
3
- import type { ViewItem } from "../../../components/list/ViewSwitcher";
3
+ import type { ViewItem } from "../../list/ViewSwitcher";
4
4
  interface ListViewsInput {
5
5
  screenCode: string;
6
6
  screen: Screen | undefined;
@@ -1,5 +1,5 @@
1
1
  import { type ResolvedActionLayoutNode } from "../../../lib/actions";
2
- import type { ActionRunHandler, WidgetContext } from "../../../components/actions/ResponsiveActionBar";
2
+ import type { ActionRunHandler, WidgetContext } from "../../actions/ResponsiveActionBar";
3
3
  import type { Action, Entity, Screen } from "../../../types/schema";
4
4
  export interface UseRowMenuArgs {
5
5
  row: Record<string, unknown>;