@cloud-app-dev/vidc 4.0.19 → 4.0.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/AppContext/Sync.d.ts +8 -0
- package/es/AppContext/Sync.js +42 -0
- package/es/AppContext/index.d.ts +10 -0
- package/es/AppContext/index.js +141 -0
- package/es/AppContext/interface.d.ts +41 -0
- package/es/AppContext/static.d.ts +8 -0
- package/es/AppContext/static.js +9 -0
- package/es/Auth/index.d.ts +8 -0
- package/es/Auth/index.js +14 -0
- package/es/AutoExit/index.d.ts +6 -0
- package/es/AutoExit/index.js +19 -0
- package/es/CheckGroupFixed/demo.d.ts +3 -0
- package/es/CheckGroupFixed/demo.js +22 -0
- package/es/CheckGroupFixed/index.d.ts +24 -0
- package/es/CheckGroupFixed/index.js +140 -0
- package/es/CheckGroupFixed/index.less +56 -0
- package/es/Config/index.d.ts +4 -0
- package/es/Config/index.js +77 -0
- package/es/Config/interface.d.ts +65 -0
- package/es/Config/utils.d.ts +4 -0
- package/es/Config/utils.js +33 -0
- package/es/ConfigContext/index.d.ts +17 -0
- package/es/ConfigContext/index.js +21 -0
- package/es/CustomRenderSelect/index.d.ts +12 -0
- package/es/CustomRenderSelect/index.js +73 -0
- package/es/CustomRenderSelect/index.less +25 -0
- package/es/DBTools/index.d.ts +25 -0
- package/es/DBTools/index.js +336 -0
- package/es/DisableMark/index.d.ts +9 -0
- package/es/DisableMark/index.js +19 -0
- package/es/DisableMark/index.less +9 -0
- package/es/DomMove/demo.d.ts +2 -0
- package/es/DomMove/demo.js +16 -0
- package/es/DomMove/index.d.ts +16 -0
- package/es/DomMove/index.js +139 -0
- package/es/DomMove/utils.d.ts +8 -0
- package/es/DomMove/utils.js +32 -0
- package/es/Drag/DragAndDropItem.d.ts +4 -0
- package/es/Drag/DragAndDropItem.js +134 -0
- package/es/Drag/DropItem.d.ts +4 -0
- package/es/Drag/DropItem.js +50 -0
- package/es/Drag/index.d.ts +7 -0
- package/es/Drag/index.js +7 -0
- package/es/Drag/interface.d.ts +16 -0
- package/es/DynamicGridList/Demo.d.ts +3 -0
- package/es/DynamicGridList/Demo.js +77 -0
- package/es/DynamicGridList/index.d.ts +24 -0
- package/es/DynamicGridList/index.js +67 -0
- package/es/DynamicList/demo.d.ts +2 -0
- package/es/DynamicList/demo.js +44 -0
- package/es/DynamicList/index.d.ts +22 -0
- package/es/DynamicList/index.js +86 -0
- package/es/DynamicList/index.less +17 -0
- package/es/DynamicList/interface.d.ts +19 -0
- package/es/DynamicList/utils.d.ts +4 -0
- package/es/DynamicList/utils.js +6 -0
- package/es/ErrorFallback/index.d.ts +9 -0
- package/es/ErrorFallback/index.js +31 -0
- package/es/ErrorFallback/inerface.d.ts +48 -0
- package/es/EventTools/index.d.ts +3 -0
- package/es/EventTools/index.js +12 -0
- package/es/FrontendPlayer/index.d.ts +4 -0
- package/es/FrontendPlayer/index.js +2 -0
- package/es/FullScreen/index.d.ts +22 -0
- package/es/FullScreen/index.js +33 -0
- package/es/FullScreen/index.less +18 -0
- package/es/GridList/Demo.d.ts +3 -0
- package/es/GridList/Demo.js +80 -0
- package/es/GridList/data.d.ts +16 -0
- package/es/GridList/data.js +609 -0
- package/es/GridList/hook.d.ts +13 -0
- package/es/GridList/hook.js +270 -0
- package/es/GridList/index.d.ts +15 -0
- package/es/GridList/index.js +44 -0
- package/es/GridList/index.less +8 -0
- package/es/GridList/interface.d.ts +59 -0
- package/es/GridList/utils.d.ts +9 -0
- package/es/GridList/utils.js +42 -0
- package/es/HightLevel/index.d.ts +9 -0
- package/es/HightLevel/index.js +18 -0
- package/es/HightLevel/index.less +3 -0
- package/es/IconFont/index.d.ts +12 -0
- package/es/IconFont/index.js +54 -0
- package/es/ImageView/index.d.ts +20 -0
- package/es/ImageView/index.js +51 -0
- package/es/ImageView/index.less +11 -0
- package/es/InstanceHistory/index.d.ts +3 -0
- package/es/InstanceHistory/index.js +7 -0
- package/es/LabelPlayer/111.png +0 -0
- package/es/LabelPlayer/demo.d.ts +2 -0
- package/es/LabelPlayer/demo.js +115 -0
- package/es/LabelPlayer/index.d.ts +21 -0
- package/es/LabelPlayer/index.js +160 -0
- package/es/LabelPlayer/index.less +24 -0
- package/es/LabelValue/index.d.ts +15 -0
- package/es/LabelValue/index.js +27 -0
- package/es/LabelValue/index.less +23 -0
- package/es/List/demo.d.ts +3 -0
- package/es/List/demo.js +23 -0
- package/es/List/index.d.ts +28 -0
- package/es/List/index.js +28 -0
- package/es/List/index.less +20 -0
- package/es/ListWithSizeAnimate/demo.d.ts +2 -0
- package/es/ListWithSizeAnimate/demo.js +98 -0
- package/es/ListWithSizeAnimate/index.d.ts +14 -0
- package/es/ListWithSizeAnimate/index.js +85 -0
- package/es/ListWithSizeAnimate/index.less +23 -0
- package/es/LoaderScript/index.d.ts +47 -0
- package/es/LoaderScript/index.js +34 -0
- package/es/LoaderScript/utils.d.ts +13 -0
- package/es/LoaderScript/utils.js +179 -0
- package/es/Map/AMap.d.ts +7109 -0
- package/es/Map/BasicMap/AMapInstance.d.ts +19 -0
- package/es/Map/BasicMap/AMapInstance.js +98 -0
- package/es/Map/BasicMap/LeafletInstance.d.ts +18 -0
- package/es/Map/BasicMap/LeafletInstance.js +111 -0
- package/es/Map/BasicMap/index.d.ts +9 -0
- package/es/Map/BasicMap/index.js +90 -0
- package/es/Map/BasicMap/index.less +29 -0
- package/es/Map/ClusterLayer/demo.d.ts +3 -0
- package/es/Map/ClusterLayer/demo.js +18 -0
- package/es/Map/ClusterLayer/hook.d.ts +5 -0
- package/es/Map/ClusterLayer/hook.js +123 -0
- package/es/Map/ClusterLayer/index.d.ts +6 -0
- package/es/Map/ClusterLayer/index.js +28 -0
- package/es/Map/ClusterLayer/index.less +29 -0
- package/es/Map/ClusterLayer/props.d.ts +8 -0
- package/es/Map/Config/index.d.ts +9 -0
- package/es/Map/Config/index.js +48 -0
- package/es/Map/Config/utils.d.ts +2 -0
- package/es/Map/Config/utils.js +65 -0
- package/es/Map/Context/index.d.ts +11 -0
- package/es/Map/Context/index.js +51 -0
- package/es/Map/FindPio/index.d.ts +4 -0
- package/es/Map/FindPio/index.js +13 -0
- package/es/Map/FindPio/index.less +7 -0
- package/es/Map/InfoWindow/MakerLikeWindow.d.ts +4 -0
- package/es/Map/InfoWindow/MakerLikeWindow.js +112 -0
- package/es/Map/InfoWindow/demo.d.ts +3 -0
- package/es/Map/InfoWindow/demo.js +70 -0
- package/es/Map/InfoWindow/index.d.ts +11 -0
- package/es/Map/InfoWindow/index.js +66 -0
- package/es/Map/LevelCenter/DragMarker/index.d.ts +10 -0
- package/es/Map/LevelCenter/DragMarker/index.js +42 -0
- package/es/Map/LevelCenter/demo.d.ts +3 -0
- package/es/Map/LevelCenter/demo.js +38 -0
- package/es/Map/LevelCenter/index.d.ts +15 -0
- package/es/Map/LevelCenter/index.js +66 -0
- package/es/Map/LoaderMap/index.d.ts +7 -0
- package/es/Map/LoaderMap/index.js +62 -0
- package/es/Map/MapDrawSelect/demo.d.ts +3 -0
- package/es/Map/MapDrawSelect/demo.js +71 -0
- package/es/Map/MapDrawSelect/index.d.ts +15 -0
- package/es/Map/MapDrawSelect/index.js +56 -0
- package/es/Map/MouseTool/index.d.ts +10 -0
- package/es/Map/MouseTool/index.js +40 -0
- package/es/Map/MouseTool/useMouseTools.d.ts +7 -0
- package/es/Map/MouseTool/useMouseTools.js +83 -0
- package/es/Map/ResetTools/index.d.ts +10 -0
- package/es/Map/ResetTools/index.js +57 -0
- package/es/Map/ResetTools/index.less +39 -0
- package/es/Map/SinglePoint/demo.d.ts +3 -0
- package/es/Map/SinglePoint/demo.js +14 -0
- package/es/Map/SinglePoint/index.d.ts +27 -0
- package/es/Map/SinglePoint/index.js +52 -0
- package/es/Map/SinglePoint/index.less +41 -0
- package/es/Map/hook/useMapEvent.d.ts +2 -0
- package/es/Map/hook/useMapEvent.js +19 -0
- package/es/Map/hook/useMapType.d.ts +4 -0
- package/es/Map/hook/useMapType.js +12 -0
- package/es/Map/icon.d.ts +2 -0
- package/es/Map/icon.js +10 -0
- package/es/Map/index.d.ts +24 -0
- package/es/Map/index.js +25 -0
- package/es/Map/interface.d.ts +74 -0
- package/es/Map/points.d.ts +50 -0
- package/es/Map/points.js +1 -0
- package/es/Map/useMarker/index.d.ts +10 -0
- package/es/Map/useMarker/index.js +71 -0
- package/es/Map/withMap/index.d.ts +3 -0
- package/es/Map/withMap/index.js +10 -0
- package/es/Picture/component/DefaultRects/RectInfo.d.ts +8 -0
- package/es/Picture/component/DefaultRects/RectInfo.js +80 -0
- package/es/Picture/component/DefaultRects/index.d.ts +13 -0
- package/es/Picture/component/DefaultRects/index.js +52 -0
- package/es/Picture/component/DefaultRects/index.less +211 -0
- package/es/Picture/component/DefaultRects/utils.d.ts +2 -0
- package/es/Picture/component/DefaultRects/utils.js +11 -0
- package/es/Picture/component/DrawRect/index.d.ts +13 -0
- package/es/Picture/component/DrawRect/index.js +46 -0
- package/es/Picture/component/DrawRect/index.less +8 -0
- package/es/Picture/component/RectMenu/index.d.ts +12 -0
- package/es/Picture/component/RectMenu/index.js +76 -0
- package/es/Picture/component/RectMenu/index.less +36 -0
- package/es/Picture/component/RectMenu/utils.d.ts +12 -0
- package/es/Picture/component/RectMenu/utils.js +19 -0
- package/es/Picture/component/Tools/index.d.ts +12 -0
- package/es/Picture/component/Tools/index.js +73 -0
- package/es/Picture/component/Tools/index.less +49 -0
- package/es/Picture/component/WheelScale/index.d.ts +7 -0
- package/es/Picture/component/WheelScale/index.js +27 -0
- package/es/Picture/demo.d.ts +2 -0
- package/es/Picture/demo.js +105 -0
- package/es/Picture/index.d.ts +5 -0
- package/es/Picture/index.js +341 -0
- package/es/Picture/index.less +20 -0
- package/es/Picture/interface.d.ts +196 -0
- package/es/Picture/loadCaptureRectImage.d.ts +3 -0
- package/es/Picture/loadCaptureRectImage.js +99 -0
- package/es/Picture/useDraw.d.ts +1 -0
- package/es/Picture/useDraw.js +103 -0
- package/es/Picture/utils.d.ts +26 -0
- package/es/Picture/utils.js +143 -0
- package/es/Player/api/index.d.ts +68 -0
- package/es/Player/api/index.js +309 -0
- package/es/Player/context.d.ts +17 -0
- package/es/Player/context.js +24 -0
- package/es/Player/contraller_bar/bar.d.ts +8 -0
- package/es/Player/contraller_bar/bar.js +20 -0
- package/es/Player/contraller_bar/contraller_event.d.ts +6 -0
- package/es/Player/contraller_bar/contraller_event.js +50 -0
- package/es/Player/contraller_bar/index.d.ts +14 -0
- package/es/Player/contraller_bar/index.js +27 -0
- package/es/Player/contraller_bar/left_bar.d.ts +10 -0
- package/es/Player/contraller_bar/left_bar.js +83 -0
- package/es/Player/contraller_bar/right_bar.d.ts +8 -0
- package/es/Player/contraller_bar/right_bar.js +32 -0
- package/es/Player/contraller_bar/time.d.ts +3 -0
- package/es/Player/contraller_bar/time.js +19 -0
- package/es/Player/contraller_bar/useBarStatus.d.ts +2 -0
- package/es/Player/contraller_bar/useBarStatus.js +43 -0
- package/es/Player/contraller_bar/volume.d.ts +9 -0
- package/es/Player/contraller_bar/volume.js +62 -0
- package/es/Player/demo.d.ts +3 -0
- package/es/Player/demo.js +266 -0
- package/es/Player/empty.d.ts +2 -0
- package/es/Player/empty.js +4 -0
- package/es/Player/event/errorEvent.d.ts +14 -0
- package/es/Player/event/errorEvent.js +88 -0
- package/es/Player/event/eventName.d.ts +18 -0
- package/es/Player/event/eventName.js +29 -0
- package/es/Player/event/index.d.ts +24 -0
- package/es/Player/event/index.js +205 -0
- package/es/Player/fps_play.d.ts +11 -0
- package/es/Player/fps_play.js +83 -0
- package/es/Player/frontend_player.d.ts +8 -0
- package/es/Player/frontend_player.js +64 -0
- package/es/Player/frontend_timeline.d.ts +10 -0
- package/es/Player/frontend_timeline.js +132 -0
- package/es/Player/iconfont.d.ts +5 -0
- package/es/Player/iconfont.js +16 -0
- package/es/Player/index.d.ts +2 -0
- package/es/Player/index.js +2 -0
- package/es/Player/live_heart.d.ts +8 -0
- package/es/Player/live_heart.js +45 -0
- package/es/Player/message.d.ts +5 -0
- package/es/Player/message.js +137 -0
- package/es/Player/player.d.ts +233 -0
- package/es/Player/segment_player.d.ts +9 -0
- package/es/Player/segment_player.js +228 -0
- package/es/Player/segment_timeline.d.ts +12 -0
- package/es/Player/segment_timeline.js +173 -0
- package/es/Player/single_player.d.ts +5 -0
- package/es/Player/single_player.js +262 -0
- package/es/Player/style/bar.less +43 -0
- package/es/Player/style/iconfont.js +43 -0
- package/es/Player/style/index.less +34 -0
- package/es/Player/style/message.less +56 -0
- package/es/Player/style/slider.less +106 -0
- package/es/Player/style/timeline.less +117 -0
- package/es/Player/style/volume.less +24 -0
- package/es/Player/timeline.d.ts +5 -0
- package/es/Player/timeline.js +95 -0
- package/es/Player/util.d.ts +43 -0
- package/es/Player/util.js +189 -0
- package/es/PlayerExt/demo.d.ts +3 -0
- package/es/PlayerExt/demo.js +154 -0
- package/es/PlayerExt/index.d.ts +48 -0
- package/es/PlayerExt/index.js +188 -0
- package/es/PlayerExt/index.less +10 -0
- package/es/Progress/index.d.ts +7 -0
- package/es/Progress/index.js +53 -0
- package/es/Progress/index.less +21 -0
- package/es/ROI/demo.d.ts +3 -0
- package/es/ROI/demo.js +16 -0
- package/es/ROI/index.d.ts +33 -0
- package/es/ROI/index.js +54 -0
- package/es/ROI/index.less +33 -0
- package/es/RefDrawer/Footer.d.ts +9 -0
- package/es/RefDrawer/Footer.js +22 -0
- package/es/RefDrawer/demo.d.ts +3 -0
- package/es/RefDrawer/demo.js +18 -0
- package/es/RefDrawer/index.d.ts +26 -0
- package/es/RefDrawer/index.js +71 -0
- package/es/RefModal/demo.d.ts +3 -0
- package/es/RefModal/demo.js +18 -0
- package/es/RefModal/index.d.ts +17 -0
- package/es/RefModal/index.js +70 -0
- package/es/ScreenPlayer/Live.d.ts +5 -0
- package/es/ScreenPlayer/Live.js +212 -0
- package/es/ScreenPlayer/LiveTools.d.ts +29 -0
- package/es/ScreenPlayer/LiveTools.js +151 -0
- package/es/ScreenPlayer/PlayerWithExt.d.ts +34 -0
- package/es/ScreenPlayer/PlayerWithExt.js +231 -0
- package/es/ScreenPlayer/RatePick.d.ts +8 -0
- package/es/ScreenPlayer/RatePick.js +29 -0
- package/es/ScreenPlayer/Record.d.ts +10 -0
- package/es/ScreenPlayer/Record.js +442 -0
- package/es/ScreenPlayer/RecordTools.d.ts +38 -0
- package/es/ScreenPlayer/RecordTools.js +197 -0
- package/es/ScreenPlayer/ScreenSelect.d.ts +7 -0
- package/es/ScreenPlayer/ScreenSelect.js +46 -0
- package/es/ScreenPlayer/SegmentTimeLine.d.ts +17 -0
- package/es/ScreenPlayer/SegmentTimeLine.js +36 -0
- package/es/ScreenPlayer/TimeMode.d.ts +7 -0
- package/es/ScreenPlayer/TimeMode.js +26 -0
- package/es/ScreenPlayer/TimeSelect.d.ts +7 -0
- package/es/ScreenPlayer/TimeSelect.js +88 -0
- package/es/ScreenPlayer/demo.d.ts +2 -0
- package/es/ScreenPlayer/demo.js +21 -0
- package/es/ScreenPlayer/demo2.d.ts +2 -0
- package/es/ScreenPlayer/demo2.js +194 -0
- package/es/ScreenPlayer/index.d.ts +6 -0
- package/es/ScreenPlayer/index.js +9 -0
- package/es/ScreenPlayer/index.less +335 -0
- package/es/ScreenPlayer/interface.d.ts +216 -0
- package/es/ScreenPlayer/useTimeSlider.d.ts +25 -0
- package/es/ScreenPlayer/useTimeSlider.js +451 -0
- package/es/ScreenPlayer/useVideoFit.d.ts +5 -0
- package/es/ScreenPlayer/useVideoFit.js +35 -0
- package/es/ScreenPlayer/utils.d.ts +17 -0
- package/es/ScreenPlayer/utils.js +85 -0
- package/es/SegmentPlayer/index.d.ts +2 -0
- package/es/SegmentPlayer/index.js +2 -0
- package/es/Service/http.d.ts +6 -0
- package/es/Service/http.js +133 -0
- package/es/Service/index.d.ts +3 -0
- package/es/Service/index.js +11 -0
- package/es/Service/interface.d.ts +23 -0
- package/es/Service/middleware.d.ts +8 -0
- package/es/Service/middleware.js +22 -0
- package/es/SocketEmitter/eventEmitter.d.ts +27 -0
- package/es/SocketEmitter/eventEmitter.js +88 -0
- package/es/SocketEmitter/index.d.ts +24 -0
- package/es/SocketEmitter/index.js +125 -0
- package/es/SocketEmitter/interface.d.ts +4 -0
- package/es/TableLayout/index.d.ts +10 -0
- package/es/TableLayout/index.js +27 -0
- package/es/TableLayout/index.less +4 -0
- package/es/ThemeAntd/demo.d.ts +4 -0
- package/es/ThemeAntd/demo.js +81 -0
- package/es/ThemeAntd/demo.less +20 -0
- package/es/ThemeAntd/index.d.ts +7 -0
- package/es/ThemeAntd/index.js +21 -0
- package/es/ThemeAntd/index.less +4 -0
- package/es/Timeout/index.d.ts +26 -0
- package/es/Timeout/index.js +65 -0
- package/es/bigNumberTransformCN/index.d.ts +5 -0
- package/es/bigNumberTransformCN/index.js +58 -0
- package/es/cache/index.d.ts +34 -0
- package/es/cache/index.js +94 -0
- package/es/copy/index.d.ts +1 -0
- package/es/copy/index.js +9 -0
- package/es/core.d.ts +0 -0
- package/es/getThemeStyle/index.d.ts +2 -0
- package/es/getThemeStyle/index.js +5 -0
- package/es/index.d.ts +62 -0
- package/es/index.js +62 -0
- package/es/likeGo/index.d.ts +2 -0
- package/es/likeGo/index.js +31 -0
- package/es/likeGoSync/index.d.ts +2 -0
- package/es/likeGoSync/index.js +10 -0
- package/es/logger/index.d.ts +7 -0
- package/es/logger/index.js +30 -0
- package/es/nextTick/index.d.ts +1 -0
- package/es/nextTick/index.js +3 -0
- package/es/recorder/demo.d.ts +3 -0
- package/es/recorder/demo.js +181 -0
- package/es/recorder/index.d.ts +294 -0
- package/es/recorder/index.js +992 -0
- package/es/submidstr/index.d.ts +5 -0
- package/es/submidstr/index.js +14 -0
- package/es/treeHelper/index.d.ts +11 -0
- package/es/treeHelper/index.js +188 -0
- package/es/typings.d.ts +2 -0
- package/es/useDrawROI/index.d.ts +16 -0
- package/es/useDrawROI/index.js +318 -0
- package/es/useEventEmitterHandle/index.d.ts +2 -0
- package/es/useEventEmitterHandle/index.js +17 -0
- package/es/useFullscreen/demo.d.ts +2 -0
- package/es/useFullscreen/demo.js +43 -0
- package/es/useFullscreen/index.d.ts +12 -0
- package/es/useFullscreen/index.js +76 -0
- package/es/useHistory/index.d.ts +3 -0
- package/es/useHistory/index.js +9 -0
- package/es/useHistory/interface.d.ts +3 -0
- package/es/useInfiniteScroll/index.d.ts +16 -0
- package/es/useInfiniteScroll/index.js +102 -0
- package/es/useRafInterval/index.d.ts +5 -0
- package/es/useRafInterval/index.js +71 -0
- package/es/useSimpleState/index.d.ts +3 -0
- package/es/useSimpleState/index.js +35 -0
- package/es/useVirtualList/index.d.ts +13 -0
- package/es/useVirtualList/index.js +136 -0
- package/es/utils.d.ts +14 -0
- package/es/utils.js +46 -0
- package/es/uuid/index.d.ts +5 -0
- package/es/uuid/index.js +6 -0
- package/package.json +1 -1
- package/tsconfig.json +1 -1
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { ISegmentType } from 'src/Player/player';
|
|
3
|
+
import './index.less';
|
|
4
|
+
export type PlayModeType = 1 | 2;
|
|
5
|
+
export interface IPluginProps {
|
|
6
|
+
url?: string;
|
|
7
|
+
children: JSX.Element;
|
|
8
|
+
/**
|
|
9
|
+
* @description 模式1浏览器模式,2插件模式
|
|
10
|
+
* @default 1
|
|
11
|
+
*/
|
|
12
|
+
mode?: PlayModeType;
|
|
13
|
+
/**
|
|
14
|
+
* @description 插件下载地址
|
|
15
|
+
*/
|
|
16
|
+
pluginDownloadUrl?: string;
|
|
17
|
+
/**
|
|
18
|
+
* @description 插件模式下传递的参数 ’&’开头
|
|
19
|
+
* @default ''
|
|
20
|
+
*/
|
|
21
|
+
pluginParams?: string;
|
|
22
|
+
segments?: ISegmentType[];
|
|
23
|
+
/**
|
|
24
|
+
* 正在获取视频数据
|
|
25
|
+
*/
|
|
26
|
+
loading?: boolean;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* 客户端插件模式,随机端口
|
|
30
|
+
*/
|
|
31
|
+
export declare const LOCAL_PORT: string[];
|
|
32
|
+
/**
|
|
33
|
+
* 随机获取端口号
|
|
34
|
+
* @returns
|
|
35
|
+
*/
|
|
36
|
+
export declare function getLocalPort(): string;
|
|
37
|
+
/**
|
|
38
|
+
* @desc 转码插件模式下的url
|
|
39
|
+
* @param url
|
|
40
|
+
* @param params
|
|
41
|
+
* @returns
|
|
42
|
+
*/
|
|
43
|
+
export declare function getLocalPlayPath(url: string, params?: string): string;
|
|
44
|
+
export declare function usePlugin(mode?: PlayModeType, key?: any): {
|
|
45
|
+
needInstall: boolean;
|
|
46
|
+
};
|
|
47
|
+
export declare function ExtModel({ url, children, mode, pluginDownloadUrl, pluginParams, loading, segments }: IPluginProps): JSX.Element;
|
|
48
|
+
export { ExtModel as default };
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
5
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
6
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
7
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
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
|
+
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); }
|
|
10
|
+
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; }
|
|
11
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
12
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
13
|
+
import React, { useEffect, useMemo, useState } from 'react';
|
|
14
|
+
import IconFont from "../Player/iconfont";
|
|
15
|
+
import "./index.less";
|
|
16
|
+
|
|
17
|
+
//模式1浏览器模式,2插件模式
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* 客户端插件模式,随机端口
|
|
21
|
+
*/
|
|
22
|
+
export var LOCAL_PORT = ['15080', '15081', '15082', '15083', '15084', '15085', '15086', '15087', '15088', '15089'];
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* 随机获取端口号
|
|
26
|
+
* @returns
|
|
27
|
+
*/
|
|
28
|
+
export function getLocalPort() {
|
|
29
|
+
return LOCAL_PORT[Math.floor(Math.random() * LOCAL_PORT.length)];
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* @desc 转码插件模式下的url
|
|
34
|
+
* @param url
|
|
35
|
+
* @param params
|
|
36
|
+
* @returns
|
|
37
|
+
*/
|
|
38
|
+
export function getLocalPlayPath(url) {
|
|
39
|
+
var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
|
|
40
|
+
var URL_TEMPLATE = "http://127.0.0.1:<port>/video/v1/transcoding?uri=<pull_uri>";
|
|
41
|
+
var port = getLocalPort();
|
|
42
|
+
var pull_uri = window.btoa(url).replace(/=/g, '').replace(/\//, '_').replace('+', '-');
|
|
43
|
+
return URL_TEMPLATE.replace('<port>', port).replace('<pull_uri>', pull_uri) + params;
|
|
44
|
+
}
|
|
45
|
+
export function usePlugin(mode, key) {
|
|
46
|
+
var _useState = useState({
|
|
47
|
+
installed: false
|
|
48
|
+
}),
|
|
49
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
50
|
+
state = _useState2[0],
|
|
51
|
+
setState = _useState2[1];
|
|
52
|
+
useEffect(function () {
|
|
53
|
+
if (mode !== 2) {
|
|
54
|
+
return undefined;
|
|
55
|
+
}
|
|
56
|
+
var port = getLocalPort();
|
|
57
|
+
var url = "http://127.0.0.1:".concat(port, "/video/v1/state");
|
|
58
|
+
var thenFn = function thenFn(res) {
|
|
59
|
+
return res.status === 200 ? setState({
|
|
60
|
+
installed: true
|
|
61
|
+
}) : undefined;
|
|
62
|
+
};
|
|
63
|
+
fetch(url).then(thenFn).catch(function (e) {
|
|
64
|
+
return console.error('插件未安装', e);
|
|
65
|
+
});
|
|
66
|
+
}, [mode, key]);
|
|
67
|
+
return {
|
|
68
|
+
needInstall: useMemo(function () {
|
|
69
|
+
return mode === 2 && !state.installed;
|
|
70
|
+
}, [state.installed, mode])
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
function NeedInstallPlugin(_ref) {
|
|
74
|
+
var pluginDownloadUrl = _ref.pluginDownloadUrl,
|
|
75
|
+
retry = _ref.retry;
|
|
76
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
77
|
+
className: "lm-player-ext-layout"
|
|
78
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
79
|
+
style: {
|
|
80
|
+
marginTop: -60,
|
|
81
|
+
textAlign: 'center'
|
|
82
|
+
}
|
|
83
|
+
}, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(IconFont, {
|
|
84
|
+
type: "lm-player-PlaySource",
|
|
85
|
+
style: {
|
|
86
|
+
fontSize: 66
|
|
87
|
+
}
|
|
88
|
+
})), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("span", null, "\u8BF7", /*#__PURE__*/React.createElement("a", {
|
|
89
|
+
target: "_blank",
|
|
90
|
+
href: pluginDownloadUrl,
|
|
91
|
+
style: {
|
|
92
|
+
textDecoration: 'none',
|
|
93
|
+
padding: '0 4px'
|
|
94
|
+
},
|
|
95
|
+
download: "PlayerPlugin.exe",
|
|
96
|
+
rel: "noopener noreferrer"
|
|
97
|
+
}, "\u4E0B\u8F7D"), "\u64AD\u653E\u63D2\u4EF6\uFF0C"), /*#__PURE__*/React.createElement("span", null, "\u82E5\u5DF2\u5B89\u88C5\u8BF7\u70B9\u51FB", /*#__PURE__*/React.createElement("a", {
|
|
98
|
+
style: {
|
|
99
|
+
padding: '0 4px'
|
|
100
|
+
},
|
|
101
|
+
onClick: retry
|
|
102
|
+
}, "\u91CD\u8BD5")))));
|
|
103
|
+
}
|
|
104
|
+
function Loading() {
|
|
105
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
106
|
+
className: "lm-player-ext-layout"
|
|
107
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
108
|
+
style: {
|
|
109
|
+
marginTop: -60,
|
|
110
|
+
textAlign: 'center'
|
|
111
|
+
}
|
|
112
|
+
}, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(IconFont, {
|
|
113
|
+
type: "lm-player-PlaySource",
|
|
114
|
+
style: {
|
|
115
|
+
fontSize: 66
|
|
116
|
+
}
|
|
117
|
+
})), /*#__PURE__*/React.createElement("div", null, "\u6B63\u5728\u83B7\u53D6\u89C6\u9891\u6570\u636E\uFF0C\u8BF7\u7A0D\u7B49...")));
|
|
118
|
+
}
|
|
119
|
+
function Empty() {
|
|
120
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
121
|
+
className: "lm-player-ext-layout"
|
|
122
|
+
}, /*#__PURE__*/React.createElement(IconFont, {
|
|
123
|
+
type: "lm-player-PlaySource",
|
|
124
|
+
style: {
|
|
125
|
+
fontSize: 66
|
|
126
|
+
}
|
|
127
|
+
}));
|
|
128
|
+
}
|
|
129
|
+
export function ExtModel(_ref2) {
|
|
130
|
+
var url = _ref2.url,
|
|
131
|
+
children = _ref2.children,
|
|
132
|
+
mode = _ref2.mode,
|
|
133
|
+
pluginDownloadUrl = _ref2.pluginDownloadUrl,
|
|
134
|
+
pluginParams = _ref2.pluginParams,
|
|
135
|
+
loading = _ref2.loading,
|
|
136
|
+
segments = _ref2.segments;
|
|
137
|
+
var _useState3 = useState({
|
|
138
|
+
forceKey: Date.now()
|
|
139
|
+
}),
|
|
140
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
141
|
+
state = _useState4[0],
|
|
142
|
+
setState = _useState4[1];
|
|
143
|
+
var hasUrl = useMemo(function () {
|
|
144
|
+
return !!url || Array.isArray(segments) && segments.findIndex(function (v) {
|
|
145
|
+
return v.url;
|
|
146
|
+
}) > -1;
|
|
147
|
+
}, [segments, url]);
|
|
148
|
+
var _usePlugin = usePlugin(mode, state.forceKey),
|
|
149
|
+
needInstall = _usePlugin.needInstall;
|
|
150
|
+
|
|
151
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
152
|
+
var playUrl = useMemo(function () {
|
|
153
|
+
return mode === 2 && url ? getLocalPlayPath(url, pluginParams) : url;
|
|
154
|
+
}, [url, mode]);
|
|
155
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
156
|
+
var playSegments = useMemo(function () {
|
|
157
|
+
return mode === 2 && segments ? segments.map(function (v) {
|
|
158
|
+
return _objectSpread(_objectSpread({}, v), {}, {
|
|
159
|
+
url: v.url ? getLocalPlayPath(v.url, pluginParams) : undefined
|
|
160
|
+
});
|
|
161
|
+
}) : segments;
|
|
162
|
+
}, [segments, mode]);
|
|
163
|
+
if (needInstall) {
|
|
164
|
+
return /*#__PURE__*/React.createElement(NeedInstallPlugin, {
|
|
165
|
+
pluginDownloadUrl: pluginDownloadUrl,
|
|
166
|
+
retry: function retry() {
|
|
167
|
+
return setState(function (old) {
|
|
168
|
+
return _objectSpread(_objectSpread({}, old), {}, {
|
|
169
|
+
forceKey: Date.now()
|
|
170
|
+
});
|
|
171
|
+
});
|
|
172
|
+
}
|
|
173
|
+
});
|
|
174
|
+
}
|
|
175
|
+
if (loading) {
|
|
176
|
+
return /*#__PURE__*/React.createElement(Loading, null);
|
|
177
|
+
}
|
|
178
|
+
if (!hasUrl) {
|
|
179
|
+
return /*#__PURE__*/React.createElement(Empty, null);
|
|
180
|
+
}
|
|
181
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
182
|
+
className: "lm-player-ext-layout"
|
|
183
|
+
}, /*#__PURE__*/React.cloneElement(children, mode === 2 ? {
|
|
184
|
+
url: playUrl,
|
|
185
|
+
segments: playSegments
|
|
186
|
+
} : {}));
|
|
187
|
+
}
|
|
188
|
+
export { ExtModel as default };
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
2
|
+
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."); }
|
|
3
|
+
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); }
|
|
4
|
+
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; }
|
|
5
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
6
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
7
|
+
import { Progress } from 'antd';
|
|
8
|
+
import React, { useEffect, useMemo, useRef, useState } from 'react';
|
|
9
|
+
import "./index.less";
|
|
10
|
+
function ProgressComponent(_ref) {
|
|
11
|
+
var _ref$status = _ref.status,
|
|
12
|
+
status = _ref$status === void 0 ? 'loading' : _ref$status;
|
|
13
|
+
var timer = useRef();
|
|
14
|
+
var currentStatus = useRef('loading');
|
|
15
|
+
var _useState = useState(0),
|
|
16
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
17
|
+
percent = _useState2[0],
|
|
18
|
+
setPersent = _useState2[1];
|
|
19
|
+
var isHide = useMemo(function () {
|
|
20
|
+
return percent === 100;
|
|
21
|
+
}, [percent]);
|
|
22
|
+
useEffect(function () {
|
|
23
|
+
if ((status === 'over' || status === 'error') && percent === 0) {
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
if (percent <= 90 && currentStatus.current === 'loading') {
|
|
27
|
+
var num = percent + 20;
|
|
28
|
+
timer.current = setTimeout(function () {
|
|
29
|
+
return setPersent(num);
|
|
30
|
+
}, 10);
|
|
31
|
+
} else {
|
|
32
|
+
clearTimeout(timer.current);
|
|
33
|
+
setPersent(100);
|
|
34
|
+
timer.current = setTimeout(function () {
|
|
35
|
+
return setPersent(0);
|
|
36
|
+
}, 1000);
|
|
37
|
+
}
|
|
38
|
+
}, [percent, status]);
|
|
39
|
+
useEffect(function () {
|
|
40
|
+
return function () {
|
|
41
|
+
return clearTimeout(timer.current);
|
|
42
|
+
};
|
|
43
|
+
});
|
|
44
|
+
return /*#__PURE__*/React.createElement(Progress, {
|
|
45
|
+
status: status === 'error' ? 'exception' : 'active',
|
|
46
|
+
percent: percent,
|
|
47
|
+
showInfo: false,
|
|
48
|
+
strokeWidth: 2,
|
|
49
|
+
strokeColor: status !== 'error' ? 'var(--primary)' : ' var(--danger)',
|
|
50
|
+
className: "lm-c-loading-progress ".concat(isHide ? 'lm-c-loading-progress-over' : '')
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
export default ProgressComponent;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
.@{ant-prefix}-progress.lm-c-loading-progress {
|
|
2
|
+
position: absolute;
|
|
3
|
+
top: 0;
|
|
4
|
+
left: 0;
|
|
5
|
+
z-index: 99;
|
|
6
|
+
height: 2px;
|
|
7
|
+
overflow: hidden;
|
|
8
|
+
opacity: 1;
|
|
9
|
+
transition: opacity 1s linear;
|
|
10
|
+
|
|
11
|
+
&.lm-c-loading-progress-over {
|
|
12
|
+
opacity: 0;
|
|
13
|
+
}
|
|
14
|
+
.@{ant-prefix}-progress-outer {
|
|
15
|
+
display: block;
|
|
16
|
+
.@{ant-prefix}-progress-inner {
|
|
17
|
+
display: block;
|
|
18
|
+
background-color: transparent;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
package/es/ROI/demo.d.ts
ADDED
package/es/ROI/demo.js
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import ROI from "./index";
|
|
3
|
+
var App = function App() {
|
|
4
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
5
|
+
style: {
|
|
6
|
+
width: "100%",
|
|
7
|
+
height: 400,
|
|
8
|
+
background: '#999'
|
|
9
|
+
}
|
|
10
|
+
}, /*#__PURE__*/React.createElement(ROI, {
|
|
11
|
+
debug: true,
|
|
12
|
+
isOpen: true,
|
|
13
|
+
onChange: console.log
|
|
14
|
+
}));
|
|
15
|
+
};
|
|
16
|
+
export default App;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import './index.less';
|
|
3
|
+
interface IRIOProps {
|
|
4
|
+
children?: React.ReactNode;
|
|
5
|
+
/**
|
|
6
|
+
* 调试模式,开启回绘制具体网格
|
|
7
|
+
*/
|
|
8
|
+
debug?: boolean;
|
|
9
|
+
/**
|
|
10
|
+
* 绘制数据变化
|
|
11
|
+
*/
|
|
12
|
+
onChange?: (rio: number[][], areas: [number, number][][]) => void;
|
|
13
|
+
/**
|
|
14
|
+
* 开启/关闭 标识
|
|
15
|
+
*/
|
|
16
|
+
isOpen?: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* key变化回清楚画布
|
|
19
|
+
*/
|
|
20
|
+
renderKey?: React.Key;
|
|
21
|
+
/**
|
|
22
|
+
* rio共多少行
|
|
23
|
+
* @default 18
|
|
24
|
+
*/
|
|
25
|
+
row?: number;
|
|
26
|
+
/**
|
|
27
|
+
* rio 一行有多少个位置
|
|
28
|
+
* @default 32
|
|
29
|
+
*/
|
|
30
|
+
rowItems?: number;
|
|
31
|
+
}
|
|
32
|
+
declare function RIO({ children, debug, renderKey, onChange, isOpen, row, rowItems }: IRIOProps): React.JSX.Element;
|
|
33
|
+
export default RIO;
|
package/es/ROI/index.js
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { useUpdateEffect } from 'ahooks';
|
|
2
|
+
import React, { useEffect, useRef } from 'react';
|
|
3
|
+
import useDrawROI from "../useDrawROI";
|
|
4
|
+
import "./index.less";
|
|
5
|
+
function RIO(_ref) {
|
|
6
|
+
var children = _ref.children,
|
|
7
|
+
debug = _ref.debug,
|
|
8
|
+
renderKey = _ref.renderKey,
|
|
9
|
+
onChange = _ref.onChange,
|
|
10
|
+
isOpen = _ref.isOpen,
|
|
11
|
+
_ref$row = _ref.row,
|
|
12
|
+
row = _ref$row === void 0 ? 18 : _ref$row,
|
|
13
|
+
_ref$rowItems = _ref.rowItems,
|
|
14
|
+
rowItems = _ref$rowItems === void 0 ? 32 : _ref$rowItems;
|
|
15
|
+
var ref = useRef(null);
|
|
16
|
+
var _useDrawROI = useDrawROI(ref, {
|
|
17
|
+
row: row,
|
|
18
|
+
rowItems: rowItems
|
|
19
|
+
}),
|
|
20
|
+
open = _useDrawROI.open,
|
|
21
|
+
close = _useDrawROI.close,
|
|
22
|
+
clear = _useDrawROI.clear,
|
|
23
|
+
rio = _useDrawROI.rio,
|
|
24
|
+
areas = _useDrawROI.areas;
|
|
25
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
26
|
+
useEffect(function () {
|
|
27
|
+
return isOpen ? open() : close();
|
|
28
|
+
}, [isOpen]);
|
|
29
|
+
useUpdateEffect(function () {
|
|
30
|
+
return clear();
|
|
31
|
+
}, [renderKey]);
|
|
32
|
+
useUpdateEffect(function () {
|
|
33
|
+
return onChange === null || onChange === void 0 ? void 0 : onChange(rio, areas);
|
|
34
|
+
}, [rio]);
|
|
35
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
36
|
+
className: "rio-layout"
|
|
37
|
+
}, children, debug && /*#__PURE__*/React.createElement("div", {
|
|
38
|
+
className: "rio-debug-box"
|
|
39
|
+
}, rio.map(function (item, index) {
|
|
40
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
41
|
+
key: "row-".concat(index)
|
|
42
|
+
}, item.map(function (n, i) {
|
|
43
|
+
return /*#__PURE__*/React.createElement("span", {
|
|
44
|
+
key: "item-".concat(i),
|
|
45
|
+
style: {
|
|
46
|
+
backgroundColor: n === 1 ? 'rgba(0,0,0,0.5)' : 'transparent'
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
}));
|
|
50
|
+
})), /*#__PURE__*/React.createElement("canvas", {
|
|
51
|
+
ref: ref
|
|
52
|
+
}));
|
|
53
|
+
}
|
|
54
|
+
export default RIO;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
.rio-layout {
|
|
2
|
+
position: relative;
|
|
3
|
+
width: 100%;
|
|
4
|
+
height: 100%;
|
|
5
|
+
|
|
6
|
+
canvas {
|
|
7
|
+
position: absolute;
|
|
8
|
+
top: 0;
|
|
9
|
+
left: 0;
|
|
10
|
+
width: 100%;
|
|
11
|
+
height: 100%;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.rio-debug-box {
|
|
15
|
+
position: absolute;
|
|
16
|
+
top: 0;
|
|
17
|
+
left: 0;
|
|
18
|
+
display: flex;
|
|
19
|
+
width: 100%;
|
|
20
|
+
height: 100%;
|
|
21
|
+
flex-direction: column;
|
|
22
|
+
|
|
23
|
+
& > div {
|
|
24
|
+
display: flex;
|
|
25
|
+
flex: 1;
|
|
26
|
+
|
|
27
|
+
span {
|
|
28
|
+
flex: 1;
|
|
29
|
+
border: 1px solid #eee;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface IFooterProps {
|
|
3
|
+
onClose?: (e: React.MouseEvent) => void;
|
|
4
|
+
cancelText: string;
|
|
5
|
+
okText: string;
|
|
6
|
+
onOk?: (e: React.MouseEvent) => void;
|
|
7
|
+
}
|
|
8
|
+
declare function Footer({ onClose, cancelText, okText, onOk }: IFooterProps): React.JSX.Element;
|
|
9
|
+
export default Footer;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Button } from 'antd';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
function Footer(_ref) {
|
|
4
|
+
var onClose = _ref.onClose,
|
|
5
|
+
cancelText = _ref.cancelText,
|
|
6
|
+
okText = _ref.okText,
|
|
7
|
+
onOk = _ref.onOk;
|
|
8
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
9
|
+
style: {
|
|
10
|
+
textAlign: 'right'
|
|
11
|
+
}
|
|
12
|
+
}, /*#__PURE__*/React.createElement(Button, {
|
|
13
|
+
onClick: onClose,
|
|
14
|
+
style: {
|
|
15
|
+
marginRight: 8
|
|
16
|
+
}
|
|
17
|
+
}, cancelText), /*#__PURE__*/React.createElement(Button, {
|
|
18
|
+
onClick: onOk,
|
|
19
|
+
type: "primary"
|
|
20
|
+
}, okText));
|
|
21
|
+
}
|
|
22
|
+
export default Footer;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Button } from 'antd';
|
|
2
|
+
import React, { useRef } from 'react';
|
|
3
|
+
import RefDrawer from "./index";
|
|
4
|
+
var App = function App() {
|
|
5
|
+
var ref = useRef(null);
|
|
6
|
+
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Button, {
|
|
7
|
+
type: "primary",
|
|
8
|
+
onClick: function onClick() {
|
|
9
|
+
var _ref$current;
|
|
10
|
+
return (_ref$current = ref.current) === null || _ref$current === void 0 ? void 0 : _ref$current.open({
|
|
11
|
+
content: /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("p", null, "Some contents..."), /*#__PURE__*/React.createElement("p", null, "Some contents..."), /*#__PURE__*/React.createElement("p", null, "Some contents..."))
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
}, "RefDrawer"), /*#__PURE__*/React.createElement(RefDrawer, {
|
|
15
|
+
ref: ref
|
|
16
|
+
}));
|
|
17
|
+
};
|
|
18
|
+
export default App;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { DrawerProps } from 'antd';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
export interface IUseDrawerHookState {
|
|
4
|
+
content?: React.ReactNode;
|
|
5
|
+
visible?: boolean;
|
|
6
|
+
title?: React.ReactNode;
|
|
7
|
+
onOk?: (e: React.MouseEvent) => void;
|
|
8
|
+
width?: number | string;
|
|
9
|
+
className?: string;
|
|
10
|
+
}
|
|
11
|
+
export interface IRefDrawerMethodsProps {
|
|
12
|
+
open: (options: IUseDrawerHookState) => void;
|
|
13
|
+
close: () => void;
|
|
14
|
+
}
|
|
15
|
+
export interface IDrawerProps extends DrawerProps {
|
|
16
|
+
cancelText?: string;
|
|
17
|
+
onOk?: (e: React.MouseEvent) => void;
|
|
18
|
+
/**
|
|
19
|
+
* @description 确认按钮文本
|
|
20
|
+
* @default 确定
|
|
21
|
+
* @type string
|
|
22
|
+
*/
|
|
23
|
+
okText?: string;
|
|
24
|
+
}
|
|
25
|
+
declare const RefDrawer: React.ForwardRefExoticComponent<Omit<any, "ref"> & React.RefAttributes<IRefDrawerMethodsProps>>;
|
|
26
|
+
export default RefDrawer;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
5
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
6
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
7
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
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
|
+
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); }
|
|
10
|
+
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; }
|
|
11
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
12
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
13
|
+
import { Drawer } from 'antd';
|
|
14
|
+
import React, { useContext, useImperativeHandle, useMemo, useState } from 'react';
|
|
15
|
+
import ConfigContext from "../ConfigContext";
|
|
16
|
+
import Footer from "./Footer";
|
|
17
|
+
var RefDrawer = /*#__PURE__*/React.forwardRef(function RefDrawer(_, ref) {
|
|
18
|
+
var context = useContext(ConfigContext.Context);
|
|
19
|
+
var root = useMemo(function () {
|
|
20
|
+
return (context === null || context === void 0 ? void 0 : context.root) || document.body;
|
|
21
|
+
}, [context === null || context === void 0 ? void 0 : context.root]);
|
|
22
|
+
var _useState = useState({
|
|
23
|
+
content: null,
|
|
24
|
+
visible: false,
|
|
25
|
+
title: '',
|
|
26
|
+
onOk: undefined,
|
|
27
|
+
width: undefined,
|
|
28
|
+
className: undefined
|
|
29
|
+
}),
|
|
30
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
31
|
+
state = _useState2[0],
|
|
32
|
+
setState = _useState2[1];
|
|
33
|
+
var open = function open(options) {
|
|
34
|
+
setState(function (old) {
|
|
35
|
+
return _objectSpread(_objectSpread(_objectSpread({}, old), options), {}, {
|
|
36
|
+
visible: true
|
|
37
|
+
});
|
|
38
|
+
});
|
|
39
|
+
};
|
|
40
|
+
var close = function close() {
|
|
41
|
+
setState(function (old) {
|
|
42
|
+
return _objectSpread(_objectSpread({}, old), {}, {
|
|
43
|
+
visible: false
|
|
44
|
+
});
|
|
45
|
+
});
|
|
46
|
+
};
|
|
47
|
+
useImperativeHandle(ref, function () {
|
|
48
|
+
return {
|
|
49
|
+
open: open,
|
|
50
|
+
close: close
|
|
51
|
+
};
|
|
52
|
+
}, [state]);
|
|
53
|
+
return /*#__PURE__*/React.createElement(Drawer, {
|
|
54
|
+
footer: /*#__PURE__*/React.createElement(Footer, {
|
|
55
|
+
onClose: close,
|
|
56
|
+
onOk: state.onOk,
|
|
57
|
+
okText: "\u786E\u5B9A",
|
|
58
|
+
cancelText: "\u53D6\u6D88"
|
|
59
|
+
}),
|
|
60
|
+
open: state.visible,
|
|
61
|
+
onClose: close,
|
|
62
|
+
destroyOnClose: true,
|
|
63
|
+
title: state.title,
|
|
64
|
+
width: state.width,
|
|
65
|
+
className: state.className,
|
|
66
|
+
getContainer: function getContainer() {
|
|
67
|
+
return root;
|
|
68
|
+
}
|
|
69
|
+
}, state.content);
|
|
70
|
+
});
|
|
71
|
+
export default RefDrawer;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Button } from 'antd';
|
|
2
|
+
import React, { useRef } from 'react';
|
|
3
|
+
import RefModal from "./index";
|
|
4
|
+
var App = function App() {
|
|
5
|
+
var ref = useRef(null);
|
|
6
|
+
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Button, {
|
|
7
|
+
type: "primary",
|
|
8
|
+
onClick: function onClick() {
|
|
9
|
+
var _ref$current;
|
|
10
|
+
return (_ref$current = ref.current) === null || _ref$current === void 0 ? void 0 : _ref$current.open({
|
|
11
|
+
content: /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("p", null, "some contents..."), /*#__PURE__*/React.createElement("p", null, "some contents..."), /*#__PURE__*/React.createElement("p", null, "some contents..."))
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
}, "RefModal"), /*#__PURE__*/React.createElement(RefModal, {
|
|
15
|
+
ref: ref
|
|
16
|
+
}));
|
|
17
|
+
};
|
|
18
|
+
export default App;
|