@equinor/echo-framework 0.11.0-rc13 → 0.11.0-rc15

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.
Files changed (44) hide show
  1. package/dist/__tests__/3dButtonUtils.test.d.ts +1 -0
  2. package/dist/components/contextualAppLinks/externalLinkButtons/trainingCenterForValvesMenu.d.ts +7 -0
  3. package/dist/components/echo3DButton/3dButtonUtils.d.ts +12 -0
  4. package/dist/components/echo3DButton/OpenIn3dDropdown.d.ts +11 -0
  5. package/dist/components/echo3DButton/echo3DButton.d.ts +18 -0
  6. package/dist/components/echo3DButton/echo3DIconButton.d.ts +26 -0
  7. package/dist/components/echo3DButton/icons/E3DWebBetaIcon.d.ts +6 -0
  8. package/dist/components/echo3DButton/index.d.ts +2 -0
  9. package/dist/components/echo3DButton/missingEcho3dAccessDialog.d.ts +8 -0
  10. package/dist/components/echo3DButton/plantNotAvailableInfo.d.ts +6 -0
  11. package/dist/components/echo3DButton/useGetOpenIn3d.d.ts +5 -0
  12. package/dist/components/echo3DButton/useGoToEcho3DWebLink.d.ts +1 -0
  13. package/dist/components/index.d.ts +2 -1
  14. package/dist/components/prepview/common/index.d.ts +1 -0
  15. package/dist/components/prepview/common/info/section/longText/LongTextSection.d.ts +1 -1
  16. package/dist/components/prepview/common/link/Link.d.ts +7 -0
  17. package/dist/components/prepview/workorder/header/{Header.d.ts → WorkOrderHeader.d.ts} +3 -3
  18. package/dist/components/prepview/workorder/header/index.d.ts +1 -1
  19. package/dist/components/tagNumber/tagNumber.d.ts +3 -2
  20. package/dist/coreApplication/EchoToolBar.d.ts +11 -2
  21. package/dist/coreApplication/EchoUserInterfaceStore.d.ts +4 -0
  22. package/dist/hooks/index.d.ts +3 -0
  23. package/dist/hooks/useHas3dAccess.d.ts +1 -0
  24. package/dist/hooks/usePlantAvailableIn3d.d.ts +1 -0
  25. package/dist/hooks/usePlantAvailableIn3dWeb.d.ts +1 -0
  26. package/dist/index.css +1 -1
  27. package/dist/index.d.ts +24 -0
  28. package/dist/index.js +11 -11
  29. package/dist/services/componentRegistry/componentRegistry.d.ts +26 -6
  30. package/dist/services/deviceInformation/deepDeviceInfo.d.ts +41 -0
  31. package/dist/services/deviceInformation/deviceInfo.d.ts +45 -0
  32. package/dist/services/searchItemDetails/searchItemDetails.store.d.ts +26 -0
  33. package/dist/services/searchItemDetails/searchItemDetails.store.test.d.ts +1 -0
  34. package/dist/services/searchItemDetails/searchItemDetailsContainer.d.ts +6 -0
  35. package/dist/theme/themeConst.d.ts +1 -0
  36. package/dist/types/device.d.ts +53 -0
  37. package/dist/types/eventTypes/index.d.ts +1 -0
  38. package/dist/types/eventTypes/searchDetailsContainerEvents.d.ts +3 -0
  39. package/dist/types/hookLibrary.d.ts +18 -3
  40. package/dist/utils/arrayUtils.d.ts +8 -0
  41. package/dist/utils/arrayUtils.test.d.ts +1 -0
  42. package/dist/utils/tagUtils.d.ts +23 -0
  43. package/dist/utils/tagUtils.test.d.ts +1 -0
  44. package/package.json +7 -5
@@ -1,14 +1,34 @@
1
1
  /// <reference types="react" />
2
2
  type AnyComponentType = React.FC<any>;
