@cloud-app-dev/vidc 4.0.17 → 4.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (299) hide show
  1. package/.dumirc.ts +1 -1
  2. package/.eslintrc.js +3 -0
  3. package/.fatherrc.ts +0 -6
  4. package/es/AppContext/Sync.d.ts +7 -0
  5. package/es/AppContext/Sync.js +44 -0
  6. package/es/AppContext/index.d.ts +17 -0
  7. package/es/AppContext/index.js +154 -0
  8. package/es/AppContext/interface.d.ts +42 -0
  9. package/es/AppContext/static.d.ts +8 -0
  10. package/es/AppContext/static.js +9 -0
  11. package/es/CheckGroupFixed/demo.d.ts +2 -0
  12. package/es/CheckGroupFixed/demo.js +20 -0
  13. package/es/CheckGroupFixed/index.d.ts +22 -0
  14. package/es/CheckGroupFixed/index.js +150 -0
  15. package/es/CheckGroupFixed/style.d.ts +6 -0
  16. package/es/CheckGroupFixed/style.js +9 -0
  17. package/es/Config/index.d.ts +4 -0
  18. package/es/Config/index.js +77 -0
  19. package/es/Config/interface.d.ts +65 -0
  20. package/es/Config/utils.d.ts +4 -0
  21. package/es/Config/utils.js +33 -0
  22. package/es/CustomRenderSelect/index.d.ts +13 -0
  23. package/es/CustomRenderSelect/index.js +86 -0
  24. package/es/DBTools/index.d.ts +25 -0
  25. package/es/DBTools/index.js +336 -0
  26. package/es/DisableMark/index.d.ts +8 -0
  27. package/es/DisableMark/index.js +25 -0
  28. package/es/DomMove/demo.d.ts +1 -0
  29. package/es/DomMove/demo.js +19 -0
  30. package/es/DomMove/index.d.ts +16 -0
  31. package/es/DomMove/index.js +148 -0
  32. package/es/DomMove/utils.d.ts +8 -0
  33. package/es/DomMove/utils.js +33 -0
  34. package/es/Drag/DragAndDropItem.d.ts +4 -0
  35. package/es/Drag/DragAndDropItem.js +133 -0
  36. package/es/Drag/DropItem.d.ts +4 -0
  37. package/es/Drag/DropItem.js +50 -0
  38. package/es/Drag/index.d.ts +7 -0
  39. package/es/Drag/index.js +7 -0
  40. package/es/Drag/interface.d.ts +16 -0
  41. package/es/DynamicGridList/demo.d.ts +2 -0
  42. package/es/DynamicGridList/demo.js +86 -0
  43. package/es/DynamicGridList/index.d.ts +27 -0
  44. package/es/DynamicGridList/index.js +71 -0
  45. package/es/DynamicList/demo.d.ts +1 -0
  46. package/es/DynamicList/demo.js +45 -0
  47. package/es/DynamicList/index.d.ts +30 -0
  48. package/es/DynamicList/index.js +98 -0
  49. package/es/DynamicList/interface.d.ts +19 -0
  50. package/es/DynamicList/utils.d.ts +4 -0
  51. package/es/DynamicList/utils.js +6 -0
  52. package/es/ErrorFallback/index.d.ts +8 -0
  53. package/es/ErrorFallback/index.js +38 -0
  54. package/es/ErrorFallback/inerface.d.ts +48 -0
  55. package/es/EventTools/index.d.ts +3 -0
  56. package/es/EventTools/index.js +12 -0
  57. package/es/FrontendPlayer/index.d.ts +4 -0
  58. package/es/FrontendPlayer/index.js +2 -0
  59. package/es/GridList/data.d.ts +16 -0
  60. package/es/GridList/data.js +609 -0
  61. package/es/GridList/demo.d.ts +2 -0
  62. package/es/GridList/demo.js +89 -0
  63. package/es/GridList/hook.d.ts +13 -0
  64. package/es/GridList/hook.js +270 -0
  65. package/es/GridList/index.d.ts +14 -0
  66. package/es/GridList/index.js +51 -0
  67. package/es/GridList/interface.d.ts +59 -0
  68. package/es/GridList/utils.d.ts +9 -0
  69. package/es/GridList/utils.js +42 -0
  70. package/es/HightLevel/index.d.ts +8 -0
  71. package/es/HightLevel/index.js +20 -0
  72. package/es/IconFont/index.d.ts +12 -0
  73. package/es/IconFont/index.js +63 -0
  74. package/es/InstanceHistory/index.d.ts +3 -0
  75. package/es/InstanceHistory/index.js +7 -0
  76. package/es/LabelValue/index.d.ts +14 -0
  77. package/es/LabelValue/index.js +35 -0
  78. package/es/List/demo.d.ts +2 -0
  79. package/es/List/demo.js +25 -0
  80. package/es/List/index.d.ts +27 -0
  81. package/es/List/index.js +38 -0
  82. package/es/ListWithSizeAnimate/demo.d.ts +1 -0
  83. package/es/ListWithSizeAnimate/demo.js +128 -0
  84. package/es/ListWithSizeAnimate/index.d.ts +13 -0
  85. package/es/ListWithSizeAnimate/index.js +106 -0
  86. package/es/LoaderScript/index.d.ts +47 -0
  87. package/es/LoaderScript/index.js +38 -0
  88. package/es/LoaderScript/utils.d.ts +13 -0
  89. package/es/LoaderScript/utils.js +179 -0
  90. package/es/Picture/component/DefaultRects/RectInfo.d.ts +7 -0
  91. package/es/Picture/component/DefaultRects/RectInfo.js +90 -0
  92. package/es/Picture/component/DefaultRects/index.d.ts +11 -0
  93. package/es/Picture/component/DefaultRects/index.js +58 -0
  94. package/es/Picture/component/DefaultRects/style.d.ts +10 -0
  95. package/es/Picture/component/DefaultRects/style.js +28 -0
  96. package/es/Picture/component/DefaultRects/utils.d.ts +2 -0
  97. package/es/Picture/component/DefaultRects/utils.js +11 -0
  98. package/es/Picture/component/DrawRect/index.d.ts +11 -0
  99. package/es/Picture/component/DrawRect/index.js +54 -0
  100. package/es/Picture/component/RectMenu/index.d.ts +10 -0
  101. package/es/Picture/component/RectMenu/index.js +84 -0
  102. package/es/Picture/component/RectMenu/utils.d.ts +12 -0
  103. package/es/Picture/component/RectMenu/utils.js +19 -0
  104. package/es/Picture/component/Tools/index.d.ts +11 -0
  105. package/es/Picture/component/Tools/index.js +105 -0
  106. package/es/Picture/component/Tools/style.d.ts +2 -0
  107. package/es/Picture/component/Tools/style.js +5 -0
  108. package/es/Picture/component/WheelScale/index.d.ts +6 -0
  109. package/es/Picture/component/WheelScale/index.js +29 -0
  110. package/es/Picture/demo.d.ts +1 -0
  111. package/es/Picture/demo.js +114 -0
  112. package/es/Picture/index.d.ts +17 -0
  113. package/es/Picture/index.js +356 -0
  114. package/es/Picture/interface.d.ts +196 -0
  115. package/es/Picture/loadCaptureRectImage.d.ts +3 -0
  116. package/es/Picture/loadCaptureRectImage.js +99 -0
  117. package/es/Picture/useDraw.d.ts +1 -0
  118. package/es/Picture/useDraw.js +103 -0
  119. package/es/Picture/utils.d.ts +26 -0
  120. package/es/Picture/utils.js +143 -0
  121. package/es/Player/api/index.d.ts +68 -0
  122. package/es/Player/api/index.js +309 -0
  123. package/es/Player/context.d.ts +21 -0
  124. package/es/Player/context.js +25 -0
  125. package/es/Player/contraller_bar/bar.d.ts +8 -0
  126. package/es/Player/contraller_bar/bar.js +32 -0
  127. package/es/Player/contraller_bar/contraller_event.d.ts +6 -0
  128. package/es/Player/contraller_bar/contraller_event.js +52 -0
  129. package/es/Player/contraller_bar/index.d.ts +13 -0
  130. package/es/Player/contraller_bar/index.js +39 -0
  131. package/es/Player/contraller_bar/left_bar.d.ts +10 -0
  132. package/es/Player/contraller_bar/left_bar.js +97 -0
  133. package/es/Player/contraller_bar/right_bar.d.ts +8 -0
  134. package/es/Player/contraller_bar/right_bar.js +36 -0
  135. package/es/Player/contraller_bar/time.d.ts +2 -0
  136. package/es/Player/contraller_bar/time.js +24 -0
  137. package/es/Player/contraller_bar/useBarStatus.d.ts +2 -0
  138. package/es/Player/contraller_bar/useBarStatus.js +43 -0
  139. package/es/Player/contraller_bar/volume.d.ts +8 -0
  140. package/es/Player/contraller_bar/volume.js +70 -0
  141. package/es/Player/demo.d.ts +2 -0
  142. package/es/Player/demo.js +289 -0
  143. package/es/Player/empty.d.ts +1 -0
  144. package/es/Player/empty.js +5 -0
  145. package/es/Player/event/errorEvent.d.ts +14 -0
  146. package/es/Player/event/errorEvent.js +88 -0
  147. package/es/Player/event/eventName.d.ts +18 -0
  148. package/es/Player/event/eventName.js +30 -0
  149. package/es/Player/event/index.d.ts +24 -0
  150. package/es/Player/event/index.js +205 -0
  151. package/es/Player/fps_play.d.ts +10 -0
  152. package/es/Player/fps_play.js +88 -0
  153. package/es/Player/frontend_player.d.ts +7 -0
  154. package/es/Player/frontend_player.js +71 -0
  155. package/es/Player/frontend_timeline.d.ts +8 -0
  156. package/es/Player/frontend_timeline.js +153 -0
  157. package/es/Player/iconfont.d.ts +4 -0
  158. package/es/Player/iconfont.js +21 -0
  159. package/es/Player/index.d.ts +2 -0
  160. package/es/Player/index.js +2 -0
  161. package/es/Player/live_heart.d.ts +8 -0
  162. package/es/Player/live_heart.js +45 -0
  163. package/es/Player/message.d.ts +3 -0
  164. package/es/Player/message.js +147 -0
  165. package/es/Player/player.d.ts +233 -0
  166. package/es/Player/segment_player.d.ts +8 -0
  167. package/es/Player/segment_player.js +229 -0
  168. package/es/Player/segment_timeline.d.ts +10 -0
  169. package/es/Player/segment_timeline.js +200 -0
  170. package/es/Player/single_player.d.ts +4 -0
  171. package/es/Player/single_player.js +278 -0
  172. package/es/Player/style/iconfont.js +43 -0
  173. package/es/Player/timeline.d.ts +7 -0
  174. package/es/Player/timeline.js +104 -0
  175. package/es/Player/util.d.ts +43 -0
  176. package/es/Player/util.js +189 -0
  177. package/es/PlayerExt/demo.d.ts +2 -0
  178. package/es/PlayerExt/demo.js +170 -0
  179. package/es/PlayerExt/index.d.ts +47 -0
  180. package/es/PlayerExt/index.js +212 -0
  181. package/es/Progress/index.d.ts +10 -0
  182. package/es/Progress/index.js +60 -0
  183. package/es/ROI/demo.d.ts +2 -0
  184. package/es/ROI/demo.js +17 -0
  185. package/es/ROI/index.d.ts +32 -0
  186. package/es/ROI/index.js +67 -0
  187. package/es/RefDrawer/Footer.d.ts +9 -0
  188. package/es/RefDrawer/Footer.js +27 -0
  189. package/es/RefDrawer/demo.d.ts +3 -0
  190. package/es/RefDrawer/demo.js +32 -0
  191. package/es/RefDrawer/index.d.ts +26 -0
  192. package/es/RefDrawer/index.js +73 -0
  193. package/es/RefModal/demo.d.ts +2 -0
  194. package/es/RefModal/demo.js +32 -0
  195. package/es/RefModal/index.d.ts +17 -0
  196. package/es/RefModal/index.js +71 -0
  197. package/es/ScreenPlayer/Live.d.ts +8 -0
  198. package/es/ScreenPlayer/Live.js +219 -0
  199. package/es/ScreenPlayer/LiveTools.d.ts +33 -0
  200. package/es/ScreenPlayer/LiveTools.js +172 -0
  201. package/es/ScreenPlayer/PlayerWithExt.d.ts +34 -0
  202. package/es/ScreenPlayer/PlayerWithExt.js +241 -0
  203. package/es/ScreenPlayer/RatePick.d.ts +7 -0
  204. package/es/ScreenPlayer/RatePick.js +35 -0
  205. package/es/ScreenPlayer/Record.d.ts +8 -0
  206. package/es/ScreenPlayer/Record.js +452 -0
  207. package/es/ScreenPlayer/RecordTools.d.ts +38 -0
  208. package/es/ScreenPlayer/RecordTools.js +214 -0
  209. package/es/ScreenPlayer/ScreenSelect.d.ts +6 -0
  210. package/es/ScreenPlayer/ScreenSelect.js +59 -0
  211. package/es/ScreenPlayer/SegmentTimeLine.d.ts +16 -0
  212. package/es/ScreenPlayer/SegmentTimeLine.js +44 -0
  213. package/es/ScreenPlayer/TimeMode.d.ts +6 -0
  214. package/es/ScreenPlayer/TimeMode.js +34 -0
  215. package/es/ScreenPlayer/TimeSelect.d.ts +6 -0
  216. package/es/ScreenPlayer/TimeSelect.js +99 -0
  217. package/es/ScreenPlayer/containerStyle.d.ts +13 -0
  218. package/es/ScreenPlayer/containerStyle.js +32 -0
  219. package/es/ScreenPlayer/demo.d.ts +1 -0
  220. package/es/ScreenPlayer/demo.js +19 -0
  221. package/es/ScreenPlayer/demo2.d.ts +1 -0
  222. package/es/ScreenPlayer/demo2.js +196 -0
  223. package/es/ScreenPlayer/index.d.ts +6 -0
  224. package/es/ScreenPlayer/index.js +9 -0
  225. package/es/ScreenPlayer/interface.d.ts +216 -0
  226. package/es/ScreenPlayer/useTimeSlider.d.ts +25 -0
  227. package/es/ScreenPlayer/useTimeSlider.js +451 -0
  228. package/es/ScreenPlayer/useVideoFit.d.ts +5 -0
  229. package/es/ScreenPlayer/useVideoFit.js +35 -0
  230. package/es/ScreenPlayer/utils.d.ts +17 -0
  231. package/es/ScreenPlayer/utils.js +85 -0
  232. package/es/SegmentPlayer/index.d.ts +2 -0
  233. package/es/SegmentPlayer/index.js +2 -0
  234. package/es/Service/http.d.ts +6 -0
  235. package/es/Service/http.js +125 -0
  236. package/es/Service/index.d.ts +3 -0
  237. package/es/Service/index.js +10 -0
  238. package/es/Service/interface.d.ts +22 -0
  239. package/es/Service/middleware.d.ts +5 -0
  240. package/es/Service/middleware.js +15 -0
  241. package/es/SocketEmitter/eventEmitter.d.ts +27 -0
  242. package/es/SocketEmitter/eventEmitter.js +88 -0
  243. package/es/SocketEmitter/index.d.ts +24 -0
  244. package/es/SocketEmitter/index.js +125 -0
  245. package/es/SocketEmitter/interface.d.ts +4 -0
  246. package/es/TableLayout/index.d.ts +9 -0
  247. package/es/TableLayout/index.js +32 -0
  248. package/es/Timeout/index.d.ts +31 -0
  249. package/es/Timeout/index.js +69 -0
  250. package/es/cache/index.d.ts +34 -0
  251. package/es/cache/index.js +94 -0
  252. package/es/copy/index.d.ts +1 -0
  253. package/es/copy/index.js +9 -0
  254. package/es/core.d.ts +0 -0
  255. package/es/getThemeStyle/index.d.ts +2 -0
  256. package/es/getThemeStyle/index.js +5 -0
  257. package/es/index.d.ts +52 -0
  258. package/es/index.js +52 -0
  259. package/es/likeGo/index.d.ts +2 -0
  260. package/es/likeGo/index.js +31 -0
  261. package/es/likeGoSync/index.d.ts +2 -0
  262. package/es/likeGoSync/index.js +10 -0
  263. package/es/logger/index.d.ts +7 -0
  264. package/es/logger/index.js +30 -0
  265. package/es/nextTick/index.d.ts +1 -0
  266. package/es/nextTick/index.js +3 -0
  267. package/es/recorder/demo.d.ts +2 -0
  268. package/es/recorder/demo.js +200 -0
  269. package/es/recorder/index.d.ts +294 -0
  270. package/es/recorder/index.js +991 -0
  271. package/es/submidstr/index.d.ts +5 -0
  272. package/es/submidstr/index.js +14 -0
  273. package/es/treeHelper/index.d.ts +11 -0
  274. package/es/treeHelper/index.js +189 -0
  275. package/es/typings.d.ts +2 -0
  276. package/es/useDrawROI/index.d.ts +16 -0
  277. package/es/useDrawROI/index.js +318 -0
  278. package/es/useEventEmitterHandle/index.d.ts +2 -0
  279. package/es/useEventEmitterHandle/index.js +17 -0
  280. package/es/useHistory/index.d.ts +3 -0
  281. package/es/useHistory/index.js +9 -0
  282. package/es/useHistory/interface.d.ts +3 -0
  283. package/es/useInfiniteScroll/index.d.ts +16 -0
  284. package/es/useInfiniteScroll/index.js +102 -0
  285. package/es/useRafInterval/index.d.ts +5 -0
  286. package/es/useRafInterval/index.js +70 -0
  287. package/es/useSimpleState/index.d.ts +3 -0
  288. package/es/useSimpleState/index.js +35 -0
  289. package/es/useVirtualList/index.d.ts +13 -0
  290. package/es/useVirtualList/index.js +136 -0
  291. package/es/utils.d.ts +14 -0
  292. package/es/utils.js +46 -0
  293. package/es/uuid/index.d.ts +5 -0
  294. package/es/uuid/index.js +6 -0
  295. package/package.json +16 -21
  296. package/release-build.sh +2 -0
  297. package/scripts/{entry.js → entry.mjs} +4 -6
  298. package/{icon-fix.js → scripts/icon-fix.mjs} +4 -3
  299. package/tsconfig.json +1 -1
