architwin 1.12.5 → 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.
Files changed (39) hide show
  1. package/CORE_FEATURES.md +35 -0
  2. package/lib/architwin.d.ts +96 -5
  3. package/lib/architwin.js +1 -1
  4. package/lib/atwinui/components/toolbar/collapse.d.ts +18 -0
  5. package/lib/atwinui/components/toolbar/collapse.js +62 -0
  6. package/lib/atwinui/components/toolbar/i18n.js +52 -2
  7. package/lib/atwinui/components/toolbar/index.js +11 -1
  8. package/lib/atwinui/components/toolbar/menuBar.d.ts +1 -0
  9. package/lib/atwinui/components/toolbar/menuBar.js +11 -0
  10. package/lib/atwinui/components/toolbar/pipeFormPane.d.ts +31 -0
  11. package/lib/atwinui/components/toolbar/pipeFormPane.js +545 -0
  12. package/lib/atwinui/components/toolbar/pipeListPane.d.ts +19 -0
  13. package/lib/atwinui/components/toolbar/pipeListPane.js +388 -0
  14. package/lib/atwinui/components/toolbar/spaceUserListPane.d.ts +3 -0
  15. package/lib/atwinui/components/toolbar/spaceUserListPane.js +95 -0
  16. package/lib/atwinui/components/toolbar/tagIotForm.d.ts +20 -0
  17. package/lib/atwinui/components/toolbar/tagIotForm.js +391 -0
  18. package/lib/atwinui/components/toolbar/tagIotFormPane.d.ts +62 -0
  19. package/lib/atwinui/components/toolbar/tagIotFormPane.js +606 -0
  20. package/lib/atwinui/components/toolbar/usersPane.d.ts +14 -0
  21. package/lib/atwinui/components/toolbar/usersPane.js +273 -0
  22. package/lib/atwinui/components/toolbar/viewingRemoteSpace.d.ts +7 -0
  23. package/lib/atwinui/components/toolbar/viewingRemoteSpace.js +77 -0
  24. package/lib/atwinui/events.d.ts +4 -1
  25. package/lib/atwinui/events.js +76 -13
  26. package/lib/atwinui/helpers.d.ts +15 -0
  27. package/lib/atwinui/helpers.js +49 -0
  28. package/lib/atwinui/index.js +2 -0
  29. package/lib/loaders/curosrMarkerLoader.d.ts +25 -0
  30. package/lib/loaders/curosrMarkerLoader.js +86 -0
  31. package/lib/loaders/index.d.ts +2 -1
  32. package/lib/loaders/index.js +2 -1
  33. package/lib/loaders/pathLoader.d.ts +99 -0
  34. package/lib/loaders/pathLoader.js +451 -0
  35. package/lib/types.d.ts +79 -1
  36. package/lib/types.js +34 -0
  37. package/package.json +1 -1
  38. package/static/atwinui.css +263 -0
  39. package/static/utility.css +81 -1
