blocks-renderer 0.1.1 → 0.1.2
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 +13 -0
- package/adapter.d.ts +14 -0
- package/adapter.js +36 -0
- package/bindings.d.ts +6 -0
- package/bindings.js +12 -0
- package/context.d.ts +24 -0
- package/context.js +36 -0
- package/esm/adapter.js +33 -0
- package/esm/bindings.js +5 -0
- package/esm/context.js +31 -0
- package/esm/index.js +6 -0
- package/esm/registry.js +24 -0
- package/esm/renderer.js +85 -0
- package/esm/types.js +1 -0
- package/esm/unknown-block.js +10 -0
- package/index.d.ts +10 -0
- package/index.js +24 -0
- package/package.json +14 -32
- package/registry.d.ts +12 -0
- package/registry.js +30 -0
- package/renderer.d.ts +23 -0
- package/renderer.js +89 -0
- package/types.d.ts +32 -0
- package/types.js +2 -0
- package/unknown-block.d.ts +9 -0
- package/unknown-block.js +13 -0
- package/dist/index.cjs +0 -214
- package/dist/index.cjs.map +0 -1
- package/dist/index.d.cts +0 -106
- package/dist/index.d.ts +0 -106
- package/dist/index.js +0 -196
- package/dist/index.js.map +0 -1
package/dist/index.js
DELETED
|
@@ -1,196 +0,0 @@
|
|
|
1
|
-
// src/bindings.ts
|
|
2
|
-
var TEMPLATE = /\{\{\s*([^}\s]+)\s*\}\}/g;
|
|
3
|
-
function readPath(scope, path) {
|
|
4
|
-
let current = scope;
|
|
5
|
-
for (const segment of path.split(".")) {
|
|
6
|
-
if (current == null || typeof current !== "object") return void 0;
|
|
7
|
-
current = current[segment];
|
|
8
|
-
}
|
|
9
|
-
return current;
|
|
10
|
-
}
|
|
11
|
-
function resolveBinding(expression, scope) {
|
|
12
|
-
const single = expression.match(/^\{\{\s*([^}\s]+)\s*\}\}$/);
|
|
13
|
-
if (single) {
|
|
14
|
-
return readPath(scope, single[1]);
|
|
15
|
-
}
|
|
16
|
-
return expression.replace(TEMPLATE, (_match, path) => {
|
|
17
|
-
const value = readPath(scope, path);
|
|
18
|
-
return value == null ? "" : String(value);
|
|
19
|
-
});
|
|
20
|
-
}
|
|
21
|
-
function resolveNodeProps(node, scope) {
|
|
22
|
-
if (!node.bindings) return node.props ?? {};
|
|
23
|
-
const resolved = { ...node.props ?? {} };
|
|
24
|
-
for (const [prop, expression] of Object.entries(node.bindings)) {
|
|
25
|
-
resolved[prop] = resolveBinding(expression, scope);
|
|
26
|
-
}
|
|
27
|
-
return resolved;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
// src/context.tsx
|
|
31
|
-
import { createContext, useContext } from "react";
|
|
32
|
-
import { jsx } from "react/jsx-runtime";
|
|
33
|
-
var RendererContext = createContext(null);
|
|
34
|
-
function RendererProvider({ children, value }) {
|
|
35
|
-
return /* @__PURE__ */ jsx(RendererContext.Provider, { value, children });
|
|
36
|
-
}
|
|
37
|
-
function useRenderer() {
|
|
38
|
-
const context = useContext(RendererContext);
|
|
39
|
-
if (!context) {
|
|
40
|
-
throw new Error("useRenderer must be used within a RendererProvider (or a DocumentRenderer)");
|
|
41
|
-
}
|
|
42
|
-
return context;
|
|
43
|
-
}
|
|
44
|
-
function useBlockField(name) {
|
|
45
|
-
const { values, errors, setValue, setError, mode } = useRenderer();
|
|
46
|
-
if (!name) {
|
|
47
|
-
return { value: void 0, error: void 0, setValue: () => {
|
|
48
|
-
}, setError: () => {
|
|
49
|
-
}, mode };
|
|
50
|
-
}
|
|
51
|
-
return {
|
|
52
|
-
value: values[name],
|
|
53
|
-
error: errors[name],
|
|
54
|
-
setValue: (value) => setValue(name, value),
|
|
55
|
-
setError: (error) => setError(name, error),
|
|
56
|
-
mode
|
|
57
|
-
};
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
// src/registry.ts
|
|
61
|
-
function composeRegistry(...layers) {
|
|
62
|
-
const composed = {};
|
|
63
|
-
for (const layer of layers) {
|
|
64
|
-
if (!layer) continue;
|
|
65
|
-
Object.assign(composed, layer);
|
|
66
|
-
}
|
|
67
|
-
return composed;
|
|
68
|
-
}
|
|
69
|
-
function resolveBlock(registry, type) {
|
|
70
|
-
return registry[type];
|
|
71
|
-
}
|
|
72
|
-
function registeredTypes(registry) {
|
|
73
|
-
return Object.keys(registry).sort();
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
// src/renderer.tsx
|
|
77
|
-
import {
|
|
78
|
-
collectDefaultValues,
|
|
79
|
-
collectFieldConstraints,
|
|
80
|
-
collectFieldNames,
|
|
81
|
-
validateField
|
|
82
|
-
} from "blocks-schema";
|
|
83
|
-
import { useCallback, useEffect, useMemo, useState } from "react";
|
|
84
|
-
|
|
85
|
-
// src/unknown-block.tsx
|
|
86
|
-
import { jsxs } from "react/jsx-runtime";
|
|
87
|
-
function UnknownBlock({ node }) {
|
|
88
|
-
return /* @__PURE__ */ jsxs("div", { "data-block-unknown": node.type, role: "note", children: [
|
|
89
|
-
"Unknown block: ",
|
|
90
|
-
node.type
|
|
91
|
-
] });
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
// src/renderer.tsx
|
|
95
|
-
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
96
|
-
function BlockRenderer({ node }) {
|
|
97
|
-
const { registry, scope } = useRenderer();
|
|
98
|
-
const Component = registry[node.type];
|
|
99
|
-
if (!Component) {
|
|
100
|
-
return /* @__PURE__ */ jsx2(UnknownBlock, { node });
|
|
101
|
-
}
|
|
102
|
-
const children = node.children?.length ? node.children.map((child) => /* @__PURE__ */ jsx2(BlockRenderer, { node: child }, child.key)) : void 0;
|
|
103
|
-
return /* @__PURE__ */ jsx2(Component, { node, props: resolveNodeProps(node, scope), children });
|
|
104
|
-
}
|
|
105
|
-
function DocumentRenderer({
|
|
106
|
-
document,
|
|
107
|
-
registry,
|
|
108
|
-
initialValues,
|
|
109
|
-
scope: externalScope,
|
|
110
|
-
onSubmit,
|
|
111
|
-
onChange,
|
|
112
|
-
onAction,
|
|
113
|
-
mode = "preview",
|
|
114
|
-
className
|
|
115
|
-
}) {
|
|
116
|
-
const defaults = useMemo(() => collectDefaultValues(document.page), [document]);
|
|
117
|
-
const constraints = useMemo(() => collectFieldConstraints(document.page), [document]);
|
|
118
|
-
const [values, setValues] = useState(() => ({ ...defaults, ...initialValues }));
|
|
119
|
-
const [errors, setErrors] = useState({});
|
|
120
|
-
useEffect(() => {
|
|
121
|
-
setValues((previous) => ({ ...defaults, ...initialValues, ...previous }));
|
|
122
|
-
}, [defaults, initialValues]);
|
|
123
|
-
const setError = useCallback((name, error) => {
|
|
124
|
-
setErrors((previous) => {
|
|
125
|
-
if (error) return { ...previous, [name]: error };
|
|
126
|
-
if (!(name in previous)) return previous;
|
|
127
|
-
const next = { ...previous };
|
|
128
|
-
delete next[name];
|
|
129
|
-
return next;
|
|
130
|
-
});
|
|
131
|
-
}, []);
|
|
132
|
-
const setValue = useCallback(
|
|
133
|
-
(name, value) => {
|
|
134
|
-
setValues((previous) => {
|
|
135
|
-
const next = { ...previous, [name]: value };
|
|
136
|
-
onChange?.(next);
|
|
137
|
-
return next;
|
|
138
|
-
});
|
|
139
|
-
const field = constraints[name];
|
|
140
|
-
if (field) {
|
|
141
|
-
setError(name, validateField(value, field.constraints, field.required));
|
|
142
|
-
}
|
|
143
|
-
},
|
|
144
|
-
[onChange, constraints, setError]
|
|
145
|
-
);
|
|
146
|
-
const handleAction = useCallback(
|
|
147
|
-
(action, event) => {
|
|
148
|
-
if (event === "submit" && onSubmit) {
|
|
149
|
-
const failures = {};
|
|
150
|
-
for (const name of collectFieldNames(document.page)) {
|
|
151
|
-
const field = constraints[name];
|
|
152
|
-
if (!field) continue;
|
|
153
|
-
const error = validateField(values[name], field.constraints, field.required);
|
|
154
|
-
if (error) failures[name] = error;
|
|
155
|
-
}
|
|
156
|
-
if (Object.keys(failures).length > 0) {
|
|
157
|
-
setErrors(failures);
|
|
158
|
-
return;
|
|
159
|
-
}
|
|
160
|
-
onSubmit(values);
|
|
161
|
-
}
|
|
162
|
-
onAction?.(action, event);
|
|
163
|
-
},
|
|
164
|
-
[onSubmit, onAction, values, document.page, constraints]
|
|
165
|
-
);
|
|
166
|
-
const contextValue = useMemo(
|
|
167
|
-
() => ({
|
|
168
|
-
document,
|
|
169
|
-
registry,
|
|
170
|
-
mode,
|
|
171
|
-
values,
|
|
172
|
-
errors,
|
|
173
|
-
setValue,
|
|
174
|
-
setError,
|
|
175
|
-
scope: { ...externalScope, values, ...values },
|
|
176
|
-
onAction: handleAction
|
|
177
|
-
}),
|
|
178
|
-
[document, registry, mode, values, errors, setValue, setError, externalScope, handleAction]
|
|
179
|
-
);
|
|
180
|
-
return /* @__PURE__ */ jsx2(RendererProvider, { value: contextValue, children: /* @__PURE__ */ jsx2("div", { className, children: /* @__PURE__ */ jsx2(BlockRenderer, { node: document.page }) }) });
|
|
181
|
-
}
|
|
182
|
-
export {
|
|
183
|
-
BlockRenderer,
|
|
184
|
-
DocumentRenderer,
|
|
185
|
-
RendererProvider,
|
|
186
|
-
UnknownBlock,
|
|
187
|
-
composeRegistry,
|
|
188
|
-
readPath,
|
|
189
|
-
registeredTypes,
|
|
190
|
-
resolveBinding,
|
|
191
|
-
resolveBlock,
|
|
192
|
-
resolveNodeProps,
|
|
193
|
-
useBlockField,
|
|
194
|
-
useRenderer
|
|
195
|
-
};
|
|
196
|
-
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/bindings.ts","../src/context.tsx","../src/registry.ts","../src/renderer.tsx","../src/unknown-block.tsx"],"sourcesContent":["import type { UINode, UINodeProps } from 'blocks-schema';\n\nconst TEMPLATE = /\\{\\{\\s*([^}\\s]+)\\s*\\}\\}/g;\n\n/** Read a dotted path (`row.author.name`) out of a scope object. */\nexport function readPath(scope: Record<string, unknown>, path: string): unknown {\n\tlet current: unknown = scope;\n\tfor (const segment of path.split('.')) {\n\t\tif (current == null || typeof current !== 'object') return undefined;\n\t\tcurrent = (current as Record<string, unknown>)[segment];\n\t}\n\treturn current;\n}\n\n/**\n * Resolve a binding expression. A template that is exactly one placeholder\n * yields the raw value (so a boolean or an object survives); a template mixed\n * with text is interpolated as a string.\n */\nexport function resolveBinding(expression: string, scope: Record<string, unknown>): unknown {\n\tconst single = expression.match(/^\\{\\{\\s*([^}\\s]+)\\s*\\}\\}$/);\n\tif (single) {\n\t\treturn readPath(scope, single[1]);\n\t}\n\n\treturn expression.replace(TEMPLATE, (_match, path: string) => {\n\t\tconst value = readPath(scope, path);\n\t\treturn value == null ? '' : String(value);\n\t});\n}\n\n/** Apply a node's `bindings` over its static props. */\nexport function resolveNodeProps(node: UINode, scope: Record<string, unknown>): UINodeProps {\n\tif (!node.bindings) return node.props ?? {};\n\n\tconst resolved: UINodeProps = { ...(node.props ?? {}) };\n\tfor (const [prop, expression] of Object.entries(node.bindings)) {\n\t\tresolved[prop] = resolveBinding(expression, scope);\n\t}\n\treturn resolved;\n}\n","'use client';\n\nimport { createContext, useContext } from 'react';\nimport type { ReactNode } from 'react';\n\nimport type { RendererContextValue } from './types';\n\nconst RendererContext = createContext<RendererContextValue | null>(null);\n\nexport function RendererProvider({ children, value }: { children: ReactNode; value: RendererContextValue }) {\n\treturn <RendererContext.Provider value={value}>{children}</RendererContext.Provider>;\n}\n\nexport function useRenderer(): RendererContextValue {\n\tconst context = useContext(RendererContext);\n\tif (!context) {\n\t\tthrow new Error('useRenderer must be used within a RendererProvider (or a DocumentRenderer)');\n\t}\n\treturn context;\n}\n\n/**\n * Resolved props plus the value/error wiring for a field node. Widget\n * implementations use this instead of reaching into the document themselves.\n */\nexport function useBlockField(name: string | undefined) {\n\tconst { values, errors, setValue, setError, mode } = useRenderer();\n\tif (!name) {\n\t\treturn { value: undefined, error: undefined, setValue: () => {}, setError: () => {}, mode };\n\t}\n\treturn {\n\t\tvalue: values[name],\n\t\terror: errors[name],\n\t\tsetValue: (value: unknown) => setValue(name, value),\n\t\tsetError: (error: string | null) => setError(name, error),\n\t\tmode,\n\t};\n}\n","import type { BlockComponent, BlockRegistry } from './types';\n\n/**\n * Layer registries left-to-right, later layers winning. This is how a host\n * customizes rendering: base primitives, then an app registry, then per-document\n * overrides — no forking of the renderer, and no single global map.\n */\nexport function composeRegistry(...layers: (BlockRegistry | undefined)[]): BlockRegistry {\n\tconst composed: BlockRegistry = {};\n\tfor (const layer of layers) {\n\t\tif (!layer) continue;\n\t\tObject.assign(composed, layer);\n\t}\n\treturn composed;\n}\n\nexport function resolveBlock(registry: BlockRegistry, type: string): BlockComponent | undefined {\n\treturn registry[type];\n}\n\n/** Node types the registry can render, sorted for stable output. */\nexport function registeredTypes(registry: BlockRegistry): string[] {\n\treturn Object.keys(registry).sort();\n}\n","'use client';\n\nimport {\n\tcollectDefaultValues,\n\tcollectFieldConstraints,\n\tcollectFieldNames,\n\tvalidateField,\n\ttype UIAction,\n\ttype UIDocument,\n\ttype UINode,\n} from 'blocks-schema';\nimport { useCallback, useEffect, useMemo, useState } from 'react';\n\nimport { resolveNodeProps } from './bindings';\nimport { RendererProvider, useRenderer } from './context';\nimport { UnknownBlock } from './unknown-block';\nimport type { BlockRegistry, RenderMode, RendererContextValue } from './types';\n\n/**\n * Renders one node and, recursively, its children: resolve the node type in the\n * registry, resolve bindings against the current scope, render children first,\n * fall back to {@link UnknownBlock}.\n */\nexport function BlockRenderer({ node }: { node: UINode }) {\n\tconst { registry, scope } = useRenderer();\n\tconst Component = registry[node.type];\n\n\tif (!Component) {\n\t\treturn <UnknownBlock node={node} />;\n\t}\n\n\tconst children = node.children?.length\n\t\t? node.children.map((child) => <BlockRenderer key={child.key} node={child} />)\n\t\t: undefined;\n\n\treturn (\n\t\t<Component node={node} props={resolveNodeProps(node, scope)}>\n\t\t\t{children}\n\t\t</Component>\n\t);\n}\n\nexport interface DocumentRendererProps {\n\tdocument: UIDocument;\n\tregistry: BlockRegistry;\n\tinitialValues?: Record<string, unknown>;\n\t/** Extra data for binding expressions, e.g. `{ row, user, params }`. */\n\tscope?: Record<string, unknown>;\n\tonSubmit?: (values: Record<string, unknown>) => void;\n\tonChange?: (values: Record<string, unknown>) => void;\n\tonAction?: (action: UIAction, event: string) => void;\n\tmode?: RenderMode;\n\tclassName?: string;\n}\n\nexport function DocumentRenderer({\n\tdocument,\n\tregistry,\n\tinitialValues,\n\tscope: externalScope,\n\tonSubmit,\n\tonChange,\n\tonAction,\n\tmode = 'preview',\n\tclassName,\n}: DocumentRendererProps) {\n\tconst defaults = useMemo(() => collectDefaultValues(document.page), [document]);\n\tconst constraints = useMemo(() => collectFieldConstraints(document.page), [document]);\n\n\tconst [values, setValues] = useState<Record<string, unknown>>(() => ({ ...defaults, ...initialValues }));\n\tconst [errors, setErrors] = useState<Record<string, string>>({});\n\n\tuseEffect(() => {\n\t\tsetValues((previous) => ({ ...defaults, ...initialValues, ...previous }));\n\t}, [defaults, initialValues]);\n\n\tconst setError = useCallback((name: string, error: string | null) => {\n\t\tsetErrors((previous) => {\n\t\t\tif (error) return { ...previous, [name]: error };\n\t\t\tif (!(name in previous)) return previous;\n\t\t\tconst next = { ...previous };\n\t\t\tdelete next[name];\n\t\t\treturn next;\n\t\t});\n\t}, []);\n\n\tconst setValue = useCallback(\n\t\t(name: string, value: unknown) => {\n\t\t\tsetValues((previous) => {\n\t\t\t\tconst next = { ...previous, [name]: value };\n\t\t\t\tonChange?.(next);\n\t\t\t\treturn next;\n\t\t\t});\n\n\t\t\tconst field = constraints[name];\n\t\t\tif (field) {\n\t\t\t\tsetError(name, validateField(value, field.constraints, field.required));\n\t\t\t}\n\t\t},\n\t\t[onChange, constraints, setError],\n\t);\n\n\tconst handleAction = useCallback(\n\t\t(action: UIAction, event: string) => {\n\t\t\tif (event === 'submit' && onSubmit) {\n\t\t\t\tconst failures: Record<string, string> = {};\n\t\t\t\tfor (const name of collectFieldNames(document.page)) {\n\t\t\t\t\tconst field = constraints[name];\n\t\t\t\t\tif (!field) continue;\n\t\t\t\t\tconst error = validateField(values[name], field.constraints, field.required);\n\t\t\t\t\tif (error) failures[name] = error;\n\t\t\t\t}\n\n\t\t\t\tif (Object.keys(failures).length > 0) {\n\t\t\t\t\tsetErrors(failures);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tonSubmit(values);\n\t\t\t}\n\n\t\t\tonAction?.(action, event);\n\t\t},\n\t\t[onSubmit, onAction, values, document.page, constraints],\n\t);\n\n\tconst contextValue: RendererContextValue = useMemo(\n\t\t() => ({\n\t\t\tdocument,\n\t\t\tregistry,\n\t\t\tmode,\n\t\t\tvalues,\n\t\t\terrors,\n\t\t\tsetValue,\n\t\t\tsetError,\n\t\t\tscope: { ...externalScope, values, ...values },\n\t\t\tonAction: handleAction,\n\t\t}),\n\t\t[document, registry, mode, values, errors, setValue, setError, externalScope, handleAction],\n\t);\n\n\treturn (\n\t\t<RendererProvider value={contextValue}>\n\t\t\t<div className={className}>\n\t\t\t\t<BlockRenderer node={document.page} />\n\t\t\t</div>\n\t\t</RendererProvider>\n\t);\n}\n","'use client';\n\nimport type { UINode } from 'blocks-schema';\n\n/**\n * Rendered when no registry layer satisfies a node type. A document may name\n * blocks a given host has not installed, so an unknown type is a visible gap,\n * never a thrown render.\n */\nexport function UnknownBlock({ node }: { node: UINode }) {\n\treturn (\n\t\t<div data-block-unknown={node.type} role=\"note\">\n\t\t\tUnknown block: {node.type}\n\t\t</div>\n\t);\n}\n"],"mappings":";AAEA,IAAM,WAAW;AAGV,SAAS,SAAS,OAAgC,MAAuB;AAC/E,MAAI,UAAmB;AACvB,aAAW,WAAW,KAAK,MAAM,GAAG,GAAG;AACtC,QAAI,WAAW,QAAQ,OAAO,YAAY,SAAU,QAAO;AAC3D,cAAW,QAAoC,OAAO;AAAA,EACvD;AACA,SAAO;AACR;AAOO,SAAS,eAAe,YAAoB,OAAyC;AAC3F,QAAM,SAAS,WAAW,MAAM,2BAA2B;AAC3D,MAAI,QAAQ;AACX,WAAO,SAAS,OAAO,OAAO,CAAC,CAAC;AAAA,EACjC;AAEA,SAAO,WAAW,QAAQ,UAAU,CAAC,QAAQ,SAAiB;AAC7D,UAAM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