@declarion/react 0.44.0 → 0.47.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-lib/{DraggableChildrenTable-G4Sw1XAD.js → DraggableChildrenTable-B6KjWkwD.js} +39 -39
- package/dist-lib/{DynamicIcon-DeRpAaXm.js → DynamicIcon-Dc2j-rg_.js} +19 -17
- package/dist-lib/{Grid-CXn-IK3H.js → Grid-OdquWJNX.js} +2 -2
- package/dist-lib/{LayoutRenderer-DX8pFS5A.js → LayoutRenderer-CzAdhjNT.js} +794 -787
- package/dist-lib/{MarkdownRenderer-CreI9x2m.js → MarkdownRenderer-C6bhrAIe.js} +10 -10
- package/dist-lib/{RefreshControl-DFh0-gCb.js → RefreshControl-F9Ib9asP.js} +179 -179
- package/dist-lib/{SmartDetailPage.impl-K6Jj1-9z.js → SmartDetailPage.impl-DdSu3kmW.js} +631 -593
- package/dist-lib/{SmartRecordListPage.impl-DQW_uVfL.js → SmartRecordListPage.impl-SkIp0_Rd.js} +220 -209
- package/dist-lib/api/agents.d.ts +39 -7
- package/dist-lib/components/agents/AgentChatPanel.d.ts +6 -1
- package/dist-lib/components/agents/transcript-runs.d.ts +29 -0
- package/dist-lib/components/file-widgets/host.d.ts +1 -0
- package/dist-lib/components/list/QuickPeek.d.ts +1 -1
- package/dist-lib/components/pages/exportRequest.d.ts +3 -3
- package/dist-lib/components/pages/list/ListFloatbar.d.ts +4 -2
- package/dist-lib/components/pages/list/cardProjection.d.ts +2 -1
- package/dist-lib/components/pages/list/filter-meta.d.ts +22 -8
- package/dist-lib/components/shared/RowActionsKebab.d.ts +3 -2
- package/dist-lib/components/views/ViewSwitcher.d.ts +2 -1
- package/dist-lib/hooks/useAgentConversation.d.ts +7 -19
- package/dist-lib/hooks/useCursorEntityData.d.ts +3 -2
- package/dist-lib/hooks/useFilters.d.ts +1 -0
- package/dist-lib/icons.js +1 -1
- package/dist-lib/index.d.ts +8 -1
- package/dist-lib/index.js +3246 -2984
- package/dist-lib/lib/actions.d.ts +1 -1
- package/dist-lib/lib/anchor.d.ts +37 -0
- package/dist-lib/lib/filter-evaluator.d.ts +16 -0
- package/dist-lib/lib/filters.d.ts +10 -4
- package/dist-lib/lib/messages.d.ts +1 -0
- package/dist-lib/lib/variants.d.ts +7 -0
- package/dist-lib/{registry-r4hiflwC.js → registry-C2VD-5MD.js} +1103 -879
- package/dist-lib/testing.js +10 -10
- package/dist-lib/types/api.d.ts +3 -10
- package/dist-lib/types/schema.d.ts +51 -13
- package/dist-lib/{useCurrentScreen-CpQjVmrT.js → useCurrentScreen-ow4r-nWa.js} +1130 -1054
- package/dist-lib/{useProperties-CULxrNT4.js → useProperties-lEKfzm2X.js} +114 -83
- package/dist-lib/{value-fUHxMV4r.js → value-CXohNH6a.js} +1 -1
- package/dist-lib/vite/index.js +23 -22
- package/package.json +12 -12
|
@@ -170,7 +170,7 @@ export type ResolvedActionLayoutNode = ResolvedActionLeaf | ResolvedActionGroup;
|
|
|
170
170
|
* @param rowSelection All selected rows for bulk context (list_toolbar bulk mode).
|
|
171
171
|
* Pass empty array for non-bulk contexts.
|
|
172
172
|
*/
|
|
173
|
-
export declare function applyRowState(layout: ResolvedActionLayoutNode[], entityActions: Record<string, Action> | undefined, globalActions: Record<string, Action> | undefined, row: Record<string, unknown>, rowSelection: Record<string, unknown>[]): ResolvedActionLayoutNode[];
|
|
173
|
+
export declare function applyRowState(layout: ResolvedActionLayoutNode[], entityActions: Record<string, Action> | undefined, globalActions: Record<string, Action> | undefined, row: Record<string, unknown>, rowSelection: Record<string, unknown>[], allowedActionCodes?: ReadonlySet<string>): ResolvedActionLayoutNode[];
|
|
174
174
|
/**
|
|
175
175
|
* Composes a flat ResolvedActionLayoutNode[] from an entity's actions map,
|
|
176
176
|
* filtered to those that include the given slot in their visibility array,
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The anchor expression, TypeScript side.
|
|
3
|
+
*
|
|
4
|
+
* One grammar for "a moment relative to now", shared with the server
|
|
5
|
+
* (golang/internal/engine/anchor.go + duration.go). The language boundary is
|
|
6
|
+
* the only reason there are two implementations; nothing else may declare a
|
|
7
|
+
* third.
|
|
8
|
+
*
|
|
9
|
+
* now the current instant
|
|
10
|
+
* now+3w three weeks ahead
|
|
11
|
+
* now-1d one day back
|
|
12
|
+
* now+3w-1d the offsets compose, left to right
|
|
13
|
+
*
|
|
14
|
+
* Units are Go's plus `d` (24h) and `w` (7d). Calendar units `y` and `mo` are
|
|
15
|
+
* refused: they have no fixed length, so `1mo` from the 31st has no answer this
|
|
16
|
+
* platform is willing to invent.
|
|
17
|
+
*/
|
|
18
|
+
/**
|
|
19
|
+
* One magnitude, and the running total of an anchor's offsets, may not exceed
|
|
20
|
+
* 100 years. Beyond that the server's arithmetic saturates and `now+N` and
|
|
21
|
+
* `now-N` collapse to the same instant - a predicate written to match nothing
|
|
22
|
+
* matching everything. The client refuses the same inputs so a template that
|
|
23
|
+
* would fail on the server does not silently produce a different moment here.
|
|
24
|
+
*/
|
|
25
|
+
export declare const MAX_DURATION_MAGNITUDE_MS: number;
|
|
26
|
+
/** At most this many signed offsets in one anchor expression. */
|
|
27
|
+
export declare const MAX_ANCHOR_OFFSETS = 8;
|
|
28
|
+
/** Parse one unsigned magnitude (`3w`, `1h30m`). Returns null when invalid. */
|
|
29
|
+
export declare function parseDurationMagnitudeMs(text: string): number | null;
|
|
30
|
+
/**
|
|
31
|
+
* Parse an anchor expression WITHOUT any surface wrapper - `now`, `now+3w`,
|
|
32
|
+
* `now+3w-1d` - and return the summed offset in milliseconds. Returns null when
|
|
33
|
+
* the text is not a valid anchor expression, which the caller surfaces the way
|
|
34
|
+
* it surfaces any unresolved token: by leaving the template visible rather than
|
|
35
|
+
* writing a wrong moment.
|
|
36
|
+
*/
|
|
37
|
+
export declare function parseAnchorOffsetMs(expr: string): number | null;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { FilterNode } from "./filters";
|
|
2
|
+
/** Metadata needed to evaluate a record-only filter condition. */
|
|
3
|
+
export interface FilterRecordField {
|
|
4
|
+
type: "string" | "text" | "rich_text" | "email" | "url" | "phone" | "enum" | "int" | "float" | "decimal" | "date" | "timestamp" | "time" | "bool" | "ref" | "uuid" | (string & {});
|
|
5
|
+
}
|
|
6
|
+
export type FilterRecordFields = Readonly<Record<string, FilterRecordField>>;
|
|
7
|
+
export type FilterRecord = Readonly<Record<string, unknown>>;
|
|
8
|
+
/**
|
|
9
|
+
* Evaluate a loader-validated filter tree against one already-loaded record.
|
|
10
|
+
*
|
|
11
|
+
* This deliberately accepts only the deterministic record subset: it has no
|
|
12
|
+
* caller, clock, relation lookup, or value coercion input. A missing field is
|
|
13
|
+
* the same as null for `is_empty`; every other operator returns false for a
|
|
14
|
+
* missing, null, or empty value.
|
|
15
|
+
*/
|
|
16
|
+
export declare function evaluateFilterTree(nodes: FilterNode[], fields: FilterRecordFields, record: FilterRecord): boolean;
|
|
@@ -4,8 +4,8 @@ export interface FilterNode {
|
|
|
4
4
|
field?: string;
|
|
5
5
|
op?: FilterOp;
|
|
6
6
|
value?: unknown;
|
|
7
|
-
/** OR group:
|
|
8
|
-
or?: FilterNode[]
|
|
7
|
+
/** OR group: child nodes are OR-ed. */
|
|
8
|
+
or?: FilterNode[];
|
|
9
9
|
/** Explicit AND group (rarely needed, top-level is implicit AND) */
|
|
10
10
|
and?: FilterNode[];
|
|
11
11
|
}
|
|
@@ -39,7 +39,13 @@ export declare const NO_VALUE_OPS: Set<FilterOp>;
|
|
|
39
39
|
export declare const MULTI_VALUE_OPS: Set<FilterOp>;
|
|
40
40
|
/** Human-friendly display names for operators. */
|
|
41
41
|
export declare const OP_LABELS: Record<FilterOp, string>;
|
|
42
|
+
export interface FilterURLState {
|
|
43
|
+
filters: FilterNode[];
|
|
44
|
+
error: string | null;
|
|
45
|
+
}
|
|
42
46
|
/** Parse filters from URL search params (JSON `filters` param). */
|
|
47
|
+
export declare function parseFilterURLState(searchParams: URLSearchParams): FilterURLState;
|
|
48
|
+
/** Parse the final tree and reject malformed URL state instead of treating it as no filter. */
|
|
43
49
|
export declare function parseFiltersFromURL(searchParams: URLSearchParams): FilterNode[];
|
|
44
50
|
/** Write filters to URL search params. */
|
|
45
51
|
export declare function setFiltersInURL(filters: FilterNode[], searchParams: URLSearchParams): void;
|
|
@@ -48,7 +54,7 @@ export declare function setFiltersInURL(filters: FilterNode[], searchParams: URL
|
|
|
48
54
|
* Uses the JSON `filters` param for the API request.
|
|
49
55
|
*/
|
|
50
56
|
export declare function filtersToApiParams(filters: FilterNode[]): URLSearchParams;
|
|
51
|
-
/** Check if the filter tree has any OR groups
|
|
57
|
+
/** Check if the filter tree has any OR groups. */
|
|
52
58
|
export declare function hasOrGroups(nodes: FilterNode[]): boolean;
|
|
53
59
|
/** Extract flat field conditions from a FilterNode array (ignoring OR/AND structure). */
|
|
54
60
|
export declare function flatFieldConditions(nodes: FilterNode[]): FilterNode[];
|
|
@@ -67,5 +73,5 @@ export declare function countActiveFilters(nodes: FilterNode[]): number;
|
|
|
67
73
|
export declare function formatFilterChip(node: FilterNode, resolveValue?: FilterValueResolver): string;
|
|
68
74
|
/** Create a simple equality filter node. */
|
|
69
75
|
export declare function eqFilter(field: string, value: string): FilterNode;
|
|
70
|
-
/** Remove a filter node by field name, recursing
|
|
76
|
+
/** Remove a filter node by field name, recursing through the final tree. */
|
|
71
77
|
export declare function removeFilter(nodes: FilterNode[], field: string): FilterNode[];
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { type LocalizedString } from "../types/schema";
|
|
2
2
|
import type { PublicParam } from "../types/api";
|
|
3
|
+
export declare const DEFAULT_LOCALE = "en";
|
|
3
4
|
export type MessageCatalog = Record<string, LocalizedString> | undefined;
|
|
4
5
|
export declare function localizedMessage(messages: MessageCatalog, code: string, locale: string, fallback?: string): string;
|
|
5
6
|
export declare function publicLocale(parameters: PublicParam[] | undefined): string;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type FilterRecord } from "./filter-evaluator";
|
|
2
|
+
import type { Entity, Screen } from "../types/schema";
|
|
3
|
+
export declare function resolveEntityVariantCode(entity: Entity, record: FilterRecord): string | undefined;
|
|
4
|
+
export declare function variantActionCodesForRecord(entity: Entity | undefined, record: FilterRecord): ReadonlySet<string> | undefined;
|
|
5
|
+
export declare function commonVariantActionCodes(entity: Entity | undefined, records: readonly FilterRecord[]): ReadonlySet<string> | undefined;
|
|
6
|
+
export declare function resolveScreenVariantCode(entity: Entity, screen: Screen, record: FilterRecord): string | undefined;
|
|
7
|
+
export declare function effectiveScreenForRecord(entity: Entity | undefined, screen: Screen | undefined, record: FilterRecord): Screen | undefined;
|