@jsonui/core 0.9.1 → 0.10.9

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/dist/index.d.ts CHANGED
@@ -1,340 +1,245 @@
1
- import * as React$1 from 'react';
2
- import React__default from 'react';
3
- import * as react_jsx_runtime from 'react/jsx-runtime';
4
- import * as redux from 'redux';
1
+ import { ValidateFunction } from 'ajv';
5
2
 
6
- declare const SEPARATOR = "/";
7
- declare const STORE_ERROR_POSTFIX = ".error";
8
- declare const STORE_TOUCH_POSTFIX = ".touch";
9
- declare const PATH_MODIFIERS_KEY = "$pathModifiers";
10
- declare const MODIFIER_KEY = "$modifier";
3
+ /**
4
+ * Tree-shaped state management with multiple stores.
5
+ * Similar to Redux but tailored for JSON UI: per-store trees, JSON Pointer paths.
6
+ *
7
+ * Store paths are unbounded and can be arbitrarily nested (objects and arrays),
8
+ * e.g. /a/b/c/2/d/e/0/f. Logical paths are resolved via resolveStorePath and
9
+ * applied consistently in get/set.
10
+ */
11
+
12
+ type StoreState = Record<string, unknown>;
13
+ type StoreChangeListener = (storeName: string, logicalPath: string) => void;
14
+ declare class FormStore {
15
+ private state;
16
+ private changeListeners;
17
+ getState(): Readonly<StoreState>;
18
+ /**
19
+ * Logical JsonUI stores snapshot — same shape as `JsonUI` `defaultValues`:
20
+ * `{ data: {...}, "data.touch": {...}, "data.error": {...} }`.
21
+ * Omits the internal `/storeRoot` wrapper returned by {@link getState}.
22
+ */
23
+ getLogicalStoresMap(): Record<string, JSONValue>;
24
+ /**
25
+ * Initialise a logical store root without marking fields as touched.
26
+ */
27
+ initializeStore(storeName: string, value: JSONValue): void;
28
+ private getByPointer;
29
+ private setByPointer;
30
+ /**
31
+ * Convenience helpers that work with logical store names and logical paths,
32
+ * instead of requiring callers to compose `/storeRoot/{storeName}/...`.
33
+ *
34
+ * Store isolation: each storeName (e.g. "data", "data.error", "data.touch") is
35
+ * a distinct store. get/set only read/write that store's subtree;
36
+ * "data.error" cannot access "data" or any other store.
37
+ *
38
+ * When trackTouch is true, set also writes to `${storeName}.touch` at
39
+ * the same logicalPath; path normalization applies (no empty segments).
40
+ */
41
+ set(storeName: string, logicalPath: string, value: unknown, trackTouch?: boolean): void;
42
+ get(storeName: string, logicalPath: string): unknown;
43
+ setForStore(storeName: string, logicalPath: string, value: unknown, trackTouch?: boolean): void;
44
+ getForStore(storeName: string, logicalPath: string): unknown;
45
+ private notify;
46
+ subscribeChange(listener: StoreChangeListener): () => void;
47
+ private notifyChange;
48
+ }
49
+ /**
50
+ * Resolve a path for a given store, using pathModifiers (from list context) and currentPath for relative paths.
51
+ * - Absolute path: /firstname -> unchanged (then normalized).
52
+ * - Relative path: firstname -> resolved against currentPath (or pathModifiers[storeName] when in list context).
53
+ * - pathModifiers apply per store: only pathModifiers[storeName] is used for that store; "data.error" cannot
54
+ * access "data" or any other store.
55
+ * Returns a normalized path (no empty segments, no trailing slash).
56
+ */
57
+ declare const resolveStorePath: (pathStr: string, currentPath: string, pathModifiers?: PathModifier, storeName?: string) => string;
58
+
59
+ declare const V_COMP = "$comp";
60
+ declare const V_CHILDREN = "$children";
11
61
  declare const ACTION_KEY = "$action";
12
- declare const REF_ASSETS = "$assetsRef";
13
- declare const REF_LOCALES = "$locales";
14
- declare const REF_VALIDATES = "$validations";
15
- declare const STYLE_WEB_NAME = "styleWeb";
16
- declare const STYLE_RN_NAME = "styleRN";
17
- declare const REDUX_GET_FUNCTION = "get";
18
- declare const REDUX_SET_FUNCTION = "set";
19
- declare const REDUX_FUNCTIONS: string[];
20
- declare const PATHNAME = "path";
21
- declare const SIMPLE_DATA_TYPES: string[];
22
- declare const V_CHILDREN_NAME = "$children";
23
- declare const V_COMP_NAME = "$comp";
62
+ declare const MODIFIER_KEY = "$modifier";
63
+ declare const PATH_MODIFIERS_KEY = "$pathModifiers";
24
64
  declare const LIST_SEMAPHORE = "$isList";
