architwin 1.13.11 → 1.14.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.
- package/lib/architwin.d.ts +61 -4
- package/lib/architwin.js +1 -1
- package/lib/atwinui/components/toolbar/i18n.js +43 -1
- package/lib/atwinui/components/toolbar/index.js +13 -1
- package/lib/atwinui/components/toolbar/menuBar.d.ts +1 -0
- package/lib/atwinui/components/toolbar/menuBar.js +11 -0
- package/lib/atwinui/components/toolbar/screenSharePane.d.ts +3 -1
- package/lib/atwinui/components/toolbar/screenSharePane.js +89 -37
- package/lib/atwinui/components/toolbar/spaceUserListPane.js +1 -1
- package/lib/atwinui/components/toolbar/viewingRemoteSpace.js +5 -5
- package/lib/atwinui/events.d.ts +1 -0
- package/lib/atwinui/events.js +90 -3
- package/lib/tag.d.ts +14 -1
- package/lib/tag.js +28 -1
- package/lib/types.d.ts +47 -1
- package/lib/types.js +23 -1
- package/package.json +1 -1
- package/static/atwinui.css +260 -1
- package/static/utility.css +82 -2
|
@@ -195,7 +195,28 @@ i18n
|
|
|
195
195
|
"PipeCategoryName": "Enter pipe type name",
|
|
196
196
|
"HideShowAllPipes": "Hide/Show All Pipes",
|
|
197
197
|
"Pipe": "Pipe",
|
|
198
|
-
"Vertex": "Vertex"
|
|
198
|
+
"Vertex": "Vertex",
|
|
199
|
+
"ScreenShare": "Screen Share",
|
|
200
|
+
"Users": "Users",
|
|
201
|
+
"EndSession": "End Session",
|
|
202
|
+
"SharingSpace": "Sharing Space",
|
|
203
|
+
"On": "On",
|
|
204
|
+
"Off": "Off",
|
|
205
|
+
"BackToUserList": "Back to user list",
|
|
206
|
+
"ScreenShareRequestModalMessage": "Waiting for remote screen share confirmation",
|
|
207
|
+
"ScreenShareRequestModalSubMessage": "You are requesting to remotely share your space to",
|
|
208
|
+
"CancelRequest": "Cancel Request",
|
|
209
|
+
"ViewingRemoteSpace": "Viewing Remote Space",
|
|
210
|
+
"LeaveSession": "Leave Session",
|
|
211
|
+
"IsSharingTheirSpace": "Is sharing their space",
|
|
212
|
+
"ToYou": "to you",
|
|
213
|
+
"ViewingInstructions": "During a remote space sharing session, you cannot navigate around the space, only your host has control during the session",
|
|
214
|
+
"Pending": "Pending",
|
|
215
|
+
"NowSharing": "Now Sharing",
|
|
216
|
+
"ConfirmLeaveSession": "画面共有を終了しますか?",
|
|
217
|
+
"ConfirmLeaveSessionReminder": "",
|
|
218
|
+
"InSession": "In Session",
|
|
219
|
+
"Leave": "Leave",
|
|
199
220
|
}
|
|
200
221
|
},
|
|
201
222
|
ja: {
|
|
@@ -391,6 +412,27 @@ i18n
|
|
|
391
412
|
"HideShowAllPipes": "全ての矢印マーカーを表示/非表示",
|
|
392
413
|
"Pipe": "矢印マーカー",
|
|
393
414
|
"Vertex": "頂点",
|
|
415
|
+
"Screen Share": "画面共有",
|
|
416
|
+
"Users": "ユーザー",
|
|
417
|
+
"EndSession": "画面共有を終了",
|
|
418
|
+
"SharingSpace": "画面共有",
|
|
419
|
+
"On": "オン",
|
|
420
|
+
"Off": "オフ",
|
|
421
|
+
"BackToUserList": "ユーザリストに戻る",
|
|
422
|
+
"ScreenShareRequestModalMessage": "先方の画面共有参加を待っています",
|
|
423
|
+
"ScreenShareRequestModalSubMessage": "画面共有のリクエストを受信しています",
|
|
424
|
+
"CancelRequest": "リクエストを拒否",
|
|
425
|
+
"ViewingRemoteSpace": "先方のスペースを表示",
|
|
426
|
+
"LeaveSession": "画面共有を終了",
|
|
427
|
+
"IsSharingTheirSpace": "上記のユーザが画面共有をしています",
|
|
428
|
+
"ToYou": "",
|
|
429
|
+
"ViewingInstructions": "画面共有中は供している人しかスペース内を動かすことができません",
|
|
430
|
+
"Pending": "承認待ち",
|
|
431
|
+
"NowSharing": "画面共有開始",
|
|
432
|
+
"ConfirmLeaveSession": "画面共有を終了しますか?",
|
|
433
|
+
"ConfirmLeaveSessionReminder": "",
|
|
434
|
+
"InSession": "共有中",
|
|
435
|
+
"Leave": "終了",
|
|
394
436
|
}
|
|
395
437
|
}
|
|
396
438
|
},
|
|
@@ -2,6 +2,8 @@ import { _mpConfig, themeManager } from "../../../architwin";
|
|
|
2
2
|
import { renderSidebarContainer } from "./sidebarContainer";
|
|
3
3
|
import { renderMenuBar, setActiveMenu, clearActiveMenu, getObjectListStatus } from "./menuBar";
|
|
4
4
|
import { renderObjectListPane, renderObjectCards, removeObjectCard } from "./objectListPane";
|
|
5
|
+
import { renderSpaceUserListPane } from "./spaceUserListPane";
|
|
6
|
+
import { renderViewingRemoteSpace } from "./viewingRemoteSpace";
|
|
5
7
|
import { renderAddObjectPane } from "./addObjectPane";
|
|
6
8
|
import { renderTagFormPane, getTagFormData, setTagCategoriesOption, tagFormMode, selectedTag, renderCategoryDropdownOptions, toggleDropdown } from "./tagFormPane";
|
|
7
9
|
import { renderTagListPane, renderTags, renderTagRow, addClickEventToTagRow, setTagLink, getTagLink, selectedCategoryFilterId, selectedSubCategoryFilterId, filterTagList } from "./tagListPane";
|
|
@@ -23,12 +25,13 @@ import { renderRoomTreePane } from "./spacePartition/roomTreePane";
|
|
|
23
25
|
import { renderRoomFormPane } from "./spacePartition/roomFormPane";
|
|
24
26
|
import { renderBasepointCalibratePane } from "./basepointCalibratePane";
|
|
25
27
|
import { renderGeneralSettingsMenu } from "./generalSettingsMenuPane";
|
|
28
|
+
import { renderScreenSharePane } from "./screenSharePane";
|
|
26
29
|
import { PipeList } from "./pipeListPane";
|
|
27
30
|
import { PipeForm } from "./pipeFormPane";
|
|
28
31
|
const pipeList = new PipeList();
|
|
29
32
|
const pipeForm = new PipeForm();
|
|
30
33
|
let iFrame, sidebarContainer;
|
|
31
|
-
let menuBar, actionBar, objectListPane, addObjectPane, tagListPane, tagFormPane, addMediaScreenForm, libraryPane, tagMessagingPane, themePane, modelControlPane, actionSettingsPane, roomTreePane, roomFormPane, basepointCalibratePane, generalSettingsPane, pipeListPane, pipeFormPane;
|
|
34
|
+
let menuBar, actionBar, objectListPane, addObjectPane, tagListPane, tagFormPane, addMediaScreenForm, libraryPane, tagMessagingPane, themePane, modelControlPane, actionSettingsPane, roomTreePane, roomFormPane, basepointCalibratePane, generalSettingsPane, spaceUserListPane, viewingRemoteSpace, usersPane, pipeListPane, pipeFormPane;
|
|
32
35
|
function getIframeElement(iframeId) {
|
|
33
36
|
if (!iframeId || iframeId === '') {
|
|
34
37
|
console.error("IframeId is empty or undefined");
|
|
@@ -83,6 +86,8 @@ function renderToolbarUI(payload) {
|
|
|
83
86
|
iFrame.appendChild(sidebarContainer);
|
|
84
87
|
menuBar = renderMenuBar(iFrame);
|
|
85
88
|
objectListPane = renderObjectListPane(payload.objects);
|
|
89
|
+
spaceUserListPane = renderSpaceUserListPane();
|
|
90
|
+
viewingRemoteSpace = renderViewingRemoteSpace();
|
|
86
91
|
addObjectPane = renderAddObjectPane();
|
|
87
92
|
tagFormPane = renderTagFormPane();
|
|
88
93
|
tagListPane = renderTagListPane();
|
|
@@ -97,6 +102,7 @@ function renderToolbarUI(payload) {
|
|
|
97
102
|
actionSettingsPane = renderActionSettingsPane();
|
|
98
103
|
basepointCalibratePane = renderBasepointCalibratePane();
|
|
99
104
|
generalSettingsPane = renderGeneralSettingsMenu();
|
|
105
|
+
usersPane = renderScreenSharePane();
|
|
100
106
|
pipeListPane = pipeList.renderPane();
|
|
101
107
|
pipeFormPane = pipeForm.renderPane();
|
|
102
108
|
renderModal();
|
|
@@ -110,11 +116,14 @@ function renderToolbarUI(payload) {
|
|
|
110
116
|
sidebarContainer.appendChild(tagMessagingPane);
|
|
111
117
|
sidebarContainer.appendChild(libraryPane);
|
|
112
118
|
sidebarContainer.appendChild(objectListPane);
|
|
119
|
+
sidebarContainer.appendChild(spaceUserListPane);
|
|
120
|
+
sidebarContainer.appendChild(viewingRemoteSpace);
|
|
113
121
|
sidebarContainer.appendChild(addObjectPane);
|
|
114
122
|
sidebarContainer.appendChild(tagFormPane);
|
|
115
123
|
sidebarContainer.appendChild(tagListPane);
|
|
116
124
|
sidebarContainer.appendChild(addMediaScreenForm);
|
|
117
125
|
sidebarContainer.appendChild(generalSettingsPane);
|
|
126
|
+
sidebarContainer.appendChild(usersPane);
|
|
118
127
|
sidebarContainer.appendChild(pipeListPane);
|
|
119
128
|
sidebarContainer.appendChild(pipeFormPane);
|
|
120
129
|
// Place your new pane
|
|
@@ -137,6 +146,9 @@ function renderToolbarUI(payload) {
|
|
|
137
146
|
roomFormPane.style.display = 'none';
|
|
138
147
|
actionSettingsPane.style.display = 'none';
|
|
139
148
|
generalSettingsPane.style.display = 'none';
|
|
149
|
+
spaceUserListPane.style.display = 'none';
|
|
150
|
+
viewingRemoteSpace.style.display = 'none';
|
|
151
|
+
usersPane.style.display = 'none';
|
|
140
152
|
pipeListPane.style.display = 'none';
|
|
141
153
|
pipeFormPane.style.display = 'none';
|
|
142
154
|
const customTheme = window.localStorage.getItem('customizedTheme');
|
|
@@ -5,6 +5,7 @@ export declare let isThemeEnabled: boolean;
|
|
|
5
5
|
export declare let isRoomCreationEnabled: boolean;
|
|
6
6
|
export declare let isBIMEnabled: boolean;
|
|
7
7
|
export declare let isGeneralSettingsEnabled: boolean;
|
|
8
|
+
export declare let isSpaceScreenSharingEnabled: boolean;
|
|
8
9
|
export declare let isPipeEnabled: boolean;
|
|
9
10
|
export declare function renderMenuBar(iFrame: HTMLIFrameElement): HTMLDivElement;
|
|
10
11
|
export declare function isAdminUser(): void;
|
|
@@ -12,6 +12,7 @@ export let isThemeEnabled = true;
|
|
|
12
12
|
export let isRoomCreationEnabled = true;
|
|
13
13
|
export let isBIMEnabled = true;
|
|
14
14
|
export let isGeneralSettingsEnabled = true;
|
|
15
|
+
export let isSpaceScreenSharingEnabled = true;
|
|
15
16
|
export let isPipeEnabled = true;
|
|
16
17
|
export function renderMenuBar(iFrame) {
|
|
17
18
|
const bimImageIcon = getAssetUrl('bim.png');
|
|
@@ -66,6 +67,10 @@ export function renderMenuBar(iFrame) {
|
|
|
66
67
|
<span class="mdi mdi-cog-outline" id="at-general-setting-btn" data-cy="at-general-setting-btn" target-pane="at-general-setting-pane"></span>
|
|
67
68
|
<div class="at_icon_tooltip" data-cy="at-tooltip-general-setting">${i18n.t('General Settings')}</div>
|
|
68
69
|
</div>
|
|
70
|
+
<div class="at_sidebar_button_icon" style="display:${isSpaceScreenSharingEnabled ? 'block' : 'none'}">
|
|
71
|
+
<span class="mdi mdi-monitor-multiple" id="at-screen-share-btn" data-cy="at-screen-share-pane" target-pane="at-screen-share-pane"></span>
|
|
72
|
+
<div class="at_icon_tooltip" data-cy="at-tooltip-screen-share">${i18n.t('Screen Share')}</div>
|
|
73
|
+
</div>
|
|
69
74
|
`;
|
|
70
75
|
return menuBarElement;
|
|
71
76
|
}
|
|
@@ -108,6 +113,11 @@ function setMenuItemsStatus() {
|
|
|
108
113
|
isGeneralSettingsEnabled = _mpConfig.toolbarConfig.menuItems.generalSetting;
|
|
109
114
|
log.info("__@ isGeneralSettingsEnabled: ", isGeneralSettingsEnabled);
|
|
110
115
|
}
|
|
116
|
+
// SCREEN SHARING
|
|
117
|
+
if (menuItems.spaceScreenSharing !== undefined) {
|
|
118
|
+
isSpaceScreenSharingEnabled = _mpConfig.toolbarConfig.menuItems.spaceScreenSharing;
|
|
119
|
+
log.info("__@ isSpaceScreenSharingEnabled: ", isSpaceScreenSharingEnabled);
|
|
120
|
+
}
|
|
111
121
|
// PIPE CONFIG
|
|
112
122
|
if (menuItems.pipe !== undefined) {
|
|
113
123
|
isPipeEnabled = _mpConfig.toolbarConfig.menuItems.pipe;
|
|
@@ -136,6 +146,7 @@ export function setActiveMenu(id) {
|
|
|
136
146
|
case 'at-settings-btn':
|
|
137
147
|
case 'at-general-setting-btn':
|
|
138
148
|
case 'at-pipe-btn':
|
|
149
|
+
case 'at-screen-share-btn':
|
|
139
150
|
if (parent.classList.contains('at_sidebar_button_icon_active')) {
|
|
140
151
|
// remove
|
|
141
152
|
log.info("removing active...");
|
|
@@ -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
|
|
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="
|
|
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 =
|
|
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
|
|
49
|
+
console.log("No users to load");
|
|
47
50
|
usersListContainer.innerHTML = ``;
|
|
48
51
|
return;
|
|
49
52
|
}
|
|
50
53
|
usersListContainer.innerHTML = '';
|
|
51
|
-
|
|
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
|
|
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
|
|
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
|
|
81
|
+
<p>${i18n.t('NowSharing')}</p>
|
|
79
82
|
</div>
|
|
80
83
|
`
|
|
81
84
|
: `
|
|
@@ -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="
|
|
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="
|
|
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('
|
|
233
|
+
${i18n.t('EndSession')}
|
|
231
234
|
</button>
|
|
232
235
|
`;
|
|
233
236
|
}
|
|
234
|
-
export function
|
|
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-
|
|
242
|
-
<h1 class="at_screen_share_request_message">${i18n.t('
|
|
243
|
-
<p class="at_screen_share_request_sub_message"> ${i18n.t('
|
|
244
|
-
<
|
|
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
|
|
263
|
-
|
|
264
|
-
if (
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
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
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
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;
|
|
@@ -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('
|
|
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
|
|
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('
|
|
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('
|
|
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('
|
|
80
|
+
instruction.textContent = i18n.t('ViewingInstructions');
|
|
81
81
|
container.appendChild(instruction);
|
|
82
82
|
}
|
package/lib/atwinui/events.d.ts
CHANGED
|
@@ -20,6 +20,7 @@ declare function batchAddEventListenerById(ids: Array<string>, callback: EventLi
|
|
|
20
20
|
declare function setActiveToolbarItem(itemId: string): void;
|
|
21
21
|
declare function toggleDisplayPane(targetId: string): Promise<void>;
|
|
22
22
|
declare function toggleActionBar(state: string): void;
|
|
23
|
+
export declare function handleUserLeaveSessionClick(): void;
|
|
23
24
|
declare function setupIndividualEventListeners(): void;
|
|
24
25
|
declare function handleModelVisibility(objId: string): Promise<void>;
|
|
25
26
|
declare function handleDeleteModel(objId: string): Promise<void>;
|
package/lib/atwinui/events.js
CHANGED
|
@@ -8,7 +8,7 @@ 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, setPipeCategories, setPipes, detachTagMedia, getTagDataCollection, setVertexPath } 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 } from "../architwin";
|
|
12
12
|
import { Notyf } from 'notyf';
|
|
13
13
|
import 'notyf/notyf.min.css';
|
|
14
14
|
import { SPACE_EVENTS, COORDINATE_SYSTEM, UNITS, DEGREE, MAP_OPTIONS, sortTagOptions, sortObjectOptions, CUSTOM_MAP_MODE } from "../types";
|
|
@@ -29,11 +29,12 @@ import { actionSettingsSelectOption, getTempCoordinateSystem, getTempMeasurement
|
|
|
29
29
|
import { getBasepointCalibrateBpCoordinateValues, getBasepointCalibrateMpCoordinateValues, initBsepointCalibratePane, toggleBasepointCalibratePane } from "./components/toolbar/basepointCalibratePane";
|
|
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
|
+
import { renderUserRows } from "./components/toolbar/spaceUserListPane";
|
|
33
|
+
import { renderRemoteSpaceViewing } from "./components/toolbar/viewingRemoteSpace";
|
|
32
34
|
import { PipeList } from "./components/toolbar/pipeListPane";
|
|
33
35
|
import { PipeForm } from "./components/toolbar/pipeFormPane";
|
|
34
|
-
// import { EditPipeForm, initPipeFormPane, pipeFormData, setPipeFormMode } from "./components/toolbar/pipeFormPane";
|
|
35
|
-
// import { initPipeData } from "./components/toolbar/addPipePane";
|
|
36
36
|
import { unsendComment, timedoutComment, getTheseTagMessages } from './components/toolbar/tagMessagingPane';
|
|
37
|
+
import { handleScreenShareAcceptRequest, handleScreenShareBackUserListPane, handleScreenShareEndSessionEvent, handleScreenShareUsersUpdated, renderScreenShareLeaveConfirmationModal } from "./components/toolbar/screenSharePane";
|
|
37
38
|
const pipeList = new PipeList();
|
|
38
39
|
const pipeForm = new PipeForm();
|
|
39
40
|
let activeToolbarItem, activeActionItem, activePane, activeActionPane, cancelTagPlacementPrompt, cancelModelPlacementPrompt;
|
|
@@ -227,6 +228,12 @@ function toggleDisplayPane(targetId) {
|
|
|
227
228
|
else {
|
|
228
229
|
resetSelectedTagSortOption();
|
|
229
230
|
}
|
|
231
|
+
if (paneId === 'at-space-user-list-pane') {
|
|
232
|
+
renderUserRows(_spaceUsers);
|
|
233
|
+
}
|
|
234
|
+
if (paneId === 'at-viewing-remote-space-pane') {
|
|
235
|
+
renderRemoteSpaceViewing(_screenSharingHostUser);
|
|
236
|
+
}
|
|
230
237
|
if (paneId === 'at-tag-form-pane') {
|
|
231
238
|
log.info("Tag Form Pane");
|
|
232
239
|
setTagFormMode("ADD" /* FORM_MODE.ADD */);
|
|
@@ -276,6 +283,10 @@ function toggleDisplayPane(targetId) {
|
|
|
276
283
|
//setup pipe list pane initialization
|
|
277
284
|
pipeList.init();
|
|
278
285
|
}
|
|
286
|
+
if (paneId === 'at-screen-share-pane') {
|
|
287
|
+
log.info('at-screen-share-pane');
|
|
288
|
+
dispatchSpaceEvent(SPACE_EVENTS.SCREEN_SHARE_PANE_OPEN);
|
|
289
|
+
}
|
|
279
290
|
if (paneId === 'at-pipe-form-pane') {
|
|
280
291
|
log.info("Pipe Pane");
|
|
281
292
|
}
|
|
@@ -310,6 +321,75 @@ function toggleActionBar(state) {
|
|
|
310
321
|
return;
|
|
311
322
|
}
|
|
312
323
|
}
|
|
324
|
+
function handleEndUserSession() {
|
|
325
|
+
const endSessionBtn = document.getElementById('at-user-pane-end-session-btn');
|
|
326
|
+
if (!endSessionBtn)
|
|
327
|
+
return;
|
|
328
|
+
endSessionBtn.addEventListener('click', () => {
|
|
329
|
+
dispatchSpaceEvent(SPACE_EVENTS.SCREEN_SHARE_HOST_END_SESSION);
|
|
330
|
+
// re-render users
|
|
331
|
+
renderUserRows(_spaceUsers);
|
|
332
|
+
});
|
|
333
|
+
}
|
|
334
|
+
function handleUserScreenShareClick() {
|
|
335
|
+
const shareButtons = document.querySelectorAll('[id^="at-user-screen-share-btn-"]');
|
|
336
|
+
shareButtons.forEach((btn) => {
|
|
337
|
+
const id = btn.id;
|
|
338
|
+
const indexMatch = id.match(/at-user-screen-share-btn-(\d+)/);
|
|
339
|
+
const userUuid = id.split('btn-')[1];
|
|
340
|
+
if (!userUuid)
|
|
341
|
+
return;
|
|
342
|
+
btn.addEventListener('click', (e) => {
|
|
343
|
+
// dispatch user uuid
|
|
344
|
+
dispatchSpaceEvent(SPACE_EVENTS.SCREEN_SHARE_REQUEST, userUuid);
|
|
345
|
+
});
|
|
346
|
+
});
|
|
347
|
+
}
|
|
348
|
+
export function handleUserLeaveSessionClick() {
|
|
349
|
+
const leaveSessionBtn = document.getElementById('at-user-leave-session-btn');
|
|
350
|
+
if (!leaveSessionBtn)
|
|
351
|
+
return;
|
|
352
|
+
// Check if listener already exists by looking for our marker
|
|
353
|
+
if (leaveSessionBtn.dataset.listenerAttached === 'true')
|
|
354
|
+
return;
|
|
355
|
+
leaveSessionBtn.addEventListener('click', () => {
|
|
356
|
+
// TODO: add actual end session logic here
|
|
357
|
+
console.log('@___MARK Leave Session button clicked');
|
|
358
|
+
renderScreenShareLeaveConfirmationModal(false);
|
|
359
|
+
});
|
|
360
|
+
// Mark that listener is attached
|
|
361
|
+
leaveSessionBtn.dataset.listenerAttached = 'true';
|
|
362
|
+
}
|
|
363
|
+
function handleUserCardContainer() {
|
|
364
|
+
const container = document.getElementById('at-space-user-card');
|
|
365
|
+
if (!container)
|
|
366
|
+
return;
|
|
367
|
+
const observer = new MutationObserver((mutations) => {
|
|
368
|
+
const hasChildren = container.children.length > 0;
|
|
369
|
+
if (hasChildren) {
|
|
370
|
+
handleUserScreenShareClick();
|
|
371
|
+
}
|
|
372
|
+
});
|
|
373
|
+
observer.observe(container, {
|
|
374
|
+
childList: true,
|
|
375
|
+
subtree: false // Only direct children
|
|
376
|
+
});
|
|
377
|
+
}
|
|
378
|
+
function handleLeaveSessionClick() {
|
|
379
|
+
const container = document.getElementById('at-sharing-user-container');
|
|
380
|
+
if (!container)
|
|
381
|
+
return;
|
|
382
|
+
const observer = new MutationObserver((mutations) => {
|
|
383
|
+
const hasChildren = container.children.length > 0;
|
|
384
|
+
if (hasChildren) {
|
|
385
|
+
handleUserLeaveSessionClick();
|
|
386
|
+
}
|
|
387
|
+
});
|
|
388
|
+
observer.observe(container, {
|
|
389
|
+
childList: true,
|
|
390
|
+
subtree: false // Only direct children
|
|
391
|
+
});
|
|
392
|
+
}
|
|
313
393
|
function setupIndividualEventListeners() {
|
|
314
394
|
//handleAddModel()
|
|
315
395
|
handleAddMediaScreen();
|
|
@@ -365,6 +445,9 @@ function setupIndividualEventListeners() {
|
|
|
365
445
|
handleCloseCustomMinimap();
|
|
366
446
|
handleCustomMapControls();
|
|
367
447
|
handleCloseActiveMinimap();
|
|
448
|
+
handleEndUserSession();
|
|
449
|
+
handleUserCardContainer();
|
|
450
|
+
handleLeaveSessionClick();
|
|
368
451
|
handleClickEventInTagSortOption();
|
|
369
452
|
handleClickEventInObjectSortOption();
|
|
370
453
|
handlePipeForm();
|
|
@@ -1335,6 +1418,10 @@ function setupSpaceEventSubscriptions() {
|
|
|
1335
1418
|
subscribeSpaceEvent(SPACE_EVENTS.FLOOR_IMAGE_UPLOADED, handleCustomMapFloorImageUploaded);
|
|
1336
1419
|
subscribeSpaceEvent(SPACE_EVENTS.FLOOR_IMAGE_UPLOAD_FAILED, handleCustomMapFloorUploadFailed);
|
|
1337
1420
|
subscribeSpaceEvent(SPACE_EVENTS.PATH_UPDATED, handlePathUpdated);
|
|
1421
|
+
subscribeSpaceEvent(SPACE_EVENTS.SCREEN_SHARE_USERS_UPDATE, handleScreenShareUsersUpdated);
|
|
1422
|
+
subscribeSpaceEvent(SPACE_EVENTS.SCREEN_SHARE_HOST_END_SESSION, handleScreenShareEndSessionEvent);
|
|
1423
|
+
subscribeSpaceEvent(SPACE_EVENTS.SCREEN_SHARE_ACCEPT_REQUEST, handleScreenShareAcceptRequest);
|
|
1424
|
+
subscribeSpaceEvent(SPACE_EVENTS.SCREEN_SHARE_BACK_USER_LIST_PANE, handleScreenShareBackUserListPane);
|
|
1338
1425
|
}
|
|
1339
1426
|
function handleDragEnd(payload) {
|
|
1340
1427
|
console.log("handleDragEnd payload", payload);
|
package/lib/tag.d.ts
CHANGED
|
@@ -82,4 +82,17 @@ declare function handleTagPlacerCreated(payload: {
|
|
|
82
82
|
tagPointer: MpSdk.ISubscription;
|
|
83
83
|
inputNode: MpSdk.Scene.INode;
|
|
84
84
|
}): void;
|
|
85
|
-
|
|
85
|
+
declare function registerSandbox(payload: {
|
|
86
|
+
sdk: MpSdk;
|
|
87
|
+
content: string;
|
|
88
|
+
options?: Partial<MpSdk.Tag.SandboxOptions>;
|
|
89
|
+
}): Promise<[sandboxId: string, messenger: MpSdk.Tag.IMessenger]>;
|
|
90
|
+
declare function attachSandbox(payload: {
|
|
91
|
+
sdk: MpSdk;
|
|
92
|
+
sandboxId: string;
|
|
93
|
+
tagIds: string[];
|
|
94
|
+
}): Promise<{
|
|
95
|
+
sandboxId: string;
|
|
96
|
+
messenger: MpSdk.Tag.IMessenger;
|
|
97
|
+
}>;
|
|
98
|
+
export { renderTag, disposeTag, moveTag, attachTagMedia, detachTagMedia, setTagIcon, editBillboard, editStem, editColor, saveTagDb, deleteTag, getTagColorCodeID, getEmbedlyData, cancelMoveTag, handleTagPlacerCreated, attachSandbox, registerSandbox };
|