myst-to-react 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,6 +1,6 @@
1
1
  # myst-to-react
2
2
 
3
3
  [![myst-to-react on npm](https://img.shields.io/npm/v/myst-to-react.svg)](https://www.npmjs.com/package/myst-to-react)
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
  Convert a MyST AST to React.
@@ -1 +1 @@
1
- {"version":3,"file":"MyST.d.ts","sourceRoot":"","sources":["../src/MyST.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAEpE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAW/C,wBAAgB,cAAc,CAAC,SAAS,EAAE,sBAAsB,EAAE,IAAI,EAAE,WAAW,qDAMlF;AAED,wBAAgB,IAAI,CAAC,EACnB,GAAG,EACH,SAAS,GACV,EAAE;IACD,GAAG,CAAC,EAAE,WAAW,GAAG,WAAW,EAAE,CAAC;IAClC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,kDAeA"}
1
+ {"version":3,"file":"MyST.d.ts","sourceRoot":"","sources":["../src/MyST.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAEpE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAW/C,wBAAgB,cAAc,CAAC,SAAS,EAAE,sBAAsB,EAAE,IAAI,EAAE,WAAW,qDAMlF;AAED,wBAAgB,IAAI,CAAC,EACnB,GAAG,EACH,SAAS,GACV,EAAE;IACD,GAAG,CAAC,EAAE,WAAW,GAAG,WAAW,EAAE,CAAC;IAClC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,kDAgBA"}
package/dist/MyST.js CHANGED
@@ -16,12 +16,14 @@ export function selectRenderer(renderers, node) {
16
16
  }
17
17
  export function MyST({ ast, className, }) {
18
18
  const renderers = useNodeRenderers();
19
- if (!ast || ast.length === 0)
19
+ if (!ast)
20
20
  return null;
21
21
  if (!Array.isArray(ast)) {
22
22
  const Component = selectRenderer(renderers, ast);
23
23
  return _jsx(Component, { node: ast, className: className }, ast.key);
24
24
  }
25
+ if (ast.length === 0)
26
+ return null;
25
27
  return (_jsx(_Fragment, { children: ast === null || ast === void 0 ? void 0 : ast.map((node) => {
26
28
  const Component = selectRenderer(renderers, node);
27
29
  return _jsx(Component, { node: node, className: className }, node.key);
package/dist/basic.d.ts CHANGED
@@ -37,6 +37,9 @@ type Include = {
37
37
  type Glossary = {
38
38
  type: 'glossary';
39
39
  };
40
+ type Root = {
41
+ type: 'root';
42
+ };
40
43
  type BasicNodeRenderers = {
41
44
  text: NodeRenderer<spec.Text>;
42
45
  span: NodeRenderer<GenericNode>;
@@ -76,6 +79,7 @@ type BasicNodeRenderers = {
76
79
  definitionDescription: NodeRenderer<DefinitionDescription>;
77
80
  include: NodeRenderer<Include>;
78
81
  glossary: NodeRenderer<Glossary>;
82
+ root: NodeRenderer<Root>;
79
83
  };
80
84
  declare const BASIC_RENDERERS: BasicNodeRenderers;
81
85
  export default BASIC_RENDERERS;
@@ -1 +1 @@
1
- {"version":3,"file":"basic.d.ts","sourceRoot":"","sources":["../src/basic.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,IAAI,MAAM,WAAW,CAAC;AAEvC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAI1D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE/C,KAAK,SAAS,GAAG;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAA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AAO,CAAC,CAAC;IAC/B,QAAQ,EAAE,YAAY,CAAC,QAAQ,CAAC,CAAC;IACjC,IAAI,EAAE,YAAY,CAAC,IAAI,CAAC,CAAC;CAC1B,CAAC;AAEF,QAAA,MAAM,eAAe,EAAE,kBA8TtB,CAAC;AAEF,eAAe,eAAe,CAAC"}
package/dist/basic.js CHANGED
@@ -151,5 +151,8 @@ const BASIC_RENDERERS = {
151
151
  // TODO, provider could give context about the filename
152
152
  return (_jsx("div", { id: node.html_id || node.identifier || node.key, className: classNames(node.class, className), children: _jsx(MyST, { ast: node.children }) }));
153
153
  },
154
+ root({ node, className }) {
155
+ return _jsx(MyST, { ast: node.children, className: className });
156
+ },
154
157
  };
155
158
  export default BASIC_RENDERERS;
@@ -10,7 +10,7 @@ export declare function scrollToElement(el: HTMLElement | null, { htmlId, scroll
10
10
  /** Update the URL fragment to this ID */
11
11
  htmlId?: string;
12
12
  } & HashLinkBehavior): void;
13
- export declare function HashLink({ id, kind, title, children, canSelectText, hover, className, hideInPopup, scrollBehavior, historyState, focusTarget, }: {
13
+ export declare function HashLink({ id, kind, title, children, canSelectText, hover, className, hideInPopup, scrollBehavior, historyState, focusTarget, noWidth, }: {
14
14
  id?: string;
15
15
  kind?: string;
16
16
  title?: string;
@@ -19,5 +19,7 @@ export declare function HashLink({ id, kind, title, children, canSelectText, hov
19
19
  canSelectText?: boolean;
20
20
  className?: string;
21
21
  hideInPopup?: boolean;
22
+ /** Ensures that when centered it doesn't take up space */
23
+ noWidth?: boolean;
22
24
  } & HashLinkBehavior): import("react/jsx-runtime").JSX.Element | null;
23
25
  //# sourceMappingURL=hashLink.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"hashLink.d.ts","sourceRoot":"","sources":["../src/hashLink.tsx"],"names":[],"mappings":"AAGA,MAAM,MAAM,gBAAgB,GAAG;IAC7B,6DAA6D;IAC7D,cAAc,CAAC,EAAE,cAAc,CAAC;IAChC,8DAA8D;IAC9D,YAAY,CAAC,EAAE,SA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,EACxB,WAAkB,GACnB,GAAE;IACD,yCAAyC;IACzC,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,GAAG,gBAAqB,QAe1B;AAED,wBAAgB,QAAQ,CAAC,EACvB,EAAE,EACF,IAAI,EACJ,KAA8B,EAC9B,QAAc,EACd,aAAqB,EACrB,KAAK,EACL,SAAyB,EACzB,WAAW,EACX,cAAc,EACd,YAAY,EACZ,WAAW,EACX,OAAO,GACR,EAAE;IACD,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC5B,QAAQ,CAAC,EAAE,GAAG,GAAG,GAAG,GAAG,KAAK,CAAC,SAAS,CAAC;IACvC,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,0DAA0D;IAC1D,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,GAAG,gBAAgB,kDAoCnB"}
package/dist/hashLink.js CHANGED
@@ -27,7 +27,7 @@ export function scrollToElement(el, { htmlId = el === null || el === void 0 ? vo
27
27
  el.focus({ preventScroll: true });
28
28
  }
29
29
  }
30
- export function HashLink({ id, kind, title = `Link to this ${kind}`, children = '¶', canSelectText = false, hover, className = 'font-normal', hideInPopup, scrollBehavior, historyState, focusTarget, }) {
30
+ export function HashLink({ id, kind, title = `Link to this ${kind}`, children = '¶', canSelectText = false, hover, className = 'font-normal', hideInPopup, scrollBehavior, historyState, focusTarget, noWidth, }) {
31
31
  const { inCrossRef } = useXRefState();
32
32
  if (inCrossRef || !id) {
33
33
  // If we are in a cross-reference pop-out, either hide hash link
@@ -39,7 +39,7 @@ export function HashLink({ id, kind, title = `Link to this ${kind}`, children =
39
39
  const el = document.getElementById(id);
40
40
  scrollToElement(el, { scrollBehavior, historyState, focusTarget });
41
41
  };
42
- return (_jsx("a", { className: classNames('no-underline text-inherit hover:text-inherit', className, {
42
+ return (_jsx("a", { className: classNames('no-underline text-inherit hover:text-inherit', { 'inline-block w-0 px-0 translate-x-[10px]': noWidth === true }, className, {
43
43
  'select-none': !canSelectText,
44
44
  'transition-opacity opacity-0 focus:opacity-100 group-hover:opacity-70': hover === true,
45
45
  '[@media(hover:hover)]:transition-opacity [@media(hover:hover)]:opacity-0 [@media(hover:hover)]:focus:opacity-100 [@media(hover:hover)]:group-hover:opacity-70': hover === 'desktop',
package/dist/heading.js CHANGED
@@ -6,7 +6,7 @@ import classNames from 'classnames';
6
6
  const Heading = ({ node, className }) => {
7
7
  const { enumerator, depth, key, identifier, html_id } = node;
8
8
  const id = html_id || identifier || key;
9
- const textContent = (_jsxs(_Fragment, { children: [enumerator && _jsx("span", { className: "mr-3 select-none", children: enumerator }), _jsx("span", { className: "heading-text", children: _jsx(MyST, { ast: node.children }) }), _jsx(HashLink, { id: id, kind: "Section", className: "px-2 font-normal", hover: true, hideInPopup: true })] }));
9
+ const textContent = (_jsxs(_Fragment, { children: [enumerator && _jsx("span", { className: "mr-3 select-none", children: enumerator }), _jsx("span", { className: "heading-text", children: _jsx(MyST, { ast: node.children }) }), _jsx(HashLink, { id: id, kind: "Section", className: "font-normal", hover: true, hideInPopup: true, noWidth: true })] }));
10
10
  // The `heading-text` class is picked up in the Outline to select without the enumerator and "#" link
11
11
  return e(`h${depth}`, {
12
12
  id,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "myst-to-react",
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",
@@ -21,7 +21,7 @@
21
21
  },
22
22
  "dependencies": {
23
23
  "@heroicons/react": "^2.0.18",
24
- "@myst-theme/providers": "^0.14.1",
24
+ "@myst-theme/providers": "^0.14.3",
25
25
  "@scienceicons/react": "^0.0.11",
26
26
  "@radix-ui/react-hover-card": "^1.0.6",
27
27
  "buffer": "^6.0.3",