@valbuild/core 0.138.2 → 0.139.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. package/CHANGELOG.md +37 -0
  2. package/dist/declarations/src/extractValModules.d.ts +14 -0
  3. package/dist/declarations/src/index.d.ts +1 -1
  4. package/dist/declarations/src/render.d.ts +36 -33
  5. package/dist/declarations/src/schema/array.d.ts +13 -8
  6. package/dist/declarations/src/schema/boolean.d.ts +1 -17
  7. package/dist/declarations/src/schema/code.d.ts +1 -21
  8. package/dist/declarations/src/schema/color.d.ts +1 -19
  9. package/dist/declarations/src/schema/date.d.ts +1 -17
  10. package/dist/declarations/src/schema/datetime.d.ts +1 -19
  11. package/dist/declarations/src/schema/discriminatedUnion.d.ts +1 -23
  12. package/dist/declarations/src/schema/enum.d.ts +1 -19
  13. package/dist/declarations/src/schema/file.d.ts +1 -19
  14. package/dist/declarations/src/schema/image.d.ts +1 -24
  15. package/dist/declarations/src/schema/keyOf.d.ts +14 -6
  16. package/dist/declarations/src/schema/literal.d.ts +1 -17
  17. package/dist/declarations/src/schema/locale.d.ts +1 -14
  18. package/dist/declarations/src/schema/number.d.ts +1 -17
  19. package/dist/declarations/src/schema/object.d.ts +1 -23
  20. package/dist/declarations/src/schema/record.d.ts +12 -6
  21. package/dist/declarations/src/schema/richtext.d.ts +1 -19
  22. package/dist/declarations/src/schema/route.d.ts +1 -17
  23. package/dist/declarations/src/schema/settings.d.ts +8 -12
  24. package/dist/declarations/src/schema/string.d.ts +1 -26
  25. package/dist/declarations/src/schema/view.d.ts +1 -20
  26. package/dist/{index-87b5aa27.cjs.prod.js → index-7d334094.cjs.prod.js} +319 -644
  27. package/dist/{index-8e33ef62.cjs.dev.js → index-90000f7a.cjs.dev.js} +319 -644
  28. package/dist/{index-36b5e0cb.esm.js → index-eb9f6480.esm.js} +319 -645
  29. package/dist/valbuild-core.cjs.dev.js +2 -1
  30. package/dist/valbuild-core.cjs.prod.js +2 -1
  31. package/dist/valbuild-core.esm.js +1 -1
  32. package/package.json +1 -1
  33. package/patch/dist/valbuild-core-patch.cjs.dev.js +1 -1
  34. package/patch/dist/valbuild-core-patch.cjs.prod.js +1 -1
  35. package/patch/dist/valbuild-core-patch.esm.js +2 -2
package/CHANGELOG.md CHANGED
@@ -1,5 +1,42 @@
1
1
  # @valbuild/core
2
2
 
