@equinor/echo-framework 2.1.0 → 2.2.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/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@equinor/echo-framework",
3
- "version": "2.1.0",
3
+ "version": "2.2.0",
4
4
  "peerDependencies": {
5
- "@equinor/echo-base": ">= 2.0.1 < 3.0.0",
6
- "@equinor/echo-components": ">= 2.0.1 < 3.0.0",
7
- "@equinor/echo-core": ">= 2.0.1 < 3.0.0",
8
- "@equinor/echo-search": ">= 2.0.1 < 3.0.0",
9
- "@equinor/echo-utils": ">= 2.1.0 < 3.0.0",
5
+ "@equinor/echo-base": ">= 2.2.0 < 3.0.0",
6
+ "@equinor/echo-components": ">= 2.2.0 < 3.0.0",
7
+ "@equinor/echo-core": ">= 2.2.0 < 3.0.0",
8
+ "@equinor/echo-search": ">= 2.2.0 < 3.0.0",
9
+ "@equinor/echo-utils": ">= 2.2.0 < 3.0.0",
10
10
  "@equinor/eds-core-react": "0.49.0",
11
11
  "@equinor/eds-icons": "0.22.0",
12
12
  "react": ">= 17.0.2",
package/src/index.d.ts CHANGED
@@ -50,7 +50,7 @@ export { RegisteredComponentName } from './lib/services/componentRegistry/compon
50
50
  export * from './lib/services/dataLayerPanel';
51
51
  export { EchoViewInspectionToolMode } from './lib/services/echoViewService/echoView.type';
52
52
  export type { EchoView, EchoViewEcmPdfInspectionToolConfig, EchoViewSyncSettings } from './lib/services/echoViewService/echoView.type';
53
- export { echoViewService, setEchoView } from './lib/services/echoViewService/echoViewService';
53
+ export { echoViewService, echoViewServiceAPI, setEchoView, clearEchoView } from './lib/services/echoViewService/echoViewService';
54
54
  export * from './lib/services/eventHubActions';
55
55
  export * from './lib/services/leftPanelNavigation';
56
56
  export * from './lib/services/locationService/locationService';
@@ -13,7 +13,3 @@ export interface EchoUiState {
13
13
  updateModuleName: (newModuleName: string) => void;
14
14
  }
15
15
  export declare const useEchoUserInterfaceStore: zustand.UseBoundStore<zustand.StoreApi<EchoUiState>>;
16
- /**
17
- * @deprecated useEchoUiContext() is deprecated, please use useEchoUserInterfaceStore() instead.
18
- */
19
- export declare const useEchoUiContext: any;
@@ -1,4 +1,73 @@
1
1
  import { EchoView } from './echoView.type';
2
+ /**
3
+ * @internal
4
+ * Sets the EchoView instance. This function is primarily intended for internal framework use and testing.
5
+ *
6
+ * @param echoView - The EchoView instance to set
7
+ */
2
8
  export declare function setEchoView(echoView: EchoView): void;
9
+ /**
10
+ * @internal
11
+ * Sets the EchoView instance. This function is primarily intended for internal framework use and testing.
12
+ *
13
+ * Clears the current echo view instance and resets access keys.
14
+ *
15
+ * This function performs cleanup by setting the echo view instance to undefined
16
+ * and clearing the first access keys array. This is typically called when
17
+ * reinitializing or shutting down the echo view system.
18
+ */
3
19
  export declare function clearEchoView(): void;
20
+ /**
21
+ * @deprecated Use echoViewServiceAPI.get instead.
22
+ *
23
+ * Gets the current EchoView instance.
24
+ *
25
+ * @returns The current EchoView instance if available, undefined otherwise
26
+ */
4
27
  export declare function echoViewService(): EchoView | undefined;
28
+ /**
29
+ * Marks that an application has accessed the echoViewService data for the first time in the current session.
30
+ * Remote apps can use this to track whether they have already loaded data from echoViewService
31
+ * or if this is their first access after navigation.
32
+ *
33
+ * @param appKey - The unique identifier for the application (e.g., 'echo3d')
34
+ */
35
+ declare function markFirstAccessByKey(appKey: string): void;
36
+ /**
37
+ * Checks if an application has accessed the echoViewService data before in the current session.
38
+ * Allows remote apps to differentiate between their first data access and subsequent accesses.
39
+ *
40
+ * @param appKey - The unique identifier for the application to check
41
+ * @returns `true` if the application has accessed the data before, `false` otherwise
42
+ */
43
+ declare function hasBeenAccessedByKey(appKey: string): boolean;
44
+ /**
45
+ * EchoView Service API
46
+ *
47
+ * Provides methods to manage the EchoView instance and track application data access.
48
+ *
49
+ * @example
50
+ * ```typescript
51
+ * // Set the EchoView instance
52
+ * echoViewServiceAPI.set(myEchoView);
53
+ *
54
+ * // Get the current instance
55
+ * const view = echoViewServiceAPI.get();
56
+ *
57
+ * // Track first access
58
+ * if (!echoViewServiceAPI.hasBeenAccessedByKey('echo3d')) {
59
+ * // First time accessing data
60
+ * loadInitialData();
61
+ * echoViewServiceAPI.markFirstAccessByKey('echo3d');
62
+ * }
63
+ * ```
64
+ */
65
+ export declare const echoViewServiceAPI: Readonly<{
66
+ /** Gets the current EchoView instance */
67
+ get: () => EchoView | undefined;
68
+ /** Marks that an application has accessed the echoViewService data for the first time */
69
+ markFirstAccessByKey: typeof markFirstAccessByKey;
70
+ /** Checks if an application has accessed the echoViewService data before in the current session */
71
+ hasBeenAccessedByKey: typeof hasBeenAccessedByKey;
72
+ }>;
73
+ export {};