@myst-theme/jupyter 1.1.4 → 1.2.2

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.
@@ -1 +1 @@
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,2CAcxE"}
1
+ {"version":3,"file":"error.d.ts","sourceRoot":"","sources":["../src/error.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,MAAM,CAAC;AAIhD,MAAM,CAAC,OAAO,UAAU,KAAK,CAAC,EAAE,MAAM,EAAE,EAAE;IAAE,MAAM,EAAE,mBAAmB,CAAA;CAAE,2CAoBxE"}
package/dist/error.js CHANGED
@@ -2,8 +2,8 @@ import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import Ansi from '@curvenote/ansi-to-react';
3
3
  import { ensureString } from 'nbtx';
4
4
  import { MaybeLongContent } from './components.js';
5
+ import { useIsScrollable } from '@myst-theme/providers';
5
6
  export default function Error({ output }) {
6
- return (_jsx(MaybeLongContent, { content: ensureString(output.traceback), path: output.path, render: (content) => {
7
- return (_jsx("pre", { className: "myst-jp-error-output text-sm font-thin font-system jupyter-error", children: _jsx(Ansi, { children: content !== null && content !== void 0 ? content : '' }) }));
8
- } }));
7
+ const { ref, isScrollable } = useIsScrollable();
8
+ return (_jsx(MaybeLongContent, { content: ensureString(output.traceback), path: output.path, render: (content) => (_jsx("pre", { ref: ref, tabIndex: isScrollable ? 0 : undefined, role: isScrollable ? 'region' : undefined, "aria-label": "cell error output", className: "myst-jp-error-output text-sm font-thin font-system overflow-auto jupyter-error", children: _jsx(Ansi, { useClasses: true, children: content !== null && content !== void 0 ? content : '' }) })) }));
9
9
  }
@@ -1 +1 @@
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,2CAY1E"}
1
+ {"version":3,"file":"stream.d.ts","sourceRoot":"","sources":["../src/stream.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,MAAM,CAAC;AAMjD,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,EAAE,MAAM,EAAE,EAAE;IAAE,MAAM,EAAE,oBAAoB,CAAA;CAAE,2CAwB1E"}
package/dist/stream.js CHANGED
@@ -2,6 +2,10 @@ import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import Ansi from '@curvenote/ansi-to-react';
3
3
  import { ensureString } from 'nbtx';
4
4
  import { MaybeLongContent } from './components.js';
5
+ import { useIsScrollable } from '@myst-theme/providers';
6
+ import classNames from 'classnames';
5
7
  export default function Stream({ output }) {
6
- return (_jsx(MaybeLongContent, { content: ensureString(output.text), path: output.path, render: (content) => (_jsx("pre", { className: "myst-jp-stream-output text-sm font-thin font-system", children: _jsx(Ansi, { children: content !== null && content !== void 0 ? content : '' }) })) }));
8
+ const { ref, isScrollable } = useIsScrollable();
9
+ const isError = output.name === 'stderr';
10
+ return (_jsx(MaybeLongContent, { content: ensureString(output.text), path: output.path, render: (content) => (_jsx("pre", { ref: ref, tabIndex: isScrollable ? 0 : undefined, role: isScrollable ? 'region' : undefined, "aria-label": "cell output stream", className: classNames('myst-jp-stream-output text-sm font-thin font-system overflow-auto', isError ? 'jupyter-error' : 'jupyter-output'), children: _jsx(Ansi, { useClasses: true, children: content !== null && content !== void 0 ? content : '' }) })) }));
7
11
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@myst-theme/jupyter",
3
- "version": "1.1.4",
3
+ "version": "1.2.2",
4
4
  "type": "module",
5
5
  "exports": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -29,7 +29,7 @@
29
29
  "@curvenote/ansi-to-react": "^7.0.0",
30
30
  "@headlessui/react": "^1.7.15",
31
31
  "@heroicons/react": "^2.0.18",
32
- "@myst-theme/providers": "^1.1.4",
32
+ "@myst-theme/providers": "^1.2.2",
33
33
  "@scienceicons/react": "^0.0.13",
34
34
  "buffer": "^6.0.3",
35
35
  "classnames": "^2.5.1",
@@ -39,7 +39,7 @@
39
39
  "myst-frontmatter": "^1.7.9",
40
40
  "myst-spec": "^0.0.5",
41
41
  "myst-spec-ext": "^1.8.1",
42
- "myst-to-react": "^1.1.4",
42
+ "myst-to-react": "^1.2.2",
43
43
  "nanoid": "^4.0.2",
44
44
  "nbtx": "^0.2.3",
45
45
  "react-syntax-highlighter": "^15.5.0",