@jsonui/core 0.7.5 → 0.8.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 (50) hide show
  1. package/dist/cjs/index.js +40 -6514
  2. package/dist/cjs/index.js.map +1 -1
  3. package/dist/esm/index.js +24 -6498
  4. package/dist/esm/index.js.map +1 -1
  5. package/dist/index.d.ts +175 -176
  6. package/package.json +34 -24
  7. package/dist/cjs/types/index.d.ts +0 -12
  8. package/dist/cjs/types/stock/Stock.d.ts +0 -24
  9. package/dist/cjs/types/stock/Stock.test.d.ts +0 -1
  10. package/dist/cjs/types/stock/appRootFunctions.d.ts +0 -4
  11. package/dist/cjs/types/stock/functions.d.ts +0 -7
  12. package/dist/cjs/types/stock/validation.d.ts +0 -11
  13. package/dist/cjs/types/store/persistConfig.d.ts +0 -8
  14. package/dist/cjs/types/store/reducers.d.ts +0 -4
  15. package/dist/cjs/types/store/root/actions.d.ts +0 -5
  16. package/dist/cjs/types/store/root/reducer.d.ts +0 -4
  17. package/dist/cjs/types/store/root/reducer.test.d.ts +0 -1
  18. package/dist/cjs/types/store/root/selector.test.d.ts +0 -1
  19. package/dist/cjs/types/store/root/selectors.d.ts +0 -7
  20. package/dist/cjs/types/utils/I18n.d.ts +0 -27
  21. package/dist/cjs/types/utils/I18n.test.d.ts +0 -1
  22. package/dist/cjs/types/utils/constants.d.ts +0 -32
  23. package/dist/cjs/types/utils/contextHandler.d.ts +0 -4
  24. package/dist/cjs/types/utils/types.d.ts +0 -46
  25. package/dist/cjs/types/utils/util.d.ts +0 -22
  26. package/dist/cjs/types/utils/util.test.d.ts +0 -1
  27. package/dist/cjs/types/wrapper/wrapperUtil.d.ts +0 -29
  28. package/dist/cjs/types/wrapper/wrapperUtil.test.d.ts +0 -1
  29. package/dist/esm/types/index.d.ts +0 -12
  30. package/dist/esm/types/stock/Stock.d.ts +0 -24
  31. package/dist/esm/types/stock/Stock.test.d.ts +0 -1
  32. package/dist/esm/types/stock/appRootFunctions.d.ts +0 -4
  33. package/dist/esm/types/stock/functions.d.ts +0 -7
  34. package/dist/esm/types/stock/validation.d.ts +0 -11
  35. package/dist/esm/types/store/persistConfig.d.ts +0 -8
  36. package/dist/esm/types/store/reducers.d.ts +0 -4
  37. package/dist/esm/types/store/root/actions.d.ts +0 -5
  38. package/dist/esm/types/store/root/reducer.d.ts +0 -4
  39. package/dist/esm/types/store/root/reducer.test.d.ts +0 -1
  40. package/dist/esm/types/store/root/selector.test.d.ts +0 -1
  41. package/dist/esm/types/store/root/selectors.d.ts +0 -7
  42. package/dist/esm/types/utils/I18n.d.ts +0 -27
  43. package/dist/esm/types/utils/I18n.test.d.ts +0 -1
  44. package/dist/esm/types/utils/constants.d.ts +0 -32
  45. package/dist/esm/types/utils/contextHandler.d.ts +0 -4
  46. package/dist/esm/types/utils/types.d.ts +0 -46
  47. package/dist/esm/types/utils/util.d.ts +0 -22
  48. package/dist/esm/types/utils/util.test.d.ts +0 -1
  49. package/dist/esm/types/wrapper/wrapperUtil.d.ts +0 -29
  50. package/dist/esm/types/wrapper/wrapperUtil.test.d.ts +0 -1
package/dist/index.d.ts CHANGED
@@ -1,32 +1,8 @@
1
- /// <reference types="react" />
2
1
  import * as React$1 from 'react';
3
- import React__default, { ReactNode } from 'react';
4
- import { JsonUIComponentsType as JsonUIComponentsType$1, JsonUIFunctions as JsonUIFunctions$1, JsonUIFunctionType as JsonUIFunctionType$1, JsonUIComponentType as JsonUIComponentType$1 } from 'utils/types';
5
- import Stock$1 from 'stock/Stock';
2
+ import React__default from 'react';
3
+ import * as react_jsx_runtime from 'react/jsx-runtime';
6
4
  import * as redux from 'redux';
7
5
 
8
- interface NewStockType {
9
- components: JsonUIComponentsType$1;
10
- functions: JsonUIFunctions$1;
11
- }
12
- declare type InitType = (prop: NewStockType) => void;
13
- declare type RegisterFunctionType = (key: string, value: JsonUIFunctionType$1) => void;
14
- declare type RegisterComponentType = (key: string, value: JsonUIComponentType$1) => void;
15
- declare type CallFunctionType = (name: string, attr?: any, props?: any, callerArgs?: any) => any;
16
- declare type GetComponentType = (componentName: string) => ReactNode;
17
- declare class Stock {
18
- stock: NewStockType;
19
- Wrapper: React.ElementType;
20
- reduxStore: any;
21
- validations: any;
22
- constructor(newStock: NewStockType, Wrapper: React.ElementType, reduxStore: any);
23
- init: InitType;
24
- registerComponent: RegisterComponentType;
25
- registerFunction: RegisterFunctionType;
26
- callFunction: CallFunctionType;
27
- getComponent: GetComponentType;
28
- }
29
-
30
6
  declare const SEPARATOR = "/";
31
7
  declare const STORE_ERROR_POSTFIX = ".error";
32
8
  declare const STORE_TOUCH_POSTFIX = ".touch";
