architwin 1.15.5 → 1.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/actionPartitionHistory.d.ts +17 -0
- package/lib/actionPartitionHistory.js +62 -0
- package/lib/actionPathHistory.js +2 -2
- package/lib/architwin.d.ts +15 -5
- package/lib/architwin.js +1 -1
- package/lib/atwinui/components/toolbar/i18n.js +4 -0
- package/lib/atwinui/components/toolbar/spacePartition/roomFormPane.d.ts +5 -1
- package/lib/atwinui/components/toolbar/spacePartition/roomFormPane.js +46 -21
- package/lib/atwinui/components/toolbar/tagListPane.d.ts +5 -0
- package/lib/atwinui/components/toolbar/tagListPane.js +198 -26
- package/lib/atwinui/events.d.ts +2 -1
- package/lib/atwinui/events.js +97 -45
- package/lib/loaders/polydrawerLoader.d.ts +2 -0
- package/lib/loaders/polydrawerLoader.js +54 -17
- package/lib/tag.d.ts +6 -1
- package/lib/tag.js +8 -1
- package/lib/types.d.ts +1 -0
- package/package.json +1 -1
- package/static/atwinui.css +20 -17
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export declare class ActionPartitionHistory {
|
|
2
|
+
private history;
|
|
3
|
+
private index;
|
|
4
|
+
private current;
|
|
5
|
+
addToHistory(partition: any): void;
|
|
6
|
+
undo(): any;
|
|
7
|
+
redo(): any;
|
|
8
|
+
getCurrent(): any;
|
|
9
|
+
setCurrent(partition: any): any;
|
|
10
|
+
getAllHistory(): {
|
|
11
|
+
history: any[];
|
|
12
|
+
index: number;
|
|
13
|
+
};
|
|
14
|
+
clearHistory(): void;
|
|
15
|
+
canUndo(): boolean;
|
|
16
|
+
canRedo(): boolean;
|
|
17
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import log from "loglevel";
|
|
2
|
+
export class ActionPartitionHistory {
|
|
3
|
+
constructor() {
|
|
4
|
+
this.history = []; // all recorded partition states
|
|
5
|
+
this.index = -1; // current pointer
|
|
6
|
+
this.current = null; // fallback for "original" state
|
|
7
|
+
}
|
|
8
|
+
addToHistory(partition) {
|
|
9
|
+
const newPartition = structuredClone(partition);
|
|
10
|
+
if (this.index < this.history.length - 1) {
|
|
11
|
+
this.history = this.history.slice(0, this.index + 1);
|
|
12
|
+
}
|
|
13
|
+
if (this.history.length === 0 ||
|
|
14
|
+
JSON.stringify(this.history[this.history.length - 1]) !== JSON.stringify(newPartition)) {
|
|
15
|
+
this.history.push(newPartition);
|
|
16
|
+
this.index = this.history.length - 1;
|
|
17
|
+
log.info("newPartition", newPartition, this.current, this.history.length);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
undo() {
|
|
21
|
+
if (!this.canUndo())
|
|
22
|
+
return null;
|
|
23
|
+
this.index--;
|
|
24
|
+
if (this.index < 0)
|
|
25
|
+
return this.current ? this.current : null;
|
|
26
|
+
return this.getCurrent();
|
|
27
|
+
}
|
|
28
|
+
redo() {
|
|
29
|
+
if (!this.canRedo())
|
|
30
|
+
return null;
|
|
31
|
+
this.index++;
|
|
32
|
+
return this.getCurrent();
|
|
33
|
+
}
|
|
34
|
+
getCurrent() {
|
|
35
|
+
if (this.index >= 0 && this.index < this.history.length) {
|
|
36
|
+
return structuredClone(this.history[this.index]);
|
|
37
|
+
}
|
|
38
|
+
return this.current ? this.current : null;
|
|
39
|
+
}
|
|
40
|
+
setCurrent(partition) {
|
|
41
|
+
this.current = structuredClone(partition); // or _.cloneDeep(partition)
|
|
42
|
+
return this.current;
|
|
43
|
+
}
|
|
44
|
+
getAllHistory() {
|
|
45
|
+
return {
|
|
46
|
+
history: this.history.map(p => structuredClone(p)),
|
|
47
|
+
index: this.index,
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
clearHistory() {
|
|
51
|
+
this.history = [];
|
|
52
|
+
this.index = -1;
|
|
53
|
+
this.current = null;
|
|
54
|
+
console.log("History cleared.");
|
|
55
|
+
}
|
|
56
|
+
canUndo() {
|
|
57
|
+
return this.index >= 0;
|
|
58
|
+
}
|
|
59
|
+
canRedo() {
|
|
60
|
+
return this.index < this.history.length - 1;
|
|
61
|
+
}
|
|
62
|
+
}
|
package/lib/actionPathHistory.js
CHANGED
|
@@ -6,7 +6,7 @@ export class ActionPathHistory {
|
|
|
6
6
|
}
|
|
7
7
|
// Save a new path
|
|
8
8
|
addToHistory(path) {
|
|
9
|
-
const newPath =
|
|
9
|
+
const newPath = structuredClone(path);
|
|
10
10
|
// If we undid something and then added a new path → cut off "future" history
|
|
11
11
|
if (this.index < this.history.length - 1) {
|
|
12
12
|
this.history = this.history.slice(0, this.index + 1);
|
|
@@ -40,7 +40,7 @@ export class ActionPathHistory {
|
|
|
40
40
|
return this.current; // fallback if index = -1
|
|
41
41
|
}
|
|
42
42
|
setCurrent(paths) {
|
|
43
|
-
this.current =
|
|
43
|
+
this.current = structuredClone(paths);
|
|
44
44
|
return this.current;
|
|
45
45
|
}
|
|
46
46
|
getAllHistory() {
|
package/lib/architwin.d.ts
CHANGED
|
@@ -16,9 +16,11 @@ import { convertYupToZup, convertZupToYup, getRelativePosition, getOriginalWorld
|
|
|
16
16
|
import { renderPreviewModal, togglePreviewModal, closePreviewModal, setPreviewModalAction, activePreviewModal } from "./atwinui/components/toolbar";
|
|
17
17
|
import { ActionPathHistory } from "./actionPathHistory";
|
|
18
18
|
import { removeScreenShareSessionData } from "./atwinui/components/toolbar/screenSharePane";
|
|
19
|
+
import { clearTagVisibilityStorage } from "./atwinui/components/toolbar/tagListPane";
|
|
19
20
|
import { clearActivePane } from "./atwinui/events";
|
|
20
21
|
declare const transformHistory: ActionHistory;
|
|
21
22
|
declare const pathHistory: ActionPathHistory;
|
|
23
|
+
declare const partitionHistory: ActionPathHistory;
|
|
22
24
|
declare const _config: {
|
|
23
25
|
mp: {
|
|
24
26
|
urlParams: string[];
|
|
@@ -61,8 +63,6 @@ declare let _atwinConnections: ISdkConnections;
|
|
|
61
63
|
declare let _onMouseClickInstance: Function;
|
|
62
64
|
declare let _modelDetails: MpSdk.Model.ModelDetails;
|
|
63
65
|
declare const tagColors: string[];
|
|
64
|
-
declare let _undoDrawActions: any[], // actions that can be redone
|
|
65
|
-
_redoDrawActions: any[];
|
|
66
66
|
declare let _tubes: MpSdk.Scene.IObject;
|
|
67
67
|
declare let _pathConfig: PathConfig;
|
|
68
68
|
declare let _partitionNodes: PartitionNode[];
|
|
@@ -656,8 +656,6 @@ declare function getWallBaseHeight(): number;
|
|
|
656
656
|
declare function clearWallBaseHeight(): void;
|
|
657
657
|
declare function undoDrawAction(): void;
|
|
658
658
|
declare function redoDrawAction(): void;
|
|
659
|
-
declare function addUndoDrawActions(action: any): void;
|
|
660
|
-
declare function clearDrawActionHistory(): void;
|
|
661
659
|
declare function setTagIcon(payload: {
|
|
662
660
|
tag: MpSdk.Tag.TagData;
|
|
663
661
|
iconName: string;
|
|
@@ -675,6 +673,18 @@ declare function getTagDataCollection(): MpSdk.Dictionary<MpSdk.Tag.TagData>;
|
|
|
675
673
|
declare function disposeTag(payload: {
|
|
676
674
|
tagId: string;
|
|
677
675
|
}): Promise<void>;
|
|
676
|
+
/**
|
|
677
|
+
* Toggles the visibility state of a specific tag.
|
|
678
|
+
*
|
|
679
|
+
* @param {Object} payload - The tag data.
|
|
680
|
+
* @param {string} payload.tagId - The unique identifier of the tag to update.
|
|
681
|
+
* @param {boolean} payload.visibility - The desired visibility state (true = visible, false = hidden).
|
|
682
|
+
* @returns {Promise<void>} Resolves when the visibility update is complete.
|
|
683
|
+
*/
|
|
684
|
+
declare function toggleVisibilityTag(payload: {
|
|
685
|
+
tagId: string;
|
|
686
|
+
visibility: boolean;
|
|
687
|
+
}): Promise<void>;
|
|
678
688
|
declare function getMpTag(tagId: string): ITag;
|
|
679
689
|
declare function getTags(space: ISpace): Promise<ITag[] | null>;
|
|
680
690
|
declare function gotoTag(tagId: string): Promise<void>;
|
|
@@ -943,4 +953,4 @@ declare function redoPipePath(): void;
|
|
|
943
953
|
* @returns void
|
|
944
954
|
* */
|
|
945
955
|
declare function setPointerEnabled(value: boolean): void;
|
|
946
|
-
export { _atwin, _config, _mpConfig, tags, sweeps, selectedObject, previousObjTransform, currentObjTransform, actionHistory, state, _tags, _tagCategories, _tagMessageRecepients, _space, _spaceId, _api, _pointerCoord, _3DXObjects, _meetingParticipants, _generatedObjectIds, _tagIotCategoryTypes, _tagIotDevices, tagColors, domMousePosition, isFitScreenOccupied, isCdnMapDataAvailable, minimap, _modelDetails, _onMouseClickInstance, transformHistory, _partitionNodes, _currentSpace, _spaceUsers, _screenSharingHostUser, _screenSharingParticipantUsers,
|
|
956
|
+
export { _atwin, _config, _mpConfig, tags, sweeps, selectedObject, previousObjTransform, currentObjTransform, actionHistory, state, _tags, _tagCategories, _tagMessageRecepients, _space, _spaceId, _api, _pointerCoord, _3DXObjects, _meetingParticipants, _generatedObjectIds, _tagIotCategoryTypes, _tagIotDevices, tagColors, domMousePosition, isFitScreenOccupied, isCdnMapDataAvailable, minimap, _modelDetails, _onMouseClickInstance, transformHistory, _partitionNodes, _currentSpace, _spaceUsers, _screenSharingHostUser, _screenSharingParticipantUsers, initAtwinApi, getAtwinSdk, connectSpace, disconnectSpace, clearActionHistory, getSweeps, getCurrentSweep, getCurrentSweepPosition, moveToSweep, getNearbySweeps, getAllSweeps, getCurrentCameraPose, getCurrentCameraZoom, getCameraPosition, getCurrentFloor, moveInDirection, cameraLookAt, cameraPan, cameraRotate, cameraSetRotation, getViewMode, setViewMode, captureSpaceScreenshot, captureScreenshotAndCameraDetails, captureCurrentView, cameraZoomBy, cameraZoomReset, cameraZoomTo, getNearbyObjects, setTransformMode, setSelectedObject, clearSelectedObject, revertTransform, setTransformControls, removeTransformControls, setRenderDistance, addObject, getObject, addObjectToSpace, renderModel, addMediaScreen, attachMediaScreenContent, updateObject, updateShowcaseObject, deleteObject, deleteShowcaseObject, copyObject, replaceObject, getTargetPosition, setObjectTransformation, setPointerCoordinates, addTextMarkupScreen, setTextMarkupScreenContent, goTo3dx, goToModel, hasTimeElapsed, getSelectedObject, renderAvatar, setSpaceAvatar, get3DXObjects, set3DXObjects, clear3DXObjects, setLibrary, getLibrary, disposeModel, disposeAllModels, renderInSpaceMediaScreen, goToPosition, goToParticipant, getNearestSweepFromObject, cancelModelPlacement, renderViewpointMarker, toggleViewpointVisibility, convertDegRotationToEuler, isToolbarFeatureEnabled, goToMPOrigin, pauseVideo, playVideo, setVideoPlayback, setAnimationState, showMinimap, hideMinimap, getMapConfig, addTag, getTags, gotoTag, renderTag, disposeTag, disposeTags, toggleVisibilityTag, getMpTags, getTagDataCollection, getMpTag, showTags, attachTagMedia, detachTagMedia, moveTag, editTagLabel, editTagDescription, editTagStem, editTagIcon, editTagColor, attachSandbox, registerSandbox, saveTag, rotateCameraToObject, setModelVisibility, tagStateSubscriber, setTagIcon, setTagCategories, setUserAssignedCategories, getUserAssignedCategories, setTagMessageRecepients, getTagMessageRecepients, setTagMessages, getTagMessages, setSelectedTagUuid, getSelectedTagUuid, setCurrentSpace, toggleFitToScreen, getFloors, getLabels, renderMeetingSidebar, createMeetingTemplate, joinMeetingTemplate, meet, dispatchSpaceEvent, subscribeSpaceEvent, unsubscribeSpaceEvent, registerCustomSpaceEvent, clearSpaceEventQueue, initSocketIo, socketEmit, getParticipants, followParticipant, unFollowParticipant, enableHUD, disableHUD, getMediaScreenHUDs, canSetHud, saveMediaScreenHud, removeMediaScreenHud, enableFitScreen, disableFitScreen, initToolbarUI, themeManager, convertToEuler, disableSweeps, enableSweeps, enableSweep, disableSweep, tubeLineType, pathLineType, _sceneObject, _tubes, drawPath, toggleSpaceNavigation, startDraw, exitDraw, cancelDraw, setPolygonPath, setPathLine, setPathLineOptions, getCurrentTubeLine, renderPolygon, toggleWallVisibility, toggleMeshChildrenVisibility, toggleFloorVisibility, getChildrenOfModel, toggleVerticeRingVisibility, setPolygonFloorOffset, getPolygonFloorOffset, setFloorBaseHeight, clearFloorBaseHeight, enableVerticeControls, deleteEdge, disposePathLine, getFloorBaseHeight, setMeshChildrenMaterialProperty, undoDrawAction, redoDrawAction, setWallBaseHeight, getWallBaseHeight, clearWallBaseHeight, getVertexPath, setSpacePartitionNodes, setCurrentPolygon, getSpaceId, getCurrentPolygon, getPathBetweenSweeps, moveAlongPath, _atwinConnections, convertZupToYup, convertYupToZup, getRelativePosition, getOriginalWorldPosition, setSpaceMetadata, getSpaceMetadata, getAssetUrl, setIotCategoryTypes, setIotDeviceTypes, setIoTDeviceTagIcons, getIoTDeviceTagIcons, setScreenSharingHostUser, setScreenSharingParticipantUsers, renderCursorMarkerPointer, updatePointerTexture, toggleElementVisibility, renderPath, setDrawingConfig, getDrawingConfig, resetDrawingConfig, _pipeCategories, _selectedPipeCategory, setPipeCategories, setSelectedPipeCategory, getSelectedPipeCategory, _pipes, _selectedPipe, setPipes, setSelectedPipe, getSelectedPipe, deleteVertex, setPipeIsDrawingMode, getPipeIsDrawingMode, setPointerEnabled, removeScreenShareSessionData, setVertexPath, _pathConfig, undoPipePath, redoPipePath, pathHistory, clearTagVisibilityStorage, partitionHistory, _renderTagPaneContent, clearActivePane, renderPreviewModal, togglePreviewModal, closePreviewModal, setPreviewModalAction, activePreviewModal };
|