3
- interface ComponentRegistry {
3
+ export declare enum RegisteredComponentName {
4
+ /** @deprecated Please use 'TagListItem' instead - that supports the new search flow */
5
+ TagItem = "TagItem",
6
+ TagListItem = "TagListItem"
7
+ }
8
+ export declare const componentRegistry: Readonly<{
9
+ /**
10
+ * Should be only used by EchopediaWeb, when bootstrapping Echo app.
11
+ * Use this method to register a legacy component from Echopedia to EchoFramework, so it's available for others to use.
12
+ * Originally created to make tightly coupled components available until they are properly refactored and decoupled.
13
+ * @param {RegisteredComponentName} name The component will be assigned to this key.
14
+ * @param {React.FC<any>} component The component which should be registered.
15
+ */
4
16
  registerComponent: ({ name, component }: {
5
17
  name: RegisteredComponentName;
6
18
  component: AnyComponentType;
7
19
  }) => void;
20
+ /**
21
+ * @deprecated Please use 'getTagListItem()' instead - that supports the new search flow
22
+ * Returns with the TagItem component, which is used in EchopediaWeb's search panel
23
+ * and pdf side drawer when listing out tags.
24
+ * @returns {React.FC<any>}
25
+ */
8
26
  getTagItem: () => AnyComponentType;
9
- }
10
- export declare enum RegisteredComponentName {
11
- TagItem = "TagItem"
12
- }
13
- export declare const componentRegistry: ComponentRegistry;
27
+ /**
28
+ * Returns with the TagItem component, which is used in EchopediaWeb's search panel
29
+ * and pdf side drawer when listing out tags.
30
+ * @returns {React.FC<any>}
31
+ */
32
+ getTagListItem: () => AnyComponentType;
33
+ }>;
14
34
  export {};
