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,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')} &lt;${(_currentSpace === null || _currentSpace === void 0 ? void 0 : _currentSpace.name) || i18n.t('SPACE_NAME')}&gt; ${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
+ }
@@ -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, };
@@ -8,7 +8,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
8
8
  });
9
9
  };
10
10
  import { actionBar, renderObjectCards, renderLibraryCards, renderTags, renderTagRow, getTagFormData, addClickEventToTagRow, setActiveCard, setActiveMenu, removeObjectCard, clearActiveMenu, setTagCategoriesOption, toggleDropdown, tagFormMode, selectedTag, renderRecepientOptions, renderTagMessages, createTagMessage, setTagLink, setTagMessagingDetails, renderCategoryDropdownOptions, clearTagFormDropdown, clearActiveActionBtn, clearActiveCard, toggleActionBarButtons, selectedCategoryFilterId, selectedSubCategoryFilterId, filterTagList, toggleModal, setModalAction, } from "./components/toolbar";
11
- import { getTargetPosition, addMediaScreen, _3DXObjects, selectedObject, setTransformControls, copyObject, revertTransform, clearSelectedObject, removeTransformControls, getLibrary, getMpTags, renderTag, captureSpaceScreenshot, moveTag, subscribeSpaceEvent, setModelVisibility, disposeModel, disposeTag, _tags, _tagCategories, dispatchSpaceEvent, editTagLabel, editTagDescription, setTagMessageRecepients, setTagMessages, setSelectedTagUuid, renderMeetingSidebar, setTagIcon, setObjectTransformation, getSelectedObject, _atwin, isCdnMapDataAvailable, captureScreenshotAndCameraDetails, _mpConfig, cancelModelPlacement, _modelDetails, actionHistory, get3DXObjects, transformHistory, goToModel, themeManager, _partitionNodes, setSpacePartitionNodes, getSpaceId, setFloorBaseHeight, toggleWallVisibility, getChildrenOfModel, toggleFloorVisibility, renderPolygon, getCurrentPolygon, getFloorBaseHeight, setSelectedObject, redoDrawAction, undoDrawAction, setWallBaseHeight, clearWallBaseHeight, clearFloorBaseHeight, isToolbarFeatureEnabled, captureCurrentView, getCurrentFloor, 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
14
  import { SPACE_EVENTS, COORDINATE_SYSTEM, UNITS, DEGREE, MAP_OPTIONS } from "../types";
@@ -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}`);
@@ -256,6 +263,15 @@ function toggleDisplayPane(targetId) {
256
263
  initGeneralSelectedMap();
257
264
  handleCloseActiveMinimap();
258
265
  }
266
+ if (paneId === 'at-pipe-list-pane') {
267
+ log.info("Pipe Pane");
268
+ //setup pipe list pane initialization
269
+ pipeList.init();
270
+ }
271
+ if (paneId === 'at-pipe-form-pane') {
272
+ log.info("Pipe Pane");
273
+ }
274
+ console.log("paneId", paneId);
259
275
  return;
260
276
  }
261
277
  else {
@@ -264,7 +280,7 @@ function toggleDisplayPane(targetId) {
264
280
  return;
265
281
  }
266
282
  }
267
- log.error('Could not get value of target-pane attribute');
283
+ log.error('Could not get value of target-pane attribute', targetId);
268
284
  return;
269
285
  });
270
286
  }
@@ -341,8 +357,44 @@ function setupIndividualEventListeners() {
341
357
  handleCloseCustomMinimap();
342
358
  handleCustomMapControls();
343
359
  handleCloseActiveMinimap();
360
+ handlePipeForm();
361
+ handlePipeList();
362
+ }
363
+ //================ OBJECT EVENT HANDLERS ===============//s
364
+ // handle pipe undo drawing
365
+ function handleUndoPipeDrawing() {
366
+ }
367
+ // handle pipe redo drawing
368
+ function handleRedoDrawing() {
369
+ }
370
+ function handlePipeCategory(payload) {
371
+ return __awaiter(this, void 0, void 0, function* () {
372
+ console.log("HANDLE CATEGORY =>", payload);
373
+ // set categories latest value
374
+ yield setPipeCategories(payload);
375
+ });
376
+ }
377
+ function handlePipe(payload) {
378
+ return __awaiter(this, void 0, void 0, function* () {
379
+ console.log("HANDLE PIPE =>", payload);
380
+ // set pipes latest value
381
+ yield setPipes(payload);
382
+ });
383
+ }
384
+ //handler pipe form events
385
+ function handlePipeForm() {
386
+ // setup events from pipe form
387
+ pipeForm.save();
388
+ pipeForm.cancel();
389
+ pipeForm.draw();
390
+ pipeForm.undo();
391
+ pipeForm.redo();
392
+ }
393
+ //handle pipe list event
394
+ function handlePipeList() {
395
+ // setup event from pipe list
396
+ pipeList.add();
344
397
  }
345
- //================ OBJECT EVENT HANDLERS ===============//
346
398
  function handleTranslateObject() {
347
399
  const translateObjectbtn = document.getElementById('at-translate-action-btn');
348
400
  translateObjectbtn.addEventListener('click', () => {
@@ -382,7 +434,7 @@ function handleCopyObject() {
382
434
  function onCopyModel() {
383
435
  return __awaiter(this, void 0, void 0, function* () {
384
436
  //Clear transform controls otherwise the original object will move to the duplicated object position making it look
385
- //like the original disappeared
437
+ //like the original disappeare
386
438
  const selectedObj = getSelectedObject().object;
387
439
  log.info("copyModel selectedObj ", selectedObj);
388
440
  const objectCards = document.getElementById('at-object-cards');
@@ -1277,6 +1329,9 @@ function setupSpaceEventSubscriptions() {
1277
1329
  subscribeSpaceEvent(SPACE_EVENTS.DRAW_HISTORY, handleDrawHistory);
1278
1330
  subscribeSpaceEvent(SPACE_EVENTS.FLOOR_IMAGE_UPLOADED, handleCustomMapFloorImageUploaded);
1279
1331
  subscribeSpaceEvent(SPACE_EVENTS.FLOOR_IMAGE_UPLOAD_FAILED, handleCustomMapFloorUploadFailed);
1332
+ // subscribeSpaceEvent(SPACE_EVENTS.DRAW_PIPE, handleDrawPipe)
1333
+ subscribeSpaceEvent(SPACE_EVENTS.PIPE_CATEGORY_ON_CHANGE, handlePipeCategory);
1334
+ subscribeSpaceEvent(SPACE_EVENTS.PIPE_ON_CHANGE, handlePipe);
1280
1335
  }
1281
1336
  function handleDragEnd(payload) {
1282
1337
  console.log("handleDragEnd payload", payload);
@@ -1322,7 +1377,7 @@ function handleDragEnd(payload) {
1322
1377
  showCurrentCoordinateValue();
1323
1378
  const transformValues = {
1324
1379
  object_position: payload.object_position,
1325
- object_rotation: payload.object_rotation,
1380
+ object_rotation: payload.object_rotationƒ,
1326
1381
  object_scale: payload.object_scale,
1327
1382
  };
1328
1383
  setCurrentTransformationValues(transformValues);
@@ -1347,13 +1402,21 @@ function handleDrawHistory(payload) {
1347
1402
  const redoBtn = document.getElementById('at-draw-redo-btn');
1348
1403
  redoBtn.classList.remove('at_disabled');
1349
1404
  }
1405
+ console.log("undoCount", undoCount);
1406
+ console.log("redoCount", redoCount);
1350
1407
  }
1351
- function handleVertexPlace() {
1352
- const undoBtn = document.getElementById('at-draw-undo-btn');
1353
- undoBtn.classList.remove('at_disabled');
1354
- setCurrentPartitionData();
1355
- const redoBtn = document.getElementById('at-draw-redo-btn');
1356
- redoBtn.classList.add('at_disabled');
1408
+ function handleVertexPlace(payload) {
1409
+ console.log("handleVertexPlace ==>", payload);
1410
+ if (isToolbarFeatureEnabled('roomCreation')) {
1411
+ const undoBtn = document.getElementById('at-draw-undo-btn');
1412
+ undoBtn.classList.remove('at_disabled');
1413
+ setCurrentPartitionData();
1414
+ const redoBtn = document.getElementById('at-draw-redo-btn');
1415
+ redoBtn.classList.add('at_disabled');
1416
+ }
1417
+ if (isToolbarFeatureEnabled('pipe')) {
1418
+ pipeForm.setPipeVertices(payload.path);
1419
+ }
1357
1420
  }
1358
1421
  function handleMouseClickObject(object) {
1359
1422
  var _a, _b, _c;
@@ -2989,7 +3052,7 @@ function handleCloseActiveMinimap() {
2989
3052
  }
2990
3053
  export {
2991
3054
  //state
2992
- activeToolbarItem, activeActionItem, cancelModelPlacementPrompt, isCustomMapControlsVisible,
3055
+ activeToolbarItem, activeActionItem, cancelModelPlacementPrompt, isCustomMapControlsVisible, pipeColor,
2993
3056
  //methods
2994
3057
  batchAddEventListenerById, batchAddEventListenerByClassName, batchAddEventListenerByClassNames, batchAddEventListenerByDataAttribute, setActiveToolbarItem, toggleDisplayPane, toggleActionBar, setupIndividualEventListeners, setupSpaceEventSubscriptions, handleModelVisibility, handleDeleteModel, handleShowMinimap, handleScrollToView, handleRenderMeetingUI, handleShowCustomMinimap,
2995
3058
  // 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;
@@ -0,0 +1,49 @@
1
+ export function waitForChange(...args) {
2
+ const maybeOptions = args[args.length - 1];
3
+ const options = typeof maybeOptions === 'object' && ('interval' in maybeOptions || 'timeout' in maybeOptions)
4
+ ? maybeOptions
5
+ : {};
6
+ const getters = (maybeOptions === options ? args.slice(0, -1) : args);
7
+ const { interval = 100, timeout = 5000 } = options;
8
+ const initial = getters.map(fn => fn());
9
+ const start = Date.now();
10
+ return new Promise((resolve, reject) => {
11
+ const check = () => {
12
+ const current = getters.map(fn => fn());
13
+ const hasChanged = current.some((val, i) => val !== initial[i] && val != null);
14
+ if (hasChanged) {
15
+ resolve(getters.length === 1 ? current[0] : current);
16
+ }
17
+ else if (Date.now() - start >= timeout) {
18
+ reject(new Error('Timeout: Values did not change'));
19
+ }
20
+ else {
21
+ setTimeout(check, interval);
22
+ }
23
+ };
24
+ check();
25
+ });
26
+ }
27
+ /**
28
+ * Binds an input element's value to a target object's property using input and mutation observers.
29
+ * @param input The input HTML element to observe
30
+ * @param getTarget A function returning the target object (like _selectedPipeCategory)
31
+ * @param key The key of the target object to update
32
+ */
33
+ export function observeInputToUpdate(input, getTarget, key) {
34
+ if (!input)
35
+ return;
36
+ const update = () => {
37
+ const target = getTarget();
38
+ if (target) {
39
+ target[key] = input.value;
40
+ }
41
+ };
42
+ const observer = new MutationObserver(update);
43
+ observer.observe(input, {
44
+ attributes: true,
45
+ attributeFilter: ['value'],
46
+ });
47
+ input.addEventListener('input', update);
48
+ console.log("observer ==>", input);
49
+ }
@@ -37,6 +37,8 @@ const sidebarPaneBtnIds = [
37
37
  'at-cancel-theme-btn',
38
38
  'at-save-customization-btn',
39
39
  'at-draw-room-btn',
40
+ // 'at-cancel-pipe-btn',
41
+ // 'at-save-pipe-btn'
40
42
  ];
41
43
  //'at-cancel-add-object-form-btn',
42
44
  function initToolbarUI(payload) {
@@ -0,0 +1,25 @@
1
+ import { MpSdk } from "../../bundle/sdk";
2
+ import * as THREE from "three";
3
+ import { IMPConfig } from "../types";
4
+ declare class CursorMarkerLoader {
5
+ inputs: {
6
+ pointerIntersection: MpSdk.Pointer.Intersection;
7
+ markerTexture: string;
8
+ visible: boolean;
9
+ offset: number;
10
+ scale: number;
11
+ };
12
+ outputs: Record<string, unknown> & MpSdk.Scene.PredefinedOutputs;
13
+ context: MpSdk.Scene.IComponentContext;
14
+ mesh: THREE.Mesh;
15
+ material: THREE.Material;
16
+ geometry: THREE.PlaneGeometry;
17
+ texture: THREE.Texture;
18
+ constructor(mpConfig: IMPConfig);
19
+ onInit: () => void;
20
+ onInputsUpdated: () => void;
21
+ onDestroy: () => void;
22
+ }
23
+ export declare const cursorMarkerType = "mp.cursorMarker";
24
+ export declare const cursorMarkerFactory: () => CursorMarkerLoader;
25
+ export {};