@texaryn/solid 0.0.0-stage → 0.3.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.
package/CHANGELOG.md ADDED
@@ -0,0 +1,33 @@
1
+ # @texaryn/solid
2
+
3
+ ## 0.3.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 3e79b3e: FormRoot now renders the UI tree without creating a native form. Consumers own
8
+ the form element and connect its submit event to the runtime.
9
+ - 3e79b3e: Give every renderer one localized validation message contract and normalize
10
+ adapter parameters so built-in widgets do not display evaluator diagnostics.
11
+
12
+ ### Patch Changes
13
+
14
+ - Updated dependencies [35cb55f]
15
+ - Updated dependencies [3e79b3e]
16
+ - @texaryn/core@0.16.0
17
+
18
+ ## 0.2.0
19
+
20
+ ### Minor Changes
21
+
22
+ - 2c2786f: Add a standalone version 2 display document runtime, semantic renderer roots, bounded server update sessions, and validated host action arguments.
23
+ - 2c2786f: Add native drag reorder to every array renderer while retaining the existing accessible move controls.
24
+
25
+ ### Patch Changes
26
+
27
+ - Updated dependencies [2c2786f]
28
+ - Updated dependencies [2c2786f]
29
+ - @texaryn/core@0.15.0
30
+
31
+ ## 0.1.0
32
+
33
+ Initial SolidJS renderer package.
package/LICENSE ADDED
@@ -0,0 +1,190 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to the Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by the Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding any notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ Copyright 2024-2026 Hamza Hamidi
179
+
180
+ Licensed under the Apache License, Version 2.0 (the "License");
181
+ you may not use this file except in compliance with the License.
182
+ You may obtain a copy of the License at
183
+
184
+ http://www.apache.org/licenses/LICENSE-2.0
185
+
186
+ Unless required by applicable law or agreed to in writing, software
187
+ distributed under the License is distributed on an "AS IS" BASIS,
188
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
189
+ See the License for the specific language governing permissions and
190
+ limitations under the License.
package/README.md CHANGED
@@ -1,3 +1,44 @@
1
- # Temporary Holding Version
1
+ # @texaryn/solid
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ SolidJS bindings and default widgets for Texaryn forms.
4
+
5
+ ```tsx
6
+ import { render } from 'solid-js/web'
7
+ import { createJsonSchemaAdapter } from '@texaryn/schema-json'
8
+ import { createForm, createDefaultRegistry, FormRoot } from '@texaryn/solid'
9
+
10
+ const schema = await createJsonSchemaAdapter({
11
+ type: 'object',
12
+ properties: {
13
+ name: { type: 'string', title: 'Name' },
14
+ },
15
+ })
16
+ const form = createForm(schema, { initialData: { name: '' } })
17
+ function submit(event: SubmitEvent) {
18
+ event.preventDefault()
19
+ form.dispatch({ type: 'Submit' })
20
+ }
21
+
22
+ render(
23
+ () => (
24
+ <form noValidate onSubmit={submit}>
25
+ <FormRoot form={form} registry={createDefaultRegistry()} showErrorSummary />
26
+ <button type="submit">Submit</button>
27
+ </form>
28
+ ),
29
+ document.getElementById('app')!,
30
+ )
31
+ ```
32
+
33
+ `FormRoot` renders the tree only. The application owns the native `<form>` and
34
+ connects its submit event to the runtime, so the tree can also be composed
35
+ inside a larger form.
36
+
37
+ `FormRoot` owns the runtime by default and destroys it when the Solid owner is
38
+ disposed. Set `destroyOnUnmount={false}` when another owner manages the runtime.
39
+ The default registry renders fields, object groups, arrays, validation messages,
40
+ and projection boundary actions. Use `useStore` to subscribe to a Texaryn store
41
+ inside an owned Solid scope, and `useFormContext` to access the active form,
42
+ registry, messages, and document.
43
+
44
+ Solid 1.9 or later is a peer dependency.
@@ -0,0 +1,13 @@
1
+ import type { Component, JSX } from 'solid-js';
2
+ import type { DocumentNode, DocumentRuntime, RendererRegistry } from '@texaryn/core';
3
+ export type DocumentWidgetComponent = Component<{
4
+ node: DocumentNode;
5
+ runtime: DocumentRuntime;
6
+ }>;
7
+ export interface DocumentRootProps {
8
+ runtime: DocumentRuntime;
9
+ registry?: RendererRegistry<DocumentWidgetComponent, DocumentNode>;
10
+ onActionError?: (error: unknown) => void;
11
+ children?: JSX.Element;
12
+ }
13
+ export declare function DocumentRoot(props: DocumentRootProps): JSX.Element;
@@ -0,0 +1,3 @@
1
+ export declare function ErrorSummary(props: {
2
+ focus?: boolean;
3
+ }): import("solid-js").JSX.Element;
@@ -0,0 +1,5 @@
1
+ import type { ValidationError } from '@texaryn/core';
2
+ export declare function FieldErrors(props: {
3
+ id: string;
4
+ errors: readonly ValidationError[];
5
+ }): import("solid-js").JSX.Element;
@@ -0,0 +1,15 @@
1
+ import type { JSX } from 'solid-js';
2
+ import type { FormMessages, FormRuntime, RendererRegistry } from '@texaryn/core';
3
+ import type { WidgetComponent } from '../widget.js';
4
+ export interface FormRootProps {
5
+ form: FormRuntime;
6
+ registry?: RendererRegistry<WidgetComponent>;
7
+ messages?: FormMessages;
8
+ idPrefix?: string;
9
+ destroyOnUnmount?: boolean;
10
+ showErrorSummary?: boolean;
11
+ summaryFocus?: boolean;
12
+ children?: JSX.Element;
13
+ }
14
+ /** Renders the UI document tree. The consumer owns any native form element and submit handler. */
15
+ export declare function FormRoot(props: FormRootProps): JSX.Element;
@@ -0,0 +1,4 @@
1
+ import type { UINode } from '@texaryn/core';
2
+ export declare function NodeRenderer(props: {
3
+ node: UINode;
4
+ }): import("solid-js").JSX.Element;
@@ -0,0 +1,12 @@
1
+ import type { Accessor } from 'solid-js';
2
+ import type { FormMessages, FormRuntime, RendererRegistry, UIDocument } from '@texaryn/core';
3
+ import type { WidgetComponent } from './widget.js';
4
+ export interface SolidFormContext {
5
+ form: Accessor<FormRuntime>;
6
+ document: Accessor<UIDocument>;
7
+ registry: Accessor<RendererRegistry<WidgetComponent>>;
8
+ messages: Accessor<FormMessages>;
9
+ idPrefix: Accessor<string>;
10
+ }
11
+ export declare const FormContext: import("solid-js").Context<SolidFormContext | undefined>;
12
+ export declare function useFormContext(): SolidFormContext;
@@ -0,0 +1,25 @@
1
+ import type { Accessor } from 'solid-js';
2
+ import type { FieldNode, NodeId, ValidationError } from '@texaryn/core';
3
+ export declare function createFieldBinding(nodeId: Accessor<NodeId>): {
4
+ node: Accessor<FieldNode | undefined>;
5
+ value: Accessor<unknown>;
6
+ errors: Accessor<ValidationError[]>;
7
+ visibleErrors: Accessor<ValidationError[]>;
8
+ dirty: Accessor<boolean>;
9
+ touched: Accessor<boolean>;
10
+ visible: Accessor<boolean>;
11
+ disabled: Accessor<boolean>;
12
+ showErrors: Accessor<boolean>;
13
+ label: Accessor<string>;
14
+ description: Accessor<string | undefined>;
15
+ inputId: Accessor<string>;
16
+ descriptionId: Accessor<string>;
17
+ errorId: Accessor<string>;
18
+ invalid: Accessor<boolean>;
19
+ describedBy: Accessor<string | undefined>;
20
+ display: Accessor<string | number>;
21
+ setRaw: (raw: string, enumIndex?: string) => void;
22
+ setValue: (next: unknown) => void;
23
+ onBlur: () => void;
24
+ };
25
+ export declare const useField: typeof createFieldBinding;
package/dist/form.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ import type { FormRuntime, FormRuntimeOptions, SchemaEvaluationPort } from '@texaryn/core';
2
+ export declare function createForm(port: SchemaEvaluationPort, options?: FormRuntimeOptions): FormRuntime;
@@ -0,0 +1,17 @@
1
+ export { createForm } from './form.js';
2
+ export { useStore } from './store.js';
3
+ export { useField } from './field.js';
4
+ export { useFormContext, FormContext } from './context.js';
5
+ export type { SolidFormContext } from './context.js';
6
+ export type { WidgetComponent } from './widget.js';
7
+ export { createDefaultRegistry } from './registry.js';
8
+ export { FormRoot } from './components/FormRoot.js';
9
+ export type { FormRootProps } from './components/FormRoot.js';
10
+ export { DocumentRoot } from './components/DocumentRoot.js';
11
+ export type { DocumentRootProps, DocumentWidgetComponent } from './components/DocumentRoot.js';
12
+ export { NodeRenderer } from './components/NodeRenderer.js';
13
+ export { FieldErrors } from './components/FieldErrors.js';
14
+ export { ErrorSummary } from './components/ErrorSummary.js';
15
+ export { FieldWidget } from './widgets/FieldWidget.js';
16
+ export { ObjectLayout } from './widgets/ObjectLayout.js';
17
+ export { ArrayControl } from './widgets/ArrayControl.js';
package/dist/index.js ADDED
@@ -0,0 +1,868 @@
1
+ import { createFormRuntime as pe, visibleFieldLabel as ve, objectChildKey as re, createRendererRegistry as $e, createFailedSubmitTracker as be, visibleErrorLabel as _e, visibleErrorMessages as we, englishMessages as xe } from "@texaryn/core";
2
+ import { createSignal as z, createEffect as q, onCleanup as K, createContext as le, useContext as ce, createMemo as b, Show as x, For as E, Switch as Te, Match as j, createUniqueId as Ie } from "solid-js";
3
+ import { createComponent as a, Dynamic as ue, memo as C, delegateEvents as G, use as de, insert as c, setAttribute as k, effect as A, template as $, spread as L, mergeProps as U } from "solid-js/web";
4
+ function ht(t, e) {
5
+ return pe(t, e);
6
+ }
7
+ function V(t) {
8
+ const [e, n] = z(t().getSnapshot(), { equals: !1 });
9
+ return q(() => {
10
+ const o = t();
11
+ n(() => o.getSnapshot()), K(o.subscribe(() => n(() => o.getSnapshot())));
12
+ }), e;
13
+ }
14
+ const ge = le();
15
+ function F() {
16
+ const t = ce(ge);
17
+ if (!t) throw new Error("Solid form widgets must be rendered below FormRoot");
18
+ return t;
19
+ }
20
+ const ne = [];
21
+ function W(t, e, n) {
22
+ return `${t}-${e}-${n}`;
23
+ }
24
+ function me(t) {
25
+ const e = F(), n = b(() => {
26
+ const s = e.document().nodes[t()];
27
+ return s?.type === "field" ? s : void 0;
28
+ });
29
+ function o(s, l) {
30
+ const [v, I] = z(l, { equals: !1 });
31
+ return q(() => {
32
+ const O = s(t());
33
+ if (!O) {
34
+ I(() => l);
35
+ return;
36
+ }
37
+ I(() => O.getSnapshot()), K(O.subscribe(() => I(() => O.getSnapshot())));
38
+ }), v;
39
+ }
40
+ const h = o((s) => e.form().getNodeState(s)?.value, void 0), u = o((s) => e.form().getNodeState(s)?.errors, ne), m = o((s) => e.form().getNodeState(s)?.dirty, !1), w = o((s) => e.form().getNodeState(s)?.touched, !1), d = o((s) => e.form().getNodeState(s)?.visible, !0), g = o((s) => e.form().getNodeState(s)?.disabled, !1), r = o((s) => e.form().getNodeState(s)?.showErrors, !1), f = b(() => r() ? u() : ne), i = b(() => {
41
+ const s = n();
42
+ return s ? ve(s.annotations.title, s.dataPointer, e.messages()) : "";
43
+ }), y = b(() => n()?.helpText ?? n()?.annotations.description), T = b(() => W(e.idPrefix(), n()?.id ?? t(), "input")), p = b(() => W(e.idPrefix(), n()?.id ?? t(), "description")), _ = b(() => W(e.idPrefix(), n()?.id ?? t(), "error")), S = b(() => f().length > 0), D = b(() => [
44
+ y() ? p() : void 0,
45
+ S() ? _() : void 0
46
+ ].filter(Boolean).join(" ") || void 0), N = b(() => {
47
+ const s = h();
48
+ return typeof s == "number" ? s : s == null ? "" : String(s);
49
+ });
50
+ function R(s) {
51
+ n()?.readOnly || e.form().dispatch({ type: "SetValue", nodeId: t(), value: s });
52
+ }
53
+ function P(s, l) {
54
+ const v = n();
55
+ if (!(!v || v.readOnly)) {
56
+ if (v.enumValues?.length) {
57
+ const I = Number(l);
58
+ Number.isInteger(I) && I >= 0 && v.enumValues[I] && R(v.enumValues[I].value);
59
+ return;
60
+ }
61
+ v.fieldType === "number" || v.fieldType === "integer" ? R(s === "" ? void 0 : Number(s)) : R(s);
62
+ }
63
+ }
64
+ function B() {
65
+ e.form().dispatch({ type: "SetTouched", nodeId: t() });
66
+ }
67
+ return {
68
+ node: n,
69
+ value: h,
70
+ errors: u,
71
+ visibleErrors: f,
72
+ dirty: m,
73
+ touched: w,
74
+ visible: d,
75
+ disabled: g,
76
+ showErrors: r,
77
+ label: i,
78
+ description: y,
79
+ inputId: T,
80
+ descriptionId: p,
81
+ errorId: _,
82
+ invalid: S,
83
+ describedBy: D,
84
+ display: N,
85
+ setRaw: P,
86
+ setValue: R,
87
+ onBlur: B
88
+ };
89
+ }
90
+ const yt = me;
91
+ function Q(t) {
92
+ const e = F(), n = b(() => e.document().nodes[t.node.id] ?? t.node), o = b(() => e.registry().resolve(n()));
93
+ return a(x, {
94
+ get when() {
95
+ return C(() => !!n().visible)() && o();
96
+ },
97
+ get children() {
98
+ return a(ue, {
99
+ get component() {
100
+ return o();
101
+ },
102
+ get node() {
103
+ return n();
104
+ }
105
+ });
106
+ }
107
+ });
108
+ }
109
+ var oe = /* @__PURE__ */ $("<button type=button>"), Se = /* @__PURE__ */ $("<div data-array-container>"), ke = /* @__PURE__ */ $("<span aria-hidden=true class=texaryn-array-drag-handle tabindex=-1>⠿"), Ae = /* @__PURE__ */ $("<button type=button data-reorder-direction=up>"), Ee = /* @__PURE__ */ $("<button type=button data-reorder-direction=down>"), Re = /* @__PURE__ */ $("<div data-array-row>");
110
+ const M = "application/x-texaryn-array-item";
111
+ function Oe(t) {
112
+ const e = F(), n = b(() => e.document().nodes[t.node.id] ?? t.node), o = b(() => n().arrayMeta), h = b(() => n().annotations.title), u = b(() => o()?.itemIds ?? []), [m, w] = z(null);
113
+ let d;
114
+ const g = () => o()?.canReorder === !0 && !n().readOnly && !n().disabled, r = () => {
115
+ d?.removeAttribute("data-array-drag-active"), d?.querySelectorAll("[data-dragging], [data-drop-target]").forEach((p) => {
116
+ p.removeAttribute("data-dragging"), p.removeAttribute("data-drop-target");
117
+ }), w(null);
118
+ };
119
+ q(() => {
120
+ const p = m();
121
+ if (!p) return;
122
+ const _ = e.form();
123
+ (p.runtime !== _ || p.root !== d || p.identityKey !== o()?.identityKey || !g() || !u().includes(p.itemId)) && r();
124
+ }), K(r);
125
+ const f = (p) => p.target instanceof Element && p.target.closest("[data-array-container]") === d, i = (p) => {
126
+ const _ = n().children[p];
127
+ return _ ? e.document().nodes[_] : void 0;
128
+ }, y = () => e.messages().addItem({
129
+ itemTemplateTitle: o()?.itemTitle,
130
+ containerTitle: h()
131
+ }), T = (p, _, S) => {
132
+ const D = S.currentTarget, N = document.activeElement === D, R = u()[p];
133
+ e.form().dispatch({
134
+ type: "MoveItem",
135
+ containerId: n().id,
136
+ from: p,
137
+ to: _
138
+ }), !(!N || !R || _ === p) && queueMicrotask(() => {
139
+ const P = [...document.querySelectorAll("[data-array-item-id]")].find((s) => s.dataset.arrayItemId === R), B = _ < p && _ === 0 ? "down" : _ > p && _ === u().length - 1 ? "up" : void 0;
140
+ B && P?.querySelector(`[data-reorder-direction="${B}"]`)?.focus();
141
+ });
142
+ };
143
+ return (() => {
144
+ var p = Se();
145
+ return de((_) => {
146
+ d = _;
147
+ }, p), c(p, a(E, {
148
+ get each() {
149
+ return u();
150
+ },
151
+ children: (_, S) => {
152
+ const D = () => i(S())?.annotations.title, N = () => S() + 1, R = () => e.messages().moveItemUp({
153
+ position: N(),
154
+ itemTitle: D(),
155
+ containerTitle: h()
156
+ }), P = () => e.messages().moveItemDown({
157
+ position: N(),
158
+ itemTitle: D(),
159
+ containerTitle: h()
160
+ }), B = () => e.messages().removeItem({
161
+ position: N(),
162
+ itemTitle: D(),
163
+ containerTitle: h()
164
+ });
165
+ return (() => {
166
+ var s = Re();
167
+ return s.addEventListener("drop", (l) => {
168
+ if (!Array.from(l.dataTransfer?.types ?? []).includes(M)) return;
169
+ l.stopPropagation();
170
+ const v = m(), I = u();
171
+ if (!d || !f(l) || !v) {
172
+ r();
173
+ return;
174
+ }
175
+ const O = I.indexOf(v.itemId), Z = I.indexOf(_);
176
+ if (v.runtime !== e.form() || v.root !== d || v.identityKey !== o()?.identityKey || !g() || O < 0 || Z < 0) {
177
+ r();
178
+ return;
179
+ }
180
+ l.preventDefault();
181
+ const ee = l.currentTarget.getBoundingClientRect(), ye = l.clientY >= ee.top + ee.height / 2, H = Z + (ye ? 1 : 0), te = H > O ? H - 1 : H;
182
+ r(), te !== O && e.form().dispatch({
183
+ type: "MoveItem",
184
+ containerId: n().id,
185
+ from: O,
186
+ to: te
187
+ });
188
+ }), s.addEventListener("dragleave", (l) => {
189
+ Array.from(l.dataTransfer?.types ?? []).includes(M) && l.currentTarget.removeAttribute("data-drop-target");
190
+ }), s.addEventListener("dragover", (l) => {
191
+ if (!Array.from(l.dataTransfer?.types ?? []).includes(M)) return;
192
+ if (!d || !f(l)) {
193
+ l.stopPropagation();
194
+ return;
195
+ }
196
+ const v = m(), I = u();
197
+ if (!v || v.runtime !== e.form() || v.root !== d || v.identityKey !== o()?.identityKey || !g() || !I.includes(v.itemId) || !I.includes(_)) {
198
+ l.stopPropagation();
199
+ return;
200
+ }
201
+ l.preventDefault(), l.stopPropagation(), l.dataTransfer && (l.dataTransfer.dropEffect = "move"), l.currentTarget.setAttribute("data-drop-target", "");
202
+ }), k(s, "data-array-item-id", _), c(s, a(x, {
203
+ get when() {
204
+ return g();
205
+ },
206
+ get children() {
207
+ var l = ke();
208
+ return l.addEventListener("dragend", (v) => {
209
+ v.dataTransfer?.clearData(M), r();
210
+ }), l.addEventListener("dragstart", (v) => {
211
+ const I = o()?.identityKey;
212
+ if (!g() || !d || I === void 0 || !u().includes(_)) {
213
+ v.preventDefault();
214
+ return;
215
+ }
216
+ v.stopPropagation(), v.dataTransfer?.setData(M, _), v.dataTransfer && (v.dataTransfer.effectAllowed = "move"), w({
217
+ runtime: e.form(),
218
+ identityKey: I,
219
+ root: d,
220
+ itemId: _
221
+ }), d.setAttribute("data-array-drag-active", ""), v.currentTarget.closest("[data-array-row]")?.setAttribute("data-dragging", "");
222
+ }), k(l, "draggable", !0), l;
223
+ }
224
+ }), null), c(s, a(x, {
225
+ get when() {
226
+ return i(S());
227
+ },
228
+ children: (l) => a(Q, {
229
+ get node() {
230
+ return l();
231
+ }
232
+ })
233
+ }), null), c(s, a(x, {
234
+ get when() {
235
+ return C(() => !!o()?.canReorder)() && S() > 0;
236
+ },
237
+ get children() {
238
+ var l = Ae();
239
+ return l.$$click = (v) => T(S(), S() - 1, v), c(l, () => R().label), A(() => k(l, "aria-label", R().accessibleName)), l;
240
+ }
241
+ }), null), c(s, a(x, {
242
+ get when() {
243
+ return C(() => !!o()?.canReorder)() && S() < u().length - 1;
244
+ },
245
+ get children() {
246
+ var l = Ee();
247
+ return l.$$click = (v) => T(S(), S() + 1, v), c(l, () => P().label), A(() => k(l, "aria-label", P().accessibleName)), l;
248
+ }
249
+ }), null), c(s, a(x, {
250
+ get when() {
251
+ return o()?.canRemove;
252
+ },
253
+ get children() {
254
+ var l = oe();
255
+ return l.$$click = () => e.form().dispatch({
256
+ type: "RemoveItem",
257
+ containerId: n().id,
258
+ index: S()
259
+ }), c(l, () => B().label), A(() => k(l, "aria-label", B().accessibleName)), l;
260
+ }
261
+ }), null), s;
262
+ })();
263
+ }
264
+ }), null), c(p, a(x, {
265
+ get when() {
266
+ return o()?.canAdd;
267
+ },
268
+ get children() {
269
+ var _ = oe();
270
+ return _.$$click = () => e.form().dispatch({
271
+ type: "InsertItem",
272
+ containerId: n().id,
273
+ index: u().length
274
+ }), c(_, () => y().label), A(() => k(_, "aria-label", y().accessibleName)), _;
275
+ }
276
+ }), null), p;
277
+ })();
278
+ }
279
+ G(["click"]);
280
+ var Ce = /* @__PURE__ */ $("<ul>"), De = /* @__PURE__ */ $("<div aria-live=polite aria-atomic=true>"), Ne = /* @__PURE__ */ $("<li>");
281
+ function Be(t) {
282
+ const e = F();
283
+ return (() => {
284
+ var n = De();
285
+ return c(n, a(x, {
286
+ get when() {
287
+ return t.errors.length > 0;
288
+ },
289
+ get children() {
290
+ var o = Ce();
291
+ return c(o, a(E, {
292
+ get each() {
293
+ return t.errors;
294
+ },
295
+ children: (h) => (() => {
296
+ var u = Ne();
297
+ return c(u, () => e.messages().validationMessage(h)), u;
298
+ })()
299
+ })), o;
300
+ }
301
+ })), A(() => k(n, "id", t.id)), n;
302
+ })();
303
+ }
304
+ var Pe = /* @__PURE__ */ $("<span> (required)"), Fe = /* @__PURE__ */ $("<select>"), ae = /* @__PURE__ */ $("<input>"), Me = /* @__PURE__ */ $("<textarea>"), Ve = /* @__PURE__ */ $("<div>"), qe = /* @__PURE__ */ $("<div><label>"), je = /* @__PURE__ */ $("<option>");
305
+ function J(t, e) {
306
+ if (t === e) return !0;
307
+ if (typeof t != "object" || t === null || typeof e != "object" || e === null) return !1;
308
+ if (Array.isArray(t) || Array.isArray(e))
309
+ return Array.isArray(t) && Array.isArray(e) && t.length === e.length && t.every((u, m) => J(u, e[m]));
310
+ const n = t, o = e, h = Object.keys(n);
311
+ return h.length === Object.keys(o).length && h.every((u) => Object.hasOwn(o, u) && J(n[u], o[u]));
312
+ }
313
+ function ie(t) {
314
+ const e = me(() => t.node.id), n = b(() => e.node()), o = b(() => {
315
+ const m = n()?.enumValues ?? [], w = e.value();
316
+ return String(m.findIndex((d) => J(d.value, w)));
317
+ }), h = () => ({
318
+ id: e.inputId(),
319
+ name: n()?.dataPointer || n()?.id || "",
320
+ disabled: e.disabled() || !!n()?.disabled,
321
+ "aria-required": !!n()?.constraints.required,
322
+ "aria-invalid": e.invalid() || void 0,
323
+ "aria-describedby": e.describedBy(),
324
+ placeholder: n()?.placeholder
325
+ }), u = (m) => {
326
+ e.setRaw(m.currentTarget.value);
327
+ };
328
+ return a(x, {
329
+ get when() {
330
+ return C(() => !!e.visible())() && n();
331
+ },
332
+ children: (m) => (() => {
333
+ var w = qe(), d = w.firstChild;
334
+ return c(d, () => e.label(), null), c(d, a(x, {
335
+ get when() {
336
+ return m().constraints.required;
337
+ },
338
+ get children() {
339
+ return Pe();
340
+ }
341
+ }), null), c(w, a(Te, {
342
+ get children() {
343
+ return [a(j, {
344
+ get when() {
345
+ return m().enumValues?.length;
346
+ },
347
+ get children() {
348
+ var g = Fe();
349
+ return L(g, U(h, {
350
+ get value() {
351
+ return o();
352
+ },
353
+ get "aria-readonly"() {
354
+ return m().readOnly ? "true" : void 0;
355
+ },
356
+ onChange: (r) => {
357
+ if (m().readOnly) {
358
+ r.currentTarget.value = o();
359
+ return;
360
+ }
361
+ e.setRaw("", r.currentTarget.value);
362
+ },
363
+ get onBlur() {
364
+ return e.onBlur;
365
+ }
366
+ }), !1, !0), c(g, a(E, {
367
+ get each() {
368
+ return m().enumValues;
369
+ },
370
+ children: (r, f) => (() => {
371
+ var i = je();
372
+ return c(i, () => r.title ?? String(r.value)), A(() => i.value = String(f())), i;
373
+ })()
374
+ })), g;
375
+ }
376
+ }), a(j, {
377
+ get when() {
378
+ return m().fieldType === "boolean";
379
+ },
380
+ get children() {
381
+ var g = ae();
382
+ return L(g, U(h, {
383
+ type: "checkbox",
384
+ get checked() {
385
+ return !!e.value();
386
+ },
387
+ get "aria-readonly"() {
388
+ return m().readOnly ? "true" : void 0;
389
+ },
390
+ onChange: (r) => {
391
+ if (m().readOnly) {
392
+ r.currentTarget.checked = !!e.value();
393
+ return;
394
+ }
395
+ e.setValue(r.currentTarget.checked);
396
+ },
397
+ get onBlur() {
398
+ return e.onBlur;
399
+ }
400
+ }), !1, !1), g;
401
+ }
402
+ }), a(j, {
403
+ get when() {
404
+ return m().widget === "textarea";
405
+ },
406
+ get children() {
407
+ var g = Me();
408
+ return L(g, U(h, {
409
+ get value() {
410
+ return e.display();
411
+ },
412
+ get readOnly() {
413
+ return m().readOnly;
414
+ },
415
+ onInput: u,
416
+ get onBlur() {
417
+ return e.onBlur;
418
+ }
419
+ }), !1, !1), g;
420
+ }
421
+ }), a(j, {
422
+ when: !0,
423
+ get children() {
424
+ var g = ae();
425
+ return L(g, U(h, {
426
+ get type() {
427
+ return m().fieldType === "number" || m().fieldType === "integer" ? "number" : "text";
428
+ },
429
+ get value() {
430
+ return e.display();
431
+ },
432
+ get readOnly() {
433
+ return m().readOnly;
434
+ },
435
+ onInput: u,
436
+ get onBlur() {
437
+ return e.onBlur;
438
+ }
439
+ }), !1, !1), g;
440
+ }
441
+ })];
442
+ }
443
+ }), null), c(w, a(x, {
444
+ get when() {
445
+ return e.description();
446
+ },
447
+ get children() {
448
+ var g = Ve();
449
+ return c(g, () => e.description()), A(() => k(g, "id", e.descriptionId())), g;
450
+ }
451
+ }), null), c(w, a(Be, {
452
+ get id() {
453
+ return e.errorId();
454
+ },
455
+ get errors() {
456
+ return e.visibleErrors();
457
+ }
458
+ }), null), A(() => k(d, "for", e.inputId())), w;
459
+ })()
460
+ });
461
+ }
462
+ var Le = /* @__PURE__ */ $("<div>"), Ue = /* @__PURE__ */ $("<button type=button>"), Ke = /* @__PURE__ */ $("<fieldset>"), He = /* @__PURE__ */ $("<legend>");
463
+ function We(t) {
464
+ const e = F(), n = b(() => e.document().nodes[t.node.id] ?? t.node), o = b(() => n().children.map((r) => e.document().nodes[r]).filter((r) => r != null)), h = b(() => o().map(re)), u = b(() => n().annotations.title), m = b(() => {
465
+ const r = /* @__PURE__ */ new Map();
466
+ for (const f of n().boundaryTargets ?? [])
467
+ r.has(f.reason) || r.set(f.reason, f);
468
+ return [...r.values()];
469
+ }), w = (r) => (e.messages().expandBoundary ?? ((i) => ({
470
+ label: `Show ${i.boundary}`,
471
+ accessibleName: `Show ${i.boundary}`
472
+ })))({
473
+ boundary: r.reason,
474
+ containerTitle: u(),
475
+ position: 1,
476
+ count: 1
477
+ }), d = (r) => {
478
+ e.form().dispatch({
479
+ type: "ExpandBoundary",
480
+ containerId: n().id,
481
+ targetToken: r.token
482
+ });
483
+ }, g = () => (() => {
484
+ var r = Le();
485
+ return c(r, a(E, {
486
+ get each() {
487
+ return h();
488
+ },
489
+ children: (f) => {
490
+ const i = b(() => o().find((y) => re(y) === f));
491
+ return a(x, {
492
+ get when() {
493
+ return i();
494
+ },
495
+ children: (y) => a(Q, {
496
+ get node() {
497
+ return y();
498
+ }
499
+ })
500
+ });
501
+ }
502
+ }), null), c(r, a(E, {
503
+ get each() {
504
+ return m();
505
+ },
506
+ children: (f) => {
507
+ const i = w(f);
508
+ return (() => {
509
+ var y = Ue();
510
+ return y.$$click = () => d(f), c(y, () => i.label), A(() => k(y, "aria-label", i.accessibleName)), y;
511
+ })();
512
+ }
513
+ }), null), r;
514
+ })();
515
+ return t.node.parentId === null ? g() : (() => {
516
+ var r = Ke();
517
+ return c(r, a(x, {
518
+ get when() {
519
+ return u();
520
+ },
521
+ children: (f) => (() => {
522
+ var i = He();
523
+ return c(i, f), i;
524
+ })()
525
+ }), null), c(r, g, null), A(() => k(r, "role", u() === void 0 ? "none" : void 0)), r;
526
+ })();
527
+ }
528
+ G(["click"]);
529
+ function Je() {
530
+ const t = $e();
531
+ return t.register({
532
+ test: (e) => e.type === "field" && e.enumValues != null && e.enumValues.length > 0,
533
+ rank: 2
534
+ }, ie), t.register({
535
+ test: (e) => e.type === "field",
536
+ rank: 1
537
+ }, ie), t.register({
538
+ test: (e) => e.type === "container" && e.containerType === "object",
539
+ rank: 1
540
+ }, We), t.register({
541
+ test: (e) => e.type === "container" && e.containerType === "array",
542
+ rank: 1
543
+ }, Oe), t;
544
+ }
545
+ var Ye = /* @__PURE__ */ $("<div role=group tabindex=-1><h2></h2><ul>"), ze = /* @__PURE__ */ $("<li><a>");
546
+ function se(t, e, n) {
547
+ return `${t}-${e}-${n}`;
548
+ }
549
+ function Ge(t) {
550
+ const e = F(), n = V(() => e.form().visibleErrors), o = V(() => e.form().submission), h = be(e.form().submission.getSnapshot()), u = b(() => se(e.idPrefix(), "error-summary", "heading"));
551
+ let m;
552
+ q(() => {
553
+ const d = n();
554
+ d.length > 0 && h.settle(o(), d) && t.focus !== !1 && queueMicrotask(() => m?.isConnected && m.focus());
555
+ });
556
+ const w = (d) => e.messages().errorSummaryDetail({
557
+ messages: we(d, e.messages())
558
+ });
559
+ return a(x, {
560
+ get when() {
561
+ return n().length > 0;
562
+ },
563
+ get children() {
564
+ var d = Ye(), g = d.firstChild, r = g.nextSibling, f = m;
565
+ return typeof f == "function" ? de(f, d) : m = d, c(g, () => e.messages().errorSummaryHeading({
566
+ count: n().length
567
+ })), c(r, a(E, {
568
+ get each() {
569
+ return n();
570
+ },
571
+ children: (i) => (() => {
572
+ var y = ze(), T = y.firstChild;
573
+ return c(T, () => _e(i, e.messages())), c(y, () => w(i), null), A(() => k(T, "href", `#${se(e.idPrefix(), i.nodeId, "input")}`)), y;
574
+ })()
575
+ })), A((i) => {
576
+ var y = u(), T = u();
577
+ return y !== i.e && k(d, "aria-labelledby", i.e = y), T !== i.t && k(g, "id", i.t = T), i;
578
+ }, {
579
+ e: void 0,
580
+ t: void 0
581
+ }), d;
582
+ }
583
+ });
584
+ }
585
+ function Qe(t) {
586
+ return Array.from(t, (e) => e.codePointAt(0).toString(36)).join("_");
587
+ }
588
+ function pt(t) {
589
+ const e = Je(), n = t.form, o = b(() => t.form), h = V(() => o().document), u = () => t.registry ?? e, m = () => t.messages ?? xe, w = `texaryn-${Qe(Ie())}`, d = () => t.idPrefix ?? w;
590
+ let g = n;
591
+ q(() => {
592
+ const f = o();
593
+ if (f === g) return;
594
+ const i = g;
595
+ g = f, t.destroyOnUnmount !== !1 && i !== f && i.destroy();
596
+ }), K(() => {
597
+ t.destroyOnUnmount !== !1 && o().destroy();
598
+ });
599
+ const r = {
600
+ form: o,
601
+ document: h,
602
+ registry: u,
603
+ messages: m,
604
+ idPrefix: d
605
+ };
606
+ return a(ge.Provider, {
607
+ value: r,
608
+ get children() {
609
+ return [a(x, {
610
+ get when() {
611
+ return C(() => !!t.showErrorSummary)() && o();
612
+ },
613
+ keyed: !0,
614
+ get children() {
615
+ return a(Ge, {
616
+ get focus() {
617
+ return t.summaryFocus !== !1;
618
+ }
619
+ });
620
+ }
621
+ }), a(x, {
622
+ get when() {
623
+ return h().nodes[h().rootId];
624
+ },
625
+ children: (f) => a(Q, {
626
+ get node() {
627
+ return f();
628
+ }
629
+ })
630
+ }), C(() => t.children)];
631
+ }
632
+ });
633
+ }
634
+ var Xe = /* @__PURE__ */ $("<fieldset><legend>"), Ze = /* @__PURE__ */ $("<div data-texaryn-layout>"), et = /* @__PURE__ */ $("<h2>"), tt = /* @__PURE__ */ $("<p role=note>"), rt = /* @__PURE__ */ $("<p>"), nt = /* @__PURE__ */ $("<button type=button>"), ot = /* @__PURE__ */ $("<ul>"), at = /* @__PURE__ */ $("<li>"), it = /* @__PURE__ */ $("<table><thead><tr></tr></thead><tbody>"), st = /* @__PURE__ */ $("<th scope=col>"), lt = /* @__PURE__ */ $("<tr>"), ct = /* @__PURE__ */ $("<td>");
635
+ const fe = le();
636
+ function X() {
637
+ const t = ce(fe);
638
+ if (!t) throw new Error("Display nodes must be rendered below DocumentRoot");
639
+ return t;
640
+ }
641
+ function he(t) {
642
+ const e = X();
643
+ return V(() => {
644
+ const n = e.runtime().getCollection(t);
645
+ if (!n) throw new Error(`Node ${t} is not a collection`);
646
+ return n;
647
+ });
648
+ }
649
+ function Y(t) {
650
+ const e = X(), n = b(() => e.document().nodes[t.nodeId]), o = b(() => {
651
+ const r = n();
652
+ if (r)
653
+ return r.type === "container" ? `container:${r.containerType}` : r.type === "text" ? `text:${r.textRole}` : r.type;
654
+ }), h = b(() => {
655
+ const r = n();
656
+ return r ? e.registry()?.resolve(r) : void 0;
657
+ }), u = () => {
658
+ const r = n();
659
+ return r?.type === "container" ? r : void 0;
660
+ }, m = () => {
661
+ const r = n();
662
+ return r?.type === "text" ? r : void 0;
663
+ }, w = () => {
664
+ const r = n();
665
+ return r?.type === "list" ? r : void 0;
666
+ }, d = () => {
667
+ const r = n();
668
+ return r?.type === "table" ? r : void 0;
669
+ }, g = () => {
670
+ const r = n();
671
+ return r?.type === "action" ? r : void 0;
672
+ };
673
+ return a(x, {
674
+ get when() {
675
+ return o();
676
+ },
677
+ keyed: !0,
678
+ children: (r) => {
679
+ let f = null;
680
+ if (r.startsWith("container:")) {
681
+ const i = () => u()?.children ?? [];
682
+ f = r === "container:group" ? (() => {
683
+ var y = Xe(), T = y.firstChild;
684
+ return c(T, () => u()?.annotations.title), c(y, a(E, {
685
+ get each() {
686
+ return i();
687
+ },
688
+ children: (p) => a(Y, {
689
+ nodeId: p
690
+ })
691
+ }), null), y;
692
+ })() : (() => {
693
+ var y = Ze();
694
+ return c(y, a(E, {
695
+ get each() {
696
+ return i();
697
+ },
698
+ children: (T) => a(Y, {
699
+ nodeId: T
700
+ })
701
+ })), y;
702
+ })();
703
+ } else r === "text:heading" ? f = (() => {
704
+ var i = et();
705
+ return c(i, () => m()?.content), i;
706
+ })() : r === "text:help" ? f = (() => {
707
+ var i = tt();
708
+ return c(i, () => m()?.content), i;
709
+ })() : r === "text:paragraph" ? f = (() => {
710
+ var i = rt();
711
+ return c(i, () => m()?.content), i;
712
+ })() : r === "list" ? f = a(x, {
713
+ get when() {
714
+ return w();
715
+ },
716
+ get children() {
717
+ return a(ut, {
718
+ get nodeId() {
719
+ return t.nodeId;
720
+ }
721
+ });
722
+ }
723
+ }) : r === "table" ? f = a(x, {
724
+ get when() {
725
+ return d();
726
+ },
727
+ get children() {
728
+ return a(dt, {
729
+ get nodeId() {
730
+ return t.nodeId;
731
+ }
732
+ });
733
+ }
734
+ }) : r === "action" && (f = (() => {
735
+ var i = nt();
736
+ return i.$$click = () => {
737
+ const y = n();
738
+ y?.type === "action" && e.runtime().invokeAction(y.id).catch((T) => {
739
+ const p = e.onActionError();
740
+ p ? p(T) : console.error(T);
741
+ });
742
+ }, c(i, () => g()?.label ?? ""), A(() => i.disabled = !e.runtime().hasActionHandler(g()?.actionType ?? "")), i;
743
+ })());
744
+ return a(x, {
745
+ get when() {
746
+ return h();
747
+ },
748
+ fallback: f,
749
+ get children() {
750
+ return a(ue, {
751
+ get component() {
752
+ return h();
753
+ },
754
+ get node() {
755
+ return n();
756
+ },
757
+ get runtime() {
758
+ return e.runtime();
759
+ }
760
+ });
761
+ }
762
+ });
763
+ }
764
+ });
765
+ }
766
+ function ut(t) {
767
+ const e = he(t.nodeId);
768
+ return (() => {
769
+ var n = ot();
770
+ return c(n, a(E, {
771
+ get each() {
772
+ return e().map((o) => o.id);
773
+ },
774
+ children: (o) => {
775
+ const h = () => e().find((u) => u.id === o);
776
+ return (() => {
777
+ var u = at();
778
+ return c(u, (() => {
779
+ var m = C(() => h()?.value == null);
780
+ return () => m() ? "" : String(h()?.value);
781
+ })()), u;
782
+ })();
783
+ }
784
+ })), n;
785
+ })();
786
+ }
787
+ function dt(t) {
788
+ const e = X(), n = he(t.nodeId), o = b(() => {
789
+ const h = e.document().nodes[t.nodeId];
790
+ return h?.type === "table" ? h : void 0;
791
+ });
792
+ return (() => {
793
+ var h = it(), u = h.firstChild, m = u.firstChild, w = u.nextSibling;
794
+ return c(m, a(E, {
795
+ get each() {
796
+ return o()?.columns ?? [];
797
+ },
798
+ children: (d) => (() => {
799
+ var g = st();
800
+ return c(g, () => d.label), g;
801
+ })()
802
+ })), c(w, a(E, {
803
+ get each() {
804
+ return n().map((d) => d.id);
805
+ },
806
+ children: (d) => {
807
+ const g = () => n().find((r) => r.id === d);
808
+ return (() => {
809
+ var r = lt();
810
+ return c(r, a(E, {
811
+ get each() {
812
+ return o()?.columns ?? [];
813
+ },
814
+ children: (f, i) => {
815
+ const y = () => g()?.cells[i()] ?? null;
816
+ return (() => {
817
+ var T = ct();
818
+ return c(T, (() => {
819
+ var p = C(() => y() === null);
820
+ return () => p() ? "" : String(y());
821
+ })()), T;
822
+ })();
823
+ }
824
+ })), r;
825
+ })();
826
+ }
827
+ })), h;
828
+ })();
829
+ }
830
+ function vt(t) {
831
+ const e = V(() => t.runtime.document), n = {
832
+ runtime: () => t.runtime,
833
+ document: e,
834
+ registry: () => t.registry,
835
+ onActionError: () => t.onActionError
836
+ };
837
+ return a(fe.Provider, {
838
+ value: n,
839
+ get children() {
840
+ return [a(x, {
841
+ get when() {
842
+ return e().rootId;
843
+ },
844
+ keyed: !0,
845
+ children: (o) => a(Y, {
846
+ nodeId: o
847
+ })
848
+ }), C(() => t.children)];
849
+ }
850
+ });
851
+ }
852
+ G(["click"]);
853
+ export {
854
+ Oe as ArrayControl,
855
+ vt as DocumentRoot,
856
+ Ge as ErrorSummary,
857
+ Be as FieldErrors,
858
+ ie as FieldWidget,
859
+ ge as FormContext,
860
+ pt as FormRoot,
861
+ Q as NodeRenderer,
862
+ We as ObjectLayout,
863
+ Je as createDefaultRegistry,
864
+ ht as createForm,
865
+ yt as useField,
866
+ F as useFormContext,
867
+ V as useStore
868
+ };
@@ -0,0 +1,3 @@
1
+ import type { RendererRegistry } from '@texaryn/core';
2
+ import type { WidgetComponent } from './widget.js';
3
+ export declare function createDefaultRegistry(): RendererRegistry<WidgetComponent>;
@@ -0,0 +1,3 @@
1
+ import { type Accessor } from 'solid-js';
2
+ import type { Store } from '@texaryn/core';
3
+ export declare function useStore<T>(store: Accessor<Store<T>>): Accessor<T>;
@@ -0,0 +1,5 @@
1
+ import type { Component } from 'solid-js';
2
+ import type { UINode } from '@texaryn/core';
3
+ export type WidgetComponent = Component<{
4
+ node: UINode;
5
+ }>;
@@ -0,0 +1,4 @@
1
+ import type { UINode } from '@texaryn/core';
2
+ export declare function ArrayControl(props: {
3
+ node: UINode;
4
+ }): import("solid-js").JSX.Element;
@@ -0,0 +1,4 @@
1
+ import type { UINode } from '@texaryn/core';
2
+ export declare function FieldWidget(props: {
3
+ node: UINode;
4
+ }): import("solid-js").JSX.Element;
@@ -0,0 +1,4 @@
1
+ import type { UINode } from '@texaryn/core';
2
+ export declare function ObjectLayout(props: {
3
+ node: UINode;
4
+ }): import("solid-js").JSX.Element;
package/package.json CHANGED
@@ -1,6 +1,65 @@
1
1
  {
2
2
  "name": "@texaryn/solid",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
3
+ "version": "0.3.0",
4
+ "description": "SolidJS bindings, renderer, and default widgets for Texaryn",
5
+ "keywords": [
6
+ "solid-js",
7
+ "json-schema",
8
+ "forms",
9
+ "form-builder",
10
+ "schema-driven",
11
+ "dynamic-forms",
12
+ "typescript"
13
+ ],
14
+ "type": "module",
15
+ "license": "Apache-2.0",
16
+ "funding": {
17
+ "type": "github",
18
+ "url": "https://github.com/sponsors/hamzahamidi"
19
+ },
20
+ "repository": {
21
+ "type": "git",
22
+ "url": "git+https://github.com/texaryn/texaryn.git",
23
+ "directory": "packages/solid"
24
+ },
25
+ "homepage": "https://texaryn.github.io/texaryn/",
26
+ "bugs": {
27
+ "url": "https://github.com/texaryn/texaryn/issues"
28
+ },
29
+ "main": "./dist/index.js",
30
+ "types": "./dist/index.d.ts",
31
+ "exports": {
32
+ ".": {
33
+ "types": "./dist/index.d.ts",
34
+ "import": "./dist/index.js"
35
+ }
36
+ },
37
+ "files": [
38
+ "dist",
39
+ "README.md",
40
+ "CHANGELOG.md",
41
+ "LICENSE"
42
+ ],
43
+ "dependencies": {
44
+ "@texaryn/core": "^0.16.0"
45
+ },
46
+ "peerDependencies": {
47
+ "solid-js": "^1.9.0"
48
+ },
49
+ "publishConfig": {
50
+ "access": "public"
51
+ },
52
+ "devDependencies": {
53
+ "@solidjs/testing-library": "^0.8.10",
54
+ "jsdom": "^25.0.0",
55
+ "solid-js": "^1.9.9",
56
+ "typescript": "~5.8.0",
57
+ "vite": "^7.3.6",
58
+ "vite-plugin-solid": "^2.11.8",
59
+ "@texaryn/schema-json": "0.10.0"
60
+ },
61
+ "scripts": {
62
+ "build": "tsc --build tsconfig.build.json --force && vite build",
63
+ "typecheck": "pnpm --filter @texaryn/core build && pnpm --filter @texaryn/schema-json build && tsc --project tsconfig.typecheck.json --noEmit"
64
+ }
6
65
  }