architwin 1.13.11 → 1.13.13
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/actionHistory.d.ts +1 -0
- package/lib/actionHistory.js +4 -1
- package/lib/actionPathHistory.d.ts +18 -0
- package/lib/actionPathHistory.js +64 -0
- package/lib/architwin.d.ts +5 -1
- package/lib/architwin.js +1 -1
- package/lib/atwinui/components/toolbar/card.js +5 -0
- package/lib/atwinui/components/toolbar/i18n.js +14 -2
- package/lib/atwinui/components/toolbar/menuBar.js +4 -4
- package/lib/atwinui/components/toolbar/modelControlsPane.js +19 -19
- package/lib/atwinui/components/toolbar/pipeFormPane.d.ts +2 -0
- package/lib/atwinui/components/toolbar/pipeFormPane.js +72 -60
- package/lib/atwinui/components/toolbar/pipeListPane.d.ts +3 -0
- package/lib/atwinui/components/toolbar/pipeListPane.js +56 -42
- package/lib/atwinui/components/toolbar/screenSharePane.d.ts +3 -1
- package/lib/atwinui/components/toolbar/screenSharePane.js +91 -39
- package/lib/atwinui/components/toolbar/spaceUserListPane.js +1 -1
- package/lib/atwinui/components/toolbar/viewingRemoteSpace.js +5 -5
- package/lib/atwinui/events.js +19 -11
- package/lib/loaders/polydrawerLoader.js +2 -1
- package/lib/utils.d.ts +2 -0
- package/lib/utils.js +7 -0
- package/package.json +1 -1
package/lib/actionHistory.d.ts
CHANGED
package/lib/actionHistory.js
CHANGED
|
@@ -58,7 +58,7 @@ export class ActionHistory {
|
|
|
58
58
|
}
|
|
59
59
|
// Check if undo is possible for an object
|
|
60
60
|
canUndo(objectId) {
|
|
61
|
-
return this.history[objectId] && this.currentIndex[objectId]
|
|
61
|
+
return this.history[objectId] && this.currentIndex[objectId] > 0;
|
|
62
62
|
}
|
|
63
63
|
// Check if redo is possible for an object
|
|
64
64
|
canRedo(objectId) {
|
|
@@ -71,4 +71,7 @@ export class ActionHistory {
|
|
|
71
71
|
this.history = {};
|
|
72
72
|
this.currentIndex = {};
|
|
73
73
|
}
|
|
74
|
+
getCurrentIndex(objectId) {
|
|
75
|
+
return this.currentIndex[objectId];
|
|
76
|
+
}
|
|
74
77
|
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Vector3 } from "../bundle/sdk";
|
|
2
|
+
export declare class ActionPathHistory {
|
|
3
|
+
private history;
|
|
4
|
+
private index;
|
|
5
|
+
private current;
|
|
6
|
+
addToHistory(path: Vector3[]): void;
|
|
7
|
+
undo(): Vector3[] | null;
|
|
8
|
+
redo(): Vector3[] | null;
|
|
9
|
+
getCurrent(): Vector3[] | null;
|
|
10
|
+
setCurrent(paths: Vector3[]): Vector3[];
|
|
11
|
+
getAllHistory(): {
|
|
12
|
+
history: Vector3[][];
|
|
13
|
+
index: number;
|
|
14
|
+
};
|
|
15
|
+
clearHistory(): void;
|
|
16
|
+
canUndo(): boolean;
|
|
17
|
+
canRedo(): boolean;
|
|
18
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
export class ActionPathHistory {
|
|
2
|
+
constructor() {
|
|
3
|
+
this.history = []; // all recorded paths
|
|
4
|
+
this.index = -1; // current pointer
|
|
5
|
+
this.current = []; // fallback for "original" state
|
|
6
|
+
}
|
|
7
|
+
// Save a new path
|
|
8
|
+
addToHistory(path) {
|
|
9
|
+
const newPath = JSON.parse(JSON.stringify(path));
|
|
10
|
+
// If we undid something and then added a new path → cut off "future" history
|
|
11
|
+
if (this.index < this.history.length - 1) {
|
|
12
|
+
this.history = this.history.slice(0, this.index + 1);
|
|
13
|
+
}
|
|
14
|
+
// Avoid pushing duplicates
|
|
15
|
+
if (this.history.length === 0 ||
|
|
16
|
+
JSON.stringify(this.history[this.history.length - 1]) !== JSON.stringify(newPath)) {
|
|
17
|
+
this.history.push(newPath);
|
|
18
|
+
this.index = this.history.length - 1;
|
|
19
|
+
console.log("Added to history:", newPath, "| history:", this.history);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
undo() {
|
|
23
|
+
if (!this.canUndo())
|
|
24
|
+
return null;
|
|
25
|
+
this.index--;
|
|
26
|
+
if (this.index < 0)
|
|
27
|
+
return this.current; // back to the original state
|
|
28
|
+
return this.getCurrent();
|
|
29
|
+
}
|
|
30
|
+
redo() {
|
|
31
|
+
if (!this.canRedo())
|
|
32
|
+
return null;
|
|
33
|
+
this.index++;
|
|
34
|
+
return this.getCurrent();
|
|
35
|
+
}
|
|
36
|
+
getCurrent() {
|
|
37
|
+
if (this.index >= 0 && this.index < this.history.length) {
|
|
38
|
+
return JSON.parse(JSON.stringify(this.history[this.index]));
|
|
39
|
+
}
|
|
40
|
+
return this.current; // fallback if index = -1
|
|
41
|
+
}
|
|
42
|
+
setCurrent(paths) {
|
|
43
|
+
this.current = JSON.parse(JSON.stringify(paths));
|
|
44
|
+
return this.current;
|
|
45
|
+
}
|
|
46
|
+
getAllHistory() {
|
|
47
|
+
return {
|
|
48
|
+
history: JSON.parse(JSON.stringify(this.history)),
|
|
49
|
+
index: this.index,
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
clearHistory() {
|
|
53
|
+
this.history = [];
|
|
54
|
+
this.index = -1;
|
|
55
|
+
this.current = [];
|
|
56
|
+
console.log("History cleared.");
|
|
57
|
+
}
|
|
58
|
+
canUndo() {
|
|
59
|
+
return this.index >= 0;
|
|
60
|
+
}
|
|
61
|
+
canRedo() {
|
|
62
|
+
return this.index < this.history.length - 1;
|
|
63
|
+
}
|
|
64
|
+
}
|
package/lib/architwin.d.ts
CHANGED
|
@@ -13,7 +13,9 @@ import { ActionHistory } from "./actionHistory";
|
|
|
13
13
|
import * as meet from './zoom';
|
|
14
14
|
import 'notyf/notyf.min.css';
|
|
15
15
|
import { convertYupToZup, convertZupToYup, getRelativePosition, getOriginalWorldPosition } from "./worldConversion";
|
|
16
|
+
import { ActionPathHistory } from "./actionPathHistory";
|
|
16
17
|
declare const transformHistory: ActionHistory;
|
|
18
|
+
declare const pathHistory: ActionPathHistory;
|
|
17
19
|
declare const _config: {
|
|
18
20
|
mp: {
|
|
19
21
|
urlParams: string[];
|
|
@@ -862,4 +864,6 @@ declare function setVertexPath(path: Vector2[]): void;
|
|
|
862
864
|
* @returns - The current pipe.
|
|
863
865
|
*/
|
|
864
866
|
declare function getPipeIsDrawingMode(): Boolean;
|
|
865
|
-
|
|
867
|
+
declare function undoPipePath(): void;
|
|
868
|
+
declare function redoPipePath(): void;
|
|
869
|
+
export { _atwin, _config, _mpConfig, tags, sweeps, selectedObject, previousObjTransform, currentObjTransform, actionHistory, state, _tags, _tagCategories, _tagMessageRecepients, _space, _spaceId, _api, _pointerCoord, _3DXObjects, _meetingParticipants, _generatedObjectIds, tagColors, domMousePosition, isFitScreenOccupied, isCdnMapDataAvailable, minimap, _modelDetails, _onMouseClickInstance, transformHistory, _partitionNodes, _undoDrawActions, _redoDrawActions, 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, 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, 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, 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, addUndoDrawActions, setWallBaseHeight, getWallBaseHeight, clearWallBaseHeight, setSpacePartitionNodes, setCurrentPolygon, getSpaceId, getCurrentPolygon, getPathBetweenSweeps, moveAlongPath, _atwinConnections, convertZupToYup, convertYupToZup, getRelativePosition, getOriginalWorldPosition, setSpaceMetadata, getSpaceMetadata, getAssetUrl, renderPath, setDrawingConfig, resetDrawingConfig, _pipeCategories, _selectedPipeCategory, setPipeCategories, setSelectedPipeCategory, getSelectedPipeCategory, _pipes, _selectedPipe, setPipes, setSelectedPipe, getSelectedPipe, deleteVertex, setPipeIsDrawingMode, getPipeIsDrawingMode, setVertexPath, _pathConfig, undoPipePath, redoPipePath, pathHistory, };
|