uidl-runtime 0.1.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/LICENSE +21 -0
- package/README.md +175 -0
- package/bin/validate.mjs +44 -0
- package/dist/actions/eventBus.d.ts +7 -0
- package/dist/actions/index.d.ts +5 -0
- package/dist/actions/interpreter.d.ts +54 -0
- package/dist/compiler/dashboard.d.ts +10 -0
- package/dist/compiler/form.d.ts +22 -0
- package/dist/compiler/index.d.ts +16 -0
- package/dist/compiler/list.d.ts +20 -0
- package/dist/compiler/report.d.ts +10 -0
- package/dist/compiler/settings.d.ts +10 -0
- package/dist/compiler/tree.d.ts +10 -0
- package/dist/compiler/types.d.ts +315 -0
- package/dist/compiler/wizard.d.ts +10 -0
- package/dist/components/BarcodeAndQRCode.d.ts +29 -0
- package/dist/components/charts.d.ts +66 -0
- package/dist/components/iconPaths.d.ts +5 -0
- package/dist/components/icons.d.ts +31 -0
- package/dist/components/primitives.d.ts +411 -0
- package/dist/data/adapters/http.d.ts +37 -0
- package/dist/data/adapters/inMemory.d.ts +62 -0
- package/dist/data/errors.d.ts +15 -0
- package/dist/data/index.d.ts +7 -0
- package/dist/data/testing/mockHttpServer.d.ts +16 -0
- package/dist/data/types.d.ts +74 -0
- package/dist/editor/Canvas.d.ts +22 -0
- package/dist/editor/Editor.d.ts +18 -0
- package/dist/editor/LayerTree.d.ts +12 -0
- package/dist/editor/PropertyPanel.d.ts +7 -0
- package/dist/editor/StylePanel.d.ts +7 -0
- package/dist/editor/ValidationStatus.d.ts +9 -0
- package/dist/editor/WidgetPalette.d.ts +6 -0
- package/dist/editor/document.d.ts +10 -0
- package/dist/editor/index.d.ts +2 -0
- package/dist/editor/store.d.ts +46 -0
- package/dist/expr/evaluate.d.ts +51 -0
- package/dist/hooks/useElementWidth.d.ts +14 -0
- package/dist/index.d.ts +61 -0
- package/dist/registry/defaults.d.ts +2 -0
- package/dist/registry/registry.d.ts +4 -0
- package/dist/renderer/RenderNode.d.ts +16 -0
- package/dist/renderer/UIDocumentRenderer.d.ts +13 -0
- package/dist/renderer/instantiateComponent.d.ts +18 -0
- package/dist/renderer/renderDocument.d.ts +63 -0
- package/dist/schema/action.schema.json +515 -0
- package/dist/schema/design-tokens.schema.json +51 -0
- package/dist/schema/jsonSchema.d.ts +11 -0
- package/dist/schema/theme-presets.schema.json +952 -0
- package/dist/schema/uidl-document.schema.json +187 -0
- package/dist/schemas/actions.d.ts +5 -0
- package/dist/schemas/document.d.ts +35 -0
- package/dist/schemas/theme.d.ts +260 -0
- package/dist/services/aiPromptGenerator.d.ts +11 -0
- package/dist/state/createDocumentState.d.ts +18 -0
- package/dist/state/dataSources.d.ts +58 -0
- package/dist/state/index.d.ts +4 -0
- package/dist/style.css +2 -0
- package/dist/theme/engine.d.ts +9 -0
- package/dist/theme/index.d.ts +7 -0
- package/dist/theme/meridianPreset.d.ts +5 -0
- package/dist/theme/presets.d.ts +5 -0
- package/dist/theme/registry.d.ts +15 -0
- package/dist/theme/serialize.d.ts +5 -0
- package/dist/theme/tailwind.d.ts +11 -0
- package/dist/types/actions.d.ts +116 -0
- package/dist/types/editor.d.ts +45 -0
- package/dist/types/index.d.ts +82 -0
- package/dist/types/theme.d.ts +95 -0
- package/dist/uidl-runtime.js +98 -0
- package/dist/uidl-runtime.js.map +1 -0
- package/dist/uidl-runtime.mjs +17779 -0
- package/dist/uidl-runtime.mjs.map +1 -0
- package/dist/utils/chart.d.ts +12 -0
- package/dist/utils/cn.d.ts +1 -0
- package/dist/utils/formLayout.d.ts +93 -0
- package/dist/utils/i18n.d.ts +132 -0
- package/dist/utils/listCell.d.ts +21 -0
- package/dist/utils/responsive.d.ts +3 -0
- package/dist/utils/tailwind.d.ts +23 -0
- package/dist/validate/validateResponsive.d.ts +7 -0
- package/dist/version.d.ts +10 -0
- package/package.json +109 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Doni Wicaksono
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
# uidl-runtime
|
|
2
|
+
|
|
3
|
+
A schema-driven React runtime that renders validated JSON documents into real application
|
|
4
|
+
surfaces — lists, forms, reports, dashboards and settings — without putting business
|
|
5
|
+
workflows inside page components.
|
|
6
|
+
|
|
7
|
+
A **UIDL document** is JSON describing layout, state, queries, bindings, events and actions.
|
|
8
|
+
`uidl-runtime` validates it against a Zod schema and renders it through a component registry.
|
|
9
|
+
Nothing in a document names a data source, an HTTP client or a database: reads go through a
|
|
10
|
+
single `DataAdapter` seam and writes go through a host-supplied mutation handler, so the same
|
|
11
|
+
document runs in memory, against a mock API, or against a real backend.
|
|
12
|
+
|
|
13
|
+
It was built for three callers: AI agents that generate interfaces from structured
|
|
14
|
+
instructions, ERP-style products whose screens are defined by metadata rather than code, and
|
|
15
|
+
low-code systems that need a validated document model instead of generated page files.
|
|
16
|
+
|
|
17
|
+
```tsx
|
|
18
|
+
import { DocumentSchema, UIDocumentRenderer, meridianLightTheme } from "uidl-runtime";
|
|
19
|
+
import "uidl-runtime/style.css";
|
|
20
|
+
|
|
21
|
+
const document = DocumentSchema.parse(rawDocument);
|
|
22
|
+
|
|
23
|
+
export function App() {
|
|
24
|
+
return (
|
|
25
|
+
<UIDocumentRenderer
|
|
26
|
+
document={document}
|
|
27
|
+
theme={meridianLightTheme}
|
|
28
|
+
onRouteChange={(path) => navigate(path)}
|
|
29
|
+
/>
|
|
30
|
+
);
|
|
31
|
+
}
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## Status
|
|
35
|
+
|
|
36
|
+
The runtime and its reference suite are functional and covered by tests. **This is not a
|
|
37
|
+
production-ready product.** The reference applications are executable blueprints, not
|
|
38
|
+
certified systems — read the maturity table below before treating any of them as finished.
|
|
39
|
+
|
|
40
|
+
- 131 test files, 1176 tests, one typecheck, one lint pass
|
|
41
|
+
- 11 industry reference consoles plus a full double-entry accounting reference
|
|
42
|
+
- Every financial posting satisfies `sum(debit) === sum(credit)`, checked by an audit gate
|
|
43
|
+
|
|
44
|
+
## Quick start
|
|
45
|
+
|
|
46
|
+
Node.js LTS and npm.
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
npm install
|
|
50
|
+
npm run dev
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
To exercise the HTTP adapter instead of the in-memory one, run two terminals:
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
npm run mock:api # mock API on port 8787
|
|
57
|
+
npm run dev:reference:http
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
## Commands
|
|
61
|
+
|
|
62
|
+
| Command | Purpose |
|
|
63
|
+
|---|---|
|
|
64
|
+
| `npm run dev` | Start the reference application suite in memory |
|
|
65
|
+
| `npm run dev:reference:http` | Start the suite with `VITE_DATA_MODE=http` |
|
|
66
|
+
| `npm run mock:api` | Start the local mock API on port 8787 |
|
|
67
|
+
| `npm run typecheck` | Type-check all workspaces |
|
|
68
|
+
| `npm run lint` | Run ESLint |
|
|
69
|
+
| `npm test` | Run Vitest unit and integration tests |
|
|
70
|
+
| `npm run build` | Build the public library and JSON schemas |
|
|
71
|
+
| `npm run build:reference` | Build the reference application suite |
|
|
72
|
+
| `npm run audit:reference` | Architecture, maturity and balanced-GL gates |
|
|
73
|
+
| `npm run test:reference` | Playwright acceptance tests, in memory |
|
|
74
|
+
| `npm run test:reference:http` | Playwright acceptance tests over HTTP |
|
|
75
|
+
| `npm run smoke:package` | Pack and consume the public npm artifact |
|
|
76
|
+
| `npm run validate:examples` | Validate the example UIDL documents |
|
|
77
|
+
|
|
78
|
+
## How it works
|
|
79
|
+
|
|
80
|
+
Reads flow one way, from metadata to rendered surface:
|
|
81
|
+
|
|
82
|
+
```text
|
|
83
|
+
DoctypeMeta / ModuleSpec
|
|
84
|
+
-> page generator
|
|
85
|
+
-> UIDLDocument (validated by DocumentSchema)
|
|
86
|
+
-> UIDocumentRenderer
|
|
87
|
+
-> DataAdapter
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
Writes never take that path. They cross an explicit boundary instead:
|
|
91
|
+
|
|
92
|
+
```text
|
|
93
|
+
UIDL mutate action
|
|
94
|
+
-> host mutationHandler
|
|
95
|
+
-> document or domain service
|
|
96
|
+
-> DataAdapter
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
The data mode is chosen in exactly one file, `packages/templates/src/config/data.config.ts`.
|
|
100
|
+
Documents and generators must not import a concrete adapter.
|
|
101
|
+
|
|
102
|
+
### Core concepts
|
|
103
|
+
|
|
104
|
+
- `$bind` reads reactive state or query results.
|
|
105
|
+
- `$query` delegates a read to the `DataAdapter`.
|
|
106
|
+
- `$expr` evaluates the supported declarative expressions, including aggregates.
|
|
107
|
+
- `mutate` delegates a write to the host and **fails closed** when no permitted handler exists.
|
|
108
|
+
- Generic list, form, workspace, settings, dashboard and report surfaces are generated UIDL.
|
|
109
|
+
- A composite transaction may use a thin React component when UIDL cannot express the
|
|
110
|
+
interaction — but the business rules stay in services.
|
|
111
|
+
|
|
112
|
+
## Repository structure
|
|
113
|
+
|
|
114
|
+
```text
|
|
115
|
+
uidl-runtime/
|
|
116
|
+
├── packages/
|
|
117
|
+
│ ├── core/ # Schemas, renderer, state, actions, themes, registry, adapters
|
|
118
|
+
│ └── templates/ # Page generators, verticals, domain services, mock data
|
|
119
|
+
├── apps/reference/ # Executable references, playground, gallery, POS, regression harness
|
|
120
|
+
├── e2e/ # Browser acceptance and visual-regression tests
|
|
121
|
+
├── scripts/ # Audit, mock API, packaging and validation tools
|
|
122
|
+
└── docs/product/ # Background product notes, not a status authority
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
`packages/core`, `packages/templates` and `apps/reference` are private workspaces. The
|
|
126
|
+
published artifact is `uidl-runtime`, including its required `style.css`.
|
|
127
|
+
|
|
128
|
+
## Reference suite
|
|
129
|
+
|
|
130
|
+
**Meridian** is the core reference: a complete double-entry accounting desk — chart of
|
|
131
|
+
accounts, sales and purchase cycles, journal entries, payments, stock ledger, POS shifts,
|
|
132
|
+
General Ledger, Trial Balance, Profit and Loss and Balance Sheet. Every report is *derived*
|
|
133
|
+
from postings rather than hand-written, so the books balance by construction.
|
|
134
|
+
|
|
135
|
+
Eleven industry consoles sit beside it: shoe retail POS, school finance, manufacturing, food
|
|
136
|
+
roasting, EPC contracting, CRM, cooperative/BMT, hospital, medical device, omnichannel
|
|
137
|
+
distribution and helpdesk. Several model Indonesian business documents directly — Faktur
|
|
138
|
+
Pajak, e-Faktur DJP, Surat Jalan, Akad Murabahah — and the interface runs bilingually in
|
|
139
|
+
Indonesian and English.
|
|
140
|
+
|
|
141
|
+
Maturity is stated per reference rather than claimed for the suite:
|
|
142
|
+
|
|
143
|
+
| Level | Meaning |
|
|
144
|
+
|---|---|
|
|
145
|
+
| Concept Reference | Architecture or workflow direction, no complete user journey |
|
|
146
|
+
| UI Reference | Reusable interface pattern, no complete business execution |
|
|
147
|
+
| Functional Reference | Executable workflow with deterministic data and acceptance evidence |
|
|
148
|
+
| Domain-Verified Reference | Functional, plus proven domain invariants and reconciliation |
|
|
149
|
+
| Production-Ready | Operations, security, accessibility, performance and support proven |
|
|
150
|
+
|
|
151
|
+
Most verticals are Functional References. School dunning, koperasi murabahah collectibility,
|
|
152
|
+
hospital claim reconciliation and helpdesk SLA are Domain-Verified. **None is
|
|
153
|
+
Production-Ready.** A workflow counts as proven only when a browser test drives its UI;
|
|
154
|
+
calling a service directly counts as setup, not evidence.
|
|
155
|
+
|
|
156
|
+
## Implementation rules
|
|
157
|
+
|
|
158
|
+
- Presentation in components, reusable behaviour in hooks, pure functions in utilities,
|
|
159
|
+
workflows and integrations in services.
|
|
160
|
+
- Validate every generated document with `DocumentSchema` before rendering.
|
|
161
|
+
- Keep one `DataAdapter` seam; never import a concrete adapter from a document, generator or
|
|
162
|
+
UI component.
|
|
163
|
+
- Require `sum(debit) === sum(credit)` for every financial posting.
|
|
164
|
+
- Keep API-backed actions fail-closed and explicitly allowlisted.
|
|
165
|
+
- Use the shared design tokens and vector icons; respect `prefers-reduced-motion`.
|
|
166
|
+
- Do not introduce a second primary runtime model alongside `UIDLDocument`.
|
|
167
|
+
|
|
168
|
+
## Credits
|
|
169
|
+
|
|
170
|
+
Outline icons are from [Heroicons](https://heroicons.com) (MIT). The interface type is
|
|
171
|
+
[Inter](https://rsms.me/inter/) (SIL Open Font License).
|
|
172
|
+
|
|
173
|
+
## License
|
|
174
|
+
|
|
175
|
+
MIT — see [LICENSE](LICENSE).
|
package/bin/validate.mjs
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { readFileSync } from "node:fs";
|
|
3
|
+
import { DocumentSchema } from "../dist/uidl-runtime.js";
|
|
4
|
+
|
|
5
|
+
const args = process.argv.slice(2);
|
|
6
|
+
if (args.length === 0) {
|
|
7
|
+
console.error("Usage: uidl-validate <file.json> [<file2.json> ...]");
|
|
8
|
+
process.exit(1);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
let hasError = false;
|
|
12
|
+
for (const filePath of args) {
|
|
13
|
+
let raw;
|
|
14
|
+
try {
|
|
15
|
+
raw = readFileSync(filePath, "utf-8");
|
|
16
|
+
} catch (err) {
|
|
17
|
+
console.error(`✗ ${filePath}: cannot read file (${err.message})`);
|
|
18
|
+
hasError = true;
|
|
19
|
+
continue;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
let parsed;
|
|
23
|
+
try {
|
|
24
|
+
parsed = JSON.parse(raw);
|
|
25
|
+
} catch (err) {
|
|
26
|
+
console.error(`✗ ${filePath}: invalid JSON (${err.message})`);
|
|
27
|
+
hasError = true;
|
|
28
|
+
continue;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
const result = DocumentSchema.safeParse(parsed);
|
|
32
|
+
if (result.success) {
|
|
33
|
+
console.log(`✓ ${filePath}`);
|
|
34
|
+
} else {
|
|
35
|
+
console.error(`✗ ${filePath}`);
|
|
36
|
+
for (const issue of result.error.issues) {
|
|
37
|
+
const issuePath = issue.path.join(".") || "(root)";
|
|
38
|
+
console.error(` - ${issuePath}: ${issue.message}`);
|
|
39
|
+
}
|
|
40
|
+
hasError = true;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
process.exit(hasError ? 1 : 0);
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export type EventBusListener = (payload: unknown) => void;
|
|
2
|
+
export interface EventBus {
|
|
3
|
+
on: (topic: string, listener: EventBusListener) => () => void;
|
|
4
|
+
emit: (topic: string, payload: unknown) => void;
|
|
5
|
+
off: (topic: string, listener: EventBusListener) => void;
|
|
6
|
+
}
|
|
7
|
+
export declare function createEventBus(): EventBus;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { createEventBus } from './eventBus';
|
|
2
|
+
export type { EventBus, EventBusListener } from './eventBus';
|
|
3
|
+
export { ActionInterpreter } from './interpreter';
|
|
4
|
+
export type { ActionContext, ApiAllowlist } from './interpreter';
|
|
5
|
+
export type { CommandHandler, CommandRequest, CommandResponse, MutationHandler, MutationRequest, MutationResponse, } from '../types/actions';
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { Action, CommandHandler, MutationHandler } from '../types/actions';
|
|
2
|
+
import { DocumentStateStore } from '../state/createDocumentState';
|
|
3
|
+
import { createEventBus } from './eventBus';
|
|
4
|
+
/**
|
|
5
|
+
* A list of allowed hostnames (exact match, or `*.example.com` for subdomains), or a predicate
|
|
6
|
+
* for more advanced matching. `api` actions refuse to run unless this is provided — see
|
|
7
|
+
* `ActionInterpreter`'s `apiAllowlist` handling for why the default is fail-closed, not open.
|
|
8
|
+
*/
|
|
9
|
+
export type ApiAllowlist = string[] | ((url: URL) => boolean);
|
|
10
|
+
export interface ActionContext {
|
|
11
|
+
stateStore?: DocumentStateStore;
|
|
12
|
+
session?: Record<string, unknown>;
|
|
13
|
+
route?: Record<string, unknown>;
|
|
14
|
+
data?: Record<string, unknown>;
|
|
15
|
+
eventBus?: ReturnType<typeof createEventBus>;
|
|
16
|
+
mutationHandler?: MutationHandler;
|
|
17
|
+
commandHandler?: CommandHandler;
|
|
18
|
+
apiAllowlist?: ApiAllowlist;
|
|
19
|
+
/** Max `api` response body size in bytes before the request is aborted. Default 5MB. */
|
|
20
|
+
apiMaxResponseBytes?: number;
|
|
21
|
+
/**
|
|
22
|
+
* Max number of `api` actions this interpreter runs concurrently; further calls fail fast
|
|
23
|
+
* instead of queueing, so a document that fires many `api` actions at once (e.g. one per row
|
|
24
|
+
* of a `repeat`) can't hammer an allowlisted host or exhaust client connections. Default 6.
|
|
25
|
+
*/
|
|
26
|
+
apiMaxConcurrentCalls?: number;
|
|
27
|
+
}
|
|
28
|
+
export declare class ActionInterpreter {
|
|
29
|
+
private stateStore?;
|
|
30
|
+
private route;
|
|
31
|
+
private session;
|
|
32
|
+
private data;
|
|
33
|
+
private eventBus;
|
|
34
|
+
private mutationHandler?;
|
|
35
|
+
private commandHandler?;
|
|
36
|
+
private apiAllowlist?;
|
|
37
|
+
private apiMaxResponseBytes;
|
|
38
|
+
private apiMaxConcurrentCalls;
|
|
39
|
+
private inFlightApiCalls;
|
|
40
|
+
constructor(context?: ActionContext);
|
|
41
|
+
getEventBus(): ReturnType<typeof createEventBus>;
|
|
42
|
+
execute(action: Action, eventValue?: unknown): void;
|
|
43
|
+
private executeAction;
|
|
44
|
+
private executeMutation;
|
|
45
|
+
private runMutation;
|
|
46
|
+
private buildMutationRequest;
|
|
47
|
+
private executeCommand;
|
|
48
|
+
private runCommand;
|
|
49
|
+
private buildCommandRequest;
|
|
50
|
+
private executeApi;
|
|
51
|
+
private fetchApi;
|
|
52
|
+
private isApiUrlAllowed;
|
|
53
|
+
private buildScope;
|
|
54
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { UIDLDocument, UIDLNode } from '../types';
|
|
2
|
+
import { DashboardPageMeta, HostCapabilities, RoutePolicy, UiPolicy } from './types.js';
|
|
3
|
+
export interface CompileDashboardOptions {
|
|
4
|
+
hostCapabilities: HostCapabilities;
|
|
5
|
+
uiPolicy?: UiPolicy;
|
|
6
|
+
routePolicy?: RoutePolicy;
|
|
7
|
+
docId?: string;
|
|
8
|
+
extraHeaderActions?: UIDLNode[];
|
|
9
|
+
}
|
|
10
|
+
export declare function compileDashboardPage(meta: DashboardPageMeta, options: CompileDashboardOptions): UIDLDocument;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { UIDLDocument, UIDLNode } from '../types';
|
|
2
|
+
import { FormPageMeta, HostCapabilities, RoutePolicy, UiPolicy } from './types.js';
|
|
3
|
+
export interface CompileFormOptions {
|
|
4
|
+
hostCapabilities: HostCapabilities;
|
|
5
|
+
uiPolicy?: UiPolicy;
|
|
6
|
+
routePolicy?: RoutePolicy;
|
|
7
|
+
docId?: string;
|
|
8
|
+
listRoute?: string;
|
|
9
|
+
initialData?: Record<string, unknown>;
|
|
10
|
+
initialVersion?: number;
|
|
11
|
+
extraHeaderActions?: UIDLNode[];
|
|
12
|
+
extraFormActions?: UIDLNode[];
|
|
13
|
+
useFullWidth?: boolean;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* TwoColumnForm prints a field's label in the row's start column, so the control must not
|
|
17
|
+
* print it again — but a control with no name of its own reaches assistive tech as an unnamed
|
|
18
|
+
* input, which is what axe reports as `label` / `select-name`. Naming it the way the static
|
|
19
|
+
* Meridian documents do (`aria-label`, see templates' `formControlNode`) satisfies both.
|
|
20
|
+
*/
|
|
21
|
+
export declare function nameControl(control: UIDLNode, label: string): UIDLNode;
|
|
22
|
+
export declare function compileFormPage(meta: FormPageMeta, recordId: string, options: CompileFormOptions): UIDLDocument;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export { PAGE_RECIPES, isPageRecipe, validateHostCapabilities, semanticNodeId, semanticListNodeIds, } from './types.js';
|
|
2
|
+
export { compileListPage, parseListQueryParams, serializeListQueryParams, } from './list.js';
|
|
3
|
+
export type { CompileListOptions } from './list.js';
|
|
4
|
+
export { compileFormPage } from './form.js';
|
|
5
|
+
export type { CompileFormOptions } from './form.js';
|
|
6
|
+
export { compileReportPage } from './report.js';
|
|
7
|
+
export type { CompileReportOptions } from './report.js';
|
|
8
|
+
export { compileDashboardPage } from './dashboard.js';
|
|
9
|
+
export type { CompileDashboardOptions } from './dashboard.js';
|
|
10
|
+
export { compileSettingsPage } from './settings.js';
|
|
11
|
+
export type { CompileSettingsOptions } from './settings.js';
|
|
12
|
+
export { compileTreePage } from './tree.js';
|
|
13
|
+
export type { CompileTreeOptions } from './tree.js';
|
|
14
|
+
export { compileWizardPage } from './wizard.js';
|
|
15
|
+
export type { CompileWizardOptions } from './wizard.js';
|
|
16
|
+
export type { PageRecipe, LocalizedText, FieldWidget, FieldOption, FieldMeta, ListColumn, ListFilter, ListSummary, ListPageMeta, StateTransition, DocumentStates, ChildTableRef, FormPageMeta, ReportColumn, ReportFilter, ReportPageMeta, DashboardKpi, DashboardChart, DashboardShortcut, DashboardPageMeta, SettingsField, SettingsSection, SettingsPageMeta, TreeNode, TreePageMeta, WizardStep, WizardPageMeta, RecipeMetaMap, HostCapabilities, UiPolicy, RoutePolicy, ResponsivePolicy, CompilePageInput, CompilePageInputFor, CompilePageResult, PageCompiler, CapabilityIssue, } from './types.js';
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { UIDLDocument, UIDLNode } from '../types';
|
|
2
|
+
import { HostCapabilities, ListPageMeta, RoutePolicy, UiPolicy } from './types.js';
|
|
3
|
+
export interface CompileListOptions {
|
|
4
|
+
hostCapabilities: HostCapabilities;
|
|
5
|
+
uiPolicy?: UiPolicy;
|
|
6
|
+
routePolicy?: RoutePolicy;
|
|
7
|
+
docId?: string;
|
|
8
|
+
initialState?: Record<string, unknown>;
|
|
9
|
+
rowActions?: Array<{
|
|
10
|
+
label: string;
|
|
11
|
+
event?: string;
|
|
12
|
+
}>;
|
|
13
|
+
createNewActions?: Array<Record<string, unknown>>;
|
|
14
|
+
rowOpenActions?: Array<Record<string, unknown>>;
|
|
15
|
+
extraHeaderActions?: UIDLNode[];
|
|
16
|
+
extraFilterActions?: UIDLNode[];
|
|
17
|
+
}
|
|
18
|
+
export declare function compileListPage(meta: ListPageMeta, options: CompileListOptions): UIDLDocument;
|
|
19
|
+
export declare function parseListQueryParams(searchParams: URLSearchParams | string, meta: ListPageMeta): Record<string, unknown>;
|
|
20
|
+
export declare function serializeListQueryParams(state: Record<string, unknown>, meta: ListPageMeta): URLSearchParams;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { UIDLDocument, UIDLNode } from '../types';
|
|
2
|
+
import { HostCapabilities, ReportPageMeta, RoutePolicy, UiPolicy } from './types.js';
|
|
3
|
+
export interface CompileReportOptions {
|
|
4
|
+
hostCapabilities: HostCapabilities;
|
|
5
|
+
uiPolicy?: UiPolicy;
|
|
6
|
+
routePolicy?: RoutePolicy;
|
|
7
|
+
docId?: string;
|
|
8
|
+
extraHeaderActions?: UIDLNode[];
|
|
9
|
+
}
|
|
10
|
+
export declare function compileReportPage(meta: ReportPageMeta, options: CompileReportOptions): UIDLDocument;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { UIDLDocument, UIDLNode } from '../types';
|
|
2
|
+
import { HostCapabilities, RoutePolicy, SettingsPageMeta, UiPolicy } from './types.js';
|
|
3
|
+
export interface CompileSettingsOptions {
|
|
4
|
+
hostCapabilities: HostCapabilities;
|
|
5
|
+
uiPolicy?: UiPolicy;
|
|
6
|
+
routePolicy?: RoutePolicy;
|
|
7
|
+
docId?: string;
|
|
8
|
+
extraHeaderActions?: UIDLNode[];
|
|
9
|
+
}
|
|
10
|
+
export declare function compileSettingsPage(meta: SettingsPageMeta, options: CompileSettingsOptions): UIDLDocument;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { UIDLDocument, UIDLNode } from '../types';
|
|
2
|
+
import { HostCapabilities, RoutePolicy, TreePageMeta, UiPolicy } from './types.js';
|
|
3
|
+
export interface CompileTreeOptions {
|
|
4
|
+
hostCapabilities: HostCapabilities;
|
|
5
|
+
uiPolicy?: UiPolicy;
|
|
6
|
+
routePolicy?: RoutePolicy;
|
|
7
|
+
docId?: string;
|
|
8
|
+
extraHeaderActions?: UIDLNode[];
|
|
9
|
+
}
|
|
10
|
+
export declare function compileTreePage(meta: TreePageMeta, options: CompileTreeOptions): UIDLDocument;
|