@reformer/renderer-json 8.0.0 → 9.0.0-beta.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.
- package/README.md +87 -0
- package/dist/converter/json-to-render-schema.test.d.ts +1 -0
- package/dist/index-Bu5XPCQ7.js +41 -0
- package/dist/index.js +102 -88
- package/dist/schema/form-schema.schema.json.d.ts +8 -5
- package/dist/schema/index.d.ts +7 -3
- package/dist/validate.js +665 -648
- package/llms.txt +1929 -0
- package/package.json +3 -2
- package/dist/index-BZLcW0SX.js +0 -42
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@reformer/renderer-json",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "9.0.0-beta.1",
|
|
4
4
|
"description": "JSON-based form renderer for @reformer ecosystem",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -53,7 +53,8 @@
|
|
|
53
53
|
"files": [
|
|
54
54
|
"dist",
|
|
55
55
|
"README.md",
|
|
56
|
-
"LICENSE"
|
|
56
|
+
"LICENSE",
|
|
57
|
+
"llms.txt"
|
|
57
58
|
],
|
|
58
59
|
"peerDependencies": {
|
|
59
60
|
"@reformer/core": ">=1.1.0",
|
package/dist/index-BZLcW0SX.js
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
const a = /^\$(model|component|dataSource)\((.+)\)$/;
|
|
2
|
-
function n(e) {
|
|
3
|
-
if (typeof e != "string") return null;
|
|
4
|
-
const t = a.exec(e);
|
|
5
|
-
return t ? { op: t[1], arg: t[2] } : null;
|
|
6
|
-
}
|
|
7
|
-
const y = (e) => n(e)?.op === "model", g = (e) => n(e)?.op === "component", S = (e) => n(e)?.op === "dataSource", s = "http://json-schema.org/draft-07/schema#", p = "https://reformer.dev/schemas/form-schema.schema.json", c = "ReFormer JSON form schema (M1, string-operator DSL)", m = "Base meta-schema: validates node structure + operator string syntax ($model/$component/$dataSource). Component-name enum is tightened per-app via buildFormSchemaMetaSchema; $dataSource names and $model paths are checked outside this schema.", d = "object", f = ["root"], l = !1, u = { $schema: { type: "string" }, version: { type: "string" }, root: { $ref: "#/definitions/node" } }, $ = { modelOp: { type: "string", pattern: "^\\$model\\(.+\\)$", description: 'Model binding: "$model(path)" — path resolved at runtime (not validated here).' }, componentOp: { type: "string", pattern: "^\\$component\\(.+\\)$", description: 'Registry component: "$component(Name)". Name is tightened to a registry enum by buildFormSchemaMetaSchema.' }, node: { oneOf: [{ $ref: "#/definitions/fieldNode" }, { $ref: "#/definitions/arrayNode" }, { $ref: "#/definitions/containerNode" }] }, fieldNode: { type: "object", required: ["value"], additionalProperties: !1, properties: { selector: { type: "string" }, value: { $ref: "#/definitions/modelOp" }, component: { $ref: "#/definitions/componentOp" }, componentProps: { type: "object" }, wrapper: { $ref: "#/definitions/node" } } }, arrayNode: { type: "object", required: ["array", "item"], additionalProperties: !1, properties: { selector: { type: "string" }, array: { $ref: "#/definitions/modelOp" }, item: { type: "object", required: ["$template"], additionalProperties: !1, properties: { $template: { $ref: "#/definitions/node" } } }, initialValue: { type: "object" }, componentProps: { type: "object" } } }, containerNode: { type: "object", required: ["component"], additionalProperties: !1, properties: { selector: { type: "string" }, component: { $ref: "#/definitions/componentOp" }, componentProps: { type: "object" }, children: { type: "array", items: { $ref: "#/definitions/node" } } } } }, r = {
|
|
8
|
-
$schema: s,
|
|
9
|
-
$id: p,
|
|
10
|
-
title: c,
|
|
11
|
-
description: m,
|
|
12
|
-
type: d,
|
|
13
|
-
required: f,
|
|
14
|
-
additionalProperties: l,
|
|
15
|
-
properties: u,
|
|
16
|
-
definitions: $
|
|
17
|
-
}, O = r;
|
|
18
|
-
function b(e) {
|
|
19
|
-
return e.names().filter((t) => e.get(t)?.type === "component");
|
|
20
|
-
}
|
|
21
|
-
function N(e) {
|
|
22
|
-
return e.names().filter((t) => e.get(t)?.type === "dataSource");
|
|
23
|
-
}
|
|
24
|
-
const h = (e) => e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
25
|
-
function j(e) {
|
|
26
|
-
const t = JSON.parse(JSON.stringify(r)), o = e?.componentNames;
|
|
27
|
-
if (o && o.length > 0) {
|
|
28
|
-
const i = o.map(h).join("|");
|
|
29
|
-
t.definitions.componentOp.pattern = `^\\$component\\((${i})\\)$`;
|
|
30
|
-
}
|
|
31
|
-
return t;
|
|
32
|
-
}
|
|
33
|
-
export {
|
|
34
|
-
g as a,
|
|
35
|
-
S as b,
|
|
36
|
-
j as c,
|
|
37
|
-
N as d,
|
|
38
|
-
O as f,
|
|
39
|
-
b as g,
|
|
40
|
-
y as i,
|
|
41
|
-
n as p
|
|
42
|
-
};
|