@peripheries/renderer 0.22.0 → 0.23.1

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.
Files changed (103) hide show
  1. package/README.md +125 -23
  2. package/dist/catalog.js +2 -6
  3. package/dist/chunks/forms-DxA9WzCt.js +336 -0
  4. package/dist/chunks/{load-CjPvISzH.js → load-b38vUiZM.js} +0 -4
  5. package/dist/chunks/{page-bundles-DLRIBP8g.js → page-bundles-CPj_vx-J.js} +1 -5
  6. package/dist/chunks/{persistence-DCMakM9H.js → persistence-hurkUUQ0.js} +0 -6
  7. package/dist/chunks/{projection-yvYKzMOS.js → projection-zhu32_KJ.js} +1 -15
  8. package/dist/chunks/{query-BPuCJC1C.js → query-D6xQbTFK.js} +166 -12
  9. package/dist/chunks/{refs-BLUokra5.js → refs-Csgh6rXq.js} +0 -4
  10. package/dist/chunks/{structure-o9pYoDjD.js → structure-CKBtQHJq.js} +1 -7
  11. package/dist/chunks/{validate-4LgH8QMJ.js → validate-BcB_PA1k.js} +20 -13
  12. package/dist/core.js +138 -47
  13. package/dist/forms.js +2 -0
  14. package/dist/print.js +0 -24
  15. package/dist/react.js +352 -22
  16. package/dist/runtime.js +2 -12
  17. package/dist/styles.css +9 -15
  18. package/dist/testing.js +214 -19
  19. package/dist/theme.js +0 -10
  20. package/dist/types/catalog/check.d.ts +0 -13
  21. package/dist/types/core/actions.d.ts +0 -24
  22. package/dist/types/core/bundles/load.d.ts +0 -23
  23. package/dist/types/core/bundles/page-bundles.d.ts +0 -9
  24. package/dist/types/core/bundles/refs.d.ts +1 -28
  25. package/dist/types/core/bundles/resolve.d.ts +0 -10
  26. package/dist/types/core/cell-props.d.ts +0 -20
  27. package/dist/types/core/cells.d.ts +0 -21
  28. package/dist/types/core/data-context.d.ts +4 -21
  29. package/dist/types/core/diagnostics.d.ts +20 -6
  30. package/dist/types/core/graph.d.ts +6 -44
  31. package/dist/types/core/index.d.ts +4 -3
  32. package/dist/types/core/layout.d.ts +0 -9
  33. package/dist/types/core/load-page.d.ts +30 -88
  34. package/dist/types/core/query.d.ts +6 -52
  35. package/dist/types/core/references.d.ts +0 -21
  36. package/dist/types/core/release.d.ts +11 -0
  37. package/dist/types/core/rules.d.ts +0 -1
  38. package/dist/types/core/selected.d.ts +0 -5
  39. package/dist/types/core/sources.d.ts +10 -63
  40. package/dist/types/core/store/create-store.d.ts +0 -6
  41. package/dist/types/core/store/persistence.d.ts +0 -1
  42. package/dist/types/core/store/projection.d.ts +0 -5
  43. package/dist/types/core/store/scope-keys.d.ts +0 -1
  44. package/dist/types/core/store/types.d.ts +0 -6
  45. package/dist/types/core/structure.d.ts +0 -33
  46. package/dist/types/core/types.d.ts +2 -13
  47. package/dist/types/core/validate.d.ts +0 -12
  48. package/dist/types/core/values.d.ts +0 -6
  49. package/dist/types/forms/conditions.d.ts +18 -0
  50. package/dist/types/forms/index.d.ts +3 -0
  51. package/dist/types/forms/model.d.ts +90 -0
  52. package/dist/types/forms/port.d.ts +47 -0
  53. package/dist/types/print/document-bindings.d.ts +0 -61
  54. package/dist/types/print/document-profile.d.ts +0 -137
  55. package/dist/types/print/map-staleness.d.ts +0 -66
  56. package/dist/types/print/page-map.d.ts +1 -334
  57. package/dist/types/print/paginate.d.ts +0 -190
  58. package/dist/types/print/print-layout.d.ts +0 -161
  59. package/dist/types/print/print-lint.d.ts +0 -109
  60. package/dist/types/print/print-policy.d.ts +0 -184
  61. package/dist/types/print/print-stylesheet.d.ts +0 -135
  62. package/dist/types/print/running-header.d.ts +0 -86
  63. package/dist/types/print/structure-print.d.ts +1 -243
  64. package/dist/types/react/cell-states.d.ts +0 -2
  65. package/dist/types/react/cell-view.d.ts +1 -15
  66. package/dist/types/react/index.d.ts +1 -0
  67. package/dist/types/react/page-renderer.d.ts +1 -33
  68. package/dist/types/react/structure-view.d.ts +0 -12
  69. package/dist/types/react/use-cell-store.d.ts +0 -5
  70. package/dist/types/react/use-container-size.d.ts +0 -5
  71. package/dist/types/react/use-forms-runtime.d.ts +147 -0
  72. package/dist/types/react/use-paging.d.ts +0 -9
  73. package/dist/types/runtime/boot.d.ts +0 -11
  74. package/dist/types/runtime/install.d.ts +0 -15
  75. package/dist/types/runtime/shims.d.ts +0 -8
  76. package/dist/types/runtime/store-export.d.ts +0 -7
  77. package/dist/types/testing/base-props.d.ts +0 -1
  78. package/dist/types/testing/components.d.ts +0 -8
  79. package/dist/types/testing/form-workbook.d.ts +103 -0
  80. package/dist/types/testing/golden.d.ts +0 -16
  81. package/dist/types/testing/ids.d.ts +0 -2
  82. package/dist/types/testing/index.d.ts +1 -0
  83. package/dist/types/testing/sources.d.ts +0 -7
  84. package/dist/types/theme/check.d.ts +0 -2
  85. package/dist/types/theme/color.d.ts +0 -12
  86. package/dist/types/theme/derive.d.ts +0 -12
  87. package/dist/types/theme/parse.d.ts +0 -7
  88. package/package.json +6 -2
  89. package/dist/catalog.js.map +0 -1
  90. package/dist/chunks/load-CjPvISzH.js.map +0 -1
  91. package/dist/chunks/page-bundles-DLRIBP8g.js.map +0 -1
  92. package/dist/chunks/persistence-DCMakM9H.js.map +0 -1
  93. package/dist/chunks/projection-yvYKzMOS.js.map +0 -1
  94. package/dist/chunks/query-BPuCJC1C.js.map +0 -1
  95. package/dist/chunks/refs-BLUokra5.js.map +0 -1
  96. package/dist/chunks/structure-o9pYoDjD.js.map +0 -1
  97. package/dist/chunks/validate-4LgH8QMJ.js.map +0 -1
  98. package/dist/core.js.map +0 -1
  99. package/dist/print.js.map +0 -1
  100. package/dist/react.js.map +0 -1
  101. package/dist/runtime.js.map +0 -1
  102. package/dist/testing.js.map +0 -1
  103. package/dist/theme.js.map +0 -1
