@valbuild/shared 0.109.0 → 0.111.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.
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
import { type SerializedSchema as SerializedSchemaT, type SerializedStringSchema as SerializedStringSchemaT, type SerializedLiteralSchema as SerializedLiteralSchemaT, type SerializedBooleanSchema as SerializedBooleanSchemaT, type SerializedNumberSchema as SerializedNumberSchemaT, type SerializedObjectSchema as SerializedObjectSchemaT, type SerializedArraySchema as SerializedArraySchemaT, type SerializedUnionSchema as SerializedUnionSchemaT, type SerializedRichTextSchema as SerializedRichTextSchemaT, type SerializedRichTextOptions as SerializedRichTextOptionsT, type SerializedRecordSchema as SerializedRecordSchemaT, type SerializedKeyOfSchema as SerializedKeyOfSchemaT, type SerializedRouteSchema as SerializedRouteSchemaT, type SerializedFileSchema as SerializedFileSchemaT, type SerializedDateSchema as SerializedDateSchemaT, type SerializedDateTimeSchema as SerializedDateTimeSchemaT, type SerializedColorSchema as SerializedColorSchemaT, type SerializedImageSchema as SerializedImageSchemaT } from "@valbuild/core";
|
|
2
|
+
import { type SerializedSchema as SerializedSchemaT, type SerializedStringSchema as SerializedStringSchemaT, type SerializedLiteralSchema as SerializedLiteralSchemaT, type SerializedBooleanSchema as SerializedBooleanSchemaT, type SerializedNumberSchema as SerializedNumberSchemaT, type SerializedObjectSchema as SerializedObjectSchemaT, type SerializedArraySchema as SerializedArraySchemaT, type SerializedUnionSchema as SerializedUnionSchemaT, type SerializedRichTextSchema as SerializedRichTextSchemaT, type SerializedRichTextOptions as SerializedRichTextOptionsT, type SerializedRecordSchema as SerializedRecordSchemaT, type SerializedKeyOfSchema as SerializedKeyOfSchemaT, type SerializedRouteSchema as SerializedRouteSchemaT, type SerializedFileSchema as SerializedFileSchemaT, type SerializedDateSchema as SerializedDateSchemaT, type SerializedDateTimeSchema as SerializedDateTimeSchemaT, type SerializedColorSchema as SerializedColorSchemaT, type SerializedCodeSchema as SerializedCodeSchemaT, type SerializedImageSchema as SerializedImageSchemaT } from "@valbuild/core";
|
|
3
3
|
export declare const SerializedStringSchema: z.ZodType<SerializedStringSchemaT>;
|
|
4
4
|
export declare const SerializedLiteralSchema: z.ZodType<SerializedLiteralSchemaT>;
|
|
5
5
|
export declare const SerializedBooleanSchema: z.ZodType<SerializedBooleanSchemaT>;
|
|
@@ -7,11 +7,21 @@ export declare const SerializedNumberSchema: z.ZodType<SerializedNumberSchemaT>;
|
|
|
7
7
|
export declare const SerializedObjectSchema: z.ZodType<SerializedObjectSchemaT>;
|
|
8
8
|
export declare const SerializedArraySchema: z.ZodType<SerializedArraySchemaT>;
|
|
9
9
|
export declare const SerializedUnionSchema: z.ZodType<SerializedUnionSchemaT>;
|
|
10
|
+
export declare const ImageEncodeOption: z.ZodUnion<readonly [z.ZodLiteral<false>, z.ZodObject<{
|
|
11
|
+
type: z.ZodLiteral<"webp">;
|
|
12
|
+
quality: z.ZodOptional<z.ZodNumber>;
|
|
13
|
+
maxWidth: z.ZodOptional<z.ZodNumber>;
|
|
14
|
+
maxHeight: z.ZodOptional<z.ZodNumber>;
|
|
15
|
+
}, z.core.$strip>]>;
|
|
10
16
|
export declare const ImageOptions: z.ZodObject<{
|
|
11
|
-
ext: z.ZodOptional<z.ZodUnion<readonly [z.ZodTuple<[z.ZodLiteral<"jpg">], null>, z.ZodTuple<[z.ZodLiteral<"webp">], null>]>>;
|
|
12
17
|
directory: z.ZodOptional<z.ZodString>;
|
|
13
|
-
prefix: z.ZodOptional<z.ZodString>;
|
|
14
18
|
accept: z.ZodOptional<z.ZodString>;
|
|
19
|
+
encode: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<false>, z.ZodObject<{
|
|
20
|
+
type: z.ZodLiteral<"webp">;
|
|
21
|
+
quality: z.ZodOptional<z.ZodNumber>;
|
|
22
|
+
maxWidth: z.ZodOptional<z.ZodNumber>;
|
|
23
|
+
maxHeight: z.ZodOptional<z.ZodNumber>;
|
|
24
|
+
}, z.core.$strip>]>>;
|
|
15
25
|
}, z.core.$strip>;
|
|
16
26
|
export declare const SerializedImageSchema: z.ZodType<SerializedImageSchemaT>;
|
|
17
27
|
export declare const RichTextOptions: z.ZodType<SerializedRichTextOptionsT>;
|
|
@@ -38,5 +48,29 @@ export declare const ColorOptions: z.ZodObject<{
|
|
|
38
48
|
alpha: z.ZodOptional<z.ZodBoolean>;
|
|
39
49
|
}, z.core.$strip>;
|
|
40
50
|
export declare const SerializedColorSchema: z.ZodType<SerializedColorSchemaT>;
|
|
51
|
+
export declare const CodeOptions: z.ZodObject<{
|
|
52
|
+
language: z.ZodOptional<z.ZodEnum<{
|
|
53
|
+
json: "json";
|
|
54
|
+
typescript: "typescript";
|
|
55
|
+
javascript: "javascript";
|
|
56
|
+
javascriptreact: "javascriptreact";
|
|
57
|
+
typescriptreact: "typescriptreact";
|
|
58
|
+
java: "java";
|
|
59
|
+
html: "html";
|
|
60
|
+
css: "css";
|
|
61
|
+
xml: "xml";
|
|
62
|
+
markdown: "markdown";
|
|
63
|
+
sql: "sql";
|
|
64
|
+
python: "python";
|
|
65
|
+
rust: "rust";
|
|
66
|
+
php: "php";
|
|
67
|
+
go: "go";
|
|
68
|
+
cpp: "cpp";
|
|
69
|
+
sass: "sass";
|
|
70
|
+
vue: "vue";
|
|
71
|
+
angular: "angular";
|
|
72
|
+
}>>;
|
|
73
|
+
}, z.core.$strip>;
|
|
74
|
+
export declare const SerializedCodeSchema: z.ZodType<SerializedCodeSchemaT>;
|
|
41
75
|
export declare const SerializedRouteSchema: z.ZodType<SerializedRouteSchemaT>;
|
|
42
76
|
export declare const SerializedSchema: z.ZodType<SerializedSchemaT>;
|
|
@@ -1001,22 +1001,20 @@ var SourcePath = zod.z.string().transform(function (path) {
|
|
|
1001
1001
|
|
|
1002
1002
|
// A render is static config, so unlike a `preview` it travels WHOLE — this
|
|
1003
1003
|
// is the field the editor reads the layout from. See `core/src/render.ts`.
|
|
1004
|
-
// Every field can carry `{ as: "inline" }
|
|
1005
|
-
//
|
|
1006
|
-
//
|
|
1007
|
-
//
|
|
1004
|
+
// Every field can carry `{ as: "inline" }`, and that is all a render says.
|
|
1005
|
+
// NB: these z.objects STRIP unknown keys, so a render variant that is not
|
|
1006
|
+
// declared here is silently dropped in transit — add it here when it is added
|
|
1007
|
+
// to `render.ts`.
|
|
1008
1008
|
var InlineRender = zod.z.object({
|
|
1009
1009
|
as: zod.z.literal("inline")
|
|
1010
1010
|
});
|
|
1011
1011
|
var FieldRender = InlineRender.optional();
|
|
1012
1012
|
var SerializedStringSchema = zod.z.object({
|
|
1013
1013
|
type: zod.z.literal("string"),
|
|
1014
|
-
render:
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
language: zod.z["enum"](core.CODE_LANGUAGES)
|
|
1019
|
-
}), InlineRender]).optional(),
|
|
1014
|
+
render: FieldRender,
|
|
1015
|
+
// `.multiline()`. Stripped like any undeclared key if it goes missing here,
|
|
1016
|
+
// which is a single-line input where the author asked for a text box.
|
|
1017
|
+
multiline: zod.z["boolean"]().optional(),
|
|
1020
1018
|
preview: zod.z.literal(true).optional(),
|
|
1021
1019
|
options: zod.z.object({
|
|
1022
1020
|
maxLength: zod.z.number().optional(),
|
|
@@ -1103,11 +1101,16 @@ var SerializedUnionSchema = zod.z.lazy(function () {
|
|
|
1103
1101
|
hidden: zod.z["boolean"]().optional()
|
|
1104
1102
|
})]);
|
|
1105
1103
|
});
|
|
1104
|
+
var ImageEncodeOption = zod.z.union([zod.z.literal(false), zod.z.object({
|
|
1105
|
+
type: zod.z.literal("webp"),
|
|
1106
|
+
quality: zod.z.number().optional(),
|
|
1107
|
+
maxWidth: zod.z.number().optional(),
|
|
1108
|
+
maxHeight: zod.z.number().optional()
|
|
1109
|
+
})]);
|
|
1106
1110
|
var ImageOptions = zod.z.object({
|
|
1107
|
-
ext: zod.z.union([zod.z.tuple([zod.z.literal("jpg")]), zod.z.tuple([zod.z.literal("webp")])]).optional(),
|
|
1108
1111
|
directory: zod.z.string().optional(),
|
|
1109
|
-
|
|
1110
|
-
|
|
1112
|
+
accept: zod.z.string().optional(),
|
|
1113
|
+
encode: ImageEncodeOption.optional()
|
|
1111
1114
|
});
|
|
1112
1115
|
var SerializedImageSchema = zod.z.object({
|
|
1113
1116
|
type: zod.z.literal("image"),
|
|
@@ -1163,6 +1166,7 @@ var SerializedRecordSchema = zod.z.lazy(function () {
|
|
|
1163
1166
|
accept: zod.z.string().optional(),
|
|
1164
1167
|
directory: zod.z.string().optional(),
|
|
1165
1168
|
remote: zod.z["boolean"]().optional(),
|
|
1169
|
+
encode: ImageEncodeOption.optional(),
|
|
1166
1170
|
alt: SerializedSchema.optional(),
|
|
1167
1171
|
moduleMetadata: zod.z.record(zod.z.string(), zod.z.record(zod.z.string(), zod.z.any())).optional(),
|
|
1168
1172
|
readonly: zod.z["boolean"]().optional(),
|
|
@@ -1242,6 +1246,20 @@ var SerializedColorSchema = zod.z.object({
|
|
|
1242
1246
|
hidden: zod.z["boolean"]().optional(),
|
|
1243
1247
|
description: zod.z.string().optional()
|
|
1244
1248
|
});
|
|
1249
|
+
var CodeOptions = zod.z.object({
|
|
1250
|
+
language: zod.z["enum"](core.CODE_LANGUAGES).optional()
|
|
1251
|
+
});
|
|
1252
|
+
var SerializedCodeSchema = zod.z.object({
|
|
1253
|
+
type: zod.z.literal("code"),
|
|
1254
|
+
render: FieldRender,
|
|
1255
|
+
preview: zod.z.literal(true).optional(),
|
|
1256
|
+
options: CodeOptions.optional(),
|
|
1257
|
+
opt: zod.z["boolean"](),
|
|
1258
|
+
customValidate: zod.z["boolean"]().optional(),
|
|
1259
|
+
readonly: zod.z["boolean"]().optional(),
|
|
1260
|
+
hidden: zod.z["boolean"]().optional(),
|
|
1261
|
+
description: zod.z.string().optional()
|
|
1262
|
+
});
|
|
1245
1263
|
var SerializedRouteSchema = zod.z.object({
|
|
1246
1264
|
type: zod.z.literal("route"),
|
|
1247
1265
|
render: FieldRender,
|
|
@@ -1262,7 +1280,7 @@ var SerializedRouteSchema = zod.z.object({
|
|
|
1262
1280
|
readonly: zod.z["boolean"]().optional(),
|
|
1263
1281
|
hidden: zod.z["boolean"]().optional()
|
|
1264
1282
|
});
|
|
1265
|
-
var SerializedSchema = zod.z.union([SerializedStringSchema, SerializedLiteralSchema, SerializedBooleanSchema, SerializedNumberSchema, SerializedObjectSchema, SerializedArraySchema, SerializedUnionSchema, SerializedRichTextSchema, SerializedRecordSchema, SerializedKeyOfSchema, SerializedRouteSchema, SerializedFileSchema, SerializedDateSchema, SerializedDateTimeSchema, SerializedColorSchema, SerializedImageSchema]);
|
|
1283
|
+
var SerializedSchema = zod.z.union([SerializedStringSchema, SerializedLiteralSchema, SerializedBooleanSchema, SerializedNumberSchema, SerializedObjectSchema, SerializedArraySchema, SerializedUnionSchema, SerializedRichTextSchema, SerializedRecordSchema, SerializedKeyOfSchema, SerializedRouteSchema, SerializedFileSchema, SerializedDateSchema, SerializedDateTimeSchema, SerializedColorSchema, SerializedCodeSchema, SerializedImageSchema]);
|
|
1266
1284
|
|
|
1267
1285
|
var ValCommit = zod.z.object({
|
|
1268
1286
|
commitSha: zod.z.string(),
|
|
@@ -3443,10 +3461,12 @@ function withValCanvasParam(url) {
|
|
|
3443
3461
|
}
|
|
3444
3462
|
|
|
3445
3463
|
exports.Api = Api;
|
|
3464
|
+
exports.CodeOptions = CodeOptions;
|
|
3446
3465
|
exports.ColorOptions = ColorOptions;
|
|
3447
3466
|
exports.DEFAULT_ERROR_MESSAGE = DEFAULT_ERROR_MESSAGE;
|
|
3448
3467
|
exports.DateOptions = DateOptions;
|
|
3449
3468
|
exports.FileOptions = FileOptions;
|
|
3469
|
+
exports.ImageEncodeOption = ImageEncodeOption;
|
|
3450
3470
|
exports.ImageOptions = ImageOptions;
|
|
3451
3471
|
exports.JSON_ENTRIES_BATCH_MAX = JSON_ENTRIES_BATCH_MAX;
|
|
3452
3472
|
exports.ParentRef = ParentRef$1;
|
|
@@ -3468,6 +3488,7 @@ exports.RemirrorTextMark = RemirrorTextMark;
|
|
|
3468
3488
|
exports.RichTextOptions = RichTextOptions;
|
|
3469
3489
|
exports.SerializedArraySchema = SerializedArraySchema;
|
|
3470
3490
|
exports.SerializedBooleanSchema = SerializedBooleanSchema;
|
|
3491
|
+
exports.SerializedCodeSchema = SerializedCodeSchema;
|
|
3471
3492
|
exports.SerializedColorSchema = SerializedColorSchema;
|
|
3472
3493
|
exports.SerializedDateSchema = SerializedDateSchema;
|
|
3473
3494
|
exports.SerializedDateTimeSchema = SerializedDateTimeSchema;
|
|
@@ -1001,22 +1001,20 @@ var SourcePath = zod.z.string().transform(function (path) {
|
|
|
1001
1001
|
|
|
1002
1002
|
// A render is static config, so unlike a `preview` it travels WHOLE — this
|
|
1003
1003
|
// is the field the editor reads the layout from. See `core/src/render.ts`.
|
|
1004
|
-
// Every field can carry `{ as: "inline" }
|
|
1005
|
-
//
|
|
1006
|
-
//
|
|
1007
|
-
//
|
|
1004
|
+
// Every field can carry `{ as: "inline" }`, and that is all a render says.
|
|
1005
|
+
// NB: these z.objects STRIP unknown keys, so a render variant that is not
|
|
1006
|
+
// declared here is silently dropped in transit — add it here when it is added
|
|
1007
|
+
// to `render.ts`.
|
|
1008
1008
|
var InlineRender = zod.z.object({
|
|
1009
1009
|
as: zod.z.literal("inline")
|
|
1010
1010
|
});
|
|
1011
1011
|
var FieldRender = InlineRender.optional();
|
|
1012
1012
|
var SerializedStringSchema = zod.z.object({
|
|
1013
1013
|
type: zod.z.literal("string"),
|
|
1014
|
-
render:
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
language: zod.z["enum"](core.CODE_LANGUAGES)
|
|
1019
|
-
}), InlineRender]).optional(),
|
|
1014
|
+
render: FieldRender,
|
|
1015
|
+
// `.multiline()`. Stripped like any undeclared key if it goes missing here,
|
|
1016
|
+
// which is a single-line input where the author asked for a text box.
|
|
1017
|
+
multiline: zod.z["boolean"]().optional(),
|
|
1020
1018
|
preview: zod.z.literal(true).optional(),
|
|
1021
1019
|
options: zod.z.object({
|
|
1022
1020
|
maxLength: zod.z.number().optional(),
|
|
@@ -1103,11 +1101,16 @@ var SerializedUnionSchema = zod.z.lazy(function () {
|
|
|
1103
1101
|
hidden: zod.z["boolean"]().optional()
|
|
1104
1102
|
})]);
|
|
1105
1103
|
});
|
|
1104
|
+
var ImageEncodeOption = zod.z.union([zod.z.literal(false), zod.z.object({
|
|
1105
|
+
type: zod.z.literal("webp"),
|
|
1106
|
+
quality: zod.z.number().optional(),
|
|
1107
|
+
maxWidth: zod.z.number().optional(),
|
|
1108
|
+
maxHeight: zod.z.number().optional()
|
|
1109
|
+
})]);
|
|
1106
1110
|
var ImageOptions = zod.z.object({
|
|
1107
|
-
ext: zod.z.union([zod.z.tuple([zod.z.literal("jpg")]), zod.z.tuple([zod.z.literal("webp")])]).optional(),
|
|
1108
1111
|
directory: zod.z.string().optional(),
|
|
1109
|
-
|
|
1110
|
-
|
|
1112
|
+
accept: zod.z.string().optional(),
|
|
1113
|
+
encode: ImageEncodeOption.optional()
|
|
1111
1114
|
});
|
|
1112
1115
|
var SerializedImageSchema = zod.z.object({
|
|
1113
1116
|
type: zod.z.literal("image"),
|
|
@@ -1163,6 +1166,7 @@ var SerializedRecordSchema = zod.z.lazy(function () {
|
|
|
1163
1166
|
accept: zod.z.string().optional(),
|
|
1164
1167
|
directory: zod.z.string().optional(),
|
|
1165
1168
|
remote: zod.z["boolean"]().optional(),
|
|
1169
|
+
encode: ImageEncodeOption.optional(),
|
|
1166
1170
|
alt: SerializedSchema.optional(),
|
|
1167
1171
|
moduleMetadata: zod.z.record(zod.z.string(), zod.z.record(zod.z.string(), zod.z.any())).optional(),
|
|
1168
1172
|
readonly: zod.z["boolean"]().optional(),
|
|
@@ -1242,6 +1246,20 @@ var SerializedColorSchema = zod.z.object({
|
|
|
1242
1246
|
hidden: zod.z["boolean"]().optional(),
|
|
1243
1247
|
description: zod.z.string().optional()
|
|
1244
1248
|
});
|
|
1249
|
+
var CodeOptions = zod.z.object({
|
|
1250
|
+
language: zod.z["enum"](core.CODE_LANGUAGES).optional()
|
|
1251
|
+
});
|
|
1252
|
+
var SerializedCodeSchema = zod.z.object({
|
|
1253
|
+
type: zod.z.literal("code"),
|
|
1254
|
+
render: FieldRender,
|
|
1255
|
+
preview: zod.z.literal(true).optional(),
|
|
1256
|
+
options: CodeOptions.optional(),
|
|
1257
|
+
opt: zod.z["boolean"](),
|
|
1258
|
+
customValidate: zod.z["boolean"]().optional(),
|
|
1259
|
+
readonly: zod.z["boolean"]().optional(),
|
|
1260
|
+
hidden: zod.z["boolean"]().optional(),
|
|
1261
|
+
description: zod.z.string().optional()
|
|
1262
|
+
});
|
|
1245
1263
|
var SerializedRouteSchema = zod.z.object({
|
|
1246
1264
|
type: zod.z.literal("route"),
|
|
1247
1265
|
render: FieldRender,
|
|
@@ -1262,7 +1280,7 @@ var SerializedRouteSchema = zod.z.object({
|
|
|
1262
1280
|
readonly: zod.z["boolean"]().optional(),
|
|
1263
1281
|
hidden: zod.z["boolean"]().optional()
|
|
1264
1282
|
});
|
|
1265
|
-
var SerializedSchema = zod.z.union([SerializedStringSchema, SerializedLiteralSchema, SerializedBooleanSchema, SerializedNumberSchema, SerializedObjectSchema, SerializedArraySchema, SerializedUnionSchema, SerializedRichTextSchema, SerializedRecordSchema, SerializedKeyOfSchema, SerializedRouteSchema, SerializedFileSchema, SerializedDateSchema, SerializedDateTimeSchema, SerializedColorSchema, SerializedImageSchema]);
|
|
1283
|
+
var SerializedSchema = zod.z.union([SerializedStringSchema, SerializedLiteralSchema, SerializedBooleanSchema, SerializedNumberSchema, SerializedObjectSchema, SerializedArraySchema, SerializedUnionSchema, SerializedRichTextSchema, SerializedRecordSchema, SerializedKeyOfSchema, SerializedRouteSchema, SerializedFileSchema, SerializedDateSchema, SerializedDateTimeSchema, SerializedColorSchema, SerializedCodeSchema, SerializedImageSchema]);
|
|
1266
1284
|
|
|
1267
1285
|
var ValCommit = zod.z.object({
|
|
1268
1286
|
commitSha: zod.z.string(),
|
|
@@ -3443,10 +3461,12 @@ function withValCanvasParam(url) {
|
|
|
3443
3461
|
}
|
|
3444
3462
|
|
|
3445
3463
|
exports.Api = Api;
|
|
3464
|
+
exports.CodeOptions = CodeOptions;
|
|
3446
3465
|
exports.ColorOptions = ColorOptions;
|
|
3447
3466
|
exports.DEFAULT_ERROR_MESSAGE = DEFAULT_ERROR_MESSAGE;
|
|
3448
3467
|
exports.DateOptions = DateOptions;
|
|
3449
3468
|
exports.FileOptions = FileOptions;
|
|
3469
|
+
exports.ImageEncodeOption = ImageEncodeOption;
|
|
3450
3470
|
exports.ImageOptions = ImageOptions;
|
|
3451
3471
|
exports.JSON_ENTRIES_BATCH_MAX = JSON_ENTRIES_BATCH_MAX;
|
|
3452
3472
|
exports.ParentRef = ParentRef$1;
|
|
@@ -3468,6 +3488,7 @@ exports.RemirrorTextMark = RemirrorTextMark;
|
|
|
3468
3488
|
exports.RichTextOptions = RichTextOptions;
|
|
3469
3489
|
exports.SerializedArraySchema = SerializedArraySchema;
|
|
3470
3490
|
exports.SerializedBooleanSchema = SerializedBooleanSchema;
|
|
3491
|
+
exports.SerializedCodeSchema = SerializedCodeSchema;
|
|
3471
3492
|
exports.SerializedColorSchema = SerializedColorSchema;
|
|
3472
3493
|
exports.SerializedDateSchema = SerializedDateSchema;
|
|
3473
3494
|
exports.SerializedDateTimeSchema = SerializedDateTimeSchema;
|
|
@@ -997,22 +997,20 @@ var SourcePath = z.string().transform(function (path) {
|
|
|
997
997
|
|
|
998
998
|
// A render is static config, so unlike a `preview` it travels WHOLE — this
|
|
999
999
|
// is the field the editor reads the layout from. See `core/src/render.ts`.
|
|
1000
|
-
// Every field can carry `{ as: "inline" }
|
|
1001
|
-
//
|
|
1002
|
-
//
|
|
1003
|
-
//
|
|
1000
|
+
// Every field can carry `{ as: "inline" }`, and that is all a render says.
|
|
1001
|
+
// NB: these z.objects STRIP unknown keys, so a render variant that is not
|
|
1002
|
+
// declared here is silently dropped in transit — add it here when it is added
|
|
1003
|
+
// to `render.ts`.
|
|
1004
1004
|
var InlineRender = z.object({
|
|
1005
1005
|
as: z.literal("inline")
|
|
1006
1006
|
});
|
|
1007
1007
|
var FieldRender = InlineRender.optional();
|
|
1008
1008
|
var SerializedStringSchema = z.object({
|
|
1009
1009
|
type: z.literal("string"),
|
|
1010
|
-
render:
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
language: z["enum"](CODE_LANGUAGES)
|
|
1015
|
-
}), InlineRender]).optional(),
|
|
1010
|
+
render: FieldRender,
|
|
1011
|
+
// `.multiline()`. Stripped like any undeclared key if it goes missing here,
|
|
1012
|
+
// which is a single-line input where the author asked for a text box.
|
|
1013
|
+
multiline: z["boolean"]().optional(),
|
|
1016
1014
|
preview: z.literal(true).optional(),
|
|
1017
1015
|
options: z.object({
|
|
1018
1016
|
maxLength: z.number().optional(),
|
|
@@ -1099,11 +1097,16 @@ var SerializedUnionSchema = z.lazy(function () {
|
|
|
1099
1097
|
hidden: z["boolean"]().optional()
|
|
1100
1098
|
})]);
|
|
1101
1099
|
});
|
|
1100
|
+
var ImageEncodeOption = z.union([z.literal(false), z.object({
|
|
1101
|
+
type: z.literal("webp"),
|
|
1102
|
+
quality: z.number().optional(),
|
|
1103
|
+
maxWidth: z.number().optional(),
|
|
1104
|
+
maxHeight: z.number().optional()
|
|
1105
|
+
})]);
|
|
1102
1106
|
var ImageOptions = z.object({
|
|
1103
|
-
ext: z.union([z.tuple([z.literal("jpg")]), z.tuple([z.literal("webp")])]).optional(),
|
|
1104
1107
|
directory: z.string().optional(),
|
|
1105
|
-
|
|
1106
|
-
|
|
1108
|
+
accept: z.string().optional(),
|
|
1109
|
+
encode: ImageEncodeOption.optional()
|
|
1107
1110
|
});
|
|
1108
1111
|
var SerializedImageSchema = z.object({
|
|
1109
1112
|
type: z.literal("image"),
|
|
@@ -1159,6 +1162,7 @@ var SerializedRecordSchema = z.lazy(function () {
|
|
|
1159
1162
|
accept: z.string().optional(),
|
|
1160
1163
|
directory: z.string().optional(),
|
|
1161
1164
|
remote: z["boolean"]().optional(),
|
|
1165
|
+
encode: ImageEncodeOption.optional(),
|
|
1162
1166
|
alt: SerializedSchema.optional(),
|
|
1163
1167
|
moduleMetadata: z.record(z.string(), z.record(z.string(), z.any())).optional(),
|
|
1164
1168
|
readonly: z["boolean"]().optional(),
|
|
@@ -1238,6 +1242,20 @@ var SerializedColorSchema = z.object({
|
|
|
1238
1242
|
hidden: z["boolean"]().optional(),
|
|
1239
1243
|
description: z.string().optional()
|
|
1240
1244
|
});
|
|
1245
|
+
var CodeOptions = z.object({
|
|
1246
|
+
language: z["enum"](CODE_LANGUAGES).optional()
|
|
1247
|
+
});
|
|
1248
|
+
var SerializedCodeSchema = z.object({
|
|
1249
|
+
type: z.literal("code"),
|
|
1250
|
+
render: FieldRender,
|
|
1251
|
+
preview: z.literal(true).optional(),
|
|
1252
|
+
options: CodeOptions.optional(),
|
|
1253
|
+
opt: z["boolean"](),
|
|
1254
|
+
customValidate: z["boolean"]().optional(),
|
|
1255
|
+
readonly: z["boolean"]().optional(),
|
|
1256
|
+
hidden: z["boolean"]().optional(),
|
|
1257
|
+
description: z.string().optional()
|
|
1258
|
+
});
|
|
1241
1259
|
var SerializedRouteSchema = z.object({
|
|
1242
1260
|
type: z.literal("route"),
|
|
1243
1261
|
render: FieldRender,
|
|
@@ -1258,7 +1276,7 @@ var SerializedRouteSchema = z.object({
|
|
|
1258
1276
|
readonly: z["boolean"]().optional(),
|
|
1259
1277
|
hidden: z["boolean"]().optional()
|
|
1260
1278
|
});
|
|
1261
|
-
var SerializedSchema = z.union([SerializedStringSchema, SerializedLiteralSchema, SerializedBooleanSchema, SerializedNumberSchema, SerializedObjectSchema, SerializedArraySchema, SerializedUnionSchema, SerializedRichTextSchema, SerializedRecordSchema, SerializedKeyOfSchema, SerializedRouteSchema, SerializedFileSchema, SerializedDateSchema, SerializedDateTimeSchema, SerializedColorSchema, SerializedImageSchema]);
|
|
1279
|
+
var SerializedSchema = z.union([SerializedStringSchema, SerializedLiteralSchema, SerializedBooleanSchema, SerializedNumberSchema, SerializedObjectSchema, SerializedArraySchema, SerializedUnionSchema, SerializedRichTextSchema, SerializedRecordSchema, SerializedKeyOfSchema, SerializedRouteSchema, SerializedFileSchema, SerializedDateSchema, SerializedDateTimeSchema, SerializedColorSchema, SerializedCodeSchema, SerializedImageSchema]);
|
|
1262
1280
|
|
|
1263
1281
|
var ValCommit = z.object({
|
|
1264
1282
|
commitSha: z.string(),
|
|
@@ -3438,4 +3456,4 @@ function withValCanvasParam(url) {
|
|
|
3438
3456
|
return "".concat(url).concat(separator).concat(VAL_CANVAS_PARAM, "=1");
|
|
3439
3457
|
}
|
|
3440
3458
|
|
|
3441
|
-
export { Api, ColorOptions, DEFAULT_ERROR_MESSAGE, DateOptions, FileOptions, ImageOptions, JSON_ENTRIES_BATCH_MAX, ParentRef$1 as ParentRef, Patch, PatchBlock, PatchId, PatchJSON, RemirrorBr, RemirrorBulletList, RemirrorHeading, RemirrorImage, RemirrorJSON, RemirrorLinkMark, RemirrorListItem, RemirrorOrderedList, RemirrorParagraph, RemirrorText, RemirrorTextMark, RichTextOptions, SerializedArraySchema, SerializedBooleanSchema, SerializedColorSchema, SerializedDateSchema, SerializedDateTimeSchema, SerializedFileSchema, SerializedImageSchema, SerializedKeyOfSchema, SerializedLiteralSchema, SerializedNumberSchema, SerializedObjectSchema, SerializedRecordSchema, SerializedRichTextSchema, SerializedRouteSchema, SerializedSchema, SerializedStringSchema, SerializedUnionSchema, SharedValConfig, VAL_AI_SESSION_STORAGE_KEY, VAL_CANVAS_MESSAGE, VAL_CANVAS_PARAM, VAL_CONFIG_SESSION_STORAGE_KEY, VAL_ENABLE_COOKIE_NAME, VAL_SESSION_COOKIE, VAL_STATE_COOKIE, VAL_THEME_SESSION_STORAGE_KEY, ValCommit, ValDeployment, createRegExpFromPattern, createValClient, filterRoutesByPatterns, findSimilar, getErrorMessageFromUnknownJson, getNextAppRouterSitemapTree, getNextAppRouterSourceFolder, getPatternFromModuleFilePath, getRoutesOf, getRoutesWithModulePaths, isValCanvasFrame, isValCanvasPageMessage, isValCanvasStudioMessage, levenshtein, parseRoutePattern, remirrorToRichTextSource, resolveSchemaSourceFixForError, resolveSchemaSourceFixes, richTextToRemirror, urlOf, validateRoutePatterns, withValCanvasParam };
|
|
3459
|
+
export { Api, CodeOptions, ColorOptions, DEFAULT_ERROR_MESSAGE, DateOptions, FileOptions, ImageEncodeOption, ImageOptions, JSON_ENTRIES_BATCH_MAX, ParentRef$1 as ParentRef, Patch, PatchBlock, PatchId, PatchJSON, RemirrorBr, RemirrorBulletList, RemirrorHeading, RemirrorImage, RemirrorJSON, RemirrorLinkMark, RemirrorListItem, RemirrorOrderedList, RemirrorParagraph, RemirrorText, RemirrorTextMark, RichTextOptions, SerializedArraySchema, SerializedBooleanSchema, SerializedCodeSchema, SerializedColorSchema, SerializedDateSchema, SerializedDateTimeSchema, SerializedFileSchema, SerializedImageSchema, SerializedKeyOfSchema, SerializedLiteralSchema, SerializedNumberSchema, SerializedObjectSchema, SerializedRecordSchema, SerializedRichTextSchema, SerializedRouteSchema, SerializedSchema, SerializedStringSchema, SerializedUnionSchema, SharedValConfig, VAL_AI_SESSION_STORAGE_KEY, VAL_CANVAS_MESSAGE, VAL_CANVAS_PARAM, VAL_CONFIG_SESSION_STORAGE_KEY, VAL_ENABLE_COOKIE_NAME, VAL_SESSION_COOKIE, VAL_STATE_COOKIE, VAL_THEME_SESSION_STORAGE_KEY, ValCommit, ValDeployment, createRegExpFromPattern, createValClient, filterRoutesByPatterns, findSimilar, getErrorMessageFromUnknownJson, getNextAppRouterSitemapTree, getNextAppRouterSourceFolder, getPatternFromModuleFilePath, getRoutesOf, getRoutesWithModulePaths, isValCanvasFrame, isValCanvasPageMessage, isValCanvasStudioMessage, levenshtein, parseRoutePattern, remirrorToRichTextSource, resolveSchemaSourceFixForError, resolveSchemaSourceFixes, richTextToRemirror, urlOf, validateRoutePatterns, withValCanvasParam };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@valbuild/shared",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.111.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Val shared types and utilities",
|
|
6
6
|
"repository": {
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"dependencies": {
|
|
32
32
|
"zod": "^4.4.3",
|
|
33
33
|
"zod-validation-error": "^5.0.0",
|
|
34
|
-
"@valbuild/core": "0.
|
|
34
|
+
"@valbuild/core": "0.111.0"
|
|
35
35
|
},
|
|
36
36
|
"files": [
|
|
37
37
|
"dist",
|