architwin 1.15.6 → 1.16.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.
@@ -270,6 +270,8 @@ i18n
270
270
  "SuccessWindowDelete": "Succesfully deleted window",
271
271
  "EnterFloorMaterial": "Enter floor material",
272
272
  "EnterWallMaterial": "Enter wall material",
273
+ "ShowAll": "Show All",
274
+ "HideAll": "Hide All",
273
275
  "PressEscCancelRelocation": "Press Esc key to cancel relocation.",
274
276
  "MoveTagCancelled": "Move Tag Cancelled",
275
277
  "Window": "Window",
@@ -539,6 +541,8 @@ i18n
539
541
  "SuccessWindowDelete": "建具の削除が完了しました",
540
542
  "EnterFloorMaterial": "仕上げ(床)を入力",
541
543
  "EnterWallMaterial": "仕上げ(壁)を入力",
544
+ "ShowAll": "全て表示",
545
+ "HideAll": "全て非表示",
542
546
  "MoveTagCancelled": "タグの移動がキャンセルされました",
543
547
  "PressEscCancelRelocation": "再配置をキャンセルするには、Esc キーを押します。",
544
548
  "Window": "建具",
@@ -1,5 +1,6 @@
1
1
  import { ITag, ITagCategory, SortConfig, TAG_TYPE } from "../../../types";
2
2
  import { MpSdk } from "../../../../bundle/sdk";
3
+ export declare const tagVisibility: Record<TAG_TYPE, Record<string, boolean>>;
3
4
  export declare let selectedCategoryFilterId: any;
4
5
  export declare let selectedSubCategoryFilterId: any;
5
6
  export declare let isTagPaneActive: boolean;
@@ -26,3 +27,7 @@ export declare function setCurrentTagPaneMode(value: TAG_TYPE | null): void;
26
27
  export declare const sortTags: (items: ITag[], options: SortConfig) => ITag[];
27
28
  export declare function updateSelectedTagSortOption(sortOption: string): void;
28
29
  export declare function resetSelectedTagSortOption(): void;
30
+ export declare function saveTagVisibilityToStorage(tagVisibility: Record<TAG_TYPE, Record<string, boolean>>): void;
31
+ export declare function initializeTagVisibility(): void;
32
+ export declare function updateShowAllButton(): void;
33
+ export declare function clearTagVisibilityStorage(): void;
@@ -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,
12
12
  // polygonHistory
13
13
  } from "../architwin";
14
14
  import { Notyf } from 'notyf';
@@ -30,7 +30,7 @@ import { toggleDrawPartitionButton, displayPartitionFormMode, setPartitionFormMo
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";
@@ -65,6 +65,7 @@ let isCustomMapControlsVisible = false;
65
65
  let _currentSandboxId = undefined;
66
66
  let isNotyfExecuted = false; // flag for notification
67
67
  let pipeColor = "";
68
+ let allTagsVisible = true;
68
69
  function batchAddEventListenerByClassName(className, callback) {
69
70
  if (className) {
70
71
  const elements = document.querySelectorAll(`.${className}`);
@@ -373,6 +374,7 @@ function renderTagPaneContent() {
373
374
  }
374
375
  if (tags.length > 0) {
375
376
  searchTagList(tags);
377
+ updateShowAllButton();
376
378
  }
377
379
  });
378
380
  }
@@ -533,6 +535,7 @@ function setupIndividualEventListeners() {
533
535
  handlePipeForm();
534
536
  handlePipeList();
535
537
  handleResponsiveChanges();
538
+ handleToggleVisibilityTags();
536
539
  handlePreviewModalResize();
537
540
  }
538
541
  //================ OBJECT EVENT HANDLERS ===============//s
@@ -1227,6 +1230,65 @@ function handleSaveTag() {
1227
1230
  setTagFormMode("NONE" /* FORM_MODE.NONE */);
1228
1231
  }));
1229
1232
  }
