architwin 1.18.5 → 1.19.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.
- package/README.md +2164 -185
- package/bundle/sdk.d.ts +2 -0
- package/lib/architwin.d.ts +6 -1
- package/lib/architwin.js +1 -1
- package/lib/atwinui/components/toolbar/card.js +16 -13
- package/lib/atwinui/components/toolbar/generalSettingsMenuPane.js +14 -0
- package/lib/atwinui/components/toolbar/i18n.js +15 -1
- package/lib/atwinui/components/toolbar/index.d.ts +2 -2
- package/lib/atwinui/components/toolbar/index.js +2 -2
- package/lib/atwinui/components/toolbar/tagFormPane.d.ts +3 -0
- package/lib/atwinui/components/toolbar/tagFormPane.js +122 -96
- package/lib/atwinui/components/toolbar/tagListPane.js +7 -11
- package/lib/atwinui/events.js +65 -4
- package/lib/graphql.d.ts +8 -0
- package/lib/graphql.js +60 -0
- package/lib/tag.d.ts +6 -1
- package/lib/tag.js +10 -1
- package/lib/types.d.ts +41 -1
- package/lib/types.js +2 -0
- package/package.json +1 -1
- package/static/utility.css +3 -0
|
@@ -271,19 +271,22 @@ export function setActiveLibraryCard(cardId) {
|
|
|
271
271
|
const payload = yield addObjectToSpace(selectedObject.amazon_uri, selectedObject.object_type, { position: coords });
|
|
272
272
|
payload.object_data = selectedObject;
|
|
273
273
|
if (isToolbarFeatureEnabled('bim')) {
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
274
|
+
const basepoint = get3DXObjects().find(obj => obj.type === "BASEPOINT");
|
|
275
|
+
if (basepoint) {
|
|
276
|
+
payload.coordinate_system = getCoordinateSystem();
|
|
277
|
+
const thisObjBimPosition = convertYupToZup(payload.object_position, getMPBasepoint(), getBasepoint(), getMeasurementUnit(), parseInt(getScaleFactor()));
|
|
278
|
+
console.log("====== caroline thisObjBimPosition: ", thisObjBimPosition);
|
|
279
|
+
const thisObjBimScale = convertYupScaleToZupScale(payload.object_scale, UNITS.METER, parseInt(getScaleFactor()));
|
|
280
|
+
console.log("====== caroline thisObjBimScale: ", thisObjBimScale);
|
|
281
|
+
const coordPayload = {
|
|
282
|
+
coord_system: getCoordinateSystem(),
|
|
283
|
+
bim_coordinates: {
|
|
284
|
+
position: thisObjBimPosition,
|
|
285
|
+
scale: thisObjBimScale,
|
|
286
|
+
}
|
|
287
|
+
};
|
|
288
|
+
payload.json_data = JSON.stringify({ coordSystemCalibration: coordPayload });
|
|
289
|
+
}
|
|
287
290
|
}
|
|
288
291
|
console.log("======Payload:", payload);
|
|
289
292
|
dispatchSpaceEvent(SPACE_EVENTS.MODEL_RENDERED, { model: payload });
|
|
@@ -40,6 +40,20 @@ export function renderGeneralSettingsMenu() {
|
|
|
40
40
|
<span class="at_text_xxs at_mx-w-16 mdi mdi-information-slab-circle" id="at-general-settings-note">
|
|
41
41
|
${i18n.t("Due to restrictions, original minimap is unavailable in password protected spaces. Please select and setup a custom minimap instead.")}
|
|
42
42
|
</span>
|
|
43
|
+
|
|
44
|
+
<div class="at_field at_flex_column">
|
|
45
|
+
<span class="at_text_base">${i18n.t("ImportMTagHeader")}</span>
|
|
46
|
+
<div id="at-import-mattertags" data-cy="at-import-mattertags">
|
|
47
|
+
<div class="at_button at_import_matterport_btn at_ghost" id="at-import-mattertag-btn" data-cy="at-import-mattertag-btn">
|
|
48
|
+
${i18n.t('ImportMTButton')}
|
|
49
|
+
<span class="mdi mdi-tray-arrow-down" id="at-import-mattertag-btn"></span>
|
|
50
|
+
</div>
|
|
51
|
+
</div>
|
|
52
|
+
</div>
|
|
53
|
+
<span class="at_text_xxs at_mx-w-16 mdi mdi-information-slab-circle" id="at-import-mattertag-note">
|
|
54
|
+
${i18n.t("ImportMTagInfo")}
|
|
55
|
+
</span>
|
|
56
|
+
|
|
43
57
|
<div class="at_scrollable_container at_h-min-45"></div>
|
|
44
58
|
</div>
|
|
45
59
|
</div>
|
|
@@ -290,6 +290,13 @@ i18n
|
|
|
290
290
|
"SuccessUpdatedFloorLevel": "Updated the partition's floor level",
|
|
291
291
|
"DuplicatePartitionName": "This partition name is already used in this room. Please choose a different name.",
|
|
292
292
|
"PleaseOnPolygonVisibility": "Action cannot be done, please turn on room visibility.",
|
|
293
|
+
"ImportMTagHeader": "Import Mattertags",
|
|
294
|
+
"ImportMTButton": "Import",
|
|
295
|
+
"ImportMTagInfo": "Importing the same tags more than once from your Matterport Space will cause duplicates",
|
|
296
|
+
"ImportResultPartial": "Failed to import {{errorCount}} tag(s).",
|
|
297
|
+
"ImportResultNone": "Failed to import any tags.",
|
|
298
|
+
"ImportResultSuccess": "Successfully imported {{count}} tag(s).",
|
|
299
|
+
"NothingToImport": "Nothing to import.",
|
|
293
300
|
}
|
|
294
301
|
},
|
|
295
302
|
ja: {
|
|
@@ -574,7 +581,14 @@ i18n
|
|
|
574
581
|
"IotCategoryRequired": "IoTカテゴリは必須です",
|
|
575
582
|
"SuccessUpdatedFloorLevel": "区画のフロアオフセット値が更新されました",
|
|
576
583
|
"DuplicatePartitionName": "このパーティション名は既にこの部屋で使用されています。別の名前を選択してください。",
|
|
577
|
-
"PleaseOnPolygonVisibility": "操作を行う前に、部屋の表示をオンにしてください。"
|
|
584
|
+
"PleaseOnPolygonVisibility": "操作を行う前に、部屋の表示をオンにしてください。",
|
|
585
|
+
"ImportMTagHeader": "Mattertagsをインポートする",
|
|
586
|
+
"ImportMTButton": "輸入",
|
|
587
|
+
"ImportMTagInfo": "Matterport Spaceから同じタグを複数回インポートすると、重複が発生します。",
|
|
588
|
+
"ImportResultPartial": "{{errorCount}}件のタグのインポートに失敗しました。",
|
|
589
|
+
"ImportResultNone": "タグのインポートに失敗しました。",
|
|
590
|
+
"ImportResultSuccess": "{{count}}件のタグをインポートしました。",
|
|
591
|
+
"NothingToImport": "インポートするものがありません。"
|
|
578
592
|
}
|
|
579
593
|
}
|
|
580
594
|
},
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { IToolbarData } from "../../../types";
|
|
2
2
|
import { setActiveMenu, clearActiveMenu, getObjectListStatus } from "./menuBar";
|
|
3
3
|
import { renderObjectCards, removeObjectCard } from "./objectListPane";
|
|
4
|
-
import { getTagFormData, setTagCategoriesOption, tagFormMode, selectedTag, renderCategoryDropdownOptions, toggleDropdown } from "./tagFormPane";
|
|
4
|
+
import { getTagFormData, setTagCategoriesOption, tagFormMode, selectedTag, renderCategoryDropdownOptions, toggleDropdown, originalTagBackup } from "./tagFormPane";
|
|
5
5
|
import { renderTags, renderTagRow, addClickEventToTagRow, setTagLink, getTagLink, selectedCategoryFilterId, selectedSubCategoryFilterId, filterTagList } from "./tagListPane";
|
|
6
6
|
import { renderPreviewModal, togglePreviewModal, closePreviewModal, setPreviewModalAction, activePreviewModal } from "./previewModal";
|
|
7
7
|
import { setActiveActionBtn, clearActiveActionBtn, toggleActionBarButtons } from "./actionBar";
|
|
@@ -22,4 +22,4 @@ declare let actionBar: HTMLElement;
|
|
|
22
22
|
*/
|
|
23
23
|
declare function setPreferredLanguage(): void;
|
|
24
24
|
declare function renderToolbarUI(payload: IToolbarData): void;
|
|
25
|
-
export { actionBar, tagFormMode, selectedTag, selectedCategoryFilterId, selectedSubCategoryFilterId, renderToolbarUI, renderObjectCards, setActiveMenu, clearActiveMenu, setActiveActionBtn, renderLibraryCards, renderTags, getTagFormData, renderTagRow, addClickEventToTagRow, setTagCategoriesOption, setActiveThemeCard, setActiveCard, setActiveLibraryCard, clearActiveCard, clearActiveLibraryCard, removeObjectCard, renderRecepientOptions, renderTagMessages, createTagMessage, renderCategoryDropdownOptions, toggleDropdown, setTagLink, getTagLink, setTagMessagingDetails, clearTagFormDropdown, clearTagFilterDropdown, getObjectListStatus, toggleModal, setModalAction, toggleModelControl, toggleActionSettings, clearActiveActionBtn, toggleActionBarButtons, filterTagList, setPreferredLanguage, renderPreviewModal, togglePreviewModal, closePreviewModal, setPreviewModalAction, activePreviewModal };
|
|
25
|
+
export { actionBar, tagFormMode, selectedTag, originalTagBackup, selectedCategoryFilterId, selectedSubCategoryFilterId, renderToolbarUI, renderObjectCards, setActiveMenu, clearActiveMenu, setActiveActionBtn, renderLibraryCards, renderTags, getTagFormData, renderTagRow, addClickEventToTagRow, setTagCategoriesOption, setActiveThemeCard, setActiveCard, setActiveLibraryCard, clearActiveCard, clearActiveLibraryCard, removeObjectCard, renderRecepientOptions, renderTagMessages, createTagMessage, renderCategoryDropdownOptions, toggleDropdown, setTagLink, getTagLink, setTagMessagingDetails, clearTagFormDropdown, clearTagFilterDropdown, getObjectListStatus, toggleModal, setModalAction, toggleModelControl, toggleActionSettings, clearActiveActionBtn, toggleActionBarButtons, filterTagList, setPreferredLanguage, renderPreviewModal, togglePreviewModal, closePreviewModal, setPreviewModalAction, activePreviewModal };
|
|
@@ -5,7 +5,7 @@ import { renderObjectListPane, renderObjectCards, removeObjectCard } from "./obj
|
|
|
5
5
|
import { renderSpaceUserListPane } from "./spaceUserListPane";
|
|
6
6
|
import { renderViewingRemoteSpace } from "./viewingRemoteSpace";
|
|
7
7
|
import { renderAddObjectPane } from "./addObjectPane";
|
|
8
|
-
import { renderTagFormPane, getTagFormData, setTagCategoriesOption, tagFormMode, selectedTag, renderCategoryDropdownOptions, toggleDropdown } from "./tagFormPane";
|
|
8
|
+
import { renderTagFormPane, getTagFormData, setTagCategoriesOption, tagFormMode, selectedTag, renderCategoryDropdownOptions, toggleDropdown, originalTagBackup } from "./tagFormPane";
|
|
9
9
|
import { renderTagListPane, renderTags, renderTagRow, addClickEventToTagRow, setTagLink, getTagLink, selectedCategoryFilterId, selectedSubCategoryFilterId, filterTagList } from "./tagListPane";
|
|
10
10
|
import { renderPreviewModal, togglePreviewModal, closePreviewModal, setPreviewModalAction, activePreviewModal } from "./previewModal";
|
|
11
11
|
import { renderAddMediascreenFormPane } from "./addMediascreenFormPane";
|
|
@@ -167,4 +167,4 @@ function renderToolbarUI(payload) {
|
|
|
167
167
|
themeManager(config);
|
|
168
168
|
}
|
|
169
169
|
}
|
|
170
|
-
export { actionBar, tagFormMode, selectedTag, selectedCategoryFilterId, selectedSubCategoryFilterId, renderToolbarUI, renderObjectCards, setActiveMenu, clearActiveMenu, setActiveActionBtn, renderLibraryCards, renderTags, getTagFormData, renderTagRow, addClickEventToTagRow, setTagCategoriesOption, setActiveThemeCard, setActiveCard, setActiveLibraryCard, clearActiveCard, clearActiveLibraryCard, removeObjectCard, renderRecepientOptions, renderTagMessages, createTagMessage, renderCategoryDropdownOptions, toggleDropdown, setTagLink, getTagLink, setTagMessagingDetails, clearTagFormDropdown, clearTagFilterDropdown, getObjectListStatus, toggleModal, setModalAction, toggleModelControl, toggleActionSettings, clearActiveActionBtn, toggleActionBarButtons, filterTagList, setPreferredLanguage, renderPreviewModal, togglePreviewModal, closePreviewModal, setPreviewModalAction, activePreviewModal };
|
|
170
|
+
export { actionBar, tagFormMode, selectedTag, originalTagBackup, selectedCategoryFilterId, selectedSubCategoryFilterId, renderToolbarUI, renderObjectCards, setActiveMenu, clearActiveMenu, setActiveActionBtn, renderLibraryCards, renderTags, getTagFormData, renderTagRow, addClickEventToTagRow, setTagCategoriesOption, setActiveThemeCard, setActiveCard, setActiveLibraryCard, clearActiveCard, clearActiveLibraryCard, removeObjectCard, renderRecepientOptions, renderTagMessages, createTagMessage, renderCategoryDropdownOptions, toggleDropdown, setTagLink, getTagLink, setTagMessagingDetails, clearTagFormDropdown, clearTagFilterDropdown, getObjectListStatus, toggleModal, setModalAction, toggleModelControl, toggleActionSettings, clearActiveActionBtn, toggleActionBarButtons, filterTagList, setPreferredLanguage, renderPreviewModal, togglePreviewModal, closePreviewModal, setPreviewModalAction, activePreviewModal };
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { FORM_MODE, ITagCategory } from "../../../types";
|
|
2
2
|
export declare let tagFormMode: FORM_MODE;
|
|
3
3
|
export declare let selectedTag: any;
|
|
4
|
+
export declare let originalTagBackup: any;
|
|
4
5
|
export declare function renderTagFormPane(): HTMLDivElement;
|
|
5
6
|
export declare function initFormData(tagId?: string): void;
|
|
6
7
|
export declare function getTagFormData(): {
|
|
@@ -18,3 +19,5 @@ export declare function renderSubcategoryDropdownOptions(elementId: string, item
|
|
|
18
19
|
export declare function clearTagFormDropdown(): void;
|
|
19
20
|
export declare function clearTagFilterDropdown(): void;
|
|
20
21
|
export declare function setTagFormMode(formMode: FORM_MODE): void;
|
|
22
|
+
export declare function clearSelectedTag(): void;
|
|
23
|
+
export declare function setSelectedTag(tag: any): void;
|
|
@@ -1,4 +1,13 @@
|
|
|
1
|
-
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
import { _atwin, _tagCategories, _tags, editTagColor, getMpTags } from "../../../architwin";
|
|
2
11
|
import { convertToCssRgb, stringContains } from "../../../utils";
|
|
3
12
|
import { TAG_TYPE } from "../../../types";
|
|
4
13
|
import { renderTags, setSelectedCategoryFilter, setSelectedSubcategoryFilter, filterTagList, getAllSubcategories, selectedCategoryFilterId, sortTags, selectedTagSortOption } from './tagListPane';
|
|
@@ -10,6 +19,7 @@ let selectedSubCategoryId = undefined;
|
|
|
10
19
|
let isChevronEventAdded = false;
|
|
11
20
|
export let tagFormMode = "NONE" /* FORM_MODE.NONE */;
|
|
12
21
|
export let selectedTag = undefined;
|
|
22
|
+
export let originalTagBackup = null;
|
|
13
23
|
export function renderTagFormPane() {
|
|
14
24
|
const element = document.createElement('div');
|
|
15
25
|
element.classList.add('at_container');
|
|
@@ -92,15 +102,12 @@ export function initFormData(tagId) {
|
|
|
92
102
|
const targetTag = _tags.find(tag => tag.json_data.id === tagId);
|
|
93
103
|
console.log("targetTag", targetTag);
|
|
94
104
|
selectedTag = targetTag;
|
|
105
|
+
// keep a deep copy of original tag data so we can revert on cancel
|
|
106
|
+
originalTagBackup = targetTag ? JSON.parse(JSON.stringify(targetTag.json_data)) : null;
|
|
95
107
|
if (targetTag) {
|
|
96
108
|
if (!tagNameInput) {
|
|
97
109
|
setInputElements();
|
|
98
110
|
}
|
|
99
|
-
const tagCategory = _tagCategories.find((category) => {
|
|
100
|
-
const tagCategory = category.subcategories.find(subcategory => subcategory.uuid === targetTag.category_uuid);
|
|
101
|
-
return tagCategory;
|
|
102
|
-
});
|
|
103
|
-
console.log('tagCategoryId', tagCategory, tagCategory.uuid);
|
|
104
111
|
tagNameInput.value = targetTag.json_data.label;
|
|
105
112
|
tagDescriptionInput.value = targetTag.json_data.description;
|
|
106
113
|
tagEmbedInput.value = targetTag.media_url && targetTag.media_url !== '' ? targetTag.media_url : '';
|
|
@@ -130,6 +137,8 @@ export function initFormData(tagId) {
|
|
|
130
137
|
tagNameInput.value = '';
|
|
131
138
|
tagDescriptionInput.value = '';
|
|
132
139
|
tagEmbedInput.value = '';
|
|
140
|
+
// clear any previous edit backup when entering add mode
|
|
141
|
+
originalTagBackup = null;
|
|
133
142
|
}
|
|
134
143
|
const categoryChevron = document.getElementById('at-category-dropdown');
|
|
135
144
|
const subcategoryChevron = document.getElementById('at-subcategory-dropdown');
|
|
@@ -260,109 +269,120 @@ export function clearInnerHTML(elementId) {
|
|
|
260
269
|
targetElement.innerHTML = ``;
|
|
261
270
|
}
|
|
262
271
|
function selectOption(option, elementId, skipToggle = false) {
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
const dropdownToggle = document.getElementById(elementId);
|
|
270
|
-
//dropdownToggle.textContent = option.textContent;
|
|
271
|
-
dropdownToggle.innerHTML = option.innerHTML;
|
|
272
|
-
//selectedText = option.textContent;
|
|
273
|
-
const isFilterDropdown = stringContains(elementId, 'filter');
|
|
274
|
-
const categoryUUID = option.getAttribute('category-uuid');
|
|
275
|
-
const categoryType = option.getAttribute('dropdown-type');
|
|
276
|
-
console.log("categoryUUID ", categoryUUID);
|
|
277
|
-
console.log("categoryType ", categoryType);
|
|
278
|
-
if (categoryUUID && categoryUUID !== null) {
|
|
279
|
-
if (categoryType == 'category' && isFilterDropdown == false) {
|
|
280
|
-
selectedCategoryId = categoryUUID;
|
|
281
|
-
}
|
|
282
|
-
else if (categoryType == 'category' && isFilterDropdown) {
|
|
283
|
-
setSelectedCategoryFilter(categoryUUID);
|
|
284
|
-
setSelectedSubcategoryFilter(undefined); //reset selected subcategory
|
|
285
|
-
const tags = getMpTags();
|
|
286
|
-
const filteredTags = filterTagList(tags);
|
|
287
|
-
const sortedTags = sortTags(filteredTags, { by: 'label', order: 'asc' });
|
|
288
|
-
renderTags(sortedTags);
|
|
289
|
-
}
|
|
290
|
-
else if (categoryType == 'subcategory' && isFilterDropdown == false) {
|
|
291
|
-
selectedSubCategoryId = categoryUUID;
|
|
292
|
-
}
|
|
293
|
-
else if (categoryType == 'subcategory' && isFilterDropdown) {
|
|
294
|
-
setSelectedSubcategoryFilter(categoryUUID);
|
|
295
|
-
const tags = getMpTags();
|
|
296
|
-
const filteredTags = filterTagList(tags);
|
|
297
|
-
const sortedTags = sortTags(filteredTags, { by: 'label', order: 'asc' });
|
|
298
|
-
renderTags(filteredTags);
|
|
299
|
-
}
|
|
300
|
-
//Populate subcategory dropdown
|
|
301
|
-
const targetCategory = _tagCategories.find(cat => cat.uuid === categoryUUID);
|
|
302
|
-
if (targetCategory && targetCategory.subcategories && targetCategory.subcategories.length > 0) {
|
|
303
|
-
console.log("Subcategories found", targetCategory.subcategories);
|
|
304
|
-
renderSubcategoryDropdownOptions(isFilterDropdown ? 'at-subcategory-filter-options' : 'at-subcategory-options', targetCategory.subcategories);
|
|
272
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
273
|
+
console.log("selectOption()");
|
|
274
|
+
//const dropdownToggle = document.querySelector('.at_dropdown_toggle');
|
|
275
|
+
if (!elementId || elementId === '' || elementId == null) {
|
|
276
|
+
console.error("ElementId is empty or undefined");
|
|
277
|
+
return;
|
|
305
278
|
}
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
279
|
+
const dropdownToggle = document.getElementById(elementId);
|
|
280
|
+
//dropdownToggle.textContent = option.textContent;
|
|
281
|
+
dropdownToggle.innerHTML = option.innerHTML;
|
|
282
|
+
//selectedText = option.textContent;
|
|
283
|
+
const isFilterDropdown = stringContains(elementId, 'filter');
|
|
284
|
+
const categoryUUID = option.getAttribute('category-uuid');
|
|
285
|
+
const categoryType = option.getAttribute('dropdown-type');
|
|
286
|
+
console.log("categoryUUID ", categoryUUID);
|
|
287
|
+
console.log("categoryType ", categoryType);
|
|
288
|
+
if (categoryUUID && categoryUUID !== null) {
|
|
289
|
+
if (categoryType == 'category' && isFilterDropdown == false) {
|
|
290
|
+
selectedCategoryId = categoryUUID;
|
|
291
|
+
}
|
|
292
|
+
else if (categoryType == 'category' && isFilterDropdown) {
|
|
293
|
+
setSelectedCategoryFilter(categoryUUID);
|
|
294
|
+
setSelectedSubcategoryFilter(undefined); //reset selected subcategory
|
|
295
|
+
const tags = getMpTags();
|
|
296
|
+
const filteredTags = filterTagList(tags);
|
|
297
|
+
const sortedTags = sortTags(filteredTags, { by: 'label', order: 'asc' });
|
|
298
|
+
renderTags(sortedTags);
|
|
299
|
+
}
|
|
300
|
+
else if (categoryType == 'subcategory' && isFilterDropdown == false) {
|
|
301
|
+
selectedSubCategoryId = categoryUUID;
|
|
302
|
+
// updates the tag icon color
|
|
303
|
+
const targetCategory = _tagCategories.find(cat => cat.uuid === selectedCategoryId);
|
|
304
|
+
if (targetCategory && selectedTag != undefined) {
|
|
305
|
+
yield editTagColor({ tagId: selectedTag.json_data.id, color: targetCategory.json_data.color.rgb });
|
|
306
|
+
_atwin.Tag.editPosition(selectedTag.json_data.id, {
|
|
307
|
+
anchorPosition: selectedTag.json_data.anchorPosition,
|
|
308
|
+
stemVector: Object.assign({}, selectedTag.json_data.stemVector),
|
|
309
|
+
});
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
else if (categoryType == 'subcategory' && isFilterDropdown) {
|
|
313
|
+
setSelectedSubcategoryFilter(categoryUUID);
|
|
314
|
+
const tags = getMpTags();
|
|
315
|
+
const filteredTags = filterTagList(tags);
|
|
316
|
+
const sortedTags = sortTags(filteredTags, { by: 'label', order: 'asc' });
|
|
317
|
+
renderTags(filteredTags);
|
|
318
|
+
}
|
|
319
|
+
//Populate subcategory dropdown
|
|
320
|
+
const targetCategory = _tagCategories.find(cat => cat.uuid === categoryUUID);
|
|
321
|
+
if (targetCategory && targetCategory.subcategories && targetCategory.subcategories.length > 0) {
|
|
322
|
+
console.log("Subcategories found", targetCategory.subcategories);
|
|
323
|
+
renderSubcategoryDropdownOptions(isFilterDropdown ? 'at-subcategory-filter-options' : 'at-subcategory-options', targetCategory.subcategories);
|
|
324
|
+
}
|
|
325
|
+
else {
|
|
326
|
+
if (categoryType == 'category') {
|
|
327
|
+
const elementId = isFilterDropdown ? 'at-subcategory-filter-options' : 'at-subcategory-options';
|
|
328
|
+
const subcatToggleId = isFilterDropdown ? 'at-subcategory-filter-dropdown-toggle' : 'at-subcategory-dropdown-toggle';
|
|
329
|
+
const subcategoryToggle = document.getElementById(elementId);
|
|
330
|
+
const subcatDropdownToggle = document.getElementById(subcatToggleId);
|
|
331
|
+
subcategoryToggle.innerHTML = `
|
|
313
332
|
<span class="mdi mdi-circle-slice-1"></span> ${i18n.t('NoSelection')}
|
|
314
333
|
`;
|
|
315
|
-
|
|
334
|
+
subcatDropdownToggle.innerHTML = `
|
|
316
335
|
<span class="mdi mdi-circle-slice-1"></span> ${i18n.t('NoSelection')}
|
|
317
336
|
`;
|
|
337
|
+
}
|
|
318
338
|
}
|
|
319
339
|
}
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
subcategoryToggle.innerHTML = `
|
|
340
|
+
else {
|
|
341
|
+
console.log("categoryUUID is undefined");
|
|
342
|
+
if (categoryType == 'category' && isFilterDropdown) {
|
|
343
|
+
console.log("Clearing subcategory filter");
|
|
344
|
+
const subcategoryToggle = document.getElementById('at-subcategory-filter-dropdown-toggle');
|
|
345
|
+
subcategoryToggle.textContent = `${i18n.t('NoSelection')}`;
|
|
346
|
+
subcategoryToggle.innerHTML = `
|
|
328
347
|
<span class="mdi mdi-circle-slice-1"></span> ${i18n.t('NoSelection')}
|
|
329
348
|
`;
|
|
330
|
-
|
|
349
|
+
setSelectedCategoryFilter(undefined);
|
|
350
|
+
}
|
|
351
|
+
if (isFilterDropdown) {
|
|
352
|
+
setSelectedSubcategoryFilter(undefined); //reset selected subcategory
|
|
353
|
+
}
|
|
354
|
+
//Populate subcategory dropdown
|
|
355
|
+
const targetCategory = _tagCategories.find(cat => cat.uuid === selectedCategoryFilterId);
|
|
356
|
+
if (targetCategory && targetCategory.subcategories && targetCategory.subcategories.length > 0) {
|
|
357
|
+
console.log("Subcategories found", targetCategory.subcategories);
|
|
358
|
+
renderSubcategoryDropdownOptions(isFilterDropdown ? 'at-subcategory-filter-options' : 'at-subcategory-options', targetCategory.subcategories);
|
|
359
|
+
}
|
|
360
|
+
else {
|
|
361
|
+
const elementId = isFilterDropdown ? 'at-subcategory-filter-options' : 'at-subcategory-options';
|
|
362
|
+
clearInnerHTML(elementId);
|
|
363
|
+
}
|
|
364
|
+
let tags = getMpTags().filter(tag => !tag.tag_type || tag.tag_type !== TAG_TYPE.IOT);
|
|
365
|
+
const filteredTags = filterTagList(tags);
|
|
366
|
+
const sortedTags = sortTags(filteredTags ? filteredTags : tags, selectedTagSortOption);
|
|
367
|
+
renderTags(sortedTags);
|
|
331
368
|
}
|
|
332
|
-
|
|
333
|
-
|
|
369
|
+
let toggleId = '';
|
|
370
|
+
if (elementId === 'at-category-dropdown-toggle') {
|
|
371
|
+
toggleId = 'at-category-options';
|
|
334
372
|
}
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
if (targetCategory && targetCategory.subcategories && targetCategory.subcategories.length > 0) {
|
|
338
|
-
console.log("Subcategories found", targetCategory.subcategories);
|
|
339
|
-
renderSubcategoryDropdownOptions(isFilterDropdown ? 'at-subcategory-filter-options' : 'at-subcategory-options', targetCategory.subcategories);
|
|
373
|
+
else if (elementId === 'at-subcategory-dropdown-toggle') {
|
|
374
|
+
toggleId = 'at-subcategory-options';
|
|
340
375
|
}
|
|
341
|
-
else {
|
|
342
|
-
|
|
343
|
-
clearInnerHTML(elementId);
|
|
376
|
+
else if (elementId === 'at-category-filter-dropdown-toggle') {
|
|
377
|
+
toggleId = 'at-category-filter-options';
|
|
344
378
|
}
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
toggleId = 'at-category-options';
|
|
353
|
-
}
|
|
354
|
-
else if (elementId === 'at-subcategory-dropdown-toggle') {
|
|
355
|
-
toggleId = 'at-subcategory-options';
|
|
356
|
-
}
|
|
357
|
-
else if (elementId === 'at-category-filter-dropdown-toggle') {
|
|
358
|
-
toggleId = 'at-category-filter-options';
|
|
359
|
-
}
|
|
360
|
-
else if (elementId === 'at-subcategory-filter-dropdown-toggle') {
|
|
361
|
-
toggleId = 'at-subcategory-filter-options';
|
|
362
|
-
}
|
|
363
|
-
if (skipToggle == false) {
|
|
364
|
-
toggleDropdown(toggleId);
|
|
365
|
-
}
|
|
379
|
+
else if (elementId === 'at-subcategory-filter-dropdown-toggle') {
|
|
380
|
+
toggleId = 'at-subcategory-filter-options';
|
|
381
|
+
}
|
|
382
|
+
if (skipToggle == false) {
|
|
383
|
+
toggleDropdown(toggleId);
|
|
384
|
+
}
|
|
385
|
+
});
|
|
366
386
|
}
|
|
367
387
|
function createOptionElement(item, dropdownType) {
|
|
368
388
|
console.log("createOptionElement");
|
|
@@ -538,3 +558,9 @@ export function clearTagFilterDropdown() {
|
|
|
538
558
|
export function setTagFormMode(formMode) {
|
|
539
559
|
tagFormMode = formMode;
|
|
540
560
|
}
|
|
561
|
+
export function clearSelectedTag() {
|
|
562
|
+
selectedTag = undefined;
|
|
563
|
+
}
|
|
564
|
+
export function setSelectedTag(tag) {
|
|
565
|
+
selectedTag = tag;
|
|
566
|
+
}
|
|
@@ -59,7 +59,7 @@ export function renderTagListPane() {
|
|
|
59
59
|
<span id="at-tag-list-title">${i18n.t('Tags')}</span>
|
|
60
60
|
</div>
|
|
61
61
|
<div class="at_form_container at_h-min-65 at_tag_list_pane">
|
|
62
|
-
<div class="at_button_row at_justify_end
|
|
62
|
+
<div class="at_button_row at_justify_end">
|
|
63
63
|
<div class="at_button at_ghost">
|
|
64
64
|
<span class="mdi mdi-sort at_icon_hover" id="at-tag-sort-icon" data-cy="at-tag-sort-btn" >
|
|
65
65
|
<span id="at-tag-sort-options-tooltip" class="at_custom_tooltip">
|
|
@@ -70,14 +70,14 @@ export function renderTagListPane() {
|
|
|
70
70
|
</span>
|
|
71
71
|
</span>
|
|
72
72
|
</div>
|
|
73
|
-
<div class="at_button at_ghost" id="at-visibility-tag-btn" data-cy="at-visibility-tag-btn"
|
|
73
|
+
<div class="at_button at_ghost ${_mpConfig.restrictionConfig.isTagReadOnly ? 'at_hidden' : ''}" id="at-visibility-tag-btn" data-cy="at-visibility-tag-btn">
|
|
74
74
|
<span class="mdi mdi-eye at_icon_hover" id="at-visibility-tag-btn">
|
|
75
75
|
<span class="at_custom_tooltip">
|
|
76
76
|
<p class="at_tag_sort_option">${i18n.t('HideAll')}</p>
|
|
77
77
|
</span>
|
|
78
78
|
</span>
|
|
79
79
|
</div>
|
|
80
|
-
<div class="at_button at_ghost" id="at-add-tag-btn" data-cy="at-add-tag-btn" target-pane="at-tag-form-pane">
|
|
80
|
+
<div class="at_button at_ghost ${_mpConfig.restrictionConfig.isTagReadOnly ? 'at_hidden' : ''}" id="at-add-tag-btn" data-cy="at-add-tag-btn" target-pane="at-tag-form-pane">
|
|
81
81
|
${i18n.t('AddTag')}
|
|
82
82
|
<span class="mdi mdi-plus-circle-outline" id="at-add-tag-btn"></span>
|
|
83
83
|
</div>
|
|
@@ -174,8 +174,6 @@ export function renderTags(tags, showOwnTagsOnly = false) {
|
|
|
174
174
|
console.log("renderTags", tags);
|
|
175
175
|
iotTags = tags;
|
|
176
176
|
const tagContainer = document.getElementById('at-tag-list-container');
|
|
177
|
-
// get value from mp config
|
|
178
|
-
const isReadOnly = _mpConfig.restrictionConfig.isTagReadOnly;
|
|
179
177
|
if (!tagContainer) {
|
|
180
178
|
console.error("Tag container does not exist in DOM");
|
|
181
179
|
return;
|
|
@@ -192,12 +190,10 @@ export function renderTags(tags, showOwnTagsOnly = false) {
|
|
|
192
190
|
tags.forEach(tag => {
|
|
193
191
|
console.log('@caroline render tag checking: ', tag);
|
|
194
192
|
if (showOwnTagsOnly) {
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
visibilityTagButton.classList.remove('at_disabled');
|
|
200
|
-
}
|
|
193
|
+
const row = renderTagRow(tag.json_data, tag.tag_icon_url, tag.tag_type);
|
|
194
|
+
tagContainer.appendChild(row);
|
|
195
|
+
addTagButton.classList.remove('at_disabled');
|
|
196
|
+
visibilityTagButton.classList.remove('at_disabled');
|
|
201
197
|
}
|
|
202
198
|
else {
|
|
203
199
|
console.log('@caroline render tag checking 2: ', tag);
|
package/lib/atwinui/events.js
CHANGED
|
@@ -7,14 +7,14 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
7
7
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
8
|
});
|
|
9
9
|
};
|
|
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, toggleVisibilityTag, _tagIotCategoryTypes, getIoTDeviceTagIcons, toggleMeshChildrenVisibility, set3DXObjects, partitionHistory, _thisVertexPath, setPolygonPath, editMode,
|
|
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, originalTagBackup, 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, editTagColor, 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, setPolygonPath, editMode, importMatterPortTag,
|
|
12
12
|
// polygonHistory
|
|
13
13
|
} from "../architwin";
|
|
14
14
|
import { Notyf } from 'notyf';
|
|
15
15
|
import 'notyf/notyf.min.css';
|
|
16
16
|
import { SPACE_EVENTS, COORDINATE_SYSTEM, UNITS, DEGREE, MAP_OPTIONS, sortTagOptions, sortObjectOptions, CUSTOM_MAP_MODE, TAG_TYPE } from "../types";
|
|
17
|
-
import { initFormData, setTagFormMode } from "./components/toolbar/tagFormPane";
|
|
17
|
+
import { clearSelectedTag, initFormData, setSelectedTag, setTagFormMode } from "./components/toolbar/tagFormPane";
|
|
18
18
|
import { renderObjectList, resetSelectedObjectSortOption, selectedObjectSortOption, sortShowcaseObjects, updateSelectedObjectSortOption } from "./components/toolbar/objectListPane";
|
|
19
19
|
import { renderLibraryList } from "./components/toolbar/libraryPane";
|
|
20
20
|
import { renderObjectCard } from "./components/toolbar/card";
|
|
@@ -526,6 +526,7 @@ function setupIndividualEventListeners() {
|
|
|
526
526
|
handlePipeList();
|
|
527
527
|
handleResponsiveChanges();
|
|
528
528
|
handleToggleVisibilityTags();
|
|
529
|
+
handleImportMTagDisplay();
|
|
529
530
|
handlePreviewModalResize();
|
|
530
531
|
}
|
|
531
532
|
//================ OBJECT EVENT HANDLERS ===============//s
|
|
@@ -821,7 +822,7 @@ function handlePlaceTag() {
|
|
|
821
822
|
log.info("Last Tag Pushed", currentTag);
|
|
822
823
|
cancelTagPlacementPrompt.style.display = 'none';
|
|
823
824
|
isPlacingTag = false;
|
|
824
|
-
|
|
825
|
+
setSelectedTag(currentTag);
|
|
825
826
|
});
|
|
826
827
|
}
|
|
827
828
|
handleMobilePlaceTag(true);
|
|
@@ -987,11 +988,45 @@ function onDisposeTag() {
|
|
|
987
988
|
}
|
|
988
989
|
}
|
|
989
990
|
clearTagFormDropdown();
|
|
991
|
+
clearSelectedTag();
|
|
990
992
|
iTag = null;
|
|
991
993
|
cancelTagPlacementPrompt.style.display = 'none';
|
|
992
994
|
isPlacingTag = false;
|
|
993
995
|
return;
|
|
994
996
|
}
|
|
997
|
+
// If we are editing an existing tag and user cancels, revert to original values
|
|
998
|
+
if (tagFormMode === "EDIT" /* FORM_MODE.EDIT */ && selectedTag && originalTagBackup) {
|
|
999
|
+
try {
|
|
1000
|
+
yield editTagColor({ tagId: selectedTag.json_data.id, color: originalTagBackup.color });
|
|
1001
|
+
}
|
|
1002
|
+
catch (e) {
|
|
1003
|
+
log.error('Failed to revert tag color on cancel', e);
|
|
1004
|
+
}
|
|
1005
|
+
try {
|
|
1006
|
+
// revert position/stemVector
|
|
1007
|
+
if (_atwin && _atwin.Tag && _atwin.Tag.editPosition) {
|
|
1008
|
+
_atwin.Tag.editPosition(selectedTag.json_data.id, {
|
|
1009
|
+
anchorPosition: originalTagBackup.anchorPosition,
|
|
1010
|
+
stemVector: Object.assign({}, originalTagBackup.stemVector),
|
|
1011
|
+
});
|
|
1012
|
+
}
|
|
1013
|
+
}
|
|
1014
|
+
catch (e) {
|
|
1015
|
+
log.error('Failed to revert tag position on cancel', e);
|
|
1016
|
+
}
|
|
1017
|
+
// revert category/subcategory and other metadata in local cache
|
|
1018
|
+
const idx = _tags.findIndex(t => t.json_data.id === selectedTag.json_data.id);
|
|
1019
|
+
if (idx !== -1) {
|
|
1020
|
+
_tags[idx].json_data = Object.assign(Object.assign({}, _tags[idx].json_data), originalTagBackup);
|
|
1021
|
+
}
|
|
1022
|
+
clearTagFormDropdown();
|
|
1023
|
+
clearSelectedTag();
|
|
1024
|
+
setTagFormMode("NONE" /* FORM_MODE.NONE */);
|
|
1025
|
+
if (cancelTagPlacementPrompt)
|
|
1026
|
+
cancelTagPlacementPrompt.style.display = 'none';
|
|
1027
|
+
isPlacingTag = false;
|
|
1028
|
+
return;
|
|
1029
|
+
}
|
|
995
1030
|
cancelMoveTag();
|
|
996
1031
|
if (iTag !== null) {
|
|
997
1032
|
yield disposeTag({ tagId: iTag.id });
|
|
@@ -1048,6 +1083,7 @@ function handleSaveTag() {
|
|
|
1048
1083
|
currentTag.tag_icon_url = targetSubCat.json_data.iconUrl;
|
|
1049
1084
|
}
|
|
1050
1085
|
}
|
|
1086
|
+
yield attachTagMedia({ sdk: _atwin, tag: currentTag.json_data, attachments: [currentTag.media_url] });
|
|
1051
1087
|
let payload = { tag: currentTag };
|
|
1052
1088
|
console.log("@__ handleSaveTag payload ", payload);
|
|
1053
1089
|
dispatchSpaceEvent(SPACE_EVENTS.TAG_SAVED, payload);
|
|
@@ -1139,6 +1175,13 @@ function handleSaveTag() {
|
|
|
1139
1175
|
_tags[index].category_uuid = tagFormPayload.tagSubcategoryId;
|
|
1140
1176
|
_tags[index].json_data.color = targetCategory.json_data.color.rgb;
|
|
1141
1177
|
if (tagFormPayload.tagEmbed && tagFormPayload.tagEmbed != '') { // this condition is added when Embed URL is removed by user and is Empty #15842
|
|
1178
|
+
_tags[index].media_url = undefined;
|
|
1179
|
+
const tagDataCollection = getTagDataCollection();
|
|
1180
|
+
_tags[index].json_data.attachments = tagDataCollection[_tags[index].json_data.id] ? tagDataCollection[_tags[index].json_data.id].attachments : _tags[index].json_data.attachments;
|
|
1181
|
+
if (_tags[index].json_data.attachments) {
|
|
1182
|
+
yield detachTagMedia({ tagId: _tags[index].json_data.id, attachmentIds: _tags[index].json_data.attachments });
|
|
1183
|
+
_tags[index].json_data.attachments = [];
|
|
1184
|
+
}
|
|
1142
1185
|
if (tagFormPayload.tagEmbed !== _tags[index].media_url) {
|
|
1143
1186
|
const tagData = {
|
|
1144
1187
|
id: _tags[index].json_data.id,
|
|
@@ -1215,6 +1258,7 @@ function handleSaveTag() {
|
|
|
1215
1258
|
}
|
|
1216
1259
|
}
|
|
1217
1260
|
clearTagFormDropdown();
|
|
1261
|
+
clearSelectedTag();
|
|
1218
1262
|
iTag = null;
|
|
1219
1263
|
saveTagBtn.classList.remove('at_disabled');
|
|
1220
1264
|
setTagFormMode("NONE" /* FORM_MODE.NONE */);
|
|
@@ -1571,6 +1615,7 @@ function setupSpaceEventSubscriptions() {
|
|
|
1571
1615
|
subscribeSpaceEvent(SPACE_EVENTS.SCREEN_SHARE_HOST_END_SESSION, handleScreenShareEndSessionEvent);
|
|
1572
1616
|
subscribeSpaceEvent(SPACE_EVENTS.SCREEN_SHARE_ACCEPT_REQUEST, handleScreenShareAcceptRequest);
|
|
1573
1617
|
subscribeSpaceEvent(SPACE_EVENTS.SCREEN_SHARE_BACK_USER_LIST_PANE, handleScreenShareBackUserListPane);
|
|
1618
|
+
subscribeSpaceEvent(SPACE_EVENTS.PROCEED_IMPORT_MTAGS, handleImportMTag);
|
|
1574
1619
|
}
|
|
1575
1620
|
function handleVertexDragEnd(payload) {
|
|
1576
1621
|
log.info("handleVertexDragEnd()", payload);
|
|
@@ -4096,6 +4141,22 @@ function handleVisiblePartitions(mpSdk) {
|
|
|
4096
4141
|
});
|
|
4097
4142
|
}));
|
|
4098
4143
|
}
|
|
4144
|
+
function handleImportMTagDisplay() {
|
|
4145
|
+
log.info('handleImportMTagDisplay');
|
|
4146
|
+
const importMTagBtn = document.getElementById('at-import-mattertag-btn');
|
|
4147
|
+
if (importMTagBtn) {
|
|
4148
|
+
importMTagBtn.addEventListener('click', () => __awaiter(this, void 0, void 0, function* () {
|
|
4149
|
+
log.info('@caroline MTagButton is clicked');
|
|
4150
|
+
yield dispatchSpaceEvent(SPACE_EVENTS.IMPORT_MTAGS, {
|
|
4151
|
+
payload: true
|
|
4152
|
+
});
|
|
4153
|
+
}));
|
|
4154
|
+
}
|
|
4155
|
+
}
|
|
4156
|
+
function handleImportMTag() {
|
|
4157
|
+
log.info("handleImportMTag()");
|
|
4158
|
+
importMatterPortTag();
|
|
4159
|
+
}
|
|
4099
4160
|
export {
|
|
4100
4161
|
//state
|
|
4101
4162
|
activeToolbarItem, activeActionItem, cancelModelPlacementPrompt, isCustomMapControlsVisible, pipeColor,
|
package/lib/graphql.d.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { IMattertagsResponse } from "./types";
|
|
2
|
+
/**
|
|
3
|
+
* Sends a GraphQL query to the Matterport API to retrieve all mattertags and their associated data for a given model ID and application key.
|
|
4
|
+
* @param modelId - Id of the model space
|
|
5
|
+
* @param appKey - Matterport app key
|
|
6
|
+
* @returns
|
|
7
|
+
*/
|
|
8
|
+
export declare function getTagAndTagData(modelId: string, appKey: string): Promise<IMattertagsResponse>;
|