@logixjs/form 0.0.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 (101) hide show
  1. package/dist/Error-VvknI9Wj.d.cts +37 -0
  2. package/dist/Error-VvknI9Wj.d.ts +37 -0
  3. package/dist/Error.cjs +46 -0
  4. package/dist/Error.cjs.map +1 -0
  5. package/dist/Error.d.cts +1 -0
  6. package/dist/Error.d.ts +1 -0
  7. package/dist/Error.js +14 -0
  8. package/dist/Error.js.map +1 -0
  9. package/dist/Form.cjs +2455 -0
  10. package/dist/Form.cjs.map +1 -0
  11. package/dist/Form.d.cts +64 -0
  12. package/dist/Form.d.ts +64 -0
  13. package/dist/Form.js +25 -0
  14. package/dist/Form.js.map +1 -0
  15. package/dist/FormView-CAg9LVrf.d.cts +17 -0
  16. package/dist/FormView-CAg9LVrf.d.ts +17 -0
  17. package/dist/FormView.cjs +61 -0
  18. package/dist/FormView.cjs.map +1 -0
  19. package/dist/FormView.d.cts +1 -0
  20. package/dist/FormView.d.ts +1 -0
  21. package/dist/FormView.js +8 -0
  22. package/dist/FormView.js.map +1 -0
  23. package/dist/Path-DOjMkAS6.d.cts +42 -0
  24. package/dist/Path-DOjMkAS6.d.ts +42 -0
  25. package/dist/Path.cjs +132 -0
  26. package/dist/Path.cjs.map +1 -0
  27. package/dist/Path.d.cts +1 -0
  28. package/dist/Path.d.ts +1 -0
  29. package/dist/Path.js +22 -0
  30. package/dist/Path.js.map +1 -0
  31. package/dist/Rule-BOAiSVz9.d.cts +202 -0
  32. package/dist/Rule-BOAiSVz9.d.ts +202 -0
  33. package/dist/Rule.cjs +307 -0
  34. package/dist/Rule.cjs.map +1 -0
  35. package/dist/Rule.d.cts +2 -0
  36. package/dist/Rule.d.ts +2 -0
  37. package/dist/Rule.js +34 -0
  38. package/dist/Rule.js.map +1 -0
  39. package/dist/SchemaErrorMapping-Cu5gl7-Z.d.ts +50 -0
  40. package/dist/SchemaErrorMapping-DOrgLzii.d.cts +50 -0
  41. package/dist/SchemaErrorMapping.cjs +305 -0
  42. package/dist/SchemaErrorMapping.cjs.map +1 -0
  43. package/dist/SchemaErrorMapping.d.cts +2 -0
  44. package/dist/SchemaErrorMapping.d.ts +2 -0
  45. package/dist/SchemaErrorMapping.js +17 -0
  46. package/dist/SchemaErrorMapping.js.map +1 -0
  47. package/dist/SchemaPathMapping-BCoUW-_q.d.ts +16 -0
  48. package/dist/SchemaPathMapping-BUq2zm8W.d.cts +20 -0
  49. package/dist/SchemaPathMapping-BUq2zm8W.d.ts +20 -0
  50. package/dist/SchemaPathMapping-DJnExqM3.d.cts +16 -0
  51. package/dist/SchemaPathMapping.cjs +179 -0
  52. package/dist/SchemaPathMapping.cjs.map +1 -0
  53. package/dist/SchemaPathMapping.d.cts +2 -0
  54. package/dist/SchemaPathMapping.d.ts +2 -0
  55. package/dist/SchemaPathMapping.js +12 -0
  56. package/dist/SchemaPathMapping.js.map +1 -0
  57. package/dist/Trait-Bu794ROY.d.cts +49 -0
  58. package/dist/Trait-Bu794ROY.d.ts +49 -0
  59. package/dist/Trait.cjs +48 -0
  60. package/dist/Trait.cjs.map +1 -0
  61. package/dist/Trait.d.cts +2 -0
  62. package/dist/Trait.d.ts +2 -0
  63. package/dist/Trait.js +12 -0
  64. package/dist/Trait.js.map +1 -0
  65. package/dist/chunk-5DRI5UGD.js +105 -0
  66. package/dist/chunk-5DRI5UGD.js.map +1 -0
  67. package/dist/chunk-AD2ZA7KA.js +23 -0
  68. package/dist/chunk-AD2ZA7KA.js.map +1 -0
  69. package/dist/chunk-EOXJRCM6.js +146 -0
  70. package/dist/chunk-EOXJRCM6.js.map +1 -0
  71. package/dist/chunk-JZ5FZKPJ.js +71 -0
  72. package/dist/chunk-JZ5FZKPJ.js.map +1 -0
  73. package/dist/chunk-LNJJPZAG.js +46 -0
  74. package/dist/chunk-LNJJPZAG.js.map +1 -0
  75. package/dist/chunk-NAR5SIFP.js +22 -0
  76. package/dist/chunk-NAR5SIFP.js.map +1 -0
  77. package/dist/chunk-OJVEZKU7.js +117 -0
  78. package/dist/chunk-OJVEZKU7.js.map +1 -0
  79. package/dist/chunk-PZ5AY32C.js +10 -0
  80. package/dist/chunk-PZ5AY32C.js.map +1 -0
  81. package/dist/chunk-S5JTU2CM.js +31 -0
  82. package/dist/chunk-S5JTU2CM.js.map +1 -0
  83. package/dist/chunk-YHDEJ47V.js +1885 -0
  84. package/dist/chunk-YHDEJ47V.js.map +1 -0
  85. package/dist/chunk-YVHXLY63.js +315 -0
  86. package/dist/chunk-YVHXLY63.js.map +1 -0
  87. package/dist/impl-BfSlyM58.d.ts +225 -0
  88. package/dist/impl-Ccdm5eDF.d.cts +225 -0
  89. package/dist/index.cjs +2689 -0
  90. package/dist/index.cjs.map +1 -0
  91. package/dist/index.d.cts +12 -0
  92. package/dist/index.d.ts +12 -0
  93. package/dist/index.js +56 -0
  94. package/dist/index.js.map +1 -0
  95. package/dist/react/index.cjs +332 -0
  96. package/dist/react/index.cjs.map +1 -0
  97. package/dist/react/index.d.cts +43 -0
  98. package/dist/react/index.d.ts +43 -0
  99. package/dist/react/index.js +201 -0
  100. package/dist/react/index.js.map +1 -0
  101. package/package.json +62 -0
