@realsee/dnalogel 2.1.2-alpha.0 → 2.1.2-alpha.2
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/README.md +3 -12
- package/docs/classes/CruisePluginController.html +24 -24
- package/docs/classes/Magnifier.html +16 -16
- package/docs/classes/ModelRoomLabelController.html +11 -11
- package/docs/classes/Object3DHelperController.html +24 -24
- package/docs/classes/PaintBrush.html +15 -15
- package/docs/classes/PanoTagPluginController.html +39 -39
- package/docs/classes/Util.BetterTween.html +8 -8
- package/docs/classes/Util.FivePointSelector.html +12 -12
- package/docs/classes/Util.Interval.html +12 -12
- package/docs/classes/Util.Magnifier.html +17 -17
- package/docs/classes/Util.PointDomHelper.html +11 -11
- package/docs/classes/Util.PointHelper.html +11 -11
- package/docs/classes/Util.Rectangle.html +13 -13
- package/docs/enums/CameraMovementEffect.html +7 -7
- package/docs/enums/ContentType.html +12 -12
- package/docs/enums/DIRECTION.html +9 -9
- package/docs/enums/DISPLAY_STRATEGY_TYPE.html +9 -9
- package/docs/enums/DimensionType.html +7 -7
- package/docs/enums/FLOOR_PLAN_ATTACHED_TO.html +8 -8
- package/docs/enums/ITEM_LABEL_PLUGIN_DISPLAY_STRATEGY_TYPE.html +9 -9
- package/docs/enums/LinkType.html +7 -7
- package/docs/enums/PaintBrushTypeEnum.html +8 -8
- package/docs/enums/PointType.html +7 -7
- package/docs/enums/Rotation.html +8 -8
- package/docs/functions/CSS3DRenderPlugin.html +4 -4
- package/docs/functions/CameraMovementPlugin.html +4 -4
- package/docs/functions/CruisePlugin.html +4 -4
- package/docs/functions/GuideLinePlugin.html +5 -5
- package/docs/functions/ItemLabelPlugin.html +4 -4
- package/docs/functions/MapviewFloorplanPlugin.html +4 -4
- package/docs/functions/ModelChassisCompassPlugin.html +4 -4
- package/docs/functions/ModelEntryDoorGuidePlugin.html +4 -4
- package/docs/functions/ModelFloorplanPlugin.html +4 -4
- package/docs/functions/ModelItemLabelPlugin.html +4 -4
- package/docs/functions/ModelRoomLabelPlugin.html +4 -4
- package/docs/functions/ModelTVVideoPlugin.html +4 -4
- package/docs/functions/ModelViewPlugin.html +4 -4
- package/docs/functions/Object3DHelperPlugin.html +4 -4
- package/docs/functions/PanoCompassPlugin.html +4 -4
- package/docs/functions/PanoCursorRaycasterPlugin.html +4 -4
- package/docs/functions/PanoDoorLabelPlugin.html +4 -4
- package/docs/functions/PanoFloorplanRadarPlugin.html +4 -4
- package/docs/functions/PanoMeasurePlugin.html +4 -4
- package/docs/functions/PanoRulerPlugin.html +4 -4
- package/docs/functions/PanoRulerProPlugin.html +4 -4
- package/docs/functions/PanoSpatialTagPlugin.html +4 -4
- package/docs/functions/PanoTagPlugin.html +4 -4
- package/docs/functions/TopviewFloorplanPlugin.html +4 -4
- package/docs/functions/Util.getCoordsFromClient.html +5 -5
- package/docs/functions/Util.getCoordsFromElement.html +5 -5
- package/docs/functions/Util.getFrameTime.html +5 -5
- package/docs/functions/Util.getIntersectFromRelativePosition.html +5 -5
- package/docs/functions/Util.getRaycasterFromFivePointer.html +5 -5
- package/docs/functions/Util.isNil.html +5 -5
- package/docs/functions/Util.nextFrame.html +5 -5
- package/docs/functions/Util.notNil.html +5 -5
- package/docs/functions/Util.requestAnimationFrameInterval.html +5 -5
- package/docs/functions/Util.tweenProgress.html +5 -5
- package/docs/functions/pluginFlag.html +5 -5
- package/docs/index.html +6 -11
- package/docs/interfaces/CSS3DRenderPluginEventMap.html +11 -11
- package/docs/interfaces/CSS3DRenderPluginState.html +8 -8
- package/docs/interfaces/CameraMovementPluginExportType.html +7 -7
- package/docs/interfaces/ContentTypeMap.html +12 -12
- package/docs/interfaces/FloorplanBounding.html +8 -8
- package/docs/interfaces/FloorplanData.html +10 -10
- package/docs/interfaces/FloorplanEntrance.html +11 -11
- package/docs/interfaces/FloorplanExtraObject.html +10 -10
- package/docs/interfaces/FloorplanExtraObject3D.html +8 -8
- package/docs/interfaces/FloorplanFloorData.html +9 -9
- package/docs/interfaces/FloorplanImagePosition.html +7 -7
- package/docs/interfaces/FloorplanObserver.html +9 -9
- package/docs/interfaces/FloorplanOutlineItem.html +9 -9
- package/docs/interfaces/FloorplanPosition.html +7 -7
- package/docs/interfaces/FloorplanRoomItem.html +13 -13
- package/docs/interfaces/FloorplanRoomLabelItem.html +7 -7
- package/docs/interfaces/FloorplanServerBounding.html +8 -8
- package/docs/interfaces/FloorplanServerComputedData.html +10 -10
- package/docs/interfaces/FloorplanServerData.html +7 -7
- package/docs/interfaces/FloorplanServerDoorItem.html +10 -10
- package/docs/interfaces/FloorplanServerDoorPosition.html +8 -8
- package/docs/interfaces/FloorplanServerEntrance.html +11 -11
- package/docs/interfaces/FloorplanServerFloorData.html +9 -9
- package/docs/interfaces/FloorplanServerImagePosition.html +7 -7
- package/docs/interfaces/FloorplanServerObserver.html +9 -9
- package/docs/interfaces/FloorplanServerOutlineItem.html +9 -9
- package/docs/interfaces/FloorplanServerPosition.html +7 -7
- package/docs/interfaces/FloorplanServerRoomItem.html +14 -14
- package/docs/interfaces/FloorplanServerRoomLabelItem.html +7 -7
- package/docs/interfaces/ItemLabelPluginData.html +6 -6
- package/docs/interfaces/ItemLabelPluginExportReturnsType.html +11 -11
- package/docs/interfaces/ItemLabelPluginParametersType.html +9 -9
- package/docs/interfaces/LineJson.html +7 -7
- package/docs/interfaces/ModelChassisCompassPluginData.html +7 -7
- package/docs/interfaces/ModelChassisCompassPluginExportType.html +8 -8
- package/docs/interfaces/ModelChassisCompassPluginParameterType.html +7 -7
- package/docs/interfaces/ModelEntryDoorGuidePluginData.html +8 -8
- package/docs/interfaces/ModelEntryDoorGuidePluginExportType.html +8 -8
- package/docs/interfaces/ModelItemLabelPluginData.html +6 -6
- package/docs/interfaces/ModelItemLabelPluginExportReturnsType.html +11 -11
- package/docs/interfaces/ModelItemLabelPluginParametersType.html +7 -7
- package/docs/interfaces/ModelRoomLabelPluginData.html +6 -6
- package/docs/interfaces/ModelTVVideoPluginData.html +9 -9
- package/docs/interfaces/ModelTVVideoPluginExportType.html +8 -8
- package/docs/interfaces/ModelTVVideoPluginParameterType.html +6 -6
- package/docs/interfaces/ModelViewPluginExportType.html +8 -8
- package/docs/interfaces/Object3DHelperState.html +8 -8
- package/docs/interfaces/OpenParameter.html +7 -7
- package/docs/interfaces/PaintBrushAction.html +12 -12
- package/docs/interfaces/PaintBrushConfigs.html +12 -12
- package/docs/interfaces/PaintBrushState.html +10 -10
- package/docs/interfaces/PanoCursorRaycasterPluginExportType.html +10 -10
- package/docs/interfaces/PanoCursorRaycasterPluginParameterType.html +5 -5
- package/docs/interfaces/PanoMeasureParameterType.html +11 -11
- package/docs/interfaces/PanoRulerPluginExportType.html +10 -10
- package/docs/interfaces/PanoRulerPluginOptions.html +7 -7
- package/docs/interfaces/PanoRulerPluginParameterType.html +8 -8
- package/docs/interfaces/PanoRulerProPluginExportType.html +9 -9
- package/docs/interfaces/PanoRulerProPluginOptions.html +7 -7
- package/docs/interfaces/PanoRulerProPluginParameterType.html +7 -7
- package/docs/interfaces/PanoRulerProPluginState.html +8 -8
- package/docs/interfaces/PanoSpatialTagPluginContentEvent.html +5 -5
- package/docs/interfaces/PanoSpatialTagPluginContentReplacement.html +5 -5
- package/docs/interfaces/PanoSpatialTagPluginData.html +11 -11
- package/docs/interfaces/PanoSpatialTagPluginDataElement.html +10 -10
- package/docs/interfaces/PanoSpatialTagPluginExportType.html +13 -13
- package/docs/interfaces/PanoSpatialTagPluginOriginElement.html +10 -10
- package/docs/interfaces/PanoSpatialTagPluginParameterType.html +13 -13
- package/docs/interfaces/PanoSpatialTagPluginPointElement.html +11 -11
- package/docs/interfaces/PanoSpatialTagPluginTagElement.html +10 -10
- package/docs/interfaces/Point.html +8 -8
- package/docs/interfaces/PointJson.html +8 -8
- package/docs/interfaces/Room.html +9 -9
- package/docs/interfaces/RoomInfo.html +7 -7
- package/docs/interfaces/RoomLabel.html +14 -14
- package/docs/interfaces/RoomRules.html +5 -5
- package/docs/interfaces/Rooms.html +5 -5
- package/docs/interfaces/Scissor.html +9 -9
- package/docs/interfaces/TagConfig.html +10 -10
- package/docs/interfaces/Tags.html +9 -9
- package/docs/interfaces/Util.MagnifierParameter.html +11 -11
- package/docs/interfaces/Util.MouseGroupParameter.html +8 -8
- package/docs/modules/Util.html +5 -5
- package/docs/modules.html +4 -4
- package/docs/types/ArrayPosition.html +5 -5
- package/docs/types/CSS3DRenderExportType.html +5 -5
- package/docs/types/CSS3DRenderPluginExportType.html +5 -5
- package/docs/types/CSS3DRenderPluginParameterType.html +5 -5
- package/docs/types/Color.html +5 -5
- package/docs/types/ContentTypeConfigKey.html +5 -5
- package/docs/types/ContentTypeConfigKeyArray.html +5 -5
- package/docs/types/Create3DDomContainerReturnType.html +5 -5
- package/docs/types/Create3DElementReturnType.html +5 -5
- package/docs/types/CruisePluginExportType.html +5 -5
- package/docs/types/Direction-1.html +5 -5
- package/docs/types/Direction4.html +5 -5
- package/docs/types/FloorplanRuleLabels.html +5 -5
- package/docs/types/FloorplanServerRuleLabels.html +5 -5
- package/docs/types/GuideLinePluginExportType.html +5 -5
- package/docs/types/HelperEventMap.html +5 -5
- package/docs/types/MapviewFloorplanPluginParameterType.html +5 -5
- package/docs/types/MapviewFloorplanPluginReturnType.html +5 -5
- package/docs/types/MediaData.html +5 -5
- package/docs/types/ModelEntryDoorGuidePluginParameterType.html +5 -5
- package/docs/types/ModelFloorplanPluginParameterType.html +5 -5
- package/docs/types/ModelFloorplanPluginReturnType.html +5 -5
- package/docs/types/ModelRoomLabelPluginParameters.html +5 -5
- package/docs/types/ModelRoomLabelPluginReturnType.html +5 -5
- package/docs/types/MoveArgs.html +5 -5
- package/docs/types/MoveOpts.html +5 -5
- package/docs/types/Object3DHelperEventMap.html +5 -5
- package/docs/types/ObjectFit.html +5 -5
- package/docs/types/PaintBrushEventMap.html +5 -5
- package/docs/types/PanoCompassPluginData.html +5 -5
- package/docs/types/PanoCompassPluginExportType.html +5 -5
- package/docs/types/PanoCompassPluginParameterType.html +5 -5
- package/docs/types/PanoFloorplanRadarPluginParameterType.html +5 -5
- package/docs/types/PanoFloorplanRadarPluginReturnType.html +5 -5
- package/docs/types/PanoMeasurePluginEvent.html +5 -5
- package/docs/types/PanoMeasureReturnType.html +5 -5
- package/docs/types/PanoSpatialTagPluginId.html +5 -5
- package/docs/types/PanoTagPluginExportInterface.html +5 -5
- package/docs/types/PanoTagPluginParamsInterface.html +5 -5
- package/docs/types/PlaneTag.html +5 -5
- package/docs/types/PointTag.html +5 -5
- package/docs/types/Position.html +5 -5
- package/docs/types/RotateArgs.html +5 -5
- package/docs/types/RotateOpts.html +5 -5
- package/docs/types/RuleLabelsKey.html +5 -5
- package/docs/types/RuleLabelsValue.html +5 -5
- package/docs/types/Tag.html +5 -5
- package/docs/types/Tag2D.html +5 -5
- package/docs/types/Tag3D.html +5 -5
- package/docs/types/TagId.html +5 -5
- package/docs/types/TopviewFloorplanPluginParameterType.html +5 -5
- package/docs/types/TopviewFloorplanPluginReturnType.html +5 -5
- package/docs/variables/FLOOR_TYPE_MAP.html +5 -5
- package/docs/variables/PLUGIN.html +5 -5
- package/docs/variables/ROOM_FETILE_TYPE_MAP.html +5 -5
- package/docs/variables/ROOM_TYPE_MAP.html +5 -5
- package/docs/variables/VERSION.html +5 -5
- package/docs/variables/itemLabelPluginServerParams.html +5 -5
- package/docs/variables/modelItemLabelPluginServerParams.html +5 -5
- package/docs/variables/modelRoomLabelPluginServerParams.html +5 -5
- package/libs/CSS3DRenderPlugin/CSS3DRender.js +1 -331
- package/libs/CSS3DRenderPlugin/Controller.js +1 -84
- package/libs/CSS3DRenderPlugin/index.js +1 -6
- package/libs/CSS3DRenderPlugin/typing.js +1 -0
- package/libs/CSS3DRenderPlugin/utils/CSS3DObjectPlus.js +1 -67
- package/libs/CSS3DRenderPlugin/utils/centerPoint.js +1 -10
- package/libs/CSS3DRenderPlugin/utils/evenNumber.js +1 -7
- package/libs/CSS3DRenderPlugin/utils/index.js +1 -0
- package/libs/CSS3DRenderPlugin/utils/positionToVector3.js +1 -7
- package/libs/CSS3DRenderPlugin/utils/random.js +1 -0
- package/libs/CameraMovementPlugin/CameraMovementPlugin.js +1 -88
- package/libs/CameraMovementPlugin/index.js +1 -0
- package/libs/CameraMovementPlugin/typing.js +1 -5
- package/libs/CruisePlugin/Controller.js +1 -484
- package/libs/CruisePlugin/index.js +1 -8
- package/libs/CruisePlugin/utils/coordinatesAngle.js +1 -8
- package/libs/CruisePlugin/utils/coordinatesToVector.js +1 -12
- package/libs/CruisePlugin/utils/formatRad.js +1 -7
- package/libs/CruisePlugin/utils/linerValue.js +1 -7
- package/libs/CruisePlugin/utils/safeCall.js +1 -28
- package/libs/CruisePlugin/utils/sleep.js +1 -10
- package/libs/CruisePlugin/utils/vectorToCoordinates.js +1 -10
- package/libs/GuideLinePlugin/Controller.js +1 -144
- package/libs/GuideLinePlugin/index.js +1 -6
- package/libs/GuideLinePlugin/utils/getArrowMaterial.js +1 -13
- package/libs/GuideLinePlugin/utils/getLineGeometries.js +1 -64
- package/libs/ItemLabelPlugin/ItemLabelComponent.js +1 -271
- package/libs/ItemLabelPlugin/ItemLabelItem.js +2 -133
- package/libs/ItemLabelPlugin/Plugin.js +2 -76
- package/libs/ItemLabelPlugin/index.js +1 -12
- package/libs/ItemLabelPlugin/typings.js +1 -4
- package/libs/ItemLabelPlugin/utils/getLabelTransform.js +1 -4
- package/libs/ItemLabelPlugin/utils/getStrokeLength.js +1 -16
- package/libs/ItemLabelPlugin/utils/isImpacted.js +1 -10
- package/libs/ItemLabelPlugin/utils/parseData.js +1 -21
- package/libs/ItemLabelPlugin/utils/transform2RenderData.js +1 -21
- package/libs/ModelChassisCompassPlugin/Plugin.js +1 -71
- package/libs/ModelChassisCompassPlugin/index.js +1 -0
- package/libs/ModelEntryDoorGuidePlugin/Plugin.js +1 -78
- package/libs/ModelEntryDoorGuidePlugin/index.js +1 -0
- package/libs/ModelItemLabelPlugin/ItemLabelComponent.js +1 -212
- package/libs/ModelItemLabelPlugin/ItemLabelItem.js +2 -42
- package/libs/ModelItemLabelPlugin/ModelItemLabelPlugin.js +2 -74
- package/libs/ModelItemLabelPlugin/events.type.js +1 -0
- package/libs/ModelItemLabelPlugin/index.js +1 -12
- package/libs/ModelItemLabelPlugin/typings.js +1 -4
- package/libs/ModelItemLabelPlugin/utils/parseData.js +1 -19
- package/libs/ModelRoomLabelPlugin/Assets/roomLabelBg.js +1 -4
- package/libs/ModelRoomLabelPlugin/Controller.js +1 -60
- package/libs/ModelRoomLabelPlugin/RoomLabelItem.js +1 -45
- package/libs/ModelRoomLabelPlugin/RoomLabelItems.js +1 -162
- package/libs/ModelRoomLabelPlugin/index.js +1 -10
- package/libs/ModelRoomLabelPlugin/utils/parseData.js +1 -16
- package/libs/ModelTVVideoPlugin/Plugin.js +1 -164
- package/libs/ModelTVVideoPlugin/index.js +1 -0
- package/libs/ModelTVVideoPlugin/typings.js +1 -4
- package/libs/ModelTVVideoPlugin/utils/parseData.js +1 -20
- package/libs/ModelViewPlugin/Plugin.js +1 -107
- package/libs/ModelViewPlugin/index.js +1 -0
- package/libs/Object3DHelperPlugin/Controller.js +1 -145
- package/libs/Object3DHelperPlugin/FiveControllerWrapper.js +1 -32
- package/libs/Object3DHelperPlugin/index.js +1 -10
- package/libs/PanoCompassPlugin/Assets/roomInfoIcon.js +1 -4
- package/libs/PanoCompassPlugin/Controller.js +1 -224
- package/libs/PanoCompassPlugin/getRoomInfoInstance.js +1 -24
- package/libs/PanoCompassPlugin/index.js +1 -6
- package/libs/PanoCursorRaycasterPlugin/index.js +1 -59
- package/libs/PanoDoorLabelPlugin/BaseController.js +1 -59
- package/libs/PanoDoorLabelPlugin/Controller.js +1 -219
- package/libs/PanoDoorLabelPlugin/DoorLabelItem.js +1 -65
- package/libs/PanoDoorLabelPlugin/index.js +1 -6
- package/libs/PanoDoorLabelPlugin/utils.js +1 -23
- package/libs/PanoMeasurePlugin/Controller/BaseController.js +1 -53
- package/libs/PanoMeasurePlugin/Controller/EditController.js +1 -102
- package/libs/PanoMeasurePlugin/Controller/MixedController.js +1 -125
- package/libs/PanoMeasurePlugin/Controller/ShortcutKeyController.js +1 -33
- package/libs/PanoMeasurePlugin/Controller/ViewController.js +1 -90
- package/libs/PanoMeasurePlugin/Controller/WatchController.js +1 -154
- package/libs/PanoMeasurePlugin/Controller/index.js +1 -140
- package/libs/PanoMeasurePlugin/Model/index.js +1 -92
- package/libs/PanoMeasurePlugin/Model/line.js +1 -56
- package/libs/PanoMeasurePlugin/Model/point.js +1 -30
- package/libs/PanoMeasurePlugin/Model/polyline.js +1 -47
- package/libs/PanoMeasurePlugin/Modules/DeleteDom/_Assets/delete.svg.js +2 -5
- package/libs/PanoMeasurePlugin/Modules/DeleteDom/_Assets/delete_bg.png.js +1 -4
- package/libs/PanoMeasurePlugin/Modules/DeleteDom/_Assets/delete_hover_bg.png.js +1 -4
- package/libs/PanoMeasurePlugin/Modules/DeleteDom/index.js +3 -67
- package/libs/PanoMeasurePlugin/Modules/FiveHelper.js +1 -28
- package/libs/PanoMeasurePlugin/Modules/GuideController.js +1 -41
- package/libs/PanoMeasurePlugin/Modules/Magnifier.js +1 -103
- package/libs/PanoMeasurePlugin/Modules/UIController/HTML.js +8 -12
- package/libs/PanoMeasurePlugin/Modules/UIController/MainBtnController.js +1 -50
- package/libs/PanoMeasurePlugin/Modules/UIController/Revoke/index.js +1 -36
- package/libs/PanoMeasurePlugin/Modules/UIController/index.js +1 -48
- package/libs/PanoMeasurePlugin/Modules/UIController/mobileHTML.js +3 -8
- package/libs/PanoMeasurePlugin/Modules/UIController/mobileMainBtnController.js +1 -39
- package/libs/PanoMeasurePlugin/Modules/UIController/style.js +1 -62
- package/libs/PanoMeasurePlugin/Modules/rangePiece/html.js +2 -7
- package/libs/PanoMeasurePlugin/Modules/rangePiece/index.js +1 -130
- package/libs/PanoMeasurePlugin/index.js +1 -11
- package/libs/PanoMeasurePlugin/utils/calculateThreeMouse.js +1 -12
- package/libs/PanoMeasurePlugin/utils/constants.js +1 -36
- package/libs/PanoMeasurePlugin/utils/distanceDom.js +1 -62
- package/libs/PanoMeasurePlugin/utils/findAssociatedLines.js +1 -13
- package/libs/PanoMeasurePlugin/utils/findClosestPoint.js +1 -15
- package/libs/PanoMeasurePlugin/utils/getIntersectionFromEvent.js +1 -9
- package/libs/PanoMeasurePlugin/utils/getPointFromHammerEvent.js +1 -8
- package/libs/PanoMeasurePlugin/utils/ironbox.js +1 -4
- package/libs/PanoMeasurePlugin/utils/isNDCPointInScreen.js +1 -7
- package/libs/PanoMeasurePlugin/utils/line.js +1 -18
- package/libs/PanoMeasurePlugin/utils/math.js +1 -13
- package/libs/PanoMeasurePlugin/utils/mouseGroup.js +3 -33
- package/libs/PanoMeasurePlugin/utils/ndc2Screen.js +1 -8
- package/libs/PanoRulerPlugin/Plugin.js +2 -263
- package/libs/PanoRulerPlugin/index.js +1 -0
- package/libs/PanoRulerPlugin/style.js +2 -5
- package/libs/PanoRulerProPlugin/Controller.js +1 -93
- package/libs/PanoRulerProPlugin/RulerItem.js +1 -128
- package/libs/PanoRulerProPlugin/RulerItems.js +1 -180
- package/libs/PanoRulerProPlugin/index.js +1 -6
- package/libs/PanoSpatialTagPlugin/Components/origins.js +1 -81
- package/libs/PanoSpatialTagPlugin/Components/tag.js +1 -124
- package/libs/PanoSpatialTagPlugin/Plugin.js +1 -247
- package/libs/PanoSpatialTagPlugin/index.js +1 -0
- package/libs/PanoSpatialTagPlugin/store.js +1 -5
- package/libs/PanoSpatialTagPlugin/style.js +1 -11
- package/libs/PanoSpatialTagPlugin/typings.js +1 -0
- package/libs/PanoTagPlugin/Assets/Icon.js +1 -6
- package/libs/PanoTagPlugin/Components/Common/Arrow.js +1 -103
- package/libs/PanoTagPlugin/Components/Common/Audio.js +1 -166
- package/libs/PanoTagPlugin/Components/Common/Line/Polyline.js +1 -93
- package/libs/PanoTagPlugin/Components/Common/Line/Straight.js +1 -90
- package/libs/PanoTagPlugin/Components/Common/Media.js +1 -393
- package/libs/PanoTagPlugin/Components/Common/MediaItem.js +1 -139
- package/libs/PanoTagPlugin/Components/Common/MultiLineText.js +1 -170
- package/libs/PanoTagPlugin/Components/Common/Point/CustomPoint.js +1 -51
- package/libs/PanoTagPlugin/Components/Common/Point/DefaultPoint.js +1 -51
- package/libs/PanoTagPlugin/Components/Common/Point/PointSwitch.js +1 -166
- package/libs/PanoTagPlugin/Components/Common/Shadow.js +15 -124
- package/libs/PanoTagPlugin/Components/Common/Text.js +1 -131
- package/libs/PanoTagPlugin/Components/Tag/AudioTag.js +1 -134
- package/libs/PanoTagPlugin/Components/Tag/CustomTag.js +1 -73
- package/libs/PanoTagPlugin/Components/Tag/ImageTextTag.js +1 -192
- package/libs/PanoTagPlugin/Components/Tag/LinkTag.js +1 -126
- package/libs/PanoTagPlugin/Components/Tag/MarketingTag.js +1 -258
- package/libs/PanoTagPlugin/Components/Tag/MediaPlane.js +1 -87
- package/libs/PanoTagPlugin/Components/Tag/TextTag.js +1 -122
- package/libs/PanoTagPlugin/Components/Tag/index.js +2 -289
- package/libs/PanoTagPlugin/Components/TagContainer.js +1 -156
- package/libs/PanoTagPlugin/Components/TagWrapper.js +1 -153
- package/libs/PanoTagPlugin/controller/TagCacheController.js +1 -31
- package/libs/PanoTagPlugin/controller/TagComputer.js +1 -264
- package/libs/PanoTagPlugin/controller/index.js +1 -377
- package/libs/PanoTagPlugin/index.js +1 -9
- package/libs/PanoTagPlugin/tag.config.js +1 -44
- package/libs/PanoTagPlugin/typings/controller.js +1 -0
- package/libs/PanoTagPlugin/typings/index.js +1 -0
- package/libs/PanoTagPlugin/typings/tag.js +1 -7
- package/libs/PanoTagPlugin/utils/actionAfterFiveModelLoad.js +1 -6
- package/libs/PanoTagPlugin/utils/addDebugPoints.js +1 -27
- package/libs/PanoTagPlugin/utils/checkRange.js +1 -10
- package/libs/PanoTagPlugin/utils/constants.js +1 -8
- package/libs/PanoTagPlugin/utils/debounce.js +1 -12
- package/libs/PanoTagPlugin/utils/doUtil.js +1 -12
- package/libs/PanoTagPlugin/utils/index.js +1 -0
- package/libs/PanoTagPlugin/utils/noTypecheck.js +1 -4
- package/libs/PanoTagPlugin/utils/normalPositionToPositions.js +1 -13
- package/libs/PanoTagPlugin/utils/planeNormal.js +1 -11
- package/libs/PanoTagPlugin/utils/resizeObserver.js +1 -17
- package/libs/PanoTagPlugin/utils/search.js +1 -15
- package/libs/PanoTagPlugin/utils/tagPosition.js +1 -13
- package/libs/PanoTagPlugin/utils/throttle.js +1 -11
- package/libs/base/BasePlugin.js +1 -18
- package/libs/base/BasePluginWithData.js +1 -6
- package/libs/components/PaintBrush/Controller.js +1 -308
- package/libs/components/PaintBrush/Subscribe.js +1 -47
- package/libs/components/PaintBrush/index.js +1 -45
- package/libs/components/PaintBrush/style.js +2 -5
- package/libs/components/PaintBrush/tween.js +1 -11
- package/libs/components/PaintBrush/typings.js +1 -4
- package/libs/components/PaintBrush/utils.js +1 -45
- package/libs/components/index.js +1 -0
- package/libs/floorplan/Assets/camera.js +1 -4
- package/libs/floorplan/Assets/compass.js +1 -4
- package/libs/floorplan/Assets/floorplanExtraObject.js +1 -4
- package/libs/floorplan/Components/BaseImage.js +1 -103
- package/libs/floorplan/Components/Camera.js +1 -62
- package/libs/floorplan/Components/Compass.js +1 -60
- package/libs/floorplan/Components/CurrentFloor.js +1 -246
- package/libs/floorplan/Components/Main.js +1 -264
- package/libs/floorplan/Components/Normalmage.js +1 -37
- package/libs/floorplan/Components/RoomHighlight/Room.js +1 -61
- package/libs/floorplan/Components/RoomHighlight/RoomHighlight.js +1 -121
- package/libs/floorplan/Components/RoomLabels/RoomLabel.js +1 -153
- package/libs/floorplan/Components/RoomLabels/RoomLabels.js +1 -174
- package/libs/floorplan/Components/RoomMaterials/RoomMaterial.js +1 -196
- package/libs/floorplan/Components/RoomMaterials/RoomMaterial_0.js +1 -37
- package/libs/floorplan/Components/RoomMaterials/RoomMaterial_1.js +1 -39
- package/libs/floorplan/Components/RoomMaterials/RoomMaterial_2.js +1 -37
- package/libs/floorplan/Components/RuleLabels/RuleItem.js +1 -134
- package/libs/floorplan/Components/RuleLabels/RuleLabels.js +1 -139
- package/libs/floorplan/Components/SvgImage.js +2 -39
- package/libs/floorplan/MapviewFloorplanPlugin/Controller.js +1 -321
- package/libs/floorplan/MapviewFloorplanPlugin/index.js +1 -6
- package/libs/floorplan/ModelFloorplanPlugin/Controller.js +1 -316
- package/libs/floorplan/ModelFloorplanPlugin/index.js +1 -6
- package/libs/floorplan/PanoFloorplanRadarPlugin/Components/Camera.js +1 -85
- package/libs/floorplan/PanoFloorplanRadarPlugin/Components/CurrentFloor/CurrentFloor.js +1 -129
- package/libs/floorplan/PanoFloorplanRadarPlugin/Components/CurrentFloor/ExtraObjects.js +1 -72
- package/libs/floorplan/PanoFloorplanRadarPlugin/Components/Main.js +1 -183
- package/libs/floorplan/PanoFloorplanRadarPlugin/Controller.js +1 -164
- package/libs/floorplan/PanoFloorplanRadarPlugin/index.js +1 -6
- package/libs/floorplan/TopviewFloorplanPlugin/Controller.js +1 -273
- package/libs/floorplan/TopviewFloorplanPlugin/index.js +1 -6
- package/libs/floorplan/constant.js +1 -4
- package/libs/floorplan/index.js +1 -0
- package/libs/floorplan/typings/floorplanData.js +1 -0
- package/libs/floorplan/typings/floorplanServerData.js +1 -101
- package/libs/floorplan/utils/constant.js +1 -7
- package/libs/floorplan/utils/correctFiveState.js +1 -54
- package/libs/floorplan/utils/formatData.js +1 -104
- package/libs/floorplan/utils/formatPosition.js +1 -35
- package/libs/index.js +1 -92
- package/libs/shared-utils/Object3DHelper/Base/BaseController.js +1 -152
- package/libs/shared-utils/Object3DHelper/Base/BaseHelper.js +1 -53
- package/libs/shared-utils/Object3DHelper/Constants/color.js +1 -21
- package/libs/shared-utils/Object3DHelper/Controller/CSS3DScaleController.js +1 -18
- package/libs/shared-utils/Object3DHelper/Controller/MoveController.js +1 -66
- package/libs/shared-utils/Object3DHelper/Controller/RectangleScaleController.js +1 -109
- package/libs/shared-utils/Object3DHelper/Controller/RotateController.js +1 -134
- package/libs/shared-utils/Object3DHelper/Helper/HTML/rectangleScaleDom.js +1 -79
- package/libs/shared-utils/Object3DHelper/Helper/HTML/tipsDom.js +1 -41
- package/libs/shared-utils/Object3DHelper/Helper/HTML/utils/createElement.js +1 -14
- package/libs/shared-utils/Object3DHelper/Helper/MoveHelper.js +1 -30
- package/libs/shared-utils/Object3DHelper/Helper/Objects/ArrowGroup.js +1 -35
- package/libs/shared-utils/Object3DHelper/Helper/OutlineHelper.js +1 -2
- package/libs/shared-utils/Object3DHelper/Helper/RectangleScaleHelper.js +1 -137
- package/libs/shared-utils/Object3DHelper/Helper/RotateHelper.js +1 -136
- package/libs/shared-utils/Object3DHelper/Helper/index.js +1 -0
- package/libs/shared-utils/Object3DHelper/index.js +1 -169
- package/libs/shared-utils/Object3DHelper/typings/Direction.js +1 -0
- package/libs/shared-utils/Object3DHelper/typings/Hooks.js +1 -0
- package/libs/shared-utils/Object3DHelper/typings/Scissor.js +1 -0
- package/libs/shared-utils/Object3DHelper/typings/index.js +1 -0
- package/libs/shared-utils/Object3DHelper/utils/calculateThreeMouse.js +1 -11
- package/libs/shared-utils/Object3DHelper/utils/direction.js +1 -22
- package/libs/shared-utils/Object3DHelper/utils/filterNotColinearPoints.js +1 -0
- package/libs/shared-utils/Object3DHelper/utils/getMouseRaycaster.js +1 -14
- package/libs/shared-utils/Object3DHelper/utils/getPoint.js +1 -0
- package/libs/shared-utils/Object3DHelper/utils/index.js +1 -0
- package/libs/shared-utils/Object3DHelper/utils/normalPositionToPositions.js +1 -0
- package/libs/shared-utils/Object3DHelper/utils/object3DBoundingPosition.js +1 -0
- package/libs/shared-utils/Object3DHelper/utils/threex/domevents/index.js +1 -191
- package/libs/shared-utils/Object3DHelper/utils/vectorIsEqual.js +1 -6
- package/libs/shared-utils/Subscribe.js +1 -50
- package/libs/shared-utils/animationFrame/BetterTween.js +1 -26
- package/libs/shared-utils/animationFrame/calculateProgress.js +1 -6
- package/libs/shared-utils/animationFrame/formatRad.js +1 -11
- package/libs/shared-utils/animationFrame/index.js +1 -31
- package/libs/shared-utils/animationFrame/tween.js +1 -30
- package/libs/shared-utils/changeModelCanvasOpacity.js +1 -12
- package/libs/shared-utils/createCanvasTextTexture.js +1 -11
- package/libs/shared-utils/createLine/index.js +1 -9
- package/libs/shared-utils/debounce.js +1 -11
- package/libs/shared-utils/equal.js +1 -54
- package/libs/shared-utils/filter.js +1 -10
- package/libs/shared-utils/five/changeMode.js +1 -39
- package/libs/shared-utils/getPxmm.js +1 -21
- package/libs/shared-utils/index.js +1 -31
- package/libs/shared-utils/isNil.js +1 -10
- package/libs/shared-utils/isTruelyObject.js +1 -6
- package/libs/shared-utils/math/Interval.js +1 -23
- package/libs/shared-utils/math/Rectangle.js +1 -23
- package/libs/shared-utils/math/index.js +1 -0
- package/libs/shared-utils/math/planimetry.js +1 -48
- package/libs/shared-utils/math/rad2Deg.js +1 -6
- package/libs/shared-utils/nearlyEqual.js +1 -6
- package/libs/shared-utils/nextFrame.js +1 -6
- package/libs/shared-utils/noop.js +1 -5
- package/libs/shared-utils/object3d2LocalMatrix.js +1 -19
- package/libs/shared-utils/removeArrayItem.js +1 -8
- package/libs/shared-utils/tap.js +1 -6
- package/libs/shared-utils/three/Assets/index.js +1 -4
- package/libs/shared-utils/three/FivePointSelector.js +1 -49
- package/libs/shared-utils/three/Magnifier.js +1 -104
- package/libs/shared-utils/three/PointDomHelper.js +1 -60
- package/libs/shared-utils/three/PointHelper.js +3 -60
- package/libs/shared-utils/three/getCoords.js +1 -13
- package/libs/shared-utils/three/getIntersect.js +1 -8
- package/libs/shared-utils/three/getRaycaster.js +1 -12
- package/libs/shared-utils/three/index.js +1 -0
- package/libs/shared-utils/three/loadTexture.js +1 -28
- package/libs/shared-utils/three/transformPositionToVector3.js +1 -5
- package/libs/shared-utils/three/transfromToMeshBasicMaterial.js +1 -24
- package/libs/shared-utils/throttle.js +1 -11
- package/libs/shared-utils/tinyEJSrender.js +14 -138
- package/libs/shared-utils/to.js +1 -29
- package/libs/shared-utils/uuid.js +1 -10
- package/libs/vendor/swiper/components-shared/get-changed-params.js +1 -0
- package/libs/vendor/swiper/components-shared/get-params.js +1 -0
- package/libs/vendor/swiper/components-shared/mount-swiper.js +1 -0
- package/libs/vendor/swiper/components-shared/params-list.js +1 -0
- package/libs/vendor/swiper/components-shared/update-swiper.js +1 -0
- package/libs/vendor/swiper/components-shared/utils.js +1 -0
- package/libs/vendor/swiper/svelte/swiper-slide.js +1 -0
- package/libs/vendor/swiper/svelte/swiper-svelte.js +1 -0
- package/libs/vendor/swiper/svelte/swiper.js +1 -0
- package/package.json +187 -17
- package/libs/node_modules/.pnpm/swiper@8.4.4/node_modules/swiper/components-shared/get-changed-params.js +0 -29
- package/libs/node_modules/.pnpm/swiper@8.4.4/node_modules/swiper/components-shared/get-params.js +0 -23
- package/libs/node_modules/.pnpm/swiper@8.4.4/node_modules/swiper/components-shared/mount-swiper.js +0 -14
- package/libs/node_modules/.pnpm/swiper@8.4.4/node_modules/swiper/components-shared/params-list.js +0 -120
- package/libs/node_modules/.pnpm/swiper@8.4.4/node_modules/swiper/components-shared/update-swiper.js +0 -36
- package/libs/node_modules/.pnpm/swiper@8.4.4/node_modules/swiper/components-shared/utils.js +0 -32
- package/libs/node_modules/.pnpm/swiper@8.4.4/node_modules/swiper/svelte/swiper-slide.js +0 -182
- package/libs/node_modules/.pnpm/swiper@8.4.4/node_modules/swiper/svelte/swiper.js +0 -254
|
@@ -1,15 +1 @@
|
|
|
1
|
-
function s(u, c)
|
|
2
|
-
const [n, r] = c;
|
|
3
|
-
if (n >= r || r <= 1 || n <= 1)
|
|
4
|
-
return -1;
|
|
5
|
-
const e = {}, a = (t) => (e[t] || (e[t] = u(t)), e[t]);
|
|
6
|
-
for (let t = n; t < r; t++) {
|
|
7
|
-
const i = a(t), l = a(t - 1);
|
|
8
|
-
if (i < l)
|
|
9
|
-
return t;
|
|
10
|
-
}
|
|
11
|
-
return -1;
|
|
12
|
-
}
|
|
13
|
-
export {
|
|
14
|
-
s as searchFirstValueSmallThanLastValue
|
|
15
|
-
};
|
|
1
|
+
"use strict";function i(u,s){const[a,r]=s;if(a>=r||r<=1||a<=1)return-1;const e={},n=t=>(e[t]||(e[t]=u(t)),e[t]);for(let t=a;t<r;t++){const l=n(t),c=n(t-1);if(l<c)return t}return-1}exports.searchFirstValueSmallThanLastValue=i;
|
|
@@ -1,13 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import { anyPositionToVector3 as o } from "../../CSS3DRenderPlugin/utils/positionToVector3.js";
|
|
3
|
-
import "three";
|
|
4
|
-
function a(r) {
|
|
5
|
-
if (Array.isArray(r) && r.length === 4) {
|
|
6
|
-
const t = r.map(o);
|
|
7
|
-
return e(t[0], t[2]);
|
|
8
|
-
} else
|
|
9
|
-
return o(r);
|
|
10
|
-
}
|
|
11
|
-
export {
|
|
12
|
-
a as tagPosition
|
|
13
|
-
};
|
|
1
|
+
"use strict";const r=require("../../CSS3DRenderPlugin/utils/centerPoint.js"),n=require("../../CSS3DRenderPlugin/utils/positionToVector3.js");require("three");function i(e){if(Array.isArray(e)&&e.length===4){const t=e.map(n.anyPositionToVector3);return r.centerPoint(t[0],t[2])}else return n.anyPositionToVector3(e)}exports.tagPosition=i;
|
|
@@ -1,11 +1 @@
|
|
|
1
|
-
function i(n,
|
|
2
|
-
let t;
|
|
3
|
-
return function(...u) {
|
|
4
|
-
t || (n.apply(this, u), t = setTimeout(function() {
|
|
5
|
-
t = null;
|
|
6
|
-
}, e));
|
|
7
|
-
};
|
|
8
|
-
}
|
|
9
|
-
export {
|
|
10
|
-
i as throttle
|
|
11
|
-
};
|
|
1
|
+
"use strict";function i(n,e=200){let t;return function(...u){t||(n.apply(this,u),t=setTimeout(function(){t=null},e))}}exports.throttle=i;
|
package/libs/base/BasePlugin.js
CHANGED
|
@@ -1,18 +1 @@
|
|
|
1
|
-
var i
|
|
2
|
-
var a = (e, r, t) => r in e ? i(e, r, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[r] = t;
|
|
3
|
-
var s = (e, r, t) => (a(e, typeof r != "symbol" ? r + "" : r, t), t);
|
|
4
|
-
import { Subscribe as c } from "../shared-utils/Subscribe.js";
|
|
5
|
-
class x {
|
|
6
|
-
constructor(r, t) {
|
|
7
|
-
s(this, "five");
|
|
8
|
-
s(this, "hooks", new c());
|
|
9
|
-
s(this, "staticPrefix", "//vrlab-static.ljcdn.com");
|
|
10
|
-
this.five = r, t != null && t.staticPrefix && (this.staticPrefix = t.staticPrefix);
|
|
11
|
-
}
|
|
12
|
-
getCurrentState() {
|
|
13
|
-
return this.state;
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
export {
|
|
17
|
-
x as Controller
|
|
18
|
-
};
|
|
1
|
+
"use strict";var i=Object.defineProperty;var a=(r,s,t)=>s in r?i(r,s,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[s]=t;var e=(r,s,t)=>(a(r,typeof s!="symbol"?s+"":s,t),t);const c=require("../shared-utils/Subscribe.js");class l{constructor(s,t){e(this,"five");e(this,"hooks",new c.Subscribe);e(this,"staticPrefix","//vrlab-static.ljcdn.com");this.five=s,t!=null&&t.staticPrefix&&(this.staticPrefix=t.staticPrefix)}getCurrentState(){return this.state}}exports.Controller=l;
|
|
@@ -1,308 +1 @@
|
|
|
1
|
-
var
|
|
2
|
-
var L = (v, p, t) => p in v ? H(v, p, { enumerable: !0, configurable: !0, writable: !0, value: t }) : v[p] = t;
|
|
3
|
-
var f = (v, p, t) => (L(v, typeof p != "symbol" ? p + "" : p, t), t);
|
|
4
|
-
import { transformCoords as w, getQuadraticCurvePoint as b, nextFrame as D, execInterval as N, queue as T, noop as S, unTransformCoords as E } from "./utils.js";
|
|
5
|
-
import W from "./tween.js";
|
|
6
|
-
import { PaintBrushTypeEnum as g } from "./typings.js";
|
|
7
|
-
import { Subscribe as U } from "./Subscribe.js";
|
|
8
|
-
import k from "../../shared-utils/uuid.js";
|
|
9
|
-
import M from "./style.js";
|
|
10
|
-
class X extends U {
|
|
11
|
-
constructor(t) {
|
|
12
|
-
super();
|
|
13
|
-
f(this, "configs");
|
|
14
|
-
f(this, "clientWidth");
|
|
15
|
-
f(this, "clientHeight");
|
|
16
|
-
f(this, "ready", !1);
|
|
17
|
-
f(this, "uuid", k());
|
|
18
|
-
f(this, "tween");
|
|
19
|
-
f(this, "tweening", !1);
|
|
20
|
-
f(this, "container");
|
|
21
|
-
f(this, "canvas");
|
|
22
|
-
f(this, "data", {});
|
|
23
|
-
f(this, "tempLine", {});
|
|
24
|
-
this.configs = t, this.clientWidth = document.body.clientWidth, this.clientHeight = document.body.clientHeight, this.container = this.ifInsertToDOM(), this.canvas = {}, this.initCtrl();
|
|
25
|
-
}
|
|
26
|
-
get color() {
|
|
27
|
-
return this.configs.currentColor;
|
|
28
|
-
}
|
|
29
|
-
get state() {
|
|
30
|
-
return this.data;
|
|
31
|
-
}
|
|
32
|
-
get dpr() {
|
|
33
|
-
return this.configs.DPR || 1;
|
|
34
|
-
}
|
|
35
|
-
ifInsertToDOM() {
|
|
36
|
-
if (this.container)
|
|
37
|
-
return this.container;
|
|
38
|
-
if (this.configs.container)
|
|
39
|
-
this.configs.container.id = "_gl_paintBrush", this.container = this.configs.container;
|
|
40
|
-
else if (document.getElementById("_gl_paintBrush"))
|
|
41
|
-
this.container = document.getElementById("_gl_paintBrush");
|
|
42
|
-
else {
|
|
43
|
-
const t = document.createElement("div");
|
|
44
|
-
t.id = "_gl_paintBrush", document.body.appendChild(t), this.container = t;
|
|
45
|
-
}
|
|
46
|
-
return this.container.innerHTML = M, this.container;
|
|
47
|
-
}
|
|
48
|
-
initCanvas(t) {
|
|
49
|
-
const e = document.createElement("canvas");
|
|
50
|
-
e.className = t, e.width = this.clientWidth, e.height = this.clientHeight;
|
|
51
|
-
const h = e.getContext("2d");
|
|
52
|
-
if (!!h)
|
|
53
|
-
return h.lineWidth = 5 * this.dpr, h.lineCap = "round", h.lineJoin = "round", this.container.appendChild(e), e;
|
|
54
|
-
}
|
|
55
|
-
initCtrl() {
|
|
56
|
-
const t = document.createElement("div");
|
|
57
|
-
t.className = "_paintBrush-ctrl";
|
|
58
|
-
const e = document.createElement("div");
|
|
59
|
-
e.className = "_paintBrush-ctrlinner";
|
|
60
|
-
const h = document.createElement("a");
|
|
61
|
-
h.className = "_paintBrush-ctrlitem _paintBrush-ctrlitem--undo", h.addEventListener("click", (s) => {
|
|
62
|
-
var a;
|
|
63
|
-
if (s.stopPropagation(), this.configs.onClickUndo && this.configs.onClickUndo(), !this.canvas[this.uuid] || !this.data[this.uuid] || this.data[this.uuid].length === 0)
|
|
64
|
-
return;
|
|
65
|
-
const c = this.data[this.uuid].pop();
|
|
66
|
-
c && this.emitStateChange({
|
|
67
|
-
type: g.Undo,
|
|
68
|
-
color: this.color,
|
|
69
|
-
ready: this.ready,
|
|
70
|
-
state: c,
|
|
71
|
-
uuid: this.uuid
|
|
72
|
-
});
|
|
73
|
-
const d = (a = this.canvas[this.uuid]) == null ? void 0 : a.getContext("2d");
|
|
74
|
-
if (!this.canvas[this.uuid])
|
|
75
|
-
return;
|
|
76
|
-
const { width: m, height: o } = this.canvas[this.uuid];
|
|
77
|
-
d && d.clearRect(0, 0, m, o), this.data[this.uuid].forEach((n) => this.handleDrawLine(this.uuid, n, { withUndo: !0 }));
|
|
78
|
-
});
|
|
79
|
-
const i = document.createElement("a");
|
|
80
|
-
return i.className = "_paintBrush-ctrlitem _paintBrush-ctrlitem--close", i.addEventListener("click", (s) => {
|
|
81
|
-
s.stopPropagation(), this.closeBrush(), this.configs.onClickClose && this.configs.onClickClose();
|
|
82
|
-
}), [h, i].forEach((s) => {
|
|
83
|
-
const c = document.createElement("i");
|
|
84
|
-
c.className = "brush-icon";
|
|
85
|
-
const d = document.createElement("span");
|
|
86
|
-
d.className = "brush-txt", d.innerText = s.className.endsWith("undo") ? this.configs.onUndoText : this.configs.onExitText, s.appendChild(c), s.appendChild(d);
|
|
87
|
-
}), e.appendChild(h), e.appendChild(i), t.appendChild(e), this.container.appendChild(t), t;
|
|
88
|
-
}
|
|
89
|
-
openBrush() {
|
|
90
|
-
if (this.ready)
|
|
91
|
-
return;
|
|
92
|
-
this.canvas[this.uuid] || (this.canvas[this.uuid] = this.initCanvas("_paintBrush-canvas")), this.container.className = "brushing";
|
|
93
|
-
const t = this.canvas[this.uuid];
|
|
94
|
-
t.getContext("2d").clearRect(0, 0, t.width, t.height), this.openBrushHandle(), this.ready = !0, this.emit("readyChange", !0);
|
|
95
|
-
}
|
|
96
|
-
closeBrush() {
|
|
97
|
-
!this.ready || (this.container.className = "", this.data = {}, this.tempLine = {}, Object.keys(this.canvas).forEach((t) => {
|
|
98
|
-
this.canvas[t].ontouchstart = () => !1, this.canvas[t].ontouchmove = () => !1, this.canvas[t].ontouchend = () => !1, this.canvas[t].ontouchcancel = () => !1;
|
|
99
|
-
const e = this.canvas[t].getContext("2d");
|
|
100
|
-
e && e.clearRect(0, 0, this.canvas[t].width, this.canvas[t].height);
|
|
101
|
-
}), this.ready = !1, this.emit("readyChange", !1), this.emitStateChange({
|
|
102
|
-
type: g.Exit,
|
|
103
|
-
color: this.color,
|
|
104
|
-
ready: !1,
|
|
105
|
-
uuid: this.uuid
|
|
106
|
-
}));
|
|
107
|
-
}
|
|
108
|
-
updateCurrentColor(t) {
|
|
109
|
-
const e = this.canvas[this.uuid];
|
|
110
|
-
if (!e)
|
|
111
|
-
return;
|
|
112
|
-
const h = e.getContext("2d");
|
|
113
|
-
!h || (this.configs.currentColor = t, h.strokeStyle = t);
|
|
114
|
-
}
|
|
115
|
-
openBrushHandle() {
|
|
116
|
-
const t = this.canvas[this.uuid];
|
|
117
|
-
if (!t)
|
|
118
|
-
return;
|
|
119
|
-
const e = t.getContext("2d");
|
|
120
|
-
if (!e)
|
|
121
|
-
return;
|
|
122
|
-
const h = this.color || "#6D92FF";
|
|
123
|
-
e.strokeStyle = h;
|
|
124
|
-
let i = null, r = [], s, c = [], d = 0;
|
|
125
|
-
const m = (o, a, n) => {
|
|
126
|
-
const l = this.color || "#ff0000";
|
|
127
|
-
e.strokeStyle = l, e.beginPath(), e.moveTo(o.x, o.y), e.quadraticCurveTo(a.x, a.y, n.x, n.y), e.stroke();
|
|
128
|
-
};
|
|
129
|
-
t.onmousedown = (o) => {
|
|
130
|
-
o.preventDefault(), d = Date.now();
|
|
131
|
-
const a = o.clientX, n = o.clientY;
|
|
132
|
-
r = [], r.push({ x: a, y: n }), i = { x: a, y: n }, s = w({ x: a, y: n }, this.clientWidth, this.clientHeight), c = [];
|
|
133
|
-
}, t.onmousemove = (o) => {
|
|
134
|
-
if (o.preventDefault(), !i)
|
|
135
|
-
return;
|
|
136
|
-
const a = Number(o.clientX), n = Number(o.clientY);
|
|
137
|
-
if (Math.abs(a - i.x) < 5 && Math.abs(n - i.y) < 5 || (r.push({ x: a, y: n }), c.push(w({ x: a, y: n }, this.clientWidth, this.clientHeight)), r.length < 3))
|
|
138
|
-
return;
|
|
139
|
-
const { control: l, end: u } = b(r);
|
|
140
|
-
!l || !u || (m(i, l, u), i = u);
|
|
141
|
-
}, t.onmouseup = (o) => {
|
|
142
|
-
if (o.preventDefault(), i = null, r.length < 3)
|
|
143
|
-
return;
|
|
144
|
-
this.data[this.uuid] || (this.data[this.uuid] = []);
|
|
145
|
-
const a = Date.now() - d, n = {
|
|
146
|
-
move: Object.assign({}, s),
|
|
147
|
-
uuid: this.uuid,
|
|
148
|
-
line: [...c],
|
|
149
|
-
color: this.color,
|
|
150
|
-
duration: a < 1280 ? a : a < 2e3 ? 1280 : 0
|
|
151
|
-
};
|
|
152
|
-
this.data[this.uuid].push(n), D(() => {
|
|
153
|
-
this.emitStateChange({
|
|
154
|
-
type: g.Drawline,
|
|
155
|
-
color: this.color,
|
|
156
|
-
ready: this.ready,
|
|
157
|
-
state: n,
|
|
158
|
-
uuid: this.uuid
|
|
159
|
-
});
|
|
160
|
-
});
|
|
161
|
-
}, t.ontouchstart = (o) => {
|
|
162
|
-
o.preventDefault(), d = Date.now();
|
|
163
|
-
const a = o.touches[0].clientX, n = o.touches[0].clientY;
|
|
164
|
-
r = [], r.push({ x: a, y: n }), i = { x: a, y: n }, console.log("ontouchstart", a, n, i), s = w({ x: a, y: n }, this.clientWidth, this.clientHeight), c = [];
|
|
165
|
-
}, t.ontouchmove = (o) => {
|
|
166
|
-
if (o.preventDefault(), !i)
|
|
167
|
-
return;
|
|
168
|
-
const a = Number(o.touches[0].clientX), n = Number(o.touches[0].clientY);
|
|
169
|
-
if (Math.abs(a - i.x) < 5 && Math.abs(n - i.y) < 5 || (r.push({ x: a, y: n }), c.push(w({ x: a, y: n }, this.clientWidth, this.clientHeight)), r.length < 3))
|
|
170
|
-
return;
|
|
171
|
-
const { control: l, end: u } = b(r);
|
|
172
|
-
!l || !u || (m(i, l, u), i = u);
|
|
173
|
-
}, t.ontouchend = t.ontouchcancel = (o) => {
|
|
174
|
-
if (o.preventDefault(), i = null, r.length < 3)
|
|
175
|
-
return;
|
|
176
|
-
this.data[this.uuid] || (this.data[this.uuid] = []);
|
|
177
|
-
const a = Date.now() - d, n = {
|
|
178
|
-
move: Object.assign({}, s),
|
|
179
|
-
line: [...c],
|
|
180
|
-
uuid: this.uuid,
|
|
181
|
-
color: this.color,
|
|
182
|
-
duration: a < 1280 ? a : a < 2e3 ? 1280 : 0
|
|
183
|
-
};
|
|
184
|
-
this.data[this.uuid].push(n), D(() => {
|
|
185
|
-
this.emitStateChange({
|
|
186
|
-
type: g.Drawline,
|
|
187
|
-
color: this.color,
|
|
188
|
-
ready: this.ready,
|
|
189
|
-
state: n,
|
|
190
|
-
uuid: this.uuid
|
|
191
|
-
});
|
|
192
|
-
});
|
|
193
|
-
};
|
|
194
|
-
}
|
|
195
|
-
emitStateChange(t, e = !0) {
|
|
196
|
-
if (t.type !== g.Drawline) {
|
|
197
|
-
this.emit("stateChange", t, e);
|
|
198
|
-
return;
|
|
199
|
-
}
|
|
200
|
-
const h = Date.now(), i = t.state;
|
|
201
|
-
if (!i || !i.line)
|
|
202
|
-
return;
|
|
203
|
-
const r = Math.ceil(i.line.length / 100);
|
|
204
|
-
for (let s = 0; s < r; s++) {
|
|
205
|
-
const c = {
|
|
206
|
-
uuid: this.uuid,
|
|
207
|
-
color: this.color,
|
|
208
|
-
ready: this.ready,
|
|
209
|
-
type: t.type,
|
|
210
|
-
state: {
|
|
211
|
-
uuid: this.uuid,
|
|
212
|
-
move: i.move,
|
|
213
|
-
duration: i.duration,
|
|
214
|
-
color: this.color,
|
|
215
|
-
line: i.line.slice(s * 100, (s + 1) * 100)
|
|
216
|
-
},
|
|
217
|
-
timestamp: h,
|
|
218
|
-
end: s === r - 1
|
|
219
|
-
};
|
|
220
|
-
N(s, 20, () => {
|
|
221
|
-
this.emit("stateChange", c, e);
|
|
222
|
-
});
|
|
223
|
-
}
|
|
224
|
-
}
|
|
225
|
-
action(t) {
|
|
226
|
-
const { ready: e, type: h, uuid: i } = t;
|
|
227
|
-
if (!e && this.ready) {
|
|
228
|
-
this.closeBrush();
|
|
229
|
-
return;
|
|
230
|
-
}
|
|
231
|
-
if (e && !this.ready) {
|
|
232
|
-
this.openBrush();
|
|
233
|
-
return;
|
|
234
|
-
}
|
|
235
|
-
if (!!this.ready)
|
|
236
|
-
switch (h) {
|
|
237
|
-
case g.Drawline:
|
|
238
|
-
const { state: r, timestamp: s, end: c } = t;
|
|
239
|
-
if (!s || !r)
|
|
240
|
-
return;
|
|
241
|
-
this.tempLine[s] = [].concat(this.tempLine[s] || [], r.line), c && (Object.assign(r, { line: this.tempLine[s] }), this.handleDrawLine(i, r, {}, () => delete this.tempLine[s]));
|
|
242
|
-
break;
|
|
243
|
-
case g.Undo:
|
|
244
|
-
this.handleUndo(i);
|
|
245
|
-
break;
|
|
246
|
-
}
|
|
247
|
-
}
|
|
248
|
-
handleDrawLine(t, e, { withUndo: h = !1 }, i = S) {
|
|
249
|
-
!e || Object.prototype.toString.call(e) != "[object Object]" || Object.keys(e).length === 0 || (console.log("handleDrawLine", e, e.line), T(() => new Promise((r) => {
|
|
250
|
-
if (h || (this.canvas[t] || (this.canvas[t] = this.initCanvas("_paintBrush-canvas--sync")), this.data[t] || (this.data[t] = []), this.data[t].push(e)), !this.canvas[t])
|
|
251
|
-
return;
|
|
252
|
-
const s = this.canvas[t].getContext("2d");
|
|
253
|
-
if (!s)
|
|
254
|
-
return;
|
|
255
|
-
const { line: c = [], color: d = "black", duration: m = 0, uuid: o } = e, a = E(e.move || {}, this.clientWidth, this.clientHeight);
|
|
256
|
-
let n = [a];
|
|
257
|
-
if (s.strokeStyle = d, s.beginPath(), s.moveTo(a.x, a.y), m && !h) {
|
|
258
|
-
let l = [];
|
|
259
|
-
const u = this;
|
|
260
|
-
u.tween = W({ step: 0 }, { step: c.length - 1 }, m).onUpdate(({ step: C }) => {
|
|
261
|
-
var _;
|
|
262
|
-
if (u.tweening = !0, !u.ready)
|
|
263
|
-
return s.clearRect(0, 0, u.canvas[o].width, u.canvas[o].height), (_ = u.tween) == null ? void 0 : _.stop();
|
|
264
|
-
const y = Math.floor(C);
|
|
265
|
-
if (!l.find((x) => x === y)) {
|
|
266
|
-
if (l.push(y), console.log("__debug__", c, c[y], y), n.push(E(c[y], u.clientWidth, u.clientHeight)), n.length < 3)
|
|
267
|
-
return;
|
|
268
|
-
const { control: x, end: B } = b(n);
|
|
269
|
-
if (!x || !B)
|
|
270
|
-
return;
|
|
271
|
-
s.quadraticCurveTo(x.x, x.y, B.x, B.y), s.stroke();
|
|
272
|
-
}
|
|
273
|
-
}).onComplete((C) => {
|
|
274
|
-
u.tween = void 0, u.tweening = !1, l = [], n = [], i && i(), r();
|
|
275
|
-
});
|
|
276
|
-
} else {
|
|
277
|
-
for (let l = 0; l < c.length; l++) {
|
|
278
|
-
if (n.push(E(c[l], this.clientWidth, this.clientHeight)), n.length < 3)
|
|
279
|
-
continue;
|
|
280
|
-
const { control: u, end: C } = b(n);
|
|
281
|
-
!u || !C || s.quadraticCurveTo(u.x, u.y, C.x, C.y);
|
|
282
|
-
}
|
|
283
|
-
s.stroke(), n = [], i && i(), r();
|
|
284
|
-
}
|
|
285
|
-
})));
|
|
286
|
-
}
|
|
287
|
-
handleUndo(t) {
|
|
288
|
-
if (console.log("handleUndo", t, this.canvas[t]), !this.canvas[t] || !this.data[t] || this.data[t].length === 0)
|
|
289
|
-
return;
|
|
290
|
-
this.data[t].pop();
|
|
291
|
-
const e = () => {
|
|
292
|
-
var i;
|
|
293
|
-
const h = (i = this.canvas[t]) == null ? void 0 : i.getContext("2d");
|
|
294
|
-
h && h.clearRect(0, 0, this.canvas[t].width, this.canvas[t].height), this.data[t].forEach((r) => this.handleDrawLine(t, r, { withUndo: !0 }));
|
|
295
|
-
};
|
|
296
|
-
if (this.tween && this.tweening) {
|
|
297
|
-
this.tween.stop(), D(e, 60);
|
|
298
|
-
return;
|
|
299
|
-
}
|
|
300
|
-
e();
|
|
301
|
-
}
|
|
302
|
-
destroyBrush() {
|
|
303
|
-
this.closeBrush(), this.ready = !1, this.emit("readyChange", !0);
|
|
304
|
-
}
|
|
305
|
-
}
|
|
306
|
-
export {
|
|
307
|
-
X as Controller
|
|
308
|
-
};
|
|
1
|
+
"use strict";var _=Object.defineProperty;var E=(y,m,t)=>m in y?_(y,m,{enumerable:!0,configurable:!0,writable:!0,value:t}):y[m]=t;var p=(y,m,t)=>(E(y,typeof m!="symbol"?m+"":m,t),t);const l=require("./utils.js"),D=require("./tween.js"),v=require("./typings.js"),T=require("./Subscribe.js"),P=require("../../shared-utils/uuid.js"),S=require("./style.js");class j extends T.Subscribe{constructor(t){super();p(this,"configs");p(this,"clientWidth");p(this,"clientHeight");p(this,"ready",!1);p(this,"uuid",P.uuid());p(this,"tween");p(this,"tweening",!1);p(this,"container");p(this,"canvas");p(this,"data",{});p(this,"tempLine",{});this.configs=t,this.clientWidth=document.body.clientWidth,this.clientHeight=document.body.clientHeight,this.container=this.ifInsertToDOM(),this.canvas={},this.initCtrl()}get color(){return this.configs.currentColor}get state(){return this.data}get dpr(){return this.configs.DPR||1}ifInsertToDOM(){if(this.container)return this.container;if(this.configs.container)this.configs.container.id="_gl_paintBrush",this.container=this.configs.container;else if(document.getElementById("_gl_paintBrush"))this.container=document.getElementById("_gl_paintBrush");else{const t=document.createElement("div");t.id="_gl_paintBrush",document.body.appendChild(t),this.container=t}return this.container.innerHTML=S.PaintBrushStyle,this.container}initCanvas(t){const e=document.createElement("canvas");e.className=t,e.width=this.clientWidth,e.height=this.clientHeight;const h=e.getContext("2d");if(!!h)return h.lineWidth=5*this.dpr,h.lineCap="round",h.lineJoin="round",this.container.appendChild(e),e}initCtrl(){const t=document.createElement("div");t.className="_paintBrush-ctrl";const e=document.createElement("div");e.className="_paintBrush-ctrlinner";const h=document.createElement("a");h.className="_paintBrush-ctrlitem _paintBrush-ctrlitem--undo",h.addEventListener("click",s=>{var r;if(s.stopPropagation(),this.configs.onClickUndo&&this.configs.onClickUndo(),!this.canvas[this.uuid]||!this.data[this.uuid]||this.data[this.uuid].length===0)return;const c=this.data[this.uuid].pop();c&&this.emitStateChange({type:v.PaintBrushTypeEnum.Undo,color:this.color,ready:this.ready,state:c,uuid:this.uuid});const f=(r=this.canvas[this.uuid])==null?void 0:r.getContext("2d");if(!this.canvas[this.uuid])return;const{width:g,height:a}=this.canvas[this.uuid];f&&f.clearRect(0,0,g,a),this.data[this.uuid].forEach(i=>this.handleDrawLine(this.uuid,i,{withUndo:!0}))});const n=document.createElement("a");return n.className="_paintBrush-ctrlitem _paintBrush-ctrlitem--close",n.addEventListener("click",s=>{s.stopPropagation(),this.closeBrush(),this.configs.onClickClose&&this.configs.onClickClose()}),[h,n].forEach(s=>{const c=document.createElement("i");c.className="brush-icon";const f=document.createElement("span");f.className="brush-txt",f.innerText=s.className.endsWith("undo")?this.configs.onUndoText:this.configs.onExitText,s.appendChild(c),s.appendChild(f)}),e.appendChild(h),e.appendChild(n),t.appendChild(e),this.container.appendChild(t),t}openBrush(){if(this.ready)return;this.canvas[this.uuid]||(this.canvas[this.uuid]=this.initCanvas("_paintBrush-canvas")),this.container.className="brushing";const t=this.canvas[this.uuid];t.getContext("2d").clearRect(0,0,t.width,t.height),this.openBrushHandle(),this.ready=!0,this.emit("readyChange",!0)}closeBrush(){!this.ready||(this.container.className="",this.data={},this.tempLine={},Object.keys(this.canvas).forEach(t=>{this.canvas[t].ontouchstart=()=>!1,this.canvas[t].ontouchmove=()=>!1,this.canvas[t].ontouchend=()=>!1,this.canvas[t].ontouchcancel=()=>!1;const e=this.canvas[t].getContext("2d");e&&e.clearRect(0,0,this.canvas[t].width,this.canvas[t].height)}),this.ready=!1,this.emit("readyChange",!1),this.emitStateChange({type:v.PaintBrushTypeEnum.Exit,color:this.color,ready:!1,uuid:this.uuid}))}updateCurrentColor(t){const e=this.canvas[this.uuid];if(!e)return;const h=e.getContext("2d");!h||(this.configs.currentColor=t,h.strokeStyle=t)}openBrushHandle(){const t=this.canvas[this.uuid];if(!t)return;const e=t.getContext("2d");if(!e)return;const h=this.color||"#6D92FF";e.strokeStyle=h;let n=null,o=[],s,c=[],f=0;const g=(a,r,i)=>{const d=this.color||"#ff0000";e.strokeStyle=d,e.beginPath(),e.moveTo(a.x,a.y),e.quadraticCurveTo(r.x,r.y,i.x,i.y),e.stroke()};t.onmousedown=a=>{a.preventDefault(),f=Date.now();const r=a.clientX,i=a.clientY;o=[],o.push({x:r,y:i}),n={x:r,y:i},s=l.transformCoords({x:r,y:i},this.clientWidth,this.clientHeight),c=[]},t.onmousemove=a=>{if(a.preventDefault(),!n)return;const r=Number(a.clientX),i=Number(a.clientY);if(Math.abs(r-n.x)<5&&Math.abs(i-n.y)<5||(o.push({x:r,y:i}),c.push(l.transformCoords({x:r,y:i},this.clientWidth,this.clientHeight)),o.length<3))return;const{control:d,end:u}=l.getQuadraticCurvePoint(o);!d||!u||(g(n,d,u),n=u)},t.onmouseup=a=>{if(a.preventDefault(),n=null,o.length<3)return;this.data[this.uuid]||(this.data[this.uuid]=[]);const r=Date.now()-f,i={move:Object.assign({},s),uuid:this.uuid,line:[...c],color:this.color,duration:r<1280?r:r<2e3?1280:0};this.data[this.uuid].push(i),l.nextFrame(()=>{this.emitStateChange({type:v.PaintBrushTypeEnum.Drawline,color:this.color,ready:this.ready,state:i,uuid:this.uuid})})},t.ontouchstart=a=>{a.preventDefault(),f=Date.now();const r=a.touches[0].clientX,i=a.touches[0].clientY;o=[],o.push({x:r,y:i}),n={x:r,y:i},console.log("ontouchstart",r,i,n),s=l.transformCoords({x:r,y:i},this.clientWidth,this.clientHeight),c=[]},t.ontouchmove=a=>{if(a.preventDefault(),!n)return;const r=Number(a.touches[0].clientX),i=Number(a.touches[0].clientY);if(Math.abs(r-n.x)<5&&Math.abs(i-n.y)<5||(o.push({x:r,y:i}),c.push(l.transformCoords({x:r,y:i},this.clientWidth,this.clientHeight)),o.length<3))return;const{control:d,end:u}=l.getQuadraticCurvePoint(o);!d||!u||(g(n,d,u),n=u)},t.ontouchend=t.ontouchcancel=a=>{if(a.preventDefault(),n=null,o.length<3)return;this.data[this.uuid]||(this.data[this.uuid]=[]);const r=Date.now()-f,i={move:Object.assign({},s),line:[...c],uuid:this.uuid,color:this.color,duration:r<1280?r:r<2e3?1280:0};this.data[this.uuid].push(i),l.nextFrame(()=>{this.emitStateChange({type:v.PaintBrushTypeEnum.Drawline,color:this.color,ready:this.ready,state:i,uuid:this.uuid})})}}emitStateChange(t,e=!0){if(t.type!==v.PaintBrushTypeEnum.Drawline){this.emit("stateChange",t,e);return}const h=Date.now(),n=t.state;if(!n||!n.line)return;const o=Math.ceil(n.line.length/100);for(let s=0;s<o;s++){const c={uuid:this.uuid,color:this.color,ready:this.ready,type:t.type,state:{uuid:this.uuid,move:n.move,duration:n.duration,color:this.color,line:n.line.slice(s*100,(s+1)*100)},timestamp:h,end:s===o-1};l.execInterval(s,20,()=>{this.emit("stateChange",c,e)})}}action(t){const{ready:e,type:h,uuid:n}=t;if(!e&&this.ready){this.closeBrush();return}if(e&&!this.ready){this.openBrush();return}if(!!this.ready)switch(h){case v.PaintBrushTypeEnum.Drawline:const{state:o,timestamp:s,end:c}=t;if(!s||!o)return;this.tempLine[s]=[].concat(this.tempLine[s]||[],o.line),c&&(Object.assign(o,{line:this.tempLine[s]}),this.handleDrawLine(n,o,{},()=>delete this.tempLine[s]));break;case v.PaintBrushTypeEnum.Undo:this.handleUndo(n);break}}handleDrawLine(t,e,{withUndo:h=!1},n=l.noop){!e||Object.prototype.toString.call(e)!="[object Object]"||Object.keys(e).length===0||(console.log("handleDrawLine",e,e.line),l.queue(()=>new Promise(o=>{if(h||(this.canvas[t]||(this.canvas[t]=this.initCanvas("_paintBrush-canvas--sync")),this.data[t]||(this.data[t]=[]),this.data[t].push(e)),!this.canvas[t])return;const s=this.canvas[t].getContext("2d");if(!s)return;const{line:c=[],color:f="black",duration:g=0,uuid:a}=e,r=l.unTransformCoords(e.move||{},this.clientWidth,this.clientHeight);let i=[r];if(s.strokeStyle=f,s.beginPath(),s.moveTo(r.x,r.y),g&&!h){let d=[];const u=this;u.tween=D.tween({step:0},{step:c.length-1},g).onUpdate(({step:C})=>{var b;if(u.tweening=!0,!u.ready)return s.clearRect(0,0,u.canvas[a].width,u.canvas[a].height),(b=u.tween)==null?void 0:b.stop();const x=Math.floor(C);if(!d.find(w=>w===x)){if(d.push(x),console.log("__debug__",c,c[x],x),i.push(l.unTransformCoords(c[x],u.clientWidth,u.clientHeight)),i.length<3)return;const{control:w,end:B}=l.getQuadraticCurvePoint(i);if(!w||!B)return;s.quadraticCurveTo(w.x,w.y,B.x,B.y),s.stroke()}}).onComplete(C=>{u.tween=void 0,u.tweening=!1,d=[],i=[],n&&n(),o()})}else{for(let d=0;d<c.length;d++){if(i.push(l.unTransformCoords(c[d],this.clientWidth,this.clientHeight)),i.length<3)continue;const{control:u,end:C}=l.getQuadraticCurvePoint(i);!u||!C||s.quadraticCurveTo(u.x,u.y,C.x,C.y)}s.stroke(),i=[],n&&n(),o()}})))}handleUndo(t){if(console.log("handleUndo",t,this.canvas[t]),!this.canvas[t]||!this.data[t]||this.data[t].length===0)return;this.data[t].pop();const e=()=>{var n;const h=(n=this.canvas[t])==null?void 0:n.getContext("2d");h&&h.clearRect(0,0,this.canvas[t].width,this.canvas[t].height),this.data[t].forEach(o=>this.handleDrawLine(t,o,{withUndo:!0}))};if(this.tween&&this.tweening){this.tween.stop(),l.nextFrame(e,60);return}e()}destroyBrush(){this.closeBrush(),this.ready=!1,this.emit("readyChange",!0)}}exports.Controller=j;
|
|
@@ -1,47 +1 @@
|
|
|
1
|
-
const
|
|
2
|
-
function r(f) {
|
|
3
|
-
return f[i] || (f[i] = {}), f[i];
|
|
4
|
-
}
|
|
5
|
-
function v(f) {
|
|
6
|
-
f[i] || delete f[i];
|
|
7
|
-
}
|
|
8
|
-
class E {
|
|
9
|
-
hasListener(t) {
|
|
10
|
-
const e = r(this);
|
|
11
|
-
return e && e[t] && e[t].length > 0;
|
|
12
|
-
}
|
|
13
|
-
on(t, e, s) {
|
|
14
|
-
const o = r(this);
|
|
15
|
-
return o[t] || (o[t] = []), o[t].push([e, s || !1]), () => this.off(t, e);
|
|
16
|
-
}
|
|
17
|
-
once(t, e) {
|
|
18
|
-
return this.on(t, e, !0);
|
|
19
|
-
}
|
|
20
|
-
off(t, e) {
|
|
21
|
-
if (t === void 0) {
|
|
22
|
-
v(this);
|
|
23
|
-
return;
|
|
24
|
-
}
|
|
25
|
-
const s = r(this);
|
|
26
|
-
if (s[t] || (s[t] = []), e === void 0) {
|
|
27
|
-
s[t].length = 0;
|
|
28
|
-
return;
|
|
29
|
-
}
|
|
30
|
-
let o = 0;
|
|
31
|
-
for (; o < s[t].length && s[t][o][0] !== e; o++)
|
|
32
|
-
;
|
|
33
|
-
o < s[t].length && s[t].splice(o, 1);
|
|
34
|
-
}
|
|
35
|
-
emit(t, ...e) {
|
|
36
|
-
let s = !1;
|
|
37
|
-
const l = r(this)[t] || [];
|
|
38
|
-
for (let h of l.slice()) {
|
|
39
|
-
const [n, u = !1] = h, c = n(...e);
|
|
40
|
-
u && this.off(t, n), c === !1 && (s = !0);
|
|
41
|
-
}
|
|
42
|
-
return s;
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
export {
|
|
46
|
-
E as Subscribe
|
|
47
|
-
};
|
|
1
|
+
"use strict";const o=Symbol("$$PAINT_BRUSH_EVENT$$");function r(f){return f[o]||(f[o]={}),f[o]}function v(f){f[o]||delete f[o]}class E{hasListener(t){const e=r(this);return e&&e[t]&&e[t].length>0}on(t,e,s){const i=r(this);return i[t]||(i[t]=[]),i[t].push([e,s||!1]),()=>this.off(t,e)}once(t,e){return this.on(t,e,!0)}off(t,e){if(t===void 0){v(this);return}const s=r(this);if(s[t]||(s[t]=[]),e===void 0){s[t].length=0;return}let i=0;for(;i<s[t].length&&s[t][i][0]!==e;i++);i<s[t].length&&s[t].splice(i,1)}emit(t,...e){let s=!1;const l=r(this)[t]||[];for(let u of l.slice()){const[n,c=!1]=u,h=n(...e);c&&this.off(t,n),h===!1&&(s=!0)}return s}}exports.Subscribe=E;
|
|
@@ -1,45 +1 @@
|
|
|
1
|
-
var e = Object.
|
|
2
|
-
var s = (r, o, t) => o in r ? e(r, o, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[o] = t;
|
|
3
|
-
var n = (r, o, t) => (s(r, typeof o != "symbol" ? o + "" : o, t), t);
|
|
4
|
-
import { Controller as l } from "./Controller.js";
|
|
5
|
-
class u {
|
|
6
|
-
constructor(o = {}) {
|
|
7
|
-
n(this, "controller");
|
|
8
|
-
const t = Object.assign({
|
|
9
|
-
currentColor: "#f44336",
|
|
10
|
-
onUndoText: "\u56DE\u9000",
|
|
11
|
-
onExitText: "\u5173\u95ED"
|
|
12
|
-
}, o);
|
|
13
|
-
this.controller = new l(t);
|
|
14
|
-
}
|
|
15
|
-
on(o, t) {
|
|
16
|
-
this.controller.on(o, t);
|
|
17
|
-
}
|
|
18
|
-
off(o, t) {
|
|
19
|
-
this.controller.off(o, t);
|
|
20
|
-
}
|
|
21
|
-
once(o, t) {
|
|
22
|
-
this.controller.once(o, t);
|
|
23
|
-
}
|
|
24
|
-
show() {
|
|
25
|
-
this.controller.openBrush();
|
|
26
|
-
}
|
|
27
|
-
action(o) {
|
|
28
|
-
this.controller.action(o);
|
|
29
|
-
}
|
|
30
|
-
get state() {
|
|
31
|
-
return this.controller.state;
|
|
32
|
-
}
|
|
33
|
-
get configs() {
|
|
34
|
-
return this.controller.configs;
|
|
35
|
-
}
|
|
36
|
-
dispose() {
|
|
37
|
-
return this.controller.destroyBrush();
|
|
38
|
-
}
|
|
39
|
-
setCurrentColor(o) {
|
|
40
|
-
this.controller.updateCurrentColor(o);
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
export {
|
|
44
|
-
u as PaintBrush
|
|
45
|
-
};
|
|
1
|
+
"use strict";var s=Object.defineProperty;var n=(t,r,e)=>r in t?s(t,r,{enumerable:!0,configurable:!0,writable:!0,value:e}):t[r]=e;var o=(t,r,e)=>(n(t,typeof r!="symbol"?r+"":r,e),e);Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const l=require("./Controller.js");require("./utils.js");require("./tween.js");require("@tweenjs/tween.js");require("./typings.js");require("./Subscribe.js");require("../../shared-utils/uuid.js");require("./style.js");class i{constructor(r={}){o(this,"controller");const e=Object.assign({currentColor:"#f44336",onUndoText:"\u56DE\u9000",onExitText:"\u5173\u95ED"},r);this.controller=new l.Controller(e)}on(r,e){this.controller.on(r,e)}off(r,e){this.controller.off(r,e)}once(r,e){this.controller.once(r,e)}show(){this.controller.openBrush()}action(r){this.controller.action(r)}get state(){return this.controller.state}get configs(){return this.controller.configs}dispose(){return this.controller.destroyBrush()}setCurrentColor(r){this.controller.updateCurrentColor(r)}}exports.PaintBrush=i;
|
|
@@ -1,11 +1 @@
|
|
|
1
|
-
|
|
2
|
-
function f(t, a, r, i = u.Linear.None) {
|
|
3
|
-
const e = new s(t).to(a, r).easing(i).start();
|
|
4
|
-
function n(o) {
|
|
5
|
-
!e.update(o) || requestAnimationFrame(n);
|
|
6
|
-
}
|
|
7
|
-
return requestAnimationFrame(n), e;
|
|
8
|
-
}
|
|
9
|
-
export {
|
|
10
|
-
f as default
|
|
11
|
-
};
|
|
1
|
+
"use strict";const t=require("@tweenjs/tween.js");function o(i,r,a,s=t.Easing.Linear.None){const e=new t.Tween(i).to(r,a).easing(s).start();function n(u){!e.update(u)||requestAnimationFrame(n)}return requestAnimationFrame(n),e}exports.tween=o;
|
|
@@ -1,45 +1 @@
|
|
|
1
|
-
function m() {
|
|
2
|
-
}
|
|
3
|
-
const i = () => Promise.resolve(), c = {
|
|
4
|
-
__queue: Promise.resolve()
|
|
5
|
-
};
|
|
6
|
-
function _(e = i) {
|
|
7
|
-
c.__queue = c.__queue.then(e).catch(i);
|
|
8
|
-
}
|
|
9
|
-
function l(e, t, n) {
|
|
10
|
-
const o = e.x, r = e.y, s = Math.floor(o / t * 1e4) / 1e4, u = Math.floor(r / n * 1e4) / 1e4;
|
|
11
|
-
return { x: s, y: u };
|
|
12
|
-
}
|
|
13
|
-
function w(e, t, n) {
|
|
14
|
-
const { x: o, y: r } = e, s = o * t, u = r * n;
|
|
15
|
-
return { x: s, y: u };
|
|
16
|
-
}
|
|
17
|
-
function y(e) {
|
|
18
|
-
if (e.length < 2)
|
|
19
|
-
return {};
|
|
20
|
-
const t = e.slice(-2), n = t[0], o = {
|
|
21
|
-
x: (t[0].x + t[1].x) / 2,
|
|
22
|
-
y: (t[0].y + t[1].y) / 2
|
|
23
|
-
};
|
|
24
|
-
return { control: n, end: o };
|
|
25
|
-
}
|
|
26
|
-
function q(e, t, n = m) {
|
|
27
|
-
new Promise((o) => {
|
|
28
|
-
setTimeout(() => {
|
|
29
|
-
n(), o(!0);
|
|
30
|
-
}, t * e);
|
|
31
|
-
});
|
|
32
|
-
}
|
|
33
|
-
const f = window, a = window.requestAnimationFrame || f.webkitRequestAnimationFrame || ((e) => setTimeout(e, 16));
|
|
34
|
-
function x(e, t = 0) {
|
|
35
|
-
t <= 0 ? a(e) : a(() => x(e, t - 1));
|
|
36
|
-
}
|
|
37
|
-
export {
|
|
38
|
-
q as execInterval,
|
|
39
|
-
y as getQuadraticCurvePoint,
|
|
40
|
-
x as nextFrame,
|
|
41
|
-
m as noop,
|
|
42
|
-
_ as queue,
|
|
43
|
-
l as transformCoords,
|
|
44
|
-
w as unTransformCoords
|
|
45
|
-
};
|
|
1
|
+
"use strict";function m(){}const i=()=>Promise.resolve(),c={__queue:Promise.resolve()};function x(e=i){c.__queue=c.__queue.then(e).catch(i)}function _(e,t,n){const o=e.x,r=e.y,s=Math.floor(o/t*1e4)/1e4,u=Math.floor(r/n*1e4)/1e4;return{x:s,y:u}}function l(e,t,n){const{x:o,y:r}=e,s=o*t,u=r*n;return{x:s,y:u}}function w(e){if(e.length<2)return{};const t=e.slice(-2),n=t[0],o={x:(t[0].x+t[1].x)/2,y:(t[0].y+t[1].y)/2};return{control:n,end:o}}function d(e,t,n=m){new Promise(o=>{setTimeout(()=>{n(),o(!0)},t*e)})}const q=window,a=window.requestAnimationFrame||q.webkitRequestAnimationFrame||(e=>setTimeout(e,16));function f(e,t=0){t<=0?a(e):a(()=>f(e,t-1))}exports.execInterval=d;exports.getQuadraticCurvePoint=w;exports.nextFrame=f;exports.noop=m;exports.queue=x;exports.transformCoords=_;exports.unTransformCoords=l;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./PaintBrush/index.js"),r=require("./PaintBrush/typings.js");require("./PaintBrush/Controller.js");require("./PaintBrush/utils.js");require("./PaintBrush/tween.js");require("@tweenjs/tween.js");require("./PaintBrush/Subscribe.js");require("../shared-utils/uuid.js");require("./PaintBrush/style.js");exports.PaintBrush=e.PaintBrush;exports.PaintBrushTypeEnum=r.PaintBrushTypeEnum;
|
|
@@ -1,4 +1 @@
|
|
|
1
|
-
const v
|
|
2
|
-
export {
|
|
3
|
-
v as CAMERA_IMAGE
|
|
4
|
-
};
|
|
1
|
+
"use strict";const v="data:image/png;base64,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";exports.CAMERA_IMAGE=v;
|