intergalactic 15.82.1 → 15.82.2-prerelease.1

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.
Files changed (268) hide show
  1. package/CHANGELOG.md +4 -8
  2. package/components.json +1 -1
  3. package/core/index.d.ts +2 -40
  4. package/core/lib/cjs/index.js +6 -426
  5. package/core/lib/cjs/index.js.map +1 -1
  6. package/core/lib/es6/index.js +2 -355
  7. package/core/lib/es6/index.js.map +1 -1
  8. package/core/lib/types/index.d.ts +2 -40
  9. package/d3-chart/component/ChartLegend/BaseLegend.type.d.ts +1 -0
  10. package/d3-chart/component/ChartLegend/LegendFlex/LegendFlex.type.d.ts +1 -0
  11. package/d3-chart/lib/cjs/Area.js +11 -11
  12. package/d3-chart/lib/cjs/Axis.js +14 -14
  13. package/d3-chart/lib/cjs/Bar.js +10 -10
  14. package/d3-chart/lib/cjs/Bubble.js +12 -12
  15. package/d3-chart/lib/cjs/Donut.js +9 -9
  16. package/d3-chart/lib/cjs/Dots.js +8 -8
  17. package/d3-chart/lib/cjs/HorizontalBar.js +10 -10
  18. package/d3-chart/lib/cjs/Hover.js +3 -3
  19. package/d3-chart/lib/cjs/Line.js +9 -9
  20. package/d3-chart/lib/cjs/Plot.js +3 -3
  21. package/d3-chart/lib/cjs/Radar.js +19 -19
  22. package/d3-chart/lib/cjs/RadialTree.js +11 -11
  23. package/d3-chart/lib/cjs/ReferenceLine.js +9 -9
  24. package/d3-chart/lib/cjs/ScatterPlot.js +9 -9
  25. package/d3-chart/lib/cjs/Tooltip.js +9 -9
  26. package/d3-chart/lib/cjs/Venn.js +9 -9
  27. package/d3-chart/lib/cjs/a11y/PlotA11yModule.js +2 -2
  28. package/d3-chart/lib/cjs/a11y/PlotA11yView.js +2 -2
  29. package/d3-chart/lib/cjs/component/ChartLegend/LegendFlex/LegendFlex.js +4 -4
  30. package/d3-chart/lib/cjs/component/ChartLegend/LegendItem/LegendItem.js +17 -17
  31. package/d3-chart/lib/cjs/component/ChartLegend/LegendTable/LegendTable.js +6 -6
  32. package/d3-chart/lib/es6/Area.js +11 -11
  33. package/d3-chart/lib/es6/Axis.js +14 -14
  34. package/d3-chart/lib/es6/Bar.js +10 -10
  35. package/d3-chart/lib/es6/Bubble.js +12 -12
  36. package/d3-chart/lib/es6/Donut.js +9 -9
  37. package/d3-chart/lib/es6/Dots.js +8 -8
  38. package/d3-chart/lib/es6/HorizontalBar.js +10 -10
  39. package/d3-chart/lib/es6/Hover.js +3 -3
  40. package/d3-chart/lib/es6/Line.js +9 -9
  41. package/d3-chart/lib/es6/Plot.js +3 -3
  42. package/d3-chart/lib/es6/Radar.js +19 -19
  43. package/d3-chart/lib/es6/RadialTree.js +11 -11
  44. package/d3-chart/lib/es6/ReferenceLine.js +9 -9
  45. package/d3-chart/lib/es6/ScatterPlot.js +9 -9
  46. package/d3-chart/lib/es6/Tooltip.js +9 -9
  47. package/d3-chart/lib/es6/Venn.js +9 -9
  48. package/d3-chart/lib/es6/a11y/PlotA11yModule.js +2 -2
  49. package/d3-chart/lib/es6/a11y/PlotA11yView.js +2 -2
  50. package/d3-chart/lib/es6/component/ChartLegend/LegendFlex/LegendFlex.js +4 -4
  51. package/d3-chart/lib/es6/component/ChartLegend/LegendItem/LegendItem.js +17 -17
  52. package/d3-chart/lib/es6/component/ChartLegend/LegendTable/LegendTable.js +6 -6
  53. package/d3-chart/lib/types/component/ChartLegend/BaseLegend.type.d.ts +1 -0
  54. package/d3-chart/lib/types/component/ChartLegend/LegendFlex/LegendFlex.type.d.ts +1 -0
  55. package/package.json +4 -4
  56. package/utils/lib/ThemeProvider.js +14 -15
  57. package/utils/lib/ThemeProvider.js.map +1 -1
  58. package/utils/lib/ThemeProvider.mjs +12 -13
  59. package/utils/lib/ThemeProvider.mjs.map +1 -1
  60. package/utils/lib/addonTextChildren.js +1 -3
  61. package/utils/lib/addonTextChildren.js.map +1 -1
  62. package/utils/lib/addonTextChildren.mjs +1 -2
  63. package/utils/lib/addonTextChildren.mjs.map +1 -1
  64. package/utils/lib/assignProps.js +1 -1
  65. package/utils/lib/assignProps.js.map +1 -1
  66. package/utils/lib/assignProps.mjs +1 -1
  67. package/utils/lib/assignProps.mjs.map +1 -1
  68. package/utils/lib/components/invalid-state-pattern/InvalidStatePattern.d.ts +1 -1
  69. package/utils/lib/components/invalid-state-pattern/InvalidStatePattern.js +7 -7
  70. package/utils/lib/components/invalid-state-pattern/InvalidStatePattern.js.map +1 -1
  71. package/utils/lib/components/invalid-state-pattern/InvalidStatePattern.mjs +5 -7
  72. package/utils/lib/components/invalid-state-pattern/InvalidStatePattern.mjs.map +1 -1
  73. package/{core/lib/cjs → utils/lib/core}/enhancement/Children.js +2 -2
  74. package/utils/lib/core/enhancement/Children.js.map +1 -0
  75. package/{core/lib/es6/enhancement/Children.js → utils/lib/core/enhancement/Children.mjs} +2 -2
  76. package/utils/lib/core/enhancement/Children.mjs.map +1 -0
  77. package/{core/lib/cjs → utils/lib/core}/enhancement/Root.js +2 -2
  78. package/utils/lib/core/enhancement/Root.js.map +1 -0
  79. package/{core/lib/es6/enhancement/Root.js → utils/lib/core/enhancement/Root.mjs} +3 -5
  80. package/utils/lib/core/enhancement/Root.mjs.map +1 -0
  81. package/utils/lib/core/enhancement/bindHandler.js.map +1 -0
  82. package/{core/lib/es6/enhancement/bindHandler.js → utils/lib/core/enhancement/bindHandler.mjs} +1 -1
  83. package/utils/lib/core/enhancement/bindHandler.mjs.map +1 -0
  84. package/utils/lib/core/enhancement/dataName.js.map +1 -0
  85. package/{core/lib/es6/enhancement/dataName.js → utils/lib/core/enhancement/dataName.mjs} +1 -1
  86. package/utils/lib/core/enhancement/dataName.mjs.map +1 -0
  87. package/utils/lib/core/enhancement/enhance.js.map +1 -0
  88. package/{core/lib/es6/enhancement/enhance.js → utils/lib/core/enhancement/enhance.mjs} +1 -1
  89. package/utils/lib/core/enhancement/enhance.mjs.map +1 -0
  90. package/utils/lib/core/enhancement/functionDefaultProps.js.map +1 -0
  91. package/{core/lib/es6/enhancement/functionDefaultProps.js → utils/lib/core/enhancement/functionDefaultProps.mjs} +1 -1
  92. package/utils/lib/core/enhancement/functionDefaultProps.mjs.map +1 -0
  93. package/utils/lib/core/enhancement/hoistProps.js.map +1 -0
  94. package/{core/lib/es6/enhancement/hoistProps.js → utils/lib/core/enhancement/hoistProps.mjs} +1 -1
  95. package/utils/lib/core/enhancement/hoistProps.mjs.map +1 -0
  96. package/{core/lib/cjs → utils/lib/core}/enhancement/i18n.js +1 -1
  97. package/utils/lib/core/enhancement/i18n.js.map +1 -0
  98. package/{core/lib/es6/enhancement/i18n.js → utils/lib/core/enhancement/i18n.mjs} +2 -3
  99. package/utils/lib/core/enhancement/i18n.mjs.map +1 -0
  100. package/utils/lib/core/enhancement/inheritedName.js.map +1 -0
  101. package/{core/lib/es6/enhancement/inheritedName.js → utils/lib/core/enhancement/inheritedName.mjs} +1 -1
  102. package/utils/lib/core/enhancement/inheritedName.mjs.map +1 -0
  103. package/{core/lib/cjs → utils/lib/core}/enhancement/staticChildren.js +3 -9
  104. package/utils/lib/core/enhancement/staticChildren.js.map +1 -0
  105. package/{core/lib/es6/enhancement/staticChildren.js → utils/lib/core/enhancement/staticChildren.mjs} +4 -7
  106. package/utils/lib/core/enhancement/staticChildren.mjs.map +1 -0
  107. package/utils/lib/core/enhancement/style.js.map +1 -0
  108. package/{core/lib/es6/enhancement/style.js → utils/lib/core/enhancement/style.mjs} +3 -4
  109. package/utils/lib/core/enhancement/style.mjs.map +1 -0
  110. package/{core/lib/cjs → utils/lib/core}/enhancement/uncontrolledProps.js +2 -6
  111. package/utils/lib/core/enhancement/uncontrolledProps.js.map +1 -0
  112. package/{core/lib/es6/enhancement/uncontrolledProps.js → utils/lib/core/enhancement/uncontrolledProps.mjs} +3 -5
  113. package/utils/lib/core/enhancement/uncontrolledProps.mjs.map +1 -0
  114. package/utils/lib/core/index.d.ts +35 -0
  115. package/utils/lib/core/index.js +457 -0
  116. package/utils/lib/core/index.js.map +1 -0
  117. package/utils/lib/core/index.mjs +348 -0
  118. package/utils/lib/core/index.mjs.map +1 -0
  119. package/utils/lib/core/register.js.map +1 -0
  120. package/{core/lib/es6/register.js → utils/lib/core/register.mjs} +1 -1
  121. package/utils/lib/core/register.mjs.map +1 -0
  122. package/{core/lib/types → utils/lib/core}/styled/index.d.ts +2 -1
  123. package/utils/lib/core/styled/index.js.map +1 -0
  124. package/{core/lib/es6/styled/index.js → utils/lib/core/styled/index.mjs} +2 -2
  125. package/utils/lib/core/styled/index.mjs.map +1 -0
  126. package/utils/lib/core/styled/sstyled.js.map +1 -0
  127. package/{core/lib/es6/styled/sstyled.js → utils/lib/core/styled/sstyled.mjs} +1 -1
  128. package/utils/lib/core/styled/sstyled.mjs.map +1 -0
  129. package/{core → utils/lib/core/types}/Component.d.ts +14 -2
  130. package/{core/lib/cjs → utils/lib/core/types}/Component.js +1 -0
  131. package/utils/lib/core/types/Component.js.map +1 -0
  132. package/{core/lib/es6/Component.js → utils/lib/core/types/Component.mjs} +5 -1
  133. package/utils/lib/core/types/Component.mjs.map +1 -0
  134. package/utils/lib/core/types/UnknownProperties.d.ts +3 -0
  135. package/utils/lib/core/types/UnknownProperties.js +2 -0
  136. package/utils/lib/core/types/UnknownProperties.js.map +1 -0
  137. package/utils/lib/core/types/UnknownProperties.mjs +2 -0
  138. package/utils/lib/core/types/UnknownProperties.mjs.map +1 -0
  139. package/utils/lib/core/types/index.d.ts +3 -0
  140. package/utils/lib/core/types/index.js +28 -0
  141. package/utils/lib/core/types/index.js.map +1 -0
  142. package/utils/lib/core/types/index.mjs +4 -0
  143. package/utils/lib/core/types/index.mjs.map +1 -0
  144. package/utils/lib/core/types/reshadow.d.js.map +1 -0
  145. package/utils/lib/core/types/reshadow.d.mjs +2 -0
  146. package/utils/lib/core/types/reshadow.d.mjs.map +1 -0
  147. package/utils/lib/core/types/symbols.d.ts +7 -0
  148. package/utils/lib/core/types/symbols.js +21 -0
  149. package/utils/lib/core/types/symbols.js.map +1 -0
  150. package/utils/lib/core/types/symbols.mjs +8 -0
  151. package/utils/lib/core/types/symbols.mjs.map +1 -0
  152. package/utils/lib/enhances/WithAutoFocus.d.ts +1 -1
  153. package/utils/lib/enhances/WithAutoFocus.js.map +1 -1
  154. package/utils/lib/enhances/WithAutoFocus.mjs.map +1 -1
  155. package/utils/lib/enhances/WithCSS.d.ts +1 -1
  156. package/utils/lib/enhances/WithCSS.js.map +1 -1
  157. package/utils/lib/enhances/WithCSS.mjs.map +1 -1
  158. package/utils/lib/enhances/WithI18n.d.ts +1 -1
  159. package/utils/lib/enhances/WithI18n.js.map +1 -1
  160. package/utils/lib/enhances/WithI18n.mjs.map +1 -1
  161. package/utils/lib/enhances/WithKeyboardFocus.d.ts +1 -1
  162. package/utils/lib/enhances/WithKeyboardFocus.js.map +1 -1
  163. package/utils/lib/enhances/WithKeyboardFocus.mjs.map +1 -1
  164. package/utils/lib/enhances/animatedSizeEnhance.d.ts +1 -1
  165. package/utils/lib/enhances/animatedSizeEnhance.js.map +1 -1
  166. package/utils/lib/enhances/animatedSizeEnhance.mjs.map +1 -1
  167. package/utils/lib/enhances/autoFocusEnhance.d.ts +1 -1
  168. package/utils/lib/enhances/autoFocusEnhance.js.map +1 -1
  169. package/utils/lib/enhances/autoFocusEnhance.mjs.map +1 -1
  170. package/utils/lib/enhances/i18nEnhance.d.ts +1 -1
  171. package/utils/lib/enhances/i18nEnhance.js.map +1 -1
  172. package/utils/lib/enhances/i18nEnhance.mjs.map +1 -1
  173. package/utils/lib/enhances/keyboardFocusEnhance.d.ts +1 -1
  174. package/utils/lib/enhances/keyboardFocusEnhance.js.map +1 -1
  175. package/utils/lib/enhances/keyboardFocusEnhance.mjs.map +1 -1
  176. package/utils/lib/findComponent.js +1 -3
  177. package/utils/lib/findComponent.js.map +1 -1
  178. package/utils/lib/findComponent.mjs +1 -2
  179. package/utils/lib/findComponent.mjs.map +1 -1
  180. package/utils/lib/getOriginChildren.js +1 -3
  181. package/utils/lib/getOriginChildren.js.map +1 -1
  182. package/utils/lib/getOriginChildren.mjs +1 -2
  183. package/utils/lib/getOriginChildren.mjs.map +1 -1
  184. package/utils/lib/if.d.ts +1 -1
  185. package/utils/lib/if.js.map +1 -1
  186. package/utils/lib/if.mjs.map +1 -1
  187. package/utils/lib/reshadow.d.ts +4 -0
  188. package/utils/lib/uniqueID.d.ts +1 -1
  189. package/utils/lib/uniqueID.js +1 -3
  190. package/utils/lib/uniqueID.js.map +1 -1
  191. package/utils/lib/uniqueID.mjs +1 -2
  192. package/utils/lib/uniqueID.mjs.map +1 -1
  193. package/core/lib/cjs/Component.js.map +0 -1
  194. package/core/lib/cjs/enhancement/Children.js.map +0 -1
  195. package/core/lib/cjs/enhancement/Root.js.map +0 -1
  196. package/core/lib/cjs/enhancement/bindHandler.js.map +0 -1
  197. package/core/lib/cjs/enhancement/dataName.js.map +0 -1
  198. package/core/lib/cjs/enhancement/enhance.js.map +0 -1
  199. package/core/lib/cjs/enhancement/functionDefaultProps.js.map +0 -1
  200. package/core/lib/cjs/enhancement/hoistProps.js.map +0 -1
  201. package/core/lib/cjs/enhancement/i18n.js.map +0 -1
  202. package/core/lib/cjs/enhancement/inheritedName.js.map +0 -1
  203. package/core/lib/cjs/enhancement/staticChildren.js.map +0 -1
  204. package/core/lib/cjs/enhancement/style.js.map +0 -1
  205. package/core/lib/cjs/enhancement/uncontrolledProps.js.map +0 -1
  206. package/core/lib/cjs/register.js.map +0 -1
  207. package/core/lib/cjs/reshadow.d.js.map +0 -1
  208. package/core/lib/cjs/styled/index.js.map +0 -1
  209. package/core/lib/cjs/styled/sstyled.js.map +0 -1
  210. package/core/lib/es6/Component.js.map +0 -1
  211. package/core/lib/es6/enhancement/Children.js.map +0 -1
  212. package/core/lib/es6/enhancement/Root.js.map +0 -1
  213. package/core/lib/es6/enhancement/bindHandler.js.map +0 -1
  214. package/core/lib/es6/enhancement/dataName.js.map +0 -1
  215. package/core/lib/es6/enhancement/enhance.js.map +0 -1
  216. package/core/lib/es6/enhancement/functionDefaultProps.js.map +0 -1
  217. package/core/lib/es6/enhancement/hoistProps.js.map +0 -1
  218. package/core/lib/es6/enhancement/i18n.js.map +0 -1
  219. package/core/lib/es6/enhancement/inheritedName.js.map +0 -1
  220. package/core/lib/es6/enhancement/staticChildren.js.map +0 -1
  221. package/core/lib/es6/enhancement/style.js.map +0 -1
  222. package/core/lib/es6/enhancement/uncontrolledProps.js.map +0 -1
  223. package/core/lib/es6/register.js.map +0 -1
  224. package/core/lib/es6/reshadow.d.js +0 -2
  225. package/core/lib/es6/reshadow.d.js.map +0 -1
  226. package/core/lib/es6/styled/index.js.map +0 -1
  227. package/core/lib/es6/styled/sstyled.js.map +0 -1
  228. package/core/lib/types/Component.d.ts +0 -152
  229. package/core/lib/types/enhancement/Children.d.ts +0 -6
  230. package/core/lib/types/enhancement/Root.d.ts +0 -6
  231. package/core/lib/types/enhancement/bindHandler.d.ts +0 -5
  232. package/core/lib/types/enhancement/dataName.d.ts +0 -4
  233. package/core/lib/types/enhancement/enhance.d.ts +0 -5
  234. package/core/lib/types/enhancement/functionDefaultProps.d.ts +0 -8
  235. package/core/lib/types/enhancement/hoistProps.d.ts +0 -10
  236. package/core/lib/types/enhancement/i18n.d.ts +0 -4
  237. package/core/lib/types/enhancement/inheritedName.d.ts +0 -8
  238. package/core/lib/types/enhancement/staticChildren.d.ts +0 -13
  239. package/core/lib/types/enhancement/style.d.ts +0 -9
  240. package/core/lib/types/enhancement/uncontrolledProps.d.ts +0 -7
  241. package/core/register.d.ts +0 -8
  242. package/core/styled/index.d.ts +0 -14
  243. package/core/styled/sstyled.d.ts +0 -17
  244. /package/{core → utils/lib/core}/enhancement/Children.d.ts +0 -0
  245. /package/{core → utils/lib/core}/enhancement/Root.d.ts +0 -0
  246. /package/{core → utils/lib/core}/enhancement/bindHandler.d.ts +0 -0
  247. /package/{core/lib/cjs → utils/lib/core}/enhancement/bindHandler.js +0 -0
  248. /package/{core → utils/lib/core}/enhancement/dataName.d.ts +0 -0
  249. /package/{core/lib/cjs → utils/lib/core}/enhancement/dataName.js +0 -0
  250. /package/{core → utils/lib/core}/enhancement/enhance.d.ts +0 -0
  251. /package/{core/lib/cjs → utils/lib/core}/enhancement/enhance.js +0 -0
  252. /package/{core → utils/lib/core}/enhancement/functionDefaultProps.d.ts +0 -0
  253. /package/{core/lib/cjs → utils/lib/core}/enhancement/functionDefaultProps.js +0 -0
  254. /package/{core → utils/lib/core}/enhancement/hoistProps.d.ts +0 -0
  255. /package/{core/lib/cjs → utils/lib/core}/enhancement/hoistProps.js +0 -0
  256. /package/{core → utils/lib/core}/enhancement/i18n.d.ts +0 -0
  257. /package/{core → utils/lib/core}/enhancement/inheritedName.d.ts +0 -0
  258. /package/{core/lib/cjs → utils/lib/core}/enhancement/inheritedName.js +0 -0
  259. /package/{core → utils/lib/core}/enhancement/staticChildren.d.ts +0 -0
  260. /package/{core → utils/lib/core}/enhancement/style.d.ts +0 -0
  261. /package/{core/lib/cjs → utils/lib/core}/enhancement/style.js +0 -0
  262. /package/{core → utils/lib/core}/enhancement/uncontrolledProps.d.ts +0 -0
  263. /package/{core/lib/types → utils/lib/core}/register.d.ts +0 -0
  264. /package/{core/lib/cjs → utils/lib/core}/register.js +0 -0
  265. /package/{core/lib/cjs → utils/lib/core}/styled/index.js +0 -0
  266. /package/{core/lib/types → utils/lib/core}/styled/sstyled.d.ts +0 -0
  267. /package/{core/lib/cjs → utils/lib/core}/styled/sstyled.js +0 -0
  268. /package/{core/lib/cjs → utils/lib/core/types}/reshadow.d.js +0 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Component.mjs","names":["PureComponent","CORE_COMPONENT","CREATE_COMPONENT","Root","undefined","RootComponent","_PureComponent","_inherits","_super","_createSuper","_this","_classCallCheck","_len","arguments","length","args","Array","_key","call","apply","concat","_defineProperty","_assertThisInitialized","_createClass","key","get","Component","Intergalactic","_Intergalactic","InternalTypings","_InternalTypings","wrapIntergalacticComponent","wrapper"],"sources":["../../../src/core/types/Component.ts"],"sourcesContent":["import React, {\n AllHTMLAttributes,\n ForwardRefExoticComponent,\n PureComponent,\n ReactNode,\n RefAttributes,\n RefObject,\n} from 'react';\nimport { IStyledProps } from '../styled';\nimport { CORE_COMPONENT, CREATE_COMPONENT } from './symbols';\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\nexport type PropsAndRef<T, Ctx, UCProps> = PropsWithRenderFnChildren<T, Ctx, UCProps> &\n RefAttributes<unknown>;\nexport type ForwardRefComponent<T, Ctx, UCProps> = ForwardRefExoticComponent<\n PropsAndRef<T, Ctx, UCProps>\n>;\ntype ComponentOrProps<T, Context, UCProps> = T extends [infer ParentProps, infer ChildProps]\n ? ComponentType<ParentProps, ChildProps, Context, UCProps>\n : ForwardRefComponent<T, Context, UCProps>;\n\nexport type ComponentType<\n ComponentProps,\n ChildComponentProps = {},\n ContextType = {},\n UCProps = {},\n FNType = null,\n> = (FNType extends null\n ? ForwardRefComponent<ComponentProps, ContextType, UCProps>\n : FNType & { displayName: string }) & {\n [K in keyof ChildComponentProps]: ComponentOrProps<ChildComponentProps[K], ContextType, UCProps>;\n} & {\n [CORE_COMPONENT]: boolean;\n [CREATE_COMPONENT]: () => ComponentType<\n ComponentProps,\n ChildComponentProps,\n ContextType,\n UCProps\n >;\n};\n"],"mappings":";;;;;;AAAA,SAGEA,aAAa,QAIR,OAAO;AAEd,SAASC,cAAc,EAAEC,gBAAgB,QAAQ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AA0BA,CAIrCC,OAKoB;EAAA,OAMjBA,OAAO;AAAA,CAAO"}