@@ -1,5 +1,4 @@
1
- import { t as CORE_SPECIFIER } from "./refs-BLUokra5.js";
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,15 +214,16 @@ 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",
223
220
  "graph_edge",
224
221
  "graph_node",
225
222
  "node",
226
- "system_node_state"
223
+ "system_node_state",
224
+ "system_version",
225
+ "system_node_version",
226
+ "system_edge_version"
227
227
  ],
228
228
  resolve_placements: [
229
229
  "edge",
@@ -234,7 +234,9 @@ var RENDER_FUNCTIONS = {
234
234
  "object_source",
235
235
  "process",
236
236
  "system",
237
- "system_node_state"
237
+ "system_node_state",
238
+ "system_version",
239
+ "system_node_version"
238
240
  ],
239
241
  event_occurrences: ["event", "event_type"],
240
242
  creatable_event_types: ["event_type"],
@@ -264,11 +266,93 @@ var RENDER_FUNCTIONS = {
264
266
  "feed_producer",
265
267
  "feed_subscription"
266
268
  ],
267
- host_chat_threads: ["session"]
269
+ host_chat_threads: ["session"],
270
+ node_states_as_of: [
271
+ "system_node_state",
272
+ "system_version",
273
+ "system_node_version",
274
+ "system",
275
+ "system_layer"
276
+ ],
277
+ node_state_view: [
278
+ "graph_node",
279
+ "system",
280
+ "system_node_state",
281
+ "system_version",
282
+ "system_node_version",
283
+ "system_layer"
284
+ ],
285
+ version_context_for: [
286
+ "system_version",
287
+ "graph_node",
288
+ "edge",
289
+ "graph_edge"
290
+ ],
291
+ version_scope_members: [
292
+ "graph_node",
293
+ "graph_edge",
294
+ "edge"
295
+ ],
296
+ auto_release_status: [
297
+ "graph_node",
298
+ "node",
299
+ "edge",
300
+ "graph"
301
+ ],
302
+ versions_for: ["system_version"],
303
+ version_diff: [
304
+ "system_version",
305
+ "system_node_version",
306
+ "system_edge_version",
307
+ "graph_node",
308
+ "node",
309
+ "edge",
310
+ "graph_edge",
311
+ "system",
312
+ "system_node_state",
313
+ "system_edge_state"
314
+ ],
315
+ form_answers: [
316
+ "system_node_state",
317
+ "graph_node",
318
+ "edge"
319
+ ]
268
320
  };
