@realsee/dnalogel 2.1.1 → 2.1.2-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (631) hide show
  1. package/README.md +3 -12
  2. package/components/index.js +242 -569
  3. package/dist/index.cjs.js +58 -73
  4. package/dist/index.es.js +7842 -12958
  5. package/dist/index.js +7842 -12958
  6. package/dist/index.umd.js +46 -61
  7. package/docs/assets/highlight.css +3 -3
  8. package/docs/assets/main.js +4 -2
  9. package/docs/assets/search.js +1 -1
  10. package/docs/assets/style.css +462 -619
  11. package/docs/classes/CruisePluginController.html +397 -23
  12. package/docs/classes/Magnifier.html +187 -9
  13. package/docs/classes/ModelRoomLabelController.html +149 -11
  14. package/docs/classes/Object3DHelperController.html +356 -0
  15. package/docs/classes/PaintBrush.html +260 -0
  16. package/docs/classes/PanoTagPluginController.html +940 -0
  17. package/docs/classes/Util.BetterTween.html +134 -0
  18. package/docs/classes/Util.FivePointSelector.html +144 -0
  19. package/docs/classes/Util.Interval.html +158 -0
  20. package/docs/classes/Util.Magnifier.html +196 -0
  21. package/docs/classes/Util.PointDomHelper.html +135 -0
  22. package/docs/classes/Util.PointHelper.html +127 -0
  23. package/docs/classes/Util.Rectangle.html +181 -0
  24. package/docs/enums/CameraMovementEffect.html +70 -3
  25. package/docs/enums/ContentType.html +116 -0
  26. package/docs/enums/DIRECTION.html +81 -1
  27. package/docs/enums/DISPLAY_STRATEGY_TYPE.html +81 -1
  28. package/docs/enums/DimensionType.html +67 -0
  29. package/docs/enums/FLOOR_PLAN_ATTACHED_TO.html +74 -1
  30. package/docs/enums/ITEM_LABEL_PLUGIN_DISPLAY_STRATEGY_TYPE.html +81 -1
  31. package/docs/enums/LinkType.html +67 -0
  32. package/docs/enums/PaintBrushTypeEnum.html +74 -0
  33. package/docs/enums/PointType.html +67 -0
  34. package/docs/enums/Rotation.html +77 -3
  35. package/docs/functions/CSS3DRenderPlugin.html +233 -0
  36. package/docs/functions/CameraMovementPlugin.html +237 -0
  37. package/docs/functions/CruisePlugin.html +233 -0
  38. package/docs/functions/GuideLinePlugin.html +235 -0
  39. package/docs/functions/ItemLabelPlugin.html +235 -0
  40. package/docs/functions/MapviewFloorplanPlugin.html +235 -0
  41. package/docs/functions/ModelChassisCompassPlugin.html +237 -0
  42. package/docs/functions/ModelEntryDoorGuidePlugin.html +237 -0
  43. package/docs/functions/ModelFloorplanPlugin.html +235 -0
  44. package/docs/functions/ModelItemLabelPlugin.html +235 -0
  45. package/docs/functions/ModelRoomLabelPlugin.html +233 -0
  46. package/docs/functions/ModelTVVideoPlugin.html +235 -0
  47. package/docs/functions/ModelViewPlugin.html +237 -0
  48. package/docs/functions/Object3DHelperPlugin.html +233 -0
  49. package/docs/functions/PanoCompassPlugin.html +235 -0
  50. package/docs/functions/PanoCursorRaycasterPlugin.html +238 -0
  51. package/docs/functions/PanoDoorLabelPlugin.html +235 -0
  52. package/docs/functions/PanoFloorplanRadarPlugin.html +235 -0
  53. package/docs/functions/PanoMeasurePlugin.html +235 -0
  54. package/docs/functions/PanoRulerPlugin.html +237 -0
  55. package/docs/functions/PanoRulerProPlugin.html +237 -0
  56. package/docs/functions/PanoSpatialTagPlugin.html +237 -0
  57. package/docs/functions/PanoTagPlugin.html +249 -0
  58. package/docs/functions/TopviewFloorplanPlugin.html +235 -0
  59. package/docs/functions/Util.getCoordsFromClient.html +78 -0
  60. package/docs/functions/Util.getCoordsFromElement.html +78 -0
  61. package/docs/functions/Util.getFrameTime.html +70 -0
  62. package/docs/functions/Util.getIntersectFromRelativePosition.html +78 -0
  63. package/docs/functions/Util.getRaycasterFromFivePointer.html +78 -0
  64. package/docs/functions/Util.isNil.html +79 -0
  65. package/docs/functions/Util.nextFrame.html +73 -0
  66. package/docs/functions/Util.notNil.html +78 -0
  67. package/docs/functions/Util.requestAnimationFrameInterval.html +98 -0
  68. package/docs/functions/Util.tweenProgress.html +84 -0
  69. package/docs/functions/pluginFlag.html +233 -0
  70. package/docs/index.html +222 -9
  71. package/docs/interfaces/CSS3DRenderPluginEventMap.html +205 -0
  72. package/docs/interfaces/CSS3DRenderPluginState.html +85 -0
  73. package/docs/interfaces/CameraMovementPluginExportType.html +111 -17
  74. package/docs/interfaces/ContentTypeMap.html +212 -0
  75. package/docs/interfaces/FloorplanBounding.html +89 -10
  76. package/docs/interfaces/FloorplanData.html +95 -3
  77. package/docs/interfaces/FloorplanEntrance.html +114 -15
  78. package/docs/interfaces/FloorplanExtraObject.html +108 -7
  79. package/docs/interfaces/FloorplanExtraObject3D.html +99 -3
  80. package/docs/interfaces/FloorplanFloorData.html +88 -3
  81. package/docs/interfaces/FloorplanImagePosition.html +74 -3
  82. package/docs/interfaces/FloorplanObserver.html +92 -5
  83. package/docs/interfaces/FloorplanOutlineItem.html +88 -3
  84. package/docs/interfaces/FloorplanPosition.html +74 -3
  85. package/docs/interfaces/FloorplanRoomItem.html +134 -17
  86. package/docs/interfaces/FloorplanRoomLabelItem.html +78 -7
  87. package/docs/interfaces/FloorplanServerBounding.html +89 -10
  88. package/docs/interfaces/FloorplanServerComputedData.html +92 -1
  89. package/docs/interfaces/FloorplanServerData.html +74 -3
  90. package/docs/interfaces/FloorplanServerDoorItem.html +92 -1
  91. package/docs/interfaces/FloorplanServerDoorPosition.html +78 -1
  92. package/docs/interfaces/FloorplanServerEntrance.html +114 -15
  93. package/docs/interfaces/FloorplanServerFloorData.html +88 -3
  94. package/docs/interfaces/FloorplanServerImagePosition.html +74 -3
  95. package/docs/interfaces/FloorplanServerObserver.html +92 -5
  96. package/docs/interfaces/FloorplanServerOutlineItem.html +88 -3
  97. package/docs/interfaces/FloorplanServerPosition.html +74 -3
  98. package/docs/interfaces/FloorplanServerRoomItem.html +145 -20
  99. package/docs/interfaces/FloorplanServerRoomLabelItem.html +78 -7
  100. package/docs/interfaces/ItemLabelPluginData.html +64 -1
  101. package/docs/interfaces/ItemLabelPluginExportReturnsType.html +149 -1
  102. package/docs/interfaces/ItemLabelPluginParametersType.html +85 -1
  103. package/docs/interfaces/LineJson.html +71 -1
  104. package/docs/interfaces/ModelChassisCompassPluginData.html +71 -1
  105. package/docs/interfaces/ModelChassisCompassPluginExportType.html +107 -1
  106. package/docs/interfaces/ModelChassisCompassPluginParameterType.html +71 -1
  107. package/docs/interfaces/ModelEntryDoorGuidePluginData.html +78 -1
  108. package/docs/interfaces/ModelEntryDoorGuidePluginExportType.html +115 -1
  109. package/docs/interfaces/ModelItemLabelPluginData.html +64 -1
  110. package/docs/interfaces/ModelItemLabelPluginExportReturnsType.html +149 -1
  111. package/docs/interfaces/ModelItemLabelPluginParametersType.html +71 -1
  112. package/docs/interfaces/ModelRoomLabelPluginData.html +64 -1
  113. package/docs/interfaces/ModelTVVideoPluginData.html +85 -1
  114. package/docs/interfaces/ModelTVVideoPluginExportType.html +109 -1
  115. package/docs/interfaces/ModelTVVideoPluginParameterType.html +64 -1
  116. package/docs/interfaces/ModelViewPluginExportType.html +129 -1
  117. package/docs/interfaces/Object3DHelperState.html +78 -0
  118. package/docs/interfaces/OpenParameter.html +74 -3
  119. package/docs/interfaces/PaintBrushAction.html +118 -0
  120. package/docs/interfaces/PaintBrushConfigs.html +122 -0
  121. package/docs/interfaces/PaintBrushState.html +99 -0
  122. package/docs/interfaces/PanoCursorRaycasterPluginExportType.html +186 -11
  123. package/docs/interfaces/PanoCursorRaycasterPluginParameterType.html +227 -1
  124. package/docs/interfaces/PanoMeasureParameterType.html +128 -5
  125. package/docs/interfaces/PanoRulerPluginExportType.html +138 -1
  126. package/docs/interfaces/PanoRulerPluginOptions.html +87 -1
  127. package/docs/interfaces/PanoRulerPluginParameterType.html +78 -1
  128. package/docs/interfaces/PanoRulerProPluginExportType.html +114 -1
  129. package/docs/interfaces/PanoRulerProPluginOptions.html +84 -1
  130. package/docs/interfaces/PanoRulerProPluginParameterType.html +71 -1
  131. package/docs/interfaces/PanoRulerProPluginState.html +78 -1
  132. package/docs/interfaces/PanoSpatialTagPluginContentEvent.html +241 -1
  133. package/docs/interfaces/PanoSpatialTagPluginContentReplacement.html +230 -1
  134. package/docs/interfaces/PanoSpatialTagPluginData.html +114 -1
  135. package/docs/interfaces/PanoSpatialTagPluginDataElement.html +96 -1
  136. package/docs/interfaces/PanoSpatialTagPluginExportType.html +192 -1
  137. package/docs/interfaces/PanoSpatialTagPluginOriginElement.html +92 -1
  138. package/docs/interfaces/PanoSpatialTagPluginParameterType.html +113 -1
  139. package/docs/interfaces/PanoSpatialTagPluginPointElement.html +99 -1
  140. package/docs/interfaces/PanoSpatialTagPluginTagElement.html +92 -1
  141. package/docs/interfaces/Point.html +78 -1
  142. package/docs/interfaces/PointJson.html +78 -1
  143. package/docs/interfaces/Room.html +85 -1
  144. package/docs/interfaces/RoomInfo.html +71 -1
  145. package/docs/interfaces/RoomLabel.html +141 -13
  146. package/docs/interfaces/RoomRules.html +230 -1
  147. package/docs/interfaces/Rooms.html +230 -1
  148. package/docs/interfaces/Scissor.html +100 -0
  149. package/docs/interfaces/TagConfig.html +120 -0
  150. package/docs/interfaces/Tags.html +89 -0
  151. package/docs/interfaces/Util.MagnifierParameter.html +116 -0
  152. package/docs/interfaces/Util.MouseGroupParameter.html +79 -0
  153. package/docs/modules/Util.html +91 -0
  154. package/docs/modules.html +425 -36
  155. package/docs/types/ArrayPosition.html +224 -0
  156. package/docs/types/CSS3DRenderExportType.html +224 -0
  157. package/docs/types/CSS3DRenderPluginExportType.html +224 -0
  158. package/docs/types/CSS3DRenderPluginParameterType.html +224 -0
  159. package/docs/types/Color.html +224 -0
  160. package/docs/types/ContentTypeConfigKey.html +224 -0
  161. package/docs/types/ContentTypeConfigKeyArray.html +224 -0
  162. package/docs/types/Create3DDomContainerReturnType.html +224 -0
  163. package/docs/types/Create3DElementReturnType.html +224 -0
  164. package/docs/types/CruisePluginExportType.html +224 -0
  165. package/docs/types/Direction-1.html +224 -0
  166. package/docs/types/Direction4.html +224 -0
  167. package/docs/types/FloorplanRuleLabels.html +226 -0
  168. package/docs/types/FloorplanServerRuleLabels.html +224 -0
  169. package/docs/types/GuideLinePluginExportType.html +224 -0
  170. package/docs/types/HelperEventMap.html +314 -0
  171. package/docs/types/MapviewFloorplanPluginParameterType.html +224 -0
  172. package/docs/types/MapviewFloorplanPluginReturnType.html +224 -0
  173. package/docs/types/MediaData.html +224 -0
  174. package/docs/types/ModelEntryDoorGuidePluginParameterType.html +224 -0
  175. package/docs/types/ModelFloorplanPluginParameterType.html +224 -0
  176. package/docs/types/ModelFloorplanPluginReturnType.html +224 -0
  177. package/docs/types/ModelRoomLabelPluginParameters.html +224 -0
  178. package/docs/types/ModelRoomLabelPluginReturnType.html +224 -0
  179. package/docs/types/MoveArgs.html +226 -0
  180. package/docs/types/MoveOpts.html +226 -0
  181. package/docs/types/Object3DHelperEventMap.html +317 -0
  182. package/docs/types/ObjectFit.html +224 -0
  183. package/docs/types/PaintBrushEventMap.html +255 -0
  184. package/docs/types/PanoCompassPluginData.html +224 -0
  185. package/docs/types/PanoCompassPluginExportType.html +224 -0
  186. package/docs/types/PanoCompassPluginParameterType.html +224 -0
  187. package/docs/types/PanoFloorplanRadarPluginParameterType.html +224 -0
  188. package/docs/types/PanoFloorplanRadarPluginReturnType.html +224 -0
  189. package/docs/types/PanoMeasurePluginEvent.html +224 -0
  190. package/docs/types/PanoMeasureReturnType.html +224 -0
  191. package/docs/types/PanoSpatialTagPluginId.html +224 -0
  192. package/docs/types/PanoTagPluginExportInterface.html +224 -0
  193. package/docs/types/PanoTagPluginParamsInterface.html +224 -0
  194. package/docs/types/PlaneTag.html +233 -0
  195. package/docs/types/PointTag.html +235 -0
  196. package/docs/types/Position.html +224 -0
  197. package/docs/types/RotateArgs.html +226 -0
  198. package/docs/types/RotateOpts.html +226 -0
  199. package/docs/types/RuleLabelsKey.html +224 -0
  200. package/docs/types/RuleLabelsValue.html +224 -0
  201. package/docs/types/Tag.html +235 -0
  202. package/docs/types/Tag2D.html +233 -0
  203. package/docs/types/Tag3D.html +233 -0
  204. package/docs/types/TagId.html +224 -0
  205. package/docs/types/TopviewFloorplanPluginParameterType.html +224 -0
  206. package/docs/types/TopviewFloorplanPluginReturnType.html +224 -0
  207. package/docs/variables/FLOOR_TYPE_MAP.html +226 -0
  208. package/docs/variables/PLUGIN.html +224 -0
  209. package/docs/variables/ROOM_FETILE_TYPE_MAP.html +226 -0
  210. package/docs/variables/ROOM_TYPE_MAP.html +226 -0
  211. package/docs/variables/VERSION.html +224 -0
  212. package/docs/variables/itemLabelPluginServerParams.html +231 -0
  213. package/docs/variables/modelItemLabelPluginServerParams.html +231 -0
  214. package/docs/variables/modelRoomLabelPluginServerParams.html +231 -0
  215. package/libs/CSS3DRenderPlugin/CSS3DRender.d.ts +2 -2
  216. package/libs/CSS3DRenderPlugin/CSS3DRender.js +1 -300
  217. package/libs/CSS3DRenderPlugin/Controller.d.ts +3 -3
  218. package/libs/CSS3DRenderPlugin/Controller.js +1 -81
  219. package/libs/CSS3DRenderPlugin/index.js +1 -14
  220. package/libs/CSS3DRenderPlugin/typing.js +1 -1
  221. package/libs/CSS3DRenderPlugin/utils/CSS3DObjectPlus.js +1 -67
  222. package/libs/CSS3DRenderPlugin/utils/centerPoint.js +1 -10
  223. package/libs/CSS3DRenderPlugin/utils/evenNumber.js +1 -7
  224. package/libs/CSS3DRenderPlugin/utils/index.js +1 -13
  225. package/libs/CSS3DRenderPlugin/utils/positionToVector3.js +1 -7
  226. package/libs/CSS3DRenderPlugin/utils/random.js +1 -6
  227. package/libs/CameraMovementPlugin/CameraMovementPlugin.js +1 -71
  228. package/libs/CameraMovementPlugin/index.js +1 -15
  229. package/libs/CameraMovementPlugin/typing.js +1 -5
  230. package/libs/CruisePlugin/Controller.js +1 -440
  231. package/libs/CruisePlugin/index.js +1 -27
  232. package/libs/CruisePlugin/utils/coordinatesAngle.js +1 -9
  233. package/libs/CruisePlugin/utils/coordinatesToVector.js +1 -12
  234. package/libs/CruisePlugin/utils/formatRad.js +1 -7
  235. package/libs/CruisePlugin/utils/linerValue.js +1 -7
  236. package/libs/CruisePlugin/utils/safeCall.js +1 -12
  237. package/libs/CruisePlugin/utils/sleep.js +1 -10
  238. package/libs/CruisePlugin/utils/vectorToCoordinates.js +1 -10
  239. package/libs/GuideLinePlugin/Controller.js +1 -112
  240. package/libs/GuideLinePlugin/index.js +1 -15
  241. package/libs/GuideLinePlugin/utils/getArrowMaterial.js +1 -13
  242. package/libs/GuideLinePlugin/utils/getLineGeometries.js +1 -118
  243. package/libs/GuideLinePlugin/utils/polyline-normals.d.ts +3 -0
  244. package/libs/ItemLabelPlugin/ItemLabelComponent.js +1 -254
  245. package/libs/ItemLabelPlugin/ItemLabelItem.js +2 -133
  246. package/libs/ItemLabelPlugin/Plugin.js +2 -85
  247. package/libs/ItemLabelPlugin/index.js +1 -25
  248. package/libs/ItemLabelPlugin/typings.js +1 -4
  249. package/libs/ItemLabelPlugin/utils/getLabelTransform.js +1 -4
  250. package/libs/ItemLabelPlugin/utils/getStrokeLength.js +1 -16
  251. package/libs/ItemLabelPlugin/utils/isImpacted.js +1 -10
  252. package/libs/ItemLabelPlugin/utils/parseData.js +1 -10
  253. package/libs/ItemLabelPlugin/utils/transform2RenderData.js +1 -11
  254. package/libs/ModelChassisCompassPlugin/Plugin.js +1 -55
  255. package/libs/ModelChassisCompassPlugin/index.js +1 -10
  256. package/libs/ModelEntryDoorGuidePlugin/Plugin.js +1 -66
  257. package/libs/ModelEntryDoorGuidePlugin/index.js +1 -11
  258. package/libs/ModelItemLabelPlugin/ItemLabelComponent.js +1 -196
  259. package/libs/ModelItemLabelPlugin/ItemLabelItem.js +2 -42
  260. package/libs/ModelItemLabelPlugin/ModelItemLabelPlugin.js +2 -79
  261. package/libs/ModelItemLabelPlugin/events.type.js +1 -1
  262. package/libs/ModelItemLabelPlugin/index.js +1 -21
  263. package/libs/ModelItemLabelPlugin/typings.js +1 -4
  264. package/libs/ModelItemLabelPlugin/utils/parseData.js +1 -9
  265. package/libs/ModelRoomLabelPlugin/Assets/roomLabelBg.js +1 -4
  266. package/libs/ModelRoomLabelPlugin/Controller.js +1 -64
  267. package/libs/ModelRoomLabelPlugin/RoomLabelItem.js +1 -45
  268. package/libs/ModelRoomLabelPlugin/RoomLabelItems.js +1 -151
  269. package/libs/ModelRoomLabelPlugin/index.js +1 -16
  270. package/libs/ModelRoomLabelPlugin/utils/parseData.js +1 -16
  271. package/libs/ModelTVVideoPlugin/Plugin.js +1 -157
  272. package/libs/ModelTVVideoPlugin/index.js +1 -19
  273. package/libs/ModelTVVideoPlugin/typings.js +1 -4
  274. package/libs/ModelTVVideoPlugin/utils/parseData.js +1 -20
  275. package/libs/ModelViewPlugin/Plugin.js +1 -96
  276. package/libs/ModelViewPlugin/index.js +1 -8
  277. package/libs/Object3DHelperPlugin/Controller.d.ts +1 -1
  278. package/libs/Object3DHelperPlugin/Controller.js +1 -137
  279. package/libs/Object3DHelperPlugin/FiveControllerWrapper.d.ts +1 -1
  280. package/libs/Object3DHelperPlugin/FiveControllerWrapper.js +1 -35
  281. package/libs/Object3DHelperPlugin/index.js +1 -42
  282. package/libs/PanoCompassPlugin/Assets/roomInfoIcon.js +1 -4
  283. package/libs/PanoCompassPlugin/Controller.js +1 -205
  284. package/libs/PanoCompassPlugin/getRoomInfoInstance.js +1 -24
  285. package/libs/PanoCompassPlugin/index.js +1 -24
  286. package/libs/PanoCursorRaycasterPlugin/index.js +1 -60
  287. package/libs/PanoDoorLabelPlugin/BaseController.js +1 -50
  288. package/libs/PanoDoorLabelPlugin/Controller.js +1 -215
  289. package/libs/PanoDoorLabelPlugin/DoorLabelItem.js +1 -65
  290. package/libs/PanoDoorLabelPlugin/index.d.ts +1 -1
  291. package/libs/PanoDoorLabelPlugin/index.js +1 -15
  292. package/libs/PanoDoorLabelPlugin/utils.d.ts +2 -2
  293. package/libs/PanoDoorLabelPlugin/utils.js +1 -23
  294. package/libs/PanoMeasurePlugin/Controller/BaseController.js +1 -63
  295. package/libs/PanoMeasurePlugin/Controller/EditController.js +1 -114
  296. package/libs/PanoMeasurePlugin/Controller/MixedController.js +1 -138
  297. package/libs/PanoMeasurePlugin/Controller/ShortcutKeyController.js +1 -33
  298. package/libs/PanoMeasurePlugin/Controller/ViewController.js +1 -101
  299. package/libs/PanoMeasurePlugin/Controller/WatchController.js +1 -169
  300. package/libs/PanoMeasurePlugin/Controller/index.d.ts +1 -1
  301. package/libs/PanoMeasurePlugin/Controller/index.js +1 -167
  302. package/libs/PanoMeasurePlugin/Model/index.d.ts +4 -4
  303. package/libs/PanoMeasurePlugin/Model/index.js +1 -99
  304. package/libs/PanoMeasurePlugin/Model/line.d.ts +1 -1
  305. package/libs/PanoMeasurePlugin/Model/line.js +1 -60
  306. package/libs/PanoMeasurePlugin/Model/point.js +1 -30
  307. package/libs/PanoMeasurePlugin/Model/polyline.d.ts +2 -2
  308. package/libs/PanoMeasurePlugin/Model/polyline.js +1 -47
  309. package/libs/PanoMeasurePlugin/Modules/DeleteDom/_Assets/delete.svg.js +2 -5
  310. package/libs/PanoMeasurePlugin/Modules/DeleteDom/_Assets/delete_bg.png.js +1 -4
  311. package/libs/PanoMeasurePlugin/Modules/DeleteDom/_Assets/delete_hover_bg.png.js +1 -4
  312. package/libs/PanoMeasurePlugin/Modules/DeleteDom/index.js +3 -67
  313. package/libs/PanoMeasurePlugin/Modules/FiveHelper.js +1 -28
  314. package/libs/PanoMeasurePlugin/Modules/GuideController.js +1 -41
  315. package/libs/PanoMeasurePlugin/Modules/Magnifier.js +1 -103
  316. package/libs/PanoMeasurePlugin/Modules/UIController/HTML.js +8 -12
  317. package/libs/PanoMeasurePlugin/Modules/UIController/MainBtnController.js +1 -50
  318. package/libs/PanoMeasurePlugin/Modules/UIController/Revoke/index.js +1 -36
  319. package/libs/PanoMeasurePlugin/Modules/UIController/index.js +1 -48
  320. package/libs/PanoMeasurePlugin/Modules/UIController/mobileHTML.js +3 -8
  321. package/libs/PanoMeasurePlugin/Modules/UIController/mobileMainBtnController.js +1 -39
  322. package/libs/PanoMeasurePlugin/Modules/UIController/style.js +1 -70
  323. package/libs/PanoMeasurePlugin/Modules/rangePiece/html.js +2 -7
  324. package/libs/PanoMeasurePlugin/Modules/rangePiece/index.js +1 -123
  325. package/libs/PanoMeasurePlugin/index.js +1 -60
  326. package/libs/PanoMeasurePlugin/utils/calculateThreeMouse.js +1 -12
  327. package/libs/PanoMeasurePlugin/utils/constants.js +1 -23
  328. package/libs/PanoMeasurePlugin/utils/distanceDom.js +1 -62
  329. package/libs/PanoMeasurePlugin/utils/findAssociatedLines.js +1 -13
  330. package/libs/PanoMeasurePlugin/utils/findClosestPoint.d.ts +1 -1
  331. package/libs/PanoMeasurePlugin/utils/findClosestPoint.js +1 -16
  332. package/libs/PanoMeasurePlugin/utils/getIntersectionFromEvent.js +1 -9
  333. package/libs/PanoMeasurePlugin/utils/getPointFromHammerEvent.js +1 -8
  334. package/libs/PanoMeasurePlugin/utils/ironbox.js +1 -4
  335. package/libs/PanoMeasurePlugin/utils/isNDCPointInScreen.js +1 -7
  336. package/libs/PanoMeasurePlugin/utils/line.js +1 -18
  337. package/libs/PanoMeasurePlugin/utils/math.js +1 -13
  338. package/libs/PanoMeasurePlugin/utils/mouseGroup.js +3 -33
  339. package/libs/PanoMeasurePlugin/utils/ndc2Screen.js +1 -8
  340. package/libs/PanoRulerPlugin/Plugin.js +3 -241
  341. package/libs/PanoRulerPlugin/index.js +1 -11
  342. package/libs/PanoRulerPlugin/style.js +2 -5
  343. package/libs/PanoRulerProPlugin/Controller.js +1 -74
  344. package/libs/PanoRulerProPlugin/RulerItem.js +1 -118
  345. package/libs/PanoRulerProPlugin/RulerItems.js +1 -181
  346. package/libs/PanoRulerProPlugin/index.js +1 -17
  347. package/libs/PanoSpatialTagPlugin/Components/origins.js +1 -82
  348. package/libs/PanoSpatialTagPlugin/Components/tag.js +1 -124
  349. package/libs/PanoSpatialTagPlugin/Plugin.js +1 -258
  350. package/libs/PanoSpatialTagPlugin/index.js +1 -24
  351. package/libs/PanoSpatialTagPlugin/store.d.ts +1 -1
  352. package/libs/PanoSpatialTagPlugin/store.js +1 -6
  353. package/libs/PanoSpatialTagPlugin/style.js +1 -11
  354. package/libs/PanoSpatialTagPlugin/typings.js +1 -1
  355. package/libs/PanoTagPlugin/Assets/Icon.js +1 -6
  356. package/libs/PanoTagPlugin/Components/Common/Arrow.js +1 -103
  357. package/libs/PanoTagPlugin/Components/Common/Audio.js +1 -163
  358. package/libs/PanoTagPlugin/Components/Common/Line/Polyline.js +1 -93
  359. package/libs/PanoTagPlugin/Components/Common/Line/Straight.js +1 -91
  360. package/libs/PanoTagPlugin/Components/Common/Media.js +1 -3438
  361. package/libs/PanoTagPlugin/Components/Common/MediaItem.js +1 -139
  362. package/libs/PanoTagPlugin/Components/Common/MultiLineText.js +1 -181
  363. package/libs/PanoTagPlugin/Components/Common/Point/CustomPoint.js +1 -52
  364. package/libs/PanoTagPlugin/Components/Common/Point/DefaultPoint.js +1 -52
  365. package/libs/PanoTagPlugin/Components/Common/Point/PointSwitch.js +1 -170
  366. package/libs/PanoTagPlugin/Components/Common/Shadow.js +15 -125
  367. package/libs/PanoTagPlugin/Components/Common/Text.js +1 -984
  368. package/libs/PanoTagPlugin/Components/Tag/AudioTag.js +1 -140
  369. package/libs/PanoTagPlugin/Components/Tag/CustomTag.js +1 -72
  370. package/libs/PanoTagPlugin/Components/Tag/ImageTextTag.js +1 -202
  371. package/libs/PanoTagPlugin/Components/Tag/LinkTag.js +1 -128
  372. package/libs/PanoTagPlugin/Components/Tag/MarketingTag.js +1 -231
  373. package/libs/PanoTagPlugin/Components/Tag/MediaPlane.js +1 -95
  374. package/libs/PanoTagPlugin/Components/Tag/TextTag.js +1 -134
  375. package/libs/PanoTagPlugin/Components/Tag/index.js +2 -308
  376. package/libs/PanoTagPlugin/Components/TagContainer.js +1 -187
  377. package/libs/PanoTagPlugin/Components/TagWrapper.js +1 -183
  378. package/libs/PanoTagPlugin/controller/TagCacheController.js +1 -32
  379. package/libs/PanoTagPlugin/controller/TagComputer.d.ts +5 -5
  380. package/libs/PanoTagPlugin/controller/TagComputer.js +1 -15
  381. package/libs/PanoTagPlugin/controller/index.js +1 -386
  382. package/libs/PanoTagPlugin/index.js +1 -71
  383. package/libs/PanoTagPlugin/tag.config.js +1 -44
  384. package/libs/PanoTagPlugin/typings/controller.js +1 -1
  385. package/libs/PanoTagPlugin/typings/index.js +1 -7
  386. package/libs/PanoTagPlugin/typings/tag.js +1 -7
  387. package/libs/PanoTagPlugin/utils/actionAfterFiveModelLoad.js +1 -6
  388. package/libs/PanoTagPlugin/utils/addDebugPoints.js +1 -27
  389. package/libs/PanoTagPlugin/utils/checkRange.d.ts +1 -1
  390. package/libs/PanoTagPlugin/utils/checkRange.js +1 -10
  391. package/libs/PanoTagPlugin/utils/constants.js +1 -8
  392. package/libs/PanoTagPlugin/utils/debounce.js +1 -12
  393. package/libs/PanoTagPlugin/utils/doUtil.js +1 -12
  394. package/libs/PanoTagPlugin/utils/index.js +1 -36
  395. package/libs/PanoTagPlugin/utils/noTypecheck.js +1 -4
  396. package/libs/PanoTagPlugin/utils/normalPositionToPositions.js +1 -13
  397. package/libs/PanoTagPlugin/utils/planeNormal.js +1 -11
  398. package/libs/PanoTagPlugin/utils/resizeObserver.js +1 -17
  399. package/libs/PanoTagPlugin/utils/search.js +1 -33
  400. package/libs/PanoTagPlugin/utils/tagPosition.js +1 -13
  401. package/libs/PanoTagPlugin/utils/throttle.js +1 -11
  402. package/libs/base/BasePlugin.js +1 -18
  403. package/libs/base/BasePluginWithData.js +1 -7
  404. package/libs/components/PaintBrush/Controller.d.ts +2 -2
  405. package/libs/components/PaintBrush/Controller.js +1 -309
  406. package/libs/components/PaintBrush/Subscribe.js +1 -47
  407. package/libs/components/PaintBrush/index.js +1 -52
  408. package/libs/components/PaintBrush/style.js +2 -5
  409. package/libs/components/PaintBrush/tween.js +1 -15
  410. package/libs/components/PaintBrush/typings.js +1 -4
  411. package/libs/components/PaintBrush/utils.d.ts +1 -1
  412. package/libs/components/PaintBrush/utils.js +1 -45
  413. package/libs/components/index.js +1 -13
  414. package/libs/env.d.ts +1 -0
  415. package/libs/floorplan/Assets/camera.js +1 -4
  416. package/libs/floorplan/Assets/compass.js +1 -4
  417. package/libs/floorplan/Assets/floorplanExtraObject.js +1 -4
  418. package/libs/floorplan/Components/BaseImage.js +1 -104
  419. package/libs/floorplan/Components/Camera.js +1 -62
  420. package/libs/floorplan/Components/Compass.js +1 -60
  421. package/libs/floorplan/Components/CurrentFloor.js +1 -255
  422. package/libs/floorplan/Components/Main.js +1 -282
  423. package/libs/floorplan/Components/Normalmage.js +1 -37
  424. package/libs/floorplan/Components/RoomHighlight/Room.js +1 -61
  425. package/libs/floorplan/Components/RoomHighlight/RoomHighlight.js +1 -122
  426. package/libs/floorplan/Components/RoomLabels/RoomLabel.js +1 -152
  427. package/libs/floorplan/Components/RoomLabels/RoomLabels.js +1 -174
  428. package/libs/floorplan/Components/RoomMaterials/RoomMaterial.js +1 -184
  429. package/libs/floorplan/Components/RoomMaterials/RoomMaterial_0.js +1 -37
  430. package/libs/floorplan/Components/RoomMaterials/RoomMaterial_1.js +1 -39
  431. package/libs/floorplan/Components/RoomMaterials/RoomMaterial_2.js +1 -37
  432. package/libs/floorplan/Components/RuleLabels/RuleItem.js +1 -134
  433. package/libs/floorplan/Components/RuleLabels/RuleLabels.js +1 -139
  434. package/libs/floorplan/Components/SvgImage.js +2 -39
  435. package/libs/floorplan/MapviewFloorplanPlugin/Controller.d.ts +1 -1
  436. package/libs/floorplan/MapviewFloorplanPlugin/Controller.js +1 -322
  437. package/libs/floorplan/MapviewFloorplanPlugin/index.js +1 -49
  438. package/libs/floorplan/ModelFloorplanPlugin/Controller.d.ts +1 -1
  439. package/libs/floorplan/ModelFloorplanPlugin/Controller.js +1 -318
  440. package/libs/floorplan/ModelFloorplanPlugin/index.js +1 -49
  441. package/libs/floorplan/PanoFloorplanRadarPlugin/Components/Camera.js +1 -84
  442. package/libs/floorplan/PanoFloorplanRadarPlugin/Components/CurrentFloor/CurrentFloor.js +1 -133
  443. package/libs/floorplan/PanoFloorplanRadarPlugin/Components/CurrentFloor/ExtraObjects.js +1 -72
  444. package/libs/floorplan/PanoFloorplanRadarPlugin/Components/Main.js +1 -191
  445. package/libs/floorplan/PanoFloorplanRadarPlugin/Controller.js +1 -146
  446. package/libs/floorplan/PanoFloorplanRadarPlugin/index.js +1 -26
  447. package/libs/floorplan/TopviewFloorplanPlugin/Controller.d.ts +1 -1
  448. package/libs/floorplan/TopviewFloorplanPlugin/Controller.js +1 -265
  449. package/libs/floorplan/TopviewFloorplanPlugin/index.js +1 -46
  450. package/libs/floorplan/constant.js +1 -4
  451. package/libs/floorplan/index.js +1 -67
  452. package/libs/floorplan/typings/floorplanData.js +1 -1
  453. package/libs/floorplan/typings/floorplanServerData.js +1 -101
  454. package/libs/floorplan/utils/constant.js +1 -8
  455. package/libs/floorplan/utils/correctFiveState.js +1 -36
  456. package/libs/floorplan/utils/formatData.js +1 -82
  457. package/libs/floorplan/utils/formatPosition.js +1 -35
  458. package/libs/index.js +1 -330
  459. package/libs/shared-utils/Object3DHelper/Base/BaseController.js +1 -155
  460. package/libs/shared-utils/Object3DHelper/Base/BaseHelper.js +1 -53
  461. package/libs/shared-utils/Object3DHelper/Constants/color.js +1 -21
  462. package/libs/shared-utils/Object3DHelper/Controller/CSS3DScaleController.js +1 -29
  463. package/libs/shared-utils/Object3DHelper/Controller/MoveController.js +1 -74
  464. package/libs/shared-utils/Object3DHelper/Controller/RectangleScaleController.d.ts +1 -1
  465. package/libs/shared-utils/Object3DHelper/Controller/RectangleScaleController.js +1 -117
  466. package/libs/shared-utils/Object3DHelper/Controller/RotateController.js +1 -142
  467. package/libs/shared-utils/Object3DHelper/Helper/HTML/rectangleScaleDom.js +1 -81
  468. package/libs/shared-utils/Object3DHelper/Helper/HTML/tipsDom.js +1 -31
  469. package/libs/shared-utils/Object3DHelper/Helper/HTML/utils/createElement.js +1 -14
  470. package/libs/shared-utils/Object3DHelper/Helper/MoveHelper.js +1 -31
  471. package/libs/shared-utils/Object3DHelper/Helper/Objects/ArrowGroup.js +1 -35
  472. package/libs/shared-utils/Object3DHelper/Helper/OutlineHelper.js +1 -103
  473. package/libs/shared-utils/Object3DHelper/Helper/RectangleScaleHelper.js +1 -143
  474. package/libs/shared-utils/Object3DHelper/Helper/RotateHelper.js +1 -137
  475. package/libs/shared-utils/Object3DHelper/Helper/index.js +1 -30
  476. package/libs/shared-utils/Object3DHelper/index.js +1 -140
  477. package/libs/shared-utils/Object3DHelper/typings/Direction.js +1 -1
  478. package/libs/shared-utils/Object3DHelper/typings/Hooks.js +1 -1
  479. package/libs/shared-utils/Object3DHelper/typings/Scissor.js +1 -1
  480. package/libs/shared-utils/Object3DHelper/typings/index.js +1 -1
  481. package/libs/shared-utils/Object3DHelper/utils/calculateThreeMouse.js +1 -11
  482. package/libs/shared-utils/Object3DHelper/utils/direction.js +1 -30
  483. package/libs/shared-utils/Object3DHelper/utils/filterNotColinearPoints.js +1 -18
  484. package/libs/shared-utils/Object3DHelper/utils/getMouseRaycaster.d.ts +1 -1
  485. package/libs/shared-utils/Object3DHelper/utils/getMouseRaycaster.js +1 -14
  486. package/libs/shared-utils/Object3DHelper/utils/getPoint.js +1 -18
  487. package/libs/shared-utils/Object3DHelper/utils/index.js +1 -29
  488. package/libs/shared-utils/Object3DHelper/utils/normalPositionToPositions.js +1 -13
  489. package/libs/shared-utils/Object3DHelper/utils/object3DBoundingPosition.js +1 -5
  490. package/libs/shared-utils/Object3DHelper/utils/threex/domevents/index.d.ts +34 -0
  491. package/libs/shared-utils/Object3DHelper/utils/threex/domevents/index.js +1 -191
  492. package/libs/shared-utils/Object3DHelper/utils/vectorIsEqual.js +1 -6
  493. package/libs/shared-utils/Subscribe.js +1 -50
  494. package/libs/shared-utils/animationFrame/BetterTween.js +1 -6
  495. package/libs/shared-utils/animationFrame/calculateProgress.js +1 -12
  496. package/libs/shared-utils/animationFrame/formatRad.js +1 -13
  497. package/libs/shared-utils/animationFrame/index.js +1 -51
  498. package/libs/shared-utils/animationFrame/tween.js +1 -30
  499. package/libs/shared-utils/changeModelCanvasOpacity.js +1 -12
  500. package/libs/shared-utils/createCanvasTextTexture.js +1 -11
  501. package/libs/shared-utils/createLine/index.js +1 -9
  502. package/libs/shared-utils/debounce.js +1 -11
  503. package/libs/shared-utils/equal.js +1 -54
  504. package/libs/shared-utils/filter.js +1 -30
  505. package/libs/shared-utils/five/changeMode.js +1 -21
  506. package/libs/shared-utils/getPxmm.js +1 -21
  507. package/libs/shared-utils/index.js +1 -45
  508. package/libs/shared-utils/isNil.js +1 -10
  509. package/libs/shared-utils/isTruelyObject.js +1 -6
  510. package/libs/shared-utils/math/Interval.js +1 -23
  511. package/libs/shared-utils/math/Rectangle.js +1 -23
  512. package/libs/shared-utils/math/index.js +1 -6
  513. package/libs/shared-utils/math/planimetry.d.ts +5 -5
  514. package/libs/shared-utils/math/planimetry.js +1 -135
  515. package/libs/shared-utils/math/rad2Deg.js +1 -6
  516. package/libs/shared-utils/nearlyEqual.js +1 -6
  517. package/libs/shared-utils/nextFrame.js +1 -6
  518. package/libs/shared-utils/noop.js +1 -5
  519. package/libs/shared-utils/object3d2LocalMatrix.js +1 -19
  520. package/libs/shared-utils/removeArrayItem.d.ts +1 -1
  521. package/libs/shared-utils/removeArrayItem.js +1 -8
  522. package/libs/shared-utils/tap.js +1 -6
  523. package/libs/shared-utils/three/Assets/index.js +1 -5
  524. package/libs/shared-utils/three/FivePointSelector.d.ts +1 -1
  525. package/libs/shared-utils/three/FivePointSelector.js +1 -63
  526. package/libs/shared-utils/three/Magnifier.d.ts +2 -2
  527. package/libs/shared-utils/three/Magnifier.js +1 -104
  528. package/libs/shared-utils/three/PointDomHelper.js +1 -68
  529. package/libs/shared-utils/three/PointHelper.js +3 -60
  530. package/libs/shared-utils/three/getCoords.js +1 -13
  531. package/libs/shared-utils/three/getIntersect.d.ts +1 -1
  532. package/libs/shared-utils/three/getIntersect.js +1 -8
  533. package/libs/shared-utils/three/getRaycaster.d.ts +1 -1
  534. package/libs/shared-utils/three/getRaycaster.js +1 -12
  535. package/libs/shared-utils/three/index.js +1 -33
  536. package/libs/shared-utils/three/loadTexture.js +1 -10
  537. package/libs/shared-utils/three/transformPositionToVector3.js +1 -5
  538. package/libs/shared-utils/three/transfromToMeshBasicMaterial.js +1 -13
  539. package/libs/shared-utils/throttle.js +1 -11
  540. package/libs/shared-utils/tinyEJSrender.js +14 -138
  541. package/libs/shared-utils/to.js +1 -11
  542. package/libs/shared-utils/uuid.js +1 -10
  543. package/libs/vendor/swiper/components-shared/get-changed-params.js +1 -0
  544. package/libs/vendor/swiper/components-shared/get-params.js +1 -0
  545. package/libs/vendor/swiper/components-shared/mount-swiper.js +1 -0
  546. package/libs/vendor/swiper/components-shared/params-list.js +1 -0
  547. package/libs/vendor/swiper/components-shared/update-swiper.js +1 -0
  548. package/libs/vendor/swiper/components-shared/utils.js +1 -0
  549. package/libs/vendor/swiper/svelte/swiper-slide.js +1 -0
  550. package/libs/vendor/swiper/svelte/swiper-svelte.js +1 -0
  551. package/libs/vendor/swiper/svelte/swiper.js +1 -0
  552. package/package.json +218 -31
  553. package/dist/style.css +0 -1
  554. package/docs/assets/icons.css +0 -1043
  555. package/docs/assets/icons.png +0 -0
  556. package/docs/assets/icons@2x.png +0 -0
  557. package/docs/assets/widgets.png +0 -0
  558. package/docs/assets/widgets@2x.png +0 -0
  559. package/docs/interfaces/CSS3DRenderPluginExportType.html +0 -4
  560. package/libs/CruisePlugin/typing.js +0 -1
  561. package/libs/GuideLinePlugin/typing.js +0 -1
  562. package/libs/GuideLinePlugin/utils/getPoint.d.ts +0 -3
  563. package/libs/GuideLinePlugin/utils/getPoint.js +0 -18
  564. package/libs/GuideLinePlugin/utils/polyline-normals.d.js +0 -1
  565. package/libs/ItemLabelPlugin/events.type.js +0 -1
  566. package/libs/ModelRoomLabelPlugin/typings.js +0 -1
  567. package/libs/Object3DHelperPlugin/mocks/addObject3D.d.ts +0 -2
  568. package/libs/Object3DHelperPlugin/mocks/addObject3D.js +0 -1377
  569. package/libs/Object3DHelperPlugin/mocks/objects.d.ts +0 -7
  570. package/libs/Object3DHelperPlugin/mocks/objects.js +0 -47
  571. package/libs/Object3DHelperPlugin/typings.js +0 -1
  572. package/libs/PanoCompassPlugin/typings.js +0 -1
  573. package/libs/PanoDoorLabelPlugin/typings.js +0 -1
  574. package/libs/PanoMeasurePlugin/typings/data.js +0 -1
  575. package/libs/PanoMeasurePlugin/typings/event.type.js +0 -1
  576. package/libs/PanoMeasurePlugin/typings/index.js +0 -1
  577. package/libs/PanoMeasurePlugin/typings/utils.type.d.ts +0 -1
  578. package/libs/PanoMeasurePlugin/typings/utils.type.js +0 -1
  579. package/libs/PanoMeasurePlugin/utils/clearGroup.d.ts +0 -2
  580. package/libs/PanoMeasurePlugin/utils/clearGroup.js +0 -6
  581. package/libs/PanoRulerPlugin/typings.js +0 -1
  582. package/libs/PanoRulerProPlugin/typings.js +0 -1
  583. package/libs/PanoTagPlugin/Components/Common/TextItem.js +0 -106
  584. package/libs/TagComputer.2bc444dc.js +0 -315
  585. package/libs/floorplan/MapviewFloorplanPlugin/typing.js +0 -1
  586. package/libs/floorplan/ModelFloorplanPlugin/typing.js +0 -1
  587. package/libs/floorplan/PanoFloorplanRadarPlugin/typing.js +0 -1
  588. package/libs/floorplan/TopviewFloorplanPlugin/style.d.ts +0 -1
  589. package/libs/floorplan/TopviewFloorplanPlugin/style.js +0 -11
  590. package/libs/floorplan/TopviewFloorplanPlugin/typing.js +0 -1
  591. package/libs/floorplan/typings/index.js +0 -1
  592. package/libs/floorplan/typings/utility.js +0 -1
  593. package/libs/hammer.b5b6115e.js +0 -882
  594. package/libs/index.164f1850.js +0 -641
  595. package/libs/index.5d5d1089.js +0 -34
  596. package/libs/index.6a0eead1.js +0 -12
  597. package/libs/index.ad783a2f.js +0 -31
  598. package/libs/index.dca207cb.js +0 -37
  599. package/libs/index.f2f85d71.js +0 -40
  600. package/libs/shared-utils/Object3DHelper/utils/finiteNumber.d.ts +0 -1
  601. package/libs/shared-utils/Object3DHelper/utils/finiteNumber.js +0 -6
  602. package/libs/shared-utils/Object3DHelper/utils/negateScale.d.ts +0 -2
  603. package/libs/shared-utils/Object3DHelper/utils/negateScale.js +0 -7
  604. package/libs/shared-utils/Object3DHelper/utils/threex/domevents/index.d.js +0 -4
  605. package/libs/shared-utils/Preloader.d.ts +0 -6
  606. package/libs/shared-utils/Preloader.js +0 -18
  607. package/libs/shared-utils/formatRad.d.ts +0 -7
  608. package/libs/shared-utils/formatRad.js +0 -7
  609. package/libs/shared-utils/getRandomColor.d.ts +0 -1
  610. package/libs/shared-utils/getRandomColor.js +0 -6
  611. package/libs/shared-utils/logger.d.ts +0 -16
  612. package/libs/shared-utils/logger.js +0 -27
  613. package/libs/shared-utils/math/evenNumber.d.ts +0 -3
  614. package/libs/shared-utils/math/evenNumber.js +0 -7
  615. package/libs/shared-utils/px2rem.d.ts +0 -1
  616. package/libs/shared-utils/px2rem.js +0 -6
  617. package/libs/shared-utils/three/getExtraModelLoader.d.ts +0 -6
  618. package/libs/shared-utils/three/getExtraModelLoader.js +0 -18
  619. package/libs/shared-utils/three/getNormal.d.ts +0 -2
  620. package/libs/shared-utils/three/getNormal.js +0 -7
  621. package/libs/shared-utils/three/getTextureLoader.d.ts +0 -6
  622. package/libs/shared-utils/three/getTextureLoader.js +0 -16
  623. package/libs/shared-utils/three/loadFbxObj.d.ts +0 -2
  624. package/libs/shared-utils/three/loadFbxObj.js +0 -16
  625. package/libs/shared-utils/vectorTocoordinates.d.ts +0 -7
  626. package/libs/shared-utils/vectorTocoordinates.js +0 -10
  627. package/libs/style.css +0 -1
  628. package/libs/tween.esm.bad2b2b4.js +0 -340
  629. package/libs/typings/math.type.js +0 -1
  630. package/libs/typings/utils.type.d.ts +0 -2
  631. package/libs/typings/utils.type.js +0 -1
