@myst-theme/jupyter 0.5.3 → 0.5.4
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":"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,
|
|
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,2CA6DA"}
|
package/dist/cjs/decoration.js
CHANGED
|
@@ -24,10 +24,11 @@ exports.usePlaceholder = usePlaceholder;
|
|
|
24
24
|
function OutputDecoration({ outputId, placeholder, children, title = 'Jupyter Notebook', url, }) {
|
|
25
25
|
const { canCompute, kind } = (0, execute_1.useCellExecution)(outputId);
|
|
26
26
|
const Link = (0, providers_1.useLinkProvider)();
|
|
27
|
+
const top = (0, providers_1.useThemeTop)();
|
|
27
28
|
const baseurl = (0, providers_1.useBaseurl)();
|
|
28
29
|
const showComputeControls = canCompute && kind === myst_spec_ext_1.SourceFileKind.Article;
|
|
29
30
|
if (showComputeControls) {
|
|
30
|
-
return ((0, jsx_runtime_1.jsxs)("div", { className: "mb-4 shadow", children: [(0, jsx_runtime_1.jsx)("div", { className: "sticky
|
|
31
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: "mb-4 shadow", children: [(0, jsx_runtime_1.jsx)("div", { className: "sticky z-[2] w-full bg-gray-100/80 backdrop-blur dark:bg-neutral-800/80 py-1 px-2", style: { top }, children: (0, jsx_runtime_1.jsxs)("div", { className: "flex items-center", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center", children: [(0, jsx_runtime_1.jsx)(solid_1.JupyterIcon, { width: "1.25rem", height: "1.25rem", className: "inline-block" }), (0, jsx_runtime_1.jsx)("span", { className: "ml-2", children: "Source:" }), url && ((0, jsx_runtime_1.jsx)(Link, { to: (0, providers_1.withBaseurl)(url, baseurl), className: "ml-2 no-underline text-normal hover:underline", children: title }))] }), (0, jsx_runtime_1.jsx)("div", { className: "flex-grow" }), (0, jsx_runtime_1.jsx)(ArticleCellControls_1.ArticleStatusBadge, { id: outputId }), (0, jsx_runtime_1.jsx)(ArticleCellControls_1.ArticleRunNotebook, { id: outputId }), (0, jsx_runtime_1.jsx)(ArticleCellControls_1.ArticleResetNotebook, { id: outputId })] }) }), (0, jsx_runtime_1.jsx)(PlaceholderProvider, { placeholder: placeholder, children: children })] }));
|
|
31
32
|
}
|
|
32
33
|
// light
|
|
33
34
|
if (kind === myst_spec_ext_1.SourceFileKind.Article) {
|
|
@@ -1 +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,
|
|
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,2CA6DA"}
|
package/dist/esm/decoration.js
CHANGED
|
@@ -4,7 +4,7 @@ import { SourceFileKind } from 'myst-spec-ext';
|
|
|
4
4
|
import { useCellExecution } from './execute';
|
|
5
5
|
import { ArticleResetNotebook, ArticleRunNotebook, ArticleStatusBadge, } from './controls/ArticleCellControls';
|
|
6
6
|
import { JupyterIcon } from '@scienceicons/react/24/solid';
|
|
7
|
-
import { useLinkProvider, useBaseurl, withBaseurl } from '@myst-theme/providers';
|
|
7
|
+
import { useLinkProvider, useBaseurl, withBaseurl, useThemeTop } from '@myst-theme/providers';
|
|
8
8
|
const PlaceholderContext = React.createContext({});
|
|
9
9
|
function PlaceholderProvider({ placeholder, children, }) {
|
|
10
10
|
const value = React.useMemo(() => ({ placeholder }), [placeholder]);
|
|
@@ -17,10 +17,11 @@ export function usePlaceholder() {
|
|
|
17
17
|
export function OutputDecoration({ outputId, placeholder, children, title = 'Jupyter Notebook', url, }) {
|
|
18
18
|
const { canCompute, kind } = useCellExecution(outputId);
|
|
19
19
|
const Link = useLinkProvider();
|
|
20
|
+
const top = useThemeTop();
|
|
20
21
|
const baseurl = useBaseurl();
|
|
21
22
|
const showComputeControls = canCompute && kind === SourceFileKind.Article;
|
|
22
23
|
if (showComputeControls) {
|
|
23
|
-
return (_jsxs("div", { className: "mb-4 shadow", children: [_jsx("div", { className: "sticky
|
|
24
|
+
return (_jsxs("div", { className: "mb-4 shadow", children: [_jsx("div", { className: "sticky z-[2] w-full bg-gray-100/80 backdrop-blur dark:bg-neutral-800/80 py-1 px-2", style: { top }, children: _jsxs("div", { className: "flex items-center", children: [_jsxs("div", { className: "flex items-center", children: [_jsx(JupyterIcon, { width: "1.25rem", height: "1.25rem", className: "inline-block" }), _jsx("span", { className: "ml-2", children: "Source:" }), url && (_jsx(Link, { to: withBaseurl(url, baseurl), className: "ml-2 no-underline text-normal hover:underline", children: title }))] }), _jsx("div", { className: "flex-grow" }), _jsx(ArticleStatusBadge, { id: outputId }), _jsx(ArticleRunNotebook, { id: outputId }), _jsx(ArticleResetNotebook, { id: outputId })] }) }), _jsx(PlaceholderProvider, { placeholder: placeholder, children: children })] }));
|
|
24
25
|
}
|
|
25
26
|
// light
|
|
26
27
|
if (kind === SourceFileKind.Article) {
|
|
@@ -1 +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,
|
|
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,2CA6DA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@myst-theme/jupyter",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.4",
|
|
4
4
|
"main": "dist/cjs/index.js",
|
|
5
5
|
"module": "dist/esm/index.js",
|
|
6
6
|
"types": "dist/types/index.d.ts",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"dependencies": {
|
|
24
24
|
"@headlessui/react": "^1.7.15",
|
|
25
25
|
"@heroicons/react": "^2.0.18",
|
|
26
|
-
"@myst-theme/providers": "^0.5.
|
|
26
|
+
"@myst-theme/providers": "^0.5.4",
|
|
27
27
|
"@scienceicons/react": "^0.0.5",
|
|
28
28
|
"ansi-to-react": "^6.1.6",
|
|
29
29
|
"buffer": "^6.0.3",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"myst-config": "^1.1.3",
|
|
34
34
|
"myst-frontmatter": "^1.1.3",
|
|
35
35
|
"myst-spec": "^0.0.4",
|
|
36
|
-
"myst-to-react": "^0.5.
|
|
36
|
+
"myst-to-react": "^0.5.4",
|
|
37
37
|
"nanoid": "^4.0.2",
|
|
38
38
|
"nbtx": "^0.2.3",
|
|
39
39
|
"react-syntax-highlighter": "^15.5.0",
|