@semcore/core 17.0.0-prerelease.20-prerelease.20 → 17.0.0-prerelease.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/LastInteractionType.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.js +25 -41
- package/lib/core-types/Component.js.map +1 -1
- package/lib/core-types/Component.mjs +18 -38
- 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.js +143 -205
- package/lib/coreFactory.js.map +1 -1
- package/lib/coreFactory.mjs +118 -164
- package/lib/coreFactory.mjs.map +1 -1
- package/lib/decorators/propsObserver.js +36 -64
- package/lib/decorators/propsObserver.js.map +1 -1
- package/lib/decorators/propsObserver.mjs +33 -61
- package/lib/decorators/propsObserver.mjs.map +1 -1
- package/lib/decorators/reactive.js +17 -17
- package/lib/decorators/reactive.js.map +1 -1
- package/lib/decorators/reactive.mjs +15 -15
- package/lib/decorators/reactive.mjs.map +1 -1
- 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 -65
- package/lib/enhancement/uncontrolledProps.js.map +1 -1
- package/lib/enhancement/uncontrolledProps.mjs +43 -52
- package/lib/enhancement/uncontrolledProps.mjs.map +1 -1
- package/lib/esm/LastInteractionType.mjs +19 -33
- package/lib/esm/core-types/Component.mjs +18 -38
- package/lib/esm/core-types/symbols.mjs +9 -9
- package/lib/esm/coreFactory.mjs +118 -164
- 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 -52
- 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 +15 -17
- 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 -43
- package/lib/esm/utils/use/useEnhancedEffect.mjs +1 -1
- package/lib/index.js +17 -17
- 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.js +4 -4
- 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.js +10 -8
- package/lib/utils/enhances/WithCSS.js.map +1 -1
- package/lib/utils/enhances/WithCSS.mjs +7 -6
- package/lib/utils/enhances/WithCSS.mjs.map +1 -1
- package/lib/utils/enhances/WithI18n.js +19 -19
- package/lib/utils/enhances/WithI18n.js.map +1 -1
- package/lib/utils/enhances/WithI18n.mjs +15 -17
- 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.js +55 -63
- package/lib/utils/enhances/animatedSizeEnhance.js.map +1 -1
- package/lib/utils/enhances/animatedSizeEnhance.mjs +50 -58
- 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.js +51 -67
- 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.js +30 -57
- package/lib/utils/eventEmitter.js.map +1 -1
- package/lib/utils/eventEmitter.mjs +26 -55
- 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/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.js +29 -47
- package/lib/utils/ref.js.map +1 -1
- package/lib/utils/ref.mjs +27 -43
- 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.js +22 -27
- package/lib/utils/uniqueID.js.map +1 -1
- package/lib/utils/uniqueID.mjs +18 -25
- 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.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.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 +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"propsObserver.js","names":["propsObserver","propsToWatch","Class","
|
|
1
|
+
{"version":3,"file":"propsObserver.js","names":["propsObserver","propsToWatch","Class","constructor","args","_defineProperty2","default","props","observablePropKeys","length","Object","keys","forEach","key","__observableProps","onPropsChange","_","shouldEmitChanges","changedProps","entries","value","arePropsEqual","is","componentWillUnmount","undefined","render","_default","exports"],"sources":["../../src/decorators/propsObserver.ts"],"sourcesContent":["type WatchedProps<Props> = { [key in keyof Props]?: unknown };\n\ntype Constructor<Props> = new (...args: any[]) => {\n props: Props;\n onPropsChange(changedProps: WatchedProps<Props>): void;\n render(): React.ReactNode;\n componentWillUnmount?(): void;\n};\n\nfunction propsObserver<\n P extends Record<string, any>,\n C extends Constructor<P>,\n>(propsToWatch: Array<keyof P>) {\n return function (Class: C): C & Constructor<P> {\n return class extends Class {\n __observableProps: WatchedProps<P> = {};\n\n constructor(...args: any[]) {\n super(...args);\n\n if (!this.props) return;\n\n const observablePropKeys = propsToWatch.length === 0 ? Object.keys(this.props) : [...propsToWatch];\n\n observablePropKeys.forEach((key) => {\n this.__observableProps[key] = this.props[key];\n });\n }\n\n onPropsChange(_?: WatchedProps<P>) {\n let shouldEmitChanges = false;\n const changedProps: WatchedProps<P> = {};\n\n Object.entries(this.__observableProps).forEach(([key, value]: [key: keyof P, value: unknown]) => {\n const arePropsEqual = Object.is(value, this.props[key]);\n\n if (!arePropsEqual) {\n this.__observableProps[key] = this.props[key];\n changedProps[key] = this.props[key];\n\n shouldEmitChanges = true;\n }\n });\n\n if (!shouldEmitChanges) return;\n\n super.onPropsChange(changedProps);\n }\n\n componentWillUnmount() {\n super.componentWillUnmount?.();\n\n Object.keys(this.__observableProps).forEach((key: keyof P) => {\n this.__observableProps[key] = undefined;\n });\n }\n\n render() {\n this.onPropsChange();\n\n return super.render();\n }\n };\n };\n}\n\nexport default propsObserver;\n"],"mappings":";;;;;;;;AASA,SAASA,aAAaA,CAGpBC,YAA4B,EAAE;EAC9B,OAAO,UAAUC,KAAQ,EAAsB;IAC7C,OAAO,cAAcA,KAAK,CAAC;MAGzBC,WAAWA,CAAC,GAAGC,IAAW,EAAE;QAC1B,KAAK,CAAC,GAAGA,IAAI,CAAC;QAAC,IAAAC,gBAAA,CAAAC,OAAA,6BAHoB,CAAC,CAAC;QAKrC,IAAI,CAAC,IAAI,CAACC,KAAK,EAAE;QAEjB,MAAMC,kBAAkB,GAAGP,YAAY,CAACQ,MAA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OAAO,KAAK,CAACU,MAAM,CAAC,CAAC;MACvB;IACF,CAAC;EACH,CAAC;AACH;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAArB,OAAA,GAEcN,aAAa","ignoreList":[]}
|
|
@@ -1,69 +1,41 @@
|
|
|
1
|
-
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
2
|
-
import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
|
|
3
|
-
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
4
|
-
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
5
|
-
import _possibleConstructorReturn from "@babel/runtime/helpers/esm/possibleConstructorReturn";
|
|
6
|
-
import _callSuper from "@babel/runtime/helpers/esm/callSuper";
|
|
7
|
-
import _superPropGet from "@babel/runtime/helpers/esm/superPropGet";
|
|
8
|
-
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
9
1
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
10
2
|
function propsObserver(propsToWatch) {
|
|
11
3
|
return function (Class) {
|
|
12
|
-
return
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
_defineProperty(_this, "__observableProps", {});
|
|
21
|
-
if (!_this.props) return _possibleConstructorReturn(_this);
|
|
22
|
-
var observablePropKeys = propsToWatch.length === 0 ? Object.keys(_this.props) : _toConsumableArray(propsToWatch);
|
|
23
|
-
observablePropKeys.forEach(function (key) {
|
|
24
|
-
_this.__observableProps[key] = _this.props[key];
|
|
4
|
+
return class extends Class {
|
|
5
|
+
constructor(...args) {
|
|
6
|
+
super(...args);
|
|
7
|
+
_defineProperty(this, "__observableProps", {});
|
|
8
|
+
if (!this.props) return;
|
|
9
|
+
const observablePropKeys = propsToWatch.length === 0 ? Object.keys(this.props) : [...propsToWatch];
|
|
10
|
+
observablePropKeys.forEach(key => {
|
|
11
|
+
this.__observableProps[key] = this.props[key];
|
|
25
12
|
});
|
|
26
|
-
return _this;
|
|
27
13
|
}
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
value
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
_this3 = this;
|
|
54
|
-
(_superPropGet2 = _superPropGet(_class, "componentWillUnmount", this, 3)) === null || _superPropGet2 === void 0 || _superPropGet2([]);
|
|
55
|
-
Object.keys(this.__observableProps).forEach(function (key) {
|
|
56
|
-
_this3.__observableProps[key] = undefined;
|
|
57
|
-
});
|
|
58
|
-
}
|
|
59
|
-
}, {
|
|
60
|
-
key: "render",
|
|
61
|
-
value: function render() {
|
|
62
|
-
this.onPropsChange();
|
|
63
|
-
return _superPropGet(_class, "render", this, 3)([]);
|
|
64
|
-
}
|
|
65
|
-
}]);
|
|
66
|
-
}(Class);
|
|
14
|
+
onPropsChange(_) {
|
|
15
|
+
let shouldEmitChanges = false;
|
|
16
|
+
const changedProps = {};
|
|
17
|
+
Object.entries(this.__observableProps).forEach(([key, value]) => {
|
|
18
|
+
const arePropsEqual = Object.is(value, this.props[key]);
|
|
19
|
+
if (!arePropsEqual) {
|
|
20
|
+
this.__observableProps[key] = this.props[key];
|
|
21
|
+
changedProps[key] = this.props[key];
|
|
22
|
+
shouldEmitChanges = true;
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
if (!shouldEmitChanges) return;
|
|
26
|
+
super.onPropsChange(changedProps);
|
|
27
|
+
}
|
|
28
|
+
componentWillUnmount() {
|
|
29
|
+
super.componentWillUnmount?.();
|
|
30
|
+
Object.keys(this.__observableProps).forEach(key => {
|
|
31
|
+
this.__observableProps[key] = undefined;
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
render() {
|
|
35
|
+
this.onPropsChange();
|
|
36
|
+
return super.render();
|
|
37
|
+
}
|
|
38
|
+
};
|
|
67
39
|
};
|
|
68
40
|
}
|
|
69
41
|
export default propsObserver;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"propsObserver.mjs","names":["propsObserver","propsToWatch","Class","
|
|
1
|
+
{"version":3,"file":"propsObserver.mjs","names":["propsObserver","propsToWatch","Class","constructor","args","_defineProperty","props","observablePropKeys","length","Object","keys","forEach","key","__observableProps","onPropsChange","_","shouldEmitChanges","changedProps","entries","value","arePropsEqual","is","componentWillUnmount","undefined","render"],"sources":["../../src/decorators/propsObserver.ts"],"sourcesContent":["type WatchedProps<Props> = { [key in keyof Props]?: unknown };\n\ntype Constructor<Props> = new (...args: any[]) => {\n props: Props;\n onPropsChange(changedProps: WatchedProps<Props>): void;\n render(): React.ReactNode;\n componentWillUnmount?(): void;\n};\n\nfunction propsObserver<\n P extends Record<string, any>,\n C extends Constructor<P>,\n>(propsToWatch: Array<keyof P>) {\n return function (Class: C): C & Constructor<P> {\n return class extends Class {\n __observableProps: WatchedProps<P> = {};\n\n constructor(...args: any[]) {\n super(...args);\n\n if (!this.props) return;\n\n const observablePropKeys = propsToWatch.length === 0 ? Object.keys(this.props) : [...propsToWatch];\n\n observablePropKeys.forEach((key) => {\n this.__observableProps[key] = this.props[key];\n });\n }\n\n onPropsChange(_?: WatchedProps<P>) {\n let shouldEmitChanges = false;\n const changedProps: WatchedProps<P> = {};\n\n Object.entries(this.__observableProps).forEach(([key, value]: [key: keyof P, value: unknown]) => {\n const arePropsEqual = Object.is(value, this.props[key]);\n\n if (!arePropsEqual) {\n this.__observableProps[key] = this.props[key];\n changedProps[key] = this.props[key];\n\n shouldEmitChanges = true;\n }\n });\n\n if (!shouldEmitChanges) return;\n\n super.onPropsChange(changedProps);\n }\n\n componentWillUnmount() {\n super.componentWillUnmount?.();\n\n Object.keys(this.__observableProps).forEach((key: keyof P) => {\n this.__observableProps[key] = undefined;\n });\n }\n\n render() {\n this.onPropsChange();\n\n return super.render();\n }\n };\n };\n}\n\nexport default propsObserver;\n"],"mappings":";AASA,SAASA,aAAaA,CAGpBC,YAA4B,EAAE;EAC9B,OAAO,UAAUC,KAAQ,EAAsB;IAC7C,OAAO,cAAcA,KAAK,CAAC;MAGzBC,WAAWA,CAAC,GAAGC,IAAW,EAAE;QAC1B,KAAK,CAAC,GAAGA,IAAI,CAAC;QAACC,eAAA,4BAHoB,CAAC,CAAC;QAKrC,IAAI,CAAC,IAAI,CAACC,KAAK,EAAE;QAEjB,MAAMC,kBAAkB,GAAGN,YAAY,CAACO,MAAM,KAAK,CAAC,GAAGC,MAAM,CAACC,IAAI,CAAC,IAAI,CAACJ,KAAK,CAAC,GAAG,CAAC,GAAGL,YAAY,CAAC;QAElGM,kBAAkB,CAACI,OAAO,CAAEC,GAAG,IAAK;UAClC,IAAI,CAACC,iBAAiB,CAACD,GAAG,CAAC,GAAG,IAAI,CAACN,KAAK,CAACM,GAAG,CAAC;QAC/C,CAAC,CAAC;MACJ;MAEAE,aAAaA,CAACC,CAAmB,EAAE;QACjC,IAAIC,iBAAiB,GAAG,KAAK;QAC7B,MAAMC,YAA6B,GAAG,CAAC,CAAC;QAExCR,MAAM,CAACS,OAAO,CAAC,IAAI,CAACL,iBAAiB,CAAC,CAACF,OAAO,CAAC,CAAC,CAACC,GAAG,EAAEO,KAAK,CAAiC,KAAK;UAC/F,MAAMC,aAAa,GAAGX,MAAM,CAACY,EAAE,CAACF,KAAK,EAAE,IAAI,CAACb,KAAK,CAACM,GAAG,CAAC,CAAC;UAEvD,IAAI,CAACQ,aAAa,EAAE;YAClB,IAAI,CAACP,iBAAiB,CAACD,GAAG,CAAC,GAAG,IAAI,CAACN,KAAK,CAACM,GAAG,CAAC;YAC7CK,YAAY,CAACL,GAAG,CAAC,GAAG,IAAI,CAACN,KAAK,CAACM,GAAG,CAAC;YAEnCI,iBAAiB,GAAG,IAAI;UAC1B;QACF,CAAC,CAAC;QAEF,IAAI,CAACA,iBAAiB,EAAE;QAExB,KAAK,CAACF,aAAa,CAACG,YAAY,CAAC;MACnC;MAEAK,oBAAoBA,CAAA,EAAG;QACrB,KAAK,CAACA,oBAAoB,GAAG,CAAC;QAE9Bb,MAAM,CAACC,IAAI,CAAC,IAAI,CAACG,iBAAiB,CAAC,CAACF,OAAO,CAAEC,GAAY,IAAK;UAC5D,IAAI,CAACC,iBAAiB,CAACD,GAAG,CAAC,GAAGW,SAAS;QACzC,CAAC,CAAC;MACJ;MAEAC,MAAMA,CAAA,EAAG;QACP,IAAI,CAACV,aAAa,CAAC,CAAC;QAEpB,OAAO,KAAK,CAACU,MAAM,CAAC,CAAC;MACvB;IACF,CAAC;EACH,CAAC;AACH;AAEA,eAAexB,aAAa","ignoreList":[]}
|
|
@@ -3,27 +3,27 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports
|
|
7
|
-
|
|
8
|
-
return value !== Object(value);
|
|
9
|
-
};
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
const isPrimitiveValue = value => value !== Object(value);
|
|
10
8
|
function reactive(watchedFieldsOrCb, cb) {
|
|
11
9
|
return function (_, ctx) {
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
const {
|
|
11
|
+
addInitializer,
|
|
12
|
+
name
|
|
13
|
+
} = ctx;
|
|
14
14
|
addInitializer(function () {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
15
|
+
const thisRoot = this;
|
|
16
|
+
const isPrimitive = isPrimitiveValue(this[name]);
|
|
17
|
+
const callback = typeof watchedFieldsOrCb === 'function' ? watchedFieldsOrCb : cb;
|
|
18
|
+
const fields = Array.isArray(watchedFieldsOrCb) ? watchedFieldsOrCb : null;
|
|
19
19
|
if (isPrimitive) {
|
|
20
|
-
|
|
20
|
+
let value = this[name];
|
|
21
21
|
Object.defineProperty(this, name, {
|
|
22
|
-
get
|
|
22
|
+
get() {
|
|
23
23
|
return value;
|
|
24
24
|
},
|
|
25
|
-
set
|
|
26
|
-
|
|
25
|
+
set(newValue) {
|
|
26
|
+
const oldValue = value;
|
|
27
27
|
value = newValue;
|
|
28
28
|
if (oldValue !== newValue) {
|
|
29
29
|
callback.call(thisRoot, name, newValue);
|
|
@@ -35,9 +35,9 @@ function reactive(watchedFieldsOrCb, cb) {
|
|
|
35
35
|
} else {
|
|
36
36
|
// @ts-ignore
|
|
37
37
|
this[name] = new Proxy(this[name], {
|
|
38
|
-
set
|
|
38
|
+
set(target, p, newValue) {
|
|
39
39
|
target[p] = newValue;
|
|
40
|
-
if (
|
|
40
|
+
if (fields?.length === 0 || fields?.includes(p)) {
|
|
41
41
|
callback.call(thisRoot, p, newValue);
|
|
42
42
|
}
|
|
43
43
|
return true;
|
|
@@ -47,5 +47,5 @@ function reactive(watchedFieldsOrCb, cb) {
|
|
|
47
47
|
});
|
|
48
48
|
};
|
|
49
49
|
}
|
|
50
|
-
var _default = exports
|
|
50
|
+
var _default = exports.default = reactive;
|
|
51
51
|
//# sourceMappingURL=reactive.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reactive.js","names":["isPrimitiveValue","value","Object","reactive","watchedFieldsOrCb","cb","_","ctx","addInitializer","name","thisRoot","isPrimitive","callback","fields","Array","isArray","defineProperty","get","set","newValue","oldValue","call","enumerable","configurable","Proxy","target","p","length","includes","_default","exports"],"sources":["../../src/decorators/reactive.ts"],"sourcesContent":["type Primitive = string | number | boolean | symbol | bigint | null | undefined;\ntype IsReadonly<This, Property extends keyof This> =\n (<F>() => F extends { [P in Property]: This[Property] } ? 1 : 2) extends\n (<F>() => F extends { -readonly [P in Property]: This[Property] } ? 1 : 2)\n ? false\n : true;\ntype Callback<This> = (this: This, field: string | symbol, newValue: unknown) => void;\ntype ReturnType<\n This,\n Property extends keyof This = keyof This,\n> = IsReadonly<This, Property> extends true\n ? (_: undefined, ctx: ClassFieldDecoratorContext<This, This[Property]>) => void\n : This[Property] extends Primitive\n ? (_: undefined, ctx: ClassFieldDecoratorContext<This, This[Property]>) => void\n : never;\n\nconst isPrimitiveValue = (value: unknown) => value !== Object(value);\n\nfunction reactive<\n This,\n Property extends keyof This,\n Value = This[Property],\n>(cb: Value extends Primitive ? Callback<This> : never): ReturnType<This>;\nfunction reactive<\n This,\n Property extends keyof This,\n Value = This[Property],\n>(watchedFields: Value extends Primitive ? never : Array<keyof Value>, cb: Callback<This>): ReturnType<This>;\n\nfunction reactive<\n This,\n Property extends keyof This,\n>(watchedFieldsOrCb: Array<keyof This[Property]> | Callback<This>, cb?: Callback<This>) {\n return function (_: undefined, ctx: ClassFieldDecoratorContext<This, This[Property]>) {\n const { addInitializer, name } = ctx;\n\n addInitializer(function (this: This) {\n const thisRoot = this;\n\n const isPrimitive = isPrimitiveValue(this[name as Property]);\n\n const callback = typeof watchedFieldsOrCb === 'function' ? watchedFieldsOrCb : cb!;\n const fields = Array.isArray(watchedFieldsOrCb) ? watchedFieldsOrCb : null;\n\n if (isPrimitive) {\n let value = this[name as Property];\n\n Object.defineProperty(this, name, {\n get() {\n return value;\n },\n set(newValue) {\n const oldValue = value;\n\n value = newValue;\n\n if (oldValue !== newValue) {\n callback.call(thisRoot, name, newValue);\n }\n },\n enumerable: true,\n configurable: true,\n });\n } else {\n // @ts-ignore\n this[name] = new Proxy(this[name], {\n set(target, p, newValue) {\n target[p] = newValue;\n\n if (fields?.length === 0 || fields?.includes(p as keyof This[Property])) {\n callback.call(thisRoot, p, newValue);\n }\n\n return true;\n },\n });\n }\n });\n };\n}\n\nexport default reactive;\n"],"mappings":";;;;;;AAgBA,
|
|
1
|
+
{"version":3,"file":"reactive.js","names":["isPrimitiveValue","value","Object","reactive","watchedFieldsOrCb","cb","_","ctx","addInitializer","name","thisRoot","isPrimitive","callback","fields","Array","isArray","defineProperty","get","set","newValue","oldValue","call","enumerable","configurable","Proxy","target","p","length","includes","_default","exports","default"],"sources":["../../src/decorators/reactive.ts"],"sourcesContent":["type Primitive = string | number | boolean | symbol | bigint | null | undefined;\ntype IsReadonly<This, Property extends keyof This> =\n (<F>() => F extends { [P in Property]: This[Property] } ? 1 : 2) extends\n (<F>() => F extends { -readonly [P in Property]: This[Property] } ? 1 : 2)\n ? false\n : true;\ntype Callback<This> = (this: This, field: string | symbol, newValue: unknown) => void;\ntype ReturnType<\n This,\n Property extends keyof This = keyof This,\n> = IsReadonly<This, Property> extends true\n ? (_: undefined, ctx: ClassFieldDecoratorContext<This, This[Property]>) => void\n : This[Property] extends Primitive\n ? (_: undefined, ctx: ClassFieldDecoratorContext<This, This[Property]>) => void\n : never;\n\nconst isPrimitiveValue = (value: unknown) => value !== Object(value);\n\nfunction reactive<\n This,\n Property extends keyof This,\n Value = This[Property],\n>(cb: Value extends Primitive ? Callback<This> : never): ReturnType<This>;\nfunction reactive<\n This,\n Property extends keyof This,\n Value = This[Property],\n>(watchedFields: Value extends Primitive ? never : Array<keyof Value>, cb: Callback<This>): ReturnType<This>;\n\nfunction reactive<\n This,\n Property extends keyof This,\n>(watchedFieldsOrCb: Array<keyof This[Property]> | Callback<This>, cb?: Callback<This>) {\n return function (_: undefined, ctx: ClassFieldDecoratorContext<This, This[Property]>) {\n const { addInitializer, name } = ctx;\n\n addInitializer(function (this: This) {\n const thisRoot = this;\n\n const isPrimitive = isPrimitiveValue(this[name as Property]);\n\n const callback = typeof watchedFieldsOrCb === 'function' ? watchedFieldsOrCb : cb!;\n const fields = Array.isArray(watchedFieldsOrCb) ? watchedFieldsOrCb : null;\n\n if (isPrimitive) {\n let value = this[name as Property];\n\n Object.defineProperty(this, name, {\n get() {\n return value;\n },\n set(newValue) {\n const oldValue = value;\n\n value = newValue;\n\n if (oldValue !== newValue) {\n callback.call(thisRoot, name, newValue);\n }\n },\n enumerable: true,\n configurable: true,\n });\n } else {\n // @ts-ignore\n this[name] = new Proxy(this[name], {\n set(target, p, newValue) {\n target[p] = newValue;\n\n if (fields?.length === 0 || fields?.includes(p as keyof This[Property])) {\n callback.call(thisRoot, p, newValue);\n }\n\n return true;\n },\n });\n }\n });\n };\n}\n\nexport default reactive;\n"],"mappings":";;;;;;AAgBA,MAAMA,gBAAgB,GAAIC,KAAc,IAAKA,KAAK,KAAKC,MAAM,CAACD,KAAK,CAAC;AAapE,SAASE,QAAQA,CAGfC,iBAA+D,EAAEC,EAAmB,EAAE;EACtF,OAAO,UAAUC,CAAY,EAAEC,GAAqD,EAAE;IACpF,MAAM;MAAEC,cAAc;MAAEC;IAAK,CAAC,GAAGF,GAAG;IAEpCC,cAAc,CAAC,YAAsB;MACnC,MAAME,QAAQ,GAAG,IAAI;MAErB,MAAMC,WAAW,GAAGX,gBAAgB,CAAC,IAAI,CAACS,IAAI,CAAa,CAAC;MAE5D,MAAMG,QAAQ,GAAG,OAAOR,iBAAiB,KAAK,UAAU,GAAGA,iBAAiB,GAAGC,EAAG;MAClF,MAAMQ,MAAM,GAAGC,KAAK,CAACC,OAAO,CAACX,iBAAiB,CAAC,GAAGA,iBAAiB,GAAG,IAAI;MAE1E,IAAIO,WAAW,EAAE;QACf,IAAIV,KAAK,GAAG,IAAI,CAACQ,IAAI,CAAa;QAElCP,MAAM,CAACc,cAAc,CAAC,IAAI,EAAEP,IAAI,EAAE;UAChCQ,GAAGA,CAAA,EAAG;YACJ,OAAOhB,KAAK;UACd,CAAC;UACDiB,GAAGA,CAACC,QAAQ,EAAE;YACZ,MAAMC,QAAQ,GAAGnB,KAAK;YAEtBA,KAAK,GAAGkB,QAAQ;YAEhB,IAAIC,QAAQ,KAAKD,QAAQ,EAAE;cACzBP,QAAQ,CAACS,IAAI,CAACX,QAAQ,EAAED,IAAI,EAAEU,QAAQ,CAAC;YACzC;UACF,CAAC;UACDG,UAAU,EAAE,IAAI;UAChBC,YAAY,EAAE;QAChB,CAAC,CAAC;MACJ,CAAC,MAAM;QACL;QACA,IAAI,CAACd,IAAI,CAAC,GAAG,IAAIe,KAAK,CAAC,IAAI,CAACf,IAAI,CAAC,EAAE;UACjCS,GAAGA,CAACO,MAAM,EAAEC,CAAC,EAAEP,QAAQ,EAAE;YACvBM,MAAM,CAACC,CAAC,CAAC,GAAGP,QAAQ;YAEpB,IAAIN,MAAM,EAAEc,MAAM,KAAK,CAAC,IAAId,MAAM,EAAEe,QAAQ,CAACF,CAAyB,CAAC,EAAE;cACvEd,QAAQ,CAACS,IAAI,CAACX,QAAQ,EAAEgB,CAAC,EAAEP,QAAQ,CAAC;YACtC;YAEA,OAAO,IAAI;UACb;QACF,CAAC,CAAC;MACJ;IACF,CAAC,CAAC;EACJ,CAAC;AACH;AAAC,IAAAU,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEc5B,QAAQ","ignoreList":[]}
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
|
|
2
|
-
return value !== Object(value);
|
|
3
|
-
};
|
|
1
|
+
const isPrimitiveValue = value => value !== Object(value);
|
|
4
2
|
function reactive(watchedFieldsOrCb, cb) {
|
|
5
3
|
return function (_, ctx) {
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
const {
|
|
5
|
+
addInitializer,
|
|
6
|
+
name
|
|
7
|
+
} = ctx;
|
|
8
8
|
addInitializer(function () {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
const thisRoot = this;
|
|
10
|
+
const isPrimitive = isPrimitiveValue(this[name]);
|
|
11
|
+
const callback = typeof watchedFieldsOrCb === 'function' ? watchedFieldsOrCb : cb;
|
|
12
|
+
const fields = Array.isArray(watchedFieldsOrCb) ? watchedFieldsOrCb : null;
|
|
13
13
|
if (isPrimitive) {
|
|
14
|
-
|
|
14
|
+
let value = this[name];
|
|
15
15
|
Object.defineProperty(this, name, {
|
|
16
|
-
get
|
|
16
|
+
get() {
|
|
17
17
|
return value;
|
|
18
18
|
},
|
|
19
|
-
set
|
|
20
|
-
|
|
19
|
+
set(newValue) {
|
|
20
|
+
const oldValue = value;
|
|
21
21
|
value = newValue;
|
|
22
22
|
if (oldValue !== newValue) {
|
|
23
23
|
callback.call(thisRoot, name, newValue);
|
|
@@ -29,9 +29,9 @@ function reactive(watchedFieldsOrCb, cb) {
|
|
|
29
29
|
} else {
|
|
30
30
|
// @ts-ignore
|
|
31
31
|
this[name] = new Proxy(this[name], {
|
|
32
|
-
set
|
|
32
|
+
set(target, p, newValue) {
|
|
33
33
|
target[p] = newValue;
|
|
34
|
-
if (
|
|
34
|
+
if (fields?.length === 0 || fields?.includes(p)) {
|
|
35
35
|
callback.call(thisRoot, p, newValue);
|
|
36
36
|
}
|
|
37
37
|
return true;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reactive.mjs","names":["isPrimitiveValue","value","Object","reactive","watchedFieldsOrCb","cb","_","ctx","addInitializer","name","thisRoot","isPrimitive","callback","fields","Array","isArray","defineProperty","get","set","newValue","oldValue","call","enumerable","configurable","Proxy","target","p","length","includes"],"sources":["../../src/decorators/reactive.ts"],"sourcesContent":["type Primitive = string | number | boolean | symbol | bigint | null | undefined;\ntype IsReadonly<This, Property extends keyof This> =\n (<F>() => F extends { [P in Property]: This[Property] } ? 1 : 2) extends\n (<F>() => F extends { -readonly [P in Property]: This[Property] } ? 1 : 2)\n ? false\n : true;\ntype Callback<This> = (this: This, field: string | symbol, newValue: unknown) => void;\ntype ReturnType<\n This,\n Property extends keyof This = keyof This,\n> = IsReadonly<This, Property> extends true\n ? (_: undefined, ctx: ClassFieldDecoratorContext<This, This[Property]>) => void\n : This[Property] extends Primitive\n ? (_: undefined, ctx: ClassFieldDecoratorContext<This, This[Property]>) => void\n : never;\n\nconst isPrimitiveValue = (value: unknown) => value !== Object(value);\n\nfunction reactive<\n This,\n Property extends keyof This,\n Value = This[Property],\n>(cb: Value extends Primitive ? Callback<This> : never): ReturnType<This>;\nfunction reactive<\n This,\n Property extends keyof This,\n Value = This[Property],\n>(watchedFields: Value extends Primitive ? never : Array<keyof Value>, cb: Callback<This>): ReturnType<This>;\n\nfunction reactive<\n This,\n Property extends keyof This,\n>(watchedFieldsOrCb: Array<keyof This[Property]> | Callback<This>, cb?: Callback<This>) {\n return function (_: undefined, ctx: ClassFieldDecoratorContext<This, This[Property]>) {\n const { addInitializer, name } = ctx;\n\n addInitializer(function (this: This) {\n const thisRoot = this;\n\n const isPrimitive = isPrimitiveValue(this[name as Property]);\n\n const callback = typeof watchedFieldsOrCb === 'function' ? watchedFieldsOrCb : cb!;\n const fields = Array.isArray(watchedFieldsOrCb) ? watchedFieldsOrCb : null;\n\n if (isPrimitive) {\n let value = this[name as Property];\n\n Object.defineProperty(this, name, {\n get() {\n return value;\n },\n set(newValue) {\n const oldValue = value;\n\n value = newValue;\n\n if (oldValue !== newValue) {\n callback.call(thisRoot, name, newValue);\n }\n },\n enumerable: true,\n configurable: true,\n });\n } else {\n // @ts-ignore\n this[name] = new Proxy(this[name], {\n set(target, p, newValue) {\n target[p] = newValue;\n\n if (fields?.length === 0 || fields?.includes(p as keyof This[Property])) {\n callback.call(thisRoot, p, newValue);\n }\n\n return true;\n },\n });\n }\n });\n };\n}\n\nexport default reactive;\n"],"mappings":"AAgBA,
|
|
1
|
+
{"version":3,"file":"reactive.mjs","names":["isPrimitiveValue","value","Object","reactive","watchedFieldsOrCb","cb","_","ctx","addInitializer","name","thisRoot","isPrimitive","callback","fields","Array","isArray","defineProperty","get","set","newValue","oldValue","call","enumerable","configurable","Proxy","target","p","length","includes"],"sources":["../../src/decorators/reactive.ts"],"sourcesContent":["type Primitive = string | number | boolean | symbol | bigint | null | undefined;\ntype IsReadonly<This, Property extends keyof This> =\n (<F>() => F extends { [P in Property]: This[Property] } ? 1 : 2) extends\n (<F>() => F extends { -readonly [P in Property]: This[Property] } ? 1 : 2)\n ? false\n : true;\ntype Callback<This> = (this: This, field: string | symbol, newValue: unknown) => void;\ntype ReturnType<\n This,\n Property extends keyof This = keyof This,\n> = IsReadonly<This, Property> extends true\n ? (_: undefined, ctx: ClassFieldDecoratorContext<This, This[Property]>) => void\n : This[Property] extends Primitive\n ? (_: undefined, ctx: ClassFieldDecoratorContext<This, This[Property]>) => void\n : never;\n\nconst isPrimitiveValue = (value: unknown) => value !== Object(value);\n\nfunction reactive<\n This,\n Property extends keyof This,\n Value = This[Property],\n>(cb: Value extends Primitive ? Callback<This> : never): ReturnType<This>;\nfunction reactive<\n This,\n Property extends keyof This,\n Value = This[Property],\n>(watchedFields: Value extends Primitive ? never : Array<keyof Value>, cb: Callback<This>): ReturnType<This>;\n\nfunction reactive<\n This,\n Property extends keyof This,\n>(watchedFieldsOrCb: Array<keyof This[Property]> | Callback<This>, cb?: Callback<This>) {\n return function (_: undefined, ctx: ClassFieldDecoratorContext<This, This[Property]>) {\n const { addInitializer, name } = ctx;\n\n addInitializer(function (this: This) {\n const thisRoot = this;\n\n const isPrimitive = isPrimitiveValue(this[name as Property]);\n\n const callback = typeof watchedFieldsOrCb === 'function' ? watchedFieldsOrCb : cb!;\n const fields = Array.isArray(watchedFieldsOrCb) ? watchedFieldsOrCb : null;\n\n if (isPrimitive) {\n let value = this[name as Property];\n\n Object.defineProperty(this, name, {\n get() {\n return value;\n },\n set(newValue) {\n const oldValue = value;\n\n value = newValue;\n\n if (oldValue !== newValue) {\n callback.call(thisRoot, name, newValue);\n }\n },\n enumerable: true,\n configurable: true,\n });\n } else {\n // @ts-ignore\n this[name] = new Proxy(this[name], {\n set(target, p, newValue) {\n target[p] = newValue;\n\n if (fields?.length === 0 || fields?.includes(p as keyof This[Property])) {\n callback.call(thisRoot, p, newValue);\n }\n\n return true;\n },\n });\n }\n });\n };\n}\n\nexport default reactive;\n"],"mappings":"AAgBA,MAAMA,gBAAgB,GAAIC,KAAc,IAAKA,KAAK,KAAKC,MAAM,CAACD,KAAK,CAAC;AAapE,SAASE,QAAQA,CAGfC,iBAA+D,EAAEC,EAAmB,EAAE;EACtF,OAAO,UAAUC,CAAY,EAAEC,GAAqD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,CAAC;YACtC;YAEA,OAAO,IAAI;UACb;QACF,CAAC,CAAC;MACJ;IACF,CAAC,CAAC;EACJ,CAAC;AACH;AAEA,eAAehB,QAAQ","ignoreList":[]}
|
|
@@ -1,25 +1,16 @@
|
|
|
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
|
-
exports
|
|
8
|
-
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
9
|
-
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
10
|
-
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
11
|
-
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
7
|
+
exports.default = void 0;
|
|
12
8
|
var _react = _interopRequireDefault(require("react"));
|
|
13
9
|
var _symbols = require("../core-types/symbols");
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
var CHILDREN_SELF = Symbol('CHILDREN_SELF');
|
|
17
|
-
var GETTER_REG = /^get[\w]+Props$/;
|
|
10
|
+
const CHILDREN_SELF = Symbol('CHILDREN_SELF');
|
|
11
|
+
const GETTER_REG = /^get[\w]+Props$/;
|
|
18
12
|
function splitPropsAndGetters(props) {
|
|
19
|
-
return Object.entries(props).reduce(
|
|
20
|
-
var _ref2 = (0, _slicedToArray2["default"])(_ref, 2),
|
|
21
|
-
key = _ref2[0],
|
|
22
|
-
value = _ref2[1];
|
|
13
|
+
return Object.entries(props).reduce((acc, [key, value]) => {
|
|
23
14
|
if (GETTER_REG.exec(key) === null) {
|
|
24
15
|
acc.props[key] = value;
|
|
25
16
|
} else {
|
|
@@ -37,82 +28,83 @@ function getterToArray(getter) {
|
|
|
37
28
|
}
|
|
38
29
|
return getter;
|
|
39
30
|
}
|
|
40
|
-
function mergeObjects() {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
31
|
+
function mergeObjects(a = {}, b = {}) {
|
|
32
|
+
const core = {
|
|
33
|
+
...a,
|
|
34
|
+
...b
|
|
35
|
+
};
|
|
36
|
+
return Object.keys(core).reduce((acc, key) => {
|
|
45
37
|
a[key] = getterToArray(a[key]);
|
|
46
38
|
b[key] = getterToArray(b[key]);
|
|
47
|
-
acc[key] = [
|
|
39
|
+
acc[key] = [...a[key], ...b[key]];
|
|
48
40
|
return acc;
|
|
49
41
|
}, {});
|
|
50
42
|
}
|
|
51
43
|
function assignGettersChain(getters) {
|
|
52
|
-
return function () {
|
|
53
|
-
|
|
54
|
-
return getters.reduce(function (acc, getter) {
|
|
44
|
+
return function (props = {}) {
|
|
45
|
+
return getters.reduce((acc, getter) => {
|
|
55
46
|
return getter(acc);
|
|
56
47
|
}, props);
|
|
57
48
|
};
|
|
58
49
|
}
|
|
59
50
|
function createChildren(Context, contexts) {
|
|
60
|
-
|
|
61
|
-
|
|
51
|
+
const Children = function () {
|
|
52
|
+
const children = Children.origin;
|
|
62
53
|
if (typeof children === 'function') {
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
value = _ref5[1];
|
|
54
|
+
const {
|
|
55
|
+
handlers = {},
|
|
56
|
+
getters = {},
|
|
57
|
+
...props
|
|
58
|
+
} = [...contexts, Context].reduce((acc, ctx) => {
|
|
59
|
+
const {
|
|
60
|
+
handlers,
|
|
61
|
+
...propsAndGetters
|
|
62
|
+
} = _react.default.useContext(ctx);
|
|
63
|
+
const {
|
|
64
|
+
props,
|
|
65
|
+
getters
|
|
66
|
+
} = splitPropsAndGetters(propsAndGetters);
|
|
67
|
+
return Object.assign({}, acc, {
|
|
68
|
+
handlers: Object.assign({}, acc.handlers, handlers),
|
|
69
|
+
getters: mergeObjects(acc.getters, getters),
|
|
70
|
+
...props
|
|
71
|
+
});
|
|
72
|
+
}, Children.props);
|
|
73
|
+
const mergedGetters = Object.entries(getters).reduce((acc, [key, value]) => {
|
|
84
74
|
acc[key] = assignGettersChain(value);
|
|
85
75
|
return acc;
|
|
86
76
|
}, {});
|
|
87
|
-
return children(
|
|
77
|
+
return children({
|
|
78
|
+
...props,
|
|
79
|
+
...mergedGetters
|
|
80
|
+
}, handlers);
|
|
88
81
|
} else if (children === undefined) {
|
|
89
82
|
return null;
|
|
90
83
|
}
|
|
91
84
|
return children;
|
|
92
85
|
};
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
return
|
|
86
|
+
Children.origin = null;
|
|
87
|
+
Children.props = {};
|
|
88
|
+
Children[_symbols.CHILDREN_COMPONENT] = true;
|
|
89
|
+
return Children;
|
|
97
90
|
}
|
|
98
91
|
function Enhancement(Context, parent) {
|
|
99
92
|
return {
|
|
100
|
-
init: function
|
|
101
|
-
|
|
102
|
-
return component[_symbols.CONTEXT_COMPONENT];
|
|
103
|
-
}).filter(Boolean);
|
|
93
|
+
init: function () {
|
|
94
|
+
const contexts = (Array.isArray(parent) ? parent : [parent]).map(component => component[_symbols.CONTEXT_COMPONENT]).filter(Boolean);
|
|
104
95
|
this[CHILDREN_SELF] = createChildren(Context, contexts);
|
|
105
96
|
},
|
|
106
|
-
asProps: function
|
|
97
|
+
asProps: function (props) {
|
|
107
98
|
// TODO: learn the reason what it was used for (by lsroman)
|
|
108
99
|
// this[CHILDREN_SELF].origin = _Children ? _Children.origin : children;
|
|
109
100
|
this[CHILDREN_SELF].origin = props.children;
|
|
110
101
|
this[CHILDREN_SELF].props = props;
|
|
111
|
-
return
|
|
102
|
+
return {
|
|
103
|
+
...props,
|
|
112
104
|
Children: this[CHILDREN_SELF]
|
|
113
|
-
}
|
|
105
|
+
};
|
|
114
106
|
}
|
|
115
107
|
};
|
|
116
108
|
}
|
|
117
|
-
var _default = exports
|
|
109
|
+
var _default = exports.default = Enhancement;
|
|
118
110
|
//# sourceMappingURL=Children.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Children.js","names":["_react","_interopRequireDefault","require","_symbols","
|
|
1
|
+
{"version":3,"file":"Children.js","names":["_react","_interopRequireDefault","require","_symbols","CHILDREN_SELF","Symbol","GETTER_REG","splitPropsAndGetters","props","Object","entries","reduce","acc","key","value","exec","getters","getterToArray","getter","Array","isArray","mergeObjects","a","b","core","keys","assignGettersChain","createChildren","Context","contexts","Children","children","origin","handlers","ctx","propsAndGetters","React","useContext","assign","mergedGetters","undefined","CHILDREN_COMPONENT","Enhancement","parent","init","map","component","CONTEXT_COMPONENT","filter","Boolean","asProps","_default","exports","default"],"sources":["../../src/enhancement/Children.tsx"],"sourcesContent":["import React from 'react';\n\nimport { CONTEXT_COMPONENT, CHILDREN_COMPONENT } from '../core-types/symbols';\n\nconst CHILDREN_SELF = Symbol('CHILDREN_SELF');\n\nconst GETTER_REG = /^get[\\w]+Props$/;\n\nfunction splitPropsAndGetters(props: any) {\n return Object.entries(props).reduce(\n (acc: any, [key, value]) => {\n if (GETTER_REG.exec(key) === null) {\n acc.props[key] = value;\n } else {\n acc.getters[key] = value;\n }\n return acc;\n },\n { props: {}, getters: {} },\n );\n}\n\nfunction getterToArray(getter: any) {\n if (!Array.isArray(getter)) {\n return typeof getter === 'function' ? [getter] : [];\n }\n return getter;\n}\n\nfunction mergeObjects(a: any = {}, b: any = {}) {\n const core = { ...a, ...b };\n return Object.keys(core).reduce((acc: any, key) => {\n a[key] = getterToArray(a[key]);\n b[key] = getterToArray(b[key]);\n acc[key] = [...a[key], ...b[key]];\n return acc;\n }, {});\n}\n\nfunction assignGettersChain(getters: Array<Function>) {\n return function (props = {}) {\n return getters.reduce((acc, getter) => {\n return getter(acc);\n }, props);\n };\n}\n\nfunction createChildren(Context: any, contexts: any) {\n const Children: any = function () {\n const children = Children.origin;\n if (typeof children === 'function') {\n const {\n handlers = {},\n getters = {},\n ...props\n } = [...contexts, Context].reduce((acc, ctx) => {\n const { handlers, ...propsAndGetters } = React.useContext(ctx) as any;\n const { props, getters } = splitPropsAndGetters(propsAndGetters);\n return Object.assign({}, acc, {\n handlers: Object.assign({}, acc.handlers, handlers),\n getters: mergeObjects(acc.getters, getters),\n ...props,\n });\n }, Children.props);\n\n const mergedGetters = Object.entries(getters).reduce((acc: any, [key, value]) => {\n acc[key] = assignGettersChain(value as []);\n return acc;\n }, {});\n\n return children({ ...props, ...mergedGetters }, handlers);\n } else if (children === undefined) {\n return null;\n }\n return children;\n };\n Children.origin = null;\n Children.props = {};\n Children[CHILDREN_COMPONENT] = true;\n return Children;\n}\n\nfunction Enhancement(this: any, Context: any, parent: any) {\n return {\n init: function (this: any) {\n const contexts = (Array.isArray(parent) ? parent : [parent])\n .map((component) => component[CONTEXT_COMPONENT])\n .filter(Boolean);\n this[CHILDREN_SELF] = createChildren(Context, contexts);\n },\n asProps: function (this: any, props: any) {\n // TODO: learn the reason what it was used for (by lsroman)\n // this[CHILDREN_SELF].origin = _Children ? _Children.origin : children;\n this[CHILDREN_SELF].origin = props.children;\n this[CHILDREN_SELF].props = props;\n return {\n ...props,\n Children: this[CHILDREN_SELF],\n };\n },\n };\n}\n\nexport default Enhancement;\n"],"mappings":";;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEA,IAAAC,QAAA,GAAAD,OAAA;AAEA,MAAME,aAAa,GAAGC,MAAM,CAAC,eAAe,CAAC;AAE7C,MAAMC,UAAU,GAAG,iBAAiB;AAEpC,SAASC,oBAAoBA,CAACC,KAAU,EAAE;EACxC,OAAOC,MA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