react-formule 1.4.0 → 1.6.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/README.md +235 -11
- package/dist/admin/formComponents/PropKeyEditorObjectFieldTemplate.d.ts +4 -0
- package/dist/admin/formComponents/SortableBox.d.ts +15 -17
- package/dist/admin/utils/fieldTypes.d.ts +852 -410
- package/dist/admin/utils/index.d.ts +1 -0
- package/dist/ai/AiChatFooter.d.ts +9 -0
- package/dist/ai/AiDiff.d.ts +9 -0
- package/dist/ai/AiSettingsDialog.d.ts +7 -0
- package/dist/ai/defaults.d.ts +4 -0
- package/dist/ai/hooks.d.ts +4 -0
- package/dist/ai/utils.d.ts +5 -0
- package/dist/contexts/CustomizationContext.d.ts +3 -1
- package/dist/exposed.d.ts +8 -18
- package/dist/forms/Form.d.ts +2 -0
- package/dist/forms/fields/base/CodeEditorField.d.ts +1 -2
- package/dist/forms/fields/base/FileField.d.ts +12 -0
- package/dist/forms/fields/base/index.d.ts +2 -0
- package/dist/forms/templates/ArrayFieldTemplates/{NormalArrayFieldTemplate.d.ts → ArrayFieldTemplate.d.ts} +3 -3
- package/dist/forms/templates/Field/FieldCollapsible.d.ts +6 -0
- package/dist/forms/templates/utils/index.d.ts +1 -0
- package/dist/forms/widgets/base/MaskedInput/MaskedInput.d.ts +2 -1
- package/dist/index.d.ts +8 -1
- package/dist/react-formule.js +153784 -143696
- package/dist/react-formule.umd.cjs +693 -544
- package/dist/store/configureStore.d.ts +8 -0
- package/dist/store/schemaWizard.d.ts +16 -1
- package/dist/types/index.d.ts +108 -0
- package/dist/utils/CodeDiffViewer.d.ts +2 -1
- package/dist/utils/FieldMessageTag.d.ts +4 -0
- package/package.json +7 -4
- package/dist/admin/formComponents/RenderSortable.d.ts +0 -2
- package/dist/vite.svg +0 -1
|
@@ -10,3 +10,4 @@ export function shoudDisplayGuideLinePopUp(schema: any): any;
|
|
|
10
10
|
export function isItTheArrayField(schema: any, uiSchema: any): boolean;
|
|
11
11
|
export function combineFieldTypes(fieldTypes: any, customFieldTypes: any): any;
|
|
12
12
|
export function timer(ms: any): Promise<any>;
|
|
13
|
+
export function getFieldSpec(schema: any, uiSchema: any, fieldTypes: any): any;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
type AiChatFooterProps = {
|
|
2
|
+
onApply?: () => void;
|
|
3
|
+
onReject?: () => void;
|
|
4
|
+
hideHelp?: boolean;
|
|
5
|
+
hideSettings?: boolean;
|
|
6
|
+
vibeMode?: boolean;
|
|
7
|
+
};
|
|
8
|
+
declare const AiChatFooter: ({ onApply, onReject, hideHelp, hideSettings, vibeMode, }: AiChatFooterProps) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export default AiChatFooter;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { AISuggestion } from '../types';
|
|
2
|
+
|
|
3
|
+
type AiDiffProps = {
|
|
4
|
+
currentSchema: object;
|
|
5
|
+
currentUiSchema: object;
|
|
6
|
+
suggestion: AISuggestion;
|
|
7
|
+
};
|
|
8
|
+
declare const AiDiff: ({ currentSchema, currentUiSchema, suggestion, }: AiDiffProps) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export default AiDiff;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
type AiSettingsDialogProps = {
|
|
2
|
+
visible: boolean;
|
|
3
|
+
onClose: () => void;
|
|
4
|
+
hideVibeMode?: boolean;
|
|
5
|
+
};
|
|
6
|
+
declare const AiSettingsDialog: ({ visible, onClose, hideVibeMode, }: AiSettingsDialogProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export default AiSettingsDialog;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { AIProvider } from '../types';
|
|
2
|
+
|
|
3
|
+
export declare const defaultGenerationPrompt = "\n## Role\nYou are an advanced assistant for a form builder application based on RJSF and JSON Schema draft 07. Your task is to analyze user requests and generate the corresponding JSON schema and UI schema in a single step.\n\n## Input Format\n- `<FORM>`: Contains the current state of the schema and uiSchema (both JSON objects) for reference.\n- `<SPEC>`: Contains a comprehensive list of available field types with their specifications.\n- `<REQ>`: Contains the user's request for creating or modifying the form.\n\n## Response Format\nYou MUST respond with a JSON object containing the `schema` and `uiSchema`, structured as follows:\n\n{\n \"schema\": {},\n \"uiSchema\": {}\n}\n\n- If the request is irrelevant or cannot be fulfilled, respond with a JSON object containing an `error` field:\n\n{\n \"error\": \"Explanation of why the request could not be fulfilled\"\n}\n\n- The response MUST be a **plain JSON object** without any additional text, formatting, or code blocks.\n\n## Process\n1. **Field Type Detection**: Analyze `<REQ>` to identify the necessary field types.\n2. **Schema Generation**: Generate the `schema` and `uiSchema` based on the detected field types and user request, using the specifications in `<SPEC>`.\n\n## Rules\n- Only include fields and properties explicitly requested in `<REQ>` and defined in `<SPEC>`.\n- Follow the structure and properties defined in `<SPEC>` strictly. Be careful to not mix things up between different field types.\n- If a field type or property is not in `<SPEC>`, exclude it entirely. \n- Note that not all field types require a `ui:widget` or `ui:field` property (e.g. number or integer fields don't), only include them if they are explicitly specified in the defaults in `<SPEC>` for that field type.\n- If the request is ambiguous or cannot be fulfilled, provide an `error` object.\n- Do not include standard JSON Schema properties or RJSF extensions unless explicitly listed in `<SPEC>`.\n- Always keep or use a standard object as form root.\n\n## Available Field Types\n<SPEC>\n\n## Example\n\n**Input**:\n<REQ>Create a form with a text field for the name and an email field that is required</REQ>\n\n**Response**:\n{\n \"schema\": {\n \"title\": \"New Form\",\n \"type\": \"object\",\n \"properties\": {\n \"name\": {\n \"type\": \"string\",\n \"title\": \"Name\"\n },\n \"email\": {\n \"type\": \"string\",\n \"title\": \"Email\"\n }\n },\n \"required\": [\"email\"]\n },\n \"uiSchema\": {\n \"name\": {\n \"ui:widget\": \"text\"\n },\n \"email\": {\n \"ui:widget\": \"text\"\n }\n }\n}\n";
|
|
4
|
+
export declare const defaultProviders: Record<string, AIProvider>;
|
package/dist/exposed.d.ts
CHANGED
|
@@ -1,22 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { ReactNode, SetStateAction } from 'react';
|
|
1
|
+
import { SetStateAction } from 'react';
|
|
3
2
|
import { RJSFSchema } from '@rjsf/utils';
|
|
4
|
-
import {
|
|
3
|
+
import { FormuleContextProps } from './types';
|
|
5
4
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
customFieldTypes?: object;
|
|
9
|
-
customFields?: object;
|
|
10
|
-
customWidgets?: object;
|
|
11
|
-
customPublishedFields?: object;
|
|
12
|
-
customPublishedWidgets?: object;
|
|
13
|
-
theme?: ThemeConfig;
|
|
14
|
-
separator?: string;
|
|
15
|
-
errorBoundary?: ReactNode;
|
|
16
|
-
synchronizeState?: (state: SchemaWizardState) => void;
|
|
17
|
-
transformSchema?: (schema: object) => object;
|
|
18
|
-
};
|
|
19
|
-
export declare const FormuleContext: ({ children, customFieldTypes, customFields, customWidgets, customPublishedFields, customPublishedWidgets, theme, separator, errorBoundary, synchronizeState, transformSchema, }: FormuleContextProps) => import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
export declare const FormuleContext: ({ children, customFieldTypes, customFields, customWidgets, customPublishedFields, customPublishedWidgets, customFunctions, theme, separator, errorBoundary, synchronizeState, transformSchema, ai, }: FormuleContextProps) => import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export declare const FormuleForm: (props: any) => import("react/jsx-runtime").JSX.Element;
|
|
20
7
|
export declare const initFormuleSchema: (data?: RJSFSchema, title?: string, description?: string) => void;
|
|
21
8
|
export declare const getFormuleState: () => {
|
|
22
9
|
current: {
|
|
@@ -35,6 +22,10 @@ export declare const getFormuleState: () => {
|
|
|
35
22
|
id: string;
|
|
36
23
|
field: {};
|
|
37
24
|
formData: {};
|
|
25
|
+
files: {
|
|
26
|
+
new: {};
|
|
27
|
+
deleted: string[];
|
|
28
|
+
};
|
|
38
29
|
};
|
|
39
30
|
export declare const getAllFromLocalStorage: () => {
|
|
40
31
|
id: string;
|
|
@@ -50,4 +41,3 @@ export declare const deleteFromLocalStorage: (id: string) => Promise<SetStateAct
|
|
|
50
41
|
}[]>>;
|
|
51
42
|
export declare const loadFromLocalStorage: (id: string) => void;
|
|
52
43
|
export declare const isUnsaved: () => boolean;
|
|
53
|
-
export {};
|
package/dist/forms/Form.d.ts
CHANGED
|
@@ -34,12 +34,14 @@ declare namespace RJSFForm {
|
|
|
34
34
|
let onChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
35
35
|
let validate: PropTypes.Requireable<(...args: any[]) => any>;
|
|
36
36
|
let formContext: PropTypes.Requireable<object>;
|
|
37
|
+
let fields: PropTypes.Requireable<object>;
|
|
37
38
|
let widgets: PropTypes.Requireable<object>;
|
|
38
39
|
let mode: PropTypes.Requireable<string>;
|
|
39
40
|
let readonly: PropTypes.Requireable<boolean>;
|
|
40
41
|
let className: PropTypes.Requireable<string>;
|
|
41
42
|
let liveValidate: PropTypes.Requireable<boolean>;
|
|
42
43
|
let showErrorList: PropTypes.Requireable<boolean>;
|
|
44
|
+
let tagName: PropTypes.Requireable<string>;
|
|
43
45
|
let FieldTemplate: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
44
46
|
let ObjectFieldTemplate: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
45
47
|
let ArrayFieldTemplate: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
export default CodeEditorField;
|
|
2
|
-
declare function CodeEditorField({ formData, onChange,
|
|
2
|
+
declare function CodeEditorField({ formData, onChange, uiSchema, readonly }: {
|
|
3
3
|
formData: any;
|
|
4
4
|
onChange: any;
|
|
5
|
-
schema: any;
|
|
6
5
|
uiSchema: any;
|
|
7
6
|
readonly: any;
|
|
8
7
|
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export default FileField;
|
|
2
|
+
declare function FileField({ disabled, formContext, id, onBlur, onChange, onFocus, readonly, formData, schema, }: {
|
|
3
|
+
disabled: any;
|
|
4
|
+
formContext: any;
|
|
5
|
+
id: any;
|
|
6
|
+
onBlur: any;
|
|
7
|
+
onChange: any;
|
|
8
|
+
onFocus: any;
|
|
9
|
+
readonly: any;
|
|
10
|
+
formData: any;
|
|
11
|
+
schema: any;
|
|
12
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { default as TagsField } from './TagsField';
|
|
2
2
|
import { default as IdFetcher } from './IdFetcher';
|
|
3
3
|
import { default as CodeEditorField } from './CodeEditorField';
|
|
4
|
+
import { default as FileField } from './FileField';
|
|
4
5
|
export default fields;
|
|
5
6
|
declare namespace fields {
|
|
6
7
|
export { TagsField as tags };
|
|
7
8
|
export { IdFetcher as idFetcher };
|
|
8
9
|
export { CodeEditorField as codeEditor };
|
|
10
|
+
export { FileField as file };
|
|
9
11
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { default as PropTypes } from 'prop-types';
|
|
2
|
-
export default
|
|
3
|
-
declare function
|
|
2
|
+
export default ArrayFieldTemplate;
|
|
3
|
+
declare function ArrayFieldTemplate({ canAdd, className, disabled, formContext, idSchema, items, options, onAddClick, readonly, required, schema, title, uiSchema, formData, }: {
|
|
4
4
|
canAdd: any;
|
|
5
5
|
className: any;
|
|
6
6
|
disabled: any;
|
|
@@ -16,7 +16,7 @@ declare function NormalArrayFieldTemplate({ canAdd, className, disabled, formCon
|
|
|
16
16
|
uiSchema: any;
|
|
17
17
|
formData: any;
|
|
18
18
|
}): import("react/jsx-runtime").JSX.Element;
|
|
19
|
-
declare namespace
|
|
19
|
+
declare namespace ArrayFieldTemplate {
|
|
20
20
|
namespace propTypes {
|
|
21
21
|
let canAdd: PropTypes.Requireable<boolean>;
|
|
22
22
|
let className: PropTypes.Requireable<string>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export default MaskedInput;
|
|
2
|
-
declare function MaskedInput({ id, mask, pattern, name, onBlur, onChange, onFocus, onPressEnter, placeholder, buttons, value, disabled, message, convertToUppercase, }: {
|
|
2
|
+
declare function MaskedInput({ id, mask, pattern, name, onBlur, onChange, onFocus, onPressEnter, placeholder, buttons, value, disabled, message, convertToUppercase, autofillInfo, }: {
|
|
3
3
|
id: any;
|
|
4
4
|
mask: any;
|
|
5
5
|
pattern: any;
|
|
@@ -14,4 +14,5 @@ declare function MaskedInput({ id, mask, pattern, name, onBlur, onChange, onFocu
|
|
|
14
14
|
disabled: any;
|
|
15
15
|
message: any;
|
|
16
16
|
convertToUppercase: any;
|
|
17
|
+
autofillInfo: any;
|
|
17
18
|
}): import("react/jsx-runtime").JSX.Element;
|
package/dist/index.d.ts
CHANGED
|
@@ -6,15 +6,22 @@ export { saveToLocalStorage } from './exposed';
|
|
|
6
6
|
export { deleteFromLocalStorage } from './exposed';
|
|
7
7
|
export { loadFromLocalStorage } from './exposed';
|
|
8
8
|
export { isUnsaved } from './exposed';
|
|
9
|
+
export { FormuleForm } from './exposed';
|
|
9
10
|
export { default as PropertyEditor } from './admin/components/PropertyEditor';
|
|
10
11
|
export { default as SelectFieldType } from './admin/components/SelectFieldType';
|
|
11
12
|
export { default as SchemaPreview } from './admin/components/SchemaPreview';
|
|
12
13
|
export { default as FormPreview } from './admin/components/FormPreview';
|
|
13
14
|
export { default as EditablePreview } from './admin/components/EditablePreview';
|
|
14
15
|
export { default as SelectOrEdit } from './admin/components/SelectOrEdit';
|
|
15
|
-
export { default as FormuleForm } from './forms/Form';
|
|
16
16
|
export { common as commonFields, extra as extraFields, } from './admin/utils/fieldTypes';
|
|
17
17
|
export { default as CodeEditor } from './utils/CodeEditor';
|
|
18
18
|
export { default as CodeViewer } from './utils/CodeViewer';
|
|
19
19
|
export { default as CodeDiffViewer } from './utils/CodeDiffViewer';
|
|
20
20
|
export type { SchemaWizardState } from './store/schemaWizard';
|
|
21
|
+
export { default as AiChatFooter } from './ai/AiChatFooter';
|
|
22
|
+
export { default as AiDiff } from './ai/AiDiff';
|
|
23
|
+
export { default as AiSettingsDialog } from './ai/AiSettingsDialog';
|
|
24
|
+
export { defaultProviders, defaultGenerationPrompt } from './ai/defaults';
|
|
25
|
+
export { useGetProvider, useGenerateSchema } from './ai/hooks';
|
|
26
|
+
export { generatePatches } from './ai/utils';
|
|
27
|
+
export * from './types';
|