architwin 1.14.6 → 1.14.7

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.
@@ -20,3 +20,4 @@ export declare function handleScreenShareEndSessionEvent(): void;
20
20
  export declare function handleScreenShareBackUserListPane(): void;
21
21
  export declare function handleScreenShareAcceptRequest(payload: ScreenShareRequest): void;
22
22
  export declare function removeScreenShareSessionData(): void;
23
+ export declare function handleScreenShareResponsiveChanges(): void;
@@ -1,6 +1,7 @@
1
1
  import { _currentSpace, _screenSharingHostUser, dispatchSpaceEvent } from '../../../architwin';
2
2
  import { SPACE_EVENTS } from '../../../types';
3
3
  import i18n from './i18n';
4
+ import { isMobileMode } from '../../helpers';
4
5
  let _spaceData = null;
5
6
  let _currentUser = { id: 'host_user', name: 'host_user', onlineStatus: 'online' };
6
7
  let _screenShareUsers = [];
@@ -18,17 +19,22 @@ export function renderScreenSharePane() {
18
19
  element.innerHTML = `
19
20
  <div class="at_flex at_flex_column">
20
21
  <div id="at-screen-share-pane-content" class="at_form_container">
21
- <div class="at_flex at_justify_start">
22
- <span class="at_bolder at_text_base">${i18n.t('Users')}</span>
22
+ <div id="at-screen-share-pane-sub-content">
23
+ <div class="at_flex at_justify_start">
24
+ <span class="at_bolder at_text_base">${i18n.t('Users')}</span>
25
+ </div>
26
+ <div id="at-user-list-container" class="at_disable_hover_users_list at_scrollable_container">
27
+ <table id="at-user-list-table">
28
+ </table>
29
+ </div>
23
30
  </div>
24
- <div id="at-user-list-container" class="at_disable_hover_users_list at_scrollable_container">
25
- <table id="at-user-list-table">
26
- </table>
27
- </div>
28
- <button type="button" id="at-screen-share-end-session-btn" class="at_SCREEN_SHARE_HOST_END_SESSION_btn"
29
- style="display:none;">
31
+ <div id="at-screen-share-end-session-btn-container" class="at_w-full">
32
+ <button type="button" id="at-screen-share-end-session-btn" class="at_end_session_button"
33
+ style="display:none;" data-cy="at-host-leave-session-btn">
30
34
  ${i18n.t('EndSession')}
31
35
  </button>
36
+ </div>
37
+
32
38
  </div>
33
39
  </div>
34
40
  `;
@@ -57,6 +63,7 @@ export function renderUsersList(users) {
57
63
  });
58
64
  handleClickEventUserRow();
59
65
  handleClickEventEndSessionBtn();
66
+ handleScreenShareResponsiveChanges();
60
67
  }
