@deephaven/app-utils 0.50.1-beta.5 → 0.51.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. package/dist/components/AppBootstrap.js.map +1 -1
  2. package/dist/components/AuthBootstrap.js +1 -1
  3. package/dist/components/AuthBootstrap.js.map +1 -1
  4. package/dist/components/ConnectionBootstrap.d.ts +0 -2
  5. package/dist/components/ConnectionBootstrap.d.ts.map +1 -1
  6. package/dist/components/ConnectionBootstrap.js +3 -3
  7. package/dist/components/ConnectionBootstrap.js.map +1 -1
  8. package/dist/components/FontBootstrap.js.map +1 -1
  9. package/dist/components/FontsLoaded.js.map +1 -1
  10. package/dist/components/LoginNotifier.js.map +1 -1
  11. package/dist/components/PluginsBootstrap.d.ts +1 -3
  12. package/dist/components/PluginsBootstrap.d.ts.map +1 -1
  13. package/dist/components/PluginsBootstrap.js +2 -2
  14. package/dist/components/PluginsBootstrap.js.map +1 -1
  15. package/dist/components/ServerConfigBootstrap.js.map +1 -1
  16. package/dist/components/ThemeBootstrap.js +2 -2
  17. package/dist/components/ThemeBootstrap.js.map +1 -1
  18. package/dist/components/UserBootstrap.js.map +1 -1
  19. package/dist/components/index.d.ts +0 -3
  20. package/dist/components/index.d.ts.map +1 -1
  21. package/dist/components/index.js +0 -3
  22. package/dist/components/index.js.map +1 -1
  23. package/dist/components/useServerConfig.js.map +1 -1
  24. package/dist/components/useUser.js.map +1 -1
  25. package/dist/plugins/PluginUtils.d.ts +1 -2
  26. package/dist/plugins/PluginUtils.d.ts.map +1 -1
  27. package/dist/plugins/PluginUtils.js.map +1 -1
  28. package/dist/utils/ConnectUtils.js.map +1 -1
  29. package/package.json +16 -16
  30. package/dist/components/useConnection.d.ts +0 -4
  31. package/dist/components/useConnection.d.ts.map +0 -1
  32. package/dist/components/useConnection.js +0 -7
  33. package/dist/components/useConnection.js.map +0 -1
  34. package/dist/components/useLoadTablePlugin.d.ts +0 -8
  35. package/dist/components/useLoadTablePlugin.d.ts.map +0 -1
  36. package/dist/components/useLoadTablePlugin.js +0 -31
  37. package/dist/components/useLoadTablePlugin.js.map +0 -1
  38. package/dist/components/usePlugins.d.ts +0 -4
  39. package/dist/components/usePlugins.d.ts.map +0 -1
  40. package/dist/components/usePlugins.js +0 -7
  41. package/dist/components/usePlugins.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"AppBootstrap.js","names":["React","useCallback","useMemo","useState","ClientBootstrap","RefreshTokenBootstrap","useBroadcastLoginListener","FontBootstrap","PluginsBootstrap","AuthBootstrap","ConnectionBootstrap","getConnectOptions","FontsLoaded","UserBootstrap","ServerConfigBootstrap","ThemeBootstrap","AppBootstrap","fontClassNames","pluginsUrl","getCorePlugins","serverUrl","children","clientOptions","logoutCount","setLogoutCount","onLogin","undefined","onLogout","value"],"sources":["../../src/components/AppBootstrap.tsx"],"sourcesContent":["import React, { useCallback, useMemo, useState } from 'react';\nimport '@deephaven/components/scss/BaseStyleSheet.scss';\nimport { ClientBootstrap } from '@deephaven/jsapi-bootstrap';\nimport {\n RefreshTokenBootstrap,\n useBroadcastLoginListener,\n} from '@deephaven/jsapi-components';\nimport { type Plugin } from '@deephaven/plugin';\nimport FontBootstrap from './FontBootstrap';\nimport PluginsBootstrap from './PluginsBootstrap';\nimport AuthBootstrap from './AuthBootstrap';\nimport ConnectionBootstrap from './ConnectionBootstrap';\nimport { getConnectOptions } from '../utils';\nimport FontsLoaded from './FontsLoaded';\nimport UserBootstrap from './UserBootstrap';\nimport ServerConfigBootstrap from './ServerConfigBootstrap';\nimport ThemeBootstrap from './ThemeBootstrap';\n\nexport type AppBootstrapProps = {\n /** URL of the server. */\n serverUrl: string;\n\n /** URL of the plugins to load. */\n pluginsUrl: string;\n\n /** The core plugins to load. */\n getCorePlugins?: () => Promise<Plugin[]>;\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 fontClassNames,\n pluginsUrl,\n getCorePlugins,\n serverUrl,\n children,\n}: AppBootstrapProps): JSX.Element {\n const clientOptions = useMemo(() => getConnectOptions(), []);\n\n // On logout, we reset the client and have user login again\n const [logoutCount, setLogoutCount] = useState(0);\n const onLogin = useCallback(() => undefined, []);\n const onLogout = useCallback(() => {\n setLogoutCount(value => value + 1);\n }, []);\n useBroadcastLoginListener(onLogin, onLogout);\n return (\n <FontBootstrap fontClassNames={fontClassNames}>\n <PluginsBootstrap getCorePlugins={getCorePlugins} pluginsUrl={pluginsUrl}>\n <ThemeBootstrap>\n <ClientBootstrap\n serverUrl={serverUrl}\n options={clientOptions}\n key={logoutCount}\n >\n <RefreshTokenBootstrap>\n <AuthBootstrap>\n <ServerConfigBootstrap>\n <UserBootstrap>\n <ConnectionBootstrap>\n <FontsLoaded>{children}</FontsLoaded>\n </ConnectionBootstrap>\n </UserBootstrap>\n </ServerConfigBootstrap>\n </AuthBootstrap>\n </RefreshTokenBootstrap>\n </ClientBootstrap>\n </ThemeBootstrap>\n </PluginsBootstrap>\n </FontBootstrap>\n );\n}\n\nexport default AppBootstrap;\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,WAAW,EAAEC,OAAO,EAAEC,QAAQ,QAAQ,OAAO;AAC7D,OAAO,gDAAgD;AACvD,SAASC,eAAe,QAAQ,4BAA4B;AAC5D,SACEC,qBAAqB,EACrBC,yBAAyB,QACpB,6BAA6B;AAAC,OAE9BC,aAAa;AAAA,OACbC,gBAAgB;AAAA,OAChBC,aAAa;AAAA,OACbC,mBAAmB;AAAA,SACjBC,iBAAiB;AAAA,OACnBC,WAAW;AAAA,OACXC,aAAa;AAAA,OACbC,qBAAqB;AAAA,OACrBC,cAAc;AAAA;AAqBrB;AACA;AACA;AACA;AACA,OAAO,SAASC,YAAY,OAMO;EAAA,IANN;IAC3BC,cAAc;IACdC,UAAU;IACVC,cAAc;IACdC,SAAS;IACTC;EACiB,CAAC;EAClB,IAAMC,aAAa,GAAGpB,OAAO,CAAC,MAAMS,iBAAiB,EAAE,EAAE,EAAE,CAAC;;EAE5D;EACA,IAAM,CAACY,WAAW,EAAEC,cAAc,CAAC,GAAGrB,QAAQ,CAAC,CAAC,CAAC;EACjD,IAAMsB,OAAO,GAAGxB,WAAW,CAAC,MAAMyB,SAAS,EAAE,EAAE,CAAC;EAChD,IAAMC,QAAQ,GAAG1B,WAAW,CAAC,MAAM;IACjCuB,cAAc,CAACI,KAAK,IAAIA,KAAK,GAAG,CAAC,CAAC;EACpC,CAAC,EAAE,EAAE,CAAC;EACNtB,yBAAyB,CAACmB,OAAO,EAAEE,QAAQ,CAAC;EAC5C,oBACE,KAAC,aAAa;IAAC,cAAc,EAAEV,cAAe;IAAA,uBAC5C,KAAC,gBAAgB;MAAC,cAAc,EAAEE,cAAe;MAAC,UAAU,EAAED,UAAW;MAAA,uBACvE,KAAC,cAAc;QAAA,uBACb,KAAC,eAAe;UACd,SAAS,EAAEE,SAAU;UACrB,OAAO,EAAEE,aAAc;UAAA,uBAGvB,KAAC,qBAAqB;YAAA,uBACpB,KAAC,aAAa;cAAA,uBACZ,KAAC,qBAAqB;gBAAA,uBACpB,KAAC,aAAa;kBAAA,uBACZ,KAAC,mBAAmB;oBAAA,uBAClB,KAAC,WAAW;sBAAA,UAAED;oBAAQ;kBAAe;gBACjB;cACR;YACM;UACV;QACM,GAZnBE,WAAW;MAaA;IACH;EACA,EACL;AAEpB;AAEA,eAAeP,YAAY"}
