@deephaven/app-utils 0.42.1-beta.4 → 0.44.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.
@@ -1 +1 @@
1
- {"version":3,"file":"AppBootstrap.d.ts","sourceRoot":"","sources":["../../src/components/AppBootstrap.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAyC,MAAM,OAAO,CAAC;AAC9D,OAAO,gDAAgD,CAAC;AAaxD,MAAM,MAAM,iBAAiB,GAAG;IAC9B,yBAAyB;IACzB,SAAS,EAAE,MAAM,CAAC;IAElB,kCAAkC;IAClC,UAAU,EAAE,MAAM,CAAC;IAEnB,gCAAgC;IAChC,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;IAE1B;;OAEG;IACH,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B,CAAC;AAEF;;;GAGG;AACH,wBAAgB,YAAY,CAAC,EAC3B,cAAc,EACd,UAAU,EACV,SAAS,EACT,QAAQ,GACT,EAAE,iBAAiB,eA6BnB;AAED,eAAe,YAAY,CAAC"}
1
+ {"version":3,"file":"AppBootstrap.d.ts","sourceRoot":"","sources":["../../src/components/AppBootstrap.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAyC,MAAM,OAAO,CAAC;AAC9D,OAAO,gDAAgD,CAAC;AAexD,MAAM,MAAM,iBAAiB,GAAG;IAC9B,yBAAyB;IACzB,SAAS,EAAE,MAAM,CAAC;IAElB,kCAAkC;IAClC,UAAU,EAAE,MAAM,CAAC;IAEnB,gCAAgC;IAChC,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;IAE1B;;OAEG;IACH,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B,CAAC;AAEF;;;GAGG;AACH,wBAAgB,YAAY,CAAC,EAC3B,cAAc,EACd,UAAU,EACV,SAAS,EACT,QAAQ,GACT,EAAE,iBAAiB,eAiCnB;AAED,eAAe,YAAY,CAAC"}
@@ -8,6 +8,8 @@ import AuthBootstrap from "./AuthBootstrap.js";
8
8
  import ConnectionBootstrap from "./ConnectionBootstrap.js";
9
9
  import { getConnectOptions } from "../utils/index.js";
10
10
  import FontsLoaded from "./FontsLoaded.js";
11
+ import UserBootstrap from "./UserBootstrap.js";
12
+ import ServerConfigBootstrap from "./ServerConfigBootstrap.js";
11
13
  /**
12
14
  * AppBootstrap component. Handles loading the fonts, client, and authentication.
13
15
  * Will display the children when everything is loaded and authenticated.
@@ -36,7 +38,7 @@ export function AppBootstrap(_ref) {
36
38
  serverUrl: serverUrl,
37
39
  options: clientOptions,
38
40
  key: logoutCount
39
- }, /*#__PURE__*/React.createElement(RefreshTokenBootstrap, null, /*#__PURE__*/React.createElement(AuthBootstrap, null, /*#__PURE__*/React.createElement(ConnectionBootstrap, null, /*#__PURE__*/React.createElement(FontsLoaded, null, children)))))));
41
+ }, /*#__PURE__*/React.createElement(RefreshTokenBootstrap, null, /*#__PURE__*/React.createElement(AuthBootstrap, null, /*#__PURE__*/React.createElement(ServerConfigBootstrap, null, /*#__PURE__*/React.createElement(UserBootstrap, null, /*#__PURE__*/React.createElement(ConnectionBootstrap, null, /*#__PURE__*/React.createElement(FontsLoaded, null, children)))))))));
40
42
  }
41
43
  export default AppBootstrap;
