@myst-theme/site 0.5.16 → 0.5.18
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/package.json +12 -12
- package/src/pages/Article.tsx +9 -5
- package/src/pages/Root.tsx +2 -11
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@myst-theme/site",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.18",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./src/index.ts",
|
|
6
6
|
"types": "./src/index.ts",
|
|
@@ -17,23 +17,23 @@
|
|
|
17
17
|
"dependencies": {
|
|
18
18
|
"@headlessui/react": "^1.7.15",
|
|
19
19
|
"@heroicons/react": "^2.0.18",
|
|
20
|
-
"@myst-theme/common": "^0.5.
|
|
21
|
-
"@myst-theme/diagrams": "^0.5.
|
|
22
|
-
"@myst-theme/frontmatter": "^0.5.
|
|
23
|
-
"@myst-theme/jupyter": "^0.5.
|
|
24
|
-
"@myst-theme/providers": "^0.5.
|
|
20
|
+
"@myst-theme/common": "^0.5.18",
|
|
21
|
+
"@myst-theme/diagrams": "^0.5.18",
|
|
22
|
+
"@myst-theme/frontmatter": "^0.5.18",
|
|
23
|
+
"@myst-theme/jupyter": "^0.5.18",
|
|
24
|
+
"@myst-theme/providers": "^0.5.18",
|
|
25
25
|
"@radix-ui/react-collapsible": "^1.0.3",
|
|
26
26
|
"classnames": "^2.3.2",
|
|
27
27
|
"lodash.throttle": "^4.1.1",
|
|
28
|
-
"myst-common": "^1.1.
|
|
29
|
-
"myst-config": "^1.1.
|
|
30
|
-
"myst-demo": "^0.5.
|
|
31
|
-
"myst-spec-ext": "^1.1.
|
|
32
|
-
"myst-to-react": "^0.5.
|
|
28
|
+
"myst-common": "^1.1.18",
|
|
29
|
+
"myst-config": "^1.1.18",
|
|
30
|
+
"myst-demo": "^0.5.18",
|
|
31
|
+
"myst-spec-ext": "^1.1.18",
|
|
32
|
+
"myst-to-react": "^0.5.18",
|
|
33
33
|
"nbtx": "^0.2.3",
|
|
34
34
|
"node-cache": "^5.1.2",
|
|
35
35
|
"node-fetch": "^2.6.11",
|
|
36
|
-
"thebe-react": "^0.3
|
|
36
|
+
"thebe-react": "^0.4.3",
|
|
37
37
|
"unist-util-select": "^4.0.1"
|
|
38
38
|
},
|
|
39
39
|
"peerDependencies": {
|
package/src/pages/Article.tsx
CHANGED
|
@@ -17,8 +17,8 @@ import {
|
|
|
17
17
|
BusyScopeProvider,
|
|
18
18
|
NotebookToolbar,
|
|
19
19
|
ConnectionStatusTray,
|
|
20
|
-
useCanCompute,
|
|
21
20
|
ErrorTray,
|
|
21
|
+
useComputeOptions,
|
|
22
22
|
} from '@myst-theme/jupyter';
|
|
23
23
|
import { FrontmatterBlock } from '@myst-theme/frontmatter';
|
|
24
24
|
import { extractKnownParts } from '../utils.js';
|
|
@@ -32,7 +32,7 @@ export const ArticlePage = React.memo(function ({
|
|
|
32
32
|
hide_all_footer_links?: boolean;
|
|
33
33
|
hideKeywords?: boolean;
|
|
34
34
|
}) {
|
|
35
|
-
const
|
|
35
|
+
const compute = useComputeOptions();
|
|
36
36
|
|
|
37
37
|
const { hide_title_block, hide_footer_links } = (article.frontmatter as any)?.options ?? {};
|
|
38
38
|
|
|
@@ -46,7 +46,7 @@ export const ArticlePage = React.memo(function ({
|
|
|
46
46
|
frontmatter={article.frontmatter}
|
|
47
47
|
>
|
|
48
48
|
<BusyScopeProvider>
|
|
49
|
-
<ExecuteScopeProvider contents={article}>
|
|
49
|
+
<ExecuteScopeProvider enable={compute?.enabled ?? false} contents={article}>
|
|
50
50
|
{!hide_title_block && (
|
|
51
51
|
<FrontmatterBlock
|
|
52
52
|
kind={article.kind}
|
|
@@ -54,8 +54,12 @@ export const ArticlePage = React.memo(function ({
|
|
|
54
54
|
className="pt-5 mb-8"
|
|
55
55
|
/>
|
|
56
56
|
)}
|
|
57
|
-
{
|
|
58
|
-
|
|
57
|
+
{compute?.enabled &&
|
|
58
|
+
compute.features.notebookCompute &&
|
|
59
|
+
article.kind === SourceFileKind.Notebook && <NotebookToolbar showLaunch />}
|
|
60
|
+
{compute?.enabled && article.kind === SourceFileKind.Article && (
|
|
61
|
+
<ErrorTray pageSlug={article.slug} />
|
|
62
|
+
)}
|
|
59
63
|
<div id="skip-to-article" />
|
|
60
64
|
<FrontmatterParts parts={parts} keywords={keywords} hideKeywords={hideKeywords} />
|
|
61
65
|
<ContentBlocks pageKind={article.kind} mdast={tree as GenericParent} />
|
package/src/pages/Root.tsx
CHANGED
|
@@ -16,8 +16,6 @@ import { DEFAULT_NAV_HEIGHT, renderers } from '../components/index.js';
|
|
|
16
16
|
import { Analytics } from '../seo/index.js';
|
|
17
17
|
import { Error404 } from './Error404.js';
|
|
18
18
|
import classNames from 'classnames';
|
|
19
|
-
import { ConfiguredThebeServerProvider } from '@myst-theme/jupyter';
|
|
20
|
-
import { ThebeBundleLoaderProvider } from 'thebe-react';
|
|
21
19
|
|
|
22
20
|
export function Document({
|
|
23
21
|
children,
|
|
@@ -27,7 +25,6 @@ export function Document({
|
|
|
27
25
|
title,
|
|
28
26
|
staticBuild,
|
|
29
27
|
baseurl,
|
|
30
|
-
loadThebeLite,
|
|
31
28
|
top = DEFAULT_NAV_HEIGHT,
|
|
32
29
|
}: {
|
|
33
30
|
children: React.ReactNode;
|
|
@@ -37,7 +34,6 @@ export function Document({
|
|
|
37
34
|
title?: string;
|
|
38
35
|
staticBuild?: boolean;
|
|
39
36
|
baseurl?: string;
|
|
40
|
-
loadThebeLite?: boolean;
|
|
41
37
|
top?: number;
|
|
42
38
|
}) {
|
|
43
39
|
const links = staticBuild
|
|
@@ -49,6 +45,7 @@ export function Document({
|
|
|
49
45
|
Link: Link as any,
|
|
50
46
|
NavLink: NavLink as any,
|
|
51
47
|
};
|
|
48
|
+
|
|
52
49
|
return (
|
|
53
50
|
<html lang="en" className={classNames(theme)} style={{ scrollPadding: top }}>
|
|
54
51
|
<head>
|
|
@@ -65,13 +62,7 @@ export function Document({
|
|
|
65
62
|
<body className="m-0 transition-colors duration-500 bg-white dark:bg-stone-900">
|
|
66
63
|
<ThemeProvider theme={theme} renderers={renderers} {...links} top={top}>
|
|
67
64
|
<BaseUrlProvider baseurl={baseurl}>
|
|
68
|
-
<
|
|
69
|
-
<SiteProvider config={config}>
|
|
70
|
-
<ConfiguredThebeServerProvider siteManifest={config}>
|
|
71
|
-
{children}
|
|
72
|
-
</ConfiguredThebeServerProvider>
|
|
73
|
-
</SiteProvider>
|
|
74
|
-
</ThebeBundleLoaderProvider>
|
|
65
|
+
<SiteProvider config={config}>{children}</SiteProvider>
|
|
75
66
|
</BaseUrlProvider>
|
|
76
67
|
</ThemeProvider>
|
|
77
68
|
<ScrollRestoration />
|