1233
+ // Toggle all tags visibility
1234
+ function handleToggleVisibilityTags() {
1235
+ const toggleVisibilityBtn = document.getElementById('at-visibility-tag-btn');
1236
+ if (!toggleVisibilityBtn)
1237
+ return;
1238
+ // Initialize tag visibility on load
1239
+ initializeTagVisibility();
1240
+ const updateAll = (visible) => __awaiter(this, void 0, void 0, function* () {
1241
+ // Determine which tags to update based on current mode
1242
+ const tagsToUpdate = currentTagPaneMode
1243
+ ? _tags.filter(tag => tag.tag_type === currentTagPaneMode)
1244
+ : _tags;
1245
+ for (const tag of tagsToUpdate) {
1246
+ const tagType = tag.tag_type || TAG_TYPE.MP;
1247
+ const tagId = tag.json_data.id;
1248
+ // Initialize type object if it doesn't exist
1249
+ if (!tagVisibility[tagType]) {
1250
+ tagVisibility[tagType] = {};
1251
+ }
1252
+ // Update visibility state
1253
+ tagVisibility[tagType][tagId] = visible;
1254
+ yield toggleVisibilityTag({ tagId: tagId, visibility: visible });
1255
+ // Update button icon
1256
+ const btn = document.getElementById(`at-visibility-tag-${tagId}`);
1257
+ if (btn) {
1258
+ btn.classList.toggle("mdi-eye", visible);
1259
+ btn.classList.toggle("mdi-eye-off-outline", !visible);
1260
+ }
1261
+ }
1262
+ // Update the main toggle button
1263
+ updateShowAllButton();
1264
+ // Save to localStorage
1265
+ saveTagVisibilityToStorage(tagVisibility);
1266
+ });
1267
+ toggleVisibilityBtn.addEventListener('click', () => {
1268
+ // Check if all visible tags in current mode are hidden
1269
+ let allHidden = false;
1270
+ if (currentTagPaneMode === TAG_TYPE.IOT) {
1271
+ // Check only IOT tags
1272
+ const iotVisibility = Object.values(tagVisibility[TAG_TYPE.IOT] || {});
1273
+ allHidden = iotVisibility.length > 0 && iotVisibility.every(v => v === false);
1274
+ }
1275
+ else if (currentTagPaneMode === TAG_TYPE.MP) {
1276
+ // Check only MP tags
1277
+ const mpVisibility = Object.values(tagVisibility[TAG_TYPE.MP] || {});
1278
+ allHidden = mpVisibility.length > 0 && mpVisibility.every(v => v === false);
1279
+ }
1280
+ else {
1281
+ // Check all tags (both MP and IOT)
1282
+ const allValues = [
1283
+ ...Object.values(tagVisibility[TAG_TYPE.MP] || {}),
1284
+ ...Object.values(tagVisibility[TAG_TYPE.IOT] || {})
1285
+ ];
1286
+ allHidden = allValues.length > 0 && allValues.every(v => v === false);
1287
+ }
1288
+ // Toggle: if all hidden, show all; if any visible, hide all
1289
+ updateAll(allHidden);
1290
+ });
1291
+ }
1230
1292
  function handleScreenshot() {
1231
1293
  var _a, _b, _c, _d, _e, _f, _g, _h;
1232
1294
  const screenshotBtn = document.getElementById('at-screenshot-btn');
@@ -3981,4 +4043,4 @@ activeToolbarItem, activeActionItem, cancelModelPlacementPrompt, isCustomMapCont
3981
4043
  //methods
3982
4044
  batchAddEventListenerById, batchAddEventListenerByClassName, batchAddEventListenerByClassNames, batchAddEventListenerByDataAttribute, setActiveToolbarItem, toggleDisplayPane, toggleActionBar, setupIndividualEventListeners, setupSpaceEventSubscriptions, handleModelVisibility, handleDeleteModel, handleShowMinimap, handleScrollToView, handleRenderMeetingUI, handleShowCustomMinimap, renderTagPaneContent,
3983
4045
  // partition
3984
- handlePartitionVisibility, handlePolygonVisibility, handleDeletePartition, handleDisplayElements, handleWindowVisibility, clearActivePane };
4046
+ handlePartitionVisibility, handlePolygonVisibility, handleDeletePartition, handleToggleVisibilityTags, handleDisplayElements, handleWindowVisibility, clearActivePane };
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.0",
4
4
  "description": "ArchiTwin Library for Matterport",
5
5
  "main": "./lib/architwin.js",
6
6
  "types": "./lib/architwin.d.ts",
@@ -676,12 +676,19 @@
676
676
 
677
677
  .at_table_button_row {
678
678
  display: flex;
679
- flex-wrap: nowrap;
680
- flex-direction: row;
681
- justify-content: space-between;
682
- align-items: auto;
683
- align-content: start;
684
- margin-right: 0.5em;
679
+ justify-content: end;
680
+ width: fit-content;
681
+ }
682
+
683
+ .at_table_label_row{
684
+ width: 130px;
685
+ }
686
+
687
+ .at_table_label_row span {
688
+ display: block;
689
+ overflow: hidden;
690
+ text-overflow: ellipsis;
691
+ white-space: nowrap;
685
692
  }
686
693
 
687
694
  /*Form Classes*/
@@ -769,8 +776,8 @@
769
776
  margin-top: 1px;
770
777
  margin-left: 4px;
771
778
  height: 2.45rem;
772
- /* width: 9rem; */
773
- width: 13rem
779
+ width: 100%;
780
+ /* width: 11.75rem */
774
781
  }
775
782
 
776
783
  .at_field_search_input:focus {
@@ -1690,7 +1697,7 @@
1690
1697
  .at_tag_list_pane {
1691
1698
  margin: 6px 6px 0px 6px !important;
1692
1699
  gap: 0px !important;
1693
- padding: 10px 10px 5px 10px !important;
1700
+ padding: 0px 5px 5px 10px !important;
1694
1701
  }
1695
1702
 
1696
1703
  /* Basic styling for the tree */
@@ -2383,11 +2390,6 @@ dialog#at-screen-share-request-modal::backdrop {
2383
2390
  margin-top: 1px;
2384
2391
  }
2385
2392
 
2386
- #at-tag-sort-icon {
2387
- background-color: var(--bg-secondary);
2388
- margin-bottom: 15px;
2389
- margin-right: -15px;
2390
- }
2391
2393
 
2392
2394
  #at-object-sort-icon {
2393
2395
  background-color: var(--bg-secondary);