fcs-core-viewer 0.54.0 → 0.55.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.
@@ -5,6 +5,7 @@
5
5
  export declare class Editor3DState {
6
6
  private static _instance;
7
7
  private _isOperationRunning;
8
+ private _isCheckedOutVersion;
8
9
  private constructor();
9
10
  /**
10
11
  * Returns the singleton instance.
@@ -25,6 +26,17 @@ export declare class Editor3DState {
25
26
  * the response (or error) has been received.
26
27
  */
27
28
  static setOperationRunning(value: boolean): void;
29
+ /**
30
+ * Returns true when the user is viewing a checked-out historical version.
31
+ * All modelling operations should be blocked in this state.
32
+ */
33
+ static IsCheckedOutVersion(): boolean;
34
+ /**
35
+ * Sets the checked-out-version flag.
36
+ * Call with `true` after a successful checkout and `false` after
37
+ * a trim-to-version or when the user returns to the latest version.
38
+ */
39
+ static setCheckedOutVersion(value: boolean): void;
28
40
  /**
29
41
  * Shows or hides the full-screen spinner overlay that blocks UI interaction
30
42
  * while a backend operation is in progress.
@@ -54,6 +54,18 @@ export declare class BackendManager {
54
54
  * @returns
55
55
  */
56
56
  sendToBackend(message: any, endpoint: string): Promise<any>;
57
+ /**
58
+ * Sends a GET request to the backend at the given endpoint.
59
+ * @param endpoint The endpoint path (e.g. '/model-versions/some-id')
60
+ * @returns The parsed JSON response, or throws on error.
61
+ */
62
+ getFromBackend(endpoint: string): Promise<any>;
63
+ /**
64
+ * Fetches the SERVICE mode flag for a given model environment.
65
+ * @param modelEnvironmentId The model environment ID
66
+ * @returns boolean indicating if the environment is in SERVICE mode
67
+ */
68
+ getModelEnvironmentServiceMode(modelEnvironmentId: Number): Promise<boolean>;
57
69
  /**
58
70
  * Along with a message also a binary file is uploaded.
59
71
  * @param message
@@ -0,0 +1,41 @@
1
+ /**
2
+ * A single entry in the model version history.
3
+ */
4
+ export interface ModelVersion {
5
+ /** Unique identifier for this history entry. */
6
+ id: string;
7
+ /** ISO timestamp of when this version was saved. */
8
+ timestamp: string;
9
+ /** The Azure Blob Storage key for the model zip at this version. */
10
+ modelBlobKey: string;
11
+ }
12
+ /**
13
+ * Client for model-history related API calls.
14
+ * Uses the existing BackendManager for consistent auth, base-URL, and error
15
+ * handling behaviour.
16
+ */
17
+ export declare class ModelHistoryClient {
18
+ private static _instance;
19
+ private _backendManager;
20
+ private constructor();
21
+ static getInstance(): ModelHistoryClient;
22
+ /**
23
+ * Fetches all stored versions for a given model from the backend.
24
+ * Calls GET /model-versions/{modelId} on the model service.
25
+ * @param modelId The model identifier (UUID).
26
+ * @returns Array of ModelVersion entries ordered oldest → newest.
27
+ */
28
+ fetchModelVersions(modelId: string): Promise<ModelVersion[]>;
29
+ /**
30
+ * Loads a historical model blob into runtime memory without permanently
31
+ * altering the version history. Uses operation 1004 (checkout_version).
32
+ * @param blobKey The Azure Blob Storage key of the version to check out.
33
+ */
34
+ checkoutVersion(blobKey: string): Promise<any>;
35
+ /**
36
+ * Permanently trims the version history so that the specified version
37
+ * becomes the latest. Uses operation 1005 (trim_to_version).
38
+ * @param blobKey The Azure Blob Storage key of the version to trim to.
39
+ */
40
+ trimToVersion(blobKey: string): Promise<any>;
41
+ }
@@ -64,6 +64,7 @@ export declare class SocketCommandsGateway implements IBackendEvents {
64
64
  set_color_by_quality: any;
65
65
  set_entity_representation: any;
66
66
  clear_model: any;
67
+ update_model_history: any;
67
68
  set_element_types: any;
68
69
  add_mesh_to_model: any;
69
70
  add_temporary_mesh_to_model: any;
@@ -228,6 +229,11 @@ export declare class SocketCommandsGateway implements IBackendEvents {
228
229
  * @param instructions Contains exported STEP file path
229
230
  */
230
231
  private export_STEP_for_selection;
232
+ /**
233
+ * Handles model history archive update from ModelService.
234
+ * Receives the complete history archive and initializes ModelHistoryPanel.
235
+ */
236
+ private update_model_history;
231
237
  measure_distance(data: BackendInstructions): Promise<CommandExecutionResponse>;
232
238
  /**
233
239
  * Helper to wrap socket BackendInstructions into the format expected by
@@ -1,6 +1,6 @@
1
1
  export declare class Remesh {
2
2
  data: {};
3
- faceUIDs: number[];
3
+ elementUIDs: number[];
4
4
  elementSize: number;
5
5
  elementOrder: number;
6
6
  meshType: {};
@@ -27,6 +27,7 @@ export declare class Remesh {
27
27
  optsteps3d: number;
28
28
  secondorder: number;
29
29
  usegmsh: boolean;
30
+ groups: number[][];
30
31
  constructor(data: {});
31
32
  perform(): Promise<boolean>;
32
33
  }
@@ -6,6 +6,8 @@ export declare enum OperationToId {
6
6
  Common_State_LoadModel = 1001,
7
7
  Common_State_SaveModel = 1002,
8
8
  Common_State_NewModel = 1003,
9
+ Common_State_CheckoutVersion = 1004,
10
+ Common_State_TrimToVersion = 1005,
9
11
  /**
10
12
  * Simulation - 10xx
11
13
  */
@@ -4,6 +4,7 @@ import { ViewerCADToolbox } from "./MainMenu/Toolboxes/CADToolbox";
4
4
  import { ViewerCAEToolbox } from "./MainMenu/Toolboxes/CAEToolbox";
5
5
  import { TopBar } from './Topbar/TopBar';
6
6
  import { OptionsMenu } from "./OptionsMenu/OptionsMenu";
7
+ import { ModelHistoryPanel } from './ModelHistory/ModelHistoryPanel';
7
8
  import { TreeView } from '../../../Viewer3D/UserInterface/UIComponents/TreeView/TreeView';
8
9
  import { TreeViewContextMenu } from '../../../Viewer3D/UserInterface/UIComponents/TreeView/TreeView';
9
10
  import { ViewerUIComponents } from '../../../Viewer3D/UserInterface/ViewerUIComponents';
@@ -21,5 +22,6 @@ export declare class EditorUIComponents extends ViewerUIComponents {
21
22
  viewerCAEToolbox: ViewerCAEToolbox;
22
23
  topBar: TopBar;
23
24
  optionsMenu: OptionsMenu;
25
+ modelHistoryPanel: ModelHistoryPanel;
24
26
  constructor();
25
27
  }
@@ -0,0 +1,65 @@
1
+ /**
2
+ * ModelHistoryPanel
3
+ *
4
+ * Renders a dropdown in the top-left corner of the Editor UI that lets users:
5
+ * 1. Browse the version timeline (mapped by timestamp).
6
+ * 2. Check out an older version (read-only).
7
+ * 3. "Continue from Here" to trim history and resume editing.
8
+ *
9
+ * The panel is always visible (unless SERVICE mode). When no archive entries
10
+ * exist the dropdown is replaced by a "No archive exists" message.
11
+ *
12
+ * The panel is mounted into the `div#div_model_history` element that is
13
+ * injected into the Editor's HTML by Editor3DUISetup.
14
+ */
15
+ export declare class ModelHistoryPanel {
16
+ private static _instance;
17
+ private _container;
18
+ private _client;
19
+ private _versions;
20
+ /** Blob key of the version currently checked out (null = latest). */
21
+ private _activeVersionBlobKey;
22
+ /** The blob key of the latest (current) model version, sent by ModelService. */
23
+ private _latestBlobKey;
24
+ /** Stored so the version list can be re-fetched after a trim. */
25
+ private _modelId;
26
+ private _triggerBtn;
27
+ private _menu;
28
+ private _select;
29
+ private _emptyMsg;
30
+ private _badge;
31
+ private _checkoutBtn;
32
+ private _continueBtn;
33
+ private _returnBtn;
34
+ private _isMenuOpen;
35
+ private constructor();
36
+ static getInstance(): ModelHistoryPanel;
37
+ /**
38
+ * Initializes the ModelHistoryPanel with history archive received from ModelService.
39
+ * Called each time an `update_model_history` WebSocket message arrives.
40
+ *
41
+ * @param modelId The model identifier.
42
+ * @param historyArchive Map of ISO timestamps to blob keys.
43
+ * @param isServiceMode If true, disables and hides the history panel.
44
+ * @param isCheckedOut If true, the session is viewing a historical version.
45
+ * @param latestBlobKey The blob key of the latest model version (for Return to Latest).
46
+ */
47
+ initializeWithArchive(modelId: string, historyArchive?: Record<string, string>, isServiceMode?: boolean, isCheckedOut?: boolean, latestBlobKey?: string): Promise<void>;
48
+ private _build;
49
+ private _populateSelect;
50
+ private _showPanel;
51
+ private _hidePanel;
52
+ private _showEmptyState;
53
+ private _showVersionList;
54
+ private _enterCheckedOutMode;
55
+ private _exitCheckedOutMode;
56
+ private _toggleMenu;
57
+ private _openMenu;
58
+ private _closeMenu;
59
+ private _onCheckoutClicked;
60
+ private _onContinueClicked;
61
+ private _onReturnToLatestClicked;
62
+ private _getSortedVersions;
63
+ private _getSortedVersionsDesc;
64
+ private _formatTimestamp;
65
+ }
@@ -11,6 +11,9 @@ export interface PluginResponse extends Response {
11
11
  finished: boolean;
12
12
  message: string;
13
13
  event: string;
14
+ plugin_name?: string;
15
+ plugin_version?: string;
16
+ plugin_version_stamp?: string;
14
17
  }
15
18
  /**
16
19
  * Constructor for generic 3D editor.
@@ -62,6 +62,7 @@ export declare class StatusBar {
62
62
  private copyLogsButton;
63
63
  private closeLogsButton;
64
64
  private versionBadge;
65
+ private pluginVersionBadge;
65
66
  /**
66
67
  * Private constructor.
67
68
  */
@@ -71,6 +72,10 @@ export declare class StatusBar {
71
72
  * as a badge on the right end of the status bar.
72
73
  */
73
74
  private _fetchAndDisplayVersion;
75
+ /**
76
+ * Displays a plugin version badge in the status bar.
77
+ */
78
+ setPluginVersionStamp(pluginName: string, versionTimestamp: string): void;
74
79
  /**
75
80
  * Getter for singleton instance.
76
81
  */
@@ -25,6 +25,8 @@ export declare class SceneWrapper {
25
25
  render: any;
26
26
  renderer: any;
27
27
  labelRenderer2D: any;
28
+ labelRenderer3D: any;
29
+ directionalLight: THREE.DirectionalLight;
28
30
  camToStart_world: any;
29
31
  camToStart_world_unit: any;
30
32
  camToStart_local: any;
@@ -71,15 +73,16 @@ export declare class SceneWrapper {
71
73
  * @param grPrimitive
72
74
  * @param currentCamera
73
75
  * @param controls
74
- * @param render
75
76
  * @param renderer
76
77
  * @param labelRenderer2D
78
+ * @param labelRenderer3D
79
+ * @param directionalLight
77
80
  * @param camToStart_world
78
81
  * @param camToStart_world_unit
79
82
  * @param camToStart_local
80
83
  * @param camToStart_length
81
84
  */
82
- constructor(canvas: HTMLCanvasElement, height: any, width: any, scene: any, sceneObjects: {}, grMesh: any, grLine: any, grPoint: any, grLabel: any, grPushPin: THREE.Group, grPrimitive: any, currentCamera: any, controls: any, render: any, renderer: any, labelRenderer2D: any, camToStart_world: any, camToStart_world_unit: any, camToStart_local: any, camToStart_length: any, axisLeft: any, axisBottom: any);
85
+ constructor(canvas: HTMLCanvasElement, height: any, width: any, scene: any, sceneObjects: {}, grMesh: any, grLine: any, grPoint: any, grLabel: any, grPushPin: THREE.Group, grPrimitive: any, currentCamera: any, controls: any, renderer: any, labelRenderer2D: any, labelRenderer3D: any, directionalLight: THREE.DirectionalLight, camToStart_world: any, camToStart_world_unit: any, camToStart_local: any, camToStart_length: any, axisLeft: any, axisBottom: any);
83
86
  static getInstance(): SceneWrapper;
84
87
  setParentViewerWrapper: (viewerWrapper: Viewer3DWrapper) => void;
85
88
  getHeight: () => any;
@@ -108,8 +111,6 @@ export declare class SceneWrapper {
108
111
  setCurrentCamera: (currentCamera: any) => void;
109
112
  getControls: () => any;
110
113
  setControls: (controls: any) => void;
111
- getRender: () => any;
112
- setRender: (render: any) => void;
113
114
  getRenderer: () => any;
114
115
  setRenderer: (renderer: any) => void;
115
116
  getLabelRenderer2D: () => any;
@@ -53,7 +53,7 @@ export declare class Viewer3DWrapper {
53
53
  axisBottom: number;
54
54
  controls: any;
55
55
  ambientLight: any;
56
- directionalLight: any;
56
+ directionalLight: THREE.DirectionalLight;
57
57
  directionalLights: [{
58
58
  direction: any;
59
59
  color: any;
@@ -171,10 +171,6 @@ export declare class Viewer3DWrapper {
171
171
  */
172
172
  DefineAllTasks(): Promise<void>;
173
173
  animate(): void;
174
- /**
175
- * Public rendering method.
176
- */
177
- render(): void;
178
174
  /**
179
175
  *
180
176
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fcs-core-viewer",
3
- "version": "0.54.0",
3
+ "version": "0.55.0",
4
4
  "description": "3D Viewer in the Cloud",
5
5
  "author": {
6
6
  "name": "Femsolve Kft."