architwin 1.9.2 → 1.9.4
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/lib/architwin.d.ts +13 -1
- package/lib/architwin.js +176 -94
- package/lib/atwinui/components/toolbar/i18n.js +2 -0
- package/lib/atwinui/components/toolbar/spacePartition/roomFormPane.d.ts +2 -0
- package/lib/atwinui/components/toolbar/spacePartition/roomFormPane.js +26 -11
- package/lib/atwinui/components/toolbar/spacePartition/roomTreePane.d.ts +39 -5
- package/lib/atwinui/components/toolbar/spacePartition/roomTreePane.js +263 -57
- package/lib/atwinui/events.d.ts +11 -2
- package/lib/atwinui/events.js +343 -121
- package/lib/loaders/polydrawerLoader.d.ts +2 -0
- package/lib/loaders/polydrawerLoader.js +29 -5
- package/lib/types.d.ts +13 -3
- package/lib/utils.d.ts +6 -0
- package/lib/utils.js +15 -0
- package/package.json +1 -1
- package/static/atwinui.css +1 -1
- package/static/utility.css +4 -0
|
@@ -458,7 +458,9 @@ export class BufferGeometry {
|
|
|
458
458
|
wallColor: 0xffd150,
|
|
459
459
|
floorOpacity: 0.4,
|
|
460
460
|
wallOpacity: 0.6,
|
|
461
|
-
visible: true
|
|
461
|
+
visible: true,
|
|
462
|
+
wallData: [],
|
|
463
|
+
floorData: undefined
|
|
462
464
|
};
|
|
463
465
|
this.emits = {
|
|
464
466
|
changed: true,
|
|
@@ -510,7 +512,11 @@ export class BufferGeometry {
|
|
|
510
512
|
opacity: this.inputs.floorOpacity,
|
|
511
513
|
transparent: true
|
|
512
514
|
}));
|
|
513
|
-
floorMesh.name = this.inputs.uuid != '' ? `${this.inputs.uuid}
|
|
515
|
+
floorMesh.name = this.inputs.uuid != '' ? `${this.inputs.uuid}_floor` : 'floor';
|
|
516
|
+
const floorConfig = this.inputs.floorData;
|
|
517
|
+
if (floorConfig && floorConfig.options) {
|
|
518
|
+
floorMesh.visible = floorConfig.options.is_visible;
|
|
519
|
+
}
|
|
514
520
|
this.groupedMesh.add(floorMesh);
|
|
515
521
|
const floorArea = getPolygonArea(this.inputs.path);
|
|
516
522
|
let [floors, walls] = this.renderWalls(WALL_HEIGHT);
|
|
@@ -520,7 +526,8 @@ export class BufferGeometry {
|
|
|
520
526
|
const floorData = {
|
|
521
527
|
options: {
|
|
522
528
|
color: this.inputs.floorColor,
|
|
523
|
-
opacity: this.inputs.floorOpacity
|
|
529
|
+
opacity: this.inputs.floorOpacity,
|
|
530
|
+
is_visible: floorMesh.visible
|
|
524
531
|
},
|
|
525
532
|
area: floorArea,
|
|
526
533
|
floor_level: this.inputs.path[0].y,
|
|
@@ -534,7 +541,10 @@ export class BufferGeometry {
|
|
|
534
541
|
floor_offset: currentOffsetValue,
|
|
535
542
|
floor_sequence: currentFloor,
|
|
536
543
|
floor: floorData,
|
|
537
|
-
walls: wallDataArray
|
|
544
|
+
walls: wallDataArray,
|
|
545
|
+
options: {
|
|
546
|
+
is_visible: this.inputs.visible
|
|
547
|
+
}
|
|
538
548
|
};
|
|
539
549
|
dispatchSpaceEvent(SPACE_EVENTS.PARTITION_UPDATED, partitionData);
|
|
540
550
|
console.log("Polygon mesh ", this.groupedMesh);
|
|
@@ -657,6 +667,18 @@ export class BufferGeometry {
|
|
|
657
667
|
floorLabelMesh.position.set((startPoint.x + endPoint.x) / 2, midPoint.y + 0.1, (startPoint.z + endPoint.z) / 2);
|
|
658
668
|
floorLabelMesh.rotation.y = -Math.PI / 2;
|
|
659
669
|
//floorLabelMesh.rotation.z = -Math.PI / 2;
|
|
670
|
+
floorLabelMesh.name = this.inputs.uuid != '' ? `${this.inputs.uuid}_edgeLabel-${i}` : `edgeLabel-${i}`;
|
|
671
|
+
if (this.inputs.wallData && this.inputs.wallData.length > 0) {
|
|
672
|
+
const wallData = this.inputs.wallData.find((w) => w.index == i);
|
|
673
|
+
if (wallData && wallData.options) {
|
|
674
|
+
wallMesh.visible = wallData.options.is_visible;
|
|
675
|
+
wallLabelMesh.visible = wallData.options.is_visible;
|
|
676
|
+
}
|
|
677
|
+
}
|
|
678
|
+
const floorConfig = this.inputs.floorData;
|
|
679
|
+
if (floorConfig && floorConfig.options) {
|
|
680
|
+
floorLabelMesh.visible = floorConfig.options.is_visible;
|
|
681
|
+
}
|
|
660
682
|
this.wallLabels.push(wallLabelMesh);
|
|
661
683
|
this.floorLabels.push(floorLabelMesh);
|
|
662
684
|
this.groupedMesh.add(wallMesh);
|
|
@@ -679,8 +701,10 @@ export class BufferGeometry {
|
|
|
679
701
|
const wallData = {
|
|
680
702
|
options: {
|
|
681
703
|
color: this.inputs.wallColor,
|
|
682
|
-
opacity: this.inputs.wallOpacity
|
|
704
|
+
opacity: this.inputs.wallOpacity,
|
|
705
|
+
is_visible: wallMesh.visible
|
|
683
706
|
},
|
|
707
|
+
index: i,
|
|
684
708
|
area: wallArea,
|
|
685
709
|
wall_height: WALL_HEIGHT,
|
|
686
710
|
edges: wallEdges
|
package/lib/types.d.ts
CHANGED
|
@@ -985,6 +985,7 @@ export interface FloorPolyData {
|
|
|
985
985
|
options?: {
|
|
986
986
|
color: number | undefined;
|
|
987
987
|
opacity: number | undefined;
|
|
988
|
+
is_visible?: boolean | undefined;
|
|
988
989
|
};
|
|
989
990
|
area: number | undefined;
|
|
990
991
|
floor_level: number;
|
|
@@ -993,9 +994,11 @@ export interface FloorPolyData {
|
|
|
993
994
|
export interface WallPolyData {
|
|
994
995
|
uuid?: string | undefined;
|
|
995
996
|
name?: string | undefined;
|
|
997
|
+
index?: number | undefined;
|
|
996
998
|
options?: {
|
|
997
|
-
color
|
|
998
|
-
opacity
|
|
999
|
+
color?: number | undefined;
|
|
1000
|
+
opacity?: number | undefined;
|
|
1001
|
+
is_visible?: boolean | undefined;
|
|
999
1002
|
};
|
|
1000
1003
|
area: number;
|
|
1001
1004
|
wall_height: number;
|
|
@@ -1003,11 +1006,18 @@ export interface WallPolyData {
|
|
|
1003
1006
|
}
|
|
1004
1007
|
export interface PolygonData {
|
|
1005
1008
|
path: Array<Vector3>;
|
|
1006
|
-
options
|
|
1009
|
+
options?: {
|
|
1010
|
+
is_visible?: boolean | undefined;
|
|
1011
|
+
};
|
|
1007
1012
|
floor_offset: number;
|
|
1008
1013
|
floor_sequence: MpSdk.Floor.FloorData;
|
|
1009
1014
|
floor: FloorPolyData;
|
|
1010
1015
|
walls: Array<WallPolyData>;
|
|
1016
|
+
is_visible?: boolean;
|
|
1017
|
+
}
|
|
1018
|
+
export interface PolyWallVisibility {
|
|
1019
|
+
index: number;
|
|
1020
|
+
is_visible: boolean;
|
|
1011
1021
|
}
|
|
1012
1022
|
export declare const enum IO_PARTICIPANT_COLORS {
|
|
1013
1023
|
GREEN = "GREEN",
|
package/lib/utils.d.ts
CHANGED
|
@@ -70,3 +70,9 @@ export declare function isEqual(value: any, other: any): boolean;
|
|
|
70
70
|
* @returns The modified string with the replacement word
|
|
71
71
|
*/
|
|
72
72
|
export declare function replaceWordInString(originalString: string, targetWord: string, replacementWord: string, caseInsensitive?: boolean): string;
|
|
73
|
+
/**
|
|
74
|
+
* Checks if an HTML element is visible in the browser viewport.
|
|
75
|
+
* @param element The HTML element to check for visibility
|
|
76
|
+
* @returns
|
|
77
|
+
*/
|
|
78
|
+
export declare function isElementVisible(element: HTMLElement): boolean;
|
package/lib/utils.js
CHANGED
|
@@ -318,3 +318,18 @@ export function replaceWordInString(originalString, targetWord, replacementWord,
|
|
|
318
318
|
const pattern = new RegExp(`\\b${targetWord}\\b`, caseMode);
|
|
319
319
|
return originalString.replace(pattern, replacementWord);
|
|
320
320
|
}
|
|
321
|
+
/**
|
|
322
|
+
* Checks if an HTML element is visible in the browser viewport.
|
|
323
|
+
* @param element The HTML element to check for visibility
|
|
324
|
+
* @returns
|
|
325
|
+
*/
|
|
326
|
+
export function isElementVisible(element) {
|
|
327
|
+
if (!element) {
|
|
328
|
+
return false; // Element is not provided
|
|
329
|
+
}
|
|
330
|
+
const style = window.getComputedStyle(element);
|
|
331
|
+
const isVisible = style.display !== 'none' && style.visibility !== 'hidden' && style.opacity !== '0';
|
|
332
|
+
const rect = element.getBoundingClientRect();
|
|
333
|
+
const isInViewport = rect.top >= 0 && rect.left >= 0 && rect.bottom <= (window.innerHeight || document.documentElement.clientHeight) && rect.right <= (window.innerWidth || document.documentElement.clientWidth);
|
|
334
|
+
return isVisible && isInViewport;
|
|
335
|
+
}
|
package/package.json
CHANGED
package/static/atwinui.css
CHANGED