@realsee/dnalogel 2.16.0-1 → 2.16.0-11
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 +688 -240
- package/dist/CruisePlugin/index.d.ts +2 -0
- package/dist/CruisePlugin/typing.d.ts +35 -40
- package/dist/GuideLinePlugin/Controller.d.ts +6 -3
- package/dist/GuideLinePlugin/GuideLineItem.d.ts +6 -0
- package/dist/GuideLinePlugin/GuideLineModeItem.d.ts +45 -4
- package/dist/GuideLinePlugin/index.d.ts +2 -1
- package/dist/GuideLinePlugin/typing.d.ts +36 -5
- package/dist/GuideLinePlugin/utils/createLineGeometry.d.ts +5 -1
- package/dist/GuideLinePlugin/utils/index.d.ts +6 -0
- package/dist/PanoTagPlugin/controller/TagComputer.d.ts +1 -0
- package/dist/PanoTagPlugin/controller/TagUtil.d.ts +5 -5
- package/dist/PanoTagPlugin/typings/tag/Utils.d.ts +3 -1
- package/dist/index.cjs.js +119 -87
- package/dist/index.js +17164 -10135
- package/dist/index.umd.js +112 -80
- package/dist/shared-utils/animationFrame/BetterTween.d.ts +3 -2
- package/dist/shared-utils/animationFrame/index.d.ts +1 -1
- package/dist/shared-utils/animationFrame/tween.d.ts +32 -23
- package/dist/shared-utils/five/changeMode.d.ts +2 -4
- package/dist/shared-utils/svelte/resizeObserver.d.ts +2 -10
- package/dist/shared-utils/svelte/resizeObserverGlobal.d.ts +10 -0
- package/docs/assets/search.js +1 -1
- package/docs/classes/CSS3DRender.html +33 -31
- package/docs/classes/CruisePluginController.html +40 -38
- package/docs/classes/GuideLineItem.GuideLineItem.html +57 -23
- package/docs/classes/GuideLineModeItem.GuideLineModeItem.html +246 -49
- package/docs/classes/Magnifier.html +22 -20
- package/docs/classes/ModelRoomLabelController.html +13 -11
- package/docs/classes/Object3DHelperController.html +27 -25
- package/docs/classes/PaintBrush.html +17 -15
- package/docs/classes/PanoMeasurePluginLine.html +25 -23
- package/docs/classes/PanoMeasurePluginModel.html +24 -22
- package/docs/classes/PanoMeasurePluginPoint.html +16 -14
- package/docs/classes/PanoMeasurePluginPolyline.html +28 -26
- package/docs/classes/PanoTagPluginController.html +49 -47
- package/docs/classes/Util.BetterTween.html +31 -18
- package/docs/classes/Util.FivePointSelector.html +14 -12
- package/docs/classes/Util.Interval.html +14 -12
- package/docs/classes/Util.Magnifier.html +19 -17
- package/docs/classes/Util.PointDomHelper.html +13 -11
- package/docs/classes/Util.PointHelper.html +13 -11
- package/docs/classes/Util.Rectangle.html +15 -13
- package/docs/enums/CameraMovementEffect.html +9 -7
- package/docs/enums/ContentType.html +21 -19
- package/docs/enums/DIRECTION.html +11 -9
- package/docs/enums/DISPLAY_STRATEGY_TYPE.html +11 -9
- package/docs/enums/DimensionType.html +9 -7
- package/docs/enums/FLOOR_PLAN_ATTACHED_TO.html +10 -8
- package/docs/enums/ITEM_LABEL_PLUGIN_DISPLAY_STRATEGY_TYPE.html +11 -9
- package/docs/enums/PaintBrushTypeEnum.html +10 -8
- package/docs/enums/Rotation.html +10 -8
- package/docs/functions/CSS3DRenderPlugin.html +6 -4
- package/docs/functions/CameraMovementPlugin.html +6 -4
- package/docs/functions/CruisePlugin.html +6 -4
- package/docs/functions/GuideLinePlugin.html +7 -5
- package/docs/functions/ItemLabelPlugin.html +6 -4
- package/docs/functions/MapviewFloorplanPlugin.html +6 -4
- package/docs/functions/ModelChassisCompassPlugin.html +6 -4
- package/docs/functions/ModelEntryDoorGuidePlugin.html +6 -4
- package/docs/functions/ModelFloorplanPlugin.html +6 -4
- package/docs/functions/ModelItemLabelPlugin.html +6 -4
- package/docs/functions/ModelRoomLabelPlugin.html +6 -4
- package/docs/functions/ModelTVVideoPlugin.html +6 -4
- package/docs/functions/ModelViewPlugin.html +6 -4
- package/docs/functions/Object3DHelperPlugin.html +6 -4
- package/docs/functions/PanoCompassPlugin.html +6 -4
- package/docs/functions/PanoCursorRaycasterPlugin.html +6 -4
- package/docs/functions/PanoDoorLabelPlugin.html +6 -4
- package/docs/functions/PanoFloorplanRadarPlugin.html +6 -4
- package/docs/functions/PanoMeasurePlugin.html +6 -4
- package/docs/functions/PanoRulerPlugin.html +6 -4
- package/docs/functions/PanoRulerProPlugin.html +6 -4
- package/docs/functions/PanoSpatialTagPlugin.html +6 -4
- package/docs/functions/PanoTagPlugin.html +6 -4
- package/docs/functions/PanoVideoPlugin.html +6 -4
- package/docs/functions/TopviewFloorplanPlugin.html +6 -4
- package/docs/functions/Util.getCoordsFromClient.html +7 -5
- package/docs/functions/Util.getCoordsFromElement.html +7 -5
- package/docs/functions/Util.getFrameTime.html +7 -5
- package/docs/functions/Util.getIntersectFromRelativePosition.html +7 -5
- package/docs/functions/Util.getRaycasterFromFivePointer.html +7 -5
- package/docs/functions/Util.isAbsoluteURL.html +7 -5
- package/docs/functions/Util.isModelLike.html +7 -5
- package/docs/functions/Util.isNil.html +7 -5
- package/docs/functions/Util.isPanoramaLike.html +7 -5
- package/docs/functions/Util.nextFrame.html +20 -7
- package/docs/functions/Util.notNil.html +7 -5
- package/docs/functions/Util.requestAnimationFrameInterval.html +7 -5
- package/docs/functions/Util.tweenProgress.html +9 -18
- package/docs/functions/Util.uuid.html +7 -5
- package/docs/functions/pluginFlag.html +7 -5
- package/docs/index.html +6 -4
- package/docs/interfaces/AddTagConfig.html +8 -6
- package/docs/interfaces/CSS3DRenderPluginEventMap.html +13 -11
- package/docs/interfaces/CSS3DRenderPluginState.html +10 -8
- package/docs/interfaces/CameraMovementPluginExportType.html +9 -7
- package/docs/interfaces/CruisePluginTypes.Config.html +107 -0
- package/docs/interfaces/CruisePluginTypes.CruiseKeyframe.html +112 -0
- package/docs/interfaces/CruisePluginTypes.EventMap.html +429 -0
- package/docs/interfaces/CruisePluginTypes.MoveAction.html +129 -0
- package/docs/interfaces/CruisePluginTypes.MoveWithKeyframesAction.html +151 -0
- package/docs/interfaces/CruisePluginTypes.MoveWithPanoIndexAction.html +153 -0
- package/docs/interfaces/CruisePluginTypes.PluginData.html +102 -0
- package/docs/interfaces/CruisePluginTypes.PluginServerData.html +83 -0
- package/docs/interfaces/CruisePluginTypes.PluginState.html +148 -0
- package/docs/interfaces/EventMap.html +17 -15
- package/docs/interfaces/FloorplanBounding.html +10 -8
- package/docs/interfaces/FloorplanData.html +12 -10
- package/docs/interfaces/FloorplanEntrance.html +13 -11
- package/docs/interfaces/FloorplanExtraObject.html +12 -10
- package/docs/interfaces/FloorplanExtraObject3D.html +10 -8
- package/docs/interfaces/FloorplanFloorData.html +11 -9
- package/docs/interfaces/FloorplanImagePosition.html +9 -7
- package/docs/interfaces/FloorplanObserver.html +11 -9
- package/docs/interfaces/FloorplanOutlineItem.html +11 -9
- package/docs/interfaces/FloorplanPosition.html +9 -7
- package/docs/interfaces/FloorplanRoomItem.html +15 -13
- package/docs/interfaces/FloorplanRoomLabelItem.html +9 -7
- package/docs/interfaces/FloorplanServerBounding.html +10 -8
- package/docs/interfaces/FloorplanServerComputedData.html +12 -10
- package/docs/interfaces/FloorplanServerData.html +9 -7
- package/docs/interfaces/FloorplanServerDoorItem.html +12 -10
- package/docs/interfaces/FloorplanServerDoorPosition.html +10 -8
- package/docs/interfaces/FloorplanServerEntrance.html +13 -11
- package/docs/interfaces/FloorplanServerFloorData.html +11 -9
- package/docs/interfaces/FloorplanServerImagePosition.html +9 -7
- package/docs/interfaces/FloorplanServerObserver.html +11 -9
- package/docs/interfaces/FloorplanServerOutlineItem.html +11 -9
- package/docs/interfaces/FloorplanServerPosition.html +9 -7
- package/docs/interfaces/FloorplanServerRoomItem.html +16 -14
- package/docs/interfaces/FloorplanServerRoomLabelItem.html +9 -7
- package/docs/interfaces/GuideLinePluginType.CatmullRomCurve3.html +102 -0
- package/docs/interfaces/GuideLinePluginType.EventMap.html +259 -0
- package/docs/interfaces/GuideLinePluginType.GuideLineGeometryStyle.html +93 -0
- package/docs/interfaces/GuideLinePluginType.GuideLineItemContainer.html +88 -0
- package/docs/interfaces/GuideLinePluginType.GuideLineMaterialStyle.html +127 -0
- package/docs/interfaces/GuideLinePluginType.LineGeometriesConfig.html +86 -0
- package/docs/interfaces/GuideLinePluginType.ModelGuideLineStyle.html +179 -0
- package/docs/interfaces/GuideLinePluginType.ModelGuideLineTag.html +209 -0
- package/docs/interfaces/GuideLinePluginType.PanoramaGuideLineStyle.html +293 -0
- package/docs/interfaces/GuideLinePluginType.PluginDataV1.html +77 -0
- package/docs/interfaces/GuideLinePluginType.PluginDataV2.html +72 -0
- package/docs/interfaces/GuideLinePluginType.PluginServerData.html +83 -0
- package/docs/interfaces/GuideLinePluginType.PluginState.html +93 -0
- package/docs/interfaces/GuideLinePluginType.Route.html +104 -0
- package/docs/interfaces/GuideLinePluginType.RouteConfig.html +93 -0
- package/docs/interfaces/HelperOffset.html +10 -8
- package/docs/interfaces/ImagePlaneGroup.html +8 -6
- package/docs/interfaces/ItemLabelPluginData.html +8 -6
- package/docs/interfaces/ItemLabelPluginExportReturnsType.html +13 -11
- package/docs/interfaces/ItemLabelPluginParametersType.html +11 -9
- package/docs/interfaces/MinMax.html +9 -7
- package/docs/interfaces/ModelChassisCompassPluginData.html +9 -7
- package/docs/interfaces/ModelChassisCompassPluginExportType.html +10 -8
- package/docs/interfaces/ModelChassisCompassPluginParameterType.html +9 -7
- package/docs/interfaces/ModelEntryDoorGuidePluginData.html +10 -8
- package/docs/interfaces/ModelEntryDoorGuidePluginExportType.html +10 -8
- package/docs/interfaces/ModelItemLabelPluginData.html +8 -6
- package/docs/interfaces/ModelItemLabelPluginExportReturnsType.html +13 -11
- package/docs/interfaces/ModelItemLabelPluginParametersType.html +9 -7
- package/docs/interfaces/ModelRoomLabelPluginData.html +8 -6
- package/docs/interfaces/ModelTVVideoPluginData.html +11 -9
- package/docs/interfaces/ModelTVVideoPluginExportType.html +10 -8
- package/docs/interfaces/ModelTVVideoPluginParameterType.html +8 -6
- package/docs/interfaces/ModelViewPluginExportType.html +13 -11
- package/docs/interfaces/Object3DHelperState.html +10 -8
- package/docs/interfaces/ObjectHelperControllers.html +11 -9
- package/docs/interfaces/PaintBrushAction.html +14 -12
- package/docs/interfaces/PaintBrushConfigs.html +14 -12
- package/docs/interfaces/PaintBrushState.html +12 -10
- package/docs/interfaces/PanoCursorRaycasterPluginExportType.html +12 -10
- package/docs/interfaces/PanoCursorRaycasterPluginParameterType.html +7 -5
- package/docs/interfaces/PanoMeasureParameterType.html +16 -14
- package/docs/interfaces/PanoMeasurePluginLineJson.html +10 -8
- package/docs/interfaces/PanoMeasurePluginOpenParameter.html +9 -7
- package/docs/interfaces/PanoMeasurePluginPointJson.html +9 -7
- package/docs/interfaces/PanoMeasurePluginPolylineJson.html +10 -8
- package/docs/interfaces/PanoRulerPluginExportType.html +12 -10
- package/docs/interfaces/PanoRulerPluginOptions.html +9 -7
- package/docs/interfaces/PanoRulerPluginParameterType.html +10 -8
- package/docs/interfaces/PanoRulerProPluginExportType.html +11 -9
- package/docs/interfaces/PanoRulerProPluginOptions.html +9 -7
- package/docs/interfaces/PanoRulerProPluginParameterType.html +9 -7
- package/docs/interfaces/PanoRulerProPluginState.html +10 -8
- package/docs/interfaces/PanoSpatialTagPluginContentEvent.html +7 -5
- package/docs/interfaces/PanoSpatialTagPluginContentReplacement.html +7 -5
- package/docs/interfaces/PanoSpatialTagPluginData.html +13 -11
- package/docs/interfaces/PanoSpatialTagPluginDataElement.html +12 -10
- package/docs/interfaces/PanoSpatialTagPluginExportType.html +15 -13
- package/docs/interfaces/PanoSpatialTagPluginOriginElement.html +12 -10
- package/docs/interfaces/PanoSpatialTagPluginParameterType.html +15 -13
- package/docs/interfaces/PanoSpatialTagPluginPointElement.html +13 -11
- package/docs/interfaces/PanoSpatialTagPluginTagElement.html +12 -10
- package/docs/interfaces/PanoVideoPluginType.LoadParams.html +8 -6
- package/docs/interfaces/PanoVideoPluginType.PanoVideoItem.html +10 -8
- package/docs/interfaces/PanoVideoPluginType.PluginData.html +8 -6
- package/docs/interfaces/PanoVideoPluginType.PluginEventMap.html +17 -15
- package/docs/interfaces/PanoVideoPluginType.PluginState.html +8 -6
- package/docs/interfaces/PanoVideoPluginType.VideoItem.html +10 -8
- package/docs/interfaces/PanoVideoPluginType.VideoMeshParams.html +12 -10
- package/docs/interfaces/Point.html +10 -8
- package/docs/interfaces/Room.html +11 -9
- package/docs/interfaces/RoomInfo.html +9 -7
- package/docs/interfaces/RoomLabel.html +16 -14
- package/docs/interfaces/RoomRules.html +7 -5
- package/docs/interfaces/Rooms.html +7 -5
- package/docs/interfaces/Scissor.html +11 -9
- package/docs/interfaces/State.html +10 -8
- package/docs/interfaces/TagCacheInterface.html +14 -12
- package/docs/interfaces/TagConfig.html +13 -11
- package/docs/interfaces/TagGLTFObjectGroup.html +8 -6
- package/docs/interfaces/TagIconUrl.html +28 -17
- package/docs/interfaces/TagObjectGroup.html +8 -6
- package/docs/interfaces/TagStyle.html +8 -6
- package/docs/interfaces/Tags.html +11 -9
- package/docs/interfaces/TemporaryState.html +8 -6
- package/docs/interfaces/Util.MagnifierParameter.html +13 -11
- package/docs/interfaces/Util.MouseGroupParameter.html +10 -8
- package/docs/modules/CruisePluginTypes.html +88 -0
- package/docs/modules/GuideLineItem.html +7 -5
- package/docs/modules/GuideLineModeItem.html +7 -5
- package/docs/modules/GuideLinePluginType.html +108 -0
- package/docs/modules/PanoVideoPluginType.html +7 -5
- package/docs/modules/Util.html +7 -5
- package/docs/modules.html +9 -5
- package/docs/types/ArrayPosition.html +7 -5
- package/docs/types/AudioAppearance.html +7 -5
- package/docs/types/AudioTagTypeConfigKey.html +7 -5
- package/docs/types/CSS3DRenderExportType.html +7 -5
- package/docs/types/CSS3DRenderPluginExportType.html +7 -5
- package/docs/types/CSS3DRenderPluginParameterType.html +7 -5
- package/docs/types/ClassFunctionParameters.html +7 -5
- package/docs/types/Color.html +7 -5
- package/docs/types/ContentTypeConfigKey.html +7 -5
- package/docs/types/ContentTypeConfigKeySplit.html +7 -5
- package/docs/types/ContentTypeMap.html +7 -5
- package/docs/types/Create3DDomContainerReturnType.html +7 -5
- package/docs/types/Create3DElementReturnType.html +7 -5
- package/docs/types/CruisePluginExportType.html +7 -5
- package/docs/types/CruisePluginTypes.CruiseData.html +60 -0
- package/docs/types/CruisePluginTypes.MoveEffect.html +60 -0
- package/docs/types/Direction-1.html +7 -5
- package/docs/types/Direction4.html +7 -5
- package/docs/types/FloorplanRuleLabels.html +7 -5
- package/docs/types/FloorplanServerRuleLabels.html +7 -5
- package/docs/types/GuideLinePluginExportType.html +7 -5
- package/docs/types/GuideLinePluginType.GuideLineItem.html +72 -0
- package/docs/types/GuideLinePluginType.GuideLineItemEventMap.html +105 -0
- package/docs/types/GuideLinePluginType.GuideLineModeItemMode.html +70 -0
- package/docs/types/GuideLinePluginType.GuideLineStyle.html +72 -0
- package/docs/types/GuideLinePluginType.PathItem.html +72 -0
- package/docs/types/GuideLinePluginType.PluginData.html +70 -0
- package/docs/types/HelperEventMap.html +7 -5
- package/docs/types/LoadTagConfig.html +7 -5
- package/docs/types/MapviewFloorplanPluginParameterType.html +7 -5
- package/docs/types/MapviewFloorplanPluginReturnType.html +7 -5
- package/docs/types/MediaData.html +7 -5
- package/docs/types/MediaStore.html +7 -5
- package/docs/types/ModelElement.html +7 -5
- package/docs/types/ModelEntryDoorGuidePluginParameterType.html +7 -5
- package/docs/types/ModelFloorplanPluginParameterType.html +7 -5
- package/docs/types/ModelFloorplanPluginReturnType.html +7 -5
- package/docs/types/ModelRoomLabelPluginParameters.html +7 -5
- package/docs/types/ModelRoomLabelPluginReturnType.html +7 -5
- package/docs/types/MoveArgs.html +7 -5
- package/docs/types/MoveOpts.html +7 -5
- package/docs/types/Object3DHelperEventMap.html +7 -5
- package/docs/types/ObjectFit.html +7 -5
- package/docs/types/PaintBrushEventMap.html +7 -5
- package/docs/types/PanoCompassPluginData.html +7 -5
- package/docs/types/PanoCompassPluginExportType.html +7 -5
- package/docs/types/PanoCompassPluginParameterType.html +7 -5
- package/docs/types/PanoFloorplanRadarPluginParameterType.html +7 -5
- package/docs/types/PanoFloorplanRadarPluginReturnType.html +7 -5
- package/docs/types/PanoIndex.html +7 -5
- package/docs/types/PanoMeasurePluginEvent.html +7 -5
- package/docs/types/PanoMeasureReturnType.html +7 -5
- package/docs/types/PanoSpatialTagPluginId.html +7 -5
- package/docs/types/PanoTagPluginExportInterface.html +7 -5
- package/docs/types/PanoTagPluginParamsInterface.html +7 -5
- package/docs/types/PanoVideoPluginParameterType.html +7 -5
- package/docs/types/PanoVideoPluginReturnType.html +7 -5
- package/docs/types/PlaneTag.html +7 -5
- package/docs/types/PlaneTagElement.html +7 -5
- package/docs/types/Point2DElement.html +7 -5
- package/docs/types/Point2DTag.html +7 -5
- package/docs/types/Point3DElement.html +7 -5
- package/docs/types/Point3DTag.html +7 -5
- package/docs/types/PointTag.html +7 -5
- package/docs/types/PointTagElement.html +7 -5
- package/docs/types/Position.html +7 -5
- package/docs/types/RotateArgs.html +7 -5
- package/docs/types/RotateOpts.html +7 -5
- package/docs/types/RuleLabelsKey.html +7 -5
- package/docs/types/RuleLabelsValue.html +7 -5
- package/docs/types/StickType.html +7 -5
- package/docs/types/Tag.html +7 -5
- package/docs/types/Tag2D.html +7 -5
- package/docs/types/Tag3D.html +7 -5
- package/docs/types/TagContentType.html +7 -5
- package/docs/types/TagDimensionType.html +7 -5
- package/docs/types/TagElement.html +7 -5
- package/docs/types/TagEvents.html +7 -5
- package/docs/types/TagGLTFObject.html +7 -5
- package/docs/types/TagHooks.html +7 -5
- package/docs/types/TagIconSize.html +7 -5
- package/docs/types/TagId.html +7 -5
- package/docs/types/TopviewFloorplanPluginParameterType.html +7 -5
- package/docs/types/TopviewFloorplanPluginReturnType.html +7 -5
- package/docs/types/WorkCode.html +7 -5
- package/docs/variables/FLOOR_TYPE_MAP.html +7 -5
- package/docs/variables/PLUGIN.html +7 -5
- package/docs/variables/ROOM_FETILE_TYPE_MAP.html +7 -5
- package/docs/variables/ROOM_TYPE_MAP.html +7 -5
- package/docs/variables/itemLabelPluginServerParams.html +7 -5
- package/docs/variables/modelItemLabelPluginServerParams.html +7 -5
- package/docs/variables/modelRoomLabelPluginServerParams.html +7 -5
- package/libs/CSS3DRenderPlugin/Controller.js +47 -13
- package/libs/CSS3DRenderPlugin/index.js +6 -8
- package/libs/CSS3DRenderPlugin/utils/even.js +1 -1
- package/libs/CSS3DRenderPlugin/utils/three/CSS3DObject.js +3 -0
- package/libs/CSS3DRenderPlugin/utils/three/CSS3DRender.js +37 -2
- package/libs/CSS3DRenderPlugin/utils/three/CSS3DRenderer.js +1 -1
- package/libs/CameraMovementPlugin/CameraMovementPlugin.js +22 -18
- package/libs/CameraMovementPlugin/index.js +7 -9
- package/libs/CruisePlugin/Controller.js +350 -135
- package/libs/CruisePlugin/index.d.ts +2 -0
- package/libs/CruisePlugin/index.js +123 -11
- package/libs/CruisePlugin/typing/index.js +6 -0
- package/libs/CruisePlugin/typing.d.ts +35 -40
- package/libs/CruisePlugin/utils/coordinatesToVector.js +3 -0
- package/libs/GuideLinePlugin/Components/Tag.js +50 -0
- package/libs/GuideLinePlugin/Controller.d.ts +6 -3
- package/libs/GuideLinePlugin/Controller.js +237 -103
- package/libs/GuideLinePlugin/GuideLineItem/index.js +109 -22
- package/libs/GuideLinePlugin/GuideLineItem.d.ts +6 -0
- package/libs/GuideLinePlugin/GuideLineItem.js +134 -7
- package/libs/GuideLinePlugin/GuideLineModeItem/index.js +192 -69
- package/libs/GuideLinePlugin/GuideLineModeItem.d.ts +45 -4
- package/libs/GuideLinePlugin/GuideLineModeItem.js +116 -4
- package/libs/GuideLinePlugin/index.d.ts +2 -1
- package/libs/GuideLinePlugin/index.js +133 -13
- package/libs/GuideLinePlugin/typing.d.ts +36 -5
- package/libs/GuideLinePlugin/typing.js +32 -1
- package/libs/GuideLinePlugin/utils/createLineGeometry.d.ts +5 -1
- package/libs/GuideLinePlugin/utils/createLineGeometry.js +40 -26
- package/libs/GuideLinePlugin/utils/getPoint.js +4 -0
- package/libs/GuideLinePlugin/utils/index.d.ts +6 -0
- package/libs/GuideLinePlugin/utils/index.js +30 -10
- package/libs/ItemLabelPlugin/ItemLabelComponent.js +83 -34
- package/libs/ItemLabelPlugin/ItemLabelItem.js +91 -14
- package/libs/ItemLabelPlugin/Plugin.js +2 -2
- package/libs/ItemLabelPlugin/index.js +8 -9
- package/libs/ModelChassisCompassPlugin/Plugin.js +25 -25
- package/libs/ModelChassisCompassPlugin/index.js +3 -4
- package/libs/ModelEntryDoorGuidePlugin/Plugin.js +14 -14
- package/libs/ModelEntryDoorGuidePlugin/index.js +3 -4
- package/libs/ModelItemLabelPlugin/ItemLabelComponent.js +46 -10
- package/libs/ModelItemLabelPlugin/ItemLabelItem.js +60 -7
- package/libs/ModelItemLabelPlugin/ModelItemLabelPlugin.js +3 -3
- package/libs/ModelItemLabelPlugin/index.js +6 -7
- package/libs/ModelRoomLabelPlugin/Controller.js +18 -1
- package/libs/ModelRoomLabelPlugin/RoomLabelItem.js +58 -4
- package/libs/ModelRoomLabelPlugin/RoomLabelItems.js +50 -20
- package/libs/ModelTVVideoPlugin/Plugin.js +6 -8
- package/libs/ModelTVVideoPlugin/index.js +6 -9
- package/libs/ModelViewPlugin/Plugin.js +3 -3
- package/libs/ModelViewPlugin/index.js +3 -4
- package/libs/Object3DHelperPlugin/Controller.js +62 -42
- package/libs/Object3DHelperPlugin/FiveControllerWrapper.js +2 -1
- package/libs/Object3DHelperPlugin/index.js +7 -9
- package/libs/PanoCompassPlugin/Controller.js +54 -4
- package/libs/PanoCompassPlugin/getRoomInfoInstance.js +1 -1
- package/libs/PanoCompassPlugin/index.js +3 -3
- package/libs/PanoDoorLabelPlugin/BaseController.js +37 -12
- package/libs/PanoDoorLabelPlugin/Controller.js +9 -6
- package/libs/PanoDoorLabelPlugin/DoorLabelItem.js +39 -13
- package/libs/PanoDoorLabelPlugin/index.js +5 -7
- package/libs/PanoMeasurePlugin/Controller/EditController.js +22 -4
- package/libs/PanoMeasurePlugin/Controller/MixedController.js +9 -5
- package/libs/PanoMeasurePlugin/Controller/ShortcutKeyController.js +2 -2
- package/libs/PanoMeasurePlugin/Controller/ViewController.js +3 -3
- package/libs/PanoMeasurePlugin/Controller/WatchController.js +5 -5
- package/libs/PanoMeasurePlugin/Controller/index.js +42 -12
- package/libs/PanoMeasurePlugin/Model/index.js +4 -4
- package/libs/PanoMeasurePlugin/Model/line.js +8 -8
- package/libs/PanoMeasurePlugin/Model/polyline.js +25 -24
- package/libs/PanoMeasurePlugin/Modules/DeleteDom/index.js +2 -2
- package/libs/PanoMeasurePlugin/Modules/FiveHelper.js +2 -1
- package/libs/PanoMeasurePlugin/Modules/GuideController.js +21 -20
- package/libs/PanoMeasurePlugin/Modules/Magnifier.js +14 -10
- package/libs/PanoMeasurePlugin/Modules/UIController/MainBtnController.js +6 -4
- package/libs/PanoMeasurePlugin/Modules/UIController/Revoke/index.js +1 -1
- package/libs/PanoMeasurePlugin/Modules/UIController/mobileHTML.js +1 -1
- package/libs/PanoMeasurePlugin/Modules/UIController/mobileMainBtnController.js +3 -3
- package/libs/PanoMeasurePlugin/Modules/rangePiece/index.js +15 -12
- package/libs/PanoMeasurePlugin/index.js +14 -15
- package/libs/PanoMeasurePlugin/typings/index.js +1 -3
- package/libs/PanoRulerPlugin/Plugin.js +54 -54
- package/libs/PanoRulerPlugin/index.js +3 -4
- package/libs/PanoRulerProPlugin/Controller.js +14 -15
- package/libs/PanoRulerProPlugin/RulerItem.js +134 -45
- package/libs/PanoRulerProPlugin/RulerItems.js +49 -40
- package/libs/PanoRulerProPlugin/index.js +4 -5
- package/libs/PanoSpatialTagPlugin/Components/origins.js +47 -8
- package/libs/PanoSpatialTagPlugin/Components/tag.js +79 -3
- package/libs/PanoSpatialTagPlugin/Plugin.js +5 -7
- package/libs/PanoSpatialTagPlugin/index.js +4 -7
- package/libs/PanoTagPlugin/Components/Common/Arrow.js +45 -20
- package/libs/PanoTagPlugin/Components/Common/Audio.js +46 -8
- package/libs/PanoTagPlugin/Components/Common/Icon/Icon.js +218 -54
- package/libs/PanoTagPlugin/Components/Common/Icon/audioIcon.js +64 -11
- package/libs/PanoTagPlugin/Components/Common/Line/Polyline.js +50 -27
- package/libs/PanoTagPlugin/Components/Common/Line/Straight.js +151 -26
- package/libs/PanoTagPlugin/Components/Common/Media.js +222 -89
- package/libs/PanoTagPlugin/Components/Common/MediaItem.js +171 -22
- package/libs/PanoTagPlugin/Components/Common/Shadow.js +100 -28
- package/libs/PanoTagPlugin/Components/Common/TagPoint.js +90 -11
- package/libs/PanoTagPlugin/Components/Common/Text/FlyMText.js +66 -13
- package/libs/PanoTagPlugin/Components/Common/Text/FlyText.js +69 -27
- package/libs/PanoTagPlugin/Components/Common/Text/MText.js +87 -13
- package/libs/PanoTagPlugin/Components/Common/TextItem.js +29 -6
- package/libs/PanoTagPlugin/Components/Tag/AudioTag/AudioPlaneTag.js +99 -14
- package/libs/PanoTagPlugin/Components/Tag/AudioTag/AudioTag.js +169 -44
- package/libs/PanoTagPlugin/Components/Tag/AudioTag/index.js +31 -6
- package/libs/PanoTagPlugin/Components/Tag/CustomTag.js +11 -4
- package/libs/PanoTagPlugin/Components/Tag/ImageTextTag.js +90 -35
- package/libs/PanoTagPlugin/Components/Tag/LinkTag.js +33 -7
- package/libs/PanoTagPlugin/Components/Tag/MarketingTag.js +174 -35
- package/libs/PanoTagPlugin/Components/Tag/MediaPlane.js +76 -24
- package/libs/PanoTagPlugin/Components/Tag/TextTag/TextPlaneTag.js +87 -14
- package/libs/PanoTagPlugin/Components/Tag/TextTag/TextTag.js +84 -17
- package/libs/PanoTagPlugin/Components/Tag/TextTag/index.js +23 -6
- package/libs/PanoTagPlugin/Components/Tag/index.js +265 -41
- package/libs/PanoTagPlugin/Components/TagContainer.js +111 -58
- package/libs/PanoTagPlugin/Components/TagItem.js +247 -71
- package/libs/PanoTagPlugin/controller/TagCache.js +21 -19
- package/libs/PanoTagPlugin/controller/TagComputer.d.ts +1 -0
- package/libs/PanoTagPlugin/controller/TagComputer.js +45 -18
- package/libs/PanoTagPlugin/controller/TagRender.js +46 -15
- package/libs/PanoTagPlugin/controller/TagUtil.d.ts +5 -5
- package/libs/PanoTagPlugin/controller/TagUtil.js +25 -9
- package/libs/PanoTagPlugin/controller/index.js +95 -33
- package/libs/PanoTagPlugin/index.js +18 -19
- package/libs/PanoTagPlugin/tag.config.js +4 -0
- package/libs/PanoTagPlugin/typings/tag/Utils.d.ts +3 -1
- package/libs/PanoTagPlugin/utils/addDebugPoints.js +4 -0
- package/libs/PanoTagPlugin/utils/audio/SharedAudio.js +7 -7
- package/libs/PanoTagPlugin/utils/normalPositionToPositions.js +4 -0
- package/libs/PanoTagPlugin/utils/tagPosition.js +1 -1
- package/libs/PanoVideoPlugin/Controller.js +53 -39
- package/libs/PanoVideoPlugin/VideoMeshController.js +89 -43
- package/libs/PanoVideoPlugin/index.js +6 -7
- package/libs/_commonjsHelpers.js +4 -0
- package/libs/base/BasePlugin.js +23 -15
- package/libs/base/BasePluginWithData.js +2 -2
- package/libs/components/PaintBrush/Controller.js +15 -4
- package/libs/components/PaintBrush/Subscribe.js +37 -0
- package/libs/components/PaintBrush/index.js +17 -4
- package/libs/components/PaintBrush/tween.js +2 -2
- package/libs/components/index.js +1 -1
- package/libs/floorplan/Components/BaseImage.js +24 -6
- package/libs/floorplan/Components/Camera.js +73 -27
- package/libs/floorplan/Components/Compass.js +20 -3
- package/libs/floorplan/Components/CurrentFloor.js +189 -50
- package/libs/floorplan/Components/Main.js +202 -54
- package/libs/floorplan/Components/Normalmage.js +5 -2
- package/libs/floorplan/Components/RoomHighlight/Room.js +38 -5
- package/libs/floorplan/Components/RoomHighlight/RoomHighlight.js +105 -58
- package/libs/floorplan/Components/RoomLabels/RoomLabel.js +91 -18
- package/libs/floorplan/Components/RoomLabels/RoomLabels.js +106 -37
- package/libs/floorplan/Components/RoomMaterials/RoomMaterial.js +42 -13
- package/libs/floorplan/Components/RoomMaterials/RoomMaterial_0.js +15 -3
- package/libs/floorplan/Components/RoomMaterials/RoomMaterial_1.js +40 -3
- package/libs/floorplan/Components/RoomMaterials/RoomMaterial_2.js +37 -3
- package/libs/floorplan/Components/RuleLabels/RuleItem.js +125 -51
- package/libs/floorplan/Components/RuleLabels/RuleLabels.js +80 -15
- package/libs/floorplan/Components/SvgImage.js +18 -6
- package/libs/floorplan/MapviewFloorplanPlugin/Controller.js +117 -75
- package/libs/floorplan/MapviewFloorplanPlugin/index.js +4 -6
- package/libs/floorplan/ModelFloorplanPlugin/Controller.js +96 -53
- package/libs/floorplan/ModelFloorplanPlugin/index.js +4 -6
- package/libs/floorplan/PanoFloorplanRadarPlugin/Components/Camera.js +43 -15
- package/libs/floorplan/PanoFloorplanRadarPlugin/Components/CurrentFloor/CurrentFloor.js +83 -22
- package/libs/floorplan/PanoFloorplanRadarPlugin/Components/CurrentFloor/ExtraObjects.js +61 -39
- package/libs/floorplan/PanoFloorplanRadarPlugin/Components/Main.js +128 -33
- package/libs/floorplan/PanoFloorplanRadarPlugin/Controller.js +39 -36
- package/libs/floorplan/PanoFloorplanRadarPlugin/index.js +4 -6
- package/libs/floorplan/TopviewFloorplanPlugin/Controller.js +83 -63
- package/libs/floorplan/TopviewFloorplanPlugin/index.js +5 -6
- package/libs/floorplan/index.js +1 -3
- package/libs/floorplan/typings/floorplanServerData.js +80 -80
- package/libs/index.js +138 -127
- package/libs/shared-utils/Object3DHelper/Base/BaseController.js +29 -1
- package/libs/shared-utils/Object3DHelper/Controller/MoveController.js +10 -1
- package/libs/shared-utils/Object3DHelper/Controller/RectangleScaleController.js +1 -1
- package/libs/shared-utils/Object3DHelper/Controller/RotateController.js +5 -2
- package/libs/shared-utils/Object3DHelper/Helper/CSS3DScaleHelper.js +9 -8
- package/libs/shared-utils/Object3DHelper/Helper/HTML/rectangleScaleDom.js +1 -0
- package/libs/shared-utils/Object3DHelper/Helper/HTML/tipsDom.js +1 -1
- package/libs/shared-utils/Object3DHelper/Helper/RotateHelper.js +4 -1
- package/libs/shared-utils/Object3DHelper/index.js +15 -0
- package/libs/shared-utils/Subscribe.js +38 -1
- package/libs/shared-utils/animationFrame/BetterTween.d.ts +3 -2
- package/libs/shared-utils/animationFrame/BetterTween.js +19 -12
- package/libs/shared-utils/animationFrame/index.d.ts +1 -1
- package/libs/shared-utils/animationFrame/index.js +14 -14
- package/libs/shared-utils/animationFrame/tween.d.ts +32 -23
- package/libs/shared-utils/animationFrame/tween.js +15 -15
- package/libs/shared-utils/audio.js +9 -9
- package/libs/shared-utils/changeModelCanvasOpacity.js +1 -1
- package/libs/shared-utils/createCanvasTextTexture.js +3 -3
- package/libs/shared-utils/five/changeMode.d.ts +2 -4
- package/libs/shared-utils/five/changeMode.js +37 -28
- package/libs/shared-utils/index.js +15 -15
- package/libs/shared-utils/log.js +2 -2
- package/libs/shared-utils/math/Interval.js +2 -0
- package/libs/shared-utils/math/Rectangle.js +2 -0
- package/libs/shared-utils/svelte/resizeObserver.d.ts +2 -10
- package/libs/shared-utils/svelte/resizeObserverGlobal.d.ts +10 -0
- package/libs/shared-utils/three/FivePointSelector.js +1 -1
- package/libs/shared-utils/three/Magnifier.js +10 -7
- package/libs/shared-utils/three/PointDomHelper.js +11 -10
- package/libs/shared-utils/three/index.js +1 -2
- package/libs/shared-utils/three/loadTexture.js +10 -10
- package/libs/shared-utils/threex/domevents/index.js +2 -2
- package/libs/vendor/@tweenjs/tween/dist/tween.esm.js.js +403 -0
- package/libs/vendor/classnames/index.js +47 -0
- package/libs/vendor/easy-reactive/main.js +3 -0
- package/libs/vendor/{simply-reactive → easy-reactive}/src/simply-reactive.js +8 -8
- package/libs/vendor/{simply-reactive → easy-reactive}/src/utils/object.js +1 -1
- package/libs/vendor/gl-vec2/add.js +7 -0
- package/libs/vendor/gl-vec2/dot.js +7 -0
- package/libs/vendor/gl-vec2/normalize.js +8 -0
- package/libs/vendor/gl-vec2/set.js +7 -0
- package/libs/vendor/gl-vec2/subtract.js +7 -0
- package/libs/vendor/lodash.clonedeep/index.js +457 -0
- package/libs/vendor/lodash.get/index.js +236 -0
- package/libs/vendor/lodash.isequal/index.js +489 -0
- package/libs/vendor/object-assign-deep/objectAssignDeep.js +62 -0
- package/libs/vendor/polyline-miter-util/index.js +18 -0
- package/libs/vendor/polyline-normals/index.js +28 -0
- package/libs/vendor/resize-observer-polyfill/dist/ResizeObserver.es.js +155 -134
- package/libs/vendor/svelte/easing/index.js +4 -5
- package/libs/vendor/svelte/index.js +1 -1
- package/libs/vendor/svelte/internal/index.js +412 -388
- package/libs/vendor/svelte/store/index.js +6 -6
- package/libs/vendor/svelte/transition/index.js +23 -20
- package/libs/vendor/svelte-carousel/src/components/Arrow/Arrow.js +41 -3
- package/libs/vendor/svelte-carousel/src/components/Carousel/Carousel.js +338 -71
- package/libs/vendor/svelte-carousel/src/components/Carousel/createCarousel.js +7 -1
- package/libs/vendor/svelte-carousel/src/components/Dot/Dot.js +19 -3
- package/libs/vendor/svelte-carousel/src/components/Dots/Dots.js +30 -7
- package/libs/vendor/svelte-carousel/src/components/Progress/Progress.js +15 -3
- package/libs/vendor/svelte-carousel/src/utils/clones.js +1 -0
- package/libs/vendor/svelte-carousel/src/utils/lazy.js +3 -0
- package/package.json +11 -13
- package/dist/GuideLinePlugin/utils/getArrowMaterial.d.ts +0 -4
- package/libs/vendor/simply-reactive/main.js +0 -3
- /package/libs/vendor/{simply-reactive → easy-reactive}/src/utils/subscription.js +0 -0
- /package/libs/vendor/{simply-reactive → easy-reactive}/src/utils/watcher.js +0 -0
package/components/index.js
CHANGED
|
@@ -1,102 +1,526 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var g = (
|
|
4
|
-
|
|
5
|
-
function j() {
|
|
1
|
+
var A = Object.defineProperty;
|
|
2
|
+
var L = (t, e, i) => e in t ? A(t, e, { enumerable: !0, configurable: !0, writable: !0, value: i }) : t[e] = i;
|
|
3
|
+
var g = (t, e, i) => (L(t, typeof e != "symbol" ? e + "" : e, i), i);
|
|
4
|
+
function F() {
|
|
6
5
|
}
|
|
7
|
-
const
|
|
6
|
+
const N = () => Promise.resolve(), R = {
|
|
8
7
|
__queue: Promise.resolve()
|
|
9
8
|
};
|
|
10
|
-
function
|
|
11
|
-
|
|
9
|
+
function z(t = N) {
|
|
10
|
+
R.__queue = R.__queue.then(t).catch(N);
|
|
12
11
|
}
|
|
13
|
-
function
|
|
14
|
-
const
|
|
15
|
-
return { x:
|
|
12
|
+
function M(t, e, i) {
|
|
13
|
+
const n = t.x, s = t.y, r = Math.floor(n / e * 1e4) / 1e4, a = Math.floor(s / i * 1e4) / 1e4;
|
|
14
|
+
return { x: r, y: a };
|
|
16
15
|
}
|
|
17
|
-
function
|
|
18
|
-
const { x:
|
|
19
|
-
return { x:
|
|
16
|
+
function j(t, e, i) {
|
|
17
|
+
const { x: n, y: s } = t, r = n * e, a = s * i;
|
|
18
|
+
return { x: r, y: a };
|
|
20
19
|
}
|
|
21
|
-
function
|
|
22
|
-
if (
|
|
20
|
+
function I(t) {
|
|
21
|
+
if (t.length < 2)
|
|
23
22
|
return {};
|
|
24
|
-
const
|
|
25
|
-
x: (
|
|
26
|
-
y: (
|
|
23
|
+
const e = t.slice(-2), i = e[0], n = {
|
|
24
|
+
x: (e[0].x + e[1].x) / 2,
|
|
25
|
+
y: (e[0].y + e[1].y) / 2
|
|
27
26
|
};
|
|
28
|
-
return { control:
|
|
27
|
+
return { control: i, end: n };
|
|
29
28
|
}
|
|
30
|
-
function
|
|
31
|
-
new Promise((
|
|
29
|
+
function q(t, e, i = F) {
|
|
30
|
+
new Promise((n) => {
|
|
32
31
|
setTimeout(() => {
|
|
33
|
-
|
|
34
|
-
},
|
|
32
|
+
i(), n(!0);
|
|
33
|
+
}, e * t);
|
|
35
34
|
});
|
|
36
35
|
}
|
|
37
|
-
const
|
|
38
|
-
function
|
|
39
|
-
|
|
36
|
+
const H = window, U = window.requestAnimationFrame || H.webkitRequestAnimationFrame || ((t) => setTimeout(t, 16));
|
|
37
|
+
function k(t, e = 0) {
|
|
38
|
+
e <= 0 ? U(t) : U(() => k(t, e - 1));
|
|
40
39
|
}
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
40
|
+
var S = Object.freeze({
|
|
41
|
+
Linear: Object.freeze({
|
|
42
|
+
None: function(t) {
|
|
43
|
+
return t;
|
|
44
|
+
},
|
|
45
|
+
In: function(t) {
|
|
46
|
+
return this.None(t);
|
|
47
|
+
},
|
|
48
|
+
Out: function(t) {
|
|
49
|
+
return this.None(t);
|
|
50
|
+
},
|
|
51
|
+
InOut: function(t) {
|
|
52
|
+
return this.None(t);
|
|
53
|
+
}
|
|
54
|
+
}),
|
|
55
|
+
Quadratic: Object.freeze({
|
|
56
|
+
In: function(t) {
|
|
57
|
+
return t * t;
|
|
58
|
+
},
|
|
59
|
+
Out: function(t) {
|
|
60
|
+
return t * (2 - t);
|
|
61
|
+
},
|
|
62
|
+
InOut: function(t) {
|
|
63
|
+
return (t *= 2) < 1 ? 0.5 * t * t : -0.5 * (--t * (t - 2) - 1);
|
|
64
|
+
}
|
|
65
|
+
}),
|
|
66
|
+
Cubic: Object.freeze({
|
|
67
|
+
In: function(t) {
|
|
68
|
+
return t * t * t;
|
|
69
|
+
},
|
|
70
|
+
Out: function(t) {
|
|
71
|
+
return --t * t * t + 1;
|
|
72
|
+
},
|
|
73
|
+
InOut: function(t) {
|
|
74
|
+
return (t *= 2) < 1 ? 0.5 * t * t * t : 0.5 * ((t -= 2) * t * t + 2);
|
|
75
|
+
}
|
|
76
|
+
}),
|
|
77
|
+
Quartic: Object.freeze({
|
|
78
|
+
In: function(t) {
|
|
79
|
+
return t * t * t * t;
|
|
80
|
+
},
|
|
81
|
+
Out: function(t) {
|
|
82
|
+
return 1 - --t * t * t * t;
|
|
83
|
+
},
|
|
84
|
+
InOut: function(t) {
|
|
85
|
+
return (t *= 2) < 1 ? 0.5 * t * t * t * t : -0.5 * ((t -= 2) * t * t * t - 2);
|
|
86
|
+
}
|
|
87
|
+
}),
|
|
88
|
+
Quintic: Object.freeze({
|
|
89
|
+
In: function(t) {
|
|
90
|
+
return t * t * t * t * t;
|
|
91
|
+
},
|
|
92
|
+
Out: function(t) {
|
|
93
|
+
return --t * t * t * t * t + 1;
|
|
94
|
+
},
|
|
95
|
+
InOut: function(t) {
|
|
96
|
+
return (t *= 2) < 1 ? 0.5 * t * t * t * t * t : 0.5 * ((t -= 2) * t * t * t * t + 2);
|
|
97
|
+
}
|
|
98
|
+
}),
|
|
99
|
+
Sinusoidal: Object.freeze({
|
|
100
|
+
In: function(t) {
|
|
101
|
+
return 1 - Math.sin((1 - t) * Math.PI / 2);
|
|
102
|
+
},
|
|
103
|
+
Out: function(t) {
|
|
104
|
+
return Math.sin(t * Math.PI / 2);
|
|
105
|
+
},
|
|
106
|
+
InOut: function(t) {
|
|
107
|
+
return 0.5 * (1 - Math.sin(Math.PI * (0.5 - t)));
|
|
108
|
+
}
|
|
109
|
+
}),
|
|
110
|
+
Exponential: Object.freeze({
|
|
111
|
+
In: function(t) {
|
|
112
|
+
return t === 0 ? 0 : Math.pow(1024, t - 1);
|
|
113
|
+
},
|
|
114
|
+
Out: function(t) {
|
|
115
|
+
return t === 1 ? 1 : 1 - Math.pow(2, -10 * t);
|
|
116
|
+
},
|
|
117
|
+
InOut: function(t) {
|
|
118
|
+
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);
|
|
119
|
+
}
|
|
120
|
+
}),
|
|
121
|
+
Circular: Object.freeze({
|
|
122
|
+
In: function(t) {
|
|
123
|
+
return 1 - Math.sqrt(1 - t * t);
|
|
124
|
+
},
|
|
125
|
+
Out: function(t) {
|
|
126
|
+
return Math.sqrt(1 - --t * t);
|
|
127
|
+
},
|
|
128
|
+
InOut: function(t) {
|
|
129
|
+
return (t *= 2) < 1 ? -0.5 * (Math.sqrt(1 - t * t) - 1) : 0.5 * (Math.sqrt(1 - (t -= 2) * t) + 1);
|
|
130
|
+
}
|
|
131
|
+
}),
|
|
132
|
+
Elastic: Object.freeze({
|
|
133
|
+
In: function(t) {
|
|
134
|
+
return t === 0 ? 0 : t === 1 ? 1 : -Math.pow(2, 10 * (t - 1)) * Math.sin((t - 1.1) * 5 * Math.PI);
|
|
135
|
+
},
|
|
136
|
+
Out: function(t) {
|
|
137
|
+
return t === 0 ? 0 : t === 1 ? 1 : Math.pow(2, -10 * t) * Math.sin((t - 0.1) * 5 * Math.PI) + 1;
|
|
138
|
+
},
|
|
139
|
+
InOut: function(t) {
|
|
140
|
+
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);
|
|
141
|
+
}
|
|
142
|
+
}),
|
|
143
|
+
Back: Object.freeze({
|
|
144
|
+
In: function(t) {
|
|
145
|
+
var e = 1.70158;
|
|
146
|
+
return t === 1 ? 1 : t * t * ((e + 1) * t - e);
|
|
147
|
+
},
|
|
148
|
+
Out: function(t) {
|
|
149
|
+
var e = 1.70158;
|
|
150
|
+
return t === 0 ? 0 : --t * t * ((e + 1) * t + e) + 1;
|
|
151
|
+
},
|
|
152
|
+
InOut: function(t) {
|
|
153
|
+
var e = 2.5949095;
|
|
154
|
+
return (t *= 2) < 1 ? 0.5 * (t * t * ((e + 1) * t - e)) : 0.5 * ((t -= 2) * t * ((e + 1) * t + e) + 2);
|
|
155
|
+
}
|
|
156
|
+
}),
|
|
157
|
+
Bounce: Object.freeze({
|
|
158
|
+
In: function(t) {
|
|
159
|
+
return 1 - S.Bounce.Out(1 - t);
|
|
160
|
+
},
|
|
161
|
+
Out: function(t) {
|
|
162
|
+
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;
|
|
163
|
+
},
|
|
164
|
+
InOut: function(t) {
|
|
165
|
+
return t < 0.5 ? S.Bounce.In(t * 2) * 0.5 : S.Bounce.Out(t * 2 - 1) * 0.5 + 0.5;
|
|
166
|
+
}
|
|
167
|
+
}),
|
|
168
|
+
generatePow: function(t) {
|
|
169
|
+
return t === void 0 && (t = 4), t = t < Number.EPSILON ? Number.EPSILON : t, t = t > 1e4 ? 1e4 : t, {
|
|
170
|
+
In: function(e) {
|
|
171
|
+
return Math.pow(e, t);
|
|
172
|
+
},
|
|
173
|
+
Out: function(e) {
|
|
174
|
+
return 1 - Math.pow(1 - e, t);
|
|
175
|
+
},
|
|
176
|
+
InOut: function(e) {
|
|
177
|
+
return e < 0.5 ? Math.pow(e * 2, t) / 2 : (1 - Math.pow(2 - e * 2, t)) / 2 + 0.5;
|
|
178
|
+
}
|
|
179
|
+
};
|
|
45
180
|
}
|
|
46
|
-
|
|
181
|
+
}), T = function() {
|
|
182
|
+
return performance.now();
|
|
183
|
+
}, W = (
|
|
184
|
+
/** @class */
|
|
185
|
+
function() {
|
|
186
|
+
function t() {
|
|
187
|
+
this._tweens = {}, this._tweensAddedDuringUpdate = {};
|
|
188
|
+
}
|
|
189
|
+
return t.prototype.getAll = function() {
|
|
190
|
+
var e = this;
|
|
191
|
+
return Object.keys(this._tweens).map(function(i) {
|
|
192
|
+
return e._tweens[i];
|
|
193
|
+
});
|
|
194
|
+
}, t.prototype.removeAll = function() {
|
|
195
|
+
this._tweens = {};
|
|
196
|
+
}, t.prototype.add = function(e) {
|
|
197
|
+
this._tweens[e.getId()] = e, this._tweensAddedDuringUpdate[e.getId()] = e;
|
|
198
|
+
}, t.prototype.remove = function(e) {
|
|
199
|
+
delete this._tweens[e.getId()], delete this._tweensAddedDuringUpdate[e.getId()];
|
|
200
|
+
}, t.prototype.update = function(e, i) {
|
|
201
|
+
e === void 0 && (e = T()), i === void 0 && (i = !1);
|
|
202
|
+
var n = Object.keys(this._tweens);
|
|
203
|
+
if (n.length === 0)
|
|
204
|
+
return !1;
|
|
205
|
+
for (; n.length > 0; ) {
|
|
206
|
+
this._tweensAddedDuringUpdate = {};
|
|
207
|
+
for (var s = 0; s < n.length; s++) {
|
|
208
|
+
var r = this._tweens[n[s]], a = !i;
|
|
209
|
+
r && r.update(e, a) === !1 && !i && delete this._tweens[n[s]];
|
|
210
|
+
}
|
|
211
|
+
n = Object.keys(this._tweensAddedDuringUpdate);
|
|
212
|
+
}
|
|
213
|
+
return !0;
|
|
214
|
+
}, t;
|
|
215
|
+
}()
|
|
216
|
+
), x = {
|
|
217
|
+
Linear: function(t, e) {
|
|
218
|
+
var i = t.length - 1, n = i * e, s = Math.floor(n), r = x.Utils.Linear;
|
|
219
|
+
return e < 0 ? r(t[0], t[1], n) : e > 1 ? r(t[i], t[i - 1], i - n) : r(t[s], t[s + 1 > i ? i : s + 1], n - s);
|
|
220
|
+
},
|
|
221
|
+
Bezier: function(t, e) {
|
|
222
|
+
for (var i = 0, n = t.length - 1, s = Math.pow, r = x.Utils.Bernstein, a = 0; a <= n; a++)
|
|
223
|
+
i += s(1 - e, n - a) * s(e, a) * t[a] * r(n, a);
|
|
224
|
+
return i;
|
|
225
|
+
},
|
|
226
|
+
CatmullRom: function(t, e) {
|
|
227
|
+
var i = t.length - 1, n = i * e, s = Math.floor(n), r = x.Utils.CatmullRom;
|
|
228
|
+
return t[0] === t[i] ? (e < 0 && (s = Math.floor(n = i * (1 + e))), r(t[(s - 1 + i) % i], t[s], t[(s + 1) % i], t[(s + 2) % i], n - s)) : e < 0 ? t[0] - (r(t[0], t[0], t[1], t[1], -n) - t[0]) : e > 1 ? t[i] - (r(t[i], t[i], t[i - 1], t[i - 1], n - i) - t[i]) : r(t[s ? s - 1 : 0], t[s], t[i < s + 1 ? i : s + 1], t[i < s + 2 ? i : s + 2], n - s);
|
|
229
|
+
},
|
|
230
|
+
Utils: {
|
|
231
|
+
Linear: function(t, e, i) {
|
|
232
|
+
return (e - t) * i + t;
|
|
233
|
+
},
|
|
234
|
+
Bernstein: function(t, e) {
|
|
235
|
+
var i = x.Utils.Factorial;
|
|
236
|
+
return i(t) / i(e) / i(t - e);
|
|
237
|
+
},
|
|
238
|
+
Factorial: function() {
|
|
239
|
+
var t = [1];
|
|
240
|
+
return function(e) {
|
|
241
|
+
var i = 1;
|
|
242
|
+
if (t[e])
|
|
243
|
+
return t[e];
|
|
244
|
+
for (var n = e; n > 1; n--)
|
|
245
|
+
i *= n;
|
|
246
|
+
return t[e] = i, i;
|
|
247
|
+
};
|
|
248
|
+
}(),
|
|
249
|
+
CatmullRom: function(t, e, i, n, s) {
|
|
250
|
+
var r = (i - t) * 0.5, a = (n - e) * 0.5, o = s * s, c = s * o;
|
|
251
|
+
return (2 * e - 2 * i + r + a) * c + (-3 * e + 3 * i - 2 * r - a) * o + r * s + e;
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
}, $ = (
|
|
255
|
+
/** @class */
|
|
256
|
+
function() {
|
|
257
|
+
function t() {
|
|
258
|
+
}
|
|
259
|
+
return t.nextId = function() {
|
|
260
|
+
return t._nextId++;
|
|
261
|
+
}, t._nextId = 0, t;
|
|
262
|
+
}()
|
|
263
|
+
), m = new W(), X = (
|
|
264
|
+
/** @class */
|
|
265
|
+
function() {
|
|
266
|
+
function t(e, i) {
|
|
267
|
+
i === void 0 && (i = m), this._object = e, this._group = i, this._isPaused = !1, this._pauseStart = 0, this._valuesStart = {}, this._valuesEnd = {}, this._valuesStartRepeat = {}, this._duration = 1e3, this._isDynamic = !1, this._initialRepeat = 0, this._repeat = 0, this._yoyo = !1, this._isPlaying = !1, this._reversed = !1, this._delayTime = 0, this._startTime = 0, this._easingFunction = S.Linear.None, this._interpolationFunction = x.Linear, this._chainedTweens = [], this._onStartCallbackFired = !1, this._onEveryStartCallbackFired = !1, this._id = $.nextId(), this._isChainStopped = !1, this._propertiesAreSetUp = !1, this._goToEnd = !1;
|
|
268
|
+
}
|
|
269
|
+
return t.prototype.getId = function() {
|
|
270
|
+
return this._id;
|
|
271
|
+
}, t.prototype.isPlaying = function() {
|
|
272
|
+
return this._isPlaying;
|
|
273
|
+
}, t.prototype.isPaused = function() {
|
|
274
|
+
return this._isPaused;
|
|
275
|
+
}, t.prototype.to = function(e, i) {
|
|
276
|
+
if (i === void 0 && (i = 1e3), this._isPlaying)
|
|
277
|
+
throw new Error("Can not call Tween.to() while Tween is already started or paused. Stop the Tween first.");
|
|
278
|
+
return this._valuesEnd = e, this._propertiesAreSetUp = !1, this._duration = i, this;
|
|
279
|
+
}, t.prototype.duration = function(e) {
|
|
280
|
+
return e === void 0 && (e = 1e3), this._duration = e, this;
|
|
281
|
+
}, t.prototype.dynamic = function(e) {
|
|
282
|
+
return e === void 0 && (e = !1), this._isDynamic = e, this;
|
|
283
|
+
}, t.prototype.start = function(e, i) {
|
|
284
|
+
if (e === void 0 && (e = T()), i === void 0 && (i = !1), this._isPlaying)
|
|
285
|
+
return this;
|
|
286
|
+
if (this._group && this._group.add(this), this._repeat = this._initialRepeat, this._reversed) {
|
|
287
|
+
this._reversed = !1;
|
|
288
|
+
for (var n in this._valuesStartRepeat)
|
|
289
|
+
this._swapEndStartRepeatValues(n), this._valuesStart[n] = this._valuesStartRepeat[n];
|
|
290
|
+
}
|
|
291
|
+
if (this._isPlaying = !0, this._isPaused = !1, this._onStartCallbackFired = !1, this._onEveryStartCallbackFired = !1, this._isChainStopped = !1, this._startTime = e, this._startTime += this._delayTime, !this._propertiesAreSetUp || i) {
|
|
292
|
+
if (this._propertiesAreSetUp = !0, !this._isDynamic) {
|
|
293
|
+
var s = {};
|
|
294
|
+
for (var r in this._valuesEnd)
|
|
295
|
+
s[r] = this._valuesEnd[r];
|
|
296
|
+
this._valuesEnd = s;
|
|
297
|
+
}
|
|
298
|
+
this._setupProperties(this._object, this._valuesStart, this._valuesEnd, this._valuesStartRepeat, i);
|
|
299
|
+
}
|
|
300
|
+
return this;
|
|
301
|
+
}, t.prototype.startFromCurrentValues = function(e) {
|
|
302
|
+
return this.start(e, !0);
|
|
303
|
+
}, t.prototype._setupProperties = function(e, i, n, s, r) {
|
|
304
|
+
for (var a in n) {
|
|
305
|
+
var o = e[a], c = Array.isArray(o), d = c ? "array" : typeof o, _ = !c && Array.isArray(n[a]);
|
|
306
|
+
if (!(d === "undefined" || d === "function")) {
|
|
307
|
+
if (_) {
|
|
308
|
+
var u = n[a];
|
|
309
|
+
if (u.length === 0)
|
|
310
|
+
continue;
|
|
311
|
+
for (var l = [o], h = 0, p = u.length; h < p; h += 1) {
|
|
312
|
+
var f = this._handleRelativeValue(o, u[h]);
|
|
313
|
+
if (isNaN(f)) {
|
|
314
|
+
_ = !1, console.warn("Found invalid interpolation list. Skipping.");
|
|
315
|
+
break;
|
|
316
|
+
}
|
|
317
|
+
l.push(f);
|
|
318
|
+
}
|
|
319
|
+
_ && (n[a] = l);
|
|
320
|
+
}
|
|
321
|
+
if ((d === "object" || c) && o && !_) {
|
|
322
|
+
i[a] = c ? [] : {};
|
|
323
|
+
var v = o;
|
|
324
|
+
for (var b in v)
|
|
325
|
+
i[a][b] = v[b];
|
|
326
|
+
s[a] = c ? [] : {};
|
|
327
|
+
var u = n[a];
|
|
328
|
+
if (!this._isDynamic) {
|
|
329
|
+
var E = {};
|
|
330
|
+
for (var b in u)
|
|
331
|
+
E[b] = u[b];
|
|
332
|
+
n[a] = u = E;
|
|
333
|
+
}
|
|
334
|
+
this._setupProperties(v, i[a], u, s[a], r);
|
|
335
|
+
} else
|
|
336
|
+
(typeof i[a] == "undefined" || r) && (i[a] = o), c || (i[a] *= 1), _ ? s[a] = n[a].slice().reverse() : s[a] = i[a] || 0;
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
}, t.prototype.stop = function() {
|
|
340
|
+
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;
|
|
341
|
+
}, t.prototype.end = function() {
|
|
342
|
+
return this._goToEnd = !0, this.update(1 / 0), this;
|
|
343
|
+
}, t.prototype.pause = function(e) {
|
|
344
|
+
return e === void 0 && (e = T()), this._isPaused || !this._isPlaying ? this : (this._isPaused = !0, this._pauseStart = e, this._group && this._group.remove(this), this);
|
|
345
|
+
}, t.prototype.resume = function(e) {
|
|
346
|
+
return e === void 0 && (e = T()), !this._isPaused || !this._isPlaying ? this : (this._isPaused = !1, this._startTime += e - this._pauseStart, this._pauseStart = 0, this._group && this._group.add(this), this);
|
|
347
|
+
}, t.prototype.stopChainedTweens = function() {
|
|
348
|
+
for (var e = 0, i = this._chainedTweens.length; e < i; e++)
|
|
349
|
+
this._chainedTweens[e].stop();
|
|
350
|
+
return this;
|
|
351
|
+
}, t.prototype.group = function(e) {
|
|
352
|
+
return e === void 0 && (e = m), this._group = e, this;
|
|
353
|
+
}, t.prototype.delay = function(e) {
|
|
354
|
+
return e === void 0 && (e = 0), this._delayTime = e, this;
|
|
355
|
+
}, t.prototype.repeat = function(e) {
|
|
356
|
+
return e === void 0 && (e = 0), this._initialRepeat = e, this._repeat = e, this;
|
|
357
|
+
}, t.prototype.repeatDelay = function(e) {
|
|
358
|
+
return this._repeatDelayTime = e, this;
|
|
359
|
+
}, t.prototype.yoyo = function(e) {
|
|
360
|
+
return e === void 0 && (e = !1), this._yoyo = e, this;
|
|
361
|
+
}, t.prototype.easing = function(e) {
|
|
362
|
+
return e === void 0 && (e = S.Linear.None), this._easingFunction = e, this;
|
|
363
|
+
}, t.prototype.interpolation = function(e) {
|
|
364
|
+
return e === void 0 && (e = x.Linear), this._interpolationFunction = e, this;
|
|
365
|
+
}, t.prototype.chain = function() {
|
|
366
|
+
for (var e = [], i = 0; i < arguments.length; i++)
|
|
367
|
+
e[i] = arguments[i];
|
|
368
|
+
return this._chainedTweens = e, this;
|
|
369
|
+
}, t.prototype.onStart = function(e) {
|
|
370
|
+
return this._onStartCallback = e, this;
|
|
371
|
+
}, t.prototype.onEveryStart = function(e) {
|
|
372
|
+
return this._onEveryStartCallback = e, this;
|
|
373
|
+
}, t.prototype.onUpdate = function(e) {
|
|
374
|
+
return this._onUpdateCallback = e, this;
|
|
375
|
+
}, t.prototype.onRepeat = function(e) {
|
|
376
|
+
return this._onRepeatCallback = e, this;
|
|
377
|
+
}, t.prototype.onComplete = function(e) {
|
|
378
|
+
return this._onCompleteCallback = e, this;
|
|
379
|
+
}, t.prototype.onStop = function(e) {
|
|
380
|
+
return this._onStopCallback = e, this;
|
|
381
|
+
}, t.prototype.update = function(e, i) {
|
|
382
|
+
if (e === void 0 && (e = T()), i === void 0 && (i = !0), this._isPaused)
|
|
383
|
+
return !0;
|
|
384
|
+
var n, s, r = this._startTime + this._duration;
|
|
385
|
+
if (!this._goToEnd && !this._isPlaying) {
|
|
386
|
+
if (e > r)
|
|
387
|
+
return !1;
|
|
388
|
+
i && this.start(e, !0);
|
|
389
|
+
}
|
|
390
|
+
if (this._goToEnd = !1, e < this._startTime)
|
|
391
|
+
return !0;
|
|
392
|
+
this._onStartCallbackFired === !1 && (this._onStartCallback && this._onStartCallback(this._object), this._onStartCallbackFired = !0), this._onEveryStartCallbackFired === !1 && (this._onEveryStartCallback && this._onEveryStartCallback(this._object), this._onEveryStartCallbackFired = !0), s = (e - this._startTime) / this._duration, s = this._duration === 0 || s > 1 ? 1 : s;
|
|
393
|
+
var a = this._easingFunction(s);
|
|
394
|
+
if (this._updateProperties(this._object, this._valuesStart, this._valuesEnd, a), this._onUpdateCallback && this._onUpdateCallback(this._object, s), s === 1)
|
|
395
|
+
if (this._repeat > 0) {
|
|
396
|
+
isFinite(this._repeat) && this._repeat--;
|
|
397
|
+
for (n in this._valuesStartRepeat)
|
|
398
|
+
!this._yoyo && typeof this._valuesEnd[n] == "string" && (this._valuesStartRepeat[n] = // eslint-disable-next-line
|
|
399
|
+
// @ts-ignore FIXME?
|
|
400
|
+
this._valuesStartRepeat[n] + parseFloat(this._valuesEnd[n])), this._yoyo && this._swapEndStartRepeatValues(n), this._valuesStart[n] = this._valuesStartRepeat[n];
|
|
401
|
+
return this._yoyo && (this._reversed = !this._reversed), this._repeatDelayTime !== void 0 ? this._startTime = e + this._repeatDelayTime : this._startTime = e + this._delayTime, this._onRepeatCallback && this._onRepeatCallback(this._object), this._onEveryStartCallbackFired = !1, !0;
|
|
402
|
+
} else {
|
|
403
|
+
this._onCompleteCallback && this._onCompleteCallback(this._object);
|
|
404
|
+
for (var o = 0, c = this._chainedTweens.length; o < c; o++)
|
|
405
|
+
this._chainedTweens[o].start(this._startTime + this._duration, !1);
|
|
406
|
+
return this._isPlaying = !1, !1;
|
|
407
|
+
}
|
|
408
|
+
return !0;
|
|
409
|
+
}, t.prototype._updateProperties = function(e, i, n, s) {
|
|
410
|
+
for (var r in n)
|
|
411
|
+
if (i[r] !== void 0) {
|
|
412
|
+
var a = i[r] || 0, o = n[r], c = Array.isArray(e[r]), d = Array.isArray(o), _ = !c && d;
|
|
413
|
+
_ ? e[r] = this._interpolationFunction(o, s) : typeof o == "object" && o ? this._updateProperties(e[r], a, o, s) : (o = this._handleRelativeValue(a, o), typeof o == "number" && (e[r] = a + (o - a) * s));
|
|
414
|
+
}
|
|
415
|
+
}, t.prototype._handleRelativeValue = function(e, i) {
|
|
416
|
+
return typeof i != "string" ? i : i.charAt(0) === "+" || i.charAt(0) === "-" ? e + parseFloat(i) : parseFloat(i);
|
|
417
|
+
}, t.prototype._swapEndStartRepeatValues = function(e) {
|
|
418
|
+
var i = this._valuesStartRepeat[e], n = this._valuesEnd[e];
|
|
419
|
+
typeof n == "string" ? this._valuesStartRepeat[e] = this._valuesStartRepeat[e] + parseFloat(n) : this._valuesStartRepeat[e] = this._valuesEnd[e], this._valuesEnd[e] = i;
|
|
420
|
+
}, t;
|
|
421
|
+
}()
|
|
422
|
+
), y = m;
|
|
423
|
+
y.getAll.bind(y);
|
|
424
|
+
y.removeAll.bind(y);
|
|
425
|
+
y.add.bind(y);
|
|
426
|
+
y.remove.bind(y);
|
|
427
|
+
y.update.bind(y);
|
|
428
|
+
function Y(t, e, i, n = S.Linear.None) {
|
|
429
|
+
const s = new X(t).to(e, i).easing(n).start();
|
|
430
|
+
function r(a) {
|
|
431
|
+
s.update(a) && requestAnimationFrame(r);
|
|
432
|
+
}
|
|
433
|
+
return requestAnimationFrame(r), s;
|
|
47
434
|
}
|
|
48
|
-
var
|
|
49
|
-
const
|
|
50
|
-
function
|
|
51
|
-
return
|
|
435
|
+
var w = /* @__PURE__ */ ((t) => (t.Drawline = "Drawline", t.Undo = "Undo", t.Exit = "Exit", t))(w || {});
|
|
436
|
+
const O = Symbol("$$PAINT_BRUSH_EVENT$$");
|
|
437
|
+
function P(t) {
|
|
438
|
+
return t[O] || (t[O] = {}), t[O];
|
|
52
439
|
}
|
|
53
|
-
function
|
|
54
|
-
|
|
440
|
+
function Q(t) {
|
|
441
|
+
t[O] || delete t[O];
|
|
55
442
|
}
|
|
56
|
-
class
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
const
|
|
63
|
-
return
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
443
|
+
class G {
|
|
444
|
+
/**
|
|
445
|
+
* 判断是否注册了事件
|
|
446
|
+
* @param name 事件类型
|
|
447
|
+
*/
|
|
448
|
+
hasListener(e) {
|
|
449
|
+
const i = P(this);
|
|
450
|
+
return i && i[e] && i[e].length > 0;
|
|
451
|
+
}
|
|
452
|
+
/**
|
|
453
|
+
* 注册事件
|
|
454
|
+
* @param name 事件类型
|
|
455
|
+
* @param callback 事件回调函数
|
|
456
|
+
* @param once 是否只执行一次
|
|
457
|
+
* @returns 解除事件
|
|
458
|
+
* @template K 预设的监听事件名称
|
|
459
|
+
* @template C 回调函数函数上下文
|
|
460
|
+
*/
|
|
461
|
+
on(e, i, n) {
|
|
462
|
+
const s = P(this);
|
|
463
|
+
return s[e] || (s[e] = []), s[e].push([i, n || !1]), () => this.off(e, i);
|
|
464
|
+
}
|
|
465
|
+
/**
|
|
466
|
+
* 注册事件(是否只执行一次)
|
|
467
|
+
* @param name 事件类型
|
|
468
|
+
* @param callback 事件回调函数
|
|
469
|
+
* @returns 解除事件
|
|
470
|
+
* @template K 预设的监听事件名称
|
|
471
|
+
* @template C 回调函数函数上下文
|
|
472
|
+
*/
|
|
473
|
+
once(e, i) {
|
|
474
|
+
return this.on(e, i, !0);
|
|
475
|
+
}
|
|
476
|
+
/**
|
|
477
|
+
* 解除事件
|
|
478
|
+
*
|
|
479
|
+
* 如果 name 不传的话解除对应所有事件
|
|
480
|
+
* 如果 name, callback 不传的话解除所有name的所有事件
|
|
481
|
+
* @param name 事件类型
|
|
482
|
+
* @param callback 事件回调函数
|
|
483
|
+
* @template K 预设的监听事件名称
|
|
484
|
+
*/
|
|
485
|
+
off(e, i) {
|
|
486
|
+
if (e === void 0) {
|
|
487
|
+
Q(this);
|
|
71
488
|
return;
|
|
72
489
|
}
|
|
73
|
-
const
|
|
74
|
-
if (e
|
|
75
|
-
e
|
|
490
|
+
const n = P(this);
|
|
491
|
+
if (n[e] || (n[e] = []), i === void 0) {
|
|
492
|
+
n[e].length = 0;
|
|
76
493
|
return;
|
|
77
494
|
}
|
|
78
495
|
let s = 0;
|
|
79
|
-
for (; s < e
|
|
496
|
+
for (; s < n[e].length && n[e][s][0] !== i; s++)
|
|
80
497
|
;
|
|
81
|
-
s < e
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
498
|
+
s < n[e].length && n[e].splice(s, 1);
|
|
499
|
+
}
|
|
500
|
+
/**
|
|
501
|
+
* 触发事件
|
|
502
|
+
* @param name 事件类型
|
|
503
|
+
* @param data 触发事件的数据
|
|
504
|
+
* @returns canceled 是否被触发取消
|
|
505
|
+
* @template K 预设的监听事件名称
|
|
506
|
+
*/
|
|
507
|
+
emit(e, ...i) {
|
|
508
|
+
let n = !1;
|
|
509
|
+
const r = P(this)[e] || [];
|
|
510
|
+
for (let a of r.slice()) {
|
|
511
|
+
const [o, c = !1] = a, d = o(...i);
|
|
512
|
+
c && this.off(e, o), d === !1 && (n = !0);
|
|
89
513
|
}
|
|
90
|
-
return
|
|
514
|
+
return n;
|
|
91
515
|
}
|
|
92
516
|
}
|
|
93
|
-
function
|
|
517
|
+
function C() {
|
|
94
518
|
return ((1 + Math.random()) * 65536 | 0).toString(16).substring(1);
|
|
95
519
|
}
|
|
96
|
-
function
|
|
97
|
-
return (
|
|
520
|
+
function J() {
|
|
521
|
+
return (C() + C() + "-" + C() + "-4" + C().substr(0, 3) + "-" + C() + "-" + C() + C() + C()).toLowerCase();
|
|
98
522
|
}
|
|
99
|
-
const
|
|
523
|
+
const Z = `
|
|
100
524
|
<style type="text/css">
|
|
101
525
|
|
|
102
526
|
#_gl_paintBrush {
|
|
@@ -197,21 +621,21 @@ transition: all 500ms;
|
|
|
197
621
|
|
|
198
622
|
</style>
|
|
199
623
|
`;
|
|
200
|
-
class
|
|
201
|
-
constructor(
|
|
624
|
+
class K extends G {
|
|
625
|
+
constructor(i) {
|
|
202
626
|
super();
|
|
203
627
|
g(this, "configs");
|
|
204
628
|
g(this, "clientWidth");
|
|
205
629
|
g(this, "clientHeight");
|
|
206
630
|
g(this, "ready", !1);
|
|
207
|
-
g(this, "uuid",
|
|
631
|
+
g(this, "uuid", J());
|
|
208
632
|
g(this, "tween");
|
|
209
633
|
g(this, "tweening", !1);
|
|
210
634
|
g(this, "container");
|
|
211
635
|
g(this, "canvas");
|
|
212
636
|
g(this, "data", {});
|
|
213
637
|
g(this, "tempLine", {});
|
|
214
|
-
this.configs =
|
|
638
|
+
this.configs = i, this.clientWidth = document.body.clientWidth, this.clientHeight = document.body.clientHeight, this.container = this.ifInsertToDOM(), this.canvas = {}, this.initCtrl();
|
|
215
639
|
}
|
|
216
640
|
get color() {
|
|
217
641
|
return this.configs.currentColor;
|
|
@@ -230,308 +654,332 @@ class X extends P {
|
|
|
230
654
|
else if (document.getElementById("_gl_paintBrush"))
|
|
231
655
|
this.container = document.getElementById("_gl_paintBrush");
|
|
232
656
|
else {
|
|
233
|
-
const
|
|
234
|
-
|
|
657
|
+
const i = document.createElement("div");
|
|
658
|
+
i.id = "_gl_paintBrush", document.body.appendChild(i), this.container = i;
|
|
235
659
|
}
|
|
236
|
-
return this.container.innerHTML =
|
|
237
|
-
}
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
660
|
+
return this.container.innerHTML = Z, this.container;
|
|
661
|
+
}
|
|
662
|
+
/**
|
|
663
|
+
*
|
|
664
|
+
* @param className 初始化画板
|
|
665
|
+
* @returns
|
|
666
|
+
*/
|
|
667
|
+
initCanvas(i) {
|
|
668
|
+
const n = document.createElement("canvas");
|
|
669
|
+
n.className = i, n.width = this.clientWidth, n.height = this.clientHeight;
|
|
670
|
+
const s = n.getContext("2d");
|
|
671
|
+
if (s)
|
|
672
|
+
return s.lineWidth = 5 * this.dpr, s.lineCap = "round", s.lineJoin = "round", this.container.appendChild(n), n;
|
|
673
|
+
}
|
|
674
|
+
/**
|
|
675
|
+
* 初始化操作面板
|
|
676
|
+
* @returns
|
|
677
|
+
*/
|
|
245
678
|
initCtrl() {
|
|
246
|
-
const
|
|
247
|
-
|
|
248
|
-
const
|
|
249
|
-
|
|
679
|
+
const i = document.createElement("div");
|
|
680
|
+
i.className = "_paintBrush-ctrl";
|
|
681
|
+
const n = document.createElement("div");
|
|
682
|
+
n.className = "_paintBrush-ctrlinner";
|
|
250
683
|
const s = document.createElement("a");
|
|
251
684
|
s.className = "_paintBrush-ctrlitem _paintBrush-ctrlitem--undo", s.addEventListener("click", (o) => {
|
|
252
|
-
var
|
|
685
|
+
var l;
|
|
253
686
|
if (o.stopPropagation(), this.configs.onClickUndo && this.configs.onClickUndo(), !this.canvas[this.uuid] || !this.data[this.uuid] || this.data[this.uuid].length === 0)
|
|
254
687
|
return;
|
|
255
|
-
const
|
|
256
|
-
|
|
257
|
-
type:
|
|
688
|
+
const c = this.data[this.uuid].pop();
|
|
689
|
+
c && this.emitStateChange({
|
|
690
|
+
type: w.Undo,
|
|
258
691
|
color: this.color,
|
|
259
692
|
ready: this.ready,
|
|
260
|
-
state:
|
|
693
|
+
state: c,
|
|
261
694
|
uuid: this.uuid
|
|
262
695
|
});
|
|
263
|
-
const
|
|
696
|
+
const d = (l = this.canvas[this.uuid]) == null ? void 0 : l.getContext("2d");
|
|
264
697
|
if (!this.canvas[this.uuid])
|
|
265
698
|
return;
|
|
266
|
-
const { width:
|
|
267
|
-
|
|
699
|
+
const { width: _, height: u } = this.canvas[this.uuid];
|
|
700
|
+
d && d.clearRect(0, 0, _, u), this.data[this.uuid].forEach((h) => this.handleDrawLine(this.uuid, h, { withUndo: !0 }));
|
|
268
701
|
});
|
|
269
|
-
const
|
|
270
|
-
return
|
|
702
|
+
const r = document.createElement("a");
|
|
703
|
+
return r.className = "_paintBrush-ctrlitem _paintBrush-ctrlitem--close", r.addEventListener("click", (o) => {
|
|
271
704
|
o.stopPropagation(), this.closeBrush(), this.configs.onClickClose && this.configs.onClickClose();
|
|
272
|
-
}), [s,
|
|
273
|
-
const
|
|
274
|
-
|
|
275
|
-
const
|
|
276
|
-
|
|
277
|
-
}),
|
|
705
|
+
}), [s, r].forEach((o) => {
|
|
706
|
+
const c = document.createElement("i");
|
|
707
|
+
c.className = "brush-icon";
|
|
708
|
+
const d = document.createElement("span");
|
|
709
|
+
d.className = "brush-txt", d.innerText = o.className.endsWith("undo") ? this.configs.onUndoText : this.configs.onExitText, o.appendChild(c), o.appendChild(d);
|
|
710
|
+
}), n.appendChild(s), n.appendChild(r), i.appendChild(n), this.container.appendChild(i), i;
|
|
278
711
|
}
|
|
279
712
|
openBrush() {
|
|
280
713
|
if (this.ready)
|
|
281
714
|
return;
|
|
282
715
|
this.canvas[this.uuid] || (this.canvas[this.uuid] = this.initCanvas("_paintBrush-canvas")), this.container.className = "brushing";
|
|
283
|
-
const
|
|
284
|
-
|
|
716
|
+
const i = this.canvas[this.uuid];
|
|
717
|
+
i.getContext("2d").clearRect(0, 0, i.width, i.height), this.openBrushHandle(), this.ready = !0, this.emit("readyChange", !0);
|
|
285
718
|
}
|
|
286
719
|
closeBrush() {
|
|
287
|
-
|
|
288
|
-
this.canvas[
|
|
289
|
-
const
|
|
290
|
-
|
|
720
|
+
this.ready && (this.container.className = "", this.data = {}, this.tempLine = {}, Object.keys(this.canvas).forEach((i) => {
|
|
721
|
+
this.canvas[i].ontouchstart = () => !1, this.canvas[i].ontouchmove = () => !1, this.canvas[i].ontouchend = () => !1, this.canvas[i].ontouchcancel = () => !1;
|
|
722
|
+
const n = this.canvas[i].getContext("2d");
|
|
723
|
+
n && n.clearRect(0, 0, this.canvas[i].width, this.canvas[i].height);
|
|
291
724
|
}), this.ready = !1, this.emit("readyChange", !1), this.emitStateChange({
|
|
292
|
-
type:
|
|
725
|
+
type: w.Exit,
|
|
293
726
|
color: this.color,
|
|
294
727
|
ready: !1,
|
|
295
728
|
uuid: this.uuid
|
|
296
729
|
}));
|
|
297
730
|
}
|
|
298
|
-
updateCurrentColor(
|
|
299
|
-
const
|
|
300
|
-
if (!
|
|
731
|
+
updateCurrentColor(i) {
|
|
732
|
+
const n = this.canvas[this.uuid];
|
|
733
|
+
if (!n)
|
|
301
734
|
return;
|
|
302
|
-
const s =
|
|
303
|
-
|
|
735
|
+
const s = n.getContext("2d");
|
|
736
|
+
s && (this.configs.currentColor = i, s.strokeStyle = i);
|
|
304
737
|
}
|
|
305
738
|
openBrushHandle() {
|
|
306
|
-
const
|
|
307
|
-
if (!
|
|
739
|
+
const i = this.canvas[this.uuid];
|
|
740
|
+
if (!i)
|
|
308
741
|
return;
|
|
309
|
-
const
|
|
310
|
-
if (!
|
|
742
|
+
const n = i.getContext("2d");
|
|
743
|
+
if (!n)
|
|
311
744
|
return;
|
|
312
745
|
const s = this.color || "#6D92FF";
|
|
313
|
-
|
|
314
|
-
let
|
|
315
|
-
const
|
|
746
|
+
n.strokeStyle = s;
|
|
747
|
+
let r = null, a = [], o, c = [], d = 0;
|
|
748
|
+
const _ = (u, l, h) => {
|
|
316
749
|
const p = this.color || "#ff0000";
|
|
317
|
-
|
|
750
|
+
n.strokeStyle = p, n.beginPath(), n.moveTo(u.x, u.y), n.quadraticCurveTo(l.x, l.y, h.x, h.y), n.stroke();
|
|
318
751
|
};
|
|
319
|
-
|
|
320
|
-
u.preventDefault(),
|
|
321
|
-
const
|
|
322
|
-
|
|
323
|
-
},
|
|
324
|
-
if (u.preventDefault(), !
|
|
752
|
+
i.onmousedown = (u) => {
|
|
753
|
+
u.preventDefault(), d = Date.now();
|
|
754
|
+
const l = u.clientX, h = u.clientY;
|
|
755
|
+
a = [], a.push({ x: l, y: h }), r = { x: l, y: h }, o = M({ x: l, y: h }, this.clientWidth, this.clientHeight), c = [];
|
|
756
|
+
}, i.onmousemove = (u) => {
|
|
757
|
+
if (u.preventDefault(), !r)
|
|
325
758
|
return;
|
|
326
|
-
const
|
|
327
|
-
if (Math.abs(
|
|
759
|
+
const l = Number(u.clientX), h = Number(u.clientY);
|
|
760
|
+
if (Math.abs(l - r.x) < 5 && Math.abs(h - r.y) < 5 || (a.push({ x: l, y: h }), c.push(M({ x: l, y: h }, this.clientWidth, this.clientHeight)), a.length < 3))
|
|
328
761
|
return;
|
|
329
|
-
const { control: p, end:
|
|
330
|
-
!p || !
|
|
331
|
-
},
|
|
332
|
-
if (u.preventDefault(),
|
|
762
|
+
const { control: p, end: f } = I(a);
|
|
763
|
+
!p || !f || (_(r, p, f), r = f);
|
|
764
|
+
}, i.onmouseup = (u) => {
|
|
765
|
+
if (u.preventDefault(), r = null, a.length < 3)
|
|
333
766
|
return;
|
|
334
767
|
this.data[this.uuid] || (this.data[this.uuid] = []);
|
|
335
|
-
const
|
|
768
|
+
const l = Date.now() - d, h = {
|
|
336
769
|
move: Object.assign({}, o),
|
|
337
770
|
uuid: this.uuid,
|
|
338
|
-
line: [...
|
|
771
|
+
line: [...c],
|
|
339
772
|
color: this.color,
|
|
340
|
-
duration:
|
|
773
|
+
duration: l < 1280 ? l : l < 2e3 ? 1280 : 0
|
|
774
|
+
// 单次笔迹时长超过2000ms不加动画
|
|
341
775
|
};
|
|
342
|
-
this.data[this.uuid].push(
|
|
776
|
+
this.data[this.uuid].push(h), k(() => {
|
|
343
777
|
this.emitStateChange({
|
|
344
|
-
type:
|
|
778
|
+
type: w.Drawline,
|
|
345
779
|
color: this.color,
|
|
346
780
|
ready: this.ready,
|
|
347
|
-
state:
|
|
781
|
+
state: h,
|
|
348
782
|
uuid: this.uuid
|
|
349
783
|
});
|
|
350
784
|
});
|
|
351
|
-
},
|
|
352
|
-
u.preventDefault(),
|
|
353
|
-
const
|
|
354
|
-
|
|
355
|
-
},
|
|
356
|
-
if (u.preventDefault(), !
|
|
785
|
+
}, i.ontouchstart = (u) => {
|
|
786
|
+
u.preventDefault(), d = Date.now();
|
|
787
|
+
const l = u.touches[0].clientX, h = u.touches[0].clientY;
|
|
788
|
+
a = [], a.push({ x: l, y: h }), r = { x: l, y: h }, o = M({ x: l, y: h }, this.clientWidth, this.clientHeight), c = [];
|
|
789
|
+
}, i.ontouchmove = (u) => {
|
|
790
|
+
if (u.preventDefault(), !r)
|
|
357
791
|
return;
|
|
358
|
-
const
|
|
359
|
-
if (Math.abs(
|
|
792
|
+
const l = Number(u.touches[0].clientX), h = Number(u.touches[0].clientY);
|
|
793
|
+
if (Math.abs(l - r.x) < 5 && Math.abs(h - r.y) < 5 || (a.push({ x: l, y: h }), c.push(M({ x: l, y: h }, this.clientWidth, this.clientHeight)), a.length < 3))
|
|
360
794
|
return;
|
|
361
|
-
const { control: p, end:
|
|
362
|
-
!p || !
|
|
363
|
-
},
|
|
364
|
-
if (u.preventDefault(),
|
|
795
|
+
const { control: p, end: f } = I(a);
|
|
796
|
+
!p || !f || (_(r, p, f), r = f);
|
|
797
|
+
}, i.ontouchend = i.ontouchcancel = (u) => {
|
|
798
|
+
if (u.preventDefault(), r = null, a.length < 3)
|
|
365
799
|
return;
|
|
366
800
|
this.data[this.uuid] || (this.data[this.uuid] = []);
|
|
367
|
-
const
|
|
801
|
+
const l = Date.now() - d, h = {
|
|
368
802
|
move: Object.assign({}, o),
|
|
369
|
-
line: [...
|
|
803
|
+
line: [...c],
|
|
370
804
|
uuid: this.uuid,
|
|
371
805
|
color: this.color,
|
|
372
|
-
duration:
|
|
806
|
+
duration: l < 1280 ? l : l < 2e3 ? 1280 : 0
|
|
807
|
+
// 单次笔迹时长超过2000ms不加动画
|
|
373
808
|
};
|
|
374
|
-
this.data[this.uuid].push(
|
|
809
|
+
this.data[this.uuid].push(h), k(() => {
|
|
375
810
|
this.emitStateChange({
|
|
376
|
-
type:
|
|
811
|
+
type: w.Drawline,
|
|
377
812
|
color: this.color,
|
|
378
813
|
ready: this.ready,
|
|
379
|
-
state:
|
|
814
|
+
state: h,
|
|
380
815
|
uuid: this.uuid
|
|
381
816
|
});
|
|
382
817
|
});
|
|
383
818
|
};
|
|
384
819
|
}
|
|
385
|
-
emitStateChange(
|
|
386
|
-
if (
|
|
387
|
-
this.emit("stateChange",
|
|
820
|
+
emitStateChange(i, n = !0) {
|
|
821
|
+
if (i.type !== w.Drawline) {
|
|
822
|
+
this.emit("stateChange", i, n);
|
|
388
823
|
return;
|
|
389
824
|
}
|
|
390
|
-
const s = Date.now(),
|
|
391
|
-
if (!
|
|
825
|
+
const s = Date.now(), r = i.state;
|
|
826
|
+
if (!r || !r.line)
|
|
392
827
|
return;
|
|
393
|
-
const
|
|
394
|
-
for (let o = 0; o <
|
|
395
|
-
const
|
|
828
|
+
const a = Math.ceil(r.line.length / 100);
|
|
829
|
+
for (let o = 0; o < a; o++) {
|
|
830
|
+
const c = {
|
|
396
831
|
uuid: this.uuid,
|
|
397
832
|
color: this.color,
|
|
398
833
|
ready: this.ready,
|
|
399
|
-
type:
|
|
834
|
+
type: i.type,
|
|
400
835
|
state: {
|
|
401
836
|
uuid: this.uuid,
|
|
402
|
-
move:
|
|
403
|
-
duration:
|
|
837
|
+
move: r.move,
|
|
838
|
+
duration: r.duration,
|
|
404
839
|
color: this.color,
|
|
405
|
-
line:
|
|
840
|
+
line: r.line.slice(o * 100, (o + 1) * 100)
|
|
406
841
|
},
|
|
407
842
|
timestamp: s,
|
|
408
|
-
end: o ===
|
|
843
|
+
end: o === a - 1
|
|
409
844
|
};
|
|
410
|
-
|
|
411
|
-
this.emit("stateChange",
|
|
845
|
+
q(o, 20, () => {
|
|
846
|
+
this.emit("stateChange", c, n);
|
|
412
847
|
});
|
|
413
848
|
}
|
|
414
849
|
}
|
|
415
|
-
action(
|
|
416
|
-
const { ready:
|
|
417
|
-
if (!
|
|
850
|
+
action(i) {
|
|
851
|
+
const { ready: n, type: s, uuid: r } = i;
|
|
852
|
+
if (!n && this.ready) {
|
|
418
853
|
this.closeBrush();
|
|
419
854
|
return;
|
|
420
855
|
}
|
|
421
|
-
if (
|
|
856
|
+
if (n && !this.ready) {
|
|
422
857
|
this.openBrush();
|
|
423
858
|
return;
|
|
424
859
|
}
|
|
425
|
-
if (
|
|
860
|
+
if (this.ready)
|
|
426
861
|
switch (s) {
|
|
427
|
-
case
|
|
428
|
-
const { state:
|
|
429
|
-
if (!o || !
|
|
862
|
+
case w.Drawline:
|
|
863
|
+
const { state: a, timestamp: o, end: c } = i;
|
|
864
|
+
if (!o || !a)
|
|
430
865
|
return;
|
|
431
|
-
this.tempLine[o] = [].concat(this.tempLine[o] || [],
|
|
866
|
+
this.tempLine[o] = [].concat(this.tempLine[o] || [], a.line), c && (Object.assign(a, { line: this.tempLine[o] }), this.handleDrawLine(r, a, {}, () => delete this.tempLine[o]));
|
|
432
867
|
break;
|
|
433
|
-
case
|
|
434
|
-
this.handleUndo(
|
|
868
|
+
case w.Undo:
|
|
869
|
+
this.handleUndo(r);
|
|
435
870
|
break;
|
|
436
871
|
}
|
|
437
872
|
}
|
|
438
|
-
handleDrawLine(
|
|
439
|
-
!
|
|
440
|
-
if (s || (this.canvas[
|
|
873
|
+
handleDrawLine(i, n, { withUndo: s = !1 }, r = F) {
|
|
874
|
+
!n || Object.prototype.toString.call(n) != "[object Object]" || Object.keys(n).length === 0 || z(() => new Promise((a) => {
|
|
875
|
+
if (s || (this.canvas[i] || (this.canvas[i] = this.initCanvas("_paintBrush-canvas--sync")), this.data[i] || (this.data[i] = []), this.data[i].push(n)), !this.canvas[i])
|
|
441
876
|
return;
|
|
442
|
-
const o = this.canvas[
|
|
877
|
+
const o = this.canvas[i].getContext("2d");
|
|
443
878
|
if (!o)
|
|
444
879
|
return;
|
|
445
|
-
const { line:
|
|
446
|
-
let
|
|
447
|
-
if (o.strokeStyle =
|
|
880
|
+
const { line: c = [], color: d = "black", duration: _ = 0, uuid: u } = n, l = j(n.move || {}, this.clientWidth, this.clientHeight);
|
|
881
|
+
let h = [l];
|
|
882
|
+
if (o.strokeStyle = d, o.beginPath(), o.moveTo(l.x, l.y), _ && !s) {
|
|
448
883
|
let p = [];
|
|
449
|
-
const
|
|
450
|
-
|
|
451
|
-
var
|
|
452
|
-
if (
|
|
453
|
-
return o.clearRect(0, 0,
|
|
454
|
-
const
|
|
455
|
-
if (!p.find((
|
|
456
|
-
if (p.push(
|
|
884
|
+
const f = this;
|
|
885
|
+
f.tween = Y({ step: 0 }, { step: c.length - 1 }, _).onUpdate(({ step: v }) => {
|
|
886
|
+
var E;
|
|
887
|
+
if (f.tweening = !0, !f.ready)
|
|
888
|
+
return o.clearRect(0, 0, f.canvas[u].width, f.canvas[u].height), (E = f.tween) == null ? void 0 : E.stop();
|
|
889
|
+
const b = Math.floor(v);
|
|
890
|
+
if (!p.find((B) => B === b)) {
|
|
891
|
+
if (p.push(b), h.push(j(c[b], f.clientWidth, f.clientHeight)), h.length < 3)
|
|
457
892
|
return;
|
|
458
|
-
const { control:
|
|
459
|
-
if (!
|
|
893
|
+
const { control: B, end: D } = I(h);
|
|
894
|
+
if (!B || !D)
|
|
460
895
|
return;
|
|
461
|
-
o.quadraticCurveTo(
|
|
896
|
+
o.quadraticCurveTo(B.x, B.y, D.x, D.y), o.stroke();
|
|
462
897
|
}
|
|
463
|
-
}).onComplete((
|
|
464
|
-
|
|
898
|
+
}).onComplete((v) => {
|
|
899
|
+
f.tween = void 0, f.tweening = !1, p = [], h = [], r && r(), a();
|
|
465
900
|
});
|
|
466
901
|
} else {
|
|
467
|
-
for (let p = 0; p <
|
|
468
|
-
if (
|
|
902
|
+
for (let p = 0; p < c.length; p++) {
|
|
903
|
+
if (h.push(j(c[p], this.clientWidth, this.clientHeight)), h.length < 3)
|
|
469
904
|
continue;
|
|
470
|
-
const { control:
|
|
471
|
-
!
|
|
905
|
+
const { control: f, end: v } = I(h);
|
|
906
|
+
!f || !v || o.quadraticCurveTo(f.x, f.y, v.x, v.y);
|
|
472
907
|
}
|
|
473
|
-
o.stroke(),
|
|
908
|
+
o.stroke(), h = [], r && r(), a();
|
|
474
909
|
}
|
|
475
910
|
}));
|
|
476
911
|
}
|
|
477
|
-
handleUndo(
|
|
478
|
-
if (!this.canvas[
|
|
912
|
+
handleUndo(i) {
|
|
913
|
+
if (!this.canvas[i] || !this.data[i] || this.data[i].length === 0)
|
|
479
914
|
return;
|
|
480
|
-
this.data[
|
|
481
|
-
const
|
|
482
|
-
var
|
|
483
|
-
const s = (
|
|
484
|
-
s && s.clearRect(0, 0, this.canvas[
|
|
915
|
+
this.data[i].pop();
|
|
916
|
+
const n = () => {
|
|
917
|
+
var r;
|
|
918
|
+
const s = (r = this.canvas[i]) == null ? void 0 : r.getContext("2d");
|
|
919
|
+
s && s.clearRect(0, 0, this.canvas[i].width, this.canvas[i].height), this.data[i].forEach((a) => this.handleDrawLine(i, a, { withUndo: !0 }));
|
|
485
920
|
};
|
|
486
921
|
if (this.tween && this.tweening) {
|
|
487
|
-
this.tween.stop(),
|
|
922
|
+
this.tween.stop(), k(n, 60);
|
|
488
923
|
return;
|
|
489
924
|
}
|
|
490
|
-
|
|
925
|
+
n();
|
|
491
926
|
}
|
|
492
927
|
destroyBrush() {
|
|
493
928
|
this.closeBrush(), this.ready = !1, this.emit("readyChange", !0);
|
|
494
929
|
}
|
|
495
930
|
}
|
|
496
|
-
class
|
|
497
|
-
constructor(
|
|
931
|
+
class tt {
|
|
932
|
+
constructor(e = {}) {
|
|
498
933
|
g(this, "controller");
|
|
499
|
-
const
|
|
934
|
+
const i = Object.assign({
|
|
500
935
|
currentColor: "#f44336",
|
|
501
|
-
onUndoText: "
|
|
502
|
-
onExitText: "
|
|
503
|
-
},
|
|
504
|
-
this.controller = new
|
|
936
|
+
onUndoText: "回退",
|
|
937
|
+
onExitText: "关闭"
|
|
938
|
+
}, e);
|
|
939
|
+
this.controller = new K(i);
|
|
505
940
|
}
|
|
506
|
-
on(
|
|
507
|
-
this.controller.on(
|
|
941
|
+
on(e, i) {
|
|
942
|
+
this.controller.on(e, i);
|
|
508
943
|
}
|
|
509
|
-
off(
|
|
510
|
-
this.controller.off(
|
|
944
|
+
off(e, i) {
|
|
945
|
+
this.controller.off(e, i);
|
|
511
946
|
}
|
|
512
|
-
once(
|
|
513
|
-
this.controller.once(
|
|
947
|
+
once(e, i) {
|
|
948
|
+
this.controller.once(e, i);
|
|
514
949
|
}
|
|
950
|
+
/**
|
|
951
|
+
* 显示画笔。
|
|
952
|
+
*/
|
|
515
953
|
show() {
|
|
516
954
|
this.controller.openBrush();
|
|
517
955
|
}
|
|
518
|
-
action(
|
|
519
|
-
this.controller.action(
|
|
956
|
+
action(e) {
|
|
957
|
+
this.controller.action(e);
|
|
520
958
|
}
|
|
959
|
+
/**
|
|
960
|
+
* 获取画笔状态。
|
|
961
|
+
*/
|
|
521
962
|
get state() {
|
|
522
963
|
return this.controller.state;
|
|
523
964
|
}
|
|
524
965
|
get configs() {
|
|
525
966
|
return this.controller.configs;
|
|
526
967
|
}
|
|
968
|
+
/**
|
|
969
|
+
* 销毁。
|
|
970
|
+
*
|
|
971
|
+
* @deprecated
|
|
972
|
+
*
|
|
973
|
+
* @description 画笔应该维护一个 **全局单例**,重复利用。
|
|
974
|
+
*/
|
|
527
975
|
dispose() {
|
|
528
976
|
return this.controller.destroyBrush();
|
|
529
977
|
}
|
|
530
|
-
setCurrentColor(
|
|
531
|
-
this.controller.updateCurrentColor(
|
|
978
|
+
setCurrentColor(e) {
|
|
979
|
+
this.controller.updateCurrentColor(e);
|
|
532
980
|
}
|
|
533
981
|
}
|
|
534
982
|
export {
|
|
535
|
-
|
|
536
|
-
|
|
983
|
+
tt as PaintBrush,
|
|
984
|
+
w as PaintBrushTypeEnum
|
|
537
985
|
};
|