@builder-builder/builder 0.0.25 → 0.0.27
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/dist/client/schema.d.ts +29 -4
- package/dist/client/schema.js +3 -1
- package/dist/components/Builder.svelte.d.ts +24 -0
- package/dist/components/BuilderCollectionButtons.svelte.d.ts +22 -0
- package/dist/components/BuilderCollections.svelte.d.ts +23 -0
- package/dist/components/BuilderDescription.svelte.d.ts +18 -0
- package/dist/components/BuilderLayout.svelte.d.ts +24 -0
- package/dist/components/BuilderOption.svelte.d.ts +31 -0
- package/dist/components/BuilderOptionSelect.svelte.d.ts +21 -0
- package/dist/components/BuilderOptionToggleBoolean.svelte.d.ts +20 -0
- package/dist/components/BuilderOptionToggleNumber.svelte.d.ts +21 -0
- package/dist/components/BuilderOptionToggleString.svelte.d.ts +21 -0
- package/dist/components/BuilderPrice.svelte.d.ts +21 -0
- package/dist/components/BuilderRender.svelte.d.ts +39 -0
- package/dist/components/config.d.ts +2 -0
- package/dist/components/config.js +1 -0
- package/dist/components/dispatch.d.ts +1 -0
- package/dist/components/dispatch.js +3 -0
- package/dist/components/id.d.ts +1 -0
- package/dist/components/id.js +3 -0
- package/dist/components/index.d.ts +25 -0
- package/dist/components/index.js +7441 -0
- package/dist/entities/builder/builder.js +2 -1
- package/dist/entities/collection/collection.js +2 -1
- package/dist/entities/collection/config.d.ts +20 -20
- package/dist/entities/collection/config.js +3 -2
- package/dist/entities/component/component.d.ts +30 -30
- package/dist/entities/component/component.js +2 -1
- package/dist/entities/component/config.d.ts +12 -12
- package/dist/entities/component/field.d.ts +4 -4
- package/dist/entities/component/field.js +4 -3
- package/dist/entities/expectation.d.ts +2 -2
- package/dist/entities/expectation.js +2 -1
- package/dist/entities/index.d.ts +1 -1
- package/dist/entities/kind.d.ts +1 -1
- package/dist/entities/kind.js +43 -3
- package/dist/entities/model/models.d.ts +3 -3
- package/dist/entities/option/config.d.ts +4 -4
- package/dist/entities/option/option.d.ts +22 -22
- package/dist/entities/option/option.js +2 -1
- package/dist/entities/option/select.d.ts +1 -1
- package/dist/entities/option/select.js +5 -4
- package/dist/entities/option/toggle.d.ts +1 -1
- package/dist/entities/option/toggle.js +4 -3
- package/dist/entities/paths.d.ts +2 -2
- package/dist/entities/paths.js +2 -1
- package/dist/entities/pricing/expression.js +5 -4
- package/dist/entities/pricing/rates.js +2 -1
- package/dist/entities/references.d.ts +50 -2
- package/dist/entities/references.js +2 -1
- package/dist/entities/serialise.d.ts +318 -113
- package/dist/entities/serialise.js +4 -3
- package/dist/entities/tags.d.ts +1 -1
- package/dist/entities/tags.js +2 -1
- package/dist/entities/ui/describe.d.ts +126 -34
- package/dist/entities/ui/describe.js +3 -2
- package/dist/entities/ui/input.d.ts +158 -49
- package/dist/entities/ui/input.js +13 -6
- package/dist/entities/ui/page.d.ts +124 -32
- package/dist/entities/ui/page.js +2 -1
- package/dist/entities/ui/pages.d.ts +11 -3
- package/dist/entities/ui/pages.js +3 -2
- package/dist/entities/validated.d.ts +1 -0
- package/dist/entities/when.d.ts +16 -16
- package/dist/entities/when.js +2 -2
- package/dist/errors/errors.d.ts +10 -0
- package/dist/errors/errors.js +6 -0
- package/dist/instance.d.ts +7 -7
- package/dist/instance.js +4 -4
- package/dist/mappers/index.d.ts +1 -1
- package/dist/mappers/order.js +4 -2
- package/dist/mappers/price.js +1 -2
- package/dist/mappers/render/collection.d.ts +9 -0
- package/dist/mappers/render/collection.js +27 -0
- package/dist/mappers/render/compose.d.ts +5 -0
- package/dist/mappers/render/compose.js +15 -0
- package/dist/mappers/render/description.d.ts +3 -0
- package/dist/mappers/render/description.js +17 -0
- package/dist/mappers/render/index.d.ts +3 -1
- package/dist/mappers/render/option.d.ts +21 -0
- package/dist/mappers/render/option.js +26 -0
- package/dist/mappers/render/page.d.ts +11 -0
- package/dist/mappers/render/page.js +11 -0
- package/dist/mappers/render/paths.d.ts +3 -0
- package/dist/mappers/render/paths.js +21 -0
- package/dist/mappers/render/render.d.ts +1 -1
- package/dist/mappers/render/render.js +33 -98
- package/dist/mappers/resolve.d.ts +2 -1
- package/dist/mappers/resolve.js +24 -23
- package/dist/primitive.d.ts +5 -0
- package/dist/primitive.js +6 -1
- package/dist/public.d.ts +1 -1
- package/dist/references.d.ts +6 -6
- package/dist/references.js +3 -2
- package/dist/validate/model.js +16 -5
- package/dist/validate/paths.js +3 -5
- package/dist/validate/pricing.js +5 -6
- package/dist/validate/resolve.d.ts +2 -1
- package/dist/validate/resolve.js +87 -73
- package/dist/validate/ui.js +14 -13
- package/package.json +7 -5
- package/dist/mappers/render/pages.d.ts +0 -24
- package/dist/mappers/render/pages.js +0 -2
|
@@ -12,27 +12,29 @@ export declare class BuilderUIInput<const Path extends Paramable<BuilderPath> =
|
|
|
12
12
|
readonly path: Path;
|
|
13
13
|
readonly displayName?: DisplayName;
|
|
14
14
|
readonly kind?: Kind;
|
|
15
|
+
readonly placeholderLabel?: Paramable<string>;
|
|
15
16
|
readonly metadata?: Metadata;
|
|
16
17
|
readonly tags?: BuilderTags;
|
|
17
|
-
constructor(path: Path, displayName?: DisplayName, kind?: Kind, metadata?: Metadata, tags?: BuilderTags);
|
|
18
|
+
constructor(path: Path, displayName?: DisplayName, kind?: Kind, placeholderLabel?: Paramable<string>, metadata?: Metadata, tags?: BuilderTags);
|
|
18
19
|
display<const NewDisplayName extends Paramable<string>>(displayName: NewDisplayName): BuilderUIInput<Path, NewDisplayName, Kind, Metadata>;
|
|
19
20
|
as<const NewKind extends Paramable<string>>(kind: NewKind): BuilderUIInput<Path, DisplayName, NewKind, Metadata>;
|
|
21
|
+
placeholder(placeholderLabel: Paramable<string>): BuilderUIInput<Path, DisplayName, Kind, Metadata>;
|
|
20
22
|
meta<const NewMetadata extends BuilderUIInputMetadata>(metadata: NewMetadata): BuilderUIInput<Path, DisplayName, Kind, NewMetadata>;
|
|
21
23
|
tag(...tags: Array<string>): BuilderUIInput<Path, DisplayName, Kind, Metadata>;
|
|
22
24
|
}
|
|
23
25
|
export declare function input<const Path extends Paramable<BuilderPath>>(path: Path): BuilderUIInput<Path>;
|
|
24
26
|
export declare const BuilderUIInputSchema: v.InstanceSchema<typeof BuilderUIInput, undefined>;
|
|
25
|
-
export declare const BuilderUIInputMetadataSchema: v.SchemaWithPipe<readonly [v.RecordSchema<v.StringSchema<undefined>, v.UnionSchema<[v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
27
|
+
export declare const BuilderUIInputMetadataSchema: v.SchemaWithPipe<readonly [v.RecordSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>, v.UnionSchema<[v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
26
28
|
readonly type: v.LiteralSchema<"parameter", undefined>;
|
|
27
|
-
readonly id: v.StringSchema<undefined>;
|
|
28
|
-
readonly name: v.StringSchema<undefined>;
|
|
29
|
+
readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
|
|
30
|
+
readonly name: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
|
|
29
31
|
}, undefined>, v.ReadonlyAction<{
|
|
30
32
|
type: "parameter";
|
|
31
33
|
id: string;
|
|
32
34
|
name: string;
|
|
33
35
|
}>]>, v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
34
36
|
readonly type: v.LiteralSchema<"ref", undefined>;
|
|
35
|
-
readonly id: v.StringSchema<undefined>;
|
|
37
|
+
readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
|
|
36
38
|
}, undefined>, v.ReadonlyAction<{
|
|
37
39
|
type: "ref";
|
|
38
40
|
id: string;
|
|
@@ -43,81 +45,96 @@ export declare const BuilderUIInputSerialisedSchema: v.SchemaWithPipe<readonly [
|
|
|
43
45
|
readonly type: v.LiteralSchema<"input", undefined>;
|
|
44
46
|
readonly path: v.UnionSchema<[v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
45
47
|
readonly type: v.LiteralSchema<"parameter", undefined>;
|
|
46
|
-
readonly id: v.StringSchema<undefined>;
|
|
47
|
-
readonly name: v.StringSchema<undefined>;
|
|
48
|
+
readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
|
|
49
|
+
readonly name: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
|
|
48
50
|
}, undefined>, v.ReadonlyAction<{
|
|
49
51
|
type: "parameter";
|
|
50
52
|
id: string;
|
|
51
53
|
name: string;
|
|
52
54
|
}>]>, v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
53
55
|
readonly type: v.LiteralSchema<"ref", undefined>;
|
|
54
|
-
readonly id: v.StringSchema<undefined>;
|
|
56
|
+
readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
|
|
55
57
|
}, undefined>, v.ReadonlyAction<{
|
|
56
58
|
type: "ref";
|
|
57
59
|
id: string;
|
|
58
|
-
}>]>, v.SchemaWithPipe<readonly [v.ArraySchema<v.UnionSchema<[v.StringSchema<undefined>, v.NumberSchema<undefined>], undefined>, undefined>, v.ReadonlyAction<(string | number)[]>]>], undefined>;
|
|
60
|
+
}>]>, v.SchemaWithPipe<readonly [v.ArraySchema<v.UnionSchema<[v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>, v.NumberSchema<undefined>], undefined>, undefined>, v.ReadonlyAction<(string | number)[]>]>], undefined>;
|
|
59
61
|
readonly displayName: v.OptionalSchema<v.UnionSchema<[v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
60
62
|
readonly type: v.LiteralSchema<"parameter", undefined>;
|
|
61
|
-
readonly id: v.StringSchema<undefined>;
|
|
62
|
-
readonly name: v.StringSchema<undefined>;
|
|
63
|
+
readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
|
|
64
|
+
readonly name: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
|
|
63
65
|
}, undefined>, v.ReadonlyAction<{
|
|
64
66
|
type: "parameter";
|
|
65
67
|
id: string;
|
|
66
68
|
name: string;
|
|
67
69
|
}>]>, v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
68
70
|
readonly type: v.LiteralSchema<"ref", undefined>;
|
|
69
|
-
readonly id: v.StringSchema<undefined>;
|
|
71
|
+
readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
|
|
70
72
|
}, undefined>, v.ReadonlyAction<{
|
|
71
73
|
type: "ref";
|
|
72
74
|
id: string;
|
|
73
|
-
}>]>, v.StringSchema<undefined>], undefined>, undefined>;
|
|
75
|
+
}>]>, v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>], undefined>, undefined>;
|
|
74
76
|
readonly kind: v.OptionalSchema<v.UnionSchema<[v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
75
77
|
readonly type: v.LiteralSchema<"parameter", undefined>;
|
|
76
|
-
readonly id: v.StringSchema<undefined>;
|
|
77
|
-
readonly name: v.StringSchema<undefined>;
|
|
78
|
+
readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
|
|
79
|
+
readonly name: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
|
|
78
80
|
}, undefined>, v.ReadonlyAction<{
|
|
79
81
|
type: "parameter";
|
|
80
82
|
id: string;
|
|
81
83
|
name: string;
|
|
82
84
|
}>]>, v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
83
85
|
readonly type: v.LiteralSchema<"ref", undefined>;
|
|
84
|
-
readonly id: v.StringSchema<undefined>;
|
|
86
|
+
readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
|
|
85
87
|
}, undefined>, v.ReadonlyAction<{
|
|
86
88
|
type: "ref";
|
|
87
89
|
id: string;
|
|
88
|
-
}>]>, v.StringSchema<undefined>], undefined>, undefined>;
|
|
90
|
+
}>]>, v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>], undefined>, undefined>;
|
|
91
|
+
readonly placeholderLabel: v.OptionalSchema<v.UnionSchema<[v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
92
|
+
readonly type: v.LiteralSchema<"parameter", undefined>;
|
|
93
|
+
readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
|
|
94
|
+
readonly name: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
|
|
95
|
+
}, undefined>, v.ReadonlyAction<{
|
|
96
|
+
type: "parameter";
|
|
97
|
+
id: string;
|
|
98
|
+
name: string;
|
|
99
|
+
}>]>, v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
100
|
+
readonly type: v.LiteralSchema<"ref", undefined>;
|
|
101
|
+
readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
|
|
102
|
+
}, undefined>, v.ReadonlyAction<{
|
|
103
|
+
type: "ref";
|
|
104
|
+
id: string;
|
|
105
|
+
}>]>, v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>], undefined>, undefined>;
|
|
89
106
|
readonly metadata: v.OptionalSchema<v.UnionSchema<[v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
90
107
|
readonly type: v.LiteralSchema<"parameter", undefined>;
|
|
91
|
-
readonly id: v.StringSchema<undefined>;
|
|
92
|
-
readonly name: v.StringSchema<undefined>;
|
|
108
|
+
readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
|
|
109
|
+
readonly name: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
|
|
93
110
|
}, undefined>, v.ReadonlyAction<{
|
|
94
111
|
type: "parameter";
|
|
95
112
|
id: string;
|
|
96
113
|
name: string;
|
|
97
114
|
}>]>, v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
98
115
|
readonly type: v.LiteralSchema<"ref", undefined>;
|
|
99
|
-
readonly id: v.StringSchema<undefined>;
|
|
116
|
+
readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
|
|
100
117
|
}, undefined>, v.ReadonlyAction<{
|
|
101
118
|
type: "ref";
|
|
102
119
|
id: string;
|
|
103
|
-
}>]>, v.SchemaWithPipe<readonly [v.RecordSchema<v.StringSchema<undefined>, v.UnionSchema<[v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
120
|
+
}>]>, v.SchemaWithPipe<readonly [v.RecordSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>, v.UnionSchema<[v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
104
121
|
readonly type: v.LiteralSchema<"parameter", undefined>;
|
|
105
|
-
readonly id: v.StringSchema<undefined>;
|
|
106
|
-
readonly name: v.StringSchema<undefined>;
|
|
122
|
+
readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
|
|
123
|
+
readonly name: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
|
|
107
124
|
}, undefined>, v.ReadonlyAction<{
|
|
108
125
|
type: "parameter";
|
|
109
126
|
id: string;
|
|
110
127
|
name: string;
|
|
111
128
|
}>]>, v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
112
129
|
readonly type: v.LiteralSchema<"ref", undefined>;
|
|
113
|
-
readonly id: v.StringSchema<undefined>;
|
|
130
|
+
readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
|
|
114
131
|
}, undefined>, v.ReadonlyAction<{
|
|
115
132
|
type: "ref";
|
|
116
133
|
id: string;
|
|
117
134
|
}>]>, v.UnknownSchema], undefined>, undefined>, v.ReadonlyAction<{
|
|
118
135
|
[x: string]: unknown;
|
|
119
136
|
}>]>], undefined>, undefined>;
|
|
120
|
-
readonly tags: v.OptionalSchema<v.SchemaWithPipe<readonly [v.ArraySchema<v.StringSchema<undefined>, undefined>, v.ReadonlyAction<string[]>]>, undefined>;
|
|
137
|
+
readonly tags: v.OptionalSchema<v.SchemaWithPipe<readonly [v.ArraySchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>, undefined>, v.ReadonlyAction<string[]>]>, undefined>;
|
|
121
138
|
}, undefined>, v.ReadonlyAction<{
|
|
122
139
|
type: "input";
|
|
123
140
|
path: readonly (string | number)[] | Readonly<{
|
|
@@ -144,6 +161,14 @@ export declare const BuilderUIInputSerialisedSchema: v.SchemaWithPipe<readonly [
|
|
|
144
161
|
type: "ref";
|
|
145
162
|
id: string;
|
|
146
163
|
}> | undefined;
|
|
164
|
+
placeholderLabel?: string | Readonly<{
|
|
165
|
+
type: "parameter";
|
|
166
|
+
id: string;
|
|
167
|
+
name: string;
|
|
168
|
+
}> | Readonly<{
|
|
169
|
+
type: "ref";
|
|
170
|
+
id: string;
|
|
171
|
+
}> | undefined;
|
|
147
172
|
metadata?: Readonly<{
|
|
148
173
|
type: "parameter";
|
|
149
174
|
id: string;
|
|
@@ -159,15 +184,15 @@ export declare const BuilderUIInputSerialisedSchema: v.SchemaWithPipe<readonly [
|
|
|
159
184
|
export type BuilderUIInputSerialised = v.InferOutput<typeof BuilderUIInputSerialisedSchema>;
|
|
160
185
|
export declare const BuilderUIInputsSerialisedSchema: v.SchemaWithPipe<readonly [v.ArraySchema<v.UnionSchema<[v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
161
186
|
readonly type: v.LiteralSchema<"parameter", undefined>;
|
|
162
|
-
readonly id: v.StringSchema<undefined>;
|
|
163
|
-
readonly name: v.StringSchema<undefined>;
|
|
187
|
+
readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
|
|
188
|
+
readonly name: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
|
|
164
189
|
}, undefined>, v.ReadonlyAction<{
|
|
165
190
|
type: "parameter";
|
|
166
191
|
id: string;
|
|
167
192
|
name: string;
|
|
168
193
|
}>]>, v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
169
194
|
readonly type: v.LiteralSchema<"ref", undefined>;
|
|
170
|
-
readonly id: v.StringSchema<undefined>;
|
|
195
|
+
readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
|
|
171
196
|
}, undefined>, v.ReadonlyAction<{
|
|
172
197
|
type: "ref";
|
|
173
198
|
id: string;
|
|
@@ -175,81 +200,96 @@ export declare const BuilderUIInputsSerialisedSchema: v.SchemaWithPipe<readonly
|
|
|
175
200
|
readonly type: v.LiteralSchema<"input", undefined>;
|
|
176
201
|
readonly path: v.UnionSchema<[v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
177
202
|
readonly type: v.LiteralSchema<"parameter", undefined>;
|
|
178
|
-
readonly id: v.StringSchema<undefined>;
|
|
179
|
-
readonly name: v.StringSchema<undefined>;
|
|
203
|
+
readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
|
|
204
|
+
readonly name: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
|
|
180
205
|
}, undefined>, v.ReadonlyAction<{
|
|
181
206
|
type: "parameter";
|
|
182
207
|
id: string;
|
|
183
208
|
name: string;
|
|
184
209
|
}>]>, v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
185
210
|
readonly type: v.LiteralSchema<"ref", undefined>;
|
|
186
|
-
readonly id: v.StringSchema<undefined>;
|
|
211
|
+
readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
|
|
187
212
|
}, undefined>, v.ReadonlyAction<{
|
|
188
213
|
type: "ref";
|
|
189
214
|
id: string;
|
|
190
|
-
}>]>, v.SchemaWithPipe<readonly [v.ArraySchema<v.UnionSchema<[v.StringSchema<undefined>, v.NumberSchema<undefined>], undefined>, undefined>, v.ReadonlyAction<(string | number)[]>]>], undefined>;
|
|
215
|
+
}>]>, v.SchemaWithPipe<readonly [v.ArraySchema<v.UnionSchema<[v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>, v.NumberSchema<undefined>], undefined>, undefined>, v.ReadonlyAction<(string | number)[]>]>], undefined>;
|
|
191
216
|
readonly displayName: v.OptionalSchema<v.UnionSchema<[v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
192
217
|
readonly type: v.LiteralSchema<"parameter", undefined>;
|
|
193
|
-
readonly id: v.StringSchema<undefined>;
|
|
194
|
-
readonly name: v.StringSchema<undefined>;
|
|
218
|
+
readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
|
|
219
|
+
readonly name: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
|
|
195
220
|
}, undefined>, v.ReadonlyAction<{
|
|
196
221
|
type: "parameter";
|
|
197
222
|
id: string;
|
|
198
223
|
name: string;
|
|
199
224
|
}>]>, v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
200
225
|
readonly type: v.LiteralSchema<"ref", undefined>;
|
|
201
|
-
readonly id: v.StringSchema<undefined>;
|
|
226
|
+
readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
|
|
202
227
|
}, undefined>, v.ReadonlyAction<{
|
|
203
228
|
type: "ref";
|
|
204
229
|
id: string;
|
|
205
|
-
}>]>, v.StringSchema<undefined>], undefined>, undefined>;
|
|
230
|
+
}>]>, v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>], undefined>, undefined>;
|
|
206
231
|
readonly kind: v.OptionalSchema<v.UnionSchema<[v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
207
232
|
readonly type: v.LiteralSchema<"parameter", undefined>;
|
|
208
|
-
readonly id: v.StringSchema<undefined>;
|
|
209
|
-
readonly name: v.StringSchema<undefined>;
|
|
233
|
+
readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
|
|
234
|
+
readonly name: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
|
|
235
|
+
}, undefined>, v.ReadonlyAction<{
|
|
236
|
+
type: "parameter";
|
|
237
|
+
id: string;
|
|
238
|
+
name: string;
|
|
239
|
+
}>]>, v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
240
|
+
readonly type: v.LiteralSchema<"ref", undefined>;
|
|
241
|
+
readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
|
|
242
|
+
}, undefined>, v.ReadonlyAction<{
|
|
243
|
+
type: "ref";
|
|
244
|
+
id: string;
|
|
245
|
+
}>]>, v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>], undefined>, undefined>;
|
|
246
|
+
readonly placeholderLabel: v.OptionalSchema<v.UnionSchema<[v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
247
|
+
readonly type: v.LiteralSchema<"parameter", undefined>;
|
|
248
|
+
readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
|
|
249
|
+
readonly name: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
|
|
210
250
|
}, undefined>, v.ReadonlyAction<{
|
|
211
251
|
type: "parameter";
|
|
212
252
|
id: string;
|
|
213
253
|
name: string;
|
|
214
254
|
}>]>, v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
215
255
|
readonly type: v.LiteralSchema<"ref", undefined>;
|
|
216
|
-
readonly id: v.StringSchema<undefined>;
|
|
256
|
+
readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
|
|
217
257
|
}, undefined>, v.ReadonlyAction<{
|
|
218
258
|
type: "ref";
|
|
219
259
|
id: string;
|
|
220
|
-
}>]>, v.StringSchema<undefined>], undefined>, undefined>;
|
|
260
|
+
}>]>, v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>], undefined>, undefined>;
|
|
221
261
|
readonly metadata: v.OptionalSchema<v.UnionSchema<[v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
222
262
|
readonly type: v.LiteralSchema<"parameter", undefined>;
|
|
223
|
-
readonly id: v.StringSchema<undefined>;
|
|
224
|
-
readonly name: v.StringSchema<undefined>;
|
|
263
|
+
readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
|
|
264
|
+
readonly name: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
|
|
225
265
|
}, undefined>, v.ReadonlyAction<{
|
|
226
266
|
type: "parameter";
|
|
227
267
|
id: string;
|
|
228
268
|
name: string;
|
|
229
269
|
}>]>, v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
230
270
|
readonly type: v.LiteralSchema<"ref", undefined>;
|
|
231
|
-
readonly id: v.StringSchema<undefined>;
|
|
271
|
+
readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
|
|
232
272
|
}, undefined>, v.ReadonlyAction<{
|
|
233
273
|
type: "ref";
|
|
234
274
|
id: string;
|
|
235
|
-
}>]>, v.SchemaWithPipe<readonly [v.RecordSchema<v.StringSchema<undefined>, v.UnionSchema<[v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
275
|
+
}>]>, v.SchemaWithPipe<readonly [v.RecordSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>, v.UnionSchema<[v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
236
276
|
readonly type: v.LiteralSchema<"parameter", undefined>;
|
|
237
|
-
readonly id: v.StringSchema<undefined>;
|
|
238
|
-
readonly name: v.StringSchema<undefined>;
|
|
277
|
+
readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
|
|
278
|
+
readonly name: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
|
|
239
279
|
}, undefined>, v.ReadonlyAction<{
|
|
240
280
|
type: "parameter";
|
|
241
281
|
id: string;
|
|
242
282
|
name: string;
|
|
243
283
|
}>]>, v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
244
284
|
readonly type: v.LiteralSchema<"ref", undefined>;
|
|
245
|
-
readonly id: v.StringSchema<undefined>;
|
|
285
|
+
readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
|
|
246
286
|
}, undefined>, v.ReadonlyAction<{
|
|
247
287
|
type: "ref";
|
|
248
288
|
id: string;
|
|
249
289
|
}>]>, v.UnknownSchema], undefined>, undefined>, v.ReadonlyAction<{
|
|
250
290
|
[x: string]: unknown;
|
|
251
291
|
}>]>], undefined>, undefined>;
|
|
252
|
-
readonly tags: v.OptionalSchema<v.SchemaWithPipe<readonly [v.ArraySchema<v.StringSchema<undefined>, undefined>, v.ReadonlyAction<string[]>]>, undefined>;
|
|
292
|
+
readonly tags: v.OptionalSchema<v.SchemaWithPipe<readonly [v.ArraySchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>, undefined>, v.ReadonlyAction<string[]>]>, undefined>;
|
|
253
293
|
}, undefined>, v.ReadonlyAction<{
|
|
254
294
|
type: "input";
|
|
255
295
|
path: readonly (string | number)[] | Readonly<{
|
|
@@ -276,6 +316,14 @@ export declare const BuilderUIInputsSerialisedSchema: v.SchemaWithPipe<readonly
|
|
|
276
316
|
type: "ref";
|
|
277
317
|
id: string;
|
|
278
318
|
}> | undefined;
|
|
319
|
+
placeholderLabel?: string | Readonly<{
|
|
320
|
+
type: "parameter";
|
|
321
|
+
id: string;
|
|
322
|
+
name: string;
|
|
323
|
+
}> | Readonly<{
|
|
324
|
+
type: "ref";
|
|
325
|
+
id: string;
|
|
326
|
+
}> | undefined;
|
|
279
327
|
metadata?: Readonly<{
|
|
280
328
|
type: "parameter";
|
|
281
329
|
id: string;
|
|
@@ -287,7 +335,7 @@ export declare const BuilderUIInputsSerialisedSchema: v.SchemaWithPipe<readonly
|
|
|
287
335
|
[x: string]: unknown;
|
|
288
336
|
}> | undefined;
|
|
289
337
|
tags?: readonly string[] | undefined;
|
|
290
|
-
}>]>], undefined>, undefined>, v.
|
|
338
|
+
}>]>], undefined>, undefined>, v.MinLengthAction<(Readonly<{
|
|
291
339
|
type: "parameter";
|
|
292
340
|
id: string;
|
|
293
341
|
name: string;
|
|
@@ -320,6 +368,66 @@ export declare const BuilderUIInputsSerialisedSchema: v.SchemaWithPipe<readonly
|
|
|
320
368
|
type: "ref";
|
|
321
369
|
id: string;
|
|
322
370
|
}> | undefined;
|
|
371
|
+
placeholderLabel?: string | Readonly<{
|
|
372
|
+
type: "parameter";
|
|
373
|
+
id: string;
|
|
374
|
+
name: string;
|
|
375
|
+
}> | Readonly<{
|
|
376
|
+
type: "ref";
|
|
377
|
+
id: string;
|
|
378
|
+
}> | undefined;
|
|
379
|
+
metadata?: Readonly<{
|
|
380
|
+
type: "parameter";
|
|
381
|
+
id: string;
|
|
382
|
+
name: string;
|
|
383
|
+
}> | Readonly<{
|
|
384
|
+
type: "ref";
|
|
385
|
+
id: string;
|
|
386
|
+
}> | Readonly<{
|
|
387
|
+
[x: string]: unknown;
|
|
388
|
+
}> | undefined;
|
|
389
|
+
tags?: readonly string[] | undefined;
|
|
390
|
+
}>)[], 1, undefined>, v.ReadonlyAction<(Readonly<{
|
|
391
|
+
type: "parameter";
|
|
392
|
+
id: string;
|
|
393
|
+
name: string;
|
|
394
|
+
}> | Readonly<{
|
|
395
|
+
type: "ref";
|
|
396
|
+
id: string;
|
|
397
|
+
}> | Readonly<{
|
|
398
|
+
type: "input";
|
|
399
|
+
path: readonly (string | number)[] | Readonly<{
|
|
400
|
+
type: "parameter";
|
|
401
|
+
id: string;
|
|
402
|
+
name: string;
|
|
403
|
+
}> | Readonly<{
|
|
404
|
+
type: "ref";
|
|
405
|
+
id: string;
|
|
406
|
+
}>;
|
|
407
|
+
displayName?: string | Readonly<{
|
|
408
|
+
type: "parameter";
|
|
409
|
+
id: string;
|
|
410
|
+
name: string;
|
|
411
|
+
}> | Readonly<{
|
|
412
|
+
type: "ref";
|
|
413
|
+
id: string;
|
|
414
|
+
}> | undefined;
|
|
415
|
+
kind?: string | Readonly<{
|
|
416
|
+
type: "parameter";
|
|
417
|
+
id: string;
|
|
418
|
+
name: string;
|
|
419
|
+
}> | Readonly<{
|
|
420
|
+
type: "ref";
|
|
421
|
+
id: string;
|
|
422
|
+
}> | undefined;
|
|
423
|
+
placeholderLabel?: string | Readonly<{
|
|
424
|
+
type: "parameter";
|
|
425
|
+
id: string;
|
|
426
|
+
name: string;
|
|
427
|
+
}> | Readonly<{
|
|
428
|
+
type: "ref";
|
|
429
|
+
id: string;
|
|
430
|
+
}> | undefined;
|
|
323
431
|
metadata?: Readonly<{
|
|
324
432
|
type: "parameter";
|
|
325
433
|
id: string;
|
|
@@ -338,6 +446,7 @@ export declare const validateUIInput: (input: unknown, references?: import("..")
|
|
|
338
446
|
readonly path: readonly (string | number)[];
|
|
339
447
|
readonly displayName?: string | undefined;
|
|
340
448
|
readonly kind?: string | undefined;
|
|
449
|
+
readonly placeholderLabel?: string | undefined;
|
|
341
450
|
readonly metadata?: {
|
|
342
451
|
readonly [x: string]: unknown;
|
|
343
452
|
} | undefined;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as v from 'valibot';
|
|
2
|
+
import { NameSchema } from '../../primitive.js';
|
|
2
3
|
import { paramable } from '../../references.js';
|
|
3
4
|
import { createEntityValidator } from '../kind.js';
|
|
4
5
|
import { BuilderPathSchema } from '../paths.js';
|
|
@@ -9,17 +10,19 @@ export class BuilderUIInput {
|
|
|
9
10
|
path;
|
|
10
11
|
displayName;
|
|
11
12
|
kind;
|
|
13
|
+
placeholderLabel;
|
|
12
14
|
metadata;
|
|
13
15
|
tags;
|
|
14
|
-
constructor(path, displayName, kind, metadata, tags) {
|
|
16
|
+
constructor(path, displayName, kind, placeholderLabel, metadata, tags) {
|
|
15
17
|
this.path = path;
|
|
16
18
|
this.displayName = displayName;
|
|
17
19
|
this.kind = kind;
|
|
20
|
+
this.placeholderLabel = placeholderLabel;
|
|
18
21
|
this.metadata = metadata;
|
|
19
22
|
this.tags = tags;
|
|
20
23
|
}
|
|
21
24
|
#next(patch) {
|
|
22
|
-
return new BuilderUIInput(this.path, patch.displayName ?? this.displayName, patch.kind ?? this.kind, patch.metadata ?? this.metadata, patch.tags ?? this.tags);
|
|
25
|
+
return new BuilderUIInput(this.path, patch.displayName ?? this.displayName, patch.kind ?? this.kind, patch.placeholderLabel ?? this.placeholderLabel, patch.metadata ?? this.metadata, patch.tags ?? this.tags);
|
|
23
26
|
}
|
|
24
27
|
display(displayName) {
|
|
25
28
|
return this.#next({
|
|
@@ -29,6 +32,9 @@ export class BuilderUIInput {
|
|
|
29
32
|
as(kind) {
|
|
30
33
|
return this.#next({ kind: kind });
|
|
31
34
|
}
|
|
35
|
+
placeholder(placeholderLabel) {
|
|
36
|
+
return this.#next({ placeholderLabel });
|
|
37
|
+
}
|
|
32
38
|
meta(metadata) {
|
|
33
39
|
return this.#next({ metadata: metadata });
|
|
34
40
|
}
|
|
@@ -40,14 +46,15 @@ export function input(path) {
|
|
|
40
46
|
return new BuilderUIInput(path);
|
|
41
47
|
}
|
|
42
48
|
export const BuilderUIInputSchema = v.instance(BuilderUIInput);
|
|
43
|
-
export const BuilderUIInputMetadataSchema = v.pipe(v.record(
|
|
49
|
+
export const BuilderUIInputMetadataSchema = v.pipe(v.record(NameSchema, paramable(v.unknown())), v.readonly());
|
|
44
50
|
export const BuilderUIInputSerialisedSchema = serialisable(v.object({
|
|
45
51
|
type: v.literal('input'),
|
|
46
52
|
path: paramable(BuilderPathSchema),
|
|
47
|
-
displayName: v.optional(paramable(
|
|
48
|
-
kind: v.optional(paramable(
|
|
53
|
+
displayName: v.optional(paramable(NameSchema)),
|
|
54
|
+
kind: v.optional(paramable(NameSchema)),
|
|
55
|
+
placeholderLabel: v.optional(paramable(NameSchema)),
|
|
49
56
|
metadata: v.optional(paramable(BuilderUIInputMetadataSchema)),
|
|
50
57
|
tags: v.optional(BuilderTagsSchema)
|
|
51
58
|
}));
|
|
52
|
-
export const BuilderUIInputsSerialisedSchema = v.pipe(v.array(paramable(BuilderUIInputSerialisedSchema)), v.readonly());
|
|
59
|
+
export const BuilderUIInputsSerialisedSchema = v.pipe(v.array(paramable(BuilderUIInputSerialisedSchema)), v.minLength(1), v.readonly());
|
|
53
60
|
export const validateUIInput = createEntityValidator('uiInput', BuilderUIInputSerialisedSchema);
|