25
65
  declare const LIST_ITEM = "$listItem";
66
+ /** Main JsonUI list pagination keys (parity). */
26
67
  declare const LIST_PAGE = "$page";
27
68
  declare const LIST_ITEM_PER_PAGE = "$itemPerPage";
28
69
  declare const LIST_LENGTH = "$listLength";
29
- declare const LIST_ITEM_PER_PAGE_DEFAULT = 10;
30
- declare const REDUX_PATHS = "$$reduxPaths";
31
- declare const V_CHILDREN_PREFIX = "$child";
32
- declare const PARENT_PROP_NAME = "__parentprop";
33
- declare const CURRENT_PATH_NAME = "__currentPaths";
34
- declare const REDUX_GET_SUBSCRIBERS_NAME = "__subscriberPaths";
35
- declare const UNDEFINED_COMP_NAME = "_Undefined";
36
- declare const PRIMITIVE_COMP_NAME = "_PrimitiveProp";
37
- declare const FRAGMENT_COMP_NAME = "Fragment";
70
+ /** Field-level inline validation spec key on a node. */
71
+ declare const V_VALIDATIONS = "$validations";
72
+ declare const ERROR_STORE_SUFFIX = ".error";
73
+ /** Shadow store for field touched state (aligned with main JsonUI `.touch`). */
74
+ declare const TOUCH_STORE_SUFFIX = ".touch";
38
75
 
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 {
72
- export {
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,
105
- };
106
- }
76
+ /**
77
+ * JSON UI type definitions (framework-agnostic).
78
+ */
107
79
 
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;
113
- interface PathModifierType {
80
+ type JsonUIValue = string | number | boolean | null | JsonUINode | JsonUIValue[];
81
+ type JSONValue = string | number | boolean | null | JSONObject | JSONValue[];
82
+ interface JSONObject {
83
+ [key: string]: JSONValue;
84
+ }
85
+ interface JsonUINode {
86
+ [key: string]: unknown;
87
+ [V_COMP]?: string;
88
+ [V_CHILDREN]?: JsonUIValue;
89
+ }
90
+ type ModifierHandler = (params: Record<string, unknown>, context: ModifierContext) => unknown | Promise<unknown>;
91
+ type ActionHandler = (params: Record<string, unknown>, context: ActionContext) => void | Promise<void>;
92
+ type TranslationsMap = Record<string, Record<string, string> | undefined>;
93
+ type PathModifier = Record<string, {
114
94
  path: string;
115
- }
116
- interface PathModifiersType {
117
- [key: string]: PathModifierType;
118
- }
119
- interface PropsType {
120
- [key: string]: PropValue;
121
- [PATH_MODIFIERS_KEY]?: PathModifiersType;
122
- }
123
- interface PathType {
124
- path: string[];
125
- level: number;
126
- }
127
- type PathsType = PathType[];
128
- interface ValidationType {
95
+ }>;
96
+ interface ModifierContext {
97
+ formStore: FormStore;
98
+ currentPath: string;
99
+ pathModifiers?: PathModifier;
100
+ validators?: unknown;
101
+ translations?: TranslationsMap;
102
+ defaultLanguage?: string;
103
+ activeLanguage?: string;
104
+ }
105
+ type ComponentActionProps = Record<string, unknown>;
106
+ interface ActionContext extends ModifierContext {
107
+ componentProps: ComponentActionProps;
108
+ validators?: ValidationRegistry;
109
+ }
110
+ type ModifierMap = Record<string, ModifierHandler | undefined>;
111
+ type ActionMap = Record<string, ActionHandler | undefined>;
112
+ /** Emitted when JsonUI unmounts or when model/defaultValues/id changes (main parity). */
113
+ interface OnStateExportProps {
114
+ id?: string;
115
+ /** Same shape as `JsonUI` `defaultValues`: logical stores `{ data: {...}, "data.touch": {...}, ... }` (no internal `storeRoot` wrapper). */
116
+ formState: JSONValue;
117
+ }
118
+ type OnStateExportType = (arg: OnStateExportProps) => void;
119
+ type StorePathDependency = {
129
120
  store: string;
130
121
  path: string;
131
- schema: any;
132
- }
133
- declare enum ReduxPathTypeEnum {
134
- ERROR = "ERROR",
135
- TOUCH = "TOUCH",
136
- NORMAL = "NORMAL"
137
- }
138
- interface ReduxPath {
139
- store?: string;
140
- path?: string;
141
- type?: ReduxPathTypeEnum;
142
- jsonataDef?: string;
143
- }
144
- type JsonUIComponentType = React__default.FC<any> | typeof React__default.Component | ((prop: any) => number | null | undefined | string);
145
- interface JsonUIComponentsType {
146
- [key: string]: JsonUIComponentType;
147
- }
148
- type JsonUIFunctionType = (attr: any, props: any, callerArgs: any, stock: any) => void | any;
149
- interface JsonUIFunctions {
150
- [key: string]: JsonUIFunctionType;
122
+ };
123
+ type ResolvedRenderNodeState = {
124
+ props: Record<string, unknown>;
125
+ resolvedSlots: Record<string, unknown>;
126
+ };
127
+ interface ValidationRule {
128
+ schema: unknown;
129
+ path: string;
130
+ store: string;
151
131
  }
132
+ /** Nested maps may be missing until first validator is registered for a path. */
133
+ type ValidationRegistry = Partial<Record<string, Partial<Record<string, ValidateFunction[]>>>>;
152
134
 
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
- }
135
+ declare const actions: ActionMap;
174
136
 
