@formvk/react 0.0.0-stage → 1.0.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 +16 -0
- package/README.md +59 -2
- package/dist/index.d.ts +231 -0
- package/dist/index.js +412 -0
- package/dist/index.js.map +1 -0
- package/package.json +44 -3
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# @formvk/react
|
|
2
|
+
|
|
3
|
+
## 1.0.0
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- 65c066c: 添加readme.md文档
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- Updated dependencies [65c066c]
|
|
12
|
+
- @formvk/core@1.0.0
|
|
13
|
+
- @formvk/reactive@1.0.0
|
|
14
|
+
- @formvk/reactive-react@1.0.0
|
|
15
|
+
- @formvk/schema@1.0.0
|
|
16
|
+
- @formvk/shared@1.0.0
|
package/README.md
CHANGED
|
@@ -1,3 +1,60 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @formvk/react
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
React bindings for Formvk. It connects the `@formvk/core` form model and `@formvk/schema` to React components, with field updates powered by `@formvk/reactive-react`.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
pnpm add @formvk/react react react-dom
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
`react` and `react-dom` (`>= 18`) are peer dependencies.
|
|
12
|
+
|
|
13
|
+
## Usage
|
|
14
|
+
|
|
15
|
+
```tsx
|
|
16
|
+
import { createForm, createSchema, createSchemaField, FormProvider } from '@formvk/react'
|
|
17
|
+
import { useState } from 'react'
|
|
18
|
+
|
|
19
|
+
function Input(props: { value?: string }) {
|
|
20
|
+
return <input value={props.value ?? ''} readOnly />
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
// schema and component factory are static: build them once at module scope
|
|
24
|
+
const { SchemaField, fragment: f } = createSchemaField({
|
|
25
|
+
components: { Input },
|
|
26
|
+
})
|
|
27
|
+
|
|
28
|
+
const schema = createSchema({
|
|
29
|
+
name: f.Input({ title: 'Name' }),
|
|
30
|
+
})
|
|
31
|
+
|
|
32
|
+
export default function App() {
|
|
33
|
+
// the form is a stateful model: create it lazily inside the component
|
|
34
|
+
const [form] = useState(() => createForm({ values: { name: '' } }))
|
|
35
|
+
|
|
36
|
+
return (
|
|
37
|
+
<FormProvider form={form}>
|
|
38
|
+
<SchemaField schema={schema} />
|
|
39
|
+
</FormProvider>
|
|
40
|
+
)
|
|
41
|
+
}
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## API
|
|
45
|
+
|
|
46
|
+
- **Components** — `FormProvider`, `SchemaField`, `createSchemaField`, `RecursionField`, `ExpressionScope`, `FormConsumer`, `ReactiveField`.
|
|
47
|
+
- **Hooks** — `useForm`, `useField`, `useFieldSchema`, `useAttach`, `useFormEffects`, `useParentForm`.
|
|
48
|
+
- **Helpers** — `createForm`, `connect`, `mapProps`, `mapReadPretty`.
|
|
49
|
+
- **Schema** — re-exports `@formvk/schema` (`createFragment`, `createSchema`, `ISchema`, expression types, ...).
|
|
50
|
+
|
|
51
|
+
Components that read observable state directly should be wrapped with `observer` from `@formvk/reactive-react`. `FormConsumer` exposes form state through a render prop.
|
|
52
|
+
|
|
53
|
+
## Documentation
|
|
54
|
+
|
|
55
|
+
- React API: https://formvk.github.io/core/api/react
|
|
56
|
+
- Getting started: https://formvk.github.io/core/guide/getting-started
|
|
57
|
+
|
|
58
|
+
## License
|
|
59
|
+
|
|
60
|
+
MIT
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,231 @@
|
|
|
1
|
+
import { AnyComponent } from '@formvk/schema';
|
|
2
|
+
import { ComponentProps as ComponentProps_2 } from 'react';
|
|
3
|
+
import { ComponentType } from 'react';
|
|
4
|
+
import { Form } from '@formvk/core';
|
|
5
|
+
import { FormPathPattern } from '@formvk/shared';
|
|
6
|
+
import { Fragment } from '@formvk/schema';
|
|
7
|
+
import { GeneralField } from '@formvk/core';
|
|
8
|
+
import { IFieldFactoryProps } from '@formvk/core';
|
|
9
|
+
import { IFormProps } from '@formvk/core';
|
|
10
|
+
import { ISchema } from '@formvk/schema';
|
|
11
|
+
import { JSX } from 'react';
|
|
12
|
+
import { NamedExoticComponent } from 'react';
|
|
13
|
+
import { ObjectField } from '@formvk/core';
|
|
14
|
+
import { PropsWithChildren } from 'react';
|
|
15
|
+
import { ReactFC } from '@formvk/reactive-react';
|
|
16
|
+
import { ReactNode } from 'react';
|
|
17
|
+
import { Schema } from '@formvk/schema';
|
|
18
|
+
import { SchemaKey } from '@formvk/schema';
|
|
19
|
+
import { SchemaPatchInput } from '@formvk/schema';
|
|
20
|
+
import { TPropsOfComponent } from '@formvk/schema';
|
|
21
|
+
|
|
22
|
+
/** 提取 React 组件定义的 props 类型;非组件类型退化为 never。 */
|
|
23
|
+
export declare type ComponentProps<T> = T extends ReactComponent ? ComponentProps_2<T> : never;
|
|
24
|
+
|
|
25
|
+
export declare function connect<T extends ReactComponent>(target: T, ...args: IComponentMapper[]): T;
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* React 侧表单工厂:core 的 Form 自身管理响应式状态,
|
|
29
|
+
* React 不会自动代理普通对象,无需 Vue 侧的 markRaw 处理。
|
|
30
|
+
*/
|
|
31
|
+
export declare function createForm<T extends object = any>(options?: IFormProps<T>): Form<T>;
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* 基于扁平组件映射与分类组件 map 创建 SchemaField + fragment:
|
|
35
|
+
* - voidComponents / arrayComponents 只接收组件 map,分类名由工厂内部提取后传给 fragment
|
|
36
|
+
* - 分类组件会自动合并进运行时组件映射,无需在 components 中重复注册
|
|
37
|
+
* - 返回的 SchemaField 已预绑定拍平后的组件与 scope,props 仍可传扁平 map 覆盖同名组件
|
|
38
|
+
* - fragment 包含 Field / Object / Array / Void / transform 与按组件名生成的动态构造器
|
|
39
|
+
* 组件 props、字段值与 scope 类型全部自动推断,无需手写类型参数。
|
|
40
|
+
*/
|
|
41
|
+
export declare function createSchemaField<F extends SchemaReactComponents = SchemaReactComponents, V extends SchemaReactComponents = {}, A extends SchemaReactComponents = {}, Scope extends object = Record<string, any>, Decorator extends AnyComponent<InferVoidProps<V, A>> = AnyComponent<InferVoidProps<V, A>>>(factoryOptions?: ISchemaFieldFactoryOptions<F, V, A, Scope, Decorator>): SchemaFieldFactoryResult<F, V, A, Scope, Decorator>;
|
|
42
|
+
|
|
43
|
+
/** 表达式作用域:与外层 scope 惰性合并,内层同名变量优先,Provider 天然隔离兄弟分支。 */
|
|
44
|
+
export declare function ExpressionScope(props: PropsWithChildren<IExpressionScopeProps>): JSX.Element;
|
|
45
|
+
|
|
46
|
+
export declare namespace ExpressionScope {
|
|
47
|
+
var displayName: string;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/** render props 形式读取 form,内部由 observer 追踪响应式状态,form 变化后自动刷新。 */
|
|
51
|
+
export declare const FormConsumer: NamedExoticComponent<Omit<{
|
|
52
|
+
children?: ReactNode | undefined;
|
|
53
|
+
}, "children"> & IFormConsumerProps> & {
|
|
54
|
+
readonly type: ReactFC<IFormConsumerProps>;
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* 挂载表单生命周期并注入 FormContext。
|
|
59
|
+
* 同时把字段 / schema / scope / options 四个上下文重置为空,
|
|
60
|
+
* 等价于 Vue 侧 useInjectionCleaner 的隔离效果,嵌套 FormProvider 不会串层。
|
|
61
|
+
*/
|
|
62
|
+
export declare function FormProvider(props: PropsWithChildren<IProviderProps>): JSX.Element;
|
|
63
|
+
|
|
64
|
+
export declare namespace FormProvider {
|
|
65
|
+
var displayName: string;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export declare type IComponentMapper<T extends ReactComponent = ReactComponent> = (target: T) => ReactComponent;
|
|
69
|
+
|
|
70
|
+
export declare interface IExpressionScopeProps {
|
|
71
|
+
value: any;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
export declare interface IFormConsumerProps {
|
|
75
|
+
children?: (renderProps: IFormConsumerRenderProps) => ReactNode;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export declare interface IFormConsumerRenderProps {
|
|
79
|
+
form: Form;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
export declare type InferArrayProps<A extends SchemaReactComponents> = {
|
|
83
|
+
[K in keyof A]: TPropsOfComponent<A[K]>;
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* 从扁平 components 与两个分类组件 map 分别推断 fragment 的三个 props map,组件 props 自动提取。
|
|
88
|
+
* 分类优先级与运行时递归渲染一致:array > void > field,已分类的名字不会出现在 field 映射中,
|
|
89
|
+
* 避免同一组件名同时命中 field / void / array 多个动态构造器重载。
|
|
90
|
+
* 分类泛型默认空 map,keyof 结果为 never,省略分类时不会污染 field 推断。
|
|
91
|
+
*/
|
|
92
|
+
export declare type InferFieldProps<F extends SchemaReactComponents, V extends SchemaReactComponents, A extends SchemaReactComponents> = {
|
|
93
|
+
[K in keyof F as K extends keyof V | keyof A ? never : K]: TPropsOfComponent<F[K]>;
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
export declare type InferVoidProps<V extends SchemaReactComponents, A extends SchemaReactComponents> = {
|
|
97
|
+
[K in keyof V as K extends keyof A ? never : K]: TPropsOfComponent<V[K]>;
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
export declare interface IProviderProps {
|
|
101
|
+
form: Form;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
export declare interface IReactiveFieldProps {
|
|
105
|
+
fieldType?: ReactiveFieldType;
|
|
106
|
+
fieldProps?: IFieldFactoryProps<any, any>;
|
|
107
|
+
/** RecursionField 按 schema.slot 分组生成的具名插槽节点 */
|
|
108
|
+
slots?: Record<string, React.ReactNode>;
|
|
109
|
+
children?: React.ReactNode;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
export declare interface IRecursionFieldProps {
|
|
113
|
+
schema: ISchema | Schema;
|
|
114
|
+
name?: SchemaKey;
|
|
115
|
+
basePath?: FormPathPattern;
|
|
116
|
+
onlyRenderProperties?: boolean;
|
|
117
|
+
onlyRenderSelf?: boolean;
|
|
118
|
+
mapProperties?: ISchemaMapper;
|
|
119
|
+
filterProperties?: ISchemaFilter;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
declare interface IRecycleTarget {
|
|
123
|
+
onMount: () => void;
|
|
124
|
+
onUnmount: () => void;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
export declare interface ISchemaFieldFactoryOptions<F extends SchemaReactComponents = SchemaReactComponents, V extends SchemaReactComponents = {}, A extends SchemaReactComponents = {}, Scope extends object = Record<string, any>, Decorator extends AnyComponent<InferVoidProps<V, A>> = AnyComponent<InferVoidProps<V, A>>> {
|
|
128
|
+
/** 扁平 name → component 映射,未声明分类的组件默认按 field 处理 */
|
|
129
|
+
components?: F;
|
|
130
|
+
/** void / 布局分类组件 map,自动合并进运行时组件映射 */
|
|
131
|
+
voidComponents?: V;
|
|
132
|
+
/** array 分类组件 map,自动合并进运行时组件映射 */
|
|
133
|
+
arrayComponents?: A;
|
|
134
|
+
/** 表达式与 reactions 的自定义 scope,传入后类型自动推断,无需手写泛型 */
|
|
135
|
+
scope?: Scope;
|
|
136
|
+
/** 默认装饰器,行为同 createFragment 的 defaultDecorator */
|
|
137
|
+
defaultDecorator?: Decorator;
|
|
138
|
+
/** 应用到 fragment 产出的每个 schema 上的 patch */
|
|
139
|
+
patches?: SchemaPatchInput | SchemaPatchInput[];
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
declare interface ISchemaFieldInnerProps extends ISchemaFieldProps {
|
|
143
|
+
/** createSchemaField 预绑定的 components 与 scope,直接使用 SchemaField 时不存在 */
|
|
144
|
+
prebound?: ISchemaFieldRuntimeOptions;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
export declare interface ISchemaFieldProps extends IRecursionFieldProps {
|
|
148
|
+
/** 扁平 name → component 映射 */
|
|
149
|
+
components?: SchemaReactComponents;
|
|
150
|
+
scope?: Record<string, any>;
|
|
151
|
+
/**
|
|
152
|
+
* schema 引用变化时重建字段,默认关闭。
|
|
153
|
+
* 仅建议在开发环境开启,且 schema 需要保持稳定引用。
|
|
154
|
+
*/
|
|
155
|
+
hotReload?: boolean;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
/** 注入后代组件的运行时选项,components 始终是扁平 name → component。 */
|
|
159
|
+
export declare interface ISchemaFieldRuntimeOptions {
|
|
160
|
+
components?: SchemaReactComponents;
|
|
161
|
+
scope?: Record<string, any>;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
export declare interface ISchemaFilter {
|
|
165
|
+
(schema: Schema, name: SchemaKey): boolean;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
export declare interface ISchemaMapper {
|
|
169
|
+
(schema: Schema, name: SchemaKey): ISchema | Schema | void;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
export declare type IStateMapper<Props = Record<string, any>> = Record<string, string | boolean> | ((props: Props, field: GeneralField) => Props);
|
|
173
|
+
|
|
174
|
+
export declare function mapProps<T extends ReactComponent = ReactComponent>(...args: IStateMapper[]): (target: T) => T;
|
|
175
|
+
|
|
176
|
+
export declare function mapReadPretty(component: ReactComponent, readPrettyProps?: Record<string, any>): <T extends ReactComponent>(target: T) => T;
|
|
177
|
+
|
|
178
|
+
export declare type ReactComponent = ComponentType<any>;
|
|
179
|
+
|
|
180
|
+
export declare const ReactiveField: NamedExoticComponent<Omit<{
|
|
181
|
+
children?: ReactNode | undefined;
|
|
182
|
+
}, keyof IReactiveFieldProps> & IReactiveFieldProps> & {
|
|
183
|
+
readonly type: ReactFC<IReactiveFieldProps>;
|
|
184
|
+
};
|
|
185
|
+
|
|
186
|
+
export declare type ReactiveFieldType = 'Field' | 'ObjectField' | 'ArrayField' | 'VoidField';
|
|
187
|
+
|
|
188
|
+
export declare function RecursionField(props: IRecursionFieldProps): JSX.Element;
|
|
189
|
+
|
|
190
|
+
export declare namespace RecursionField {
|
|
191
|
+
var displayName: string;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
export declare function SchemaField(props: ISchemaFieldInnerProps): JSX.Element;
|
|
195
|
+
|
|
196
|
+
export declare namespace SchemaField {
|
|
197
|
+
var displayName: string;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
/**
|
|
201
|
+
* createSchemaField 的返回值:
|
|
202
|
+
* - SchemaField:预绑定 components 与 scope 的渲染组件
|
|
203
|
+
* - fragment:同配置的 fragment 构造器集合(Field / Object / Array / Void / transform 与动态构造器)
|
|
204
|
+
*/
|
|
205
|
+
export declare type SchemaFieldFactoryResult<F extends SchemaReactComponents, V extends SchemaReactComponents, A extends SchemaReactComponents, Scope extends object, Decorator extends AnyComponent<InferVoidProps<V, A>>> = {
|
|
206
|
+
SchemaField: typeof SchemaField;
|
|
207
|
+
fragment: Fragment<InferFieldProps<F, V, A>, InferVoidProps<V, A>, InferArrayProps<A>, Scope, Decorator>;
|
|
208
|
+
};
|
|
209
|
+
|
|
210
|
+
export declare type SchemaReactComponents = Record<string, ReactComponent>;
|
|
211
|
+
|
|
212
|
+
/**
|
|
213
|
+
* 把字段生命周期挂到 React 组件生命周期上:
|
|
214
|
+
* target 变化时旧实例 onUnmount、新实例 onMount,组件卸载时清理当前实例。
|
|
215
|
+
*/
|
|
216
|
+
export declare function useAttach<T extends IRecycleTarget>(target: T | undefined): T | undefined;
|
|
217
|
+
|
|
218
|
+
export declare function useField<T = GeneralField>(): T | undefined;
|
|
219
|
+
|
|
220
|
+
export declare function useFieldSchema(): Schema | undefined;
|
|
221
|
+
|
|
222
|
+
export declare function useForm(): Form | undefined;
|
|
223
|
+
|
|
224
|
+
export declare function useFormEffects(effects?: (form: Form) => void): void;
|
|
225
|
+
|
|
226
|
+
export declare function useParentForm(): Form | ObjectField | undefined;
|
|
227
|
+
|
|
228
|
+
|
|
229
|
+
export * from "@formvk/schema";
|
|
230
|
+
|
|
231
|
+
export { }
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,412 @@
|
|
|
1
|
+
import { Schema as e, createFragment as t } from "@formvk/schema";
|
|
2
|
+
import { FormPath as n, each as r, isFn as i, isStr as a, isValid as o, lazyMerge as s, uid as c } from "@formvk/shared";
|
|
3
|
+
import { createContext as l, createElement as u, isValidElement as d, useContext as f, useEffect as p, useLayoutEffect as m, useMemo as h, useRef as g, useState as _ } from "react";
|
|
4
|
+
import { jsx as v } from "react/jsx-runtime";
|
|
5
|
+
import { observer as y } from "@formvk/reactive-react";
|
|
6
|
+
import { createForm as b, isObjectField as x, isVoidField as S } from "@formvk/core";
|
|
7
|
+
import { toJS as C } from "@formvk/reactive";
|
|
8
|
+
import w from "hoist-non-react-statics";
|
|
9
|
+
export * from "@formvk/schema";
|
|
10
|
+
// src/shared/context.ts
|
|
11
|
+
var T = l(void 0), E = l(void 0), D = l(void 0), O = l(void 0), k = l(void 0);
|
|
12
|
+
// src/components/ExpressionScope.tsx
|
|
13
|
+
function A(e) {
|
|
14
|
+
let t = f(O), n = h(() => s(t ?? {}, e.value), [t, e.value]);
|
|
15
|
+
return /* @__PURE__ */ v(O.Provider, {
|
|
16
|
+
value: n,
|
|
17
|
+
children: e.children
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
A.displayName = "ExpressionScope";
|
|
21
|
+
// src/hooks/useForm.ts
|
|
22
|
+
function j() {
|
|
23
|
+
return f(T);
|
|
24
|
+
}
|
|
25
|
+
// src/components/FormConsumer.tsx
|
|
26
|
+
var M = y((e) => {
|
|
27
|
+
let t = j(), { children: n } = e;
|
|
28
|
+
return typeof n == "function" ? n({ form: t }) : null;
|
|
29
|
+
});
|
|
30
|
+
M.displayName = "FormConsumer";
|
|
31
|
+
// src/hooks/useAttach.ts
|
|
32
|
+
function N(e) {
|
|
33
|
+
return p(() => (e?.onMount(), () => {
|
|
34
|
+
e?.onUnmount();
|
|
35
|
+
}), [e]), e;
|
|
36
|
+
}
|
|
37
|
+
// src/components/FormProvider.tsx
|
|
38
|
+
function P(e) {
|
|
39
|
+
let { form: t, children: n } = e;
|
|
40
|
+
return N(t), /* @__PURE__ */ v(T.Provider, {
|
|
41
|
+
value: t,
|
|
42
|
+
children: /* @__PURE__ */ v(E.Provider, {
|
|
43
|
+
value: void 0,
|
|
44
|
+
children: /* @__PURE__ */ v(D.Provider, {
|
|
45
|
+
value: void 0,
|
|
46
|
+
children: /* @__PURE__ */ v(O.Provider, {
|
|
47
|
+
value: void 0,
|
|
48
|
+
children: /* @__PURE__ */ v(k.Provider, {
|
|
49
|
+
value: void 0,
|
|
50
|
+
children: n
|
|
51
|
+
})
|
|
52
|
+
})
|
|
53
|
+
})
|
|
54
|
+
})
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
P.displayName = "FormProvider";
|
|
58
|
+
// src/hooks/useField.ts
|
|
59
|
+
function F() {
|
|
60
|
+
return f(E);
|
|
61
|
+
}
|
|
62
|
+
// src/utils/getRawComponent.ts
|
|
63
|
+
function I(e, t) {
|
|
64
|
+
return a(t) ? n.getIn(e, t) ?? t : t;
|
|
65
|
+
}
|
|
66
|
+
// src/utils/slots.ts
|
|
67
|
+
function L(e) {
|
|
68
|
+
return Array.isArray(e) ? e : e == null ? [] : [e];
|
|
69
|
+
}
|
|
70
|
+
// src/components/ReactiveField.tsx
|
|
71
|
+
function R(e) {
|
|
72
|
+
return e ? i(e) ? !0 : typeof e == "object" && ("$$typeof" in e || i(e.render)) : !1;
|
|
73
|
+
}
|
|
74
|
+
function z(e) {
|
|
75
|
+
return d(e) || a(e) ? e : R(e) ? u(e) : e;
|
|
76
|
+
}
|
|
77
|
+
function B(e, t) {
|
|
78
|
+
let n = { ...e };
|
|
79
|
+
if (!t) return n;
|
|
80
|
+
function i(e, t) {
|
|
81
|
+
let r = z(t), i = n[e];
|
|
82
|
+
n[e] = i === void 0 ? r : [].concat(L(i), L(r));
|
|
83
|
+
}
|
|
84
|
+
return a(t) || d(t) || R(t) ? i("default", t) : typeof t == "object" && r(t, (e, t) => {
|
|
85
|
+
i(t, e);
|
|
86
|
+
}), n;
|
|
87
|
+
}
|
|
88
|
+
function V(e) {
|
|
89
|
+
let t = {}, n = {};
|
|
90
|
+
return r(e, (e, r) => {
|
|
91
|
+
if (r.startsWith("on")) {
|
|
92
|
+
let t = `${r[2].toLowerCase()}${r.slice(3)}`;
|
|
93
|
+
n[t] = n[t] ?? e;
|
|
94
|
+
} else r.startsWith("@") ? n[r.slice(1)] = e : t[r] = e;
|
|
95
|
+
}), {
|
|
96
|
+
props: t,
|
|
97
|
+
events: n
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
function H(e) {
|
|
101
|
+
let t = {};
|
|
102
|
+
return r(e, (e, n) => {
|
|
103
|
+
t[`on${n.charAt(0).toUpperCase()}${n.slice(1)}`] = e;
|
|
104
|
+
}), t;
|
|
105
|
+
}
|
|
106
|
+
var U = y((e) => {
|
|
107
|
+
let t = j(), n = F(), r = f(k), { fieldType: i = "Field", fieldProps: o, slots: s, children: c } = e, l = h(() => {
|
|
108
|
+
let e = o ?? {};
|
|
109
|
+
return t?.[`create${i}`]?.({
|
|
110
|
+
...e,
|
|
111
|
+
basePath: e.basePath ?? n?.address
|
|
112
|
+
});
|
|
113
|
+
}, [
|
|
114
|
+
t,
|
|
115
|
+
i,
|
|
116
|
+
o,
|
|
117
|
+
n
|
|
118
|
+
]);
|
|
119
|
+
N(l);
|
|
120
|
+
let d = null;
|
|
121
|
+
if (!l) d = c ?? null;
|
|
122
|
+
else if (l.display !== "visible") d = null;
|
|
123
|
+
else {
|
|
124
|
+
let e = B(s ?? {}, l.content);
|
|
125
|
+
function t(e) {
|
|
126
|
+
if (!l.decoratorType) return e;
|
|
127
|
+
let t = I(r?.components, l.decoratorType), { props: n, events: i } = V(C(l.decorator[1]) || {});
|
|
128
|
+
return u(t, {
|
|
129
|
+
...n,
|
|
130
|
+
...H(i)
|
|
131
|
+
}, e);
|
|
132
|
+
}
|
|
133
|
+
function n() {
|
|
134
|
+
if (!l.componentType) return e.default ?? null;
|
|
135
|
+
let t = I(r?.components, l.componentType), { props: n, events: i } = V(C(l.component[1]) || {}), o = i.change, s = i.focus, c = i.blur;
|
|
136
|
+
i.change = (...e) => {
|
|
137
|
+
S(l) || l.onInput(...e), o?.(...e);
|
|
138
|
+
}, i.focus = (...e) => {
|
|
139
|
+
S(l) || l.onFocus(...e), s?.(...e);
|
|
140
|
+
}, i.blur = (...e) => {
|
|
141
|
+
S(l) || l.onBlur(...e), c?.(...e);
|
|
142
|
+
};
|
|
143
|
+
let d = {
|
|
144
|
+
...S(l) ? {} : {
|
|
145
|
+
disabled: l.pattern === "disabled" || l.pattern === "readPretty",
|
|
146
|
+
readOnly: l.pattern === "readOnly"
|
|
147
|
+
},
|
|
148
|
+
...n,
|
|
149
|
+
...S(l) ? {} : { value: l.value },
|
|
150
|
+
...H(i)
|
|
151
|
+
};
|
|
152
|
+
if (a(t)) {
|
|
153
|
+
let n = Object.keys(e).flatMap((t) => L(e[t]));
|
|
154
|
+
return u(t, d, ...n);
|
|
155
|
+
}
|
|
156
|
+
return u(t, {
|
|
157
|
+
...d,
|
|
158
|
+
slots: e
|
|
159
|
+
}, e.default);
|
|
160
|
+
}
|
|
161
|
+
d = t(n());
|
|
162
|
+
}
|
|
163
|
+
return /* @__PURE__ */ v(E.Provider, {
|
|
164
|
+
value: l,
|
|
165
|
+
children: d
|
|
166
|
+
});
|
|
167
|
+
});
|
|
168
|
+
U.displayName = "ReactiveField";
|
|
169
|
+
// src/components/RecursionField.tsx
|
|
170
|
+
function W(e) {
|
|
171
|
+
let t = Object.keys(e);
|
|
172
|
+
if (!t.length) return null;
|
|
173
|
+
let n = t.flatMap((t) => L(e[t]));
|
|
174
|
+
return u("div", { style: { display: "contents" } }, ...n);
|
|
175
|
+
}
|
|
176
|
+
function G(t) {
|
|
177
|
+
let n = F(), r = f(k) ?? {}, a = f(O), c = h(() => e.isSchemaInstance(t.schema) ? t.schema : new e(t.schema), [t.schema]), l = h(() => c.toFieldProps({
|
|
178
|
+
...r,
|
|
179
|
+
get scope() {
|
|
180
|
+
return s(r.scope, a ?? {});
|
|
181
|
+
}
|
|
182
|
+
}), [
|
|
183
|
+
c,
|
|
184
|
+
r,
|
|
185
|
+
a
|
|
186
|
+
]);
|
|
187
|
+
function u() {
|
|
188
|
+
return t.onlyRenderProperties ? t.basePath ?? (o(t.name) ? (n?.address ?? "").concat(t.name) : n?.address) : t.basePath ?? n?.address;
|
|
189
|
+
}
|
|
190
|
+
let d = u();
|
|
191
|
+
function p() {
|
|
192
|
+
if (t.onlyRenderSelf) return {};
|
|
193
|
+
let n = e.getOrderProperties(c);
|
|
194
|
+
if (!n.length) return {};
|
|
195
|
+
let r = {}, a = t.mapProperties, o = t.filterProperties;
|
|
196
|
+
return n.forEach(({ schema: e, key: t }, n) => {
|
|
197
|
+
let s = e;
|
|
198
|
+
if (i(a)) {
|
|
199
|
+
let n = a(e, t);
|
|
200
|
+
n && (s = n);
|
|
201
|
+
}
|
|
202
|
+
if (i(o) && o(s, t) === !1) return;
|
|
203
|
+
let c = s.slot ?? "default", l = /* @__PURE__ */ v(G, {
|
|
204
|
+
schema: s,
|
|
205
|
+
name: t,
|
|
206
|
+
basePath: d
|
|
207
|
+
}, `${n}-${String(t)}`);
|
|
208
|
+
(r[c] ??= []).push(l);
|
|
209
|
+
}), r;
|
|
210
|
+
}
|
|
211
|
+
let m = (e) => /* @__PURE__ */ v(D.Provider, {
|
|
212
|
+
value: c,
|
|
213
|
+
children: e
|
|
214
|
+
});
|
|
215
|
+
if (!o(t.name)) return m(W(p()));
|
|
216
|
+
let g = {
|
|
217
|
+
...l,
|
|
218
|
+
name: t.name,
|
|
219
|
+
basePath: d
|
|
220
|
+
};
|
|
221
|
+
return c.type === "object" ? t.onlyRenderProperties ? m(W(p())) : m(/* @__PURE__ */ v(U, {
|
|
222
|
+
fieldType: "ObjectField",
|
|
223
|
+
fieldProps: g,
|
|
224
|
+
slots: p()
|
|
225
|
+
})) : c.type === "array" ? m(/* @__PURE__ */ v(U, {
|
|
226
|
+
fieldType: "ArrayField",
|
|
227
|
+
fieldProps: g
|
|
228
|
+
})) : c.type === "void" ? t.onlyRenderProperties ? m(W(p())) : m(/* @__PURE__ */ v(U, {
|
|
229
|
+
fieldType: "VoidField",
|
|
230
|
+
fieldProps: g,
|
|
231
|
+
slots: p()
|
|
232
|
+
})) : m(/* @__PURE__ */ v(U, {
|
|
233
|
+
fieldType: "Field",
|
|
234
|
+
fieldProps: g
|
|
235
|
+
}));
|
|
236
|
+
}
|
|
237
|
+
G.displayName = "RecursionField";
|
|
238
|
+
// src/components/SchemaField.tsx
|
|
239
|
+
function K(e, t) {
|
|
240
|
+
return e ? `${e}.${t}` : String(t);
|
|
241
|
+
}
|
|
242
|
+
function q(e, t, n) {
|
|
243
|
+
let r = [], i = [], a = (e, t) => {
|
|
244
|
+
e.type === "array" && i.push(K(t, "*")), s(e, t);
|
|
245
|
+
}, s = (e, t) => {
|
|
246
|
+
let n = e.properties ?? {};
|
|
247
|
+
Object.keys(n).forEach((e) => {
|
|
248
|
+
let i = K(t, e);
|
|
249
|
+
r.push(i), a(n[e], i);
|
|
250
|
+
});
|
|
251
|
+
let i = e.items;
|
|
252
|
+
i && (Array.isArray(i) ? i : [i]).forEach((e) => {
|
|
253
|
+
e && s(e, K(t, "*"));
|
|
254
|
+
});
|
|
255
|
+
};
|
|
256
|
+
if (o(n)) {
|
|
257
|
+
let i = K(t, String(n));
|
|
258
|
+
r.push(i), a(e, i);
|
|
259
|
+
} else s(e, t);
|
|
260
|
+
return {
|
|
261
|
+
fields: r,
|
|
262
|
+
arrays: i
|
|
263
|
+
};
|
|
264
|
+
}
|
|
265
|
+
function J(t) {
|
|
266
|
+
return e.isSchemaInstance(t) ? t : new e({
|
|
267
|
+
type: "object",
|
|
268
|
+
...t
|
|
269
|
+
});
|
|
270
|
+
}
|
|
271
|
+
function Y(e, t, n, r, i) {
|
|
272
|
+
let a = q(t, r, i), o = q(n, r, i), s = new Set(o.fields);
|
|
273
|
+
a.fields.forEach((t) => {
|
|
274
|
+
s.has(t) || (e.deleteValuesIn(t), e.deleteInitialValuesIn(t));
|
|
275
|
+
}), (/* @__PURE__ */ new Set([
|
|
276
|
+
...a.fields,
|
|
277
|
+
...o.fields,
|
|
278
|
+
...a.arrays,
|
|
279
|
+
...o.arrays
|
|
280
|
+
])).forEach((t) => {
|
|
281
|
+
e.clearFormGraph(t, !1);
|
|
282
|
+
});
|
|
283
|
+
}
|
|
284
|
+
function X(e) {
|
|
285
|
+
let t = j(), r = F(), i = h(() => J(e.schema), [e.schema]), a = h(() => ({
|
|
286
|
+
components: {
|
|
287
|
+
...e.prebound?.components,
|
|
288
|
+
...e.components
|
|
289
|
+
},
|
|
290
|
+
scope: {
|
|
291
|
+
...e.prebound?.scope,
|
|
292
|
+
...e.scope
|
|
293
|
+
}
|
|
294
|
+
}), [
|
|
295
|
+
e.prebound,
|
|
296
|
+
e.components,
|
|
297
|
+
e.scope
|
|
298
|
+
]), [o, s] = _(0), c = g(i), l = e.basePath ? n.parse(e.basePath).toString() : r?.address?.toString() ?? "";
|
|
299
|
+
return m(() => {
|
|
300
|
+
if (!e.hotReload || !t || c.current === i) return;
|
|
301
|
+
let n = c.current;
|
|
302
|
+
c.current = i, Y(t, n, i, l, e.name), s((e) => e + 1);
|
|
303
|
+
}, [
|
|
304
|
+
e.hotReload,
|
|
305
|
+
t,
|
|
306
|
+
i,
|
|
307
|
+
l,
|
|
308
|
+
e.name
|
|
309
|
+
]), /* @__PURE__ */ v(k.Provider, {
|
|
310
|
+
value: a,
|
|
311
|
+
children: /* @__PURE__ */ v(O.Provider, {
|
|
312
|
+
value: a.scope,
|
|
313
|
+
children: /* @__PURE__ */ v(G, {
|
|
314
|
+
schema: i,
|
|
315
|
+
name: e.name,
|
|
316
|
+
basePath: e.basePath,
|
|
317
|
+
onlyRenderProperties: e.onlyRenderProperties,
|
|
318
|
+
onlyRenderSelf: e.onlyRenderSelf,
|
|
319
|
+
mapProperties: e.mapProperties,
|
|
320
|
+
filterProperties: e.filterProperties
|
|
321
|
+
}, o)
|
|
322
|
+
})
|
|
323
|
+
});
|
|
324
|
+
}
|
|
325
|
+
X.displayName = "SchemaField";
|
|
326
|
+
function Z(e = {}) {
|
|
327
|
+
let n = e.voidComponents ?? {}, r = e.arrayComponents ?? {}, i = {
|
|
328
|
+
...e.components,
|
|
329
|
+
...n,
|
|
330
|
+
...r
|
|
331
|
+
}, a = t({
|
|
332
|
+
patches: e.patches,
|
|
333
|
+
voidComponentNames: Object.keys(n),
|
|
334
|
+
arrayComponentNames: Object.keys(r),
|
|
335
|
+
defaultDecorator: e.defaultDecorator
|
|
336
|
+
}), o = {
|
|
337
|
+
components: i,
|
|
338
|
+
scope: e.scope
|
|
339
|
+
}, s = (e) => /* @__PURE__ */ v(X, {
|
|
340
|
+
...e,
|
|
341
|
+
prebound: o
|
|
342
|
+
});
|
|
343
|
+
return s.displayName = "SchemaField", {
|
|
344
|
+
SchemaField: s,
|
|
345
|
+
fragment: a
|
|
346
|
+
};
|
|
347
|
+
}
|
|
348
|
+
// src/hooks/useFieldSchema.ts
|
|
349
|
+
function Q() {
|
|
350
|
+
return f(D);
|
|
351
|
+
}
|
|
352
|
+
// src/hooks/useFormEffects.ts
|
|
353
|
+
function ee(e) {
|
|
354
|
+
let t = j();
|
|
355
|
+
p(() => {
|
|
356
|
+
if (!t || !e) return;
|
|
357
|
+
let n = c();
|
|
358
|
+
return t.addEffects(n, e), () => {
|
|
359
|
+
t.removeEffects(n);
|
|
360
|
+
};
|
|
361
|
+
}, [t, e]);
|
|
362
|
+
}
|
|
363
|
+
// src/hooks/useParentForm.ts
|
|
364
|
+
function te() {
|
|
365
|
+
let e = F(), t = j();
|
|
366
|
+
function n(e) {
|
|
367
|
+
return e ? x(e) ? e : n(e.parent) : t;
|
|
368
|
+
}
|
|
369
|
+
return n(e);
|
|
370
|
+
}
|
|
371
|
+
// src/shared/connect.tsx
|
|
372
|
+
function $(e) {
|
|
373
|
+
return e.displayName ?? e.name;
|
|
374
|
+
}
|
|
375
|
+
function ne(...e) {
|
|
376
|
+
function t(t, s) {
|
|
377
|
+
return e.reduce((e, t) => (i(t) ? e = Object.assign(e, t(e, s)) : r(t, (t, r) => {
|
|
378
|
+
let i = n.getIn(s, r), c = a(t) ? t : r, l = n.getIn(e, c);
|
|
379
|
+
r === "value" && t !== r && delete e.value, (!o(l) || o(i)) && n.setIn(e, c, i);
|
|
380
|
+
}), e), t);
|
|
381
|
+
}
|
|
382
|
+
return function(e) {
|
|
383
|
+
let n = y((n) => {
|
|
384
|
+
let r = F(), i = r ? t({ ...n }, r) : { ...n };
|
|
385
|
+
return u(e, i);
|
|
386
|
+
}), r = $(e);
|
|
387
|
+
return n.displayName = r ? `Connected${r}` : "ConnectedComponent", w(n, e), n;
|
|
388
|
+
};
|
|
389
|
+
}
|
|
390
|
+
function re(e, t) {
|
|
391
|
+
return function(n) {
|
|
392
|
+
let r = y((r) => {
|
|
393
|
+
let i = F(), a = i && !S(i) && i.pattern === "readPretty" ? e : n;
|
|
394
|
+
return u(a, {
|
|
395
|
+
...t,
|
|
396
|
+
...r
|
|
397
|
+
});
|
|
398
|
+
}), i = $(n);
|
|
399
|
+
return r.displayName = i ? `Read${i}` : "ReadComponent", w(r, n), r;
|
|
400
|
+
};
|
|
401
|
+
}
|
|
402
|
+
function ie(e, ...t) {
|
|
403
|
+
let n = t.reduce((e, t) => t(e), e), r = (e) => u(n, e);
|
|
404
|
+
return r.displayName = $(e), w(r, e), r;
|
|
405
|
+
}
|
|
406
|
+
// src/shared/createForm.ts
|
|
407
|
+
function ae(e) {
|
|
408
|
+
return b(e);
|
|
409
|
+
}
|
|
410
|
+
export { A as ExpressionScope, M as FormConsumer, P as FormProvider, U as ReactiveField, G as RecursionField, X as SchemaField, ie as connect, ae as createForm, Z as createSchemaField, ne as mapProps, re as mapReadPretty, N as useAttach, F as useField, Q as useFieldSchema, j as useForm, ee as useFormEffects, te as useParentForm };
|
|
411
|
+
|
|
412
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":["createCoreForm","createForm$1","hoistNonReactStatics","FormContext","createContext","FieldContext","SchemaContext","SchemaExpressionScopeContext","SchemaOptionsContext","ExpressionScope","parentScope","useContext","merged","useMemo","lazyMerge","props","useForm","FormConsumer","observer","form","children","useAttach","useEffect","target","FormProvider","useField","getRawComponent","isStr","component","FormPath","components","toArray","value","isReactComponentLike","isFn","renderContent","isValidElement","content","createElement","mergeSlots","result","slots","appendToSlot","rendered","origin","name","each","key","normalizeProps","events","eventName","toReactEventProps","handler","ReactiveField","parent","options","incomingSlots","field","factoryProps","fieldProps","fieldType","mergedSlots","renderDecorator","inner","Decorator","decoratorProps","toJS","renderComponent","Component","originProps","originChange","originFocus","originBlur","args","isVoidField","componentProps","slotChildren","resolveEmptySlot","names","RecursionField","scope","fieldSchema","Schema","getBasePath","isValid","basePath","generateSlots","properties","renderMap","mapProperties","filterProperties","item","itemSchema","mapped","slotName","node","index","withSchema","commonFieldProps","joinPath","prefix","segment","collectSchemaPaths","fields","arrays","walkNode","path","walkChildren","items","rootPath","schema","toSchema","applyHotReload","prevPaths","prev","nextPaths","next","nextFields","pattern","SchemaField","reloadVersion","setReloadVersion","useState","prevSchemaRef","useRef","useLayoutEffect","version","createSchemaField","voidComponents","factoryOptions","arrayComponents","flatComponents","fragment","createFragment","prebound","BoundSchemaField","useFieldSchema","useFormEffects","effects","id","uid","useParentForm","findObjectParent","isObjectField","getComponentName","mapProps","transform","mapper","extractValue","extract","targetValue","to","originalValue","input","Connected","nextProps","mapReadPretty","Read","Current","readPrettyProps","connect","current","createForm"],"sources":["../src/shared/context.ts","../src/components/ExpressionScope.tsx","../src/hooks/useForm.ts","../src/components/FormConsumer.tsx","../src/hooks/useAttach.ts","../src/components/FormProvider.tsx","../src/hooks/useField.ts","../src/utils/getRawComponent.ts","../src/utils/slots.ts","../src/components/ReactiveField.tsx","../src/components/RecursionField.tsx","../src/components/SchemaField.tsx","../src/hooks/useFieldSchema.ts","../src/hooks/useFormEffects.ts","../src/hooks/useParentForm.ts","../src/shared/connect.tsx","../src/shared/createForm.ts"],"sourcesContent":["import type { Form, GeneralField } from '@formvk/core'\nimport type { Schema } from '@formvk/schema'\nimport { createContext } from 'react'\n\nimport type { ISchemaFieldRuntimeOptions } from '../types'\n\nexport const FormContext = createContext<Form | undefined>(undefined)\n\nexport const FieldContext = createContext<GeneralField | undefined>(undefined)\n\nexport const SchemaContext = createContext<Schema | undefined>(undefined)\n\nexport const SchemaExpressionScopeContext = createContext<Record<string, any> | undefined>(undefined)\n\nexport const SchemaOptionsContext = createContext<ISchemaFieldRuntimeOptions | undefined>(undefined)\n","import { lazyMerge } from '@formvk/shared'\nimport { useContext, useMemo } from 'react'\nimport type { PropsWithChildren } from 'react'\n\nimport { SchemaExpressionScopeContext } from '../shared/context'\nimport type { IExpressionScopeProps } from '../types'\n\n/** 表达式作用域:与外层 scope 惰性合并,内层同名变量优先,Provider 天然隔离兄弟分支。 */\nexport function ExpressionScope(props: PropsWithChildren<IExpressionScopeProps>) {\n const parentScope = useContext(SchemaExpressionScopeContext)\n const merged = useMemo(() => lazyMerge(parentScope ?? {}, props.value), [parentScope, props.value])\n\n return <SchemaExpressionScopeContext.Provider value={merged}>{props.children}</SchemaExpressionScopeContext.Provider>\n}\n\nExpressionScope.displayName = 'ExpressionScope'\n","import type { Form } from '@formvk/core'\nimport { useContext } from 'react'\n\nimport { FormContext } from '../shared/context'\n\nexport function useForm(): Form | undefined {\n return useContext(FormContext)\n}\n","import type { Form } from '@formvk/core'\nimport { observer } from '@formvk/reactive-react'\nimport type { ReactNode } from 'react'\n\nimport { useForm } from '../hooks/useForm'\nimport type { IFormConsumerRenderProps } from '../types'\n\nexport interface IFormConsumerProps {\n children?: (renderProps: IFormConsumerRenderProps) => ReactNode\n}\n\n/** render props 形式读取 form,内部由 observer 追踪响应式状态,form 变化后自动刷新。 */\nexport const FormConsumer = observer((props: IFormConsumerProps) => {\n const form = useForm()\n const { children } = props\n if (typeof children !== 'function') return null\n return children({ form: form as Form })\n})\n\nFormConsumer.displayName = 'FormConsumer'\n","import { useEffect } from 'react'\n\ninterface IRecycleTarget {\n onMount: () => void\n onUnmount: () => void\n}\n\n/**\n * 把字段生命周期挂到 React 组件生命周期上:\n * target 变化时旧实例 onUnmount、新实例 onMount,组件卸载时清理当前实例。\n */\nexport function useAttach<T extends IRecycleTarget>(target: T | undefined): T | undefined {\n useEffect(() => {\n target?.onMount()\n return () => {\n target?.onUnmount()\n }\n }, [target])\n return target\n}\n","import type { PropsWithChildren } from 'react'\n\nimport { useAttach } from '../hooks/useAttach'\nimport {\n FieldContext,\n FormContext,\n SchemaContext,\n SchemaExpressionScopeContext,\n SchemaOptionsContext,\n} from '../shared/context'\nimport type { IProviderProps } from '../types'\n\n/**\n * 挂载表单生命周期并注入 FormContext。\n * 同时把字段 / schema / scope / options 四个上下文重置为空,\n * 等价于 Vue 侧 useInjectionCleaner 的隔离效果,嵌套 FormProvider 不会串层。\n */\nexport function FormProvider(props: PropsWithChildren<IProviderProps>) {\n const { form, children } = props\n useAttach(form)\n\n return (\n <FormContext.Provider value={form}>\n <FieldContext.Provider value={undefined}>\n <SchemaContext.Provider value={undefined}>\n <SchemaExpressionScopeContext.Provider value={undefined}>\n <SchemaOptionsContext.Provider value={undefined}>{children}</SchemaOptionsContext.Provider>\n </SchemaExpressionScopeContext.Provider>\n </SchemaContext.Provider>\n </FieldContext.Provider>\n </FormContext.Provider>\n )\n}\n\nFormProvider.displayName = 'FormProvider'\n","import type { GeneralField } from '@formvk/core'\nimport { useContext } from 'react'\n\nimport { FieldContext } from '../shared/context'\n\nexport function useField<T = GeneralField>(): T | undefined {\n return useContext(FieldContext) as T | undefined\n}\n","import { FormPath, isStr } from '@formvk/shared'\n\n/**\n * 解析 schema 中的组件描述:字符串按路径从 components 中查找,组件类型直接使用。\n * React 侧不存在响应式代理包裹,无需 toRaw。\n */\nexport function getRawComponent(components: Record<string, any> | undefined, component: any): any {\n if (isStr(component)) {\n return FormPath.getIn(components, component) ?? component\n }\n return component\n}\n","import type { ReactNode } from 'react'\n\n/** 具名插槽映射,default 为默认插槽,对应 Vue 侧的 slots 对象。 */\nexport type SlotMap = Record<string, ReactNode>\n\nexport function toArray(value: ReactNode): ReactNode[] {\n if (Array.isArray(value)) return value\n return value === undefined || value === null ? [] : [value]\n}\n","import { isVoidField } from '@formvk/core'\nimport type { GeneralField, IFieldFactoryProps } from '@formvk/core'\nimport { toJS } from '@formvk/reactive'\nimport { observer } from '@formvk/reactive-react'\nimport { each, isFn, isStr } from '@formvk/shared'\nimport { createElement, isValidElement, useContext, useMemo } from 'react'\nimport type { ReactNode } from 'react'\n\nimport { useAttach } from '../hooks/useAttach'\nimport { useField } from '../hooks/useField'\nimport { useForm } from '../hooks/useForm'\nimport { FieldContext, SchemaOptionsContext } from '../shared/context'\nimport type { IReactiveFieldProps, ISchemaFieldRuntimeOptions } from '../types'\nimport { getRawComponent } from '../utils/getRawComponent'\nimport { toArray } from '../utils/slots'\nimport type { SlotMap } from '../utils/slots'\n\nfunction isReactComponentLike(value: any): boolean {\n if (!value) return false\n if (isFn(value)) return true\n return typeof value === 'object' && ('$$typeof' in value || isFn(value.render))\n}\n\nfunction renderContent(content: any): ReactNode {\n if (isValidElement(content) || isStr(content)) return content\n if (isReactComponentLike(content)) return createElement(content)\n return content\n}\n\n/** 合并 RecursionField 生成的具名插槽与 schema 上的 content 声明。 */\nfunction mergeSlots(slots: SlotMap, content: any): SlotMap {\n const result: SlotMap = { ...slots }\n\n if (!content) return result\n\n function appendToSlot(name: string, value: any) {\n const rendered = renderContent(value)\n const origin = result[name]\n result[name] = origin === undefined ? rendered : ([] as ReactNode[]).concat(toArray(origin), toArray(rendered))\n }\n\n if (isStr(content) || isValidElement(content) || isReactComponentLike(content)) {\n appendToSlot('default', content)\n } else if (typeof content === 'object') {\n // 普通对象视为具名插槽内容映射\n each(content, (value, key) => {\n appendToSlot(key, value)\n })\n }\n\n return result\n}\n\nfunction normalizeProps(origin: Record<string, any>) {\n const props: Record<string, any> = {}\n const events: Record<string, any> = {}\n each(origin, (value, key) => {\n if (key.startsWith('on')) {\n const eventName = `${key[2].toLowerCase()}${key.slice(3)}`\n events[eventName] = events[eventName] ?? value\n } else if (key.startsWith('@')) {\n events[key.slice(1)] = value\n } else {\n props[key] = value\n }\n })\n return { props, events }\n}\n\nfunction toReactEventProps(events: Record<string, any>) {\n const props: Record<string, any> = {}\n each(events, (handler, name) => {\n props[`on${name.charAt(0).toUpperCase()}${name.slice(1)}`] = handler\n })\n return props\n}\n\nexport const ReactiveField = observer((props: IReactiveFieldProps) => {\n const form = useForm()\n const parent = useField()\n const options = useContext(SchemaOptionsContext) as ISchemaFieldRuntimeOptions | undefined\n\n const { fieldType = 'Field', fieldProps, slots: incomingSlots, children } = props\n\n // 与 Vue 侧 watch(fieldProps) 重建对齐:fieldProps 引用变化即创建新字段,旧实例由 useAttach 卸载\n const field = useMemo(() => {\n const factoryProps = (fieldProps ?? {}) as IFieldFactoryProps<any, any>\n return (form as any)?.[`create${fieldType}`]?.({\n ...factoryProps,\n basePath: factoryProps.basePath ?? parent?.address,\n }) as GeneralField | undefined\n }, [form, fieldType, fieldProps, parent])\n\n useAttach(field)\n\n let content: ReactNode = null\n\n if (!field) {\n content = children ?? null\n } else if (field.display !== 'visible') {\n content = null\n } else {\n const mergedSlots = mergeSlots(incomingSlots ?? {}, field.content)\n\n function renderDecorator(inner: ReactNode) {\n if (!field!.decoratorType) return inner\n const Decorator = getRawComponent(options?.components, field!.decoratorType)\n const { props: decoratorProps, events } = normalizeProps(toJS((field!.decorator as any)[1]) || {})\n return createElement(Decorator, { ...decoratorProps, ...toReactEventProps(events) }, inner)\n }\n\n function renderComponent(): ReactNode {\n if (!field!.componentType) return mergedSlots.default ?? null\n\n const Component = getRawComponent(options?.components, field!.componentType)\n const { props: originProps, events } = normalizeProps(toJS((field!.component as any)[1]) || {})\n const originChange = events.change\n const originFocus = events.focus\n const originBlur = events.blur\n\n events.change = (...args: any[]) => {\n if (!isVoidField(field!)) field!.onInput(...args)\n originChange?.(...args)\n }\n events.focus = (...args: any[]) => {\n if (!isVoidField(field!)) field!.onFocus(...args)\n originFocus?.(...args)\n }\n events.blur = (...args: any[]) => {\n if (!isVoidField(field!)) field!.onBlur(...args)\n originBlur?.(...args)\n }\n\n const componentProps: Record<string, any> = {\n ...(isVoidField(field!)\n ? {}\n : {\n disabled: field!.pattern === 'disabled' || field!.pattern === 'readPretty',\n readOnly: field!.pattern === 'readOnly',\n }),\n ...originProps,\n ...(isVoidField(field!) ? {} : { value: field!.value }),\n ...toReactEventProps(events),\n }\n\n if (isStr(Component)) {\n // 原生标签不接收 slots 对象,所有具名插槽拍平成 children\n const slotChildren = Object.keys(mergedSlots).flatMap(name => toArray(mergedSlots[name]))\n return createElement(Component, componentProps, ...slotChildren)\n }\n // React 组件通过 props.slots 读取具名插槽,default 同时作为 children 透传\n return createElement(Component, { ...componentProps, slots: mergedSlots }, mergedSlots.default)\n }\n\n content = renderDecorator(renderComponent())\n }\n\n return <FieldContext.Provider value={field}>{content}</FieldContext.Provider>\n})\n\nReactiveField.displayName = 'ReactiveField'\n","import { Schema } from '@formvk/schema'\nimport { isFn, isValid, lazyMerge } from '@formvk/shared'\nimport { createElement, useContext, useMemo } from 'react'\nimport type { ReactNode } from 'react'\n\nimport { useField } from '../hooks/useField'\nimport { SchemaContext, SchemaExpressionScopeContext, SchemaOptionsContext } from '../shared/context'\nimport type { IRecursionFieldProps, ISchemaFieldRuntimeOptions, ISchemaFilter, ISchemaMapper } from '../types'\nimport { toArray } from '../utils/slots'\nimport type { SlotMap } from '../utils/slots'\nimport { ReactiveField } from './ReactiveField'\n\nfunction resolveEmptySlot(slots: SlotMap) {\n const names = Object.keys(slots)\n if (!names.length) return null\n const children = names.flatMap(name => toArray(slots[name]))\n // 无名根节点不创建字段,用 display: contents 的包裹层保持 DOM 结构与 Vue 侧一致\n return createElement('div', { style: { display: 'contents' } }, ...children)\n}\n\nexport function RecursionField(props: IRecursionFieldProps) {\n const parent = useField()\n const options = (useContext(SchemaOptionsContext) ?? {}) as ISchemaFieldRuntimeOptions\n const scope = useContext(SchemaExpressionScopeContext)\n\n // React 无响应式代理包裹,Schema 实例直接缓存即可(对应 Vue 侧去掉 markRaw)\n const fieldSchema = useMemo(\n () => (Schema.isSchemaInstance(props.schema) ? props.schema : new Schema(props.schema as any)),\n [props.schema]\n )\n\n const fieldProps = useMemo(\n () =>\n fieldSchema.toFieldProps({\n ...options,\n get scope() {\n return lazyMerge(options.scope as any, scope ?? {})\n },\n }),\n [fieldSchema, options, scope]\n )\n\n function getBasePath() {\n if (props.onlyRenderProperties) {\n return (\n props.basePath ?? (isValid(props.name) ? (parent?.address ?? '').concat(props.name as any) : parent?.address)\n )\n }\n return props.basePath ?? parent?.address\n }\n\n const basePath = getBasePath()\n\n function generateSlots(): SlotMap {\n if (props.onlyRenderSelf) return {}\n const properties = Schema.getOrderProperties(fieldSchema)\n if (!properties.length) return {}\n\n const renderMap: Record<string, ReactNode[]> = {}\n const mapProperties = props.mapProperties as ISchemaMapper | undefined\n const filterProperties = props.filterProperties as ISchemaFilter | undefined\n\n properties.forEach(({ schema: item, key: name }, index) => {\n let itemSchema = item\n if (isFn(mapProperties)) {\n const mapped = mapProperties(item, name)\n if (mapped) itemSchema = mapped as Schema\n }\n if (isFn(filterProperties)) {\n if (filterProperties(itemSchema, name) === false) return\n }\n const slotName = itemSchema.slot ?? 'default'\n const node = (\n <RecursionField key={`${index}-${String(name)}`} schema={itemSchema} name={name} basePath={basePath} />\n )\n ;(renderMap[slotName] ??= []).push(node)\n })\n\n return renderMap\n }\n\n const withSchema = (content: ReactNode) => (\n <SchemaContext.Provider value={fieldSchema}>{content}</SchemaContext.Provider>\n )\n\n if (!isValid(props.name)) {\n return withSchema(resolveEmptySlot(generateSlots()))\n }\n\n const commonFieldProps = {\n ...fieldProps,\n name: props.name,\n basePath,\n }\n\n if (fieldSchema.type === 'object') {\n if (props.onlyRenderProperties) return withSchema(resolveEmptySlot(generateSlots()))\n return withSchema(<ReactiveField fieldType=\"ObjectField\" fieldProps={commonFieldProps} slots={generateSlots()} />)\n }\n\n if (fieldSchema.type === 'array') {\n return withSchema(<ReactiveField fieldType=\"ArrayField\" fieldProps={commonFieldProps} />)\n }\n\n if (fieldSchema.type === 'void') {\n if (props.onlyRenderProperties) return withSchema(resolveEmptySlot(generateSlots()))\n return withSchema(<ReactiveField fieldType=\"VoidField\" fieldProps={commonFieldProps} slots={generateSlots()} />)\n }\n\n return withSchema(<ReactiveField fieldType=\"Field\" fieldProps={commonFieldProps} />)\n}\n\nRecursionField.displayName = 'RecursionField'\n","import type { Form } from '@formvk/core'\nimport { createFragment, Schema } from '@formvk/schema'\nimport type { AnyComponent, ISchema, SchemaKey } from '@formvk/schema'\nimport { FormPath, isValid } from '@formvk/shared'\nimport { useLayoutEffect, useMemo, useRef, useState } from 'react'\n\nimport { useField } from '../hooks/useField'\nimport { useForm } from '../hooks/useForm'\nimport { SchemaExpressionScopeContext, SchemaOptionsContext } from '../shared/context'\nimport type {\n InferArrayProps,\n InferFieldProps,\n InferVoidProps,\n ISchemaFieldFactoryOptions,\n ISchemaFieldProps,\n ISchemaFieldRuntimeOptions,\n SchemaFieldFactoryResult,\n SchemaReactComponents,\n} from '../types'\nimport { RecursionField } from './RecursionField'\n\ninterface ISchemaFieldInnerProps extends ISchemaFieldProps {\n /** createSchemaField 预绑定的 components 与 scope,直接使用 SchemaField 时不存在 */\n prebound?: ISchemaFieldRuntimeOptions\n}\n\nfunction joinPath(prefix: string, segment: SchemaKey | '*') {\n return prefix ? `${prefix}.${segment}` : String(segment)\n}\n\ninterface ISchemaPaths {\n /** 字段的绝对路径,数组元素下标使用 * 通配 */\n fields: string[]\n /** 数组子树的清理模式,覆盖任意下标 */\n arrays: string[]\n}\n\n/**\n * 收集 schema 声明的字段路径,用于热更新时定位需要销毁的字段。\n * 数组元素的下标是运行时产物,这里统一用 * 通配。\n */\nfunction collectSchemaPaths(schema: Schema, basePath: string, name?: SchemaKey): ISchemaPaths {\n const fields: string[] = []\n const arrays: string[] = []\n\n const walkNode = (node: Schema, path: string) => {\n if (node.type === 'array') arrays.push(joinPath(path, '*'))\n walkChildren(node, path)\n }\n\n const walkChildren = (node: Schema, prefix: string) => {\n const properties = node.properties ?? {}\n Object.keys(properties).forEach(key => {\n const path = joinPath(prefix, key)\n fields.push(path)\n walkNode(properties[key], path)\n })\n const items = node.items\n if (items) {\n const itemSchemas = Array.isArray(items) ? items : [items]\n itemSchemas.forEach(item => {\n if (item) walkChildren(item, joinPath(prefix, '*'))\n })\n }\n }\n\n if (isValid(name)) {\n const rootPath = joinPath(basePath, String(name))\n fields.push(rootPath)\n walkNode(schema, rootPath)\n } else {\n walkChildren(schema, basePath)\n }\n\n return { fields, arrays }\n}\n\nfunction toSchema(schema: ISchema | Schema): Schema {\n return Schema.isSchemaInstance(schema) ? schema : new Schema({ type: 'object', ...schema })\n}\n\n/**\n * 热更新:销毁旧 schema 声明的字段(保留值),字段会在本次渲染的 fieldProps 更新后重建。\n */\nfunction applyHotReload(form: Form, prev: Schema, next: Schema, basePath: string, name?: SchemaKey) {\n const prevPaths = collectSchemaPaths(prev, basePath, name)\n const nextPaths = collectSchemaPaths(next, basePath, name)\n const nextFields = new Set(nextPaths.fields)\n\n prevPaths.fields.forEach(path => {\n if (nextFields.has(path)) return\n form.deleteValuesIn(path)\n form.deleteInitialValuesIn(path)\n })\n\n const patterns = new Set<string>([...prevPaths.fields, ...nextPaths.fields, ...prevPaths.arrays, ...nextPaths.arrays])\n patterns.forEach(pattern => {\n form.clearFormGraph(pattern, false)\n })\n}\n\nexport function SchemaField(props: ISchemaFieldInnerProps) {\n const form = useForm()\n const parent = useField()\n\n const fieldSchema = useMemo(() => toSchema(props.schema), [props.schema])\n\n const options = useMemo<ISchemaFieldRuntimeOptions>(\n () => ({\n components: { ...props.prebound?.components, ...props.components },\n scope: { ...props.prebound?.scope, ...props.scope },\n }),\n [props.prebound, props.components, props.scope]\n )\n\n // 对齐 Vue watch(schema, { flush: 'pre' }):外部 store 的销毁不能放在渲染期\n // (destroy 会调度其他 observer 组件更新,触发 React 跨组件 setState 告警)。\n // 改为 layout effect 中清理旧字段,再通过 key 让 RecursionField 子树整体重挂载;\n // layout effect 在浏览器绘制前同步完成重渲染,无中间态闪烁,ref 守卫保证 StrictMode 双调用幂等。\n const [reloadVersion, setReloadVersion] = useState(0)\n const prevSchemaRef = useRef<Schema>(fieldSchema)\n const basePath = props.basePath ? FormPath.parse(props.basePath).toString() : (parent?.address?.toString() ?? '')\n\n useLayoutEffect(() => {\n if (!props.hotReload || !form || prevSchemaRef.current === fieldSchema) return\n const prev = prevSchemaRef.current\n prevSchemaRef.current = fieldSchema\n applyHotReload(form, prev, fieldSchema, basePath, props.name)\n setReloadVersion(version => version + 1)\n }, [props.hotReload, form, fieldSchema, basePath, props.name])\n\n return (\n <SchemaOptionsContext.Provider value={options}>\n <SchemaExpressionScopeContext.Provider value={options.scope}>\n <RecursionField\n key={reloadVersion}\n schema={fieldSchema}\n name={props.name}\n basePath={props.basePath}\n onlyRenderProperties={props.onlyRenderProperties}\n onlyRenderSelf={props.onlyRenderSelf}\n mapProperties={props.mapProperties}\n filterProperties={props.filterProperties}\n />\n </SchemaExpressionScopeContext.Provider>\n </SchemaOptionsContext.Provider>\n )\n}\n\nSchemaField.displayName = 'SchemaField'\n\n/**\n * 基于扁平组件映射与分类组件 map 创建 SchemaField + fragment:\n * - voidComponents / arrayComponents 只接收组件 map,分类名由工厂内部提取后传给 fragment\n * - 分类组件会自动合并进运行时组件映射,无需在 components 中重复注册\n * - 返回的 SchemaField 已预绑定拍平后的组件与 scope,props 仍可传扁平 map 覆盖同名组件\n * - fragment 包含 Field / Object / Array / Void / transform 与按组件名生成的动态构造器\n * 组件 props、字段值与 scope 类型全部自动推断,无需手写类型参数。\n */\nexport function createSchemaField<\n F extends SchemaReactComponents = SchemaReactComponents,\n V extends SchemaReactComponents = {},\n A extends SchemaReactComponents = {},\n Scope extends object = Record<string, any>,\n Decorator extends AnyComponent<InferVoidProps<V, A>> = AnyComponent<InferVoidProps<V, A>>,\n>(\n factoryOptions: ISchemaFieldFactoryOptions<F, V, A, Scope, Decorator> = {}\n): SchemaFieldFactoryResult<F, V, A, Scope, Decorator> {\n const voidComponents = factoryOptions.voidComponents ?? {}\n const arrayComponents = factoryOptions.arrayComponents ?? {}\n const flatComponents: SchemaReactComponents = {\n ...factoryOptions.components,\n ...voidComponents,\n ...arrayComponents,\n }\n\n const fragment = createFragment<InferFieldProps<F, V, A>, InferVoidProps<V, A>, InferArrayProps<A>, Scope, Decorator>(\n {\n patches: factoryOptions.patches,\n voidComponentNames: Object.keys(voidComponents),\n arrayComponentNames: Object.keys(arrayComponents),\n defaultDecorator: factoryOptions.defaultDecorator,\n }\n )\n\n const prebound: ISchemaFieldRuntimeOptions = {\n components: flatComponents,\n scope: factoryOptions.scope,\n }\n\n const BoundSchemaField = (props: ISchemaFieldProps) => <SchemaField {...props} prebound={prebound} />\n BoundSchemaField.displayName = 'SchemaField'\n\n return { SchemaField: BoundSchemaField as typeof SchemaField, fragment }\n}\n","import type { Schema } from '@formvk/schema'\nimport { useContext } from 'react'\n\nimport { SchemaContext } from '../shared/context'\n\nexport function useFieldSchema(): Schema | undefined {\n return useContext(SchemaContext)\n}\n","import type { Form } from '@formvk/core'\nimport { uid } from '@formvk/shared'\nimport { useEffect } from 'react'\n\nimport { useForm } from './useForm'\n\nexport function useFormEffects(effects?: (form: Form) => void): void {\n const form = useForm()\n\n useEffect(() => {\n if (!form || !effects) return\n const id = uid()\n form.addEffects(id, effects)\n return () => {\n // 捕获注册时的 form,避免 form 替换后清理到了新实例上\n form.removeEffects(id)\n }\n }, [form, effects])\n}\n","import { isObjectField } from '@formvk/core'\nimport type { Form, GeneralField, ObjectField } from '@formvk/core'\n\nimport { useField } from './useField'\nimport { useForm } from './useForm'\n\nexport function useParentForm(): Form | ObjectField | undefined {\n const field = useField()\n const form = useForm()\n\n function findObjectParent(target?: GeneralField): Form | ObjectField | undefined {\n if (!target) return form\n if (isObjectField(target)) return target\n return findObjectParent(target.parent)\n }\n\n return findObjectParent(field)\n}\n","import { isVoidField } from '@formvk/core'\nimport type { GeneralField } from '@formvk/core'\nimport { observer } from '@formvk/reactive-react'\nimport { each, FormPath, isFn, isStr, isValid } from '@formvk/shared'\nimport hoistNonReactStatics from 'hoist-non-react-statics'\nimport { createElement } from 'react'\n\nimport { useField } from '../hooks/useField'\nimport type { IComponentMapper, IStateMapper, ReactComponent } from '../types'\n\nfunction getComponentName(component: ReactComponent): string | undefined {\n return component.displayName ?? component.name\n}\n\nexport function mapProps<T extends ReactComponent = ReactComponent>(...args: IStateMapper[]) {\n function transform(input: Record<string, any>, field: GeneralField) {\n return args.reduce((props, mapper) => {\n if (isFn(mapper)) {\n props = Object.assign(props, mapper(props, field))\n } else {\n each(mapper, (to, extract) => {\n const extractValue = FormPath.getIn(field, extract)\n const targetValue = isStr(to) ? to : extract\n const originalValue = FormPath.getIn(props, targetValue)\n if (extract === 'value') {\n if (to !== extract) {\n delete props.value\n }\n }\n if (isValid(originalValue) && !isValid(extractValue)) return\n FormPath.setIn(props, targetValue, extractValue)\n })\n }\n return props\n }, input)\n }\n\n return function (target: T): T {\n const Connected: ReactComponent = observer(props => {\n const field = useField()\n // 无字段上下文时原样透传,支持 connect 组件脱离表单单独使用\n const nextProps = field ? transform({ ...props }, field) : { ...props }\n return createElement(target, nextProps)\n })\n const name = getComponentName(target)\n Connected.displayName = name ? `Connected${name}` : 'ConnectedComponent'\n hoistNonReactStatics(Connected, target)\n return Connected as unknown as T\n }\n}\n\nexport function mapReadPretty(component: ReactComponent, readPrettyProps?: Record<string, any>) {\n return function <T extends ReactComponent>(target: T): T {\n const Read: ReactComponent = observer(props => {\n const field = useField()\n const Current = field && !isVoidField(field) && field.pattern === 'readPretty' ? component : target\n return createElement(Current, { ...readPrettyProps, ...props })\n })\n const name = getComponentName(target)\n Read.displayName = name ? `Read${name}` : 'ReadComponent'\n hoistNonReactStatics(Read, target)\n return Read as unknown as T\n }\n}\n\nexport function connect<T extends ReactComponent>(target: T, ...args: IComponentMapper[]): T {\n const Component = args.reduce<ReactComponent>((current, mapper) => mapper(current), target)\n const Connected: ReactComponent = props => createElement(Component, props)\n Connected.displayName = getComponentName(target)\n hoistNonReactStatics(Connected, target)\n return Connected as unknown as T\n}\n","import type { IFormProps } from '@formvk/core'\nimport { createForm as createCoreForm } from '@formvk/core'\n\n/**\n * React 侧表单工厂:core 的 Form 自身管理响应式状态,\n * React 不会自动代理普通对象,无需 Vue 侧的 markRaw 处理。\n */\nexport function createForm<T extends object = any>(options?: IFormProps<T>) {\n return createCoreForm<T>(options)\n}\n"],"mappings":";;;;;;;;;;AAMA,IAAaG,IAAcC,EAAgC,KAAA,CAAS,GAEvDC,IAAeD,EAAwC,KAAA,CAAS,GAEhEE,IAAgBF,EAAkC,KAAA,CAAS,GAE3DG,IAA+BH,EAA+C,KAAA,CAAS,GAEvFI,IAAuBJ,EAAsD,KAAA,CAAS;;ACNnG,SAAgBK,EAAgB,GAAiD;CAC/E,IAAMC,IAAcC,EAAWJ,CAA4B,GACrDK,IAASC,QAAcC,EAAUJ,KAAe,CAAC,GAAGK,EAAM,KAAK,GAAG,CAACL,GAAaK,EAAM,KAAK,CAAC;CAElG,OAAO,kBAACR,EAA6B,UAA9B;EAAuC,OAAOK;EAAS,UAAAG,EAAM;CAAgD,CAAA;AACtH;AAEA,EAAgB,cAAc;;ACV9B,SAAgBC,IAA4B;CAC1C,OAAOL,EAAWR,CAAW;AAC/B;;ACKA,IAAac,IAAeC,GAAU,MAA8B;CAClE,IAAMC,IAAOH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AAcsB,IAAO,OAAOA,MAAS,iBAC1C3C,EAAqB2J,GAAMtI,CAAM,GAC1BsI;CACT;AACF;AAEA,SAAgBG,GAAkC,GAAW,GAAGvF,GAA6B;CAC3F,IAAML,IAAYK,EAAK,QAAwB,GAAS,MAAW0E,EAAOc,CAAO,GAAG1I,CAAM,GACpFmI,KAA4B,MAASpH,EAAc8B,GAAWrD,CAAK;CAGzE,OAFA,EAAU,cAAciI,EAAiBzH,CAAM,GAC/CrB,EAAqBwJ,GAAWnI,CAAM,GAC/BmI;AACT;;AChEA,SAAgBQ,GAAmC,GAAyB;CAC1E,OAAOlK,EAAkBuD,CAAO;AAClC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,47 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@formvk/react",
|
|
3
|
-
"version": "
|
|
4
|
-
"
|
|
5
|
-
"
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Formvk React Bindings",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"form",
|
|
7
|
+
"formvk",
|
|
8
|
+
"formvk-react",
|
|
9
|
+
"react"
|
|
10
|
+
],
|
|
11
|
+
"license": "MIT",
|
|
12
|
+
"author": "yiyunwan",
|
|
13
|
+
"files": [
|
|
14
|
+
"dist",
|
|
15
|
+
"CHANGELOG.md"
|
|
16
|
+
],
|
|
17
|
+
"type": "module",
|
|
18
|
+
"main": "dist/index.js",
|
|
19
|
+
"module": "dist/index.js",
|
|
20
|
+
"types": "dist/index.d.ts",
|
|
21
|
+
"dependencies": {
|
|
22
|
+
"@formvk/core": "~1.0.0",
|
|
23
|
+
"@formvk/reactive": "~1.0.0",
|
|
24
|
+
"@formvk/reactive-react": "~1.0.0",
|
|
25
|
+
"@formvk/schema": "~1.0.0",
|
|
26
|
+
"@formvk/shared": "~1.0.0",
|
|
27
|
+
"hoist-non-react-statics": "^3.3.2"
|
|
28
|
+
},
|
|
29
|
+
"devDependencies": {
|
|
30
|
+
"@testing-library/react": "^16.3.3",
|
|
31
|
+
"@types/hoist-non-react-statics": "^3.3.7",
|
|
32
|
+
"@types/react": "^19.3.0",
|
|
33
|
+
"@types/react-dom": "^19.3.0",
|
|
34
|
+
"@vitejs/plugin-react": "^6.3.0",
|
|
35
|
+
"happy-dom": "^21.0.4",
|
|
36
|
+
"react": "^19.3.1",
|
|
37
|
+
"react-dom": "^19.3.1"
|
|
38
|
+
},
|
|
39
|
+
"peerDependencies": {
|
|
40
|
+
"react": ">=18",
|
|
41
|
+
"react-dom": ">=18"
|
|
42
|
+
},
|
|
43
|
+
"scripts": {
|
|
44
|
+
"build": "tsc --noEmit && vite build",
|
|
45
|
+
"test": "vitest"
|
|
46
|
+
}
|
|
6
47
|
}
|