@formspec/build 0.1.0-alpha.2 → 0.1.0-alpha.20
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 +120 -0
- package/dist/__tests__/alias-chain-propagation.test.d.ts +9 -0
- package/dist/__tests__/alias-chain-propagation.test.d.ts.map +1 -0
- package/dist/__tests__/chain-dsl-canonicalizer.test.d.ts +2 -0
- package/dist/__tests__/chain-dsl-canonicalizer.test.d.ts.map +1 -0
- package/dist/__tests__/class-schema.test.d.ts +2 -0
- package/dist/__tests__/class-schema.test.d.ts.map +1 -0
- package/dist/__tests__/constraint-validator.test.d.ts +2 -0
- package/dist/__tests__/constraint-validator.test.d.ts.map +1 -0
- package/dist/__tests__/date-extension.integration.test.d.ts +2 -0
- package/dist/__tests__/date-extension.integration.test.d.ts.map +1 -0
- package/dist/__tests__/extension-api.test.d.ts +2 -0
- package/dist/__tests__/extension-api.test.d.ts.map +1 -0
- package/dist/__tests__/extension-runtime.integration.test.d.ts +2 -0
- package/dist/__tests__/extension-runtime.integration.test.d.ts.map +1 -0
- package/dist/__tests__/fixtures/alias-chains.d.ts +37 -0
- package/dist/__tests__/fixtures/alias-chains.d.ts.map +1 -0
- package/dist/__tests__/fixtures/class-schema-regressions.d.ts +87 -0
- package/dist/__tests__/fixtures/class-schema-regressions.d.ts.map +1 -0
- package/dist/__tests__/fixtures/edge-cases.d.ts +132 -0
- package/dist/__tests__/fixtures/edge-cases.d.ts.map +1 -0
- package/dist/__tests__/fixtures/example-a-builtins.d.ts +30 -0
- package/dist/__tests__/fixtures/example-a-builtins.d.ts.map +1 -0
- package/dist/__tests__/fixtures/example-date-extension.d.ts +12 -0
- package/dist/__tests__/fixtures/example-date-extension.d.ts.map +1 -0
- package/dist/__tests__/fixtures/example-interface-types.d.ts +102 -0
- package/dist/__tests__/fixtures/example-interface-types.d.ts.map +1 -0
- package/dist/__tests__/fixtures/example-numeric-extension.d.ts +20 -0
- package/dist/__tests__/fixtures/example-numeric-extension.d.ts.map +1 -0
- package/dist/__tests__/fixtures/extension-forms.d.ts +7 -0
- package/dist/__tests__/fixtures/extension-forms.d.ts.map +1 -0
- package/dist/__tests__/fixtures/mixed-authoring-shipping-address.d.ts +31 -0
- package/dist/__tests__/fixtures/mixed-authoring-shipping-address.d.ts.map +1 -0
- package/dist/__tests__/fixtures/named-primitive-aliases.d.ts +15 -0
- package/dist/__tests__/fixtures/named-primitive-aliases.d.ts.map +1 -0
- package/dist/__tests__/fixtures/nested-array-path-constraints.d.ts +14 -0
- package/dist/__tests__/fixtures/nested-array-path-constraints.d.ts.map +1 -0
- package/dist/__tests__/fixtures/sample-forms.d.ts +65 -0
- package/dist/__tests__/fixtures/sample-forms.d.ts.map +1 -0
- package/dist/__tests__/generate-schemas.test.d.ts +2 -0
- package/dist/__tests__/generate-schemas.test.d.ts.map +1 -0
- package/dist/__tests__/guards.test.d.ts +2 -0
- package/dist/__tests__/guards.test.d.ts.map +1 -0
- package/dist/__tests__/ir-analyzer.test.d.ts +11 -0
- package/dist/__tests__/ir-analyzer.test.d.ts.map +1 -0
- package/dist/__tests__/ir-jsdoc-constraints.test.d.ts +12 -0
- package/dist/__tests__/ir-jsdoc-constraints.test.d.ts.map +1 -0
- package/dist/__tests__/ir-json-schema-generator.test.d.ts +11 -0
- package/dist/__tests__/ir-json-schema-generator.test.d.ts.map +1 -0
- package/dist/__tests__/ir-ui-schema-generator.test.d.ts +2 -0
- package/dist/__tests__/ir-ui-schema-generator.test.d.ts.map +1 -0
- package/dist/__tests__/mixed-authoring.test.d.ts +2 -0
- package/dist/__tests__/mixed-authoring.test.d.ts.map +1 -0
- package/dist/__tests__/numeric-extension.integration.test.d.ts +2 -0
- package/dist/__tests__/numeric-extension.integration.test.d.ts.map +1 -0
- package/dist/__tests__/parity/fixtures/address/chain-dsl.d.ts +9 -0
- package/dist/__tests__/parity/fixtures/address/chain-dsl.d.ts.map +1 -0
- package/dist/__tests__/parity/fixtures/address/expected-ir.d.ts +9 -0
- package/dist/__tests__/parity/fixtures/address/expected-ir.d.ts.map +1 -0
- package/dist/__tests__/parity/fixtures/address/tsdoc.d.ts +19 -0
- package/dist/__tests__/parity/fixtures/address/tsdoc.d.ts.map +1 -0
- package/dist/__tests__/parity/fixtures/plan-status/chain-dsl.d.ts +19 -0
- package/dist/__tests__/parity/fixtures/plan-status/chain-dsl.d.ts.map +1 -0
- package/dist/__tests__/parity/fixtures/plan-status/expected-ir.d.ts +6 -0
- package/dist/__tests__/parity/fixtures/plan-status/expected-ir.d.ts.map +1 -0
- package/dist/__tests__/parity/fixtures/plan-status/tsdoc.d.ts +17 -0
- package/dist/__tests__/parity/fixtures/plan-status/tsdoc.d.ts.map +1 -0
- package/dist/__tests__/parity/fixtures/product-config/chain-dsl.d.ts +13 -0
- package/dist/__tests__/parity/fixtures/product-config/chain-dsl.d.ts.map +1 -0
- package/dist/__tests__/parity/fixtures/product-config/expected-ir.d.ts +9 -0
- package/dist/__tests__/parity/fixtures/product-config/expected-ir.d.ts.map +1 -0
- package/dist/__tests__/parity/fixtures/product-config/tsdoc.d.ts +28 -0
- package/dist/__tests__/parity/fixtures/product-config/tsdoc.d.ts.map +1 -0
- package/dist/__tests__/parity/fixtures/usd-cents/chain-dsl.d.ts +9 -0
- package/dist/__tests__/parity/fixtures/usd-cents/chain-dsl.d.ts.map +1 -0
- package/dist/__tests__/parity/fixtures/usd-cents/expected-ir.d.ts +6 -0
- package/dist/__tests__/parity/fixtures/usd-cents/expected-ir.d.ts.map +1 -0
- package/dist/__tests__/parity/fixtures/usd-cents/tsdoc.d.ts +19 -0
- package/dist/__tests__/parity/fixtures/usd-cents/tsdoc.d.ts.map +1 -0
- package/dist/__tests__/parity/fixtures/user-registration/chain-dsl.d.ts +12 -0
- package/dist/__tests__/parity/fixtures/user-registration/chain-dsl.d.ts.map +1 -0
- package/dist/__tests__/parity/fixtures/user-registration/expected-ir.d.ts +9 -0
- package/dist/__tests__/parity/fixtures/user-registration/expected-ir.d.ts.map +1 -0
- package/dist/__tests__/parity/fixtures/user-registration/tsdoc.d.ts +19 -0
- package/dist/__tests__/parity/fixtures/user-registration/tsdoc.d.ts.map +1 -0
- package/dist/__tests__/parity/parity.test.d.ts +18 -0
- package/dist/__tests__/parity/parity.test.d.ts.map +1 -0
- package/dist/__tests__/parity/utils.d.ts +151 -0
- package/dist/__tests__/parity/utils.d.ts.map +1 -0
- package/dist/__tests__/path-target-parser.test.d.ts +9 -0
- package/dist/__tests__/path-target-parser.test.d.ts.map +1 -0
- package/dist/analyzer/class-analyzer.d.ts +100 -0
- package/dist/analyzer/class-analyzer.d.ts.map +1 -0
- package/dist/analyzer/jsdoc-constraints.d.ts +53 -0
- package/dist/analyzer/jsdoc-constraints.d.ts.map +1 -0
- package/dist/analyzer/program.d.ts +68 -0
- package/dist/analyzer/program.d.ts.map +1 -0
- package/dist/analyzer/tsdoc-parser.d.ts +122 -0
- package/dist/analyzer/tsdoc-parser.d.ts.map +1 -0
- package/dist/browser.cjs +1291 -0
- package/dist/browser.cjs.map +1 -0
- package/dist/browser.d.ts +73 -0
- package/dist/browser.d.ts.map +1 -0
- package/dist/browser.js +1242 -0
- package/dist/browser.js.map +1 -0
- package/dist/build.d.ts +996 -0
- package/dist/canonicalize/chain-dsl-canonicalizer.d.ts +18 -0
- package/dist/canonicalize/chain-dsl-canonicalizer.d.ts.map +1 -0
- package/dist/canonicalize/index.d.ts +8 -0
- package/dist/canonicalize/index.d.ts.map +1 -0
- package/dist/canonicalize/tsdoc-canonicalizer.d.ts +34 -0
- package/dist/canonicalize/tsdoc-canonicalizer.d.ts.map +1 -0
- package/dist/cli.cjs +3862 -0
- package/dist/cli.cjs.map +1 -0
- package/dist/cli.js +3826 -103
- package/dist/cli.js.map +1 -1
- package/dist/extensions/index.d.ts +8 -0
- package/dist/extensions/index.d.ts.map +1 -0
- package/dist/extensions/registry.d.ts +79 -0
- package/dist/extensions/registry.d.ts.map +1 -0
- package/dist/generators/class-schema.d.ts +99 -0
- package/dist/generators/class-schema.d.ts.map +1 -0
- package/dist/generators/method-schema.d.ts +65 -0
- package/dist/generators/method-schema.d.ts.map +1 -0
- package/dist/generators/mixed-authoring.d.ts +45 -0
- package/dist/generators/mixed-authoring.d.ts.map +1 -0
- package/dist/index.cjs +3627 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +33 -8
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3587 -106
- package/dist/index.js.map +1 -1
- package/dist/internals.cjs +3371 -0
- package/dist/internals.cjs.map +1 -0
- package/dist/internals.d.ts +30 -0
- package/dist/internals.d.ts.map +1 -0
- package/dist/internals.js +3345 -0
- package/dist/internals.js.map +1 -0
- package/dist/json-schema/generator.d.ts +16 -5
- package/dist/json-schema/generator.d.ts.map +1 -1
- package/dist/json-schema/ir-generator.d.ts +108 -0
- package/dist/json-schema/ir-generator.d.ts.map +1 -0
- package/dist/json-schema/schema.d.ts +16 -0
- package/dist/json-schema/schema.d.ts.map +1 -0
- package/dist/json-schema/types.d.ts +29 -2
- package/dist/json-schema/types.d.ts.map +1 -1
- package/dist/ui-schema/generator.d.ts +5 -0
- package/dist/ui-schema/generator.d.ts.map +1 -1
- package/dist/ui-schema/ir-generator.d.ts +53 -0
- package/dist/ui-schema/ir-generator.d.ts.map +1 -0
- package/dist/ui-schema/schema.d.ts +357 -0
- package/dist/ui-schema/schema.d.ts.map +1 -0
- package/dist/ui-schema/types.d.ts +8 -73
- package/dist/ui-schema/types.d.ts.map +1 -1
- package/dist/validate/constraint-validator.d.ts +23 -0
- package/dist/validate/constraint-validator.d.ts.map +1 -0
- package/dist/validate/index.d.ts +9 -0
- package/dist/validate/index.d.ts.map +1 -0
- package/package.json +27 -7
- package/dist/__tests__/cli.test.js +0 -178
- package/dist/__tests__/cli.test.js.map +0 -1
- package/dist/__tests__/edge-cases.test.js +0 -217
- package/dist/__tests__/edge-cases.test.js.map +0 -1
- package/dist/__tests__/generator.test.js +0 -225
- package/dist/__tests__/generator.test.js.map +0 -1
- package/dist/__tests__/integration.test.js +0 -163
- package/dist/__tests__/integration.test.js.map +0 -1
- package/dist/__tests__/write-schemas.test.js +0 -196
- package/dist/__tests__/write-schemas.test.js.map +0 -1
- package/dist/json-schema/generator.js +0 -161
- package/dist/json-schema/generator.js.map +0 -1
- package/dist/json-schema/types.js +0 -7
- package/dist/json-schema/types.js.map +0 -1
- package/dist/ui-schema/generator.js +0 -150
- package/dist/ui-schema/generator.js.map +0 -1
- package/dist/ui-schema/types.js +0 -8
- package/dist/ui-schema/types.js.map +0 -1
|
@@ -0,0 +1,357 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Zod schemas for JSON Forms UI Schema.
|
|
3
|
+
*
|
|
4
|
+
* These schemas are the source of truth for UI Schema validation.
|
|
5
|
+
* TypeScript types are derived from these schemas via `z.infer<>`.
|
|
6
|
+
*
|
|
7
|
+
* @see https://jsonforms.io/docs/uischema/
|
|
8
|
+
*/
|
|
9
|
+
import { z } from "zod";
|
|
10
|
+
/**
|
|
11
|
+
* Zod schema for rule effect values.
|
|
12
|
+
*/
|
|
13
|
+
export declare const ruleEffectSchema: z.ZodEnum<["SHOW", "HIDE", "ENABLE", "DISABLE"]>;
|
|
14
|
+
/**
|
|
15
|
+
* Rule effect types for conditional visibility.
|
|
16
|
+
*/
|
|
17
|
+
export type RuleEffect = z.infer<typeof ruleEffectSchema>;
|
|
18
|
+
/**
|
|
19
|
+
* Zod schema for UI Schema element type strings.
|
|
20
|
+
*/
|
|
21
|
+
export declare const uiSchemaElementTypeSchema: z.ZodEnum<["Control", "VerticalLayout", "HorizontalLayout", "Group", "Categorization", "Category", "Label"]>;
|
|
22
|
+
/**
|
|
23
|
+
* UI Schema element types.
|
|
24
|
+
*/
|
|
25
|
+
export type UISchemaElementType = z.infer<typeof uiSchemaElementTypeSchema>;
|
|
26
|
+
/**
|
|
27
|
+
* JSON Schema subset used in rule conditions.
|
|
28
|
+
*/
|
|
29
|
+
export interface RuleConditionSchema {
|
|
30
|
+
const?: unknown;
|
|
31
|
+
enum?: readonly unknown[];
|
|
32
|
+
type?: string;
|
|
33
|
+
not?: RuleConditionSchema;
|
|
34
|
+
minimum?: number;
|
|
35
|
+
maximum?: number;
|
|
36
|
+
exclusiveMinimum?: number;
|
|
37
|
+
exclusiveMaximum?: number;
|
|
38
|
+
minLength?: number;
|
|
39
|
+
properties?: Record<string, RuleConditionSchema>;
|
|
40
|
+
required?: string[];
|
|
41
|
+
allOf?: RuleConditionSchema[];
|
|
42
|
+
}
|
|
43
|
+
export declare const ruleConditionSchema: z.ZodType<RuleConditionSchema>;
|
|
44
|
+
/**
|
|
45
|
+
* Zod schema for a schema-based rule condition.
|
|
46
|
+
*/
|
|
47
|
+
export declare const schemaBasedConditionSchema: z.ZodObject<{
|
|
48
|
+
scope: z.ZodString;
|
|
49
|
+
schema: z.ZodType<RuleConditionSchema, z.ZodTypeDef, RuleConditionSchema>;
|
|
50
|
+
}, "strict", z.ZodTypeAny, {
|
|
51
|
+
schema: RuleConditionSchema;
|
|
52
|
+
scope: string;
|
|
53
|
+
}, {
|
|
54
|
+
schema: RuleConditionSchema;
|
|
55
|
+
scope: string;
|
|
56
|
+
}>;
|
|
57
|
+
/**
|
|
58
|
+
* Condition for a rule.
|
|
59
|
+
*/
|
|
60
|
+
export type SchemaBasedCondition = z.infer<typeof schemaBasedConditionSchema>;
|
|
61
|
+
/**
|
|
62
|
+
* Zod schema for a UI Schema rule.
|
|
63
|
+
*/
|
|
64
|
+
export declare const ruleSchema: z.ZodObject<{
|
|
65
|
+
effect: z.ZodEnum<["SHOW", "HIDE", "ENABLE", "DISABLE"]>;
|
|
66
|
+
condition: z.ZodObject<{
|
|
67
|
+
scope: z.ZodString;
|
|
68
|
+
schema: z.ZodType<RuleConditionSchema, z.ZodTypeDef, RuleConditionSchema>;
|
|
69
|
+
}, "strict", z.ZodTypeAny, {
|
|
70
|
+
schema: RuleConditionSchema;
|
|
71
|
+
scope: string;
|
|
72
|
+
}, {
|
|
73
|
+
schema: RuleConditionSchema;
|
|
74
|
+
scope: string;
|
|
75
|
+
}>;
|
|
76
|
+
}, "strict", z.ZodTypeAny, {
|
|
77
|
+
condition: {
|
|
78
|
+
schema: RuleConditionSchema;
|
|
79
|
+
scope: string;
|
|
80
|
+
};
|
|
81
|
+
effect: "SHOW" | "HIDE" | "ENABLE" | "DISABLE";
|
|
82
|
+
}, {
|
|
83
|
+
condition: {
|
|
84
|
+
schema: RuleConditionSchema;
|
|
85
|
+
scope: string;
|
|
86
|
+
};
|
|
87
|
+
effect: "SHOW" | "HIDE" | "ENABLE" | "DISABLE";
|
|
88
|
+
}>;
|
|
89
|
+
/**
|
|
90
|
+
* Rule for conditional element visibility/enablement.
|
|
91
|
+
*/
|
|
92
|
+
export type Rule = z.infer<typeof ruleSchema>;
|
|
93
|
+
/**
|
|
94
|
+
* Union of all UI Schema element types.
|
|
95
|
+
*/
|
|
96
|
+
export type UISchemaElement = ControlElement | VerticalLayout | HorizontalLayout | GroupLayout | Categorization | Category | LabelElement;
|
|
97
|
+
export declare const uiSchemaElementSchema: z.ZodType<UISchemaElement>;
|
|
98
|
+
/**
|
|
99
|
+
* Zod schema for a Control element.
|
|
100
|
+
*/
|
|
101
|
+
export declare const controlSchema: z.ZodObject<{
|
|
102
|
+
type: z.ZodLiteral<"Control">;
|
|
103
|
+
scope: z.ZodString;
|
|
104
|
+
label: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodLiteral<false>]>>;
|
|
105
|
+
rule: z.ZodOptional<z.ZodObject<{
|
|
106
|
+
effect: z.ZodEnum<["SHOW", "HIDE", "ENABLE", "DISABLE"]>;
|
|
107
|
+
condition: z.ZodObject<{
|
|
108
|
+
scope: z.ZodString;
|
|
109
|
+
schema: z.ZodType<RuleConditionSchema, z.ZodTypeDef, RuleConditionSchema>;
|
|
110
|
+
}, "strict", z.ZodTypeAny, {
|
|
111
|
+
schema: RuleConditionSchema;
|
|
112
|
+
scope: string;
|
|
113
|
+
}, {
|
|
114
|
+
schema: RuleConditionSchema;
|
|
115
|
+
scope: string;
|
|
116
|
+
}>;
|
|
117
|
+
}, "strict", z.ZodTypeAny, {
|
|
118
|
+
condition: {
|
|
119
|
+
schema: RuleConditionSchema;
|
|
120
|
+
scope: string;
|
|
121
|
+
};
|
|
122
|
+
effect: "SHOW" | "HIDE" | "ENABLE" | "DISABLE";
|
|
123
|
+
}, {
|
|
124
|
+
condition: {
|
|
125
|
+
schema: RuleConditionSchema;
|
|
126
|
+
scope: string;
|
|
127
|
+
};
|
|
128
|
+
effect: "SHOW" | "HIDE" | "ENABLE" | "DISABLE";
|
|
129
|
+
}>>;
|
|
130
|
+
options: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
131
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
132
|
+
type: z.ZodLiteral<"Control">;
|
|
133
|
+
scope: z.ZodString;
|
|
134
|
+
label: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodLiteral<false>]>>;
|
|
135
|
+
rule: z.ZodOptional<z.ZodObject<{
|
|
136
|
+
effect: z.ZodEnum<["SHOW", "HIDE", "ENABLE", "DISABLE"]>;
|
|
137
|
+
condition: z.ZodObject<{
|
|
138
|
+
scope: z.ZodString;
|
|
139
|
+
schema: z.ZodType<RuleConditionSchema, z.ZodTypeDef, RuleConditionSchema>;
|
|
140
|
+
}, "strict", z.ZodTypeAny, {
|
|
141
|
+
schema: RuleConditionSchema;
|
|
142
|
+
scope: string;
|
|
143
|
+
}, {
|
|
144
|
+
schema: RuleConditionSchema;
|
|
145
|
+
scope: string;
|
|
146
|
+
}>;
|
|
147
|
+
}, "strict", z.ZodTypeAny, {
|
|
148
|
+
condition: {
|
|
149
|
+
schema: RuleConditionSchema;
|
|
150
|
+
scope: string;
|
|
151
|
+
};
|
|
152
|
+
effect: "SHOW" | "HIDE" | "ENABLE" | "DISABLE";
|
|
153
|
+
}, {
|
|
154
|
+
condition: {
|
|
155
|
+
schema: RuleConditionSchema;
|
|
156
|
+
scope: string;
|
|
157
|
+
};
|
|
158
|
+
effect: "SHOW" | "HIDE" | "ENABLE" | "DISABLE";
|
|
159
|
+
}>>;
|
|
160
|
+
options: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
161
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
162
|
+
type: z.ZodLiteral<"Control">;
|
|
163
|
+
scope: z.ZodString;
|
|
164
|
+
label: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodLiteral<false>]>>;
|
|
165
|
+
rule: z.ZodOptional<z.ZodObject<{
|
|
166
|
+
effect: z.ZodEnum<["SHOW", "HIDE", "ENABLE", "DISABLE"]>;
|
|
167
|
+
condition: z.ZodObject<{
|
|
168
|
+
scope: z.ZodString;
|
|
169
|
+
schema: z.ZodType<RuleConditionSchema, z.ZodTypeDef, RuleConditionSchema>;
|
|
170
|
+
}, "strict", z.ZodTypeAny, {
|
|
171
|
+
schema: RuleConditionSchema;
|
|
172
|
+
scope: string;
|
|
173
|
+
}, {
|
|
174
|
+
schema: RuleConditionSchema;
|
|
175
|
+
scope: string;
|
|
176
|
+
}>;
|
|
177
|
+
}, "strict", z.ZodTypeAny, {
|
|
178
|
+
condition: {
|
|
179
|
+
schema: RuleConditionSchema;
|
|
180
|
+
scope: string;
|
|
181
|
+
};
|
|
182
|
+
effect: "SHOW" | "HIDE" | "ENABLE" | "DISABLE";
|
|
183
|
+
}, {
|
|
184
|
+
condition: {
|
|
185
|
+
schema: RuleConditionSchema;
|
|
186
|
+
scope: string;
|
|
187
|
+
};
|
|
188
|
+
effect: "SHOW" | "HIDE" | "ENABLE" | "DISABLE";
|
|
189
|
+
}>>;
|
|
190
|
+
options: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
191
|
+
}, z.ZodTypeAny, "passthrough">>;
|
|
192
|
+
/**
|
|
193
|
+
* A Control element that binds to a JSON Schema property.
|
|
194
|
+
*/
|
|
195
|
+
export type ControlElement = z.infer<typeof controlSchema>;
|
|
196
|
+
/**
|
|
197
|
+
* A vertical layout element.
|
|
198
|
+
*/
|
|
199
|
+
export interface VerticalLayout {
|
|
200
|
+
type: "VerticalLayout";
|
|
201
|
+
elements: UISchemaElement[];
|
|
202
|
+
rule?: Rule | undefined;
|
|
203
|
+
options?: Record<string, unknown> | undefined;
|
|
204
|
+
[k: string]: unknown;
|
|
205
|
+
}
|
|
206
|
+
export declare const verticalLayoutSchema: z.ZodType<VerticalLayout>;
|
|
207
|
+
/**
|
|
208
|
+
* A horizontal layout element.
|
|
209
|
+
*/
|
|
210
|
+
export interface HorizontalLayout {
|
|
211
|
+
type: "HorizontalLayout";
|
|
212
|
+
elements: UISchemaElement[];
|
|
213
|
+
rule?: Rule | undefined;
|
|
214
|
+
options?: Record<string, unknown> | undefined;
|
|
215
|
+
[k: string]: unknown;
|
|
216
|
+
}
|
|
217
|
+
export declare const horizontalLayoutSchema: z.ZodType<HorizontalLayout>;
|
|
218
|
+
/**
|
|
219
|
+
* A group element with a label.
|
|
220
|
+
*/
|
|
221
|
+
export interface GroupLayout {
|
|
222
|
+
type: "Group";
|
|
223
|
+
label: string;
|
|
224
|
+
elements: UISchemaElement[];
|
|
225
|
+
rule?: Rule | undefined;
|
|
226
|
+
options?: Record<string, unknown> | undefined;
|
|
227
|
+
[k: string]: unknown;
|
|
228
|
+
}
|
|
229
|
+
export declare const groupLayoutSchema: z.ZodType<GroupLayout>;
|
|
230
|
+
/**
|
|
231
|
+
* A Category element, used inside a Categorization layout.
|
|
232
|
+
*/
|
|
233
|
+
export interface Category {
|
|
234
|
+
type: "Category";
|
|
235
|
+
label: string;
|
|
236
|
+
elements: UISchemaElement[];
|
|
237
|
+
rule?: Rule | undefined;
|
|
238
|
+
options?: Record<string, unknown> | undefined;
|
|
239
|
+
[k: string]: unknown;
|
|
240
|
+
}
|
|
241
|
+
export declare const categorySchema: z.ZodType<Category>;
|
|
242
|
+
/**
|
|
243
|
+
* A Categorization element (tab-based layout).
|
|
244
|
+
*/
|
|
245
|
+
export interface Categorization {
|
|
246
|
+
type: "Categorization";
|
|
247
|
+
elements: Category[];
|
|
248
|
+
label?: string | undefined;
|
|
249
|
+
rule?: Rule | undefined;
|
|
250
|
+
options?: Record<string, unknown> | undefined;
|
|
251
|
+
[k: string]: unknown;
|
|
252
|
+
}
|
|
253
|
+
export declare const categorizationSchema: z.ZodType<Categorization>;
|
|
254
|
+
/**
|
|
255
|
+
* Zod schema for a Label element.
|
|
256
|
+
*/
|
|
257
|
+
export declare const labelElementSchema: z.ZodObject<{
|
|
258
|
+
type: z.ZodLiteral<"Label">;
|
|
259
|
+
text: z.ZodString;
|
|
260
|
+
rule: z.ZodOptional<z.ZodObject<{
|
|
261
|
+
effect: z.ZodEnum<["SHOW", "HIDE", "ENABLE", "DISABLE"]>;
|
|
262
|
+
condition: z.ZodObject<{
|
|
263
|
+
scope: z.ZodString;
|
|
264
|
+
schema: z.ZodType<RuleConditionSchema, z.ZodTypeDef, RuleConditionSchema>;
|
|
265
|
+
}, "strict", z.ZodTypeAny, {
|
|
266
|
+
schema: RuleConditionSchema;
|
|
267
|
+
scope: string;
|
|
268
|
+
}, {
|
|
269
|
+
schema: RuleConditionSchema;
|
|
270
|
+
scope: string;
|
|
271
|
+
}>;
|
|
272
|
+
}, "strict", z.ZodTypeAny, {
|
|
273
|
+
condition: {
|
|
274
|
+
schema: RuleConditionSchema;
|
|
275
|
+
scope: string;
|
|
276
|
+
};
|
|
277
|
+
effect: "SHOW" | "HIDE" | "ENABLE" | "DISABLE";
|
|
278
|
+
}, {
|
|
279
|
+
condition: {
|
|
280
|
+
schema: RuleConditionSchema;
|
|
281
|
+
scope: string;
|
|
282
|
+
};
|
|
283
|
+
effect: "SHOW" | "HIDE" | "ENABLE" | "DISABLE";
|
|
284
|
+
}>>;
|
|
285
|
+
options: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
286
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
287
|
+
type: z.ZodLiteral<"Label">;
|
|
288
|
+
text: z.ZodString;
|
|
289
|
+
rule: z.ZodOptional<z.ZodObject<{
|
|
290
|
+
effect: z.ZodEnum<["SHOW", "HIDE", "ENABLE", "DISABLE"]>;
|
|
291
|
+
condition: z.ZodObject<{
|
|
292
|
+
scope: z.ZodString;
|
|
293
|
+
schema: z.ZodType<RuleConditionSchema, z.ZodTypeDef, RuleConditionSchema>;
|
|
294
|
+
}, "strict", z.ZodTypeAny, {
|
|
295
|
+
schema: RuleConditionSchema;
|
|
296
|
+
scope: string;
|
|
297
|
+
}, {
|
|
298
|
+
schema: RuleConditionSchema;
|
|
299
|
+
scope: string;
|
|
300
|
+
}>;
|
|
301
|
+
}, "strict", z.ZodTypeAny, {
|
|
302
|
+
condition: {
|
|
303
|
+
schema: RuleConditionSchema;
|
|
304
|
+
scope: string;
|
|
305
|
+
};
|
|
306
|
+
effect: "SHOW" | "HIDE" | "ENABLE" | "DISABLE";
|
|
307
|
+
}, {
|
|
308
|
+
condition: {
|
|
309
|
+
schema: RuleConditionSchema;
|
|
310
|
+
scope: string;
|
|
311
|
+
};
|
|
312
|
+
effect: "SHOW" | "HIDE" | "ENABLE" | "DISABLE";
|
|
313
|
+
}>>;
|
|
314
|
+
options: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
315
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
316
|
+
type: z.ZodLiteral<"Label">;
|
|
317
|
+
text: z.ZodString;
|
|
318
|
+
rule: z.ZodOptional<z.ZodObject<{
|
|
319
|
+
effect: z.ZodEnum<["SHOW", "HIDE", "ENABLE", "DISABLE"]>;
|
|
320
|
+
condition: z.ZodObject<{
|
|
321
|
+
scope: z.ZodString;
|
|
322
|
+
schema: z.ZodType<RuleConditionSchema, z.ZodTypeDef, RuleConditionSchema>;
|
|
323
|
+
}, "strict", z.ZodTypeAny, {
|
|
324
|
+
schema: RuleConditionSchema;
|
|
325
|
+
scope: string;
|
|
326
|
+
}, {
|
|
327
|
+
schema: RuleConditionSchema;
|
|
328
|
+
scope: string;
|
|
329
|
+
}>;
|
|
330
|
+
}, "strict", z.ZodTypeAny, {
|
|
331
|
+
condition: {
|
|
332
|
+
schema: RuleConditionSchema;
|
|
333
|
+
scope: string;
|
|
334
|
+
};
|
|
335
|
+
effect: "SHOW" | "HIDE" | "ENABLE" | "DISABLE";
|
|
336
|
+
}, {
|
|
337
|
+
condition: {
|
|
338
|
+
schema: RuleConditionSchema;
|
|
339
|
+
scope: string;
|
|
340
|
+
};
|
|
341
|
+
effect: "SHOW" | "HIDE" | "ENABLE" | "DISABLE";
|
|
342
|
+
}>>;
|
|
343
|
+
options: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
344
|
+
}, z.ZodTypeAny, "passthrough">>;
|
|
345
|
+
/**
|
|
346
|
+
* A Label element for displaying static text.
|
|
347
|
+
*/
|
|
348
|
+
export type LabelElement = z.infer<typeof labelElementSchema>;
|
|
349
|
+
/**
|
|
350
|
+
* Root UI Schema (always a layout — not a Control, Category, or Label).
|
|
351
|
+
*/
|
|
352
|
+
export type UISchema = VerticalLayout | HorizontalLayout | GroupLayout | Categorization;
|
|
353
|
+
/**
|
|
354
|
+
* Zod schema for the root UI Schema (layout types only).
|
|
355
|
+
*/
|
|
356
|
+
export declare const uiSchema: z.ZodType<UISchema>;
|
|
357
|
+
//# sourceMappingURL=schema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../src/ui-schema/schema.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAaxB;;GAEG;AACH,eAAO,MAAM,gBAAgB,kDAAgD,CAAC;AAE9E;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CA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CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAM9D;;GAEG;AACH,MAAM,MAAM,QAAQ,GAAG,cAAc,GAAG,gBAAgB,GAAG,WAAW,GAAG,cAAc,CAAC;AAExF;;GAEG;AACH,eAAO,MAAM,QAAQ,EAAE,CAAC,CAAC,OAAO,CAAC,QAAQ,CAEjB,CAAC"}
|
|
@@ -1,87 +1,22 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* JSON Forms UI Schema type definitions.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
4
|
+
* Types are derived from Zod schemas in ./schema.ts.
|
|
5
5
|
* See: https://jsonforms.io/docs/uischema/
|
|
6
6
|
*/
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
*/
|
|
10
|
-
export type UISchemaElementType = "Control" | "VerticalLayout" | "HorizontalLayout" | "Group" | "Categorization" | "Category";
|
|
11
|
-
/**
|
|
12
|
-
* Rule effect types for conditional visibility.
|
|
13
|
-
*/
|
|
14
|
-
export type RuleEffect = "SHOW" | "HIDE" | "ENABLE" | "DISABLE";
|
|
15
|
-
/**
|
|
16
|
-
* JSON Schema subset for rule conditions.
|
|
17
|
-
*/
|
|
18
|
-
export interface RuleConditionSchema {
|
|
19
|
-
const?: unknown;
|
|
20
|
-
enum?: readonly unknown[];
|
|
21
|
-
type?: string;
|
|
22
|
-
minimum?: number;
|
|
23
|
-
maximum?: number;
|
|
24
|
-
properties?: Record<string, RuleConditionSchema>;
|
|
25
|
-
allOf?: RuleConditionSchema[];
|
|
26
|
-
}
|
|
27
|
-
/**
|
|
28
|
-
* Condition for a rule.
|
|
29
|
-
*/
|
|
30
|
-
export interface SchemaBasedCondition {
|
|
31
|
-
scope: string;
|
|
32
|
-
schema: RuleConditionSchema;
|
|
33
|
-
}
|
|
34
|
-
/**
|
|
35
|
-
* Rule for conditional element visibility/enablement.
|
|
36
|
-
*/
|
|
37
|
-
export interface Rule {
|
|
38
|
-
effect: RuleEffect;
|
|
39
|
-
condition: SchemaBasedCondition;
|
|
40
|
-
}
|
|
7
|
+
export type { RuleConditionSchema, SchemaBasedCondition, Rule, RuleEffect, ControlElement, VerticalLayout, HorizontalLayout, GroupLayout, Categorization, Category, LabelElement, UISchemaElement, UISchemaElementType, UISchema, } from "./schema.js";
|
|
8
|
+
import type { Rule, UISchemaElementType } from "./schema.js";
|
|
41
9
|
/**
|
|
42
10
|
* Base interface for all UI Schema elements.
|
|
11
|
+
*
|
|
12
|
+
* This is a manually maintained interface representing the common shape
|
|
13
|
+
* shared by all element types. It is kept as an interface (rather than
|
|
14
|
+
* derived from Zod) because it is the base of a discriminated union, not
|
|
15
|
+
* a union member itself.
|
|
43
16
|
*/
|
|
44
17
|
export interface UISchemaElementBase {
|
|
45
18
|
type: UISchemaElementType;
|
|
46
19
|
rule?: Rule;
|
|
47
20
|
options?: Record<string, unknown>;
|
|
48
21
|
}
|
|
49
|
-
/**
|
|
50
|
-
* A Control element that binds to a JSON Schema property.
|
|
51
|
-
*/
|
|
52
|
-
export interface ControlElement extends UISchemaElementBase {
|
|
53
|
-
type: "Control";
|
|
54
|
-
scope: string;
|
|
55
|
-
label?: string;
|
|
56
|
-
}
|
|
57
|
-
/**
|
|
58
|
-
* A vertical layout element.
|
|
59
|
-
*/
|
|
60
|
-
export interface VerticalLayout extends UISchemaElementBase {
|
|
61
|
-
type: "VerticalLayout";
|
|
62
|
-
elements: UISchemaElement[];
|
|
63
|
-
}
|
|
64
|
-
/**
|
|
65
|
-
* A horizontal layout element.
|
|
66
|
-
*/
|
|
67
|
-
export interface HorizontalLayout extends UISchemaElementBase {
|
|
68
|
-
type: "HorizontalLayout";
|
|
69
|
-
elements: UISchemaElement[];
|
|
70
|
-
}
|
|
71
|
-
/**
|
|
72
|
-
* A group element with a label.
|
|
73
|
-
*/
|
|
74
|
-
export interface GroupLayout extends UISchemaElementBase {
|
|
75
|
-
type: "Group";
|
|
76
|
-
label: string;
|
|
77
|
-
elements: UISchemaElement[];
|
|
78
|
-
}
|
|
79
|
-
/**
|
|
80
|
-
* Union of all UI Schema element types.
|
|
81
|
-
*/
|
|
82
|
-
export type UISchemaElement = ControlElement | VerticalLayout | HorizontalLayout | GroupLayout;
|
|
83
|
-
/**
|
|
84
|
-
* Root UI Schema (always a layout).
|
|
85
|
-
*/
|
|
86
|
-
export type UISchema = VerticalLayout | HorizontalLayout | GroupLayout;
|
|
87
22
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/ui-schema/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/ui-schema/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,YAAY,EACV,mBAAmB,EACnB,oBAAoB,EACpB,IAAI,EACJ,UAAU,EACV,cAAc,EACd,cAAc,EACd,gBAAgB,EAChB,WAAW,EACX,cAAc,EACd,QAAQ,EACR,YAAY,EACZ,eAAe,EACf,mBAAmB,EACnB,QAAQ,GACT,MAAM,aAAa,CAAC;AAErB,OAAO,KAAK,EAAE,IAAI,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAE7D;;;;;;;GAOG;AACH,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,mBAAmB,CAAC;IAC1B,IAAI,CAAC,EAAE,IAAI,CAAC;IACZ,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACnC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Constraint validator for the FormSpec IR.
|
|
3
|
+
*
|
|
4
|
+
* Delegates target-centric semantic analysis to `@formspec/analysis` so build
|
|
5
|
+
* validation and editor tooling share the same inheritance, path-target,
|
|
6
|
+
* contradiction, and broadening semantics.
|
|
7
|
+
*
|
|
8
|
+
* @packageDocumentation
|
|
9
|
+
*/
|
|
10
|
+
import { type ConstraintSemanticDiagnostic } from "@formspec/analysis";
|
|
11
|
+
import type { FormIR } from "@formspec/core";
|
|
12
|
+
import type { ExtensionRegistry } from "../extensions/index.js";
|
|
13
|
+
export type ValidationDiagnostic = ConstraintSemanticDiagnostic;
|
|
14
|
+
export interface ValidationResult {
|
|
15
|
+
readonly diagnostics: readonly ValidationDiagnostic[];
|
|
16
|
+
readonly valid: boolean;
|
|
17
|
+
}
|
|
18
|
+
export interface ValidateIROptions {
|
|
19
|
+
readonly vendorPrefix?: string;
|
|
20
|
+
readonly extensionRegistry?: ExtensionRegistry;
|
|
21
|
+
}
|
|
22
|
+
export declare function validateIR(ir: FormIR, options?: ValidateIROptions): ValidationResult;
|
|
23
|
+
//# sourceMappingURL=constraint-validator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constraint-validator.d.ts","sourceRoot":"","sources":["../../src/validate/constraint-validator.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAGL,KAAK,4BAA4B,EAClC,MAAM,oBAAoB,CAAC;AAC5B,OAAO,KAAK,EAAE,MAAM,EAA4C,MAAM,gBAAgB,CAAC;AACvF,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAEhE,MAAM,MAAM,oBAAoB,GAAG,4BAA4B,CAAC;AAEhE,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,WAAW,EAAE,SAAS,oBAAoB,EAAE,CAAC;IACtD,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;CACzB;AAED,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,iBAAiB,CAAC,EAAE,iBAAiB,CAAC;CAChD;AA6ED,wBAAgB,UAAU,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,iBAAiB,GAAG,gBAAgB,CAepF"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Constraint validation for the FormSpec IR.
|
|
3
|
+
*
|
|
4
|
+
* @packageDocumentation
|
|
5
|
+
*/
|
|
6
|
+
export { validateIR } from "./constraint-validator.js";
|
|
7
|
+
export type { ValidationDiagnostic, ValidationResult, ValidateIROptions, } from "./constraint-validator.js";
|
|
8
|
+
export type { ExtensionRegistry } from "../extensions/index.js";
|
|
9
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/validate/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACvD,YAAY,EACV,oBAAoB,EACpB,gBAAgB,EAChB,iBAAiB,GAClB,MAAM,2BAA2B,CAAC;AAGnC,YAAY,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@formspec/build",
|
|
3
|
-
"version": "0.1.0-alpha.
|
|
3
|
+
"version": "0.1.0-alpha.20",
|
|
4
4
|
"description": "Build tools to compile FormSpec forms to JSON Schema and UI Schema",
|
|
5
5
|
"type": "module",
|
|
6
|
-
"main": "./dist/index.
|
|
6
|
+
"main": "./dist/index.cjs",
|
|
7
|
+
"module": "./dist/index.js",
|
|
7
8
|
"types": "./dist/build.d.ts",
|
|
8
9
|
"bin": {
|
|
9
10
|
"formspec-build": "./dist/cli.js"
|
|
@@ -11,18 +12,37 @@
|
|
|
11
12
|
"exports": {
|
|
12
13
|
".": {
|
|
13
14
|
"types": "./dist/build.d.ts",
|
|
14
|
-
"import": "./dist/index.js"
|
|
15
|
+
"import": "./dist/index.js",
|
|
16
|
+
"require": "./dist/index.cjs"
|
|
17
|
+
},
|
|
18
|
+
"./browser": {
|
|
19
|
+
"types": "./dist/browser.d.ts",
|
|
20
|
+
"import": "./dist/browser.js",
|
|
21
|
+
"require": "./dist/browser.cjs"
|
|
22
|
+
},
|
|
23
|
+
"./internals": {
|
|
24
|
+
"types": "./dist/internals.d.ts",
|
|
25
|
+
"import": "./dist/internals.js",
|
|
26
|
+
"require": "./dist/internals.cjs"
|
|
15
27
|
}
|
|
16
28
|
},
|
|
17
29
|
"files": [
|
|
18
|
-
"dist"
|
|
30
|
+
"dist",
|
|
31
|
+
"README.md"
|
|
19
32
|
],
|
|
20
33
|
"dependencies": {
|
|
21
|
-
"@
|
|
34
|
+
"@microsoft/tsdoc": "^0.16.0",
|
|
35
|
+
"@microsoft/tsdoc-config": "^0.18.1",
|
|
36
|
+
"zod": "^3.25.0",
|
|
37
|
+
"@formspec/analysis": "0.1.0-alpha.20",
|
|
38
|
+
"@formspec/core": "0.1.0-alpha.19"
|
|
39
|
+
},
|
|
40
|
+
"peerDependencies": {
|
|
41
|
+
"typescript": "^5.0.0"
|
|
22
42
|
},
|
|
23
43
|
"devDependencies": {
|
|
24
44
|
"vitest": "^3.0.0",
|
|
25
|
-
"@formspec/dsl": "0.1.0-alpha.
|
|
45
|
+
"@formspec/dsl": "0.1.0-alpha.19"
|
|
26
46
|
},
|
|
27
47
|
"publishConfig": {
|
|
28
48
|
"access": "public"
|
|
@@ -30,7 +50,7 @@
|
|
|
30
50
|
"keywords": [],
|
|
31
51
|
"license": "UNLICENSED",
|
|
32
52
|
"scripts": {
|
|
33
|
-
"build": "tsc",
|
|
53
|
+
"build": "tsup && tsc --emitDeclarationOnly && api-extractor run --local",
|
|
34
54
|
"clean": "rm -rf dist temp",
|
|
35
55
|
"typecheck": "tsc --noEmit",
|
|
36
56
|
"test": "pnpm run build && vitest run",
|