@@ -0,0 +1,388 @@
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
+ };
10
+ import { _3DXObjects, _pipeCategories, _pipes, _selectedPipeCategory, dispatchSpaceEvent, disposeModel, moveToSweep, renderPath, setModelVisibility } from "../../../architwin";
11
+ import i18n from './i18n';
12
+ import { COLLAPSE, SPACE_EVENTS } from "../../../types";
13
+ import { Collapse } from "./collapse";
14
+ import { notyf, toggleDisplayPane } from "../../events";
15
+ import { PipeForm } from "./pipeFormPane";
16
+ import { waitForChange } from "../../helpers";
17
+ import { getShortcutTooltipHTML } from "./static/common";
18
+ import { setModalAction, toggleModal } from "./modal";
19
+ export class PipeList {
20
+ // Initialize collapse UI and pipe form
21
+ constructor() {
22
+ this.categories = [];
23
+ this.pipes = [];
24
+ this.collapse = new Collapse(undefined, { expand: false });
25
+ this.form = new PipeForm();
26
+ }
27
+ // render the main pane
28
+ renderPane() {
29
+ const element = document.createElement('div');
30
+ element.classList.add('at_container', 'at_w-12', 'at_h-responsive-64');
31
+ element.id = 'at-pipe-list-pane';
32
+ element.setAttribute('data-cy', 'at-pipe-list-pane');
33
+ element.innerHTML = `
34
+ <div class="at_panel_header at_flex at_justify_between at_items_center">
35
+ <span class="mdi mdi-keyboard at_pull_left at_icon_hover ">
36
+ ${getShortcutTooltipHTML()}
37
+ </span>
38
+ <span>${i18n.t('Pipes')}</span>
39
+ </div>
40
+ <div class="at_form_container ">
41
+ <div class="at_field at_flex_column" style="${_pipeCategories ? '' : 'display: none;'}">
42
+ <div class="">
43
+ <span>${i18n.t('SelectPipeType')}</span>
44
+ </div>
45
+ <div id="at-custom-pipe-category-dropdown" data-cy="at-custom-pipe-category-dropdown">
46
+ <div id="at-pipe-category-dropdown" class=" at_dropdown at_flex at_flex_row at_space_between">
47
+ <div class="at_dropdown_toggle" id="at-pipe-category-dropdown-toggle" data-cy="at-pipe-category-dropdown-toggle">${i18n.t('NoSelection')}</div>
48
+ <span class="mdi mdi-triangle-down at_chevron" id="at-pipe-category-chevron" data-cy="at-pipe-category-chevron"></span>
49
+ </div>
50
+ <div style="position:absolute">
51
+ <div class="at_dropdown_options" id="at-pipe-category-options" data-cy="at-pipe-category-options">
52
+ </div>
53
+ </div>
54
+ </div>
55
+
56
+ </div>
57
+ </div>
58
+ <div class="at_form_container at_field ">
59
+ <div class="at_collapsible_container" id="at-dropdown_container">
60
+ <div id="at-pipe-type-collapse-html-element"></div>
61
+ </div>
62
+ </div>
63
+ <div class="at_flex at_align_item_end at_button_row at_justify_end">
64
+ <div class="at_button at_ghost" id="at-add-pipe-btn" data-cy="at-add-pipe-btn" target-pane="at-pipe-form-pane">
65
+ ${i18n.t('AddPipeType')}
66
+ <span class="mdi mdi-plus-circle-outline"></span>
67
+ </div>
68
+ </div>
69
+ `;
70
+ return element;
71
+ }
72
+ // create element for collapse element
73
+ createCollapseElement(categories, pipes) {
74
+ const element = document.createElement('div');
75
+ element.classList.add('at_collapse_container', 'at_h-responsive-304');
76
+ element.innerHTML = categories.length ? categories.sort((a, b) => new Date(a.created_on).getTime() - new Date(b.created_on).getTime()).map((category, index) => {
77
+ var _a;
78
+ return `
79
+ <div class="collapse-container at_accent_forest at_rounded at_mb_2" id="at-collapsible-${COLLAPSE.HEADER}-${category.uuid}" data-uuid="${category.uuid}" data-type="${COLLAPSE.HEADER}">
80
+ <div class="" id="at-locate-area-${COLLAPSE.HEADER}-${category.uuid}" data-uuid="${category.uuid}" data-type="${COLLAPSE.HEADER}">
81
+ <div class="at_collapsible_header at_p-2" id="at-header-collapse-${index}">
82
+ <div>
83
+ <span class="mdi mdi-triangle-down ${COLLAPSE.TOGGLE_ID}" id="${COLLAPSE.TOGGLE_ID}" data-cy="at-collapsible-toggle-btn-${category.uuid}"></span>
84
+ <span class="mdi mdi-checkbox-blank" style="color:${(_a = JSON.parse(category.json_data)) === null || _a === void 0 ? void 0 : _a.color}"></span>
85
+ <span>${category.name}</span>
86
+ </div>
87
+ <div class="at_flex at_justify_end at_gap_2">
88
+ <span class="mdi mdi-pen" id="at-edit-btn-${COLLAPSE.HEADER}-${category.uuid}" data-type="${COLLAPSE.HEADER}" data-uuid="${category.uuid}" data-cy="at-pipe-type-edit-btn-${category.uuid}" target-pane="at-pipe-form-pane"></span>
89
+ <span class="mdi mdi-trash-can-outline" id="at-delete-btn-${COLLAPSE.HEADER}-${category.uuid}" data-type="${COLLAPSE.HEADER}" data-uuid="${category.uuid}" data-cy="at-pipe-type-delete-btn"></span>
90
+ <span class="mdi mdi-eye" id="at-view-btn-${COLLAPSE.HEADER}-${category.uuid}" data-type="${COLLAPSE.HEADER}" data-cy="at-pipe-type-view-btn" data-uuid="${category.uuid}"></span>
91
+ </div>
92
+ </div>
93
+ <div class="at_collapsible_content at_secondary_azusa" id="${COLLAPSE.CONTENT_ID}">
94
+ <div class="at_p-2">
95
+
96
+ ${pipes != undefined && pipes.filter(pipe => pipe.category_uuid === category.uuid).length ?
97
+ pipes.filter(pipe => pipe.category_uuid === category.uuid).sort((a, b) => new Date(a.created_on).getTime() - new Date(b.created_on).getTime()).map(pipe => `
98
+ <div class="at_locate_area_container at_flex at_justify_end at_gap_2" id="at-collapsible-${COLLAPSE.LIST}-${pipe.uuid}" data-uuid="${pipe.uuid}" data-type="${COLLAPSE.LIST}">
99
+ <div id="at-locate-area-${COLLAPSE.LIST}-${pipe.uuid}" data-uuid="${pipe.uuid}" data-type="${COLLAPSE.LIST}">
100
+ <span>${pipe.name}</span>
101
+ <span class="mdi mdi-trash-can-outline at-pipe-filter-chevron" id="at-delete-btn-${COLLAPSE.LIST}-${pipe.uuid}" data-cy="at-pipe-delete-btn" data-type="${COLLAPSE.LIST}" data-uuid="${pipe.uuid}"></span>
102
+ <span class="mdi mdi-eye at-pipe-filter-chevron" id="at-view-btn-${COLLAPSE.LIST}-${pipe.uuid}" data-cy="at-pipe-view-btn" data-uuid="${pipe.uuid}" data-type="${COLLAPSE.LIST}"></span>
103
+ </div>
104
+ </div>
105
+ `).join('')
106
+ :
107
+ `
108
+ <div class="at_flex at_justify_center at_items_center at_flex_column">
109
+ <div style="white-space:nowrap"> ${i18n.t('NoPipesToDisplay')}</div>
110
+ </div>
111
+ `}
112
+ </div>
113
+ </div>
114
+ </div>
115
+ </div>
116
+ `;
117
+ }).join('')
118
+ : `
119
+ <div class="at_h-responsive-304">
120
+ <div class=" at_flex at_justify_center at_items_center at_flex_column at_h-full">
121
+ <span class="mdi mdi-pipe-disconnected at_pipe_category at_text-xxl"></span>
122
+ <div class="at_text_xs" style="white-space:nowrap"> ${i18n.t('NoPipesTypeToDisplay')}</div>
123
+ </div>
124
+ </div>
125
+ `;
126
+ return element;
127
+ }
128
+ //initialize pane, data binding and some handlers
129
+ init() {
130
+ return __awaiter(this, void 0, void 0, function* () {
131
+ const container = document.getElementById('at-pipe-type-collapse-html-element');
132
+ if (!container)
133
+ return;
134
+ const element = this.createCollapseElement(_pipeCategories, _pipes);
135
+ this.collapse.setElement(element);
136
+ const rendered = this.collapse.render();
137
+ container.replaceChildren(rendered);
138
+ this.eventHandler();
139
+ this.form.resetInteractionState();
140
+ this.initDropdown(_pipeCategories.sort((a, b) => new Date(a.created_on).getTime() - new Date(b.created_on).getTime()).map(category => category.name));
141
+ this.renderPipePaths();
142
+ const options = document.getElementById('at-pipe-category-options');
143
+ if (options.classList.contains('open')) {
144
+ options.classList.remove('open');
145
+ }
146
+ });
147
+ }
148
+ eventHandler() {
149
+ this.edit();
150
+ this.delete();
151
+ this.toggle();
152
+ this.locate();
153
+ this.handleClickItem();
154
+ this.collapse.init();
155
+ }
156
+ handleClickItem() {
157
+ document.querySelectorAll('.at_locate_area_container').forEach(container => {
158
+ container.addEventListener('click', (e) => {
159
+ const target = e.currentTarget;
160
+ if (target.classList.contains('selected')) {
161
+ target.classList.toggle('selected');
162
+ return;
163
+ }
164
+ document.querySelectorAll('.at_locate_area_container.selected').forEach(el => el.classList.remove('selected'));
165
+ target.classList.toggle('selected');
166
+ });
167
+ });
168
+ }
169
+ locate() {
170
+ document.querySelectorAll('[id^="at-locate-area"]').forEach(el => {
171
+ el.addEventListener('click', ({ currentTarget }) => __awaiter(this, void 0, void 0, function* () {
172
+ var _a;
173
+ const target = currentTarget;
174
+ const uuid = target.dataset.uuid;
175
+ const type = target.dataset.type;
176
+ console.log("CLICKED");
177
+ const pipe = type === COLLAPSE.HEADER
178
+ ? _pipes.find(p => p.category_uuid === uuid)
179
+ : _pipes.find(p => p.uuid === uuid);
180
+ const parsed = JSON.parse((_a = pipe === null || pipe === void 0 ? void 0 : pipe.json_data) !== null && _a !== void 0 ? _a : '{}');
181
+ if (parsed.sweepId) {
182
+ moveToSweep(parsed.sweepId, parsed.rotation);
183
+ }
184
+ }));
185
+ });
186
+ }
187
+ // add pipe listiner
188
+ add() {
189
+ const btn = document.getElementById('at-add-pipe-btn');
190
+ if (!btn)
191
+ return;
192
+ btn.addEventListener('click', (e) => __awaiter(this, void 0, void 0, function* () {
193
+ const target = e.currentTarget;
194
+ yield dispatchSpaceEvent(SPACE_EVENTS.PIPE_CATEGORY_SAVED, {});
195
+ //wait until the _selectedPipeCategory change state value
196
+ const newCategory = yield waitForChange(() => _selectedPipeCategory);
197
+ console.log("CLICKED ADD CATEGORY =>", newCategory);
198
+ this.form.setPipeTitle("AddPipeType");
199
+ yield this.form.init(newCategory);
200
+ yield toggleDisplayPane(target.id);
201
+ }));
202
+ }
203
+ //edit pipe listiner
204
+ edit() {
205
+ document.querySelectorAll('[id^="at-edit-btn"]').forEach(btn => {
206
+ btn.addEventListener('click', (e) => __awaiter(this, void 0, void 0, function* () {
207
+ const target = e.currentTarget;
208
+ const uuid = target.dataset.uuid;
209
+ this.form.setPipeTitle("EditPipeType");
210
+ yield dispatchSpaceEvent(SPACE_EVENTS.PIPE_CATEGORY_SELECTED, uuid);
211
+ yield this.form.init(_selectedPipeCategory, _pipes);
212
+ yield toggleDisplayPane(target.id);
213
+ }));
214
+ });
215
+ }
216
+ //toggle visibility listiner
217
+ toggle() {
218
+ document.querySelectorAll('[id^="at-view-btn"]').forEach(el => {
219
+ el.addEventListener('click', (e) => __awaiter(this, void 0, void 0, function* () {
220
+ const target = e.currentTarget;
221
+ const uuid = target.dataset.uuid;
222
+ const type = target.dataset.type;
223
+ if (!uuid)
224
+ return;
225
+ if (type === COLLAPSE.HEADER) {
226
+ // Toggle the header icon
227
+ const isCurrentlyEye = target.classList.contains('mdi-eye');
228
+ target.classList.replace(isCurrentlyEye ? 'mdi-eye' : 'mdi-eye-off-outline', isCurrentlyEye ? 'mdi-eye-off-outline' : 'mdi-eye');
229
+ // Apply the same state to all its child list icons
230
+ _pipes
231
+ .filter(pipe => pipe.category_uuid === uuid)
232
+ .forEach(pipe => {
233
+ const listEl = document.getElementById(`at-view-btn-${COLLAPSE.LIST}-${pipe.uuid}`);
234
+ if (listEl) {
235
+ listEl.classList.replace(isCurrentlyEye ? 'mdi-eye' : 'mdi-eye-off-outline', isCurrentlyEye ? 'mdi-eye-off-outline' : 'mdi-eye');
236
+ }
237
+ const targetObj = _3DXObjects.find(obj => obj.object.uuid === pipe.uuid);
238
+ if (targetObj) {
239
+ setModelVisibility(targetObj.object.id);
240
+ }
241
+ });
242
+ }
243
+ else {
244
+ // Toggle list icon
245
+ const isCurrentlyEye = target.classList.contains('mdi-eye');
246
+ target.classList.replace(isCurrentlyEye ? 'mdi-eye' : 'mdi-eye-off-outline', isCurrentlyEye ? 'mdi-eye-off-outline' : 'mdi-eye');
247
+ // After toggling, check if all list items under the same header are off or not
248
+ const pipe = _pipes.find(pipe => pipe.uuid === uuid);
249
+ if (!pipe)
250
+ return;
251
+ const headerBtn = document.getElementById(`at-view-btn-${COLLAPSE.HEADER}-${pipe.category_uuid}`);
252
+ if (!headerBtn)
253
+ return;
254
+ const allListIcons = _pipes
255
+ .filter(p => p.category_uuid === pipe.category_uuid)
256
+ .map(p => document.getElementById(`at-view-btn-${COLLAPSE.LIST}-${p.uuid}`))
257
+ .filter(Boolean);
258
+ const allOff = allListIcons.every(icon => icon.classList.contains('mdi-eye-off-outline'));
259
+ headerBtn.classList.replace(allOff ? 'mdi-eye' : 'mdi-eye-off-outline', allOff ? 'mdi-eye-off-outline' : 'mdi-eye');
260
+ const targetObj = _3DXObjects.find(obj => obj.object.uuid === uuid);
261
+ if (targetObj) {
262
+ setModelVisibility(targetObj.object.id);
263
+ }
264
+ }
265
+ }));
266
+ });
267
+ }
268
+ //delete and dispose 3d objects
269
+ delete() {
270
+ document.querySelectorAll('[id^="at-delete-btn"]').forEach(el => {
271
+ el.addEventListener('click', (e) => __awaiter(this, void 0, void 0, function* () {
272
+ const target = e.currentTarget;
273
+ const uuid = target.dataset.uuid;
274
+ const type = target.dataset.type;
275
+ toggleModal();
276
+ setModalAction({
277
+ title: `${i18n.t('DeletePipeCategory')}`,
278
+ description: `${i18n.t('ConfirmDeletePipeCategory')}`,
279
+ buttonLabel: `${i18n.t('YesDelete')}`
280
+ }, () => {
281
+ if (uuid) {
282
+ if (type == COLLAPSE.HEADER) {
283
+ dispatchSpaceEvent(SPACE_EVENTS.PIPE_CATEGORY_REMOVED, uuid);
284
+ _pipes.filter(pipe => pipe.category_uuid == uuid).forEach(pipe => {
285
+ const targetObj = _3DXObjects.find(obj => obj.object.uuid == pipe.uuid);
286
+ if (targetObj) {
287
+ disposeModel(targetObj);
288
+ }
289
+ });
290
+ notyf.success(`${i18n.t('PipeCategoryDeletedSuccessfully')}`);
291
+ toggleModal(false);
292
+ }
293
+ else {
294
+ dispatchSpaceEvent(SPACE_EVENTS.PIPE_REMOVED, uuid);
295
+ const targetObj = _3DXObjects.find(obj => obj.object.uuid == uuid);
296
+ if (targetObj) {
297
+ disposeModel(targetObj);
298
+ }
299
+ notyf.success(`${i18n.t('PipeDeletedSuccessfully')}`);
300
+ toggleModal(false);
301
+ }
302
+ this.collapse.removeElement(uuid, type);
303
+ }
304
+ });
305
+ }));
306
+ });
307
+ }
308
+ //render pipe path 3D objects
309
+ renderPipePaths() {
310
+ // initialize to empty
311
+ _3DXObjects.filter(x => x.type === 'PATH').forEach(disposeModel);
312
+ // render paths
313
+ _pipeCategories.forEach(categories => {
314
+ var _a;
315
+ const _categories = JSON.parse((_a = categories === null || categories === void 0 ? void 0 : categories.json_data) !== null && _a !== void 0 ? _a : '{}');
316
+ _pipes.filter(pipe => pipe.category_uuid == categories.uuid).forEach(pipe => {
317
+ var _a;
318
+ const _pipe = JSON.parse((_a = pipe === null || pipe === void 0 ? void 0 : pipe.json_data) !== null && _a !== void 0 ? _a : '{}');
319
+ if (!_pipe)
320
+ return;
321
+ if (_pipe.vertices) {
322
+ renderPath(_pipe.vertices, {
323
+ uuid: pipe.uuid,
324
+ textColor: _categories.color,
325
+ fillColor: 'none'
326
+ });
327
+ }
328
+ });
329
+ });
330
+ }
331
+ initDropdown(options) {
332
+ // Ensure unique options
333
+ const uniqueOptions = [i18n.t("NoSelection"), ...[...new Set(options)]];
334
+ const toggleBtn = document.getElementById('at-custom-pipe-category-dropdown');
335
+ const optionsContainer = document.getElementById('at-pipe-category-options');
336
+ const toggleLabel = toggleBtn.querySelector('#at-pipe-category-dropdown-toggle');
337
+ toggleLabel.textContent = i18n.t("NoSelection");
338
+ toggleBtn.onclick = () => {
339
+ const isNowOpen = optionsContainer.classList.toggle('open');
340
+ if (isNowOpen) {
341
+ optionsContainer.innerHTML = '';
342
+ uniqueOptions.forEach(opt => {
343
+ const div = document.createElement('div');
344
+ div.style.width = '228px';
345
+ div.style.cursor = "pointer";
346
+ div.textContent = opt;
347
+ div.classList.add('at_dropdown-option');
348
+ // Mark the default selected (All Category)
349
+ if (opt === toggleLabel.textContent) {
350
+ div.classList.add('selected');
351
+ }
352
+ div.onclick = () => {
353
+ toggleLabel.textContent = opt;
354
+ // Remove .selected from all
355
+ document.querySelectorAll('.at_dropdown-option.selected').forEach(el => el.classList.remove('selected'));
356
+ div.classList.add('selected');
357
+ console.log("OPT", opt);
358
+ const filteredCategory = opt === i18n.t('NoSelection')
359
+ ? _pipeCategories
360
+ : _pipeCategories.filter(category => category.name === opt);
361
+ // Get all selected category UUIDs (can be multiple if same name)
362
+ const selectedCategoryUUIDs = filteredCategory.map(cat => cat.uuid);
363
+ _pipes.forEach(pipe => {
364
+ const isVisible = selectedCategoryUUIDs.includes(pipe.category_uuid);
365
+ const targetObj = _3DXObjects.find(obj => obj.object.uuid === pipe.uuid);
366
+ if (targetObj) {
367
+ setModelVisibility(targetObj.object.id, isVisible);
368
+ }
369
+ });
370
+ const container = document.getElementById('at-pipe-type-collapse-html-element');
371
+ if (!container)
372
+ return;
373
+ const element = this.createCollapseElement(filteredCategory, _pipes);
374
+ this.collapse.setElement(element);
375
+ const rendered = this.collapse.render();
376
+ container.replaceChildren(rendered);
377
+ this.eventHandler();
378
+ optionsContainer.classList.remove('open');
379
+ };
380
+ optionsContainer.appendChild(div);
381
+ });
382
+ }
383
+ else {
384
+ optionsContainer.innerHTML = '';
385
+ }
386
+ };
387
+ }
388
+ }
@@ -0,0 +1,3 @@
1
+ import { ISpaceUser } from "../../../types";
2
+ export declare function renderSpaceUserListPane(): HTMLElement;
3
+ export declare function renderUserRows(userList: ISpaceUser[]): void;
@@ -0,0 +1,95 @@
1
+ import i18n from './i18n';
2
+ import { getBundleVersion } from "../../../utils";
3
+ export function renderSpaceUserListPane() {
4
+ const element = document.createElement('div');
5
+ element.classList.add('at_container');
6
+ element.classList.add('at_w-12');
7
+ // element.classList.add('at_h-min-70')
8
+ // element.classList.add('at_h-max-77')
9
+ element.classList.add('at_h-full');
10
+ element.setAttribute('id', 'at-space-user-list-pane');
11
+ element.setAttribute('data-cy', 'at-space-user-list-pane');
12
+ element.innerHTML = `
13
+ <div class="at_panel_header">
14
+ <span>${i18n.t('Users')}</span>
15
+ </div>
16
+
17
+ <div class="at_scrollable_container at_h-min-40"
18
+ id="at-space-user-card"
19
+ data-cy="at-space-user-card">
20
+ </div>
21
+
22
+ <div class="at_button_row at_justify_center">
23
+ <div
24
+ class="at_button at_ghost at_bg_red_600 at_w-full"
25
+ id="at-user-pane-end-session-btn"
26
+ data-cy="at-user-pane-end-session-btn"
27
+ target-pane="at-add-object-pane">
28
+ ${i18n.t('End Session')}
29
+ </div>
30
+ </div>
31
+
32
+ <div class="at_flex at_justify_center at_price"
33
+ id="at-bundle-version"
34
+ data-cy="at-bundle-version">
35
+ <small class="at_text_xxs at_text_white at_opacity_5">
36
+ ${getBundleVersion()}
37
+ </small>
38
+ </div>
39
+ `;
40
+ return element;
41
+ }
42
+ export function renderUserRows(userList) {
43
+ const container = document.getElementById('at-space-user-card');
44
+ if (!container) {
45
+ return;
46
+ }
47
+ container.innerHTML = '';
48
+ userList.forEach((user, index) => {
49
+ const card = document.createElement('div');
50
+ card.className = 'at_card at_flex at_items_center at_justify_between at_px-4 at_py-2 at_border_b at_user_list_card at_bg_black at_opacity_75';
51
+ // Left: circle + name
52
+ const left = document.createElement('div');
53
+ left.className = 'at_flex at_items_center at_gap-2';
54
+ const circle = document.createElement('span');
55
+ circle.style.width = '15px';
56
+ circle.style.height = '15px';
57
+ circle.style.borderRadius = '50%';
58
+ circle.style.backgroundColor = user.isActive ? '#22c55e' : '#ffffff';
59
+ circle.style.border = '1px solid #ccc';
60
+ circle.style.marginRight = '10px';
61
+ const nameEl = document.createElement('span');
62
+ nameEl.textContent = user.name;
63
+ nameEl.className = 'at_text_sm';
64
+ left.appendChild(circle);
65
+ left.appendChild(nameEl);
66
+ // Divider
67
+ const divider = document.createElement('div');
68
+ divider.className = 'at_flex_1 at_border_b at_mx-2';
69
+ divider.style.height = '1px';
70
+ // Right: share button styled like `at_button at_ghost`
71
+ const shareBtn = document.createElement('div');
72
+ shareBtn.id = `at-user-screen-share-btn-${user.uuid}`;
73
+ shareBtn.setAttribute('data-cy', `at-user-screen-share-btn-${user.uuid}`);
74
+ shareBtn.setAttribute('target-pane', 'at-viewing-remote-space-pane');
75
+ if (user.isSharing) {
76
+ const nowSharingText = document.createElement('span');
77
+ nowSharingText.textContent = 'Now Sharing';
78
+ nowSharingText.className = 'at_text_xs at_text_gray';
79
+ shareBtn.appendChild(nowSharingText);
80
+ }
81
+ else {
82
+ const icon = document.createElement('span');
83
+ icon.className = 'mdi mdi-monitor-share';
84
+ icon.style.fontSize = '20px';
85
+ shareBtn.className = 'at_button at_ghost';
86
+ shareBtn.style.border = 'none';
87
+ shareBtn.appendChild(icon);
88
+ }
89
+ // Assemble card
90
+ card.appendChild(left);
91
+ card.appendChild(divider);
92
+ card.appendChild(shareBtn);
93
+ container.appendChild(card);
94
+ });
95
+ }
@@ -0,0 +1,20 @@
1
+ import { FORM_MODE, ITagIOTCategory, ITagIOTDevice } from '../../../types';
2
+ export declare let iotTagFormMode: FORM_MODE;
3
+ export declare function renderTagIOTForm(): HTMLDivElement;
4
+ export declare function setIotCategoryOptions(): void;
5
+ export declare function toggleIoTCategoryOptions(): void;
6
+ export declare function toggleIoTDevicesOptions(): void;
7
+ export declare function setSelectedIoTSystemRadio(payload: string): void;
8
+ export declare function clearIoTDropdowns(): void;
9
+ export declare function initIoTFormData(): void;
10
+ export declare function renderIotCategoryDropdownOptions(elementId: string, items: Array<ITagIOTCategory>): void;
11
+ export declare function setIotDeviceOptions(): void;
12
+ export declare function renderIotDeviceDropdownOptions(elementId: string, items: Array<ITagIOTDevice>): void;
13
+ export declare function getIotTagFormData(): {
14
+ tagName: string;
15
+ modelName: string;
16
+ serialName: string;
17
+ tagMf: string;
18
+ tagCategoryId: string;
19
+ systemLink?: string;
20
+ };