3
+ ## 0.139.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [#780](https://github.com/valbuild/val/pull/780) [`db13bed`](https://github.com/valbuild/val/commit/db13bed902f9f9147feb5be07ce47fe8b5b143f9) Thanks [@freekh](https://github.com/freekh)! - When a new version of your site with a changed schema is deployed while Val Studio is open, the Studio now asks you to reload before you keep editing, instead of carrying on with the old schema.
8
+
9
+ ## 0.139.0
10
+
11
+ ### Minor Changes
12
+
13
+ - [#776](https://github.com/valbuild/val/pull/776) [`3eb5031`](https://github.com/valbuild/val/commit/3eb503167ae466ee586303c95efcc14665129481) Thanks [@freekh](https://github.com/freekh)! - **Breaking:** `.render({ as: "inline" })` now goes on the list, not on its items.
14
+
15
+ You now write `s.array(item).render({ as: "inline" })` and `s.record(item).render({ as: "inline" })`. Each item is then edited in its own row instead of in a preview row you click into. The list decides. The item schema stays reusable, and a page builder made of tagged blocks needs nothing on each block:
16
+
17
+ ```ts
18
+ // before
19
+ s.array(
20
+ s.discriminatedUnion(
21
+ "type",
22
+ hero.render({ as: "inline" }),
23
+ text.render({ as: "inline" }),
24
+ ),
25
+ );
26
+
27
+ // after
28
+ s.array(s.discriminatedUnion("type", hero, text)).render({ as: "inline" });
29
+ ```
30
+
31
+ What changed:
32
+
33
+ - Only `s.array()`, `s.record()` and `s.keyOf()` have `.render(...)` now. On every other schema the method is gone, so the old placement shows up as a type error. Move the render out one level.
34
+ - The render only affects the list's own items. A list nested inside one of those items keeps its default unless it has its own `.render`.
35
+ - `s.router()`, `s.imageset()` and `s.fileset()` throw if you give them a render, because pages and media have their own editors.
36
+ - `s.keyOf(...).render({ as: "inline" })` means the same as before: the selected entry's content is shown below the dropdown.
37
+
38
+ **Watch for one case that still compiles:** an array or record that is itself the item of another list. `s.record(s.array(s.string()).render({ as: "inline" }))` used to show the record's arrays inline. Now it shows each array's strings inline. To keep the old layout, write `s.record(s.array(s.string())).render({ as: "inline" })`.
39
+
3
40
  ## 0.138.2
4
41
 
5
42
  ### Patch Changes
@@ -85,6 +85,20 @@ export declare function computeSourcesSha(entries: readonly {
85
85
  path: string;
86
86
  source: unknown;
87
87
  }[]): string;
88
+ /**
89
+ * The `schemaSha` fold on its own: path and serialized schema, in `val.modules`
90
+ * order.
91
+ *
92
+ * Separate for the same reason as {@link computeSourcesSha}: the Studio folds
93
+ * the schemas of the bundle it is running and compares the answer with the
94
+ * `schemaSha` on `/stat`, which is how it learns that a new schema has been
95
+ * deployed under it. One implementation, so that comparison is between two
96
+ * runs of the same code.
97
+ */
98
+ export declare function computeSchemaSha(entries: readonly {
99
+ path: string;
100
+ serializedSchema: unknown;
101
+ }[]): string;
88
102
  export declare function computeValModuleShas(config: ValModules["config"], entries: readonly ValModuleShaEntry[], moduleErrors: readonly ExtractedModuleError[]): ValModuleShas;
89
103
  /**
90
104
  * Extracts schemas and sources from a ValModules registry and computes the
@@ -1,6 +1,6 @@
1
1
  export { initVal, type ConfigDirectory } from "./initVal.js";
2
2
  export { modules, type ValModules } from "./modules.js";
3
- export { extractValModules, computeValModuleShas, computeSourcesSha, type ExtractedValModules, type ValModuleShaEntry, type ValModuleShas, type ExtractedModuleError, } from "./extractValModules.js";
3
+ export { extractValModules, computeValModuleShas, computeSourcesSha, computeSchemaSha, type ExtractedValModules, type ValModuleShaEntry, type ValModuleShas, type ExtractedModuleError, } from "./extractValModules.js";
4
4
  export type { InitVal, ValConfig, ValConstructor, ContentConstructor, } from "./initVal.js";
5
5
  export { Schema, type SerializedSchema, type SelectorOfSchema } from "./schema/index.js";
6
6
  export { hasRemoteFileSchema, hasMediaSchema, } from "./schema/hasRemoteFileSchema.js";
@@ -26,9 +26,19 @@ import type { SerializedSchema } from "./schema/index.js";
26
26
  * description still previews as `#3` until someone writes the preview.
27
27
  */
28
28
  /**
29
- * A RENDER is how the FIELD ITSELF is laid out in the editor, and it applies
30
- * only when you are looking at the field: `.render({ as: "inline" })` on an
31
- * array/record item.
29
+ * A RENDER is how a field is laid out in the editor, and it applies only when
30
+ * you are looking at the field. It is declared by a CONTAINER about its
31
+ * children, never by a child about itself: `s.array(item).render({ as: "inline" })`
32
+ * and `s.record(item).render({ as: "inline" })`. The one other schema that takes
33
+ * a render is `s.keyOf(...)`, where it means something of its own (see
34
+ * `KeyOfSchema.render`).
35
+ *
36
+ * Why the container: inline is a property of the LIST — "my items are edited in
37
+ * their rows" — and the item schema is the wrong place to say it. An item can be
38
+ * reused in a list that wants preview rows and one that wants forms; a tagged
39
+ * union had to be declared inline on every variant (or on any one of them,
40
+ * which was worse); and a schema that was not an item carried a setting that
41
+ * did nothing. Putting it on the container makes all three go away.
32
42
  *
33
43
  * It is deliberately the ONE thing a render can say. What a string looks like
34
44
  * when it holds more than a line is the schema's own business — `.multiline()`
@@ -45,7 +55,7 @@ import type { SerializedSchema } from "./schema/index.js";
45
55
  *
46
56
  * A render is static configuration - plain data, with no closure behind it and
47
57
  * no dependency on source - which is why it lives in the SERIALIZED schema
48
- * (`SerializedStringSchema.render`) and is read straight off it where the field
58
+ * (`SerializedArraySchema.render`) and is read straight off it where the field
49
59
  * is drawn. There is no render pipeline, no store and no host round-trip.
50
60
  *
51
61
  * That "static" is an ASSUMPTION we are taking deliberately, for simplicity,
@@ -56,49 +66,42 @@ import type { SerializedSchema } from "./schema/index.js";
56
66
  * conflating them is what this file was split up to undo.
57
67
  */
58
68
  /**
59
- * `{ as: "inline" }` on a field that is the ITEM of an array or record: the
60
- * container renders the field itself inside each (sortable) row, instead of a
61
- * clickable preview row that navigates to it. This is what a page-builder list
62
- * is made of: `s.array(s.object({...}).render({ as: "inline" }))`.
69
+ * `{ as: "inline" }` on an array or record: the container renders each of its
70
+ * DIRECT items' own editor inside its (sortable) row, instead of a clickable
71
+ * preview row that navigates to it. This is what a page-builder list is made
72
+ * of: `s.array(s.discriminatedUnion("type", hero, text)).render({ as: "inline" })`.
73
+ *
74
+ * It reaches one level down and no further: in
75
+ * `s.array(s.object({ tags: s.array(s.string()) })).render({ as: "inline" })`
76
+ * the objects are inline and `tags` keeps its own default.
63
77
  *
64
- * On a field that is not directly under an array or record it is inert — an
65
- * object's fields are already laid out in place.
78
+ * Not available on `s.router(...)`, `s.imageset(...)` or `s.fileset(...)`:
79
+ * pages and media have UIs of their own, and `RecordSchema.render` throws there.
66
80
  *
67
- * Like every render it is static configuration (see the top of this file): it
68
- * travels whole in the serialized schema and the editor reads it straight off
69
- * the item schema it already has.
81
+ * On `s.keyOf(...)` the same value means something else: the selected entry's
82
+ * content is shown below the selector. That is the keyOf field's own layout,
83
+ * and is not read by any list.
70
84
  */
71
85
  export type InlineRender = {
72
86
  as: "inline";
73
87
  };
74
88
  /**
75
- * What `.render(...)` takes on every field, and what the serialized schema
76
- * carries verbatim.
89
+ * What `.render(...)` takes, and what the serialized schema carries verbatim.
77
90
  */
78
91
  export type FieldRender = InlineRender;
79
92
  /**
80
- * Is this item schema edited INSIDE its list row, rather than behind a
81
- * clickable preview row that navigates to it?
93
+ * Does this CONTAINER edit its items inside their list rows, rather than behind
94
+ * clickable preview rows that navigate to them?
95
+ *
96
+ * Pass the array or record — never the item. Anything else answers `false`,
97
+ * `s.keyOf` included: its render is about the keyOf field, not about a list.
82
98
  *
83
99
  * The one answer, so that the list rows, the nav-stop rule (`getNavPath`) and
84
100
  * the add buttons cannot drift apart — they are three readings of the same
85
101
  * question, and a disagreement between them is a row you can edit in place but
86
102
  * that "add" navigates away from.
87
103
  *
88
- * A discriminated union counts as inline when the union itself declares it OR
89
- * when ANY of its variants does. A page-builder list is
90
- * `s.array(s.discriminatedUnion("type", block, block, ...))` and the natural
91
- * place to write the render is on the blocks, one per block type — the union
92
- * is a dispatch, not something the
93
- * author thinks of as the field. `some` rather than `every` because the row
94
- * draws the union's own editor (the tag selector plus the matched variant's
95
- * fields), which handles every variant either way: with `every`, adding one
96
- * variant and forgetting its `.render` would silently turn the whole list back
97
- * into preview rows.
98
- *
99
- * This is the ONLY place a render is allowed to be read from anywhere but the
100
- * schema it was declared on. It stays static (see the top of this file): the
101
- * answer is a function of the serialized schema alone, never of the value the
102
- * row happens to hold.
104
+ * It stays static (see the top of this file): the answer is a function of the
105
+ * serialized schema alone, never of the value the row happens to hold.
103
106
  */
104
- export declare function isInlineRender(schema: SerializedSchema): boolean;
107
+ export declare function isInlineRender(container: SerializedSchema): boolean;
@@ -6,7 +6,10 @@ import { ModuleFilePath, SourcePath } from "../val/index.js";
6
6
  import { ValidationError, ValidationErrors } from "./validation/ValidationError.js";
7
7
  export type SerializedArraySchema = {
8
8
  type: "array";
9
- /** Static layout config, carried whole in the serialized schema — see `render.ts`. */
9
+ /**
10
+ * How this array lays out its ITEMS: `{ as: "inline" }` edits each one in
11
+ * its row. Static config, carried whole — see `render.ts`.
12
+ */
10
13
  render?: FieldRender;
11
14
  item: SerializedSchema;
12
15
  opt: boolean;
@@ -124,17 +127,19 @@ export declare class ArraySchema<T extends Schema<SelectorSource>, Src extends S
124
127
  */
125
128
  preview(select: ItemPreviewInput<Src>): ArraySchema<T, Src>;
126
129
  /**
127
- * How this field is laid out in the editor when it is the item of an array
128
- * or record: `{ as: "inline" }` renders the field itself inside each row,
129
- * instead of a preview row that navigates to it.
130
+ * How this array lays out its ITEMS in the editor: `{ as: "inline" }` draws
131
+ * each item's own editor inside its (sortable) row, instead of a preview row
132
+ * that navigates to it. It reaches the direct items only.
130
133
  *
131
134
  * Static configuration, not a callback — see `render.ts`.
132
135
  *
133
136
  * @example
134
- * const schema = s.record(s.array(s.string()).render({ as: "inline" }));
135
- * export default c.define("/example.val.ts", schema, {
136
- * "a-post": ["news", "release"],
137
- * });
137
+ * const schema = s
138
+ * .array(s.object({ title: s.string(), body: s.string() }))
139
+ * .render({ as: "inline" });
140
+ * export default c.define("/example.val.ts", schema, [
141
+ * { title: "Hello", body: "World" },
142
+ * ]);
138
143
  */
139
144
  render(input: FieldRender): ArraySchema<T, Src>;
140
145
  }
@@ -1,12 +1,9 @@
1
1
  import { CustomValidateFunction, Schema, SchemaAssertResult, SerializedSchema } from "./index.js";
2
2
  import { ItemPreviewInput, PreviewItem } from "../preview.js";
3
- import { FieldRender } from "../render.js";
4
3
  import { SourcePath } from "../val/index.js";
5
4
  import { ValidationError, ValidationErrors } from "./validation/ValidationError.js";
6
5
  export type SerializedBooleanSchema = {
7
6
  type: "boolean";
8
- /** Static layout config, carried whole in the serialized schema — see `render.ts`. */
9
- render?: FieldRender;
10
7
  /** Set when this schema declares a `preview`. The closure itself cannot serialize. */
11
8
  preview?: true;
12
9
  opt: boolean;
@@ -21,9 +18,8 @@ export declare class BooleanSchema<Src extends boolean | null> extends Schema<Sr
21
18
  private readonly isReadonly;
22
19
  private readonly isHidden;
23
20
  private readonly description?;
24
- private readonly renderInput;
25
21
  private readonly previewInput;
26
- constructor(opt?: boolean, customValidateFunctions?: CustomValidateFunction<Src>[], isReadonly?: boolean, isHidden?: boolean, description?: string | undefined, renderInput?: FieldRender | null, previewInput?: ItemPreviewInput<Src> | null);
22
+ constructor(opt?: boolean, customValidateFunctions?: CustomValidateFunction<Src>[], isReadonly?: boolean, isHidden?: boolean, description?: string | undefined, previewInput?: ItemPreviewInput<Src> | null);
27
23
  /**
28
24
  * Describe this field.
29
25
  *
@@ -69,18 +65,6 @@ export declare class BooleanSchema<Src extends boolean | null> extends Schema<Sr
69
65
  readonly(isReadonly?: boolean): BooleanSchema<Src>;
70
66
  hidden(isHidden?: boolean): BooleanSchema<Src>;
71
67
  protected executeCustomValidateAt(path: SourcePath, src: Src): ValidationError[];
72
- /**
73
- * How this field is laid out in the editor when it is the item of an array
74
- * or record: `{ as: "inline" }` renders the field itself inside each row,
75
- * instead of a preview row that navigates to it.
76
- *
77
- * Static configuration, not a callback — see `render.ts`.
78
- *
79
- * @example
80
- * const schema = s.array(s.boolean().render({ as: "inline" }));
81
- * export default c.define("/example.val.ts", schema, [true, false]);
82
- */
83
- render(input: FieldRender): BooleanSchema<Src>;
84
68
  /**
85
69
  * How this VALUE is shown where a preview of it is needed — a row in a
86
70
  * sortable list, a reference dropdown, a search hit. Never how the field
@@ -1,6 +1,5 @@
1
1
  import { CustomValidateFunction, Schema, SchemaAssertResult, SerializedSchema } from "./index.js";
2
2
  import { ItemPreviewInput, PreviewItem } from "../preview.js";
3
- import { FieldRender } from "../render.js";
4
3
  import { SourcePath } from "../val/index.js";
5
4
  import { RawString } from "./string.js";
6
5
  import { ValidationError, ValidationErrors } from "./validation/ValidationError.js";
@@ -26,8 +25,6 @@ export type CodeOptions = {
26
25
  };
27
26
  export type SerializedCodeSchema = {
28
27
  type: "code";
29
- /** Static layout config, carried whole in the serialized schema — see `render.ts`. */
30
- render?: FieldRender;
31
28
  /** Set when this schema declares a `preview`. The closure itself cannot serialize. */
32
29
  preview?: true;
33
30
  options?: CodeOptions;
@@ -52,9 +49,8 @@ export declare class CodeSchema<Src extends string | null> extends Schema<Src> {
52
49
  private readonly isReadonly;
53
50
  private readonly isHidden;
54
51
  private readonly description?;
55
- private readonly renderInput;
56
52
  private readonly previewInput;
57
- constructor(options?: CodeOptions | undefined, opt?: boolean, customValidateFunctions?: CustomValidateFunction<Src>[], isReadonly?: boolean, isHidden?: boolean, description?: string | undefined, renderInput?: FieldRender | null, previewInput?: ItemPreviewInput<Src> | null);
53
+ constructor(options?: CodeOptions | undefined, opt?: boolean, customValidateFunctions?: CustomValidateFunction<Src>[], isReadonly?: boolean, isHidden?: boolean, description?: string | undefined, previewInput?: ItemPreviewInput<Src> | null);
58
54
  /**
59
55
  * Describe this field.
60
56
  *
@@ -111,22 +107,6 @@ export declare class CodeSchema<Src extends string | null> extends Schema<Src> {
111
107
  nullable(): CodeSchema<Src | null>;
112
108
  readonly(isReadonly?: boolean): CodeSchema<Src>;
113
109
  hidden(isHidden?: boolean): CodeSchema<Src>;
114
- /**
115
- * How this field is laid out in the editor when it is the item of an array
116
- * or record: `{ as: "inline" }` renders the field itself inside each row,
117
- * instead of a preview row that navigates to it.
118
- *
119
- * Static configuration, not a callback — see `render.ts`.
120
- *
121
- * @example
122
- * const schema = s.array(
123
- * s.code({ language: "css" }).render({ as: "inline" }),
124
- * );
125
- * export default c.define("/example.val.ts", schema, [
126
- * ".hero { color: red; }",
127
- * ]);
128
- */
129
- render(input: FieldRender): CodeSchema<Src>;
130
110
  /**
131
111
  * How this VALUE is shown where a preview of it is needed — a row in a
132
112
  * sortable list, a reference dropdown, a search hit. Never how the field
@@ -1,6 +1,5 @@
1
1
  import { CustomValidateFunction, Schema, SchemaAssertResult, SerializedSchema } from "./index.js";
2
2
  import { ItemPreviewInput, PreviewItem } from "../preview.js";
3
- import { FieldRender } from "../render.js";
4
3
  import { SourcePath } from "../val/index.js";
5
4
  import { ColorFormat } from "./colorFormat.js";
6
5
  import { RawString } from "./string.js";
@@ -29,8 +28,6 @@ export type ColorOptions = {
29
28
  };
30
29
  export type SerializedColorSchema = {
31
30
  type: "color";
32
- /** Static layout config, carried whole in the serialized schema — see `render.ts`. */
33
- render?: FieldRender;
34
31
  /** Set when this schema declares a `preview`. The closure itself cannot serialize. */
35
32
  preview?: true;
36
33
  options?: ColorOptions;
@@ -47,9 +44,8 @@ export declare class ColorSchema<Src extends string | null> extends Schema<Src>
47
44
  private readonly isReadonly;
48
45
  private readonly isHidden;
49
46
  private readonly description?;
50
- private readonly renderInput;
51
47
  private readonly previewInput;
52
- constructor(options?: ColorOptions | undefined, opt?: boolean, customValidateFunctions?: CustomValidateFunction<Src>[], isReadonly?: boolean, isHidden?: boolean, description?: string | undefined, renderInput?: FieldRender | null, previewInput?: ItemPreviewInput<Src> | null);
48
+ constructor(options?: ColorOptions | undefined, opt?: boolean, customValidateFunctions?: CustomValidateFunction<Src>[], isReadonly?: boolean, isHidden?: boolean, description?: string | undefined, previewInput?: ItemPreviewInput<Src> | null);
53
49
  /**
54
50
  * Describe this field.
55
51
  *
@@ -101,20 +97,6 @@ export declare class ColorSchema<Src extends string | null> extends Schema<Src>
101
97
  nullable(): ColorSchema<Src | null>;
102
98
  readonly(isReadonly?: boolean): ColorSchema<Src>;
103
99
  hidden(isHidden?: boolean): ColorSchema<Src>;
104
- /**
105
- * How this field is laid out in the editor when it is the item of an array
106
- * or record: `{ as: "inline" }` renders the field itself inside each row,
107
- * instead of a preview row that navigates to it.
108
- *
109
- * Static configuration, not a callback — see `render.ts`.
110
- *
111
- * @example
112
- * const schema = s.array(s.color().render({ as: "inline" }));
113
- * export default c.define("/example.val.ts", schema, [
114
- * "hsl(217.22 91.22% 59.8%)",
115
- * ]);
116
- */
117
- render(input: FieldRender): ColorSchema<Src>;
118
100
  /**
119
101
  * How this VALUE is shown where a preview of it is needed — a row in a
120
102
  * sortable list, a reference dropdown, a search hit. Never how the field
@@ -1,6 +1,5 @@
1
1
  import { CustomValidateFunction, Schema, SchemaAssertResult, SerializedSchema } from "./index.js";
2
2
  import { ItemPreviewInput, PreviewItem } from "../preview.js";
3
- import { FieldRender } from "../render.js";
4
3
  import { SourcePath } from "../val/index.js";
5
4
  import { RawString } from "./string.js";
6
5
  import { ValidationError, ValidationErrors } from "./validation/ValidationError.js";
@@ -22,8 +21,6 @@ type DateOptions = {
22
21
  };
23
22
  export type SerializedDateSchema = {
24
23
  type: "date";
25
- /** Static layout config, carried whole in the serialized schema — see `render.ts`. */
26
- render?: FieldRender;
27
24
  /** Set when this schema declares a `preview`. The closure itself cannot serialize. */
28
25
  preview?: true;
29
26
  options?: DateOptions;
@@ -40,9 +37,8 @@ export declare class DateSchema<Src extends string | null> extends Schema<Src> {
40
37
  private readonly isReadonly;
41
38
  private readonly isHidden;
42
39
  private readonly description?;
43
- private readonly renderInput;
44
40
  private readonly previewInput;
45
- constructor(options?: DateOptions | undefined, opt?: boolean, customValidateFunctions?: CustomValidateFunction<Src>[], isReadonly?: boolean, isHidden?: boolean, description?: string | undefined, renderInput?: FieldRender | null, previewInput?: ItemPreviewInput<Src> | null);
41
+ constructor(options?: DateOptions | undefined, opt?: boolean, customValidateFunctions?: CustomValidateFunction<Src>[], isReadonly?: boolean, isHidden?: boolean, description?: string | undefined, previewInput?: ItemPreviewInput<Src> | null);
46
42
  /**
47
43
  * Describe this field.
48
44
  *
@@ -108,18 +104,6 @@ export declare class DateSchema<Src extends string | null> extends Schema<Src> {
108
104
  readonly(isReadonly?: boolean): DateSchema<Src>;
109
105
  hidden(isHidden?: boolean): DateSchema<Src>;
110
106
  protected executeCustomValidateAt(path: SourcePath, src: Src): ValidationError[];
111
- /**
112
- * How this field is laid out in the editor when it is the item of an array
113
- * or record: `{ as: "inline" }` renders the field itself inside each row,
114
- * instead of a preview row that navigates to it.
115
- *
116
- * Static configuration, not a callback — see `render.ts`.
117
- *
118
- * @example
119
- * const schema = s.array(s.date().render({ as: "inline" }));
120
- * export default c.define("/example.val.ts", schema, ["2025-06-01"]);
121
- */
122
- render(input: FieldRender): DateSchema<Src>;
123
107
  /**
124
108
  * How this VALUE is shown where a preview of it is needed — a row in a
125
109
  * sortable list, a reference dropdown, a search hit. Never how the field
@@ -1,6 +1,5 @@
1
1
  import { CustomValidateFunction, Schema, SchemaAssertResult, SerializedSchema } from "./index.js";
2
2
  import { ItemPreviewInput, PreviewItem } from "../preview.js";
3
- import { FieldRender } from "../render.js";
4
3
  import { SourcePath } from "../val/index.js";
5
4
  import { RawString } from "./string.js";
6
5
  import { ValidationError, ValidationErrors } from "./validation/ValidationError.js";
@@ -26,8 +25,6 @@ type DateTimeOptions = {
26
25
  };
27
26
  export type SerializedDateTimeSchema = {
28
27
  type: "dateTime";
29
- /** Static layout config, carried whole in the serialized schema — see `render.ts`. */
30
- render?: FieldRender;
31
28
  /** Set when this schema declares a `preview`. The closure itself cannot serialize. */
32
29
  preview?: true;
33
30
  options?: DateTimeOptions;
@@ -44,9 +41,8 @@ export declare class DateTimeSchema<Src extends string | null> extends Schema<Sr
44
41
  private readonly isReadonly;
45
42
  private readonly isHidden;
46
43
  private readonly description?;
47
- private readonly renderInput;
48
44
  private readonly previewInput;
49
- constructor(options?: DateTimeOptions | undefined, opt?: boolean, customValidateFunctions?: CustomValidateFunction<Src>[], isReadonly?: boolean, isHidden?: boolean, description?: string | undefined, renderInput?: FieldRender | null, previewInput?: ItemPreviewInput<Src> | null);
45
+ constructor(options?: DateTimeOptions | undefined, opt?: boolean, customValidateFunctions?: CustomValidateFunction<Src>[], isReadonly?: boolean, isHidden?: boolean, description?: string | undefined, previewInput?: ItemPreviewInput<Src> | null);
50
46
  /**
51
47
  * Describe this field.
52
48
  *
@@ -131,20 +127,6 @@ export declare class DateTimeSchema<Src extends string | null> extends Schema<Sr
131
127
  readonly(isReadonly?: boolean): DateTimeSchema<Src>;
132
128
  hidden(isHidden?: boolean): DateTimeSchema<Src>;
133
129
  protected executeCustomValidateAt(path: SourcePath, src: Src): ValidationError[];
134
- /**
135
- * How this field is laid out in the editor when it is the item of an array
136
- * or record: `{ as: "inline" }` renders the field itself inside each row,
137
- * instead of a preview row that navigates to it.
138
- *
139
- * Static configuration, not a callback — see `render.ts`.
140
- *
141
- * @example
142
- * const schema = s.array(s.datetime().render({ as: "inline" }));
143
- * export default c.define("/example.val.ts", schema, [
144
- * "2025-06-01T09:00:00.000Z",
145
- * ]);
146
- */
147
- render(input: FieldRender): DateTimeSchema<Src>;
148
130
  /**
149
131
  * How this VALUE is shown where a preview of it is needed — a row in a
150
132
  * sortable list, a reference dropdown, a search hit. Never how the field
@@ -1,6 +1,5 @@
1
1
  import { CustomValidateFunction, Schema, SchemaAssertResult } from "./index.js";
2
2
  import { ItemPreviewInput, PreviewItem, ReifiedPreview, PreviewScope } from "../preview.js";
3
- import { FieldRender } from "../render.js";
4
3
  import { SelectorSource } from "../selector/index.js";
5
4
  import { SourceObject } from "../source/index.js";
6
5
  import { ModuleFilePath, SourcePath } from "../val/index.js";
@@ -8,8 +7,6 @@ import { SerializedObjectSchema } from "./object.js";
8
7
  import { ValidationError, ValidationErrors } from "./validation/ValidationError.js";
9
8
  export type SerializedDiscriminatedUnionSchema = {
10
9
  type: "discriminated-union";
11
- /** Static layout config, carried whole in the serialized schema — see `render.ts`. */
12
- render?: FieldRender;
13
10
  /** Set when this schema declares a `preview`. The closure itself cannot serialize. */
14
11
  preview?: true;
15
12
  /** The name of the field every variant tags itself with. */
@@ -56,9 +53,8 @@ export declare class DiscriminatedUnionSchema<Key extends string, T extends Disc
56
53
  private readonly isReadonly;
57
54
  private readonly isHidden;
58
55
  private readonly description?;
59
- private readonly renderInput;
60
56
  private readonly previewInput;
61
- constructor(key: Key, items: T, opt?: boolean, customValidateFunctions?: CustomValidateFunction<Src>[], isReadonly?: boolean, isHidden?: boolean, description?: string | undefined, renderInput?: FieldRender | null, previewInput?: ItemPreviewInput<Src> | null);
57
+ constructor(key: Key, items: T, opt?: boolean, customValidateFunctions?: CustomValidateFunction<Src>[], isReadonly?: boolean, isHidden?: boolean, description?: string | undefined, previewInput?: ItemPreviewInput<Src> | null);
62
58
  /**
63
59
  * Describe this field.
64
60
  *
@@ -127,24 +123,6 @@ export declare class DiscriminatedUnionSchema<Key extends string, T extends Disc
127
123
  * them — a structural error `executeValidate` already reports.
128
124
  */
129
125
  private matchedVariant;
130
- /**
131
- * How this field is laid out in the editor when it is the item of an array
132
- * or record: `{ as: "inline" }` renders the field itself inside each row,
133
- * instead of a preview row that navigates to it.
134
- *
135
- * Static configuration, not a callback — see `render.ts`.
136
- *
137
- * @example
138
- * // A page builder: the row draws the tag selector and the matched
139
- * // variant's fields.
140
- * const hero = s.object({ type: s.literal("hero"), title: s.string() });
141
- * const text = s.object({ type: s.literal("text"), body: s.string() });
142
- * const block = s.discriminatedUnion("type", hero, text).render({ as: "inline" });
143
- * export default c.define("/example.val.ts", s.array(block), [
144
- * { type: "hero", title: "Hello" },
145
- * ]);
146
- */
147
- render(input: FieldRender): DiscriminatedUnionSchema<Key, T, Src>;
148
126
  /**
149
127
  * How this VALUE is shown where a preview of it is needed — a row in a
150
128
  * sortable list, a reference dropdown, a search hit. Never how the field
@@ -1,12 +1,9 @@
1
1
  import { CustomValidateFunction, Schema, SchemaAssertResult } from "./index.js";
2
2
  import { ItemPreviewInput, PreviewItem } from "../preview.js";
3
- import { FieldRender } from "../render.js";
4
3
  import { SourcePath } from "../val/index.js";
5
4
  import { ValidationError, ValidationErrors } from "./validation/ValidationError.js";
6
5
  export type SerializedEnumSchema = {
7
6
  type: "enum";
8
- /** Static layout config, carried whole in the serialized schema — see `render.ts`. */
9
- render?: FieldRender;
10
7
  /** Set when this schema declares a `preview`. The closure itself cannot serialize. */
11
8
  preview?: true;
12
9
  /**
@@ -36,7 +33,6 @@ export declare class EnumSchema<Src extends string | null> extends Schema<Src> {
36
33
  private readonly isReadonly;
37
34
  private readonly isHidden;
38
35
  private readonly description?;
39
- private readonly renderInput;
40
36
  private readonly previewInput;
41
37
  /**
42
38
  * Type-only marker: as a record key, this declares the key set.
@@ -47,7 +43,7 @@ export declare class EnumSchema<Src extends string | null> extends Schema<Src> {
47
43
  * cannot be a record key at all. See `LocaleSchema`.
48
44
  */
49
45
  readonly __declaresRecordKeys: true;
50
- constructor(values: readonly string[], opt?: boolean, customValidateFunctions?: CustomValidateFunction<Src>[], isReadonly?: boolean, isHidden?: boolean, description?: string | undefined, renderInput?: FieldRender | null, previewInput?: ItemPreviewInput<Src> | null);
46
+ constructor(values: readonly string[], opt?: boolean, customValidateFunctions?: CustomValidateFunction<Src>[], isReadonly?: boolean, isHidden?: boolean, description?: string | undefined, previewInput?: ItemPreviewInput<Src> | null);
51
47
  /**
52
48
  * Describe this field.
53
49
  *
@@ -94,20 +90,6 @@ export declare class EnumSchema<Src extends string | null> extends Schema<Src> {
94
90
  readonly(isReadonly?: boolean): EnumSchema<Src>;
95
91
  hidden(isHidden?: boolean): EnumSchema<Src>;
96
92
  protected executeCustomValidateAt(path: SourcePath, src: Src): ValidationError[];
97
- /**
98
- * How this field is laid out in the editor when it is the item of an array
99
- * or record: `{ as: "inline" }` renders the field itself inside each row,
100
- * instead of a preview row that navigates to it.
101
- *
102
- * Static configuration, not a callback — see `render.ts`.
103
- *
104
- * @example
105
- * const schema = s.array(
106
- * s.enum("draft", "published").render({ as: "inline" }),
107
- * );
108
- * export default c.define("/example.val.ts", schema, ["draft"]);
109
- */
110
- render(input: FieldRender): EnumSchema<Src>;
111
93
  /**
112
94
  * How this VALUE is shown where a preview of it is needed — a row in a
113
95
  * sortable list, a reference dropdown, a search hit. Never how the field
@@ -5,15 +5,12 @@ import { ModulePath, SourcePath } from "../val/index.js";
5
5
  import { ValidationError, ValidationErrors } from "./validation/ValidationError.js";
6
6
  import { ValModule } from "../index.js";
7
7
  import { ItemPreviewInput, PreviewItem } from "../preview.js";
8
- import { FieldRender } from "../render.js";
9
8
  import { FilesetEntryMetadata } from "./fileset.js";
10
9
  export type FileOptions = {
11
10
  accept?: string;
12
11
  };
13
12
  export type SerializedFileSchema = {
14
13
  type: "file";
15
- /** Static layout config, carried whole in the serialized schema — see `render.ts`. */
16
- render?: FieldRender;
17
14
  /** Set when this schema declares a `preview`. The closure itself cannot serialize. */
18
15
  preview?: true;
19
16
  options?: FileOptions;
@@ -34,9 +31,8 @@ export declare class FileSchema<Src extends FileSource | null> extends Schema<Sr
34
31
  private readonly isReadonly;
35
32
  private readonly isHidden;
36
33
  private readonly description?;
37
- private readonly renderInput;
38
34
  private readonly previewInput;
39
- constructor(options?: FileOptions | undefined, opt?: boolean, isRemote?: boolean, customValidateFunctions?: CustomValidateFunction<Src>[], moduleMetadata?: Record<ModulePath, Record<string, FilesetEntryMetadata>>, isReadonly?: boolean, isHidden?: boolean, description?: string | undefined, renderInput?: FieldRender | null, previewInput?: ItemPreviewInput<Src> | null);
35
+ constructor(options?: FileOptions | undefined, opt?: boolean, isRemote?: boolean, customValidateFunctions?: CustomValidateFunction<Src>[], moduleMetadata?: Record<ModulePath, Record<string, FilesetEntryMetadata>>, isReadonly?: boolean, isHidden?: boolean, description?: string | undefined, previewInput?: ItemPreviewInput<Src> | null);
40
36
  /**
41
37
  * Describe this field.
42
38
  *
@@ -117,20 +113,6 @@ export declare class FileSchema<Src extends FileSource | null> extends Schema<Sr
117
113
  readonly(isReadonly?: boolean): FileSchema<Src>;
118
114
  hidden(isHidden?: boolean): FileSchema<Src>;
119
115
  protected executeCustomValidateAt(path: SourcePath, src: Src): ValidationError[];
120
- /**
121
- * How this field is laid out in the editor when it is the item of an array
122
- * or record: `{ as: "inline" }` renders the field itself inside each row,
123
- * instead of a preview row that navigates to it.
124
- *
125
- * Static configuration, not a callback — see `render.ts`.
126
- *
127
- * @example
128
- * const schema = s.array(s.file().render({ as: "inline" }));
129
- * export default c.define("/example.val.ts", schema, [
130
- * { path: "/public/val/example.pdf", mimeType: "application/pdf" },
131
- * ]);
132
- */
133
- render(input: FieldRender): FileSchema<Src>;
134
116
  /**
135
117
  * How this VALUE is shown where a preview of it is needed — a row in a
136
118
  * sortable list, a reference dropdown, a search hit. Never how the field