@deephaven/jsapi-bootstrap 0.59.1-beta.4 → 0.59.1-deferred-api.7

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,14 @@
1
+ import React from 'react';
2
+ type DeferredApiBootstrapProps = React.PropsWithChildren<{
3
+ onError?: (error: unknown) => void;
4
+ /**
5
+ * Options to use when fetching the deferred API.
6
+ */
7
+ options?: Record<string, unknown>;
8
+ }>;
9
+ /**
10
+ * Does not render children until the deferred API is resolved.
11
+ */
12
+ declare const DeferredApiBootstrap: React.MemoExoticComponent<({ children, onError, options, }: DeferredApiBootstrapProps) => JSX.Element | null>;
13
+ export default DeferredApiBootstrap;
14
+ //# sourceMappingURL=DeferredApiBootstrap.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DeferredApiBootstrap.d.ts","sourceRoot":"","sources":["../src/DeferredApiBootstrap.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,KAAK,yBAAyB,GAAG,KAAK,CAAC,iBAAiB,CAAC;IACvD,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;IACnC;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACnC,CAAC,CAAC;AAEH;;GAEG;AACH,QAAA,MAAM,oBAAoB,8DAKrB,yBAAyB,KAAG,WAAW,GAAG,IAAI,CAYlD,CAAC;AAIF,eAAe,oBAAoB,CAAC"}
@@ -0,0 +1,30 @@
1
+ import React from 'react';
2
+ import useDeferredApi from "./useDeferredApi.js";
3
+ import { ApiContext } from "./ApiBootstrap.js";
4
+ import { jsx as _jsx } from "react/jsx-runtime";
5
+ /**
6
+ * Does not render children until the deferred API is resolved.
7
+ */
8
+ var DeferredApiBootstrap = /*#__PURE__*/React.memo(_ref => {
9
+ var {
10
+ children,
11
+ onError,
12
+ options
13
+ } = _ref;
14
+ var [api, apiError] = useDeferredApi(options);
15
+ if (apiError != null) {
16
+ onError === null || onError === void 0 ? void 0 : onError(apiError);
17
+ return null;
18
+ }
19
+ if (api == null) {
20
+ // Still waiting for the API to load
21
+ return null;
22
+ }
23
+ return /*#__PURE__*/_jsx(ApiContext.Provider, {
24
+ value: api,
25
+ children: children
26
+ });
27
+ });
28
+ DeferredApiBootstrap.displayName = 'DeferredApiBootstrap';
29
+ export default DeferredApiBootstrap;
30
+ //# sourceMappingURL=DeferredApiBootstrap.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DeferredApiBootstrap.js","names":["React","useDeferredApi","ApiContext","jsx","_jsx","DeferredApiBootstrap","memo","_ref","children","onError","options","api","apiError","Provider","value","displayName"],"sources":["../src/DeferredApiBootstrap.tsx"],"sourcesContent":["import React from 'react';\nimport useDeferredApi from './useDeferredApi';\nimport { ApiContext } from './ApiBootstrap';\n\ntype DeferredApiBootstrapProps = React.PropsWithChildren<{\n onError?: (error: unknown) => void;\n /**\n * Options to use when fetching the deferred API.\n */\n options?: Record<string, unknown>;\n}>;\n\n/**\n * Does not render children until the deferred API is resolved.\n */\nconst DeferredApiBootstrap = React.memo(\n ({\n children,\n onError,\n options,\n }: DeferredApiBootstrapProps): JSX.Element | null => {\n const [api, apiError] = useDeferredApi(options);\n if (apiError != null) {\n onError?.(apiError);\n return null;\n }\n if (api == null) {\n // Still waiting for the API to load\n return null;\n }\n return <ApiContext.Provider value={api}>{children}</ApiContext.Provider>;\n }\n);\n\nDeferredApiBootstrap.displayName = 'DeferredApiBootstrap';\n\nexport default DeferredApiBootstrap;\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AAAC,OACnBC,cAAc;AAAA,SACZC,UAAU;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAUnB;AACA;AACA;AACA,IAAMC,oBAAoB,gBAAGL,KAAK,CAACM,IAAI,CACrCC,IAAA,IAIqD;EAAA,IAJpD;IACCC,QAAQ;IACRC,OAAO;IACPC;EACyB,CAAC,GAAAH,IAAA;EAC1B,IAAM,CAACI,GAAG,EAAEC,QAAQ,CAAC,GAAGX,cAAc,CAACS,OAAO,CAAC;EAC/C,IAAIE,QAAQ,IAAI,IAAI,EAAE;IACpBH,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAGG,QAAQ,CAAC;IACnB,OAAO,IAAI;EACb;EACA,IAAID,GAAG,IAAI,IAAI,EAAE;IACf;IACA,OAAO,IAAI;EACb;EACA,oBAAOP,IAAA,CAACF,UAAU,CAACW,QAAQ;IAACC,KAAK,EAAEH,GAAI;IAAAH,QAAA,EAAEA;EAAQ,CAAsB,CAAC;AAC1E,CACF,CAAC;AAEDH,oBAAoB,CAACU,WAAW,GAAG,sBAAsB;AAEzD,eAAeV,oBAAoB"}
package/dist/index.d.ts CHANGED
@@ -1,5 +1,7 @@
1
1
  export * from './ApiBootstrap';