@@ -0,0 +1,41 @@
1
+ /// <reference types="user-agent-data-types" />
2
+ import UAParser from 'ua-parser-js';
3
+ import { DetailedDeviceInformation } from '../../types/device';
4
+ /**
5
+ * This object is concerned with gathering and holding information about the users device.
6
+ * This object will be read-only after initialization and should as a rule throw errors if the
7
+ * deviceInformation property is altered after intialization.
8
+ */
9
+ declare class DetailedDeviceInformationProvider {
10
+ /** Represents the user agent string parser.
11
+ * This method is treated as a fallback if the User-Agent Client Hints API does not provide a coherent value
12
+ * or if the browser does not yet support it.
13
+ */
14
+ private readonly _uaParser;
15
+ /**
16
+ * Stores the system report from a call to the underlying system.
17
+ * - If this is undefined, it is not yet initialized (it happens asynchronously).
18
+ */
19
+ private readonly _uaDataValues;
20
+ /** Holds the current device information and should be the single source of truth.
21
+ *
22
+ * It can be undefined because we have to asynchronously fetch underlying system information.
23
+ */
24
+ private readonly _deviceInformation;
25
+ private constructor();
26
+ get deviceInformation(): DetailedDeviceInformation;
27
+ get uaDataValues(): UADataValues | null | undefined;
28
+ get uaParser(): UAParser.UAParserInstance;
29
+ /** Constructs the parser and returns it. */
30
+ static initialize(): DetailedDeviceInformationProvider;
31
+ private static getPlatform;
32
+ private static getWebBrowser;
33
+ private static getOperatingSystem;
34
+ /**
35
+ * TODO: Get the device model from Client Hints API.
36
+ * This requires top-level await support, which in turn has to be implemented to modules downstream.
37
+ */
38
+ private static getDeviceModel;
39
+ }
40
+ declare const detailedDeviceInformationProvider: DetailedDeviceInformationProvider;
41
+ export { DetailedDeviceInformationProvider, detailedDeviceInformationProvider };
@@ -0,0 +1,45 @@
1
+ import { Browser, DetailedDeviceInformation, DeviceType, IDeviceSummary, ScreenDimensions, ScreenOrientation, UserInput } from '../../types/device';
2
+ import { detailedDeviceInformationProvider } from './deepDeviceInfo';
3
+ type Props = {
4
+ detailedDeviceInfo: typeof detailedDeviceInformationProvider;
5
+ };
6
+ declare class DeviceInformation {
7
+ /**
8
+ * Represents the current viewport orientation.
9
+ * If the viewport is square, it will default to portrait.
10
+ */
11
+ private _orientation;
12
+ /**
13
+ * Represents an abstracted device type: desktop, tablet or mobile.
14
+ */
15
+ private readonly _deviceType;
16
+ /**
17
+ * Represents the current input source.
18
+ * Note: On a touchscreen device which has a mouse plugged in, it will return the mouse.
19
+ */
20
+ private readonly _userInput;
21
+ private readonly _browser?;
22
+ /**
23
+ * Represents the viewport (layout and visual) and (full)screen dimensions.
24
+ * WebKit browsers prior to 15 will only support layout dimensions.
25
+ */
26
+ private _dimensions;
27
+ protected orientationIsLandscapeQuery: MediaQueryList;
28
+ private _detailedDeviceInfo;
29
+ constructor(props: Props);
30
+ private getUpdatedScreenDimensions;
31
+ private getBrowser;
32
+ private getUserInput;
33
+ /** Returns the current viewing medium.*/
34
+ private getDeviceType;
35
+ private getOrientation;
36
+ getDeviceDetails(): DetailedDeviceInformation;
37
+ get orientation(): ScreenOrientation;
38
+ get deviceType(): DeviceType;
39
+ get userInput(): UserInput;
40
+ get screenDimensions(): ScreenDimensions;
41
+ get browser(): Browser | undefined;
42
+ getDeviceSummary(): IDeviceSummary;
43
+ }
44
+ declare const deviceInfo: DeviceInformation;
45
+ export { deviceInfo, DeviceInformation };
@@ -0,0 +1,26 @@
1
+ import { ReactNode } from 'react';
2
+ export declare const useSearchItemDetailsStore: import("zustand").UseBoundStore<Omit<import("zustand").StoreApi<SearchItemDetailsState>, "setState"> & {
3
+ setState(nextStateOrUpdater: SearchItemDetailsState | Partial<SearchItemDetailsState> | ((state: import("immer/dist/internal").WritableDraft<SearchItemDetailsState>) => void), shouldReplace?: boolean | undefined): void;
4
+ }>;
5
+ export type SearchItemDetailsObject = {
6
+ content: ReactNode;
7
+ header?: ReactNode;
8
+ subHeader?: ReactNode;
9
+ isOpen: boolean;
10
+ };
11
+ export type SearchItemDetailsState = {
12
+ actions: {
13
+ showDetails: (args: ShowDetailsArgs) => void;
14
+ hideDetails: (panelKey: string) => void;
15
+ clearItemsByPanelKey: (panelKey: string) => void;
16
+ };
17
+ items: Record<string, SearchItemDetailsObject[]>;
18
+ };
19
+ type ShowDetailsArgs = {
20
+ panelKey: string;
21
+ content: ReactNode;
22
+ header?: ReactNode;
23
+ subHeader?: ReactNode;
24
+ replaceLastNavigationItem?: boolean;
25
+ };
26
+ export {};
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ interface SearchItemDetailsContainerProps {
3
+ onSearchDetailsClose?: (panelKey: string) => void;
4
+ }
5
+ export declare const SearchItemDetailsContainer: React.FC<SearchItemDetailsContainerProps>;
6
+ export {};
@@ -47,4 +47,5 @@ export declare const themeConst: {
47
47
  defaultSeverity: string;
48
48
  toggleActive: string;
49
49
  toggleInactive: string;
50
+ dividerColor: string;
50
51
  };