321
+ var RENDER_FUNCTIONS_AHEAD = { form_answers: "SCH M3b" };
269
322
  var UnsafeDocumentError = class extends Error {
270
323
  name = "UnsafeDocumentError";
324
+ code;
325
+ constructor(message, options) {
326
+ super(message);
327
+ if (options) this.code = options.code;
328
+ }
271
329
  };
330
+ var MAIN_ONLY_COLLECTIONS = new Set([
331
+ "systemCollection",
332
+ "graph_nodeCollection",
333
+ "graph_edgeCollection"
334
+ ]);
335
+ var SYSTEM_SCOPED_COLLECTIONS = new Set([
336
+ "system_node_stateCollection",
337
+ "system_edge_stateCollection",
338
+ "node_state_latestCollection",
339
+ "cell_config_latestCollection",
340
+ "system_runCollection",
341
+ "system_stateCollection"
342
+ ]);
343
+ var SCOPING_PARENTS = new Set([
344
+ "systemCollection",
345
+ "system_runCollection",
346
+ "system_stateCollection"
347
+ ]);
348
+ var SCOPING_COLUMNS = new Set([
349
+ "id",
350
+ "system_id",
351
+ "system_run_id",
352
+ "source_system_id",
353
+ "target_system_id"
354
+ ]);
355
+ var CONNECTION_FIELDS = new Set(["edges", "node"]);
272
356
  var ENTITY_ROOT = /^(.+?)(Collection|ByPk)$/;
273
357
  var prepared = new Map();
