myst-demo 0.12.0 → 0.13.1

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":"index.d.ts","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACxD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAsN1D,wBAAgB,YAAY,CAAC,EAC3B,KAAK,EACL,MAAM,EACN,UAAU,EACV,SAAS,EACT,UAAU,EACV,UAAU,EACV,SAAS,GACV,EAAE;IACD,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,UAAU,CAAC,EAAE,CAAC,KAAK,EAAE;QAAE,WAAW,EAAE,eAAe,CAAA;KAAE,KAAK,GAAG,CAAC,OAAO,GAAG,IAAI,CAAC;IAC7E,SAAS,CAAC,EAAE,GAAG,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,2CA6PA;AAED,eAAO,MAAM,gBAAgB,EAAE,YAE9B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACxD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAsN1D,wBAAgB,YAAY,CAAC,EAC3B,KAAK,EACL,MAAM,EACN,UAAU,EACV,SAAS,EACT,UAAU,EACV,UAAU,EACV,SAAS,GACV,EAAE;IACD,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,UAAU,CAAC,EAAE,CAAC,KAAK,EAAE;QAAE,WAAW,EAAE,eAAe,CAAA;KAAE,KAAK,GAAG,CAAC,OAAO,GAAG,IAAI,CAAC;IAC7E,SAAS,CAAC,EAAE,GAAG,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,2CA8PA;AAED,eAAO,MAAM,gBAAgB,EAAE,YAE9B,CAAC"}
package/dist/index.js CHANGED
@@ -7,6 +7,17 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
7
7
  step((generator = generator.apply(thisArg, _arguments || [])).next());
8
8
  });
9
9
  };
10
+ var __rest = (this && this.__rest) || function (s, e) {
11
+ var t = {};
12
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
13
+ t[p] = s[p];
14
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
15
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
16
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
17
+ t[p[i]] = s[p[i]];
18
+ }
19
+ return t;
20
+ };
10
21
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
11
22
  import { VFile } from 'vfile';
12
23
  import { remove } from 'unist-util-remove';
@@ -285,6 +296,7 @@ export function MySTRenderer({ value, column, fullscreen, numbering, TitleBlock,
285
296
  'bg-blue-800 text-white': astStage === show,
286
297
  }), title: `Show the AST Stage ${show.toUpperCase()}`, "aria-pressed": astStage === show ? 'true' : 'false', onClick: () => setAstStage(show), children: show.toUpperCase() }, show)))] }))] }));
287
298
  const mdastStage = astStage === 'pre' ? mdastPre : mdastPost;
299
+ const { downloads, exports, parts } = frontmatter, reducedFrontmatter = __rest(frontmatter, ["downloads", "exports", "parts"]);
288
300
  return (_jsxs("figure", { className: classnames('relative', {
289
301
  'grid grid-cols-2 gap-0 grid-rows-[3rem_1fr]': column,
290
302
  'shadow-lg rounded': !fullscreen,
@@ -295,7 +307,7 @@ export function MySTRenderer({ value, column, fullscreen, numbering, TitleBlock,
295
307
  'pt-[40px]': !column && previewType !== 'AST',
296
308
  'pt-[80px]': !column && previewType === 'AST',
297
309
  'pt-4': column,
298
- }), children: [previewType === 'DEMO' && (_jsx(_Fragment, { children: _jsxs(ReferencesProvider, { references: references, frontmatter: frontmatter, 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' ? 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', {
299
311
  'bg-red-500 dark:bg-red-800': m.fatal === true,
300
312
  'bg-orange-500 dark:bg-orange-700': m.fatal === false,
301
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.12.0",
3
+ "version": "0.13.1",
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.6.0",
26
+ "myst-common": "^1.7.0",
27
27
  "myst-config": "^1.5.0",
28
- "myst-directives": "^1.5.5",
29
- "myst-ext-card": "^1.0.7",
28
+ "myst-directives": "^1.5.6",
29
+ "myst-ext-card": "^1.0.8",
30
30
  "myst-ext-exercise": "^1.0.7",
31
31
  "myst-ext-grid": "^1.0.7",
32
32
  "myst-ext-proof": "^1.0.10",
33
33
  "myst-ext-tabs": "^1.0.7",
34
- "myst-frontmatter": "^1.5.0",
35
- "myst-parser": "^1.5.5",
34
+ "myst-frontmatter": "^1.7.0",
35
+ "myst-parser": "^1.5.6",
36
36
  "myst-spec": "^0.0.5",
37
37
  "myst-to-docx": "^1.0.11",
38
- "myst-to-html": "^1.5.5",
38
+ "myst-to-html": "^1.5.6",
39
39
  "myst-to-jats": "^1.0.27",
40
- "myst-to-react": "^0.12.0",
41
- "myst-to-tex": "^1.0.35",
42
- "myst-to-typst": "^0.0.21",
43
- "myst-transforms": "^1.3.24",
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",
44
44
  "unified": "^10.1.2",
45
45
  "unist-util-remove": "^4.0.0",
46
46
  "unist-util-visit": "^4.1.2",