@cloud-app-dev/vidc 3.2.11 → 3.2.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (347) hide show
  1. package/.dumirc.ts +71 -0
  2. package/.editorconfig +0 -3
  3. package/.eslintrc.js +3 -0
  4. package/.fatherrc.ts +19 -0
  5. package/.husky/commit-msg +5 -0
  6. package/.husky/pre-commit +4 -0
  7. package/.prettierrc.js +16 -0
  8. package/README.md +14 -26
  9. package/es/Api/index.js +100 -30
  10. package/es/AppContext/Sync.js +19 -3
  11. package/es/AppContext/index.js +86 -42
  12. package/es/AppContext/static.js +7 -0
  13. package/es/Auth/index.js +11 -4
  14. package/es/AutoExit/index.js +11 -3
  15. package/es/Box/BetweenBox/index.js +19 -10
  16. package/es/Box/BetweenBox/{index.css → index.less} +0 -0
  17. package/es/Box/InfoBox/index.js +24 -18
  18. package/es/Box/InfoBox/index.less +22 -0
  19. package/es/Box/TwoColumnBox/index.js +42 -25
  20. package/es/Box/TwoColumnBox/index.less +70 -0
  21. package/es/Box/deps/grid-factory.d.ts +2 -2
  22. package/es/Box/deps/grid-factory.js +12 -0
  23. package/es/Box/index.js +29 -16
  24. package/es/Box/{index.css → index.less} +5 -4
  25. package/es/CheckGroupFixed/demo.d.ts +3 -0
  26. package/es/CheckGroupFixed/demo.js +28 -0
  27. package/es/CheckGroupFixed/index.js +117 -82
  28. package/es/CheckGroupFixed/index.less +50 -0
  29. package/es/Config/index.js +5 -1
  30. package/es/Config/utils.js +18 -3
  31. package/es/ConfigContext/index.js +8 -4
  32. package/es/CustomRenderSelect/index.js +71 -36
  33. package/es/CustomRenderSelect/index.less +25 -0
  34. package/es/DisableMark/index.js +14 -11
  35. package/es/DisableMark/{index.css → index.less} +0 -0
  36. package/es/DomMove/demo.js +14 -10
  37. package/es/DomMove/index.js +52 -30
  38. package/es/DomMove/utils.js +8 -3
  39. package/es/Drag/DragAndDropItem.js +44 -20
  40. package/es/Drag/DropItem.js +22 -6
  41. package/es/Drag/index.js +2 -2
  42. package/es/Drag/{index.css → index.less} +0 -0
  43. package/es/Drawer/Footer.js +22 -15
  44. package/es/Drawer/{Demo.d.ts → demo.d.ts} +0 -0
  45. package/es/Drawer/demo.js +109 -0
  46. package/es/Drawer/index.js +98 -60
  47. package/es/Drawer/index.less +42 -0
  48. package/es/ErrorFallback/index.js +23 -14
  49. package/es/FrontendPlayer/index.js +1 -1
  50. package/es/FullScreen/index.js +30 -17
  51. package/es/FullScreen/index.less +16 -0
  52. package/es/HightLevel/index.js +11 -4
  53. package/es/HightLevel/{index.css → index.less} +0 -0
  54. package/es/IconFont/index.js +39 -18
  55. package/es/ImageView/index.js +37 -13
  56. package/es/ImageView/index.less +10 -0
  57. package/es/Input/demo.d.ts +3 -0
  58. package/es/Input/demo.js +16 -0
  59. package/es/Input/index.js +46 -22
  60. package/es/Input/index.less +12 -0
  61. package/es/InstanceHistory/index.js +2 -0
  62. package/es/LabelValue/index.js +25 -18
  63. package/es/LabelValue/index.less +20 -0
  64. package/es/List/DynamicGridList/Demo.d.ts +1 -0
  65. package/es/List/DynamicGridList/Demo.js +52 -32
  66. package/es/List/DynamicGridList/index.d.ts +3 -3
  67. package/es/List/DynamicGridList/index.js +41 -26
  68. package/es/List/DynamicList/index.js +76 -56
  69. package/es/List/DynamicList/index.less +15 -0
  70. package/es/List/GridList/Demo.d.ts +1 -0
  71. package/es/List/GridList/Demo.js +60 -38
  72. package/es/List/GridList/hook.d.ts +1 -1
  73. package/es/List/GridList/hook.js +66 -35
  74. package/es/List/GridList/index.js +33 -29
  75. package/es/List/GridList/{index.css → index.less} +0 -0
  76. package/es/List/GridList/utils.d.ts +2 -2
  77. package/es/List/GridList/utils.js +1 -0
  78. package/es/List/VList/index.d.ts +1 -1
  79. package/es/List/VList/index.js +32 -19
  80. package/es/List/VList/{index.css → index.less} +0 -0
  81. package/es/List/VList/utils.d.ts +2 -2
  82. package/es/List/VList/utils.js +8 -6
  83. package/es/List/demo.d.ts +3 -0
  84. package/es/List/demo.js +26 -0
  85. package/es/List/index.d.ts +1 -1
  86. package/es/List/index.js +31 -23
  87. package/es/List/{index.css → index.less} +5 -4
  88. package/es/ListWithSizeAnimate/demo.d.ts +2 -0
  89. package/es/ListWithSizeAnimate/demo.js +19 -0
  90. package/es/ListWithSizeAnimate/index.d.ts +9 -0
  91. package/es/ListWithSizeAnimate/index.js +71 -0
  92. package/es/ListWithSizeAnimate/index.less +13 -0
  93. package/es/LoaderApp/index.js +59 -25
  94. package/es/LoaderApp/{index.css → index.less} +0 -0
  95. package/es/LoaderApp/loader.js +40 -23
  96. package/es/LoaderApp/sandbox.back.js +101 -24
  97. package/es/LoaderApp/sandbox.js +26 -9
  98. package/es/LoaderApp/utils.d.ts +1 -1
  99. package/es/LoaderApp/utils.js +68 -25
  100. package/es/LoaderScript/index.js +25 -10
  101. package/es/LoaderScript/utils.js +151 -87
  102. package/es/Map/BasicMap/AMapInstance.d.ts +1 -1
  103. package/es/Map/BasicMap/AMapInstance.js +25 -3
  104. package/es/Map/BasicMap/LeafletInstance.js +28 -11
  105. package/es/Map/BasicMap/index.js +67 -27
  106. package/es/Map/BasicMap/index.less +24 -0
  107. package/es/Map/ClusterLayer/hook.d.ts +2 -2
  108. package/es/Map/ClusterLayer/hook.js +51 -23
  109. package/es/Map/ClusterLayer/index.d.ts +1 -1
  110. package/es/Map/ClusterLayer/index.js +14 -6
  111. package/es/Map/ClusterLayer/index.less +27 -0
  112. package/es/Map/Config/index.js +44 -16
  113. package/es/Map/Config/utils.js +17 -3
  114. package/es/Map/Context/index.js +43 -9
  115. package/es/Map/FindPio/index.js +5 -2
  116. package/es/Map/FindPio/{index.css → index.less} +0 -0
  117. package/es/Map/InfoWindow/MakerLikeWindow.d.ts +1 -1
  118. package/es/Map/InfoWindow/MakerLikeWindow.js +41 -18
  119. package/es/Map/InfoWindow/demo.d.ts +1 -0
  120. package/es/Map/InfoWindow/demo.js +51 -29
  121. package/es/Map/InfoWindow/index.d.ts +1 -1
  122. package/es/Map/InfoWindow/index.js +39 -18
  123. package/es/Map/LevelCenter/DragMarker/index.js +16 -10
  124. package/es/Map/LevelCenter/demo.d.ts +1 -0
  125. package/es/Map/LevelCenter/demo.js +41 -22
  126. package/es/Map/LevelCenter/index.js +41 -29
  127. package/es/Map/LevelCenter/index.less +2 -0
  128. package/es/Map/LoaderMap/index.js +38 -22
  129. package/es/Map/MapDrawSelect/demo.d.ts +1 -0
  130. package/es/Map/MapDrawSelect/demo.js +65 -46
  131. package/es/Map/MapDrawSelect/index.js +43 -31
  132. package/es/Map/MapDrawSelect/index.less +2 -0
  133. package/es/Map/MouseTool/index.js +32 -18
  134. package/es/Map/MouseTool/useMouseTools.js +37 -8
  135. package/es/Map/ResetTools/index.js +58 -44
  136. package/es/Map/ResetTools/index.less +35 -0
  137. package/es/Map/SinglePoint/index.js +39 -27
  138. package/es/Map/SinglePoint/index.less +41 -0
  139. package/es/Map/hook/useMapEvent.js +8 -4
  140. package/es/Map/hook/useMapType.js +3 -2
  141. package/es/Map/index.d.ts +1 -0
  142. package/es/Map/index.js +11 -11
  143. package/es/Map/useMarker/index.d.ts +1 -1
  144. package/es/Map/useMarker/index.js +33 -13
  145. package/es/Map/{LevelCenter/index.css → useMarker/index.less} +0 -0
  146. package/es/Map/withMap/index.d.ts +1 -0
  147. package/es/Map/withMap/index.js +14 -4
  148. package/es/Modal/demo.d.ts +3 -0
  149. package/es/Modal/demo.js +106 -0
  150. package/es/Modal/index.js +94 -57
  151. package/es/Modal/index.less +45 -0
  152. package/es/Picture/component/DefaultRects/RectInfo.js +59 -37
  153. package/es/Picture/component/DefaultRects/index.js +46 -32
  154. package/es/Picture/component/DefaultRects/index.less +188 -0
  155. package/es/Picture/component/DrawRect/index.js +37 -24
  156. package/es/Picture/component/DrawRect/{index.css → index.less} +0 -0
  157. package/es/Picture/component/RectMenu/index.js +35 -26
  158. package/es/Picture/component/RectMenu/index.less +31 -0
  159. package/es/Picture/component/RectMenu/utils.js +6 -3
  160. package/es/Picture/component/Tools/index.js +91 -69
  161. package/es/Picture/component/Tools/index.less +43 -0
  162. package/es/Picture/component/WheelScale/index.js +9 -4
  163. package/es/Picture/demo.js +14 -11
  164. package/es/Picture/dragBound.d.ts +1 -1
  165. package/es/Picture/dragBound.js +17 -4
  166. package/es/Picture/index.d.ts +2 -2
  167. package/es/Picture/index.js +201 -137
  168. package/es/Picture/index.less +14 -0
  169. package/es/Picture/interface.d.ts +0 -6
  170. package/es/Picture/loadCaptureRectImage.d.ts +1 -1
  171. package/es/Picture/loadCaptureRectImage.js +39 -14
  172. package/es/Picture/useDraw.js +40 -20
  173. package/es/Picture/utils.d.ts +9 -9
  174. package/es/Picture/utils.js +18 -3
  175. package/es/Player/api/index.d.ts +3 -3
  176. package/es/Player/api/index.js +117 -82
  177. package/es/Player/context.js +21 -7
  178. package/es/Player/contraller_bar/bar.d.ts +1 -1
  179. package/es/Player/contraller_bar/bar.js +28 -10
  180. package/es/Player/contraller_bar/contraller_event.js +34 -12
  181. package/es/Player/contraller_bar/index.js +30 -22
  182. package/es/Player/contraller_bar/left_bar.js +62 -39
  183. package/es/Player/contraller_bar/right_bar.js +34 -18
  184. package/es/Player/contraller_bar/time.js +19 -8
  185. package/es/Player/contraller_bar/useBarStatus.js +29 -11
  186. package/es/Player/contraller_bar/volume.d.ts +1 -1
  187. package/es/Player/contraller_bar/volume.js +43 -21
  188. package/es/Player/demo.d.ts +1 -0
  189. package/es/Player/demo.js +258 -215
  190. package/es/Player/event/errorEvent.js +41 -16
  191. package/es/Player/event/eventName.js +12 -1
  192. package/es/Player/event/index.js +66 -24
  193. package/es/Player/fps_play.js +33 -15
  194. package/es/Player/frontend_player.js +42 -20
  195. package/es/Player/frontend_timeline.js +95 -55
  196. package/es/Player/iconfont.js +23 -8
  197. package/es/Player/index.js +1 -1
  198. package/es/Player/live_heart.js +15 -3
  199. package/es/Player/message.js +68 -37
  200. package/es/Player/segment_player.js +113 -62
  201. package/es/Player/segment_timeline.js +145 -97
  202. package/es/Player/single_player.js +153 -111
  203. package/es/Player/style/bar.less +39 -0
  204. package/es/Player/style/iconfont.js +17 -10
  205. package/es/Player/style/index.less +30 -0
  206. package/es/Player/style/message.less +50 -0
  207. package/es/Player/style/slider.less +103 -0
  208. package/es/Player/style/timeline.less +106 -0
  209. package/es/Player/style/volume.less +21 -0
  210. package/es/Player/timeline.d.ts +1 -1
  211. package/es/Player/timeline.js +59 -32
  212. package/es/Player/util.js +46 -7
  213. package/es/PlayerExt/demo.d.ts +1 -0
  214. package/es/PlayerExt/demo.js +145 -112
  215. package/es/PlayerExt/index.d.ts +2 -2
  216. package/es/PlayerExt/index.js +139 -87
  217. package/es/PlayerExt/{index.css → index.less} +0 -0
  218. package/es/Progress/index.js +18 -5
  219. package/es/Progress/index.less +20 -0
  220. package/es/ROI/demo.d.ts +1 -0
  221. package/es/ROI/demo.js +12 -8
  222. package/es/ROI/index.js +45 -35
  223. package/es/ROI/index.less +29 -0
  224. package/es/ScreenPlayer/Live.d.ts +2 -2
  225. package/es/ScreenPlayer/Live.js +172 -109
  226. package/es/ScreenPlayer/LiveTools.d.ts +2 -2
  227. package/es/ScreenPlayer/LiveTools.js +156 -116
  228. package/es/ScreenPlayer/PlayerWithExt.d.ts +2 -2
  229. package/es/ScreenPlayer/PlayerWithExt.js +172 -115
  230. package/es/ScreenPlayer/RatePick.js +35 -22
  231. package/es/ScreenPlayer/Record.d.ts +1 -1
  232. package/es/ScreenPlayer/Record.js +307 -192
  233. package/es/ScreenPlayer/RecordTools.d.ts +2 -2
  234. package/es/ScreenPlayer/RecordTools.js +201 -149
  235. package/es/ScreenPlayer/ScreenSelect.js +37 -28
  236. package/es/ScreenPlayer/SegmentTimeLine.d.ts +1 -1
  237. package/es/ScreenPlayer/SegmentTimeLine.js +24 -17
  238. package/es/ScreenPlayer/TimeMode.js +22 -16
  239. package/es/ScreenPlayer/TimeSelect.js +86 -65
  240. package/es/ScreenPlayer/demo.js +16 -18
  241. package/es/ScreenPlayer/demo2.js +193 -178
  242. package/es/ScreenPlayer/index.d.ts +1 -0
  243. package/es/ScreenPlayer/index.js +3 -3
  244. package/es/ScreenPlayer/index.less +178 -0
  245. package/es/ScreenPlayer/interface.d.ts +2 -2
  246. package/es/ScreenPlayer/useTimeSlider.d.ts +8 -8
  247. package/es/ScreenPlayer/useTimeSlider.js +167 -60
  248. package/es/ScreenPlayer/useVideoFit.d.ts +1 -1
  249. package/es/ScreenPlayer/useVideoFit.js +18 -5
  250. package/es/ScreenPlayer/utils.d.ts +1 -1
  251. package/es/ScreenPlayer/utils.js +10 -1
  252. package/es/SegmentPlayer/index.js +1 -1
  253. package/es/Service/fetch-adapter.d.ts +1 -1
  254. package/es/Service/fetch-adapter.js +48 -5
  255. package/es/Service/http.js +46 -16
  256. package/es/Service/index.js +2 -2
  257. package/es/TableLayout/index.js +18 -12
  258. package/es/TableLayout/{index.css → index.less} +0 -0
  259. package/es/ThemeAntd/demo.d.ts +1 -0
  260. package/es/ThemeAntd/demo.js +126 -76
  261. package/es/ThemeAntd/{demo.css → demo.less} +4 -3
  262. package/es/ThemeAntd/index.js +6 -2
  263. package/es/ThemeAntd/index.less +16 -0
  264. package/es/ThemeAntd/style/button.less +67 -0
  265. package/es/ThemeAntd/style/checkbox.less +72 -0
  266. package/es/ThemeAntd/style/form.less +12 -0
  267. package/es/ThemeAntd/style/input.less +83 -0
  268. package/es/ThemeAntd/style/pagination.less +95 -0
  269. package/es/ThemeAntd/style/picker.less +106 -0
  270. package/es/ThemeAntd/style/popover.less +5 -0
  271. package/es/ThemeAntd/style/radio.less +87 -0
  272. package/es/ThemeAntd/style/{scrollbar.css → scrollbar.less} +4 -2
  273. package/es/ThemeAntd/style/select.less +81 -0
  274. package/es/ThemeAntd/style/table.less +57 -0
  275. package/es/ThemeAntd/style/tree.less +18 -0
  276. package/es/Timeout/index.js +36 -12
  277. package/es/Tree/demo.js +26 -21
  278. package/es/Tree/index.js +51 -30
  279. package/es/Tree/index.less +59 -0
  280. package/es/index.d.ts +1 -0
  281. package/es/index.js +48 -47
  282. package/es/useDrawROI/index.js +130 -65
  283. package/es/useEventEmitterHandle/index.js +6 -2
  284. package/es/useFullscreen/demo.js +44 -27
  285. package/es/useFullscreen/index.js +30 -8
  286. package/es/useHistory/index.js +3 -1
  287. package/es/useInfiniteScroll/index.js +50 -19
  288. package/es/useRafInterval/index.js +28 -4
  289. package/es/useSimpleState/index.js +23 -6
  290. package/es/useVirtualList/index.js +58 -20
  291. package/es/utils.d.ts +1 -1
  292. package/es/utils.js +53 -14
  293. package/package.json +37 -32
  294. package/tsconfig.json +8 -32
  295. package/.eslintrc +0 -4
  296. package/.fatherrc.js +0 -25
  297. package/.prettierrc +0 -11
  298. package/.umirc.ts +0 -55
  299. package/clear-cache.sh +0 -4
  300. package/es/Box/InfoBox/index.css +0 -22
  301. package/es/Box/TwoColumnBox/index.css +0 -70
  302. package/es/CheckGroupFixed/index.css +0 -49
  303. package/es/CustomRenderSelect/index.css +0 -20
  304. package/es/Drawer/Demo.js +0 -59
  305. package/es/Drawer/index.css +0 -40
  306. package/es/FullScreen/index.css +0 -16
  307. package/es/ImageView/index.css +0 -10
  308. package/es/Input/index.css +0 -8
  309. package/es/LabelValue/index.css +0 -18
  310. package/es/List/DynamicList/index.css +0 -15
  311. package/es/Map/BasicMap/index.css +0 -24
  312. package/es/Map/ClusterLayer/index.css +0 -26
  313. package/es/Map/MapDrawSelect/index.css +0 -0
  314. package/es/Map/ResetTools/index.css +0 -32
  315. package/es/Map/SinglePoint/icon/Place_icon_OnLine_Hover.svg +0 -15
  316. package/es/Map/SinglePoint/icon/Place_icon_OnLine_Normal.svg +0 -15
  317. package/es/Map/SinglePoint/icon/Place_icon_OutLine_Hover.svg +0 -15
  318. package/es/Map/SinglePoint/icon/Place_icon_OutLine_Normal.svg +0 -15
  319. package/es/Map/SinglePoint/index.css +0 -29
  320. package/es/Map/useMarker/index.css +0 -0
  321. package/es/Modal/index.css +0 -43
  322. package/es/Picture/component/DefaultRects/index.css +0 -247
  323. package/es/Picture/component/RectMenu/index.css +0 -31
  324. package/es/Picture/component/Tools/index.css +0 -42
  325. package/es/Picture/index.css +0 -12
  326. package/es/Player/style/bar.css +0 -38
  327. package/es/Player/style/index.css +0 -30
  328. package/es/Player/style/message.css +0 -49
  329. package/es/Player/style/slider.css +0 -96
  330. package/es/Player/style/timeline.css +0 -99
  331. package/es/Player/style/volume.css +0 -19
  332. package/es/Progress/index.css +0 -20
  333. package/es/ROI/index.css +0 -29
  334. package/es/ScreenPlayer/index.css +0 -166
  335. package/es/ThemeAntd/index.css +0 -620
  336. package/es/ThemeAntd/style/button.css +0 -55
  337. package/es/ThemeAntd/style/checkbox.css +0 -64
  338. package/es/ThemeAntd/style/form.css +0 -10
  339. package/es/ThemeAntd/style/input.css +0 -68
  340. package/es/ThemeAntd/style/pagination.css +0 -82
  341. package/es/ThemeAntd/style/picker.css +0 -98
  342. package/es/ThemeAntd/style/popover.css +0 -3
  343. package/es/ThemeAntd/style/radio.css +0 -80
  344. package/es/ThemeAntd/style/select.css +0 -76
  345. package/es/ThemeAntd/style/table.css +0 -46
  346. package/es/ThemeAntd/style/tree.css +0 -16
  347. package/es/Tree/index.css +0 -64
