@realsee/dnalogel 2.1.1 → 2.1.2-alpha.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 (520) hide show
  1. package/components/index.js +242 -569
  2. package/dist/index.cjs.js +58 -73
  3. package/dist/index.es.js +7842 -12958
  4. package/dist/index.js +7842 -12958
  5. package/dist/index.umd.js +46 -61
  6. package/docs/assets/highlight.css +3 -3
  7. package/docs/assets/main.js +4 -2
  8. package/docs/assets/search.js +1 -1
  9. package/docs/assets/style.css +462 -619
  10. package/docs/classes/CruisePluginController.html +397 -23
  11. package/docs/classes/Magnifier.html +187 -9
  12. package/docs/classes/ModelRoomLabelController.html +149 -11
  13. package/docs/classes/Object3DHelperController.html +356 -0
  14. package/docs/classes/PaintBrush.html +260 -0
  15. package/docs/classes/PanoTagPluginController.html +940 -0
  16. package/docs/classes/Util.BetterTween.html +134 -0
  17. package/docs/classes/Util.FivePointSelector.html +144 -0
  18. package/docs/classes/Util.Interval.html +158 -0
  19. package/docs/classes/Util.Magnifier.html +196 -0
  20. package/docs/classes/Util.PointDomHelper.html +135 -0
  21. package/docs/classes/Util.PointHelper.html +127 -0
  22. package/docs/classes/Util.Rectangle.html +181 -0
  23. package/docs/enums/CameraMovementEffect.html +70 -3
  24. package/docs/enums/ContentType.html +116 -0
  25. package/docs/enums/DIRECTION.html +81 -1
  26. package/docs/enums/DISPLAY_STRATEGY_TYPE.html +81 -1
  27. package/docs/enums/DimensionType.html +67 -0
  28. package/docs/enums/FLOOR_PLAN_ATTACHED_TO.html +74 -1
  29. package/docs/enums/ITEM_LABEL_PLUGIN_DISPLAY_STRATEGY_TYPE.html +81 -1
  30. package/docs/enums/LinkType.html +67 -0
  31. package/docs/enums/PaintBrushTypeEnum.html +74 -0
  32. package/docs/enums/PointType.html +67 -0
  33. package/docs/enums/Rotation.html +77 -3
  34. package/docs/functions/CSS3DRenderPlugin.html +233 -0
  35. package/docs/functions/CameraMovementPlugin.html +237 -0
  36. package/docs/functions/CruisePlugin.html +233 -0
  37. package/docs/functions/GuideLinePlugin.html +235 -0
  38. package/docs/functions/ItemLabelPlugin.html +235 -0
  39. package/docs/functions/MapviewFloorplanPlugin.html +235 -0
  40. package/docs/functions/ModelChassisCompassPlugin.html +237 -0
  41. package/docs/functions/ModelEntryDoorGuidePlugin.html +237 -0
  42. package/docs/functions/ModelFloorplanPlugin.html +235 -0
  43. package/docs/functions/ModelItemLabelPlugin.html +235 -0
  44. package/docs/functions/ModelRoomLabelPlugin.html +233 -0
  45. package/docs/functions/ModelTVVideoPlugin.html +235 -0
  46. package/docs/functions/ModelViewPlugin.html +237 -0
  47. package/docs/functions/Object3DHelperPlugin.html +233 -0
  48. package/docs/functions/PanoCompassPlugin.html +235 -0
  49. package/docs/functions/PanoCursorRaycasterPlugin.html +238 -0
  50. package/docs/functions/PanoDoorLabelPlugin.html +235 -0
  51. package/docs/functions/PanoFloorplanRadarPlugin.html +235 -0
  52. package/docs/functions/PanoMeasurePlugin.html +235 -0
  53. package/docs/functions/PanoRulerPlugin.html +237 -0
  54. package/docs/functions/PanoRulerProPlugin.html +237 -0
  55. package/docs/functions/PanoSpatialTagPlugin.html +237 -0
  56. package/docs/functions/PanoTagPlugin.html +249 -0
  57. package/docs/functions/TopviewFloorplanPlugin.html +235 -0
  58. package/docs/functions/Util.getCoordsFromClient.html +78 -0
  59. package/docs/functions/Util.getCoordsFromElement.html +78 -0
  60. package/docs/functions/Util.getFrameTime.html +70 -0
  61. package/docs/functions/Util.getIntersectFromRelativePosition.html +78 -0
  62. package/docs/functions/Util.getRaycasterFromFivePointer.html +78 -0
  63. package/docs/functions/Util.isNil.html +79 -0
  64. package/docs/functions/Util.nextFrame.html +73 -0
  65. package/docs/functions/Util.notNil.html +78 -0
  66. package/docs/functions/Util.requestAnimationFrameInterval.html +98 -0
  67. package/docs/functions/Util.tweenProgress.html +84 -0
  68. package/docs/functions/pluginFlag.html +233 -0
  69. package/docs/index.html +220 -2
  70. package/docs/interfaces/CSS3DRenderPluginEventMap.html +205 -0
  71. package/docs/interfaces/CSS3DRenderPluginState.html +85 -0
  72. package/docs/interfaces/CameraMovementPluginExportType.html +111 -17
  73. package/docs/interfaces/ContentTypeMap.html +212 -0
  74. package/docs/interfaces/FloorplanBounding.html +89 -10
  75. package/docs/interfaces/FloorplanData.html +95 -3
  76. package/docs/interfaces/FloorplanEntrance.html +114 -15
  77. package/docs/interfaces/FloorplanExtraObject.html +108 -7
  78. package/docs/interfaces/FloorplanExtraObject3D.html +99 -3
  79. package/docs/interfaces/FloorplanFloorData.html +88 -3
  80. package/docs/interfaces/FloorplanImagePosition.html +74 -3
  81. package/docs/interfaces/FloorplanObserver.html +92 -5
  82. package/docs/interfaces/FloorplanOutlineItem.html +88 -3
  83. package/docs/interfaces/FloorplanPosition.html +74 -3
  84. package/docs/interfaces/FloorplanRoomItem.html +134 -17
  85. package/docs/interfaces/FloorplanRoomLabelItem.html +78 -7
  86. package/docs/interfaces/FloorplanServerBounding.html +89 -10
  87. package/docs/interfaces/FloorplanServerComputedData.html +92 -1
  88. package/docs/interfaces/FloorplanServerData.html +74 -3
  89. package/docs/interfaces/FloorplanServerDoorItem.html +92 -1
  90. package/docs/interfaces/FloorplanServerDoorPosition.html +78 -1
  91. package/docs/interfaces/FloorplanServerEntrance.html +114 -15
  92. package/docs/interfaces/FloorplanServerFloorData.html +88 -3
  93. package/docs/interfaces/FloorplanServerImagePosition.html +74 -3
  94. package/docs/interfaces/FloorplanServerObserver.html +92 -5
  95. package/docs/interfaces/FloorplanServerOutlineItem.html +88 -3
  96. package/docs/interfaces/FloorplanServerPosition.html +74 -3
  97. package/docs/interfaces/FloorplanServerRoomItem.html +145 -20
  98. package/docs/interfaces/FloorplanServerRoomLabelItem.html +78 -7
  99. package/docs/interfaces/ItemLabelPluginData.html +64 -1
  100. package/docs/interfaces/ItemLabelPluginExportReturnsType.html +149 -1
  101. package/docs/interfaces/ItemLabelPluginParametersType.html +85 -1
  102. package/docs/interfaces/LineJson.html +71 -1
  103. package/docs/interfaces/ModelChassisCompassPluginData.html +71 -1
  104. package/docs/interfaces/ModelChassisCompassPluginExportType.html +107 -1
  105. package/docs/interfaces/ModelChassisCompassPluginParameterType.html +71 -1
  106. package/docs/interfaces/ModelEntryDoorGuidePluginData.html +78 -1
  107. package/docs/interfaces/ModelEntryDoorGuidePluginExportType.html +115 -1
  108. package/docs/interfaces/ModelItemLabelPluginData.html +64 -1
  109. package/docs/interfaces/ModelItemLabelPluginExportReturnsType.html +149 -1
  110. package/docs/interfaces/ModelItemLabelPluginParametersType.html +71 -1
  111. package/docs/interfaces/ModelRoomLabelPluginData.html +64 -1
  112. package/docs/interfaces/ModelTVVideoPluginData.html +85 -1
  113. package/docs/interfaces/ModelTVVideoPluginExportType.html +109 -1
  114. package/docs/interfaces/ModelTVVideoPluginParameterType.html +64 -1
  115. package/docs/interfaces/ModelViewPluginExportType.html +129 -1
  116. package/docs/interfaces/Object3DHelperState.html +78 -0
  117. package/docs/interfaces/OpenParameter.html +74 -3
  118. package/docs/interfaces/PaintBrushAction.html +118 -0
  119. package/docs/interfaces/PaintBrushConfigs.html +122 -0
  120. package/docs/interfaces/PaintBrushState.html +99 -0
  121. package/docs/interfaces/PanoCursorRaycasterPluginExportType.html +186 -11
  122. package/docs/interfaces/PanoCursorRaycasterPluginParameterType.html +227 -1
  123. package/docs/interfaces/PanoMeasureParameterType.html +128 -5
  124. package/docs/interfaces/PanoRulerPluginExportType.html +138 -1
  125. package/docs/interfaces/PanoRulerPluginOptions.html +87 -1
  126. package/docs/interfaces/PanoRulerPluginParameterType.html +78 -1
  127. package/docs/interfaces/PanoRulerProPluginExportType.html +114 -1
  128. package/docs/interfaces/PanoRulerProPluginOptions.html +84 -1
  129. package/docs/interfaces/PanoRulerProPluginParameterType.html +71 -1
  130. package/docs/interfaces/PanoRulerProPluginState.html +78 -1
  131. package/docs/interfaces/PanoSpatialTagPluginContentEvent.html +241 -1
  132. package/docs/interfaces/PanoSpatialTagPluginContentReplacement.html +230 -1
  133. package/docs/interfaces/PanoSpatialTagPluginData.html +114 -1
  134. package/docs/interfaces/PanoSpatialTagPluginDataElement.html +96 -1
  135. package/docs/interfaces/PanoSpatialTagPluginExportType.html +192 -1
  136. package/docs/interfaces/PanoSpatialTagPluginOriginElement.html +92 -1
  137. package/docs/interfaces/PanoSpatialTagPluginParameterType.html +113 -1
  138. package/docs/interfaces/PanoSpatialTagPluginPointElement.html +99 -1
  139. package/docs/interfaces/PanoSpatialTagPluginTagElement.html +92 -1
  140. package/docs/interfaces/Point.html +78 -1
  141. package/docs/interfaces/PointJson.html +78 -1
  142. package/docs/interfaces/Room.html +85 -1
  143. package/docs/interfaces/RoomInfo.html +71 -1
  144. package/docs/interfaces/RoomLabel.html +141 -13
  145. package/docs/interfaces/RoomRules.html +230 -1
  146. package/docs/interfaces/Rooms.html +230 -1
  147. package/docs/interfaces/Scissor.html +100 -0
  148. package/docs/interfaces/TagConfig.html +120 -0
  149. package/docs/interfaces/Tags.html +89 -0
  150. package/docs/interfaces/Util.MagnifierParameter.html +116 -0
  151. package/docs/interfaces/Util.MouseGroupParameter.html +79 -0
  152. package/docs/modules/Util.html +91 -0
  153. package/docs/modules.html +425 -36
  154. package/docs/types/ArrayPosition.html +224 -0
  155. package/docs/types/CSS3DRenderExportType.html +224 -0
  156. package/docs/types/CSS3DRenderPluginExportType.html +224 -0
  157. package/docs/types/CSS3DRenderPluginParameterType.html +224 -0
  158. package/docs/types/Color.html +224 -0
  159. package/docs/types/ContentTypeConfigKey.html +224 -0
  160. package/docs/types/ContentTypeConfigKeyArray.html +224 -0
  161. package/docs/types/Create3DDomContainerReturnType.html +224 -0
  162. package/docs/types/Create3DElementReturnType.html +224 -0
  163. package/docs/types/CruisePluginExportType.html +224 -0
  164. package/docs/types/Direction-1.html +224 -0
  165. package/docs/types/Direction4.html +224 -0
  166. package/docs/types/FloorplanRuleLabels.html +226 -0
  167. package/docs/types/FloorplanServerRuleLabels.html +224 -0
  168. package/docs/types/GuideLinePluginExportType.html +224 -0
  169. package/docs/types/HelperEventMap.html +314 -0
  170. package/docs/types/MapviewFloorplanPluginParameterType.html +224 -0
  171. package/docs/types/MapviewFloorplanPluginReturnType.html +224 -0
  172. package/docs/types/MediaData.html +224 -0
  173. package/docs/types/ModelEntryDoorGuidePluginParameterType.html +224 -0
  174. package/docs/types/ModelFloorplanPluginParameterType.html +224 -0
  175. package/docs/types/ModelFloorplanPluginReturnType.html +224 -0
  176. package/docs/types/ModelRoomLabelPluginParameters.html +224 -0
  177. package/docs/types/ModelRoomLabelPluginReturnType.html +224 -0
  178. package/docs/types/MoveArgs.html +226 -0
  179. package/docs/types/MoveOpts.html +226 -0
  180. package/docs/types/Object3DHelperEventMap.html +317 -0
  181. package/docs/types/ObjectFit.html +224 -0
  182. package/docs/types/PaintBrushEventMap.html +255 -0
  183. package/docs/types/PanoCompassPluginData.html +224 -0
  184. package/docs/types/PanoCompassPluginExportType.html +224 -0
  185. package/docs/types/PanoCompassPluginParameterType.html +224 -0
  186. package/docs/types/PanoFloorplanRadarPluginParameterType.html +224 -0
  187. package/docs/types/PanoFloorplanRadarPluginReturnType.html +224 -0
  188. package/docs/types/PanoMeasurePluginEvent.html +224 -0
  189. package/docs/types/PanoMeasureReturnType.html +224 -0
  190. package/docs/types/PanoSpatialTagPluginId.html +224 -0
  191. package/docs/types/PanoTagPluginExportInterface.html +224 -0
  192. package/docs/types/PanoTagPluginParamsInterface.html +224 -0
  193. package/docs/types/PlaneTag.html +233 -0
  194. package/docs/types/PointTag.html +235 -0
  195. package/docs/types/Position.html +224 -0
  196. package/docs/types/RotateArgs.html +226 -0
  197. package/docs/types/RotateOpts.html +226 -0
  198. package/docs/types/RuleLabelsKey.html +224 -0
  199. package/docs/types/RuleLabelsValue.html +224 -0
  200. package/docs/types/Tag.html +235 -0
  201. package/docs/types/Tag2D.html +233 -0
  202. package/docs/types/Tag3D.html +233 -0
  203. package/docs/types/TagId.html +224 -0
  204. package/docs/types/TopviewFloorplanPluginParameterType.html +224 -0
  205. package/docs/types/TopviewFloorplanPluginReturnType.html +224 -0
  206. package/docs/variables/FLOOR_TYPE_MAP.html +226 -0
  207. package/docs/variables/PLUGIN.html +224 -0
  208. package/docs/variables/ROOM_FETILE_TYPE_MAP.html +226 -0
  209. package/docs/variables/ROOM_TYPE_MAP.html +226 -0
  210. package/docs/variables/VERSION.html +224 -0
  211. package/docs/variables/itemLabelPluginServerParams.html +231 -0
  212. package/docs/variables/modelItemLabelPluginServerParams.html +231 -0
  213. package/docs/variables/modelRoomLabelPluginServerParams.html +231 -0
  214. package/libs/CSS3DRenderPlugin/CSS3DRender.d.ts +2 -2
  215. package/libs/CSS3DRenderPlugin/CSS3DRender.js +150 -119
  216. package/libs/CSS3DRenderPlugin/Controller.d.ts +3 -3
  217. package/libs/CSS3DRenderPlugin/Controller.js +45 -42
  218. package/libs/CSS3DRenderPlugin/index.js +4 -12
  219. package/libs/CameraMovementPlugin/CameraMovementPlugin.js +71 -54
  220. package/libs/CruisePlugin/Controller.js +331 -287
  221. package/libs/CruisePlugin/index.js +6 -25
  222. package/libs/CruisePlugin/utils/coordinatesAngle.js +2 -3
  223. package/libs/CruisePlugin/utils/safeCall.js +21 -5
  224. package/libs/GuideLinePlugin/Controller.js +94 -62
  225. package/libs/GuideLinePlugin/index.js +4 -13
  226. package/libs/GuideLinePlugin/utils/getLineGeometries.js +49 -103
  227. package/libs/GuideLinePlugin/utils/polyline-normals.d.ts +3 -0
  228. package/libs/ItemLabelPlugin/ItemLabelComponent.js +200 -183
  229. package/libs/ItemLabelPlugin/ItemLabelItem.js +27 -27
  230. package/libs/ItemLabelPlugin/Plugin.js +20 -29
  231. package/libs/ItemLabelPlugin/index.js +5 -18
  232. package/libs/ItemLabelPlugin/utils/parseData.js +15 -4
  233. package/libs/ItemLabelPlugin/utils/transform2RenderData.js +16 -6
  234. package/libs/ModelChassisCompassPlugin/Plugin.js +54 -38
  235. package/libs/ModelEntryDoorGuidePlugin/Plugin.js +58 -46
  236. package/libs/ModelItemLabelPlugin/ItemLabelComponent.js +145 -129
  237. package/libs/ModelItemLabelPlugin/ItemLabelItem.js +18 -18
  238. package/libs/ModelItemLabelPlugin/ModelItemLabelPlugin.js +19 -24
  239. package/libs/ModelItemLabelPlugin/index.js +5 -14
  240. package/libs/ModelItemLabelPlugin/utils/parseData.js +16 -6
  241. package/libs/ModelRoomLabelPlugin/Controller.js +2 -6
  242. package/libs/ModelRoomLabelPlugin/RoomLabelItem.js +22 -22
  243. package/libs/ModelRoomLabelPlugin/RoomLabelItems.js +105 -94
  244. package/libs/ModelRoomLabelPlugin/index.js +4 -10
  245. package/libs/ModelTVVideoPlugin/Plugin.js +101 -94
  246. package/libs/ModelViewPlugin/Plugin.js +71 -60
  247. package/libs/Object3DHelperPlugin/Controller.d.ts +1 -1
  248. package/libs/Object3DHelperPlugin/Controller.js +79 -71
  249. package/libs/Object3DHelperPlugin/FiveControllerWrapper.d.ts +1 -1
  250. package/libs/Object3DHelperPlugin/FiveControllerWrapper.js +8 -11
  251. package/libs/Object3DHelperPlugin/index.js +8 -40
  252. package/libs/PanoCompassPlugin/Controller.js +91 -72
  253. package/libs/PanoCompassPlugin/index.js +4 -22
  254. package/libs/PanoCursorRaycasterPlugin/index.js +8 -9
  255. package/libs/PanoDoorLabelPlugin/BaseController.js +42 -33
  256. package/libs/PanoDoorLabelPlugin/Controller.js +84 -80
  257. package/libs/PanoDoorLabelPlugin/DoorLabelItem.js +16 -16
  258. package/libs/PanoDoorLabelPlugin/index.d.ts +1 -1
  259. package/libs/PanoDoorLabelPlugin/index.js +3 -12
  260. package/libs/PanoDoorLabelPlugin/utils.d.ts +2 -2
  261. package/libs/PanoMeasurePlugin/Controller/BaseController.js +14 -24
  262. package/libs/PanoMeasurePlugin/Controller/EditController.js +8 -20
  263. package/libs/PanoMeasurePlugin/Controller/MixedController.js +15 -28
  264. package/libs/PanoMeasurePlugin/Controller/ViewController.js +15 -26
  265. package/libs/PanoMeasurePlugin/Controller/WatchController.js +28 -43
  266. package/libs/PanoMeasurePlugin/Controller/index.d.ts +1 -1
  267. package/libs/PanoMeasurePlugin/Controller/index.js +43 -70
  268. package/libs/PanoMeasurePlugin/Model/index.d.ts +4 -4
  269. package/libs/PanoMeasurePlugin/Model/index.js +38 -45
  270. package/libs/PanoMeasurePlugin/Model/line.d.ts +1 -1
  271. package/libs/PanoMeasurePlugin/Model/line.js +10 -14
  272. package/libs/PanoMeasurePlugin/Model/polyline.d.ts +2 -2
  273. package/libs/PanoMeasurePlugin/Modules/Magnifier.js +3 -3
  274. package/libs/PanoMeasurePlugin/Modules/UIController/style.js +16 -24
  275. package/libs/PanoMeasurePlugin/Modules/rangePiece/index.js +35 -28
  276. package/libs/PanoMeasurePlugin/index.js +6 -55
  277. package/libs/PanoMeasurePlugin/utils/constants.js +29 -16
  278. package/libs/PanoMeasurePlugin/utils/findClosestPoint.d.ts +1 -1
  279. package/libs/PanoMeasurePlugin/utils/findClosestPoint.js +4 -5
  280. package/libs/PanoRulerPlugin/Plugin.js +180 -157
  281. package/libs/PanoRulerProPlugin/Controller.js +70 -51
  282. package/libs/PanoRulerProPlugin/RulerItem.js +55 -45
  283. package/libs/PanoRulerProPlugin/RulerItems.js +124 -125
  284. package/libs/PanoRulerProPlugin/index.js +4 -15
  285. package/libs/PanoSpatialTagPlugin/Components/origins.js +24 -25
  286. package/libs/PanoSpatialTagPlugin/Components/tag.js +23 -23
  287. package/libs/PanoSpatialTagPlugin/Plugin.js +61 -72
  288. package/libs/PanoSpatialTagPlugin/store.d.ts +1 -1
  289. package/libs/PanoSpatialTagPlugin/store.js +1 -2
  290. package/libs/PanoTagPlugin/Components/Common/Arrow.js +47 -47
  291. package/libs/PanoTagPlugin/Components/Common/Audio.js +95 -92
  292. package/libs/PanoTagPlugin/Components/Common/Line/Polyline.js +48 -48
  293. package/libs/PanoTagPlugin/Components/Common/Line/Straight.js +40 -41
  294. package/libs/PanoTagPlugin/Components/Common/Media.js +258 -3303
  295. package/libs/PanoTagPlugin/Components/Common/MediaItem.js +60 -60
  296. package/libs/PanoTagPlugin/Components/Common/MultiLineText.js +96 -107
  297. package/libs/PanoTagPlugin/Components/Common/Point/CustomPoint.js +15 -16
  298. package/libs/PanoTagPlugin/Components/Common/Point/DefaultPoint.js +22 -23
  299. package/libs/PanoTagPlugin/Components/Common/Point/PointSwitch.js +78 -82
  300. package/libs/PanoTagPlugin/Components/Common/Shadow.js +51 -52
  301. package/libs/PanoTagPlugin/Components/Common/Text.js +84 -937
  302. package/libs/PanoTagPlugin/Components/Tag/AudioTag.js +58 -64
  303. package/libs/PanoTagPlugin/Components/Tag/CustomTag.js +35 -34
  304. package/libs/PanoTagPlugin/Components/Tag/ImageTextTag.js +101 -111
  305. package/libs/PanoTagPlugin/Components/Tag/LinkTag.js +43 -45
  306. package/libs/PanoTagPlugin/Components/Tag/MarketingTag.js +123 -96
  307. package/libs/PanoTagPlugin/Components/Tag/MediaPlane.js +36 -44
  308. package/libs/PanoTagPlugin/Components/Tag/TextTag.js +71 -83
  309. package/libs/PanoTagPlugin/Components/Tag/index.js +130 -149
  310. package/libs/PanoTagPlugin/Components/TagContainer.js +69 -100
  311. package/libs/PanoTagPlugin/Components/TagWrapper.js +86 -116
  312. package/libs/PanoTagPlugin/controller/TagCacheController.js +2 -3
  313. package/libs/PanoTagPlugin/controller/TagComputer.d.ts +5 -5
  314. package/libs/PanoTagPlugin/controller/TagComputer.js +262 -13
  315. package/libs/PanoTagPlugin/controller/index.js +177 -186
  316. package/libs/PanoTagPlugin/index.js +7 -69
  317. package/libs/PanoTagPlugin/utils/checkRange.d.ts +1 -1
  318. package/libs/PanoTagPlugin/utils/resizeObserver.js +1 -1
  319. package/libs/PanoTagPlugin/utils/search.js +9 -27
  320. package/libs/base/BasePluginWithData.js +0 -1
  321. package/libs/components/PaintBrush/Controller.d.ts +2 -2
  322. package/libs/components/PaintBrush/Controller.js +3 -4
  323. package/libs/components/PaintBrush/index.js +2 -9
  324. package/libs/components/PaintBrush/tween.js +7 -11
  325. package/libs/components/PaintBrush/utils.d.ts +1 -1
  326. package/libs/env.d.ts +1 -0
  327. package/libs/floorplan/Components/BaseImage.js +29 -30
  328. package/libs/floorplan/Components/Camera.js +24 -24
  329. package/libs/floorplan/Components/Compass.js +36 -36
  330. package/libs/floorplan/Components/CurrentFloor.js +65 -74
  331. package/libs/floorplan/Components/Main.js +94 -112
  332. package/libs/floorplan/Components/Normalmage.js +21 -21
  333. package/libs/floorplan/Components/RoomHighlight/Room.js +20 -20
  334. package/libs/floorplan/Components/RoomHighlight/RoomHighlight.js +43 -44
  335. package/libs/floorplan/Components/RoomLabels/RoomLabel.js +60 -59
  336. package/libs/floorplan/Components/RoomLabels/RoomLabels.js +61 -61
  337. package/libs/floorplan/Components/RoomMaterials/RoomMaterial.js +136 -124
  338. package/libs/floorplan/Components/RoomMaterials/RoomMaterial_0.js +21 -21
  339. package/libs/floorplan/Components/RoomMaterials/RoomMaterial_1.js +20 -20
  340. package/libs/floorplan/Components/RoomMaterials/RoomMaterial_2.js +22 -22
  341. package/libs/floorplan/Components/RuleLabels/RuleItem.js +68 -68
  342. package/libs/floorplan/Components/RuleLabels/RuleLabels.js +40 -40
  343. package/libs/floorplan/Components/SvgImage.js +19 -19
  344. package/libs/floorplan/MapviewFloorplanPlugin/Controller.d.ts +1 -1
  345. package/libs/floorplan/MapviewFloorplanPlugin/Controller.js +145 -146
  346. package/libs/floorplan/MapviewFloorplanPlugin/index.js +4 -47
  347. package/libs/floorplan/ModelFloorplanPlugin/Controller.d.ts +1 -1
  348. package/libs/floorplan/ModelFloorplanPlugin/Controller.js +187 -189
  349. package/libs/floorplan/ModelFloorplanPlugin/index.js +4 -47
  350. package/libs/floorplan/PanoFloorplanRadarPlugin/Components/Camera.js +32 -31
  351. package/libs/floorplan/PanoFloorplanRadarPlugin/Components/CurrentFloor/CurrentFloor.js +56 -60
  352. package/libs/floorplan/PanoFloorplanRadarPlugin/Components/CurrentFloor/ExtraObjects.js +29 -29
  353. package/libs/floorplan/PanoFloorplanRadarPlugin/Components/Main.js +75 -83
  354. package/libs/floorplan/PanoFloorplanRadarPlugin/Controller.js +92 -74
  355. package/libs/floorplan/PanoFloorplanRadarPlugin/index.js +4 -24
  356. package/libs/floorplan/TopviewFloorplanPlugin/Controller.d.ts +1 -1
  357. package/libs/floorplan/TopviewFloorplanPlugin/Controller.js +181 -173
  358. package/libs/floorplan/TopviewFloorplanPlugin/index.js +4 -44
  359. package/libs/floorplan/utils/constant.js +1 -2
  360. package/libs/floorplan/utils/correctFiveState.js +48 -30
  361. package/libs/floorplan/utils/formatData.js +58 -36
  362. package/libs/index.js +90 -328
  363. package/libs/node_modules/.pnpm/swiper@8.4.4/node_modules/swiper/components-shared/get-changed-params.js +29 -0
  364. package/libs/node_modules/.pnpm/swiper@8.4.4/node_modules/swiper/components-shared/get-params.js +23 -0
  365. package/libs/node_modules/.pnpm/swiper@8.4.4/node_modules/swiper/components-shared/mount-swiper.js +14 -0
  366. package/libs/node_modules/.pnpm/swiper@8.4.4/node_modules/swiper/components-shared/params-list.js +120 -0
  367. package/libs/node_modules/.pnpm/swiper@8.4.4/node_modules/swiper/components-shared/update-swiper.js +36 -0
  368. package/libs/node_modules/.pnpm/swiper@8.4.4/node_modules/swiper/components-shared/utils.js +32 -0
  369. package/libs/node_modules/.pnpm/swiper@8.4.4/node_modules/swiper/svelte/swiper-slide.js +182 -0
  370. package/libs/node_modules/.pnpm/swiper@8.4.4/node_modules/swiper/svelte/swiper.js +254 -0
  371. package/libs/shared-utils/Object3DHelper/Base/BaseController.js +2 -5
  372. package/libs/shared-utils/Object3DHelper/Controller/CSS3DScaleController.js +5 -16
  373. package/libs/shared-utils/Object3DHelper/Controller/MoveController.js +16 -24
  374. package/libs/shared-utils/Object3DHelper/Controller/RectangleScaleController.d.ts +1 -1
  375. package/libs/shared-utils/Object3DHelper/Controller/RectangleScaleController.js +15 -23
  376. package/libs/shared-utils/Object3DHelper/Controller/RotateController.js +2 -10
  377. package/libs/shared-utils/Object3DHelper/Helper/HTML/rectangleScaleDom.js +27 -29
  378. package/libs/shared-utils/Object3DHelper/Helper/HTML/tipsDom.js +19 -9
  379. package/libs/shared-utils/Object3DHelper/Helper/MoveHelper.js +4 -5
  380. package/libs/shared-utils/Object3DHelper/Helper/OutlineHelper.js +1 -102
  381. package/libs/shared-utils/Object3DHelper/Helper/RectangleScaleHelper.js +8 -14
  382. package/libs/shared-utils/Object3DHelper/Helper/RotateHelper.js +2 -3
  383. package/libs/shared-utils/Object3DHelper/index.js +72 -43
  384. package/libs/shared-utils/Object3DHelper/utils/direction.js +14 -22
  385. package/libs/shared-utils/Object3DHelper/utils/getMouseRaycaster.d.ts +1 -1
  386. package/libs/shared-utils/Object3DHelper/utils/threex/domevents/index.d.ts +34 -0
  387. package/libs/shared-utils/Object3DHelper/utils/threex/domevents/index.js +1 -1
  388. package/libs/shared-utils/Subscribe.js +1 -1
  389. package/libs/shared-utils/animationFrame/BetterTween.js +24 -4
  390. package/libs/shared-utils/animationFrame/calculateProgress.js +3 -9
  391. package/libs/shared-utils/animationFrame/formatRad.js +1 -3
  392. package/libs/shared-utils/animationFrame/index.js +19 -39
  393. package/libs/shared-utils/animationFrame/tween.js +17 -17
  394. package/libs/shared-utils/filter.js +6 -26
  395. package/libs/shared-utils/five/changeMode.js +34 -16
  396. package/libs/shared-utils/index.js +29 -43
  397. package/libs/shared-utils/math/planimetry.d.ts +5 -5
  398. package/libs/shared-utils/math/planimetry.js +34 -121
  399. package/libs/shared-utils/removeArrayItem.d.ts +1 -1
  400. package/libs/shared-utils/three/Assets/index.js +1 -2
  401. package/libs/shared-utils/three/FivePointSelector.d.ts +1 -1
  402. package/libs/shared-utils/three/FivePointSelector.js +12 -26
  403. package/libs/shared-utils/three/Magnifier.d.ts +2 -2
  404. package/libs/shared-utils/three/Magnifier.js +3 -3
  405. package/libs/shared-utils/three/PointDomHelper.js +26 -34
  406. package/libs/shared-utils/three/getIntersect.d.ts +1 -1
  407. package/libs/shared-utils/three/getRaycaster.d.ts +1 -1
  408. package/libs/shared-utils/three/loadTexture.js +25 -7
  409. package/libs/shared-utils/three/transfromToMeshBasicMaterial.js +18 -7
  410. package/libs/shared-utils/to.js +26 -8
  411. package/package.json +45 -28
  412. package/dist/style.css +0 -1
  413. package/docs/assets/icons.css +0 -1043
  414. package/docs/assets/icons.png +0 -0
  415. package/docs/assets/icons@2x.png +0 -0
  416. package/docs/assets/widgets.png +0 -0
  417. package/docs/assets/widgets@2x.png +0 -0
  418. package/docs/interfaces/CSS3DRenderPluginExportType.html +0 -4
  419. package/libs/CSS3DRenderPlugin/typing.js +0 -1
  420. package/libs/CSS3DRenderPlugin/utils/index.js +0 -13
  421. package/libs/CSS3DRenderPlugin/utils/random.js +0 -6
  422. package/libs/CameraMovementPlugin/index.js +0 -15
  423. package/libs/CruisePlugin/typing.js +0 -1
  424. package/libs/GuideLinePlugin/typing.js +0 -1
  425. package/libs/GuideLinePlugin/utils/getPoint.d.ts +0 -3
  426. package/libs/GuideLinePlugin/utils/getPoint.js +0 -18
  427. package/libs/GuideLinePlugin/utils/polyline-normals.d.js +0 -1
  428. package/libs/ItemLabelPlugin/events.type.js +0 -1
  429. package/libs/ModelChassisCompassPlugin/index.js +0 -10
  430. package/libs/ModelEntryDoorGuidePlugin/index.js +0 -11
  431. package/libs/ModelItemLabelPlugin/events.type.js +0 -1
  432. package/libs/ModelRoomLabelPlugin/typings.js +0 -1
  433. package/libs/ModelTVVideoPlugin/index.js +0 -19
  434. package/libs/ModelViewPlugin/index.js +0 -8
  435. package/libs/Object3DHelperPlugin/mocks/addObject3D.d.ts +0 -2
  436. package/libs/Object3DHelperPlugin/mocks/addObject3D.js +0 -1377
  437. package/libs/Object3DHelperPlugin/mocks/objects.d.ts +0 -7
  438. package/libs/Object3DHelperPlugin/mocks/objects.js +0 -47
  439. package/libs/Object3DHelperPlugin/typings.js +0 -1
  440. package/libs/PanoCompassPlugin/typings.js +0 -1
  441. package/libs/PanoDoorLabelPlugin/typings.js +0 -1
  442. package/libs/PanoMeasurePlugin/typings/data.js +0 -1
  443. package/libs/PanoMeasurePlugin/typings/event.type.js +0 -1
  444. package/libs/PanoMeasurePlugin/typings/index.js +0 -1
  445. package/libs/PanoMeasurePlugin/typings/utils.type.d.ts +0 -1
  446. package/libs/PanoMeasurePlugin/typings/utils.type.js +0 -1
  447. package/libs/PanoMeasurePlugin/utils/clearGroup.d.ts +0 -2
  448. package/libs/PanoMeasurePlugin/utils/clearGroup.js +0 -6
  449. package/libs/PanoRulerPlugin/index.js +0 -11
  450. package/libs/PanoRulerPlugin/typings.js +0 -1
  451. package/libs/PanoRulerProPlugin/typings.js +0 -1
  452. package/libs/PanoSpatialTagPlugin/index.js +0 -24
  453. package/libs/PanoSpatialTagPlugin/typings.js +0 -1
  454. package/libs/PanoTagPlugin/Components/Common/TextItem.js +0 -106
  455. package/libs/PanoTagPlugin/typings/controller.js +0 -1
  456. package/libs/PanoTagPlugin/typings/index.js +0 -7
  457. package/libs/PanoTagPlugin/utils/index.js +0 -36
  458. package/libs/TagComputer.2bc444dc.js +0 -315
  459. package/libs/components/index.js +0 -13
  460. package/libs/floorplan/MapviewFloorplanPlugin/typing.js +0 -1
  461. package/libs/floorplan/ModelFloorplanPlugin/typing.js +0 -1
  462. package/libs/floorplan/PanoFloorplanRadarPlugin/typing.js +0 -1
  463. package/libs/floorplan/TopviewFloorplanPlugin/style.d.ts +0 -1
  464. package/libs/floorplan/TopviewFloorplanPlugin/style.js +0 -11
  465. package/libs/floorplan/TopviewFloorplanPlugin/typing.js +0 -1
  466. package/libs/floorplan/index.js +0 -67
  467. package/libs/floorplan/typings/floorplanData.js +0 -1
  468. package/libs/floorplan/typings/index.js +0 -1
  469. package/libs/floorplan/typings/utility.js +0 -1
  470. package/libs/hammer.b5b6115e.js +0 -882
  471. package/libs/index.164f1850.js +0 -641
  472. package/libs/index.5d5d1089.js +0 -34
  473. package/libs/index.6a0eead1.js +0 -12
  474. package/libs/index.ad783a2f.js +0 -31
  475. package/libs/index.dca207cb.js +0 -37
  476. package/libs/index.f2f85d71.js +0 -40
  477. package/libs/shared-utils/Object3DHelper/Helper/index.js +0 -30
  478. package/libs/shared-utils/Object3DHelper/typings/Direction.js +0 -1
  479. package/libs/shared-utils/Object3DHelper/typings/Hooks.js +0 -1
  480. package/libs/shared-utils/Object3DHelper/typings/Scissor.js +0 -1
  481. package/libs/shared-utils/Object3DHelper/typings/index.js +0 -1
  482. package/libs/shared-utils/Object3DHelper/utils/filterNotColinearPoints.js +0 -18
  483. package/libs/shared-utils/Object3DHelper/utils/finiteNumber.d.ts +0 -1
  484. package/libs/shared-utils/Object3DHelper/utils/finiteNumber.js +0 -6
  485. package/libs/shared-utils/Object3DHelper/utils/getPoint.js +0 -18
  486. package/libs/shared-utils/Object3DHelper/utils/index.js +0 -29
  487. package/libs/shared-utils/Object3DHelper/utils/negateScale.d.ts +0 -2
  488. package/libs/shared-utils/Object3DHelper/utils/negateScale.js +0 -7
  489. package/libs/shared-utils/Object3DHelper/utils/normalPositionToPositions.js +0 -13
  490. package/libs/shared-utils/Object3DHelper/utils/object3DBoundingPosition.js +0 -5
  491. package/libs/shared-utils/Object3DHelper/utils/threex/domevents/index.d.js +0 -4
  492. package/libs/shared-utils/Preloader.d.ts +0 -6
  493. package/libs/shared-utils/Preloader.js +0 -18
  494. package/libs/shared-utils/formatRad.d.ts +0 -7
  495. package/libs/shared-utils/formatRad.js +0 -7
  496. package/libs/shared-utils/getRandomColor.d.ts +0 -1
  497. package/libs/shared-utils/getRandomColor.js +0 -6
  498. package/libs/shared-utils/logger.d.ts +0 -16
  499. package/libs/shared-utils/logger.js +0 -27
  500. package/libs/shared-utils/math/evenNumber.d.ts +0 -3
  501. package/libs/shared-utils/math/evenNumber.js +0 -7
  502. package/libs/shared-utils/math/index.js +0 -6
  503. package/libs/shared-utils/px2rem.d.ts +0 -1
  504. package/libs/shared-utils/px2rem.js +0 -6
  505. package/libs/shared-utils/three/getExtraModelLoader.d.ts +0 -6
  506. package/libs/shared-utils/three/getExtraModelLoader.js +0 -18
  507. package/libs/shared-utils/three/getNormal.d.ts +0 -2
  508. package/libs/shared-utils/three/getNormal.js +0 -7
  509. package/libs/shared-utils/three/getTextureLoader.d.ts +0 -6
  510. package/libs/shared-utils/three/getTextureLoader.js +0 -16
  511. package/libs/shared-utils/three/index.js +0 -33
  512. package/libs/shared-utils/three/loadFbxObj.d.ts +0 -2
  513. package/libs/shared-utils/three/loadFbxObj.js +0 -16
  514. package/libs/shared-utils/vectorTocoordinates.d.ts +0 -7
  515. package/libs/shared-utils/vectorTocoordinates.js +0 -10
  516. package/libs/style.css +0 -1
  517. package/libs/tween.esm.bad2b2b4.js +0 -340
  518. package/libs/typings/math.type.js +0 -1
  519. package/libs/typings/utils.type.d.ts +0 -2
  520. package/libs/typings/utils.type.js +0 -1
