@voltro/client 0.52.0 → 0.54.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.
@@ -5,7 +5,7 @@ property of its respective copyright holders and is used under the terms of
5
5
  its license. This file is provided for attribution; it grants no rights in
6
6
  @voltro/client itself, which is proprietary (see LICENSE).
7
7
 
8
- Generated from the resolved runtime dependency closure (6 packages).
8
+ Generated from the resolved runtime dependency closure (12 packages).
9
9
 
10
10
  ---
11
11
 
@@ -37,6 +37,146 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
37
37
  SOFTWARE.
38
38
  ```
39
39
 
40
+ ## @tanstack/devtools-event-client@0.4.4
41
+
42
+ License: MIT
43
+
44
+ ```
45
+ MIT License
46
+
47
+ Copyright (c) 2025 TanStack
48
+
49
+ Permission is hereby granted, free of charge, to any person obtaining a copy
50
+ of this software and associated documentation files (the "Software"), to deal
51
+ in the Software without restriction, including without limitation the rights
52
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
53
+ copies of the Software, and to permit persons to whom the Software is
54
+ furnished to do so, subject to the following conditions:
55
+
56
+ The above copyright notice and this permission notice shall be included in all
57
+ copies or substantial portions of the Software.
58
+
59
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
60
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
61
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
62
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
63
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
64
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
65
+ SOFTWARE.
66
+ ```
67
+
68
+ ## @tanstack/form-core@1.33.5
69
+
70
+ License: MIT
71
+
72
+ ```
73
+ MIT License
74
+
75
+ Copyright (c) 2021-present Tanner Linsley
76
+
77
+ Permission is hereby granted, free of charge, to any person obtaining a copy
78
+ of this software and associated documentation files (the "Software"), to deal
79
+ in the Software without restriction, including without limitation the rights
80
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
81
+ copies of the Software, and to permit persons to whom the Software is
82
+ furnished to do so, subject to the following conditions:
83
+
84
+ The above copyright notice and this permission notice shall be included in all
85
+ copies or substantial portions of the Software.
86
+
87
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
88
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
89
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
90
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
91
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
92
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
93
+ SOFTWARE.
94
+ ```
95
+
96
+ ## @tanstack/pacer-lite@0.1.1
97
+
98
+ License: MIT
99
+
100
+ ```
101
+ MIT License
102
+
103
+ Copyright (c) 2025 Tanner Linsley
104
+
105
+ Permission is hereby granted, free of charge, to any person obtaining a copy
106
+ of this software and associated documentation files (the "Software"), to deal
107
+ in the Software without restriction, including without limitation the rights
108
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
109
+ copies of the Software, and to permit persons to whom the Software is
110
+ furnished to do so, subject to the following conditions:
111
+
112
+ The above copyright notice and this permission notice shall be included in all
113
+ copies or substantial portions of the Software.
114
+
115
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
116
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
117
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
118
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
119
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
120
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
121
+ SOFTWARE.
122
+ ```
123
+
124
+ ## @tanstack/react-store@0.11.1
125
+
126
+ License: MIT
127
+
128
+ ```
129
+ MIT License
130
+
131
+ Copyright (c) 2021 Tanner Linsley
132
+
133
+ Permission is hereby granted, free of charge, to any person obtaining a copy
134
+ of this software and associated documentation files (the "Software"), to deal
135
+ in the Software without restriction, including without limitation the rights
136
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
137
+ copies of the Software, and to permit persons to whom the Software is
138
+ furnished to do so, subject to the following conditions:
139
+
140
+ The above copyright notice and this permission notice shall be included in all
141
+ copies or substantial portions of the Software.
142
+
143
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
144
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
145
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
146
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
147
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
148
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
149
+ SOFTWARE.
150
+ ```
151
+
152
+ ## @tanstack/store@0.11.1
153
+
154
+ License: MIT
155
+
156
+ ```
157
+ MIT License
158
+
159
+ Copyright (c) 2021 Tanner Linsley
160
+
161
+ Permission is hereby granted, free of charge, to any person obtaining a copy
162
+ of this software and associated documentation files (the "Software"), to deal
163
+ in the Software without restriction, including without limitation the rights
164
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
165
+ copies of the Software, and to permit persons to whom the Software is
166
+ furnished to do so, subject to the following conditions:
167
+
168
+ The above copyright notice and this permission notice shall be included in all
169
+ copies or substantial portions of the Software.
170
+
171
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
172
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
173
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
174
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
175
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
176
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
177
+ SOFTWARE.
178
+ ```
179
+
40
180
  ## jose@6.2.8
41
181
 
42
182
  License: MIT
@@ -329,6 +469,34 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
329
469
  SOFTWARE.
330
470
  ```
