architwin 1.14.12 → 1.14.14

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.
@@ -223,6 +223,8 @@ i18n
223
223
  "ConfirmLeaveSessionReminder": "",
224
224
  "InSession": "In Session",
225
225
  "Leave": "Leave",
226
+ "You are sharing to this person": "You are sharing {space_name} to this person",
227
+ "Pointer": "Pointer",
226
228
  "WindowsDoors": "Windows and Doors",
227
229
  "AddWindowDoor": "Add Window/Door",
228
230
  "EnterMaterialHere": "Enter window material",
@@ -231,7 +233,9 @@ i18n
231
233
  "ConfirmDeleteWindow": "Are you sure you want to delete this window?",
232
234
  "SuccessWindowDelete": "Succesfully deleted window",
233
235
  "EnterFloorMaterial": "Enter floor material",
234
- "EnterWallMaterial": "Enter wall material"
236
+ "EnterWallMaterial": "Enter wall material",
237
+ "Window": "Window",
238
+ "CannotBackDrawingMode": "Cannot go back while drawing mode is active."
235
239
  }
236
240
  },
237
241
  ja: {
@@ -454,6 +458,8 @@ i18n
454
458
  "ConfirmLeaveSessionReminder": "",
455
459
  "InSession": "共有中",
456
460
  "Leave": "終了",
461
+ "You are sharing to this person": "{space_name} をこの方と共有中です",
462
+ "Pointer": "ポインター",
457
463
  "WindowsDoors": "建具",
458
464
  "AddWindowDoor": "建具を追加",
459
465
  "EnterMaterialHere": "仕上げ(建具)を入力",
@@ -462,7 +468,9 @@ i18n
462
468
  "ConfirmDeleteWindow": "本当にこの建具を削除しますか?",
463
469
  "SuccessWindowDelete": "建具の削除が完了しました",
464
470
  "EnterFloorMaterial": "仕上げ(床)を入力",
465
- "EnterWallMaterial": "仕上げ(壁)を入力"
471
+ "EnterWallMaterial": "仕上げ(壁)を入力",
472
+ "Window": "建具",
473
+ "CannotBackDrawingMode": "描画モードがアクティブな間は戻ることができません。"
466
474
  }
467
475
  }
468
476
  },
