@myst-theme/jupyter 1.0.0 → 1.1.0

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/block.js CHANGED
@@ -10,7 +10,7 @@ export function NotebookBlock({ node, className }) {
10
10
  const block = (_jsxs("div", { id: (_b = (_a = node.html_id) !== null && _a !== void 0 ? _a : node.identifier) !== null && _b !== void 0 ? _b : node.key, className: classNames('myst-jp-nb-block relative group/block', className, node.class, {
11
11
  [(_c = node.data) === null || _c === void 0 ? void 0 : _c.class]: typeof ((_d = node.data) === null || _d === void 0 ? void 0 : _d.class) === 'string',
12
12
  hidden: node.visibility === 'remove',
13
- }), children: [pageKind === SourceFileKind.Notebook && node.kind === 'notebook-code' && (_jsxs(_Fragment, { children: [_jsx("div", { className: "myst-jp-nb-block-spinner flex sticky top-[115px] z-10 opacity-90 group-hover/block:opacity-100 group-hover/block:hidden", children: _jsx("div", { className: "flex absolute top-0 right-0", children: _jsx(NotebookRunCellSpinnerOnly, { id: `spinner-${node.key}` }) }) }), _jsx("div", { className: "myst-jp-nb-block sticky top-[115px] z-10 opacity-90 group-hover/block:opacity-100 group-hover/block:flex", children: _jsxs("div", { className: "absolute -top-[12px] right-0 flex flex-row rounded bg-white dark:bg-slate-800", children: [_jsx(NotebookRunCell, { id: `run-${node.key}` }), _jsx(NotebookClearCell, { id: `clear-${node.key}` })] }) })] })), _jsx(MyST, { ast: node.children })] }));
13
+ }), children: [pageKind === SourceFileKind.Notebook && node.kind === 'notebook-code' && (_jsxs(_Fragment, { children: [_jsx("div", { className: "myst-jp-nb-block-spinner flex sticky top-[115px] z-10 opacity-90 group-hover/block:opacity-100 group-hover/block:hidden", children: _jsx("div", { className: "flex absolute top-0 right-0", children: _jsx(NotebookRunCellSpinnerOnly, { id: node.key }) }) }), _jsx("div", { className: "myst-jp-nb-block sticky top-[115px] z-10 opacity-90 group-hover/block:opacity-100 group-hover/block:flex", children: _jsxs("div", { className: "absolute -top-[12px] right-0 flex flex-row rounded bg-white dark:bg-slate-800", children: [_jsx(NotebookRunCell, { id: node.key }), _jsx(NotebookClearCell, { id: node.key })] }) })] })), _jsx(MyST, { ast: node.children })] }));
14
14
  if (node.visibility === 'hide') {
15
15
  return _jsx(Details, { title: "Notebook Cell", children: block });
16
16
  }
