@myst-theme/jupyter 0.0.3 → 0.1.22
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/cjs/components.d.ts +0 -1
- package/dist/cjs/components.d.ts.map +1 -1
- package/dist/cjs/error.d.ts +0 -1
- package/dist/cjs/error.d.ts.map +1 -1
- package/dist/cjs/hooks.d.ts +0 -17
- package/dist/cjs/hooks.d.ts.map +1 -1
- package/dist/cjs/jupyter.d.ts +0 -1
- package/dist/cjs/jupyter.d.ts.map +1 -1
- package/dist/cjs/jupyter.js +25 -37
- package/dist/cjs/output.d.ts +0 -1
- package/dist/cjs/output.d.ts.map +1 -1
- package/dist/cjs/output.js +2 -1
- package/dist/cjs/safe.d.ts +0 -1
- package/dist/cjs/safe.d.ts.map +1 -1
- package/dist/cjs/stream.d.ts +0 -1
- package/dist/cjs/stream.d.ts.map +1 -1
- package/dist/cjs/thebe-provider.d.ts +7 -0
- package/dist/cjs/thebe-provider.d.ts.map +1 -0
- package/dist/cjs/thebe-provider.js +53 -0
- package/dist/esm/components.d.ts +0 -1
- package/dist/esm/components.d.ts.map +1 -1
- package/dist/esm/error.d.ts +0 -1
- package/dist/esm/error.d.ts.map +1 -1
- package/dist/esm/hooks.d.ts +0 -17
- package/dist/esm/hooks.d.ts.map +1 -1
- package/dist/esm/jupyter.d.ts +0 -1
- package/dist/esm/jupyter.d.ts.map +1 -1
- package/dist/esm/jupyter.js +26 -38
- package/dist/esm/output.d.ts +0 -1
- package/dist/esm/output.d.ts.map +1 -1
- package/dist/esm/output.js +2 -1
- package/dist/esm/safe.d.ts +0 -1
- package/dist/esm/safe.d.ts.map +1 -1
- package/dist/esm/stream.d.ts +0 -1
- package/dist/esm/stream.d.ts.map +1 -1
- package/dist/esm/thebe-provider.d.ts +7 -0
- package/dist/esm/thebe-provider.d.ts.map +1 -0
- package/dist/esm/thebe-provider.js +26 -0
- package/dist/types/components.d.ts +0 -1
- package/dist/types/components.d.ts.map +1 -1
- package/dist/types/error.d.ts +0 -1
- package/dist/types/error.d.ts.map +1 -1
- package/dist/types/hooks.d.ts +0 -17
- package/dist/types/hooks.d.ts.map +1 -1
- package/dist/types/jupyter.d.ts +0 -1
- package/dist/types/jupyter.d.ts.map +1 -1
- package/dist/types/output.d.ts +0 -1
- package/dist/types/output.d.ts.map +1 -1
- package/dist/types/safe.d.ts +0 -1
- package/dist/types/safe.d.ts.map +1 -1
- package/dist/types/stream.d.ts +0 -1
- package/dist/types/stream.d.ts.map +1 -1
- package/dist/types/thebe-provider.d.ts +7 -0
- package/dist/types/thebe-provider.d.ts.map +1 -0
- package/package.json +3 -3
- package/dist/cjs/selectors.d.ts +0 -10
- package/dist/cjs/selectors.d.ts.map +0 -1
- package/dist/cjs/selectors.js +0 -10
- package/dist/esm/selectors.d.ts +0 -10
- package/dist/esm/selectors.d.ts.map +0 -1
- package/dist/esm/selectors.js +0 -4
- package/dist/types/selectors.d.ts +0 -10
- package/dist/types/selectors.d.ts.map +0 -1
package/dist/cjs/components.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"components.d.ts","sourceRoot":"","sources":["../../src/components.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"components.d.ts","sourceRoot":"","sources":["../../src/components.tsx"],"names":[],"mappings":"AAGA,eAAO,MAAM,gBAAgB;;;sBAOT,MAAM,KAAK,WAAW;iBAUzC,CAAC;AAEF,eAAO,MAAM,aAAa;aAAqC,MAAM;iBAWpE,CAAC"}
|
package/dist/cjs/error.d.ts
CHANGED
package/dist/cjs/error.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"error.d.ts","sourceRoot":"","sources":["../../src/error.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"error.d.ts","sourceRoot":"","sources":["../../src/error.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,MAAM,CAAC;AAGhD,MAAM,CAAC,OAAO,UAAU,KAAK,CAAC,EAAE,MAAM,EAAE,EAAE;IAAE,MAAM,EAAE,mBAAmB,CAAA;CAAE,eAcxE"}
|
package/dist/cjs/hooks.d.ts
CHANGED
|
@@ -1,21 +1,4 @@
|
|
|
1
1
|
import type { MinifiedOutput } from 'nbtx';
|
|
2
|
-
/**
|
|
3
|
-
* Truncation vs Summarization
|
|
4
|
-
*
|
|
5
|
-
* In Curvespace, we're decided to change our data structure for outputs to align it as
|
|
6
|
-
* closely as possible with Jupyters nbformat.IOutput[] type, but in a way that still allows
|
|
7
|
-
* us to truncate output content and push that to storage.
|
|
8
|
-
*
|
|
9
|
-
* This will be used only in the CLI and Curvespace initially but should be ported back to
|
|
10
|
-
* the rest of the code base. This will mean
|
|
11
|
-
*
|
|
12
|
-
* - changing the DB schema
|
|
13
|
-
* - migration
|
|
14
|
-
* - changing API response
|
|
15
|
-
* - changing the frontend
|
|
16
|
-
* - changing the extension
|
|
17
|
-
*
|
|
18
|
-
*/
|
|
19
2
|
interface LongContent {
|
|
20
3
|
content_type?: string;
|
|
21
4
|
content: string;
|
package/dist/cjs/hooks.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["../../src/hooks.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAIV,cAAc,EAEf,MAAM,MAAM,CAAC;AAId
|
|
1
|
+
{"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["../../src/hooks.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAIV,cAAc,EAEf,MAAM,MAAM,CAAC;AAId,UAAU,WAAW;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,OAAO,EAAE,MAAM,CAAC;CACjB;AA0BD,wBAAgB,cAAc,CAC5B,OAAO,CAAC,EAAE,MAAM,EAChB,GAAG,CAAC,EAAE,MAAM,GACX;IAAE,IAAI,CAAC,EAAE,WAAW,CAAC;IAAC,KAAK,CAAC,EAAE,KAAK,CAAA;CAAE,CAQvC;AAuBD,wBAAgB,2BAA2B,CAAC,OAAO,EAAE,cAAc,EAAE,GAAG;IACtE,IAAI,EAAE,cAAc,EAAE,GAAG,SAAS,CAAC;IACnC,KAAK,EAAE,GAAG,GAAG,SAAS,CAAC;CACxB,CAqCA;AAUD,MAAM,CAAC,OAAO,UAAU,aAAa;;;EAapC"}
|
package/dist/cjs/jupyter.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"jupyter.d.ts","sourceRoot":"","sources":["../../src/jupyter.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"jupyter.d.ts","sourceRoot":"","sources":["../../src/jupyter.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,MAAM,CAAC;AAqB3C,eAAO,MAAM,oBAAoB;QAI3B,MAAM;aACD,cAAc,EAAE;iBA0B1B,CAAC"}
|
package/dist/cjs/jupyter.js
CHANGED
|
@@ -25,54 +25,42 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
26
|
exports.NativeJupyterOutputs = void 0;
|
|
27
27
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
28
|
-
const react_1 = require("react");
|
|
29
|
-
const hooks_1 =
|
|
30
|
-
const nanoid_1 = require("nanoid");
|
|
31
|
-
const react_redux_1 = require("react-redux");
|
|
32
|
-
const connect_1 = require("@curvenote/connect");
|
|
28
|
+
const react_1 = __importStar(require("react"));
|
|
29
|
+
const hooks_1 = require("./hooks");
|
|
33
30
|
const nbtx_1 = require("nbtx");
|
|
34
|
-
const outline_1 = require("@heroicons/react/24/outline");
|
|
35
31
|
const convertImages_1 = require("./convertImages");
|
|
36
|
-
const
|
|
37
|
-
|
|
32
|
+
const thebe_provider_1 = require("./thebe-provider");
|
|
33
|
+
function OutputRenderer({ id, data, core }) {
|
|
34
|
+
const [cell] = (0, react_1.useState)(new core.PassiveCellRenderer(id));
|
|
35
|
+
const ref = (0, react_1.useRef)(null);
|
|
36
|
+
(0, react_1.useEffect)(() => {
|
|
37
|
+
cell.render(data);
|
|
38
|
+
}, [data, cell]);
|
|
39
|
+
(0, react_1.useEffect)(() => {
|
|
40
|
+
if (!ref.current)
|
|
41
|
+
return;
|
|
42
|
+
cell.attachToDOM(ref.current);
|
|
43
|
+
}, [ref]);
|
|
44
|
+
return (0, jsx_runtime_1.jsx)("div", { ref: ref });
|
|
45
|
+
}
|
|
46
|
+
const MemoOutputRenderer = react_1.default.memo(OutputRenderer);
|
|
38
47
|
const NativeJupyterOutputs = ({ id, outputs, }) => {
|
|
39
|
-
|
|
40
|
-
const windowSize = (0, hooks_1.default)();
|
|
48
|
+
const { core } = (0, thebe_provider_1.useThebeCore)();
|
|
41
49
|
const { data, error } = (0, hooks_1.useFetchAnyTruncatedContent)(outputs);
|
|
42
|
-
const [
|
|
43
|
-
const [
|
|
44
|
-
const [clamped, setClamped] = (0, react_1.useState)(false);
|
|
45
|
-
const uid = (0, react_1.useMemo)(nanoid_1.nanoid, []);
|
|
46
|
-
const { height } = (_a = (0, react_redux_1.useSelector)((state) => (0, selectors_1.selectIFrameHeight)(state, uid))) !== null && _a !== void 0 ? _a : {};
|
|
47
|
-
const rendererReady = (0, react_redux_1.useSelector)((state) => (0, selectors_1.selectIFrameReady)(state, uid));
|
|
48
|
-
const iframeRef = (0, react_1.useRef)(null);
|
|
50
|
+
const [loaded, setLoaded] = (0, react_1.useState)(false);
|
|
51
|
+
const [fullOutputs, setFullOutputs] = (0, react_1.useState)(null);
|
|
49
52
|
(0, react_1.useEffect)(() => {
|
|
50
|
-
if (
|
|
53
|
+
if (!data || loaded)
|
|
51
54
|
return;
|
|
55
|
+
setLoaded(true);
|
|
52
56
|
(0, convertImages_1.fetchAndEncodeOutputImages)(data).then((out) => {
|
|
53
57
|
const compactOutputs = (0, nbtx_1.convertToIOutputs)(out, {});
|
|
54
|
-
|
|
58
|
+
setFullOutputs(compactOutputs);
|
|
55
59
|
});
|
|
56
|
-
}, [id,
|
|
57
|
-
(0, react_1.useEffect)(() => {
|
|
58
|
-
if (height == null)
|
|
59
|
-
return;
|
|
60
|
-
if (height > PERCENT_OF_WINDOW * windowSize.height) {
|
|
61
|
-
setFrameHeight(PERCENT_OF_WINDOW * windowSize.height);
|
|
62
|
-
setClamped(true);
|
|
63
|
-
}
|
|
64
|
-
else {
|
|
65
|
-
setFrameHeight(height + 25);
|
|
66
|
-
setClamped(false);
|
|
67
|
-
}
|
|
68
|
-
setLoading(false);
|
|
69
|
-
}, [height]);
|
|
60
|
+
}, [id, data]);
|
|
70
61
|
if (error) {
|
|
71
62
|
return (0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "text-red-500" }, { children: ["Error rendering output: ", error.message] }));
|
|
72
63
|
}
|
|
73
|
-
return ((0, jsx_runtime_1.jsxs)("div", { children: [
|
|
74
|
-
setFrameHeight(height !== null && height !== void 0 ? height : 0);
|
|
75
|
-
setClamped(false);
|
|
76
|
-
} }, { children: (0, jsx_runtime_1.jsx)(outline_1.ChevronDoubleDownIcon, { className: "w-5 h-5 inline" }) })))] }));
|
|
64
|
+
return ((0, jsx_runtime_1.jsxs)("div", { children: [!fullOutputs && (0, jsx_runtime_1.jsx)("div", Object.assign({ className: "p-2.5" }, { children: "Loading..." })), fullOutputs && core && (0, jsx_runtime_1.jsx)(MemoOutputRenderer, { id: id, core: core, data: fullOutputs })] }));
|
|
77
65
|
};
|
|
78
66
|
exports.NativeJupyterOutputs = NativeJupyterOutputs;
|
package/dist/cjs/output.d.ts
CHANGED
package/dist/cjs/output.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"output.d.ts","sourceRoot":"","sources":["../../src/output.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"output.d.ts","sourceRoot":"","sources":["../../src/output.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE/C,OAAO,KAAK,EAAsB,cAAc,EAAE,MAAM,MAAM,CAAC;AAiB/D,wBAAgB,iBAAiB,CAC/B,OAAO,EAAE,cAAc,EAAE,EACzB,iBAAiB,EAAE,GAAG,CAAC,MAAM,CAAC,EAC9B,eAAe,EAAE,GAAG,CAAC,MAAM,CAAC,WAY7B;AAED,wBAAgB,MAAM,CAAC,IAAI,EAAE,WAAW,eA+BvC"}
|
package/dist/cjs/output.js
CHANGED
|
@@ -10,6 +10,7 @@ const classnames_1 = __importDefault(require("classnames"));
|
|
|
10
10
|
const safe_1 = require("./safe");
|
|
11
11
|
const jupyter_1 = require("./jupyter");
|
|
12
12
|
const ClientOnly_1 = __importDefault(require("./ClientOnly"));
|
|
13
|
+
const thebe_provider_1 = require("./thebe-provider");
|
|
13
14
|
const DIRECT_OUTPUT_TYPES = new Set(['stream', 'error']);
|
|
14
15
|
const DIRECT_MIME_TYPES = new Set([
|
|
15
16
|
nbtx_1.KnownCellOutputMimeTypes.TextPlain,
|
|
@@ -40,7 +41,7 @@ function Output(node) {
|
|
|
40
41
|
}
|
|
41
42
|
else {
|
|
42
43
|
// Hide the iframe if rendering on the server
|
|
43
|
-
component = ((0, jsx_runtime_1.jsx)(ClientOnly_1.default, { children: (0, jsx_runtime_1.jsx)(jupyter_1.NativeJupyterOutputs, { id: node.key, outputs: outputs }) }));
|
|
44
|
+
component = ((0, jsx_runtime_1.jsx)(ClientOnly_1.default, { children: (0, jsx_runtime_1.jsx)(thebe_provider_1.ThebeCoreProvider, { children: (0, jsx_runtime_1.jsx)(jupyter_1.NativeJupyterOutputs, { id: node.key, outputs: outputs }) }) }));
|
|
44
45
|
}
|
|
45
46
|
return ((0, jsx_runtime_1.jsx)("figure", Object.assign({ id: node.identifier || undefined, className: (0, classnames_1.default)('max-w-full overflow-auto m-0 group not-prose relative', {
|
|
46
47
|
'text-left': !node.align || node.align === 'left',
|
package/dist/cjs/safe.d.ts
CHANGED
package/dist/cjs/safe.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"safe.d.ts","sourceRoot":"","sources":["../../src/safe.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"safe.d.ts","sourceRoot":"","sources":["../../src/safe.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAA2C,cAAc,EAAE,MAAM,MAAM,CAAC;AAwEpF,wBAAgB,WAAW,CAAC,EAAE,OAAO,EAAE,OAAO,EAAE,EAAE;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,cAAc,EAAE,CAAA;CAAE,eAM/F"}
|
package/dist/cjs/stream.d.ts
CHANGED
package/dist/cjs/stream.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stream.d.ts","sourceRoot":"","sources":["../../src/stream.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"stream.d.ts","sourceRoot":"","sources":["../../src/stream.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,MAAM,CAAC;AAGjD,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,EAAE,MAAM,EAAE,EAAE;IAAE,MAAM,EAAE,oBAAoB,CAAA;CAAE,eAY1E"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export type ThebeCore = typeof import('thebe-core');
|
|
3
|
+
export declare function ThebeCoreProvider({ children }: React.PropsWithChildren): JSX.Element;
|
|
4
|
+
export declare function useThebeCore(): {
|
|
5
|
+
core?: typeof import("thebe-core") | undefined;
|
|
6
|
+
};
|
|
7
|
+
//# sourceMappingURL=thebe-provider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"thebe-provider.d.ts","sourceRoot":"","sources":["../../src/thebe-provider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8B,MAAM,OAAO,CAAC;AAGnD,MAAM,MAAM,SAAS,GAAG,cAAc,YAAY,CAAC,CAAC;AAKpD,wBAAgB,iBAAiB,CAAC,EAAE,QAAQ,EAAE,EAAE,KAAK,CAAC,iBAAiB,eAoBtE;AAED,wBAAgB,YAAY;;EAM3B"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.useThebeCore = exports.ThebeCoreProvider = void 0;
|
|
27
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
28
|
+
const react_1 = __importStar(require("react"));
|
|
29
|
+
// Don't know how to get rid of the undefined here in the case of an async provider
|
|
30
|
+
const ThebeCoreContext = react_1.default.createContext(undefined);
|
|
31
|
+
function ThebeCoreProvider({ children }) {
|
|
32
|
+
const [core, setCore] = (0, react_1.useState)();
|
|
33
|
+
(0, react_1.useEffect)(() => {
|
|
34
|
+
console.debug('importing thebe-core...');
|
|
35
|
+
Promise.resolve().then(() => __importStar(require('thebe-core'))).then((thebeCore) => {
|
|
36
|
+
console.debug('thebe-core loaded');
|
|
37
|
+
setCore(thebeCore);
|
|
38
|
+
})
|
|
39
|
+
.catch(({ reason }) => {
|
|
40
|
+
console.error(`thebe-core load failed ${reason}`);
|
|
41
|
+
});
|
|
42
|
+
}, []);
|
|
43
|
+
return ((0, jsx_runtime_1.jsx)(ThebeCoreContext.Provider, Object.assign({ value: { core } }, { children: (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: children }) })));
|
|
44
|
+
}
|
|
45
|
+
exports.ThebeCoreProvider = ThebeCoreProvider;
|
|
46
|
+
function useThebeCore() {
|
|
47
|
+
const context = react_1.default.useContext(ThebeCoreContext);
|
|
48
|
+
if (context === undefined) {
|
|
49
|
+
throw new Error('useThebeCore must be used inside a ThebeCoreProvider');
|
|
50
|
+
}
|
|
51
|
+
return context;
|
|
52
|
+
}
|
|
53
|
+
exports.useThebeCore = useThebeCore;
|
package/dist/esm/components.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"components.d.ts","sourceRoot":"","sources":["../../src/components.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"components.d.ts","sourceRoot":"","sources":["../../src/components.tsx"],"names":[],"mappings":"AAGA,eAAO,MAAM,gBAAgB;;;sBAOT,MAAM,KAAK,WAAW;iBAUzC,CAAC;AAEF,eAAO,MAAM,aAAa;aAAqC,MAAM;iBAWpE,CAAC"}
|
package/dist/esm/error.d.ts
CHANGED
package/dist/esm/error.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"error.d.ts","sourceRoot":"","sources":["../../src/error.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"error.d.ts","sourceRoot":"","sources":["../../src/error.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,MAAM,CAAC;AAGhD,MAAM,CAAC,OAAO,UAAU,KAAK,CAAC,EAAE,MAAM,EAAE,EAAE;IAAE,MAAM,EAAE,mBAAmB,CAAA;CAAE,eAcxE"}
|
package/dist/esm/hooks.d.ts
CHANGED
|
@@ -1,21 +1,4 @@
|
|
|
1
1
|
import type { MinifiedOutput } from 'nbtx';
|
|
2
|
-
/**
|
|
3
|
-
* Truncation vs Summarization
|
|
4
|
-
*
|
|
5
|
-
* In Curvespace, we're decided to change our data structure for outputs to align it as
|
|
6
|
-
* closely as possible with Jupyters nbformat.IOutput[] type, but in a way that still allows
|
|
7
|
-
* us to truncate output content and push that to storage.
|
|
8
|
-
*
|
|
9
|
-
* This will be used only in the CLI and Curvespace initially but should be ported back to
|
|
10
|
-
* the rest of the code base. This will mean
|
|
11
|
-
*
|
|
12
|
-
* - changing the DB schema
|
|
13
|
-
* - migration
|
|
14
|
-
* - changing API response
|
|
15
|
-
* - changing the frontend
|
|
16
|
-
* - changing the extension
|
|
17
|
-
*
|
|
18
|
-
*/
|
|
19
2
|
interface LongContent {
|
|
20
3
|
content_type?: string;
|
|
21
4
|
content: string;
|
package/dist/esm/hooks.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["../../src/hooks.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAIV,cAAc,EAEf,MAAM,MAAM,CAAC;AAId
|
|
1
|
+
{"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["../../src/hooks.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAIV,cAAc,EAEf,MAAM,MAAM,CAAC;AAId,UAAU,WAAW;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,OAAO,EAAE,MAAM,CAAC;CACjB;AA0BD,wBAAgB,cAAc,CAC5B,OAAO,CAAC,EAAE,MAAM,EAChB,GAAG,CAAC,EAAE,MAAM,GACX;IAAE,IAAI,CAAC,EAAE,WAAW,CAAC;IAAC,KAAK,CAAC,EAAE,KAAK,CAAA;CAAE,CAQvC;AAuBD,wBAAgB,2BAA2B,CAAC,OAAO,EAAE,cAAc,EAAE,GAAG;IACtE,IAAI,EAAE,cAAc,EAAE,GAAG,SAAS,CAAC;IACnC,KAAK,EAAE,GAAG,GAAG,SAAS,CAAC;CACxB,CAqCA;AAUD,MAAM,CAAC,OAAO,UAAU,aAAa;;;EAapC"}
|
package/dist/esm/jupyter.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"jupyter.d.ts","sourceRoot":"","sources":["../../src/jupyter.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"jupyter.d.ts","sourceRoot":"","sources":["../../src/jupyter.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,MAAM,CAAC;AAqB3C,eAAO,MAAM,oBAAoB;QAI3B,MAAM;aACD,cAAc,EAAE;iBA0B1B,CAAC"}
|
package/dist/esm/jupyter.js
CHANGED
|
@@ -1,51 +1,39 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { useEffect,
|
|
3
|
-
import
|
|
4
|
-
import { nanoid } from 'nanoid';
|
|
5
|
-
import { useSelector } from 'react-redux';
|
|
6
|
-
import { host, actions } from '@curvenote/connect';
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import React, { useEffect, useRef, useState } from 'react';
|
|
3
|
+
import { useFetchAnyTruncatedContent } from './hooks';
|
|
7
4
|
import { convertToIOutputs } from 'nbtx';
|
|
8
|
-
import { ChevronDoubleDownIcon } from '@heroicons/react/24/outline';
|
|
9
5
|
import { fetchAndEncodeOutputImages } from './convertImages';
|
|
10
|
-
import {
|
|
11
|
-
|
|
6
|
+
import { useThebeCore } from './thebe-provider';
|
|
7
|
+
function OutputRenderer({ id, data, core }) {
|
|
8
|
+
const [cell] = useState(new core.PassiveCellRenderer(id));
|
|
9
|
+
const ref = useRef(null);
|
|
10
|
+
useEffect(() => {
|
|
11
|
+
cell.render(data);
|
|
12
|
+
}, [data, cell]);
|
|
13
|
+
useEffect(() => {
|
|
14
|
+
if (!ref.current)
|
|
15
|
+
return;
|
|
16
|
+
cell.attachToDOM(ref.current);
|
|
17
|
+
}, [ref]);
|
|
18
|
+
return _jsx("div", { ref: ref });
|
|
19
|
+
}
|
|
20
|
+
const MemoOutputRenderer = React.memo(OutputRenderer);
|
|
12
21
|
export const NativeJupyterOutputs = ({ id, outputs, }) => {
|
|
13
|
-
|
|
14
|
-
const windowSize = useWindowSize();
|
|
22
|
+
const { core } = useThebeCore();
|
|
15
23
|
const { data, error } = useFetchAnyTruncatedContent(outputs);
|
|
16
|
-
const [
|
|
17
|
-
const [
|
|
18
|
-
const [clamped, setClamped] = useState(false);
|
|
19
|
-
const uid = useMemo(nanoid, []);
|
|
20
|
-
const { height } = (_a = useSelector((state) => selectIFrameHeight(state, uid))) !== null && _a !== void 0 ? _a : {};
|
|
21
|
-
const rendererReady = useSelector((state) => selectIFrameReady(state, uid));
|
|
22
|
-
const iframeRef = useRef(null);
|
|
24
|
+
const [loaded, setLoaded] = useState(false);
|
|
25
|
+
const [fullOutputs, setFullOutputs] = useState(null);
|
|
23
26
|
useEffect(() => {
|
|
24
|
-
if (
|
|
27
|
+
if (!data || loaded)
|
|
25
28
|
return;
|
|
29
|
+
setLoaded(true);
|
|
26
30
|
fetchAndEncodeOutputImages(data).then((out) => {
|
|
27
31
|
const compactOutputs = convertToIOutputs(out, {});
|
|
28
|
-
|
|
32
|
+
setFullOutputs(compactOutputs);
|
|
29
33
|
});
|
|
30
|
-
}, [id,
|
|
31
|
-
useEffect(() => {
|
|
32
|
-
if (height == null)
|
|
33
|
-
return;
|
|
34
|
-
if (height > PERCENT_OF_WINDOW * windowSize.height) {
|
|
35
|
-
setFrameHeight(PERCENT_OF_WINDOW * windowSize.height);
|
|
36
|
-
setClamped(true);
|
|
37
|
-
}
|
|
38
|
-
else {
|
|
39
|
-
setFrameHeight(height + 25);
|
|
40
|
-
setClamped(false);
|
|
41
|
-
}
|
|
42
|
-
setLoading(false);
|
|
43
|
-
}, [height]);
|
|
34
|
+
}, [id, data]);
|
|
44
35
|
if (error) {
|
|
45
36
|
return _jsxs("div", Object.assign({ className: "text-red-500" }, { children: ["Error rendering output: ", error.message] }));
|
|
46
37
|
}
|
|
47
|
-
return (_jsxs("div", { children: [
|
|
48
|
-
setFrameHeight(height !== null && height !== void 0 ? height : 0);
|
|
49
|
-
setClamped(false);
|
|
50
|
-
} }, { children: _jsx(ChevronDoubleDownIcon, { className: "w-5 h-5 inline" }) })))] }));
|
|
38
|
+
return (_jsxs("div", { children: [!fullOutputs && _jsx("div", Object.assign({ className: "p-2.5" }, { children: "Loading..." })), fullOutputs && core && _jsx(MemoOutputRenderer, { id: id, core: core, data: fullOutputs })] }));
|
|
51
39
|
};
|
package/dist/esm/output.d.ts
CHANGED
package/dist/esm/output.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"output.d.ts","sourceRoot":"","sources":["../../src/output.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"output.d.ts","sourceRoot":"","sources":["../../src/output.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE/C,OAAO,KAAK,EAAsB,cAAc,EAAE,MAAM,MAAM,CAAC;AAiB/D,wBAAgB,iBAAiB,CAC/B,OAAO,EAAE,cAAc,EAAE,EACzB,iBAAiB,EAAE,GAAG,CAAC,MAAM,CAAC,EAC9B,eAAe,EAAE,GAAG,CAAC,MAAM,CAAC,WAY7B;AAED,wBAAgB,MAAM,CAAC,IAAI,EAAE,WAAW,eA+BvC"}
|
package/dist/esm/output.js
CHANGED
|
@@ -4,6 +4,7 @@ import classNames from 'classnames';
|
|
|
4
4
|
import { SafeOutputs } from './safe';
|
|
5
5
|
import { NativeJupyterOutputs as JupyterOutputs } from './jupyter';
|
|
6
6
|
import ClientOnly from './ClientOnly';
|
|
7
|
+
import { ThebeCoreProvider } from './thebe-provider';
|
|
7
8
|
const DIRECT_OUTPUT_TYPES = new Set(['stream', 'error']);
|
|
8
9
|
const DIRECT_MIME_TYPES = new Set([
|
|
9
10
|
KnownCellOutputMimeTypes.TextPlain,
|
|
@@ -33,7 +34,7 @@ export function Output(node) {
|
|
|
33
34
|
}
|
|
34
35
|
else {
|
|
35
36
|
// Hide the iframe if rendering on the server
|
|
36
|
-
component = (_jsx(ClientOnly, { children: _jsx(JupyterOutputs, { id: node.key, outputs: outputs }) }));
|
|
37
|
+
component = (_jsx(ClientOnly, { children: _jsx(ThebeCoreProvider, { children: _jsx(JupyterOutputs, { id: node.key, outputs: outputs }) }) }));
|
|
37
38
|
}
|
|
38
39
|
return (_jsx("figure", Object.assign({ id: node.identifier || undefined, className: classNames('max-w-full overflow-auto m-0 group not-prose relative', {
|
|
39
40
|
'text-left': !node.align || node.align === 'left',
|
package/dist/esm/safe.d.ts
CHANGED
package/dist/esm/safe.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"safe.d.ts","sourceRoot":"","sources":["../../src/safe.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"safe.d.ts","sourceRoot":"","sources":["../../src/safe.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAA2C,cAAc,EAAE,MAAM,MAAM,CAAC;AAwEpF,wBAAgB,WAAW,CAAC,EAAE,OAAO,EAAE,OAAO,EAAE,EAAE;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,cAAc,EAAE,CAAA;CAAE,eAM/F"}
|
package/dist/esm/stream.d.ts
CHANGED
package/dist/esm/stream.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stream.d.ts","sourceRoot":"","sources":["../../src/stream.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"stream.d.ts","sourceRoot":"","sources":["../../src/stream.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,MAAM,CAAC;AAGjD,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,EAAE,MAAM,EAAE,EAAE;IAAE,MAAM,EAAE,oBAAoB,CAAA;CAAE,eAY1E"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export type ThebeCore = typeof import('thebe-core');
|
|
3
|
+
export declare function ThebeCoreProvider({ children }: React.PropsWithChildren): JSX.Element;
|
|
4
|
+
export declare function useThebeCore(): {
|
|
5
|
+
core?: typeof import("thebe-core") | undefined;
|
|
6
|
+
};
|
|
7
|
+
//# sourceMappingURL=thebe-provider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"thebe-provider.d.ts","sourceRoot":"","sources":["../../src/thebe-provider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8B,MAAM,OAAO,CAAC;AAGnD,MAAM,MAAM,SAAS,GAAG,cAAc,YAAY,CAAC,CAAC;AAKpD,wBAAgB,iBAAiB,CAAC,EAAE,QAAQ,EAAE,EAAE,KAAK,CAAC,iBAAiB,eAoBtE;AAED,wBAAgB,YAAY;;EAM3B"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import React, { useEffect, useState } from 'react';
|
|
3
|
+
// Don't know how to get rid of the undefined here in the case of an async provider
|
|
4
|
+
const ThebeCoreContext = React.createContext(undefined);
|
|
5
|
+
export function ThebeCoreProvider({ children }) {
|
|
6
|
+
const [core, setCore] = useState();
|
|
7
|
+
useEffect(() => {
|
|
8
|
+
console.debug('importing thebe-core...');
|
|
9
|
+
import('thebe-core')
|
|
10
|
+
.then((thebeCore) => {
|
|
11
|
+
console.debug('thebe-core loaded');
|
|
12
|
+
setCore(thebeCore);
|
|
13
|
+
})
|
|
14
|
+
.catch(({ reason }) => {
|
|
15
|
+
console.error(`thebe-core load failed ${reason}`);
|
|
16
|
+
});
|
|
17
|
+
}, []);
|
|
18
|
+
return (_jsx(ThebeCoreContext.Provider, Object.assign({ value: { core } }, { children: _jsx(_Fragment, { children: children }) })));
|
|
19
|
+
}
|
|
20
|
+
export function useThebeCore() {
|
|
21
|
+
const context = React.useContext(ThebeCoreContext);
|
|
22
|
+
if (context === undefined) {
|
|
23
|
+
throw new Error('useThebeCore must be used inside a ThebeCoreProvider');
|
|
24
|
+
}
|
|
25
|
+
return context;
|
|
26
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"components.d.ts","sourceRoot":"","sources":["../../src/components.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"components.d.ts","sourceRoot":"","sources":["../../src/components.tsx"],"names":[],"mappings":"AAGA,eAAO,MAAM,gBAAgB;;;sBAOT,MAAM,KAAK,WAAW;iBAUzC,CAAC;AAEF,eAAO,MAAM,aAAa;aAAqC,MAAM;iBAWpE,CAAC"}
|
package/dist/types/error.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"error.d.ts","sourceRoot":"","sources":["../../src/error.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"error.d.ts","sourceRoot":"","sources":["../../src/error.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,MAAM,CAAC;AAGhD,MAAM,CAAC,OAAO,UAAU,KAAK,CAAC,EAAE,MAAM,EAAE,EAAE;IAAE,MAAM,EAAE,mBAAmB,CAAA;CAAE,eAcxE"}
|
package/dist/types/hooks.d.ts
CHANGED
|
@@ -1,21 +1,4 @@
|
|
|
1
1
|
import type { MinifiedOutput } from 'nbtx';
|
|
2
|
-
/**
|
|
3
|
-
* Truncation vs Summarization
|
|
4
|
-
*
|
|
5
|
-
* In Curvespace, we're decided to change our data structure for outputs to align it as
|
|
6
|
-
* closely as possible with Jupyters nbformat.IOutput[] type, but in a way that still allows
|
|
7
|
-
* us to truncate output content and push that to storage.
|
|
8
|
-
*
|
|
9
|
-
* This will be used only in the CLI and Curvespace initially but should be ported back to
|
|
10
|
-
* the rest of the code base. This will mean
|
|
11
|
-
*
|
|
12
|
-
* - changing the DB schema
|
|
13
|
-
* - migration
|
|
14
|
-
* - changing API response
|
|
15
|
-
* - changing the frontend
|
|
16
|
-
* - changing the extension
|
|
17
|
-
*
|
|
18
|
-
*/
|
|
19
2
|
interface LongContent {
|
|
20
3
|
content_type?: string;
|
|
21
4
|
content: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["../../src/hooks.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAIV,cAAc,EAEf,MAAM,MAAM,CAAC;AAId
|
|
1
|
+
{"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["../../src/hooks.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAIV,cAAc,EAEf,MAAM,MAAM,CAAC;AAId,UAAU,WAAW;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,OAAO,EAAE,MAAM,CAAC;CACjB;AA0BD,wBAAgB,cAAc,CAC5B,OAAO,CAAC,EAAE,MAAM,EAChB,GAAG,CAAC,EAAE,MAAM,GACX;IAAE,IAAI,CAAC,EAAE,WAAW,CAAC;IAAC,KAAK,CAAC,EAAE,KAAK,CAAA;CAAE,CAQvC;AAuBD,wBAAgB,2BAA2B,CAAC,OAAO,EAAE,cAAc,EAAE,GAAG;IACtE,IAAI,EAAE,cAAc,EAAE,GAAG,SAAS,CAAC;IACnC,KAAK,EAAE,GAAG,GAAG,SAAS,CAAC;CACxB,CAqCA;AAUD,MAAM,CAAC,OAAO,UAAU,aAAa;;;EAapC"}
|
package/dist/types/jupyter.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"jupyter.d.ts","sourceRoot":"","sources":["../../src/jupyter.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"jupyter.d.ts","sourceRoot":"","sources":["../../src/jupyter.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,MAAM,CAAC;AAqB3C,eAAO,MAAM,oBAAoB;QAI3B,MAAM;aACD,cAAc,EAAE;iBA0B1B,CAAC"}
|
package/dist/types/output.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"output.d.ts","sourceRoot":"","sources":["../../src/output.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"output.d.ts","sourceRoot":"","sources":["../../src/output.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE/C,OAAO,KAAK,EAAsB,cAAc,EAAE,MAAM,MAAM,CAAC;AAiB/D,wBAAgB,iBAAiB,CAC/B,OAAO,EAAE,cAAc,EAAE,EACzB,iBAAiB,EAAE,GAAG,CAAC,MAAM,CAAC,EAC9B,eAAe,EAAE,GAAG,CAAC,MAAM,CAAC,WAY7B;AAED,wBAAgB,MAAM,CAAC,IAAI,EAAE,WAAW,eA+BvC"}
|
package/dist/types/safe.d.ts
CHANGED
package/dist/types/safe.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"safe.d.ts","sourceRoot":"","sources":["../../src/safe.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"safe.d.ts","sourceRoot":"","sources":["../../src/safe.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAA2C,cAAc,EAAE,MAAM,MAAM,CAAC;AAwEpF,wBAAgB,WAAW,CAAC,EAAE,OAAO,EAAE,OAAO,EAAE,EAAE;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,cAAc,EAAE,CAAA;CAAE,eAM/F"}
|
package/dist/types/stream.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stream.d.ts","sourceRoot":"","sources":["../../src/stream.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"stream.d.ts","sourceRoot":"","sources":["../../src/stream.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,MAAM,CAAC;AAGjD,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,EAAE,MAAM,EAAE,EAAE;IAAE,MAAM,EAAE,oBAAoB,CAAA;CAAE,eAY1E"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export type ThebeCore = typeof import('thebe-core');
|
|
3
|
+
export declare function ThebeCoreProvider({ children }: React.PropsWithChildren): JSX.Element;
|
|
4
|
+
export declare function useThebeCore(): {
|
|
5
|
+
core?: typeof import("thebe-core") | undefined;
|
|
6
|
+
};
|
|
7
|
+
//# sourceMappingURL=thebe-provider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"thebe-provider.d.ts","sourceRoot":"","sources":["../../src/thebe-provider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8B,MAAM,OAAO,CAAC;AAGnD,MAAM,MAAM,SAAS,GAAG,cAAc,YAAY,CAAC,CAAC;AAKpD,wBAAgB,iBAAiB,CAAC,EAAE,QAAQ,EAAE,EAAE,KAAK,CAAC,iBAAiB,eAoBtE;AAED,wBAAgB,YAAY;;EAM3B"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@myst-theme/jupyter",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.1.22",
|
|
4
4
|
"main": "dist/cjs/index.js",
|
|
5
5
|
"module": "dist/esm/index.js",
|
|
6
6
|
"types": "dist/types/index.d.ts",
|
|
@@ -19,10 +19,9 @@
|
|
|
19
19
|
"build": "npm-run-all -l clean -p build:cjs build:esm build:types"
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@curvenote/connect": "^0.0.7",
|
|
23
22
|
"@headlessui/react": "^1.7.7",
|
|
24
23
|
"@heroicons/react": "^2.0.13",
|
|
25
|
-
"@myst-theme/providers": "^0.1.
|
|
24
|
+
"@myst-theme/providers": "^0.1.22",
|
|
26
25
|
"@popperjs/core": "^2.11.6",
|
|
27
26
|
"ansi-to-react": "^6.1.6",
|
|
28
27
|
"buffer": "^6.0.3",
|
|
@@ -35,6 +34,7 @@
|
|
|
35
34
|
"react-popper": "^2.3.0",
|
|
36
35
|
"react-syntax-highlighter": "^15.5.0",
|
|
37
36
|
"swr": "^1.3.0",
|
|
37
|
+
"thebe-core": "^0.1.1",
|
|
38
38
|
"unist-util-select": "^4.0.1"
|
|
39
39
|
},
|
|
40
40
|
"peerDependencies": {
|
package/dist/cjs/selectors.d.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { HostState } from '@curvenote/connect';
|
|
2
|
-
export interface State {
|
|
3
|
-
app: HostState;
|
|
4
|
-
}
|
|
5
|
-
export declare const selectIFrameHeight: (state: State, id: string) => Pick<import("@curvenote/connect").HostStateItem, "height" | "width"> | undefined;
|
|
6
|
-
export declare const selectIFrameReady: (state: State, id: string) => Boolean;
|
|
7
|
-
export declare const selectIFrameSendFailed: (state: State, id: string) => false | {
|
|
8
|
-
message: string | undefined;
|
|
9
|
-
};
|
|
10
|
-
//# sourceMappingURL=selectors.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"selectors.d.ts","sourceRoot":"","sources":["../../src/selectors.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAGpD,MAAM,WAAW,KAAK;IACpB,GAAG,EAAE,SAAS,CAAC;CAChB;AAED,eAAO,MAAM,kBAAkB,UAAW,KAAK,MAAM,MAAM,qFACX,CAAC;AAEjD,eAAO,MAAM,iBAAiB,UAAW,KAAK,MAAM,MAAM,YACT,CAAC;AAElD,eAAO,MAAM,sBAAsB,UAAW,KAAK,MAAM,MAAM;;CACb,CAAC"}
|
package/dist/cjs/selectors.js
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.selectIFrameSendFailed = exports.selectIFrameReady = exports.selectIFrameHeight = void 0;
|
|
4
|
-
const connect_1 = require("@curvenote/connect");
|
|
5
|
-
const selectIFrameHeight = (state, id) => connect_1.host.selectors.selectIFrameSize(state.app, id);
|
|
6
|
-
exports.selectIFrameHeight = selectIFrameHeight;
|
|
7
|
-
const selectIFrameReady = (state, id) => connect_1.host.selectors.selectIFrameReady(state.app, id);
|
|
8
|
-
exports.selectIFrameReady = selectIFrameReady;
|
|
9
|
-
const selectIFrameSendFailed = (state, id) => connect_1.host.selectors.selectIFrameFailed(state.app, id);
|
|
10
|
-
exports.selectIFrameSendFailed = selectIFrameSendFailed;
|
package/dist/esm/selectors.d.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { HostState } from '@curvenote/connect';
|
|
2
|
-
export interface State {
|
|
3
|
-
app: HostState;
|
|
4
|
-
}
|
|
5
|
-
export declare const selectIFrameHeight: (state: State, id: string) => Pick<import("@curvenote/connect").HostStateItem, "height" | "width"> | undefined;
|
|
6
|
-
export declare const selectIFrameReady: (state: State, id: string) => Boolean;
|
|
7
|
-
export declare const selectIFrameSendFailed: (state: State, id: string) => false | {
|
|
8
|
-
message: string | undefined;
|
|
9
|
-
};
|
|
10
|
-
//# sourceMappingURL=selectors.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"selectors.d.ts","sourceRoot":"","sources":["../../src/selectors.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAGpD,MAAM,WAAW,KAAK;IACpB,GAAG,EAAE,SAAS,CAAC;CAChB;AAED,eAAO,MAAM,kBAAkB,UAAW,KAAK,MAAM,MAAM,qFACX,CAAC;AAEjD,eAAO,MAAM,iBAAiB,UAAW,KAAK,MAAM,MAAM,YACT,CAAC;AAElD,eAAO,MAAM,sBAAsB,UAAW,KAAK,MAAM,MAAM;;CACb,CAAC"}
|
package/dist/esm/selectors.js
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { host } from '@curvenote/connect';
|
|
2
|
-
export const selectIFrameHeight = (state, id) => host.selectors.selectIFrameSize(state.app, id);
|
|
3
|
-
export const selectIFrameReady = (state, id) => host.selectors.selectIFrameReady(state.app, id);
|
|
4
|
-
export const selectIFrameSendFailed = (state, id) => host.selectors.selectIFrameFailed(state.app, id);
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { HostState } from '@curvenote/connect';
|
|
2
|
-
export interface State {
|
|
3
|
-
app: HostState;
|
|
4
|
-
}
|
|
5
|
-
export declare const selectIFrameHeight: (state: State, id: string) => Pick<import("@curvenote/connect").HostStateItem, "height" | "width"> | undefined;
|
|
6
|
-
export declare const selectIFrameReady: (state: State, id: string) => Boolean;
|
|
7
|
-
export declare const selectIFrameSendFailed: (state: State, id: string) => false | {
|
|
8
|
-
message: string | undefined;
|
|
9
|
-
};
|
|
10
|
-
//# sourceMappingURL=selectors.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"selectors.d.ts","sourceRoot":"","sources":["../../src/selectors.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAGpD,MAAM,WAAW,KAAK;IACpB,GAAG,EAAE,SAAS,CAAC;CAChB;AAED,eAAO,MAAM,kBAAkB,UAAW,KAAK,MAAM,MAAM,qFACX,CAAC;AAEjD,eAAO,MAAM,iBAAiB,UAAW,KAAK,MAAM,MAAM,YACT,CAAC;AAElD,eAAO,MAAM,sBAAsB,UAAW,KAAK,MAAM,MAAM;;CACb,CAAC"}
|