@semcore/core 16.5.1-prerelease.5 → 17.0.0-prerelease.14
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/CHANGELOG.md +12 -1
- package/README.md +4 -4
- package/lib/LastInteractionType.js +22 -36
- package/lib/LastInteractionType.js.map +1 -1
- package/lib/LastInteractionType.mjs +19 -33
- package/lib/LastInteractionType.mjs.map +1 -1
- package/lib/core-types/Component.d.ts +26 -79
- package/lib/core-types/Component.js +24 -72
- package/lib/core-types/Component.js.map +1 -1
- package/lib/core-types/Component.mjs +18 -34
- package/lib/core-types/Component.mjs.map +1 -1
- package/lib/core-types/symbols.js +9 -9
- package/lib/core-types/symbols.js.map +1 -1
- package/lib/core-types/symbols.mjs +9 -9
- package/lib/core-types/symbols.mjs.map +1 -1
- package/lib/coreFactory.d.ts +6 -23
- package/lib/coreFactory.js +150 -217
- package/lib/coreFactory.js.map +1 -1
- package/lib/coreFactory.mjs +139 -194
- package/lib/coreFactory.mjs.map +1 -1
- package/lib/decorators/propsObserver.d.ts +11 -0
- package/lib/decorators/reactive.d.ts +11 -0
- package/lib/enhancement/Children.js +51 -59
- package/lib/enhancement/Children.js.map +1 -1
- package/lib/enhancement/Children.mjs +47 -41
- package/lib/enhancement/Children.mjs.map +1 -1
- package/lib/enhancement/Root.js +36 -37
- package/lib/enhancement/Root.js.map +1 -1
- package/lib/enhancement/Root.mjs +28 -18
- package/lib/enhancement/Root.mjs.map +1 -1
- package/lib/enhancement/dataName.js +7 -8
- package/lib/enhancement/dataName.js.map +1 -1
- package/lib/enhancement/dataName.mjs +5 -5
- package/lib/enhancement/dataName.mjs.map +1 -1
- package/lib/enhancement/enhance.js +6 -9
- package/lib/enhancement/enhance.js.map +1 -1
- package/lib/enhancement/enhance.mjs +5 -7
- package/lib/enhancement/enhance.mjs.map +1 -1
- package/lib/enhancement/functionDefaultProps.js +6 -6
- package/lib/enhancement/functionDefaultProps.js.map +1 -1
- package/lib/enhancement/functionDefaultProps.mjs +4 -4
- package/lib/enhancement/functionDefaultProps.mjs.map +1 -1
- package/lib/enhancement/i18n.js +13 -13
- package/lib/enhancement/i18n.js.map +1 -1
- package/lib/enhancement/i18n.mjs +10 -9
- package/lib/enhancement/i18n.mjs.map +1 -1
- package/lib/enhancement/inheritedName.js +7 -8
- package/lib/enhancement/inheritedName.js.map +1 -1
- package/lib/enhancement/inheritedName.mjs +5 -5
- package/lib/enhancement/inheritedName.mjs.map +1 -1
- package/lib/enhancement/staticChildren.js +47 -56
- package/lib/enhancement/staticChildren.js.map +1 -1
- package/lib/enhancement/staticChildren.mjs +43 -48
- package/lib/enhancement/staticChildren.mjs.map +1 -1
- package/lib/enhancement/style.js +29 -27
- package/lib/enhancement/style.js.map +1 -1
- package/lib/enhancement/style.mjs +26 -20
- package/lib/enhancement/style.mjs.map +1 -1
- package/lib/enhancement/uncontrolledProps.js +46 -64
- package/lib/enhancement/uncontrolledProps.js.map +1 -1
- package/lib/enhancement/uncontrolledProps.mjs +43 -51
- package/lib/enhancement/uncontrolledProps.mjs.map +1 -1
- package/lib/esm/LastInteractionType.mjs +19 -33
- package/lib/esm/core-types/Component.mjs +18 -34
- package/lib/esm/core-types/symbols.mjs +9 -9
- package/lib/esm/coreFactory.mjs +139 -194
- package/lib/esm/enhancement/Children.mjs +47 -41
- package/lib/esm/enhancement/Root.mjs +28 -18
- package/lib/esm/enhancement/dataName.mjs +5 -5
- package/lib/esm/enhancement/enhance.mjs +5 -7
- package/lib/esm/enhancement/functionDefaultProps.mjs +4 -4
- package/lib/esm/enhancement/i18n.mjs +10 -9
- package/lib/esm/enhancement/inheritedName.mjs +5 -5
- package/lib/esm/enhancement/staticChildren.mjs +43 -48
- package/lib/esm/enhancement/style.mjs +26 -20
- package/lib/esm/enhancement/uncontrolledProps.mjs +43 -51
- package/lib/esm/register.mjs +12 -20
- package/lib/esm/styled/reshadow-core.mjs +98 -111
- package/lib/esm/styled/sstyled.mjs +31 -41
- package/lib/esm/utils/assignProps.mjs +32 -36
- package/lib/esm/utils/enhances/WithI18n.mjs +16 -63
- package/lib/esm/utils/enhances/i18nEnhance.mjs +47 -61
- package/lib/esm/utils/logger.mjs +13 -21
- package/lib/esm/utils/pick.mjs +4 -4
- package/lib/esm/utils/ref.mjs +27 -57
- package/lib/esm/utils/use/useEnhancedEffect.mjs +1 -1
- package/lib/index.d.ts +3 -3
- package/lib/index.js +17 -17
- package/lib/index.js.map +1 -1
- package/lib/index.mjs.map +1 -1
- package/lib/register.js +17 -24
- package/lib/register.js.map +1 -1
- package/lib/register.mjs +12 -20
- package/lib/register.mjs.map +1 -1
- package/lib/styled/index.d.ts +1 -5
- package/lib/styled/index.js +4 -4
- package/lib/styled/index.js.map +1 -1
- package/lib/styled/index.mjs.map +1 -1
- package/lib/styled/reshadow-core.js +102 -104
- package/lib/styled/reshadow-core.js.map +1 -1
- package/lib/styled/reshadow-core.mjs +98 -111
- package/lib/styled/reshadow-core.mjs.map +1 -1
- package/lib/styled/sstyled.js +31 -53
- package/lib/styled/sstyled.js.map +1 -1
- package/lib/styled/sstyled.mjs +31 -41
- package/lib/styled/sstyled.mjs.map +1 -1
- package/lib/theme/processor.js +150 -222
- package/lib/theme/processor.js.map +1 -1
- package/lib/theme/processor.mjs +148 -221
- package/lib/theme/processor.mjs.map +1 -1
- package/lib/theme/themes/dark.js +2 -2
- package/lib/theme/themes/dark.js.map +1 -1
- package/lib/theme/themes/default.js +2 -2
- package/lib/theme/themes/default.js.map +1 -1
- package/lib/theme/themes/highlights-dark.js +2 -2
- package/lib/theme/themes/highlights-dark.js.map +1 -1
- package/lib/theme/themes/highlights-light.js +2 -2
- package/lib/theme/themes/highlights-light.js.map +1 -1
- package/lib/theme/themes/light.js +2 -2
- package/lib/theme/themes/light.js.map +1 -1
- package/lib/theme/utils.js +140 -215
- package/lib/theme/utils.js.map +1 -1
- package/lib/theme/utils.mjs +135 -214
- package/lib/theme/utils.mjs.map +1 -1
- package/lib/utils/CSSinJS.js +8 -10
- package/lib/utils/CSSinJS.js.map +1 -1
- package/lib/utils/CSSinJS.mjs +6 -7
- package/lib/utils/CSSinJS.mjs.map +1 -1
- package/lib/utils/ThemeProvider.js +44 -51
- package/lib/utils/ThemeProvider.js.map +1 -1
- package/lib/utils/ThemeProvider.mjs +36 -47
- package/lib/utils/ThemeProvider.mjs.map +1 -1
- package/lib/utils/addonText.js +4 -7
- package/lib/utils/addonText.js.map +1 -1
- package/lib/utils/addonText.mjs +2 -5
- package/lib/utils/addonText.mjs.map +1 -1
- package/lib/utils/addonTextChildren.js +15 -21
- package/lib/utils/addonTextChildren.js.map +1 -1
- package/lib/utils/addonTextChildren.mjs +7 -13
- package/lib/utils/addonTextChildren.mjs.map +1 -1
- package/lib/utils/ariaProps.js +7 -5
- package/lib/utils/ariaProps.js.map +1 -1
- package/lib/utils/ariaProps.mjs +7 -5
- package/lib/utils/ariaProps.mjs.map +1 -1
- package/lib/utils/assignProps.js +33 -37
- package/lib/utils/assignProps.js.map +1 -1
- package/lib/utils/assignProps.mjs +32 -36
- package/lib/utils/assignProps.mjs.map +1 -1
- package/lib/utils/canUseDOM.js +1 -1
- package/lib/utils/capitalizeFirstLetter.js +1 -1
- package/lib/utils/color.js +72 -95
- package/lib/utils/color.js.map +1 -1
- package/lib/utils/color.mjs +71 -94
- package/lib/utils/color.mjs.map +1 -1
- package/lib/utils/compose.js +3 -12
- package/lib/utils/compose.js.map +1 -1
- package/lib/utils/compose.mjs +2 -11
- package/lib/utils/compose.mjs.map +1 -1
- package/lib/utils/createUUID.js +5 -5
- package/lib/utils/createUUID.js.map +1 -1
- package/lib/utils/createUUID.mjs +4 -4
- package/lib/utils/createUUID.mjs.map +1 -1
- package/lib/utils/cssToIntDefault.js +3 -4
- package/lib/utils/cssToIntDefault.js.map +1 -1
- package/lib/utils/cssToIntDefault.mjs +2 -3
- package/lib/utils/cssToIntDefault.mjs.map +1 -1
- package/lib/utils/enhances/WithCSS.d.ts +2 -30
- package/lib/utils/enhances/WithCSS.js +13 -64
- package/lib/utils/enhances/WithCSS.js.map +1 -1
- package/lib/utils/enhances/WithCSS.mjs +9 -59
- package/lib/utils/enhances/WithCSS.mjs.map +1 -1
- package/lib/utils/enhances/WithI18n.d.ts +1 -30
- package/lib/utils/enhances/WithI18n.js +20 -76
- package/lib/utils/enhances/WithI18n.js.map +1 -1
- package/lib/utils/enhances/WithI18n.mjs +16 -63
- package/lib/utils/enhances/WithI18n.mjs.map +1 -1
- package/lib/utils/enhances/a11yEnhance.js +34 -39
- package/lib/utils/enhances/a11yEnhance.js.map +1 -1
- package/lib/utils/enhances/a11yEnhance.mjs +32 -36
- package/lib/utils/enhances/a11yEnhance.mjs.map +1 -1
- package/lib/utils/enhances/animatedSizeEnhance.d.ts +0 -4
- package/lib/utils/enhances/animatedSizeEnhance.js +55 -65
- package/lib/utils/enhances/animatedSizeEnhance.js.map +1 -1
- package/lib/utils/enhances/animatedSizeEnhance.mjs +50 -61
- package/lib/utils/enhances/animatedSizeEnhance.mjs.map +1 -1
- package/lib/utils/enhances/contextEnhance.js +12 -11
- package/lib/utils/enhances/contextEnhance.js.map +1 -1
- package/lib/utils/enhances/contextEnhance.mjs +9 -8
- package/lib/utils/enhances/contextEnhance.mjs.map +1 -1
- package/lib/utils/enhances/i18nEnhance.d.ts +0 -4
- package/lib/utils/enhances/i18nEnhance.js +51 -69
- package/lib/utils/enhances/i18nEnhance.js.map +1 -1
- package/lib/utils/enhances/i18nEnhance.mjs +47 -61
- package/lib/utils/enhances/i18nEnhance.mjs.map +1 -1
- package/lib/utils/enhances/resolveColorEnhance.js +12 -10
- package/lib/utils/enhances/resolveColorEnhance.js.map +1 -1
- package/lib/utils/enhances/resolveColorEnhance.mjs +8 -6
- package/lib/utils/enhances/resolveColorEnhance.mjs.map +1 -1
- package/lib/utils/eventEmitter.d.ts +10 -6
- package/lib/utils/eventEmitter.js +33 -32
- package/lib/utils/eventEmitter.js.map +1 -1
- package/lib/utils/eventEmitter.mjs +30 -31
- package/lib/utils/eventEmitter.mjs.map +1 -1
- package/lib/utils/findComponent.js +35 -42
- package/lib/utils/findComponent.js.map +1 -1
- package/lib/utils/findComponent.mjs +26 -33
- package/lib/utils/findComponent.mjs.map +1 -1
- package/lib/utils/fire.js +7 -13
- package/lib/utils/fire.js.map +1 -1
- package/lib/utils/fire.mjs +5 -11
- package/lib/utils/fire.mjs.map +1 -1
- package/lib/utils/focus-lock/focusBorders.js +28 -32
- package/lib/utils/focus-lock/focusBorders.js.map +1 -1
- package/lib/utils/focus-lock/focusBorders.mjs +26 -32
- package/lib/utils/focus-lock/focusBorders.mjs.map +1 -1
- package/lib/utils/focus-lock/getFocusableIn.js +4 -6
- package/lib/utils/focus-lock/getFocusableIn.js.map +1 -1
- package/lib/utils/focus-lock/getFocusableIn.mjs +3 -6
- package/lib/utils/focus-lock/getFocusableIn.mjs.map +1 -1
- package/lib/utils/focus-lock/isFocusInside.js +5 -6
- package/lib/utils/focus-lock/isFocusInside.js.map +1 -1
- package/lib/utils/focus-lock/isFocusInside.mjs +4 -6
- package/lib/utils/focus-lock/isFocusInside.mjs.map +1 -1
- package/lib/utils/focus-lock/isFocusable.js +9 -12
- package/lib/utils/focus-lock/isFocusable.js.map +1 -1
- package/lib/utils/focus-lock/isFocusable.mjs +8 -11
- package/lib/utils/focus-lock/isFocusable.mjs.map +1 -1
- package/lib/utils/focus-lock/setFocus.js +21 -27
- package/lib/utils/focus-lock/setFocus.js.map +1 -1
- package/lib/utils/focus-lock/setFocus.mjs +19 -25
- package/lib/utils/focus-lock/setFocus.mjs.map +1 -1
- package/lib/utils/getAccessibleName.js +10 -22
- package/lib/utils/getAccessibleName.js.map +1 -1
- package/lib/utils/getAccessibleName.mjs +10 -21
- package/lib/utils/getAccessibleName.mjs.map +1 -1
- package/lib/utils/getDisplayName.js +1 -1
- package/lib/utils/getDisplayName.mjs +3 -5
- package/lib/utils/getEventTarget.js +13 -32
- package/lib/utils/getEventTarget.js.map +1 -1
- package/lib/utils/getEventTarget.mjs +12 -31
- package/lib/utils/getEventTarget.mjs.map +1 -1
- package/lib/utils/getOriginChildren.js +4 -4
- package/lib/utils/getOriginChildren.js.map +1 -1
- package/lib/utils/getRandomInt.js +1 -1
- package/lib/utils/getValue.js +4 -6
- package/lib/utils/getValue.js.map +1 -1
- package/lib/utils/getValue.mjs +3 -5
- package/lib/utils/getValue.mjs.map +1 -1
- package/lib/utils/hasLabels.js +16 -27
- package/lib/utils/hasLabels.js.map +1 -1
- package/lib/utils/hasLabels.mjs +14 -24
- package/lib/utils/hasLabels.mjs.map +1 -1
- package/lib/utils/hasParent.js +3 -2
- package/lib/utils/hasParent.js.map +1 -1
- package/lib/utils/hasParent.mjs +2 -3
- package/lib/utils/hasParent.mjs.map +1 -1
- package/lib/utils/ifChildren.js +6 -4
- package/lib/utils/ifChildren.js.map +1 -1
- package/lib/utils/ifChildren.mjs +4 -2
- package/lib/utils/ifChildren.mjs.map +1 -1
- package/lib/utils/injectStyle.js +11 -13
- package/lib/utils/injectStyle.js.map +1 -1
- package/lib/utils/injectStyle.mjs +9 -10
- package/lib/utils/injectStyle.mjs.map +1 -1
- package/lib/utils/inputProps.js +5 -5
- package/lib/utils/inputProps.js.map +1 -1
- package/lib/utils/inputProps.mjs +4 -4
- package/lib/utils/inputProps.mjs.map +1 -1
- package/lib/utils/isInteractiveElement.js +7 -9
- package/lib/utils/isInteractiveElement.js.map +1 -1
- package/lib/utils/isInteractiveElement.mjs +7 -9
- package/lib/utils/isInteractiveElement.mjs.map +1 -1
- package/lib/utils/isNode.js +4 -5
- package/lib/utils/isNode.js.map +1 -1
- package/lib/utils/isNode.mjs +1 -2
- package/lib/utils/isNode.mjs.map +1 -1
- package/lib/utils/isPromise.js +1 -1
- package/lib/utils/isRetina.js +7 -2
- package/lib/utils/isRetina.js.map +1 -1
- package/lib/utils/isRetina.mjs +6 -1
- package/lib/utils/isRetina.mjs.map +1 -1
- package/lib/utils/logger.js +18 -25
- package/lib/utils/logger.js.map +1 -1
- package/lib/utils/logger.mjs +13 -21
- package/lib/utils/logger.mjs.map +1 -1
- package/lib/utils/numericChecker.js +11 -18
- package/lib/utils/numericChecker.js.map +1 -1
- package/lib/utils/numericChecker.mjs +10 -17
- package/lib/utils/numericChecker.mjs.map +1 -1
- package/lib/utils/ownerDocument.js +2 -2
- package/lib/utils/ownerDocument.js.map +1 -1
- package/lib/utils/ownerDocument.mjs +1 -1
- package/lib/utils/ownerDocument.mjs.map +1 -1
- package/lib/utils/pick.js +5 -5
- package/lib/utils/pick.js.map +1 -1
- package/lib/utils/pick.mjs +4 -4
- package/lib/utils/pick.mjs.map +1 -1
- package/lib/utils/propsForElement.js +10 -12
- package/lib/utils/propsForElement.js.map +1 -1
- package/lib/utils/propsForElement.mjs +8 -10
- package/lib/utils/propsForElement.mjs.map +1 -1
- package/lib/utils/rafTrottle.js +9 -14
- package/lib/utils/rafTrottle.js.map +1 -1
- package/lib/utils/rafTrottle.mjs +7 -12
- package/lib/utils/rafTrottle.mjs.map +1 -1
- package/lib/utils/reactToText.js +5 -8
- package/lib/utils/reactToText.js.map +1 -1
- package/lib/utils/reactToText.mjs +3 -6
- package/lib/utils/reactToText.mjs.map +1 -1
- package/lib/utils/ref.d.ts +1 -3
- package/lib/utils/ref.js +29 -61
- package/lib/utils/ref.js.map +1 -1
- package/lib/utils/ref.mjs +27 -57
- package/lib/utils/ref.mjs.map +1 -1
- package/lib/utils/setRef.js +2 -2
- package/lib/utils/setRef.js.map +1 -1
- package/lib/utils/syncScroll.js +24 -24
- package/lib/utils/syncScroll.js.map +1 -1
- package/lib/utils/syncScroll.mjs +21 -21
- package/lib/utils/syncScroll.mjs.map +1 -1
- package/lib/utils/uncontroll.js +8 -18
- package/lib/utils/uncontroll.js.map +1 -1
- package/lib/utils/uncontroll.mjs +8 -17
- package/lib/utils/uncontroll.mjs.map +1 -1
- package/lib/utils/uniqueID.d.ts +0 -4
- package/lib/utils/uniqueID.js +23 -30
- package/lib/utils/uniqueID.js.map +1 -1
- package/lib/utils/uniqueID.mjs +19 -29
- package/lib/utils/uniqueID.mjs.map +1 -1
- package/lib/utils/use/useColorResolver.js +20 -21
- package/lib/utils/use/useColorResolver.js.map +1 -1
- package/lib/utils/use/useColorResolver.mjs +16 -18
- package/lib/utils/use/useColorResolver.mjs.map +1 -1
- package/lib/utils/use/useEnhancedEffect.d.ts +1 -1
- package/lib/utils/use/useEnhancedEffect.js +4 -4
- package/lib/utils/use/useEnhancedEffect.js.map +1 -1
- package/lib/utils/use/useEnhancedEffect.mjs +1 -1
- package/lib/utils/use/useEnhancedEffect.mjs.map +1 -1
- package/lib/utils/use/useEventCallback.js +5 -10
- package/lib/utils/use/useEventCallback.js.map +1 -1
- package/lib/utils/use/useEventCallback.mjs +3 -8
- package/lib/utils/use/useEventCallback.mjs.map +1 -1
- package/lib/utils/use/useEventListener.js +11 -15
- package/lib/utils/use/useEventListener.js.map +1 -1
- package/lib/utils/use/useEventListener.mjs +7 -11
- package/lib/utils/use/useEventListener.mjs.map +1 -1
- package/lib/utils/use/useFocusLock.js +80 -94
- package/lib/utils/use/useFocusLock.js.map +1 -1
- package/lib/utils/use/useFocusLock.mjs +71 -88
- package/lib/utils/use/useFocusLock.mjs.map +1 -1
- package/lib/utils/use/usePreventScroll.js +26 -28
- package/lib/utils/use/usePreventScroll.js.map +1 -1
- package/lib/utils/use/usePreventScroll.mjs +21 -23
- package/lib/utils/use/usePreventScroll.mjs.map +1 -1
- package/lib/utils/use/useScrollBarWidth.js +8 -14
- package/lib/utils/use/useScrollBarWidth.js.map +1 -1
- package/lib/utils/use/useScrollBarWidth.mjs +8 -13
- package/lib/utils/use/useScrollBarWidth.mjs.map +1 -1
- package/lib/utils/useCssVariable.js +32 -37
- package/lib/utils/useCssVariable.js.map +1 -1
- package/lib/utils/useCssVariable.mjs +27 -34
- package/lib/utils/useCssVariable.mjs.map +1 -1
- package/lib/utils/zIndexStacking.d.ts +3 -1
- package/lib/utils/zIndexStacking.js +28 -24
- package/lib/utils/zIndexStacking.js.map +1 -1
- package/lib/utils/zIndexStacking.mjs +23 -22
- package/lib/utils/zIndexStacking.mjs.map +1 -1
- package/package.json +129 -129
- package/lib/enhancement/bindHandler.d.ts +0 -5
- package/lib/enhancement/bindHandler.js +0 -53
- package/lib/enhancement/bindHandler.js.map +0 -1
- package/lib/enhancement/bindHandler.mjs +0 -48
- package/lib/enhancement/bindHandler.mjs.map +0 -1
- package/lib/enhancement/hoistProps.d.ts +0 -10
- package/lib/enhancement/hoistProps.js +0 -95
- package/lib/enhancement/hoistProps.js.map +0 -1
- package/lib/enhancement/hoistProps.mjs +0 -78
- package/lib/enhancement/hoistProps.mjs.map +0 -1
- package/lib/esm/enhancement/bindHandler.mjs +0 -48
- package/lib/esm/enhancement/hoistProps.mjs +0 -78
- package/lib/esm/utils/createHoc.mjs +0 -42
- package/lib/esm/utils/getDisplayName.mjs +0 -6
- package/lib/utils/ScreenReaderOnly.d.ts +0 -8
- package/lib/utils/ScreenReaderOnly.js +0 -30
- 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/createHoc.d.ts +0 -3
- package/lib/utils/createHoc.js +0 -52
- package/lib/utils/createHoc.js.map +0 -1
- package/lib/utils/createHoc.mjs +0 -42
- package/lib/utils/createHoc.mjs.map +0 -1
- package/lib/utils/enhances/WithAutoFocus.d.ts +0 -14
- package/lib/utils/enhances/WithAutoFocus.js +0 -72
- package/lib/utils/enhances/WithAutoFocus.js.map +0 -1
- package/lib/utils/enhances/WithAutoFocus.mjs +0 -66
- package/lib/utils/enhances/WithAutoFocus.mjs.map +0 -1
- package/lib/utils/enhances/WithKeyboardFocus.d.ts +0 -46
- package/lib/utils/enhances/WithKeyboardFocus.js +0 -94
- package/lib/utils/enhances/WithKeyboardFocus.js.map +0 -1
- package/lib/utils/enhances/WithKeyboardFocus.mjs +0 -88
- package/lib/utils/enhances/WithKeyboardFocus.mjs.map +0 -1
- package/lib/utils/enhances/WithRef.d.ts +0 -3
- package/lib/utils/enhances/WithRef.js +0 -25
- 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/autoFocusEnhance.d.ts +0 -10
- package/lib/utils/enhances/autoFocusEnhance.js +0 -45
- 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/keyboardFocusEnhance.d.ts +0 -27
- 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/if.d.ts +0 -11
- package/lib/utils/if.js +0 -15
- 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/use/useCss.d.ts +0 -4
- package/lib/utils/use/useCss.js +0 -19
- 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
|
@@ -1,27 +1,18 @@
|
|
|
1
|
-
import
|
|
2
|
-
import _cn from "classnames";
|
|
1
|
+
import cn from "classnames";
|
|
3
2
|
import { forkRef } from "./ref.mjs";
|
|
4
3
|
import "../styled/index.mjs";
|
|
5
4
|
import { sstyled } from "../styled/sstyled.mjs";
|
|
6
|
-
function callAllEventHandlers() {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
12
|
-
args[_key2] = arguments[_key2];
|
|
5
|
+
function callAllEventHandlers(...fns) {
|
|
6
|
+
return (...args) => !fns.some((fn) => {
|
|
7
|
+
let result;
|
|
8
|
+
if (fn) {
|
|
9
|
+
result = fn(...args);
|
|
13
10
|
}
|
|
14
|
-
return !
|
|
15
|
-
|
|
16
|
-
if (fn) {
|
|
17
|
-
result = fn.apply(void 0, args);
|
|
18
|
-
}
|
|
19
|
-
return typeof result === "boolean" && !result;
|
|
20
|
-
});
|
|
21
|
-
};
|
|
11
|
+
return typeof result === "boolean" && !result;
|
|
12
|
+
});
|
|
22
13
|
}
|
|
23
14
|
function assignHandlers(props, source) {
|
|
24
|
-
return Object.keys(source).reduce(
|
|
15
|
+
return Object.keys(source).reduce((proxySource, propName) => {
|
|
25
16
|
if (typeof source[propName] === "function" && propName.startsWith("on")) {
|
|
26
17
|
proxySource[propName] = callAllEventHandlers(props[propName], source[propName]);
|
|
27
18
|
}
|
|
@@ -29,7 +20,7 @@ function assignHandlers(props, source) {
|
|
|
29
20
|
}, {});
|
|
30
21
|
}
|
|
31
22
|
function assignHandlersInner(props, source) {
|
|
32
|
-
return Object.keys(source).reduce(
|
|
23
|
+
return Object.keys(source).reduce((proxySource, propName) => {
|
|
33
24
|
if (propName !== "ref" && propName.startsWith("on")) {
|
|
34
25
|
if (typeof source[propName] === "function" && typeof props[propName] === "function") {
|
|
35
26
|
proxySource[propName] = callAllEventHandlers(props[propName], source[propName]);
|
|
@@ -42,26 +33,28 @@ function assignHandlersInner(props, source) {
|
|
|
42
33
|
return proxySource;
|
|
43
34
|
}, {});
|
|
44
35
|
}
|
|
45
|
-
function assignProps() {
|
|
46
|
-
var props = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
47
|
-
var source = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
36
|
+
function assignProps(props = {}, source = {}) {
|
|
48
37
|
if (props === source) return props;
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
38
|
+
const newProps = {
|
|
39
|
+
...source,
|
|
40
|
+
...props,
|
|
41
|
+
...assignHandlersInner(props, source)
|
|
42
|
+
};
|
|
43
|
+
for (const key in source) {
|
|
44
|
+
if (key.startsWith("use:")) {
|
|
45
|
+
const originalKey = key.slice("use:".length);
|
|
46
|
+
newProps[originalKey] = source[key];
|
|
54
47
|
}
|
|
55
48
|
}
|
|
56
|
-
for (
|
|
57
|
-
if (
|
|
58
|
-
|
|
59
|
-
newProps[
|
|
49
|
+
for (const key in props) {
|
|
50
|
+
if (key.startsWith("use:")) {
|
|
51
|
+
const originalKey = key.slice("use:".length);
|
|
52
|
+
newProps[originalKey] = props[key];
|
|
60
53
|
}
|
|
61
54
|
}
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
if (sourceDescriptorRef
|
|
55
|
+
const sourceDescriptorRef = Object.getOwnPropertyDescriptor(source, "ref");
|
|
56
|
+
const propsDescriptorRef = Object.getOwnPropertyDescriptor(props, "ref");
|
|
57
|
+
if ((sourceDescriptorRef == null ? void 0 : sourceDescriptorRef.configurable) && (propsDescriptorRef == null ? void 0 : propsDescriptorRef.configurable)) {
|
|
65
58
|
newProps.ref = forkRef(source.ref, props.ref);
|
|
66
59
|
}
|
|
67
60
|
if (props.forwardRef) {
|
|
@@ -69,10 +62,13 @@ function assignProps() {
|
|
|
69
62
|
newProps.forwardRef = newProps.ref;
|
|
70
63
|
}
|
|
71
64
|
if (source.style && props.style) {
|
|
72
|
-
newProps.style =
|
|
65
|
+
newProps.style = {
|
|
66
|
+
...source.style,
|
|
67
|
+
...props.style
|
|
68
|
+
};
|
|
73
69
|
}
|
|
74
70
|
if (source.className) {
|
|
75
|
-
newProps.className =
|
|
71
|
+
newProps.className = cn(props.className, source.className);
|
|
76
72
|
}
|
|
77
73
|
if (source.styles && props.styles) {
|
|
78
74
|
newProps.styles = sstyled.merge(source.styles, props.styles);
|
|
@@ -1,75 +1,28 @@
|
|
|
1
|
-
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
2
|
-
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
3
|
-
import _callSuper from "@babel/runtime/helpers/esm/callSuper";
|
|
4
|
-
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
5
|
-
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
6
1
|
import { createIntlCache, createIntl } from "@formatjs/intl";
|
|
7
|
-
import React, { createContext
|
|
8
|
-
import createHoc from "../createHoc.mjs";
|
|
2
|
+
import React, { createContext } from "react";
|
|
9
3
|
import { useAsyncI18nMessages } from "./i18nEnhance.mjs";
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
args[_key] = arguments[_key];
|
|
25
|
-
}
|
|
26
|
-
_this = _callSuper(this, WithI18n2, [].concat(args));
|
|
27
|
-
_defineProperty(_this, "context", void 0);
|
|
28
|
-
_defineProperty(_this, "getText", function(dictionary, selfLocale) {
|
|
29
|
-
var _this$props = _this.props, locale = _this$props.locale, getText2 = _this$props.getText;
|
|
30
|
-
var contextLocale = _this.context;
|
|
31
|
-
return getText2(dictionary, selfLocale || locale || contextLocale);
|
|
32
|
-
});
|
|
33
|
-
return _this;
|
|
34
|
-
}
|
|
35
|
-
_inherits(WithI18n2, _Component);
|
|
36
|
-
return _createClass(WithI18n2, [{
|
|
37
|
-
key: "render",
|
|
38
|
-
value: function render() {
|
|
39
|
-
var _ref = this.props, children = _ref.children;
|
|
40
|
-
return children({
|
|
41
|
-
getText: this.getText
|
|
42
|
-
});
|
|
43
|
-
}
|
|
44
|
-
}]);
|
|
45
|
-
})(Component);
|
|
46
|
-
_defineProperty(WithI18n, "contextType", Context);
|
|
47
|
-
_defineProperty(WithI18n, "defaultProps", {
|
|
48
|
-
getText
|
|
49
|
-
});
|
|
50
|
-
var useI18n = function useI18n2(dictionary) {
|
|
51
|
-
var _React$useContext;
|
|
52
|
-
var locale = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "en";
|
|
53
|
-
var fallbackDictionary = arguments.length > 2 ? arguments[2] : void 0;
|
|
54
|
-
var lang = (_React$useContext = React.useContext(Context)) !== null && _React$useContext !== void 0 ? _React$useContext : locale;
|
|
55
|
-
var resolvedDictionary = useAsyncI18nMessages(dictionary, lang, fallbackDictionary);
|
|
56
|
-
var intl = React.useMemo(function() {
|
|
57
|
-
return createIntl({
|
|
58
|
-
locale: lang,
|
|
59
|
-
messages: resolvedDictionary
|
|
60
|
-
}, messagesCache);
|
|
61
|
-
}, [resolvedDictionary, lang]);
|
|
62
|
-
return React.useCallback(function(messageId, variables) {
|
|
4
|
+
const Context = /* @__PURE__ */ createContext(void 0);
|
|
5
|
+
const {
|
|
6
|
+
Provider: I18nProvider,
|
|
7
|
+
Consumer: I18nConsumer
|
|
8
|
+
} = Context;
|
|
9
|
+
const messagesCache = createIntlCache();
|
|
10
|
+
const useI18n = (dictionary, locale = "en", fallbackDictionary) => {
|
|
11
|
+
const lang = React.useContext(Context) ?? locale;
|
|
12
|
+
const resolvedDictionary = useAsyncI18nMessages(dictionary, lang, fallbackDictionary);
|
|
13
|
+
const intl = React.useMemo(() => createIntl({
|
|
14
|
+
locale: lang,
|
|
15
|
+
messages: resolvedDictionary
|
|
16
|
+
}, messagesCache), [resolvedDictionary, lang]);
|
|
17
|
+
return React.useCallback((messageId, variables) => {
|
|
63
18
|
return intl.formatMessage({
|
|
64
|
-
id: messageId
|
|
19
|
+
id: messageId ?? ""
|
|
65
20
|
}, variables);
|
|
66
21
|
}, [intl]);
|
|
67
22
|
};
|
|
68
|
-
const WithI18n$1 = createHoc(WithI18n);
|
|
69
23
|
export {
|
|
70
24
|
Context,
|
|
71
25
|
I18nConsumer,
|
|
72
26
|
I18nProvider,
|
|
73
|
-
WithI18n$1 as default,
|
|
74
27
|
useI18n
|
|
75
28
|
};
|
|
@@ -1,89 +1,75 @@
|
|
|
1
|
-
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
2
|
-
import _typeof from "@babel/runtime/helpers/esm/typeof";
|
|
3
|
-
import _regenerator from "@babel/runtime/helpers/esm/regenerator";
|
|
4
|
-
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
5
|
-
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
6
|
-
import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
|
|
7
1
|
import React from "react";
|
|
8
2
|
import { useI18n } from "./WithI18n.mjs";
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
var container = React.useMemo(function() {
|
|
3
|
+
const useAsyncI18nMessages = (primaryContainer, locale, fallbackContainer) => {
|
|
4
|
+
const container = React.useMemo(() => {
|
|
12
5
|
if (!fallbackContainer) return primaryContainer;
|
|
13
6
|
if (!primaryContainer) return fallbackContainer;
|
|
14
7
|
if (primaryContainer === fallbackContainer) return primaryContainer;
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
if (typeof primaryContainer[
|
|
18
|
-
container2[
|
|
19
|
-
|
|
20
|
-
return
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
case 1:
|
|
26
|
-
_yield$Promise$all = _context.v;
|
|
27
|
-
_yield$Promise$all2 = _slicedToArray(_yield$Promise$all, 2);
|
|
28
|
-
primary = _yield$Promise$all2[0];
|
|
29
|
-
fallback = _yield$Promise$all2[1];
|
|
30
|
-
return _context.a(2, _objectSpread(_objectSpread({}, primary), fallback));
|
|
31
|
-
}
|
|
32
|
-
}, _callee);
|
|
33
|
-
}));
|
|
8
|
+
const container2 = {};
|
|
9
|
+
for (const locale2 in primaryContainer) {
|
|
10
|
+
if (typeof primaryContainer[locale2] === "function" || typeof fallbackContainer[locale2] === "function") {
|
|
11
|
+
container2[locale2] = async () => {
|
|
12
|
+
const [primary, fallback] = await Promise.all([primaryContainer[locale2], fallbackContainer[locale2]]);
|
|
13
|
+
return {
|
|
14
|
+
...primary,
|
|
15
|
+
...fallback
|
|
16
|
+
};
|
|
17
|
+
};
|
|
34
18
|
} else {
|
|
35
|
-
|
|
36
|
-
|
|
19
|
+
container2[locale2] = {
|
|
20
|
+
...primaryContainer[locale2] ?? {},
|
|
21
|
+
...fallbackContainer[locale2] ?? {}
|
|
22
|
+
};
|
|
37
23
|
}
|
|
38
|
-
};
|
|
39
|
-
for (var _locale in primaryContainer) {
|
|
40
|
-
_loop(_locale);
|
|
41
24
|
}
|
|
42
25
|
return container2;
|
|
43
26
|
}, [primaryContainer, fallbackContainer]);
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
for (
|
|
47
|
-
if (
|
|
48
|
-
store2[
|
|
27
|
+
const initStore = React.useMemo(() => {
|
|
28
|
+
const store2 = {};
|
|
29
|
+
for (const locale2 in container) {
|
|
30
|
+
if (typeof container[locale2] === "object") {
|
|
31
|
+
store2[locale2] = container[locale2];
|
|
49
32
|
}
|
|
50
33
|
}
|
|
51
34
|
return store2;
|
|
52
35
|
}, [container]);
|
|
53
|
-
|
|
54
|
-
|
|
36
|
+
const [store, setStore] = React.useState(initStore);
|
|
37
|
+
const lastLoadedLocaleRef = React.useRef(null);
|
|
55
38
|
if (store[locale]) lastLoadedLocaleRef.current = locale;
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
var loadingLocaleRef = React.useRef(null);
|
|
60
|
-
React.useEffect(function() {
|
|
39
|
+
const fallbackMessages = React.useMemo(() => Object.values(store)[0], [store]);
|
|
40
|
+
const loadingLocaleRef = React.useRef(null);
|
|
41
|
+
React.useEffect(() => {
|
|
61
42
|
loadingLocaleRef.current = locale;
|
|
62
|
-
|
|
43
|
+
const asyncMessages = container[locale];
|
|
63
44
|
if (typeof asyncMessages === "function") {
|
|
64
|
-
asyncMessages().then(
|
|
45
|
+
asyncMessages().then((module) => {
|
|
65
46
|
if (loadingLocaleRef.current !== locale) return;
|
|
66
|
-
|
|
67
|
-
if ("default" in module &&
|
|
68
|
-
setStore(
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
47
|
+
let messages = module;
|
|
48
|
+
if ("default" in module && typeof module.default === "object") messages = module.default;
|
|
49
|
+
setStore((store2) => ({
|
|
50
|
+
...store2,
|
|
51
|
+
[locale]: messages
|
|
52
|
+
}));
|
|
53
|
+
}).catch((err) => {
|
|
72
54
|
console.error(err);
|
|
73
55
|
});
|
|
74
56
|
}
|
|
75
57
|
}, [container, locale]);
|
|
76
|
-
return
|
|
58
|
+
return store[locale] ?? fallbackMessages;
|
|
77
59
|
};
|
|
78
|
-
const i18nEnhance = (
|
|
79
|
-
return
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
60
|
+
const i18nEnhance = (container) => {
|
|
61
|
+
return (props) => {
|
|
62
|
+
const {
|
|
63
|
+
i18n,
|
|
64
|
+
locale
|
|
65
|
+
} = props;
|
|
66
|
+
const getI18nText = useI18n(i18n, locale, container);
|
|
67
|
+
return {
|
|
68
|
+
...props,
|
|
83
69
|
getI18nText
|
|
84
|
-
}
|
|
70
|
+
};
|
|
85
71
|
};
|
|
86
|
-
}
|
|
72
|
+
};
|
|
87
73
|
export {
|
|
88
74
|
i18nEnhance as default,
|
|
89
75
|
useAsyncI18nMessages
|
package/lib/esm/utils/logger.mjs
CHANGED
|
@@ -1,32 +1,24 @@
|
|
|
1
|
-
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
2
|
-
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
3
1
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
_classCallCheck(this, Logger2);
|
|
2
|
+
const DEV = process.env.NODE_ENV !== "production";
|
|
3
|
+
class Logger {
|
|
4
|
+
constructor(logger2) {
|
|
8
5
|
_defineProperty(this, "logger", void 0);
|
|
9
6
|
this.logger = logger2 || {
|
|
10
|
-
warn:
|
|
7
|
+
warn: () => {
|
|
11
8
|
}
|
|
12
9
|
};
|
|
13
10
|
}
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
value: function warn(condition, msg, component) {
|
|
22
|
-
if (DEV) {
|
|
23
|
-
if (condition) {
|
|
24
|
-
this.console("warn", msg, component);
|
|
25
|
-
}
|
|
11
|
+
console(level, msg, component) {
|
|
12
|
+
this.logger[level](component ? `[${component}]: ${msg}` : msg);
|
|
13
|
+
}
|
|
14
|
+
warn(condition, msg, component) {
|
|
15
|
+
if (DEV) {
|
|
16
|
+
if (condition) {
|
|
17
|
+
this.console("warn", msg, component);
|
|
26
18
|
}
|
|
27
19
|
}
|
|
28
|
-
}
|
|
29
|
-
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
30
22
|
const logger = new Logger(console);
|
|
31
23
|
export {
|
|
32
24
|
Logger,
|
package/lib/esm/utils/pick.mjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
function pick(obj, keys) {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
const res = {};
|
|
3
|
+
const len = keys.length;
|
|
4
|
+
let idx = -1;
|
|
5
5
|
while (++idx < len) {
|
|
6
|
-
|
|
6
|
+
const key = keys[idx];
|
|
7
7
|
if (key in obj) {
|
|
8
8
|
res[key] = obj[key];
|
|
9
9
|
}
|
package/lib/esm/utils/ref.mjs
CHANGED
|
@@ -1,11 +1,8 @@
|
|
|
1
|
-
import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
|
|
2
|
-
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
3
1
|
import React from "react";
|
|
4
|
-
import { findDOMNode } from "react-dom";
|
|
5
2
|
function setRef(ref, value) {
|
|
6
3
|
if (typeof ref === "function") {
|
|
7
4
|
ref(value);
|
|
8
|
-
} else if (ref
|
|
5
|
+
} else if (ref == null ? void 0 : ref.hasOwnProperty("current")) {
|
|
9
6
|
ref["current"] = value;
|
|
10
7
|
}
|
|
11
8
|
}
|
|
@@ -14,72 +11,45 @@ function getRef(ref) {
|
|
|
14
11
|
return "current" in ref ? ref.current : ref;
|
|
15
12
|
}
|
|
16
13
|
function useCallbackRef(initialValue, callback) {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
ref.callback(value, last);
|
|
33
|
-
}
|
|
14
|
+
const [ref] = React.useState(() => ({
|
|
15
|
+
// value
|
|
16
|
+
value: initialValue,
|
|
17
|
+
// last callback
|
|
18
|
+
callback,
|
|
19
|
+
// "memoized" public interface
|
|
20
|
+
facade: {
|
|
21
|
+
get current() {
|
|
22
|
+
return ref.value;
|
|
23
|
+
},
|
|
24
|
+
set current(value) {
|
|
25
|
+
const last = ref.value;
|
|
26
|
+
if (last !== value) {
|
|
27
|
+
ref.value = value;
|
|
28
|
+
ref.callback(value, last);
|
|
34
29
|
}
|
|
35
30
|
}
|
|
36
|
-
}
|
|
37
|
-
})
|
|
31
|
+
}
|
|
32
|
+
}));
|
|
38
33
|
ref.callback = callback;
|
|
39
34
|
return ref.facade;
|
|
40
35
|
}
|
|
41
|
-
function useForkRef() {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
return React.useCallback(function(refValue) {
|
|
46
|
-
var uniqueRefs = _toConsumableArray(new Set(refs));
|
|
47
|
-
uniqueRefs.forEach(function(ref) {
|
|
48
|
-
return setRef(ref, refValue);
|
|
49
|
-
});
|
|
36
|
+
function useForkRef(...refs) {
|
|
37
|
+
return React.useCallback((refValue) => {
|
|
38
|
+
const uniqueRefs = [...new Set(refs)];
|
|
39
|
+
uniqueRefs.forEach((ref) => setRef(ref, refValue));
|
|
50
40
|
}, refs);
|
|
51
41
|
}
|
|
52
|
-
function forkRef() {
|
|
53
|
-
|
|
54
|
-
refs[_key2] = arguments[_key2];
|
|
55
|
-
}
|
|
56
|
-
if (refs.every(function(ref) {
|
|
57
|
-
return ref == null;
|
|
58
|
-
})) {
|
|
42
|
+
function forkRef(...refs) {
|
|
43
|
+
if (refs.every((ref) => ref == null)) {
|
|
59
44
|
return null;
|
|
60
45
|
}
|
|
61
|
-
return
|
|
62
|
-
|
|
63
|
-
uniqueRefs.forEach(
|
|
64
|
-
return setRef(ref, refValue);
|
|
65
|
-
});
|
|
46
|
+
return (refValue) => {
|
|
47
|
+
const uniqueRefs = [...new Set(refs)];
|
|
48
|
+
uniqueRefs.forEach((ref) => setRef(ref, refValue));
|
|
66
49
|
};
|
|
67
50
|
}
|
|
68
|
-
function getNodeByRef(ref) {
|
|
69
|
-
if (typeof ref === "function") {
|
|
70
|
-
ref = ref();
|
|
71
|
-
}
|
|
72
|
-
if (!ref) return null;
|
|
73
|
-
var node = getRef(ref);
|
|
74
|
-
if (!node) return null;
|
|
75
|
-
if ("nodeType" in node && node.nodeType === 1) return node;
|
|
76
|
-
if (Object.keys(node).length === 1 && "getBoundingClientRect" in node) return null;
|
|
77
|
-
if (!/* @__PURE__ */ React.isValidElement(node) && !(node instanceof React.Component)) return null;
|
|
78
|
-
return findDOMNode(node);
|
|
79
|
-
}
|
|
80
51
|
export {
|
|
81
52
|
forkRef,
|
|
82
|
-
getNodeByRef,
|
|
83
53
|
getRef,
|
|
84
54
|
setRef,
|
|
85
55
|
useCallbackRef,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import canUseDOM from "../canUseDOM.mjs";
|
|
3
|
-
|
|
3
|
+
const useEnhancedEffect = canUseDOM() ? React.useLayoutEffect : React.useEffect;
|
|
4
4
|
export {
|
|
5
5
|
useEnhancedEffect as default
|
|
6
6
|
};
|
package/lib/index.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/** ============================== core ============================== */
|
|
2
2
|
import { Root, Component, Intergalactic, wrapIntergalacticComponent } from './core-types/Component';
|
|
3
|
-
import type { PropGetterFn, IRootComponentProps,
|
|
3
|
+
import type { PropGetterFn, IRootComponentProps, IRootNodeProps } from './core-types/Component';
|
|
4
4
|
import { CORE_INSTANCE, CREATE_COMPONENT, CONTEXT_COMPONENT, CHILDREN_COMPONENT, INHERITED_NAME } from './core-types/symbols';
|
|
5
5
|
import type { UnknownProperties } from './core-types/UnknownProperties';
|
|
6
6
|
import { createComponent, createBaseComponent, assignProps } from './coreFactory';
|
|
7
7
|
import { lastInteraction } from './LastInteractionType';
|
|
8
8
|
import register from './register';
|
|
9
|
-
import type {
|
|
9
|
+
import type { IStyledProps } from './styled';
|
|
10
10
|
import { sstyled } from './styled';
|
|
11
|
-
export { sstyled, createComponent, createBaseComponent, Root, Component, type UnknownProperties, Intergalactic, type PropGetterFn, type IRootComponentProps, type
|
|
11
|
+
export { sstyled, createComponent, createBaseComponent, Root, Component, type UnknownProperties, Intergalactic, type PropGetterFn, type IRootComponentProps, type IRootNodeProps, CORE_INSTANCE, CREATE_COMPONENT, CONTEXT_COMPONENT, CHILDREN_COMPONENT, INHERITED_NAME, type IStyledProps, wrapIntergalacticComponent, assignProps, register, lastInteraction, };
|
package/lib/index.js
CHANGED
|
@@ -1,96 +1,96 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault")
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
Object.defineProperty(exports, "CHILDREN_COMPONENT", {
|
|
8
8
|
enumerable: true,
|
|
9
|
-
get: function
|
|
9
|
+
get: function () {
|
|
10
10
|
return _symbols.CHILDREN_COMPONENT;
|
|
11
11
|
}
|
|
12
12
|
});
|
|
13
13
|
Object.defineProperty(exports, "CONTEXT_COMPONENT", {
|
|
14
14
|
enumerable: true,
|
|
15
|
-
get: function
|
|
15
|
+
get: function () {
|
|
16
16
|
return _symbols.CONTEXT_COMPONENT;
|
|
17
17
|
}
|
|
18
18
|
});
|
|
19
19
|
Object.defineProperty(exports, "CORE_INSTANCE", {
|
|
20
20
|
enumerable: true,
|
|
21
|
-
get: function
|
|
21
|
+
get: function () {
|
|
22
22
|
return _symbols.CORE_INSTANCE;
|
|
23
23
|
}
|
|
24
24
|
});
|
|
25
25
|
Object.defineProperty(exports, "CREATE_COMPONENT", {
|
|
26
26
|
enumerable: true,
|
|
27
|
-
get: function
|
|
27
|
+
get: function () {
|
|
28
28
|
return _symbols.CREATE_COMPONENT;
|
|
29
29
|
}
|
|
30
30
|
});
|
|
31
31
|
Object.defineProperty(exports, "Component", {
|
|
32
32
|
enumerable: true,
|
|
33
|
-
get: function
|
|
33
|
+
get: function () {
|
|
34
34
|
return _Component.Component;
|
|
35
35
|
}
|
|
36
36
|
});
|
|
37
37
|
Object.defineProperty(exports, "INHERITED_NAME", {
|
|
38
38
|
enumerable: true,
|
|
39
|
-
get: function
|
|
39
|
+
get: function () {
|
|
40
40
|
return _symbols.INHERITED_NAME;
|
|
41
41
|
}
|
|
42
42
|
});
|
|
43
43
|
Object.defineProperty(exports, "Intergalactic", {
|
|
44
44
|
enumerable: true,
|
|
45
|
-
get: function
|
|
45
|
+
get: function () {
|
|
46
46
|
return _Component.Intergalactic;
|
|
47
47
|
}
|
|
48
48
|
});
|
|
49
49
|
Object.defineProperty(exports, "Root", {
|
|
50
50
|
enumerable: true,
|
|
51
|
-
get: function
|
|
51
|
+
get: function () {
|
|
52
52
|
return _Component.Root;
|
|
53
53
|
}
|
|
54
54
|
});
|
|
55
55
|
Object.defineProperty(exports, "assignProps", {
|
|
56
56
|
enumerable: true,
|
|
57
|
-
get: function
|
|
57
|
+
get: function () {
|
|
58
58
|
return _coreFactory.assignProps;
|
|
59
59
|
}
|
|
60
60
|
});
|
|
61
61
|
Object.defineProperty(exports, "createBaseComponent", {
|
|
62
62
|
enumerable: true,
|
|
63
|
-
get: function
|
|
63
|
+
get: function () {
|
|
64
64
|
return _coreFactory.createBaseComponent;
|
|
65
65
|
}
|
|
66
66
|
});
|
|
67
67
|
Object.defineProperty(exports, "createComponent", {
|
|
68
68
|
enumerable: true,
|
|
69
|
-
get: function
|
|
69
|
+
get: function () {
|
|
70
70
|
return _coreFactory.createComponent;
|
|
71
71
|
}
|
|
72
72
|
});
|
|
73
73
|
Object.defineProperty(exports, "lastInteraction", {
|
|
74
74
|
enumerable: true,
|
|
75
|
-
get: function
|
|
75
|
+
get: function () {
|
|
76
76
|
return _LastInteractionType.lastInteraction;
|
|
77
77
|
}
|
|
78
78
|
});
|
|
79
79
|
Object.defineProperty(exports, "register", {
|
|
80
80
|
enumerable: true,
|
|
81
|
-
get: function
|
|
82
|
-
return _register
|
|
81
|
+
get: function () {
|
|
82
|
+
return _register.default;
|
|
83
83
|
}
|
|
84
84
|
});
|
|
85
85
|
Object.defineProperty(exports, "sstyled", {
|
|
86
86
|
enumerable: true,
|
|
87
|
-
get: function
|
|
87
|
+
get: function () {
|
|
88
88
|
return _styled.sstyled;
|
|
89
89
|
}
|
|
90
90
|
});
|
|
91
91
|
Object.defineProperty(exports, "wrapIntergalacticComponent", {
|
|
92
92
|
enumerable: true,
|
|
93
|
-
get: function
|
|
93
|
+
get: function () {
|
|
94
94
|
return _Component.wrapIntergalacticComponent;
|
|
95
95
|
}
|
|
96
96
|
});
|