@jsonui/react 0.3.0 → 0.4.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.
Files changed (62) hide show
  1. package/dist/cjs/index.js +787 -1709
  2. package/dist/cjs/index.js.map +1 -1
  3. package/dist/cjs/types/MessageReceiver.d.ts +2 -0
  4. package/dist/cjs/types/MessageReceiverContext.d.ts +8 -0
  5. package/dist/cjs/types/ReduxProviders.d.ts +1 -9
  6. package/dist/cjs/types/ViewerWeb.d.ts +2 -10
  7. package/dist/cjs/types/Wrapper.d.ts +5 -3
  8. package/dist/cjs/types/index.d.ts +4 -3
  9. package/dist/cjs/types/stock/components/Fragment.d.ts +5 -3
  10. package/dist/cjs/types/stock/components/PrimitiveProp.d.ts +3 -2
  11. package/dist/cjs/types/stock/components/Text.d.ts +1 -1
  12. package/dist/cjs/types/stock/components/View.d.ts +1 -1
  13. package/dist/cjs/types/stories/JsonUI.stories.d.ts +3 -3
  14. package/dist/cjs/types/stories/MultiChild.stories.d.ts +5 -0
  15. package/dist/cjs/types/stories/PartialValueUpdateTest/PushNotificationTest.stories.d.ts +5 -0
  16. package/dist/cjs/types/stories/ReduxTest.stories.d.ts +6 -0
  17. package/dist/cjs/types/stories/Simple.stories.d.ts +5 -0
  18. package/dist/cjs/types/stories/Table.stories.d.ts +5 -0
  19. package/dist/cjs/types/types.d.ts +23 -0
  20. package/dist/esm/index.js +787 -1711
  21. package/dist/esm/index.js.map +1 -1
  22. package/dist/esm/types/MessageReceiver.d.ts +2 -0
  23. package/dist/esm/types/MessageReceiverContext.d.ts +8 -0
  24. package/dist/esm/types/ReduxProviders.d.ts +1 -9
  25. package/dist/esm/types/ViewerWeb.d.ts +2 -10
  26. package/dist/esm/types/Wrapper.d.ts +5 -3
  27. package/dist/esm/types/index.d.ts +4 -3
  28. package/dist/esm/types/stock/components/Fragment.d.ts +5 -3
  29. package/dist/esm/types/stock/components/PrimitiveProp.d.ts +3 -2
  30. package/dist/esm/types/stock/components/Text.d.ts +1 -1
  31. package/dist/esm/types/stock/components/View.d.ts +1 -1
  32. package/dist/esm/types/stories/JsonUI.stories.d.ts +3 -3
  33. package/dist/esm/types/stories/MultiChild.stories.d.ts +5 -0
  34. package/dist/esm/types/stories/PartialValueUpdateTest/PushNotificationTest.stories.d.ts +5 -0
  35. package/dist/esm/types/stories/ReduxTest.stories.d.ts +6 -0
  36. package/dist/esm/types/stories/Simple.stories.d.ts +5 -0
  37. package/dist/esm/types/stories/Table.stories.d.ts +5 -0
  38. package/dist/esm/types/types.d.ts +23 -0
  39. package/dist/index.d.ts +9 -18
  40. package/package.json +4 -4
  41. package/dist/cjs/types/indexModule.d.ts +0 -6
  42. package/dist/cjs/types/stock/components/FieldEdit.d.ts +0 -3
  43. package/dist/cjs/types/stock/components.d.ts +0 -20
  44. package/dist/cjs/types/stock/stockToRenderer.d.ts +0 -22
  45. package/dist/cjs/types/store/store.d.ts +0 -7
  46. package/dist/cjs/types/stories/Button.d.ts +0 -28
  47. package/dist/cjs/types/stories/Button.stories.d.ts +0 -8
  48. package/dist/cjs/types/stories/Header.d.ts +0 -12
  49. package/dist/cjs/types/stories/Header.stories.d.ts +0 -6
  50. package/dist/cjs/types/stories/Page.d.ts +0 -3
  51. package/dist/cjs/types/stories/Page.stories.d.ts +0 -6
  52. package/dist/esm/types/indexModule.d.ts +0 -6
  53. package/dist/esm/types/stock/components/FieldEdit.d.ts +0 -3
  54. package/dist/esm/types/stock/components.d.ts +0 -20
  55. package/dist/esm/types/stock/stockToRenderer.d.ts +0 -22
  56. package/dist/esm/types/store/store.d.ts +0 -7
  57. package/dist/esm/types/stories/Button.d.ts +0 -28
  58. package/dist/esm/types/stories/Button.stories.d.ts +0 -8
  59. package/dist/esm/types/stories/Header.d.ts +0 -12
  60. package/dist/esm/types/stories/Header.stories.d.ts +0 -6
  61. package/dist/esm/types/stories/Page.d.ts +0 -3
  62. package/dist/esm/types/stories/Page.stories.d.ts +0 -6