175
- interface OwnTraverse {
176
- key: string;
177
- value: PropsType;
178
- path: string[];
179
- parent: PropsType;
180
- level: number;
181
- }
182
- declare const getFilteredPath: ({ [c.PARENT_PROP_NAME]: parentComp, ...propsNew }: PropsType, func: (filterProps: OwnTraverse) => boolean) => OwnTraverse[];
183
- declare const actionBuilder: (props: PropsType, stock: InstanceType<typeof Stock>) => void;
184
- declare const calculatePropsFromModifier: (props: PropsType, stock: InstanceType<typeof Stock>) => ReduxPath[];
185
- declare const getCurrentPaths: (props: PropsType, pathModifier: PathModifiersType) => PathModifiersType;
186
- declare const normalisePrimitives: (props: PropsType, parentComp?: any) => any;
187
- declare const getRootWrapperProps: (props: PropsType, stock: InstanceType<typeof Stock>) => void;
188
- declare const isChildrenProp: (propName?: string) => boolean;
189
- declare const getParentProps: (props: PropsType) => PropsType;
190
- declare const getPropsChildrenFilter: ({ props, filter }: {
191
- props: PropsType;
192
- filter: "onlyChildren" | "withoutChildren";
193
- }) => PropsType;
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;
197
- declare const isTechnicalProp: (propName: string) => boolean;
198
- declare const removeTechnicalProps: (changeableProps: any) => any;
137
+ /**
138
+ * Expands simplified node format into full JSON UI node so components receive
139
+ * value, onChange, error, etc. without the model having to specify every binding.
140
+ *
141
+ * When a node has store + path (non-empty store, string path), we add:
142
+ * - value: { $modifier: 'get', store, path }
143
+ * - onChange: { $action: 'set', store, path }
144
+ * - error / fieldErrors: { $modifier: 'get', store: store + '.error', path }
145
+ * - fieldTouched: { $modifier: 'get', store: store + '.touch', path }
146
+ *
147
+ * The component is unchanged; RenderNode uses the expanded node for prop
148
+ * resolution and the expanded props are passed through normally.
149
+ */
199
150
 
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 {
215
- export {
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,
230
- };
231
- }
151
+ /**
152
+ * Returns an expanded node with value, onChange, error, fieldErrors, fieldTouched
153
+ * derived from store + path. Strips store and path from the result so they are
154
+ * not passed as component props.
155
+ * If the node is not simplified, returns the same node reference.
156
+ */
157
+ declare const expandSimplifiedNode: (node: JsonUINode) => JsonUINode;
232
158
 