274
358
  function prepareDocument(source) {
@@ -280,7 +364,7 @@ function prepareDocument(source) {
280
364
  if (selection.kind !== Kind.FIELD) throw new UnsafeDocumentError("Fragments are not allowed at the root of a render-time query");
281
365
  for (const e of rootEntities(selection)) entities.add(e);
282
366
  }
283
- const text = print(withTypename(doc));
367
+ const text = print(withTypename(mainOnly(doc)));
284
368
  const out = {
285
369
  text,
286
370
  operationName: op.name?.value,
@@ -315,6 +399,73 @@ function rootEntities(field) {
315
399
  if (!match) throw new UnsafeDocumentError(`Root field "${name}" is not a table or view collection, or a render function. Other function fields (RPCs, rls_* helpers) and introspection are not allowed at render time.`);
316
400
  return [match[1]];
317
401
  }
402
+ var IS_NULL = {
403
+ kind: Kind.OBJECT_FIELD,
404
+ name: {
405
+ kind: Kind.NAME,
406
+ value: "version"
407
+ },
408
+ value: {
409
+ kind: Kind.OBJECT,
410
+ fields: [{
411
+ kind: Kind.OBJECT_FIELD,
412
+ name: {
413
+ kind: Kind.NAME,
414
+ value: "is"
415
+ },
416
+ value: {
417
+ kind: Kind.ENUM,
418
+ value: "NULL"
419
+ }
420
+ }]
421
+ }
422
+ };
423
+ function namesVersion(value) {
424
+ if (value.kind === Kind.LIST) return value.values.some(namesVersion);
425
+ if (value.kind !== Kind.OBJECT) return false;
426
+ return value.fields.some((f) => f.name.value === "version" || namesVersion(f.value));
427
+ }
428
+ function scopedByFilter(node) {
429
+ const filter = node.arguments?.find((a) => a.name.value === "filter")?.value;
430
+ if (filter?.kind !== Kind.OBJECT) return false;
431
+ return filter.fields.some((f) => SCOPING_COLUMNS.has(f.name.value) && f.value.kind === Kind.OBJECT && f.value.fields.some((op) => op.name.value === "eq" || op.name.value === "in"));
432
+ }
433
+ function parentField(ancestors) {
434
+ for (let i = ancestors.length - 1; i >= 0; i--) {
435
+ const a = ancestors[i];
436
+ if (a?.kind === Kind.FRAGMENT_DEFINITION || a?.kind === Kind.OPERATION_DEFINITION) return void 0;
437
+ if (a?.kind === Kind.FIELD && a.name && !CONNECTION_FIELDS.has(a.name.value)) return a.name.value;
438
+ }
439
+ }
440
+ function mainOnly(doc) {
441
+ return visit(doc, { Field(node, _key, _parent, _path, ancestors) {
442
+ if (SYSTEM_SCOPED_COLLECTIONS.has(node.name.value)) {
443
+ const parent = parentField(ancestors);
444
+ if (!(parent && SCOPING_PARENTS.has(parent)) && !scopedByFilter(node)) throw new UnsafeDocumentError(`${node.name.value} would read every system's rows, a branch's included: read it under a systemCollection, or filter its id, system_id or run by eq or in`, { code: "DESCRIPTOR_STATE_UNSCOPED" });
445
+ return;
446
+ }
447
+ if (!MAIN_ONLY_COLLECTIONS.has(node.name.value)) return void 0;
448
+ const filter = node.arguments?.find((a) => a.name.value === "filter");
449
+ if (filter && filter.value.kind !== Kind.OBJECT) throw new UnsafeDocumentError(`${node.name.value} reads main rows only, so its filter is written in the document, not passed as a variable`, { code: "DESCRIPTOR_VERSION_FILTER" });
450
+ if (filter && namesVersion(filter.value)) throw new UnsafeDocumentError(`${node.name.value} reads main rows only; a branch is read through a version context, not a version filter`, { code: "DESCRIPTOR_VERSION_FILTER" });
451
+ const value = {
452
+ kind: Kind.OBJECT,
453
+ fields: [...filter?.value.kind === Kind.OBJECT ? filter.value.fields : [], IS_NULL]
454
+ };
455
+ const others = (node.arguments ?? []).filter((a) => a !== filter);
456
+ return {
457
+ ...node,
458
+ arguments: [...others, {
459
+ kind: Kind.ARGUMENT,
460
+ name: {
461
+ kind: Kind.NAME,
462
+ value: "filter"
463
+ },
464
+ value
465
+ }]
466
+ };
467
+ } });
468
+ }
318
469
  function withTypename(doc) {
319
470
  return visit(doc, { SelectionSet: { leave(node, _key, parent) {
320
471
  if (parent && "kind" in parent && parent.kind === Kind.OPERATION_DEFINITION) return node;
@@ -607,12 +758,18 @@ function validateDescriptor(descriptor, path = "descriptor") {
607
758
  } catch (e) {
608
759
  push({
609
760
  severity: "error",
610
- code: "DESCRIPTOR_DOCUMENT_INVALID",
761
+ code: e instanceof UnsafeDocumentError && e.code || "DESCRIPTOR_DOCUMENT_INVALID",
611
762
  path: `${path}.document`,
612
763
  message: e.message
613
764
  });
614
765
  return out;
615
766
  }
767
+ for (const sel of op.selectionSet.selections) if (sel.kind === Kind.FIELD && sel.alias && !sel.selectionSet && Object.hasOwn(RENDER_FUNCTIONS, sel.name.value)) push({
768
+ severity: "error",
769
+ code: "DESCRIPTOR_ALIAS_JSON_ROOT",
770
+ path: `${path}.document`,
771
+ message: `${sel.name.value} returns JSON; name it without the alias "${sel.alias.value}"`
772
+ });
616
773
  const declared = new Map(op.variableDefinitions?.map((v) => [v.variable.name.value, v]) ?? []);
617
774
  for (const [name, def] of declared) {
618
775
  const required = def.type.kind === Kind.NON_NULL_TYPE && !def.defaultValue;
@@ -788,7 +945,4 @@ var queryKey = (descriptor, variables) => JSON.stringify([
788
945
  descriptor.result?.path ?? null,
789
946
  descriptor.result?.flatten_connections !== false
790
947
  ]);
791
- //#endregion
792
- export { resolveReferences as C, passesConditions as S, EACH_DEFAULT_AS as _, descriptorShape as a, isEach as b, prepareDocument as c, selectionShape as d, shapeAt as f, EACH as g, variableReferences as h, VARIABLE_NAMESPACES as i, queryKey as l, variableLabels as m, RENDER_FUNCTIONS as n, orderByVariable as o, validateDescriptor as p, UnsafeDocumentError as r, pageVariables as s, PAGING_VARIABLES as t, resolveDescriptorVariables as u, cellContext as v, settled as w, pageContext as x, cellResolutionContext as y };
793
-
794
- //# sourceMappingURL=query-BPuCJC1C.js.map
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 };
@@ -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 { C as resolveReferences, b as isEach, w as settled } from "./query-BPuCJC1C.js";
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-o9pYoDjD.js.map
@@ -1,7 +1,21 @@
1
- import { _ as EACH_DEFAULT_AS, a as descriptorShape, b as isEach, f as shapeAt, g as EACH, m as variableLabels, p as validateDescriptor } from "./query-BPuCJC1C.js";
2
- import { g as usesStructureLayout, m as structureIssues, v as actionProblems } from "./structure-o9pYoDjD.js";
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
4
+ var TIER_OF_GRAPH_TYPE = {
5
+ "meta-process": "meta",
6
+ "process-eng": "eng",
7
+ "process-ops": "ops"
8
+ };
9
+ function systemsFromGraphs(rows) {
10
+ const out = {};
11
+ for (const r of rows ?? []) {
12
+ const tier = r.graph_type ? TIER_OF_GRAPH_TYPE[r.graph_type] : void 0;
13
+ if (!tier || !r.role) continue;
14
+ const name = `${tier}_${r.role}`;
15
+ if (isStateName(name) && !out[name]) out[name] = r.id;
16
+ }
17
+ return out;
18
+ }
5
19
  function systemsFromProcess(row) {
6
20
  const out = {};
7
21
  for (const name of STATE_NAMES) {
@@ -117,7 +131,7 @@ function walkRequest(config, start, systems) {
117
131
  for (const u of unknown) diagnostics.push({
118
132
  severity: "error",
119
133
  code: "STATE_UNKNOWN_NAME",
120
- message: `include_state "${u}" isn't a system name (${STATE_NAMES.join(", ")})`
134
+ message: `include_state "${u}" isn't a system name: expected <tier>_<role> (tier meta, eng or ops; e.g. eng_data)`
121
135
  });
122
136
  const states = [];
123
137
  for (const name of names) {
@@ -208,8 +222,6 @@ function readWalk(raw, request) {
208
222
  diagnostics
209
223
  };
210
224
  }
211
- //#endregion
212
- //#region packages/renderer/src/core/selected.ts
213
225
  var STRICT_REF$1 = /^@([A-Za-z0-9_$-]+)((?:\.[A-Za-z0-9_$[\]-]+)*)$/;
214
226
  var shapes = new Map();
215
227
  function shapeOf(d) {
@@ -258,8 +270,6 @@ function selectionIssues(cell, queries, at) {
258
270
  visit(cell.conditions, `${at}.conditions`, top);
259
271
  return out;
260
272
  }
261
- //#endregion
262
- //#region packages/renderer/src/core/validate.ts
263
273
  var words = (name) => name.replace(/([a-z0-9])([A-Z])/g, "$1 $2").toLowerCase().split(/[\s_-]+/).filter(Boolean);
264
274
  function editDistance(a, b) {
265
275
  let prev = Array.from({ length: b.length + 1 }, (_, j) => j);
@@ -406,7 +416,7 @@ function checkBindings(queries, path, push, cellId, template = false) {
406
416
  cellId,
407
417
  label,
408
418
  path: `${at}.state`,
409
- message: `"${label}" names state "${String(s)}"; expected one of ${STATE_NAMES.join(", ")}`
419
+ message: `"${label}" names state "${String(s)}"; expected <tier>_<role> (tier meta, eng or ops; e.g. eng_data)`
410
420
  });
411
421
  }
412
422
  }
@@ -816,7 +826,4 @@ function slotIssues(cells, catalog) {
816
826
  });
817
827
  return out;
818
828
  }
819
- //#endregion
820
- export { stateValue as _, nearestNames as a, walkRequest 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, systemsFromProcess as v, walkKey as y };
821
-
822
- //# sourceMappingURL=validate-4LgH8QMJ.js.map
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 };