architwin 1.15.4 → 1.15.6

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.
@@ -387,14 +387,14 @@ i18n
387
387
  "SuccessPartitionDelete": "削除しました",
388
388
  "NoPartitionDeleted": "削除できる区画がありません",
389
389
  "Saving": "保存",
390
- "DeletePartition": "パーティション削除",
390
+ "DeletePartition": "区画削除",
391
391
  "ModifyPartition": "パーティションの変更",
392
392
  "InvalidNaN": "値が不正です。正しい数値を入力してくさい。",
393
393
  "CannotPlaceInArea": "ここには設定できません。位置を変えて試してください。",
394
394
  "SuccessWallHeight": "壁の高さが正常に更新されました",
395
395
  "Edge": "辺長",
396
396
  "Area": "面積",
397
- "DeleteWall": "ウォール削除",
397
+ "DeleteWall": "壁削除",
398
398
  "SuccessWallDelete": "削除しました",
399
399
  "WarnLowFloor": "Tマークされたエリアは、スペースの床よりも低い場合があります",
400
400
  "Settings": "BIM/CAD設定",
@@ -13,7 +13,7 @@ export function renderPreviewModal() {
13
13
  element.setAttribute('id', 'at-preview-modal-overlay');
14
14
  element.setAttribute('data-cy', 'at-preview-modal-overlay');
15
15
  element.innerHTML = `
16
- <div class="at_preview_modal">
16
+ <div class="at_preview_modal" id="at-preview-modal">
17
17
  <div class="at_preview_modal-header">
18
18
  <h2 class="at_preview_modal-title" id="at-preview-modal-content-heading" data-cy="at-preview-modal-content-heading"></h2>
19
19
  <button class="at_preview_modal-close-btn" data-cy="at-preview-modal-close-btn">&times;</button>
@@ -22,6 +22,14 @@ export function renderPreviewModal() {
22
22
  <div class="at_preview_modal-content" id="at-preview-modal-content-subheading" data-cy="at-preview-modal-content-subheading">
23
23
  </div>
24
24
  </div>
25
+ <div class="at_preview_modal-resize-handle at_preview_modal-resize-handle--top" data-resize-direction="top"></div>
26
+ <div class="at_preview_modal-resize-handle at_preview_modal-resize-handle--right" data-resize-direction="right"></div>
27
+ <div class="at_preview_modal-resize-handle at_preview_modal-resize-handle--bottom" data-resize-direction="bottom"></div>
28
+ <div class="at_preview_modal-resize-handle at_preview_modal-resize-handle--left" data-resize-direction="left"></div>
29
+ <div class="at_preview_modal-resize-handle at_preview_modal-resize-handle--top-left" data-resize-direction="top-left"></div>
30
+ <div class="at_preview_modal-resize-handle at_preview_modal-resize-handle--top-right" data-resize-direction="top-right"></div>
31
+ <div class="at_preview_modal-resize-handle at_preview_modal-resize-handle--bottom-left" data-resize-direction="bottom-left"></div>
32
+ <div class="at_preview_modal-resize-handle at_preview_modal-resize-handle--bottom-right" data-resize-direction="bottom-right"></div>
25
33
  </div>
26
34
  `;
27
35
  document.body.appendChild(element);
@@ -1,5 +1,7 @@
1
- import { FORM_MODE, PartitionNode, PolygonData, IObjectData } from "../../../../types";
1
+ import { FORM_MODE, PartitionNode, PolygonData, WallPolyData, IObjectData, WindowPolyData } from "../../../../types";
2
2
  export declare let isEditWindow: boolean;
3
+ export declare let currentEditWindowIndex: number;
4
+ export declare let currentWindow: WindowPolyData;
3
5
  export declare function renderRoomFormPane(): HTMLDivElement;
4
6
  /**
5
7
  * Toggles the state of the partition drawing functionality.
@@ -30,6 +32,7 @@ export declare function displayPartitionFormMode(): void;
30
32
  * @param event - The click event from the edit button, used to identify which partition to edit
31
33
  */
32
34
  export declare function handlePartitionRowEditBtnClickEvent(partitions: Array<PartitionNode>, targetElement: HTMLElement): void;
35
+ export declare function displayWall(wall: WallPolyData): HTMLElement;
33
36
  /**
34
37
  * Clears the partition form by resetting UI elements and internal data.
35
38
  * - Navigates back to the partition list view.
@@ -103,6 +106,8 @@ export declare function getCurrentPolygonData(): PolygonData;
103
106
  * partition with its corresponding UUID, space UUID, and polygon data.
104
107
  */
105
108
  export declare function setCurrentPartitionData(): Promise<void>;
109
+ export declare function removeWindow(index?: number): void;
110
+ export declare function toggleUndoRedoButtons(undo: boolean, redo: boolean): void;
106
111
  export declare function getCurrentPartitionData(): PartitionNode;
107
112
  export declare function getNewlyAddedPartition(): Array<PartitionNode>;
108
113
  export declare function getDeletedSavedPartitionArray(): Array<PartitionNode>;
@@ -119,3 +124,4 @@ export declare function setPreviousPartitionData(payload: PartitionNode): void;
119
124
  export declare function handlePartitionWallEditBtn(wallUuid: string): Promise<void>;
120
125
  export declare function getTempCurrentRoomEditData(): Array<PartitionNode>;
121
126
  export declare function setTempCurrentRoomEditData(roomEditData: Array<PartitionNode>): void;
127
+ export declare function getCurrentWall(): WallPolyData;
@@ -10,7 +10,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
10
10
  import i18n from '../i18n';
11
11
  import { SPACE_EVENTS } from "../../../../types";
12
12
  import { batchAddEventListenerByClassName } from "../../../events";
13
- import { startDraw, cancelDraw, disposeModel, _3DXObjects, getCurrentPolygon, dispatchSpaceEvent, enableVerticeControls, setCurrentPolygon, setMeshChildrenMaterialProperty, get3DXObjects, getChildrenOfModel, clearSelectedObject, renderPolygon, addUndoDrawActions, setWallBaseHeight, clearWallBaseHeight, setDrawingConfig, resetDrawingConfig, goToPosition, clearFloorBaseHeight } from '../../../../architwin';
13
+ import { startDraw, cancelDraw, disposeModel, _3DXObjects, getCurrentPolygon, dispatchSpaceEvent, enableVerticeControls, setCurrentPolygon, setMeshChildrenMaterialProperty, get3DXObjects, getChildrenOfModel, clearSelectedObject, renderPolygon, setWallBaseHeight, clearWallBaseHeight, setDrawingConfig, resetDrawingConfig, goToPosition, partitionHistory } from '../../../../architwin';
14
14
  import { generateUUID, extractUUID } from '../../../../utils';
15
15
  import { getCurrentEditRoomData } from './roomTreePane';
16
16
  import { toggleModal, setModalAction } from "../modal";
@@ -42,7 +42,8 @@ let floorMaterial = '';
42
42
  let inputWallMaterial;
43
43
  let wallMaterial = '';
44
44
  export let isEditWindow = false;
45
- let currentEditWindowIndex = null;
45
+ export let currentEditWindowIndex = null;
46
+ export let currentWindow = null;
46
47
  let tempCurrentEditRoom = null;
47
48
  export function renderRoomFormPane() {
48
49
  log.info("__@ renderRoomFormPane: ", roomFormMode);
@@ -211,10 +212,6 @@ export function toggleDrawPartitionButton() {
211
212
  const vertexList = document.getElementById('at-face-vertex-container');
212
213
  const partitionNameInput = document.getElementById('at-edit-partition-name-input');
213
214
  partitionNameInput.value = '';
214
- const undoBtn = document.getElementById('at-draw-undo-btn');
215
- const redoBtn = document.getElementById('at-draw-redo-btn');
216
- undoBtn.classList.add('at_disabled');
217
- redoBtn.classList.add('at_disabled');
218
215
  const formMode = getPartitionFormMode();
219
216
  if (formMode == "ADD" /* FORM_MODE.ADD */) {
220
217
  tempCurrentPolygon = getCurrentPolygon();
@@ -231,6 +228,7 @@ export function toggleDrawPartitionButton() {
231
228
  isEditPartition = false;
232
229
  previousPartitionData = null;
233
230
  }
231
+ // toggleUndoRedoButtons(false, false)
234
232
  }
235
233
  export function toggleDrawWindowButton() {
236
234
  var _a, _b;
@@ -251,7 +249,6 @@ export function toggleDrawWindowButton() {
251
249
  }
252
250
  const objectIndex = _3DXObjects.findIndex(obj => obj.object.id == currentObject.object.id);
253
251
  log.info("objectIndex", objectIndex);
254
- clearFloorBaseHeight();
255
252
  drawingConfig = {
256
253
  lineTypeComponentConfig: {
257
254
  renderPolygonOnAdd: false,
@@ -302,6 +299,7 @@ export function toggleDrawWindowButton() {
302
299
  }
303
300
  }
304
301
  }
302
+ // toggleUndoRedoButtons(false, false)
305
303
  }
306
304
  /**
307
305
  * Displays the partition form based on the current form mode.
@@ -339,12 +337,12 @@ function populatePartitionForm(partition) {
339
337
  const memo = document.getElementById('at-room-memo-input');
340
338
  if (partition.polygon_json != null) {
341
339
  memo.value = JSON.parse(partition.polygon_json).memo;
340
+ floorLevel.value = JSON.parse(partition.polygon_json).floor_level;
342
341
  }
343
342
  // Display Partitions
344
343
  currentPartitionDataArray = partition.children;
345
344
  savedPartitionDataArray = partition.children;
346
345
  if (currentPartitionDataArray.length !== 0) {
347
- floorLevel.value = JSON.parse(partition.children[0].polygon_json).floor.floor_level;
348
346
  wallheight.value = JSON.parse(partition.children[0].polygon_json).walls[0].wall_height;
349
347
  displayPartitions(currentPartitionDataArray);
350
348
  }
@@ -699,14 +697,6 @@ function displayFaces(polygon) {
699
697
  console.log("renderPolygon:", payload, getCurrentPolygon());
700
698
  // Re-render polygon
701
699
  renderPolygon(payload);
702
- const undoPaylaod = {
703
- action: "deleteWall",
704
- wallId: wallId,
705
- payload: payload
706
- };
707
- addUndoDrawActions(undoPaylaod);
708
- const redoBtn = document.getElementById('at-draw-redo-btn');
709
- redoBtn.classList.add('at_disabled');
710
700
  toggleModal(false);
711
701
  notify.success(`${i18n.t('SuccessWallDelete')}`);
712
702
  }));
@@ -798,7 +788,7 @@ function displayFaces(polygon) {
798
788
  wallConfirmMaterial.style.display = "inline-flex";
799
789
  });
800
790
  }
801
- function displayWall(wall) {
791
+ export function displayWall(wall) {
802
792
  log.info("displayWall()", wall);
803
793
  // Extract the wall name from the format "_wall-{number}" using regex
804
794
  const match = wall.name.match(/wall-(\d+)$/);
@@ -929,6 +919,7 @@ function setupEditWindow(element, window) {
929
919
  const confirmBtn = element.querySelector(`#at-confirm-edit-window-${window.index}`);
930
920
  if (!editBtn || !editNameContainer || !inputName || !nameLabel || !editMaterialContainer || !inputMaterial)
931
921
  return;
922
+ currentWindow = window;
932
923
  // Show inputs when edit icon is clicked
933
924
  editBtn.addEventListener("click", () => {
934
925
  if (isDrawing) {
@@ -965,6 +956,17 @@ function setupEditWindow(element, window) {
965
956
  };
966
957
  enableVerticeControls(windowComponent);
967
958
  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)
968
970
  });
969
971
  // // Confirm edit name and material
970
972
  confirmBtn.addEventListener("click", () => {
@@ -998,6 +1000,8 @@ function setupEditWindow(element, window) {
998
1000
  saveWallChanges();
999
1001
  isDrawing = false;
1000
1002
  isEditWindow = false;
1003
+ partitionHistory.clearHistory();
1004
+ // toggleUndoRedoButtons(false, false)
1001
1005
  });
1002
1006
  }
1003
1007
  function saveWallChanges() {
@@ -1161,7 +1165,7 @@ function displayFloor(floor, walls, floorModel) {
1161
1165
  <span class="mdi mdi-chevron-up" id="at-expand-btn-${floor.uuid}" data-cy="at-expand-btn-${floor.uuid}" model-id="${floorModelUUID}"></span>
1162
1166
  </div>
1163
1167
  <div class="at_subitem_right">
1164
- <span class="mdi mdi-delete-outline"></span>
1168
+ <!-- <span class="mdi mdi-delete-outline"></span> -->
1165
1169
  </div>
1166
1170
  </div>
1167
1171
 
@@ -1365,17 +1369,17 @@ export function getPartitionFormData() {
1365
1369
  const name = ((_a = document.getElementById('at-room-name-input')) === null || _a === void 0 ? void 0 : _a.value) || null;
1366
1370
  const wallheight = ((_b = document.getElementById('at-room-wall-height-input')) === null || _b === void 0 ? void 0 : _b.value) || null;
1367
1371
  const floorLevel = ((_c = document.getElementById('at-room-floor-level-input')) === null || _c === void 0 ? void 0 : _c.value) || null;
1368
- let memo = ((_d = document.getElementById('at-room-memo-input')) === null || _d === void 0 ? void 0 : _d.value) || null;
1372
+ const memo = ((_d = document.getElementById('at-room-memo-input')) === null || _d === void 0 ? void 0 : _d.value) || null;
1369
1373
  const currentUrl = window.location.href;
1370
1374
  const spaceUUID = extractUUID(currentUrl);
1371
1375
  let payload = {
1372
1376
  space_uuid: spaceUUID,
1373
1377
  name: name,
1374
1378
  parent_uuid: null,
1375
- polygon_json: JSON.stringify({ memo: memo }),
1379
+ polygon_json: JSON.stringify({ memo: memo, floor_level: Number(floorLevel) }),
1376
1380
  children: currentPartitionDataArray,
1377
1381
  };
1378
- if (!memo) {
1382
+ if (!memo && !floorLevel) {
1379
1383
  payload.polygon_json = null;
1380
1384
  }
1381
1385
  currentPartitionDataArray.forEach(partition => {
@@ -1391,7 +1395,7 @@ export function getPartitionFormData() {
1391
1395
  currentEditRoomData.children = currentPartitionDataArray;
1392
1396
  payload = currentEditRoomData;
1393
1397
  payload.name = name;
1394
- payload.polygon_json = JSON.stringify({ memo: memo });
1398
+ payload.polygon_json = JSON.stringify({ memo: memo, floor_level: Number(floorLevel) });
1395
1399
  }
1396
1400
  return payload;
1397
1401
  }
@@ -1522,7 +1526,7 @@ export function setCurrentPartitionData() {
1522
1526
  if (drawingMode === 'partition') {
1523
1527
  displayFaceLists();
1524
1528
  currentObject = currentObjectData;
1525
- log.info("JAMES currentObject", currentObject);
1529
+ log.info("currentObject", currentObject);
1526
1530
  }
1527
1531
  }, 50); // Check every 50ms
1528
1532
  });
@@ -1628,10 +1632,6 @@ function onModeDetectFloorInput(event) {
1628
1632
  floorConfirmMaterial.style.display = "none";
1629
1633
  }
1630
1634
  }
1631
- function setFloorMaterial(material) {
1632
- console.log('setFloorMaterial()', material);
1633
- floorMaterial = material;
1634
- }
1635
1635
  function onModeDetectWallInput(event) {
1636
1636
  console.log('onModeDetectWallInput()', event);
1637
1637
  const target = event.target;
@@ -1648,6 +1648,40 @@ function onModeDetectWallInput(event) {
1648
1648
  wallConfirmMaterial.style.display = "none";
1649
1649
  }
1650
1650
  }
1651
+ export function removeWindow(index = -1) {
1652
+ if (index <= -1) {
1653
+ currentWall.windows.pop();
1654
+ }
1655
+ else {
1656
+ currentWall.windows.splice(index, 1);
1657
+ }
1658
+ const faceVertexContainer = document.getElementById('at-face-vertex-container');
1659
+ faceVertexContainer.innerHTML = '';
1660
+ faceVertexContainer.append(displayWall(currentWall));
1661
+ }
1662
+ export function toggleUndoRedoButtons(undo, redo) {
1663
+ console.log("toggleUndoRedoButtons", undo, redo);
1664
+ if (!undo) {
1665
+ const undoBtn = document.getElementById('at-draw-undo-btn');
1666
+ undoBtn.classList.add('at_disabled');
1667
+ }
1668
+ else {
1669
+ const undoBtn = document.getElementById('at-draw-undo-btn');
1670
+ undoBtn.classList.remove('at_disabled');
1671
+ }
1672
+ if (!redo) {
1673
+ const redoBtn = document.getElementById('at-draw-redo-btn');
1674
+ redoBtn.classList.add('at_disabled');
1675
+ }
1676
+ else {
1677
+ const redoBtn = document.getElementById('at-draw-redo-btn');
1678
+ redoBtn.classList.remove('at_disabled');
1679
+ }
1680
+ }
1681
+ function setFloorMaterial(material) {
1682
+ console.log('setFloorMaterial()', material);
1683
+ floorMaterial = material;
1684
+ }
1651
1685
  function setWallMaterial(material) {
1652
1686
  console.log('setWallMaterial()');
1653
1687
  wallMaterial = material;
@@ -1782,3 +1816,6 @@ export function getTempCurrentRoomEditData() {
1782
1816
  export function setTempCurrentRoomEditData(roomEditData) {
1783
1817
  tempCurrentEditRoom = roomEditData;
1784
1818
  }
1819
+ export function getCurrentWall() {
1820
+ return currentWall;
1821
+ }
@@ -8,7 +8,9 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
8
8
  });
9
9
  };
10
10
  import { actionBar, renderObjectCards, renderLibraryCards, renderTags, renderTagRow, getTagFormData, addClickEventToTagRow, setActiveCard, setActiveMenu, removeObjectCard, clearActiveMenu, setTagCategoriesOption, toggleDropdown, tagFormMode, selectedTag, renderRecepientOptions, renderTagMessages, createTagMessage, setTagLink, setTagMessagingDetails, renderCategoryDropdownOptions, clearTagFormDropdown, clearActiveActionBtn, clearActiveCard, toggleActionBarButtons, selectedCategoryFilterId, selectedSubCategoryFilterId, filterTagList, toggleModal, setModalAction, } from "./components/toolbar";
11
- import { getTargetPosition, addMediaScreen, _3DXObjects, selectedObject, setTransformControls, copyObject, revertTransform, clearSelectedObject, removeTransformControls, getLibrary, getMpTags, renderTag, captureSpaceScreenshot, moveTag, subscribeSpaceEvent, setModelVisibility, disposeModel, disposeTag, _tags, _tagCategories, dispatchSpaceEvent, editTagLabel, editTagDescription, setTagMessageRecepients, setTagMessages, setSelectedTagUuid, renderMeetingSidebar, setTagIcon, setObjectTransformation, getSelectedObject, _atwin, isCdnMapDataAvailable, captureScreenshotAndCameraDetails, _mpConfig, cancelModelPlacement, _modelDetails, actionHistory, get3DXObjects, transformHistory, goToModel, themeManager, _partitionNodes, setSpacePartitionNodes, getSpaceId, setFloorBaseHeight, toggleWallVisibility, getChildrenOfModel, toggleFloorVisibility, renderPolygon, getCurrentPolygon, getFloorBaseHeight, setSelectedObject, redoDrawAction, undoDrawAction, setWallBaseHeight, clearWallBaseHeight, clearFloorBaseHeight, isToolbarFeatureEnabled, captureCurrentView, getCurrentFloor, _spaceUsers, setPipeCategories, setPipes, detachTagMedia, getTagDataCollection, setVertexPath, _screenSharingHostUser, _tagIotCategoryTypes, getIoTDeviceTagIcons, toggleMeshChildrenVisibility, set3DXObjects } from "../architwin";
11
+ import { getTargetPosition, addMediaScreen, _3DXObjects, selectedObject, setTransformControls, copyObject, revertTransform, clearSelectedObject, removeTransformControls, getLibrary, getMpTags, renderTag, captureSpaceScreenshot, moveTag, subscribeSpaceEvent, setModelVisibility, disposeModel, disposeTag, _tags, _tagCategories, dispatchSpaceEvent, editTagLabel, editTagDescription, setTagMessageRecepients, setTagMessages, setSelectedTagUuid, renderMeetingSidebar, setTagIcon, setObjectTransformation, getSelectedObject, _atwin, isCdnMapDataAvailable, captureScreenshotAndCameraDetails, _mpConfig, cancelModelPlacement, _modelDetails, actionHistory, get3DXObjects, transformHistory, goToModel, themeManager, _partitionNodes, setSpacePartitionNodes, getSpaceId, setFloorBaseHeight, toggleWallVisibility, getChildrenOfModel, toggleFloorVisibility, renderPolygon, getCurrentPolygon, getFloorBaseHeight, setSelectedObject, redoDrawAction, undoDrawAction, setWallBaseHeight, clearWallBaseHeight, clearFloorBaseHeight, isToolbarFeatureEnabled, captureCurrentView, getCurrentFloor, _spaceUsers, setPipeCategories, setPipes, detachTagMedia, getTagDataCollection, setVertexPath, _screenSharingHostUser, _tagIotCategoryTypes, getIoTDeviceTagIcons, toggleMeshChildrenVisibility, set3DXObjects, partitionHistory,
12
+ // polygonHistory
13
+ } from "../architwin";
12
14
  import { Notyf } from 'notyf';
13
15
  import 'notyf/notyf.min.css';
14
16
  import { SPACE_EVENTS, COORDINATE_SYSTEM, UNITS, DEGREE, MAP_OPTIONS, sortTagOptions, sortObjectOptions, CUSTOM_MAP_MODE, TAG_TYPE } from "../types";
@@ -24,7 +26,7 @@ import log from 'loglevel';
24
26
  import * as minimap from '../minimap';
25
27
  import { clearActiveThemeCard, getSelectedTheme } from "./components/toolbar/themePane";
26
28
  import { getCurrentEditRoomData, displayRoomTree, updatePartitionVisibilityUI, getSelectedPartitionId, updatePolygonVisibilityData, toggleVisibilityState, setFilteredDisplay, updateRoomVisibilityUI, highlightSelectedPartitionChild, highlightSelectedWindow, getRoomData } from "./components/toolbar/spacePartition/roomTreePane";
27
- import { toggleDrawPartitionButton, displayPartitionFormMode, setPartitionFormMode, clearPartitionForm, setPolygonData, getPartitionFormData, getPartitionSavingMode, setPartitionSavingMode, getPartitionFormMode, getNewlyAddedPartition, setCurrentPartitionData, getCurrentPartitionData, getTempCurrentPolygon, clearTempCurrentPolygon, toggleDrawWindowButton, getIsDrawing, getDrawingMode, getCurrentPolygonData, setTempCurrentRoomEditData } from "./components/toolbar/spacePartition/roomFormPane";
29
+ import { toggleDrawPartitionButton, displayPartitionFormMode, setPartitionFormMode, clearPartitionForm, setPolygonData, getPartitionFormData, getPartitionSavingMode, setPartitionSavingMode, getPartitionFormMode, getNewlyAddedPartition, setCurrentPartitionData, getCurrentPartitionData, getTempCurrentPolygon, clearTempCurrentPolygon, toggleDrawWindowButton, getIsDrawing, getDrawingMode, getCurrentPolygonData, setTempCurrentRoomEditData, toggleUndoRedoButtons, getCurrentWall, currentWindow } from "./components/toolbar/spacePartition/roomFormPane";
28
30
  import { actionSettingsSelectOption, getTempCoordinateSystem, getTempMeasurementUnit, getTempRotationUnit, setCoordinateSystem, setMeasurementUnit, setRotationUnit, initSettingsValues, setTempCoordinateSystem, setTempMeasurementUnit, setTempRotationUnit, toggleActionSettingsDropdown, toggleCalibrateBasepoint, setScaleFactor, getTempScaleFactor, setTempScaleFactor, setBasepoint, getTempBasepoint, setTempBasepoint, getBasepoint, toggleActionSettings, getBasepointObjectPayload, displayConvertedCoordinates, getCoordinateSystem, getScaleFactor, getMeasurementUnit, getRotationUnit, setBasepointObjectPayload } from "./components/toolbar/actionSettingsPane";
29
31
  import { getBasepointCalibrateBpCoordinateValues, getBasepointCalibrateMpCoordinateValues, initBsepointCalibratePane, toggleBasepointCalibratePane } from "./components/toolbar/basepointCalibratePane";
30
32
  import { toggleGeneralMapOptions, initGeneralSelectedMap, getSelectedMapOption } from './components/toolbar/generalSettingsMenuPane';
@@ -38,6 +40,7 @@ import { PipeForm } from "./components/toolbar/pipeFormPane";
38
40
  import { toggleIoTCategoryOptions, toggleIoTDevicesOptions, setSelectedIoTSystemRadio, clearIoTDropdowns, initIoTFormData, setIotCategoryOptions, getIotTagFormData, iotTagFormMode, selectedIotTag, clearIotFields, getIotCategoryOption } from './components/toolbar/tagIotFormPane';
39
41
  import { getTheseTagMessages, timedoutComment, unsendComment } from "./components/toolbar/tagMessagingPane";
40
42
  import { handleScreenShareResponsiveChanges, handleScreenShareAcceptRequest, handleScreenShareBackUserListPane, handleScreenShareEndSessionEvent, handleScreenShareUsersUpdated, renderScreenShareLeaveConfirmationModal } from "./components/toolbar/screenSharePane";
43
+ import _ from "lodash";
41
44
  const pipeList = new PipeList();
42
45
  const pipeForm = new PipeForm();
43
46
  let activeToolbarItem, activeActionItem, activePane, activeActionPane, cancelTagPlacementPrompt, cancelModelPlacementPrompt;
@@ -530,6 +533,7 @@ function setupIndividualEventListeners() {
530
533
  handlePipeForm();
531
534
  handlePipeList();
532
535
  handleResponsiveChanges();
536
+ handlePreviewModalResize();
533
537
  }
534
538
  //================ OBJECT EVENT HANDLERS ===============//s
535
539
  function handleResponsiveChanges() {
@@ -1504,9 +1508,8 @@ function setupSpaceEventSubscriptions() {
1504
1508
  subscribeSpaceEvent(SPACE_EVENTS.TAGPLACER_CREATED, handleTagPlacerCreated);
1505
1509
  subscribeSpaceEvent(SPACE_EVENTS.UPDATE_ROOM_TREE, handleUpdateRoomTree);
1506
1510
  subscribeSpaceEvent(SPACE_EVENTS.PARTITION_CLICKED, handlePartitionSelected);
1507
- subscribeSpaceEvent(SPACE_EVENTS.VERTEX_DRAG_END, setCurrentPartitionData);
1511
+ subscribeSpaceEvent(SPACE_EVENTS.VERTEX_DRAG_END, handleVertexDragEnd);
1508
1512
  subscribeSpaceEvent(SPACE_EVENTS.VERTEX_PLACED, handleVertexPlace);
1509
- subscribeSpaceEvent(SPACE_EVENTS.DRAW_HISTORY, handleDrawHistory);
1510
1513
  subscribeSpaceEvent(SPACE_EVENTS.FLOOR_IMAGE_UPLOADED, handleCustomMapFloorImageUploaded);
1511
1514
  subscribeSpaceEvent(SPACE_EVENTS.FLOOR_IMAGE_UPLOAD_FAILED, handleCustomMapFloorUploadFailed);
1512
1515
  subscribeSpaceEvent(SPACE_EVENTS.TAG_SANDBOX_REGISTERED, handleSandboxRegistered);
@@ -1517,6 +1520,31 @@ function setupSpaceEventSubscriptions() {
1517
1520
  subscribeSpaceEvent(SPACE_EVENTS.SCREEN_SHARE_ACCEPT_REQUEST, handleScreenShareAcceptRequest);
1518
1521
  subscribeSpaceEvent(SPACE_EVENTS.SCREEN_SHARE_BACK_USER_LIST_PANE, handleScreenShareBackUserListPane);
1519
1522
  }
1523
+ function handleVertexDragEnd(payload) {
1524
+ log.info("handleVertexDragEnd()", payload);
1525
+ setCurrentPartitionData();
1526
+ if (isToolbarFeatureEnabled("roomCreation")) {
1527
+ let data;
1528
+ const currentPartitionData = _.cloneDeep(getCurrentPartitionData());
1529
+ const currentPolygonData = _.cloneDeep(getCurrentPolygonData());
1530
+ const currentWall = getCurrentWall();
1531
+ const wallIndex = currentPolygonData.walls.findIndex(w => w.uuid == currentWall.uuid);
1532
+ if (currentPartitionData) {
1533
+ data = {
1534
+ polygon: {
1535
+ uuid: currentPartitionData.uuid,
1536
+ polygon_json: currentPolygonData
1537
+ },
1538
+ verticePath: currentPolygonData.walls[wallIndex].windows[currentWindow.index].path
1539
+ };
1540
+ partitionHistory.addToHistory(JSON.parse(JSON.stringify(data)));
1541
+ }
1542
+ log.info("all history", partitionHistory.getAllHistory());
1543
+ }
1544
+ // partitionHistory.addToHistory(data)
1545
+ // polygonHistory.addToHistory(payload)
1546
+ // toggleUndoRedoButtons(polygonHistory.canUndo(), polygonHistory.canRedo())
1547
+ }
1520
1548
  function handlePartitionColiderClickSelected(payload) {
1521
1549
  return __awaiter(this, void 0, void 0, function* () {
1522
1550
  const polygonId = extractUUID(payload.collider.name);
@@ -1585,43 +1613,10 @@ function handleDragEnd(payload) {
1585
1613
  };
1586
1614
  setCurrentTransformationValues(transformValues);
1587
1615
  }
1588
- function handleDrawHistory(payload) {
1589
- console.log("payload", payload);
1590
- const undoCount = (payload.undoDrawActions).length;
1591
- const redoCount = (payload.redoDrawActions).length;
1592
- if (undoCount == 0) {
1593
- const undoBtn = document.getElementById('at-draw-undo-btn');
1594
- undoBtn.classList.add('at_disabled');
1595
- }
1596
- else {
1597
- const undoBtn = document.getElementById('at-draw-undo-btn');
1598
- undoBtn.classList.remove('at_disabled');
1599
- }
1600
- if (redoCount == 0) {
1601
- const redoBtn = document.getElementById('at-draw-redo-btn');
1602
- redoBtn.classList.add('at_disabled');
1603
- }
1604
- else {
1605
- const redoBtn = document.getElementById('at-draw-redo-btn');
1606
- redoBtn.classList.remove('at_disabled');
1607
- }
1608
- console.log("undoCount", undoCount);
1609
- console.log("redoCount", redoCount);
1610
- }
1611
1616
  function handleVertexPlace(payload) {
1612
1617
  console.log("handleVertexPlace ==>", payload);
1613
1618
  if (isToolbarFeatureEnabled('roomCreation')) {
1614
- log.info("getDrawingMode()", getDrawingMode());
1615
- if (getDrawingMode() === 'window') {
1616
- log.info("current polygon", getCurrentPolygon());
1617
- }
1618
- if (getDrawingMode() === 'partition') {
1619
- // setCurrentPartitionData()
1620
- }
1621
- const undoBtn = document.getElementById('at-draw-undo-btn');
1622
- undoBtn.classList.remove('at_disabled');
1623
- const redoBtn = document.getElementById('at-draw-redo-btn');
1624
- redoBtn.classList.add('at_disabled');
1619
+ toggleUndoRedoButtons(partitionHistory.canUndo(), partitionHistory.canRedo());
1625
1620
  }
1626
1621
  if (isToolbarFeatureEnabled('pipe')) {
1627
1622
  pipeForm.setPipeVertices(payload.path);
@@ -2337,11 +2332,6 @@ function handleCancelPartition() {
2337
2332
  clearSelectedObject();
2338
2333
  clearFloorBaseHeight();
2339
2334
  toggleDisplayPane('at-cancel-room-form-btn');
2340
- const drawHistory = {
2341
- redoDrawActions: [],
2342
- undoDrawActions: [],
2343
- };
2344
- handleDrawHistory(drawHistory);
2345
2335
  }));
2346
2336
  }
2347
2337
  /**
@@ -3896,6 +3886,95 @@ function clearActivePane() {
3896
3886
  paneElement.style.display = 'none';
3897
3887
  }
3898
3888
  }
3889
+ function handlePreviewModalResize() {
3890
+ const modal = document.getElementById('at-preview-modal');
3891
+ const resizeHandles = document.querySelectorAll('.at_preview_modal-resize-handle');
3892
+ if (!modal || !resizeHandles.length)
3893
+ return;
3894
+ let isResizing = false;
3895
+ let currentHandle = null;
3896
+ let startX = 0;
3897
+ let startY = 0;
3898
+ let startWidth = 0;
3899
+ let startHeight = 0;
3900
+ let startLeft = 0;
3901
+ let startTop = 0;
3902
+ const minWidth = 400;
3903
+ const minHeight = 300;
3904
+ const maxWidth = window.innerWidth * 0.95;
3905
+ const maxHeight = window.innerHeight * 0.95;
3906
+ resizeHandles.forEach((handle) => {
3907
+ handle.addEventListener('mousedown', (e) => {
3908
+ e.preventDefault();
3909
+ e.stopPropagation();
3910
+ isResizing = true;
3911
+ currentHandle = handle;
3912
+ startX = e.clientX;
3913
+ startY = e.clientY;
3914
+ const rect = modal.getBoundingClientRect();
3915
+ startWidth = rect.width;
3916
+ startHeight = rect.height;
3917
+ startLeft = rect.left;
3918
+ startTop = rect.top;
3919
+ document.body.style.cursor = window.getComputedStyle(handle).cursor;
3920
+ document.body.style.userSelect = 'none';
3921
+ });
3922
+ });
3923
+ document.addEventListener('mousemove', (e) => {
3924
+ if (!isResizing || !currentHandle)
3925
+ return;
3926
+ const direction = currentHandle.getAttribute('data-resize-direction');
3927
+ const deltaX = e.clientX - startX;
3928
+ const deltaY = e.clientY - startY;
3929
+ let newWidth = startWidth;
3930
+ let newHeight = startHeight;
3931
+ let newLeft = startLeft;
3932
+ let newTop = startTop;
3933
+ // Handle horizontal resizing
3934
+ if (direction === null || direction === void 0 ? void 0 : direction.includes('right')) {
3935
+ newWidth = Math.max(minWidth, Math.min(maxWidth, startWidth + deltaX));
3936
+ // Don't change left position for right resize
3937
+ }
3938
+ else if (direction === null || direction === void 0 ? void 0 : direction.includes('left')) {
3939
+ const potentialWidth = startWidth - deltaX;
3940
+ if (potentialWidth >= minWidth && potentialWidth <= maxWidth) {
3941
+ newWidth = potentialWidth;
3942
+ newLeft = startLeft + deltaX;
3943
+ }
3944
+ }
3945
+ // Handle vertical resizing
3946
+ if (direction === null || direction === void 0 ? void 0 : direction.includes('bottom')) {
3947
+ newHeight = Math.max(minHeight, Math.min(maxHeight, startHeight + deltaY));
3948
+ }
3949
+ else if (direction === null || direction === void 0 ? void 0 : direction.includes('top')) {
3950
+ const potentialHeight = startHeight - deltaY;
3951
+ if (potentialHeight >= minHeight && potentialHeight <= maxHeight) {
3952
+ newHeight = potentialHeight;
3953
+ newTop = startTop + deltaY;
3954
+ }
3955
+ }
3956
+ // Apply new dimensions
3957
+ modal.style.width = `${newWidth}px`;
3958
+ modal.style.height = `${newHeight}px`;
3959
+ modal.style.maxWidth = `${newWidth}px`;
3960
+ modal.style.maxHeight = `${newHeight}px`;
3961
+ // For top/left resizing, we need to reposition the modal
3962
+ if ((direction === null || direction === void 0 ? void 0 : direction.includes('left')) || (direction === null || direction === void 0 ? void 0 : direction.includes('top'))) {
3963
+ modal.style.position = 'fixed';
3964
+ modal.style.left = `${newLeft}px`;
3965
+ modal.style.top = `${newTop}px`;
3966
+ modal.style.transform = 'none';
3967
+ }
3968
+ });
3969
+ document.addEventListener('mouseup', () => {
3970
+ if (isResizing) {
3971
+ isResizing = false;
3972
+ currentHandle = null;
3973
+ document.body.style.cursor = '';
3974
+ document.body.style.userSelect = '';
3975
+ }
3976
+ });
3977
+ }
3899
3978
  export {
3900
3979
  //state
3901
3980
  activeToolbarItem, activeActionItem, cancelModelPlacementPrompt, isCustomMapControlsVisible, pipeColor,
@@ -76,6 +76,7 @@ export declare class Vertice {
76
76
  texture: THREE.CanvasTexture;
77
77
  pointerSub: MpSdk.ISubscription;
78
78
  pointerIntersection: MpSdk.Pointer.Intersection;
79
+ cachedWallNormal: THREE.Vector3 | null;
79
80
  constructor(mpSdk: MpSdk);
80
81
  inputs: {
81
82
  index: any;
@@ -98,6 +99,7 @@ export declare class Vertice {
98
99
  'INTERACTION.HOVER': boolean;
99
100
  };
100
101
  onInputsUpdated: (prevInputs: any) => void;
102
+ calculateWallNormalFromVertices(): THREE.Vector3 | null;
101
103
  onEvent(eventType: any, data: any): void;
102
104
  onInit: () => void;
103
105
  renderVertice: (hovered?: boolean) => void;