architwin 1.12.5 → 1.13.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/CORE_FEATURES.md +35 -0
- package/lib/architwin.d.ts +96 -5
- 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 +56 -4
- 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/tagFormPane.d.ts +1 -0
- package/lib/atwinui/components/toolbar/tagFormPane.js +4 -1
- 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.js +5 -5
- 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 +96 -15
- 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/minimap.d.ts +4 -2
- package/lib/minimap.js +16 -3
- package/lib/types.d.ts +86 -2
- package/lib/types.js +39 -0
- package/package.json +1 -1
- package/static/atwinui.css +263 -0
- package/static/map.css +9 -1
- package/static/utility.css +81 -1
|
@@ -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, };
|
package/lib/atwinui/events.js
CHANGED
|
@@ -8,11 +8,11 @@ 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, detachTagMedia, getTagDataCollection } 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, setPipeCategories, setPipes, detachTagMedia, getTagDataCollection } from "../architwin";
|
|
12
12
|
import { Notyf } from 'notyf';
|
|
13
13
|
import 'notyf/notyf.min.css';
|
|
14
|
-
import { SPACE_EVENTS, COORDINATE_SYSTEM, UNITS, DEGREE, MAP_OPTIONS } from "../types";
|
|
15
|
-
import { initFormData } from "./components/toolbar/tagFormPane";
|
|
14
|
+
import { SPACE_EVENTS, COORDINATE_SYSTEM, UNITS, DEGREE, MAP_OPTIONS, CUSTOM_MAP_MODE } from "../types";
|
|
15
|
+
import { initFormData, setTagFormMode } from "./components/toolbar/tagFormPane";
|
|
16
16
|
import { renderObjectList } from "./components/toolbar/objectListPane";
|
|
17
17
|
import { renderLibraryList } from "./components/toolbar/libraryPane";
|
|
18
18
|
import { renderObjectCard } from "./components/toolbar/card";
|
|
@@ -29,9 +29,15 @@ 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 } from './components/toolbar/tagListPane';
|
|
32
|
+
import { PipeList } from "./components/toolbar/pipeListPane";
|
|
33
|
+
import { PipeForm } from "./components/toolbar/pipeFormPane";
|
|
34
|
+
// import { EditPipeForm, initPipeFormPane, pipeFormData, setPipeFormMode } from "./components/toolbar/pipeFormPane";
|
|
35
|
+
// import { initPipeData } from "./components/toolbar/addPipePane";
|
|
32
36
|
import { unsendComment, timedoutComment, getTheseTagMessages } from './components/toolbar/tagMessagingPane';
|
|
37
|
+
const pipeList = new PipeList();
|
|
38
|
+
const pipeForm = new PipeForm();
|
|
33
39
|
let activeToolbarItem, activeActionItem, activePane, activeActionPane, cancelTagPlacementPrompt, cancelModelPlacementPrompt;
|
|
34
|
-
let notyf = new Notyf({ position: { x: 'left', y: 'bottom' }, duration: 4500, types: [
|
|
40
|
+
export let notyf = new Notyf({ position: { x: 'left', y: 'bottom' }, duration: 4500, types: [
|
|
35
41
|
{
|
|
36
42
|
type: 'info',
|
|
37
43
|
background: 'blue',
|
|
@@ -50,6 +56,7 @@ let _currentPaneId;
|
|
|
50
56
|
let isPlacingTag = false;
|
|
51
57
|
let isCustomMapControlsVisible = false;
|
|
52
58
|
let isNotyfExecuted = false; // flag for notification
|
|
59
|
+
let pipeColor = "";
|
|
53
60
|
function batchAddEventListenerByClassName(className, callback) {
|
|
54
61
|
if (className) {
|
|
55
62
|
const elements = document.querySelectorAll(`.${className}`);
|
|
@@ -215,6 +222,7 @@ function toggleDisplayPane(targetId) {
|
|
|
215
222
|
}
|
|
216
223
|
if (paneId === 'at-tag-form-pane') {
|
|
217
224
|
log.info("Tag Form Pane");
|
|
225
|
+
setTagFormMode("ADD" /* FORM_MODE.ADD */);
|
|
218
226
|
clearTagFormDropdown();
|
|
219
227
|
initFormData();
|
|
220
228
|
setTagCategoriesOption();
|
|
@@ -256,6 +264,15 @@ function toggleDisplayPane(targetId) {
|
|
|
256
264
|
initGeneralSelectedMap();
|
|
257
265
|
handleCloseActiveMinimap();
|
|
258
266
|
}
|
|
267
|
+
if (paneId === 'at-pipe-list-pane') {
|
|
268
|
+
log.info("Pipe Pane");
|
|
269
|
+
//setup pipe list pane initialization
|
|
270
|
+
pipeList.init();
|
|
271
|
+
}
|
|
272
|
+
if (paneId === 'at-pipe-form-pane') {
|
|
273
|
+
log.info("Pipe Pane");
|
|
274
|
+
}
|
|
275
|
+
console.log("paneId", paneId);
|
|
259
276
|
return;
|
|
260
277
|
}
|
|
261
278
|
else {
|
|
@@ -264,7 +281,7 @@ function toggleDisplayPane(targetId) {
|
|
|
264
281
|
return;
|
|
265
282
|
}
|
|
266
283
|
}
|
|
267
|
-
log.error('Could not get value of target-pane attribute');
|
|
284
|
+
log.error('Could not get value of target-pane attribute', targetId);
|
|
268
285
|
return;
|
|
269
286
|
});
|
|
270
287
|
}
|
|
@@ -341,8 +358,44 @@ function setupIndividualEventListeners() {
|
|
|
341
358
|
handleCloseCustomMinimap();
|
|
342
359
|
handleCustomMapControls();
|
|
343
360
|
handleCloseActiveMinimap();
|
|
361
|
+
handlePipeForm();
|
|
362
|
+
handlePipeList();
|
|
363
|
+
}
|
|
364
|
+
//================ OBJECT EVENT HANDLERS ===============//s
|
|
365
|
+
// handle pipe undo drawing
|
|
366
|
+
function handleUndoPipeDrawing() {
|
|
367
|
+
}
|
|
368
|
+
// handle pipe redo drawing
|
|
369
|
+
function handleRedoDrawing() {
|
|
370
|
+
}
|
|
371
|
+
function handlePipeCategory(payload) {
|
|
372
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
373
|
+
console.log("HANDLE CATEGORY =>", payload);
|
|
374
|
+
// set categories latest value
|
|
375
|
+
yield setPipeCategories(payload);
|
|
376
|
+
});
|
|
377
|
+
}
|
|
378
|
+
function handlePipe(payload) {
|
|
379
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
380
|
+
console.log("HANDLE PIPE =>", payload);
|
|
381
|
+
// set pipes latest value
|
|
382
|
+
yield setPipes(payload);
|
|
383
|
+
});
|
|
384
|
+
}
|
|
385
|
+
//handler pipe form events
|
|
386
|
+
function handlePipeForm() {
|
|
387
|
+
// setup events from pipe form
|
|
388
|
+
pipeForm.save();
|
|
389
|
+
pipeForm.cancel();
|
|
390
|
+
pipeForm.draw();
|
|
391
|
+
pipeForm.undo();
|
|
392
|
+
pipeForm.redo();
|
|
393
|
+
}
|
|
394
|
+
//handle pipe list event
|
|
395
|
+
function handlePipeList() {
|
|
396
|
+
// setup event from pipe list
|
|
397
|
+
pipeList.add();
|
|
344
398
|
}
|
|
345
|
-
//================ OBJECT EVENT HANDLERS ===============//
|
|
346
399
|
function handleTranslateObject() {
|
|
347
400
|
const translateObjectbtn = document.getElementById('at-translate-action-btn');
|
|
348
401
|
translateObjectbtn.addEventListener('click', () => {
|
|
@@ -382,7 +435,7 @@ function handleCopyObject() {
|
|
|
382
435
|
function onCopyModel() {
|
|
383
436
|
return __awaiter(this, void 0, void 0, function* () {
|
|
384
437
|
//Clear transform controls otherwise the original object will move to the duplicated object position making it look
|
|
385
|
-
//like the original
|
|
438
|
+
//like the original disappeare
|
|
386
439
|
const selectedObj = getSelectedObject().object;
|
|
387
440
|
log.info("copyModel selectedObj ", selectedObj);
|
|
388
441
|
const objectCards = document.getElementById('at-object-cards');
|
|
@@ -997,6 +1050,7 @@ function handleSaveTag() {
|
|
|
997
1050
|
clearTagFormDropdown();
|
|
998
1051
|
iTag = null;
|
|
999
1052
|
saveTagBtn.classList.remove('at_disabled');
|
|
1053
|
+
setTagFormMode("NONE" /* FORM_MODE.NONE */);
|
|
1000
1054
|
}));
|
|
1001
1055
|
}
|
|
1002
1056
|
function handleScreenshot() {
|
|
@@ -1277,6 +1331,9 @@ function setupSpaceEventSubscriptions() {
|
|
|
1277
1331
|
subscribeSpaceEvent(SPACE_EVENTS.DRAW_HISTORY, handleDrawHistory);
|
|
1278
1332
|
subscribeSpaceEvent(SPACE_EVENTS.FLOOR_IMAGE_UPLOADED, handleCustomMapFloorImageUploaded);
|
|
1279
1333
|
subscribeSpaceEvent(SPACE_EVENTS.FLOOR_IMAGE_UPLOAD_FAILED, handleCustomMapFloorUploadFailed);
|
|
1334
|
+
// subscribeSpaceEvent(SPACE_EVENTS.DRAW_PIPE, handleDrawPipe)
|
|
1335
|
+
subscribeSpaceEvent(SPACE_EVENTS.PIPE_CATEGORY_ON_CHANGE, handlePipeCategory);
|
|
1336
|
+
subscribeSpaceEvent(SPACE_EVENTS.PIPE_ON_CHANGE, handlePipe);
|
|
1280
1337
|
}
|
|
1281
1338
|
function handleDragEnd(payload) {
|
|
1282
1339
|
console.log("handleDragEnd payload", payload);
|
|
@@ -1322,7 +1379,7 @@ function handleDragEnd(payload) {
|
|
|
1322
1379
|
showCurrentCoordinateValue();
|
|
1323
1380
|
const transformValues = {
|
|
1324
1381
|
object_position: payload.object_position,
|
|
1325
|
-
object_rotation: payload.object_rotation
|
|
1382
|
+
object_rotation: payload.object_rotationƒ,
|
|
1326
1383
|
object_scale: payload.object_scale,
|
|
1327
1384
|
};
|
|
1328
1385
|
setCurrentTransformationValues(transformValues);
|
|
@@ -1347,13 +1404,21 @@ function handleDrawHistory(payload) {
|
|
|
1347
1404
|
const redoBtn = document.getElementById('at-draw-redo-btn');
|
|
1348
1405
|
redoBtn.classList.remove('at_disabled');
|
|
1349
1406
|
}
|
|
1407
|
+
console.log("undoCount", undoCount);
|
|
1408
|
+
console.log("redoCount", redoCount);
|
|
1350
1409
|
}
|
|
1351
|
-
function handleVertexPlace() {
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1410
|
+
function handleVertexPlace(payload) {
|
|
1411
|
+
console.log("handleVertexPlace ==>", payload);
|
|
1412
|
+
if (isToolbarFeatureEnabled('roomCreation')) {
|
|
1413
|
+
const undoBtn = document.getElementById('at-draw-undo-btn');
|
|
1414
|
+
undoBtn.classList.remove('at_disabled');
|
|
1415
|
+
setCurrentPartitionData();
|
|
1416
|
+
const redoBtn = document.getElementById('at-draw-redo-btn');
|
|
1417
|
+
redoBtn.classList.add('at_disabled');
|
|
1418
|
+
}
|
|
1419
|
+
if (isToolbarFeatureEnabled('pipe')) {
|
|
1420
|
+
pipeForm.setPipeVertices(payload.path);
|
|
1421
|
+
}
|
|
1357
1422
|
}
|
|
1358
1423
|
function handleMouseClickObject(object) {
|
|
1359
1424
|
var _a, _b, _c;
|
|
@@ -2544,21 +2609,37 @@ function handleShowCustomMinimapSettings() {
|
|
|
2544
2609
|
settingsBtn.addEventListener('click', () => {
|
|
2545
2610
|
isCustomMapControlsVisible = !isCustomMapControlsVisible;
|
|
2546
2611
|
if (mapControlsContainer) {
|
|
2612
|
+
// Shows setting controls
|
|
2547
2613
|
if (isCustomMapControlsVisible) {
|
|
2548
2614
|
mapControlsContainer.classList.add('show');
|
|
2549
2615
|
minimapPane.classList.add('show-settings');
|
|
2616
|
+
minimap.setCustomMapMode(CUSTOM_MAP_MODE.EDIT);
|
|
2617
|
+
// Enter edit mode; Update sweep color
|
|
2618
|
+
updateSweepColor(CUSTOM_MAP_MODE.EDIT);
|
|
2550
2619
|
}
|
|
2551
2620
|
else {
|
|
2621
|
+
// Hides setting controld
|
|
2552
2622
|
mapControlsContainer.classList.remove('show');
|
|
2553
2623
|
if (minimap.getMinimapPosition().includes('bottom')) {
|
|
2554
2624
|
minimapPane.classList.add('no-transition');
|
|
2555
2625
|
}
|
|
2556
2626
|
minimapPane.classList.remove('show-settings');
|
|
2627
|
+
minimap.setCustomMapMode(CUSTOM_MAP_MODE.DEFAULT);
|
|
2628
|
+
// Exit edit mode; Back to default color
|
|
2629
|
+
updateSweepColor(CUSTOM_MAP_MODE.DEFAULT);
|
|
2557
2630
|
}
|
|
2558
2631
|
}
|
|
2559
2632
|
});
|
|
2560
2633
|
}
|
|
2561
2634
|
}
|
|
2635
|
+
function updateSweepColor(mode) {
|
|
2636
|
+
const addClass = mode === CUSTOM_MAP_MODE.EDIT ? 'at_sweep_color_edit' : 'at_sweep_color_default';
|
|
2637
|
+
const removeClass = mode === CUSTOM_MAP_MODE.EDIT ? 'at_sweep_color_default' : 'at_sweep_color_edit';
|
|
2638
|
+
document.querySelectorAll('.at_custom_sweep').forEach(el => {
|
|
2639
|
+
el.classList.remove(removeClass);
|
|
2640
|
+
el.classList.add(addClass);
|
|
2641
|
+
});
|
|
2642
|
+
}
|
|
2562
2643
|
/**
|
|
2563
2644
|
* Closes the custom minimap panel.
|
|
2564
2645
|
*/
|
|
@@ -2989,7 +3070,7 @@ function handleCloseActiveMinimap() {
|
|
|
2989
3070
|
}
|
|
2990
3071
|
export {
|
|
2991
3072
|
//state
|
|
2992
|
-
activeToolbarItem, activeActionItem, cancelModelPlacementPrompt, isCustomMapControlsVisible,
|
|
3073
|
+
activeToolbarItem, activeActionItem, cancelModelPlacementPrompt, isCustomMapControlsVisible, pipeColor,
|
|
2993
3074
|
//methods
|
|
2994
3075
|
batchAddEventListenerById, batchAddEventListenerByClassName, batchAddEventListenerByClassNames, batchAddEventListenerByDataAttribute, setActiveToolbarItem, toggleDisplayPane, toggleActionBar, setupIndividualEventListeners, setupSpaceEventSubscriptions, handleModelVisibility, handleDeleteModel, handleShowMinimap, handleScrollToView, handleRenderMeetingUI, handleShowCustomMinimap,
|
|
2995
3076
|
// partition
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export declare function waitForChange<T>(getter: () => T, options?: {
|
|
2
|
+
interval?: number;
|
|
3
|
+
timeout?: number;
|
|
4
|
+
}): Promise<T>;
|
|
5
|
+
export declare function waitForChange<T1, T2>(getter1: () => T1, getter2: () => T2, options?: {
|
|
6
|
+
interval?: number;
|
|
7
|
+
timeout?: number;
|
|
8
|
+
}): Promise<[T1, T2]>;
|
|
9
|
+
/**
|
|
10
|
+
* Binds an input element's value to a target object's property using input and mutation observers.
|
|
11
|
+
* @param input The input HTML element to observe
|
|
12
|
+
* @param getTarget A function returning the target object (like _selectedPipeCategory)
|
|
13
|
+
* @param key The key of the target object to update
|
|
14
|
+
*/
|
|
15
|
+
export declare function observeInputToUpdate(input: HTMLInputElement, getTarget: () => Record<string, any> | undefined, key: string): void;
|