architwin 1.15.6 → 1.16.1

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.
@@ -270,6 +270,8 @@ i18n
270
270
  "SuccessWindowDelete": "Succesfully deleted window",
271
271
  "EnterFloorMaterial": "Enter floor material",
272
272
  "EnterWallMaterial": "Enter wall material",
273
+ "ShowAll": "Show All",
274
+ "HideAll": "Hide All",
273
275
  "PressEscCancelRelocation": "Press Esc key to cancel relocation.",
274
276
  "MoveTagCancelled": "Move Tag Cancelled",
275
277
  "Window": "Window",
@@ -539,6 +541,8 @@ i18n
539
541
  "SuccessWindowDelete": "建具の削除が完了しました",
540
542
  "EnterFloorMaterial": "仕上げ(床)を入力",
541
543
  "EnterWallMaterial": "仕上げ(壁)を入力",
544
+ "ShowAll": "全て表示",
545
+ "HideAll": "全て非表示",
542
546
  "MoveTagCancelled": "タグの移動がキャンセルされました",
543
547
  "PressEscCancelRelocation": "再配置をキャンセルするには、Esc キーを押します。",
544
548
  "Window": "建具",
@@ -1,7 +1,5 @@
1
- import { FORM_MODE, PartitionNode, PolygonData, WallPolyData, IObjectData, WindowPolyData } from "../../../../types";
1
+ import { FORM_MODE, PartitionNode, PolygonData, WallPolyData, IObjectData } from "../../../../types";
2
2
  export declare let isEditWindow: boolean;
3
- export declare let currentEditWindowIndex: number;
4
- export declare let currentWindow: WindowPolyData;
5
3
  export declare function renderRoomFormPane(): HTMLDivElement;
6
4
  /**
7
5
  * Toggles the state of the partition drawing functionality.
@@ -105,7 +103,7 @@ export declare function getCurrentPolygonData(): PolygonData;
105
103
  * Sets the partition data, including updating the floor level and generating a new
106
104
  * partition with its corresponding UUID, space UUID, and polygon data.
107
105
  */
108
- export declare function setCurrentPartitionData(): Promise<void>;
106
+ export declare function setCurrentPartitionData(payload: PolygonData | undefined): Promise<void>;
109
107
  export declare function removeWindow(index?: number): void;
110
108
  export declare function toggleUndoRedoButtons(undo: boolean, redo: boolean): void;
111
109
  export declare function getCurrentPartitionData(): PartitionNode;
@@ -41,10 +41,10 @@ let inputFloorMaterial;
41
41
  let floorMaterial = '';
42
42
  let inputWallMaterial;
43
43
  let wallMaterial = '';
44
- export let isEditWindow = false;
45
- export let currentEditWindowIndex = null;
46
- export let currentWindow = null;
44
+ let currentEditWindowIndex = null;
45
+ let currentWindowIndex = null;
47
46
  let tempCurrentEditRoom = null;
47
+ export let isEditWindow = false;
48
48
  export function renderRoomFormPane() {
49
49
  log.info("__@ renderRoomFormPane: ", roomFormMode);
50
50
  const element = document.createElement('div');
@@ -228,10 +228,11 @@ export function toggleDrawPartitionButton() {
228
228
  isEditPartition = false;
229
229
  previousPartitionData = null;
230
230
  }
231
- // toggleUndoRedoButtons(false, false)
231
+ partitionHistory.clearHistory();
232
+ toggleUndoRedoButtons(false, false);
232
233
  }
