@jsonui/core 0.4.1 → 0.4.3
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/cjs/index.js +21 -5
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/utils/constants.d.ts +1 -0
- package/dist/cjs/types/wrapper/wrapperUtil.d.ts +2 -1
- package/dist/esm/index.js +21 -5
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/utils/constants.d.ts +1 -0
- package/dist/esm/types/wrapper/wrapperUtil.d.ts +2 -1
- package/dist/index.d.ts +9 -3
- package/package.json +2 -2
|
@@ -27,5 +27,6 @@ export declare const REDUX_PATHS = "$$reduxPaths";
|
|
|
27
27
|
export declare const V_CHILDREN_PREFIX = "$child";
|
|
28
28
|
export declare const PARENT_PROP_NAME = "__parentprop";
|
|
29
29
|
export declare const CURRENT_PATH_NAME = "__currentPaths";
|
|
30
|
+
export declare const UNDEFINED_COMP_NAME = "_Undefined";
|
|
30
31
|
export declare const PRIMITIVE_COMP_NAME = "_PrimitiveProp";
|
|
31
32
|
export declare const FRAGMENT_COMP_NAME = "Fragment";
|
|
@@ -18,7 +18,7 @@ export declare const getRootWrapperProps: (props: PropsType, stock: InstanceType
|
|
|
18
18
|
[x: string]: import("../utils/types").PropValue;
|
|
19
19
|
$pathModifiers?: PathModifiersType | undefined;
|
|
20
20
|
};
|
|
21
|
-
export declare const
|
|
21
|
+
export declare const isChildrenProp: (propName?: string | undefined) => boolean;
|
|
22
22
|
export declare const getParentProps: (props: PropsType) => PropsType;
|
|
23
23
|
export declare const getPropsChildrenFilter: ({ props, filter }: {
|
|
24
24
|
props: PropsType;
|
|
@@ -27,5 +27,6 @@ export declare const getPropsChildrenFilter: ({ props, filter }: {
|
|
|
27
27
|
export declare const getChildrensForRoot: (props: PropsType, children: any, Wrapper: WrapperType) => JSX.Element | JSX.Element[] | undefined;
|
|
28
28
|
export declare const generateChildren: (props: PropsType, { Wrapper }: InstanceType<typeof Stock>) => import("../utils/types").PropValue | JSX.Element;
|
|
29
29
|
export declare const generateNewChildren: (props: PropsType, { Wrapper }: InstanceType<typeof Stock>) => JSX.Element | JSX.Element[] | undefined;
|
|
30
|
+
export declare const isTechnicalProp: (propName: string) => boolean;
|
|
30
31
|
export declare const removeTechnicalProps: (changeableProps: any) => any;
|
|
31
32
|
export {};
|
package/dist/esm/index.js
CHANGED
|
@@ -4985,9 +4985,10 @@ const REDUX_PATHS = '$$reduxPaths';
|
|
|
4985
4985
|
const V_CHILDREN_PREFIX = '$child';
|
|
4986
4986
|
const PARENT_PROP_NAME = '__parentprop';
|
|
4987
4987
|
const CURRENT_PATH_NAME = '__currentPaths';
|
|
4988
|
+
const UNDEFINED_COMP_NAME = '_Undefined';
|
|
4988
4989
|
const PRIMITIVE_COMP_NAME = '_PrimitiveProp'; // TODO check all literal and replace with this constant
|
|
4989
4990
|
const FRAGMENT_COMP_NAME = 'Fragment'; // TODO check all literal and replace with this constant
|
|
4990
|
-
var constants=/*#__PURE__*/Object.freeze({__proto__:null,SEPARATOR:SEPARATOR,STORE_ERROR_POSTFIX:STORE_ERROR_POSTFIX,PATH_MODIFIERS_KEY:PATH_MODIFIERS_KEY,MODIFIER_KEY:MODIFIER_KEY,ACTION_KEY:ACTION_KEY,PERSIST_STORAGE_KEY:PERSIST_STORAGE_KEY,PERSIST_STORAGE_NAMES:PERSIST_STORAGE_NAMES,REF_ASSETS:REF_ASSETS,REF_LOCALES:REF_LOCALES,REF_VALIDATES:REF_VALIDATES,STYLE_WEB_NAME:STYLE_WEB_NAME,STYLE_RN_NAME:STYLE_RN_NAME,REDUX_GET_FUNCTION:REDUX_GET_FUNCTION,REDUX_SET_FUNCTION:REDUX_SET_FUNCTION,REDUX_FUNCTIONS:REDUX_FUNCTIONS,PATHNAME:PATHNAME,SIMPLE_DATA_TYPES:SIMPLE_DATA_TYPES,V_CHILDREN_NAME:V_CHILDREN_NAME,V_COMP_NAME:V_COMP_NAME,LIST_SEMAPHORE:LIST_SEMAPHORE,LIST_ITEM:LIST_ITEM,LIST_PAGE:LIST_PAGE,LIST_ITEM_PER_PAGE:LIST_ITEM_PER_PAGE,LIST_LENGTH:LIST_LENGTH,LIST_ITEM_PER_PAGE_DEFAULT:LIST_ITEM_PER_PAGE_DEFAULT,REDUX_PATHS:REDUX_PATHS,V_CHILDREN_PREFIX:V_CHILDREN_PREFIX,PARENT_PROP_NAME:PARENT_PROP_NAME,CURRENT_PATH_NAME:CURRENT_PATH_NAME,PRIMITIVE_COMP_NAME:PRIMITIVE_COMP_NAME,FRAGMENT_COMP_NAME:FRAGMENT_COMP_NAME});var jsonpointer = {};var hasExcape = /~/;
|
|
4991
|
+
var constants=/*#__PURE__*/Object.freeze({__proto__:null,SEPARATOR:SEPARATOR,STORE_ERROR_POSTFIX:STORE_ERROR_POSTFIX,PATH_MODIFIERS_KEY:PATH_MODIFIERS_KEY,MODIFIER_KEY:MODIFIER_KEY,ACTION_KEY:ACTION_KEY,PERSIST_STORAGE_KEY:PERSIST_STORAGE_KEY,PERSIST_STORAGE_NAMES:PERSIST_STORAGE_NAMES,REF_ASSETS:REF_ASSETS,REF_LOCALES:REF_LOCALES,REF_VALIDATES:REF_VALIDATES,STYLE_WEB_NAME:STYLE_WEB_NAME,STYLE_RN_NAME:STYLE_RN_NAME,REDUX_GET_FUNCTION:REDUX_GET_FUNCTION,REDUX_SET_FUNCTION:REDUX_SET_FUNCTION,REDUX_FUNCTIONS:REDUX_FUNCTIONS,PATHNAME:PATHNAME,SIMPLE_DATA_TYPES:SIMPLE_DATA_TYPES,V_CHILDREN_NAME:V_CHILDREN_NAME,V_COMP_NAME:V_COMP_NAME,LIST_SEMAPHORE:LIST_SEMAPHORE,LIST_ITEM:LIST_ITEM,LIST_PAGE:LIST_PAGE,LIST_ITEM_PER_PAGE:LIST_ITEM_PER_PAGE,LIST_LENGTH:LIST_LENGTH,LIST_ITEM_PER_PAGE_DEFAULT:LIST_ITEM_PER_PAGE_DEFAULT,REDUX_PATHS:REDUX_PATHS,V_CHILDREN_PREFIX:V_CHILDREN_PREFIX,PARENT_PROP_NAME:PARENT_PROP_NAME,CURRENT_PATH_NAME:CURRENT_PATH_NAME,UNDEFINED_COMP_NAME:UNDEFINED_COMP_NAME,PRIMITIVE_COMP_NAME:PRIMITIVE_COMP_NAME,FRAGMENT_COMP_NAME:FRAGMENT_COMP_NAME});var jsonpointer = {};var hasExcape = /~/;
|
|
4991
4992
|
var escapeMatcher = /~[01]/g;
|
|
4992
4993
|
function escapeReplacer (m) {
|
|
4993
4994
|
switch (m) {
|
|
@@ -6843,11 +6844,11 @@ const getRootWrapperProps = (props, stock) => {
|
|
|
6843
6844
|
newProps.subscriberPaths = subscriberPaths;
|
|
6844
6845
|
return newProps;
|
|
6845
6846
|
};
|
|
6846
|
-
const
|
|
6847
|
+
const isChildrenProp = (propName) => !!propName && typeof propName === 'string' && propName.startsWith(V_CHILDREN_PREFIX);
|
|
6847
6848
|
const getParentProps = (props) => {
|
|
6848
6849
|
return props && typeof props === 'object' && !Array.isArray(props)
|
|
6849
6850
|
? Object.keys(props)
|
|
6850
|
-
.filter((key) => !
|
|
6851
|
+
.filter((key) => !isChildrenProp(key) && key !== PARENT_PROP_NAME)
|
|
6851
6852
|
.reduce((newObj, key) => {
|
|
6852
6853
|
// eslint-disable-next-line no-param-reassign
|
|
6853
6854
|
newObj[key] = props[key];
|
|
@@ -6857,7 +6858,7 @@ const getParentProps = (props) => {
|
|
|
6857
6858
|
};
|
|
6858
6859
|
const getPropsChildrenFilter = ({ props, filter }) => props && typeof props === 'object' && !Array.isArray(props)
|
|
6859
6860
|
? Object.keys(props)
|
|
6860
|
-
.filter((key) => ((filter === 'withoutChildren' && !
|
|
6861
|
+
.filter((key) => ((filter === 'withoutChildren' && !isChildrenProp(key)) || (filter === 'onlyChildren' && isChildrenProp(key))) && key !== PARENT_PROP_NAME)
|
|
6861
6862
|
.reduce((newObj, key) => {
|
|
6862
6863
|
// eslint-disable-next-line no-param-reassign
|
|
6863
6864
|
newObj[key] = props[key];
|
|
@@ -6891,10 +6892,25 @@ const generateNewChildren = (props, { Wrapper }) => {
|
|
|
6891
6892
|
}
|
|
6892
6893
|
return undefined;
|
|
6893
6894
|
};
|
|
6895
|
+
const isTechnicalProp = (propName) => [
|
|
6896
|
+
PARENT_PROP_NAME,
|
|
6897
|
+
STYLE_WEB_NAME,
|
|
6898
|
+
V_COMP_NAME,
|
|
6899
|
+
PATH_MODIFIERS_KEY,
|
|
6900
|
+
CURRENT_PATH_NAME,
|
|
6901
|
+
PATH_MODIFIERS_KEY,
|
|
6902
|
+
LIST_SEMAPHORE,
|
|
6903
|
+
LIST_ITEM,
|
|
6904
|
+
LIST_PAGE,
|
|
6905
|
+
LIST_ITEM_PER_PAGE,
|
|
6906
|
+
LIST_LENGTH,
|
|
6907
|
+
'style',
|
|
6908
|
+
'subscriberPaths',
|
|
6909
|
+
].includes(propName);
|
|
6894
6910
|
const removeTechnicalProps = (changeableProps) => {
|
|
6895
6911
|
const _a = changeableProps, _b = PARENT_PROP_NAME; _a[_b]; const _c = STYLE_WEB_NAME; _a[_c]; const _d = V_COMP_NAME; _a[_d]; const _e = PATH_MODIFIERS_KEY; _a[_e]; const _f = CURRENT_PATH_NAME; _a[_f]; const _g = PATH_MODIFIERS_KEY; _a[_g]; const _h = LIST_SEMAPHORE; _a[_h]; const _j = LIST_ITEM; _a[_j]; const _k = LIST_PAGE; _a[_k]; const _l = LIST_ITEM_PER_PAGE; _a[_l]; const _m = LIST_LENGTH; _a[_m]; const newProps = __rest(_a, [_b + "", "style", _c + "", _d + "", _e + "", _f + "", "subscriberPaths", _g + "", _h + "", _j + "", _k + "", _l + "", _m + ""]);
|
|
6896
6912
|
return newProps;
|
|
6897
|
-
};var wrapperUtil=/*#__PURE__*/Object.freeze({__proto__:null,getFilteredPath:getFilteredPath,actionBuilder:actionBuilder,calculatePropsFromModifier:calculatePropsFromModifier,getCurrentPaths:getCurrentPaths,normalisePrimitives:normalisePrimitives,getRootWrapperProps:getRootWrapperProps,
|
|
6913
|
+
};var wrapperUtil=/*#__PURE__*/Object.freeze({__proto__:null,getFilteredPath:getFilteredPath,actionBuilder:actionBuilder,calculatePropsFromModifier:calculatePropsFromModifier,getCurrentPaths:getCurrentPaths,normalisePrimitives:normalisePrimitives,getRootWrapperProps:getRootWrapperProps,isChildrenProp:isChildrenProp,getParentProps:getParentProps,getPropsChildrenFilter:getPropsChildrenFilter,getChildrensForRoot:getChildrensForRoot,generateChildren:generateChildren,generateNewChildren:generateNewChildren,isTechnicalProp:isTechnicalProp,removeTechnicalProps:removeTechnicalProps});var ajv = {exports: {}};var core$2 = {};var validate = {};var boolSchema = {};var errors = {};var codegen = {};var code$1 = {};(function (exports) {
|
|
6898
6914
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6899
6915
|
exports.regexpCode = exports.getEsmExportName = exports.getProperty = exports.safeStringify = exports.stringify = exports.strConcat = exports.addCodeArg = exports.str = exports._ = exports.nil = exports._Code = exports.Name = exports.IDENTIFIER = exports._CodeOrName = void 0;
|
|
6900
6916
|
class _CodeOrName {
|