@semcore/core 16.0.0-prerelease.2 → 16.0.0-prerelease.6
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/{cjs/LastInteractionType.js → LastInteractionType.cjs} +1 -1
- package/lib/LastInteractionType.cjs.map +1 -0
- package/lib/LastInteractionType.d.ts +1 -1
- package/lib/{es6/LastInteractionType.js → LastInteractionType.mjs} +5 -5
- package/lib/LastInteractionType.mjs.map +1 -0
- package/lib/core-types/{Component.js → Component.cjs} +1 -1
- package/lib/core-types/Component.cjs.map +1 -0
- package/lib/core-types/Component.mjs +6 -6
- package/lib/core-types/UnknownProperties.cjs +2 -0
- package/lib/core-types/UnknownProperties.cjs.map +1 -0
- package/lib/core-types/UnknownProperties.mjs +0 -1
- package/lib/core-types/reshadow.d.cjs +2 -0
- package/lib/core-types/reshadow.d.cjs.map +1 -0
- package/lib/core-types/{symbols.js → symbols.cjs} +1 -1
- package/lib/core-types/symbols.cjs.map +1 -0
- package/lib/{cjs/coreFactory.js → coreFactory.cjs} +1 -1
- package/lib/coreFactory.cjs.map +1 -0
- package/lib/{es6/coreFactory.js → coreFactory.mjs} +30 -30
- package/lib/coreFactory.mjs.map +1 -0
- package/lib/{cjs/enhancement/Children.js → enhancement/Children.cjs} +1 -1
- package/lib/enhancement/Children.cjs.map +1 -0
- package/lib/enhancement/Children.mjs +4 -4
- package/lib/enhancement/{Root.js → Root.cjs} +1 -1
- package/lib/enhancement/Root.cjs.map +1 -0
- package/lib/enhancement/Root.mjs +3 -3
- package/lib/enhancement/{bindHandler.js → bindHandler.cjs} +1 -1
- package/lib/enhancement/bindHandler.cjs.map +1 -0
- package/lib/enhancement/{dataName.js → dataName.cjs} +1 -1
- package/lib/enhancement/dataName.cjs.map +1 -0
- package/lib/enhancement/dataName.mjs +1 -1
- package/lib/{cjs/enhancement/enhance.js → enhancement/enhance.cjs} +1 -1
- package/lib/enhancement/enhance.cjs.map +1 -0
- package/lib/enhancement/{functionDefaultProps.js → functionDefaultProps.cjs} +1 -1
- package/lib/enhancement/functionDefaultProps.cjs.map +1 -0
- package/lib/enhancement/{hoistProps.js → hoistProps.cjs} +1 -1
- package/lib/enhancement/hoistProps.cjs.map +1 -0
- package/lib/enhancement/hoistProps.mjs +4 -4
- package/lib/enhancement/{i18n.js → i18n.cjs} +1 -1
- package/lib/enhancement/i18n.cjs.map +1 -0
- package/lib/enhancement/i18n.mjs +2 -2
- package/lib/{cjs/enhancement/inheritedName.js → enhancement/inheritedName.cjs} +1 -1
- package/lib/enhancement/inheritedName.cjs.map +1 -0
- package/lib/enhancement/inheritedName.mjs +2 -2
- package/lib/enhancement/{staticChildren.js → staticChildren.cjs} +1 -1
- package/lib/enhancement/staticChildren.cjs.map +1 -0
- package/lib/enhancement/staticChildren.mjs +3 -3
- package/lib/enhancement/{style.js → style.cjs} +1 -1
- package/lib/enhancement/style.cjs.map +1 -0
- package/lib/enhancement/style.mjs +3 -3
- package/lib/{cjs/enhancement/uncontrolledProps.js → enhancement/uncontrolledProps.cjs} +1 -1
- package/lib/enhancement/uncontrolledProps.cjs.map +1 -0
- package/lib/enhancement/uncontrolledProps.mjs +7 -7
- package/lib/{cjs/index.js → index.cjs} +1 -1
- package/lib/index.cjs.map +1 -0
- package/lib/{es6/index.js → index.mjs} +7 -7
- package/lib/index.mjs.map +1 -0
- package/lib/{cjs/register.js → register.cjs} +1 -1
- package/lib/register.cjs.map +1 -0
- package/lib/register.mjs +3 -3
- package/lib/{cjs/styled/index.js → styled/index.cjs} +1 -1
- package/lib/styled/index.cjs.map +1 -0
- package/lib/{cjs/styled/reshadow-core.js → styled/reshadow-core.cjs} +1 -1
- package/lib/styled/reshadow-core.cjs.map +1 -0
- package/lib/styled/reshadow-core.mjs +5 -5
- package/lib/styled/reshadow-core.mjs.map +1 -1
- package/lib/styled/{sstyled.js → sstyled.cjs} +1 -1
- package/lib/styled/sstyled.cjs.map +1 -0
- package/lib/styled/sstyled.mjs +2 -2
- package/lib/theme/{processor.js → processor.cjs} +1 -1
- package/lib/theme/processor.cjs.map +1 -0
- package/lib/theme/processor.mjs +4 -4
- package/lib/{cjs/theme/themes/dark.js → theme/themes/dark.cjs} +1 -1
- package/lib/theme/themes/dark.cjs.map +1 -0
- package/lib/theme/themes/{default.js → default.cjs} +1 -1
- package/lib/theme/themes/default.cjs.map +1 -0
- package/lib/{cjs/theme/themes/light.js → theme/themes/light.cjs} +1 -1
- package/lib/theme/themes/light.cjs.map +1 -0
- package/lib/{cjs/theme/utils.js → theme/utils.cjs} +1 -1
- package/lib/theme/utils.cjs.map +1 -0
- package/lib/theme/utils.mjs +9 -9
- package/lib/theme/utils.mjs.map +1 -1
- package/lib/{cjs/utils/CSSinJS.js → utils/CSSinJS.cjs} +1 -1
- package/lib/utils/CSSinJS.cjs.map +1 -0
- package/lib/utils/CSSinJS.mjs +1 -1
- package/lib/utils/{ScreenReaderOnly.js → ScreenReaderOnly.cjs} +1 -1
- package/lib/utils/ScreenReaderOnly.cjs.map +1 -0
- package/lib/utils/ScreenReaderOnly.mjs +1 -1
- package/lib/utils/{ThemeProvider.js → ThemeProvider.cjs} +1 -1
- package/lib/utils/ThemeProvider.cjs.map +1 -0
- package/lib/utils/ThemeProvider.mjs +4 -4
- package/lib/utils/{addonText.js → addonText.cjs} +1 -1
- package/lib/utils/addonText.cjs.map +1 -0
- package/lib/utils/addonText.d.ts +1 -1
- package/lib/{cjs/utils/addonTextChildren.js → utils/addonTextChildren.cjs} +1 -1
- package/lib/utils/addonTextChildren.cjs.map +1 -0
- package/lib/utils/addonTextChildren.mjs +1 -1
- package/lib/utils/{ariaProps.js → ariaProps.cjs} +1 -1
- package/lib/utils/ariaProps.cjs.map +1 -0
- package/lib/{cjs/utils/assignProps.js → utils/assignProps.cjs} +1 -1
- package/lib/utils/assignProps.cjs.map +1 -0
- package/lib/utils/assignProps.mjs +9 -9
- package/lib/utils/{canUseDOM.js → canUseDOM.cjs} +1 -1
- package/lib/utils/canUseDOM.cjs.map +1 -0
- package/lib/utils/{capitalizeFirstLetter.js → capitalizeFirstLetter.cjs} +1 -1
- package/lib/utils/capitalizeFirstLetter.cjs.map +1 -0
- package/lib/utils/{color.js → color.cjs} +1 -1
- package/lib/utils/color.cjs.map +1 -0
- package/lib/utils/color.mjs +2 -2
- package/lib/{cjs/utils/compose.js → utils/compose.cjs} +1 -1
- package/lib/utils/compose.cjs.map +1 -0
- package/lib/{cjs/utils/createHoc.js → utils/createHoc.cjs} +1 -1
- package/lib/utils/createHoc.cjs.map +1 -0
- package/lib/utils/createHoc.mjs +8 -8
- package/lib/{cjs/utils/createUUID.js → utils/createUUID.cjs} +1 -1
- package/lib/utils/createUUID.cjs.map +1 -0
- package/lib/utils/{cssToIntDefault.js → cssToIntDefault.cjs} +1 -1
- package/lib/utils/cssToIntDefault.cjs.map +1 -0
- package/lib/utils/enhances/{WithAutoFocus.js → WithAutoFocus.cjs} +1 -1
- package/lib/utils/enhances/WithAutoFocus.cjs.map +1 -0
- package/lib/utils/enhances/WithAutoFocus.mjs +6 -6
- package/lib/{cjs/utils/enhances/WithCSS.js → utils/enhances/WithCSS.cjs} +1 -1
- package/lib/utils/enhances/WithCSS.cjs.map +1 -0
- package/lib/utils/enhances/WithCSS.mjs +6 -6
- package/lib/{cjs/utils/enhances/WithI18n.js → utils/enhances/WithI18n.cjs} +1 -1
- package/lib/utils/enhances/WithI18n.cjs.map +1 -0
- package/lib/utils/enhances/WithI18n.mjs +6 -6
- package/lib/utils/enhances/{WithKeyboardFocus.js → WithKeyboardFocus.cjs} +1 -1
- package/lib/utils/enhances/WithKeyboardFocus.cjs.map +1 -0
- package/lib/utils/enhances/WithKeyboardFocus.mjs +6 -6
- package/lib/{cjs/utils/enhances/WithRef.js → utils/enhances/WithRef.cjs} +1 -1
- package/lib/utils/enhances/WithRef.cjs.map +1 -0
- package/lib/utils/enhances/WithRef.mjs +1 -1
- package/lib/{cjs/utils/enhances/a11yEnhance.js → utils/enhances/a11yEnhance.cjs} +1 -1
- package/lib/utils/enhances/a11yEnhance.cjs.map +1 -0
- package/lib/utils/enhances/a11yEnhance.mjs +2 -2
- package/lib/utils/enhances/{animatedSizeEnhance.js → animatedSizeEnhance.cjs} +1 -1
- package/lib/utils/enhances/animatedSizeEnhance.cjs.map +1 -0
- package/lib/utils/enhances/animatedSizeEnhance.mjs +15 -15
- package/lib/utils/enhances/animatedSizeEnhance.mjs.map +1 -1
- package/lib/utils/enhances/{autoFocusEnhance.js → autoFocusEnhance.cjs} +1 -1
- package/lib/utils/enhances/autoFocusEnhance.cjs.map +1 -0
- package/lib/utils/enhances/autoFocusEnhance.mjs +2 -2
- package/lib/utils/enhances/{contextEnhance.js → contextEnhance.cjs} +1 -1
- package/lib/utils/enhances/contextEnhance.cjs.map +1 -0
- package/lib/utils/enhances/contextEnhance.mjs +4 -4
- package/lib/{cjs/utils/enhances/i18nEnhance.js → utils/enhances/i18nEnhance.cjs} +1 -1
- package/lib/utils/enhances/i18nEnhance.cjs.map +1 -0
- package/lib/utils/enhances/i18nEnhance.mjs +9 -9
- package/lib/utils/enhances/{keyboardFocusEnhance.js → keyboardFocusEnhance.cjs} +1 -1
- package/lib/utils/enhances/keyboardFocusEnhance.cjs.map +1 -0
- package/lib/utils/enhances/keyboardFocusEnhance.mjs +1 -1
- package/lib/{cjs/utils/enhances/resolveColorEnhance.js → utils/enhances/resolveColorEnhance.cjs} +1 -1
- package/lib/utils/enhances/resolveColorEnhance.cjs.map +1 -0
- package/lib/{cjs/utils/eventEmitter.js → utils/eventEmitter.cjs} +1 -1
- package/lib/utils/eventEmitter.cjs.map +1 -0
- package/lib/utils/eventEmitter.mjs +3 -3
- package/lib/{cjs/utils/findComponent.js → utils/findComponent.cjs} +1 -1
- package/lib/utils/findComponent.cjs.map +1 -0
- package/lib/{cjs/utils/fire.js → utils/fire.cjs} +1 -1
- package/lib/utils/fire.cjs.map +1 -0
- package/lib/utils/focus-lock/{focusBorders.js → focusBorders.cjs} +1 -1
- package/lib/utils/focus-lock/focusBorders.cjs.map +1 -0
- package/lib/utils/focus-lock/{getFocusableIn.js → getFocusableIn.cjs} +1 -1
- package/lib/utils/focus-lock/getFocusableIn.cjs.map +1 -0
- package/lib/{cjs/utils/focus-lock/isFocusInside.js → utils/focus-lock/isFocusInside.cjs} +1 -1
- package/lib/utils/focus-lock/isFocusInside.cjs.map +1 -0
- package/lib/{cjs/utils/focus-lock/isFocusable.js → utils/focus-lock/isFocusable.cjs} +1 -1
- package/lib/utils/focus-lock/isFocusable.cjs.map +1 -0
- package/lib/utils/focus-lock/isFocusable.mjs +1 -1
- package/lib/utils/focus-lock/{setFocus.js → setFocus.cjs} +1 -1
- package/lib/utils/focus-lock/setFocus.cjs.map +1 -0
- package/lib/utils/{getAccessibleName.js → getAccessibleName.cjs} +1 -1
- package/lib/utils/getAccessibleName.cjs.map +1 -0
- package/lib/utils/getAccessibleName.mjs +1 -1
- package/lib/utils/{getDisplayName.js → getDisplayName.cjs} +1 -1
- package/lib/utils/getDisplayName.cjs.map +1 -0
- package/lib/{cjs/utils/getEventTarget.js → utils/getEventTarget.cjs} +1 -1
- package/lib/utils/getEventTarget.cjs.map +1 -0
- package/lib/utils/getEventTarget.mjs +1 -1
- package/lib/{cjs/utils/getOriginChildren.js → utils/getOriginChildren.cjs} +1 -1
- package/lib/utils/getOriginChildren.cjs.map +1 -0
- package/lib/{cjs/utils/getRandomInt.js → utils/getRandomInt.cjs} +1 -1
- package/lib/utils/getRandomInt.cjs.map +1 -0
- package/lib/{cjs/utils/getValue.js → utils/getValue.cjs} +1 -1
- package/lib/utils/getValue.cjs.map +1 -0
- package/lib/utils/{hasLabels.js → hasLabels.cjs} +1 -1
- package/lib/utils/hasLabels.cjs.map +1 -0
- package/lib/utils/hasLabels.mjs +1 -1
- package/lib/{cjs/utils/hasParent.js → utils/hasParent.cjs} +1 -1
- package/lib/utils/hasParent.cjs.map +1 -0
- package/lib/{cjs/utils/if.js → utils/if.cjs} +1 -1
- package/lib/utils/if.cjs.map +1 -0
- package/lib/utils/{ifChildren.js → ifChildren.cjs} +1 -1
- package/lib/utils/ifChildren.cjs.map +1 -0
- package/lib/{cjs/utils/injectStyle.js → utils/injectStyle.cjs} +1 -1
- package/lib/utils/injectStyle.cjs.map +1 -0
- package/lib/utils/injectStyle.mjs +1 -1
- package/lib/utils/{inputProps.js → inputProps.cjs} +1 -1
- package/lib/utils/inputProps.cjs.map +1 -0
- package/lib/utils/{isNode.js → isNode.cjs} +1 -1
- package/lib/utils/isNode.cjs.map +1 -0
- package/lib/utils/isNode.mjs +1 -1
- package/lib/utils/{isPromise.js → isPromise.cjs} +1 -1
- package/lib/utils/isPromise.cjs.map +1 -0
- package/lib/{cjs/utils/isRetina.js → utils/isRetina.cjs} +1 -1
- package/lib/utils/isRetina.cjs.map +1 -0
- package/lib/{cjs/utils/logger.js → utils/logger.cjs} +1 -1
- package/lib/utils/logger.cjs.map +1 -0
- package/lib/utils/logger.mjs +3 -3
- package/lib/utils/{numericChecker.js → numericChecker.cjs} +1 -1
- package/lib/utils/numericChecker.cjs.map +1 -0
- package/lib/utils/{ownerDocument.js → ownerDocument.cjs} +1 -1
- package/lib/utils/ownerDocument.cjs.map +1 -0
- package/lib/{cjs/utils/pick.js → utils/pick.cjs} +1 -1
- package/lib/utils/pick.cjs.map +1 -0
- package/lib/utils/{propsForElement.js → propsForElement.cjs} +1 -1
- package/lib/utils/propsForElement.cjs.map +1 -0
- package/lib/utils/propsForElement.mjs +1 -1
- package/lib/{cjs/utils/rafTrottle.js → utils/rafTrottle.cjs} +1 -1
- package/lib/utils/rafTrottle.cjs.map +1 -0
- package/lib/{cjs/utils/reactToText.js → utils/reactToText.cjs} +1 -1
- package/lib/utils/reactToText.cjs.map +1 -0
- package/lib/utils/{ref.js → ref.cjs} +1 -1
- package/lib/utils/ref.cjs.map +1 -0
- package/lib/utils/ref.mjs +2 -2
- package/lib/{cjs/utils/setRef.js → utils/setRef.cjs} +1 -1
- package/lib/utils/setRef.cjs.map +1 -0
- package/lib/{cjs/utils/syncScroll.js → utils/syncScroll.cjs} +1 -1
- package/lib/utils/syncScroll.cjs.map +1 -0
- package/lib/utils/syncScroll.mjs +1 -1
- package/lib/{cjs/utils/uncontroll.js → utils/uncontroll.cjs} +1 -1
- package/lib/utils/uncontroll.cjs.map +1 -0
- package/lib/utils/uncontroll.mjs +1 -1
- package/lib/{cjs/utils/uniqueID.js → utils/uniqueID.cjs} +1 -1
- package/lib/utils/uniqueID.cjs.map +1 -0
- package/lib/utils/uniqueID.mjs +2 -2
- package/lib/utils/use/{useColorResolver.js → useColorResolver.cjs} +1 -1
- package/lib/utils/use/useColorResolver.cjs.map +1 -0
- package/lib/utils/use/{useCss.js → useCss.cjs} +1 -1
- package/lib/utils/use/useCss.cjs.map +1 -0
- package/lib/utils/use/{useEnhancedEffect.js → useEnhancedEffect.cjs} +1 -1
- package/lib/utils/use/useEnhancedEffect.cjs.map +1 -0
- package/lib/utils/use/{useEventCallback.js → useEventCallback.cjs} +1 -1
- package/lib/utils/use/useEventCallback.cjs.map +1 -0
- package/lib/utils/use/{useEventListener.js → useEventListener.cjs} +1 -1
- package/lib/utils/use/useEventListener.cjs.map +1 -0
- package/lib/utils/use/{useFocusLock.js → useFocusLock.cjs} +1 -1
- package/lib/utils/use/useFocusLock.cjs.map +1 -0
- package/lib/utils/use/useFocusLock.mjs +2 -2
- package/lib/{cjs/utils/use/usePreventScroll.js → utils/use/usePreventScroll.cjs} +1 -1
- package/lib/utils/use/usePreventScroll.cjs.map +1 -0
- package/lib/utils/{useCssVariable.js → useCssVariable.cjs} +1 -1
- package/lib/utils/useCssVariable.cjs.map +1 -0
- package/lib/utils/useCssVariable.mjs +3 -3
- package/lib/utils/{zIndexStacking.js → zIndexStacking.cjs} +1 -1
- package/lib/utils/zIndexStacking.cjs.map +1 -0
- package/lib/utils/zIndexStacking.mjs +3 -3
- package/package.json +8 -9
- package/vite.config.ts +15 -0
- 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.map +0 -1
- 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.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.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.map +0 -1
- package/lib/cjs/index.js.map +0 -1
- package/lib/cjs/register.js.map +0 -1
- package/lib/cjs/styled/index.js.map +0 -1
- 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.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.map +0 -1
- package/lib/cjs/theme/utils.js.map +0 -1
- 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.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.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.map +0 -1
- package/lib/cjs/utils/createHoc.js.map +0 -1
- 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.map +0 -1
- 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.map +0 -1
- 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.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.map +0 -1
- package/lib/cjs/utils/eventEmitter.js.map +0 -1
- package/lib/cjs/utils/findComponent.js.map +0 -1
- 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.map +0 -1
- 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.map +0 -1
- package/lib/cjs/utils/getOriginChildren.js.map +0 -1
- package/lib/cjs/utils/getRandomInt.js.map +0 -1
- 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.map +0 -1
- 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.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.map +0 -1
- 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.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.map +0 -1
- 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.map +0 -1
- package/lib/cjs/utils/syncScroll.js.map +0 -1
- package/lib/cjs/utils/uncontroll.js.map +0 -1
- 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.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.map +0 -1
- package/lib/core-types/UnknownProperties.js +0 -2
- package/lib/core-types/UnknownProperties.js.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/symbols.js.map +0 -1
- package/lib/enhancement/Children.js +0 -119
- package/lib/enhancement/Children.js.map +0 -1
- package/lib/enhancement/Root.js.map +0 -1
- package/lib/enhancement/bindHandler.js.map +0 -1
- package/lib/enhancement/dataName.js.map +0 -1
- package/lib/enhancement/enhance.js +0 -22
- package/lib/enhancement/enhance.js.map +0 -1
- package/lib/enhancement/functionDefaultProps.js.map +0 -1
- package/lib/enhancement/hoistProps.js.map +0 -1
- package/lib/enhancement/i18n.js.map +0 -1
- package/lib/enhancement/inheritedName.js +0 -23
- package/lib/enhancement/inheritedName.js.map +0 -1
- package/lib/enhancement/staticChildren.js.map +0 -1
- package/lib/enhancement/style.js.map +0 -1
- package/lib/enhancement/uncontrolledProps.js +0 -131
- package/lib/enhancement/uncontrolledProps.js.map +0 -1
- 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.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.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/esm/_virtual/_commonjsHelpers.mjs +0 -6
- package/lib/esm/_virtual/index.mjs +0 -4
- package/lib/esm/_virtual/index2.mjs +0 -4
- package/lib/esm/_virtual/react-is.development.mjs +0 -4
- package/lib/esm/_virtual/react-is.production.min.mjs +0 -4
- package/lib/register.js +0 -37
- package/lib/register.js.map +0 -1
- package/lib/styled/index.js +0 -32
- package/lib/styled/index.js.map +0 -1
- package/lib/styled/reshadow-core.js +0 -256
- package/lib/styled/reshadow-core.js.map +0 -1
- package/lib/styled/sstyled.js.map +0 -1
- package/lib/theme/processor.js.map +0 -1
- package/lib/theme/themes/dark.js +0 -385
- package/lib/theme/themes/dark.js.map +0 -1
- package/lib/theme/themes/default.js.map +0 -1
- package/lib/theme/themes/light.js +0 -394
- package/lib/theme/themes/light.js.map +0 -1
- package/lib/theme/utils.js +0 -297
- package/lib/theme/utils.js.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/ScreenReaderOnly.js.map +0 -1
- package/lib/utils/ThemeProvider.js.map +0 -1
- package/lib/utils/addonText.js.map +0 -1
- package/lib/utils/addonTextChildren.js +0 -45
- package/lib/utils/addonTextChildren.js.map +0 -1
- package/lib/utils/ariaProps.js.map +0 -1
- package/lib/utils/assignProps.js +0 -93
- package/lib/utils/assignProps.js.map +0 -1
- package/lib/utils/canUseDOM.js.map +0 -1
- package/lib/utils/capitalizeFirstLetter.js.map +0 -1
- package/lib/utils/color.js.map +0 -1
- package/lib/utils/compose.js +0 -21
- package/lib/utils/compose.js.map +0 -1
- package/lib/utils/createHoc.js +0 -55
- package/lib/utils/createHoc.js.map +0 -1
- package/lib/utils/createUUID.js +0 -15
- package/lib/utils/createUUID.js.map +0 -1
- package/lib/utils/cssToIntDefault.js.map +0 -1
- package/lib/utils/enhances/WithAutoFocus.js.map +0 -1
- package/lib/utils/enhances/WithCSS.js +0 -93
- package/lib/utils/enhances/WithCSS.js.map +0 -1
- package/lib/utils/enhances/WithI18n.js +0 -95
- package/lib/utils/enhances/WithI18n.js.map +0 -1
- package/lib/utils/enhances/WithKeyboardFocus.js.map +0 -1
- package/lib/utils/enhances/WithRef.js +0 -26
- package/lib/utils/enhances/WithRef.js.map +0 -1
- package/lib/utils/enhances/a11yEnhance.js +0 -74
- package/lib/utils/enhances/a11yEnhance.js.map +0 -1
- package/lib/utils/enhances/animatedSizeEnhance.js.map +0 -1
- package/lib/utils/enhances/autoFocusEnhance.js.map +0 -1
- package/lib/utils/enhances/contextEnhance.js.map +0 -1
- package/lib/utils/enhances/i18nEnhance.js +0 -101
- package/lib/utils/enhances/i18nEnhance.js.map +0 -1
- package/lib/utils/enhances/keyboardFocusEnhance.js.map +0 -1
- package/lib/utils/enhances/resolveColorEnhance.js +0 -25
- package/lib/utils/enhances/resolveColorEnhance.js.map +0 -1
- package/lib/utils/eventEmitter.js +0 -41
- package/lib/utils/eventEmitter.js.map +0 -1
- package/lib/utils/findComponent.js +0 -106
- package/lib/utils/findComponent.js.map +0 -1
- package/lib/utils/fire.js +0 -23
- package/lib/utils/fire.js.map +0 -1
- package/lib/utils/focus-lock/focusBorders.js.map +0 -1
- package/lib/utils/focus-lock/getFocusableIn.js.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/isFocusable.js +0 -51
- package/lib/utils/focus-lock/isFocusable.js.map +0 -1
- package/lib/utils/focus-lock/setFocus.js.map +0 -1
- package/lib/utils/getAccessibleName.js.map +0 -1
- package/lib/utils/getDisplayName.js.map +0 -1
- package/lib/utils/getEventTarget.js +0 -53
- package/lib/utils/getEventTarget.js.map +0 -1
- package/lib/utils/getOriginChildren.js +0 -18
- package/lib/utils/getOriginChildren.js.map +0 -1
- package/lib/utils/getRandomInt.js +0 -11
- package/lib/utils/getRandomInt.js.map +0 -1
- package/lib/utils/getValue.js +0 -16
- package/lib/utils/getValue.js.map +0 -1
- package/lib/utils/hasLabels.js.map +0 -1
- package/lib/utils/hasParent.js +0 -14
- package/lib/utils/hasParent.js.map +0 -1
- package/lib/utils/if.js +0 -16
- package/lib/utils/if.js.map +0 -1
- package/lib/utils/ifChildren.js.map +0 -1
- package/lib/utils/injectStyle.js +0 -49
- package/lib/utils/injectStyle.js.map +0 -1
- package/lib/utils/inputProps.js.map +0 -1
- package/lib/utils/isNode.js.map +0 -1
- package/lib/utils/isPromise.js.map +0 -1
- package/lib/utils/isRetina.js +0 -15
- package/lib/utils/isRetina.js.map +0 -1
- package/lib/utils/logger.js +0 -40
- package/lib/utils/logger.js.map +0 -1
- package/lib/utils/numericChecker.js.map +0 -1
- package/lib/utils/ownerDocument.js.map +0 -1
- package/lib/utils/pick.js +0 -19
- package/lib/utils/pick.js.map +0 -1
- package/lib/utils/propsForElement.js.map +0 -1
- package/lib/utils/rafTrottle.js +0 -33
- package/lib/utils/rafTrottle.js.map +0 -1
- package/lib/utils/reactToText.js +0 -33
- package/lib/utils/reactToText.js.map +0 -1
- package/lib/utils/ref.js.map +0 -1
- package/lib/utils/setRef.js +0 -10
- package/lib/utils/setRef.js.map +0 -1
- package/lib/utils/syncScroll.js +0 -61
- package/lib/utils/syncScroll.js.map +0 -1
- package/lib/utils/uncontroll.js +0 -47
- package/lib/utils/uncontroll.js.map +0 -1
- package/lib/utils/uniqueID.js +0 -42
- package/lib/utils/uniqueID.js.map +0 -1
- package/lib/utils/use/useColorResolver.js.map +0 -1
- package/lib/utils/use/useCss.js.map +0 -1
- package/lib/utils/use/useEnhancedEffect.js.map +0 -1
- package/lib/utils/use/useEventCallback.js.map +0 -1
- package/lib/utils/use/useEventListener.js.map +0 -1
- package/lib/utils/use/useFocusLock.js.map +0 -1
- package/lib/utils/use/usePreventScroll.js +0 -78
- package/lib/utils/use/usePreventScroll.js.map +0 -1
- package/lib/utils/useCssVariable.js.map +0 -1
- package/lib/utils/zIndexStacking.js.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,88 +0,0 @@
|
|
|
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 'react';
|
|
6
|
-
import assignProps from '../utils/assignProps';
|
|
7
|
-
import useEnhancedEffect from '../utils/use/useEnhancedEffect';
|
|
8
|
-
import pick from '../utils/pick';
|
|
9
|
-
export var HOIST_CONTEXT = Symbol('HOIST_CONTEXT');
|
|
10
|
-
var HOIST_SELF = Symbol('HOIST_SELF');
|
|
11
|
-
var HOIST_SET = Symbol('HOIST_SET');
|
|
12
|
-
function flatChildComponent(childComponents) {
|
|
13
|
-
return Object.values(childComponents).reduce(function (acc, Component) {
|
|
14
|
-
if (Array.isArray(Component)) {
|
|
15
|
-
acc.push(Component[0]);
|
|
16
|
-
acc.push.apply(acc, _toConsumableArray(flatChildComponent(Component[1])));
|
|
17
|
-
} else {
|
|
18
|
-
acc.push(Component);
|
|
19
|
-
}
|
|
20
|
-
return acc;
|
|
21
|
-
}, []);
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
/** @deprecated Doesn't work in ssr and sometimes breakes rulles of hooks. We should never use it. */
|
|
25
|
-
function Enhancement(childComponents, Context) {
|
|
26
|
-
return {
|
|
27
|
-
condition: function condition(Component) {
|
|
28
|
-
return [Component].concat(_toConsumableArray(flatChildComponent(childComponents))).some(function (Component) {
|
|
29
|
-
var _Component$hoistProps;
|
|
30
|
-
return Boolean((_Component$hoistProps = Component.hoistProps) === null || _Component$hoistProps === void 0 ? void 0 : _Component$hoistProps.length);
|
|
31
|
-
});
|
|
32
|
-
},
|
|
33
|
-
init: function init(props, WrapperComponent, isFunction) {
|
|
34
|
-
var _this = this;
|
|
35
|
-
if (isFunction) {
|
|
36
|
-
// TODO: might breake rules of hooks (by lsroman)
|
|
37
|
-
this[HOIST_SELF] = React.useState({});
|
|
38
|
-
} else {
|
|
39
|
-
this[HOIST_SELF] = [{}, function (obj) {
|
|
40
|
-
_this[HOIST_SELF][0] = obj;
|
|
41
|
-
_this.forceUpdate();
|
|
42
|
-
}];
|
|
43
|
-
}
|
|
44
|
-
// For optimization render
|
|
45
|
-
this[HOIST_SET] = function (obj) {
|
|
46
|
-
_this[HOIST_SELF][1](obj);
|
|
47
|
-
};
|
|
48
|
-
},
|
|
49
|
-
context: function context(_context) {
|
|
50
|
-
// TODO: need to optimizte container initialization (by lsroman)
|
|
51
|
-
// WrapperComponent.hoistProps
|
|
52
|
-
return _objectSpread(_objectSpread({}, _context), {}, _defineProperty({}, HOIST_CONTEXT, this[HOIST_SET]));
|
|
53
|
-
},
|
|
54
|
-
asProps: function asProps(props) {
|
|
55
|
-
// TODO: need to check for no props overwriting (by lsroman)
|
|
56
|
-
return assignProps(this[HOIST_SELF][0], props);
|
|
57
|
-
},
|
|
58
|
-
wrapperProps: function wrapperProps(props, WrapperComponent) {
|
|
59
|
-
var _WrapperComponent$hoi;
|
|
60
|
-
if ((_WrapperComponent$hoi = WrapperComponent.hoistProps) !== null && _WrapperComponent$hoi !== void 0 && _WrapperComponent$hoi.length) {
|
|
61
|
-
var context = React.useContext(Context);
|
|
62
|
-
var renameProps = WrapperComponent.hoistProps.reduce(function (acc, propName) {
|
|
63
|
-
var _propName$split = propName.split(':'),
|
|
64
|
-
_propName$split2 = _slicedToArray(_propName$split, 2),
|
|
65
|
-
name = _propName$split2[0],
|
|
66
|
-
rename = _propName$split2[1];
|
|
67
|
-
acc[name] = rename || name;
|
|
68
|
-
return acc;
|
|
69
|
-
}, {});
|
|
70
|
-
var hoistProps = Object.entries(pick(props, Object.keys(renameProps))).reduce(function (acc, _ref) {
|
|
71
|
-
var _ref2 = _slicedToArray(_ref, 2),
|
|
72
|
-
name = _ref2[0],
|
|
73
|
-
value = _ref2[1];
|
|
74
|
-
acc[renameProps[name]] = value;
|
|
75
|
-
return acc;
|
|
76
|
-
}, {});
|
|
77
|
-
useEnhancedEffect(function () {
|
|
78
|
-
if (context[HOIST_CONTEXT]) {
|
|
79
|
-
context[HOIST_CONTEXT](hoistProps);
|
|
80
|
-
}
|
|
81
|
-
}, Object.values(hoistProps));
|
|
82
|
-
}
|
|
83
|
-
return props;
|
|
84
|
-
}
|
|
85
|
-
};
|
|
86
|
-
}
|
|
87
|
-
export default Enhancement;
|
|
88
|
-
//# sourceMappingURL=hoistProps.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"hoistProps.js","names":["React","assignProps","useEnhancedEffect","pick","HOIST_CONTEXT","Symbol","HOIST_SELF","HOIST_SET","flatChildComponent","childComponents","Object","values","reduce","acc","Component","Array","isArray","push","apply","_toConsumableArray","Enhancement","Context","condition","concat","some","_Component$hoistProps","Boolean","hoistProps","length","init","props","WrapperComponent","isFunction","_this","useState","obj","forceUpdate","context","_objectSpread","_defineProperty","asProps","wrapperProps","_WrapperComponent$hoi","useContext","renameProps","propName","_propName$split","split","_propName$split2","_slicedToArray","name","rename","entries","keys","_ref","_ref2","value"],"sources":["../../../src/enhancement/hoistProps.tsx"],"sourcesContent":["import React from 'react';\nimport assignProps from '../utils/assignProps';\nimport useEnhancedEffect from '../utils/use/useEnhancedEffect';\nimport pick from '../utils/pick';\n\nexport const HOIST_CONTEXT = Symbol('HOIST_CONTEXT');\nconst HOIST_SELF = Symbol('HOIST_SELF');\nconst HOIST_SET = Symbol('HOIST_SET');\n\nfunction flatChildComponent(childComponents: any) {\n return Object.values(childComponents).reduce<unknown[]>((acc, Component) => {\n if (Array.isArray(Component)) {\n acc.push(Component[0]);\n acc.push(...flatChildComponent(Component[1]));\n } else {\n acc.push(Component);\n }\n return acc;\n }, []);\n}\n\n/** @deprecated Doesn't work in ssr and sometimes breakes rulles of hooks. We should never use it. */\nfunction Enhancement(childComponents: any, Context: any) {\n return {\n condition: function (Component: any) {\n return [Component, ...flatChildComponent(childComponents)].some((Component) =>\n Boolean(Component.hoistProps?.length),\n );\n },\n init: function (this: any, props: any, WrapperComponent: any, isFunction: boolean) {\n if (isFunction) {\n // TODO: might breake rules of hooks (by lsroman)\n this[HOIST_SELF] = React.useState({});\n } else {\n this[HOIST_SELF] = [\n {},\n (obj: any) => {\n this[HOIST_SELF][0] = obj;\n this.forceUpdate();\n },\n ];\n }\n // For optimization render\n this[HOIST_SET] = (obj: any) => {\n this[HOIST_SELF][1](obj);\n };\n },\n context: function (this: any, context: any) {\n // TODO: need to optimizte container initialization (by lsroman)\n // WrapperComponent.hoistProps\n return {\n ...context,\n [HOIST_CONTEXT]: this[HOIST_SET],\n };\n },\n asProps: function (this: any, props: any) {\n // TODO: need to check for no props overwriting (by lsroman)\n return assignProps(this[HOIST_SELF][0], props);\n },\n wrapperProps: function (props: any, WrapperComponent: any) {\n if (WrapperComponent.hoistProps?.length) {\n const context: any = React.useContext(Context);\n const renameProps: any = WrapperComponent.hoistProps.reduce((acc: any, propName: any) => {\n const [name, rename] = propName.split(':');\n acc[name] = rename || name;\n return acc;\n }, {});\n const hoistProps = Object.entries(pick(props, Object.keys(renameProps))).reduce(\n (acc: any, [name, value]) => {\n acc[renameProps[name]] = value;\n return acc;\n },\n {},\n );\n\n useEnhancedEffect(() => {\n if (context[HOIST_CONTEXT]) {\n context[HOIST_CONTEXT](hoistProps);\n }\n }, Object.values(hoistProps));\n }\n return props;\n },\n };\n}\n\nexport default Enhancement;\n"],"mappings":";;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,WAAW,MAAM,sBAAsB;AAC9C,OAAOC,iBAAiB,MAAM,gCAAgC;AAC9D,OAAOC,IAAI,MAAM,eAAe;AAEhC,OAAO,IAAMC,aAAa,GAAGC,MAAM,CAAC,eAAe,CAAC;AACpD,IAAMC,UAAU,GAAGD,MAAM,CAAC,YAAY,CAAC;AACvC,IAAME,SAAS,GAAGF,MAAM,CAAC,WAAW,CAAC;AAErC,SAASG,kBAAkBA,CAACC,eAAoB,EAAE;EAChD,OAAOC,MAAM,CAACC,MAAM,CAACF,eAAe,CAAC,CAACG,MAAM,CAAY,U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AC7E,UAACC,GAAQ,EAAAyC,IAAA,EAAoB;UAAA,IAAAC,KAAA,GAAAN,cAAA,CAAAK,IAAA;YAAjBJ,IAAI,GAAAK,KAAA;YAAEC,KAAK,GAAAD,KAAA;UACrB1C,GAAG,CAAC+B,WAAW,CAACM,IAAI,CAAC,CAAC,GAAGM,KAAK;UAC9B,OAAO3C,GAAG;QACZ,CAAC,EACD,CAAC,CAAC,CACH;QAEDX,iBAAiB,CAAC,YAAM;UACtB,IAAImC,OAAO,CAACjC,aAAa,CAAC,EAAE;YAC1BiC,OAAO,CAACjC,aAAa,CAAC,CAACuB,UAAU,CAAC;UACpC;QACF,CAAC,EAAEjB,MAAM,CAACC,MAAM,CAACgB,UAAU,CAAC,CAAC;MAC/B;MACA,OAAOG,KAAK;IACd;EACF,CAAC;AACH;AAEA,eAAeV,WAAW"}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import _objectSpread from "@babel/runtime/helpers/objectSpread2";
|
|
2
|
-
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
-
var _excluded = ["locale"];
|
|
4
|
-
import React from 'react';
|
|
5
|
-
import { Context } from '../utils/enhances/WithI18n';
|
|
6
|
-
function i18nAppLocaleEnhance() {
|
|
7
|
-
return {
|
|
8
|
-
wrapperProps: function wrapperProps(props) {
|
|
9
|
-
var locale = props.locale,
|
|
10
|
-
other = _objectWithoutProperties(props, _excluded);
|
|
11
|
-
var contextLocale = React.useContext(Context);
|
|
12
|
-
if (!locale && !contextLocale) return props;
|
|
13
|
-
return _objectSpread(_objectSpread({}, other), {}, {
|
|
14
|
-
locale: locale !== null && locale !== void 0 ? locale : contextLocale
|
|
15
|
-
});
|
|
16
|
-
}
|
|
17
|
-
};
|
|
18
|
-
}
|
|
19
|
-
export default i18nAppLocaleEnhance;
|
|
20
|
-
//# sourceMappingURL=i18n.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"i18n.js","names":["React","Context","i18nAppLocaleEnhance","wrapperProps","props","locale","other","_objectWithoutProperties","_excluded","contextLocale","useContext","_objectSpread"],"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,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,OAAO,QAAQ,4BAA4B;AAEpD,SAASC,oBAAoBA,CAAA,EAAG;EAC9B,OAAO;IACLC,YAAY,EAAE,SAAAA,aAACC,KAAU,EAAK;MAC5B,IAAQC,MAAM,GAAeD,KAAK,CAA1BC,MAAM;QAAKC,KAAK,GAAAC,wBAAA,CAAKH,KAAK,EAAAI,SAAA;MAClC,IAAMC,aAAa,GAAGT,KAAK,CAACU,UAAU,CAACT,OAAO,CAAC;MAC/C,IAAI,CAACI,MAAM,IAAI,CAACI,aAAa,EAAE,OAAOL,KAAK;MAC3C,OAAAO,aAAA,CAAAA,aAAA,KACKL,KAAK;QACRD,MAAM,EAAEA,MAAM,aAANA,MAAM,cAANA,MAAM,GAAII;MAAa;IAEnC;EACF,CAAC;AACH;AAEA,eAAeP,oBAAoB"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
-
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
3
|
-
import { INHERITED_NAME } from '../core-types/symbols';
|
|
4
|
-
function Enhancement() {
|
|
5
|
-
return {
|
|
6
|
-
condition: function condition(Component) {
|
|
7
|
-
return Boolean(Component.displayName);
|
|
8
|
-
},
|
|
9
|
-
"static": function _static(WrapperComponent) {
|
|
10
|
-
return _defineProperty({}, INHERITED_NAME, _toConsumableArray(new Set([].concat(_toConsumableArray(WrapperComponent[INHERITED_NAME] || []), [WrapperComponent.displayName]))));
|
|
11
|
-
}
|
|
12
|
-
};
|
|
13
|
-
}
|
|
14
|
-
export default Enhancement;
|
|
15
|
-
//# sourceMappingURL=inheritedName.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"inheritedName.js","names":["INHERITED_NAME","Enhancement","condition","Component","Boolean","displayName","_static","WrapperComponent","_defineProperty","_toConsumableArray","Set","concat"],"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,SAASA,cAAc,QAAQ,uBAAuB;AAEtD,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,OAAAC,eAAA,KACGR,cAAc,EAAAS,kBAAA,CACV,IAAIC,GAAG,IAAAC,MAAA,CAAAF,kBAAA,CAAMF,gBAAgB,CAACP,cAAc,CAAC,IAAI,EAAE,IAAGO,gBAAgB,CAACF,WAAW,GAAE;IAG7F;EACF,CAAC;AACH;AAEA,eAAeJ,WAAW"}
|
|
@@ -1,123 +0,0 @@
|
|
|
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 'react';
|
|
5
|
-
import assignProps from '../utils/assignProps';
|
|
6
|
-
import pick from '../utils/pick';
|
|
7
|
-
import logger from '../utils/logger';
|
|
8
|
-
function assign(target, source) {
|
|
9
|
-
return Object.defineProperties(target, Object.keys(source).reduce(function (descriptors, key) {
|
|
10
|
-
descriptors[key] = Object.getOwnPropertyDescriptor(source, key);
|
|
11
|
-
return descriptors;
|
|
12
|
-
}, {}));
|
|
13
|
-
}
|
|
14
|
-
export function getterMethodName(name) {
|
|
15
|
-
return "get".concat(name, "Props");
|
|
16
|
-
}
|
|
17
|
-
export function getterMethodNameByDisplayName() {
|
|
18
|
-
var displayName = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
|
19
|
-
var displayNames = displayName.split('.');
|
|
20
|
-
var name = displayNames.slice(-(displayNames.length - 1)).join('');
|
|
21
|
-
return getterMethodName(name);
|
|
22
|
-
}
|
|
23
|
-
function flatGetterMethodNames(childComponents, parentName) {
|
|
24
|
-
return Object.entries(childComponents).reduce(function (acc, _ref) {
|
|
25
|
-
var _ref2 = _slicedToArray(_ref, 2),
|
|
26
|
-
name = _ref2[0],
|
|
27
|
-
value = _ref2[1];
|
|
28
|
-
if (Array.isArray(value)) {
|
|
29
|
-
acc.push.apply(acc, _toConsumableArray(flatGetterMethodNames(value[1], name)));
|
|
30
|
-
}
|
|
31
|
-
name = parentName ? "".concat(parentName).concat(name) : name;
|
|
32
|
-
acc.push(getterMethodName(name));
|
|
33
|
-
return acc;
|
|
34
|
-
}, []);
|
|
35
|
-
}
|
|
36
|
-
export var STATIC_COMPONENT = Symbol('STATIC_COMPONENT');
|
|
37
|
-
export var ROOT_COMPONENT = Symbol('ROOT_COMPONENT');
|
|
38
|
-
var SELF_GETTER_METHOD = Symbol('SELF_GETTER_METHOD');
|
|
39
|
-
function Enhancement(childComponents, createComponent, options) {
|
|
40
|
-
var getterMethodNames = flatGetterMethodNames(childComponents);
|
|
41
|
-
return {
|
|
42
|
-
condition: function condition(Component) {
|
|
43
|
-
return Boolean(Component[STATIC_COMPONENT] || Object.keys(childComponents).length);
|
|
44
|
-
},
|
|
45
|
-
init: function init(props, WrapperComponent) {
|
|
46
|
-
var _this = this;
|
|
47
|
-
var getterMethods = pick(this, getterMethodNames);
|
|
48
|
-
this[SELF_GETTER_METHOD] = function () {
|
|
49
|
-
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['data-ui-name'] || WrapperComponent.displayName);
|
|
51
|
-
};
|
|
52
|
-
assign(this, getterMethodNames.reduce(function (acc, name) {
|
|
53
|
-
var getterMethod = getterMethods[name];
|
|
54
|
-
if (!getterMethod) return acc;
|
|
55
|
-
acc[name] = function () {
|
|
56
|
-
var childrenProps = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
57
|
-
var getterProps = getterMethod.call(_this, childrenProps, acc[name].index);
|
|
58
|
-
return assignProps(childrenProps, getterProps);
|
|
59
|
-
};
|
|
60
|
-
acc[name].index = -1;
|
|
61
|
-
acc[name].cache = new Set();
|
|
62
|
-
return acc;
|
|
63
|
-
}, {}));
|
|
64
|
-
},
|
|
65
|
-
"static": function _static(WrapperComponent, Component) {
|
|
66
|
-
if (Object.keys(childComponents).length && !WrapperComponent.displayName) {
|
|
67
|
-
throw new Error('"displayName" is not defined');
|
|
68
|
-
}
|
|
69
|
-
return Object.entries(childComponents).reduce(function (acc, _ref3) {
|
|
70
|
-
var _ref4 = _slicedToArray(_ref3, 2),
|
|
71
|
-
name = _ref4[0],
|
|
72
|
-
value = _ref4[1];
|
|
73
|
-
var childComponents = {};
|
|
74
|
-
if (Array.isArray(value)) {
|
|
75
|
-
childComponents = value[1];
|
|
76
|
-
value = value[0];
|
|
77
|
-
}
|
|
78
|
-
var prevStaticComponent = value[STATIC_COMPONENT];
|
|
79
|
-
// @ts-ignore
|
|
80
|
-
var prevDisplayName = value.displayName;
|
|
81
|
-
// @ts-ignore
|
|
82
|
-
value.displayName = "".concat(WrapperComponent.displayName, ".").concat(name);
|
|
83
|
-
value[STATIC_COMPONENT] = true;
|
|
84
|
-
value[ROOT_COMPONENT] = Component[ROOT_COMPONENT] || Component;
|
|
85
|
-
acc[name] = createComponent(value, childComponents, options);
|
|
86
|
-
// @ts-ignore
|
|
87
|
-
value.displayName = prevDisplayName;
|
|
88
|
-
value[STATIC_COMPONENT] = prevStaticComponent;
|
|
89
|
-
return acc;
|
|
90
|
-
}, {});
|
|
91
|
-
},
|
|
92
|
-
context: function context(_context) {
|
|
93
|
-
// const getterMethod = getterMethodNameByDisplayName(WrapperComponent.displayName);
|
|
94
|
-
return _objectSpread(_objectSpread({}, _context), pick(this, getterMethodNames));
|
|
95
|
-
},
|
|
96
|
-
wrapperProps: function wrapperProps(props, WrapperComponent) {
|
|
97
|
-
if (!WrapperComponent[STATIC_COMPONENT]) return props;
|
|
98
|
-
var context = React.useContext(options.context);
|
|
99
|
-
var getterMethod = context[getterMethodNameByDisplayName(WrapperComponent.displayName)];
|
|
100
|
-
if (getterMethod) {
|
|
101
|
-
if (!getterMethod.cache.has(this)) {
|
|
102
|
-
getterMethod.cache.add(this);
|
|
103
|
-
getterMethod.index++;
|
|
104
|
-
if (this) this.index = getterMethod.index;
|
|
105
|
-
}
|
|
106
|
-
if (this) getterMethod.index = this.index;
|
|
107
|
-
return getterMethod(props);
|
|
108
|
-
}
|
|
109
|
-
return props;
|
|
110
|
-
},
|
|
111
|
-
render: function render(_render) {
|
|
112
|
-
var _this2 = this;
|
|
113
|
-
getterMethodNames.forEach(function (name) {
|
|
114
|
-
if (_this2[name] === undefined) return;
|
|
115
|
-
_this2[name].index = -1;
|
|
116
|
-
_this2[name].cache.clear();
|
|
117
|
-
});
|
|
118
|
-
return _render;
|
|
119
|
-
}
|
|
120
|
-
};
|
|
121
|
-
}
|
|
122
|
-
export default Enhancement;
|
|
123
|
-
//# sourceMappingURL=staticChildren.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"staticChildren.js","names":["React","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","_slicedToArray","value","Array","isArray","push","apply","_toConsumableArray","STATIC_COMPONENT","Symbol","ROOT_COMPONENT","SELF_GETTER_METHOD","Enhancement","createComponent","options","getterMethodNames","condition","Component","Boolean","init","props","WrapperComponent","_this","getterMethods","selfGetterMethod","warn","getterMethod","childrenProps","getterProps","call","index","cache","Set","_static","Error","_ref3","_ref4","prevStaticComponent","prevDisplayName","context","_objectSpread","wrapperProps","useContext","has","add","render","_this2","forEach","clear"],"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":";;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,WAAW,MAAM,sBAAsB;AAC9C,OAAOC,IAAI,MAAM,eAAe;AAChC,OAAOC,MAAM,MAAM,iBAAiB;AAEpC,SAASC,MAAMA,CAACC,MAAW,EAAEC,MAAW,EAAE;EACxC,OAAOC,MAAM,CAACC,gBAAgB,CAC5BH,MAAM,EACNE,MAAM,CAACE,IAAI,CAACH,MAAM,CAAC,CAACI,MAAM,CAAC,UAACC,WAAgB,EAAEC,GAAG,EAAK;IACpDD,WAAW,CAACC,GAAG,CAAC,GAAGL,MAAM,CAACM,wBAAwB,CAACP,MAAM,EAAEM,GAAG,CAAC;IAC/D,OAAOD,WAAW;EACpB,CAAC,EAAE,CAAC,CAAC,CAAC,CACP;AACH;AAEA,OAAO,SAASG,gBAAgBA,CAACC,IAAY,EAAE;EAC7C,aAAAC,MAAA,CAAaD,IAAI;AACnB;AAEA,OAAO,SAASE,6BAA6BA,CAAA,EAAmB;EAAA,IAAlBC,WAAW,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,EAAE;EAC5D,IAAMG,YAAY,GAAGJ,WAAW,CAACK,KAAK,CAAC,GAAG,CAAC;EAC3C,IAAMR,IAAI,GAAGO,YAAY,CAACE,KAAK,CAAC,EAAEF,YAAY,CAACF,MAAM,GAAG,CAAC,CAAC,CAAC,CA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
1
|
-
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
2
|
-
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
3
|
-
import _objectSpread from "@babel/runtime/helpers/objectSpread2";
|
|
4
|
-
var _excluded = ["_styles", "styles"],
|
|
5
|
-
_excluded2 = ["styles"];
|
|
6
|
-
import React from 'react';
|
|
7
|
-
import { sstyled } from '../styled/index';
|
|
8
|
-
import { STATIC_COMPONENT } from './staticChildren';
|
|
9
|
-
export var STYLES_CONTEXT = Symbol('STYLES_CONTEXT');
|
|
10
|
-
var STYLES_SELF = Symbol('STYLES_SELF');
|
|
11
|
-
function Enhancement(childComponents, Context) {
|
|
12
|
-
return {
|
|
13
|
-
condition: function condition(Component) {
|
|
14
|
-
return Boolean(Component.style || Component[STATIC_COMPONENT]);
|
|
15
|
-
},
|
|
16
|
-
init: function init(props, WrapperComponent) {
|
|
17
|
-
if (props.styles) {
|
|
18
|
-
this[STYLES_SELF] = props.styles;
|
|
19
|
-
}
|
|
20
|
-
if (WrapperComponent.style) {
|
|
21
|
-
this[STYLES_SELF] = sstyled.merge(WrapperComponent.style, props._styles);
|
|
22
|
-
}
|
|
23
|
-
},
|
|
24
|
-
context: function context(_context) {
|
|
25
|
-
// Optimization: if has no children there is no need to create new context (by lsroman)
|
|
26
|
-
if (!this[STYLES_SELF] || !Object.keys(childComponents).length) {
|
|
27
|
-
return _context;
|
|
28
|
-
}
|
|
29
|
-
return _objectSpread(_objectSpread({}, _context), {}, _defineProperty({}, STYLES_CONTEXT, this[STYLES_SELF]));
|
|
30
|
-
},
|
|
31
|
-
asProps: function asProps(_ref) {
|
|
32
|
-
var _styles = _ref._styles,
|
|
33
|
-
styles = _ref.styles,
|
|
34
|
-
props = _objectWithoutProperties(_ref, _excluded);
|
|
35
|
-
return _objectSpread(_objectSpread({}, props), {}, {
|
|
36
|
-
styles: this[STYLES_SELF]
|
|
37
|
-
});
|
|
38
|
-
},
|
|
39
|
-
wrapperProps: function wrapperProps(_ref2) {
|
|
40
|
-
var styles = _ref2.styles,
|
|
41
|
-
props = _objectWithoutProperties(_ref2, _excluded2);
|
|
42
|
-
var context = React.useContext(Context);
|
|
43
|
-
return _objectSpread(_objectSpread({}, props), {}, {
|
|
44
|
-
_styles: styles,
|
|
45
|
-
styles: context[STYLES_CONTEXT]
|
|
46
|
-
});
|
|
47
|
-
}
|
|
48
|
-
};
|
|
49
|
-
}
|
|
50
|
-
export default Enhancement;
|
|
51
|
-
//# sourceMappingURL=style.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"style.js","names":["React","sstyled","STATIC_COMPONENT","STYLES_CONTEXT","Symbol","STYLES_SELF","Enhancement","childComponents","Context","condition","Component","Boolean","style","init","props","WrapperComponent","styles","merge","_styles","context","Object","keys","length","_objectSpread","_defineProperty","asProps","_ref","_objectWithoutProperties","_excluded","wrapperProps","_ref2","_excluded2","useContext"],"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,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,OAAO,QAAQ,iBAAiB;AACzC,SAASC,gBAAgB,QAAQ,kBAAkB;AAEnD,OAAO,IAAMC,cAAc,GAAGC,MAAM,CAAC,gBAAgB,CAAC;AACtD,IAAMC,WAAW,GAAGD,MAAM,CAAC,aAAa,CAAC;AAEzC,SAASE,WAAWA,CAACC,eAAoB,EAAEC,OAAY,EAAE;EACvD,OAAO;IACLC,SAAS,EAAE,SAAAA,UAAUC,SAAc,EAAE;MACnC,OAAOC,OAAO,CAACD,SAAS,CAACE,KAAK,IAAIF,SAAS,CAACR,gBAAgB,CAAC,CAAC;IAChE,CAAC;IACDW,IAAI,EAAE,SAAAA,KAAqBC,KAAU,EAAEC,gBAAqB,EAAE;MAC5D,IAAID,KAAK,CAACE,MAAM,EAAE;QAChB,IAAI,CAACX,WAAW,CAAC,GAAGS,KAAK,CAACE,MAAM;MAClC;MACA,IAAID,gBAAgB,CAACH,KAAK,EAAE;QAC1B,IAAI,CAACP,WAAW,CAAC,GAAGJ,OAAO,CAACgB,KAAK,CAACF,gBAAgB,CAACH,KAAK,EAAEE,KAAK,CAACI,OAAO,CAAC;MAC1E;IACF,CAAC;IACDC,OAAO,EAAE,SAAAA,QAAqBA,QAAY,EAAO;MAC/C;MACA,IAAI,CAAC,IAAI,CAACd,WAAW,CAAC,IAAI,CAACe,MAAM,CAACC,IAAI,CAACd,eAAe,CAAC,CAACe,MAAM,EAAE;QAC9D,OAAOH,QAAO;MAChB;MACA,OAAAI,aAAA,CAAAA,aAAA,KACKJ,QAAO,OAAAK,eAAA,KACTrB,cAAc,EAAG,IAAI,CAACE,WAAW,CAAC;IAEvC,CAAC;IAEDoB,OAAO,EAAE,SAAAA,QAAAC,IAAA,EAAyD;MAAA,IAAlCR,OAAO,GAAAQ,IAAA,CAAPR,OAAO;QAAEF,MAAM,GAAAU,IAAA,CAANV,MAAM;QAAKF,KAAK,GAAAa,wBAAA,CAAAD,IAAA,EAAAE,SAAA;MACvD,OAAAL,aAAA,CAAAA,aAAA,KACKT,KAAK;QACRE,MAAM,EAAE,IAAI,CAACX,WAAW;MAAC;IAE7B,CAAC;IACDwB,YAAY,EAAE,SAAAA,aAAAC,KAAA,EAAgD;MAAA,IAAzBd,MAAM,GAAAc,KAAA,CAANd,MAAM;QAAKF,KAAK,GAAAa,wBAAA,CAAAG,KAAA,EAAAC,UAAA;MACnD,IAAMZ,OAAY,GAAGnB,KAAK,CAACgC,UAAU,CAACxB,OAAO,CAAC;MAC9C,OAAAe,aAAA,CAAAA,aAAA,KACKT,KAAK;QACRI,OAAO,EAAEF,MAAM;QACfA,MAAM,EAAEG,OAAO,CAAChB,cAAc;MAAC;IAEnC;EACF,CAAC;AACH;AAEA,eAAeG,WAAW"}
|
|
@@ -1,123 +0,0 @@
|
|
|
1
|
-
import _objectSpread from "@babel/runtime/helpers/objectSpread2";
|
|
2
|
-
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
3
|
-
import _toArray from "@babel/runtime/helpers/toArray";
|
|
4
|
-
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
5
|
-
import _toPropertyKey from "@babel/runtime/helpers/toPropertyKey";
|
|
6
|
-
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
7
|
-
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
8
|
-
import { callAllEventHandlers } from '../utils/assignProps';
|
|
9
|
-
import capitalizeFirstLetter from '../utils/capitalizeFirstLetter';
|
|
10
|
-
function assign(target, source) {
|
|
11
|
-
return Object.defineProperties(target, Object.keys(source).reduce(function (descriptors, key) {
|
|
12
|
-
descriptors[key] = Object.getOwnPropertyDescriptor(source, key);
|
|
13
|
-
return descriptors;
|
|
14
|
-
}, {}));
|
|
15
|
-
}
|
|
16
|
-
function defaultProp(prop) {
|
|
17
|
-
return "default".concat(capitalizeFirstLetter(prop));
|
|
18
|
-
}
|
|
19
|
-
function handlerProp(prop) {
|
|
20
|
-
if (prop === 'value') prop = '';
|
|
21
|
-
if (prop === 'checked') prop = '';
|
|
22
|
-
return "on".concat(capitalizeFirstLetter(prop), "Change");
|
|
23
|
-
}
|
|
24
|
-
function isControlled(propValue) {
|
|
25
|
-
return propValue !== undefined;
|
|
26
|
-
}
|
|
27
|
-
function uncontrolledProp(self, propName, propValue, propDefaultValue, propHandler, chainHandler) {
|
|
28
|
-
function getValue() {
|
|
29
|
-
return isControlled(propValue) ? propValue : propName in self.state ? self.state[propName] : propDefaultValue;
|
|
30
|
-
}
|
|
31
|
-
return [getValue(), function (value) {
|
|
32
|
-
var oldValue = getValue();
|
|
33
|
-
if (oldValue === value) return false;
|
|
34
|
-
if (!isControlled(propValue)) self.setState(_defineProperty({}, propName, value));
|
|
35
|
-
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
36
|
-
args[_key - 1] = arguments[_key];
|
|
37
|
-
}
|
|
38
|
-
return callAllEventHandlers.apply(void 0, [propHandler].concat(_toConsumableArray(chainHandler))).apply(void 0, [value].concat(args));
|
|
39
|
-
}];
|
|
40
|
-
}
|
|
41
|
-
function uncontrolledUniversal(props, config, uncontrolledProp) {
|
|
42
|
-
var handlerProps = {};
|
|
43
|
-
var uncontrolledProps = Object.keys(config).reduce(function (result, propName) {
|
|
44
|
-
var _objectSpread2;
|
|
45
|
-
var handlerName = handlerProp(propName);
|
|
46
|
-
var defaultPropName = defaultProp(propName);
|
|
47
|
-
var propDefaultValue = result[defaultPropName],
|
|
48
|
-
propValue = result[propName],
|
|
49
|
-
propHandler = result[handlerName],
|
|
50
|
-
other = _objectWithoutProperties(result, [defaultPropName, propName, handlerName].map(_toPropertyKey));
|
|
51
|
-
if (propDefaultValue === undefined) {
|
|
52
|
-
console.warn(defaultPropName, 'must be installed in "defaultProps"');
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
// if (typeof propDefaultValue === 'function' && propDefaultValue.defaultInit) {
|
|
56
|
-
// propDefaultValue = propDefaultValue(result);
|
|
57
|
-
// }
|
|
58
|
-
|
|
59
|
-
var setter = config[propName];
|
|
60
|
-
var chainHandler = [];
|
|
61
|
-
if (Array.isArray(setter)) {
|
|
62
|
-
var _setter = setter;
|
|
63
|
-
var _setter2 = _toArray(_setter);
|
|
64
|
-
setter = _setter2[0];
|
|
65
|
-
chainHandler = _setter2.slice(1);
|
|
66
|
-
}
|
|
67
|
-
setter = setter || function (v) {
|
|
68
|
-
return v;
|
|
69
|
-
};
|
|
70
|
-
var _uncontrolledProp = uncontrolledProp(propName, propValue, propDefaultValue, propHandler, chainHandler),
|
|
71
|
-
_uncontrolledProp2 = _slicedToArray(_uncontrolledProp, 2),
|
|
72
|
-
value = _uncontrolledProp2[0],
|
|
73
|
-
handler = _uncontrolledProp2[1];
|
|
74
|
-
// TODO: need to warn about recursion (by lsroman)
|
|
75
|
-
handlerProps[propName] = handler;
|
|
76
|
-
return _objectSpread(_objectSpread({}, other), {}, (_objectSpread2 = {}, _defineProperty(_objectSpread2, propName, value), _defineProperty(_objectSpread2, handlerName, function (eventOrValue) {
|
|
77
|
-
for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
|
|
78
|
-
args[_key2 - 1] = arguments[_key2];
|
|
79
|
-
}
|
|
80
|
-
var result = [setter.apply(void 0, [eventOrValue].concat(args))].concat(args);
|
|
81
|
-
if (eventOrValue !== null && eventOrValue !== void 0 && eventOrValue.target) {
|
|
82
|
-
result.push(eventOrValue);
|
|
83
|
-
}
|
|
84
|
-
return handler.apply(void 0, _toConsumableArray(result));
|
|
85
|
-
}), _objectSpread2));
|
|
86
|
-
}, props);
|
|
87
|
-
return [uncontrolledProps, handlerProps];
|
|
88
|
-
}
|
|
89
|
-
function uncontrolled(self, props, config) {
|
|
90
|
-
return uncontrolledUniversal(props, config, uncontrolledProp.bind(undefined, self));
|
|
91
|
-
}
|
|
92
|
-
function Enhancement() {
|
|
93
|
-
return {
|
|
94
|
-
condition: function condition(Component) {
|
|
95
|
-
return Boolean(Component.prototype.uncontrolledProps);
|
|
96
|
-
},
|
|
97
|
-
init: function init() {
|
|
98
|
-
this.state = this.state || {};
|
|
99
|
-
assign(this, {
|
|
100
|
-
get handlers() {
|
|
101
|
-
var _uncontrolled = uncontrolled(this, this.props, this.uncontrolledProps()),
|
|
102
|
-
_uncontrolled2 = _slicedToArray(_uncontrolled, 2),
|
|
103
|
-
uncontrolledHandlers = _uncontrolled2[1];
|
|
104
|
-
return uncontrolledHandlers;
|
|
105
|
-
}
|
|
106
|
-
});
|
|
107
|
-
},
|
|
108
|
-
context: function context(_context) {
|
|
109
|
-
return _objectSpread(_objectSpread({}, _context), {}, {
|
|
110
|
-
handlers: this.handlers
|
|
111
|
-
});
|
|
112
|
-
},
|
|
113
|
-
asProps: function asProps(props) {
|
|
114
|
-
// TODO: need to omit unneccessary props (by lsroman)
|
|
115
|
-
var _uncontrolled3 = uncontrolled(this, props, this.uncontrolledProps()),
|
|
116
|
-
_uncontrolled4 = _slicedToArray(_uncontrolled3, 1),
|
|
117
|
-
uncontrolledProps = _uncontrolled4[0];
|
|
118
|
-
return uncontrolledProps;
|
|
119
|
-
}
|
|
120
|
-
};
|
|
121
|
-
}
|
|
122
|
-
export default Enhancement;
|
|
123
|
-
//# sourceMappingURL=uncontrolledProps.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"uncontrolledProps.js","names":["callAllEventHandlers","capitalizeFirstLetter","assign","target","source","Object","defineProperties","keys","reduce","descriptors","key","getOwnPropertyDescriptor","defaultProp","prop","concat","handlerProp","isControlled","propValue","undefined","uncontrolledProp","self","propName","propDefaultValue","propHandler","chainHandler","getValue","state","value","oldValue","setState","_defineProperty","_len","arguments","length","args","Array","_key","apply","_toConsumableArray","uncontrolledUniversal","props","config","handlerProps","uncontrolledProps","result","_objectSpread2","handlerName","defaultPropName","other","_objectWithoutProperties","map","_toPropertyKey","console","warn","setter","isArray","_setter","_setter2","_toArray","slice","v","_uncontrolledProp","_uncontrolledProp2","_slicedToArray","handler","_objectSpread","eventOrValue","_len2","_key2","push","uncontrolled","bind","Enhancement","condition","Component","Boolean","prototype","init","handlers","_uncontrolled","_uncontrolled2","uncontrolledHandlers","context","asProps","_uncontrolled3","_uncontrolled4"],"sources":["../../../src/enhancement/uncontrolledProps.tsx"],"sourcesContent":["import { callAllEventHandlers } from '../utils/assignProps';\nimport capitalizeFirstLetter from '../utils/capitalizeFirstLetter';\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\nfunction defaultProp(prop: any) {\n return `default${capitalizeFirstLetter(prop)}`;\n}\n\nfunction handlerProp(prop: any) {\n if (prop === 'value') prop = '';\n if (prop === 'checked') prop = '';\n return `on${capitalizeFirstLetter(prop)}Change`;\n}\n\nfunction isControlled(propValue: any) {\n return propValue !== undefined;\n}\n\nfunction uncontrolledProp(\n self: any,\n propName: any,\n propValue: any,\n propDefaultValue: any,\n propHandler: any,\n chainHandler: any,\n) {\n function getValue() {\n return isControlled(propValue)\n ? propValue\n : propName in self.state\n ? self.state[propName]\n : propDefaultValue;\n }\n\n return [\n getValue(),\n (value: any, ...args: any[]) => {\n const oldValue = getValue();\n if (oldValue === value) return false;\n if (!isControlled(propValue)) self.setState({ [propName]: value });\n return callAllEventHandlers(propHandler, ...chainHandler)(value, ...args);\n },\n ];\n}\n\nfunction uncontrolledUniversal(props: any, config: any, uncontrolledProp: any) {\n const handlerProps = {};\n const uncontrolledProps = Object.keys(config).reduce((result, propName) => {\n const handlerName = handlerProp(propName);\n const defaultPropName = defaultProp(propName);\n const {\n [defaultPropName]: propDefaultValue,\n [propName]: propValue,\n [handlerName]: propHandler,\n ...other\n } = result;\n\n if (propDefaultValue === undefined) {\n console.warn(defaultPropName, 'must be installed in \"defaultProps\"');\n }\n\n // if (typeof propDefaultValue === 'function' && propDefaultValue.defaultInit) {\n // propDefaultValue = propDefaultValue(result);\n // }\n\n let setter = config[propName];\n let chainHandler = [];\n\n if (Array.isArray(setter)) [setter, ...chainHandler] = setter;\n setter = setter || ((v: any) => v);\n\n const [value, handler] = uncontrolledProp(\n propName,\n propValue,\n propDefaultValue,\n propHandler,\n chainHandler,\n );\n // TODO: need to warn about recursion (by lsroman)\n (handlerProps as any)[propName] = handler;\n\n return {\n ...other,\n [propName]: value,\n [handlerName]: (eventOrValue: any, ...args: any[]) => {\n const result = [setter(eventOrValue, ...args), ...args];\n if (eventOrValue?.target) {\n result.push(eventOrValue);\n }\n return handler(...result);\n },\n };\n }, props);\n return [uncontrolledProps, handlerProps];\n}\n\nfunction uncontrolled(self: any, props: any, config: any) {\n return uncontrolledUniversal(props, config, uncontrolledProp.bind(undefined, self));\n}\n\nfunction Enhancement() {\n return {\n condition: function (Component: any) {\n return Boolean(Component.prototype.uncontrolledProps);\n },\n init: function (this: any) {\n this.state = this.state || {};\n assign(this, {\n get handlers() {\n const [, uncontrolledHandlers] = uncontrolled(this, this.props, this.uncontrolledProps());\n return uncontrolledHandlers;\n },\n });\n },\n context: function (this: any, context: any) {\n return {\n ...context,\n handlers: this.handlers,\n };\n },\n asProps: function (this: any, props: any) {\n // TODO: need to omit unneccessary props (by lsroman)\n const [uncontrolledProps] = uncontrolled(this, props, this.uncontrolledProps());\n return uncontrolledProps;\n },\n };\n}\n\nexport default Enhancement;\n"],"mappings":";;;;;;;AAAA,SAASA,oBAAoB,QAAQ,sBAAsB;AAC3D,OAAOC,qBAAqB,MAAM,gCAAgC;AAElE,SAASC,MAAMA,CAACC,MAAW,EAAEC,MAAW,EAAE;EACxC,OAAOC,MAAM,CAACC,gBAAgB,CAC5BH,MAA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,OAAO1C,iBAAiB;IAC1B;EACF,CAAC;AACH;AAEA,eAAe6B,WAAW"}
|
package/lib/es6/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["createComponent","createBaseComponent","assignProps","sstyled","Root","Component","Intergalactic","wrapIntergalacticComponent","CORE_INSTANCE","CREATE_COMPONENT","CONTEXT_COMPONENT","CHILDREN_COMPONENT","INHERITED_NAME","register","lastInteraction"],"sources":["../../src/index.ts"],"sourcesContent":["/** ============================== core ============================== */\nimport { createComponent, createBaseComponent, assignProps } from './coreFactory';\nimport { sstyled } from './styled';\nimport type { StyledProps } from './styled';\nimport { Root, Component, Intergalactic, wrapIntergalacticComponent } from './core-types/Component';\nimport type {\n PropGetterFn,\n IRootComponentProps,\n ComponentType,\n IRootComponentHandlers,\n IComponentProps,\n ReturnEl,\n IFunctionProps,\n} from './core-types/Component';\nimport {\n CORE_INSTANCE,\n CREATE_COMPONENT,\n CONTEXT_COMPONENT,\n CHILDREN_COMPONENT,\n INHERITED_NAME,\n} from './core-types/symbols';\nimport type { UnknownProperties } from './core-types/UnknownProperties';\nimport register from './register';\nimport { lastInteraction } from './LastInteractionType';\n\nexport {\n sstyled,\n createComponent,\n createBaseComponent,\n Root,\n Component,\n UnknownProperties,\n Intergalactic,\n PropGetterFn,\n IRootComponentProps,\n ComponentType,\n IRootComponentHandlers,\n IComponentProps,\n IFunctionProps,\n CORE_INSTANCE,\n CREATE_COMPONENT,\n CONTEXT_COMPONENT,\n CHILDREN_COMPONENT,\n INHERITED_NAME,\n ReturnEl,\n StyledProps,\n wrapIntergalacticComponent,\n assignProps,\n register,\n lastInteraction,\n};\n"],"mappings":"AAAA;AACA,SAASA,eAAe,EAAEC,mBAAmB,EAAEC,WAAW,QAAQ,eAAe;AACjF,SAASC,OAAO,QAAQ,UAAU;AAElC,SAASC,IAAI,EAAEC,SAAS,EAAEC,aAAa,EAAEC,0BAA0B,QAAQ,wBAAwB;AAUnG,SACEC,aAAa,EACbC,gBAAgB,EAChBC,iBAAiB,EACjBC,kBAAkB,EAClBC,cAAc,QACT,sBAAsB;AAE7B,OAAOC,QAAQ,MAAM,YAAY;AACjC,SAASC,eAAe,QAAQ,uBAAuB;AAEvD,SACEX,OAAO,EACPH,eAAe,EACfC,mBAAmB,EACnBG,IAAI,EACJC,SAAS,EAETC,aAAa,EAObE,aAAa,EACbC,gBAAgB,EAChBC,iBAAiB,EACjBC,kBAAkB,EAClBC,cAAc,EAGdL,0BAA0B,EAC1BL,WAAW,EACXW,QAAQ,EACRC,eAAe"}
|
package/lib/es6/register.js
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
2
|
-
import _createClass from "@babel/runtime/helpers/createClass";
|
|
3
|
-
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
4
|
-
var Register = /*#__PURE__*/function () {
|
|
5
|
-
function Register() {
|
|
6
|
-
_classCallCheck(this, Register);
|
|
7
|
-
_defineProperty(this, "data", {});
|
|
8
|
-
}
|
|
9
|
-
_createClass(Register, [{
|
|
10
|
-
key: "get",
|
|
11
|
-
value: function get(name, defaultValue) {
|
|
12
|
-
if (name in this.data) {
|
|
13
|
-
return this.data[name];
|
|
14
|
-
} else {
|
|
15
|
-
return this.set(name, defaultValue);
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
}, {
|
|
19
|
-
key: "set",
|
|
20
|
-
value: function set(name, value) {
|
|
21
|
-
this.data[name] = value;
|
|
22
|
-
return this.data[name];
|
|
23
|
-
}
|
|
24
|
-
}]);
|
|
25
|
-
return Register;
|
|
26
|
-
}();
|
|
27
|
-
export { Register };
|
|
28
|
-
export default new Register();
|
|
29
|
-
//# sourceMappingURL=register.js.map
|
package/lib/es6/register.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"register.js","names":["Register","_classCallCheck","_defineProperty","_createClass","key","value","get","name","defaultValue","data","set"],"sources":["../../src/register.tsx"],"sourcesContent":["class Register {\n data: any = {};\n\n get<D>(name: string, defaultValue?: D): D {\n if (name in this.data) {\n return this.data[name];\n } else {\n return this.set(name, defaultValue) as any;\n }\n }\n\n set<D>(name: string, value: D): D {\n this.data[name] = value;\n return this.data[name];\n }\n}\n\nexport { Register };\nexport default new Register();\n"],"mappings":";;;IAAMA,QAAQ;EAAA,SAAAA,SAAA;IAAAC,eAAA,OAAAD,QAAA;IAAAE,eAAA,eACA,CAAC,CAAC;EAAA;EAAAC,YAAA,CAAAH,QAAA;IAAAI,GAAA;IAAAC,KAAA,EAEd,SAAAC,IAAOC,IAAY,EAAEC,YAAgB,EAAK;MACxC,IAAID,IAAI,IAAI,IAAI,CAACE,IAAI,EAAE;QACrB,OAAO,IAAI,CAACA,IAAI,CAACF,IAAI,CAAC;MACxB,CAAC,MAAM;QACL,OAAO,IAAI,CAACG,GAAG,CAACH,IAAI,EAAEC,YAAY,CAAC;MACrC;IACF;EAAC;IAAAJ,GAAA;IAAAC,KAAA,EAED,SAAAK,IAAOH,IAAY,EAAEF,KAAQ,EAAK;MAChC,IAAI,CAACI,IAAI,CAACF,IAAI,CAAC,GAAGF,KAAK;MACvB,OAAO,IAAI,CAACI,IAAI,CAACF,IAAI,CAAC;IACxB;EAAC;EAAA,OAAAP,QAAA;AAAA;AAGH,SAASA,QAAQ;AACjB,eAAe,IAAIA,QAAQ,EAAE"}
|
package/lib/es6/styled/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["styled","use","css","sstyled"],"sources":["../../../src/styled/index.tsx"],"sourcesContent":["import { UnknownProperties } from '../core-types/UnknownProperties';\n\nexport type StyledProps = {\n // eslint-disable-next-line ssr-friendly/no-dom-globals-in-module-scope\n styles?: React.DetailedHTMLProps<React.StyleHTMLAttributes<HTMLStyleElement>, HTMLStyleElement>;\n};\n\n/** @deprecated */\nexport interface IStyledProps extends StyledProps, UnknownProperties {}\n\n/** @ts-ignore */\nexport { styled, use, css } from './reshadow-core';\n\nexport { sstyled } from './sstyled';\n"],"mappings":"AAOA;;AAGA;AACA,SAASA,MAAM,EAAEC,GAAG,EAAEC,GAAG,QAAQ,iBAAiB;AAElD,SAASC,OAAO,QAAQ,WAAW"}
|