@@ -1,58 +1,72 @@
1
1
  import "antd/lib/popover/style";
2
2
  import _Popover from "antd/lib/popover";
3
3
  import React, { useCallback, useContext } from 'react';
4
- import { mapContext } from '../Context';
5
- import IconFont from '../../IconFont';
6
- import '../../Player/style/iconfont';
7
- import "./index.css";
4
+ import { mapContext } from "../Context";
5
+ import IconFont from "../../IconFont";
6
+ import "../../Player/style/iconfont";
7
+ import "./index.less";
8
+ import { jsx as _jsx } from "react/jsx-runtime";
9
+ import { jsxs as _jsxs } from "react/jsx-runtime";
10
+
8
11
  function ResetTools(_ref) {
9
12
  var onMapReset = _ref.onMapReset,
10
- onMapZoom = _ref.onMapZoom,
11
- _ref$className = _ref.className,
12
- className = _ref$className === void 0 ? '' : _ref$className;
13
+ onMapZoom = _ref.onMapZoom,
14
+ _ref$className = _ref.className,
15
+ className = _ref$className === void 0 ? '' : _ref$className;
16
+
13
17
  var _useContext = useContext(mapContext),
14
- instance = _useContext.instance;
18
+ instance = _useContext.instance;
19
+
15
20
  var mapReset = useCallback(function () {
16
21
  return onMapReset ? onMapReset() : instance.mapReset();
17
22
  }, []);
18
23
  var mapZoom = useCallback(function (num) {
19
24
  return onMapZoom ? onMapZoom(num) : instance.setZoom(instance.getZoom() + num);
20
25
  }, []);
21
- return /*#__PURE__*/React.createElement("div", {
22
- className: "map-reset-tool-container ".concat(className)
23
- }, /*#__PURE__*/React.createElement(_Popover, {
24
- placement: "left",
25
- content: "\u590D\u4F4D",
26
- overlayClassName: "map-rest-tools-item-popup"
27
- }, /*#__PURE__*/React.createElement("div", {
28
- className: "map-reset map-tool-icon",
29
- onClick: mapReset
30
- }, /*#__PURE__*/React.createElement(IconFont, {
31
- type: "lm-player-S_Bar_Reduction"
32
- }))), /*#__PURE__*/React.createElement("div", {
33
- className: "map-zoom"
34
- }, /*#__PURE__*/React.createElement(_Popover, {
35
- placement: "left",
36
- content: "\u653E\u5927",
37
- overlayClassName: "map-rest-tools-item-popup"
38
- }, /*#__PURE__*/React.createElement("div", {
39
- className: "map-tool-icon",
40
- onClick: function onClick() {
41
- return mapZoom(1);
42
- }
43
- }, /*#__PURE__*/React.createElement(IconFont, {
44
- type: "lm-player-S_Edit_LinePlus"
45
- }))), /*#__PURE__*/React.createElement(_Popover, {
46
- placement: "left",
47
- content: "\u7F29\u5C0F",
48
- overlayClassName: "map-rest-tools-item-popup"
49
- }, /*#__PURE__*/React.createElement("div", {
50
- className: "map-tool-icon",
51
- onClick: function onClick() {
52
- return mapZoom(-1);
53
- }
54
- }, /*#__PURE__*/React.createElement(IconFont, {
55
- type: "lm-player-S_Edit_LineMinus"
56
- })))));
26
+ return /*#__PURE__*/_jsxs("div", {
27
+ className: "map-reset-tool-container ".concat(className),
28
+ children: [/*#__PURE__*/_jsx(_Popover, {
29
+ placement: "left",
30
+ content: "\u590D\u4F4D",
31
+ overlayClassName: "map-rest-tools-item-popup",
32
+ children: /*#__PURE__*/_jsx("div", {
33
+ className: "map-reset map-tool-icon",
34
+ onClick: mapReset,
35
+ children: /*#__PURE__*/_jsx(IconFont, {
36
+ type: "lm-player-S_Bar_Reduction"
37
+ })
38
+ })
39
+ }), /*#__PURE__*/_jsxs("div", {
40
+ className: "map-zoom",
41
+ children: [/*#__PURE__*/_jsx(_Popover, {
42
+ placement: "left",
43
+ content: "\u653E\u5927",
44
+ overlayClassName: "map-rest-tools-item-popup",
45
+ children: /*#__PURE__*/_jsx("div", {
46
+ className: "map-tool-icon",
47
+ onClick: function onClick() {
48
+ return mapZoom(1);
49
+ },
50
+ children: /*#__PURE__*/_jsx(IconFont, {
51
+ type: "lm-player-S_Edit_LinePlus"
52
+ })
53
+ })
54
+ }), /*#__PURE__*/_jsx(_Popover, {
55
+ placement: "left",
56
+ content: "\u7F29\u5C0F",
57
+ overlayClassName: "map-rest-tools-item-popup",
58
+ children: /*#__PURE__*/_jsx("div", {
59
+ className: "map-tool-icon",
60
+ onClick: function onClick() {
61
+ return mapZoom(-1);
62
+ },
63
+ children: /*#__PURE__*/_jsx(IconFont, {
64
+ type: "lm-player-S_Edit_LineMinus"
65
+ })
66
+ })
67
+ })]
68
+ })]
69
+ });
57
70
  }