233
- declare const findLastIndex: (arr: any[], func: any) => number;
234
- declare const drop: (arr: any[], n?: number) => 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;
239
- declare const pathArrayToPathString: (array: (string | number)[]) => string;
240
- declare const pathArrayToJsonPointer: (array: (string | number)[]) => string;
241
- declare function isOnlyObject(item: any): boolean;
242
- declare const mergePath: (target: any, newState: any) => any;
243
- declare const changeRelativePath: (path: string) => string;
244
159
  /**
245
- * Deep merge two objects.
246
- * @param target
247
- * @param ...sources
160
+ * JsonUI list pagination: maps `$page`, `$itemPerPage`, and `$listLength` to a slice of the backing list.
161
+ *
162
+ * Computes which indices belong on the current page. `page`, `itemPerPage`, and `listLength` are
163
+ * coerced to non-negative integers; invalid or missing values use defaults (`page` → 0,
164
+ * `itemPerPage` → effective list length, `listLength` → `realDataLength` when omitted).
165
+ * If `page * itemPerPage` exceeds `listLength`, offset resets to 0 (parity with reference impl).
166
+ *
167
+ * @param args.realDataLength - Actual length of the list data in memory (caps defaults).
168
+ * @param args.page - Zero-based page index from the model (`$page`).
169
+ * @param args.itemPerPage - Page size from the model (`$itemPerPage`).
170
+ * @param args.listLength - Logical list length from the model (`$listLength`); may differ from `realDataLength`.
171
+ * @returns `offset` and `end` for half-open `[offset, end)` slicing, plus `indices` listing each index in range.
172
+ * @see computeRenderNodeSlotChildren in @jsonui/react
248
173
  */
249
- declare function mergeDeep(target: any, ...sources: any): any;
250
- declare const collectObjMerge: (refConst: string, json: any) => {};
251
- declare const collectObjToArray: (refConst: string, json: any, flatten?: boolean) => any[];
252
- declare const isValidJson: (d: any) => boolean;
253
- declare const isPrimitiveValue: (value: any, emptyStringAllowed?: boolean) => boolean;
254
- declare const hasLeaf: (obj: any, emptyStringAllowed?: boolean) => boolean;
174
+ interface ComputeListSliceRangeArgs {
175
+ realDataLength: number;
176
+ page?: unknown;
177
+ itemPerPage?: unknown;
178
+ listLength?: unknown;
179
+ }
180
+ interface ComputeListSliceRangeResult {
181
+ offset: number;
182
+ end: number;
183
+ indices: number[];
184
+ }
185
+ declare const computeListSliceRange: ({ realDataLength, page: pageRaw, itemPerPage: itemPerPageRaw, listLength: listLengthRaw, }: ComputeListSliceRangeArgs) => ComputeListSliceRangeResult;
255
186
 
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 {
274
- export {
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,
292
- };
293
- }
187
+ declare const getOwnPathModifiers: (node: JsonUINode) => PathModifier | undefined;
188
+ declare const mergeEffectivePathModifiers: ({ ownPathModifiers, pathModifiers, currentPath, }: {
189
+ ownPathModifiers?: PathModifier;
190
+ pathModifiers?: PathModifier;
191
+ currentPath: string;
192
+ }) => PathModifier | undefined;
294
193
 
295
- interface I18nResources {
296
- [key: string]: {
297
- translation: {
298
- [key: string]: string;
299
- };
300
- };
301
- }
302
- interface I18nProps {
303
- language?: string;
304
- resources?: I18nResources;
305
- keyPrefix?: string;
306
- keyPostfix?: string;
307
- nonExistsHandler?: (key: string) => void;
308
- }
309
- declare class I18n {
310
- language: string;
311
- languages: string[];
312
- resources?: I18nResources;
313
- keyPrefix?: string;
314
- keyPostfix?: string;
315
- nonExistsHandler?: (key: string) => void;
316
- availableLanguageKey?: string;
317
- constructor({ language, resources, nonExistsHandler, keyPrefix, keyPostfix }: I18nProps);
318
- getLocales: () => string;
319
- t: (key: any, options?: any, language?: string | null) => any;
320
- }
194
+ /** Segment-aware path overlap check (aligned with validation.ts). */
195
+ declare const isPathPrefix: (rulePath: string, targetPath: string) => boolean;
321
196
 
322
- declare const StockContext: React$1.Context<Stock | null>;
323
- declare const PathModifierContext: React$1.Context<{}>;
197
+ /** Breakpoint keys for responsive style objects */
198
+ type BreakpointKey = 'base' | 'xs' | 'sm' | 'md' | 'lg' | 'xl';
199
+ /** Platform for style resolution */
200
+ type StylePlatform = 'web' | 'native';
201
+ /** Default breakpoint width thresholds (min-width in px) */
202
+ declare const DEFAULT_BREAKPOINTS: Record<BreakpointKey, number>;
203
+ /** Order for merging: base first, then xs..xl */
204
+ declare const BREAKPOINT_ORDER: BreakpointKey[];
324
205
 
