@realsee/dnalogel 2.1.0 → 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.
- package/components/index.js +242 -569
- package/dist/index.cjs.js +58 -73
- package/dist/index.es.js +7846 -12962
- package/dist/index.js +7846 -12962
- package/dist/index.umd.js +46 -61
- package/docs/assets/highlight.css +3 -3
- package/docs/assets/main.js +4 -2
- package/docs/assets/search.js +1 -1
- package/docs/assets/style.css +462 -619
- package/docs/classes/CruisePluginController.html +397 -23
- package/docs/classes/Magnifier.html +187 -9
- package/docs/classes/ModelRoomLabelController.html +149 -11
- package/docs/classes/Object3DHelperController.html +356 -0
- package/docs/classes/PaintBrush.html +260 -0
- package/docs/classes/PanoTagPluginController.html +940 -0
- package/docs/classes/Util.BetterTween.html +134 -0
- package/docs/classes/Util.FivePointSelector.html +144 -0
- package/docs/classes/Util.Interval.html +158 -0
- package/docs/classes/Util.Magnifier.html +196 -0
- package/docs/classes/Util.PointDomHelper.html +135 -0
- package/docs/classes/Util.PointHelper.html +127 -0
- package/docs/classes/Util.Rectangle.html +181 -0
- package/docs/enums/CameraMovementEffect.html +70 -3
- package/docs/enums/ContentType.html +116 -0
- package/docs/enums/DIRECTION.html +81 -1
- package/docs/enums/DISPLAY_STRATEGY_TYPE.html +81 -1
- package/docs/enums/DimensionType.html +67 -0
- package/docs/enums/FLOOR_PLAN_ATTACHED_TO.html +74 -1
- package/docs/enums/ITEM_LABEL_PLUGIN_DISPLAY_STRATEGY_TYPE.html +81 -1
- package/docs/enums/LinkType.html +67 -0
- package/docs/enums/PaintBrushTypeEnum.html +74 -0
- package/docs/enums/PointType.html +67 -0
- package/docs/enums/Rotation.html +77 -3
- package/docs/functions/CSS3DRenderPlugin.html +233 -0
- package/docs/functions/CameraMovementPlugin.html +237 -0
- package/docs/functions/CruisePlugin.html +233 -0
- package/docs/functions/GuideLinePlugin.html +235 -0
- package/docs/functions/ItemLabelPlugin.html +235 -0
- package/docs/functions/MapviewFloorplanPlugin.html +235 -0
- package/docs/functions/ModelChassisCompassPlugin.html +237 -0
- package/docs/functions/ModelEntryDoorGuidePlugin.html +237 -0
- package/docs/functions/ModelFloorplanPlugin.html +235 -0
- package/docs/functions/ModelItemLabelPlugin.html +235 -0
- package/docs/functions/ModelRoomLabelPlugin.html +233 -0
- package/docs/functions/ModelTVVideoPlugin.html +235 -0
- package/docs/functions/ModelViewPlugin.html +237 -0
- package/docs/functions/Object3DHelperPlugin.html +233 -0
- package/docs/functions/PanoCompassPlugin.html +235 -0
- package/docs/functions/PanoCursorRaycasterPlugin.html +238 -0
- package/docs/functions/PanoDoorLabelPlugin.html +235 -0
- package/docs/functions/PanoFloorplanRadarPlugin.html +235 -0
- package/docs/functions/PanoMeasurePlugin.html +235 -0
- package/docs/functions/PanoRulerPlugin.html +237 -0
- package/docs/functions/PanoRulerProPlugin.html +237 -0
- package/docs/functions/PanoSpatialTagPlugin.html +237 -0
- package/docs/functions/PanoTagPlugin.html +249 -0
- package/docs/functions/TopviewFloorplanPlugin.html +235 -0
- package/docs/functions/Util.getCoordsFromClient.html +78 -0
- package/docs/functions/Util.getCoordsFromElement.html +78 -0
- package/docs/functions/Util.getFrameTime.html +70 -0
- package/docs/functions/Util.getIntersectFromRelativePosition.html +78 -0
- package/docs/functions/Util.getRaycasterFromFivePointer.html +78 -0
- package/docs/functions/Util.isNil.html +79 -0
- package/docs/functions/Util.nextFrame.html +73 -0
- package/docs/functions/Util.notNil.html +78 -0
- package/docs/functions/Util.requestAnimationFrameInterval.html +98 -0
- package/docs/functions/Util.tweenProgress.html +84 -0
- package/docs/functions/pluginFlag.html +233 -0
- package/docs/index.html +220 -2
- package/docs/interfaces/CSS3DRenderPluginEventMap.html +205 -0
- package/docs/interfaces/CSS3DRenderPluginState.html +85 -0
- package/docs/interfaces/CameraMovementPluginExportType.html +111 -17
- package/docs/interfaces/ContentTypeMap.html +212 -0
- package/docs/interfaces/FloorplanBounding.html +89 -10
- package/docs/interfaces/FloorplanData.html +95 -3
- package/docs/interfaces/FloorplanEntrance.html +114 -15
- package/docs/interfaces/FloorplanExtraObject.html +108 -7
- package/docs/interfaces/FloorplanExtraObject3D.html +99 -3
- package/docs/interfaces/FloorplanFloorData.html +88 -3
- package/docs/interfaces/FloorplanImagePosition.html +74 -3
- package/docs/interfaces/FloorplanObserver.html +92 -5
- package/docs/interfaces/FloorplanOutlineItem.html +88 -3
- package/docs/interfaces/FloorplanPosition.html +74 -3
- package/docs/interfaces/FloorplanRoomItem.html +134 -17
- package/docs/interfaces/FloorplanRoomLabelItem.html +78 -7
- package/docs/interfaces/FloorplanServerBounding.html +89 -10
- package/docs/interfaces/FloorplanServerComputedData.html +92 -1
- package/docs/interfaces/FloorplanServerData.html +74 -3
- package/docs/interfaces/FloorplanServerDoorItem.html +92 -1
- package/docs/interfaces/FloorplanServerDoorPosition.html +78 -1
- package/docs/interfaces/FloorplanServerEntrance.html +114 -15
- package/docs/interfaces/FloorplanServerFloorData.html +88 -3
- package/docs/interfaces/FloorplanServerImagePosition.html +74 -3
- package/docs/interfaces/FloorplanServerObserver.html +92 -5
- package/docs/interfaces/FloorplanServerOutlineItem.html +88 -3
- package/docs/interfaces/FloorplanServerPosition.html +74 -3
- package/docs/interfaces/FloorplanServerRoomItem.html +145 -20
- package/docs/interfaces/FloorplanServerRoomLabelItem.html +78 -7
- package/docs/interfaces/ItemLabelPluginData.html +64 -1
- package/docs/interfaces/ItemLabelPluginExportReturnsType.html +149 -1
- package/docs/interfaces/ItemLabelPluginParametersType.html +85 -1
- package/docs/interfaces/LineJson.html +71 -1
- package/docs/interfaces/ModelChassisCompassPluginData.html +71 -1
- package/docs/interfaces/ModelChassisCompassPluginExportType.html +107 -1
- package/docs/interfaces/ModelChassisCompassPluginParameterType.html +71 -1
- package/docs/interfaces/ModelEntryDoorGuidePluginData.html +78 -1
- package/docs/interfaces/ModelEntryDoorGuidePluginExportType.html +115 -1
- package/docs/interfaces/ModelItemLabelPluginData.html +64 -1
- package/docs/interfaces/ModelItemLabelPluginExportReturnsType.html +149 -1
- package/docs/interfaces/ModelItemLabelPluginParametersType.html +71 -1
- package/docs/interfaces/ModelRoomLabelPluginData.html +64 -1
- package/docs/interfaces/ModelTVVideoPluginData.html +85 -1
- package/docs/interfaces/ModelTVVideoPluginExportType.html +109 -1
- package/docs/interfaces/ModelTVVideoPluginParameterType.html +64 -1
- package/docs/interfaces/ModelViewPluginExportType.html +129 -1
- package/docs/interfaces/Object3DHelperState.html +78 -0
- package/docs/interfaces/OpenParameter.html +74 -3
- package/docs/interfaces/PaintBrushAction.html +118 -0
- package/docs/interfaces/PaintBrushConfigs.html +122 -0
- package/docs/interfaces/PaintBrushState.html +99 -0
- package/docs/interfaces/PanoCursorRaycasterPluginExportType.html +186 -11
- package/docs/interfaces/PanoCursorRaycasterPluginParameterType.html +227 -1
- package/docs/interfaces/PanoMeasureParameterType.html +128 -5
- package/docs/interfaces/PanoRulerPluginExportType.html +138 -1
- package/docs/interfaces/PanoRulerPluginOptions.html +87 -1
- package/docs/interfaces/PanoRulerPluginParameterType.html +78 -1
- package/docs/interfaces/PanoRulerProPluginExportType.html +114 -1
- package/docs/interfaces/PanoRulerProPluginOptions.html +84 -1
- package/docs/interfaces/PanoRulerProPluginParameterType.html +71 -1
- package/docs/interfaces/PanoRulerProPluginState.html +78 -1
- package/docs/interfaces/PanoSpatialTagPluginContentEvent.html +241 -1
- package/docs/interfaces/PanoSpatialTagPluginContentReplacement.html +230 -1
- package/docs/interfaces/PanoSpatialTagPluginData.html +114 -1
- package/docs/interfaces/PanoSpatialTagPluginDataElement.html +96 -1
- package/docs/interfaces/PanoSpatialTagPluginExportType.html +192 -1
- package/docs/interfaces/PanoSpatialTagPluginOriginElement.html +92 -1
- package/docs/interfaces/PanoSpatialTagPluginParameterType.html +113 -1
- package/docs/interfaces/PanoSpatialTagPluginPointElement.html +99 -1
- package/docs/interfaces/PanoSpatialTagPluginTagElement.html +92 -1
- package/docs/interfaces/Point.html +78 -1
- package/docs/interfaces/PointJson.html +78 -1
- package/docs/interfaces/Room.html +85 -1
- package/docs/interfaces/RoomInfo.html +71 -1
- package/docs/interfaces/RoomLabel.html +141 -13
- package/docs/interfaces/RoomRules.html +230 -1
- package/docs/interfaces/Rooms.html +230 -1
- package/docs/interfaces/Scissor.html +100 -0
- package/docs/interfaces/TagConfig.html +120 -0
- package/docs/interfaces/Tags.html +89 -0
- package/docs/interfaces/Util.MagnifierParameter.html +116 -0
- package/docs/interfaces/Util.MouseGroupParameter.html +79 -0
- package/docs/modules/Util.html +91 -0
- package/docs/modules.html +425 -36
- package/docs/types/ArrayPosition.html +224 -0
- package/docs/types/CSS3DRenderExportType.html +224 -0
- package/docs/types/CSS3DRenderPluginExportType.html +224 -0
- package/docs/types/CSS3DRenderPluginParameterType.html +224 -0
- package/docs/types/Color.html +224 -0
- package/docs/types/ContentTypeConfigKey.html +224 -0
- package/docs/types/ContentTypeConfigKeyArray.html +224 -0
- package/docs/types/Create3DDomContainerReturnType.html +224 -0
- package/docs/types/Create3DElementReturnType.html +224 -0
- package/docs/types/CruisePluginExportType.html +224 -0
- package/docs/types/Direction-1.html +224 -0
- package/docs/types/Direction4.html +224 -0
- package/docs/types/FloorplanRuleLabels.html +226 -0
- package/docs/types/FloorplanServerRuleLabels.html +224 -0
- package/docs/types/GuideLinePluginExportType.html +224 -0
- package/docs/types/HelperEventMap.html +314 -0
- package/docs/types/MapviewFloorplanPluginParameterType.html +224 -0
- package/docs/types/MapviewFloorplanPluginReturnType.html +224 -0
- package/docs/types/MediaData.html +224 -0
- package/docs/types/ModelEntryDoorGuidePluginParameterType.html +224 -0
- package/docs/types/ModelFloorplanPluginParameterType.html +224 -0
- package/docs/types/ModelFloorplanPluginReturnType.html +224 -0
- package/docs/types/ModelRoomLabelPluginParameters.html +224 -0
- package/docs/types/ModelRoomLabelPluginReturnType.html +224 -0
- package/docs/types/MoveArgs.html +226 -0
- package/docs/types/MoveOpts.html +226 -0
- package/docs/types/Object3DHelperEventMap.html +317 -0
- package/docs/types/ObjectFit.html +224 -0
- package/docs/types/PaintBrushEventMap.html +255 -0
- package/docs/types/PanoCompassPluginData.html +224 -0
- package/docs/types/PanoCompassPluginExportType.html +224 -0
- package/docs/types/PanoCompassPluginParameterType.html +224 -0
- package/docs/types/PanoFloorplanRadarPluginParameterType.html +224 -0
- package/docs/types/PanoFloorplanRadarPluginReturnType.html +224 -0
- package/docs/types/PanoMeasurePluginEvent.html +224 -0
- package/docs/types/PanoMeasureReturnType.html +224 -0
- package/docs/types/PanoSpatialTagPluginId.html +224 -0
- package/docs/types/PanoTagPluginExportInterface.html +224 -0
- package/docs/types/PanoTagPluginParamsInterface.html +224 -0
- package/docs/types/PlaneTag.html +233 -0
- package/docs/types/PointTag.html +235 -0
- package/docs/types/Position.html +224 -0
- package/docs/types/RotateArgs.html +226 -0
- package/docs/types/RotateOpts.html +226 -0
- package/docs/types/RuleLabelsKey.html +224 -0
- package/docs/types/RuleLabelsValue.html +224 -0
- package/docs/types/Tag.html +235 -0
- package/docs/types/Tag2D.html +233 -0
- package/docs/types/Tag3D.html +233 -0
- package/docs/types/TagId.html +224 -0
- package/docs/types/TopviewFloorplanPluginParameterType.html +224 -0
- package/docs/types/TopviewFloorplanPluginReturnType.html +224 -0
- package/docs/variables/FLOOR_TYPE_MAP.html +226 -0
- package/docs/variables/PLUGIN.html +224 -0
- package/docs/variables/ROOM_FETILE_TYPE_MAP.html +226 -0
- package/docs/variables/ROOM_TYPE_MAP.html +226 -0
- package/docs/variables/VERSION.html +224 -0
- package/docs/variables/itemLabelPluginServerParams.html +231 -0
- package/docs/variables/modelItemLabelPluginServerParams.html +231 -0
- package/docs/variables/modelRoomLabelPluginServerParams.html +231 -0
- package/libs/CSS3DRenderPlugin/CSS3DRender.d.ts +2 -2
- package/libs/CSS3DRenderPlugin/CSS3DRender.js +150 -119
- package/libs/CSS3DRenderPlugin/Controller.d.ts +3 -3
- package/libs/CSS3DRenderPlugin/Controller.js +45 -42
- package/libs/CSS3DRenderPlugin/index.js +4 -12
- package/libs/CameraMovementPlugin/CameraMovementPlugin.js +71 -54
- package/libs/CruisePlugin/Controller.js +331 -287
- package/libs/CruisePlugin/index.js +6 -25
- package/libs/CruisePlugin/utils/coordinatesAngle.js +2 -3
- package/libs/CruisePlugin/utils/safeCall.js +21 -5
- package/libs/GuideLinePlugin/Controller.js +94 -62
- package/libs/GuideLinePlugin/index.js +4 -13
- package/libs/GuideLinePlugin/utils/getLineGeometries.js +49 -103
- package/libs/GuideLinePlugin/utils/polyline-normals.d.ts +3 -0
- package/libs/ItemLabelPlugin/ItemLabelComponent.js +200 -183
- package/libs/ItemLabelPlugin/ItemLabelItem.js +27 -27
- package/libs/ItemLabelPlugin/Plugin.js +20 -29
- package/libs/ItemLabelPlugin/index.js +5 -18
- package/libs/ItemLabelPlugin/utils/parseData.js +15 -4
- package/libs/ItemLabelPlugin/utils/transform2RenderData.js +16 -6
- package/libs/ModelChassisCompassPlugin/Plugin.js +54 -38
- package/libs/ModelEntryDoorGuidePlugin/Plugin.js +58 -46
- package/libs/ModelItemLabelPlugin/ItemLabelComponent.js +145 -129
- package/libs/ModelItemLabelPlugin/ItemLabelItem.js +18 -18
- package/libs/ModelItemLabelPlugin/ModelItemLabelPlugin.js +19 -24
- package/libs/ModelItemLabelPlugin/index.js +5 -14
- package/libs/ModelItemLabelPlugin/utils/parseData.js +16 -6
- package/libs/ModelRoomLabelPlugin/Controller.js +2 -6
- package/libs/ModelRoomLabelPlugin/RoomLabelItem.js +22 -22
- package/libs/ModelRoomLabelPlugin/RoomLabelItems.js +105 -94
- package/libs/ModelRoomLabelPlugin/index.js +4 -10
- package/libs/ModelTVVideoPlugin/Plugin.js +101 -94
- package/libs/ModelViewPlugin/Plugin.js +71 -60
- package/libs/Object3DHelperPlugin/Controller.d.ts +1 -1
- package/libs/Object3DHelperPlugin/Controller.js +79 -71
- package/libs/Object3DHelperPlugin/FiveControllerWrapper.d.ts +1 -1
- package/libs/Object3DHelperPlugin/FiveControllerWrapper.js +8 -11
- package/libs/Object3DHelperPlugin/index.js +8 -40
- package/libs/PanoCompassPlugin/Controller.js +91 -72
- package/libs/PanoCompassPlugin/index.js +4 -22
- package/libs/PanoCursorRaycasterPlugin/index.js +8 -9
- package/libs/PanoDoorLabelPlugin/BaseController.js +42 -33
- package/libs/PanoDoorLabelPlugin/Controller.js +84 -80
- package/libs/PanoDoorLabelPlugin/DoorLabelItem.js +16 -16
- package/libs/PanoDoorLabelPlugin/index.d.ts +1 -1
- package/libs/PanoDoorLabelPlugin/index.js +3 -12
- package/libs/PanoDoorLabelPlugin/utils.d.ts +2 -2
- package/libs/PanoMeasurePlugin/Controller/BaseController.js +14 -24
- package/libs/PanoMeasurePlugin/Controller/EditController.js +8 -20
- package/libs/PanoMeasurePlugin/Controller/MixedController.js +15 -28
- package/libs/PanoMeasurePlugin/Controller/ViewController.js +15 -26
- package/libs/PanoMeasurePlugin/Controller/WatchController.js +28 -43
- package/libs/PanoMeasurePlugin/Controller/index.d.ts +1 -1
- package/libs/PanoMeasurePlugin/Controller/index.js +43 -70
- package/libs/PanoMeasurePlugin/Model/index.d.ts +4 -4
- package/libs/PanoMeasurePlugin/Model/index.js +38 -45
- package/libs/PanoMeasurePlugin/Model/line.d.ts +1 -1
- package/libs/PanoMeasurePlugin/Model/line.js +10 -14
- package/libs/PanoMeasurePlugin/Model/polyline.d.ts +2 -2
- package/libs/PanoMeasurePlugin/Modules/Magnifier.js +3 -3
- package/libs/PanoMeasurePlugin/Modules/UIController/style.js +16 -24
- package/libs/PanoMeasurePlugin/Modules/rangePiece/index.js +35 -28
- package/libs/PanoMeasurePlugin/index.js +6 -55
- package/libs/PanoMeasurePlugin/utils/constants.js +29 -16
- package/libs/PanoMeasurePlugin/utils/findClosestPoint.d.ts +1 -1
- package/libs/PanoMeasurePlugin/utils/findClosestPoint.js +4 -5
- package/libs/PanoRulerPlugin/Plugin.js +180 -157
- package/libs/PanoRulerProPlugin/Controller.js +70 -51
- package/libs/PanoRulerProPlugin/RulerItem.js +55 -45
- package/libs/PanoRulerProPlugin/RulerItems.js +124 -125
- package/libs/PanoRulerProPlugin/index.js +4 -15
- package/libs/PanoSpatialTagPlugin/Components/origins.js +24 -25
- package/libs/PanoSpatialTagPlugin/Components/tag.js +23 -23
- package/libs/PanoSpatialTagPlugin/Plugin.js +61 -72
- package/libs/PanoSpatialTagPlugin/store.d.ts +1 -1
- package/libs/PanoSpatialTagPlugin/store.js +1 -2
- package/libs/PanoTagPlugin/Components/Common/Arrow.js +47 -47
- package/libs/PanoTagPlugin/Components/Common/Audio.js +95 -92
- package/libs/PanoTagPlugin/Components/Common/Line/Polyline.js +48 -48
- package/libs/PanoTagPlugin/Components/Common/Line/Straight.js +40 -41
- package/libs/PanoTagPlugin/Components/Common/Media.js +258 -3303
- package/libs/PanoTagPlugin/Components/Common/MediaItem.js +60 -60
- package/libs/PanoTagPlugin/Components/Common/MultiLineText.js +96 -107
- package/libs/PanoTagPlugin/Components/Common/Point/CustomPoint.js +15 -16
- package/libs/PanoTagPlugin/Components/Common/Point/DefaultPoint.js +22 -23
- package/libs/PanoTagPlugin/Components/Common/Point/PointSwitch.js +78 -82
- package/libs/PanoTagPlugin/Components/Common/Shadow.js +51 -52
- package/libs/PanoTagPlugin/Components/Common/Text.js +84 -937
- package/libs/PanoTagPlugin/Components/Tag/AudioTag.js +58 -64
- package/libs/PanoTagPlugin/Components/Tag/CustomTag.js +35 -34
- package/libs/PanoTagPlugin/Components/Tag/ImageTextTag.js +101 -111
- package/libs/PanoTagPlugin/Components/Tag/LinkTag.js +43 -45
- package/libs/PanoTagPlugin/Components/Tag/MarketingTag.js +123 -96
- package/libs/PanoTagPlugin/Components/Tag/MediaPlane.js +36 -44
- package/libs/PanoTagPlugin/Components/Tag/TextTag.js +71 -83
- package/libs/PanoTagPlugin/Components/Tag/index.js +130 -149
- package/libs/PanoTagPlugin/Components/TagContainer.js +69 -100
- package/libs/PanoTagPlugin/Components/TagWrapper.js +86 -116
- package/libs/PanoTagPlugin/controller/TagCacheController.js +2 -3
- package/libs/PanoTagPlugin/controller/TagComputer.d.ts +5 -5
- package/libs/PanoTagPlugin/controller/TagComputer.js +262 -13
- package/libs/PanoTagPlugin/controller/index.js +177 -186
- package/libs/PanoTagPlugin/index.js +7 -69
- package/libs/PanoTagPlugin/utils/checkRange.d.ts +1 -1
- package/libs/PanoTagPlugin/utils/resizeObserver.js +1 -1
- package/libs/PanoTagPlugin/utils/search.js +9 -27
- package/libs/base/BasePluginWithData.js +0 -1
- package/libs/components/PaintBrush/Controller.d.ts +2 -2
- package/libs/components/PaintBrush/Controller.js +3 -4
- package/libs/components/PaintBrush/index.js +2 -9
- package/libs/components/PaintBrush/tween.js +7 -11
- package/libs/components/PaintBrush/utils.d.ts +1 -1
- package/libs/env.d.ts +1 -0
- package/libs/floorplan/Components/BaseImage.js +29 -30
- package/libs/floorplan/Components/Camera.js +24 -24
- package/libs/floorplan/Components/Compass.js +36 -36
- package/libs/floorplan/Components/CurrentFloor.js +65 -74
- package/libs/floorplan/Components/Main.js +94 -112
- package/libs/floorplan/Components/Normalmage.js +21 -21
- package/libs/floorplan/Components/RoomHighlight/Room.js +20 -20
- package/libs/floorplan/Components/RoomHighlight/RoomHighlight.js +43 -44
- package/libs/floorplan/Components/RoomLabels/RoomLabel.js +60 -59
- package/libs/floorplan/Components/RoomLabels/RoomLabels.js +61 -61
- package/libs/floorplan/Components/RoomMaterials/RoomMaterial.js +136 -124
- package/libs/floorplan/Components/RoomMaterials/RoomMaterial_0.js +21 -21
- package/libs/floorplan/Components/RoomMaterials/RoomMaterial_1.js +20 -20
- package/libs/floorplan/Components/RoomMaterials/RoomMaterial_2.js +22 -22
- package/libs/floorplan/Components/RuleLabels/RuleItem.js +68 -68
- package/libs/floorplan/Components/RuleLabels/RuleLabels.js +40 -40
- package/libs/floorplan/Components/SvgImage.js +19 -19
- package/libs/floorplan/MapviewFloorplanPlugin/Controller.d.ts +1 -1
- package/libs/floorplan/MapviewFloorplanPlugin/Controller.js +145 -146
- package/libs/floorplan/MapviewFloorplanPlugin/index.js +4 -47
- package/libs/floorplan/ModelFloorplanPlugin/Controller.d.ts +1 -1
- package/libs/floorplan/ModelFloorplanPlugin/Controller.js +187 -189
- package/libs/floorplan/ModelFloorplanPlugin/index.js +4 -47
- package/libs/floorplan/PanoFloorplanRadarPlugin/Components/Camera.js +32 -31
- package/libs/floorplan/PanoFloorplanRadarPlugin/Components/CurrentFloor/CurrentFloor.js +56 -60
- package/libs/floorplan/PanoFloorplanRadarPlugin/Components/CurrentFloor/ExtraObjects.js +29 -29
- package/libs/floorplan/PanoFloorplanRadarPlugin/Components/Main.js +75 -83
- package/libs/floorplan/PanoFloorplanRadarPlugin/Controller.js +92 -74
- package/libs/floorplan/PanoFloorplanRadarPlugin/index.js +4 -24
- package/libs/floorplan/TopviewFloorplanPlugin/Controller.d.ts +1 -1
- package/libs/floorplan/TopviewFloorplanPlugin/Controller.js +181 -173
- package/libs/floorplan/TopviewFloorplanPlugin/index.js +4 -44
- package/libs/floorplan/utils/constant.js +1 -2
- package/libs/floorplan/utils/correctFiveState.js +48 -30
- package/libs/floorplan/utils/formatData.js +58 -36
- package/libs/index.js +90 -328
- package/libs/node_modules/.pnpm/swiper@8.4.4/node_modules/swiper/components-shared/get-changed-params.js +29 -0
- package/libs/node_modules/.pnpm/swiper@8.4.4/node_modules/swiper/components-shared/get-params.js +23 -0
- package/libs/node_modules/.pnpm/swiper@8.4.4/node_modules/swiper/components-shared/mount-swiper.js +14 -0
- package/libs/node_modules/.pnpm/swiper@8.4.4/node_modules/swiper/components-shared/params-list.js +120 -0
- package/libs/node_modules/.pnpm/swiper@8.4.4/node_modules/swiper/components-shared/update-swiper.js +36 -0
- package/libs/node_modules/.pnpm/swiper@8.4.4/node_modules/swiper/components-shared/utils.js +32 -0
- package/libs/node_modules/.pnpm/swiper@8.4.4/node_modules/swiper/svelte/swiper-slide.js +182 -0
- package/libs/node_modules/.pnpm/swiper@8.4.4/node_modules/swiper/svelte/swiper.js +254 -0
- package/libs/shared-utils/Object3DHelper/Base/BaseController.js +2 -5
- package/libs/shared-utils/Object3DHelper/Controller/CSS3DScaleController.js +5 -16
- package/libs/shared-utils/Object3DHelper/Controller/MoveController.js +16 -24
- package/libs/shared-utils/Object3DHelper/Controller/RectangleScaleController.d.ts +1 -1
- package/libs/shared-utils/Object3DHelper/Controller/RectangleScaleController.js +15 -23
- package/libs/shared-utils/Object3DHelper/Controller/RotateController.js +2 -10
- package/libs/shared-utils/Object3DHelper/Helper/HTML/rectangleScaleDom.js +27 -29
- package/libs/shared-utils/Object3DHelper/Helper/HTML/tipsDom.js +19 -9
- package/libs/shared-utils/Object3DHelper/Helper/MoveHelper.js +4 -5
- package/libs/shared-utils/Object3DHelper/Helper/OutlineHelper.js +1 -102
- package/libs/shared-utils/Object3DHelper/Helper/RectangleScaleHelper.js +8 -14
- package/libs/shared-utils/Object3DHelper/Helper/RotateHelper.js +2 -3
- package/libs/shared-utils/Object3DHelper/index.js +72 -43
- package/libs/shared-utils/Object3DHelper/utils/direction.js +14 -22
- package/libs/shared-utils/Object3DHelper/utils/getMouseRaycaster.d.ts +1 -1
- package/libs/shared-utils/Object3DHelper/utils/threex/domevents/index.d.ts +34 -0
- package/libs/shared-utils/Object3DHelper/utils/threex/domevents/index.js +1 -1
- package/libs/shared-utils/Subscribe.js +1 -1
- package/libs/shared-utils/animationFrame/BetterTween.js +24 -4
- package/libs/shared-utils/animationFrame/calculateProgress.js +3 -9
- package/libs/shared-utils/animationFrame/formatRad.js +1 -3
- package/libs/shared-utils/animationFrame/index.js +19 -39
- package/libs/shared-utils/animationFrame/tween.js +17 -17
- package/libs/shared-utils/filter.js +6 -26
- package/libs/shared-utils/five/changeMode.js +34 -16
- package/libs/shared-utils/index.js +29 -43
- package/libs/shared-utils/math/planimetry.d.ts +5 -5
- package/libs/shared-utils/math/planimetry.js +34 -121
- package/libs/shared-utils/removeArrayItem.d.ts +1 -1
- package/libs/shared-utils/three/Assets/index.js +1 -2
- package/libs/shared-utils/three/FivePointSelector.d.ts +1 -1
- package/libs/shared-utils/three/FivePointSelector.js +12 -26
- package/libs/shared-utils/three/Magnifier.d.ts +2 -2
- package/libs/shared-utils/three/Magnifier.js +3 -3
- package/libs/shared-utils/three/PointDomHelper.js +27 -35
- package/libs/shared-utils/three/PointHelper.js +1 -1
- package/libs/shared-utils/three/getIntersect.d.ts +1 -1
- package/libs/shared-utils/three/getRaycaster.d.ts +1 -1
- package/libs/shared-utils/three/loadTexture.js +25 -7
- package/libs/shared-utils/three/transfromToMeshBasicMaterial.js +18 -7
- package/libs/shared-utils/to.js +26 -8
- package/package.json +45 -28
- package/dist/style.css +0 -1
- package/docs/assets/icons.css +0 -1043
- package/docs/assets/icons.png +0 -0
- package/docs/assets/icons@2x.png +0 -0
- package/docs/assets/widgets.png +0 -0
- package/docs/assets/widgets@2x.png +0 -0
- package/docs/interfaces/CSS3DRenderPluginExportType.html +0 -4
- package/libs/CSS3DRenderPlugin/typing.js +0 -1
- package/libs/CSS3DRenderPlugin/utils/index.js +0 -13
- package/libs/CSS3DRenderPlugin/utils/random.js +0 -6
- package/libs/CameraMovementPlugin/index.js +0 -15
- package/libs/CruisePlugin/typing.js +0 -1
- package/libs/GuideLinePlugin/typing.js +0 -1
- package/libs/GuideLinePlugin/utils/getPoint.d.ts +0 -3
- package/libs/GuideLinePlugin/utils/getPoint.js +0 -18
- package/libs/GuideLinePlugin/utils/polyline-normals.d.js +0 -1
- package/libs/ItemLabelPlugin/events.type.js +0 -1
- package/libs/ModelChassisCompassPlugin/index.js +0 -10
- package/libs/ModelEntryDoorGuidePlugin/index.js +0 -11
- package/libs/ModelItemLabelPlugin/events.type.js +0 -1
- package/libs/ModelRoomLabelPlugin/typings.js +0 -1
- package/libs/ModelTVVideoPlugin/index.js +0 -19
- package/libs/ModelViewPlugin/index.js +0 -8
- package/libs/Object3DHelperPlugin/mocks/addObject3D.d.ts +0 -2
- package/libs/Object3DHelperPlugin/mocks/addObject3D.js +0 -1377
- package/libs/Object3DHelperPlugin/mocks/objects.d.ts +0 -7
- package/libs/Object3DHelperPlugin/mocks/objects.js +0 -47
- package/libs/Object3DHelperPlugin/typings.js +0 -1
- package/libs/PanoCompassPlugin/typings.js +0 -1
- package/libs/PanoDoorLabelPlugin/typings.js +0 -1
- package/libs/PanoMeasurePlugin/typings/data.js +0 -1
- package/libs/PanoMeasurePlugin/typings/event.type.js +0 -1
- package/libs/PanoMeasurePlugin/typings/index.js +0 -1
- package/libs/PanoMeasurePlugin/typings/utils.type.d.ts +0 -1
- package/libs/PanoMeasurePlugin/typings/utils.type.js +0 -1
- package/libs/PanoMeasurePlugin/utils/clearGroup.d.ts +0 -2
- package/libs/PanoMeasurePlugin/utils/clearGroup.js +0 -6
- package/libs/PanoRulerPlugin/index.js +0 -11
- package/libs/PanoRulerPlugin/typings.js +0 -1
- package/libs/PanoRulerProPlugin/typings.js +0 -1
- package/libs/PanoSpatialTagPlugin/index.js +0 -24
- package/libs/PanoSpatialTagPlugin/typings.js +0 -1
- package/libs/PanoTagPlugin/Components/Common/TextItem.js +0 -106
- package/libs/PanoTagPlugin/typings/controller.js +0 -1
- package/libs/PanoTagPlugin/typings/index.js +0 -7
- package/libs/PanoTagPlugin/utils/index.js +0 -36
- package/libs/TagComputer.2bc444dc.js +0 -315
- package/libs/components/index.js +0 -13
- package/libs/floorplan/MapviewFloorplanPlugin/typing.js +0 -1
- package/libs/floorplan/ModelFloorplanPlugin/typing.js +0 -1
- package/libs/floorplan/PanoFloorplanRadarPlugin/typing.js +0 -1
- package/libs/floorplan/TopviewFloorplanPlugin/style.d.ts +0 -1
- package/libs/floorplan/TopviewFloorplanPlugin/style.js +0 -11
- package/libs/floorplan/TopviewFloorplanPlugin/typing.js +0 -1
- package/libs/floorplan/index.js +0 -67
- package/libs/floorplan/typings/floorplanData.js +0 -1
- package/libs/floorplan/typings/index.js +0 -1
- package/libs/floorplan/typings/utility.js +0 -1
- package/libs/hammer.b5b6115e.js +0 -882
- package/libs/index.164f1850.js +0 -641
- package/libs/index.6a0eead1.js +0 -12
- package/libs/index.ad783a2f.js +0 -31
- package/libs/index.dca207cb.js +0 -37
- package/libs/index.f2f85d71.js +0 -40
- package/libs/index.fd12d787.js +0 -34
- package/libs/shared-utils/Object3DHelper/Helper/index.js +0 -30
- package/libs/shared-utils/Object3DHelper/typings/Direction.js +0 -1
- package/libs/shared-utils/Object3DHelper/typings/Hooks.js +0 -1
- package/libs/shared-utils/Object3DHelper/typings/Scissor.js +0 -1
- package/libs/shared-utils/Object3DHelper/typings/index.js +0 -1
- package/libs/shared-utils/Object3DHelper/utils/filterNotColinearPoints.js +0 -18
- package/libs/shared-utils/Object3DHelper/utils/finiteNumber.d.ts +0 -1
- package/libs/shared-utils/Object3DHelper/utils/finiteNumber.js +0 -6
- package/libs/shared-utils/Object3DHelper/utils/getPoint.js +0 -18
- package/libs/shared-utils/Object3DHelper/utils/index.js +0 -29
- package/libs/shared-utils/Object3DHelper/utils/negateScale.d.ts +0 -2
- package/libs/shared-utils/Object3DHelper/utils/negateScale.js +0 -7
- package/libs/shared-utils/Object3DHelper/utils/normalPositionToPositions.js +0 -13
- package/libs/shared-utils/Object3DHelper/utils/object3DBoundingPosition.js +0 -5
- package/libs/shared-utils/Object3DHelper/utils/threex/domevents/index.d.js +0 -4
- package/libs/shared-utils/Preloader.d.ts +0 -6
- package/libs/shared-utils/Preloader.js +0 -18
- package/libs/shared-utils/formatRad.d.ts +0 -7
- package/libs/shared-utils/formatRad.js +0 -7
- package/libs/shared-utils/getRandomColor.d.ts +0 -1
- package/libs/shared-utils/getRandomColor.js +0 -6
- package/libs/shared-utils/logger.d.ts +0 -16
- package/libs/shared-utils/logger.js +0 -27
- package/libs/shared-utils/math/evenNumber.d.ts +0 -3
- package/libs/shared-utils/math/evenNumber.js +0 -7
- package/libs/shared-utils/math/index.js +0 -6
- package/libs/shared-utils/px2rem.d.ts +0 -1
- package/libs/shared-utils/px2rem.js +0 -6
- package/libs/shared-utils/three/getExtraModelLoader.d.ts +0 -6
- package/libs/shared-utils/three/getExtraModelLoader.js +0 -18
- package/libs/shared-utils/three/getNormal.d.ts +0 -2
- package/libs/shared-utils/three/getNormal.js +0 -7
- package/libs/shared-utils/three/getTextureLoader.d.ts +0 -6
- package/libs/shared-utils/three/getTextureLoader.js +0 -16
- package/libs/shared-utils/three/index.js +0 -33
- package/libs/shared-utils/three/loadFbxObj.d.ts +0 -2
- package/libs/shared-utils/three/loadFbxObj.js +0 -16
- package/libs/shared-utils/vectorTocoordinates.d.ts +0 -7
- package/libs/shared-utils/vectorTocoordinates.js +0 -10
- package/libs/style.css +0 -1
- package/libs/tween.esm.bad2b2b4.js +0 -340
- package/libs/typings/math.type.js +0 -1
- package/libs/typings/utils.type.d.ts +0 -2
- package/libs/typings/utils.type.js +0 -1
package/components/index.js
CHANGED
|
@@ -1,429 +1,102 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var g = (
|
|
4
|
-
|
|
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
|
|
7
|
+
const S = () => Promise.resolve(), k = {
|
|
7
8
|
__queue: Promise.resolve()
|
|
8
9
|
};
|
|
9
|
-
function
|
|
10
|
-
|
|
10
|
+
function q(o = S) {
|
|
11
|
+
k.__queue = k.__queue.then(o).catch(S);
|
|
11
12
|
}
|
|
12
|
-
function
|
|
13
|
-
const
|
|
14
|
-
return { x:
|
|
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
|
|
17
|
-
const { x:
|
|
18
|
-
return { x:
|
|
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
|
|
21
|
-
if (
|
|
21
|
+
function B(o) {
|
|
22
|
+
if (o.length < 2)
|
|
22
23
|
return {};
|
|
23
|
-
const
|
|
24
|
-
x: (
|
|
25
|
-
y: (
|
|
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:
|
|
28
|
+
return { control: t, end: e };
|
|
28
29
|
}
|
|
29
|
-
function
|
|
30
|
-
new Promise((
|
|
30
|
+
function O(o, n, t = U) {
|
|
31
|
+
new Promise((e) => {
|
|
31
32
|
setTimeout(() => {
|
|
32
|
-
|
|
33
|
-
},
|
|
33
|
+
t(), e(!0);
|
|
34
|
+
}, n * o);
|
|
34
35
|
});
|
|
35
36
|
}
|
|
36
|
-
const
|
|
37
|
-
function D(
|
|
38
|
-
|
|
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
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
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
|
-
|
|
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
|
|
376
|
-
const
|
|
377
|
-
function
|
|
378
|
-
return
|
|
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
|
|
381
|
-
|
|
53
|
+
function F(o) {
|
|
54
|
+
o[C] || delete o[C];
|
|
382
55
|
}
|
|
383
|
-
class
|
|
384
|
-
hasListener(
|
|
385
|
-
const
|
|
386
|
-
return
|
|
56
|
+
class P {
|
|
57
|
+
hasListener(n) {
|
|
58
|
+
const t = E(this);
|
|
59
|
+
return t && t[n] && t[n].length > 0;
|
|
387
60
|
}
|
|
388
|
-
on(
|
|
389
|
-
const
|
|
390
|
-
return
|
|
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(
|
|
393
|
-
return this.on(
|
|
65
|
+
once(n, t) {
|
|
66
|
+
return this.on(n, t, !0);
|
|
394
67
|
}
|
|
395
|
-
off(
|
|
396
|
-
if (
|
|
397
|
-
|
|
68
|
+
off(n, t) {
|
|
69
|
+
if (n === void 0) {
|
|
70
|
+
F(this);
|
|
398
71
|
return;
|
|
399
72
|
}
|
|
400
|
-
const
|
|
401
|
-
if (n
|
|
402
|
-
n
|
|
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
|
|
406
|
-
for (;
|
|
78
|
+
let s = 0;
|
|
79
|
+
for (; s < e[n].length && e[n][s][0] !== t; s++)
|
|
407
80
|
;
|
|
408
|
-
|
|
409
|
-
}
|
|
410
|
-
emit(
|
|
411
|
-
let
|
|
412
|
-
const
|
|
413
|
-
for (let
|
|
414
|
-
const [
|
|
415
|
-
|
|
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
|
|
90
|
+
return e;
|
|
418
91
|
}
|
|
419
92
|
}
|
|
420
|
-
function
|
|
93
|
+
function m() {
|
|
421
94
|
return ((1 + Math.random()) * 65536 | 0).toString(16).substring(1);
|
|
422
95
|
}
|
|
423
|
-
function
|
|
424
|
-
return (
|
|
96
|
+
function R() {
|
|
97
|
+
return (m() + m() + "-" + m() + "-4" + m().substr(0, 3) + "-" + m() + "-" + m() + m() + m()).toLowerCase();
|
|
425
98
|
}
|
|
426
|
-
const
|
|
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
|
|
528
|
-
constructor(
|
|
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",
|
|
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 =
|
|
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
|
|
561
|
-
|
|
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 =
|
|
236
|
+
return this.container.innerHTML = z, this.container;
|
|
564
237
|
}
|
|
565
|
-
initCanvas(
|
|
566
|
-
const
|
|
567
|
-
|
|
568
|
-
const
|
|
569
|
-
if (!!
|
|
570
|
-
return
|
|
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-
|
|
575
|
-
const
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
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
|
|
583
|
-
|
|
584
|
-
type:
|
|
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:
|
|
260
|
+
state: l,
|
|
588
261
|
uuid: this.uuid
|
|
589
262
|
});
|
|
590
|
-
const
|
|
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:
|
|
594
|
-
|
|
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
|
|
597
|
-
return
|
|
598
|
-
|
|
599
|
-
}), [
|
|
600
|
-
const
|
|
601
|
-
|
|
602
|
-
const
|
|
603
|
-
|
|
604
|
-
}),
|
|
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
|
|
611
|
-
|
|
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((
|
|
615
|
-
this.canvas[
|
|
616
|
-
const
|
|
617
|
-
|
|
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:
|
|
292
|
+
type: v.Exit,
|
|
620
293
|
color: this.color,
|
|
621
294
|
ready: !1,
|
|
622
295
|
uuid: this.uuid
|
|
623
296
|
}));
|
|
624
297
|
}
|
|
625
|
-
updateCurrentColor(
|
|
626
|
-
const
|
|
627
|
-
if (!
|
|
298
|
+
updateCurrentColor(t) {
|
|
299
|
+
const e = this.canvas[this.uuid];
|
|
300
|
+
if (!e)
|
|
628
301
|
return;
|
|
629
|
-
const
|
|
630
|
-
!
|
|
302
|
+
const s = e.getContext("2d");
|
|
303
|
+
!s || (this.configs.currentColor = t, s.strokeStyle = t);
|
|
631
304
|
}
|
|
632
305
|
openBrushHandle() {
|
|
633
|
-
const
|
|
634
|
-
if (!
|
|
306
|
+
const t = this.canvas[this.uuid];
|
|
307
|
+
if (!t)
|
|
635
308
|
return;
|
|
636
|
-
const
|
|
637
|
-
if (!
|
|
309
|
+
const e = t.getContext("2d");
|
|
310
|
+
if (!e)
|
|
638
311
|
return;
|
|
639
|
-
const
|
|
640
|
-
|
|
641
|
-
let
|
|
642
|
-
const
|
|
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
|
-
|
|
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
|
-
|
|
647
|
-
|
|
648
|
-
const
|
|
649
|
-
|
|
650
|
-
},
|
|
651
|
-
if (
|
|
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
|
|
654
|
-
if (Math.abs(
|
|
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:
|
|
657
|
-
!p || !
|
|
658
|
-
},
|
|
659
|
-
if (
|
|
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
|
|
663
|
-
move: Object.assign({},
|
|
335
|
+
const h = Date.now() - f, a = {
|
|
336
|
+
move: Object.assign({}, r),
|
|
664
337
|
uuid: this.uuid,
|
|
665
|
-
line: [...
|
|
338
|
+
line: [...l],
|
|
666
339
|
color: this.color,
|
|
667
|
-
duration:
|
|
340
|
+
duration: h < 1280 ? h : h < 2e3 ? 1280 : 0
|
|
668
341
|
};
|
|
669
|
-
this.data[this.uuid].push(
|
|
342
|
+
this.data[this.uuid].push(a), D(() => {
|
|
670
343
|
this.emitStateChange({
|
|
671
|
-
type:
|
|
344
|
+
type: v.Drawline,
|
|
672
345
|
color: this.color,
|
|
673
346
|
ready: this.ready,
|
|
674
|
-
state:
|
|
347
|
+
state: a,
|
|
675
348
|
uuid: this.uuid
|
|
676
349
|
});
|
|
677
350
|
});
|
|
678
|
-
},
|
|
679
|
-
|
|
680
|
-
const
|
|
681
|
-
|
|
682
|
-
},
|
|
683
|
-
if (
|
|
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
|
|
686
|
-
if (Math.abs(
|
|
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:
|
|
689
|
-
!p || !
|
|
690
|
-
},
|
|
691
|
-
if (
|
|
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
|
|
695
|
-
move: Object.assign({},
|
|
696
|
-
line: [...
|
|
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:
|
|
372
|
+
duration: h < 1280 ? h : h < 2e3 ? 1280 : 0
|
|
700
373
|
};
|
|
701
|
-
this.data[this.uuid].push(
|
|
374
|
+
this.data[this.uuid].push(a), D(() => {
|
|
702
375
|
this.emitStateChange({
|
|
703
|
-
type:
|
|
376
|
+
type: v.Drawline,
|
|
704
377
|
color: this.color,
|
|
705
378
|
ready: this.ready,
|
|
706
|
-
state:
|
|
379
|
+
state: a,
|
|
707
380
|
uuid: this.uuid
|
|
708
381
|
});
|
|
709
382
|
});
|
|
710
383
|
};
|
|
711
384
|
}
|
|
712
|
-
emitStateChange(
|
|
713
|
-
if (
|
|
714
|
-
this.emit("stateChange",
|
|
385
|
+
emitStateChange(t, e = !0) {
|
|
386
|
+
if (t.type !== v.Drawline) {
|
|
387
|
+
this.emit("stateChange", t, e);
|
|
715
388
|
return;
|
|
716
389
|
}
|
|
717
|
-
const
|
|
718
|
-
if (!
|
|
390
|
+
const s = Date.now(), i = t.state;
|
|
391
|
+
if (!i || !i.line)
|
|
719
392
|
return;
|
|
720
|
-
const
|
|
721
|
-
for (let
|
|
722
|
-
const
|
|
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:
|
|
399
|
+
type: t.type,
|
|
727
400
|
state: {
|
|
728
401
|
uuid: this.uuid,
|
|
729
|
-
move:
|
|
730
|
-
duration:
|
|
402
|
+
move: i.move,
|
|
403
|
+
duration: i.duration,
|
|
731
404
|
color: this.color,
|
|
732
|
-
line:
|
|
405
|
+
line: i.line.slice(r * 100, (r + 1) * 100)
|
|
733
406
|
},
|
|
734
|
-
timestamp:
|
|
735
|
-
end:
|
|
407
|
+
timestamp: s,
|
|
408
|
+
end: r === c - 1
|
|
736
409
|
};
|
|
737
|
-
|
|
738
|
-
this.emit("stateChange",
|
|
410
|
+
O(r, 20, () => {
|
|
411
|
+
this.emit("stateChange", l, e);
|
|
739
412
|
});
|
|
740
413
|
}
|
|
741
414
|
}
|
|
742
|
-
action(
|
|
743
|
-
const { ready:
|
|
744
|
-
if (!
|
|
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 (
|
|
421
|
+
if (e && !this.ready) {
|
|
749
422
|
this.openBrush();
|
|
750
423
|
return;
|
|
751
424
|
}
|
|
752
425
|
if (!!this.ready)
|
|
753
|
-
switch (
|
|
754
|
-
case
|
|
755
|
-
const { state:
|
|
756
|
-
if (!
|
|
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[
|
|
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
|
|
761
|
-
this.handleUndo(
|
|
433
|
+
case v.Undo:
|
|
434
|
+
this.handleUndo(i);
|
|
762
435
|
break;
|
|
763
436
|
}
|
|
764
437
|
}
|
|
765
|
-
handleDrawLine(
|
|
766
|
-
!
|
|
767
|
-
if (
|
|
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
|
|
770
|
-
if (!
|
|
442
|
+
const r = this.canvas[t].getContext("2d");
|
|
443
|
+
if (!r)
|
|
771
444
|
return;
|
|
772
|
-
const { line:
|
|
773
|
-
let
|
|
774
|
-
if (
|
|
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
|
|
777
|
-
|
|
778
|
-
var
|
|
779
|
-
if (
|
|
780
|
-
return
|
|
781
|
-
const
|
|
782
|
-
if (!p.find((
|
|
783
|
-
if (p.push(
|
|
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:
|
|
786
|
-
if (!
|
|
458
|
+
const { control: w, end: N } = B(a);
|
|
459
|
+
if (!w || !N)
|
|
787
460
|
return;
|
|
788
|
-
|
|
461
|
+
r.quadraticCurveTo(w.x, w.y, N.x, N.y), r.stroke();
|
|
789
462
|
}
|
|
790
|
-
}).onComplete((
|
|
791
|
-
|
|
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 <
|
|
795
|
-
if (
|
|
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:
|
|
798
|
-
!
|
|
470
|
+
const { control: d, end: y } = B(a);
|
|
471
|
+
!d || !y || r.quadraticCurveTo(d.x, d.y, y.x, y.y);
|
|
799
472
|
}
|
|
800
|
-
|
|
473
|
+
r.stroke(), a = [], i && i(), c();
|
|
801
474
|
}
|
|
802
475
|
})));
|
|
803
476
|
}
|
|
804
|
-
handleUndo(
|
|
805
|
-
if (console.log("handleUndo",
|
|
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[
|
|
808
|
-
const
|
|
809
|
-
var
|
|
810
|
-
const
|
|
811
|
-
|
|
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(
|
|
487
|
+
this.tween.stop(), D(e, 60);
|
|
815
488
|
return;
|
|
816
489
|
}
|
|
817
|
-
|
|
490
|
+
e();
|
|
818
491
|
}
|
|
819
492
|
destroyBrush() {
|
|
820
493
|
this.closeBrush(), this.ready = !1, this.emit("readyChange", !0);
|
|
821
494
|
}
|
|
822
495
|
}
|
|
823
|
-
class
|
|
824
|
-
constructor(
|
|
496
|
+
class J {
|
|
497
|
+
constructor(n = {}) {
|
|
825
498
|
g(this, "controller");
|
|
826
|
-
const
|
|
499
|
+
const t = Object.assign({
|
|
827
500
|
currentColor: "#f44336",
|
|
828
501
|
onUndoText: "\u56DE\u9000",
|
|
829
502
|
onExitText: "\u5173\u95ED"
|
|
830
|
-
},
|
|
831
|
-
this.controller = new
|
|
503
|
+
}, n);
|
|
504
|
+
this.controller = new X(t);
|
|
832
505
|
}
|
|
833
|
-
on(
|
|
834
|
-
this.controller.on(
|
|
506
|
+
on(n, t) {
|
|
507
|
+
this.controller.on(n, t);
|
|
835
508
|
}
|
|
836
|
-
off(
|
|
837
|
-
this.controller.off(
|
|
509
|
+
off(n, t) {
|
|
510
|
+
this.controller.off(n, t);
|
|
838
511
|
}
|
|
839
|
-
once(
|
|
840
|
-
this.controller.once(
|
|
512
|
+
once(n, t) {
|
|
513
|
+
this.controller.once(n, t);
|
|
841
514
|
}
|
|
842
515
|
show() {
|
|
843
516
|
this.controller.openBrush();
|
|
844
517
|
}
|
|
845
|
-
action(
|
|
846
|
-
this.controller.action(
|
|
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(
|
|
858
|
-
this.controller.updateCurrentColor(
|
|
530
|
+
setCurrentColor(n) {
|
|
531
|
+
this.controller.updateCurrentColor(n);
|
|
859
532
|
}
|
|
860
533
|
}
|
|
861
534
|
export {
|
|
862
|
-
|
|
863
|
-
|
|
535
|
+
J as PaintBrush,
|
|
536
|
+
v as PaintBrushTypeEnum
|
|
864
537
|
};
|