architwin 1.17.3 → 1.18.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/lib/architwin.d.ts +14 -2
- package/lib/architwin.js +1 -1
- package/lib/atwinui/components/toolbar/card.js +5 -3
- package/lib/atwinui/components/toolbar/libraryPane.js +1 -0
- package/lib/atwinui/components/toolbar/tagFormPane.js +2 -2
- package/lib/atwinui/events.d.ts +3 -1
- package/lib/atwinui/events.js +47 -3
- package/lib/loaders/polydrawerLoader.js +1 -1
- package/lib/types.d.ts +1 -0
- package/package.json +1 -1
|
@@ -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) {
|
|
@@ -219,13 +220,13 @@ export function renderLibraryRow(payload) {
|
|
|
219
220
|
let thumbnail;
|
|
220
221
|
const element = document.createElement('div');
|
|
221
222
|
element.classList.add('at_card');
|
|
222
|
-
element.classList.add('at_mx-w-
|
|
223
|
+
element.classList.add('at_mx-w-16');
|
|
223
224
|
//element.setAttribute('id','some-id')
|
|
224
225
|
element.innerHTML = `
|
|
225
226
|
<div class="at_card-body at_library_card_body" card-id="${payload.id}">
|
|
226
227
|
${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>
|
|
228
|
+
`<div class="at_card-title at_library_card_title" id="at-library-card-title-${payload.id}">
|
|
229
|
+
<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
230
|
</div>` :
|
|
230
231
|
``}
|
|
231
232
|
</div>
|
|
@@ -244,6 +245,7 @@ export function setActiveLibraryCard(cardId) {
|
|
|
244
245
|
activeLibraryCard.classList.remove('at_card_active');
|
|
245
246
|
}
|
|
246
247
|
const objId = target.getAttribute('card-id');
|
|
248
|
+
log.info("@@ objId", objId, target);
|
|
247
249
|
let targetId;
|
|
248
250
|
if (/[a-z]/.test(objId) || /[A-Z]/.test(objId)) {
|
|
249
251
|
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.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { MpSdk } from "../../bundle/sdk";
|
|
1
2
|
import { Notyf } from 'notyf';
|
|
2
3
|
import 'notyf/notyf.min.css';
|
|
3
4
|
declare let activeToolbarItem: HTMLElement, activeActionItem: HTMLElement, cancelModelPlacementPrompt: HTMLDivElement;
|
|
@@ -48,4 +49,5 @@ declare function handleShowCustomMinimap(): void;
|
|
|
48
49
|
declare function handleDisplayElements(id: string): void;
|
|
49
50
|
declare function handleWindowVisibility(visibilityBtn: HTMLElement, updateStateDB: boolean, fromParentVisibilityState?: boolean): Promise<void>;
|
|
50
51
|
declare function clearActivePane(): void;
|
|
51
|
-
|
|
52
|
+
declare function handleVisiblePartitions(mpSdk: MpSdk): void;
|
|
53
|
+
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, handleVisiblePartitions };
|
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
|
}
|
|
@@ -1771,6 +1772,7 @@ function handleSetModelsView() {
|
|
|
1771
1772
|
function handleSetLibraryModelsView() {
|
|
1772
1773
|
const libraryModelsCardViewBtn = document.getElementById('at-library-models-card-view-btn');
|
|
1773
1774
|
const libraryModelsListViewBtn = document.getElementById('at-library-models-list-view-btn');
|
|
1775
|
+
const libraryCards = document.getElementById('at-library-cards');
|
|
1774
1776
|
if (!libraryModelsCardViewBtn) {
|
|
1775
1777
|
return;
|
|
1776
1778
|
}
|
|
@@ -1780,6 +1782,7 @@ function handleSetLibraryModelsView() {
|
|
|
1780
1782
|
libraryModelsCardViewBtn.addEventListener('click', () => __awaiter(this, void 0, void 0, function* () {
|
|
1781
1783
|
libraryModelsCardViewBtn.classList.add('at_ghost_active');
|
|
1782
1784
|
libraryModelsListViewBtn.classList.remove('at_ghost_active');
|
|
1785
|
+
libraryCards.classList.add('at_flex_tiles');
|
|
1783
1786
|
modelsView = 'card';
|
|
1784
1787
|
log.info("libraryModelsCardViewBtn", modelsView);
|
|
1785
1788
|
const checkAssetLibrary = yield getLibrary();
|
|
@@ -1796,6 +1799,7 @@ function handleSetLibraryModelsView() {
|
|
|
1796
1799
|
libraryModelsListViewBtn.addEventListener('click', () => __awaiter(this, void 0, void 0, function* () {
|
|
1797
1800
|
libraryModelsListViewBtn.classList.add('at_ghost_active');
|
|
1798
1801
|
libraryModelsCardViewBtn.classList.remove('at_ghost_active');
|
|
1802
|
+
libraryCards.classList.remove('at_flex_tiles');
|
|
1799
1803
|
modelsView = 'list';
|
|
1800
1804
|
log.info("libraryModelsListViewBtn", modelsView);
|
|
1801
1805
|
const checkAssetLibrary = yield getLibrary();
|
|
@@ -1913,11 +1917,13 @@ function handlePartitionVisibility(targetId) {
|
|
|
1913
1917
|
};
|
|
1914
1918
|
const processPartitionVisibility = (targetObject) => {
|
|
1915
1919
|
if (targetObject) {
|
|
1920
|
+
log.info("targetObject", targetObject);
|
|
1916
1921
|
const { component, object } = targetObject;
|
|
1917
1922
|
// Update main partition visibility
|
|
1918
1923
|
// @ts-ignore
|
|
1919
1924
|
if (component.mesh.visible !== isVisible) {
|
|
1920
1925
|
setModelVisibility(object.id, isVisible);
|
|
1926
|
+
targetObject.object.object_data.json_data.options.is_visible = isVisible;
|
|
1921
1927
|
}
|
|
1922
1928
|
// Update model children visibility
|
|
1923
1929
|
getChildrenOfModel(component)
|
|
@@ -4044,10 +4050,48 @@ function handlePreviewModalResize() {
|
|
|
4044
4050
|
}
|
|
4045
4051
|
});
|
|
4046
4052
|
}
|
|
4053
|
+
function handleVisiblePartitions(mpSdk) {
|
|
4054
|
+
log.info('handleVisiblePartitions()');
|
|
4055
|
+
let lastFloorSequence = null;
|
|
4056
|
+
mpSdk.Floor.current.subscribe((currentFloor) => __awaiter(this, void 0, void 0, function* () {
|
|
4057
|
+
if ((currentFloor === null || currentFloor === void 0 ? void 0 : currentFloor.sequence) == null || currentFloor.sequence === -1 || currentFloor.sequence === lastFloorSequence) {
|
|
4058
|
+
return;
|
|
4059
|
+
}
|
|
4060
|
+
lastFloorSequence = currentFloor.sequence;
|
|
4061
|
+
log.info('handleVisiblePartitions', currentFloor);
|
|
4062
|
+
const polygons = get3DXObjects().filter(obj => obj.type === 'POLYGON');
|
|
4063
|
+
log.info("room partitions", polygons);
|
|
4064
|
+
if (!polygons.length)
|
|
4065
|
+
return;
|
|
4066
|
+
const updateChildrenVisibility = (component) => {
|
|
4067
|
+
getChildrenOfModel(component).filter(child => child.name && !child.deleted && child.visible !== true).forEach(child => {
|
|
4068
|
+
if (child.name.includes('wall')) {
|
|
4069
|
+
toggleWallVisibility(component, child.name);
|
|
4070
|
+
}
|
|
4071
|
+
else {
|
|
4072
|
+
toggleFloorVisibility(component, child.name);
|
|
4073
|
+
}
|
|
4074
|
+
});
|
|
4075
|
+
};
|
|
4076
|
+
const setPolygonsVisibility = (visible, polygon) => {
|
|
4077
|
+
setModelVisibility(polygon.object.id, visible);
|
|
4078
|
+
updateChildrenVisibility(polygon.component);
|
|
4079
|
+
};
|
|
4080
|
+
polygons.forEach(polygon => {
|
|
4081
|
+
log.info("JAMES polygon", polygon);
|
|
4082
|
+
const polygonFloorId = polygon.object.object_data.json_data.floor_sequence.sequence;
|
|
4083
|
+
log.info("JAMES polygonFloorId", polygonFloorId);
|
|
4084
|
+
log.info("JAMES currentFloor.sequence", currentFloor.sequence);
|
|
4085
|
+
const isCurrentFloor = polygonFloorId === currentFloor.sequence;
|
|
4086
|
+
log.info('partition matches current floor:', isCurrentFloor);
|
|
4087
|
+
setPolygonsVisibility(isCurrentFloor, polygon);
|
|
4088
|
+
});
|
|
4089
|
+
}));
|
|
4090
|
+
}
|
|
4047
4091
|
export {
|
|
4048
4092
|
//state
|
|
4049
4093
|
activeToolbarItem, activeActionItem, cancelModelPlacementPrompt, isCustomMapControlsVisible, pipeColor,
|
|
4050
4094
|
//methods
|
|
4051
4095
|
batchAddEventListenerById, batchAddEventListenerByClassName, batchAddEventListenerByClassNames, batchAddEventListenerByDataAttribute, setActiveToolbarItem, toggleDisplayPane, toggleActionBar, setupIndividualEventListeners, setupSpaceEventSubscriptions, handleModelVisibility, handleDeleteModel, handleShowMinimap, handleScrollToView, handleRenderMeetingUI, handleShowCustomMinimap, renderTagPaneContent,
|
|
4052
4096
|
// partition
|
|
4053
|
-
handlePartitionVisibility, handlePolygonVisibility, handleDeletePartition, handleToggleVisibilityTags, handleDisplayElements, handleWindowVisibility, clearActivePane };
|
|
4097
|
+
handlePartitionVisibility, handlePolygonVisibility, handleDeletePartition, handleToggleVisibilityTags, handleDisplayElements, handleWindowVisibility, clearActivePane, handleVisiblePartitions };
|
package/lib/types.d.ts
CHANGED