@realsee/dnalogel 2.16.2-alpha.0 → 2.17.0-aplha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/PanoTagPlugin/Archive/deprecated.d.ts +22 -0
- package/dist/PanoTagPlugin/controller/TagComputer.d.ts +3 -3
- package/dist/PanoTagPlugin/controller/TagUtil.d.ts +2 -1
- package/dist/PanoTagPlugin/controller/index.d.ts +2 -2
- package/dist/PanoTagPlugin/typings/controller.d.ts +1 -1
- package/dist/PanoTagPlugin/typings/tag/Tag.d.ts +6 -7
- package/dist/PanoTagPlugin/typings/tag/TagConfig.d.ts +6 -1
- package/dist/PanoTagPlugin/typings/tag/TagData.d.ts +25 -25
- package/dist/PanoTagPlugin/typings/tag/Utils.d.ts +4 -0
- package/dist/PanoTagPlugin/utils/model/mediaPlane.d.ts +15 -25
- package/dist/index.cjs.js +42 -42
- package/dist/index.js +1899 -1855
- package/dist/index.umd.js +42 -42
- package/dist/shared-utils/five/FiveDomEvents.d.ts +6 -0
- package/dist/shared-utils/five/getFloorIndex.d.ts +10 -0
- package/dist/shared-utils/three/FragmentTransparencyMaterial.d.ts +17 -0
- package/dist/shared-utils/three/loadVideoTexture.d.ts +6 -1
- package/dist/typings/utils.type.d.ts +2 -0
- package/docs/assets/search.js +1 -1
- package/docs/classes/CSS3DRender.html +31 -31
- package/docs/classes/CruisePluginController.html +25 -25
- package/docs/classes/Magnifier.html +20 -20
- package/docs/classes/ModelRoomLabelController.html +11 -11
- package/docs/classes/Object3DHelperController.html +24 -24
- package/docs/classes/PaintBrush.html +15 -15
- package/docs/classes/PanoMeasurePluginLine.html +23 -23
- package/docs/classes/PanoMeasurePluginModel.html +22 -22
- package/docs/classes/PanoMeasurePluginPoint.html +14 -14
- package/docs/classes/PanoMeasurePluginPolyline.html +26 -26
- package/docs/classes/PanoTagPluginController.html +81 -369
- 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 +19 -19
- 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/PaintBrushTypeEnum.html +8 -8
- package/docs/enums/Rotation.html +8 -8
- package/docs/functions/CSS3DRenderPlugin.html +6 -5
- package/docs/functions/CameraMovementPlugin.html +6 -5
- package/docs/functions/CruisePlugin.html +6 -5
- package/docs/functions/GuideLinePlugin.html +6 -5
- package/docs/functions/ItemLabelPlugin.html +6 -5
- package/docs/functions/MapviewFloorplanPlugin.html +6 -5
- package/docs/functions/ModelChassisCompassPlugin.html +6 -5
- package/docs/functions/ModelEntryDoorGuidePlugin.html +6 -5
- package/docs/functions/ModelFloorplanPlugin.html +6 -5
- package/docs/functions/ModelItemLabelPlugin.html +6 -5
- package/docs/functions/ModelRoomLabelPlugin.html +6 -5
- package/docs/functions/ModelTVVideoPlugin.html +6 -5
- package/docs/functions/ModelViewPlugin.html +6 -5
- package/docs/functions/Object3DHelperPlugin.html +6 -5
- package/docs/functions/PanoCompassPlugin.html +6 -5
- package/docs/functions/PanoCursorRaycasterPlugin.html +6 -5
- package/docs/functions/PanoDoorLabelPlugin.html +6 -5
- package/docs/functions/PanoFloorplanRadarPlugin.html +6 -5
- package/docs/functions/PanoMeasurePlugin.html +6 -5
- package/docs/functions/PanoRulerPlugin.html +6 -5
- package/docs/functions/PanoRulerProPlugin.html +6 -5
- package/docs/functions/PanoSpatialTagPlugin.html +6 -5
- package/docs/functions/PanoTagPlugin.html +6 -5
- package/docs/functions/PanoVideoPlugin.html +6 -5
- package/docs/functions/TopviewFloorplanPlugin.html +6 -5
- 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 +6 -5
- package/docs/index.html +5 -4
- package/docs/interfaces/AddTagConfig.html +6 -6
- package/docs/interfaces/CSS3DRenderPluginEventMap.html +11 -11
- package/docs/interfaces/CSS3DRenderPluginState.html +8 -8
- package/docs/interfaces/CameraMovementPluginExportType.html +7 -7
- package/docs/interfaces/EventMap.html +19 -19
- 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/HelperOffset.html +8 -8
- package/docs/interfaces/ImagePlaneGroup.html +6 -6
- package/docs/interfaces/ItemLabelPluginData.html +6 -6
- package/docs/interfaces/ItemLabelPluginExportReturnsType.html +11 -11
- package/docs/interfaces/ItemLabelPluginParametersType.html +9 -9
- package/docs/interfaces/MinMax.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 +11 -11
- package/docs/interfaces/Object3DHelperState.html +8 -8
- package/docs/interfaces/ObjectHelperControllers.html +9 -9
- 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 +6 -5
- package/docs/interfaces/PanoMeasureParameterType.html +14 -14
- package/docs/interfaces/PanoMeasurePluginLineJson.html +8 -8
- package/docs/interfaces/PanoMeasurePluginOpenParameter.html +7 -7
- package/docs/interfaces/PanoMeasurePluginPointJson.html +7 -7
- package/docs/interfaces/PanoMeasurePluginPolylineJson.html +8 -8
- 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 +6 -5
- package/docs/interfaces/PanoSpatialTagPluginContentReplacement.html +6 -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/PanoVideoPluginType.LoadParams.html +6 -6
- package/docs/interfaces/PanoVideoPluginType.PanoVideoItem.html +8 -8
- package/docs/interfaces/PanoVideoPluginType.PluginData.html +6 -6
- package/docs/interfaces/PanoVideoPluginType.PluginEventMap.html +9 -9
- package/docs/interfaces/PanoVideoPluginType.PluginState.html +6 -6
- package/docs/interfaces/PanoVideoPluginType.VideoItem.html +8 -8
- package/docs/interfaces/PanoVideoPluginType.VideoMeshParams.html +10 -10
- package/docs/interfaces/Point.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 +6 -5
- package/docs/interfaces/Rooms.html +6 -5
- package/docs/interfaces/Scissor.html +9 -9
- package/docs/interfaces/State.html +8 -8
- package/docs/interfaces/TagCacheInterface.html +12 -12
- package/docs/interfaces/TagConfig.html +19 -12
- package/docs/interfaces/TagGLTFObjectGroup.html +6 -6
- package/docs/interfaces/TagIconUrl.html +11 -11
- package/docs/interfaces/TagObjectGroup.html +6 -6
- package/docs/interfaces/TagStyle.html +6 -6
- package/docs/interfaces/Tags.html +214 -13
- package/docs/interfaces/TemporaryState.html +6 -6
- package/docs/interfaces/Util.MagnifierParameter.html +11 -11
- package/docs/interfaces/Util.MouseGroupParameter.html +8 -8
- package/docs/modules/PanoVideoPluginType.html +5 -5
- package/docs/modules/Util.html +5 -5
- package/docs/modules.html +6 -4
- package/docs/types/ArrayPosition.html +6 -5
- package/docs/types/AudioAppearance.html +6 -5
- package/docs/types/AudioTagTypeConfigKey.html +6 -5
- package/docs/types/CSS3DRenderExportType.html +6 -5
- package/docs/types/CSS3DRenderPluginExportType.html +6 -5
- package/docs/types/CSS3DRenderPluginParameterType.html +6 -5
- package/docs/types/ClassFunctionParameters.html +6 -5
- package/docs/types/Color.html +6 -5
- package/docs/types/ContentTypeConfigKey.html +6 -5
- package/docs/types/ContentTypeConfigKeySplit.html +6 -5
- package/docs/types/ContentTypeMap.html +7 -6
- package/docs/types/Create3DDomContainerReturnType.html +6 -5
- package/docs/types/Create3DElementReturnType.html +6 -5
- package/docs/types/CruisePluginExportType.html +6 -5
- package/docs/types/Direction-1.html +6 -5
- package/docs/types/Direction4.html +6 -5
- package/docs/types/ElementRenderer.html +6 -5
- package/docs/types/FloorplanRuleLabels.html +6 -5
- package/docs/types/FloorplanServerRuleLabels.html +6 -5
- package/docs/types/GuideLinePluginExportType.html +6 -5
- package/docs/types/HelperEventMap.html +6 -5
- package/docs/types/LoadTagConfig.html +6 -5
- package/docs/types/MapviewFloorplanPluginParameterType.html +6 -5
- package/docs/types/MapviewFloorplanPluginReturnType.html +6 -5
- package/docs/types/MediaData.html +6 -5
- package/docs/types/MediaStore.html +6 -5
- package/docs/types/ModelElement.html +6 -5
- package/docs/types/ModelEntryDoorGuidePluginParameterType.html +6 -5
- package/docs/types/ModelFloorplanPluginParameterType.html +6 -5
- package/docs/types/ModelFloorplanPluginReturnType.html +6 -5
- package/docs/types/ModelRoomLabelPluginParameters.html +6 -5
- package/docs/types/ModelRoomLabelPluginReturnType.html +6 -5
- package/docs/types/MoveArgs.html +6 -5
- package/docs/types/MoveOpts.html +6 -5
- package/docs/types/Object3DHelperEventMap.html +6 -5
- package/docs/types/ObjectFit.html +6 -5
- package/docs/types/PaintBrushEventMap.html +6 -5
- package/docs/types/PanoCompassPluginData.html +6 -5
- package/docs/types/PanoCompassPluginExportType.html +6 -5
- package/docs/types/PanoCompassPluginParameterType.html +6 -5
- package/docs/types/PanoFloorplanRadarPluginParameterType.html +6 -5
- package/docs/types/PanoFloorplanRadarPluginReturnType.html +6 -5
- package/docs/types/PanoIndex.html +6 -5
- package/docs/types/PanoMeasurePluginEvent.html +6 -5
- package/docs/types/PanoMeasureReturnType.html +6 -5
- package/docs/types/PanoSpatialTagPluginId.html +6 -5
- package/docs/types/PanoTagPluginExportInterface.html +6 -5
- package/docs/types/PanoTagPluginParamsInterface.html +6 -5
- package/docs/types/PanoVideoPluginParameterType.html +6 -5
- package/docs/types/PanoVideoPluginReturnType.html +6 -5
- package/docs/types/PickTagContentTypeInContentTypeConfigKey.html +275 -0
- package/docs/types/PlaneTag.html +6 -5
- package/docs/types/PlaneTagElement.html +6 -5
- package/docs/types/Point2DElement.html +6 -5
- package/docs/types/Point2DTag.html +6 -5
- package/docs/types/Point3DElement.html +6 -5
- package/docs/types/Point3DTag.html +6 -5
- package/docs/types/PointTag.html +6 -5
- package/docs/types/PointTagElement.html +6 -5
- package/docs/types/Position.html +6 -5
- package/docs/types/RotateArgs.html +6 -5
- package/docs/types/RotateOpts.html +6 -5
- package/docs/types/RuleLabelsKey.html +6 -5
- package/docs/types/RuleLabelsValue.html +6 -5
- package/docs/types/StickType.html +6 -5
- package/docs/types/Tag.html +7 -6
- package/docs/types/Tag2D.html +6 -5
- package/docs/types/Tag3D.html +6 -5
- package/docs/types/TagContentType.html +6 -5
- package/docs/types/TagDimensionType.html +6 -5
- package/docs/types/TagElement.html +6 -5
- package/docs/types/TagEvents.html +6 -5
- package/docs/types/TagGLTFObject.html +6 -5
- package/docs/types/TagHooks.html +6 -5
- package/docs/types/TagIconSize.html +6 -5
- package/docs/types/TagId.html +6 -5
- package/docs/types/TopviewFloorplanPluginParameterType.html +6 -5
- package/docs/types/TopviewFloorplanPluginReturnType.html +6 -5
- package/docs/types/WorkCode.html +6 -5
- package/docs/variables/FLOOR_TYPE_MAP.html +6 -5
- package/docs/variables/PLUGIN.html +6 -5
- package/docs/variables/ROOM_FETILE_TYPE_MAP.html +6 -5
- package/docs/variables/ROOM_TYPE_MAP.html +6 -5
- package/docs/variables/itemLabelPluginServerParams.html +6 -5
- package/docs/variables/modelItemLabelPluginServerParams.html +6 -5
- package/docs/variables/modelRoomLabelPluginServerParams.html +6 -5
- package/libs/PanoTagPlugin/Archive/deprecated.d.ts +15 -0
- package/libs/PanoTagPlugin/Components/Common/Media.js +14 -10
- package/libs/PanoTagPlugin/Components/Tag/ImageTextTag.js +1 -1
- package/libs/PanoTagPlugin/controller/TagComputer.d.ts +3 -3
- package/libs/PanoTagPlugin/controller/TagComputer.js +173 -171
- package/libs/PanoTagPlugin/controller/TagRender.js +51 -44
- package/libs/PanoTagPlugin/controller/TagUtil.d.ts +2 -1
- package/libs/PanoTagPlugin/controller/TagUtil.js +21 -16
- package/libs/PanoTagPlugin/controller/index.d.ts +2 -2
- package/libs/PanoTagPlugin/controller/index.js +45 -41
- package/libs/PanoTagPlugin/index.js +12 -10
- package/libs/PanoTagPlugin/tag.config.js +7 -0
- package/libs/PanoTagPlugin/typings/controller.d.ts +1 -1
- package/libs/PanoTagPlugin/typings/tag/Tag.d.ts +6 -7
- package/libs/PanoTagPlugin/typings/tag/TagConfig.d.ts +6 -1
- package/libs/PanoTagPlugin/typings/tag/TagData.d.ts +25 -25
- package/libs/PanoTagPlugin/typings/tag/Utils.d.ts +4 -0
- package/libs/PanoTagPlugin/utils/model/mediaPlane.d.ts +15 -25
- package/libs/PanoTagPlugin/utils/model/mediaPlane.js +130 -158
- package/libs/base/BasePlugin.js +1 -1
- package/libs/index.js +104 -102
- package/libs/shared-utils/five/FiveDomEvents.d.ts +6 -0
- package/libs/shared-utils/five/FiveDomEvents.js +48 -38
- package/libs/shared-utils/five/getFloorIndex.d.ts +10 -0
- package/libs/shared-utils/five/getFloorIndex.js +16 -0
- package/libs/shared-utils/logger.js +1 -1
- package/libs/shared-utils/three/FragmentTransparencyMaterial.d.ts +17 -0
- package/libs/shared-utils/three/FragmentTransparencyMaterial.js +36 -0
- package/libs/shared-utils/three/loadVideoTexture.d.ts +6 -1
- package/libs/shared-utils/three/loadVideoTexture.js +8 -10
- package/libs/typings/utils.type.d.ts +2 -0
- package/libs/typings/utils.type.js +1 -0
- package/package.json +2 -2
- package/libs/PanoTagPlugin/Archive/index.d.ts +0 -1
- package/libs/PanoTagPlugin/Archive/index.js +0 -4
|
@@ -1,14 +1,18 @@
|
|
|
1
1
|
import type { Create3DDomContainerParamsType } from '../../../CSS3DRenderPlugin/Controller';
|
|
2
2
|
import type { Five, Mode } from '@realsee/five';
|
|
3
|
-
import type { TagContentType } from './TagData';
|
|
3
|
+
import type { ContentTypeMap, TagContentType } from './TagData';
|
|
4
4
|
import type { Tag } from './Tag';
|
|
5
5
|
import type { MinMax, StickType } from './Utils';
|
|
6
|
+
import type { PartialDeep } from 'type-fest';
|
|
6
7
|
export interface TagConfig<C extends TagContentType = TagContentType, S extends StickType = StickType> {
|
|
7
8
|
/** 显示/隐藏配置 */
|
|
8
9
|
visibleConfig?: {
|
|
9
10
|
/** 保持可见/不可见, 设置后visibleConfig下所有其他配置都不生效 */
|
|
10
11
|
keep?: 'visible' | 'hidden';
|
|
12
|
+
/** 在哪些 five mode 下可见,默认为 [’Panorama‘] */
|
|
11
13
|
visibleFiveMode?: Mode[];
|
|
14
|
+
/** 当 visibleFiveMode 包含 'Floorplan' 或者 'MapView' 时,是否仅在当前楼层模型下可见,默认为true */
|
|
15
|
+
followModelVisibility?: boolean;
|
|
12
16
|
/** 走点时不隐藏 */
|
|
13
17
|
alwaysShowWhenMovePano?: true;
|
|
14
18
|
/** min-max米内显示 | 无距离限制 */
|
|
@@ -84,6 +88,7 @@ export interface TagConfig<C extends TagContentType = TagContentType, S extends
|
|
|
84
88
|
/** 展开/收起 */
|
|
85
89
|
unfolded?: boolean;
|
|
86
90
|
};
|
|
91
|
+
initialData?: PartialDeep<ContentTypeMap[C]>;
|
|
87
92
|
tag3DConfig?: Create3DDomContainerParamsType['config'];
|
|
88
93
|
/** 当图片为一张时可以通过Mesh渲染 */
|
|
89
94
|
renderType?: 'Mesh' | 'Dom';
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { DeprecatedMediaPlaneProperty } from '../../Archive/deprecated';
|
|
1
2
|
import type { Position, TagIconUrl } from './Utils';
|
|
2
3
|
export declare type MediaData = {
|
|
3
4
|
type: 'Image';
|
|
@@ -7,8 +8,8 @@ export declare type MediaData = {
|
|
|
7
8
|
url: string;
|
|
8
9
|
videoCoverUrl?: string;
|
|
9
10
|
};
|
|
10
|
-
declare type Object = Record<string | number | symbol, any>;
|
|
11
11
|
export declare type ObjectFit = 'fill' | 'contain' | 'cover' | 'none' | 'scale-down';
|
|
12
|
+
declare type Object = Record<string | number | symbol, any>;
|
|
12
13
|
export declare enum ContentType {
|
|
13
14
|
/** 音频标签 */
|
|
14
15
|
Audio = "Audio",
|
|
@@ -51,7 +52,6 @@ interface ContentTypeMapInterface {
|
|
|
51
52
|
text?: string;
|
|
52
53
|
title?: string;
|
|
53
54
|
description?: string;
|
|
54
|
-
extraData?: Object;
|
|
55
55
|
edit?: {
|
|
56
56
|
title?: {
|
|
57
57
|
inputting?: boolean;
|
|
@@ -72,7 +72,6 @@ interface ContentTypeMapInterface {
|
|
|
72
72
|
appearance?: 'line' | 'plane';
|
|
73
73
|
theme?: 'dark' | 'light';
|
|
74
74
|
audioUrl: string;
|
|
75
|
-
extraData?: Object;
|
|
76
75
|
};
|
|
77
76
|
/** 图文标签 */
|
|
78
77
|
ImageText: {
|
|
@@ -82,7 +81,6 @@ interface ContentTypeMapInterface {
|
|
|
82
81
|
mediaData: (MediaData & {
|
|
83
82
|
name?: string;
|
|
84
83
|
})[];
|
|
85
|
-
extraData?: Object;
|
|
86
84
|
};
|
|
87
85
|
/** 图片标签 */
|
|
88
86
|
Image: ContentTypeMapInterface['ImageText'];
|
|
@@ -96,7 +94,6 @@ interface ContentTypeMapInterface {
|
|
|
96
94
|
/** @deprecated: linkType 不再和样式绑定,使用 iconUrl 代替 */
|
|
97
95
|
linkType?: 'vr' | 'normal';
|
|
98
96
|
icon?: TagIconUrl;
|
|
99
|
-
extraData?: Object;
|
|
100
97
|
};
|
|
101
98
|
/** VR跳转标签 */
|
|
102
99
|
VRLink: ContentTypeMapInterface['Link'];
|
|
@@ -126,35 +123,33 @@ interface ContentTypeMapInterface {
|
|
|
126
123
|
/** 单位 */
|
|
127
124
|
unit: string;
|
|
128
125
|
};
|
|
129
|
-
extraData?: Object;
|
|
130
126
|
};
|
|
131
127
|
/** 营销贴片 */
|
|
132
128
|
MediaPlane: {
|
|
133
129
|
enableCarousel?: boolean;
|
|
134
|
-
/**
|
|
135
|
-
* @description stretch: 拉伸适配, proportional: 等比适配,默认值 'proportional'
|
|
136
|
-
* @deprecated replaced by objectFit
|
|
137
|
-
*/
|
|
138
|
-
adaptationMode?: 'stretch' | 'proportional';
|
|
139
130
|
/** 多媒体在容器中的适配规则 {@link https://developer.mozilla.org/zh-CN/docs/Web/CSS/object-fit} */
|
|
140
131
|
objectFit?: ObjectFit;
|
|
141
|
-
/**
|
|
142
|
-
* @description 是否开启自动轮播
|
|
143
|
-
* @param autoplay true: 开启自动轮播, false: 关闭自动播放
|
|
144
|
-
* @param autoplayVideo 自动轮播时,如果是视频, 则自动播放视频
|
|
145
|
-
* @default 默认值 { autoplay: true, autoplayVideo: false }
|
|
146
|
-
*/
|
|
147
132
|
autoplayConfig?: {
|
|
148
|
-
|
|
149
|
-
|
|
133
|
+
/**
|
|
134
|
+
* @description 是否自动播放视频
|
|
135
|
+
* @default autoplayVideo: false
|
|
136
|
+
*/
|
|
137
|
+
autoplayVideo?: boolean;
|
|
138
|
+
/**
|
|
139
|
+
* @description 是否自动轮播
|
|
140
|
+
* @default autoplayCarousel: true
|
|
141
|
+
*/
|
|
142
|
+
autoplayCarousel?: boolean;
|
|
143
|
+
/**
|
|
144
|
+
* @description 轮播中遇到视频是否要自动播放
|
|
145
|
+
* @default autoplayVideoInCarousel: false
|
|
146
|
+
*/
|
|
147
|
+
autoplayVideoInCarousel?: boolean;
|
|
150
148
|
};
|
|
151
149
|
mediaData: MediaData[];
|
|
152
|
-
/**
|
|
153
|
-
* @description 暂停时的播放按钮url
|
|
154
|
-
*/
|
|
150
|
+
/** @description 暂停时的播放按钮url */
|
|
155
151
|
playIcon?: 'withText' | 'withoutText' | string;
|
|
156
|
-
|
|
157
|
-
};
|
|
152
|
+
} & DeprecatedMediaPlaneProperty;
|
|
158
153
|
MediaModel: {
|
|
159
154
|
modelUrl: string;
|
|
160
155
|
mediaData: MediaData[];
|
|
@@ -170,5 +165,10 @@ interface ContentTypeMapInterface {
|
|
|
170
165
|
Custom: Object;
|
|
171
166
|
Unknown: Object;
|
|
172
167
|
}
|
|
173
|
-
|
|
168
|
+
declare type ContentTypeMapInterfaceWithextraData = {
|
|
169
|
+
[key in keyof ContentTypeMapInterface]: ContentTypeMapInterface[key] & {
|
|
170
|
+
extraData?: Object;
|
|
171
|
+
};
|
|
172
|
+
};
|
|
173
|
+
export declare type ContentTypeMap = Pick<ContentTypeMapInterfaceWithextraData, TagContentType>;
|
|
174
174
|
export {};
|
|
@@ -62,6 +62,10 @@ export declare type TagIconSize = 'S' | 'M' | 'L' | 'XL' | number;
|
|
|
62
62
|
export declare type AudioAppearance = Tag<'Audio'>['data']['appearance'];
|
|
63
63
|
export declare type AudioTagTypeConfigKey = `${StickType | 'Any'}-Audio-${AudioAppearance}`;
|
|
64
64
|
export declare type ContentTypeConfigKey = `${StickType | 'Any'}-${TagContentType | 'Any'}` | TagContentType | AudioTagTypeConfigKey;
|
|
65
|
+
/**
|
|
66
|
+
* @description: 从 ContentTypeConfigKey 中提取 ContentTypeConfigKey 对应的 ContentType 是啥,没找到就是 never
|
|
67
|
+
*/
|
|
68
|
+
export declare type PickTagContentTypeInContentTypeConfigKey<T extends ContentTypeConfigKey> = T extends `${any}-Audio-${any}` ? 'Audio' : T extends `${any}-${infer C}` ? C : T extends TagContentType ? T : never;
|
|
65
69
|
export declare type ContentTypeConfigKeySplit = [StickType | 'Any', TagContentType | 'Any'] | [TagContentType] | [StickType | 'Any', 'Audio', AudioAppearance];
|
|
66
70
|
export declare type PointTag<C extends TagContentType = TagContentType> = Tag<C, '2DPoint' | '3DPoint'>;
|
|
67
71
|
/** 二维标签 */
|
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
import * as THREE from 'three';
|
|
2
2
|
import { Vector3 } from 'three';
|
|
3
3
|
import { ObjectFit } from '../../typings';
|
|
4
|
+
import DomEvents from '../../../shared-utils/threex/domevents';
|
|
5
|
+
import { Overwrite } from '../../../typings/utils.type';
|
|
4
6
|
declare type Src = string;
|
|
5
|
-
declare type VideoTexture =
|
|
7
|
+
declare type VideoTexture = Overwrite<THREE.VideoTexture, {
|
|
6
8
|
image: HTMLVideoElement;
|
|
7
|
-
|
|
8
|
-
|
|
9
|
+
metadataLoaded: boolean;
|
|
10
|
+
}>;
|
|
11
|
+
declare type ImageTexture = Overwrite<THREE.Texture, {
|
|
9
12
|
image: HTMLImageElement;
|
|
10
|
-
}
|
|
13
|
+
}>;
|
|
11
14
|
declare abstract class MediaPlane extends THREE.Mesh<THREE.BufferGeometry | THREE.Geometry, THREE.MeshBasicMaterial> {
|
|
12
15
|
name: string;
|
|
13
16
|
src?: string;
|
|
@@ -22,10 +25,10 @@ declare class ImagePlane extends MediaPlane {
|
|
|
22
25
|
declare class VideoPlane extends MediaPlane {
|
|
23
26
|
readonly isVideoPlane = true;
|
|
24
27
|
name: string;
|
|
25
|
-
videoInstance
|
|
28
|
+
videoInstance?: HTMLVideoElement;
|
|
29
|
+
onVideoReady?: (videoInstance?: HTMLVideoElement) => void;
|
|
26
30
|
private objectFit;
|
|
27
31
|
private buttonSrc;
|
|
28
|
-
private paused;
|
|
29
32
|
private videoCoverSrc?;
|
|
30
33
|
private domEvents?;
|
|
31
34
|
private disposers;
|
|
@@ -37,39 +40,26 @@ declare class VideoPlane extends MediaPlane {
|
|
|
37
40
|
private videoTextureMap;
|
|
38
41
|
private ImageTextureMap;
|
|
39
42
|
constructor(videoSrc: string, cornerPoints: Vector3[], params?: {
|
|
40
|
-
|
|
43
|
+
paused?: boolean;
|
|
41
44
|
playButton?: 'withText' | 'withoutText' | string;
|
|
42
45
|
videoCoverSrc?: string;
|
|
43
46
|
objectFit?: ObjectFit;
|
|
44
47
|
videoTextureMap?: Map<Src, VideoTexture>;
|
|
45
48
|
ImageTextureMap?: Map<Src, ImageTexture>;
|
|
46
49
|
});
|
|
47
|
-
play(): Promise<void>;
|
|
50
|
+
play(muted?: boolean): Promise<void>;
|
|
48
51
|
pause(): void;
|
|
49
|
-
initialDomEvents(
|
|
50
|
-
initialRenderHooks(
|
|
52
|
+
initialDomEvents(domEvents: DomEvents): void;
|
|
53
|
+
initialRenderHooks(func: (render: () => void) => () => any): void;
|
|
51
54
|
private showPauseUI;
|
|
52
55
|
private render;
|
|
53
|
-
private
|
|
56
|
+
private addAutoBindEventListener;
|
|
54
57
|
private addDomEventListener;
|
|
55
58
|
private removeDomEventListener;
|
|
56
59
|
private addCoverMesh;
|
|
57
60
|
private addVideoMesh;
|
|
58
61
|
private addButtonMesh;
|
|
59
|
-
|
|
60
|
-
* @description: 将视频封面Mesh
|
|
61
|
-
*/
|
|
62
|
-
private getCoverMesh;
|
|
63
|
-
/**
|
|
64
|
-
* @description: 获取视频Mesh
|
|
65
|
-
*/
|
|
66
|
-
private getVideoMesh;
|
|
67
|
-
/**
|
|
68
|
-
* @description: 获取点击播放按钮Mesh
|
|
69
|
-
*/
|
|
70
|
-
private getButtonMesh;
|
|
71
|
-
private getButtonTexture;
|
|
72
|
-
private getCoverTexture;
|
|
62
|
+
private getImageTexture;
|
|
73
63
|
private getVideoTexture;
|
|
74
64
|
}
|
|
75
65
|
export { ImagePlane, VideoPlane };
|
|
@@ -1,36 +1,36 @@
|
|
|
1
|
-
var
|
|
2
|
-
var P = (
|
|
3
|
-
var
|
|
4
|
-
var v = (
|
|
5
|
-
var s = (
|
|
1
|
+
var x = Object.defineProperty;
|
|
2
|
+
var P = (c, a, e) => a in c ? x(c, a, { enumerable: !0, configurable: !0, writable: !0, value: e }) : c[a] = e;
|
|
3
|
+
var n = (c, a, e) => (P(c, typeof a != "symbol" ? a + "" : a, e), e);
|
|
4
|
+
var v = (c, a, e) => new Promise((t, i) => {
|
|
5
|
+
var s = (o) => {
|
|
6
6
|
try {
|
|
7
|
-
|
|
7
|
+
r(e.next(o));
|
|
8
8
|
} catch (h) {
|
|
9
9
|
i(h);
|
|
10
10
|
}
|
|
11
|
-
},
|
|
11
|
+
}, d = (o) => {
|
|
12
12
|
try {
|
|
13
|
-
|
|
13
|
+
r(e.throw(o));
|
|
14
14
|
} catch (h) {
|
|
15
15
|
i(h);
|
|
16
16
|
}
|
|
17
|
-
},
|
|
18
|
-
|
|
17
|
+
}, r = (o) => o.done ? t(o.value) : Promise.resolve(o.value).then(s, d);
|
|
18
|
+
r((e = e.apply(c, a)).next());
|
|
19
19
|
});
|
|
20
|
-
import * as
|
|
21
|
-
import { Vector3 as
|
|
22
|
-
import { centerPoint as
|
|
23
|
-
import { loadTexture as
|
|
24
|
-
import { QuadrangleGeometry as
|
|
25
|
-
import {
|
|
26
|
-
import { Image_Play_Icon_With_Text as
|
|
27
|
-
import { getPositionsByObjectFit as
|
|
28
|
-
import
|
|
20
|
+
import * as p from "three";
|
|
21
|
+
import { Vector3 as g } from "three";
|
|
22
|
+
import { centerPoint as w } from "../../../shared-utils/three/centerPoint.js";
|
|
23
|
+
import { loadTexture as I } from "../../../shared-utils/three/loadTexture.js";
|
|
24
|
+
import { QuadrangleGeometry as V, QuadrangleMesh as y } from "../../../shared-utils/three/Quadrangle.js";
|
|
25
|
+
import { getVideoTexture as B } from "../../../shared-utils/three/loadVideoTexture.js";
|
|
26
|
+
import { Image_Play_Icon_With_Text as C, Image_Play_Icon as T } from "../../Assets/Icon.js";
|
|
27
|
+
import { getPositionsByObjectFit as l } from "../../../shared-utils/three/getPositionsByObjectFit.js";
|
|
28
|
+
import "@realsee/five";
|
|
29
|
+
import "../../../shared-utils/threex/domevents/index.js";
|
|
29
30
|
import "@realsee/five/gltf-loader";
|
|
31
|
+
import { FragmentTransparencyMaterial as F } from "../../../shared-utils/three/FragmentTransparencyMaterial.js";
|
|
30
32
|
import "../../../shared-utils/math/pointIsRectangle.js";
|
|
31
|
-
import "@realsee/five";
|
|
32
33
|
import "object-assign-deep";
|
|
33
|
-
import "../../../shared-utils/threex/domevents/index.js";
|
|
34
34
|
import "hammerjs";
|
|
35
35
|
import "@tweenjs/tween.js";
|
|
36
36
|
import "../../../CSS3DRenderPlugin/utils/three/CSS3DRender.js";
|
|
@@ -58,88 +58,89 @@ import "lodash.clonedeep";
|
|
|
58
58
|
import "lodash.isequal";
|
|
59
59
|
import "classnames";
|
|
60
60
|
import "../../../shared-utils/three/GLTFLoader.js";
|
|
61
|
-
class
|
|
61
|
+
class b extends p.Mesh {
|
|
62
62
|
constructor() {
|
|
63
63
|
super(...arguments);
|
|
64
|
-
|
|
65
|
-
|
|
64
|
+
n(this, "name", "MediaPlane");
|
|
65
|
+
n(this, "src");
|
|
66
66
|
}
|
|
67
67
|
removeFromParent() {
|
|
68
68
|
const e = this.parent;
|
|
69
69
|
return e !== null && e.remove(this), this;
|
|
70
70
|
}
|
|
71
71
|
}
|
|
72
|
-
class ye extends
|
|
72
|
+
class ye extends b {
|
|
73
73
|
constructor(e, t, i) {
|
|
74
74
|
super();
|
|
75
|
-
|
|
76
|
-
this.src = e,
|
|
77
|
-
var
|
|
78
|
-
const
|
|
79
|
-
this.position.copy(h), this.geometry = M, this.material =
|
|
75
|
+
n(this, "name", "PanoTagPluginImagePlane");
|
|
76
|
+
this.src = e, I(e).then((s) => {
|
|
77
|
+
var u;
|
|
78
|
+
const d = new URL(e, location.href).pathname.endsWith(".png"), r = new p.MeshBasicMaterial({ map: s, transparent: d }), o = l((u = i == null ? void 0 : i.objectFit) != null ? u : "contain", t, s.image.width / s.image.height), h = w(...o), m = o.map((f) => f.clone().sub(h)), M = new V(m);
|
|
79
|
+
this.position.copy(h), this.geometry = M, this.material = r;
|
|
80
80
|
}).catch((s) => {
|
|
81
81
|
console.error({ e: s });
|
|
82
82
|
});
|
|
83
83
|
}
|
|
84
84
|
}
|
|
85
|
-
class Ee extends
|
|
85
|
+
class Ee extends b {
|
|
86
86
|
constructor(e, t, i) {
|
|
87
|
-
const {
|
|
88
|
-
videoCoverSrc: s,
|
|
89
|
-
objectFit: a = "contain",
|
|
90
|
-
playButton: n = "withText",
|
|
91
|
-
videoTextureMap: r,
|
|
92
|
-
ImageTextureMap: h,
|
|
93
|
-
videoInstance: m = document.createElement("video")
|
|
94
|
-
} = i != null ? i : {};
|
|
87
|
+
const { videoCoverSrc: s, objectFit: d = "contain", playButton: r = "withText", paused: o = !0, videoTextureMap: h, ImageTextureMap: m } = i != null ? i : {};
|
|
95
88
|
super();
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
this.cornerPoints = t, this.src = e, this.buttonSrc = (() =>
|
|
89
|
+
n(this, "isVideoPlane", !0);
|
|
90
|
+
n(this, "name", "PanoTagPluginImagePlane");
|
|
91
|
+
n(this, "videoInstance");
|
|
92
|
+
n(this, "onVideoReady");
|
|
93
|
+
n(this, "objectFit");
|
|
94
|
+
n(this, "buttonSrc");
|
|
95
|
+
n(this, "videoCoverSrc");
|
|
96
|
+
n(this, "domEvents");
|
|
97
|
+
n(this, "disposers", []);
|
|
98
|
+
n(this, "domEventsListenerTemporaryList", []);
|
|
99
|
+
n(this, "cornerPoints");
|
|
100
|
+
n(this, "videoMesh");
|
|
101
|
+
n(this, "coverMesh");
|
|
102
|
+
n(this, "buttonMesh");
|
|
103
|
+
n(this, "videoTextureMap");
|
|
104
|
+
n(this, "ImageTextureMap");
|
|
105
|
+
this.cornerPoints = t, this.src = e, this.buttonSrc = (() => r === "withText" ? C : r === "withoutText" ? T : typeof r == "string" ? r : T)(), this.videoCoverSrc = s, this.objectFit = d, this.videoTextureMap = h, this.ImageTextureMap = m, this.position.copy(w(...t)), this.videoCoverSrc && o ? this.addCoverMesh().then(() => this.addButtonMesh()) : this.addVideoMesh().then(() => {
|
|
106
|
+
o ? this.addButtonMesh() : this.play(!0);
|
|
107
|
+
}), this.addEventListener("removed", () => {
|
|
113
108
|
this.remove(...this.children);
|
|
114
109
|
}), this.addEventListener("dispose", () => {
|
|
115
110
|
var M;
|
|
116
|
-
this.domEventsListenerTemporaryList = [], (M = this.disposers) == null || M.forEach((
|
|
111
|
+
this.domEventsListenerTemporaryList = [], (M = this.disposers) == null || M.forEach((u) => u == null ? void 0 : u());
|
|
117
112
|
});
|
|
118
113
|
}
|
|
119
|
-
play() {
|
|
114
|
+
play(e = !1) {
|
|
120
115
|
return v(this, null, function* () {
|
|
121
|
-
|
|
116
|
+
this.videoMesh || (yield this.addVideoMesh()), this.coverMesh && (this.coverMesh.visible = !1), this.remove(this.buttonMesh), this.videoMesh.visible = !0, this.videoInstance.paused && this.videoInstance.play().catch((t) => {
|
|
117
|
+
console.error(t);
|
|
118
|
+
}), this.videoInstance.muted = e, this.render();
|
|
122
119
|
});
|
|
123
120
|
}
|
|
124
121
|
pause() {
|
|
125
|
-
this.
|
|
122
|
+
!this.videoInstance || (this.showPauseUI(), this.videoInstance.pause(), this.render());
|
|
126
123
|
}
|
|
127
124
|
initialDomEvents(e) {
|
|
128
|
-
this.domEvents || (this.domEvents =
|
|
125
|
+
this.domEvents || (this.domEvents = e, this.domEventsListenerTemporaryList.forEach((t) => this.addDomEventListener(...t)), this.domEventsListenerTemporaryList = []);
|
|
129
126
|
}
|
|
130
127
|
initialRenderHooks(e) {
|
|
131
|
-
const
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
128
|
+
const i = e(() => {
|
|
129
|
+
var s;
|
|
130
|
+
this.videoMesh && ((s = this.videoInstance) == null ? void 0 : s.paused) === !1 && (this.videoMesh.needsRender = !0);
|
|
131
|
+
});
|
|
132
|
+
this.disposers.push(() => i);
|
|
135
133
|
}
|
|
136
134
|
showPauseUI() {
|
|
137
|
-
|
|
135
|
+
return v(this, null, function* () {
|
|
136
|
+
this.coverMesh ? (this.coverMesh.visible = !0, this.videoMesh && (this.videoMesh.visible = !1)) : (yield this.addCoverMesh(), this.coverMesh && (this.videoMesh.visible = !1)), this.addButtonMesh(), this.render();
|
|
137
|
+
});
|
|
138
138
|
}
|
|
139
139
|
render() {
|
|
140
|
-
|
|
140
|
+
var e;
|
|
141
|
+
this.videoMesh && (this.videoMesh.needsRender = !0), this.coverMesh && (this.coverMesh.needsRender = !0), this.buttonMesh && (this.buttonMesh.needsRender = !0), this.videoMesh && ((e = this.videoInstance) == null ? void 0 : e.paused) === !1 && (this.videoMesh.needsRender = !0);
|
|
141
142
|
}
|
|
142
|
-
|
|
143
|
+
addAutoBindEventListener(...e) {
|
|
143
144
|
const t = e[0];
|
|
144
145
|
t.addEventListener("added", () => {
|
|
145
146
|
this.addDomEventListener(...e);
|
|
@@ -160,112 +161,83 @@ class Ee extends L {
|
|
|
160
161
|
}
|
|
161
162
|
addCoverMesh() {
|
|
162
163
|
return v(this, null, function* () {
|
|
163
|
-
if (this.children.
|
|
164
|
+
if (this.children.includes(this.coverMesh))
|
|
164
165
|
return;
|
|
165
|
-
const e = yield this
|
|
166
|
-
|
|
166
|
+
const e = yield (() => v(this, null, function* () {
|
|
167
|
+
if (this.coverMesh)
|
|
168
|
+
return this.coverMesh;
|
|
169
|
+
if (!this.videoCoverSrc)
|
|
170
|
+
return;
|
|
171
|
+
const t = yield this.getImageTexture(this.videoCoverSrc);
|
|
172
|
+
if (!t)
|
|
173
|
+
return;
|
|
174
|
+
const i = new p.MeshBasicMaterial({ transparent: !1, map: t }), s = l(this.objectFit, this.cornerPoints, t.image.width / t.image.height), d = new y(s, i);
|
|
175
|
+
return d.position.copy(new g(0, 0, 0)), d.name = "videoCoverMesh", d;
|
|
176
|
+
}))();
|
|
177
|
+
return e && (this.children.includes(this.coverMesh) || (this.add(e), this.coverMesh = e)), e;
|
|
167
178
|
});
|
|
168
179
|
}
|
|
169
180
|
addVideoMesh() {
|
|
170
181
|
return v(this, null, function* () {
|
|
171
|
-
if (this.children.
|
|
182
|
+
if (this.children.includes(this.videoMesh))
|
|
172
183
|
return;
|
|
173
|
-
const e = yield this
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
184
|
+
const e = yield (() => v(this, null, function* () {
|
|
185
|
+
if (this.videoMesh)
|
|
186
|
+
return this.videoMesh;
|
|
187
|
+
if (!this.src)
|
|
188
|
+
return;
|
|
189
|
+
const i = this.getVideoTexture(this.src), s = new p.MeshBasicMaterial({ transparent: !1, map: i }), d = yield new Promise((o) => {
|
|
190
|
+
i.metadataLoaded ? o(l(this.objectFit, this.cornerPoints, i.image.videoWidth / i.image.videoHeight)) : i.addEventListener(
|
|
191
|
+
"videoLoaded",
|
|
192
|
+
() => o(l(this.objectFit, this.cornerPoints, i.image.videoWidth / i.image.videoHeight))
|
|
193
|
+
);
|
|
194
|
+
}), r = new y(d, s);
|
|
195
|
+
return r.name = "videoMesh", r.position.copy(new g(0, 0, 0)), r;
|
|
196
|
+
}))();
|
|
197
|
+
if (!e)
|
|
180
198
|
return;
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
return v(this, null, function* () {
|
|
187
|
-
if (this.coverMesh)
|
|
188
|
-
return this.coverMesh;
|
|
189
|
-
const e = yield this.getCoverTexture(), t = new d.MeshBasicMaterial({ transparent: !1, map: e }), i = g(this.objectFit, this.cornerPoints, e.image.width / e.image.height), s = new y(i, t);
|
|
190
|
-
return s.name = "videoCoverMesh", s.position.copy(new f(0, 0, 0)), this.coverMesh = s, s;
|
|
191
|
-
});
|
|
192
|
-
}
|
|
193
|
-
getVideoMesh() {
|
|
194
|
-
return v(this, null, function* () {
|
|
195
|
-
if (this.videoMesh)
|
|
196
|
-
return this.videoMesh;
|
|
197
|
-
const e = yield this.getVideoTexture(), t = new d.MeshBasicMaterial({ transparent: !1, map: e }), i = g(this.objectFit, this.cornerPoints, e.image.videoWidth / e.image.videoHeight), s = new y(i, t);
|
|
198
|
-
s.name = "videoMesh", s.position.copy(new f(0, 0, 0)), this.addAutoEventListener(s, "click", () => this.pause());
|
|
199
|
-
const a = e.image;
|
|
200
|
-
return a.addEventListener("playing", () => {
|
|
199
|
+
this.addAutoBindEventListener(e, "click", () => {
|
|
200
|
+
!this.videoInstance.paused && this.videoInstance.muted ? this.videoInstance.muted = !1 : this.pause();
|
|
201
|
+
});
|
|
202
|
+
const t = e.material.map.image;
|
|
203
|
+
return t.addEventListener("playing", () => {
|
|
201
204
|
this.coverMesh || this.remove(this.buttonMesh), this.render();
|
|
202
|
-
}),
|
|
203
|
-
this.showPauseUI();
|
|
204
|
-
}), this.videoMesh =
|
|
205
|
-
});
|
|
206
|
-
}
|
|
207
|
-
getButtonMesh() {
|
|
208
|
-
return v(this, null, function* () {
|
|
209
|
-
var p, l, w, T;
|
|
210
|
-
if (this.buttonMesh)
|
|
211
|
-
return this.buttonMesh;
|
|
212
|
-
const e = (l = (p = this.videoMesh) == null ? void 0 : p.geometry.points[0].distanceTo(this.videoMesh.geometry.points[3])) != null ? l : 1 / 0, t = (T = (w = this.coverMesh) == null ? void 0 : w.geometry.points[0].distanceTo(this.coverMesh.geometry.points[3])) != null ? T : 1 / 0, i = this.cornerPoints[0].distanceTo(this.cornerPoints[3]), a = Math.min(e, t, i) / i * 0.3, n = yield this.getButtonTexture(), r = new d.ShaderMaterial({
|
|
213
|
-
uniforms: {
|
|
214
|
-
map: { value: n }
|
|
215
|
-
},
|
|
216
|
-
transparent: !1,
|
|
217
|
-
blending: d.CustomBlending,
|
|
218
|
-
blendSrc: d.SrcAlphaFactor,
|
|
219
|
-
blendDst: d.OneMinusSrcAlphaFactor,
|
|
220
|
-
blendSrcAlpha: d.OneFactor,
|
|
221
|
-
blendDstAlpha: d.OneMinusSrcAlphaFactor,
|
|
222
|
-
vertexShader: `
|
|
223
|
-
varying vec2 vUv;
|
|
224
|
-
void main() {
|
|
225
|
-
vUv = uv;
|
|
226
|
-
gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
|
|
227
|
-
}
|
|
228
|
-
`,
|
|
229
|
-
fragmentShader: `
|
|
230
|
-
uniform sampler2D map;
|
|
231
|
-
// \u7EB9\u7406\u5750\u6807
|
|
232
|
-
varying vec2 vUv;
|
|
233
|
-
void main() {
|
|
234
|
-
gl_FragColor = texture2D(map, vUv);
|
|
235
|
-
}
|
|
236
|
-
`
|
|
237
|
-
}), h = g("contain", this.cornerPoints, n.image.width / n.image.height), m = new y(h, r);
|
|
238
|
-
m.position.copy(new f(0, 0, 0)), m.name = "buttonMesh", m.scale.set(a, a, a), this.addAutoEventListener(m, "click", () => this.play());
|
|
239
|
-
const M = new d.Vector3().crossVectors(new d.Vector3().subVectors(h[0], h[1]), new d.Vector3().subVectors(h[0], h[3])).normalize().multiplyScalar(1e-4);
|
|
240
|
-
return m.position.add(M), this.buttonMesh = m, m;
|
|
205
|
+
}), t.addEventListener("pause", () => {
|
|
206
|
+
this.showPauseUI(), this.render();
|
|
207
|
+
}), this.children.includes(this.videoMesh) || (this.add(e), this.videoMesh = e, this.videoInstance = t), e;
|
|
241
208
|
});
|
|
242
209
|
}
|
|
243
|
-
|
|
210
|
+
addButtonMesh() {
|
|
244
211
|
return v(this, null, function* () {
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
212
|
+
if (this.children.includes(this.buttonMesh))
|
|
213
|
+
return;
|
|
214
|
+
const e = yield (() => v(this, null, function* () {
|
|
215
|
+
var u, f, E, L;
|
|
216
|
+
if (this.buttonMesh)
|
|
217
|
+
return this.buttonMesh;
|
|
218
|
+
const t = (f = (u = this.videoMesh) == null ? void 0 : u.geometry.points[0].distanceTo(this.videoMesh.geometry.points[3])) != null ? f : 1 / 0, i = (L = (E = this.coverMesh) == null ? void 0 : E.geometry.points[0].distanceTo(this.coverMesh.geometry.points[3])) != null ? L : 1 / 0, s = this.cornerPoints[0].distanceTo(this.cornerPoints[3]), r = Math.min(t, i, s) / s * 0.3, o = yield this.getImageTexture(this.buttonSrc), h = l("contain", this.cornerPoints, o.image.width / o.image.height), m = new y(h, new F(o));
|
|
219
|
+
m.position.copy(new g(0, 0, 0)), m.name = "buttonMesh", m.scale.set(r, r, r), this.addAutoBindEventListener(m, "click", () => this.play());
|
|
220
|
+
const M = new p.Vector3().crossVectors(new p.Vector3().subVectors(h[0], h[1]), new p.Vector3().subVectors(h[0], h[3])).normalize().multiplyScalar(1e-4);
|
|
221
|
+
return m.position.add(M), m;
|
|
222
|
+
}))();
|
|
223
|
+
return this.children.includes(this.buttonMesh) || (this.add(e), this.buttonMesh = e), e;
|
|
250
224
|
});
|
|
251
225
|
}
|
|
252
|
-
|
|
226
|
+
getImageTexture(e) {
|
|
253
227
|
return v(this, null, function* () {
|
|
254
|
-
var
|
|
255
|
-
if ((
|
|
256
|
-
return this.ImageTextureMap.get(
|
|
257
|
-
const
|
|
258
|
-
return (
|
|
228
|
+
var i, s;
|
|
229
|
+
if ((i = this.ImageTextureMap) != null && i.has(e))
|
|
230
|
+
return this.ImageTextureMap.get(e);
|
|
231
|
+
const t = yield I(e);
|
|
232
|
+
return (s = this.ImageTextureMap) == null || s.set(e, t), t;
|
|
259
233
|
});
|
|
260
234
|
}
|
|
261
|
-
getVideoTexture() {
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
return (i = this.videoTextureMap) == null || i.set(this.src, e), e;
|
|
268
|
-
});
|
|
235
|
+
getVideoTexture(e) {
|
|
236
|
+
var i, s;
|
|
237
|
+
if ((i = this.videoTextureMap) != null && i.has(e))
|
|
238
|
+
return this.videoTextureMap.get(e);
|
|
239
|
+
const t = B(e);
|
|
240
|
+
return (s = this.videoTextureMap) == null || s.set(e, t), t;
|
|
269
241
|
}
|
|
270
242
|
}
|
|
271
243
|
export {
|
package/libs/base/BasePlugin.js
CHANGED
|
@@ -4,7 +4,7 @@ var s = (e, r, t) => (a(e, typeof r != "symbol" ? r + "" : r, t), t);
|
|
|
4
4
|
import { Subscribe as c } from "../shared-utils/Subscribe.js";
|
|
5
5
|
class o {
|
|
6
6
|
constructor(r, t) {
|
|
7
|
-
s(this, "VERSION", "2.
|
|
7
|
+
s(this, "VERSION", "2.17.0-aplha.1");
|
|
8
8
|
s(this, "five");
|
|
9
9
|
s(this, "hooks", new c());
|
|
10
10
|
s(this, "staticPrefix", "//vrlab-static.ljcdn.com");
|