@deephaven/jsapi-bootstrap 0.59.1-beta.6 → 0.59.1-deferred-api.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/DeferredApiBootstrap.d.ts +14 -0
- package/dist/DeferredApiBootstrap.d.ts.map +1 -0
- package/dist/DeferredApiBootstrap.js +30 -0
- package/dist/DeferredApiBootstrap.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/package.json +6 -6
|
@@ -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
|
+
export 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,eAAO,MAAM,oBAAoB,8DAK5B,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
|
+
export 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 */\nexport const 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,OAAO,IAAMC,oBAAoB,gBAAGL,KAAK,CAACM,IAAI,CAC5CC,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
package/dist/index.d.ts.map
CHANGED
|
@@ -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
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-
|
|
3
|
+
"version": "0.59.1-deferred-api.8+aa680966",
|
|
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-
|
|
26
|
-
"@deephaven/jsapi-types": "^0.59.1-
|
|
27
|
-
"@deephaven/log": "^0.59.1-
|
|
28
|
-
"@deephaven/react-hooks": "^0.59.1-
|
|
25
|
+
"@deephaven/components": "^0.59.1-deferred-api.8+aa680966",
|
|
26
|
+
"@deephaven/jsapi-types": "^0.59.1-deferred-api.8+aa680966",
|
|
27
|
+
"@deephaven/log": "^0.59.1-deferred-api.8+aa680966",
|
|
28
|
+
"@deephaven/react-hooks": "^0.59.1-deferred-api.8+aa680966"
|
|
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": "
|
|
43
|
+
"gitHead": "aa680966a952d8459df75f241b6c4b354d4c9a58"
|
|
44
44
|
}
|