@@ -1,429 +1,102 @@
1
- var q = Object.defineProperty;
2
- var H = (t, i, e) => i in t ? q(t, i, { enumerable: !0, configurable: !0, writable: !0, value: e }) : t[i] = e;
3
- var g = (t, i, e) => (H(t, typeof i != "symbol" ? i + "" : i, e), e);
4
- function N() {
1
+ var j = Object.defineProperty;
2
+ var M = (o, n, t) => n in o ? j(o, n, { enumerable: !0, configurable: !0, writable: !0, value: t }) : o[n] = t;
3
+ var g = (o, n, t) => (M(o, typeof n != "symbol" ? n + "" : n, t), t);
4
+ import { Tween as W, Easing as $ } from "@tweenjs/tween.js";
5
+ function U() {
5
6
  }
6
- const U = () => Promise.resolve(), F = {
7
+ const S = () => Promise.resolve(), k = {
7
8
  __queue: Promise.resolve()
8
9
  };
9
- function W(t = U) {
10
- F.__queue = F.__queue.then(t).catch(U);
10
+ function q(o = S) {
11
+ k.__queue = k.__queue.then(o).catch(S);
11
12
  }
12
- function I(t, i, e) {
13
- const n = t.x, r = t.y, s = Math.floor(n / i * 1e4) / 1e4, o = Math.floor(r / e * 1e4) / 1e4;
14
- return { x: s, y: o };
13
+ function b(o, n, t) {
14
+ const e = o.x, s = o.y, i = Math.floor(e / n * 1e4) / 1e4, c = Math.floor(s / t * 1e4) / 1e4;
15
+ return { x: i, y: c };
15
16
  }
16
- function R(t, i, e) {
17
- const { x: n, y: r } = t, s = n * i, o = r * e;
18
- return { x: s, y: o };
17
+ function T(o, n, t) {
18
+ const { x: e, y: s } = o, i = e * n, c = s * t;
19
+ return { x: i, y: c };
19
20
  }
20
- function M(t) {
21
- if (t.length < 2)
21
+ function B(o) {
22
+ if (o.length < 2)
22
23
  return {};
23
- const i = t.slice(-2), e = i[0], n = {
24
- x: (i[0].x + i[1].x) / 2,
25
- y: (i[0].y + i[1].y) / 2
24
+ const n = o.slice(-2), t = n[0], e = {
25
+ x: (n[0].x + n[1].x) / 2,
26
+ y: (n[0].y + n[1].y) / 2
26
27
  };
27
- return { control: e, end: n };
28
+ return { control: t, end: e };
28
29
  }
29
- function $(t, i, e = N) {
30
- new Promise((n) => {
30
+ function O(o, n, t = U) {
31
+ new Promise((e) => {
31
32
  setTimeout(() => {
32
- e(), n(!0);
33
- }, i * t);
33
+ t(), e(!0);
34
+ }, n * o);
34
35
  });
35
36
  }
36
- const z = window, j = window.requestAnimationFrame || z.webkitRequestAnimationFrame || ((t) => setTimeout(t, 16));
37
- function D(t, i = 0) {
38
- i <= 0 ? j(t) : j(() => D(t, i - 1));
37
+ const I = window, H = window.requestAnimationFrame || I.webkitRequestAnimationFrame || ((o) => setTimeout(o, 16));
38
+ function D(o, n = 0) {
39
+ n <= 0 ? H(o) : H(() => D(o, n - 1));
39
40
  }
40
- var m = {
41
- Linear: {
42
- None: function(t) {
43
- return t;
44
- }
45
- },
46
- Quadratic: {
47
- In: function(t) {
48
- return t * t;
49
- },
50
- Out: function(t) {
51
- return t * (2 - t);
52
- },
53
- InOut: function(t) {
54
- return (t *= 2) < 1 ? 0.5 * t * t : -0.5 * (--t * (t - 2) - 1);
55
- }
56
- },
57
- Cubic: {
58
- In: function(t) {
59
- return t * t * t;
60
- },
61
- Out: function(t) {
62
- return --t * t * t + 1;
63
- },
64
- InOut: function(t) {
65
- return (t *= 2) < 1 ? 0.5 * t * t * t : 0.5 * ((t -= 2) * t * t + 2);
66
- }
67
- },
68
- Quartic: {
69
- In: function(t) {
70
- return t * t * t * t;
71
- },
72
- Out: function(t) {
73
- return 1 - --t * t * t * t;
74
- },
75
- InOut: function(t) {
76
- return (t *= 2) < 1 ? 0.5 * t * t * t * t : -0.5 * ((t -= 2) * t * t * t - 2);
77
- }
78
- },
79
- Quintic: {
80
- In: function(t) {
81
- return t * t * t * t * t;
82
- },
83
- Out: function(t) {
84
- return --t * t * t * t * t + 1;
85
- },
86
- InOut: function(t) {
87
- return (t *= 2) < 1 ? 0.5 * t * t * t * t * t : 0.5 * ((t -= 2) * t * t * t * t + 2);
88
- }
89
- },
90
- Sinusoidal: {
91
- In: function(t) {
92
- return 1 - Math.cos(t * Math.PI / 2);
93
- },
94
- Out: function(t) {
95
- return Math.sin(t * Math.PI / 2);
96
- },
97
- InOut: function(t) {
98
- return 0.5 * (1 - Math.cos(Math.PI * t));
99
- }
100
- },
101
- Exponential: {
102
- In: function(t) {
103
- return t === 0 ? 0 : Math.pow(1024, t - 1);
104
- },
105
- Out: function(t) {
106
- return t === 1 ? 1 : 1 - Math.pow(2, -10 * t);
107
- },
108
- InOut: function(t) {
109
- return t === 0 ? 0 : t === 1 ? 1 : (t *= 2) < 1 ? 0.5 * Math.pow(1024, t - 1) : 0.5 * (-Math.pow(2, -10 * (t - 1)) + 2);
110
- }
111
- },
112
- Circular: {
113
- In: function(t) {
114
- return 1 - Math.sqrt(1 - t * t);
115
- },
116
- Out: function(t) {
117
- return Math.sqrt(1 - --t * t);
118
- },
119
- InOut: function(t) {
120
- return (t *= 2) < 1 ? -0.5 * (Math.sqrt(1 - t * t) - 1) : 0.5 * (Math.sqrt(1 - (t -= 2) * t) + 1);
121
- }
122
- },
123
- Elastic: {
124
- In: function(t) {
125
- return t === 0 ? 0 : t === 1 ? 1 : -Math.pow(2, 10 * (t - 1)) * Math.sin((t - 1.1) * 5 * Math.PI);
126
- },
127
- Out: function(t) {
128
- return t === 0 ? 0 : t === 1 ? 1 : Math.pow(2, -10 * t) * Math.sin((t - 0.1) * 5 * Math.PI) + 1;
129
- },
130
- InOut: function(t) {
131
- return t === 0 ? 0 : t === 1 ? 1 : (t *= 2, t < 1 ? -0.5 * Math.pow(2, 10 * (t - 1)) * Math.sin((t - 1.1) * 5 * Math.PI) : 0.5 * Math.pow(2, -10 * (t - 1)) * Math.sin((t - 1.1) * 5 * Math.PI) + 1);
132
- }
133
- },
134
- Back: {
135
- In: function(t) {
136
- var i = 1.70158;
137
- return t * t * ((i + 1) * t - i);
138
- },
139
- Out: function(t) {
140
- var i = 1.70158;
141
- return --t * t * ((i + 1) * t + i) + 1;
142
- },
143
- InOut: function(t) {
144
- var i = 2.5949095;
145
- return (t *= 2) < 1 ? 0.5 * (t * t * ((i + 1) * t - i)) : 0.5 * ((t -= 2) * t * ((i + 1) * t + i) + 2);
146
- }
147
- },
148
- Bounce: {
149
- In: function(t) {
150
- return 1 - m.Bounce.Out(1 - t);
151
- },
152
- Out: function(t) {
153
- return t < 1 / 2.75 ? 7.5625 * t * t : t < 2 / 2.75 ? 7.5625 * (t -= 1.5 / 2.75) * t + 0.75 : t < 2.5 / 2.75 ? 7.5625 * (t -= 2.25 / 2.75) * t + 0.9375 : 7.5625 * (t -= 2.625 / 2.75) * t + 0.984375;
154
- },
155
- InOut: function(t) {
156
- return t < 0.5 ? m.Bounce.In(t * 2) * 0.5 : m.Bounce.Out(t * 2 - 1) * 0.5 + 0.5;
157
- }
158
- }
159
- }, T;
160
- typeof self > "u" && typeof process < "u" && process.hrtime ? T = function() {
161
- var t = process.hrtime();
162
- return t[0] * 1e3 + t[1] / 1e6;
163
- } : typeof self < "u" && self.performance !== void 0 && self.performance.now !== void 0 ? T = self.performance.now.bind(self.performance) : Date.now !== void 0 ? T = Date.now : T = function() {
164
- return new Date().getTime();
165
- };
166
- var C = T, X = function() {
167
- function t() {
168
- this._tweens = {}, this._tweensAddedDuringUpdate = {};
169
- }
170
- return t.prototype.getAll = function() {
171
- var i = this;
172
- return Object.keys(this._tweens).map(function(e) {
173
- return i._tweens[e];
174
- });
175
- }, t.prototype.removeAll = function() {
176
- this._tweens = {};
177
- }, t.prototype.add = function(i) {
178
- this._tweens[i.getId()] = i, this._tweensAddedDuringUpdate[i.getId()] = i;
179
- }, t.prototype.remove = function(i) {
180
- delete this._tweens[i.getId()], delete this._tweensAddedDuringUpdate[i.getId()];
181
- }, t.prototype.update = function(i, e) {
182
- i === void 0 && (i = C()), e === void 0 && (e = !1);
183
- var n = Object.keys(this._tweens);
184
- if (n.length === 0)
185
- return !1;
186
- for (; n.length > 0; ) {
187
- this._tweensAddedDuringUpdate = {};
188
- for (var r = 0; r < n.length; r++) {
189
- var s = this._tweens[n[r]], o = !e;
190
- s && s.update(i, o) === !1 && !e && delete this._tweens[n[r]];
191
- }
192
- n = Object.keys(this._tweensAddedDuringUpdate);
193
- }
194
- return !0;
195
- }, t;
196
- }(), S = {
197
- Linear: function(t, i) {
198
- var e = t.length - 1, n = e * i, r = Math.floor(n), s = S.Utils.Linear;
199
- return i < 0 ? s(t[0], t[1], n) : i > 1 ? s(t[e], t[e - 1], e - n) : s(t[r], t[r + 1 > e ? e : r + 1], n - r);
200
- },
201
- Bezier: function(t, i) {
202
- for (var e = 0, n = t.length - 1, r = Math.pow, s = S.Utils.Bernstein, o = 0; o <= n; o++)
203
- e += r(1 - i, n - o) * r(i, o) * t[o] * s(n, o);
204
- return e;
205
- },
206
- CatmullRom: function(t, i) {
207
- var e = t.length - 1, n = e * i, r = Math.floor(n), s = S.Utils.CatmullRom;
208
- return t[0] === t[e] ? (i < 0 && (r = Math.floor(n = e * (1 + i))), s(t[(r - 1 + e) % e], t[r], t[(r + 1) % e], t[(r + 2) % e], n - r)) : i < 0 ? t[0] - (s(t[0], t[0], t[1], t[1], -n) - t[0]) : i > 1 ? t[e] - (s(t[e], t[e], t[e - 1], t[e - 1], n - e) - t[e]) : s(t[r ? r - 1 : 0], t[r], t[e < r + 1 ? e : r + 1], t[e < r + 2 ? e : r + 2], n - r);
209
- },
210
- Utils: {
211
- Linear: function(t, i, e) {
212
- return (i - t) * e + t;
213
- },
214
- Bernstein: function(t, i) {
215
- var e = S.Utils.Factorial;
216
- return e(t) / e(i) / e(t - i);
217
- },
218
- Factorial: function() {
219
- var t = [1];
220
- return function(i) {
221
- var e = 1;
222
- if (t[i])
223
- return t[i];
224
- for (var n = i; n > 1; n--)
225
- e *= n;
226
- return t[i] = e, e;
227
- };
228
- }(),
229
- CatmullRom: function(t, i, e, n, r) {
230
- var s = (e - t) * 0.5, o = (n - i) * 0.5, a = r * r, c = r * a;
231
- return (2 * i - 2 * e + s + o) * c + (-3 * i + 3 * e - 2 * s - o) * a + s * r + i;
232
- }
41
+ function A(o, n, t, e = $.Linear.None) {
42
+ const s = new W(o).to(n, t).easing(e).start();
43
+ function i(c) {
44
+ !s.update(c) || requestAnimationFrame(i);
233
45
  }
234
- }, A = function() {
235
- function t() {
236
- }
237
- return t.nextId = function() {
238
- return t._nextId++;
239
- }, t._nextId = 0, t;
240
- }(), L = new X(), Y = function() {
241
- function t(i, e) {
242
- e === void 0 && (e = L), this._object = i, this._group = e, this._isPaused = !1, this._pauseStart = 0, this._valuesStart = {}, this._valuesEnd = {}, this._valuesStartRepeat = {}, this._duration = 1e3, this._initialRepeat = 0, this._repeat = 0, this._yoyo = !1, this._isPlaying = !1, this._reversed = !1, this._delayTime = 0, this._startTime = 0, this._easingFunction = m.Linear.None, this._interpolationFunction = S.Linear, this._chainedTweens = [], this._onStartCallbackFired = !1, this._id = A.nextId(), this._isChainStopped = !1, this._goToEnd = !1;
243
- }
244
- return t.prototype.getId = function() {
245
- return this._id;
246
- }, t.prototype.isPlaying = function() {
247
- return this._isPlaying;
248
- }, t.prototype.isPaused = function() {
249
- return this._isPaused;
250
- }, t.prototype.to = function(i, e) {
251
- return this._valuesEnd = Object.create(i), e !== void 0 && (this._duration = e), this;
252
- }, t.prototype.duration = function(i) {
253
- return this._duration = i, this;
254
- }, t.prototype.start = function(i) {
255
- if (this._isPlaying)
256
- return this;
257
- if (this._group && this._group.add(this), this._repeat = this._initialRepeat, this._reversed) {
258
- this._reversed = !1;
259
- for (var e in this._valuesStartRepeat)
260
- this._swapEndStartRepeatValues(e), this._valuesStart[e] = this._valuesStartRepeat[e];
261
- }
262
- return this._isPlaying = !0, this._isPaused = !1, this._onStartCallbackFired = !1, this._isChainStopped = !1, this._startTime = i !== void 0 ? typeof i == "string" ? C() + parseFloat(i) : i : C(), this._startTime += this._delayTime, this._setupProperties(this._object, this._valuesStart, this._valuesEnd, this._valuesStartRepeat), this;
263
- }, t.prototype._setupProperties = function(i, e, n, r) {
264
- for (var s in n) {
265
- var o = i[s], a = Array.isArray(o), c = a ? "array" : typeof o, d = !a && Array.isArray(n[s]);
266
- if (!(c === "undefined" || c === "function")) {
267
- if (d) {
268
- var _ = n[s];
269
- if (_.length === 0)
270
- continue;
271
- _ = _.map(this._handleRelativeValue.bind(this, o)), n[s] = [o].concat(_);
272
- }
273
- if ((c === "object" || a) && o && !d) {
274
- e[s] = a ? [] : {};
275
- for (var l in o)
276
- e[s][l] = o[l];
277
- r[s] = a ? [] : {}, this._setupProperties(o, e[s], n[s], r[s]);
278
- } else
279
- typeof e[s] > "u" && (e[s] = o), a || (e[s] *= 1), d ? r[s] = n[s].slice().reverse() : r[s] = e[s] || 0;
280
- }
281
- }
282
- }, t.prototype.stop = function() {
283
- return this._isChainStopped || (this._isChainStopped = !0, this.stopChainedTweens()), this._isPlaying ? (this._group && this._group.remove(this), this._isPlaying = !1, this._isPaused = !1, this._onStopCallback && this._onStopCallback(this._object), this) : this;
284
- }, t.prototype.end = function() {
285
- return this._goToEnd = !0, this.update(1 / 0), this;
286
- }, t.prototype.pause = function(i) {
287
- return i === void 0 && (i = C()), this._isPaused || !this._isPlaying ? this : (this._isPaused = !0, this._pauseStart = i, this._group && this._group.remove(this), this);
288
- }, t.prototype.resume = function(i) {
289
- return i === void 0 && (i = C()), !this._isPaused || !this._isPlaying ? this : (this._isPaused = !1, this._startTime += i - this._pauseStart, this._pauseStart = 0, this._group && this._group.add(this), this);
290
- }, t.prototype.stopChainedTweens = function() {
291
- for (var i = 0, e = this._chainedTweens.length; i < e; i++)
292
- this._chainedTweens[i].stop();
293
- return this;
294
- }, t.prototype.group = function(i) {
295
- return this._group = i, this;
296
- }, t.prototype.delay = function(i) {
297
- return this._delayTime = i, this;
298
- }, t.prototype.repeat = function(i) {
299
- return this._initialRepeat = i, this._repeat = i, this;
300
- }, t.prototype.repeatDelay = function(i) {
301
- return this._repeatDelayTime = i, this;
302
- }, t.prototype.yoyo = function(i) {
303
- return this._yoyo = i, this;
304
- }, t.prototype.easing = function(i) {
305
- return this._easingFunction = i, this;
306
- }, t.prototype.interpolation = function(i) {
307
- return this._interpolationFunction = i, this;
308
- }, t.prototype.chain = function() {
309
- for (var i = [], e = 0; e < arguments.length; e++)
310
- i[e] = arguments[e];
311
- return this._chainedTweens = i, this;
312
- }, t.prototype.onStart = function(i) {
313
- return this._onStartCallback = i, this;
314
- }, t.prototype.onUpdate = function(i) {
315
- return this._onUpdateCallback = i, this;
316
- }, t.prototype.onRepeat = function(i) {
317
- return this._onRepeatCallback = i, this;
318
- }, t.prototype.onComplete = function(i) {
319
- return this._onCompleteCallback = i, this;
320
- }, t.prototype.onStop = function(i) {
321
- return this._onStopCallback = i, this;
322
- }, t.prototype.update = function(i, e) {
323
- if (i === void 0 && (i = C()), e === void 0 && (e = !0), this._isPaused)
324
- return !0;
325
- var n, r, s = this._startTime + this._duration;
326
- if (!this._goToEnd && !this._isPlaying) {
327
- if (i > s)
328
- return !1;
329
- e && this.start(i);
330
- }
331
- if (this._goToEnd = !1, i < this._startTime)
332
- return !0;
333
- this._onStartCallbackFired === !1 && (this._onStartCallback && this._onStartCallback(this._object), this._onStartCallbackFired = !0), r = (i - this._startTime) / this._duration, r = this._duration === 0 || r > 1 ? 1 : r;
334
- var o = this._easingFunction(r);
335
- if (this._updateProperties(this._object, this._valuesStart, this._valuesEnd, o), this._onUpdateCallback && this._onUpdateCallback(this._object, r), r === 1)
336
- if (this._repeat > 0) {
337
- isFinite(this._repeat) && this._repeat--;
338
- for (n in this._valuesStartRepeat)
339
- !this._yoyo && typeof this._valuesEnd[n] == "string" && (this._valuesStartRepeat[n] = this._valuesStartRepeat[n] + parseFloat(this._valuesEnd[n])), this._yoyo && this._swapEndStartRepeatValues(n), this._valuesStart[n] = this._valuesStartRepeat[n];
340
- return this._yoyo && (this._reversed = !this._reversed), this._repeatDelayTime !== void 0 ? this._startTime = i + this._repeatDelayTime : this._startTime = i + this._delayTime, this._onRepeatCallback && this._onRepeatCallback(this._object), !0;
341
- } else {
342
- this._onCompleteCallback && this._onCompleteCallback(this._object);
343
- for (var a = 0, c = this._chainedTweens.length; a < c; a++)
344
- this._chainedTweens[a].start(this._startTime + this._duration);
345
- return this._isPlaying = !1, !1;
346
- }
347
- return !0;
348
- }, t.prototype._updateProperties = function(i, e, n, r) {
349
- for (var s in n)
350
- if (e[s] !== void 0) {
351
- var o = e[s] || 0, a = n[s], c = Array.isArray(i[s]), d = Array.isArray(a), _ = !c && d;
352
- _ ? i[s] = this._interpolationFunction(a, r) : typeof a == "object" && a ? this._updateProperties(i[s], o, a, r) : (a = this._handleRelativeValue(o, a), typeof a == "number" && (i[s] = o + (a - o) * r));
353
- }
354
- }, t.prototype._handleRelativeValue = function(i, e) {
355
- return typeof e != "string" ? e : e.charAt(0) === "+" || e.charAt(0) === "-" ? i + parseFloat(e) : parseFloat(e);
356
- }, t.prototype._swapEndStartRepeatValues = function(i) {
357
- var e = this._valuesStartRepeat[i], n = this._valuesEnd[i];
358
- typeof n == "string" ? this._valuesStartRepeat[i] = this._valuesStartRepeat[i] + parseFloat(n) : this._valuesStartRepeat[i] = this._valuesEnd[i], this._valuesEnd[i] = e;
359
- }, t;
360
- }();
361
- A.nextId;
362
- var v = L;
363
- v.getAll.bind(v);
364
- v.removeAll.bind(v);
365
- v.add.bind(v);
366
- v.remove.bind(v);
367
- v.update.bind(v);
368
- function Q(t, i, e, n = m.Linear.None) {
369
- const r = new Y(t).to(i, e).easing(n).start();
370
- function s(o) {
371
- !r.update(o) || requestAnimationFrame(s);
372
- }
373
- return requestAnimationFrame(s), r;
46
+ return requestAnimationFrame(i), s;
374
47
  }
375
- var w = /* @__PURE__ */ ((t) => (t.Drawline = "Drawline", t.Undo = "Undo", t.Exit = "Exit", t))(w || {});
376
- const E = Symbol("$$PAINT_BRUSH_EVENT$$");
377
- function P(t) {
378
- return t[E] || (t[E] = {}), t[E];
48
+ var v = /* @__PURE__ */ ((o) => (o.Drawline = "Drawline", o.Undo = "Undo", o.Exit = "Exit", o))(v || {});
49
+ const C = Symbol("$$PAINT_BRUSH_EVENT$$");
50
+ function E(o) {
51
+ return o[C] || (o[C] = {}), o[C];
379
52
  }
380
- function G(t) {
381
- t[E] || delete t[E];
53
+ function F(o) {
54
+ o[C] || delete o[C];
382
55
  }
383
- class J {
384
- hasListener(i) {
385
- const e = P(this);
386
- return e && e[i] && e[i].length > 0;
56
+ class P {
57
+ hasListener(n) {
58
+ const t = E(this);
59
+ return t && t[n] && t[n].length > 0;
387
60
  }
388
- on(i, e, n) {
389
- const r = P(this);
390
- return r[i] || (r[i] = []), r[i].push([e, n || !1]), () => this.off(i, e);
61
+ on(n, t, e) {
62
+ const s = E(this);
63
+ return s[n] || (s[n] = []), s[n].push([t, e || !1]), () => this.off(n, t);
391
64
  }
392
- once(i, e) {
393
- return this.on(i, e, !0);
65
+ once(n, t) {
66
+ return this.on(n, t, !0);
394
67
  }
395
- off(i, e) {
396
- if (i === void 0) {
397
- G(this);
68
+ off(n, t) {
69
+ if (n === void 0) {
70
+ F(this);
398
71
  return;
399
72
  }
400
- const n = P(this);
401
- if (n[i] || (n[i] = []), e === void 0) {
402
- n[i].length = 0;
73
+ const e = E(this);
74
+ if (e[n] || (e[n] = []), t === void 0) {
75
+ e[n].length = 0;
403
76
  return;
404
77
  }
405
- let r = 0;
406
- for (; r < n[i].length && n[i][r][0] !== e; r++)
78
+ let s = 0;
79
+ for (; s < e[n].length && e[n][s][0] !== t; s++)
407
80
  ;
408
- r < n[i].length && n[i].splice(r, 1);
409
- }
410
- emit(i, ...e) {
411
- let n = !1;
412
- const s = P(this)[i] || [];
413
- for (let o of s.slice()) {
414
- const [a, c = !1] = o, d = a(...e);
415
- c && this.off(i, a), d === !1 && (n = !0);
81
+ s < e[n].length && e[n].splice(s, 1);
82
+ }
83
+ emit(n, ...t) {
84
+ let e = !1;
85
+ const i = E(this)[n] || [];
86
+ for (let c of i.slice()) {
87
+ const [r, l = !1] = c, f = r(...t);
88
+ l && this.off(n, r), f === !1 && (e = !0);
416
89
  }
417
- return n;
90
+ return e;
418
91
  }
419
92
  }
420
- function y() {
93
+ function m() {
421
94
  return ((1 + Math.random()) * 65536 | 0).toString(16).substring(1);
422
95
  }
423
- function Z() {
424
- return (y() + y() + "-" + y() + "-4" + y().substr(0, 3) + "-" + y() + "-" + y() + y() + y()).toLowerCase();
96
+ function R() {
97
+ return (m() + m() + "-" + m() + "-4" + m().substr(0, 3) + "-" + m() + "-" + m() + m() + m()).toLowerCase();
425
98
  }
426
- const K = `
99
+ const z = `
427
100
  <style type="text/css">
428
101
 
429
102
  #_gl_paintBrush {
@@ -524,21 +197,21 @@ transition: all 500ms;
524
197
 
525
198
  </style>
526
199
  `;
527
- class V extends J {
528
- constructor(e) {
200
+ class X extends P {
201
+ constructor(t) {
529
202
  super();
530
203
  g(this, "configs");
531
204
  g(this, "clientWidth");
532
205
  g(this, "clientHeight");
533
206
  g(this, "ready", !1);
534
- g(this, "uuid", Z());
207
+ g(this, "uuid", R());
535
208
  g(this, "tween");
536
209
  g(this, "tweening", !1);
537
210
  g(this, "container");
538
211
  g(this, "canvas");
539
212
  g(this, "data", {});
540
213
  g(this, "tempLine", {});
541
- this.configs = e, this.clientWidth = document.body.clientWidth, this.clientHeight = document.body.clientHeight, this.container = this.ifInsertToDOM(), this.canvas = {}, this.initCtrl();
214
+ this.configs = t, this.clientWidth = document.body.clientWidth, this.clientHeight = document.body.clientHeight, this.container = this.ifInsertToDOM(), this.canvas = {}, this.initCtrl();
542
215
  }
543
216
  get color() {
544
217
  return this.configs.currentColor;
@@ -557,293 +230,293 @@ class V extends J {
557
230
  else if (document.getElementById("_gl_paintBrush"))
558
231
  this.container = document.getElementById("_gl_paintBrush");
559
232
  else {
560
- const e = document.createElement("div");
561
- e.id = "_gl_paintBrush", document.body.appendChild(e), this.container = e;
233
+ const t = document.createElement("div");
234
+ t.id = "_gl_paintBrush", document.body.appendChild(t), this.container = t;
562
235
  }
563
- return this.container.innerHTML = K, this.container;
236
+ return this.container.innerHTML = z, this.container;
564
237
  }
565
- initCanvas(e) {
566
- const n = document.createElement("canvas");
567
- n.className = e, n.width = this.clientWidth, n.height = this.clientHeight;
568
- const r = n.getContext("2d");
569
- if (!!r)
570
- return r.lineWidth = 5 * this.dpr, r.lineCap = "round", r.lineJoin = "round", this.container.appendChild(n), n;
238
+ initCanvas(t) {
239
+ const e = document.createElement("canvas");
240
+ e.className = t, e.width = this.clientWidth, e.height = this.clientHeight;
241
+ const s = e.getContext("2d");
242
+ if (!!s)
243
+ return s.lineWidth = 5 * this.dpr, s.lineCap = "round", s.lineJoin = "round", this.container.appendChild(e), e;
571
244
  }
572
245
  initCtrl() {
246
+ const t = document.createElement("div");
247
+ t.className = "_paintBrush-ctrl";
573
248
  const e = document.createElement("div");
574
- e.className = "_paintBrush-ctrl";
575
- const n = document.createElement("div");
576
- n.className = "_paintBrush-ctrlinner";
577
- const r = document.createElement("a");
578
- r.className = "_paintBrush-ctrlitem _paintBrush-ctrlitem--undo", r.addEventListener("click", (a) => {
579
- var u;
580
- if (a.stopPropagation(), this.configs.onClickUndo && this.configs.onClickUndo(), !this.canvas[this.uuid] || !this.data[this.uuid] || this.data[this.uuid].length === 0)
249
+ e.className = "_paintBrush-ctrlinner";
250
+ const s = document.createElement("a");
251
+ s.className = "_paintBrush-ctrlitem _paintBrush-ctrlitem--undo", s.addEventListener("click", (r) => {
252
+ var h;
253
+ if (r.stopPropagation(), this.configs.onClickUndo && this.configs.onClickUndo(), !this.canvas[this.uuid] || !this.data[this.uuid] || this.data[this.uuid].length === 0)
581
254
  return;
582
- const c = this.data[this.uuid].pop();
583
- c && this.emitStateChange({
584
- type: w.Undo,
255
+ const l = this.data[this.uuid].pop();
256
+ l && this.emitStateChange({
257
+ type: v.Undo,
585
258
  color: this.color,
586
259
  ready: this.ready,
587
- state: c,
260
+ state: l,
588
261
  uuid: this.uuid
589
262
  });
590
- const d = (u = this.canvas[this.uuid]) == null ? void 0 : u.getContext("2d");
263
+ const f = (h = this.canvas[this.uuid]) == null ? void 0 : h.getContext("2d");
591
264
  if (!this.canvas[this.uuid])
592
265
  return;
593
- const { width: _, height: l } = this.canvas[this.uuid];
594
- d && d.clearRect(0, 0, _, l), this.data[this.uuid].forEach((h) => this.handleDrawLine(this.uuid, h, { withUndo: !0 }));
266
+ const { width: x, height: u } = this.canvas[this.uuid];
267
+ f && f.clearRect(0, 0, x, u), this.data[this.uuid].forEach((a) => this.handleDrawLine(this.uuid, a, { withUndo: !0 }));
595
268
  });
596
- const s = document.createElement("a");
597
- return s.className = "_paintBrush-ctrlitem _paintBrush-ctrlitem--close", s.addEventListener("click", (a) => {
598
- a.stopPropagation(), this.closeBrush(), this.configs.onClickClose && this.configs.onClickClose();
599
- }), [r, s].forEach((a) => {
600
- const c = document.createElement("i");
601
- c.className = "brush-icon";
602
- const d = document.createElement("span");
603
- d.className = "brush-txt", d.innerText = a.className.endsWith("undo") ? this.configs.onUndoText : this.configs.onExitText, a.appendChild(c), a.appendChild(d);
604
- }), n.appendChild(r), n.appendChild(s), e.appendChild(n), this.container.appendChild(e), e;
269
+ const i = document.createElement("a");
270
+ return i.className = "_paintBrush-ctrlitem _paintBrush-ctrlitem--close", i.addEventListener("click", (r) => {
271
+ r.stopPropagation(), this.closeBrush(), this.configs.onClickClose && this.configs.onClickClose();
272
+ }), [s, i].forEach((r) => {
273
+ const l = document.createElement("i");
274
+ l.className = "brush-icon";
275
+ const f = document.createElement("span");
276
+ f.className = "brush-txt", f.innerText = r.className.endsWith("undo") ? this.configs.onUndoText : this.configs.onExitText, r.appendChild(l), r.appendChild(f);
277
+ }), e.appendChild(s), e.appendChild(i), t.appendChild(e), this.container.appendChild(t), t;
605
278
  }
606
279
  openBrush() {
607
280
  if (this.ready)
608
281
  return;
609
282
  this.canvas[this.uuid] || (this.canvas[this.uuid] = this.initCanvas("_paintBrush-canvas")), this.container.className = "brushing";
610
- const e = this.canvas[this.uuid];
611
- e.getContext("2d").clearRect(0, 0, e.width, e.height), this.openBrushHandle(), this.ready = !0, this.emit("readyChange", !0);
283
+ const t = this.canvas[this.uuid];
284
+ t.getContext("2d").clearRect(0, 0, t.width, t.height), this.openBrushHandle(), this.ready = !0, this.emit("readyChange", !0);
612
285
  }
613
286
  closeBrush() {
614
- !this.ready || (this.container.className = "", this.data = {}, this.tempLine = {}, Object.keys(this.canvas).forEach((e) => {
615
- this.canvas[e].ontouchstart = () => !1, this.canvas[e].ontouchmove = () => !1, this.canvas[e].ontouchend = () => !1, this.canvas[e].ontouchcancel = () => !1;
616
- const n = this.canvas[e].getContext("2d");
617
- n && n.clearRect(0, 0, this.canvas[e].width, this.canvas[e].height);
287
+ !this.ready || (this.container.className = "", this.data = {}, this.tempLine = {}, Object.keys(this.canvas).forEach((t) => {
288
+ this.canvas[t].ontouchstart = () => !1, this.canvas[t].ontouchmove = () => !1, this.canvas[t].ontouchend = () => !1, this.canvas[t].ontouchcancel = () => !1;
289
+ const e = this.canvas[t].getContext("2d");
290
+ e && e.clearRect(0, 0, this.canvas[t].width, this.canvas[t].height);
618
291
  }), this.ready = !1, this.emit("readyChange", !1), this.emitStateChange({
619
- type: w.Exit,
292
+ type: v.Exit,
620
293
  color: this.color,
621
294
  ready: !1,
622
295
  uuid: this.uuid
623
296
  }));
624
297
  }
625
- updateCurrentColor(e) {
626
- const n = this.canvas[this.uuid];
627
- if (!n)
298
+ updateCurrentColor(t) {
299
+ const e = this.canvas[this.uuid];
300
+ if (!e)
628
301
  return;
629
- const r = n.getContext("2d");
630
- !r || (this.configs.currentColor = e, r.strokeStyle = e);
302
+ const s = e.getContext("2d");
303
+ !s || (this.configs.currentColor = t, s.strokeStyle = t);
631
304
  }
632
305
  openBrushHandle() {
633
- const e = this.canvas[this.uuid];
634
- if (!e)
306
+ const t = this.canvas[this.uuid];
307
+ if (!t)
635
308
  return;
636
- const n = e.getContext("2d");
637
- if (!n)
309
+ const e = t.getContext("2d");
310
+ if (!e)
638
311
  return;
639
- const r = this.color || "#6D92FF";
640
- n.strokeStyle = r;
641
- let s = null, o = [], a, c = [], d = 0;
642
- const _ = (l, u, h) => {
312
+ const s = this.color || "#6D92FF";
313
+ e.strokeStyle = s;
314
+ let i = null, c = [], r, l = [], f = 0;
315
+ const x = (u, h, a) => {
643
316
  const p = this.color || "#ff0000";
644
- n.strokeStyle = p, n.beginPath(), n.moveTo(l.x, l.y), n.quadraticCurveTo(u.x, u.y, h.x, h.y), n.stroke();
317
+ e.strokeStyle = p, e.beginPath(), e.moveTo(u.x, u.y), e.quadraticCurveTo(h.x, h.y, a.x, a.y), e.stroke();
645
318
  };
646
- e.onmousedown = (l) => {
647
- l.preventDefault(), d = Date.now();
648
- const u = l.clientX, h = l.clientY;
649
- o = [], o.push({ x: u, y: h }), s = { x: u, y: h }, a = I({ x: u, y: h }, this.clientWidth, this.clientHeight), c = [];
650
- }, e.onmousemove = (l) => {
651
- if (l.preventDefault(), !s)
319
+ t.onmousedown = (u) => {
320
+ u.preventDefault(), f = Date.now();
321
+ const h = u.clientX, a = u.clientY;
322
+ c = [], c.push({ x: h, y: a }), i = { x: h, y: a }, r = b({ x: h, y: a }, this.clientWidth, this.clientHeight), l = [];
323
+ }, t.onmousemove = (u) => {
324
+ if (u.preventDefault(), !i)
652
325
  return;
653
- const u = Number(l.clientX), h = Number(l.clientY);
654
- if (Math.abs(u - s.x) < 5 && Math.abs(h - s.y) < 5 || (o.push({ x: u, y: h }), c.push(I({ x: u, y: h }, this.clientWidth, this.clientHeight)), o.length < 3))
326
+ const h = Number(u.clientX), a = Number(u.clientY);
327
+ if (Math.abs(h - i.x) < 5 && Math.abs(a - i.y) < 5 || (c.push({ x: h, y: a }), l.push(b({ x: h, y: a }, this.clientWidth, this.clientHeight)), c.length < 3))
655
328
  return;
656
- const { control: p, end: f } = M(o);
657
- !p || !f || (_(s, p, f), s = f);
658
- }, e.onmouseup = (l) => {
659
- if (l.preventDefault(), s = null, o.length < 3)
329
+ const { control: p, end: d } = B(c);
330
+ !p || !d || (x(i, p, d), i = d);
331
+ }, t.onmouseup = (u) => {
332
+ if (u.preventDefault(), i = null, c.length < 3)
660
333
  return;
661
334
  this.data[this.uuid] || (this.data[this.uuid] = []);
662
- const u = Date.now() - d, h = {
663
- move: Object.assign({}, a),
335
+ const h = Date.now() - f, a = {
336
+ move: Object.assign({}, r),
664
337
  uuid: this.uuid,
665
- line: [...c],
338
+ line: [...l],
666
339
  color: this.color,
667
- duration: u < 1280 ? u : u < 2e3 ? 1280 : 0
340
+ duration: h < 1280 ? h : h < 2e3 ? 1280 : 0
668
341
  };
669
- this.data[this.uuid].push(h), D(() => {
342
+ this.data[this.uuid].push(a), D(() => {
670
343
  this.emitStateChange({
671
- type: w.Drawline,
344
+ type: v.Drawline,
672
345
  color: this.color,
673
346
  ready: this.ready,
674
- state: h,
347
+ state: a,
675
348
  uuid: this.uuid
676
349
  });
677
350
  });
678
- }, e.ontouchstart = (l) => {
679
- l.preventDefault(), d = Date.now();
680
- const u = l.touches[0].clientX, h = l.touches[0].clientY;
681
- o = [], o.push({ x: u, y: h }), s = { x: u, y: h }, console.log("ontouchstart", u, h, s), a = I({ x: u, y: h }, this.clientWidth, this.clientHeight), c = [];
682
- }, e.ontouchmove = (l) => {
683
- if (l.preventDefault(), !s)
351
+ }, t.ontouchstart = (u) => {
352
+ u.preventDefault(), f = Date.now();
353
+ const h = u.touches[0].clientX, a = u.touches[0].clientY;
354
+ c = [], c.push({ x: h, y: a }), i = { x: h, y: a }, console.log("ontouchstart", h, a, i), r = b({ x: h, y: a }, this.clientWidth, this.clientHeight), l = [];
355
+ }, t.ontouchmove = (u) => {
356
+ if (u.preventDefault(), !i)
684
357
  return;
685
- const u = Number(l.touches[0].clientX), h = Number(l.touches[0].clientY);
686
- if (Math.abs(u - s.x) < 5 && Math.abs(h - s.y) < 5 || (o.push({ x: u, y: h }), c.push(I({ x: u, y: h }, this.clientWidth, this.clientHeight)), o.length < 3))
358
+ const h = Number(u.touches[0].clientX), a = Number(u.touches[0].clientY);
359
+ if (Math.abs(h - i.x) < 5 && Math.abs(a - i.y) < 5 || (c.push({ x: h, y: a }), l.push(b({ x: h, y: a }, this.clientWidth, this.clientHeight)), c.length < 3))
687
360
  return;
688
- const { control: p, end: f } = M(o);
689
- !p || !f || (_(s, p, f), s = f);
690
- }, e.ontouchend = e.ontouchcancel = (l) => {
691
- if (l.preventDefault(), s = null, o.length < 3)
361
+ const { control: p, end: d } = B(c);
362
+ !p || !d || (x(i, p, d), i = d);
363
+ }, t.ontouchend = t.ontouchcancel = (u) => {
364
+ if (u.preventDefault(), i = null, c.length < 3)
692
365
  return;
693
366
  this.data[this.uuid] || (this.data[this.uuid] = []);
694
- const u = Date.now() - d, h = {
695
- move: Object.assign({}, a),
696
- line: [...c],
367
+ const h = Date.now() - f, a = {
368
+ move: Object.assign({}, r),
369
+ line: [...l],
697
370
  uuid: this.uuid,
698
371
  color: this.color,
699
- duration: u < 1280 ? u : u < 2e3 ? 1280 : 0
372
+ duration: h < 1280 ? h : h < 2e3 ? 1280 : 0
700
373
  };
701
- this.data[this.uuid].push(h), D(() => {
374
+ this.data[this.uuid].push(a), D(() => {
702
375
  this.emitStateChange({
703
- type: w.Drawline,
376
+ type: v.Drawline,
704
377
  color: this.color,
705
378
  ready: this.ready,
706
- state: h,
379
+ state: a,
707
380
  uuid: this.uuid
708
381
  });
709
382
  });
710
383
  };
711
384
  }
712
- emitStateChange(e, n = !0) {
713
- if (e.type !== w.Drawline) {
714
- this.emit("stateChange", e, n);
385
+ emitStateChange(t, e = !0) {
386
+ if (t.type !== v.Drawline) {
387
+ this.emit("stateChange", t, e);
715
388
  return;
716
389
  }
717
- const r = Date.now(), s = e.state;
718
- if (!s || !s.line)
390
+ const s = Date.now(), i = t.state;
391
+ if (!i || !i.line)
719
392
  return;
720
- const o = Math.ceil(s.line.length / 100);
721
- for (let a = 0; a < o; a++) {
722
- const c = {
393
+ const c = Math.ceil(i.line.length / 100);
394
+ for (let r = 0; r < c; r++) {
395
+ const l = {
723
396
  uuid: this.uuid,
724
397
  color: this.color,
725
398
  ready: this.ready,
726
- type: e.type,
399
+ type: t.type,
727
400
  state: {
728
401
  uuid: this.uuid,
729
- move: s.move,
730
- duration: s.duration,
402
+ move: i.move,
403
+ duration: i.duration,
731
404
  color: this.color,
732
- line: s.line.slice(a * 100, (a + 1) * 100)
405
+ line: i.line.slice(r * 100, (r + 1) * 100)
733
406
  },
734
- timestamp: r,
735
- end: a === o - 1
407
+ timestamp: s,
408
+ end: r === c - 1
736
409
  };
737
- $(a, 20, () => {
738
- this.emit("stateChange", c, n);
410
+ O(r, 20, () => {
411
+ this.emit("stateChange", l, e);
739
412
  });
740
413
  }
741
414
  }
742
- action(e) {
743
- const { ready: n, type: r, uuid: s } = e;
744
- if (!n && this.ready) {
415
+ action(t) {
416
+ const { ready: e, type: s, uuid: i } = t;
417
+ if (!e && this.ready) {
745
418
  this.closeBrush();
746
419
  return;
747
420
  }
748
- if (n && !this.ready) {
421
+ if (e && !this.ready) {
749
422
  this.openBrush();
750
423
  return;
751
424
  }
752
425
  if (!!this.ready)
753
- switch (r) {
754
- case w.Drawline:
755
- const { state: o, timestamp: a, end: c } = e;
756
- if (!a || !o)
426
+ switch (s) {
427
+ case v.Drawline:
428
+ const { state: c, timestamp: r, end: l } = t;
429
+ if (!r || !c)
757
430
  return;
758
- this.tempLine[a] = [].concat(this.tempLine[a] || [], o.line), c && (Object.assign(o, { line: this.tempLine[a] }), this.handleDrawLine(s, o, {}, () => delete this.tempLine[a]));
431
+ this.tempLine[r] = [].concat(this.tempLine[r] || [], c.line), l && (Object.assign(c, { line: this.tempLine[r] }), this.handleDrawLine(i, c, {}, () => delete this.tempLine[r]));
759
432
  break;
760
- case w.Undo:
761
- this.handleUndo(s);
433
+ case v.Undo:
434
+ this.handleUndo(i);
762
435
  break;
763
436
  }
764
437
  }
765
- handleDrawLine(e, n, { withUndo: r = !1 }, s = N) {
766
- !n || Object.prototype.toString.call(n) != "[object Object]" || Object.keys(n).length === 0 || (console.log("handleDrawLine", n, n.line), W(() => new Promise((o) => {
767
- if (r || (this.canvas[e] || (this.canvas[e] = this.initCanvas("_paintBrush-canvas--sync")), this.data[e] || (this.data[e] = []), this.data[e].push(n)), !this.canvas[e])
438
+ handleDrawLine(t, e, { withUndo: s = !1 }, i = U) {
439
+ !e || Object.prototype.toString.call(e) != "[object Object]" || Object.keys(e).length === 0 || (console.log("handleDrawLine", e, e.line), q(() => new Promise((c) => {
440
+ if (s || (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])
768
441
  return;
769
- const a = this.canvas[e].getContext("2d");
770
- if (!a)
442
+ const r = this.canvas[t].getContext("2d");
443
+ if (!r)
771
444
  return;
772
- const { line: c = [], color: d = "black", duration: _ = 0, uuid: l } = n, u = R(n.move || {}, this.clientWidth, this.clientHeight);
773
- let h = [u];
774
- if (a.strokeStyle = d, a.beginPath(), a.moveTo(u.x, u.y), _ && !r) {
445
+ const { line: l = [], color: f = "black", duration: x = 0, uuid: u } = e, h = T(e.move || {}, this.clientWidth, this.clientHeight);
446
+ let a = [h];
447
+ if (r.strokeStyle = f, r.beginPath(), r.moveTo(h.x, h.y), x && !s) {
775
448
  let p = [];
776
- const f = this;
777
- f.tween = Q({ step: 0 }, { step: c.length - 1 }, _).onUpdate(({ step: b }) => {
778
- var k;
779
- if (f.tweening = !0, !f.ready)
780
- return a.clearRect(0, 0, f.canvas[l].width, f.canvas[l].height), (k = f.tween) == null ? void 0 : k.stop();
781
- const x = Math.floor(b);
782
- if (!p.find((B) => B === x)) {
783
- if (p.push(x), console.log("__debug__", c, c[x], x), h.push(R(c[x], f.clientWidth, f.clientHeight)), h.length < 3)
449
+ const d = this;
450
+ d.tween = A({ step: 0 }, { step: l.length - 1 }, x).onUpdate(({ step: y }) => {
451
+ var L;
452
+ if (d.tweening = !0, !d.ready)
453
+ return r.clearRect(0, 0, d.canvas[u].width, d.canvas[u].height), (L = d.tween) == null ? void 0 : L.stop();
454
+ const _ = Math.floor(y);
455
+ if (!p.find((w) => w === _)) {
456
+ if (p.push(_), console.log("__debug__", l, l[_], _), a.push(T(l[_], d.clientWidth, d.clientHeight)), a.length < 3)
784
457
  return;
785
- const { control: B, end: O } = M(h);
786
- if (!B || !O)
458
+ const { control: w, end: N } = B(a);
459
+ if (!w || !N)
787
460
  return;
788
- a.quadraticCurveTo(B.x, B.y, O.x, O.y), a.stroke();
461
+ r.quadraticCurveTo(w.x, w.y, N.x, N.y), r.stroke();
789
462
  }
790
- }).onComplete((b) => {
791
- f.tween = void 0, f.tweening = !1, p = [], h = [], s && s(), o();
463
+ }).onComplete((y) => {
464
+ d.tween = void 0, d.tweening = !1, p = [], a = [], i && i(), c();
792
465
  });
793
466
  } else {
794
- for (let p = 0; p < c.length; p++) {
795
- if (h.push(R(c[p], this.clientWidth, this.clientHeight)), h.length < 3)
467
+ for (let p = 0; p < l.length; p++) {
468
+ if (a.push(T(l[p], this.clientWidth, this.clientHeight)), a.length < 3)
796
469
  continue;
797
- const { control: f, end: b } = M(h);
798
- !f || !b || a.quadraticCurveTo(f.x, f.y, b.x, b.y);
470
+ const { control: d, end: y } = B(a);
471
+ !d || !y || r.quadraticCurveTo(d.x, d.y, y.x, y.y);
799
472
  }
800
- a.stroke(), h = [], s && s(), o();
473
+ r.stroke(), a = [], i && i(), c();
801
474
  }
802
475
  })));
803
476
  }
804
- handleUndo(e) {
805
- if (console.log("handleUndo", e, this.canvas[e]), !this.canvas[e] || !this.data[e] || this.data[e].length === 0)
477
+ handleUndo(t) {
478
+ if (console.log("handleUndo", t, this.canvas[t]), !this.canvas[t] || !this.data[t] || this.data[t].length === 0)
806
479
  return;
807
- this.data[e].pop();
808
- const n = () => {
809
- var s;
810
- const r = (s = this.canvas[e]) == null ? void 0 : s.getContext("2d");
811
- r && r.clearRect(0, 0, this.canvas[e].width, this.canvas[e].height), this.data[e].forEach((o) => this.handleDrawLine(e, o, { withUndo: !0 }));
480
+ this.data[t].pop();
481
+ const e = () => {
482
+ var i;
483
+ const s = (i = this.canvas[t]) == null ? void 0 : i.getContext("2d");
484
+ s && s.clearRect(0, 0, this.canvas[t].width, this.canvas[t].height), this.data[t].forEach((c) => this.handleDrawLine(t, c, { withUndo: !0 }));
812
485
  };
813
486
  if (this.tween && this.tweening) {
814
- this.tween.stop(), D(n, 60);
487
+ this.tween.stop(), D(e, 60);
815
488
  return;
816
489
  }
817
- n();
490
+ e();
818
491
  }
819
492
  destroyBrush() {
820
493
  this.closeBrush(), this.ready = !1, this.emit("readyChange", !0);
821
494
  }
822
495
  }
823
- class et {
824
- constructor(i = {}) {
496
+ class J {
497
+ constructor(n = {}) {
825
498
  g(this, "controller");
826
- const e = Object.assign({
499
+ const t = Object.assign({
827
500
  currentColor: "#f44336",
828
501
  onUndoText: "\u56DE\u9000",
829
502
  onExitText: "\u5173\u95ED"
830
- }, i);
831
- this.controller = new V(e);
503
+ }, n);
504
+ this.controller = new X(t);
832
505
  }
833
- on(i, e) {
834
- this.controller.on(i, e);
506
+ on(n, t) {
507
+ this.controller.on(n, t);
835
508
  }
836
- off(i, e) {
837
- this.controller.off(i, e);
509
+ off(n, t) {
510
+ this.controller.off(n, t);
838
511
  }
839
- once(i, e) {
840
- this.controller.once(i, e);
512
+ once(n, t) {
513
+ this.controller.once(n, t);
841
514
  }
842
515
  show() {
843
516
  this.controller.openBrush();
844
517
  }
845
- action(i) {
846
- this.controller.action(i);
518
+ action(n) {
519
+ this.controller.action(n);
847
520
  }
848
521
  get state() {
849
522
  return this.controller.state;
@@ -854,11 +527,11 @@ class et {
854
527
  dispose() {
855
528
  return this.controller.destroyBrush();
856
529
  }
857
- setCurrentColor(i) {
858
- this.controller.updateCurrentColor(i);
530
+ setCurrentColor(n) {
531
+ this.controller.updateCurrentColor(n);
859
532
  }
860
533
  }
861
534
  export {
862
- et as PaintBrush,
863
- w as PaintBrushTypeEnum
535
+ J as PaintBrush,
536
+ v as PaintBrushTypeEnum
864
537
  };