71
+
58
72
  export default ResetTools;
@@ -0,0 +1,35 @@
1
+ .map-reset-tool-container {
2
+ position: absolute;
3
+ right: 10px;
4
+ bottom: 10px;
5
+ z-index: 3;
6
+ padding: 5px 0;
7
+ background: #ffffff;
8
+ .map-reset,
9
+ .map-zoom {
10
+ background: #ffffff;
11
+ }
12
+ .map-zoom {
13
+ margin-bottom: 0;
14
+ }
15
+ .map-tool-icon {
16
+ width: 30px;
17
+ height: 25px;
18
+ display: flex;
19
+ align-items: center;
20
+ justify-content: center;
21
+ font-size: 18px;
22
+ color: vart(--icon);
23
+ cursor: pointer;
24
+ &:hover {
25
+ color: var(--primary);
26
+ }
27
+ }
28
+ }
29
+
30
+ .map-rest-tools-item-popup {
31
+ .ant-popover-inner-content {
32
+ padding: 4px 8px;
33
+ font-size: var(--fs-small);
34
+ }
35
+ }
@@ -1,30 +1,39 @@
1
1
  import _useMount from "ahooks/es/useMount";
2
2
  import React, { useCallback, useContext } from 'react';
3
- import ClusterLayer from '../ClusterLayer';
4
- import ResetTools from '../ResetTools';
5
- import DragMarker from '../LevelCenter/DragMarker';
6
- import withMap from '../withMap';
7
- import { mapContext } from '../Context';
8
- import useMapEvent from '../hook/useMapEvent';
9
- import "./index.css";
3
+ import ClusterLayer from "../ClusterLayer";
4
+ import ResetTools from "../ResetTools";
5
+ import DragMarker from "../LevelCenter/DragMarker";
6
+ import withMap from "../withMap";
7
+ import { mapContext } from "../Context";
8
+ import useMapEvent from "../hook/useMapEvent";
9
+ import "./index.less";
10
+ import { jsx as _jsx } from "react/jsx-runtime";
11
+ import { Fragment as _Fragment } from "react/jsx-runtime";
12
+ import { jsxs as _jsxs } from "react/jsx-runtime";
13
+
10
14
  function SinglePoint(_ref) {
11
15
  var center = _ref.center,
12
- points = _ref.points,
13
- onCenterChange = _ref.onCenterChange,
14
- enableClick = _ref.enableClick,
15
- title = _ref.title,
16
- children = _ref.children;
16
+ points = _ref.points,
17
+ onCenterChange = _ref.onCenterChange,
18
+ enableClick = _ref.enableClick,
19
+ title = _ref.title,
20
+ children = _ref.children;
21
+
17
22
  var _useContext = useContext(mapContext),
18
- instance = _useContext.instance;
23
+ instance = _useContext.instance;
24
+
19
25
  var mapRest = useCallback(function () {
20
26
  return instance.setZoomAndCenter(instance.config.zoom, center !== null && center !== void 0 ? center : instance.config.center);
21
27
  }, [center, instance]);
28
+
22
29
  _useMount(function () {
23
30
  if (enableClick) {
24
31
  instance.setCursor('pointer');
25
32
  }
33
+
26
34
  mapRest();
27
35
  });
36
+
28
37
  useMapEvent('click', function (event) {
29
38
  if (enableClick) {
30
39
  var _center = [event.lnglat.lng, event.lnglat.lat];
@@ -34,19 +43,22 @@ function SinglePoint(_ref) {
34
43
  });
35
44
  }
36
45
  });
