@realsee/dnalogel 2.0.0-alpha.30-beta → 2.0.0-alpha.30
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/CHANGELOG.md +7 -0
- package/dist/ItemLabelPlugin/index.js +362 -143
- package/dist/ItemLabelPlugin/typings.d.ts +5 -0
- package/dist/ItemLabelPlugin/utils/getLabelTransform.d.ts +1 -0
- package/dist/ItemLabelPlugin/utils/getStrokeLength.d.ts +5 -0
- package/dist/ItemLabelPlugin/utils/isImpacted.d.ts +6 -0
- package/dist/ItemLabelPlugin/utils/transform2RenderData.d.ts +3 -0
- package/dist/PanoMeasurePlugin/Controller/BaseController.d.ts +5 -2
- package/dist/PanoMeasurePlugin/Controller/MixedController.d.ts +44 -0
- package/dist/PanoMeasurePlugin/Controller/WatchController.d.ts +1 -0
- package/dist/PanoMeasurePlugin/Controller/index.d.ts +17 -8
- package/dist/PanoMeasurePlugin/Modules/DeleteDom/_Assets/delete.svg.d.ts +1 -1
- package/dist/PanoMeasurePlugin/Modules/DeleteDom/_Assets/delete_bg.png.d.ts +1 -1
- package/dist/PanoMeasurePlugin/Modules/DeleteDom/index.d.ts +3 -0
- package/dist/PanoMeasurePlugin/Modules/Magnifier.d.ts +49 -14
- package/dist/PanoMeasurePlugin/Modules/UIController/NewMainBtnController.d.ts +12 -0
- package/dist/PanoMeasurePlugin/Modules/UIController/index.d.ts +4 -0
- package/dist/PanoMeasurePlugin/Modules/UIController/mobileHTML.d.ts +2 -0
- package/dist/PanoMeasurePlugin/Modules/UIController/style.d.ts +2 -0
- package/dist/PanoMeasurePlugin/Modules/rangePiece/html.d.ts +4 -0
- package/dist/PanoMeasurePlugin/Modules/rangePiece/index.d.ts +42 -0
- package/dist/PanoMeasurePlugin/index.d.ts +8 -5
- package/dist/PanoMeasurePlugin/index.js +1893 -3431
- package/dist/PanoMeasurePlugin/typings/data.d.ts +4 -0
- package/dist/PanoMeasurePlugin/typings/event.type.d.ts +10 -1
- package/dist/PanoMeasurePlugin/utils/calculateThreeMouse.d.ts +10 -0
- package/dist/PanoMeasurePlugin/utils/mouseGroup.d.ts +2 -2
- package/dist/floorplan/ModelFloorplanPlugin/index.js +3 -3
- package/dist/floorplan/TopviewFloorplanPlugin/index.js +3 -3
- package/dist/index.es.js +1850 -3190
- package/dist/index.js +1784 -3122
- package/dist/index.umd.js +1787 -3126
- package/dist/shared-utils/index.d.ts +1 -0
- package/dist/shared-utils/math/Interval.d.ts +13 -0
- package/dist/shared-utils/math/Rectangle.d.ts +27 -0
- package/dist/shared-utils/math/index.d.ts +2 -0
- package/docs/assets/search.js +1 -1
- package/docs/classes/Magnifier.html +9 -0
- package/docs/classes/ModelRoomLabelController.html +5 -5
- package/docs/classes/PanoFloorplanRadarPluginController.html +2 -2
- package/docs/enums/CameraMovementEffect.html +2 -2
- package/docs/enums/DIRECTION.html +1 -1
- package/docs/enums/DISPLAY_STRATEGY_TYPE.html +1 -1
- package/docs/enums/FLOOR_PLAN_ATTACHED_TO.html +1 -1
- package/docs/enums/ITEM_LABEL_PLUGIN_DISPLAY_STRATEGY_TYPE.html +1 -1
- package/docs/enums/ModelFloorplanErrorType.html +1 -1
- package/docs/enums/Rotation.html +2 -2
- package/docs/index.html +2 -2
- package/docs/interfaces/CSS3DRenderPluginExportType.html +3 -3
- package/docs/interfaces/CameraMovementPluginExportType.html +3 -3
- package/docs/interfaces/FloorplanBounding.html +5 -5
- package/docs/interfaces/FloorplanData.html +2 -2
- package/docs/interfaces/FloorplanEntrance.html +8 -8
- package/docs/interfaces/FloorplanExtraObject.html +4 -4
- package/docs/interfaces/FloorplanExtraObject3D.html +2 -2
- package/docs/interfaces/FloorplanFloorData.html +2 -2
- package/docs/interfaces/FloorplanImagePosition.html +2 -2
- package/docs/interfaces/FloorplanObserver.html +2 -2
- package/docs/interfaces/FloorplanOutlineItem.html +2 -2
- package/docs/interfaces/FloorplanPosition.html +2 -2
- package/docs/interfaces/FloorplanRoomItem.html +7 -7
- package/docs/interfaces/FloorplanRoomLabelItem.html +4 -4
- package/docs/interfaces/FloorplanServerBounding.html +5 -5
- package/docs/interfaces/FloorplanServerComputedData.html +1 -1
- package/docs/interfaces/FloorplanServerData.html +2 -2
- package/docs/interfaces/FloorplanServerEntrance.html +8 -8
- package/docs/interfaces/FloorplanServerFloorData.html +2 -2
- package/docs/interfaces/FloorplanServerImagePosition.html +2 -2
- package/docs/interfaces/FloorplanServerObserver.html +2 -2
- package/docs/interfaces/FloorplanServerOutlineItem.html +2 -2
- package/docs/interfaces/FloorplanServerPosition.html +2 -2
- package/docs/interfaces/FloorplanServerRoomItem.html +8 -8
- package/docs/interfaces/FloorplanServerRoomLabelItem.html +4 -4
- package/docs/interfaces/ItemLabelPluginData.html +1 -1
- package/docs/interfaces/ItemLabelPluginExportReturnsType.html +1 -1
- package/docs/interfaces/ItemLabelPluginParametersType.html +1 -1
- package/docs/interfaces/LineJson.html +1 -1
- package/docs/interfaces/ModelChassisCompassPluginData.html +1 -1
- package/docs/interfaces/ModelChassisCompassPluginExportType.html +1 -1
- package/docs/interfaces/ModelChassisCompassPluginParameterType.html +1 -1
- package/docs/interfaces/ModelEntryDoorGuidePluginData.html +1 -1
- package/docs/interfaces/ModelEntryDoorGuidePluginExportType.html +1 -1
- package/docs/interfaces/ModelFloorplanParameterType.html +1 -1
- package/docs/interfaces/ModelFloorplanViewEvent.html +3 -3
- package/docs/interfaces/ModelItemLabelPluginData.html +1 -1
- package/docs/interfaces/ModelItemLabelPluginExportReturnsType.html +1 -1
- package/docs/interfaces/ModelItemLabelPluginParametersType.html +1 -1
- package/docs/interfaces/ModelRoomLabelPluginData.html +1 -1
- package/docs/interfaces/ModelTVVideoPluginData.html +1 -1
- package/docs/interfaces/ModelTVVideoPluginExportType.html +1 -1
- package/docs/interfaces/ModelTVVideoPluginParameterType.html +1 -1
- package/docs/interfaces/ModelViewPluginExportType.html +1 -1
- package/docs/interfaces/OpenParameter.html +3 -0
- package/docs/interfaces/PanoCompassPluginData.html +1 -1
- package/docs/interfaces/PanoCompassPluginParameterType.html +1 -1
- package/docs/interfaces/PanoCursorRaycasterPluginExportType.html +6 -6
- package/docs/interfaces/PanoCursorRaycasterPluginParameterType.html +1 -1
- package/docs/interfaces/PanoFloorplanRadarPluginControllerParameter.html +1 -1
- package/docs/interfaces/PanoMeasureParameterType.html +1 -0
- package/docs/interfaces/PanoRulerPluginExportType.html +1 -1
- package/docs/interfaces/PanoRulerPluginOptions.html +1 -1
- package/docs/interfaces/PanoRulerPluginParameterType.html +1 -1
- package/docs/interfaces/PanoSpatialTagPluginContentEvent.html +1 -1
- package/docs/interfaces/PanoSpatialTagPluginContentReplacement.html +1 -1
- package/docs/interfaces/PanoSpatialTagPluginData.html +1 -1
- package/docs/interfaces/PanoSpatialTagPluginDataElement.html +1 -1
- package/docs/interfaces/PanoSpatialTagPluginExportType.html +1 -1
- package/docs/interfaces/PanoSpatialTagPluginOriginElement.html +1 -1
- package/docs/interfaces/PanoSpatialTagPluginParameterType.html +1 -1
- package/docs/interfaces/PanoSpatialTagPluginPointElement.html +1 -1
- package/docs/interfaces/PanoSpatialTagPluginTagElement.html +1 -1
- package/docs/interfaces/Point.html +1 -1
- package/docs/interfaces/PointJson.html +1 -1
- package/docs/interfaces/Room.html +1 -1
- package/docs/interfaces/RoomInfo.html +1 -1
- package/docs/interfaces/RoomLabel.html +7 -7
- package/docs/interfaces/RoomRules.html +1 -1
- package/docs/interfaces/Rooms.html +1 -1
- package/docs/interfaces/TopviewFloorplanPluginParameterType.html +10 -10
- package/docs/modules.html +20 -20
- package/libs/ItemLabelPlugin/ItemLabelComponent.js +211 -67
- package/libs/ItemLabelPlugin/ItemLabelItem.js +109 -54
- package/libs/ItemLabelPlugin/Plugin.js +7 -4
- package/libs/ItemLabelPlugin/typings.d.ts +5 -0
- package/libs/ItemLabelPlugin/utils/getLabelTransform.d.ts +1 -0
- package/libs/ItemLabelPlugin/utils/getLabelTransform.js +3 -0
- package/libs/ItemLabelPlugin/utils/getStrokeLength.d.ts +5 -0
- package/libs/ItemLabelPlugin/utils/getStrokeLength.js +16 -0
- package/libs/ItemLabelPlugin/utils/isImpacted.d.ts +6 -0
- package/libs/ItemLabelPlugin/utils/isImpacted.js +12 -0
- package/libs/ItemLabelPlugin/utils/parseData.js +1 -1
- package/libs/ItemLabelPlugin/utils/transform2RenderData.d.ts +3 -0
- package/libs/ItemLabelPlugin/utils/transform2RenderData.js +4 -0
- package/libs/PanoMeasurePlugin/Controller/BaseController.d.ts +5 -2
- package/libs/PanoMeasurePlugin/Controller/BaseController.js +9 -1
- package/libs/PanoMeasurePlugin/Controller/EditController.js +4 -4
- package/libs/PanoMeasurePlugin/Controller/MixedController.d.ts +44 -0
- package/libs/PanoMeasurePlugin/Controller/MixedController.js +337 -0
- package/libs/PanoMeasurePlugin/Controller/WatchController.d.ts +1 -0
- package/libs/PanoMeasurePlugin/Controller/WatchController.js +14 -3
- package/libs/PanoMeasurePlugin/Controller/index.d.ts +17 -8
- package/libs/PanoMeasurePlugin/Controller/index.js +57 -18
- package/libs/PanoMeasurePlugin/Modules/DeleteDom/_Assets/delete.svg.d.ts +1 -1
- package/libs/PanoMeasurePlugin/Modules/DeleteDom/_Assets/delete.svg.js +11 -14
- package/libs/PanoMeasurePlugin/Modules/DeleteDom/_Assets/delete_bg.png.d.ts +1 -1
- package/libs/PanoMeasurePlugin/Modules/DeleteDom/_Assets/delete_bg.png.js +1 -1
- package/libs/PanoMeasurePlugin/Modules/DeleteDom/index.d.ts +3 -0
- package/libs/PanoMeasurePlugin/Modules/DeleteDom/index.js +48 -11
- package/libs/PanoMeasurePlugin/Modules/Magnifier.d.ts +49 -14
- package/libs/PanoMeasurePlugin/Modules/Magnifier.js +185 -60
- package/libs/PanoMeasurePlugin/Modules/UIController/MainBtnController.js +1 -1
- package/libs/PanoMeasurePlugin/Modules/UIController/NewMainBtnController.d.ts +12 -0
- package/libs/PanoMeasurePlugin/Modules/UIController/NewMainBtnController.js +98 -0
- package/libs/PanoMeasurePlugin/Modules/UIController/index.d.ts +4 -0
- package/libs/PanoMeasurePlugin/Modules/UIController/index.js +24 -7
- package/libs/PanoMeasurePlugin/Modules/UIController/mobileHTML.d.ts +2 -0
- package/libs/PanoMeasurePlugin/Modules/UIController/mobileHTML.js +80 -0
- package/libs/PanoMeasurePlugin/Modules/UIController/style.d.ts +2 -0
- package/libs/PanoMeasurePlugin/Modules/UIController/style.js +10 -1
- package/libs/PanoMeasurePlugin/Modules/rangePiece/html.d.ts +4 -0
- package/libs/PanoMeasurePlugin/Modules/rangePiece/html.js +64 -0
- package/libs/PanoMeasurePlugin/Modules/rangePiece/index.d.ts +42 -0
- package/libs/PanoMeasurePlugin/Modules/rangePiece/index.js +265 -0
- package/libs/PanoMeasurePlugin/index.d.ts +8 -5
- package/libs/PanoMeasurePlugin/index.js +2 -0
- package/libs/PanoMeasurePlugin/typings/data.d.ts +4 -0
- package/libs/PanoMeasurePlugin/typings/event.type.d.ts +10 -1
- package/libs/PanoMeasurePlugin/utils/calculateThreeMouse.d.ts +10 -0
- package/libs/PanoMeasurePlugin/utils/calculateThreeMouse.js +15 -0
- package/libs/PanoMeasurePlugin/utils/constants.js +7 -7
- package/libs/PanoMeasurePlugin/utils/distanceDom.js +19 -14
- package/libs/PanoMeasurePlugin/utils/mouseGroup.d.ts +2 -2
- package/libs/PanoMeasurePlugin/utils/mouseGroup.js +5 -6
- package/libs/floorplan/Components/RoomMaterials/RoomMaterial.js +3 -3
- package/libs/shared-utils/index.d.ts +1 -0
- package/libs/shared-utils/index.js +1 -0
- package/libs/shared-utils/math/Interval.d.ts +13 -0
- package/libs/shared-utils/math/Interval.js +40 -0
- package/libs/shared-utils/math/Rectangle.d.ts +27 -0
- package/libs/shared-utils/math/Rectangle.js +50 -0
- package/libs/shared-utils/math/index.d.ts +2 -0
- package/libs/shared-utils/math/index.js +2 -0
- package/package.json +2 -1
|
@@ -22,17 +22,52 @@ import "./events.type";
|
|
|
22
22
|
import classNames from 'classnames';
|
|
23
23
|
|
|
24
24
|
function add_css(target) {
|
|
25
|
-
append_styles(target, "svelte-
|
|
25
|
+
append_styles(target, "svelte-1gam1w3", ".item-label-item.svelte-1gam1w3.svelte-1gam1w3{position:absolute;z-index:0;transform:none;cursor:pointer;pointer-events:none;user-select:none;animation:svelte-1gam1w3-fadeIn .3s ease-in}.item-label-item.fold.svelte-1gam1w3>.item-label-item__text-wrap.svelte-1gam1w3{visibility:hidden}.item-label-item.fold.svelte-1gam1w3>.item-label-item__bar.anchor.svelte-1gam1w3{visibility:hidden}.item-label-item.fold.svelte-1gam1w3>.item-label-item__bar.anchor.svelte-1gam1w3:after{visibility:visible}.item-label-item__text-wrap.svelte-1gam1w3.svelte-1gam1w3{height:fit-content;padding:12px 20px 12px 12px;position:absolute;width:max-content;max-width:473px;min-height:92px;background-image:linear-gradient(269deg, rgba(0, 0, 0, 0.50) 0%, rgba(0, 0, 0, 0.60) 49%, rgba(31, 38, 46, 0.70) 100%);border:1.5px solid rgba(255, 255, 255, .65);border-radius:3px;color:white;transform:translate(-50%, 0);display:flex;justify-content:flex-start;align-items:center;box-sizing:border-box;overflow:hidden;pointer-events:all}.icon-wrap.svelte-1gam1w3.svelte-1gam1w3{width:68px;height:100%;display:flex;justify-content:center;align-content:center}.icon.svelte-1gam1w3.svelte-1gam1w3{width:68px;height:68px;background-repeat:no-repeat;background-size:contain;background-position:center}.item-label-text.svelte-1gam1w3.svelte-1gam1w3{margin-left:12px;padding-left:12px;min-height:68px;height:auto;display:flex;flex-flow:column;justify-content:space-around;align-content:flex-start;border-left:solid rgba(255, 255, 255, .2) 1px;border-top:solid rgba(255, 255, 255, .2) 0;border-right:solid rgba(255, 255, 255, .2) 0;border-bottom:solid rgba(255, 255, 255, .2) 0;pointer-events:auto}.item-model.svelte-1gam1w3.svelte-1gam1w3{white-space:nowrap;font-size:22px;font-weight:bold;line-height:30px}.item-name.svelte-1gam1w3.svelte-1gam1w3{height:auto;word-wrap:break-word;word-break:break-all;font-size:20px;line-height:28px}.item-label-item__bar.svelte-1gam1w3.svelte-1gam1w3{position:absolute;bottom:0;width:3px;background-image:linear-gradient(to bottom, white, rgba(255, 255, 255, 0));box-shadow:0 2px 8px 0 rgba(0, 0, 0, 0.20);pointer-events:none}.item-label-item__bar.anchor.svelte-1gam1w3.svelte-1gam1w3:after{content:'';position:absolute;bottom:0;width:24px;height:24px;background-image:url(\"//vrlab-public.ljcdn.com/common/file/web/67e7a198-28c9-47dc-879b-507bd3ae600c.png \");background-position:center;background-size:contain;transform:translate(-10.5px, 50%)}@keyframes svelte-1gam1w3-fadeIn{from{opacity:0\n }to{opacity:1\n }}");
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
let div3;
|
|
28
|
+
// (21:2) {#if itemLabel.icon}
|
|
29
|
+
function create_if_block(ctx) {
|
|
31
30
|
let div1;
|
|
32
31
|
let div0;
|
|
33
32
|
let div0_style_value;
|
|
33
|
+
let mounted;
|
|
34
|
+
let dispose;
|
|
35
|
+
|
|
36
|
+
return {
|
|
37
|
+
c() {
|
|
38
|
+
div1 = element("div");
|
|
39
|
+
div0 = element("div");
|
|
40
|
+
attr(div0, "class", "icon svelte-1gam1w3");
|
|
41
|
+
attr(div0, "style", div0_style_value = `background-image: url(${/*itemLabel*/ ctx[0].icon ?? defaultIcon})`);
|
|
42
|
+
attr(div1, "class", "icon-wrap svelte-1gam1w3");
|
|
43
|
+
},
|
|
44
|
+
m(target, anchor) {
|
|
45
|
+
insert(target, div1, anchor);
|
|
46
|
+
append(div1, div0);
|
|
47
|
+
|
|
48
|
+
if (!mounted) {
|
|
49
|
+
dispose = listen(div1, "click", /*click_handler*/ ctx[5]);
|
|
50
|
+
mounted = true;
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
p(ctx, dirty) {
|
|
54
|
+
if (dirty & /*itemLabel*/ 1 && div0_style_value !== (div0_style_value = `background-image: url(${/*itemLabel*/ ctx[0].icon ?? defaultIcon})`)) {
|
|
55
|
+
attr(div0, "style", div0_style_value);
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
d(detaching) {
|
|
59
|
+
if (detaching) detach(div1);
|
|
60
|
+
mounted = false;
|
|
61
|
+
dispose();
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
function create_fragment(ctx) {
|
|
67
|
+
let div3;
|
|
68
|
+
let div1;
|
|
34
69
|
let t0;
|
|
35
|
-
let
|
|
70
|
+
let div0;
|
|
36
71
|
let span0;
|
|
37
72
|
let t1_value = (/*itemLabel*/ ctx[0].code ?? /*itemLabel*/ ctx[0].id) + "";
|
|
38
73
|
let t1;
|
|
@@ -40,103 +75,105 @@ function create_fragment(ctx) {
|
|
|
40
75
|
let span1;
|
|
41
76
|
let t3_value = /*itemLabel*/ ctx[0].name + "";
|
|
42
77
|
let t3;
|
|
43
|
-
let
|
|
78
|
+
let div1_class_value;
|
|
44
79
|
let t4;
|
|
45
|
-
let
|
|
46
|
-
let
|
|
47
|
-
let
|
|
80
|
+
let div2;
|
|
81
|
+
let div2_class_value;
|
|
82
|
+
let div3_class_value;
|
|
48
83
|
let mounted;
|
|
49
84
|
let dispose;
|
|
85
|
+
let if_block = /*itemLabel*/ ctx[0].icon && create_if_block(ctx);
|
|
50
86
|
|
|
51
87
|
return {
|
|
52
88
|
c() {
|
|
53
|
-
div5 = element("div");
|
|
54
89
|
div3 = element("div");
|
|
55
90
|
div1 = element("div");
|
|
56
|
-
|
|
91
|
+
if (if_block) if_block.c();
|
|
57
92
|
t0 = space();
|
|
58
|
-
|
|
93
|
+
div0 = element("div");
|
|
59
94
|
span0 = element("span");
|
|
60
95
|
t1 = text(t1_value);
|
|
61
96
|
t2 = space();
|
|
62
97
|
span1 = element("span");
|
|
63
98
|
t3 = text(t3_value);
|
|
64
99
|
t4 = space();
|
|
65
|
-
|
|
66
|
-
attr(
|
|
67
|
-
attr(
|
|
68
|
-
attr(
|
|
69
|
-
attr(
|
|
70
|
-
|
|
71
|
-
attr(div2, "class", "item-label-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
set_style(
|
|
76
|
-
attr(div5, "class", div5_class_value = "" + (null_to_empty(classNames("item-label-item", { visible: /*itemLabel*/ ctx[0].visible })) + " svelte-1u8wokx"));
|
|
77
|
-
set_style(div5, "z-index", /*itemLabel*/ ctx[0].zIndex, false);
|
|
78
|
-
set_style(div5, "transform", /*itemLabel*/ ctx[0].transform, false);
|
|
100
|
+
div2 = element("div");
|
|
101
|
+
attr(span0, "class", "item-model svelte-1gam1w3");
|
|
102
|
+
attr(span1, "class", "item-name svelte-1gam1w3");
|
|
103
|
+
attr(div0, "class", "item-label-text svelte-1gam1w3");
|
|
104
|
+
attr(div1, "class", div1_class_value = "" + (null_to_empty(classNames("item-label-item__text-wrap")) + " svelte-1gam1w3"));
|
|
105
|
+
set_style(div1, "bottom", `${/*itemLabel*/ ctx[0].strokeLength}px`);
|
|
106
|
+
attr(div2, "class", div2_class_value = "" + (null_to_empty(classNames("item-label-item__bar", { anchor: /*anchorEnabled*/ ctx[1] })) + " svelte-1gam1w3"));
|
|
107
|
+
set_style(div2, "height", `${/*itemLabel*/ ctx[0].strokeLength}px`);
|
|
108
|
+
attr(div3, "class", div3_class_value = "" + (null_to_empty(classNames("item-label-item", { fold: /*itemLabel*/ ctx[0].isFold })) + " svelte-1gam1w3"));
|
|
109
|
+
set_style(div3, "z-index", /*itemLabel*/ ctx[0].zIndex, false);
|
|
110
|
+
set_style(div3, "transform", /*itemLabel*/ ctx[0].transform, false);
|
|
79
111
|
},
|
|
80
112
|
m(target, anchor) {
|
|
81
|
-
insert(target,
|
|
82
|
-
append(div5, div3);
|
|
113
|
+
insert(target, div3, anchor);
|
|
83
114
|
append(div3, div1);
|
|
115
|
+
if (if_block) if_block.m(div1, null);
|
|
116
|
+
append(div1, t0);
|
|
84
117
|
append(div1, div0);
|
|
85
|
-
append(
|
|
86
|
-
append(div3, div2);
|
|
87
|
-
append(div2, span0);
|
|
118
|
+
append(div0, span0);
|
|
88
119
|
append(span0, t1);
|
|
89
|
-
append(
|
|
90
|
-
append(
|
|
120
|
+
append(div0, t2);
|
|
121
|
+
append(div0, span1);
|
|
91
122
|
append(span1, t3);
|
|
92
|
-
append(
|
|
93
|
-
append(
|
|
123
|
+
append(div3, t4);
|
|
124
|
+
append(div3, div2);
|
|
94
125
|
|
|
95
126
|
if (!mounted) {
|
|
96
|
-
dispose = listen(
|
|
127
|
+
dispose = listen(div1, "click", /*onClick*/ ctx[3]);
|
|
97
128
|
mounted = true;
|
|
98
129
|
}
|
|
99
130
|
},
|
|
100
131
|
p(ctx, [dirty]) {
|
|
101
|
-
if (
|
|
102
|
-
|
|
132
|
+
if (/*itemLabel*/ ctx[0].icon) {
|
|
133
|
+
if (if_block) {
|
|
134
|
+
if_block.p(ctx, dirty);
|
|
135
|
+
} else {
|
|
136
|
+
if_block = create_if_block(ctx);
|
|
137
|
+
if_block.c();
|
|
138
|
+
if_block.m(div1, t0);
|
|
139
|
+
}
|
|
140
|
+
} else if (if_block) {
|
|
141
|
+
if_block.d(1);
|
|
142
|
+
if_block = null;
|
|
103
143
|
}
|
|
104
144
|
|
|
105
145
|
if (dirty & /*itemLabel*/ 1 && t1_value !== (t1_value = (/*itemLabel*/ ctx[0].code ?? /*itemLabel*/ ctx[0].id) + "")) set_data(t1, t1_value);
|
|
106
146
|
if (dirty & /*itemLabel*/ 1 && t3_value !== (t3_value = /*itemLabel*/ ctx[0].name + "")) set_data(t3, t3_value);
|
|
107
147
|
|
|
108
|
-
if (dirty & /*itemLabel*/ 1 && div3_class_value !== (div3_class_value = "" + (null_to_empty(classNames("item-label-item__text-wrap", { visible: /*itemLabel*/ ctx[0].visible })) + " svelte-1u8wokx"))) {
|
|
109
|
-
attr(div3, "class", div3_class_value);
|
|
110
|
-
}
|
|
111
|
-
|
|
112
148
|
if (dirty & /*itemLabel*/ 1) {
|
|
113
|
-
set_style(
|
|
149
|
+
set_style(div1, "bottom", `${/*itemLabel*/ ctx[0].strokeLength}px`);
|
|
114
150
|
}
|
|
115
151
|
|
|
116
|
-
if (dirty & /*anchorEnabled*/ 2 &&
|
|
117
|
-
attr(
|
|
152
|
+
if (dirty & /*anchorEnabled*/ 2 && div2_class_value !== (div2_class_value = "" + (null_to_empty(classNames("item-label-item__bar", { anchor: /*anchorEnabled*/ ctx[1] })) + " svelte-1gam1w3"))) {
|
|
153
|
+
attr(div2, "class", div2_class_value);
|
|
118
154
|
}
|
|
119
155
|
|
|
120
156
|
if (dirty & /*itemLabel*/ 1) {
|
|
121
|
-
set_style(
|
|
157
|
+
set_style(div2, "height", `${/*itemLabel*/ ctx[0].strokeLength}px`);
|
|
122
158
|
}
|
|
123
159
|
|
|
124
|
-
if (dirty & /*itemLabel*/ 1 &&
|
|
125
|
-
attr(
|
|
160
|
+
if (dirty & /*itemLabel*/ 1 && div3_class_value !== (div3_class_value = "" + (null_to_empty(classNames("item-label-item", { fold: /*itemLabel*/ ctx[0].isFold })) + " svelte-1gam1w3"))) {
|
|
161
|
+
attr(div3, "class", div3_class_value);
|
|
126
162
|
}
|
|
127
163
|
|
|
128
164
|
if (dirty & /*itemLabel*/ 1) {
|
|
129
|
-
set_style(
|
|
165
|
+
set_style(div3, "z-index", /*itemLabel*/ ctx[0].zIndex, false);
|
|
130
166
|
}
|
|
131
167
|
|
|
132
168
|
if (dirty & /*itemLabel*/ 1) {
|
|
133
|
-
set_style(
|
|
169
|
+
set_style(div3, "transform", /*itemLabel*/ ctx[0].transform, false);
|
|
134
170
|
}
|
|
135
171
|
},
|
|
136
172
|
i: noop,
|
|
137
173
|
o: noop,
|
|
138
174
|
d(detaching) {
|
|
139
|
-
if (detaching) detach(
|
|
175
|
+
if (detaching) detach(div3);
|
|
176
|
+
if (if_block) if_block.d();
|
|
140
177
|
mounted = false;
|
|
141
178
|
dispose();
|
|
142
179
|
}
|
|
@@ -149,24 +186,42 @@ function instance($$self, $$props, $$invalidate) {
|
|
|
149
186
|
let { itemLabel } = $$props;
|
|
150
187
|
let { hooks } = $$props;
|
|
151
188
|
let { anchorEnabled } = $$props;
|
|
189
|
+
let { onIconClick } = $$props;
|
|
152
190
|
|
|
153
191
|
function onClick() {
|
|
154
192
|
hooks.emit('onLabelClick', itemLabel);
|
|
155
193
|
}
|
|
156
194
|
|
|
195
|
+
const click_handler = e => onIconClick(itemLabel);
|
|
196
|
+
|
|
157
197
|
$$self.$$set = $$props => {
|
|
158
198
|
if ('itemLabel' in $$props) $$invalidate(0, itemLabel = $$props.itemLabel);
|
|
159
|
-
if ('hooks' in $$props) $$invalidate(
|
|
199
|
+
if ('hooks' in $$props) $$invalidate(4, hooks = $$props.hooks);
|
|
160
200
|
if ('anchorEnabled' in $$props) $$invalidate(1, anchorEnabled = $$props.anchorEnabled);
|
|
201
|
+
if ('onIconClick' in $$props) $$invalidate(2, onIconClick = $$props.onIconClick);
|
|
161
202
|
};
|
|
162
203
|
|
|
163
|
-
return [itemLabel, anchorEnabled, onClick, hooks];
|
|
204
|
+
return [itemLabel, anchorEnabled, onIconClick, onClick, hooks, click_handler];
|
|
164
205
|
}
|
|
165
206
|
|
|
166
207
|
class Component extends SvelteComponent {
|
|
167
208
|
constructor(options) {
|
|
168
209
|
super();
|
|
169
|
-
|
|
210
|
+
|
|
211
|
+
init(
|
|
212
|
+
this,
|
|
213
|
+
options,
|
|
214
|
+
instance,
|
|
215
|
+
create_fragment,
|
|
216
|
+
safe_not_equal,
|
|
217
|
+
{
|
|
218
|
+
itemLabel: 0,
|
|
219
|
+
hooks: 4,
|
|
220
|
+
anchorEnabled: 1,
|
|
221
|
+
onIconClick: 2
|
|
222
|
+
},
|
|
223
|
+
add_css
|
|
224
|
+
);
|
|
170
225
|
}
|
|
171
226
|
}
|
|
172
227
|
|
|
@@ -2,8 +2,9 @@ import { Subscribe } from "@realsee/five";
|
|
|
2
2
|
import ItemLabelComponent from './ItemLabelComponent';
|
|
3
3
|
import { ITEM_LABEL_PLUGIN_DISPLAY_STRATEGY_TYPE } from "./typings";
|
|
4
4
|
import { parseItemLabelPluginData } from "./utils/parseData";
|
|
5
|
+
const defaultMaxVisibleDistance = undefined;
|
|
5
6
|
export const Plugin = (five, params) => {
|
|
6
|
-
var _a, _b;
|
|
7
|
+
var _a, _b, _c;
|
|
7
8
|
const pluginState = {
|
|
8
9
|
container: document.createElement('div'),
|
|
9
10
|
data: null,
|
|
@@ -15,6 +16,7 @@ export const Plugin = (five, params) => {
|
|
|
15
16
|
hooks: new Subscribe(),
|
|
16
17
|
modelOcclusionEnable: (_a = params === null || params === void 0 ? void 0 : params.modelOcclusionEnable) !== null && _a !== void 0 ? _a : true,
|
|
17
18
|
displayStrategyType: (_b = params === null || params === void 0 ? void 0 : params.displayStrategyType) !== null && _b !== void 0 ? _b : ITEM_LABEL_PLUGIN_DISPLAY_STRATEGY_TYPE.SMALL,
|
|
19
|
+
maxVisibleDistance: (_c = params === null || params === void 0 ? void 0 : params.maxVisibleDistance) !== null && _c !== void 0 ? _c : defaultMaxVisibleDistance,
|
|
18
20
|
};
|
|
19
21
|
pluginState.container.setAttribute('class', 'item-label-plugin-container');
|
|
20
22
|
pluginState.container.style.cssText = `
|
|
@@ -74,7 +76,8 @@ export const Plugin = (five, params) => {
|
|
|
74
76
|
itemLabels: pluginState.itemLabels,
|
|
75
77
|
wrapper: pluginState.wrapper,
|
|
76
78
|
hooks: pluginState.hooks,
|
|
77
|
-
displayStrategyType: pluginState.displayStrategyType
|
|
79
|
+
displayStrategyType: pluginState.displayStrategyType,
|
|
80
|
+
maxVisibleDistance: pluginState.maxVisibleDistance
|
|
78
81
|
}
|
|
79
82
|
});
|
|
80
83
|
}
|
|
@@ -87,12 +90,12 @@ export const Plugin = (five, params) => {
|
|
|
87
90
|
};
|
|
88
91
|
// 添加 five 监听
|
|
89
92
|
const addListener4Five = () => {
|
|
90
|
-
five.on('modeChange', onFiveModeChange)
|
|
93
|
+
// five.on('modeChange', onFiveModeChange)
|
|
91
94
|
five.once('dispose', dispose);
|
|
92
95
|
};
|
|
93
96
|
// 取消 five 监听
|
|
94
97
|
const removeListener4Five = () => {
|
|
95
|
-
five.off('modeChange', onFiveModeChange)
|
|
98
|
+
// five.off('modeChange', onFiveModeChange)
|
|
96
99
|
};
|
|
97
100
|
const onFiveModeChange = (mode) => {
|
|
98
101
|
if (!pluginState.enabled)
|
|
@@ -8,6 +8,7 @@ export declare enum ITEM_LABEL_PLUGIN_DISPLAY_STRATEGY_TYPE {
|
|
|
8
8
|
EXTRA_LARGE = "x-large"
|
|
9
9
|
}
|
|
10
10
|
export interface ItemLabelPluginParametersType {
|
|
11
|
+
maxVisibleDistance?: number;
|
|
11
12
|
modelOcclusionEnable?: boolean;
|
|
12
13
|
displayStrategyType?: Partial<ITEM_LABEL_PLUGIN_DISPLAY_STRATEGY_TYPE>;
|
|
13
14
|
}
|
|
@@ -30,6 +31,9 @@ export interface ItemLabel {
|
|
|
30
31
|
modelPosition: [number, number, number];
|
|
31
32
|
type?: string[];
|
|
32
33
|
icon?: string;
|
|
34
|
+
observerIndex?: number | undefined;
|
|
35
|
+
visible?: boolean;
|
|
36
|
+
isFold?: boolean;
|
|
33
37
|
[key: string]: any;
|
|
34
38
|
}
|
|
35
39
|
export interface ItemLabelPluginExportReturnsType {
|
|
@@ -51,4 +55,5 @@ export interface ItemLabelPluginState {
|
|
|
51
55
|
hooks: Subscribe<PluginEvent>;
|
|
52
56
|
modelOcclusionEnable: boolean;
|
|
53
57
|
displayStrategyType: Partial<ITEM_LABEL_PLUGIN_DISPLAY_STRATEGY_TYPE>;
|
|
58
|
+
maxVisibleDistance: number | undefined;
|
|
54
59
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const getLabelTransform: (cssOffset: [number, number]) => string;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 展示策略
|
|
3
|
+
* */
|
|
4
|
+
import { ITEM_LABEL_PLUGIN_DISPLAY_STRATEGY_TYPE } from "../typings";
|
|
5
|
+
export const getStrokeLength = (itemSpaceHeight, type) => {
|
|
6
|
+
switch (type) {
|
|
7
|
+
case ITEM_LABEL_PLUGIN_DISPLAY_STRATEGY_TYPE.SMALL:
|
|
8
|
+
return Math.ceil(-27.78 * itemSpaceHeight + 85);
|
|
9
|
+
case ITEM_LABEL_PLUGIN_DISPLAY_STRATEGY_TYPE.MIDLLE:
|
|
10
|
+
return Math.ceil(-38.9 * itemSpaceHeight + 130);
|
|
11
|
+
case ITEM_LABEL_PLUGIN_DISPLAY_STRATEGY_TYPE.LARGE:
|
|
12
|
+
return Math.ceil(-44.44 * itemSpaceHeight + 140);
|
|
13
|
+
case ITEM_LABEL_PLUGIN_DISPLAY_STRATEGY_TYPE.EXTRA_LARGE:
|
|
14
|
+
return Math.ceil(-92.59 * itemSpaceHeight + 300);
|
|
15
|
+
}
|
|
16
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import * as THREE from 'three';
|
|
2
|
+
const { Raycaster, Vector3 } = THREE;
|
|
3
|
+
/**
|
|
4
|
+
* 碰撞检测可见性
|
|
5
|
+
* */
|
|
6
|
+
export const isImpacted = (five, sourceVector, targetVector, distance) => {
|
|
7
|
+
const direction = sourceVector.clone().sub(targetVector).normalize();
|
|
8
|
+
const raycaster = new Raycaster();
|
|
9
|
+
raycaster.set(targetVector, direction);
|
|
10
|
+
const [intersection] = five.model.intersectRaycaster(raycaster);
|
|
11
|
+
return intersection && distance <= intersection.distance + 0.1;
|
|
12
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/** @description 转成内部所需数据 */
|
|
2
2
|
export function parseItemLabelPluginData(data) {
|
|
3
|
-
return data.item_labels.map(label => (Object.assign({ modelPosition: [label.position[0], label.position[1], label.position[2]] }, label)));
|
|
3
|
+
return data.item_labels.map(label => (Object.assign({ modelPosition: [label.position[0], label.position[1], label.position[2]], observerIndex: undefined }, label)));
|
|
4
4
|
}
|
|
@@ -3,9 +3,10 @@ import type Magnifier from '../Modules/Magnifier';
|
|
|
3
3
|
import type FiveHelper from '../Modules/FiveHelper';
|
|
4
4
|
import type { Group } from 'three';
|
|
5
5
|
import type { Model } from '../Model';
|
|
6
|
-
import type {
|
|
6
|
+
import type { PanoMeasurePluginEvent } from '../typings/event.type';
|
|
7
7
|
import type { UserDistanceItem } from '../utils/distanceDom';
|
|
8
8
|
import type { Five, Intersection, IntersectMeshInterface, Subscribe } from '@realsee/five';
|
|
9
|
+
import type { OpenParameter } from '../typings/data';
|
|
9
10
|
export interface IControllerParams {
|
|
10
11
|
five: Five;
|
|
11
12
|
group: Group;
|
|
@@ -14,7 +15,8 @@ export interface IControllerParams {
|
|
|
14
15
|
container: Element;
|
|
15
16
|
magnifier: Magnifier;
|
|
16
17
|
fiveHelper: FiveHelper;
|
|
17
|
-
|
|
18
|
+
openParams: OpenParameter;
|
|
19
|
+
hook: Subscribe<PanoMeasurePluginEvent>;
|
|
18
20
|
userDistanceItemCreator?: () => UserDistanceItem;
|
|
19
21
|
}
|
|
20
22
|
export default abstract class BaseController {
|
|
@@ -22,6 +24,7 @@ export default abstract class BaseController {
|
|
|
22
24
|
protected group: Group;
|
|
23
25
|
protected model: Model;
|
|
24
26
|
protected disposed: boolean;
|
|
27
|
+
protected isMobile: boolean;
|
|
25
28
|
protected mouseGroup: Group;
|
|
26
29
|
protected container: Element;
|
|
27
30
|
protected fiveHelper: FiveHelper;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { preventDefault } from '../utils/ironbox';
|
|
2
2
|
export default class BaseController {
|
|
3
3
|
constructor(params) {
|
|
4
|
+
var _a, _b;
|
|
4
5
|
Object.defineProperty(this, "five", {
|
|
5
6
|
enumerable: true,
|
|
6
7
|
configurable: true,
|
|
@@ -25,6 +26,12 @@ export default class BaseController {
|
|
|
25
26
|
writable: true,
|
|
26
27
|
value: false
|
|
27
28
|
});
|
|
29
|
+
Object.defineProperty(this, "isMobile", {
|
|
30
|
+
enumerable: true,
|
|
31
|
+
configurable: true,
|
|
32
|
+
writable: true,
|
|
33
|
+
value: void 0
|
|
34
|
+
});
|
|
28
35
|
Object.defineProperty(this, "mouseGroup", {
|
|
29
36
|
enumerable: true,
|
|
30
37
|
configurable: true,
|
|
@@ -76,6 +83,7 @@ export default class BaseController {
|
|
|
76
83
|
this.magnifier = params.magnifier;
|
|
77
84
|
this.container = params.container;
|
|
78
85
|
this.fiveHelper = params.fiveHelper;
|
|
86
|
+
this.isMobile = (_b = (_a = params.openParams) === null || _a === void 0 ? void 0 : _a.isMobile) !== null && _b !== void 0 ? _b : false;
|
|
79
87
|
this.userDistanceItemCreator = params.userDistanceItemCreator;
|
|
80
88
|
// ==================== Groups ====================
|
|
81
89
|
this.group = params.group;
|
|
@@ -113,7 +121,7 @@ export default class BaseController {
|
|
|
113
121
|
}
|
|
114
122
|
dispose() {
|
|
115
123
|
this.disposed = true;
|
|
116
|
-
this.magnifier.
|
|
124
|
+
this.magnifier.remove();
|
|
117
125
|
this.model.lines.forEach((line) => this.removeLine(line));
|
|
118
126
|
const fiveElement = this.five.getElement();
|
|
119
127
|
if (fiveElement) {
|
|
@@ -80,7 +80,7 @@ export default class EditController extends BaseController {
|
|
|
80
80
|
const position = this.updateMouseGroup(intersection, mesh).position;
|
|
81
81
|
(_a = this.pressPoint) === null || _a === void 0 ? void 0 : _a.position.copy(position);
|
|
82
82
|
this.updateDashed();
|
|
83
|
-
requestAnimationFrame(() => this.magnifier.
|
|
83
|
+
requestAnimationFrame(() => this.magnifier.renderWithPoint(this.mouseGroup.position));
|
|
84
84
|
this.five.needsRender = true;
|
|
85
85
|
}, 20)
|
|
86
86
|
});
|
|
@@ -123,7 +123,7 @@ export default class EditController extends BaseController {
|
|
|
123
123
|
// ============ revoke dashed ============
|
|
124
124
|
this.updateDashed();
|
|
125
125
|
// ============ revoke magnifier ============
|
|
126
|
-
this.magnifier.
|
|
126
|
+
this.magnifier.remove();
|
|
127
127
|
this.five.needsRender = true;
|
|
128
128
|
}
|
|
129
129
|
});
|
|
@@ -132,7 +132,7 @@ export default class EditController extends BaseController {
|
|
|
132
132
|
configurable: true,
|
|
133
133
|
writable: true,
|
|
134
134
|
value: () => {
|
|
135
|
-
this.magnifier.
|
|
135
|
+
this.magnifier.remove();
|
|
136
136
|
this.group.remove(this.mouseGroup);
|
|
137
137
|
this.hasAppendMouseGroup = false;
|
|
138
138
|
if (this.lastPoint) {
|
|
@@ -220,7 +220,7 @@ export default class EditController extends BaseController {
|
|
|
220
220
|
}
|
|
221
221
|
this.pressPoint = undefined;
|
|
222
222
|
this.hasAppendMouseGroup = false;
|
|
223
|
-
this.magnifier.
|
|
223
|
+
this.magnifier.remove();
|
|
224
224
|
this.group.remove(this.mouseGroup);
|
|
225
225
|
this.updateDashed();
|
|
226
226
|
this.five.needsRender = true;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import type { LineJson } from '../typings/data';
|
|
2
|
+
import { Model } from '../Model';
|
|
3
|
+
import Line from '../Model/line';
|
|
4
|
+
import BaseController, { IControllerParams } from './BaseController';
|
|
5
|
+
export declare type State = 'watching' | 'editing';
|
|
6
|
+
export interface EditEvent {
|
|
7
|
+
editedLineChange: (lines: LineJson[]) => void;
|
|
8
|
+
}
|
|
9
|
+
export default class MixedController extends BaseController {
|
|
10
|
+
state: State;
|
|
11
|
+
model: Model;
|
|
12
|
+
private hasAppendDashed;
|
|
13
|
+
private fiveElement?;
|
|
14
|
+
private mobileStartPoint;
|
|
15
|
+
private mobileNowPoint;
|
|
16
|
+
private highlightedLines;
|
|
17
|
+
private deleteDom;
|
|
18
|
+
/** 圆环点到上一个端点连接的虚线 */
|
|
19
|
+
private dashed;
|
|
20
|
+
constructor(params: IControllerParams);
|
|
21
|
+
dispose(): void;
|
|
22
|
+
highlightLine(line: Line): void;
|
|
23
|
+
clearHighlightLines(): void;
|
|
24
|
+
getEditingLines(): Line[];
|
|
25
|
+
/** 编辑线条发生改变时通知外部 */
|
|
26
|
+
private onLineChanged;
|
|
27
|
+
private onWantsTapGesture;
|
|
28
|
+
/** 编辑时取消走点,watch时可以走 */
|
|
29
|
+
private onWantsToMoveToPano;
|
|
30
|
+
/** 移动全景时更新 distanceItem 在屏幕上的位置 */
|
|
31
|
+
private onCameraUpdate;
|
|
32
|
+
/** mobile态时更新虚线 */
|
|
33
|
+
private updateMobileDashed;
|
|
34
|
+
/** mobile态时更新放大镜 */
|
|
35
|
+
private updateMagnifier;
|
|
36
|
+
private onGetStartPoint;
|
|
37
|
+
private onGetEndPoint;
|
|
38
|
+
private onNowPointChange;
|
|
39
|
+
private onWillChangeState;
|
|
40
|
+
private chooseLine;
|
|
41
|
+
private highlightLines;
|
|
42
|
+
private deleteDomClickCallback;
|
|
43
|
+
private cancelDeleteClickCallback;
|
|
44
|
+
}
|