@realsee/dnalogel 2.0.0-alpha.35 → 2.0.0-alpha.36
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/ItemLabelPlugin/index.js +21 -41
- package/dist/ModelItemLabelPlugin/index.js +16 -36
- package/dist/PanoMeasurePlugin/Modules/DeleteDom/_Assets/delete_hover_bg.png.d.ts +1 -1
- package/dist/PanoMeasurePlugin/Modules/UIController/HTML.d.ts +0 -4
- package/dist/PanoMeasurePlugin/Modules/UIController/MainBtnController.d.ts +0 -3
- package/dist/PanoMeasurePlugin/Modules/UIController/mobileHTML.d.ts +2 -0
- package/dist/PanoMeasurePlugin/Modules/UIController/{NewMainBtnController.d.ts → mobileMainBtnController.d.ts} +1 -1
- package/dist/PanoMeasurePlugin/Modules/UIController/style.d.ts +0 -3
- package/dist/PanoMeasurePlugin/Modules/rangePiece/html.d.ts +1 -1
- package/dist/PanoMeasurePlugin/Modules/rangePiece/index.d.ts +2 -0
- package/dist/PanoMeasurePlugin/index.js +298 -331
- package/dist/PanoMeasurePlugin/typings/data.d.ts +5 -0
- package/dist/PanoMeasurePlugin/utils/mouseGroup.d.ts +6 -1
- package/dist/base/BasePlugin.d.ts +100 -0
- package/dist/base/BasePluginWithData.d.ts +34 -0
- package/dist/floorplan/ModelFloorplanPlugin/Controller.d.ts +70 -78
- package/dist/floorplan/ModelFloorplanPlugin/index.d.ts +5 -7
- package/dist/floorplan/ModelFloorplanPlugin/index.js +1059 -569
- package/dist/floorplan/ModelFloorplanPlugin/typing.d.ts +107 -0
- package/dist/floorplan/PanoFloorplanRadarPlugin/Controller.d.ts +23 -14
- package/dist/floorplan/PanoFloorplanRadarPlugin/index.d.ts +5 -6
- package/dist/floorplan/PanoFloorplanRadarPlugin/index.js +489 -129
- package/dist/floorplan/PanoFloorplanRadarPlugin/typing.d.ts +52 -0
- package/dist/floorplan/TopviewFloorplanPlugin/Controller.d.ts +50 -58
- package/dist/floorplan/TopviewFloorplanPlugin/index.d.ts +5 -3
- package/dist/floorplan/TopviewFloorplanPlugin/index.js +1031 -443
- package/dist/floorplan/TopviewFloorplanPlugin/typing.d.ts +86 -0
- package/{libs/floorplan/ModelFloorplanPlugin → dist/floorplan}/utils/constant.d.ts +10 -3
- package/{libs/floorplan/ModelFloorplanPlugin → dist/floorplan}/utils/correctFiveState.d.ts +2 -1
- package/dist/index.es.js +2184 -1411
- package/dist/index.js +2188 -1415
- package/dist/index.umd.js +2142 -1369
- package/dist/shared-utils/five/changeMode.d.ts +4 -1
- package/dist/shared-utils/getPxmm.d.ts +8 -0
- package/docs/assets/search.js +1 -1
- package/docs/classes/Magnifier.html +4 -4
- package/docs/classes/ModelRoomLabelController.html +4 -4
- 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/Rotation.html +2 -2
- package/docs/index.html +2 -2
- package/docs/interfaces/CSS3DRenderPluginExportType.html +2 -2
- package/docs/interfaces/CameraMovementPluginExportType.html +2 -2
- package/docs/interfaces/FloorplanBounding.html +4 -4
- package/docs/interfaces/FloorplanData.html +2 -2
- package/docs/interfaces/FloorplanEntrance.html +7 -7
- package/docs/interfaces/FloorplanExtraObject.html +3 -3
- 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 +6 -6
- package/docs/interfaces/FloorplanRoomLabelItem.html +3 -3
- package/docs/interfaces/FloorplanServerBounding.html +4 -4
- package/docs/interfaces/FloorplanServerComputedData.html +1 -1
- package/docs/interfaces/FloorplanServerData.html +2 -2
- package/docs/interfaces/FloorplanServerEntrance.html +7 -7
- 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 +7 -7
- package/docs/interfaces/FloorplanServerRoomLabelItem.html +3 -3
- 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/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 +2 -2
- 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/PanoMeasureParameterType.html +1 -1
- 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/modules.html +17 -27
- package/libs/ItemLabelPlugin/ItemLabelComponent.js +21 -41
- package/libs/ModelItemLabelPlugin/ItemLabelComponent.js +16 -36
- package/libs/PanoMeasurePlugin/Controller/index.js +4 -2
- package/libs/PanoMeasurePlugin/Modules/DeleteDom/_Assets/delete_hover_bg.png.d.ts +1 -1
- package/libs/PanoMeasurePlugin/Modules/DeleteDom/_Assets/delete_hover_bg.png.js +1 -1
- package/libs/PanoMeasurePlugin/Modules/GuideController.js +2 -2
- package/libs/PanoMeasurePlugin/Modules/UIController/HTML.d.ts +0 -4
- package/libs/PanoMeasurePlugin/Modules/UIController/HTML.js +66 -55
- package/libs/PanoMeasurePlugin/Modules/UIController/MainBtnController.d.ts +0 -3
- package/libs/PanoMeasurePlugin/Modules/UIController/MainBtnController.js +51 -73
- package/libs/PanoMeasurePlugin/Modules/UIController/Revoke/index.js +7 -4
- package/libs/PanoMeasurePlugin/Modules/UIController/index.js +10 -12
- package/libs/PanoMeasurePlugin/Modules/UIController/mobileHTML.d.ts +2 -0
- package/libs/PanoMeasurePlugin/Modules/UIController/mobileHTML.js +2 -2
- package/libs/PanoMeasurePlugin/Modules/UIController/{NewMainBtnController.d.ts → mobileMainBtnController.d.ts} +1 -1
- package/libs/PanoMeasurePlugin/Modules/UIController/{NewMainBtnController.js → mobileMainBtnController.js} +4 -4
- package/libs/PanoMeasurePlugin/Modules/UIController/style.d.ts +0 -3
- package/libs/PanoMeasurePlugin/Modules/UIController/style.js +7 -24
- package/libs/PanoMeasurePlugin/Modules/rangePiece/html.d.ts +1 -1
- package/libs/PanoMeasurePlugin/Modules/rangePiece/html.js +1 -1
- package/libs/PanoMeasurePlugin/Modules/rangePiece/index.d.ts +2 -0
- package/libs/PanoMeasurePlugin/Modules/rangePiece/index.js +1 -2
- package/libs/PanoMeasurePlugin/typings/data.d.ts +5 -0
- package/libs/PanoMeasurePlugin/utils/mouseGroup.d.ts +6 -1
- package/libs/PanoMeasurePlugin/utils/mouseGroup.js +55 -7
- package/libs/base/BasePlugin.d.ts +100 -0
- package/libs/base/BasePlugin.js +31 -0
- package/libs/base/BasePluginWithData.d.ts +34 -0
- package/libs/base/BasePluginWithData.js +4 -0
- package/libs/floorplan/Components/Compass.js +11 -11
- package/libs/floorplan/Components/CurrentFloor.js +24 -11
- package/libs/floorplan/Components/Main.js +21 -15
- package/libs/floorplan/Components/RoomHighlight/Room.js +44 -5
- package/libs/floorplan/Components/RoomHighlight/RoomHighlight.js +29 -12
- package/libs/floorplan/Components/RoomLabels/RoomLabel.js +164 -15
- package/libs/floorplan/Components/RoomLabels/RoomLabels.js +68 -24
- package/libs/floorplan/Components/RoomMaterials/RoomMaterial_1.js +1 -0
- package/libs/floorplan/Components/RoomMaterials/RoomMaterial_2.js +11 -9
- package/libs/floorplan/Components/RuleLabels/RuleItem.js +2 -2
- package/libs/floorplan/ModelFloorplanPlugin/Controller.d.ts +70 -78
- package/libs/floorplan/ModelFloorplanPlugin/Controller.js +434 -274
- package/libs/floorplan/ModelFloorplanPlugin/index.d.ts +5 -7
- package/libs/floorplan/ModelFloorplanPlugin/index.js +2 -2
- package/libs/floorplan/ModelFloorplanPlugin/typing.d.ts +107 -0
- package/libs/floorplan/ModelFloorplanPlugin/{typings/events.type.js → typing.js} +0 -0
- package/libs/floorplan/PanoFloorplanRadarPlugin/Components/Camera.js +5 -5
- package/libs/floorplan/PanoFloorplanRadarPlugin/Components/Main.js +114 -53
- package/libs/floorplan/PanoFloorplanRadarPlugin/Controller.d.ts +23 -14
- package/libs/floorplan/PanoFloorplanRadarPlugin/Controller.js +162 -52
- package/libs/floorplan/PanoFloorplanRadarPlugin/index.d.ts +5 -6
- package/libs/floorplan/PanoFloorplanRadarPlugin/index.js +2 -2
- package/libs/floorplan/PanoFloorplanRadarPlugin/typing.d.ts +52 -0
- package/libs/floorplan/PanoFloorplanRadarPlugin/typing.js +1 -0
- package/libs/floorplan/TopviewFloorplanPlugin/Controller.d.ts +50 -58
- package/libs/floorplan/TopviewFloorplanPlugin/Controller.js +320 -174
- package/libs/floorplan/TopviewFloorplanPlugin/index.d.ts +5 -3
- package/libs/floorplan/TopviewFloorplanPlugin/index.js +2 -2
- package/libs/floorplan/TopviewFloorplanPlugin/style.js +1 -1
- package/libs/floorplan/TopviewFloorplanPlugin/typing.d.ts +86 -0
- package/libs/floorplan/TopviewFloorplanPlugin/typing.js +1 -0
- package/{dist/floorplan/ModelFloorplanPlugin → libs/floorplan}/utils/constant.d.ts +10 -3
- package/libs/floorplan/{ModelFloorplanPlugin/utils → utils}/constant.js +9 -2
- package/{dist/floorplan/ModelFloorplanPlugin → libs/floorplan}/utils/correctFiveState.d.ts +2 -1
- package/libs/floorplan/{ModelFloorplanPlugin/utils → utils}/correctFiveState.js +16 -16
- package/libs/shared-utils/five/changeMode.d.ts +4 -1
- package/libs/shared-utils/five/changeMode.js +34 -13
- package/libs/shared-utils/getPxmm.d.ts +8 -0
- package/libs/shared-utils/getPxmm.js +25 -20
- package/package.json +2 -2
- package/dist/floorplan/ModelFloorplanPlugin/typings/events.type.d.ts +0 -23
- package/docs/classes/PanoFloorplanRadarPluginController.html +0 -3
- package/docs/enums/ModelFloorplanErrorType.html +0 -1
- package/docs/interfaces/ModelFloorplanParameterType.html +0 -1
- package/docs/interfaces/ModelFloorplanViewEvent.html +0 -5
- package/docs/interfaces/PanoFloorplanRadarPluginControllerParameter.html +0 -1
- package/docs/interfaces/TopviewFloorplanPluginParameterType.html +0 -19
- package/libs/ModelSimulationPlugin/index.d.ts +0 -33
- package/libs/ModelSimulationPlugin/index.js +0 -166
- package/libs/ModelSimulationPlugin/shaders/fragment.d.ts +0 -2
- package/libs/ModelSimulationPlugin/shaders/fragment.js +0 -96
- package/libs/ModelSimulationPlugin/shaders/vertex.d.ts +0 -2
- package/libs/ModelSimulationPlugin/shaders/vertex.js +0 -23
- package/libs/floorplan/ModelFloorplanPlugin/Assets/compass.d.ts +0 -1
- package/libs/floorplan/ModelFloorplanPlugin/Assets/compass.js +0 -1
- package/libs/floorplan/ModelFloorplanPlugin/Components/Camera.js +0 -120
- package/libs/floorplan/ModelFloorplanPlugin/Components/Compass.js +0 -106
- package/libs/floorplan/ModelFloorplanPlugin/Components/CurrentFloor/CurrentFloor.js +0 -463
- package/libs/floorplan/ModelFloorplanPlugin/Components/Main.js +0 -375
- package/libs/floorplan/ModelFloorplanPlugin/Components/RoomLabels/RoomLabel.js +0 -171
- package/libs/floorplan/ModelFloorplanPlugin/Components/RoomLabels/RoomLabels.js +0 -265
- package/libs/floorplan/ModelFloorplanPlugin/Components/RuleLabels/RuleItem.js +0 -301
- package/libs/floorplan/ModelFloorplanPlugin/Components/RuleLabels/RuleLabels.js +0 -219
- package/libs/floorplan/ModelFloorplanPlugin/typings/events.type.d.ts +0 -23
- package/libs/shared-utils/five/useFivePlugin.d.ts +0 -1
- package/libs/shared-utils/five/useFivePlugin.js +0 -8
- package/libs/shared-utils/useDebounce.d.ts +0 -8
- package/libs/shared-utils/useDebounce.js +0 -22
- package/libs/shared-utils/useThrottle.d.ts +0 -8
- package/libs/shared-utils/useThrottle.js +0 -25
|
@@ -5,6 +5,7 @@ import {
|
|
|
5
5
|
append,
|
|
6
6
|
append_styles,
|
|
7
7
|
attr,
|
|
8
|
+
binding_callbacks,
|
|
8
9
|
detach,
|
|
9
10
|
element,
|
|
10
11
|
empty,
|
|
@@ -18,14 +19,16 @@ import {
|
|
|
18
19
|
text
|
|
19
20
|
} from "svelte/internal";
|
|
20
21
|
|
|
22
|
+
import { onMount } from 'svelte';
|
|
23
|
+
|
|
21
24
|
function add_css(target) {
|
|
22
|
-
append_styles(target, "svelte-
|
|
25
|
+
append_styles(target, "svelte-1b5j2lp", ".floorplan-plugin__room-label-item.svelte-1b5j2lp{position:absolute;display:flex;flex-flow:column;align-items:center;line-height:1;color:#fff;transform:translate(-50%, -50%);white-space:nowrap;will-change:opacity;transition:opacity 300ms}.floorplan-plugin__room-size.svelte-1b5j2lp{opacity:0.45}");
|
|
23
26
|
}
|
|
24
27
|
|
|
25
|
-
// (
|
|
28
|
+
// (95:30)
|
|
26
29
|
function create_if_block_1(ctx) {
|
|
27
30
|
let html_tag;
|
|
28
|
-
let raw_value = /*userConfigElement*/ ctx[
|
|
31
|
+
let raw_value = /*userConfigElement*/ ctx[4].outerHTML + "";
|
|
29
32
|
let html_anchor;
|
|
30
33
|
|
|
31
34
|
return {
|
|
@@ -39,7 +42,7 @@ function create_if_block_1(ctx) {
|
|
|
39
42
|
insert(target, html_anchor, anchor);
|
|
40
43
|
},
|
|
41
44
|
p(ctx, dirty) {
|
|
42
|
-
if (dirty & /*userConfigElement*/
|
|
45
|
+
if (dirty & /*userConfigElement*/ 16 && raw_value !== (raw_value = /*userConfigElement*/ ctx[4].outerHTML + "")) html_tag.p(raw_value);
|
|
43
46
|
},
|
|
44
47
|
d(detaching) {
|
|
45
48
|
if (detaching) detach(html_anchor);
|
|
@@ -48,7 +51,7 @@ function create_if_block_1(ctx) {
|
|
|
48
51
|
};
|
|
49
52
|
}
|
|
50
53
|
|
|
51
|
-
// (
|
|
54
|
+
// (89:2) {#if getLabelElement === undefined}
|
|
52
55
|
function create_if_block(ctx) {
|
|
53
56
|
let span0;
|
|
54
57
|
let t0_value = /*room*/ ctx[0].name + "";
|
|
@@ -62,9 +65,9 @@ function create_if_block(ctx) {
|
|
|
62
65
|
t0 = text(t0_value);
|
|
63
66
|
t1 = space();
|
|
64
67
|
span1 = element("span");
|
|
65
|
-
span1.textContent = `${/*roomSizeDes*/ ctx[
|
|
68
|
+
span1.textContent = `${/*roomSizeDes*/ ctx[5]}`;
|
|
66
69
|
attr(span0, "class", "floorplan-plugin__room-name");
|
|
67
|
-
attr(span1, "class", "floorplan-plugin__room-size svelte-
|
|
70
|
+
attr(span1, "class", "floorplan-plugin__room-size svelte-1b5j2lp");
|
|
68
71
|
},
|
|
69
72
|
m(target, anchor) {
|
|
70
73
|
insert(target, span0, anchor);
|
|
@@ -88,7 +91,7 @@ function create_fragment(ctx) {
|
|
|
88
91
|
|
|
89
92
|
function select_block_type(ctx, dirty) {
|
|
90
93
|
if (/*getLabelElement*/ ctx[1] === undefined) return create_if_block;
|
|
91
|
-
if (/*userConfigElement*/ ctx[
|
|
94
|
+
if (/*userConfigElement*/ ctx[4]) return create_if_block_1;
|
|
92
95
|
}
|
|
93
96
|
|
|
94
97
|
let current_block_type = select_block_type(ctx, -1);
|
|
@@ -98,14 +101,16 @@ function create_fragment(ctx) {
|
|
|
98
101
|
c() {
|
|
99
102
|
div = element("div");
|
|
100
103
|
if (if_block) if_block.c();
|
|
101
|
-
attr(div, "class", "floorplan-plugin__room-label-item svelte-
|
|
102
|
-
set_style(div, "left", /*left*/ ctx[
|
|
103
|
-
set_style(div, "top", /*top*/ ctx[
|
|
104
|
-
set_style(div, "font-size", /*fontSize*/ ctx[
|
|
104
|
+
attr(div, "class", "floorplan-plugin__room-label-item svelte-1b5j2lp");
|
|
105
|
+
set_style(div, "left", /*left*/ ctx[6], false);
|
|
106
|
+
set_style(div, "top", /*top*/ ctx[7], false);
|
|
107
|
+
set_style(div, "font-size", /*fontSize*/ ctx[8], false);
|
|
108
|
+
set_style(div, "opacity", /*labelVisible*/ ctx[3] ? '1' : '0', false);
|
|
105
109
|
},
|
|
106
110
|
m(target, anchor) {
|
|
107
111
|
insert(target, div, anchor);
|
|
108
112
|
if (if_block) if_block.m(div, null);
|
|
113
|
+
/*div_binding*/ ctx[15](div);
|
|
109
114
|
},
|
|
110
115
|
p(ctx, [dirty]) {
|
|
111
116
|
if (current_block_type === (current_block_type = select_block_type(ctx, dirty)) && if_block) {
|
|
@@ -119,6 +124,10 @@ function create_fragment(ctx) {
|
|
|
119
124
|
if_block.m(div, null);
|
|
120
125
|
}
|
|
121
126
|
}
|
|
127
|
+
|
|
128
|
+
if (dirty & /*labelVisible*/ 8) {
|
|
129
|
+
set_style(div, "opacity", /*labelVisible*/ ctx[3] ? '1' : '0', false);
|
|
130
|
+
}
|
|
122
131
|
},
|
|
123
132
|
i: noop,
|
|
124
133
|
o: noop,
|
|
@@ -128,45 +137,185 @@ function create_fragment(ctx) {
|
|
|
128
137
|
if (if_block) {
|
|
129
138
|
if_block.d();
|
|
130
139
|
}
|
|
140
|
+
|
|
141
|
+
/*div_binding*/ ctx[15](null);
|
|
131
142
|
}
|
|
132
143
|
};
|
|
133
144
|
}
|
|
134
145
|
|
|
146
|
+
function isPointInPolygon(point, polygon) {
|
|
147
|
+
const x = point[0];
|
|
148
|
+
const y = point[1];
|
|
149
|
+
let inside = false;
|
|
150
|
+
|
|
151
|
+
for (let i = 0, j = polygon.length - 1; i < polygon.length; j = i++) {
|
|
152
|
+
const xi = polygon[i][0];
|
|
153
|
+
const yi = polygon[i][1];
|
|
154
|
+
const xj = polygon[j][0];
|
|
155
|
+
const yj = polygon[j][1];
|
|
156
|
+
const intersect = yi > y !== yj > y && x < (xj - xi) * (y - yi) / (yj - yi) + xi;
|
|
157
|
+
if (intersect) inside = !inside;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
return inside;
|
|
161
|
+
}
|
|
162
|
+
|
|
135
163
|
function instance($$self, $$props, $$invalidate) {
|
|
164
|
+
let isLabelInRoom;
|
|
136
165
|
let userConfigElement;
|
|
166
|
+
let labelVisible;
|
|
167
|
+
let { pxmm } = $$props;
|
|
137
168
|
let { room } = $$props;
|
|
169
|
+
let { hoveredRoom } = $$props;
|
|
138
170
|
let { getLabelElement } = $$props;
|
|
171
|
+
let { adaptiveRoomLabelVisibleEnable } = $$props;
|
|
172
|
+
|
|
173
|
+
function isLabelInRoomCurry(room, labelElementSize) {
|
|
174
|
+
if (labelElementSize.width === 0 || labelElementSize.height === 0) return () => false;
|
|
175
|
+
const polygon = room.path.map(({ x, y }) => [x, y]);
|
|
176
|
+
const labelPosition = room.roomLabel.position;
|
|
177
|
+
const { x, y } = labelPosition;
|
|
178
|
+
const { width, height } = labelElementSize;
|
|
179
|
+
const halfWidth = width / 2;
|
|
180
|
+
const halfHeight = height / 2;
|
|
181
|
+
|
|
182
|
+
return function isLabelInRoom(pxmm) {
|
|
183
|
+
const clientX = x * pxmm;
|
|
184
|
+
const clientY = y * pxmm;
|
|
185
|
+
const clientPolygon = polygon.map(([x, y]) => [x * pxmm, y * pxmm]);
|
|
186
|
+
|
|
187
|
+
// const
|
|
188
|
+
/** 围成 labelRect 的四个点
|
|
189
|
+
* 1----0
|
|
190
|
+
* | |
|
|
191
|
+
* 2----3
|
|
192
|
+
*/
|
|
193
|
+
const labelRectClientPoints = [
|
|
194
|
+
[clientX + halfWidth, clientY - halfHeight],
|
|
195
|
+
[clientX - halfWidth, clientY - halfHeight],
|
|
196
|
+
[clientX - halfWidth, clientY + halfHeight],
|
|
197
|
+
[clientX + halfWidth, clientY + halfHeight]
|
|
198
|
+
];
|
|
199
|
+
|
|
200
|
+
return labelRectClientPoints.every(point => isPointInPolygon(point, clientPolygon));
|
|
201
|
+
};
|
|
202
|
+
}
|
|
139
203
|
|
|
204
|
+
// ========== 获取设备宽高像素 ==========
|
|
140
205
|
// TODO: 统一这里的判断条件,目前写了多处
|
|
141
206
|
const bodyWidth = document.body.clientWidth;
|
|
142
207
|
|
|
143
208
|
const bodyHeight = document.body.clientHeight;
|
|
144
209
|
const roomSizeDes = room.size ? (room.size / 1000000).toFixed(1) + '㎡' : '';
|
|
210
|
+
|
|
211
|
+
// ====================================
|
|
145
212
|
const roomLabel = room.roomLabel;
|
|
213
|
+
|
|
146
214
|
const left = roomLabel.positionInImage.x * 100 + '%';
|
|
147
215
|
const top = roomLabel.positionInImage.y * 100 + '%';
|
|
216
|
+
|
|
217
|
+
// 屏幕宽或高小于 500px 时,用 10px 字体,否则用 14px
|
|
148
218
|
const fontSize = (bodyWidth < 500 || bodyHeight < 500 ? 10 : 14) / 16 + 'rem';
|
|
149
219
|
|
|
220
|
+
let isHoverd = false;
|
|
221
|
+
let labelElement;
|
|
222
|
+
let labelElementSize;
|
|
223
|
+
|
|
224
|
+
hoveredRoom.subscribe(function onHoverdRoomUpdate(_room) {
|
|
225
|
+
$$invalidate(12, isHoverd = !!_room && _room.id === room.id);
|
|
226
|
+
});
|
|
227
|
+
|
|
228
|
+
onMount(() => {
|
|
229
|
+
// Label 能不能展示只跟房间大小有关
|
|
230
|
+
// 计算 LabelElement 宽高
|
|
231
|
+
const labelDomRect = labelElement === null || labelElement === void 0
|
|
232
|
+
? void 0
|
|
233
|
+
: labelElement.getClientRects()[0];
|
|
234
|
+
|
|
235
|
+
$$invalidate(13, labelElementSize = {
|
|
236
|
+
width: labelDomRect.width,
|
|
237
|
+
height: labelDomRect.height
|
|
238
|
+
});
|
|
239
|
+
});
|
|
240
|
+
|
|
241
|
+
function div_binding($$value) {
|
|
242
|
+
binding_callbacks[$$value ? 'unshift' : 'push'](() => {
|
|
243
|
+
labelElement = $$value;
|
|
244
|
+
$$invalidate(2, labelElement);
|
|
245
|
+
});
|
|
246
|
+
}
|
|
247
|
+
|
|
150
248
|
$$self.$$set = $$props => {
|
|
249
|
+
if ('pxmm' in $$props) $$invalidate(9, pxmm = $$props.pxmm);
|
|
151
250
|
if ('room' in $$props) $$invalidate(0, room = $$props.room);
|
|
251
|
+
if ('hoveredRoom' in $$props) $$invalidate(10, hoveredRoom = $$props.hoveredRoom);
|
|
152
252
|
if ('getLabelElement' in $$props) $$invalidate(1, getLabelElement = $$props.getLabelElement);
|
|
253
|
+
if ('adaptiveRoomLabelVisibleEnable' in $$props) $$invalidate(11, adaptiveRoomLabelVisibleEnable = $$props.adaptiveRoomLabelVisibleEnable);
|
|
153
254
|
};
|
|
154
255
|
|
|
155
256
|
$$self.$$.update = () => {
|
|
257
|
+
if ($$self.$$.dirty & /*labelElementSize, room*/ 8193) {
|
|
258
|
+
$: $$invalidate(14, isLabelInRoom = labelElementSize
|
|
259
|
+
? isLabelInRoomCurry(room, labelElementSize)
|
|
260
|
+
: undefined);
|
|
261
|
+
}
|
|
262
|
+
|
|
156
263
|
if ($$self.$$.dirty & /*getLabelElement, room*/ 3) {
|
|
157
|
-
$: $$invalidate(
|
|
264
|
+
$: $$invalidate(4, userConfigElement = getLabelElement === null || getLabelElement === void 0
|
|
158
265
|
? void 0
|
|
159
266
|
: getLabelElement(room));
|
|
160
267
|
}
|
|
268
|
+
|
|
269
|
+
if ($$self.$$.dirty & /*adaptiveRoomLabelVisibleEnable, isHoverd, isLabelInRoom, pxmm*/ 23040) {
|
|
270
|
+
$: $$invalidate(3, labelVisible = adaptiveRoomLabelVisibleEnable
|
|
271
|
+
? isHoverd
|
|
272
|
+
? true
|
|
273
|
+
: !!(isLabelInRoom === null || isLabelInRoom === void 0
|
|
274
|
+
? void 0
|
|
275
|
+
: isLabelInRoom(pxmm))
|
|
276
|
+
: true);
|
|
277
|
+
}
|
|
161
278
|
};
|
|
162
279
|
|
|
163
|
-
return [
|
|
280
|
+
return [
|
|
281
|
+
room,
|
|
282
|
+
getLabelElement,
|
|
283
|
+
labelElement,
|
|
284
|
+
labelVisible,
|
|
285
|
+
userConfigElement,
|
|
286
|
+
roomSizeDes,
|
|
287
|
+
left,
|
|
288
|
+
top,
|
|
289
|
+
fontSize,
|
|
290
|
+
pxmm,
|
|
291
|
+
hoveredRoom,
|
|
292
|
+
adaptiveRoomLabelVisibleEnable,
|
|
293
|
+
isHoverd,
|
|
294
|
+
labelElementSize,
|
|
295
|
+
isLabelInRoom,
|
|
296
|
+
div_binding
|
|
297
|
+
];
|
|
164
298
|
}
|
|
165
299
|
|
|
166
300
|
class Component extends SvelteComponent {
|
|
167
301
|
constructor(options) {
|
|
168
302
|
super();
|
|
169
|
-
|
|
303
|
+
|
|
304
|
+
init(
|
|
305
|
+
this,
|
|
306
|
+
options,
|
|
307
|
+
instance,
|
|
308
|
+
create_fragment,
|
|
309
|
+
safe_not_equal,
|
|
310
|
+
{
|
|
311
|
+
pxmm: 9,
|
|
312
|
+
room: 0,
|
|
313
|
+
hoveredRoom: 10,
|
|
314
|
+
getLabelElement: 1,
|
|
315
|
+
adaptiveRoomLabelVisibleEnable: 11
|
|
316
|
+
},
|
|
317
|
+
add_css
|
|
318
|
+
);
|
|
170
319
|
}
|
|
171
320
|
}
|
|
172
321
|
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
/* generated by Svelte v3.47.0 */
|
|
2
2
|
import {
|
|
3
3
|
SvelteComponent,
|
|
4
|
+
add_render_callback,
|
|
5
|
+
add_resize_listener,
|
|
4
6
|
append_styles,
|
|
5
7
|
assign,
|
|
6
8
|
attr,
|
|
@@ -30,18 +32,19 @@ function add_css(target) {
|
|
|
30
32
|
|
|
31
33
|
function get_each_context(ctx, list, i) {
|
|
32
34
|
const child_ctx = ctx.slice();
|
|
33
|
-
child_ctx[
|
|
35
|
+
child_ctx[9] = list[i];
|
|
34
36
|
return child_ctx;
|
|
35
37
|
}
|
|
36
38
|
|
|
37
|
-
// (
|
|
39
|
+
// (17:0) {#if rooms}
|
|
38
40
|
function create_if_block(ctx) {
|
|
39
41
|
let div;
|
|
40
42
|
let each_blocks = [];
|
|
41
43
|
let each_1_lookup = new Map();
|
|
44
|
+
let div_resize_listener;
|
|
42
45
|
let current;
|
|
43
|
-
let each_value = /*rooms*/ ctx[
|
|
44
|
-
const get_key = ctx => /*room*/ ctx[
|
|
46
|
+
let each_value = /*rooms*/ ctx[5];
|
|
47
|
+
const get_key = ctx => /*room*/ ctx[9].id;
|
|
45
48
|
|
|
46
49
|
for (let i = 0; i < each_value.length; i += 1) {
|
|
47
50
|
let child_ctx = get_each_context(ctx, each_value, i);
|
|
@@ -58,6 +61,7 @@ function create_if_block(ctx) {
|
|
|
58
61
|
}
|
|
59
62
|
|
|
60
63
|
attr(div, "class", "floorplan-plugin__room-labels svelte-447cof");
|
|
64
|
+
add_render_callback(() => /*div_elementresize_handler*/ ctx[8].call(div));
|
|
61
65
|
},
|
|
62
66
|
m(target, anchor) {
|
|
63
67
|
insert(target, div, anchor);
|
|
@@ -66,11 +70,12 @@ function create_if_block(ctx) {
|
|
|
66
70
|
each_blocks[i].m(div, null);
|
|
67
71
|
}
|
|
68
72
|
|
|
73
|
+
div_resize_listener = add_resize_listener(div, /*div_elementresize_handler*/ ctx[8].bind(div));
|
|
69
74
|
current = true;
|
|
70
75
|
},
|
|
71
76
|
p(ctx, dirty) {
|
|
72
|
-
if (dirty & /*rooms, getLabelElement*/
|
|
73
|
-
each_value = /*rooms*/ ctx[
|
|
77
|
+
if (dirty & /*pxmm, rooms, getLabelElement, hoveredRoom, adaptiveRoomLabelVisibleEnable*/ 55) {
|
|
78
|
+
each_value = /*rooms*/ ctx[5];
|
|
74
79
|
group_outros();
|
|
75
80
|
each_blocks = update_keyed_each(each_blocks, dirty, get_key, 1, ctx, each_value, each_1_lookup, div, outro_and_destroy_block, create_each_block, null, get_each_context);
|
|
76
81
|
check_outros();
|
|
@@ -98,11 +103,13 @@ function create_if_block(ctx) {
|
|
|
98
103
|
for (let i = 0; i < each_blocks.length; i += 1) {
|
|
99
104
|
each_blocks[i].d();
|
|
100
105
|
}
|
|
106
|
+
|
|
107
|
+
div_resize_listener();
|
|
101
108
|
}
|
|
102
109
|
};
|
|
103
110
|
}
|
|
104
111
|
|
|
105
|
-
// (
|
|
112
|
+
// (19:4) {#each rooms as room (room.id)}
|
|
106
113
|
function create_each_block(key_1, ctx) {
|
|
107
114
|
let first;
|
|
108
115
|
let roomlabel;
|
|
@@ -110,8 +117,11 @@ function create_each_block(key_1, ctx) {
|
|
|
110
117
|
|
|
111
118
|
const roomlabel_spread_levels = [
|
|
112
119
|
{
|
|
113
|
-
|
|
114
|
-
|
|
120
|
+
pxmm: /*pxmm*/ ctx[4],
|
|
121
|
+
room: /*room*/ ctx[9],
|
|
122
|
+
getLabelElement: /*getLabelElement*/ ctx[1],
|
|
123
|
+
hoveredRoom: /*hoveredRoom*/ ctx[0],
|
|
124
|
+
adaptiveRoomLabelVisibleEnable: /*adaptiveRoomLabelVisibleEnable*/ ctx[2]
|
|
115
125
|
}
|
|
116
126
|
];
|
|
117
127
|
|
|
@@ -139,11 +149,14 @@ function create_each_block(key_1, ctx) {
|
|
|
139
149
|
p(new_ctx, dirty) {
|
|
140
150
|
ctx = new_ctx;
|
|
141
151
|
|
|
142
|
-
const roomlabel_changes = (dirty & /*rooms, getLabelElement*/
|
|
152
|
+
const roomlabel_changes = (dirty & /*pxmm, rooms, getLabelElement, hoveredRoom, adaptiveRoomLabelVisibleEnable*/ 55)
|
|
143
153
|
? get_spread_update(roomlabel_spread_levels, [
|
|
144
154
|
{
|
|
145
|
-
|
|
146
|
-
|
|
155
|
+
pxmm: /*pxmm*/ ctx[4],
|
|
156
|
+
room: /*room*/ ctx[9],
|
|
157
|
+
getLabelElement: /*getLabelElement*/ ctx[1],
|
|
158
|
+
hoveredRoom: /*hoveredRoom*/ ctx[0],
|
|
159
|
+
adaptiveRoomLabelVisibleEnable: /*adaptiveRoomLabelVisibleEnable*/ ctx[2]
|
|
147
160
|
}
|
|
148
161
|
])
|
|
149
162
|
: {};
|
|
@@ -169,7 +182,7 @@ function create_each_block(key_1, ctx) {
|
|
|
169
182
|
function create_fragment(ctx) {
|
|
170
183
|
let if_block_anchor;
|
|
171
184
|
let current;
|
|
172
|
-
let if_block = /*rooms*/ ctx[
|
|
185
|
+
let if_block = /*rooms*/ ctx[5] && create_if_block(ctx);
|
|
173
186
|
|
|
174
187
|
return {
|
|
175
188
|
c() {
|
|
@@ -182,11 +195,11 @@ function create_fragment(ctx) {
|
|
|
182
195
|
current = true;
|
|
183
196
|
},
|
|
184
197
|
p(ctx, [dirty]) {
|
|
185
|
-
if (/*rooms*/ ctx[
|
|
198
|
+
if (/*rooms*/ ctx[5]) {
|
|
186
199
|
if (if_block) {
|
|
187
200
|
if_block.p(ctx, dirty);
|
|
188
201
|
|
|
189
|
-
if (dirty & /*rooms*/
|
|
202
|
+
if (dirty & /*rooms*/ 32) {
|
|
190
203
|
transition_in(if_block, 1);
|
|
191
204
|
}
|
|
192
205
|
} else {
|
|
@@ -225,21 +238,50 @@ function instance($$self, $$props, $$invalidate) {
|
|
|
225
238
|
let rooms;
|
|
226
239
|
let { floorIndex } = $$props;
|
|
227
240
|
let { floorplanData } = $$props;
|
|
241
|
+
let { hoveredRoom } = $$props;
|
|
228
242
|
let { getLabelElement } = $$props;
|
|
243
|
+
let { adaptiveRoomLabelVisibleEnable } = $$props;
|
|
244
|
+
let clientWidth = 0;
|
|
245
|
+
let pxmm = 0;
|
|
246
|
+
|
|
247
|
+
function div_elementresize_handler() {
|
|
248
|
+
clientWidth = this.clientWidth;
|
|
249
|
+
$$invalidate(3, clientWidth);
|
|
250
|
+
}
|
|
229
251
|
|
|
230
252
|
$$self.$$set = $$props => {
|
|
231
|
-
if ('floorIndex' in $$props) $$invalidate(
|
|
232
|
-
if ('floorplanData' in $$props) $$invalidate(
|
|
233
|
-
if ('
|
|
253
|
+
if ('floorIndex' in $$props) $$invalidate(6, floorIndex = $$props.floorIndex);
|
|
254
|
+
if ('floorplanData' in $$props) $$invalidate(7, floorplanData = $$props.floorplanData);
|
|
255
|
+
if ('hoveredRoom' in $$props) $$invalidate(0, hoveredRoom = $$props.hoveredRoom);
|
|
256
|
+
if ('getLabelElement' in $$props) $$invalidate(1, getLabelElement = $$props.getLabelElement);
|
|
257
|
+
if ('adaptiveRoomLabelVisibleEnable' in $$props) $$invalidate(2, adaptiveRoomLabelVisibleEnable = $$props.adaptiveRoomLabelVisibleEnable);
|
|
234
258
|
};
|
|
235
259
|
|
|
236
260
|
$$self.$$.update = () => {
|
|
237
|
-
if ($$self.$$.dirty & /*floorplanData, floorIndex*/
|
|
238
|
-
$: $$invalidate(
|
|
261
|
+
if ($$self.$$.dirty & /*floorplanData, floorIndex*/ 192) {
|
|
262
|
+
$: $$invalidate(5, rooms = floorplanData.floorDatas[floorIndex].rooms);
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
if ($$self.$$.dirty & /*floorplanData, clientWidth*/ 136) {
|
|
266
|
+
$: {
|
|
267
|
+
const { max, min } = floorplanData.bounding;
|
|
268
|
+
const boundingWidth = max.x - min.x;
|
|
269
|
+
$$invalidate(4, pxmm = clientWidth / boundingWidth);
|
|
270
|
+
}
|
|
239
271
|
}
|
|
240
272
|
};
|
|
241
273
|
|
|
242
|
-
return [
|
|
274
|
+
return [
|
|
275
|
+
hoveredRoom,
|
|
276
|
+
getLabelElement,
|
|
277
|
+
adaptiveRoomLabelVisibleEnable,
|
|
278
|
+
clientWidth,
|
|
279
|
+
pxmm,
|
|
280
|
+
rooms,
|
|
281
|
+
floorIndex,
|
|
282
|
+
floorplanData,
|
|
283
|
+
div_elementresize_handler
|
|
284
|
+
];
|
|
243
285
|
}
|
|
244
286
|
|
|
245
287
|
class Component extends SvelteComponent {
|
|
@@ -253,9 +295,11 @@ class Component extends SvelteComponent {
|
|
|
253
295
|
create_fragment,
|
|
254
296
|
safe_not_equal,
|
|
255
297
|
{
|
|
256
|
-
floorIndex:
|
|
257
|
-
floorplanData:
|
|
258
|
-
|
|
298
|
+
floorIndex: 6,
|
|
299
|
+
floorplanData: 7,
|
|
300
|
+
hoveredRoom: 0,
|
|
301
|
+
getLabelElement: 1,
|
|
302
|
+
adaptiveRoomLabelVisibleEnable: 2
|
|
259
303
|
},
|
|
260
304
|
add_css
|
|
261
305
|
);
|
|
@@ -46,6 +46,7 @@ function create_fragment(ctx) {
|
|
|
46
46
|
attr(pattern, "width", /*width*/ ctx[1]);
|
|
47
47
|
attr(pattern, "height", /*width*/ ctx[1]);
|
|
48
48
|
attr(pattern, "patternUnits", "userSpaceOnUse");
|
|
49
|
+
attr(pattern, "patternTransform", "scale(50 50)");
|
|
49
50
|
attr(path1, "d", /*d*/ ctx[0]);
|
|
50
51
|
attr(path1, "fill", "url(#fpm-room-pattern-0)");
|
|
51
52
|
},
|
|
@@ -40,8 +40,8 @@ function create_fragment(ctx) {
|
|
|
40
40
|
path1 = svg_element("path");
|
|
41
41
|
t2 = space();
|
|
42
42
|
path2 = svg_element("path");
|
|
43
|
-
attr(rect0, "x", "0
|
|
44
|
-
attr(rect0, "y", "0
|
|
43
|
+
attr(rect0, "x", "0");
|
|
44
|
+
attr(rect0, "y", "0");
|
|
45
45
|
attr(rect0, "width", "6");
|
|
46
46
|
attr(rect0, "height", "50");
|
|
47
47
|
attr(rect0, "fill", "none");
|
|
@@ -50,22 +50,24 @@ function create_fragment(ctx) {
|
|
|
50
50
|
attr(pattern0, "id", "room-material-pattern-1");
|
|
51
51
|
attr(pattern0, "x", "0");
|
|
52
52
|
attr(pattern0, "y", "0");
|
|
53
|
-
attr(pattern0, "width", "
|
|
54
|
-
attr(pattern0, "height", "
|
|
53
|
+
attr(pattern0, "width", "12");
|
|
54
|
+
attr(pattern0, "height", "50");
|
|
55
55
|
attr(pattern0, "patternUnits", "userSpaceOnUse");
|
|
56
|
-
attr(
|
|
57
|
-
attr(rect1, "
|
|
56
|
+
attr(pattern0, "patternTransform", "scale(50 50)");
|
|
57
|
+
attr(rect1, "x", "0");
|
|
58
|
+
attr(rect1, "y", "0");
|
|
58
59
|
attr(rect1, "width", "6");
|
|
59
60
|
attr(rect1, "height", "50");
|
|
60
61
|
attr(rect1, "fill", "none");
|
|
61
62
|
attr(rect1, "stroke", "#4B4B57");
|
|
62
63
|
attr(rect1, "stroke-width", "0.5");
|
|
63
64
|
attr(pattern1, "id", "room-material-pattern-2");
|
|
64
|
-
attr(pattern1, "x", "
|
|
65
|
+
attr(pattern1, "x", "6");
|
|
65
66
|
attr(pattern1, "y", "25");
|
|
66
|
-
attr(pattern1, "width", "
|
|
67
|
-
attr(pattern1, "height", "
|
|
67
|
+
attr(pattern1, "width", "12");
|
|
68
|
+
attr(pattern1, "height", "50");
|
|
68
69
|
attr(pattern1, "patternUnits", "userSpaceOnUse");
|
|
70
|
+
attr(pattern1, "patternTransform", "scale(50 50)");
|
|
69
71
|
attr(path0, "d", /*d*/ ctx[0]);
|
|
70
72
|
attr(path0, "fill", "#43434D");
|
|
71
73
|
attr(path1, "d", /*d*/ ctx[0]);
|
|
@@ -36,7 +36,7 @@ function get_each_context_1(ctx, list, i) {
|
|
|
36
36
|
return child_ctx;
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
-
// (
|
|
39
|
+
// (47:4) {#each rulerLabels as rulerLabel}
|
|
40
40
|
function create_each_block_1(ctx) {
|
|
41
41
|
let div;
|
|
42
42
|
|
|
@@ -57,7 +57,7 @@ function create_each_block_1(ctx) {
|
|
|
57
57
|
};
|
|
58
58
|
}
|
|
59
59
|
|
|
60
|
-
// (
|
|
60
|
+
// (56:4) {#each rulerTexts as textItem, textItemIndex (textItemIndex)}
|
|
61
61
|
function create_each_block(key_1, ctx) {
|
|
62
62
|
let div1;
|
|
63
63
|
let div0;
|