325
- declare const compSelectorHook: (currentPaths: PathModifiersType, subscriberPaths: ReduxPath[]) => (state: any) => any[] | undefined;
206
+ interface RunRenderNodeResolutionArgs {
207
+ node: JsonUINode;
208
+ modifiers: ModifierMap;
209
+ ctx: ModifierContext;
210
+ currentPath: string;
211
+ effectivePathModifiers?: PathModifier;
212
+ stylePlatform: StylePlatform;
213
+ styleBreakpoint?: BreakpointKey;
214
+ /** Store name from the simplified component's own `store` prop, if any. */
215
+ componentStore?: string;
216
+ /** Logical path from the simplified component's own `path` prop, if any. */
217
+ componentPath?: string;
218
+ }
219
+ declare const runRenderNodeResolution: ({ node, modifiers, ctx, currentPath, effectivePathModifiers, stylePlatform, styleBreakpoint, componentStore, componentPath, }: RunRenderNodeResolutionArgs) => Promise<{
220
+ state: ResolvedRenderNodeState;
221
+ deps: StorePathDependency[];
222
+ }>;
326
223
 
327
- declare const _default: {
328
- get: JsonUIFunctionType;
329
- set: JsonUIFunctionType;
330
- jsonata: JsonUIFunctionType;
331
- };
224
+ declare const resolveAction: (value: unknown, actions: ActionMap, modifiers: ModifierMap, ctx: ActionContext) => ((e: unknown) => Promise<void>) | undefined;
225
+
226
+ declare const buildValidationRegistry: (rules?: ValidationRule[]) => ValidationRegistry;
332
227
 
333
- declare const rootReducer: redux.Reducer<{
334
- root: any;
335
- }, redux.AnyAction, Partial<{
336
- root: any;
337
- }>>;
228
+ declare const modifiers: ModifierMap;
229
+
230
+ /**
231
+ * Minimal JSON Pointer implementation (RFC 6901).
232
+ * Supports get, set, and path resolution (absolute, relative, ./ ../).
233
+ *
234
+ * Paths and nesting are unbounded: e.g. /a/b/c/0/d/e/1/f is valid;
235
+ * segments can be object keys or array indices (numeric strings).
236
+ */
237
+ /**
238
+ * Normalize a path: remove empty segments and trailing/leading slashes.
239
+ * Prevents accidental keys like "" from paths such as "//" or "/a/".
240
+ * Does not decode segments (e.g. ~1 stays so one segment is preserved).
241
+ */
242
+ declare const normalizePath: (pathStr: string) => string;
338
243
 
339
- export { I18n, PathModifierContext, ReduxPathTypeEnum, Stock, StockContext, compSelectorHook, constants, _default as stockFunctions, rootReducer as storeReducers, jsonUtils as utils, wrapperUtil };
340
- export type { ArraysType, JsonUIComponentsType, JsonUIFunctionType, JsonUIFunctions, Path, PathModifierType, PathModifiersType, PathType, PathsType, PropValue, PropsType, ReduxPath, UIDefinition, ValidationType, WrapperType };
244
+ export { ACTION_KEY, BREAKPOINT_ORDER, DEFAULT_BREAKPOINTS, ERROR_STORE_SUFFIX, FormStore, LIST_ITEM, LIST_ITEM_PER_PAGE, LIST_LENGTH, LIST_PAGE, LIST_SEMAPHORE, MODIFIER_KEY, PATH_MODIFIERS_KEY, TOUCH_STORE_SUFFIX, V_CHILDREN, V_COMP, V_VALIDATIONS, actions, buildValidationRegistry, computeListSliceRange, expandSimplifiedNode, getOwnPathModifiers, isPathPrefix, mergeEffectivePathModifiers, modifiers, normalizePath, resolveAction, resolveStorePath, runRenderNodeResolution };
245
+ export type { ActionContext, ActionHandler, ActionMap, BreakpointKey, JSONObject, JSONValue, JsonUINode, ModifierContext, ModifierHandler, ModifierMap, OnStateExportProps, OnStateExportType, PathModifier, ResolvedRenderNodeState, StorePathDependency, StylePlatform, TranslationsMap, ValidationRegistry, ValidationRule };