233
234
  export function toggleDrawWindowButton() {
234
- var _a, _b;
235
+ var _a, _b, _c;
235
236
  log.info("toggleDrawWindowButton()", getCurrentPolygon(), _3DXObjects);
236
237
  setCurrentPolygon(undefined);
237
238
  const addDoorButton = document.getElementById('at-add-window-door-btn');
@@ -246,6 +247,7 @@ export function toggleDrawWindowButton() {
246
247
  ${i18n.t('DoneDrawing')}
247
248
  <span class="mdi mdi-check-bold"></span>
248
249
  `;
250
+ currentWindowIndex = (_a = currentWall.windows) === null || _a === void 0 ? void 0 : _a.length;
249
251
  }
250
252
  const objectIndex = _3DXObjects.findIndex(obj => obj.object.id == currentObject.object.id);
251
253
  log.info("objectIndex", objectIndex);
@@ -253,7 +255,7 @@ export function toggleDrawWindowButton() {
253
255
  lineTypeComponentConfig: {
254
256
  renderPolygonOnAdd: false,
255
257
  drawingMode: drawingMode,
256
- targetIndex: (_b = currentEditWindowIndex !== null && currentEditWindowIndex !== void 0 ? currentEditWindowIndex : (_a = currentWall.windows) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 0,
258
+ targetIndex: (_c = currentEditWindowIndex !== null && currentEditWindowIndex !== void 0 ? currentEditWindowIndex : (_b = currentWall.windows) === null || _b === void 0 ? void 0 : _b.length) !== null && _c !== void 0 ? _c : 0,
257
259
  polygonData: currentPolygonData,
258
260
  targetUUID: currentWall.uuid,
259
261
  objectIndex: objectIndex
@@ -266,6 +268,7 @@ export function toggleDrawWindowButton() {
266
268
  else {
267
269
  isDrawing = false;
268
270
  drawingMode = null;
271
+ currentWindowIndex = null;
269
272
  currentPartitionData.polygon_json = JSON.stringify(currentPolygonData);
270
273
  addDoorButton.classList.remove('at_add_window_door_btn_active');
271
274
  addDoorButton.classList.add('at_add_window_door_btn');
@@ -290,16 +293,17 @@ export function toggleDrawWindowButton() {
290
293
  log.info("objectIndex", objectIndex);
291
294
  if (_3DXObjects[objectIndex].children) {
292
295
  _3DXObjects[objectIndex].children.map((win) => __awaiter(this, void 0, void 0, function* () {
293
- var _c;
296
+ var _d;
294
297
  log.info("WIND", win);
295
- if (win.index == ((_c = currentWall.windows) === null || _c === void 0 ? void 0 : _c.length) - 1 && win.wallUUID == currentWall.uuid) {
298
+ if (win.index == ((_d = currentWall.windows) === null || _d === void 0 ? void 0 : _d.length) - 1 && win.wallUUID == currentWall.uuid) {
296
299
  yield disposeModel(win);
297
300
  }
298
301
  }));
299
302
  }
300
303
  }
301
304
  }
302
- // toggleUndoRedoButtons(false, false)
305
+ partitionHistory.clearHistory();
306
+ toggleUndoRedoButtons(false, false);
303
307
  }
304
308
  /**
305
309
  * Displays the partition form based on the current form mode.
@@ -919,7 +923,6 @@ function setupEditWindow(element, window) {
919
923
  const confirmBtn = element.querySelector(`#at-confirm-edit-window-${window.index}`);
920
924
  if (!editBtn || !editNameContainer || !inputName || !nameLabel || !editMaterialContainer || !inputMaterial)
921
925
  return;
922
- currentWindow = window;
923
926
  // Show inputs when edit icon is clicked
924
927
  editBtn.addEventListener("click", () => {
925
928
  if (isDrawing) {
@@ -956,17 +959,7 @@ function setupEditWindow(element, window) {
956
959
  };
957
960
  enableVerticeControls(windowComponent);
958
961
  isDrawing = true;
959
- let data;
960
- if (currentPartitionData) {
961
- data = {
962
- polygon: {
963
- uuid: currentPartitionData.uuid,
964
- polygon_json: currentPolygonData
965
- },
966
- verticePath: window.path,
967
- };
968
- }
969
- // partitionHistory.setCurrent(data)
962
+ // partitionHistory.setCurrent(window.path)
970
963
  });
971
964
  // // Confirm edit name and material
972
965
  confirmBtn.addEventListener("click", () => {
@@ -977,7 +970,7 @@ function setupEditWindow(element, window) {
977
970
  nameLabel.textContent = window.name;
978
971
  editNameContainer.style.display = "none";
979
972
  const newMaterial = inputMaterial.value.trim();
980
- window.material = newMaterial || window.material;
973
+ window.material = newMaterial;
981
974
  editMaterialContainer.style.display = "none";
982
975
  editBtn.style.display = "flex";
983
976
  confirmBtn.style.display = "none";
@@ -1001,7 +994,7 @@ function setupEditWindow(element, window) {
1001
994
  isDrawing = false;
1002
995
  isEditWindow = false;
1003
996
  partitionHistory.clearHistory();
1004
- // toggleUndoRedoButtons(false, false)
997
+ toggleUndoRedoButtons(false, false);
1005
998
  });
1006
999
  }
1007
1000
  function saveWallChanges() {
@@ -1457,38 +1450,42 @@ export function clearTempCurrentPolygon() {
1457
1450
  */
1458
1451
  export function setPolygonData(payload) {
1459
1452
  console.log('setPolygonData()', payload);
1460
- // Helper function to round numbers to 2 decimals
1461
- function roundToFourDecimals(value) {
1462
- if (typeof value === "number") {
1463
- return Math.round(value * 10000) / 10000; // Round to 4 decimals
1453
+ if (payload != undefined) {
1454
+ // Helper function to round numbers to 2 decimals
1455
+ function roundToFourDecimals(value) {
1456
+ if (typeof value === "number") {
1457
+ return Math.round(value * 10000) / 10000; // Round to 4 decimals
1458
+ }
1459
+ else if (Array.isArray(value)) {
1460
+ return value.map(roundToFourDecimals); // Recursively round each item in the array
1461
+ }
1462
+ else if (typeof value === "object" && value !== null) {
1463
+ return Object.keys(value).reduce((acc, key) => {
1464
+ acc[key] = roundToFourDecimals(value[key]); // Recursively process each object property
1465
+ return acc;
1466
+ }, {});
1467
+ }
1468
+ return value;
1464
1469
  }
1465
- else if (Array.isArray(value)) {
1466
- return value.map(roundToFourDecimals); // Recursively round each item in the array
1470
+ // Round numbers in the polygon JSON recursively
1471
+ if (payload) {
1472
+ payload = roundToFourDecimals(payload);
1467
1473
  }
1468
- else if (typeof value === "object" && value !== null) {
1469
- return Object.keys(value).reduce((acc, key) => {
1470
- acc[key] = roundToFourDecimals(value[key]); // Recursively process each object property
1471
- return acc;
1472
- }, {});
1474
+ // Set floor UUID and name
1475
+ if (payload.floor) {
1476
+ payload.floor.uuid = payload.floor.uuid || generateUUID();
1477
+ payload.floor.name = `floor`;
1473
1478
  }
1474
- return value;
1475
- }
1476
- // Round numbers in the polygon JSON recursively
1477
- if (payload) {
1478
- payload = roundToFourDecimals(payload);
1479
- }
1480
- // Set floor UUID and name
1481
- if (payload.floor) {
1482
- payload.floor.uuid = payload.floor.uuid || generateUUID();
1483
- payload.floor.name = `floor`;
1479
+ // Iterate over walls to set UUID and names
1480
+ if (payload.walls && payload.walls.length > 0) {
1481
+ payload.walls = payload.walls.map((wall, index) => (Object.assign(Object.assign({}, roundToFourDecimals(wall)), { name: `wall-${index}`, uuid: wall.uuid || generateUUID() })));
1482
+ }
1483
+ currentPolygonData = payload;
1484
+ setCurrentPartitionData(payload);
1484
1485
  }
1485
- // Iterate over walls to set UUID and names
1486
- if (payload.walls && payload.walls.length > 0) {
1487
- payload.walls = payload.walls.map((wall, index) => (Object.assign(Object.assign({}, roundToFourDecimals(wall)), { name: `wall-${index}`, uuid: wall.uuid || generateUUID() })));
1486
+ else {
1487
+ setCurrentPartitionData(undefined);
1488
1488
  }
1489
- currentPolygonData = payload;
1490
- console.log("setPolygonData() currentPolygonData:", currentPolygonData);
1491
- setCurrentPartitionData();
1492
1489
  }
1493
1490
  /**
1494
1491
  * Returns current polygon data
@@ -1501,10 +1498,10 @@ export function getCurrentPolygonData() {
1501
1498
  * Sets the partition data, including updating the floor level and generating a new
1502
1499
  * partition with its corresponding UUID, space UUID, and polygon data.
1503
1500
  */
1504
- export function setCurrentPartitionData() {
1501
+ export function setCurrentPartitionData(payload) {
1505
1502
  var _a;
1506
1503
  return __awaiter(this, void 0, void 0, function* () {
1507
- console.log('setCurrentPartitionData()');
1504
+ console.log('setCurrentPartitionData()', payload);
1508
1505
  const floorLevel = ((_a = document.getElementById('at-room-floor-level-input')) === null || _a === void 0 ? void 0 : _a.value) || null;
1509
1506
  const currentUrl = window.location.href;
1510
1507
  const spaceUUID = extractUUID(currentUrl);
@@ -1519,7 +1516,9 @@ export function setCurrentPartitionData() {
1519
1516
  resolve();
1520
1517
  }
1521
1518
  if (currentObjectData == undefined) {
1522
- currentPolygonData = null;
1519
+ if (drawingMode === 'partition') {
1520
+ currentPolygonData = null;
1521
+ }
1523
1522
  clearInterval(interval);
1524
1523
  resolve();
1525
1524
  }
@@ -1530,7 +1529,7 @@ export function setCurrentPartitionData() {
1530
1529
  }
1531
1530
  }, 50); // Check every 50ms
1532
1531
  });
1533
- if (currentPolygonData) {
1532
+ if (payload) {
1534
1533
  let polygonData = currentPolygonData;
1535
1534
  polygonData.floor.floor_level = Number(floorLevel); // Set the floor level from the input
1536
1535
  // Create a new partition data payload
@@ -1546,13 +1545,11 @@ export function setCurrentPartitionData() {
1546
1545
  }
1547
1546
  if (isEditPartition) {
1548
1547
  newPayload.name = currentPartitionData.name;
1549
- console.log("newPayload.name", newPayload.name);
1550
1548
  }
1551
1549
  if (currentHighlightedFace) {
1552
1550
  setMeshChildrenMaterialProperty(currentHighlightedFace.component, currentHighlightedFace.name, currentHighlightedFace.type, currentHighlightedFace.value);
1553
1551
  }
1554
1552
  updatePartitionDataArray(newPayload, currentPartitionDataArray);
1555
- log.info("if currentPartitionDataArray", currentPartitionDataArray);
1556
1553
  if (drawingMode === 'partition') {
1557
1554
  displayFaces(currentPolygonData);
1558
1555
  }
@@ -1569,13 +1566,19 @@ export function setCurrentPartitionData() {
1569
1566
  else {
1570
1567
  const faceVertexContainer = document.getElementById('at-face-vertex-container');
1571
1568
  faceVertexContainer.innerHTML = '';
1572
- if (currentPartitionData) {
1573
- const target = _3DXObjects.find(obj => obj.object.object_data.uuid === currentPartitionData.uuid);
1574
- disposeModel(target);
1575
- currentPartitionDataArray = currentPartitionDataArray.filter(partition => partition.uuid != currentPartitionData.uuid);
1576
- dispatchSpaceEvent(SPACE_EVENTS.PARTITION_DISPOSED, currentPartitionData);
1577
- currentPartitionData = null;
1578
- log.info("else currentPartitionDataArray", currentPartitionDataArray);
1569
+ if (drawingMode === 'partition') {
1570
+ if (currentPartitionData) {
1571
+ currentPartitionDataArray = currentPartitionDataArray.filter(partition => partition.uuid != currentPartitionData.uuid);
1572
+ dispatchSpaceEvent(SPACE_EVENTS.PARTITION_DISPOSED, currentPartitionData);
1573
+ currentPartitionData = null;
1574
+ log.info("else currentPartitionDataArray", currentPartitionDataArray);
1575
+ }
1576
+ }
1577
+ else if (drawingMode === 'window') {
1578
+ if (currentWall === null || currentWall === void 0 ? void 0 : currentWall.windows) {
1579
+ currentWall.windows.splice(currentWindowIndex, 1);
1580
+ faceVertexContainer.append(displayWall(currentWall));
1581
+ }
1579
1582
  }
1580
1583
  }
1581
1584
  });
@@ -1,5 +1,6 @@
1
1
  import { ITag, ITagCategory, SortConfig, TAG_TYPE } from "../../../types";
2
2
  import { MpSdk } from "../../../../bundle/sdk";
3
+ export declare const tagVisibility: Record<TAG_TYPE, Record<string, boolean>>;
3
4
  export declare let selectedCategoryFilterId: any;
4
5
  export declare let selectedSubCategoryFilterId: any;
5
6
  export declare let isTagPaneActive: boolean;
@@ -26,3 +27,7 @@ export declare function setCurrentTagPaneMode(value: TAG_TYPE | null): void;
26
27
  export declare const sortTags: (items: ITag[], options: SortConfig) => ITag[];
27
28
  export declare function updateSelectedTagSortOption(sortOption: string): void;
28
29
  export declare function resetSelectedTagSortOption(): void;
30
+ export declare function saveTagVisibilityToStorage(tagVisibility: Record<TAG_TYPE, Record<string, boolean>>): void;
31
+ export declare function initializeTagVisibility(): void;
32
+ export declare function updateShowAllButton(): void;
33
+ export declare function clearTagVisibilityStorage(): void;