@equinor/subsurface-app-management 2.4.0 → 2.5.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.
- package/dist/api/services/TutorialService.d.ts +7 -0
- package/dist/api/services/TutorialService.js +1 -1
- package/dist/constants/queryKeys.d.ts +1 -0
- package/dist/constants/queryKeys.js +1 -1
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/useTutorialStepImage.d.ts +1 -0
- package/dist/hooks/useTutorialStepImage.js +1 -0
- package/dist/index.js +1 -1
- package/dist/providers/TutorialProvider/TutorialProvider.js +1 -1
- package/dist/providers/TutorialProvider/hooks/usePrefetchTutorialStepImages.d.ts +1 -0
- package/dist/providers/TutorialProvider/hooks/usePrefetchTutorialStepImages.js +1 -0
- package/package.json +1 -1
|
@@ -29,4 +29,11 @@ export declare class TutorialService {
|
|
|
29
29
|
* @throws ApiError
|
|
30
30
|
*/
|
|
31
31
|
static getDraftTutorialsForApplication(applicationName: string): CancelablePromise<Array<MyTutorialDto>>;
|
|
32
|
+
/**
|
|
33
|
+
* Get tutorial image
|
|
34
|
+
* @param path
|
|
35
|
+
* @returns string OK
|
|
36
|
+
* @throws ApiError
|
|
37
|
+
*/
|
|
38
|
+
static getTutorialImage(path: string): CancelablePromise<string>;
|
|
32
39
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{OpenAPI_JSEMBARK_Prod as t,OpenAPI_SAM_Prod as a}from"../core/OpenAPI.js";import{request as
|
|
1
|
+
import{OpenAPI_JSEMBARK_Prod as t,OpenAPI_SAM_Prod as a}from"../core/OpenAPI.js";import{request as r}from"../core/request.js";class i{static getTutorialsForApplication(a){return r(t,{method:"GET",url:"/api/v1/Tutorial/{applicationName}",path:{applicationName:a}})}static getTutorialSasToken(){return r(t,{method:"GET",url:"/api/v1/Tutorial/SASToken"})}static getMyTutorials(t){return r(a,{method:"GET",url:"/api/v1/Tutorial/{applicationName}/false",path:{applicationName:t}})}static getDraftTutorialsForApplication(t){return r(a,{method:"GET",url:"/api/v1/Tutorial/draft/{applicationName}",path:{applicationName:t}})}static getTutorialImage(t){return r(a,{method:"GET",url:"/api/v1/Tutorial/gettutorialimage/{path}",path:{path:t},errors:{404:"Not Found"}})}}export{i as TutorialService};
|
|
@@ -2,4 +2,5 @@ export declare const GET_FEATURE_TOGGLES_FOR_APP = "getFeatureToggleFromAppName"
|
|
|
2
2
|
export declare const GET_TUTORIALS_FOR_APP = "getTutorialsForApp";
|
|
3
3
|
export declare const GET_TUTORIALS_SAS_TOKEN = "getTutorialsSasToken";
|
|
4
4
|
export declare const GET_RELEASE_NOTES = "getReleaseNotes";
|
|
5
|
+
export declare const GET_TUTORIAL_STEP_IMAGE = "getTutorialStepImage";
|
|
5
6
|
export declare const SAM_QUERIES: string[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e="getFeatureToggleFromAppName",t="getTutorialsForApp",o="getTutorialsSasToken",a="getReleaseNotes",g=[e,t,o,a];export{e as GET_FEATURE_TOGGLES_FOR_APP,a as GET_RELEASE_NOTES,t as GET_TUTORIALS_FOR_APP,o as GET_TUTORIALS_SAS_TOKEN,g as SAM_QUERIES};
|
|
1
|
+
const e="getFeatureToggleFromAppName",t="getTutorialsForApp",o="getTutorialsSasToken",a="getReleaseNotes",g="getTutorialStepImage",r=[e,t,o,a];export{e as GET_FEATURE_TOGGLES_FOR_APP,a as GET_RELEASE_NOTES,t as GET_TUTORIALS_FOR_APP,o as GET_TUTORIALS_SAS_TOKEN,g as GET_TUTORIAL_STEP_IMAGE,r as SAM_QUERIES};
|
package/dist/hooks/index.d.ts
CHANGED
|
@@ -2,3 +2,4 @@ export { useFeatureToggleContext } from '../providers/FeatureToggleProvider';
|
|
|
2
2
|
export { useFeatureToggling } from './useFeatureToggling';
|
|
3
3
|
export { useReleaseNotesQuery } from './useReleaseNotesQuery';
|
|
4
4
|
export { useTutorialsQuery } from './useTutorialsQuery';
|
|
5
|
+
export { useTutorialStepImage } from './useTutorialStepImage';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function useTutorialStepImage(imgUrl: string | undefined): import("@tanstack/react-query").UseQueryResult<string, Error>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{useQuery as e}from"@tanstack/react-query";import{TutorialService as r}from"../api/services/TutorialService.js";import{GET_TUTORIAL_STEP_IMAGE as t}from"../constants/queryKeys.js";function i(i){return e({queryKey:[t,i],queryFn:()=>r.getTutorialImage(i),gcTime:1/0,staleTime:1/0,enabled:void 0!==i})}export{i as useTutorialStepImage};
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{Feature}from"./components/Feature/Feature.js";export{FeatureRoute}from"./components/FeatureRoute/FeatureRoute.js";export{FeatureToggleProvider,useFeatureToggleContext}from"./providers/FeatureToggleProvider.js";export{useFeatureToggling}from"./hooks/useFeatureToggling.js";export{useReleaseNotesQuery}from"./hooks/useReleaseNotesQuery.js";export{useTutorialsQuery}from"./hooks/useTutorialsQuery.js";export{OldTutorialProvider}from"./providers/OldTutorialProvider/OldTutorialProvider.js";export{useOldTutorial}from"./providers/OldTutorialProvider/OldTutorialProvider.hooks.js";export{TutorialProvider,useTutorials}from"./providers/TutorialProvider/TutorialProvider.js";export{EnvironmentType}from"./types/Environment.js";export{RELEASENOTE_TYPES_INFORMATION,ReleaseNoteType}from"./types/ReleaseNotes.js";import*as e from"./utils/environment.js";export{e as environment};export{ApiError}from"./api/core/ApiError.js";export{CancelError,CancelablePromise}from"./api/core/CancelablePromise.js";export{OpenAPI_APP,getJSEmbarkToken,getPortalToken,getSAMToken}from"./api/core/OpenAPI.js";export{request}from"./api/core/request.js";export{ApplicationCategory}from"./api/models/ApplicationCategory.js";export{ServiceNowUrgency}from"./api/models/ServiceNowUrgency.js";export{TutorialPosition}from"./api/models/TutorialPosition.js";export{AmplifyApplicationService}from"./api/services/AmplifyApplicationService.js";export{FeatureToggleService}from"./api/services/FeatureToggleService.js";export{ImpersonateUserService}from"./api/services/ImpersonateUserService.js";export{ReleaseNotesService}from"./api/services/ReleaseNotesService.js";export{ServiceNowService}from"./api/services/ServiceNowService.js";export{SlackService}from"./api/services/SlackService.js";export{TutorialService}from"./api/services/TutorialService.js";export{GET_FEATURE_TOGGLES_FOR_APP,GET_RELEASE_NOTES,GET_TUTORIALS_FOR_APP,GET_TUTORIALS_SAS_TOKEN,SAM_QUERIES}from"./constants/queryKeys.js";
|
|
1
|
+
export{Feature}from"./components/Feature/Feature.js";export{FeatureRoute}from"./components/FeatureRoute/FeatureRoute.js";export{FeatureToggleProvider,useFeatureToggleContext}from"./providers/FeatureToggleProvider.js";export{useFeatureToggling}from"./hooks/useFeatureToggling.js";export{useReleaseNotesQuery}from"./hooks/useReleaseNotesQuery.js";export{useTutorialsQuery}from"./hooks/useTutorialsQuery.js";export{useTutorialStepImage}from"./hooks/useTutorialStepImage.js";export{OldTutorialProvider}from"./providers/OldTutorialProvider/OldTutorialProvider.js";export{useOldTutorial}from"./providers/OldTutorialProvider/OldTutorialProvider.hooks.js";export{TutorialProvider,useTutorials}from"./providers/TutorialProvider/TutorialProvider.js";export{EnvironmentType}from"./types/Environment.js";export{RELEASENOTE_TYPES_INFORMATION,ReleaseNoteType}from"./types/ReleaseNotes.js";import*as e from"./utils/environment.js";export{e as environment};export{ApiError}from"./api/core/ApiError.js";export{CancelError,CancelablePromise}from"./api/core/CancelablePromise.js";export{OpenAPI_APP,getJSEmbarkToken,getPortalToken,getSAMToken}from"./api/core/OpenAPI.js";export{request}from"./api/core/request.js";export{ApplicationCategory}from"./api/models/ApplicationCategory.js";export{ServiceNowUrgency}from"./api/models/ServiceNowUrgency.js";export{TutorialPosition}from"./api/models/TutorialPosition.js";export{AmplifyApplicationService}from"./api/services/AmplifyApplicationService.js";export{FeatureToggleService}from"./api/services/FeatureToggleService.js";export{ImpersonateUserService}from"./api/services/ImpersonateUserService.js";export{ReleaseNotesService}from"./api/services/ReleaseNotesService.js";export{ServiceNowService}from"./api/services/ServiceNowService.js";export{SlackService}from"./api/services/SlackService.js";export{TutorialService}from"./api/services/TutorialService.js";export{GET_FEATURE_TOGGLES_FOR_APP,GET_RELEASE_NOTES,GET_TUTORIALS_FOR_APP,GET_TUTORIALS_SAS_TOKEN,GET_TUTORIAL_STEP_IMAGE,SAM_QUERIES}from"./constants/queryKeys.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as r}from"react/jsx-runtime";import{createContext as o,useContext as
|
|
1
|
+
import{jsx as r}from"react/jsx-runtime";import{createContext as o,useContext as t,useState as i,useMemo as e}from"react";import{useLocation as n,matchPath as s}from"react-router";import{useSeenTutorials as a}from"./useSeenTutorials.js";import"../FeatureToggleProvider.js";import"@tanstack/react-query";import"../../api/core/OpenAPI.js";import{useTutorialsQuery as u}from"../../hooks/useTutorialsQuery.js";import{usePrefetchTutorialStepImages as d}from"./hooks/usePrefetchTutorialStepImages.js";const l=o(void 0);function p(){const r=t(l);if(void 0===r)throw new Error("'useTutorials' must be used within provider");return r}const c=({children:o})=>{const{pathname:t}=n(),{data:p=[]}=u(),[c,v]=i(void 0),[f,m]=i(void 0),[h,T]=a();d();const w=e((()=>p?.filter((r=>null!==s(r.path,t)))),[t,p]),g=e((()=>w?.filter((r=>!h.includes(r.id)&&r.willPopUp))),[h,w]);return r(l.Provider,{value:{allTutorials:p,tutorialsOnThisPage:w,unseenTutorialsOnThisPage:g,activeTutorial:c,activeStep:f,startTutorial:r=>{if(!p?.some((o=>r===o.id)))throw new Error("Tutorial not found");v(p.find((o=>r===o.id))),m(0)},skipTutorial:r=>{c&&c.id===r&&(v(void 0),m(void 0)),T(r)},goToNextStep:()=>{if(!c)throw new Error("No currently active tutorial!");if(void 0===f)throw new Error("activeStep is undefined!");f+1>=c.steps.length?(T(c.id),v(void 0),m(void 0)):m(f+1)},goToPreviousStep:()=>{if(!c)throw new Error("No currently active tutorial!");if(void 0===f)throw new Error("activeStep is undefined!");0===f?(v(void 0),m(void 0)):m(f-1)}},children:o})};export{l as TutorialDataContext,c as TutorialProvider,p as useTutorials};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function usePrefetchTutorialStepImages(): void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{useRef as r,useEffect as e}from"react";import{useQueryClient as o}from"@tanstack/react-query";import{TutorialService as t}from"../../../api/services/TutorialService.js";import{GET_TUTORIAL_STEP_IMAGE as i}from"../../../constants/queryKeys.js";import"../../FeatureToggleProvider.js";import"../../../api/core/OpenAPI.js";import{useTutorialsQuery as s}from"../../../hooks/useTutorialsQuery.js";function m(){const{data:m=[]}=s(),c=o(),u=r([]);e((()=>{const r=r=>{for(const e of r.steps)e.imgUrl&&c.prefetchQuery({queryKey:[i,e.imgUrl],queryFn:()=>t.getTutorialImage(e.imgUrl),staleTime:1/0,gcTime:1/0})};for(const e of m)u.current.includes(e.id)||(u.current.push(e.id),r(e))}),[c,m])}export{m as usePrefetchTutorialStepImages};
|