@declarion/react 0.56.0 → 0.59.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/README.md +0 -2
- package/dist-lib/AgentChatPanel.impl-DBH1Ff4G.js +1200 -0
- package/dist-lib/DetailAuditStrip-GNRA_eP5.js +289 -0
- package/dist-lib/{DraggableChildrenTable-BV5sb8Uo.js → DraggableChildrenTable-4RZC351U.js} +87 -86
- package/dist-lib/Grid-CQabaBLx.js +405 -0
- package/dist-lib/{LayoutRenderer-C9AH9cXf.js → LayoutRenderer-DGKWZKpW.js} +1000 -1114
- package/dist-lib/{ListCardsBody-DXcDg536.js → ListCardsBody-DfGmyNIu.js} +84 -84
- package/dist-lib/MarkdownRenderer-BDbzDv_y.js +87 -0
- package/dist-lib/{RefreshControl-CNtN8zSl.js → RefreshControl-Bhoib0ZA.js} +126 -155
- package/dist-lib/SmartDetailPage.impl-Ds2RGg6K.js +1565 -0
- package/dist-lib/SmartListPage.impl-BrZLE_Gb.js +3046 -0
- package/dist-lib/{SmartRecordListPage.impl-Bkl9aZJ8.js → SmartRecordListPage.impl-C1FJLr80.js} +281 -280
- package/dist-lib/SortHeaderMenu-Cijxk4cX.js +107 -0
- package/dist-lib/action-dispatch-DY0c8U81.js +1967 -0
- package/dist-lib/api/client.d.ts +5 -0
- package/dist-lib/api/data.d.ts +2 -4
- package/dist-lib/api/entities.d.ts +8 -15
- package/dist-lib/api/events.d.ts +3 -3
- package/dist-lib/cardProjection-Bkl2SSYz.js +499 -0
- package/dist-lib/components/actions/ResponsiveActionBar.d.ts +17 -16
- package/dist-lib/components/agents/AgentChatPanel.d.ts +3 -13
- package/dist-lib/components/agents/AgentChatPanel.impl.d.ts +14 -0
- package/dist-lib/components/agents/AgentPicker.d.ts +1 -2
- package/dist-lib/components/chrome/PageShell.d.ts +7 -0
- package/dist-lib/components/chrome/RecordHeader.d.ts +1 -2
- package/dist-lib/components/detail-layout/ChildrenBlock.d.ts +1 -1
- package/dist-lib/components/detail-layout/DetailAuditStrip.d.ts +1 -2
- package/dist-lib/components/detail-layout/DetailHighlights.d.ts +1 -2
- package/dist-lib/components/detail-layout/blockMeta.d.ts +2 -1
- package/dist-lib/components/fields/BoolField.d.ts +1 -1
- package/dist-lib/components/fields/EnumField.d.ts +1 -1
- package/dist-lib/components/fields/IntArrayField.d.ts +1 -1
- package/dist-lib/components/fields/MultilangArrayField.d.ts +2 -0
- package/dist-lib/components/fields/MultilangField.d.ts +1 -1
- package/dist-lib/components/fields/MultilangTextField.d.ts +1 -1
- package/dist-lib/components/fields/NumberField.d.ts +1 -1
- package/dist-lib/components/fields/PasswordField.d.ts +1 -1
- package/dist-lib/components/fields/RefCombobox.d.ts +1 -1
- package/dist-lib/components/fields/SecretField.d.ts +1 -1
- package/dist-lib/components/fields/StringArrayField.d.ts +1 -1
- package/dist-lib/components/fields/TimestampField.d.ts +1 -1
- package/dist-lib/components/fields/cells/registry.d.ts +2 -1
- package/dist-lib/components/fields/index.d.ts +2 -1
- package/dist-lib/components/fields/langMap.d.ts +2 -0
- package/dist-lib/components/fields/secretValue.d.ts +2 -0
- package/dist-lib/components/file-widgets/UnknownFileWidget.d.ts +3 -0
- package/dist-lib/components/file-widgets/UploadFailureText.d.ts +4 -0
- package/dist-lib/components/file-widgets/helpers.d.ts +1 -1
- package/dist-lib/components/file-widgets/host.d.ts +4 -3
- package/dist-lib/components/file-widgets/types.d.ts +1 -0
- package/dist-lib/components/file-widgets/upload.d.ts +18 -3
- package/dist-lib/components/filters/filter-op-label.d.ts +3 -0
- package/dist-lib/components/layout/ImpersonationBanner.d.ts +1 -1
- package/dist-lib/components/layout/ImpersonationFrame.d.ts +1 -1
- package/dist-lib/components/layout/Layout.d.ts +2 -1
- package/dist-lib/components/layout/Sidebar.d.ts +2 -1
- package/dist-lib/components/layout/TenantChip.d.ts +1 -1
- package/dist-lib/components/list/ViewSwitcher.d.ts +4 -2
- package/dist-lib/components/pages/DocumentsMenu.d.ts +1 -2
- package/dist-lib/components/pages/ExportMenu.d.ts +3 -5
- package/dist-lib/components/pages/RecordDocumentsPanel.d.ts +1 -2
- package/dist-lib/components/pages/auth/AuthShell.d.ts +4 -31
- package/dist-lib/components/pages/exportRequest.d.ts +4 -6
- package/dist-lib/components/pages/list/DeleteViewDialog.d.ts +8 -0
- package/dist-lib/components/pages/list/ListCardRow.d.ts +1 -2
- package/dist-lib/components/pages/list/ListCardsBody.d.ts +0 -1
- package/dist-lib/components/pages/list/ListFloatbar.d.ts +2 -2
- package/dist-lib/components/pages/list/ListHeader.d.ts +2 -2
- package/dist-lib/components/pages/list/ListNoRows.d.ts +4 -5
- package/dist-lib/components/pages/list/ListToolbar.d.ts +3 -2
- package/dist-lib/components/pages/list/ListUrlBanner.d.ts +10 -0
- package/dist-lib/components/pages/list/RowActionsCell.d.ts +2 -4
- package/dist-lib/components/pages/list/RowContextMenu.d.ts +1 -2
- package/dist-lib/components/pages/list/columns.d.ts +2 -1
- package/dist-lib/components/pages/list/filter-meta.d.ts +2 -1
- package/dist-lib/components/pages/list/useActiveView.d.ts +38 -0
- package/dist-lib/components/pages/list/useListColumnLayout.d.ts +6 -5
- package/dist-lib/components/pages/list/useListQuery.d.ts +4 -4
- package/dist-lib/components/pages/list/useListSort.d.ts +5 -4
- package/dist-lib/components/pages/list/useListViews.d.ts +18 -8
- package/dist-lib/components/pages/list/useRowMenu.d.ts +2 -3
- package/dist-lib/components/pages/profile/Profile.d.ts +3 -0
- package/dist-lib/components/params/ParamsBlock.d.ts +1 -13
- package/dist-lib/components/params/param-editors.d.ts +3 -11
- package/dist-lib/components/primitives/ClassifiedFieldLocked.d.ts +1 -2
- package/dist-lib/components/shared/DynamicIcon.d.ts +2 -2
- package/dist-lib/components/shared/ErrorBoundary.d.ts +1 -1
- package/dist-lib/components/shared/LoadingSkeleton.d.ts +1 -0
- package/dist-lib/components/shared/LucideIcon.d.ts +1 -1
- package/dist-lib/components/shared/useOwnRefresh.d.ts +1 -1
- package/dist-lib/declarion-react.css +1 -1
- package/dist-lib/embed/theme.d.ts +1 -1
- package/dist-lib/embed/useEmbedNavigate.d.ts +1 -1
- package/dist-lib/failure-v-uGSpbX.js +158 -0
- package/dist-lib/{field-classification-D6xQYn-h.js → field-classification-C28XE-_P.js} +514 -307
- package/dist-lib/format-count-DA4wmmWR.js +1771 -0
- package/dist-lib/hooks/useEntityData.d.ts +1 -1
- package/dist-lib/hooks/useFilters.d.ts +7 -5
- package/dist-lib/hooks/useLanguage.d.ts +4 -0
- package/dist-lib/hooks/useParams.d.ts +4 -51
- package/dist-lib/hooks/useRegisterScreenTab.d.ts +1 -1
- package/dist-lib/hooks/useSSE.d.ts +3 -3
- package/dist-lib/hooks/useTabTitle.d.ts +2 -0
- package/dist-lib/hooks/useText.d.ts +3 -3
- package/dist-lib/hooks/useVersionWatcher.d.ts +1 -1
- package/dist-lib/hooks/useViews.d.ts +20 -0
- package/dist-lib/index.d.ts +8 -7
- package/dist-lib/index.js +2716 -5795
- package/dist-lib/lib/action-dispatch.d.ts +2 -1
- package/dist-lib/lib/actions.d.ts +30 -42
- package/dist-lib/lib/anchor.d.ts +3 -4
- package/dist-lib/lib/decimal-text.d.ts +1 -0
- package/dist-lib/lib/document-templates.d.ts +1 -2
- package/dist-lib/lib/download.d.ts +2 -1
- package/dist-lib/lib/evidence-verdict.d.ts +2 -1
- package/dist-lib/lib/failure.d.ts +2 -0
- package/dist-lib/lib/field-classification.d.ts +3 -3
- package/dist-lib/lib/filters.d.ts +18 -2
- package/dist-lib/lib/format-count.d.ts +8 -7
- package/dist-lib/lib/language.d.ts +19 -0
- package/dist-lib/lib/mass-edit.d.ts +2 -1
- package/dist-lib/lib/realtime-query-keys.d.ts +1 -1
- package/dist-lib/lib/realtime-reconcile.d.ts +3 -4
- package/dist-lib/lib/screen-back.d.ts +4 -6
- package/dist-lib/lib/sort.d.ts +9 -9
- package/dist-lib/lib/timestamp.d.ts +5 -7
- package/dist-lib/lib/ui-actions.d.ts +2 -1
- package/dist-lib/peekDraftStore-D-cTbiIr.js +199 -0
- package/dist-lib/registry-Cb3W-czW.js +1950 -0
- package/dist-lib/safe-url-oSJw5pzO.js +34 -0
- package/dist-lib/stores/icon-registry.d.ts +2 -2
- package/dist-lib/stores/list-layout.d.ts +3 -4
- package/dist-lib/stores/realtime.d.ts +1 -1
- package/dist-lib/stores/tabs.d.ts +3 -2
- package/dist-lib/testing.d.ts +6 -0
- package/dist-lib/testing.js +98 -76
- package/dist-lib/types/api.d.ts +7 -8
- package/dist-lib/types/fieldType.d.ts +1 -1
- package/dist-lib/types/files.d.ts +4 -4
- package/dist-lib/types/schema.d.ts +44 -50
- package/dist-lib/useAgentConversation-D97IqE-J.js +623 -0
- package/dist-lib/{useCurrentScreen-CzwzQpoW.js → useCurrentScreen-BL5NZFCw.js} +2777 -3768
- package/dist-lib/useListQuery-BG1GyKtJ.js +103 -0
- package/dist-lib/useProperties-4Lg3odrt.js +83 -0
- package/dist-lib/{useTabSearchMirror-C39U85cg.js → useTabSearchMirror-ZVLlINBX.js} +49 -51
- package/dist-lib/useText-BFDCTUSo.js +952 -0
- package/dist-lib/{value-Bo8C8WMU.js → value-By1-WJ8J.js} +74 -76
- package/dist-lib/vite/fingerprint-plugin.d.ts +2 -3
- package/package.json +13 -12
- package/dist-lib/Grid-DWgUPuZ3.js +0 -404
- package/dist-lib/MarkdownRenderer-CcSFc2N3.js +0 -85
- package/dist-lib/RecordIdBadge-CGxPR-8q.js +0 -24
- package/dist-lib/SmartDetailPage.impl-lskCd-WG.js +0 -1846
- package/dist-lib/SmartListPage.impl-CrGbdzyK.js +0 -2854
- package/dist-lib/SortHeaderMenu-SYSAaqQJ.js +0 -106
- package/dist-lib/action-dispatch-CR4ajBtT.js +0 -1985
- package/dist-lib/cardProjection-CW5RIMko.js +0 -699
- package/dist-lib/components/pages/home/HomeStub.d.ts +0 -6
- package/dist-lib/components/pages/jobs/Jobs.d.ts +0 -1
- package/dist-lib/components/pages/pipeline/Pipeline.d.ts +0 -1
- package/dist-lib/format-count-Dobmi-Ji.js +0 -1551
- package/dist-lib/hooks/useUserLocale.d.ts +0 -1
- package/dist-lib/lib/messages.d.ts +0 -12
- package/dist-lib/peekDraftStore-5wQ7lq_V.js +0 -194
- package/dist-lib/registry-CjgUaF7C.js +0 -1768
- package/dist-lib/useListQuery-D7Hr5WM1.js +0 -96
- package/dist-lib/useProperties-CqtCzFCr.js +0 -81
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
//#region src/lib/safe-url.ts
|
|
2
|
+
var e = [
|
|
3
|
+
"http:",
|
|
4
|
+
"https:",
|
|
5
|
+
"mailto:"
|
|
6
|
+
], t = /[\u0000-\u001f\u007f]/g;
|
|
7
|
+
function n(n) {
|
|
8
|
+
if (!n) return;
|
|
9
|
+
let r = n.trim();
|
|
10
|
+
if (!r) return;
|
|
11
|
+
let i = r.replace(t, "");
|
|
12
|
+
if (!i || i.startsWith("//")) return;
|
|
13
|
+
let a = i.match(/^([a-zA-Z][a-zA-Z0-9+.-]*):/);
|
|
14
|
+
if (a) {
|
|
15
|
+
let t = a[1].toLowerCase() + ":";
|
|
16
|
+
if (!e.includes(t)) return;
|
|
17
|
+
}
|
|
18
|
+
return i;
|
|
19
|
+
}
|
|
20
|
+
function r(e) {
|
|
21
|
+
if (!e) return !1;
|
|
22
|
+
if (e.startsWith("//")) return !0;
|
|
23
|
+
let t = typeof window < "u" ? window.location.href : "http://localhost/", n;
|
|
24
|
+
try {
|
|
25
|
+
n = new URL(e, t);
|
|
26
|
+
} catch {
|
|
27
|
+
return !1;
|
|
28
|
+
}
|
|
29
|
+
if (n.protocol !== "http:" && n.protocol !== "https:") return !0;
|
|
30
|
+
let r = typeof window < "u" ? window.location.origin : "http://localhost";
|
|
31
|
+
return n.origin !== r;
|
|
32
|
+
}
|
|
33
|
+
//#endregion
|
|
34
|
+
export { n, r as t };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* One declared glyph. Matches the wire JSON the Go side serves on /api/schema
|
|
3
|
-
* as `icons
|
|
3
|
+
* as `icons`:
|
|
4
4
|
* - svg: geometry-only path `d` strings, rendered into the fixed 24x24
|
|
5
5
|
* stroke frame (the same frame as the built-in set).
|
|
6
6
|
* - lucide: a Lucide icon name, lazily resolved via dynamicIconImports.
|
|
7
|
-
* - url: an asset URL, rendered via <img src> ONLY (security boundary
|
|
7
|
+
* - url: an asset URL, rendered via <img src> ONLY (security boundary).
|
|
8
8
|
*/
|
|
9
9
|
export type IconDef = {
|
|
10
10
|
kind: "svg";
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Per-device list-table WIDTH store
|
|
3
|
-
*
|
|
4
|
-
* localStorage, per (tenant, user, SCREEN) by column id. Screen-keyed, so
|
|
2
|
+
* Per-device list-table WIDTH store. Holds ONE thing: column pixel widths,
|
|
3
|
+
* device-local in localStorage, per (tenant, user, SCREEN) by column id. Screen-keyed, so
|
|
5
4
|
* widening a column once holds across EVERY view of that screen on this device.
|
|
6
5
|
* Absent entry = the YAML default (`field.display.width ?? 150`), resolved by
|
|
7
6
|
* TanStack when `header.getSize()` reads `columnSizing[id] ?? columnDef.size`.
|
|
@@ -15,7 +14,7 @@
|
|
|
15
14
|
* for a teammate on a laptop), so it is device-local and never in a saved view.
|
|
16
15
|
*
|
|
17
16
|
* This does NOT violate the "browser stores nothing" appearance-preferences
|
|
18
|
-
* rule (
|
|
17
|
+
* rule (`preferences.ts`): that governs deployment BRANDING
|
|
19
18
|
* (theme/accent/density). Widths are device state of the same class as the
|
|
20
19
|
* `tabs` store, which already uses localStorage. Keying + persistence mirror
|
|
21
20
|
* `stores/tabs.ts`: a module-level (tenant,user) scope set via `setScope`, the
|
|
@@ -90,7 +90,7 @@ export declare function screenCurrentness(state: CurrentnessInputs, realtimeFlag
|
|
|
90
90
|
/**
|
|
91
91
|
* The one predicate every indicator reads: is the screen showing this entity
|
|
92
92
|
* CURRENT. The rows keep rendering throughout; this says whether they may be
|
|
93
|
-
* behind.
|
|
93
|
+
* behind.
|
|
94
94
|
*/
|
|
95
95
|
export declare function useScreenIsLive(realtimeFlag: boolean | undefined, entityCode: string): boolean;
|
|
96
96
|
export {};
|
|
@@ -10,7 +10,7 @@ export type TabCloseScope = "current" | "others" | "right" | "all";
|
|
|
10
10
|
* origin tab with a hash is reopened via pathname+search, and the hash is
|
|
11
11
|
* applied only in the `navigate()` call. `tabId`/`title`/`icon`/`screen` are
|
|
12
12
|
* hints for switching to (or reopening) the origin tab. Never stores secrets,
|
|
13
|
-
* external URLs, or row data.
|
|
13
|
+
* external URLs, or row data.
|
|
14
14
|
*/
|
|
15
15
|
export interface ReturnTarget {
|
|
16
16
|
pathname: string;
|
|
@@ -26,6 +26,7 @@ export interface TabItem {
|
|
|
26
26
|
pathname: string;
|
|
27
27
|
search: string;
|
|
28
28
|
title: string;
|
|
29
|
+
derivedTitle?: boolean;
|
|
29
30
|
icon?: string;
|
|
30
31
|
closable: boolean;
|
|
31
32
|
area?: string;
|
|
@@ -46,7 +47,7 @@ interface TabState {
|
|
|
46
47
|
switchTab: (id: string) => void;
|
|
47
48
|
reorderTabs: (activeId: string, overId: string) => void;
|
|
48
49
|
findTabByPathname: (pathname: string) => TabItem | undefined;
|
|
49
|
-
updateTabTitle: (id: string, title: string) => void;
|
|
50
|
+
updateTabTitle: (id: string, title: string, derived?: boolean) => void;
|
|
50
51
|
updateTabSearch: (id: string, search: string) => void;
|
|
51
52
|
setReturnTarget: (id: string, rt: ReturnTarget | null) => void;
|
|
52
53
|
commitTabNavigation: (id: string, patch: {
|
package/dist-lib/testing.d.ts
CHANGED
|
@@ -5,6 +5,8 @@ import { type ResponsiveViewport } from "./hooks/useResponsiveMode.d.ts";
|
|
|
5
5
|
import { type ActionExecuteRequest, type ActionExecuteResponse } from "./api/data.d.ts";
|
|
6
6
|
import type { Schema } from "./types/schema.d.ts";
|
|
7
7
|
import type { DataResponse, ListMeta, ListResponse, Refs } from "./types/api.d.ts";
|
|
8
|
+
import { type TextFn } from "./lib/language.d.ts";
|
|
9
|
+
import type { LocalizedString } from "./types/schema.d.ts";
|
|
8
10
|
/** A single action's stubbed outcome: the action's RESULT payload (what
|
|
9
11
|
* executeDeclarionAction unwraps from response.result), or a function of the
|
|
10
12
|
* dispatched body returning it. The harness always wraps it in a success
|
|
@@ -63,6 +65,10 @@ export interface RenderWithDeclarionResult extends RenderResult {
|
|
|
63
65
|
* CALLED something rather than that the user arrived. */
|
|
64
66
|
location: () => string;
|
|
65
67
|
}
|
|
68
|
+
export declare function textFixture(language?: string, messages?: Record<string, LocalizedString>): TextFn;
|
|
69
|
+
export declare function languageWrapper(language?: string, messages?: Record<string, LocalizedString>): ({ children }: {
|
|
70
|
+
children: ReactNode;
|
|
71
|
+
}) => import("react").JSX.Element;
|
|
66
72
|
/** Build a valid Schema from a partial - fills the required empty maps so a
|
|
67
73
|
* consumer only declares the entities/screens its test needs. */
|
|
68
74
|
export declare function schemaFixture(partial?: Partial<Schema>): Schema;
|
package/dist-lib/testing.js
CHANGED
|
@@ -1,14 +1,36 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
1
|
+
import { an as e, r as t, t as n } from "./useCurrentScreen-BL5NZFCw.js";
|
|
2
|
+
import { E as r, p as i, s as a } from "./useText-BFDCTUSo.js";
|
|
3
|
+
import { _ as o, c as s, g as c, v as l } from "./failure-v-uGSpbX.js";
|
|
4
|
+
import { useState as u } from "react";
|
|
5
|
+
import { MemoryRouter as d, useLocation as f } from "react-router";
|
|
6
|
+
import { QueryClient as p, QueryClientProvider as m } from "@tanstack/react-query";
|
|
7
|
+
import { Toaster as h } from "sonner";
|
|
8
|
+
import { jsx as g, jsxs as _ } from "react/jsx-runtime";
|
|
9
|
+
import { render as v } from "@testing-library/react";
|
|
8
10
|
//#region src/testing.tsx
|
|
9
|
-
function
|
|
11
|
+
function y(e = "en", t) {
|
|
12
|
+
return a(t, e, "en");
|
|
13
|
+
}
|
|
14
|
+
function b(e = "en", t) {
|
|
15
|
+
let n = new p({ defaultOptions: { queries: { retry: !1 } } });
|
|
16
|
+
return n.setQueryData(["schema", !1], x({
|
|
17
|
+
language: e,
|
|
18
|
+
messages: t
|
|
19
|
+
})), n.setQueryData(["schema", !0], x({
|
|
20
|
+
language: e,
|
|
21
|
+
messages: t
|
|
22
|
+
})), function({ children: e }) {
|
|
23
|
+
return /* @__PURE__ */ g(m, {
|
|
24
|
+
client: n,
|
|
25
|
+
children: e
|
|
26
|
+
});
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
function x(e = {}) {
|
|
10
30
|
return {
|
|
11
31
|
languages: [],
|
|
32
|
+
language: "en",
|
|
33
|
+
deployment_language: "en",
|
|
12
34
|
structures: {},
|
|
13
35
|
entities: {},
|
|
14
36
|
screens: {},
|
|
@@ -19,7 +41,7 @@ function v(e = {}) {
|
|
|
19
41
|
...e
|
|
20
42
|
};
|
|
21
43
|
}
|
|
22
|
-
function
|
|
44
|
+
function S(e, t = {}, n) {
|
|
23
45
|
return {
|
|
24
46
|
data: e,
|
|
25
47
|
meta: {
|
|
@@ -33,31 +55,31 @@ function y(e, t = {}, n) {
|
|
|
33
55
|
...n === void 0 ? {} : { $refs: n }
|
|
34
56
|
};
|
|
35
57
|
}
|
|
36
|
-
function
|
|
58
|
+
function C(e) {
|
|
37
59
|
return e;
|
|
38
60
|
}
|
|
39
|
-
var
|
|
40
|
-
function
|
|
61
|
+
var w = Symbol("declarion.testing.actionEnvelope");
|
|
62
|
+
function T(e) {
|
|
41
63
|
return {
|
|
42
64
|
...e,
|
|
43
|
-
[
|
|
65
|
+
[w]: !0
|
|
44
66
|
};
|
|
45
67
|
}
|
|
46
|
-
function
|
|
47
|
-
if (e && typeof e == "object" && e[
|
|
68
|
+
function E(e) {
|
|
69
|
+
if (e && typeof e == "object" && e[w]) {
|
|
48
70
|
let t = { ...e };
|
|
49
|
-
return delete t[
|
|
71
|
+
return delete t[w], t;
|
|
50
72
|
}
|
|
51
73
|
return {
|
|
52
74
|
status: "success",
|
|
53
75
|
result: e
|
|
54
76
|
};
|
|
55
77
|
}
|
|
56
|
-
function
|
|
57
|
-
let t =
|
|
78
|
+
function D({ into: e }) {
|
|
79
|
+
let t = f();
|
|
58
80
|
return e.current = `${t.pathname}${t.search}${t.hash}`, null;
|
|
59
81
|
}
|
|
60
|
-
function
|
|
82
|
+
function O() {
|
|
61
83
|
let e = {
|
|
62
84
|
id: "test-tenant",
|
|
63
85
|
code: "test",
|
|
@@ -74,9 +96,9 @@ function T() {
|
|
|
74
96
|
created_at: "2026-01-01T00:00:00Z",
|
|
75
97
|
updated_at: "2026-01-01T00:00:00Z"
|
|
76
98
|
};
|
|
77
|
-
|
|
99
|
+
i.getState().setUser(t, e);
|
|
78
100
|
}
|
|
79
|
-
function
|
|
101
|
+
function k(e) {
|
|
80
102
|
if (e === void 0) return { rows: [] };
|
|
81
103
|
if (Array.isArray(e)) return { rows: e };
|
|
82
104
|
if (Array.isArray(e.data)) {
|
|
@@ -89,15 +111,15 @@ function E(e) {
|
|
|
89
111
|
}
|
|
90
112
|
return e;
|
|
91
113
|
}
|
|
92
|
-
function
|
|
93
|
-
let
|
|
94
|
-
|
|
95
|
-
let i =
|
|
96
|
-
|
|
97
|
-
let a =
|
|
114
|
+
function A(e) {
|
|
115
|
+
let t = e.entityData ?? {};
|
|
116
|
+
l((n, r) => {
|
|
117
|
+
let i = r;
|
|
118
|
+
e.onListRequest?.(n, i);
|
|
119
|
+
let a = t[n], o = typeof a == "function" ? a(i) : a;
|
|
98
120
|
if (o instanceof Error) throw o;
|
|
99
|
-
let s =
|
|
100
|
-
return
|
|
121
|
+
let s = k(o), c = s.meta?.per_page ?? 50, l = s.meta?.total ?? s.rows.length;
|
|
122
|
+
return r.count === "only" ? {
|
|
101
123
|
data: [],
|
|
102
124
|
meta: {
|
|
103
125
|
page: 1,
|
|
@@ -116,78 +138,78 @@ function D(t) {
|
|
|
116
138
|
...s.refs === void 0 ? {} : { $refs: s.refs }
|
|
117
139
|
};
|
|
118
140
|
});
|
|
119
|
-
let
|
|
120
|
-
|
|
121
|
-
let
|
|
141
|
+
let n = e.entityItems ?? {}, r = e.entityItemResponses ?? {};
|
|
142
|
+
o((e, t) => {
|
|
143
|
+
let i = typeof t == "string" ? t : s(t), a = r[e]?.[i];
|
|
122
144
|
if (a instanceof Error) throw a;
|
|
123
145
|
if (a !== void 0) return a;
|
|
124
|
-
let
|
|
125
|
-
if (
|
|
126
|
-
return { data:
|
|
146
|
+
let o = n[e]?.[i];
|
|
147
|
+
if (o instanceof Error) throw o;
|
|
148
|
+
return { data: o };
|
|
127
149
|
});
|
|
128
|
-
let
|
|
129
|
-
|
|
130
|
-
if (!(e in
|
|
131
|
-
let n =
|
|
132
|
-
return
|
|
150
|
+
let i = e.actionResults ?? {};
|
|
151
|
+
c(async (e, t) => {
|
|
152
|
+
if (!(e in i)) throw Error(`renderWithDeclarion: no action result registered for "${e}" (seed it via actionResults)`);
|
|
153
|
+
let n = i[e];
|
|
154
|
+
return E(typeof n == "function" ? await n(t) : n);
|
|
133
155
|
});
|
|
134
156
|
}
|
|
135
|
-
function
|
|
136
|
-
|
|
157
|
+
function j() {
|
|
158
|
+
l(null), o(null), c(null), i.setState({
|
|
137
159
|
user: null,
|
|
138
160
|
isAuthenticated: !1,
|
|
139
161
|
activeTenant: null,
|
|
140
162
|
tenants: []
|
|
141
163
|
});
|
|
142
164
|
}
|
|
143
|
-
function
|
|
144
|
-
let
|
|
165
|
+
function M(i, a = {}) {
|
|
166
|
+
let o = new p({ defaultOptions: { queries: {
|
|
145
167
|
retry: !1,
|
|
146
168
|
gcTime: Infinity
|
|
147
169
|
} } });
|
|
148
|
-
|
|
149
|
-
let
|
|
150
|
-
code:
|
|
151
|
-
children:
|
|
152
|
-
}) :
|
|
153
|
-
client:
|
|
154
|
-
children: [/* @__PURE__ */
|
|
155
|
-
initialEntries: [
|
|
156
|
-
children: [/* @__PURE__ */
|
|
157
|
-
}), /* @__PURE__ */ h
|
|
158
|
-
}),
|
|
159
|
-
query:
|
|
170
|
+
O(), o.setQueryData(["schema", !0], a.schema ?? x()), A(a);
|
|
171
|
+
let s = a.screenCode ? /* @__PURE__ */ g(n, {
|
|
172
|
+
code: a.screenCode,
|
|
173
|
+
children: i
|
|
174
|
+
}) : i, c = { current: a.route ?? "/" }, l = /* @__PURE__ */ _(m, {
|
|
175
|
+
client: o,
|
|
176
|
+
children: [/* @__PURE__ */ _(d, {
|
|
177
|
+
initialEntries: [a.route ?? "/"],
|
|
178
|
+
children: [/* @__PURE__ */ g(D, { into: c }), /* @__PURE__ */ g(t, { children: s })]
|
|
179
|
+
}), /* @__PURE__ */ g(h, {})]
|
|
180
|
+
}), u = a.embedQuery ? /* @__PURE__ */ g(r, {
|
|
181
|
+
query: a.embedQuery,
|
|
160
182
|
children: l
|
|
161
|
-
}) : l,
|
|
162
|
-
viewportOverride:
|
|
163
|
-
children:
|
|
164
|
-
}) :
|
|
165
|
-
return Object.assign(
|
|
166
|
-
queryClient:
|
|
167
|
-
location: () =>
|
|
183
|
+
}) : l, f = v(a.viewport ? /* @__PURE__ */ g(e, {
|
|
184
|
+
viewportOverride: a.viewport,
|
|
185
|
+
children: u
|
|
186
|
+
}) : u);
|
|
187
|
+
return Object.assign(f, {
|
|
188
|
+
queryClient: o,
|
|
189
|
+
location: () => c.current
|
|
168
190
|
});
|
|
169
191
|
}
|
|
170
|
-
function
|
|
171
|
-
let [
|
|
172
|
-
let e = new
|
|
192
|
+
function N({ children: e, authenticated: n = !0, ...r }) {
|
|
193
|
+
let [a] = u(() => {
|
|
194
|
+
let e = new p({ defaultOptions: { queries: {
|
|
173
195
|
retry: !1,
|
|
174
196
|
gcTime: Infinity
|
|
175
197
|
} } });
|
|
176
|
-
return
|
|
198
|
+
return n ? (O(), e.setQueryData(["schema", !0], r.schema ?? x())) : i.setState({
|
|
177
199
|
user: null,
|
|
178
200
|
isAuthenticated: !1,
|
|
179
201
|
activeTenant: null,
|
|
180
202
|
tenants: []
|
|
181
|
-
}),
|
|
203
|
+
}), A(r), e;
|
|
182
204
|
});
|
|
183
|
-
return /* @__PURE__ */
|
|
184
|
-
client:
|
|
185
|
-
children: [/* @__PURE__ */
|
|
186
|
-
initialEntries: [
|
|
187
|
-
children: /* @__PURE__ */
|
|
188
|
-
}), /* @__PURE__ */ h
|
|
205
|
+
return /* @__PURE__ */ _(m, {
|
|
206
|
+
client: a,
|
|
207
|
+
children: [/* @__PURE__ */ g(d, {
|
|
208
|
+
initialEntries: [r.route ?? "/"],
|
|
209
|
+
children: /* @__PURE__ */ g(t, { children: e })
|
|
210
|
+
}), /* @__PURE__ */ g(h, {})]
|
|
189
211
|
});
|
|
190
212
|
}
|
|
191
|
-
typeof afterEach == "function" && afterEach(() =>
|
|
213
|
+
typeof afterEach == "function" && afterEach(() => j());
|
|
192
214
|
//#endregion
|
|
193
|
-
export {
|
|
215
|
+
export { N as PreviewHarness, T as actionEnvelope, C as actionResults, j as cleanupDeclarion, S as entityDataFixture, b as languageWrapper, M as renderWithDeclarion, x as schemaFixture, y as textFixture };
|
package/dist-lib/types/api.d.ts
CHANGED
|
@@ -85,9 +85,9 @@ export declare function isApiErrorBody(body: unknown): body is ApiErrorBody;
|
|
|
85
85
|
* - CURSOR_SEMANTICS_MISMATCH: the cursor was minted under different sort
|
|
86
86
|
* semantics (multi-column ordering, NULL placement). Server bumped its
|
|
87
87
|
* cursor format version since the cursor was issued.
|
|
88
|
-
* -
|
|
89
|
-
*
|
|
90
|
-
*
|
|
88
|
+
* - CURSOR_LANGUAGE_CHANGED: the cursor was minted in one language and the
|
|
89
|
+
* request now reads in another. Issued so multilang sort cannot silently
|
|
90
|
+
* re-order mid-pagination.
|
|
91
91
|
*
|
|
92
92
|
* UX contract for both: clear the `after` token and refetch page 1 under
|
|
93
93
|
* the current conditions. EntityClient.list does this transparently;
|
|
@@ -95,7 +95,7 @@ export declare function isApiErrorBody(body: unknown): body is ApiErrorBody;
|
|
|
95
95
|
* retry logic.
|
|
96
96
|
*/
|
|
97
97
|
export declare const CURSOR_SEMANTICS_MISMATCH = "cursor.semantics_mismatch";
|
|
98
|
-
export declare const
|
|
98
|
+
export declare const CURSOR_LANGUAGE_CHANGED = "cursor.language_changed";
|
|
99
99
|
/**
|
|
100
100
|
* A cross-store (Postgres-hot / ClickHouse-cold) archive cursor that the server
|
|
101
101
|
* could not decode for this read - a malformed token, a tenant/entity mismatch,
|
|
@@ -266,8 +266,8 @@ export interface BrandingTheme {
|
|
|
266
266
|
}
|
|
267
267
|
/**
|
|
268
268
|
* The deployment's DEFAULTS for the controls the Preferences screen renders,
|
|
269
|
-
* and the single durable source of preference state
|
|
270
|
-
*
|
|
269
|
+
* and the single durable source of preference state: the browser stores
|
|
270
|
+
* nothing. A user's toggle holds for the SPA session and resets to
|
|
271
271
|
* these on reload.
|
|
272
272
|
*
|
|
273
273
|
* Wire shape is snake_case because it is YAML. `stores/preferences.ts` owns the
|
|
@@ -372,7 +372,6 @@ export interface PublicMeta {
|
|
|
372
372
|
export interface PublicParamsResponse {
|
|
373
373
|
parameters: PublicParam[];
|
|
374
374
|
accents?: Record<string, AccentDef>;
|
|
375
|
-
messages?: Record<string, LocalizedString>;
|
|
376
375
|
meta?: PublicMeta;
|
|
377
376
|
}
|
|
378
377
|
/**
|
|
@@ -419,6 +418,7 @@ export interface ResolvedParam {
|
|
|
419
418
|
/** Shared enum this parameter names, when it names one rather than listing
|
|
420
419
|
* its members inline. Present for display; `values` is what to render. */
|
|
421
420
|
enum?: string;
|
|
421
|
+
ref?: EntityField["ref"];
|
|
422
422
|
}
|
|
423
423
|
export interface ParamOverride {
|
|
424
424
|
param_code: string;
|
|
@@ -454,7 +454,6 @@ export interface ListParams {
|
|
|
454
454
|
* "only" - total only, no rows (the follow-up count request).
|
|
455
455
|
* "with" - rows + total, using the entity's declared strategy.
|
|
456
456
|
* "exact" - rows + forced exact total.
|
|
457
|
-
* See docs/plans/2026-05-18-declarative-row-count.md.
|
|
458
457
|
*/
|
|
459
458
|
count?: "window" | "only" | "with" | "exact";
|
|
460
459
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export type FieldType = "uuid" | "string" | "text" | "rich_text" | "int" | "float" | "bool" | "date" | "time" | "timestamp" | "email" | "url" | "phone" | "enum" | "json" | "ref" | "tags" | "multilang" | "multilang_text" | "structure" | "secret" | "password" | "decimal" | "string_array" | "int_array" | "uuid_array" | "bytes";
|
|
1
|
+
export type FieldType = "uuid" | "string" | "text" | "rich_text" | "int" | "float" | "bool" | "date" | "time" | "timestamp" | "email" | "url" | "phone" | "enum" | "json" | "ref" | "tags" | "multilang" | "multilang_text" | "multilang_array" | "structure" | "secret" | "password" | "decimal" | "string_array" | "int_array" | "uuid_array" | "bytes";
|
|
2
2
|
export declare const FIELD_TYPES: readonly FieldType[];
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
+
import type { LocalizedString } from "./schema";
|
|
1
2
|
export type FileFieldMode = "single" | "array" | "named_map" | "rich_text_inline";
|
|
2
3
|
export interface FileFieldDisplay {
|
|
3
4
|
widget: string;
|
|
4
|
-
placeholder?:
|
|
5
|
+
placeholder?: LocalizedString;
|
|
6
|
+
initials?: boolean;
|
|
5
7
|
crop_on_upload?: boolean;
|
|
6
8
|
aspect_ratio?: string;
|
|
7
9
|
focal_point?: boolean;
|
|
@@ -13,11 +15,9 @@ export interface FileFieldDisplay {
|
|
|
13
15
|
lazy_load?: boolean;
|
|
14
16
|
}
|
|
15
17
|
export interface FileNamedSlotDef {
|
|
18
|
+
name: LocalizedString;
|
|
16
19
|
accepts?: string[];
|
|
17
20
|
max_size_bytes?: number;
|
|
18
|
-
svg_sanitize?: boolean;
|
|
19
|
-
pdf_strip_js?: boolean;
|
|
20
|
-
exif_strip?: boolean;
|
|
21
21
|
aspect_ratio?: string;
|
|
22
22
|
storage_backend?: string;
|
|
23
23
|
}
|