@@ -0,0 +1,53 @@
1
+ export type SupportedPlatforms = 'Android' | 'Linux' | 'MacOs' | 'iOS' | 'iPadOS' | 'Windows' | 'Platform not found.';
2
+ export type DetailedDeviceInformation = {
3
+ operatingSystem: string;
4
+ webBrowser: string;
5
+ deviceModel: string;
6
+ platform?: SupportedPlatforms;
7
+ };
8
+ export type IDeepDeviceInformation = {
9
+ operatingSystem: string;
10
+ webBrowser: string;
11
+ deviceModel: string;
12
+ platform?: SupportedPlatforms;
13
+ };
14
+ /** If the viewport is a square, then the orientation will be portrait. */
15
+ export type ScreenOrientation = 'portrait' | 'landscape';
16
+ /** Keep in mind, this is calculated when the page loads, so be sure to do refresh if simulating a device in DevTools. */
17
+ export type DeviceType = 'mobile' | 'tablet' | 'desktop';
18
+ export type UserInput = 'touch' | 'mouse';
19
+ export type Browser = 'Chrome' | 'Safari' | 'Firefox' | 'Edge' | 'Opera';
20
+ type Dimensions = {
21
+ width: number;
22
+ height: number;
23
+ };
24
+ export type ScreenDimensions = {
25
+ /** Provides measurements for use in the visual viewport.
26
+ *
27
+ * The visual viewport is the currently visible viewport and these dimensions
28
+ * can be smaller than the layout viewport if, for example, the user has pinch zoomed or summoned their
29
+ * on-screen keyboards.
30
+ */
31
+ visual: Dimensions;
32
+ /**
33
+ * Provides measurements for the layout viewport. These values are always fetched from
34
+ * innerHeight and innerWidth, so scrollbars are included.
35
+ */
36
+ layout?: Dimensions;
37
+ /** Provides measurements for use in fullscreen contexts. */
38
+ fullscreen?: FullscreenDimensions;
39
+ };
40
+ export type FullscreenDimensions = {
41
+ /** The total screen dimensions, essentially equal to the screen resolution configured in OS settings.*/
42
+ total: Dimensions;
43
+ /** The available screen dimensions, taking into account overlays such as browser address bar or virtual keyboard. */
44
+ available: Dimensions;
45
+ };
46
+ export interface IDeviceSummary {
47
+ orientation: ScreenOrientation;
48
+ deviceType: DeviceType;
49
+ userInput: UserInput;
50
+ screenDimensions: ScreenDimensions;
51
+ deepInfo: IDeepDeviceInformation;
52
+ }
53
+ export {};
@@ -1,3 +1,4 @@
1
1
  export type { LegendChangedEvent } from './legendEvent';
2
2
  export type { PlantEvent } from './plantEvent';
3
+ export type { SearchItemDetailsClosedEvent } from './searchDetailsContainerEvents';
3
4
  export type { ToasterEvent } from './toasterEvent';
@@ -0,0 +1,3 @@
1
+ export interface SearchItemDetailsClosedEvent {
2
+ panelKey: string;
3
+ }
@@ -1,5 +1,20 @@
1
- export type SetActiveTagNo = (tagNo: string, activeTagTab?: string, activeTagSubTab?: string, instCode?: string) => void;
1
+ export type SetActiveTagNo = (argsORtagNo: string | {
2
+ tagNo: string;
3
+ activeTagTab?: string;
4
+ activeTagSubTab?: string;
5
+ instCode?: string;
6
+ activePanelKey?: string;
7
+ replaceLastNavigationItem?: boolean;
8
+ }, activeTagTab?: string, activeTagSubTab?: string, instCode?: string) => void;
2
9
  export type TagData = [(tagNo: string, instCode: string) => void];