61
68
  export function renderOnlineUserRow(user) {
62
69
  const element = document.createElement("tr");
@@ -194,9 +201,11 @@ export function renderSharingSpaceDetail(user) {
194
201
  <span class="mdi mdi-arrow-left"></span>
195
202
  <p> ${i18n.t('BackToUserList')}</p>
196
203
  </div>
197
- <button type="button" id="at-screen-share-end-session-btn" class="at_SCREEN_SHARE_HOST_END_SESSION_btn">
204
+ <div id="at-screen-share-end-session-btn-container" class="at_w-full">
205
+ <button type="button" id="at-screen-share-end-session-btn" class="at_end_session_button">
198
206
  ${i18n.t('EndSession')}
199
207
  </button>
208
+ </div>
200
209
  </div>
201
210
  </div>
202
211
  `;
@@ -221,17 +230,21 @@ function recreateUserListContainer() {
221
230
  usersPaneContent.classList.add('at_form_container');
222
231
  const endSessionBtnVisibility = _screenShareSession ? 'block' : 'none';
223
232
  usersPaneContent.innerHTML = `
224
- <div class="at_flex at_justify_start">
233
+ <div id="at-screen-share-pane-sub-content">
234
+ <div id="at-user-list-title" class="at_flex at_justify_start">
225
235
  <span class="at_bolder at_text_base">${i18n.t('Users')}</span>
226
236
  </div>
227
237
  <div id="at-user-list-container" class="at_disable_hover_users_list at_scrollable_container">
228
238
  <table id="at-user-list-table">
229
239
  </table>
230
240
  </div>
241
+ </div>
242
+
231
243
  <button type="button" id="at-screen-share-end-session-btn" class="at_button at_ghost at_w-full"
232
244
  style="display:${endSessionBtnVisibility};">
233
245
  ${i18n.t('EndSession')}
234
246
  </button>
247
+
235
248
  `;
236
249
  }
237
250
  export function renderScreenShareLeaveConfirmationModal(isUserHost) {
@@ -433,3 +446,27 @@ const updateScreenSharePointer = (isOn) => {
433
446
  }
434
447
  select.selectedIndex = isOn ? 0 : 1;
435
448
  };
449
+ export function handleScreenShareResponsiveChanges() {
450
+ const element = document.getElementById("at-screen-share-pane");
451
+ if (!element)
452
+ return;
453
+ const isMobile = isMobileMode();
454
+ element.classList.toggle("at_w-13", !isMobile);
455
+ element.classList.toggle("at_w-responsive-61", isMobile);
456
+ const button = element.querySelector("#at-screen-share-end-session-btn");
457
+ if (button) {
458
+ button.className = isMobile ? "at_end_session_button-mobile" : "at_end_session_button";
459
+ button.innerHTML = isMobile ? `<span class="mdi mdi-power"></span>` : i18n.t("EndSession");
460
+ const content = element.querySelector("#at-screen-share-pane-sub-content");
461
+ if (content) {
462
+ const isButtonVisible = window.getComputedStyle(button).display === "block";
463
+ const shouldHideContent = isMobile && isButtonVisible;
464
+ content.classList.toggle("at_hidden", shouldHideContent);
465
+ element.classList.toggle("at_bg_transparent", shouldHideContent);
466
+ }
467
+ const container = element.querySelector("#at-screen-share-end-session-btn-container");
468
+ if (container) {
469
+ container.classList.toggle("at_display_flex_end", isMobile);
470
+ }
471
+ }
472
+ }
@@ -5,3 +5,4 @@ export declare function renderViewingRemoteSpace(): HTMLElement;
5
5
  * @param user The user who is currently sharing their screen
6
6
  */
7
7
  export declare function renderRemoteSpaceViewing(user: ScreenShareUser): void;
8
+ export declare function handleRemoteViewResponsiveChanges(): void;
@@ -1,5 +1,6 @@
1
1
  import { _currentSpace } from "../../../architwin";
2
2
  import i18n from './i18n';
3
+ import { isMobileMode } from "../../helpers";
3
4
  export function renderViewingRemoteSpace() {
4
5
  const element = document.createElement('div');
5
6
  element.classList.add('at_container', 'at_w-14', 'at_h-full', 'at_p-5');
@@ -12,14 +13,10 @@ export function renderViewingRemoteSpace() {
12
13
 
13
14
  <div id="at-sharing-user-container" >
14
15
  </div>
15
-
16
- <div class="at_button_row at_justify_center">
17
- <div
18
- class="at_button at_ghost at_w-full"
19
- id="at-user-leave-session-btn"
20
- data-cy="at-user-leave-session-btn">
21
- ${i18n.t('LeaveSession')}
22
- </div>
16
+ <div id="at-user-leave-session-btn-container" class="at_w-full">
17
+ <button id="at-user-leave-session-btn" type="button" class="at_end_session_button at_text-xxl at_p-2 at_w-full" data-cy="at-user-leave-session-btn">
18
+ ${i18n.t('LeaveSession')}
19
+ </button>
23
20
  </div>
24
21
  `;
25
22
  return element;
@@ -79,4 +76,27 @@ export function renderRemoteSpaceViewing(user) {
79
76
  instruction.className = 'at_text_xs at_text_center at_text_white at_opacity_80 at_mb_6';
80
77
  instruction.textContent = i18n.t('ViewingInstructions');
81
78
  container.appendChild(instruction);
79
+ handleRemoteViewResponsiveChanges();
80
+ }
81
+ export function handleRemoteViewResponsiveChanges() {
82
+ const element = document.getElementById("at-viewing-remote-space-pane");
83
+ if (!element)
84
+ return;
85
+ const isMobile = isMobileMode();
86
+ const content = element.querySelector("#at-sharing-user-container");
87
+ element.classList.toggle("at_w-14", !isMobile);
88
+ element.classList.toggle("at_w-screen", isMobile);
89
+ element.classList.toggle("at_bg_transparent", isMobile);
90
+ if (content) {
91
+ content.classList.toggle("at_hidden", isMobile);
92
+ }
93
+ const button = element.querySelector("#at-user-leave-session-btn");
94
+ if (button) {
95
+ button.className = isMobile ? "at_end_session_button-mobile" : "at_end_session_button";
96
+ button.innerHTML = isMobile ? `<span class="mdi mdi-power"></span>` : i18n.t("EndSession");
97
+ }
98
+ const container = element.querySelector("#at-user-leave-session-btn-container");
99
+ if (container) {
100
+ container.classList.toggle("at_display_flex_end", isMobile);
101
+ }
82
102
  }
@@ -30,11 +30,11 @@ import { getBasepointCalibrateBpCoordinateValues, getBasepointCalibrateMpCoordin
30
30
  import { toggleGeneralMapOptions, initGeneralSelectedMap, getSelectedMapOption } from './components/toolbar/generalSettingsMenuPane';
31
31
  import { searchTagList, setSearchTagTerm, searchClearfield, getSearchTagTerm, sortTags, updateSelectedTagSortOption, resetSelectedTagSortOption } from './components/toolbar/tagListPane';
32
32
  import { renderUserRows } from "./components/toolbar/spaceUserListPane";
33
- import { renderRemoteSpaceViewing } from "./components/toolbar/viewingRemoteSpace";
33
+ import { handleRemoteViewResponsiveChanges, renderRemoteSpaceViewing } from "./components/toolbar/viewingRemoteSpace";
34
34
  import { PipeList } from "./components/toolbar/pipeListPane";
35
35
  import { PipeForm } from "./components/toolbar/pipeFormPane";
36
36
  import { unsendComment, timedoutComment, getTheseTagMessages } from './components/toolbar/tagMessagingPane';
37
- import { handleScreenShareAcceptRequest, handleScreenShareBackUserListPane, handleScreenShareEndSessionEvent, handleScreenShareUsersUpdated, renderScreenShareLeaveConfirmationModal } from "./components/toolbar/screenSharePane";
37
+ import { handleScreenShareResponsiveChanges, handleScreenShareAcceptRequest, handleScreenShareBackUserListPane, handleScreenShareEndSessionEvent, handleScreenShareUsersUpdated, renderScreenShareLeaveConfirmationModal } from "./components/toolbar/screenSharePane";
38
38
  const pipeList = new PipeList();
39
39
  const pipeForm = new PipeForm();
40
40
  let activeToolbarItem, activeActionItem, activePane, activeActionPane, cancelTagPlacementPrompt, cancelModelPlacementPrompt;
@@ -452,8 +452,15 @@ function setupIndividualEventListeners() {
452
452
  handleClickEventInObjectSortOption();
453
453
  handlePipeForm();
454
454
  handlePipeList();
455
+ handleResponsiveChanges();
455
456
  }
456
457
  //================ OBJECT EVENT HANDLERS ===============//s
458
+ function handleResponsiveChanges() {
459
+ window.addEventListener("resize", () => {
460
+ handleScreenShareResponsiveChanges();
461
+ handleRemoteViewResponsiveChanges();
462
+ });
463
+ }
457
464
  function handlePipeCategory(payload) {
458
465
  return __awaiter(this, void 0, void 0, function* () {
459
466
  console.log("HANDLE CATEGORY =>", payload);
@@ -13,3 +13,4 @@ export declare function waitForChange<T1, T2>(getter1: () => T1, getter2: () =>
13
13
  * @param key The key of the target object to update
14
14
  */
15
15
  export declare function observeInputToUpdate(input: HTMLInputElement, getTarget: () => Record<string, any> | undefined, key: string): void;
16
+ export declare function isMobileMode(): boolean;
@@ -47,3 +47,11 @@ export function observeInputToUpdate(input, getTarget, key) {
47
47
  input.addEventListener('input', update);
48
48
  console.log("observer ==>", input);
49
49
  }
50
+ export function isMobileMode() {
51
+ // Detect by screen size
52
+ const isSmallScreen = window.innerWidth <= 768; // typical mobile breakpoint
53
+ // Detect by user agent
54
+ const ua = navigator.userAgent.toLowerCase();
55
+ const isMobileDevice = /iphone|ipad|android|mobile/.test(ua);
56
+ return isSmallScreen || isMobileDevice;
57
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "architwin",
3
- "version": "1.14.6",
3
+ "version": "1.14.7",
4
4
  "description": "ArchiTwin Library for Matterport",
5
5
  "main": "./lib/architwin.js",
6
6
  "types": "./lib/architwin.d.ts",
@@ -707,6 +707,9 @@
707
707
  justify-content: space-between;
708
708
  }
709
709
 
710
+ .at_flex_end {
711
+ justify-content:flex-end;
712
+ }
710
713
  .at_field label {
711
714
  color: var(--text-color-light);
712
715
  font-size: 1em;
@@ -2198,6 +2201,42 @@
2198
2201
  cursor: pointer;
2199
2202
  }
2200
2203
 
2204
+ .at_end_session_button {
2205
+ border: 2px solid white;
2206
+ border-radius: 5px;
2207
+ background-color: #d51a4c;
2208
+ color: white;
2209
+ margin-top: 0.5rem;
2210
+ padding-block: 5px;
2211
+ /* align-self: stretch; */
2212
+ text-align: center;
2213
+ outline: none;
2214
+ font-size: 14px;
2215
+ cursor: pointer;
2216
+ width: 100%;
2217
+ }
2218
+ .at_end_session_button-mobile {
2219
+ background-color: #d51a4c;
2220
+ border-radius: 8px;
2221
+ border: 2px solid white;
2222
+ border-radius: 5px;
2223
+ color: white;
2224
+ /* padding-block: 5px; */
2225
+ /* align-self: stretch; */
2226
+ text-align: center;
2227
+ outline: none;
2228
+ cursor: pointer;
2229
+ width: 45px !important;
2230
+ height: 45px !important;
2231
+ font-size: 25px;
2232
+ }
2233
+
2234
+ .at_bg_transparent{
2235
+ /* border: 1px solid black; */
2236
+ background-color: transparent !important;
2237
+ /* width: 18rem; */
2238
+ }
2239
+
2201
2240
  .at_screen_share_request_modal {
2202
2241
  width: 600px;
2203
2242
  height: 300px;
@@ -2287,7 +2326,7 @@ dialog#at-screen-share-request-modal::backdrop {
2287
2326
  }
2288
2327
 
2289
2328
  #at-user-leave-session-btn {
2290
- background-color: #d51a4c;
2329
+ /* background-color: #d51a4c; */
2291
2330
  border-radius: 8px;
2292
2331
  }
2293
2332
 
@@ -2295,9 +2334,16 @@ dialog#at-screen-share-request-modal::backdrop {
2295
2334
  background-color: #d51a4c;
2296
2335
  border-radius: 8px;
2297
2336
  color: white;
2298
- padding-top: 8.75px !important;
2299
- padding-bottom: 8.75px !important;
2337
+ /* padding-top: 8.75px !important;
2338
+ padding-bottom: 8.75px !important; */
2300
2339
  max-height: 3rem !important;
2340
+ width: 100%;
2341
+ }
2342
+
2343
+ .at_display_flex_end{
2344
+ width: 100%;
2345
+ display: flex;
2346
+ justify-content: flex-end;
2301
2347
  }
2302
2348
 
2303
2349
  .at_gap_2rem {
@@ -38,6 +38,9 @@ height: calc(100vh - 304px)
38
38
  height: calc(100vh - 650px);
39
39
  }
40
40
 
41
+ .at_w-responsive-61{
42
+ width: calc(100vw - 61px);
43
+ }
41
44
  .at_p-2{
42
45
  padding: 0.5rem;
43
46
  }