@@ -0,0 +1,179 @@
1
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
2
+ 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; }
3
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
4
+ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
5
+ function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var methodName = context.method, method = delegate.iterator[methodName]; if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel; var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) keys.push(key); return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, catch: function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
6
+ function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
7
+ function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
8
+ 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); }
9
+ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
10
+ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
11
+ 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; }
12
+ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
13
+ function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
14
+ function _asyncIterator(iterable) { var method, async, sync, retry = 2; for ("undefined" != typeof Symbol && (async = Symbol.asyncIterator, sync = Symbol.iterator); retry--;) { if (async && null != (method = iterable[async])) return method.call(iterable); if (sync && null != (method = iterable[sync])) return new AsyncFromSyncIterator(method.call(iterable)); async = "@@asyncIterator", sync = "@@iterator"; } throw new TypeError("Object is not async iterable"); }
15
+ function AsyncFromSyncIterator(s) { function AsyncFromSyncIteratorContinuation(r) { if (Object(r) !== r) return Promise.reject(new TypeError(r + " is not an object.")); var done = r.done; return Promise.resolve(r.value).then(function (value) { return { value: value, done: done }; }); } return AsyncFromSyncIterator = function AsyncFromSyncIterator(s) { this.s = s, this.n = s.next; }, AsyncFromSyncIterator.prototype = { s: null, n: null, next: function next() { return AsyncFromSyncIteratorContinuation(this.n.apply(this.s, arguments)); }, return: function _return(value) { var ret = this.s.return; return void 0 === ret ? Promise.resolve({ value: value, done: !0 }) : AsyncFromSyncIteratorContinuation(ret.apply(this.s, arguments)); }, throw: function _throw(value) { var thr = this.s.return; return void 0 === thr ? Promise.reject(value) : AsyncFromSyncIteratorContinuation(thr.apply(this.s, arguments)); } }, new AsyncFromSyncIterator(s); }
16
+ import nextTick from "../nextTick";
17
+ import { likeGo } from "../utils";
18
+ var global = window;
19
+ if (!global._LOADER_SCRIPT_URL) {
20
+ global._LOADER_SCRIPT_URL = {};
21
+ }
22
+ export var loadScript = function loadScript(url) {
23
+ return new Promise(function (resolve, reject) {
24
+ if (global._LOADER_SCRIPT_URL[url]) {
25
+ resolve(null);
26
+ }
27
+ var script = document.createElement('script');
28
+ script.crossOrigin = 'anonymous';
29
+ script.type = 'text/javascript';
30
+ script.onload = function () {
31
+ global._LOADER_SCRIPT_URL[url] = true;
32
+ resolve(null);
33
+ };
34
+ script.onerror = function (err) {
35
+ reject(err);
36
+ };
37
+ script.src = url;
38
+ document.head.appendChild(script);
39
+ });
40
+ };
41
+ export var loaderCss = function loaderCss(href) {
42
+ return new Promise(function (resolve, reject) {
43
+ if (global._LOADER_SCRIPT_URL[href]) {
44
+ resolve(null);
45
+ }
46
+ var link = document.createElement('link');
47
+ link.rel = 'stylesheet';
48
+ link.href = href;
49
+ link.onload = function () {
50
+ global._LOADER_SCRIPT_URL[href] = true;
51
+ resolve(null);
52
+ };
53
+ link.onerror = function (err) {
54
+ reject(err);
55
+ };
56
+ document.head.appendChild(link);
57
+ });
58
+ };
59
+ export function createAsyncIterable(options) {
60
+ return _defineProperty({}, Symbol.asyncIterator, function () {
61
+ return {
62
+ i: 0,
63
+ next: function next() {
64
+ var _this = this;
65
+ return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
66
+ var param, arr;
67
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
68
+ while (1) switch (_context.prev = _context.next) {
69
+ case 0:
70
+ if (!(_this.i < options.length)) {
71
+ _context.next = 12;
72
+ break;
73
+ }
74
+ param = options[_this.i];
75
+ arr = [];
76
+ if (param.scripts && param.scripts.length > 0) {
77
+ arr.push.apply(arr, _toConsumableArray(param.scripts.map(function (v) {
78
+ return loadScript(v);
79
+ })));
80
+ }
81
+ if (param.styles && param.styles.length > 0) {
82
+ arr.push.apply(arr, _toConsumableArray(param.styles.map(function (v) {
83
+ return loaderCss(v);
84
+ })));
85
+ }
86
+ if (!(arr.length > 0)) {
87
+ _context.next = 11;
88
+ break;
89
+ }
90
+ _context.next = 8;
91
+ return Promise.all(arr);
92
+ case 8:
93
+ return _context.abrupt("return", {
94
+ value: _this.i++,
95
+ done: false
96
+ });
97
+ case 11:
98
+ return _context.abrupt("return", Promise.resolve({
99
+ value: _this.i++,
100
+ done: false
101
+ }));
102
+ case 12:
103
+ return _context.abrupt("return", Promise.resolve({
104
+ value: _this.i,
105
+ done: true
106
+ }));
107
+ case 13:
108
+ case "end":
109
+ return _context.stop();
110
+ }
111
+ }, _callee);
112
+ }))();
113
+ }
114
+ };
115
+ });
116
+ }
117
+ export function runAsyncIterable(Iterables, runtime, callback) {
118
+ likeGo( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
119
+ var _iteratorAbruptCompletion, _didIteratorError, _iteratorError, _iterator, _step, x;
120
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
121
+ while (1) switch (_context2.prev = _context2.next) {
122
+ case 0:
123
+ _iteratorAbruptCompletion = false;
124
+ _didIteratorError = false;
125
+ _context2.prev = 2;
126
+ _iterator = _asyncIterator(Iterables);
127
+ case 4:
128
+ _context2.next = 6;
129
+ return _iterator.next();
130
+ case 6:
131
+ if (!(_iteratorAbruptCompletion = !(_step = _context2.sent).done)) {
132
+ _context2.next = 12;
133
+ break;
134
+ }
135
+ x = _step.value;
136
+ runtime === null || runtime === void 0 ? void 0 : runtime(x);
137
+ case 9:
138
+ _iteratorAbruptCompletion = false;
139
+ _context2.next = 4;
140
+ break;
141
+ case 12:
142
+ _context2.next = 18;
143
+ break;
144
+ case 14:
145
+ _context2.prev = 14;
146
+ _context2.t0 = _context2["catch"](2);
147
+ _didIteratorError = true;
148
+ _iteratorError = _context2.t0;
149
+ case 18:
150
+ _context2.prev = 18;
151
+ _context2.prev = 19;
152
+ if (!(_iteratorAbruptCompletion && _iterator.return != null)) {
153
+ _context2.next = 23;
154
+ break;
155
+ }
156
+ _context2.next = 23;
157
+ return _iterator.return();
158
+ case 23:
159
+ _context2.prev = 23;
160
+ if (!_didIteratorError) {
161
+ _context2.next = 26;
162
+ break;
163
+ }
164
+ throw _iteratorError;
165
+ case 26:
166
+ return _context2.finish(23);
167
+ case 27:
168
+ return _context2.finish(18);
169
+ case 28:
170
+ nextTick(function () {
171
+ return callback === null || callback === void 0 ? void 0 : callback();
172
+ });
173
+ case 29:
174
+ case "end":
175
+ return _context2.stop();
176
+ }
177
+ }, _callee2, null, [[2, 14, 18, 28], [19,, 23, 27]]);
178
+ })));
179
+ }
@@ -0,0 +1,7 @@
1
+ import { RectType } from '../../interface';
2
+ interface IRectInfoProps {
3
+ item: RectType;
4
+ containerDom: HTMLDivElement;
5
+ }
6
+ declare function RectInfo({ item, containerDom }: IRectInfoProps): import("react/jsx-runtime").JSX.Element;
7
+ export default RectInfo;
@@ -0,0 +1,90 @@
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(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
6
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
7
+ import { useMemo } from 'react';
8
+ import IconFont from "../../../IconFont";
9
+ import { jsx as _jsx } from "react/jsx-runtime";
10
+ import { jsxs as _jsxs } from "react/jsx-runtime";
11
+ var RECT_INFO_WIDTH = 150;
12
+ var RECT_INFO_HEIGHT = 24;
13
+ var RECT_WINDOW_MARGIN = 6;
14
+ function RectInfo(_ref) {
15
+ var _item$tags2, _item$tags3;
16
+ var item = _ref.item,
17
+ containerDom = _ref.containerDom;
18
+ var position = useMemo(function () {
19
+ var _item$tags;
20
+ var _containerDom$getBoun = containerDom.getBoundingClientRect(),
21
+ width = _containerDom$getBoun.width,
22
+ height = _containerDom$getBoun.height;
23
+ var _rectInfoWidth$rectIn = {
24
+ rectInfoWidth: RECT_INFO_WIDTH,
25
+ rectInfoHeight: ((_item$tags = item.tags) !== null && _item$tags !== void 0 ? _item$tags : []).length * RECT_INFO_HEIGHT + 6 + 30
26
+ },
27
+ rectInfoWidth = _rectInfoWidth$rectIn.rectInfoWidth,
28
+ rectInfoHeight = _rectInfoWidth$rectIn.rectInfoHeight;
29
+ var _item$rect = _slicedToArray(item.rect, 3),
30
+ rectLeft = _item$rect[0],
31
+ rectTop = _item$rect[1],
32
+ rectWidth = _item$rect[2];
33
+ var x, y;
34
+ if (rectWidth + rectLeft + rectInfoWidth < width) {
35
+ x = rectWidth + rectLeft + RECT_WINDOW_MARGIN;
36
+ } else {
37
+ x = rectLeft - RECT_WINDOW_MARGIN - rectInfoWidth;
38
+ }
39
+ if (rectTop + rectInfoHeight < height) {
40
+ y = rectTop;
41
+ y = y < 0 ? RECT_WINDOW_MARGIN : y;
42
+ } else {
43
+ y = height - rectInfoHeight;
44
+ }
45
+ return {
46
+ x: x,
47
+ y: y,
48
+ width: rectInfoWidth,
49
+ height: rectInfoHeight
50
+ };
51
+ }, [containerDom, item.rect, ((_item$tags2 = item.tags) !== null && _item$tags2 !== void 0 ? _item$tags2 : []).length]);
52
+ return /*#__PURE__*/_jsxs("div", {
53
+ className: "rect-info-list-wrapper",
54
+ style: {
55
+ left: position.x,
56
+ top: position.y,
57
+ width: position.width,
58
+ height: position.height
59
+ },
60
+ children: [/*#__PURE__*/_jsxs("div", {
61
+ className: "data-type",
62
+ children: [item.hasOwnProperty('lowQuality') && /*#__PURE__*/_jsxs("span", {
63
+ className: "data-tag low",
64
+ children: [/*#__PURE__*/_jsx(IconFont, {
65
+ type: 'lm-player_View_Cluster'
66
+ }), item.lowQuality ? '低质量' : '高质量']
67
+ }), item.hasOwnProperty('dupId') && item.dupId && /*#__PURE__*/_jsxs("span", {
68
+ className: "data-tag repeat",
69
+ children: [/*#__PURE__*/_jsx(IconFont, {
70
+ type: 'lm-player_Photo_repeatingdata'
71
+ }), "\u91CD\u590D"]
72
+ })]
73
+ }), /*#__PURE__*/_jsx("ul", {
74
+ className: "rect-info-list",
75
+ children: ((_item$tags3 = item.tags) !== null && _item$tags3 !== void 0 ? _item$tags3 : []).map(function (v, index) {
76
+ return /*#__PURE__*/_jsxs("li", {
77
+ className: "info-item",
78
+ title: v.titleAttr,
79
+ children: [/*#__PURE__*/_jsx(IconFont, {
80
+ type: v.icon
81
+ }), /*#__PURE__*/_jsx("span", {
82
+ className: "item-value",
83
+ children: v.label
84
+ })]
85
+ }, index);
86
+ })
87
+ })]
88
+ });
89
+ }
90
+ export default RectInfo;
@@ -0,0 +1,11 @@
1
+ import { RectType } from '../../interface';
2
+ interface IDefaultRectsProps {
3
+ rects: RectType[];
4
+ containerDom: HTMLDivElement;
5
+ onClickRect?: (item: RectType & {
6
+ base64: string;
7
+ }) => void;
8
+ getRectImage: (rect: number[]) => string | null;
9
+ }
10
+ declare function DefaultRects({ rects, containerDom, onClickRect, getRectImage }: IDefaultRectsProps): import("react/jsx-runtime").JSX.Element;
11
+ export default DefaultRects;
@@ -0,0 +1,58 @@
1
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
2
+ 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; }
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
+ 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(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
6
+ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
7
+ import React, { useCallback, useMemo } from 'react';
8
+ import RectInfo from "./RectInfo";
9
+ import { borderBottomDecorator, borderTopDecorator, rectItem, typeRect } from "./style";
10
+ import { computedZIndex } from "./utils";
11
+ import { jsx as _jsx } from "react/jsx-runtime";
12
+ import { jsxs as _jsxs } from "react/jsx-runtime";
13
+ import { Fragment as _Fragment } from "react/jsx-runtime";
14
+ function DefaultRects(_ref) {
15
+ var rects = _ref.rects,
16
+ containerDom = _ref.containerDom,
17
+ onClickRect = _ref.onClickRect,
18
+ getRectImage = _ref.getRectImage;
19
+ var renderRects = useMemo(function () {
20
+ return computedZIndex(rects);
21
+ }, [rects]);
22
+ var rectClick = useCallback(function (e, item) {
23
+ var _getRectImage;
24
+ e.stopPropagation();
25
+ onClickRect === null || onClickRect === void 0 ? void 0 : onClickRect(_objectSpread(_objectSpread({}, item), {}, {
26
+ base64: (_getRectImage = getRectImage(item.rect)) !== null && _getRectImage !== void 0 ? _getRectImage : ''
27
+ }));
28
+ }, [getRectImage, onClickRect]);
29
+ return /*#__PURE__*/_jsx(_Fragment, {
30
+ children: renderRects.map(function (v, k) {
31
+ return /*#__PURE__*/_jsxs("div", {
32
+ className: typeRect[v.type],
33
+ children: [/*#__PURE__*/_jsxs("div", {
34
+ className: "rect-item ".concat(rectItem),
35
+ onClick: function onClick(e) {
36
+ return rectClick(e, v);
37
+ },
38
+ style: {
39
+ left: v.rect[0],
40
+ top: v.rect[1],
41
+ width: v.rect[2],
42
+ height: v.rect[3],
43
+ zIndex: k
44
+ },
45
+ children: [/*#__PURE__*/_jsx("div", {
46
+ className: "border-top-decorator ".concat(borderTopDecorator)
47
+ }), /*#__PURE__*/_jsx("div", {
48
+ className: "border-bottom-decorator ".concat(borderBottomDecorator)
49
+ })]
50
+ }), Array.isArray(v.tags) && v.tags.length > 0 && /*#__PURE__*/_jsx(RectInfo, {
51
+ item: v,
52
+ containerDom: containerDom
53
+ })]
54
+ }, k);
55
+ })
56
+ });
57
+ }
58
+ export default DefaultRects;
@@ -0,0 +1,10 @@
1
+ export declare const rectItem: string;
2
+ export declare const borderTopDecorator: string;
3
+ export declare const borderBottomDecorator: string;
4
+ export declare const typeRect: {
5
+ face: string;
6
+ body: string;
7
+ vehicle: string;
8
+ nonVehicle: string;
9
+ thing: string;
10
+ };
@@ -0,0 +1,28 @@
1
+ var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11, _templateObject12;
2
+ function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
3
+ import { css } from '@emotion/css';
4
+ var borderDecoratorColorMixin = function borderDecoratorColorMixin(color) {
5
+ return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n .border-top-decorator {\n &::before {\n border-top-color: ", ";\n border-left-color: ", ";\n }\n\n &::after {\n border-top-color: ", ";\n border-right-color: ", ";\n }\n }\n\n .border-bottom-decorator {\n &::before {\n border-bottom-color: ", ";\n border-left-color: ", ";\n }\n\n &::after {\n border-bottom-color: ", ";\n border-right-color: ", ";\n }\n }\n "])), color, color, color, color, color, color, color, color);
6
+ };
7
+ var rectItemStyleMixin = function rectItemStyleMixin(color, lightColor, shadowColor) {
8
+ return css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n .rect-item {\n border-color: ", ";\n ", ";\n &:hover {\n border-color: ", ";\n box-shadow: inset 0 0 24px 0 ", ";\n }\n }\n "])), lightColor, borderDecoratorColorMixin(color), color, shadowColor);
9
+ };
10
+ var rectInfoListMixin = function rectInfoListMixin(color, bgColor) {
11
+ return css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n .rect-info-list-wrapper {\n .data-type {\n .data-tag {\n background: ", ";\n border: 1px solid ", ";\n }\n }\n }\n "])), bgColor, color);
12
+ };
13
+ var rectItemWrapperface = css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n ", ";\n ", ";\n"])), rectItemStyleMixin('#ff5f57', 'rgba(255, 95, 87, .6)', 'rgba(255, 95, 87, .4)'), rectInfoListMixin('#FF5F57', 'rgba(255,95,87,.6)'));
14
+ var rectItemWrapperbody = css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n ", ";\n ", ";\n"])), rectItemStyleMixin('#ffbb22', 'rgba(255, 187, 34, .6)', 'rgba(255, 187, 34, .4)'), rectInfoListMixin('#FFBB22', 'rgba(255,187,34,.6)'));
15
+ var rectItemWrappervehicle = css(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n ", ";\n ", ";\n"])), rectItemStyleMixin('#44aaff', 'rgba(68, 170, 255, .6)', 'rgba(68, 170, 255, .4)'), rectInfoListMixin('#44aaff', 'rgba(68,170,255,.6)'));
16
+ var rectItemWrappernonVehicle = css(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n ", ";\n ", ";\n"])), rectItemStyleMixin('#50e9b2', 'rgba(80, 233, 178, .6)', 'rgba(80, 233, 178, .4)'), rectInfoListMixin('#50e9b2', 'rgba(80,233,178,.6)'));
17
+ var rectItemWrapperthing = css(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral(["\n ", ";\n ", ";\n"])), rectItemStyleMixin('#b946d2', 'rgba(185, 70, 210, .6)', 'rgba(185, 70, 210, .4)'), rectInfoListMixin('#b946d2', 'rgba(185, 70, 210, .6)'));
18
+ export var rectItem = css(_templateObject9 || (_templateObject9 = _taggedTemplateLiteral(["\n position: absolute;\n border-width: 1px;\n border-style: solid;\n cursor: pointer;\n"])));
19
+ var borderDecorator = css(_templateObject10 || (_templateObject10 = _taggedTemplateLiteral(["\n position: absolute;\n width: 100%;\n pointer-events: none;\n &::before,\n &::after {\n display: block;\n width: 8px;\n height: 8px;\n border: 2px solid transparent;\n content: '';\n }\n &::before {\n float: left;\n margin-left: -1px;\n }\n &::after {\n float: right;\n margin-right: -1px;\n }\n"])));
20
+ export var borderTopDecorator = css(_templateObject11 || (_templateObject11 = _taggedTemplateLiteral(["\n ", ";\n top: 0;\n &::before,\n &::after {\n margin-top: -1px;\n }\n"])), borderDecorator);
21
+ export var borderBottomDecorator = css(_templateObject12 || (_templateObject12 = _taggedTemplateLiteral(["\n ", ";\n bottom: 0;\n &::before,\n &::after {\n margin-bottom: -1px;\n }\n"])), borderDecorator);
22
+ export var typeRect = {
23
+ face: rectItemWrapperface,
24
+ body: rectItemWrapperbody,
25
+ vehicle: rectItemWrappervehicle,
26
+ nonVehicle: rectItemWrappernonVehicle,
27
+ thing: rectItemWrapperthing
28
+ };
@@ -0,0 +1,2 @@
1
+ import { RectType } from '../../interface';
2
+ export declare function computedZIndex(rects: RectType[]): RectType[];
@@ -0,0 +1,11 @@
1
+ export function computedZIndex(rects) {
2
+ var areas = rects.map(function (v) {
3
+ var width = v.rect[2];
4
+ var height = v.rect[3];
5
+ v.area = width * height;
6
+ return v;
7
+ });
8
+ return areas.sort(function (a, b) {
9
+ return b.area - a.area;
10
+ });
11
+ }
@@ -0,0 +1,11 @@
1
+ import { MenuRectType } from '../../interface';
2
+ interface IDrawRectProps {
3
+ rect: number[];
4
+ canRenderMenu?: boolean;
5
+ containerDom: HTMLDivElement;
6
+ onMenuClick?: (options: MenuRectType) => void;
7
+ menus: MenuRectType[];
8
+ getRectImage: (rect: number[]) => string | null;
9
+ }
10
+ declare function DrawRect({ rect, canRenderMenu, containerDom, onMenuClick, menus, getRectImage }: IDrawRectProps): import("react/jsx-runtime").JSX.Element;
11
+ export default DrawRect;
@@ -0,0 +1,54 @@
1
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
2
+ var _templateObject;
3
+ 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; }
4
+ 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; }
5
+ 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; }
6
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
7
+ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
8
+ function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
9
+ import { css } from '@emotion/css';
10
+ import { useCallback, useMemo } from 'react';
11
+ import RectMenu from "../RectMenu";
12
+ import { jsx as _jsx } from "react/jsx-runtime";
13
+ import { Fragment as _Fragment } from "react/jsx-runtime";
14
+ import { jsxs as _jsxs } from "react/jsx-runtime";
15
+ var cssbox = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n position: absolute;\n border: 1px solid;\n box-shadow: 0 0 0 9999em rgb(0 0 0 / 40%);\n border-image-source: url('data:image/gif;base64,R0lGODlhCgAKAJECAAAAAP///////wAAACH/C05FVFNDQVBFMi4wAwEAAAAh/wtYTVAgRGF0YVhNUDw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMy1jMDExIDY2LjE0NTY2MSwgMjAxMi8wMi8wNi0xNDo1NjoyNyAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6OEI5RDc5MTFDNkE2MTFFM0JCMDZEODI2QTI4MzJBOTIiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6OEI5RDc5MTBDNkE2MTFFM0JCMDZEODI2QTI4MzJBOTIiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNiAoTWFjaW50b3NoKSI+IDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZjppbnN0YW5jZUlEPSJ4bXAuZGlkOjAyODAxMTc0MDcyMDY4MTE4MDgzQzNDMjA5MzREQ0ZDIiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOjAyODAxMTc0MDcyMDY4MTE4MDgzQzNDMjA5MzREQ0ZDIi8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+Af/+/fz7+vn49/b19PPy8fDv7u3s6+rp6Ofm5eTj4uHg397d3Nva2djX1tXU09LR0M/OzczLysnIx8bFxMPCwcC/vr28u7q5uLe2tbSzsrGwr66trKuqqainpqWko6KhoJ+enZybmpmYl5aVlJOSkZCPjo2Mi4qJiIeGhYSDgoGAf359fHt6eXh3dnV0c3JxcG9ubWxramloZ2ZlZGNiYWBfXl1cW1pZWFdWVVRTUlFQT05NTEtKSUhHRkVEQ0JBQD8+PTw7Ojk4NzY1NDMyMTAvLi0sKyopKCcmJSQjIiEgHx4dHBsaGRgXFhUUExIREA8ODQwLCgkIBwYFBAMCAQAAIfkEBQoAAgAsAAAAAAoACgAAAhWEERkn7W3ei7KlagMWF/dKgYeyGAUAIfkEBQoAAgAsAAAAAAoACgAAAg+UYwLJ7RnQm7QmsCyVKhUAIfkEBQoAAgAsAAAAAAoACgAAAhCUYgLJHdiinNSAVfOEKoUCACH5BAUKAAIALAAAAAAKAAoAAAIRVISAdusPo3RAzYtjaMIaUQAAIfkEBQoAAgAsAAAAAAoACgAAAg+MDiem7Q8bSLFaG5il6xQAIfkEBQoAAgAsAAAAAAoACgAAAg+UYRLJ7QnQm7SmsCyVKhUAIfkEBQoAAgAsAAAAAAoACgAAAhCUYBLJDdiinNSEVfOEKoECACH5BAUKAAIALAAAAAAKAAoAAAIRFISBdusPo3RBzYsjaMIaUQAAOw==');\n border-image-repeat: repeat;\n border-image-slice: 1;\n"])));
16
+ function DrawRect(_ref) {
17
+ var _ref$rect = _ref.rect,
18
+ rect = _ref$rect === void 0 ? [] : _ref$rect,
19
+ canRenderMenu = _ref.canRenderMenu,
20
+ containerDom = _ref.containerDom,
21
+ onMenuClick = _ref.onMenuClick,
22
+ menus = _ref.menus,
23
+ getRectImage = _ref.getRectImage;
24
+ var x = useMemo(function () {
25
+ return rect[0] + rect[2];
26
+ }, [rect]);
27
+ var y = useMemo(function () {
28
+ return rect[1] + rect[3];
29
+ }, [rect]);
30
+ var onMenuClickAction = useCallback(function (item) {
31
+ var _getRectImage;
32
+ onMenuClick === null || onMenuClick === void 0 ? void 0 : onMenuClick(_objectSpread(_objectSpread({}, item), {}, {
33
+ base64: (_getRectImage = getRectImage(rect)) !== null && _getRectImage !== void 0 ? _getRectImage : ''
34
+ }));
35
+ }, [getRectImage, onMenuClick, rect]);
36
+ return /*#__PURE__*/_jsxs(_Fragment, {
37
+ children: [/*#__PURE__*/_jsx("div", {
38
+ className: cssbox,
39
+ style: {
40
+ left: rect[0],
41
+ top: rect[1],
42
+ width: rect[2],
43
+ height: rect[3]
44
+ }
45
+ }), canRenderMenu && /*#__PURE__*/_jsx(RectMenu, {
46
+ x: x,
47
+ y: y,
48
+ containerDom: containerDom,
49
+ onMenuClick: onMenuClickAction,
50
+ menus: menus
51
+ })]
52
+ });
53
+ }
54
+ export default DrawRect;
@@ -0,0 +1,10 @@
1
+ import { MenuRectType } from '../../../Picture/interface';
2
+ interface IRectMenuProps {
3
+ x: number;
4
+ y: number;
5
+ menus: MenuRectType[];
6
+ containerDom: HTMLDivElement;
7
+ onMenuClick: (options: MenuRectType) => void;
8
+ }
9
+ declare function RectMenu({ x, y, menus, containerDom, onMenuClick }: IRectMenuProps): import("react/jsx-runtime").JSX.Element;
10
+ export default RectMenu;
@@ -0,0 +1,84 @@
1
+ var _templateObject, _templateObject2;
2
+ function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
3
+ import { css } from '@emotion/css';
4
+ import { useMemoizedFn } from 'ahooks';
5
+ import React, { useEffect, useMemo, useRef } from 'react';
6
+ import IconFont from "../../../IconFont";
7
+ import { computedMenuPosition } from "./utils";
8
+ import { jsx as _jsx } from "react/jsx-runtime";
9
+ import { jsxs as _jsxs } from "react/jsx-runtime";
10
+ var MENU_WIDTH = 110;
11
+ var MENU_HEIGHT = 30;
12
+ var selectRectMenuLayoutCss = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n position: absolute;\n width: 105px;\n overflow: hidden;\n font-size: var(--fs-small);\n"])));
13
+ var menuActionItemCss = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n padding: 4px 10px;\n margin-bottom: 4px;\n color: rgb(0 0 0 / 65%);\n white-space: nowrap;\n background: #fff;\n border-radius: 15px;\n box-shadow: 0 0 2px rgb(0 0 0 / 20%);\n .anticon {\n padding-right: 2px;\n font-size: 16px;\n color: #89b;\n }\n &:hover {\n color: #fff;\n cursor: pointer;\n background: #fa0;\n .anticon {\n color: #fff;\n }\n }\n &:last-child {\n margin-bottom: 0;\n }\n"])));
14
+ function RectMenu(_ref) {
15
+ var x = _ref.x,
16
+ y = _ref.y,
17
+ menus = _ref.menus,
18
+ containerDom = _ref.containerDom,
19
+ onMenuClick = _ref.onMenuClick;
20
+ var _useMemo = useMemo(function () {
21
+ return containerDom.getBoundingClientRect();
22
+ }, [containerDom]),
23
+ width = _useMemo.width,
24
+ height = _useMemo.height;
25
+ var size = useMemo(function () {
26
+ return {
27
+ w: MENU_WIDTH,
28
+ h: MENU_HEIGHT * menus.length
29
+ };
30
+ }, [menus.length]);
31
+ var position = useMemo(function () {
32
+ return computedMenuPosition({
33
+ width: width,
34
+ height: height,
35
+ size: size,
36
+ position: [x, y]
37
+ });
38
+ }, [height, size, width, x, y]);
39
+ var domRef = useRef(null);
40
+ var handleCancelB = useMemoizedFn(function (e) {
41
+ return e.stopPropagation();
42
+ });
43
+
44
+ //防止click事件冒泡到查看器
45
+ useEffect(function () {
46
+ var dom = domRef.current;
47
+ if (dom) {
48
+ dom.addEventListener('mousedown', handleCancelB, false);
49
+ dom.addEventListener('mousemove', handleCancelB, false);
50
+ dom.addEventListener('mouseup', handleCancelB, false);
51
+ }
52
+ return function () {
53
+ if (dom) {
54
+ dom.removeEventListener('mousedown', handleCancelB, false);
55
+ dom.removeEventListener('mousemove', handleCancelB, false);
56
+ dom.removeEventListener('mouseup', handleCancelB, false);
57
+ }
58
+ };
59
+ }, [handleCancelB]);
60
+ var onClickMenu = useMemoizedFn(function (e, item) {
61
+ e.stopPropagation();
62
+ onMenuClick === null || onMenuClick === void 0 ? void 0 : onMenuClick(item);
63
+ });
64
+ return /*#__PURE__*/_jsx("div", {
65
+ className: selectRectMenuLayoutCss,
66
+ style: {
67
+ left: position.x,
68
+ top: position.y
69
+ },
70
+ ref: domRef,
71
+ children: menus.map(function (v) {
72
+ return /*#__PURE__*/_jsxs("div", {
73
+ className: menuActionItemCss,
74
+ onClick: function onClick(e) {
75
+ return onClickMenu(e, v);
76
+ },
77
+ children: [/*#__PURE__*/_jsx(IconFont, {
78
+ type: v.icon
79
+ }), v.title]
80
+ }, v.pathname);
81
+ })
82
+ });
83
+ }
84
+ export default RectMenu;
@@ -0,0 +1,12 @@
1
+ export declare function computedMenuPosition({ width, height, position, size }: {
2
+ width: number;
3
+ height: number;
4
+ position: number[];
5
+ size: {
6
+ w: number;
7
+ h: number;
8
+ };
9
+ }): {
10
+ x: number;
11
+ y: number;
12
+ };
@@ -0,0 +1,19 @@
1
+ export function computedMenuPosition(_ref) {
2
+ var width = _ref.width,
3
+ height = _ref.height,
4
+ position = _ref.position,
5
+ size = _ref.size;
6
+ var x, y;
7
+ x = position[0];
8
+ y = position[1];
9
+ if (width - x < size.w) {
10
+ x = width - size.w;
11
+ }
12
+ if (height - y < size.h) {
13
+ y = height - size.h;
14
+ }
15
+ return {
16
+ x: x,
17
+ y: y
18
+ };
19
+ }