architwin 1.14.1 → 1.14.3
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 +13 -1
- package/lib/atwinui/components/toolbar/menuBar.js +7 -7
- package/lib/atwinui/components/toolbar/modelControlsPane.js +19 -19
- package/lib/atwinui/components/toolbar/objectListPane.d.ts +1 -1
- package/lib/atwinui/components/toolbar/objectListPane.js +10 -10
- 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 +55 -41
- package/lib/atwinui/components/toolbar/screenSharePane.js +2 -2
- package/lib/atwinui/components/toolbar/tagListPane.d.ts +1 -1
- package/lib/atwinui/components/toolbar/tagListPane.js +11 -10
- package/lib/atwinui/events.js +25 -18
- 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,8 +13,10 @@ 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
|
import { removeScreenShareSessionData } from "./atwinui/components/toolbar/screenSharePane";
|
|
17
18
|
declare const transformHistory: ActionHistory;
|
|
19
|
+
declare const pathHistory: ActionPathHistory;
|
|
18
20
|
declare const _config: {
|
|
19
21
|
mp: {
|
|
20
22
|
urlParams: string[];
|
|
@@ -913,10 +915,12 @@ declare function setVertexPath(path: Vector2[]): void;
|
|
|
913
915
|
* @returns - The current pipe.
|
|
914
916
|
*/
|
|
915
917
|
declare function getPipeIsDrawingMode(): Boolean;
|
|
918
|
+
declare function undoPipePath(): void;
|
|
919
|
+
declare function redoPipePath(): void;
|
|
916
920
|
/**
|
|
917
921
|
* Sets whether the screen sharing pointer is enabled
|
|
918
922
|
* @param value boolean
|
|
919
923
|
* @returns void
|
|
920
924
|
* */
|
|
921
925
|
declare function setPointerEnabled(value: boolean): void;
|
|
922
|
-
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, _currentSpace, _spaceUsers, _screenSharingHostUser, _screenSharingParticipantUsers, _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, 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, addUndoDrawActions, setWallBaseHeight, getWallBaseHeight, clearWallBaseHeight, setSpacePartitionNodes, setCurrentPolygon, getSpaceId, getCurrentPolygon, getPathBetweenSweeps, moveAlongPath, _atwinConnections, convertZupToYup, convertYupToZup, getRelativePosition, getOriginalWorldPosition, setSpaceMetadata, getSpaceMetadata, getAssetUrl, setScreenSharingHostUser, setScreenSharingParticipantUsers, renderCursorMarkerPointer, updatePointerTexture, toggleElementVisibility, renderPath, setDrawingConfig, resetDrawingConfig, _pipeCategories, _selectedPipeCategory, setPipeCategories, setSelectedPipeCategory, getSelectedPipeCategory, _pipes, _selectedPipe, setPipes, setSelectedPipe, getSelectedPipe, deleteVertex, setPipeIsDrawingMode, getPipeIsDrawingMode, setPointerEnabled, removeScreenShareSessionData, setVertexPath, _pathConfig };
|
|
926
|
+
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, _currentSpace, _spaceUsers, _screenSharingHostUser, _screenSharingParticipantUsers, _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, 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, addUndoDrawActions, setWallBaseHeight, getWallBaseHeight, clearWallBaseHeight, setSpacePartitionNodes, setCurrentPolygon, getSpaceId, getCurrentPolygon, getPathBetweenSweeps, moveAlongPath, _atwinConnections, convertZupToYup, convertYupToZup, getRelativePosition, getOriginalWorldPosition, setSpaceMetadata, getSpaceMetadata, getAssetUrl, setScreenSharingHostUser, setScreenSharingParticipantUsers, renderCursorMarkerPointer, updatePointerTexture, toggleElementVisibility, renderPath, setDrawingConfig, resetDrawingConfig, _pipeCategories, _selectedPipeCategory, setPipeCategories, setSelectedPipeCategory, getSelectedPipeCategory, _pipes, _selectedPipe, setPipes, setSelectedPipe, getSelectedPipe, deleteVertex, setPipeIsDrawingMode, getPipeIsDrawingMode, setPointerEnabled, removeScreenShareSessionData, setVertexPath, _pathConfig, undoPipePath, redoPipePath, pathHistory, };
|