@equinor/subsurface-app-management 1.0.0 → 1.0.1

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 (104) hide show
  1. package/README.md +3 -4
  2. package/dist/esm/api/core/ApiError.js +1 -0
  3. package/dist/esm/api/core/CancelablePromise.js +1 -0
  4. package/dist/esm/api/core/OpenAPI.js +1 -0
  5. package/dist/esm/api/core/request.js +1 -0
  6. package/dist/esm/api/models/ServiceNowUrgency.js +1 -0
  7. package/dist/esm/api/models/TutorialPosition.js +1 -0
  8. package/dist/esm/api/services/PortalService.js +1 -0
  9. package/dist/esm/api/services/ReleaseNotesService.js +1 -0
  10. package/dist/esm/api/services/TutorialService.js +1 -0
  11. package/dist/esm/components/Feature/Feature.js +1 -0
  12. package/dist/esm/hooks/useFeatureToggling.js +1 -0
  13. package/dist/esm/hooks/useReleaseNotesQuery.js +1 -0
  14. package/dist/esm/hooks/useSignalRMessages.js +1 -0
  15. package/dist/esm/index.js +1 -0
  16. package/dist/esm/node_modules/@equinor/eds-tokens/dist/esm/base/clickbounds.js +1 -0
  17. package/dist/esm/node_modules/@equinor/eds-tokens/dist/esm/base/colors.js +1 -0
  18. package/dist/esm/node_modules/@equinor/eds-tokens/dist/esm/base/elevation.js +1 -0
  19. package/dist/esm/node_modules/@equinor/eds-tokens/dist/esm/base/index.js +1 -0
  20. package/dist/esm/node_modules/@equinor/eds-tokens/dist/esm/base/interactions.js +1 -0
  21. package/dist/esm/node_modules/@equinor/eds-tokens/dist/esm/base/shape.js +1 -0
  22. package/dist/esm/node_modules/@equinor/eds-tokens/dist/esm/base/spacings.js +1 -0
  23. package/dist/esm/node_modules/@equinor/eds-tokens/dist/esm/base/typography.js +1 -0
  24. package/dist/esm/providers/AuthProvider/AuthProvider.js +1 -0
  25. package/dist/esm/providers/AuthProvider/AuthProviderInner.js +1 -0
  26. package/dist/esm/providers/FeatureToggleProvider.js +1 -0
  27. package/dist/esm/providers/TutorialProvider/TutorialDialog.js +1 -0
  28. package/dist/esm/providers/TutorialProvider/TutorialProvider.const.js +1 -0
  29. package/dist/esm/providers/TutorialProvider/TutorialProvider.hooks.js +1 -0
  30. package/dist/esm/providers/TutorialProvider/TutorialProvider.js +1 -0
  31. package/dist/esm/providers/TutorialProvider/TutorialProvider.styles.js +67 -0
  32. package/dist/esm/providers/TutorialProvider/TutorialProvider.utils.js +1 -0
  33. package/dist/esm/providers/TutorialProvider/TutorialProviderInner.js +1 -0
  34. package/dist/esm/providers/TutorialProvider/TutorialStepIndicator.js +25 -0
  35. package/dist/esm/providers/TutorialStepsProvider.js +1 -0
  36. package/dist/esm/types/Environment.js +1 -0
  37. package/dist/esm/types/ReleaseNotes.js +1 -0
  38. package/dist/esm/utils/auth_environment.js +1 -0
  39. package/dist/esm/utils/localStorage.js +1 -0
  40. package/dist/types/api/core/ApiError.d.ts +10 -0
  41. package/dist/types/api/core/ApiRequestOptions.d.ts +13 -0
  42. package/dist/types/api/core/ApiResult.d.ts +7 -0
  43. package/dist/types/api/core/CancelablePromise.d.ts +26 -0
  44. package/dist/types/api/core/OpenAPI.d.ts +32 -0
  45. package/dist/types/api/core/request.d.ts +13 -0
  46. package/dist/types/api/index.d.ts +15 -0
  47. package/dist/types/api/models/AccessRole.d.ts +4 -0
  48. package/dist/types/api/models/Applications.d.ts +17 -0
  49. package/dist/types/api/models/CustomTutorialStep.d.ts +4 -0
  50. package/dist/types/api/models/Feature.d.ts +8 -0
  51. package/dist/types/api/models/FeatureToggleDto.d.ts +5 -0
  52. package/dist/types/api/models/GenericTutorialStep.d.ts +7 -0
  53. package/dist/types/api/models/GraphUser.d.ts +6 -0
  54. package/dist/types/api/models/ReleaseNote.d.ts +9 -0
  55. package/dist/types/api/models/ReleaseNotePatch.d.ts +8 -0
  56. package/dist/types/api/models/ServiceNowIncidentAttachmentResponse.d.ts +7 -0
  57. package/dist/types/api/models/ServiceNowIncidentResponse.d.ts +13 -0
  58. package/dist/types/api/models/ServiceNowUrgency.d.ts +5 -0
  59. package/dist/types/api/models/Tutorial.d.ts +13 -0
  60. package/dist/types/api/models/TutorialPosition.d.ts +7 -0
  61. package/dist/types/api/models/TutorialStepBase.d.ts +4 -0
  62. package/dist/types/api/services/PortalService.d.ts +35 -0
  63. package/dist/types/api/services/ReleaseNotesService.d.ts +28 -0
  64. package/dist/types/api/services/TutorialService.d.ts +12 -0
  65. package/dist/types/components/Feature/Feature.d.ts +9 -0
  66. package/dist/types/components/index.d.ts +1 -0
  67. package/dist/types/hooks/index.d.ts +6 -0
  68. package/dist/types/hooks/useFeatureToggling.d.ts +3 -0
  69. package/dist/types/hooks/useReleaseNotesQuery.d.ts +6 -0
  70. package/dist/types/hooks/useSignalRMessages.d.ts +12 -0
  71. package/dist/types/index.d.ts +5 -0
  72. package/dist/types/providers/AuthProvider/AuthProvider.d.ts +17 -0
  73. package/dist/types/providers/AuthProvider/AuthProviderInner.d.ts +16 -0
  74. package/dist/types/providers/FeatureToggleProvider.d.ts +14 -0
  75. package/dist/types/providers/ReleaseNotesProvider.d.ts +20 -0
  76. package/dist/types/providers/TutorialProvider/TutorialDialog.d.ts +3 -0
  77. package/dist/types/providers/TutorialProvider/TutorialProvider.const.d.ts +7 -0
  78. package/dist/types/providers/TutorialProvider/TutorialProvider.d.ts +30 -0
  79. package/dist/types/providers/TutorialProvider/TutorialProvider.hooks.d.ts +3 -0
  80. package/dist/types/providers/TutorialProvider/TutorialProvider.styles.d.ts +26 -0
  81. package/dist/types/providers/TutorialProvider/TutorialProvider.types.d.ts +11 -0
  82. package/dist/types/providers/TutorialProvider/TutorialProvider.utils.d.ts +3 -0
  83. package/dist/types/providers/TutorialProvider/TutorialProviderInner.d.ts +3 -0
  84. package/dist/types/providers/TutorialProvider/TutorialStepIndicator.d.ts +8 -0
  85. package/dist/types/providers/TutorialStepsProvider.d.ts +13 -0
  86. package/dist/types/providers/index.d.ts +5 -0
  87. package/dist/types/storybook/InfoCard.d.ts +8 -0
  88. package/dist/types/storybook/Links.d.ts +9 -0
  89. package/dist/types/storybook/PropsTable.d.ts +10 -0
  90. package/dist/types/storybook/Stack.d.ts +9 -0
  91. package/dist/types/storybook/Story.d.ts +2 -0
  92. package/dist/types/storybook/index.d.ts +5 -0
  93. package/dist/types/tests/browserMocks.d.ts +24 -0
  94. package/dist/types/tests/setupTests.d.ts +2 -0
  95. package/dist/types/tests/test-utils.d.ts +6 -0
  96. package/dist/types/types/Environment.d.ts +6 -0
  97. package/dist/types/types/ReleaseNotes.d.ts +19 -0
  98. package/dist/types/types/index.d.ts +2 -0
  99. package/dist/types/utils/UtilStory.d.ts +7 -0
  100. package/dist/types/utils/auth_environment.d.ts +47 -0
  101. package/dist/types/utils/index.d.ts +2 -0
  102. package/dist/types/utils/localStorage.d.ts +2 -0
  103. package/dist/types/utils/releaseNotes.d.ts +8 -0
  104. package/package.json +1 -1