37
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(ClusterLayer, {
38
- points: points
39
- }), /*#__PURE__*/React.createElement(ResetTools, {
40
- onMapReset: mapRest
41
- }), /*#__PURE__*/React.createElement(DragMarker, {
42
- title: title,
43
- center: center,
44
- onChange: function onChange(_ref2) {
45
- var center = _ref2.center;
46
- return onCenterChange === null || onCenterChange === void 0 ? void 0 : onCenterChange({
47
- center: center
48
- });
49
- }
50
- }), children);
46
+ return /*#__PURE__*/_jsxs(_Fragment, {
47
+ children: [/*#__PURE__*/_jsx(ClusterLayer, {
48
+ points: points
49
+ }), /*#__PURE__*/_jsx(ResetTools, {
50
+ onMapReset: mapRest
51
+ }), /*#__PURE__*/_jsx(DragMarker, {
52
+ title: title,
53
+ center: center,
54
+ onChange: function onChange(_ref2) {
55
+ var center = _ref2.center;
56
+ return onCenterChange === null || onCenterChange === void 0 ? void 0 : onCenterChange({
57
+ center: center
58
+ });
59
+ }
60
+ }), children]
61
+ });
51
62
  }
63
+
52
64
  export default withMap(SinglePoint, 'single-point-map-container');
