architwin 1.13.10 → 1.13.12

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.
@@ -33,7 +33,7 @@ export class PipeList {
33
33
  <span class="mdi mdi-keyboard at_pull_left at_icon_hover ">
34
34
  ${getShortcutTooltipHTML()}
35
35
  </span>
36
- <span>${i18n.t('PipesMenu')}</span>
36
+ <span>${i18n.t('Pipes')}</span>
37
37
  </div>
38
38
  <div class="at_form_container ">
39
39
  <div class="at_field at_flex_column" style="${_pipeCategories ? '' : 'display: none;'}">
@@ -69,6 +69,7 @@ export class PipeList {
69
69
  createCollapseElement(categories, pipes) {
70
70
  const element = document.createElement('div');
71
71
  element.classList.add('at_collapse_container', 'at_h-responsive-304');
72
+ element.id = 'at-pipe-list-collapse';
72
73
  element.innerHTML = categories.length ? categories.sort((a, b) => new Date(a.created_on).getTime() - new Date(b.created_on).getTime()).map((category, index) => {
73
74
  var _a;
74
75
  return `
@@ -86,7 +87,7 @@ export class PipeList {
86
87
  <span class="mdi mdi-eye" id="at-view-btn-${COLLAPSE.HEADER}-${category.uuid}" data-type="${COLLAPSE.HEADER}" data-cy="at-pipe-type-view-btn" data-uuid="${category.uuid}"></span>
87
88
  </div>
88
89
  </div>
89
- <div class="at_collapsible_content at_secondary_azusa" id="${COLLAPSE.CONTENT_ID}">
90
+ <div class="at_collapsible_content at_secondary_azusa" id="${COLLAPSE.CONTENT_ID}-${category.uuid}" data-cy="at-collapsible-content-${category.uuid}">
90
91
  <div class="at_p-2">
91
92
  ${pipes != undefined && pipes.filter(pipe => pipe.category_uuid === category.uuid).length ?
92
93
  pipes
@@ -100,14 +101,14 @@ export class PipeList {
100
101
  <div class="at_locate_area_container at_flex at_justify_end at_gap_2" id="at-collapsible-${COLLAPSE.LIST}-${pipe.uuid}" data-uuid="${pipe.uuid}" data-type="${COLLAPSE.LIST}">
101
102
  <div id="at-locate-area-${COLLAPSE.LIST}-${pipe.uuid}" data-uuid="${pipe.uuid}" data-type="${COLLAPSE.LIST}">
102
103
  <span>${pipe.name.split(' ')[0] === 'Pipe' ? i18n.t('Pipe') + ' ' + pipe.name.split(' ')[1] : pipe.name}</span>
103
- <span class="mdi mdi-trash-can-outline at-pipe-filter-chevron" id="at-delete-btn-${COLLAPSE.LIST}-${pipe.uuid}" data-cy="at-pipe-delete-btn" data-type="${COLLAPSE.LIST}" data-uuid="${pipe.uuid}"></span>
104
+ <span class="mdi mdi-trash-can-outline at-pipe-filter-chevron" id="at-delete-btn-${COLLAPSE.LIST}-${pipe.uuid}" data-cy="at-pipe-delete-btn" data-type="${COLLAPSE.LIST}" data-uuid="${pipe.uuid}" data-categoryuuid="${category.uuid}"></span>
104
105
  <span class="mdi mdi-eye at-pipe-filter-chevron" id="at-view-btn-${COLLAPSE.LIST}-${pipe.uuid}" data-cy="at-pipe-view-btn" data-uuid="${pipe.uuid}" data-type="${COLLAPSE.LIST}"></span>
105
106
  </div>
106
107
  </div>
107
108
  `).join('')
108
109
  :
109
110
  `
110
- <div class="at_flex at_justify_center at_items_center at_flex_column">
111
+ <div class="at_flex at_justify_center at_items_center at_flex_column at_text_sm">
111
112
  <div style="white-space:nowrap"> ${i18n.t('NoPipesToDisplay')}</div>
112
113
  </div>
113
114
  `}
@@ -120,7 +121,7 @@ export class PipeList {
120
121
  : `
121
122
  <div class="at_h-responsive-304">
122
123
  <div class=" at_flex at_justify_center at_items_center at_flex_column at_h-full">
123
- <span class="mdi mdi-pipe-disconnected at_pipe_category at_text-xxl"></span>
124
+ <span class="mdi mdi-arrow-decision at_pipe_category at_text-xxl"></span>
124
125
  <div class="at_text_xs" style="white-space:nowrap"> ${i18n.t('NoPipesTypeToDisplay')}</div>
125
126
  </div>
126
127
  </div>
@@ -179,7 +180,6 @@ export class PipeList {
179
180
  const target = currentTarget;
180
181
  const uuid = target.dataset.uuid;
181
182
  const type = target.dataset.type;
182
- console.log("CLICKED");
183
183
  const pipe = type === COLLAPSE.HEADER
184
184
  ? _pipes.find(p => p.category_uuid === uuid)
185
185
  : _pipes.find(p => p.uuid === uuid);
@@ -198,7 +198,6 @@ export class PipeList {
198
198
  btn.addEventListener('click', (e) => __awaiter(this, void 0, void 0, function* () {
199
199
  const target = e.currentTarget;
200
200
  yield dispatchSpaceEvent(SPACE_EVENTS.PIPE_CATEGORY_ADD, {});
201
- console.log("CLICKED ADD CATEGORY =>", _selectedPipeCategory);
202
201
  this.form.setPipeTitle("AddPipeType");
203
202
  yield this.form.init(_selectedPipeCategory);
204
203
  yield toggleDisplayPane(target.id);
@@ -270,46 +269,61 @@ export class PipeList {
270
269
  }));
271
270
  });
272
271
  }
273
- //delete and dispose 3d objects
274
272
  delete() {
275
- document.querySelectorAll('[id^="at-delete-btn"]').forEach(el => {
276
- el.addEventListener('click', (e) => __awaiter(this, void 0, void 0, function* () {
277
- const target = e.currentTarget;
278
- const uuid = target.dataset.uuid;
279
- const type = target.dataset.type;
280
- toggleModal();
281
- setModalAction({
282
- title: `${i18n.t('DeletePipeCategory')}`,
283
- description: `${i18n.t('ConfirmDeletePipeCategory')}`,
284
- buttonLabel: `${i18n.t('YesDelete')}`
285
- }, () => {
286
- if (uuid) {
287
- if (type == COLLAPSE.HEADER) {
288
- dispatchSpaceEvent(SPACE_EVENTS.PIPE_CATEGORY_REMOVED, uuid);
289
- _pipes.filter(pipe => pipe.category_uuid == uuid).forEach(pipe => {
290
- const targetObj = _3DXObjects.find(obj => obj.object.uuid == pipe.uuid);
291
- if (targetObj) {
292
- disposeModel(targetObj);
293
- }
294
- });
295
- notyf.success(`${i18n.t('PipeCategoryDeletedSuccessfully')}`);
296
- toggleModal(false);
297
- }
298
- else {
299
- dispatchSpaceEvent(SPACE_EVENTS.PIPE_REMOVED, uuid);
300
- const targetObj = _3DXObjects.find(obj => obj.object.uuid == uuid);
301
- if (targetObj) {
302
- disposeModel(targetObj);
303
- }
304
- notyf.success(`${i18n.t('PipeDeletedSuccessfully')}`);
305
- toggleModal(false);
306
- }
307
- this.collapse.removeElement(uuid, type);
308
- }
309
- });
273
+ document.querySelectorAll('[id^="at-delete-btn"]').forEach(el => el.addEventListener('click', (e) => __awaiter(this, void 0, void 0, function* () {
274
+ const target = e.currentTarget;
275
+ const { uuid, type, categoryuuid } = target.dataset;
276
+ if (!uuid)
277
+ return;
278
+ const isHeader = type === COLLAPSE.HEADER;
279
+ const config = {
280
+ title: i18n.t(isHeader ? 'DeletePipeCategory' : 'DeletePipe'),
281
+ description: i18n.t(isHeader ? 'ConfirmDeletePipeCategory' : 'ConfirmDeletePipe'),
282
+ buttonLabel: i18n.t('YesDelete'),
283
+ };
284
+ toggleModal();
285
+ setModalAction(config, () => __awaiter(this, void 0, void 0, function* () {
286
+ this.handleDisposePipeObjectModel(uuid, isHeader);
287
+ dispatchSpaceEvent(isHeader ? SPACE_EVENTS.PIPE_CATEGORY_REMOVED : SPACE_EVENTS.PIPE_REMOVED, uuid);
288
+ yield waitForChange(() => _pipeCategories, () => _pipes, { interval: 300, timeout: 10000 });
289
+ isHeader ? this.handleCategoryDelete() : this.handlePipeDelete(categoryuuid);
290
+ toggleModal(false);
291
+ this.collapse.removeElement(uuid, type);
310
292
  }));
293
+ })));
294
+ }
295
+ handleDisposePipeObjectModel(uuid, isHeader) {
296
+ (isHeader
297
+ ? _pipes.filter(p => p.category_uuid === uuid).map(p => p.uuid)
298
+ : [uuid]).forEach(id => {
299
+ const obj = _3DXObjects.find(o => o.object.uuid === id);
300
+ if (obj)
301
+ disposeModel(obj);
311
302
  });
312
303
  }
304
+ handleCategoryDelete() {
305
+ if (_pipeCategories.length == 0) {
306
+ document.getElementById('at-pipe-list-collapse').innerHTML = `
307
+ <div class="at_h-responsive-304">
308
+ <div class="at_flex at_justify_center at_items_center at_flex_column at_h-full">
309
+ <span class="mdi mdi-arrow-decision at_pipe_category at_text-xxl"></span>
310
+ <div class="at_text_xs" style="white-space:nowrap">${i18n.t('NoPipesTypeToDisplay')}</div>
311
+ </div>
312
+ </div>`;
313
+ }
314
+ notyf.success(i18n.t('PipeCategoryDeletedSuccessfully'));
315
+ }
316
+ handlePipeDelete(categoryuuid) {
317
+ if (!_pipes.some(p => p.category_uuid === categoryuuid)) {
318
+ document.getElementById(`${COLLAPSE.CONTENT_ID}-${categoryuuid}`).innerHTML = `
319
+ <div class="at_flex at_justify_center at_items_center at_flex_column">
320
+ <div class="at_p-2 at_text_sm">
321
+ <div style="white-space:nowrap">${i18n.t('NoPipesToDisplay')}</div>
322
+ </div>
323
+ </div>`;
324
+ }
325
+ notyf.success(i18n.t('PipeDeletedSuccessfully'));
326
+ }
313
327
  //render pipe path 3D objects
314
328
  renderPipePaths() {
315
329
  // initialize to empty
@@ -7,7 +7,9 @@ export declare function renderOfflineUserRow(user: ScreenShareUser): HTMLTableRo
7
7
  export declare function handleClickEventUserRow(): void;
8
8
  export declare function renderSharingSpaceDetail(user: ScreenShareSessionUser): void;
9
9
  export declare function handleClickEventBackToUserListLink(): void;
10
- export declare function renderScreenShareRequestModal(request: ScreenShareRequest): void;
10
+ export declare function renderScreenShareLeaveConfirmationModal(isUserHost: boolean): void;
11
+ export declare function handleModalCancelButton(): void;
12
+ export declare function handleModalLeaveButton(isHost: boolean): void;
11
13
  export declare function handleInputEventSelectPointerSettings(): void;
12
14
  export declare function handleClickEventEndSessionBtn(): void;
13
15
  export declare function handleScreenShareUsersUpdated(payload: {
@@ -1,4 +1,4 @@
1
- import { _currentSpace, dispatchSpaceEvent } from '../../../architwin';
1
+ import { _currentSpace, _screenSharingHostUser, dispatchSpaceEvent } from '../../../architwin';
2
2
  import { SPACE_EVENTS } from '../../../types';
3
3
  import i18n from './i18n';
4
4
  let _spaceData = null;
@@ -25,7 +25,7 @@ export function renderScreenSharePane() {
25
25
  <table id="at-user-list-table">
26
26
  </table>
27
27
  </div>
28
- <button type="button" id="at-screen-share-end-session-btn" class="at_screen_share_end_session_btn"
28
+ <button type="button" id="at-screen-share-end-session-btn" class="at_SCREEN_SHARE_HOST_END_SESSION_btn"
29
29
  style="display:none;">
30
30
  ${i18n.t('EndSession')}
31
31
  </button>
@@ -36,19 +36,22 @@ export function renderScreenSharePane() {
36
36
  }
37
37
  export function renderUsersList(users) {
38
38
  _onDisplayComponent = 'USER_LIST';
39
- _screenShareUsers = sortUsersByStatus(users);
39
+ _screenShareUsers = [];
40
+ const _offlineUsers = users.filter(u => u.onlineStatus === 'offline');
41
+ const _notOfflineUsers = users.filter(u => u.onlineStatus !== 'offline');
42
+ _screenShareUsers = [..._notOfflineUsers, ..._offlineUsers];
40
43
  const usersListContainer = document.getElementById("at-user-list-table");
41
44
  if (!usersListContainer) {
42
45
  console.error("usersListContainer does not exist in DOM");
43
46
  return;
44
47
  }
45
48
  if (users.length <= 0) {
46
- console.log("No tags to load");
49
+ console.log("No users to load");
47
50
  usersListContainer.innerHTML = ``;
48
51
  return;
49
52
  }
50
53
  usersListContainer.innerHTML = '';
51
- users.forEach(user => {
54
+ _screenShareUsers.forEach(user => {
52
55
  const row = user.onlineStatus !== 'offline' ? renderOnlineUserRow(user) : renderOfflineUserRow(user);
53
56
  usersListContainer.appendChild(row);
54
57
  });
@@ -63,19 +66,19 @@ export function renderOnlineUserRow(user) {
63
66
  const iconOrSharingText = user.onlineStatus === 'in_session'
64
67
  ? `
65
68
  <div class="at_flex at_items_center at_justify_center">
66
- <p>In Session</p>
69
+ <p>${i18n.t('InSession')}</p>
67
70
  </div>
68
71
  `
69
72
  : user.onlineStatus === 'pending'
70
73
  ? `
71
74
  <div class="at_flex at_items_center at_justify_center">
72
- <p>Pending</p>
75
+ <p>${i18n.t('Pending')}</p>
73
76
  </div>
74
77
  `
75
78
  : user.onlineStatus === 'sharing'
76
79
  ? `
77
80
  <div class="at_flex at_items_center at_justify_center">
78
- <p>Now Sharing</p>
81
+ <p>${i18n.t('NowSharing')}</p>
79
82
  </div>
80
83
  `
81
84
  : `
@@ -123,11 +126,11 @@ export function handleClickEventUserRow() {
123
126
  _screenShareUser = user;
124
127
  if (user.onlineStatus === 'offline')
125
128
  return;
126
- if (user.onlineStatus === 'sharing')
129
+ if (user.onlineStatus === 'in_session')
127
130
  return;
128
131
  if (user.onlineStatus === 'pending')
129
132
  return;
130
- if (user.onlineStatus === 'in_session') {
133
+ if (user.onlineStatus === 'sharing') {
131
134
  if (!_screenShareSession) {
132
135
  return;
133
136
  }
@@ -191,7 +194,7 @@ export function renderSharingSpaceDetail(user) {
191
194
  <span class="mdi mdi-arrow-left"></span>
192
195
  <p> ${i18n.t('BackToUserList')}</p>
193
196
  </div>
194
- <button type="button" id="at-screen-share-end-session-btn" class="at_screen_share_end_session_btn">
197
+ <button type="button" id="at-screen-share-end-session-btn" class="at_SCREEN_SHARE_HOST_END_SESSION_btn">
195
198
  ${i18n.t('EndSession')}
196
199
  </button>
197
200
  </div>
@@ -225,23 +228,31 @@ function recreateUserListContainer() {
225
228
  <table id="at-user-list-table">
226
229
  </table>
227
230
  </div>
228
- <button type="button" id="at-screen-share-end-session-btn" class="at_screen_share_end_session_btn"
231
+ <button type="button" id="at-screen-share-end-session-btn" class="at_button at_ghost at_w-full"
229
232
  style="display:${endSessionBtnVisibility};">
230
- ${i18n.t('End Session')}
233
+ ${i18n.t('EndSession')}
231
234
  </button>
232
235
  `;
233
236
  }
234
- export function renderScreenShareRequestModal(request) {
237
+ export function renderScreenShareLeaveConfirmationModal(isUserHost) {
235
238
  _onDisplayComponent = 'SCREEN_SHARE_REQUEST_MODAL';
239
+ // remove any existing modal first
240
+ const existingModal = document.getElementById('at-screen-share-request-modal');
241
+ if (existingModal) {
242
+ existingModal.remove();
243
+ }
236
244
  const element = document.createElement('dialog');
237
245
  element.setAttribute('id', 'at-screen-share-request-modal');
238
246
  element.classList.add('at_screen_share_request_modal');
239
247
  element.innerHTML = `
240
248
  <div class="at_screen_share_request_modal_content at_flex at_flex_column at_justify_center at_items_center">
241
- <div class="at_screen_share_icon mdi mdi-monitor-multiple"></div>
242
- <h1 class="at_screen_share_request_message">${i18n.t('ScreenShareRequestModalMessage')}</h1>
243
- <p class="at_screen_share_request_sub_message"> ${i18n.t('ScreenShareRequestModalSubMessage')} <strong>${request.user.name}</strong></p>
244
- <button type="button" id="at-screen-share-request-btn" class="at_screen_share_cancel_request_btn">${i18n.t('CancelRequest')}</button>
249
+ <div class="at_screen_share_icon mdi mdi-logout-variant"></div>
250
+ <h1 class="at_screen_share_request_message">${i18n.t('ConfirmLeaveSession')}</h1>
251
+ <p class="at_screen_share_request_sub_message"> ${i18n.t('ConfirmLeaveSessionReminder')}</p>
252
+ <div class="at_flex at_flex_row at_gap_2rem">
253
+ <button type="button" id="at-screen-share-leave-confirmation-cancel-btn" class="at_screen_share_leave_confirmation_cancel_btn">${i18n.t('Cancel')}</button>
254
+ <button type="button" id="at-screen-share-leave-confirmation-leave-btn" class="at_screen_share_leave_confirmation_leave_btn">${i18n.t('Leave')}</button>
255
+ </div>
245
256
  </div>
246
257
  `;
247
258
  // disabled modal dismiss via Esc key
@@ -255,21 +266,61 @@ export function renderScreenShareRequestModal(request) {
255
266
  element.addEventListener('cancel', (event) => {
256
267
  event.preventDefault();
257
268
  });
258
- handleScreenShareCancelRequest(element, request);
259
269
  document.body.appendChild(element);
260
270
  element.showModal();
271
+ // attach button event handlers after modal is created
272
+ handleModalCancelButton();
273
+ handleModalLeaveButton(isUserHost);
261
274
  }
262
- function handleScreenShareCancelRequest(dialogElement, request) {
263
- var _a;
264
- if (dialogElement) {
265
- (_a = dialogElement.querySelector('#at-screen-share-request-btn')) === null || _a === void 0 ? void 0 : _a.addEventListener('click', () => {
266
- const cancelRequest = Object.assign(Object.assign({}, request), { status: 'canceled' });
267
- dispatchSpaceEvent(SPACE_EVENTS.SCREEN_SHARE_CANCEL_REQUEST, cancelRequest);
268
- dialogElement.close();
269
- dialogElement.remove();
270
- _onDisplayComponent = 'USER_LIST';
271
- });
272
- }
275
+ export function handleModalCancelButton() {
276
+ const cancelBtn = document.getElementById('at-screen-share-leave-confirmation-cancel-btn');
277
+ if (!cancelBtn)
278
+ return;
279
+ // Check if listener already exists
280
+ if (cancelBtn.dataset.listenerAttached === 'true')
281
+ return;
282
+ cancelBtn.addEventListener('click', () => {
283
+ console.log('Cancel button clicked');
284
+ // Close the modal
285
+ const modal = document.getElementById('at-screen-share-request-modal');
286
+ if (modal) {
287
+ modal.close();
288
+ modal.remove();
289
+ }
290
+ // Reset display component state if needed
291
+ _onDisplayComponent = null;
292
+ });
293
+ cancelBtn.dataset.listenerAttached = 'true';
294
+ }
295
+ export function handleModalLeaveButton(isHost) {
296
+ const leaveBtn = document.getElementById('at-screen-share-leave-confirmation-leave-btn');
297
+ if (!leaveBtn)
298
+ return;
299
+ // Check if listener already exists
300
+ if (leaveBtn.dataset.listenerAttached === 'true')
301
+ return;
302
+ leaveBtn.addEventListener('click', () => {
303
+ console.log('Leave button clicked');
304
+ // Close the modal first
305
+ const modal = document.getElementById('at-screen-share-request-modal');
306
+ if (modal) {
307
+ modal.close();
308
+ modal.remove();
309
+ }
310
+ if (isHost) {
311
+ // execute leave session logic
312
+ removeScreenShareSessionData();
313
+ recreateUserListContainer();
314
+ renderUsersList(_screenShareUsers);
315
+ dispatchSpaceEvent(SPACE_EVENTS.SCREEN_SHARE_HOST_END_SESSION, handleScreenShareEndSessionEvent);
316
+ }
317
+ else {
318
+ dispatchSpaceEvent(SPACE_EVENTS.SCREEN_SHARE_GUEST_LEAVE_SESSION, _screenSharingHostUser);
319
+ }
320
+ // Reset display component state
321
+ _onDisplayComponent = null;
322
+ });
323
+ leaveBtn.dataset.listenerAttached = 'true';
273
324
  }
274
325
  export function handleInputEventSelectPointerSettings() {
275
326
  const select = document.getElementById('at_select_screen_share_pointer');
@@ -284,15 +335,16 @@ export function handleInputEventSelectPointerSettings() {
284
335
  }
285
336
  export function handleClickEventEndSessionBtn() {
286
337
  const button = document.getElementById('at-screen-share-end-session-btn');
287
- if (button) {
288
- button.addEventListener('click', () => {
289
- // internal logic end session
290
- removeScreenShareSessionData();
291
- recreateUserListContainer();
292
- renderUsersList(_screenShareUsers);
293
- dispatchSpaceEvent(SPACE_EVENTS.SCREEN_SHARE_END_SESSION, handleScreenShareEndSessionEvent);
294
- });
295
- }
338
+ if (!button)
339
+ return;
340
+ // check if listener already exists by looking for our marker
341
+ if (button.dataset.listenerAttached === 'true')
342
+ return;
343
+ button.addEventListener('click', () => {
344
+ renderScreenShareLeaveConfirmationModal(true);
345
+ });
346
+ // mark that listener is attached
347
+ button.dataset.listenerAttached = 'true';
296
348
  }
297
349
  export function handleScreenShareUsersUpdated(payload) {
298
350
  _spaceData = payload.space_data;
@@ -25,7 +25,7 @@ export function renderSpaceUserListPane() {
25
25
  id="at-user-pane-end-session-btn"
26
26
  data-cy="at-user-pane-end-session-btn"
27
27
  target-pane="at-add-object-pane">
28
- ${i18n.t('End Session')}
28
+ ${i18n.t('EndSession')}
29
29
  </div>
30
30
  </div>
31
31
 
@@ -7,7 +7,7 @@ export function renderViewingRemoteSpace() {
7
7
  element.setAttribute('data-cy', 'at-viewing-remote-space-pane');
8
8
  element.innerHTML = `
9
9
  <div class="at_panel_header">
10
- <span>${i18n.t('Viewing Remote Space')}</span>
10
+ <span>${i18n.t('ViewingRemoteSpace')}</span>
11
11
  </div>
12
12
 
13
13
  <div id="at-sharing-user-container" >
@@ -15,10 +15,10 @@ export function renderViewingRemoteSpace() {
15
15
 
16
16
  <div class="at_button_row at_justify_center">
17
17
  <div
18
- class="at_button at_ghost at_bg_red_600 at_w-full"
18
+ class="at_button at_ghost at_w-full"
19
19
  id="at-user-leave-session-btn"
20
20
  data-cy="at-user-leave-session-btn">
21
- ${i18n.t('Leave Session')}
21
+ ${i18n.t('LeaveSession')}
22
22
  </div>
23
23
  </div>
24
24
  `;
@@ -55,7 +55,7 @@ export function renderRemoteSpaceViewing(user) {
55
55
  const statusText = document.createElement('div');
56
56
  statusText.className = 'at_text_sm at_text_white';
57
57
  statusText.innerHTML = `
58
- ${i18n.t('Is sharing their space')} ${(_currentSpace === null || _currentSpace === void 0 ? void 0 : _currentSpace.name) || i18n.t('SPACE_NAME')} ${i18n.t('to you')}
58
+ ${i18n.t('IsSharingTheirSpace')} ${(_currentSpace === null || _currentSpace === void 0 ? void 0 : _currentSpace.name) || i18n.t('SPACE_NAME')} ${i18n.t('ToYou')}
59
59
  `;
60
60
  infoWrapper.appendChild(userNameEl);
61
61
  infoWrapper.appendChild(statusText);
@@ -77,6 +77,6 @@ export function renderRemoteSpaceViewing(user) {
77
77
  // === Instructional Text ===
78
78
  const instruction = document.createElement('div');
79
79
  instruction.className = 'at_text_xs at_text_center at_text_white at_opacity_80 at_mb_6';
80
- instruction.textContent = i18n.t('During a remote space sharing session, you cannot navigate around the space, only your host has control during the session');
80
+ instruction.textContent = i18n.t('ViewingInstructions');
81
81
  container.appendChild(instruction);
82
82
  }
@@ -19,7 +19,7 @@ import { renderObjectCard } from "./components/toolbar/card";
19
19
  import { toggleModelControl, getCoordinateValues, showCurrentCoordinateValue, handleModelControlInputs, setSelectedObjectCoordinateSystem, getSelectedObjectCoordinateSystem, getCurrentTransformationValues, setCurrentTransformationValues, getTransformValues, clearCurrentTransformationValues } from "./components/toolbar/modelControlsPane";
20
20
  import { attachTagMedia, handleTagPlacerCreated, cancelMoveTag } from "../tag";
21
21
  import i18n from './components/toolbar/i18n';
22
- import { isValidUrl, debounce, isElementVisible, extractUUID, showLoader } from "../utils";
22
+ import { isValidUrl, debounce, isElementVisible, extractUUID, showLoader, isVec3Equal, isQuatEqual } from "../utils";
23
23
  import log from 'loglevel';
24
24
  import * as minimap from '../minimap';
25
25
  import { clearActiveThemeCard, getSelectedTheme } from "./components/toolbar/themePane";
@@ -1265,16 +1265,6 @@ function handleConfirmTransform() {
1265
1265
  const selected = getSelectedObject();
1266
1266
  if (transform) {
1267
1267
  setObjectTransformation(selected.node, transform);
1268
- //clearCoordinateInputs()
1269
- //Add to the action history so it can be reverse with undo or redo
1270
- const currentTransform = JSON.stringify(transform);
1271
- actionHistory.push(currentTransform);
1272
- //@ts-expect-error
1273
- transformHistory.addAction(selected.object.id, transform.object_position, transform.object_rotation, transform.object_scale);
1274
- if (_mpConfig.toolbarConfig) {
1275
- toggleActionBarButtons('at-redo-action-btn', transformHistory.canRedo(selected.object.id));
1276
- toggleActionBarButtons('at-undo-action-btn', transformHistory.canUndo(selected.object.id));
1277
- }
1278
1268
  //Emit a drag end event so app side can listen
1279
1269
  const payload = selected.object;
1280
1270
  payload.object_position = transform.object_position;
@@ -1314,6 +1304,24 @@ function handleConfirmTransform() {
1314
1304
  activeElement.classList.remove("at_sidebar_button_icon_active");
1315
1305
  removeTransformControls();
1316
1306
  toggleModelControl(false);
1307
+ // Add to the action history so it can be reversed with undo or redo
1308
+ // Get the most recent action in the transformHistory
1309
+ const { object_position: lastPos, object_rotation: lastRot, object_scale: lastScale } = JSON.parse(transformHistory.getTransformHistory(selected.object.id).at(transformHistory.getCurrentIndex(selected.object.id)));
1310
+ const isPositionEqual = isVec3Equal(selected.node.position, lastPos);
1311
+ // @ts-expect-error
1312
+ const isRotationEqual = isQuatEqual(selected.node.obj3D.rotation, lastRot);
1313
+ const isScaleEqual = isVec3Equal(selected.node.scale, lastScale);
1314
+ // Only push actionHistory when the previous action is not equal to the current action
1315
+ if (!isPositionEqual || !isRotationEqual || !isScaleEqual) {
1316
+ const currentTransform = JSON.stringify(transform);
1317
+ actionHistory.push(currentTransform);
1318
+ // @ts-expect-error
1319
+ transformHistory.addAction(selected.object.id, selected.node.position, selected.node.obj3D.rotation, selected.node.scale);
1320
+ if (_mpConfig.toolbarConfig) {
1321
+ toggleActionBarButtons('at-redo-action-btn', transformHistory.canRedo(selected.object.id));
1322
+ toggleActionBarButtons('at-undo-action-btn', transformHistory.canUndo(selected.object.id));
1323
+ }
1324
+ }
1317
1325
  }
1318
1326
  });
1319
1327
  }
@@ -325,7 +325,8 @@ export class TubeLine {
325
325
  }
326
326
  }
327
327
  onDestroy() {
328
- this.texture.dispose();
328
+ var _a;
329
+ (_a = this.texture) === null || _a === void 0 ? void 0 : _a.dispose();
329
330
  if (this.panel) {
330
331
  this.panel.dispose();
331
332
  //@ts-expect-error
package/lib/utils.d.ts CHANGED
@@ -91,3 +91,5 @@ export declare function convertMeasurement(value: any, fromUnit: any, toUnit: an
91
91
  export declare function showLoader(visible: boolean): void;
92
92
  export declare function percentToScale(percentValue: Vector3): Vector3;
93
93
  export declare function scaleToPercent(scaleValue: Vector3): Vector3;
94
+ export declare function isVec3Equal(a: any, b: any): boolean;
95
+ export declare function isQuatEqual(a: any, b: any): boolean;
package/lib/utils.js CHANGED
@@ -449,3 +449,10 @@ export function scaleToPercent(scaleValue) {
449
449
  z: parseFloat((clampMin(scaleValue.z) * 100).toFixed(2)),
450
450
  };
451
451
  }
452
+ // Helper for comparing {x, y, z}
453
+ export function isVec3Equal(a, b) {
454
+ return a.x.toFixed(3) === b.x.toFixed(3) && a.y.toFixed(3) === b.y.toFixed(3) && a.z.toFixed(3) === b.z.toFixed(3);
455
+ }
456
+ export function isQuatEqual(a, b) {
457
+ return a._x.toFixed(3) === b._x.toFixed(3) && a._y.toFixed(3) === b._y.toFixed(3) && a._z.toFixed(3) === b._z.toFixed(3);
458
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "architwin",
3
- "version": "1.13.10",
3
+ "version": "1.13.12",
4
4
  "description": "ArchiTwin Library for Matterport",
5
5
  "main": "./lib/architwin.js",
6
6
  "types": "./lib/architwin.d.ts",