@@ -183,11 +183,11 @@ export function renderSharingSpaceDetail(user) {
183
183
  <div class="at_screen_share_guest_card at_flex at_flex_row at_justify_between at_items_center">
184
184
  <div class="at_flex at_flex_column at_justify_start">
185
185
  <p class="at_bolder at_text_base">${user.name}</p>
186
- <span class="at_subtitle_text">Your are sharing <span class="at_bolder">${_currentSpace === null || _currentSpace === void 0 ? void 0 : _currentSpace.name}</span> to this person</span>
186
+ <span class="at_subtitle_text">${i18n.t('You are sharing to this person').replace('{space_name}', (_currentSpace === null || _currentSpace === void 0 ? void 0 : _currentSpace.name) || '')}</span>
187
187
  </div>
188
188
  <div class="at_users_online_indicator"></div>
189
189
  </div>
190
- <div class="at_bolder at_text_base">Pointer</div>
190
+ <div class="at_bolder at_text_base">${i18n.t('Pointer')}</div>
191
191
  <div class="at_flex at_flex_column at_justify_start">
192
192
  <div class="at_screen_share_pointer_choices">
193
193
  <select id="at_select_screen_share_pointer" name="at_screen_share_pointer">
@@ -41,6 +41,9 @@ let inputFloorMaterial;
41
41
  let floorMaterial = '';
42
42
  let inputWallMaterial;
43
43
  let wallMaterial = '';
44
+ let isEditWindow = false;
45
+ let currentEditWindowIndex = null;
46
+ let newlyAddedWindow = null;
44
47
  export function renderRoomFormPane() {
45
48
  log.info("__@ renderRoomFormPane: ", roomFormMode);
46
49
  const element = document.createElement('div');
@@ -224,8 +227,8 @@ export function toggleDrawPartitionButton() {
224
227
  }
225
228
  }
226
229
  export function toggleDrawWindowButton() {
227
- var _a;
228
- log.info("toggleDrawWindowButton()", getCurrentPolygon());
230
+ var _a, _b;
231
+ log.info("toggleDrawWindowButton()", getCurrentPolygon(), _3DXObjects);
229
232
  setCurrentPolygon(undefined);
230
233
  const addDoorButton = document.getElementById('at-add-window-door-btn');
231
234
  if (!isDrawing) {
@@ -238,13 +241,16 @@ export function toggleDrawWindowButton() {
238
241
  ${i18n.t('DoneDrawing')}
239
242
  <span class="mdi mdi-check-bold"></span>
240
243
  `;
244
+ const objectIndex = _3DXObjects.findIndex(obj => obj.object.id == currentObject.object.id);
245
+ log.info("objectIndex", objectIndex);
241
246
  drawingConfig = {
242
247
  lineTypeComponentConfig: {
243
248
  renderPolygonOnAdd: false,
244
249
  drawingMode: drawingMode,
245
- targetIndex: ((_a = currentWall.windows) === null || _a === void 0 ? void 0 : _a.length) || 0,
250
+ 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,
246
251
  polygonData: currentPolygonData,
247
- targetUUID: currentWall.uuid
252
+ targetUUID: currentWall.uuid,
253
+ objectIndex: objectIndex
248
254
  }
249
255
  };
250
256
  log.info("drawingConfig", drawingConfig);
@@ -263,6 +269,19 @@ export function toggleDrawWindowButton() {
263
269
  `;
264
270
  cancelDraw();
265
271
  resetDrawingConfig();
272
+ setCurrentPolygon(currentObject);
273
+ let payload;
274
+ if (currentPartitionData) {
275
+ payload = {
276
+ uuid: currentPartitionData.uuid,
277
+ space_uuid: currentPartitionData.space_uuid,
278
+ name: currentPartitionData.name,
279
+ parent_uuid: currentPartitionData.parent_uuid,
280
+ polygon_json: currentPolygonData
281
+ };
282
+ }
283
+ // Re-render polygon
284
+ renderPolygon(payload);
266
285
  }
267
286
  }
268
287
  /**
@@ -832,6 +851,9 @@ function displayWindows(window) {
832
851
  wallMaterial = currentWall.material;
833
852
  inputWallMaterial.value = currentWall.material;
834
853
  }
854
+ const isEditing = currentEditWindowIndex === window.index;
855
+ const editDisplay = isEditing ? 'none' : 'flex';
856
+ const confirmDisplay = isEditing ? 'flex' : 'none';
835
857
  element.innerHTML = `
836
858
  <div class="at_dropdown_subitem_container">
837
859
  <div class="at_subitem_left">
@@ -843,16 +865,16 @@ function displayWindows(window) {
843
865
  <div class="at_distance">${window.area.toFixed(2)} m²</div>
844
866
  </div>
845
867
  <div class="at_subitem_right">
846
- <span class="mdi mdi-pencil" id="at-edit-window-btn-${window.index}"></span>
847
- <span class="mdi mdi-check" id="at-confirm-edit-window-${window.index}" data-cy="at-confirm-edit-window-${window.index}" style="display: none;"></span>
868
+ <span class="mdi mdi-pencil" id="at-edit-window-btn-${window.index}" style="display: ${editDisplay};"></span>
869
+ <span class="mdi mdi-check" id="at-confirm-edit-window-${window.index}" data-cy="at-confirm-edit-window-${window.index}" style="display: ${confirmDisplay};"></span>
848
870
  <span class="mdi mdi-delete-outline" id="at-delete-window-btn-${window.index}"></span>
849
871
  </div>
850
872
  </div>
851
- <div class="at_edit_name" id="at-edit-window-name-${window.index}" data-index="${window.index}" style="display: none;">
873
+ <div class="at_edit_name" id="at-edit-window-name-${window.index}" data-index="${window.index}" style="display: ${confirmDisplay};">
852
874
  <input class="at_edit_name_input" type="text" id="at-edit-window-name-input-${window.index}" data-cy="at-edit-window-name-input-${window.index}" value="${windowName}" placeholder="${i18n.t('EnterNameHere')}">
853
875
  </div>
854
- <div class="at_edit_material" id="at-edit-window-material-${window.index}" data-index="${window.index}" style="display: none;">
855
- <input class="at_edit_material_input" type="text" id="at-edit-window-material-input-${window.index}" data-cy="at-edit-window-material-input-${window.index}" value="${(_a = window.material) !== null && _a !== void 0 ? _a : ''}" placeholder="${i18n.t('EnterMaterialHere')}">
876
+ <div class="at_edit_material" id="at-edit-window-material-${window.index}" data-index="${window.index}" style="display: ${confirmDisplay};">
877
+ <input class="at_edit_material_input" type="text" id="at-edit-window-material-input-${window.index}" data-cy="at-edit-window-material-input-${window.index}" value="${(_a = window.material) !== null && _a !== void 0 ? _a : ''}" placeholder="${i18n.t('EnterMaterialHere')}">
856
878
  </div>
857
879
  `;
858
880
  const nameElement = element.querySelector(`#at-window-name-${window.index}`);
@@ -885,16 +907,28 @@ function setupEditWindow(element, window) {
885
907
  return;
886
908
  // Show inputs when edit icon is clicked
887
909
  editBtn.addEventListener("click", () => {
910
+ log.info("window", window);
888
911
  editNameContainer.style.display = "flex";
889
912
  editMaterialContainer.style.display = "flex";
890
913
  editBtn.style.display = "none";
891
914
  confirmBtn.style.display = "flex";
892
915
  inputName.focus();
893
- log.info("3DXOBJECT", get3DXObjects());
894
- // enableVerticeControls(window.component)
916
+ isEditWindow = true;
917
+ currentEditWindowIndex = window.index;
918
+ // toggleDrawWindowButton()
919
+ // @ts-ignore
920
+ const windowComponent = {
921
+ inputs: {
922
+ path: window.path
923
+ }
924
+ };
925
+ log.info("currentObject ", currentObject);
926
+ // setCurrentPolygon(currentObject)
927
+ // enableVerticeControls(windowComponent)
895
928
  });
896
929
  // // Confirm edit name and material
897
930
  confirmBtn.addEventListener("click", () => {
931
+ log.info("3dxobject", _3DXObjects);
898
932
  // Update window name
899
933
  const newName = inputName.value.trim();
900
934
  window.name = newName || window.name;
@@ -907,12 +941,28 @@ function setupEditWindow(element, window) {
907
941
  confirmBtn.style.display = "none";
908
942
  const windowTooltip = document.getElementById(`at-window-name-tooltip-${window.index}`);
909
943
  windowTooltip.innerText = `${window.name}`;
944
+ isEditWindow = false;
945
+ currentEditWindowIndex = null;
946
+ currentWall.windows[window.index] = window;
947
+ const objectIndex = _3DXObjects.findIndex(obj => obj.object.object_id == currentObject.object.object_id);
948
+ if (_3DXObjects[objectIndex].children) {
949
+ _3DXObjects[objectIndex].children.map((win) => __awaiter(this, void 0, void 0, function* () {
950
+ log.info("WIND", win);
951
+ if (win.index == window.index && win.wallUUID == currentWall.uuid) {
952
+ yield disposeModel(win);
953
+ }
954
+ }));
955
+ }
956
+ // toggleDrawWindowButton()
910
957
  saveWallChanges();
911
958
  });
912
959
  }
913
960
  function saveWallChanges() {
961
+ log.info("currentWall", currentWall);
914
962
  updateWallInPolygon(currentWall);
915
963
  updatePartitionData();
964
+ //
965
+ log.info("currentObject", currentObject);
916
966
  setCurrentPolygon(currentObject);
917
967
  renderCurrentPartition();
918
968
  // dispatchSpaceEvent(SPACE_EVENTS.PARTITION_EDITED, { data: currentPartitionData });
@@ -940,6 +990,7 @@ function renderCurrentPartition() {
940
990
  parent_uuid: currentPartitionData.parent_uuid,
941
991
  polygon_json: currentPolygonData
942
992
  };
993
+ log.info("render paylaod", payload);
943
994
  renderPolygon(payload);
944
995
  }
945
996
  function setupDeleteWindow(element, window) {
@@ -968,6 +1019,18 @@ function setupDeleteWindow(element, window) {
968
1019
  currentWall = Object.assign(Object.assign({}, wall), { windows: wall.windows.filter((w) => w.index !== window.index) });
969
1020
  return currentWall;
970
1021
  });
1022
+ const objectIndex = _3DXObjects.findIndex(obj => obj.object.object_id == currentObject.object.object_id);
1023
+ if (objectIndex != null) {
1024
+ log.info("objectIndex", objectIndex);
1025
+ if (_3DXObjects[objectIndex].children) {
1026
+ _3DXObjects[objectIndex].children.map((win) => __awaiter(this, void 0, void 0, function* () {
1027
+ log.info("WIND", win);
1028
+ if (win.index == window.index && win.wallUUID == currentWall.uuid) {
1029
+ yield disposeModel(win);
1030
+ }
1031
+ }));
1032
+ }
1033
+ }
971
1034
  // Save + rerender window
972
1035
  currentObject.object.object_data.json_data = currentPolygonData;
973
1036
  saveWallChanges();
@@ -1007,6 +1070,10 @@ function goBackToPartitionList() {
1007
1070
  }
1008
1071
  function goBackToFloorWallList() {
1009
1072
  log.info("goBackToFloorWallList()");
1073
+ if (isDrawing) {
1074
+ notify.error(`${i18n.t('CannotBackDrawingMode')}`);
1075
+ return;
1076
+ }
1010
1077
  const elements = {
1011
1078
  'at-face-title': 'flex',
1012
1079
  'at-window-door-title': 'none',
@@ -1140,8 +1207,8 @@ export function clearPartitionForm() {
1140
1207
  displayElement('at-draw-partition-form-btn', 'block');
1141
1208
  hideElement('at-add-window-door-btn');
1142
1209
  hideElement('at-edit-wall-material');
1143
- resetDrawingConfig();
1144
1210
  cancelDrawing();
1211
+ resetDrawingConfig();
1145
1212
  const partitionContainer = document.getElementById('at-partition-item-container');
1146
1213
  partitionContainer.style.display = 'none';
1147
1214
  const addDoorButton = document.getElementById('at-add-window-door-btn');
@@ -1165,6 +1232,8 @@ export function clearPartitionForm() {
1165
1232
  previousPartitionData = null;
1166
1233
  isDrawing = false;
1167
1234
  drawingMode = null;
1235
+ currentEditWindowIndex = null;
1236
+ isEditWindow = false;
1168
1237
  }
1169
1238
  /**
1170
1239
  * Cancels the drawing action for a partition.
@@ -1332,12 +1401,6 @@ export function clearTempCurrentPolygon() {
1332
1401
  */
1333
1402
  export function setPolygonData(payload) {
1334
1403
  console.log('setPolygonData()', payload);
1335
- // let currentObjectData = getCurrentPolygon()
1336
- // console.log('currentObjectData ', currentObjectData);
1337
- // if (currentObjectData) {
1338
- // currentObjectData.object.object_data.json_data = payload
1339
- // }
1340
- // setCurrentPolygon(currentObjectData)
1341
1404
  // Helper function to round numbers to 2 decimals
1342
1405
  function roundToFourDecimals(value) {
1343
1406
  if (typeof value === "number") {
@@ -1436,9 +1499,9 @@ export function setCurrentPartitionData() {
1436
1499
  displayFaces(currentPolygonData);
1437
1500
  }
1438
1501
  else if (drawingMode === 'window') {
1439
- log.info("current wall", currentWall);
1440
1502
  // Update current edit wall display
1441
1503
  currentWall = currentPolygonData.walls.find(wall => wall.uuid == currentWall.uuid);
1504
+ log.info("current wall", currentWall, currentPolygonData);
1442
1505
  const faceVertexContainer = document.getElementById('at-face-vertex-container');
1443
1506
  faceVertexContainer.innerHTML = '';
1444
1507
  faceVertexContainer.append(displayWall(currentWall));
@@ -1481,7 +1544,7 @@ function updatePartitionDataArray(payload, currentPartitionDataArray) {
1481
1544
  }
1482
1545
  else if (drawingMode === 'window') {
1483
1546
  // Update current partition data
1484
- currentPartitionData.polygon_json = JSON.stringify(currentPolygonData);
1547
+ currentPartitionData.polygon_json = JSON.stringify(payload.polygon_json);
1485
1548
  // Update current partition data array
1486
1549
  const currentPartitionDataIndex = currentPartitionDataArray.findIndex(partitionData => partitionData.uuid = currentPartitionData.uuid);
1487
1550
  currentPartitionDataArray[currentPartitionDataIndex] = currentPartitionData;
@@ -1,4 +1,5 @@
1
1
  import { IObjectData, PartitionNode } from "../../../../types";
2
+ import { Vector3 } from "../../../../../bundle/sdk";
2
3
  /**
3
4
  * Renders and returns the HTML element for the room tree pane.
4
5
  * @returns {HTMLElement} The HTML element representing the room tree pane.
@@ -69,8 +70,15 @@ export declare function setFilteredDisplay(type: String): void;
69
70
  */
70
71
  export declare function updateRoomVisibilityUI(parentId: string, isVisible: boolean): void;
71
72
  /**
72
- * Highlights the selected child element within a partition by toggling CSS classes.
73
+ * Highlights the selected child element and toggle expand indicator within a partition by toggling CSS classes.
73
74
  * @param partitionId - The unique identifier of the partition containing the child elements
74
75
  * @param name - The specific name/identifier of the child element to highlight
75
76
  */
76
77
  export declare function highlightSelectedPartitionChild(partitionId: string, name: string): void;
78
+ export declare function toggeleExpandParitionWallChild(partitionId: string, name: string): void;
79
+ export declare function highlightSelectedWallWindow(wallUuid: string, index: number | string): void;
80
+ export declare function toggleHighlightedPartitionItem(): void;
81
+ export declare function toggleHighlightedWindowItem(): void;
82
+ export declare function calculateMidPoint(coords: Array<{
83
+ start: Vector3;
84
+ }>): Vector3;