architwin 1.17.4 → 1.18.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/architwin.d.ts +3 -2
- package/lib/architwin.js +1 -1
- package/lib/atwinui/components/toolbar/card.d.ts +1 -1
- package/lib/atwinui/components/toolbar/card.js +11 -7
- package/lib/atwinui/components/toolbar/libraryPane.js +1 -0
- package/lib/atwinui/components/toolbar/tagFormPane.js +2 -2
- package/lib/atwinui/events.js +16 -4
- package/lib/loaders/polydrawerLoader.js +1 -1
- package/lib/types.d.ts +1 -0
- package/package.json +1 -1
|
@@ -3,7 +3,7 @@ import { I3DObject } from "../../../types";
|
|
|
3
3
|
import { Scene } from "../../../../bundle/sdk";
|
|
4
4
|
export declare function renderObjectCard(payload: IShowcaseObject, objectComponent?: Scene.IComponent): HTMLDivElement;
|
|
5
5
|
export declare function renderObjectRow(payload: IShowcaseObject, objectComponent?: Scene.IComponent): HTMLDivElement;
|
|
6
|
-
export declare function setActiveCard(cardId: string): Promise<void>;
|
|
6
|
+
export declare function setActiveCard(cardId: string, moveToObject?: boolean): Promise<void>;
|
|
7
7
|
export declare function clearActiveCard(): void;
|
|
8
8
|
export declare function renderLibraryCard(payload: I3DObject): HTMLDivElement;
|
|
9
9
|
export declare function renderLibraryRow(payload: I3DObject): HTMLDivElement;
|
|
@@ -17,6 +17,7 @@ import i18n from './i18n';
|
|
|
17
17
|
import { getBasepoint, getCoordinateSystem, getMeasurementUnit, getMPBasepoint, getScaleFactor } from "./actionSettingsPane";
|
|
18
18
|
import { convertYupScaleToZupScale } from "../../../worldConversion";
|
|
19
19
|
import { toggleActionBarButtons } from "../../components/toolbar";
|
|
20
|
+
import log from "loglevel";
|
|
20
21
|
let activeCard, activeLibraryCard;
|
|
21
22
|
let _basePath = '../../../../architwin/static';
|
|
22
23
|
export function renderObjectCard(payload, objectComponent) {
|
|
@@ -31,6 +32,7 @@ export function renderObjectCard(payload, objectComponent) {
|
|
|
31
32
|
element.classList.add('at_mx-w-16');
|
|
32
33
|
element.setAttribute('id', `at-card-${payload.id}`);
|
|
33
34
|
element.setAttribute('data-cy', `at-card-${payload.id}`);
|
|
35
|
+
element.setAttribute('card-id', `${payload.id}`);
|
|
34
36
|
let object_data = {};
|
|
35
37
|
object_data = payload.object_data;
|
|
36
38
|
if (object_data.upload_file != null) {
|
|
@@ -55,7 +57,7 @@ export function renderObjectCard(payload, objectComponent) {
|
|
|
55
57
|
}
|
|
56
58
|
element.innerHTML = `
|
|
57
59
|
<img class="at_image at_object_image" src="${thumbnail}" alt="Property Image" id="at-card-image-${payload.id}" data-cy="at-card-image-${payload.id}" card-id="${payload.id}" style="min-width: 100%;">
|
|
58
|
-
<div class="at_card-body" id="at-
|
|
60
|
+
<div class="at_card-body" id="at-card-body-${payload.id}" card-id="${payload.id}">
|
|
59
61
|
${payload.object_data.name ?
|
|
60
62
|
`<div class="at_card-title">
|
|
61
63
|
<h2 class="at_title" id="at-card-title-${payload.id}" card-id="${payload.id}" data-cy="at-card-title-${payload.id}">${payload.object_data.name}</h2>
|
|
@@ -91,6 +93,7 @@ export function renderObjectRow(payload, objectComponent) {
|
|
|
91
93
|
element.classList.add('at_card');
|
|
92
94
|
element.classList.add('at_mx-w-16');
|
|
93
95
|
element.setAttribute('id', `at-card-${payload.id}`);
|
|
96
|
+
element.setAttribute('card-id', `${payload.id}`);
|
|
94
97
|
let object_data = {};
|
|
95
98
|
object_data = payload.object_data;
|
|
96
99
|
let isObjectVisible = true;
|
|
@@ -101,7 +104,7 @@ export function renderObjectRow(payload, objectComponent) {
|
|
|
101
104
|
console.log("isObjectVisible: ", isObjectVisible);
|
|
102
105
|
}
|
|
103
106
|
element.innerHTML = `
|
|
104
|
-
<div class="at_card-body" id="at-card-
|
|
107
|
+
<div class="at_card-body" id="at-card-body-${payload.id}" card-id="${payload.id}">
|
|
105
108
|
${payload.object_data.name ?
|
|
106
109
|
`<div class="at_card-title" card-id="${payload.id}">
|
|
107
110
|
<h2 class="at_list_title" id="at-card-row-title-${payload.id}" card-id="${payload.id}" data-cy="at-card-title-${payload.id}">${payload.object_data.name}</h2>
|
|
@@ -126,7 +129,7 @@ export function renderObjectRow(payload, objectComponent) {
|
|
|
126
129
|
`;
|
|
127
130
|
return element;
|
|
128
131
|
}
|
|
129
|
-
export function setActiveCard(cardId) {
|
|
132
|
+
export function setActiveCard(cardId, moveToObject = true) {
|
|
130
133
|
return __awaiter(this, void 0, void 0, function* () {
|
|
131
134
|
const target = document.getElementById(cardId);
|
|
132
135
|
console.log("Card id", cardId);
|
|
@@ -152,7 +155,7 @@ export function setActiveCard(cardId) {
|
|
|
152
155
|
}
|
|
153
156
|
// await goTo3dx(Number.parseInt(objId))
|
|
154
157
|
const viewMode = getViewMode();
|
|
155
|
-
if (viewMode && viewMode != "mode.floorplan") {
|
|
158
|
+
if (viewMode && viewMode != "mode.floorplan" && moveToObject) {
|
|
156
159
|
yield goToModel(Number.parseInt(objId));
|
|
157
160
|
}
|
|
158
161
|
const parent = target.parentElement;
|
|
@@ -219,13 +222,13 @@ export function renderLibraryRow(payload) {
|
|
|
219
222
|
let thumbnail;
|
|
220
223
|
const element = document.createElement('div');
|
|
221
224
|
element.classList.add('at_card');
|
|
222
|
-
element.classList.add('at_mx-w-
|
|
225
|
+
element.classList.add('at_mx-w-16');
|
|
223
226
|
//element.setAttribute('id','some-id')
|
|
224
227
|
element.innerHTML = `
|
|
225
228
|
<div class="at_card-body at_library_card_body" card-id="${payload.id}">
|
|
226
229
|
${payload.name ?
|
|
227
|
-
`<div class="at_card-title at_library_card_title" id="at-library-card-title-${payload.id}"
|
|
228
|
-
<h2 class="at_title" id="at-card-title-${payload.id}" data-cy="at-card-title-${payload.id}">${payload.name}.${payload.object_type}</h2>
|
|
230
|
+
`<div class="at_card-title at_library_card_title" id="at-library-card-title-${payload.id}">
|
|
231
|
+
<h2 class="at_title" id="at-card-title-${payload.id}" data-cy="at-card-title-${payload.id}" card-id="${payload.id}">${payload.name}.${payload.object_type}</h2>
|
|
229
232
|
</div>` :
|
|
230
233
|
``}
|
|
231
234
|
</div>
|
|
@@ -244,6 +247,7 @@ export function setActiveLibraryCard(cardId) {
|
|
|
244
247
|
activeLibraryCard.classList.remove('at_card_active');
|
|
245
248
|
}
|
|
246
249
|
const objId = target.getAttribute('card-id');
|
|
250
|
+
log.info("@@ objId", objId, target);
|
|
247
251
|
let targetId;
|
|
248
252
|
if (/[a-z]/.test(objId) || /[A-Z]/.test(objId)) {
|
|
249
253
|
targetId = objId;
|
|
@@ -55,6 +55,7 @@ export function renderLibraryCards(cardList) {
|
|
|
55
55
|
console.log("renderLibraryCards()");
|
|
56
56
|
libraryCardContainer = document.getElementById('at-library-cards');
|
|
57
57
|
if (cardList && cardList.length > 0) {
|
|
58
|
+
libraryCardContainer.classList.add('at_flex_tiles');
|
|
58
59
|
console.log("Card numbers", cardList.length);
|
|
59
60
|
libraryCardContainer.innerHTML = ``;
|
|
60
61
|
cardList.forEach(list => {
|
|
@@ -102,7 +102,7 @@ export function initFormData(tagId) {
|
|
|
102
102
|
});
|
|
103
103
|
console.log('tagCategoryId', tagCategory, tagCategory.uuid);
|
|
104
104
|
tagNameInput.value = targetTag.json_data.label;
|
|
105
|
-
tagDescriptionInput.value = targetTag.json_data.description;
|
|
105
|
+
tagDescriptionInput.value = targetTag.json_data.description.split('\n')[0];
|
|
106
106
|
tagEmbedInput.value = targetTag.media_url && targetTag.media_url !== '' ? targetTag.media_url : '';
|
|
107
107
|
const subcategories = getAllSubcategories();
|
|
108
108
|
const selectectedSubcategory = subcategories.find(sub => sub.uuid === targetTag.category_uuid);
|
|
@@ -168,7 +168,7 @@ export function getTagFormData() {
|
|
|
168
168
|
}
|
|
169
169
|
if (tagNameInput) {
|
|
170
170
|
const tagName = tagNameInput.value;
|
|
171
|
-
const tagDescription = tagDescriptionInput.value;
|
|
171
|
+
const tagDescription = tagDescriptionInput.value.split('\n')[0];
|
|
172
172
|
const tagEmbed = tagEmbedInput.value;
|
|
173
173
|
const formData = {
|
|
174
174
|
tagName: tagName,
|
package/lib/atwinui/events.js
CHANGED
|
@@ -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, toggleVisibilityTag, _tagIotCategoryTypes, getIoTDeviceTagIcons, toggleMeshChildrenVisibility, set3DXObjects, partitionHistory, _thisVertexPath, setPolygonPath,
|
|
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,
|
|
12
12
|
// polygonHistory
|
|
13
13
|
} from "../architwin";
|
|
14
14
|
import { Notyf } from 'notyf';
|
|
@@ -1654,7 +1654,8 @@ function handleVertexPlace(payload) {
|
|
|
1654
1654
|
}
|
|
1655
1655
|
toggleUndoRedoButtons(partitionHistory.canUndo(), partitionHistory.canRedo());
|
|
1656
1656
|
}
|
|
1657
|
-
|
|
1657
|
+
// add editmode condiition to prevent error of pipe form when vertex initialized without editmode and pipe feature enabled
|
|
1658
|
+
if (editMode && isToolbarFeatureEnabled('pipe')) {
|
|
1658
1659
|
pipeForm.setPipeVertices(payload.path);
|
|
1659
1660
|
}
|
|
1660
1661
|
}
|
|
@@ -1720,7 +1721,7 @@ function handleMouseClickObject(object) {
|
|
|
1720
1721
|
}
|
|
1721
1722
|
toggleActionBar('show');
|
|
1722
1723
|
toggleModelControl(false);
|
|
1723
|
-
setActiveCard(`at-card-
|
|
1724
|
+
setActiveCard(`at-card-body-${objectId}`);
|
|
1724
1725
|
handleScrollToView('at-object-cards', `at-card-${objectId}`);
|
|
1725
1726
|
// clearActiveActionBtn()
|
|
1726
1727
|
//setActiveActionBtn('at-translate-action-btn')
|
|
@@ -1756,6 +1757,10 @@ function handleSetModelsView() {
|
|
|
1756
1757
|
const objectComponents = _3DXObjects.map(obj => obj.component);
|
|
1757
1758
|
const sortedObjects = sortShowcaseObjects(spaceObjects, selectedObjectSortOption);
|
|
1758
1759
|
renderObjectCards(sortedObjects, objectComponents);
|
|
1760
|
+
log.info("selectedObject", selectedObject);
|
|
1761
|
+
if (selectedObject) {
|
|
1762
|
+
setActiveCard(`at-card-body-${selectedObject.object.id}`, false);
|
|
1763
|
+
}
|
|
1759
1764
|
});
|
|
1760
1765
|
modelsListViewBtn.addEventListener('click', () => {
|
|
1761
1766
|
modelsListViewBtn.classList.add('at_ghost_active');
|
|
@@ -1766,11 +1771,15 @@ function handleSetModelsView() {
|
|
|
1766
1771
|
const objectComponents = _3DXObjects.map(obj => obj.component);
|
|
1767
1772
|
const sortedObjects = sortShowcaseObjects(spaceObjects, selectedObjectSortOption);
|
|
1768
1773
|
renderObjectList(sortedObjects, objectComponents);
|
|
1774
|
+
if (selectedObject) {
|
|
1775
|
+
setActiveCard(`at-card-body-${selectedObject.object.id}`, false);
|
|
1776
|
+
}
|
|
1769
1777
|
});
|
|
1770
1778
|
}
|
|
1771
1779
|
function handleSetLibraryModelsView() {
|
|
1772
1780
|
const libraryModelsCardViewBtn = document.getElementById('at-library-models-card-view-btn');
|
|
1773
1781
|
const libraryModelsListViewBtn = document.getElementById('at-library-models-list-view-btn');
|
|
1782
|
+
const libraryCards = document.getElementById('at-library-cards');
|
|
1774
1783
|
if (!libraryModelsCardViewBtn) {
|
|
1775
1784
|
return;
|
|
1776
1785
|
}
|
|
@@ -1780,6 +1789,7 @@ function handleSetLibraryModelsView() {
|
|
|
1780
1789
|
libraryModelsCardViewBtn.addEventListener('click', () => __awaiter(this, void 0, void 0, function* () {
|
|
1781
1790
|
libraryModelsCardViewBtn.classList.add('at_ghost_active');
|
|
1782
1791
|
libraryModelsListViewBtn.classList.remove('at_ghost_active');
|
|
1792
|
+
libraryCards.classList.add('at_flex_tiles');
|
|
1783
1793
|
modelsView = 'card';
|
|
1784
1794
|
log.info("libraryModelsCardViewBtn", modelsView);
|
|
1785
1795
|
const checkAssetLibrary = yield getLibrary();
|
|
@@ -1796,6 +1806,7 @@ function handleSetLibraryModelsView() {
|
|
|
1796
1806
|
libraryModelsListViewBtn.addEventListener('click', () => __awaiter(this, void 0, void 0, function* () {
|
|
1797
1807
|
libraryModelsListViewBtn.classList.add('at_ghost_active');
|
|
1798
1808
|
libraryModelsCardViewBtn.classList.remove('at_ghost_active');
|
|
1809
|
+
libraryCards.classList.remove('at_flex_tiles');
|
|
1799
1810
|
modelsView = 'list';
|
|
1800
1811
|
log.info("libraryModelsListViewBtn", modelsView);
|
|
1801
1812
|
const checkAssetLibrary = yield getLibrary();
|
|
@@ -2610,7 +2621,8 @@ function handleMarkFloor() {
|
|
|
2610
2621
|
message: `${i18n.t('WarnLowFloor')}`
|
|
2611
2622
|
});
|
|
2612
2623
|
}
|
|
2613
|
-
|
|
2624
|
+
//old condition Math.sign(coord.y) == 1 || coord.y > -0.9
|
|
2625
|
+
if (Math.sign(coord.y) == 1 || coord.y > -100) {
|
|
2614
2626
|
setFloorBaseHeight(coord.y);
|
|
2615
2627
|
const adjustedHeight = getFloorBaseHeight();
|
|
2616
2628
|
if (currentRoomData) {
|
package/lib/types.d.ts
CHANGED