react-formule 1.3.0 → 1.5.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 +111 -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 +1273 -657
- package/dist/admin/utils/index.d.ts +1 -0
- package/dist/exposed.d.ts +8 -18
- 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/StepsField.d.ts +6 -0
- package/dist/index.d.ts +1 -1
- package/dist/react-formule.js +106748 -100969
- package/dist/react-formule.umd.cjs +521 -485
- package/dist/store/configureStore.d.ts +8 -0
- package/dist/store/schemaWizard.d.ts +16 -1
- package/dist/types/index.d.ts +34 -0
- package/package.json +2 -2
- package/dist/admin/formComponents/RenderSortable.d.ts +0 -2
- package/dist/vite.svg +0 -1
|
@@ -20,6 +20,10 @@ declare const store: import('@reduxjs/toolkit/dist/configureStore').ToolkitStore
|
|
|
20
20
|
id: string;
|
|
21
21
|
field: {};
|
|
22
22
|
formData: {};
|
|
23
|
+
files: {
|
|
24
|
+
new: {};
|
|
25
|
+
deleted: string[];
|
|
26
|
+
};
|
|
23
27
|
};
|
|
24
28
|
}, import('redux').AnyAction, import('@reduxjs/toolkit').MiddlewareArray<[import('redux-thunk').ThunkMiddleware<{
|
|
25
29
|
schemaWizard: {
|
|
@@ -39,6 +43,10 @@ declare const store: import('@reduxjs/toolkit/dist/configureStore').ToolkitStore
|
|
|
39
43
|
id: string;
|
|
40
44
|
field: {};
|
|
41
45
|
formData: {};
|
|
46
|
+
files: {
|
|
47
|
+
new: {};
|
|
48
|
+
deleted: string[];
|
|
49
|
+
};
|
|
42
50
|
};
|
|
43
51
|
}, import('redux').AnyAction>, ({ getState }: {
|
|
44
52
|
getState: any;
|
|
@@ -15,12 +15,23 @@ export declare const initialState: {
|
|
|
15
15
|
id: string;
|
|
16
16
|
field: {};
|
|
17
17
|
formData: {};
|
|
18
|
+
files: {
|
|
19
|
+
new: {};
|
|
20
|
+
deleted: string[];
|
|
21
|
+
};
|
|
18
22
|
};
|
|
19
23
|
export type SchemaWizardState = typeof initialState;
|
|
20
24
|
export declare const schemaInit: import('@reduxjs/toolkit').ActionCreatorWithPayload<{
|
|
21
25
|
data: any;
|
|
22
26
|
id: any;
|
|
23
|
-
}, "schemaWizard/schemaInit">, enableCreateMode: import('@reduxjs/toolkit').ActionCreatorWithoutPayload<"schemaWizard/enableCreateMode">, selectProperty: import('@reduxjs/toolkit').ActionCreatorWithPayload<any, "schemaWizard/selectProperty">, updateSchemaByPath: import('@reduxjs/toolkit').ActionCreatorWithPayload<any, "schemaWizard/updateSchemaByPath">, updateUiSchemaByPath: import('@reduxjs/toolkit').ActionCreatorWithPayload<any, "schemaWizard/updateUiSchemaByPath">, addByPath: import('@reduxjs/toolkit').ActionCreatorWithPayload<any, "schemaWizard/addByPath">, deleteByPath: import('@reduxjs/toolkit').ActionCreatorWithPayload<any, "schemaWizard/deleteByPath">, renameIdByPath: import('@reduxjs/toolkit').ActionCreatorWithPayload<any, "schemaWizard/renameIdByPath">, updateRequired: import('@reduxjs/toolkit').ActionCreatorWithPayload<any, "schemaWizard/updateRequired">, updateFormData: import('@reduxjs/toolkit').ActionCreatorWithPayload<any, "schemaWizard/updateFormData"
|
|
27
|
+
}, "schemaWizard/schemaInit">, enableCreateMode: import('@reduxjs/toolkit').ActionCreatorWithoutPayload<"schemaWizard/enableCreateMode">, selectProperty: import('@reduxjs/toolkit').ActionCreatorWithPayload<any, "schemaWizard/selectProperty">, updateSchemaByPath: import('@reduxjs/toolkit').ActionCreatorWithPayload<any, "schemaWizard/updateSchemaByPath">, updateUiSchemaByPath: import('@reduxjs/toolkit').ActionCreatorWithPayload<any, "schemaWizard/updateUiSchemaByPath">, addByPath: import('@reduxjs/toolkit').ActionCreatorWithPayload<any, "schemaWizard/addByPath">, deleteByPath: import('@reduxjs/toolkit').ActionCreatorWithPayload<any, "schemaWizard/deleteByPath">, renameIdByPath: import('@reduxjs/toolkit').ActionCreatorWithPayload<any, "schemaWizard/renameIdByPath">, updateRequired: import('@reduxjs/toolkit').ActionCreatorWithPayload<any, "schemaWizard/updateRequired">, updateFormData: import('@reduxjs/toolkit').ActionCreatorWithPayload<any, "schemaWizard/updateFormData">, addFile: import('@reduxjs/toolkit').ActionCreatorWithPayload<{
|
|
28
|
+
uid: string;
|
|
29
|
+
objectUrl: string;
|
|
30
|
+
}, "schemaWizard/addFile">, removeNewFile: import('@reduxjs/toolkit').ActionCreatorWithPayload<{
|
|
31
|
+
uid: string;
|
|
32
|
+
}, "schemaWizard/removeNewFile">, removeExistingFile: import('@reduxjs/toolkit').ActionCreatorWithPayload<{
|
|
33
|
+
uid: string;
|
|
34
|
+
}, "schemaWizard/removeExistingFile">;
|
|
24
35
|
declare const _default: import('redux').Reducer<{
|
|
25
36
|
current: {
|
|
26
37
|
schema: {
|
|
@@ -38,5 +49,9 @@ declare const _default: import('redux').Reducer<{
|
|
|
38
49
|
id: string;
|
|
39
50
|
field: {};
|
|
40
51
|
formData: {};
|
|
52
|
+
files: {
|
|
53
|
+
new: {};
|
|
54
|
+
deleted: string[];
|
|
55
|
+
};
|
|
41
56
|
}>;
|
|
42
57
|
export default _default;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { ThemeConfig } from 'antd';
|
|
3
|
+
import { SchemaWizardState } from '../store/schemaWizard';
|
|
4
|
+
|
|
5
|
+
export type CustomFunctions = {
|
|
6
|
+
file?: {
|
|
7
|
+
/**
|
|
8
|
+
* Function to fetch a file based on a file UID. Formule will call this function with
|
|
9
|
+
* each of the file UIDs in a Files field's formData to initialize it with the files
|
|
10
|
+
* fetched from the URL returned by this function.
|
|
11
|
+
* @param uid The UID of the file to fetch
|
|
12
|
+
* @returns An object URL for the file which can be a promise. This can be:
|
|
13
|
+
* - Simply a url to your backend, requiring no processing from your side
|
|
14
|
+
* - If you have a more complex use case, where you need to configure authentication,
|
|
15
|
+
* etc, you can instead fetch the file inside this function using your custom logic
|
|
16
|
+
* and then create and return an object URL with URL.createObjectURL()
|
|
17
|
+
*/
|
|
18
|
+
fetchFile: (uid: string) => string | Promise<string>;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
export type FormuleContextProps = {
|
|
22
|
+
children: ReactNode;
|
|
23
|
+
customFieldTypes?: object;
|
|
24
|
+
customFields?: object;
|
|
25
|
+
customWidgets?: object;
|
|
26
|
+
customPublishedFields?: object;
|
|
27
|
+
customPublishedWidgets?: object;
|
|
28
|
+
customFunctions?: CustomFunctions;
|
|
29
|
+
theme?: ThemeConfig;
|
|
30
|
+
separator?: string;
|
|
31
|
+
errorBoundary?: ReactNode;
|
|
32
|
+
synchronizeState?: (state: SchemaWizardState) => void;
|
|
33
|
+
transformSchema?: (schema: object) => object;
|
|
34
|
+
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-formule",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.5.0",
|
|
5
5
|
"author": "CERN",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"repository": {
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
"dist"
|
|
14
14
|
],
|
|
15
15
|
"types": "./dist/index.d.ts",
|
|
16
|
+
"main": "./dist/react-formule.umd.cjs",
|
|
16
17
|
"exports": {
|
|
17
18
|
".": {
|
|
18
19
|
"types": "./dist/index.d.ts",
|
|
@@ -46,7 +47,6 @@
|
|
|
46
47
|
"axios": "^1.4.0",
|
|
47
48
|
"codemirror": "^6.0.1",
|
|
48
49
|
"codemirror-json-schema": "0.7.1",
|
|
49
|
-
"immutability-helper": "^3.1.1",
|
|
50
50
|
"katex": "^0.16.8",
|
|
51
51
|
"markdown-it": "^13.0.1",
|
|
52
52
|
"markdown-it-texmath": "^1.0.0",
|
package/dist/vite.svg
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="31.88" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 257"><defs><linearGradient id="IconifyId1813088fe1fbc01fb466" x1="-.828%" x2="57.636%" y1="7.652%" y2="78.411%"><stop offset="0%" stop-color="#41D1FF"></stop><stop offset="100%" stop-color="#BD34FE"></stop></linearGradient><linearGradient id="IconifyId1813088fe1fbc01fb467" x1="43.376%" x2="50.316%" y1="2.242%" y2="89.03%"><stop offset="0%" stop-color="#FFEA83"></stop><stop offset="8.333%" stop-color="#FFDD35"></stop><stop offset="100%" stop-color="#FFA800"></stop></linearGradient></defs><path fill="url(#IconifyId1813088fe1fbc01fb466)" d="M255.153 37.938L134.897 252.976c-2.483 4.44-8.862 4.466-11.382.048L.875 37.958c-2.746-4.814 1.371-10.646 6.827-9.67l120.385 21.517a6.537 6.537 0 0 0 2.322-.004l117.867-21.483c5.438-.991 9.574 4.796 6.877 9.62Z"></path><path fill="url(#IconifyId1813088fe1fbc01fb467)" d="M185.432.063L96.44 17.501a3.268 3.268 0 0 0-2.634 3.014l-5.474 92.456a3.268 3.268 0 0 0 3.997 3.378l24.777-5.718c2.318-.535 4.413 1.507 3.936 3.838l-7.361 36.047c-.495 2.426 1.782 4.5 4.151 3.78l15.304-4.649c2.372-.72 4.652 1.36 4.15 3.788l-11.698 56.621c-.732 3.542 3.979 5.473 5.943 2.437l1.313-2.028l72.516-144.72c1.215-2.423-.88-5.186-3.54-4.672l-25.505 4.922c-2.396.462-4.435-1.77-3.759-4.114l16.646-57.705c.677-2.35-1.37-4.583-3.769-4.113Z"></path></svg>
|