42
44
  //# sourceMappingURL=AppBootstrap.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"AppBootstrap.js","names":["React","useCallback","useMemo","useState","ClientBootstrap","RefreshTokenBootstrap","useBroadcastLoginListener","FontBootstrap","PluginsBootstrap","AuthBootstrap","ConnectionBootstrap","getConnectOptions","FontsLoaded","AppBootstrap","fontClassNames","pluginsUrl","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 FontBootstrap from './FontBootstrap';\nimport PluginsBootstrap from './PluginsBootstrap';\nimport AuthBootstrap from './AuthBootstrap';\nimport ConnectionBootstrap from './ConnectionBootstrap';\nimport { getConnectOptions } from '../utils';\nimport FontsLoaded from './FontsLoaded';\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 /** 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 serverUrl,\n children,\n}: AppBootstrapProps) {\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 pluginsUrl={pluginsUrl}>\n <ClientBootstrap\n serverUrl={serverUrl}\n options={clientOptions}\n key={logoutCount}\n >\n <RefreshTokenBootstrap>\n <AuthBootstrap>\n <ConnectionBootstrap>\n <FontsLoaded>{children}</FontsLoaded>\n </ConnectionBootstrap>\n </AuthBootstrap>\n </RefreshTokenBootstrap>\n </ClientBootstrap>\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,OAC9BC,aAAa;AAAA,OACbC,gBAAgB;AAAA,OAChBC,aAAa;AAAA,OACbC,mBAAmB;AAAA,SACjBC,iBAAiB;AAAA,OACnBC,WAAW;AAkBlB;AACA;AACA;AACA;AACA,OAAO,SAASC,YAAY,OAKN;EAAA,IALO;IAC3BC,cAAc;IACdC,UAAU;IACVC,SAAS;IACTC;EACiB,CAAC;EAClB,IAAMC,aAAa,GAAGhB,OAAO,CAAC,MAAMS,iBAAiB,EAAE,EAAE,EAAE,CAAC;;EAE5D;EACA,IAAM,CAACQ,WAAW,EAAEC,cAAc,CAAC,GAAGjB,QAAQ,CAAC,CAAC,CAAC;EACjD,IAAMkB,OAAO,GAAGpB,WAAW,CAAC,MAAMqB,SAAS,EAAE,EAAE,CAAC;EAChD,IAAMC,QAAQ,GAAGtB,WAAW,CAAC,MAAM;IACjCmB,cAAc,CAACI,KAAK,IAAIA,KAAK,GAAG,CAAC,CAAC;EACpC,CAAC,EAAE,EAAE,CAAC;EACNlB,yBAAyB,CAACe,OAAO,EAAEE,QAAQ,CAAC;EAC5C,oBACE,oBAAC,aAAa;IAAC,cAAc,EAAET;EAAe,gBAC5C,oBAAC,gBAAgB;IAAC,UAAU,EAAEC;EAAW,gBACvC,oBAAC,eAAe;IACd,SAAS,EAAEC,SAAU;IACrB,OAAO,EAAEE,aAAc;IACvB,GAAG,EAAEC;EAAY,gBAEjB,oBAAC,qBAAqB,qBACpB,oBAAC,aAAa,qBACZ,oBAAC,mBAAmB,qBAClB,oBAAC,WAAW,QAAEF,QAAQ,CAAe,CACjB,CACR,CACM,CACR,CACD,CACL;AAEpB;AAEA,eAAeJ,YAAY"}