@@ -0,0 +1,41 @@
1
+ .single-point-map-container {
2
+ .marker-center-layout {
3
+ text-align: center;
4
+ width: 32px;
5
+ height: 42px;
6
+ margin-top: -10px;
7
+
8
+ > div {
9
+ width: 100%;
10
+ height: 100%;
11
+ padding-top: 6px;
12
+ }
13
+
14
+ .onLine {
15
+ background: url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB3aWR0aD0iMzJweCIgaGVpZ2h0PSI0MnB4IiB2aWV3Qm94PSIwIDAgMzIgNDIiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+CiAgICA8IS0tIE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3IDEwLjAyNzc3ODQsMzMuOTkyNDIyMyA5Ljg3ODM5MTA5LDMzLjY0NTQ1ODQgQzkuMzM1MTI2MDYsMzIuMzgzNjgxNSA4LjgxNjUxNzY2LDMxLjQyMjAyMzUgOC4yLDMwLjYgQzcuODMzNjc5OCwzMC4xMTE1NzMxIDcuNDUwMzE0NTUsMjkuNjI2MjQ5IDYuODkwNzIyNjgsMjguOTM1NzI2OSBDNi43NjgwNzUwNiwyOC43ODQzODI5IDYuMzI0MTg5MTIsMjguMjM4MzQwOSA2LjM0Mzc2NTQ5LDI4LjI2MjQ0NDMgQzIuNTA0NzA4MDcsMjMuNTM1NjA0OCAxLjA0OTUzNTY2LDIwLjczODUwMTIgMS4wMDA5NDgyOSwxNi4xNzgzNjc1IEwwLjk5NTIyOTAxNywxNS42NDE1ODg4IEwxLjAwNDM0NDIzLDE1LjYzNTQwNDQgWiIgc3Ryb2tlPSIjNjc2RjdGIiBzdHJva2Utd2lkdGg9IjIiIGZpbGw9InVybCgjbGluZWFyR3JhZGllbnQtMSkiPjwvcGF0aD4KICAgIDwvZz4KPC9zdmc+')
30
+ no-repeat;
31
+ }
32
+ }
33
+
34
+ .anticon {
35
+ font-size: 18px;
36
+ color: white;
37
+ position: relative;
38
+ top: 1px;
39
+ }
40
+ }
41
+ }
@@ -1,19 +1,23 @@
1
1
  import _useLatest from "ahooks/es/useLatest";
