@myst-theme/jupyter 0.3.7 → 0.4.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.
Files changed (117) hide show
  1. package/dist/cjs/BinderBadge.js +1 -1
  2. package/dist/cjs/ErrorTray.d.ts +4 -4
  3. package/dist/cjs/ErrorTray.d.ts.map +1 -1
  4. package/dist/cjs/ErrorTray.js +11 -3
  5. package/dist/cjs/decoration.d.ts +11 -0
  6. package/dist/cjs/decoration.d.ts.map +1 -0
  7. package/dist/cjs/decoration.js +39 -0
  8. package/dist/cjs/embed.d.ts +3 -2
  9. package/dist/cjs/embed.d.ts.map +1 -1
  10. package/dist/cjs/embed.js +8 -18
  11. package/dist/cjs/execute/actions.d.ts +1 -1
  12. package/dist/cjs/execute/actions.d.ts.map +1 -1
  13. package/dist/cjs/execute/busy.d.ts +24 -2
  14. package/dist/cjs/execute/busy.d.ts.map +1 -1
  15. package/dist/cjs/execute/busy.js +86 -9
  16. package/dist/cjs/execute/hooks.d.ts +5 -2
  17. package/dist/cjs/execute/hooks.d.ts.map +1 -1
  18. package/dist/cjs/execute/hooks.js +19 -10
  19. package/dist/cjs/execute/provider.d.ts +7 -2
  20. package/dist/cjs/execute/provider.d.ts.map +1 -1
  21. package/dist/cjs/execute/provider.js +5 -3
  22. package/dist/cjs/execute/reducer.js +2 -2
  23. package/dist/cjs/execute/selectors.d.ts +0 -1
  24. package/dist/cjs/execute/selectors.d.ts.map +1 -1
  25. package/dist/cjs/execute/selectors.js +9 -14
  26. package/dist/cjs/execute/types.d.ts +1 -1
  27. package/dist/cjs/execute/types.d.ts.map +1 -1
  28. package/dist/cjs/execute/utils.d.ts.map +1 -1
  29. package/dist/cjs/execute/utils.js +9 -8
  30. package/dist/cjs/figure.d.ts +5 -0
  31. package/dist/cjs/figure.d.ts.map +1 -0
  32. package/dist/cjs/figure.js +20 -0
  33. package/dist/cjs/index.d.ts +2 -0
  34. package/dist/cjs/index.d.ts.map +1 -1
  35. package/dist/cjs/index.js +2 -0
  36. package/dist/cjs/jupyter.d.ts.map +1 -1
  37. package/dist/cjs/jupyter.js +20 -6
  38. package/dist/cjs/output.d.ts +9 -1
  39. package/dist/cjs/output.d.ts.map +1 -1
  40. package/dist/cjs/output.js +17 -9
  41. package/dist/cjs/providers.d.ts +7 -2
  42. package/dist/cjs/providers.d.ts.map +1 -1
  43. package/dist/cjs/providers.js +8 -3
  44. package/dist/cjs/utils.js +2 -2
  45. package/dist/esm/BinderBadge.js +1 -1
  46. package/dist/esm/ErrorTray.d.ts +4 -4
  47. package/dist/esm/ErrorTray.d.ts.map +1 -1
  48. package/dist/esm/ErrorTray.js +11 -3
  49. package/dist/esm/decoration.d.ts +11 -0
  50. package/dist/esm/decoration.d.ts.map +1 -0
  51. package/dist/esm/decoration.js +31 -0
  52. package/dist/esm/embed.d.ts +3 -2
  53. package/dist/esm/embed.d.ts.map +1 -1
  54. package/dist/esm/embed.js +9 -19
  55. package/dist/esm/execute/actions.d.ts +1 -1
  56. package/dist/esm/execute/actions.d.ts.map +1 -1
  57. package/dist/esm/execute/busy.d.ts +24 -2
  58. package/dist/esm/execute/busy.d.ts.map +1 -1
  59. package/dist/esm/execute/busy.js +84 -8
  60. package/dist/esm/execute/hooks.d.ts +5 -2
  61. package/dist/esm/execute/hooks.d.ts.map +1 -1
  62. package/dist/esm/execute/hooks.js +18 -9
  63. package/dist/esm/execute/provider.d.ts +7 -2
  64. package/dist/esm/execute/provider.d.ts.map +1 -1
  65. package/dist/esm/execute/provider.js +4 -2
  66. package/dist/esm/execute/reducer.js +1 -1
  67. package/dist/esm/execute/selectors.d.ts +0 -1
  68. package/dist/esm/execute/selectors.d.ts.map +1 -1
  69. package/dist/esm/execute/selectors.js +7 -11
  70. package/dist/esm/execute/types.d.ts +1 -1
  71. package/dist/esm/execute/types.d.ts.map +1 -1
  72. package/dist/esm/execute/utils.d.ts.map +1 -1
  73. package/dist/esm/execute/utils.js +9 -8
  74. package/dist/esm/figure.d.ts +5 -0
  75. package/dist/esm/figure.d.ts.map +1 -0
  76. package/dist/esm/figure.js +16 -0
  77. package/dist/esm/index.d.ts +2 -0
  78. package/dist/esm/index.d.ts.map +1 -1
  79. package/dist/esm/index.js +2 -0
  80. package/dist/esm/jupyter.d.ts.map +1 -1
  81. package/dist/esm/jupyter.js +16 -5
  82. package/dist/esm/output.d.ts +9 -1
  83. package/dist/esm/output.d.ts.map +1 -1
  84. package/dist/esm/output.js +15 -8
  85. package/dist/esm/providers.d.ts +7 -2
  86. package/dist/esm/providers.d.ts.map +1 -1
  87. package/dist/esm/providers.js +6 -2
  88. package/dist/esm/utils.js +2 -2
  89. package/dist/types/ErrorTray.d.ts +4 -4
  90. package/dist/types/ErrorTray.d.ts.map +1 -1
  91. package/dist/types/decoration.d.ts +11 -0
  92. package/dist/types/decoration.d.ts.map +1 -0
  93. package/dist/types/embed.d.ts +3 -2
  94. package/dist/types/embed.d.ts.map +1 -1
  95. package/dist/types/execute/actions.d.ts +1 -1
  96. package/dist/types/execute/actions.d.ts.map +1 -1
  97. package/dist/types/execute/busy.d.ts +24 -2
  98. package/dist/types/execute/busy.d.ts.map +1 -1
  99. package/dist/types/execute/hooks.d.ts +5 -2
  100. package/dist/types/execute/hooks.d.ts.map +1 -1
  101. package/dist/types/execute/provider.d.ts +7 -2
  102. package/dist/types/execute/provider.d.ts.map +1 -1
  103. package/dist/types/execute/selectors.d.ts +0 -1
  104. package/dist/types/execute/selectors.d.ts.map +1 -1
  105. package/dist/types/execute/types.d.ts +1 -1
  106. package/dist/types/execute/types.d.ts.map +1 -1
  107. package/dist/types/execute/utils.d.ts.map +1 -1
  108. package/dist/types/figure.d.ts +5 -0
  109. package/dist/types/figure.d.ts.map +1 -0
  110. package/dist/types/index.d.ts +2 -0
  111. package/dist/types/index.d.ts.map +1 -1
  112. package/dist/types/jupyter.d.ts.map +1 -1
  113. package/dist/types/output.d.ts +9 -1
  114. package/dist/types/output.d.ts.map +1 -1
  115. package/dist/types/providers.d.ts +7 -2
  116. package/dist/types/providers.d.ts.map +1 -1
  117. package/package.json +11 -9