@@ -0,0 +1,3 @@
1
+ export type UnknownProperties = {
2
+ [key: string]: unknown;
3
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ //# sourceMappingURL=UnknownProperties.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"UnknownProperties.js","names":[],"sources":["../../../src/core/types/UnknownProperties.ts"],"sourcesContent":["export type UnknownProperties = {\n [key: string]: unknown;\n};\n"],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=UnknownProperties.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"UnknownProperties.mjs","names":[],"sources":["../../../src/core/types/UnknownProperties.ts"],"sourcesContent":["export type UnknownProperties = {\n [key: string]: unknown;\n};\n"],"mappings":""}
@@ -0,0 +1,3 @@
1
+ import { UnknownProperties } from './UnknownProperties';
2
+ export * from './Component';
3
+ export { UnknownProperties };
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ var _exportNames = {
7
+ UnknownProperties: true
8
+ };
9
+ Object.defineProperty(exports, "UnknownProperties", {
10
+ enumerable: true,
11
+ get: function get() {
12
+ return _UnknownProperties.UnknownProperties;
13
+ }
14
+ });
15
+ var _UnknownProperties = require("./UnknownProperties");
16
+ var _Component = require("./Component");
17
+ Object.keys(_Component).forEach(function (key) {
18
+ if (key === "default" || key === "__esModule") return;
19
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
20
+ if (key in exports && exports[key] === _Component[key]) return;
21
+ Object.defineProperty(exports, key, {
22
+ enumerable: true,
23
+ get: function get() {
24
+ return _Component[key];
25
+ }
26
+ });
27
+ });
28
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":["_UnknownProperties","require","_Component","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","defineProperty","enumerable","get"],"sources":["../../../src/core/types/index.ts"],"sourcesContent":["import { UnknownProperties } from './UnknownProperties';\n\nexport * from './Component';\n\nexport { UnknownProperties };\n"],"mappings":";;;;;;;;;;;;;;AAAA,IAAAA,kBAAA,GAAAC,OAAA;AAEA,IAAAC,UAAA,GAAAD,OAAA;AAAAE,MAAA,CAAAC,IAAA,CAAAF,UAAA,EAAAG,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,EAAAJ,GAAA;EAAA,IAAAA,GAAA,IAAAK,OAAA,IAAAA,OAAA,CAAAL,GAAA,MAAAJ,UAAA,CAAAI,GAAA;EAAAH,MAAA,CAAAS,cAAA,CAAAD,OAAA,EAAAL,GAAA;IAAAO,UAAA;IAAAC,GAAA,WAAAA,IAAA;MAAA,OAAAZ,UAAA,CAAAI,GAAA;IAAA;EAAA;AAAA"}
@@ -0,0 +1,4 @@
1
+ import { UnknownProperties } from "./UnknownProperties.mjs";
2
+ export * from "./Component.mjs";
3
+ export { UnknownProperties };
4
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.mjs","names":["UnknownProperties"],"sources":["../../../src/core/types/index.ts"],"sourcesContent":["import { UnknownProperties } from './UnknownProperties';\n\nexport * from './Component';\n\nexport { UnknownProperties };\n"],"mappings":"AAAA,SAASA,iBAAiB,QAAQ,yBAAqB;AAEvD,cAAc,iBAAa;AAE3B,SAASA,iBAAiB"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reshadow.d.js","names":[],"sources":["../../../src/core/types/reshadow.d.ts"],"sourcesContent":["declare module 'hoist-non-react-statics' {\n const hoistNonReactStatics: any;\n export default hoistNonReactStatics;\n}\n"],"mappings":""}
@@ -0,0 +1,2 @@
1
+
2
+ //# sourceMappingURL=reshadow.d.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reshadow.d.mjs","names":[],"sources":["../../../src/core/types/reshadow.d.ts"],"sourcesContent":["declare module 'hoist-non-react-statics' {\n const hoistNonReactStatics: any;\n export default hoistNonReactStatics;\n}\n"],"mappings":""}
@@ -0,0 +1,7 @@
1
+ export declare const CORE_COMPONENT: unique symbol;
2
+ export declare const CORE_INSTANCE: unique symbol;
3
+ export declare const CORE_AS_PROPS: unique symbol;
4
+ export declare const CORE_INIT: unique symbol;
5
+ export declare const CONTEXT_COMPONENT: unique symbol;
6
+ export declare const CREATE_COMPONENT: unique symbol;
7
+ export declare const PARENT_COMPONENTS: unique symbol;
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.PARENT_COMPONENTS = exports.CREATE_COMPONENT = exports.CORE_INSTANCE = exports.CORE_INIT = exports.CORE_COMPONENT = exports.CORE_AS_PROPS = exports.CONTEXT_COMPONENT = void 0;
7
+ var CORE_COMPONENT = Symbol('CORE_COMPONENT');
8
+ exports.CORE_COMPONENT = CORE_COMPONENT;
9
+ var CORE_INSTANCE = Symbol('CORE_INSTANCE');
10
+ exports.CORE_INSTANCE = CORE_INSTANCE;
11
+ var CORE_AS_PROPS = Symbol('CORE_AS_PROPS');
12
+ exports.CORE_AS_PROPS = CORE_AS_PROPS;
13
+ var CORE_INIT = Symbol('CORE_INIT');
14
+ exports.CORE_INIT = CORE_INIT;
15
+ var CONTEXT_COMPONENT = Symbol('CONTEXT_COMPONENT');
16
+ exports.CONTEXT_COMPONENT = CONTEXT_COMPONENT;
17
+ var CREATE_COMPONENT = Symbol('CREATE_COMPONENT');
18
+ exports.CREATE_COMPONENT = CREATE_COMPONENT;
19
+ var PARENT_COMPONENTS = Symbol('PARENT_COMPONENTS');
20
+ exports.PARENT_COMPONENTS = PARENT_COMPONENTS;
21
+ //# sourceMappingURL=symbols.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"symbols.js","names":["CORE_COMPONENT","Symbol","exports","CORE_INSTANCE","CORE_AS_PROPS","CORE_INIT","CONTEXT_COMPONENT","CREATE_COMPONENT","PARENT_COMPONENTS"],"sources":["../../../src/core/types/symbols.ts"],"sourcesContent":["export const CORE_COMPONENT = Symbol('CORE_COMPONENT');\nexport const CORE_INSTANCE = Symbol('CORE_INSTANCE');\nexport const CORE_AS_PROPS = Symbol('CORE_AS_PROPS');\nexport const CORE_INIT = Symbol('CORE_INIT');\nexport const CONTEXT_COMPONENT = Symbol('CONTEXT_COMPONENT');\nexport const CREATE_COMPONENT = Symbol('CREATE_COMPONENT');\nexport const PARENT_COMPONENTS = Symbol('PARENT_COMPONENTS');\n"],"mappings":";;;;;;AAAO,IAAMA,cAAc,GAAGC,MAAM,CAAC,gBAAgB,CAAC;AAACC,OAAA,CAAAF,cAAA,GAAAA,cAAA;AAChD,IAAMG,aAAa,GAAGF,MAAM,CAAC,eAAe,CAAC;AAACC,OAAA,CAAAC,aAAA,GAAAA,aAAA;AAC9C,IAAMC,aAAa,GAAGH,MAAM,CAAC,eAAe,CAAC;AAACC,OAAA,CAAAE,aAAA,GAAAA,aAAA;AAC9C,IAAMC,SAAS,GAAGJ,MAAM,CAAC,WAAW,CAAC;AAACC,OAAA,CAAAG,SAAA,GAAAA,SAAA;AACtC,IAAMC,iBAAiB,GAAGL,MAAM,CAAC,mBAAmB,CAAC;AAACC,OAAA,CAAAI,iBAAA,GAAAA,iBAAA;AACtD,IAAMC,gBAAgB,GAAGN,MAAM,CAAC,kBAAkB,CAAC;AAACC,OAAA,CAAAK,gBAAA,GAAAA,gBAAA;AACpD,IAAMC,iBAAiB,GAAGP,MAAM,CAAC,mBAAmB,CAAC;AAACC,OAAA,CAAAM,iBAAA,GAAAA,iBAAA"}
@@ -0,0 +1,8 @@
1
+ export var CORE_COMPONENT = Symbol('CORE_COMPONENT');
2
+ export var CORE_INSTANCE = Symbol('CORE_INSTANCE');
3
+ export var CORE_AS_PROPS = Symbol('CORE_AS_PROPS');
4
+ export var CORE_INIT = Symbol('CORE_INIT');
5
+ export var CONTEXT_COMPONENT = Symbol('CONTEXT_COMPONENT');
6
+ export var CREATE_COMPONENT = Symbol('CREATE_COMPONENT');
7
+ export var PARENT_COMPONENTS = Symbol('PARENT_COMPONENTS');
8
+ //# sourceMappingURL=symbols.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"symbols.mjs","names":["CORE_COMPONENT","Symbol","CORE_INSTANCE","CORE_AS_PROPS","CORE_INIT","CONTEXT_COMPONENT","CREATE_COMPONENT","PARENT_COMPONENTS"],"sources":["../../../src/core/types/symbols.ts"],"sourcesContent":["export const CORE_COMPONENT = Symbol('CORE_COMPONENT');\nexport const CORE_INSTANCE = Symbol('CORE_INSTANCE');\nexport const CORE_AS_PROPS = Symbol('CORE_AS_PROPS');\nexport const CORE_INIT = Symbol('CORE_INIT');\nexport const CONTEXT_COMPONENT = Symbol('CONTEXT_COMPONENT');\nexport const CREATE_COMPONENT = Symbol('CREATE_COMPONENT');\nexport const PARENT_COMPONENTS = Symbol('PARENT_COMPONENTS');\n"],"mappings":"AAAA,OAAO,IAAMA,cAAc,GAAGC,MAAM,CAAC,gBAAgB,CAAC;AACtD,OAAO,IAAMC,aAAa,GAAGD,MAAM,CAAC,eAAe,CAAC;AACpD,OAAO,IAAME,aAAa,GAAGF,MAAM,CAAC,eAAe,CAAC;AACpD,OAAO,IAAMG,SAAS,GAAGH,MAAM,CAAC,WAAW,CAAC;AAC5C,OAAO,IAAMI,iBAAiB,GAAGJ,MAAM,CAAC,mBAAmB,CAAC;AAC5D,OAAO,IAAMK,gBAAgB,GAAGL,MAAM,CAAC,kBAAkB,CAAC;AAC1D,OAAO,IAAMM,iBAAiB,GAAGN,MAAM,CAAC,mBAAmB,CAAC"}
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { UnknownProperties } from 'intergalactic/core';
2
+ import { UnknownProperties } from '../core';
3
3
  /** @deprecated */
4
4
  export interface IEnhancedWithAutoFocusProps extends EnhancedWithAutoFocusProps, UnknownProperties {
5
5
  }
