architwin 1.15.6 → 1.16.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.
@@ -10,7 +10,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
10
10
  import { SPACE_EVENTS, sortTagOptions, TAG_TYPE } from "../../../types";
11
11
  import { batchAddEventListenerByClassName, toggleDisplayPane, batchAddEventListenerByDataAttribute } from "../../events";
12
12
  import { convertToCssRgb, getBundleVersion } from "../../../utils";
13
- import { gotoTag, disposeTag, dispatchSpaceEvent, _tags, getUserAssignedCategories, _mpConfig, moveTag, getAtwinSdk } from "../../../architwin";
13
+ import { gotoTag, disposeTag, dispatchSpaceEvent, _tags, getUserAssignedCategories, _mpConfig, moveTag, getAtwinSdk, toggleVisibilityTag } from "../../../architwin";
14
14
  import { initFormData, toggleDropdown } from "./tagFormPane";
15
15
  import { toggleModal, setModalAction } from "./modal";
16
16
  import { initIoTFormData, setIoTFormMode } from './tagIotFormPane';
@@ -35,6 +35,10 @@ let _tagLink;
35
35
  let isChevronEventAdded = false;
36
36
  let allSubcategories = [];
37
37
  let tagSearchTerm = '';
38
+ export const tagVisibility = {
39
+ [TAG_TYPE.MP]: {},
40
+ [TAG_TYPE.IOT]: {}
41
+ };
38
42
  let iotTags = [];
39
43
  export let selectedCategoryFilterId = undefined;
40
44
  export let selectedSubCategoryFilterId = undefined;
