@elliemae/ds-utilities 3.4.3-rc.1 → 3.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/capitalize.js +4 -1
- package/dist/cjs/capitalize.js.map +1 -1
- package/dist/cjs/compose.js +7 -2
- package/dist/cjs/compose.js.map +1 -1
- package/dist/cjs/deprecated/deprecatedMsg.js +4 -1
- package/dist/cjs/deprecated/deprecatedMsg.js.map +1 -1
- package/dist/cjs/deprecated/index.js +4 -1
- package/dist/cjs/deprecated/index.js.map +1 -1
- package/dist/cjs/deprecated/reactTypesUtility.js +4 -1
- package/dist/cjs/deprecated/reactTypesUtility.js.map +2 -2
- package/dist/cjs/deprecated/scrollingTimer.js +4 -1
- package/dist/cjs/deprecated/scrollingTimer.js.map +1 -1
- package/dist/cjs/deprecated/useParentElement.js +4 -1
- package/dist/cjs/deprecated/useParentElement.js.map +1 -1
- package/dist/cjs/deprecated/useSetRef.js +4 -1
- package/dist/cjs/deprecated/useSetRef.js.map +1 -1
- package/dist/cjs/deprecated/useUncontrolled.js +4 -1
- package/dist/cjs/deprecated/useUncontrolled.js.map +2 -2
- package/dist/cjs/deprecated/useWindowSize.js +4 -1
- package/dist/cjs/deprecated/useWindowSize.js.map +1 -1
- package/dist/cjs/getComponentFromProps.js +16 -7
- package/dist/cjs/getComponentFromProps.js.map +2 -2
- package/dist/cjs/hooks/index.js +4 -1
- package/dist/cjs/hooks/index.js.map +1 -1
- package/dist/cjs/hooks/useCallbackAfterRender.js +4 -1
- package/dist/cjs/hooks/useCallbackAfterRender.js.map +1 -1
- package/dist/cjs/hooks/useCancellableDelayedCallback.js +10 -4
- package/dist/cjs/hooks/useCancellableDelayedCallback.js.map +1 -1
- package/dist/cjs/hooks/useDerivedStateFromProps.js +4 -1
- package/dist/cjs/hooks/useDerivedStateFromProps.js.map +1 -1
- package/dist/cjs/hooks/useExecutionTimer.js +4 -1
- package/dist/cjs/hooks/useExecutionTimer.js.map +1 -1
- package/dist/cjs/hooks/useExpandState.js +4 -1
- package/dist/cjs/hooks/useExpandState.js.map +1 -1
- package/dist/cjs/hooks/useFocusTrap.js +34 -20
- package/dist/cjs/hooks/useFocusTrap.js.map +1 -1
- package/dist/cjs/hooks/useHotkeys.js +4 -1
- package/dist/cjs/hooks/useHotkeys.js.map +2 -2
- package/dist/cjs/hooks/useHoverHandlersDelay.js +4 -1
- package/dist/cjs/hooks/useHoverHandlersDelay.js.map +1 -1
- package/dist/cjs/hooks/useIsMobile.js +4 -1
- package/dist/cjs/hooks/useIsMobile.js.map +1 -1
- package/dist/cjs/hooks/useIsShowingEllipsis.js +14 -8
- package/dist/cjs/hooks/useIsShowingEllipsis.js.map +1 -1
- package/dist/cjs/hooks/useOnBlurOut.js +15 -9
- package/dist/cjs/hooks/useOnBlurOut.js.map +1 -1
- package/dist/cjs/hooks/useOnElementResize.js +11 -5
- package/dist/cjs/hooks/useOnElementResize.js.map +1 -1
- package/dist/cjs/hooks/useOnFirstFocusIn.js +35 -23
- package/dist/cjs/hooks/useOnFirstFocusIn.js.map +1 -1
- package/dist/cjs/hooks/useOnSpecificFocus.js +15 -7
- package/dist/cjs/hooks/useOnSpecificFocus.js.map +1 -1
- package/dist/cjs/hooks/usePrevious.js +4 -1
- package/dist/cjs/hooks/usePrevious.js.map +1 -1
- package/dist/cjs/hooks/useResizeObserver.js +23 -12
- package/dist/cjs/hooks/useResizeObserver.js.map +2 -2
- package/dist/cjs/hooks/useShouldRecalculate.js +4 -1
- package/dist/cjs/hooks/useShouldRecalculate.js.map +1 -1
- package/dist/cjs/hooks/useWindowScrollerList.js +20 -14
- package/dist/cjs/hooks/useWindowScrollerList.js.map +1 -1
- package/dist/cjs/index.js +4 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/objectUtilities.js +4 -1
- package/dist/cjs/objectUtilities.js.map +1 -1
- package/dist/cjs/onClickHandlerForNonInteractiveElements.js +4 -1
- package/dist/cjs/onClickHandlerForNonInteractiveElements.js.map +1 -1
- package/dist/cjs/operators.js +4 -1
- package/dist/cjs/operators.js.map +1 -1
- package/dist/cjs/platform.js +4 -1
- package/dist/cjs/platform.js.map +1 -1
- package/dist/cjs/props-helpers/defaultProps/index.js +4 -1
- package/dist/cjs/props-helpers/defaultProps/index.js.map +1 -1
- package/dist/cjs/props-helpers/defaultProps/useMemoMergePropsWithDefault.js +4 -1
- package/dist/cjs/props-helpers/defaultProps/useMemoMergePropsWithDefault.js.map +2 -2
- package/dist/cjs/props-helpers/getProps/index.js +4 -1
- package/dist/cjs/props-helpers/getProps/index.js.map +1 -1
- package/dist/cjs/props-helpers/globalProps/constants.js +7 -2
- package/dist/cjs/props-helpers/globalProps/constants.js.map +1 -1
- package/dist/cjs/props-helpers/globalProps/getGlobalAttributes.js +4 -1
- package/dist/cjs/props-helpers/globalProps/getGlobalAttributes.js.map +1 -1
- package/dist/cjs/props-helpers/globalProps/globalAttributesPropTypes.js +4 -1
- package/dist/cjs/props-helpers/globalProps/globalAttributesPropTypes.js.map +1 -1
- package/dist/cjs/props-helpers/globalProps/index.js +4 -1
- package/dist/cjs/props-helpers/globalProps/index.js.map +1 -1
- package/dist/cjs/props-helpers/globalProps/useGetGlobalAttributes.js +8 -2
- package/dist/cjs/props-helpers/globalProps/useGetGlobalAttributes.js.map +1 -1
- package/dist/cjs/props-helpers/index.js +4 -1
- package/dist/cjs/props-helpers/index.js.map +1 -1
- package/dist/cjs/props-helpers/propTypes/PropTypes.js +4 -1
- package/dist/cjs/props-helpers/propTypes/PropTypes.js.map +1 -1
- package/dist/cjs/props-helpers/propTypes/customPropTypes.js +4 -1
- package/dist/cjs/props-helpers/propTypes/customPropTypes.js.map +1 -1
- package/dist/cjs/props-helpers/propTypes/describe.js +4 -1
- package/dist/cjs/props-helpers/propTypes/describe.js.map +2 -2
- package/dist/cjs/props-helpers/propTypes/describeConversions.js +17 -4
- package/dist/cjs/props-helpers/propTypes/describeConversions.js.map +2 -2
- package/dist/cjs/props-helpers/propTypes/describeGuards.js +4 -1
- package/dist/cjs/props-helpers/propTypes/describeGuards.js.map +1 -1
- package/dist/cjs/props-helpers/propTypes/index.js +4 -1
- package/dist/cjs/props-helpers/propTypes/index.js.map +2 -2
- package/dist/cjs/props-helpers/propTypes/toTypescript.js +4 -1
- package/dist/cjs/props-helpers/propTypes/toTypescript.js.map +1 -1
- package/dist/cjs/props-helpers/propTypes/types.js +4 -1
- package/dist/cjs/props-helpers/propTypes/types.js.map +1 -1
- package/dist/cjs/props-helpers/tests/globalProps/TestComponent.js +9 -4
- package/dist/cjs/props-helpers/tests/globalProps/TestComponent.js.map +1 -1
- package/dist/cjs/props-helpers/tests/validation/test.schema.js +4 -1
- package/dist/cjs/props-helpers/tests/validation/test.schema.js.map +1 -1
- package/dist/cjs/props-helpers/tests/xstyledProps/TestComponent.js +9 -4
- package/dist/cjs/props-helpers/tests/xstyledProps/TestComponent.js.map +1 -1
- package/dist/cjs/props-helpers/useDeprecateComponent/index.js +4 -1
- package/dist/cjs/props-helpers/useDeprecateComponent/index.js.map +1 -1
- package/dist/cjs/props-helpers/validation/errorTemplates.js +12 -5
- package/dist/cjs/props-helpers/validation/errorTemplates.js.map +1 -1
- package/dist/cjs/props-helpers/validation/index.js +4 -1
- package/dist/cjs/props-helpers/validation/index.js.map +1 -1
- package/dist/cjs/props-helpers/validation/typescriptGuards.js +4 -1
- package/dist/cjs/props-helpers/validation/typescriptGuards.js.map +1 -1
- package/dist/cjs/props-helpers/validation/typescriptParsers.js +4 -1
- package/dist/cjs/props-helpers/validation/typescriptParsers.js.map +1 -1
- package/dist/cjs/props-helpers/validation/typescriptValidator.js +20 -3
- package/dist/cjs/props-helpers/validation/typescriptValidator.js.map +1 -1
- package/dist/cjs/props-helpers/xstyledProps/constants.js +7 -2
- package/dist/cjs/props-helpers/xstyledProps/constants.js.map +1 -1
- package/dist/cjs/props-helpers/xstyledProps/index.js +4 -1
- package/dist/cjs/props-helpers/xstyledProps/index.js.map +1 -1
- package/dist/cjs/props-helpers/xstyledProps/useGetXstyledProps.js +4 -1
- package/dist/cjs/props-helpers/xstyledProps/useGetXstyledProps.js.map +1 -1
- package/dist/cjs/props-helpers/xstyledProps/xstyledPropTypes.js +4 -1
- package/dist/cjs/props-helpers/xstyledProps/xstyledPropTypes.js.map +1 -1
- package/dist/cjs/reactTypesUtility.js +4 -1
- package/dist/cjs/reactTypesUtility.js.map +2 -2
- package/dist/cjs/system.js +4 -1
- package/dist/cjs/system.js.map +1 -1
- package/dist/cjs/timeUtils.js +4 -1
- package/dist/cjs/timeUtils.js.map +1 -1
- package/dist/cjs/utils.js +4 -1
- package/dist/cjs/utils.js.map +1 -1
- package/dist/cjs/validations.js +4 -1
- package/dist/cjs/validations.js.map +1 -1
- package/dist/esm/capitalize.js.map +1 -1
- package/dist/esm/compose.js +3 -1
- package/dist/esm/compose.js.map +1 -1
- package/dist/esm/deprecated/deprecatedMsg.js.map +1 -1
- package/dist/esm/deprecated/index.js.map +1 -1
- package/dist/esm/deprecated/reactTypesUtility.js.map +2 -2
- package/dist/esm/deprecated/scrollingTimer.js.map +1 -1
- package/dist/esm/deprecated/useParentElement.js.map +1 -1
- package/dist/esm/deprecated/useSetRef.js.map +1 -1
- package/dist/esm/deprecated/useUncontrolled.js.map +1 -1
- package/dist/esm/deprecated/useWindowSize.js.map +1 -1
- package/dist/esm/getComponentFromProps.js +12 -6
- package/dist/esm/getComponentFromProps.js.map +2 -2
- package/dist/esm/hooks/index.js.map +2 -2
- package/dist/esm/hooks/useCallbackAfterRender.js.map +1 -1
- package/dist/esm/hooks/useCancellableDelayedCallback.js +6 -3
- package/dist/esm/hooks/useCancellableDelayedCallback.js.map +1 -1
- package/dist/esm/hooks/useDerivedStateFromProps.js.map +1 -1
- package/dist/esm/hooks/useExecutionTimer.js.map +1 -1
- package/dist/esm/hooks/useExpandState.js.map +1 -1
- package/dist/esm/hooks/useFocusTrap.js +30 -19
- package/dist/esm/hooks/useFocusTrap.js.map +1 -1
- package/dist/esm/hooks/useHotkeys.js.map +1 -1
- package/dist/esm/hooks/useHoverHandlersDelay.js.map +1 -1
- package/dist/esm/hooks/useIsMobile.js.map +1 -1
- package/dist/esm/hooks/useIsShowingEllipsis.js +10 -7
- package/dist/esm/hooks/useIsShowingEllipsis.js.map +1 -1
- package/dist/esm/hooks/useOnBlurOut.js +11 -8
- package/dist/esm/hooks/useOnBlurOut.js.map +1 -1
- package/dist/esm/hooks/useOnElementResize.js +7 -4
- package/dist/esm/hooks/useOnElementResize.js.map +1 -1
- package/dist/esm/hooks/useOnFirstFocusIn.js +31 -22
- package/dist/esm/hooks/useOnFirstFocusIn.js.map +1 -1
- package/dist/esm/hooks/useOnSpecificFocus.js +11 -6
- package/dist/esm/hooks/useOnSpecificFocus.js.map +1 -1
- package/dist/esm/hooks/usePrevious.js.map +1 -1
- package/dist/esm/hooks/useResizeObserver.js +19 -11
- package/dist/esm/hooks/useResizeObserver.js.map +1 -1
- package/dist/esm/hooks/useShouldRecalculate.js.map +1 -1
- package/dist/esm/hooks/useWindowScrollerList.js +16 -13
- package/dist/esm/hooks/useWindowScrollerList.js.map +1 -1
- package/dist/esm/index.js.map +2 -2
- package/dist/esm/objectUtilities.js.map +1 -1
- package/dist/esm/onClickHandlerForNonInteractiveElements.js.map +1 -1
- package/dist/esm/operators.js.map +1 -1
- package/dist/esm/platform.js.map +1 -1
- package/dist/esm/props-helpers/defaultProps/index.js.map +1 -1
- package/dist/esm/props-helpers/defaultProps/useMemoMergePropsWithDefault.js.map +1 -1
- package/dist/esm/props-helpers/getProps/index.js.map +1 -1
- package/dist/esm/props-helpers/globalProps/constants.js +3 -1
- package/dist/esm/props-helpers/globalProps/constants.js.map +1 -1
- package/dist/esm/props-helpers/globalProps/getGlobalAttributes.js.map +1 -1
- package/dist/esm/props-helpers/globalProps/globalAttributesPropTypes.js.map +1 -1
- package/dist/esm/props-helpers/globalProps/index.js.map +1 -1
- package/dist/esm/props-helpers/globalProps/useGetGlobalAttributes.js +4 -1
- package/dist/esm/props-helpers/globalProps/useGetGlobalAttributes.js.map +1 -1
- package/dist/esm/props-helpers/index.js.map +1 -1
- package/dist/esm/props-helpers/propTypes/PropTypes.js.map +1 -1
- package/dist/esm/props-helpers/propTypes/customPropTypes.js.map +1 -1
- package/dist/esm/props-helpers/propTypes/describe.js.map +1 -1
- package/dist/esm/props-helpers/propTypes/describeConversions.js +13 -3
- package/dist/esm/props-helpers/propTypes/describeConversions.js.map +1 -1
- package/dist/esm/props-helpers/propTypes/describeGuards.js.map +1 -1
- package/dist/esm/props-helpers/propTypes/index.js.map +1 -1
- package/dist/esm/props-helpers/propTypes/toTypescript.js.map +1 -1
- package/dist/esm/props-helpers/propTypes/types.js.map +1 -1
- package/dist/esm/props-helpers/tests/globalProps/TestComponent.js +5 -3
- package/dist/esm/props-helpers/tests/globalProps/TestComponent.js.map +2 -2
- package/dist/esm/props-helpers/tests/validation/test.schema.js.map +1 -1
- package/dist/esm/props-helpers/tests/xstyledProps/TestComponent.js +5 -3
- package/dist/esm/props-helpers/tests/xstyledProps/TestComponent.js.map +2 -2
- package/dist/esm/props-helpers/useDeprecateComponent/index.js.map +1 -1
- package/dist/esm/props-helpers/validation/errorTemplates.js +8 -4
- package/dist/esm/props-helpers/validation/errorTemplates.js.map +1 -1
- package/dist/esm/props-helpers/validation/index.js.map +1 -1
- package/dist/esm/props-helpers/validation/typescriptGuards.js.map +1 -1
- package/dist/esm/props-helpers/validation/typescriptParsers.js.map +1 -1
- package/dist/esm/props-helpers/validation/typescriptValidator.js +16 -2
- package/dist/esm/props-helpers/validation/typescriptValidator.js.map +1 -1
- package/dist/esm/props-helpers/xstyledProps/constants.js +3 -1
- package/dist/esm/props-helpers/xstyledProps/constants.js.map +1 -1
- package/dist/esm/props-helpers/xstyledProps/index.js.map +1 -1
- package/dist/esm/props-helpers/xstyledProps/useGetXstyledProps.js.map +1 -1
- package/dist/esm/props-helpers/xstyledProps/xstyledPropTypes.js.map +1 -1
- package/dist/esm/reactTypesUtility.js.map +2 -2
- package/dist/esm/system.js.map +1 -1
- package/dist/esm/timeUtils.js.map +1 -1
- package/dist/esm/utils.js.map +1 -1
- package/dist/esm/validations.js.map +1 -1
- package/package.json +2 -2
|
@@ -17,7 +17,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
17
17
|
}
|
|
18
18
|
return to;
|
|
19
19
|
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
|
+
mod
|
|
23
|
+
));
|
|
21
24
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
22
25
|
var describeConversions_exports = {};
|
|
23
26
|
__export(describeConversions_exports, {
|
|
@@ -39,7 +42,11 @@ ${message}`;
|
|
|
39
42
|
}
|
|
40
43
|
return propType(props, propName, componentName, ...rest);
|
|
41
44
|
};
|
|
42
|
-
Object.defineProperty(
|
|
45
|
+
Object.defineProperty(
|
|
46
|
+
func,
|
|
47
|
+
"isRequired",
|
|
48
|
+
Object.getOwnPropertyDescriptor(propType, "isRequired")
|
|
49
|
+
);
|
|
43
50
|
return func;
|
|
44
51
|
};
|
|
45
52
|
const convertArray = (array) => array.map((type) => convertPropType(type));
|
|
@@ -55,7 +62,10 @@ const convertPropType = (propType) => {
|
|
|
55
62
|
throw new Error(`react-desc: unknown error -- proptype is not well defined`);
|
|
56
63
|
}
|
|
57
64
|
if (propType.type === "tuple") {
|
|
58
|
-
return enrichPropType(
|
|
65
|
+
return enrichPropType(
|
|
66
|
+
import_prop_types.default.arrayOf((0, import_customPropTypes.tupleValidator)(convertArray(propType.args))),
|
|
67
|
+
propType.reactDesc
|
|
68
|
+
);
|
|
59
69
|
}
|
|
60
70
|
const realPropType = import_prop_types.default[propType.type];
|
|
61
71
|
if (!realPropType) {
|
|
@@ -69,7 +79,10 @@ const convertPropType = (propType) => {
|
|
|
69
79
|
return enrichPropType(realPropType(convertPropType(propType.args)), propType.reactDesc);
|
|
70
80
|
}
|
|
71
81
|
if ((0, import_describeGuards.isShape)(propType, realPropType)) {
|
|
72
|
-
return enrichPropType(
|
|
82
|
+
return enrichPropType(
|
|
83
|
+
realPropType(convertShape(propType.args)),
|
|
84
|
+
propType.reactDesc
|
|
85
|
+
);
|
|
73
86
|
}
|
|
74
87
|
if ((0, import_describeGuards.isInstanceOf)(propType, realPropType)) {
|
|
75
88
|
return enrichPropType(realPropType(propType.args), propType.reactDesc);
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/props-helpers/propTypes/describeConversions.ts", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
4
|
"sourcesContent": ["/* eslint-disable max-statements */\n/* eslint-disable complexity */\n/* eslint-disable max-params */\n/* eslint-disable no-console */\n/* eslint-disable @typescript-eslint/no-use-before-define */\nimport PropTypes, { ValidationMap, Requireable } from 'prop-types';\nimport { tupleValidator } from './customPropTypes';\nimport {\n hasArguments,\n isArrayOf,\n isExact,\n isInstanceOf,\n isObjectOf,\n isOneOf,\n isOneOfType,\n isShape,\n} from './describeGuards';\nimport { ReactDescT, ReactDescObjT, InstanceOfT, OneOfT, ObjectOfT, ExactT } from './types';\n\nconst enrichPropType = (propType: Requireable<unknown>, reactDesc: ReactDescObjT): Requireable<unknown> => {\n const func = (props: Record<string, unknown>, propName: string, componentName: string, ...rest: [string, string]) => {\n if (reactDesc && reactDesc.deprecated && propName in props && !reactDesc.warned) {\n const { version = '', message = '' } = reactDesc.deprecated;\n const error = `Warning: \"${propName}\" property of \"${componentName}\" will be deprecated in version: ${version}.\\n${message}`;\n console.warn(error);\n reactDesc.warned = true;\n }\n return propType(props, propName, componentName, ...rest);\n };\n Object.defineProperty(\n func,\n 'isRequired',\n Object.getOwnPropertyDescriptor(propType, 'isRequired') as PropertyDescriptor,\n );\n return func as Requireable<unknown>;\n};\n\nconst convertArray = (array: ReactDescT[]): Requireable<unknown>[] => array.map((type) => convertPropType(type));\n\nconst convertShape = (_shape: Record<string, ReactDescT>): ValidationMap<Record<string, unknown>> => {\n const result: ValidationMap<Record<string, unknown>> = {};\n Object.keys(_shape).forEach((key) => {\n result[key] = convertPropType(_shape[key]);\n });\n return result;\n};\n\nexport const convertPropType = (propType: ReactDescT): Requireable<unknown> => {\n if (!propType || !propType.type) {\n throw new Error(`react-desc: unknown error -- proptype is not well defined`);\n }\n\n // DimSum PropTypes conversion\n if (propType.type === 'tuple') {\n return enrichPropType(\n PropTypes.arrayOf(tupleValidator(convertArray(propType.args as ReactDescT[]))),\n propType.reactDesc,\n );\n }\n\n // Default PropType conversion\n const realPropType = PropTypes[propType.type];\n\n if (!realPropType) {\n throw new Error(`react-desc: unknown type ${propType.type}`);\n }\n\n if (hasArguments(propType, realPropType)) {\n if (isOneOfType(propType, realPropType)) {\n return enrichPropType(realPropType(convertArray(propType.args as ReactDescT[])), propType.reactDesc);\n }\n if (isArrayOf(propType, realPropType)) {\n return enrichPropType(realPropType(convertPropType(propType.args as ReactDescT)), propType.reactDesc);\n }\n if (isShape(propType, realPropType)) {\n return enrichPropType(\n realPropType(convertShape(propType.args as Record<string, ReactDescT>)),\n propType.reactDesc,\n );\n }\n if (isInstanceOf(propType, realPropType)) {\n return enrichPropType(realPropType(propType.args as Parameters<InstanceOfT>[0]), propType.reactDesc);\n }\n if (isOneOf(propType, realPropType)) {\n return enrichPropType(realPropType(propType.args as Parameters<OneOfT>[0]), propType.reactDesc);\n }\n if (isObjectOf(propType, realPropType)) {\n return enrichPropType(realPropType(propType.args as Parameters<ObjectOfT>[0]), propType.reactDesc);\n }\n if (isExact(propType, realPropType)) {\n return enrichPropType(realPropType(propType.args as Parameters<ExactT>[0]), propType.reactDesc);\n }\n throw new Error(`react-desc: unknown error -- proptype with args is not matching`);\n }\n\n return enrichPropType(realPropType, propType.reactDesc);\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": "
|
|
6
|
-
"names": []
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADKvB,wBAAsD;AACtD,6BAA+B;AAC/B,4BASO;AAGP,MAAM,iBAAiB,CAAC,UAAgC,cAAmD;AACzG,QAAM,OAAO,CAAC,OAAgC,UAAkB,kBAA0B,SAA2B;AACnH,QAAI,aAAa,UAAU,cAAc,YAAY,SAAS,CAAC,UAAU,QAAQ;AAC/E,YAAM,EAAE,UAAU,IAAI,UAAU,GAAG,IAAI,UAAU;AACjD,YAAM,QAAQ,aAAa,0BAA0B,iDAAiD;AAAA,EAAa;AACnH,cAAQ,KAAK,KAAK;AAClB,gBAAU,SAAS;AAAA,IACrB;AACA,WAAO,SAAS,OAAO,UAAU,eAAe,GAAG,IAAI;AAAA,EACzD;AACA,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA,OAAO,yBAAyB,UAAU,YAAY;AAAA,EACxD;AACA,SAAO;AACT;AAEA,MAAM,eAAe,CAAC,UAAgD,MAAM,IAAI,CAAC,SAAS,gBAAgB,IAAI,CAAC;AAE/G,MAAM,eAAe,CAAC,WAA+E;AACnG,QAAM,SAAiD,CAAC;AACxD,SAAO,KAAK,MAAM,EAAE,QAAQ,CAAC,QAAQ;AACnC,WAAO,OAAO,gBAAgB,OAAO,IAAI;AAAA,EAC3C,CAAC;AACD,SAAO;AACT;AAEO,MAAM,kBAAkB,CAAC,aAA+C;AAC7E,MAAI,CAAC,YAAY,CAAC,SAAS,MAAM;AAC/B,UAAM,IAAI,MAAM,2DAA2D;AAAA,EAC7E;AAGA,MAAI,SAAS,SAAS,SAAS;AAC7B,WAAO;AAAA,MACL,kBAAAA,QAAU,YAAQ,uCAAe,aAAa,SAAS,IAAoB,CAAC,CAAC;AAAA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ode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
|
+
mod
|
|
23
|
+
));
|
|
21
24
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
22
25
|
var describeGuards_exports = {};
|
|
23
26
|
__export(describeGuards_exports, {
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/props-helpers/propTypes/describeGuards.ts", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
4
|
"sourcesContent": ["import {\n AllPropTypes,\n ArrayOfT,\n ExactT,\n InstanceOfT,\n ObjectOfT,\n OneOfT,\n OneOfTypeT,\n ParametizedPropTypes,\n ReactDescT,\n ShapeT,\n} from './types';\n\nexport const hasArguments = (propType: ReactDescT, realPropType: AllPropTypes): realPropType is ParametizedPropTypes =>\n !!propType.args;\n\nexport const isOneOfType = (propType: ReactDescT, realPropType: AllPropTypes): realPropType is OneOfTypeT =>\n propType.type === 'oneOfType';\n\nexport const isArrayOf = (propType: ReactDescT, realPropType: AllPropTypes): realPropType is ArrayOfT =>\n propType.type === 'arrayOf';\n\nexport const isShape = (propType: ReactDescT, realPropType: AllPropTypes): realPropType is ShapeT =>\n propType.type === 'shape';\n\nexport const isInstanceOf = (propType: ReactDescT, realPropType: AllPropTypes): realPropType is InstanceOfT =>\n propType.type === 'instanceOf';\n\nexport const isOneOf = (propType: ReactDescT, realPropType: AllPropTypes): realPropType is OneOfT =>\n propType.type === 'oneOf';\n\nexport const isObjectOf = (propType: ReactDescT, realPropType: AllPropTypes): realPropType is ObjectOfT =>\n propType.type === 'objectOf';\n\nexport const isExact = (propType: ReactDescT, realPropType: AllPropTypes): realPropType is ExactT =>\n propType.type === 'exact';\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADahB,MAAM,eAAe,CAAC,UAAsB,iBACjD,CAAC,CAAC,SAAS;AAEN,MAAM,cAAc,CAAC,UAAsB,iBAChD,SAAS,SAAS;AAEb,MAAM,YAAY,CAAC,UAAsB,iBAC9C,SAAS,SAAS;AAEb,MAAM,UAAU,CAAC,UAAsB,iBAC5C,SAAS,SAAS;AAEb,MAAM,eAAe,CAAC,UAAsB,iBACjD,SAAS,SAAS;AAEb,MAAM,UAAU,CAAC,UAAsB,iBAC5C,SAAS,SAAS;AAEb,MAAM,aAAa,CAAC,UAAsB,iBAC/C,SAAS,SAAS;AAEb,MAAM,UAAU,CAAC,UAAsB,iBAC5C,SAAS,SAAS;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -17,7 +17,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
17
17
|
}
|
|
18
18
|
return to;
|
|
19
19
|
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
|
+
mod
|
|
23
|
+
));
|
|
21
24
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
22
25
|
var propTypes_exports = {};
|
|
23
26
|
__export(propTypes_exports, {
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/props-helpers/propTypes/index.ts", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
4
|
"sourcesContent": ["import PropTypes from './PropTypes';\nimport describe from './describe';\n\nexport { describe, PropTypes };\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": "
|
|
6
|
-
"names": []
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA,oCAAAA;AAAA,EAAA,gCAAAC;AAAA;AAAA;ACAA,YAAuB;ADAvB,uBAAsB;AACtB,sBAAqB;",
|
|
6
|
+
"names": ["PropTypes", "describe"]
|
|
7
7
|
}
|
|
@@ -17,7 +17,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
17
17
|
}
|
|
18
18
|
return to;
|
|
19
19
|
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
|
+
mod
|
|
23
|
+
));
|
|
21
24
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
22
25
|
var toTypescript_exports = {};
|
|
23
26
|
__export(toTypescript_exports, {
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/props-helpers/propTypes/toTypescript.ts", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
4
|
"sourcesContent": ["/* eslint-disable @typescript-eslint/restrict-template-expressions */\n/* eslint-disable @typescript-eslint/no-use-before-define */\n/* eslint-disable complexity */\n/* eslint-disable react/forbid-foreign-prop-types */\nimport React from 'react';\nimport { ComponentDocumentation, Hook, ReactDescT, TypescriptDocumentation } from './types';\n\nconst arrayFormat = (array: ReactDescT[]) => array.map((propType) => propTypeFormat(propType));\n\nconst shapeFormat = (shape: Record<string, ReactDescT>) => {\n const props = Object.keys(shape).map((key) => {\n const value = shape[key];\n let valueFormat;\n if (\n value.type &&\n (value.type === 'arrayOf' || value.type === 'oneOfType' || value.type === 'oneOf') &&\n Array.isArray(value.args)\n ) {\n valueFormat = `${propTypeFormat(value)}`;\n } else if (value.type === 'shape') {\n valueFormat = `${propTypeFormat(value)}`;\n } else {\n valueFormat = propTypeFormat(value);\n }\n return `${key}${value.reactDesc && value.reactDesc.required ? '' : '?'}: ${valueFormat}`;\n });\n return `{${props.join(',')}}`;\n};\n\nconst propTypeFormat = (propType: ReactDescT | ReactDescT[], joinWith = ''): string => {\n let result;\n if (Array.isArray(propType)) {\n result = arrayFormat(propType).join(joinWith);\n } else if (typeof propType !== 'function' && propType.type) {\n switch (propType.type) {\n case 'array':\n result = 'any[]';\n break;\n case 'arrayOf':\n if ((propType.args as ReactDescT).type === 'oneOfType') {\n result = `(${propTypeFormat(propType.args as ReactDescT, ' | ')})[]`;\n } else {\n result = `${propTypeFormat(propType.args as ReactDescT, '\\n')}[]`;\n }\n break;\n case 'tuple':\n result = `[${propTypeFormat(propType.args as ReactDescT, ', ')}]`;\n break;\n case 'bool':\n result = 'boolean';\n break;\n case 'func':\n result = propType?.reactDesc?.signature ?? '((...args: any[]) => any)';\n break;\n case 'node':\n result = 'React.ReactNode';\n break;\n case 'element':\n result = 'JSX.Element';\n break;\n case 'instanceOf':\n result = 'any';\n break;\n case 'symbol':\n result = 'any';\n break;\n case 'objectOf':\n result = `{ [key: string]: ${propTypeFormat(propType.args as ReactDescT)} }`;\n break;\n case 'oneOf':\n result = (propType.args as unknown[]).map((a) => `\"${a}\"`).join(' | ');\n break;\n case 'oneOfType':\n result = `${propTypeFormat(propType.args as ReactDescT[], ' | ')}`;\n break;\n case 'shape':\n result = `${shapeFormat(propType.args as Record<string, ReactDescT>)}`;\n break;\n default:\n result = `${propType.type}`;\n break;\n }\n } else {\n result = 'any';\n }\n return result;\n};\n\nconst propTypeAsTypescript = (propType: ReactDescT, propName: string) => {\n const documentation = {\n ...propType.reactDesc,\n name: propName,\n };\n\n documentation.format = propTypeFormat(propType);\n\n return documentation;\n};\n\nexport default function descToTypescript<C, R>(\n component: React.ComponentType<C> | Hook<C, R>,\n reactDesc: ComponentDocumentation,\n) {\n if (!component) {\n throw new Error('react-desc: component is required');\n }\n\n const documentation: Partial<TypescriptDocumentation> = {\n name: component.displayName || component.name,\n ...reactDesc,\n };\n if (reactDesc) {\n delete documentation.propTypes;\n\n if (reactDesc.propTypes) {\n const propTypes: TypescriptDocumentation['properties'] = [];\n Object.keys(reactDesc.propTypes).forEach((propName) => {\n const propType = reactDesc.propTypes[propName];\n propTypes.push(propTypeAsTypescript(propType, propName));\n });\n if (propTypes.length > 0) {\n documentation.properties = propTypes;\n }\n }\n }\n return documentation as TypescriptDocumentation;\n}\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADOvB,MAAM,cAAc,CAAC,UAAwB,MAAM,IAAI,CAAC,aAAa,eAAe,QAAQ,CAAC;AAE7F,MAAM,cAAc,CAAC,UAAsC;AACzD,QAAM,QAAQ,OAAO,KAAK,KAAK,EAAE,IAAI,CAAC,QAAQ;AAC5C,UAAM,QAAQ,MAAM;AACpB,QAAI;AACJ,QACE,MAAM,SACL,MAAM,SAAS,aAAa,MAAM,SAAS,eAAe,MAAM,SAAS,YAC1E,MAAM,QAAQ,MAAM,IAAI,GACxB;AACA,oBAAc,GAAG,eAAe,KAAK;AAAA,IACvC,WAAW,MAAM,SAAS,SAAS;AACjC,oBAAc,GAAG,eAAe,KAAK;AAAA,IACvC,OAAO;AACL,oBAAc,eAAe,KAAK;AAAA,IACpC;AACA,WAAO,GAAG,MAAM,MAAM,aAAa,MAAM,UAAU,WAAW,KAAK,QAAQ;AAAA,EAC7E,CAAC;AACD,SAAO,IAAI,MAAM,KAAK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AAI,CAAC,WAAW;AACd,UAAM,IAAI,MAAM,mCAAmC;AAAA,EACrD;AAEA,QAAM,gBAAkD;AAAA,IACtD,MAAM,UAAU,eAAe,UAAU;AAAA,IACzC,GAAG;AAAA,EACL;AACA,MAAI,WAAW;AACb,WAAO,cAAc;AAErB,QAAI,UAAU,WAAW;AACvB,YAAM,YAAmD,CAAC;AAC1D,aAAO,KAAK,UAAU,SAAS,EAAE,QAAQ,CAAC,aAAa;AACrD,cAAM,WAAW,UAAU,UAAU;AACrC,kBAAU,KAAK,qBAAqB,UAAU,QAAQ,CAAC;AAAA,MACzD,CAAC;AACD,UAAI,UAAU,SAAS,GAAG;AACxB,sBAAc,aAAa;AAAA,MAC7B;AAAA,IACF;AAAA,EACF;AACA,SAAO;AACT;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -13,7 +13,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
13
13
|
}
|
|
14
14
|
return to;
|
|
15
15
|
};
|
|
16
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
16
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
17
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
18
|
+
mod
|
|
19
|
+
));
|
|
17
20
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
21
|
var types_exports = {};
|
|
19
22
|
module.exports = __toCommonJS(types_exports);
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/props-helpers/propTypes/types.ts", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
4
|
"sourcesContent": ["import {\n any,\n array,\n bool,\n func,\n number,\n object,\n string,\n node,\n element,\n symbol,\n elementType,\n instanceOf,\n oneOf,\n oneOfType,\n arrayOf,\n objectOf,\n shape,\n exact,\n ValidationMap,\n} from 'prop-types';\nimport React from 'react';\n\nexport interface ReactDescObjT {\n [key: string]: unknown;\n required?: boolean;\n deprecated?: Record<string, string>;\n description?: string;\n defaultValue?: unknown;\n format?: string;\n signature?: string;\n warned?: boolean;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n isRequiredIf?: (props: any) => boolean;\n}\n\nexport type InstanceOfT = typeof instanceOf;\nexport type OneOfT = typeof oneOf;\nexport type ObjectOfT = typeof objectOf;\nexport type ExactT = typeof exact;\nexport type OneOfTypeT = typeof oneOfType;\nexport type ArrayOfT = typeof arrayOf;\nexport type ShapeT = typeof shape;\nexport type AnyT = typeof any;\nexport type ArrayT = typeof array;\nexport type BoolT = typeof bool;\nexport type FuncT = typeof func;\nexport type NumberT = typeof number;\nexport type ObjectT = typeof object;\nexport type StringT = typeof string;\nexport type NodeT = typeof node;\nexport type ElementT = typeof element;\nexport type SymbolT = typeof symbol;\nexport type ElementTypeT = typeof elementType;\n\nexport type ParametizedPropTypes = InstanceOfT | OneOfT | ObjectOfT | ExactT | OneOfTypeT | ArrayOfT | ShapeT;\n\nexport type AllPropTypes =\n | AnyT\n | ArrayT\n | BoolT\n | FuncT\n | NumberT\n | ObjectT\n | StringT\n | NodeT\n | ElementT\n | SymbolT\n | ElementTypeT\n | ParametizedPropTypes;\n\nexport type PropTypesTypes =\n | 'any'\n | 'array'\n | 'bool'\n | 'func'\n | 'number'\n | 'object'\n | 'string'\n | 'node'\n | 'element'\n | 'symbol'\n | 'elementType'\n | 'instanceOf'\n | 'oneOf'\n | 'oneOfType'\n | 'arrayOf'\n | 'objectOf'\n | 'shape'\n | 'exact'\n | 'tuple';\n\nexport interface ReactDescT {\n [key: string]: unknown;\n type: PropTypesTypes;\n defaultValue: (this: ReactDescT, dfault: unknown) => ReactDescT;\n deprecated: (this: ReactDescT, info: Record<string, string>) => ReactDescT;\n description: (this: ReactDescT, descr: string) => ReactDescT;\n format: (this: ReactDescT, format: string) => ReactDescT;\n signature: (this: ReactDescT, format: string) => ReactDescT;\n hidden: (this: ReactDescT) => ReactDescT;\n global: (this: ReactDescT) => ReactDescT;\n xstyled: (this: ReactDescT) => ReactDescT;\n isRequired: ReactDescT;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n isRequiredIf: (this: ReactDescT, isRequiredIf: (props: any) => boolean) => ReactDescT;\n reactDesc: ReactDescObjT;\n args?:\n | ReactDescT\n | ReactDescT[]\n | Record<string, ReactDescT>\n | unknown[]\n | Parameters<InstanceOfT>[0]\n | Parameters<OneOfT>[0]\n | Parameters<ObjectOfT>[0]\n | Parameters<ExactT>[0];\n}\n\nexport interface ComponentDocumentation {\n propTypes: Record<string, ReactDescT>;\n availableAt?: unknown;\n description?: string;\n details?: unknown;\n deprecated?: unknown;\n usage?: unknown;\n intrinsicElement?: unknown;\n toTypescript?: unknown;\n}\n\nexport interface TypescriptDocumentation extends Partial<ComponentDocumentation> {\n name: string;\n description: string;\n properties: {\n name: string;\n required?: boolean | undefined;\n deprecated?: Record<string, string> | undefined;\n description?: string;\n format?: string;\n signature?: string;\n warned?: boolean;\n defaultValue?: unknown;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n isRequiredIf?: (props: any) => boolean;\n }[];\n}\n\nexport type DocumentedReactComponent<T> = React.ComponentType<T> & {\n availableAt: unknown;\n description: (descr: string) => DocumentedReactComponent<T>;\n details: unknown;\n deprecated: unknown;\n usage: unknown;\n intrinsicElement: unknown;\n toTypescript: () => TypescriptDocumentation;\n propTypesValue: ValidationMap<Record<string, unknown>>;\n};\n\nexport type Hook<T = unknown, S = unknown> = ((props: T) => S) & { displayName?: string; name?: string };\n\nexport type DocumentedPropType = ReactDescT;\n\nexport type PropTypesObj = {\n any: DocumentedPropType;\n array: DocumentedPropType;\n bool: DocumentedPropType;\n func: DocumentedPropType;\n number: DocumentedPropType;\n object: DocumentedPropType;\n string: DocumentedPropType;\n node: DocumentedPropType;\n element: DocumentedPropType;\n symbol: DocumentedPropType;\n elementType: DocumentedPropType;\n instanceOf: (cls: unknown) => DocumentedPropType;\n oneOf: (arr: unknown[]) => DocumentedPropType;\n oneOfType: (arr: DocumentedPropType[]) => DocumentedPropType;\n arrayOf: (smth: DocumentedPropType) => DocumentedPropType;\n objectOf: (smth: DocumentedPropType) => DocumentedPropType;\n shape: (obj: Record<string, DocumentedPropType>) => DocumentedPropType;\n exact: (obj: Record<string, DocumentedPropType>) => DocumentedPropType;\n tuple: (arr: DocumentedPropType[]) => DocumentedPropType;\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;ACAA,YAAuB;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -17,7 +17,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
17
17
|
}
|
|
18
18
|
return to;
|
|
19
19
|
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
|
+
mod
|
|
23
|
+
));
|
|
21
24
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
22
25
|
var TestComponent_exports = {};
|
|
23
26
|
__export(TestComponent_exports, {
|
|
@@ -25,12 +28,14 @@ __export(TestComponent_exports, {
|
|
|
25
28
|
});
|
|
26
29
|
module.exports = __toCommonJS(TestComponent_exports);
|
|
27
30
|
var React = __toESM(require("react"));
|
|
31
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
28
32
|
var import_react = __toESM(require("react"));
|
|
29
33
|
var import_globalProps = require("../../globalProps");
|
|
30
34
|
const TestComponent = (props) => {
|
|
31
35
|
const globalAttributes = (0, import_globalProps.useGetGlobalAttributes)(props);
|
|
32
|
-
return /* @__PURE__ */
|
|
33
|
-
...globalAttributes
|
|
34
|
-
|
|
36
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
37
|
+
...globalAttributes,
|
|
38
|
+
children: "Some random div"
|
|
39
|
+
});
|
|
35
40
|
};
|
|
36
41
|
//# sourceMappingURL=TestComponent.js.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../src/props-helpers/tests/globalProps/TestComponent.js", "../../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
4
|
"sourcesContent": ["import React from 'react';\nimport { useGetGlobalAttributes } from '../../globalProps';\n\nexport const TestComponent = (props) => {\n const globalAttributes = useGetGlobalAttributes(props);\n\n return <div {...globalAttributes}>Some random div</div>;\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB;AAAA,mBAAkB;AAClB,yBAAuC;AAEhC,MAAM,gBAAgB,CAAC,UAAU;AACtC,QAAM,uBAAmB,2CAAuB,KAAK;AAErD,SAAO,4CAAC;AAAA,IAAK,GAAG;AAAA,IAAkB;AAAA,GAAe;AACnD;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -17,7 +17,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
17
17
|
}
|
|
18
18
|
return to;
|
|
19
19
|
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
|
+
mod
|
|
23
|
+
));
|
|
21
24
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
22
25
|
var test_schema_exports = {};
|
|
23
26
|
__export(test_schema_exports, {
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../src/props-helpers/tests/validation/test.schema.js", "../../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
4
|
"sourcesContent": ["import { PropTypes, describe } from '../../propTypes/index.ts';\n\nconst TestSchema = {\n string: PropTypes.string.description('String'),\n number: PropTypes.number.description('Number'),\n boolean: PropTypes.bool.description('Boolean'),\n any: PropTypes.any.description('Any'),\n union: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).description('Union'),\n union2: PropTypes.oneOf(['A', 'B']).description('Union 2'),\n union3: PropTypes.oneOfType([\n PropTypes.string,\n PropTypes.arrayOf(PropTypes.string),\n PropTypes.shape({ string: PropTypes.string }),\n ]).description('Union 3'),\n array: PropTypes.arrayOf(PropTypes.string).description('Array'),\n object: PropTypes.object.description('Object'),\n shape: PropTypes.shape({\n string: PropTypes.string.description('String').isRequired,\n number: PropTypes.number.description('Number'),\n boolean: PropTypes.bool.description('Boolean'),\n anotherShape: PropTypes.shape({\n string: PropTypes.string.description('String').isRequired,\n number: PropTypes.number.description('Number'),\n boolean: PropTypes.bool.description('Boolean'),\n }).description('Another shape'),\n }).description('Shape'),\n function: PropTypes.func.description('Function'),\n jsx: PropTypes.element.description('JSX'),\n node: PropTypes.node.description('Node'),\n something: PropTypes.oneOf(['thing', 'object']).description('something'),\n isRequiredIf: PropTypes.string.description('isRequiredIf').isRequiredIf((props) => props.something === 'thing'),\n};\n\nconst TestComponent = () => null;\n\nconst TestComponentWithSchema = describe(TestComponent).description('Test Component');\n\nTestComponentWithSchema.propTypes = TestSchema;\n\nexport const TypescriptSchema = TestComponentWithSchema.toTypescript();\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": "
|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AAU;AAAA,EAC/C,KAAK,2BAAU,QAAQ,YAAY,KAAK;AAAA,EACxC,MAAM,2BAAU,KAAK,YAAY,MAAM;AAAA,EACvC,WAAW,2BAAU,MAAM,CAAC,SAAS,QAAQ,CAAC,EAAE,YAAY,WAAW;AAAA,EACvE,cAAc,2BAAU,OAAO,YAAY,cAAc,EAAE,aAAa,CAAC,UAAU,MAAM,cAAc,OAAO;AAChH;AAEA,MAAM,gBAAgB,MAAM;AAE5B,MAAM,8BAA0B,2BAAS,aAAa,EAAE,YAAY,gBAAgB;AAEpF,wBAAwB,YAAY;AAE7B,MAAM,mBAAmB,wBAAwB,aAAa;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -17,7 +17,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
17
17
|
}
|
|
18
18
|
return to;
|
|
19
19
|
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
|
+
mod
|
|
23
|
+
));
|
|
21
24
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
22
25
|
var TestComponent_exports = {};
|
|
23
26
|
__export(TestComponent_exports, {
|
|
@@ -25,14 +28,16 @@ __export(TestComponent_exports, {
|
|
|
25
28
|
});
|
|
26
29
|
module.exports = __toCommonJS(TestComponent_exports);
|
|
27
30
|
var React = __toESM(require("react"));
|
|
31
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
28
32
|
var import_react = __toESM(require("react"));
|
|
29
33
|
var import_xstyledProps = require("../../xstyledProps");
|
|
30
34
|
const TestComponent = (props) => {
|
|
31
35
|
const xstyledProps = (0, import_xstyledProps.useGetXstyledProps)(props);
|
|
32
36
|
props.signal(xstyledProps);
|
|
33
|
-
return /* @__PURE__ */
|
|
37
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
34
38
|
...xstyledProps,
|
|
35
|
-
"data-testid": "xstyled-div"
|
|
36
|
-
|
|
39
|
+
"data-testid": "xstyled-div",
|
|
40
|
+
children: "Some random div"
|
|
41
|
+
});
|
|
37
42
|
};
|
|
38
43
|
//# sourceMappingURL=TestComponent.js.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../src/props-helpers/tests/xstyledProps/TestComponent.js", "../../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
4
|
"sourcesContent": ["/* eslint-disable react/prop-types */\nimport React from 'react';\nimport { useGetXstyledProps } from '../../xstyledProps';\n\nexport const TestComponent = (props) => {\n const xstyledProps = useGetXstyledProps(props);\n\n props.signal(xstyledProps);\n\n return (\n <div {...xstyledProps} data-testid=\"xstyled-div\">\n Some random div\n </div>\n );\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB;AACA,mBAAkB;AAClB,0BAAmC;AAE5B,MAAM,gBAAgB,CAAC,UAAU;AACtC,QAAM,mBAAe,wCAAmB,KAAK;AAE7C,QAAM,OAAO,YAAY;AAEzB,SACE,4CAAC;AAAA,IAAK,GAAG;AAAA,IAAc,eAAY;AAAA,IAAc;AAAA,GAEjD;AAEJ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -17,7 +17,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
17
17
|
}
|
|
18
18
|
return to;
|
|
19
19
|
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
|
+
mod
|
|
23
|
+
));
|
|
21
24
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
22
25
|
var useDeprecateComponent_exports = {};
|
|
23
26
|
__export(useDeprecateComponent_exports, {
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/props-helpers/useDeprecateComponent/index.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
4
|
"sourcesContent": ["/* eslint-disable no-console */\nimport { useEffect } from 'react';\n\ninterface Props {\n componentName: string;\n version: string;\n}\n\nexport const useDeprecateComponent = ({ componentName, version }: Props) => {\n useEffect(() => {\n console.error(`Warning: ${componentName}:: this component will be deprecated in version: ${version}.`);\n }, [componentName, version]);\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADCvB,mBAA0B;AAOnB,MAAM,wBAAwB,CAAC,EAAE,eAAe,QAAQ,MAAa;AAC1E,8BAAU,MAAM;AACd,YAAQ,MAAM,YAAY,iEAAiE,UAAU;AAAA,EACvG,GAAG,CAAC,eAAe,OAAO,CAAC;AAC7B;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -17,7 +17,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
17
17
|
}
|
|
18
18
|
return to;
|
|
19
19
|
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
|
+
mod
|
|
23
|
+
));
|
|
21
24
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
22
25
|
var errorTemplates_exports = {};
|
|
23
26
|
__export(errorTemplates_exports, {
|
|
@@ -27,16 +30,20 @@ __export(errorTemplates_exports, {
|
|
|
27
30
|
module.exports = __toCommonJS(errorTemplates_exports);
|
|
28
31
|
var React = __toESM(require("react"));
|
|
29
32
|
const throwTypeError = (componentName, validPropKey, invalidProp, validFormat) => {
|
|
30
|
-
throw new Error(
|
|
33
|
+
throw new Error(
|
|
34
|
+
`${componentName}:: You are trying to pass a not valid "${validPropKey}" property,
|
|
31
35
|
please provide a valid type.
|
|
32
36
|
|
|
33
37
|
Received: ${invalidProp} (${typeof invalidProp})
|
|
34
38
|
Expected: (${validFormat.replace("\n", " or ")})
|
|
35
|
-
`
|
|
39
|
+
`
|
|
40
|
+
);
|
|
36
41
|
};
|
|
37
42
|
const throwRequiredError = (componentName, validPropKey) => {
|
|
38
|
-
throw new Error(
|
|
43
|
+
throw new Error(
|
|
44
|
+
`${componentName}:: Please provide a/an "${validPropKey}" property to use this component.
|
|
39
45
|
This property is required.
|
|
40
|
-
`
|
|
46
|
+
`
|
|
47
|
+
);
|
|
41
48
|
};
|
|
42
49
|
//# sourceMappingURL=errorTemplates.js.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/props-helpers/validation/errorTemplates.ts", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
4
|
"sourcesContent": ["/* eslint-disable max-params */\nexport const throwTypeError = (\n componentName: string,\n validPropKey: string,\n invalidProp: unknown,\n validFormat: string,\n): void => {\n throw new Error(\n `${componentName}:: You are trying to pass a not valid \"${validPropKey}\" property, \n please provide a valid type.\n\n Received: ${invalidProp} (${typeof invalidProp})\n Expected: (${validFormat.replace('\\n', ' or ')})\n `,\n );\n};\n\nexport const throwRequiredError = (componentName: string, validPropKey: string): void => {\n throw new Error(\n `${componentName}:: Please provide a/an \"${validPropKey}\" property to use this component. \n This property is required.\n `,\n );\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADChB,MAAM,iBAAiB,CAC5B,eACA,cACA,aACA,gBACS;AACT,QAAM,IAAI;AAAA,IACR,GAAG,uDAAuD;AAAA;AAAA;AAAA,cAGhD,gBAAgB,OAAO;AAAA,eACtB,YAAY,QAAQ,MAAM,MAAM;AAAA;AAAA,EAE7C;AACF;AAEO,MAAM,qBAAqB,CAAC,eAAuB,iBAA+B;AACvF,QAAM,IAAI;AAAA,IACR,GAAG,wCAAwC;AAAA;AAAA;AAAA,EAG7C;AACF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -14,7 +14,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
14
14
|
return to;
|
|
15
15
|
};
|
|
16
16
|
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
17
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
17
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
18
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
19
|
+
mod
|
|
20
|
+
));
|
|
18
21
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
22
|
var validation_exports = {};
|
|
20
23
|
module.exports = __toCommonJS(validation_exports);
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/props-helpers/validation/index.ts", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
4
|
"sourcesContent": ["export * from './errorTemplates';\nexport * from './typescriptValidator';\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;ACAA,YAAuB;ADAvB,+BAAc,6BAAd;AACA,+BAAc,kCADd;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -17,7 +17,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
17
17
|
}
|
|
18
18
|
return to;
|
|
19
19
|
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
|
+
mod
|
|
23
|
+
));
|
|
21
24
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
22
25
|
var typescriptGuards_exports = {};
|
|
23
26
|
__export(typescriptGuards_exports, {
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/props-helpers/validation/typescriptGuards.ts", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
4
|
"sourcesContent": ["type GuardFn = (format: string) => boolean;\n\nexport const isPrimitiveType: GuardFn = (format) => ['string', 'number', 'boolean'].includes(format);\nexport const isUndefined: GuardFn = (format) => format === '\"undefined\"';\nexport const isNull: GuardFn = (format) => format === '\"null\"';\nexport const isUnion: GuardFn = (format) => {\n let depth = 0;\n let satisfies = false;\n format.split('').forEach((char) => {\n if (['{', '('].includes(char)) depth += 1;\n else if (['}', ')'].includes(char)) depth -= 1;\n else if (char === '|' && depth === 0) satisfies = true;\n });\n return satisfies;\n};\n\nexport const isString: GuardFn = (format) => !isUnion(format) && format[0] === '\"' && format.slice(-1) === '\"';\n\nexport const isArray: GuardFn = (format) => !isUnion(format) && format.slice(-2) === '[]';\n\nexport const isObject: GuardFn = (format) =>\n format === 'object' || (!isUnion(format) && format[0] === '{' && format.slice(-1) === '}');\n\nexport const isFunction: GuardFn = (format) => {\n // It's isn't an union\n if (isUnion(format)) return false;\n // Has to start with (( and end with )\n if (!format.startsWith('((') && format.slice(-1) !== ')') return false;\n\n // The arrow MUST occur at depth 1 (when couting parenthesis)\n // Otherwise the only possibility is that we have \"something with parenthesis\" (look down below)\n let depth = 0;\n let arrowOccursAtDepth1 = false;\n for (let i = 0; i < format.length; i += 1) {\n const char = format[i];\n if (['{', '('].includes(char)) depth += 1;\n else if (['}', ')'].includes(char)) depth -= 1;\n else if (i < format.length - 1 && format.slice(i, i + 2) === '=>') {\n arrowOccursAtDepth1 = arrowOccursAtDepth1 || depth === 1;\n }\n }\n return arrowOccursAtDepth1;\n};\n\nexport const isJSXorNode: GuardFn = (format) => !isUnion(format) && ['React.ReactNode', 'JSX.Element'].includes(format);\n\nexport const isSomethingWithParenthesis: GuardFn = (format) =>\n !isUnion(format) && format[0] === '(' && format.slice(-1) === ')';\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADEhB,MAAM,kBAA2B,CAAC,WAAW,CAAC,UAAU,UAAU,SAAS,EAAE,SAAS,MAAM;AAC5F,MAAM,cAAuB,CAAC,WAAW,WAAW;AACpD,MAAM,SAAkB,CAAC,WAAW,WAAW;AAC/C,MAAM,UAAmB,CAAC,WAAW;AAC1C,MAAI,QAAQ;AACZ,MAAI,YAAY;AAChB,SAAO,MAAM,E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OAAO,MAAM,EAAE,MAAM;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -17,7 +17,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
17
17
|
}
|
|
18
18
|
return to;
|
|
19
19
|
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
|
+
mod
|
|
23
|
+
));
|
|
21
24
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
22
25
|
var typescriptParsers_exports = {};
|
|
23
26
|
__export(typescriptParsers_exports, {
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/props-helpers/validation/typescriptParsers.ts", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
4
|
"sourcesContent": ["/* eslint-disable complexity */\nexport const typescriptObjectParser = (format: string): [string, string][] => {\n const keyValuePairs: [string, string][] = [];\n\n // State of the algorithm\n let lastKey = '';\n let lastValue = '';\n let shouldAppendToKey = true;\n\n const pushPair = () => {\n if (lastKey) keyValuePairs.push([lastKey, lastValue]);\n lastKey = '';\n lastValue = '';\n shouldAppendToKey = true;\n };\n\n // Complex -- but working -- logic\n let depth = 0;\n format.split('').forEach((char) => {\n if (char === '{') {\n depth += 1;\n if (depth > 1) lastValue += char;\n } else if (char === '}') {\n if (depth > 1) lastValue += char;\n depth -= 1;\n if (depth === 1) pushPair();\n } else if (char === ':') {\n shouldAppendToKey = false;\n if (depth > 1) lastValue += char;\n } else if (char === ',') {\n if (depth === 1) pushPair();\n else lastValue += char;\n } else if (char === ' ') {\n // Do nothing\n } else if (shouldAppendToKey) lastKey += char;\n else lastValue += char;\n });\n pushPair();\n\n return keyValuePairs;\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADChB,MAAM,yBAAyB,CAAC,WAAuC;AAC5E,QAAM,gBAAoC,CAAC;AAG3C,MAAI,UAAU;AACd,MAAI,YAAY;AAChB,MAAI,oBAAoB;AAExB,QAAM,WAAW,MAAM;AACrB,QAAI;AAAS,oBAAc,KAAK,CAAC,SAAS,SAAS,CAAC;AACpD,cAAU;AACV,gBAAY;AACZ,wBAAoB;AAAA,EACtB;AAGA,MAAI,QAAQ;AACZ,SAAO,MAAM,EAAE,EAAE,QAAQ,CAAC,SAAS;AACjC,QAAI,SAAS,KAAK;AAChB,eAAS;AACT,UAAI,QAAQ;AAAG,qBAAa;AAAA,IAC9B,WAAW,SAAS,KAAK;AACvB,UAAI,QAAQ;AAAG,qBAAa;AAC5B,eAAS;AACT,UAAI,UAAU;AAAG,iBAAS;AAAA,IAC5B,WAAW,SAAS,KAAK;AACvB,0BAAoB;AACpB,UAAI,QAAQ;AAAG,qBAAa;AAAA,IAC9B,WAAW,SAAS,KAAK;AACvB,UAAI,UAAU;AAAG,iBAAS;AAAA;AACrB,qBAAa;AAAA,IACpB,WAAW,SAAS,KAAK;AAAA,IAEzB,WAAW;AAAmB,iBAAW;AAAA;AACpC,mBAAa;AAAA,EACpB,CAAC;AACD,WAAS;AAET,SAAO;AACT;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -17,7 +17,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
17
17
|
}
|
|
18
18
|
return to;
|
|
19
19
|
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
|
+
mod
|
|
23
|
+
));
|
|
21
24
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
22
25
|
var typescriptValidator_exports = {};
|
|
23
26
|
__export(typescriptValidator_exports, {
|
|
@@ -56,7 +59,14 @@ const validateArray = (schemaName, key, value, format, validationsMemo, nextVali
|
|
|
56
59
|
(0, import_errorTemplates.throwTypeError)(schemaName, key, value, format);
|
|
57
60
|
}
|
|
58
61
|
value.forEach((val, index) => {
|
|
59
|
-
validateValueWithFormat(
|
|
62
|
+
validateValueWithFormat(
|
|
63
|
+
schemaName,
|
|
64
|
+
`${key}[${index}]`,
|
|
65
|
+
val,
|
|
66
|
+
format.slice(0, -2),
|
|
67
|
+
validationsMemo,
|
|
68
|
+
nextValidationsMemo
|
|
69
|
+
);
|
|
60
70
|
});
|
|
61
71
|
};
|
|
62
72
|
function isObjectType(value) {
|
|
@@ -77,7 +87,14 @@ const validateObject = (schemaName, key, value, format, validationsMemo, nextVal
|
|
|
77
87
|
(0, import_errorTemplates.throwRequiredError)(schemaName, key);
|
|
78
88
|
}
|
|
79
89
|
if (trueKey in value) {
|
|
80
|
-
validateValueWithFormat(
|
|
90
|
+
validateValueWithFormat(
|
|
91
|
+
schemaName,
|
|
92
|
+
`${key}[${trueKey}]`,
|
|
93
|
+
value[trueKey],
|
|
94
|
+
objectValue,
|
|
95
|
+
validationsMemo,
|
|
96
|
+
nextValidationsMemo
|
|
97
|
+
);
|
|
81
98
|
}
|
|
82
99
|
});
|
|
83
100
|
};
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/props-helpers/validation/typescriptValidator.ts", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
4
|
"sourcesContent": ["/* eslint-disable complexity */\n/* eslint-disable max-lines */\n/* eslint-disable max-params */\nimport { PropsWithChildren, useMemo, useRef, WeakValidationMap } from 'react';\nimport { TypescriptDocumentation } from '../propTypes/types';\nimport { describe } from '../propTypes';\nimport { throwRequiredError, throwTypeError } from './errorTemplates';\nimport {\n isArray,\n isFunction,\n isJSXorNode,\n isObject,\n isPrimitiveType,\n isSomethingWithParenthesis,\n isString,\n isUnion,\n isUndefined,\n isNull,\n} from './typescriptGuards';\nimport { typescriptObjectParser } from './typescriptParsers';\n\ntype ValidatorFn = (\n schemaName: string,\n key: string,\n value: unknown,\n format: string,\n validationsMemo: Record<symbol, string>,\n nextValidationsMemo: Record<symbol, string>,\n) => void;\n\n// =============================================================================\n// Atom Validators\n// =============================================================================\n\n// This functions will validate something from the data\n// and optionally recursively apply `validateValueWithFormat`\n// in smaller parts\n\nconst validateUndefined: ValidatorFn = (schemaName, key, value, format) => {\n if (value !== undefined || value === 'undefined') {\n throwTypeError(schemaName, key, value, format);\n }\n};\nconst validateNull: ValidatorFn = (schemaName, key, value, format) => {\n if (value !== null || value === 'null') {\n throwTypeError(schemaName, key, value, format);\n }\n};\nconst validatePrimitiveType: ValidatorFn = (schemaName, key, value, format) => {\n if (typeof value !== format) {\n throwTypeError(schemaName, key, value, format);\n }\n};\n\nconst validateString: ValidatorFn = (schemaName, key, value, format) => {\n if (value !== format.slice(1, -1)) {\n throwTypeError(schemaName, key, value, format);\n }\n};\n\nconst validateArray: ValidatorFn = (schemaName, key, value, format, validationsMemo, nextValidationsMemo) => {\n // Check that we have an array\n if (!Array.isArray(value)) {\n throwTypeError(schemaName, key, value, format);\n }\n\n // Check that each element inside satisfies the format\n (value as unknown[]).forEach((val, index) => {\n // this is a recursive func, we need to invoke it before it's defined.\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n validateValueWithFormat(\n schemaName,\n `${key}[${index}]`,\n val,\n format.slice(0, -2),\n validationsMemo,\n nextValidationsMemo,\n );\n });\n};\nfunction isObjectType(value: unknown | Record<string, unknown>): value is Record<string, unknown> {\n return !(typeof value !== 'object' || Array.isArray(value));\n}\nconst validateObject: ValidatorFn = (schemaName, key, value, format, validationsMemo, nextValidationsMemo) => {\n const valuesIsObject = isObjectType(value);\n // Check that we have an object\n if (!valuesIsObject) {\n throwTypeError(schemaName, key, value, format);\n return;\n }\n\n if (format === 'object') return;\n\n const keyValuePairs = typescriptObjectParser(format);\n // Now we have the key - value pairs\n // Each key could either be required or not\n // Just recursively check the object\n\n keyValuePairs.forEach(([objectKey, objectValue]) => {\n const trueKey = objectKey.slice(-1) === '?' ? objectKey.slice(0, -1) : objectKey;\n\n if (trueKey === objectKey && !(trueKey in value)) {\n throwRequiredError(schemaName, key);\n }\n\n if (trueKey in value) {\n // this is a recursive func, we need to invoke it before it's defined.\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n validateValueWithFormat(\n schemaName,\n `${key}[${trueKey}]`,\n value[trueKey],\n objectValue,\n validationsMemo,\n nextValidationsMemo,\n );\n }\n });\n};\n\nconst validateUnion: ValidatorFn = (schemaName, key, value, format, validationsMemo, nextValidationsMemo) => {\n const possibilities = format.split(/\\s?\\|\\s?/);\n\n const errors = [];\n\n possibilities.forEach((possibility) => {\n try {\n // this is a recursive func, we need to invoke it before it's defined.\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n validateValueWithFormat(schemaName, key, value, possibility, validationsMemo, nextValidationsMemo);\n } catch (e) {\n errors.push(e);\n }\n });\n\n if (errors.length === possibilities.length) {\n throwTypeError(schemaName, key, value, format);\n }\n};\n\nconst validateFunction: ValidatorFn = (schemaName, key, value, format) => {\n // Check that we have a function\n if (typeof value !== 'function') {\n throwTypeError(schemaName, key, value, format);\n }\n};\n\nfunction isJSXElement(value: unknown | JSX.Element): value is JSX.Element {\n return value === null || (typeof value === 'object' && value !== null && '$$typeof' in value);\n}\nconst validateJSXorNode: ValidatorFn = (schemaName, key, value, format) => {\n const valueIsJSX = isJSXElement(value);\n if (format === 'JSX.Element' && !valueIsJSX) {\n throwTypeError(schemaName, key, value, format);\n }\n};\n\n// =============================================================================\n// Schema validator\n// =============================================================================\n\nconst validateValueWithFormat: ValidatorFn = (schemaName, key, value, format, validationsMemo, nextValidationsMemo) => {\n nextValidationsMemo[value as symbol] = format;\n\n if ((value as symbol) in validationsMemo) {\n // We already validated this value on this format\n return;\n }\n\n if (isUndefined(format)) {\n validateUndefined(schemaName, key, value, format, validationsMemo, nextValidationsMemo);\n } else if (isNull(format)) {\n validateNull(schemaName, key, value, format, validationsMemo, nextValidationsMemo);\n } else if (isPrimitiveType(format)) {\n validatePrimitiveType(schemaName, key, value, format, validationsMemo, nextValidationsMemo);\n } else if (isUnion(format)) {\n validateUnion(schemaName, key, value, format, validationsMemo, nextValidationsMemo);\n } else if (isString(format)) {\n validateString(schemaName, key, value, format, validationsMemo, nextValidationsMemo);\n } else if (isArray(format)) {\n validateArray(schemaName, key, value, format, validationsMemo, nextValidationsMemo);\n } else if (isObject(format)) {\n validateObject(schemaName, key, value, format, validationsMemo, nextValidationsMemo);\n } else if (isFunction(format)) {\n validateFunction(schemaName, key, value, format, validationsMemo, nextValidationsMemo);\n } else if (isJSXorNode(format)) {\n validateJSXorNode(schemaName, key, value, format, validationsMemo, nextValidationsMemo);\n } else if (isSomethingWithParenthesis(format)) {\n validateValueWithFormat(schemaName, key, value, format.slice(1, -1), validationsMemo, nextValidationsMemo);\n }\n};\n\nexport const validateTypescriptPropTypesImplementation = (\n props: PropsWithChildren<Record<string, unknown>>,\n schema: TypescriptDocumentation,\n validationsMemo: Record<string, string> = {},\n nextValidationsMemo: Record<string, string> = {},\n): void => {\n const { properties, name: schemaName } = schema;\n\n properties.forEach((property) => {\n const { name, format, required, isRequiredIf } = property;\n\n const requiredConditionally = isRequiredIf && isRequiredIf(props);\n\n if (required && !(name in props)) {\n throwRequiredError(schema.name, name);\n }\n\n if (requiredConditionally && !(name in props)) {\n throwRequiredError(schema.name, name);\n }\n\n const shouldValidateProperty = props[name] !== undefined || required || requiredConditionally;\n\n if (name in props && format && shouldValidateProperty) {\n validateValueWithFormat(schemaName, name, props[name], format, validationsMemo, nextValidationsMemo);\n }\n });\n};\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport const useValidateTypescriptPropTypes = <T = Record<string, any>>(\n props: PropsWithChildren<T>,\n propTypes: WeakValidationMap<unknown>,\n): void => {\n const validationsMemo = useRef<Record<string, string>>({});\n\n const typescriptSchema = useMemo(() => {\n const Component = () => {};\n\n const DescribedComponent = describe(Component);\n DescribedComponent.propTypes = propTypes;\n return DescribedComponent.toTypescript();\n }, [propTypes]);\n\n useMemo(() => {\n const nextValidationsMemo = {};\n\n validateTypescriptPropTypesImplementation(props, typescriptSchema, validationsMemo.current, nextValidationsMemo);\n validationsMemo.current = nextValidationsMemo;\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [props]);\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADGvB,mBAAsE;AAEtE,uBAAyB;AACzB,4BAAmD;AACnD,8BAWO;AACP,+BAAuC;AAmBvC,MAAM,oBAAiC,CAAC,YAAY,KAAK,OAAO,WAAW;AACzE,MAAI,UAAU,UAAa,UAAU,aAAa;AAChD,8CAAe,YAAY,KAAK,OAAO,MAAM;AAAA,EAC/C;AACF;AACA,MAAM,eAA4B,CAAC,YAAY,KAAK,OAAO,WAAW;AACpE,MAAI,UAAU,QAAQ,UAAU,QAAQ;AACtC,8CAAe,YAAY,KAAK,OAAO,MAAM;AAAA,EAC/C;AACF;AACA,MAAM,wBAAqC,CAAC,YAAY,KAAK,OAAO,WAAW;AAC7E,MAAI,OAAO,UAAU,QAAQ;AAC3B,8CAAe,YAAY,KAAK,OAAO,MAAM;AAAA,EAC/C;AACF;AAEA,MAAM,iBAA8B,CAAC,YAAY,KAAK,OAAO,WAAW;AACtE,MAAI,UAAU,OAAO,MAAM,GAAG,EAAE,GAA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CAAC,CAAC;AAEzD,QAAM,uBAAmB,sBAAQ,MAAM;AACrC,UAAM,YAAY,MAAM;AAAA,IAAC;AAEzB,UAAM,yBAAqB,2BAAS,SAAS;AAC7C,uBAAmB,YAAY;AAC/B,WAAO,mBAAmB,aAAa;AAAA,EACzC,GAAG,CAAC,SAAS,CAAC;AAEd,4BAAQ,MAAM;AACZ,UAAM,sBAAsB,CAAC;AAE7B,8CAA0C,OAAO,kBAAkB,gBAAgB,SAAS,mBAAmB;AAC/G,oBAAgB,UAAU;AAAA,EAE5B,GAAG,CAAC,KAAK,CAAC;AACZ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -17,7 +17,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
17
17
|
}
|
|
18
18
|
return to;
|
|
19
19
|
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
|
+
mod
|
|
23
|
+
));
|
|
21
24
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
22
25
|
var constants_exports = {};
|
|
23
26
|
__export(constants_exports, {
|
|
@@ -78,5 +81,7 @@ const layoutKeys = [
|
|
|
78
81
|
"overscrollBehavior",
|
|
79
82
|
"objectFit"
|
|
80
83
|
];
|
|
81
|
-
const xstyledKeys = Object.fromEntries(
|
|
84
|
+
const xstyledKeys = Object.fromEntries(
|
|
85
|
+
[...spacingKeys, ...sizingKeys, ...layoutKeys].map((item) => [item, true])
|
|
86
|
+
);
|
|
82
87
|
//# sourceMappingURL=constants.js.map
|