@equinor/subsurface-app-management 1.1.19 → 1.1.21
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/index.js +1 -1
- package/dist/providers/TutorialProvider/TutorialDialog.d.ts +4 -1
- package/dist/providers/TutorialProvider/TutorialDialog.js +1 -1
- package/dist/providers/TutorialProvider/TutorialProvider.hooks.d.ts +3 -0
- package/dist/providers/TutorialProvider/TutorialProvider.hooks.js +1 -1
- package/dist/providers/TutorialProvider/TutorialProviderInner.js +1 -1
- package/dist/providers/index.d.ts +1 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{Feature}from"./components/Feature/Feature.js";export{FeatureToggleProvider,useFeatureToggleContext}from"./providers/FeatureToggleProvider.js";export{useFeatureToggling}from"./hooks/useFeatureToggling.js";export{useReleaseNotesQuery}from"./hooks/useReleaseNotesQuery.js";export{TutorialProvider}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_SAM,getPortalToken}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_TUTORIALS_FOR_APP,GET_TUTORIALS_SAS_TOKEN,SAM_QUERIES}from"./constants/queryKeys.js";
|
|
1
|
+
export{Feature}from"./components/Feature/Feature.js";export{FeatureToggleProvider,useFeatureToggleContext}from"./providers/FeatureToggleProvider.js";export{useFeatureToggling}from"./hooks/useFeatureToggling.js";export{useReleaseNotesQuery}from"./hooks/useReleaseNotesQuery.js";export{TutorialProvider}from"./providers/TutorialProvider/TutorialProvider.js";export{useTutorial}from"./providers/TutorialProvider/TutorialProvider.hooks.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_SAM,getPortalToken}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_TUTORIALS_FOR_APP,GET_TUTORIALS_SAS_TOKEN,SAM_QUERIES}from"./constants/queryKeys.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsxs as t,Fragment as r,jsx as
|
|
1
|
+
import{jsxs as t,Fragment as r,jsx as e}from"react/jsx-runtime";import{useMemo as i}from"react";import{Button as o}from"@equinor/eds-core-react";import{DIALOG_EDGE_MARGIN as a,TUTORIAL_LOCALSTORAGE_VALUE_STRING as n}from"./TutorialProvider.const.js";import{useGetTutorialSasToken as s,useTutorial as l}from"./TutorialProvider.hooks.js";import{DialogTypography as m,DialogImage as c,DialogWrapper as p,StyledTutorialDialog as d,DialogContent as u,DialogActions as g,NavigateSteps as h}from"./TutorialProvider.styles.js";import{getBestPositionWithoutOverlap as T}from"./TutorialProvider.utils.js";import f from"./TutorialStepIndicator.js";import"../../api/core/OpenAPI.js";import"../../api/models/ApplicationCategory.js";import"../../api/models/ServiceNowUrgency.js";import{TutorialPosition as v}from"../../api/models/TutorialPosition.js";const y=({resetHasStartedTutorial:y})=>{const{data:P}=s(),{activeTutorial:S,currentStep:j,setCurrentStep:x,setActiveTutorial:k,dialogRef:O,allElementsToHighlight:$,customStepComponents:C,isLastStep:R,currentStepObject:B,setAllElementsToHighlight:E,shortNameFromParams:H,viewportWidth:I,clearSearchParam:_}=l(),w=i((()=>{if(B)return B.key&&C?C.find((t=>t.key===B.key))?.element:void 0===B.key||null===B.key?t(r,{children:[e(m,{variant:"h5",children:B.title}),e(m,{group:"paragraph",variant:"body_short",children:B.body}),B.imgUrl&&P&&e(c,{"data-testid":"tutorial-image",alt:"tutorial-image",src:`${B.imgUrl}?${P}`})]}):void 0}),[B,C,P]),L=i((()=>{if(S&&I&&$&&O.current)return S.steps[j].position?S.steps[j].position:S.dynamicPositioning?T($[j].getBoundingClientRect(),O.current.getBoundingClientRect()):v.BOTTOM_RIGHT}),[S,I,$,O,j]),N=i((()=>{if(L&&L!==v.CENTER)switch(L){case v.TOP_LEFT:return{marginTop:`${a}px`,marginLeft:`${a}px`};case v.TOP_RIGHT:return{marginTop:`${a}px`,marginRight:`${a}px`};case v.BOTTOM_LEFT:return{marginBottom:`${a}px`,marginLeft:`${a}px`};case v.BOTTOM_RIGHT:default:return{marginBottom:`${a}px`,marginRight:`${a}px`}}}),[L]),A=()=>{H&&_(),S&&(window.localStorage.setItem(S?.shortName,n),k(void 0),O.current?.close(),x(0),E(void 0),y())};return e(p,{children:e(d,{"data-testid":"tutorial-dialog",ref:O,style:N??void 0,children:t(u,{children:[w,e(f,{steps:S?.steps??[],currentStep:j}),t(g,{children:[e(o,{variant:"ghost",onClick:()=>{A()},children:"Skip"}),t(h,{children:[j&&0!==j?e(o,{variant:"ghost",onClick:()=>{x((t=>t-1))},children:"Previous"}):null,e(o,{variant:"outlined",onClick:()=>{R?A():x((t=>t+1))},children:R?"Done":"Next"})]})]})]})})})};export{y as default};
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { Query } from '@tanstack/react-query';
|
|
2
2
|
export declare const useGetTutorialsForApp: (appName: string) => import("@tanstack/react-query").UseQueryResult<import("../..").Tutorial[], Error>;
|
|
3
3
|
export declare const useGetTutorialSasToken: () => import("@tanstack/react-query").UseQueryResult<string, Error>;
|
|
4
|
+
/**
|
|
5
|
+
* Use with caution. There has not been much testing of how using this hook in an app affects the tutorial logic
|
|
6
|
+
*/
|
|
4
7
|
export declare const useTutorial: () => import("./TutorialProvider").TutorialContextType;
|
|
5
8
|
export declare const useIsFetchingWithTimeout: (predicateFn: (query: Query) => boolean) => boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{useContext as r,useState as t,useEffect as e}from"react";import{useIsFetching as o,useQuery as i}from"@tanstack/react-query";import{TutorialService as u}from"../../api/services/TutorialService.js";import{GET_TUTORIALS_FOR_APP as s,GET_TUTORIALS_SAS_TOKEN as a}from"../../constants/queryKeys.js";import{TutorialContext as n}from"./TutorialProvider.js";const c=r=>i({queryKey:[s,r],queryFn:()=>u.getTutorialsForApplication(r)}),m=()=>i({queryKey:[a],queryFn:()=>u.getTutorialSasToken()}),p=()=>{const t=r(n);if(void 0===t)throw new Error("'useTutorial' must be used within a TutorialProvider");return t},y=r=>{const[i,u]=t(!0),s=o({predicate:r})>0;return e((()=>{const r=setTimeout((()=>{u(s)}),100);return()=>clearTimeout(r)}),[s]),i||i!==s};export{m as useGetTutorialSasToken,c as useGetTutorialsForApp,y as useIsFetchingWithTimeout,p as useTutorial};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsxs as t,jsx as r,Fragment as
|
|
1
|
+
import{jsxs as t,jsx as r,Fragment as e}from"react/jsx-runtime";import{useRef as o,useMemo as i,useCallback as n,useEffect as l}from"react";import{useLocation as a}from"react-router";import{Typography as s,Button as h}from"@equinor/eds-core-react";import p from"./TutorialDialog.js";import{HIGHLIGHT_PADDING as c,TUTORIAL_HIGHLIGHTER_DATATEST_ID as m}from"./TutorialProvider.const.js";import{useTutorial as u,useGetTutorialsForApp as d}from"./TutorialProvider.hooks.js";import{TutorialErrorDialog as f,Highlighter as g}from"./TutorialProvider.styles.js";import{EnvironmentType as w}from"../../types/Environment.js";const T=()=>{const{pathname:T}=a(),{activeTutorial:v,setActiveTutorial:P,dialogRef:j,allElementsToHighlight:x,shortNameFromParams:N,tutorialError:b,tutorialsFromProps:C,currentStep:k,viewportWidth:E,setTutorialError:I,clearSearchParam:S,appName:$,environmentName:y}=u(),D=o(!1),{data:R}=d($),U=i((()=>{if(!(R||C&&0!==C.length))return[];const t=[];return C&&t.push(...C),R&&t.push(...R),t}),[R,C]),B=i((()=>{if(!x||!v||!E)return;const t=x[k],r=t.getBoundingClientRect();return t&&t.scrollIntoView({behavior:"smooth",block:"center"}),{top:r.top-c+window.scrollY,left:r.left-c,height:r.height+2*c,width:r.width+2*c}}),[v,x,k,E]),F=i((()=>U.filter((t=>T.includes(t.path)))),[U,T]),H=n((t=>{D.current||(P(t),D.current=!0)}),[P]);l((()=>{B&&!j.current?.open&&j.current?.showModal()}),[j,B]),l((()=>{if(F.length<1)return;const t=F.find((t=>t.shortName===N)),r=F.find((t=>!window.localStorage.getItem(t.shortName)&&t.willPopUp));t?H(t):r&&H(r)}),[H,N,F]);const O=()=>{S(),I(!1),P(void 0)},q=n((()=>{D.current=!1}),[]);return(v?.showInProd||y!==w.PRODUCTION)&&(v?.willPopUp||N)?b&&N?t(f,{open:!0,isDismissable:!0,onClose:O,children:[r(s,{children:"There was a problem starting this tutorial. Please report this in using the feedback function in the Top Bar."}),r(h,{variant:"outlined",onClick:O,children:"Close"})]}):b?null:t(e,{children:[B&&r(g,{"data-testid":m,style:{top:`${B.top}px`,left:`${B.left}px`,width:`${B.width}px`,height:`${B.height}px`}}),r(p,{resetHasStartedTutorial:q})]}):null};export{T as default};
|