@@ -0,0 +1,5 @@
1
+ export declare enum ServiceNowUrgency {
2
+ CRITICAL = "Critical",
3
+ MODERATE = "Moderate",
4
+ NORMAL = "Normal"
5
+ }
@@ -0,0 +1,13 @@
1
+ import { CustomTutorialStep } from './CustomTutorialStep';
2
+ import { GenericTutorialStep } from './GenericTutorialStep';
3
+ export type Tutorial = {
4
+ id: string;
5
+ name: string;
6
+ shortName: string;
7
+ path: string;
8
+ application: string;
9
+ steps: Array<CustomTutorialStep | GenericTutorialStep>;
10
+ showInProd: boolean;
11
+ willPopUp: boolean;
12
+ dynamicPositioning?: boolean | null;
13
+ };
@@ -0,0 +1,7 @@
1
+ export declare enum TutorialPosition {
2
+ TOP_LEFT = "TOP_LEFT",
3
+ TOP_RIGHT = "TOP_RIGHT",
4
+ BOTTOM_LEFT = "BOTTOM_LEFT",
5
+ BOTTOM_RIGHT = "BOTTOM_RIGHT",
6
+ CENTER = "CENTER"
7
+ }
@@ -0,0 +1,4 @@
1
+ import type { TutorialPosition } from './TutorialPosition';
2
+ export type TutorialStepBase = {
3
+ position?: TutorialPosition;
4
+ };
@@ -0,0 +1,35 @@
1
+ import type { CancelablePromise } from '../';
2
+ import { FeatureToggleDto } from '../';
3
+ import { ServiceNowIncidentResponse } from 'src/api/models/ServiceNowIncidentResponse';
4
+ import { AmplifyApplication } from '../models/Applications';
5
+ export declare class PortalService {
6
+ /**
7
+ * Creates a incident report in service now
8
+ * @param formData
9
+ * @returns any Success
10
+ * @throws ApiError
11
+ */
12
+ static createIncident(formData?: FormData): CancelablePromise<ServiceNowIncidentResponse>;
13
+ /**
14
+ * Uploads file to slack and links it to a channel defined in config
15
+ * @param formData
16
+ * @returns any Success
17
+ * @throws ApiError
18
+ */
19
+ static fileUpload(formData?: FormData): CancelablePromise<unknown>;
20
+ /**
21
+ * Posts a slack message to channel defined in config
22
+ * @param formData
23
+ * @returns any Success
24
+ * @throws ApiError
25
+ */
26
+ static postmessage(formData?: FormData): CancelablePromise<unknown>;
27
+ /**
28
+ * Gets a Feature Toggle from Application name
29
+ * @param applicationName name
30
+ * @returns FeatureToggleDto Success
31
+ * @throws ApiError
32
+ */
33
+ static getFeatureToggleFromApplicationName(applicationName: string): CancelablePromise<FeatureToggleDto>;
34
+ static userApplications(): CancelablePromise<Array<AmplifyApplication>>;
35
+ }
@@ -0,0 +1,28 @@
1
+ import type { CancelablePromise } from '../core/CancelablePromise';
2
+ export declare class ReleaseNotesService {
3
+ /**
4
+ * @param applicationName
5
+ * @param version
6
+ * @param tags
7
+ * @returns any Success
8
+ * @throws ApiError
9
+ */
10
+ static getReleasenoteList(applicationName?: string, version?: string, tags?: Array<string>): CancelablePromise<any>;
11
+ /**
12
+ * @returns any Success
13
+ * @throws ApiError
14
+ */
15
+ static getMyReleasenotes(): CancelablePromise<any>;
16
+ /**
17
+ * @param applicationName
18
+ * @param releaseId
19
+ * @returns any Success
20
+ * @throws ApiError
21
+ */
22
+ static getReleasenote(applicationName: string, releaseId: string): CancelablePromise<any>;
23
+ /**
24
+ * @returns string Success
25
+ * @throws ApiError
26
+ */
27
+ static getContainerSasUri(): CancelablePromise<string>;
28
+ }
@@ -0,0 +1,12 @@
1
+ import type { Tutorial } from '../models/Tutorial';
2
+ import type { CancelablePromise } from '../core/CancelablePromise';
3
+ export declare class TutorialService {
4
+ /**
5
+ * Gets all tutorials for Application
6
+ * @param applicationName
7
+ * @returns Tutorial Success
8
+ * @throws ApiError
9
+ */
10
+ static getTutorialsForApplication(applicationName: string): CancelablePromise<Array<Tutorial>>;
11
+ static getTutorialSasToken(): CancelablePromise<string>;
12
+ }
@@ -0,0 +1,9 @@
1
+ import { DetailedHTMLProps, FC, HTMLAttributes, ReactNode } from 'react';
2
+ interface FeatureProps {
3
+ featureKey: string;
4
+ children: ReactNode;
5
+ fallback?: DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>;
6
+ showIfKeyMissing?: boolean;
7
+ }
8
+ export declare const Feature: FC<FeatureProps>;
9
+ export {};
@@ -0,0 +1 @@
1
+ export { Feature } from './Feature/Feature';
@@ -0,0 +1,6 @@
1
+ import { useAuth } from '../providers/AuthProvider/AuthProvider';
2
+ import { useTutorialSteps } from '../providers/TutorialStepsProvider';
3
+ import { useFeatureToggling } from './useFeatureToggling';
4
+ import { useReleaseNotesQuery } from './useReleaseNotesQuery';
5
+ import { useSignalRMessages } from './useSignalRMessages';
6
+ export { useAuth, useFeatureToggling, useReleaseNotesQuery, useSignalRMessages, useTutorialSteps, };
@@ -0,0 +1,3 @@
1
+ export declare function useFeatureToggling(featureKey: string, showIfKeyMissing?: boolean): {
2
+ showContent: boolean;
3
+ };
@@ -0,0 +1,6 @@
1
+ import { ReleaseNote } from 'src/api/models/ReleaseNote';
2
+ interface ReleaseNotesQueryProps {
3
+ enabled?: boolean;
4
+ }
5
+ export declare function useReleaseNotesQuery(options?: ReleaseNotesQueryProps): import("@tanstack/react-query").UseQueryResult<ReleaseNote[], Error>;
6
+ export {};
@@ -0,0 +1,12 @@
1
+ export declare function useSignalRMessages<T extends {
2
+ SequenceNumber?: number | null;
3
+ Read?: boolean | null;
4
+ Subject?: string | null;
5
+ }>(topic: string): {
6
+ messages: T[];
7
+ hasUnreadMessages: boolean;
8
+ setMessageAsRead: (message: T) => void;
9
+ setAllMessagesAsRead: () => void;
10
+ deleteMessage: (message: T) => Promise<void>;
11
+ closeConnection: () => Promise<void>;
12
+ };
@@ -0,0 +1,5 @@
1
+ export * from './components';
2
+ export * from './hooks';
3
+ export * from './providers';
4
+ export * from './types';
5
+ export * from './utils';
@@ -0,0 +1,17 @@
1
+ import { FC, ReactElement, ReactNode } from 'react';
2
+ import { AccountInfo } from '@azure/msal-browser';
3
+ export type AuthState = 'loading' | 'authorized' | 'unauthorized';
4
+ export interface AuthContextType {
5
+ account: AccountInfo | undefined;
6
+ photo: string | undefined;
7
+ roles: string[] | undefined;
8
+ logout: () => void;
9
+ }
10
+ export declare const useAuth: () => AuthContextType;
11
+ interface AuthProviderProps {
12
+ children: ReactNode;
13
+ loadingComponent?: ReactElement;
14
+ unauthorizedComponent?: ReactElement;
15
+ }
16
+ declare const AuthProvider: FC<AuthProviderProps>;
17
+ export default AuthProvider;
@@ -0,0 +1,16 @@
1
+ import { FC, ReactElement, ReactNode } from 'react';
2
+ import { AccountInfo } from '@azure/msal-common';
3
+ import { AuthState } from './AuthProvider';
4
+ export interface AuthProviderInnerProps {
5
+ children: ReactNode;
6
+ account: AccountInfo | undefined;
7
+ setAccount: (val: AccountInfo | undefined) => void;
8
+ setPhoto: (val: string | undefined) => void;
9
+ setRoles: (val: string[] | undefined) => void;
10
+ authState: AuthState;
11
+ setAuthState: (val: AuthState) => void;
12
+ loadingComponent?: ReactElement;
13
+ unauthorizedComponent?: ReactElement;
14
+ }
15
+ declare const AuthProviderInner: FC<AuthProviderInnerProps>;
16
+ export default AuthProviderInner;
@@ -0,0 +1,14 @@
1
+ import { FC, ReactNode } from 'react';
2
+ import { Feature, GraphUser } from '../api';
3
+ export declare const isUserInActiveUserArray: (username: string, activeUsers: GraphUser[] | undefined | null) => boolean;
4
+ interface FeatureToggleContextType {
5
+ isLoading: boolean;
6
+ isError: boolean;
7
+ features?: Feature[] | null;
8
+ }
9
+ export declare function useFeatureToggleContext(): FeatureToggleContextType;
10
+ interface FeatureToggleProviderProps {
11
+ children: ReactNode;
12
+ }
13
+ declare const FeatureToggleProvider: FC<FeatureToggleProviderProps>;
14
+ export default FeatureToggleProvider;
@@ -0,0 +1,20 @@
1
+ import { Dispatch, FC, ReactNode, SetStateAction } from 'react';
2
+ import { Option, SieveValue, TableOfContentsItemType } from '@equinor/amplify-components';
3
+ import { ReleaseNote } from 'src/api/models/ReleaseNote';
4
+ interface ReleaseNotesContextState {
5
+ search: SieveValue;
6
+ setSearch: Dispatch<SetStateAction<SieveValue>>;
7
+ selectedReleaseNoteTypes?: Option[];
8
+ open: boolean;
9
+ setOpen: (open: boolean) => void;
10
+ toggle: () => void;
11
+ filteredData: ReleaseNote[];
12
+ releaseNotesYears: TableOfContentsItemType[];
13
+ }
14
+ export declare const useReleaseNotes: () => ReleaseNotesContextState;
15
+ interface ReleaseNotesContextProviderProps {
16
+ children: ReactNode;
17
+ enabled?: boolean;
18
+ }
19
+ declare const ReleaseNotesProvider: FC<ReleaseNotesContextProviderProps>;
20
+ export default ReleaseNotesProvider;
@@ -0,0 +1,3 @@
1
+ import { FC } from 'react';
2
+ declare const TutorialDialog: FC;
3
+ export default TutorialDialog;
@@ -0,0 +1,7 @@
1
+ export declare const HIGHLIGHT_PADDING = 8;
2
+ export declare const DIALOG_EDGE_MARGIN = 24;
3
+ export declare const TUTORIAL_SEARCH_PARAM_KEY = "tutorial";
4
+ export declare const TUTORIAL_LOCALSTORAGE_VALUE_STRING = "hasCompletedTutorial";
5
+ export declare const TUTORIAL_HIGHLIGHTER_DATATEST_ID = "tutorial-highlighter";
6
+ export declare const GET_TUTORIALS_FOR_APP = "getTutorialsForApp";
7
+ export declare const GET_TUTORIALS_SAS_TOKEN = "getTutorialsSasToken";
@@ -0,0 +1,30 @@
1
+ import { Dispatch, FC, MutableRefObject, ReactNode, SetStateAction } from 'react';
2
+ import { CustomTutorialComponent } from './TutorialProvider.types';
3
+ import { CustomTutorialStep, GenericTutorialStep, Tutorial } from 'src/api';
4
+ export interface TutorialContextType {
5
+ activeTutorial: Tutorial | undefined;
6
+ setActiveTutorial: Dispatch<SetStateAction<Tutorial | undefined>>;
7
+ currentStep: number;
8
+ setCurrentStep: Dispatch<SetStateAction<number>>;
9
+ allElementsToHighlight: HTMLElement[] | undefined;
10
+ setAllElementsToHighlight: Dispatch<SetStateAction<HTMLElement[] | undefined>>;
11
+ customStepComponents: CustomTutorialComponent[] | undefined;
12
+ currentStepObject: GenericTutorialStep | CustomTutorialStep | undefined;
13
+ isLastStep: boolean;
14
+ dialogRef: MutableRefObject<HTMLDialogElement | null>;
15
+ clearSearchParam: () => void;
16
+ shortNameFromParams: string | undefined;
17
+ setShortNameFromParams: Dispatch<SetStateAction<string | undefined>>;
18
+ tutorialsFromProps: Tutorial[];
19
+ tutorialError: boolean;
20
+ setTutorialError: Dispatch<SetStateAction<boolean>>;
21
+ viewportWidth: number;
22
+ }
23
+ export declare const TutorialContext: import("react").Context<TutorialContextType | undefined>;
24
+ interface TutorialProviderProps {
25
+ children: ReactNode;
26
+ customStepComponents?: CustomTutorialComponent[];
27
+ tutorials?: Tutorial[];
28
+ }
29
+ declare const TutorialProvider: FC<TutorialProviderProps>;
30
+ export default TutorialProvider;
@@ -0,0 +1,3 @@
1
+ export declare const useGetTutorialsForApp: () => import("@tanstack/react-query").UseQueryResult<import("../../api").Tutorial[], Error>;
2
+ export declare const useGetTutorialSasToken: () => import("@tanstack/react-query").UseQueryResult<string, Error>;
3
+ export declare const useTutorial: () => import("src/providers/TutorialProvider/TutorialProvider").TutorialContextType;
@@ -0,0 +1,26 @@
1
+ export declare const Highlighter: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
2
+ export declare const DialogWrapper: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
3
+ export declare const StyledTutorialDialog: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").DialogHTMLAttributes<HTMLDialogElement>, HTMLDialogElement>, never>> & string;
4
+ export declare const DialogContent: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
5
+ export declare const DialogImage: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>, never>> & string;
6
+ export declare const DialogActions: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
7
+ export declare const NavigateSteps: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
8
+ export declare const TutorialErrorDialog: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<Omit<{
9
+ isDismissable?: boolean;
10
+ open: boolean;
11
+ onClose?: () => void;
12
+ dialogRef?: import("react").ForwardedRef<HTMLDialogElement>;
13
+ } & import("react").HTMLAttributes<HTMLDivElement> & import("react").RefAttributes<HTMLDivElement>, "ref"> & {
14
+ ref?: ((instance: HTMLDivElement | null) => void | import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | import("react").RefObject<HTMLDivElement> | null | undefined;
15
+ }, never>> & string & Omit<import("react").ForwardRefExoticComponent<{
16
+ isDismissable?: boolean;
17
+ open: boolean;
18
+ onClose?: () => void;
19
+ dialogRef?: import("react").ForwardedRef<HTMLDialogElement>;
20
+ } & import("react").HTMLAttributes<HTMLDivElement> & import("react").RefAttributes<HTMLDivElement>> & {
21
+ Actions: typeof import("@equinor/eds-core-react/dist/types/components/Dialog/DialogActions").DialogActions;
22
+ Title: typeof import("@equinor/eds-core-react/dist/types/components/Dialog/DialogTitle").DialogTitle;
23
+ CustomContent: typeof import("@equinor/eds-core-react/dist/types/components/Dialog/DialogContent").DialogContent;
24
+ Content: typeof import("@equinor/eds-core-react/dist/types/components/Dialog/DialogContent").DialogContent;
25
+ Header: typeof import("@equinor/eds-core-react/dist/types/components/Dialog/DialogHeader").DialogHeader;
26
+ }, keyof import("react").Component<any, {}, any>>;
@@ -0,0 +1,11 @@
1
+ import { ReactElement } from 'react';
2
+ export interface HighlightingInfo {
3
+ top: number;
4
+ left: number;
5
+ width: number;
6
+ height: number;
7
+ }
8
+ export interface CustomTutorialComponent {
9
+ key: string;
10
+ element: ReactElement;
11
+ }
@@ -0,0 +1,3 @@
1
+ import { Tutorial, TutorialPosition } from 'src/api';
2
+ export declare const getBestPositionWithoutOverlap: (highlightedBoundingRect: DOMRect, dialogBoundingRect: DOMRect) => TutorialPosition.TOP_LEFT | TutorialPosition.TOP_RIGHT | TutorialPosition.BOTTOM_LEFT | TutorialPosition.BOTTOM_RIGHT;
3
+ export declare const getAllElementsToHighlight: (activeTutorial: Tutorial) => (HTMLElement | null)[];
@@ -0,0 +1,3 @@
1
+ import { FC } from 'react';
2
+ declare const TutorialProviderInner: FC;
3
+ export default TutorialProviderInner;
@@ -0,0 +1,8 @@
1
+ import { FC } from 'react';
2
+ import { CustomTutorialStep, GenericTutorialStep } from 'src/api';
3
+ interface TutorialStepIndicatorProps {
4
+ steps: (GenericTutorialStep | CustomTutorialStep)[];
5
+ currentStep: number;
6
+ }
7
+ declare const TutorialStepIndicator: FC<TutorialStepIndicatorProps>;
8
+ export default TutorialStepIndicator;
@@ -0,0 +1,13 @@
1
+ import { FC, ReactNode } from 'react';
2
+ interface TutorialContextState {
3
+ tutorialStep: string;
4
+ setTutorialStep: (val: string) => void;
5
+ showTutorialIntro: boolean;
6
+ setShowTutorialIntro: (val: boolean) => void;
7
+ }
8
+ export declare const useTutorialSteps: () => TutorialContextState;
9
+ declare const TutorialStepsProvider: FC<{
10
+ children: ReactNode;
11
+ startOpen?: boolean;
12
+ }>;
13
+ export default TutorialStepsProvider;
@@ -0,0 +1,5 @@
1
+ import AuthProvider from './AuthProvider/AuthProvider';
2
+ import TutorialProvider from './TutorialProvider/TutorialProvider';
3
+ import FeatureToggleProvider from './FeatureToggleProvider';
4
+ import TutorialStepsProvider from './TutorialStepsProvider';
5
+ export { AuthProvider, FeatureToggleProvider, TutorialProvider, TutorialStepsProvider, };
@@ -0,0 +1,8 @@
1
+ interface InfoCardTypes {
2
+ title?: string;
3
+ description?: string;
4
+ url?: string;
5
+ urlTitle?: string;
6
+ }
7
+ export declare const InfoCard: ({ title, description, url, urlTitle, }: InfoCardTypes) => import("react/jsx-runtime").JSX.Element;
8
+ export {};
@@ -0,0 +1,9 @@
1
+ interface LinksProps {
2
+ figmaUrl?: string;
3
+ ariaUrl?: string;
4
+ documentationUrl?: string;
5
+ sourceUrl?: string;
6
+ edsSBUrl?: string;
7
+ }
8
+ export declare const Links: ({ ariaUrl, figmaUrl, documentationUrl, sourceUrl, edsSBUrl, }: LinksProps) => import("react/jsx-runtime").JSX.Element;
9
+ export {};
@@ -0,0 +1,10 @@
1
+ import PropTypes from 'prop-types';
2
+ export declare const PropsTable: {
3
+ ({ story, ...props }: {
4
+ [x: string]: any;
5
+ story?: string | undefined;
6
+ }): import("react/jsx-runtime").JSX.Element;
7
+ propTypes: {
8
+ story: PropTypes.Requireable<string>;
9
+ };
10
+ };
@@ -0,0 +1,9 @@
1
+ import { HTMLAttributes, ReactNode } from 'react';
2
+ import { CSSObject } from 'styled-components';
3
+ type StackProps = {
4
+ direction?: CSSObject['flexDirection'];
5
+ align?: CSSObject['alignItems'];
6
+ children: ReactNode;
7
+ } & HTMLAttributes<HTMLDivElement>;
8
+ export declare const Stack: ({ children, direction, align, ...rest }: StackProps) => import("react/jsx-runtime").JSX.Element;
9
+ export {};
@@ -0,0 +1,2 @@
1
+ import { StoryProps } from '@storybook/addon-docs';
2
+ export declare const Story: (props: StoryProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,5 @@
1
+ export { InfoCard } from './InfoCard';
2
+ export { Links } from './Links';
3
+ export { PropsTable } from './PropsTable';
4
+ export { Stack } from './Stack';
5
+ export { Story } from './Story';
@@ -0,0 +1,24 @@
1
+ import { Mock } from 'vitest';
2
+ export declare class ClipboardDataMock {
3
+ getData: Mock<string[], [string]>;
4
+ setData: Mock<string[], [string, string]>;
5
+ constructor();
6
+ }
7
+ export declare class ClipboardEventMock extends Event {
8
+ clipboardData: ClipboardDataMock;
9
+ constructor(type: string, options?: EventInit);
10
+ }
11
+ export declare class DataTransferMock {
12
+ data: Record<string, string>;
13
+ constructor();
14
+ setData(format: string, data: string): void;
15
+ getData(format: string): string;
16
+ }
17
+ export declare class DragEventMock extends Event {
18
+ dataTransfer: DataTransferMock;
19
+ constructor(type: string, options?: EventInit);
20
+ }
21
+ export declare function mockGetBoundingClientRect(): DOMRect;
22
+ export declare class FakeDOMRectList extends Array<DOMRect> implements DOMRectList {
23
+ item(index: number): DOMRect | null;
24
+ }
@@ -0,0 +1,2 @@
1
+ import '@testing-library/jest-dom';
2
+ import 'jest-styled-components';
@@ -0,0 +1,6 @@
1
+ import { ReactElement } from 'react';
2
+ import { render, RenderOptions } from '@testing-library/react';
3
+ import userEvent from '@testing-library/user-event';
4
+ declare const customRender: (ui: ReactElement, options?: RenderOptions) => ReturnType<typeof render>;
5
+ export * from '@testing-library/react';
6
+ export { customRender as render, userEvent };
@@ -0,0 +1,6 @@
1
+ export declare enum EnvironmentType {
2
+ LOCALHOST = "localhost",
3
+ DEVELOP = "development",
4
+ STAGING = "staging",
5
+ PRODUCTION = "production"
6
+ }
@@ -0,0 +1,19 @@
1
+ declare enum ReleaseNoteType {
2
+ FEATURE = "Feature",
3
+ IMPROVEMENT = "Improvement",
4
+ BUG_FIX = "Bug fix"
5
+ }
6
+ type ReleaseNoteTypeInformation = {
7
+ [key in ReleaseNoteType]: {
8
+ dotColor: string;
9
+ };
10
+ };
11
+ declare const RELEASENOTE_TYPES_INFORMATION: ReleaseNoteTypeInformation;
12
+ interface ReleaseNotesTypesProps {
13
+ name: ReleaseNoteType;
14
+ onClick?: () => void;
15
+ active?: boolean;
16
+ showIcon: boolean;
17
+ }
18
+ export { ReleaseNoteType, RELEASENOTE_TYPES_INFORMATION };
19
+ export type { ReleaseNotesTypesProps };
@@ -0,0 +1,2 @@
1
+ export * from './Environment';
2
+ export * from './ReleaseNotes';
@@ -0,0 +1,7 @@
1
+ import { FC } from 'react';
2
+ interface UtilStoryProps {
3
+ name: string;
4
+ codeText: string;
5
+ }
6
+ declare const UtilStory: FC<UtilStoryProps>;
7
+ export default UtilStory;
@@ -0,0 +1,47 @@
1
+ import { PublicClientApplication } from '@azure/msal-browser';
2
+ import { EnvironmentType } from 'src/types/Environment';
3
+ interface EnvVariables {
4
+ CLIENT_ID: string;
5
+ NAME: string;
6
+ API_URL: string;
7
+ API_SCOPE: string;
8
+ ENVIRONMENT_NAME: string;
9
+ SERVICE_NOW_CONFIGURATION_ITEM: string;
10
+ ALLOWED_PARENT_DOMAINS: string;
11
+ }
12
+ export declare const auth: {
13
+ fetchMsGraph: (url: string, accessToken: string) => Promise<Response>;
14
+ GRAPH_SCOPES: {
15
+ OPENID: string;
16
+ PROFILE: string;
17
+ USER_READ: string;
18
+ };
19
+ GRAPH_REQUESTS_LOGIN: {
20
+ scopes: string[];
21
+ };
22
+ GRAPH_REQUESTS_PHOTO: {
23
+ scopes: string[];
24
+ };
25
+ GRAPH_REQUESTS_BACKEND: (apiScope: string) => {
26
+ scopes: string[];
27
+ };
28
+ GRAPH_ENDPOINTS: {
29
+ PHOTO: string;
30
+ };
31
+ msalApp: PublicClientApplication;
32
+ getToken: () => Promise<string>;
33
+ isReaderOnly: (roles: string[] | undefined) => boolean;
34
+ isInIframe: () => boolean;
35
+ };
36
+ export declare const environment: {
37
+ getConfig: (param: keyof EnvVariables) => string;
38
+ getAppName: (appName: string | undefined) => string;
39
+ getClientId: (clientId: string | undefined) => string;
40
+ getApiUrl: (apiUrl: string | undefined) => string;
41
+ getApiScope: (apiScope: string | undefined) => string;
42
+ getEnvironmentName: (environmentName: string | EnvironmentType | undefined) => EnvironmentType;
43
+ getIsMock: (isMock: string | undefined) => boolean;
44
+ getServiceNowConfigurationItem: (configurationItem: string | undefined) => string;
45
+ PORTAL_URL_WITHOUT_LOCALHOST: string;
46
+ };
47
+ export {};
@@ -0,0 +1,2 @@
1
+ import { auth, environment } from './auth_environment';
2
+ export { auth, environment };
@@ -0,0 +1,2 @@
1
+ export declare const getLocalStorage: <T>(key: string, defaultState: T) => T;
2
+ export declare const updateLocalStorage: <T>(key: string, state: T) => void;
@@ -0,0 +1,8 @@
1
+ import { TableOfContentsItemType } from '@equinor/amplify-components';
2
+ import { ReleaseNote } from 'src/api/models/ReleaseNote';
3
+ declare const extractDatesFromReleaseNotes: (releaseNotes: ReleaseNote[]) => TableOfContentsItemType[];
4
+ declare const monthValueToString: (monthValue: Date) => string;
5
+ declare const monthToString: (monthValue: Date) => string;
6
+ declare const yearValueToString: (yearValue: Date) => string;
7
+ declare const sortReleaseNotesByDate: (notes: ReleaseNote[]) => ReleaseNote[];
8
+ export { extractDatesFromReleaseNotes, monthToString, monthValueToString, sortReleaseNotesByDate, yearValueToString, };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@equinor/subsurface-app-management",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "React Typescript components/hooks to communicate with equinor/sam",
5
5
  "main": "dist/esm/index.js",
6
6
  "types": "dist/types/index.d.ts",