@@ -0,0 +1,2 @@
1
+ declare const MessageReceiver: () => null;
2
+ export default MessageReceiver;
@@ -0,0 +1,8 @@
1
+ /// <reference types="react" />
2
+ import { ChangeDefaultValueFunc } from 'types';
3
+ export declare class MessageHandler {
4
+ updateDefaultValueHandler?: ChangeDefaultValueFunc;
5
+ set: (newFunc: ChangeDefaultValueFunc) => void;
6
+ get: () => ChangeDefaultValueFunc | undefined;
7
+ }
8
+ export declare const MessageHandlerContext: import("react").Context<MessageHandler | null>;
@@ -2,15 +2,7 @@
2
2
  import React, { ReactNode } from 'react';
3
3
  import { Store, AnyAction } from 'redux';
4
4
  import { Persistor } from 'redux-persist/es/types';
5
- export declare type JSONPrimitive = string | number | boolean | null;
6
- export declare type JSONValue = JSONPrimitive | JSONObject | JSONArray;
7
- export declare type JSONObject = {
8
- [member: string]: JSONValue;
9
- };
10
- export declare type JSONArray = Array<JSONValue>;
11
- export interface DefaultValues {
12
- [key: string]: JSONValue;
13
- }
5
+ import { DefaultValues } from 'types';
14
6
  declare type MyProps = {
15
7
  children: ReactNode;
16
8
  defaultValues?: DefaultValues;
@@ -1,12 +1,4 @@
1
1
  /// <reference types="react" />
2
- import { DefaultValues } from './ReduxProviders';
3
- export interface ViewerProps {
4
- model: any;
5
- defaultValues?: DefaultValues;
6
- id?: string;
7
- components?: any;
8
- functions?: any;
9
- disabledPersist?: boolean;
10
- }
11
- declare function ViewerWeb(props: ViewerProps): JSX.Element;
2
+ import { ViewerProps } from 'types';
3
+ declare function ViewerWeb({ defaultValues, disabledPersist, ...props }: ViewerProps): JSX.Element;
12
4
  export default ViewerWeb;
@@ -1,5 +1,7 @@
1
1
  /// <reference types="react" />
2
2
  import { PropsType } from '@jsonui/core';
3
- export declare const getStyleForWeb: (props: PropsType | undefined, component: string) => any;
4
- declare function WrapperOuter(props: any): JSX.Element;
5
- export default WrapperOuter;
3
+ export declare const getStyle: (props: PropsType | undefined, component: string) => any;
4
+ declare function Wrapper({ props: origProps }: {
5
+ props: any;
6
+ }): JSX.Element | null;
7
+ export default Wrapper;
@@ -1,6 +1,7 @@
1
1
  /// <reference types="react" />
2
- import { ViewerProps } from './ViewerWeb';
2
+ import { ChangeDefaultValueFuncProp, JSONValue, ViewerProps } from 'types';
3
+ import { MessageHandlerContext, MessageHandler } from './MessageReceiverContext';
3
4
  declare type JsonUIProps = ViewerProps;
4
5
  declare const JsonUI: (props: JsonUIProps) => JSX.Element;
5
- export { JsonUI };
6
- export type { JsonUIProps };
6
+ export { JsonUI, MessageHandlerContext, MessageHandler };
7
+ export type { JsonUIProps, JSONValue, ChangeDefaultValueFuncProp };
@@ -1,4 +1,6 @@
1
- declare const Fragment: ({ children }: {
2
- children: any;
3
- }) => any;
1
+ /// <reference types="react" />
2
+ import { constants as c } from '@jsonui/core';
3
+ declare const Fragment: ({ [c.V_CHILDREN_NAME]: props, ...a }: {
4
+ [c.V_CHILDREN_NAME]: any;
5
+ }) => JSX.Element;
4
6
  export default Fragment;
@@ -1,5 +1,6 @@
1
1
  /// <reference types="react" />
2
- declare function PrimitiveProp({ children }: {
3
- children: any;
2
+ import { constants as c } from '@jsonui/core';
3
+ declare function PrimitiveProp({ [c.V_CHILDREN_NAME]: children }: {
4
+ [c.V_CHILDREN_NAME]: any;
4
5
  }): JSX.Element;
5
6
  export default PrimitiveProp;
@@ -1,3 +1,3 @@
1
1
  /// <reference types="react" />
2
- declare function Text(props: any): JSX.Element;
2
+ declare function Text({ value, [c.V_CHILDREN_NAME]: children, ...props }: any): JSX.Element;
3
3
  export default Text;
@@ -1,3 +1,3 @@
1
1
  /// <reference types="react" />
2
- declare function View(props: any): JSX.Element;
2
+ declare function View({ [c.V_CHILDREN_NAME]: children, ...props }: any): JSX.Element;
3
3
  export default View;
@@ -1,6 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  import { ComponentStory, ComponentMeta } from '@storybook/react';
3
- declare const JsonUIStory: ComponentMeta<(props: import("../ViewerWeb").ViewerProps) => JSX.Element>;
4
- export declare const TableTest: ComponentStory<(props: import("../ViewerWeb").ViewerProps) => JSX.Element>;
5
- export declare const InputTest: ComponentStory<(props: import("../ViewerWeb").ViewerProps) => JSX.Element>;
3
+ declare const JsonUIStory: ComponentMeta<(props: import("../types").ViewerProps) => JSX.Element>;
4
+ export declare const TableTest: ComponentStory<(props: import("../types").ViewerProps) => JSX.Element>;
5
+ export declare const InputTest: ComponentStory<(props: import("../types").ViewerProps) => JSX.Element>;
6
6
  export default JsonUIStory;
@@ -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 MultiChild: ComponentStory<(props: import("../types").ViewerProps) => JSX.Element>;
5
+ export default JsonUIStory;
@@ -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 PartialValueUpdateTest: ComponentStory<(props: import("../../types").ViewerProps) => JSX.Element>;
5
+ export default JsonUIStory;
@@ -0,0 +1,6 @@
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 TwoEditAnd1Modifier: ComponentStory<(props: import("../types").ViewerProps) => JSX.Element>;
5
+ export declare const PathModifierTest: ComponentStory<(props: import("../types").ViewerProps) => JSX.Element>;
6
+ export default JsonUIStory;
@@ -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 PrimitivesTest: ComponentStory<(props: import("../types").ViewerProps) => JSX.Element>;
5
+ export default JsonUIStory;
@@ -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 TableTest: ComponentStory<(props: import("../types").ViewerProps) => JSX.Element>;
5
+ export default JsonUIStory;
@@ -0,0 +1,23 @@
1
+ export declare type JSONPrimitive = string | number | boolean | null;
2
+ export declare type JSONValue = JSONPrimitive | JSONObject | JSONArray;
3
+ export declare type JSONObject = {
4
+ [member: string]: JSONValue;
5
+ };
6
+ export declare type JSONArray = Array<JSONValue>;
7
+ export interface ChangeDefaultValueFuncProp {
8
+ store: string;
9
+ path: string;
10
+ value: JSONValue;
11
+ }
12
+ export declare type ChangeDefaultValueFunc = (arg: ChangeDefaultValueFuncProp) => void;
13
+ export interface DefaultValues {
14
+ [key: string]: JSONValue;
15
+ }
16
+ export interface ViewerProps {
17
+ model: any;
18
+ defaultValues?: DefaultValues;
19
+ id?: string;
20
+ components?: any;
21
+ functions?: any;
22
+ disabledPersist?: boolean;
23
+ }