3
- export type SetActiveCommPackNo = (commPackNo: string, activeCommPackProject: string, activeCommPackTab?: string, activeCommPackSubTab?: string) => void;
4
- export type SetActiveMcPackNo = (mcPackNo: string, activeMcPackProject: string, activeMcPackTab?: string, activeMcPackSubTab?: string) => void;
10
+ export type SetActiveCommPackNo = (argsORcommPackNo: string | {
11
+ commPackNo: string;
12
+ activeCommPackProject: string;
13
+ activePanelKey?: string;
14
+ }, activeCommPackProject?: string) => void;
15
+ export type SetActiveMcPackNo = (argsORmcPackNo: string | {
16
+ mcPackNo: string;
17
+ activeMcPackProject: string;
18
+ activePanelKey?: string;
19
+ }, activeMcPackProject?: string) => void;
5
20
  export type ScreenOrientation = 'landscape' | 'portrait' | undefined;
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Function for creating a range between two numbers
3
+ * @export
4
+ * @param {number} start: The starting point of the range.
5
+ * @param {number} end: The end point of the range.
6
+ * @return {*} {number[]}
7
+ */
8
+ export declare function range(start: number, end: number): number[];
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,23 @@
1
+ import { TagDetailsDto } from '@equinor/echo-search';
2
+ /**
3
+ * Function for getting the echoUrl based on tag details
4
+ * Returns the url if found, builds and returns an url if plantCode and tagNo is found
5
+ * Otherwise - returns empty string
6
+ * @param {(TagDetailsDto | undefined)} tagDetails
7
+ * @return {*} {string}
8
+ */
9
+ export declare function getEcho3DAppUrlForTag(tagDetails: TagDetailsDto | undefined): Promise<string>;
10
+ /**
11
+ * Function for getting Plant Code based on Tag Details data
12
+ * Returns the plant Code if found, returns empty string otherwise.
13
+ * @param {TagDetailsDto} tagDetails
14
+ * @returns {*} {string}
15
+ */
16
+ export declare function getPlantCodeForTag(tagDetails: TagDetailsDto): Promise<string>;
17
+ /**
18
+ * Function for getting plant project description based on Tag Details
19
+ * Returns the plant project description if found, otherwise, return empty string.
20
+ * @param {TagDetailsDto} tagDetails
21
+ * @returns {*} {string}
22
+ */
23
+ export declare function getProjectDescriptionForTag(tagDetails: TagDetailsDto): Promise<string>;
@@ -0,0 +1 @@
1
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@equinor/echo-framework",
3
- "version": "0.11.0-rc13",
3
+ "version": "0.11.0-rc15",
4
4
  "description": "Modules and components for EchoWeb, utilizing EchoCore",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -38,7 +38,7 @@
38
38
  "peerDependencies": {
39
39
  "@equinor/echo-base": ">=0.6.12 < 0.7.0",
40
40
  "@equinor/echo-components": ">=0.5.0 < 0.6.0",
41
- "@equinor/echo-core": ">=0.6.20 < 0.8.0",
41
+ "@equinor/echo-core": ">=0.7.5 < 0.8.0",
42
42
  "@equinor/echo-search": ">=0.13.2 < 0.14.0",
43
43
  "@equinor/echo-utils": ">=0.2.12 < 0.3.0",
44
44
  "@equinor/eds-core-react": "^0.25.0",
@@ -53,9 +53,9 @@
53
53
  "@babel/preset-react": "^7.18.6",
54
54
  "@equinor/echo-base": "^0.6.22",
55
55
  "@equinor/echo-components": "^0.5.19",
56
- "@equinor/echo-core": "^0.7.3",
56
+ "@equinor/echo-core": "^0.7.5",
57
57
  "@equinor/echo-scripts": "^0.1.5",
58
- "@equinor/echo-search": "^0.13.11",
58
+ "@equinor/echo-search": "^0.13.13",
59
59
  "@equinor/echo-update": "^1.3.1",
60
60
  "@equinor/echo-utils": "^0.2.12",
61
61
  "@equinor/eds-core-react": "^0.25.0",
@@ -105,7 +105,8 @@
105
105
  "styled-components": "^5.3.6",
106
106
  "ts-jest": "^29.0.5",
107
107
  "tslib": "^2.4.1",
108
- "typescript": "=4.9.4"
108
+ "typescript": "=4.9.4",
109
+ "user-agent-data-types": "^0.3.0"
109
110
  },
110
111
  "compilerOptions": {
111
112
  "declaration": true
@@ -119,6 +120,7 @@
119
120
  },
120
121
  "dependencies": {
121
122
  "@microsoft/signalr": "^6.0.13",
123
+ "immer": "^9.0.19",
122
124
  "zustand": "^4.3.2"
123
125
  }
124
126
  }