architwin 1.15.5 → 1.15.6
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 +2 -5
- package/lib/architwin.js +1 -1
- package/lib/atwinui/components/toolbar/spacePartition/roomFormPane.d.ts +5 -1
- package/lib/atwinui/components/toolbar/spacePartition/roomFormPane.js +46 -21
- package/lib/atwinui/events.js +33 -43
- package/lib/loaders/polydrawerLoader.d.ts +2 -0
- package/lib/loaders/polydrawerLoader.js +54 -17
- package/package.json +1 -1
- package/static/atwinui.css +4 -3
|
@@ -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
|
@@ -19,6 +19,7 @@ import { removeScreenShareSessionData } from "./atwinui/components/toolbar/scree
|
|
|
19
19
|
import { clearActivePane } from "./atwinui/events";
|
|
20
20
|
declare const transformHistory: ActionHistory;
|
|
21
21
|
declare const pathHistory: ActionPathHistory;
|
|
22
|
+
declare const partitionHistory: ActionPathHistory;
|
|
22
23
|
declare const _config: {
|
|
23
24
|
mp: {
|
|
24
25
|
urlParams: string[];
|
|
@@ -61,8 +62,6 @@ declare let _atwinConnections: ISdkConnections;
|
|
|
61
62
|
declare let _onMouseClickInstance: Function;
|
|
62
63
|
declare let _modelDetails: MpSdk.Model.ModelDetails;
|
|
63
64
|
declare const tagColors: string[];
|
|
64
|
-
declare let _undoDrawActions: any[], // actions that can be redone
|
|
65
|
-
_redoDrawActions: any[];
|
|
66
65
|
declare let _tubes: MpSdk.Scene.IObject;
|
|
67
66
|
declare let _pathConfig: PathConfig;
|
|
68
67
|
declare let _partitionNodes: PartitionNode[];
|
|
@@ -656,8 +655,6 @@ declare function getWallBaseHeight(): number;
|
|
|
656
655
|
declare function clearWallBaseHeight(): void;
|
|
657
656
|
declare function undoDrawAction(): void;
|
|
658
657
|
declare function redoDrawAction(): void;
|
|
659
|
-
declare function addUndoDrawActions(action: any): void;
|
|
660
|
-
declare function clearDrawActionHistory(): void;
|
|
661
658
|
declare function setTagIcon(payload: {
|
|
662
659
|
tag: MpSdk.Tag.TagData;
|
|
663
660
|
iconName: string;
|
|
@@ -943,4 +940,4 @@ declare function redoPipePath(): void;
|
|
|
943
940
|
* @returns void
|
|
944
941
|
* */
|
|
945
942
|
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,
|
|
943
|
+
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, 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, partitionHistory, _renderTagPaneContent, clearActivePane, renderPreviewModal, togglePreviewModal, closePreviewModal, setPreviewModalAction, activePreviewModal };
|