2
2
  export * from './ClientBootstrap';
3
+ export * from './DeferredApiBootstrap';
3
4
  export * from './useApi';
4
5
  export * from './useClient';
6
+ export * from './useDeferredApi';
5
7
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,mBAAmB,CAAC;AAClC,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,mBAAmB,CAAC;AAClC,cAAc,wBAAwB,CAAC;AACvC,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,kBAAkB,CAAC"}
package/dist/index.js CHANGED
@@ -1,5 +1,7 @@
1
1
  export * from "./ApiBootstrap.js";
2
2
  export * from "./ClientBootstrap.js";
3
+ export * from "./DeferredApiBootstrap.js";
3
4
  export * from "./useApi.js";
4
5
  export * from "./useClient.js";
6
+ export * from "./useDeferredApi.js";
5
7
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../src/index.ts"],"sourcesContent":["export * from './ApiBootstrap';\nexport * from './ClientBootstrap';\nexport * from './useApi';\nexport * from './useClient';\n"],"mappings":""}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../src/index.ts"],"sourcesContent":["export * from './ApiBootstrap';\nexport * from './ClientBootstrap';\nexport * from './DeferredApiBootstrap';\nexport * from './useApi';\nexport * from './useClient';\nexport * from './useDeferredApi';\n"],"mappings":""}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@deephaven/jsapi-bootstrap",
3
- "version": "0.59.1-beta.4+65478140",
3
+ "version": "0.59.1-deferred-api.7+e8f88b2d",
4
4
  "description": "Deephaven JSAPI Bootstrap",
5
5
  "author": "Deephaven Data Labs LLC",
6
6
  "license": "Apache-2.0",
@@ -22,10 +22,10 @@
22
22
  "build:sass": "sass --embed-sources --load-path=../../node_modules ./src:./dist"
23
23
  },
24
24
  "dependencies": {
25
- "@deephaven/components": "^0.59.1-beta.4+65478140",
26
- "@deephaven/jsapi-types": "^0.59.1-beta.4+65478140",
27
- "@deephaven/log": "^0.59.1-beta.4+65478140",
28
- "@deephaven/react-hooks": "^0.59.1-beta.4+65478140"
25
+ "@deephaven/components": "^0.59.1-deferred-api.7+e8f88b2d",
26
+ "@deephaven/jsapi-types": "^0.59.1-deferred-api.7+e8f88b2d",
27
+ "@deephaven/log": "^0.59.1-deferred-api.7+e8f88b2d",
28
+ "@deephaven/react-hooks": "^0.59.1-deferred-api.7+e8f88b2d"
29
29
  },
30
30
  "devDependencies": {
31
31
  "react": "^17.x"
@@ -40,5 +40,5 @@
40
40
  "publishConfig": {
41
41
  "access": "public"
42
42
  },
43
- "gitHead": "65478140934157c7c5bcf27ea89151255fb18a52"
43
+ "gitHead": "e8f88b2d5481e747aebdedf3c11563d1cca3a7e9"
44
44
  }