myst-demo 0.13.7 → 0.14.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;AA0N1D,wBAAgB,YAAY,CAAC,EAC3B,EAAE,EACF,KAAK,EACL,MAAM,EACN,UAAU,EACV,SAAS,EACT,UAAU,EACV,UAAU,EACV,SAAS,GACV,EAAE;IACD,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,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,2CA+PA;AAED,eAAO,MAAM,gBAAgB,EAAE,YAS9B,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;AA0N1D,wBAAgB,YAAY,CAAC,EAC3B,EAAE,EACF,KAAK,EACL,MAAM,EACN,UAAU,EACV,SAAS,EACT,UAAU,EACV,UAAU,EACV,SAAS,GACV,EAAE;IACD,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,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,2CAqQA;AAED,eAAO,MAAM,gBAAgB,EAAE,YAS9B,CAAC"}
package/dist/index.js CHANGED
@@ -25,7 +25,7 @@ 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';
28
- import { ReferencesProvider } from '@myst-theme/providers';
28
+ import { ArticleProvider, GridSystemProvider } from '@myst-theme/providers';
29
29
  import { CopyIcon, CodeBlock, MyST } from 'myst-to-react';
30
30
  import { useEffect, useRef, useState } from 'react';
31
31
  import classnames from 'classnames';
@@ -308,7 +308,7 @@ export function MySTRenderer({ id, value, column, fullscreen, numbering, TitleBl
308
308
  'pt-[40px]': !column && previewType !== 'AST',
309
309
  'pt-[80px]': !column && previewType === 'AST',
310
310
  'pt-4': column,
311
- }), 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 rounded border", 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
+ }), children: [previewType === 'DEMO' && (_jsx(_Fragment, { children: _jsx(ArticleProvider, { kind: SourceFileKind.Article, references: references, frontmatter: reducedFrontmatter, children: _jsxs(GridSystemProvider, { gridSystem: "demo-grid", 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 rounded border", 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', {
312
312
  'bg-red-500 dark:bg-red-800': m.fatal === true,
313
313
  'bg-orange-500 dark:bg-orange-700': m.fatal === false,
314
314
  '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.7",
3
+ "version": "0.14.1",
4
4
  "type": "module",
5
5
  "exports": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -23,25 +23,25 @@
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.8",
26
+ "myst-common": "^1.7.9",
27
27
  "myst-config": "^1.7.8",
28
- "myst-directives": "^1.5.11",
28
+ "myst-directives": "^1.5.12",
29
29
  "myst-ext-button": "^0.0.1",
30
30
  "myst-ext-card": "^1.0.9",
31
31
  "myst-ext-exercise": "^1.0.9",
32
32
  "myst-ext-grid": "^1.0.9",
33
33
  "myst-ext-proof": "^1.0.12",
34
34
  "myst-ext-tabs": "^1.0.9",
35
- "myst-frontmatter": "^1.7.8",
36
- "myst-parser": "^1.5.11",
35
+ "myst-frontmatter": "^1.7.9",
36
+ "myst-parser": "^1.5.12",
37
37
  "myst-spec": "^0.0.5",
38
- "myst-to-docx": "^1.0.13",
38
+ "myst-to-docx": "^1.0.14",
39
39
  "myst-to-html": "^1.5.11",
40
40
  "myst-to-jats": "^1.0.32",
41
- "myst-to-react": "^0.13.7",
41
+ "myst-to-react": "^0.14.1",
42
42
  "myst-to-tex": "^1.0.41",
43
43
  "myst-to-typst": "^0.0.30",
44
- "myst-transforms": "^1.3.31",
44
+ "myst-transforms": "^1.3.32",
45
45
  "unified": "^10.1.2",
46
46
  "unist-util-remove": "^4.0.0",
47
47
  "unist-util-visit": "^4.1.2",