@peripheries/renderer 0.23.0 → 0.24.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 +62 -34
- package/dist/catalog.js +2 -6
- package/dist/chunks/{forms-CCAE7sCu.js → forms-DxA9WzCt.js} +0 -6
- package/dist/chunks/{load-CjPvISzH.js → load-b38vUiZM.js} +0 -4
- package/dist/chunks/{page-bundles-DLRIBP8g.js → page-bundles-CPj_vx-J.js} +1 -5
- package/dist/chunks/{persistence-DCMakM9H.js → persistence-hurkUUQ0.js} +0 -6
- package/dist/chunks/{projection-yvYKzMOS.js → projection-zhu32_KJ.js} +1 -15
- package/dist/chunks/{query-LnTbQghF.js → query-D6xQbTFK.js} +0 -6
- package/dist/chunks/{refs-BLUokra5.js → refs-Csgh6rXq.js} +0 -4
- package/dist/chunks/{structure-BrKSgzRJ.js → structure-CKBtQHJq.js} +1 -7
- package/dist/chunks/{validate-B_g7719l.js → validate-BcB_PA1k.js} +2 -10
- package/dist/core.js +26 -26
- package/dist/forms.js +1 -1
- package/dist/print.js +0 -24
- package/dist/react.js +9 -27
- package/dist/runtime.js +2 -12
- package/dist/styles.css +9 -15
- package/dist/testing.js +5 -21
- package/dist/theme.js +0 -10
- package/dist/types/catalog/check.d.ts +0 -13
- package/dist/types/core/actions.d.ts +0 -24
- package/dist/types/core/bundles/load.d.ts +0 -23
- package/dist/types/core/bundles/page-bundles.d.ts +0 -9
- package/dist/types/core/bundles/refs.d.ts +1 -28
- package/dist/types/core/bundles/resolve.d.ts +0 -10
- package/dist/types/core/cell-props.d.ts +0 -20
- package/dist/types/core/cells.d.ts +0 -21
- package/dist/types/core/data-context.d.ts +0 -22
- package/dist/types/core/diagnostics.d.ts +1 -3
- package/dist/types/core/graph.d.ts +0 -54
- package/dist/types/core/index.d.ts +1 -0
- package/dist/types/core/layers.d.ts +8 -0
- package/dist/types/core/layers.gen.d.ts +12 -0
- package/dist/types/core/layout.d.ts +0 -9
- package/dist/types/core/load-page.d.ts +0 -111
- package/dist/types/core/query.d.ts +0 -64
- package/dist/types/core/references.d.ts +0 -21
- package/dist/types/core/release.d.ts +0 -10
- package/dist/types/core/rules.d.ts +0 -1
- package/dist/types/core/selected.d.ts +0 -5
- package/dist/types/core/sources.d.ts +5 -64
- package/dist/types/core/store/create-store.d.ts +0 -6
- package/dist/types/core/store/persistence.d.ts +0 -1
- package/dist/types/core/store/projection.d.ts +0 -5
- package/dist/types/core/store/scope-keys.d.ts +0 -1
- package/dist/types/core/store/types.d.ts +0 -6
- package/dist/types/core/structure.d.ts +0 -33
- package/dist/types/core/types.d.ts +0 -13
- package/dist/types/core/validate.d.ts +0 -12
- package/dist/types/core/values.d.ts +0 -6
- package/dist/types/forms/conditions.d.ts +0 -37
- package/dist/types/forms/index.d.ts +1 -0
- package/dist/types/forms/model.d.ts +4 -48
- package/dist/types/forms/port.d.ts +0 -22
- package/dist/types/forms/section.d.ts +22 -0
- package/dist/types/print/document-bindings.d.ts +0 -61
- package/dist/types/print/document-profile.d.ts +0 -137
- package/dist/types/print/map-staleness.d.ts +0 -66
- package/dist/types/print/page-map.d.ts +1 -334
- package/dist/types/print/paginate.d.ts +0 -190
- package/dist/types/print/print-layout.d.ts +0 -161
- package/dist/types/print/print-lint.d.ts +0 -109
- package/dist/types/print/print-policy.d.ts +0 -184
- package/dist/types/print/print-stylesheet.d.ts +0 -135
- package/dist/types/print/running-header.d.ts +0 -86
- package/dist/types/print/structure-print.d.ts +1 -243
- package/dist/types/react/cell-states.d.ts +0 -2
- package/dist/types/react/cell-view.d.ts +0 -16
- package/dist/types/react/page-renderer.d.ts +0 -37
- package/dist/types/react/structure-view.d.ts +0 -12
- package/dist/types/react/use-cell-store.d.ts +0 -5
- package/dist/types/react/use-container-size.d.ts +0 -5
- package/dist/types/react/use-forms-runtime.d.ts +2 -55
- package/dist/types/react/use-paging.d.ts +0 -9
- package/dist/types/runtime/boot.d.ts +0 -11
- package/dist/types/runtime/install.d.ts +0 -15
- package/dist/types/runtime/shims.d.ts +0 -8
- package/dist/types/runtime/store-export.d.ts +0 -7
- package/dist/types/testing/base-props.d.ts +0 -1
- package/dist/types/testing/components.d.ts +0 -8
- package/dist/types/testing/form-workbook.d.ts +0 -3
- package/dist/types/testing/golden.d.ts +0 -16
- package/dist/types/testing/ids.d.ts +0 -2
- package/dist/types/testing/sources.d.ts +0 -7
- package/dist/types/theme/check.d.ts +0 -2
- package/dist/types/theme/color.d.ts +0 -12
- package/dist/types/theme/derive.d.ts +0 -12
- package/dist/types/theme/parse.d.ts +0 -7
- package/package.json +2 -2
- package/dist/catalog.js.map +0 -1
- package/dist/chunks/forms-CCAE7sCu.js.map +0 -1
- package/dist/chunks/load-CjPvISzH.js.map +0 -1
- package/dist/chunks/page-bundles-DLRIBP8g.js.map +0 -1
- package/dist/chunks/persistence-DCMakM9H.js.map +0 -1
- package/dist/chunks/projection-yvYKzMOS.js.map +0 -1
- package/dist/chunks/query-LnTbQghF.js.map +0 -1
- package/dist/chunks/refs-BLUokra5.js.map +0 -1
- package/dist/chunks/structure-BrKSgzRJ.js.map +0 -1
- package/dist/chunks/validate-B_g7719l.js.map +0 -1
- package/dist/core.js.map +0 -1
- package/dist/print.js.map +0 -1
- package/dist/react.js.map +0 -1
- package/dist/runtime.js.map +0 -1
- package/dist/testing.js.map +0 -1
- package/dist/theme.js.map +0 -1
package/README.md
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
# @peripheries/renderer
|
|
2
2
|
|
|
3
|
-
The one renderer for pages built from federated component bundles
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
page looks the same in each.
|
|
3
|
+
The one renderer for pages built from federated component bundles. Hosts,
|
|
4
|
+
component repos' harnesses and previews all render through it, so a page looks
|
|
5
|
+
the same in each.
|
|
7
6
|
|
|
8
7
|
| Entry | Holds |
|
|
9
8
|
|---|---|
|
|
10
|
-
| `@peripheries/renderer/core` | Framework-free: cells and thin-ref hydration, references and conditions, the data context, walks and state names, cell props, layout, document structure, bundle refs and resolution, the shared store, `loadPageData(page, source)`, validation, `DIAGNOSTICS` and `PAGE_RULES` |
|
|
11
|
-
| `@peripheries/renderer/catalog` | `checkCatalog`: what a component repo runs on the knowledge it emits
|
|
12
|
-
| `@peripheries/renderer/react` | `PageRenderer`, `CellView`, `StructureView`, the cell states, `useContainerSize` |
|
|
9
|
+
| `@peripheries/renderer/core` | Framework-free: cells and thin-ref hydration, references and conditions, the data context, walks and state names (`layerName`, the layer catalog `LAYER_ROLES`), cell props, layout, document structure, bundle refs and resolution, the shared store, `loadPageData(page, source)`, validation, `DIAGNOSTICS` and `PAGE_RULES` |
|
|
10
|
+
| `@peripheries/renderer/catalog` | `checkCatalog`: what a component repo runs on the knowledge it emits. The only entry with a JSON Schema validator (ajv) |
|
|
11
|
+
| `@peripheries/renderer/react` | `PageRenderer`, `CellView`, `StructureView`, the cell states, `useContainerSize`, `useFormsRuntime` and its `FormSlotProps` and `FormAnswer` |
|
|
13
12
|
| `@peripheries/renderer/runtime` | What a page boots with: the import map and boot script, the shims, `installRuntime`, the store bundles import |
|
|
14
|
-
| `@peripheries/renderer/theme` | The org theme pipeline
|
|
13
|
+
| `@peripheries/renderer/theme` | The org theme pipeline: `parseTheme` (version 1 or 2 in, version 2 out, with diagnostics), `themeTokens` (semantic overrides derived in OKLCH), `themeCss` (the `theme` layer), `checkTheme` (WCAG contrast) |
|
|
15
14
|
| `@peripheries/renderer/print` | The print pipeline, framework-free: `collectBlocks` (the page map), `paginate`, `buildPrintLayout` (the packer's decision as CSS), `buildPageStylesheet` (`@page` geometry and margin boxes), running headers, `@printPolicy` parsing, print lint, `resolveDocumentProfile`, region bindings, map staleness, and the `layout.structure[].print` writer |
|
|
15
|
+
| `@peripheries/renderer/forms` | The forms runtime, framework-free: the steps overlay and its model, conditions, modes, navigation, progress, deep links, and the persistence port (`FormsPort`), and the form-section contract's type (`FormSection`, `FormContentBlock`); the React hook is `useFormsRuntime` in `/react` |
|
|
16
16
|
| `@peripheries/renderer/testing` | The golden pages, synthetic fixtures, and sources that serve them |
|
|
17
17
|
| `@peripheries/renderer/styles.css` | Page and cell containers, the responsive buckets, placeholders and notices, in the `renderer` layer |
|
|
18
18
|
|
|
@@ -32,9 +32,18 @@ const runtime = await loadPageData(page, source, { params, baseProps, viewer, co
|
|
|
32
32
|
|
|
33
33
|
`RendererEnvironment` takes, besides `core`, `navigate` and `store`:
|
|
34
34
|
|
|
35
|
-
- `actionsFor(cell)`: the actions a cell gets
|
|
36
|
-
|
|
37
|
-
|
|
35
|
+
- `actionsFor(cell)`: the actions a cell gets;
|
|
36
|
+
`projectCellActions(cell.actions, pageActions)` applies the lookup rule
|
|
37
|
+
(binding key, then registry key, then the cell's own name).
|
|
38
|
+
- `runAction`: runs a cell's declared action (the host's write path, or a
|
|
39
|
+
harness's mock); without it a declared action reports `FAILED`.
|
|
40
|
+
- `loadPage`: loads a paged label's next page.
|
|
41
|
+
- `onPropSources(cell, sources)`: each rendered cell's props, leaf by leaf,
|
|
42
|
+
with where each value came from (for an edit layer, with `editTarget`).
|
|
43
|
+
- `retry()`: reads the page again, for a failed cell's "Try again".
|
|
44
|
+
- `cellProps(cell)`: props from the page's runtime, merged last; on a form
|
|
45
|
+
page, `useFormsRuntime`'s `cellProps` gives each cell `form`, `answers` and
|
|
46
|
+
`answer`.
|
|
38
47
|
- `onCellError(cellId, error)`: a component threw. The cell shows an error
|
|
39
48
|
notice either way.
|
|
40
49
|
- `onUnresolvedReference(cellId, ref)`: a prop's `@ref` resolved to nothing
|
|
@@ -52,8 +61,7 @@ sharing the channel reads it.
|
|
|
52
61
|
## The names a bundle may rely on
|
|
53
62
|
|
|
54
63
|
What the renderer writes, for a bundle's CSS and checks. These are the only
|
|
55
|
-
names: 0.8.0 dropped the old client-prefixed twins and container names
|
|
56
|
-
(design/core-and-tokens.md §14).
|
|
64
|
+
names: 0.8.0 dropped the old client-prefixed twins and container names.
|
|
57
65
|
|
|
58
66
|
| Where | Name |
|
|
59
67
|
|---|---|
|
|
@@ -69,9 +77,29 @@ bundle's `ThemeProvider` export.
|
|
|
69
77
|
|
|
70
78
|
## Versions
|
|
71
79
|
|
|
72
|
-
- **0.
|
|
73
|
-
|
|
74
|
-
|
|
80
|
+
- **0.24.0** (2026-10-20): one renderer batch (CX).
|
|
81
|
+
- **`layerName(system)` and `LAYER_ROLES`** in `/core`: a system's state name (its layer's role,
|
|
82
|
+
else a registered layer's own type, `question`, `answer`, …) from the layer catalog, which is
|
|
83
|
+
generated from `public.system_layer` (`npm run gen:layers`; CI checks it is current). A host
|
|
84
|
+
and BEA's preview resolve a page's state names alike. An unregistered type has no name.
|
|
85
|
+
- **`FormSection` and `FormContentBlock`** in `/forms`: a form section cell's `props.section`,
|
|
86
|
+
contract v1 (`contracts/form-section.schema.json`): the section node's `id`, its authored
|
|
87
|
+
`sectionId`, `title`, `description?`, `sectionType?`, its `questions` (`{ key, label, required,
|
|
88
|
+
definition }`, the definition the form-definition contract's question or null) and its
|
|
89
|
+
`content` blocks (the form-definition contract's content block). Static: visibility, answers
|
|
90
|
+
and totals stay runtime (`forms.*`, `FormAnswer`, unchanged). v1 is the target shape: the
|
|
91
|
+
component engine doesn't emit `props.section` yet; the cutover is in the stack's
|
|
92
|
+
`contracts/README.md`.
|
|
93
|
+
- **`FormQuestionDefinition`'s** `options`, `validation`, `description` and `helpText` may be
|
|
94
|
+
null, as the form-definition contract's question has them.
|
|
95
|
+
|
|
96
|
+
- **0.23.1** (2026-10-15): the published files carry no comments and no
|
|
97
|
+
source maps (declarations included); this README is the documentation.
|
|
98
|
+
No API change.
|
|
99
|
+
|
|
100
|
+
- **0.23.0** (2026-10-15): the
|
|
101
|
+
versions and forms release, in one minor.
|
|
102
|
+
- **Main only:** `prepareDocument` reads
|
|
75
103
|
main systems and placements only, adding `version: { is: NULL }` to
|
|
76
104
|
`systemCollection`, `graph_nodeCollection` and `graph_edgeCollection`
|
|
77
105
|
at any depth. New diagnostics: `SYSTEM_NOT_MAIN` (a warning: a page
|
|
@@ -96,14 +124,15 @@ bundle's `ThemeProvider` export.
|
|
|
96
124
|
which (`recorded` | `context`), and `PageRuntime.readVersionIds` the
|
|
97
125
|
versions the states were read from, for print's and an embed's "Release
|
|
98
126
|
N". A state row may carry `versionId`, `unversioned` and `outOfScope`.
|
|
99
|
-
- **Render-time functions:** `RENDER_FUNCTIONS` adds
|
|
127
|
+
- **Render-time functions:** `RENDER_FUNCTIONS` adds the version reads
|
|
100
128
|
(`node_states_as_of`, `node_state_view`, `version_context_for`,
|
|
101
129
|
`version_scope_members`, `versions_for`, `version_diff`,
|
|
102
130
|
`auto_release_status`), each with the tables it reads for
|
|
103
131
|
invalidation.
|
|
104
|
-
- **Declared ahead:** `form_answers(p_structure_nodes: [UUID!]!)`
|
|
105
|
-
|
|
106
|
-
|
|
132
|
+
- **Declared ahead:** `form_answers(p_structure_nodes: [UUID!]!)` is a
|
|
133
|
+
render function now, listed in `RENDER_FUNCTIONS_AHEAD` until the
|
|
134
|
+
database has it, so descriptors can read a workbook's answers without a
|
|
135
|
+
renderer release. Its JSON is a leaf:
|
|
107
136
|
`result.path` reads into it and nothing in it is flattened. An alias on
|
|
108
137
|
a render function's JSON root is refused (`DESCRIPTOR_ALIAS_JSON_ROOT`),
|
|
109
138
|
since its JSON is decoded by field name.
|
|
@@ -117,7 +146,7 @@ bundle's `ThemeProvider` export.
|
|
|
117
146
|
- **Releases:** `validateManifest(pages)` returns `ReleaseProblem[]`,
|
|
118
147
|
advisory before a release; `manifestPageFrom(graphNodeId, data)` reads a
|
|
119
148
|
page artifact's state data as a manifest page. The runtime adds `PageView` and
|
|
120
|
-
`SubmissionData
|
|
149
|
+
`SubmissionData`.
|
|
121
150
|
- **The forms runtime** (`@peripheries/renderer/forms`): the steps
|
|
122
151
|
overlay, modes, navigation, saving, progress and deep links behind
|
|
123
152
|
`FormsPort { save, submit, visit, reopen }` (and, optional, `upload` and
|
|
@@ -156,10 +185,10 @@ bundle's `ThemeProvider` export.
|
|
|
156
185
|
null, never an email or a user id;
|
|
157
186
|
- a component reads `form`, `answers` and `answer` from its props on a
|
|
158
187
|
form page, and puts `answer.inputId` on its control.
|
|
159
|
-
-
|
|
160
|
-
|
|
188
|
+
- page ids (an embed's `page_id`, `PageScope`'s page) become anchor
|
|
189
|
+
ids; the renderer treats them as opaque, so nothing changes.
|
|
161
190
|
|
|
162
|
-
- **0.10.0
|
|
191
|
+
- **0.10.0:** actions run, documents edit, pages embed.
|
|
163
192
|
- Declared actions run through the environment's `runAction`; the runtime's
|
|
164
193
|
`ACTION_FIELDS` takes `subjects` and `audience` on `create`, `edit` and
|
|
165
194
|
`append`, and `create` needs `edge_type` only under a parent.
|
|
@@ -175,9 +204,8 @@ bundle's `ThemeProvider` export.
|
|
|
175
204
|
- A nullable query variable whose whole reference reads `@params`,
|
|
176
205
|
`@context` or `@viewer` and resolves to nothing is sent as `null`.
|
|
177
206
|
- PAGE_RULES is shorter (3780 characters) and describes embed cells.
|
|
178
|
-
- **0.9.0
|
|
179
|
-
|
|
180
|
-
the renderer half of actions (§9.2).
|
|
207
|
+
- **0.9.0:** queries, realtime's inputs, the host contract retired, and
|
|
208
|
+
the renderer half of actions.
|
|
181
209
|
- A label can be `{ descriptor: QueryDescriptor }`, or a node binding to a
|
|
182
210
|
live `query_data` node, whose descriptor runs instead of returning its
|
|
183
211
|
state. `GraphSource` gains `query(descriptor, variables)`, which returns
|
|
@@ -208,7 +236,7 @@ bundle's `ThemeProvider` export.
|
|
|
208
236
|
|
|
209
237
|
- **0.8.1:** `BaseProps` carries the org's `locale` and `currency` (from its
|
|
210
238
|
org template's metadata), which `@stack/charts` formats with.
|
|
211
|
-
- **0.8.0:** the old names go
|
|
239
|
+
- **0.8.0:** the old names go. The renderer
|
|
212
240
|
writes only the attributes and container names above, the runtime installs
|
|
213
241
|
only `__STACK_RUNTIME__` and maps only `@stack/store`, and the store has no
|
|
214
242
|
second hook name. A bundle's `ThemeProvider` is no longer lifted or wrapped
|
|
@@ -216,15 +244,15 @@ bundle's `ThemeProvider` export.
|
|
|
216
244
|
gone). `@peripheries/runtime` 0.8.0 drops `LEGACY_RUNTIME_GLOBAL` and
|
|
217
245
|
`SPECIFIER_ALIASES`.
|
|
218
246
|
|
|
219
|
-
- **0.7.3:** the page container also carries `data-page-grid`, the
|
|
220
|
-
|
|
247
|
+
- **0.7.3:** the page container also carries `data-page-grid`, the
|
|
248
|
+
canonical name of the old page-grid attribute, so every attribute
|
|
221
249
|
the renderer writes has its canonical name (above) before the old ones go.
|
|
222
250
|
|
|
223
251
|
- **0.7.2:** the package ships its LICENSE: proprietary to Peripheries Studio
|
|
224
252
|
Inc., all rights reserved.
|
|
225
253
|
- **0.7.1:** `bundleScope` puts the advisor org's `main` after the shared
|
|
226
254
|
lineages, so an advisor org's older copy of a core component never shadows
|
|
227
|
-
core on a client org's page
|
|
255
|
+
core on a client org's page.
|
|
228
256
|
- **0.7.0:** shared lineages and the theme. `bundleScope` appends the
|
|
229
257
|
platform's shared lineages, and the loader imports them by specifier;
|
|
230
258
|
`@core/` resolves from `stack/core` (`host:` is retired); `importMapFor` and
|
|
@@ -264,7 +292,7 @@ bundle's `ThemeProvider` export.
|
|
|
264
292
|
- **0.3.0:** `@peripheries/runtime/rank`, sibling order on `graph_node.rank`
|
|
265
293
|
(`compareRank`, `sortByRank`, `rankBetween` and the rest), so no one
|
|
266
294
|
vendors it; the `WALK_NODE_TYPES_EMPTY` warning, because `nodeTypes: []`
|
|
267
|
-
filters nothing
|
|
295
|
+
filters nothing (it doesn't mean "enter nothing").
|
|
268
296
|
- **0.2.0:** the hooks above, `pageRuntimeFromValues`, action projection,
|
|
269
297
|
`data-missing-component` on a missing component's notice, the theme passed
|
|
270
298
|
to `ThemeProvider`, store defaults seeded.
|
|
@@ -285,7 +313,7 @@ to fix it; `Diagnostic.code` is typed from that table. Tools show the fix with
|
|
|
285
313
|
the diagnostic, so a writer learns a rule when they break it.
|
|
286
314
|
|
|
287
315
|
**`PAGE_RULES`** (from `/core`) is the host's rules for composing a page, the
|
|
288
|
-
short text a writer reads first
|
|
316
|
+
short text a writer reads first. It is built from the
|
|
289
317
|
constants the renderer and validator use, so it changes when they do.
|
|
290
318
|
|
|
291
319
|
`core` imports no React at runtime and never reaches the network, and the
|
|
@@ -296,4 +324,4 @@ code; the golden pages run over fixture sources in `react/golden-pages.test.tsx`
|
|
|
296
324
|
publishes every package whose version isn't on npm yet, built output only;
|
|
297
325
|
`.github/workflows/publish-packages.yml` stages each new version from
|
|
298
326
|
`develop`, and a maintainer approves it on npmjs.com. Bump the version here to
|
|
299
|
-
release
|
|
327
|
+
release.
|
package/dist/catalog.js
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { x as isEach } from "./chunks/query-
|
|
2
|
-
import { i as eachFormProblems, s as validatePage } from "./chunks/validate-
|
|
1
|
+
import { x as isEach } from "./chunks/query-D6xQbTFK.js";
|
|
2
|
+
import { i as eachFormProblems, s as validatePage } from "./chunks/validate-BcB_PA1k.js";
|
|
3
3
|
import { KNOWLEDGE_BUDGETS, KNOWLEDGE_KEY } from "@peripheries/runtime";
|
|
4
4
|
import Ajv2020 from "ajv/dist/2020.js";
|
|
5
|
-
//#region packages/renderer/src/catalog/check.ts
|
|
6
5
|
var ref = (kind, key) => `${kind}:${key}`;
|
|
7
6
|
var size = (v) => JSON.stringify(v ?? null).length;
|
|
8
7
|
var isReference = (v) => typeof v === "string" && (v.startsWith("@") || v.includes("${"));
|
|
@@ -272,7 +271,4 @@ function validateLiteral(schema, value, path, push, ajv) {
|
|
|
272
271
|
if (!ajv.validate(schema, value)) push("error", "PROP_INVALID", path, ajv.errorsText(ajv.errors, { dataVar: "" }).replace(/^\s+/, ""));
|
|
273
272
|
} catch {}
|
|
274
273
|
}
|
|
275
|
-
//#endregion
|
|
276
274
|
export { checkCatalog, validatePageProps };
|
|
277
|
-
|
|
278
|
-
//# sourceMappingURL=catalog.js.map
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
//#region packages/renderer/src/forms/conditions.ts
|
|
2
1
|
var CONDITION_OPS = [
|
|
3
2
|
"eq",
|
|
4
3
|
"ne",
|
|
@@ -188,8 +187,6 @@ function normalizeCondition(legacy) {
|
|
|
188
187
|
problems
|
|
189
188
|
};
|
|
190
189
|
}
|
|
191
|
-
//#endregion
|
|
192
|
-
//#region packages/renderer/src/forms/model.ts
|
|
193
190
|
var answered = (v) => v !== void 0 && v !== null && !(typeof v === "string" && v.trim() === "") && !(Array.isArray(v) && v.length === 0);
|
|
194
191
|
function visibleSteps(model, values) {
|
|
195
192
|
const shows = (when) => evaluateCondition(when ?? null, values);
|
|
@@ -336,7 +333,4 @@ function linkTo(steps, mode, at) {
|
|
|
336
333
|
...at.question ? { question: at.question } : {}
|
|
337
334
|
};
|
|
338
335
|
}
|
|
339
|
-
//#endregion
|
|
340
336
|
export { CONDITION_OPS as _, goToQuestion as a, normalizeCondition as b, missing as c, positionsOf as d, progress as f, visibleSteps as g, stepKind as h, goTo as i, move as l, settle as m, enterAdvances as n, isReadOnlyStatus as o, questionsOf as p, fromPageSteps as r, linkTo as s, defaultMode as t, positionFromLink as u, evaluateCondition as v, normalizeOperator as x, isConditionOp as y };
|
|
341
|
-
|
|
342
|
-
//# sourceMappingURL=forms-CCAE7sCu.js.map
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { READY_GLOBAL } from "@peripheries/runtime";
|
|
2
|
-
//#region packages/renderer/src/core/bundles/load.ts
|
|
3
2
|
function isComponentExport(value) {
|
|
4
3
|
if (typeof value === "function") return true;
|
|
5
4
|
if (!value || typeof value !== "object") return false;
|
|
@@ -66,7 +65,4 @@ async function loadBundles(rows, files) {
|
|
|
66
65
|
function _clearBundleCache() {
|
|
67
66
|
cache.clear();
|
|
68
67
|
}
|
|
69
|
-
//#endregion
|
|
70
68
|
export { loadBundlesSettled as a, loadBundles as i, isComponentExport as n, projectModule as o, loadBundle as r, runtimeReady as s, _clearBundleCache as t };
|
|
71
|
-
|
|
72
|
-
//# sourceMappingURL=load-CjPvISzH.js.map
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { a as normalizeRef, o as refKey } from "./refs-
|
|
2
|
-
//#region packages/renderer/src/core/bundles/page-bundles.ts
|
|
1
|
+
import { a as normalizeRef, o as refKey } from "./refs-Csgh6rXq.js";
|
|
3
2
|
function pageBundleRefs(scope, cells, pageOrgId) {
|
|
4
3
|
const out = [...scope];
|
|
5
4
|
const seen = new Set(out.map(refKey));
|
|
@@ -28,7 +27,4 @@ function pageBundles(scope, rows, loaded, pageOrgId, failed = false) {
|
|
|
28
27
|
}
|
|
29
28
|
};
|
|
30
29
|
}
|
|
31
|
-
//#endregion
|
|
32
30
|
export { pageBundles as n, pageBundleRefs as t };
|
|
33
|
-
|
|
34
|
-
//# sourceMappingURL=page-bundles-DLRIBP8g.js.map
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { Store } from "@tanstack/store";
|
|
2
|
-
//#region packages/renderer/src/core/store/create-store.ts
|
|
3
2
|
function createStackStore(initial) {
|
|
4
3
|
const store = new Store({
|
|
5
4
|
selections: {},
|
|
@@ -89,8 +88,6 @@ function createStackStore(initial) {
|
|
|
89
88
|
subscribe: (listener) => store.subscribe(() => listener(getState()))
|
|
90
89
|
};
|
|
91
90
|
}
|
|
92
|
-
//#endregion
|
|
93
|
-
//#region packages/renderer/src/core/store/persistence.ts
|
|
94
91
|
var KEY_PREFIX = "stack.store.";
|
|
95
92
|
function storageFor(mode) {
|
|
96
93
|
if (typeof window === "undefined" || mode === "none") return null;
|
|
@@ -134,7 +131,4 @@ function clearAllScopes() {
|
|
|
134
131
|
} catch {}
|
|
135
132
|
}
|
|
136
133
|
}
|
|
137
|
-
//#endregion
|
|
138
134
|
export { createStackStore as a, saveScope as i, clearScope as n, loadScope as r, clearAllScopes as t };
|
|
139
|
-
|
|
140
|
-
//# sourceMappingURL=persistence-DCMakM9H.js.map
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { t as CORE_SPECIFIER } from "./refs-
|
|
2
|
-
//#region packages/renderer/src/core/cells.ts
|
|
1
|
+
import { t as CORE_SPECIFIER } from "./refs-Csgh6rXq.js";
|
|
3
2
|
var HYDRATED_CELL_FIELDS = [
|
|
4
3
|
"component",
|
|
5
4
|
"props",
|
|
@@ -86,8 +85,6 @@ function rootCells(cells) {
|
|
|
86
85
|
const roots = cells.filter((c) => !nested.has(c.id));
|
|
87
86
|
return roots.length ? roots : cells;
|
|
88
87
|
}
|
|
89
|
-
//#endregion
|
|
90
|
-
//#region packages/renderer/src/core/cell-props.ts
|
|
91
88
|
function projectCellData(cell, ctx) {
|
|
92
89
|
if (!cell.data) return null;
|
|
93
90
|
const data = { ...cell.data.static };
|
|
@@ -149,8 +146,6 @@ function assembleCellProps(i) {
|
|
|
149
146
|
if (i.renderComponent) props.renderComponent = i.renderComponent;
|
|
150
147
|
return props;
|
|
151
148
|
}
|
|
152
|
-
//#endregion
|
|
153
|
-
//#region packages/renderer/src/core/layout.ts
|
|
154
149
|
function pageContainerStyle(layout) {
|
|
155
150
|
const type = layout?.type ?? "stack";
|
|
156
151
|
const gap = typeof layout?.gap === "number" ? `${layout.gap}px` : typeof layout?.gap === "string" ? layout.gap : "16px";
|
|
@@ -209,8 +204,6 @@ function documentProfile(layout) {
|
|
|
209
204
|
const profile = layout.profile;
|
|
210
205
|
return typeof profile === "string" && /^[a-z][a-z0-9-]*$/.test(profile) ? profile : void 0;
|
|
211
206
|
}
|
|
212
|
-
//#endregion
|
|
213
|
-
//#region packages/renderer/src/core/bundles/resolve.ts
|
|
214
207
|
function resolveComponent(name, { cellBundle, scope, core }) {
|
|
215
208
|
if (name.startsWith("@core/")) {
|
|
216
209
|
const bare = name.slice(6);
|
|
@@ -239,8 +232,6 @@ function resolveComponent(name, { cellBundle, scope, core }) {
|
|
|
239
232
|
source: "core"
|
|
240
233
|
} : null;
|
|
241
234
|
}
|
|
242
|
-
//#endregion
|
|
243
|
-
//#region packages/renderer/src/core/store/scope-keys.ts
|
|
244
235
|
var pageScopeKey = (pageId) => `page:${pageId}`;
|
|
245
236
|
var projectScopeKey = (projectId) => `project:${projectId}`;
|
|
246
237
|
function resolveScopeId(kind, ctx) {
|
|
@@ -248,8 +239,6 @@ function resolveScopeId(kind, ctx) {
|
|
|
248
239
|
if (kind === "project") return ctx.projectId ? projectScopeKey(ctx.projectId) : null;
|
|
249
240
|
return null;
|
|
250
241
|
}
|
|
251
|
-
//#endregion
|
|
252
|
-
//#region packages/renderer/src/core/store/projection.ts
|
|
253
242
|
var setterName = (name) => "set" + name.charAt(0).toUpperCase() + name.slice(1);
|
|
254
243
|
function projectSelections(decls, state, ctx) {
|
|
255
244
|
if (!decls) return void 0;
|
|
@@ -315,7 +304,4 @@ function collectScopeIds(ctx, selections, viewState) {
|
|
|
315
304
|
}
|
|
316
305
|
return [...ids];
|
|
317
306
|
}
|
|
318
|
-
//#endregion
|
|
319
307
|
export { normalizeCell as C, hasRef as S, rootCells as T, failedLabels as _, projectSelections as a, HYDRATED_CELL_FIELDS as b, pageScopeKey as c, resolveComponent as d, cellAttributes as f, assembleCellProps as g, pageContainerStyle as h, projectLive as i, projectScopeKey as l, documentProfile as m, attachViewStateSetters as n, projectViewState as o, cellPlacementStyle as p, collectScopeIds as r, shallowEqualBundle as s, attachSelectionSetters as t, resolveScopeId as u, projectCellData as v, resolveCell as w, STORE_FIELDS as x, CONTENT_FIELDS as y };
|
|
320
|
-
|
|
321
|
-
//# sourceMappingURL=projection-yvYKzMOS.js.map
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { DESCRIPTOR_VERSION, GRAPHQL_MAX_ROWS } from "@peripheries/runtime";
|
|
2
2
|
import { Kind, parse, print, visit } from "graphql";
|
|
3
|
-
//#region packages/renderer/src/core/references.ts
|
|
4
3
|
var STRICT_REF$1 = /^@[A-Za-z0-9_$-]+(\.[A-Za-z0-9_$[\]-]+)*$/;
|
|
5
4
|
var INTERPOLATION = /\$\{(?:context\.)?([^}]+)\}/g;
|
|
6
5
|
var UnresolvedReference = class extends Error {
|
|
@@ -215,8 +214,6 @@ function passesConditions(conditions, ctx) {
|
|
|
215
214
|
if (hideIf !== void 0 && hideIf !== "" && resolveReferences(hideIf, ctx)) return false;
|
|
216
215
|
return true;
|
|
217
216
|
}
|
|
218
|
-
//#endregion
|
|
219
|
-
//#region packages/renderer/src/core/query.ts
|
|
220
217
|
var RENDER_FUNCTIONS = {
|
|
221
218
|
walk_graph: [
|
|
222
219
|
"edge",
|
|
@@ -948,7 +945,4 @@ var queryKey = (descriptor, variables) => JSON.stringify([
|
|
|
948
945
|
descriptor.result?.path ?? null,
|
|
949
946
|
descriptor.result?.flatten_connections !== false
|
|
950
947
|
]);
|
|
951
|
-
//#endregion
|
|
952
948
|
export { passesConditions as C, pageContext as S, settled as T, EACH as _, VARIABLE_NAMESPACES as a, cellResolutionContext as b, pageVariables as c, resolveDescriptorVariables as d, selectionShape as f, variableReferences as g, variableLabels as h, UnsafeDocumentError as i, prepareDocument as l, validateDescriptor as m, RENDER_FUNCTIONS as n, descriptorShape as o, shapeAt as p, RENDER_FUNCTIONS_AHEAD as r, orderByVariable as s, PAGING_VARIABLES as t, queryKey as u, EACH_DEFAULT_AS as v, resolveReferences as w, isEach as x, cellContext as y };
|
|
953
|
-
|
|
954
|
-
//# sourceMappingURL=query-LnTbQghF.js.map
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
//#region packages/renderer/src/core/bundles/refs.ts
|
|
2
1
|
var CORE_SPECIFIER = "@stack/core";
|
|
3
2
|
var MAIN = "main";
|
|
4
3
|
var PUBLIC = "public";
|
|
@@ -65,7 +64,4 @@ function bundleScope(input) {
|
|
|
65
64
|
});
|
|
66
65
|
return out;
|
|
67
66
|
}
|
|
68
|
-
//#endregion
|
|
69
67
|
export { normalizeRef as a, bundleScope as i, MAIN as n, refKey as o, PUBLIC as r, CORE_SPECIFIER as t };
|
|
70
|
-
|
|
71
|
-
//# sourceMappingURL=refs-BLUokra5.js.map
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { T as settled, w as resolveReferences, x as isEach } from "./query-
|
|
1
|
+
import { T as settled, w as resolveReferences, x as isEach } from "./query-D6xQbTFK.js";
|
|
2
2
|
import { ACTION_FIELDS, ACTION_KINDS, SECTION_KINDS as SECTION_KINDS$1, isGraphAction } from "@peripheries/runtime";
|
|
3
|
-
//#region packages/renderer/src/core/actions.ts
|
|
4
3
|
var actionBindingKey = (registry, entityKey) => entityKey ? `${registry}#${entityKey}` : registry;
|
|
5
4
|
function normalizeActionDeclaration(decl) {
|
|
6
5
|
if (typeof decl === "string") return decl.trim() ? {
|
|
@@ -148,8 +147,6 @@ function declaredActions(cell, ctx, runAction) {
|
|
|
148
147
|
}
|
|
149
148
|
return Object.keys(out).length ? out : void 0;
|
|
150
149
|
}
|
|
151
|
-
//#endregion
|
|
152
|
-
//#region packages/renderer/src/core/structure.ts
|
|
153
150
|
var PAGE_DOCUMENT = "__page__";
|
|
154
151
|
function normalizeStructure(nodes) {
|
|
155
152
|
if (!Array.isArray(nodes)) return [];
|
|
@@ -383,7 +380,4 @@ function tableOfContents(structure, cells = []) {
|
|
|
383
380
|
});
|
|
384
381
|
return walk(normalizeStructure(structure), 1, PAGE_DOCUMENT);
|
|
385
382
|
}
|
|
386
|
-
//#endregion
|
|
387
383
|
export { resolveAction as C, projectCellActions as S, actionBindingKey as _, deriveSectionReferences as a, declaredActions as b, nodePrintStyle as c, referencesFor as d, sectionAnchor as f, usesStructureLayout as g, tableOfContents as h, deriveSectionNumbering as i, normalizeStructure as l, structureIssues as m, SECTION_KINDS$1 as n, isSectionNode as o, sortByOrder as p, deriveElementReferences as r, mergeSectionReferences as s, PAGE_DOCUMENT as t, numberingFor as u, actionProblems as v, normalizeActionDeclaration as x, actionReferences as y };
|
|
388
|
-
|
|
389
|
-
//# sourceMappingURL=structure-BrKSgzRJ.js.map
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { _ as EACH, h as variableLabels, m as validateDescriptor, o as descriptorShape, p as shapeAt, v as EACH_DEFAULT_AS, x as isEach } from "./query-
|
|
2
|
-
import { g as usesStructureLayout, m as structureIssues, v as actionProblems } from "./structure-
|
|
1
|
+
import { _ as EACH, h as variableLabels, m as validateDescriptor, o as descriptorShape, p as shapeAt, v as EACH_DEFAULT_AS, x as isEach } from "./query-D6xQbTFK.js";
|
|
2
|
+
import { g as usesStructureLayout, m as structureIssues, v as actionProblems } from "./structure-CKBtQHJq.js";
|
|
3
3
|
import { DEFAULT_STATE, STATE_NAMES, WALK_DEFAULTS, isDescriptorBinding, isGraphAction, isStateName } from "@peripheries/runtime";
|
|
4
|
-
//#region packages/renderer/src/core/graph.ts
|
|
5
4
|
var TIER_OF_GRAPH_TYPE = {
|
|
6
5
|
"meta-process": "meta",
|
|
7
6
|
"process-eng": "eng",
|
|
@@ -223,8 +222,6 @@ function readWalk(raw, request) {
|
|
|
223
222
|
diagnostics
|
|
224
223
|
};
|
|
225
224
|
}
|
|
226
|
-
//#endregion
|
|
227
|
-
//#region packages/renderer/src/core/selected.ts
|
|
228
225
|
var STRICT_REF$1 = /^@([A-Za-z0-9_$-]+)((?:\.[A-Za-z0-9_$[\]-]+)*)$/;
|
|
229
226
|
var shapes = new Map();
|
|
230
227
|
function shapeOf(d) {
|
|
@@ -273,8 +270,6 @@ function selectionIssues(cell, queries, at) {
|
|
|
273
270
|
visit(cell.conditions, `${at}.conditions`, top);
|
|
274
271
|
return out;
|
|
275
272
|
}
|
|
276
|
-
//#endregion
|
|
277
|
-
//#region packages/renderer/src/core/validate.ts
|
|
278
273
|
var words = (name) => name.replace(/([a-z0-9])([A-Z])/g, "$1 $2").toLowerCase().split(/[\s_-]+/).filter(Boolean);
|
|
279
274
|
function editDistance(a, b) {
|
|
280
275
|
let prev = Array.from({ length: b.length + 1 }, (_, j) => j);
|
|
@@ -831,7 +826,4 @@ function slotIssues(cells, catalog) {
|
|
|
831
826
|
});
|
|
832
827
|
return out;
|
|
833
828
|
}
|
|
834
|
-
//#endregion
|
|
835
829
|
export { stateValue as _, nearestNames as a, walkKey as b, selectionIssues as c, needsWalk as d, readField as f, stateNames as g, resolveWalkStart as h, eachFormProblems as i, RESERVED_LABELS as l, referencedLabels as m, STORE_SCOPES as n, validateCell as o, readWalk as p, WALK_DIRECTIONS as r, validatePage as s, RESPONSIVE_BUCKETS as t, mergeStates as u, systemsFromGraphs as v, walkRequest as x, systemsFromProcess as y };
|
|
836
|
-
|
|
837
|
-
//# sourceMappingURL=validate-B_g7719l.js.map
|
package/dist/core.js
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
import { C as normalizeCell, S as hasRef, T as rootCells, a as projectSelections, b as HYDRATED_CELL_FIELDS, c as pageScopeKey, d as resolveComponent, f as cellAttributes, g as assembleCellProps, h as pageContainerStyle, i as projectLive, l as projectScopeKey, n as attachViewStateSetters, o as projectViewState, p as cellPlacementStyle, r as collectScopeIds, s as shallowEqualBundle, t as attachSelectionSetters, u as resolveScopeId, v as projectCellData, w as resolveCell, x as STORE_FIELDS, y as CONTENT_FIELDS } from "./chunks/projection-
|
|
2
|
-
import { C as passesConditions, S as pageContext, T as settled, _ as EACH, a as VARIABLE_NAMESPACES, b as cellResolutionContext, c as pageVariables, d as resolveDescriptorVariables, f as selectionShape, g as variableReferences, h as variableLabels, i as UnsafeDocumentError, l as prepareDocument, m as validateDescriptor, n as RENDER_FUNCTIONS, o as descriptorShape, p as shapeAt, r as RENDER_FUNCTIONS_AHEAD, s as orderByVariable, t as PAGING_VARIABLES, u as queryKey, v as EACH_DEFAULT_AS, w as resolveReferences, x as isEach, y as cellContext } from "./chunks/query-
|
|
3
|
-
import { _ as stateValue, a as nearestNames, b as walkKey, c as selectionIssues, d as needsWalk, f as readField, g as stateNames, h as resolveWalkStart, i as eachFormProblems, l as RESERVED_LABELS, m as referencedLabels, n as STORE_SCOPES, o as validateCell, p as readWalk, r as WALK_DIRECTIONS, s as validatePage, t as RESPONSIVE_BUCKETS, u as mergeStates, v as systemsFromGraphs, x as walkRequest, y as systemsFromProcess } from "./chunks/validate-
|
|
4
|
-
import { C as resolveAction, S as projectCellActions, _ as actionBindingKey, a as deriveSectionReferences, b as declaredActions, c as nodePrintStyle, d as referencesFor, f as sectionAnchor, g as usesStructureLayout, h as tableOfContents, i as deriveSectionNumbering, l as normalizeStructure, m as structureIssues, n as SECTION_KINDS, r as deriveElementReferences, s as mergeSectionReferences, t as PAGE_DOCUMENT, u as numberingFor, v as actionProblems, x as normalizeActionDeclaration, y as actionReferences } from "./chunks/structure-
|
|
5
|
-
import { a as loadBundlesSettled, i as loadBundles, n as isComponentExport, o as projectModule, r as loadBundle, s as runtimeReady, t as _clearBundleCache } from "./chunks/load-
|
|
6
|
-
import { a as normalizeRef, i as bundleScope, n as MAIN, o as refKey, r as PUBLIC, t as CORE_SPECIFIER } from "./chunks/refs-
|
|
7
|
-
import { n as pageBundles, t as pageBundleRefs } from "./chunks/page-bundles-
|
|
8
|
-
import { a as createStackStore, i as saveScope, n as clearScope, r as loadScope } from "./chunks/persistence-
|
|
1
|
+
import { C as normalizeCell, S as hasRef, T as rootCells, a as projectSelections, b as HYDRATED_CELL_FIELDS, c as pageScopeKey, d as resolveComponent, f as cellAttributes, g as assembleCellProps, h as pageContainerStyle, i as projectLive, l as projectScopeKey, n as attachViewStateSetters, o as projectViewState, p as cellPlacementStyle, r as collectScopeIds, s as shallowEqualBundle, t as attachSelectionSetters, u as resolveScopeId, v as projectCellData, w as resolveCell, x as STORE_FIELDS, y as CONTENT_FIELDS } from "./chunks/projection-zhu32_KJ.js";
|
|
2
|
+
import { C as passesConditions, S as pageContext, T as settled, _ as EACH, a as VARIABLE_NAMESPACES, b as cellResolutionContext, c as pageVariables, d as resolveDescriptorVariables, f as selectionShape, g as variableReferences, h as variableLabels, i as UnsafeDocumentError, l as prepareDocument, m as validateDescriptor, n as RENDER_FUNCTIONS, o as descriptorShape, p as shapeAt, r as RENDER_FUNCTIONS_AHEAD, s as orderByVariable, t as PAGING_VARIABLES, u as queryKey, v as EACH_DEFAULT_AS, w as resolveReferences, x as isEach, y as cellContext } from "./chunks/query-D6xQbTFK.js";
|
|
3
|
+
import { _ as stateValue, a as nearestNames, b as walkKey, c as selectionIssues, d as needsWalk, f as readField, g as stateNames, h as resolveWalkStart, i as eachFormProblems, l as RESERVED_LABELS, m as referencedLabels, n as STORE_SCOPES, o as validateCell, p as readWalk, r as WALK_DIRECTIONS, s as validatePage, t as RESPONSIVE_BUCKETS, u as mergeStates, v as systemsFromGraphs, x as walkRequest, y as systemsFromProcess } from "./chunks/validate-BcB_PA1k.js";
|
|
4
|
+
import { C as resolveAction, S as projectCellActions, _ as actionBindingKey, a as deriveSectionReferences, b as declaredActions, c as nodePrintStyle, d as referencesFor, f as sectionAnchor, g as usesStructureLayout, h as tableOfContents, i as deriveSectionNumbering, l as normalizeStructure, m as structureIssues, n as SECTION_KINDS, r as deriveElementReferences, s as mergeSectionReferences, t as PAGE_DOCUMENT, u as numberingFor, v as actionProblems, x as normalizeActionDeclaration, y as actionReferences } from "./chunks/structure-CKBtQHJq.js";
|
|
5
|
+
import { a as loadBundlesSettled, i as loadBundles, n as isComponentExport, o as projectModule, r as loadBundle, s as runtimeReady, t as _clearBundleCache } from "./chunks/load-b38vUiZM.js";
|
|
6
|
+
import { a as normalizeRef, i as bundleScope, n as MAIN, o as refKey, r as PUBLIC, t as CORE_SPECIFIER } from "./chunks/refs-Csgh6rXq.js";
|
|
7
|
+
import { n as pageBundles, t as pageBundleRefs } from "./chunks/page-bundles-CPj_vx-J.js";
|
|
8
|
+
import { a as createStackStore, i as saveScope, n as clearScope, r as loadScope } from "./chunks/persistence-hurkUUQ0.js";
|
|
9
9
|
import { ACTION_KINDS, QUERY_DESCRIPTOR_KEY, SECTION_KINDS as SECTION_KINDS$1, STATE_ROLES, STATE_TIERS, WALK_DEFAULTS, isDescriptorBinding, isLiveQueryState, isReadOnlyVersion } from "@peripheries/runtime";
|
|
10
|
-
//#region packages/renderer/src/core/data-context.ts
|
|
11
10
|
function resolveDeclarations(queries, systems, diagnostics = [], cellId) {
|
|
12
11
|
const out = {};
|
|
13
12
|
for (const [label, raw] of Object.entries(queries ?? {})) {
|
|
@@ -91,8 +90,22 @@ function buildDataContext(input) {
|
|
|
91
90
|
}
|
|
92
91
|
return ctx;
|
|
93
92
|
}
|
|
94
|
-
|
|
95
|
-
|
|
93
|
+
var LAYER_ROLES = {
|
|
94
|
+
"answer": null,
|
|
95
|
+
"appraisal-system": "appraisal",
|
|
96
|
+
"data-system": "data",
|
|
97
|
+
"edits": null,
|
|
98
|
+
"model-system": "model",
|
|
99
|
+
"organisation": null,
|
|
100
|
+
"process-system": "process",
|
|
101
|
+
"question": null,
|
|
102
|
+
"submission": null
|
|
103
|
+
};
|
|
104
|
+
function layerName(s) {
|
|
105
|
+
if (s.system_layer) return s.system_layer.role ?? s.system_type ?? null;
|
|
106
|
+
if (!s.system_type || !Object.hasOwn(LAYER_ROLES, s.system_type)) return null;
|
|
107
|
+
return LAYER_ROLES[s.system_type] ?? s.system_type;
|
|
108
|
+
}
|
|
96
109
|
async function resolveSystems(source, page) {
|
|
97
110
|
const systems = !page.process_id ? {} : source.graphSystems ? systemsFromGraphs(await source.graphSystems(page.process_id)) : systemsFromProcess(await source.processSystems?.(page.process_id));
|
|
98
111
|
if (!systems.eng_data) {
|
|
@@ -620,8 +633,6 @@ function recordsByName(found, declarations) {
|
|
|
620
633
|
}
|
|
621
634
|
return out;
|
|
622
635
|
}
|
|
623
|
-
//#endregion
|
|
624
|
-
//#region packages/renderer/src/core/sources.ts
|
|
625
636
|
var TOOL_OWNED_KEYS = ["content_index", "ref_index"];
|
|
626
637
|
var STRUCTURE_FIELDS = [
|
|
627
638
|
"title",
|
|
@@ -741,8 +752,6 @@ function cellPropSources(runtime, cell, env = {}) {
|
|
|
741
752
|
}))
|
|
742
753
|
};
|
|
743
754
|
}
|
|
744
|
-
//#endregion
|
|
745
|
-
//#region packages/renderer/src/core/diagnostics.ts
|
|
746
755
|
var DIAGNOSTICS = {
|
|
747
756
|
PAGE_INVALID: {
|
|
748
757
|
meaning: "`content.cells` is not a list.",
|
|
@@ -850,7 +859,7 @@ var DIAGNOSTICS = {
|
|
|
850
859
|
},
|
|
851
860
|
UNSUPPORTED_REGISTRY_BINDING: {
|
|
852
861
|
meaning: "A binding names a registry query (`{ registry: \"x.y\" }`) from the retired host contract.",
|
|
853
|
-
fix: "Copy the matching recipe’s descriptor into `{ descriptor }` (the component’s pattern pack has it), or bind the graph node that produces the data.
|
|
862
|
+
fix: "Copy the matching recipe’s descriptor into `{ descriptor }` (the component’s pattern pack has it), or bind the graph node that produces the data."
|
|
854
863
|
},
|
|
855
864
|
STATE_UNKNOWN_NAME: {
|
|
856
865
|
meaning: "A state name is not `<tier>_<role>`.",
|
|
@@ -1021,8 +1030,6 @@ var DIAGNOSTICS = {
|
|
|
1021
1030
|
fix: "Fix the snippet; it is copied far more faithfully than any rule."
|
|
1022
1031
|
}
|
|
1023
1032
|
};
|
|
1024
|
-
//#endregion
|
|
1025
|
-
//#region packages/renderer/src/core/rules.ts
|
|
1026
1033
|
var LAYOUT_TYPES = [
|
|
1027
1034
|
"stack",
|
|
1028
1035
|
"grid",
|
|
@@ -1069,8 +1076,6 @@ The host's rules for every page. Components, kits and patterns are in the catalo
|
|
|
1069
1076
|
## When a check fails
|
|
1070
1077
|
Every page write is validated; each diagnostic names its code, place and fix.
|
|
1071
1078
|
`;
|
|
1072
|
-
//#endregion
|
|
1073
|
-
//#region packages/renderer/src/core/values.ts
|
|
1074
1079
|
var isTraversal = (v) => !!v && typeof v === "object" && Array.isArray(v.nodes);
|
|
1075
1080
|
function pageRuntimeFromValues(page, { values = {}, traversal } = {}) {
|
|
1076
1081
|
const cells = (page.content?.cells ?? []).map((c) => resolveCell(normalizeCell(c).cell, null));
|
|
@@ -1108,8 +1113,6 @@ function pageRuntimeFromValues(page, { values = {}, traversal } = {}) {
|
|
|
1108
1113
|
diagnostics: validatePage(page)
|
|
1109
1114
|
};
|
|
1110
1115
|
}
|
|
1111
|
-
//#endregion
|
|
1112
|
-
//#region packages/renderer/src/core/release.ts
|
|
1113
1116
|
function validateManifest(pages, catalog) {
|
|
1114
1117
|
return pages.flatMap(({ graphNodeId, page }) => validatePage(page, catalog).filter((d) => d.severity === "error").map((d) => ({
|
|
1115
1118
|
graph_node_id: graphNodeId,
|
|
@@ -1129,7 +1132,4 @@ function manifestPageFrom(graphNodeId, data) {
|
|
|
1129
1132
|
}
|
|
1130
1133
|
};
|
|
1131
1134
|
}
|
|
1132
|
-
|
|
1133
|
-
export { CONTENT_FIELDS, CORE_SPECIFIER, DIAGNOSTICS, EACH, EACH_DEFAULT_AS, HYDRATED_CELL_FIELDS, LAYOUT_TYPES, MAIN, PAGE_DOCUMENT, PAGE_RULES, PAGING_VARIABLES, PUBLIC, RENDER_FUNCTIONS, RENDER_FUNCTIONS_AHEAD, RESERVED_LABELS, RESPONSIVE_BUCKETS, SECTION_KINDS, STORE_FIELDS, STORE_SCOPES, STRUCTURE_FIELDS, TOOL_OWNED_KEYS, UnsafeDocumentError, VARIABLE_NAMESPACES, WALK_DIRECTIONS, _clearBundleCache, actionBindingKey, actionProblems, actionReferences, assembleCellProps, attachSelectionSetters, attachViewStateSetters, buildDataContext, bundleScope, cellAttributes, cellContext, cellPlacementStyle, cellPropSources, cellResolutionContext, clearScope, collectDeclarations, collectDescriptors, collectScopeIds, collectStatic, createStackStore, declaredActions, deriveElementReferences, deriveSectionNumbering, deriveSectionReferences, descriptorShape, eachFormProblems, editTarget, hasRef, isComponentExport, isEach, loadBundle, loadBundles, loadBundlesSettled, loadPageData, loadScope, manifestPageFrom, mergeSectionReferences, mergeStates, nearestNames, needsWalk, nodePrintStyle, normalizeActionDeclaration, normalizeCell, normalizeRef, normalizeStructure, numberingFor, orderByVariable, pageBundleRefs, pageBundles, pageContainerStyle, pageContext, pageRuntimeFromValues, pageScopeKey, pageVariables, passesConditions, patchAt, prepareDocument, projectCellActions, projectCellData, projectLive, projectModule, projectScopeKey, projectSelections, projectViewState, queryKey, readField, readWalk, refKey, referencedLabels, referencesFor, resolveAction, resolveCell, resolveComponent, resolveDataSystem, resolveDeclarations, resolveDescriptorVariables, resolveReferences, resolveScopeId, resolveSystems, resolveWalkStart, rootCells, runtimeReady, saveScope, sectionAnchor, selectionIssues, selectionShape, settled, shallowEqualBundle, shapeAt, stateNames, stateValue, structureIssues, systemsFromGraphs, systemsFromProcess, tableOfContents, usesStructureLayout, validateCell, validateDescriptor, validateManifest, validatePage, variableLabels, variableReferences, walkKey, walkRequest };
|
|
1134
|
-
|
|
1135
|
-
//# sourceMappingURL=core.js.map
|
|
1135
|
+
export { CONTENT_FIELDS, CORE_SPECIFIER, DIAGNOSTICS, EACH, EACH_DEFAULT_AS, HYDRATED_CELL_FIELDS, LAYER_ROLES, LAYOUT_TYPES, MAIN, PAGE_DOCUMENT, PAGE_RULES, PAGING_VARIABLES, PUBLIC, RENDER_FUNCTIONS, RENDER_FUNCTIONS_AHEAD, RESERVED_LABELS, RESPONSIVE_BUCKETS, SECTION_KINDS, STORE_FIELDS, STORE_SCOPES, STRUCTURE_FIELDS, TOOL_OWNED_KEYS, UnsafeDocumentError, VARIABLE_NAMESPACES, WALK_DIRECTIONS, _clearBundleCache, actionBindingKey, actionProblems, actionReferences, assembleCellProps, attachSelectionSetters, attachViewStateSetters, buildDataContext, bundleScope, cellAttributes, cellContext, cellPlacementStyle, cellPropSources, cellResolutionContext, clearScope, collectDeclarations, collectDescriptors, collectScopeIds, collectStatic, createStackStore, declaredActions, deriveElementReferences, deriveSectionNumbering, deriveSectionReferences, descriptorShape, eachFormProblems, editTarget, hasRef, isComponentExport, isEach, layerName, loadBundle, loadBundles, loadBundlesSettled, loadPageData, loadScope, manifestPageFrom, mergeSectionReferences, mergeStates, nearestNames, needsWalk, nodePrintStyle, normalizeActionDeclaration, normalizeCell, normalizeRef, normalizeStructure, numberingFor, orderByVariable, pageBundleRefs, pageBundles, pageContainerStyle, pageContext, pageRuntimeFromValues, pageScopeKey, pageVariables, passesConditions, patchAt, prepareDocument, projectCellActions, projectCellData, projectLive, projectModule, projectScopeKey, projectSelections, projectViewState, queryKey, readField, readWalk, refKey, referencedLabels, referencesFor, resolveAction, resolveCell, resolveComponent, resolveDataSystem, resolveDeclarations, resolveDescriptorVariables, resolveReferences, resolveScopeId, resolveSystems, resolveWalkStart, rootCells, runtimeReady, saveScope, sectionAnchor, selectionIssues, selectionShape, settled, shallowEqualBundle, shapeAt, stateNames, stateValue, structureIssues, systemsFromGraphs, systemsFromProcess, tableOfContents, usesStructureLayout, validateCell, validateDescriptor, validateManifest, validatePage, variableLabels, variableReferences, walkKey, walkRequest };
|
package/dist/forms.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { _ as CONDITION_OPS, a as goToQuestion, b as normalizeCondition, c as missing, d as positionsOf, f as progress, g as visibleSteps, h as stepKind, i as goTo, l as move, m as settle, n as enterAdvances, o as isReadOnlyStatus, p as questionsOf, r as fromPageSteps, s as linkTo, t as defaultMode, u as positionFromLink, v as evaluateCondition, x as normalizeOperator, y as isConditionOp } from "./chunks/forms-
|
|
1
|
+
import { _ as CONDITION_OPS, a as goToQuestion, b as normalizeCondition, c as missing, d as positionsOf, f as progress, g as visibleSteps, h as stepKind, i as goTo, l as move, m as settle, n as enterAdvances, o as isReadOnlyStatus, p as questionsOf, r as fromPageSteps, s as linkTo, t as defaultMode, u as positionFromLink, v as evaluateCondition, x as normalizeOperator, y as isConditionOp } from "./chunks/forms-DxA9WzCt.js";
|
|
2
2
|
export { CONDITION_OPS, defaultMode, enterAdvances, evaluateCondition, fromPageSteps, goTo, goToQuestion, isConditionOp, isReadOnlyStatus, linkTo, missing, move, normalizeCondition, normalizeOperator, positionFromLink, positionsOf, progress, questionsOf, settle, stepKind, visibleSteps };
|