@@ -44,7 +48,7 @@ export let selectedTagSortOption = { by: 'label', order: 'asc' };
44
48
  export function renderTagListPane() {
45
49
  const element = document.createElement('div');
46
50
  element.classList.add('at_container');
47
- element.classList.add('at_w-12');
51
+ element.classList.add('at_w-13');
48
52
  element.classList.add('at_h-full');
49
53
  element.setAttribute('id', 'at-tag-list-pane');
50
54
  element.setAttribute('data-cy', 'at-tag-list-pane');
@@ -52,25 +56,40 @@ export function renderTagListPane() {
52
56
  <div class="at_panel_header">
53
57
  <span id="at-tag-list-title">${i18n.t('Tags')}</span>
54
58
  </div>
55
- <div class="at_form_container at_tag_list_pane">
56
- <div class="at_tags_filter_section">
57
- <input class="at_field_search_input" type="text" name="search_name" id="at-tag-name-search" data-cy="at-tag-name-search" placeholder=${i18n.t('Search...')}>
58
- <span class="mdi mdi-close at_button_search_tag" id="at-clear-search-tag-name" style="display:none"></span>
59
- <button class="at_search_button" id="at-search-tag-button">
60
- <span class="mdi mdi-magnify"></span>
61
- </button>
62
- <div class="at_sort_btn_container">
63
- <div id="at-tag-sort-icon" class="mdi mdi-filter mdi-24px at_icon_hover">
59
+ <div class="at_form_container at_h-min-65 at_tag_list_pane">
60
+ <div class="at_button_row at_justify_end ${_mpConfig.restrictionConfig.isTagReadOnly ? 'at_disabled' : ''}">
61
+ <div class="at_button at_ghost">
62
+ <span class="mdi mdi-sort at_icon_hover" id="at-tag-sort-icon" data-cy="at-tag-sort-btn" >
64
63
  <span id="at-tag-sort-options-tooltip" class="at_custom_tooltip">
65
64
  <p class="at_tag_sort_option at_sort_option_selected" data-sort="Ascending">${i18n.t('Ascending')}</p>
66
65
  <p class="at_tag_sort_option" data-sort="Descending">${i18n.t('Descending')}</p>
67
66
  <p class="at_tag_sort_option" data-sort="Newest">${i18n.t('Newest')}</p>
68
67
  <p class="at_tag_sort_option" data-sort="Oldest">${i18n.t('Oldest')}</p>
69
68
  </span>
70
- </div>
69
+ </span>
70
+ </div>
71
+ <div class="at_button at_ghost" id="at-visibility-tag-btn" data-cy="at-visibility-tag-btn" >
72
+ <span class="mdi mdi-eye at_icon_hover" id="at-visibility-tag-btn">
73
+ <span class="at_custom_tooltip">
74
+ <p class="at_tag_sort_option">${i18n.t('HideAll')}</p>
75
+ </span>
76
+ </span>
71
77
  </div>
78
+ <div class="at_button at_ghost" id="at-add-tag-btn" data-cy="at-add-tag-btn" target-pane="at-tag-form-pane">
79
+ ${i18n.t('AddTag')}
80
+ <span class="mdi mdi-plus-circle-outline" id="at-add-tag-btn"></span>
81
+ </div>
82
+ </div>
83
+
84
+ <div class="at_tags_filter_section">
85
+ <input class="at_field_search_input" type="text" name="search_name" id="at-tag-name-search" data-cy="at-tag-name-search" placeholder=${i18n.t('Search...')}>
86
+ <span class="mdi mdi-close at_button_search_tag" id="at-clear-search-tag-name" style="display:none"></span>
87
+ <button class="at_search_button" id="at-search-tag-button">
88
+ <span class="mdi mdi-magnify"></span>
89
+ </button>
90
+
72
91
  </div>
73
- <div class="at_field at_flex_column" style="${_tagCategories ? '' : 'display: none;'}" id="at-custom-category-filter-dropdown-container">
92
+ <div class="at_field at_flex_column" style="${_tagCategories ? '' : 'display: none;'}">
74
93
  <label for="">${i18n.t('Category')}</label>
75
94
  <div id="at-custom-category-filter-dropdown" data-cy="at-custom-category-filter-dropdown">
76
95
  <div id="at-category-filter-dropdown" class="at_dropdown at_flex at_flex_row at_space_between">
@@ -99,16 +118,11 @@ export function renderTagListPane() {
99
118
  </div>
100
119
  </div>
101
120
  </div>
102
- <div class="at_scrollable_container at_h-min-45" id="at-tag-list-scrollable-container">
121
+ <div class="at_form_container at_scrollable_container at_h-min-45" id="at-tag-list-scrollable-container">
103
122
  <table id="at-tag-list-container">
104
123
  </table>
105
124
  </div>
106
- <div class="at_button_row at_justify_end ${_mpConfig.restrictionConfig.isTagReadOnly ? 'at_disabled' : ''}">
107
- <div class="at_button at_ghost" id="at-add-tag-btn" data-cy="at-add-tag-btn" target-pane="at-tag-form-pane">
108
- ${i18n.t('AddTag')}
109
- <span class="mdi mdi-plus-circle-outline" id="at-add-tag-btn"></span>
110
- </div>
111
- </div>
125
+
112
126
  <div class="at_flex at_justify_center at_price" id="at-bundle-version" data-cy="at-bundle-version">
113
127
  <small class="at_text_xxs at_text_white at_opacity_5">${getBundleVersion()}</small>
114
128
  </div>
@@ -156,6 +170,9 @@ export function renderTags(tags, showOwnTagsOnly = false) {
156
170
  tagContainer.innerHTML = ``;
157
171
  return;
158
172
  }
173
+ const disabled = _mpConfig.restrictionConfig.isIoTtagReadonly;
174
+ const addTagButton = document.getElementById('at-add-tag-btn');
175
+ const visibilityTagButton = document.getElementById('at-visibility-tag-btn');
159
176
  tagContainer.innerHTML = ``;
160
177
  tags.forEach(tag => {
161
178
  console.log('@caroline render tag checking: ', tag);
@@ -163,12 +180,16 @@ export function renderTags(tags, showOwnTagsOnly = false) {
163
180
  if (isTagPartOfCategory(tag.category_uuid)) {
164
181
  const row = renderTagRow(tag.json_data, tag.tag_icon_url, tag.tag_type);
165
182
  tagContainer.appendChild(row);
183
+ addTagButton.classList.remove('at_disabled');
184
+ visibilityTagButton.classList.remove('at_disabled');
166
185
  }
167
186
  }
168
187
  else {
169
188
  console.log('@caroline render tag checking 2: ', tag);
170
189
  const row = renderTagRow(tag.json_data, tag.tag_icon_url, tag.tag_type);
171
190
  tagContainer.appendChild(row);
191
+ addTagButton.classList.toggle('at_disabled', disabled);
192
+ visibilityTagButton.classList.toggle('at_disabled', disabled);
172
193
  }
173
194
  });
174
195
  batchAddEventListenerByClassName('at_edit_tag_btn', (event) => __awaiter(this, void 0, void 0, function* () {
@@ -267,6 +288,28 @@ export function renderTags(tags, showOwnTagsOnly = false) {
267
288
  }
268
289
  }
269
290
  }));
291
+ // Toggle individual tag visibility
292
+ batchAddEventListenerByClassName('at_visibility_tag_btn', (event) => __awaiter(this, void 0, void 0, function* () {
293
+ var _a;
294
+ const btn = event.target;
295
+ const tagId = btn.getAttribute('tag-id');
296
+ if (!tagId)
297
+ return;
298
+ // Find the tag to determine its type
299
+ const tag = _tags.find(t => t.json_data.id == tagId);
300
+ if (!tag)
301
+ return;
302
+ const tagType = tag.tag_type || TAG_TYPE.MP;
303
+ const current = (_a = tagVisibility[tagType][tagId]) !== null && _a !== void 0 ? _a : true;
304
+ const newState = !current;
305
+ tagVisibility[tagType][tagId] = newState;
306
+ yield toggleVisibilityTag({ tagId, visibility: newState });
307
+ btn.classList.remove(newState ? "mdi-eye-off-outline" : "mdi-eye");
308
+ btn.classList.add(newState ? "mdi-eye" : "mdi-eye-off-outline");
309
+ // update main toggle button, not event
310
+ updateShowAllButton();
311
+ saveTagVisibilityToStorage(tagVisibility);
312
+ }));
270
313
  if (Number(window.innerWidth) <= 540) {
271
314
  batchAddEventListenerByDataAttribute('toggle-pane', (event) => __awaiter(this, void 0, void 0, function* () {
272
315
  toggleDisplayPane('at-cancel-tag-form-btn');
@@ -275,6 +318,7 @@ export function renderTags(tags, showOwnTagsOnly = false) {
275
318
  activeElement.classList.remove('at_sidebar_button_icon_active');
276
319
  }), {
277
320
  ignoreSelectors: [
321
+ 'at_visibility_tag_btn',
278
322
  '.at_edit_tag_btn',
279
323
  '.at_copy_tag_btn',
280
324
  '.at_delete_tag_btn',
@@ -320,6 +364,16 @@ export function renderTags(tags, showOwnTagsOnly = false) {
320
364
  document.addEventListener('keydown', handleEscKey);
321
365
  }));
322
366
  initDropdownEventListeners();
367
+ Object.entries(tagVisibility).forEach(([tagType, visibilityMap]) => {
368
+ Object.entries(visibilityMap).forEach(([tagId, visible]) => {
369
+ console.log(tagType, tagId, visible);
370
+ const toggleBtn = document.getElementById(`at-visibility-tag-${tagId}`);
371
+ if (toggleBtn) {
372
+ toggleBtn.classList.remove(visible ? "mdi-eye-off-outline" : "mdi-eye");
373
+ toggleBtn.classList.add(visible ? "mdi-eye" : "mdi-eye-off-outline");
374
+ }
375
+ });
376
+ });
323
377
  }
324
378
  export function renderTagRow(tag, tagIconUrl, tag_type = null) {
325
379
  log.info('@caroline rendertagrow: ', tag);
@@ -332,7 +386,11 @@ export function renderTagRow(tag, tagIconUrl, tag_type = null) {
332
386
  // element.setAttribute('tag-id',tag.json_data.id)
333
387
  // get read only value from mpconfig
334
388
  const isTagReadOnly = _mpConfig.restrictionConfig.isTagReadOnly;
389
+ const isIotTagReadOnly = _mpConfig.restrictionConfig.isIoTtagReadonly;
390
+ const isIoT = tag_type === TAG_TYPE.IOT;
391
+ const isGenerallyDisabled = isTagReadOnly || (isIoT && isIotTagReadOnly);
335
392
  console.log("_isTagReadOnly: ", isTagReadOnly);
393
+ console.log("@___isIotTagReadOnly: ", isIotTagReadOnly);
336
394
  // Displays tag icon with tag color indicator
337
395
  const thisTagIconURL = tagIconUrl === 'button.png' || tagIconUrl === '' || tagIconUrl === undefined ? "https://cdn.jsdelivr.net/npm/architwin@latest/static/images/button.png" : tagIconUrl;
338
396
  let tagIconIndicatorBg = convertToCssRgb(tag.color);
@@ -353,12 +411,15 @@ export function renderTagRow(tag, tagIconUrl, tag_type = null) {
353
411
  <span title="${tag.label.length > 12 ? tag.label : ''}">${tag.label}</span>
354
412
  </div>
355
413
  </td>
356
- <td class="at_table_button_row">
357
- <span class="mdi mdi-pencil at_edit_tag_btn ${isTagReadOnly ? 'at_disabled' : ''}" id="at-edit-tag-${tag.id}" data-cy="at-edit-tag-${tag.id}" tag-id="${tag.id}" target-pane=${tag_type === TAG_TYPE.IOT ? "at-tag-iot-form-pane" : "at-tag-form-pane"}></span>
358
- <span class="mdi mdi-content-copy at_copy_tag_btn ${isTagReadOnly ? 'at_disabled' : ''} id="at-edit-tag-${tag.id}" id="at-copy-tag-${tag.id}" data-cy="at-copy-tag-${tag.id}" tag-id="${tag.id}"></span>
359
- <span class="mdi mdi-message at_message_tag_btn ${tag_type === TAG_TYPE.IOT ? 'at_hidden' : ''}" id="at-message-tag-${tag.id}" data-cy="at-message-tag-${tag.id}" tag-id="${tag.id}" target-pane="at-tag-messaging-pane"></span>
360
- <span class="mdi mdi-map-marker at_locate_tag_btn ${tag_type === TAG_TYPE.IOT ? '' : 'at_hidden'}" id="at-relocate-tag-${tag.id}" data-cy="at-relocate-tag-${tag.id}" tag-id="${tag.id}"></span>
361
- <span class="mdi mdi-trash-can-outline at_delete_tag_btn ${isTagReadOnly ? 'at_disabled' : ''}" id="at-delete-tag-${tag.id}" data-cy="at-delete-tag-${tag.id}" tag-id="${tag.id}"></span>
414
+ <td>
415
+ <div class="at_table_button_row">
416
+ <span class="mdi mdi-eye at_visibility_tag_btn ${isGenerallyDisabled ? 'at_disabled' : ''}" id="at-visibility-tag-${tag.id}" data-cy="at-visibility-tag-${tag.id}" tag-id="${tag.id}" tag-id="${tag.id}"></span>
417
+ <span class="mdi mdi-pencil at_edit_tag_btn ${isGenerallyDisabled ? 'at_disabled' : ''}" id="at-edit-tag-${tag.id}" data-cy="at-edit-tag-${tag.id}" tag-id="${tag.id}" target-pane="at-tag-form-pane"></span>
418
+ <span class="mdi mdi-content-copy at_copy_tag_btn ${isTagReadOnly ? 'at_disabled' : ''} id="at-edit-tag-${tag.id}"" id="at-copy-tag-${tag.id}" data-cy="at-copy-tag-${tag.id}" tag-id="${tag.id}"></span>
419
+ <span class="mdi mdi-message at_message_tag_btn ${isIoT ? 'at_hidden' : ''}" id="at-message-tag-${tag.id}" data-cy="at-message-tag-${tag.id}" tag-id="${tag.id}" target-pane="at-tag-messaging-pane"></span>
420
+ <span class="mdi mdi-map-marker at_locate_tag_btn ${!isIoT ? 'at_hidden' : ''} ${isIotTagReadOnly ? 'at_disabled' : ''}" id="at-relocate-tag-${tag.id}" data-cy="at-relocate-tag-${tag.id}" tag-id="${tag.id}"></span>
421
+ <span class="mdi mdi-trash-can-outline at_delete_tag_btn ${isGenerallyDisabled ? 'at_disabled' : ''}" id="at-delete-tag-${tag.id}" data-cy="at-delete-tag-${tag.id}" tag-id="${tag.id}"></span>
422
+ </div>
362
423
  </td>
363
424
  `;
364
425
  return element;
@@ -379,6 +440,7 @@ export function addClickEventToTagRow(tag) {
379
440
  const editTagBtn = document.getElementById(`at-edit-tag-${tag.id}`);
380
441
  const copyTagBtn = document.getElementById(`at-copy-tag-${tag.id}`);
381
442
  const deleteTagBtn = document.getElementById(`at-delete-tag-${tag.id}`);
443
+ const visibilityTagBtn = document.getElementById(`at-visibility-tag-${tag.id}`);
382
444
  if (editTagBtn) {
383
445
  editTagBtn.addEventListener('click', (event) => __awaiter(this, void 0, void 0, function* () {
384
446
  console.log('Event', event);
@@ -424,6 +486,11 @@ export function addClickEventToTagRow(tag) {
424
486
  }
425
487
  }));
426
488
  }
489
+ if (visibilityTagBtn) {
490
+ visibilityTagBtn.addEventListener('click', (event) => __awaiter(this, void 0, void 0, function* () {
491
+ console.log("CLICK ==>");
492
+ }));
493
+ }
427
494
  }
428
495
  // Original Implementation
429
496
  // export function filterTagList(tags:Array<ITag>):Array<ITag>{
@@ -653,3 +720,108 @@ export function resetSelectedTagSortOption() {
653
720
  }
654
721
  }
655
722
  }
723
+ // create local storage functions to save tag visibility states
724
+ export function saveTagVisibilityToStorage(tagVisibility) {
725
+ try {
726
+ localStorage.setItem('tagVisibility', JSON.stringify(tagVisibility));
727
+ log.info('Saved tag visibility:', tagVisibility);
728
+ }
729
+ catch (error) {
730
+ log.error('Failed to save tag visibility to localStorage:', error);
731
+ }
732
+ }
733
+ // load tag visibility states from local storage
734
+ function loadTagVisibilityFromStorage() {
735
+ var _a, _b;
736
+ try {
737
+ const parsed = JSON.parse(localStorage.getItem('tagVisibility') || '{}');
738
+ return {
739
+ [TAG_TYPE.MP]: (_a = parsed[TAG_TYPE.MP]) !== null && _a !== void 0 ? _a : {},
740
+ [TAG_TYPE.IOT]: (_b = parsed[TAG_TYPE.IOT]) !== null && _b !== void 0 ? _b : {}
741
+ };
742
+ }
743
+ catch (error) {
744
+ log.error('Failed to load tag visibility from localStorage:', error);
745
+ return { [TAG_TYPE.MP]: {}, [TAG_TYPE.IOT]: {} };
746
+ }
747
+ }
748
+ // initialize tag visibility states on app load
749
+ export function initializeTagVisibility() {
750
+ var _a;
751
+ const savedVisibility = loadTagVisibilityFromStorage();
752
+ for (const tag of _tags) {
753
+ const tagId = tag.json_data.id;
754
+ const tagType = tag.tag_type || TAG_TYPE.MP;
755
+ // Initialize type object if it doesn't exist
756
+ if (!tagVisibility[tagType]) {
757
+ tagVisibility[tagType] = {};
758
+ }
759
+ // Use saved state if it exists, otherwise default to true
760
+ tagVisibility[tagType][tagId] = ((_a = savedVisibility[tagType]) === null || _a === void 0 ? void 0 : _a.hasOwnProperty(tagId))
761
+ ? savedVisibility[tagType][tagId]
762
+ : true;
763
+ }
764
+ setTagVisibilityStates();
765
+ }
766
+ // apply visibility states to tags
767
+ function setTagVisibilityStates() {
768
+ return __awaiter(this, void 0, void 0, function* () {
769
+ for (const tag of _tags) {
770
+ const tagId = tag.json_data.id;
771
+ const tagType = tag.tag_type || TAG_TYPE.MP;
772
+ const isVisible = tagVisibility[tagType][tagId];
773
+ yield toggleVisibilityTag({ tagId: tagId, visibility: isVisible });
774
+ const btn = document.getElementById(`at-visibility-tag-${tagId}`);
775
+ if (btn) {
776
+ btn.classList.toggle("mdi-eye", isVisible);
777
+ btn.classList.toggle("mdi-eye-off-outline", !isVisible);
778
+ }
779
+ }
780
+ updateShowAllButton();
781
+ });
782
+ }
783
+ // update the main show/hide all button based on current tag visibility states
784
+ export function updateShowAllButton() {
785
+ const toggleVisibilityBtn = document.getElementById('at-visibility-tag-btn');
786
+ if (!toggleVisibilityBtn)
787
+ return;
788
+ // Check visibility based on current tag pane mode
789
+ let allHidden = false;
790
+ if (currentTagPaneMode === TAG_TYPE.IOT) {
791
+ // Check only IOT tags
792
+ allHidden = Object.values(tagVisibility[TAG_TYPE.IOT]).every(v => v === false);
793
+ }
794
+ else if (currentTagPaneMode === TAG_TYPE.MP) {
795
+ // Check only MP tags
796
+ allHidden = Object.values(tagVisibility[TAG_TYPE.MP]).every(v => v === false);
797
+ }
798
+ else {
799
+ // Check all tags when no specific mode is set
800
+ const allValues = [
801
+ ...Object.values(tagVisibility[TAG_TYPE.MP]),
802
+ ...Object.values(tagVisibility[TAG_TYPE.IOT])
803
+ ];
804
+ allHidden = allValues.length > 0 && allValues.every(v => v === false);
805
+ }
806
+ toggleVisibilityBtn.innerHTML = allHidden
807
+ ? `<span class="mdi mdi-eye-off-outline at_icon_hover">
808
+ <span class="at_custom_tooltip">
809
+ <p class="at_tag_sort_option">${i18n.t('ShowAll')}</p>
810
+ </span>
811
+ </span>`
812
+ : `<span class="mdi mdi-eye at_icon_hover">
813
+ <span class="at_custom_tooltip">
814
+ <p class="at_tag_sort_option">${i18n.t('HideAll')}</p>
815
+ </span>
816
+ </span>`;
817
+ }
818
+ // clear tag visibility states from local storage
819
+ export function clearTagVisibilityStorage() {
820
+ if (localStorage.getItem('tagVisibility')) {
821
+ localStorage.removeItem('tagVisibility');
822
+ log.info('Tag visibility storage cleared');
823
+ }
824
+ else {
825
+ log.info('No tag in storage found');
826
+ }
827
+ }
@@ -23,6 +23,7 @@ declare function renderTagPaneContent(): Promise<void>;
23
23
  declare function toggleActionBar(state: string): void;
24
24
  export declare function handleUserLeaveSessionClick(): void;
25
25
  declare function setupIndividualEventListeners(): void;
26
+ declare function handleToggleVisibilityTags(): void;
26
27
  declare function handleModelVisibility(objId: string): Promise<void>;
27
28
  declare function handleDeleteModel(objId: string): Promise<void>;
28
29
  declare function handleShowMinimap(): void;
@@ -47,4 +48,4 @@ declare function handleShowCustomMinimap(): void;
47
48
  declare function handleDisplayElements(id: string): void;
48
49
  declare function handleWindowVisibility(visibilityBtn: HTMLElement, updateStateDB: boolean, fromParentVisibilityState?: boolean): Promise<void>;
49
50
  declare function clearActivePane(): void;
50
- export { activeToolbarItem, activeActionItem, cancelModelPlacementPrompt, isCustomMapControlsVisible, pipeColor, batchAddEventListenerById, batchAddEventListenerByClassName, batchAddEventListenerByClassNames, batchAddEventListenerByDataAttribute, setActiveToolbarItem, toggleDisplayPane, toggleActionBar, setupIndividualEventListeners, setupSpaceEventSubscriptions, handleModelVisibility, handleDeleteModel, handleShowMinimap, handleScrollToView, handleRenderMeetingUI, handleShowCustomMinimap, renderTagPaneContent, handlePartitionVisibility, handlePolygonVisibility, handleDeletePartition, handleDisplayElements, handleWindowVisibility, clearActivePane };
51
+ export { activeToolbarItem, activeActionItem, cancelModelPlacementPrompt, isCustomMapControlsVisible, pipeColor, batchAddEventListenerById, batchAddEventListenerByClassName, batchAddEventListenerByClassNames, batchAddEventListenerByDataAttribute, setActiveToolbarItem, toggleDisplayPane, toggleActionBar, setupIndividualEventListeners, setupSpaceEventSubscriptions, handleModelVisibility, handleDeleteModel, handleShowMinimap, handleScrollToView, handleRenderMeetingUI, handleShowCustomMinimap, renderTagPaneContent, handlePartitionVisibility, handlePolygonVisibility, handleDeletePartition, handleToggleVisibilityTags, handleDisplayElements, handleWindowVisibility, clearActivePane };
@@ -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, _spaceUsers, setPipeCategories, setPipes, detachTagMedia, getTagDataCollection, setVertexPath, _screenSharingHostUser, _tagIotCategoryTypes, getIoTDeviceTagIcons, toggleMeshChildrenVisibility, set3DXObjects, partitionHistory,
11
+ import { getTargetPosition, addMediaScreen, _3DXObjects, selectedObject, setTransformControls, copyObject, revertTransform, clearSelectedObject, removeTransformControls, getLibrary, getMpTags, renderTag, captureSpaceScreenshot, moveTag, subscribeSpaceEvent, setModelVisibility, disposeModel, disposeTag, _tags, _tagCategories, dispatchSpaceEvent, editTagLabel, editTagDescription, setTagMessageRecepients, setTagMessages, setSelectedTagUuid, renderMeetingSidebar, setTagIcon, setObjectTransformation, getSelectedObject, _atwin, isCdnMapDataAvailable, captureScreenshotAndCameraDetails, _mpConfig, cancelModelPlacement, _modelDetails, actionHistory, get3DXObjects, transformHistory, goToModel, themeManager, _partitionNodes, setSpacePartitionNodes, getSpaceId, setFloorBaseHeight, toggleWallVisibility, getChildrenOfModel, toggleFloorVisibility, renderPolygon, getCurrentPolygon, getFloorBaseHeight, setSelectedObject, redoDrawAction, undoDrawAction, setWallBaseHeight, clearWallBaseHeight, clearFloorBaseHeight, isToolbarFeatureEnabled, captureCurrentView, getCurrentFloor, _spaceUsers, setPipeCategories, setPipes, detachTagMedia, getTagDataCollection, setVertexPath, _screenSharingHostUser, toggleVisibilityTag, _tagIotCategoryTypes, getIoTDeviceTagIcons, toggleMeshChildrenVisibility, set3DXObjects, partitionHistory, _thisVertexPath,
12
12
  // polygonHistory
13
13
  } from "../architwin";
14
14
  import { Notyf } from 'notyf';
@@ -26,11 +26,11 @@ import log from 'loglevel';
26
26
  import * as minimap from '../minimap';
27
27
  import { clearActiveThemeCard, getSelectedTheme } from "./components/toolbar/themePane";
28
28
  import { getCurrentEditRoomData, displayRoomTree, updatePartitionVisibilityUI, getSelectedPartitionId, updatePolygonVisibilityData, toggleVisibilityState, setFilteredDisplay, updateRoomVisibilityUI, highlightSelectedPartitionChild, highlightSelectedWindow, getRoomData } from "./components/toolbar/spacePartition/roomTreePane";
29
- import { toggleDrawPartitionButton, displayPartitionFormMode, setPartitionFormMode, clearPartitionForm, setPolygonData, getPartitionFormData, getPartitionSavingMode, setPartitionSavingMode, getPartitionFormMode, getNewlyAddedPartition, setCurrentPartitionData, getCurrentPartitionData, getTempCurrentPolygon, clearTempCurrentPolygon, toggleDrawWindowButton, getIsDrawing, getDrawingMode, getCurrentPolygonData, setTempCurrentRoomEditData, toggleUndoRedoButtons, getCurrentWall, currentWindow } from "./components/toolbar/spacePartition/roomFormPane";
29
+ import { toggleDrawPartitionButton, displayPartitionFormMode, setPartitionFormMode, clearPartitionForm, setPolygonData, getPartitionFormData, getPartitionSavingMode, setPartitionSavingMode, getPartitionFormMode, getNewlyAddedPartition, getCurrentPartitionData, getTempCurrentPolygon, clearTempCurrentPolygon, toggleDrawWindowButton, getIsDrawing, getDrawingMode, getCurrentPolygonData, setTempCurrentRoomEditData, toggleUndoRedoButtons } from "./components/toolbar/spacePartition/roomFormPane";
30
30
  import { actionSettingsSelectOption, getTempCoordinateSystem, getTempMeasurementUnit, getTempRotationUnit, setCoordinateSystem, setMeasurementUnit, setRotationUnit, initSettingsValues, setTempCoordinateSystem, setTempMeasurementUnit, setTempRotationUnit, toggleActionSettingsDropdown, toggleCalibrateBasepoint, setScaleFactor, getTempScaleFactor, setTempScaleFactor, setBasepoint, getTempBasepoint, setTempBasepoint, getBasepoint, toggleActionSettings, getBasepointObjectPayload, displayConvertedCoordinates, getCoordinateSystem, getScaleFactor, getMeasurementUnit, getRotationUnit, setBasepointObjectPayload } from "./components/toolbar/actionSettingsPane";
31
31
  import { getBasepointCalibrateBpCoordinateValues, getBasepointCalibrateMpCoordinateValues, initBsepointCalibratePane, toggleBasepointCalibratePane } from "./components/toolbar/basepointCalibratePane";
32
32
  import { toggleGeneralMapOptions, initGeneralSelectedMap, getSelectedMapOption } from './components/toolbar/generalSettingsMenuPane';
33
- import { searchTagList, setSearchTagTerm, searchClearfield, getSearchTagTerm, sortTags, updateSelectedTagSortOption, resetSelectedTagSortOption, filterIotTagList, setTagPaneActive, isTagPaneActive, setCurrentTagPaneMode, currentTagPaneMode, selectedTagSortOption } from './components/toolbar/tagListPane';
33
+ import { searchTagList, setSearchTagTerm, searchClearfield, getSearchTagTerm, sortTags, updateSelectedTagSortOption, resetSelectedTagSortOption, filterIotTagList, setTagPaneActive, isTagPaneActive, setCurrentTagPaneMode, currentTagPaneMode, selectedTagSortOption, tagVisibility, updateShowAllButton, saveTagVisibilityToStorage, initializeTagVisibility } from './components/toolbar/tagListPane';
34
34
  import { renderUserRows } from "./components/toolbar/spaceUserListPane";
35
35
  import { handleRemoteViewResponsiveChanges, renderRemoteSpaceViewing } from "./components/toolbar/viewingRemoteSpace";
36
36
  import { PipeList } from "./components/toolbar/pipeListPane";
@@ -40,7 +40,6 @@ import { PipeForm } from "./components/toolbar/pipeFormPane";
40
40
  import { toggleIoTCategoryOptions, toggleIoTDevicesOptions, setSelectedIoTSystemRadio, clearIoTDropdowns, initIoTFormData, setIotCategoryOptions, getIotTagFormData, iotTagFormMode, selectedIotTag, clearIotFields, getIotCategoryOption } from './components/toolbar/tagIotFormPane';
41
41
  import { getTheseTagMessages, timedoutComment, unsendComment } from "./components/toolbar/tagMessagingPane";
42
42
  import { handleScreenShareResponsiveChanges, handleScreenShareAcceptRequest, handleScreenShareBackUserListPane, handleScreenShareEndSessionEvent, handleScreenShareUsersUpdated, renderScreenShareLeaveConfirmationModal } from "./components/toolbar/screenSharePane";
43
- import _ from "lodash";
44
43
  const pipeList = new PipeList();
45
44
  const pipeForm = new PipeForm();
46
45
  let activeToolbarItem, activeActionItem, activePane, activeActionPane, cancelTagPlacementPrompt, cancelModelPlacementPrompt;
@@ -65,6 +64,7 @@ let isCustomMapControlsVisible = false;
65
64
  let _currentSandboxId = undefined;
66
65
  let isNotyfExecuted = false; // flag for notification
67
66
  let pipeColor = "";
67
+ let allTagsVisible = true;
68
68
  function batchAddEventListenerByClassName(className, callback) {
69
69
  if (className) {
70
70
  const elements = document.querySelectorAll(`.${className}`);
@@ -373,6 +373,7 @@ function renderTagPaneContent() {
373
373
  }
374
374
  if (tags.length > 0) {
375
375
  searchTagList(tags);
376
+ updateShowAllButton();
376
377
  }
377
378
  });
378
379
  }
@@ -533,6 +534,7 @@ function setupIndividualEventListeners() {
533
534
  handlePipeForm();
534
535
  handlePipeList();
535
536
  handleResponsiveChanges();
537
+ handleToggleVisibilityTags();
536
538
  handlePreviewModalResize();
537
539
  }
538
540
  //================ OBJECT EVENT HANDLERS ===============//s
@@ -1227,6 +1229,65 @@ function handleSaveTag() {
1227
1229
  setTagFormMode("NONE" /* FORM_MODE.NONE */);
1228
1230
  }));
1229
1231
  }
1232
+ // Toggle all tags visibility
1233
+ function handleToggleVisibilityTags() {
1234
+ const toggleVisibilityBtn = document.getElementById('at-visibility-tag-btn');
1235
+ if (!toggleVisibilityBtn)
1236
+ return;
1237
+ // Initialize tag visibility on load
1238
+ initializeTagVisibility();
1239
+ const updateAll = (visible) => __awaiter(this, void 0, void 0, function* () {
1240
+ // Determine which tags to update based on current mode
1241
+ const tagsToUpdate = currentTagPaneMode
1242
+ ? _tags.filter(tag => tag.tag_type === currentTagPaneMode)
1243
+ : _tags;
1244
+ for (const tag of tagsToUpdate) {
1245
+ const tagType = tag.tag_type || TAG_TYPE.MP;
1246
+ const tagId = tag.json_data.id;
1247
+ // Initialize type object if it doesn't exist
1248
+ if (!tagVisibility[tagType]) {
1249
+ tagVisibility[tagType] = {};
1250
+ }
1251
+ // Update visibility state
1252
+ tagVisibility[tagType][tagId] = visible;
1253
+ yield toggleVisibilityTag({ tagId: tagId, visibility: visible });
1254
+ // Update button icon
1255
+ const btn = document.getElementById(`at-visibility-tag-${tagId}`);
1256
+ if (btn) {
1257
+ btn.classList.toggle("mdi-eye", visible);
1258
+ btn.classList.toggle("mdi-eye-off-outline", !visible);
1259
+ }
1260
+ }
1261
+ // Update the main toggle button
1262
+ updateShowAllButton();
1263
+ // Save to localStorage
1264
+ saveTagVisibilityToStorage(tagVisibility);
1265
+ });
1266
+ toggleVisibilityBtn.addEventListener('click', () => {
1267
+ // Check if all visible tags in current mode are hidden
1268
+ let allHidden = false;
1269
+ if (currentTagPaneMode === TAG_TYPE.IOT) {
1270
+ // Check only IOT tags
1271
+ const iotVisibility = Object.values(tagVisibility[TAG_TYPE.IOT] || {});
1272
+ allHidden = iotVisibility.length > 0 && iotVisibility.every(v => v === false);
1273
+ }
1274
+ else if (currentTagPaneMode === TAG_TYPE.MP) {
1275
+ // Check only MP tags
1276
+ const mpVisibility = Object.values(tagVisibility[TAG_TYPE.MP] || {});
1277
+ allHidden = mpVisibility.length > 0 && mpVisibility.every(v => v === false);
1278
+ }
1279
+ else {
1280
+ // Check all tags (both MP and IOT)
1281
+ const allValues = [
1282
+ ...Object.values(tagVisibility[TAG_TYPE.MP] || {}),
1283
+ ...Object.values(tagVisibility[TAG_TYPE.IOT] || {})
1284
+ ];
1285
+ allHidden = allValues.length > 0 && allValues.every(v => v === false);
1286
+ }
1287
+ // Toggle: if all hidden, show all; if any visible, hide all
1288
+ updateAll(allHidden);
1289
+ });
1290
+ }
1230
1291
  function handleScreenshot() {
1231
1292
  var _a, _b, _c, _d, _e, _f, _g, _h;
1232
1293
  const screenshotBtn = document.getElementById('at-screenshot-btn');
@@ -1522,28 +1583,9 @@ function setupSpaceEventSubscriptions() {
1522
1583
  }
1523
1584
  function handleVertexDragEnd(payload) {
1524
1585
  log.info("handleVertexDragEnd()", payload);
1525
- setCurrentPartitionData();
1526
1586
  if (isToolbarFeatureEnabled("roomCreation")) {
1527
- let data;
1528
- const currentPartitionData = _.cloneDeep(getCurrentPartitionData());
1529
- const currentPolygonData = _.cloneDeep(getCurrentPolygonData());
1530
- const currentWall = getCurrentWall();
1531
- const wallIndex = currentPolygonData.walls.findIndex(w => w.uuid == currentWall.uuid);
1532
- if (currentPartitionData) {
1533
- data = {
1534
- polygon: {
1535
- uuid: currentPartitionData.uuid,
1536
- polygon_json: currentPolygonData
1537
- },
1538
- verticePath: currentPolygonData.walls[wallIndex].windows[currentWindow.index].path
1539
- };
1540
- partitionHistory.addToHistory(JSON.parse(JSON.stringify(data)));
1541
- }
1542
- log.info("all history", partitionHistory.getAllHistory());
1587
+ partitionHistory.addToHistory([..._thisVertexPath]);
1543
1588
  }
1544
- // partitionHistory.addToHistory(data)
1545
- // polygonHistory.addToHistory(payload)
1546
- // toggleUndoRedoButtons(polygonHistory.canUndo(), polygonHistory.canRedo())
1547
1589
  }
1548
1590
  function handlePartitionColiderClickSelected(payload) {
1549
1591
  return __awaiter(this, void 0, void 0, function* () {
@@ -1616,6 +1658,9 @@ function handleDragEnd(payload) {
1616
1658
  function handleVertexPlace(payload) {
1617
1659
  console.log("handleVertexPlace ==>", payload);
1618
1660
  if (isToolbarFeatureEnabled('roomCreation')) {
1661
+ if (payload.path.length <= 2) {
1662
+ setPolygonData(undefined);
1663
+ }
1619
1664
  toggleUndoRedoButtons(partitionHistory.canUndo(), partitionHistory.canRedo());
1620
1665
  }
1621
1666
  if (isToolbarFeatureEnabled('pipe')) {
@@ -1623,6 +1668,7 @@ function handleVertexPlace(payload) {
1623
1668
  }
1624
1669
  }
1625
1670
  function handlePathUpdated(payload) {
1671
+ log.info("handlePathUpdated", payload);
1626
1672
  setVertexPath(payload.path);
1627
1673
  handleVertexPlace(payload);
1628
1674
  }
@@ -2559,6 +2605,7 @@ function handleMarkFloor() {
2559
2605
  partitionsUUIDs = currentPartitionData.children.map(child => child.uuid);
2560
2606
  const target = objects.find(obj => partitionsUUIDs.includes(obj.object.object_data.uuid));
2561
2607
  if (target) {
2608
+ setSelectedObject(target.object, target.node, target.component, target.type);
2562
2609
  const polyJson = target.object.object_data.json_data;
2563
2610
  const updatedPath = polyJson.path.map(path => {
2564
2611
  path.y = adjustedHeight;
@@ -2573,6 +2620,7 @@ function handleMarkFloor() {
2573
2620
  }
2574
2621
  else if (currentPolygon) {
2575
2622
  //setSelectedObject(currentPolygon.object,currentPolygon.node,currentPolygon.component,currentPolygon.type)
2623
+ setSelectedObject(currentPolygon.object, currentPolygon.node, currentPolygon.component, currentPolygon.type);
2576
2624
  const polyJson = currentPolygon.object.object_data.json_data;
2577
2625
  const updatedPath = polyJson.path.map(path => {
2578
2626
  path.y = adjustedHeight;
@@ -3981,4 +4029,4 @@ activeToolbarItem, activeActionItem, cancelModelPlacementPrompt, isCustomMapCont
3981
4029
  //methods
3982
4030
  batchAddEventListenerById, batchAddEventListenerByClassName, batchAddEventListenerByClassNames, batchAddEventListenerByDataAttribute, setActiveToolbarItem, toggleDisplayPane, toggleActionBar, setupIndividualEventListeners, setupSpaceEventSubscriptions, handleModelVisibility, handleDeleteModel, handleShowMinimap, handleScrollToView, handleRenderMeetingUI, handleShowCustomMinimap, renderTagPaneContent,
3983
4031
  // partition
3984
- handlePartitionVisibility, handlePolygonVisibility, handleDeletePartition, handleDisplayElements, handleWindowVisibility, clearActivePane };
4032
+ handlePartitionVisibility, handlePolygonVisibility, handleDeletePartition, handleToggleVisibilityTags, handleDisplayElements, handleWindowVisibility, clearActivePane };
@@ -63,7 +63,9 @@ export class TubeLine {
63
63
  //this.renderGUI();
64
64
  }
65
65
  if (this.inputs.path.length > 1) {
66
- this.renderTubeLine();
66
+ if (isToolbarFeatureEnabled('pipes')) {
67
+ this.renderTubeLine();
68
+ }
67
69
  }
68
70
  };
69
71
  this.onInputsUpdated = (prevInputs) => {
package/lib/tag.d.ts CHANGED
@@ -95,4 +95,9 @@ declare function attachSandbox(payload: {
95
95
  sandboxId: string;
96
96
  messenger: MpSdk.Tag.IMessenger;
97
97
  }>;
98
- export { renderTag, disposeTag, moveTag, attachTagMedia, detachTagMedia, setTagIcon, editBillboard, editStem, editColor, saveTagDb, deleteTag, getTagColorCodeID, getEmbedlyData, cancelMoveTag, handleTagPlacerCreated, attachSandbox, registerSandbox };
98
+ declare function toggleTagVisibility(payload: {
99
+ tagId: string;
100
+ sdk: MpSdk;
101
+ visibility: boolean;
102
+ }): void;
103
+ export { renderTag, disposeTag, moveTag, attachTagMedia, detachTagMedia, setTagIcon, editBillboard, editStem, editColor, saveTagDb, deleteTag, getTagColorCodeID, getEmbedlyData, cancelMoveTag, handleTagPlacerCreated, attachSandbox, registerSandbox, toggleTagVisibility };
package/lib/tag.js CHANGED
@@ -432,7 +432,14 @@ function attachSandbox(payload) {
432
432
  }
433
433
  });
434
434
  }
435
- export { renderTag, disposeTag, moveTag, attachTagMedia, detachTagMedia, setTagIcon, editBillboard, editStem, editColor, saveTagDb, deleteTag, getTagColorCodeID, getEmbedlyData, cancelMoveTag, handleTagPlacerCreated, attachSandbox, registerSandbox };
435
+ function toggleTagVisibility(payload) {
436
+ payload.sdk.Tag.editOpacity(payload.tagId, payload.visibility ? 1 : 0);
437
+ payload.sdk.Tag.allowAction(payload.tagId, {
438
+ opening: payload.visibility,
439
+ navigating: true
440
+ });
441
+ }
442
+ export { renderTag, disposeTag, moveTag, attachTagMedia, detachTagMedia, setTagIcon, editBillboard, editStem, editColor, saveTagDb, deleteTag, getTagColorCodeID, getEmbedlyData, cancelMoveTag, handleTagPlacerCreated, attachSandbox, registerSandbox, toggleTagVisibility };
436
443
  // # -------------------------------------------------------------------------
437
444
  // # tag
438
445
  // # -------------------------------------------------------------------------
package/lib/types.d.ts CHANGED
@@ -154,6 +154,7 @@ export interface IMPConfig {
154
154
  };
155
155
  restrictionConfig?: {
156
156
  isTagReadOnly?: boolean;
157
+ isIoTtagReadonly?: boolean;
157
158
  isTagToggleSharing?: boolean;
158
159
  };
159
160
  sweepPuckConfig?: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "architwin",
3
- "version": "1.15.6",
3
+ "version": "1.16.1",
4
4
  "description": "ArchiTwin Library for Matterport",
5
5
  "main": "./lib/architwin.js",
6
6
  "types": "./lib/architwin.d.ts",