@@ -60,80 +36,80 @@ declare const UNDEFINED_COMP_NAME = "_Undefined";
60
36
  declare const PRIMITIVE_COMP_NAME = "_PrimitiveProp";
61
37
  declare const FRAGMENT_COMP_NAME = "Fragment";
62
38
 
63
- declare const constants_d_SEPARATOR: typeof SEPARATOR;
64
- declare const constants_d_STORE_ERROR_POSTFIX: typeof STORE_ERROR_POSTFIX;
65
- declare const constants_d_STORE_TOUCH_POSTFIX: typeof STORE_TOUCH_POSTFIX;
66
- declare const constants_d_PATH_MODIFIERS_KEY: typeof PATH_MODIFIERS_KEY;
67
- declare const constants_d_MODIFIER_KEY: typeof MODIFIER_KEY;
68
- declare const constants_d_ACTION_KEY: typeof ACTION_KEY;
69
- declare const constants_d_REF_ASSETS: typeof REF_ASSETS;
70
- declare const constants_d_REF_LOCALES: typeof REF_LOCALES;
71
- declare const constants_d_REF_VALIDATES: typeof REF_VALIDATES;
72
- declare const constants_d_STYLE_WEB_NAME: typeof STYLE_WEB_NAME;
73
- declare const constants_d_STYLE_RN_NAME: typeof STYLE_RN_NAME;
74
- declare const constants_d_REDUX_GET_FUNCTION: typeof REDUX_GET_FUNCTION;
75
- declare const constants_d_REDUX_SET_FUNCTION: typeof REDUX_SET_FUNCTION;
76
- declare const constants_d_REDUX_FUNCTIONS: typeof REDUX_FUNCTIONS;
77
- declare const constants_d_PATHNAME: typeof PATHNAME;
78
- declare const constants_d_SIMPLE_DATA_TYPES: typeof SIMPLE_DATA_TYPES;
79
- declare const constants_d_V_CHILDREN_NAME: typeof V_CHILDREN_NAME;
80
- declare const constants_d_V_COMP_NAME: typeof V_COMP_NAME;
81
- declare const constants_d_LIST_SEMAPHORE: typeof LIST_SEMAPHORE;
82
- declare const constants_d_LIST_ITEM: typeof LIST_ITEM;
83
- declare const constants_d_LIST_PAGE: typeof LIST_PAGE;
84
- declare const constants_d_LIST_ITEM_PER_PAGE: typeof LIST_ITEM_PER_PAGE;
85
- declare const constants_d_LIST_LENGTH: typeof LIST_LENGTH;
86
- declare const constants_d_LIST_ITEM_PER_PAGE_DEFAULT: typeof LIST_ITEM_PER_PAGE_DEFAULT;
87
- declare const constants_d_REDUX_PATHS: typeof REDUX_PATHS;
88
- declare const constants_d_V_CHILDREN_PREFIX: typeof V_CHILDREN_PREFIX;
89
- declare const constants_d_PARENT_PROP_NAME: typeof PARENT_PROP_NAME;
90
- declare const constants_d_CURRENT_PATH_NAME: typeof CURRENT_PATH_NAME;
91
- declare const constants_d_REDUX_GET_SUBSCRIBERS_NAME: typeof REDUX_GET_SUBSCRIBERS_NAME;
92
- declare const constants_d_UNDEFINED_COMP_NAME: typeof UNDEFINED_COMP_NAME;
93
- declare const constants_d_PRIMITIVE_COMP_NAME: typeof PRIMITIVE_COMP_NAME;
94
- declare const constants_d_FRAGMENT_COMP_NAME: typeof FRAGMENT_COMP_NAME;
95
- declare namespace constants_d {
39
+ declare const constants_ACTION_KEY: typeof ACTION_KEY;
40
+ declare const constants_CURRENT_PATH_NAME: typeof CURRENT_PATH_NAME;
41
+ declare const constants_FRAGMENT_COMP_NAME: typeof FRAGMENT_COMP_NAME;
42
+ declare const constants_LIST_ITEM: typeof LIST_ITEM;
43
+ declare const constants_LIST_ITEM_PER_PAGE: typeof LIST_ITEM_PER_PAGE;
44
+ declare const constants_LIST_ITEM_PER_PAGE_DEFAULT: typeof LIST_ITEM_PER_PAGE_DEFAULT;
45
+ declare const constants_LIST_LENGTH: typeof LIST_LENGTH;
46
+ declare const constants_LIST_PAGE: typeof LIST_PAGE;
47
+ declare const constants_LIST_SEMAPHORE: typeof LIST_SEMAPHORE;
48
+ declare const constants_MODIFIER_KEY: typeof MODIFIER_KEY;
49
+ declare const constants_PARENT_PROP_NAME: typeof PARENT_PROP_NAME;
50
+ declare const constants_PATHNAME: typeof PATHNAME;
51
+ declare const constants_PATH_MODIFIERS_KEY: typeof PATH_MODIFIERS_KEY;
52
+ declare const constants_PRIMITIVE_COMP_NAME: typeof PRIMITIVE_COMP_NAME;
53
+ declare const constants_REDUX_FUNCTIONS: typeof REDUX_FUNCTIONS;
54
+ declare const constants_REDUX_GET_FUNCTION: typeof REDUX_GET_FUNCTION;
55
+ declare const constants_REDUX_GET_SUBSCRIBERS_NAME: typeof REDUX_GET_SUBSCRIBERS_NAME;
56
+ declare const constants_REDUX_PATHS: typeof REDUX_PATHS;
57
+ declare const constants_REDUX_SET_FUNCTION: typeof REDUX_SET_FUNCTION;
58
+ declare const constants_REF_ASSETS: typeof REF_ASSETS;
59
+ declare const constants_REF_LOCALES: typeof REF_LOCALES;
60
+ declare const constants_REF_VALIDATES: typeof REF_VALIDATES;
61
+ declare const constants_SEPARATOR: typeof SEPARATOR;
62
+ declare const constants_SIMPLE_DATA_TYPES: typeof SIMPLE_DATA_TYPES;
63
+ declare const constants_STORE_ERROR_POSTFIX: typeof STORE_ERROR_POSTFIX;
64
+ declare const constants_STORE_TOUCH_POSTFIX: typeof STORE_TOUCH_POSTFIX;
65
+ declare const constants_STYLE_RN_NAME: typeof STYLE_RN_NAME;
66
+ declare const constants_STYLE_WEB_NAME: typeof STYLE_WEB_NAME;
67
+ declare const constants_UNDEFINED_COMP_NAME: typeof UNDEFINED_COMP_NAME;
68
+ declare const constants_V_CHILDREN_NAME: typeof V_CHILDREN_NAME;
69
+ declare const constants_V_CHILDREN_PREFIX: typeof V_CHILDREN_PREFIX;
70
+ declare const constants_V_COMP_NAME: typeof V_COMP_NAME;
71
+ declare namespace constants {
96
72
  export {
97
- constants_d_SEPARATOR as SEPARATOR,
98
- constants_d_STORE_ERROR_POSTFIX as STORE_ERROR_POSTFIX,
99
- constants_d_STORE_TOUCH_POSTFIX as STORE_TOUCH_POSTFIX,
100
- constants_d_PATH_MODIFIERS_KEY as PATH_MODIFIERS_KEY,
101
- constants_d_MODIFIER_KEY as MODIFIER_KEY,
102
- constants_d_ACTION_KEY as ACTION_KEY,
103
- constants_d_REF_ASSETS as REF_ASSETS,
104
- constants_d_REF_LOCALES as REF_LOCALES,
105
- constants_d_REF_VALIDATES as REF_VALIDATES,
106
- constants_d_STYLE_WEB_NAME as STYLE_WEB_NAME,
107
- constants_d_STYLE_RN_NAME as STYLE_RN_NAME,
108
- constants_d_REDUX_GET_FUNCTION as REDUX_GET_FUNCTION,
109
- constants_d_REDUX_SET_FUNCTION as REDUX_SET_FUNCTION,
110
- constants_d_REDUX_FUNCTIONS as REDUX_FUNCTIONS,
111
- constants_d_PATHNAME as PATHNAME,
112
- constants_d_SIMPLE_DATA_TYPES as SIMPLE_DATA_TYPES,
113
- constants_d_V_CHILDREN_NAME as V_CHILDREN_NAME,
114
- constants_d_V_COMP_NAME as V_COMP_NAME,
115
- constants_d_LIST_SEMAPHORE as LIST_SEMAPHORE,
116
- constants_d_LIST_ITEM as LIST_ITEM,
117
- constants_d_LIST_PAGE as LIST_PAGE,
118
- constants_d_LIST_ITEM_PER_PAGE as LIST_ITEM_PER_PAGE,
119
- constants_d_LIST_LENGTH as LIST_LENGTH,
120
- constants_d_LIST_ITEM_PER_PAGE_DEFAULT as LIST_ITEM_PER_PAGE_DEFAULT,
121
- constants_d_REDUX_PATHS as REDUX_PATHS,
122
- constants_d_V_CHILDREN_PREFIX as V_CHILDREN_PREFIX,
123
- constants_d_PARENT_PROP_NAME as PARENT_PROP_NAME,
124
- constants_d_CURRENT_PATH_NAME as CURRENT_PATH_NAME,
125
- constants_d_REDUX_GET_SUBSCRIBERS_NAME as REDUX_GET_SUBSCRIBERS_NAME,
126
- constants_d_UNDEFINED_COMP_NAME as UNDEFINED_COMP_NAME,
127
- constants_d_PRIMITIVE_COMP_NAME as PRIMITIVE_COMP_NAME,
128
- constants_d_FRAGMENT_COMP_NAME as FRAGMENT_COMP_NAME,
73
+ constants_ACTION_KEY as ACTION_KEY,
74
+ constants_CURRENT_PATH_NAME as CURRENT_PATH_NAME,
75
+ constants_FRAGMENT_COMP_NAME as FRAGMENT_COMP_NAME,
76
+ constants_LIST_ITEM as LIST_ITEM,
77
+ constants_LIST_ITEM_PER_PAGE as LIST_ITEM_PER_PAGE,
78
+ constants_LIST_ITEM_PER_PAGE_DEFAULT as LIST_ITEM_PER_PAGE_DEFAULT,
79
+ constants_LIST_LENGTH as LIST_LENGTH,
80
+ constants_LIST_PAGE as LIST_PAGE,
81
+ constants_LIST_SEMAPHORE as LIST_SEMAPHORE,
82
+ constants_MODIFIER_KEY as MODIFIER_KEY,
83
+ constants_PARENT_PROP_NAME as PARENT_PROP_NAME,
84
+ constants_PATHNAME as PATHNAME,
85
+ constants_PATH_MODIFIERS_KEY as PATH_MODIFIERS_KEY,
86
+ constants_PRIMITIVE_COMP_NAME as PRIMITIVE_COMP_NAME,
87
+ constants_REDUX_FUNCTIONS as REDUX_FUNCTIONS,
88
+ constants_REDUX_GET_FUNCTION as REDUX_GET_FUNCTION,
89
+ constants_REDUX_GET_SUBSCRIBERS_NAME as REDUX_GET_SUBSCRIBERS_NAME,
90
+ constants_REDUX_PATHS as REDUX_PATHS,
91
+ constants_REDUX_SET_FUNCTION as REDUX_SET_FUNCTION,
92
+ constants_REF_ASSETS as REF_ASSETS,
93
+ constants_REF_LOCALES as REF_LOCALES,
94
+ constants_REF_VALIDATES as REF_VALIDATES,
95
+ constants_SEPARATOR as SEPARATOR,
96
+ constants_SIMPLE_DATA_TYPES as SIMPLE_DATA_TYPES,
97
+ constants_STORE_ERROR_POSTFIX as STORE_ERROR_POSTFIX,
98
+ constants_STORE_TOUCH_POSTFIX as STORE_TOUCH_POSTFIX,
99
+ constants_STYLE_RN_NAME as STYLE_RN_NAME,
100
+ constants_STYLE_WEB_NAME as STYLE_WEB_NAME,
101
+ constants_UNDEFINED_COMP_NAME as UNDEFINED_COMP_NAME,
102
+ constants_V_CHILDREN_NAME as V_CHILDREN_NAME,
103
+ constants_V_CHILDREN_PREFIX as V_CHILDREN_PREFIX,
104
+ constants_V_COMP_NAME as V_COMP_NAME,
129
105
  };
130
106
  }
131
107
 
132
- declare type UIDefinition = any;
133
- declare type Path = string;
134
- declare type ArraysType = any[];
135
- declare type WrapperType = React__default.ElementType;
136
- declare type PropValue = PropsType | ArraysType | string | null | boolean | number | undefined | PathModifiersType;
108
+ type UIDefinition = any;
109
+ type Path = string;
110
+ type ArraysType = any[];
111
+ type WrapperType = React__default.ElementType;
112
+ type PropValue = PropsType | ArraysType | string | null | boolean | number | undefined | PathModifiersType;
137
113
  interface PathModifierType {
138
114
  path: string;
139
115
  }
@@ -148,7 +124,7 @@ interface PathType {
148
124
  path: string[];
149
125
  level: number;
150
126
  }
151
- declare type PathsType = PathType[];
127
+ type PathsType = PathType[];
152
128
  interface ValidationType {
153
129
  store: string;
154
130
  path: string;
@@ -165,15 +141,37 @@ interface ReduxPath {
165
141
  type?: ReduxPathTypeEnum;
166
142
  jsonataDef?: string;
167
143
  }
168
- declare type JsonUIComponentType = React__default.FC<any> | typeof React__default.Component | ((prop: any) => number | null | undefined | string);
144
+ type JsonUIComponentType = React__default.FC<any> | typeof React__default.Component | ((prop: any) => number | null | undefined | string);
169
145
  interface JsonUIComponentsType {
170
146
  [key: string]: JsonUIComponentType;
171
147
  }
172
- declare type JsonUIFunctionType = (attr: any, props: any, callerArgs: any, stock: any) => Promise<void> | void | any;
148
+ type JsonUIFunctionType = (attr: any, props: any, callerArgs: any, stock: any) => Promise<void> | void | any;
173
149
  interface JsonUIFunctions {
174
150
  [key: string]: JsonUIFunctionType;
175
151
  }
176
152
 
153
+ interface NewStockType {
154
+ components: JsonUIComponentsType;
155
+ functions: JsonUIFunctions;
156
+ }
157
+ type InitType = (prop: NewStockType) => void;
158
+ type RegisterFunctionType = (key: string, value: JsonUIFunctionType) => void;
159
+ type RegisterComponentType = (key: string, value: JsonUIComponentType) => void;
160
+ type CallFunctionType = (name: string, attr?: any, props?: any, callerArgs?: any) => any;
161
+ type GetComponentType = (componentName: string) => JsonUIComponentType;
162
+ declare class Stock {
163
+ stock: NewStockType;
164
+ Wrapper: React.ElementType;
165
+ reduxStore: any;
166
+ validations: any;
167
+ constructor(newStock: NewStockType, Wrapper: React.ElementType, reduxStore: any);
168
+ init: InitType;
169
+ registerComponent: RegisterComponentType;
170
+ registerFunction: RegisterFunctionType;
171
+ callFunction: CallFunctionType;
172
+ getComponent: GetComponentType;
173
+ }
174
+
177
175
  interface OwnTraverse {
178
176
  key: string;
179
177
  value: PropsType;
@@ -187,57 +185,57 @@ declare const calculatePropsFromModifier: (props: PropsType, stock: InstanceType
187
185
  declare const getCurrentPaths: (props: PropsType, pathModifier: PathModifiersType) => PathModifiersType;
188
186
  declare const normalisePrimitives: (props: PropsType, parentComp?: any) => any;
189
187
  declare const getRootWrapperProps: (props: PropsType, stock: InstanceType<typeof Stock>) => void;
190
- declare const isChildrenProp: (propName?: string | undefined) => boolean;
188
+ declare const isChildrenProp: (propName?: string) => boolean;
191
189
  declare const getParentProps: (props: PropsType) => PropsType;
192
190
  declare const getPropsChildrenFilter: ({ props, filter }: {
193
191
  props: PropsType;
194
- filter: 'onlyChildren' | 'withoutChildren';
192
+ filter: "onlyChildren" | "withoutChildren";
195
193
  }) => PropsType;
196
- declare const getChildrensForRoot: (props: PropsType, children: any, Wrapper: WrapperType) => JSX.Element | JSX.Element[] | undefined;
197
- declare const generateChildren: (props: PropsType, { Wrapper }: InstanceType<typeof Stock>) => PropValue | JSX.Element;
198
- declare const generateNewChildren: (props: PropsType, { Wrapper }: InstanceType<typeof Stock>) => JSX.Element | JSX.Element[] | undefined;
194
+ declare const getChildrensForRoot: (props: PropsType, children: any, Wrapper: WrapperType) => react_jsx_runtime.JSX.Element | react_jsx_runtime.JSX.Element[] | undefined;
195
+ declare const generateChildren: (props: PropsType, { Wrapper }: InstanceType<typeof Stock>) => PropValue | react_jsx_runtime.JSX.Element;
196
+ declare const generateNewChildren: (props: PropsType, { Wrapper }: InstanceType<typeof Stock>) => react_jsx_runtime.JSX.Element | react_jsx_runtime.JSX.Element[] | undefined;
199
197
  declare const isTechnicalProp: (propName: string) => boolean;
200
198
  declare const removeTechnicalProps: (changeableProps: any) => any;
201
199
 
202
- declare const wrapperUtil_d_getFilteredPath: typeof getFilteredPath;
203
- declare const wrapperUtil_d_actionBuilder: typeof actionBuilder;
204
- declare const wrapperUtil_d_calculatePropsFromModifier: typeof calculatePropsFromModifier;
205
- declare const wrapperUtil_d_getCurrentPaths: typeof getCurrentPaths;
206
- declare const wrapperUtil_d_normalisePrimitives: typeof normalisePrimitives;
207
- declare const wrapperUtil_d_getRootWrapperProps: typeof getRootWrapperProps;
208
- declare const wrapperUtil_d_isChildrenProp: typeof isChildrenProp;
209
- declare const wrapperUtil_d_getParentProps: typeof getParentProps;
210
- declare const wrapperUtil_d_getPropsChildrenFilter: typeof getPropsChildrenFilter;
211
- declare const wrapperUtil_d_getChildrensForRoot: typeof getChildrensForRoot;
212
- declare const wrapperUtil_d_generateChildren: typeof generateChildren;
213
- declare const wrapperUtil_d_generateNewChildren: typeof generateNewChildren;
214
- declare const wrapperUtil_d_isTechnicalProp: typeof isTechnicalProp;
215
- declare const wrapperUtil_d_removeTechnicalProps: typeof removeTechnicalProps;
216
- declare namespace wrapperUtil_d {
200
+ declare const wrapperUtil_actionBuilder: typeof actionBuilder;
201
+ declare const wrapperUtil_calculatePropsFromModifier: typeof calculatePropsFromModifier;
202
+ declare const wrapperUtil_generateChildren: typeof generateChildren;
203
+ declare const wrapperUtil_generateNewChildren: typeof generateNewChildren;
204
+ declare const wrapperUtil_getChildrensForRoot: typeof getChildrensForRoot;
205
+ declare const wrapperUtil_getCurrentPaths: typeof getCurrentPaths;
206
+ declare const wrapperUtil_getFilteredPath: typeof getFilteredPath;
207
+ declare const wrapperUtil_getParentProps: typeof getParentProps;
208
+ declare const wrapperUtil_getPropsChildrenFilter: typeof getPropsChildrenFilter;
209
+ declare const wrapperUtil_getRootWrapperProps: typeof getRootWrapperProps;
210
+ declare const wrapperUtil_isChildrenProp: typeof isChildrenProp;
211
+ declare const wrapperUtil_isTechnicalProp: typeof isTechnicalProp;
212
+ declare const wrapperUtil_normalisePrimitives: typeof normalisePrimitives;
213
+ declare const wrapperUtil_removeTechnicalProps: typeof removeTechnicalProps;
214
+ declare namespace wrapperUtil {
217
215
  export {
218
- wrapperUtil_d_getFilteredPath as getFilteredPath,
219
- wrapperUtil_d_actionBuilder as actionBuilder,
220
- wrapperUtil_d_calculatePropsFromModifier as calculatePropsFromModifier,
221
- wrapperUtil_d_getCurrentPaths as getCurrentPaths,
222
- wrapperUtil_d_normalisePrimitives as normalisePrimitives,
223
- wrapperUtil_d_getRootWrapperProps as getRootWrapperProps,
224
- wrapperUtil_d_isChildrenProp as isChildrenProp,
225
- wrapperUtil_d_getParentProps as getParentProps,
226
- wrapperUtil_d_getPropsChildrenFilter as getPropsChildrenFilter,
227
- wrapperUtil_d_getChildrensForRoot as getChildrensForRoot,
228
- wrapperUtil_d_generateChildren as generateChildren,
229
- wrapperUtil_d_generateNewChildren as generateNewChildren,
230
- wrapperUtil_d_isTechnicalProp as isTechnicalProp,
231
- wrapperUtil_d_removeTechnicalProps as removeTechnicalProps,
216
+ wrapperUtil_actionBuilder as actionBuilder,
217
+ wrapperUtil_calculatePropsFromModifier as calculatePropsFromModifier,
218
+ wrapperUtil_generateChildren as generateChildren,
219
+ wrapperUtil_generateNewChildren as generateNewChildren,
220
+ wrapperUtil_getChildrensForRoot as getChildrensForRoot,
221
+ wrapperUtil_getCurrentPaths as getCurrentPaths,
222
+ wrapperUtil_getFilteredPath as getFilteredPath,
223
+ wrapperUtil_getParentProps as getParentProps,
224
+ wrapperUtil_getPropsChildrenFilter as getPropsChildrenFilter,
225
+ wrapperUtil_getRootWrapperProps as getRootWrapperProps,
226
+ wrapperUtil_isChildrenProp as isChildrenProp,
227
+ wrapperUtil_isTechnicalProp as isTechnicalProp,
228
+ wrapperUtil_normalisePrimitives as normalisePrimitives,
229
+ wrapperUtil_removeTechnicalProps as removeTechnicalProps,
232
230
  };
233
231
  }
234
232
 
235
233
  declare const findLastIndex: (arr: any[], func: any) => number;
236
234
  declare const drop: (arr: any[], n?: number) => any[];
237
- declare const isNumber: (a: any) => boolean;
238
- declare const jsonPointerFix: (path?: string | undefined) => string;
239
- declare const jsonPointerGet: (json: any, path?: string | undefined) => any;
240
- declare const jsonPointerSet: (json: any, path?: string | undefined, value?: any) => any;
235
+ declare const isNumber: (a: any) => a is number;
236
+ declare const jsonPointerFix: (path?: string) => string;
237
+ declare const jsonPointerGet: (json: any, path?: string) => any;
238
+ declare const jsonPointerSet: (json: any, path?: string, value?: any) => any;
241
239
  declare const pathArrayToPathString: (array: (string | number)[]) => string;
242
240
  declare const pathArrayToJsonPointer: (array: (string | number)[]) => string;
243
241
  declare function isOnlyObject(item: any): boolean;
@@ -253,44 +251,44 @@ declare const collectObjMerge: (refConst: string, json: any) => {};
253
251
  declare const collectObjToArray: (refConst: string, json: any, flatten?: boolean) => any[];
254
252
  declare const isValidJson: (d: any) => boolean;
255
253
  declare const isPrimitiveValue: (value: any, emptyStringAllowed?: boolean) => boolean;
256
- declare const hasLeaf: (obj: any, emptyStringAllowed?: boolean | undefined) => boolean;
254
+ declare const hasLeaf: (obj: any, emptyStringAllowed?: boolean) => boolean;
257
255
 
258
- declare const util_d_findLastIndex: typeof findLastIndex;
259
- declare const util_d_drop: typeof drop;
260
- declare const util_d_isNumber: typeof isNumber;
261
- declare const util_d_jsonPointerFix: typeof jsonPointerFix;
262
- declare const util_d_jsonPointerGet: typeof jsonPointerGet;
263
- declare const util_d_jsonPointerSet: typeof jsonPointerSet;
264
- declare const util_d_pathArrayToPathString: typeof pathArrayToPathString;
265
- declare const util_d_pathArrayToJsonPointer: typeof pathArrayToJsonPointer;
266
- declare const util_d_isOnlyObject: typeof isOnlyObject;
267
- declare const util_d_mergePath: typeof mergePath;
268
- declare const util_d_changeRelativePath: typeof changeRelativePath;
269
- declare const util_d_mergeDeep: typeof mergeDeep;
270
- declare const util_d_collectObjMerge: typeof collectObjMerge;
271
- declare const util_d_collectObjToArray: typeof collectObjToArray;
272
- declare const util_d_isValidJson: typeof isValidJson;
273
- declare const util_d_isPrimitiveValue: typeof isPrimitiveValue;
274
- declare const util_d_hasLeaf: typeof hasLeaf;
275
- declare namespace util_d {
256
+ declare const jsonUtils_changeRelativePath: typeof changeRelativePath;
257
+ declare const jsonUtils_collectObjMerge: typeof collectObjMerge;
258
+ declare const jsonUtils_collectObjToArray: typeof collectObjToArray;
259
+ declare const jsonUtils_drop: typeof drop;
260
+ declare const jsonUtils_findLastIndex: typeof findLastIndex;
261
+ declare const jsonUtils_hasLeaf: typeof hasLeaf;
262
+ declare const jsonUtils_isNumber: typeof isNumber;
263
+ declare const jsonUtils_isOnlyObject: typeof isOnlyObject;
264
+ declare const jsonUtils_isPrimitiveValue: typeof isPrimitiveValue;
265
+ declare const jsonUtils_isValidJson: typeof isValidJson;
266
+ declare const jsonUtils_jsonPointerFix: typeof jsonPointerFix;
267
+ declare const jsonUtils_jsonPointerGet: typeof jsonPointerGet;
268
+ declare const jsonUtils_jsonPointerSet: typeof jsonPointerSet;
269
+ declare const jsonUtils_mergeDeep: typeof mergeDeep;
270
+ declare const jsonUtils_mergePath: typeof mergePath;
271
+ declare const jsonUtils_pathArrayToJsonPointer: typeof pathArrayToJsonPointer;
272
+ declare const jsonUtils_pathArrayToPathString: typeof pathArrayToPathString;
273
+ declare namespace jsonUtils {
276
274
  export {
277
- util_d_findLastIndex as findLastIndex,
278
- util_d_drop as drop,
279
- util_d_isNumber as isNumber,
280
- util_d_jsonPointerFix as jsonPointerFix,
281
- util_d_jsonPointerGet as jsonPointerGet,
282
- util_d_jsonPointerSet as jsonPointerSet,
283
- util_d_pathArrayToPathString as pathArrayToPathString,
284
- util_d_pathArrayToJsonPointer as pathArrayToJsonPointer,
285
- util_d_isOnlyObject as isOnlyObject,
286
- util_d_mergePath as mergePath,
287
- util_d_changeRelativePath as changeRelativePath,
288
- util_d_mergeDeep as mergeDeep,
289
- util_d_collectObjMerge as collectObjMerge,
290
- util_d_collectObjToArray as collectObjToArray,
291
- util_d_isValidJson as isValidJson,
292
- util_d_isPrimitiveValue as isPrimitiveValue,
293
- util_d_hasLeaf as hasLeaf,
275
+ jsonUtils_changeRelativePath as changeRelativePath,
276
+ jsonUtils_collectObjMerge as collectObjMerge,
277
+ jsonUtils_collectObjToArray as collectObjToArray,
278
+ jsonUtils_drop as drop,
279
+ jsonUtils_findLastIndex as findLastIndex,
280
+ jsonUtils_hasLeaf as hasLeaf,
281
+ jsonUtils_isNumber as isNumber,
282
+ jsonUtils_isOnlyObject as isOnlyObject,
283
+ jsonUtils_isPrimitiveValue as isPrimitiveValue,
284
+ jsonUtils_isValidJson as isValidJson,
285
+ jsonUtils_jsonPointerFix as jsonPointerFix,
286
+ jsonUtils_jsonPointerGet as jsonPointerGet,
287
+ jsonUtils_jsonPointerSet as jsonPointerSet,
288
+ jsonUtils_mergeDeep as mergeDeep,
289
+ jsonUtils_mergePath as mergePath,
290
+ jsonUtils_pathArrayToJsonPointer as pathArrayToJsonPointer,
291
+ jsonUtils_pathArrayToPathString as pathArrayToPathString,
294
292
  };
295
293
  }
296
294
 
@@ -318,10 +316,10 @@ declare class I18n {
318
316
  availableLanguageKey?: string;
319
317
  constructor({ language, resources, nonExistsHandler, keyPrefix, keyPostfix }: I18nProps);
320
318
  getLocales: () => string;
321
- t: (key: any, options?: any, language?: string | null | undefined) => any;
319
+ t: (key: any, options?: any, language?: string | null) => any;
322
320
  }
323
321
 
324
- declare const StockContext: React$1.Context<Stock$1 | null>;
322
+ declare const StockContext: React$1.Context<Stock | null>;
325
323
  declare const PathModifierContext: React$1.Context<{}>;
326
324
 
327
325
  declare const compSelectorHook: (currentPaths: PathModifiersType, subscriberPaths: ReduxPath[]) => (state: any) => any[] | undefined;
@@ -336,4 +334,5 @@ declare const rootReducer: redux.Reducer<redux.CombinedState<{
336
334
  root: any;
337
335
  }>, redux.AnyAction>;
338
336
 
339
- export { ArraysType, I18n, JsonUIComponentsType, JsonUIFunctionType, JsonUIFunctions, Path, PathModifierContext, PathModifierType, PathModifiersType, PathType, PathsType, PropValue, PropsType, ReduxPath, ReduxPathTypeEnum, Stock, StockContext, UIDefinition, ValidationType, WrapperType, compSelectorHook, constants_d as constants, _default as stockFunctions, rootReducer as storeReducers, util_d as util, wrapperUtil_d as wrapperUtil };
337
+ export { I18n, PathModifierContext, ReduxPathTypeEnum, Stock, StockContext, compSelectorHook, constants, _default as stockFunctions, rootReducer as storeReducers, jsonUtils as utils, wrapperUtil };
338
+ export type { ArraysType, JsonUIComponentsType, JsonUIFunctionType, JsonUIFunctions, Path, PathModifierType, PathModifiersType, PathType, PathsType, PropValue, PropsType, ReduxPath, UIDefinition, ValidationType, WrapperType };
package/package.json CHANGED
@@ -1,16 +1,23 @@
1
1
  {
2
2
  "name": "@jsonui/core",
3
- "version": "0.7.5",
3
+ "version": "0.8.1",
4
4
  "license": "MIT",
5
5
  "source": "src/index.ts",
6
- "main": "dist/cjs/index.js",
7
- "module": "dist/esm/index.js",
8
6
  "homepage": "http://www.jsonui.org/",
9
7
  "files": [
10
8
  "dist"
11
9
  ],
10
+ "main": "dist/cjs/index.js",
11
+ "module": "dist/esm/index.js",
12
12
  "types": "dist/index.d.ts",
13
13
  "type": "module",
14
+ "exports": {
15
+ ".": {
16
+ "import": "./dist/esm/index.js",
17
+ "require": "./dist/cjs/index.js",
18
+ "types": "./dist/index.d.ts"
19
+ }
20
+ },
14
21
  "scripts": {
15
22
  "lint": "eslint src --ext .jsx,.js,.tsx,.ts",
16
23
  "test": "jest",
@@ -21,28 +28,30 @@
21
28
  "access": "public"
22
29
  },
23
30
  "dependencies": {
24
- "ajv": "^8.9.0",
31
+ "ajv": "^8.17.1",
25
32
  "ajv-errors": "^3.0.0",
26
33
  "ajv-formats": "^3.0.1",
27
- "immer": "^9.0.12",
28
- "jsonata": "^1.8.5",
29
- "jsonpointer": "^5.0.0",
34
+ "immer": "^10.2.0",
35
+ "jsonata": "^2.1.0",
36
+ "jsonpointer": "^5.0.1",
30
37
  "key-value-replace": "^3.0.0",
31
- "lodash": "^4.17.21",
32
- "redux": "^4.1.2",
33
- "traverse": "^0.6.6"
38
+ "traverse": "^0.6.11"
34
39
  },
35
40
  "peerDependencies": {
36
- "react": "^17.0.2",
37
- "react-dom": "^17.0.2"
41
+ "lodash": "^4.17.21",
42
+ "react": "^19.2.0",
43
+ "react-dom": "^19.2.0",
44
+ "redux": "^5.0.1"
38
45
  },
39
46
  "devDependencies": {
40
- "@rollup/plugin-commonjs": "^21.0.1",
41
- "@rollup/plugin-json": "^4.1.0",
42
- "@rollup/plugin-node-resolve": "^13.1.3",
43
- "@rollup/plugin-typescript": "^8.3.0",
44
- "@types/jest": "^27.4.0",
45
- "@types/traverse": "^0.6.32",
47
+ "@rollup/plugin-commonjs": "^29.0.0",
48
+ "@rollup/plugin-json": "^6.1.0",
49
+ "@rollup/plugin-node-resolve": "^16.0.3",
50
+ "@rollup/plugin-typescript": "^12.3.0",
51
+ "@types/jest": "^30.0.0",
52
+ "@types/react": "^19.2.3",
53
+ "@types/react-dom": "^19.2.2",
54
+ "@types/traverse": "^0.6.37",
46
55
  "@typescript-eslint/eslint-plugin": "^5.10.0",
47
56
  "@typescript-eslint/parser": "^5.10.0",
48
57
  "eslint": "^8.2.0",
@@ -51,11 +60,12 @@
51
60
  "eslint-plugin-jsx-a11y": "^6.5.1",
52
61
  "eslint-plugin-react": "^7.28.0",
53
62
  "eslint-plugin-react-hooks": "^4.3.0",
54
- "jest": "^27.5.1",
55
- "rollup": "^2.67.3",
56
- "rollup-plugin-dts": "^4.1.0",
57
- "rollup-plugin-visualizer": "^5.5.4",
58
- "ts-jest": "^27.1.3"
63
+ "jest": "^30.2.0",
64
+ "rollup": "^4.53.2",
65
+ "rollup-plugin-dts": "^6.2.3",
66
+ "rollup-plugin-visualizer": "^6.0.5",
67
+ "ts-jest": "^29.4.5",
68
+ "typescript": "^5.9.3"
59
69
  },
60
- "gitHead": "6d81d8253ba84681a5b3c832dee1084cd2e5d26f"
70
+ "gitHead": "aac0d89b4cf6116cebea7d4fbdc49ea39637da2f"
61
71
  }
@@ -1,12 +0,0 @@
1
- import Stock from './stock/Stock';
2
- import * as wrapperUtil from './wrapper/wrapperUtil';
3
- import * as constants from './utils/constants';
4
- import * as util from './utils/util';
5
- import I18n from './utils/I18n';
6
- import { StockContext, PathModifierContext } from './utils/contextHandler';
7
- import { compSelectorHook } from './store/root/selectors';
8
- import stockFunctions from './stock/functions';
9
- import storeReducers from './store/reducers';
10
- import { UIDefinition, Path, ArraysType, WrapperType, PropValue, PathModifierType, PathModifiersType, PropsType, PathType, PathsType, ValidationType, ReduxPathTypeEnum, ReduxPath, JsonUIComponentsType, JsonUIFunctionType, JsonUIFunctions } from './utils/types';
11
- export { Stock, I18n, wrapperUtil, util, constants, StockContext, PathModifierContext, compSelectorHook, stockFunctions, storeReducers };
12
- export type { UIDefinition, Path, ArraysType, WrapperType, PropValue, PathModifierType, PathModifiersType, PropsType, PathType, PathsType, ValidationType, ReduxPathTypeEnum, ReduxPath, JsonUIComponentsType, JsonUIFunctionType, JsonUIFunctions, };
@@ -1,24 +0,0 @@
1
- import { ReactNode } from 'react';
2
- import { JsonUIComponentsType, JsonUIComponentType, JsonUIFunctions, JsonUIFunctionType } from 'utils/types';
3
- interface NewStockType {
4
- components: JsonUIComponentsType;
5
- functions: JsonUIFunctions;
6
- }
7
- declare type InitType = (prop: NewStockType) => void;
8
- declare type RegisterFunctionType = (key: string, value: JsonUIFunctionType) => void;
9
- declare type RegisterComponentType = (key: string, value: JsonUIComponentType) => void;
10
- declare type CallFunctionType = (name: string, attr?: any, props?: any, callerArgs?: any) => any;
11
- declare type GetComponentType = (componentName: string) => ReactNode;
12
- export default class Stock {
13
- stock: NewStockType;
14
- Wrapper: React.ElementType;
15
- reduxStore: any;
16
- validations: any;
17
- constructor(newStock: NewStockType, Wrapper: React.ElementType, reduxStore: any);
18
- init: InitType;
19
- registerComponent: RegisterComponentType;
20
- registerFunction: RegisterFunctionType;
21
- callFunction: CallFunctionType;
22
- getComponent: GetComponentType;
23
- }
24
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1,4 +0,0 @@
1
- import { JsonUIFunctions, JsonUIFunctionType } from 'utils/types';
2
- export declare const deletePersistDataStore: JsonUIFunctionType;
3
- declare const appRootFunctions: JsonUIFunctions;
4
- export default appRootFunctions;
@@ -1,7 +0,0 @@
1
- import { JsonUIFunctionType } from '../utils/types';
2
- declare const _default: {
3
- get: JsonUIFunctionType;
4
- set: JsonUIFunctionType;
5
- jsonata: JsonUIFunctionType;
6
- };
7
- export default _default;
@@ -1,11 +0,0 @@
1
- import { ErrorObject } from 'ajv';
2
- export declare const errorConverter: (errors: ErrorObject<string, Record<string, any>, unknown>[] | null | undefined) => any;
3
- export declare const validateJSON: (schema: any, data: any) => {
4
- valid: boolean;
5
- error: any;
6
- };
7
- export declare const validateJSONAndStore: (schema: any, store: string, data: any) => {
8
- store: string;
9
- valid: boolean;
10
- value: any;
11
- };
@@ -1,8 +0,0 @@
1
- /// <reference types="redux-persist/types/types" />
2
- /// <reference types="redux-persist" />
3
- declare const _default: {
4
- key: string;
5
- whitelist: string[];
6
- transforms: import("redux-persist").Transform<unknown, unknown, any, any>[];
7
- };
8
- export default _default;
@@ -1,4 +0,0 @@
1
- declare const rootReducer: import("redux").Reducer<import("redux").CombinedState<{
2
- root: any;
3
- }>, import("redux").AnyAction>;
4
- export default rootReducer;
@@ -1,5 +0,0 @@
1
- export declare const DATA_UPDATE = "DATA_UPDATE";
2
- export declare const set: (payload: any) => {
3
- type: string;
4
- payload: any;
5
- };
@@ -1,4 +0,0 @@
1
- import { AnyAction } from 'redux';
2
- export declare type RootStateType = any;
3
- declare const reducer: (state: any, action: AnyAction) => any;
4
- export default reducer;
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};