@equinor/echo-framework 0.18.11 → 0.19.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.
Files changed (31) hide show
  1. package/index.cjs.js +1 -1
  2. package/package.json +3 -2
  3. package/src/index.d.ts +2 -8
  4. package/src/lib/components/index.d.ts +1 -1
  5. package/src/lib/components/panel/panelNavigation.helper.d.ts +2 -2
  6. package/src/lib/components/prepview/Prepview.d.ts +2 -2
  7. package/src/lib/components/prepviewButton/prepviewButton.d.ts +1 -0
  8. package/src/lib/feature/measuringPoint/components/measuringPointDetails/api/api-documentRelationships.d.ts +4 -0
  9. package/src/lib/feature/measuringPoint/components/measuringPointDetails/labelledImageList.d.ts +10 -0
  10. package/src/lib/feature/measuringPoint/components/measuringPointDetails/measuringPointImageList.d.ts +5 -0
  11. package/src/lib/feature/measuringPoint/components/measuringPointDetails/mediaItemView/MeasuringPointImageView.d.ts +15 -0
  12. package/src/lib/feature/measuringPoint/components/measuringPointDetails/mediaItemView/MeasuringPointImageViewFooter.d.ts +7 -0
  13. package/src/lib/feature/measuringPoint/components/measuringPointDetails/mediaItemView/MeasuringPointImageViewMedia.d.ts +10 -0
  14. package/src/lib/feature/measuringPoint/components/measuringPointItem.d.ts +1 -1
  15. package/src/lib/feature/measuringPoint/hooks/useDocumentRelationships.d.ts +6 -0
  16. package/src/lib/feature/measuringPoint/types/documentRelationships.d.ts +18 -0
  17. package/src/lib/services/leftPanelNavigation/index.d.ts +2 -0
  18. package/src/lib/services/leftPanelNavigation/leftPanelNavigation.store.d.ts +13 -0
  19. package/src/lib/services/leftPanelNavigation/leftPanelNavigation.store.types.d.ts +21 -0
  20. package/src/lib/services/leftPanelNavigation/leftPanelNavigationContainer.d.ts +7 -0
  21. package/src/lib/services/leftPanelNavigation/leftPanelNavigationSideSheet.d.ts +7 -0
  22. package/src/lib/types/eventTypes/index.d.ts +0 -1
  23. package/src/lib/types/eventTypes/prepviewEvent.d.ts +1 -0
  24. package/src/lib/types/searchItemDetailsType.d.ts +1 -1
  25. package/src/lib/utils/previousUtils.d.ts +3 -3
  26. package/src/lib/components/prepviewButton/index.d.ts +0 -1
  27. package/src/lib/services/searchItemDetails/searchItemDetails.store.d.ts +0 -31
  28. package/src/lib/services/searchItemDetails/searchItemDetailsContainer.d.ts +0 -7
  29. package/src/lib/services/searchItemDetails/searchItemDetailsSideSheet.d.ts +0 -7
  30. package/src/lib/types/eventTypes/leftPanelNavigationUpdateEvent.d.ts +0 -5
  31. /package/src/lib/services/{searchItemDetails → leftPanelNavigation}/previous.d.ts +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@equinor/echo-framework",
3
- "version": "0.18.11",
3
+ "version": "0.19.0",
4
4
  "peerDependencies": {
5
5
  "@equinor/echo-base": ">= 0.7.0 < 0.8.0",
6
6
  "@equinor/echo-components": ">= 0.11.0 < 0.12.0",
@@ -17,7 +17,8 @@
17
17
  "history": "5.3.0",
18
18
  "lodash": "4.17.21",
19
19
  "react-router-dom": "5.3.4",
20
- "zustand": ">= 4.4.7 < 5"
20
+ "zustand": ">= 4.4.7 < 5",
21
+ "react-swipeable": "7.0.1"
21
22
  },
22
23
  "main": "./index.cjs.js",
23
24
  "type": "commonjs"
