intergalactic 15.82.1-prerelease.1 → 15.82.2-prerelease.0
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 +2 -10
- package/components.json +1 -1
- package/core/index.d.ts +2 -40
- package/core/lib/cjs/index.js +6 -426
- package/core/lib/cjs/index.js.map +1 -1
- package/core/lib/es6/index.js +2 -355
- package/core/lib/es6/index.js.map +1 -1
- package/core/lib/types/index.d.ts +2 -40
- package/d3-chart/component/ChartLegend/BaseLegend.type.d.ts +1 -0
- package/d3-chart/component/ChartLegend/LegendFlex/LegendFlex.type.d.ts +1 -0
- package/d3-chart/lib/cjs/Area.js +11 -11
- package/d3-chart/lib/cjs/Axis.js +14 -14
- package/d3-chart/lib/cjs/Bar.js +10 -10
- package/d3-chart/lib/cjs/Bubble.js +12 -12
- package/d3-chart/lib/cjs/Donut.js +9 -9
- package/d3-chart/lib/cjs/Dots.js +8 -8
- package/d3-chart/lib/cjs/HorizontalBar.js +10 -10
- package/d3-chart/lib/cjs/Hover.js +3 -3
- package/d3-chart/lib/cjs/Line.js +9 -9
- package/d3-chart/lib/cjs/Plot.js +3 -3
- package/d3-chart/lib/cjs/Radar.js +19 -19
- package/d3-chart/lib/cjs/RadialTree.js +11 -11
- package/d3-chart/lib/cjs/ReferenceLine.js +9 -9
- package/d3-chart/lib/cjs/ScatterPlot.js +9 -9
- package/d3-chart/lib/cjs/Tooltip.js +9 -9
- package/d3-chart/lib/cjs/Venn.js +9 -9
- package/d3-chart/lib/cjs/a11y/PlotA11yModule.js +2 -2
- package/d3-chart/lib/cjs/a11y/PlotA11yView.js +2 -2
- package/d3-chart/lib/cjs/component/ChartLegend/LegendFlex/LegendFlex.js +4 -4
- package/d3-chart/lib/cjs/component/ChartLegend/LegendItem/LegendItem.js +17 -17
- package/d3-chart/lib/cjs/component/ChartLegend/LegendTable/LegendTable.js +6 -6
- package/d3-chart/lib/es6/Area.js +11 -11
- package/d3-chart/lib/es6/Axis.js +14 -14
- package/d3-chart/lib/es6/Bar.js +10 -10
- package/d3-chart/lib/es6/Bubble.js +12 -12
- package/d3-chart/lib/es6/Donut.js +9 -9
- package/d3-chart/lib/es6/Dots.js +8 -8
- package/d3-chart/lib/es6/HorizontalBar.js +10 -10
- package/d3-chart/lib/es6/Hover.js +3 -3
- package/d3-chart/lib/es6/Line.js +9 -9
- package/d3-chart/lib/es6/Plot.js +3 -3
- package/d3-chart/lib/es6/Radar.js +19 -19
- package/d3-chart/lib/es6/RadialTree.js +11 -11
- package/d3-chart/lib/es6/ReferenceLine.js +9 -9
- package/d3-chart/lib/es6/ScatterPlot.js +9 -9
- package/d3-chart/lib/es6/Tooltip.js +9 -9
- package/d3-chart/lib/es6/Venn.js +9 -9
- package/d3-chart/lib/es6/a11y/PlotA11yModule.js +2 -2
- package/d3-chart/lib/es6/a11y/PlotA11yView.js +2 -2
- package/d3-chart/lib/es6/component/ChartLegend/LegendFlex/LegendFlex.js +4 -4
- package/d3-chart/lib/es6/component/ChartLegend/LegendItem/LegendItem.js +17 -17
- package/d3-chart/lib/es6/component/ChartLegend/LegendTable/LegendTable.js +6 -6
- package/d3-chart/lib/types/component/ChartLegend/BaseLegend.type.d.ts +1 -0
- package/d3-chart/lib/types/component/ChartLegend/LegendFlex/LegendFlex.type.d.ts +1 -0
- package/package.json +5 -5
- package/utils/lib/ThemeProvider.js +14 -15
- package/utils/lib/ThemeProvider.js.map +1 -1
- package/utils/lib/ThemeProvider.mjs +12 -13
- package/utils/lib/ThemeProvider.mjs.map +1 -1
- package/utils/lib/addonTextChildren.js +1 -3
- package/utils/lib/addonTextChildren.js.map +1 -1
- package/utils/lib/addonTextChildren.mjs +1 -2
- package/utils/lib/addonTextChildren.mjs.map +1 -1
- package/utils/lib/assignProps.js +1 -1
- package/utils/lib/assignProps.js.map +1 -1
- package/utils/lib/assignProps.mjs +1 -1
- package/utils/lib/assignProps.mjs.map +1 -1
- package/utils/lib/components/invalid-state-pattern/InvalidStatePattern.d.ts +1 -1
- package/utils/lib/components/invalid-state-pattern/InvalidStatePattern.js +7 -7
- package/utils/lib/components/invalid-state-pattern/InvalidStatePattern.js.map +1 -1
- package/utils/lib/components/invalid-state-pattern/InvalidStatePattern.mjs +5 -7
- package/utils/lib/components/invalid-state-pattern/InvalidStatePattern.mjs.map +1 -1
- package/{core/lib/cjs → utils/lib/core}/enhancement/Children.js +2 -2
- package/utils/lib/core/enhancement/Children.js.map +1 -0
- package/{core/lib/es6/enhancement/Children.js → utils/lib/core/enhancement/Children.mjs} +2 -2
- package/utils/lib/core/enhancement/Children.mjs.map +1 -0
- package/{core/lib/cjs → utils/lib/core}/enhancement/Root.js +2 -2
- package/utils/lib/core/enhancement/Root.js.map +1 -0
- package/{core/lib/es6/enhancement/Root.js → utils/lib/core/enhancement/Root.mjs} +3 -5
- package/utils/lib/core/enhancement/Root.mjs.map +1 -0
- package/utils/lib/core/enhancement/bindHandler.js.map +1 -0
- package/{core/lib/es6/enhancement/bindHandler.js → utils/lib/core/enhancement/bindHandler.mjs} +1 -1
- package/utils/lib/core/enhancement/bindHandler.mjs.map +1 -0
- package/utils/lib/core/enhancement/dataName.js.map +1 -0
- package/{core/lib/es6/enhancement/dataName.js → utils/lib/core/enhancement/dataName.mjs} +1 -1
- package/utils/lib/core/enhancement/dataName.mjs.map +1 -0
- package/utils/lib/core/enhancement/enhance.js.map +1 -0
- package/{core/lib/es6/enhancement/enhance.js → utils/lib/core/enhancement/enhance.mjs} +1 -1
- package/utils/lib/core/enhancement/enhance.mjs.map +1 -0
- package/utils/lib/core/enhancement/functionDefaultProps.js.map +1 -0
- package/{core/lib/es6/enhancement/functionDefaultProps.js → utils/lib/core/enhancement/functionDefaultProps.mjs} +1 -1
- package/utils/lib/core/enhancement/functionDefaultProps.mjs.map +1 -0
- package/utils/lib/core/enhancement/hoistProps.js.map +1 -0
- package/{core/lib/es6/enhancement/hoistProps.js → utils/lib/core/enhancement/hoistProps.mjs} +1 -1
- package/utils/lib/core/enhancement/hoistProps.mjs.map +1 -0
- package/{core/lib/cjs → utils/lib/core}/enhancement/i18n.js +1 -1
- package/utils/lib/core/enhancement/i18n.js.map +1 -0
- package/{core/lib/es6/enhancement/i18n.js → utils/lib/core/enhancement/i18n.mjs} +2 -3
- package/utils/lib/core/enhancement/i18n.mjs.map +1 -0
- package/utils/lib/core/enhancement/inheritedName.js.map +1 -0
- package/{core/lib/es6/enhancement/inheritedName.js → utils/lib/core/enhancement/inheritedName.mjs} +1 -1
- package/utils/lib/core/enhancement/inheritedName.mjs.map +1 -0
- package/{core/lib/cjs → utils/lib/core}/enhancement/staticChildren.js +3 -9
- package/utils/lib/core/enhancement/staticChildren.js.map +1 -0
- package/{core/lib/es6/enhancement/staticChildren.js → utils/lib/core/enhancement/staticChildren.mjs} +4 -7
- package/utils/lib/core/enhancement/staticChildren.mjs.map +1 -0
- package/utils/lib/core/enhancement/style.js.map +1 -0
- package/{core/lib/es6/enhancement/style.js → utils/lib/core/enhancement/style.mjs} +3 -4
- package/utils/lib/core/enhancement/style.mjs.map +1 -0
- package/{core/lib/cjs → utils/lib/core}/enhancement/uncontrolledProps.js +2 -6
- package/utils/lib/core/enhancement/uncontrolledProps.js.map +1 -0
- package/{core/lib/es6/enhancement/uncontrolledProps.js → utils/lib/core/enhancement/uncontrolledProps.mjs} +3 -5
- package/utils/lib/core/enhancement/uncontrolledProps.mjs.map +1 -0
- package/utils/lib/core/index.d.ts +35 -0
- package/utils/lib/core/index.js +457 -0
- package/utils/lib/core/index.js.map +1 -0
- package/utils/lib/core/index.mjs +348 -0
- package/utils/lib/core/index.mjs.map +1 -0
- package/utils/lib/core/register.js.map +1 -0
- package/{core/lib/es6/register.js → utils/lib/core/register.mjs} +1 -1
- package/utils/lib/core/register.mjs.map +1 -0
- package/{core/lib/types → utils/lib/core}/styled/index.d.ts +2 -1
- package/utils/lib/core/styled/index.js.map +1 -0
- package/{core/lib/es6/styled/index.js → utils/lib/core/styled/index.mjs} +2 -2
- package/utils/lib/core/styled/index.mjs.map +1 -0
- package/utils/lib/core/styled/sstyled.js.map +1 -0
- package/{core/lib/es6/styled/sstyled.js → utils/lib/core/styled/sstyled.mjs} +1 -1
- package/utils/lib/core/styled/sstyled.mjs.map +1 -0
- package/{core → utils/lib/core/types}/Component.d.ts +14 -2
- package/{core/lib/cjs → utils/lib/core/types}/Component.js +1 -0
- package/utils/lib/core/types/Component.js.map +1 -0
- package/{core/lib/es6/Component.js → utils/lib/core/types/Component.mjs} +5 -1
- package/utils/lib/core/types/Component.mjs.map +1 -0
- package/utils/lib/core/types/UnknownProperties.d.ts +3 -0
- package/utils/lib/core/types/UnknownProperties.js +2 -0
- package/utils/lib/core/types/UnknownProperties.js.map +1 -0
- package/utils/lib/core/types/UnknownProperties.mjs +2 -0
- package/utils/lib/core/types/UnknownProperties.mjs.map +1 -0
- package/utils/lib/core/types/index.d.ts +3 -0
- package/utils/lib/core/types/index.js +28 -0
- package/utils/lib/core/types/index.js.map +1 -0
- package/utils/lib/core/types/index.mjs +4 -0
- package/utils/lib/core/types/index.mjs.map +1 -0
- package/utils/lib/core/types/reshadow.d.js.map +1 -0
- package/utils/lib/core/types/reshadow.d.mjs +2 -0
- package/utils/lib/core/types/reshadow.d.mjs.map +1 -0
- package/utils/lib/core/types/symbols.d.ts +7 -0
- package/utils/lib/core/types/symbols.js +21 -0
- package/utils/lib/core/types/symbols.js.map +1 -0
- package/utils/lib/core/types/symbols.mjs +8 -0
- package/utils/lib/core/types/symbols.mjs.map +1 -0
- package/utils/lib/enhances/WithAutoFocus.d.ts +1 -1
- package/utils/lib/enhances/WithAutoFocus.js.map +1 -1
- package/utils/lib/enhances/WithAutoFocus.mjs.map +1 -1
- package/utils/lib/enhances/WithCSS.d.ts +1 -1
- package/utils/lib/enhances/WithCSS.js.map +1 -1
- package/utils/lib/enhances/WithCSS.mjs.map +1 -1
- package/utils/lib/enhances/WithI18n.d.ts +1 -1
- package/utils/lib/enhances/WithI18n.js.map +1 -1
- package/utils/lib/enhances/WithI18n.mjs.map +1 -1
- package/utils/lib/enhances/WithKeyboardFocus.d.ts +1 -1
- package/utils/lib/enhances/WithKeyboardFocus.js.map +1 -1
- package/utils/lib/enhances/WithKeyboardFocus.mjs.map +1 -1
- package/utils/lib/enhances/animatedSizeEnhance.d.ts +1 -1
- package/utils/lib/enhances/animatedSizeEnhance.js.map +1 -1
- package/utils/lib/enhances/animatedSizeEnhance.mjs.map +1 -1
- package/utils/lib/enhances/autoFocusEnhance.d.ts +1 -1
- package/utils/lib/enhances/autoFocusEnhance.js.map +1 -1
- package/utils/lib/enhances/autoFocusEnhance.mjs.map +1 -1
- package/utils/lib/enhances/i18nEnhance.d.ts +1 -1
- package/utils/lib/enhances/i18nEnhance.js.map +1 -1
- package/utils/lib/enhances/i18nEnhance.mjs.map +1 -1
- package/utils/lib/enhances/keyboardFocusEnhance.d.ts +1 -1
- package/utils/lib/enhances/keyboardFocusEnhance.js.map +1 -1
- package/utils/lib/enhances/keyboardFocusEnhance.mjs.map +1 -1
- package/utils/lib/findComponent.js +1 -3
- package/utils/lib/findComponent.js.map +1 -1
- package/utils/lib/findComponent.mjs +1 -2
- package/utils/lib/findComponent.mjs.map +1 -1
- package/utils/lib/getOriginChildren.js +1 -3
- package/utils/lib/getOriginChildren.js.map +1 -1
- package/utils/lib/getOriginChildren.mjs +1 -2
- package/utils/lib/getOriginChildren.mjs.map +1 -1
- package/utils/lib/if.d.ts +1 -1
- package/utils/lib/if.js.map +1 -1
- package/utils/lib/if.mjs.map +1 -1
- package/utils/lib/reshadow.d.ts +4 -0
- package/utils/lib/uniqueID.d.ts +1 -1
- package/utils/lib/uniqueID.js +1 -3
- package/utils/lib/uniqueID.js.map +1 -1
- package/utils/lib/uniqueID.mjs +1 -2
- package/utils/lib/uniqueID.mjs.map +1 -1
- package/core/lib/cjs/Component.js.map +0 -1
- package/core/lib/cjs/enhancement/Children.js.map +0 -1
- package/core/lib/cjs/enhancement/Root.js.map +0 -1
- package/core/lib/cjs/enhancement/bindHandler.js.map +0 -1
- package/core/lib/cjs/enhancement/dataName.js.map +0 -1
- package/core/lib/cjs/enhancement/enhance.js.map +0 -1
- package/core/lib/cjs/enhancement/functionDefaultProps.js.map +0 -1
- package/core/lib/cjs/enhancement/hoistProps.js.map +0 -1
- package/core/lib/cjs/enhancement/i18n.js.map +0 -1
- package/core/lib/cjs/enhancement/inheritedName.js.map +0 -1
- package/core/lib/cjs/enhancement/staticChildren.js.map +0 -1
- package/core/lib/cjs/enhancement/style.js.map +0 -1
- package/core/lib/cjs/enhancement/uncontrolledProps.js.map +0 -1
- package/core/lib/cjs/register.js.map +0 -1
- package/core/lib/cjs/reshadow.d.js.map +0 -1
- package/core/lib/cjs/styled/index.js.map +0 -1
- package/core/lib/cjs/styled/sstyled.js.map +0 -1
- package/core/lib/es6/Component.js.map +0 -1
- package/core/lib/es6/enhancement/Children.js.map +0 -1
- package/core/lib/es6/enhancement/Root.js.map +0 -1
- package/core/lib/es6/enhancement/bindHandler.js.map +0 -1
- package/core/lib/es6/enhancement/dataName.js.map +0 -1
- package/core/lib/es6/enhancement/enhance.js.map +0 -1
- package/core/lib/es6/enhancement/functionDefaultProps.js.map +0 -1
- package/core/lib/es6/enhancement/hoistProps.js.map +0 -1
- package/core/lib/es6/enhancement/i18n.js.map +0 -1
- package/core/lib/es6/enhancement/inheritedName.js.map +0 -1
- package/core/lib/es6/enhancement/staticChildren.js.map +0 -1
- package/core/lib/es6/enhancement/style.js.map +0 -1
- package/core/lib/es6/enhancement/uncontrolledProps.js.map +0 -1
- package/core/lib/es6/register.js.map +0 -1
- package/core/lib/es6/reshadow.d.js +0 -2
- package/core/lib/es6/reshadow.d.js.map +0 -1
- package/core/lib/es6/styled/index.js.map +0 -1
- package/core/lib/es6/styled/sstyled.js.map +0 -1
- package/core/lib/types/Component.d.ts +0 -152
- package/core/lib/types/enhancement/Children.d.ts +0 -6
- package/core/lib/types/enhancement/Root.d.ts +0 -6
- package/core/lib/types/enhancement/bindHandler.d.ts +0 -5
- package/core/lib/types/enhancement/dataName.d.ts +0 -4
- package/core/lib/types/enhancement/enhance.d.ts +0 -5
- package/core/lib/types/enhancement/functionDefaultProps.d.ts +0 -8
- package/core/lib/types/enhancement/hoistProps.d.ts +0 -10
- package/core/lib/types/enhancement/i18n.d.ts +0 -4
- package/core/lib/types/enhancement/inheritedName.d.ts +0 -8
- package/core/lib/types/enhancement/staticChildren.d.ts +0 -13
- package/core/lib/types/enhancement/style.d.ts +0 -9
- package/core/lib/types/enhancement/uncontrolledProps.d.ts +0 -7
- package/core/register.d.ts +0 -8
- package/core/styled/index.d.ts +0 -14
- package/core/styled/sstyled.d.ts +0 -17
- /package/{core → utils/lib/core}/enhancement/Children.d.ts +0 -0
- /package/{core → utils/lib/core}/enhancement/Root.d.ts +0 -0
- /package/{core → utils/lib/core}/enhancement/bindHandler.d.ts +0 -0
- /package/{core/lib/cjs → utils/lib/core}/enhancement/bindHandler.js +0 -0
- /package/{core → utils/lib/core}/enhancement/dataName.d.ts +0 -0
- /package/{core/lib/cjs → utils/lib/core}/enhancement/dataName.js +0 -0
- /package/{core → utils/lib/core}/enhancement/enhance.d.ts +0 -0
- /package/{core/lib/cjs → utils/lib/core}/enhancement/enhance.js +0 -0
- /package/{core → utils/lib/core}/enhancement/functionDefaultProps.d.ts +0 -0
- /package/{core/lib/cjs → utils/lib/core}/enhancement/functionDefaultProps.js +0 -0
- /package/{core → utils/lib/core}/enhancement/hoistProps.d.ts +0 -0
- /package/{core/lib/cjs → utils/lib/core}/enhancement/hoistProps.js +0 -0
- /package/{core → utils/lib/core}/enhancement/i18n.d.ts +0 -0
- /package/{core → utils/lib/core}/enhancement/inheritedName.d.ts +0 -0
- /package/{core/lib/cjs → utils/lib/core}/enhancement/inheritedName.js +0 -0
- /package/{core → utils/lib/core}/enhancement/staticChildren.d.ts +0 -0
- /package/{core → utils/lib/core}/enhancement/style.d.ts +0 -0
- /package/{core/lib/cjs → utils/lib/core}/enhancement/style.js +0 -0
- /package/{core → utils/lib/core}/enhancement/uncontrolledProps.d.ts +0 -0
- /package/{core/lib/types → utils/lib/core}/register.d.ts +0 -0
- /package/{core/lib/cjs → utils/lib/core}/register.js +0 -0
- /package/{core/lib/cjs → utils/lib/core}/styled/index.js +0 -0
- /package/{core/lib/types → utils/lib/core}/styled/sstyled.d.ts +0 -0
- /package/{core/lib/cjs → utils/lib/core}/styled/sstyled.js +0 -0
- /package/{core/lib/cjs → utils/lib/core/types}/reshadow.d.js +0 -0
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"autoFocusEnhance.mjs","names":["React","useForkRef","notUsingNativeAutoFocus","autoFocus","autoFocusEnhance","props","ref","other","_objectWithoutProperties","_excluded","nodeRef","createRef","useEffect","inputNode","current","focus","timer","setTimeout","clearTimeout","_objectSpread"],"sources":["../../src/enhances/autoFocusEnhance.tsx"],"sourcesContent":["import React from 'react';\nimport { useForkRef } from '../ref';\nimport { UnknownProperties
|
1
|
+
{"version":3,"file":"autoFocusEnhance.mjs","names":["React","useForkRef","notUsingNativeAutoFocus","autoFocus","autoFocusEnhance","props","ref","other","_objectWithoutProperties","_excluded","nodeRef","createRef","useEffect","inputNode","current","focus","timer","setTimeout","clearTimeout","_objectSpread"],"sources":["../../src/enhances/autoFocusEnhance.tsx"],"sourcesContent":["import React from 'react';\nimport { useForkRef } from '../ref';\nimport { UnknownProperties } from '../core';\n\nfunction notUsingNativeAutoFocus(autoFocus: any) {\n return typeof autoFocus === 'boolean' || typeof autoFocus === 'number';\n}\n\n/** @deprecated */\nexport interface IWithAutoFocusEnhanceProps extends WithAutoFocusEnhanceProps, UnknownProperties {}\nexport type WithAutoFocusEnhanceProps = {\n /** Native autofocus, but with support for working inside modals, you can also transmit the number of ms before focus is triggered */\n autoFocus?: Boolean | Number;\n};\n\nfunction autoFocusEnhance() {\n return (props: any) => {\n const { autoFocus, ref, ...other } = props;\n if (!notUsingNativeAutoFocus(autoFocus)) {\n return props;\n }\n const nodeRef = React.createRef<HTMLElement>();\n React.useEffect(() => {\n if (autoFocus === false) return;\n const { current: inputNode } = nodeRef;\n if (!inputNode || !inputNode.focus) return;\n const timer = setTimeout(() => inputNode?.focus(), (autoFocus as number) || 0);\n return () => {\n clearTimeout(timer);\n };\n }, [autoFocus]);\n return {\n ref: useForkRef(ref, nodeRef),\n ...other,\n };\n };\n}\n\nexport default autoFocusEnhance;\n"],"mappings":";;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,UAAU,QAAQ,YAAQ;AAGnC,SAASC,uBAAuBA,CAACC,SAAc,EAAE;EAC/C,OAAO,OAAOA,SAAS,KAAK,SAAS,IAAI,OAAOA,SAAS,KAAK,QAAQ;AACxE;;AAEA;;AAOA,SAASC,gBAAgBA,CAAA,EAAG;EAC1B,OAAO,UAACC,KAAU,EAAK;IACrB,IAAQF,SAAS,GAAoBE,KAAK,CAAlCF,SAAS;MAAEG,GAAG,GAAeD,KAAK,CAAvBC,GAAG;MAAKC,KAAK,GAAAC,wBAAA,CAAKH,KAAK,EAAAI,SAAA;IAC1C,IAAI,CAACP,uBAAuB,CAACC,SAAS,CAAC,EAAE;MACvC,OAAOE,KAAK;IACd;IACA,IAAMK,OAAO,gBAAGV,KAAK,CAACW,SAAS,EAAe;IAC9CX,KAAK,CAACY,SAAS,CAAC,YAAM;MACpB,IAAIT,SAAS,KAAK,KAAK,EAAE;MACzB,IAAiBU,SAAS,GAAKH,OAAO,CAA9BI,OAAO;MACf,IAAI,CAACD,SAAS,IAAI,CAACA,SAAS,CAACE,KAAK,EAAE;MACpC,IAAMC,KAAK,GAAGC,UAAU,CAAC;QAAA,OAAMJ,SAAS,aAATA,SAAS,uBAATA,SAAS,CAAEE,KAAK,EAAE;MAAA,GAAGZ,SAAS,IAAe,CAAC,CAAC;MAC9E,OAAO,YAAM;QACXe,YAAY,CAACF,KAAK,CAAC;MACrB,CAAC;IACH,CAAC,EAAE,CAACb,SAAS,CAAC,CAAC;IACf,OAAAgB,aAAA;MACEb,GAAG,EAAEL,UAAU,CAACK,GAAG,EAAEI,OAAO;IAAC,GAC1BH,KAAK;EAEZ,CAAC;AACH;AAEA,eAAeH,gBAAgB"}
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { LocaleKeys, useI18n } from './WithI18n';
|
2
|
-
import { UnknownProperties } from '
|
2
|
+
import { UnknownProperties } from '../core';
|
3
3
|
export declare function interpolate(template: string, variables?: {}): string;
|
4
4
|
/** @deprecated */
|
5
5
|
export interface IWithI18nEnhanceProps extends WithI18nEnhanceProps, UnknownProperties {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"i18nEnhance.js","names":["_react","_interopRequireDefault","require","_WithI18n","interpolationRegex","escapeHtml","html","String","split","map","char","join","interpolate","template","variables","arguments","length","undefined","replace","_","key","useAsyncI18nMessages","primaryContainer","locale","fallbackContainer","_store$locale","container","React","useMemo","_loop","_locale","_asyncToGenerator2","_regeneratorRuntime2","mark","_callee","_yield$Promise$all","_yield$Promise$all2","primary","fallback","wrap","_callee$","_context","prev","next","Promise","all","sent","_slicedToArray2","abrupt","_objectSpread3","stop","_primaryContainer$_lo","_fallbackContainer$_l","initStore","store","_typeof2","_React$useState","useState","_React$useState2","setStore","lastLoadedLocaleRef","useRef","current","fallbackMessages","Object","values","loadingLocaleRef","useEffect","asyncMessages","then","module","messages","_defineProperty2","console","error","exports","_default","props","i18n","getI18nText","useI18n"],"sources":["../../src/enhances/i18nEnhance.tsx"],"sourcesContent":["import React from 'react';\nimport { LocaleKeys, useI18n } from './WithI18n';\nimport { UnknownProperties } from '
|
1
|
+
{"version":3,"file":"i18nEnhance.js","names":["_react","_interopRequireDefault","require","_WithI18n","interpolationRegex","escapeHtml","html","String","split","map","char","join","interpolate","template","variables","arguments","length","undefined","replace","_","key","useAsyncI18nMessages","primaryContainer","locale","fallbackContainer","_store$locale","container","React","useMemo","_loop","_locale","_asyncToGenerator2","_regeneratorRuntime2","mark","_callee","_yield$Promise$all","_yield$Promise$all2","primary","fallback","wrap","_callee$","_context","prev","next","Promise","all","sent","_slicedToArray2","abrupt","_objectSpread3","stop","_primaryContainer$_lo","_fallbackContainer$_l","initStore","store","_typeof2","_React$useState","useState","_React$useState2","setStore","lastLoadedLocaleRef","useRef","current","fallbackMessages","Object","values","loadingLocaleRef","useEffect","asyncMessages","then","module","messages","_defineProperty2","console","error","exports","_default","props","i18n","getI18nText","useI18n"],"sources":["../../src/enhances/i18nEnhance.tsx"],"sourcesContent":["import React from 'react';\nimport { LocaleKeys, useI18n } from './WithI18n';\nimport { UnknownProperties } from '../core';\n\nconst interpolationRegex = /{(.*?)}/g;\n\nconst escapeHtml = (html: string) =>\n String(html)\n .split('')\n .map((char) => {\n switch (char) {\n case '<':\n return '<';\n case '>':\n return '>';\n case '&':\n return '&';\n case '\"':\n return '"';\n case '`':\n return '`';\n }\n return char;\n })\n .join('');\n\nexport function interpolate(template: string, variables: {} = {}) {\n return template.replace(interpolationRegex, (_, key) => {\n if ((variables as any)[key] !== undefined) {\n return escapeHtml((variables as any)[key]);\n }\n return _;\n });\n}\n\n/** @deprecated */\nexport interface IWithI18nEnhanceProps extends WithI18nEnhanceProps, UnknownProperties {}\nexport type WithI18nEnhanceProps = {\n /* Function for getting the required field from the translation dictionary */\n getI18nText?: (key?: string, variables?: {}) => any;\n /* Object with translations */\n i18n?: {\n [locale: string]: {\n [key: string]: string;\n };\n };\n /* Locale for translations */\n locale?: LocaleKeys;\n};\n\ntype Messages = { [messageId: string]: string };\ntype MessagesContainer = { [locale: string]: Messages | (() => Promise<Messages>) };\ntype MessagesStore = { [locale: string]: Messages };\nexport const useAsyncI18nMessages = (\n primaryContainer: MessagesContainer,\n locale: string,\n fallbackContainer?: MessagesContainer,\n) => {\n const container = React.useMemo(() => {\n if (!fallbackContainer) return primaryContainer;\n if (!primaryContainer) return fallbackContainer;\n if (primaryContainer === fallbackContainer) return primaryContainer;\n const container: MessagesContainer = {};\n for (const locale in primaryContainer) {\n if (\n typeof primaryContainer[locale] === 'function' ||\n typeof fallbackContainer[locale] === 'function'\n ) {\n container[locale] = async () => {\n const [primary, fallback] = await Promise.all([\n primaryContainer[locale],\n fallbackContainer[locale],\n ]);\n return { ...primary, ...fallback };\n };\n } else {\n container[locale] = {\n ...(primaryContainer[locale] ?? {}),\n ...(fallbackContainer[locale] ?? {}),\n };\n }\n }\n return container;\n }, [primaryContainer, fallbackContainer]);\n const initStore = React.useMemo(() => {\n const store: MessagesStore = {};\n for (const locale in container) {\n if (typeof container[locale] === 'object') {\n store[locale] = container[locale] as Messages;\n }\n }\n return store;\n }, [container]);\n const [store, setStore] = React.useState(initStore);\n const lastLoadedLocaleRef = React.useRef<string | null>(null);\n if (store[locale]) lastLoadedLocaleRef.current = locale;\n const fallbackMessages = React.useMemo(() => Object.values(store)[0], [store]);\n\n const loadingLocaleRef = React.useRef<string | null>(null);\n React.useEffect(() => {\n loadingLocaleRef.current = locale;\n const asyncMessages = container[locale];\n if (typeof asyncMessages === 'function') {\n asyncMessages()\n .then((module) => {\n if (loadingLocaleRef.current !== locale) return;\n let messages = module;\n if ('default' in module && typeof module.default === 'object') messages = module.default;\n setStore((store) => ({\n ...store,\n [locale]: messages,\n }));\n })\n\n .catch(console.error);\n }\n }, [container, locale]);\n\n return store[locale] ?? fallbackMessages;\n};\nexport default (container?: MessagesContainer) => {\n return (props: any): { getI18nText: ReturnType<typeof useI18n> } => {\n const { i18n, locale } = props;\n const getI18nText = useI18n(i18n, locale, container);\n\n return { ...props, getI18nText };\n };\n};\n"],"mappings":";;;;;;;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AAGA,IAAME,kBAAkB,GAAG,UAAU;AAErC,IAAMC,UAAU,GAAG,SAAbA,UAAUA,CAAIC,IAAY;EAAA,OAC9BC,MAAM,CAACD,IAAI,CAAC,CACTE,KAAK,CAAC,EAAE,CAAC,CACTC,GAAG,CAAC,UAACC,KAAI,EAAK;IACb,QAAQA,KAAI;MACV,KAAK,GA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I,IAAAf,QAAA,aAAOe,MAAM,WAAQ,MAAK,QAAQ,EAAEC,QAAQ,GAAGD,MAAM,WAAQ;QACxFX,QAAQ,CAAC,UAACL,KAAK;UAAA,WAAAL,cAAA,iBAAAA,cAAA,iBACVK,KAAK,WAAAkB,gBAAA,iBACPjD,MAAM,EAAGgD,QAAQ;QAAA,CAClB,CAAC;MACL,CAAC,CAAC,SAEI,CAACE,OAAO,CAACC,KAAK,CAAC;IACzB;EACF,CAAC,EAAE,CAAChD,SAAS,EAAEH,MAAM,CAAC,CAAC;EAEvB,QAAAE,aAAA,GAAO6B,KAAK,CAAC/B,MAAM,CAAC,cAAAE,aAAA,cAAAA,aAAA,GAAIsC,gBAAgB;AAC1C,CAAC;AAACY,OAAA,CAAAtD,oBAAA,GAAAA,oBAAA;AAAA,IAAAuD,QAAA,GACa,SAAAA,SAAClD,SAA6B,EAAK;EAChD,OAAO,UAACmD,KAAU,EAAkD;IAClE,IAAQC,IAAI,GAAaD,KAAK,CAAtBC,IAAI;MAAEvD,MAAM,GAAKsD,KAAK,CAAhBtD,MAAM;IACpB,IAAMwD,WAAW,GAAG,IAAAC,iBAAO,EAACF,IAAI,EAAEvD,MAAM,EAAEG,SAAS,CAAC;IAEpD,WAAAuB,cAAA,iBAAAA,cAAA,iBAAY4B,KAAK;MAAEE,WAAW,EAAXA;IAAW;EAChC,CAAC;AACH,CAAC;AAAAJ,OAAA,cAAAC,QAAA"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"i18nEnhance.mjs","names":["React","useI18n","interpolationRegex","escapeHtml","html","String","split","map","char","join","interpolate","template","variables","arguments","length","undefined","replace","_","key","useAsyncI18nMessages","primaryContainer","locale","fallbackContainer","_store$locale","container","useMemo","_loop","_locale","_asyncToGenerator","_regeneratorRuntime","mark","_callee","_yield$Promise$all","_yield$Promise$all2","primary","fallback","wrap","_callee$","_context","prev","next","Promise","all","sent","_slicedToArray","abrupt","_objectSpread","stop","_primaryContainer$_lo","_fallbackContainer$_l","initStore","store","_typeof","_React$useState","useState","_React$useState2","setStore","lastLoadedLocaleRef","useRef","current","fallbackMessages","Object","values","loadingLocaleRef","useEffect","asyncMessages","then","module","messages","_defineProperty","console","error","props","i18n","getI18nText"],"sources":["../../src/enhances/i18nEnhance.tsx"],"sourcesContent":["import React from 'react';\nimport { LocaleKeys, useI18n } from './WithI18n';\nimport { UnknownProperties } from '
|
1
|
+
{"version":3,"file":"i18nEnhance.mjs","names":["React","useI18n","interpolationRegex","escapeHtml","html","String","split","map","char","join","interpolate","template","variables","arguments","length","undefined","replace","_","key","useAsyncI18nMessages","primaryContainer","locale","fallbackContainer","_store$locale","container","useMemo","_loop","_locale","_asyncToGenerator","_regeneratorRuntime","mark","_callee","_yield$Promise$all","_yield$Promise$all2","primary","fallback","wrap","_callee$","_context","prev","next","Promise","all","sent","_slicedToArray","abrupt","_objectSpread","stop","_primaryContainer$_lo","_fallbackContainer$_l","initStore","store","_typeof","_React$useState","useState","_React$useState2","setStore","lastLoadedLocaleRef","useRef","current","fallbackMessages","Object","values","loadingLocaleRef","useEffect","asyncMessages","then","module","messages","_defineProperty","console","error","props","i18n","getI18nText"],"sources":["../../src/enhances/i18nEnhance.tsx"],"sourcesContent":["import React from 'react';\nimport { LocaleKeys, useI18n } from './WithI18n';\nimport { UnknownProperties } from '../core';\n\nconst interpolationRegex = /{(.*?)}/g;\n\nconst escapeHtml = (html: string) =>\n String(html)\n .split('')\n .map((char) => {\n switch (char) {\n case '<':\n return '<';\n case '>':\n return '>';\n case '&':\n return '&';\n case '\"':\n return '"';\n case '`':\n return '`';\n }\n return char;\n })\n .join('');\n\nexport function interpolate(template: string, variables: {} = {}) {\n return template.replace(interpolationRegex, (_, key) => {\n if ((variables as any)[key] !== undefined) {\n return escapeHtml((variables as any)[key]);\n }\n return _;\n });\n}\n\n/** @deprecated */\nexport interface IWithI18nEnhanceProps extends WithI18nEnhanceProps, UnknownProperties {}\nexport type WithI18nEnhanceProps = {\n /* Function for getting the required field from the translation dictionary */\n getI18nText?: (key?: string, variables?: {}) => any;\n /* Object with translations */\n i18n?: {\n [locale: string]: {\n [key: string]: string;\n };\n };\n /* Locale for translations */\n locale?: LocaleKeys;\n};\n\ntype Messages = { [messageId: string]: string };\ntype MessagesContainer = { [locale: string]: Messages | (() => Promise<Messages>) };\ntype MessagesStore = { [locale: string]: Messages };\nexport const useAsyncI18nMessages = (\n primaryContainer: MessagesContainer,\n locale: string,\n fallbackContainer?: MessagesContainer,\n) => {\n const container = React.useMemo(() => {\n if (!fallbackContainer) return primaryContainer;\n if (!primaryContainer) return fallbackContainer;\n if (primaryContainer === fallbackContainer) return primaryContainer;\n const container: MessagesContainer = {};\n for (const locale in primaryContainer) {\n if (\n typeof primaryContainer[locale] === 'function' ||\n typeof fallbackContainer[locale] === 'function'\n ) {\n container[locale] = async () => {\n const [primary, fallback] = await Promise.all([\n primaryContainer[locale],\n fallbackContainer[locale],\n ]);\n return { ...primary, ...fallback };\n };\n } else {\n container[locale] = {\n ...(primaryContainer[locale] ?? {}),\n ...(fallbackContainer[locale] ?? {}),\n };\n }\n }\n return container;\n }, [primaryContainer, fallbackContainer]);\n const initStore = React.useMemo(() => {\n const store: MessagesStore = {};\n for (const locale in container) {\n if (typeof container[locale] === 'object') {\n store[locale] = container[locale] as Messages;\n }\n }\n return store;\n }, [container]);\n const [store, setStore] = React.useState(initStore);\n const lastLoadedLocaleRef = React.useRef<string | null>(null);\n if (store[locale]) lastLoadedLocaleRef.current = locale;\n const fallbackMessages = React.useMemo(() => Object.values(store)[0], [store]);\n\n const loadingLocaleRef = React.useRef<string | null>(null);\n React.useEffect(() => {\n loadingLocaleRef.current = locale;\n const asyncMessages = container[locale];\n if (typeof asyncMessages === 'function') {\n asyncMessages()\n .then((module) => {\n if (loadingLocaleRef.current !== locale) return;\n let messages = module;\n if ('default' in module && typeof module.default === 'object') messages = module.default;\n setStore((store) => ({\n ...store,\n [locale]: messages,\n }));\n })\n\n .catch(console.error);\n }\n }, [container, locale]);\n\n return store[locale] ?? fallbackMessages;\n};\nexport default (container?: MessagesContainer) => {\n return (props: any): { getI18nText: ReturnType<typeof useI18n> } => {\n const { i18n, locale } = props;\n const getI18nText = useI18n(i18n, locale, container);\n\n return { ...props, getI18nText };\n };\n};\n"],"mappings":";;;;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAAqBC,OAAO,QAAQ,gBAAY;AAGhD,IAAMC,kBAAkB,GAAG,UAAU;AAErC,IAAMC,UAAU,GAAG,SAAbA,UAAUA,CAAIC,IAAY;EAAA,OAC9BC,MAAM,CAACD,IAAI,CAAC,CACTE,KAAK,CAAC,EAAE,CAAC,CACTC,GAAG,CAAC,UAACC,KAAI,EAAK;IACb,QAAQA,KAAI;MACV,KAAK,GAAG;QACN,OAAO,MAAM;MACf,KAAK,GAAG;QACN,OAAO,MAAM;MACf,KAAK,GAAG;QACN,OAAO,OAAO;MAChB,KAAK,GAAG;QACN,OAAO,QAAQ;MACjB,KAAK,GAAG;QACN,OAAO,OAAO;IAAC;IAEnB,OAAOA,KAAI;EACb,CAAC,CAAC,CACDC,IAAI,CAAC,EAAE,CAAC;AAAA;AAEb,OAAO,SAASC,WAAWA,CAACC,QAAgB,EAAsB;EAAA,IAApBC,SAAa,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,CAAC,CAAC;EAC9D,OAAOF,QAAQ,CAACK,OAAO,CAACd,kBAAkB,EAAE,UAACe,CAAC,EAAEC,GAAG,EAAK;IACtD,IAAKN,SAAS,CAASM,GAAG,CAAC,KAAKH,SAAS,EAAE;MACzC,OAAOZ,UAAU,CAAES,SAAS,CAASM,GAAG,CAAC,CAAC;IAC5C;IACA,OAAOD,CAAC;EACV,CAAC,CAAC;AACJ;;AAEA;;AAkBA,OAAO,IAAME,oBAAoB,GAAG,SAAvBA,oBAAoBA,CAC/BC,gBAAmC,EACnCC,MAAc,EACdC,iBAAqC,EAClC;EAAA,IAAAC,aAAA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;AACH,CAAC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"keyboardFocusEnhance.js","names":["_react","_interopRequireDefault","require","_assignProps","enforcedKeyboardFocusEnhanceContext","React","createContext","exports","lastFocusSource","focusSourceListeners","useFocusSource","handleMouseDown","useCallback","forEach","listener","setFocusSource","handleKeyDown","focusSourceRef","useRef","source","current","subscribeListeners","document","addEventListener","capture","unsubscribeListeners","removeEventListener","useEffect","needToAddListeners","length","sourceListener","push","needToRemoveListeners","sourceListenerIndex","indexOf","splice","keyboardFocusEnhance","makeFocusable","arguments","undefined","props","_props$tabIndex","disabled","autoFocus","tabIndex","_React$useState","useState","_React$useState2","_slicedToArray2","keyboardFocused","setKeyboardFocused","ref","handleFocus","event","isTrusted","handlerBlur","timer","setTimeout","_ref$current","focus","clearTimeout","enforcedKeyboardFocus","useContext","assignProps","onFocus","onBlur","_default"],"sources":["../../src/enhances/keyboardFocusEnhance.tsx"],"sourcesContent":["import React from 'react';\nimport assignProps from '../assignProps';\nimport { UnknownProperties } from '
|
1
|
+
{"version":3,"file":"keyboardFocusEnhance.js","names":["_react","_interopRequireDefault","require","_assignProps","enforcedKeyboardFocusEnhanceContext","React","createContext","exports","lastFocusSource","focusSourceListeners","useFocusSource","handleMouseDown","useCallback","forEach","listener","setFocusSource","handleKeyDown","focusSourceRef","useRef","source","current","subscribeListeners","document","addEventListener","capture","unsubscribeListeners","removeEventListener","useEffect","needToAddListeners","length","sourceListener","push","needToRemoveListeners","sourceListenerIndex","indexOf","splice","keyboardFocusEnhance","makeFocusable","arguments","undefined","props","_props$tabIndex","disabled","autoFocus","tabIndex","_React$useState","useState","_React$useState2","_slicedToArray2","keyboardFocused","setKeyboardFocused","ref","handleFocus","event","isTrusted","handlerBlur","timer","setTimeout","_ref$current","focus","clearTimeout","enforcedKeyboardFocus","useContext","assignProps","onFocus","onBlur","_default"],"sources":["../../src/enhances/keyboardFocusEnhance.tsx"],"sourcesContent":["import React from 'react';\nimport assignProps from '../assignProps';\nimport { UnknownProperties } from '../core';\n\n/** @deprecated */\nexport interface IKeyboardFocusProps extends KeyboardFocusProps, UnknownProperties {}\nexport type KeyboardFocusProps = {\n /* Property responsible for displaying \"keyboard\" focus */\n keyboardFocused?: boolean;\n /**\n * Makes component to catch browser focus on component mount\n * @default false\n */\n autoFocus?: boolean;\n};\n\nexport const enforcedKeyboardFocusEnhanceContext = React.createContext(false);\n\nlet lastFocusSource: 'mouse' | 'keyboard' | 'none' = 'none';\nconst focusSourceListeners: {\n setFocusSource: (source: 'mouse' | 'keyboard' | 'none') => void;\n subscribeListeners: () => void;\n}[] = [];\nexport const useFocusSource = () => {\n const handleMouseDown = React.useCallback(\n () => focusSourceListeners.forEach((listener) => listener.setFocusSource('mouse')),\n [],\n );\n const handleKeyDown = React.useCallback(\n () => focusSourceListeners.forEach((listener) => listener.setFocusSource('keyboard')),\n [],\n );\n const focusSourceRef = React.useRef<'none' | 'mouse' | 'keyboard'>(lastFocusSource);\n const setFocusSource = React.useCallback((source: 'none' | 'mouse' | 'keyboard') => {\n focusSourceRef.current = source;\n lastFocusSource = source;\n }, []);\n const subscribeListeners = React.useCallback(() => {\n document.addEventListener('mousedown', handleMouseDown, { capture: true });\n document.addEventListener('keydown', handleKeyDown, { capture: true });\n }, []);\n const unsubscribeListeners = React.useCallback(() => {\n document.removeEventListener('mousedown', handleMouseDown, { capture: true });\n document.removeEventListener('keydown', handleKeyDown, { capture: true });\n }, []);\n\n React.useEffect(() => {\n const needToAddListeners = focusSourceListeners.length === 0;\n const sourceListener = { setFocusSource, subscribeListeners };\n focusSourceListeners.push(sourceListener);\n if (needToAddListeners) subscribeListeners();\n const needToRemoveListeners = needToAddListeners;\n\n return () => {\n const sourceListenerIndex = focusSourceListeners.indexOf(sourceListener);\n focusSourceListeners.splice(sourceListenerIndex, 1);\n if (needToRemoveListeners) unsubscribeListeners();\n if (needToRemoveListeners && focusSourceListeners.length > 0) {\n focusSourceListeners[0].subscribeListeners();\n }\n };\n }, []);\n\n return focusSourceRef;\n};\n\nexport type KeyboardFocusEnhanceHook = (props: {\n tabIndex?: number;\n disabled?: boolean;\n autoFocus?: boolean;\n}) => {\n tabIndex: number;\n keyboardFocused: boolean;\n onFocus: (e: React.FocusEvent) => void;\n onBlur: () => void;\n};\n\nconst keyboardFocusEnhance = (makeFocusable = true): KeyboardFocusEnhanceHook => {\n return (props) => {\n const { disabled, autoFocus } = props;\n const tabIndex = props.tabIndex ?? (makeFocusable ? 0 : undefined);\n const [keyboardFocused, setKeyboardFocused] = React.useState(false);\n const focusSourceRef = useFocusSource();\n const ref = React.useRef<HTMLElement>(null);\n\n const handleFocus = React.useCallback((event: React.FocusEvent) => {\n if (event.isTrusted === true) {\n if (focusSourceRef.current !== 'keyboard') return;\n }\n setKeyboardFocused(true);\n }, []);\n const handlerBlur = React.useCallback(() => setKeyboardFocused(false), []);\n React.useEffect(() => {\n if (typeof autoFocus !== 'number' && !autoFocus) return;\n const timer = setTimeout(() => {\n ref.current?.focus();\n setKeyboardFocused(true);\n }, 0);\n return () => {\n clearTimeout(timer);\n };\n }, [autoFocus]);\n React.useEffect(() => {\n if (disabled) {\n setKeyboardFocused(false);\n }\n }, [disabled]);\n\n const enforcedKeyboardFocus = React.useContext(enforcedKeyboardFocusEnhanceContext);\n\n return assignProps(props, {\n tabIndex: disabled ? -1 : tabIndex,\n keyboardFocused: (keyboardFocused || enforcedKeyboardFocus) && !disabled,\n onFocus: handleFocus,\n onBlur: handlerBlur,\n ref,\n });\n };\n};\n\nexport default keyboardFocusEnhance;\n"],"mappings":";;;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAF,sBAAA,CAAAC,OAAA;AAeO,IAAME,mCAAmC,gBAAGC,iBAAK,CAACC,aAAa,CAAC,KAAK,CAAC;AAACC,OAAA,CAAAH,mCAAA,GAAAA,mCAAA;AAE9E,IAAII,eAA8C,GAAG,MAAM;AAC3D,IAAMC,oBAGH,GAAG,E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CAACyD,UAAU,CAAC1D,mCAAmC,CAAC;IAEnF,OAAO,IAAA2D,uBAAW,EAACvB,KAAK,EAAE;MACxBI,QAAQ,EAAEF,QAAQ,GAAG,CAAC,CAAC,GAAGE,QAAQ;MAClCK,eAAe,EAAE,CAACA,eAAe,IAAIY,qBAAqB,KAAK,CAACnB,QAAQ;MACxEsB,OAAO,EAAEZ,WAAW;MACpBa,MAAM,EAAEV,WAAW;MACnBJ,GAAG,EAAHA;IACF,CAAC,CAAC;EACJ,CAAC;AACH,CAAC;AAAC,IAAAe,QAAA,GAEa9B,oBAAoB;AAAA7B,OAAA,cAAA2D,QAAA"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"keyboardFocusEnhance.mjs","names":["React","assignProps","enforcedKeyboardFocusEnhanceContext","createContext","lastFocusSource","focusSourceListeners","useFocusSource","handleMouseDown","useCallback","forEach","listener","setFocusSource","handleKeyDown","focusSourceRef","useRef","source","current","subscribeListeners","document","addEventListener","capture","unsubscribeListeners","removeEventListener","useEffect","needToAddListeners","length","sourceListener","push","needToRemoveListeners","sourceListenerIndex","indexOf","splice","keyboardFocusEnhance","makeFocusable","arguments","undefined","props","_props$tabIndex","disabled","autoFocus","tabIndex","_React$useState","useState","_React$useState2","_slicedToArray","keyboardFocused","setKeyboardFocused","ref","handleFocus","event","isTrusted","handlerBlur","timer","setTimeout","_ref$current","focus","clearTimeout","enforcedKeyboardFocus","useContext","onFocus","onBlur"],"sources":["../../src/enhances/keyboardFocusEnhance.tsx"],"sourcesContent":["import React from 'react';\nimport assignProps from '../assignProps';\nimport { UnknownProperties } from '
|
1
|
+
{"version":3,"file":"keyboardFocusEnhance.mjs","names":["React","assignProps","enforcedKeyboardFocusEnhanceContext","createContext","lastFocusSource","focusSourceListeners","useFocusSource","handleMouseDown","useCallback","forEach","listener","setFocusSource","handleKeyDown","focusSourceRef","useRef","source","current","subscribeListeners","document","addEventListener","capture","unsubscribeListeners","removeEventListener","useEffect","needToAddListeners","length","sourceListener","push","needToRemoveListeners","sourceListenerIndex","indexOf","splice","keyboardFocusEnhance","makeFocusable","arguments","undefined","props","_props$tabIndex","disabled","autoFocus","tabIndex","_React$useState","useState","_React$useState2","_slicedToArray","keyboardFocused","setKeyboardFocused","ref","handleFocus","event","isTrusted","handlerBlur","timer","setTimeout","_ref$current","focus","clearTimeout","enforcedKeyboardFocus","useContext","onFocus","onBlur"],"sources":["../../src/enhances/keyboardFocusEnhance.tsx"],"sourcesContent":["import React from 'react';\nimport assignProps from '../assignProps';\nimport { UnknownProperties } from '../core';\n\n/** @deprecated */\nexport interface IKeyboardFocusProps extends KeyboardFocusProps, UnknownProperties {}\nexport type KeyboardFocusProps = {\n /* Property responsible for displaying \"keyboard\" focus */\n keyboardFocused?: boolean;\n /**\n * Makes component to catch browser focus on component mount\n * @default false\n */\n autoFocus?: boolean;\n};\n\nexport const enforcedKeyboardFocusEnhanceContext = React.createContext(false);\n\nlet lastFocusSource: 'mouse' | 'keyboard' | 'none' = 'none';\nconst focusSourceListeners: {\n setFocusSource: (source: 'mouse' | 'keyboard' | 'none') => void;\n subscribeListeners: () => void;\n}[] = [];\nexport const useFocusSource = () => {\n const handleMouseDown = React.useCallback(\n () => focusSourceListeners.forEach((listener) => listener.setFocusSource('mouse')),\n [],\n );\n const handleKeyDown = React.useCallback(\n () => focusSourceListeners.forEach((listener) => listener.setFocusSource('keyboard')),\n [],\n );\n const focusSourceRef = React.useRef<'none' | 'mouse' | 'keyboard'>(lastFocusSource);\n const setFocusSource = React.useCallback((source: 'none' | 'mouse' | 'keyboard') => {\n focusSourceRef.current = source;\n lastFocusSource = source;\n }, []);\n const subscribeListeners = React.useCallback(() => {\n document.addEventListener('mousedown', handleMouseDown, { capture: true });\n document.addEventListener('keydown', handleKeyDown, { capture: true });\n }, []);\n const unsubscribeListeners = React.useCallback(() => {\n document.removeEventListener('mousedown', handleMouseDown, { capture: true });\n document.removeEventListener('keydown', handleKeyDown, { capture: true });\n }, []);\n\n React.useEffect(() => {\n const needToAddListeners = focusSourceListeners.length === 0;\n const sourceListener = { setFocusSource, subscribeListeners };\n focusSourceListeners.push(sourceListener);\n if (needToAddListeners) subscribeListeners();\n const needToRemoveListeners = needToAddListeners;\n\n return () => {\n const sourceListenerIndex = focusSourceListeners.indexOf(sourceListener);\n focusSourceListeners.splice(sourceListenerIndex, 1);\n if (needToRemoveListeners) unsubscribeListeners();\n if (needToRemoveListeners && focusSourceListeners.length > 0) {\n focusSourceListeners[0].subscribeListeners();\n }\n };\n }, []);\n\n return focusSourceRef;\n};\n\nexport type KeyboardFocusEnhanceHook = (props: {\n tabIndex?: number;\n disabled?: boolean;\n autoFocus?: boolean;\n}) => {\n tabIndex: number;\n keyboardFocused: boolean;\n onFocus: (e: React.FocusEvent) => void;\n onBlur: () => void;\n};\n\nconst keyboardFocusEnhance = (makeFocusable = true): KeyboardFocusEnhanceHook => {\n return (props) => {\n const { disabled, autoFocus } = props;\n const tabIndex = props.tabIndex ?? (makeFocusable ? 0 : undefined);\n const [keyboardFocused, setKeyboardFocused] = React.useState(false);\n const focusSourceRef = useFocusSource();\n const ref = React.useRef<HTMLElement>(null);\n\n const handleFocus = React.useCallback((event: React.FocusEvent) => {\n if (event.isTrusted === true) {\n if (focusSourceRef.current !== 'keyboard') return;\n }\n setKeyboardFocused(true);\n }, []);\n const handlerBlur = React.useCallback(() => setKeyboardFocused(false), []);\n React.useEffect(() => {\n if (typeof autoFocus !== 'number' && !autoFocus) return;\n const timer = setTimeout(() => {\n ref.current?.focus();\n setKeyboardFocused(true);\n }, 0);\n return () => {\n clearTimeout(timer);\n };\n }, [autoFocus]);\n React.useEffect(() => {\n if (disabled) {\n setKeyboardFocused(false);\n }\n }, [disabled]);\n\n const enforcedKeyboardFocus = React.useContext(enforcedKeyboardFocusEnhanceContext);\n\n return assignProps(props, {\n tabIndex: disabled ? -1 : tabIndex,\n keyboardFocused: (keyboardFocused || enforcedKeyboardFocus) && !disabled,\n onFocus: handleFocus,\n onBlur: handlerBlur,\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E,CAACb,SAAS,CAAC,CAAC;IACfvC,KAAK,CAACuB,SAAS,CAAC,YAAM;MACpB,IAAIe,QAAQ,EAAE;QACZQ,kBAAkB,CAAC,KAAK,CAAC;MAC3B;IACF,CAAC,EAAE,CAACR,QAAQ,CAAC,CAAC;IAEd,IAAMmB,qBAAqB,GAAGzD,KAAK,CAAC0D,UAAU,CAACxD,mCAAmC,CAAC;IAEnF,OAAOD,WAAW,CAACmC,KAAK,EAAE;MACxBI,QAAQ,EAAEF,QAAQ,GAAG,CAAC,CAAC,GAAGE,QAAQ;MAClCK,eAAe,EAAE,CAACA,eAAe,IAAIY,qBAAqB,KAAK,CAACnB,QAAQ;MACxEqB,OAAO,EAAEX,WAAW;MACpBY,MAAM,EAAET,WAAW;MACnBJ,GAAG,EAAHA;IACF,CAAC,CAAC;EACJ,CAAC;AACH,CAAC;AAED,eAAef,oBAAoB"}
|
@@ -8,10 +8,8 @@ exports["default"] = void 0;
|
|
8
8
|
exports.findAllComponents = findAllComponents;
|
9
9
|
exports.isAdvanceMode = isAdvanceMode;
|
10
10
|
var _react = _interopRequireDefault(require("react"));
|
11
|
-
var _core = require("
|
11
|
+
var _core = require("./core");
|
12
12
|
var _getOriginChildren = _interopRequireDefault(require("./getOriginChildren"));
|
13
|
-
// @ts-ignore
|
14
|
-
|
15
13
|
function findComponent(Children, names, recursively) {
|
16
14
|
var limit = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 100;
|
17
15
|
var children = Children[_core.CHILDREN_COMPONENT] ? (0, _getOriginChildren["default"])(Children) : Children;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"findComponent.js","names":["_react","_interopRequireDefault","require","_core","_getOriginChildren","findComponent","Children","names","recursively","limit","arguments","length","undefined","children","CHILDREN_COMPONENT","getOriginChildren","React","toArray","find","child","isValidElement","type","Fragment","props","inheritedNames","INHERITED_NAME","displayName","result","name","includes","isAdvanceMode","findAllComponents","findAllAndAdd","forEach","component","push","_default","exports"],"sources":["../src/findComponent.ts"],"sourcesContent":["import React, { ReactElement, ReactNode } from 'react';\
|
1
|
+
{"version":3,"file":"findComponent.js","names":["_react","_interopRequireDefault","require","_core","_getOriginChildren","findComponent","Children","names","recursively","limit","arguments","length","undefined","children","CHILDREN_COMPONENT","getOriginChildren","React","toArray","find","child","isValidElement","type","Fragment","props","inheritedNames","INHERITED_NAME","displayName","result","name","includes","isAdvanceMode","findAllComponents","findAllAndAdd","forEach","component","push","_default","exports"],"sources":["../src/findComponent.ts"],"sourcesContent":["import React, { ReactElement, ReactNode } from 'react';\nimport { CHILDREN_COMPONENT, INHERITED_NAME } from './core';\nimport getOriginChildren from './getOriginChildren';\n\nfunction findComponent(\n Children: any,\n names: string[],\n recursively?: boolean,\n limit = 100,\n): Exclude<ReactNode, boolean | null | undefined> | undefined {\n const children = Children[CHILDREN_COMPONENT] ? getOriginChildren(Children) : Children;\n return React.Children.toArray(children).find((child) => {\n if (React.isValidElement(child)) {\n if (child.type === React.Fragment) {\n return findComponent(child.props.children, names, recursively, limit);\n }\n // @ts-ignore\n const inheritedNames = child.type[INHERITED_NAME] || [child.type.displayName];\n const result = !!inheritedNames.find((name: string) => names.includes(name));\n\n if (!result && child.props.children && recursively && limit > 0) {\n return findComponent(child.props.children, names, recursively, limit - 1);\n }\n\n return result;\n }\n });\n}\n\nexport function isAdvanceMode(Children: any, name: string[], recursively?: boolean) {\n const children = Children[CHILDREN_COMPONENT] ? getOriginChildren(Children) : Children;\n if (!children) return false;\n if (typeof children === 'function') {\n return true;\n }\n return !!findComponent(children, name, recursively);\n}\n\nexport function findAllComponents(Children: any, names: string[]): ReactElement[] {\n const result: ReactElement[] = [];\n\n const findAllAndAdd = (Children: any) => {\n const children = Children[CHILDREN_COMPONENT] ? getOriginChildren(Children) : Children;\n React.Children.toArray(children).forEach((child) => {\n if (React.isValidElement(child)) {\n if (child.type === React.Fragment) {\n findAllAndAdd(child.props.children);\n } else {\n // @ts-ignore\n const inheritedNames = child.type[INHERITED_NAME] || [child.type.displayName];\n const component = !!inheritedNames.find((name: string) => names.includes(name));\n\n if (component) {\n result.push(child);\n }\n\n if (child.props.children) {\n return findAllAndAdd(child.props.children);\n }\n }\n }\n });\n };\n\n findAllAndAdd(Children);\n\n return result;\n}\n\nexport default findComponent;\n"],"mappings":";;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,kBAAA,GAAAH,sBAAA,CAAAC,OAAA;AAEA,SAASG,aAAaA,CACpBC,QAAa,EACbC,KAAe,EACfC,WAAqB,EAEuC;EAAA,IAD5DC,KAAK,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,GAAG;EAEX,IAAMG,QAAQ,GAAGP,QAAQ,CAACQ,wBAAkB,CAAC,GAAG,IAAAC,6BAAiB,EAACT,QAAQ,CAAC,GAAGA,QAAQ;EACtF,OAAOU,iBAAK,CAACV,QAAQ,CAACW,OAAO,CAACJ,QAAQ,CAAC,CAACK,IAAI,CAAC,UAACC,KAAK,EAAK;IACtD,kBAAIH,iBAAK,CAACI,cAAc,CAACD,KAAK,CAAC,EAAE;MAC/B,IAAIA,KAAK,CAACE,IAAI,KAAKL,iBAAK,CAACM,QAAQ,EAAE;QACjC,OAAOjB,aAAa,CAACc,KAAK,CAACI,KAAK,CAACV,QAAQ,EAAEN,KAAK,EAAEC,WAAW,EAAEC,KAAK,CAAC;MACvE;MACA;MACA,IAAMe,cAAc,GAAGL,KAAK,CAACE,IAAI,CAACI,oBAAc,CAAC,IAAI,CAACN,KAAK,CAACE,IAAI,CAACK,WAAW,CAAC;MAC7E,IAAMC,MAAM,GAAG,CAAC,CAACH,cAAc,CAACN,IAAI,CAAC,UAACU,IAAY;QAAA,OAAKrB,KAAK,CAACsB,QAAQ,CAACD,IAAI,CAAC;MAAA,EAAC;MAE5E,IAAI,CAACD,MAAM,IAAIR,KAAK,CAACI,KAAK,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,IAAI,CAACN,KAAK,CAACE,IAAI,CAACK,WAAW,CAAC;UAC7E,IAAMQ,SAAS,GAAG,CAAC,CAACV,cAAc,CAACN,IAAI,CAAC,UAACU,IAAY;YAAA,OAAKrB,KAAK,CAACsB,QAAQ,CAACD,IAAI,CAAC;UAAA,EAAC;UAE/E,IAAIM,SAAS,EAAE;YACbP,MAAM,CAACQ,IAAI,CAAChB,KAAK,CAAC;UACpB;UAEA,IAAIA,KAAK,CAACI,KAAK,CAACV,QAAQ,EAAE;YACxB,OAAOmB,aAAa,CAACb,KAAK,CAACI,KAAK,CAACV,QAAQ,CAAC;UAC5C;QACF;MACF;IACF,CAAC,CAAC;EACJ,CAAC;EAEDmB,aAAa,CAAC1B,QAAQ,CAAC;EAEvB,OAAOqB,MAAM;AACf;AAAC,IAAAS,QAAA,GAEc/B,aAAa;AAAAgC,OAAA,cAAAD,QAAA"}
|
@@ -1,6 +1,5 @@
|
|
1
1
|
import React from 'react';
|
2
|
-
|
3
|
-
import { CHILDREN_COMPONENT, INHERITED_NAME } from 'intergalactic/core';
|
2
|
+
import { CHILDREN_COMPONENT, INHERITED_NAME } from "./core.mjs";
|
4
3
|
import getOriginChildren from "./getOriginChildren.mjs";
|
5
4
|
function findComponent(Children, names, recursively) {
|
6
5
|
var limit = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 100;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"findComponent.mjs","names":["React","CHILDREN_COMPONENT","INHERITED_NAME","getOriginChildren","findComponent","Children","names","recursively","limit","arguments","length","undefined","children","toArray","find","child","isValidElement","type","Fragment","props","inheritedNames","displayName","result","name","includes","isAdvanceMode","findAllComponents","findAllAndAdd","forEach","component","push"],"sources":["../src/findComponent.ts"],"sourcesContent":["import React, { ReactElement, ReactNode } from 'react';\
|
1
|
+
{"version":3,"file":"findComponent.mjs","names":["React","CHILDREN_COMPONENT","INHERITED_NAME","getOriginChildren","findComponent","Children","names","recursively","limit","arguments","length","undefined","children","toArray","find","child","isValidElement","type","Fragment","props","inheritedNames","displayName","result","name","includes","isAdvanceMode","findAllComponents","findAllAndAdd","forEach","component","push"],"sources":["../src/findComponent.ts"],"sourcesContent":["import React, { ReactElement, ReactNode } from 'react';\nimport { CHILDREN_COMPONENT, INHERITED_NAME } from './core';\nimport getOriginChildren from './getOriginChildren';\n\nfunction findComponent(\n Children: any,\n names: string[],\n recursively?: boolean,\n limit = 100,\n): Exclude<ReactNode, boolean | null | undefined> | undefined {\n const children = Children[CHILDREN_COMPONENT] ? getOriginChildren(Children) : Children;\n return React.Children.toArray(children).find((child) => {\n if (React.isValidElement(child)) {\n if (child.type === React.Fragment) {\n return findComponent(child.props.children, names, recursively, limit);\n }\n // @ts-ignore\n const inheritedNames = child.type[INHERITED_NAME] || [child.type.displayName];\n const result = !!inheritedNames.find((name: string) => names.includes(name));\n\n if (!result && child.props.children && recursively && limit > 0) {\n return findComponent(child.props.children, names, recursively, limit - 1);\n }\n\n return result;\n }\n });\n}\n\nexport function isAdvanceMode(Children: any, name: string[], recursively?: boolean) {\n const children = Children[CHILDREN_COMPONENT] ? getOriginChildren(Children) : Children;\n if (!children) return false;\n if (typeof children === 'function') {\n return true;\n }\n return !!findComponent(children, name, recursively);\n}\n\nexport function findAllComponents(Children: any, names: string[]): ReactElement[] {\n const result: ReactElement[] = [];\n\n const findAllAndAdd = (Children: any) => {\n const children = Children[CHILDREN_COMPONENT] ? getOriginChildren(Children) : Children;\n React.Children.toArray(children).forEach((child) => {\n if (React.isValidElement(child)) {\n if (child.type === React.Fragment) {\n findAllAndAdd(child.props.children);\n } else {\n // @ts-ignore\n const inheritedNames = child.type[INHERITED_NAME] || [child.type.displayName];\n const component = !!inheritedNames.find((name: string) => names.includes(name));\n\n if (component) {\n result.push(child);\n }\n\n if (child.props.children) {\n return findAllAndAdd(child.props.children);\n }\n }\n }\n });\n };\n\n findAllAndAdd(Children);\n\n return result;\n}\n\nexport default findComponent;\n"],"mappings":"AAAA,OAAOA,KAAK,M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M,CAACQ,IAAI,CAACf,KAAK,CAAC;UACpB;UAEA,IAAIA,KAAK,CAACI,KAAK,CAACP,QAAQ,EAAE;YACxB,OAAOe,aAAa,CAACZ,KAAK,CAACI,KAAK,CAACP,QAAQ,CAAC;UAC5C;QACF;MACF;IACF,CAAC,CAAC;EACJ,CAAC;EAEDe,aAAa,CAACtB,QAAQ,CAAC;EAEvB,OAAOiB,MAAM;AACf;AAEA,eAAelB,aAAa"}
|
@@ -6,9 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
});
|
7
7
|
exports["default"] = void 0;
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
9
|
-
var _core = require("
|
10
|
-
// @ts-ignore
|
11
|
-
|
9
|
+
var _core = require("./core");
|
12
10
|
function getOriginChildren(Children) {
|
13
11
|
if ( /*#__PURE__*/_react["default"].isValidElement(Children.origin) && Children.origin.type[_core.CHILDREN_COMPONENT]) {
|
14
12
|
return getOriginChildren(Children.origin.type);
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"getOriginChildren.js","names":["_react","_interopRequireDefault","require","_core","getOriginChildren","Children","React","isValidElement","origin","type","CHILDREN_COMPONENT","_default","exports"],"sources":["../src/getOriginChildren.ts"],"sourcesContent":["import React from 'react';\
|
1
|
+
{"version":3,"file":"getOriginChildren.js","names":["_react","_interopRequireDefault","require","_core","getOriginChildren","Children","React","isValidElement","origin","type","CHILDREN_COMPONENT","_default","exports"],"sources":["../src/getOriginChildren.ts"],"sourcesContent":["import React from 'react';\nimport { CHILDREN_COMPONENT } from './core';\n\nfunction getOriginChildren(Children: any): any {\n if (React.isValidElement(Children.origin) && Children.origin.type[CHILDREN_COMPONENT]) {\n return getOriginChildren(Children.origin.type);\n }\n return Children.origin;\n}\n\nexport default getOriginChildren;\n"],"mappings":";;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AAEA,SAASE,iBAAiBA,CAACC,QAAa,EAAO;EAC7C,IAAI,cAAAC,iBAAK,CAACC,cAAc,CAACF,QAAQ,CAACG,MAAM,CAAC,IAAIH,QAAQ,CAACG,MAAM,CAACC,IAAI,CAACC,wBAAkB,CAAC,EAAE;IACrF,OAAON,iBAAiB,CAACC,QAAQ,CAACG,MAAM,CAACC,IAAI,CAAC;EAChD;EACA,OAAOJ,QAAQ,CAACG,MAAM;AACxB;AAAC,IAAAG,QAAA,GAEcP,iBAAiB;AAAAQ,OAAA,cAAAD,QAAA"}
|
@@ -1,6 +1,5 @@
|
|
1
1
|
import React from 'react';
|
2
|
-
|
3
|
-
import { CHILDREN_COMPONENT } from 'intergalactic/core';
|
2
|
+
import { CHILDREN_COMPONENT } from "./core.mjs";
|
4
3
|
function getOriginChildren(Children) {
|
5
4
|
if ( /*#__PURE__*/React.isValidElement(Children.origin) && Children.origin.type[CHILDREN_COMPONENT]) {
|
6
5
|
return getOriginChildren(Children.origin.type);
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"getOriginChildren.mjs","names":["React","CHILDREN_COMPONENT","getOriginChildren","Children","isValidElement","origin","type"],"sources":["../src/getOriginChildren.ts"],"sourcesContent":["import React from 'react';\
|
1
|
+
{"version":3,"file":"getOriginChildren.mjs","names":["React","CHILDREN_COMPONENT","getOriginChildren","Children","isValidElement","origin","type"],"sources":["../src/getOriginChildren.ts"],"sourcesContent":["import React from 'react';\nimport { CHILDREN_COMPONENT } from './core';\n\nfunction getOriginChildren(Children: any): any {\n if (React.isValidElement(Children.origin) && Children.origin.type[CHILDREN_COMPONENT]) {\n return getOriginChildren(Children.origin.type);\n }\n return Children.origin;\n}\n\nexport default getOriginChildren;\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,kBAAkB,QAAQ,YAAQ;AAE3C,SAASC,iBAAiBA,CAACC,QAAa,EAAO;EAC7C,IAAI,cAAAH,KAAK,CAACI,cAAc,CAACD,QAAQ,CAACE,MAAM,CAAC,IAAIF,QAAQ,CAACE,MAAM,CAACC,IAAI,CAACL,kBAAkB,CAAC,EAAE;IACrF,OAAOC,iBAAiB,CAACC,QAAQ,CAACE,MAAM,CAACC,IAAI,CAAC;EAChD;EACA,OAAOH,QAAQ,CAACE,MAAM;AACxB;AAEA,eAAeH,iBAAiB"}
|
package/utils/lib/if.d.ts
CHANGED
package/utils/lib/if.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"if.js","names":["If","props","condition","children","_default","exports"],"sources":["../src/if.tsx"],"sourcesContent":["import { UnknownProperties } from '
|
1
|
+
{"version":3,"file":"if.js","names":["If","props","condition","children","_default","exports"],"sources":["../src/if.tsx"],"sourcesContent":["import { UnknownProperties } from './core';\nimport { FC, ReactNode } from 'react';\n\n/** @deprecated */\nexport interface IIfProps extends IfProps, UnknownProperties {}\nexport type IfProps = {\n condition: boolean;\n children?: ReactNode;\n};\n\nconst If: FC<IIfProps> = (props) => {\n const { condition, children } = props;\n return (condition ? children : null) as ReturnType<FC>;\n};\n\nexport default If;\n"],"mappings":";;;;;;AAGA;;AAOA,IAAMA,EAAgB,GAAG,SAAnBA,EAAgBA,CAAIC,KAAK,EAAK;EAClC,IAAQC,SAAS,GAAeD,KAAK,CAA7BC,SAAS;IAAEC,QAAQ,GAAKF,KAAK,CAAlBE,QAAQ;EAC3B,OAAQD,SAAS,GAAGC,QAAQ,GAAG,IAAI;AACrC,CAAC;AAAC,IAAAC,QAAA,GAEaJ,EAAE;AAAAK,OAAA,cAAAD,QAAA"}
|
package/utils/lib/if.mjs.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"if.mjs","names":["If","props","condition","children"],"sources":["../src/if.tsx"],"sourcesContent":["import { UnknownProperties } from '
|
1
|
+
{"version":3,"file":"if.mjs","names":["If","props","condition","children"],"sources":["../src/if.tsx"],"sourcesContent":["import { UnknownProperties } from './core';\nimport { FC, ReactNode } from 'react';\n\n/** @deprecated */\nexport interface IIfProps extends IfProps, UnknownProperties {}\nexport type IfProps = {\n condition: boolean;\n children?: ReactNode;\n};\n\nconst If: FC<IIfProps> = (props) => {\n const { condition, children } = props;\n return (condition ? children : null) as ReturnType<FC>;\n};\n\nexport default If;\n"],"mappings":"AAGA;;AAOA,IAAMA,EAAgB,GAAG,SAAnBA,EAAgBA,CAAIC,KAAK,EAAK;EAClC,IAAQC,SAAS,GAAeD,KAAK,CAA7BC,SAAS;IAAEC,QAAQ,GAAKF,KAAK,CAAlBE,QAAQ;EAC3B,OAAQD,SAAS,GAAGC,QAAQ,GAAG,IAAI;AACrC,CAAC;AAED,eAAeH,EAAE"}
|
package/utils/lib/uniqueID.d.ts
CHANGED
package/utils/lib/uniqueID.js
CHANGED
@@ -8,10 +8,8 @@ exports.useUID = exports["default"] = void 0;
|
|
8
8
|
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
9
9
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
10
10
|
var _react = _interopRequireDefault(require("react"));
|
11
|
-
var _core = require("
|
11
|
+
var _core = require("./core");
|
12
12
|
var _useEnhancedEffect = _interopRequireDefault(require("./use/useEnhancedEffect"));
|
13
|
-
// @ts-ignore
|
14
|
-
|
15
13
|
var createSource = function createSource() {
|
16
14
|
var prefix = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'ui-kit-';
|
17
15
|
return {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"uniqueID.js","names":["_react","_interopRequireDefault","require","_core","_useEnhancedEffect","createSource","prefix","arguments","length","undefined","value","useUID","_context$prefix","context","register","get","_ref","React","useId","useState","_ref2","_slicedToArray2","uid","trimmedUid","String","startsWith","endsWith","slice","useEnhancedEffect","set","exports","_default","props","_objectSpread2"],"sources":["../src/uniqueID.ts"],"sourcesContent":["import React from 'react';\
|
1
|
+
{"version":3,"file":"uniqueID.js","names":["_react","_interopRequireDefault","require","_core","_useEnhancedEffect","createSource","prefix","arguments","length","undefined","value","useUID","_context$prefix","context","register","get","_ref","React","useId","useState","_ref2","_slicedToArray2","uid","trimmedUid","String","startsWith","endsWith","slice","useEnhancedEffect","set","exports","_default","props","_objectSpread2"],"sources":["../src/uniqueID.ts"],"sourcesContent":["import React from 'react';\nimport { UnknownProperties, register } from './core';\nimport useEnhancedEffect from './use/useEnhancedEffect';\n\ntype ContextType = {\n prefix?: string;\n value: number;\n};\n\n/** @deprecated */\nexport interface IUniqueIDProps extends UniqueIDProps, UnknownProperties {}\nexport type UniqueIDProps = {\n /* Unique ID */\n uid?: string;\n};\n\nconst createSource = (prefix = 'ui-kit-'): ContextType => ({ value: 1, prefix });\n\nexport const useUID = (prefix?: string): string => {\n const context = register.get<ContextType>('uid-context', createSource(prefix));\n const [uid] = React.useId ? [React.useId()] : React.useState<number>(context.value++);\n const trimmedUid =\n String(uid).startsWith(':') && String(uid).endsWith(':') ? String(uid).slice(1, -1) : uid;\n\n useEnhancedEffect(() => {\n register.set<ContextType>('uid-context', context);\n }, [trimmedUid]);\n\n return (context.prefix ?? '') + trimmedUid;\n};\n\nexport default (prefix?: string) => {\n return (props: any): { uid: ReturnType<typeof useUID> } => {\n const uid = useUID(prefix);\n return {\n uid,\n ...props,\n };\n };\n};\n"],"mappings":";;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,kBAAA,GAAAH,sBAAA,CAAAC,OAAA;AAcA,IAAMG,YAAY,GAAG,SAAfA,YAAYA,CAAA;EAAA,IAAIC,MAAM,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,SAAS;EAAA,OAAmB;IAAEG,KAAK,EAAE,CAAC;IAAEJ,MAAM,EAANA;EAAO,CAAC;AAAA,CAAC;AAEzE,IAAMK,MAAM,GAAG,SAATA,MAAMA,CAAIL,MAAe,EAAa;EAAA,IAAAM,eAAA;EACjD,IAAMC,OAAO,GAAGC,cAAQ,CAACC,GAAG,CAAc,aAAa,EAAEV,YAAY,CAACC,MAAM,CAAC,CAAC;EAC9E,IAAAU,IAAA,GAAcC,iBAAK,CAACC,KAAK,GAAG,CAACD,iBAAK,CAACC,KAAK,EAAE,CAAC,GAAGD,iBAAK,CAACE,QAAQ,CAASN,OAAO,CAACH,KAAK,EAAE,CAAC;IAAAU,KAAA,OAAAC,eAAA,aAAAL,IAAA;IAA9EM,GAAG,GAAAF,KAAA;EACV,IAAMG,UAAU,GACdC,MAAM,CAACF,GAAG,CAAC,CAACG,UAAU,CAAC,GAAG,CAAC,IAAID,MAAM,CAACF,GAAG,CAAC,CAACI,QAAQ,CAAC,GAAG,CAAC,GAAGF,MAAM,CAACF,GAAG,CAAC,CAACK,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAGL,GAAG;EAE3F,IAAAM,6BAAiB,EAAC,YAAM;IACtBd,cAAQ,CAACe,GAAG,CAAc,aAAa,EAAEhB,OAAO,CAAC;EACnD,CAAC,EAAE,CAACU,UAAU,CAAC,CAAC;EAEhB,OAAO,EAAAX,eAAA,GAACC,OAAO,CAACP,MAAM,cAAAM,eAAA,cAAAA,eAAA,GAAI,EAAE,IAAIW,UAAU;AAC5C,CAAC;AAACO,OAAA,CAAAnB,MAAA,GAAAA,MAAA;AAAA,IAAAoB,QAAA,GAEa,SAAAA,SAACzB,MAAe,EAAK;EAClC,OAAO,UAAC0B,KAAU,EAAyC;IACzD,IAAMV,GAAG,GAAGX,MAAM,CAACL,MAAM,CAAC;IAC1B,WAAA2B,cAAA;MACEX,GAAG,EAAHA;IAAG,GACAU,KAAK;EAEZ,CAAC;AACH,CAAC;AAAAF,OAAA,cAAAC,QAAA"}
|
package/utils/lib/uniqueID.mjs
CHANGED
@@ -1,8 +1,7 @@
|
|
1
1
|
import _objectSpread from "@babel/runtime/helpers/objectSpread2";
|
2
2
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
3
3
|
import React from 'react';
|
4
|
-
|
5
|
-
import { register } from 'intergalactic/core';
|
4
|
+
import { register } from "./core.mjs";
|
6
5
|
import useEnhancedEffect from "./use/useEnhancedEffect.mjs";
|
7
6
|
var createSource = function createSource() {
|
8
7
|
var prefix = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'ui-kit-';
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"uniqueID.mjs","names":["React","register","useEnhancedEffect","createSource","prefix","arguments","length","undefined","value","useUID","_context$prefix","context","get","_ref","useId","useState","_ref2","_slicedToArray","uid","trimmedUid","String","startsWith","endsWith","slice","set","props","_objectSpread"],"sources":["../src/uniqueID.ts"],"sourcesContent":["import React from 'react';\
|
1
|
+
{"version":3,"file":"uniqueID.mjs","names":["React","register","useEnhancedEffect","createSource","prefix","arguments","length","undefined","value","useUID","_context$prefix","context","get","_ref","useId","useState","_ref2","_slicedToArray","uid","trimmedUid","String","startsWith","endsWith","slice","set","props","_objectSpread"],"sources":["../src/uniqueID.ts"],"sourcesContent":["import React from 'react';\nimport { UnknownProperties, register } from './core';\nimport useEnhancedEffect from './use/useEnhancedEffect';\n\ntype ContextType = {\n prefix?: string;\n value: number;\n};\n\n/** @deprecated */\nexport interface IUniqueIDProps extends UniqueIDProps, UnknownProperties {}\nexport type UniqueIDProps = {\n /* Unique ID */\n uid?: string;\n};\n\nconst createSource = (prefix = 'ui-kit-'): ContextType => ({ value: 1, prefix });\n\nexport const useUID = (prefix?: string): string => {\n const context = register.get<ContextType>('uid-context', createSource(prefix));\n const [uid] = React.useId ? [React.useId()] : React.useState<number>(context.value++);\n const trimmedUid =\n String(uid).startsWith(':') && String(uid).endsWith(':') ? String(uid).slice(1, -1) : uid;\n\n useEnhancedEffect(() => {\n register.set<ContextType>('uid-context', context);\n }, [trimmedUid]);\n\n return (context.prefix ?? '') + trimmedUid;\n};\n\nexport default (prefix?: string) => {\n return (props: any): { uid: ReturnType<typeof useUID> } => {\n const uid = useUID(prefix);\n return {\n uid,\n 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CAAC;AAED,gBAAe,UAACf,MAAe,EAAK;EAClC,OAAO,UAACqB,KAAU,EAAyC;IACzD,IAAMP,GAAG,GAAGT,MAAM,CAACL,MAAM,CAAC;IAC1B,OAAAsB,aAAA;MACER,GAAG,EAAHA;IAAG,GACAO,KAAK;EAEZ,CAAC;AACH,CAAC"}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"Component.js","names":["_react","require","Root","undefined","exports","RootComponent","_PureComponent","_inherits2","_super","_createSuper2","_this","_classCallCheck2","_len","arguments","length","args","Array","_key","call","apply","concat","_defineProperty2","_assertThisInitialized2","_createClass2","key","get","PureComponent","Component","Intergalactic","_Intergalactic","InternalTypings","_InternalTypings","wrapIntergalacticComponent","wrapper"],"sources":["../../src/Component.tsx"],"sourcesContent":["import React, {\n AllHTMLAttributes,\n ForwardRefExoticComponent,\n PureComponent,\n ReactNode,\n RefObject,\n} from 'react';\nimport { IStyledProps } from './styled';\n\n/** @deprecated */\ntype KnownKeys<T> = {\n [K in keyof T]: string extends K ? never : number extends K ? never : K;\n} extends { [_ in keyof T]: infer U }\n ? U\n : never;\n\n/** @deprecated */\nexport type HandlersType<UCProps> = { [K in keyof UCProps]?: <T = unknown>(arg: T) => void };\n/** @deprecated */\nexport type ChildrenType<Props = {}, Ctx = {}, UCProps = {}> =\n | ((props: Props & Ctx, handlers: HandlersType<UCProps>) => ReactNode)\n | ReactNode;\n\n/** @deprecated */\nexport type RootComponentHandler = (...args: any[]) => void | false;\n\n/** @deprecated */\nexport interface IRootComponentHandlers {\n [key: string]: RootComponentHandler;\n}\n\n/** @deprecated */\nexport interface IRootComponentProps<Props = {}, Ctx = {}> {\n forwardRef?: RefObject<any>;\n Children?: any;\n children?: ChildrenType<Props, Ctx>;\n styles?: IStyledProps['styles'];\n 'data-ui-name'?: string;\n}\n\n/** @deprecated */\nexport type IComponentProps<Props = {}, Ctx = {}> = Props & IRootComponentProps<Props, Ctx>;\n\n/** @deprecated */\nexport type IFunctionProps<Props = {}, Ctx = {}> = IComponentProps<Props, Ctx> &\n Omit<AllHTMLAttributes<any>, keyof IComponentProps<Props, Ctx>> & { Root?: Root };\n\n/** @deprecated */\nexport type PropsWithRenderFnChildren<Props = {}, Ctx = {}, UCProps = {}> = Omit<\n Pick<Props, KnownKeys<Props>>,\n 'children'\n> & {\n children?: ChildrenType<Props, Ctx, UCProps>;\n [key: string]: unknown;\n};\n\n/** @deprecated */\nexport type CProps<Props, Ctx = {}, UCProps = {}> = Props & {\n children?: ((props: Props & Ctx, handlers: UCProps) => React.ReactNode) | React.ReactNode;\n};\n/** @deprecated */\nexport type ReturnEl = React.ReactElement | null;\n\nexport interface IRootNodeProps {\n render: React.ElementType | string;\n tag?: React.ElementType | string;\n\n [key: string]: any;\n}\n\ntype Root = ForwardRefExoticComponent<IRootNodeProps>;\n\n/**\n * @deprecated since version ^1.8.0\n */\nexport type PropGetter<T extends (...args: any) => any> = <P>(props?: P) => ReturnType<T> & P;\n/**\n * @deprecated since version ^1.8.0\n */\n/** @deprecated */\nexport type PropGetterReturn<T extends (...args: any) => any> = Partial<ReturnType<T>>;\n/** @deprecated */\nexport type PropGetterFn = <T extends {}>(props?: T) => T & { [key: string]: unknown };\n/** @deprecated */\nexport type Merge<Props, HTMLProps> = Props & Omit<HTMLProps, keyof Props>;\n/** @deprecated */\nexport type MergeGetters<G1 extends (...args: any) => any, G2 extends (...args: any) => any> = <P>(\n props?: P,\n) => Merge<ReturnType<G1>, ReturnType<G2>> & P;\n\nconst Root: Root = undefined as any;\n\nexport { Root };\n\n/** @deprecated */\nabstract class RootComponent<\n Props = {},\n Context = {},\n State = {},\n Enhance = {},\n> extends PureComponent<Props, State> {\n get handlers(): Readonly<IRootComponentHandlers> {\n return {};\n }\n\n get asProps() {\n return {} as Readonly<\n Merge<Props & IRootComponentProps<Props, Context> & Enhance, AllHTMLAttributes<any>>\n >;\n }\n\n Root: Root = undefined as any;\n\n isControlled = false;\n}\n\nexport const Component = RootComponent;\n/** @deprecated */\nexport type Component<\n Props = {},\n Context = {},\n State = {},\n Handlers extends IRootComponentHandlers = IRootComponentHandlers,\n> = React.ComponentClass<Props, State> & {\n isControlled: boolean;\n\n handlers: Readonly<Handlers>;\n\n asProps: Readonly<Merge<Props & IRootComponentProps<Props, Context>, AllHTMLAttributes<any>>>;\n\n Root: Root;\n};\n\nexport namespace Intergalactic {\n type ReactFCProps<C extends React.FC> = C extends React.FC<infer Props> ? Omit<Props, 'tag'> : {};\n type ReactComponentProps<C extends React.ComponentClass> = C extends React.ComponentClass<\n infer Props\n >\n ? Omit<Props, 'tag'>\n : never;\n type ReactFCLike = (props: any) => any;\n type ReactFCLikeProps<C extends ReactFCLike> = C extends (props: infer Props) => any ? Props : {};\n type ComponentChildren<\n Props,\n Context,\n RenderingResult = InternalTypings.ReturnResult,\n AdditionalContext extends any[] = never[],\n > =\n | ((props: MergeProps<Context, Props>, ...args: AdditionalContext) => RenderingResult)\n | InternalTypings.ReturnResult;\n type ComponentBasicProps<Tag extends InternalTypings.ComponentTag> = {\n ref?: React.Ref<InternalTypings.ComponentHtmlElement<Tag> | null>;\n /** @private DO NOT USE IT. Low-level api that prevents specified props from being applied as DOM attribute. */\n __excludeProps?: string[];\n };\n type MergeProps<HighPriorityProps, LowPriorityProps> = {\n [K in keyof LowPriorityProps]: K extends keyof HighPriorityProps\n ? HighPriorityProps[K]\n : LowPriorityProps[K];\n } & HighPriorityProps;\n /** @private */\n export namespace InternalTypings {\n export type EfficientOmit<Type, Keys> = {\n [Property in keyof Type as Exclude<Property, Keys>]: Type[Property];\n };\n export type ComponentPropsNesting<Tag extends InternalTypings.ComponentTag> = Omit<\n MergeProps<\n Tag extends React.FC\n ? ReactFCProps<Tag>\n : Tag extends React.ComponentClass\n ? ReactComponentProps<Tag>\n : Tag extends ReactFCLike\n ? ReactFCLikeProps<Tag>\n : Tag extends keyof JSX.IntrinsicElements\n ? JSX.IntrinsicElements[Tag]\n : {},\n Tag extends { __nestedProps: infer NestedProps } ? NestedProps : {}\n >,\n 'children' | 'tag'\n >;\n export type ReturnResult =\n | React.ReactElement\n | React.ReactNode\n | React.ReactNode[]\n | string\n | null;\n export type ComponentTag =\n | keyof JSX.IntrinsicElements\n | React.ComponentClass\n | React.FC\n | ReactFCLike;\n export type ComponentProps<\n Tag extends ComponentTag,\n BaseTag extends ComponentTag | never,\n Props,\n Context = never,\n AdditionalContext extends any[] = never[],\n > = {\n tag?: Tag;\n children?: ComponentChildren<\n EfficientOmit<Props, 'children'> & { children: React.ReactNode },\n Context,\n ReturnResult,\n AdditionalContext\n >;\n } & ComponentBasicProps<Tag> &\n MergeProps<\n EfficientOmit<Props, 'tag' | 'children'>,\n MergeProps<ComponentPropsNesting<Tag>, ComponentPropsNesting<BaseTag>>\n >;\n export type PropsRenderingResultComponentProps<\n Tag extends ComponentTag,\n Props,\n Context = {},\n AdditionalContext extends any[] = never[],\n > = {\n tag?: Tag;\n children?: ComponentChildren<\n EfficientOmit<Props, 'children'> & { children: React.ReactNode },\n Context,\n Partial<\n EfficientOmit<\n MergeProps<Props, ComponentPropsNesting<Tag>>,\n 'children' | 'tag' | 'ref'\n > & {\n children?: React.ReactNode;\n }\n >,\n AdditionalContext\n >;\n } & ComponentBasicProps<Tag> &\n MergeProps<EfficientOmit<Props, 'tag' | 'children'>, ComponentPropsNesting<Tag>>;\n export type ComponentRenderingResults = React.ReactElement;\n export type ComponentAdditive<\n BaseTag extends ComponentTag,\n Tag extends ComponentTag,\n Props = {},\n Context = {},\n AdditionalContext = {},\n > = {\n __nestedProps: ComponentPropsNesting<BaseTag>;\n __tag: Tag;\n __props: Props;\n __context: Context;\n __additionalContext: AdditionalContext;\n };\n export type InferJsxIntrinsicElement<T extends React.DetailedHTMLProps<any, any>> =\n T extends React.DetailedHTMLProps<infer _, infer Element> ? Element : HTMLElement;\n type InferElementFromRef<T> = T extends React.Ref<infer Element> ? Element : never;\n type InferRefElementFromProps<T> = 'ref' extends keyof T\n ? InferElementFromRef<T['ref']>\n : HTMLElement;\n export type ComponentHtmlElement<Tag extends ComponentTag> =\n Tag extends keyof JSX.IntrinsicElements\n ? InferJsxIntrinsicElement<JSX.IntrinsicElements[Tag]>\n : Tag extends { __nestedProps: infer NestedProps }\n ? InferRefElementFromProps<NestedProps>\n : HTMLElement;\n export type UntypeRefAndTag<Props> = Intergalactic.InternalTypings.EfficientOmit<\n Props,\n 'ref' | 'tag'\n > & {\n ref: React.Ref<any>;\n tag: Intergalactic.InternalTypings.ComponentTag;\n };\n }\n export type Component<\n BaseTag extends InternalTypings.ComponentTag = never,\n BaseProps = {},\n Context = {},\n AdditionalContext extends any[] = never[],\n > = (<Tag extends InternalTypings.ComponentTag = BaseTag, Props extends BaseProps = BaseProps>(\n props: InternalTypings.ComponentProps<Tag, BaseTag, Props, Context, AdditionalContext>,\n ) => InternalTypings.ComponentRenderingResults) &\n InternalTypings.ComponentAdditive<BaseTag, Tag, BaseProps, Context, AdditionalContext>;\n export type Tag = InternalTypings.ComponentTag;\n export type DomProps<Tag extends keyof JSX.IntrinsicElements> =\n InternalTypings.InferJsxIntrinsicElement<JSX.IntrinsicElements[Tag]>;\n}\n\nexport const wrapIntergalacticComponent = <\n Component extends Intergalactic.Component<any, any, any, any>,\n PropsExtending = {},\n>(\n wrapper: (\n props: Intergalactic.InternalTypings.UntypeRefAndTag<\n Intergalactic.InternalTypings.ComponentPropsNesting<Component>\n > &\n PropsExtending,\n ) => React.ReactNode,\n): Intergalactic.Component<\n Component['__tag'],\n Component['__props'] & Component['__nestedProps'] & PropsExtending,\n Component['__context'],\n Component['__additionalContext']\n> => wrapper as any;\n"],"mappings":";;;;;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AA0FA,IAAMC,IAAU,GAAGC,SAAgB;AAACC,OAAA,CAAAF,IAAA,GAAAA,IAAA;AAIpC;AAAA,IACeG,aAAa,0BAAAC,cAAA;EAAA,IAAAC,UAAA,aAAAF,aAAA,EAAAC,cAAA;EAAA,IAAAE,MAAA,OAAAC,aAAA,aAAA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7B,OAAA,CAAA4B,0BAAA,GAAAA,0BAAA"}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"Children.js","names":["_react","_interopRequireDefault","require","_index","_excluded","_excluded2","CHILDREN_COMPONENT","Symbol","exports","CHILDREN_SELF","GETTER_REG","splitPropsAndGetters","props","Object","entries","reduce","acc","_ref","_ref2","_slicedToArray2","key","value","exec","getters","getterToArray","getter","Array","isArray","mergeObjects","a","arguments","length","undefined","b","core","_objectSpread2","keys","concat","_toConsumableArray2","assignGettersChain","createChildren","Context","contexts","Children","children","origin","_reduce","ctx","_ref3","React","useContext","handlers","propsAndGetters","_objectWithoutProperties2","_splitPropsAndGetters","assign","_reduce$handlers","_reduce$getters","mergedGetters","_ref4","_ref5","Enhancement","parent","init","map","component","CONTEXT_COMPONENT","filter","Boolean","asProps","_default"],"sources":["../../../src/enhancement/Children.tsx"],"sourcesContent":["import React from 'react';\nimport { CONTEXT_COMPONENT } from '../index';\n\nexport const CHILDREN_COMPONENT = Symbol('CHILDREN_COMPONENT');\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;AACA,IAAAC,MAAA,GAAAD,OAAA;AAA6C,IAAAE,SAAA;EAAAC,UAAA;AAEtC,IAAMC,kBAAkB,GAAGC,MAAM,CAAC,oBAAoB,CAAC;AAACC,OAAA,CAAAF,kBAAA,GAAAA,kBAAA;AAC/D,IAAMG,aAAa,GAAGF,MAAM,CAAC,eAAe,CAAC;AAE7C,IAAMG,UAAU,GAAG,iBAAiB;AAEpC,SAASC,oBAAoBA,CAACC,KAAU,EAAE;EACx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,GAAG,CAAC,CAAC;EACnB+B,QAAQ,CAACrC,kBAAkB,CAAC,GAAG,IAAI;EACnC,OAAOqC,QAAQ;AACjB;AAEA,SAASkB,WAAWA,CAAYpB,OAAY,EAAEqB,MAAW,EAAE;EACzD,OAAO;IACLC,IAAI,EAAE,SAAAA,KAAA,EAAqB;MACzB,IAAMrB,QAAQ,GAAG,CAAChB,KAAK,CAACC,OAAO,CAACmC,MAAM,CAAC,GAAGA,MAAM,GAAG,CAACA,MAAM,CAAC,EACxDE,GAAG,CAAC,UAACC,SAAS;QAAA,OAAKA,SAAS,CAACC,wBAAiB,CAAC;MAAA,EAAC,CAChDC,MAAM,CAACC,OAAO,CAAC;MAClB,IAAI,CAAC3D,aAAa,CAAC,GAAG+B,cAAc,CAACC,OAAO,EAAEC,QAAQ,CAAC;IACzD,CAAC;IACD2B,OAAO,EAAE,SAAAA,QAAqBzD,KAAU,EAAE;MACxC;MACA;MACA,IAAI,CAACH,aAAa,CAAC,CAACoC,MAAM,GAAGjC,KAAK,CAACgC,QAAQ;MAC3C,IAAI,CAACnC,aAAa,CAAC,CAACG,KAAK,GAAGA,KAAK;MACjC,WAAAuB,cAAA,iBAAAA,cAAA,iBACKvB,KAAK;QACR+B,QAAQ,EAAE,IAAI,CAAClC,aAAa;MAAC;IAEjC;EACF,CAAC;AACH;AAAC,IAAA6D,QAAA,GAEcT,WAAW;AAAArD,OAAA,cAAA8D,QAAA"}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"Root.js","names":["_react","_interopRequireDefault","require","_assignProps","_ref4","_excluded","_excluded2","createRootRender","Root","React","forwardRef","_ref","ref","Tag","render","source","_objectWithoutProperties2","_Root$props","props","_Root","styles","children","Children","_Root$props$forwardRe","clearProps","Object","entries","reduce","_ref2","_ref3","_slicedToArray2","name","value","undefined","child","origin","createElement","other","assignProps","_objectSpread2","useForkRef","Error","Fragment","Enhancement","init","asProps","WrapperComponent","isFunction","_default","exports"],"sources":["../../../src/enhancement/Root.tsx"],"sourcesContent":["import React from 'react';\n// @ts-ignore\nimport assignProps from '@semcore/utils/lib/assignProps';\n// @ts-ignore\nimport { useForkRef } from '@semcore/utils/lib/ref';\n\nfunction createRootRender() {\n // @ts-ignore\n const Root = React.forwardRef(function ({ render: Tag, ...source }, ref) {\n const {\n Root: _Root,\n\n styles,\n\n children,\n Children,\n forwardRef = null,\n ...props\n // @ts-ignore\n } = Root.props;\n\n const clearProps = Object.entries(props).reduce((props: any, [name, value]) => {\n if (value !== undefined) {\n props[name] = value;\n }\n return props;\n }, {});\n\n const child = {};\n // TODO: need to find better check solution (by lsroman)\n if (typeof Children.origin !== 'undefined') {\n // @ts-ignore\n child.children = <Children />;\n }\n\n const other = assignProps(\n {\n ...clearProps,\n ref: useForkRef(forwardRef, ref),\n },\n {\n ...child,\n ...source,\n },\n );\n if (!Tag) {\n throw new Error('`render` prop of Root is not provided');\n }\n if (Tag === React.Fragment) return <React.Fragment>{other.children}</React.Fragment>;\n\n return <Tag {...other} />;\n });\n // @ts-ignore\n Root.props = {};\n return Root;\n}\n\nfunction Enhancement() {\n return {\n init: function (this: any) {\n this.Root = createRootRender();\n },\n asProps: function (this: any, props: any, WrapperComponent: any, isFunction: boolean) {\n if (isFunction) {\n return {\n ...props,\n Root: this.Root,\n };\n }\n return props;\n },\n render: function (this: any, render: any, props: any) {\n this.Root.props = props;\n return render;\n },\n };\n}\n\nexport default Enhancement;\n"],"mappings":";;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEA,IAAAC,YAAA,GAAAF,sBAAA,CAAAC,OAAA;AAEA,IAAAE,KAAA,GAAAF,OAAA;AAAoD,IAAAG,SAAA;EAAAC,UAAA;AAEpD,SAASC,gBAAgBA,CAAA,EAAG;EAC1B;EACA,IAAMC,IAAI,gBAAGC,iBAAK,CAACC,UAAU,CAAC,UAAAC,IAAA,EAAsCC,GAAG,EAAE;IAAA,IAAvBC,GAAG,GAAAF,IAAA,CAAXG,MAAM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uC,CAAC;IAC1D;IACA,IAAI5B,GAAG,KAAKJ,iBAAK,CAACiC,QAAQ,EAAE,oBAAO1C,MAAA,YAAAoC,aAAA,CAACpC,MAAA,WAAK,CAAC0C,QAAQ,QAAEL,KAAK,CAAChB,QAAQ,CAAkB;IAEpF,oBAAOrB,MAAA,YAAAoC,aAAA,CAACvB,GAAG,EAAKwB,KAAK,CAAI;EAC3B,CAAC,CAAC;EACF;EACA7B,IAAI,CAACU,KAAK,GAAG,CAAC,CAAC;EACf,OAAOV,IAAI;AACb;AAEA,SAASmC,WAAWA,CAAA,EAAG;EACrB,OAAO;IACLC,IAAI,EAAE,SAAAA,KAAA,EAAqB;MACzB,IAAI,CAACpC,IAAI,GAAGD,gBAAgB,EAAE;IAChC,CAAC;IACDsC,OAAO,EAAE,SAAAA,QAAqB3B,KAAU,EAAE4B,gBAAqB,EAAEC,UAAmB,EAAE;MACpF,IAAIA,UAAU,EAAE;QACd,WAAAR,cAAA,iBAAAA,cAAA,iBACKrB,KAAK;UACRV,IAAI,EAAE,IAAI,CAACA;QAAI;MAEnB;MACA,OAAOU,KAAK;IACd,CAAC;IACDJ,MAAM,EAAE,SAAAA,OAAqBA,OAAW,EAAEI,KAAU,EAAE;MACpD,IAAI,CAACV,IAAI,CAACU,KAAK,GAAGA,KAAK;MACvB,OAAOJ,OAAM;IACf;EACF,CAAC;AACH;AAAC,IAAAkC,QAAA,GAEcL,WAAW;AAAAM,OAAA,cAAAD,QAAA"}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"bindHandler.js","names":["arraysEqual","a","b","length","i","handlerBinder","fn","_len","arguments","depsArgs","Array","_key","memoizeds","hasher","has","get","memoized","find","deps","bindFn","apply","bind","push","set","WeakMap","Enhancement","condition","Component","isFunction","init","_this","Object","keys","filter","field","startsWith","forEach","name","_default","exports"],"sources":["../../../src/enhancement/bindHandler.tsx"],"sourcesContent":["function arraysEqual(a: any, b: any) {\n if (a.length !== b.length) return false;\n for (let i = 0; i < a.length; i++) {\n if (a[i] !== b[i]) return false;\n }\n return true;\n}\n\nfunction handlerBinder(fn: any) {\n return function (...depsArgs: any[]) {\n let memoizeds = [];\n if (handlerBinder.hasher.has(fn)) {\n memoizeds = handlerBinder.hasher.get(fn);\n const memoized = memoizeds.find((memoized: any) => arraysEqual(memoized.deps, depsArgs));\n if (memoized) return memoized.fn;\n }\n\n const bindFn = fn(...depsArgs).bind(fn);\n memoizeds.push({\n deps: depsArgs,\n fn: bindFn,\n });\n handlerBinder.hasher.set(fn, memoizeds);\n return bindFn;\n };\n}\n\nhandlerBinder.hasher = new WeakMap();\n\nfunction Enhancement() {\n return {\n condition: function (Component: any, isFunction: boolean) {\n return !isFunction;\n },\n init: function (this: any) {\n Object.keys(this)\n .filter((field) => field.startsWith('bindHandler'))\n .forEach((name) => {\n this[name] = handlerBinder(this[name].bind(this));\n });\n },\n };\n}\n\nexport default Enhancement;\n"],"mappings":";;;;;;AAAA,SAASA,WAAWA,CAACC,CAAM,EAAEC,CAAM,EAAE;EACnC,IAAID,CAAC,CAACE,MAAM,KAAKD,CAAC,CAACC,MAAM,EAAE,OAAO,KAAK;EACvC,KAAK,IAAIC,CAAC,GAAG,CAAC,EAAEA,CAAC,GAAGH,CAAC,CAACE,MAAM,EAAEC,CAAC,EAAE,EAAE;IACjC,IAAIH,CAAC,CAACG,CAAC,CAAC,KAAKF,CAAC,CAACE,CAAC,CAAC,EAAE,OAAO,KAAK;EACjC;EACA,OAAO,IAAI;AACb;AAEA,SAASC,aAAaA,CAACC,EAAO,EAAE;EAC9B,OAAO,YAA8B;IAAA,SAAAC,IAAA,GAAAC,SAAA,CAAAL,MAAA,EAAjBM,QAAQ,OAAAC,KAAA,CAAAH,IAAA,GAAAI,IAAA,MAAAA,IAAA,GAAAJ,IAAA,EAAAI,IAAA;MAARF,QAAQ,CAAAE,IAAA,IAAAH,SAAA,CAAAG,IAAA;IAAA;IAC1B,IAAIC,SAAS,GAAG,EAAE;IAClB,IAAIP,aAAa,C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AA,cAAAD,QAAA"}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"dataName.js","names":["Enhancement","wrapperProps","props","WrapperComponent","_objectSpread2","displayName","_default","exports"],"sources":["../../../src/enhancement/dataName.tsx"],"sourcesContent":["function Enhancement() {\n return {\n wrapperProps: function (props: any, WrapperComponent: any) {\n return {\n 'data-ui-name': WrapperComponent.displayName,\n ...props,\n };\n },\n };\n}\n\nexport default Enhancement;\n"],"mappings":";;;;;;;;AAAA,SAASA,WAAWA,CAAA,EAAG;EACrB,OAAO;IACLC,YAAY,EAAE,SAAAA,aAAUC,KAAU,EAAEC,gBAAqB,EAAE;MACzD,WAAAC,cAAA;QACE,cAAc,EAAED,gBAAgB,CAACE;MAAW,GACzCH,KAAK;IAEZ;EACF,CAAC;AACH;AAAC,IAAAI,QAAA,GAEcN,WAAW;AAAAO,OAAA,cAAAD,QAAA"}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"enhance.js","names":["Enhancement","condition","Component","_Component$enhance","Boolean","enhance","length","wrapperProps","props","WrapperComponent","reduce","acc","_default","exports"],"sources":["../../../src/enhancement/enhance.tsx"],"sourcesContent":["function Enhancement() {\n return {\n condition: function (Component: any) {\n return Boolean(Component.enhance?.length);\n },\n wrapperProps: function (props: any, WrapperComponent: any) {\n return WrapperComponent.enhance.reduce((acc: any, enhance: any) => enhance(acc), props);\n },\n };\n}\n\nexport default Enhancement;\n"],"mappings":";;;;;;AAAA,SAASA,WAAWA,CAAA,EAAG;EACrB,OAAO;IACLC,SAAS,EAAE,SAAAA,UAAUC,SAAc,EAAE;MAAA,IAAAC,kBAAA;MACnC,OAAOC,OAAO,EAAAD,kBAAA,GAACD,SAAS,CAACG,OAAO,cAAAF,kBAAA,uBAAjBA,kBAAA,CAAmBG,MAAM,CAAC;IAC3C,CAAC;IACDC,YAAY,EAAE,SAAAA,aAAUC,KAAU,EAAEC,gBAAqB,EAAE;MACzD,OAAOA,gBAAgB,CAACJ,OAAO,CAACK,MAAM,CAAC,UAACC,GAAQ,EAAEN,OAAY;QAAA,OAAKA,OAAO,CAACM,GAAG,CAAC;MAAA,GAAEH,KAAK,CAAC;IACzF;EACF,CAAC;AACH;AAAC,IAAAI,QAAA,GAEcZ,WAAW;AAAAa,OAAA,cAAAD,QAAA"}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"functionDefaultProps.js","names":["Enhancement","defaultProps","condition","Component","Boolean","Object","keys","length","_static","WrapperComponent","wrapperProps","props","assign","_default","exports"],"sources":["../../../src/enhancement/functionDefaultProps.tsx"],"sourcesContent":["function Enhancement() {\n let defaultProps = {};\n return {\n condition: function (Component: any) {\n if (!Component.defaultProps) {\n return false;\n }\n if (typeof Component.defaultProps === 'function') {\n return true;\n }\n return Boolean(Object.keys(Component.defaultProps).length);\n },\n static: function (WrapperComponent: any) {\n defaultProps = WrapperComponent.defaultProps;\n return {\n defaultProps: {},\n };\n },\n wrapperProps: function (props: any) {\n if (typeof defaultProps === 'function') {\n // TODO: optimization\n return Object.assign({}, defaultProps(props), props);\n }\n return Object.assign({}, defaultProps, props);\n },\n };\n}\n\nexport default Enhancement;\n"],"mappings":";;;;;;AAAA,SAASA,WAAWA,CAAA,EAAG;EACrB,IAAIC,YAAY,GAAG,CAAC,CAAC;EACrB,OAAO;IACLC,SAAS,EAAE,SAAAA,UAAUC,SAAc,EAAE;MACnC,IAAI,CAACA,SAAS,CAACF,YAAY,EAAE;QAC3B,OAAO,KAAK;MACd;MACA,IAAI,OAAOE,SAAS,CAACF,YAAY,KAAK,UAAU,EAAE;QAChD,OAAO,IAAI;MACb;MACA,OAAOG,OAAO,CAACC,MAAM,CAACC,IAAI,CAACH,SAAS,CAACF,YAAY,CAAC,CAACM,MAAM,CAAC;IAC5D,CAAC;IACD,UAAQ,SAAAC,QAAUC,gBAAqB,EAAE;MACvCR,YAAY,GAAGQ,gBAAgB,CAACR,YAAY;MAC5C,OAAO;QACLA,YAAY,EAAE,CAAC;MACjB,CAAC;IACH,CAAC;IACDS,YAAY,EAAE,SAAAA,aAAUC,KAAU,EAAE;MAClC,IAAI,OAAOV,YAAY,KAAK,UAAU,EAAE;QACtC;QACA,OAAOI,MAAM,CAACO,MAAM,CAAC,CAAC,CAAC,EAAEX,YAAY,CAACU,KAAK,CAAC,EAAEA,KAAK,CAAC;MACtD;MACA,OAAON,MAAM,CAACO,MAAM,CAAC,CAAC,CAAC,EAAEX,YAAY,EAAEU,KAAK,CAAC;IAC/C;EACF,CAAC;AACH;AAAC,IAAAE,QAAA,GAEcb,WAAW;AAAAc,OAAA,cAAAD,QAAA"}
|