myst-to-react 0.1.19 → 0.1.20
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/admonitions.d.ts +1 -1
- package/dist/cjs/admonitions.d.ts.map +1 -1
- package/dist/cjs/basic.d.ts +1 -1
- package/dist/cjs/basic.d.ts.map +1 -1
- package/dist/cjs/card.d.ts +1 -1
- package/dist/cjs/card.d.ts.map +1 -1
- package/dist/cjs/cite.d.ts +1 -1
- package/dist/cjs/cite.d.ts.map +1 -1
- package/dist/cjs/code.d.ts +2 -1
- package/dist/cjs/code.d.ts.map +1 -1
- package/dist/cjs/code.js +6 -3
- package/dist/cjs/convertToReact.d.ts +2 -2
- package/dist/cjs/convertToReact.d.ts.map +1 -1
- package/dist/cjs/crossReference.d.ts +1 -1
- package/dist/cjs/crossReference.d.ts.map +1 -1
- package/dist/cjs/crossReference.js +2 -1
- package/dist/cjs/dropdown.d.ts +1 -1
- package/dist/cjs/dropdown.d.ts.map +1 -1
- package/dist/cjs/extensions/chemicalFormula.d.ts +1 -1
- package/dist/cjs/extensions/chemicalFormula.d.ts.map +1 -1
- package/dist/cjs/extensions/index.d.ts +1 -1
- package/dist/cjs/extensions/index.d.ts.map +1 -1
- package/dist/cjs/extensions/siunits.d.ts +1 -1
- package/dist/cjs/extensions/siunits.d.ts.map +1 -1
- package/dist/cjs/footnotes.d.ts +1 -1
- package/dist/cjs/footnotes.d.ts.map +1 -1
- package/dist/cjs/grid.d.ts +1 -1
- package/dist/cjs/grid.d.ts.map +1 -1
- package/dist/cjs/heading.d.ts +1 -1
- package/dist/cjs/heading.d.ts.map +1 -1
- package/dist/cjs/heading.js +1 -1
- package/dist/cjs/iframe.d.ts +1 -1
- package/dist/cjs/iframe.d.ts.map +1 -1
- package/dist/cjs/image.d.ts +1 -1
- package/dist/cjs/image.d.ts.map +1 -1
- package/dist/cjs/index.d.ts +1 -2
- package/dist/cjs/index.d.ts.map +1 -1
- package/dist/cjs/index.js +1 -2
- package/dist/cjs/links/index.d.ts +1 -1
- package/dist/cjs/links/index.d.ts.map +1 -1
- package/dist/cjs/math.d.ts +1 -1
- package/dist/cjs/math.d.ts.map +1 -1
- package/dist/cjs/tabs.d.ts +2 -2
- package/dist/cjs/tabs.d.ts.map +1 -1
- package/dist/types/admonitions.d.ts +1 -1
- package/dist/types/admonitions.d.ts.map +1 -1
- package/dist/types/basic.d.ts +1 -1
- package/dist/types/basic.d.ts.map +1 -1
- package/dist/types/card.d.ts +1 -1
- package/dist/types/card.d.ts.map +1 -1
- package/dist/types/cite.d.ts +1 -1
- package/dist/types/cite.d.ts.map +1 -1
- package/dist/types/code.d.ts +2 -1
- package/dist/types/code.d.ts.map +1 -1
- package/dist/types/convertToReact.d.ts +2 -2
- package/dist/types/convertToReact.d.ts.map +1 -1
- package/dist/types/crossReference.d.ts +1 -1
- package/dist/types/crossReference.d.ts.map +1 -1
- package/dist/types/dropdown.d.ts +1 -1
- package/dist/types/dropdown.d.ts.map +1 -1
- package/dist/types/extensions/chemicalFormula.d.ts +1 -1
- package/dist/types/extensions/chemicalFormula.d.ts.map +1 -1
- package/dist/types/extensions/index.d.ts +1 -1
- package/dist/types/extensions/index.d.ts.map +1 -1
- package/dist/types/extensions/siunits.d.ts +1 -1
- package/dist/types/extensions/siunits.d.ts.map +1 -1
- package/dist/types/footnotes.d.ts +1 -1
- package/dist/types/footnotes.d.ts.map +1 -1
- package/dist/types/grid.d.ts +1 -1
- package/dist/types/grid.d.ts.map +1 -1
- package/dist/types/heading.d.ts +1 -1
- package/dist/types/heading.d.ts.map +1 -1
- package/dist/types/iframe.d.ts +1 -1
- package/dist/types/iframe.d.ts.map +1 -1
- package/dist/types/image.d.ts +1 -1
- package/dist/types/image.d.ts.map +1 -1
- package/dist/types/index.d.ts +1 -2
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/links/index.d.ts +1 -1
- package/dist/types/links/index.d.ts.map +1 -1
- package/dist/types/math.d.ts +1 -1
- package/dist/types/math.d.ts.map +1 -1
- package/dist/types/tabs.d.ts +2 -2
- package/dist/types/tabs.d.ts.map +1 -1
- package/package.json +2 -6
- package/dist/cjs/output/components.d.ts +0 -10
- package/dist/cjs/output/components.d.ts.map +0 -1
- package/dist/cjs/output/components.js +0 -41
- package/dist/cjs/output/error.d.ts +0 -6
- package/dist/cjs/output/error.d.ts.map +0 -1
- package/dist/cjs/output/error.js +0 -15
- package/dist/cjs/output/hooks.d.ts +0 -67
- package/dist/cjs/output/hooks.d.ts.map +0 -1
- package/dist/cjs/output/hooks.js +0 -85
- package/dist/cjs/output/index.d.ts +0 -6
- package/dist/cjs/output/index.d.ts.map +0 -1
- package/dist/cjs/output/index.js +0 -7
- package/dist/cjs/output/jupyter.d.ts +0 -7
- package/dist/cjs/output/jupyter.d.ts.map +0 -1
- package/dist/cjs/output/jupyter.js +0 -75
- package/dist/cjs/output/output.d.ts +0 -7
- package/dist/cjs/output/output.d.ts.map +0 -1
- package/dist/cjs/output/output.js +0 -66
- package/dist/cjs/output/outputBlock.d.ts +0 -10
- package/dist/cjs/output/outputBlock.d.ts.map +0 -1
- package/dist/cjs/output/outputBlock.js +0 -13
- package/dist/cjs/output/safe.d.ts +0 -7
- package/dist/cjs/output/safe.d.ts.map +0 -1
- package/dist/cjs/output/safe.js +0 -77
- package/dist/cjs/output/selectors.d.ts +0 -10
- package/dist/cjs/output/selectors.d.ts.map +0 -1
- package/dist/cjs/output/selectors.js +0 -10
- package/dist/cjs/output/stream.d.ts +0 -6
- package/dist/cjs/output/stream.d.ts.map +0 -1
- package/dist/cjs/output/stream.js +0 -13
- package/dist/cjs/types.d.ts +0 -7
- package/dist/cjs/types.d.ts.map +0 -1
- package/dist/cjs/types.js +0 -2
- package/dist/types/output/components.d.ts +0 -10
- package/dist/types/output/components.d.ts.map +0 -1
- package/dist/types/output/error.d.ts +0 -6
- package/dist/types/output/error.d.ts.map +0 -1
- package/dist/types/output/hooks.d.ts +0 -67
- package/dist/types/output/hooks.d.ts.map +0 -1
- package/dist/types/output/index.d.ts +0 -6
- package/dist/types/output/index.d.ts.map +0 -1
- package/dist/types/output/jupyter.d.ts +0 -7
- package/dist/types/output/jupyter.d.ts.map +0 -1
- package/dist/types/output/output.d.ts +0 -7
- package/dist/types/output/output.d.ts.map +0 -1
- package/dist/types/output/outputBlock.d.ts +0 -10
- package/dist/types/output/outputBlock.d.ts.map +0 -1
- package/dist/types/output/safe.d.ts +0 -7
- package/dist/types/output/safe.d.ts.map +0 -1
- package/dist/types/output/selectors.d.ts +0 -10
- package/dist/types/output/selectors.d.ts.map +0 -1
- package/dist/types/output/stream.d.ts +0 -6
- package/dist/types/output/stream.d.ts.map +0 -1
- package/dist/types/types.d.ts +0 -7
- package/dist/types/types.d.ts.map +0 -1
package/dist/types/heading.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"heading.d.ts","sourceRoot":"","sources":["../../src/heading.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"heading.d.ts","sourceRoot":"","sources":["../../src/heading.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAS1D,wBAAgB,QAAQ,CAAC,EACvB,EAAE,EACF,IAAI,EACJ,KAAc,GACf,EAAE;IACD,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;CAC1B,sBAqBA;AAED,QAAA,MAAM,OAAO,EAAE,YAAY,CAAC,OAAO,CAoBlC,CAAC;AAEF,QAAA,MAAM,iBAAiB;;CAEtB,CAAC;AAEF,eAAe,iBAAiB,CAAC"}
|
package/dist/types/iframe.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"iframe.d.ts","sourceRoot":"","sources":["../../src/iframe.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"iframe.d.ts","sourceRoot":"","sources":["../../src/iframe.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAE1D,eAAO,MAAM,MAAM,EAAE,YAiCpB,CAAC;AAEF,QAAA,MAAM,gBAAgB;;CAErB,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
|
package/dist/types/image.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"image.d.ts","sourceRoot":"","sources":["../../src/image.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"image.d.ts","sourceRoot":"","sources":["../../src/image.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,IAAI,aAAa,EAAE,MAAM,WAAW,CAAC;AACxD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAI1D,KAAK,SAAS,GAAG,aAAa,GAAG;IAAE,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAwErD,eAAO,MAAM,KAAK,EAAE,YAAY,CAAC,SAAS,CAczC,CAAC;AAEF,QAAA,MAAM,eAAe;;CAEpB,CAAC;AAEF,eAAe,eAAe,CAAC"}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import type { NodeRenderer } from '
|
|
2
|
+
import type { NodeRenderer } from '@myst-theme/providers';
|
|
3
3
|
import type { GenericParent } from 'myst-common';
|
|
4
|
-
export type { NodeRenderer } from './types';
|
|
5
4
|
export { CopyIcon } from './components/CopyIcon';
|
|
6
5
|
export { CodeBlock } from './code';
|
|
7
6
|
export { Admonition, AdmonitionKind } from './admonitions';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAoBjD,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AACnC,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAE3D,eAAO,MAAM,iBAAiB,EAAE,MAAM,CAAC,MAAM,EAAE,YAAY,CAkB1D,CAAC;AAEF,wBAAgB,QAAQ,CACtB,IAAI,EAAE,aAAa,GAAG,IAAI,EAC1B,SAAS,GAAE,MAAM,CAAC,MAAM,EAAE,YAAY,CAAqB,6BAU5D"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/links/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAOtC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/links/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAOtC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAO1D,KAAK,eAAe,GAAG,IAAI,GAAG;IAAE,QAAQ,CAAC,EAAE,OAAO,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAiDxE,eAAO,MAAM,IAAI,EAAE,YAAY,CAAC,eAAe,CA+C9C,CAAC;AAEF,eAAO,MAAM,SAAS,EAAE,YAAY,CAAC,eAAe,CAkCnD,CAAC;AAEF,QAAA,MAAM,cAAc;;;CAGnB,CAAC;AAEF,eAAe,cAAc,CAAC"}
|
package/dist/types/math.d.ts
CHANGED
package/dist/types/math.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"math.d.ts","sourceRoot":"","sources":["../../src/math.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAGlD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"math.d.ts","sourceRoot":"","sources":["../../src/math.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAGlD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AA2B1D,KAAK,QAAQ,GAAG,CAAC,UAAU,GAAG,IAAI,CAAC,GAAG;IACpC,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;AAuCF,QAAA,MAAM,cAAc;;;CAGnB,CAAC;AAEF,eAAe,cAAc,CAAC"}
|
package/dist/types/tabs.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { GenericNode } from '
|
|
2
|
-
import type { NodeRenderer } from '
|
|
1
|
+
import type { GenericNode } from 'myst-common';
|
|
2
|
+
import type { NodeRenderer } from '@myst-theme/providers';
|
|
3
3
|
interface TabItem extends GenericNode {
|
|
4
4
|
key: string;
|
|
5
5
|
title: string;
|
package/dist/types/tabs.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tabs.d.ts","sourceRoot":"","sources":["../../src/tabs.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"tabs.d.ts","sourceRoot":"","sources":["../../src/tabs.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAG/C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAE1D,UAAU,OAAQ,SAAQ,WAAW;IACnC,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,eAAO,MAAM,cAAc,EAAE,YAiC5B,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,YAAY,CAAC,OAAO,CAOjD,CAAC;AAEF,QAAA,MAAM,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,YAAY,CAG/C,CAAC;AAEF,eAAe,aAAa,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "myst-to-react",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.20",
|
|
4
4
|
"main": "dist/cjs/index.js",
|
|
5
5
|
"types": "dist/types/index.d.ts",
|
|
6
6
|
"files": [
|
|
@@ -18,14 +18,10 @@
|
|
|
18
18
|
"build": "npm-run-all -l clean -p build:cjs build:types"
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@
|
|
22
|
-
"@curvenote/connect": "0.0.6",
|
|
23
|
-
"@curvenote/nbtx": "^0.1.11",
|
|
24
|
-
"@myst-theme/providers": "^0.1.19",
|
|
21
|
+
"@myst-theme/providers": "^0.1.20",
|
|
25
22
|
"@headlessui/react": "^1.6.5",
|
|
26
23
|
"@heroicons/react": "^2.0.12",
|
|
27
24
|
"@popperjs/core": "^2.11.5",
|
|
28
|
-
"ansi-to-react": "^6.1.6",
|
|
29
25
|
"buffer": "^6.0.3",
|
|
30
26
|
"classnames": "^2.3.1",
|
|
31
27
|
"myst-common": "^0.0.12",
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
export declare const MaybeLongContent: ({ content, path, render, }: {
|
|
3
|
-
content?: string | undefined;
|
|
4
|
-
path?: string | undefined;
|
|
5
|
-
render: (content: string) => JSX.Element;
|
|
6
|
-
}) => JSX.Element;
|
|
7
|
-
export declare const DangerousHTML: ({ content, ...rest }: {
|
|
8
|
-
content: string;
|
|
9
|
-
}) => JSX.Element;
|
|
10
|
-
//# sourceMappingURL=components.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"components.d.ts","sourceRoot":"","sources":["../../../src/output/components.tsx"],"names":[],"mappings":";AAGA,eAAO,MAAM,gBAAgB;;;sBAOT,MAAM,KAAK,WAAW;iBAUzC,CAAC;AAEF,eAAO,MAAM,aAAa;aAAqC,MAAM;iBAWpE,CAAC"}
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
|
-
var t = {};
|
|
4
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
-
t[p] = s[p];
|
|
6
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
-
t[p[i]] = s[p[i]];
|
|
10
|
-
}
|
|
11
|
-
return t;
|
|
12
|
-
};
|
|
13
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
-
exports.DangerousHTML = exports.MaybeLongContent = void 0;
|
|
15
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
16
|
-
const react_1 = require("react");
|
|
17
|
-
const hooks_1 = require("./hooks");
|
|
18
|
-
const MaybeLongContent = ({ content, path, render, }) => {
|
|
19
|
-
const { error, data } = (0, hooks_1.useLongContent)(content, path);
|
|
20
|
-
if (error) {
|
|
21
|
-
return (0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "text-red-500" }, { children: ["Error loading content: ", error.message] }));
|
|
22
|
-
}
|
|
23
|
-
if (!data) {
|
|
24
|
-
return (0, jsx_runtime_1.jsx)("div", { children: "Fetching long content...." });
|
|
25
|
-
}
|
|
26
|
-
return (0, jsx_runtime_1.jsx)("div", { children: render(data.content) });
|
|
27
|
-
};
|
|
28
|
-
exports.MaybeLongContent = MaybeLongContent;
|
|
29
|
-
const DangerousHTML = (_a) => {
|
|
30
|
-
var { content } = _a, rest = __rest(_a, ["content"]);
|
|
31
|
-
const ref = (0, react_1.useRef)(null);
|
|
32
|
-
(0, react_1.useEffect)(() => {
|
|
33
|
-
if (!content || !ref.current)
|
|
34
|
-
return;
|
|
35
|
-
const el = document.createRange().createContextualFragment(content);
|
|
36
|
-
ref.current.innerHTML = '';
|
|
37
|
-
ref.current.appendChild(el);
|
|
38
|
-
}, [content, ref]);
|
|
39
|
-
return (0, jsx_runtime_1.jsx)("div", Object.assign({}, rest, { ref: ref }));
|
|
40
|
-
};
|
|
41
|
-
exports.DangerousHTML = DangerousHTML;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"error.d.ts","sourceRoot":"","sources":["../../../src/output/error.tsx"],"names":[],"mappings":";AAEA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAG3D,MAAM,CAAC,OAAO,UAAU,KAAK,CAAC,EAAE,MAAM,EAAE,EAAE;IAAE,MAAM,EAAE,mBAAmB,CAAA;CAAE,eAcxE"}
|
package/dist/cjs/output/error.js
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
7
|
-
const ansi_to_react_1 = __importDefault(require("ansi-to-react"));
|
|
8
|
-
const blocks_1 = require("@curvenote/blocks");
|
|
9
|
-
const components_1 = require("./components");
|
|
10
|
-
function Error({ output }) {
|
|
11
|
-
return ((0, jsx_runtime_1.jsx)(components_1.MaybeLongContent, { content: (0, blocks_1.ensureString)(output.traceback), path: output.path, render: (content) => {
|
|
12
|
-
return ((0, jsx_runtime_1.jsx)("pre", Object.assign({ className: "text-sm font-thin font-system jupyter-error" }, { children: (0, jsx_runtime_1.jsx)(ansi_to_react_1.default, { children: content !== null && content !== void 0 ? content : '' }) })));
|
|
13
|
-
} }));
|
|
14
|
-
}
|
|
15
|
-
exports.default = Error;
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import type { MinifiedOutput } from '@curvenote/nbtx/dist/minify/types';
|
|
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
|
-
interface LongContent {
|
|
20
|
-
content_type?: string;
|
|
21
|
-
content: string;
|
|
22
|
-
}
|
|
23
|
-
export declare function useLongContent(content?: string, url?: string): {
|
|
24
|
-
data?: LongContent;
|
|
25
|
-
error?: Error;
|
|
26
|
-
};
|
|
27
|
-
export declare function useFetchAnyTruncatedContent(outputs: MinifiedOutput[]): {
|
|
28
|
-
data: ({
|
|
29
|
-
data: {};
|
|
30
|
-
path?: string | undefined;
|
|
31
|
-
traceback: string & string[];
|
|
32
|
-
output_type: "error";
|
|
33
|
-
ename: string;
|
|
34
|
-
evalue: string;
|
|
35
|
-
} | {
|
|
36
|
-
data: {};
|
|
37
|
-
path?: string | undefined;
|
|
38
|
-
output_type: "stream";
|
|
39
|
-
name: import("@jupyterlab/nbformat").StreamType;
|
|
40
|
-
text: import("@jupyterlab/nbformat").MultilineString;
|
|
41
|
-
} | {
|
|
42
|
-
data: {};
|
|
43
|
-
output_type: import("@curvenote/nbtx/dist/minify/types").MimeOutputType;
|
|
44
|
-
execution_count?: import("@jupyterlab/nbformat").ExecutionCount | undefined;
|
|
45
|
-
metadata: import("@lumino/coreutils").PartialJSONObject;
|
|
46
|
-
} | {
|
|
47
|
-
[x: string]: import("@lumino/coreutils").PartialJSONValue | undefined;
|
|
48
|
-
path?: string | undefined;
|
|
49
|
-
traceback: string & string[];
|
|
50
|
-
output_type: "error";
|
|
51
|
-
ename: string;
|
|
52
|
-
evalue: string;
|
|
53
|
-
} | {
|
|
54
|
-
[x: string]: import("@lumino/coreutils").PartialJSONValue | undefined;
|
|
55
|
-
path?: string | undefined;
|
|
56
|
-
output_type: "stream";
|
|
57
|
-
name: import("@jupyterlab/nbformat").StreamType;
|
|
58
|
-
text: import("@jupyterlab/nbformat").MultilineString;
|
|
59
|
-
})[] | undefined;
|
|
60
|
-
error: any;
|
|
61
|
-
};
|
|
62
|
-
export default function useWindowSize(): {
|
|
63
|
-
width: number;
|
|
64
|
-
height: number;
|
|
65
|
-
};
|
|
66
|
-
export {};
|
|
67
|
-
//# sourceMappingURL=hooks.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["../../../src/output/hooks.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAIV,cAAc,EAEf,MAAM,mCAAmC,CAAC;AAI3C;;;;;;;;;;;;;;;;GAgBG;AAEH,UAAU,WAAW;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,OAAO,EAAE,MAAM,CAAC;CACjB;AAQD,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA6BpE;AAUD,MAAM,CAAC,OAAO,UAAU,aAAa;;;EAapC"}
|
package/dist/cjs/output/hooks.js
DELETED
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.useFetchAnyTruncatedContent = exports.useLongContent = void 0;
|
|
7
|
-
const immutable_1 = __importDefault(require("swr/immutable"));
|
|
8
|
-
const utils_1 = require("@curvenote/nbtx/dist/minify/utils");
|
|
9
|
-
const react_1 = require("react");
|
|
10
|
-
const fetcher = (...args) => fetch(...args).then((res) => {
|
|
11
|
-
if (res.status === 200)
|
|
12
|
-
return res.json();
|
|
13
|
-
throw new Error(`Content returned with status ${res.status}.`);
|
|
14
|
-
});
|
|
15
|
-
function useLongContent(content, url) {
|
|
16
|
-
if (typeof document === 'undefined') {
|
|
17
|
-
// This is ONLY called on the server
|
|
18
|
-
return url ? {} : { data: { content: content !== null && content !== void 0 ? content : '' } };
|
|
19
|
-
}
|
|
20
|
-
const { data, error } = (0, immutable_1.default)(url || null, fetcher);
|
|
21
|
-
if (!url)
|
|
22
|
-
return { data: { content: content !== null && content !== void 0 ? content : '' } };
|
|
23
|
-
return { data, error };
|
|
24
|
-
}
|
|
25
|
-
exports.useLongContent = useLongContent;
|
|
26
|
-
const arrayFetcher = (...urls) => {
|
|
27
|
-
return Promise.all(urls.map((url) => fetcher(url)));
|
|
28
|
-
};
|
|
29
|
-
function shallowCloneOutputs(outputs) {
|
|
30
|
-
return outputs.map((output) => {
|
|
31
|
-
if ('data' in output && output.data) {
|
|
32
|
-
const data = output.data;
|
|
33
|
-
return Object.assign(Object.assign({}, output), { data: Object.entries(data).reduce((acc, [mimetype, payload]) => {
|
|
34
|
-
return Object.assign(Object.assign({}, acc), { [mimetype]: Object.assign({}, payload) });
|
|
35
|
-
}, {}) });
|
|
36
|
-
}
|
|
37
|
-
return Object.assign({}, output);
|
|
38
|
-
});
|
|
39
|
-
}
|
|
40
|
-
function useFetchAnyTruncatedContent(outputs) {
|
|
41
|
-
const itemsWithPaths = [];
|
|
42
|
-
const updated = shallowCloneOutputs(outputs);
|
|
43
|
-
(0, utils_1.walkPaths)(updated, (path, obj) => {
|
|
44
|
-
// images have paths, but we don't need to fetch them
|
|
45
|
-
if ('content_type' in obj && obj.content_type.startsWith('image/'))
|
|
46
|
-
return;
|
|
47
|
-
obj.path = path;
|
|
48
|
-
itemsWithPaths.push(obj);
|
|
49
|
-
});
|
|
50
|
-
const { data, error } = (0, immutable_1.default)(itemsWithPaths.map(({ path }) => path), arrayFetcher);
|
|
51
|
-
data === null || data === void 0 ? void 0 : data.forEach(({ content }, idx) => {
|
|
52
|
-
const obj = itemsWithPaths[idx];
|
|
53
|
-
if ('text' in obj)
|
|
54
|
-
obj.text = content; // stream
|
|
55
|
-
if ('traceback' in obj)
|
|
56
|
-
obj.traceback = content; // error
|
|
57
|
-
if ('content' in obj)
|
|
58
|
-
obj.content = content; // mimeoutput
|
|
59
|
-
obj.path = undefined;
|
|
60
|
-
});
|
|
61
|
-
return {
|
|
62
|
-
data: itemsWithPaths.length === 0 || data ? updated : undefined,
|
|
63
|
-
error,
|
|
64
|
-
};
|
|
65
|
-
}
|
|
66
|
-
exports.useFetchAnyTruncatedContent = useFetchAnyTruncatedContent;
|
|
67
|
-
function getWindowSize() {
|
|
68
|
-
const { innerWidth: width, innerHeight: height } = window;
|
|
69
|
-
return {
|
|
70
|
-
width,
|
|
71
|
-
height,
|
|
72
|
-
};
|
|
73
|
-
}
|
|
74
|
-
function useWindowSize() {
|
|
75
|
-
const [windowSize, setWindowSize] = (0, react_1.useState)(getWindowSize());
|
|
76
|
-
(0, react_1.useLayoutEffect)(() => {
|
|
77
|
-
function handleResize() {
|
|
78
|
-
setWindowSize(getWindowSize());
|
|
79
|
-
}
|
|
80
|
-
window.addEventListener('resize', handleResize);
|
|
81
|
-
return () => window.removeEventListener('resize', handleResize);
|
|
82
|
-
}, []);
|
|
83
|
-
return windowSize;
|
|
84
|
-
}
|
|
85
|
-
exports.default = useWindowSize;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/output/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC,QAAA,MAAM,gBAAgB;;CAErB,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
|
package/dist/cjs/output/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"jupyter.d.ts","sourceRoot":"","sources":["../../../src/output/jupyter.tsx"],"names":[],"mappings":";AAKA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAQtD,eAAO,MAAM,oBAAoB;QAI3B,MAAM;aACD,cAAc,EAAE;iBAmE1B,CAAC"}
|
|
@@ -1,75 +0,0 @@
|
|
|
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.NativeJupyterOutputs = void 0;
|
|
27
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
28
|
-
const react_1 = require("react");
|
|
29
|
-
const hooks_1 = __importStar(require("./hooks"));
|
|
30
|
-
const nanoid_1 = require("nanoid");
|
|
31
|
-
const react_redux_1 = require("react-redux");
|
|
32
|
-
const connect_1 = require("@curvenote/connect");
|
|
33
|
-
const nbtx_1 = require("@curvenote/nbtx");
|
|
34
|
-
const outline_1 = require("@heroicons/react/24/outline");
|
|
35
|
-
const selectors_1 = require("./selectors");
|
|
36
|
-
const PERCENT_OF_WINDOW = 0.9;
|
|
37
|
-
const NativeJupyterOutputs = ({ id, outputs, }) => {
|
|
38
|
-
const windowSize = (0, hooks_1.default)();
|
|
39
|
-
const { data, error } = (0, hooks_1.useFetchAnyTruncatedContent)(outputs);
|
|
40
|
-
const [loading, setLoading] = (0, react_1.useState)(true);
|
|
41
|
-
const [frameHeight, setFrameHeight] = (0, react_1.useState)(0);
|
|
42
|
-
const [clamped, setClamped] = (0, react_1.useState)(false);
|
|
43
|
-
const uid = (0, react_1.useMemo)(nanoid_1.nanoid, []);
|
|
44
|
-
const height = (0, react_redux_1.useSelector)((state) => (0, selectors_1.selectIFrameHeight)(state, uid));
|
|
45
|
-
const rendererReady = (0, react_redux_1.useSelector)((state) => (0, selectors_1.selectIFrameReady)(state, uid));
|
|
46
|
-
const iframeRef = (0, react_1.useRef)(null);
|
|
47
|
-
(0, react_1.useEffect)(() => {
|
|
48
|
-
if (iframeRef.current == null || !rendererReady || !data)
|
|
49
|
-
return;
|
|
50
|
-
(0, nbtx_1.fetchAndEncodeOutputImages)((0, nbtx_1.convertToIOutputs)(data)).then((out) => {
|
|
51
|
-
connect_1.host.commsDispatch(iframeRef.current, connect_1.actions.connectHostSendContent(uid, out));
|
|
52
|
-
});
|
|
53
|
-
}, [id, iframeRef.current, rendererReady]);
|
|
54
|
-
(0, react_1.useEffect)(() => {
|
|
55
|
-
if (height == null)
|
|
56
|
-
return;
|
|
57
|
-
if (height > PERCENT_OF_WINDOW * windowSize.height) {
|
|
58
|
-
setFrameHeight(PERCENT_OF_WINDOW * windowSize.height);
|
|
59
|
-
setClamped(true);
|
|
60
|
-
}
|
|
61
|
-
else {
|
|
62
|
-
setFrameHeight(height + 25);
|
|
63
|
-
setClamped(false);
|
|
64
|
-
}
|
|
65
|
-
setLoading(false);
|
|
66
|
-
}, [height]);
|
|
67
|
-
if (error) {
|
|
68
|
-
return (0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "text-red-500" }, { children: ["Error rendering output: ", error.message] }));
|
|
69
|
-
}
|
|
70
|
-
return ((0, jsx_runtime_1.jsxs)("div", { children: [loading && (0, jsx_runtime_1.jsx)("div", Object.assign({ className: "p-2.5" }, { children: "Loading..." })), (0, jsx_runtime_1.jsx)("iframe", { ref: iframeRef, id: uid, name: uid, title: uid, src: "https://next.curvenote.run", width: '100%', height: frameHeight, sandbox: "allow-scripts" }), clamped && ((0, jsx_runtime_1.jsx)("div", Object.assign({ className: "cursor-pointer p-1 pb-2 hover:bg-gray-50 dark:hover:bg-gray-700 text-center text-gray-500 hover:text-gray-600 dark:text-gray-200 dark:hover:text-gray-50", title: "Expand", onClick: () => {
|
|
71
|
-
setFrameHeight(height !== null && height !== void 0 ? height : 0);
|
|
72
|
-
setClamped(false);
|
|
73
|
-
} }, { children: (0, jsx_runtime_1.jsx)(outline_1.ChevronDoubleDownIcon, { className: "w-5 h-5 inline" }) })))] }));
|
|
74
|
-
};
|
|
75
|
-
exports.NativeJupyterOutputs = NativeJupyterOutputs;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import type { GenericNode } from 'mystjs';
|
|
3
|
-
import type { MinifiedOutput } from '@curvenote/nbtx/dist/minify/types';
|
|
4
|
-
export declare function allOutputsAreSafe(outputs: MinifiedOutput[], directOutputTypes: Set<string>, directMimeTypes: Set<string>): boolean;
|
|
5
|
-
export declare function anyErrors(outputs: MinifiedOutput[]): boolean;
|
|
6
|
-
export declare function Output(node: GenericNode): JSX.Element;
|
|
7
|
-
//# sourceMappingURL=output.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"output.d.ts","sourceRoot":"","sources":["../../../src/output/output.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC;AAE1C,OAAO,KAAK,EAAsB,cAAc,EAAE,MAAM,mCAAmC,CAAC;AAgB5F,wBAAgB,iBAAiB,CAC/B,OAAO,EAAE,cAAc,EAAE,EACzB,iBAAiB,EAAE,GAAG,CAAC,MAAM,CAAC,EAC9B,eAAe,EAAE,GAAG,CAAC,MAAM,CAAC,WAY7B;AAWD,wBAAgB,SAAS,CAAC,OAAO,EAAE,cAAc,EAAE,WAElD;AAED,wBAAgB,MAAM,CAAC,IAAI,EAAE,WAAW,eA8BvC"}
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.Output = exports.anyErrors = exports.allOutputsAreSafe = void 0;
|
|
7
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
-
const blocks_1 = require("@curvenote/blocks");
|
|
9
|
-
const classnames_1 = __importDefault(require("classnames"));
|
|
10
|
-
const safe_1 = require("./safe");
|
|
11
|
-
const jupyter_1 = require("./jupyter");
|
|
12
|
-
const outputBlock_1 = require("./outputBlock");
|
|
13
|
-
const DIRECT_OUTPUT_TYPES = new Set(['stream', 'error']);
|
|
14
|
-
const DIRECT_MIME_TYPES = new Set([
|
|
15
|
-
blocks_1.KnownCellOutputMimeTypes.TextPlain,
|
|
16
|
-
blocks_1.KnownCellOutputMimeTypes.ImagePng,
|
|
17
|
-
blocks_1.KnownCellOutputMimeTypes.ImageGif,
|
|
18
|
-
blocks_1.KnownCellOutputMimeTypes.ImageJpeg,
|
|
19
|
-
blocks_1.KnownCellOutputMimeTypes.ImageBmp,
|
|
20
|
-
]);
|
|
21
|
-
function allOutputsAreSafe(outputs, directOutputTypes, directMimeTypes) {
|
|
22
|
-
return outputs.reduce((flag, output) => {
|
|
23
|
-
if (directOutputTypes.has(output.output_type))
|
|
24
|
-
return true;
|
|
25
|
-
const data = output.data;
|
|
26
|
-
const mimetypes = data ? Object.keys(data) : [];
|
|
27
|
-
const safe = 'data' in output &&
|
|
28
|
-
Boolean(output.data) &&
|
|
29
|
-
mimetypes.every((mimetype) => directMimeTypes.has(mimetype));
|
|
30
|
-
return flag && safe;
|
|
31
|
-
}, true);
|
|
32
|
-
}
|
|
33
|
-
exports.allOutputsAreSafe = allOutputsAreSafe;
|
|
34
|
-
function listMimetypes(outputs, directOutputTypes) {
|
|
35
|
-
return outputs.map((output) => {
|
|
36
|
-
if (directOutputTypes.has(output.output_type))
|
|
37
|
-
return [output.output_type];
|
|
38
|
-
const data = output.data;
|
|
39
|
-
const mimetypes = data ? Object.keys(data) : [];
|
|
40
|
-
return [output.output_type, mimetypes];
|
|
41
|
-
});
|
|
42
|
-
}
|
|
43
|
-
function anyErrors(outputs) {
|
|
44
|
-
return outputs.reduce((flag, output) => flag || output.output_type === 'error', false);
|
|
45
|
-
}
|
|
46
|
-
exports.anyErrors = anyErrors;
|
|
47
|
-
function Output(node) {
|
|
48
|
-
const outputs = node.data;
|
|
49
|
-
const allSafe = allOutputsAreSafe(outputs, DIRECT_OUTPUT_TYPES, DIRECT_MIME_TYPES);
|
|
50
|
-
const hasError = anyErrors(outputs);
|
|
51
|
-
let component;
|
|
52
|
-
if (allSafe) {
|
|
53
|
-
component = (0, jsx_runtime_1.jsx)(safe_1.SafeOutputs, { keyStub: node.key, outputs: outputs });
|
|
54
|
-
}
|
|
55
|
-
else {
|
|
56
|
-
// Hide the iframe if rendering on the server
|
|
57
|
-
component =
|
|
58
|
-
typeof document === 'undefined' ? null : (0, jsx_runtime_1.jsx)(jupyter_1.NativeJupyterOutputs, { id: node.key, outputs: outputs });
|
|
59
|
-
}
|
|
60
|
-
return ((0, jsx_runtime_1.jsx)("figure", Object.assign({ suppressHydrationWarning: !allSafe, id: node.identifier || undefined, className: (0, classnames_1.default)('max-w-full overflow-auto m-0', {
|
|
61
|
-
'text-left': !node.align || node.align === 'left',
|
|
62
|
-
'text-center': node.align === 'center',
|
|
63
|
-
'text-right': node.align === 'right',
|
|
64
|
-
}) }, { children: (0, jsx_runtime_1.jsx)(outputBlock_1.OutputBlock, Object.assign({ allSafe: allSafe, hasError: hasError }, { children: component })) }), node.key));
|
|
65
|
-
}
|
|
66
|
-
exports.Output = Output;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
type Props = {
|
|
3
|
-
children?: React.ReactNode;
|
|
4
|
-
allSafe?: boolean;
|
|
5
|
-
hasError?: boolean;
|
|
6
|
-
className?: string;
|
|
7
|
-
};
|
|
8
|
-
export declare function OutputBlock(props: Props): JSX.Element;
|
|
9
|
-
export {};
|
|
10
|
-
//# sourceMappingURL=outputBlock.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"outputBlock.d.ts","sourceRoot":"","sources":["../../../src/output/outputBlock.tsx"],"names":[],"mappings":";AAEA,KAAK,KAAK,GAAG;IACX,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,wBAAgB,WAAW,CAAC,KAAK,EAAE,KAAK,eAWvC"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.OutputBlock = void 0;
|
|
7
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
-
const classnames_1 = __importDefault(require("classnames"));
|
|
9
|
-
function OutputBlock(props) {
|
|
10
|
-
const { children, allSafe, className } = props;
|
|
11
|
-
return ((0, jsx_runtime_1.jsx)("div", Object.assign({ suppressHydrationWarning: !allSafe, className: (0, classnames_1.default)('relative group not-prose overflow-auto mb-4 pl-0.5', className) }, { children: children })));
|
|
12
|
-
}
|
|
13
|
-
exports.OutputBlock = OutputBlock;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import type { MinifiedOutput } from '@curvenote/nbtx/dist/minify/types';
|
|
3
|
-
export declare function SafeOutputs({ keyStub, outputs }: {
|
|
4
|
-
keyStub: string;
|
|
5
|
-
outputs: MinifiedOutput[];
|
|
6
|
-
}): JSX.Element;
|
|
7
|
-
//# sourceMappingURL=safe.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"safe.d.ts","sourceRoot":"","sources":["../../../src/output/safe.tsx"],"names":[],"mappings":";AACA,OAAO,KAAK,EAGV,cAAc,EACf,MAAM,mCAAmC,CAAC;AAwE3C,wBAAgB,WAAW,CAAC,EAAE,OAAO,EAAE,OAAO,EAAE,EAAE;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,cAAc,EAAE,CAAA;CAAE,eAM/F"}
|