package/src/index.d.ts CHANGED
@@ -22,8 +22,7 @@ export * from './lib/services/activeSelectionStore';
22
22
  export { getPlantsCachedOrApi, getPlantsFromApi } from './lib/services/api/api-plants';
23
23
  export { RegisteredComponentName } from './lib/services/componentRegistry/componentRegistry';
24
24
  export * from './lib/services/eventHubActions';
25
- export * from './lib/services/searchItemDetails/searchItemDetails.store';
26
- export { SearchItemDetailsSideSheet } from './lib/services/searchItemDetails/searchItemDetailsSideSheet';
25
+ export * from './lib/services/leftPanelNavigation';
27
26
  export * from './lib/theme/themeConst';
28
27
  export * from './lib/types/api-echohub';
29
28
  export type { EchoHubPlant } from './lib/types/echoHubPlant';
@@ -34,7 +33,7 @@ export type { SetActiveTagNo, TagData } from './lib/types/hookLibrary';
34
33
  export type { ModelPermissions } from './lib/types/modelPermissions';
35
34
  export { InternalApplicationLinks } from './lib/types/navigation/internalApplicationLinks';
36
35
  export { PingableSources } from './lib/types/pingableSources';
37
- export { searchItemDetailsType } from './lib/types/searchItemDetailsType';
36
+ export { SearchItemDetailsType as searchItemDetailsType } from './lib/types/searchItemDetailsType';
38
37
  export * from './lib/utils';
39
38
  export { convertPathNameToReadableString } from './lib/utils/moduleNameUtils';
40
39
  export * from './lib/utils/startup';
@@ -60,11 +59,6 @@ declare const EchoFramework: Readonly<{
60
59
  }>;
61
60
  }>;
