architwin 1.12.4 → 1.13.0
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/CORE_FEATURES.md +35 -0
- package/ONBOARDING.md +115 -0
- package/lib/architwin.d.ts +98 -6
- package/lib/architwin.js +1 -1
- package/lib/atwinui/components/toolbar/collapse.d.ts +18 -0
- package/lib/atwinui/components/toolbar/collapse.js +62 -0
- package/lib/atwinui/components/toolbar/i18n.js +52 -2
- package/lib/atwinui/components/toolbar/index.js +11 -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/pipeFormPane.d.ts +31 -0
- package/lib/atwinui/components/toolbar/pipeFormPane.js +545 -0
- package/lib/atwinui/components/toolbar/pipeListPane.d.ts +19 -0
- package/lib/atwinui/components/toolbar/pipeListPane.js +388 -0
- package/lib/atwinui/components/toolbar/spaceUserListPane.d.ts +3 -0
- package/lib/atwinui/components/toolbar/spaceUserListPane.js +95 -0
- package/lib/atwinui/components/toolbar/tagIotForm.d.ts +20 -0
- package/lib/atwinui/components/toolbar/tagIotForm.js +391 -0
- package/lib/atwinui/components/toolbar/tagIotFormPane.d.ts +62 -0
- package/lib/atwinui/components/toolbar/tagIotFormPane.js +606 -0
- package/lib/atwinui/components/toolbar/tagMessagingPane.d.ts +4 -0
- package/lib/atwinui/components/toolbar/tagMessagingPane.js +117 -10
- package/lib/atwinui/components/toolbar/usersPane.d.ts +14 -0
- package/lib/atwinui/components/toolbar/usersPane.js +273 -0
- package/lib/atwinui/components/toolbar/viewingRemoteSpace.d.ts +7 -0
- package/lib/atwinui/components/toolbar/viewingRemoteSpace.js +77 -0
- package/lib/atwinui/events.d.ts +4 -1
- package/lib/atwinui/events.js +106 -26
- package/lib/atwinui/helpers.d.ts +15 -0
- package/lib/atwinui/helpers.js +49 -0
- package/lib/atwinui/index.js +2 -0
- package/lib/loaders/curosrMarkerLoader.d.ts +25 -0
- package/lib/loaders/curosrMarkerLoader.js +86 -0
- package/lib/loaders/index.d.ts +2 -1
- package/lib/loaders/index.js +2 -1
- package/lib/loaders/pathLoader.d.ts +99 -0
- package/lib/loaders/pathLoader.js +451 -0
- package/lib/tag.d.ts +1 -1
- package/lib/tag.js +2 -0
- package/lib/types.d.ts +80 -1
- package/lib/types.js +35 -0
- package/package.json +1 -1
- package/static/atwinui.css +267 -0
- package/static/utility.css +81 -1
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
1
10
|
import { getTagMessageRecepients, getTagMessages, getSelectedTagUuid, dispatchSpaceEvent, _tags } from "../../../architwin";
|
|
2
11
|
import { SPACE_EVENTS } from "../../../types";
|
|
3
12
|
import { bytesToMegabytes, convertToCssRgb, generateUUID } from "../../../utils";
|
|
@@ -7,7 +16,9 @@ import { parseISO } from 'date-fns';
|
|
|
7
16
|
import { formatWithOptions } from "date-fns/fp";
|
|
8
17
|
import { ja } from "date-fns/locale";
|
|
9
18
|
import i18n from './i18n';
|
|
19
|
+
import { batchAddEventListenerByClassName } from '../../events';
|
|
10
20
|
let notyf = new Notyf({ position: { x: 'left', y: 'bottom' } });
|
|
21
|
+
let theseTagMessages = [];
|
|
11
22
|
export function renderTagMessagingPane() {
|
|
12
23
|
const element = document.createElement('div');
|
|
13
24
|
element.classList.add('at_container');
|
|
@@ -140,7 +151,11 @@ export function renderTagMessage(message, optimisticUpdate = false) {
|
|
|
140
151
|
`
|
|
141
152
|
<img class="at_chat_media" src="${message.image_url}"/><br>
|
|
142
153
|
` : ``}
|
|
143
|
-
<small>${created_on}</small>
|
|
154
|
+
<small>${created_on}</small><br>
|
|
155
|
+
<div class="at_flex at_justify_center at_comment_unsend_container" style="${checkTimeoutDifference(message.created_on, 'check') == true ? 'at_comment_unsend_container' : 'display: none'} id="at-unsend-container-${message.uuid}">
|
|
156
|
+
<small class="mdi mdi-arrow-u-left-top at_text_xxs at_align_center at_comment_unsend_text"> </small>
|
|
157
|
+
<small class="at_text_xxs at_align_center at_comment_unsend_text" id="at-unsend-user-text-${created_on}">Unsend</small>
|
|
158
|
+
</div>
|
|
144
159
|
</div>
|
|
145
160
|
</div>
|
|
146
161
|
`;
|
|
@@ -152,8 +167,8 @@ export function renderTagMessage(message, optimisticUpdate = false) {
|
|
|
152
167
|
}
|
|
153
168
|
else {
|
|
154
169
|
chat.innerHTML = `
|
|
155
|
-
<span class="at_chat_avatar at_chat_avatar_sender">${message.owner_name.charAt(0).toUpperCase()}</span>
|
|
156
|
-
<div class="at_chat_bubble at_chat_bubble_sent">
|
|
170
|
+
<span class="at_chat_avatar at_chat_avatar_sender" id="at-chat-avatar-container-${message.uuid}">${message.owner_name.charAt(0).toUpperCase()}</span>
|
|
171
|
+
<div class="at_chat_bubble at_chat_bubble_sent" id="at-chat-bubble-container-${message.uuid}">
|
|
157
172
|
<div>
|
|
158
173
|
<small>${message.owner_name} ➡️ ${message.to_user_name}</small> <br>
|
|
159
174
|
${message.messages}
|
|
@@ -162,8 +177,13 @@ export function renderTagMessage(message, optimisticUpdate = false) {
|
|
|
162
177
|
`
|
|
163
178
|
<img class="at_chat_media" src="${message.image_url}"/><br>
|
|
164
179
|
` : ``}
|
|
165
|
-
<small>${created_on}</small>
|
|
180
|
+
<small>${created_on}</small><br>
|
|
181
|
+
<div class="at_flex at_justify_center at_comment_unsend_container" id="at-unsend-container-${message.uuid}" style="${checkTimeoutDifference(message.created_on, 'check') == true ? 'at_comment_unsend_container' : 'display: none'}">
|
|
182
|
+
<small class="mdi mdi-arrow-u-left-top at_text_xxs at_align_center at_comment_unsend_text"> </small>
|
|
183
|
+
<small class="at_text_xxs at_align_center at_comment_unsend_text" id="at-unsend-admin-text-${message.uuid}" value="${message.uuid}">Unsend</small>
|
|
184
|
+
</div>
|
|
166
185
|
</div>
|
|
186
|
+
|
|
167
187
|
</div>
|
|
168
188
|
`;
|
|
169
189
|
}
|
|
@@ -171,13 +191,20 @@ export function renderTagMessage(message, optimisticUpdate = false) {
|
|
|
171
191
|
const firstChild = chatContainer.firstChild;
|
|
172
192
|
chatContainer.insertBefore(chat, firstChild);
|
|
173
193
|
const input = (document.getElementById("at-no-message"));
|
|
174
|
-
input
|
|
175
|
-
|
|
194
|
+
if (input)
|
|
195
|
+
input.remove();
|
|
196
|
+
// return
|
|
176
197
|
}
|
|
177
198
|
else {
|
|
178
199
|
chatContainer.appendChild(chat);
|
|
179
|
-
return;
|
|
180
200
|
}
|
|
201
|
+
chat.addEventListener('click', (event) => {
|
|
202
|
+
//@ts-expect-error
|
|
203
|
+
const newMessage = event.target.getAttribute('value');
|
|
204
|
+
console.log('___chat is clicked', newMessage, message);
|
|
205
|
+
unsendComment({ newMessage });
|
|
206
|
+
});
|
|
207
|
+
return;
|
|
181
208
|
}
|
|
182
209
|
export function getSelectedMessageRecepient() {
|
|
183
210
|
const recepientDropdown = document.getElementById('at-recepient-dropdown');
|
|
@@ -220,6 +247,7 @@ export function getTagMessageText() {
|
|
|
220
247
|
return content;
|
|
221
248
|
}
|
|
222
249
|
export function clearTagMessageInput() {
|
|
250
|
+
console.log('clearTagMessageInput()');
|
|
223
251
|
const textareaInput = document.getElementById('at-chat-textarea');
|
|
224
252
|
textareaInput.value = '';
|
|
225
253
|
}
|
|
@@ -261,16 +289,18 @@ export function createTagMessage() {
|
|
|
261
289
|
message.created_on = created_on;
|
|
262
290
|
dispatchSpaceEvent(SPACE_EVENTS.TAG_MESSAGE_SENT, message);
|
|
263
291
|
// add remove span
|
|
292
|
+
//clear input field
|
|
293
|
+
clearTagMessageInput();
|
|
264
294
|
//Perform optimistic update
|
|
265
|
-
renderTagMessage(message,
|
|
295
|
+
renderTagMessage(message, false); //change to false due to Unsend Option #15713
|
|
266
296
|
//Clear forms
|
|
267
297
|
clearSelectedMedia();
|
|
268
|
-
clearTagMessageInput();
|
|
269
298
|
notyf.success(`${i18n.t('MessageSentSuccess')}`);
|
|
299
|
+
getTagMessages();
|
|
270
300
|
return message;
|
|
271
301
|
}
|
|
272
302
|
export function setTagMessagingDetails(tagId) {
|
|
273
|
-
console.log("setTagMessagingDetails()", tagId);
|
|
303
|
+
console.log("setTagMessagingDetails() ", tagId);
|
|
274
304
|
if (tagId && tagId !== '') {
|
|
275
305
|
const tagTitle = document.getElementById('at-tag-name-messaging');
|
|
276
306
|
const tagColor = document.getElementById('at-tag-color-messaging');
|
|
@@ -299,3 +329,80 @@ export function setTagMessagingDetails(tagId) {
|
|
|
299
329
|
console.error("tagId is either undefined or empty");
|
|
300
330
|
return;
|
|
301
331
|
}
|
|
332
|
+
// this deletes a selected Chat Bubble
|
|
333
|
+
export function unsendComment(payload) {
|
|
334
|
+
console.log('___unsendComment()', payload);
|
|
335
|
+
batchAddEventListenerByClassName('at_comment_unsend_container', (event) => __awaiter(this, void 0, void 0, function* () {
|
|
336
|
+
console.log('__batch event', event);
|
|
337
|
+
//@ts-ignore
|
|
338
|
+
const commentTag = event.target.getAttribute('value');
|
|
339
|
+
if (commentTag && payload.tagMessages) {
|
|
340
|
+
console.log('__comment uuid: ', payload.tagMessages);
|
|
341
|
+
const commentFound = payload.tagMessages.find((message) => {
|
|
342
|
+
return message.uuid == commentTag;
|
|
343
|
+
});
|
|
344
|
+
if (commentFound && checkTimeoutDifference(commentFound.created_on, 'delete') == true) {
|
|
345
|
+
dispatchSpaceEvent(SPACE_EVENTS.TAG_MESSAGE_UNSEND, { uuid: commentFound.uuid, tagId: commentFound.tag_uuid });
|
|
346
|
+
hideTagBubble(commentFound.uuid);
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
}));
|
|
350
|
+
}
|
|
351
|
+
// this sets the Interval to check if Timeout hadn't pass yet
|
|
352
|
+
export function timedoutComment(payload) {
|
|
353
|
+
console.log('timedoutComment()', payload);
|
|
354
|
+
setInterval(function () {
|
|
355
|
+
// console.log("This message prints every 5 seconds.", payload);
|
|
356
|
+
payload.filter((message) => __awaiter(this, void 0, void 0, function* () {
|
|
357
|
+
const difference = yield checkTimeoutDifference(parseISO(message.created_on), 'check');
|
|
358
|
+
const container = document.getElementById(`at-unsend-container-${message.uuid}`);
|
|
359
|
+
if (difference == true && container) {
|
|
360
|
+
// console.log('difference test: ', difference)
|
|
361
|
+
// container.style.display = 'block'
|
|
362
|
+
}
|
|
363
|
+
else if (difference == false && container) {
|
|
364
|
+
container.style.display = 'none';
|
|
365
|
+
// console.log('This message print UNSEND STILL AVAIABLE')
|
|
366
|
+
}
|
|
367
|
+
}));
|
|
368
|
+
}, 5000);
|
|
369
|
+
}
|
|
370
|
+
// this compares the created_on and current Time of User its within Timeout
|
|
371
|
+
export function checkTimeoutDifference(createdDateInput, mode) {
|
|
372
|
+
const createdDate = new Date(createdDateInput);
|
|
373
|
+
const currentDate = new Date();
|
|
374
|
+
const difference = currentDate.getTime() - createdDate.getTime();
|
|
375
|
+
const TIMEOUT = 10 * 60 * 1000;
|
|
376
|
+
if (mode == 'check') {
|
|
377
|
+
if (difference <= TIMEOUT) {
|
|
378
|
+
timedoutComment(theseTagMessages);
|
|
379
|
+
return true;
|
|
380
|
+
}
|
|
381
|
+
else {
|
|
382
|
+
return false;
|
|
383
|
+
}
|
|
384
|
+
}
|
|
385
|
+
else if (mode == 'delete') {
|
|
386
|
+
if (difference <= TIMEOUT) {
|
|
387
|
+
return true;
|
|
388
|
+
}
|
|
389
|
+
else {
|
|
390
|
+
return false;
|
|
391
|
+
}
|
|
392
|
+
}
|
|
393
|
+
}
|
|
394
|
+
// this function hides the selected Chat Bubble while it is being deleted
|
|
395
|
+
function hideTagBubble(payload) {
|
|
396
|
+
console.log('hideTagBubble()', payload);
|
|
397
|
+
const chatContainer = document.getElementById(`at-chat-bubble-container-${payload}`);
|
|
398
|
+
const chaAvatar = document.getElementById(`at-chat-avatar-container-${payload}`);
|
|
399
|
+
if (chatContainer && chaAvatar) {
|
|
400
|
+
chatContainer.style.display = 'none';
|
|
401
|
+
chaAvatar.style.display = 'none';
|
|
402
|
+
}
|
|
403
|
+
}
|
|
404
|
+
// this gets the tagMessages
|
|
405
|
+
export function getTheseTagMessages(payload) {
|
|
406
|
+
console.log('getTheseTagMessages()');
|
|
407
|
+
return theseTagMessages = payload;
|
|
408
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ScreenShareRequest, ScreenShareSessionUser, ScreenShareUser } from '../../../types';
|
|
2
|
+
export declare function renderUsersPane(): HTMLElement;
|
|
3
|
+
export declare function renderUsersList(users: ScreenShareUser[]): void;
|
|
4
|
+
export declare function renderOnlineUserRow(user: ScreenShareUser): HTMLTableRowElement;
|
|
5
|
+
export declare function renderOfflineUserRow(user: ScreenShareUser): HTMLTableRowElement;
|
|
6
|
+
export declare function sortUsersRowByOnlineState(onlineFirst?: boolean): void;
|
|
7
|
+
export declare function handleClickEventUserRow(): void;
|
|
8
|
+
export declare function renderSharingSpaceDetail(user: ScreenShareSessionUser): void;
|
|
9
|
+
export declare function handleClickEventBackToUserListLink(): void;
|
|
10
|
+
export declare function renderScreenShareRequestModal(request: ScreenShareRequest): void;
|
|
11
|
+
export declare function handleInputEventSelectPointerSettings(): void;
|
|
12
|
+
export declare function handleClickEventEndSessionBtn(): void;
|
|
13
|
+
export declare function handleScreenShareUsersUpdated(users: ScreenShareUser[]): void;
|
|
14
|
+
export declare function handleScreenShareEndSessionEvent(): void;
|
|
@@ -0,0 +1,273 @@
|
|
|
1
|
+
import { _space, dispatchSpaceEvent } from '../../../architwin';
|
|
2
|
+
import { SPACE_EVENTS } from '../../../types';
|
|
3
|
+
import i18n from './i18n';
|
|
4
|
+
let _currentUser;
|
|
5
|
+
let _screenShareUsers = [];
|
|
6
|
+
let _screenShareUser;
|
|
7
|
+
let _screenShareSessionUsers;
|
|
8
|
+
let _screenShareSessionUser;
|
|
9
|
+
let _screenShareSession;
|
|
10
|
+
let _screenShareUsersSortSettings = { onlineFirst: true };
|
|
11
|
+
let _onDisplayComponent;
|
|
12
|
+
export function renderUsersPane() {
|
|
13
|
+
const element = document.createElement('div');
|
|
14
|
+
element.setAttribute('id', 'at-users-pane');
|
|
15
|
+
element.style.setProperty('width', '400px');
|
|
16
|
+
element.classList.add('at_container');
|
|
17
|
+
element.innerHTML = `
|
|
18
|
+
<div id="at-users-pane" class="at_flex at_flex_column">
|
|
19
|
+
<div id="at-users-pane-content" class="at_form_container">
|
|
20
|
+
<div class="at_flex at_justify_start">
|
|
21
|
+
<span class="at_bolder at_text_base">${i18n.t('Users')}</span>
|
|
22
|
+
</div>
|
|
23
|
+
<div class="at_disable_hover_users_list at_scrollable_container at_h-min-45">
|
|
24
|
+
<table id="at-user-list-container">
|
|
25
|
+
</table>
|
|
26
|
+
</div>
|
|
27
|
+
</div>
|
|
28
|
+
</div>
|
|
29
|
+
`;
|
|
30
|
+
return element;
|
|
31
|
+
}
|
|
32
|
+
export function renderUsersList(users) {
|
|
33
|
+
_onDisplayComponent = 'USER_LIST';
|
|
34
|
+
_screenShareUsers = users;
|
|
35
|
+
const usersContainer = document.getElementById("at-user-list-container");
|
|
36
|
+
if (!usersContainer) {
|
|
37
|
+
console.error("Tag container does not exist in DOM");
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
if (users.length <= 0) {
|
|
41
|
+
console.log("No tags to load");
|
|
42
|
+
usersContainer.innerHTML = ``;
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
usersContainer.innerHTML = '';
|
|
46
|
+
users.forEach(user => {
|
|
47
|
+
const row = user.onlineStatus !== 'offline' ? renderOnlineUserRow(user) : renderOfflineUserRow(user);
|
|
48
|
+
usersContainer.appendChild(row);
|
|
49
|
+
});
|
|
50
|
+
handleClickEventUserRow();
|
|
51
|
+
sortUsersRowByOnlineState(true);
|
|
52
|
+
}
|
|
53
|
+
export function renderOnlineUserRow(user) {
|
|
54
|
+
const element = document.createElement("tr");
|
|
55
|
+
element.setAttribute('id', `at-user-row-${user.id}`);
|
|
56
|
+
element.dataset.id = user.id;
|
|
57
|
+
element.classList.add(...['at_online_user_row', 'at_flex', 'at_items_center', 'at_justify_between']);
|
|
58
|
+
const iconOrSharingText = user.onlineStatus === 'in_session'
|
|
59
|
+
? `
|
|
60
|
+
<div class="at_flex at_items_center at_justify_center">
|
|
61
|
+
<p>Now Sharing</p>
|
|
62
|
+
</div>
|
|
63
|
+
`
|
|
64
|
+
: `
|
|
65
|
+
<div class="at_user_screen_sharing_state at_flex at_items_center at_justify_center">
|
|
66
|
+
<div class="mdi mdi-monitor-share"></div>
|
|
67
|
+
</div>
|
|
68
|
+
`;
|
|
69
|
+
element.innerHTML = `
|
|
70
|
+
<td id="at_user_row_${user.id}">
|
|
71
|
+
<div class="at_flex at_flex_row at_items_center">
|
|
72
|
+
<div class="at_users_online_indicator"></div>
|
|
73
|
+
<span class="at_no_hover_text_online_user at_text_base">${user.name}</span>
|
|
74
|
+
</div>
|
|
75
|
+
</td>
|
|
76
|
+
<td>
|
|
77
|
+
${iconOrSharingText}
|
|
78
|
+
</td>
|
|
79
|
+
`;
|
|
80
|
+
return element;
|
|
81
|
+
}
|
|
82
|
+
export function renderOfflineUserRow(user) {
|
|
83
|
+
const element = document.createElement("tr");
|
|
84
|
+
element.setAttribute('id', `at-user-row-${user.id}`);
|
|
85
|
+
element.dataset.id = user.id;
|
|
86
|
+
element.classList.add(...['at_offline_user_row', 'at_flex', 'at_items_center', 'at_justify_between']);
|
|
87
|
+
element.innerHTML = `
|
|
88
|
+
<td id="at_user_row_${user.id}">
|
|
89
|
+
<div class="at_flex at_flex_row at_items_center">
|
|
90
|
+
<div class="at_users_ofline_indicator"></div>
|
|
91
|
+
<span class="at_no_hover_text_offline_user at_text_base at_offline_user_name_text">${user.name}</span>
|
|
92
|
+
</div>
|
|
93
|
+
</td>
|
|
94
|
+
`;
|
|
95
|
+
return element;
|
|
96
|
+
}
|
|
97
|
+
export function sortUsersRowByOnlineState(onlineFirst = _screenShareUsersSortSettings.onlineFirst || true) {
|
|
98
|
+
_screenShareUsersSortSettings = { onlineFirst };
|
|
99
|
+
const table = document.getElementById('at-user-list-container');
|
|
100
|
+
const rows = Array.from(table.querySelectorAll('tr'));
|
|
101
|
+
if (onlineFirst) {
|
|
102
|
+
rows.sort((a, b) => {
|
|
103
|
+
const aClass = a.classList.contains('at_online_user_row');
|
|
104
|
+
const bClass = b.classList.contains('at_online_user_row');
|
|
105
|
+
return Number(bClass) - Number(aClass);
|
|
106
|
+
});
|
|
107
|
+
table.append(...rows);
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
export function handleClickEventUserRow() {
|
|
111
|
+
const table = document.getElementById('at-user-list-container');
|
|
112
|
+
if (table) {
|
|
113
|
+
table.addEventListener('click', (event) => {
|
|
114
|
+
const target = event.target;
|
|
115
|
+
const row = target.closest('tr');
|
|
116
|
+
if (row && table.contains(row)) {
|
|
117
|
+
const id = row.dataset.id;
|
|
118
|
+
const user = _screenShareUsers.find(u => u.id === id);
|
|
119
|
+
_screenShareUser = user;
|
|
120
|
+
if (user.onlineStatus === 'offline')
|
|
121
|
+
return;
|
|
122
|
+
if (user.onlineStatus === 'in_session') {
|
|
123
|
+
const usersPaneContent = document.getElementById('at-users-pane-content');
|
|
124
|
+
usersPaneContent.innerHTML = '';
|
|
125
|
+
const sessionUser = {
|
|
126
|
+
id: user.id,
|
|
127
|
+
name: user.name,
|
|
128
|
+
role: 'guest',
|
|
129
|
+
session: _screenShareSession
|
|
130
|
+
};
|
|
131
|
+
renderSharingSpaceDetail(sessionUser);
|
|
132
|
+
}
|
|
133
|
+
else {
|
|
134
|
+
const nowEpochSeconds = Math.floor(Date.now() / 1000);
|
|
135
|
+
const screenShareInvitation = {
|
|
136
|
+
user: user,
|
|
137
|
+
requestBy: _currentUser,
|
|
138
|
+
requestedAt: nowEpochSeconds,
|
|
139
|
+
status: 'pending'
|
|
140
|
+
};
|
|
141
|
+
dispatchSpaceEvent(SPACE_EVENTS.SCREEN_SHARE_REQUEST, screenShareInvitation);
|
|
142
|
+
// renderScreenShareRequestModal(screenShareInvitation) // moved it to front end
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
});
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
export function renderSharingSpaceDetail(user) {
|
|
149
|
+
var _a;
|
|
150
|
+
_onDisplayComponent = 'SPACE_SHARING_DETAILS';
|
|
151
|
+
_screenShareSessionUser = user;
|
|
152
|
+
const usersPaneContent = document.getElementById('at-users-pane-content');
|
|
153
|
+
const element = document.createElement('div');
|
|
154
|
+
element.setAttribute('id', 'at-sharing-space-details');
|
|
155
|
+
element.classList.add('at_form_container');
|
|
156
|
+
element.innerHTML = `
|
|
157
|
+
<div class="at_flex at_justify_start">
|
|
158
|
+
<span class="at_bolder at_text_base at_capitalize">${i18n.t('Sharing Space')}</span>
|
|
159
|
+
</div>
|
|
160
|
+
<div class="at_flex at_flex_column at_gap_half_rem">
|
|
161
|
+
<div class="at_screen_share_guest_card at_flex at_flex_row at_justify_between at_items_center">
|
|
162
|
+
<div class="at_flex at_flex_column at_justify_start">
|
|
163
|
+
<p class="at_bolder at_text_base">${user.name}</p>
|
|
164
|
+
<span class="at_subtitle_text">Your are sharing ${(_a = _space === null || _space === void 0 ? void 0 : _space.name) !== null && _a !== void 0 ? _a : 'test'} to this person</span>
|
|
165
|
+
</div>
|
|
166
|
+
<div class="at_users_online_indicator"></div>
|
|
167
|
+
</div>
|
|
168
|
+
<div class="at_bolder at_text_base">Pointer</div>
|
|
169
|
+
<div class="at_flex at_flex_column at_justify_start">
|
|
170
|
+
<div class="at_screen_share_pointer_choices">
|
|
171
|
+
<select id="at_select_screen_share_pointer" name="at_screen_share_pointer">
|
|
172
|
+
<option>${i18n.t('Off')}</option>
|
|
173
|
+
<option>${i18n.t('On')}</option>
|
|
174
|
+
</select>
|
|
175
|
+
</div>
|
|
176
|
+
</div>
|
|
177
|
+
<div class="at_flex at_flex_column at_justify_center at_items_center">
|
|
178
|
+
<div id="at-back-user-list-link" class="at_back_user_list_link">
|
|
179
|
+
<span class="mdi mdi-arrow-left"></span>
|
|
180
|
+
<p> ${i18n.t('Back to user list')}</p>
|
|
181
|
+
</div>
|
|
182
|
+
<button type="button" id="at-screen-share-end-session-btn" class="at_screen_share_end_session_btn">
|
|
183
|
+
${i18n.t('End Session')}
|
|
184
|
+
</button>
|
|
185
|
+
</div>
|
|
186
|
+
</div>
|
|
187
|
+
`;
|
|
188
|
+
usersPaneContent.appendChild(element);
|
|
189
|
+
handleClickEventBackToUserListLink();
|
|
190
|
+
handleInputEventSelectPointerSettings();
|
|
191
|
+
handleClickEventEndSessionBtn();
|
|
192
|
+
}
|
|
193
|
+
export function handleClickEventBackToUserListLink() {
|
|
194
|
+
const link = document.getElementById('at-back-user-list-link');
|
|
195
|
+
if (link) {
|
|
196
|
+
link.addEventListener('click', () => {
|
|
197
|
+
const usersPaneContent = document.getElementById('at-users-pane-content');
|
|
198
|
+
usersPaneContent.innerHTML = '';
|
|
199
|
+
usersPaneContent.classList.add('at_form_container');
|
|
200
|
+
usersPaneContent.innerHTML = `
|
|
201
|
+
<div class="at_flex at_justify_start">
|
|
202
|
+
<span class="at_bolder at_text_base">${i18n.t('Users')}</span>
|
|
203
|
+
</div>
|
|
204
|
+
<div class="at_disable_hover_users_list at_scrollable_container at_h-min-45">
|
|
205
|
+
<table id="at-user-list-container">
|
|
206
|
+
</table>
|
|
207
|
+
</div>
|
|
208
|
+
`;
|
|
209
|
+
renderUsersList(_screenShareUsers);
|
|
210
|
+
});
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
export function renderScreenShareRequestModal(request) {
|
|
214
|
+
var _a;
|
|
215
|
+
_onDisplayComponent = 'SCREEN_SHARE_REQUEST_MODAL';
|
|
216
|
+
const element = document.createElement('dialog');
|
|
217
|
+
element.setAttribute('id', 'at-screen-share-request-modal');
|
|
218
|
+
element.classList.add('at_screen_share_request_modal');
|
|
219
|
+
element.innerHTML = `
|
|
220
|
+
<div class="at_screen_share_request_modal_content at_flex at_flex_column at_justify_center at_items_center">
|
|
221
|
+
<div class="at_screen_share_icon mdi mdi-monitor-multiple"></div>
|
|
222
|
+
<h1 class="at_screen_share_request_message">${i18n.t('Waiting for remote screen share confirmation')}</h1>
|
|
223
|
+
<p class="at_screen_share_request_sub_message"> ${i18n.t('You are requesting to remotely share your space to')} <strong>${request.user.name}</strong></p>
|
|
224
|
+
<button type="button" id="at-screen-share-request-btn" class="at_screen_share_cancel_request_btn">${i18n.t('Cancel Request')}</button>
|
|
225
|
+
</div>
|
|
226
|
+
`;
|
|
227
|
+
// disabled modal dismiss via Esc key
|
|
228
|
+
function blockEscapeKey(e) {
|
|
229
|
+
if (e.key === 'Escape' && element.open) {
|
|
230
|
+
e.preventDefault();
|
|
231
|
+
e.stopPropagation();
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
element.addEventListener('keydown', blockEscapeKey);
|
|
235
|
+
element.addEventListener('cancel', (event) => {
|
|
236
|
+
event.preventDefault();
|
|
237
|
+
});
|
|
238
|
+
(_a = element.querySelector('#at-screen-share-request-btn')) === null || _a === void 0 ? void 0 : _a.addEventListener('click', () => {
|
|
239
|
+
const cancelRequest = Object.assign(Object.assign({}, request), { status: 'canceled' });
|
|
240
|
+
dispatchSpaceEvent(SPACE_EVENTS.SCREEN_SHARE_CANCEL_REQUEST, cancelRequest);
|
|
241
|
+
element.close();
|
|
242
|
+
element.remove();
|
|
243
|
+
_onDisplayComponent = 'USER_LIST';
|
|
244
|
+
});
|
|
245
|
+
document.body.appendChild(element);
|
|
246
|
+
element.showModal();
|
|
247
|
+
}
|
|
248
|
+
export function handleInputEventSelectPointerSettings() {
|
|
249
|
+
const select = document.getElementById('at_select_screen_share_pointer');
|
|
250
|
+
if (select) {
|
|
251
|
+
select.addEventListener('input', (event) => {
|
|
252
|
+
const target = event.target;
|
|
253
|
+
_screenShareSession = Object.assign(Object.assign({}, _screenShareSession), { isPointerEnabled: target.value === 'On' });
|
|
254
|
+
dispatchSpaceEvent(SPACE_EVENTS.SCREEN_SHARE_POINTER_UPDATE, _screenShareSession);
|
|
255
|
+
});
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
export function handleClickEventEndSessionBtn() {
|
|
259
|
+
const button = document.getElementById('at-screen-share-end-session-btn');
|
|
260
|
+
if (button) {
|
|
261
|
+
button.addEventListener('click', () => {
|
|
262
|
+
dispatchSpaceEvent(SPACE_EVENTS.SCREEN_SHARE_END_SESSION, handleScreenShareEndSessionEvent);
|
|
263
|
+
});
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
export function handleScreenShareUsersUpdated(users) {
|
|
267
|
+
renderUsersList(users);
|
|
268
|
+
}
|
|
269
|
+
export function handleScreenShareEndSessionEvent() {
|
|
270
|
+
_screenShareSessionUsers = [];
|
|
271
|
+
_screenShareSession = {};
|
|
272
|
+
renderUsersList(_screenShareUsers);
|
|
273
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ISpaceUser } from "../../../types";
|
|
2
|
+
export declare function renderViewingRemoteSpace(): HTMLElement;
|
|
3
|
+
/**
|
|
4
|
+
* Render the viewing remote space panel for the user sharing their screen.
|
|
5
|
+
* @param user The user who is currently sharing their screen
|
|
6
|
+
*/
|
|
7
|
+
export declare function renderRemoteSpaceViewing(user: ISpaceUser): void;
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { _currentSpace } from "../../../architwin";
|
|
2
|
+
import i18n from './i18n';
|
|
3
|
+
export function renderViewingRemoteSpace() {
|
|
4
|
+
const element = document.createElement('div');
|
|
5
|
+
element.classList.add('at_container', 'at_w-14', 'at_h-full', 'at_p-5');
|
|
6
|
+
element.setAttribute('id', 'at-viewing-remote-space-pane');
|
|
7
|
+
element.setAttribute('data-cy', 'at-viewing-remote-space-pane');
|
|
8
|
+
element.innerHTML = `
|
|
9
|
+
<div class="at_panel_header">
|
|
10
|
+
<span>${i18n.t('Viewing Remote Space')}</span>
|
|
11
|
+
</div>
|
|
12
|
+
|
|
13
|
+
<div id="at-sharing-user-container" >
|
|
14
|
+
</div>
|
|
15
|
+
|
|
16
|
+
<div class="at_button_row at_justify_center">
|
|
17
|
+
<div
|
|
18
|
+
class="at_button at_ghost at_bg_red_600 at_w-full"
|
|
19
|
+
id="at-user-leave-session-btn"
|
|
20
|
+
data-cy="at-user-leave-session-btn">
|
|
21
|
+
${i18n.t('Leave Session')}
|
|
22
|
+
</div>
|
|
23
|
+
</div>
|
|
24
|
+
`;
|
|
25
|
+
return element;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Render the viewing remote space panel for the user sharing their screen.
|
|
29
|
+
* @param user The user who is currently sharing their screen
|
|
30
|
+
*/
|
|
31
|
+
export function renderRemoteSpaceViewing(user) {
|
|
32
|
+
var _a;
|
|
33
|
+
const container = document.getElementById('at-sharing-user-container');
|
|
34
|
+
const maincontainer = document.getElementById('at-viewing-remote-space-pane');
|
|
35
|
+
if (!container && !maincontainer)
|
|
36
|
+
return;
|
|
37
|
+
maincontainer.style.display = 'block';
|
|
38
|
+
container.innerHTML = '';
|
|
39
|
+
// === Main Card ===
|
|
40
|
+
const card = document.createElement('div');
|
|
41
|
+
card.className = 'at_card at_p-5 at_mb_5 at_mt_4 at_bg_black at_opacity_75 at_rounded';
|
|
42
|
+
const cardContent = document.createElement('div');
|
|
43
|
+
cardContent.className = 'at_flex at_items_center at_justify_between';
|
|
44
|
+
// Left: User info
|
|
45
|
+
const infoWrapper = document.createElement('div');
|
|
46
|
+
const userNameEl = document.createElement('strong');
|
|
47
|
+
userNameEl.textContent = ((_a = user.name) === null || _a === void 0 ? void 0 : _a.toUpperCase()) || 'ADMIN';
|
|
48
|
+
userNameEl.className = 'at_text_white at_font_bold';
|
|
49
|
+
userNameEl.style.fontSize = '1.25rem';
|
|
50
|
+
const statusText = document.createElement('div');
|
|
51
|
+
statusText.className = 'at_text_sm at_text_white';
|
|
52
|
+
statusText.innerHTML = `
|
|
53
|
+
${i18n.t('Is sharing their space')} <${(_currentSpace === null || _currentSpace === void 0 ? void 0 : _currentSpace.name) || i18n.t('SPACE_NAME')}> ${i18n.t('to you')}
|
|
54
|
+
`;
|
|
55
|
+
infoWrapper.appendChild(userNameEl);
|
|
56
|
+
infoWrapper.appendChild(statusText);
|
|
57
|
+
// Right: Green dot
|
|
58
|
+
const dot = document.createElement('div');
|
|
59
|
+
dot.className = 'at_circle at_w-2 at_h-2 at_bg_green_500';
|
|
60
|
+
const circle = document.createElement('span');
|
|
61
|
+
circle.style.width = '15px';
|
|
62
|
+
circle.style.height = '15px';
|
|
63
|
+
circle.style.borderRadius = '50%';
|
|
64
|
+
circle.style.backgroundColor = user.isActive ? '#22c55e' : '#ffffff';
|
|
65
|
+
circle.style.border = '1px solid #ccc';
|
|
66
|
+
circle.style.marginRight = '10px';
|
|
67
|
+
// Combine into card
|
|
68
|
+
cardContent.appendChild(infoWrapper);
|
|
69
|
+
cardContent.appendChild(circle);
|
|
70
|
+
card.appendChild(cardContent);
|
|
71
|
+
container.appendChild(card);
|
|
72
|
+
// === Instructional Text ===
|
|
73
|
+
const instruction = document.createElement('div');
|
|
74
|
+
instruction.className = 'at_text_xs at_text_center at_text_white at_opacity_80 at_mb_6';
|
|
75
|
+
instruction.textContent = i18n.t('During a remote space sharing session, you cannot navigate around the space, only your host has control during the session');
|
|
76
|
+
container.appendChild(instruction);
|
|
77
|
+
}
|
package/lib/atwinui/events.d.ts
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
|
+
import { Notyf } from 'notyf';
|
|
1
2
|
import 'notyf/notyf.min.css';
|
|
2
3
|
declare let activeToolbarItem: HTMLElement, activeActionItem: HTMLElement, cancelModelPlacementPrompt: HTMLDivElement;
|
|
4
|
+
export declare let notyf: Notyf;
|
|
3
5
|
declare let isCustomMapControlsVisible: boolean;
|
|
6
|
+
declare let pipeColor: string;
|
|
4
7
|
declare function batchAddEventListenerByClassName(className: string, callback: EventListener): void;
|
|
5
8
|
/**
|
|
6
9
|
* @param attrName - The name of the data attribute (without the "data-" prefix), e.g. 'toggle-pane'
|
|
@@ -39,4 +42,4 @@ declare function handleDeletePartition(targetId: string): void;
|
|
|
39
42
|
* Handles the display logic for showing the custom minimap.
|
|
40
43
|
*/
|
|
41
44
|
declare function handleShowCustomMinimap(): void;
|
|
42
|
-
export { activeToolbarItem, activeActionItem, cancelModelPlacementPrompt, isCustomMapControlsVisible, batchAddEventListenerById, batchAddEventListenerByClassName, batchAddEventListenerByClassNames, batchAddEventListenerByDataAttribute, setActiveToolbarItem, toggleDisplayPane, toggleActionBar, setupIndividualEventListeners, setupSpaceEventSubscriptions, handleModelVisibility, handleDeleteModel, handleShowMinimap, handleScrollToView, handleRenderMeetingUI, handleShowCustomMinimap, handlePartitionVisibility, handlePolygonVisibility, handleDeletePartition, };
|
|
45
|
+
export { activeToolbarItem, activeActionItem, cancelModelPlacementPrompt, isCustomMapControlsVisible, pipeColor, batchAddEventListenerById, batchAddEventListenerByClassName, batchAddEventListenerByClassNames, batchAddEventListenerByDataAttribute, setActiveToolbarItem, toggleDisplayPane, toggleActionBar, setupIndividualEventListeners, setupSpaceEventSubscriptions, handleModelVisibility, handleDeleteModel, handleShowMinimap, handleScrollToView, handleRenderMeetingUI, handleShowCustomMinimap, handlePartitionVisibility, handlePolygonVisibility, handleDeletePartition, };
|