@mastra/playground-ui 4.0.0-alpha.5 → 4.0.0-alpha.6
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/dist/components/dynamic-form/index.d.ts +2 -2
- package/dist/components/dynamic-form/utils.d.ts +0 -4
- package/dist/components/ui/alert.d.ts +8 -0
- package/dist/components/ui/autoform/AutoForm.d.ts +13 -0
- package/dist/components/ui/autoform/components/ArrayElementWrapper.d.ts +4 -0
- package/dist/components/ui/autoform/components/ArrayWrapper.d.ts +4 -0
- package/dist/components/ui/autoform/components/BooleanField.d.ts +4 -0
- package/dist/components/ui/autoform/components/DateField.d.ts +4 -0
- package/dist/components/ui/autoform/components/ErrorMessage.d.ts +5 -0
- package/dist/components/ui/autoform/components/FieldWrapper.d.ts +4 -0
- package/dist/components/ui/autoform/components/Form.d.ts +3 -0
- package/dist/components/ui/autoform/components/NumberField.d.ts +4 -0
- package/dist/components/ui/autoform/components/ObjectWrapper.d.ts +4 -0
- package/dist/components/ui/autoform/components/RecordField.d.ts +4 -0
- package/dist/components/ui/autoform/components/SelectField.d.ts +4 -0
- package/dist/components/ui/autoform/components/StringField.d.ts +4 -0
- package/dist/components/ui/autoform/components/SubmitButton.d.ts +5 -0
- package/dist/components/ui/autoform/index.d.ts +4 -0
- package/dist/components/ui/autoform/types.d.ts +5 -0
- package/dist/components/ui/autoform/utils.d.ts +1 -0
- package/dist/components/ui/autoform/zodProvider/field-type-inference.d.ts +4 -0
- package/dist/components/ui/autoform/zodProvider/index.d.ts +9 -0
- package/dist/components/ui/card.d.ts +8 -0
- package/dist/components/ui/checkbox.d.ts +4 -0
- package/dist/components/ui/date-picker.d.ts +2 -2
- package/dist/components/ui/form.d.ts +23 -0
- package/dist/components/ui/toggle.d.ts +12 -0
- package/dist/hooks/use-workflows.d.ts +0 -4
- package/dist/index.d.ts +1 -0
- package/dist/index.es.js +354 -897
- package/dist/index.es.js.map +1 -1
- package/package.json +12 -7
- package/dist/components/dynamic-form/default-field-map.d.ts +0 -16
- package/dist/components/dynamic-form/fields/array-field.d.ts +0 -17
- package/dist/components/dynamic-form/fields/boolean-field.d.ts +0 -12
- package/dist/components/dynamic-form/fields/creatable-field.d.ts +0 -17
- package/dist/components/dynamic-form/fields/date-field.d.ts +0 -12
- package/dist/components/dynamic-form/fields/enum-field.d.ts +0 -16
- package/dist/components/dynamic-form/fields/index.d.ts +0 -10
- package/dist/components/dynamic-form/fields/number-field.d.ts +0 -12
- package/dist/components/dynamic-form/fields/object-field.d.ts +0 -27
- package/dist/components/dynamic-form/fields/record-field.d.ts +0 -14
- package/dist/components/dynamic-form/fields/string-field.d.ts +0 -14
- package/dist/components/dynamic-form/fields/union-field.d.ts +0 -28
- package/dist/components/dynamic-form/resolvers/index.d.ts +0 -4
- package/dist/components/dynamic-form/schema-resolver.d.ts +0 -21
- package/dist/components/dynamic-form/schema.d.ts +0 -70
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mastra/playground-ui",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "4.0.0-alpha.
|
|
4
|
+
"version": "4.0.0-alpha.6",
|
|
5
5
|
"description": "Mastra Playground components",
|
|
6
6
|
"main": "dist/index.umd.js",
|
|
7
7
|
"module": "dist/index.es.js",
|
|
@@ -30,12 +30,16 @@
|
|
|
30
30
|
"@assistant-ui/react": "^0.7.91",
|
|
31
31
|
"@assistant-ui/react-markdown": "^0.7.21",
|
|
32
32
|
"@assistant-ui/react-syntax-highlighter": "^0.7.10",
|
|
33
|
+
"@autoform/core": "^2.1.0",
|
|
34
|
+
"@autoform/react": "^3.0.0",
|
|
35
|
+
"@autoform/zod": "^2.1.0",
|
|
33
36
|
"@codemirror/lang-json": "^6.0.1",
|
|
34
37
|
"@dagrejs/dagre": "^1.1.4",
|
|
35
|
-
"@hookform/resolvers": "^3.
|
|
38
|
+
"@hookform/resolvers": "^3.10.0",
|
|
36
39
|
"@lezer/highlight": "^1.2.1",
|
|
37
40
|
"@lukeed/uuid": "^2.0.1",
|
|
38
41
|
"@radix-ui/react-avatar": "^1.1.3",
|
|
42
|
+
"@radix-ui/react-checkbox": "^1.1.4",
|
|
39
43
|
"@radix-ui/react-collapsible": "^1.1.3",
|
|
40
44
|
"@radix-ui/react-dialog": "^1.1.6",
|
|
41
45
|
"@radix-ui/react-label": "^2.1.2",
|
|
@@ -43,8 +47,9 @@
|
|
|
43
47
|
"@radix-ui/react-scroll-area": "^1.2.3",
|
|
44
48
|
"@radix-ui/react-select": "^2.1.6",
|
|
45
49
|
"@radix-ui/react-slot": "^1.1.2",
|
|
46
|
-
"@radix-ui/react-switch": "^1.1.
|
|
50
|
+
"@radix-ui/react-switch": "^1.1.3",
|
|
47
51
|
"@radix-ui/react-tabs": "^1.1.2",
|
|
52
|
+
"@radix-ui/react-toggle": "^1.1.2",
|
|
48
53
|
"@radix-ui/react-tooltip": "^1.1.8",
|
|
49
54
|
"@tanstack/react-table": "^8.21.2",
|
|
50
55
|
"@types/react-syntax-highlighter": "^15.5.13",
|
|
@@ -57,8 +62,8 @@
|
|
|
57
62
|
"motion": "^12.4.2",
|
|
58
63
|
"prism-react-renderer": "^2.4.0",
|
|
59
64
|
"react-code-block": "1.1.1",
|
|
60
|
-
"react-day-picker": "^
|
|
61
|
-
"react-hook-form": "^7.
|
|
65
|
+
"react-day-picker": "^8.10.1",
|
|
66
|
+
"react-hook-form": "^7.54.2",
|
|
62
67
|
"react-markdown": "^9.1.0",
|
|
63
68
|
"react-resizable-panels": "^2.1.7",
|
|
64
69
|
"react-syntax-highlighter": "^15.6.1",
|
|
@@ -76,14 +81,14 @@
|
|
|
76
81
|
"use-debounce": "^10.0.4",
|
|
77
82
|
"zod": "^3.24.2",
|
|
78
83
|
"zustand": "^5.0.3",
|
|
79
|
-
"@mastra/client-js": "^0.1.14-alpha.
|
|
84
|
+
"@mastra/client-js": "^0.1.14-alpha.6"
|
|
80
85
|
},
|
|
81
86
|
"peerDependencies": {
|
|
82
87
|
"lucide-react": "^0.474.0",
|
|
83
88
|
"react": ">=19.0.0",
|
|
84
89
|
"react-dom": ">=19.0.0",
|
|
85
90
|
"tailwindcss": "^3.0.0",
|
|
86
|
-
"@mastra/core": "^0.8.0-alpha.
|
|
91
|
+
"@mastra/core": "^0.8.0-alpha.6"
|
|
87
92
|
},
|
|
88
93
|
"devDependencies": {
|
|
89
94
|
"@types/node": "^20.17.27",
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { FieldProps } from './schema';
|
|
2
|
-
|
|
3
|
-
export declare function getDefaultFieldMap(): {
|
|
4
|
-
STRING: (props: FieldProps) => import("react/jsx-runtime").JSX.Element;
|
|
5
|
-
NUMBER: (props: FieldProps) => import("react/jsx-runtime").JSX.Element;
|
|
6
|
-
BOOLEAN: (props: FieldProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
-
DATE: (props: FieldProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
-
ENUM: (props: FieldProps) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
-
ARRAY: (props: FieldProps) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
-
RECORD: (props: FieldProps) => import("react/jsx-runtime").JSX.Element;
|
|
11
|
-
OBJECT: (props: FieldProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
12
|
-
UNION: (props: FieldProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
13
|
-
CREATABLE: (props: FieldProps) => import("react/jsx-runtime").JSX.Element;
|
|
14
|
-
SELECT: (props: FieldProps) => import("react/jsx-runtime").JSX.Element;
|
|
15
|
-
MULTI_SELECT: (props: FieldProps) => import("react/jsx-runtime").JSX.Element;
|
|
16
|
-
};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { Control } from 'react-hook-form';
|
|
2
|
-
import * as React from 'react';
|
|
3
|
-
interface ArrayFieldProps {
|
|
4
|
-
name: string;
|
|
5
|
-
control: Control<any>;
|
|
6
|
-
renderField: (props: {
|
|
7
|
-
fieldName: string;
|
|
8
|
-
index: number;
|
|
9
|
-
}) => React.ReactNode;
|
|
10
|
-
handleFieldChange?: (props: {
|
|
11
|
-
key: string;
|
|
12
|
-
value: any[];
|
|
13
|
-
}) => void;
|
|
14
|
-
isStringField?: boolean;
|
|
15
|
-
}
|
|
16
|
-
export declare function ArrayField({ name, control, renderField, isStringField }: ArrayFieldProps): import("react/jsx-runtime").JSX.Element;
|
|
17
|
-
export {};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { Control } from 'react-hook-form';
|
|
2
|
-
|
|
3
|
-
interface BooleanFieldProps {
|
|
4
|
-
name: string;
|
|
5
|
-
control: Control<any>;
|
|
6
|
-
handleFieldChange?: (props: {
|
|
7
|
-
key: string;
|
|
8
|
-
value: boolean;
|
|
9
|
-
}) => void;
|
|
10
|
-
}
|
|
11
|
-
export declare function BooleanField({ name, control, handleFieldChange }: BooleanFieldProps): import("react/jsx-runtime").JSX.Element;
|
|
12
|
-
export {};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { Control } from 'react-hook-form';
|
|
2
|
-
|
|
3
|
-
interface CreatableFieldProps {
|
|
4
|
-
name: string;
|
|
5
|
-
control: Control<any>;
|
|
6
|
-
options?: {
|
|
7
|
-
label: string;
|
|
8
|
-
value: string;
|
|
9
|
-
}[];
|
|
10
|
-
handleFieldChange?: (props: {
|
|
11
|
-
key: string;
|
|
12
|
-
value: string[];
|
|
13
|
-
}) => void;
|
|
14
|
-
placeholder?: string;
|
|
15
|
-
}
|
|
16
|
-
export declare function CreatableField({ name, control, options, handleFieldChange, placeholder }: CreatableFieldProps): import("react/jsx-runtime").JSX.Element;
|
|
17
|
-
export {};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { Control } from 'react-hook-form';
|
|
2
|
-
|
|
3
|
-
interface DateFieldProps {
|
|
4
|
-
name: string;
|
|
5
|
-
control: Control<any>;
|
|
6
|
-
handleFieldChange?: (props: {
|
|
7
|
-
key: string;
|
|
8
|
-
value: string | Date | null | undefined;
|
|
9
|
-
}) => void;
|
|
10
|
-
}
|
|
11
|
-
export declare function DateField({ name, control, handleFieldChange }: DateFieldProps): import("react/jsx-runtime").JSX.Element;
|
|
12
|
-
export {};
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { Control } from 'react-hook-form';
|
|
2
|
-
|
|
3
|
-
interface EnumFieldProps {
|
|
4
|
-
name: string;
|
|
5
|
-
control: Control<any>;
|
|
6
|
-
options: {
|
|
7
|
-
label: string;
|
|
8
|
-
value: string;
|
|
9
|
-
}[];
|
|
10
|
-
handleFieldChange?: (props: {
|
|
11
|
-
key: string;
|
|
12
|
-
value: string;
|
|
13
|
-
}) => void;
|
|
14
|
-
}
|
|
15
|
-
export declare function EnumField({ name, control, options, handleFieldChange }: EnumFieldProps): import("react/jsx-runtime").JSX.Element;
|
|
16
|
-
export {};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export { ArrayField } from './array-field';
|
|
2
|
-
export { BooleanField } from './boolean-field';
|
|
3
|
-
export { CreatableField } from './creatable-field';
|
|
4
|
-
export { DateField } from './date-field';
|
|
5
|
-
export { EnumField } from './enum-field';
|
|
6
|
-
export { StringField } from './string-field';
|
|
7
|
-
export { UnionField } from './union-field';
|
|
8
|
-
export { ObjectField } from './object-field';
|
|
9
|
-
export { NumberField } from './number-field';
|
|
10
|
-
export { RecordField } from './record-field';
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { Control } from 'react-hook-form';
|
|
2
|
-
|
|
3
|
-
interface NumberFieldProps {
|
|
4
|
-
name: string;
|
|
5
|
-
control: Control<any>;
|
|
6
|
-
handleFieldChange?: (props: {
|
|
7
|
-
key: string;
|
|
8
|
-
value: number;
|
|
9
|
-
}) => void;
|
|
10
|
-
}
|
|
11
|
-
export declare function NumberField({ name, control, handleFieldChange }: NumberFieldProps): import("react/jsx-runtime").JSX.Element;
|
|
12
|
-
export {};
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { ZodSchema } from 'zod';
|
|
2
|
-
import * as React from 'react';
|
|
3
|
-
interface ObjectFieldProps {
|
|
4
|
-
renderDynamicForm: (props: {
|
|
5
|
-
schema: ZodSchema;
|
|
6
|
-
handleFieldChange: (field: string, value: any) => void;
|
|
7
|
-
control: any;
|
|
8
|
-
formValues: Record<string, any>;
|
|
9
|
-
errors: Record<string, any>;
|
|
10
|
-
parentField: string;
|
|
11
|
-
action?: any;
|
|
12
|
-
isOptional?: boolean;
|
|
13
|
-
depth?: number;
|
|
14
|
-
}) => React.ReactNode;
|
|
15
|
-
schema: ZodSchema;
|
|
16
|
-
handleFieldChange: (field: string, value: any) => void;
|
|
17
|
-
control: any;
|
|
18
|
-
formValues: Record<string, any>;
|
|
19
|
-
errors: Record<string, any>;
|
|
20
|
-
parentField: string;
|
|
21
|
-
action?: any;
|
|
22
|
-
isArray?: boolean;
|
|
23
|
-
isOptional?: boolean;
|
|
24
|
-
depth?: number;
|
|
25
|
-
}
|
|
26
|
-
export declare function ObjectField({ renderDynamicForm, schema, handleFieldChange, control, formValues, errors, parentField, action, isArray, isOptional, depth, }: ObjectFieldProps): import("react/jsx-runtime").JSX.Element;
|
|
27
|
-
export {};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { Control } from 'react-hook-form';
|
|
2
|
-
import { ZodSchema } from 'zod';
|
|
3
|
-
|
|
4
|
-
interface RecordFieldProps {
|
|
5
|
-
name: string;
|
|
6
|
-
control: Control<any>;
|
|
7
|
-
innerSchema?: ZodSchema;
|
|
8
|
-
handleFieldChange?: (props: {
|
|
9
|
-
key: string;
|
|
10
|
-
value: Record<string, any>;
|
|
11
|
-
}) => void;
|
|
12
|
-
}
|
|
13
|
-
export declare function RecordField({ name, control, handleFieldChange }: RecordFieldProps): import("react/jsx-runtime").JSX.Element;
|
|
14
|
-
export {};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { Control } from 'react-hook-form';
|
|
2
|
-
|
|
3
|
-
interface StringFieldProps {
|
|
4
|
-
name: string;
|
|
5
|
-
control: Control<any>;
|
|
6
|
-
handleFieldChange?: (props: {
|
|
7
|
-
key: string;
|
|
8
|
-
value: any;
|
|
9
|
-
}) => void;
|
|
10
|
-
isMultiline?: boolean;
|
|
11
|
-
placeholder?: string;
|
|
12
|
-
}
|
|
13
|
-
export declare function StringField({ name, control, handleFieldChange, isMultiline, placeholder }: StringFieldProps): import("react/jsx-runtime").JSX.Element;
|
|
14
|
-
export {};
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { ZodUnion } from 'zod';
|
|
2
|
-
import * as React from 'react';
|
|
3
|
-
interface UnionComponentProps {
|
|
4
|
-
renderDynamicForm: (props: {
|
|
5
|
-
schema: ZodUnion<any>;
|
|
6
|
-
handleFieldChange: (field: string, value: any) => void;
|
|
7
|
-
control: any;
|
|
8
|
-
formValues: Record<string, any>;
|
|
9
|
-
errors: Record<string, any>;
|
|
10
|
-
parentField: string;
|
|
11
|
-
action?: any;
|
|
12
|
-
isOptional?: boolean;
|
|
13
|
-
isNullable?: boolean;
|
|
14
|
-
depth?: number;
|
|
15
|
-
}) => React.ReactNode;
|
|
16
|
-
schema: ZodUnion<any>;
|
|
17
|
-
handleFieldChange: (field: string, value: any) => void;
|
|
18
|
-
control: any;
|
|
19
|
-
formValues: Record<string, any>;
|
|
20
|
-
errors: Record<string, any>;
|
|
21
|
-
parentField: string;
|
|
22
|
-
action?: any;
|
|
23
|
-
isOptional?: boolean;
|
|
24
|
-
isNullable?: boolean;
|
|
25
|
-
depth?: number;
|
|
26
|
-
}
|
|
27
|
-
export declare function UnionField({ renderDynamicForm, schema, handleFieldChange, control, formValues, errors, parentField, action, isOptional, isNullable, depth, }: UnionComponentProps): import("react/jsx-runtime").JSX.Element | null;
|
|
28
|
-
export {};
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { Control, FieldErrors } from 'react-hook-form';
|
|
2
|
-
import { z } from 'zod';
|
|
3
|
-
|
|
4
|
-
interface ResolveSchemaProps {
|
|
5
|
-
schema: z.ZodSchema;
|
|
6
|
-
parentField: string;
|
|
7
|
-
control: Control<any>;
|
|
8
|
-
formValues: any;
|
|
9
|
-
errors: FieldErrors;
|
|
10
|
-
handleFieldChange: (props: {
|
|
11
|
-
key: string | number | symbol;
|
|
12
|
-
value: any;
|
|
13
|
-
}) => void;
|
|
14
|
-
isArray?: boolean;
|
|
15
|
-
isOptional?: boolean;
|
|
16
|
-
isNullable?: boolean;
|
|
17
|
-
}
|
|
18
|
-
export declare function resolveSchema({ schema, parentField, control, formValues, errors, handleFieldChange, isOptional, isNullable, depth, }: ResolveSchemaProps & {
|
|
19
|
-
depth?: number;
|
|
20
|
-
}): import("react/jsx-runtime").JSX.Element | (import("react/jsx-runtime").JSX.Element | null)[] | null;
|
|
21
|
-
export {};
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
import { Control } from 'react-hook-form';
|
|
2
|
-
import { ZodSchema, z } from 'zod';
|
|
3
|
-
import * as React from 'react';
|
|
4
|
-
type ActionVariables = Record<string, any>;
|
|
5
|
-
export declare enum FormConfigType {
|
|
6
|
-
STRING = "STRING",
|
|
7
|
-
NUMBER = "NUMBER",
|
|
8
|
-
DATE = "DATE",
|
|
9
|
-
ENUM = "ENUM",
|
|
10
|
-
ARRAY = "ARRAY",
|
|
11
|
-
BOOLEAN = "BOOLEAN",
|
|
12
|
-
RECORD = "RECORD",
|
|
13
|
-
OBJECT = "OBJECT",
|
|
14
|
-
UNION = "UNION",
|
|
15
|
-
CREATABLE = "CREATABLE",
|
|
16
|
-
SELECT = "SELECT",
|
|
17
|
-
MULTI_SELECT = "MULTI_SELECT"
|
|
18
|
-
}
|
|
19
|
-
type FormConfig = {
|
|
20
|
-
type: FormConfigType;
|
|
21
|
-
options?: {
|
|
22
|
-
label: string;
|
|
23
|
-
value: string;
|
|
24
|
-
}[];
|
|
25
|
-
isOptional?: boolean;
|
|
26
|
-
hasEffects?: boolean;
|
|
27
|
-
innerSchema?: ZodSchema;
|
|
28
|
-
};
|
|
29
|
-
export declare function getFormConfigTypesFromSchemaDef({ schema, isOptional, }: {
|
|
30
|
-
schema: ZodSchema<any>;
|
|
31
|
-
isOptional?: boolean;
|
|
32
|
-
}): FormConfig;
|
|
33
|
-
export type FieldProps = {
|
|
34
|
-
name: string;
|
|
35
|
-
options?: {
|
|
36
|
-
label: string;
|
|
37
|
-
value: string;
|
|
38
|
-
}[];
|
|
39
|
-
control: Control<any>;
|
|
40
|
-
innerSchema?: ZodSchema;
|
|
41
|
-
variables?: Record<string, ActionVariables | undefined>;
|
|
42
|
-
isNullable?: boolean;
|
|
43
|
-
handleFieldChange: ({ key, value, variables, }: {
|
|
44
|
-
key: keyof z.infer<any>;
|
|
45
|
-
value: any;
|
|
46
|
-
variables?: ActionVariables;
|
|
47
|
-
}) => void;
|
|
48
|
-
};
|
|
49
|
-
export declare function schemaToFormFieldRenderer<T extends ZodSchema>({ schema, errors, renderFieldMap, schemaField, renderLabel, control, variables, onFieldChange, schemaOptions, values, isOptional, isNullable, }: {
|
|
50
|
-
schema: ZodSchema<any>;
|
|
51
|
-
errors: any;
|
|
52
|
-
renderFieldMap?: Record<FormConfigType, (props: FieldProps) => React.ReactNode>;
|
|
53
|
-
schemaField: string;
|
|
54
|
-
control: any;
|
|
55
|
-
onFieldChange: (props: {
|
|
56
|
-
key: keyof z.infer<T>;
|
|
57
|
-
value: any;
|
|
58
|
-
variables?: ActionVariables;
|
|
59
|
-
}) => void;
|
|
60
|
-
variables?: Record<string, ActionVariables | undefined>;
|
|
61
|
-
schemaOptions?: Record<string, any>;
|
|
62
|
-
renderLabel?: ({ isOptional, schemaField }: {
|
|
63
|
-
isOptional: boolean;
|
|
64
|
-
schemaField: string;
|
|
65
|
-
}) => React.ReactNode;
|
|
66
|
-
values: Record<keyof z.infer<T>, unknown>;
|
|
67
|
-
isOptional?: boolean;
|
|
68
|
-
isNullable?: boolean;
|
|
69
|
-
}): any;
|
|
70
|
-
export {};
|