@@ -0,0 +1,201 @@
1
+ import {
2
+ getFormView
3
+ } from "../chunk-LNJJPZAG.js";
4
+ import {
5
+ getAtPath
6
+ } from "../chunk-5DRI5UGD.js";
7
+ import {
8
+ toErrorsPath,
9
+ toManualErrorsPath,
10
+ toSchemaErrorsPath,
11
+ toUiPath
12
+ } from "../chunk-OJVEZKU7.js";
13
+ import "../chunk-PZ5AY32C.js";
14
+
15
+ // src/react/useField.ts
16
+ import { useCallback, useMemo } from "react";
17
+ import * as LogixReact from "@logixjs/react";
18
+ var readUiFlag = (ui, key) => {
19
+ if (!ui || typeof ui !== "object" || Array.isArray(ui)) return false;
20
+ return ui[key] === true;
21
+ };
22
+ var useField = (form, path) => {
23
+ const value = LogixReact.useSelector(form.runtime, (s) => getAtPath(s, path));
24
+ const manualError = LogixReact.useSelector(form.runtime, (s) => getAtPath(s, toManualErrorsPath(path)));
25
+ const ruleError = LogixReact.useSelector(form.runtime, (s) => getAtPath(s, toErrorsPath(path)));
26
+ const schemaError = LogixReact.useSelector(form.runtime, (s) => getAtPath(s, toSchemaErrorsPath(path)));
27
+ const error = useMemo(() => manualError ?? ruleError ?? schemaError, [manualError, ruleError, schemaError]);
28
+ const ui = LogixReact.useSelector(form.runtime, (s) => getAtPath(s, toUiPath(path)));
29
+ const touched = useMemo(() => readUiFlag(ui, "touched"), [ui]);
30
+ const dirty = useMemo(() => readUiFlag(ui, "dirty"), [ui]);
31
+ const dispatch = LogixReact.useDispatch(form.runtime);
32
+ const onChange = useCallback(
33
+ (next) => {
34
+ dispatch({ _tag: "setValue", payload: { path, value: next } });
35
+ },
36
+ [dispatch, path]
37
+ );
38
+ const onBlur = useCallback(() => {
39
+ dispatch({ _tag: "blur", payload: { path } });
40
+ }, [dispatch, path]);
41
+ return useMemo(
42
+ () => ({
43
+ value,
44
+ error,
45
+ touched,
46
+ dirty,
47
+ onChange,
48
+ onBlur
49
+ }),
50
+ [value, error, touched, dirty, onChange, onBlur]
51
+ );
52
+ };
53
+
54
+ // src/react/useFieldArray.ts
55
+ import { useCallback as useCallback2, useMemo as useMemo2 } from "react";
56
+ import * as LogixReact2 from "@logixjs/react";
57
+
58
+ // src/internal/form/rowid.ts
59
+ import * as Logix from "@logixjs/core";
60
+ var getRowIdStore = (runtime) => {
61
+ if (!runtime || typeof runtime !== "object" && typeof runtime !== "function") {
62
+ return void 0;
63
+ }
64
+ const store = Logix.InternalContracts.getRowIdStore(runtime);
65
+ if (!store || typeof store !== "object") return void 0;
66
+ const getRowId = store.getRowId;
67
+ if (typeof getRowId !== "function") return void 0;
68
+ return store;
69
+ };
70
+ var getTrackByForListPath = (runtime, listPath) => {
71
+ if (!runtime || typeof runtime !== "object" && typeof runtime !== "function") {
72
+ return void 0;
73
+ }
74
+ const configs = Logix.InternalContracts.getStateTraitListConfigs(runtime);
75
+ if (!Array.isArray(configs)) return void 0;
76
+ for (const cfg of configs) {
77
+ if (!cfg || typeof cfg !== "object") continue;
78
+ const typed = cfg;
79
+ if (typed.path !== listPath) continue;
80
+ if (typeof typed.trackBy === "string" && typed.trackBy.length > 0) {
81
+ return typed.trackBy;
82
+ }
83
+ }
84
+ return void 0;
85
+ };
86
+ var readTrackBy = (item, trackBy) => {
87
+ if (!item || typeof item !== "object") return void 0;
88
+ const segments = trackBy.split(".");
89
+ let current = item;
90
+ for (const seg of segments) {
91
+ if (current == null) return void 0;
92
+ current = current[seg];
93
+ }
94
+ return current;
95
+ };
96
+ var getFieldArrayItemId = (params) => {
97
+ const k = params.trackBy !== void 0 ? readTrackBy(params.item, params.trackBy) : void 0;
98
+ if (k !== void 0) return String(k);
99
+ const fromStore = params.rowIds?.[params.index] ?? params.rowIdStore?.getRowId(params.listPath, params.index);
100
+ if (typeof fromStore === "string" && fromStore.length > 0) return fromStore;
101
+ return String(params.index);
102
+ };
103
+
104
+ // src/react/useFieldArray.ts
105
+ var useFieldArray = (form, path) => {
106
+ const items = LogixReact2.useSelector(form.runtime, (s) => {
107
+ const value = getAtPath(s, path);
108
+ return Array.isArray(value) ? value : [];
109
+ });
110
+ const dispatch = LogixReact2.useDispatch(form.runtime);
111
+ const rowIdStore = getRowIdStore(form.runtime);
112
+ const trackBy = getTrackByForListPath(form.runtime, path);
113
+ const fields = useMemo2(() => {
114
+ const ensureList = rowIdStore?.ensureList;
115
+ const rowIds = typeof ensureList === "function" ? (() => {
116
+ try {
117
+ return ensureList(path, items, trackBy);
118
+ } catch {
119
+ return void 0;
120
+ }
121
+ })() : void 0;
122
+ return items.map((item, index) => ({
123
+ id: getFieldArrayItemId({
124
+ listPath: path,
125
+ item,
126
+ index,
127
+ trackBy,
128
+ rowIds,
129
+ rowIdStore
130
+ })
131
+ }));
132
+ }, [items, rowIdStore, trackBy, path]);
133
+ const append = useCallback2(
134
+ (value) => {
135
+ dispatch({ _tag: "arrayAppend", payload: { path, value } });
136
+ },
137
+ [dispatch, path]
138
+ );
139
+ const prepend = useCallback2(
140
+ (value) => {
141
+ dispatch({ _tag: "arrayPrepend", payload: { path, value } });
142
+ },
143
+ [dispatch, path]
144
+ );
145
+ const remove = useCallback2(
146
+ (index) => {
147
+ dispatch({ _tag: "arrayRemove", payload: { path, index } });
148
+ },
149
+ [dispatch, path]
150
+ );
151
+ const swap = useCallback2(
152
+ (indexA, indexB) => {
153
+ dispatch({ _tag: "arraySwap", payload: { path, indexA, indexB } });
154
+ },
155
+ [dispatch, path]
156
+ );
157
+ const move = useCallback2(
158
+ (from, to) => {
159
+ dispatch({ _tag: "arrayMove", payload: { path, from, to } });
160
+ },
161
+ [dispatch, path]
162
+ );
163
+ return useMemo2(
164
+ () => ({
165
+ fields,
166
+ append,
167
+ prepend,
168
+ remove,
169
+ swap,
170
+ move
171
+ }),
172
+ [fields, append, prepend, remove, swap, move]
173
+ );
174
+ };
175
+
176
+ // src/react/useForm.ts
177
+ import * as LogixReact3 from "@logixjs/react";
178
+ var useForm = (form) => LogixReact3.useModule(form);
179
+
180
+ // src/react/useFormState.ts
181
+ import { useCallback as useCallback3, useRef } from "react";
182
+ import * as LogixReact4 from "@logixjs/react";
183
+ var useFormState = (form, selector, equalityFn) => {
184
+ const lastViewRef = useRef(void 0);
185
+ const select = useCallback3(
186
+ (state) => {
187
+ const view = getFormView(state, lastViewRef.current);
188
+ lastViewRef.current = view;
189
+ return selector(view);
190
+ },
191
+ [selector]
192
+ );
193
+ return LogixReact4.useSelector(form.runtime, select, equalityFn);
194
+ };
195
+ export {
196
+ useField,
197
+ useFieldArray,
198
+ useForm,
199
+ useFormState
200
+ };
201
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/react/useField.ts","../../src/react/useFieldArray.ts","../../src/internal/form/rowid.ts","../../src/react/useForm.ts","../../src/react/useFormState.ts"],"sourcesContent":["import { useCallback, useMemo } from 'react'\nimport type * as Logix from '@logixjs/core'\nimport * as LogixReact from '@logixjs/react'\nimport type { FormAction, FormState } from '../Form.js'\nimport { getAtPath } from '../internal/form/path.js'\nimport { toErrorsPath, toManualErrorsPath, toSchemaErrorsPath, toUiPath } from '../Path.js'\n\nconst readUiFlag = (ui: unknown, key: string): boolean => {\n if (!ui || typeof ui !== 'object' || Array.isArray(ui)) return false\n return (ui as Record<string, unknown>)[key] === true\n}\n\ntype FormRuntimeHandle<TValues extends object> = {\n readonly runtime: Logix.ModuleRuntime<FormState<TValues>, FormAction>\n}\n\nexport const useField = <TValues extends object>(\n form: FormRuntimeHandle<TValues>,\n path: string,\n): {\n readonly value: unknown\n readonly error: unknown\n readonly touched: boolean\n readonly dirty: boolean\n readonly onChange: (value: unknown) => void\n readonly onBlur: () => void\n} => {\n const value = LogixReact.useSelector(form.runtime, (s) => getAtPath(s, path))\n const manualError = LogixReact.useSelector(form.runtime, (s) => getAtPath(s, toManualErrorsPath(path)))\n const ruleError = LogixReact.useSelector(form.runtime, (s) => getAtPath(s, toErrorsPath(path)))\n const schemaError = LogixReact.useSelector(form.runtime, (s) => getAtPath(s, toSchemaErrorsPath(path)))\n const error = useMemo(() => manualError ?? ruleError ?? schemaError, [manualError, ruleError, schemaError])\n const ui = LogixReact.useSelector(form.runtime, (s) => getAtPath(s, toUiPath(path)))\n\n const touched = useMemo(() => readUiFlag(ui, 'touched'), [ui])\n const dirty = useMemo(() => readUiFlag(ui, 'dirty'), [ui])\n\n const dispatch = LogixReact.useDispatch(form.runtime)\n\n const onChange = useCallback(\n (next: unknown) => {\n dispatch({ _tag: 'setValue', payload: { path, value: next } })\n },\n [dispatch, path],\n )\n\n const onBlur = useCallback(() => {\n dispatch({ _tag: 'blur', payload: { path } })\n }, [dispatch, path])\n\n return useMemo(\n () => ({\n value,\n error,\n touched,\n dirty,\n onChange,\n onBlur,\n }),\n [value, error, touched, dirty, onChange, onBlur],\n )\n}\n","import { useCallback, useMemo } from 'react'\nimport type * as Logix from '@logixjs/core'\nimport * as LogixReact from '@logixjs/react'\nimport type { FormAction, FormState } from '../Form.js'\nimport { getAtPath } from '../internal/form/path.js'\nimport { getFieldArrayItemId, getRowIdStore, getTrackByForListPath } from '../internal/form/rowid.js'\n\nexport interface FieldArrayItem {\n readonly id: string\n}\n\ntype FormRuntimeHandle<TValues extends object> = {\n readonly runtime: Logix.ModuleRuntime<FormState<TValues>, FormAction>\n}\n\nexport const useFieldArray = <TValues extends object>(\n form: FormRuntimeHandle<TValues>,\n path: string,\n): {\n readonly fields: ReadonlyArray<FieldArrayItem>\n readonly append: (value: unknown) => void\n readonly prepend: (value: unknown) => void\n readonly remove: (index: number) => void\n readonly swap: (indexA: number, indexB: number) => void\n readonly move: (from: number, to: number) => void\n} => {\n const items = LogixReact.useSelector(form.runtime, (s) => {\n const value = getAtPath(s, path)\n return Array.isArray(value) ? value : []\n })\n\n const dispatch = LogixReact.useDispatch(form.runtime)\n const rowIdStore = getRowIdStore(form.runtime)\n const trackBy = getTrackByForListPath(form.runtime, path)\n\n const fields = useMemo(() => {\n const ensureList = rowIdStore?.ensureList\n const rowIds =\n typeof ensureList === 'function'\n ? (() => {\n try {\n return ensureList(path, items, trackBy)\n } catch {\n return undefined\n }\n })()\n : undefined\n\n return items.map((item, index) => ({\n id: getFieldArrayItemId({\n listPath: path,\n item,\n index,\n trackBy,\n rowIds,\n rowIdStore,\n }),\n }))\n }, [items, rowIdStore, trackBy, path])\n\n const append = useCallback(\n (value: unknown) => {\n dispatch({ _tag: 'arrayAppend', payload: { path, value } })\n },\n [dispatch, path],\n )\n\n const prepend = useCallback(\n (value: unknown) => {\n dispatch({ _tag: 'arrayPrepend', payload: { path, value } })\n },\n [dispatch, path],\n )\n\n const remove = useCallback(\n (index: number) => {\n dispatch({ _tag: 'arrayRemove', payload: { path, index } })\n },\n [dispatch, path],\n )\n\n const swap = useCallback(\n (indexA: number, indexB: number) => {\n dispatch({ _tag: 'arraySwap', payload: { path, indexA, indexB } })\n },\n [dispatch, path],\n )\n\n const move = useCallback(\n (from: number, to: number) => {\n dispatch({ _tag: 'arrayMove', payload: { path, from, to } })\n },\n [dispatch, path],\n )\n\n return useMemo(\n () => ({\n fields,\n append,\n prepend,\n remove,\n swap,\n move,\n }),\n [fields, append, prepend, remove, swap, move],\n )\n}\n","import * as Logix from '@logixjs/core'\n\nexport type RowIdStoreLike = {\n readonly getRowId: (listPath: string, index: number) => string | undefined\n readonly ensureList?: (listPath: string, items: ReadonlyArray<unknown>, trackBy?: string) => ReadonlyArray<string>\n}\n\ntype ListConfigLike = {\n readonly path: string\n readonly trackBy?: string\n}\n\nexport const getRowIdStore = (runtime: unknown): RowIdStoreLike | undefined => {\n if (!runtime || (typeof runtime !== 'object' && typeof runtime !== 'function')) {\n return undefined\n }\n const store = Logix.InternalContracts.getRowIdStore(runtime as any)\n if (!store || typeof store !== 'object') return undefined\n const getRowId = (store as Record<string, unknown>).getRowId\n if (typeof getRowId !== 'function') return undefined\n return store as RowIdStoreLike\n}\n\nexport const getTrackByForListPath = (runtime: unknown, listPath: string): string | undefined => {\n if (!runtime || (typeof runtime !== 'object' && typeof runtime !== 'function')) {\n return undefined\n }\n const configs = Logix.InternalContracts.getStateTraitListConfigs(runtime as any)\n if (!Array.isArray(configs)) return undefined\n\n for (const cfg of configs as ReadonlyArray<unknown>) {\n if (!cfg || typeof cfg !== 'object') continue\n const typed = cfg as ListConfigLike\n if (typed.path !== listPath) continue\n if (typeof typed.trackBy === 'string' && typed.trackBy.length > 0) {\n return typed.trackBy\n }\n }\n\n return undefined\n}\n\nconst readTrackBy = (item: unknown, trackBy: string): unknown => {\n if (!item || typeof item !== 'object') return undefined\n const segments = trackBy.split('.')\n let current: any = item\n for (const seg of segments) {\n if (current == null) return undefined\n current = current[seg as any]\n }\n return current\n}\n\nexport const getFieldArrayItemId = (params: {\n readonly listPath: string\n readonly item: unknown\n readonly index: number\n readonly trackBy?: string\n readonly rowIds?: ReadonlyArray<string>\n readonly rowIdStore?: RowIdStoreLike\n}): string => {\n const k = params.trackBy !== undefined ? readTrackBy(params.item, params.trackBy) : undefined\n if (k !== undefined) return String(k)\n\n const fromStore = params.rowIds?.[params.index] ?? params.rowIdStore?.getRowId(params.listPath, params.index)\n if (typeof fromStore === 'string' && fromStore.length > 0) return fromStore\n\n return String(params.index)\n}\n","import * as LogixReact from '@logixjs/react'\nimport type { FormAction, FormHandleExt, FormModule, FormState } from '../Form.js'\n\nexport const useForm = <Id extends string, TValues extends object>(\n form: FormModule<Id, TValues>,\n): LogixReact.ModuleRef<FormState<TValues>, FormAction> & FormHandleExt<TValues> => LogixReact.useModule(form)\n","import { useCallback, useRef } from 'react'\nimport type * as Logix from '@logixjs/core'\nimport * as LogixReact from '@logixjs/react'\nimport type { FormAction, FormState } from '../Form.js'\nimport type { FormView } from '../FormView.js'\nimport { getFormView } from '../FormView.js'\n\ntype FormRuntimeHandle<TValues extends object> = {\n readonly runtime: Logix.ModuleRuntime<FormState<TValues>, FormAction>\n}\n\nexport const useFormState = <TValues extends object, V>(\n form: FormRuntimeHandle<TValues>,\n selector: (view: FormView) => V,\n equalityFn?: (previous: V, next: V) => boolean,\n): V => {\n const lastViewRef = useRef<FormView | undefined>(undefined)\n\n const select = useCallback(\n (state: unknown): V => {\n const view = getFormView(state, lastViewRef.current)\n lastViewRef.current = view\n return selector(view)\n },\n [selector],\n )\n\n return LogixReact.useSelector(form.runtime, select, equalityFn)\n}\n"],"mappings":";;;;;;;;;;;;;;;AAAA,SAAS,aAAa,eAAe;AAErC,YAAY,gBAAgB;AAK5B,IAAM,aAAa,CAAC,IAAa,QAAyB;AACxD,MAAI,CAAC,MAAM,OAAO,OAAO,YAAY,MAAM,QAAQ,EAAE,EAAG,QAAO;AAC/D,SAAQ,GAA+B,GAAG,MAAM;AAClD;AAMO,IAAM,WAAW,CACtB,MACA,SAQG;AACH,QAAM,QAAmB,uBAAY,KAAK,SAAS,CAAC,MAAM,UAAU,GAAG,IAAI,CAAC;AAC5E,QAAM,cAAyB,uBAAY,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;AAAA,IACA,CAAC,UAAU,IAAI;AAAA,EACjB;AAEA,QAAM,OAAOA;AAAA,IACX,CAAC,QAAgB,WAAmB;AAClC,eAAS,EAAE,MAAM,aAAa,SAAS,EAAE,MAAM,QAAQ,OAAO,EAAE,CAAC;AAAA,IACnE;AAAA,IACA,CAAC,UAAU,IAAI;AAAA,EACjB;AAEA,QAAM,OAAOA;AAAA,IACX,CAAC,MAAc,OAAe;AAC5B,eAAS,EAAE,MAAM,aAAa,SAAS,EAAE,MAAM,MAAM,GAAG,EAAE,CAAC;AAAA,IAC7D;AAAA,IACA,CAAC,UAAU,IAAI;AAAA,EACjB;AAEA,SAAOD;AAAA,IACL,OAAO;AAAA,MACL;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,IACA,CAAC,QAAQ,QAAQ,SAAS,QAAQ,MAAM,IAAI;AAAA,EAC9C;AACF;;;AE1GA,YAAYE,iBAAgB;AAGrB,IAAM,UAAU,CACrB,SAC6F,sBAAU,IAAI;;;ACL7G,SAAS,eAAAC,cAAa,cAAc;AAEpC,YAAYC,iBAAgB;AASrB,IAAM,eAAe,CAC1B,MACA,UACA,eACM;AACN,QAAM,cAAc,OAA6B,MAAS;AAE1D,QAAM,SAASC;AAAA,IACb,CAAC,UAAsB;AACrB,YAAM,OAAO,YAAY,OAAO,YAAY,OAAO;AACnD,kBAAY,UAAU;AACtB,aAAO,SAAS,IAAI;AAAA,IACtB;AAAA,IACA,CAAC,QAAQ;AAAA,EACX;AAEA,SAAkB,wBAAY,KAAK,SAAS,QAAQ,UAAU;AAChE;","names":["useCallback","useMemo","LogixReact","useMemo","useCallback","LogixReact","useCallback","LogixReact","useCallback"]}
package/package.json ADDED
@@ -0,0 +1,62 @@
1
+ {
2
+ "name": "@logixjs/form",
3
+ "version": "0.0.1",
4
+ "description": "Form domain package for Logix v3 Trait system",
5
+ "files": [
6
+ "dist/**"
7
+ ],
8
+ "type": "module",
9
+ "main": "./dist/index.cjs",
10
+ "module": "./dist/index.js",
11
+ "types": "./dist/index.d.ts",
12
+ "exports": {
13
+ "./package.json": "./package.json",
14
+ ".": {
15
+ "types": "./dist/index.d.ts",
16
+ "import": "./dist/index.js",
17
+ "require": "./dist/index.cjs"
18
+ },
19
+ "./react": {
20
+ "types": "./dist/react/index.d.ts",
21
+ "import": "./dist/react/index.js",
22
+ "require": "./dist/react/index.cjs"
23
+ },
24
+ "./*": {
25
+ "types": "./dist/*.d.ts",
26
+ "import": "./dist/*.js",
27
+ "require": "./dist/*.cjs"
28
+ },
29
+ "./internal/*": null
30
+ },
31
+ "publishConfig": {
32
+ "access": "public"
33
+ },
34
+ "dependencies": {
35
+ "effect": "^3.19.8",
36
+ "@logixjs/core": "0.0.1",
37
+ "@logixjs/react": "0.1.0"
38
+ },
39
+ "devDependencies": {
40
+ "@effect/vitest": "^0.27.0",
41
+ "@types/react": "^19.2.2",
42
+ "react": "^19.2.0",
43
+ "tsup": "^8.0.0",
44
+ "typescript": "^5.8.2",
45
+ "vitest": "^4.0.15"
46
+ },
47
+ "peerDependencies": {
48
+ "effect": "^3.19.8",
49
+ "react": ">=18.0.0",
50
+ "@logixjs/core": "0.0.1"
51
+ },
52
+ "scripts": {
53
+ "build": "tsup --format cjs,esm --dts",
54
+ "dev": "tsup --watch",
55
+ "typecheck": "tsc -p tsconfig.json --noEmit",
56
+ "typecheck:test": "tsc -p tsconfig.test.json --noEmit",
57
+ "test": "vitest run",
58
+ "test:changed": "vitest run --changed",
59
+ "test:cache": "vitest run --cache",
60
+ "test:watch": "vitest"
61
+ }
62
+ }