331
471
 
472
+ ## use-sync-external-store@1.6.0
473
+
474
+ License: MIT
475
+
476
+ ```
477
+ MIT License
478
+
479
+ Copyright (c) Meta Platforms, Inc. and affiliates.
480
+
481
+ Permission is hereby granted, free of charge, to any person obtaining a copy
482
+ of this software and associated documentation files (the "Software"), to deal
483
+ in the Software without restriction, including without limitation the rights
484
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
485
+ copies of the Software, and to permit persons to whom the Software is
486
+ furnished to do so, subject to the following conditions:
487
+
488
+ The above copyright notice and this permission notice shall be included in all
489
+ copies or substantial portions of the Software.
490
+
491
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
492
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
493
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
494
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
495
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
496
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
497
+ SOFTWARE.
498
+ ```
499
+
332
500
  ## uuid@11.1.1
333
501
 
334
502
  License: MIT
package/dist/form.d.ts CHANGED
@@ -1,5 +1,17 @@
1
+ import { ParseResult } from 'effect';
1
2
  import { Schema } from 'effect';
2
3
 
4
+ /**
5
+ * Walk a ParseError's issue tree into structured, PATH-PRESERVING issues.
6
+ * Every leaf keeps its full path (`address.city`, `entries.0.startsAt`) —
7
+ * nothing collapses to the top-level segment.
8
+ */
9
+ export declare const decodeFieldIssues: (error: ParseResult.ParseError) => ReadonlyArray<FieldIssue>;
10
+
11
+ /** The document's locale per the framework contract (`<html lang>`); `'en'`
12
+ * outside a browser. Primary subtag only (`de-AT` → `de`). */
13
+ export declare const documentLocale: () => string;
14
+
3
15
  export declare interface FieldDescriptor {
4
16
  /** Property name on the input object. */
5
17
  readonly name: string;
@@ -16,17 +28,56 @@ export declare interface FieldDescriptor {
16
28
  /** The resolved JSON-Schema node — carries `maxLength` / `pattern` /
17
29
  * `minimum` / `format` / `description` for widgets + validation hints. */
18
30
  readonly jsonSchema: Readonly<Record<string, unknown>>;
31
+ /** Dotted parent path for a nested-struct member (`'address'` for
32
+ * `address.city`) — the SECTION a renderer groups it under. Top-level
33
+ * fields carry none. Overridable via `formField({ section })`. */
34
+ readonly section?: string;
35
+ /** Human label for the section (humanised path tail). */
36
+ readonly sectionLabel?: string;
37
+ /** Help text — the Schema `description` annotation. */
38
+ readonly description?: string;
39
+ /** Declared ordering (`formField({ order })`); fields sort by it, stable
40
+ * against declaration order. */
41
+ readonly order?: number;
42
+ /** For `widget: 'array'` (array of structs): the ITEM's field descriptors,
43
+ * names relative to one item (`startsAt`, not `entries.0.startsAt`). */
44
+ readonly item?: ReadonlyArray<FieldDescriptor>;
45
+ /** For `widget: 'reference'`: the referenced TABLE — a renderer binds a
46
+ * query-backed picker to it; the VALUE stays the id (or id list). Comes
47
+ * from `formField({ reference: 'stores' })`. */
48
+ readonly reference?: string;
19
49
  }
20
50
 
21
51
  export declare interface FieldErrors {
22
52
  readonly [field: string]: string;
23
53
  }
24
54
 
55
+ /** One structured validation issue. `path` is the dotted field path
56
+ * (`'email'`, `'address.city'`, `'entries.0.startsAt'`); `id` is the stable
57
+ * message id (`'validation.minLength'`); `params` feed its template;
58
+ * `fallback` is a rendered English default so an unknown id still shows a
59
+ * sentence, never a bare key. */
60
+ export declare interface FieldIssue {
61
+ readonly path: string;
62
+ readonly id: string;
63
+ readonly params?: Readonly<Record<string, unknown>>;
64
+ readonly fallback: string;
65
+ }
66
+
25
67
  export declare interface FieldOption {
26
68
  readonly value: string;
27
69
  readonly label: string;
28
70
  }
29
71
 
72
+ /** One display section of a form: `name` is the section path (`'address'`),
73
+ * `undefined` for the top-level run of unsectioned fields. Contiguous in
74
+ * display order, so a renderer can walk sections top to bottom. */
75
+ export declare interface FieldSection {
76
+ readonly name: string | undefined;
77
+ readonly label: string | undefined;
78
+ readonly fields: ReadonlyArray<FieldDescriptor>;
79
+ }
80
+
30
81
  /** DOM id of the JSON script the 422 re-render embeds (survives the
31
82
  * `interactive:'none'` strip — it is neither `type="module"` nor `src`). */
32
83
  export declare const FORM_FLASH_SCRIPT_ID = "__voltro_form_flash__";
@@ -68,6 +119,27 @@ export declare const formDataToInput: (schema: Schema.Schema.Any, entries: Itera
68
119
  * uploads are a declared limit of the no-JS path. */
69
120
  export declare type FormEntry = readonly [name: string, value: string];
70
121
 
122
+ /** UI metadata for one schema field, as an annotations object:
123
+ *
124
+ * Schema.String.annotations(formField({ section: 'contact', order: 2 }))
125
+ *
126
+ * Rides the JSON-Schema annotation (merged, not replaced — verified), so it
127
+ * survives the same normalisation every other descriptor fact does. */
128
+ export declare const formField: (meta: {
129
+ readonly label?: string;
130
+ readonly section?: string;
131
+ readonly order?: number;
132
+ readonly widget?: WidgetKind;
133
+ /** Mark the field a REFERENCE to a table: `formField({ reference: 'stores' })`
134
+ * → `widget: 'reference'` carrying the target, value = the id (or id
135
+ * list, for a multi-reference feeding a target's `relations:`). */
136
+ readonly reference?: string;
137
+ }) => {
138
+ readonly jsonSchema: {
139
+ readonly "x-voltro": typeof meta;
140
+ };
141
+ };
142
+
71
143
  /**
72
144
  * The error/values payload a failed no-JS form POST carries back into the
73
145
  * 422 re-render. Keyed by `formKey` so a page with several forms re-fills
@@ -87,6 +159,21 @@ export declare interface FormFlashPayload {
87
159
  readonly formError?: string;
88
160
  }
89
161
 
162
+ /**
163
+ * Group an ordered field list into contiguous sections — the structure a
164
+ * form (or its skeleton — the placeholder must have the SHAPE of the real
165
+ * thing, title rows included) renders. Pure; feeds `<FormSkeleton>`,
166
+ * `<AutoForm>` layouts and `form.section(...)` alike.
167
+ */
168
+ export declare const formSections: (fields: ReadonlyArray<FieldDescriptor>) => ReadonlyArray<FieldSection>;
169
+
170
+ /**
171
+ * Render one issue id to display text: app resolver first (its `undefined`
172
+ * falls through), then the built-in catalog for the locale's primary subtag,
173
+ * then English, then the issue's own fallback sentence.
174
+ */
175
+ export declare const resolveValidationMessage: (issue: Pick<FieldIssue, "id" | "params" | "fallback">, options?: ValidateOptions) => string;
176
+
90
177
  /**
91
178
  * Derive table COLUMNS from a query's output `Schema` — an
92
179
  * `Schema.Array(Schema.Struct({...}))`. Drills into the array's element and maps
@@ -103,25 +190,39 @@ export declare const schemaToColumns: (schema: Schema.Schema.Any) => ReadonlyArr
103
190
  export declare const schemaToFields: (schema: Schema.Schema.Any) => ReadonlyArray<FieldDescriptor>;
104
191
 
105
192
  /**
106
- * Validate `values` against an input `schema`, returning the first error per
107
- * top-level field (`{ [field]: message }`) the shape `<AutoForm>` and custom
108
- * widgets render inline. Uses the same `decodeUnknownEither` + `ArrayFormatter`
109
- * path the store's `.validate(...)` uses, so client and server speak ONE
110
- * schema. `{ errors: 'all' }` collects every field's error in one pass.
111
- *
112
- * Client-side validation is non-authoritative UX — the server re-validates the
113
- * same schema on the mutation; this just gives instant inline feedback.
193
+ * Validate `values` against an input `schema`. Uses the same
194
+ * `decodeUnknownEither` path the store's `.validate(...)` uses, so client and
195
+ * server speak ONE schema; `{ errors: 'all' }` collects every field in one
196
+ * pass. Client-side validation is non-authoritative UX the server
197
+ * re-validates the same schema on the mutation.
114
198
  */
115
- export declare const validateFields: (schema: Schema.Schema.Any, values: unknown) => ValidationResult;
199
+ export declare const validateFields: (schema: Schema.Schema.Any, values: unknown, options?: ValidateOptions) => ValidationResult;
200
+
201
+ export declare interface ValidateOptions {
202
+ /** BCP-47-ish tag; only the primary subtag is read. Default: the document's
203
+ * `<html lang>`, else `'en'`. */
204
+ readonly locale?: string;
205
+ readonly messages?: ValidationMessageResolver;
206
+ }
207
+
208
+ /** Resolve one message id to display text. Return `undefined` to fall through
209
+ * to the built-in en/de defaults — so a resolver only has to know the ids it
210
+ * overrides. Wire it to `@voltro/i18n` in one line:
211
+ * `messages: (id, params) => t(id, params)`. */
212
+ export declare type ValidationMessageResolver = (id: string, params: Readonly<Record<string, unknown>> | undefined, fallback: string) => string | undefined;
116
213
 
117
214
  export declare interface ValidationResult {
118
215
  readonly valid: boolean;
216
+ /** Display text per field path — what `<AutoForm>` and custom widgets
217
+ * render inline. First issue per field wins. */
119
218
  readonly errors: FieldErrors;
219
+ /** Every issue, structured — for widget kits that translate themselves. */
220
+ readonly issues: ReadonlyArray<FieldIssue>;
120
221
  }
121
222
 
122
223
  /** The default widget kinds the framework can render from a schema. `'custom'`
123
224
  * means "no default widget" — the field needs a render-prop (a nested object,
124
225
  * an array of objects, or a multi-branch union). Mirrors innovation/01's set. */
125
- export declare type WidgetKind = 'text' | 'textarea' | 'number' | 'checkbox' | 'switch' | 'select' | 'radio' | 'async-select' | 'multi-select' | 'date' | 'datetime' | 'daterange' | 'file' | 'hidden' | 'custom';
226
+ export declare type WidgetKind = 'text' | 'textarea' | 'number' | 'checkbox' | 'switch' | 'select' | 'radio' | 'async-select' | 'multi-select' | 'date' | 'datetime' | 'daterange' | 'file' | 'hidden' | 'array' | 'reference' | 'custom';
126
227
 
127
228
  export { }
package/dist/form.js CHANGED
@@ -1,2 +1,2 @@
1
- import { a as e, c as t, i as n, l as r, n as i, o as a, r as o, s, t as c } from "./formData-Bw07C0wr.js";
2
- export { c as FORM_FLASH_SCRIPT_ID, i as FORM_KEY_FIELD, o as FORM_PATH_PREFIX, n as FORM_REDIRECT_FIELD, e as formActionPath, a as formDataToInput, t as schemaToColumns, r as schemaToFields, s as validateFields };
1
+ import { a as e, c as t, d as n, f as r, i, l as a, m as o, n as s, o as c, p as l, r as u, s as d, t as f, u as p } from "./formData-BO7zkG_F.js";
2
+ export { f as FORM_FLASH_SCRIPT_ID, s as FORM_KEY_FIELD, u as FORM_PATH_PREFIX, i as FORM_REDIRECT_FIELD, d as decodeFieldIssues, t as documentLocale, e as formActionPath, c as formDataToInput, n as formField, r as formSections, a as resolveValidationMessage, l as schemaToColumns, o as schemaToFields, p as validateFields };