@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
package/dist-lib/testing.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Dt as e, Et as t, Ot as n,
|
|
1
|
+
import { Dt as e, Et as t, Ot as n, jt as r, r as i, t as a, tr as o, yt as s } from "./useCurrentScreen-ow4r-nWa.js";
|
|
2
2
|
import { useState as c } from "react";
|
|
3
3
|
import { MemoryRouter as l } from "react-router";
|
|
4
4
|
import { QueryClient as u, QueryClientProvider as d } from "@tanstack/react-query";
|
|
@@ -70,7 +70,7 @@ function S() {
|
|
|
70
70
|
created_at: "2026-01-01T00:00:00Z",
|
|
71
71
|
updated_at: "2026-01-01T00:00:00Z"
|
|
72
72
|
};
|
|
73
|
-
|
|
73
|
+
r.getState().setUser(t, e);
|
|
74
74
|
}
|
|
75
75
|
function C(e) {
|
|
76
76
|
if (e === void 0) return { rows: [] };
|
|
@@ -125,7 +125,7 @@ function w(r) {
|
|
|
125
125
|
});
|
|
126
126
|
}
|
|
127
127
|
function T() {
|
|
128
|
-
n(null), e(null), t(null),
|
|
128
|
+
n(null), e(null), t(null), r.setState({
|
|
129
129
|
user: null,
|
|
130
130
|
isAuthenticated: !1,
|
|
131
131
|
activeTenant: null,
|
|
@@ -138,28 +138,28 @@ function E(e, t = {}) {
|
|
|
138
138
|
gcTime: Infinity
|
|
139
139
|
} } });
|
|
140
140
|
S(), n.setQueryData(["schema", !0], t.schema ?? g()), w(t);
|
|
141
|
-
let
|
|
141
|
+
let r = t.screenCode ? /* @__PURE__ */ p(a, {
|
|
142
142
|
code: t.screenCode,
|
|
143
143
|
children: e
|
|
144
144
|
}) : e, s = /* @__PURE__ */ m(d, {
|
|
145
145
|
client: n,
|
|
146
146
|
children: [/* @__PURE__ */ p(l, {
|
|
147
147
|
initialEntries: [t.route ?? "/"],
|
|
148
|
-
children: /* @__PURE__ */ p(
|
|
148
|
+
children: /* @__PURE__ */ p(i, { children: r })
|
|
149
149
|
}), /* @__PURE__ */ p(f, {})]
|
|
150
|
-
}), c = h(t.viewport ? /* @__PURE__ */ p(
|
|
150
|
+
}), c = h(t.viewport ? /* @__PURE__ */ p(o, {
|
|
151
151
|
viewportOverride: t.viewport,
|
|
152
152
|
children: s
|
|
153
153
|
}) : s);
|
|
154
154
|
return Object.assign(c, { queryClient: n });
|
|
155
155
|
}
|
|
156
156
|
function D({ children: e, authenticated: t = !0, ...n }) {
|
|
157
|
-
let [
|
|
157
|
+
let [a] = c(() => {
|
|
158
158
|
let e = new u({ defaultOptions: { queries: {
|
|
159
159
|
retry: !1,
|
|
160
160
|
gcTime: Infinity
|
|
161
161
|
} } });
|
|
162
|
-
return t ? (S(), e.setQueryData(["schema", !0], n.schema ?? g())) :
|
|
162
|
+
return t ? (S(), e.setQueryData(["schema", !0], n.schema ?? g())) : r.setState({
|
|
163
163
|
user: null,
|
|
164
164
|
isAuthenticated: !1,
|
|
165
165
|
activeTenant: null,
|
|
@@ -167,10 +167,10 @@ function D({ children: e, authenticated: t = !0, ...n }) {
|
|
|
167
167
|
}), w(n), e;
|
|
168
168
|
});
|
|
169
169
|
return /* @__PURE__ */ m(d, {
|
|
170
|
-
client:
|
|
170
|
+
client: a,
|
|
171
171
|
children: [/* @__PURE__ */ p(l, {
|
|
172
172
|
initialEntries: [n.route ?? "/"],
|
|
173
|
-
children: /* @__PURE__ */ p(
|
|
173
|
+
children: /* @__PURE__ */ p(i, { children: e })
|
|
174
174
|
}), /* @__PURE__ */ p(f, {})]
|
|
175
175
|
});
|
|
176
176
|
}
|
package/dist-lib/types/api.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { AccentDef, LocalizedString } from "./schema";
|
|
2
2
|
import type { HydratedFile } from "./files";
|
|
3
|
+
import type { FilterNode } from "../lib/filters";
|
|
3
4
|
export interface ListMeta {
|
|
4
5
|
/**
|
|
5
6
|
* Total matching rows. Present only when the request asked for a count
|
|
@@ -390,7 +391,7 @@ export interface ListParams {
|
|
|
390
391
|
sort?: string;
|
|
391
392
|
search?: string;
|
|
392
393
|
/** JSON filter nodes (recursive AND/OR tree). */
|
|
393
|
-
filters?:
|
|
394
|
+
filters?: FilterNode[];
|
|
394
395
|
include_deleted?: boolean;
|
|
395
396
|
expand?: string[];
|
|
396
397
|
screen?: string;
|
|
@@ -414,14 +415,6 @@ export interface ListParams {
|
|
|
414
415
|
*/
|
|
415
416
|
count?: "window" | "only" | "with" | "exact";
|
|
416
417
|
}
|
|
417
|
-
/** Minimal filter node type for API params (matches backend FilterNode). */
|
|
418
|
-
export interface FilterNodeParam {
|
|
419
|
-
field?: string;
|
|
420
|
-
op?: string;
|
|
421
|
-
value?: unknown;
|
|
422
|
-
or?: FilterNodeParam[][];
|
|
423
|
-
and?: FilterNodeParam[];
|
|
424
|
-
}
|
|
425
418
|
/** Cursor-based pagination metadata returned by v2 List. */
|
|
426
419
|
export interface V2Meta {
|
|
427
420
|
total: number;
|
|
@@ -492,7 +485,7 @@ export interface V2ListParams {
|
|
|
492
485
|
expand?: string[];
|
|
493
486
|
sort?: string;
|
|
494
487
|
search?: string;
|
|
495
|
-
filters?:
|
|
488
|
+
filters?: FilterNode[];
|
|
496
489
|
limit?: number;
|
|
497
490
|
after?: string;
|
|
498
491
|
include_deleted?: boolean;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { OrderedMap } from "./ordmap";
|
|
2
2
|
import type { FileFieldDef } from "./files";
|
|
3
3
|
import type { IconDef } from "../stores/icon-registry";
|
|
4
|
+
import type { FilterNode } from "../lib/filters";
|
|
4
5
|
export { OrderedMap };
|
|
5
6
|
export type { IconDef };
|
|
6
7
|
export type LocalizedString = Record<string, string>;
|
|
@@ -55,15 +56,6 @@ export declare function fieldDisplayName(field: EntityField, fieldName: string,
|
|
|
55
56
|
export interface RefDisplay {
|
|
56
57
|
field: string;
|
|
57
58
|
}
|
|
58
|
-
/** A single declarative filter condition ({field, op, value}). Shared by
|
|
59
|
-
* ViewDefinition.filters (screen views) and RefConfig.options_filter (ref
|
|
60
|
-
* dropdown option narrowing); mirrors engine.ViewFilter. Structurally a subset
|
|
61
|
-
* of the wire FilterNodeParam, so it can feed a list query's `filters`. */
|
|
62
|
-
export interface FilterCondition {
|
|
63
|
-
field: string;
|
|
64
|
-
op: string;
|
|
65
|
-
value?: unknown;
|
|
66
|
-
}
|
|
67
59
|
export interface RefConfig {
|
|
68
60
|
entity: string;
|
|
69
61
|
field?: string;
|
|
@@ -71,9 +63,10 @@ export interface RefConfig {
|
|
|
71
63
|
fields?: string[];
|
|
72
64
|
/** Narrows the option set offered by this ref's entity-select dropdown (edit
|
|
73
65
|
* combobox or action-param picker) to rows matching these conditions - e.g.
|
|
74
|
-
* only `is_active = true`. Read-side only (not a write/security boundary)
|
|
75
|
-
*
|
|
76
|
-
|
|
66
|
+
* only `is_active = true`. Read-side only (not a write/security boundary).
|
|
67
|
+
* The shared filter tree, so a declared narrowing takes the same shapes a
|
|
68
|
+
* list query's `filters` takes. */
|
|
69
|
+
options_filter?: FilterNode[];
|
|
77
70
|
}
|
|
78
71
|
/** One declared filter-only option ({code, label}). `code` is stored into the
|
|
79
72
|
* filter when chosen (a literal or a `$user.*` token resolved server-side);
|
|
@@ -318,6 +311,11 @@ export interface EntityMutations {
|
|
|
318
311
|
delete?: boolean;
|
|
319
312
|
restore?: boolean;
|
|
320
313
|
}
|
|
314
|
+
export interface EntityVariant {
|
|
315
|
+
name?: string;
|
|
316
|
+
when?: FilterNode[];
|
|
317
|
+
actions?: string[];
|
|
318
|
+
}
|
|
321
319
|
/** A set of CRUD op flags, each present or absent. The YAML-decoded shape of
|
|
322
320
|
* an entity's `public` opt-out block (deny-by-default authorization, plan
|
|
323
321
|
* 2026-06-17). A flag being true means that op is open to ALL authenticated
|
|
@@ -368,6 +366,17 @@ export interface Entity {
|
|
|
368
366
|
properties?: Record<string, PropertyDef>;
|
|
369
367
|
search_fields?: string[];
|
|
370
368
|
actions?: Record<string, Action>;
|
|
369
|
+
variants?: OrderedMap<EntityVariant>;
|
|
370
|
+
/**
|
|
371
|
+
* Platform-default action codes the engine must NOT inject for this entity
|
|
372
|
+
* (`__new`, `__edit`, `__create`, ...). Declared in the entity's YAML.
|
|
373
|
+
*
|
|
374
|
+
* A disabled `__new` closes the CREATE ROUTE too, not only the toolbar
|
|
375
|
+
* button: `<list>/new` is the detail route with the literal id `new`, so
|
|
376
|
+
* without this the form the removed button pointed at still rendered for
|
|
377
|
+
* anyone who typed the address or kept a bookmark.
|
|
378
|
+
*/
|
|
379
|
+
disable_defaults?: string[];
|
|
371
380
|
handlers?: Record<string, HandlerDef>;
|
|
372
381
|
associations?: Record<string, AssociationDef>;
|
|
373
382
|
files?: OrderedMap<FileFieldDef>;
|
|
@@ -475,6 +484,7 @@ export interface ExportConfig {
|
|
|
475
484
|
enabled?: boolean;
|
|
476
485
|
}
|
|
477
486
|
export declare function entityAllowsMutation(entity: Pick<Entity, "readonly" | "mutations"> | undefined, op: EntityMutationOp): boolean;
|
|
487
|
+
export declare function entityAllowsCreateRoute(entity: Pick<Entity, "disable_defaults"> | undefined): boolean;
|
|
478
488
|
export declare function getPrimaryKeyFields(entity: Entity): string[];
|
|
479
489
|
export type PkValues = Record<string, string>;
|
|
480
490
|
export declare function extractPkValues(entity: Entity, record: Record<string, unknown>): PkValues;
|
|
@@ -536,6 +546,7 @@ export interface WidgetNode {
|
|
|
536
546
|
export interface LayoutField {
|
|
537
547
|
name: string;
|
|
538
548
|
actions?: Action[];
|
|
549
|
+
structure?: string;
|
|
539
550
|
}
|
|
540
551
|
export interface LayoutNode {
|
|
541
552
|
row?: RowConfig;
|
|
@@ -614,6 +625,20 @@ export interface ScreenResponsiveViewport {
|
|
|
614
625
|
detail?: ResponsiveDetailBranch;
|
|
615
626
|
}
|
|
616
627
|
export type ScreenResponsive = Partial<Record<ViewportKey, ScreenResponsiveViewport>>;
|
|
628
|
+
export interface ScreenVariant {
|
|
629
|
+
name?: string;
|
|
630
|
+
when?: FilterNode[];
|
|
631
|
+
items?: LayoutNode[];
|
|
632
|
+
sidebar?: LayoutNode[];
|
|
633
|
+
sidebar_width?: string;
|
|
634
|
+
highlights?: string[];
|
|
635
|
+
audit?: AuditConfig;
|
|
636
|
+
actions?: string[];
|
|
637
|
+
row_actions?: string[];
|
|
638
|
+
action_layout?: ActionLayoutNode[];
|
|
639
|
+
card?: CardSpec;
|
|
640
|
+
quick_peek?: QuickPeekConfig;
|
|
641
|
+
}
|
|
617
642
|
export interface Screen {
|
|
618
643
|
type: "list" | "detail" | "custom" | "record_list";
|
|
619
644
|
entity?: string;
|
|
@@ -647,6 +672,7 @@ export interface Screen {
|
|
|
647
672
|
sort_default?: string;
|
|
648
673
|
actions?: string[];
|
|
649
674
|
row_actions?: string[];
|
|
675
|
+
variants?: OrderedMap<ScreenVariant>;
|
|
650
676
|
items?: LayoutNode[];
|
|
651
677
|
sidebar?: LayoutNode[];
|
|
652
678
|
sidebar_width?: string;
|
|
@@ -661,7 +687,19 @@ export interface Screen {
|
|
|
661
687
|
* field code. Append/replace/clear the entity field's declared values for
|
|
662
688
|
* just this screen. Mirrors engine.Screen.FilterSpecialValues. */
|
|
663
689
|
filter_special_values?: Record<string, ScreenFilterSpecialValues>;
|
|
690
|
+
/** Per-field operator lists, keyed by filter field code, published by the
|
|
691
|
+
* server from the ONE vocabulary the query builder enforces
|
|
692
|
+
* (engine.OperatorsByFieldType, plus the $status / $property sets). The
|
|
693
|
+
* filter drawer renders exactly these; it keeps no table of its own,
|
|
694
|
+
* because a client-side guess had already diverged - array, multilang,
|
|
695
|
+
* json and bytes fields were offered two operators the builder rejects
|
|
696
|
+
* and denied `contains`, the one that works. */
|
|
697
|
+
filter_operators?: Record<string, string[]>;
|
|
664
698
|
views?: ViewDefinition[];
|
|
699
|
+
/** Code of the view this list OPENS on. A starting point, never a bound: the
|
|
700
|
+
* switcher still offers every other view and the unfiltered "All", and a
|
|
701
|
+
* viewer's own default view wins over it. */
|
|
702
|
+
default_view?: string;
|
|
665
703
|
/** Action slot promotion for list screens (rule-of-2). UI honors first 2.
|
|
666
704
|
* Note: primary_record_actions (detail header) was removed in Task 5 of plan
|
|
667
705
|
* 2026-04-21-action-toolbar-priority-overflow. Use action_layout instead. */
|
|
@@ -720,7 +758,7 @@ export interface ViewDefinition {
|
|
|
720
758
|
name: LocalizedString;
|
|
721
759
|
description?: LocalizedString;
|
|
722
760
|
icon?: string;
|
|
723
|
-
filters?:
|
|
761
|
+
filters?: FilterNode[];
|
|
724
762
|
columns?: string[];
|
|
725
763
|
sort?: string;
|
|
726
764
|
}
|