@myst-theme/jupyter 0.2.5 → 0.2.7

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":"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;AAM/D,eAAO,MAAM,mBAAmB,aAA+B,CAAC;AAEhE,eAAO,MAAM,iBAAiB,aAMb,CAAC;AAElB,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,eA2BvC"}
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;AAM/D,eAAO,MAAM,mBAAmB,aAA+B,CAAC;AAEhE,eAAO,MAAM,iBAAiB,aAMb,CAAC;AAElB,wBAAgB,iBAAiB,CAC/B,OAAO,EAAE,cAAc,EAAE,EACzB,iBAAiB,EAAE,GAAG,CAAC,MAAM,CAAC,EAC9B,eAAe,EAAE,GAAG,CAAC,MAAM,CAAC,WAY7B;AA0CD,wBAAgB,MAAM,CAAC,IAAI,EAAE,WAAW,eAYvC"}
@@ -31,21 +31,25 @@ function allOutputsAreSafe(outputs, directOutputTypes, directMimeTypes) {
31
31
  }, true);
32
32
  }
33
33
  exports.allOutputsAreSafe = allOutputsAreSafe;
34
- function Output(node) {
35
- const exec = (0, providers_1.useNotebookCellExecution)(node.key);
36
- const outputs = node.data;
34
+ function JupyterOutput({ nodeKey, nodeType, identifier, data, align, }) {
35
+ const exec = (0, providers_1.useNotebookCellExecution)(nodeKey);
36
+ const outputs = data;
37
37
  const allSafe = allOutputsAreSafe(outputs, exports.DIRECT_OUTPUT_TYPES, exports.DIRECT_MIME_TYPES);
38
38
  let component;
39
39
  if (allSafe && !(exec === null || exec === void 0 ? void 0 : exec.ready)) {
40
- component = (0, jsx_runtime_1.jsx)(safe_1.SafeOutputs, { keyStub: node.key, outputs: outputs });
40
+ component = (0, jsx_runtime_1.jsx)(safe_1.SafeOutputs, { keyStub: nodeKey, outputs: outputs });
41
41
  }
42
42
  else {
43
- component = (0, jsx_runtime_1.jsx)(jupyter_1.JupyterOutputs, { id: node.key, outputs: outputs });
43
+ component = (0, jsx_runtime_1.jsx)(jupyter_1.JupyterOutputs, { id: nodeKey, outputs: outputs });
44
44
  }
45
- return ((0, jsx_runtime_1.jsx)("figure", Object.assign({ id: node.identifier || undefined, "data-mdast-node-type": node.type, "data-mdast-node-id": node.key, className: (0, classnames_1.default)('max-w-full overflow-auto m-0 group not-prose relative', {
46
- 'text-left': !node.align || node.align === 'left',
47
- 'text-center': node.align === 'center',
48
- 'text-right': node.align === 'right',
49
- }) }, { children: component }), node.key));
45
+ return ((0, jsx_runtime_1.jsx)("figure", Object.assign({ id: identifier || undefined, "data-mdast-node-type": nodeType, "data-mdast-node-id": nodeKey, className: (0, classnames_1.default)('max-w-full overflow-auto m-0 group not-prose relative', {
46
+ 'text-left': !align || align === 'left',
47
+ 'text-center': align === 'center',
48
+ 'text-right': align === 'right',
49
+ }) }, { children: component })));
50
+ }
51
+ function Output(node) {
52
+ // Note, NodeRenderer's can't have hooks in it directly!
53
+ return ((0, jsx_runtime_1.jsx)(JupyterOutput, { nodeKey: node.key, nodeType: node.type, identifier: node.identifier, align: node.align, data: node.data }, node.key));
50
54
  }
51
55
  exports.Output = Output;
@@ -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;AAM/D,eAAO,MAAM,mBAAmB,aAA+B,CAAC;AAEhE,eAAO,MAAM,iBAAiB,aAMb,CAAC;AAElB,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,eA2BvC"}
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;AAM/D,eAAO,MAAM,mBAAmB,aAA+B,CAAC;AAEhE,eAAO,MAAM,iBAAiB,aAMb,CAAC;AAElB,wBAAgB,iBAAiB,CAC/B,OAAO,EAAE,cAAc,EAAE,EACzB,iBAAiB,EAAE,GAAG,CAAC,MAAM,CAAC,EAC9B,eAAe,EAAE,GAAG,CAAC,MAAM,CAAC,WAY7B;AA0CD,wBAAgB,MAAM,CAAC,IAAI,EAAE,WAAW,eAYvC"}
@@ -24,20 +24,24 @@ export function allOutputsAreSafe(outputs, directOutputTypes, directMimeTypes) {
24
24
  return flag && safe;
25
25
  }, true);
