@sequent-org/ifc-viewer 1.2.4-ci.57.0 → 1.2.4-ci.59.0
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/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sequent-org/ifc-viewer",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "1.2.4-ci.
|
|
4
|
+
"version": "1.2.4-ci.59.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"description": "IFC 3D model viewer component for web applications - fully self-contained with local IFCLoader",
|
|
7
7
|
"main": "src/index.js",
|
|
@@ -53,6 +53,8 @@ export class LabelPlacementController {
|
|
|
53
53
|
this._labelDrag = {
|
|
54
54
|
active: false,
|
|
55
55
|
moved: false,
|
|
56
|
+
// true => призрак живёт в document.body и позиционируется по viewport
|
|
57
|
+
ghostInBody: false,
|
|
56
58
|
pointerId: null,
|
|
57
59
|
id: null,
|
|
58
60
|
start: { x: 0, y: 0 },
|
|
@@ -182,9 +184,7 @@ export class LabelPlacementController {
|
|
|
182
184
|
}
|
|
183
185
|
|
|
184
186
|
#log(event, payload) {
|
|
185
|
-
|
|
186
|
-
this.logger?.log?.("[LabelPlacement]", event, payload);
|
|
187
|
-
} catch (_) {}
|
|
187
|
+
// no-op: debug logging disabled
|
|
188
188
|
}
|
|
189
189
|
|
|
190
190
|
#dispatchLabelEvent(name, detail, legacyName = null) {
|
|
@@ -617,6 +617,8 @@ export class LabelPlacementController {
|
|
|
617
617
|
const dragGhost = document.createElement("div");
|
|
618
618
|
dragGhost.className = "ifc-label-ghost ifc-label-ghost--drag";
|
|
619
619
|
dragGhost.setAttribute("aria-hidden", "true");
|
|
620
|
+
// Фиксируем позицию, чтобы призрак не обрезался контейнером viewer
|
|
621
|
+
dragGhost.style.position = "fixed";
|
|
620
622
|
dragGhost.style.display = "none";
|
|
621
623
|
dragGhost.style.left = "0px";
|
|
622
624
|
dragGhost.style.top = "0px";
|
|
@@ -675,7 +677,14 @@ export class LabelPlacementController {
|
|
|
675
677
|
// Важно: container должен быть position:relative (в index.html уже так).
|
|
676
678
|
this.container.appendChild(this._ui.btn);
|
|
677
679
|
this.container.appendChild(this._ui.ghost);
|
|
678
|
-
|
|
680
|
+
// Призрак перетаскивания добавляем в body, чтобы не обрезался overflow контейнера
|
|
681
|
+
if (document?.body) {
|
|
682
|
+
document.body.appendChild(this._ui.dragGhost);
|
|
683
|
+
this._labelDrag.ghostInBody = true;
|
|
684
|
+
} else {
|
|
685
|
+
this.container.appendChild(this._ui.dragGhost);
|
|
686
|
+
this._labelDrag.ghostInBody = false;
|
|
687
|
+
}
|
|
679
688
|
this.container.appendChild(this._ui.menu);
|
|
680
689
|
this.container.appendChild(this._ui.canvasMenu);
|
|
681
690
|
}
|
|
@@ -797,21 +806,7 @@ export class LabelPlacementController {
|
|
|
797
806
|
? target.closest(".ifc-label-marker")
|
|
798
807
|
: null;
|
|
799
808
|
if (!closestMarker) return;
|
|
800
|
-
|
|
801
|
-
type: e?.type,
|
|
802
|
-
target,
|
|
803
|
-
closestMarker,
|
|
804
|
-
button: e?.button,
|
|
805
|
-
buttons: e?.buttons,
|
|
806
|
-
clientX: e?.clientX,
|
|
807
|
-
clientY: e?.clientY,
|
|
808
|
-
defaultPrevented: !!e?.defaultPrevented,
|
|
809
|
-
};
|
|
810
|
-
try {
|
|
811
|
-
this.logger?.log?.("[LabelDnD]", scope, payload);
|
|
812
|
-
} catch (_) {
|
|
813
|
-
try { console.log("[LabelDnD]", scope, payload); } catch (_) {}
|
|
814
|
-
}
|
|
809
|
+
// debug logging disabled
|
|
815
810
|
};
|
|
816
811
|
|
|
817
812
|
this._onDbgDocPointerDown = (e) => logDnDEvent("document", e);
|
|
@@ -958,9 +953,13 @@ export class LabelPlacementController {
|
|
|
958
953
|
|
|
959
954
|
#updateDragGhostFromClient(clientX, clientY) {
|
|
960
955
|
this._labelDrag.last = { x: clientX, y: clientY };
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
956
|
+
let x = clientX;
|
|
957
|
+
let y = clientY;
|
|
958
|
+
if (!this._labelDrag.ghostInBody) {
|
|
959
|
+
if (!this._containerOffsetValid) this.#refreshContainerOffset();
|
|
960
|
+
x = (clientX - this._containerOffset.left);
|
|
961
|
+
y = (clientY - this._containerOffset.top);
|
|
962
|
+
}
|
|
964
963
|
this._labelDrag.ghostPos.x = x;
|
|
965
964
|
this._labelDrag.ghostPos.y = y;
|
|
966
965
|
this.#applyDragGhostTransform();
|
|
@@ -1024,6 +1023,11 @@ export class LabelPlacementController {
|
|
|
1024
1023
|
const moved = !!this._labelDrag.moved;
|
|
1025
1024
|
const clientX = e?.clientX ?? this._labelDrag.last.x;
|
|
1026
1025
|
const clientY = e?.clientY ?? this._labelDrag.last.y;
|
|
1026
|
+
this.logger?.log?.("[LabelClickDbg]", {
|
|
1027
|
+
phase: "finish",
|
|
1028
|
+
moved: !!moved,
|
|
1029
|
+
id: marker?.id ?? this._labelDrag.id,
|
|
1030
|
+
});
|
|
1027
1031
|
|
|
1028
1032
|
this._labelDrag.active = false;
|
|
1029
1033
|
this._labelDrag.moved = false;
|
|
@@ -1279,22 +1283,18 @@ export class LabelPlacementController {
|
|
|
1279
1283
|
this._markers.push(marker);
|
|
1280
1284
|
|
|
1281
1285
|
const onMarkerPointerDown = (e) => {
|
|
1286
|
+
this.logger?.log?.("[LabelClickDbg]", {
|
|
1287
|
+
phase: "down",
|
|
1288
|
+
button: e?.button,
|
|
1289
|
+
buttons: e?.buttons,
|
|
1290
|
+
clientX: e?.clientX,
|
|
1291
|
+
clientY: e?.clientY,
|
|
1292
|
+
pointerId: e?.pointerId,
|
|
1293
|
+
});
|
|
1282
1294
|
// Важно: не даём клику попасть в canvas/OrbitControls
|
|
1283
1295
|
try { e.preventDefault(); } catch (_) {}
|
|
1284
1296
|
try { e.stopPropagation(); } catch (_) {}
|
|
1285
1297
|
try { e.stopImmediatePropagation?.(); } catch (_) {}
|
|
1286
|
-
try {
|
|
1287
|
-
this.logger?.log?.("[LabelDnD]", "marker", {
|
|
1288
|
-
type: e?.type,
|
|
1289
|
-
target: e?.target || null,
|
|
1290
|
-
closestMarker: e?.target?.closest?.(".ifc-label-marker") || null,
|
|
1291
|
-
button: e?.button,
|
|
1292
|
-
buttons: e?.buttons,
|
|
1293
|
-
clientX: e?.clientX,
|
|
1294
|
-
clientY: e?.clientY,
|
|
1295
|
-
defaultPrevented: !!e?.defaultPrevented,
|
|
1296
|
-
});
|
|
1297
|
-
} catch (_) {}
|
|
1298
1298
|
// если были в режиме постановки — выходим
|
|
1299
1299
|
try { this.cancelPlacement(); } catch (_) {}
|
|
1300
1300
|
|
|
@@ -1309,49 +1309,21 @@ export class LabelPlacementController {
|
|
|
1309
1309
|
try { marker.el.addEventListener("pointerdown", onMarkerPointerDown); } catch (_) {}
|
|
1310
1310
|
}
|
|
1311
1311
|
const onMarkerPointerUp = (e) => {
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
clientY: e?.clientY,
|
|
1321
|
-
defaultPrevented: !!e?.defaultPrevented,
|
|
1322
|
-
});
|
|
1323
|
-
} catch (_) {}
|
|
1312
|
+
this.logger?.log?.("[LabelClickDbg]", {
|
|
1313
|
+
phase: "up",
|
|
1314
|
+
button: e?.button,
|
|
1315
|
+
buttons: e?.buttons,
|
|
1316
|
+
clientX: e?.clientX,
|
|
1317
|
+
clientY: e?.clientY,
|
|
1318
|
+
pointerId: e?.pointerId,
|
|
1319
|
+
});
|
|
1324
1320
|
};
|
|
1325
1321
|
try { marker.el.addEventListener("pointerup", onMarkerPointerUp, { capture: true, passive: true }); } catch (_) {
|
|
1326
1322
|
try { marker.el.addEventListener("pointerup", onMarkerPointerUp); } catch (_) {}
|
|
1327
1323
|
}
|
|
1328
1324
|
const onMarkerDragStart = (e) => {
|
|
1329
|
-
try {
|
|
1330
|
-
this.logger?.log?.("[LabelDnD]", "marker", {
|
|
1331
|
-
type: e?.type,
|
|
1332
|
-
target: e?.target || null,
|
|
1333
|
-
closestMarker: e?.target?.closest?.(".ifc-label-marker") || null,
|
|
1334
|
-
button: e?.button,
|
|
1335
|
-
buttons: e?.buttons,
|
|
1336
|
-
clientX: e?.clientX,
|
|
1337
|
-
clientY: e?.clientY,
|
|
1338
|
-
defaultPrevented: !!e?.defaultPrevented,
|
|
1339
|
-
});
|
|
1340
|
-
} catch (_) {}
|
|
1341
1325
|
};
|
|
1342
1326
|
const onMarkerDragEnd = (e) => {
|
|
1343
|
-
try {
|
|
1344
|
-
this.logger?.log?.("[LabelDnD]", "marker", {
|
|
1345
|
-
type: e?.type,
|
|
1346
|
-
target: e?.target || null,
|
|
1347
|
-
closestMarker: e?.target?.closest?.(".ifc-label-marker") || null,
|
|
1348
|
-
button: e?.button,
|
|
1349
|
-
buttons: e?.buttons,
|
|
1350
|
-
clientX: e?.clientX,
|
|
1351
|
-
clientY: e?.clientY,
|
|
1352
|
-
defaultPrevented: !!e?.defaultPrevented,
|
|
1353
|
-
});
|
|
1354
|
-
} catch (_) {}
|
|
1355
1327
|
};
|
|
1356
1328
|
try { marker.el.addEventListener("dragstart", onMarkerDragStart); } catch (_) {}
|
|
1357
1329
|
try { marker.el.addEventListener("dragend", onMarkerDragEnd); } catch (_) {}
|
|
@@ -1414,7 +1386,6 @@ export class LabelPlacementController {
|
|
|
1414
1386
|
* @deprecated используйте setLabelMarkers
|
|
1415
1387
|
*/
|
|
1416
1388
|
setCardMarkers(items) {
|
|
1417
|
-
try { this.logger?.warn?.("[LabelPlacement] setCardMarkers is deprecated, use setLabelMarkers"); } catch (_) {}
|
|
1418
1389
|
this.setLabelMarkers(items);
|
|
1419
1390
|
}
|
|
1420
1391
|
|
|
@@ -1422,7 +1393,6 @@ export class LabelPlacementController {
|
|
|
1422
1393
|
* @deprecated используйте getLabelMarkers
|
|
1423
1394
|
*/
|
|
1424
1395
|
getCardMarkers() {
|
|
1425
|
-
try { this.logger?.warn?.("[LabelPlacement] getCardMarkers is deprecated, use getLabelMarkers"); } catch (_) {}
|
|
1426
1396
|
return this.getLabelMarkers();
|
|
1427
1397
|
}
|
|
1428
1398
|
|