@@ -1,12 +1 @@
1
- function s(n, r, a = 20, o = 5) {
2
- return new Promise((c, i) => {
3
- let t = 0;
4
- const l = setInterval(() => {
5
- const e = n();
6
- r(e) ? (clearInterval(l), c(e)) : t >= o && (clearInterval(l), i(e)), t++;
7
- }, a);
8
- });
9
- }
10
- export {
11
- s as default
12
- };
1
+ "use strict";function a(n,r,i=20,c=5){return new Promise((o,s)=>{let t=0;const l=setInterval(()=>{const e=n();r(e)?(clearInterval(l),o(e)):t>=c&&(clearInterval(l),s(e)),t++},i)})}exports.doUtil=a;
@@ -1,36 +1 @@
1
- import { centerPoint as t } from "../../CSS3DRenderPlugin/utils/centerPoint.js";
2
- import { evenNumber as m } from "../../CSS3DRenderPlugin/utils/evenNumber.js";
3
- import { random as n } from "../../CSS3DRenderPlugin/utils/random.js";
4
- import { anyPositionToVector3 as f, arrayPositionToVector3 as x, positionToVector3 as s } from "../../CSS3DRenderPlugin/utils/positionToVector3.js";
5
- import { addDebugPoints as l } from "./addDebugPoints.js";
6
- import { noTypecheck as d } from "./noTypecheck.js";
7
- import { planeNormal as T } from "./planeNormal.js";
8
- import { tagPosition as u } from "./tagPosition.js";
9
- import { checkRange as g } from "./checkRange.js";
10
- import { actionAfterFiveModelLoad as v } from "./actionAfterFiveModelLoad.js";
11
- import { normalPositionToPositions as k } from "./normalPositionToPositions.js";
12
- import { debounce as N } from "./debounce.js";
13
- import { throttle as z } from "./throttle.js";
14
- import { binarySearchFirstBig as B, searchFirstValueSmallThanLastValue as D } from "./search.js";
15
- import { resizeObserver as O } from "./resizeObserver.js";
16
- import "three";
17
- export {
18
- v as actionAfterFiveModelLoad,
19
- l as addDebugPoints,
20
- f as anyPositionToVector3,
21
- x as arrayPositionToVector3,
22
- B as binarySearchFirstBig,
23
- t as centerPoint,
24
- g as checkRange,
25
- N as debounce,
26
- m as evenNumber,
27
- d as noTypecheck,
28
- k as normalPositionToPositions,
29
- T as planeNormal,
30
- s as positionToVector3,
31
- n as random,
32
- O as resizeObserver,
33
- D as searchFirstValueSmallThanLastValue,
34
- u as tagPosition,
35
- z as throttle
36
- };
1
+ "use strict";require("three");
@@ -1,4 +1 @@
1
- const e = (c) => c;
2
- export {
3
- e as noTypecheck
4
- };
1
+ "use strict";const e=c=>c;exports.noTypecheck=e;
@@ -1,13 +1 @@
1
- import * as s from "three";
2
- function d(t, e, a) {
3
- const r = new s.Plane().setFromNormalAndCoplanarPoint(a, e), o = e.clone().sub(t).cross(new s.Vector3(0, 1, 0)).setLength(0.01), n = new s.Vector3(0, 0.01, 0);
4
- return [
5
- e.clone().sub(o).sub(n),
6
- e.clone().add(o).sub(n),
7
- e.clone().add(o).add(n),
8
- e.clone().sub(o).add(n)
9
- ].map((c) => r.projectPoint(c, new s.Vector3()));
10
- }
11
- export {
12
- d as normalPositionToPositions
13
- };
1
+ "use strict";const u=require("three");function i(e){if(e&&e.__esModule)return e;const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const c=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,c.get?c:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const s=i(u);function d(e,t,n){const a=new s.Plane().setFromNormalAndCoplanarPoint(n,t),o=t.clone().sub(e).cross(new s.Vector3(0,1,0)).setLength(.01),r=new s.Vector3(0,.01,0);return[t.clone().sub(o).sub(r),t.clone().add(o).sub(r),t.clone().add(o).add(r),t.clone().sub(o).add(r)].map(l=>a.projectPoint(l,new s.Vector3))}exports.normalPositionToPositions=d;
@@ -1,11 +1 @@
1
- import "three";
2
- import { anyPositionToVector3 as c } from "../../CSS3DRenderPlugin/utils/positionToVector3.js";
3
- function i(t) {
4
- if (t.length < 3)
5
- return;
6
- const o = t.map(c), r = o[1].clone().sub(o[0]), n = o[2].clone().sub(o[1]);
7
- return r.cross(n);
8
- }
9
- export {
10
- i as planeNormal
11
- };
1
+ "use strict";require("three");const r=require("../../CSS3DRenderPlugin/utils/positionToVector3.js");function s(e){if(e.length<3)return;const o=e.map(r.anyPositionToVector3),t=o[1].clone().sub(o[0]),n=o[2].clone().sub(o[1]);return t.cross(n)}exports.planeNormal=s;
@@ -1,17 +1 @@
1
- function o(e, r) {
2
- if (!r || typeof ResizeObserver > "u" || !ResizeObserver)
3
- return {
4
- observe: () => window.addEventListener("resize", e),
5
- unobserve: () => window.removeEventListener("resize", e)
6
- };
7
- {
8
- const s = new ResizeObserver(e);
9
- return {
10
- observe: () => s.observe(r),
11
- unobserve: () => s.unobserve(r)
12
- };
13
- }
14
- }
15
- export {
16
- o as resizeObserver
17
- };
1
+ "use strict";function i(e,r){if(!r||typeof ResizeObserver=="undefined"||!ResizeObserver)return{observe:()=>window.addEventListener("resize",e),unobserve:()=>window.removeEventListener("resize",e)};{const s=new ResizeObserver(e);return{observe:()=>s.observe(r),unobserve:()=>s.unobserve(r)}}}exports.resizeObserver=i;
@@ -1,33 +1 @@
1
- function s(l, o, i) {
2
- const [r, e] = o;
3
- if (r >= e || e <= 1)
4
- return -1;
5
- let u = r, n = e;
6
- const a = {}, c = (t) => (a[t] || (a[t] = l(t)), a[t]);
7
- for (; u <= n; ) {
8
- const t = Math.floor((u + n) / 2);
9
- if (c(t) > i) {
10
- if (t === r || c(t - 1) <= i)
11
- return t;
12
- n = t - 1;
13
- } else
14
- u = t + 1;
15
- }
16
- return -1;
17
- }
18
- function f(l, o) {
19
- const [i, r] = o;
20
- if (i >= r || r <= 1 || i <= 1)
21
- return -1;
22
- const e = {}, u = (n) => (e[n] || (e[n] = l(n)), e[n]);
23
- for (let n = i; n < r; n++) {
24
- const a = u(n), c = u(n - 1);
25
- if (a < c)
26
- return n;
27
- }
28
- return -1;
29
- }
30
- export {
31
- s as binarySearchFirstBig,
32
- f as searchFirstValueSmallThanLastValue
33
- };
1
+ "use strict";function i(u,s){const[a,r]=s;if(a>=r||r<=1||a<=1)return-1;const e={},n=t=>(e[t]||(e[t]=u(t)),e[t]);for(let t=a;t<r;t++){const l=n(t),c=n(t-1);if(l<c)return t}return-1}exports.searchFirstValueSmallThanLastValue=i;
@@ -1,13 +1 @@
1
- import { centerPoint as e } from "../../CSS3DRenderPlugin/utils/centerPoint.js";
2
- import { anyPositionToVector3 as o } from "../../CSS3DRenderPlugin/utils/positionToVector3.js";
3
- import "three";
4
- function a(r) {
5
- if (Array.isArray(r) && r.length === 4) {
6
- const t = r.map(o);
7
- return e(t[0], t[2]);
8
- } else
9
- return o(r);
10
- }
11
- export {
12
- a as tagPosition
13
- };
1
+ "use strict";const r=require("../../CSS3DRenderPlugin/utils/centerPoint.js"),n=require("../../CSS3DRenderPlugin/utils/positionToVector3.js");require("three");function i(e){if(Array.isArray(e)&&e.length===4){const t=e.map(n.anyPositionToVector3);return r.centerPoint(t[0],t[2])}else return n.anyPositionToVector3(e)}exports.tagPosition=i;
@@ -1,11 +1 @@
1
- function i(n, e = 200) {
2
- let t;
3
- return function(...u) {
4
- t || (n.apply(this, u), t = setTimeout(function() {
5
- t = null;
6
- }, e));
7
- };
8
- }
9
- export {
10
- i as throttle
11
- };
1
+ "use strict";function i(n,e=200){let t;return function(...u){t||(n.apply(this,u),t=setTimeout(function(){t=null},e))}}exports.throttle=i;
@@ -1,18 +1 @@
1
- var i = Object.defineProperty;
2
- var a = (e, r, t) => r in e ? i(e, r, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[r] = t;
3
- var s = (e, r, t) => (a(e, typeof r != "symbol" ? r + "" : r, t), t);
4
- import { Subscribe as c } from "../shared-utils/Subscribe.js";
5
- class x {
6
- constructor(r, t) {
7
- s(this, "five");
8
- s(this, "hooks", new c());
9
- s(this, "staticPrefix", "//vrlab-static.ljcdn.com");
10
- this.five = r, t != null && t.staticPrefix && (this.staticPrefix = t.staticPrefix);
11
- }
12
- getCurrentState() {
13
- return this.state;
14
- }
15
- }
16
- export {
17
- x as Controller
18
- };
1
+ "use strict";var i=Object.defineProperty;var a=(r,s,t)=>s in r?i(r,s,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[s]=t;var e=(r,s,t)=>(a(r,typeof s!="symbol"?s+"":s,t),t);const c=require("../shared-utils/Subscribe.js");class l{constructor(s,t){e(this,"five");e(this,"hooks",new c.Subscribe);e(this,"staticPrefix","//vrlab-static.ljcdn.com");this.five=s,t!=null&&t.staticPrefix&&(this.staticPrefix=t.staticPrefix)}getCurrentState(){return this.state}}exports.Controller=l;
@@ -1,7 +1 @@
1
- import { Controller as o } from "./BasePlugin.js";
2
- import "../shared-utils/Subscribe.js";
3
- class e extends o {
4
- }
5
- export {
6
- e as Controller
7
- };
1
+ "use strict";const e=require("./BasePlugin.js");class s extends e.Controller{}exports.Controller=s;
@@ -23,7 +23,7 @@ export declare class Controller extends Subscribe<PaintBrushEventMap> {
23
23
  * @param className 初始化画板
24
24
  * @returns
25
25
  */
26
- initCanvas(className: string): HTMLCanvasElement | undefined;
26
+ initCanvas(className: string): HTMLCanvasElement;
27
27
  /**
28
28
  * 初始化操作面板
29
29
  * @returns
@@ -36,7 +36,7 @@ export declare class Controller extends Subscribe<PaintBrushEventMap> {
36
36
  emitStateChange(action: PaintBrushAction, userAction?: boolean): void;
37
37
  action(action: PaintBrushAction): void;
38
38
  handleDrawLine(_uuid: string, data: PaintBrushState, { withUndo }: {
39
- withUndo?: boolean | undefined;
39
+ withUndo?: boolean;
40
40
  }, callback?: typeof noop): void;
41
41
  handleUndo(uuid: string): void;
42
42
  destroyBrush(): void;
@@ -1,309 +1 @@
1
- var H = Object.defineProperty;
2
- var L = (v, p, t) => p in v ? H(v, p, { enumerable: !0, configurable: !0, writable: !0, value: t }) : v[p] = t;
3
- var f = (v, p, t) => (L(v, typeof p != "symbol" ? p + "" : p, t), t);
4
- import { transformCoords as w, getQuadraticCurvePoint as b, nextFrame as D, execInterval as N, queue as T, unTransformCoords as E, noop as S } from "./utils.js";
5
- import W from "./tween.js";
6
- import { PaintBrushTypeEnum as g } from "./typings.js";
7
- import { Subscribe as U } from "./Subscribe.js";
8
- import k from "../../shared-utils/uuid.js";
9
- import M from "./style.js";
10
- import "../../tween.esm.bad2b2b4.js";
11
- class Y extends U {
12
- constructor(t) {
13
- super();
14
- f(this, "configs");
15
- f(this, "clientWidth");
16
- f(this, "clientHeight");
17
- f(this, "ready", !1);
18
- f(this, "uuid", k());
19
- f(this, "tween");
20
- f(this, "tweening", !1);
21
- f(this, "container");
22
- f(this, "canvas");
23
- f(this, "data", {});
24
- f(this, "tempLine", {});
25
- this.configs = t, this.clientWidth = document.body.clientWidth, this.clientHeight = document.body.clientHeight, this.container = this.ifInsertToDOM(), this.canvas = {}, this.initCtrl();
26
- }
27
- get color() {
28
- return this.configs.currentColor;
29
- }
30
- get state() {
31
- return this.data;
32
- }
33
- get dpr() {
34
- return this.configs.DPR || 1;
35
- }
36
- ifInsertToDOM() {
37
- if (this.container)
38
- return this.container;
39
- if (this.configs.container)
40
- this.configs.container.id = "_gl_paintBrush", this.container = this.configs.container;
41
- else if (document.getElementById("_gl_paintBrush"))
42
- this.container = document.getElementById("_gl_paintBrush");
43
- else {
44
- const t = document.createElement("div");
45
- t.id = "_gl_paintBrush", document.body.appendChild(t), this.container = t;
46
- }
47
- return this.container.innerHTML = M, this.container;
48
- }
49
- initCanvas(t) {
50
- const e = document.createElement("canvas");
51
- e.className = t, e.width = this.clientWidth, e.height = this.clientHeight;
52
- const h = e.getContext("2d");
53
- if (!!h)
54
- return h.lineWidth = 5 * this.dpr, h.lineCap = "round", h.lineJoin = "round", this.container.appendChild(e), e;
55
- }
56
- initCtrl() {
57
- const t = document.createElement("div");
58
- t.className = "_paintBrush-ctrl";
59
- const e = document.createElement("div");
60
- e.className = "_paintBrush-ctrlinner";
61
- const h = document.createElement("a");
62
- h.className = "_paintBrush-ctrlitem _paintBrush-ctrlitem--undo", h.addEventListener("click", (s) => {
63
- var a;
64
- if (s.stopPropagation(), this.configs.onClickUndo && this.configs.onClickUndo(), !this.canvas[this.uuid] || !this.data[this.uuid] || this.data[this.uuid].length === 0)
65
- return;
66
- const c = this.data[this.uuid].pop();
67
- c && this.emitStateChange({
68
- type: g.Undo,
69
- color: this.color,
70
- ready: this.ready,
71
- state: c,
72
- uuid: this.uuid
73
- });
74
- const d = (a = this.canvas[this.uuid]) == null ? void 0 : a.getContext("2d");
75
- if (!this.canvas[this.uuid])
76
- return;
77
- const { width: m, height: o } = this.canvas[this.uuid];
78
- d && d.clearRect(0, 0, m, o), this.data[this.uuid].forEach((n) => this.handleDrawLine(this.uuid, n, { withUndo: !0 }));
79
- });
80
- const i = document.createElement("a");
81
- return i.className = "_paintBrush-ctrlitem _paintBrush-ctrlitem--close", i.addEventListener("click", (s) => {
82
- s.stopPropagation(), this.closeBrush(), this.configs.onClickClose && this.configs.onClickClose();
83
- }), [h, i].forEach((s) => {
84
- const c = document.createElement("i");
85
- c.className = "brush-icon";
86
- const d = document.createElement("span");
87
- d.className = "brush-txt", d.innerText = s.className.endsWith("undo") ? this.configs.onUndoText : this.configs.onExitText, s.appendChild(c), s.appendChild(d);
88
- }), e.appendChild(h), e.appendChild(i), t.appendChild(e), this.container.appendChild(t), t;
89
- }
90
- openBrush() {
91
- if (this.ready)
92
- return;
93
- this.canvas[this.uuid] || (this.canvas[this.uuid] = this.initCanvas("_paintBrush-canvas")), this.container.className = "brushing";
94
- const t = this.canvas[this.uuid];
95
- t.getContext("2d").clearRect(0, 0, t.width, t.height), this.openBrushHandle(), this.ready = !0, this.emit("readyChange", !0);
96
- }
97
- closeBrush() {
98
- !this.ready || (this.container.className = "", this.data = {}, this.tempLine = {}, Object.keys(this.canvas).forEach((t) => {
99
- this.canvas[t].ontouchstart = () => !1, this.canvas[t].ontouchmove = () => !1, this.canvas[t].ontouchend = () => !1, this.canvas[t].ontouchcancel = () => !1;
100
- const e = this.canvas[t].getContext("2d");
101
- e && e.clearRect(0, 0, this.canvas[t].width, this.canvas[t].height);
102
- }), this.ready = !1, this.emit("readyChange", !1), this.emitStateChange({
103
- type: g.Exit,
104
- color: this.color,
105
- ready: !1,
106
- uuid: this.uuid
107
- }));
108
- }
109
- updateCurrentColor(t) {
110
- const e = this.canvas[this.uuid];
111
- if (!e)
112
- return;
113
- const h = e.getContext("2d");
114
- !h || (this.configs.currentColor = t, h.strokeStyle = t);
115
- }
116
- openBrushHandle() {
117
- const t = this.canvas[this.uuid];
118
- if (!t)
119
- return;
120
- const e = t.getContext("2d");
121
- if (!e)
122
- return;
123
- const h = this.color || "#6D92FF";
124
- e.strokeStyle = h;
125
- let i = null, r = [], s, c = [], d = 0;
126
- const m = (o, a, n) => {
127
- const l = this.color || "#ff0000";
128
- e.strokeStyle = l, e.beginPath(), e.moveTo(o.x, o.y), e.quadraticCurveTo(a.x, a.y, n.x, n.y), e.stroke();
129
- };
130
- t.onmousedown = (o) => {
131
- o.preventDefault(), d = Date.now();
132
- const a = o.clientX, n = o.clientY;
133
- r = [], r.push({ x: a, y: n }), i = { x: a, y: n }, s = w({ x: a, y: n }, this.clientWidth, this.clientHeight), c = [];
134
- }, t.onmousemove = (o) => {
135
- if (o.preventDefault(), !i)
136
- return;
137
- const a = Number(o.clientX), n = Number(o.clientY);
138
- if (Math.abs(a - i.x) < 5 && Math.abs(n - i.y) < 5 || (r.push({ x: a, y: n }), c.push(w({ x: a, y: n }, this.clientWidth, this.clientHeight)), r.length < 3))
139
- return;
140
- const { control: l, end: u } = b(r);
141
- !l || !u || (m(i, l, u), i = u);
142
- }, t.onmouseup = (o) => {
143
- if (o.preventDefault(), i = null, r.length < 3)
144
- return;
145
- this.data[this.uuid] || (this.data[this.uuid] = []);
146
- const a = Date.now() - d, n = {
147
- move: Object.assign({}, s),
148
- uuid: this.uuid,
149
- line: [...c],
150
- color: this.color,
151
- duration: a < 1280 ? a : a < 2e3 ? 1280 : 0
152
- };
153
- this.data[this.uuid].push(n), D(() => {
154
- this.emitStateChange({
155
- type: g.Drawline,
156
- color: this.color,
157
- ready: this.ready,
158
- state: n,
159
- uuid: this.uuid
160
- });
161
- });
162
- }, t.ontouchstart = (o) => {
163
- o.preventDefault(), d = Date.now();
164
- const a = o.touches[0].clientX, n = o.touches[0].clientY;
165
- r = [], r.push({ x: a, y: n }), i = { x: a, y: n }, console.log("ontouchstart", a, n, i), s = w({ x: a, y: n }, this.clientWidth, this.clientHeight), c = [];
166
- }, t.ontouchmove = (o) => {
167
- if (o.preventDefault(), !i)
168
- return;
169
- const a = Number(o.touches[0].clientX), n = Number(o.touches[0].clientY);
170
- if (Math.abs(a - i.x) < 5 && Math.abs(n - i.y) < 5 || (r.push({ x: a, y: n }), c.push(w({ x: a, y: n }, this.clientWidth, this.clientHeight)), r.length < 3))
171
- return;
172
- const { control: l, end: u } = b(r);
173
- !l || !u || (m(i, l, u), i = u);
174
- }, t.ontouchend = t.ontouchcancel = (o) => {
175
- if (o.preventDefault(), i = null, r.length < 3)
176
- return;
177
- this.data[this.uuid] || (this.data[this.uuid] = []);
178
- const a = Date.now() - d, n = {
179
- move: Object.assign({}, s),
180
- line: [...c],
181
- uuid: this.uuid,
182
- color: this.color,
183
- duration: a < 1280 ? a : a < 2e3 ? 1280 : 0
184
- };
185
- this.data[this.uuid].push(n), D(() => {
186
- this.emitStateChange({
187
- type: g.Drawline,
188
- color: this.color,
189
- ready: this.ready,
190
- state: n,
191
- uuid: this.uuid
192
- });
193
- });
194
- };
195
- }
196
- emitStateChange(t, e = !0) {
197
- if (t.type !== g.Drawline) {
198
- this.emit("stateChange", t, e);
199
- return;
200
- }
201
- const h = Date.now(), i = t.state;
202
- if (!i || !i.line)
203
- return;
204
- const r = Math.ceil(i.line.length / 100);
205
- for (let s = 0; s < r; s++) {
206
- const c = {
207
- uuid: this.uuid,
208
- color: this.color,
209
- ready: this.ready,
210
- type: t.type,
211
- state: {
212
- uuid: this.uuid,
213
- move: i.move,
214
- duration: i.duration,
215
- color: this.color,
216
- line: i.line.slice(s * 100, (s + 1) * 100)
217
- },
218
- timestamp: h,
219
- end: s === r - 1
220
- };
221
- N(s, 20, () => {
222
- this.emit("stateChange", c, e);
223
- });
224
- }
225
- }
226
- action(t) {
227
- const { ready: e, type: h, uuid: i } = t;
228
- if (!e && this.ready) {
229
- this.closeBrush();
230
- return;
231
- }
232
- if (e && !this.ready) {
233
- this.openBrush();
234
- return;
235
- }
236
- if (!!this.ready)
237
- switch (h) {
238
- case g.Drawline:
239
- const { state: r, timestamp: s, end: c } = t;
240
- if (!s || !r)
241
- return;
242
- this.tempLine[s] = [].concat(this.tempLine[s] || [], r.line), c && (Object.assign(r, { line: this.tempLine[s] }), this.handleDrawLine(i, r, {}, () => delete this.tempLine[s]));
243
- break;
244
- case g.Undo:
245
- this.handleUndo(i);
246
- break;
247
- }
248
- }
249
- handleDrawLine(t, e, { withUndo: h = !1 }, i = S) {
250
- !e || Object.prototype.toString.call(e) != "[object Object]" || Object.keys(e).length === 0 || (console.log("handleDrawLine", e, e.line), T(() => new Promise((r) => {
251
- if (h || (this.canvas[t] || (this.canvas[t] = this.initCanvas("_paintBrush-canvas--sync")), this.data[t] || (this.data[t] = []), this.data[t].push(e)), !this.canvas[t])
252
- return;
253
- const s = this.canvas[t].getContext("2d");
254
- if (!s)
255
- return;
256
- const { line: c = [], color: d = "black", duration: m = 0, uuid: o } = e, a = E(e.move || {}, this.clientWidth, this.clientHeight);
257
- let n = [a];
258
- if (s.strokeStyle = d, s.beginPath(), s.moveTo(a.x, a.y), m && !h) {
259
- let l = [];
260
- const u = this;
261
- u.tween = W({ step: 0 }, { step: c.length - 1 }, m).onUpdate(({ step: C }) => {
262
- var _;
263
- if (u.tweening = !0, !u.ready)
264
- return s.clearRect(0, 0, u.canvas[o].width, u.canvas[o].height), (_ = u.tween) == null ? void 0 : _.stop();
265
- const y = Math.floor(C);
266
- if (!l.find((x) => x === y)) {
267
- if (l.push(y), console.log("__debug__", c, c[y], y), n.push(E(c[y], u.clientWidth, u.clientHeight)), n.length < 3)
268
- return;
269
- const { control: x, end: B } = b(n);
270
- if (!x || !B)
271
- return;
272
- s.quadraticCurveTo(x.x, x.y, B.x, B.y), s.stroke();
273
- }
274
- }).onComplete((C) => {
275
- u.tween = void 0, u.tweening = !1, l = [], n = [], i && i(), r();
276
- });
277
- } else {
278
- for (let l = 0; l < c.length; l++) {
279
- if (n.push(E(c[l], this.clientWidth, this.clientHeight)), n.length < 3)
280
- continue;
281
- const { control: u, end: C } = b(n);
282
- !u || !C || s.quadraticCurveTo(u.x, u.y, C.x, C.y);
283
- }
284
- s.stroke(), n = [], i && i(), r();
285
- }
286
- })));
287
- }
288
- handleUndo(t) {
289
- if (console.log("handleUndo", t, this.canvas[t]), !this.canvas[t] || !this.data[t] || this.data[t].length === 0)
290
- return;
291
- this.data[t].pop();
292
- const e = () => {
293
- var i;
294
- const h = (i = this.canvas[t]) == null ? void 0 : i.getContext("2d");
295
- h && h.clearRect(0, 0, this.canvas[t].width, this.canvas[t].height), this.data[t].forEach((r) => this.handleDrawLine(t, r, { withUndo: !0 }));
296
- };
297
- if (this.tween && this.tweening) {
298
- this.tween.stop(), D(e, 60);
299
- return;
300
- }
301
- e();
302
- }
303
- destroyBrush() {
304
- this.closeBrush(), this.ready = !1, this.emit("readyChange", !0);
305
- }
306
- }
307
- export {
308
- Y as Controller
309
- };
1
+ "use strict";var _=Object.defineProperty;var E=(y,m,t)=>m in y?_(y,m,{enumerable:!0,configurable:!0,writable:!0,value:t}):y[m]=t;var p=(y,m,t)=>(E(y,typeof m!="symbol"?m+"":m,t),t);const l=require("./utils.js"),D=require("./tween.js"),v=require("./typings.js"),T=require("./Subscribe.js"),P=require("../../shared-utils/uuid.js"),S=require("./style.js");class j extends T.Subscribe{constructor(t){super();p(this,"configs");p(this,"clientWidth");p(this,"clientHeight");p(this,"ready",!1);p(this,"uuid",P.uuid());p(this,"tween");p(this,"tweening",!1);p(this,"container");p(this,"canvas");p(this,"data",{});p(this,"tempLine",{});this.configs=t,this.clientWidth=document.body.clientWidth,this.clientHeight=document.body.clientHeight,this.container=this.ifInsertToDOM(),this.canvas={},this.initCtrl()}get color(){return this.configs.currentColor}get state(){return this.data}get dpr(){return this.configs.DPR||1}ifInsertToDOM(){if(this.container)return this.container;if(this.configs.container)this.configs.container.id="_gl_paintBrush",this.container=this.configs.container;else if(document.getElementById("_gl_paintBrush"))this.container=document.getElementById("_gl_paintBrush");else{const t=document.createElement("div");t.id="_gl_paintBrush",document.body.appendChild(t),this.container=t}return this.container.innerHTML=S.PaintBrushStyle,this.container}initCanvas(t){const e=document.createElement("canvas");e.className=t,e.width=this.clientWidth,e.height=this.clientHeight;const h=e.getContext("2d");if(!!h)return h.lineWidth=5*this.dpr,h.lineCap="round",h.lineJoin="round",this.container.appendChild(e),e}initCtrl(){const t=document.createElement("div");t.className="_paintBrush-ctrl";const e=document.createElement("div");e.className="_paintBrush-ctrlinner";const h=document.createElement("a");h.className="_paintBrush-ctrlitem _paintBrush-ctrlitem--undo",h.addEventListener("click",s=>{var r;if(s.stopPropagation(),this.configs.onClickUndo&&this.configs.onClickUndo(),!this.canvas[this.uuid]||!this.data[this.uuid]||this.data[this.uuid].length===0)return;const c=this.data[this.uuid].pop();c&&this.emitStateChange({type:v.PaintBrushTypeEnum.Undo,color:this.color,ready:this.ready,state:c,uuid:this.uuid});const f=(r=this.canvas[this.uuid])==null?void 0:r.getContext("2d");if(!this.canvas[this.uuid])return;const{width:g,height:a}=this.canvas[this.uuid];f&&f.clearRect(0,0,g,a),this.data[this.uuid].forEach(i=>this.handleDrawLine(this.uuid,i,{withUndo:!0}))});const n=document.createElement("a");return n.className="_paintBrush-ctrlitem _paintBrush-ctrlitem--close",n.addEventListener("click",s=>{s.stopPropagation(),this.closeBrush(),this.configs.onClickClose&&this.configs.onClickClose()}),[h,n].forEach(s=>{const c=document.createElement("i");c.className="brush-icon";const f=document.createElement("span");f.className="brush-txt",f.innerText=s.className.endsWith("undo")?this.configs.onUndoText:this.configs.onExitText,s.appendChild(c),s.appendChild(f)}),e.appendChild(h),e.appendChild(n),t.appendChild(e),this.container.appendChild(t),t}openBrush(){if(this.ready)return;this.canvas[this.uuid]||(this.canvas[this.uuid]=this.initCanvas("_paintBrush-canvas")),this.container.className="brushing";const t=this.canvas[this.uuid];t.getContext("2d").clearRect(0,0,t.width,t.height),this.openBrushHandle(),this.ready=!0,this.emit("readyChange",!0)}closeBrush(){!this.ready||(this.container.className="",this.data={},this.tempLine={},Object.keys(this.canvas).forEach(t=>{this.canvas[t].ontouchstart=()=>!1,this.canvas[t].ontouchmove=()=>!1,this.canvas[t].ontouchend=()=>!1,this.canvas[t].ontouchcancel=()=>!1;const e=this.canvas[t].getContext("2d");e&&e.clearRect(0,0,this.canvas[t].width,this.canvas[t].height)}),this.ready=!1,this.emit("readyChange",!1),this.emitStateChange({type:v.PaintBrushTypeEnum.Exit,color:this.color,ready:!1,uuid:this.uuid}))}updateCurrentColor(t){const e=this.canvas[this.uuid];if(!e)return;const h=e.getContext("2d");!h||(this.configs.currentColor=t,h.strokeStyle=t)}openBrushHandle(){const t=this.canvas[this.uuid];if(!t)return;const e=t.getContext("2d");if(!e)return;const h=this.color||"#6D92FF";e.strokeStyle=h;let n=null,o=[],s,c=[],f=0;const g=(a,r,i)=>{const d=this.color||"#ff0000";e.strokeStyle=d,e.beginPath(),e.moveTo(a.x,a.y),e.quadraticCurveTo(r.x,r.y,i.x,i.y),e.stroke()};t.onmousedown=a=>{a.preventDefault(),f=Date.now();const r=a.clientX,i=a.clientY;o=[],o.push({x:r,y:i}),n={x:r,y:i},s=l.transformCoords({x:r,y:i},this.clientWidth,this.clientHeight),c=[]},t.onmousemove=a=>{if(a.preventDefault(),!n)return;const r=Number(a.clientX),i=Number(a.clientY);if(Math.abs(r-n.x)<5&&Math.abs(i-n.y)<5||(o.push({x:r,y:i}),c.push(l.transformCoords({x:r,y:i},this.clientWidth,this.clientHeight)),o.length<3))return;const{control:d,end:u}=l.getQuadraticCurvePoint(o);!d||!u||(g(n,d,u),n=u)},t.onmouseup=a=>{if(a.preventDefault(),n=null,o.length<3)return;this.data[this.uuid]||(this.data[this.uuid]=[]);const r=Date.now()-f,i={move:Object.assign({},s),uuid:this.uuid,line:[...c],color:this.color,duration:r<1280?r:r<2e3?1280:0};this.data[this.uuid].push(i),l.nextFrame(()=>{this.emitStateChange({type:v.PaintBrushTypeEnum.Drawline,color:this.color,ready:this.ready,state:i,uuid:this.uuid})})},t.ontouchstart=a=>{a.preventDefault(),f=Date.now();const r=a.touches[0].clientX,i=a.touches[0].clientY;o=[],o.push({x:r,y:i}),n={x:r,y:i},console.log("ontouchstart",r,i,n),s=l.transformCoords({x:r,y:i},this.clientWidth,this.clientHeight),c=[]},t.ontouchmove=a=>{if(a.preventDefault(),!n)return;const r=Number(a.touches[0].clientX),i=Number(a.touches[0].clientY);if(Math.abs(r-n.x)<5&&Math.abs(i-n.y)<5||(o.push({x:r,y:i}),c.push(l.transformCoords({x:r,y:i},this.clientWidth,this.clientHeight)),o.length<3))return;const{control:d,end:u}=l.getQuadraticCurvePoint(o);!d||!u||(g(n,d,u),n=u)},t.ontouchend=t.ontouchcancel=a=>{if(a.preventDefault(),n=null,o.length<3)return;this.data[this.uuid]||(this.data[this.uuid]=[]);const r=Date.now()-f,i={move:Object.assign({},s),line:[...c],uuid:this.uuid,color:this.color,duration:r<1280?r:r<2e3?1280:0};this.data[this.uuid].push(i),l.nextFrame(()=>{this.emitStateChange({type:v.PaintBrushTypeEnum.Drawline,color:this.color,ready:this.ready,state:i,uuid:this.uuid})})}}emitStateChange(t,e=!0){if(t.type!==v.PaintBrushTypeEnum.Drawline){this.emit("stateChange",t,e);return}const h=Date.now(),n=t.state;if(!n||!n.line)return;const o=Math.ceil(n.line.length/100);for(let s=0;s<o;s++){const c={uuid:this.uuid,color:this.color,ready:this.ready,type:t.type,state:{uuid:this.uuid,move:n.move,duration:n.duration,color:this.color,line:n.line.slice(s*100,(s+1)*100)},timestamp:h,end:s===o-1};l.execInterval(s,20,()=>{this.emit("stateChange",c,e)})}}action(t){const{ready:e,type:h,uuid:n}=t;if(!e&&this.ready){this.closeBrush();return}if(e&&!this.ready){this.openBrush();return}if(!!this.ready)switch(h){case v.PaintBrushTypeEnum.Drawline:const{state:o,timestamp:s,end:c}=t;if(!s||!o)return;this.tempLine[s]=[].concat(this.tempLine[s]||[],o.line),c&&(Object.assign(o,{line:this.tempLine[s]}),this.handleDrawLine(n,o,{},()=>delete this.tempLine[s]));break;case v.PaintBrushTypeEnum.Undo:this.handleUndo(n);break}}handleDrawLine(t,e,{withUndo:h=!1},n=l.noop){!e||Object.prototype.toString.call(e)!="[object Object]"||Object.keys(e).length===0||(console.log("handleDrawLine",e,e.line),l.queue(()=>new Promise(o=>{if(h||(this.canvas[t]||(this.canvas[t]=this.initCanvas("_paintBrush-canvas--sync")),this.data[t]||(this.data[t]=[]),this.data[t].push(e)),!this.canvas[t])return;const s=this.canvas[t].getContext("2d");if(!s)return;const{line:c=[],color:f="black",duration:g=0,uuid:a}=e,r=l.unTransformCoords(e.move||{},this.clientWidth,this.clientHeight);let i=[r];if(s.strokeStyle=f,s.beginPath(),s.moveTo(r.x,r.y),g&&!h){let d=[];const u=this;u.tween=D.tween({step:0},{step:c.length-1},g).onUpdate(({step:C})=>{var b;if(u.tweening=!0,!u.ready)return s.clearRect(0,0,u.canvas[a].width,u.canvas[a].height),(b=u.tween)==null?void 0:b.stop();const x=Math.floor(C);if(!d.find(w=>w===x)){if(d.push(x),console.log("__debug__",c,c[x],x),i.push(l.unTransformCoords(c[x],u.clientWidth,u.clientHeight)),i.length<3)return;const{control:w,end:B}=l.getQuadraticCurvePoint(i);if(!w||!B)return;s.quadraticCurveTo(w.x,w.y,B.x,B.y),s.stroke()}}).onComplete(C=>{u.tween=void 0,u.tweening=!1,d=[],i=[],n&&n(),o()})}else{for(let d=0;d<c.length;d++){if(i.push(l.unTransformCoords(c[d],this.clientWidth,this.clientHeight)),i.length<3)continue;const{control:u,end:C}=l.getQuadraticCurvePoint(i);!u||!C||s.quadraticCurveTo(u.x,u.y,C.x,C.y)}s.stroke(),i=[],n&&n(),o()}})))}handleUndo(t){if(console.log("handleUndo",t,this.canvas[t]),!this.canvas[t]||!this.data[t]||this.data[t].length===0)return;this.data[t].pop();const e=()=>{var n;const h=(n=this.canvas[t])==null?void 0:n.getContext("2d");h&&h.clearRect(0,0,this.canvas[t].width,this.canvas[t].height),this.data[t].forEach(o=>this.handleDrawLine(t,o,{withUndo:!0}))};if(this.tween&&this.tweening){this.tween.stop(),l.nextFrame(e,60);return}e()}destroyBrush(){this.closeBrush(),this.ready=!1,this.emit("readyChange",!0)}}exports.Controller=j;
@@ -1,47 +1 @@
1
- const i = Symbol("$$PAINT_BRUSH_EVENT$$");
2
- function r(f) {
3
- return f[i] || (f[i] = {}), f[i];
4
- }
5
- function v(f) {
6
- f[i] || delete f[i];
7
- }
8
- class E {
9
- hasListener(t) {
10
- const e = r(this);
11
- return e && e[t] && e[t].length > 0;
12
- }
13
- on(t, e, s) {
14
- const o = r(this);
15
- return o[t] || (o[t] = []), o[t].push([e, s || !1]), () => this.off(t, e);
16
- }
17
- once(t, e) {
18
- return this.on(t, e, !0);
19
- }
20
- off(t, e) {
21
- if (t === void 0) {
22
- v(this);
23
- return;
24
- }
25
- const s = r(this);
26
- if (s[t] || (s[t] = []), e === void 0) {
27
- s[t].length = 0;
28
- return;
29
- }
30
- let o = 0;
31
- for (; o < s[t].length && s[t][o][0] !== e; o++)
32
- ;
33
- o < s[t].length && s[t].splice(o, 1);
34
- }
35
- emit(t, ...e) {
36
- let s = !1;
37
- const l = r(this)[t] || [];
38
- for (let h of l.slice()) {
39
- const [n, u = !1] = h, c = n(...e);
40
- u && this.off(t, n), c === !1 && (s = !0);
41
- }
42
- return s;
43
- }
44
- }
45
- export {
46
- E as Subscribe
47
- };
1
+ "use strict";const o=Symbol("$$PAINT_BRUSH_EVENT$$");function r(f){return f[o]||(f[o]={}),f[o]}function v(f){f[o]||delete f[o]}class E{hasListener(t){const e=r(this);return e&&e[t]&&e[t].length>0}on(t,e,s){const i=r(this);return i[t]||(i[t]=[]),i[t].push([e,s||!1]),()=>this.off(t,e)}once(t,e){return this.on(t,e,!0)}off(t,e){if(t===void 0){v(this);return}const s=r(this);if(s[t]||(s[t]=[]),e===void 0){s[t].length=0;return}let i=0;for(;i<s[t].length&&s[t][i][0]!==e;i++);i<s[t].length&&s[t].splice(i,1)}emit(t,...e){let s=!1;const l=r(this)[t]||[];for(let u of l.slice()){const[n,c=!1]=u,h=n(...e);c&&this.off(t,n),h===!1&&(s=!0)}return s}}exports.Subscribe=E;
@@ -1,52 +1 @@
1
- var e = Object.defineProperty;
2
- var s = (r, o, t) => o in r ? e(r, o, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[o] = t;
3
- var n = (r, o, t) => (s(r, typeof o != "symbol" ? o + "" : o, t), t);
4
- import { Controller as l } from "./Controller.js";
5
- import "./utils.js";
6
- import "./tween.js";
7
- import "../../tween.esm.bad2b2b4.js";
8
- import "./typings.js";
9
- import "./Subscribe.js";
10
- import "../../shared-utils/uuid.js";
11
- import "./style.js";
12
- class C {
13
- constructor(o = {}) {
14
- n(this, "controller");
15
- const t = Object.assign({
16
- currentColor: "#f44336",
17
- onUndoText: "\u56DE\u9000",
18
- onExitText: "\u5173\u95ED"
19
- }, o);
20
- this.controller = new l(t);
21
- }
22
- on(o, t) {
23
- this.controller.on(o, t);
24
- }
25
- off(o, t) {
26
- this.controller.off(o, t);
27
- }
28
- once(o, t) {
29
- this.controller.once(o, t);
30
- }
31
- show() {
32
- this.controller.openBrush();
33
- }
34
- action(o) {
35
- this.controller.action(o);
36
- }
37
- get state() {
38
- return this.controller.state;
39
- }
40
- get configs() {
41
- return this.controller.configs;
42
- }
43
- dispose() {
44
- return this.controller.destroyBrush();
45
- }
46
- setCurrentColor(o) {
47
- this.controller.updateCurrentColor(o);
48
- }
49
- }
50
- export {
51
- C as PaintBrush
52
- };
1
+ "use strict";var s=Object.defineProperty;var n=(t,r,e)=>r in t?s(t,r,{enumerable:!0,configurable:!0,writable:!0,value:e}):t[r]=e;var o=(t,r,e)=>(n(t,typeof r!="symbol"?r+"":r,e),e);Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const l=require("./Controller.js");require("./utils.js");require("./tween.js");require("@tweenjs/tween.js");require("./typings.js");require("./Subscribe.js");require("../../shared-utils/uuid.js");require("./style.js");class i{constructor(r={}){o(this,"controller");const e=Object.assign({currentColor:"#f44336",onUndoText:"\u56DE\u9000",onExitText:"\u5173\u95ED"},r);this.controller=new l.Controller(e)}on(r,e){this.controller.on(r,e)}off(r,e){this.controller.off(r,e)}once(r,e){this.controller.once(r,e)}show(){this.controller.openBrush()}action(r){this.controller.action(r)}get state(){return this.controller.state}get configs(){return this.controller.configs}dispose(){return this.controller.destroyBrush()}setCurrentColor(r){this.controller.updateCurrentColor(r)}}exports.PaintBrush=i;