2
2
  import { useContext, useEffect } from 'react';
3
- import { mapContext } from '../Context';
3
+ import { mapContext } from "../Context";
4
+
4
5
  function useMapEvent(type, fn) {
5
6
  var fnRef = _useLatest(fn);
7
+
6
8
  var _useContext = useContext(mapContext),
7
- instance = _useContext.instance;
9
+ instance = _useContext.instance;
10
+
8
11
  useEffect(function () {
9
12
  var eventAction = function eventAction(event) {
10
13
  fnRef.current(event);
11
14
  };
15
+
12
16
  instance.on(type, eventAction);
13
17
  return function () {
14
18
  return instance.off(type, eventAction);
15
- };
16
- // eslint-disable-next-line react-hooks/exhaustive-deps
19
+ }; // eslint-disable-next-line react-hooks/exhaustive-deps
17
20
  }, [instance, type]);
18
21
  }
22
+
19
23
  export default useMapEvent;
@@ -1,8 +1,9 @@
1
1
  import { useContext, useMemo } from 'react';
2
- import { mapContext } from '../Context';
2
+ import { mapContext } from "../Context";
3
3
  export default function useMapType() {
4
4
  var _useContext = useContext(mapContext),
5
- glaobalKey = _useContext.glaobalKey;
5
+ glaobalKey = _useContext.glaobalKey;
6
+
6
7
  return useMemo(function () {
7
8
  return {
8
9
  leaflet: glaobalKey === 'L',
package/es/Map/index.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import ClusterLayer from './ClusterLayer';
2
3
  import Config from './Config';
3
4
  import Context from './Context';
package/es/Map/index.js CHANGED
@@ -1,14 +1,14 @@
1
- import ClusterLayer from './ClusterLayer';
2
- import Config from './Config';
3
- import Context from './Context';
4
- import FindPio from './FindPio';
5
- import LevelCenter from './LevelCenter';
6
- import LoaderMap from './LoaderMap';
7
- import BasicMap from './BasicMap';
8
- import ResetTools from './ResetTools';
9
- import SinglePoint from './SinglePoint';
10
- import useMarker from './useMarker';
11
- import withMap from './withMap';
1
+ import ClusterLayer from "./ClusterLayer";
2
+ import Config from "./Config";
3
+ import Context from "./Context";
4
+ import FindPio from "./FindPio";
5
+ import LevelCenter from "./LevelCenter";
6
+ import LoaderMap from "./LoaderMap";
7
+ import BasicMap from "./BasicMap";
8
+ import ResetTools from "./ResetTools";
9
+ import SinglePoint from "./SinglePoint";
10
+ import useMarker from "./useMarker";
11
+ import withMap from "./withMap";
12
12
  var Map = {
13
13
  ClusterLayer: ClusterLayer,
14
14
  Config: Config,
@@ -1,4 +1,4 @@
1
- /// <reference types="src/map/amap" />
1
+ /// <reference path="../AMap.d.ts" />
2
2
  import { Map } from '../interface';
3
3
  import './index.less';
4
4
  export interface IUseMarkerProps {
@@ -1,33 +1,50 @@
1
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
2
+
3
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
4
+
5
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
6
+
1
7
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
8
+
2
9
  function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
10
+
3
11
  function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
12
+
4
13
  function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
14
+
5
15
  function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
16
+
6
17
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
18
+
7
19
  /// <reference path="../AMap.d.ts" />
8
20
  import { useEffect, useRef, useState } from 'react';
9
- import useMapType from '../hook/useMapType';
10
- import "./index.css";
21
+ import useMapType from "../hook/useMapType";
22
+ import "./index.less";
23
+
11
24
  function useMarker(_ref) {
12
25
  var map = _ref.map,
13
- center = _ref.center,
14
- createIcon = _ref.createIcon,
15
- options = _ref.options;
26
+ center = _ref.center,
27
+ createIcon = _ref.createIcon,
28
+ options = _ref.options;
29
+
16
30
  var _useState = useState({
17
- marker: null
18
- }),
19
- _useState2 = _slicedToArray(_useState, 2),
20
- state = _useState2[0],
21
- setState = _useState2[1];
31
+ marker: null
32
+ }),
33
+ _useState2 = _slicedToArray(_useState, 2),
34
+ state = _useState2[0],
35
+ setState = _useState2[1];
36
+
22
37
  var inMap = useRef(false);
23
38
  var type = useMapType();
24
39
  useEffect(function () {
25
40
  if (!(center && center.length === 2) || !map) {
26
41
  return;
27
42
  }
43
+
28
44
  if (type.leaflet) {
29
45
  var L = window.L;
30
46
  var latlng = L.latLng(center);
47
+
31
48
  if (inMap.current) {
32
49
  state.marker.setLatLng(latlng);
33
50
  } else {
@@ -43,22 +60,25 @@ function useMarker(_ref) {
43
60
  inMap.current = true;
44
61
  }
45
62
  }
63
+
46
64
  if (type.AMap) {
47
65
  if (inMap.current) {
48
66
  state.marker.setPosition(center);
49
67
  } else {
50
- var _marker = new AMap.Marker(Object.assign({
68
+ var _marker = new AMap.Marker(_objectSpread({
51
69
  position: center
52
70
  }, options));
71
+
53
72
  map.add(_marker);
54
73
  setState({
55
74
  marker: _marker
56
75
  });
57
76
  inMap.current = true;
58
77
  }
59
- }
60
- // eslint-disable-next-line react-hooks/exhaustive-deps
78
+ } // eslint-disable-next-line react-hooks/exhaustive-deps
79
+
61
80
  }, [center, map, options]);
62
81
  return state.marker;
63
82
  }
83
+
64
84
  export default useMarker;
@@ -1,2 +1,3 @@
1
+ /// <reference types="react" />
1
2
  declare function withMap<P>(Component: any, className?: string): (props: P) => JSX.Element;
2
3
  export default withMap;
@@ -1,10 +1,20 @@
1
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
2
+
3
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
4
+
5
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
6
+
1
7
  import React from 'react';
2
- import Map from '../BasicMap';
8
+ import Map from "../BasicMap";
9
+ import { jsx as _jsx } from "react/jsx-runtime";
10
+
3
11
  function withMap(Component, className) {
4
12
  return function withMapComponent(props) {
5
- return /*#__PURE__*/React.createElement(Map, {
6
- className: className
7
- }, /*#__PURE__*/React.createElement(Component, Object.assign({}, props)));
13
+ return /*#__PURE__*/_jsx(Map, {
14
+ className: className,
15
+ children: /*#__PURE__*/_jsx(Component, _objectSpread({}, props))
16
+ });
8
17
  };
9
18
  }
19
+
10
20
  export default withMap;
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ declare const App: () => JSX.Element;
3
+ export default App;
@@ -0,0 +1,106 @@
1
+ import "antd/lib/config-provider/style";
2
+ import _ConfigProvider from "antd/lib/config-provider";
3
+ import "antd/lib/button/style";
4
+ import _Button from "antd/lib/button";
5
+
6
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
7
+
8
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
9
+
10
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
11
+
12
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
13
+
14
+ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
15
+
16
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
17
+
18
+ import React, { useRef, useState } from 'react';
19
+ import Modal from "./index";
20
+ import { jsx as _jsx } from "react/jsx-runtime";
21
+ import { jsxs as _jsxs } from "react/jsx-runtime";
22
+ import { Fragment as _Fragment } from "react/jsx-runtime";
23
+
24
+ var App = function App() {
25
+ var _Modal$useModal = Modal.useModal(),
26
+ open = _Modal$useModal.open;
27
+
28
+ var _useState = useState(false),
29
+ _useState2 = _slicedToArray(_useState, 2),
30
+ visible = _useState2[0],
31
+ setVisible = _useState2[1];
32
+
33
+ var ref = useRef(null);
34
+ return /*#__PURE__*/_jsxs(_ConfigProvider, {
35
+ prefixCls: "cloudapp",
36
+ children: [/*#__PURE__*/_jsxs("div", {
37
+ children: [/*#__PURE__*/_jsx(_Button, {
38
+ type: "primary",
39
+ onClick: function onClick() {
40
+ return setVisible(true);
41
+ },
42
+ children: "Open Modal of 1000px width"
43
+ }), /*#__PURE__*/_jsxs(Modal, {
44
+ title: "Modal 1000px width",
45
+ centered: true,
46
+ visible: visible,
47
+ onOk: function onOk() {
48
+ return setVisible(false);
49
+ },
50
+ onCancel: function onCancel() {
51
+ return setVisible(false);
52
+ },
53
+ width: 1000,
54
+ children: [/*#__PURE__*/_jsx("p", {
55
+ children: "some contents..."
56
+ }), /*#__PURE__*/_jsx("p", {
57
+ children: "some contents..."
58
+ }), /*#__PURE__*/_jsx("p", {
59
+ children: "some contents..."
60
+ })]
61
+ })]
62
+ }), /*#__PURE__*/_jsx("div", {
63
+ children: /*#__PURE__*/_jsx(_Button, {
64
+ type: "primary",
65
+ onClick: function onClick() {
66
+ return open({
67
+ content: /*#__PURE__*/_jsxs(_Fragment, {
68
+ children: [/*#__PURE__*/_jsx("p", {
69
+ children: "some contents..."
70
+ }), /*#__PURE__*/_jsx("p", {
71
+ children: "some contents..."
72
+ }), /*#__PURE__*/_jsx("p", {
73
+ children: "some contents..."
74
+ })]
75
+ })
76
+ });
77
+ },
78
+ children: "useModal"
79
+ })
80
+ }), /*#__PURE__*/_jsxs("div", {
81
+ children: [/*#__PURE__*/_jsx(_Button, {
82
+ type: "primary",
83
+ onClick: function onClick() {
84
+ var _ref$current;
85
+
86
+ return (_ref$current = ref.current) === null || _ref$current === void 0 ? void 0 : _ref$current.open({
87
+ content: /*#__PURE__*/_jsxs(_Fragment, {
88
+ children: [/*#__PURE__*/_jsx("p", {
89
+ children: "some contents..."
90
+ }), /*#__PURE__*/_jsx("p", {
91
+ children: "some contents..."
92
+ }), /*#__PURE__*/_jsx("p", {
93
+ children: "some contents..."
94
+ })]
95
+ })
96
+ });
97
+ },
98
+ children: "RefModal"
99
+ }), /*#__PURE__*/_jsx(Modal.RefModal, {
100
+ ref: ref
101
+ })]
102
+ })]
103
+ });
104
+ };
105
+
106
+ export default App;