@@ -1,8 +1,10 @@
1
1
  import { Embed } from './embed';
2
2
  import { Output } from './output';
3
+ import { Figure } from './figure';
3
4
  declare const OUTPUT_RENDERERS: {
4
5
  output: typeof Output;
5
6
  embed: typeof Embed;
7
+ container: typeof Figure;
6
8
  };
7
9
  export * from './BinderBadge';
8
10
  export * from './ErrorTray';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC,QAAA,MAAM,gBAAgB;;;CAGrB,CAAC;AAEF,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,wBAAwB,CAAC;AACvC,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAE3B,eAAe,gBAAgB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC,QAAA,MAAM,gBAAgB;;;;CAIrB,CAAC;AAEF,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,wBAAwB,CAAC;AACvC,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAE3B,eAAe,gBAAgB,CAAC"}
package/dist/esm/index.js CHANGED
@@ -1,8 +1,10 @@
1
1
  import { Embed } from './embed';
2
2
  import { Output } from './output';
3
+ import { Figure } from './figure';
3
4
  const OUTPUT_RENDERERS = {
4
5
  output: Output,
5
6
  embed: Embed,
7
+ container: Figure,
6
8
  };
7
9
  export * from './BinderBadge';
8
10
  export * from './ErrorTray';
@@ -1 +1 @@
1
- {"version":3,"file":"jupyter.d.ts","sourceRoot":"","sources":["../../src/jupyter.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAsC,MAAM,OAAO,CAAC;AAG3D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,MAAM,CAAC;AAmE3C,eAAO,MAAM,cAAc;QACD,MAAM;aAAW,cAAc,EAAE;8CAmD1D,CAAC"}
1
+ {"version":3,"file":"jupyter.d.ts","sourceRoot":"","sources":["../../src/jupyter.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAsC,MAAM,OAAO,CAAC;AAG3D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,MAAM,CAAC;AAsF3C,eAAO,MAAM,cAAc;QACD,MAAM;aAAW,cAAc,EAAE;8CAwD1D,CAAC"}
@@ -3,17 +3,22 @@ import React, { useEffect, useRef, useState } from 'react';
3
3
  import { useFetchAnyTruncatedContent } from './hooks';
4
4
  import { convertToIOutputs } from 'nbtx';
5
5
  import { fetchAndEncodeOutputImages } from './convertImages';
6
- import { SourceFileKind } from 'myst-common';
6
+ import { SourceFileKind } from 'myst-spec-ext';
7
7
  import { useXRefState } from '@myst-theme/providers';
8
8
  import { useThebeLoader } from 'thebe-react';
9
9
  import { useCellExecution } from './execute';
10
+ import { usePlaceholder } from './decoration';
11
+ import { MyST } from 'myst-to-react';
12
+ import classNames from 'classnames';
10
13
  function ActiveOutputRenderer({ id, initialData, core, }) {
14
+ var _a;
11
15
  const exec = useCellExecution(id);
16
+ const placeholder = usePlaceholder();
12
17
  const ref = useRef(null);
13
18
  useEffect(() => {
14
19
  var _a, _b, _c;
15
20
  if (!ref.current || !(exec === null || exec === void 0 ? void 0 : exec.cell)) {
16
- console.debug(`Jupyter: No cell ref available for cell ${(_a = exec === null || exec === void 0 ? void 0 : exec.cell) === null || _a === void 0 ? void 0 : _a.id}`);
21
+ console.debug(`Jupyter: No cell ref available for cell ${id}:${(_a = exec === null || exec === void 0 ? void 0 : exec.cell) === null || _a === void 0 ? void 0 : _a.id}`);
17
22
  return;
18
23
  }
19
24
  const verb = exec.cell.isAttachedToDOM ? 'reattaching' : 'attaching';
@@ -24,12 +29,14 @@ function ActiveOutputRenderer({ id, initialData, core, }) {
24
29
  });
25
30
  exec.cell.attachToDOM(ref.current);
26
31
  if (exec.cell.executionCount == null) {
27
- exec.cell.initOutputs((_c = core === null || core === void 0 ? void 0 : core.stripWidgets(initialData)) !== null && _c !== void 0 ? _c : initialData);
32
+ exec.cell.initOutputs((_c = core === null || core === void 0 ? void 0 : core.stripWidgets(initialData, true, placeholder ? () => '' : undefined)) !== null && _c !== void 0 ? _c : initialData);
28
33
  }
29
34
  }, [ref === null || ref === void 0 ? void 0 : ref.current, exec === null || exec === void 0 ? void 0 : exec.cell]);
30
- return _jsx("div", { ref: ref, "data-thebe-active-ref": "true", className: "relative" });
35
+ const executed = ((_a = exec === null || exec === void 0 ? void 0 : exec.cell) === null || _a === void 0 ? void 0 : _a.executionCount) != null;
36
+ console.debug(`Jupyter: Cell ${id} executed: ${executed}; Show output: ${executed || !placeholder}`);
37
+ return (_jsxs("div", { children: [_jsx("div", { ref: ref, "data-thebe-active-ref": "true", className: classNames('relative', { 'invisible h-0': !executed && placeholder }) }), placeholder && !executed && _jsx(MyST, { ast: placeholder })] }));
31
38
  }
32
- function PassiveOutputRenderer({ id, data, core, kind, }) {
39
+ function PassiveOutputRenderer({ id, data, core, }) {
33
40
  const cell = useRef(new core.PassiveCellRenderer(id, undefined, undefined));
34
41
  const ref = useRef(null);
35
42
  useEffect(() => {
@@ -47,6 +54,7 @@ export const JupyterOutputs = React.memo(({ id, outputs }) => {
47
54
  const { data, error } = useFetchAnyTruncatedContent(outputs);
48
55
  const [fullOutputs, setFullOutputs] = useState(null);
49
56
  const exec = useCellExecution(id);
57
+ const placeholder = usePlaceholder();
50
58
  useEffect(() => {
51
59
  if (core)
52
60
  return;
@@ -67,5 +75,8 @@ export const JupyterOutputs = React.memo(({ id, outputs }) => {
67
75
  if (!inCrossRef && (exec === null || exec === void 0 ? void 0 : exec.ready)) {
68
76
  return (_jsxs("div", { children: [!fullOutputs && _jsx("div", { className: "p-2.5", children: "Fetching full output data..." }), core && fullOutputs && (_jsx(ActiveOutputRenderer, { id: id, initialData: fullOutputs, core: core }, id))] }));
69
77
  }
78
+ if (placeholder) {
79
+ return _jsx(MyST, { ast: placeholder });
80
+ }
70
81
  return (_jsxs("div", { children: [!fullOutputs && _jsx("div", { className: "p-2.5", children: "Loading..." }), fullOutputs && core && (_jsx(PassiveOutputRenderer, { id: id, data: fullOutputs, core: core, kind: SourceFileKind.Notebook }))] }));
71
82
  });
@@ -3,5 +3,13 @@ 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
5
  export declare function allOutputsAreSafe(outputs: MinifiedOutput[], directOutputTypes: Set<string>, directMimeTypes: Set<string>): boolean;
6
- export declare function Output(node: GenericNode): import("react/jsx-runtime").JSX.Element;
6
+ export declare function JupyterOutput({ outputId, identifier, data, align, }: {
7
+ outputId: string;
8
+ identifier?: string;
9
+ data: MinifiedOutput[];
10
+ align?: 'left' | 'center' | 'right';
11
+ }): import("react/jsx-runtime").JSX.Element;
12
+ export declare function Output({ node }: {
13
+ node: GenericNode;
14
+ }): import("react/jsx-runtime").JSX.Element;
7
15
  //# 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,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;AA6CD,wBAAgB,MAAM,CAAC,IAAI,EAAE,WAAW,2CAYvC"}
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,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,aAAa,CAAC,EAC5B,QAAQ,EACR,UAAU,EACV,IAAI,EACJ,KAAK,GACN,EAAE;IACD,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,cAAc,EAAE,CAAC;IACvB,KAAK,CAAC,EAAE,MAAM,GAAG,QAAQ,GAAG,OAAO,CAAC;CACrC,2CAqCA;AAED,wBAAgB,MAAM,CAAC,EAAE,IAAI,EAAE,EAAE;IAAE,IAAI,EAAE,WAAW,CAAA;CAAE,2CASrD"}
@@ -5,6 +5,8 @@ import { SafeOutputs } from './safe';
5
5
  import { JupyterOutputs } from './jupyter';
6
6
  import { useMemo } from 'react';
7
7
  import { useCellExecution } from './execute';
8
+ import { usePlaceholder } from './decoration';
9
+ import { MyST } from 'myst-to-react';
8
10
  export const DIRECT_OUTPUT_TYPES = new Set(['stream', 'error']);
9
11
  export const DIRECT_MIME_TYPES = new Set([
10
12
  KnownCellOutputMimeTypes.TextPlain,
@@ -25,24 +27,29 @@ export function allOutputsAreSafe(outputs, directOutputTypes, directMimeTypes) {
25
27
  return flag && safe;
26
28
  }, true);
27
29
  }
28
- function JupyterOutput({ nodeKey, nodeType, identifier, data, align, }) {
29
- const { ready } = useCellExecution(nodeKey);
30
+ export function JupyterOutput({ outputId, identifier, data, align, }) {
31
+ const { ready } = useCellExecution(outputId);
30
32
  const outputs = data;
31
33
  const allSafe = useMemo(() => allOutputsAreSafe(outputs, DIRECT_OUTPUT_TYPES, DIRECT_MIME_TYPES), [outputs]);
34
+ const placeholder = usePlaceholder();
32
35
  let component;
33
36
  if (allSafe && !ready) {
34
- component = _jsx(SafeOutputs, { keyStub: nodeKey, outputs: outputs });
37
+ if (placeholder && (!outputs || outputs.length === 0)) {
38
+ if (placeholder) {
39
+ return _jsx(MyST, { ast: placeholder });
40
+ }
41
+ }
42
+ component = _jsx(SafeOutputs, { keyStub: outputId, outputs: outputs });
35
43
  }
36
44
  else {
37
- component = _jsx(JupyterOutputs, { id: nodeKey, outputs: outputs });
45
+ component = _jsx(JupyterOutputs, { id: outputId, outputs: outputs });
38
46
  }
39
- return (_jsx("figure", { id: identifier || undefined, "data-mdast-node-type": nodeType, "data-mdast-node-id": nodeKey, className: classNames('max-w-full overflow-visible m-0 group not-prose relative', {
47
+ return (_jsx("figure", { id: identifier || undefined, "data-mdast-node-id": outputId, className: classNames('max-w-full overflow-y-visible overflow-x-auto m-0 group not-prose relative', {
40
48
  'text-left': !align || align === 'left',
41
49
  'text-center': align === 'center',
42
50
  'text-right': align === 'right',
43
51
  }), children: component }));
44
52
  }
45
- export function Output(node) {
46
- // Note, NodeRenderer's can't have hooks in it directly!
47
- return (_jsx(JupyterOutput, { nodeKey: node.key, nodeType: node.type, identifier: node.identifier, align: node.align, data: node.data }, node.key));
53
+ export function Output({ node }) {
54
+ return (_jsx(JupyterOutput, { outputId: node.id, identifier: node.identifier, align: node.align, data: node.data }));
48
55
  }
@@ -1,4 +1,4 @@
1
- import type { SourceFileKind } from 'myst-common';
1
+ import type { SourceFileKind } from 'myst-spec-ext';
2
2
  import React from 'react';
3
3
  import type { Root } from 'mdast';
4
4
  export declare function useComputeOptions(): {
@@ -7,11 +7,16 @@ export declare function useComputeOptions(): {
7
7
  githubBadgeUrl?: undefined;
8
8
  binderBadgeUrl?: undefined;
9
9
  } | {
10
- canCompute: boolean;
11
10
  thebe: import("./utils").ExtendedCoreOptions | undefined;
12
11
  githubBadgeUrl: string | undefined;
13
12
  binderBadgeUrl: string | undefined;
13
+ canCompute?: undefined;
14
14
  };
15
+ export declare function useCanCompute(article: {
16
+ frontmatter: {
17
+ thebe?: boolean | Record<string, any>;
18
+ };
19
+ }): boolean;
15
20
  export declare function ConfiguredThebeServerProvider({ children }: React.PropsWithChildren): import("react/jsx-runtime").JSX.Element;
16
21
  export type PartialPage = {
17
22
  kind: SourceFileKind;
@@ -1 +1 @@
1
- {"version":3,"file":"providers.d.ts","sourceRoot":"","sources":["../../src/providers.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC;AAIlC,wBAAgB,iBAAiB;;;;;;;;;;EAwBhC;AAED,wBAAgB,6BAA6B,CAAC,EAAE,QAAQ,EAAE,EAAE,KAAK,CAAC,iBAAiB,2CAalF;AAED,MAAM,MAAM,WAAW,GAAG;IACxB,IAAI,EAAE,cAAc,CAAC;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,IAAI,CAAC;CACb,CAAC"}
1
+ {"version":3,"file":"providers.d.ts","sourceRoot":"","sources":["../../src/providers.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AACpD,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC;AAIlC,wBAAgB,iBAAiB;;;;;;;;;;EAuBhC;AAED,wBAAgB,aAAa,CAAC,OAAO,EAAE;IAAE,WAAW,EAAE;QAAE,KAAK,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;KAAE,CAAA;CAAE,WAGhG;AAED,wBAAgB,6BAA6B,CAAC,EAAE,QAAQ,EAAE,EAAE,KAAK,CAAC,iBAAiB,2CAalF;AAED,MAAM,MAAM,WAAW,GAAG;IACxB,IAAI,EAAE,cAAc,CAAC;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,IAAI,CAAC;CACb,CAAC"}
@@ -17,14 +17,18 @@ export function useComputeOptions() {
17
17
  const binderBadgeUrl = mainProject === null || mainProject === void 0 ? void 0 : mainProject.binder;
18
18
  const thebeOptions = thebeFrontmatterToOptions(thebeFrontmatter, githubBadgeUrl, binderBadgeUrl);
19
19
  return {
20
- canCompute: thebeFrontmatter !== undefined && thebeFrontmatter !== false,
21
- thebe: thebeOptions,
20
+ thebe: thebeFrontmatter ? thebeOptions : undefined,
22
21
  githubBadgeUrl,
23
22
  binderBadgeUrl,
24
23
  };
25
24
  };
26
25
  return React.useMemo(makeOptions, [config]);
27
26
  }
27
+ export function useCanCompute(article) {
28
+ var _a;
29
+ const { thebe } = useComputeOptions();
30
+ return !!thebe && ((_a = article.frontmatter) === null || _a === void 0 ? void 0 : _a.thebe) !== false;
31
+ }
28
32
  export function ConfiguredThebeServerProvider({ children }) {
29
33
  const { thebe } = useComputeOptions();
30
34
  return (_jsx(ThebeServerProvider, { connect: false, options: thebe, useBinder: thebe === null || thebe === void 0 ? void 0 : thebe.useBinder, useJupyterLite: thebe === null || thebe === void 0 ? void 0 : thebe.useJupyterLite, children: children }));
package/dist/esm/utils.js CHANGED
@@ -48,7 +48,7 @@ export function thebeFrontmatterToOptions(fm, githubBadgeUrl, binderBadgeUrl) {
48
48
  thebeOptions.savedSessionOptions = { enabled: false };
49
49
  }
50
50
  // handle thebe.local.*
51
- // as local OVERIDES other binder and server settings, handle these first
51
+ // as local OVERRIDES other binder and server settings, handle these first
52
52
  // TODO need to expose NODE_ENV somehow via a loader
53
53
  let NODE_ENV = 'development';
54
54
  if (typeof window !== 'undefined') {
@@ -71,7 +71,7 @@ export function thebeFrontmatterToOptions(fm, githubBadgeUrl, binderBadgeUrl) {
71
71
  return thebeOptions;
72
72
  // else just fall through & return - TODO return early?
73
73
  }
74
- // handle additional optons
74
+ // handle additional options
75
75
  if (kernelName) {
76
76
  thebeOptions.kernelOptions = {
77
77
  kernelName: kernelName,
@@ -1,5 +1,5 @@
1
- import type { IThebeNotebookError } from 'thebe-react';
2
- export declare function ErrorTray({ errors }: {
3
- errors: IThebeNotebookError[];
4
- }): import("react/jsx-runtime").JSX.Element;
1
+ export declare function ErrorTray({ pageSlug, index }: {
2
+ pageSlug: string;
3
+ index?: string;
4
+ }): import("react/jsx-runtime").JSX.Element | null;
5
5
  //# sourceMappingURL=ErrorTray.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ErrorTray.d.ts","sourceRoot":"","sources":["../../src/ErrorTray.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAgDvD,wBAAgB,SAAS,CAAC,EAAE,MAAM,EAAE,EAAE;IAAE,MAAM,EAAE,mBAAmB,EAAE,CAAA;CAAE,2CAStE"}
1
+ {"version":3,"file":"ErrorTray.d.ts","sourceRoot":"","sources":["../../src/ErrorTray.tsx"],"names":[],"mappings":"AAmDA,wBAAgB,SAAS,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,EAAE;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,kDAkBlF"}
@@ -0,0 +1,11 @@
1
+ import React from 'react';
2
+ import type { GenericNode } from 'myst-common';
3
+ export declare function usePlaceholder(): GenericNode | undefined;
4
+ export declare function OutputDecoration({ outputId, placeholder, children, title, url, }: {
5
+ outputId: string;
6
+ placeholder?: GenericNode;
7
+ children?: React.ReactNode;
8
+ title?: string;
9
+ url?: string;
10
+ }): import("react/jsx-runtime").JSX.Element;
11
+ //# sourceMappingURL=decoration.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"decoration.d.ts","sourceRoot":"","sources":["../../src/decoration.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAqB/C,wBAAgB,cAAc,4BAG7B;AAED,wBAAgB,gBAAgB,CAAC,EAC/B,QAAQ,EACR,WAAW,EACX,QAAQ,EACR,KAA0B,EAC1B,GAAG,GACJ,EAAE;IACD,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,GAAG,CAAC,EAAE,MAAM,CAAC;CACd,2CAyDA"}
@@ -1,4 +1,5 @@
1
- /// <reference types="react" />
2
1
  import { type GenericNode } from 'myst-common';
3
- export declare function Embed(node: GenericNode, children: React.ReactNode): import("react/jsx-runtime").JSX.Element;
2
+ export declare function Embed({ node }: {
3
+ node: GenericNode;
4
+ }): import("react/jsx-runtime").JSX.Element;
4
5
  //# sourceMappingURL=embed.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"embed.d.ts","sourceRoot":"","sources":["../../src/embed.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAkB,KAAK,WAAW,EAAE,MAAM,aAAa,CAAC;AAwD/D,wBAAgB,KAAK,CAAC,IAAI,EAAE,WAAW,EAAE,QAAQ,EAAE,KAAK,CAAC,SAAS,2CAajE"}
1
+ {"version":3,"file":"embed.d.ts","sourceRoot":"","sources":["../../src/embed.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,aAAa,CAAC;AAK/C,wBAAgB,KAAK,CAAC,EAAE,IAAI,EAAE,EAAE;IAAE,IAAI,EAAE,WAAW,CAAA;CAAE,2CAkBpD"}
@@ -1,4 +1,4 @@
1
- import type { Dependency, SourceFileKind } from 'myst-common';
1
+ import type { SourceFileKind, Dependency } from 'myst-spec-ext';
2
2
  import type { Root } from 'mdast';
3
3
  import type { BuildStatus, Computable } from './types';
4
4
  import type { IRenderMimeRegistry, ThebeNotebook, ThebeSession } from 'thebe-core';
@@ -1 +1 @@
1
- {"version":3,"file":"actions.d.ts","sourceRoot":"","sources":["../../../src/execute/actions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC9D,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC;AAClC,OAAO,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACvD,OAAO,KAAK,EAAE,mBAAmB,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAEnF,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,IAAI,eAAe,CAQ9E;AAED,UAAU,eAAe;IACvB,IAAI,EAAE,cAAc,CAAC;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,IAAI,CAAC;IACZ,YAAY,EAAE,UAAU,EAAE,CAAC;IAC3B,WAAW,EAAE,UAAU,EAAE,CAAC;CAC3B;AAED,wBAAgB,aAAa,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,IAAI,WAAW,CAEtE;AAED,UAAU,WAAW;IACnB,IAAI,EAAE,MAAM,CAAC;CACd;AAED,wBAAgB,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AkB,CAKpF;AAED,UAAU,kBAAkB;IAC1B,aAAa,EAAE,MAAM,CAAC;IACtB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,IAAI,eAAe,CAG9E;AAED,UAAU,eAAe;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,IAAI,CAAC;CACb;AAED,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,IAAI,kBAAkB,CAQpF;AAED,UAAU,kBAAkB;IAC1B,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,aAAa,CAAC;IACxB,UAAU,EAAE,mBAAmB,CAAC;CACjC;AAED,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,IAAI,iBAAiB,CAOlF;AAED,UAAU,iBAAiB;IACzB,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,YAAY,CAAC;CACvB;AAED,MAAM,WAAW,kBAAkB;IACjC,IAAI,EACA,UAAU,GACV,eAAe,GACf,cAAc,GACd,aAAa,GACb,WAAW,GACX,cAAc,GACd,aAAa,GACb,qBAAqB,GACrB,qBAAqB,CAAC;IAC1B,OAAO,EACH,eAAe,GACf,WAAW,GACX,iBAAiB,GACjB,kBAAkB,GAClB,eAAe,GACf,kBAAkB,GAClB,iBAAiB,CAAC;CACvB"}
@@ -1,4 +1,5 @@
1
1
  import React from 'react';
2
+ import type { IThebeNotebookError } from 'thebe-react';
2
3
  export type BusyKind = 'execute' | 'reset';
3
4
  export interface BusyScopeState {
4
5
  execute: {
@@ -15,6 +16,11 @@ export interface BusyScopeState {
15
16
  };
16
17
  };
17
18
  };
19
+ error: {
20
+ [pageSlug: string]: {
21
+ [notebookSlug: string]: IThebeNotebookError[];
22
+ };
23
+ };
18
24
  }
19
25
  export interface BusyScopeContext {
20
26
  state: BusyScopeState;
@@ -37,9 +43,14 @@ export interface NotebookPayload {
37
43
  cellIds: string[];
38
44
  kind: BusyKind;
39
45
  }
46
+ export interface ErrorPayload {
47
+ pageSlug: string;
48
+ notebookSlug: string;
49
+ errors?: IThebeNotebookError[];
50
+ }
40
51
  type BusyScopeAction = {
41
- type: 'SET_CELL_BUSY' | 'CLEAR_CELL_BUSY' | 'SET_NOTEBOOK_BUSY' | 'CLEAR_NOTEBOOK_BUSY';
42
- payload: SlugPayload | CellPayload | NotebookPayload;
52
+ type: 'SET_CELL_BUSY' | 'CLEAR_CELL_BUSY' | 'SET_NOTEBOOK_BUSY' | 'CLEAR_NOTEBOOK_BUSY' | 'SET_ERROR' | 'CLEAR_ERROR';
53
+ payload: SlugPayload | CellPayload | NotebookPayload | ErrorPayload;
43
54
  };
44
55
  export declare function reducer(state: BusyScopeState, action: BusyScopeAction): BusyScopeState;
45
56
  export declare function BusyScopeProvider({ children }: React.PropsWithChildren): import("react/jsx-runtime").JSX.Element;
@@ -51,6 +62,17 @@ export declare function useBusyScope(): {
51
62
  clearCell: (pageSlug: string, notebookSlug: string, cellId: string, kind: BusyKind) => void;
52
63
  setNotebook: (pageSlug: string, notebookSlug: string, cellIds: string[], kind: BusyKind) => void;
53
64
  clearNotebook: (pageSlug: string, notebookSlug: string, kind: BusyKind) => void;
65
+ setError: (pageSlug: string, notebookSlug: string, errors: IThebeNotebookError[]) => void;
66
+ clearError: (pageSlug: string, notebookSlug: string) => void;
67
+ };
68
+ interface ErrorItem {
69
+ pageSlug: string;
70
+ notebookSlug: string;
71
+ errors: IThebeNotebookError[];
72
+ }
73
+ export declare function useBusyErrors(pageSlug: string): {
74
+ items: ErrorItem[] | undefined;
75
+ clearErrors: () => void;
54
76
  };
55
77
  export declare function selectCellIsBusy(state: BusyScopeState, pageSlug: string, notebookSlug: string, cellId: string, kind: BusyKind): boolean;
56
78
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"busy.d.ts","sour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;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,WAEvF"}
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import type { IdOrKey } from './types';
3
3
  import type { IThebeCell } from 'thebe-core';
4
- import { SourceFileKind } from 'myst-common';
4
+ import { SourceFileKind } from 'myst-spec-ext';
5
5
  export declare function useExecutionScope({ clearOutputsOnExecute, }?: {
6
6
  clearOutputsOnExecute?: boolean;
7
7
  }): {
@@ -10,6 +10,7 @@ export declare function useExecutionScope({ clearOutputsOnExecute, }?: {
10
10
  clearAll: (pageSlug: string) => void;
11
11
  resetAll: (pageSlug: string) => void;
12
12
  execute: (slug: string) => void;
13
+ canCompute: boolean;
13
14
  slug: string;
14
15
  state: import("./types").ExecuteScopeState;
15
16
  dispatch: React.Dispatch<import("./actions").ExecuteScopeAction>;
@@ -31,6 +32,7 @@ export declare function useNotebookExecution(id: IdOrKey, clearOutputsOnExecute?
31
32
  notebookIsResetting: boolean;
32
33
  notebookIsBusy: boolean;
33
34
  executionCount: number | null | undefined;
35
+ canCompute: boolean;
34
36
  slug: string;
35
37
  state: import("./types").ExecuteScopeState;
36
38
  dispatch: React.Dispatch<import("./actions").ExecuteScopeAction>;
@@ -42,7 +44,8 @@ export declare function useNotebookExecution(id: IdOrKey, clearOutputsOnExecute?
42
44
  * @param id
43
45
  * @returns
44
46
  */
45
- export declare function useCellExecution(id: IdOrKey): {
47
+ export declare function useCellExecution(id: IdOrKey, clearOutputsOnExecute?: boolean): {
48
+ canCompute: boolean;
46
49
  kind: SourceFileKind;
47
50
  ready: boolean;
48
51
  execute: () => void;
@@ -1 +1 @@
1
- {"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["../../../src/execute/hooks.ts"],"names":[],"mappings":"AAAA,OAAO,KAAsB,MAAM,OAAO,CAAC;AAC3C,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,SAAS,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B,oBAAoB,CAAC,EAAE,EAAE,OAAO;;;;EAc/C;AAED,wBAAgB,iBAAiB,YAOhC"}
@@ -1,10 +1,12 @@
1
- import type { Dependency } from 'myst-common';
2
- import { SourceFileKind } from 'myst-common';
1
+ import type { Dependency } from 'myst-spec-ext';
2
+ import { SourceFileKind } from 'myst-spec-ext';
3
3
  import type { Root } from 'mdast';
4
4
  import React from 'react';
5
5
  import type { ExecuteScopeAction } from './actions';
6
6
  import type { ExecuteScopeState, IdKeyMap } from './types';
7
+ import type { Thebe } from 'myst-frontmatter';
7
8
  export interface ExecuteScopeType {
9
+ canCompute: boolean;
8
10
  slug: string;
9
11
  state: ExecuteScopeState;
10
12
  dispatch: React.Dispatch<ExecuteScopeAction>;
@@ -16,6 +18,9 @@ type ArticleContents = {
16
18
  kind: SourceFileKind;
17
19
  mdast: Root;
18
20
  dependencies?: Dependency[];
21
+ frontmatter: {
22
+ thebe?: boolean | Thebe;
23
+ };
19
24
  };
20
25
  /**
21
26
  * The ExecuteScopeProvider is responsible for maintaining the state of the
@@ -1 +1 @@
1
- {"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../../../src/execute/provider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC;AAClC,OAAO,KAAwC,MAAM,OAAO,CAAC;AAE7D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AACpD,OAAO,KAAK,EAAc,iBAAiB,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAUvE,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,iBAAiB,CAAC;IACzB,QAAQ,EAAE,KAAK,CAAC,QAAQ,CAAC,kBAAkB,CAAC,CAAC;IAC7C,MAAM,EAAE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AY,CAAC,EAAE,UAAU,EAAE,CAAC;IAC5B,WAAW,EAAE;QAAE,KAAK,CAAC,EAAE,OAAO,GAAG,KAAK,CAAA;KAAE,CAAC;CAC1C,CAAC;AA8DF;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,EACnC,QAAQ,EACR,QAAQ,GACT,EAAE,KAAK,CAAC,iBAAiB,CAAC;IAAE,QAAQ,EAAE,eAAe,CAAA;CAAE,CAAC,2CAiGxD"}
@@ -22,5 +22,4 @@ export declare const selectSessionsToStart: (state: ExecuteScopeState) => {
22
22
  export declare function selectAreAllDependenciesReady(state: ExecuteScopeState, slug: string): boolean;
23
23
  export declare function selectAreAllNotebookScopesBuilt(state: ExecuteScopeState, slug: string): boolean;
24
24
  export declare function selectAreAllSessionsStarted(state: ExecuteScopeState, slug: string): boolean;
25
- export declare function selectNotebookCellIds(state: ExecuteScopeState, pageSlug: string, notebookSlug: string): string[];
26
25
  //# sourceMappingURL=selectors.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"selectors.d.ts","sourceRoot":"","sources":["../../../src/execute/selectors.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAE9D,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,iBAAiB,EAAE,QAAQ,EAAE,MAAM;;EAE5E;AAED,wBAAgB,qBAAqB,CACnC,KAAK,EAAE,iBAAiB,EACxB,QAAQ,EAAE,MAAM,EAChB,YAAY,EAAE,MAAM,oDAGrB;AAED,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,iBAAiB,EAAE,IAAI,EAAE,MAAM,WAExE;AAED,wBAAgB,6BAA6B,CAAC,KAAK,EAAE,iBAAiB,EAAE,IAAI,EAAE,MAAM,WAEnF;AAED,wBAAgB,gCAAgC,CAAC,KAAK,EAAE,iBAAiB,EAAE,IAAI,EAAE,MAAM,WAEtF;AAED,wBAAgB,0BAA0B,CAAC,KAAK,EAAE,iBA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AAgC,CAAC,KAAK,EAAE,iBAAiB,EAAE,IAAI,EAAE,MAAM,WAEtF;AAED,wBAAgB,0BAA0B,CAAC,KAAK,EAAE,iBAAiB,EAAE,IAAI,EAAE,MAAM,yBAEhF;AAQD,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,iBAAiB;UAKpD,MAAM;SACP,MAAM;IAclB;AAsBD,eAAO,MAAM,2BAA2B,UAlBvB,iBAAiB,KAAG;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,YAAY,EAAE,MAAM,CAAA;CAAE,EAkBS,CAAC;AACzF,eAAO,MAAM,qBAAqB,UAnBjB,iBAAiB,KAAG;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,YAAY,EAAE,MAAM,CAAA;CAAE,EAmBC,CAAC;AAEjF,wBAAgB,6BAA6B,CAAC,KAAK,EAAE,iBAAiB,EAAE,IAAI,EAAE,MAAM,WAInF;AAED,wBAAgB,+BAA+B,CAAC,KAAK,EAAE,iBAAiB,EAAE,IAAI,EAAE,MAAM,WAKrF;AAED,wBAAgB,2BAA2B,CAAC,KAAK,EAAE,iBAAiB,EAAE,IAAI,EAAE,MAAM,WAMjF"}
@@ -1,5 +1,5 @@
1
1
  import type { Root } from 'mdast';
2
- import type { SourceFileKind, Dependency } from 'myst-common';
2
+ import type { SourceFileKind, Dependency } from 'myst-spec-ext';
3
3
  import type { IRenderMimeRegistry, ThebeNotebook, ThebeSession } from 'thebe-core';
4
4
  export type BuildStatus = 'pending' | 'fetching' | 'build-notebooks' | 'wait-for-server' | 'start-session' | 'error';
5
5
  export type IdOrKey = string;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/execute/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC;AAClC,OAAO,KAAK,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAC9D,OAAO,KAAK,EAAE,mBAAmB,EAAE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F,MAAM,EAAE;QACN,CAAC,QAAQ,EAAE,MAAM,GAAG;YAClB,MAAM,EAAE,WAAW,CAAC;SACrB,CAAC;KACH,CAAC;CACH;AAED,MAAM,WAAW,cAAc;IAC7B,UAAU,EAAE,mBAAmB,CAAC;IAChC,QAAQ,EAAE,aAAa,CAAC;IACxB,OAAO,CAAC,EAAE,YAAY,CAAC;CACxB;AAED,MAAM,WAAW,UAAU;IACzB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,UAAU,CAAC;CACpB"}
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/execute/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,KAAK,EAAE,MAAM,EAAE,mBAAmB,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AACzE,OAAO,KAAK,EAAE,QAAQ,EAAkB,MAAM,SAAS,CAAC;AAExD;;;;;;;;;;;;;;;;;GAiBG;AAEH,wBAAgB,iBAAiB,CAC/B,IAAI,EAAE,SAAS,EACf,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,MAAM,EAChB,YAAY,EAAE,MAAM,EACpB,KAAK,EAAE,aAAa,EACpB,MAAM,EAAE,QAAQ,EAChB,UAAU,EAAE,mBAAmB,oDAoDhC"}
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/execute/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,KAAK,EAAE,MAAM,EAAE,mBAAmB,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AACzE,OAAO,KAAK,EAAE,QAAQ,EAAkB,MAAM,SAAS,CAAC;AAExD;;;;;;;;;;;;;;;;;GAiBG;AAEH,wBAAgB,iBAAiB,CAC/B,IAAI,EAAE,SAAS,EACf,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,MAAM,EAChB,YAAY,EAAE,MAAM,EACpB,KAAK,EAAE,aAAa,EACpB,MAAM,EAAE,QAAQ,EAChB,UAAU,EAAE,mBAAmB,oDAuDhC"}
@@ -0,0 +1,5 @@
1
+ import { type GenericNode } from 'myst-common';
2
+ export declare function Figure({ node }: {
3
+ node: GenericNode;
4
+ }): import("react/jsx-runtime").JSX.Element;
5
+ //# sourceMappingURL=figure.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"figure.d.ts","sourceRoot":"","sources":["../../src/figure.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,aAAa,CAAC;AAI/C,wBAAgB,MAAM,CAAC,EAAE,IAAI,EAAE,EAAE;IAAE,IAAI,EAAE,WAAW,CAAA;CAAE,2CAoBrD"}
@@ -1,8 +1,10 @@
1
1
  import { Embed } from './embed';
2
2
  import { Output } from './output';
3
+ import { Figure } from './figure';
3
4
  declare const OUTPUT_RENDERERS: {
4
5
  output: typeof Output;
5
6
  embed: typeof Embed;
7
+ container: typeof Figure;
6
8
  };
7
9
  export * from './BinderBadge';
8
10
  export * from './ErrorTray';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC,QAAA,MAAM,gBAAgB;;;CAGrB,CAAC;AAEF,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,wBAAwB,CAAC;AACvC,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAE3B,eAAe,gBAAgB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC,QAAA,MAAM,gBAAgB;;;;CAIrB,CAAC;AAEF,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,wBAAwB,CAAC;AACvC,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAE3B,eAAe,gBAAgB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"jupyter.d.ts","sourceRoot":"","sources":["../../src/jupyter.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAsC,MAAM,OAAO,CAAC;AAG3D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,MAAM,CAAC;AAmE3C,eAAO,MAAM,cAAc;QACD,MAAM;aAAW,cAAc,EAAE;8CAmD1D,CAAC"}
1
+ {"version":3,"file":"jupyter.d.ts","sourceRoot":"","sources":["../../src/jupyter.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAsC,MAAM,OAAO,CAAC;AAG3D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,MAAM,CAAC;AAsF3C,eAAO,MAAM,cAAc;QACD,MAAM;aAAW,cAAc,EAAE;8CAwD1D,CAAC"}
@@ -3,5 +3,13 @@ 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
5
  export declare function allOutputsAreSafe(outputs: MinifiedOutput[], directOutputTypes: Set<string>, directMimeTypes: Set<string>): boolean;
6
- export declare function Output(node: GenericNode): import("react/jsx-runtime").JSX.Element;
6
+ export declare function JupyterOutput({ outputId, identifier, data, align, }: {
7
+ outputId: string;
8
+ identifier?: string;
9
+ data: MinifiedOutput[];
10
+ align?: 'left' | 'center' | 'right';
11
+ }): import("react/jsx-runtime").JSX.Element;
12
+ export declare function Output({ node }: {
13
+ node: GenericNode;
14
+ }): import("react/jsx-runtime").JSX.Element;
7
15
  //# 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,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;AA6CD,wBAAgB,MAAM,CAAC,IAAI,EAAE,WAAW,2CAYvC"}
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,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,aAAa,CAAC,EAC5B,QAAQ,EACR,UAAU,EACV,IAAI,EACJ,KAAK,GACN,EAAE;IACD,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,cAAc,EAAE,CAAC;IACvB,KAAK,CAAC,EAAE,MAAM,GAAG,QAAQ,GAAG,OAAO,CAAC;CACrC,2CAqCA;AAED,wBAAgB,MAAM,CAAC,EAAE,IAAI,EAAE,EAAE;IAAE,IAAI,EAAE,WAAW,CAAA;CAAE,2CASrD"}
@@ -1,4 +1,4 @@
1
- import type { SourceFileKind } from 'myst-common';
1
+ import type { SourceFileKind } from 'myst-spec-ext';
2
2
  import React from 'react';
3
3
  import type { Root } from 'mdast';
4
4
  export declare function useComputeOptions(): {
@@ -7,11 +7,16 @@ export declare function useComputeOptions(): {
7
7
  githubBadgeUrl?: undefined;
8
8
  binderBadgeUrl?: undefined;
9
9
  } | {
10
- canCompute: boolean;
11
10
  thebe: import("./utils").ExtendedCoreOptions | undefined;
12
11
  githubBadgeUrl: string | undefined;
13
12
  binderBadgeUrl: string | undefined;
13
+ canCompute?: undefined;
14
14
  };
15
+ export declare function useCanCompute(article: {
16
+ frontmatter: {
17
+ thebe?: boolean | Record<string, any>;
18
+ };
19
+ }): boolean;
15
20
  export declare function ConfiguredThebeServerProvider({ children }: React.PropsWithChildren): import("react/jsx-runtime").JSX.Element;
16
21
  export type PartialPage = {
17
22
  kind: SourceFileKind;
@@ -1 +1 @@
1
- {"version":3,"file":"providers.d.ts","sourceRoot":"","sources":["../../src/providers.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC;AAIlC,wBAAgB,iBAAiB;;;;;;;;;;EAwBhC;AAED,wBAAgB,6BAA6B,CAAC,EAAE,QAAQ,EAAE,EAAE,KAAK,CAAC,iBAAiB,2CAalF;AAED,MAAM,MAAM,WAAW,GAAG;IACxB,IAAI,EAAE,cAAc,CAAC;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,IAAI,CAAC;CACb,CAAC"}
1
+ {"version":3,"file":"providers.d.ts","sourceRoot":"","sources":["../../src/providers.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AACpD,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC;AAIlC,wBAAgB,iBAAiB;;;;;;;;;;EAuBhC;AAED,wBAAgB,aAAa,CAAC,OAAO,EAAE;IAAE,WAAW,EAAE;QAAE,KAAK,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;KAAE,CAAA;CAAE,WAGhG;AAED,wBAAgB,6BAA6B,CAAC,EAAE,QAAQ,EAAE,EAAE,KAAK,CAAC,iBAAiB,2CAalF;AAED,MAAM,MAAM,WAAW,GAAG;IACxB,IAAI,EAAE,cAAc,CAAC;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,IAAI,CAAC;CACb,CAAC"}