1
+ {"version":3,"file":"AppBootstrap.js","names":["React","useCallback","useMemo","useState","ClientBootstrap","RefreshTokenBootstrap","useBroadcastLoginListener","FontBootstrap","PluginsBootstrap","AuthBootstrap","ConnectionBootstrap","getConnectOptions","FontsLoaded","UserBootstrap","ServerConfigBootstrap","ThemeBootstrap","jsx","_jsx","AppBootstrap","_ref","fontClassNames","pluginsUrl","getCorePlugins","serverUrl","children","clientOptions","logoutCount","setLogoutCount","onLogin","undefined","onLogout","value","options"],"sources":["../../src/components/AppBootstrap.tsx"],"sourcesContent":["import React, { useCallback, useMemo, useState } from 'react';\nimport '@deephaven/components/scss/BaseStyleSheet.scss';\nimport { ClientBootstrap } from '@deephaven/jsapi-bootstrap';\nimport {\n RefreshTokenBootstrap,\n useBroadcastLoginListener,\n} from '@deephaven/jsapi-components';\nimport { type Plugin } from '@deephaven/plugin';\nimport FontBootstrap from './FontBootstrap';\nimport PluginsBootstrap from './PluginsBootstrap';\nimport AuthBootstrap from './AuthBootstrap';\nimport ConnectionBootstrap from './ConnectionBootstrap';\nimport { getConnectOptions } from '../utils';\nimport FontsLoaded from './FontsLoaded';\nimport UserBootstrap from './UserBootstrap';\nimport ServerConfigBootstrap from './ServerConfigBootstrap';\nimport ThemeBootstrap from './ThemeBootstrap';\n\nexport type AppBootstrapProps = {\n /** URL of the server. */\n serverUrl: string;\n\n /** URL of the plugins to load. */\n pluginsUrl: string;\n\n /** The core plugins to load. */\n getCorePlugins?: () => Promise<Plugin[]>;\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 fontClassNames,\n pluginsUrl,\n getCorePlugins,\n serverUrl,\n children,\n}: AppBootstrapProps): JSX.Element {\n const clientOptions = useMemo(() => getConnectOptions(), []);\n\n // On logout, we reset the client and have user login again\n const [logoutCount, setLogoutCount] = useState(0);\n const onLogin = useCallback(() => undefined, []);\n const onLogout = useCallback(() => {\n setLogoutCount(value => value + 1);\n }, []);\n useBroadcastLoginListener(onLogin, onLogout);\n return (\n <FontBootstrap fontClassNames={fontClassNames}>\n <PluginsBootstrap getCorePlugins={getCorePlugins} pluginsUrl={pluginsUrl}>\n <ThemeBootstrap>\n <ClientBootstrap\n serverUrl={serverUrl}\n options={clientOptions}\n key={logoutCount}\n >\n <RefreshTokenBootstrap>\n <AuthBootstrap>\n <ServerConfigBootstrap>\n <UserBootstrap>\n <ConnectionBootstrap>\n <FontsLoaded>{children}</FontsLoaded>\n </ConnectionBootstrap>\n </UserBootstrap>\n </ServerConfigBootstrap>\n </AuthBootstrap>\n </RefreshTokenBootstrap>\n </ClientBootstrap>\n </ThemeBootstrap>\n </PluginsBootstrap>\n </FontBootstrap>\n );\n}\n\nexport default AppBootstrap;\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,WAAW,EAAEC,OAAO,EAAEC,QAAQ,QAAQ,OAAO;AAC7D,OAAO,gDAAgD;AACvD,SAASC,eAAe,QAAQ,4BAA4B;AAC5D,SACEC,qBAAqB,EACrBC,yBAAyB,QACpB,6BAA6B;AAAC,OAE9BC,aAAa;AAAA,OACbC,gBAAgB;AAAA,OAChBC,aAAa;AAAA,OACbC,mBAAmB;AAAA,SACjBC,iBAAiB;AAAA,OACnBC,WAAW;AAAA,OACXC,aAAa;AAAA,OACbC,qBAAqB;AAAA,OACrBC,cAAc;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAqBrB;AACA;AACA;AACA;AACA,OAAO,SAASC,YAAYA,CAAAC,IAAA,EAMO;EAAA,IANN;IAC3BC,cAAc;IACdC,UAAU;IACVC,cAAc;IACdC,SAAS;IACTC;EACiB,CAAC,GAAAL,IAAA;EAClB,IAAMM,aAAa,GAAGvB,OAAO,CAAC,MAAMS,iBAAiB,CAAC,CAAC,EAAE,EAAE,CAAC;;EAE5D;EACA,IAAM,CAACe,WAAW,EAAEC,cAAc,CAAC,GAAGxB,QAAQ,CAAC,CAAC,CAAC;EACjD,IAAMyB,OAAO,GAAG3B,WAAW,CAAC,MAAM4B,SAAS,EAAE,EAAE,CAAC;EAChD,IAAMC,QAAQ,GAAG7B,WAAW,CAAC,MAAM;IACjC0B,cAAc,CAACI,KAAK,IAAIA,KAAK,GAAG,CAAC,CAAC;EACpC,CAAC,EAAE,EAAE,CAAC;EACNzB,yBAAyB,CAACsB,OAAO,EAAEE,QAAQ,CAAC;EAC5C,oBACEb,IAAA,CAACV,aAAa;IAACa,cAAc,EAAEA,cAAe;IAAAI,QAAA,eAC5CP,IAAA,CAACT,gBAAgB;MAACc,cAAc,EAAEA,cAAe;MAACD,UAAU,EAAEA,UAAW;MAAAG,QAAA,eACvEP,IAAA,CAACF,cAAc;QAAAS,QAAA,eACbP,IAAA,CAACb,eAAe;UACdmB,SAAS,EAAEA,SAAU;UACrBS,OAAO,EAAEP,aAAc;UAAAD,QAAA,eAGvBP,IAAA,CAACZ,qBAAqB;YAAAmB,QAAA,eACpBP,IAAA,CAACR,aAAa;cAAAe,QAAA,eACZP,IAAA,CAACH,qBAAqB;gBAAAU,QAAA,eACpBP,IAAA,CAACJ,aAAa;kBAAAW,QAAA,eACZP,IAAA,CAACP,mBAAmB;oBAAAc,QAAA,eAClBP,IAAA,CAACL,WAAW;sBAAAY,QAAA,EAAEA;oBAAQ,CAAc;kBAAC,CAClB;gBAAC,CACT;cAAC,CACK;YAAC,CACX;UAAC,CACK;QAAC,GAZnBE,WAaU;MAAC,CACJ;IAAC,CACD;EAAC,CACN,CAAC;AAEpB;AAEA,eAAeR,YAAY"}
@@ -5,7 +5,7 @@ import { AuthPluginAnonymous, AuthPluginParent, AuthPluginPsk } from '@deephaven
5
5
  import { LoadingOverlay } from '@deephaven/components';
6
6
  import { useClient } from '@deephaven/jsapi-bootstrap';
7
7
  import { getErrorMessage } from '@deephaven/utils';
8
- import { PluginsContext } from "./PluginsBootstrap.js";
8
+ import { PluginsContext } from '@deephaven/plugin';
9
9
  import { getAuthPluginComponent } from "../plugins/index.js";
10
10
  import LoginNotifier from "./LoginNotifier.js";
11
11
  import { jsx as _jsx } from "react/jsx-runtime";
@@ -1 +1 @@
1
- {"version":3,"file":"AuthBootstrap.js","names":["React","useContext","useEffect","useMemo","useState","AuthPluginAnonymous","AuthPluginParent","AuthPluginPsk","LoadingOverlay","useClient","getErrorMessage","PluginsContext","getAuthPluginComponent","LoginNotifier","CORE_AUTH_PLUGINS","Map","AuthPlugin","AuthBootstrap","children","client","plugins","authConfig","setAuthConfig","error","setError","initAuthConfigValues","isCanceled","loadAuthConfigValues","newAuthConfigValues","getAuthConfigValues","e","AuthComponent","undefined","isLoading"],"sources":["../../src/components/AuthBootstrap.tsx"],"sourcesContent":["import React, { useContext, useEffect, useMemo, useState } from 'react';\nimport {\n AuthConfigMap,\n AuthPluginAnonymous,\n AuthPluginParent,\n AuthPluginPsk,\n} from '@deephaven/auth-plugins';\nimport { LoadingOverlay } from '@deephaven/components';\nimport { useClient } from '@deephaven/jsapi-bootstrap';\nimport { getErrorMessage } from '@deephaven/utils';\nimport { PluginsContext } from './PluginsBootstrap';\nimport { getAuthPluginComponent } from '../plugins';\nimport LoginNotifier from './LoginNotifier';\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 [\n '@deephaven/auth-plugins.AuthPluginParent',\n { AuthPlugin: AuthPluginParent },\n ],\n ['@deephaven/auth-plugins.AuthPluginPsk', { AuthPlugin: AuthPluginPsk }],\n [\n '@deephaven/auth-plugins.AuthPluginAnonymous',\n { AuthPlugin: AuthPluginAnonymous },\n ],\n]);\n\n/**\n * AuthBootstrap component. Handles displaying the auth plugin and authenticating.\n */\nexport function AuthBootstrap({ children }: AuthBootstrapProps): JSX.Element {\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 [error, setError] = useState<unknown>();\n\n useEffect(\n function initAuthConfigValues() {\n let isCanceled = false;\n async function loadAuthConfigValues(): Promise<void> {\n try {\n const newAuthConfigValues = await client.getAuthConfigValues();\n if (!isCanceled) {\n setAuthConfig(new Map(newAuthConfigValues));\n }\n } catch (e) {\n if (!isCanceled) {\n setError(e);\n }\n }\n }\n loadAuthConfigValues();\n return () => {\n isCanceled = 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 isLoading = AuthComponent == null || authConfig == null;\n\n if (isLoading || error != null) {\n return (\n <LoadingOverlay\n isLoading={isLoading && error == null}\n errorMessage={getErrorMessage(error)}\n />\n );\n }\n return (\n <AuthComponent authConfigValues={authConfig}>\n <>\n <LoginNotifier />\n {children}\n </>\n </AuthComponent>\n );\n}\n\nexport default AuthBootstrap;\n"],"mappings":";;AAAA,OAAOA,KAAK,IAAIC,UAAU,EAAEC,SAAS,EAAEC,OAAO,EAAEC,QAAQ,QAAQ,OAAO;AACvE,SAEEC,mBAAmB,EACnBC,gBAAgB,EAChBC,aAAa,QACR,yBAAyB;AAChC,SAASC,cAAc,QAAQ,uBAAuB;AACtD,SAASC,SAAS,QAAQ,4BAA4B;AACtD,SAASC,eAAe,QAAQ,kBAAkB;AAAC,SAC1CC,cAAc;AAAA,SACdC,sBAAsB;AAAA,OACxBC,aAAa;AAAA;AAAA;AAAA;AASpB;AACA,IAAMC,iBAAiB,GAAG,IAAIC,GAAG,CAAC,CAChC,CACE,0CAA0C,EAC1C;EAAEC,UAAU,EAAEV;AAAiB,CAAC,CACjC,EACD,CAAC,uCAAuC,EAAE;EAAEU,UAAU,EAAET;AAAc,CAAC,CAAC,EACxE,CACE,6CAA6C,EAC7C;EAAES,UAAU,EAAEX;AAAoB,CAAC,CACpC,CACF,CAAC;;AAEF;AACA;AACA;AACA,OAAO,SAASY,aAAa,OAAgD;EAAA,IAA/C;IAAEC;EAA6B,CAAC;EAC5D,IAAMC,MAAM,GAAGV,SAAS,EAAE;EAC1B;EACA;EACA,IAAMW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AIV,KAAK,IAAI,IAAK;MACtC,YAAY,EAAEb,eAAe,CAACa,KAAK;IAAE,EACrC;EAEN;EACA,oBACE,KAAC,aAAa;IAAC,gBAAgB,EAAEF,UAAW;IAAA,uBAC1C;MAAA,wBACE,KAAC,aAAa,KAAG,EAChBH,QAAQ;IAAA;EACR,EACW;AAEpB;AAEA,eAAeD,aAAa"}
1
+ {"version":3,"file":"AuthBootstrap.js","names":["React","useContext","useEffect","useMemo","useState","AuthPluginAnonymous","AuthPluginParent","AuthPluginPsk","LoadingOverlay","useClient","getErrorMessage","PluginsContext","getAuthPluginComponent","LoginNotifier","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","CORE_AUTH_PLUGINS","Map","AuthPlugin","AuthBootstrap","_ref","children","client","plugins","authConfig","setAuthConfig","error","setError","initAuthConfigValues","isCanceled","loadAuthConfigValues","_loadAuthConfigValues","apply","arguments","_asyncToGenerator","newAuthConfigValues","getAuthConfigValues","e","AuthComponent","undefined","isLoading","errorMessage","authConfigValues"],"sources":["../../src/components/AuthBootstrap.tsx"],"sourcesContent":["import React, { useContext, useEffect, useMemo, useState } from 'react';\nimport {\n AuthConfigMap,\n AuthPluginAnonymous,\n AuthPluginParent,\n AuthPluginPsk,\n} from '@deephaven/auth-plugins';\nimport { LoadingOverlay } from '@deephaven/components';\nimport { useClient } from '@deephaven/jsapi-bootstrap';\nimport { getErrorMessage } from '@deephaven/utils';\nimport { PluginsContext } from '@deephaven/plugin';\nimport { getAuthPluginComponent } from '../plugins';\nimport LoginNotifier from './LoginNotifier';\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 [\n '@deephaven/auth-plugins.AuthPluginParent',\n { AuthPlugin: AuthPluginParent },\n ],\n ['@deephaven/auth-plugins.AuthPluginPsk', { AuthPlugin: AuthPluginPsk }],\n [\n '@deephaven/auth-plugins.AuthPluginAnonymous',\n { AuthPlugin: AuthPluginAnonymous },\n ],\n]);\n\n/**\n * AuthBootstrap component. Handles displaying the auth plugin and authenticating.\n */\nexport function AuthBootstrap({ children }: AuthBootstrapProps): JSX.Element {\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 [error, setError] = useState<unknown>();\n\n useEffect(\n function initAuthConfigValues() {\n let isCanceled = false;\n async function loadAuthConfigValues(): Promise<void> {\n try {\n const newAuthConfigValues = await client.getAuthConfigValues();\n if (!isCanceled) {\n setAuthConfig(new Map(newAuthConfigValues));\n }\n } catch (e) {\n if (!isCanceled) {\n setError(e);\n }\n }\n }\n loadAuthConfigValues();\n return () => {\n isCanceled = 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 isLoading = AuthComponent == null || authConfig == null;\n\n if (isLoading || error != null) {\n return (\n <LoadingOverlay\n isLoading={isLoading && error == null}\n errorMessage={getErrorMessage(error)}\n />\n );\n }\n return (\n <AuthComponent authConfigValues={authConfig}>\n <>\n <LoginNotifier />\n {children}\n </>\n </AuthComponent>\n );\n}\n\nexport default AuthBootstrap;\n"],"mappings":";;AAAA,OAAOA,KAAK,IAAIC,UAAU,EAAEC,SAAS,EAAEC,OAAO,EAAEC,QAAQ,QAAQ,OAAO;AACvE,SAEEC,mBAAmB,EACnBC,gBAAgB,EAChBC,aAAa,QACR,yBAAyB;AAChC,SAASC,cAAc,QAAQ,uBAAuB;AACtD,SAASC,SAAS,QAAQ,4BAA4B;AACtD,SAASC,eAAe,QAAQ,kBAAkB;AAClD,SAASC,cAAc,QAAQ,mBAAmB;AAAC,SAC1CC,sBAAsB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AC,CAAC;UACb;QACF;MACF,CAAC;MAAA,OAAAN,qBAAA,CAAAC,KAAA,OAAAC,SAAA;IAAA;IACDH,oBAAoB,CAAC,CAAC;IACtB,OAAO,MAAM;MACXD,UAAU,GAAG,IAAI;IACnB,CAAC;EACH,CAAC,EACD,CAACP,MAAM,CACT,CAAC;EAED,IAAMgB,aAAa,GAAGvC,OAAO,CAAC,MAAM;IAClC,IAAIwB,OAAO,IAAI,IAAI,IAAIC,UAAU,IAAI,IAAI,EAAE;MACzC,OAAOe,SAAS;IAClB;IAEA,IAAI;MACF,OAAO/B,sBAAsB,CAACe,OAAO,EAAEC,UAAU,EAAER,iBAAiB,CAAC;IACvE,CAAC,CAAC,OAAOqB,CAAC,EAAE;MACVV,QAAQ,CAACU,CAAC,CAAC;IACb;EACF,CAAC,EAAE,CAACb,UAAU,EAAED,OAAO,CAAC,CAAC;EAEzB,IAAMiB,SAAS,GAAGF,aAAa,IAAI,IAAI,IAAId,UAAU,IAAI,IAAI;EAE7D,IAAIgB,SAAS,IAAId,KAAK,IAAI,IAAI,EAAE;IAC9B,oBACEf,IAAA,CAACP,cAAc;MACboC,SAAS,EAAEA,SAAS,IAAId,KAAK,IAAI,IAAK;MACtCe,YAAY,EAAEnC,eAAe,CAACoB,KAAK;IAAE,CACtC,CAAC;EAEN;EACA,oBACEf,IAAA,CAAC2B,aAAa;IAACI,gBAAgB,EAAElB,UAAW;IAAAH,QAAA,eAC1CN,KAAA,CAAAF,SAAA;MAAAQ,QAAA,gBACEV,IAAA,CAACF,aAAa,IAAE,CAAC,EAChBY,QAAQ;IAAA,CACT;EAAC,CACU,CAAC;AAEpB;AAEA,eAAeF,aAAa"}
@@ -1,6 +1,4 @@
1
1
  import React from 'react';
2
- import type { IdeConnection } from '@deephaven/jsapi-types';
3
- export declare const ConnectionContext: React.Context<IdeConnection | null>;
4
2
  export type ConnectionBootstrapProps = {
5
3
  /**
6
4
  * The children to render wrapped with the ConnectionContext.
@@ -1 +1 @@
1
- {"version":3,"file":"ConnectionBootstrap.d.ts","sourceRoot":"","sources":["../../src/components/ConnectionBootstrap.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA6C,MAAM,OAAO,CAAC;AAGlE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAK5D,eAAO,MAAM,iBAAiB,qCAA4C,CAAC;AAE3E,MAAM,MAAM,wBAAwB,GAAG;IACrC;;;OAGG;IACH,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B,CAAC;AAEF;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,EAClC,QAAQ,GACT,EAAE,wBAAwB,GAAG,GAAG,CAAC,OAAO,CAgExC;AAED,eAAe,mBAAmB,CAAC"}
1
+ {"version":3,"file":"ConnectionBootstrap.d.ts","sourceRoot":"","sources":["../../src/components/ConnectionBootstrap.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8B,MAAM,OAAO,CAAC;AASnD,MAAM,MAAM,wBAAwB,GAAG;IACrC;;;OAGG;IACH,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B,CAAC;AAEF;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,EAClC,QAAQ,GACT,EAAE,wBAAwB,GAAG,GAAG,CAAC,OAAO,CAgExC;AAED,eAAe,mBAAmB,CAAC"}
@@ -1,12 +1,12 @@
1
1
  function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
2
2
  function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
3
- import React, { createContext, useEffect, useState } from 'react';
3
+ import React, { useEffect, useState } from 'react';
4
4
  import { LoadingOverlay } from '@deephaven/components';
5
5
  import { useApi, useClient } from '@deephaven/jsapi-bootstrap';
6
+ import { ConnectionContext } from '@deephaven/jsapi-components';
6
7
  import Log from '@deephaven/log';
7
8
  import { jsx as _jsx } from "react/jsx-runtime";
8
- var log = Log.module('@deephaven/jsapi-components.ConnectionBootstrap');
9
- export var ConnectionContext = /*#__PURE__*/createContext(null);
9
+ var log = Log.module('@deephaven/app-utils.ConnectionBootstrap');
10
10
  /**
11
11
  * ConnectionBootstrap component. Handles initializing the connection.
12
12
  */
@@ -1 +1 @@
1
- {"version":3,"file":"ConnectionBootstrap.js","names":["React","createContext","useEffect","useState","LoadingOverlay","useApi","useClient","Log","log","module","ConnectionContext","ConnectionBootstrap","children","api","client","error","setError","connection","setConnection","initConnection","isCanceled","loadConnection","newConnection","getAsIdeConnection","e","listenForShutdown","handleShutdown","event","detail","info","JSON","stringify","removerFn","addEventListener","IdeConnection","EVENT_SHUTDOWN","undefined"],"sources":["../../src/components/ConnectionBootstrap.tsx"],"sourcesContent":["import React, { createContext, useEffect, useState } from 'react';\nimport { LoadingOverlay } from '@deephaven/components';\nimport { useApi, useClient } from '@deephaven/jsapi-bootstrap';\nimport type { IdeConnection } from '@deephaven/jsapi-types';\nimport Log from '@deephaven/log';\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({\n children,\n}: ConnectionBootstrapProps): JSX.Element {\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 isCanceled = false;\n async function loadConnection(): Promise<void> {\n try {\n const newConnection = await client.getAsIdeConnection();\n if (isCanceled) {\n return;\n }\n setConnection(newConnection);\n } catch (e) {\n if (isCanceled) {\n return;\n }\n setError(e);\n }\n }\n loadConnection();\n return () => {\n isCanceled = true;\n };\n },\n [api, client]\n );\n\n useEffect(\n function listenForShutdown() {\n if (connection == null) return;\n\n function handleShutdown(event: CustomEvent): void {\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 != null ? `${error}` : undefined}\n />\n );\n }\n\n return (\n <ConnectionContext.Provider value={connection}>\n {children}\n </ConnectionContext.Provider>\n );\n}\n\nexport default ConnectionBootstrap;\n"],"mappings":";;AAAA,OAAOA,KAAK,IAAIC,aAAa,EAAEC,SAAS,EAAEC,QAAQ,QAAQ,OAAO;AACjE,SAASC,cAAc,QAAQ,uBAAuB;AACtD,SAASC,MAAM,EAAEC,SAAS,QAAQ,4BAA4B;AAE9D,OAAOC,GAAG,MAAM,gBAAgB;AAAC;AAEjC,IAAMC,GAAG,GAAGD,GAAG,CAACE,MAAM,CAAC,iDAAiD,CAAC;AAEzE,OAAO,IAAMC,iBAAiB,gBAAGT,aAAa,CAAuB,IAAI,CAAC;AAU1E;AACA;AACA;AACA,OAAO,SAASU,mBAAmB,OAEO;EAAA,IAFN;IAClCC;EACwB,CAAC;EACzB,IAAMC,GAAG,GAAGR,MAAM,EAAE;EACpB,IAAMS,MAAM,GAAGR,SAAS,EAAE;EAC1B,IAAM,CAACS,KAAK,EAAEC,QAAQ,CAAC,GAAGb,QAAQ,EAAW;EAC7C,IAAM,CAACc,UAAU,EAAEC,aAAa,CAAC,GAAGf,QAAQ,EAAiB;EAC7DD,SAAS,CACP,SAASiB,cAAc,GAAG;IACxB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B,CAAC,QAAQ;IAAC,KAAK,EAAEnB,UAAW;IAAA,UAC3CL;EAAQ,EACkB;AAEjC;AAEA,eAAeD,mBAAmB"}
1
+ {"version":3,"file":"ConnectionBootstrap.js","names":["React","useEffect","useState","LoadingOverlay","useApi","useClient","ConnectionContext","Log","jsx","_jsx","log","module","ConnectionBootstrap","_ref","children","api","client","error","setError","connection","setConnection","initConnection","isCanceled","loadConnection","_loadConnection","apply","arguments","_asyncToGenerator","newConnection","getAsIdeConnection","e","listenForShutdown","handleShutdown","event","detail","info","concat","JSON","stringify","removerFn","addEventListener","IdeConnection","EVENT_SHUTDOWN","isLoading","errorMessage","undefined","Provider","value"],"sources":["../../src/components/ConnectionBootstrap.tsx"],"sourcesContent":["import React, { useEffect, useState } from 'react';\nimport { LoadingOverlay } from '@deephaven/components';\nimport { useApi, useClient } from '@deephaven/jsapi-bootstrap';\nimport type { IdeConnection } from '@deephaven/jsapi-types';\nimport { ConnectionContext } from '@deephaven/jsapi-components';\nimport Log from '@deephaven/log';\n\nconst log = Log.module('@deephaven/app-utils.ConnectionBootstrap');\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({\n children,\n}: ConnectionBootstrapProps): JSX.Element {\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 isCanceled = false;\n async function loadConnection(): Promise<void> {\n try {\n const newConnection = await client.getAsIdeConnection();\n if (isCanceled) {\n return;\n }\n setConnection(newConnection);\n } catch (e) {\n if (isCanceled) {\n return;\n }\n setError(e);\n }\n }\n loadConnection();\n return () => {\n isCanceled = true;\n };\n },\n [api, client]\n );\n\n useEffect(\n function listenForShutdown() {\n if (connection == null) return;\n\n function handleShutdown(event: CustomEvent): void {\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 != null ? `${error}` : undefined}\n />\n );\n }\n\n return (\n <ConnectionContext.Provider value={connection}>\n {children}\n </ConnectionContext.Provider>\n );\n}\n\nexport default ConnectionBootstrap;\n"],"mappings":";;AAAA,OAAOA,KAAK,IAAIC,SAAS,EAAEC,QAAQ,QAAQ,OAAO;AAClD,SAASC,cAAc,QAAQ,uBAAuB;AACtD,SAASC,MAAM,EAAEC,SAAS,QAAQ,4BAA4B;AAE9D,SAASC,iBAAiB,QAAQ,6BAA6B;AAC/D,OAAOC,GAAG,MAAM,gBAAgB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAEjC,IAAMC,GAAG,GAAGH,GAAG,CAACI,MAAM,CAAC,0CAA0C,CAAC;AAUlE;AACA;AACA;AACA,OAAO,SAASC,mBAAmBA,CAAAC,IAAA,EAEO;EAAA,IAFN;IAClCC;EACwB,CAAC,GAAAD,IAAA;EACzB,IAAME,GAAG,GAAGX,MAAM,CAAC,CAAC;EACpB,IAAMY,MAAM,GAAGX,SAAS,CAAC,CAAC;EAC1B,IAAM,CAACY,KAAK,EAAEC,QAAQ,CAAC,GAAGhB,QAAQ,CAAU,CAAC;EAC7C,IAAM,CAACiB,UAAU,EAAEC,aAAa,CAAC,GAAGlB,QAAQ,CAAgB,CAAC;EAC7DD,SAAS,CACP,SAASoB,cAAcA,CAAA,EAAG;IACxB,IAAIC,UAAU,GAAG,KAAK;IAAC,SACRC,cAAcA,CAAA;MAAA,OAAAC,eAAA,CAAAC,KAAA,OAAAC,SAAA;IAAA;IAAA,SAAAF,gBAAA;MAAAA,eAAA,GAAAG,iB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A,CAAMnB,KAAK,IAAK4B;IAAU,CACtD,CAAC;EAEN;EAEA,oBACEpC,IAAA,CAACH,iBAAiB,CAACwC,QAAQ;IAACC,KAAK,EAAE5B,UAAW;IAAAL,QAAA,EAC3CA;EAAQ,CACiB,CAAC;AAEjC;AAEA,eAAeF,mBAAmB"}
@@ -1 +1 @@
1
- {"version":3,"file":"FontBootstrap.js","names":["React","createContext","useEffect","useState","FontsLoadedContext","FontBootstrap","fontClassNames","children","isLoaded","setIsLoaded","initFonts","document","fonts","ready","then","visibility","position","top","map","className"],"sources":["../../src/components/FontBootstrap.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-semibold', 'fira-mono'],\n children,\n}: FontBootstrapProps): JSX.Element {\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"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,aAAa,EAAEC,SAAS,EAAEC,QAAQ,QAAQ,OAAO;AACjE,OAAO,MAAM;AAAC;AAAA;AAAA;AAEd,OAAO,IAAMC,kBAAkB,gBAAGH,aAAa,CAAU,KAAK,CAAC;AAe/D;AACA;AACA;AACA,OAAO,SAASI,aAAa,OAGO;EAAA,IAHN;IAC5BC,cAAc,GAAG,CAAC,mBAAmB,EAAE,oBAAoB,EAAE,WAAW,CAAC;IACzEC;EACkB,CAAC;EACnB,IAAM,CAACC,QAAQ,EAAEC,WAAW,CAAC,GAAGN,QAAQ,CAAC,KAAK,CAAC;EAC/CD,SAAS,CAAC,SAASQ,SAAS,GAAG;IAC7BC,QAAQ,CAACC,KAAK,CAACC,KAAK,CAACC,IAAI,CAAC,MAAM;MAC9BL,WAAW,CAAC,IAAI,CAAC;IACnB,CAAC,CAAC;EACJ,CAAC,EAAE,EAAE,CAAC;EAEN,oBACE;IAAA,wBACE,KAAC,kBAAkB,CAAC,QAAQ;MAAC,KAAK,EAAED,QAAS;MAAA,UAC1CD;IAAQ,EACmB,eAU9B;MACE,EAAE,EAAC,eAAe;MAClB,KAAK,EAAE;QAAEQ,UAAU,EAAE,QAAQ;QAAEC,QAAQ,EAAE,UAAU;QAAEC,GAAG,EAAE,CAAC;MAAM,CAAE;MAAA,UAGlEX,cAAc,CAACY,GAAG,CAACC,SAAS,iBAC3B;QAAmB,SAAS,EAAEA,SAAU;QAAA,UAAC;MAEzC,GAFQA,SAAS,CAGlB;IAAC,EACE;EAAA,EACL;AAEP;AAEA,eAAed,aAAa"}
1
+ {"version":3,"file":"FontBootstrap.js","names":["React","createContext","useEffect","useState","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","FontsLoadedContext","FontBootstrap","_ref","fontClassNames","children","isLoaded","setIsLoaded","initFonts","document","fonts","ready","then","Provider","value","id","style","visibility","position","top","map","className"],"sources":["../../src/components/FontBootstrap.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-semibold', 'fira-mono'],\n children,\n}: FontBootstrapProps): JSX.Element {\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"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,aAAa,EAAEC,SAAS,EAAEC,QAAQ,QAAQ,OAAO;AACjE,OAAO,MAAM;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAAA,SAAAC,QAAA,IAAAC,SAAA;AAAA,SAAAC,IAAA,IAAAC,KAAA;AAEd,OAAO,IAAMC,kBAAkB,gBAAGT,aAAa,CAAU,KAAK,CAAC;AAe/D;AACA;AACA;AACA,OAAO,SAASU,aAAaA,CAAAC,IAAA,EAGO;EAAA,IAHN;IAC5BC,cAAc,GAAG,CAAC,mBAAmB,EAAE,oBAAoB,EAAE,WAAW,CAAC;IACzEC;EACkB,CAAC,GAAAF,IAAA;EACnB,IAAM,CAACG,QAAQ,EAAEC,WAAW,CAAC,GAAGb,QAAQ,CAAC,KAAK,CAAC;EAC/CD,SAAS,CAAC,SAASe,SAASA,CAAA,EAAG;IAC7BC,QAAQ,CAACC,KAAK,CAACC,KAAK,CAACC,IAAI,CAAC,MAAM;MAC9BL,WAAW,CAAC,IAAI,CAAC;IACnB,CAAC,CAAC;EACJ,CAAC,EAAE,EAAE,CAAC;EAEN,oBACEP,KAAA,CAAAF,SAAA;IAAAO,QAAA,gBACET,IAAA,CAACK,kBAAkB,CAACY,QAAQ;MAACC,KAAK,EAAER,QAAS;MAAAD,QAAA,EAC1CA;IAAQ,CACkB,CAAC,eAU9BT,IAAA;MACEmB,EAAE,EAAC,eAAe;MAClBC,KAAK,EAAE;QAAEC,UAAU,EAAE,QAAQ;QAAEC,QAAQ,EAAE,UAAU;QAAEC,GAAG,EAAE,CAAC;MAAM,CAAE;MAAAd,QAAA,EAGlED,cAAc,CAACgB,GAAG,CAACC,SAAS,iBAC3BzB,IAAA;QAAmByB,SAAS,EAAEA,SAAU;QAAAhB,QAAA,EAAC;MAEzC,GAFQgB,SAEL,CACJ;IAAC,CACC,CAAC;EAAA,CACN,CAAC;AAEP;AAEA,eAAenB,aAAa"}
@@ -1 +1 @@
1
- {"version":3,"file":"FontsLoaded.js","names":["React","useContext","LoadingOverlay","FontsLoadedContext","FontsLoaded","children","isFontsLoaded"],"sources":["../../src/components/FontsLoaded.tsx"],"sourcesContent":["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): JSX.Element {\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"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,UAAU,QAAQ,OAAO;AACzC,SAASC,cAAc,QAAQ,uBAAuB;AAAC,SAC9CC,kBAAkB;AAAA;AAAA;AAO3B,OAAO,SAASC,WAAW,OAA8C;EAAA,IAA7C;IAAEC;EAA2B,CAAC;EACxD,IAAMC,aAAa,GAAGL,UAAU,CAACE,kBAAkB,CAAC;EAEpD,IAAI,CAACG,aAAa,EAAE;IAClB,oBAAO,KAAC,cAAc;MAAC,eAAY;IAAsB,EAAG;EAC9D;;EAEA;EACA,oBAAO;IAAA,UAAGD;EAAQ,EAAI;AACxB;AAEA,eAAeD,WAAW"}
1
+ {"version":3,"file":"FontsLoaded.js","names":["React","useContext","LoadingOverlay","FontsLoadedContext","jsx","_jsx","Fragment","_Fragment","FontsLoaded","_ref","children","isFontsLoaded"],"sources":["../../src/components/FontsLoaded.tsx"],"sourcesContent":["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): JSX.Element {\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"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,UAAU,QAAQ,OAAO;AACzC,SAASC,cAAc,QAAQ,uBAAuB;AAAC,SAC9CC,kBAAkB;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAAA,SAAAC,QAAA,IAAAC,SAAA;AAO3B,OAAO,SAASC,WAAWA,CAAAC,IAAA,EAA8C;EAAA,IAA7C;IAAEC;EAA2B,CAAC,GAAAD,IAAA;EACxD,IAAME,aAAa,GAAGV,UAAU,CAACE,kBAAkB,CAAC;EAEpD,IAAI,CAACQ,aAAa,EAAE;IAClB,oBAAON,IAAA,CAACH,cAAc;MAAC,eAAY;IAAsB,CAAE,CAAC;EAC9D;;EAEA;EACA,oBAAOG,IAAA,CAAAE,SAAA;IAAAG,QAAA,EAAGA;EAAQ,CAAG,CAAC;AACxB;AAEA,eAAeF,WAAW"}
@@ -1 +1 @@
1
- {"version":3,"file":"LoginNotifier.js","names":["useBroadcastChannel","BROADCAST_LOGIN_MESSAGE","makeMessage","useEffect","LoginNotifier","channel","notifyLogin","postMessage"],"sources":["../../src/components/LoginNotifier.tsx"],"sourcesContent":["import { useBroadcastChannel } from '@deephaven/jsapi-components';\nimport { BROADCAST_LOGIN_MESSAGE, makeMessage } from '@deephaven/jsapi-utils';\nimport { useEffect } from 'react';\n\n/**\n * Component that broadcasts a message when mounted. Should be mounted after the user has logged in.\n */\nexport function LoginNotifier(): JSX.Element | null {\n const channel = useBroadcastChannel();\n useEffect(\n function notifyLogin() {\n channel.postMessage(makeMessage(BROADCAST_LOGIN_MESSAGE));\n },\n [channel]\n );\n return null;\n}\n\nexport default LoginNotifier;\n"],"mappings":"AAAA,SAASA,mBAAmB,QAAQ,6BAA6B;AACjE,SAASC,uBAAuB,EAAEC,WAAW,QAAQ,wBAAwB;AAC7E,SAASC,SAAS,QAAQ,OAAO;;AAEjC;AACA;AACA;AACA,OAAO,SAASC,aAAa,GAAuB;EAClD,IAAMC,OAAO,GAAGL,mBAAmB,EAAE;EACrCG,SAAS,CACP,SAASG,WAAW,GAAG;IACrBD,OAAO,CAACE,WAAW,CAACL,WAAW,CAACD,uBAAuB,CAAC,CAAC;EAC3D,CAAC,EACD,CAACI,OAAO,CAAC,CACV;EACD,OAAO,IAAI;AACb;AAEA,eAAeD,aAAa"}
1
+ {"version":3,"file":"LoginNotifier.js","names":["useBroadcastChannel","BROADCAST_LOGIN_MESSAGE","makeMessage","useEffect","LoginNotifier","channel","notifyLogin","postMessage"],"sources":["../../src/components/LoginNotifier.tsx"],"sourcesContent":["import { useBroadcastChannel } from '@deephaven/jsapi-components';\nimport { BROADCAST_LOGIN_MESSAGE, makeMessage } from '@deephaven/jsapi-utils';\nimport { useEffect } from 'react';\n\n/**\n * Component that broadcasts a message when mounted. Should be mounted after the user has logged in.\n */\nexport function LoginNotifier(): JSX.Element | null {\n const channel = useBroadcastChannel();\n useEffect(\n function notifyLogin() {\n channel.postMessage(makeMessage(BROADCAST_LOGIN_MESSAGE));\n },\n [channel]\n );\n return null;\n}\n\nexport default LoginNotifier;\n"],"mappings":"AAAA,SAASA,mBAAmB,QAAQ,6BAA6B;AACjE,SAASC,uBAAuB,EAAEC,WAAW,QAAQ,wBAAwB;AAC7E,SAASC,SAAS,QAAQ,OAAO;;AAEjC;AACA;AACA;AACA,OAAO,SAASC,aAAaA,CAAA,EAAuB;EAClD,IAAMC,OAAO,GAAGL,mBAAmB,CAAC,CAAC;EACrCG,SAAS,CACP,SAASG,WAAWA,CAAA,EAAG;IACrBD,OAAO,CAACE,WAAW,CAACL,WAAW,CAACD,uBAAuB,CAAC,CAAC;EAC3D,CAAC,EACD,CAACI,OAAO,CACV,CAAC;EACD,OAAO,IAAI;AACb;AAEA,eAAeD,aAAa"}
@@ -1,7 +1,5 @@
1
- import { type Plugin } from '@deephaven/plugin';
2
1
  import React from 'react';
3
- import { PluginModuleMap } from '../plugins';
4
- export declare const PluginsContext: React.Context<PluginModuleMap | null>;
2
+ import { type Plugin } from '@deephaven/plugin';
5
3
  export type PluginsBootstrapProps = {
6
4
  /**
7
5
  * Base URL of the plugins to load.
@@ -1 +1 @@
1
- {"version":3,"file":"PluginsBootstrap.d.ts","sourceRoot":"","sources":["../../src/components/PluginsBootstrap.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,KAA6C,MAAM,OAAO,CAAC;AAClE,OAAO,EAAE,eAAe,EAAqB,MAAM,YAAY,CAAC;AAEhE,eAAO,MAAM,cAAc,uCAA8C,CAAC;AAE1E,MAAM,MAAM,qBAAqB,GAAG;IAClC;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;IAEnB,gCAAgC;IAChC,cAAc,CAAC,EAAE,MAAM,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;IAEzC;;;OAGG;IACH,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B,CAAC;AAEF;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,EAC/B,UAAU,EACV,cAAc,EACd,QAAQ,GACT,EAAE,qBAAqB,GAAG,GAAG,CAAC,OAAO,CA4BrC;AAED,eAAe,gBAAgB,CAAC"}
1
+ {"version":3,"file":"PluginsBootstrap.d.ts","sourceRoot":"","sources":["../../src/components/PluginsBootstrap.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8B,MAAM,OAAO,CAAC;AACnD,OAAO,EACL,KAAK,MAAM,EAGZ,MAAM,mBAAmB,CAAC;AAG3B,MAAM,MAAM,qBAAqB,GAAG;IAClC;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;IAEnB,gCAAgC;IAChC,cAAc,CAAC,EAAE,MAAM,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;IAEzC;;;OAGG;IACH,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B,CAAC;AAEF;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,EAC/B,UAAU,EACV,cAAc,EACd,QAAQ,GACT,EAAE,qBAAqB,GAAG,GAAG,CAAC,OAAO,CA4BrC;AAED,eAAe,gBAAgB,CAAC"}
@@ -1,9 +1,9 @@
1
1
  function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
2
2
  function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
3
- import React, { createContext, useEffect, useState } from 'react';
3
+ import React, { useEffect, useState } from 'react';
4
+ import { PluginsContext } from '@deephaven/plugin';
4
5
  import { loadModulePlugins } from "../plugins/index.js";
5
6
  import { jsx as _jsx } from "react/jsx-runtime";
6
- export var PluginsContext = /*#__PURE__*/createContext(null);
7
7
  /**
8
8
  * PluginsBootstrap component. Handles loading the plugins.
9
9
  */
@@ -1 +1 @@
1
- {"version":3,"file":"PluginsBootstrap.js","names":["React","createContext","useEffect","useState","loadModulePlugins","PluginsContext","PluginsBootstrap","pluginsUrl","getCorePlugins","children","plugins","setPlugins","initPlugins","isCanceled","loadPlugins","corePlugins","pluginModules","corePluginPairs","map","plugin","name","Map"],"sources":["../../src/components/PluginsBootstrap.tsx"],"sourcesContent":["import { type Plugin } from '@deephaven/plugin';\nimport 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 /** The core plugins to load. */\n getCorePlugins?: () => Promise<Plugin[]>;\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 getCorePlugins,\n children,\n}: PluginsBootstrapProps): JSX.Element {\n const [plugins, setPlugins] = useState<PluginModuleMap | null>(null);\n useEffect(\n function initPlugins() {\n let isCanceled = false;\n async function loadPlugins(): Promise<void> {\n const corePlugins = (await getCorePlugins?.()) ?? [];\n const pluginModules = await loadModulePlugins(pluginsUrl);\n if (!isCanceled) {\n const corePluginPairs = corePlugins.map(\n plugin => [plugin.name, plugin] as const\n );\n setPlugins(new Map([...corePluginPairs, ...pluginModules]));\n }\n }\n loadPlugins();\n return () => {\n isCanceled = true;\n };\n },\n [pluginsUrl, getCorePlugins]\n );\n\n return (\n <PluginsContext.Provider value={plugins}>\n {children}\n </PluginsContext.Provider>\n );\n}\n\nexport default PluginsBootstrap;\n"],"mappings":";;AACA,OAAOA,KAAK,IAAIC,aAAa,EAAEC,SAAS,EAAEC,QAAQ,QAAQ,OAAO;AAAC,SACxCC,iBAAiB;AAAA;AAE3C,OAAO,IAAMC,cAAc,gBAAGJ,aAAa,CAAyB,IAAI,CAAC;AAkBzE;AACA;AACA;AACA,OAAO,SAASK,gBAAgB,OAIO;EAAA,IAJN;IAC/BC,UAAU;IACVC,cAAc;IACdC;EACqB,CAAC;EACtB,IAAM,CAACC,OAAO,EAAEC,UAAU,CAAC,GAAGR,QAAQ,CAAyB,IAAI,CAAC;EACpED,SAAS,CACP,SAASU,WAAW,GAAG;IACrB,IAAIC,UAAU,GAAG,KAAK;IAAC,SACRC,WAAW;MAAA;IAAA;IAAA;MAAA,iCAA1B,aAA4C;QAAA;QAC1C,IAAMC,WAAW,kCAAUP,cAAc,aAAdA,cAAc,uBAAdA,cAAc,EAAI,yEAAK,EAAE;QACpD,IAAMQ,aAAa,SAASZ,iBAAiB,CAACG,UAAU,CAAC;QACzD,IAAI,CAACM,UAAU,EAAE;UACf,IAAMI,eAAe,GAAGF,WAAW,CAACG,GAAG,CACrCC,MAAM,IAAI,CAACA,MAAM,CAACC,IAAI,EAAED,MAAM,CAAU,CACzC;UACDR,UAAU,CAAC,IAAIU,GAAG,CAAC,CAAC,GAAGJ,eAAe,EAAE,GAAGD,aAAa,CAAC,CAAC,CAAC;QAC7D;MACF,CAAC;MAAA;IAAA;IACDF,WAAW,EAAE;IACb,OAAO,MAAM;MACXD,UAAU,GAAG,IAAI;IACnB,CAAC;EACH,CAAC,EACD,CAACN,UAAU,EAAEC,cAAc,CAAC,CAC7B;EAED,oBACE,KAAC,cAAc,CAAC,QAAQ;IAAC,KAAK,EAAEE,OAAQ;IAAA,UACrCD;EAAQ,EACe;AAE9B;AAEA,eAAeH,gBAAgB"}
1
+ {"version":3,"file":"PluginsBootstrap.js","names":["React","useEffect","useState","PluginsContext","loadModulePlugins","jsx","_jsx","PluginsBootstrap","_ref","pluginsUrl","getCorePlugins","children","plugins","setPlugins","initPlugins","isCanceled","loadPlugins","_loadPlugins","apply","arguments","_asyncToGenerator","_yield$getCorePlugins","corePlugins","pluginModules","corePluginPairs","map","plugin","name","Map","Provider","value"],"sources":["../../src/components/PluginsBootstrap.tsx"],"sourcesContent":["import React, { useEffect, useState } from 'react';\nimport {\n type Plugin,\n type PluginModuleMap,\n PluginsContext,\n} from '@deephaven/plugin';\nimport { loadModulePlugins } from '../plugins';\n\nexport type PluginsBootstrapProps = {\n /**\n * Base URL of the plugins to load.\n */\n pluginsUrl: string;\n\n /** The core plugins to load. */\n getCorePlugins?: () => Promise<Plugin[]>;\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 getCorePlugins,\n children,\n}: PluginsBootstrapProps): JSX.Element {\n const [plugins, setPlugins] = useState<PluginModuleMap | null>(null);\n useEffect(\n function initPlugins() {\n let isCanceled = false;\n async function loadPlugins(): Promise<void> {\n const corePlugins = (await getCorePlugins?.()) ?? [];\n const pluginModules = await loadModulePlugins(pluginsUrl);\n if (!isCanceled) {\n const corePluginPairs = corePlugins.map(\n plugin => [plugin.name, plugin] as const\n );\n setPlugins(new Map([...corePluginPairs, ...pluginModules]));\n }\n }\n loadPlugins();\n return () => {\n isCanceled = true;\n };\n },\n [pluginsUrl, getCorePlugins]\n );\n\n return (\n <PluginsContext.Provider value={plugins}>\n {children}\n </PluginsContext.Provider>\n );\n}\n\nexport default PluginsBootstrap;\n"],"mappings":";;AAAA,OAAOA,KAAK,IAAIC,SAAS,EAAEC,QAAQ,QAAQ,OAAO;AAClD,SAGEC,cAAc,QACT,mBAAmB;AAAC,SAClBC,iBAAiB;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAkB1B;AACA;AACA;AACA,OAAO,SAASC,gBAAgBA,CAAAC,IAAA,EAIO;EAAA,IAJN;IAC/BC,UAAU;IACVC,cAAc;IACdC;EACqB,CAAC,GAAAH,IAAA;EACtB,IAAM,CAACI,OAAO,EAAEC,UAAU,CAAC,GAAGX,QAAQ,CAAyB,IAAI,CAAC;EACpED,SAAS,CACP,SAASa,WAAWA,CAAA,EAAG;IACrB,IAAIC,UAAU,GAAG,KAAK;IAAC,SACRC,WAAWA,CAAA;MAAA,OAAAC,YAAA,CAAAC,KAAA,OAAAC,SAAA;IAAA;IAAA,SAAAF,aAAA;MAAAA,YAAA,GAAAG,iBAAA,CAA1B,aAA4C;QAAA,IAAAC,qBAAA;QAC1C,IAAMC,WAAW,IAAAD,qBAAA,SAAUX,cAAc,aAAdA,cAAc,uBAAdA,cAAc,CAAG,CAAC,cAAAW,qBAAA,cAAAA,qBAAA,GAAK,EAAE;QACpD,IAAME,aAAa,SAASnB,iBAAiB,CAACK,UAAU,CAAC;QACzD,IAAI,CAACM,UAAU,EAAE;UACf,IAAMS,eAAe,GAAGF,WAAW,CAACG,GAAG,CACrCC,MAAM,IAAI,CAACA,MAAM,CAACC,IAAI,EAAED,MAAM,CAChC,CAAC;UACDb,UAAU,CAAC,IAAIe,GAAG,CAAC,CAAC,GAAGJ,eAAe,EAAE,GAAGD,aAAa,CAAC,CAAC,CAAC;QAC7D;MACF,CAAC;MAAA,OAAAN,YAAA,CAAAC,KAAA,OAAAC,SAAA;IAAA;IACDH,WAAW,CAAC,CAAC;IACb,OAAO,MAAM;MACXD,UAAU,GAAG,IAAI;IACnB,CAAC;EACH,CAAC,EACD,CAACN,UAAU,EAAEC,cAAc,CAC7B,CAAC;EAED,oBACEJ,IAAA,CAACH,cAAc,CAAC0B,QAAQ;IAACC,KAAK,EAAElB,OAAQ;IAAAD,QAAA,EACrCA;EAAQ,CACc,CAAC;AAE9B;AAEA,eAAeJ,gBAAgB"}
@@ -1 +1 @@
1
- {"version":3,"file":"ServerConfigBootstrap.js","names":["React","createContext","useEffect","useState","LoadingOverlay","useClient","getErrorMessage","ServerConfigContext","ServerConfigBootstrap","children","client","serverConfig","setServerConfig","error","setError","initServerConfigValues","isCanceled","loadServerConfigValues","newServerConfigValues","getServerConfigValues","Map","e","isLoading"],"sources":["../../src/components/ServerConfigBootstrap.tsx"],"sourcesContent":["import React, { createContext, useEffect, useState } from 'react';\nimport { LoadingOverlay } from '@deephaven/components';\nimport { useClient } from '@deephaven/jsapi-bootstrap';\nimport { getErrorMessage } from '@deephaven/utils';\n\nexport const ServerConfigContext = createContext<Map<string, string> | null>(\n null\n);\n\nexport type ServerConfigBootstrapProps = {\n /**\n * The children to render after server config is loaded.\n */\n children: React.ReactNode;\n};\n\n/**\n * ServerConfigBootstrap component. Handles loading the server config.\n */\nexport function ServerConfigBootstrap({\n children,\n}: ServerConfigBootstrapProps): JSX.Element {\n const client = useClient();\n const [serverConfig, setServerConfig] = useState<Map<string, string>>();\n const [error, setError] = useState<unknown>();\n\n useEffect(\n function initServerConfigValues() {\n let isCanceled = false;\n async function loadServerConfigValues(): Promise<void> {\n try {\n const newServerConfigValues = await client.getServerConfigValues();\n if (!isCanceled) {\n setServerConfig(new Map(newServerConfigValues));\n }\n } catch (e) {\n if (!isCanceled) {\n setError(e);\n }\n }\n }\n loadServerConfigValues();\n return () => {\n isCanceled = true;\n };\n },\n [client]\n );\n\n const isLoading = serverConfig == null;\n\n if (isLoading || error != null) {\n return (\n <LoadingOverlay\n isLoading={isLoading && error == null}\n errorMessage={getErrorMessage(error)}\n />\n );\n }\n\n return (\n <ServerConfigContext.Provider value={serverConfig}>\n {children}\n </ServerConfigContext.Provider>\n );\n}\n\nexport default ServerConfigBootstrap;\n"],"mappings":";;AAAA,OAAOA,KAAK,IAAIC,aAAa,EAAEC,SAAS,EAAEC,QAAQ,QAAQ,OAAO;AACjE,SAASC,cAAc,QAAQ,uBAAuB;AACtD,SAASC,SAAS,QAAQ,4BAA4B;AACtD,SAASC,eAAe,QAAQ,kBAAkB;AAAC;AAEnD,OAAO,IAAMC,mBAAmB,gBAAGN,aAAa,CAC9C,IAAI,CACL;AASD;AACA;AACA;AACA,OAAO,SAASO,qBAAqB,OAEO;EAAA,IAFN;IACpCC;EAC0B,CAAC;EAC3B,IAAMC,MAAM,GAAGL,SAAS,EAAE;EAC1B,IAAM,CAACM,YAAY,EAAEC,eAAe,CAAC,GAAGT,QAAQ,EAAuB;EACvE,IAAM,CAACU,KAAK,EAAEC,QAAQ,CAAC,GAAGX,QAAQ,EAAW;EAE7CD,SAAS,CACP,SAASa,sBAAsB,GAAG;IAChC,IAAIC,UAAU,GAAG,KAAK;IAAC,SACRC,sBAAsB;MAAA;IAAA;IAAA;MAAA,4CAArC,aAAuD;QACrD,IAAI;UACF,IAAMC,qBAAqB,SAASR,MAAM,CAACS,qBAAqB,EAAE;UAClE,IAAI,CAACH,UAAU,EAAE;YACfJ,eAAe,CAAC,IAAIQ,GAAG,CAACF,qBAAqB,CAAC,CAAC;UACjD;QACF,CAAC,CAAC,OAAOG,CAAC,EAAE;UACV,IAAI,CAACL,UAAU,EAAE;YACfF,QAAQ,CAACO,CAAC,CAAC;UACb;QACF;MACF,CAAC;MAAA;IAAA;IACDJ,sBAAsB,EAAE;IACxB,OAAO,MAAM;MACXD,UAAU,GAAG,IAAI;IACnB,CAAC;EACH,CAAC,EACD,CAACN,MAAM,CAAC,CACT;EAED,IAAMY,SAAS,GAAGX,YAAY,IAAI,IAAI;EAEtC,IAAIW,SAAS,IAAIT,KAAK,IAAI,IAAI,EAAE;IAC9B,oBACE,KAAC,cAAc;MACb,SAAS,EAAES,SAAS,IAAIT,KAAK,IAAI,IAAK;MACtC,YAAY,EAAEP,eAAe,CAACO,KAAK;IAAE,EACrC;EAEN;EAEA,oBACE,KAAC,mBAAmB,CAAC,QAAQ;IAAC,KAAK,EAAEF,YAAa;IAAA,UAC/CF;EAAQ,EACoB;AAEnC;AAEA,eAAeD,qBAAqB"}
1
+ {"version":3,"file":"ServerConfigBootstrap.js","names":["React","createContext","useEffect","useState","LoadingOverlay","useClient","getErrorMessage","jsx","_jsx","ServerConfigContext","ServerConfigBootstrap","_ref","children","client","serverConfig","setServerConfig","error","setError","initServerConfigValues","isCanceled","loadServerConfigValues","_loadServerConfigValues","apply","arguments","_asyncToGenerator","newServerConfigValues","getServerConfigValues","Map","e","isLoading","errorMessage","Provider","value"],"sources":["../../src/components/ServerConfigBootstrap.tsx"],"sourcesContent":["import React, { createContext, useEffect, useState } from 'react';\nimport { LoadingOverlay } from '@deephaven/components';\nimport { useClient } from '@deephaven/jsapi-bootstrap';\nimport { getErrorMessage } from '@deephaven/utils';\n\nexport const ServerConfigContext = createContext<Map<string, string> | null>(\n null\n);\n\nexport type ServerConfigBootstrapProps = {\n /**\n * The children to render after server config is loaded.\n */\n children: React.ReactNode;\n};\n\n/**\n * ServerConfigBootstrap component. Handles loading the server config.\n */\nexport function ServerConfigBootstrap({\n children,\n}: ServerConfigBootstrapProps): JSX.Element {\n const client = useClient();\n const [serverConfig, setServerConfig] = useState<Map<string, string>>();\n const [error, setError] = useState<unknown>();\n\n useEffect(\n function initServerConfigValues() {\n let isCanceled = false;\n async function loadServerConfigValues(): Promise<void> {\n try {\n const newServerConfigValues = await client.getServerConfigValues();\n if (!isCanceled) {\n setServerConfig(new Map(newServerConfigValues));\n }\n } catch (e) {\n if (!isCanceled) {\n setError(e);\n }\n }\n }\n loadServerConfigValues();\n return () => {\n isCanceled = true;\n };\n },\n [client]\n );\n\n const isLoading = serverConfig == null;\n\n if (isLoading || error != null) {\n return (\n <LoadingOverlay\n isLoading={isLoading && error == null}\n errorMessage={getErrorMessage(error)}\n />\n );\n }\n\n return (\n <ServerConfigContext.Provider value={serverConfig}>\n {children}\n </ServerConfigContext.Provider>\n );\n}\n\nexport default ServerConfigBootstrap;\n"],"mappings":";;AAAA,OAAOA,KAAK,IAAIC,aAAa,EAAEC,SAAS,EAAEC,QAAQ,QAAQ,OAAO;AACjE,SAASC,cAAc,QAAQ,uBAAuB;AACtD,SAASC,SAAS,QAAQ,4BAA4B;AACtD,SAASC,eAAe,QAAQ,kBAAkB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAEnD,OAAO,IAAMC,mBAAmB,gBAAGR,aAAa,CAC9C,IACF,CAAC;AASD;AACA;AACA;AACA,OAAO,SAASS,qBAAqBA,CAAAC,IAAA,EAEO;EAAA,IAFN;IACpCC;EAC0B,CAAC,GAAAD,IAAA;EAC3B,IAAME,MAAM,GAAGR,SAAS,CAAC,CAAC;EAC1B,IAAM,CAACS,YAAY,EAAEC,eAAe,CAAC,GAAGZ,QAAQ,CAAsB,CAAC;EACvE,IAAM,CAACa,KAAK,EAAEC,QAAQ,CAAC,GAAGd,QAAQ,CAAU,CAAC;EAE7CD,SAAS,CACP,SAASgB,sBAAsBA,CAAA,EAAG;IAChC,IAAIC,UAAU,GAAG,KAAK;IAAC,SACRC,sBAAsBA,CAAA;MAAA,OAAAC,uBAAA,CAAAC,KAAA,OAAAC,SAAA;IAAA;IAAA,SAAAF,wBAAA;MAAAA,uBAAA,GAAAG,iBAAA,CAArC,aAAuD;QACrD,IAAI;UACF,IAAMC,qBAAqB,SAASZ,MAAM,CAACa,qBAAqB,CAAC,CAAC;UAClE,IAAI,CAACP,UAAU,EAAE;YACfJ,eAAe,CAAC,IAAIY,GAAG,CAACF,qBAAqB,CAAC,CAAC;UACjD;QACF,CAAC,CAAC,OAAOG,CAAC,EAAE;UACV,IAAI,CAACT,UAAU,EAAE;YACfF,QAAQ,CAACW,CAAC,CAAC;UACb;QACF;MACF,CAAC;MAAA,OAAAP,uBAAA,CAAAC,KAAA,OAAAC,SAAA;IAAA;IACDH,sBAAsB,CAAC,CAAC;IACxB,OAAO,MAAM;MACXD,UAAU,GAAG,IAAI;IACnB,CAAC;EACH,CAAC,EACD,CAACN,MAAM,CACT,CAAC;EAED,IAAMgB,SAAS,GAAGf,YAAY,IAAI,IAAI;EAEtC,IAAIe,SAAS,IAAIb,KAAK,IAAI,IAAI,EAAE;IAC9B,oBACER,IAAA,CAACJ,cAAc;MACbyB,SAAS,EAAEA,SAAS,IAAIb,KAAK,IAAI,IAAK;MACtCc,YAAY,EAAExB,eAAe,CAACU,KAAK;IAAE,CACtC,CAAC;EAEN;EAEA,oBACER,IAAA,CAACC,mBAAmB,CAACsB,QAAQ;IAACC,KAAK,EAAElB,YAAa;IAAAF,QAAA,EAC/CA;EAAQ,CACmB,CAAC;AAEnC;AAEA,eAAeF,qBAAqB"}
@@ -1,7 +1,7 @@
1
- import { ThemeProvider } from '@deephaven/components';
2
1
  import { useContext, useMemo } from 'react';
2
+ import { ThemeProvider } from '@deephaven/components';
3
+ import { PluginsContext } from '@deephaven/plugin';
3
4
  import { getThemeDataFromPlugins } from "../plugins/index.js";
4
- import { PluginsContext } from "./PluginsBootstrap.js";
5
5
  import { jsx as _jsx } from "react/jsx-runtime";
6
6
  export function ThemeBootstrap(_ref) {
7
7
  var {
@@ -1 +1 @@
1
- {"version":3,"file":"ThemeBootstrap.js","names":["ThemeProvider","useContext","useMemo","getThemeDataFromPlugins","PluginsContext","ThemeBootstrap","children","pluginModules","themes"],"sources":["../../src/components/ThemeBootstrap.tsx"],"sourcesContent":["import { ThemeProvider } from '@deephaven/components';\nimport { useContext, useMemo } from 'react';\nimport { getThemeDataFromPlugins } from '../plugins';\nimport { PluginsContext } from './PluginsBootstrap';\n\nexport interface ThemeBootstrapProps {\n children: React.ReactNode;\n}\n\nexport function ThemeBootstrap({ children }: ThemeBootstrapProps): JSX.Element {\n // The `usePlugins` hook throws if the context value is null. Since this is\n // the state while plugins load asynchronously, we are using `useContext`\n // directly to avoid the exception.\n const pluginModules = useContext(PluginsContext);\n\n const themes = useMemo(\n () =>\n pluginModules == null ? null : getThemeDataFromPlugins(pluginModules),\n [pluginModules]\n );\n\n return <ThemeProvider themes={themes}>{children}</ThemeProvider>;\n}\n\nexport default ThemeBootstrap;\n"],"mappings":"AAAA,SAASA,aAAa,QAAQ,uBAAuB;AACrD,SAASC,UAAU,EAAEC,OAAO,QAAQ,OAAO;AAAC,SACnCC,uBAAuB;AAAA,SACvBC,cAAc;AAAA;AAMvB,OAAO,SAASC,cAAc,OAAiD;EAAA,IAAhD;IAAEC;EAA8B,CAAC;EAC9D;EACA;EACA;EACA,IAAMC,aAAa,GAAGN,UAAU,CAACG,cAAc,CAAC;EAEhD,IAAMI,MAAM,GAAGN,OAAO,CACpB,MACEK,aAAa,IAAI,IAAI,GAAG,IAAI,GAAGJ,uBAAuB,CAACI,aAAa,CAAC,EACvE,CAACA,aAAa,CAAC,CAChB;EAED,oBAAO,KAAC,aAAa;IAAC,MAAM,EAAEC,MAAO;IAAA,UAAEF;EAAQ,EAAiB;AAClE;AAEA,eAAeD,cAAc"}
1
+ {"version":3,"file":"ThemeBootstrap.js","names":["useContext","useMemo","ThemeProvider","PluginsContext","getThemeDataFromPlugins","jsx","_jsx","ThemeBootstrap","_ref","children","pluginModules","themes"],"sources":["../../src/components/ThemeBootstrap.tsx"],"sourcesContent":["import { useContext, useMemo } from 'react';\nimport { ThemeProvider } from '@deephaven/components';\nimport { PluginsContext } from '@deephaven/plugin';\nimport { getThemeDataFromPlugins } from '../plugins';\n\nexport interface ThemeBootstrapProps {\n children: React.ReactNode;\n}\n\nexport function ThemeBootstrap({ children }: ThemeBootstrapProps): JSX.Element {\n // The `usePlugins` hook throws if the context value is null. Since this is\n // the state while plugins load asynchronously, we are using `useContext`\n // directly to avoid the exception.\n const pluginModules = useContext(PluginsContext);\n\n const themes = useMemo(\n () =>\n pluginModules == null ? null : getThemeDataFromPlugins(pluginModules),\n [pluginModules]\n );\n\n return <ThemeProvider themes={themes}>{children}</ThemeProvider>;\n}\n\nexport default ThemeBootstrap;\n"],"mappings":"AAAA,SAASA,UAAU,EAAEC,OAAO,QAAQ,OAAO;AAC3C,SAASC,aAAa,QAAQ,uBAAuB;AACrD,SAASC,cAAc,QAAQ,mBAAmB;AAAC,SAC1CC,uBAAuB;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAMhC,OAAO,SAASC,cAAcA,CAAAC,IAAA,EAAiD;EAAA,IAAhD;IAAEC;EAA8B,CAAC,GAAAD,IAAA;EAC9D;EACA;EACA;EACA,IAAME,aAAa,GAAGV,UAAU,CAACG,cAAc,CAAC;EAEhD,IAAMQ,MAAM,GAAGV,OAAO,CACpB,MACES,aAAa,IAAI,IAAI,GAAG,IAAI,GAAGN,uBAAuB,CAACM,aAAa,CAAC,EACvE,CAACA,aAAa,CAChB,CAAC;EAED,oBAAOJ,IAAA,CAACJ,aAAa;IAACS,MAAM,EAAEA,MAAO;IAAAF,QAAA,EAAEA;EAAQ,CAAgB,CAAC;AAClE;AAEA,eAAeF,cAAc"}
@@ -1 +1 @@
1
- {"version":3,"file":"UserBootstrap.js","names":["React","useContext","UserContext","UserOverrideContext","UserPermissionsOverrideContext","getUserFromConfig","useServerConfig","UserBootstrap","children","serverConfig","overrides","permissionsOverrides","user"],"sources":["../../src/components/UserBootstrap.tsx"],"sourcesContent":["import React, { useContext } from 'react';\nimport {\n UserContext,\n UserOverrideContext,\n UserPermissionsOverrideContext,\n getUserFromConfig,\n} from '@deephaven/auth-plugins';\nimport useServerConfig from './useServerConfig';\n\nexport type UserBootstrapProps = {\n /** The children to render */\n children: React.ReactNode;\n};\n\n/**\n * UserBootstrap component. Derives the UserContext from the ServerConfigContext, UserOverrideContext, and UserPermissionsOverrideContext.\n */\nexport function UserBootstrap({ children }: UserBootstrapProps): JSX.Element {\n const serverConfig = useServerConfig();\n const overrides = useContext(UserOverrideContext);\n const permissionsOverrides = useContext(UserPermissionsOverrideContext);\n const user = getUserFromConfig(serverConfig, overrides, permissionsOverrides);\n return <UserContext.Provider value={user}>{children}</UserContext.Provider>;\n}\n\nexport default UserBootstrap;\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,UAAU,QAAQ,OAAO;AACzC,SACEC,WAAW,EACXC,mBAAmB,EACnBC,8BAA8B,EAC9BC,iBAAiB,QACZ,yBAAyB;AAAC,OAC1BC,eAAe;AAAA;AAOtB;AACA;AACA;AACA,OAAO,SAASC,aAAa,OAAgD;EAAA,IAA/C;IAAEC;EAA6B,CAAC;EAC5D,IAAMC,YAAY,GAAGH,eAAe,EAAE;EACtC,IAAMI,SAAS,GAAGT,UAAU,CAACE,mBAAmB,CAAC;EACjD,IAAMQ,oBAAoB,GAAGV,UAAU,CAACG,8BAA8B,CAAC;EACvE,IAAMQ,IAAI,GAAGP,iBAAiB,CAACI,YAAY,EAAEC,SAAS,EAAEC,oBAAoB,CAAC;EAC7E,oBAAO,KAAC,WAAW,CAAC,QAAQ;IAAC,KAAK,EAAEC,IAAK;IAAA,UAAEJ;EAAQ,EAAwB;AAC7E;AAEA,eAAeD,aAAa"}
1
+ {"version":3,"file":"UserBootstrap.js","names":["React","useContext","UserContext","UserOverrideContext","UserPermissionsOverrideContext","getUserFromConfig","useServerConfig","jsx","_jsx","UserBootstrap","_ref","children","serverConfig","overrides","permissionsOverrides","user","Provider","value"],"sources":["../../src/components/UserBootstrap.tsx"],"sourcesContent":["import React, { useContext } from 'react';\nimport {\n UserContext,\n UserOverrideContext,\n UserPermissionsOverrideContext,\n getUserFromConfig,\n} from '@deephaven/auth-plugins';\nimport useServerConfig from './useServerConfig';\n\nexport type UserBootstrapProps = {\n /** The children to render */\n children: React.ReactNode;\n};\n\n/**\n * UserBootstrap component. Derives the UserContext from the ServerConfigContext, UserOverrideContext, and UserPermissionsOverrideContext.\n */\nexport function UserBootstrap({ children }: UserBootstrapProps): JSX.Element {\n const serverConfig = useServerConfig();\n const overrides = useContext(UserOverrideContext);\n const permissionsOverrides = useContext(UserPermissionsOverrideContext);\n const user = getUserFromConfig(serverConfig, overrides, permissionsOverrides);\n return <UserContext.Provider value={user}>{children}</UserContext.Provider>;\n}\n\nexport default UserBootstrap;\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,UAAU,QAAQ,OAAO;AACzC,SACEC,WAAW,EACXC,mBAAmB,EACnBC,8BAA8B,EAC9BC,iBAAiB,QACZ,yBAAyB;AAAC,OAC1BC,eAAe;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAOtB;AACA;AACA;AACA,OAAO,SAASC,aAAaA,CAAAC,IAAA,EAAgD;EAAA,IAA/C;IAAEC;EAA6B,CAAC,GAAAD,IAAA;EAC5D,IAAME,YAAY,GAAGN,eAAe,CAAC,CAAC;EACtC,IAAMO,SAAS,GAAGZ,UAAU,CAACE,mBAAmB,CAAC;EACjD,IAAMW,oBAAoB,GAAGb,UAAU,CAACG,8BAA8B,CAAC;EACvE,IAAMW,IAAI,GAAGV,iBAAiB,CAACO,YAAY,EAAEC,SAAS,EAAEC,oBAAoB,CAAC;EAC7E,oBAAON,IAAA,CAACN,WAAW,CAACc,QAAQ;IAACC,KAAK,EAAEF,IAAK;IAAAJ,QAAA,EAAEA;EAAQ,CAAuB,CAAC;AAC7E;AAEA,eAAeF,aAAa"}
@@ -5,9 +5,6 @@ export * from './FontBootstrap';
5
5
  export * from './FontsLoaded';
6
6
  export * from './PluginsBootstrap';
7
7
  export * from './ThemeBootstrap';
8
- export * from './usePlugins';
9
- export * from './useConnection';
10
8
  export * from './useServerConfig';
11
9
  export * from './useUser';
12
- export * from './useLoadTablePlugin';
13
10
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,uBAAuB,CAAC;AACtC,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC;AAC9B,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC;AAC7B,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,WAAW,CAAC;AAC1B,cAAc,sBAAsB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,uBAAuB,CAAC;AACtC,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC;AAC9B,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,WAAW,CAAC"}
@@ -5,9 +5,6 @@ export * from "./FontBootstrap.js";
5
5
  export * from "./FontsLoaded.js";
6
6
  export * from "./PluginsBootstrap.js";
7
7
  export * from "./ThemeBootstrap.js";
8
- export * from "./usePlugins.js";
9
- export * from "./useConnection.js";
10
8
  export * from "./useServerConfig.js";
11
9
  export * from "./useUser.js";
12
- export * from "./useLoadTablePlugin.js";
13
10
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../src/components/index.ts"],"sourcesContent":["export * from './AppBootstrap';\nexport * from './AuthBootstrap';\nexport * from './ConnectionBootstrap';\nexport * from './FontBootstrap';\nexport * from './FontsLoaded';\nexport * from './PluginsBootstrap';\nexport * from './ThemeBootstrap';\nexport * from './usePlugins';\nexport * from './useConnection';\nexport * from './useServerConfig';\nexport * from './useUser';\nexport * from './useLoadTablePlugin';\n"],"mappings":""}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../src/components/index.ts"],"sourcesContent":["export * from './AppBootstrap';\nexport * from './AuthBootstrap';\nexport * from './ConnectionBootstrap';\nexport * from './FontBootstrap';\nexport * from './FontsLoaded';\nexport * from './PluginsBootstrap';\nexport * from './ThemeBootstrap';\nexport * from './useServerConfig';\nexport * from './useUser';\n"],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"file":"useServerConfig.js","names":["useContextOrThrow","ServerConfigContext","useServerConfig"],"sources":["../../src/components/useServerConfig.ts"],"sourcesContent":["import { useContextOrThrow } from '@deephaven/react-hooks';\nimport { ServerConfigContext } from './ServerConfigBootstrap';\n\nexport function useServerConfig(): Map<string, string> {\n return useContextOrThrow(\n ServerConfigContext,\n 'No server config available in useServerConfig. Was code wrapped in ServerConfigBootstrap or ServerConfigContext.Provider?'\n );\n}\n\nexport default useServerConfig;\n"],"mappings":"AAAA,SAASA,iBAAiB,QAAQ,wBAAwB;AAAC,SAClDC,mBAAmB;AAE5B,OAAO,SAASC,eAAe,GAAwB;EACrD,OAAOF,iBAAiB,CACtBC,mBAAmB,EACnB,2HAA2H,CAC5H;AACH;AAEA,eAAeC,eAAe"}
1
+ {"version":3,"file":"useServerConfig.js","names":["useContextOrThrow","ServerConfigContext","useServerConfig"],"sources":["../../src/components/useServerConfig.ts"],"sourcesContent":["import { useContextOrThrow } from '@deephaven/react-hooks';\nimport { ServerConfigContext } from './ServerConfigBootstrap';\n\nexport function useServerConfig(): Map<string, string> {\n return useContextOrThrow(\n ServerConfigContext,\n 'No server config available in useServerConfig. Was code wrapped in ServerConfigBootstrap or ServerConfigContext.Provider?'\n );\n}\n\nexport default useServerConfig;\n"],"mappings":"AAAA,SAASA,iBAAiB,QAAQ,wBAAwB;AAAC,SAClDC,mBAAmB;AAE5B,OAAO,SAASC,eAAeA,CAAA,EAAwB;EACrD,OAAOF,iBAAiB,CACtBC,mBAAmB,EACnB,2HACF,CAAC;AACH;AAEA,eAAeC,eAAe"}
@@ -1 +1 @@
1
- {"version":3,"file":"useUser.js","names":["useContextOrThrow","UserContext","useUser"],"sources":["../../src/components/useUser.ts"],"sourcesContent":["import { useContextOrThrow } from '@deephaven/react-hooks';\nimport { UserContext } from '@deephaven/auth-plugins';\nimport type { User } from '@deephaven/redux';\n\nexport function useUser(): User {\n return useContextOrThrow(\n UserContext,\n 'No user available in useUser. Was code wrapped in UserBootstrap or UserContext.Provider?'\n );\n}\n\nexport default useUser;\n"],"mappings":"AAAA,SAASA,iBAAiB,QAAQ,wBAAwB;AAC1D,SAASC,WAAW,QAAQ,yBAAyB;AAGrD,OAAO,SAASC,OAAO,GAAS;EAC9B,OAAOF,iBAAiB,CACtBC,WAAW,EACX,0FAA0F,CAC3F;AACH;AAEA,eAAeC,OAAO"}
1
+ {"version":3,"file":"useUser.js","names":["useContextOrThrow","UserContext","useUser"],"sources":["../../src/components/useUser.ts"],"sourcesContent":["import { useContextOrThrow } from '@deephaven/react-hooks';\nimport { UserContext } from '@deephaven/auth-plugins';\nimport type { User } from '@deephaven/redux';\n\nexport function useUser(): User {\n return useContextOrThrow(\n UserContext,\n 'No user available in useUser. Was code wrapped in UserBootstrap or UserContext.Provider?'\n );\n}\n\nexport default useUser;\n"],"mappings":"AAAA,SAASA,iBAAiB,QAAQ,wBAAwB;AAC1D,SAASC,WAAW,QAAQ,yBAAyB;AAGrD,OAAO,SAASC,OAAOA,CAAA,EAAS;EAC9B,OAAOF,iBAAiB,CACtBC,WAAW,EACX,0FACF,CAAC;AACH;AAEA,eAAeC,OAAO"}
@@ -1,6 +1,5 @@
1
1
  import { ThemeData } from '@deephaven/components';
2
- import { type PluginModule, type AuthPlugin, type AuthPluginComponent, LegacyAuthPlugin, LegacyPlugin, Plugin } from '@deephaven/plugin';
3
- export type PluginModuleMap = Map<string, PluginModule>;
2
+ import { type PluginModuleMap, type AuthPlugin, type AuthPluginComponent, LegacyAuthPlugin, LegacyPlugin, Plugin } from '@deephaven/plugin';
4
3
  export type PluginManifestPluginInfo = {
5
4
  name: string;
6
5
  main: string;
@@ -1 +1 @@
1
- {"version":3,"file":"PluginUtils.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3,"file":"PluginUtils.d.ts","sourceRoot":"","sources":["../../src/plugins/PluginUtils.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAe,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAE/D,OAAO,EACL,KAAK,eAAe,EACpB,KAAK,UAAU,EACf,KAAK,mBAAmB,EAExB,gBAAgB,EAChB,YAAY,EACZ,MAAM,EAMP,MAAM,mBAAmB,CAAC;AAK3B,MAAM,MAAM,wBAAwB,GAAG;IACrC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG;IAAE,OAAO,EAAE,wBAAwB,EAAE,CAAA;CAAE,CAAC;AAErE;;;;GAIG;AACH,wBAAsB,gBAAgB,CACpC,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC,YAAY,GAAG;IAAE,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC,CAG7C;AAED;;;;GAIG;AACH,wBAAsB,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC,CAUvE;AAED;;;;GAIG;AACH,wBAAsB,iBAAiB,CACrC,gBAAgB,EAAE,MAAM,GACvB,OAAO,CAAC,eAAe,CAAC,CAgD1B;AAED,wBAAgB,eAAe,CAC7B,gBAAgB,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,GACpC,MAAM,EAAE,CAEV;AAED;;;;;;;;GAQG;AACH,wBAAgB,sBAAsB,CACpC,SAAS,EAAE,eAAe,EAC1B,gBAAgB,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,EACrC,WAAW,6CAAmD,GAC7D,mBAAmB,CAwCrB;AAED;;;GAGG;AACH,wBAAgB,uBAAuB,CACrC,SAAS,EAAE,eAAe,GACzB,SAAS,EAAE,CA0Bb"}
@@ -1 +1 @@
1
- {"version":3,"file":"PluginUtils.js","names":["getThemeKey","Log","isAuthPlugin","PluginType","isLegacyAuthPlugin","isLegacyPlugin","isThemePlugin","loadRemoteModule","log","module","loadModulePlugin","pluginUrl","myModule","loadJson","jsonUrl","res","fetch","ok","Error","statusText","json","loadModulePlugins","modulePluginsUrl","debug","manifest","Array","isArray","plugins","pluginPromises","i","length","name","main","pluginMainUrl","push","pluginModules","Promise","allSettled","pluginMap","Map","status","moduleValue","value","default","error","set","reason","info","e","getAuthHandlers","authConfigValues","get","split","getAuthPluginComponent","corePlugins","authHandlers","authPlugins","entries","filter","plugin","map","type","AUTH_PLUGIN","component","AuthPlugin","Component","isAvailable","availableAuthPlugins","warn","join","getThemeDataFromPlugins","themePluginEntries","entry","pluginName","configs","themes","baseTheme","styleContent","baseThemeKey","themeKey","flat"],"sources":["../../src/plugins/PluginUtils.tsx"],"sourcesContent":["import { getThemeKey, ThemeData } from '@deephaven/components';\nimport Log from '@deephaven/log';\nimport {\n type PluginModule,\n type AuthPlugin,\n type AuthPluginComponent,\n isAuthPlugin,\n LegacyAuthPlugin,\n LegacyPlugin,\n Plugin,\n PluginType,\n isLegacyAuthPlugin,\n isLegacyPlugin,\n isThemePlugin,\n ThemePlugin,\n} from '@deephaven/plugin';\nimport loadRemoteModule from './loadRemoteModule';\n\nconst log = Log.module('@deephaven/app-utils.PluginUtils');\n\nexport type PluginModuleMap = Map<string, PluginModule>;\n\nexport type PluginManifestPluginInfo = {\n name: string;\n main: string;\n version: string;\n};\n\nexport type PluginManifest = { plugins: PluginManifestPluginInfo[] };\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(\n pluginUrl: string\n): Promise<LegacyPlugin | { default: Plugin }> {\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(jsonUrl: string): Promise<PluginManifest> {\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 based on the manifest file at the provided base URL\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<LegacyPlugin | { default: Plugin }>[] = [];\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\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 const moduleValue = isLegacyPlugin(module.value)\n ? module.value\n : // TypeScript builds CJS default exports differently depending on\n // whether there are also named exports. If the default is the only\n // export, it will be the value. If there are also named exports,\n // it will be assigned to the `default` property on the value.\n module.value.default ?? module.value;\n\n if (moduleValue == null) {\n log.error(`Plugin '${name}' is missing an exported value.`);\n } else {\n pluginMap.set(name, moduleValue);\n }\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 = new Map<string, AuthPlugin | LegacyAuthPlugin>()\n): AuthPluginComponent {\n const authHandlers = getAuthHandlers(authConfigValues);\n // User plugins take priority over core plugins\n const authPlugins = (\n [...pluginMap.entries(), ...corePlugins.entries()].filter(\n ([, plugin]) => isAuthPlugin(plugin) || isLegacyAuthPlugin(plugin)\n ) as [string, AuthPlugin | LegacyAuthPlugin][]\n ).map(([name, plugin]) => {\n if (isLegacyAuthPlugin(plugin)) {\n return {\n type: PluginType.AUTH_PLUGIN,\n name,\n component: plugin.AuthPlugin.Component,\n isAvailable: plugin.AuthPlugin.isAvailable,\n };\n }\n\n return plugin;\n });\n\n // Filter the available auth plugins\n const availableAuthPlugins = authPlugins.filter(({ isAvailable }) =>\n isAvailable(authHandlers, authConfigValues)\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 { name, component } = availableAuthPlugins[0];\n log.info('Using LoginPlugin', name);\n\n return component;\n}\n\n/**\n * Extract theme data from theme plugins in the given plugin map.\n * @param pluginMap\n */\nexport function getThemeDataFromPlugins(\n pluginMap: PluginModuleMap\n): ThemeData[] {\n const themePluginEntries = [...pluginMap.entries()].filter(\n (entry): entry is [string, ThemePlugin] => isThemePlugin(entry[1])\n );\n\n log.debug('Getting theme data from plugins', themePluginEntries);\n\n return themePluginEntries\n .map(([pluginName, plugin]) => {\n // Normalize to an array since config can be an array of configs or a\n // single config\n const configs = Array.isArray(plugin.themes)\n ? plugin.themes\n : [plugin.themes];\n\n return configs.map(\n ({ name, baseTheme, styleContent }) =>\n ({\n baseThemeKey: `default-${baseTheme ?? 'dark'}`,\n themeKey: getThemeKey(pluginName, name),\n name,\n styleContent,\n }) as const\n );\n })\n .flat();\n}\n"],"mappings":";;AAAA,SAASA,WAAW,QAAmB,uBAAuB;AAC9D,OAAOC,GAAG,MAAM,gBAAgB;AAChC,SAIEC,YAAY,EAIZC,UAAU,EACVC,kBAAkB,EAClBC,cAAc,EACdC,aAAa,QAER,mBAAmB;AAAC,OACpBC,gBAAgB;AAEvB,IAAMC,GAAG,GAAGP,GAAG,CAACQ,MAAM,CAAC,kCAAkC,CAAC;AAY1D;AACA;AACA;AACA;AACA;AACA,gBAAsBC,gBAAgB;EAAA;AAAA;;AAOtC;AACA;AACA;AACA;AACA;AAJA;EAAA,sCAPO,WACLC,SAAiB,EAC4B;IAC7C,IAAMC,QAAQ,SAASL,gBAAgB,CAACI,SAAS,CAAC;IAClD,OAAOC,QAAQ;EACjB,CAAC;EAAA;AAAA;AAOD,gBAAsBC,QAAQ;EAAA;AAAA;;AAY9B;AACA;AACA;AACA;AACA;AAJA;EAAA,8BAZO,WAAwBC,OAAe,EAA2B;IACvE,IAAMC,GAAG,SAASC,KAAK,CAACF,OAAO,CAAC;IAChC,IAAI,CAACC,GAAG,CAACE,EAAE,EAAE;MACX,MAAM,IAAIC,KAAK,CAACH,GAAG,CAACI,UAAU,CAAC;IACjC;IACA,IAAI;MACF,aAAaJ,GAAG,CAACK,IAAI,EAAE;IACzB,CAAC,CAAC,gBAAM;MACN,MAAM,IAAIF,KAAK,CAAC,6BAA6B,CAAC;IAChD;EACF,CAAC;EAAA;AAAA;AAOD,gBAAsBG,iBAAiB;EAAA;AAAA;AAkDtC;EAAA,uCAlDM,WACLC,gBAAwB,EACE;IAC1Bd,GAAG,CAACe,KAAK,CAAC,oBAAoB,CAAC;IAC/B,IAAI;MACF,IAAMC,QAAQ,SAASX,QAAQ,WAAIS,gBAAgB,oBAAiB;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AEd,MAAM,CAAC;IACxB;IACA;IACA,IAAMe,OAAO,GAAGjD,KAAK,CAACC,OAAO,CAACiC,MAAM,CAACgB,MAAM,CAAC,GACxChB,MAAM,CAACgB,MAAM,GACb,CAAChB,MAAM,CAACgB,MAAM,CAAC;IAEnB,OAAOD,OAAO,CAACd,GAAG,CAChB;MAAA,IAAC;QAAE7B,IAAI;QAAE6C,SAAS;QAAEC;MAAa,CAAC;MAAA,OAC/B;QACCC,YAAY,oBAAaF,SAAS,aAATA,SAAS,cAATA,SAAS,GAAI,MAAM,CAAE;QAC9CG,QAAQ,EAAE/E,WAAW,CAACyE,UAAU,EAAE1C,IAAI,CAAC;QACvCA,IAAI;QACJ8C;MACF,CAAC;IAAA,CAAU,CACd;EACH,CAAC,CAAC,CACDG,IAAI,EAAE;AACX"}
1
+ {"version":3,"file":"PluginUtils.js","names":["getThemeKey","Log","isAuthPlugin","PluginType","isLegacyAuthPlugin","isLegacyPlugin","isThemePlugin","loadRemoteModule","log","module","loadModulePlugin","_x","_loadModulePlugin","apply","arguments","_asyncToGenerator","pluginUrl","myModule","loadJson","_x2","_loadJson","jsonUrl","res","fetch","ok","Error","statusText","json","_unused","loadModulePlugins","_x3","_loadModulePlugins","modulePluginsUrl","debug","manifest","concat","Array","isArray","plugins","pluginPromises","i","length","name","main","pluginMainUrl","push","pluginModules","Promise","allSettled","pluginMap","Map","status","_module$value$default","moduleValue","value","default","error","set","reason","info","e","getAuthHandlers","authConfigValues","_authConfigValues$get","_authConfigValues$get2","get","split","getAuthPluginComponent","corePlugins","undefined","authHandlers","authPlugins","entries","filter","_ref","plugin","map","_ref2","type","AUTH_PLUGIN","component","AuthPlugin","Component","isAvailable","availableAuthPlugins","_ref3","warn","_ref4","join","getThemeDataFromPlugins","themePluginEntries","entry","_ref5","pluginName","configs","themes","_ref6","baseTheme","styleContent","baseThemeKey","themeKey","flat"],"sources":["../../src/plugins/PluginUtils.tsx"],"sourcesContent":["import { getThemeKey, ThemeData } from '@deephaven/components';\nimport Log from '@deephaven/log';\nimport {\n type PluginModuleMap,\n type AuthPlugin,\n type AuthPluginComponent,\n isAuthPlugin,\n LegacyAuthPlugin,\n LegacyPlugin,\n Plugin,\n PluginType,\n isLegacyAuthPlugin,\n isLegacyPlugin,\n isThemePlugin,\n ThemePlugin,\n} from '@deephaven/plugin';\nimport loadRemoteModule from './loadRemoteModule';\n\nconst log = Log.module('@deephaven/app-utils.PluginUtils');\n\nexport type PluginManifestPluginInfo = {\n name: string;\n main: string;\n version: string;\n};\n\nexport type PluginManifest = { plugins: PluginManifestPluginInfo[] };\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(\n pluginUrl: string\n): Promise<LegacyPlugin | { default: Plugin }> {\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(jsonUrl: string): Promise<PluginManifest> {\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 based on the manifest file at the provided base URL\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<LegacyPlugin | { default: Plugin }>[] = [];\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\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 const moduleValue = isLegacyPlugin(module.value)\n ? module.value\n : // TypeScript builds CJS default exports differently depending on\n // whether there are also named exports. If the default is the only\n // export, it will be the value. If there are also named exports,\n // it will be assigned to the `default` property on the value.\n module.value.default ?? module.value;\n\n if (moduleValue == null) {\n log.error(`Plugin '${name}' is missing an exported value.`);\n } else {\n pluginMap.set(name, moduleValue);\n }\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 = new Map<string, AuthPlugin | LegacyAuthPlugin>()\n): AuthPluginComponent {\n const authHandlers = getAuthHandlers(authConfigValues);\n // User plugins take priority over core plugins\n const authPlugins = (\n [...pluginMap.entries(), ...corePlugins.entries()].filter(\n ([, plugin]) => isAuthPlugin(plugin) || isLegacyAuthPlugin(plugin)\n ) as [string, AuthPlugin | LegacyAuthPlugin][]\n ).map(([name, plugin]) => {\n if (isLegacyAuthPlugin(plugin)) {\n return {\n type: PluginType.AUTH_PLUGIN,\n name,\n component: plugin.AuthPlugin.Component,\n isAvailable: plugin.AuthPlugin.isAvailable,\n };\n }\n\n return plugin;\n });\n\n // Filter the available auth plugins\n const availableAuthPlugins = authPlugins.filter(({ isAvailable }) =>\n isAvailable(authHandlers, authConfigValues)\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 { name, component } = availableAuthPlugins[0];\n log.info('Using LoginPlugin', name);\n\n return component;\n}\n\n/**\n * Extract theme data from theme plugins in the given plugin map.\n * @param pluginMap\n */\nexport function getThemeDataFromPlugins(\n pluginMap: PluginModuleMap\n): ThemeData[] {\n const themePluginEntries = [...pluginMap.entries()].filter(\n (entry): entry is [string, ThemePlugin] => isThemePlugin(entry[1])\n );\n\n log.debug('Getting theme data from plugins', themePluginEntries);\n\n return themePluginEntries\n .map(([pluginName, plugin]) => {\n // Normalize to an array since config can be an array of configs or a\n // single config\n const configs = Array.isArray(plugin.themes)\n ? plugin.themes\n : [plugin.themes];\n\n return configs.map(\n ({ name, baseTheme, styleContent }) =>\n ({\n baseThemeKey: `default-${baseTheme ?? 'dark'}`,\n themeKey: getThemeKey(pluginName, name),\n name,\n styleContent,\n }) as const\n );\n })\n .flat();\n}\n"],"mappings":";;AAAA,SAASA,WAAW,QAAmB,uBAAuB;AAC9D,OAAOC,GAAG,MAAM,gBAAgB;AAChC,SAIEC,YAAY,EAIZC,UAAU,EACVC,kBAAkB,EAClBC,cAAc,EACdC,aAAa,QAER,mBAAmB;AAAC,OACpBC,gBAAgB;AAEvB,IAAMC,GAAG,GAAGP,GAAG,CAACQ,MAAM,CAAC,kCAAkC,CAAC;AAU1D;AACA;AACA;AACA;AACA;AACA,gBAAsBC,gBAAgBA,CAAAC,EAAA;EAAA,OAAAC,iBAAA,CAAAC,KAAA,OAAAC,SAAA;AAAA;;AAOtC;AACA;AACA;AACA;AACA;AAJA,S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AACA,OAAO,SAASS,uBAAuBA,CACrCxC,SAA0B,EACb;EACb,IAAMyC,kBAAkB,GAAG,CAAC,GAAGzC,SAAS,CAACuB,OAAO,CAAC,CAAC,CAAC,CAACC,MAAM,CACvDkB,KAAK,IAAqCrF,aAAa,CAACqF,KAAK,CAAC,CAAC,CAAC,CACnE,CAAC;EAEDnF,GAAG,CAACyB,KAAK,CAAC,iCAAiC,EAAEyD,kBAAkB,CAAC;EAEhE,OAAOA,kBAAkB,CACtBd,GAAG,CAACgB,KAAA,IAA0B;IAAA,IAAzB,CAACC,UAAU,EAAElB,MAAM,CAAC,GAAAiB,KAAA;IACxB;IACA;IACA,IAAME,OAAO,GAAG1D,KAAK,CAACC,OAAO,CAACsC,MAAM,CAACoB,MAAM,CAAC,GACxCpB,MAAM,CAACoB,MAAM,GACb,CAACpB,MAAM,CAACoB,MAAM,CAAC;IAEnB,OAAOD,OAAO,CAAClB,GAAG,CAChBoB,KAAA;MAAA,IAAC;QAAEtD,IAAI;QAAEuD,SAAS;QAAEC;MAAa,CAAC,GAAAF,KAAA;MAAA,OAC/B;QACCG,YAAY,aAAAhE,MAAA,CAAa8D,SAAS,aAATA,SAAS,cAATA,SAAS,GAAI,MAAM,CAAE;QAC9CG,QAAQ,EAAEpG,WAAW,CAAC6F,UAAU,EAAEnD,IAAI,CAAC;QACvCA,IAAI;QACJwD;MACF,CAAC;IAAA,CACL,CAAC;EACH,CAAC,CAAC,CACDG,IAAI,CAAC,CAAC;AACX"}
@@ -1 +1 @@
1
- {"version":3,"file":"ConnectUtils.js","names":["getBaseUrl","apiUrl","URL","window","location","getEnvoyPrefix","searchParams","URLSearchParams","search","get","getConnectOptions","envoyPrefix","headers"],"sources":["../../src/utils/ConnectUtils.ts"],"sourcesContent":["import type { 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"],"mappings":"AAEA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASA,UAAU,CAACC,MAAc,EAAO;EAC9C,OAAO,IAAIC,GAAG,CAACD,MAAM,YAAKE,MAAM,CAACC,QAAQ,EAAG;AAC9C;;AAEA;AACA;AACA;AACA;AACA,OAAO,SAASC,cAAc,GAAkB;EAC9C,IAAMC,YAAY,GAAG,IAAIC,eAAe,CAACJ,MAAM,CAACC,QAAQ,CAACI,MAAM,CAAC;EAChE,OAAOF,YAAY,CAACG,GAAG,CAAC,aAAa,CAAC;AACxC;AAEA,OAAO,SAASC,iBAAiB,GAAmB;EAClD,IAAMC,WAAW,GAAGN,cAAc,EAAE;EACpC,OAAOM,WAAW,IAAI,IAAI,GACtB;IAAEC,OAAO,EAAE;MAAE,cAAc,EAAED;IAAY;EAAE,CAAC,GAC5C;IAAEC,OAAO,EAAE,CAAC;EAAE,CAAC;AACrB"}
1
+ {"version":3,"file":"ConnectUtils.js","names":["getBaseUrl","apiUrl","URL","concat","window","location","getEnvoyPrefix","searchParams","URLSearchParams","search","get","getConnectOptions","envoyPrefix","headers"],"sources":["../../src/utils/ConnectUtils.ts"],"sourcesContent":["import type { 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"],"mappings":"AAEA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASA,UAAUA,CAACC,MAAc,EAAO;EAC9C,OAAO,IAAIC,GAAG,CAACD,MAAM,KAAAE,MAAA,CAAKC,MAAM,CAACC,QAAQ,CAAE,CAAC;AAC9C;;AAEA;AACA;AACA;AACA;AACA,OAAO,SAASC,cAAcA,CAAA,EAAkB;EAC9C,IAAMC,YAAY,GAAG,IAAIC,eAAe,CAACJ,MAAM,CAACC,QAAQ,CAACI,MAAM,CAAC;EAChE,OAAOF,YAAY,CAACG,GAAG,CAAC,aAAa,CAAC;AACxC;AAEA,OAAO,SAASC,iBAAiBA,CAAA,EAAmB;EAClD,IAAMC,WAAW,GAAGN,cAAc,CAAC,CAAC;EACpC,OAAOM,WAAW,IAAI,IAAI,GACtB;IAAEC,OAAO,EAAE;MAAE,cAAc,EAAED;IAAY;EAAE,CAAC,GAC5C;IAAEC,OAAO,EAAE,CAAC;EAAE,CAAC;AACrB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@deephaven/app-utils",
3
- "version": "0.50.1-beta.5+c736708e",
3
+ "version": "0.51.0",
4
4
  "description": "Deephaven App Utils",
5
5
  "author": "Deephaven Data Labs LLC",
6
6
  "license": "Apache-2.0",
@@ -29,20 +29,20 @@
29
29
  },
30
30
  "dependencies": {
31
31
  "@adobe/react-spectrum": "^3.29.0",
32
- "@deephaven/auth-plugins": "^0.50.1-beta.5+c736708e",
33
- "@deephaven/chart": "^0.50.1-beta.5+c736708e",
34
- "@deephaven/components": "^0.50.1-beta.5+c736708e",
35
- "@deephaven/icons": "^0.50.1-beta.5+c736708e",
36
- "@deephaven/iris-grid": "^0.50.1-beta.5+c736708e",
37
- "@deephaven/jsapi-bootstrap": "^0.50.1-beta.5+c736708e",
38
- "@deephaven/jsapi-components": "^0.50.1-beta.5+c736708e",
39
- "@deephaven/jsapi-types": "^0.50.1-beta.5+c736708e",
40
- "@deephaven/jsapi-utils": "^0.50.1-beta.5+c736708e",
41
- "@deephaven/log": "^0.50.1-beta.5+c736708e",
42
- "@deephaven/plugin": "^0.50.1-beta.5+c736708e",
43
- "@deephaven/react-hooks": "^0.50.1-beta.5+c736708e",
44
- "@deephaven/redux": "^0.50.1-beta.5+c736708e",
45
- "@deephaven/utils": "^0.50.1-beta.5+c736708e",
32
+ "@deephaven/auth-plugins": "^0.51.0",
33
+ "@deephaven/chart": "^0.51.0",
34
+ "@deephaven/components": "^0.51.0",
35
+ "@deephaven/icons": "^0.51.0",
36
+ "@deephaven/iris-grid": "^0.51.0",
37
+ "@deephaven/jsapi-bootstrap": "^0.51.0",
38
+ "@deephaven/jsapi-components": "^0.51.0",
39
+ "@deephaven/jsapi-types": "^0.51.0",
40
+ "@deephaven/jsapi-utils": "^0.51.0",
41
+ "@deephaven/log": "^0.51.0",
42
+ "@deephaven/plugin": "^0.51.0",
43
+ "@deephaven/react-hooks": "^0.51.0",
44
+ "@deephaven/redux": "^0.51.0",
45
+ "@deephaven/utils": "^0.51.0",
46
46
  "@paciolan/remote-component": "2.13.0",
47
47
  "@paciolan/remote-module-loader": "^3.0.2",
48
48
  "fira": "mozilla/fira#4.202"
@@ -62,5 +62,5 @@
62
62
  "publishConfig": {
63
63
  "access": "public"
64
64
  },
65
- "gitHead": "c736708e0dd39aa1d0f171f1e9ecf69023647021"
65
+ "gitHead": "54f7cc5d08a9c1a390b2e89a9fb84fe1018008eb"
66
66
  }
@@ -1,4 +0,0 @@
1
- import type { IdeConnection } from '@deephaven/jsapi-types';
2
- export declare function useConnection(): IdeConnection;
3
- export default useConnection;
4
- //# sourceMappingURL=useConnection.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useConnection.d.ts","sourceRoot":"","sources":["../../src/components/useConnection.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAI5D,wBAAgB,aAAa,IAAI,aAAa,CAK7C;AAED,eAAe,aAAa,CAAC"}
@@ -1,7 +0,0 @@
1
- import { useContextOrThrow } from '@deephaven/react-hooks';
2
- import { ConnectionContext } from "./ConnectionBootstrap.js";
3
- export function useConnection() {
4
- return useContextOrThrow(ConnectionContext, 'No IdeConnection available in useConnection. Was code wrapped in ConnectionBootstrap or ConnectionContext.Provider?');
5
- }
6
- export default useConnection;
7
- //# sourceMappingURL=useConnection.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useConnection.js","names":["useContextOrThrow","ConnectionContext","useConnection"],"sources":["../../src/components/useConnection.ts"],"sourcesContent":["import type { IdeConnection } from '@deephaven/jsapi-types';\nimport { useContextOrThrow } from '@deephaven/react-hooks';\nimport { ConnectionContext } from './ConnectionBootstrap';\n\nexport function useConnection(): IdeConnection {\n return useContextOrThrow(\n ConnectionContext,\n 'No IdeConnection available in useConnection. Was code wrapped in ConnectionBootstrap or ConnectionContext.Provider?'\n );\n}\n\nexport default useConnection;\n"],"mappings":"AACA,SAASA,iBAAiB,QAAQ,wBAAwB;AAAC,SAClDC,iBAAiB;AAE1B,OAAO,SAASC,aAAa,GAAkB;EAC7C,OAAOF,iBAAiB,CACtBC,iBAAiB,EACjB,qHAAqH,CACtH;AACH;AAEA,eAAeC,aAAa"}
@@ -1,8 +0,0 @@
1
- import { type TablePluginComponent } from '@deephaven/plugin';
2
- /**
3
- * Creates a table plugin loader function.
4
- * @returns A function to load a Table plugin element by name
5
- */
6
- export declare function useLoadTablePlugin(): (name: string) => TablePluginComponent;
7
- export default useLoadTablePlugin;
8
- //# sourceMappingURL=useLoadTablePlugin.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useLoadTablePlugin.d.ts","sourceRoot":"","sources":["../../src/components/useLoadTablePlugin.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,oBAAoB,EAG1B,MAAM,mBAAmB,CAAC;AAM3B;;;GAGG;AACH,wBAAgB,kBAAkB,IAAI,CAAC,IAAI,EAAE,MAAM,KAAK,oBAAoB,CAwB3E;AAED,eAAe,kBAAkB,CAAC"}
@@ -1,31 +0,0 @@
1
- import { useCallback } from 'react';
2
- import { isTablePlugin, isLegacyTablePlugin } from '@deephaven/plugin';
3
- import Log from '@deephaven/log';
4
- import usePlugins from "./usePlugins.js";
5
- var log = Log.module('@deephaven/app-utils/useTablePlugin');
6
-
7
- /**
8
- * Creates a table plugin loader function.
9
- * @returns A function to load a Table plugin element by name
10
- */
11
- export function useLoadTablePlugin() {
12
- var plugins = usePlugins();
13
- var plugin = useCallback(name => {
14
- // First check if we have any plugin modules loaded that match the TablePlugin.
15
- var pluginModule = plugins.get(name);
16
- if (pluginModule != null) {
17
- if (isTablePlugin(pluginModule)) {
18
- return pluginModule.component;
19
- }
20
- if (isLegacyTablePlugin(pluginModule)) {
21
- return pluginModule.TablePlugin;
22
- }
23
- }
24
- var errorMessage = "Unable to find table plugin ".concat(name, ".");
25
- log.error(errorMessage);
26
- throw new Error(errorMessage);
27
- }, [plugins]);
28
- return plugin;
29
- }
30
- export default useLoadTablePlugin;
31
- //# sourceMappingURL=useLoadTablePlugin.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useLoadTablePlugin.js","names":["useCallback","isTablePlugin","isLegacyTablePlugin","Log","usePlugins","log","module","useLoadTablePlugin","plugins","plugin","name","pluginModule","get","component","TablePlugin","errorMessage","error","Error"],"sources":["../../src/components/useLoadTablePlugin.ts"],"sourcesContent":["import { useCallback } from 'react';\nimport {\n type TablePluginComponent,\n isTablePlugin,\n isLegacyTablePlugin,\n} from '@deephaven/plugin';\nimport Log from '@deephaven/log';\nimport usePlugins from './usePlugins';\n\nconst log = Log.module('@deephaven/app-utils/useTablePlugin');\n\n/**\n * Creates a table plugin loader function.\n * @returns A function to load a Table plugin element by name\n */\nexport function useLoadTablePlugin(): (name: string) => TablePluginComponent {\n const plugins = usePlugins();\n\n const plugin = useCallback(\n (name: string) => {\n // First check if we have any plugin modules loaded that match the TablePlugin.\n const pluginModule = plugins.get(name);\n if (pluginModule != null) {\n if (isTablePlugin(pluginModule)) {\n return pluginModule.component;\n }\n if (isLegacyTablePlugin(pluginModule)) {\n return pluginModule.TablePlugin;\n }\n }\n\n const errorMessage = `Unable to find table plugin ${name}.`;\n log.error(errorMessage);\n throw new Error(errorMessage);\n },\n [plugins]\n );\n\n return plugin;\n}\n\nexport default useLoadTablePlugin;\n"],"mappings":"AAAA,SAASA,WAAW,QAAQ,OAAO;AACnC,SAEEC,aAAa,EACbC,mBAAmB,QACd,mBAAmB;AAC1B,OAAOC,GAAG,MAAM,gBAAgB;AAAC,OAC1BC,UAAU;AAEjB,IAAMC,GAAG,GAAGF,GAAG,CAACG,MAAM,CAAC,qCAAqC,CAAC;;AAE7D;AACA;AACA;AACA;AACA,OAAO,SAASC,kBAAkB,GAA2C;EAC3E,IAAMC,OAAO,GAAGJ,UAAU,EAAE;EAE5B,IAAMK,MAAM,GAAGT,WAAW,CACvBU,IAAY,IAAK;IAChB;IACA,IAAMC,YAAY,GAAGH,OAAO,CAACI,GAAG,CAACF,IAAI,CAAC;IACtC,IAAIC,YAAY,IAAI,IAAI,EAAE;MACxB,IAAIV,aAAa,CAACU,YAAY,CAAC,EAAE;QAC/B,OAAOA,YAAY,CAACE,SAAS;MAC/B;MACA,IAAIX,mBAAmB,CAACS,YAAY,CAAC,EAAE;QACrC,OAAOA,YAAY,CAACG,WAAW;MACjC;IACF;IAEA,IAAMC,YAAY,yCAAkCL,IAAI,MAAG;IAC3DL,GAAG,CAACW,KAAK,CAACD,YAAY,CAAC;IACvB,MAAM,IAAIE,KAAK,CAACF,YAAY,CAAC;EAC/B,CAAC,EACD,CAACP,OAAO,CAAC,CACV;EAED,OAAOC,MAAM;AACf;AAEA,eAAeF,kBAAkB"}
@@ -1,4 +0,0 @@
1
- import type { PluginModuleMap } from '../plugins';
2
- export declare function usePlugins(): PluginModuleMap;
3
- export default usePlugins;
4
- //# sourceMappingURL=usePlugins.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"usePlugins.d.ts","sourceRoot":"","sources":["../../src/components/usePlugins.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAGlD,wBAAgB,UAAU,IAAI,eAAe,CAK5C;AAED,eAAe,UAAU,CAAC"}
@@ -1,7 +0,0 @@
1
- import { useContextOrThrow } from '@deephaven/react-hooks';
2
- import { PluginsContext } from "./PluginsBootstrap.js";
3
- export function usePlugins() {
4
- return useContextOrThrow(PluginsContext, 'No Plugins available in usePlugins. This can happen when plugins have not finished loading or if code is not wrapped in PluginsBootstrap or PluginsContext.Provider.');
5
- }
6
- export default usePlugins;
7
- //# sourceMappingURL=usePlugins.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"usePlugins.js","names":["useContextOrThrow","PluginsContext","usePlugins"],"sources":["../../src/components/usePlugins.ts"],"sourcesContent":["import { useContextOrThrow } from '@deephaven/react-hooks';\nimport type { PluginModuleMap } from '../plugins';\nimport { PluginsContext } from './PluginsBootstrap';\n\nexport function usePlugins(): PluginModuleMap {\n return useContextOrThrow(\n PluginsContext,\n 'No Plugins available in usePlugins. This can happen when plugins have not finished loading or if code is not wrapped in PluginsBootstrap or PluginsContext.Provider.'\n );\n}\n\nexport default usePlugins;\n"],"mappings":"AAAA,SAASA,iBAAiB,QAAQ,wBAAwB;AAAC,SAElDC,cAAc;AAEvB,OAAO,SAASC,UAAU,GAAoB;EAC5C,OAAOF,iBAAiB,CACtBC,cAAc,EACd,sKAAsK,CACvK;AACH;AAEA,eAAeC,UAAU"}