@jsonui/react 0.6.0 → 0.7.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.
@@ -1,9 +1,9 @@
1
1
  import { ReactNode } from 'react';
2
- import { DefaultValues } from 'types';
3
- interface MyProps {
2
+ import { DefaultValues, GetFormState } from 'types';
3
+ interface Props {
4
4
  children: ReactNode;
5
5
  defaultValues?: DefaultValues;
6
- disabledPersist?: boolean;
6
+ getFormState?: GetFormState;
7
7
  }
8
- declare const Providers: ({ children, defaultValues: root, disabledPersist }: MyProps) => JSX.Element;
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, disabledPersist, ...props }: ViewerProps): JSX.Element;
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
2
  import { ChangeDefaultValueFuncProp, JSONValue, ViewerProps } from 'types';
3
+ import { JsonUIComponentsType, JsonUIFunctions, JsonUIFunctionType } from '@jsonui/core';
3
4
  import { MessageHandlerContext, MessageHandler } from './MessageReceiverContext';
4
- declare type JsonUIProps = ViewerProps;
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
- disabledPersist?: boolean;
25
- onSubmit?: OnSubmitFunc;
25
+ getFormState?: GetFormState;
26
26
  }