@jsonui/react 0.6.0 → 0.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/cjs/index.js +16153 -38251
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/ReduxProviders.d.ts +4 -4
- package/dist/cjs/types/ViewerWeb.d.ts +1 -1
- package/dist/cjs/types/index.d.ts +4 -4
- package/dist/cjs/types/stories/StateSaveTest/StateSaveTest.stories.d.ts +5 -0
- package/dist/cjs/types/tests/input.test.d.ts +0 -2
- package/dist/cjs/types/types.d.ts +3 -3
- package/dist/esm/index.js +16030 -38128
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/ReduxProviders.d.ts +4 -4
- package/dist/esm/types/ViewerWeb.d.ts +1 -1
- package/dist/esm/types/index.d.ts +4 -4
- package/dist/esm/types/stories/StateSaveTest/StateSaveTest.stories.d.ts +5 -0
- package/dist/esm/types/tests/input.test.d.ts +0 -2
- package/dist/esm/types/types.d.ts +3 -3
- package/dist/index.d.ts +28 -5
- package/package.json +5 -6
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
-
import { DefaultValues } from 'types';
|
|
3
|
-
interface
|
|
2
|
+
import { DefaultValues, GetFormState } from 'types';
|
|
3
|
+
interface Props {
|
|
4
4
|
children: ReactNode;
|
|
5
5
|
defaultValues?: DefaultValues;
|
|
6
|
-
|
|
6
|
+
getFormState?: GetFormState;
|
|
7
7
|
}
|
|
8
|
-
declare const Providers: ({ children, defaultValues: root,
|
|
8
|
+
declare const Providers: ({ children, defaultValues: root, getFormState: getState }: Props) => JSX.Element;
|
|
9
9
|
export default Providers;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { ViewerProps } from 'types';
|
|
3
|
-
declare function ViewerWeb({ defaultValues,
|
|
3
|
+
declare function ViewerWeb({ defaultValues, getFormState, ...props }: ViewerProps): JSX.Element;
|
|
4
4
|
export default ViewerWeb;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import {
|
|
2
|
+
import { JsonUIComponentsType, JsonUIFunctions, JsonUIFunctionType } from '@jsonui/core';
|
|
3
|
+
import { ChangeDefaultValueFuncProp, JSONValue, ViewerProps } from './types';
|
|
3
4
|
import { MessageHandlerContext, MessageHandler } from './MessageReceiverContext';
|
|
4
|
-
declare
|
|
5
|
-
declare const JsonUI: (props: JsonUIProps) => JSX.Element;
|
|
5
|
+
declare const JsonUI: (props: ViewerProps) => JSX.Element;
|
|
6
6
|
export { JsonUI, MessageHandlerContext, MessageHandler };
|
|
7
|
-
export type { JsonUIProps, JSONValue, ChangeDefaultValueFuncProp };
|
|
7
|
+
export type { ViewerProps as JsonUIProps, JSONValue, ChangeDefaultValueFuncProp, JsonUIFunctions, JsonUIFunctionType, JsonUIComponentsType };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { ComponentStory, ComponentMeta } from '@storybook/react';
|
|
3
|
+
declare const JsonUIStory: ComponentMeta<(props: import("types").ViewerProps) => JSX.Element>;
|
|
4
|
+
export declare const StoreStateTest: ComponentStory<(props: import("types").ViewerProps) => JSX.Element>;
|
|
5
|
+
export default JsonUIStory;
|
|
@@ -7,8 +7,6 @@ export {};
|
|
|
7
7
|
* - check children and no children component with children prop
|
|
8
8
|
* - check data manipulation with mutability situation
|
|
9
9
|
* - check error boundary how works
|
|
10
|
-
* - check persistent data how works after reload
|
|
11
|
-
* - test with app id and multiple instance how the persistent can work
|
|
12
10
|
* Low:
|
|
13
11
|
* - check performance or memory leak???
|
|
14
12
|
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
import { JsonUIComponentsType, JsonUIFunctions } from '@jsonui/core';
|
|
2
3
|
export declare type JSONPrimitive = string | number | boolean | null;
|
|
3
4
|
export declare type JSONValue = JSONPrimitive | JSONObject | JSONArray;
|
|
@@ -15,12 +16,11 @@ export declare type OnSubmitFunc = (arg: any) => void;
|
|
|
15
16
|
export interface DefaultValues {
|
|
16
17
|
[key: string]: JSONValue;
|
|
17
18
|
}
|
|
19
|
+
export declare type GetFormState = React.MutableRefObject<(() => DefaultValues) | undefined>;
|
|
18
20
|
export interface ViewerProps {
|
|
19
21
|
model: any;
|
|
20
22
|
defaultValues?: DefaultValues;
|
|
21
|
-
id?: string;
|
|
22
23
|
components?: JsonUIComponentsType;
|
|
23
24
|
functions?: JsonUIFunctions;
|
|
24
|
-
|
|
25
|
-
onSubmit?: OnSubmitFunc;
|
|
25
|
+
getFormState?: GetFormState;
|
|
26
26
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,31 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import {
|
|
3
|
-
export {
|
|
2
|
+
import { JsonUIComponentsType, JsonUIFunctions } from '@jsonui/core';
|
|
3
|
+
export { JsonUIComponentsType, JsonUIFunctionType, JsonUIFunctions } from '@jsonui/core';
|
|
4
4
|
import * as react from 'react';
|
|
5
|
+
import { ChangeDefaultValueFunc } from 'types';
|
|
6
|
+
|
|
7
|
+
declare type JSONPrimitive = string | number | boolean | null;
|
|
8
|
+
declare type JSONValue = JSONPrimitive | JSONObject | JSONArray;
|
|
9
|
+
declare type JSONObject = {
|
|
10
|
+
[member: string]: JSONValue;
|
|
11
|
+
};
|
|
12
|
+
declare type JSONArray = Array<JSONValue>;
|
|
13
|
+
interface ChangeDefaultValueFuncProp {
|
|
14
|
+
store: string;
|
|
15
|
+
path: string;
|
|
16
|
+
value: JSONValue;
|
|
17
|
+
}
|
|
18
|
+
interface DefaultValues {
|
|
19
|
+
[key: string]: JSONValue;
|
|
20
|
+
}
|
|
21
|
+
declare type GetFormState = React.MutableRefObject<(() => DefaultValues) | undefined>;
|
|
22
|
+
interface ViewerProps {
|
|
23
|
+
model: any;
|
|
24
|
+
defaultValues?: DefaultValues;
|
|
25
|
+
components?: JsonUIComponentsType;
|
|
26
|
+
functions?: JsonUIFunctions;
|
|
27
|
+
getFormState?: GetFormState;
|
|
28
|
+
}
|
|
5
29
|
|
|
6
30
|
declare class MessageHandler {
|
|
7
31
|
updateDefaultValueHandler?: ChangeDefaultValueFunc;
|
|
@@ -10,7 +34,6 @@ declare class MessageHandler {
|
|
|
10
34
|
}
|
|
11
35
|
declare const MessageHandlerContext: react.Context<MessageHandler | null>;
|
|
12
36
|
|
|
13
|
-
declare
|
|
14
|
-
declare const JsonUI: (props: JsonUIProps) => JSX.Element;
|
|
37
|
+
declare const JsonUI: (props: ViewerProps) => JSX.Element;
|
|
15
38
|
|
|
16
|
-
export { JsonUI, JsonUIProps, MessageHandler, MessageHandlerContext };
|
|
39
|
+
export { ChangeDefaultValueFuncProp, JSONValue, JsonUI, ViewerProps as JsonUIProps, MessageHandler, MessageHandlerContext };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jsonui/react",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.1",
|
|
4
4
|
"author": "Istvan Fodor <fodori@jsonui.org>",
|
|
5
5
|
"contributors": [],
|
|
6
6
|
"bugs": {
|
|
@@ -36,21 +36,20 @@
|
|
|
36
36
|
"test": "jest"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@emotion/react": "^11.
|
|
40
|
-
"@jsonui/core": "^0.
|
|
39
|
+
"@emotion/react": "^11.13.3",
|
|
40
|
+
"@jsonui/core": "^0.7.1",
|
|
41
41
|
"batchflow": "^0.4.0",
|
|
42
42
|
"jsonata": "^1.8.5",
|
|
43
43
|
"lodash": "^4.17.21",
|
|
44
44
|
"react-redux": "^7.2.6",
|
|
45
45
|
"redux": "^4.1.2",
|
|
46
|
-
"redux-persist": "^6.0.0",
|
|
47
46
|
"typescript": "^4.5.4"
|
|
48
47
|
},
|
|
49
48
|
"devDependencies": {
|
|
50
49
|
"@babel/core": "^7.17.5",
|
|
51
50
|
"@babel/preset-env": "^7.16.11",
|
|
52
51
|
"@babel/preset-react": "^7.16.7",
|
|
53
|
-
"@emotion/jest": "^11.
|
|
52
|
+
"@emotion/jest": "^11.13.0",
|
|
54
53
|
"@rollup/plugin-commonjs": "^21.0.1",
|
|
55
54
|
"@rollup/plugin-json": "^4.1.0",
|
|
56
55
|
"@rollup/plugin-node-resolve": "^13.1.3",
|
|
@@ -113,5 +112,5 @@
|
|
|
113
112
|
"last 1 safari version"
|
|
114
113
|
]
|
|
115
114
|
},
|
|
116
|
-
"gitHead": "
|
|
115
|
+
"gitHead": "8b9b046e117f9ca14f3b9750fccad1be4de785a9"
|
|
117
116
|
}
|