@peripheries/renderer 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.
Files changed (57) hide show
  1. package/README.md +65 -0
  2. package/dist/chunks/create-store-CglsI7tw.js +90 -0
  3. package/dist/chunks/create-store-CglsI7tw.js.map +1 -0
  4. package/dist/chunks/load-6zEgvJ6I.js +60 -0
  5. package/dist/chunks/load-6zEgvJ6I.js.map +1 -0
  6. package/dist/chunks/page-bundles-C4VW3dsK.js +87 -0
  7. package/dist/chunks/page-bundles-C4VW3dsK.js.map +1 -0
  8. package/dist/chunks/projection-Dsy9ruj8.js +592 -0
  9. package/dist/chunks/projection-Dsy9ruj8.js.map +1 -0
  10. package/dist/core.js +740 -0
  11. package/dist/core.js.map +1 -0
  12. package/dist/react.js +357 -0
  13. package/dist/react.js.map +1 -0
  14. package/dist/runtime.js +91 -0
  15. package/dist/runtime.js.map +1 -0
  16. package/dist/styles.css +51 -0
  17. package/dist/testing.js +944 -0
  18. package/dist/testing.js.map +1 -0
  19. package/dist/types/core/bundles/load.d.ts +49 -0
  20. package/dist/types/core/bundles/page-bundles.d.ts +17 -0
  21. package/dist/types/core/bundles/refs.d.ts +41 -0
  22. package/dist/types/core/bundles/resolve.d.ts +25 -0
  23. package/dist/types/core/cell-props.d.ts +39 -0
  24. package/dist/types/core/cells.d.ts +39 -0
  25. package/dist/types/core/data-context.d.ts +38 -0
  26. package/dist/types/core/graph.d.ts +95 -0
  27. package/dist/types/core/index.d.ts +19 -0
  28. package/dist/types/core/layout.d.ts +12 -0
  29. package/dist/types/core/load-page.d.ts +72 -0
  30. package/dist/types/core/references.d.ts +43 -0
  31. package/dist/types/core/store/create-store.d.ts +26 -0
  32. package/dist/types/core/store/persistence.d.ts +9 -0
  33. package/dist/types/core/store/projection.d.ts +15 -0
  34. package/dist/types/core/store/scope-keys.d.ts +10 -0
  35. package/dist/types/core/store/types.d.ts +37 -0
  36. package/dist/types/core/structure.d.ts +72 -0
  37. package/dist/types/core/types.d.ts +30 -0
  38. package/dist/types/core/validate.d.ts +14 -0
  39. package/dist/types/react/cell-states.d.ts +25 -0
  40. package/dist/types/react/cell-view.d.ts +31 -0
  41. package/dist/types/react/index.d.ts +6 -0
  42. package/dist/types/react/page-renderer.d.ts +30 -0
  43. package/dist/types/react/structure-view.d.ts +30 -0
  44. package/dist/types/react/use-cell-store.d.ts +13 -0
  45. package/dist/types/react/use-container-size.d.ts +11 -0
  46. package/dist/types/runtime/boot.d.ts +7 -0
  47. package/dist/types/runtime/index.d.ts +4 -0
  48. package/dist/types/runtime/install.d.ts +21 -0
  49. package/dist/types/runtime/shims.d.ts +11 -0
  50. package/dist/types/runtime/store-export.d.ts +18 -0
  51. package/dist/types/testing/base-props.d.ts +3 -0
  52. package/dist/types/testing/components.d.ts +51 -0
  53. package/dist/types/testing/golden.d.ts +51 -0
  54. package/dist/types/testing/ids.d.ts +14 -0
  55. package/dist/types/testing/index.d.ts +5 -0
  56. package/dist/types/testing/sources.d.ts +25 -0
  57. package/package.json +51 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"testing.js","names":[],"sources":["../src/testing/ids.ts","../src/testing/base-props.ts","../src/testing/components.tsx","../src/testing/golden.ts","../src/testing/sources.ts"],"mappings":";;;;;;;;;;;;;;;;AAKA,IAAa,aAAa,MAAc,2BAA2B,OAAO,CAAC,CAAC,CAAC,SAAS,IAAI,GAAG;AAE7F,IAAa,aAAa;AAG1B,IAAa,oBAAoB,CAAC,kBAAkB,iBAAiB;AACrE,IAAa,uBAAuB;AAEpC,IAAa,aAAa;CAAE,IAAI,UAAU,CAAC;CAAG,MAAM;AAAiB;AACrE,IAAa,cAAc;CAAE,IAAI,UAAU,CAAC;CAAG,MAAM;AAAkB;;;ACTvE,IAAa,qBAAgC;CAC3C,MAAM;EAAE,IAAI,UAAU,CAAC;EAAG,OAAO,UAAU;EAAwB,UAAU;CAAiB;CAC9F,QAAQ;EAAE,IAAI,WAAW;EAAI,SAAS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,0 +1,49 @@