@@ -1 +1 @@
1
- {"version":3,"file":"WithAutoFocus.js","names":["_react","require","_reactDom","_createHoc","_interopRequireDefault","EnhancedWithAutoFocus","_PureComponent","_inherits2","_super","_createSuper2","_this","_classCallCheck2","_len","arguments","length","args","Array","_key","call","apply","concat","_defineProperty2","_assertThisInitialized2","_createClass2","key","value","notUsingNativeAutoFocus","autoFocus","props","componentDidMount","node","findDOMNode","timer","setTimeout","focus","componentWillUnmount","clearTimeout","render","_ref","children","undefined","PureComponent","_default","createHoc","exports"],"sources":["../../src/enhances/WithAutoFocus.tsx"],"sourcesContent":["import React, { PureComponent } from 'react';\nimport { findDOMNode } from 'react-dom';\nimport createHoc from '../createHoc';\nimport { UnknownProperties, Intergalactic } from '@semcore/core';\n\n/** @deprecated */\nexport interface IEnhancedWithAutoFocusProps\n extends EnhancedWithAutoFocusProps,\n UnknownProperties {}\nexport type EnhancedWithAutoFocusProps = {\n /**\n * @default undefined\n */\n autoFocus?: string | number | boolean;\n children?: (props: IEnhancedWithAutoFocusProps) => React.ReactNode;\n};\n\nclass EnhancedWithAutoFocus extends PureComponent<IEnhancedWithAutoFocusProps> {\n static displayName = 'EnhancedWithAutoFocus';\n\n static defaultProps = {\n autoFocus: undefined,\n };\n\n private timer: ReturnType<typeof setTimeout> | undefined;\n\n notUsingNativeAutoFocus() {\n const { autoFocus } = this.props;\n return typeof autoFocus === 'boolean' || typeof autoFocus === 'number';\n }\n\n componentDidMount() {\n if (this.notUsingNativeAutoFocus()) {\n const { autoFocus } = this.props;\n if (autoFocus === false) return;\n const node = findDOMNode(this);\n if (!node) return;\n //@ts-ignore\n this.timer = setTimeout(() => node.focus(), (autoFocus as number) || 0);\n }\n }\n\n componentWillUnmount() {\n clearTimeout(this.timer);\n }\n\n render() {\n const { children } = this.props as any;\n const props = {} as IEnhancedWithAutoFocusProps;\n if (this.notUsingNativeAutoFocus()) {\n props.autoFocus = undefined;\n }\n return children(props);\n }\n}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IAAI,CAACD,IAAI,EAAE;QACX;QACA,IAAI,CAACE,KAAK,GAAGC,UAAU,CAAC;UAAA,OAAMH,IAAI,CAACI,KAAK,EAAE;QAAA,GAAGP,SAAS,IAAe,CAAC,CAAC;MACzE;IACF;EAAC;IAAAH,GAAA;IAAAC,KAAA,EAED,SAAAU,qBAAA,EAAuB;MACrBC,YAAY,CAAC,IAAI,CAACJ,KAAK,CAAC;IAC1B;EAAC;IAAAR,GAAA;IAAAC,KAAA,EAED,SAAAY,OAAA,EAAS;MACP,IAAAC,IAAA,GAAqB,IAAI,CAACV,KAAK;QAAvBW,QAAQ,GAAAD,IAAA,CAARC,QAAQ;MAChB,IAAMX,KAAK,GAAG,CAAC,CAAgC;MAC/C,IAAI,IAAI,CAACF,uBAAuB,EAAE,EAAE;QAClCE,KAAK,CAACD,SAAS,GAAGa,SAAS;MAC7B;MACA,OAAOD,QAAQ,CAACX,KAAK,CAAC;IACxB;EAAC;EAAA,OAAAvB,qBAAA;AAAA,EApCiCoC,oBAAa;AAAA,IAAApB,gBAAA,aAA3ChB,qBAAqB,iBACJ,uBAAuB;AAAA,IAAAgB,gBAAA,aADxChB,qBAAqB,kBAGH;EACpBsB,SAAS,EAAEa;AACb,CAAC;AAAA,IAAAE,QAAA,GAkCY,IAAAC,qBAAS,EAACtC,qBAAqB,CAAC;AAAAuC,OAAA,cAAAF,QAAA"}
1
+ {"version":3,"file":"WithAutoFocus.js","names":["_react","require","_reactDom","_createHoc","_interopRequireDefault","EnhancedWithAutoFocus","_PureComponent","_inherits2","_super","_createSuper2","_this","_classCallCheck2","_len","arguments","length","args","Array","_key","call","apply","concat","_defineProperty2","_assertThisInitialized2","_createClass2","key","value","notUsingNativeAutoFocus","autoFocus","props","componentDidMount","node","findDOMNode","timer","setTimeout","focus","componentWillUnmount","clearTimeout","render","_ref","children","undefined","PureComponent","_default","createHoc","exports"],"sources":["../../src/enhances/WithAutoFocus.tsx"],"sourcesContent":["import React, { PureComponent } from 'react';\nimport { findDOMNode } from 'react-dom';\nimport createHoc from '../createHoc';\nimport { UnknownProperties } from '../core';\n\n/** @deprecated */\nexport interface IEnhancedWithAutoFocusProps\n extends EnhancedWithAutoFocusProps,\n UnknownProperties {}\nexport type EnhancedWithAutoFocusProps = {\n /**\n * @default undefined\n */\n autoFocus?: string | number | boolean;\n children?: (props: IEnhancedWithAutoFocusProps) => React.ReactNode;\n};\n\nclass EnhancedWithAutoFocus extends PureComponent<IEnhancedWithAutoFocusProps> {\n static displayName = 'EnhancedWithAutoFocus';\n\n static defaultProps = {\n autoFocus: undefined,\n };\n\n private timer: ReturnType<typeof setTimeout> | undefined;\n\n notUsingNativeAutoFocus() {\n const { autoFocus } = this.props;\n return typeof autoFocus === 'boolean' || typeof autoFocus === 'number';\n }\n\n componentDidMount() {\n if (this.notUsingNativeAutoFocus()) {\n const { autoFocus } = this.props;\n if (autoFocus === false) return;\n const node = findDOMNode(this);\n if (!node) return;\n //@ts-ignore\n this.timer = setTimeout(() => node.focus(), (autoFocus as number) || 0);\n }\n }\n\n componentWillUnmount() {\n clearTimeout(this.timer);\n }\n\n render() {\n const { children } = this.props as any;\n const props = {} as IEnhancedWithAutoFocusProps;\n if (this.notUsingNativeAutoFocus()) {\n props.autoFocus = undefined;\n }\n return children(props);\n }\n}\n\nexport default createHoc(EnhancedWithAutoFocus);\n"],"mappings":";;;;;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AACA,IAAAE,UAAA,GAAAC,sBAAA,CAAAH,OAAA;AAAqC,IAe/BI,qBAAqB,0BAAAC,cAAA;EAAA,IAAAC,UAAA,aAAAF,qBAAA,EAAAC,cAAA;EAAA,IAAAE,MAAA,OAAAC,aAAA,aAAAJ,qBAAA;EAAA,SAAAA,sBAAA;IAAA,IAAAK,KAAA;IAAA,IAAAC,gBAAA,mBAAAN,qBAAA;IAAA,SAAAO,IAAA,GAAAC,SAAA,CAAAC,MAAA,EAAAC,IAAA,OAA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,CAAgC;MAC/C,IAAI,IAAI,CAACF,uBAAuB,EAAE,EAAE;QAClCE,KAAK,CAACD,SAAS,GAAGa,SAAS;MAC7B;MACA,OAAOD,QAAQ,CAACX,KAAK,CAAC;IACxB;EAAC;EAAA,OAAAvB,qBAAA;AAAA,EApCiCoC,oBAAa;AAAA,IAAApB,gBAAA,aAA3ChB,qBAAqB,iBACJ,uBAAuB;AAAA,IAAAgB,gBAAA,aADxChB,qBAAqB,kBAGH;EACpBsB,SAAS,EAAEa;AACb,CAAC;AAAA,IAAAE,QAAA,GAkCY,IAAAC,qBAAS,EAACtC,qBAAqB,CAAC;AAAAuC,OAAA,cAAAF,QAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"WithAutoFocus.mjs","names":["PureComponent","findDOMNode","createHoc","EnhancedWithAutoFocus","_PureComponent","_inherits","_super","_createSuper","_this","_classCallCheck","_len","arguments","length","args","Array","_key","call","apply","concat","_defineProperty","_assertThisInitialized","_createClass","key","value","notUsingNativeAutoFocus","autoFocus","props","componentDidMount","node","timer","setTimeout","focus","componentWillUnmount","clearTimeout","render","_ref","children","undefined"],"sources":["../../src/enhances/WithAutoFocus.tsx"],"sourcesContent":["import React, { PureComponent } from 'react';\nimport { findDOMNode } from 'react-dom';\nimport createHoc from '../createHoc';\nimport { UnknownProperties, Intergalactic } from '@semcore/core';\n\n/** @deprecated */\nexport interface IEnhancedWithAutoFocusProps\n extends EnhancedWithAutoFocusProps,\n UnknownProperties {}\nexport type EnhancedWithAutoFocusProps = {\n /**\n * @default undefined\n */\n autoFocus?: string | number | boolean;\n children?: (props: IEnhancedWithAutoFocusProps) => React.ReactNode;\n};\n\nclass EnhancedWithAutoFocus extends PureComponent<IEnhancedWithAutoFocusProps> {\n static displayName = 'EnhancedWithAutoFocus';\n\n static defaultProps = {\n autoFocus: undefined,\n };\n\n private timer: ReturnType<typeof setTimeout> | undefined;\n\n notUsingNativeAutoFocus() {\n const { autoFocus } = this.props;\n return typeof autoFocus === 'boolean' || typeof autoFocus === 'number';\n }\n\n componentDidMount() {\n if (this.notUsingNativeAutoFocus()) {\n const { autoFocus } = this.props;\n if (autoFocus === false) return;\n const node = findDOMNode(this);\n if (!node) return;\n //@ts-ignore\n this.timer = setTimeout(() => node.focus(), (autoFocus as number) || 0);\n }\n }\n\n componentWillUnmount() {\n clearTimeout(this.timer);\n }\n\n render() {\n const { children } = this.props as any;\n const props = {} as IEnhancedWithAutoFocusProps;\n if (this.notUsingNativeAutoFocus()) {\n props.autoFocus = undefined;\n }\n return children(props);\n }\n}\n\nexport default createHoc(EnhancedWithAutoFocus);\n"],"mappings":";;;;;;AAAA,SAAgBA,aAAa,QAAQ,OAAO;AAC5C,SAASC,WAAW,QAAQ,WAAW;AACvC,OAAOC,SAAS,MAAM,kBAAc;AAAC,IAe/BC,qBAAqB,0BAAAC,cAAA;EAAAC,SAAA,CAAAF,qBAAA,EAAAC,cAAA;EAAA,IAAAE,MAAA,GAAAC,YAAA,CAAAJ,qBAAA;EAAA,SAAAA,sBAAA;IAAA,IAAAK,KAAA;IAAAC,eAAA,OAAAN,qBAAA;IAAA,SAAAO,IAAA,GAAAC,SAAA,CAAAC,MAAA,EAAAC,IAAA,OAAAC,KAAA,CAAAJ,IAAA,GAAAK,IAAA,MAAAA,IAAA,GAAAL,IAAA,EAAAK,IAAA;MAAAF,IAAA,CAAAE,IAAA,IAAAJ,SAAA,CAAAI,IAAA;IAAA;IAAAP,KAAA,GAAAF,MAAA,CAAAU,IAAA,CAAAC,KAAA,CAAAX,MAAA,SAAAY,MAAA,CAAAL,IAAA;IAAAM,eAAA,CAAAC,sBAAA,CAAAZ,KAAA;IAAA,OAAAA,KAAA;EAAA;EAAAa,YAAA,CAAAlB,qBAAA;IAAAmB,GAAA;IAAAC,KAAA,EASzB,SAAAC,wBAAA,EAA0B;MACxB,IAAQC,SAAS,GAAK,IAAI,CAACC,KAAK,CAAxBD,SAAS;MACjB,OAAO,OAAOA,SAAS,KAAK,SAAS,IAAI,OAAOA,SAAS,KAAK,QAAQ;IACxE;EAAC;IAAAH,GAAA;IAAAC,KAAA,EAED,SAAAI,kBAAA,EAAoB;MAClB,IAAI,IAAI,CAACH,uBAAuB,EAAE,EAAE;QAClC,IAAQC,SAAS,GAAK,IAAI,CAACC,KAAK,CAAxBD,SAAS;QACjB,IAAIA,SAAS,KAAK,KAAK,EAAE;QACzB,IAAMG,IAAI,GAAG3B,WAAW,CAAC,IAAI,CAAC;QAC9B,IAAI,CAAC2B,IAAI,EAAE;QACX;QACA,IAAI,CAACC,KAAK,GAAGC,UAAU,CAAC;UAAA,OAAMF,IAAI,CAACG,KAAK,EAAE;QAAA,GAAGN,SAAS,IAAe,CAAC,CAAC;MACzE;IACF;EAAC;IAAAH,GAAA;IAAAC,KAAA,EAED,SAAAS,qBAAA,EAAuB;MACrBC,YAAY,CAAC,IAAI,CAACJ,KAAK,CAAC;IAC1B;EAAC;IAAAP,GAAA;IAAAC,KAAA,EAED,SAAAW,OAAA,EAAS;MACP,IAAAC,IAAA,GAAqB,IAAI,CAACT,KAAK;QAAvBU,QAAQ,GAAAD,IAAA,CAARC,QAAQ;MAChB,IAAMV,KAAK,GAAG,CAAC,CAAgC;MAC/C,IAAI,IAAI,CAACF,uBAAuB,EAAE,EAAE;QAClCE,KAAK,CAACD,SAAS,GAAGY,SAAS;MAC7B;MACA,OAAOD,QAAQ,CAACV,KAAK,CAAC;IACxB;EAAC;EAAA,OAAAvB,qBAAA;AAAA,EApCiCH,aAAa;AAAAmB,eAAA,CAA3ChB,qBAAqB,iBACJ,uBAAuB;AAAAgB,eAAA,CADxChB,qBAAqB,kBAGH;EACpBsB,SAAS,EAAEY;AACb,CAAC;AAkCH,eAAenC,SAAS,CAACC,qBAAqB,CAAC"}
1
+ {"version":3,"file":"WithAutoFocus.mjs","names":["PureComponent","findDOMNode","createHoc","EnhancedWithAutoFocus","_PureComponent","_inherits","_super","_createSuper","_this","_classCallCheck","_len","arguments","length","args","Array","_key","call","apply","concat","_defineProperty","_assertThisInitialized","_createClass","key","value","notUsingNativeAutoFocus","autoFocus","props","componentDidMount","node","timer","setTimeout","focus","componentWillUnmount","clearTimeout","render","_ref","children","undefined"],"sources":["../../src/enhances/WithAutoFocus.tsx"],"sourcesContent":["import React, { PureComponent } from 'react';\nimport { findDOMNode } from 'react-dom';\nimport createHoc from '../createHoc';\nimport { UnknownProperties } from '../core';\n\n/** @deprecated */\nexport interface IEnhancedWithAutoFocusProps\n extends EnhancedWithAutoFocusProps,\n UnknownProperties {}\nexport type EnhancedWithAutoFocusProps = {\n /**\n * @default undefined\n */\n autoFocus?: string | number | boolean;\n children?: (props: IEnhancedWithAutoFocusProps) => React.ReactNode;\n};\n\nclass EnhancedWithAutoFocus extends PureComponent<IEnhancedWithAutoFocusProps> {\n static displayName = 'EnhancedWithAutoFocus';\n\n static defaultProps = {\n autoFocus: undefined,\n };\n\n private timer: ReturnType<typeof setTimeout> | undefined;\n\n notUsingNativeAutoFocus() {\n const { autoFocus } = this.props;\n return typeof autoFocus === 'boolean' || typeof autoFocus === 'number';\n }\n\n componentDidMount() {\n if (this.notUsingNativeAutoFocus()) {\n const { autoFocus } = this.props;\n if (autoFocus === false) return;\n const node = findDOMNode(this);\n if (!node) return;\n //@ts-ignore\n this.timer = setTimeout(() => node.focus(), (autoFocus as number) || 0);\n }\n }\n\n componentWillUnmount() {\n clearTimeout(this.timer);\n }\n\n render() {\n const { children } = this.props as any;\n const props = {} as IEnhancedWithAutoFocusProps;\n if (this.notUsingNativeAutoFocus()) {\n props.autoFocus = undefined;\n }\n return children(props);\n }\n}\n\nexport default createHoc(EnhancedWithAutoFocus);\n"],"mappings":";;;;;;AAAA,SAAgBA,aAAa,QAAQ,OAAO;AAC5C,SAASC,WAAW,QAAQ,WAAW;AACvC,OAAOC,SAAS,MAAM,kBAAc;AAAC,IAe/BC,qBAAqB,0BAAAC,cAAA;EAAAC,SAAA,CAAAF,qBAAA,EAAAC,cAAA;EAAA,IAAAE,MAAA,GAAAC,YAAA,CAAAJ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AAS;MACP,IAAAC,IAAA,GAAqB,IAAI,CAACT,KAAK;QAAvBU,QAAQ,GAAAD,IAAA,CAARC,QAAQ;MAChB,IAAMV,KAAK,GAAG,CAAC,CAAgC;MAC/C,IAAI,IAAI,CAACF,uBAAuB,EAAE,EAAE;QAClCE,KAAK,CAACD,SAAS,GAAGY,SAAS;MAC7B;MACA,OAAOD,QAAQ,CAACV,KAAK,CAAC;IACxB;EAAC;EAAA,OAAAvB,qBAAA;AAAA,EApCiCH,aAAa;AAAAmB,eAAA,CAA3ChB,qBAAqB,iBACJ,uBAAuB;AAAAgB,eAAA,CADxChB,qBAAqB,kBAGH;EACpBsB,SAAS,EAAEY;AACb,CAAC;AAkCH,eAAenC,SAAS,CAACC,qBAAqB,CAAC"}
@@ -1,7 +1,7 @@
1
1
  import React, { PureComponent } from 'react';
2
2
  import { NanoOptions } from '@phytonmk/nano-css';
3
3
  import { CssLikeObject } from '@phytonmk/nano-css/types/common';
4
- import { UnknownProperties } from 'intergalactic/core';
4
+ import { UnknownProperties } from '../core';
5
5
  declare const getStylesheet: () => string;
6
6
  /**
7
7
  * Function to clear the nano CSS styles object from keys with undefined value
@@ -1 +1 @@
1
- {"version":3,"file":"WithCSS.js","names":["_react","_interopRequireWildcard","require","_createHoc","_interopRequireDefault","_CSSinJS2","getStylesheet","CSSinJS","raw","exports","normaliseCss","obj","Object","keys","reduce","acc","key","result","undefined","WithCssContext","React","createContext","Provider","initNanoCss","options","arguments","length","EnhancedWithCSS","_PureComponent","_inherits2","_super","_createSuper2","props","context","_this","_classCallCheck2","call","_defineProperty2","_assertThisInitialized2","dynamicClassName","_createClass2","value","render","_this$props","children","_this$props$className","className","state","getDerivedStateFromProps","_CSSinJS$cache","_CSSinJS","cleanCss","css","cache","PureComponent","_default","createHoc"],"sources":["../../src/enhances/WithCSS.tsx"],"sourcesContent":["import React, { PureComponent } from 'react';\nimport { NanoOptions } from '@phytonmk/nano-css';\nimport { CssLikeObject } from '@phytonmk/nano-css/types/common';\nimport createHoc from '../createHoc';\nimport CSSinJS from '../CSSinJS';\nimport { UnknownProperties, Intergalactic } from '@semcore/core';\n\nconst getStylesheet = () => CSSinJS().raw;\n\n/**\n * Function to clear the nano CSS styles object from keys with undefined value\n * @param {Object} obj - nano CSS styles object\n * @returns {Object}\n */\nfunction normaliseCss(obj: CssLikeObject) {\n return Object.keys(obj).reduce((acc: any, key) => {\n const result = acc;\n if (obj[key] !== undefined) {\n result[key] = obj[key];\n }\n return result;\n }, {});\n}\n\nconst WithCssContext = React.createContext<NanoOptions>({});\nconst { Provider } = WithCssContext;\n\nfunction initNanoCss(options: NanoOptions = {}) {\n return CSSinJS(options);\n}\n\n/** @deprecated */\nexport interface IEnhancedWithCSSProps extends EnhancedWithCSSProps, UnknownProperties {}\nexport type EnhancedWithCSSProps = {\n className?: string;\n css?: {};\n\n children(props: { className: string | undefined }): React.ReactNode;\n};\n\nclass EnhancedWithCSS extends PureComponent<IEnhancedWithCSSProps> {\n static contextType = WithCssContext;\n\n static defaultProps = {\n css: {},\n };\n\n state = {\n dynamicClassName: '',\n };\n\n static getDerivedStateFromProps(props: any) {\n const cleanCss = normaliseCss(props.css);\n return {\n dynamicClassName: Object.keys(cleanCss).length ? CSSinJS().cache?.(cleanCss) : '',\n };\n }\n\n constructor(props: any, context: any) {\n super(props, context);\n\n initNanoCss(context);\n }\n\n render() {\n const { children, className = '' } = this.props;\n const { dynamicClassName } = this.state;\n return children({\n className: className + dynamicClassName || undefined,\n });\n }\n}\n\nexport { getStylesheet, EnhancedWithCSS, Provider, WithCssContext, initNanoCss, normaliseCss };\nexport default createHoc(EnhancedWithCSS);\n"],"mappings":";;;;;;;;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AAGA,IAAAC,UAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,SAAA,GAAAD,sBAAA,CAAAF,OAAA;AAGA,IAAMI,aAAa,GAAG,SAAhBA,aAAaA,CAAA;EAAA,O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AAA8C,QAAA"}
1
+ {"version":3,"file":"WithCSS.js","names":["_react","_interopRequireWildcard","require","_createHoc","_interopRequireDefault","_CSSinJS2","getStylesheet","CSSinJS","raw","exports","normaliseCss","obj","Object","keys","reduce","acc","key","result","undefined","WithCssContext","React","createContext","Provider","initNanoCss","options","arguments","length","EnhancedWithCSS","_PureComponent","_inherits2","_super","_createSuper2","props","context","_this","_classCallCheck2","call","_defineProperty2","_assertThisInitialized2","dynamicClassName","_createClass2","value","render","_this$props","children","_this$props$className","className","state","getDerivedStateFromProps","_CSSinJS$cache","_CSSinJS","cleanCss","css","cache","PureComponent","_default","createHoc"],"sources":["../../src/enhances/WithCSS.tsx"],"sourcesContent":["import React, { PureComponent } from 'react';\nimport { NanoOptions } from '@phytonmk/nano-css';\nimport { CssLikeObject } from '@phytonmk/nano-css/types/common';\nimport createHoc from '../createHoc';\nimport CSSinJS from '../CSSinJS';\nimport { UnknownProperties } from '../core';\n\nconst getStylesheet = () => CSSinJS().raw;\n\n/**\n * Function to clear the nano CSS styles object from keys with undefined value\n * @param {Object} obj - nano CSS styles object\n * @returns {Object}\n */\nfunction normaliseCss(obj: CssLikeObject) {\n return Object.keys(obj).reduce((acc: any, key) => {\n const result = acc;\n if (obj[key] !== undefined) {\n result[key] = obj[key];\n }\n return result;\n }, {});\n}\n\nconst WithCssContext = React.createContext<NanoOptions>({});\nconst { Provider } = WithCssContext;\n\nfunction initNanoCss(options: NanoOptions = {}) {\n return CSSinJS(options);\n}\n\n/** @deprecated */\nexport interface IEnhancedWithCSSProps extends EnhancedWithCSSProps, UnknownProperties {}\nexport type EnhancedWithCSSProps = {\n className?: string;\n css?: {};\n\n children(props: { className: string | undefined }): React.ReactNode;\n};\n\nclass EnhancedWithCSS extends PureComponent<IEnhancedWithCSSProps> {\n static contextType = WithCssContext;\n\n static defaultProps = {\n css: {},\n };\n\n state = {\n dynamicClassName: '',\n };\n\n static getDerivedStateFromProps(props: any) {\n const cleanCss = normaliseCss(props.css);\n return {\n dynamicClassName: Object.keys(cleanCss).length ? CSSinJS().cache?.(cleanCss) : '',\n };\n }\n\n constructor(props: any, context: any) {\n super(props, context);\n\n initNanoCss(context);\n }\n\n render() {\n const { children, className = '' } = this.props;\n const { dynamicClassName } = this.state;\n return children({\n className: className + dynamicClassName || undefined,\n });\n }\n}\n\nexport { getStylesheet, EnhancedWithCSS, Provider, WithCssContext, initNanoCss, normaliseCss };\nexport default createHoc(EnhancedWithCSS);\n"],"mappings":";;;;;;;;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AAGA,IAAAC,UAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,SAAA,GAAAD,sBAAA,CAAAF,OAAA;AAGA,IAAMI,aAAa,GAAG,SAAhBA,aAAaA,CAAA;EAAA,OAAS,IAAAC,oBAAO,GAAE,CAACC,GAAG;AAAA;;AAEzC;AACA;AACA;AACA;AACA;AAJAC,OAAA,CAAAH,aAAA,GAAAA,aAAA;AAKA,SAASI,YAAYA,CAACC,GAAkB,EAAE;EACxC,OAAOC,MAAM,CAACC,IAAI,CAACF,GAAG,CAAC,CAACG,MAAM,CAAC,UAACC,GAAQ,EAAEC,GAAG,EAAK;IAChD,IAAMC,MAAM,GAAGF,GAAG;IAClB,IAAIJ,GAAG,CAACK,GAAG,CAAC,KAAKE,SAAS,EAAE;MAC1BD,MAAM,CAACD,GAAG,CAAC,GAAGL,GAAG,CAACK,GAAG,CAAC;IACxB;IACA,OAAOC,MAAM;EACf,CAAC,EAAE,CAAC,CAAC,CAAC;AACR;AAEA,IAAME,cAAc,gBAAGC,iBAAK,CAACC,aAAa,CAAc,CAAC,CAAC,CAAC;AAACZ,OAAA,CAAAU,cAAA,GAAAA,cAAA;AAC5D,IAAQG,QAAQ,GAAKH,cAAc,CAA3BG,QAAQ;AAAoBb,OAAA,CAAAa,QAAA,GAAAA,QAAA;AAEpC,SAASC,WAAWA,CAAA,EAA4B;EAAA,IAA3BC,OAAoB,GAA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,IAAI,CAACsC,QAAQ,CAAC,CAACzB,MAAM,IAAAuB,cAAA,GAAG,CAAAC,QAAA,OAAA3C,oBAAO,GAAE,EAAC8C,KAAK,cAAAJ,cAAA,uBAAfA,cAAA,CAAAb,IAAA,CAAAc,QAAA,EAAkBC,QAAQ,CAAC,GAAG;MACjF,CAAC;IACH;EAAC;EAAA,OAAAxB,eAAA;AAAA,EAhB2B2B,oBAAa;AAAA7C,OAAA,CAAAkB,eAAA,GAAAA,eAAA;AAAA,IAAAU,gBAAA,aAArCV,eAAe,iBACER,cAAc;AAAA,IAAAkB,gBAAA,aAD/BV,eAAe,kBAGG;EACpByB,GAAG,EAAE,CAAC;AACR,CAAC;AAAA,IAAAG,QAAA,GA6BY,IAAAC,qBAAS,EAAC7B,eAAe,CAAC;AAAAlB,OAAA,cAAA8C,QAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"WithCSS.mjs","names":["React","PureComponent","createHoc","CSSinJS","getStylesheet","raw","normaliseCss","obj","Object","keys","reduce","acc","key","result","undefined","WithCssContext","createContext","Provider","initNanoCss","options","arguments","length","EnhancedWithCSS","_PureComponent","_inherits","_super","_createSuper","props","context","_this","_classCallCheck","call","_defineProperty","_assertThisInitialized","dynamicClassName","_createClass","value","render","_this$props","children","_this$props$className","className","state","getDerivedStateFromProps","_CSSinJS$cache","_CSSinJS","cleanCss","css","cache"],"sources":["../../src/enhances/WithCSS.tsx"],"sourcesContent":["import React, { PureComponent } from 'react';\nimport { NanoOptions } from '@phytonmk/nano-css';\nimport { CssLikeObject } from '@phytonmk/nano-css/types/common';\nimport createHoc from '../createHoc';\nimport CSSinJS from '../CSSinJS';\nimport { UnknownProperties, Intergalactic } from '@semcore/core';\n\nconst getStylesheet = () => CSSinJS().raw;\n\n/**\n * Function to clear the nano CSS styles object from keys with undefined value\n * @param {Object} obj - nano CSS styles object\n * @returns {Object}\n */\nfunction normaliseCss(obj: CssLikeObject) {\n return Object.keys(obj).reduce((acc: any, key) => {\n const result = acc;\n if (obj[key] !== undefined) {\n result[key] = obj[key];\n }\n return result;\n }, {});\n}\n\nconst WithCssContext = React.createContext<NanoOptions>({});\nconst { Provider } = WithCssContext;\n\nfunction initNanoCss(options: NanoOptions = {}) {\n return CSSinJS(options);\n}\n\n/** @deprecated */\nexport interface IEnhancedWithCSSProps extends EnhancedWithCSSProps, UnknownProperties {}\nexport type EnhancedWithCSSProps = {\n className?: string;\n css?: {};\n\n children(props: { className: string | undefined }): React.ReactNode;\n};\n\nclass EnhancedWithCSS extends PureComponent<IEnhancedWithCSSProps> {\n static contextType = WithCssContext;\n\n static defaultProps = {\n css: {},\n };\n\n state = {\n dynamicClassName: '',\n };\n\n static getDerivedStateFromProps(props: any) {\n const cleanCss = normaliseCss(props.css);\n return {\n dynamicClassName: Object.keys(cleanCss).length ? CSSinJS().cache?.(cleanCss) : '',\n };\n }\n\n constructor(props: any, context: any) {\n super(props, context);\n\n initNanoCss(context);\n }\n\n render() {\n const { children, className = '' } = this.props;\n const { dynamicClassName } = this.state;\n return children({\n className: className + dynamicClassName || undefined,\n });\n }\n}\n\nexport { getStylesheet, EnhancedWithCSS, Provider, WithCssContext, initNanoCss, normaliseCss };\nexport default createHoc(EnhancedWithCSS);\n"],"mappings":";;;;;;AAAA,OAAOA,KAAK,IAAIC,aAAa,QAAQ,OAAO;AAG5C,OAAOC,SAAS,MAAM,kBAAc;AACpC,OAAOC,OAAO,MAAM,gBAAY;AAGhC,IAAMC,aAAa,GAAG,SAAhBA,aAAaA,CAAA;EAAA,OAASD,OAAO,EAAE,CAACE,GAAG;AAAA;;AAEzC;AACA;AACA;AACA;AACA;AACA,SAASC,YAAYA,CAACC,GAAkB,EAAE;EACxC,OAAOC,MAAM,CAACC,IAAI,CAACF,GAAG,CAAC,CAACG,MAAM,CAAC,UAACC,GAAQ,EAAEC,GAAG,EAAK;IAChD,IAAMC,MAAM,GAAGF,GAAG;IAClB,IAAIJ,GAAG,CAACK,GAAG,CAAC,KAAKE,SAAS,EAAE;MAC1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AGP,gBAAgB,IAAIpB;MAC7C,CAAC,CAAC;IACJ;EAAC;IAAAF,GAAA;IAAAwB,KAAA,EAnBD,SAAAO,yBAAgChB,KAAU,EAAE;MAAA,IAAAiB,cAAA,EAAAC,QAAA;MAC1C,IAAMC,QAAQ,GAAGxC,YAAY,CAACqB,KAAK,CAACoB,GAAG,CAAC;MACxC,OAAO;QACLb,gBAAgB,EAAE1B,MAAM,CAACC,IAAI,CAACqC,QAAQ,CAAC,CAACzB,MAAM,IAAAuB,cAAA,GAAG,CAAAC,QAAA,GAAA1C,OAAO,EAAE,EAAC6C,KAAK,cAAAJ,cAAA,uBAAfA,cAAA,CAAAb,IAAA,CAAAc,QAAA,EAAkBC,QAAQ,CAAC,GAAG;MACjF,CAAC;IACH;EAAC;EAAA,OAAAxB,eAAA;AAAA,EAhB2BrB,aAAa;AAAA+B,eAAA,CAArCV,eAAe,iBACEP,cAAc;AAAAiB,eAAA,CAD/BV,eAAe,kBAGG;EACpByB,GAAG,EAAE,CAAC;AACR,CAAC;AA4BH,SAAS3C,aAAa,EAAEkB,eAAe,EAAEL,QAAQ,EAAEF,cAAc,EAAEG,WAAW,EAAEZ,YAAY;AAC5F,eAAeJ,SAAS,CAACoB,eAAe,CAAC"}
1
+ {"version":3,"file":"WithCSS.mjs","names":["React","PureComponent","createHoc","CSSinJS","getStylesheet","raw","normaliseCss","obj","Object","keys","reduce","acc","key","result","undefined","WithCssContext","createContext","Provider","initNanoCss","options","arguments","length","EnhancedWithCSS","_PureComponent","_inherits","_super","_createSuper","props","context","_this","_classCallCheck","call","_defineProperty","_assertThisInitialized","dynamicClassName","_createClass","value","render","_this$props","children","_this$props$className","className","state","getDerivedStateFromProps","_CSSinJS$cache","_CSSinJS","cleanCss","css","cache"],"sources":["../../src/enhances/WithCSS.tsx"],"sourcesContent":["import React, { PureComponent } from 'react';\nimport { NanoOptions } from '@phytonmk/nano-css';\nimport { CssLikeObject } from '@phytonmk/nano-css/types/common';\nimport createHoc from '../createHoc';\nimport CSSinJS from '../CSSinJS';\nimport { UnknownProperties } from '../core';\n\nconst getStylesheet = () => CSSinJS().raw;\n\n/**\n * Function to clear the nano CSS styles object from keys with undefined value\n * @param {Object} obj - nano CSS styles object\n * @returns {Object}\n */\nfunction normaliseCss(obj: CssLikeObject) {\n return Object.keys(obj).reduce((acc: any, key) => {\n const result = acc;\n if (obj[key] !== undefined) {\n result[key] = obj[key];\n }\n return result;\n }, {});\n}\n\nconst WithCssContext = React.createContext<NanoOptions>({});\nconst { Provider } = WithCssContext;\n\nfunction initNanoCss(options: NanoOptions = {}) {\n return CSSinJS(options);\n}\n\n/** @deprecated */\nexport interface IEnhancedWithCSSProps extends EnhancedWithCSSProps, UnknownProperties {}\nexport type EnhancedWithCSSProps = {\n className?: string;\n css?: {};\n\n children(props: { className: string | undefined }): React.ReactNode;\n};\n\nclass EnhancedWithCSS extends PureComponent<IEnhancedWithCSSProps> {\n static contextType = WithCssContext;\n\n static defaultProps = {\n css: {},\n };\n\n state = {\n dynamicClassName: '',\n };\n\n static getDerivedStateFromProps(props: any) {\n const cleanCss = normaliseCss(props.css);\n return {\n dynamicClassName: Object.keys(cleanCss).length ? CSSinJS().cache?.(cleanCss) : '',\n };\n }\n\n constructor(props: any, context: any) {\n super(props, context);\n\n initNanoCss(context);\n }\n\n render() {\n const { children, className = '' } = this.props;\n const { dynamicClassName } = this.state;\n return children({\n className: className + dynamicClassName || undefined,\n });\n }\n}\n\nexport { getStylesheet, EnhancedWithCSS, Provider, WithCssContext, initNanoCss, normaliseCss };\nexport default createHoc(EnhancedWithCSS);\n"],"mappings":";;;;;;AAAA,OAAOA,KAAK,IAAIC,aAAa,QAAQ,OAAO;AAG5C,OAAOC,SAAS,MAAM,kBAAc;AACpC,OAAOC,OAAO,MAAM,gBAAY;AAGhC,IAAMC,aAAa,GAAG,SAAhBA,aAAaA,CAAA;EAAA,OAASD,OAAO,EAAE,CAACE,GAAG;AAAA;;AAEzC;AACA;AACA;AACA;AACA;AACA,SAAS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AARC,QAAQ;QAAAC,qBAAA,GAAAF,WAAA,CAAEG,SAAS;QAATA,SAAS,GAAAD,qBAAA,cAAG,EAAE,GAAAA,qBAAA;MAChC,IAAQN,gBAAgB,GAAK,IAAI,CAACQ,KAAK,CAA/BR,gBAAgB;MACxB,OAAOK,QAAQ,CAAC;QACdE,SAAS,EAAEA,SAAS,GAAGP,gBAAgB,IAAIpB;MAC7C,CAAC,CAAC;IACJ;EAAC;IAAAF,GAAA;IAAAwB,KAAA,EAnBD,SAAAO,yBAAgChB,KAAU,EAAE;MAAA,IAAAiB,cAAA,EAAAC,QAAA;MAC1C,IAAMC,QAAQ,GAAGxC,YAAY,CAACqB,KAAK,CAACoB,GAAG,CAAC;MACxC,OAAO;QACLb,gBAAgB,EAAE1B,MAAM,CAACC,IAAI,CAACqC,QAAQ,CAAC,CAACzB,MAAM,IAAAuB,cAAA,GAAG,CAAAC,QAAA,GAAA1C,OAAO,EAAE,EAAC6C,KAAK,cAAAJ,cAAA,uBAAfA,cAAA,CAAAb,IAAA,CAAAc,QAAA,EAAkBC,QAAQ,CAAC,GAAG;MACjF,CAAC;IACH;EAAC;EAAA,OAAAxB,eAAA;AAAA,EAhB2BrB,aAAa;AAAA+B,eAAA,CAArCV,eAAe,iBACEP,cAAc;AAAAiB,eAAA,CAD/BV,eAAe,kBAGG;EACpByB,GAAG,EAAE,CAAC;AACR,CAAC;AA4BH,SAAS3C,aAAa,EAAEkB,eAAe,EAAEL,QAAQ,EAAEF,cAAc,EAAEG,WAAW,EAAEZ,YAAY;AAC5F,eAAeJ,SAAS,CAACoB,eAAe,CAAC"}
@@ -1,5 +1,5 @@
1
1
  import React, { Component } from 'react';
2
- import { UnknownProperties } from 'intergalactic/core';
2
+ import { UnknownProperties } from '../core';
3
3
  export type LocaleKeys = string;
4
4
  export type DictionaryItem = {
5
5
  [key: string]: string;
@@ -1 +1 @@
1
- {"version":3,"file":"WithI18n.js","names":["_react","_interopRequireWildcard","require","_createHoc","_interopRequireDefault","_i18nEnhance","Context","createContext","undefined","exports","I18nProvider","Provider","I18nConsumer","Consumer","getText","dictionaries","locale","key","dictionary","WithI18n","_Component","_inherits2","_super","_createSuper2","_this","_classCallCheck2","_len","arguments","length","args","Array","_key","call","apply","concat","_defineProperty2","_assertThisInitialized2","selfLocale","_this$props","props","contextLocale","context","_createClass2","value","render","_ref","children","Component","useI18n","fallbackDictionary","lang","React","useContext","resolvedDictionary","useAsyncI18nMessages","useCallback","messageId","variables","_resolvedDictionary$m","interpolate","_default","createHoc"],"sources":["../../src/enhances/WithI18n.tsx"],"sourcesContent":["import React, { Component, createContext } from 'react';\nimport createHoc from '../createHoc';\nimport { interpolate, useAsyncI18nMessages } from './i18nEnhance';\nimport { UnknownProperties, Intergalactic } from '@semcore/core';\n\nexport type LocaleKeys = string;\nexport type DictionaryItem = { [key: string]: string };\nexport type Dictionary = { [locale: string]: DictionaryItem | (() => Promise<DictionaryItem>) };\nexport const Context = createContext<LocaleKeys | undefined>(undefined);\nconst { Provider: I18nProvider, Consumer: I18nConsumer } = Context;\n\nfunction getText(dictionaries: Dictionary, locale: LocaleKeys) {\n return function (key: keyof DictionaryItem) {\n const dictionary = dictionaries[locale];\n return dictionary ? (dictionary as any)[key] : (dictionaries as any)['en'][key];\n };\n}\n\n/** @deprecated */\nexport interface IWithI18nInjectedProps extends WithI18nInjectedProps, UnknownProperties {}\nexport type WithI18nInjectedProps = {\n getText: WithI18n['getText'];\n};\n\n/** @deprecated */\nexport interface IWithI18nProps extends WithI18nProps, UnknownProperties {}\nexport type WithI18nProps = WithI18nInjectedProps & {\n locale?: LocaleKeys;\n\n children?(props: IWithI18nInjectedProps): React.ReactNode;\n};\n\n/**\n * @deprecated use `useI18n` instead\n */\nclass WithI18n extends Component<IWithI18nProps> {\n /* @ts-ignore */\n context: LocaleKeys;\n\n static contextType = Context;\n static defaultProps = {\n getText,\n };\n\n getText = (dictionary: Dictionary, selfLocale?: string): string => {\n const { locale, getText } = this.props;\n const contextLocale = this.context;\n return getText(dictionary, selfLocale || locale || contextLocale);\n };\n\n render() {\n const { children } = this.props as any;\n return children({\n getText: this.getText,\n });\n }\n}\n\nconst useI18n = (\n dictionary: Dictionary,\n locale: LocaleKeys = 'en',\n fallbackDictionary?: Dictionary,\n) => {\n const lang = React.useContext(Context);\n const resolvedDictionary = useAsyncI18nMessages(dictionary, lang || locale, fallbackDictionary);\n return React.useCallback(\n (messageId: string, variables?: { [key: string]: string | number | undefined }) => {\n return interpolate(resolvedDictionary[messageId] ?? '', variables);\n },\n [resolvedDictionary],\n );\n};\n\nexport default createHoc(WithI18n);\nexport { useI18n, I18nProvider, I18nConsumer };\n"],"mappings":";;;;;;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,UAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,YAAA,GAAAH,OAAA;AAMO,IAAMI,OAAO,gBAAG,IAAAC,oBAAa,EAAyBC,SAAS,CAAC;AAACC,OAAA,CAAAH,OAAA,GAAAA,OAAA;AACxE,IAAkBI,YAAY,GAA6BJ,OAAO,CAA1DK,QAAQ;EAA0BC,YAAY,GAAKN,OAAO,CAAlCO,QAAQ;AAA2BJ,OAAA,CAAAG,YAAA,GAAAA,YAAA;AAAAH,OAAA,CAAAC,YAAA,GAAAA,YAAA;AAEnE,SAASI,OAAOA,CAACC,YAAwB,EAAEC,MAAkB,EAAE;EAC7D,OAAO,UAAUC,GAAyB,EAAE;IAC1C,IAAMC,UAAU,GAAGH,YAAY,CAACC,MAAM,CAAC;IACvC,OAAOE,UAAU,GAAIA,UAAU,CAASD,GAAG,CAAC,GAAIF,YAAY,CAAS,IAAI,CAAC,CAACE,GAAG,CAAC;EACjF,CAAC;AACH;;AAEA;AAcA;AACA;AACA;AAFA,IAGME,QAAQ,0BAAAC,UAAA;EAAA,IAAAC,UAAA,aAAAF,QAAA,EAAAC,UAAA;EAAA,IAAAE,MAAA,OAAAC,aAAA,aAAAJ,QAAA;EA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A;AACF,CAAC;AAgBH,IAAMkC,OAAO,GAAG,SAAVA,OAAOA,CACX9B,UAAsB,EAGnB;EAAA,IAFHF,MAAkB,GAAAW,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAnB,SAAA,GAAAmB,SAAA,MAAG,IAAI;EAAA,IACzBsB,kBAA+B,GAAAtB,SAAA,CAAAC,MAAA,OAAAD,SAAA,MAAAnB,SAAA;EAE/B,IAAM0C,IAAI,GAAGC,iBAAK,CAACC,UAAU,CAAC9C,OAAO,CAAC;EACtC,IAAM+C,kBAAkB,GAAG,IAAAC,iCAAoB,EAACpC,UAAU,EAAEgC,IAAI,IAAIlC,MAAM,EAAEiC,kBAAkB,CAAC;EAC/F,OAAOE,iBAAK,CAACI,WAAW,CACtB,UAACC,SAAiB,EAAEC,SAA0D,EAAK;IAAA,IAAAC,qBAAA;IACjF,OAAO,IAAAC,wBAAW,GAAAD,qBAAA,GAACL,kBAAkB,CAACG,SAAS,CAAC,cAAAE,qBAAA,cAAAA,qBAAA,GAAI,EAAE,EAAED,SAAS,CAAC;EACpE,CAAC,EACD,CAACJ,kBAAkB,CAAC,CACrB;AACH,CAAC;AAAC5C,OAAA,CAAAuC,OAAA,GAAAA,OAAA;AAAA,IAAAY,QAAA,GAEa,IAAAC,qBAAS,EAAC1C,QAAQ,CAAC;AAAAV,OAAA,cAAAmD,QAAA"}
1
+ {"version":3,"file":"WithI18n.js","names":["_react","_interopRequireWildcard","require","_createHoc","_interopRequireDefault","_i18nEnhance","Context","createContext","undefined","exports","I18nProvider","Provider","I18nConsumer","Consumer","getText","dictionaries","locale","key","dictionary","WithI18n","_Component","_inherits2","_super","_createSuper2","_this","_classCallCheck2","_len","arguments","length","args","Array","_key","call","apply","concat","_defineProperty2","_assertThisInitialized2","selfLocale","_this$props","props","contextLocale","context","_createClass2","value","render","_ref","children","Component","useI18n","fallbackDictionary","lang","React","useContext","resolvedDictionary","useAsyncI18nMessages","useCallback","messageId","variables","_resolvedDictionary$m","interpolate","_default","createHoc"],"sources":["../../src/enhances/WithI18n.tsx"],"sourcesContent":["import React, { Component, createContext } from 'react';\nimport createHoc from '../createHoc';\nimport { interpolate, useAsyncI18nMessages } from './i18nEnhance';\nimport { UnknownProperties } from '../core';\n\nexport type LocaleKeys = string;\nexport type DictionaryItem = { [key: string]: string };\nexport type Dictionary = { [locale: string]: DictionaryItem | (() => Promise<DictionaryItem>) };\nexport const Context = createContext<LocaleKeys | undefined>(undefined);\nconst { Provider: I18nProvider, Consumer: I18nConsumer } = Context;\n\nfunction getText(dictionaries: Dictionary, locale: LocaleKeys) {\n return function (key: keyof DictionaryItem) {\n const dictionary = dictionaries[locale];\n return dictionary ? (dictionary as any)[key] : (dictionaries as any)['en'][key];\n };\n}\n\n/** @deprecated */\nexport interface IWithI18nInjectedProps extends WithI18nInjectedProps, UnknownProperties {}\nexport type WithI18nInjectedProps = {\n getText: WithI18n['getText'];\n};\n\n/** @deprecated */\nexport interface IWithI18nProps extends WithI18nProps, UnknownProperties {}\nexport type WithI18nProps = WithI18nInjectedProps & {\n locale?: LocaleKeys;\n\n children?(props: IWithI18nInjectedProps): React.ReactNode;\n};\n\n/**\n * @deprecated use `useI18n` instead\n */\nclass WithI18n extends Component<IWithI18nProps> {\n /* @ts-ignore */\n context: LocaleKeys;\n\n static contextType = Context;\n static defaultProps = {\n getText,\n };\n\n getText = (dictionary: Dictionary, selfLocale?: string): string => {\n const { locale, getText } = this.props;\n const contextLocale = this.context;\n return getText(dictionary, selfLocale || locale || contextLocale);\n };\n\n render() {\n const { children } = this.props as any;\n return children({\n getText: this.getText,\n });\n }\n}\n\nconst useI18n = (\n dictionary: Dictionary,\n locale: LocaleKeys = 'en',\n fallbackDictionary?: Dictionary,\n) => {\n const lang = React.useContext(Context);\n const resolvedDictionary = useAsyncI18nMessages(dictionary, lang || locale, fallbackDictionary);\n return React.useCallback(\n (messageId: string, variables?: { [key: string]: string | number | undefined }) => {\n return interpolate(resolvedDictionary[messageId] ?? '', variables);\n },\n [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ACtC,IAAM+C,kBAAkB,GAAG,IAAAC,iCAAoB,EAACpC,UAAU,EAAEgC,IAAI,IAAIlC,MAAM,EAAEiC,kBAAkB,CAAC;EAC/F,OAAOE,iBAAK,CAACI,WAAW,CACtB,UAACC,SAAiB,EAAEC,SAA0D,EAAK;IAAA,IAAAC,qBAAA;IACjF,OAAO,IAAAC,wBAAW,GAAAD,qBAAA,GAACL,kBAAkB,CAACG,SAAS,CAAC,cAAAE,qBAAA,cAAAA,qBAAA,GAAI,EAAE,EAAED,SAAS,CAAC;EACpE,CAAC,EACD,CAACJ,kBAAkB,CAAC,CACrB;AACH,CAAC;AAAC5C,OAAA,CAAAuC,OAAA,GAAAA,OAAA;AAAA,IAAAY,QAAA,GAEa,IAAAC,qBAAS,EAAC1C,QAAQ,CAAC;AAAAV,OAAA,cAAAmD,QAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"WithI18n.mjs","names":["React","Component","createContext","createHoc","interpolate","useAsyncI18nMessages","Context","undefined","I18nProvider","Provider","I18nConsumer","Consumer","getText","dictionaries","locale","key","dictionary","WithI18n","_Component","_inherits","_super","_createSuper","_this","_classCallCheck","_len","arguments","length","args","Array","_key","call","apply","concat","_defineProperty","_assertThisInitialized","selfLocale","_this$props","props","contextLocale","context","_createClass","value","render","_ref","children","useI18n","fallbackDictionary","lang","useContext","resolvedDictionary","useCallback","messageId","variables","_resolvedDictionary$m"],"sources":["../../src/enhances/WithI18n.tsx"],"sourcesContent":["import React, { Component, createContext } from 'react';\nimport createHoc from '../createHoc';\nimport { interpolate, useAsyncI18nMessages } from './i18nEnhance';\nimport { UnknownProperties, Intergalactic } from '@semcore/core';\n\nexport type LocaleKeys = string;\nexport type DictionaryItem = { [key: string]: string };\nexport type Dictionary = { [locale: string]: DictionaryItem | (() => Promise<DictionaryItem>) };\nexport const Context = createContext<LocaleKeys | undefined>(undefined);\nconst { Provider: I18nProvider, Consumer: I18nConsumer } = Context;\n\nfunction getText(dictionaries: Dictionary, locale: LocaleKeys) {\n return function (key: keyof DictionaryItem) {\n const dictionary = dictionaries[locale];\n return dictionary ? (dictionary as any)[key] : (dictionaries as any)['en'][key];\n };\n}\n\n/** @deprecated */\nexport interface IWithI18nInjectedProps extends WithI18nInjectedProps, UnknownProperties {}\nexport type WithI18nInjectedProps = {\n getText: WithI18n['getText'];\n};\n\n/** @deprecated */\nexport interface IWithI18nProps extends WithI18nProps, UnknownProperties {}\nexport type WithI18nProps = WithI18nInjectedProps & {\n locale?: LocaleKeys;\n\n children?(props: IWithI18nInjectedProps): React.ReactNode;\n};\n\n/**\n * @deprecated use `useI18n` instead\n */\nclass WithI18n extends Component<IWithI18nProps> {\n /* @ts-ignore */\n context: LocaleKeys;\n\n static contextType = Context;\n static defaultProps = {\n getText,\n };\n\n getText = (dictionary: Dictionary, selfLocale?: string): string => {\n const { locale, getText } = this.props;\n const contextLocale = this.context;\n return getText(dictionary, selfLocale || locale || contextLocale);\n };\n\n render() {\n const { children } = this.props as any;\n return children({\n getText: this.getText,\n });\n }\n}\n\nconst useI18n = (\n dictionary: Dictionary,\n locale: LocaleKeys = 'en',\n fallbackDictionary?: Dictionary,\n) => {\n const lang = React.useContext(Context);\n const resolvedDictionary = useAsyncI18nMessages(dictionary, lang || locale, fallbackDictionary);\n return React.useCallback(\n (messageId: string, variables?: { [key: string]: string | number | undefined }) => {\n return interpolate(resolvedDictionary[messageId] ?? '', variables);\n },\n [resolvedDictionary],\n );\n};\n\nexport default createHoc(WithI18n);\nexport { useI18n, I18nProvider, I18nConsumer };\n"],"mappings":";;;;;;AAAA,OAAOA,KAAK,IAAIC,SAAS,EAAEC,aAAa,QAAQ,OAAO;AACvD,OAAOC,SAAS,MAAM,kBAAc;AACpC,SAASC,WAAW,EAAEC,oBAAoB,QAAQ,mBAAe;AAMjE,OAAO,IAAMC,OAAO,gBAAGJ,aAAa,CAAyBK,SAAS,CAAC;AACvE,IAAkBC,YAAY,GAA6BF,OAAO,CAA1DG,QAAQ;EAA0BC,YAAY,GAAKJ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ncI18nMessages","Context","undefined","I18nProvider","Provider","I18nConsumer","Consumer","getText","dictionaries","locale","key","dictionary","WithI18n","_Component","_inherits","_super","_createSuper","_this","_classCallCheck","_len","arguments","length","args","Array","_key","call","apply","concat","_defineProperty","_assertThisInitialized","selfLocale","_this$props","props","contextLocale","context","_createClass","value","render","_ref","children","useI18n","fallbackDictionary","lang","useContext","resolvedDictionary","useCallback","messageId","variables","_resolvedDictionary$m"],"sources":["../../src/enhances/WithI18n.tsx"],"sourcesContent":["import React, { Component, createContext } from 'react';\nimport createHoc from '../createHoc';\nimport { interpolate, useAsyncI18nMessages } from './i18nEnhance';\nimport { UnknownProperties } from '../core';\n\nexport type LocaleKeys = string;\nexport type DictionaryItem = { [key: string]: string };\nexport type Dictionary = { [locale: string]: DictionaryItem | (() => Promise<DictionaryItem>) };\nexport const Context = createContext<LocaleKeys | undefined>(undefined);\nconst { Provider: I18nProvider, Consumer: I18nConsumer } = Context;\n\nfunction getText(dictionaries: Dictionary, locale: LocaleKeys) {\n return function (key: keyof DictionaryItem) {\n const dictionary = dictionaries[locale];\n return dictionary ? (dictionary as any)[key] : (dictionaries as any)['en'][key];\n };\n}\n\n/** @deprecated */\nexport interface IWithI18nInjectedProps extends WithI18nInjectedProps, UnknownProperties {}\nexport type WithI18nInjectedProps = {\n getText: WithI18n['getText'];\n};\n\n/** @deprecated */\nexport interface IWithI18nProps extends WithI18nProps, UnknownProperties {}\nexport type WithI18nProps = WithI18nInjectedProps & {\n locale?: LocaleKeys;\n\n children?(props: IWithI18nInjectedProps): React.ReactNode;\n};\n\n/**\n * @deprecated use `useI18n` instead\n */\nclass WithI18n extends Component<IWithI18nProps> {\n /* @ts-ignore */\n context: LocaleKeys;\n\n static contextType = Context;\n static defaultProps = {\n getText,\n };\n\n getText = (dictionary: Dictionary, selfLocale?: string): string => {\n const { locale, getText } = this.props;\n const contextLocale = this.context;\n return getText(dictionary, selfLocale || locale || contextLocale);\n };\n\n render() {\n const { children } = this.props as any;\n return children({\n getText: this.getText,\n });\n }\n}\n\nconst useI18n = (\n dictionary: Dictionary,\n locale: LocaleKeys = 'en',\n fallbackDictionary?: Dictionary,\n) => {\n const lang = React.useContext(Context);\n const resolvedDictionary = useAsyncI18nMessages(dictionary, lang || locale, fallbackDictionary);\n return React.useCallback(\n (messageId: string, variables?: { [key: string]: string | number | undefined }) => {\n return interpolate(resolvedDictionary[messageId] ?? '', variables);\n },\n [resolvedDictionary],\n );\n};\n\nexport default createHoc(WithI18n);\nexport { useI18n, I18nProvider, I18nConsumer };\n"],"mappings":";;;;;;AAAA,OAAOA,KAAK,IAAIC,SAAS,EAAEC,aAAa,QAAQ,OAAO;AACvD,OAAOC,SAAS,MAAM,kBAAc;AACpC,SAASC,WAAW,EAAEC,oBAAoB,QAAQ,mBAAe;AAMjE,OAAO,IAAMC,OAAO,gBAAGJ,aAAa,CAAyBK,SAAS,CAAC;AACvE,IAAkBC,YAAY,GAA6BF,OAAO,CAA1DG,QAAQ;EAA0BC,YAAY,GAAKJ,OAAO,CAAlCK,QAAQ;AAExC,SAASC,OAAOA,CAACC,YAAwB,EAAEC,MAAkB,EAAE;EAC7D,OAAO,UAAUC,GAAyB,EAAE;IAC1C,IAAMC,UAAU,GAAGH,YAAY,CAACC,MAAM,CAAC;IACvC,OAAOE,UAAU,GAAIA,UAAU,CAASD,GAAG,CAAC,GAAIF,YAAY,CAAS,IAAI,CAAC,CAACE,GAAG,CAAC;EACjF,CAAC;AACH;;AAEA;AAcA;AACA;AACA;AAFA,IAGME,QAAQ,0BAAAC,UAAA;EAAAC,SAAA,CAAAF,QAAA,EAAAC,UAAA;EAAA,IAAAE,MAAA,GAAAC,YAAA,CAAAJ,QAAA;EAAA,SAAAA,SAAA;IAAA,IAAAK,KAAA;IAAAC,eAAA,OAAAN,QAAA;IAAA,SAAAO,IAAA,GAAAC,SAAA,CAAAC,MAAA,EAAAC,IAAA,OAAAC,KAAA,CAAAJ,IAAA,GAAAK,IAAA,MAAAA,IAAA,GAAAL,IA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D,SAAA,MAAAlB,SAAA;EAE/B,IAAMwC,IAAI,GAAG/C,KAAK,CAACgD,UAAU,CAAC1C,OAAO,CAAC;EACtC,IAAM2C,kBAAkB,GAAG5C,oBAAoB,CAACW,UAAU,EAAE+B,IAAI,IAAIjC,MAAM,EAAEgC,kBAAkB,CAAC;EAC/F,OAAO9C,KAAK,CAACkD,WAAW,CACtB,UAACC,SAAiB,EAAEC,SAA0D,EAAK;IAAA,IAAAC,qBAAA;IACjF,OAAOjD,WAAW,EAAAiD,qBAAA,GAACJ,kBAAkB,CAACE,SAAS,CAAC,cAAAE,qBAAA,cAAAA,qBAAA,GAAI,EAAE,EAAED,SAAS,CAAC;EACpE,CAAC,EACD,CAACH,kBAAkB,CAAC,CACrB;AACH,CAAC;AAED,eAAe9C,SAAS,CAACc,QAAQ,CAAC;AAClC,SAAS4B,OAAO,EAAErC,YAAY,EAAEE,YAAY"}
@@ -1,5 +1,5 @@
1
1
  import React, { PureComponent } from 'react';
2
- import { UnknownProperties } from 'intergalactic/core';
2
+ import { UnknownProperties } from '../core';
3
3
  /** @deprecated */
4
4
  export interface IEnhancedWithKeyboardFocusInjectedProps extends EnhancedWithKeyboardFocusInjectedProps {
5
5
  }
@@ -1 +1 @@
1
- {"version":3,"file":"WithKeyboardFocus.js","names":["_react","require","_createHoc","_interopRequireDefault","_uncontroll","_fire","usingKeyBoard","EnhancedWithKeyboardFocus","_PureComponent","_inherits2","_super","_createSuper2","_this","_classCallCheck2","_len","arguments","length","args","Array","_key","call","apply","concat","_defineProperty2","_assertThisInitialized2","keyboardFocused","e","fire","internalSetState","_createClass2","key","value","render","_this$props","props","children","tabIndex","disabled","state","onFocus","handlerFocus","onBlur","handlerBlur","onKeyDown","handlerKeyDown","onMouseDown","handlerMouseDown","getDerivedStateFromProps","undefined","PureComponent","exports","_default","createHoc"],"sources":["../../src/enhances/WithKeyboardFocus.tsx"],"sourcesContent":["import React, { PureComponent } from 'react';\nimport createHoc from '../createHoc';\nimport { internalSetState } from '../uncontroll';\nimport fire from '../fire';\nimport { UnknownProperties, Intergalactic } from '@semcore/core';\n\n/** @deprecated */\nexport interface IEnhancedWithKeyboardFocusInjectedProps\n extends EnhancedWithKeyboardFocusInjectedProps {}\nexport type EnhancedWithKeyboardFocusInjectedProps = {\n tabIndex: number;\n keyboardFocused: boolean;\n\n onFocus(e: FocusEvent): void;\n\n onBlur(e: FocusEvent): void;\n\n onKeyDown(e: KeyboardEvent): void;\n\n onMouseDown(e: MouseEvent): void;\n};\n\n/** @deprecated */\nexport interface IEnhancedWithKeyboardFocusProps\n extends EnhancedWithKeyboardFocusProps,\n UnknownProperties {}\nexport type EnhancedWithKeyboardFocusProps = {\n keyboardFocused?: boolean;\n tabIndex?: number;\n disabled?: boolean;\n\n children(props: IEnhancedWithKeyboardFocusInjectedProps): React.ReactNode;\n};\n\n/** @deprecated */\nexport interface IEnhancedWithKeyboardFocusState\n extends EnhancedWithKeyboardFocusState,\n UnknownProperties {}\nexport type EnhancedWithKeyboardFocusState = {\n keyboardFocused: boolean;\n};\n\nlet usingKeyBoard = true;\n\nexport class EnhancedWithKeyboardFocus extends PureComponent<\n IEnhancedWithKeyboardFocusProps,\n IEnhancedWithKeyboardFocusState\n> {\n static displayName = 'EnhancedWithKeyboardFocus';\n\n static defaultProps = {\n tabIndex: 0,\n };\n\n static getDerivedStateFromProps(props: any, state: any) {\n if (props.keyboardFocused !== undefined) {\n return {\n keyboardFocused: props.keyboardFocused,\n };\n }\n return state;\n }\n\n state = {\n keyboardFocused: false,\n };\n\n handlerFocus = (e: FocusEvent) => {\n fire(this, 'onFocus', e);\n if (usingKeyBoard) {\n internalSetState(this, { keyboardFocused: true });\n }\n };\n\n handlerBlur = (e: FocusEvent) => {\n fire(this, 'onBlur', e);\n internalSetState(this, { keyboardFocused: false });\n };\n\n handlerKeyDown = (e: KeyboardEvent) => {\n fire(this, 'onKeyDown', e);\n usingKeyBoard = true;\n };\n\n handlerMouseDown = (e: MouseEvent) => {\n fire(this, 'onMouseDown', e);\n usingKeyBoard = false;\n };\n\n render() {\n const { children, tabIndex, disabled } = this.props;\n const { keyboardFocused } = this.state;\n return children({\n tabIndex: disabled ? -1 : tabIndex!,\n keyboardFocused,\n onFocus: this.handlerFocus,\n onBlur: this.handlerBlur,\n onKeyDown: this.handlerKeyDown,\n onMouseDown: this.handlerMouseDown,\n });\n }\n}\n\nexport default createHoc(EnhancedWithKeyboardFocus);\n"],"mappings":";;;;;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,UAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,WAAA,GAAAH,OAAA;AACA,IAAAI,KAAA,GAAAF,sBAAA,CAAAF,OAAA;AAuCA,IAAIK,aAAa,GAAG,IAAI;AAAC,IAEZC,yBAAyB,0BAAAC,cAAA;EAAA,IAAAC,UAAA,aAAAF,yBAAA,EAAAC,cAAA;EAAA,IAAAE,MAAA,OAAAC,aAAA,aAAAJ,yBAAA;EAAA,SAAAA,0BAAA;IAAA,IAAAK,KAAA;IAAA,IAAAC,gBAAA,mBAAAN,yBAAA;IAAA,SAAAO,IAAA,GAAAC,SAAA,CAAAC,MAAA,EAAAC,IAAA,OAAAC,KAAA,CAAAJ,IAAA,GAAAK,IAAA,MAAAA,IAAA,GAAAL,IAAA,EAAAK,IAAA;MAAAF,IAAA,CAAAE,IAAA,IAAAJ,SAAA,CAAAI,IAAA;IAAA;IAAAP,KAAA,GAAAF,MAAA,CAAAU,IAAA,CAAAC,KAAA,CAAAX,MAAA,SAAAY,MAAA,CAAAL,IAAA;IAAA,IAAAM,gBAAA,iBAAAC,uBAAA,aAAAZ,KAAA,YAmB5B;MACNa,eAAe,EAAE;IACnB,CAAC;IAAA,IAAAF,gBAAA,iBAAAC,uBAAA,aAAAZ,KAAA,mBAEc,UAACc,CAAa,EAAK;MAChC,IAAAC,gBAAI,MAAAH,uBAAA,aAAAZ,KAAA,GAAO,SAAS,EAAEc,CAAC,CAAC;MACxB,IAAIp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AAfA,eAAe;QACfc,OAAO,EAAE,IAAI,CAACC,YAAY;QAC1BC,MAAM,EAAE,IAAI,CAACC,WAAW;QACxBC,SAAS,EAAE,IAAI,CAACC,cAAc;QAC9BC,WAAW,EAAE,IAAI,CAACC;MACpB,CAAC,CAAC;IACJ;EAAC;IAAAhB,GAAA;IAAAC,KAAA,EA9CD,SAAAgB,yBAAgCb,KAAU,EAAEI,KAAU,EAAE;MACtD,IAAIJ,KAAK,CAACT,eAAe,KAAKuB,SAAS,EAAE;QACvC,OAAO;UACLvB,eAAe,EAAES,KAAK,CAACT;QACzB,CAAC;MACH;MACA,OAAOa,KAAK;IACd;EAAC;EAAA,OAAA/B,yBAAA;AAAA,EAjB4C0C,oBAAa;AAAAC,OAAA,CAAA3C,yBAAA,GAAAA,yBAAA;AAAA,IAAAgB,gBAAA,aAA/ChB,yBAAyB,iBAIf,2BAA2B;AAAA,IAAAgB,gBAAA,aAJrChB,yBAAyB,kBAMd;EACpB6B,QAAQ,EAAE;AACZ,CAAC;AAAA,IAAAe,QAAA,GAmDY,IAAAC,qBAAS,EAAC7C,yBAAyB,CAAC;AAAA2C,OAAA,cAAAC,QAAA"}
1
+ {"version":3,"file":"WithKeyboardFocus.js","names":["_react","require","_createHoc","_interopRequireDefault","_uncontroll","_fire","usingKeyBoard","EnhancedWithKeyboardFocus","_PureComponent","_inherits2","_super","_createSuper2","_this","_classCallCheck2","_len","arguments","length","args","Array","_key","call","apply","concat","_defineProperty2","_assertThisInitialized2","keyboardFocused","e","fire","internalSetState","_createClass2","key","value","render","_this$props","props","children","tabIndex","disabled","state","onFocus","handlerFocus","onBlur","handlerBlur","onKeyDown","handlerKeyDown","onMouseDown","handlerMouseDown","getDerivedStateFromProps","undefined","PureComponent","exports","_default","createHoc"],"sources":["../../src/enhances/WithKeyboardFocus.tsx"],"sourcesContent":["import React, { PureComponent } from 'react';\nimport createHoc from '../createHoc';\nimport { internalSetState } from '../uncontroll';\nimport fire from '../fire';\nimport { UnknownProperties } from '../core';\n\n/** @deprecated */\nexport interface IEnhancedWithKeyboardFocusInjectedProps\n extends EnhancedWithKeyboardFocusInjectedProps {}\nexport type EnhancedWithKeyboardFocusInjectedProps = {\n tabIndex: number;\n keyboardFocused: boolean;\n\n onFocus(e: FocusEvent): void;\n\n onBlur(e: FocusEvent): void;\n\n onKeyDown(e: KeyboardEvent): void;\n\n onMouseDown(e: MouseEvent): void;\n};\n\n/** @deprecated */\nexport interface IEnhancedWithKeyboardFocusProps\n extends EnhancedWithKeyboardFocusProps,\n UnknownProperties {}\nexport type EnhancedWithKeyboardFocusProps = {\n keyboardFocused?: boolean;\n tabIndex?: number;\n disabled?: boolean;\n\n children(props: IEnhancedWithKeyboardFocusInjectedProps): React.ReactNode;\n};\n\n/** @deprecated */\nexport interface IEnhancedWithKeyboardFocusState\n extends EnhancedWithKeyboardFocusState,\n UnknownProperties {}\nexport type EnhancedWithKeyboardFocusState = {\n keyboardFocused: boolean;\n};\n\nlet usingKeyBoard = true;\n\nexport class EnhancedWithKeyboardFocus extends PureComponent<\n IEnhancedWithKeyboardFocusProps,\n IEnhancedWithKeyboardFocusState\n> {\n static displayName = 'EnhancedWithKeyboardFocus';\n\n static defaultProps = {\n tabIndex: 0,\n };\n\n static getDerivedStateFromProps(props: any, state: any) {\n if (props.keyboardFocused !== undefined) {\n return {\n keyboardFocused: props.keyboardFocused,\n };\n }\n return state;\n }\n\n state = {\n keyboardFocused: false,\n };\n\n handlerFocus = (e: FocusEvent) => {\n fire(this, 'onFocus', e);\n if (usingKeyBoard) {\n internalSetState(this, { keyboardFocused: true });\n }\n };\n\n handlerBlur = (e: FocusEvent) => {\n fire(this, 'onBlur', e);\n internalSetState(this, { keyboardFocused: false });\n };\n\n handlerKeyDown = (e: KeyboardEvent) => {\n fire(this, 'onKeyDown', e);\n usingKeyBoard = true;\n };\n\n handlerMouseDown = (e: MouseEvent) => {\n fire(this, 'onMouseDown', e);\n usingKeyBoard = false;\n };\n\n render() {\n const { children, tabIndex, disabled } = this.props;\n const { keyboardFocused } = this.state;\n return children({\n tabIndex: disabled ? -1 : tabIndex!,\n keyboardFocused,\n onFocus: this.handlerFocus,\n onBlur: this.handlerBlur,\n onKeyDown: this.handlerKeyDown,\n onMouseDown: this.handlerMouseDown,\n });\n }\n}\n\nexport default createHoc(EnhancedWithKeyboardFocus);\n"],"mappings":";;;;;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,UAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,WAAA,GAAAH,OAAA;AACA,IAAAI,KAAA,GAAAF,sBAAA,CAAAF,OAAA;AAuCA,IAAIK,aAAa,GAAG,IAAI;AAAC,IAEZC,yBAAyB,0BAAAC,cAAA;EAAA,IAAAC,UAAA,aAAAF,yBAAA,EAAAC,cAAA;EAAA,IAAAE,MAAA,OAAAC,aAAA,aAAAJ,yBAAA;EAAA,SAAAA,0BAAA;IAAA,IAAAK,KAAA;IAAA,IAAAC,gBAAA,mBAAAN,yBAAA;IAAA,SAAAO,IAAA,GAAAC,SAAA,CAAAC,MAAA,EAAAC,IAAA,OAAAC,KAAA,CAAAJ,IAAA,GAAAK,IAAA,MAAAA,IAAA,GAAAL,IAAA,EAAAK,IAAA;MAAAF,IAAA,CAAAE,IAAA,IAAAJ,SAAA,CAAAI,IAAA;IAAA;IAAAP,KAAA,GAAAF,MAAA,CAAAU,IAAA,CAAAC,KAAA,CAAAX,MAAA,SAAAY,MAAA,CAAAL,IAAA;IAAA,IAAAM,gBAAA,iBAAAC,uBAAA,aAAAZ,KAAA,YAmB5B;MACNa,eAAe,EAAE;IACnB,CAAC;IAAA,IAAAF,gBAAA,iBAAAC,uBAAA,aAAAZ,KAAA,mBAEc,UAACc,CAAa,EAAK;MAChC,IAAAC,gBAAI,MAAAH,uBAAA,aAAAZ,KAAA,GAAO,SAAS,EAAEc,CAAC,CAAC;MACxB,IAAIpB,aAAa,EAAE;QACjB,IAAAsB,4BAAgB,MAAAJ,uBAAA,a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C,MAAM,EAAE,IAAI,CAACC,WAAW;QACxBC,SAAS,EAAE,IAAI,CAACC,cAAc;QAC9BC,WAAW,EAAE,IAAI,CAACC;MACpB,CAAC,CAAC;IACJ;EAAC;IAAAhB,GAAA;IAAAC,KAAA,EA9CD,SAAAgB,yBAAgCb,KAAU,EAAEI,KAAU,EAAE;MACtD,IAAIJ,KAAK,CAACT,eAAe,KAAKuB,SAAS,EAAE;QACvC,OAAO;UACLvB,eAAe,EAAES,KAAK,CAACT;QACzB,CAAC;MACH;MACA,OAAOa,KAAK;IACd;EAAC;EAAA,OAAA/B,yBAAA;AAAA,EAjB4C0C,oBAAa;AAAAC,OAAA,CAAA3C,yBAAA,GAAAA,yBAAA;AAAA,IAAAgB,gBAAA,aAA/ChB,yBAAyB,iBAIf,2BAA2B;AAAA,IAAAgB,gBAAA,aAJrChB,yBAAyB,kBAMd;EACpB6B,QAAQ,EAAE;AACZ,CAAC;AAAA,IAAAe,QAAA,GAmDY,IAAAC,qBAAS,EAAC7C,yBAAyB,CAAC;AAAA2C,OAAA,cAAAC,QAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"WithKeyboardFocus.mjs","names":["PureComponent","createHoc","internalSetState","fire","usingKeyBoard","EnhancedWithKeyboardFocus","_PureComponent","_inherits","_super","_createSuper","_this","_classCallCheck","_len","arguments","length","args","Array","_key","call","apply","concat","_defineProperty","_assertThisInitialized","keyboardFocused","e","_createClass","key","value","render","_this$props","props","children","tabIndex","disabled","state","onFocus","handlerFocus","onBlur","handlerBlur","onKeyDown","handlerKeyDown","onMouseDown","handlerMouseDown","getDerivedStateFromProps","undefined"],"sources":["../../src/enhances/WithKeyboardFocus.tsx"],"sourcesContent":["import React, { PureComponent } from 'react';\nimport createHoc from '../createHoc';\nimport { internalSetState } from '../uncontroll';\nimport fire from '../fire';\nimport { UnknownProperties, Intergalactic } from '@semcore/core';\n\n/** @deprecated */\nexport interface IEnhancedWithKeyboardFocusInjectedProps\n extends EnhancedWithKeyboardFocusInjectedProps {}\nexport type EnhancedWithKeyboardFocusInjectedProps = {\n tabIndex: number;\n keyboardFocused: boolean;\n\n onFocus(e: FocusEvent): void;\n\n onBlur(e: FocusEvent): void;\n\n onKeyDown(e: KeyboardEvent): void;\n\n onMouseDown(e: MouseEvent): void;\n};\n\n/** @deprecated */\nexport interface IEnhancedWithKeyboardFocusProps\n extends EnhancedWithKeyboardFocusProps,\n UnknownProperties {}\nexport type EnhancedWithKeyboardFocusProps = {\n keyboardFocused?: boolean;\n tabIndex?: number;\n disabled?: boolean;\n\n children(props: IEnhancedWithKeyboardFocusInjectedProps): React.ReactNode;\n};\n\n/** @deprecated */\nexport interface IEnhancedWithKeyboardFocusState\n extends EnhancedWithKeyboardFocusState,\n UnknownProperties {}\nexport type EnhancedWithKeyboardFocusState = {\n keyboardFocused: boolean;\n};\n\nlet usingKeyBoard = true;\n\nexport class EnhancedWithKeyboardFocus extends PureComponent<\n IEnhancedWithKeyboardFocusProps,\n IEnhancedWithKeyboardFocusState\n> {\n static displayName = 'EnhancedWithKeyboardFocus';\n\n static defaultProps = {\n tabIndex: 0,\n };\n\n static getDerivedStateFromProps(props: any, state: any) {\n if (props.keyboardFocused !== undefined) {\n return {\n keyboardFocused: props.keyboardFocused,\n };\n }\n return state;\n }\n\n state = {\n keyboardFocused: false,\n };\n\n handlerFocus = (e: FocusEvent) => {\n fire(this, 'onFocus', e);\n if (usingKeyBoard) {\n internalSetState(this, { keyboardFocused: true });\n }\n };\n\n handlerBlur = (e: FocusEvent) => {\n fire(this, 'onBlur', e);\n internalSetState(this, { keyboardFocused: false });\n };\n\n handlerKeyDown = (e: KeyboardEvent) => {\n fire(this, 'onKeyDown', e);\n usingKeyBoard = true;\n };\n\n handlerMouseDown = (e: MouseEvent) => {\n fire(this, 'onMouseDown', e);\n usingKeyBoard = false;\n };\n\n render() {\n const { children, tabIndex, disabled } = this.props;\n const { keyboardFocused } = this.state;\n return children({\n tabIndex: disabled ? -1 : tabIndex!,\n keyboardFocused,\n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EAAE;MACtD,IAAIJ,KAAK,CAACP,eAAe,KAAKqB,SAAS,EAAE;QACvC,OAAO;UACLrB,eAAe,EAAEO,KAAK,CAACP;QACzB,CAAC;MACH;MACA,OAAOW,KAAK;IACd;EAAC;EAAA,OAAA7B,yBAAA;AAAA,EAjB4CL,aAAa;AAyD3DqB,eAAA,CAzDYhB,yBAAyB,iBAIf,2BAA2B;AAAAgB,eAAA,CAJrChB,yBAAyB,kBAMd;EACpB2B,QAAQ,EAAE;AACZ,CAAC;AAmDH,eAAe/B,SAAS,CAACI,yBAAyB,CAAC"}
1
+ {"version":3,"file":"WithKeyboardFocus.mjs","names":["PureComponent","createHoc","internalSetState","fire","usingKeyBoard","EnhancedWithKeyboardFocus","_PureComponent","_inherits","_super","_createSuper","_this","_classCallCheck","_len","arguments","length","args","Array","_key","call","apply","concat","_defineProperty","_assertThisInitialized","keyboardFocused","e","_createClass","key","value","render","_this$props","props","children","tabIndex","disabled","state","onFocus","handlerFocus","onBlur","handlerBlur","onKeyDown","handlerKeyDown","onMouseDown","handlerMouseDown","getDerivedStateFromProps","undefined"],"sources":["../../src/enhances/WithKeyboardFocus.tsx"],"sourcesContent":["import React, { PureComponent } from 'react';\nimport createHoc from '../createHoc';\nimport { internalSetState } from '../uncontroll';\nimport fire from '../fire';\nimport { UnknownProperties } from '../core';\n\n/** @deprecated */\nexport interface IEnhancedWithKeyboardFocusInjectedProps\n extends EnhancedWithKeyboardFocusInjectedProps {}\nexport type EnhancedWithKeyboardFocusInjectedProps = {\n tabIndex: number;\n keyboardFocused: boolean;\n\n onFocus(e: FocusEvent): void;\n\n onBlur(e: FocusEvent): void;\n\n onKeyDown(e: KeyboardEvent): void;\n\n onMouseDown(e: MouseEvent): void;\n};\n\n/** @deprecated */\nexport interface IEnhancedWithKeyboardFocusProps\n extends EnhancedWithKeyboardFocusProps,\n UnknownProperties {}\nexport type EnhancedWithKeyboardFocusProps = {\n keyboardFocused?: boolean;\n tabIndex?: number;\n disabled?: boolean;\n\n children(props: IEnhancedWithKeyboardFocusInjectedProps): React.ReactNode;\n};\n\n/** @deprecated */\nexport interface IEnhancedWithKeyboardFocusState\n extends EnhancedWithKeyboardFocusState,\n UnknownProperties {}\nexport type EnhancedWithKeyboardFocusState = {\n keyboardFocused: boolean;\n};\n\nlet usingKeyBoard = true;\n\nexport class EnhancedWithKeyboardFocus extends PureComponent<\n IEnhancedWithKeyboardFocusProps,\n IEnhancedWithKeyboardFocusState\n> {\n static displayName = 'EnhancedWithKeyboardFocus';\n\n static defaultProps = {\n tabIndex: 0,\n };\n\n static getDerivedStateFromProps(props: any, state: any) {\n if (props.keyboardFocused !== undefined) {\n return {\n keyboardFocused: props.keyboardFocused,\n };\n }\n return state;\n }\n\n state = {\n keyboardFocused: false,\n };\n\n handlerFocus = (e: FocusEvent) => {\n fire(this, 'onFocus', e);\n if (usingKeyBoard) {\n internalSetState(this, { keyboardFocused: true });\n }\n };\n\n handlerBlur = (e: FocusEvent) => {\n fire(this, 'onBlur', e);\n internalSetState(this, { keyboardFocused: false });\n };\n\n handlerKeyDown = (e: KeyboardEvent) => {\n fire(this, 'onKeyDown', e);\n usingKeyBoard = true;\n };\n\n handlerMouseDown = (e: MouseEvent) => {\n fire(this, 'onMouseDown', e);\n usingKeyBoard = false;\n };\n\n render() {\n const { children, tabIndex, disabled } = this.props;\n const { keyboardFocused } = this.state;\n return children({\n tabIndex: disabled ? -1 : tabIndex!,\n keyboardFocused,\n onFocus: this.handlerFocus,\n onBlur: this.handlerBlur,\n onKeyDown: this.handlerKeyDown,\n onMouseDown: this.handlerMouseDown,\n });\n }\n}\n\nexport default createHoc(EnhancedWithKeyboardFocus);\n"],"mappings":";;;;;;AAAA,SAAgBA,aAAa,QAAQ,OAAO;AAC5C,OAAOC,SAAS,MAAM,kBAAc;AACpC,SAASC,gBAAgB,QAAQ,mBAAe;AAChD,OAAOC,IAAI,MAAM,aAAS;AAuC1B,IAAIC,aAAa,GAAG,IAAI;AAExB,WAAaC,yBAAyB,0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CAACI,yBAAyB,CAAC"}
@@ -1,4 +1,4 @@
1
- import { UnknownProperties } from 'intergalactic/core';
1
+ import { UnknownProperties } from '../core';
2
2
  /** @deprecated */
3
3
  export interface IWithAnimatedSizeEnhanceProps extends WithAnimatedSizeEnhanceProps, UnknownProperties {
4
4
  }
@@ -1 +1 @@
1
- {"version":3,"file":"animatedSizeEnhance.js","names":["_react","_interopRequireDefault","require","_ref2","_useEnhancedEffect","_excluded","uniqueId","animatedSizeEnhance","_ref","_ref$animateProps","animateProps","_ref$onChangeOf","onChangeOf","props","ref","__animatedEnhanceInstanceId","duration","other","_objectWithoutProperties2","nodeRef","React","createRef","lastSizesRef","useRef","prevPropsRef","animatedSizeInstanceIdRef","current","useEnhancedEffect","animationsDisabled","undefined","node","every","value","i","length","getBoundingClientRect","sizes","Math","abs","style","getPropertyValue","endsWith","transition","concat","timeout","handleTransitionEnd","clearTimeout","removeEventListener","animationFrame","requestAnimationFrame","addEventListener","setTimeout","cancelAnimationFrame","_toConsumableArray2","map","propName","_objectSpread2","useForkRef","_default","exports"],"sources":["../../src/enhances/animatedSizeEnhance.tsx"],"sourcesContent":["import React from 'react';\nimport { useForkRef } from '../ref';\nimport useEnhancedEffect from '../use/useEnhancedEffect';\nimport { UnknownProperties } from '@semcore/core';\n\n/** @deprecated */\nexport interface IWithAnimatedSizeEnhanceProps\n extends WithAnimatedSizeEnhanceProps,\n UnknownProperties {}\nexport type WithAnimatedSizeEnhanceProps = {\n animationsDisabled?: boolean;\n};\n\nlet uniqueId = 0;\n\nfunction animatedSizeEnhance({\n animateProps = [],\n onChangeOf = [],\n}: {\n animateProps: ('width' | 'height')[];\n onChangeOf: string[];\n}) {\n return (props: any) => {\n const { ref, __animatedEnhanceInstanceId, duration, ...other } = props;\n const nodeRef = React.createRef<HTMLElement>();\n const lastSizesRef = React.useRef<(number | undefined)[]>([]);\n const prevPropsRef = React.useRef(props);\n const animatedSizeInstanceIdRef = React.useRef(uniqueId++);\n\n prevPropsRef.current = props;\n\n useEnhancedEffect(() => {\n if (props.animationsDisabled) return;\n if (\n __animatedEnhanceInstanceId !== undefined &&\n __animatedEnhanceInstanceId !== animatedSizeInstanceIdRef.current\n )\n return;\n if (!nodeRef.current) {\n return;\n }\n const node = nodeRef.current;\n if (lastSizesRef.current.every((value) => value === undefined)) {\n for (let i = 0; i < animateProps.length; i++) {\n lastSizesRef.current[i] = node.getBoundingClientRect()[animateProps[i]];\n }\n return;\n }\n\n const sizes: (number | undefined)[] = [];\n for (let i = 0; i < animateProps.length; i++) {\n sizes[i] = node.getBoundingClientRect()[animateProps[i]];\n if (\n Math.abs(lastSizesRef.current[i]! - sizes[i]!) < 3 ||\n node.style.getPropertyValue(animateProps[i]).endsWith('%')\n ) {\n lastSizesRef.current[i] = sizes[i];\n sizes[i] = undefined;\n }\n }\n if (sizes.every((value) => value === undefined)) return;\n\n node.style.transition = 'none';\n for (let i = 0; i < animateProps.length; i++) {\n node.style[animateProps[i]] = `${lastSizesRef.current[i]}px`;\n }\n let timeout = -1;\n const handleTransitionEnd = () => {\n clearTimeout(timeout);\n if (!node) return;\n node.style.transition = null as any;\n for (let i = 0; i < animateProps.length; i++) {\n node.style[animateProps[i]] = null as any;\n }\n node.removeEventListener('transitionend', handleTransitionEnd);\n node.removeEventListener('transitioncancel', handleTransitionEnd);\n };\n const animationFrame = requestAnimationFrame(() => {\n if (!node) return;\n node.addEventListener('transitionend', handleTransitionEnd);\n node.addEventListener('transitioncancel', handleTransitionEnd);\n node.style.transition = `${duration}ms all ease-in-out`;\n for (let i = 0; i < animateProps.length; i++) {\n lastSizesRef.current[i] = sizes[i];\n node.style[animateProps[i]] = `${sizes[i]}px`;\n }\n });\n timeout = setTimeout(handleTransitionEnd, 500) as any;\n return () => {\n cancelAnimationFrame(animationFrame);\n handleTransitionEnd();\n };\n }, [\n __animatedEnhanceInstanceId,\n props.animationsDisabled,\n duration,\n ...onChangeOf.map((propName) => props[propName]),\n ]);\n\n return {\n ref: useForkRef(ref, nodeRef),\n __animatedEnhanceInstanceId: __animatedEnhanceInstanceId ?? animatedSizeInstanceIdRef.current,\n ...other,\n };\n };\n}\n\nexport default animatedSizeEnhance;\n"],"mappings":";;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,kBAAA,GAAAH,sBAAA,CAAAC,OAAA;AAAyD,IAAAG,SAAA;AAWzD,IAAIC,QAAQ,GAAG,CAAC;AAEhB,SAASC,mBAAmBA,CAAAC,IAAA,EAMzB;EAAA,IAAAC,iBAAA,GAAAD,IAAA,CALDE,YAAY;IAAZA,YAAY,GAAAD,iBAAA,cAAG,EAAE,GAAAA,iBAAA;IAAAE,eAAA,GAAAH,IAAA,CACjBI,UAAU;IAAVA,UAAU,GAAAD,eAAA,cAAG,EAAE,GAAAA,eAAA;EAKf,OAAO,UAACE,KAAU,EAAK;IACrB,IAAQC,GAAG,GAAsDD,KAAK,CAA9DC,GAAG;MAAEC,2BAA2B,GAAyBF,KAAK,CAAzDE,2BAA2B;MAAEC,QAAQ,GAAeH,KAAK,CAA5BG,QAAQ;MAAKC,KAAK,OAAAC,yBAAA,aAAKL,KAAK,EAAAR,SAAA;IACtE,IAAMc,OAAO,gBAAGC,iBAAK,CAACC,SAAS,EAAe;IAC9C,IAAMC,YAAY,GAAGF,iBAAK,CAACG,MAAM,CAAyB,EAAE,CAAC;IAC7D,IAAMC,YAAY,GAAGJ,iBAAK,CAACG,MAAM,CAACV,KAAK,CAAC;IACxC,IAAMY,yBAAyB,GAAGL,iBAAK,CAACG,MAAM,CAACjB,QAAQ,EAAE,CAAC;IAE1DkB,YAAY,CAACE,OAAO,GAAGb,KAAK;IAE5B,IAAAc,6BAAiB,EAAC,YAAM;MACtB,IAAId,KAAK,CAACe,kBAAkB,EAAE;MAC9B,IACEb,2BAA2B,KAAKc,SAAS,IACzCd,2BAA2B,KAAKU,yBAAyB,CAACC,OAAO,EAEjE;MACF,IAAI,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,CAACuB,GAAC,CAAC,CAAC,MAAAU,MAAA,CAAMP,KAAK,CAACH,GAAC,CAAC,OAAI;QAC/C;MACF,CAAC,CAAC;MACFW,OAAO,GAAGO,UAAU,CAACN,mBAAmB,EAAE,GAAG,CAAQ;MACrD,OAAO,YAAM;QACXO,oBAAoB,CAACJ,cAAc,CAAC;QACpCH,mBAAmB,EAAE;MACvB,CAAC;IACH,CAAC,GACC9B,2BAA2B,EAC3BF,KAAK,CAACe,kBAAkB,EACxBZ,QAAQ,EAAA2B,MAAA,KAAAU,mBAAA,aACLzC,UAAU,CAAC0C,GAAG,CAAC,UAACC,QAAQ;MAAA,OAAK1C,KAAK,CAAC0C,QAAQ,CAAC;IAAA,EAAC,GAChD;IAEF,WAAAC,cAAA;MACE1C,GAAG,EAAE,IAAA2C,gBAAU,EAAC3C,GAAG,EAAEK,OAAO,CAAC;MAC7BJ,2BAA2B,EAAEA,2BAA2B,aAA3BA,2BAA2B,cAA3BA,2BAA2B,GAAIU,yBAAyB,CAACC;IAAO,GAC1FT,KAAK;EAEZ,CAAC;AACH;AAAC,IAAAyC,QAAA,GAEcnD,mBAAmB;AAAAoD,OAAA,cAAAD,QAAA"}
1
+ {"version":3,"file":"animatedSizeEnhance.js","names":["_react","_interopRequireDefault","require","_ref2","_useEnhancedEffect","_excluded","uniqueId","animatedSizeEnhance","_ref","_ref$animateProps","animateProps","_ref$onChangeOf","onChangeOf","props","ref","__animatedEnhanceInstanceId","duration","other","_objectWithoutProperties2","nodeRef","React","createRef","lastSizesRef","useRef","prevPropsRef","animatedSizeInstanceIdRef","current","useEnhancedEffect","animationsDisabled","undefined","node","every","value","i","length","getBoundingClientRect","sizes","Math","abs","style","getPropertyValue","endsWith","transition","concat","timeout","handleTransitionEnd","clearTimeout","removeEventListener","animationFrame","requestAnimationFrame","addEventListener","setTimeout","cancelAnimationFrame","_toConsumableArray2","map","propName","_objectSpread2","useForkRef","_default","exports"],"sources":["../../src/enhances/animatedSizeEnhance.tsx"],"sourcesContent":["import React from 'react';\nimport { useForkRef } from '../ref';\nimport useEnhancedEffect from '../use/useEnhancedEffect';\nimport { UnknownProperties } from '../core';\n\n/** @deprecated */\nexport interface IWithAnimatedSizeEnhanceProps\n extends WithAnimatedSizeEnhanceProps,\n UnknownProperties {}\nexport type WithAnimatedSizeEnhanceProps = {\n animationsDisabled?: boolean;\n};\n\nlet uniqueId = 0;\n\nfunction animatedSizeEnhance({\n animateProps = [],\n onChangeOf = [],\n}: {\n animateProps: ('width' | 'height')[];\n onChangeOf: string[];\n}) {\n return (props: any) => {\n const { ref, __animatedEnhanceInstanceId, duration, ...other } = props;\n const nodeRef = React.createRef<HTMLElement>();\n const lastSizesRef = React.useRef<(number | undefined)[]>([]);\n const prevPropsRef = React.useRef(props);\n const animatedSizeInstanceIdRef = React.useRef(uniqueId++);\n\n prevPropsRef.current = props;\n\n useEnhancedEffect(() => {\n if (props.animationsDisabled) return;\n if (\n __animatedEnhanceInstanceId !== undefined &&\n __animatedEnhanceInstanceId !== animatedSizeInstanceIdRef.current\n )\n return;\n if (!nodeRef.current) {\n return;\n }\n const node = nodeRef.current;\n if (lastSizesRef.current.every((value) => value === undefined)) {\n for (let i = 0; i < animateProps.length; i++) {\n lastSizesRef.current[i] = node.getBoundingClientRect()[animateProps[i]];\n }\n return;\n }\n\n const sizes: (number | undefined)[] = [];\n for (let i = 0; i < animateProps.length; i++) {\n sizes[i] = node.getBoundingClientRect()[animateProps[i]];\n if (\n Math.abs(lastSizesRef.current[i]! - sizes[i]!) < 3 ||\n node.style.getPropertyValue(animateProps[i]).endsWith('%')\n ) {\n lastSizesRef.current[i] = sizes[i];\n sizes[i] = undefined;\n }\n }\n if (sizes.every((value) => value === undefined)) return;\n\n node.style.transition = 'none';\n for (let i = 0; i < animateProps.length; i++) {\n node.style[animateProps[i]] = `${lastSizesRef.current[i]}px`;\n }\n let timeout = -1;\n const handleTransitionEnd = () => {\n clearTimeout(timeout);\n if (!node) return;\n node.style.transition = null as any;\n for (let i = 0; i < animateProps.length; i++) {\n node.style[animateProps[i]] = null as any;\n }\n node.removeEventListener('transitionend', handleTransitionEnd);\n node.removeEventListener('transitioncancel', handleTransitionEnd);\n };\n const animationFrame = requestAnimationFrame(() => {\n if (!node) return;\n node.addEventListener('transitionend', handleTransitionEnd);\n node.addEventListener('transitioncancel', handleTransitionEnd);\n node.style.transition = `${duration}ms all ease-in-out`;\n for (let i = 0; i < animateProps.length; i++) {\n lastSizesRef.current[i] = sizes[i];\n node.style[animateProps[i]] = `${sizes[i]}px`;\n }\n });\n timeout = setTimeout(handleTransitionEnd, 500) as any;\n return () => {\n cancelAnimationFrame(animationFrame);\n handleTransitionEnd();\n };\n }, [\n __animatedEnhanceInstanceId,\n props.animationsDisabled,\n duration,\n ...onChangeOf.map((propName) => props[propName]),\n ]);\n\n return {\n ref: useForkRef(ref, nodeRef),\n __animatedEnhanceInstanceId: __animatedEnhanceInstanceId ?? animatedSizeInstanceIdRef.current,\n ...other,\n };\n };\n}\n\nexport default animatedSizeEnhance;\n"],"mappings":";;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,kBAAA,GAAAH,sBAAA,CAAAC,OAAA;AAAyD,IAAAG,SAAA;AAWzD,IAAIC,QAAQ,GAAG,CAAC;AAEhB,SAASC,mBAAmBA,CAAAC,IAAA,EAMzB;EAAA,IAAAC,iBAAA,GAAAD,IAAA,CALDE,YAAY;IAAZA,YAAY,GAAAD,iBAAA,cAAG,EAAE,GAAAA,iBAAA;IAAAE,eAAA,GAAAH,IAAA,CACjBI,UAAU;IAAVA,UAAU,GAAAD,eAAA,cAAG,EAAE,GAAAA,eAAA;EAKf,OAAO,UAACE,KAAU,EAAK;IACrB,IAAQC,GAAG,GAAsDD,KAAK,CAA9DC,GAAG;MAAEC,2BAA2B,GAAyBF,KAAK,CAAzDE,2BAA2B;MAAEC,QAAQ,GAAeH,KAAK,CAA5BG,QA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B;AAAAoD,OAAA,cAAAD,QAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"animatedSizeEnhance.mjs","names":["React","useForkRef","useEnhancedEffect","uniqueId","animatedSizeEnhance","_ref","_ref$animateProps","animateProps","_ref$onChangeOf","onChangeOf","props","ref","__animatedEnhanceInstanceId","duration","other","_objectWithoutProperties","_excluded","nodeRef","createRef","lastSizesRef","useRef","prevPropsRef","animatedSizeInstanceIdRef","current","animationsDisabled","undefined","node","every","value","i","length","getBoundingClientRect","sizes","Math","abs","style","getPropertyValue","endsWith","transition","concat","timeout","handleTransitionEnd","clearTimeout","removeEventListener","animationFrame","requestAnimationFrame","addEventListener","setTimeout","cancelAnimationFrame","_toConsumableArray","map","propName","_objectSpread"],"sources":["../../src/enhances/animatedSizeEnhance.tsx"],"sourcesContent":["import React from 'react';\nimport { useForkRef } from '../ref';\nimport useEnhancedEffect from '../use/useEnhancedEffect';\nimport { UnknownProperties } from '@semcore/core';\n\n/** @deprecated */\nexport interface IWithAnimatedSizeEnhanceProps\n extends WithAnimatedSizeEnhanceProps,\n UnknownProperties {}\nexport type WithAnimatedSizeEnhanceProps = {\n animationsDisabled?: boolean;\n};\n\nlet uniqueId = 0;\n\nfunction animatedSizeEnhance({\n animateProps = [],\n onChangeOf = [],\n}: {\n animateProps: ('width' | 'height')[];\n onChangeOf: string[];\n}) {\n return (props: any) => {\n const { ref, __animatedEnhanceInstanceId, duration, ...other } = props;\n const nodeRef = React.createRef<HTMLElement>();\n const lastSizesRef = React.useRef<(number | undefined)[]>([]);\n const prevPropsRef = React.useRef(props);\n const animatedSizeInstanceIdRef = React.useRef(uniqueId++);\n\n prevPropsRef.current = props;\n\n useEnhancedEffect(() => {\n if (props.animationsDisabled) return;\n if (\n __animatedEnhanceInstanceId !== undefined &&\n __animatedEnhanceInstanceId !== animatedSizeInstanceIdRef.current\n )\n return;\n if (!nodeRef.current) {\n return;\n }\n const node = nodeRef.current;\n if (lastSizesRef.current.every((value) => value === undefined)) {\n for (let i = 0; i < animateProps.length; i++) {\n lastSizesRef.current[i] = node.getBoundingClientRect()[animateProps[i]];\n }\n return;\n }\n\n const sizes: (number | undefined)[] = [];\n for (let i = 0; i < animateProps.length; i++) {\n sizes[i] = node.getBoundingClientRect()[animateProps[i]];\n if (\n Math.abs(lastSizesRef.current[i]! - sizes[i]!) < 3 ||\n node.style.getPropertyValue(animateProps[i]).endsWith('%')\n ) {\n lastSizesRef.current[i] = sizes[i];\n sizes[i] = undefined;\n }\n }\n if (sizes.every((value) => value === undefined)) return;\n\n node.style.transition = 'none';\n for (let i = 0; i < animateProps.length; i++) {\n node.style[animateProps[i]] = `${lastSizesRef.current[i]}px`;\n }\n let timeout = -1;\n const handleTransitionEnd = () => {\n clearTimeout(timeout);\n if (!node) return;\n node.style.transition = null as any;\n for (let i = 0; i < animateProps.length; i++) {\n node.style[animateProps[i]] = null as any;\n }\n node.removeEventListener('transitionend', handleTransitionEnd);\n node.removeEventListener('transitioncancel', handleTransitionEnd);\n };\n const animationFrame = requestAnimationFrame(() => {\n if (!node) return;\n node.addEventListener('transitionend', handleTransitionEnd);\n node.addEventListener('transitioncancel', handleTransitionEnd);\n node.style.transition = `${duration}ms all ease-in-out`;\n for (let i = 0; i < animateProps.length; i++) {\n lastSizesRef.current[i] = sizes[i];\n node.style[animateProps[i]] = `${sizes[i]}px`;\n }\n });\n timeout = setTimeout(handleTransitionEnd, 500) as any;\n return () => {\n cancelAnimationFrame(animationFrame);\n handleTransitionEnd();\n };\n }, [\n __animatedEnhanceInstanceId,\n props.animationsDisabled,\n duration,\n ...onChangeOf.map((propName) => props[propName]),\n ]);\n\n return {\n ref: useForkRef(ref, nodeRef),\n __animatedEnhanceInstanceId: __animatedEnhanceInstanceId ?? animatedSizeInstanceIdRef.current,\n ...other,\n };\n };\n}\n\nexport default animatedSizeEnhance;\n"],"mappings":";;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,UAAU,QAAQ,YAAQ;AACnC,OAAOC,iBAAi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C,GACC7B,2BAA2B,EAC3BF,KAAK,CAACc,kBAAkB,EACxBX,QAAQ,EAAA0B,MAAA,CAAAU,kBAAA,CACLxC,UAAU,CAACyC,GAAG,CAAC,UAACC,QAAQ;MAAA,OAAKzC,KAAK,CAACyC,QAAQ,CAAC;IAAA,EAAC,GAChD;IAEF,OAAAC,aAAA;MACEzC,GAAG,EAAEV,UAAU,CAACU,GAAG,EAAEM,OAAO,CAAC;MAC7BL,2BAA2B,EAAEA,2BAA2B,aAA3BA,2BAA2B,cAA3BA,2BAA2B,GAAIU,yBAAyB,CAACC;IAAO,GAC1FT,KAAK;EAEZ,CAAC;AACH;AAEA,eAAeV,mBAAmB"}
1
+ {"version":3,"file":"animatedSizeEnhance.mjs","names":["React","useForkRef","useEnhancedEffect","uniqueId","animatedSizeEnhance","_ref","_ref$animateProps","animateProps","_ref$onChangeOf","onChangeOf","props","ref","__animatedEnhanceInstanceId","duration","other","_objectWithoutProperties","_excluded","nodeRef","createRef","lastSizesRef","useRef","prevPropsRef","animatedSizeInstanceIdRef","current","animationsDisabled","undefined","node","every","value","i","length","getBoundingClientRect","sizes","Math","abs","style","getPropertyValue","endsWith","transition","concat","timeout","handleTransitionEnd","clearTimeout","removeEventListener","animationFrame","requestAnimationFrame","addEventListener","setTimeout","cancelAnimationFrame","_toConsumableArray","map","propName","_objectSpread"],"sources":["../../src/enhances/animatedSizeEnhance.tsx"],"sourcesContent":["import React from 'react';\nimport { useForkRef } from '../ref';\nimport useEnhancedEffect from '../use/useEnhancedEffect';\nimport { UnknownProperties } from '../core';\n\n/** @deprecated */\nexport interface IWithAnimatedSizeEnhanceProps\n extends WithAnimatedSizeEnhanceProps,\n UnknownProperties {}\nexport type WithAnimatedSizeEnhanceProps = {\n animationsDisabled?: boolean;\n};\n\nlet uniqueId = 0;\n\nfunction animatedSizeEnhance({\n animateProps = [],\n onChangeOf = [],\n}: {\n animateProps: ('width' | 'height')[];\n onChangeOf: string[];\n}) {\n return (props: any) => {\n const { ref, __animatedEnhanceInstanceId, duration, ...other } = props;\n const nodeRef = React.createRef<HTMLElement>();\n const lastSizesRef = React.useRef<(number | undefined)[]>([]);\n const prevPropsRef = React.useRef(props);\n const animatedSizeInstanceIdRef = React.useRef(uniqueId++);\n\n prevPropsRef.current = props;\n\n useEnhancedEffect(() => {\n if (props.animationsDisabled) return;\n if (\n __animatedEnhanceInstanceId !== undefined &&\n __animatedEnhanceInstanceId !== animatedSizeInstanceIdRef.current\n )\n return;\n if (!nodeRef.current) {\n return;\n }\n const node = nodeRef.current;\n if (lastSizesRef.current.every((value) => value === undefined)) {\n for (let i = 0; i < animateProps.length; i++) {\n lastSizesRef.current[i] = node.getBoundingClientRect()[animateProps[i]];\n }\n return;\n }\n\n const sizes: (number | undefined)[] = [];\n for (let i = 0; i < animateProps.length; i++) {\n sizes[i] = node.getBoundingClientRect()[animateProps[i]];\n if (\n Math.abs(lastSizesRef.current[i]! - sizes[i]!) < 3 ||\n node.style.getPropertyValue(animateProps[i]).endsWith('%')\n ) {\n lastSizesRef.current[i] = sizes[i];\n sizes[i] = undefined;\n }\n }\n if (sizes.every((value) => value === undefined)) return;\n\n node.style.transition = 'none';\n for (let i = 0; i < animateProps.length; i++) {\n node.style[animateProps[i]] = `${lastSizesRef.current[i]}px`;\n }\n let timeout = -1;\n const handleTransitionEnd = () => {\n clearTimeout(timeout);\n if (!node) return;\n node.style.transition = null as any;\n for (let i = 0; i < animateProps.length; i++) {\n node.style[animateProps[i]] = null as any;\n }\n node.removeEventListener('transitionend', handleTransitionEnd);\n node.removeEventListener('transitioncancel', handleTransitionEnd);\n };\n const animationFrame = requestAnimationFrame(() => {\n if (!node) return;\n node.addEventListener('transitionend', handleTransitionEnd);\n node.addEventListener('transitioncancel', handleTransitionEnd);\n node.style.transition = `${duration}ms all ease-in-out`;\n for (let i = 0; i < animateProps.length; i++) {\n lastSizesRef.current[i] = sizes[i];\n node.style[animateProps[i]] = `${sizes[i]}px`;\n }\n });\n timeout = setTimeout(handleTransitionEnd, 500) as any;\n return () => {\n cancelAnimationFrame(animationFrame);\n handleTransitionEnd();\n };\n }, [\n __animatedEnhanceInstanceId,\n props.animationsDisabled,\n duration,\n ...onChangeOf.map((propName) => props[propName]),\n ]);\n\n return {\n ref: useForkRef(ref, nodeRef),\n __animatedEnhanceInstanceId: __animatedEnhanceInstanceId ?? animatedSizeInstanceIdRef.current,\n ...other,\n };\n };\n}\n\nexport default animatedSizeEnhance;\n"],"mappings":";;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,UAAU,QAAQ,YAAQ;AACnC,OAAOC,iBAAiB,MAAM,8BAA0B;AAWxD,IAAIC,QAAQ,GAAG,CAAC;AAEhB,SAASC,mBAAmBA,CAAAC,IAAA,EAMzB;EAAA,IAAAC,iBAAA,GAAAD,IAAA,CALDE,YAAY;IAAZA,YAAY,GAAAD,iBAAA,cAAG,EAAE,GAAAA,iBAAA;IAAAE,eAAA,GAAAH,IAAA,CACjBI,UAAU;IAAVA,UAAU,GAAAD,eAAA,cAAG,EAAE,GAAAA,eAAA;EAKf,OAAO,UAACE,KAAU,EAAK;IACrB,IAAQC,GAAG,GAAsDD,KAAK,CAA9DC,GAAG;MAAEC,2BAA2B,GAAyBF,KAAK,CAAzDE,2BAA2B;MAAEC,QAAQ,GAAeH,KAAK,CAA5BG,QAAQ;MAAKC,KAAK,GAAAC,wBAAA,CAAKL,KAAK,EAAAM,SAAA;IACtE,IAAMC,OAAO,gBAAGjB,KAAK,CAACkB,SAAS,EAAe;IAC9C,IAAMC,YAAY,GAAGnB,KAAK,CAACoB,MAAM,CAAyB,EAAE,CAAC;IAC7D,IAAMC,YAAY,GAAGrB,KAAK,CAACoB,MAAM,CAACV,KAAK,CAAC;IACxC,IAAMY,yBAAyB,GAAGtB,KAAK,CAACoB,MAAM,CAACjB,QAAQ,EAAE,CAAC;IAE1DkB,YAAY,CAACE,OAAO,GAAGb,KAAK;IAE5BR,iBAAiB,CAAC,YAAM;MACtB,IAAIQ,KAAK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AE;UAC5CV,YAAY,CAACI,OAAO,CAACM,GAAC,CAAC,GAAGG,KAAK,CAACH,GAAC,CAAC;UAClCH,IAAI,CAACS,KAAK,CAAC5B,YAAY,CAACsB,GAAC,CAAC,CAAC,MAAAU,MAAA,CAAMP,KAAK,CAACH,GAAC,CAAC,OAAI;QAC/C;MACF,CAAC,CAAC;MACFW,OAAO,GAAGO,UAAU,CAACN,mBAAmB,EAAE,GAAG,CAAQ;MACrD,OAAO,YAAM;QACXO,oBAAoB,CAACJ,cAAc,CAAC;QACpCH,mBAAmB,EAAE;MACvB,CAAC;IACH,CAAC,GACC7B,2BAA2B,EAC3BF,KAAK,CAACc,kBAAkB,EACxBX,QAAQ,EAAA0B,MAAA,CAAAU,kBAAA,CACLxC,UAAU,CAACyC,GAAG,CAAC,UAACC,QAAQ;MAAA,OAAKzC,KAAK,CAACyC,QAAQ,CAAC;IAAA,EAAC,GAChD;IAEF,OAAAC,aAAA;MACEzC,GAAG,EAAEV,UAAU,CAACU,GAAG,EAAEM,OAAO,CAAC;MAC7BL,2BAA2B,EAAEA,2BAA2B,aAA3BA,2BAA2B,cAA3BA,2BAA2B,GAAIU,yBAAyB,CAACC;IAAO,GAC1FT,KAAK;EAEZ,CAAC;AACH;AAEA,eAAeV,mBAAmB"}
@@ -1,4 +1,4 @@
1
- import { UnknownProperties } from 'intergalactic/core';
1
+ import { UnknownProperties } from '../core';
2
2
  /** @deprecated */
3
3
  export interface IWithAutoFocusEnhanceProps extends WithAutoFocusEnhanceProps, UnknownProperties {
4
4
  }
@@ -1 +1 @@
1
- {"version":3,"file":"autoFocusEnhance.js","names":["_react","_interopRequireDefault","require","_ref","_excluded","notUsingNativeAutoFocus","autoFocus","autoFocusEnhance","props","ref","other","_objectWithoutProperties2","nodeRef","React","createRef","useEffect","inputNode","current","focus","timer","setTimeout","clearTimeout","_objectSpread2","useForkRef","_default","exports"],"sources":["../../src/enhances/autoFocusEnhance.tsx"],"sourcesContent":["import React from 'react';\nimport { useForkRef } from '../ref';\nimport { UnknownProperties, Intergalactic } from '@semcore/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,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,IAAA,GAAAD,OAAA;AAAoC,IAAAE,SAAA;AAGpC,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,OAAAC,yBAAA,aAAKH,KAAK,EAAAJ,SAAA;IAC1C,IAAI,CAACC,uBAAuB,CAACC,SAAS,CAAC,EAAE;MACvC,OAAOE,KAAK;IACd;IACA,IAAMI,OAAO,gBAAGC,iBAAK,CAACC,SAAS,EAAe;IAC9CD,iBAAK,CAACE,SAAS,CAAC,YAAM;MACpB,IAAIT,SAAS,KAAK,KAAK,EAAE;MACzB,IAAiBU,SAAS,GAAKJ,OAAO,CAA9BK,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,WAAAgB,cAAA;MACEb,GAAG,EAAE,IAAAc,eAAU,EAACd,GAAG,EAAEG,OAAO;IAAC,GAC1BF,KAAK;EAEZ,CAAC;AACH;AAAC,IAAAc,QAAA,GAEcjB,gBAAgB;AAAAkB,OAAA,cAAAD,QAAA"}
1
+ {"version":3,"file":"autoFocusEnhance.js","names":["_react","_interopRequireDefault","require","_ref","_excluded","notUsingNativeAutoFocus","autoFocus","autoFocusEnhance","props","ref","other","_objectWithoutProperties2","nodeRef","React","createRef","useEffect","inputNode","current","focus","timer","setTimeout","clearTimeout","_objectSpread2","useForkRef","_default","exports"],"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,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,IAAA,GAAAD,OAAA;AAAoC,IAAAE,SAAA;AAGpC,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,OAAAC,yBAAA,aAAKH,KAAK,EAAAJ,SAAA;IAC1C,IAAI,CAACC,uBAAuB,CAACC,SAAS,CAAC,EAAE;MACvC,OAAOE,KAAK;IACd;IACA,IAAMI,OAAO,gBAAGC,iBAAK,CAACC,SAAS,EAAe;IAC9CD,iBAAK,CAACE,SAAS,CAAC,YAAM;MACpB,IAAIT,SAAS,KAAK,KAAK,EAAE;MACzB,IAAiBU,SAAS,GAAKJ,OAAO,CAA9BK,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,K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