@@ -1 +1 @@
1
- {"version":3,"file":"figure.d.ts","sourceRoot":"","sources":["../src/figure.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,aAAa,CAAC;AAQ/C,wBAAgB,MAAM,CAAC,EAAE,IAAI,EAAE,EAAE;IAAE,IAAI,EAAE,WAAW,CAAA;CAAE,2CAgDrD"}
1
+ {"version":3,"file":"figure.d.ts","sourceRoot":"","sources":["../src/figure.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,aAAa,CAAC;AAS/C,wBAAgB,MAAM,CAAC,EAAE,IAAI,EAAE,EAAE;IAAE,IAAI,EAAE,WAAW,CAAA;CAAE,2CAqDrD"}
package/dist/figure.js CHANGED
@@ -1,9 +1,10 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { SourceFileKind } from 'myst-spec-ext';
3
- import { DEFAULT_RENDERERS, MyST } from 'myst-to-react';
3
+ import { Callout, DEFAULT_RENDERERS, MyST } from 'myst-to-react';
4
4
  import classNames from 'classnames';
5
5
  import { OutputDecoration } from './decoration.js';
6
6
  import { OutputsContextProvider } from './providers.js';
7
+ import { ExclamationTriangleIcon } from '@heroicons/react/24/outline';
7
8
  export function Figure({ node }) {
8
9
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
9
10
  const { base: Container } = DEFAULT_RENDERERS['container'];
@@ -17,7 +18,7 @@ export function Figure({ node }) {
17
18
  return (_jsx("figure", { id: node.html_id || node.identifier || node.key, className: classNames('myst-jp-figure', { subcontainer: node.subcontainer }, node.class), children: _jsx(OutputDecoration, { outputId: (_f = outputs.id) !== null && _f !== void 0 ? _f : outputs.key, placeholder: placeholder, title: (_g = node.source) === null || _g === void 0 ? void 0 : _g.title, url: (_h = node.source) === null || _h === void 0 ? void 0 : _h.url, remoteBaseUrl: (_j = node.source) === null || _j === void 0 ? void 0 : _j.remoteBaseUrl, children: _jsx(OutputsContextProvider, { outputsId: (_k = outputs.id) !== null && _k !== void 0 ? _k : outputs.key, children: _jsx(MyST, { ast: others }) }) }, node.key) }));
18
19
  }
19
20
  else if (output) {
20
- return (_jsx("div", { className: "border border-gred-500", children: _jsxs("details", { children: [_jsx("summary", { children: "Legacy Output Embedded" }), _jsx("pre", { children: JSON.stringify(output, null, 2) })] }) }));
21
+ return (_jsx(Callout, { title: _jsx("div", { children: "Cannot render embedded output node" }), color: 'red', dropdown: true, Icon: ExclamationTriangleIcon, className: output.className, children: _jsx("div", { className: "py-2", children: "Output data package is not compatible with the current renderer." }) }));
21
22
  }
22
23
  }
23
24
  return _jsx(Container, { node: node });
package/dist/index.d.ts CHANGED
@@ -7,4 +7,5 @@ export * from './controls/index.js';
7
7
  export * from './utils.js';
8
8
  export { useLaunchBinder } from './hooks.js';
9
9
  export { JUPYTER_RENDERERS, NOTEBOOK_BLOCK_RENDERERS, OUTPUT_RENDERERS } from './renderers.js';
10
+ export { MYST_SPEC_VERSION } from '@myst-theme/common';
10
11
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,2BAA2B,CAAC;AAC1C,cAAc,gBAAgB,CAAC;AAC/B,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,YAAY,CAAC;AAC3B,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAC7C,OAAO,EAAE,iBAAiB,EAAE,wBAAwB,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,2BAA2B,CAAC;AAC1C,cAAc,gBAAgB,CAAC;AAC/B,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,YAAY,CAAC;AAC3B,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAC7C,OAAO,EAAE,iBAAiB,EAAE,wBAAwB,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAC/F,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC"}
package/dist/index.js CHANGED
@@ -7,3 +7,4 @@ export * from './controls/index.js';
7
7
  export * from './utils.js';
8
8
  export { useLaunchBinder } from './hooks.js';
9
9
  export { JUPYTER_RENDERERS, NOTEBOOK_BLOCK_RENDERERS, OUTPUT_RENDERERS } from './renderers.js';
10
+ export { MYST_SPEC_VERSION } from '@myst-theme/common';
package/dist/output.d.ts CHANGED
@@ -2,8 +2,19 @@ import type { GenericNode } from 'myst-common';
2
2
  import type { MinifiedOutput } from 'nbtx';
3
3
  export declare const DIRECT_OUTPUT_TYPES: Set<string>;
4
4
  export declare const DIRECT_MIME_TYPES: Set<string>;
5
- export declare function isOutputSafe(output: MinifiedOutput, directOutputTypes: Set<string>, directMimeTypes: Set<string>): boolean;
6
- export declare function Output({ node }: {
5
+ export declare function isOutputSafe(output: MinifiedOutput | null | undefined, directOutputTypes: Set<string>, directMimeTypes: Set<string>): boolean;
6
+ /**
7
+ * Check if an output is valid and has the expected structure.
8
+ *
9
+ * @param output - The output to validate.
10
+ * @returns Object with isValid flag and reason if invalid.
11
+ */
12
+ export declare function validateOutput(output: unknown): {
13
+ isValid: boolean;
14
+ reason?: string;
15
+ };
16
+ export declare function Output({ node, className }: {
7
17
  node: GenericNode;
18
+ className?: string;
8
19
  }): import("react/jsx-runtime").JSX.Element;
9
20
  //# sourceMappingURL=output.d.ts.map
@@ -1 +1 @@
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;AAO/D,eAAO,MAAM,mBAAmB,aAA+B,CAAC;AAEhE,eAAO,MAAM,iBAAiB,EAMxB,GAAG,CAAC,MAAM,CAAC,CAAC;AAElB,wBAAgB,YAAY,CAC1B,MAAM,EAAE,cAAc,EACtB,iBAAiB,EAAE,GAAG,CAAC,MAAM,CAAC,EAC9B,eAAe,EAAE,GAAG,CAAC,MAAM,CAAC,WAU7B;AAED,wBAAgB,MAAM,CAAC,EAAE,IAAI,EAAE,EAAE;IAAE,IAAI,EAAE,WAAW,CAAA;CAAE,2CAYrD"}
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;AAS/D,eAAO,MAAM,mBAAmB,aAA+B,CAAC;AAEhE,eAAO,MAAM,iBAAiB,EAMxB,GAAG,CAAC,MAAM,CAAC,CAAC;AAElB,wBAAgB,YAAY,CAC1B,MAAM,EAAE,cAAc,GAAG,IAAI,GAAG,SAAS,EACzC,iBAAiB,EAAE,GAAG,CAAC,MAAM,CAAC,EAC9B,eAAe,EAAE,GAAG,CAAC,MAAM,CAAC,WAgB7B;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,OAAO,GAAG;IAC/C,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAWA;AAED,wBAAgB,MAAM,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE;IAAE,IAAI,EAAE,WAAW,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,2CAoCpF"}
package/dist/output.js CHANGED
@@ -1,10 +1,12 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { KnownCellOutputMimeTypes } from 'nbtx';
3
3
  import { SafeOutput } from './safe.js';
4
4
  import { JupyterOutput } from './jupyter.js';
5
5
  import { useMemo } from 'react';
6
6
  import { useCellExecution } from './execute/index.js';
7
7
  import { useOutputsContext } from './providers.js';
8
+ import { Callout } from 'myst-to-react';
9
+ import { ExclamationTriangleIcon } from '@heroicons/react/24/outline';
8
10
  export const DIRECT_OUTPUT_TYPES = new Set(['stream', 'error']);
9
11
  export const DIRECT_MIME_TYPES = new Set([
10
12
  KnownCellOutputMimeTypes.TextPlain,
@@ -14,20 +16,51 @@ export const DIRECT_MIME_TYPES = new Set([
14
16
  KnownCellOutputMimeTypes.ImageBmp,
15
17
  ]);
16
18
  export function isOutputSafe(output, directOutputTypes, directMimeTypes) {
17
- if (directOutputTypes.has(output.output_type))
18
- return true;
19
- const data = output.data;
20
- const mimetypes = data ? Object.keys(data) : [];
21
- return ('data' in output &&
22
- Boolean(output.data) &&
23
- mimetypes.every((mimetype) => directMimeTypes.has(mimetype)));
19
+ if (!output)
20
+ return false;
21
+ try {
22
+ if (directOutputTypes.has(output.output_type))
23
+ return true;
24
+ const data = output.data;
25
+ const mimetypes = data ? Object.keys(data) : [];
26
+ return ('data' in output &&
27
+ Boolean(output.data) &&
28
+ mimetypes.every((mimetype) => directMimeTypes.has(mimetype)));
29
+ }
30
+ catch (error) {
31
+ console.error(error);
32
+ return false;
33
+ }
34
+ }
35
+ /**
36
+ * Check if an output is valid and has the expected structure.
37
+ *
38
+ * @param output - The output to validate.
39
+ * @returns Object with isValid flag and reason if invalid.
40
+ */
41
+ export function validateOutput(output) {
42
+ if (!output || typeof output !== 'object') {
43
+ return { isValid: false, reason: 'Jupyter output data package is missing or not an object' };
44
+ }
45
+ const outputType = output.output_type;
46
+ if (!('output_type' in output) || typeof outputType !== 'string') {
47
+ return { isValid: false, reason: 'Missing or invalid output_type property' };
48
+ }
49
+ return { isValid: true };
24
50
  }
25
- export function Output({ node }) {
51
+ export function Output({ node, className }) {
26
52
  const { outputsId } = useOutputsContext();
27
- const { ready } = useCellExecution(outputsId);
53
+ const { ready } = useCellExecution(outputsId !== null && outputsId !== void 0 ? outputsId : '');
28
54
  // FUTURE: we'll be rendering AST outputs directly in future
29
55
  const maybeSafeOutput = useMemo(() => node.jupyter_data, [node]);
30
56
  const isSafe = isOutputSafe(maybeSafeOutput, DIRECT_OUTPUT_TYPES, DIRECT_MIME_TYPES);
57
+ const validation = validateOutput(maybeSafeOutput);
58
+ if (!outputsId || !maybeSafeOutput || !validation.isValid) {
59
+ if (validation.reason) {
60
+ console.error(validation.reason);
61
+ }
62
+ return (_jsx(Callout, { title: _jsx("div", { children: "Cannot render output node" }), color: 'red', dropdown: true, Icon: ExclamationTriangleIcon, className: className, children: _jsxs("div", { className: "py-2 space-y-1", children: [_jsx("div", { children: "Output data package is not compatible with the current renderer." }), validation.reason && (_jsxs("div", { className: "font-mono text-sm", children: ["Reason: ", validation.reason] }))] }) }));
63
+ }
31
64
  if (isSafe && !ready) {
32
65
  return _jsx(SafeOutput, { output: maybeSafeOutput });
33
66
  }
@@ -43,7 +43,7 @@ export declare function ThebeLoaderAndServer({ baseurl, connect, children, }: Re
43
43
  baseurl?: string;
44
44
  }>): import("react/jsx-runtime").JSX.Element;
45
45
  type OutputsContextType = {
46
- outputsId: IdOrKey;
46
+ outputsId: IdOrKey | undefined;
47
47
  };
48
48
  export declare function useOutputsContext(): OutputsContextType;
49
49
  export declare function OutputsContextProvider({ outputsId, children, }: {
@@ -1 +1 @@
1
- {"version":3,"file":"providers.d.ts","sourceRoot":"","sources":["../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,EACR,gBAAgB,EAChB,mBAAmB,EACnB,QAAQ,GACT,EAAE,KAAK,CAAC,iBAAiB,CAAC;IACzB,QAAQ,EAAE;QACR,eAAe,EAAE,OAAO,CAAC;QACzB,aAAa,EAAE,OAAO,CAAC;QACvB,YAAY,EAAE,OAAO,CAAC;KACvB,CAAC;IACF,gBAAgB,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,mBAAmB,KAAK,mBAAmB,GAAG,SAAS,CAAC;IACnF,mBAAmB,CAAC,EAAE,gBAAgB,EAAE,CAAC;CAC1C,CAAC,2CA2BD;AAED,wBAAgB,aAAa,wBAG5B;AAED,wBAAgB,iBAAiB,0CAEhC;AAED,MAAM,MAAM,WAAW,GAAG;IACxB,IAAI,EAAE,cAAc,CAAC;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,aAAa,CAAC;CACtB,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,EACnC,OAAO,EACP,OAAO,EACP,QAAQ,GACT,EAAE,KAAK,CAAC,iBAAiB,CAAC;IAAE,OAAO,CAAC,EAAE,OAAO,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC,2CAkBlE;AAED,KAAK,kBAAkB,GAAG;IACxB,SAAS,EAAE,OAAO,GAAG,SAAS,CAAC;CAChC,CAAC;AAGF,wBAAgB,iBAAiB,uBAIhC;AACD,wBAAgB,sBAAsB,CAAC,EACrC,SAAS,EACT,QAAQ,GACT,EAAE;IACD,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,SAAS,EAAE,OAAO,CAAC;CACpB,2CAEA"}
package/dist/providers.js CHANGED
@@ -47,9 +47,8 @@ export function ThebeLoaderAndServer({ baseurl, connect, children, }) {
47
47
  const OutputsContext = React.createContext(null);
48
48
  export function useOutputsContext() {
49
49
  const context = useContext(OutputsContext);
50
- if (context === null) {
51
- throw new Error('useOutputsContext must be used within a OutputsContextProvider');
52
- }
50
+ if (context === null)
51
+ return { outputsId: undefined };
53
52
  return context;
54
53
  }
55
54
  export function OutputsContextProvider({ outputsId, children, }) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@myst-theme/jupyter",
3
- "version": "1.0.0",
3
+ "version": "1.1.0",
4
4
  "type": "module",
5
5
  "exports": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -11,6 +11,10 @@
11
11
  "node": ">=16"
12
12
  },
13
13
  "license": "MIT",
14
+ "repository": {
15
+ "type": "git",
16
+ "url": "git+https://github.com/jupyter-book/myst-theme.git"
17
+ },
14
18
  "scripts": {
15
19
  "clean": "rimraf dist",
16
20
  "lint": "eslint \"src/**/*.ts*\" \"src/**/*.tsx\" -c ./.eslintrc.cjs",
@@ -25,7 +29,7 @@
25
29
  "@curvenote/ansi-to-react": "^7.0.0",
26
30
  "@headlessui/react": "^1.7.15",
27
31
  "@heroicons/react": "^2.0.18",
28
- "@myst-theme/providers": "^1.0.0",
32
+ "@myst-theme/providers": "^1.1.0",
29
33
  "@scienceicons/react": "^0.0.13",
30
34
  "buffer": "^6.0.3",
31
35
  "classnames": "^2.5.1",
@@ -35,7 +39,7 @@
35
39
  "myst-frontmatter": "^1.7.9",
36
40
  "myst-spec": "^0.0.5",
37
41
  "myst-spec-ext": "^1.8.1",
38
- "myst-to-react": "^1.0.0",
42
+ "myst-to-react": "^1.1.0",
39
43
  "nanoid": "^4.0.2",
40
44
  "nbtx": "^0.2.3",
41
45
  "react-syntax-highlighter": "^15.5.0",