@deephaven/code-studio 0.37.1-beta.0 → 0.37.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/build/assets/{AppRoot-98cdf6be.js → AppRoot-30b24991.js} +4 -4
- package/build/assets/{AppRoot-98cdf6be.js.map → AppRoot-30b24991.js.map} +1 -1
- package/build/assets/{index-b0951362.js → index-05ede71e.js} +2 -2
- package/build/assets/{index-b0951362.js.map → index-05ede71e.js.map} +1 -1
- package/build/assets/{index-414f468e.js → index-2a9c25d7.js} +2 -2
- package/build/assets/{index-414f468e.js.map → index-2a9c25d7.js.map} +1 -1
- package/build/assets/{useConnection-554f7596.js → useConnection-dd107347.js} +2 -2
- package/build/assets/{useConnection-554f7596.js.map → useConnection-dd107347.js.map} +1 -1
- package/build/index.html +2 -2
- package/package.json +31 -31
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{A as t,C as n}from"./vendor-ef910ebc.js";import{L as C,B as f}from"./index-
|
|
2
|
-
//# sourceMappingURL=index-
|
|
1
|
+
import{A as t,C as n}from"./vendor-ef910ebc.js";import{L as C,B as f}from"./index-05ede71e.js";import{c as E,r as k,L as U,u as S,P as b,d as O,g as M,e as $,C as R,f as _,h as N}from"./useConnection-dd107347.js";import{i as un,j as ln,R as cn,o as dn,p as gn,l as fn,m as hn,k as pn,n as Pn,a as An,b as Cn}from"./useConnection-dd107347.js";import"./helpers-042e6b4d.js";import"./monaco-a26f85af.js";const x=t.createContext(!1);function T({fontClassNames:e=["fira-sans-regular","fira-sans-bold","fira-mono"],children:s}){const[i,o]=t.useState(!1);return t.useEffect(function(){document.fonts.ready.then(()=>{o(!0)})},[]),n.jsxs(n.Fragment,{children:[n.jsx(x.Provider,{value:i,children:s}),n.jsx("div",{id:"preload-fonts",style:{visibility:"hidden",position:"absolute",top:-1e4},children:e.map(r=>n.jsx("p",{className:r,children:"preload"},r))})]})}const B="io.deephaven.auth.AnonymousAuthenticationHandler",d=C.module("AuthPluginAnonymous");function F({client:e,onSuccess:s,onFailure:i}){const[o,r]=t.useState(),u=E();return t.useEffect(()=>{let a=!1;async function c(){try{if(d.info("Logging in..."),await e.login({type:u.CoreClient.LOGIN_TYPE_ANONYMOUS}),a){d.info("Previous login result canceled");return}d.info("Logged in successfully."),s()}catch(l){if(a){d.info("Previous login failure canceled");return}d.error("Unable to login:",l),r(l),i(l)}}return c(),()=>{a=!0}},[e,u,i,s]),n.jsx(f,{"data-testid":"auth-anonymous-loading",isLoading:!0,isLoaded:!1,errorMessage:o!=null?`${o}`:null})}const I={Component:F,isAvailable:e=>e.includes(B)},H=I,A=C.module("AuthPluginParent");function V(){return new URLSearchParams(window.location.search).get("authProvider")??""}function Y({client:e,onSuccess:s,onFailure:i}){const[o,r]=t.useState();return t.useEffect(()=>{async function u(){try{A.info("Logging in by delegating to parent window...");const a=await k(U);await e.login(a),A.info("Logged in successfully."),s()}catch(a){A.error("Unable to login:",a),r(a),i(a)}}u()},[e,i,s]),n.jsx(f,{"data-testid":"auth-parent-loading",isLoading:!0,isLoaded:!1,errorMessage:o!=null?`${o}`:null})}const G={Component:Y,isAvailable:()=>window.opener!=null&&V()==="parent"},W=G,g=C.module("AuthPluginPsk"),y="io.deephaven.authentication.psk.PskAuthenticationHandler";function q(){return new URLSearchParams(window.location.search).get("psk")??""}function D({client:e,onSuccess:s,onFailure:i}){const[o,r]=t.useState(),[u]=t.useState(()=>q());return t.useEffect(()=>{let a=!1;async function c(){try{if(!u)throw new Error("No Pre-shared key token found. Add `psk=<token>` parameter to your URL");if(g.info("Logging in with found token..."),await e.login({type:y,token:u}),a){g.info("Previous login result canceled");return}g.info("Logged in successfully."),s()}catch(l){if(a){g.info("Previous login failure canceled");return}g.error("Unable to login:",l),r(l),i(l)}}return c(),()=>{a=!0}},[e,i,s,u]),n.jsx(f,{"data-testid":"auth-psk-loading",isLoading:!0,isLoaded:!1,errorMessage:o!=null?`${o}`:null})}const J={Component:D,isAvailable:e=>e.includes(y)},Q=J,z=new Map([["@deephaven/auth-plugins.AuthPluginPsk",Q],["@deephaven/auth-plugins.AuthPluginParent",W],["@deephaven/auth-plugins.AuthPluginAnonymous",H]]);function K({children:e}){const s=S(),i=t.useContext(b),[o,r]=t.useState(),[u,a]=t.useState(!1),[c,l]=t.useState();t.useEffect(function(){let p=!1;async function j(){try{const P=await s.getAuthConfigValues();p||r(new Map(P))}catch(P){p||l(P)}}return j(),()=>{p=!0}},[s]);const m=t.useMemo(()=>{if(!(i==null||o==null))try{return O(i,o,z)}catch(h){l(h)}},[o,i]),v=t.useCallback(()=>{a(!0)},[]),w=t.useCallback(h=>{a(!1),l(h)},[]),L=m==null||o==null;return L||c!=null?n.jsx(f,{isLoading:L,errorMessage:c!=null?`${c}`:void 0}):u?n.jsx(n.Fragment,{children:e}):n.jsx(m,{authConfigValues:o,client:s,onSuccess:v,onFailure:w})}function X({children:e}){return t.useContext(x)?n.jsx(n.Fragment,{children:e}):n.jsx(f,{"data-testid":"fonts-loaded-loading"})}function sn({apiUrl:e,fontClassNames:s,pluginsUrl:i,children:o}){const r=M(e).origin,u=$();return n.jsx(T,{fontClassNames:s,children:n.jsx(R,{serverUrl:r,options:u,children:n.jsx(_,{pluginsUrl:i,children:n.jsx(K,{children:n.jsx(N,{children:n.jsx(X,{children:o})})})})})})}export{sn as AppBootstrap,K as AuthBootstrap,R as ClientBootstrap,un as ClientContext,N as ConnectionBootstrap,ln as ConnectionContext,T as FontBootstrap,X as FontsLoaded,x as FontsLoadedContext,_ as PluginsBootstrap,b as PluginsContext,cn as RemoteComponent,dn as getAuthHandlers,O as getAuthPluginComponent,M as getBaseUrl,$ as getConnectOptions,gn as getEnvoyPrefix,fn as loadComponentPlugin,hn as loadJson,pn as loadModulePlugin,Pn as loadModulePlugins,S as useClient,An as useConnection,Cn as usePlugins};
|
|
2
|
+
//# sourceMappingURL=index-2a9c25d7.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index-414f468e.js","sources":["../../../app-utils/src/components/FontBootstrap.tsx","../../../auth-plugins/src/AuthHandlerTypes.ts","../../../auth-plugins/src/AuthPluginAnonymous.tsx","../../../auth-plugins/src/AuthPluginParent.tsx","../../../auth-plugins/src/AuthPluginPsk.tsx","../../../app-utils/src/components/AuthBootstrap.tsx","../../../app-utils/src/components/FontsLoaded.tsx","../../../app-utils/src/components/AppBootstrap.tsx"],"sourcesContent":["import React, { createContext, useEffect, useState } from 'react';\nimport 'fira';\n\nexport const FontsLoadedContext = createContext<boolean>(false);\n\nexport type FontBootstrapProps = {\n /**\n * Class names of the font elements to pre load\n */\n fontClassNames?: string[];\n\n /**\n * The children to render wrapped with the FontsLoadedContext.\n * Note that it renders the children even if the fonts aren't loaded yet.\n */\n children: React.ReactNode;\n};\n\n/**\n * FontBootstrap component. Handles preloading fonts.\n */\nexport function FontBootstrap({\n fontClassNames = ['fira-sans-regular', 'fira-sans-bold', 'fira-mono'],\n children,\n}: FontBootstrapProps) {\n const [isLoaded, setIsLoaded] = useState(false);\n useEffect(function initFonts() {\n document.fonts.ready.then(() => {\n setIsLoaded(true);\n });\n }, []);\n\n return (\n <>\n <FontsLoadedContext.Provider value={isLoaded}>\n {children}\n </FontsLoadedContext.Provider>\n {/*\n Need to preload any monaco and Deephaven grid fonts.\n We hide text with all the fonts we need on the root app.jsx page\n Load the Fira Mono font so that Monaco calculates word wrapping properly.\n This element doesn't need to be visible, just load the font and stay hidden.\n https://github.com/microsoft/vscode/issues/88689\n Can be replaced with a rel=\"preload\" when firefox adds support\n https://developer.mozilla.org/en-US/docs/Web/HTML/Preloading_content\n */}\n <div\n id=\"preload-fonts\"\n style={{ visibility: 'hidden', position: 'absolute', top: -10000 }}\n >\n {/* trigger loading of fonts needed by monaco and iris grid */}\n {fontClassNames.map(className => (\n <p key={className} className={className}>\n preload\n </p>\n ))}\n </div>\n </>\n );\n}\n\nexport default FontBootstrap;\n","export const AUTH_HANDLER_TYPE_ANONYMOUS =\n 'io.deephaven.auth.AnonymousAuthenticationHandler';\n\nexport const AUTH_HANDLER_TYPE_PSK =\n 'io.deephaven.authentication.psk.PskAuthenticationHandler';\n","import React, { useEffect, useState } from 'react';\nimport { useApi } from '@deephaven/jsapi-bootstrap';\nimport Log from '@deephaven/log';\nimport { LoadingOverlay } from '@deephaven/components';\nimport { AUTH_HANDLER_TYPE_ANONYMOUS } from './AuthHandlerTypes';\nimport { AuthPlugin, AuthPluginProps } from './AuthPlugin';\n\nconst log = Log.module('AuthPluginAnonymous');\n\n/**\n * AuthPlugin that tries to login anonymously. Fails if anonymous login fails\n */\nfunction Component({\n client,\n onSuccess,\n onFailure,\n}: AuthPluginProps): JSX.Element {\n const [error, setError] = useState<unknown>();\n const dh = useApi();\n\n useEffect(() => {\n let isCanceled = false;\n async function login() {\n try {\n log.info('Logging in...');\n await client.login({ type: dh.CoreClient.LOGIN_TYPE_ANONYMOUS });\n if (isCanceled) {\n log.info('Previous login result canceled');\n return;\n }\n log.info('Logged in successfully.');\n onSuccess();\n } catch (e) {\n if (isCanceled) {\n log.info('Previous login failure canceled');\n return;\n }\n log.error('Unable to login:', e);\n setError(e);\n onFailure(e);\n }\n }\n login();\n return () => {\n isCanceled = true;\n };\n }, [client, dh, onFailure, onSuccess]);\n return (\n <LoadingOverlay\n data-testid=\"auth-anonymous-loading\"\n isLoading\n isLoaded={false}\n errorMessage={error != null ? `${error}` : null}\n />\n );\n}\n\nconst AuthPluginAnonymous: AuthPlugin = {\n Component,\n isAvailable: authHandlers =>\n authHandlers.includes(AUTH_HANDLER_TYPE_ANONYMOUS),\n};\n\nexport default AuthPluginAnonymous;\n","import React, { useEffect, useState } from 'react';\nimport { LoginOptions } from '@deephaven/jsapi-types';\nimport {\n LOGIN_OPTIONS_REQUEST,\n requestParentResponse,\n} from '@deephaven/jsapi-utils';\nimport Log from '@deephaven/log';\nimport { LoadingOverlay } from '@deephaven/components';\nimport { AuthPlugin, AuthPluginProps } from './AuthPlugin';\n\nconst log = Log.module('AuthPluginParent');\n\nfunction getWindowAuthProvider(): string {\n return new URLSearchParams(window.location.search).get('authProvider') ?? '';\n}\n\n/**\n * AuthPlugin that tries to delegate to the parent window for authentication. Fails if there is no parent window.\n */\nfunction Component({\n client,\n onSuccess,\n onFailure,\n}: AuthPluginProps): JSX.Element {\n const [error, setError] = useState<unknown>();\n useEffect(() => {\n async function login() {\n try {\n log.info('Logging in by delegating to parent window...');\n const loginOptions = await requestParentResponse<LoginOptions>(\n LOGIN_OPTIONS_REQUEST\n );\n\n await client.login(loginOptions);\n log.info('Logged in successfully.');\n onSuccess();\n } catch (e) {\n log.error('Unable to login:', e);\n setError(e);\n onFailure(e);\n }\n }\n login();\n }, [client, onFailure, onSuccess]);\n return (\n <LoadingOverlay\n data-testid=\"auth-parent-loading\"\n isLoading\n isLoaded={false}\n errorMessage={error != null ? `${error}` : null}\n />\n );\n}\n\nconst AuthPluginParent: AuthPlugin = {\n Component,\n isAvailable: () =>\n window.opener != null && getWindowAuthProvider() === 'parent',\n};\n\nexport default AuthPluginParent;\n","import React, { useEffect, useState } from 'react';\nimport Log from '@deephaven/log';\nimport { LoadingOverlay } from '@deephaven/components';\nimport { AuthPlugin, AuthPluginProps } from './AuthPlugin';\n\nconst log = Log.module('AuthPluginPsk');\n\nconst AUTH_TYPE = 'io.deephaven.authentication.psk.PskAuthenticationHandler';\n\nfunction getWindowToken(): string {\n return new URLSearchParams(window.location.search).get('psk') ?? '';\n}\n\n/**\n * AuthPlugin that tries to login using a pre-shared key.\n * Add the `psk=<token>` parameter to your URL string to set the token.\n */\nfunction Component({\n client,\n onSuccess,\n onFailure,\n}: AuthPluginProps): JSX.Element {\n const [error, setError] = useState<unknown>();\n const [token] = useState(() => getWindowToken());\n useEffect(() => {\n let isCanceled = false;\n async function login() {\n try {\n if (!token) {\n throw new Error(\n 'No Pre-shared key token found. Add `psk=<token>` parameter to your URL'\n );\n }\n log.info('Logging in with found token...');\n await client.login({ type: AUTH_TYPE, token });\n if (isCanceled) {\n log.info('Previous login result canceled');\n return;\n }\n log.info('Logged in successfully.');\n onSuccess();\n } catch (e) {\n if (isCanceled) {\n log.info('Previous login failure canceled');\n return;\n }\n log.error('Unable to login:', e);\n setError(e);\n onFailure(e);\n }\n }\n login();\n return () => {\n isCanceled = true;\n };\n }, [client, onFailure, onSuccess, token]);\n return (\n <LoadingOverlay\n data-testid=\"auth-psk-loading\"\n isLoading\n isLoaded={false}\n errorMessage={error != null ? `${error}` : null}\n />\n );\n}\n\nconst AuthPluginPsk: AuthPlugin = {\n Component,\n isAvailable: authHandlers => authHandlers.includes(AUTH_TYPE),\n};\n\nexport default AuthPluginPsk;\n","import React, {\n useCallback,\n useContext,\n useEffect,\n useMemo,\n useState,\n} from 'react';\nimport {\n AuthConfigMap,\n AuthPluginAnonymous,\n AuthPluginParent,\n AuthPluginPsk,\n} from '@deephaven/auth-plugins';\nimport { LoadingOverlay } from '@deephaven/components';\nimport { PluginsContext } from './PluginsBootstrap';\nimport { getAuthPluginComponent } from '../plugins';\nimport useClient from './useClient';\n\nexport type AuthBootstrapProps = {\n /**\n * The children to render after authentication is completed.\n */\n children: React.ReactNode;\n};\n\n/** Core auth plugins that are always loaded */\nconst CORE_AUTH_PLUGINS = new Map([\n ['@deephaven/auth-plugins.AuthPluginPsk', AuthPluginPsk],\n ['@deephaven/auth-plugins.AuthPluginParent', AuthPluginParent],\n ['@deephaven/auth-plugins.AuthPluginAnonymous', AuthPluginAnonymous],\n]);\n\n/**\n * AuthBootstrap component. Handles displaying the auth plugin and authenticating.\n */\nexport function AuthBootstrap({ children }: AuthBootstrapProps) {\n const client = useClient();\n // `useContext` instead of `usePlugins` so that we don't have to wait for the plugins to load\n // We want to load the auth config values in parallel with the plugins\n const plugins = useContext(PluginsContext);\n const [authConfig, setAuthConfig] = useState<AuthConfigMap>();\n const [isLoggedIn, setIsLoggedIn] = useState(false);\n const [error, setError] = useState<unknown>();\n\n useEffect(\n function initAuthConfigValues() {\n let isCancelled = false;\n async function loadAuthConfigValues() {\n try {\n const newAuthConfigValues = await client.getAuthConfigValues();\n if (!isCancelled) {\n setAuthConfig(new Map(newAuthConfigValues));\n }\n } catch (e) {\n if (!isCancelled) {\n setError(e);\n }\n }\n }\n loadAuthConfigValues();\n return () => {\n isCancelled = true;\n };\n },\n [client]\n );\n\n const AuthComponent = useMemo(() => {\n if (plugins == null || authConfig == null) {\n return undefined;\n }\n\n try {\n return getAuthPluginComponent(plugins, authConfig, CORE_AUTH_PLUGINS);\n } catch (e) {\n setError(e);\n }\n }, [authConfig, plugins]);\n\n const handleLoginSuccess = useCallback(() => {\n setIsLoggedIn(true);\n }, []);\n\n const handleLoginFailure = useCallback((e: unknown) => {\n setIsLoggedIn(false);\n setError(e);\n }, []);\n\n const isLoading = AuthComponent == null || authConfig == null;\n\n if (isLoading || error != null) {\n return (\n <LoadingOverlay\n isLoading={isLoading}\n errorMessage={error != null ? `${error}` : undefined}\n />\n );\n }\n if (!isLoggedIn) {\n return (\n <AuthComponent\n authConfigValues={authConfig}\n client={client}\n onSuccess={handleLoginSuccess}\n onFailure={handleLoginFailure}\n />\n );\n }\n\n // eslint-disable-next-line react/jsx-no-useless-fragment\n return <>{children}</>;\n}\n\nexport default AuthBootstrap;\n","import React, { useContext } from 'react';\nimport { LoadingOverlay } from '@deephaven/components';\nimport { FontsLoadedContext } from './FontBootstrap';\n\nexport type FontsLoadedProps = {\n /** Children to show when the fonts have completed loading */\n children: React.ReactNode;\n};\n\nexport function FontsLoaded({ children }: FontsLoadedProps) {\n const isFontsLoaded = useContext(FontsLoadedContext);\n\n if (!isFontsLoaded) {\n return <LoadingOverlay data-testid=\"fonts-loaded-loading\" />;\n }\n\n // eslint-disable-next-line react/jsx-no-useless-fragment\n return <>{children}</>;\n}\n\nexport default FontsLoaded;\n","import React from 'react';\nimport '@deephaven/components/scss/BaseStyleSheet.scss';\nimport FontBootstrap from './FontBootstrap';\nimport ClientBootstrap from './ClientBootstrap';\nimport PluginsBootstrap from './PluginsBootstrap';\nimport AuthBootstrap from './AuthBootstrap';\nimport ConnectionBootstrap from './ConnectionBootstrap';\nimport { getBaseUrl, getConnectOptions } from '../utils';\nimport FontsLoaded from './FontsLoaded';\n\nexport type AppBootstrapProps = {\n /** URL of the API to load. */\n apiUrl: string;\n\n /** URL of the plugins to load. */\n pluginsUrl: string;\n\n /** Font class names to load. */\n fontClassNames?: string[];\n\n /**\n * The children to render wrapped when everything is loaded and authenticated.\n */\n children: React.ReactNode;\n};\n\n/**\n * AppBootstrap component. Handles loading the fonts, client, and authentication.\n * Will display the children when everything is loaded and authenticated.\n */\nexport function AppBootstrap({\n apiUrl,\n fontClassNames,\n pluginsUrl,\n children,\n}: AppBootstrapProps) {\n const serverUrl = getBaseUrl(apiUrl).origin;\n const clientOptions = getConnectOptions();\n return (\n <FontBootstrap fontClassNames={fontClassNames}>\n <ClientBootstrap serverUrl={serverUrl} options={clientOptions}>\n <PluginsBootstrap pluginsUrl={pluginsUrl}>\n <AuthBootstrap>\n <ConnectionBootstrap>\n <FontsLoaded>{children}</FontsLoaded>\n </ConnectionBootstrap>\n </AuthBootstrap>\n </PluginsBootstrap>\n </ClientBootstrap>\n </FontBootstrap>\n );\n}\n\nexport default AppBootstrap;\n"],"names":["FontsLoadedContext","createContext","FontBootstrap","fontClassNames","children","isLoaded","setIsLoaded","useState","useEffect","jsxs","Fragment","jsx","className","AUTH_HANDLER_TYPE_ANONYMOUS","log","Log","Component","client","onSuccess","onFailure","error","setError","dh","useApi","isCanceled","login","e","LoadingOverlay","AuthPluginAnonymous","authHandlers","AuthPluginAnonymous$1","getWindowAuthProvider","loginOptions","requestParentResponse","LOGIN_OPTIONS_REQUEST","AuthPluginParent","AuthPluginParent$1","AUTH_TYPE","getWindowToken","token","AuthPluginPsk","AuthPluginPsk$1","CORE_AUTH_PLUGINS","AuthBootstrap","useClient","plugins","useContext","PluginsContext","authConfig","setAuthConfig","isLoggedIn","setIsLoggedIn","isCancelled","loadAuthConfigValues","newAuthConfigValues","AuthComponent","useMemo","getAuthPluginComponent","handleLoginSuccess","useCallback","handleLoginFailure","isLoading","FontsLoaded","AppBootstrap","apiUrl","pluginsUrl","serverUrl","getBaseUrl","clientOptions","getConnectOptions","ClientBootstrap","PluginsBootstrap","ConnectionBootstrap"],"mappings":"iZAGa,MAAAA,EAAqBC,gBAAuB,EAAK,EAkBvD,SAASC,EAAc,CAC5B,eAAAC,EAAiB,CAAC,oBAAqB,iBAAkB,WAAW,EACpE,SAAAC,CACF,EAAuB,CACrB,KAAM,CAACC,EAAUC,CAAW,EAAIC,WAAS,EAAK,EAC9CC,OAAAA,EAAA,UAAU,UAAqB,CACpB,SAAA,MAAM,MAAM,KAAK,IAAM,CAC9BF,EAAY,EAAI,CAAA,CACjB,CACH,EAAG,CAAE,CAAA,EAIDG,EAAA,KAAAC,WAAA,CAAA,SAAA,CAAAC,EAAA,IAACX,EAAmB,SAAnB,CAA4B,MAAOK,EACjC,SAAAD,EACH,EAUAO,EAAA,IAAC,MAAA,CACC,GAAG,gBACH,MAAO,CAAE,WAAY,SAAU,SAAU,WAAY,IAAK,IAAO,EAGhE,SAAAR,EAAe,IACdS,GAAAD,EAAA,IAAC,KAAkB,UAAAC,EAAsB,SAAA,SAAA,EAAjCA,CAER,CACD,CAAA,CACH,CACF,CAAA,CAAA,CAEJ,CC3DO,MAAMC,EACX,mDCMIC,EAAMC,EAAI,OAAO,qBAAqB,EAK5C,SAASC,EAAU,CACjB,OAAAC,EACA,UAAAC,EACA,UAAAC,CACF,EAAiC,CAC/B,KAAM,CAACC,EAAOC,CAAQ,EAAId,EAAkB,SAAA,EACtCe,EAAKC,IAEXf,OAAAA,EAAAA,UAAU,IAAM,CACd,IAAIgB,EAAa,GACjB,eAAeC,GAAQ,CACjB,GAAA,CAGF,GAFAX,EAAI,KAAK,eAAe,EACxB,MAAMG,EAAO,MAAM,CAAE,KAAMK,EAAG,WAAW,qBAAsB,EAC3DE,EAAY,CACdV,EAAI,KAAK,gCAAgC,EACzC,MACF,CACAA,EAAI,KAAK,yBAAyB,EACx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AAE,SAAA1D,GAA8B,CAG1D,OAFsB0C,aAAW9C,CAAkB,oBAOzC,SAAAI,CAAS,CAAA,EAJVO,EAAA,IAACgB,EAAe,CAAA,cAAY,sBAAuB,CAAA,CAK9D,CCYO,SAASoC,GAAa,CAC3B,OAAAC,EACA,eAAA7D,EACA,WAAA8D,EACA,SAAA7D,CACF,EAAsB,CACd,MAAA8D,EAAYC,EAAWH,CAAM,EAAE,OAC/BI,EAAgBC,IAEpB,OAAA1D,EAAAA,IAACT,GAAc,eAAAC,EACb,SAAAQ,EAAA,IAAC2D,GAAgB,UAAAJ,EAAsB,QAASE,EAC9C,SAAAzD,EAAA,IAAC4D,EAAiB,CAAA,WAAAN,EAChB,eAACtB,EACC,CAAA,SAAAhC,EAAAA,IAAC6D,GACC,SAAC7D,MAAAmD,EAAA,CAAa,SAAA1D,EAAS,CACzB,CAAA,CAAA,CACF,CACF,CAAA,CAAA,CACF,CACF,CAAA,CAEJ"}
|
|
1
|
+
{"version":3,"file":"index-2a9c25d7.js","sources":["../../../app-utils/src/components/FontBootstrap.tsx","../../../auth-plugins/src/AuthHandlerTypes.ts","../../../auth-plugins/src/AuthPluginAnonymous.tsx","../../../auth-plugins/src/AuthPluginParent.tsx","../../../auth-plugins/src/AuthPluginPsk.tsx","../../../app-utils/src/components/AuthBootstrap.tsx","../../../app-utils/src/components/FontsLoaded.tsx","../../../app-utils/src/components/AppBootstrap.tsx"],"sourcesContent":["import React, { createContext, useEffect, useState } from 'react';\nimport 'fira';\n\nexport const FontsLoadedContext = createContext<boolean>(false);\n\nexport type FontBootstrapProps = {\n /**\n * Class names of the font elements to pre load\n */\n fontClassNames?: string[];\n\n /**\n * The children to render wrapped with the FontsLoadedContext.\n * Note that it renders the children even if the fonts aren't loaded yet.\n */\n children: React.ReactNode;\n};\n\n/**\n * FontBootstrap component. Handles preloading fonts.\n */\nexport function FontBootstrap({\n fontClassNames = ['fira-sans-regular', 'fira-sans-bold', 'fira-mono'],\n children,\n}: FontBootstrapProps) {\n const [isLoaded, setIsLoaded] = useState(false);\n useEffect(function initFonts() {\n document.fonts.ready.then(() => {\n setIsLoaded(true);\n });\n }, []);\n\n return (\n <>\n <FontsLoadedContext.Provider value={isLoaded}>\n {children}\n </FontsLoadedContext.Provider>\n {/*\n Need to preload any monaco and Deephaven grid fonts.\n We hide text with all the fonts we need on the root app.jsx page\n Load the Fira Mono font so that Monaco calculates word wrapping properly.\n This element doesn't need to be visible, just load the font and stay hidden.\n https://github.com/microsoft/vscode/issues/88689\n Can be replaced with a rel=\"preload\" when firefox adds support\n https://developer.mozilla.org/en-US/docs/Web/HTML/Preloading_content\n */}\n <div\n id=\"preload-fonts\"\n style={{ visibility: 'hidden', position: 'absolute', top: -10000 }}\n >\n {/* trigger loading of fonts needed by monaco and iris grid */}\n {fontClassNames.map(className => (\n <p key={className} className={className}>\n preload\n </p>\n ))}\n </div>\n </>\n );\n}\n\nexport default FontBootstrap;\n","export const AUTH_HANDLER_TYPE_ANONYMOUS =\n 'io.deephaven.auth.AnonymousAuthenticationHandler';\n\nexport const AUTH_HANDLER_TYPE_PSK =\n 'io.deephaven.authentication.psk.PskAuthenticationHandler';\n","import React, { useEffect, useState } from 'react';\nimport { useApi } from '@deephaven/jsapi-bootstrap';\nimport Log from '@deephaven/log';\nimport { LoadingOverlay } from '@deephaven/components';\nimport { AUTH_HANDLER_TYPE_ANONYMOUS } from './AuthHandlerTypes';\nimport { AuthPlugin, AuthPluginProps } from './AuthPlugin';\n\nconst log = Log.module('AuthPluginAnonymous');\n\n/**\n * AuthPlugin that tries to login anonymously. Fails if anonymous login fails\n */\nfunction Component({\n client,\n onSuccess,\n onFailure,\n}: AuthPluginProps): JSX.Element {\n const [error, setError] = useState<unknown>();\n const dh = useApi();\n\n useEffect(() => {\n let isCanceled = false;\n async function login() {\n try {\n log.info('Logging in...');\n await client.login({ type: dh.CoreClient.LOGIN_TYPE_ANONYMOUS });\n if (isCanceled) {\n log.info('Previous login result canceled');\n return;\n }\n log.info('Logged in successfully.');\n onSuccess();\n } catch (e) {\n if (isCanceled) {\n log.info('Previous login failure canceled');\n return;\n }\n log.error('Unable to login:', e);\n setError(e);\n onFailure(e);\n }\n }\n login();\n return () => {\n isCanceled = true;\n };\n }, [client, dh, onFailure, onSuccess]);\n return (\n <LoadingOverlay\n data-testid=\"auth-anonymous-loading\"\n isLoading\n isLoaded={false}\n errorMessage={error != null ? `${error}` : null}\n />\n );\n}\n\nconst AuthPluginAnonymous: AuthPlugin = {\n Component,\n isAvailable: authHandlers =>\n authHandlers.includes(AUTH_HANDLER_TYPE_ANONYMOUS),\n};\n\nexport default AuthPluginAnonymous;\n","import React, { useEffect, useState } from 'react';\nimport { LoginOptions } from '@deephaven/jsapi-types';\nimport {\n LOGIN_OPTIONS_REQUEST,\n requestParentResponse,\n} from '@deephaven/jsapi-utils';\nimport Log from '@deephaven/log';\nimport { LoadingOverlay } from '@deephaven/components';\nimport { AuthPlugin, AuthPluginProps } from './AuthPlugin';\n\nconst log = Log.module('AuthPluginParent');\n\nfunction getWindowAuthProvider(): string {\n return new URLSearchParams(window.location.search).get('authProvider') ?? '';\n}\n\n/**\n * AuthPlugin that tries to delegate to the parent window for authentication. Fails if there is no parent window.\n */\nfunction Component({\n client,\n onSuccess,\n onFailure,\n}: AuthPluginProps): JSX.Element {\n const [error, setError] = useState<unknown>();\n useEffect(() => {\n async function login() {\n try {\n log.info('Logging in by delegating to parent window...');\n const loginOptions = await requestParentResponse<LoginOptions>(\n LOGIN_OPTIONS_REQUEST\n );\n\n await client.login(loginOptions);\n log.info('Logged in successfully.');\n onSuccess();\n } catch (e) {\n log.error('Unable to login:', e);\n setError(e);\n onFailure(e);\n }\n }\n login();\n }, [client, onFailure, onSuccess]);\n return (\n <LoadingOverlay\n data-testid=\"auth-parent-loading\"\n isLoading\n isLoaded={false}\n errorMessage={error != null ? `${error}` : null}\n />\n );\n}\n\nconst AuthPluginParent: AuthPlugin = {\n Component,\n isAvailable: () =>\n window.opener != null && getWindowAuthProvider() === 'parent',\n};\n\nexport default AuthPluginParent;\n","import React, { useEffect, useState } from 'react';\nimport Log from '@deephaven/log';\nimport { LoadingOverlay } from '@deephaven/components';\nimport { AuthPlugin, AuthPluginProps } from './AuthPlugin';\n\nconst log = Log.module('AuthPluginPsk');\n\nconst AUTH_TYPE = 'io.deephaven.authentication.psk.PskAuthenticationHandler';\n\nfunction getWindowToken(): string {\n return new URLSearchParams(window.location.search).get('psk') ?? '';\n}\n\n/**\n * AuthPlugin that tries to login using a pre-shared key.\n * Add the `psk=<token>` parameter to your URL string to set the token.\n */\nfunction Component({\n client,\n onSuccess,\n onFailure,\n}: AuthPluginProps): JSX.Element {\n const [error, setError] = useState<unknown>();\n const [token] = useState(() => getWindowToken());\n useEffect(() => {\n let isCanceled = false;\n async function login() {\n try {\n if (!token) {\n throw new Error(\n 'No Pre-shared key token found. Add `psk=<token>` parameter to your URL'\n );\n }\n log.info('Logging in with found token...');\n await client.login({ type: AUTH_TYPE, token });\n if (isCanceled) {\n log.info('Previous login result canceled');\n return;\n }\n log.info('Logged in successfully.');\n onSuccess();\n } catch (e) {\n if (isCanceled) {\n log.info('Previous login failure canceled');\n return;\n }\n log.error('Unable to login:', e);\n setError(e);\n onFailure(e);\n }\n }\n login();\n return () => {\n isCanceled = true;\n };\n }, [client, onFailure, onSuccess, token]);\n return (\n <LoadingOverlay\n data-testid=\"auth-psk-loading\"\n isLoading\n isLoaded={false}\n errorMessage={error != null ? `${error}` : null}\n />\n );\n}\n\nconst AuthPluginPsk: AuthPlugin = {\n Component,\n isAvailable: authHandlers => authHandlers.includes(AUTH_TYPE),\n};\n\nexport default AuthPluginPsk;\n","import React, {\n useCallback,\n useContext,\n useEffect,\n useMemo,\n useState,\n} from 'react';\nimport {\n AuthConfigMap,\n AuthPluginAnonymous,\n AuthPluginParent,\n AuthPluginPsk,\n} from '@deephaven/auth-plugins';\nimport { LoadingOverlay } from '@deephaven/components';\nimport { PluginsContext } from './PluginsBootstrap';\nimport { getAuthPluginComponent } from '../plugins';\nimport useClient from './useClient';\n\nexport type AuthBootstrapProps = {\n /**\n * The children to render after authentication is completed.\n */\n children: React.ReactNode;\n};\n\n/** Core auth plugins that are always loaded */\nconst CORE_AUTH_PLUGINS = new Map([\n ['@deephaven/auth-plugins.AuthPluginPsk', AuthPluginPsk],\n ['@deephaven/auth-plugins.AuthPluginParent', AuthPluginParent],\n ['@deephaven/auth-plugins.AuthPluginAnonymous', AuthPluginAnonymous],\n]);\n\n/**\n * AuthBootstrap component. Handles displaying the auth plugin and authenticating.\n */\nexport function AuthBootstrap({ children }: AuthBootstrapProps) {\n const client = useClient();\n // `useContext` instead of `usePlugins` so that we don't have to wait for the plugins to load\n // We want to load the auth config values in parallel with the plugins\n const plugins = useContext(PluginsContext);\n const [authConfig, setAuthConfig] = useState<AuthConfigMap>();\n const [isLoggedIn, setIsLoggedIn] = useState(false);\n const [error, setError] = useState<unknown>();\n\n useEffect(\n function initAuthConfigValues() {\n let isCancelled = false;\n async function loadAuthConfigValues() {\n try {\n const newAuthConfigValues = await client.getAuthConfigValues();\n if (!isCancelled) {\n setAuthConfig(new Map(newAuthConfigValues));\n }\n } catch (e) {\n if (!isCancelled) {\n setError(e);\n }\n }\n }\n loadAuthConfigValues();\n return () => {\n isCancelled = true;\n };\n },\n [client]\n );\n\n const AuthComponent = useMemo(() => {\n if (plugins == null || authConfig == null) {\n return undefined;\n }\n\n try {\n return getAuthPluginComponent(plugins, authConfig, CORE_AUTH_PLUGINS);\n } catch (e) {\n setError(e);\n }\n }, [authConfig, plugins]);\n\n const handleLoginSuccess = useCallback(() => {\n setIsLoggedIn(true);\n }, []);\n\n const handleLoginFailure = useCallback((e: unknown) => {\n setIsLoggedIn(false);\n setError(e);\n }, []);\n\n const isLoading = AuthComponent == null || authConfig == null;\n\n if (isLoading || error != null) {\n return (\n <LoadingOverlay\n isLoading={isLoading}\n errorMessage={error != null ? `${error}` : undefined}\n />\n );\n }\n if (!isLoggedIn) {\n return (\n <AuthComponent\n authConfigValues={authConfig}\n client={client}\n onSuccess={handleLoginSuccess}\n onFailure={handleLoginFailure}\n />\n );\n }\n\n // eslint-disable-next-line react/jsx-no-useless-fragment\n return <>{children}</>;\n}\n\nexport default AuthBootstrap;\n","import React, { useContext } from 'react';\nimport { LoadingOverlay } from '@deephaven/components';\nimport { FontsLoadedContext } from './FontBootstrap';\n\nexport type FontsLoadedProps = {\n /** Children to show when the fonts have completed loading */\n children: React.ReactNode;\n};\n\nexport function FontsLoaded({ children }: FontsLoadedProps) {\n const isFontsLoaded = useContext(FontsLoadedContext);\n\n if (!isFontsLoaded) {\n return <LoadingOverlay data-testid=\"fonts-loaded-loading\" />;\n }\n\n // eslint-disable-next-line react/jsx-no-useless-fragment\n return <>{children}</>;\n}\n\nexport default FontsLoaded;\n","import React from 'react';\nimport '@deephaven/components/scss/BaseStyleSheet.scss';\nimport FontBootstrap from './FontBootstrap';\nimport ClientBootstrap from './ClientBootstrap';\nimport PluginsBootstrap from './PluginsBootstrap';\nimport AuthBootstrap from './AuthBootstrap';\nimport ConnectionBootstrap from './ConnectionBootstrap';\nimport { getBaseUrl, getConnectOptions } from '../utils';\nimport FontsLoaded from './FontsLoaded';\n\nexport type AppBootstrapProps = {\n /** URL of the API to load. */\n apiUrl: string;\n\n /** URL of the plugins to load. */\n pluginsUrl: string;\n\n /** Font class names to load. */\n fontClassNames?: string[];\n\n /**\n * The children to render wrapped when everything is loaded and authenticated.\n */\n children: React.ReactNode;\n};\n\n/**\n * AppBootstrap component. Handles loading the fonts, client, and authentication.\n * Will display the children when everything is loaded and authenticated.\n */\nexport function AppBootstrap({\n apiUrl,\n fontClassNames,\n pluginsUrl,\n children,\n}: AppBootstrapProps) {\n const serverUrl = getBaseUrl(apiUrl).origin;\n const clientOptions = getConnectOptions();\n return (\n <FontBootstrap fontClassNames={fontClassNames}>\n <ClientBootstrap serverUrl={serverUrl} options={clientOptions}>\n <PluginsBootstrap pluginsUrl={pluginsUrl}>\n <AuthBootstrap>\n <ConnectionBootstrap>\n <FontsLoaded>{children}</FontsLoaded>\n </ConnectionBootstrap>\n </AuthBootstrap>\n </PluginsBootstrap>\n </ClientBootstrap>\n </FontBootstrap>\n );\n}\n\nexport default AppBootstrap;\n"],"names":["FontsLoadedContext","createContext","FontBootstrap","fontClassNames","children","isLoaded","setIsLoaded","useState","useEffect","jsxs","Fragment","jsx","className","AUTH_HANDLER_TYPE_ANONYMOUS","log","Log","Component","client","onSuccess","onFailure","error","setError","dh","useApi","isCanceled","login","e","LoadingOverlay","AuthPluginAnonymous","authHandlers","AuthPluginAnonymous$1","getWindowAuthProvider","loginOptions","requestParentResponse","LOGIN_OPTIONS_REQUEST","AuthPluginParent","AuthPluginParent$1","AUTH_TYPE","getWindowToken","token","AuthPluginPsk","AuthPluginPsk$1","CORE_AUTH_PLUGINS","AuthBootstrap","useClient","plugins","useContext","PluginsContext","authConfig","setAuthConfig","isLoggedIn","setIsLoggedIn","isCancelled","loadAuthConfigValues","newAuthConfigValues","AuthComponent","useMemo","getAuthPluginComponent","handleLoginSuccess","useCallback","handleLoginFailure","isLoading","FontsLoaded","AppBootstrap","apiUrl","pluginsUrl","serverUrl","getBaseUrl","clientOptions","getConnectOptions","ClientBootstrap","PluginsBootstrap","ConnectionBootstrap"],"mappings":"iZAGa,MAAAA,EAAqBC,gBAAuB,EAAK,EAkBvD,SAASC,EAAc,CAC5B,eAAAC,EAAiB,CAAC,oBAAqB,iBAAkB,WAAW,EACpE,SAAAC,CACF,EAAuB,CACrB,KAAM,CAACC,EAAUC,CAAW,EAAIC,WAAS,EAAK,EAC9CC,OAAAA,EAAA,UAAU,UAAqB,CACpB,SAAA,MAAM,MAAM,KAAK,IAAM,CAC9BF,EAAY,EAAI,CAAA,CACjB,CACH,EAAG,CAAE,CAAA,EAIDG,EAAA,KAAAC,WAAA,CAAA,SAAA,CAAAC,EAAA,IAACX,EAAmB,SAAnB,CAA4B,MAAOK,EACjC,SAAAD,EACH,EAUAO,EAAA,IAAC,MAAA,CACC,GA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|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{A as l,I as h,C as d,H as C,R as S,aG as $,aH as A,aI as P,aJ as M,aK as L}from"./vendor-ef910ebc.js";import{aY as b,L as p,B as N}from"./index-
|
|
2
|
-
//# sourceMappingURL=useConnection-
|
|
1
|
+
import{A as l,I as h,C as d,H as C,R as S,aG as $,aH as A,aI as P,aJ as M,aK as L}from"./vendor-ef910ebc.js";import{aY as b,L as p,B as N}from"./index-05ede71e.js";class j extends Error{isTimeout=!0}const T=j,v=()=>{const e=l.useContext(b);if(e==null)throw new Error("No API available in useApi. Was code wrapped in ApiBootstrap or ApiContext.Provider?");return e},m=p.module("MessageUtils"),z="io.deephaven.message.LoginOptions.request",X="io.deephaven.message.SessionDetails.request";function I(e,n=h(),i){return{message:e,id:n,payload:i}}async function Z(e,n=3e4){if(window.opener==null)throw new Error("window.opener is null, unable to send request.");return new Promise((i,r)=>{let a;const t=h(),s=u=>{const{data:o}=u;if(m.debug("Received message",o),o?.id!==t){m.debug("Ignore message, id doesn't match",o);return}window.clearTimeout(a),window.removeEventListener("message",s),i(o.payload)};window.addEventListener("message",s),a=window.setTimeout(()=>{window.removeEventListener("message",s),r(new T("Request timed out"))},n),window.opener.postMessage(I(e,t),"*")})}const x=l.createContext(null);function ee({serverUrl:e,options:n,children:i}){const r=v(),[a,t]=l.useState();return l.useEffect(function(){const u=new r.CoreClient(e,n);return t(u),()=>{u.disconnect()}},[r,n,e]),a==null?null:d.jsx(x.Provider,{value:a,children:i})}function O(e){if(e==null)return!1;const n=e;return n.Component!==void 0&&typeof n.isAvailable=="function"}const E={react:C,"react-dom":S,redux:$,"react-redux":A},U=P.createRequires(()=>E),q=P.createRemoteComponent({requires:U}),B=q,H=M.createRequires(E),J=L({requires:H}),W=J,c=p.module("@deephaven/app-utils.PluginUtils");function ne(e,n){const i=new URL(`${n}.js`,e),r=C.forwardRef((a,t)=>d.jsx(B,{url:i.href,render:({err:s,Component:u})=>{if(s!=null&&s!==""){const o=`Error loading plugin ${n} from ${i} due to ${s}`;return c.error(o),d.jsx("div",{className:"error-message",children:`${o}`})}return d.jsx(u,{ref:t,...a})}}));return r.pluginName=n,r.displayName="Plugin",r}async function _(e){return await W(e)}async function k(e){const n=await fetch(e);if(!n.ok)throw new Error(n.statusText);try{return await n.json()}catch{throw new Error("Could not be parsed as JSON")}}async function D(e){c.debug("Loading plugins...");try{const n=await k(`${e}/manifest.json`);if(!Array.isArray(n.plugins))throw new Error("Plugin manifest JSON does not contain plugins array");c.debug("Plugin manifest loaded:",n);const i=[];for(let t=0;t<n.plugins.length;t+=1){const{name:s,main:u}=n.plugins[t],o=`${e}/${s}/${u}`;i.push(_(o))}const r=await Promise.allSettled(i),a=new Map;for(let t=0;t<r.length;t+=1){const s=r[t],{name:u}=n.plugins[t];s.status==="fulfilled"?a.set(u,s.value):c.error(`Unable to load plugin ${u}`,s.reason)}return c.info("Plugins loaded:",a),a}catch(n){return c.error("Unable to load plugins:",n),new Map}}function F(e){return e.get("AuthHandlers")?.split(",")??[]}function te(e,n,i){const r=F(n),a=[...e.entries()].filter(([,o])=>O(o.AuthPlugin)).map(([o,g])=>[o,g.AuthPlugin]);a.push(...i??[]);const t=a.filter(([o,g])=>g.isAvailable(r));if(t.length===0)throw new Error(`No login plugins found, please register a login plugin for auth handlers: ${r}`);t.length>1&&c.warn("More than one login plugin available, will use the first one: ",t.map(([o])=>o).join(", "));const[s,u]=t[0];return c.info("Using LoginPlugin",s),u.Component}const y=l.createContext(null);function oe({pluginsUrl:e,children:n}){const[i,r]=l.useState(null);return l.useEffect(function(){let t=!1;async function s(){const u=await D(e);t||r(u)}return s(),()=>{t=!0}},[e]),d.jsx(y.Provider,{value:i,children:n})}function G(){const e=l.useContext(x);if(e==null)throw new Error("No Client available in useClient. Was code wrapped in ClientBootstrap or ClientContext.Provider?");return e}const Q=p.module("@deephaven/jsapi-components.ConnectionBootstrap"),R=l.createContext(null);function se({children:e}){const n=v(),i=G(),[r,a]=l.useState(),[t,s]=l.useState();return l.useEffect(function(){let o=!1;async function g(){try{const f=await i.getAsIdeConnection();if(o)return;s(f)}catch(f){if(o)return;a(f)}}return g(),()=>{o=!0}},[n,i]),l.useEffect(function(){if(t==null)return;function o(f){const{detail:w}=f;Q.info("Shutdown",`${JSON.stringify(w)}`),a(`Server shutdown: ${w??"Unknown reason"}`)}return t.addEventListener(n.IdeConnection.EVENT_SHUTDOWN,o)},[n,t]),t==null||r!=null?d.jsx(N,{"data-testid":"connection-bootstrap-loading",isLoading:t==null,errorMessage:`${r}`}):d.jsx(R.Provider,{value:t,children:e})}function re(e){return new URL(e,`${window.location}`)}function K(){return new URLSearchParams(window.location.search).get("envoyPrefix")}function ie(){const e=K();return e!=null?{headers:{"envoy-prefix":e}}:{headers:{}}}function ae(){const e=l.useContext(y);if(e==null)throw new Error("No Plugins available in usePlugins. Was code wrapped in PluginsBootstrap or PluginsContext.Provider?");return e}function ue(){const e=l.useContext(R);if(e==null)throw new Error("No IdeConnection available in useConnection. Was code wrapped in ConnectionBootstrap or ConnectionContext.Provider?");return e}export{ee as C,z as L,y as P,B as R,X as S,T,ue as a,ae as b,v as c,te as d,ie as e,oe as f,re as g,se as h,x as i,R as j,_ as k,ne as l,k as m,D as n,F as o,K as p,Z as r,G as u};
|
|
2
|
+
//# sourceMappingURL=useConnection-dd107347.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useConnection-554f7596.js","sources":["../../../utils/src/TimeoutError.ts","../../../jsapi-bootstrap/src/useApi.ts","../../../jsapi-utils/src/MessageUtils.ts","../../../app-utils/src/components/ClientBootstrap.tsx","../../../auth-plugins/src/AuthPlugin.ts","../../../app-utils/src/plugins/remote-component.config.ts","../../../app-utils/src/plugins/RemoteComponent.ts","../../../app-utils/src/plugins/loadRemoteModule.ts","../../../app-utils/src/plugins/PluginUtils.tsx","../../../app-utils/src/components/PluginsBootstrap.tsx","../../../app-utils/src/components/useClient.ts","../../../app-utils/src/components/ConnectionBootstrap.tsx","../../../app-utils/src/utils/ConnectUtils.ts","../../../app-utils/src/components/usePlugins.ts","../../../app-utils/src/components/useConnection.ts"],"sourcesContent":["class TimeoutError extends Error {\n isTimeout = true;\n}\n\nexport default TimeoutError;\n","import { useContext } from 'react';\nimport { ApiContext } from './ApiBootstrap';\n\nexport const useApi = () => {\n const dh = useContext(ApiContext);\n if (dh == null) {\n throw new Error(\n 'No API available in useApi. Was code wrapped in ApiBootstrap or ApiContext.Provider?'\n );\n }\n return dh;\n};\n\nexport default useApi;\n","import shortid from 'shortid';\nimport Log from '@deephaven/log';\nimport { TimeoutError } from '@deephaven/utils';\n\nconst log = Log.module('MessageUtils');\n\nexport const LOGIN_OPTIONS_REQUEST =\n 'io.deephaven.message.LoginOptions.request';\n\nexport const SESSION_DETAILS_REQUEST =\n 'io.deephaven.message.SessionDetails.request';\n\nexport interface Message<T> {\n message: string;\n payload?: T;\n id: string;\n}\n\nexport interface Response<T> {\n id: string;\n payload: T;\n}\n\n/**\n * Make message object with optional payload\n * @param message Message string\n * @param id Unique message id\n * @param payload Payload to send\n * @returns Message\n */\nexport function makeMessage<T>(\n message: string,\n id = shortid(),\n payload?: T\n): Message<T> {\n return { message, id, payload };\n}\n\n/**\n * Make response object for given message id\n * @param messageId Id of the request message to respond to\n * @param payload Payload to respond with\n * @returns Response\n */\nexport function makeResponse<T>(messageId: string, payload: T): Response<T> {\n return { id: messageId, payload };\n}\n\n/**\n * Request data from the parent window and wait for response\n * @param request Request message to send to the parent window\n * @param timeout Timeout in ms\n * @returns Payload of the given type, or undefined\n */\nexport async function requestParentResponse<T>(\n request: string,\n timeout = 30000\n): Promise<T> {\n if (window.opener == null) {\n throw new Error('window.opener is null, unable to send request.');\n }\n return new Promise((resolve, reject) => {\n let timeoutId: number;\n const id = shortid();\n const listener = (event: MessageEvent<Response<T>>) => {\n const { data } = event;\n log.debug('Received message', data);\n if (data?.id !== id) {\n log.debug(\"Ignore message, id doesn't match\", data);\n return;\n }\n window.clearTimeout(timeoutId);\n window.removeEventListener('message', listener);\n resolve(data.payload);\n };\n window.addEventListener('message', listener);\n timeoutId = window.setTimeout(() => {\n window.removeEventListener('message', listener);\n reject(new TimeoutError('Request timed out'));\n }, timeout);\n window.opener.postMessage(makeMessage(request, id), '*');\n });\n}\n","import React, { createContext, useEffect, useState } from 'react';\nimport { useApi } from '@deephaven/jsapi-bootstrap';\nimport { ConnectOptions, CoreClient } from '@deephaven/jsapi-types';\n\nexport const ClientContext = createContext<CoreClient | null>(null);\n\nexport type ClientBootstrapProps = {\n /** URL of the server to connect to */\n serverUrl: string;\n\n /** Connection options to pass to CoreClient when connecting */\n options?: ConnectOptions;\n\n /**\n * The children to render wrapped with the ClientContext.\n * Will not render children until the client is created.\n */\n children: React.ReactNode;\n};\n\n/**\n * ClientBootstrap component. Handles creating the client.\n */\nexport function ClientBootstrap({\n serverUrl,\n options,\n children,\n}: ClientBootstrapProps) {\n const api = useApi();\n const [client, setClient] = useState<CoreClient>();\n useEffect(\n function initClient() {\n const newClient = new api.CoreClient(serverUrl, options);\n setClient(newClient);\n return () => {\n newClient.disconnect();\n };\n },\n [api, options, serverUrl]\n );\n\n if (client == null) {\n return null;\n }\n return (\n <ClientContext.Provider value={client}>{children}</ClientContext.Provider>\n );\n}\n\nexport default ClientBootstrap;\n","import React from 'react';\nimport { CoreClient } from '@deephaven/jsapi-types';\n\n/**\n * Map from auth config keys to their values\n * E.g. Map { AuthHandlers → \"io.deephaven.auth.AnonymousAuthenticationHandler\" }\n */\nexport type AuthConfigMap = Map<string, string>;\n\n/**\n * Props for the auth plugin component to render\n */\nexport type AuthPluginProps = {\n /** Map from config keys to their values */\n authConfigValues: AuthConfigMap;\n\n /** Client to check auth configuration on */\n client: CoreClient;\n\n /** Called when authentication is sucessful */\n onSuccess(): void;\n\n /** Called when authentication fails */\n onFailure(error: unknown): void;\n};\n\nexport type AuthPluginComponent = React.FunctionComponent<AuthPluginProps>;\n\n/**\n * Whether the auth plugin is available given the current configuration\n */\nexport type AuthPluginIsAvailableFunction = (authHandlers: string[]) => boolean;\n\nexport type AuthPlugin = {\n Component: AuthPluginComponent;\n isAvailable: AuthPluginIsAvailableFunction;\n};\n\nexport function isAuthPlugin(plugin?: unknown): plugin is AuthPlugin {\n if (plugin == null) return false;\n const authPlugin = plugin as AuthPlugin;\n return (\n authPlugin.Component !== undefined &&\n typeof authPlugin.isAvailable === 'function'\n );\n}\n","/* eslint-disable global-require */\n/**\n * remote-component.config.js\n *\n * Dependencies for Remote Components\n */\nimport react from 'react';\nimport * as redux from 'redux';\nimport * as reactRedux from 'react-redux';\nimport ReactDOM from 'react-dom';\n\n// eslint-disable-next-line import/prefer-default-export\nexport const resolve = {\n react,\n 'react-dom': ReactDOM,\n redux,\n 'react-redux': reactRedux,\n};\n","import {\n createRemoteComponent,\n createRequires,\n} from '@paciolan/remote-component';\nimport { resolve } from './remote-component.config';\n\nconst requires = createRequires(() => resolve);\n\nexport const RemoteComponent = createRemoteComponent({ requires });\nexport default RemoteComponent;\n","import createLoadRemoteModule, {\n createRequires,\n} from '@paciolan/remote-module-loader';\nimport { resolve } from './remote-component.config';\n\nconst requires = createRequires(resolve);\n\nexport const loadRemoteModule: {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (url: string): Promise<any>;\n} = createLoadRemoteModule({\n requires,\n});\n\nexport default loadRemoteModule;\n","import React, { ForwardRefExoticComponent } from 'react';\nimport {\n AuthPlugin,\n AuthPluginComponent,\n isAuthPlugin,\n} from '@deephaven/auth-plugins';\nimport Log from '@deephaven/log';\nimport RemoteComponent from './RemoteComponent';\nimport loadRemoteModule from './loadRemoteModule';\n\nconst log = Log.module('@deephaven/app-utils.PluginUtils');\n\n// A PluginModule. This interface should have new fields added to it from different levels of plugins.\n// eslint-disable-next-line @typescript-eslint/no-empty-interface\nexport interface PluginModule {}\n\nexport type PluginModuleMap = Map<string, PluginModule>;\n\n/**\n * Load a component plugin from the server.\n * @param baseURL Base URL of the plugin server\n * @param pluginName Name of the component plugin to load\n * @returns A lazily loaded JSX.Element from the plugin\n */\nexport function loadComponentPlugin(\n baseURL: URL,\n pluginName: string\n): ForwardRefExoticComponent<React.RefAttributes<unknown>> {\n const pluginUrl = new URL(`${pluginName}.js`, baseURL);\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const Plugin: any = React.forwardRef((props, ref) => (\n <RemoteComponent\n url={pluginUrl.href}\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n render={({ err, Component }: { err: unknown; Component: any }) => {\n if (err != null && err !== '') {\n const errorMessage = `Error loading plugin ${pluginName} from ${pluginUrl} due to ${err}`;\n log.error(errorMessage);\n return <div className=\"error-message\">{`${errorMessage}`}</div>;\n }\n // eslint-disable-next-line react/jsx-props-no-spreading\n return <Component ref={ref} {...props} />;\n }}\n />\n ));\n Plugin.pluginName = pluginName;\n Plugin.displayName = 'Plugin';\n return Plugin;\n}\n\n/**\n * Imports a commonjs plugin module from the provided URL\n * @param pluginUrl The URL of the plugin to load\n * @returns The loaded module\n */\nexport async function loadModulePlugin(pluginUrl: string): Promise<unknown> {\n const myModule = await loadRemoteModule(pluginUrl);\n return myModule;\n}\n\n/**\n * Loads a JSON file and returns the JSON object\n * @param jsonUrl The URL of the JSON file to load\n * @returns The JSON object of the manifest file\n */\nexport async function loadJson(\n jsonUrl: string\n): Promise<{ plugins: { name: string; main: string }[] }> {\n const res = await fetch(jsonUrl);\n if (!res.ok) {\n throw new Error(res.statusText);\n }\n try {\n return await res.json();\n } catch {\n throw new Error('Could not be parsed as JSON');\n }\n}\n\n/**\n * Load all plugin modules available.\n * @param modulePluginsUrl The base URL of the module plugins to load\n * @returns A map from the name of the plugin to the plugin module that was loaded\n */\nexport async function loadModulePlugins(\n modulePluginsUrl: string\n): Promise<PluginModuleMap> {\n log.debug('Loading plugins...');\n try {\n const manifest = await loadJson(`${modulePluginsUrl}/manifest.json`);\n\n if (!Array.isArray(manifest.plugins)) {\n throw new Error('Plugin manifest JSON does not contain plugins array');\n }\n\n log.debug('Plugin manifest loaded:', manifest);\n const pluginPromises: Promise<unknown>[] = [];\n for (let i = 0; i < manifest.plugins.length; i += 1) {\n const { name, main } = manifest.plugins[i];\n const pluginMainUrl = `${modulePluginsUrl}/${name}/${main}`;\n pluginPromises.push(loadModulePlugin(pluginMainUrl));\n }\n const pluginModules = await Promise.allSettled(pluginPromises);\n\n const pluginMap: PluginModuleMap = new Map();\n for (let i = 0; i < pluginModules.length; i += 1) {\n const module = pluginModules[i];\n const { name } = manifest.plugins[i];\n if (module.status === 'fulfilled') {\n pluginMap.set(name, module.value as PluginModule);\n } else {\n log.error(`Unable to load plugin ${name}`, module.reason);\n }\n }\n log.info('Plugins loaded:', pluginMap);\n\n return pluginMap;\n } catch (e) {\n log.error('Unable to load plugins:', e);\n return new Map();\n }\n}\n\nexport function getAuthHandlers(\n authConfigValues: Map<string, string>\n): string[] {\n return authConfigValues.get('AuthHandlers')?.split(',') ?? [];\n}\n\n/**\n * Get the auth plugin component from the plugin map and current configuration\n * Throws if no auth plugin is available\n *\n * @param pluginMap Map of plugins loaded from the server\n * @param authConfigValues Auth config values from the server\n * @param corePlugins Map of core auth plugins to include in the list. They are added after the loaded plugins\n * @returns The auth plugin component to render\n */\nexport function getAuthPluginComponent(\n pluginMap: PluginModuleMap,\n authConfigValues: Map<string, string>,\n corePlugins?: Map<string, AuthPlugin>\n): AuthPluginComponent {\n const authHandlers = getAuthHandlers(authConfigValues);\n // Filter out all the plugins that are auth plugins, and then map them to [pluginName, AuthPlugin] pairs\n // Uses some pretty disgusting casting, because TypeScript wants to treat it as an (string | AuthPlugin)[] array instead\n const authPlugins = ([\n ...pluginMap.entries(),\n ].filter(([, plugin]: [string, { AuthPlugin?: AuthPlugin }]) =>\n isAuthPlugin(plugin.AuthPlugin)\n ) as [string, { AuthPlugin: AuthPlugin }][]).map(([name, plugin]) => [\n name,\n plugin.AuthPlugin,\n ]) as [string, AuthPlugin][];\n\n // Add all the core plugins in priority\n authPlugins.push(...(corePlugins ?? []));\n\n // Filter the available auth plugins\n\n const availableAuthPlugins = authPlugins.filter(([name, authPlugin]) =>\n authPlugin.isAvailable(authHandlers)\n );\n\n if (availableAuthPlugins.length === 0) {\n throw new Error(\n `No login plugins found, please register a login plugin for auth handlers: ${authHandlers}`\n );\n } else if (availableAuthPlugins.length > 1) {\n log.warn(\n 'More than one login plugin available, will use the first one: ',\n availableAuthPlugins.map(([name]) => name).join(', ')\n );\n }\n\n const [loginPluginName, NewLoginPlugin] = availableAuthPlugins[0];\n log.info('Using LoginPlugin', loginPluginName);\n\n return NewLoginPlugin.Component;\n}\n","import React, { createContext, useEffect, useState } from 'react';\nimport { PluginModuleMap, loadModulePlugins } from '../plugins';\n\nexport const PluginsContext = createContext<PluginModuleMap | null>(null);\n\nexport type PluginsBootstrapProps = {\n /**\n * Base URL of the plugins to load.\n */\n pluginsUrl: string;\n\n /**\n * The children to render wrapped with the PluginsContext.\n * Note that it renders the children even if the plugins aren't loaded yet.\n */\n children: React.ReactNode;\n};\n\n/**\n * PluginsBootstrap component. Handles loading the plugins.\n */\nexport function PluginsBootstrap({\n pluginsUrl,\n children,\n}: PluginsBootstrapProps) {\n const [plugins, setPlugins] = useState<PluginModuleMap | null>(null);\n useEffect(\n function initPlugins() {\n let isCancelled = false;\n async function loadPlugins() {\n const pluginModules = await loadModulePlugins(pluginsUrl);\n if (!isCancelled) {\n setPlugins(pluginModules);\n }\n }\n loadPlugins();\n return () => {\n isCancelled = true;\n };\n },\n [pluginsUrl]\n );\n\n return (\n <PluginsContext.Provider value={plugins}>\n {children}\n </PluginsContext.Provider>\n );\n}\n\nexport default PluginsBootstrap;\n","import { useContext } from 'react';\nimport { ClientContext } from './ClientBootstrap';\n\nexport function useClient() {\n const client = useContext(ClientContext);\n if (client == null) {\n throw new Error(\n 'No Client available in useClient. Was code wrapped in ClientBootstrap or ClientContext.Provider?'\n );\n }\n return client;\n}\n\nexport default useClient;\n","import React, { createContext, useEffect, useState } from 'react';\nimport { LoadingOverlay } from '@deephaven/components';\nimport { useApi } from '@deephaven/jsapi-bootstrap';\nimport { IdeConnection } from '@deephaven/jsapi-types';\nimport Log from '@deephaven/log';\nimport useClient from './useClient';\n\nconst log = Log.module('@deephaven/jsapi-components.ConnectionBootstrap');\n\nexport const ConnectionContext = createContext<IdeConnection | null>(null);\n\nexport type ConnectionBootstrapProps = {\n /**\n * The children to render wrapped with the ConnectionContext.\n * Will not render children until the connection is created.\n */\n children: React.ReactNode;\n};\n\n/**\n * ConnectionBootstrap component. Handles initializing the connection.\n */\nexport function ConnectionBootstrap({ children }: ConnectionBootstrapProps) {\n const api = useApi();\n const client = useClient();\n const [error, setError] = useState<unknown>();\n const [connection, setConnection] = useState<IdeConnection>();\n useEffect(\n function initConnection() {\n let isCancelled = false;\n async function loadConnection() {\n try {\n const newConnection = await client.getAsIdeConnection();\n if (isCancelled) {\n return;\n }\n setConnection(newConnection);\n } catch (e) {\n if (isCancelled) {\n return;\n }\n setError(e);\n }\n }\n loadConnection();\n return () => {\n isCancelled = true;\n };\n },\n [api, client]\n );\n\n useEffect(\n function listenForShutdown() {\n if (connection == null) return;\n\n function handleShutdown(event: CustomEvent) {\n const { detail } = event;\n log.info('Shutdown', `${JSON.stringify(detail)}`);\n setError(`Server shutdown: ${detail ?? 'Unknown reason'}`);\n }\n\n const removerFn = connection.addEventListener(\n api.IdeConnection.EVENT_SHUTDOWN,\n handleShutdown\n );\n return removerFn;\n },\n [api, connection]\n );\n\n if (connection == null || error != null) {\n return (\n <LoadingOverlay\n data-testid=\"connection-bootstrap-loading\"\n isLoading={connection == null}\n errorMessage={`${error}`}\n />\n );\n }\n\n return (\n <ConnectionContext.Provider value={connection}>\n {children}\n </ConnectionContext.Provider>\n );\n}\n\nexport default ConnectionBootstrap;\n","import { ConnectOptions } from '@deephaven/jsapi-types';\n\n/**\n * Get the base URL of the API\n * @param apiUrl API URL\n * @returns URL for the base of the API\n */\nexport function getBaseUrl(apiUrl: string): URL {\n return new URL(apiUrl, `${window.location}`);\n}\n\n/**\n * Get the Envoy prefix header value\n * @returns Envoy prefix header value\n */\nexport function getEnvoyPrefix(): string | null {\n const searchParams = new URLSearchParams(window.location.search);\n return searchParams.get('envoyPrefix');\n}\n\nexport function getConnectOptions(): ConnectOptions {\n const envoyPrefix = getEnvoyPrefix();\n return envoyPrefix != null\n ? { headers: { 'envoy-prefix': envoyPrefix } }\n : { headers: {} };\n}\n","import { useContext } from 'react';\nimport { PluginsContext } from './PluginsBootstrap';\n\nexport function usePlugins() {\n const plugins = useContext(PluginsContext);\n if (plugins == null) {\n throw new Error(\n 'No Plugins available in usePlugins. Was code wrapped in PluginsBootstrap or PluginsContext.Provider?'\n );\n }\n return plugins;\n}\n\nexport default usePlugins;\n","import { useContext } from 'react';\nimport { ConnectionContext } from './ConnectionBootstrap';\n\nexport function useConnection() {\n const connection = useContext(ConnectionContext);\n if (connection == null) {\n throw new Error(\n 'No IdeConnection available in useConnection. Was code wrapped in ConnectionBootstrap or ConnectionContext.Provider?'\n );\n }\n return connection;\n}\n\nexport default useConnection;\n"],"names":["TimeoutError","TimeoutError$1","useApi","dh","useContext","ApiContext","log","Log","LOGIN_OPTIONS_REQUEST","SESSION_DETAILS_REQUEST","makeMessage","message","id","shortid","payload","requestParentResponse","request","timeout","resolve","reject","timeoutId","listener","event","data","ClientContext","createContext","ClientBootstrap","serverUrl","options","children","api","client","setClient","useState","useEffect","newClient","isAuthPlugin","plugin","authPlugin","react","ReactDOM","redux","reactRedux","requires","createRequires","RemoteComponent","createRemoteComponent","RemoteComponent$1","loadRemoteModule","createLoadRemoteModule","loadRemoteModule$1","loadComponentPlugin","baseURL","pluginName","pluginUrl","Plugin","React","props","ref","jsx","err","Component","errorMessage","loadModulePlugin","loadJson","jsonUrl","res","loadModulePlugins","modulePluginsUrl","manifest","pluginPromises","i","name","main","pluginMainUrl","pluginModules","pluginMap","module","e","getAuthHandlers","authConfigValues","getAuthPluginComponent","corePlugins","authHandlers","authPlugins","availableAuthPlugins","loginPluginName","NewLoginPlugin","PluginsContext","PluginsBootstrap","pluginsUrl","plugins","setPlugins","isCancelled","loadPlugins","useClient","ConnectionContext","ConnectionBootstrap","error","setError","connection","setConnection","loadConnection","newConnection","handleShutdown","detail","LoadingOverlay","getBaseUrl","apiUrl","getEnvoyPrefix","getConnectOptions","envoyPrefix","usePlugins","useConnection"],"mappings":"oKAAA,MAAMA,UAAqB,KAAM,CAC/B,UAAY,EACd,CAEA,MAAAC,EAAeD,ECDFE,EAAS,IAAM,CACpB,MAAAC,EAAKC,aAAWC,CAAU,EAChC,GAAIF,GAAM,KACR,MAAM,IAAI,MACR,sFAAA,EAGG,OAAAA,CACT,ECPMG,EAAMC,EAAI,OAAO,cAAc,EAExBC,EACX,4CAEWC,EACX,8CAoBK,SAASC,EACdC,EACAC,EAAKC,EAAA,EACLC,EACY,CACL,MAAA,CAAE,QAAAH,EAAS,GAAAC,EAAI,QAAAE,EACxB,CAkBsB,eAAAC,EACpBC,EACAC,EAAU,IACE,CACR,GAAA,OAAO,QAAU,KACb,MAAA,IAAI,MAAM,gDAAgD,EAElE,OAAO,IAAI,QAAQ,CAACC,EAASC,IAAW,CAClC,IAAAC,EACJ,MAAMR,EAAKC,IACLQ,EAAYC,GAAqC,CAC/C,KAAA,CAAE,KAAAC,CAAS,EAAAD,EAEb,GADAhB,EAAA,MAAM,mBAAoBiB,CAAI,EAC9BA,GAAM,KAAOX,EAAI,CACfN,EAAA,MAAM,mCAAoCiB,CAAI,EAClD,MACF,CACA,OAAO,aAAaH,CAAS,EACtB,OAAA,oBAAoB,UAAWC,CAAQ,EAC9CH,EAAQK,EAAK,OAAO,CAAA,EAEf,OAAA,iBAAiB,UAAWF,CAAQ,EAC/BD,EAAA,OAAO,WAAW,IAAM,CAC3B,OAAA,oBAAoB,UAAWC,CAAQ,EACvCF,EAAA,IAAInB,EAAa,mBAAmB,CAAC,GAC3CiB,CAAO,EACV,OAAO,OAAO,YAAYP,EAAYM,EAASJ,CAAE,EAAG,GAAG,CAAA,CACxD,CACH,CC9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AU,CAAA,EAGdA,GAAc,MAAQF,GAAS,KAE/BvC,EAAA,IAAC+C,EAAA,CACC,cAAY,+BACZ,UAAWN,GAAc,KACzB,aAAc,GAAGF,GAAA,CAAA,QAMpBF,EAAkB,SAAlB,CAA2B,MAAOI,EAChC,SAAAvE,CACH,CAAA,CAEJ,CC/EO,SAAS8E,GAAWC,EAAqB,CAC9C,OAAO,IAAI,IAAIA,EAAQ,GAAG,OAAO,UAAU,CAC7C,CAMO,SAASC,GAAgC,CAEvC,OADc,IAAI,gBAAgB,OAAO,SAAS,MAAM,EAC3C,IAAI,aAAa,CACvC,CAEO,SAASC,IAAoC,CAClD,MAAMC,EAAcF,IACpB,OAAOE,GAAe,KAClB,CAAE,QAAS,CAAE,eAAgBA,CAAY,GACzC,CAAE,QAAS,CAAA,EACjB,CCtBO,SAASC,IAAa,CACrB,MAAArB,EAAUvF,aAAWoF,CAAc,EACzC,GAAIG,GAAW,KACb,MAAM,IAAI,MACR,sGAAA,EAGG,OAAAA,CACT,CCRO,SAASsB,IAAgB,CACxB,MAAAb,EAAahG,aAAW4F,CAAiB,EAC/C,GAAII,GAAc,KAChB,MAAM,IAAI,MACR,qHAAA,EAGG,OAAAA,CACT"}
|
|
1
|
+
{"version":3,"file":"useConnection-dd107347.js","sources":["../../../utils/src/TimeoutError.ts","../../../jsapi-bootstrap/src/useApi.ts","../../../jsapi-utils/src/MessageUtils.ts","../../../app-utils/src/components/ClientBootstrap.tsx","../../../auth-plugins/src/AuthPlugin.ts","../../../app-utils/src/plugins/remote-component.config.ts","../../../app-utils/src/plugins/RemoteComponent.ts","../../../app-utils/src/plugins/loadRemoteModule.ts","../../../app-utils/src/plugins/PluginUtils.tsx","../../../app-utils/src/components/PluginsBootstrap.tsx","../../../app-utils/src/components/useClient.ts","../../../app-utils/src/components/ConnectionBootstrap.tsx","../../../app-utils/src/utils/ConnectUtils.ts","../../../app-utils/src/components/usePlugins.ts","../../../app-utils/src/components/useConnection.ts"],"sourcesContent":["class TimeoutError extends Error {\n isTimeout = true;\n}\n\nexport default TimeoutError;\n","import { useContext } from 'react';\nimport { ApiContext } from './ApiBootstrap';\n\nexport const useApi = () => {\n const dh = useContext(ApiContext);\n if (dh == null) {\n throw new Error(\n 'No API available in useApi. Was code wrapped in ApiBootstrap or ApiContext.Provider?'\n );\n }\n return dh;\n};\n\nexport default useApi;\n","import shortid from 'shortid';\nimport Log from '@deephaven/log';\nimport { TimeoutError } from '@deephaven/utils';\n\nconst log = Log.module('MessageUtils');\n\nexport const LOGIN_OPTIONS_REQUEST =\n 'io.deephaven.message.LoginOptions.request';\n\nexport const SESSION_DETAILS_REQUEST =\n 'io.deephaven.message.SessionDetails.request';\n\nexport interface Message<T> {\n message: string;\n payload?: T;\n id: string;\n}\n\nexport interface Response<T> {\n id: string;\n payload: T;\n}\n\n/**\n * Make message object with optional payload\n * @param message Message string\n * @param id Unique message id\n * @param payload Payload to send\n * @returns Message\n */\nexport function makeMessage<T>(\n message: string,\n id = shortid(),\n payload?: T\n): Message<T> {\n return { message, id, payload };\n}\n\n/**\n * Make response object for given message id\n * @param messageId Id of the request message to respond to\n * @param payload Payload to respond with\n * @returns Response\n */\nexport function makeResponse<T>(messageId: string, payload: T): Response<T> {\n return { id: messageId, payload };\n}\n\n/**\n * Request data from the parent window and wait for response\n * @param request Request message to send to the parent window\n * @param timeout Timeout in ms\n * @returns Payload of the given type, or undefined\n */\nexport async function requestParentResponse<T>(\n request: string,\n timeout = 30000\n): Promise<T> {\n if (window.opener == null) {\n throw new Error('window.opener is null, unable to send request.');\n }\n return new Promise((resolve, reject) => {\n let timeoutId: number;\n const id = shortid();\n const listener = (event: MessageEvent<Response<T>>) => {\n const { data } = event;\n log.debug('Received message', data);\n if (data?.id !== id) {\n log.debug(\"Ignore message, id doesn't match\", data);\n return;\n }\n window.clearTimeout(timeoutId);\n window.removeEventListener('message', listener);\n resolve(data.payload);\n };\n window.addEventListener('message', listener);\n timeoutId = window.setTimeout(() => {\n window.removeEventListener('message', listener);\n reject(new TimeoutError('Request timed out'));\n }, timeout);\n window.opener.postMessage(makeMessage(request, id), '*');\n });\n}\n","import React, { createContext, useEffect, useState } from 'react';\nimport { useApi } from '@deephaven/jsapi-bootstrap';\nimport { ConnectOptions, CoreClient } from '@deephaven/jsapi-types';\n\nexport const ClientContext = createContext<CoreClient | null>(null);\n\nexport type ClientBootstrapProps = {\n /** URL of the server to connect to */\n serverUrl: string;\n\n /** Connection options to pass to CoreClient when connecting */\n options?: ConnectOptions;\n\n /**\n * The children to render wrapped with the ClientContext.\n * Will not render children until the client is created.\n */\n children: React.ReactNode;\n};\n\n/**\n * ClientBootstrap component. Handles creating the client.\n */\nexport function ClientBootstrap({\n serverUrl,\n options,\n children,\n}: ClientBootstrapProps) {\n const api = useApi();\n const [client, setClient] = useState<CoreClient>();\n useEffect(\n function initClient() {\n const newClient = new api.CoreClient(serverUrl, options);\n setClient(newClient);\n return () => {\n newClient.disconnect();\n };\n },\n [api, options, serverUrl]\n );\n\n if (client == null) {\n return null;\n }\n return (\n <ClientContext.Provider value={client}>{children}</ClientContext.Provider>\n );\n}\n\nexport default ClientBootstrap;\n","import React from 'react';\nimport { CoreClient } from '@deephaven/jsapi-types';\n\n/**\n * Map from auth config keys to their values\n * E.g. Map { AuthHandlers → \"io.deephaven.auth.AnonymousAuthenticationHandler\" }\n */\nexport type AuthConfigMap = Map<string, string>;\n\n/**\n * Props for the auth plugin component to render\n */\nexport type AuthPluginProps = {\n /** Map from config keys to their values */\n authConfigValues: AuthConfigMap;\n\n /** Client to check auth configuration on */\n client: CoreClient;\n\n /** Called when authentication is sucessful */\n onSuccess(): void;\n\n /** Called when authentication fails */\n onFailure(error: unknown): void;\n};\n\nexport type AuthPluginComponent = React.FunctionComponent<AuthPluginProps>;\n\n/**\n * Whether the auth plugin is available given the current configuration\n */\nexport type AuthPluginIsAvailableFunction = (authHandlers: string[]) => boolean;\n\nexport type AuthPlugin = {\n Component: AuthPluginComponent;\n isAvailable: AuthPluginIsAvailableFunction;\n};\n\nexport function isAuthPlugin(plugin?: unknown): plugin is AuthPlugin {\n if (plugin == null) return false;\n const authPlugin = plugin as AuthPlugin;\n return (\n authPlugin.Component !== undefined &&\n typeof authPlugin.isAvailable === 'function'\n );\n}\n","/* eslint-disable global-require */\n/**\n * remote-component.config.js\n *\n * Dependencies for Remote Components\n */\nimport react from 'react';\nimport * as redux from 'redux';\nimport * as reactRedux from 'react-redux';\nimport ReactDOM from 'react-dom';\n\n// eslint-disable-next-line import/prefer-default-export\nexport const resolve = {\n react,\n 'react-dom': ReactDOM,\n redux,\n 'react-redux': reactRedux,\n};\n","import {\n createRemoteComponent,\n createRequires,\n} from '@paciolan/remote-component';\nimport { resolve } from './remote-component.config';\n\nconst requires = createRequires(() => resolve);\n\nexport const RemoteComponent = createRemoteComponent({ requires });\nexport default RemoteComponent;\n","import createLoadRemoteModule, {\n createRequires,\n} from '@paciolan/remote-module-loader';\nimport { resolve } from './remote-component.config';\n\nconst requires = createRequires(resolve);\n\nexport const loadRemoteModule: {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (url: string): Promise<any>;\n} = createLoadRemoteModule({\n requires,\n});\n\nexport default loadRemoteModule;\n","import React, { ForwardRefExoticComponent } from 'react';\nimport {\n AuthPlugin,\n AuthPluginComponent,\n isAuthPlugin,\n} from '@deephaven/auth-plugins';\nimport Log from '@deephaven/log';\nimport RemoteComponent from './RemoteComponent';\nimport loadRemoteModule from './loadRemoteModule';\n\nconst log = Log.module('@deephaven/app-utils.PluginUtils');\n\n// A PluginModule. This interface should have new fields added to it from different levels of plugins.\n// eslint-disable-next-line @typescript-eslint/no-empty-interface\nexport interface PluginModule {}\n\nexport type PluginModuleMap = Map<string, PluginModule>;\n\n/**\n * Load a component plugin from the server.\n * @param baseURL Base URL of the plugin server\n * @param pluginName Name of the component plugin to load\n * @returns A lazily loaded JSX.Element from the plugin\n */\nexport function loadComponentPlugin(\n baseURL: URL,\n pluginName: string\n): ForwardRefExoticComponent<React.RefAttributes<unknown>> {\n const pluginUrl = new URL(`${pluginName}.js`, baseURL);\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const Plugin: any = React.forwardRef((props, ref) => (\n <RemoteComponent\n url={pluginUrl.href}\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n render={({ err, Component }: { err: unknown; Component: any }) => {\n if (err != null && err !== '') {\n const errorMessage = `Error loading plugin ${pluginName} from ${pluginUrl} due to ${err}`;\n log.error(errorMessage);\n return <div className=\"error-message\">{`${errorMessage}`}</div>;\n }\n // eslint-disable-next-line react/jsx-props-no-spreading\n return <Component ref={ref} {...props} />;\n }}\n />\n ));\n Plugin.pluginName = pluginName;\n Plugin.displayName = 'Plugin';\n return Plugin;\n}\n\n/**\n * Imports a commonjs plugin module from the provided URL\n * @param pluginUrl The URL of the plugin to load\n * @returns The loaded module\n */\nexport async function loadModulePlugin(pluginUrl: string): Promise<unknown> {\n const myModule = await loadRemoteModule(pluginUrl);\n return myModule;\n}\n\n/**\n * Loads a JSON file and returns the JSON object\n * @param jsonUrl The URL of the JSON file to load\n * @returns The JSON object of the manifest file\n */\nexport async function loadJson(\n jsonUrl: string\n): Promise<{ plugins: { name: string; main: string }[] }> {\n const res = await fetch(jsonUrl);\n if (!res.ok) {\n throw new Error(res.statusText);\n }\n try {\n return await res.json();\n } catch {\n throw new Error('Could not be parsed as JSON');\n }\n}\n\n/**\n * Load all plugin modules available.\n * @param modulePluginsUrl The base URL of the module plugins to load\n * @returns A map from the name of the plugin to the plugin module that was loaded\n */\nexport async function loadModulePlugins(\n modulePluginsUrl: string\n): Promise<PluginModuleMap> {\n log.debug('Loading plugins...');\n try {\n const manifest = await loadJson(`${modulePluginsUrl}/manifest.json`);\n\n if (!Array.isArray(manifest.plugins)) {\n throw new Error('Plugin manifest JSON does not contain plugins array');\n }\n\n log.debug('Plugin manifest loaded:', manifest);\n const pluginPromises: Promise<unknown>[] = [];\n for (let i = 0; i < manifest.plugins.length; i += 1) {\n const { name, main } = manifest.plugins[i];\n const pluginMainUrl = `${modulePluginsUrl}/${name}/${main}`;\n pluginPromises.push(loadModulePlugin(pluginMainUrl));\n }\n const pluginModules = await Promise.allSettled(pluginPromises);\n\n const pluginMap: PluginModuleMap = new Map();\n for (let i = 0; i < pluginModules.length; i += 1) {\n const module = pluginModules[i];\n const { name } = manifest.plugins[i];\n if (module.status === 'fulfilled') {\n pluginMap.set(name, module.value as PluginModule);\n } else {\n log.error(`Unable to load plugin ${name}`, module.reason);\n }\n }\n log.info('Plugins loaded:', pluginMap);\n\n return pluginMap;\n } catch (e) {\n log.error('Unable to load plugins:', e);\n return new Map();\n }\n}\n\nexport function getAuthHandlers(\n authConfigValues: Map<string, string>\n): string[] {\n return authConfigValues.get('AuthHandlers')?.split(',') ?? [];\n}\n\n/**\n * Get the auth plugin component from the plugin map and current configuration\n * Throws if no auth plugin is available\n *\n * @param pluginMap Map of plugins loaded from the server\n * @param authConfigValues Auth config values from the server\n * @param corePlugins Map of core auth plugins to include in the list. They are added after the loaded plugins\n * @returns The auth plugin component to render\n */\nexport function getAuthPluginComponent(\n pluginMap: PluginModuleMap,\n authConfigValues: Map<string, string>,\n corePlugins?: Map<string, AuthPlugin>\n): AuthPluginComponent {\n const authHandlers = getAuthHandlers(authConfigValues);\n // Filter out all the plugins that are auth plugins, and then map them to [pluginName, AuthPlugin] pairs\n // Uses some pretty disgusting casting, because TypeScript wants to treat it as an (string | AuthPlugin)[] array instead\n const authPlugins = ([\n ...pluginMap.entries(),\n ].filter(([, plugin]: [string, { AuthPlugin?: AuthPlugin }]) =>\n isAuthPlugin(plugin.AuthPlugin)\n ) as [string, { AuthPlugin: AuthPlugin }][]).map(([name, plugin]) => [\n name,\n plugin.AuthPlugin,\n ]) as [string, AuthPlugin][];\n\n // Add all the core plugins in priority\n authPlugins.push(...(corePlugins ?? []));\n\n // Filter the available auth plugins\n\n const availableAuthPlugins = authPlugins.filter(([name, authPlugin]) =>\n authPlugin.isAvailable(authHandlers)\n );\n\n if (availableAuthPlugins.length === 0) {\n throw new Error(\n `No login plugins found, please register a login plugin for auth handlers: ${authHandlers}`\n );\n } else if (availableAuthPlugins.length > 1) {\n log.warn(\n 'More than one login plugin available, will use the first one: ',\n availableAuthPlugins.map(([name]) => name).join(', ')\n );\n }\n\n const [loginPluginName, NewLoginPlugin] = availableAuthPlugins[0];\n log.info('Using LoginPlugin', loginPluginName);\n\n return NewLoginPlugin.Component;\n}\n","import React, { createContext, useEffect, useState } from 'react';\nimport { PluginModuleMap, loadModulePlugins } from '../plugins';\n\nexport const PluginsContext = createContext<PluginModuleMap | null>(null);\n\nexport type PluginsBootstrapProps = {\n /**\n * Base URL of the plugins to load.\n */\n pluginsUrl: string;\n\n /**\n * The children to render wrapped with the PluginsContext.\n * Note that it renders the children even if the plugins aren't loaded yet.\n */\n children: React.ReactNode;\n};\n\n/**\n * PluginsBootstrap component. Handles loading the plugins.\n */\nexport function PluginsBootstrap({\n pluginsUrl,\n children,\n}: PluginsBootstrapProps) {\n const [plugins, setPlugins] = useState<PluginModuleMap | null>(null);\n useEffect(\n function initPlugins() {\n let isCancelled = false;\n async function loadPlugins() {\n const pluginModules = await loadModulePlugins(pluginsUrl);\n if (!isCancelled) {\n setPlugins(pluginModules);\n }\n }\n loadPlugins();\n return () => {\n isCancelled = true;\n };\n },\n [pluginsUrl]\n );\n\n return (\n <PluginsContext.Provider value={plugins}>\n {children}\n </PluginsContext.Provider>\n );\n}\n\nexport default PluginsBootstrap;\n","import { useContext } from 'react';\nimport { ClientContext } from './ClientBootstrap';\n\nexport function useClient() {\n const client = useContext(ClientContext);\n if (client == null) {\n throw new Error(\n 'No Client available in useClient. Was code wrapped in ClientBootstrap or ClientContext.Provider?'\n );\n }\n return client;\n}\n\nexport default useClient;\n","import React, { createContext, useEffect, useState } from 'react';\nimport { LoadingOverlay } from '@deephaven/components';\nimport { useApi } from '@deephaven/jsapi-bootstrap';\nimport { IdeConnection } from '@deephaven/jsapi-types';\nimport Log from '@deephaven/log';\nimport useClient from './useClient';\n\nconst log = Log.module('@deephaven/jsapi-components.ConnectionBootstrap');\n\nexport const ConnectionContext = createContext<IdeConnection | null>(null);\n\nexport type ConnectionBootstrapProps = {\n /**\n * The children to render wrapped with the ConnectionContext.\n * Will not render children until the connection is created.\n */\n children: React.ReactNode;\n};\n\n/**\n * ConnectionBootstrap component. Handles initializing the connection.\n */\nexport function ConnectionBootstrap({ children }: ConnectionBootstrapProps) {\n const api = useApi();\n const client = useClient();\n const [error, setError] = useState<unknown>();\n const [connection, setConnection] = useState<IdeConnection>();\n useEffect(\n function initConnection() {\n let isCancelled = false;\n async function loadConnection() {\n try {\n const newConnection = await client.getAsIdeConnection();\n if (isCancelled) {\n return;\n }\n setConnection(newConnection);\n } catch (e) {\n if (isCancelled) {\n return;\n }\n setError(e);\n }\n }\n loadConnection();\n return () => {\n isCancelled = true;\n };\n },\n [api, client]\n );\n\n useEffect(\n function listenForShutdown() {\n if (connection == null) return;\n\n function handleShutdown(event: CustomEvent) {\n const { detail } = event;\n log.info('Shutdown', `${JSON.stringify(detail)}`);\n setError(`Server shutdown: ${detail ?? 'Unknown reason'}`);\n }\n\n const removerFn = connection.addEventListener(\n api.IdeConnection.EVENT_SHUTDOWN,\n handleShutdown\n );\n return removerFn;\n },\n [api, connection]\n );\n\n if (connection == null || error != null) {\n return (\n <LoadingOverlay\n data-testid=\"connection-bootstrap-loading\"\n isLoading={connection == null}\n errorMessage={`${error}`}\n />\n );\n }\n\n return (\n <ConnectionContext.Provider value={connection}>\n {children}\n </ConnectionContext.Provider>\n );\n}\n\nexport default ConnectionBootstrap;\n","import { ConnectOptions } from '@deephaven/jsapi-types';\n\n/**\n * Get the base URL of the API\n * @param apiUrl API URL\n * @returns URL for the base of the API\n */\nexport function getBaseUrl(apiUrl: string): URL {\n return new URL(apiUrl, `${window.location}`);\n}\n\n/**\n * Get the Envoy prefix header value\n * @returns Envoy prefix header value\n */\nexport function getEnvoyPrefix(): string | null {\n const searchParams = new URLSearchParams(window.location.search);\n return searchParams.get('envoyPrefix');\n}\n\nexport function getConnectOptions(): ConnectOptions {\n const envoyPrefix = getEnvoyPrefix();\n return envoyPrefix != null\n ? { headers: { 'envoy-prefix': envoyPrefix } }\n : { headers: {} };\n}\n","import { useContext } from 'react';\nimport { PluginsContext } from './PluginsBootstrap';\n\nexport function usePlugins() {\n const plugins = useContext(PluginsContext);\n if (plugins == null) {\n throw new Error(\n 'No Plugins available in usePlugins. Was code wrapped in PluginsBootstrap or PluginsContext.Provider?'\n );\n }\n return plugins;\n}\n\nexport default usePlugins;\n","import { useContext } from 'react';\nimport { ConnectionContext } from './ConnectionBootstrap';\n\nexport function useConnection() {\n const connection = useContext(ConnectionContext);\n if (connection == null) {\n throw new Error(\n 'No IdeConnection available in useConnection. Was code wrapped in ConnectionBootstrap or ConnectionContext.Provider?'\n );\n }\n return connection;\n}\n\nexport default useConnection;\n"],"names":["TimeoutError","TimeoutError$1","useApi","dh","useContext","ApiContext","log","Log","LOGIN_OPTIONS_REQUEST","SESSION_DETAILS_REQUEST","makeMessage","message","id","shortid","payload","requestParentResponse","request","timeout","resolve","reject","timeoutId","listener","event","data","ClientContext","createContext","ClientBootstrap","serverUrl","options","children","api","client","setClient","useState","useEffect","newClient","isAuthPlugin","plugin","authPlugin","react","ReactDOM","redux","reactRedux","requires","createRequires","RemoteComponent","createRemoteComponent","RemoteComponent$1","loadRemoteModule","createLoadRemoteModule","loadRemoteModule$1","loadComponentPlugin","baseURL","pluginName","pluginUrl","Plugin","React","props","ref","jsx","err","Component","errorMessage","loadModulePlugin","loadJson","jsonUrl","res","loadModulePlugins","modulePluginsUrl","manifest","pluginPromises","i","name","main","pluginMainUrl","pluginModules","pluginMap","module","e","getAuthHandlers","authConfigValues","getAuthPluginComponent","corePlugins","authHandlers","authPlugins","availableAuthPlugins","loginPluginName","NewLoginPlugin","PluginsContext","PluginsBootstrap","pluginsUrl","plugins","setPlugins","isCancelled","loadPlugins","useClient","ConnectionContext","ConnectionBootstrap","error","setError","connection","setConnection","loadConnection","newConnection","handleShutdown","detail","LoadingOverlay","getBaseUrl","apiUrl","getEnvoyPrefix","getConnectOptions","envoyPrefix","usePlugins","useConnection"],"mappings":"oKAAA,MAAMA,UAAqB,KAAM,CAC/B,UAAY,EACd,CAEA,MAAAC,EAAeD,ECDFE,EAAS,IAAM,CACpB,MAAAC,EAAKC,aAAWC,CAAU,EAChC,GAAIF,GAAM,KACR,MAAM,IAAI,MACR,sFAAA,EAGG,OAAAA,CACT,ECPMG,EAAMC,EAAI,OAAO,cAAc,EAExBC,EACX,4CAEWC,EACX,8CAoBK,SAASC,EACdC,EACAC,EAAKC,EAAA,EACLC,EACY,CACL,MAAA,CAAE,QAAAH,EAAS,GAAAC,EAAI,QAAAE,EACxB,CAkBsB,eAAAC,EACpBC,EACAC,EAAU,IACE,CACR,GAAA,OAAO,QAAU,KACb,MAAA,IAAI,MAAM,gDAAgD,EAElE,OAAO,IAAI,QAAQ,CAACC,EAASC,IAAW,CAClC,IAAAC,EACJ,MAAMR,EAAKC,IACLQ,EAAYC,GAAqC,CAC/C,KAAA,CAAE,KAAAC,CAAS,EAAAD,EAEb,GADAhB,EAAA,MAAM,mBAAoBiB,CAAI,EAC9BA,GAAM,KAAOX,EAAI,CACfN,EAAA,MAAM,mCAAoCiB,CAAI,EAClD,MACF,CACA,OAAO,aAAaH,CAAS,EACtB,OAAA,oBAAoB,UAAWC,CAAQ,EAC9CH,EAAQK,EAAK,OAAO,CAAA,EAEf,OAAA,iBAAiB,UAAWF,CAAQ,EAC/BD,EAAA,OAAO,WAAW,IAAM,CAC3B,OAAA,oBAAoB,UAAWC,CAAQ,EACvCF,EAAA,IAAInB,EAAa,mBAAmB,CAAC,GAC3CiB,CAAO,EACV,OAAO,OAAO,YAAYP,EAAYM,EAASJ,CAAE,EAAG,GAAG,CAAA,CACxD,CACH,CC9Ea,MAAAY,EAAgBC,gBAAiC,IAAI,EAmB3D,SAASC,GAAgB,CAC9B,UAAAC,EACA,QAAAC,EACA,SAAAC,CAC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,KACzB,aAAc,GAAGF,GAAA,CAAA,QAMpBF,EAAkB,SAAlB,CAA2B,MAAOI,EAChC,SAAAvE,CACH,CAAA,CAEJ,CC/EO,SAAS8E,GAAWC,EAAqB,CAC9C,OAAO,IAAI,IAAIA,EAAQ,GAAG,OAAO,UAAU,CAC7C,CAMO,SAASC,GAAgC,CAEvC,OADc,IAAI,gBAAgB,OAAO,SAAS,MAAM,EAC3C,IAAI,aAAa,CACvC,CAEO,SAASC,IAAoC,CAClD,MAAMC,EAAcF,IACpB,OAAOE,GAAe,KAClB,CAAE,QAAS,CAAE,eAAgBA,CAAY,GACzC,CAAE,QAAS,CAAA,EACjB,CCtBO,SAASC,IAAa,CACrB,MAAArB,EAAUvF,aAAWoF,CAAc,EACzC,GAAIG,GAAW,KACb,MAAM,IAAI,MACR,sGAAA,EAGG,OAAAA,CACT,CCRO,SAASsB,IAAgB,CACxB,MAAAb,EAAahG,aAAW4F,CAAiB,EAC/C,GAAII,GAAc,KAChB,MAAM,IAAI,MACR,qHAAA,EAGG,OAAAA,CACT"}
|
package/build/index.html
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<!DOCTYPE html>
|
|
2
2
|
<html lang="en">
|
|
3
3
|
<head>
|
|
4
|
-
<meta name="ui-version" content="v0.37.
|
|
4
|
+
<meta name="ui-version" content="v0.37.1" />
|
|
5
5
|
<meta charset="utf-8" />
|
|
6
6
|
<meta
|
|
7
7
|
name="viewport"
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
<link rel="manifest" href="/ide/manifest.json" />
|
|
16
16
|
<link rel="icon" href="/ide/favicon-cc-app.svg" />
|
|
17
17
|
<title>Deephaven</title>
|
|
18
|
-
<script type="module" crossorigin src="/ide/assets/index-
|
|
18
|
+
<script type="module" crossorigin src="/ide/assets/index-05ede71e.js"></script>
|
|
19
19
|
<link rel="modulepreload" crossorigin href="/ide/assets/monaco-a26f85af.js">
|
|
20
20
|
<link rel="modulepreload" crossorigin href="/ide/assets/helpers-042e6b4d.js">
|
|
21
21
|
<link rel="modulepreload" crossorigin href="/ide/assets/vendor-ef910ebc.js">
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@deephaven/code-studio",
|
|
3
|
-
"version": "0.37.1
|
|
3
|
+
"version": "0.37.1",
|
|
4
4
|
"description": "Deephaven Code Studio",
|
|
5
5
|
"author": "Deephaven Data Labs LLC",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -11,30 +11,30 @@
|
|
|
11
11
|
"directory": "packages/code-studio"
|
|
12
12
|
},
|
|
13
13
|
"dependencies": {
|
|
14
|
-
"@deephaven/app-utils": "^0.37.
|
|
15
|
-
"@deephaven/auth-plugins": "^0.37.
|
|
16
|
-
"@deephaven/chart": "^0.37.
|
|
17
|
-
"@deephaven/components": "^0.37.
|
|
18
|
-
"@deephaven/console": "^0.37.
|
|
19
|
-
"@deephaven/dashboard": "^0.37.
|
|
20
|
-
"@deephaven/dashboard-core-plugins": "^0.37.
|
|
21
|
-
"@deephaven/file-explorer": "^0.37.
|
|
22
|
-
"@deephaven/filters": "^0.37.
|
|
23
|
-
"@deephaven/golden-layout": "^0.37.
|
|
24
|
-
"@deephaven/grid": "^0.37.
|
|
25
|
-
"@deephaven/icons": "^0.37.
|
|
26
|
-
"@deephaven/iris-grid": "^0.37.
|
|
27
|
-
"@deephaven/jsapi-bootstrap": "^0.37.
|
|
28
|
-
"@deephaven/jsapi-components": "^0.37.1
|
|
29
|
-
"@deephaven/jsapi-shim": "^0.37.
|
|
30
|
-
"@deephaven/jsapi-types": "^0.37.
|
|
31
|
-
"@deephaven/jsapi-utils": "^0.37.
|
|
32
|
-
"@deephaven/log": "^0.37.
|
|
33
|
-
"@deephaven/pouch-storage": "^0.37.
|
|
34
|
-
"@deephaven/react-hooks": "^0.37.
|
|
35
|
-
"@deephaven/redux": "^0.37.
|
|
36
|
-
"@deephaven/storage": "^0.37.
|
|
37
|
-
"@deephaven/utils": "^0.37.
|
|
14
|
+
"@deephaven/app-utils": "^0.37.0",
|
|
15
|
+
"@deephaven/auth-plugins": "^0.37.0",
|
|
16
|
+
"@deephaven/chart": "^0.37.0",
|
|
17
|
+
"@deephaven/components": "^0.37.0",
|
|
18
|
+
"@deephaven/console": "^0.37.0",
|
|
19
|
+
"@deephaven/dashboard": "^0.37.0",
|
|
20
|
+
"@deephaven/dashboard-core-plugins": "^0.37.0",
|
|
21
|
+
"@deephaven/file-explorer": "^0.37.0",
|
|
22
|
+
"@deephaven/filters": "^0.37.0",
|
|
23
|
+
"@deephaven/golden-layout": "^0.37.0",
|
|
24
|
+
"@deephaven/grid": "^0.37.0",
|
|
25
|
+
"@deephaven/icons": "^0.37.0",
|
|
26
|
+
"@deephaven/iris-grid": "^0.37.0",
|
|
27
|
+
"@deephaven/jsapi-bootstrap": "^0.37.0",
|
|
28
|
+
"@deephaven/jsapi-components": "^0.37.1",
|
|
29
|
+
"@deephaven/jsapi-shim": "^0.37.0",
|
|
30
|
+
"@deephaven/jsapi-types": "^0.37.0",
|
|
31
|
+
"@deephaven/jsapi-utils": "^0.37.0",
|
|
32
|
+
"@deephaven/log": "^0.37.0",
|
|
33
|
+
"@deephaven/pouch-storage": "^0.37.0",
|
|
34
|
+
"@deephaven/react-hooks": "^0.37.0",
|
|
35
|
+
"@deephaven/redux": "^0.37.0",
|
|
36
|
+
"@deephaven/storage": "^0.37.0",
|
|
37
|
+
"@deephaven/utils": "^0.37.0",
|
|
38
38
|
"@fortawesome/fontawesome-svg-core": "^6.2.1",
|
|
39
39
|
"@fortawesome/react-fontawesome": "^0.2.0",
|
|
40
40
|
"classnames": "^2.3.1",
|
|
@@ -75,11 +75,11 @@
|
|
|
75
75
|
"update-licenses": "npm-license > licenses.txt"
|
|
76
76
|
},
|
|
77
77
|
"devDependencies": {
|
|
78
|
-
"@deephaven/eslint-config": "^0.37.
|
|
79
|
-
"@deephaven/mocks": "^0.37.
|
|
80
|
-
"@deephaven/prettier-config": "^0.37.
|
|
81
|
-
"@deephaven/stylelint-config": "^0.37.
|
|
82
|
-
"@deephaven/tsconfig": "^0.37.
|
|
78
|
+
"@deephaven/eslint-config": "^0.37.0",
|
|
79
|
+
"@deephaven/mocks": "^0.37.0",
|
|
80
|
+
"@deephaven/prettier-config": "^0.37.0",
|
|
81
|
+
"@deephaven/stylelint-config": "^0.37.0",
|
|
82
|
+
"@deephaven/tsconfig": "^0.37.0",
|
|
83
83
|
"@vitejs/plugin-react-swc": "^3.2.0",
|
|
84
84
|
"autoprefixer": "^10.4.8",
|
|
85
85
|
"vite": "^4.1.4"
|
|
@@ -87,5 +87,5 @@
|
|
|
87
87
|
"publishConfig": {
|
|
88
88
|
"access": "public"
|
|
89
89
|
},
|
|
90
|
-
"gitHead": "
|
|
90
|
+
"gitHead": "3b581795f7869534e5606dd01cfdc28120f623aa"
|
|
91
91
|
}
|