1
+ {"version":3,"file":"AppBootstrap.js","names":["React","useCallback","useMemo","useState","ClientBootstrap","RefreshTokenBootstrap","useBroadcastLoginListener","FontBootstrap","PluginsBootstrap","AuthBootstrap","ConnectionBootstrap","getConnectOptions","FontsLoaded","UserBootstrap","ServerConfigBootstrap","AppBootstrap","fontClassNames","pluginsUrl","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 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';\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 /** 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 serverUrl,\n children,\n}: AppBootstrapProps) {\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 pluginsUrl={pluginsUrl}>\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 </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,OAC9BC,aAAa;AAAA,OACbC,gBAAgB;AAAA,OAChBC,aAAa;AAAA,OACbC,mBAAmB;AAAA,SACjBC,iBAAiB;AAAA,OACnBC,WAAW;AAAA,OACXC,aAAa;AAAA,OACbC,qBAAqB;AAkB5B;AACA;AACA;AACA;AACA,OAAO,SAASC,YAAY,OAKN;EAAA,IALO;IAC3BC,cAAc;IACdC,UAAU;IACVC,SAAS;IACTC;EACiB,CAAC;EAClB,IAAMC,aAAa,GAAGlB,OAAO,CAAC,MAAMS,iBAAiB,EAAE,EAAE,EAAE,CAAC;;EAE5D;EACA,IAAM,CAACU,WAAW,EAAEC,cAAc,CAAC,GAAGnB,QAAQ,CAAC,CAAC,CAAC;EACjD,IAAMoB,OAAO,GAAGtB,WAAW,CAAC,MAAMuB,SAAS,EAAE,EAAE,CAAC;EAChD,IAAMC,QAAQ,GAAGxB,WAAW,CAAC,MAAM;IACjCqB,cAAc,CAACI,KAAK,IAAIA,KAAK,GAAG,CAAC,CAAC;EACpC,CAAC,EAAE,EAAE,CAAC;EACNpB,yBAAyB,CAACiB,OAAO,EAAEE,QAAQ,CAAC;EAC5C,oBACE,oBAAC,aAAa;IAAC,cAAc,EAAET;EAAe,gBAC5C,oBAAC,gBAAgB;IAAC,UAAU,EAAEC;EAAW,gBACvC,oBAAC,eAAe;IACd,SAAS,EAAEC,SAAU;IACrB,OAAO,EAAEE,aAAc;IACvB,GAAG,EAAEC;EAAY,gBAEjB,oBAAC,qBAAqB,qBACpB,oBAAC,aAAa,qBACZ,oBAAC,qBAAqB,qBACpB,oBAAC,aAAa,qBACZ,oBAAC,mBAAmB,qBAClB,oBAAC,WAAW,QAAEF,QAAQ,CAAe,CACjB,CACR,CACM,CACV,CACM,CACR,CACD,CACL;AAEpB;AAEA,eAAeJ,YAAY"}
@@ -0,0 +1,14 @@
1
+ import React from 'react';
2
+ export declare const ServerConfigContext: React.Context<Map<string, string> | null>;
3
+ export type ServerConfigBootstrapProps = {
4
+ /**
5
+ * The children to render after server config is loaded.
6
+ */
7
+ children: React.ReactNode;
8
+ };
9
+ /**
10
+ * ServerConfigBootstrap component. Handles loading the server config.
11
+ */
12
+ export declare function ServerConfigBootstrap({ children, }: ServerConfigBootstrapProps): JSX.Element;
13
+ export default ServerConfigBootstrap;
14
+ //# sourceMappingURL=ServerConfigBootstrap.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ServerConfigBootstrap.d.ts","sourceRoot":"","sources":["../../src/components/ServerConfigBootstrap.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA6C,MAAM,OAAO,CAAC;AAKlE,eAAO,MAAM,mBAAmB,2CAE/B,CAAC;AAEF,MAAM,MAAM,0BAA0B,GAAG;IACvC;;OAEG;IACH,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B,CAAC;AAEF;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,EACpC,QAAQ,GACT,EAAE,0BAA0B,eA4C5B;AAED,eAAe,qBAAqB,CAAC"}
@@ -0,0 +1,55 @@
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
+ 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';
4
+ import { LoadingOverlay } from '@deephaven/components';
5
+ import { useClient } from '@deephaven/jsapi-bootstrap';
6
+ import { getErrorMessage } from '@deephaven/utils';
7
+ export var ServerConfigContext = /*#__PURE__*/createContext(null);
8
+ /**
9
+ * ServerConfigBootstrap component. Handles loading the server config.
10
+ */
11
+ export function ServerConfigBootstrap(_ref) {
12
+ var {
13
+ children
14
+ } = _ref;
15
+ var client = useClient();
16
+ var [serverConfig, setServerConfig] = useState();
17
+ var [error, setError] = useState();
18
+ useEffect(function initServerConfigValues() {
19
+ var isCanceled = false;
20
+ function loadServerConfigValues() {
21
+ return _loadServerConfigValues.apply(this, arguments);
22
+ }
23
+ function _loadServerConfigValues() {
24
+ _loadServerConfigValues = _asyncToGenerator(function* () {
25
+ try {
26
+ var newServerConfigValues = yield client.getServerConfigValues();
27
+ if (!isCanceled) {
28
+ setServerConfig(new Map(newServerConfigValues));
29
+ }
30
+ } catch (e) {
31
+ if (!isCanceled) {
32
+ setError(e);
33
+ }
34
+ }
35
+ });
36
+ return _loadServerConfigValues.apply(this, arguments);
37
+ }
38
+ loadServerConfigValues();
39
+ return () => {
40
+ isCanceled = true;
41
+ };
42
+ }, [client]);
43
+ var isLoading = serverConfig == null;
44
+ if (isLoading || error != null) {
45
+ return /*#__PURE__*/React.createElement(LoadingOverlay, {
46
+ isLoading: isLoading && error == null,
47
+ errorMessage: getErrorMessage(error)
48
+ });
49
+ }
50
+ return /*#__PURE__*/React.createElement(ServerConfigContext.Provider, {
51
+ value: serverConfig
52
+ }, children);
53
+ }
54
+ export default ServerConfigBootstrap;
55
+ //# sourceMappingURL=ServerConfigBootstrap.js.map
@@ -0,0 +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) {\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() {\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;AAElD,OAAO,IAAMC,mBAAmB,gBAAGN,aAAa,CAC9C,IAAI,CACL;AASD;AACA;AACA;AACA,OAAO,SAASO,qBAAqB,OAEN;EAAA,IAFO;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,aAAwC;QACtC,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,oBAAC,cAAc;MACb,SAAS,EAAES,SAAS,IAAIT,KAAK,IAAI,IAAK;MACtC,YAAY,EAAEP,eAAe,CAACO,KAAK;IAAE,EACrC;EAEN;EAEA,oBACE,oBAAC,mBAAmB,CAAC,QAAQ;IAAC,KAAK,EAAEF;EAAa,GAC/CF,QAAQ,CACoB;AAEnC;AAEA,eAAeD,qBAAqB"}
@@ -0,0 +1,11 @@
1
+ import React from 'react';
2
+ export type UserBootstrapProps = {
3
+ /** The children to render */
4
+ children: React.ReactNode;
5
+ };
6
+ /**
7
+ * UserBootstrap component. Derives the UserContext from the ServerConfigContext, UserOverrideContext, and UserPermissionsOverrideContext.
8
+ */
9
+ export declare function UserBootstrap({ children }: UserBootstrapProps): JSX.Element;
10
+ export default UserBootstrap;
11
+ //# sourceMappingURL=UserBootstrap.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"UserBootstrap.d.ts","sourceRoot":"","sources":["../../src/components/UserBootstrap.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqB,MAAM,OAAO,CAAC;AAS1C,MAAM,MAAM,kBAAkB,GAAG;IAC/B,6BAA6B;IAC7B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B,CAAC;AAEF;;GAEG;AACH,wBAAgB,aAAa,CAAC,EAAE,QAAQ,EAAE,EAAE,kBAAkB,eAM7D;AAED,eAAe,aAAa,CAAC"}
@@ -0,0 +1,20 @@
1
+ import React, { useContext } from 'react';
2
+ import { UserContext, UserOverrideContext, UserPermissionsOverrideContext, getUserFromConfig } from '@deephaven/auth-plugins';
3
+ import useServerConfig from "./useServerConfig.js";
4
+ /**
5
+ * UserBootstrap component. Derives the UserContext from the ServerConfigContext, UserOverrideContext, and UserPermissionsOverrideContext.
6
+ */
7
+ export function UserBootstrap(_ref) {
8
+ var {
9
+ children
10
+ } = _ref;
11
+ var serverConfig = useServerConfig();
12
+ var overrides = useContext(UserOverrideContext);
13
+ var permissionsOverrides = useContext(UserPermissionsOverrideContext);
14
+ var user = getUserFromConfig(serverConfig, overrides, permissionsOverrides);
15
+ return /*#__PURE__*/React.createElement(UserContext.Provider, {
16
+ value: user
17
+ }, children);
18
+ }
19
+ export default UserBootstrap;
20
+ //# sourceMappingURL=UserBootstrap.js.map
@@ -0,0 +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) {\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;AAOtB;AACA;AACA;AACA,OAAO,SAASC,aAAa,OAAmC;EAAA,IAAlC;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,oBAAC,WAAW,CAAC,QAAQ;IAAC,KAAK,EAAEC;EAAK,GAAEJ,QAAQ,CAAwB;AAC7E;AAEA,eAAeD,aAAa"}
@@ -6,4 +6,6 @@ export * from './FontsLoaded';
6
6
  export * from './PluginsBootstrap';
7
7
  export * from './usePlugins';
8
8
  export * from './useConnection';
9
+ export * from './useServerConfig';
10
+ export * from './useUser';
9
11
  //# 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,cAAc,CAAC;AAC7B,cAAc,iBAAiB,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,cAAc,CAAC;AAC7B,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,WAAW,CAAC"}
@@ -6,4 +6,6 @@ export * from "./FontsLoaded.js";
6
6
  export * from "./PluginsBootstrap.js";
7
7
  export * from "./usePlugins.js";
8
8
  export * from "./useConnection.js";
9
+ export * from "./useServerConfig.js";
10
+ export * from "./useUser.js";
9
11
  //# 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 './usePlugins';\nexport * from './useConnection';\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 './usePlugins';\nexport * from './useConnection';\nexport * from './useServerConfig';\nexport * from './useUser';\n"],"mappings":""}
@@ -0,0 +1,3 @@
1
+ export declare function useServerConfig(): Map<string, string>;
2
+ export default useServerConfig;
3
+ //# sourceMappingURL=useServerConfig.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useServerConfig.d.ts","sourceRoot":"","sources":["../../src/components/useServerConfig.ts"],"names":[],"mappings":"AAGA,wBAAgB,eAAe,wBAK9B;AAED,eAAe,eAAe,CAAC"}
@@ -0,0 +1,7 @@
1
+ import { useContextOrThrow } from '@deephaven/react-hooks';
2
+ import { ServerConfigContext } from "./ServerConfigBootstrap.js";
3
+ export function useServerConfig() {
4
+ return useContextOrThrow(ServerConfigContext, 'No server config available in useServerConfig. Was code wrapped in ServerConfigBootstrap or ServerConfigContext.Provider?');
5
+ }
6
+ export default useServerConfig;
7
+ //# sourceMappingURL=useServerConfig.js.map
@@ -0,0 +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() {\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,GAAG;EAChC,OAAOF,iBAAiB,CACtBC,mBAAmB,EACnB,2HAA2H,CAC5H;AACH;AAEA,eAAeC,eAAe"}
@@ -0,0 +1,3 @@
1
+ export declare function useUser(): import("@deephaven/redux").User;
2
+ export default useUser;
3
+ //# sourceMappingURL=useUser.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useUser.d.ts","sourceRoot":"","sources":["../../src/components/useUser.ts"],"names":[],"mappings":"AAGA,wBAAgB,OAAO,oCAKtB;AAED,eAAe,OAAO,CAAC"}
@@ -0,0 +1,7 @@
1
+ import { useContextOrThrow } from '@deephaven/react-hooks';
2
+ import { UserContext } from '@deephaven/auth-plugins';
3
+ export function useUser() {
4
+ return useContextOrThrow(UserContext, 'No user available in useUser. Was code wrapped in UserBootstrap or UserContext.Provider?');
5
+ }
6
+ export default useUser;
7
+ //# sourceMappingURL=useUser.js.map
@@ -0,0 +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';\n\nexport function useUser() {\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;AAErD,OAAO,SAASC,OAAO,GAAG;EACxB,OAAOF,iBAAiB,CACtBC,WAAW,EACX,0FAA0F,CAC3F;AACH;AAEA,eAAeC,OAAO"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@deephaven/app-utils",
3
- "version": "0.42.1-beta.4+154ccfcc",
3
+ "version": "0.44.0",
4
4
  "description": "Deephaven App Utils",
5
5
  "author": "Deephaven Data Labs LLC",
6
6
  "license": "Apache-2.0",
@@ -28,15 +28,15 @@
28
28
  "redux": "^4.x"
29
29
  },
30
30
  "dependencies": {
31
- "@deephaven/auth-plugins": "^0.42.1-beta.4+154ccfcc",
32
- "@deephaven/components": "^0.42.1-beta.4+154ccfcc",
33
- "@deephaven/jsapi-bootstrap": "^0.42.1-beta.4+154ccfcc",
34
- "@deephaven/jsapi-components": "^0.42.1-beta.4+154ccfcc",
35
- "@deephaven/jsapi-types": "^0.42.1-beta.4+154ccfcc",
36
- "@deephaven/jsapi-utils": "^0.42.1-beta.4+154ccfcc",
37
- "@deephaven/log": "^0.42.1-beta.4+154ccfcc",
38
- "@deephaven/react-hooks": "^0.42.1-beta.4+154ccfcc",
39
- "@deephaven/utils": "^0.42.1-beta.4+154ccfcc",
31
+ "@deephaven/auth-plugins": "^0.44.0",
32
+ "@deephaven/components": "^0.44.0",
33
+ "@deephaven/jsapi-bootstrap": "^0.44.0",
34
+ "@deephaven/jsapi-components": "^0.44.0",
35
+ "@deephaven/jsapi-types": "^0.44.0",
36
+ "@deephaven/jsapi-utils": "^0.44.0",
37
+ "@deephaven/log": "^0.44.0",
38
+ "@deephaven/react-hooks": "^0.44.0",
39
+ "@deephaven/utils": "^0.44.0",
40
40
  "@paciolan/remote-component": "2.13.0",
41
41
  "@paciolan/remote-module-loader": "^3.0.2",
42
42
  "fira": "mozilla/fira#4.202"
@@ -56,5 +56,5 @@
56
56
  "publishConfig": {
57
57
  "access": "public"
58
58
  },
59
- "gitHead": "154ccfccd5a6f9996d67f0fcc71d031985bfd6a5"
59
+ "gitHead": "ba13c9139b3b7a5f5d64d79069f1de9d4727eeb6"
60
60
  }