@semcore/core 16.0.0-prerelease.4 → 16.0.0-prerelease.7
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/lib/LastInteractionType.cjs +57 -0
- package/lib/LastInteractionType.cjs.map +1 -0
- package/lib/LastInteractionType.d.ts +1 -1
- package/lib/LastInteractionType.mjs +51 -0
- package/lib/core-types/Component.cjs +59 -0
- package/lib/core-types/Component.cjs.map +1 -0
- package/lib/core-types/Component.mjs +28 -31
- package/lib/core-types/UnknownProperties.cjs +2 -0
- package/lib/core-types/UnknownProperties.cjs.map +1 -0
- package/lib/core-types/reshadow.d.cjs +2 -0
- package/lib/core-types/reshadow.d.cjs.map +1 -0
- package/lib/core-types/symbols.cjs +25 -0
- package/lib/core-types/symbols.cjs.map +1 -0
- package/lib/core-types/symbols.mjs +20 -10
- package/lib/coreFactory.cjs +352 -0
- package/lib/coreFactory.cjs.map +1 -0
- package/lib/coreFactory.mjs +324 -0
- package/lib/enhancement/Children.cjs +119 -0
- package/lib/enhancement/Children.cjs.map +1 -0
- package/lib/enhancement/Children.mjs +34 -49
- package/lib/enhancement/Root.cjs +78 -0
- package/lib/enhancement/Root.cjs.map +1 -0
- package/lib/enhancement/Root.mjs +25 -35
- package/lib/enhancement/bindHandler.cjs +54 -0
- package/lib/enhancement/bindHandler.cjs.map +1 -0
- package/lib/enhancement/bindHandler.mjs +10 -9
- package/lib/enhancement/dataName.cjs +20 -0
- package/lib/enhancement/dataName.cjs.map +1 -0
- package/lib/enhancement/dataName.mjs +5 -4
- package/lib/enhancement/enhance.cjs +22 -0
- package/lib/enhancement/enhance.cjs.map +1 -0
- package/lib/enhancement/enhance.mjs +4 -3
- package/lib/enhancement/functionDefaultProps.cjs +36 -0
- package/lib/enhancement/functionDefaultProps.cjs.map +1 -0
- package/lib/enhancement/functionDefaultProps.mjs +5 -5
- package/lib/enhancement/hoistProps.cjs +97 -0
- package/lib/enhancement/hoistProps.cjs.map +1 -0
- package/lib/enhancement/hoistProps.mjs +22 -32
- package/lib/enhancement/i18n.cjs +28 -0
- package/lib/enhancement/i18n.cjs.map +1 -0
- package/lib/enhancement/i18n.mjs +8 -8
- package/lib/enhancement/inheritedName.cjs +23 -0
- package/lib/enhancement/inheritedName.cjs.map +1 -0
- package/lib/enhancement/inheritedName.mjs +5 -4
- package/lib/enhancement/staticChildren.cjs +135 -0
- package/lib/enhancement/staticChildren.cjs.map +1 -0
- package/lib/enhancement/staticChildren.mjs +35 -38
- package/lib/enhancement/style.cjs +60 -0
- package/lib/enhancement/style.cjs.map +1 -0
- package/lib/enhancement/style.mjs +16 -17
- package/lib/enhancement/uncontrolledProps.cjs +131 -0
- package/lib/enhancement/uncontrolledProps.cjs.map +1 -0
- package/lib/enhancement/uncontrolledProps.mjs +28 -44
- package/lib/esm/LastInteractionType.mjs +29 -20
- package/lib/esm/core-types/Component.mjs +40 -29
- package/lib/esm/core-types/symbols.mjs +18 -10
- package/lib/esm/coreFactory.mjs +273 -184
- package/lib/esm/enhancement/Children.mjs +72 -48
- package/lib/esm/enhancement/Root.mjs +49 -32
- package/lib/esm/enhancement/bindHandler.mjs +34 -30
- package/lib/esm/enhancement/dataName.mjs +7 -7
- package/lib/esm/enhancement/enhance.mjs +9 -9
- package/lib/esm/enhancement/functionDefaultProps.mjs +19 -9
- package/lib/esm/enhancement/hoistProps.mjs +62 -42
- package/lib/esm/enhancement/i18n.mjs +13 -11
- package/lib/esm/enhancement/inheritedName.mjs +9 -9
- package/lib/esm/enhancement/staticChildren.mjs +100 -58
- package/lib/esm/enhancement/style.mjs +38 -26
- package/lib/esm/enhancement/uncontrolledProps.mjs +81 -62
- package/lib/esm/index.mjs +21 -21
- package/lib/esm/register.mjs +22 -15
- package/lib/esm/styled/reshadow-core.mjs +9 -7
- package/lib/esm/styled/sstyled.mjs +98 -55
- package/lib/esm/utils/assignProps.mjs +65 -31
- package/lib/esm/utils/canUseDOM.mjs +3 -3
- package/lib/esm/utils/capitalizeFirstLetter.mjs +3 -3
- package/lib/esm/utils/enhances/WithI18n.mjs +44 -38
- package/lib/esm/utils/logger.mjs +24 -16
- package/lib/esm/utils/pick.mjs +11 -6
- package/lib/esm/utils/ref.mjs +33 -24
- package/lib/esm/utils/use/useEnhancedEffect.mjs +4 -4
- package/lib/index.cjs +103 -0
- package/lib/index.cjs.map +1 -0
- package/lib/index.mjs +23 -0
- package/lib/register.cjs +37 -0
- package/lib/register.cjs.map +1 -0
- package/lib/register.mjs +13 -11
- package/lib/styled/index.cjs +32 -0
- package/lib/styled/index.cjs.map +1 -0
- package/lib/styled/reshadow-core.cjs +256 -0
- package/lib/styled/reshadow-core.cjs.map +1 -0
- package/lib/styled/reshadow-core.mjs +8 -233
- package/lib/styled/sstyled.cjs +149 -0
- package/lib/styled/sstyled.cjs.map +1 -0
- package/lib/styled/sstyled.mjs +40 -61
- package/lib/theme/processor.cjs +315 -0
- package/lib/theme/processor.cjs.map +1 -0
- package/lib/theme/themes/dark.cjs +385 -0
- package/lib/theme/themes/dark.cjs.map +1 -0
- package/lib/theme/themes/default.cjs +394 -0
- package/lib/theme/themes/default.cjs.map +1 -0
- package/lib/theme/themes/light.cjs +394 -0
- package/lib/theme/themes/light.cjs.map +1 -0
- package/lib/theme/utils.cjs +297 -0
- package/lib/theme/utils.cjs.map +1 -0
- package/lib/utils/CSSinJS.cjs +36 -0
- package/lib/utils/CSSinJS.cjs.map +1 -0
- package/lib/utils/ScreenReaderOnly.cjs +31 -0
- package/lib/utils/ScreenReaderOnly.cjs.map +1 -0
- package/lib/utils/ThemeProvider.cjs +82 -0
- package/lib/utils/ThemeProvider.cjs.map +1 -0
- package/lib/utils/addonText.cjs +18 -0
- package/lib/utils/addonText.cjs.map +1 -0
- package/lib/utils/addonText.d.ts +1 -1
- package/lib/utils/addonTextChildren.cjs +45 -0
- package/lib/utils/addonTextChildren.cjs.map +1 -0
- package/lib/utils/ariaProps.cjs +22 -0
- package/lib/utils/ariaProps.cjs.map +1 -0
- package/lib/utils/assignProps.cjs +93 -0
- package/lib/utils/assignProps.cjs.map +1 -0
- package/lib/utils/assignProps.mjs +30 -38
- package/lib/utils/canUseDOM.cjs +10 -0
- package/lib/utils/canUseDOM.cjs.map +1 -0
- package/lib/utils/canUseDOM.mjs +5 -3
- package/lib/utils/capitalizeFirstLetter.cjs +10 -0
- package/lib/utils/capitalizeFirstLetter.cjs.map +1 -0
- package/lib/utils/capitalizeFirstLetter.mjs +4 -2
- package/lib/utils/color.cjs +208 -0
- package/lib/utils/color.cjs.map +1 -0
- package/lib/utils/compose.cjs +21 -0
- package/lib/utils/compose.cjs.map +1 -0
- package/lib/utils/createHoc.cjs +55 -0
- package/lib/utils/createHoc.cjs.map +1 -0
- package/lib/utils/createUUID.cjs +15 -0
- package/lib/utils/createUUID.cjs.map +1 -0
- package/lib/utils/cssToIntDefault.cjs +22 -0
- package/lib/utils/cssToIntDefault.cjs.map +1 -0
- package/lib/utils/enhances/WithAutoFocus.cjs +75 -0
- package/lib/utils/enhances/WithAutoFocus.cjs.map +1 -0
- package/lib/utils/enhances/WithCSS.cjs +93 -0
- package/lib/utils/enhances/WithCSS.cjs.map +1 -0
- package/lib/utils/enhances/WithI18n.cjs +95 -0
- package/lib/utils/enhances/WithI18n.cjs.map +1 -0
- package/lib/utils/enhances/WithI18n.mjs +28 -57
- package/lib/utils/enhances/WithKeyboardFocus.cjs +93 -0
- package/lib/utils/enhances/WithKeyboardFocus.cjs.map +1 -0
- package/lib/utils/enhances/WithRef.cjs +26 -0
- package/lib/utils/enhances/WithRef.cjs.map +1 -0
- package/lib/utils/enhances/a11yEnhance.cjs +74 -0
- package/lib/utils/enhances/a11yEnhance.cjs.map +1 -0
- package/lib/utils/enhances/animatedSizeEnhance.cjs +98 -0
- package/lib/utils/enhances/animatedSizeEnhance.cjs.map +1 -0
- package/lib/utils/enhances/autoFocusEnhance.cjs +46 -0
- package/lib/utils/enhances/autoFocusEnhance.cjs.map +1 -0
- package/lib/utils/enhances/contextEnhance.cjs +22 -0
- package/lib/utils/enhances/contextEnhance.cjs.map +1 -0
- package/lib/utils/enhances/i18nEnhance.cjs +101 -0
- package/lib/utils/enhances/i18nEnhance.cjs.map +1 -0
- package/lib/utils/enhances/keyboardFocusEnhance.cjs +63 -0
- package/lib/utils/enhances/keyboardFocusEnhance.cjs.map +1 -0
- package/lib/utils/enhances/resolveColorEnhance.cjs +25 -0
- package/lib/utils/enhances/resolveColorEnhance.cjs.map +1 -0
- package/lib/utils/eventEmitter.cjs +41 -0
- package/lib/utils/eventEmitter.cjs.map +1 -0
- package/lib/utils/findComponent.cjs +106 -0
- package/lib/utils/findComponent.cjs.map +1 -0
- package/lib/utils/fire.cjs +23 -0
- package/lib/utils/fire.cjs.map +1 -0
- package/lib/utils/focus-lock/focusBorders.cjs +72 -0
- package/lib/utils/focus-lock/focusBorders.cjs.map +1 -0
- package/lib/utils/focus-lock/getFocusableIn.cjs +26 -0
- package/lib/utils/focus-lock/getFocusableIn.cjs.map +1 -0
- package/lib/utils/focus-lock/isFocusInside.cjs +16 -0
- package/lib/utils/focus-lock/isFocusInside.cjs.map +1 -0
- package/lib/utils/focus-lock/isFocusable.cjs +51 -0
- package/lib/utils/focus-lock/isFocusable.cjs.map +1 -0
- package/lib/utils/focus-lock/setFocus.cjs +63 -0
- package/lib/utils/focus-lock/setFocus.cjs.map +1 -0
- package/lib/utils/getAccessibleName.cjs +56 -0
- package/lib/utils/getAccessibleName.cjs.map +1 -0
- package/lib/utils/getDisplayName.cjs +10 -0
- package/lib/utils/getDisplayName.cjs.map +1 -0
- package/lib/utils/getEventTarget.cjs +53 -0
- package/lib/utils/getEventTarget.cjs.map +1 -0
- package/lib/utils/getOriginChildren.cjs +18 -0
- package/lib/utils/getOriginChildren.cjs.map +1 -0
- package/lib/utils/getRandomInt.cjs +11 -0
- package/lib/utils/getRandomInt.cjs.map +1 -0
- package/lib/utils/getValue.cjs +16 -0
- package/lib/utils/getValue.cjs.map +1 -0
- package/lib/utils/hasLabels.cjs +47 -0
- package/lib/utils/hasLabels.cjs.map +1 -0
- package/lib/utils/hasParent.cjs +14 -0
- package/lib/utils/hasParent.cjs.map +1 -0
- package/lib/utils/if.cjs +16 -0
- package/lib/utils/if.cjs.map +1 -0
- package/lib/utils/ifChildren.cjs +17 -0
- package/lib/utils/ifChildren.cjs.map +1 -0
- package/lib/utils/injectStyle.cjs +49 -0
- package/lib/utils/injectStyle.cjs.map +1 -0
- package/lib/utils/inputProps.cjs +22 -0
- package/lib/utils/inputProps.cjs.map +1 -0
- package/lib/utils/isNode.cjs +28 -0
- package/lib/utils/isNode.cjs.map +1 -0
- package/lib/utils/isPromise.cjs +10 -0
- package/lib/utils/isPromise.cjs.map +1 -0
- package/lib/utils/isRetina.cjs +15 -0
- package/lib/utils/isRetina.cjs.map +1 -0
- package/lib/utils/logger.cjs +40 -0
- package/lib/utils/logger.cjs.map +1 -0
- package/lib/utils/logger.mjs +19 -16
- package/lib/utils/numericChecker.cjs +33 -0
- package/lib/utils/numericChecker.cjs.map +1 -0
- package/lib/utils/ownerDocument.cjs +10 -0
- package/lib/utils/ownerDocument.cjs.map +1 -0
- package/lib/utils/pick.cjs +19 -0
- package/lib/utils/pick.cjs.map +1 -0
- package/lib/utils/pick.mjs +4 -2
- package/lib/utils/propsForElement.cjs +59 -0
- package/lib/utils/propsForElement.cjs.map +1 -0
- package/lib/utils/rafTrottle.cjs +33 -0
- package/lib/utils/rafTrottle.cjs.map +1 -0
- package/lib/utils/reactToText.cjs +33 -0
- package/lib/utils/reactToText.cjs.map +1 -0
- package/lib/utils/ref.cjs +95 -0
- package/lib/utils/ref.cjs.map +1 -0
- package/lib/utils/ref.mjs +20 -60
- package/lib/utils/setRef.cjs +10 -0
- package/lib/utils/setRef.cjs.map +1 -0
- package/lib/utils/syncScroll.cjs +61 -0
- package/lib/utils/syncScroll.cjs.map +1 -0
- package/lib/utils/uncontroll.cjs +47 -0
- package/lib/utils/uncontroll.cjs.map +1 -0
- package/lib/utils/uniqueID.cjs +42 -0
- package/lib/utils/uniqueID.cjs.map +1 -0
- package/lib/utils/use/useColorResolver.cjs +208 -0
- package/lib/utils/use/useColorResolver.cjs.map +1 -0
- package/lib/utils/use/useCss.cjs +20 -0
- package/lib/utils/use/useCss.cjs.map +1 -0
- package/lib/utils/use/useEnhancedEffect.cjs +13 -0
- package/lib/utils/use/useEnhancedEffect.cjs.map +1 -0
- package/lib/utils/use/useEnhancedEffect.mjs +4 -3
- package/lib/utils/use/useEventCallback.cjs +25 -0
- package/lib/utils/use/useEventCallback.cjs.map +1 -0
- package/lib/utils/use/useEventListener.cjs +33 -0
- package/lib/utils/use/useEventListener.cjs.map +1 -0
- package/lib/utils/use/useFocusLock.cjs +289 -0
- package/lib/utils/use/useFocusLock.cjs.map +1 -0
- package/lib/utils/use/usePreventScroll.cjs +78 -0
- package/lib/utils/use/usePreventScroll.cjs.map +1 -0
- package/lib/utils/useCssVariable.cjs +55 -0
- package/lib/utils/useCssVariable.cjs.map +1 -0
- package/lib/utils/zIndexStacking.cjs +48 -0
- package/lib/utils/zIndexStacking.cjs.map +1 -0
- package/package.json +7 -7
- package/vite.config.ts +8 -0
- package/lib/cjs/LastInteractionType.js +0 -57
- package/lib/cjs/LastInteractionType.js.map +0 -1
- package/lib/cjs/core-types/Component.js +0 -59
- package/lib/cjs/core-types/Component.js.map +0 -1
- package/lib/cjs/core-types/UnknownProperties.js +0 -2
- package/lib/cjs/core-types/UnknownProperties.js.map +0 -1
- package/lib/cjs/core-types/reshadow.d.js +0 -2
- package/lib/cjs/core-types/reshadow.d.js.map +0 -1
- package/lib/cjs/core-types/symbols.js +0 -25
- package/lib/cjs/core-types/symbols.js.map +0 -1
- package/lib/cjs/coreFactory.js +0 -352
- package/lib/cjs/coreFactory.js.map +0 -1
- package/lib/cjs/enhancement/Children.js +0 -119
- package/lib/cjs/enhancement/Children.js.map +0 -1
- package/lib/cjs/enhancement/Root.js +0 -78
- package/lib/cjs/enhancement/Root.js.map +0 -1
- package/lib/cjs/enhancement/bindHandler.js +0 -54
- package/lib/cjs/enhancement/bindHandler.js.map +0 -1
- package/lib/cjs/enhancement/dataName.js +0 -20
- package/lib/cjs/enhancement/dataName.js.map +0 -1
- package/lib/cjs/enhancement/enhance.js +0 -22
- package/lib/cjs/enhancement/enhance.js.map +0 -1
- package/lib/cjs/enhancement/functionDefaultProps.js +0 -36
- package/lib/cjs/enhancement/functionDefaultProps.js.map +0 -1
- package/lib/cjs/enhancement/hoistProps.js +0 -97
- package/lib/cjs/enhancement/hoistProps.js.map +0 -1
- package/lib/cjs/enhancement/i18n.js +0 -28
- package/lib/cjs/enhancement/i18n.js.map +0 -1
- package/lib/cjs/enhancement/inheritedName.js +0 -23
- package/lib/cjs/enhancement/inheritedName.js.map +0 -1
- package/lib/cjs/enhancement/staticChildren.js +0 -135
- package/lib/cjs/enhancement/staticChildren.js.map +0 -1
- package/lib/cjs/enhancement/style.js +0 -60
- package/lib/cjs/enhancement/style.js.map +0 -1
- package/lib/cjs/enhancement/uncontrolledProps.js +0 -131
- package/lib/cjs/enhancement/uncontrolledProps.js.map +0 -1
- package/lib/cjs/index.js +0 -103
- package/lib/cjs/index.js.map +0 -1
- package/lib/cjs/register.js +0 -37
- package/lib/cjs/register.js.map +0 -1
- package/lib/cjs/styled/index.js +0 -32
- package/lib/cjs/styled/index.js.map +0 -1
- package/lib/cjs/styled/reshadow-core.js +0 -256
- package/lib/cjs/styled/reshadow-core.js.map +0 -1
- package/lib/cjs/styled/sstyled.js +0 -149
- package/lib/cjs/styled/sstyled.js.map +0 -1
- package/lib/cjs/theme/dark.json +0 -2506
- package/lib/cjs/theme/exclude-tokens.json +0 -10
- package/lib/cjs/theme/light.json +0 -2584
- package/lib/cjs/theme/processor.js +0 -315
- package/lib/cjs/theme/processor.js.map +0 -1
- package/lib/cjs/theme/themes/auto.css +0 -1465
- package/lib/cjs/theme/themes/dark.css +0 -723
- package/lib/cjs/theme/themes/dark.js +0 -385
- package/lib/cjs/theme/themes/dark.js.map +0 -1
- package/lib/cjs/theme/themes/default.css +0 -742
- package/lib/cjs/theme/themes/default.js +0 -394
- package/lib/cjs/theme/themes/default.js.map +0 -1
- package/lib/cjs/theme/themes/light.css +0 -742
- package/lib/cjs/theme/themes/light.js +0 -394
- package/lib/cjs/theme/themes/light.js.map +0 -1
- package/lib/cjs/theme/utils.js +0 -297
- package/lib/cjs/theme/utils.js.map +0 -1
- package/lib/cjs/utils/CSSinJS.js +0 -36
- package/lib/cjs/utils/CSSinJS.js.map +0 -1
- package/lib/cjs/utils/ScreenReaderOnly.js +0 -31
- package/lib/cjs/utils/ScreenReaderOnly.js.map +0 -1
- package/lib/cjs/utils/ThemeProvider.js +0 -82
- package/lib/cjs/utils/ThemeProvider.js.map +0 -1
- package/lib/cjs/utils/addonText.js +0 -18
- package/lib/cjs/utils/addonText.js.map +0 -1
- package/lib/cjs/utils/addonTextChildren.js +0 -45
- package/lib/cjs/utils/addonTextChildren.js.map +0 -1
- package/lib/cjs/utils/ariaProps.js +0 -22
- package/lib/cjs/utils/ariaProps.js.map +0 -1
- package/lib/cjs/utils/assignProps.js +0 -93
- package/lib/cjs/utils/assignProps.js.map +0 -1
- package/lib/cjs/utils/canUseDOM.js +0 -10
- package/lib/cjs/utils/canUseDOM.js.map +0 -1
- package/lib/cjs/utils/capitalizeFirstLetter.js +0 -10
- package/lib/cjs/utils/capitalizeFirstLetter.js.map +0 -1
- package/lib/cjs/utils/color.js +0 -208
- package/lib/cjs/utils/color.js.map +0 -1
- package/lib/cjs/utils/compose.js +0 -21
- package/lib/cjs/utils/compose.js.map +0 -1
- package/lib/cjs/utils/createHoc.js +0 -55
- package/lib/cjs/utils/createHoc.js.map +0 -1
- package/lib/cjs/utils/createUUID.js +0 -15
- package/lib/cjs/utils/createUUID.js.map +0 -1
- package/lib/cjs/utils/cssToIntDefault.js +0 -22
- package/lib/cjs/utils/cssToIntDefault.js.map +0 -1
- package/lib/cjs/utils/enhances/WithAutoFocus.js +0 -75
- package/lib/cjs/utils/enhances/WithAutoFocus.js.map +0 -1
- package/lib/cjs/utils/enhances/WithCSS.js +0 -93
- package/lib/cjs/utils/enhances/WithCSS.js.map +0 -1
- package/lib/cjs/utils/enhances/WithI18n.js +0 -95
- package/lib/cjs/utils/enhances/WithI18n.js.map +0 -1
- package/lib/cjs/utils/enhances/WithKeyboardFocus.js +0 -93
- package/lib/cjs/utils/enhances/WithKeyboardFocus.js.map +0 -1
- package/lib/cjs/utils/enhances/WithRef.js +0 -26
- package/lib/cjs/utils/enhances/WithRef.js.map +0 -1
- package/lib/cjs/utils/enhances/a11yEnhance.js +0 -74
- package/lib/cjs/utils/enhances/a11yEnhance.js.map +0 -1
- package/lib/cjs/utils/enhances/animatedSizeEnhance.js +0 -98
- package/lib/cjs/utils/enhances/animatedSizeEnhance.js.map +0 -1
- package/lib/cjs/utils/enhances/autoFocusEnhance.js +0 -46
- package/lib/cjs/utils/enhances/autoFocusEnhance.js.map +0 -1
- package/lib/cjs/utils/enhances/contextEnhance.js +0 -22
- package/lib/cjs/utils/enhances/contextEnhance.js.map +0 -1
- package/lib/cjs/utils/enhances/i18nEnhance.js +0 -101
- package/lib/cjs/utils/enhances/i18nEnhance.js.map +0 -1
- package/lib/cjs/utils/enhances/keyboardFocusEnhance.js +0 -63
- package/lib/cjs/utils/enhances/keyboardFocusEnhance.js.map +0 -1
- package/lib/cjs/utils/enhances/resolveColorEnhance.js +0 -25
- package/lib/cjs/utils/enhances/resolveColorEnhance.js.map +0 -1
- package/lib/cjs/utils/eventEmitter.js +0 -41
- package/lib/cjs/utils/eventEmitter.js.map +0 -1
- package/lib/cjs/utils/findComponent.js +0 -106
- package/lib/cjs/utils/findComponent.js.map +0 -1
- package/lib/cjs/utils/fire.js +0 -23
- package/lib/cjs/utils/fire.js.map +0 -1
- package/lib/cjs/utils/focus-lock/focusBorders.js +0 -72
- package/lib/cjs/utils/focus-lock/focusBorders.js.map +0 -1
- package/lib/cjs/utils/focus-lock/getFocusableIn.js +0 -26
- package/lib/cjs/utils/focus-lock/getFocusableIn.js.map +0 -1
- package/lib/cjs/utils/focus-lock/isFocusInside.js +0 -16
- package/lib/cjs/utils/focus-lock/isFocusInside.js.map +0 -1
- package/lib/cjs/utils/focus-lock/isFocusable.js +0 -51
- package/lib/cjs/utils/focus-lock/isFocusable.js.map +0 -1
- package/lib/cjs/utils/focus-lock/setFocus.js +0 -63
- package/lib/cjs/utils/focus-lock/setFocus.js.map +0 -1
- package/lib/cjs/utils/getAccessibleName.js +0 -56
- package/lib/cjs/utils/getAccessibleName.js.map +0 -1
- package/lib/cjs/utils/getDisplayName.js +0 -10
- package/lib/cjs/utils/getDisplayName.js.map +0 -1
- package/lib/cjs/utils/getEventTarget.js +0 -53
- package/lib/cjs/utils/getEventTarget.js.map +0 -1
- package/lib/cjs/utils/getOriginChildren.js +0 -18
- package/lib/cjs/utils/getOriginChildren.js.map +0 -1
- package/lib/cjs/utils/getRandomInt.js +0 -11
- package/lib/cjs/utils/getRandomInt.js.map +0 -1
- package/lib/cjs/utils/getValue.js +0 -16
- package/lib/cjs/utils/getValue.js.map +0 -1
- package/lib/cjs/utils/hasLabels.js +0 -47
- package/lib/cjs/utils/hasLabels.js.map +0 -1
- package/lib/cjs/utils/hasParent.js +0 -14
- package/lib/cjs/utils/hasParent.js.map +0 -1
- package/lib/cjs/utils/if.js +0 -16
- package/lib/cjs/utils/if.js.map +0 -1
- package/lib/cjs/utils/ifChildren.js +0 -17
- package/lib/cjs/utils/ifChildren.js.map +0 -1
- package/lib/cjs/utils/injectStyle.js +0 -49
- package/lib/cjs/utils/injectStyle.js.map +0 -1
- package/lib/cjs/utils/inputProps.js +0 -22
- package/lib/cjs/utils/inputProps.js.map +0 -1
- package/lib/cjs/utils/isNode.js +0 -28
- package/lib/cjs/utils/isNode.js.map +0 -1
- package/lib/cjs/utils/isPromise.js +0 -10
- package/lib/cjs/utils/isPromise.js.map +0 -1
- package/lib/cjs/utils/isRetina.js +0 -15
- package/lib/cjs/utils/isRetina.js.map +0 -1
- package/lib/cjs/utils/logger.js +0 -40
- package/lib/cjs/utils/logger.js.map +0 -1
- package/lib/cjs/utils/numericChecker.js +0 -33
- package/lib/cjs/utils/numericChecker.js.map +0 -1
- package/lib/cjs/utils/ownerDocument.js +0 -10
- package/lib/cjs/utils/ownerDocument.js.map +0 -1
- package/lib/cjs/utils/pick.js +0 -19
- package/lib/cjs/utils/pick.js.map +0 -1
- package/lib/cjs/utils/propsForElement.js +0 -59
- package/lib/cjs/utils/propsForElement.js.map +0 -1
- package/lib/cjs/utils/rafTrottle.js +0 -33
- package/lib/cjs/utils/rafTrottle.js.map +0 -1
- package/lib/cjs/utils/reactToText.js +0 -33
- package/lib/cjs/utils/reactToText.js.map +0 -1
- package/lib/cjs/utils/ref.js +0 -95
- package/lib/cjs/utils/ref.js.map +0 -1
- package/lib/cjs/utils/setRef.js +0 -10
- package/lib/cjs/utils/setRef.js.map +0 -1
- package/lib/cjs/utils/syncScroll.js +0 -61
- package/lib/cjs/utils/syncScroll.js.map +0 -1
- package/lib/cjs/utils/uncontroll.js +0 -47
- package/lib/cjs/utils/uncontroll.js.map +0 -1
- package/lib/cjs/utils/uniqueID.js +0 -42
- package/lib/cjs/utils/uniqueID.js.map +0 -1
- package/lib/cjs/utils/use/useColorResolver.js +0 -208
- package/lib/cjs/utils/use/useColorResolver.js.map +0 -1
- package/lib/cjs/utils/use/useCss.js +0 -20
- package/lib/cjs/utils/use/useCss.js.map +0 -1
- package/lib/cjs/utils/use/useEnhancedEffect.js +0 -13
- package/lib/cjs/utils/use/useEnhancedEffect.js.map +0 -1
- package/lib/cjs/utils/use/useEventCallback.js +0 -25
- package/lib/cjs/utils/use/useEventCallback.js.map +0 -1
- package/lib/cjs/utils/use/useEventListener.js +0 -33
- package/lib/cjs/utils/use/useEventListener.js.map +0 -1
- package/lib/cjs/utils/use/useFocusLock.js +0 -289
- package/lib/cjs/utils/use/useFocusLock.js.map +0 -1
- package/lib/cjs/utils/use/usePreventScroll.js +0 -78
- package/lib/cjs/utils/use/usePreventScroll.js.map +0 -1
- package/lib/cjs/utils/useCssVariable.js +0 -55
- package/lib/cjs/utils/useCssVariable.js.map +0 -1
- package/lib/cjs/utils/zIndexStacking.js +0 -48
- package/lib/cjs/utils/zIndexStacking.js.map +0 -1
- package/lib/core-types/Component.js +0 -59
- package/lib/core-types/Component.js.map +0 -1
- package/lib/core-types/Component.mjs.map +0 -1
- package/lib/core-types/UnknownProperties.js +0 -2
- package/lib/core-types/UnknownProperties.js.map +0 -1
- package/lib/core-types/UnknownProperties.mjs +0 -3
- package/lib/core-types/UnknownProperties.mjs.map +0 -1
- package/lib/core-types/reshadow.d.js +0 -2
- package/lib/core-types/reshadow.d.js.map +0 -1
- package/lib/core-types/reshadow.d.mjs +0 -2
- package/lib/core-types/reshadow.d.mjs.map +0 -1
- package/lib/core-types/symbols.js +0 -25
- package/lib/core-types/symbols.js.map +0 -1
- package/lib/core-types/symbols.mjs.map +0 -1
- package/lib/enhancement/Children.js +0 -119
- package/lib/enhancement/Children.js.map +0 -1
- package/lib/enhancement/Children.mjs.map +0 -1
- package/lib/enhancement/Root.js +0 -78
- package/lib/enhancement/Root.js.map +0 -1
- package/lib/enhancement/Root.mjs.map +0 -1
- package/lib/enhancement/bindHandler.js +0 -54
- package/lib/enhancement/bindHandler.js.map +0 -1
- package/lib/enhancement/bindHandler.mjs.map +0 -1
- package/lib/enhancement/dataName.js +0 -20
- package/lib/enhancement/dataName.js.map +0 -1
- package/lib/enhancement/dataName.mjs.map +0 -1
- package/lib/enhancement/enhance.js +0 -22
- package/lib/enhancement/enhance.js.map +0 -1
- package/lib/enhancement/enhance.mjs.map +0 -1
- package/lib/enhancement/functionDefaultProps.js +0 -36
- package/lib/enhancement/functionDefaultProps.js.map +0 -1
- package/lib/enhancement/functionDefaultProps.mjs.map +0 -1
- package/lib/enhancement/hoistProps.js +0 -97
- package/lib/enhancement/hoistProps.js.map +0 -1
- package/lib/enhancement/hoistProps.mjs.map +0 -1
- package/lib/enhancement/i18n.js +0 -28
- package/lib/enhancement/i18n.js.map +0 -1
- package/lib/enhancement/i18n.mjs.map +0 -1
- package/lib/enhancement/inheritedName.js +0 -23
- package/lib/enhancement/inheritedName.js.map +0 -1
- package/lib/enhancement/inheritedName.mjs.map +0 -1
- package/lib/enhancement/staticChildren.js +0 -135
- package/lib/enhancement/staticChildren.js.map +0 -1
- package/lib/enhancement/staticChildren.mjs.map +0 -1
- package/lib/enhancement/style.js +0 -60
- package/lib/enhancement/style.js.map +0 -1
- package/lib/enhancement/style.mjs.map +0 -1
- package/lib/enhancement/uncontrolledProps.js +0 -131
- package/lib/enhancement/uncontrolledProps.js.map +0 -1
- package/lib/enhancement/uncontrolledProps.mjs.map +0 -1
- package/lib/es6/LastInteractionType.js +0 -49
- package/lib/es6/LastInteractionType.js.map +0 -1
- package/lib/es6/core-types/Component.js +0 -54
- package/lib/es6/core-types/Component.js.map +0 -1
- package/lib/es6/core-types/UnknownProperties.js +0 -2
- package/lib/es6/core-types/UnknownProperties.js.map +0 -1
- package/lib/es6/core-types/reshadow.d.js +0 -2
- package/lib/es6/core-types/reshadow.d.js.map +0 -1
- package/lib/es6/core-types/symbols.js +0 -10
- package/lib/es6/core-types/symbols.js.map +0 -1
- package/lib/es6/coreFactory.js +0 -343
- package/lib/es6/coreFactory.js.map +0 -1
- package/lib/es6/enhancement/Children.js +0 -111
- package/lib/es6/enhancement/Children.js.map +0 -1
- package/lib/es6/enhancement/Root.js +0 -70
- package/lib/es6/enhancement/Root.js.map +0 -1
- package/lib/es6/enhancement/bindHandler.js +0 -47
- package/lib/es6/enhancement/bindHandler.js.map +0 -1
- package/lib/es6/enhancement/dataName.js +0 -12
- package/lib/es6/enhancement/dataName.js.map +0 -1
- package/lib/es6/enhancement/enhance.js +0 -15
- package/lib/es6/enhancement/enhance.js.map +0 -1
- package/lib/es6/enhancement/functionDefaultProps.js +0 -29
- package/lib/es6/enhancement/functionDefaultProps.js.map +0 -1
- package/lib/es6/enhancement/hoistProps.js +0 -88
- package/lib/es6/enhancement/hoistProps.js.map +0 -1
- package/lib/es6/enhancement/i18n.js +0 -20
- package/lib/es6/enhancement/i18n.js.map +0 -1
- package/lib/es6/enhancement/inheritedName.js +0 -15
- package/lib/es6/enhancement/inheritedName.js.map +0 -1
- package/lib/es6/enhancement/staticChildren.js +0 -123
- package/lib/es6/enhancement/staticChildren.js.map +0 -1
- package/lib/es6/enhancement/style.js +0 -51
- package/lib/es6/enhancement/style.js.map +0 -1
- package/lib/es6/enhancement/uncontrolledProps.js +0 -123
- package/lib/es6/enhancement/uncontrolledProps.js.map +0 -1
- package/lib/es6/index.js +0 -9
- package/lib/es6/index.js.map +0 -1
- package/lib/es6/register.js +0 -29
- package/lib/es6/register.js.map +0 -1
- package/lib/es6/styled/index.js +0 -6
- package/lib/es6/styled/index.js.map +0 -1
- package/lib/es6/styled/reshadow-core.js +0 -243
- package/lib/es6/styled/reshadow-core.js.map +0 -1
- package/lib/es6/styled/sstyled.js +0 -142
- package/lib/es6/styled/sstyled.js.map +0 -1
- package/lib/es6/theme/dark.json +0 -2506
- package/lib/es6/theme/exclude-tokens.json +0 -10
- package/lib/es6/theme/light.json +0 -2584
- package/lib/es6/theme/processor.js +0 -307
- package/lib/es6/theme/processor.js.map +0 -1
- package/lib/es6/theme/themes/auto.css +0 -1465
- package/lib/es6/theme/themes/dark.css +0 -723
- package/lib/es6/theme/themes/dark.js +0 -378
- package/lib/es6/theme/themes/dark.js.map +0 -1
- package/lib/es6/theme/themes/default.css +0 -742
- package/lib/es6/theme/themes/default.js +0 -387
- package/lib/es6/theme/themes/default.js.map +0 -1
- package/lib/es6/theme/themes/light.css +0 -742
- package/lib/es6/theme/themes/light.js +0 -387
- package/lib/es6/theme/themes/light.js.map +0 -1
- package/lib/es6/theme/utils.js +0 -286
- package/lib/es6/theme/utils.js.map +0 -1
- package/lib/es6/utils/CSSinJS.js +0 -28
- package/lib/es6/utils/CSSinJS.js.map +0 -1
- package/lib/es6/utils/ScreenReaderOnly.js +0 -24
- package/lib/es6/utils/ScreenReaderOnly.js.map +0 -1
- package/lib/es6/utils/ThemeProvider.js +0 -71
- package/lib/es6/utils/ThemeProvider.js.map +0 -1
- package/lib/es6/utils/addonText.js +0 -11
- package/lib/es6/utils/addonText.js.map +0 -1
- package/lib/es6/utils/addonTextChildren.js +0 -37
- package/lib/es6/utils/addonTextChildren.js.map +0 -1
- package/lib/es6/utils/ariaProps.js +0 -16
- package/lib/es6/utils/ariaProps.js.map +0 -1
- package/lib/es6/utils/assignProps.js +0 -84
- package/lib/es6/utils/assignProps.js.map +0 -1
- package/lib/es6/utils/canUseDOM.js +0 -4
- package/lib/es6/utils/canUseDOM.js.map +0 -1
- package/lib/es6/utils/capitalizeFirstLetter.js +0 -4
- package/lib/es6/utils/capitalizeFirstLetter.js.map +0 -1
- package/lib/es6/utils/color.js +0 -196
- package/lib/es6/utils/color.js.map +0 -1
- package/lib/es6/utils/compose.js +0 -15
- package/lib/es6/utils/compose.js.map +0 -1
- package/lib/es6/utils/createHoc.js +0 -46
- package/lib/es6/utils/createHoc.js.map +0 -1
- package/lib/es6/utils/createUUID.js +0 -9
- package/lib/es6/utils/createUUID.js.map +0 -1
- package/lib/es6/utils/cssToIntDefault.js +0 -16
- package/lib/es6/utils/cssToIntDefault.js.map +0 -1
- package/lib/es6/utils/enhances/WithAutoFocus.js +0 -67
- package/lib/es6/utils/enhances/WithAutoFocus.js.map +0 -1
- package/lib/es6/utils/enhances/WithCSS.js +0 -79
- package/lib/es6/utils/enhances/WithCSS.js.map +0 -1
- package/lib/es6/utils/enhances/WithI18n.js +0 -83
- package/lib/es6/utils/enhances/WithI18n.js.map +0 -1
- package/lib/es6/utils/enhances/WithKeyboardFocus.js +0 -84
- package/lib/es6/utils/enhances/WithKeyboardFocus.js.map +0 -1
- package/lib/es6/utils/enhances/WithRef.js +0 -18
- package/lib/es6/utils/enhances/WithRef.js.map +0 -1
- package/lib/es6/utils/enhances/a11yEnhance.js +0 -66
- package/lib/es6/utils/enhances/a11yEnhance.js.map +0 -1
- package/lib/es6/utils/enhances/animatedSizeEnhance.js +0 -90
- package/lib/es6/utils/enhances/animatedSizeEnhance.js.map +0 -1
- package/lib/es6/utils/enhances/autoFocusEnhance.js +0 -38
- package/lib/es6/utils/enhances/autoFocusEnhance.js.map +0 -1
- package/lib/es6/utils/enhances/contextEnhance.js +0 -14
- package/lib/es6/utils/enhances/contextEnhance.js.map +0 -1
- package/lib/es6/utils/enhances/i18nEnhance.js +0 -92
- package/lib/es6/utils/enhances/i18nEnhance.js.map +0 -1
- package/lib/es6/utils/enhances/keyboardFocusEnhance.js +0 -57
- package/lib/es6/utils/enhances/keyboardFocusEnhance.js.map +0 -1
- package/lib/es6/utils/enhances/resolveColorEnhance.js +0 -17
- package/lib/es6/utils/enhances/resolveColorEnhance.js.map +0 -1
- package/lib/es6/utils/eventEmitter.js +0 -34
- package/lib/es6/utils/eventEmitter.js.map +0 -1
- package/lib/es6/utils/findComponent.js +0 -95
- package/lib/es6/utils/findComponent.js.map +0 -1
- package/lib/es6/utils/fire.js +0 -15
- package/lib/es6/utils/fire.js.map +0 -1
- package/lib/es6/utils/focus-lock/focusBorders.js +0 -62
- package/lib/es6/utils/focus-lock/focusBorders.js.map +0 -1
- package/lib/es6/utils/focus-lock/getFocusableIn.js +0 -19
- package/lib/es6/utils/focus-lock/getFocusableIn.js.map +0 -1
- package/lib/es6/utils/focus-lock/isFocusInside.js +0 -9
- package/lib/es6/utils/focus-lock/isFocusInside.js.map +0 -1
- package/lib/es6/utils/focus-lock/isFocusable.js +0 -43
- package/lib/es6/utils/focus-lock/isFocusable.js.map +0 -1
- package/lib/es6/utils/focus-lock/setFocus.js +0 -55
- package/lib/es6/utils/focus-lock/setFocus.js.map +0 -1
- package/lib/es6/utils/getAccessibleName.js +0 -49
- package/lib/es6/utils/getAccessibleName.js.map +0 -1
- package/lib/es6/utils/getDisplayName.js +0 -4
- package/lib/es6/utils/getDisplayName.js.map +0 -1
- package/lib/es6/utils/getEventTarget.js +0 -45
- package/lib/es6/utils/getEventTarget.js.map +0 -1
- package/lib/es6/utils/getOriginChildren.js +0 -10
- package/lib/es6/utils/getOriginChildren.js.map +0 -1
- package/lib/es6/utils/getRandomInt.js +0 -5
- package/lib/es6/utils/getRandomInt.js.map +0 -1
- package/lib/es6/utils/getValue.js +0 -10
- package/lib/es6/utils/getValue.js.map +0 -1
- package/lib/es6/utils/hasLabels.js +0 -39
- package/lib/es6/utils/hasLabels.js.map +0 -1
- package/lib/es6/utils/hasParent.js +0 -7
- package/lib/es6/utils/hasParent.js.map +0 -1
- package/lib/es6/utils/if.js +0 -9
- package/lib/es6/utils/if.js.map +0 -1
- package/lib/es6/utils/ifChildren.js +0 -10
- package/lib/es6/utils/ifChildren.js.map +0 -1
- package/lib/es6/utils/injectStyle.js +0 -41
- package/lib/es6/utils/injectStyle.js.map +0 -1
- package/lib/es6/utils/inputProps.js +0 -14
- package/lib/es6/utils/inputProps.js.map +0 -1
- package/lib/es6/utils/isNode.js +0 -21
- package/lib/es6/utils/isNode.js.map +0 -1
- package/lib/es6/utils/isPromise.js +0 -4
- package/lib/es6/utils/isPromise.js.map +0 -1
- package/lib/es6/utils/isRetina.js +0 -9
- package/lib/es6/utils/isRetina.js.map +0 -1
- package/lib/es6/utils/logger.js +0 -32
- package/lib/es6/utils/logger.js.map +0 -1
- package/lib/es6/utils/numericChecker.js +0 -27
- package/lib/es6/utils/numericChecker.js.map +0 -1
- package/lib/es6/utils/ownerDocument.js +0 -4
- package/lib/es6/utils/ownerDocument.js.map +0 -1
- package/lib/es6/utils/pick.js +0 -13
- package/lib/es6/utils/pick.js.map +0 -1
- package/lib/es6/utils/propsForElement.js +0 -50
- package/lib/es6/utils/propsForElement.js.map +0 -1
- package/lib/es6/utils/rafTrottle.js +0 -26
- package/lib/es6/utils/rafTrottle.js.map +0 -1
- package/lib/es6/utils/reactToText.js +0 -26
- package/lib/es6/utils/reactToText.js.map +0 -1
- package/lib/es6/utils/ref.js +0 -83
- package/lib/es6/utils/ref.js.map +0 -1
- package/lib/es6/utils/setRef.js +0 -3
- package/lib/es6/utils/setRef.js.map +0 -1
- package/lib/es6/utils/syncScroll.js +0 -54
- package/lib/es6/utils/syncScroll.js.map +0 -1
- package/lib/es6/utils/uncontroll.js +0 -38
- package/lib/es6/utils/uncontroll.js.map +0 -1
- package/lib/es6/utils/uniqueID.js +0 -33
- package/lib/es6/utils/uniqueID.js.map +0 -1
- package/lib/es6/utils/use/useColorResolver.js +0 -200
- package/lib/es6/utils/use/useColorResolver.js.map +0 -1
- package/lib/es6/utils/use/useCss.js +0 -12
- package/lib/es6/utils/use/useCss.js.map +0 -1
- package/lib/es6/utils/use/useEnhancedEffect.js +0 -5
- package/lib/es6/utils/use/useEnhancedEffect.js.map +0 -1
- package/lib/es6/utils/use/useEventCallback.js +0 -19
- package/lib/es6/utils/use/useEventCallback.js.map +0 -1
- package/lib/es6/utils/use/useEventListener.js +0 -25
- package/lib/es6/utils/use/useEventListener.js.map +0 -1
- package/lib/es6/utils/use/useFocusLock.js +0 -266
- package/lib/es6/utils/use/useFocusLock.js.map +0 -1
- package/lib/es6/utils/use/usePreventScroll.js +0 -70
- package/lib/es6/utils/use/usePreventScroll.js.map +0 -1
- package/lib/es6/utils/useCssVariable.js +0 -46
- package/lib/es6/utils/useCssVariable.js.map +0 -1
- package/lib/es6/utils/zIndexStacking.js +0 -38
- package/lib/es6/utils/zIndexStacking.js.map +0 -1
- package/lib/register.js +0 -37
- package/lib/register.js.map +0 -1
- package/lib/register.mjs.map +0 -1
- package/lib/styled/index.js +0 -32
- package/lib/styled/index.js.map +0 -1
- package/lib/styled/index.mjs +0 -6
- package/lib/styled/index.mjs.map +0 -1
- package/lib/styled/reshadow-core.js +0 -256
- package/lib/styled/reshadow-core.js.map +0 -1
- package/lib/styled/reshadow-core.mjs.map +0 -1
- package/lib/styled/sstyled.js +0 -149
- package/lib/styled/sstyled.js.map +0 -1
- package/lib/styled/sstyled.mjs.map +0 -1
- package/lib/theme/processor.js +0 -315
- package/lib/theme/processor.js.map +0 -1
- package/lib/theme/processor.mjs +0 -307
- package/lib/theme/processor.mjs.map +0 -1
- package/lib/theme/themes/dark.js +0 -385
- package/lib/theme/themes/dark.js.map +0 -1
- package/lib/theme/themes/dark.mjs +0 -378
- package/lib/theme/themes/dark.mjs.map +0 -1
- package/lib/theme/themes/default.js +0 -394
- package/lib/theme/themes/default.js.map +0 -1
- package/lib/theme/themes/default.mjs +0 -387
- package/lib/theme/themes/default.mjs.map +0 -1
- package/lib/theme/themes/light.js +0 -394
- package/lib/theme/themes/light.js.map +0 -1
- package/lib/theme/themes/light.mjs +0 -387
- package/lib/theme/themes/light.mjs.map +0 -1
- package/lib/theme/utils.js +0 -297
- package/lib/theme/utils.js.map +0 -1
- package/lib/theme/utils.mjs +0 -286
- package/lib/theme/utils.mjs.map +0 -1
- package/lib/types/LastInteractionType.d.ts +0 -11
- package/lib/types/core-types/UnknownProperties.d.ts +0 -3
- package/lib/types/core-types/symbols.d.ts +0 -9
- package/lib/types/register.d.ts +0 -8
- package/lib/types/styled/index.d.ts +0 -11
- package/lib/types/styled/reshadow-core.d.ts +0 -37
- package/lib/types/styled/sstyled.d.ts +0 -17
- package/lib/types/theme/themes/default.d.ts +0 -387
- package/lib/types/utils/CSSinJS.d.ts +0 -5
- package/lib/types/utils/ScreenReaderOnly.d.ts +0 -8
- package/lib/types/utils/ThemeProvider.d.ts +0 -15
- package/lib/types/utils/addonText.d.ts +0 -2
- package/lib/types/utils/addonTextChildren.d.ts +0 -3
- package/lib/types/utils/ariaProps.d.ts +0 -12
- package/lib/types/utils/assignProps.d.ts +0 -11
- package/lib/types/utils/canUseDOM.d.ts +0 -1
- package/lib/types/utils/capitalizeFirstLetter.d.ts +0 -1
- package/lib/types/utils/color.d.ts +0 -5
- package/lib/types/utils/compose.d.ts +0 -1
- package/lib/types/utils/createHoc.d.ts +0 -3
- package/lib/types/utils/createUUID.d.ts +0 -1
- package/lib/types/utils/cssToIntDefault.d.ts +0 -8
- package/lib/types/utils/enhances/WithAutoFocus.d.ts +0 -14
- package/lib/types/utils/enhances/WithCSS.d.ts +0 -41
- package/lib/types/utils/enhances/WithI18n.d.ts +0 -43
- package/lib/types/utils/enhances/WithKeyboardFocus.d.ts +0 -45
- package/lib/types/utils/enhances/WithRef.d.ts +0 -3
- package/lib/types/utils/enhances/a11yEnhance.d.ts +0 -10
- package/lib/types/utils/enhances/animatedSizeEnhance.d.ts +0 -12
- package/lib/types/utils/enhances/autoFocusEnhance.d.ts +0 -10
- package/lib/types/utils/enhances/contextEnhance.d.ts +0 -3
- package/lib/types/utils/enhances/i18nEnhance.d.ts +0 -25
- package/lib/types/utils/enhances/keyboardFocusEnhance.d.ts +0 -27
- package/lib/types/utils/enhances/resolveColorEnhance.d.ts +0 -2
- package/lib/types/utils/eventEmitter.d.ts +0 -9
- package/lib/types/utils/findComponent.d.ts +0 -12
- package/lib/types/utils/fire.d.ts +0 -2
- package/lib/types/utils/focus-lock/focusBorders.d.ts +0 -4
- package/lib/types/utils/focus-lock/getFocusableIn.d.ts +0 -1
- package/lib/types/utils/focus-lock/isFocusInside.d.ts +0 -1
- package/lib/types/utils/focus-lock/isFocusable.d.ts +0 -1
- package/lib/types/utils/focus-lock/setFocus.d.ts +0 -1
- package/lib/types/utils/getAccessibleName.d.ts +0 -1
- package/lib/types/utils/getDisplayName.d.ts +0 -2
- package/lib/types/utils/getEventTarget.d.ts +0 -1
- package/lib/types/utils/getOriginChildren.d.ts +0 -2
- package/lib/types/utils/getRandomInt.d.ts +0 -1
- package/lib/types/utils/getValue.d.ts +0 -1
- package/lib/types/utils/hasLabels.d.ts +0 -7
- package/lib/types/utils/hasParent.d.ts +0 -1
- package/lib/types/utils/if.d.ts +0 -11
- package/lib/types/utils/ifChildren.d.ts +0 -8
- package/lib/types/utils/injectStyle.d.ts +0 -2
- package/lib/types/utils/inputProps.d.ts +0 -2
- package/lib/types/utils/isNode.d.ts +0 -1
- package/lib/types/utils/isPromise.d.ts +0 -1
- package/lib/types/utils/isRetina.d.ts +0 -1
- package/lib/types/utils/logger.d.ts +0 -9
- package/lib/types/utils/numericChecker.d.ts +0 -5
- package/lib/types/utils/ownerDocument.d.ts +0 -1
- package/lib/types/utils/pick.d.ts +0 -1
- package/lib/types/utils/propsForElement.d.ts +0 -3
- package/lib/types/utils/rafTrottle.d.ts +0 -2
- package/lib/types/utils/reactToText.d.ts +0 -3
- package/lib/types/utils/ref.d.ts +0 -8
- package/lib/types/utils/setRef.d.ts +0 -2
- package/lib/types/utils/syncScroll.d.ts +0 -1
- package/lib/types/utils/uncontroll.d.ts +0 -4
- package/lib/types/utils/uniqueID.d.ts +0 -12
- package/lib/types/utils/use/useColorResolver.d.ts +0 -1
- package/lib/types/utils/use/useCss.d.ts +0 -4
- package/lib/types/utils/use/useEnhancedEffect.d.ts +0 -3
- package/lib/types/utils/use/useEventCallback.d.ts +0 -4
- package/lib/types/utils/use/useEventListener.d.ts +0 -2
- package/lib/types/utils/use/useFocusLock.d.ts +0 -10
- package/lib/types/utils/use/usePreventScroll.d.ts +0 -2
- package/lib/types/utils/useCssVariable.d.ts +0 -8
- package/lib/types/utils/zIndexStacking.d.ts +0 -8
- package/lib/utils/CSSinJS.js +0 -36
- package/lib/utils/CSSinJS.js.map +0 -1
- package/lib/utils/CSSinJS.mjs +0 -28
- package/lib/utils/CSSinJS.mjs.map +0 -1
- package/lib/utils/ScreenReaderOnly.js +0 -31
- package/lib/utils/ScreenReaderOnly.js.map +0 -1
- package/lib/utils/ScreenReaderOnly.mjs +0 -24
- package/lib/utils/ScreenReaderOnly.mjs.map +0 -1
- package/lib/utils/ThemeProvider.js +0 -82
- package/lib/utils/ThemeProvider.js.map +0 -1
- package/lib/utils/ThemeProvider.mjs +0 -71
- package/lib/utils/ThemeProvider.mjs.map +0 -1
- package/lib/utils/addonText.js +0 -18
- package/lib/utils/addonText.js.map +0 -1
- package/lib/utils/addonText.mjs +0 -11
- package/lib/utils/addonText.mjs.map +0 -1
- package/lib/utils/addonTextChildren.js +0 -45
- package/lib/utils/addonTextChildren.js.map +0 -1
- package/lib/utils/addonTextChildren.mjs +0 -37
- package/lib/utils/addonTextChildren.mjs.map +0 -1
- package/lib/utils/ariaProps.js +0 -22
- package/lib/utils/ariaProps.js.map +0 -1
- package/lib/utils/ariaProps.mjs +0 -16
- package/lib/utils/ariaProps.mjs.map +0 -1
- package/lib/utils/assignProps.js +0 -93
- package/lib/utils/assignProps.js.map +0 -1
- package/lib/utils/assignProps.mjs.map +0 -1
- package/lib/utils/canUseDOM.js +0 -10
- package/lib/utils/canUseDOM.js.map +0 -1
- package/lib/utils/canUseDOM.mjs.map +0 -1
- package/lib/utils/capitalizeFirstLetter.js +0 -10
- package/lib/utils/capitalizeFirstLetter.js.map +0 -1
- package/lib/utils/capitalizeFirstLetter.mjs.map +0 -1
- package/lib/utils/color.js +0 -208
- package/lib/utils/color.js.map +0 -1
- package/lib/utils/color.mjs +0 -196
- package/lib/utils/color.mjs.map +0 -1
- package/lib/utils/compose.js +0 -21
- package/lib/utils/compose.js.map +0 -1
- package/lib/utils/compose.mjs +0 -15
- package/lib/utils/compose.mjs.map +0 -1
- package/lib/utils/createHoc.js +0 -55
- package/lib/utils/createHoc.js.map +0 -1
- package/lib/utils/createHoc.mjs +0 -46
- package/lib/utils/createHoc.mjs.map +0 -1
- package/lib/utils/createUUID.js +0 -15
- package/lib/utils/createUUID.js.map +0 -1
- package/lib/utils/createUUID.mjs +0 -9
- package/lib/utils/createUUID.mjs.map +0 -1
- package/lib/utils/cssToIntDefault.js +0 -22
- package/lib/utils/cssToIntDefault.js.map +0 -1
- package/lib/utils/cssToIntDefault.mjs +0 -16
- package/lib/utils/cssToIntDefault.mjs.map +0 -1
- package/lib/utils/enhances/WithAutoFocus.js +0 -75
- package/lib/utils/enhances/WithAutoFocus.js.map +0 -1
- package/lib/utils/enhances/WithAutoFocus.mjs +0 -67
- package/lib/utils/enhances/WithAutoFocus.mjs.map +0 -1
- package/lib/utils/enhances/WithCSS.js +0 -93
- package/lib/utils/enhances/WithCSS.js.map +0 -1
- package/lib/utils/enhances/WithCSS.mjs +0 -79
- package/lib/utils/enhances/WithCSS.mjs.map +0 -1
- package/lib/utils/enhances/WithI18n.js +0 -95
- package/lib/utils/enhances/WithI18n.js.map +0 -1
- package/lib/utils/enhances/WithI18n.mjs.map +0 -1
- package/lib/utils/enhances/WithKeyboardFocus.js +0 -93
- package/lib/utils/enhances/WithKeyboardFocus.js.map +0 -1
- package/lib/utils/enhances/WithKeyboardFocus.mjs +0 -84
- package/lib/utils/enhances/WithKeyboardFocus.mjs.map +0 -1
- package/lib/utils/enhances/WithRef.js +0 -26
- package/lib/utils/enhances/WithRef.js.map +0 -1
- package/lib/utils/enhances/WithRef.mjs +0 -18
- package/lib/utils/enhances/WithRef.mjs.map +0 -1
- package/lib/utils/enhances/a11yEnhance.js +0 -74
- package/lib/utils/enhances/a11yEnhance.js.map +0 -1
- package/lib/utils/enhances/a11yEnhance.mjs +0 -66
- package/lib/utils/enhances/a11yEnhance.mjs.map +0 -1
- package/lib/utils/enhances/animatedSizeEnhance.js +0 -98
- package/lib/utils/enhances/animatedSizeEnhance.js.map +0 -1
- package/lib/utils/enhances/animatedSizeEnhance.mjs +0 -90
- package/lib/utils/enhances/animatedSizeEnhance.mjs.map +0 -1
- package/lib/utils/enhances/autoFocusEnhance.js +0 -46
- package/lib/utils/enhances/autoFocusEnhance.js.map +0 -1
- package/lib/utils/enhances/autoFocusEnhance.mjs +0 -38
- package/lib/utils/enhances/autoFocusEnhance.mjs.map +0 -1
- package/lib/utils/enhances/contextEnhance.js +0 -22
- package/lib/utils/enhances/contextEnhance.js.map +0 -1
- package/lib/utils/enhances/contextEnhance.mjs +0 -14
- package/lib/utils/enhances/contextEnhance.mjs.map +0 -1
- package/lib/utils/enhances/i18nEnhance.js +0 -101
- package/lib/utils/enhances/i18nEnhance.js.map +0 -1
- package/lib/utils/enhances/i18nEnhance.mjs +0 -92
- package/lib/utils/enhances/i18nEnhance.mjs.map +0 -1
- package/lib/utils/enhances/keyboardFocusEnhance.js +0 -63
- package/lib/utils/enhances/keyboardFocusEnhance.js.map +0 -1
- package/lib/utils/enhances/keyboardFocusEnhance.mjs +0 -57
- package/lib/utils/enhances/keyboardFocusEnhance.mjs.map +0 -1
- package/lib/utils/enhances/resolveColorEnhance.js +0 -25
- package/lib/utils/enhances/resolveColorEnhance.js.map +0 -1
- package/lib/utils/enhances/resolveColorEnhance.mjs +0 -17
- package/lib/utils/enhances/resolveColorEnhance.mjs.map +0 -1
- package/lib/utils/eventEmitter.js +0 -41
- package/lib/utils/eventEmitter.js.map +0 -1
- package/lib/utils/eventEmitter.mjs +0 -34
- package/lib/utils/eventEmitter.mjs.map +0 -1
- package/lib/utils/findComponent.js +0 -106
- package/lib/utils/findComponent.js.map +0 -1
- package/lib/utils/findComponent.mjs +0 -95
- package/lib/utils/findComponent.mjs.map +0 -1
- package/lib/utils/fire.js +0 -23
- package/lib/utils/fire.js.map +0 -1
- package/lib/utils/fire.mjs +0 -15
- package/lib/utils/fire.mjs.map +0 -1
- package/lib/utils/focus-lock/focusBorders.js +0 -72
- package/lib/utils/focus-lock/focusBorders.js.map +0 -1
- package/lib/utils/focus-lock/focusBorders.mjs +0 -62
- package/lib/utils/focus-lock/focusBorders.mjs.map +0 -1
- package/lib/utils/focus-lock/getFocusableIn.js +0 -26
- package/lib/utils/focus-lock/getFocusableIn.js.map +0 -1
- package/lib/utils/focus-lock/getFocusableIn.mjs +0 -19
- package/lib/utils/focus-lock/getFocusableIn.mjs.map +0 -1
- package/lib/utils/focus-lock/isFocusInside.js +0 -16
- package/lib/utils/focus-lock/isFocusInside.js.map +0 -1
- package/lib/utils/focus-lock/isFocusInside.mjs +0 -9
- package/lib/utils/focus-lock/isFocusInside.mjs.map +0 -1
- package/lib/utils/focus-lock/isFocusable.js +0 -51
- package/lib/utils/focus-lock/isFocusable.js.map +0 -1
- package/lib/utils/focus-lock/isFocusable.mjs +0 -43
- package/lib/utils/focus-lock/isFocusable.mjs.map +0 -1
- package/lib/utils/focus-lock/setFocus.js +0 -63
- package/lib/utils/focus-lock/setFocus.js.map +0 -1
- package/lib/utils/focus-lock/setFocus.mjs +0 -55
- package/lib/utils/focus-lock/setFocus.mjs.map +0 -1
- package/lib/utils/getAccessibleName.js +0 -56
- package/lib/utils/getAccessibleName.js.map +0 -1
- package/lib/utils/getAccessibleName.mjs +0 -49
- package/lib/utils/getAccessibleName.mjs.map +0 -1
- package/lib/utils/getDisplayName.js +0 -10
- package/lib/utils/getDisplayName.js.map +0 -1
- package/lib/utils/getDisplayName.mjs +0 -4
- package/lib/utils/getDisplayName.mjs.map +0 -1
- package/lib/utils/getEventTarget.js +0 -53
- package/lib/utils/getEventTarget.js.map +0 -1
- package/lib/utils/getEventTarget.mjs +0 -45
- package/lib/utils/getEventTarget.mjs.map +0 -1
- package/lib/utils/getOriginChildren.js +0 -18
- package/lib/utils/getOriginChildren.js.map +0 -1
- package/lib/utils/getOriginChildren.mjs +0 -10
- package/lib/utils/getOriginChildren.mjs.map +0 -1
- package/lib/utils/getRandomInt.js +0 -11
- package/lib/utils/getRandomInt.js.map +0 -1
- package/lib/utils/getRandomInt.mjs +0 -5
- package/lib/utils/getRandomInt.mjs.map +0 -1
- package/lib/utils/getValue.js +0 -16
- package/lib/utils/getValue.js.map +0 -1
- package/lib/utils/getValue.mjs +0 -10
- package/lib/utils/getValue.mjs.map +0 -1
- package/lib/utils/hasLabels.js +0 -47
- package/lib/utils/hasLabels.js.map +0 -1
- package/lib/utils/hasLabels.mjs +0 -39
- package/lib/utils/hasLabels.mjs.map +0 -1
- package/lib/utils/hasParent.js +0 -14
- package/lib/utils/hasParent.js.map +0 -1
- package/lib/utils/hasParent.mjs +0 -7
- package/lib/utils/hasParent.mjs.map +0 -1
- package/lib/utils/if.js +0 -16
- package/lib/utils/if.js.map +0 -1
- package/lib/utils/if.mjs +0 -9
- package/lib/utils/if.mjs.map +0 -1
- package/lib/utils/ifChildren.js +0 -17
- package/lib/utils/ifChildren.js.map +0 -1
- package/lib/utils/ifChildren.mjs +0 -10
- package/lib/utils/ifChildren.mjs.map +0 -1
- package/lib/utils/injectStyle.js +0 -49
- package/lib/utils/injectStyle.js.map +0 -1
- package/lib/utils/injectStyle.mjs +0 -41
- package/lib/utils/injectStyle.mjs.map +0 -1
- package/lib/utils/inputProps.js +0 -22
- package/lib/utils/inputProps.js.map +0 -1
- package/lib/utils/inputProps.mjs +0 -14
- package/lib/utils/inputProps.mjs.map +0 -1
- package/lib/utils/isNode.js +0 -28
- package/lib/utils/isNode.js.map +0 -1
- package/lib/utils/isNode.mjs +0 -21
- package/lib/utils/isNode.mjs.map +0 -1
- package/lib/utils/isPromise.js +0 -10
- package/lib/utils/isPromise.js.map +0 -1
- package/lib/utils/isPromise.mjs +0 -4
- package/lib/utils/isPromise.mjs.map +0 -1
- package/lib/utils/isRetina.js +0 -15
- package/lib/utils/isRetina.js.map +0 -1
- package/lib/utils/isRetina.mjs +0 -9
- package/lib/utils/isRetina.mjs.map +0 -1
- package/lib/utils/logger.js +0 -40
- package/lib/utils/logger.js.map +0 -1
- package/lib/utils/logger.mjs.map +0 -1
- package/lib/utils/numericChecker.js +0 -33
- package/lib/utils/numericChecker.js.map +0 -1
- package/lib/utils/numericChecker.mjs +0 -27
- package/lib/utils/numericChecker.mjs.map +0 -1
- package/lib/utils/ownerDocument.js +0 -10
- package/lib/utils/ownerDocument.js.map +0 -1
- package/lib/utils/ownerDocument.mjs +0 -4
- package/lib/utils/ownerDocument.mjs.map +0 -1
- package/lib/utils/pick.js +0 -19
- package/lib/utils/pick.js.map +0 -1
- package/lib/utils/pick.mjs.map +0 -1
- package/lib/utils/propsForElement.js +0 -59
- package/lib/utils/propsForElement.js.map +0 -1
- package/lib/utils/propsForElement.mjs +0 -50
- package/lib/utils/propsForElement.mjs.map +0 -1
- package/lib/utils/rafTrottle.js +0 -33
- package/lib/utils/rafTrottle.js.map +0 -1
- package/lib/utils/rafTrottle.mjs +0 -26
- package/lib/utils/rafTrottle.mjs.map +0 -1
- package/lib/utils/reactToText.js +0 -33
- package/lib/utils/reactToText.js.map +0 -1
- package/lib/utils/reactToText.mjs +0 -26
- package/lib/utils/reactToText.mjs.map +0 -1
- package/lib/utils/ref.js +0 -95
- package/lib/utils/ref.js.map +0 -1
- package/lib/utils/ref.mjs.map +0 -1
- package/lib/utils/setRef.js +0 -10
- package/lib/utils/setRef.js.map +0 -1
- package/lib/utils/setRef.mjs +0 -3
- package/lib/utils/setRef.mjs.map +0 -1
- package/lib/utils/syncScroll.js +0 -61
- package/lib/utils/syncScroll.js.map +0 -1
- package/lib/utils/syncScroll.mjs +0 -54
- package/lib/utils/syncScroll.mjs.map +0 -1
- package/lib/utils/uncontroll.js +0 -47
- package/lib/utils/uncontroll.js.map +0 -1
- package/lib/utils/uncontroll.mjs +0 -38
- package/lib/utils/uncontroll.mjs.map +0 -1
- package/lib/utils/uniqueID.js +0 -42
- package/lib/utils/uniqueID.js.map +0 -1
- package/lib/utils/uniqueID.mjs +0 -33
- package/lib/utils/uniqueID.mjs.map +0 -1
- package/lib/utils/use/useColorResolver.js +0 -208
- package/lib/utils/use/useColorResolver.js.map +0 -1
- package/lib/utils/use/useColorResolver.mjs +0 -200
- package/lib/utils/use/useColorResolver.mjs.map +0 -1
- package/lib/utils/use/useCss.js +0 -20
- package/lib/utils/use/useCss.js.map +0 -1
- package/lib/utils/use/useCss.mjs +0 -12
- package/lib/utils/use/useCss.mjs.map +0 -1
- package/lib/utils/use/useEnhancedEffect.js +0 -13
- package/lib/utils/use/useEnhancedEffect.js.map +0 -1
- package/lib/utils/use/useEnhancedEffect.mjs.map +0 -1
- package/lib/utils/use/useEventCallback.js +0 -25
- package/lib/utils/use/useEventCallback.js.map +0 -1
- package/lib/utils/use/useEventCallback.mjs +0 -19
- package/lib/utils/use/useEventCallback.mjs.map +0 -1
- package/lib/utils/use/useEventListener.js +0 -33
- package/lib/utils/use/useEventListener.js.map +0 -1
- package/lib/utils/use/useEventListener.mjs +0 -25
- package/lib/utils/use/useEventListener.mjs.map +0 -1
- package/lib/utils/use/useFocusLock.js +0 -289
- package/lib/utils/use/useFocusLock.js.map +0 -1
- package/lib/utils/use/useFocusLock.mjs +0 -266
- package/lib/utils/use/useFocusLock.mjs.map +0 -1
- package/lib/utils/use/usePreventScroll.js +0 -78
- package/lib/utils/use/usePreventScroll.js.map +0 -1
- package/lib/utils/use/usePreventScroll.mjs +0 -70
- package/lib/utils/use/usePreventScroll.mjs.map +0 -1
- package/lib/utils/useCssVariable.js +0 -55
- package/lib/utils/useCssVariable.js.map +0 -1
- package/lib/utils/useCssVariable.mjs +0 -46
- package/lib/utils/useCssVariable.mjs.map +0 -1
- package/lib/utils/zIndexStacking.js +0 -48
- package/lib/utils/zIndexStacking.js.map +0 -1
- package/lib/utils/zIndexStacking.mjs +0 -38
- package/lib/utils/zIndexStacking.mjs.map +0 -1
- /package/lib/{types/core-types → core-types}/Component.d.ts +0 -0
- /package/lib/{types/coreFactory.d.ts → coreFactory.d.ts} +0 -0
- /package/lib/{types/enhancement → enhancement}/Children.d.ts +0 -0
- /package/lib/{types/enhancement → enhancement}/Root.d.ts +0 -0
- /package/lib/{types/enhancement → enhancement}/bindHandler.d.ts +0 -0
- /package/lib/{types/enhancement → enhancement}/dataName.d.ts +0 -0
- /package/lib/{types/enhancement → enhancement}/enhance.d.ts +0 -0
- /package/lib/{types/enhancement → enhancement}/functionDefaultProps.d.ts +0 -0
- /package/lib/{types/enhancement → enhancement}/hoistProps.d.ts +0 -0
- /package/lib/{types/enhancement → enhancement}/i18n.d.ts +0 -0
- /package/lib/{types/enhancement → enhancement}/inheritedName.d.ts +0 -0
- /package/lib/{types/enhancement → enhancement}/staticChildren.d.ts +0 -0
- /package/lib/{types/enhancement → enhancement}/style.d.ts +0 -0
- /package/lib/{types/enhancement → enhancement}/uncontrolledProps.d.ts +0 -0
- /package/lib/{types/index.d.ts → index.d.ts} +0 -0
- /package/lib/{types/theme → theme}/processor.d.ts +0 -0
- /package/lib/{types/theme → theme}/themes/dark.d.ts +0 -0
- /package/lib/{types/theme → theme}/themes/light.d.ts +0 -0
- /package/lib/{types/theme → theme}/utils.d.ts +0 -0
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
|
-
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
3
|
-
import _objectSpread from "@babel/runtime/helpers/objectSpread2";
|
|
4
|
-
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
5
|
-
import React from
|
|
1
|
+
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
2
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
3
|
+
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
4
|
+
import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
|
|
5
|
+
import React from "react";
|
|
6
6
|
import assignProps from "../utils/assignProps.mjs";
|
|
7
7
|
import useEnhancedEffect from "../utils/use/useEnhancedEffect.mjs";
|
|
8
8
|
import pick from "../utils/pick.mjs";
|
|
9
|
-
|
|
10
|
-
var HOIST_SELF = Symbol(
|
|
11
|
-
var HOIST_SET = Symbol(
|
|
9
|
+
var HOIST_CONTEXT = Symbol("HOIST_CONTEXT");
|
|
10
|
+
var HOIST_SELF = Symbol("HOIST_SELF");
|
|
11
|
+
var HOIST_SET = Symbol("HOIST_SET");
|
|
12
12
|
function flatChildComponent(childComponents) {
|
|
13
|
-
return Object.values(childComponents).reduce(function
|
|
13
|
+
return Object.values(childComponents).reduce(function(acc, Component) {
|
|
14
14
|
if (Array.isArray(Component)) {
|
|
15
15
|
acc.push(Component[0]);
|
|
16
16
|
acc.push.apply(acc, _toConsumableArray(flatChildComponent(Component[1])));
|
|
@@ -20,61 +20,49 @@ function flatChildComponent(childComponents) {
|
|
|
20
20
|
return acc;
|
|
21
21
|
}, []);
|
|
22
22
|
}
|
|
23
|
-
|
|
24
|
-
/** @deprecated Doesn't work in ssr and sometimes breakes rulles of hooks. We should never use it. */
|
|
25
23
|
function Enhancement(childComponents, Context) {
|
|
26
24
|
return {
|
|
27
25
|
condition: function condition(Component) {
|
|
28
|
-
return [Component].concat(_toConsumableArray(flatChildComponent(childComponents))).some(function
|
|
26
|
+
return [Component].concat(_toConsumableArray(flatChildComponent(childComponents))).some(function(Component2) {
|
|
29
27
|
var _Component$hoistProps;
|
|
30
|
-
return Boolean((_Component$hoistProps =
|
|
28
|
+
return Boolean((_Component$hoistProps = Component2.hoistProps) === null || _Component$hoistProps === void 0 ? void 0 : _Component$hoistProps.length);
|
|
31
29
|
});
|
|
32
30
|
},
|
|
33
31
|
init: function init(props, WrapperComponent, isFunction) {
|
|
34
32
|
var _this = this;
|
|
35
33
|
if (isFunction) {
|
|
36
|
-
// TODO: might breake rules of hooks (by lsroman)
|
|
37
34
|
this[HOIST_SELF] = React.useState({});
|
|
38
35
|
} else {
|
|
39
|
-
this[HOIST_SELF] = [{}, function
|
|
36
|
+
this[HOIST_SELF] = [{}, function(obj) {
|
|
40
37
|
_this[HOIST_SELF][0] = obj;
|
|
41
38
|
_this.forceUpdate();
|
|
42
39
|
}];
|
|
43
40
|
}
|
|
44
|
-
|
|
45
|
-
this[HOIST_SET] = function (obj) {
|
|
41
|
+
this[HOIST_SET] = function(obj) {
|
|
46
42
|
_this[HOIST_SELF][1](obj);
|
|
47
43
|
};
|
|
48
44
|
},
|
|
49
45
|
context: function context(_context) {
|
|
50
|
-
// TODO: need to optimizte container initialization (by lsroman)
|
|
51
|
-
// WrapperComponent.hoistProps
|
|
52
46
|
return _objectSpread(_objectSpread({}, _context), {}, _defineProperty({}, HOIST_CONTEXT, this[HOIST_SET]));
|
|
53
47
|
},
|
|
54
48
|
asProps: function asProps(props) {
|
|
55
|
-
// TODO: need to check for no props overwriting (by lsroman)
|
|
56
49
|
return assignProps(this[HOIST_SELF][0], props);
|
|
57
50
|
},
|
|
58
51
|
wrapperProps: function wrapperProps(props, WrapperComponent) {
|
|
59
52
|
var _WrapperComponent$hoi;
|
|
60
53
|
if ((_WrapperComponent$hoi = WrapperComponent.hoistProps) !== null && _WrapperComponent$hoi !== void 0 && _WrapperComponent$hoi.length) {
|
|
61
54
|
var context = React.useContext(Context);
|
|
62
|
-
var renameProps = WrapperComponent.hoistProps.reduce(function
|
|
63
|
-
var _propName$split = propName.split(
|
|
64
|
-
_propName$split2 = _slicedToArray(_propName$split, 2),
|
|
65
|
-
name = _propName$split2[0],
|
|
66
|
-
rename = _propName$split2[1];
|
|
55
|
+
var renameProps = WrapperComponent.hoistProps.reduce(function(acc, propName) {
|
|
56
|
+
var _propName$split = propName.split(":"), _propName$split2 = _slicedToArray(_propName$split, 2), name = _propName$split2[0], rename = _propName$split2[1];
|
|
67
57
|
acc[name] = rename || name;
|
|
68
58
|
return acc;
|
|
69
59
|
}, {});
|
|
70
|
-
var hoistProps = Object.entries(pick(props, Object.keys(renameProps))).reduce(function
|
|
71
|
-
var _ref2 = _slicedToArray(_ref, 2),
|
|
72
|
-
name = _ref2[0],
|
|
73
|
-
value = _ref2[1];
|
|
60
|
+
var hoistProps = Object.entries(pick(props, Object.keys(renameProps))).reduce(function(acc, _ref) {
|
|
61
|
+
var _ref2 = _slicedToArray(_ref, 2), name = _ref2[0], value = _ref2[1];
|
|
74
62
|
acc[renameProps[name]] = value;
|
|
75
63
|
return acc;
|
|
76
64
|
}, {});
|
|
77
|
-
useEnhancedEffect(function
|
|
65
|
+
useEnhancedEffect(function() {
|
|
78
66
|
if (context[HOIST_CONTEXT]) {
|
|
79
67
|
context[HOIST_CONTEXT](hoistProps);
|
|
80
68
|
}
|
|
@@ -84,5 +72,7 @@ function Enhancement(childComponents, Context) {
|
|
|
84
72
|
}
|
|
85
73
|
};
|
|
86
74
|
}
|
|
87
|
-
export
|
|
88
|
-
|
|
75
|
+
export {
|
|
76
|
+
HOIST_CONTEXT,
|
|
77
|
+
Enhancement as default
|
|
78
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports["default"] = void 0;
|
|
8
|
+
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
9
|
+
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
10
|
+
var _react = _interopRequireDefault(require("react"));
|
|
11
|
+
var _WithI18n = require("../utils/enhances/WithI18n");
|
|
12
|
+
var _excluded = ["locale"];
|
|
13
|
+
function i18nAppLocaleEnhance() {
|
|
14
|
+
return {
|
|
15
|
+
wrapperProps: function wrapperProps(props) {
|
|
16
|
+
var locale = props.locale,
|
|
17
|
+
other = (0, _objectWithoutProperties2["default"])(props, _excluded);
|
|
18
|
+
var contextLocale = _react["default"].useContext(_WithI18n.Context);
|
|
19
|
+
if (!locale && !contextLocale) return props;
|
|
20
|
+
return (0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, other), {}, {
|
|
21
|
+
locale: locale !== null && locale !== void 0 ? locale : contextLocale
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
var _default = i18nAppLocaleEnhance;
|
|
27
|
+
exports["default"] = _default;
|
|
28
|
+
//# sourceMappingURL=i18n.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"i18n.cjs","names":["_react","_interopRequireDefault","require","_WithI18n","_excluded","i18nAppLocaleEnhance","wrapperProps","props","locale","other","_objectWithoutProperties2","contextLocale","React","useContext","Context","_objectSpread2","_default","exports"],"sources":["../../src/enhancement/i18n.tsx"],"sourcesContent":["import React from 'react';\nimport { Context } from '../utils/enhances/WithI18n';\n\nfunction i18nAppLocaleEnhance() {\n return {\n wrapperProps: (props: any) => {\n const { locale, ...other } = props;\n const contextLocale = React.useContext(Context);\n if (!locale && !contextLocale) return props;\n return {\n ...other,\n locale: locale ?? contextLocale,\n };\n },\n };\n}\n\nexport default i18nAppLocaleEnhance;\n"],"mappings":";;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AAAqD,IAAAE,SAAA;AAErD,SAASC,oBAAoBA,CAAA,EAAG;EAC9B,OAAO;IACLC,YAAY,EAAE,SAAAA,aAACC,KAAU,EAAK;MAC5B,IAAQC,MAAM,GAAeD,KAAK,CAA1BC,MAAM;QAAKC,KAAK,OAAAC,yBAAA,aAAKH,KAAK,EAAAH,SAAA;MAClC,IAAMO,aAAa,GAAGC,iBAAK,CAACC,UAAU,CAACC,iBAAO,CAAC;MAC/C,IAAI,CAACN,MAAM,IAAI,CAACG,aAAa,EAAE,OAAOJ,KAAK;MAC3C,WAAAQ,cAAA,iBAAAA,cAAA,iBACKN,KAAK;QACRD,MAAM,EAAEA,MAAM,aAANA,MAAM,cAANA,MAAM,GAAIG;MAAa;IAEnC;EACF,CAAC;AACH;AAAC,IAAAK,QAAA,GAEcX,oBAAoB;AAAAY,OAAA,cAAAD,QAAA"}
|
package/lib/enhancement/i18n.mjs
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
import _objectSpread from "@babel/runtime/helpers/objectSpread2";
|
|
2
|
-
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
-
|
|
4
|
-
import React from 'react';
|
|
1
|
+
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
2
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
3
|
+
import React from "react";
|
|
5
4
|
import { Context } from "../utils/enhances/WithI18n.mjs";
|
|
5
|
+
var _excluded = ["locale"];
|
|
6
6
|
function i18nAppLocaleEnhance() {
|
|
7
7
|
return {
|
|
8
8
|
wrapperProps: function wrapperProps(props) {
|
|
9
|
-
var locale = props.locale,
|
|
10
|
-
other = _objectWithoutProperties(props, _excluded);
|
|
9
|
+
var locale = props.locale, other = _objectWithoutProperties(props, _excluded);
|
|
11
10
|
var contextLocale = React.useContext(Context);
|
|
12
11
|
if (!locale && !contextLocale) return props;
|
|
13
12
|
return _objectSpread(_objectSpread({}, other), {}, {
|
|
@@ -16,5 +15,6 @@ function i18nAppLocaleEnhance() {
|
|
|
16
15
|
}
|
|
17
16
|
};
|
|
18
17
|
}
|
|
19
|
-
export
|
|
20
|
-
|
|
18
|
+
export {
|
|
19
|
+
i18nAppLocaleEnhance as default
|
|
20
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports["default"] = void 0;
|
|
8
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
9
|
+
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
10
|
+
var _symbols = require("../core-types/symbols");
|
|
11
|
+
function Enhancement() {
|
|
12
|
+
return {
|
|
13
|
+
condition: function condition(Component) {
|
|
14
|
+
return Boolean(Component.displayName);
|
|
15
|
+
},
|
|
16
|
+
"static": function _static(WrapperComponent) {
|
|
17
|
+
return (0, _defineProperty2["default"])({}, _symbols.INHERITED_NAME, (0, _toConsumableArray2["default"])(new Set([].concat((0, _toConsumableArray2["default"])(WrapperComponent[_symbols.INHERITED_NAME] || []), [WrapperComponent.displayName]))));
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
var _default = Enhancement;
|
|
22
|
+
exports["default"] = _default;
|
|
23
|
+
//# sourceMappingURL=inheritedName.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inheritedName.cjs","names":["_symbols","require","Enhancement","condition","Component","Boolean","displayName","_static","WrapperComponent","_defineProperty2","INHERITED_NAME","_toConsumableArray2","Set","concat","_default","exports"],"sources":["../../src/enhancement/inheritedName.tsx"],"sourcesContent":["import { INHERITED_NAME } from '../core-types/symbols';\n\nfunction Enhancement() {\n return {\n condition: function (Component: any) {\n return Boolean(Component.displayName);\n },\n static: function (WrapperComponent: any) {\n return {\n [INHERITED_NAME]: [\n ...new Set([...(WrapperComponent[INHERITED_NAME] || []), WrapperComponent.displayName]),\n ],\n };\n },\n };\n}\n\nexport default Enhancement;\n"],"mappings":";;;;;;;;;AAAA,IAAAA,QAAA,GAAAC,OAAA;AAEA,SAASC,WAAWA,CAAA,EAAG;EACrB,OAAO;IACLC,SAAS,EAAE,SAAAA,UAAUC,SAAc,EAAE;MACnC,OAAOC,OAAO,CAACD,SAAS,CAACE,WAAW,CAAC;IACvC,CAAC;IACD,UAAQ,SAAAC,QAAUC,gBAAqB,EAAE;MACvC,WAAAC,gBAAA,iBACGC,uBAAc,MAAAC,mBAAA,aACV,IAAIC,GAAG,IAAAC,MAAA,KAAAF,mBAAA,aAAMH,gBAAgB,CAACE,uBAAc,CAAC,IAAI,EAAE,IAAGF,gBAAgB,CAACF,WAAW,GAAE;IAG7F;EACF,CAAC;AACH;AAAC,IAAAQ,QAAA,GAEcZ,WAAW;AAAAa,OAAA,cAAAD,QAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
-
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
2
|
+
import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
|
|
3
3
|
import { INHERITED_NAME } from "../core-types/symbols.mjs";
|
|
4
4
|
function Enhancement() {
|
|
5
5
|
return {
|
|
@@ -11,5 +11,6 @@ function Enhancement() {
|
|
|
11
11
|
}
|
|
12
12
|
};
|
|
13
13
|
}
|
|
14
|
-
export
|
|
15
|
-
|
|
14
|
+
export {
|
|
15
|
+
Enhancement as default
|
|
16
|
+
};
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports["default"] = exports.STATIC_COMPONENT = exports.ROOT_COMPONENT = void 0;
|
|
8
|
+
exports.getterMethodName = getterMethodName;
|
|
9
|
+
exports.getterMethodNameByDisplayName = getterMethodNameByDisplayName;
|
|
10
|
+
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
11
|
+
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
12
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
13
|
+
var _react = _interopRequireDefault(require("react"));
|
|
14
|
+
var _assignProps = _interopRequireDefault(require("../utils/assignProps"));
|
|
15
|
+
var _pick = _interopRequireDefault(require("../utils/pick"));
|
|
16
|
+
var _logger = _interopRequireDefault(require("../utils/logger"));
|
|
17
|
+
function assign(target, source) {
|
|
18
|
+
return Object.defineProperties(target, Object.keys(source).reduce(function (descriptors, key) {
|
|
19
|
+
descriptors[key] = Object.getOwnPropertyDescriptor(source, key);
|
|
20
|
+
return descriptors;
|
|
21
|
+
}, {}));
|
|
22
|
+
}
|
|
23
|
+
function getterMethodName(name) {
|
|
24
|
+
return "get".concat(name, "Props");
|
|
25
|
+
}
|
|
26
|
+
function getterMethodNameByDisplayName() {
|
|
27
|
+
var displayName = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
|
28
|
+
var displayNames = displayName.split('.');
|
|
29
|
+
var name = displayNames.slice(-(displayNames.length - 1)).join('');
|
|
30
|
+
return getterMethodName(name);
|
|
31
|
+
}
|
|
32
|
+
function flatGetterMethodNames(childComponents, parentName) {
|
|
33
|
+
return Object.entries(childComponents).reduce(function (acc, _ref) {
|
|
34
|
+
var _ref2 = (0, _slicedToArray2["default"])(_ref, 2),
|
|
35
|
+
name = _ref2[0],
|
|
36
|
+
value = _ref2[1];
|
|
37
|
+
if (Array.isArray(value)) {
|
|
38
|
+
acc.push.apply(acc, (0, _toConsumableArray2["default"])(flatGetterMethodNames(value[1], name)));
|
|
39
|
+
}
|
|
40
|
+
name = parentName ? "".concat(parentName).concat(name) : name;
|
|
41
|
+
acc.push(getterMethodName(name));
|
|
42
|
+
return acc;
|
|
43
|
+
}, []);
|
|
44
|
+
}
|
|
45
|
+
var STATIC_COMPONENT = Symbol('STATIC_COMPONENT');
|
|
46
|
+
exports.STATIC_COMPONENT = STATIC_COMPONENT;
|
|
47
|
+
var ROOT_COMPONENT = Symbol('ROOT_COMPONENT');
|
|
48
|
+
exports.ROOT_COMPONENT = ROOT_COMPONENT;
|
|
49
|
+
var SELF_GETTER_METHOD = Symbol('SELF_GETTER_METHOD');
|
|
50
|
+
function Enhancement(childComponents, createComponent, options) {
|
|
51
|
+
var getterMethodNames = flatGetterMethodNames(childComponents);
|
|
52
|
+
return {
|
|
53
|
+
condition: function condition(Component) {
|
|
54
|
+
return Boolean(Component[STATIC_COMPONENT] || Object.keys(childComponents).length);
|
|
55
|
+
},
|
|
56
|
+
init: function init(props, WrapperComponent) {
|
|
57
|
+
var _this = this;
|
|
58
|
+
var getterMethods = (0, _pick["default"])(this, getterMethodNames);
|
|
59
|
+
this[SELF_GETTER_METHOD] = function () {
|
|
60
|
+
var selfGetterMethod = getterMethodNameByDisplayName(WrapperComponent.displayName);
|
|
61
|
+
_logger["default"].warn(true, "Getter `".concat(selfGetterMethod, "` can't be fired as it is a getter of static component"), props['data-ui-name'] || WrapperComponent.displayName);
|
|
62
|
+
};
|
|
63
|
+
assign(this, getterMethodNames.reduce(function (acc, name) {
|
|
64
|
+
var getterMethod = getterMethods[name];
|
|
65
|
+
if (!getterMethod) return acc;
|
|
66
|
+
acc[name] = function () {
|
|
67
|
+
var childrenProps = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
68
|
+
var getterProps = getterMethod.call(_this, childrenProps, acc[name].index);
|
|
69
|
+
return (0, _assignProps["default"])(childrenProps, getterProps);
|
|
70
|
+
};
|
|
71
|
+
acc[name].index = -1;
|
|
72
|
+
acc[name].cache = new Set();
|
|
73
|
+
return acc;
|
|
74
|
+
}, {}));
|
|
75
|
+
},
|
|
76
|
+
"static": function _static(WrapperComponent, Component) {
|
|
77
|
+
if (Object.keys(childComponents).length && !WrapperComponent.displayName) {
|
|
78
|
+
throw new Error('"displayName" is not defined');
|
|
79
|
+
}
|
|
80
|
+
return Object.entries(childComponents).reduce(function (acc, _ref3) {
|
|
81
|
+
var _ref4 = (0, _slicedToArray2["default"])(_ref3, 2),
|
|
82
|
+
name = _ref4[0],
|
|
83
|
+
value = _ref4[1];
|
|
84
|
+
var childComponents = {};
|
|
85
|
+
if (Array.isArray(value)) {
|
|
86
|
+
childComponents = value[1];
|
|
87
|
+
value = value[0];
|
|
88
|
+
}
|
|
89
|
+
var prevStaticComponent = value[STATIC_COMPONENT];
|
|
90
|
+
// @ts-ignore
|
|
91
|
+
var prevDisplayName = value.displayName;
|
|
92
|
+
// @ts-ignore
|
|
93
|
+
value.displayName = "".concat(WrapperComponent.displayName, ".").concat(name);
|
|
94
|
+
value[STATIC_COMPONENT] = true;
|
|
95
|
+
value[ROOT_COMPONENT] = Component[ROOT_COMPONENT] || Component;
|
|
96
|
+
acc[name] = createComponent(value, childComponents, options);
|
|
97
|
+
// @ts-ignore
|
|
98
|
+
value.displayName = prevDisplayName;
|
|
99
|
+
value[STATIC_COMPONENT] = prevStaticComponent;
|
|
100
|
+
return acc;
|
|
101
|
+
}, {});
|
|
102
|
+
},
|
|
103
|
+
context: function context(_context) {
|
|
104
|
+
// const getterMethod = getterMethodNameByDisplayName(WrapperComponent.displayName);
|
|
105
|
+
return (0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, _context), (0, _pick["default"])(this, getterMethodNames));
|
|
106
|
+
},
|
|
107
|
+
wrapperProps: function wrapperProps(props, WrapperComponent) {
|
|
108
|
+
if (!WrapperComponent[STATIC_COMPONENT]) return props;
|
|
109
|
+
var context = _react["default"].useContext(options.context);
|
|
110
|
+
var getterMethod = context[getterMethodNameByDisplayName(WrapperComponent.displayName)];
|
|
111
|
+
if (getterMethod) {
|
|
112
|
+
if (!getterMethod.cache.has(this)) {
|
|
113
|
+
getterMethod.cache.add(this);
|
|
114
|
+
getterMethod.index++;
|
|
115
|
+
if (this) this.index = getterMethod.index;
|
|
116
|
+
}
|
|
117
|
+
if (this) getterMethod.index = this.index;
|
|
118
|
+
return getterMethod(props);
|
|
119
|
+
}
|
|
120
|
+
return props;
|
|
121
|
+
},
|
|
122
|
+
render: function render(_render) {
|
|
123
|
+
var _this2 = this;
|
|
124
|
+
getterMethodNames.forEach(function (name) {
|
|
125
|
+
if (_this2[name] === undefined) return;
|
|
126
|
+
_this2[name].index = -1;
|
|
127
|
+
_this2[name].cache.clear();
|
|
128
|
+
});
|
|
129
|
+
return _render;
|
|
130
|
+
}
|
|
131
|
+
};
|
|
132
|
+
}
|
|
133
|
+
var _default = Enhancement;
|
|
134
|
+
exports["default"] = _default;
|
|
135
|
+
//# sourceMappingURL=staticChildren.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"staticChildren.cjs","names":["_react","_interopRequireDefault","require","_assignProps","_pick","_logger","assign","target","source","Object","defineProperties","keys","reduce","descriptors","key","getOwnPropertyDescriptor","getterMethodName","name","concat","getterMethodNameByDisplayName","displayName","arguments","length","undefined","displayNames","split","slice","join","flatGetterMethodNames","childComponents","parentName","entries","acc","_ref","_ref2","_slicedToArray2","value","Array","isArray","push","apply","_toConsumableArray2","STATIC_COMPONENT","Symbol","exports","ROOT_COMPONENT","SELF_GETTER_METHOD","Enhancement","createComponent","options","getterMethodNames","condition","Component","Boolean","init","props","WrapperComponent","_this","getterMethods","pick","selfGetterMethod","logger","warn","getterMethod","childrenProps","getterProps","call","index","assignProps","cache","Set","_static","Error","_ref3","_ref4","prevStaticComponent","prevDisplayName","context","_objectSpread2","wrapperProps","React","useContext","has","add","render","_this2","forEach","clear","_default"],"sources":["../../src/enhancement/staticChildren.tsx"],"sourcesContent":["import React from 'react';\nimport assignProps from '../utils/assignProps';\nimport pick from '../utils/pick';\nimport logger from '../utils/logger';\n\nfunction assign(target: any, source: any) {\n return Object.defineProperties(\n target,\n Object.keys(source).reduce((descriptors: any, key) => {\n descriptors[key] = Object.getOwnPropertyDescriptor(source, key);\n return descriptors;\n }, {}),\n );\n}\n\nexport function getterMethodName(name: string) {\n return `get${name}Props`;\n}\n\nexport function getterMethodNameByDisplayName(displayName = '') {\n const displayNames = displayName.split('.');\n const name = displayNames.slice(-(displayNames.length - 1)).join('');\n return getterMethodName(name);\n}\n\nfunction flatGetterMethodNames(childComponents: any, parentName?: string) {\n return Object.entries(childComponents).reduce<string[]>((acc, [name, value]) => {\n if (Array.isArray(value)) {\n acc.push(...flatGetterMethodNames(value[1], name));\n }\n name = parentName ? `${parentName}${name}` : name;\n acc.push(getterMethodName(name));\n return acc;\n }, []);\n}\n\nexport const STATIC_COMPONENT = Symbol('STATIC_COMPONENT');\nexport const ROOT_COMPONENT = Symbol('ROOT_COMPONENT');\nconst SELF_GETTER_METHOD = Symbol('SELF_GETTER_METHOD');\n\nfunction Enhancement(childComponents: any, createComponent: any, options: any) {\n const getterMethodNames = flatGetterMethodNames(childComponents);\n return {\n condition: function (Component: any) {\n return Boolean(Component[STATIC_COMPONENT] || Object.keys(childComponents).length);\n },\n init: function (this: any, props: any, WrapperComponent: any) {\n const getterMethods: any = pick(this, getterMethodNames);\n this[SELF_GETTER_METHOD] = () => {\n const selfGetterMethod = getterMethodNameByDisplayName(WrapperComponent.displayName);\n logger.warn(\n true,\n `Getter \\`${selfGetterMethod}\\` can't be fired as it is a getter of static component`,\n props['data-ui-name'] || WrapperComponent.displayName,\n );\n };\n assign(\n this,\n getterMethodNames.reduce((acc: any, name) => {\n const getterMethod = getterMethods[name];\n if (!getterMethod) return acc;\n acc[name] = (childrenProps = {}) => {\n const getterProps = getterMethod.call(this, childrenProps, acc[name].index);\n return assignProps(childrenProps, getterProps);\n };\n acc[name].index = -1;\n acc[name].cache = new Set();\n return acc;\n }, {}),\n );\n },\n static: function (WrapperComponent: any, Component: any) {\n if (Object.keys(childComponents).length && !WrapperComponent.displayName) {\n throw new Error('\"displayName\" is not defined');\n }\n return Object.entries(childComponents).reduce((acc: any, [name, value]: any) => {\n let childComponents = {};\n\n if (Array.isArray(value)) {\n childComponents = value[1];\n value = value[0];\n }\n\n const prevStaticComponent = value[STATIC_COMPONENT];\n // @ts-ignore\n const prevDisplayName = value.displayName;\n // @ts-ignore\n value.displayName = `${WrapperComponent.displayName}.${name}`;\n value[STATIC_COMPONENT] = true;\n value[ROOT_COMPONENT] = Component[ROOT_COMPONENT] || Component;\n acc[name] = createComponent(value, childComponents, options);\n // @ts-ignore\n value.displayName = prevDisplayName;\n value[STATIC_COMPONENT] = prevStaticComponent;\n return acc;\n }, {});\n },\n context: function (context: any /*, WrapperComponent*/) {\n // const getterMethod = getterMethodNameByDisplayName(WrapperComponent.displayName);\n return {\n ...context,\n // [getterMethod]: this[SELF_GETTER_METHOD],\n ...pick(this, getterMethodNames as any),\n };\n },\n wrapperProps: function (this: any, props: any, WrapperComponent: any) {\n if (!WrapperComponent[STATIC_COMPONENT]) return props;\n const context: any = React.useContext(options.context);\n const getterMethod = context[getterMethodNameByDisplayName(WrapperComponent.displayName)];\n if (getterMethod) {\n if (!getterMethod.cache.has(this)) {\n getterMethod.cache.add(this);\n getterMethod.index++;\n if (this) this.index = getterMethod.index;\n }\n if (this) getterMethod.index = this.index;\n return getterMethod(props);\n }\n return props;\n },\n render: function (this: any, render: any) {\n getterMethodNames.forEach((name) => {\n if (this[name] === undefined) return;\n this[name].index = -1;\n this[name].cache.clear();\n });\n return render;\n },\n };\n}\n\nexport default Enhancement;\n"],"mappings":"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"}
|
|
@@ -1,30 +1,28 @@
|
|
|
1
|
-
import _objectSpread from "@babel/runtime/helpers/objectSpread2";
|
|
2
|
-
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
3
|
-
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
4
|
-
import React from
|
|
1
|
+
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
2
|
+
import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
|
|
3
|
+
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
4
|
+
import React from "react";
|
|
5
5
|
import assignProps from "../utils/assignProps.mjs";
|
|
6
6
|
import pick from "../utils/pick.mjs";
|
|
7
7
|
import logger from "../utils/logger.mjs";
|
|
8
8
|
function assign(target, source) {
|
|
9
|
-
return Object.defineProperties(target, Object.keys(source).reduce(function
|
|
9
|
+
return Object.defineProperties(target, Object.keys(source).reduce(function(descriptors, key) {
|
|
10
10
|
descriptors[key] = Object.getOwnPropertyDescriptor(source, key);
|
|
11
11
|
return descriptors;
|
|
12
12
|
}, {}));
|
|
13
13
|
}
|
|
14
|
-
|
|
14
|
+
function getterMethodName(name) {
|
|
15
15
|
return "get".concat(name, "Props");
|
|
16
16
|
}
|
|
17
|
-
|
|
18
|
-
var displayName = arguments.length > 0 && arguments[0] !==
|
|
19
|
-
var displayNames = displayName.split(
|
|
20
|
-
var name = displayNames.slice(-(displayNames.length - 1)).join(
|
|
17
|
+
function getterMethodNameByDisplayName() {
|
|
18
|
+
var displayName = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "";
|
|
19
|
+
var displayNames = displayName.split(".");
|
|
20
|
+
var name = displayNames.slice(-(displayNames.length - 1)).join("");
|
|
21
21
|
return getterMethodName(name);
|
|
22
22
|
}
|
|
23
23
|
function flatGetterMethodNames(childComponents, parentName) {
|
|
24
|
-
return Object.entries(childComponents).reduce(function
|
|
25
|
-
var _ref2 = _slicedToArray(_ref, 2),
|
|
26
|
-
name = _ref2[0],
|
|
27
|
-
value = _ref2[1];
|
|
24
|
+
return Object.entries(childComponents).reduce(function(acc, _ref) {
|
|
25
|
+
var _ref2 = _slicedToArray(_ref, 2), name = _ref2[0], value = _ref2[1];
|
|
28
26
|
if (Array.isArray(value)) {
|
|
29
27
|
acc.push.apply(acc, _toConsumableArray(flatGetterMethodNames(value[1], name)));
|
|
30
28
|
}
|
|
@@ -33,9 +31,9 @@ function flatGetterMethodNames(childComponents, parentName) {
|
|
|
33
31
|
return acc;
|
|
34
32
|
}, []);
|
|
35
33
|
}
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
var SELF_GETTER_METHOD = Symbol(
|
|
34
|
+
var STATIC_COMPONENT = Symbol("STATIC_COMPONENT");
|
|
35
|
+
var ROOT_COMPONENT = Symbol("ROOT_COMPONENT");
|
|
36
|
+
var SELF_GETTER_METHOD = Symbol("SELF_GETTER_METHOD");
|
|
39
37
|
function Enhancement(childComponents, createComponent, options) {
|
|
40
38
|
var getterMethodNames = flatGetterMethodNames(childComponents);
|
|
41
39
|
return {
|
|
@@ -45,20 +43,20 @@ function Enhancement(childComponents, createComponent, options) {
|
|
|
45
43
|
init: function init(props, WrapperComponent) {
|
|
46
44
|
var _this = this;
|
|
47
45
|
var getterMethods = pick(this, getterMethodNames);
|
|
48
|
-
this[SELF_GETTER_METHOD] = function
|
|
46
|
+
this[SELF_GETTER_METHOD] = function() {
|
|
49
47
|
var selfGetterMethod = getterMethodNameByDisplayName(WrapperComponent.displayName);
|
|
50
|
-
logger.warn(true, "Getter `".concat(selfGetterMethod, "` can't be fired as it is a getter of static component"), props[
|
|
48
|
+
logger.warn(true, "Getter `".concat(selfGetterMethod, "` can't be fired as it is a getter of static component"), props["data-ui-name"] || WrapperComponent.displayName);
|
|
51
49
|
};
|
|
52
|
-
assign(this, getterMethodNames.reduce(function
|
|
50
|
+
assign(this, getterMethodNames.reduce(function(acc, name) {
|
|
53
51
|
var getterMethod = getterMethods[name];
|
|
54
52
|
if (!getterMethod) return acc;
|
|
55
|
-
acc[name] = function
|
|
56
|
-
var childrenProps = arguments.length > 0 && arguments[0] !==
|
|
53
|
+
acc[name] = function() {
|
|
54
|
+
var childrenProps = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
57
55
|
var getterProps = getterMethod.call(_this, childrenProps, acc[name].index);
|
|
58
56
|
return assignProps(childrenProps, getterProps);
|
|
59
57
|
};
|
|
60
58
|
acc[name].index = -1;
|
|
61
|
-
acc[name].cache = new Set();
|
|
59
|
+
acc[name].cache = /* @__PURE__ */ new Set();
|
|
62
60
|
return acc;
|
|
63
61
|
}, {}));
|
|
64
62
|
},
|
|
@@ -66,31 +64,25 @@ function Enhancement(childComponents, createComponent, options) {
|
|
|
66
64
|
if (Object.keys(childComponents).length && !WrapperComponent.displayName) {
|
|
67
65
|
throw new Error('"displayName" is not defined');
|
|
68
66
|
}
|
|
69
|
-
return Object.entries(childComponents).reduce(function
|
|
70
|
-
var _ref4 = _slicedToArray(_ref3, 2),
|
|
71
|
-
|
|
72
|
-
value = _ref4[1];
|
|
73
|
-
var childComponents = {};
|
|
67
|
+
return Object.entries(childComponents).reduce(function(acc, _ref3) {
|
|
68
|
+
var _ref4 = _slicedToArray(_ref3, 2), name = _ref4[0], value = _ref4[1];
|
|
69
|
+
var childComponents2 = {};
|
|
74
70
|
if (Array.isArray(value)) {
|
|
75
|
-
|
|
71
|
+
childComponents2 = value[1];
|
|
76
72
|
value = value[0];
|
|
77
73
|
}
|
|
78
74
|
var prevStaticComponent = value[STATIC_COMPONENT];
|
|
79
|
-
// @ts-ignore
|
|
80
75
|
var prevDisplayName = value.displayName;
|
|
81
|
-
// @ts-ignore
|
|
82
76
|
value.displayName = "".concat(WrapperComponent.displayName, ".").concat(name);
|
|
83
77
|
value[STATIC_COMPONENT] = true;
|
|
84
78
|
value[ROOT_COMPONENT] = Component[ROOT_COMPONENT] || Component;
|
|
85
|
-
acc[name] = createComponent(value,
|
|
86
|
-
// @ts-ignore
|
|
79
|
+
acc[name] = createComponent(value, childComponents2, options);
|
|
87
80
|
value.displayName = prevDisplayName;
|
|
88
81
|
value[STATIC_COMPONENT] = prevStaticComponent;
|
|
89
82
|
return acc;
|
|
90
83
|
}, {});
|
|
91
84
|
},
|
|
92
85
|
context: function context(_context) {
|
|
93
|
-
// const getterMethod = getterMethodNameByDisplayName(WrapperComponent.displayName);
|
|
94
86
|
return _objectSpread(_objectSpread({}, _context), pick(this, getterMethodNames));
|
|
95
87
|
},
|
|
96
88
|
wrapperProps: function wrapperProps(props, WrapperComponent) {
|
|
@@ -110,8 +102,8 @@ function Enhancement(childComponents, createComponent, options) {
|
|
|
110
102
|
},
|
|
111
103
|
render: function render(_render) {
|
|
112
104
|
var _this2 = this;
|
|
113
|
-
getterMethodNames.forEach(function
|
|
114
|
-
if (_this2[name] ===
|
|
105
|
+
getterMethodNames.forEach(function(name) {
|
|
106
|
+
if (_this2[name] === void 0) return;
|
|
115
107
|
_this2[name].index = -1;
|
|
116
108
|
_this2[name].cache.clear();
|
|
117
109
|
});
|
|
@@ -119,5 +111,10 @@ function Enhancement(childComponents, createComponent, options) {
|
|
|
119
111
|
}
|
|
120
112
|
};
|
|
121
113
|
}
|
|
122
|
-
export
|
|
123
|
-
|
|
114
|
+
export {
|
|
115
|
+
ROOT_COMPONENT,
|
|
116
|
+
STATIC_COMPONENT,
|
|
117
|
+
Enhancement as default,
|
|
118
|
+
getterMethodName,
|
|
119
|
+
getterMethodNameByDisplayName
|
|
120
|
+
};
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports["default"] = exports.STYLES_CONTEXT = void 0;
|
|
8
|
+
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
9
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
10
|
+
var _objectSpread3 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
11
|
+
var _react = _interopRequireDefault(require("react"));
|
|
12
|
+
var _index = require("../styled/index");
|
|
13
|
+
var _staticChildren = require("./staticChildren");
|
|
14
|
+
var _excluded = ["_styles", "styles"],
|
|
15
|
+
_excluded2 = ["styles"];
|
|
16
|
+
var STYLES_CONTEXT = Symbol('STYLES_CONTEXT');
|
|
17
|
+
exports.STYLES_CONTEXT = STYLES_CONTEXT;
|
|
18
|
+
var STYLES_SELF = Symbol('STYLES_SELF');
|
|
19
|
+
function Enhancement(childComponents, Context) {
|
|
20
|
+
return {
|
|
21
|
+
condition: function condition(Component) {
|
|
22
|
+
return Boolean(Component.style || Component[_staticChildren.STATIC_COMPONENT]);
|
|
23
|
+
},
|
|
24
|
+
init: function init(props, WrapperComponent) {
|
|
25
|
+
if (props.styles) {
|
|
26
|
+
this[STYLES_SELF] = props.styles;
|
|
27
|
+
}
|
|
28
|
+
if (WrapperComponent.style) {
|
|
29
|
+
this[STYLES_SELF] = _index.sstyled.merge(WrapperComponent.style, props._styles);
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
context: function context(_context) {
|
|
33
|
+
// Optimization: if has no children there is no need to create new context (by lsroman)
|
|
34
|
+
if (!this[STYLES_SELF] || !Object.keys(childComponents).length) {
|
|
35
|
+
return _context;
|
|
36
|
+
}
|
|
37
|
+
return (0, _objectSpread3["default"])((0, _objectSpread3["default"])({}, _context), {}, (0, _defineProperty2["default"])({}, STYLES_CONTEXT, this[STYLES_SELF]));
|
|
38
|
+
},
|
|
39
|
+
asProps: function asProps(_ref) {
|
|
40
|
+
var _styles = _ref._styles,
|
|
41
|
+
styles = _ref.styles,
|
|
42
|
+
props = (0, _objectWithoutProperties2["default"])(_ref, _excluded);
|
|
43
|
+
return (0, _objectSpread3["default"])((0, _objectSpread3["default"])({}, props), {}, {
|
|
44
|
+
styles: this[STYLES_SELF]
|
|
45
|
+
});
|
|
46
|
+
},
|
|
47
|
+
wrapperProps: function wrapperProps(_ref2) {
|
|
48
|
+
var styles = _ref2.styles,
|
|
49
|
+
props = (0, _objectWithoutProperties2["default"])(_ref2, _excluded2);
|
|
50
|
+
var context = _react["default"].useContext(Context);
|
|
51
|
+
return (0, _objectSpread3["default"])((0, _objectSpread3["default"])({}, props), {}, {
|
|
52
|
+
_styles: styles,
|
|
53
|
+
styles: context[STYLES_CONTEXT]
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
var _default = Enhancement;
|
|
59
|
+
exports["default"] = _default;
|
|
60
|
+
//# sourceMappingURL=style.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"style.cjs","names":["_react","_interopRequireDefault","require","_index","_staticChildren","_excluded","_excluded2","STYLES_CONTEXT","Symbol","exports","STYLES_SELF","Enhancement","childComponents","Context","condition","Component","Boolean","style","STATIC_COMPONENT","init","props","WrapperComponent","styles","sstyled","merge","_styles","context","Object","keys","length","_objectSpread3","_defineProperty2","asProps","_ref","_objectWithoutProperties2","wrapperProps","_ref2","React","useContext","_default"],"sources":["../../src/enhancement/style.tsx"],"sourcesContent":["import React from 'react';\nimport { sstyled } from '../styled/index';\nimport { STATIC_COMPONENT } from './staticChildren';\n\nexport const STYLES_CONTEXT = Symbol('STYLES_CONTEXT');\nconst STYLES_SELF = Symbol('STYLES_SELF');\n\nfunction Enhancement(childComponents: any, Context: any) {\n return {\n condition: function (Component: any) {\n return Boolean(Component.style || Component[STATIC_COMPONENT]);\n },\n init: function (this: any, props: any, WrapperComponent: any) {\n if (props.styles) {\n this[STYLES_SELF] = props.styles;\n }\n if (WrapperComponent.style) {\n this[STYLES_SELF] = sstyled.merge(WrapperComponent.style, props._styles);\n }\n },\n context: function (this: any, context: any): any {\n // Optimization: if has no children there is no need to create new context (by lsroman)\n if (!this[STYLES_SELF] || !Object.keys(childComponents).length) {\n return context;\n }\n return {\n ...context,\n [STYLES_CONTEXT]: this[STYLES_SELF],\n };\n },\n\n asProps: function (this: any, { _styles, styles, ...props }: any) {\n return {\n ...props,\n styles: this[STYLES_SELF],\n };\n },\n wrapperProps: function (this: any, { styles, ...props }: any) {\n const context: any = React.useContext(Context);\n return {\n ...props,\n _styles: styles,\n styles: context[STYLES_CONTEXT],\n };\n },\n };\n}\n\nexport default Enhancement;\n"],"mappings":";;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,eAAA,GAAAF,OAAA;AAAoD,IAAAG,SAAA;EAAAC,UAAA;AAE7C,IAAMC,cAAc,GAAGC,MAAM,CAAC,gBAAgB,CAAC;AAACC,OAAA,CAAAF,cAAA,GAAAA,cAAA;AACvD,IAAMG,WAAW,GAAGF,MAAM,CAAC,aAAa,CAAC;AAEzC,SAASG,WAAWA,CAACC,eAAoB,EAAEC,OAAY,EAAE;EACvD,OAAO;IACLC,SAAS,EAAE,SAAAA,UAAUC,SAAc,EAAE;MACnC,OAAOC,OAAO,CAACD,SAAS,CAACE,KAAK,IAAIF,SAAS,CAACG,gCAAgB,CAAC,CAAC;IAChE,CAAC;IACDC,IAAI,EAAE,SAAAA,KAAqBC,KAAU,EAAEC,gBAAqB,EAAE;MAC5D,IAAID,KAAK,CAACE,MAAM,EAAE;QAChB,IAAI,CAACZ,WAAW,CAAC,GAAGU,KAAK,CAACE,MAAM;MAClC;MACA,IAAID,gBAAgB,CAACJ,KAAK,EAAE;QAC1B,IAAI,CAACP,WAAW,CAAC,GAAGa,cAAO,CAACC,KAAK,CAACH,gBAAgB,CAACJ,KAAK,EAAEG,KAAK,CAACK,OAAO,CAAC;MAC1E;IACF,CAAC;IACDC,OAAO,EAAE,SAAAA,QAAqBA,QAAY,EAAO;MAC/C;MACA,IAAI,CAAC,IAAI,CAAChB,WAAW,CAAC,IAAI,CAACiB,MAAM,CAACC,IAAI,CAAChB,eAAe,CAAC,CAACiB,MAAM,EAAE;QAC9D,OAAOH,QAAO;MAChB;MACA,WAAAI,cAAA,iBAAAA,cAAA,iBACKJ,QAAO,WAAAK,gBAAA,iBACTxB,cAAc,EAAG,IAAI,CAACG,WAAW,CAAC;IAEvC,CAAC;IAEDsB,OAAO,EAAE,SAAAA,QAAAC,IAAA,EAAyD;MAAA,IAAlCR,OAAO,GAAAQ,IAAA,CAAPR,OAAO;QAAEH,MAAM,GAAAW,IAAA,CAANX,MAAM;QAAKF,KAAK,OAAAc,yBAAA,aAAAD,IAAA,EAAA5B,SAAA;MACvD,WAAAyB,cAAA,iBAAAA,cAAA,iBACKV,KAAK;QACRE,MAAM,EAAE,IAAI,CAACZ,WAAW;MAAC;IAE7B,CAAC;IACDyB,YAAY,EAAE,SAAAA,aAAAC,KAAA,EAAgD;MAAA,IAAzBd,MAAM,GAAAc,KAAA,CAANd,MAAM;QAAKF,KAAK,OAAAc,yBAAA,aAAAE,KAAA,EAAA9B,UAAA;MACnD,IAAMoB,OAAY,GAAGW,iBAAK,CAACC,UAAU,CAACzB,OAAO,CAAC;MAC9C,WAAAiB,cAAA,iBAAAA,cAAA,iBACKV,KAAK;QACRK,OAAO,EAAEH,MAAM;QACfA,MAAM,EAAEI,OAAO,CAACnB,cAAc;MAAC;IAEnC;EACF,CAAC;AACH;AAAC,IAAAgC,QAAA,GAEc5B,WAAW;AAAAF,OAAA,cAAA8B,QAAA"}
|