myst-demo 0.13.1 → 0.13.3

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 (2) hide show
  1. package/dist/index.js +3 -3
  2. package/package.json +18 -18
package/dist/index.js CHANGED
@@ -21,7 +21,7 @@ var __rest = (this && this.__rest) || function (s, e) {
21
21
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
22
22
  import { VFile } from 'vfile';
23
23
  import { remove } from 'unist-util-remove';
24
- import yaml from 'js-yaml';
24
+ import { load as yamlLoad, dump as yamlDump } from 'js-yaml';
25
25
  import { fileError, RuleId, } from 'myst-common';
26
26
  import { SourceFileKind } from 'myst-spec-ext';
27
27
  import { validatePageFrontmatter } from 'myst-frontmatter';
@@ -63,7 +63,7 @@ function getFrontmatter(vfile, tree) {
63
63
  const firstIsYaml = (firstNode === null || firstNode === void 0 ? void 0 : firstNode.type) === 'code' && (firstNode === null || firstNode === void 0 ? void 0 : firstNode.lang) === 'yaml';
64
64
  if (firstIsYaml) {
65
65
  try {
66
- frontmatter = yaml.load(firstNode.value) || {};
66
+ frontmatter = yamlLoad(firstNode.value) || {};
67
67
  firstNode.type = '__delete__';
68
68
  }
69
69
  catch (err) {
@@ -307,7 +307,7 @@ export function MySTRenderer({ value, column, fullscreen, numbering, TitleBlock,
307
307
  'pt-[40px]': !column && previewType !== 'AST',
308
308
  'pt-[80px]': !column && previewType === 'AST',
309
309
  'pt-4': column,
310
- }), children: [previewType === 'DEMO' && (_jsx(_Fragment, { children: _jsxs(ReferencesProvider, { references: references, frontmatter: reducedFrontmatter, children: [TitleBlock && _jsx(TitleBlock, { frontmatter: frontmatter }), _jsx(MyST, { ast: (_a = references.article) === null || _a === void 0 ? void 0 : _a.children })] }) })), previewType === 'AST' && (_jsx(_Fragment, { children: _jsx(CodeBlock, { lang: astLang, value: astLang === 'yaml' ? yaml.dump(mdastStage) : JSON.stringify(mdastStage, null, 2) }) })), previewType === 'HTML' && _jsx(CodeBlock, { lang: "xml", value: html, showCopy: false }), previewType === 'LaTeX' && _jsx(CodeBlock, { lang: "latex", value: tex, showCopy: false }), previewType === 'Typst' && _jsx(CodeBlock, { lang: "typst", value: typst, showCopy: false }), previewType === 'JATS' && _jsx(CodeBlock, { lang: "xml", value: jats, showCopy: false }), previewType === 'DOCX' && (_jsx("div", { children: _jsxs("button", { className: "p-3 border rounded", onClick: () => saveDocxFile('demo.docx', references.article), title: `Download Micorsoft Word`, "aria-label": `Download Micorsoft Word`, children: [_jsx(ArrowDownTrayIcon, { width: "1.3rem", height: "1.3rem", className: "inline mr-1" }), ' ', "Download as Microsoft Word"] }) }))] }), currentWarnings.length > 0 && (_jsx("div", { className: classnames('w-full', { 'absolute bottom-0': column }), children: currentWarnings.map((m, i) => (_jsxs("div", { className: classnames('p-1 shadow-inner text-white not-prose', {
310
+ }), children: [previewType === 'DEMO' && (_jsx(_Fragment, { children: _jsxs(ReferencesProvider, { references: references, frontmatter: reducedFrontmatter, children: [TitleBlock && _jsx(TitleBlock, { frontmatter: frontmatter }), _jsx(MyST, { ast: (_a = references.article) === null || _a === void 0 ? void 0 : _a.children })] }) })), previewType === 'AST' && (_jsx(_Fragment, { children: _jsx(CodeBlock, { lang: astLang, value: astLang === 'yaml' ? yamlDump(mdastStage) : JSON.stringify(mdastStage, null, 2) }) })), previewType === 'HTML' && _jsx(CodeBlock, { lang: "xml", value: html, showCopy: false }), previewType === 'LaTeX' && _jsx(CodeBlock, { lang: "latex", value: tex, showCopy: false }), previewType === 'Typst' && _jsx(CodeBlock, { lang: "typst", value: typst, showCopy: false }), previewType === 'JATS' && _jsx(CodeBlock, { lang: "xml", value: jats, showCopy: false }), previewType === 'DOCX' && (_jsx("div", { children: _jsxs("button", { className: "p-3 border rounded", onClick: () => saveDocxFile('demo.docx', references.article), title: `Download Micorsoft Word`, "aria-label": `Download Micorsoft Word`, children: [_jsx(ArrowDownTrayIcon, { width: "1.3rem", height: "1.3rem", className: "inline mr-1" }), ' ', "Download as Microsoft Word"] }) }))] }), currentWarnings.length > 0 && (_jsx("div", { className: classnames('w-full', { 'absolute bottom-0': column }), children: currentWarnings.map((m, i) => (_jsxs("div", { className: classnames('p-1 shadow-inner text-white not-prose', {
311
311
  'bg-red-500 dark:bg-red-800': m.fatal === true,
312
312
  'bg-orange-500 dark:bg-orange-700': m.fatal === false,
313
313
  'bg-slate-500 dark:bg-slate-800': m.fatal === null,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "myst-demo",
3
- "version": "0.13.1",
3
+ "version": "0.13.3",
4
4
  "type": "module",
5
5
  "exports": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -23,24 +23,24 @@
23
23
  "@heroicons/react": "^2.0.18",
24
24
  "classnames": "^2.3.2",
25
25
  "js-yaml": "^4.1.0",
26
- "myst-common": "^1.7.0",
27
- "myst-config": "^1.5.0",
28
- "myst-directives": "^1.5.6",
29
- "myst-ext-card": "^1.0.8",
30
- "myst-ext-exercise": "^1.0.7",
31
- "myst-ext-grid": "^1.0.7",
32
- "myst-ext-proof": "^1.0.10",
33
- "myst-ext-tabs": "^1.0.7",
34
- "myst-frontmatter": "^1.7.0",
35
- "myst-parser": "^1.5.6",
26
+ "myst-common": "^1.7.3",
27
+ "myst-config": "^1.7.3",
28
+ "myst-directives": "^1.5.7",
29
+ "myst-ext-card": "^1.0.9",
30
+ "myst-ext-exercise": "^1.0.8",
31
+ "myst-ext-grid": "^1.0.8",
32
+ "myst-ext-proof": "^1.0.11",
33
+ "myst-ext-tabs": "^1.0.8",
34
+ "myst-frontmatter": "^1.7.3",
35
+ "myst-parser": "^1.5.7",
36
36
  "myst-spec": "^0.0.5",
37
- "myst-to-docx": "^1.0.11",
38
- "myst-to-html": "^1.5.6",
39
- "myst-to-jats": "^1.0.27",
40
- "myst-to-react": "^0.13.1",
41
- "myst-to-tex": "^1.0.37",
42
- "myst-to-typst": "^0.0.22",
43
- "myst-transforms": "^1.3.25",
37
+ "myst-to-docx": "^1.0.12",
38
+ "myst-to-html": "^1.5.7",
39
+ "myst-to-jats": "^1.0.30",
40
+ "myst-to-react": "^0.13.3",
41
+ "myst-to-tex": "^1.0.38",
42
+ "myst-to-typst": "^0.0.25",
43
+ "myst-transforms": "^1.3.26",
44
44
  "unified": "^10.1.2",
45
45
  "unist-util-remove": "^4.0.0",
46
46
  "unist-util-visit": "^4.1.2",