@realsee/dnalogel 2.0.0-alpha.35-beta2 → 2.0.0-alpha.37
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/PanoSpatialTagPlugin/Plugin.d.ts +2 -0
- package/dist/PanoSpatialTagPlugin/index.js +40 -45
- package/dist/base/BasePlugin.d.ts +100 -0
- package/dist/base/BasePluginWithData.d.ts +34 -0
- package/dist/floorplan/ModelFloorplanPlugin/Controller.d.ts +71 -78
- package/dist/floorplan/ModelFloorplanPlugin/index.d.ts +5 -7
- package/dist/floorplan/ModelFloorplanPlugin/index.js +1064 -567
- 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 +2262 -1487
- package/dist/index.js +2266 -1491
- package/dist/index.umd.js +2293 -1518
- 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/PanoSpatialTagPlugin/Components/tag.js +2 -2
- package/libs/PanoSpatialTagPlugin/Plugin.d.ts +2 -0
- package/libs/PanoSpatialTagPlugin/Plugin.js +38 -43
- 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 +71 -78
- package/libs/floorplan/ModelFloorplanPlugin/Controller.js +439 -272
- 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
|
@@ -6,7 +6,9 @@ import {
|
|
|
6
6
|
detach,
|
|
7
7
|
init,
|
|
8
8
|
insert,
|
|
9
|
+
listen,
|
|
9
10
|
noop,
|
|
11
|
+
run_all,
|
|
10
12
|
safe_not_equal,
|
|
11
13
|
svg_element
|
|
12
14
|
} from "svelte/internal";
|
|
@@ -20,22 +22,35 @@ function add_css(target) {
|
|
|
20
22
|
function create_fragment(ctx) {
|
|
21
23
|
let path;
|
|
22
24
|
let path_fill_value;
|
|
25
|
+
let mounted;
|
|
26
|
+
let dispose;
|
|
23
27
|
|
|
24
28
|
return {
|
|
25
29
|
c() {
|
|
26
30
|
path = svg_element("path");
|
|
27
|
-
attr(path, "d", /*_pathD*/ ctx[
|
|
31
|
+
attr(path, "d", /*_pathD*/ ctx[2]);
|
|
28
32
|
attr(path, "fill", path_fill_value = `#fff`);
|
|
29
33
|
attr(path, "class", "svelte-11takew");
|
|
30
34
|
},
|
|
31
35
|
m(target, anchor) {
|
|
32
36
|
insert(target, path, anchor);
|
|
37
|
+
|
|
38
|
+
if (!mounted) {
|
|
39
|
+
dispose = [
|
|
40
|
+
listen(path, "mouseenter", /*onMouseEnter*/ ctx[0]),
|
|
41
|
+
listen(path, "mouseleave", /*onMouseLeave*/ ctx[1])
|
|
42
|
+
];
|
|
43
|
+
|
|
44
|
+
mounted = true;
|
|
45
|
+
}
|
|
33
46
|
},
|
|
34
47
|
p: noop,
|
|
35
48
|
i: noop,
|
|
36
49
|
o: noop,
|
|
37
50
|
d(detaching) {
|
|
38
51
|
if (detaching) detach(path);
|
|
52
|
+
mounted = false;
|
|
53
|
+
run_all(dispose);
|
|
39
54
|
}
|
|
40
55
|
};
|
|
41
56
|
}
|
|
@@ -43,6 +58,16 @@ function create_fragment(ctx) {
|
|
|
43
58
|
function instance($$self, $$props, $$invalidate) {
|
|
44
59
|
let { room } = $$props;
|
|
45
60
|
let { floorplanData } = $$props;
|
|
61
|
+
let { hoveredRoom } = $$props;
|
|
62
|
+
|
|
63
|
+
function onMouseEnter() {
|
|
64
|
+
hoveredRoom.set(room);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
function onMouseLeave() {
|
|
68
|
+
hoveredRoom.set(undefined);
|
|
69
|
+
}
|
|
70
|
+
|
|
46
71
|
const { bounding } = floorplanData;
|
|
47
72
|
|
|
48
73
|
const _pathD = pathD(room.path, {
|
|
@@ -51,17 +76,31 @@ function instance($$self, $$props, $$invalidate) {
|
|
|
51
76
|
});
|
|
52
77
|
|
|
53
78
|
$$self.$$set = $$props => {
|
|
54
|
-
if ('room' in $$props) $$invalidate(
|
|
55
|
-
if ('floorplanData' in $$props) $$invalidate(
|
|
79
|
+
if ('room' in $$props) $$invalidate(3, room = $$props.room);
|
|
80
|
+
if ('floorplanData' in $$props) $$invalidate(4, floorplanData = $$props.floorplanData);
|
|
81
|
+
if ('hoveredRoom' in $$props) $$invalidate(5, hoveredRoom = $$props.hoveredRoom);
|
|
56
82
|
};
|
|
57
83
|
|
|
58
|
-
return [_pathD, room, floorplanData];
|
|
84
|
+
return [onMouseEnter, onMouseLeave, _pathD, room, floorplanData, hoveredRoom];
|
|
59
85
|
}
|
|
60
86
|
|
|
61
87
|
class Component extends SvelteComponent {
|
|
62
88
|
constructor(options) {
|
|
63
89
|
super();
|
|
64
|
-
|
|
90
|
+
|
|
91
|
+
init(
|
|
92
|
+
this,
|
|
93
|
+
options,
|
|
94
|
+
instance,
|
|
95
|
+
create_fragment,
|
|
96
|
+
safe_not_equal,
|
|
97
|
+
{
|
|
98
|
+
room: 3,
|
|
99
|
+
floorplanData: 4,
|
|
100
|
+
hoveredRoom: 5
|
|
101
|
+
},
|
|
102
|
+
add_css
|
|
103
|
+
);
|
|
65
104
|
}
|
|
66
105
|
}
|
|
67
106
|
|
|
@@ -32,11 +32,11 @@ function add_css(target) {
|
|
|
32
32
|
|
|
33
33
|
function get_each_context(ctx, list, i) {
|
|
34
34
|
const child_ctx = ctx.slice();
|
|
35
|
-
child_ctx[
|
|
35
|
+
child_ctx[5] = list[i];
|
|
36
36
|
return child_ctx;
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
-
// (
|
|
39
|
+
// (11:4) {#each floorplanData.floorDatas[floorIndex].rooms as room (room.id)}
|
|
40
40
|
function create_each_block(key_1, ctx) {
|
|
41
41
|
let first;
|
|
42
42
|
let room;
|
|
@@ -44,8 +44,9 @@ function create_each_block(key_1, ctx) {
|
|
|
44
44
|
|
|
45
45
|
const room_spread_levels = [
|
|
46
46
|
{
|
|
47
|
-
room: /*room*/ ctx[
|
|
48
|
-
floorplanData: /*floorplanData*/ ctx[1]
|
|
47
|
+
room: /*room*/ ctx[5],
|
|
48
|
+
floorplanData: /*floorplanData*/ ctx[1],
|
|
49
|
+
hoveredRoom: /*hoveredRoom*/ ctx[2]
|
|
49
50
|
}
|
|
50
51
|
];
|
|
51
52
|
|
|
@@ -73,11 +74,12 @@ function create_each_block(key_1, ctx) {
|
|
|
73
74
|
p(new_ctx, dirty) {
|
|
74
75
|
ctx = new_ctx;
|
|
75
76
|
|
|
76
|
-
const room_changes = (dirty & /*floorplanData, floorIndex*/
|
|
77
|
+
const room_changes = (dirty & /*floorplanData, floorIndex, hoveredRoom*/ 7)
|
|
77
78
|
? get_spread_update(room_spread_levels, [
|
|
78
79
|
{
|
|
79
|
-
room: /*room*/ ctx[
|
|
80
|
-
floorplanData: /*floorplanData*/ ctx[1]
|
|
80
|
+
room: /*room*/ ctx[5],
|
|
81
|
+
floorplanData: /*floorplanData*/ ctx[1],
|
|
82
|
+
hoveredRoom: /*hoveredRoom*/ ctx[2]
|
|
81
83
|
}
|
|
82
84
|
])
|
|
83
85
|
: {};
|
|
@@ -108,7 +110,7 @@ function create_fragment(ctx) {
|
|
|
108
110
|
let svg_viewBox_value;
|
|
109
111
|
let current;
|
|
110
112
|
let each_value = /*floorplanData*/ ctx[1].floorDatas[/*floorIndex*/ ctx[0]].rooms;
|
|
111
|
-
const get_key = ctx => /*room*/ ctx[
|
|
113
|
+
const get_key = ctx => /*room*/ ctx[5].id;
|
|
112
114
|
|
|
113
115
|
for (let i = 0; i < each_value.length; i += 1) {
|
|
114
116
|
let child_ctx = get_each_context(ctx, each_value, i);
|
|
@@ -127,7 +129,7 @@ function create_fragment(ctx) {
|
|
|
127
129
|
|
|
128
130
|
attr(svg, "width", "100%");
|
|
129
131
|
attr(svg, "height", "100%");
|
|
130
|
-
attr(svg, "viewBox", svg_viewBox_value = `0 0 ${/*boundingWidth*/ ctx[
|
|
132
|
+
attr(svg, "viewBox", svg_viewBox_value = `0 0 ${/*boundingWidth*/ ctx[3]} ${/*boundingHeight*/ ctx[4]}`);
|
|
131
133
|
attr(svg, "class", "svelte-1tk06jk");
|
|
132
134
|
attr(div, "class", "floorplan-plugin__room-highlight svelte-1tk06jk");
|
|
133
135
|
},
|
|
@@ -142,7 +144,7 @@ function create_fragment(ctx) {
|
|
|
142
144
|
current = true;
|
|
143
145
|
},
|
|
144
146
|
p(ctx, [dirty]) {
|
|
145
|
-
if (dirty & /*floorplanData, floorIndex*/
|
|
147
|
+
if (dirty & /*floorplanData, floorIndex, hoveredRoom*/ 7) {
|
|
146
148
|
each_value = /*floorplanData*/ ctx[1].floorDatas[/*floorIndex*/ ctx[0]].rooms;
|
|
147
149
|
group_outros();
|
|
148
150
|
each_blocks = update_keyed_each(each_blocks, dirty, get_key, 1, ctx, each_value, each_1_lookup, svg, outro_and_destroy_block, create_each_block, null, get_each_context);
|
|
@@ -178,21 +180,36 @@ function create_fragment(ctx) {
|
|
|
178
180
|
function instance($$self, $$props, $$invalidate) {
|
|
179
181
|
let { floorIndex } = $$props;
|
|
180
182
|
let { floorplanData } = $$props;
|
|
183
|
+
let { hoveredRoom } = $$props;
|
|
181
184
|
const boundingWidth = floorplanData.bounding.max.x - floorplanData.bounding.min.x;
|
|
182
185
|
const boundingHeight = floorplanData.bounding.max.y - floorplanData.bounding.min.y;
|
|
183
186
|
|
|
184
187
|
$$self.$$set = $$props => {
|
|
185
188
|
if ('floorIndex' in $$props) $$invalidate(0, floorIndex = $$props.floorIndex);
|
|
186
189
|
if ('floorplanData' in $$props) $$invalidate(1, floorplanData = $$props.floorplanData);
|
|
190
|
+
if ('hoveredRoom' in $$props) $$invalidate(2, hoveredRoom = $$props.hoveredRoom);
|
|
187
191
|
};
|
|
188
192
|
|
|
189
|
-
return [floorIndex, floorplanData, boundingWidth, boundingHeight];
|
|
193
|
+
return [floorIndex, floorplanData, hoveredRoom, boundingWidth, boundingHeight];
|
|
190
194
|
}
|
|
191
195
|
|
|
192
196
|
class Component extends SvelteComponent {
|
|
193
197
|
constructor(options) {
|
|
194
198
|
super();
|
|
195
|
-
|
|
199
|
+
|
|
200
|
+
init(
|
|
201
|
+
this,
|
|
202
|
+
options,
|
|
203
|
+
instance,
|
|
204
|
+
create_fragment,
|
|
205
|
+
safe_not_equal,
|
|
206
|
+
{
|
|
207
|
+
floorIndex: 0,
|
|
208
|
+
floorplanData: 1,
|
|
209
|
+
hoveredRoom: 2
|
|
210
|
+
},
|
|
211
|
+
add_css
|
|
212
|
+
);
|
|
196
213
|
}
|
|
197
214
|
}
|
|
198
215
|
|
|
@@ -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
|
},
|