62
61
  Hooks: Readonly<{
63
- searchItems: Readonly<{
64
- useSearchItemDetailsStore: import("zustand").UseBoundStore<Omit<import("zustand").StoreApi<unknown>, "setState"> & {
65
- setState(nextStateOrUpdater: unknown, shouldReplace?: boolean | undefined): void;
66
- }>;
67
- }>;
68
62
  useEchoHistory(): (path: string, params?: {
69
63
  [key: string]: string;
70
64
  } | undefined, state?: any) => void;
@@ -20,7 +20,7 @@ export * from './panel';
20
20
  export * from './panelButton';
21
21
  export * from './plantSelector';
22
22
  export * from './prepview';
23
- export * from './prepviewButton';
23
+ export * from './prepviewButton/prepviewButton';
24
24
  export * from './projectSelector';
25
25
  export * from './realTimeData';
26
26
  export * from './router';
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { SearchItemDetailsObject } from '../../services/searchItemDetails/searchItemDetails.store';
2
+ import { LeftPanelNavigationContent } from '../../services/leftPanelNavigation/leftPanelNavigation.store.types';
3
3
  /**
4
4
  * Hook for support the search panel navigation: it supports the "breadcumb" functionality, where the currently open item
5
5
  * needs to refer back to the previous one.
@@ -10,5 +10,5 @@ import { SearchItemDetailsObject } from '../../services/searchItemDetails/search
10
10
  */
11
11
  export declare const useLeftPanelNavigation: () => {
12
12
  previousButton: React.ReactNode;
13
- activeSearchItem: SearchItemDetailsObject | undefined;
13
+ activeSearchItem: LeftPanelNavigationContent | undefined;
14
14
  };
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import { ColorMap, SideSheetOrientation, WorkOrderDateType } from '@equinor/echo-components';
3
- import { WorkItemType } from './utils';
4
3
  import { HistoricNotificationItem, HistoricPunchItem, HistoricWorkOrderItem, ItemTypes } from './types';
4
+ import { WorkItemType } from './utils';
5
5
  interface PrepviewProps {
6
6
  orientation: SideSheetOrientation;
7
7
  instCode?: string;
@@ -17,6 +17,6 @@ interface PrepviewProps {
17
17
  workOrderDateType?: WorkOrderDateType;
18
18
  }
19
19
  declare function Prepview(props: PrepviewProps): JSX.Element | null;
20
- export { MaintenanceApiNameForWorkOrders, WorkItemType } from './utils';
21
20
  export * from './types/shared';
21
+ export { MaintenanceApiNameForWorkOrders, WorkItemType } from './utils';
22
22
  export { Prepview };
@@ -3,5 +3,6 @@ export interface PrepviewButtonProps {
3
3
  workOrderId?: string | undefined;
4
4
  notificationId?: string | undefined;
5
5
  punchId?: string | undefined;
6
+ instCode?: string | undefined;
6
7
  }
7
8
  export declare const PrepviewButton: React.FC<PrepviewButtonProps>;
@@ -0,0 +1,4 @@
1
+ import { DocumentRelationships } from '../../../types/documentRelationships';
2
+ export declare function getDocumentRelationshipsFromApi(args: {
3
+ measuringPointId: string;
4
+ }): Promise<DocumentRelationships[]>;
@@ -0,0 +1,10 @@
1
+ import { DocumentRelationships } from '../../types/documentRelationships';
2
+ interface LabelledImageListProps {
3
+ documentId: string;
4
+ createdDateTime: string;
5
+ imageSrc: string;
6
+ documentRelationships: DocumentRelationships[];
7
+ imageIndex: number;
8
+ }
9
+ export declare const LabelledImageList: ({ documentId, createdDateTime, imageSrc, documentRelationships, imageIndex }: LabelledImageListProps) => import("react/jsx-runtime").JSX.Element;
10
+ export {};
@@ -0,0 +1,5 @@
1
+ interface MeasuringPointImageListProps {
2
+ measuringPointId: string;
3
+ }
4
+ export declare const MeasuringPointImageList: ({ measuringPointId }: MeasuringPointImageListProps) => import("react/jsx-runtime").JSX.Element | import("react/jsx-runtime").JSX.Element[];
5
+ export {};
@@ -0,0 +1,15 @@
1
+ import React from 'react';
2
+ interface MeasuringPointImageViewProps {
3
+ title: string;
4
+ date: string;
5
+ triggerScrim: () => void;
6
+ showPrevious: () => void;
7
+ showNext: () => void;
8
+ showPrevIcon: boolean;
9
+ showNextIcon: boolean;
10
+ imageSrc: string;
11
+ description?: string;
12
+ open: boolean;
13
+ }
14
+ export declare const MeasuringPointImageView: React.FC<React.PropsWithChildren<MeasuringPointImageViewProps>>;
15
+ export {};
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ interface MeasuringPointImageViewFooterProps {
3
+ date: string;
4
+ description?: string;
5
+ }
6
+ export declare const MeasuringPointImageViewFooter: React.FC<MeasuringPointImageViewFooterProps>;
7
+ export {};
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ interface MeasuringPointImageViewMediaProps {
3
+ imageSrc: string;
4
+ showPrevious: () => void;
5
+ showNext: () => void;
6
+ showNextIcon: boolean;
7
+ showPrevIcon: boolean;
8
+ }
9
+ export declare const MeasuringPointImageViewMedia: React.FC<React.PropsWithChildren<MeasuringPointImageViewMediaProps>>;
10
+ export {};
@@ -7,7 +7,7 @@ interface MeasuringPointItemProps {
7
7
  }
8
8
  /**
9
9
  * Component for displaying measuring point item.
10
- * Displays information about the condition of the measuring point, as well as the last recorded measurement.
10
+ * Displays information about the condition of the measuring point, as well as the last reported measurement.
11
11
  * @param {MeasuringPointItemProps}
12
12
  * @returns {*}
13
13
  */
@@ -0,0 +1,6 @@
1
+ export declare function useDocumentRelationships(measuringPointId: string): {
2
+ status: "error" | "success" | "pending";
3
+ documentRelationships: import("../types/documentRelationships").DocumentRelationships[];
4
+ error: Error | null;
5
+ totalAttachments: string;
6
+ };
@@ -0,0 +1,18 @@
1
+ export interface DocumentRelationships {
2
+ readonly documentId: string;
3
+ readonly characteristics?: DocumentRelationshipsCharacteristics[];
4
+ readonly attachments?: DocumentRelationshipsAttachment[];
5
+ }
6
+ interface DocumentRelationshipsAttachment {
7
+ readonly attachmentId: string;
8
+ readonly attachmentImageUri?: string;
9
+ readonly createdDateTime?: string;
10
+ readonly _links?: DocumentRelationshipsLinks;
11
+ }
12
+ interface DocumentRelationshipsCharacteristics {
13
+ readonly valueId?: string;
14
+ }
15
+ interface DocumentRelationshipsLinks {
16
+ readonly enclosure?: string;
17
+ }
18
+ export {};
@@ -0,0 +1,2 @@
1
+ export { getLeftPanelNavigationState } from './leftPanelNavigation.store';
2
+ export * from './leftPanelNavigation.store.types';
@@ -0,0 +1,13 @@
1
+ import { LeftPanelNavigationStore } from './leftPanelNavigation.store.types';
2
+ export declare const useLeftPanelNavigationStore: import("zustand").UseBoundStore<Omit<Omit<import("zustand").StoreApi<unknown>, "subscribe"> & {
3
+ subscribe: {
4
+ (listener: (selectedState: unknown, previousSelectedState: unknown) => void): () => void;
5
+ <U>(selector: (state: unknown) => U, listener: (selectedState: U, previousSelectedState: U) => void, options?: {
6
+ equalityFn?: ((a: U, b: U) => boolean) | undefined;
7
+ fireImmediately?: boolean | undefined;
8
+ } | undefined): () => void;
9
+ };
10
+ }, "setState"> & {
11
+ setState(nextStateOrUpdater: unknown, shouldReplace?: boolean | undefined): void;
12
+ }>;
13
+ export declare function getLeftPanelNavigationState(): LeftPanelNavigationStore;
@@ -0,0 +1,21 @@
1
+ import { ReactNode } from 'react';
2
+ export type LeftPanelNavigationContent = {
3
+ content: ReactNode;
4
+ header?: ReactNode;
5
+ subHeader?: ReactNode;
6
+ itemId?: string;
7
+ isOpen: boolean;
8
+ };
9
+ export interface LeftPanelNavigationStore {
10
+ addContent: (args: {
11
+ panelKey: string;
12
+ content: ReactNode;
13
+ header?: ReactNode;
14
+ subHeader?: ReactNode;
15
+ keepLastNavigationItem?: boolean;
16
+ itemId?: string;
17
+ }) => void;
18
+ removeLastContentByPanelKey: (panelKey: string) => void;
19
+ clearItemsByPanelKey: (panelKey: string) => void;
20
+ items: Record<string, LeftPanelNavigationContent[]>;
21
+ }
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ import { LeftPanelNavigationContent } from './leftPanelNavigation.store.types';
3
+ interface LeftPanelNavigationItemContainerProps {
4
+ itemToDisplay: LeftPanelNavigationContent;
5
+ }
6
+ export declare const LeftPanelNavigationItemContainer: React.FC<LeftPanelNavigationItemContainerProps>;
7
+ export {};
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ import { LeftPanelNavigationContent } from './leftPanelNavigation.store.types';
3
+ interface LeftPanelNavigationSideSheetProps {
4
+ itemToDisplay: LeftPanelNavigationContent | undefined;
5
+ }
6
+ export declare const LeftPanelNavigationSideSheet: React.FC<LeftPanelNavigationSideSheetProps>;
7
+ export {};
@@ -1,5 +1,4 @@
1
1
  export type { FullScreenModeEvent } from './fullScreenModeEvent';
2
- export type { LeftPanelNavigationUpdateEvent } from './leftPanelNavigationUpdateEvent';
3
2
  export type { LegendChangedEvent, LegendStatusesChangedEvent } from './legendEvent';
4
3
  export type { OnMainSearchTriggerEvent } from './onMainSearchTriggerEvent';
5
4
  export type { PlantEvent } from './plantEvent';
@@ -2,4 +2,5 @@ export interface PrepviewEvent {
2
2
  notificationId?: string;
3
3
  workOrderId?: string;
4
4
  punchId?: string;
5
+ instCode?: string;
5
6
  }
@@ -1,4 +1,4 @@
1
- export declare enum searchItemDetailsType {
1
+ export declare enum SearchItemDetailsType {
2
2
  Tag = "Tag",
3
3
  Document = "Document",
4
4
  Punch = "Punch",
@@ -1,15 +1,15 @@
1
1
  import { Panel } from '@equinor/echo-core';
2
- import { SearchItemDetailsObject } from '../services/searchItemDetails/searchItemDetails.store';
2
+ import { LeftPanelNavigationContent } from '../services/leftPanelNavigation';
3
3
  /**
4
4
  * Get the previous search item id or the previous active panel label
5
5
  *
6
6
  * @export
7
- * @param {SearchItemDetailsObject[]} openedSearchItems Opened search items
7
+ * @param {LeftPanelNavigationContent[]} openedSearchItems Opened search items
8
8
  * @param {Panel[]} modulePanels Module panels
9
9
  * @param {string} activePanelKey The active panel key
10
10
  * @return {*} {string} Returns the previous search item id or active panel label
11
11
  */
12
- export declare function getPreviousItemIdOrPanelTitle(openedSearchItems: SearchItemDetailsObject[], modulePanels: Panel[], activePanelKey: string): string;
12
+ export declare function getPreviousItemIdOrPanelTitle(openedSearchItems: LeftPanelNavigationContent[], modulePanels: Panel[], activePanelKey: string): string;
13
13
  /**
14
14
  * Get the active panel label
15
15
  *
@@ -1 +0,0 @@
1
- export * from './prepviewButton';
@@ -1,31 +0,0 @@
1
- import { ReactNode } from 'react';
2
- import { searchItemDetailsType } from '../../types/searchItemDetailsType';
3
- export declare const useSearchItemDetailsStore: import("zustand").UseBoundStore<Omit<import("zustand").StoreApi<unknown>, "setState"> & {
4
- setState(nextStateOrUpdater: unknown, shouldReplace?: boolean | undefined): void;
5
- }>;
6
- export type SearchItemDetailsObject = {
7
- content: ReactNode;
8
- header?: ReactNode;
9
- subHeader?: ReactNode;
10
- itemId: string;
11
- itemType: searchItemDetailsType;
12
- isOpen: boolean;
13
- };
14
- export type SearchItemDetailsState = {
15
- actions: {
16
- showDetails: (args: ShowDetailsArgs) => void;
17
- hideDetails: (panelKey: string) => void;
18
- clearItemsByPanelKey: (panelKey: string) => void;
19
- };
20
- items: Record<string, SearchItemDetailsObject[]>;
21
- };
22
- type ShowDetailsArgs = {
23
- panelKey: string;
24
- content: ReactNode;
25
- header?: ReactNode;
26
- subHeader?: ReactNode;
27
- keepLastNavigationItem?: boolean;
28
- itemId: string;
29
- itemType: searchItemDetailsType;
30
- };
31
- export {};
@@ -1,7 +0,0 @@
1
- import React from 'react';
2
- import { SearchItemDetailsObject } from './searchItemDetails.store';
3
- interface SearchItemDetailsContainerProps {
4
- itemToDisplay: SearchItemDetailsObject;
5
- }
6
- export declare const SearchItemDetailsContainer: React.FC<SearchItemDetailsContainerProps>;
7
- export {};
@@ -1,7 +0,0 @@
1
- import React from 'react';
2
- import { SearchItemDetailsObject } from './searchItemDetails.store';
3
- interface SearchItemDetailsSideSheetProps {
4
- itemToDisplay: SearchItemDetailsObject | undefined;
5
- }
6
- export declare const SearchItemDetailsSideSheet: React.FC<SearchItemDetailsSideSheetProps>;
7
- export {};
@@ -1,5 +0,0 @@
1
- export interface LeftPanelNavigationUpdateEvent {
2
- previousTitle?: string;
3
- onClick?: () => void;
4
- resetNavigation?: boolean;
5
- }