@deephaven/embed-grid 0.37.1-auth-plugins.2 → 0.37.2

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.
@@ -0,0 +1,2 @@
1
+ var E=Object.defineProperty;var m=(n,t,o)=>t in n?E(n,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):n[t]=o;var p=(n,t,o)=>(m(n,typeof t!="symbol"?t+"":t,o),o);import{r as e,j as l}from"./vendor-5506ffbc.js";import{af as h,L as S,ae as g}from"./index-b177e5d5.js";class A extends Error{constructor(){super(...arguments);p(this,"isTimeout",!0)}}const b=A,x=()=>{const n=e.useContext(h);if(n==null)throw new Error("No API available in useApi. Was code wrapped in ApiBootstrap or ApiContext.Provider?");return n},w=e.createContext(null);function L({serverUrl:n,options:t,children:o}){const i=x(),[s,r]=e.useState();return e.useEffect(function(){const u=new i.CoreClient(n,t);return r(u),()=>{u.disconnect()}},[i,t,n]),s==null?null:l.jsx(w.Provider,{value:s,children:o})}function j(){const n=e.useContext(w);if(n==null)throw new Error("No Client available in useClient. Was code wrapped in ClientBootstrap or ClientContext.Provider?");return n}const B=S.module("@deephaven/jsapi-components.ConnectionBootstrap"),v=e.createContext(null);function y({children:n}){const t=x(),o=j(),[i,s]=e.useState(),[r,C]=e.useState();return e.useEffect(function(){let a=!1;async function d(){try{const c=await o.getAsIdeConnection();if(a)return;C(c)}catch(c){if(a)return;s(c)}}return d(),()=>{a=!0}},[t,o]),e.useEffect(function(){if(r==null)return;function a(c){const{detail:f}=c;B.info("Shutdown",`${JSON.stringify(f)}`),s(`Server shutdown: ${f??"Unknown reason"}`)}return r.addEventListener(t.IdeConnection.EVENT_SHUTDOWN,a)},[t,r]),r==null||i!=null?l.jsx(g,{"data-testid":"connection-bootstrap-loading",isLoading:r==null,errorMessage:`${i}`}):l.jsx(v.Provider,{value:r,children:n})}function I(){const n=e.useContext(v);if(n==null)throw new Error("No IdeConnection available in useConnection. Was code wrapped in ConnectionBootstrap or ConnectionContext.Provider?");return n}export{L as C,b as T,x as a,j as b,y as c,w as d,v as e,I as u};
2
+ //# sourceMappingURL=useConnection-563173ac.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useConnection-563173ac.js","sources":["../../../utils/src/TimeoutError.ts","../../../jsapi-bootstrap/src/useApi.ts","../../../app-utils/src/components/ClientBootstrap.tsx","../../../app-utils/src/components/useClient.ts","../../../app-utils/src/components/ConnectionBootstrap.tsx","../../../app-utils/src/components/useConnection.ts"],"sourcesContent":["class TimeoutError extends Error {\n isTimeout = true;\n}\n\nexport default TimeoutError;\n","import { useContext } from 'react';\nimport { ApiContext } from './ApiBootstrap';\n\nexport const useApi = () => {\n const dh = useContext(ApiContext);\n if (dh == null) {\n throw new Error(\n 'No API available in useApi. Was code wrapped in ApiBootstrap or ApiContext.Provider?'\n );\n }\n return dh;\n};\n\nexport default useApi;\n","import React, { createContext, useEffect, useState } from 'react';\nimport { useApi } from '@deephaven/jsapi-bootstrap';\nimport { ConnectOptions, CoreClient } from '@deephaven/jsapi-types';\n\nexport const ClientContext = createContext<CoreClient | null>(null);\n\nexport type ClientBootstrapProps = {\n /** URL of the server to connect to */\n serverUrl: string;\n\n /** Connection options to pass to CoreClient when connecting */\n options?: ConnectOptions;\n\n /**\n * The children to render wrapped with the ClientContext.\n * Will not render children until the client is created.\n */\n children: React.ReactNode;\n};\n\n/**\n * ClientBootstrap component. Handles creating the client.\n */\nexport function ClientBootstrap({\n serverUrl,\n options,\n children,\n}: ClientBootstrapProps) {\n const api = useApi();\n const [client, setClient] = useState<CoreClient>();\n useEffect(\n function initClient() {\n const newClient = new api.CoreClient(serverUrl, options);\n setClient(newClient);\n return () => {\n newClient.disconnect();\n };\n },\n [api, options, serverUrl]\n );\n\n if (client == null) {\n return null;\n }\n return (\n <ClientContext.Provider value={client}>{children}</ClientContext.Provider>\n );\n}\n\nexport default ClientBootstrap;\n","import { useContext } from 'react';\nimport { ClientContext } from './ClientBootstrap';\n\nexport function useClient() {\n const client = useContext(ClientContext);\n if (client == null) {\n throw new Error(\n 'No Client available in useClient. Was code wrapped in ClientBootstrap or ClientContext.Provider?'\n );\n }\n return client;\n}\n\nexport default useClient;\n","import React, { createContext, useEffect, useState } from 'react';\nimport { LoadingOverlay } from '@deephaven/components';\nimport { useApi } from '@deephaven/jsapi-bootstrap';\nimport { IdeConnection } from '@deephaven/jsapi-types';\nimport Log from '@deephaven/log';\nimport useClient from './useClient';\n\nconst log = Log.module('@deephaven/jsapi-components.ConnectionBootstrap');\n\nexport const ConnectionContext = createContext<IdeConnection | null>(null);\n\nexport type ConnectionBootstrapProps = {\n /**\n * The children to render wrapped with the ConnectionContext.\n * Will not render children until the connection is created.\n */\n children: React.ReactNode;\n};\n\n/**\n * ConnectionBootstrap component. Handles initializing the connection.\n */\nexport function ConnectionBootstrap({ children }: ConnectionBootstrapProps) {\n const api = useApi();\n const client = useClient();\n const [error, setError] = useState<unknown>();\n const [connection, setConnection] = useState<IdeConnection>();\n useEffect(\n function initConnection() {\n let isCancelled = false;\n async function loadConnection() {\n try {\n const newConnection = await client.getAsIdeConnection();\n if (isCancelled) {\n return;\n }\n setConnection(newConnection);\n } catch (e) {\n if (isCancelled) {\n return;\n }\n setError(e);\n }\n }\n loadConnection();\n return () => {\n isCancelled = true;\n };\n },\n [api, client]\n );\n\n useEffect(\n function listenForShutdown() {\n if (connection == null) return;\n\n function handleShutdown(event: CustomEvent) {\n const { detail } = event;\n log.info('Shutdown', `${JSON.stringify(detail)}`);\n setError(`Server shutdown: ${detail ?? 'Unknown reason'}`);\n }\n\n const removerFn = connection.addEventListener(\n api.IdeConnection.EVENT_SHUTDOWN,\n handleShutdown\n );\n return removerFn;\n },\n [api, connection]\n );\n\n if (connection == null || error != null) {\n return (\n <LoadingOverlay\n data-testid=\"connection-bootstrap-loading\"\n isLoading={connection == null}\n errorMessage={`${error}`}\n />\n );\n }\n\n return (\n <ConnectionContext.Provider value={connection}>\n {children}\n </ConnectionContext.Provider>\n );\n}\n\nexport default ConnectionBootstrap;\n","import { useContext } from 'react';\nimport { ConnectionContext } from './ConnectionBootstrap';\n\nexport function useConnection() {\n const connection = useContext(ConnectionContext);\n if (connection == null) {\n throw new Error(\n 'No IdeConnection available in useConnection. Was code wrapped in ConnectionBootstrap or ConnectionContext.Provider?'\n );\n }\n return connection;\n}\n\nexport default useConnection;\n"],"names":["TimeoutError","__publicField","TimeoutError$1","useApi","dh","useContext","ApiContext","ClientContext","createContext","ClientBootstrap","serverUrl","options","children","api","client","setClient","useState","useEffect","newClient","useClient","log","Log","ConnectionContext","ConnectionBootstrap","error","setError","connection","setConnection","isCancelled","loadConnection","newConnection","e","handleShutdown","event","detail","jsx","LoadingOverlay","useConnection"],"mappings":"gRAAA,MAAMA,UAAqB,KAAM,CAAjC,kCACEC,EAAA,iBAAY,IACd,CAEA,MAAAC,EAAeF,ECDFG,EAAS,IAAM,CACpB,MAAAC,EAAKC,aAAWC,CAAU,EAChC,GAAIF,GAAM,KACR,MAAM,IAAI,MACR,sFAAA,EAGG,OAAAA,CACT,ECPaG,EAAgBC,gBAAiC,IAAI,EAmB3D,SAASC,EAAgB,CAC9B,UAAAC,EACA,QAAAC,EACA,SAAAC,CACF,EAAyB,CACvB,MAAMC,EAAMV,IACN,CAACW,EAAQC,CAAS,EAAIC,EAAqB,SAAA,EAYjD,OAXAC,EAAA,UACE,UAAsB,CACpB,MAAMC,EAAY,IAAIL,EAAI,WAAWH,EAAWC,CAAO,EACvD,OAAAI,EAAUG,CAAS,EACZ,IAAM,CACXA,EAAU,WAAW,CAAA,CAEzB,EACA,CAACL,EAAKF,EAASD,CAAS,CAAA,EAGtBI,GAAU,KACL,WAGNP,EAAc,SAAd,CAAuB,MAAOO,EAAS,SAAAF,CAAS,CAAA,CAErD,CC5CO,SAASO,GAAY,CACpB,MAAAL,EAAST,aAAWE,CAAa,EACvC,GAAIO,GAAU,KACZ,MAAM,IAAI,MACR,kGAAA,EAGG,OAAAA,CACT,CCJA,MAAMM,EAAM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version" content="v0.37.0" />
4
+ <meta name="ui-version" content="v0.37.2" />
5
5
  <meta charset="utf-8" />
