myst-to-react 0.16.0 → 0.17.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.
- package/dist/block.d.ts.map +1 -1
- package/dist/block.js +3 -2
- package/dist/code.d.ts.map +1 -1
- package/dist/code.js +4 -4
- package/dist/image.d.ts.map +1 -1
- package/dist/image.js +3 -1
- package/package.json +4 -4
package/dist/block.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"block.d.ts","sourceRoot":"","sources":["../src/block.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAEjD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAE1D,wBAAgB,KAAK,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE;IAAE,IAAI,EAAE,aAAa,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,
|
|
1
|
+
{"version":3,"file":"block.d.ts","sourceRoot":"","sources":["../src/block.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAEjD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAE1D,wBAAgB,KAAK,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE;IAAE,IAAI,EAAE,aAAa,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,kDAqBrF;AAED,QAAA,MAAM,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,YAAY,CAEjD,CAAC;AAEF,eAAe,eAAe,CAAC"}
|
package/dist/block.js
CHANGED
|
@@ -3,7 +3,7 @@ import { Details } from './dropdown.js';
|
|
|
3
3
|
import { MyST } from './MyST.js';
|
|
4
4
|
import classNames from 'classnames';
|
|
5
5
|
export function Block({ node, className }) {
|
|
6
|
-
var _a, _b;
|
|
6
|
+
var _a, _b, _c;
|
|
7
7
|
const cn = classNames(className, node.class, {
|
|
8
8
|
[(_a = node.data) === null || _a === void 0 ? void 0 : _a.class]: typeof ((_b = node.data) === null || _b === void 0 ? void 0 : _b.class) === 'string',
|
|
9
9
|
});
|
|
@@ -12,7 +12,8 @@ export function Block({ node, className }) {
|
|
|
12
12
|
// Only wrap this in a block if the block has a class name or an identifier
|
|
13
13
|
// Otherwise pass through the contents as is.
|
|
14
14
|
// This allows children (e.g. margin) access to the grid-system
|
|
15
|
-
const
|
|
15
|
+
const identifier = (_c = node.html_id) !== null && _c !== void 0 ? _c : node.identifier;
|
|
16
|
+
const block = cn || identifier ? (_jsx("div", { id: identifier, className: cn, children: _jsx(MyST, { ast: node.children }) })) : (_jsx(MyST, { ast: node.children }));
|
|
16
17
|
if (node.visibility === 'hide') {
|
|
17
18
|
return _jsx(Details, { title: "Block", children: block });
|
|
18
19
|
}
|
package/dist/code.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"code.d.ts","sourceRoot":"","sources":["../src/code.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAU1D,KAAK,KAAK,GAAG;IACX,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;IAC1B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAaF,wBAAgB,SAAS,CAAC,KAAK,EAAE,KAAK,
|
|
1
|
+
{"version":3,"file":"code.d.ts","sourceRoot":"","sources":["../src/code.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAU1D,KAAK,KAAK,GAAG;IACX,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;IAC1B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAaF,wBAAgB,SAAS,CAAC,KAAK,EAAE,KAAK,2CAuFrC;AAgED,QAAA,MAAM,cAAc;;;CAGnB,CAAC;AAEF,eAAe,cAAc,CAAC"}
|
package/dist/code.js
CHANGED
|
@@ -49,11 +49,11 @@ export function CodeBlock(props) {
|
|
|
49
49
|
},
|
|
50
50
|
};
|
|
51
51
|
}, [emphasizeLines]);
|
|
52
|
-
return (_jsxs("div", { id: identifier, className: classNames('myst-code
|
|
53
|
-
'shadow hover:shadow-md dark:shadow-2xl dark:shadow-neutral-900
|
|
52
|
+
return (_jsxs("div", { id: identifier, className: classNames('relative myst-code group not-prose', className, {
|
|
53
|
+
'my-5 text-sm shadow hover:shadow-md dark:shadow-2xl dark:shadow-neutral-900': shadow,
|
|
54
54
|
'bg-stone-200/10': background,
|
|
55
|
-
'border border-l-4 border-l-blue-400
|
|
56
|
-
}), children: [filename && (_jsxs("div", { className: "flex flex-row pl-2 bg-white border-b dark:bg-slate-600 dark:border-slate-300", children: [_jsx(DocumentIcon, { width: "16px", height: "16px", className: "
|
|
55
|
+
'border border-l-4 border-gray-200 border-l-blue-400 dark:border-l-blue-400 dark:border-gray-800': border,
|
|
56
|
+
}), children: [filename && (_jsxs("div", { className: "flex flex-row pl-2 bg-white border-b dark:bg-slate-600 dark:border-slate-300", children: [_jsx(DocumentIcon, { width: "16px", height: "16px", className: "inline-block flex-none self-center text-gray-500 myst-code-filename-icon dark:text-gray-100" }), _jsx("div", { className: "self-center p-2 text-sm leading-3 myst-code-filename-title prose text-slate-600 dark:text-white", children: filename })] })), _jsx(SyntaxHighlighter, Object.assign({}, highlighterProps, { className: "block overflow-auto p-3 myst-code-body hljs", children: value })), showCopy && (_jsx(CopyIcon, { text: value, className: classNames('absolute right-1 myst-code-copy-icon', {
|
|
57
57
|
'top-[32px]': filename,
|
|
58
58
|
'top-1': !filename,
|
|
59
59
|
}) }))] }));
|
package/dist/image.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"image.d.ts","sourceRoot":"","sources":["../src/image.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,IAAI,aAAa,EAAE,MAAM,WAAW,CAAC;AACxD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAK1D,KAAK,SAAS,GAAG,aAAa,GAAG;IAAE,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"image.d.ts","sourceRoot":"","sources":["../src/image.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,IAAI,aAAa,EAAE,MAAM,WAAW,CAAC;AACxD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAK1D,KAAK,SAAS,GAAG,aAAa,GAAG;IAAE,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAkIrD,eAAO,MAAM,KAAK,EAAE,YAAY,CAAC,SAAS,CAezC,CAAC;AAEF,QAAA,MAAM,eAAe;;CAEpB,CAAC;AAEF,eAAe,eAAe,CAAC"}
|
package/dist/image.js
CHANGED
|
@@ -41,7 +41,9 @@ function Picture({ className, id, src, srcOptimized, urlSource, align = 'center'
|
|
|
41
41
|
if (src.endsWith('.mp4') || (urlSource === null || urlSource === void 0 ? void 0 : urlSource.endsWith('.mp4'))) {
|
|
42
42
|
return (_jsx(Video, { className: className, id: id, width: width, height: height, align: align, src: src, urlSource: urlSource }));
|
|
43
43
|
}
|
|
44
|
-
const image = (_jsx("img", { id: id, style: Object.assign({ width: getStyleValue(width), height: getStyleValue(height) }, alignToMargin(align)), src: src, alt: alt, "data-canonical-url": urlSource
|
|
44
|
+
const image = (_jsx("img", { id: id, style: Object.assign({ width: getStyleValue(width), height: getStyleValue(height) }, alignToMargin(align)), src: src, alt: alt, "data-canonical-url": urlSource,
|
|
45
|
+
// Don't set className if nested under picture
|
|
46
|
+
className: srcOptimized ? undefined : className }));
|
|
45
47
|
if (!srcOptimized)
|
|
46
48
|
return image;
|
|
47
49
|
return (_jsxs("picture", { className: className, children: [_jsx("source", { srcSet: srcOptimized, type: "image/webp" }), image] }));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "myst-to-react",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.17.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -21,13 +21,13 @@
|
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
23
|
"@heroicons/react": "^2.0.18",
|
|
24
|
-
"@myst-theme/providers": "^0.
|
|
24
|
+
"@myst-theme/providers": "^0.17.0",
|
|
25
25
|
"@scienceicons/react": "^0.0.13",
|
|
26
26
|
"@radix-ui/react-hover-card": "^1.0.6",
|
|
27
27
|
"buffer": "^6.0.3",
|
|
28
28
|
"classnames": "^2.3.2",
|
|
29
|
-
"myst-common": "^1.
|
|
30
|
-
"myst-config": "^1.
|
|
29
|
+
"myst-common": "^1.8.1",
|
|
30
|
+
"myst-config": "^1.8.1",
|
|
31
31
|
"myst-spec": "^0.0.5",
|
|
32
32
|
"nanoid": "^4.0.2",
|
|
33
33
|
"react-syntax-highlighter": "15.5.0",
|