myst-demo 0.14.1 → 0.14.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.
package/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  # myst-demo
2
2
 
3
3
  [![myst-demo on npm](https://img.shields.io/npm/v/myst-demo.svg)](https://www.npmjs.com/package/myst-demo)
4
- [![MIT License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/curvenote/curvenote/blob/main/LICENSE)
4
+ [![MIT License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/jupyter-book/myst-theme/blob/main/LICENSE)
5
5
 
6
6
  A demo component for MyST Markdown, for example, [in the sandbox](https://mystmd.org/sandbox).
7
7
 
package/dist/index.js CHANGED
@@ -208,7 +208,6 @@ function parse(text, defaultFrontmatter, options) {
208
208
  });
209
209
  }
210
210
  export function MySTRenderer({ id, value, column, fullscreen, numbering, TitleBlock, captureTab, className, }) {
211
- var _a;
212
211
  const area = useRef(null);
213
212
  const [text, setText] = useState(value.trim());
214
213
  const [references, setReferences] = useState({});
@@ -302,13 +301,13 @@ export function MySTRenderer({ id, value, column, fullscreen, numbering, TitleBl
302
301
  'grid grid-cols-2 gap-0 grid-rows-[3rem_1fr]': column,
303
302
  'rounded shadow-lg': !fullscreen,
304
303
  'm-0': fullscreen,
305
- }, className), children: [column && (_jsxs("div", { className: "flex flex-row col-span-2 items-stretch px-2 h-full border dark:border-slate-600", children: [_jsx("div", { className: "flex-grow" }), demoMenu] })), _jsxs("div", { className: classnames('relative myst', { 'overflow-auto': column }), children: [_jsx(CopyIcon, { text: text, className: "absolute right-0 p-1" }), _jsxs("label", { children: [_jsx("span", { className: "sr-only", children: "Edit the MyST Markdown text" }), _jsx("textarea", { ref: area, value: text, className: classnames('block p-6 w-full font-mono shadow-inner outline-none resize-none bg-slate-50/50 dark:bg-slate-800/50', { 'text-sm': !column }, { 'h-full': column }), onChange: (e) => setText(e.target.value) })] })] }), _jsxs("div", { className: classnames('relative exclude-from-outline min-h-1 dark:bg-slate-900', {
304
+ }, className), children: [column && (_jsxs("div", { className: "flex flex-row items-stretch h-full col-span-2 px-2 border dark:border-slate-600", children: [_jsx("div", { className: "flex-grow" }), demoMenu] })), _jsxs("div", { className: classnames('relative myst', { 'overflow-auto': column }), children: [_jsx(CopyIcon, { text: text, className: "absolute right-0 p-1" }), _jsxs("label", { children: [_jsx("span", { className: "sr-only", children: "Edit the MyST Markdown text" }), _jsx("textarea", { ref: area, value: text, className: classnames('block p-6 w-full font-mono shadow-inner outline-none resize-none bg-slate-50/50 dark:bg-slate-800/50', { 'text-sm': !column }, { 'h-full': column }), onChange: (e) => setText(e.target.value) })] })] }), _jsxs("div", { className: classnames('relative exclude-from-outline min-h-1 dark:bg-slate-900', {
306
305
  'overflow-auto': column,
307
306
  }), children: [!column && _jsx("div", { className: "absolute top-0 left-0", children: demoMenu }), _jsxs("div", { className: classnames('px-6 pb-6', {
308
307
  'pt-[40px]': !column && previewType !== 'AST',
309
308
  'pt-[80px]': !column && previewType === 'AST',
310
309
  'pt-4': column,
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', {
310
+ }), 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: references.article })] }) }) })), 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', {
312
311
  'bg-red-500 dark:bg-red-800': m.fatal === true,
313
312
  'bg-orange-500 dark:bg-orange-700': m.fatal === false,
314
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.14.1",
3
+ "version": "0.14.3",
4
4
  "type": "module",
5
5
  "exports": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -38,7 +38,7 @@
38
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.14.1",
41
+ "myst-to-react": "^0.14.3",
42
42
  "myst-to-tex": "^1.0.41",
43
43
  "myst-to-typst": "^0.0.30",
44
44
  "myst-transforms": "^1.3.32",