26
26
  }
27
- export function Output(node) {
28
- const exec = useNotebookCellExecution(node.key);
29
- const outputs = node.data;
27
+ function JupyterOutput({ nodeKey, nodeType, identifier, data, align, }) {
28
+ const exec = useNotebookCellExecution(nodeKey);
29
+ const outputs = data;
30
30
  const allSafe = allOutputsAreSafe(outputs, DIRECT_OUTPUT_TYPES, DIRECT_MIME_TYPES);
31
31
  let component;
32
32
  if (allSafe && !(exec === null || exec === void 0 ? void 0 : exec.ready)) {
33
- component = _jsx(SafeOutputs, { keyStub: node.key, outputs: outputs });
33
+ component = _jsx(SafeOutputs, { keyStub: nodeKey, outputs: outputs });
34
34
  }
35
35
  else {
36
- component = _jsx(JupyterOutputs, { id: node.key, outputs: outputs });
36
+ component = _jsx(JupyterOutputs, { id: nodeKey, outputs: outputs });
37
37
  }
38
- return (_jsx("figure", Object.assign({ id: node.identifier || undefined, "data-mdast-node-type": node.type, "data-mdast-node-id": node.key, className: classNames('max-w-full overflow-auto m-0 group not-prose relative', {
39
- 'text-left': !node.align || node.align === 'left',
40
- 'text-center': node.align === 'center',
41
- 'text-right': node.align === 'right',
42
- }) }, { children: component }), node.key));
38
+ return (_jsx("figure", Object.assign({ id: identifier || undefined, "data-mdast-node-type": nodeType, "data-mdast-node-id": nodeKey, className: classNames('max-w-full overflow-auto m-0 group not-prose relative', {
39
+ 'text-left': !align || align === 'left',
40
+ 'text-center': align === 'center',
41
+ 'text-right': align === 'right',
42
+ }) }, { children: component })));
43
+ }
44
+ export function Output(node) {
45
+ // Note, NodeRenderer's can't have hooks in it directly!
46
+ return (_jsx(JupyterOutput, { nodeKey: node.key, nodeType: node.type, identifier: node.identifier, align: node.align, data: node.data }, node.key));
43
47
  }
@@ -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;AAM/D,eAAO,MAAM,mBAAmB,aAA+B,CAAC;AAEhE,eAAO,MAAM,iBAAiB,aAMb,CAAC;AAElB,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,eA2BvC"}
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;AAM/D,eAAO,MAAM,mBAAmB,aAA+B,CAAC;AAEhE,eAAO,MAAM,iBAAiB,aAMb,CAAC;AAElB,wBAAgB,iBAAiB,CAC/B,OAAO,EAAE,cAAc,EAAE,EACzB,iBAAiB,EAAE,GAAG,CAAC,MAAM,CAAC,EAC9B,eAAe,EAAE,GAAG,CAAC,MAAM,CAAC,WAY7B;AA0CD,wBAAgB,MAAM,CAAC,IAAI,EAAE,WAAW,eAYvC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@myst-theme/jupyter",
3
- "version": "0.2.5",
3
+ "version": "0.2.7",
4
4
  "main": "dist/cjs/index.js",
5
5
  "module": "dist/esm/index.js",
6
6
  "types": "dist/types/index.d.ts",
@@ -21,7 +21,7 @@
21
21
  "dependencies": {
22
22
  "@headlessui/react": "^1.7.13",
23
23
  "@heroicons/react": "^2.0.13",
24
- "@myst-theme/providers": "^0.2.5",
24
+ "@myst-theme/providers": "^0.2.7",
25
25
  "ansi-to-react": "^6.1.6",
26
26
  "buffer": "^6.0.3",
27
27
  "classnames": "^2.3.2",