architwin 1.19.3 → 1.19.4

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.
@@ -119,7 +119,7 @@ export function renderObjectRow(payload, objectComponent) {
119
119
  </div>
120
120
  <div>
121
121
  <div class="at_button_icon" style="display:inline-block">
122
- <span class="mdi ${isObjectVisible ? 'mdi-eye-off' : 'mdi-eye'} at_model_visibility_btn" id="at-visibility-model-${payload.id}-btn" data-cy="at-visibility-model-${payload.id}-btn" card-id="${payload.id}"></span>
122
+ <span class="mdi ${isObjectVisible ? 'mdi-eye' : 'mdi-eye-off'} at_model_visibility_btn" id="at-visibility-model-${payload.id}-btn" data-cy="at-visibility-model-${payload.id}-btn" card-id="${payload.id}"></span>
123
123
  </div>
124
124
  <div class="at_button_icon" style="display:inline-block">
125
125
  <span class="mdi mdi-delete-outline at_model_delete_btn" id="at-delete-model-${payload.id}-btn" data-cy="at-delete-model-${payload.id}-btn" card-id="${payload.id}"></span>
@@ -213,11 +213,13 @@ export function displayPartitionItems(partitionItems, partitionId, object, paren
213
213
  // This is for the walls
214
214
  partitionItems.forEach((wall, index) => {
215
215
  log.info("__@ partition item: ", wall);
216
+ if (!wall || !wall.name || !(object === null || object === void 0 ? void 0 : object[index]))
217
+ return;
216
218
  if (!wall.options.is_deleted) {
217
219
  if (!wall.hide) {
218
220
  // Split wall name to localize
219
221
  const match = wall.name.match(/wall-(\d+)$/);
220
- const wallNumber = parseInt(match[1]) + 1;
222
+ const wallNumber = match ? parseInt(match[1]) + 1 : index + 1;
221
223
  const isVisible = wall.options.is_visible;
222
224
  const objName = object[index].name.includes('_') ? object[index].name : `${partitionId}_${object[index].name}`;
223
225
  log.info("__@ objName: ", objName);
@@ -142,6 +142,8 @@ export function initFormData(tagId) {
142
142
  tagEmbedInput.value = '';
143
143
  // clear any previous edit backup when entering add mode
144
144
  originalTagBackup = null;
145
+ // clear stale reference to a previously saved tag so subcategory color changes don't leak onto it
146
+ selectedTag = undefined;
145
147
  }
146
148
  const categoryChevron = document.getElementById('at-category-dropdown');
147
149
  const subcategoryChevron = document.getElementById('at-subcategory-dropdown');
@@ -11,7 +11,7 @@ import { SPACE_EVENTS, sortTagOptions, TAG_TYPE } from "../../../types";
11
11
  import { batchAddEventListenerByClassName, toggleDisplayPane, batchAddEventListenerByDataAttribute } from "../../events";
12
12
  import { convertToCssRgb, getBundleVersion, stringContains } from "../../../utils";
13
13
  import { gotoTag, disposeTag, dispatchSpaceEvent, _tags, getUserAssignedCategories, _mpConfig, moveTag, getAtwinSdk, toggleVisibilityTag, _tagIotCategoryTypes } from "../../../architwin";
14
- import { hideTagsFromSpace, initFormData, renderTagsInSpace, toggleDropdown } from "./tagFormPane";
14
+ import { initFormData, renderTagsInSpace, toggleDropdown } from "./tagFormPane";
15
15
  import { toggleModal, setModalAction } from "./modal";
16
16
  import { initIoTFormData, setIoTFormMode } from './tagIotFormPane';
17
17
  import { Notyf } from 'notyf';
@@ -272,6 +272,11 @@ export function renderTags(tags, showOwnTagsOnly = false) {
272
272
  console.log("TAG DELETE", tagId, _tags);
273
273
  const targetTag = _tags.find(tag => tag.json_data.id.toString() == tagId);
274
274
  yield disposeTag({ tagId: tagId });
275
+ if (targetTag) {
276
+ const tagType = targetTag.tag_type || TAG_TYPE.MP;
277
+ delete tagVisibility[tagType][tagId];
278
+ updateShowAllButton();
279
+ }
275
280
  const tagRow = document.getElementById(`at-tag-row-${tagId}`);
276
281
  tagRow.remove();
277
282
  const payload = { tag: targetTag };
@@ -486,7 +491,13 @@ export function addClickEventToTagRow(tag) {
486
491
  if (tag) {
487
492
  const tagId = tag.getAttribute('tag-id');
488
493
  if (tagId && tagId !== null) {
494
+ const deletedTag = _tags.find(t => t.json_data.id.toString() === tagId);
489
495
  yield disposeTag({ tagId: tagId });
496
+ if (deletedTag) {
497
+ const tagType = deletedTag.tag_type || TAG_TYPE.MP;
498
+ delete tagVisibility[tagType][tagId];
499
+ updateShowAllButton();
500
+ }
490
501
  const tagRow = document.getElementById(`at-tag-row-${tagId}`);
491
502
  tagRow.remove();
492
503
  notify.success(i18n.t('SuccessDeleteTag'));
@@ -879,9 +890,9 @@ export function filterIotTagByCategory(tags) {
879
890
  return __awaiter(this, void 0, void 0, function* () {
880
891
  log.info("selectedIoTCategoryFilter", selectedIoTCategoryFilter, _tags);
881
892
  const filteredTags = tags.filter(tag => tag.iot_tag.iot_category == selectedIoTCategoryFilter.name);
882
- const removeTags = tags.filter(tag => !filteredTags.some(ft => ft.id === tag.id) && tag.tag_type === TAG_TYPE.IOT);
883
- yield hideTagsFromSpace(removeTags);
884
- yield renderTagsInSpace(filteredTags, true);
893
+ // const removeTags = tags.filter(tag => !filteredTags.some(ft => ft.id === tag.id) && tag.tag_type === TAG_TYPE.IOT)
894
+ // await hideTagsFromSpace(removeTags)
895
+ // await renderTagsInSpace(filteredTags, true)
885
896
  renderTags(filteredTags);
886
897
  });
887
898
  }
@@ -181,7 +181,13 @@ function toggleDisplayPane(targetId) {
181
181
  if (tag) {
182
182
  const tagId = tag.getAttribute('tag-id');
183
183
  if (tagId && tagId !== null) {
184
+ const deletedTag = _tags.find(t => t.json_data.id.toString() === tagId);
184
185
  yield disposeTag({ tagId: tagId });
186
+ if (deletedTag) {
187
+ const tagType = deletedTag.tag_type || TAG_TYPE.MP;
188
+ delete tagVisibility[tagType][tagId];
189
+ updateShowAllButton();
190
+ }
185
191
  const tagRow = document.getElementById(`at-tag-row-${tagId}`);
186
192
  log.info("tagRow", tagRow);
187
193
  tagRow.remove();
@@ -195,9 +201,9 @@ function toggleDisplayPane(targetId) {
195
201
  }
196
202
  if (paneId === 'at-object-list-pane') {
197
203
  const objectsInSpace = get3DXObjects();
198
- const objectComponents = objectsInSpace.map(obj => obj.component);
199
- const spaceObjects = objectsInSpace.filter(obj => obj.type !== 'POLYGON' && obj.type !== 'BASEPOINT' && obj.type !== "PATH").map(obj => obj.object);
204
+ const spaceObjects = objectsInSpace.filter(obj => obj.type !== 'POLYGON' && obj.type !== 'BASEPOINT' && obj.type !== "PATH" && obj.type !== "TUBELINE").map(obj => obj.object);
200
205
  const sortedObjects = sortShowcaseObjects(spaceObjects, { by: 'showcase_object_name', order: 'asc' });
206
+ const objectComponents = sortedObjects.map(obj => { var _a; return (_a = objectsInSpace.find(o => o.object.id === obj.id)) === null || _a === void 0 ? void 0 : _a.component; });
201
207
  renderObjectCards(sortedObjects, objectComponents);
202
208
  if (targetId === 'at-cancel-library-btn') {
203
209
  yield cancelModelPlacement();
@@ -819,6 +825,15 @@ function handlePlaceTag() {
819
825
  const tags = getMpTags();
820
826
  _tags[tags.length - 1].category_uuid = payload.tagSubcategoryId;
821
827
  currentTag = _tags[_tags.length - 1];
828
+ if (currentTag) {
829
+ const tagType = currentTag.tag_type || TAG_TYPE.MP;
830
+ const tagId = currentTag.json_data.id;
831
+ if (!tagVisibility[tagType])
832
+ tagVisibility[tagType] = {};
833
+ tagVisibility[tagType][tagId] = true;
834
+ updateShowAllButton();
835
+ saveTagVisibilityToStorage(tagVisibility);
836
+ }
822
837
  log.info('_tags', _tags);
823
838
  log.info("Last Tag Pushed", currentTag);
824
839
  cancelTagPlacementPrompt.style.display = 'none';
@@ -854,6 +869,15 @@ function handlePlaceTag() {
854
869
  notyf.success(`${i18n.t('SuccessAddTagToSpace')}`);
855
870
  const tags = getMpTags();
856
871
  currentTag = tags[tags.length - 1];
872
+ if (currentTag) {
873
+ const tagType = currentTag.tag_type || TAG_TYPE.MP;
874
+ const tagId = currentTag.json_data.id;
875
+ if (!tagVisibility[tagType])
876
+ tagVisibility[tagType] = {};
877
+ tagVisibility[tagType][tagId] = true;
878
+ updateShowAllButton();
879
+ saveTagVisibilityToStorage(tagVisibility);
880
+ }
857
881
  log.info("Last Tag Pushed", tags[tags.length - 1]);
858
882
  cancelTagPlacementPrompt.style.display = 'none';
859
883
  isPlacingTag = false;
@@ -911,6 +935,14 @@ function handlePlaceTag() {
911
935
  if (index !== -1) {
912
936
  log.info("tag found");
913
937
  _tags[index].category_uuid = payload.tagSubcategoryId;
938
+ const newTag = _tags[index];
939
+ const tagType = newTag.tag_type || TAG_TYPE.MP;
940
+ const tagId = newTag.json_data.id;
941
+ if (!tagVisibility[tagType])
942
+ tagVisibility[tagType] = {};
943
+ tagVisibility[tagType][tagId] = true;
944
+ updateShowAllButton();
945
+ saveTagVisibilityToStorage(tagVisibility);
914
946
  }
915
947
  else {
916
948
  log.info("tag not found");
@@ -950,6 +982,14 @@ function handlePlaceTag() {
950
982
  if (index !== -1) {
951
983
  log.info("tag found");
952
984
  _tags[index].category_uuid = payload.tagSubcategoryId;
985
+ const newTag = _tags[index];
986
+ const tagType = newTag.tag_type || TAG_TYPE.MP;
987
+ const tagId = newTag.json_data.id;
988
+ if (!tagVisibility[tagType])
989
+ tagVisibility[tagType] = {};
990
+ tagVisibility[tagType][tagId] = true;
991
+ updateShowAllButton();
992
+ saveTagVisibilityToStorage(tagVisibility);
953
993
  }
954
994
  else {
955
995
  log.info("tag not found");
@@ -967,6 +1007,10 @@ function handlePlaceTag() {
967
1007
  }
968
1008
  }
969
1009
  }
1010
+ else {
1011
+ cancelTagPlacementPrompt.style.display = 'none';
1012
+ isPlacingTag = false;
1013
+ }
970
1014
  }));
971
1015
  }
972
1016
  function onDisposeTag() {
@@ -979,7 +1023,13 @@ function onDisposeTag() {
979
1023
  if (tag) {
980
1024
  const tagId = tag.getAttribute('tag-id');
981
1025
  if (tagId && tagId !== null) {
1026
+ const deletedTag = _tags.find(t => t.json_data.id.toString() === tagId);
982
1027
  yield disposeTag({ tagId: tagId });
1028
+ if (deletedTag) {
1029
+ const tagType = deletedTag.tag_type || TAG_TYPE.MP;
1030
+ delete tagVisibility[tagType][tagId];
1031
+ updateShowAllButton();
1032
+ }
983
1033
  const tagRow = document.getElementById(`at-tag-row-${tagId}`);
984
1034
  log.info("tagRow", tagRow);
985
1035
  tagRow.remove();
@@ -1032,7 +1082,13 @@ function onDisposeTag() {
1032
1082
  }
1033
1083
  cancelMoveTag();
1034
1084
  if (iTag !== null) {
1085
+ const deletedTag = _tags.find(t => t.id.toString() === iTag.id.toString());
1035
1086
  yield disposeTag({ tagId: iTag.id });
1087
+ if (deletedTag) {
1088
+ const tagType = deletedTag.tag_type || TAG_TYPE.MP;
1089
+ delete tagVisibility[tagType][iTag.id.toString()];
1090
+ updateShowAllButton();
1091
+ }
1036
1092
  }
1037
1093
  iTag = null;
1038
1094
  if (cancelTagPlacementPrompt) {
@@ -1066,6 +1122,7 @@ function handleSaveTag() {
1066
1122
  const tagFormPayload = getTagFormData();
1067
1123
  log.info('=== tagFormPayload ===', tagFormPayload);
1068
1124
  saveTagBtn.classList.add('at_disabled');
1125
+ let saveSucceeded = false;
1069
1126
  if (tagFormMode == "ADD" /* FORM_MODE.ADD */) {
1070
1127
  log.info("FORM MODE", "ADD" /* FORM_MODE.ADD */);
1071
1128
  if (_tagCategories) {
@@ -1092,6 +1149,7 @@ function handleSaveTag() {
1092
1149
  console.log("@__ handleSaveTag payload ", payload);
1093
1150
  dispatchSpaceEvent(SPACE_EVENTS.TAG_SAVED, payload);
1094
1151
  currentTag = undefined;
1152
+ saveSucceeded = true;
1095
1153
  toggleDisplayPane('at-cancel-tag-form-btn');
1096
1154
  }
1097
1155
  else {
@@ -1111,6 +1169,7 @@ function handleSaveTag() {
1111
1169
  let payload = { tag: currentTag };
1112
1170
  dispatchSpaceEvent(SPACE_EVENTS.TAG_SAVED, payload);
1113
1171
  currentTag = undefined;
1172
+ saveSucceeded = true;
1114
1173
  toggleDisplayPane('at-cancel-tag-form-btn');
1115
1174
  }
1116
1175
  else {
@@ -1219,6 +1278,7 @@ function handleSaveTag() {
1219
1278
  log.info("SAVE PAYLOAD", payload);
1220
1279
  dispatchSpaceEvent(SPACE_EVENTS.TAG_SAVED, payload);
1221
1280
  // selectedTag = undefined
1281
+ saveSucceeded = true;
1222
1282
  toggleDisplayPane('at-cancel-tag-form-btn');
1223
1283
  }
1224
1284
  else {
@@ -1254,6 +1314,7 @@ function handleSaveTag() {
1254
1314
  log.info("SAVE PAYLOAD", payload);
1255
1315
  dispatchSpaceEvent(SPACE_EVENTS.TAG_SAVED, payload);
1256
1316
  // selectedTag = undefined
1317
+ saveSucceeded = true;
1257
1318
  toggleDisplayPane('at-cancel-tag-form-btn');
1258
1319
  }
1259
1320
  else {
@@ -1261,11 +1322,12 @@ function handleSaveTag() {
1261
1322
  }
1262
1323
  }
1263
1324
  }
1264
- clearTagFormDropdown();
1265
- clearSelectedTag();
1266
- iTag = null;
1267
1325
  saveTagBtn.classList.remove('at_disabled');
1268
- setTagFormMode("NONE" /* FORM_MODE.NONE */);
1326
+ if (saveSucceeded) {
1327
+ clearTagFormDropdown();
1328
+ iTag = null;
1329
+ setTagFormMode("NONE" /* FORM_MODE.NONE */);
1330
+ }
1269
1331
  }));
1270
1332
  }
1271
1333
  // Toggle all tags visibility
@@ -1278,7 +1340,7 @@ function handleToggleVisibilityTags() {
1278
1340
  const updateAll = (visible) => __awaiter(this, void 0, void 0, function* () {
1279
1341
  // Determine which tags to update based on current mode
1280
1342
  const tagsToUpdate = currentTagPaneMode
1281
- ? _tags.filter(tag => tag.tag_type === currentTagPaneMode)
1343
+ ? _tags.filter(tag => (tag.tag_type || TAG_TYPE.MP) === currentTagPaneMode)
1282
1344
  : _tags;
1283
1345
  for (const tag of tagsToUpdate) {
1284
1346
  const tagType = tag.tag_type || TAG_TYPE.MP;
@@ -1802,9 +1864,9 @@ function handleSetModelsView() {
1802
1864
  modelsListViewBtn.classList.remove('at_ghost_active');
1803
1865
  modelsView = 'card';
1804
1866
  log.info("modelCardViewBtn", modelsView);
1805
- const spaceObjects = _3DXObjects.filter(obj => obj.type !== 'POLYGON' && obj.type !== "BASEPOINT" && obj.type !== "PATH").map(obj => obj.object);
1806
- const objectComponents = _3DXObjects.map(obj => obj.component);
1867
+ const spaceObjects = _3DXObjects.filter(obj => obj.type !== 'POLYGON' && obj.type !== "BASEPOINT" && obj.type !== "PATH" && obj.type !== "TUBELINE").map(obj => obj.object);
1807
1868
  const sortedObjects = sortShowcaseObjects(spaceObjects, selectedObjectSortOption);
1869
+ const objectComponents = sortedObjects.map(obj => { var _a; return (_a = _3DXObjects.find(o => o.object.id === obj.id)) === null || _a === void 0 ? void 0 : _a.component; });
1808
1870
  renderObjectCards(sortedObjects, objectComponents);
1809
1871
  log.info("selectedObject", selectedObject);
1810
1872
  if (selectedObject) {
@@ -1816,9 +1878,9 @@ function handleSetModelsView() {
1816
1878
  modelsCardViewBtn.classList.remove('at_ghost_active');
1817
1879
  modelsView = 'list';
1818
1880
  log.info("modelListViewBtn", modelsView);
1819
- const spaceObjects = _3DXObjects.filter(obj => obj.type !== "POLYGON" && obj.type !== "BASEPOINT" && obj.type !== "PATH").map(obj => obj.object);
1820
- const objectComponents = _3DXObjects.map(obj => obj.component);
1881
+ const spaceObjects = _3DXObjects.filter(obj => obj.type !== "POLYGON" && obj.type !== "BASEPOINT" && obj.type !== "PATH" && obj.type !== "TUBELINE").map(obj => obj.object);
1821
1882
  const sortedObjects = sortShowcaseObjects(spaceObjects, selectedObjectSortOption);
1883
+ const objectComponents = sortedObjects.map(obj => { var _a; return (_a = _3DXObjects.find(o => o.object.id === obj.id)) === null || _a === void 0 ? void 0 : _a.component; });
1822
1884
  renderObjectList(sortedObjects, objectComponents);
1823
1885
  if (selectedObject) {
1824
1886
  setActiveCard(`at-card-body-${selectedObject.object.id}`, false);
@@ -3337,19 +3399,22 @@ function handleClearSearchTagName() {
3337
3399
  const tags = [..._tags];
3338
3400
  if (selectedCategoryFilterId || selectedSubCategoryFilterId && isTagPaneActive) {
3339
3401
  const filteredTags = filterTagList(tags).filter(tag => !tag.tag_type || tag.tag_type === TAG_TYPE.MP);
3402
+ const sortedTagsToDisplay = sortTags(filteredTags, selectedTagSortOption);
3340
3403
  // show filtered tags only
3341
- yield renderTagsInSpace(filteredTags, true);
3342
- renderTags(filteredTags);
3404
+ yield renderTagsInSpace(sortedTagsToDisplay, true);
3405
+ renderTags(sortedTagsToDisplay);
3343
3406
  }
3344
3407
  else if (tags.length > 0 && isTagPaneActive) {
3345
3408
  const filteredMPTags = tags.filter(tag => !tag.tag_type || tag.tag_type === TAG_TYPE.MP);
3346
- yield renderTagsInSpace(filteredMPTags, true);
3347
- renderTags(filteredMPTags, true);
3409
+ const sortedTagsToDisplay = sortTags(filteredMPTags, selectedTagSortOption);
3410
+ yield renderTagsInSpace(sortedTagsToDisplay, true);
3411
+ renderTags(sortedTagsToDisplay, true);
3348
3412
  }
3349
3413
  else if (!isTagPaneActive) {
3350
3414
  const filteredIotTags = filterIotTagList(tags);
3351
- yield renderTagsInSpace(filteredIotTags, true);
3352
- renderTags(filteredIotTags);
3415
+ const sortedTagsToDisplay = sortTags(filteredIotTags, selectedTagSortOption);
3416
+ yield renderTagsInSpace(sortedTagsToDisplay, true);
3417
+ renderTags(sortedTagsToDisplay);
3353
3418
  }
3354
3419
  }));
3355
3420
  }
@@ -3367,7 +3432,7 @@ function handleSearchFromTagListButton() {
3367
3432
  const foundTag = filterTagList(tags);
3368
3433
  if (foundTag) {
3369
3434
  if (selectedCategoryFilterId || selectedSubCategoryFilterId && isTagPaneActive) {
3370
- const filteredTags = filterTagList(foundTag);
3435
+ const filteredTags = filterTagList(foundTag).filter(tag => !tag.tag_type || tag.tag_type === TAG_TYPE.MP);
3371
3436
  const removeTags = tags.filter(tag => !filteredTags.some(ft => ft.id === tag.id) && (!tag.tag_type || tag.tag_type === TAG_TYPE.MP));
3372
3437
  log.info("removeTags", removeTags);
3373
3438
  // remove tags that is not part in the sorted Tags
@@ -3376,23 +3441,24 @@ function handleSearchFromTagListButton() {
3376
3441
  yield renderTagsInSpace(filteredTags, true);
3377
3442
  renderTags(filteredTags);
3378
3443
  }
3379
- else if (foundTag.length > 0 && isTagPaneActive) {
3380
- const removeTags = tags.filter(tag => !foundTag.some(ft => ft.id === tag.id) && (!tag.tag_type || tag.tag_type === TAG_TYPE.MP));
3444
+ else if (isTagPaneActive) {
3445
+ const filteredMpTags = foundTag.filter(tag => !tag.tag_type || tag.tag_type === TAG_TYPE.MP);
3446
+ const removeTags = tags.filter(tag => !filteredMpTags.some(ft => ft.id === tag.id) && (!tag.tag_type || tag.tag_type === TAG_TYPE.MP));
3381
3447
  log.info("removeTags", removeTags);
3382
3448
  // remove tags that is not part in the sorted Tags
3383
3449
  yield hideTagsFromSpace(removeTags);
3384
3450
  // show filtered tags only
3385
- yield renderTagsInSpace(foundTag, true);
3386
- renderTags(foundTag, true);
3451
+ yield renderTagsInSpace(filteredMpTags, true);
3452
+ renderTags(filteredMpTags, true);
3387
3453
  }
3388
3454
  else if (!isTagPaneActive) {
3389
3455
  const filteredIotTags = filterIotTagList(foundTag);
3390
- const removeTags = tags.filter(tag => !filteredIotTags.some(ft => ft.id === tag.id) && tag.tag_type === TAG_TYPE.IOT);
3391
- log.info("removeTags", removeTags);
3392
- // remove tags that is not part in the sorted Tags
3393
- yield hideTagsFromSpace(removeTags);
3394
- // show filtered tags only
3395
- yield renderTagsInSpace(filteredIotTags, true);
3456
+ // const removeTags = tags.filter(tag => !filteredIotTags.some(ft => ft.id === tag.id) && tag.tag_type === TAG_TYPE.IOT)
3457
+ // log.info("removeTags", removeTags)
3458
+ // // remove tags that is not part in the sorted Tags
3459
+ // await hideTagsFromSpace(removeTags)
3460
+ // // show filtered tags only
3461
+ // await renderTagsInSpace(filteredIotTags, true)
3396
3462
  renderTags(filteredIotTags);
3397
3463
  }
3398
3464
  }
@@ -3605,6 +3671,15 @@ function handlePlaceIotTag() {
3605
3671
  const tags = getMpTags();
3606
3672
  currentTag = _tags[tags.length - 1];
3607
3673
  _tags[tags.length - 1].category_uuid = payload.tagCategoryId;
3674
+ if (currentTag) {
3675
+ const tagType = currentTag.tag_type || TAG_TYPE.IOT;
3676
+ const tagId = currentTag.json_data.id;
3677
+ if (!tagVisibility[tagType])
3678
+ tagVisibility[tagType] = {};
3679
+ tagVisibility[tagType][tagId] = true;
3680
+ updateShowAllButton();
3681
+ saveTagVisibilityToStorage(tagVisibility);
3682
+ }
3608
3683
  cancelTagPlacementPrompt.style.display = 'none';
3609
3684
  isPlacingTag = false;
3610
3685
  });
@@ -3636,6 +3711,15 @@ function handlePlaceIotTag() {
3636
3711
  notyf.success(`${i18n.t('SuccessAddTagToSpace')}`);
3637
3712
  const tags = getMpTags();
3638
3713
  currentTag = tags[tags.length - 1];
3714
+ if (currentTag) {
3715
+ const tagType = currentTag.tag_type || TAG_TYPE.IOT;
3716
+ const tagId = currentTag.json_data.id;
3717
+ if (!tagVisibility[tagType])
3718
+ tagVisibility[tagType] = {};
3719
+ tagVisibility[tagType][tagId] = true;
3720
+ updateShowAllButton();
3721
+ saveTagVisibilityToStorage(tagVisibility);
3722
+ }
3639
3723
  log.info("Last IoT Tag Pushed", tags[tags.length - 1]);
3640
3724
  cancelTagPlacementPrompt.style.display = 'none';
3641
3725
  isPlacingTag = false;
@@ -3966,11 +4050,16 @@ function handleClickEventInObjectSortOption() {
3966
4050
  const sortOption = closestOption.dataset.sort;
3967
4051
  updateSelectedObjectSortOption(sortOption);
3968
4052
  const objectsInSpace = get3DXObjects();
3969
- const objectComponents = objectsInSpace.map(obj => obj.component);
3970
- const spaceObjects = objectsInSpace.filter(obj => obj.type !== 'POLYGON' && obj.type !== 'BASEPOINT').map(obj => obj.object);
4053
+ const spaceObjects = objectsInSpace.filter(obj => obj.type !== 'POLYGON' && obj.type !== 'BASEPOINT' && obj.type !== 'PATH' && obj.type !== 'TUBELINE').map(obj => obj.object);
3971
4054
  const sortConfig = sortObjectOptions[sortOption] || { by: 'label', order: 'asc' };
3972
4055
  const sortedObjects = sortShowcaseObjects(spaceObjects, sortConfig);
3973
- renderObjectCards(sortedObjects, objectComponents);
4056
+ const objectComponents = sortedObjects.map(obj => { var _a; return (_a = objectsInSpace.find(o => o.object.id === obj.id)) === null || _a === void 0 ? void 0 : _a.component; });
4057
+ if (modelsView === 'list') {
4058
+ renderObjectList(sortedObjects, objectComponents);
4059
+ }
4060
+ else {
4061
+ renderObjectCards(sortedObjects, objectComponents);
4062
+ }
3974
4063
  }
3975
4064
  });
3976
4065
  }
@@ -621,11 +621,13 @@ export class BufferGeometry {
621
621
  // }
622
622
  };
623
623
  this.renderPolygon = () => {
624
- var _a;
624
+ var _a, _b, _c, _d;
625
625
  const THREE = this.context.three;
626
+ if (!this.inputs.path || this.inputs.path.length === 0)
627
+ return;
626
628
  const polyData = this.inputs.polygonData;
627
629
  console.log("polyData ", polyData);
628
- const WALL_HEIGHT = polyData && polyData.walls[0].wall_height ? polyData.walls[0].wall_height : this.inputs.wallHeight;
630
+ const WALL_HEIGHT = (_c = (_b = (_a = polyData === null || polyData === void 0 ? void 0 : polyData.walls) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.wall_height) !== null && _c !== void 0 ? _c : this.inputs.wallHeight;
629
631
  this.groupedMesh = new THREE.Group();
630
632
  let floorDataArray = [];
631
633
  let wallDataArray = [];
@@ -637,7 +639,7 @@ export class BufferGeometry {
637
639
  return point;
638
640
  });
639
641
  let floorLevel;
640
- console.log("floorLevel polyData.floor.floor_level", (_a = polyData === null || polyData === void 0 ? void 0 : polyData.floor) === null || _a === void 0 ? void 0 : _a.floor_level);
642
+ console.log("floorLevel polyData.floor.floor_level", (_d = polyData === null || polyData === void 0 ? void 0 : polyData.floor) === null || _d === void 0 ? void 0 : _d.floor_level);
641
643
  floorLevel = this.inputs.path[0].y;
642
644
  console.log("floorLevel ", floorLevel);
643
645
  console.log("floorLevel this.inputs.path[0].y", this.inputs.path[0].y);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "architwin",
3
- "version": "1.19.3",
3
+ "version": "1.19.4",
4
4
  "description": "ArchiTwin Library for Matterport",
5
5
  "main": "./lib/architwin.js",
6
6
  "types": "./lib/architwin.d.ts",