6
6
  <meta
7
7
  name="viewport"
@@ -16,7 +16,7 @@
16
16
 
17
17
  <link rel="icon" href="./favicon-cc-app.svg" />
18
18
  <title>Deephaven Embedded Grid</title>
19
- <script type="module" crossorigin src="./assets/index-dd6971f8.js"></script>
19
+ <script type="module" crossorigin src="./assets/index-b177e5d5.js"></script>
20
20
  <link rel="modulepreload" crossorigin href="./assets/monaco-0851b9b6.js">
21
21
  <link rel="modulepreload" crossorigin href="./assets/helpers-042e6b4d.js">
22
22
  <link rel="modulepreload" crossorigin href="./assets/vendor-5506ffbc.js">
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@deephaven/embed-grid",
3
- "version": "0.37.1-auth-plugins.2+96728edb",
3
+ "version": "0.37.2",
4
4
  "description": "Deephaven Embedded Grid",
5
5
  "author": "Deephaven Data Labs LLC",
6
6
  "license": "Apache-2.0",
@@ -16,13 +16,13 @@
16
16
  "build"
17
17
  ],
18
18
  "dependencies": {
19
- "@deephaven/app-utils": "^0.37.1-auth-plugins.2+96728edb",
20
- "@deephaven/components": "^0.37.1-auth-plugins.2+96728edb",
21
- "@deephaven/iris-grid": "^0.37.1-auth-plugins.2+96728edb",
22
- "@deephaven/jsapi-bootstrap": "^0.37.1-auth-plugins.2+96728edb",
23
- "@deephaven/jsapi-shim": "^0.37.1-auth-plugins.2+96728edb",
24
- "@deephaven/jsapi-utils": "^0.37.1-auth-plugins.2+96728edb",
25
- "@deephaven/log": "^0.37.1-auth-plugins.2+96728edb",
19
+ "@deephaven/app-utils": "^0.37.2",
20
+ "@deephaven/components": "^0.37.2",
21
+ "@deephaven/iris-grid": "^0.37.2",
22
+ "@deephaven/jsapi-bootstrap": "^0.37.2",
23
+ "@deephaven/jsapi-shim": "^0.37.2",
24
+ "@deephaven/jsapi-utils": "^0.37.2",
25
+ "@deephaven/log": "^0.37.2",
26
26
  "fira": "mozilla/fira#4.202",
27
27
  "react": "^17.0.2",
28
28
  "react-dom": "^17.0.2"
@@ -34,16 +34,16 @@
34
34
  "preview": "vite preview"
35
35
  },
36
36
  "devDependencies": {
37
- "@deephaven/eslint-config": "^0.37.1-auth-plugins.2+96728edb",
38
- "@deephaven/mocks": "^0.37.1-auth-plugins.2+96728edb",
39
- "@deephaven/prettier-config": "^0.37.1-auth-plugins.2+96728edb",
40
- "@deephaven/stylelint-config": "^0.37.1-auth-plugins.2+96728edb",
41
- "@deephaven/tsconfig": "^0.37.1-auth-plugins.2+96728edb",
37
+ "@deephaven/eslint-config": "^0.37.2",
38
+ "@deephaven/mocks": "^0.37.2",
39
+ "@deephaven/prettier-config": "^0.37.2",
40
+ "@deephaven/stylelint-config": "^0.37.2",
41
+ "@deephaven/tsconfig": "^0.37.2",
42
42
  "@vitejs/plugin-react-swc": "^3.2.0",
43
43
  "vite": "^4.1.4"
44
44
  },
45
45
  "publishConfig": {
46
46
  "access": "public"
47
47
  },
48
- "gitHead": "96728edb7793223b015654e81e07b04505db0854"
48
+ "gitHead": "fa22e4b507d6b3a52ea05ca6b1256c0cb1432c18"
49
49
  }