1
+ import type { ComponentType } from 'react';
2
+ /** A bundle row as the loader needs it. RLS decides which rows the viewer sees. */
3
+ export type BundleRow = {
4
+ id: string;
5
+ org_id: string;
6
+ org_slug: string;
7
+ bundle_name: string;
8
+ version: string;
9
+ storage_path: string | null;
10
+ is_public: boolean;
11
+ is_live: boolean;
12
+ components: Array<{
13
+ component_name: string | null;
14
+ exposed_export: string | null;
15
+ }>;
16
+ };
17
+ export type LoadedBundle = {
18
+ id: string;
19
+ label: string;
20
+ components: Record<string, ComponentType<Record<string, unknown>>>;
21
+ /** `contracts.json`: per-component @data / @action / @printPolicy / @size. */
22
+ contracts: Record<string, unknown>;
23
+ ThemeProvider?: ComponentType<{
24
+ children?: unknown;
25
+ }>;
26
+ documentProfiles?: unknown;
27
+ paginatorBindings?: unknown;
28
+ };
29
+ /** A function, forwardRef, memo or lazy export: something React can render. */
30
+ export declare function isComponentExport(value: unknown): value is ComponentType<Record<string, unknown>>;
31
+ /** Map registry rows (`exposed_export` → `component_name`) onto a module, and lift the bundle-level exports. */
32
+ export declare function projectModule(row: BundleRow, mod: Record<string, unknown>, contracts?: Record<string, unknown>): LoadedBundle;
33
+ export type BundleFiles = {
34
+ /** A file of the bundle's version, or null when the row has no files. */
35
+ url: (row: BundleRow, file: string) => string | null;
36
+ import?: (url: string) => Promise<Record<string, unknown>>;
37
+ fetch?: (url: string) => Promise<Response>;
38
+ };
39
+ /** Resolves once the host has installed its runtime (`@peripheries/renderer/runtime`'s installRuntime). */
40
+ export declare function runtimeReady(g?: Record<string, unknown>): Promise<void>;
41
+ /**
42
+ * Load one bundle, once per bundle id (ids are immutable). Waits for the
43
+ * shared runtime first, so the bundle's bare imports resolve to the host's.
44
+ */
45
+ export declare function loadBundle(row: BundleRow, files: BundleFiles): Promise<LoadedBundle>;
46
+ /** Load every bundle in scope in parallel; a failure drops that bundle, not the page. */
47
+ export declare function loadBundles(rows: BundleRow[], files: BundleFiles): Promise<LoadedBundle[]>;
48
+ /** Test seam. */
49
+ export declare function _clearBundleCache(): void;
@@ -0,0 +1,17 @@
1
+ import type { PageCell } from '../types.js';
2
+ import type { BundleRow, LoadedBundle } from './load.js';
3
+ import { type LineageRef } from './refs.js';
4
+ /** Every lineage the page and its cells reference: the scope, then any cell's own bundle_ref. */
5
+ export declare function pageBundleRefs(scope: LineageRef[], cells: PageCell[], pageOrgId: string | null): LineageRef[];
6
+ /** The bundles a page renders with: its scope, nearest first, and each cell's own bundle_ref. */
7
+ export type PageBundles = {
8
+ /** null while the bundles load (and always on the server). */
9
+ scope: LoadedBundle[] | null;
10
+ forCell: (cell: PageCell) => LoadedBundle | null;
11
+ };
12
+ /**
13
+ * Match the loaded bundles to the page's scope and to cells' own refs. `rows`
14
+ * are the bundle rows found for `pageBundleRefs(scope, …)`; `loaded` is null
15
+ * until they have imported.
16
+ */
17
+ export declare function pageBundles(scope: LineageRef[], rows: BundleRow[], loaded: LoadedBundle[] | null, pageOrgId: string | null): PageBundles;
@@ -0,0 +1,41 @@
1
+ export type { BundleRef } from '@peripheries/runtime';
2
+ export type LineageRef = {
3
+ kind: 'lineage';
4
+ orgSlug: string;
5
+ bundle: string;
6
+ } | {
7
+ kind: 'lineage-in-org';
8
+ orgId: string;
9
+ bundle: string;
10
+ } | {
11
+ kind: 'pinned';
12
+ bundleId: string;
13
+ };
14
+ export declare const MAIN = "main";
15
+ export declare const PUBLIC = "public";
16
+ /**
17
+ * Normalise a config ref. An org slug means that org's main lineage. A named
18
+ * lineage without `org_slug` belongs to the page's org, so it needs `pageOrgId`;
19
+ * without one it is dropped rather than guessed.
20
+ */
21
+ export declare function normalizeRef(ref: unknown, pageOrgId?: string | null): LineageRef | null;
22
+ export declare const refKey: (r: LineageRef) => string;
23
+ /** Where a page's bundles come from, nearest level first (cell refs are per cell). */
24
+ export type BundleScopeInput = {
25
+ pageOrgId?: string | null;
26
+ /** `project_page.metadata.bundle_refs` */
27
+ pageRefs?: unknown[] | null;
28
+ /** `project_template.{org_id, bundle_name}` */
29
+ projectTemplate?: {
30
+ orgId: string;
31
+ bundleName: string | null;
32
+ } | null;
33
+ /** The section's route entry `bundle_ref` (R3). */
34
+ sectionRef?: unknown;
35
+ /** The org whose main lineage is the fallback: the org template's advisor org or its own org. */
36
+ orgs?: Array<{
37
+ id: string;
38
+ }>;
39
+ };
40
+ /** The ordered, de-duplicated lineage list for a page: page → project → section → org main. */
41
+ export declare function bundleScope(input: BundleScopeInput): LineageRef[];
@@ -0,0 +1,25 @@
1
+ import type { ComponentType } from 'react';
2
+ import type { LoadedBundle } from './load.js';
3
+ export type CoreRegistry = Record<string, ComponentType<Record<string, unknown>>>;
4
+ export type ResolvedComponent = {
5
+ Component: ComponentType<Record<string, unknown>>;
6
+ /** Which bundle supplied it, or 'core'. */
7
+ source: string;
8
+ };
9
+ /**
10
+ * One cascade (design/core.md §6, design/bundles.md §2):
11
+ * - `@core/Name` and `host:Name` come from the host only;
12
+ * - a cell with its own bundle_ref resolves from that bundle, then core;
13
+ * - otherwise the page's bundles, nearest level first, then core.
14
+ * Federated wins on a name collision, core last: that is how a component
15
+ * repo replaces a default core component.
16
+ */
17
+ export declare function resolveComponent(name: string, { cellBundle, scope, core }: {
18
+ cellBundle?: LoadedBundle | null;
19
+ scope: LoadedBundle[];
20
+ core: CoreRegistry;
21
+ }): ResolvedComponent | null;
22
+ /** The ThemeProvider of the nearest bundle that exports one. */
23
+ export declare function nearestThemeProvider(scope: LoadedBundle[]): ComponentType<{
24
+ children?: unknown;
25
+ }> | undefined;
@@ -0,0 +1,39 @@
1
+ import type { DataContext, PageCell } from './types.js';
2
+ export type CellStatus = {
3
+ isLoading: boolean;
4
+ isError: boolean;
5
+ errors?: Error[];
6
+ };
7
+ /**
8
+ * A cell's own `data` prop (the PWA's projectDataBundle): its static values,
9
+ * then each declared key read from the page context (a registry alias reads
10
+ * that key). Every declared key is present, `undefined` while loading.
11
+ */
12
+ export declare function projectCellData(cell: PageCell, ctx: DataContext): {
13
+ data: Record<string, unknown>;
14
+ status: CellStatus;
15
+ } | null;
16
+ export type AssembledInputs = {
17
+ resolvedProps: Record<string, unknown>;
18
+ children: unknown;
19
+ baseProps: unknown;
20
+ cellData: ReturnType<typeof projectCellData>;
21
+ actions: Record<string, unknown> | undefined;
22
+ selections?: Record<string, unknown>;
23
+ viewState?: Record<string, unknown>;
24
+ live?: Record<string, unknown>;
25
+ size?: {
26
+ width: number;
27
+ height: number;
28
+ };
29
+ navigate: (to: string) => void;
30
+ context: Record<string, unknown>;
31
+ };
32
+ /**
33
+ * The PWA's order (CellRenderer.tsx:973-989), so contract props win over
34
+ * `cell.props`: props, children, isLoading / error, baseProps, data / status,
35
+ * actions, the store bundles; then what's new here: size, navigate, context
36
+ * (design/core.md §4). `isLoading` / `error` come from the cell's own data,
37
+ * not, as in the PWA, from whichever page key came first.
38
+ */
39
+ export declare function assembleCellProps(i: AssembledInputs): Record<string, unknown>;
@@ -0,0 +1,39 @@
1
+ import type { Diagnostic } from './graph.js';
2
+ import type { PageCell } from './types.js';
3
+ /** The config fields a thin ref took from its DSNS (the PWA's HYDRATED_CELL_FIELDS, which the agency's publish mirrors). */
4
+ export declare const HYDRATED_CELL_FIELDS: readonly ["component", "props", "layout", "conditions", "children", "traversal", "data", "bundle_ref", "actions"];
5
+ /** Also kept, unlike the PWA, whose hydration and publish dropped them (design/core.md §3). */
6
+ export declare const STORE_FIELDS: readonly ["selections", "viewState", "live"];
7
+ /** What a ref's node owns: everything but the cell's placement. A field its config sets wins, as a whole. */
8
+ export declare const CONTENT_FIELDS: readonly [...("data" | "children" | "actions" | "component" | "props" | "conditions" | "traversal" | "bundle_ref")[], "selections", "viewState", "live"];
9
+ /** Where a rendered cell's content came from. */
10
+ export type CellSource = 'inline' | 'node' | 'fallback' | 'pending';
11
+ /** A cell as the renderer reads it: its content resolved, `graph_node_id` its own node (if any). */
12
+ export type ResolvedCell = PageCell & {
13
+ source: CellSource;
14
+ };
15
+ /**
16
+ * The one place the authored forms are read (design/renderer.md §3.1):
17
+ * 1 inline; 2 inline with a `ref`; 3 `{ id, graph_node_id }` (legacy thin ref,
18
+ * read as 2); 4 inline with a `graph_node_id` (legacy, read as 1, walking
19
+ * from that node). Legacy forms are reported, so their use can be counted.
20
+ */
21
+ export declare function normalizeCell(cell: PageCell, path?: string): {
22
+ cell: PageCell;
23
+ diagnostics: Diagnostic[];
24
+ };
25
+ /** Whether a (normalized) cell's content is managed by a node. */
26
+ export declare const hasRef: (cell: PageCell) => cell is PageCell & {
27
+ ref: NonNullable<PageCell["ref"]>;
28
+ };
29
+ /**
30
+ * A normalized cell with its node's `page_cell_config` (design/renderer.md §3.2):
31
+ * - the node owns the content (CONTENT_FIELDS): a field the config sets wins;
32
+ * - the page owns the placement: `id`, and `layout` when the entry has one;
33
+ * - `name` from the entry if it has one; `metadata` merged, entry then config;
34
+ * - no config: the entry renders as it is when it names a component
35
+ * (`fallback`), else the cell is `pending`.
36
+ */
37
+ export declare function resolveCell(cell: PageCell, config: Record<string, unknown> | null | undefined): ResolvedCell;
38
+ /** Cells no other cell lists in `children`: what a flat page renders, in content order. */
39
+ export declare function rootCells<T extends PageCell>(cells: T[]): T[];
@@ -0,0 +1,38 @@
1
+ import type { NodeRecord, StateName } from '@peripheries/runtime';
2
+ import { readField, type Diagnostic, type ProcessSystems } from './graph.js';
3
+ export { readField };
4
+ import type { DataContext, DeclaredBinding, ProjectPage } from './types.js';
5
+ /** A system a declaration reads: by name from the page's process, or named outright by id. */
6
+ export type StateRead = {
7
+ name?: StateName;
8
+ systemId: string;
9
+ };
10
+ /** A declaration with the systems it reads, in merge order. */
11
+ export type ResolvedDeclaration = DeclaredBinding & {
12
+ reads: StateRead[];
13
+ };
14
+ /**
15
+ * Declarations (`data.queries`) with the systems each reads: `system_id`
16
+ * outright, else its `state` names (default `eng_data`) through the page's
17
+ * systems. Only node bindings: a registry binding is left to projectCellData
18
+ * (as an alias) and to validation. A declaration none of whose systems exist
19
+ * is dropped, with a diagnostic.
20
+ */
21
+ export declare function resolveDeclarations(queries: Record<string, unknown> | undefined, systems: ProcessSystems, diagnostics?: Diagnostic[], cellId?: string): Record<string, ResolvedDeclaration>;
22
+ /** The page's own declarations (`content.data.queries`), which every cell sees. */
23
+ export declare const collectDeclarations: (page: ProjectPage, systems: ProcessSystems, diagnostics?: Diagnostic[]) => Record<string, ResolvedDeclaration>;
24
+ /** The page's static values (`content.data.static`), which every cell sees. */
25
+ export declare function collectStatic(page: ProjectPage): Record<string, unknown>;
26
+ /**
27
+ * The page-wide DataContext: static, then declared on top. A declared label
28
+ * whose producer has no state resolves to null. `states` is keyed
29
+ * `<system_id>/<graph_node_id>`; `records` holds the NodeRecords for
30
+ * `as: 'record'` declarations, by graph node id. Traversal is per cell
31
+ * (the cell's walk; design/renderer.md §5.2), not part of this context.
32
+ */
33
+ export declare function buildDataContext(input: {
34
+ static: Record<string, unknown>;
35
+ declared: Record<string, ResolvedDeclaration>;
36
+ states: Map<string, unknown>;
37
+ records?: Record<string, NodeRecord>;
38
+ }): DataContext;
@@ -0,0 +1,95 @@
1
+ import { type EdgeRecord, type NodeRecord, type StateName, type StateRecord, type Traversal, type TraversalConfig } from '@peripheries/runtime';
2
+ import type { PageCell } from './types.js';
3
+ /** The page's systems by name, from its process (and, for eng_data, the page's metadata fallbacks). */
4
+ export type ProcessSystems = Partial<Record<StateName, string>>;
5
+ /**
6
+ * Something wrong with a page's configuration (design/renderer.md §7). Codes
7
+ * are stable, so tools can explain them; `legacy` marks a form still read but
8
+ * on its way out.
9
+ */
10
+ export type Diagnostic = {
11
+ severity: 'error' | 'warning' | 'legacy';
12
+ code: string;
13
+ message: string;
14
+ /** Where in the page, e.g. `content.cells[3].traversal`. */
15
+ path?: string;
16
+ cellId?: string;
17
+ label?: string;
18
+ };
19
+ /** A process row's system columns, `<tier>_<role>_system_id`, as names. */
20
+ export declare function systemsFromProcess(row: Record<string, unknown> | null | undefined): ProcessSystems;
21
+ /** The state names a read asks for, in order, duplicates dropped; the default when it names none. */
22
+ export declare function stateNames(state: unknown): {
23
+ names: StateName[];
24
+ unknown: string[];
25
+ };
26
+ /** A value at a dot-path: the whole value without one. */
27
+ export declare function readField(state: unknown, field?: string): unknown;
28
+ /**
29
+ * Several systems' data for one node, merged in order, later winning: plain
30
+ * objects key by key, anything else replaces. `undefined` when none had any,
31
+ * so "not loaded" and "empty" differ.
32
+ */
33
+ export declare function mergeStates(values: readonly unknown[]): unknown;
34
+ /** The named states of a NodeRecord, merged, then `field`. */
35
+ export declare function stateValue(state: NodeRecord['state'], names: readonly StateName[], field?: string): unknown;
36
+ export type WalkStart = {
37
+ graphNodeId: string;
38
+ kind: 'cell' | 'page';
39
+ };
40
+ /** A cell's own node (a thin ref's, or an inline cell's `graph_node_id`), else the page node (agency doc 17). */
41
+ export declare function resolveWalkStart(cell: Pick<PageCell, 'graph_node_id' | 'metadata'>, pageGraphNodeId: string | null | undefined): WalkStart | null;
42
+ /** Every data label a cell's props and conditions read with a whole-string `@label…` reference. */
43
+ export declare function referencedLabels(cell: Pick<PageCell, 'props' | 'conditions'>): Set<string>;
44
+ /**
45
+ * Whether a cell's walk has anything to give it (design/renderer.md §5.2): it
46
+ * reads `@_traversal`, or a label nothing explicit provides. Declarations win
47
+ * over what a walk finds, so a walk whose labels are all declared changes nothing.
48
+ */
49
+ export declare function needsWalk(cell: PageCell, explicit: ReadonlySet<string>): boolean;
50
+ export type WalkRequest = {
51
+ start: WalkStart;
52
+ direction: 'incoming' | 'outgoing' | 'both';
53
+ edgeTypes: string[];
54
+ nodeTypes: string[] | null;
55
+ maxDepth: number;
56
+ maxNodes: number;
57
+ /** The state names asked for, and the system each resolves to. */
58
+ states: Array<{
59
+ name: StateName;
60
+ systemId: string;
61
+ }>;
62
+ excludeNodeTypes: string[] | null;
63
+ excludeEdgeTypes: string[] | null;
64
+ };
65
+ /** A cell's walk as a request, or why it can't run. */
66
+ export declare function walkRequest(config: TraversalConfig, start: WalkStart, systems: ProcessSystems): {
67
+ request?: WalkRequest;
68
+ diagnostics: Omit<Diagnostic, 'cellId'>[];
69
+ };
70
+ /** One walk per distinct question: cells asking the same one from the same start share it. */
71
+ export declare const walkKey: (r: WalkRequest) => string;
72
+ /** What walk_graph returns: nodes with their states keyed by system id. */
73
+ export type RawWalk = {
74
+ nodes: Array<Omit<NodeRecord, 'state'> & {
75
+ state: Record<string, StateRecord | null>;
76
+ }>;
77
+ edges: EdgeRecord[];
78
+ truncated: boolean;
79
+ };
80
+ export type WalkBinding = {
81
+ label: string;
82
+ graph_node_id: string;
83
+ field?: string;
84
+ };
85
+ /**
86
+ * A walk's result for its cells: `@_traversal` (NodeRecords with states by
87
+ * name, noise stripped, edges only between what's left), and the labels its
88
+ * `binding_key` nodes provide. Two nodes with one key is a diagnostic, and
89
+ * neither binds.
90
+ */
91
+ export declare function readWalk(raw: RawWalk, request: WalkRequest): {
92
+ traversal: Traversal;
93
+ bindings: WalkBinding[];
94
+ diagnostics: Omit<Diagnostic, 'cellId'>[];
95
+ };
@@ -0,0 +1,19 @@
1
+ export { CONTENT_FIELDS, hasRef, HYDRATED_CELL_FIELDS, normalizeCell, resolveCell, rootCells, STORE_FIELDS, type CellSource, type ResolvedCell } from './cells.js';
2
+ export { buildDataContext, collectDeclarations, collectStatic, readField, resolveDeclarations, type ResolvedDeclaration, type StateRead } from './data-context.js';
3
+ export { mergeStates, needsWalk, readWalk, referencedLabels, resolveWalkStart, stateNames, stateValue, systemsFromProcess, walkKey, walkRequest, type Diagnostic, type ProcessSystems, type RawWalk, type WalkBinding, type WalkRequest, type WalkStart, } from './graph.js';
4
+ export { loadPageData, resolveDataSystem, resolveSystems, type CellData, type CellWalk, type GraphSource, type NodeRecordRow, type PageRuntime } from './load-page.js';
5
+ export { cellResolutionContext, passesConditions, resolveReferences, settled, type CellScope, type ResolutionContext } from './references.js';
6
+ export { validateCell, validatePage, type Catalog } from './validate.js';
7
+ export type * from './types.js';
8
+ export { assembleCellProps, projectCellData, type CellStatus } from './cell-props.js';
9
+ export { cellAttributes, cellPlacementStyle, pageContainerStyle } from './layout.js';
10
+ export { deriveElementReferences, deriveSectionNumbering, deriveSectionReferences, mergeSectionReferences, nodePrintStyle, normalizeStructure, numberingFor, PAGE_DOCUMENT, referencesFor, SECTION_KINDS, sectionAnchor, structureIssues, usesStructureLayout, type LayoutNode, type SectionNumbering, type SectionReference, type SectionReferences, } from './structure.js';
11
+ export { _clearBundleCache, isComponentExport, loadBundle, loadBundles, projectModule, runtimeReady, type BundleFiles, type BundleRow, type LoadedBundle, } from './bundles/load.js';
12
+ export { pageBundleRefs, pageBundles, type PageBundles } from './bundles/page-bundles.js';
13
+ export { bundleScope, MAIN, normalizeRef, PUBLIC, refKey, type BundleRef, type BundleScopeInput, type LineageRef } from './bundles/refs.js';
14
+ export { nearestThemeProvider, resolveComponent, type CoreRegistry, type ResolvedComponent } from './bundles/resolve.js';
15
+ export { createStackStore, type StackStoreApi } from './store/create-store.js';
16
+ export { clearScope, loadScope, saveScope, type StorageMode } from './store/persistence.js';
17
+ export { attachSelectionSetters, attachViewStateSetters, collectScopeIds, projectLive, projectSelections, projectViewState, shallowEqualBundle } from './store/projection.js';
18
+ export { pageScopeKey, projectScopeKey, resolveScopeId, type ScopeContext } from './store/scope-keys.js';
19
+ export type * from './store/types.js';
@@ -0,0 +1,12 @@
1
+ import type { CSSProperties } from 'react';
2
+ import type { CellLayout, PageCell } from './types.js';
3
+ /** The page container (the PWA's ProjectPageRenderer): stack by default; grid of `columns` (12); flex. */
4
+ export declare function pageContainerStyle(layout: Record<string, unknown> | null | undefined): CSSProperties;
5
+ /** A cell's placement in the page grid; a nested cell gets none. */
6
+ export declare function cellPlacementStyle(layout: CellLayout | undefined): CSSProperties;
7
+ /**
8
+ * Hooks for CSS: the host's own responsive rules (base.css) read the generic
9
+ * names; the `data-oa-*` duplicates keep bundles' existing stylesheets working
10
+ * until they move (design/bundles.md §6).
11
+ */
12
+ export declare function cellAttributes(cell: PageCell): Record<string, string>;
@@ -0,0 +1,72 @@
1
+ import type { NodeRecord, StateRecord, Traversal } from '@peripheries/runtime';
2
+ import { type ResolvedCell } from './cells.js';
3
+ import { type Diagnostic, type ProcessSystems, type RawWalk, type WalkRequest } from './graph.js';
4
+ import type { DataContext, ProjectPage } from './types.js';
5
+ /** A NodeRecord as a source returns it: its states keyed by system id. */
6
+ export type NodeRecordRow = Omit<NodeRecord, 'state'> & {
7
+ stateBySystem: Record<string, StateRecord | null>;
8
+ };
9
+ /**
10
+ * Where a page's graph data comes from (design/renderer.md §6). The host's
11
+ * reads GraphQL under the viewer's JWT; the harness's reads fixtures; the
12
+ * agency's reads its own client. Every method may cache.
13
+ */
14
+ export interface GraphSource {
15
+ /** The process row: its `<tier>_<role>_system_id` columns. */
16
+ processSystems(processId: string): Promise<Record<string, unknown> | null>;
17
+ /** The newest `page_cell_config` of each cell node in a system. */
18
+ cellConfigs(systemId: string, graphNodeIds: string[]): Promise<Record<string, Record<string, unknown> | null>>;
19
+ /** The newest state's data of each node in a system; missing nodes absent. */
20
+ latestStates(systemId: string, graphNodeIds: string[]): Promise<Record<string, unknown>>;
21
+ walk(request: WalkRequest): Promise<RawWalk>;
22
+ nodeRecords(graphNodeIds: string[], systemIds: string[]): Promise<Record<string, NodeRecordRow>>;
23
+ }
24
+ /** A cell's own walk: `@_traversal`, and the labels its `binding_key` nodes provide. */
25
+ export type CellWalk = {
26
+ traversal: Traversal;
27
+ labels: DataContext;
28
+ };
29
+ /**
30
+ * A cell's own data (design/renderer.md §5.2): its static values, its
31
+ * declarations (inline, or from its ref's config) and its walk. A cell
32
+ * resolves against, lowest first: static (the page's, then its own), its
33
+ * walk, the page's declarations, its own declarations.
34
+ */
35
+ export type CellData = {
36
+ static: DataContext;
37
+ declared: DataContext;
38
+ walk?: CellWalk;
39
+ };
40
+ export type PageRuntime = {
41
+ page: ProjectPage;
42
+ /** Every cell, its content resolved: inline as written, a ref's from its node (or its fallback). */
43
+ cells: ResolvedCell[];
44
+ /** Ref cells with neither a node config nor a component of their own: rendered as pending. */
45
+ unresolved: string[];
46
+ /** The page's static values, then its declarations on top: what every cell sees. */
47
+ data: DataContext;
48
+ /** Labels the page declares: a walk's label of the same name never replaces them. */
49
+ declared: string[];
50
+ /** Each cell's own data, by cell id (only cells that have some). */
51
+ cellData: Record<string, CellData>;
52
+ systems: ProcessSystems;
53
+ engDataSystemId: string | null;
54
+ diagnostics: Diagnostic[];
55
+ };
56
+ /**
57
+ * A page's systems by name: its process's twelve system columns, with the two
58
+ * denormalised copies in metadata as eng_data's fallbacks (the PWA's
59
+ * eng-data-system-id.ts order: the process, pageProcess, systemGraph).
60
+ */
61
+ export declare function resolveSystems(source: Pick<GraphSource, 'processSystems'>, page: ProjectPage): Promise<ProcessSystems>;
62
+ /** The page's DSNS: what thin refs hydrate from and what declarations read by default. */
63
+ export declare function resolveDataSystem(source: Pick<GraphSource, 'processSystems'>, page: ProjectPage): Promise<string | null>;
64
+ /**
65
+ * Everything a page needs before it renders (design/core.md §3, stages 1–3;
66
+ * design/renderer.md §3, §5): read every ref's node config (one read per
67
+ * system), then every declaration's producer (one read per system), every
68
+ * walk a cell needs and any NodeRecords, in parallel. Framework-free: the
69
+ * source decides how each read runs (the host's runs in its route loader,
70
+ * through TanStack Query, under the viewer's JWT).
71
+ */
72
+ export declare function loadPageData(page: ProjectPage, source: GraphSource): Promise<PageRuntime>;
@@ -0,0 +1,43 @@
1
+ import type { DataContext } from './types.js';
2
+ export type ResolutionContext = {
3
+ data: DataContext;
4
+ params: Record<string, unknown>;
5
+ };
6
+ /** Resolve every string in a value, recursively through arrays and plain objects. Keys aren't resolved. */
7
+ export declare function resolveReferences<T = unknown>(value: T, ctx: ResolutionContext): T;
8
+ export declare const settled: (data: unknown) => {
9
+ data: unknown;
10
+ isLoading: boolean;
11
+ error: null;
12
+ };
13
+ /** What a cell brings to its own resolution (loadPageData's CellData), and the labels the page declares. */
14
+ export type CellScope = {
15
+ static?: DataContext;
16
+ declared?: DataContext;
17
+ walk?: {
18
+ traversal: {
19
+ nodes: unknown[];
20
+ edges: unknown[];
21
+ };
22
+ labels?: DataContext;
23
+ };
24
+ pageDeclared?: ReadonlySet<string>;
25
+ };
26
+ /**
27
+ * The context one cell resolves against (design/renderer.md §5.2), lowest
28
+ * first: the page's static values, the cell's own static values, the labels
29
+ * the cell's walk found, the page's declarations, the cell's own
30
+ * declarations; then its friendly registry aliases; then the reserved
31
+ * `_traversal`, `params` and `baseProps`, which nothing can shadow.
32
+ * Explicit beats discovered: no walk label replaces a declared one.
33
+ */
34
+ export declare function cellResolutionContext(cell: {
35
+ data?: {
36
+ queries?: Record<string, unknown>;
37
+ };
38
+ }, page: ResolutionContext, own?: CellScope, baseProps?: unknown): ResolutionContext;
39
+ /** showIf / hideIf: values (usually strict refs) tested for truthiness. An empty string skips the check. */
40
+ export declare function passesConditions(conditions: {
41
+ showIf?: unknown;
42
+ hideIf?: unknown;
43
+ } | undefined, ctx: ResolutionContext): boolean;
@@ -0,0 +1,26 @@
1
+ import { Store } from '@tanstack/store';
2
+ import type { LiveEntry, ScopeId, SelectionsScope, StackStoreData, StackStoreState, ViewStateScope } from './types.js';
3
+ export type StackStoreApi = ReturnType<typeof createStackStore>;
4
+ /**
5
+ * The shared store, on TanStack Store (design/bundles.md §5). One instance per
6
+ * page tree. `getState()` returns the data with the actions, the shape the
7
+ * PWA's zustand store exposed to the escape-hatch API.
8
+ */
9
+ export declare function createStackStore(initial?: Partial<StackStoreData>): {
10
+ getState: () => StackStoreState;
11
+ subscribe: (listener: (state: StackStoreState) => void) => import("@tanstack/store").Subscription;
12
+ setSelection: (scope: ScopeId, channel: string, value: unknown) => void;
13
+ setViewState: (scope: ScopeId, key: string, value: unknown) => void;
14
+ _setLive: (channel: string, entry: LiveEntry) => void;
15
+ _hydrateScope: (scope: ScopeId, slice: {
16
+ selections?: SelectionsScope;
17
+ viewState?: ViewStateScope;
18
+ }) => void;
19
+ _snapshotScope: (scope: ScopeId) => {
20
+ selections: SelectionsScope;
21
+ viewState: ViewStateScope;
22
+ };
23
+ _clearScope: (scope: ScopeId) => void;
24
+ /** The underlying TanStack store, for `useSelector`. */
25
+ store: Store<StackStoreData, never>;
26
+ };
@@ -0,0 +1,9 @@
1
+ import type { ScopeId, SelectionsScope, ViewStateScope } from './types.js';
2
+ export type StorageMode = 'session' | 'local' | 'none';
3
+ export interface PersistedScope {
4
+ selections?: SelectionsScope;
5
+ viewState?: ViewStateScope;
6
+ }
7
+ export declare function loadScope(scope: ScopeId, mode: StorageMode): PersistedScope | null;
8
+ export declare function saveScope(scope: ScopeId, slice: PersistedScope, mode: StorageMode): void;
9
+ export declare function clearScope(scope: ScopeId, mode: StorageMode): void;
@@ -0,0 +1,15 @@
1
+ import type { StackStoreApi } from './create-store.js';
2
+ import { type ScopeContext } from './scope-keys.js';
3
+ import type { LiveDeclarations, ProjectedBundle, ScopeId, SelectionDeclarations, StackStoreData, ViewStateDeclarations } from './types.js';
4
+ export declare function projectSelections(decls: SelectionDeclarations | undefined, state: StackStoreData, ctx: ScopeContext): ProjectedBundle | undefined;
5
+ /** Selections are read-only unless `writable`. */
6
+ export declare function attachSelectionSetters(values: ProjectedBundle, decls: SelectionDeclarations, store: StackStoreApi, ctx: ScopeContext): ProjectedBundle;
7
+ export declare function projectViewState(decls: ViewStateDeclarations | undefined, state: StackStoreData, ctx: ScopeContext): ProjectedBundle | undefined;
8
+ /** viewState is writable unless `writable: false`. */
9
+ export declare function attachViewStateSetters(values: ProjectedBundle, decls: ViewStateDeclarations, store: StackStoreApi, ctx: ScopeContext): ProjectedBundle;
10
+ /** `live.<name>` is the data; `live.<name>Status` the envelope. */
11
+ export declare function projectLive(decls: LiveDeclarations | undefined, state: StackStoreData): ProjectedBundle | undefined;
12
+ /** Equality for a selector: re-render only when a projected channel changes. */
13
+ export declare function shallowEqualBundle(a: ProjectedBundle | undefined, b: ProjectedBundle | undefined): boolean;
14
+ /** Every scope a cell's declarations touch (for hydration and persistence). */
15
+ export declare function collectScopeIds(ctx: ScopeContext, selections?: SelectionDeclarations, viewState?: ViewStateDeclarations): ScopeId[];
@@ -0,0 +1,10 @@
1
+ import type { ScopeKind } from '@peripheries/runtime';
2
+ import type { ScopeId } from './types.js';
3
+ export declare const pageScopeKey: (pageId: string) => ScopeId;
4
+ export declare const projectScopeKey: (projectId: string) => ScopeId;
5
+ export interface ScopeContext {
6
+ pageId?: string | null;
7
+ projectId?: string | null;
8
+ }
9
+ /** `null` when the context lacks the id: no scope, so no value and no setter. */
10
+ export declare function resolveScopeId(kind: ScopeKind, ctx: ScopeContext): ScopeId | null;
@@ -0,0 +1,37 @@
1
+ export type ScopeId = string;
2
+ export type { ScopeKind } from '@peripheries/runtime';
3
+ export type SelectionsScope = Record<string, unknown>;
4
+ export type ViewStateScope = Record<string, unknown>;
5
+ export interface LiveEntry<T = unknown> {
6
+ data: T;
7
+ updatedAt: string;
8
+ status: 'idle' | 'streaming' | 'error';
9
+ error?: string;
10
+ }
11
+ export interface StackStoreData {
12
+ selections: Record<ScopeId, SelectionsScope>;
13
+ viewState: Record<ScopeId, ViewStateScope>;
14
+ /** Global, not scoped: a channel is one source. */
15
+ live: Record<string, LiveEntry>;
16
+ }
17
+ export interface StackStoreActions {
18
+ /** Cell-facing, through projected setter props. */
19
+ setSelection: (scope: ScopeId, channel: string, value: unknown) => void;
20
+ setViewState: (scope: ScopeId, key: string, value: unknown) => void;
21
+ /** Host-internal. */
22
+ _setLive: (channel: string, entry: LiveEntry) => void;
23
+ _hydrateScope: (scope: ScopeId, slice: {
24
+ selections?: SelectionsScope;
25
+ viewState?: ViewStateScope;
26
+ }) => void;
27
+ _snapshotScope: (scope: ScopeId) => {
28
+ selections: SelectionsScope;
29
+ viewState: ViewStateScope;
30
+ };
31
+ _clearScope: (scope: ScopeId) => void;
32
+ }
33
+ /** What a selector sees: the data plus the actions, as the PWA's zustand store exposed. */
34
+ export type StackStoreState = StackStoreData & StackStoreActions;
35
+ export type { LiveDecl, LiveDeclarations, SelectionDecl, SelectionDeclarations, ViewStateDecl, ViewStateDeclarations, } from '@peripheries/runtime';
36
+ /** Spread onto a cell's `selections` / `viewState` / `live` props. */
37
+ export type ProjectedBundle = Record<string, unknown>;