@myst-theme/jupyter 0.6.0 → 0.7.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.
@@ -1 +1 @@
1
- {"version":3,"file":"leaf.d.ts","sourceRoot":"","sources":["../../src/execute/leaf.tsx"],"names":[],"mappings":";AACA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AACvD,OAAO,KAAK,EAAE,QAAQ,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAY9D,wBAAgB,YAAY,CAAC,EAC3B,IAAI,EACJ,GAAG,EACH,QAAQ,GACT,EAAE;IACD,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,EAAE,KAAK,CAAC,QAAQ,CAAC,kBAAkB,CAAC,CAAC;CAC9C,kDAkBA;AAED,wBAAgB,eAAe,CAAC,EAC9B,QAAQ,EACR,YAAY,EACZ,MAAM,EACN,KAAK,EACL,QAAQ,GACT,EAAE;IACD,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,MAAM,EAAE,QAAQ,CAAC;IACjB,KAAK,EAAE,iBAAiB,CAAC;IACzB,QAAQ,EAAE,KAAK,CAAC,QAAQ,CAAC,kBAAkB,CAAC,CAAC;CAC9C,QAiDA;AAED,wBAAgB,cAAc,CAAC,EAC7B,QAAQ,EACR,YAAY,EACZ,QAAQ,EACR,KAAK,EACL,QAAQ,GACT,EAAE;IACD,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAC;IAC7B,KAAK,EAAE,iBAAiB,CAAC;IACzB,QAAQ,EAAE,KAAK,CAAC,QAAQ,CAAC,kBAAkB,CAAC,CAAC;CAC9C,QAmFA;AAED,wBAAgB,aAAa,CAAC,EAC5B,KAAK,EACL,QAAQ,GACT,EAAE;IACD,KAAK,EAA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,EAAE,KAAK,CAAC,QAAQ,CAAC,kBAAkB,CAAC,CAAC;CAC9C,QA4BA"}
@@ -49,7 +49,7 @@ export function NotebookBuilder({ pageSlug, notebookSlug, idkmap, state, dispatc
49
49
  }, [core, config, pageSlug, notebookSlug, scopeHasNotebook, lock, plotly]);
50
50
  // TODO find a way to check if the all the notebooks are built and do a single dispatch
51
51
  // potentilly use a move the loop down into this component
52
- const allNotebooksAreBuilt = selectAreAllNotebookScopesBuilt(state, pageSlug);
52
+ const allNotebooksAreBuilt = plotly && selectAreAllNotebookScopesBuilt(state, pageSlug);
53
53
  useEffect(() => {
54
54
  if (!allNotebooksAreBuilt)
55
55
  return;
@@ -64,7 +64,7 @@ export function SessionStarter({ pageSlug, notebookSlug, location, state, dispat
64
64
  const lock = useRef(false); // TODO can be removed if we solve double render from provider
65
65
  const scope = (_a = state.pages[pageSlug]) === null || _a === void 0 ? void 0 : _a.scopes[notebookSlug];
66
66
  useEffect(() => {
67
- if (!core || !server || scope.session || lock.current)
67
+ if (!core || !server || (scope === null || scope === void 0 ? void 0 : scope.session) || lock.current)
68
68
  return;
69
69
  lock.current = true;
70
70
  console.debug(`Jupyter: Starting session for ${pageSlug}-${notebookSlug} at ${location}`);
@@ -121,7 +121,7 @@ export function SessionStarter({ pageSlug, notebookSlug, location, state, dispat
121
121
  });
122
122
  }
123
123
  });
124
- }, [core, config, pageSlug, notebookSlug, lock]);
124
+ }, [core, config, scope, pageSlug, notebookSlug, lock]);
125
125
  // TODO avoid multiple dispatch?
126
126
  const allSessionsAreStarted = selectAreAllSessionsStarted(state, pageSlug);
127
127
  useEffect(() => {
package/dist/plotly.js CHANGED
@@ -19,8 +19,9 @@ export function isPlotly(outputs) {
19
19
  return outputs.some((output) => { var _a; return Object.keys((_a = output.data) !== null && _a !== void 0 ? _a : []).includes(PLOTLY_MIMETYPE); });
20
20
  }
21
21
  export function usePlotlyPassively(rendermime, outputs) {
22
- const [loaded, setLoaded] = useState(false);
23
22
  const isPlotlyOutput = isPlotly(outputs);
23
+ // skip loading for non plotly outputs
24
+ const [loaded, setLoaded] = useState(!isPlotlyOutput);
24
25
  useEffect(() => {
25
26
  if (loaded || !isPlotlyOutput)
26
27
  return;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@myst-theme/jupyter",
3
- "version": "0.6.0",
3
+ "version": "0.7.0",
4
4
  "type": "module",
5
5
  "exports": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -25,7 +25,7 @@
25
25
  "@curvenote/ansi-to-react": "^7.0.0",
26
26
  "@headlessui/react": "^1.7.15",
27
27
  "@heroicons/react": "^2.0.18",
28
- "@myst-theme/providers": "^0.6.0",
28
+ "@myst-theme/providers": "^0.7.0",
29
29
  "@scienceicons/react": "^0.0.6",
30
30
  "buffer": "^6.0.3",
31
31
  "classnames": "^2.3.2",
@@ -35,14 +35,14 @@
35
35
  "myst-frontmatter": "^1.1.18",
36
36
  "myst-spec": "^0.0.4",
37
37
  "myst-spec-ext": "^1.1.18",
38
- "myst-to-react": "^0.6.0",
38
+ "myst-to-react": "^0.7.0",
39
39
  "nanoid": "^4.0.2",
40
40
  "nbtx": "^0.2.3",
41
41
  "react-syntax-highlighter": "^15.5.0",
42
42
  "swr": "^2.1.5",
43
- "thebe-core": "^0.4.5",
44
- "thebe-lite": "^0.4.5",
45
- "thebe-react": "^0.4.5",
43
+ "thebe-core": "^0.4.6",
44
+ "thebe-lite": "^0.4.6",
45
+ "thebe-react": "^0.4.6",
46
46
  "unist-util-select": "^4.0.3"
47
47
  },
48
48
  "peerDependencies": {