myst-to-react 0.13.6 → 0.13.7

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 (56) hide show
  1. package/dist/MyST.d.ts +2 -1
  2. package/dist/MyST.d.ts.map +1 -1
  3. package/dist/MyST.js +6 -6
  4. package/dist/admonitions.js +4 -4
  5. package/dist/aside.js +3 -3
  6. package/dist/basic.d.ts.map +1 -1
  7. package/dist/basic.js +67 -67
  8. package/dist/card.d.ts.map +1 -1
  9. package/dist/card.js +9 -9
  10. package/dist/cite.d.ts +2 -1
  11. package/dist/cite.d.ts.map +1 -1
  12. package/dist/cite.js +8 -8
  13. package/dist/code.d.ts.map +1 -1
  14. package/dist/code.js +6 -6
  15. package/dist/components/HoverPopover.d.ts +2 -1
  16. package/dist/components/HoverPopover.d.ts.map +1 -1
  17. package/dist/components/HoverPopover.js +3 -2
  18. package/dist/crossReference.d.ts.map +1 -1
  19. package/dist/crossReference.js +4 -4
  20. package/dist/dropdown.d.ts.map +1 -1
  21. package/dist/dropdown.js +4 -4
  22. package/dist/exercise.d.ts +2 -1
  23. package/dist/exercise.d.ts.map +1 -1
  24. package/dist/exercise.js +6 -6
  25. package/dist/extensions/chemicalFormula.d.ts.map +1 -1
  26. package/dist/extensions/chemicalFormula.js +3 -2
  27. package/dist/extensions/siunits.d.ts.map +1 -1
  28. package/dist/extensions/siunits.js +2 -2
  29. package/dist/footnotes.js +2 -2
  30. package/dist/grid.d.ts.map +1 -1
  31. package/dist/grid.js +4 -4
  32. package/dist/heading.d.ts.map +1 -1
  33. package/dist/heading.js +3 -2
  34. package/dist/iframe.js +2 -2
  35. package/dist/image.d.ts.map +1 -1
  36. package/dist/image.js +4 -5
  37. package/dist/inlineError.d.ts +2 -1
  38. package/dist/inlineError.d.ts.map +1 -1
  39. package/dist/inlineError.js +3 -2
  40. package/dist/inlineExpression.d.ts.map +1 -1
  41. package/dist/inlineExpression.js +5 -4
  42. package/dist/links/index.d.ts.map +1 -1
  43. package/dist/links/index.js +15 -14
  44. package/dist/math.d.ts.map +1 -1
  45. package/dist/math.js +6 -5
  46. package/dist/proof.d.ts +2 -1
  47. package/dist/proof.d.ts.map +1 -1
  48. package/dist/proof.js +4 -4
  49. package/dist/reactive.d.ts.map +1 -1
  50. package/dist/reactive.js +8 -4
  51. package/dist/tabs.d.ts +4 -2
  52. package/dist/tabs.d.ts.map +1 -1
  53. package/dist/tabs.js +8 -8
  54. package/dist/unknown.d.ts.map +1 -1
  55. package/dist/unknown.js +2 -2
  56. package/package.json +2 -2
package/dist/MyST.d.ts CHANGED
@@ -1,7 +1,8 @@
1
1
  import type { NodeRenderersValidated } from '@myst-theme/providers';
2
2
  import type { GenericNode } from 'myst-common';
3
3
  export declare function selectRenderer(renderers: NodeRenderersValidated, node: GenericNode): import("@myst-theme/providers").NodeRenderer<any>;
4
- export declare function MyST({ ast }: {
4
+ export declare function MyST({ ast, className, }: {
5
5
  ast?: GenericNode | GenericNode[];
6
+ className?: string;
6
7
  }): import("react/jsx-runtime").JSX.Element | null;
7
8
  //# sourceMappingURL=MyST.d.ts.map
@@ -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,EAAE,GAAG,EAAE,EAAE;IAAE,GAAG,CAAC,EAAE,WAAW,GAAG,WAAW,EAAE,CAAA;CAAE,kDAelE"}
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"}
package/dist/MyST.js CHANGED
@@ -1,10 +1,10 @@
1
1
  import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
2
2
  import { matches } from 'unist-util-select';
3
3
  import { useNodeRenderers } from '@myst-theme/providers';
4
- function DefaultComponent({ node }) {
4
+ function DefaultComponent({ node, className }) {
5
5
  if (!node.children)
6
- return _jsx("span", { children: node.value });
7
- return (_jsx("div", { children: _jsx(MyST, { ast: node.children }) }));
6
+ return _jsx("span", { className: className, children: node.value });
7
+ return (_jsx("div", { className: className, children: _jsx(MyST, { ast: node.children }) }));
8
8
  }
9
9
  export function selectRenderer(renderers, node) {
10
10
  var _a, _b, _c;
@@ -14,16 +14,16 @@ export function selectRenderer(renderers, node) {
14
14
  .find(([selector]) => selector !== 'base' && matches(selector, node))) === null || _b === void 0 ? void 0 : _b[1];
15
15
  return (_c = SpecificComponent !== null && SpecificComponent !== void 0 ? SpecificComponent : componentRenderers === null || componentRenderers === void 0 ? void 0 : componentRenderers.base) !== null && _c !== void 0 ? _c : DefaultComponent;
16
16
  }
17
- export function MyST({ ast }) {
17
+ export function MyST({ ast, className, }) {
18
18
  const renderers = useNodeRenderers();
19
19
  if (!ast || ast.length === 0)
20
20
  return null;
21
21
  if (!Array.isArray(ast)) {
22
22
  const Component = selectRenderer(renderers, ast);
23
- return _jsx(Component, { node: ast }, ast.key);
23
+ return _jsx(Component, { node: ast, className: className }, ast.key);
24
24
  }
25
25
  return (_jsx(_Fragment, { children: ast === null || ast === void 0 ? void 0 : ast.map((node) => {
26
26
  const Component = selectRenderer(renderers, node);
27
- return _jsx(Component, { node: node }, node.key);
27
+ return _jsx(Component, { node: node, className: className }, node.key);
28
28
  }) }));
29
29
  }
@@ -83,8 +83,8 @@ function AdmonitionIcon({ kind, className }) {
83
83
  return _jsx(ArrowRightCircleIcon, Object.assign({}, opts));
84
84
  return _jsx(InformationCircleIcon, Object.assign({}, opts));
85
85
  }
86
- export const AdmonitionTitle = ({ node }) => {
87
- return _jsx(MyST, { ast: node.children });
86
+ export const AdmonitionTitle = ({ node, className }) => {
87
+ return _jsx(MyST, { ast: node.children, className: className });
88
88
  };
89
89
  const WrapperElement = ({ dropdown, className, children, open, }) => {
90
90
  if (dropdown)
@@ -121,7 +121,7 @@ export function Admonition({ title, kind, color, simple, dropdown, children, hid
121
121
  'text-red-600': color === 'red',
122
122
  }) })), _jsx("div", { className: classNames('text-neutral-900 dark:text-white grow self-center overflow-hidden break-words', { 'ml-4': hideIcon }), children: title }), dropdown && (_jsx("div", { className: "self-center flex-none text-sm font-thin text-neutral-700 dark:text-neutral-200", children: _jsx(ChevronRightIcon, { width: "2rem", height: "2rem", className: classNames(iconClass, 'transition-transform details-toggle') }) }))] })), _jsx("div", { className: classNames('px-4', { 'py-1': !simple, 'details-body': dropdown }), children: children })] }));
123
123
  }
124
- export const AdmonitionRenderer = ({ node }) => {
124
+ export const AdmonitionRenderer = ({ node, className }) => {
125
125
  const [title, ...rest] = node.children;
126
126
  const classes = getClasses(node.class);
127
127
  const { kind, color } = getFirstKind({ kind: node.kind, classes });
@@ -130,7 +130,7 @@ export const AdmonitionRenderer = ({ node }) => {
130
130
  const hideIcon = node.icon === false;
131
131
  const isOpen = node.open === true;
132
132
  const useTitle = (title === null || title === void 0 ? void 0 : title.type) === 'admonitionTitle';
133
- return (_jsx(Admonition, { title: useTitle ? _jsx(MyST, { ast: [title] }) : undefined, kind: kind, color: color, dropdown: isDropdown, open: isOpen, simple: isSimple, hideIcon: hideIcon, className: classNames(classes), children: useTitle ? _jsx(MyST, { ast: rest }) : _jsx(MyST, { ast: node.children }) }));
133
+ return (_jsx(Admonition, { title: useTitle ? _jsx(MyST, { ast: [title] }) : undefined, kind: kind, color: color, dropdown: isDropdown, open: isOpen, simple: isSimple, hideIcon: hideIcon, className: classNames(classes, className), children: useTitle ? _jsx(MyST, { ast: rest }) : _jsx(MyST, { ast: node.children }) }));
134
134
  };
135
135
  const ADMONITION_RENDERERS = {
136
136
  admonition: AdmonitionRenderer,
package/dist/aside.js CHANGED
@@ -19,13 +19,13 @@ function getAsideClass(kind) {
19
19
  };
20
20
  }
21
21
  }
22
- export const AsideRenderer = ({ node }) => {
22
+ export const AsideRenderer = ({ node, className }) => {
23
23
  const [title, ...rest] = node.children;
24
24
  const classes = getAsideClass(node.kind);
25
25
  if (title.type !== 'admonitionTitle') {
26
- return (_jsx("aside", { className: classNames(classes.container, node.class), children: _jsx(MyST, { ast: node.children }) }));
26
+ return (_jsx("aside", { className: classNames(classes.container, node.class, className), children: _jsx(MyST, { ast: node.children }) }));
27
27
  }
28
- return (_jsxs("aside", { className: classNames(classes.container, node.class), children: [_jsx("div", { className: classes.title, children: _jsx(MyST, { ast: title }) }), _jsx("div", { className: classes.body, children: _jsx(MyST, { ast: rest }) })] }));
28
+ return (_jsxs("aside", { className: classNames(classes.container, node.class, className), children: [_jsx("div", { className: classes.title, children: _jsx(MyST, { ast: title }) }), _jsx("div", { className: classes.body, children: _jsx(MyST, { ast: rest }) })] }));
29
29
  };
30
30
  const ASIDE_RENDERERS = {
31
31
  aside: AsideRenderer,
@@ -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,EA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;IAC/B,QAAQ,EAAE,YAAY,CAAC,QAAQ,CAAC,CAAC;CAClC,CAAC;AAEF,QAAA,MAAM,eAAe,EAAE,kBA2TtB,CAAC;AAEF,eAAe,eAAe,CAAC"}
package/dist/basic.js CHANGED
@@ -15,90 +15,90 @@ const BASIC_RENDERERS = {
15
15
  const text = node.value.split('​');
16
16
  return (_jsx(_Fragment, { children: text.map((v, i) => (_jsxs(React.Fragment, { children: [v, i < text.length - 1 && _jsx("wbr", {})] }, i))) }));
17
17
  },
18
- span({ node }) {
19
- return (_jsx("span", { className: node.class, style: node.style, id: node.html_id, children: _jsx(MyST, { ast: node.children }) }));
18
+ span({ node, className }) {
19
+ return (_jsx("span", { className: classNames(node.class, className), style: node.style, id: node.html_id, children: _jsx(MyST, { ast: node.children }) }));
20
20
  },
21
- div({ node }) {
22
- return (_jsx("div", { className: node.class, style: node.style, id: node.html_id, children: _jsx(MyST, { ast: node.children }) }));
21
+ div({ node, className }) {
22
+ return (_jsx("div", { className: classNames(node.class, className), style: node.style, id: node.html_id, children: _jsx(MyST, { ast: node.children }) }));
23
23
  },
24
- delete({ node }) {
25
- return (_jsx("del", { children: _jsx(MyST, { ast: node.children }) }));
24
+ delete({ node, className }) {
25
+ return (_jsx("del", { className: className, children: _jsx(MyST, { ast: node.children }) }));
26
26
  },
27
- strong({ node }) {
28
- return (_jsx("strong", { children: _jsx(MyST, { ast: node.children }) }));
27
+ strong({ node, className }) {
28
+ return (_jsx("strong", { className: className, children: _jsx(MyST, { ast: node.children }) }));
29
29
  },
30
- emphasis({ node }) {
31
- return (_jsx("em", { children: _jsx(MyST, { ast: node.children }) }));
30
+ emphasis({ node, className }) {
31
+ return (_jsx("em", { className: className, children: _jsx(MyST, { ast: node.children }) }));
32
32
  },
33
- underline({ node }) {
34
- return (_jsx("span", { style: { textDecoration: 'underline' }, children: _jsx(MyST, { ast: node.children }) }));
33
+ underline({ node, className }) {
34
+ return (_jsx("span", { style: { textDecoration: 'underline' }, className: className, children: _jsx(MyST, { ast: node.children }) }));
35
35
  },
36
- smallcaps({ node }) {
37
- return (_jsx("span", { style: { fontVariant: 'small-caps' }, children: _jsx(MyST, { ast: node.children }) }));
36
+ smallcaps({ node, className }) {
37
+ return (_jsx("span", { style: { fontVariant: 'small-caps' }, className: className, children: _jsx(MyST, { ast: node.children }) }));
38
38
  },
39
- link({ node }) {
40
- return (_jsx("a", { target: "_blank", href: node.url, className: node.class, rel: "noreferrer", children: _jsx(MyST, { ast: node.children }) }));
39
+ link({ node, className }) {
40
+ return (_jsx("a", { target: "_blank", href: node.url, className: classNames(node.class, className), rel: "noreferrer", children: _jsx(MyST, { ast: node.children }) }));
41
41
  },
42
- paragraph({ node }) {
43
- return (_jsx("p", { id: node.html_id, children: _jsx(MyST, { ast: node.children }) }));
42
+ paragraph({ node, className }) {
43
+ return (_jsx("p", { id: node.html_id, className: className, children: _jsx(MyST, { ast: node.children }) }));
44
44
  },
45
- algorithmLine({ node }) {
45
+ algorithmLine({ node, className }) {
46
46
  var _a;
47
47
  // Used in algorithms
48
48
  const style = {
49
49
  paddingLeft: `${((_a = node.indent) !== null && _a !== void 0 ? _a : 0) + 2}rem`,
50
50
  };
51
- return (_jsx("p", { className: "line", style: style, "data-line-number": node.enumerator, children: _jsx(MyST, { ast: node.children }) }));
51
+ return (_jsx("p", { className: classNames('line', className), style: style, "data-line-number": node.enumerator, children: _jsx(MyST, { ast: node.children }) }));
52
52
  },
53
- break() {
54
- return _jsx("br", {});
53
+ break({ className }) {
54
+ return _jsx("br", { className: className });
55
55
  },
56
- inlineMath({ node }) {
57
- return _jsx("code", { children: node.value });
56
+ inlineMath({ node, className }) {
57
+ return _jsx("code", { className: className, children: node.value });
58
58
  },
59
- math({ node }) {
60
- return _jsx("code", { children: node.value });
59
+ math({ node, className }) {
60
+ return _jsx("code", { className: className, children: node.value });
61
61
  },
62
- list({ node }) {
62
+ list({ node, className }) {
63
63
  if (node.ordered) {
64
- return (_jsx("ol", { start: node.start || undefined, id: node.html_id, children: _jsx(MyST, { ast: node.children }) }));
64
+ return (_jsx("ol", { start: node.start || undefined, id: node.html_id, className: className, children: _jsx(MyST, { ast: node.children }) }));
65
65
  }
66
- return (_jsx("ul", { id: node.html_id, children: _jsx(MyST, { ast: node.children }) }));
66
+ return (_jsx("ul", { id: node.html_id, className: className, children: _jsx(MyST, { ast: node.children }) }));
67
67
  },
68
- listItem({ node }) {
68
+ listItem({ node, className }) {
69
69
  if (node.checked == null) {
70
- return (_jsx("li", { children: _jsx(MyST, { ast: node.children }) }));
70
+ return (_jsx("li", { className: className, children: _jsx(MyST, { ast: node.children }) }));
71
71
  }
72
- return (_jsxs("li", { className: "task-list-item", children: [_jsx("input", { type: "checkbox", className: "task-list-item-checkbox", defaultChecked: node.checked }), _jsx(MyST, { ast: node.children })] }));
72
+ return (_jsxs("li", { className: classNames('task-list-item', className), children: [_jsx("input", { type: "checkbox", className: "task-list-item-checkbox", defaultChecked: node.checked }), _jsx(MyST, { ast: node.children })] }));
73
73
  },
74
- container({ node }) {
74
+ container({ node, className }) {
75
75
  const figureName = `fig-${node.kind}`;
76
- return (_jsx("figure", { id: node.html_id || node.identifier || node.key, className: classNames({ [figureName]: !!node.kind, subcontainer: node.subcontainer }, node.class), children: _jsx(MyST, { ast: node.children }) }));
76
+ return (_jsx("figure", { id: node.html_id || node.identifier || node.key, className: classNames({ [figureName]: !!node.kind, subcontainer: node.subcontainer }, node.class, className), children: _jsx(MyST, { ast: node.children }) }));
77
77
  },
78
- caption({ node }) {
79
- return (_jsx("figcaption", { className: "group", children: _jsx(MyST, { ast: node.children }) }));
78
+ caption({ node, className }) {
79
+ return (_jsx("figcaption", { className: classNames('group', className), children: _jsx(MyST, { ast: node.children }) }));
80
80
  },
81
- legend({ node }) {
82
- return (_jsx("figcaption", { className: "text-sm", children: _jsx(MyST, { ast: node.children }) }));
81
+ legend({ node, className }) {
82
+ return (_jsx("figcaption", { className: classNames('text-sm', className), children: _jsx(MyST, { ast: node.children }) }));
83
83
  },
84
- blockquote({ node }) {
85
- return (_jsx("blockquote", { id: node.html_id, children: _jsx(MyST, { ast: node.children }) }));
84
+ blockquote({ node, className }) {
85
+ return (_jsx("blockquote", { id: node.html_id, className: className, children: _jsx(MyST, { ast: node.children }) }));
86
86
  },
87
87
  thematicBreak() {
88
88
  return _jsx("hr", { className: "py-2 my-5 translate-y-2" });
89
89
  },
90
- captionNumber({ node }) {
90
+ captionNumber({ node, className }) {
91
91
  const id = node.html_id || node.identifier || node.key;
92
- return (_jsx(HashLink, { id: id, kind: node.kind, className: "mr-1 font-semibold text-inherit hover:text-inherit hover:font-semibold", children: _jsx(MyST, { ast: node.children }) }));
92
+ return (_jsx(HashLink, { id: id, kind: node.kind, className: classNames('mr-1 font-semibold text-inherit hover:text-inherit hover:font-semibold', className), children: _jsx(MyST, { ast: node.children }) }));
93
93
  },
94
- table({ node }) {
94
+ table({ node, className }) {
95
95
  // TODO: actually render the tbody on the server if it isn't included here.
96
- return (_jsx("table", { className: node.class, style: node.style, children: _jsx("tbody", { children: _jsx(MyST, { ast: node.children }) }) }));
96
+ return (_jsx("table", { className: classNames(node.class, className), style: node.style, children: _jsx("tbody", { children: _jsx(MyST, { ast: node.children }) }) }));
97
97
  },
98
- tableRow({ node }) {
99
- return (_jsx("tr", { className: node.class, style: node.style, children: _jsx(MyST, { ast: node.children }) }));
98
+ tableRow({ node, className }) {
99
+ return (_jsx("tr", { className: classNames(node.class, className), style: node.style, children: _jsx(MyST, { ast: node.children }) }));
100
100
  },
101
- tableCell({ node }) {
101
+ tableCell({ node, className }) {
102
102
  const ifGreaterThanOne = (num) => (num === 1 ? undefined : num);
103
103
  const attrs = {
104
104
  rowSpan: ifGreaterThanOne(node.rowspan),
@@ -110,17 +110,17 @@ const BASIC_RENDERERS = {
110
110
  'text-center': node.align === 'center',
111
111
  };
112
112
  if (node.header)
113
- return (_jsx("th", Object.assign({ className: classNames(node.class, align), style: node.style }, attrs, { children: _jsx(MyST, { ast: node.children }) })));
114
- return (_jsx("td", Object.assign({ className: classNames(node.class, align), style: node.style }, attrs, { children: _jsx(MyST, { ast: node.children }) })));
113
+ return (_jsx("th", Object.assign({ className: classNames(node.class, align, className), style: node.style }, attrs, { children: _jsx(MyST, { ast: node.children }) })));
114
+ return (_jsx("td", Object.assign({ className: classNames(node.class, align, className), style: node.style }, attrs, { children: _jsx(MyST, { ast: node.children }) })));
115
115
  },
116
- subscript({ node }) {
117
- return (_jsx("sub", { children: _jsx(MyST, { ast: node.children }) }));
116
+ subscript({ node, className }) {
117
+ return (_jsx("sub", { className: className, children: _jsx(MyST, { ast: node.children }) }));
118
118
  },
119
- superscript({ node }) {
120
- return (_jsx("sup", { children: _jsx(MyST, { ast: node.children }) }));
119
+ superscript({ node, className }) {
120
+ return (_jsx("sup", { className: className, children: _jsx(MyST, { ast: node.children }) }));
121
121
  },
122
- abbreviation({ node }) {
123
- return (_jsx(Tooltip, { title: node.title, children: _jsx("abbr", { "aria-label": node.title, className: "border-b border-dotted cursor-help", children: _jsx(MyST, { ast: node.children }) }) }));
122
+ abbreviation({ node, className }) {
123
+ return (_jsx(Tooltip, { title: node.title, className: classNames(className), children: _jsx("abbr", { "aria-label": node.title, className: "border-b border-dotted cursor-help", children: _jsx(MyST, { ast: node.children }) }) }));
124
124
  },
125
125
  mystComment() {
126
126
  return null;
@@ -128,28 +128,28 @@ const BASIC_RENDERERS = {
128
128
  comment() {
129
129
  return null;
130
130
  },
131
- definitionList({ node }) {
132
- return (_jsx("dl", { className: "my-5", id: node.html_id || node.identifier || node.key, children: _jsx(MyST, { ast: node.children }) }));
131
+ definitionList({ node, className }) {
132
+ return (_jsx("dl", { className: classNames('my-5', className), id: node.html_id || node.identifier || node.key, children: _jsx(MyST, { ast: node.children }) }));
133
133
  },
134
- definitionTerm({ node }) {
134
+ definitionTerm({ node, className }) {
135
135
  var _a, _b;
136
136
  const allowedStrongTypes = new Set(['text', 'emphasis']);
137
137
  const makeStrong = (_b = (_a = node.children) === null || _a === void 0 ? void 0 : _a.reduce((allowed, n) => allowed && allowedStrongTypes.has(n.type), true)) !== null && _b !== void 0 ? _b : false;
138
- return (_jsx("dt", { id: node.html_id || node.identifier || node.key, children: makeStrong ? (_jsx("strong", { children: _jsx(MyST, { ast: node.children }) })) : (_jsx(MyST, { ast: node.children })) }));
138
+ return (_jsx("dt", { id: node.html_id || node.identifier || node.key, className: className, children: makeStrong ? (_jsx("strong", { children: _jsx(MyST, { ast: node.children }) })) : (_jsx(MyST, { ast: node.children })) }));
139
139
  },
140
- definitionDescription({ node }) {
141
- return (_jsx("dd", { children: _jsx(MyST, { ast: node.children }) }));
140
+ definitionDescription({ node, className }) {
141
+ return (_jsx("dd", { className: className, children: _jsx(MyST, { ast: node.children }) }));
142
142
  },
143
- keyboard({ node }) {
144
- return (_jsx("kbd", { children: _jsx(MyST, { ast: node.children }) }));
143
+ keyboard({ node, className }) {
144
+ return (_jsx("kbd", { className: className, children: _jsx(MyST, { ast: node.children }) }));
145
145
  },
146
- include({ node }) {
146
+ include({ node, className }) {
147
147
  // TODO, provider could give context about the filename
148
- return _jsx(MyST, { ast: node.children });
148
+ return _jsx(MyST, { ast: node.children, className: className });
149
149
  },
150
- glossary({ node }) {
150
+ glossary({ node, className }) {
151
151
  // TODO, provider could give context about the filename
152
- return (_jsx("div", { id: node.html_id || node.identifier || node.key, className: node.class, children: _jsx(MyST, { ast: node.children }) }));
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
154
  };
155
155
  export default BASIC_RENDERERS;
@@ -1 +1 @@
1
- {"version":3,"file":"card.d.ts","sourceRoot":"","sources":["../src/card.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAM1D,KAAK,QAAQ,GAAG;IACd,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,OAAO,CAAC;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AAEF,QAAA,MAAM,cAAc;;;;;CAKnB,CAAC;AAEF,eAAe,cAAc,CAAC"}
package/dist/card.js CHANGED
@@ -2,14 +2,14 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import classNames from 'classnames';
3
3
  import { useLinkProvider, useBaseurl, withBaseurl } from '@myst-theme/providers';
4
4
  import { MyST } from './MyST.js';
5
- export const Header = ({ node }) => {
6
- return (_jsx("header", { className: "py-1 pl-3 m-0 border-b border-gray-100 bg-gray-50 dark:bg-slate-900 dark:border-gray-800", children: _jsx(MyST, { ast: node.children }) }));
5
+ export const Header = ({ node, className }) => {
6
+ return (_jsx("header", { className: classNames('py-1 pl-3 m-0 border-b border-gray-100 bg-gray-50 dark:bg-slate-900 dark:border-gray-800', className), children: _jsx(MyST, { ast: node.children }) }));
7
7
  };
8
- export const Footer = ({ node }) => {
9
- return (_jsx("footer", { className: "py-1 pl-3 m-0 border-t border-gray-100 bg-gray-50 dark:bg-slate-900 dark:border-gray-800", children: _jsx(MyST, { ast: node.children }) }));
8
+ export const Footer = ({ node, className }) => {
9
+ return (_jsx("footer", { className: classNames('py-1 pl-3 m-0 border-t border-gray-100 bg-gray-50 dark:bg-slate-900 dark:border-gray-800', className), children: _jsx(MyST, { ast: node.children }) }));
10
10
  };
11
- export const CardTitle = ({ node }) => {
12
- return (_jsx("div", { className: "pt-3 font-bold group-hover:underline", children: _jsx(MyST, { ast: node.children }) }));
11
+ export const CardTitle = ({ node, className }) => {
12
+ return (_jsx("div", { className: classNames('pt-3 font-bold group-hover:underline', className), children: _jsx(MyST, { ast: node.children }) }));
13
13
  };
14
14
  function getParts(children) {
15
15
  var _a, _b;
@@ -34,16 +34,16 @@ function ExternalOrInternalLink({ to, className, isStatic, prefetch = 'intent',
34
34
  }
35
35
  return (_jsx(Link, { to: withBaseurl(to, baseurl), className: className, prefetch: prefetch, children: children }));
36
36
  }
37
- export const CardRenderer = ({ node }) => {
37
+ export const CardRenderer = ({ node, className }) => {
38
38
  const parts = getParts(node.children);
39
39
  const url = node.url;
40
40
  const isStatic = node.static || false;
41
41
  const link = !!url;
42
42
  const sharedStyle = 'my-5 rounded shadow dark:shadow-neutral-800 overflow-hidden border border-gray-100 dark:border-gray-800 flex flex-col';
43
43
  if (link) {
44
- return (_jsxs(ExternalOrInternalLink, { to: url, isStatic: isStatic, className: classNames(sharedStyle, 'text-inherit hover:text-inherit', 'block font-normal no-underline hover:no-underline cursor-pointer group', 'hover:border-blue-500 dark:hover:border-blue-400'), children: [_jsx(MyST, { ast: parts.header }), _jsx("div", { className: "flex-grow px-4 py-2", children: _jsx(MyST, { ast: parts.body }) }), _jsx(MyST, { ast: parts.footer })] }));
44
+ return (_jsxs(ExternalOrInternalLink, { to: url, isStatic: isStatic, className: classNames(sharedStyle, 'text-inherit hover:text-inherit', 'block font-normal no-underline hover:no-underline cursor-pointer group', 'hover:border-blue-500 dark:hover:border-blue-400', className), children: [_jsx(MyST, { ast: parts.header }), _jsx("div", { className: "flex-grow px-4 py-2", children: _jsx(MyST, { ast: parts.body }) }), _jsx(MyST, { ast: parts.footer })] }));
45
45
  }
46
- return (_jsxs("div", { className: sharedStyle, children: [_jsx(MyST, { ast: parts.header }), _jsx("div", { className: "flex-grow px-4 py-2", children: _jsx(MyST, { ast: parts.body }) }), _jsx(MyST, { ast: parts.footer })] }));
46
+ return (_jsxs("div", { className: classNames(sharedStyle, className), children: [_jsx(MyST, { ast: parts.header }), _jsx("div", { className: "flex-grow px-4 py-2", children: _jsx(MyST, { ast: parts.body }) }), _jsx(MyST, { ast: parts.footer })] }));
47
47
  };
48
48
  const CARD_RENDERERS = {
49
49
  card: CardRenderer,
package/dist/cite.d.ts CHANGED
@@ -1,10 +1,11 @@
1
1
  import type { NodeRenderer } from '@myst-theme/providers';
2
2
  import type { GenericParent } from 'myst-common';
3
3
  export declare const CiteGroup: NodeRenderer<GenericParent>;
4
- export declare const Cite: ({ label, error, children, }: {
4
+ export declare const Cite: ({ label, error, children, className, }: {
5
5
  label?: string;
6
6
  error?: boolean;
7
7
  children: React.ReactNode;
8
+ className?: string;
8
9
  }) => import("react/jsx-runtime").JSX.Element;
9
10
  export declare const CiteRenderer: NodeRenderer;
10
11
  declare const CITE_RENDERERS: Record<string, NodeRenderer>;
@@ -1 +1 @@
1
- {"version":3,"file":"cite.d.ts","sourceRoot":"","sources":["../src/cite.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAK1D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAiBjD,eAAO,MAAM,SAAS,EAAE,YAAY,CAAC,aAAa,CAcjD,CAAC;AAEF,eAAO,MAAM,IAAI,gCAId;IACD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B,4CAsBA,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,YAO1B,CAAC;AAEF,QAAA,MAAM,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,YAAY,CAGhD,CAAC;AAEF,eAAe,cAAc,CAAC"}
1
+ {"version":3,"file":"cite.d.ts","sourceRoot":"","sources":["../src/cite.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAK1D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAiBjD,eAAO,MAAM,SAAS,EAAE,YAAY,CAAC,aAAa,CAiBjD,CAAC;AAEF,eAAO,MAAM,IAAI,2CAKd;IACD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,4CA4BA,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,YAO1B,CAAC;AAEF,QAAA,MAAM,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,YAAY,CAGhD,CAAC;AAEF,eAAe,cAAc,CAAC"}
package/dist/cite.js CHANGED
@@ -14,7 +14,7 @@ function useNumberedReferences() {
14
14
  function CiteChild({ html }) {
15
15
  return (_jsx("div", { className: "hover-document article w-[500px] sm:max-w-[500px] p-3", dangerouslySetInnerHTML: { __html: html || '' } }));
16
16
  }
17
- export const CiteGroup = ({ node }) => {
17
+ export const CiteGroup = ({ node, className }) => {
18
18
  var _a, _b;
19
19
  const allCite = (_b = (_a = node.children) === null || _a === void 0 ? void 0 : _a.every((child) => child.type === 'cite')) !== null && _b !== void 0 ? _b : false;
20
20
  return (_jsx("span", { className: classNames({
@@ -22,24 +22,24 @@ export const CiteGroup = ({ node }) => {
22
22
  'xref-group': !allCite,
23
23
  narrative: node.kind === 'narrative',
24
24
  parenthetical: node.kind === 'parenthetical',
25
- }), children: _jsx(MyST, { ast: node.children }) }));
25
+ }, className), children: _jsx(MyST, { ast: node.children }) }));
26
26
  };
27
- export const Cite = ({ label, error, children, }) => {
27
+ export const Cite = ({ label, error, children, className, }) => {
28
28
  var _a, _b;
29
29
  const references = useReferences();
30
30
  if (!label) {
31
- return _jsx(InlineError, { value: "cite (no label)", message: 'Citation Has No Label' });
31
+ return (_jsx(InlineError, { value: "cite (no label)", message: 'Citation Has No Label', className: className }));
32
32
  }
33
33
  const { html, doi: doiString, url: refUrl } = (_b = (_a = references === null || references === void 0 ? void 0 : references.cite) === null || _a === void 0 ? void 0 : _a.data[label]) !== null && _b !== void 0 ? _b : {};
34
34
  if (error) {
35
- return _jsx(InlineError, { value: label, message: 'Citation Not Found' });
35
+ return _jsx(InlineError, { value: label, message: 'Citation Not Found', className: className });
36
36
  }
37
37
  const url = doiString ? doi.buildUrl(doiString) : refUrl;
38
- return (_jsx(HoverPopover, { openDelay: 300, card: _jsx(CiteChild, { html: html }), children: _jsxs("cite", { children: [url && (_jsx("a", { href: url, target: "_blank", rel: "noreferrer", className: "hover-link", children: children })), !url && _jsx("span", { className: "hover-link", children: children })] }) }));
38
+ return (_jsx(HoverPopover, { openDelay: 300, card: _jsx(CiteChild, { html: html }), children: _jsxs("cite", { className: className, children: [url && (_jsx("a", { href: url, target: "_blank", rel: "noreferrer", className: "hover-link", children: children })), !url && _jsx("span", { className: "hover-link", children: children })] }) }));
39
39
  };
40
- export const CiteRenderer = ({ node }) => {
40
+ export const CiteRenderer = ({ node, className }) => {
41
41
  const numbered = useNumberedReferences();
42
- return (_jsx(Cite, { label: node.label, error: node.error, children: numbered && node.kind === 'parenthetical' ? node.enumerator : _jsx(MyST, { ast: node.children }) }));
42
+ return (_jsx(Cite, { label: node.label, error: node.error, className: className, children: numbered && node.kind === 'parenthetical' ? node.enumerator : _jsx(MyST, { ast: node.children }) }));
43
43
  };
44
44
  const CITE_RENDERERS = {
45
45
  citeGroup: CiteGroup,
@@ -1 +1 @@
1
- {"version":3,"file":"code.d.ts","sourceRoot":"","sources":["../src/code.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAU1D,KAAK,KAAK,GAAG;IACX,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;IAC1B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAaF,wBAAgB,SAAS,CAAC,KAAK,EAAE,KAAK,2CAiFrC;AA2DD,QAAA,MAAM,cAAc;;;CAGnB,CAAC;AAEF,eAAe,cAAc,CAAC"}
1
+ {"version":3,"file":"code.d.ts","sourceRoot":"","sources":["../src/code.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAU1D,KAAK,KAAK,GAAG;IACX,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;IAC1B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAaF,wBAAgB,SAAS,CAAC,KAAK,EAAE,KAAK,2CAiFrC;AAgED,QAAA,MAAM,cAAc;;;CAGnB,CAAC;AAEF,eAAe,cAAc,CAAC"}
package/dist/code.js CHANGED
@@ -55,8 +55,8 @@ export function CodeBlock(props) {
55
55
  'border border-l-4 border-l-blue-400 border-gray-200 dark:border-l-blue-400 dark:border-gray-800': border,
56
56
  }), children: [filename && (_jsxs("div", { className: "flex flex-row pl-2 bg-white border-b dark:bg-slate-600 dark:border-slate-300", children: [_jsx(DocumentIcon, { width: "16px", height: "16px", className: "self-center flex-none inline-block text-gray-500 dark:text-gray-100" }), _jsx("div", { className: "self-center p-2 text-sm leading-3 prose text-slate-600 dark:text-white", children: filename })] })), _jsx(SyntaxHighlighter, Object.assign({}, highlighterProps, { className: "block p-3 hljs", children: value })), showCopy && (_jsx(CopyIcon, { text: value, className: classNames('absolute right-1', { 'top-[32px]': filename, 'top-1': !filename }) }))] }));
57
57
  }
58
- const code = ({ node }) => {
59
- const child = (_jsx(CodeBlock, { identifier: node.html_id, "data-mdast-node-type": node.type, "data-mdast-node-id": node.key, value: node.value || '', lang: node.lang, filename: node.filename, emphasizeLines: node.emphasizeLines, showLineNumbers: node.showLineNumbers, startingLineNumber: node.startingLineNumber, shadow: true, border: node.executable, background: !node.executable, className: classNames({ hidden: node.visibility === 'remove' }, node.class) }));
58
+ const code = ({ node, className }) => {
59
+ const child = (_jsx(CodeBlock, { identifier: node.html_id, "data-mdast-node-type": node.type, "data-mdast-node-id": node.key, value: node.value || '', lang: node.lang, filename: node.filename, emphasizeLines: node.emphasizeLines, showLineNumbers: node.showLineNumbers, startingLineNumber: node.startingLineNumber, shadow: true, border: node.executable, background: !node.executable, className: classNames({ hidden: node.visibility === 'remove' }, node.class, className) }));
60
60
  if (node.visibility === 'hide') {
61
61
  return _jsx(Details, { title: "Source", children: child });
62
62
  }
@@ -73,15 +73,15 @@ function isColor(maybeColorHash) {
73
73
  const color = match[1];
74
74
  return color;
75
75
  }
76
- const inlineCode = ({ node }) => {
76
+ const inlineCode = ({ node, className }) => {
77
77
  if (isColor(node.value)) {
78
- return (_jsxs("code", { className: "px-1 rounded bg-slate-100 text-slate-700 dark:bg-slate-800 dark:text-slate-100", children: [node.value, _jsx("span", { style: { backgroundColor: node.value }, className: "inline-block w-[10px] h-[10px] rounded-full ml-1" })] }));
78
+ return (_jsxs("code", { className: classNames('px-1 rounded bg-slate-100 text-slate-700 dark:bg-slate-800 dark:text-slate-100', className), children: [node.value, _jsx("span", { style: { backgroundColor: node.value }, className: "inline-block w-[10px] h-[10px] rounded-full ml-1" })] }));
79
79
  }
80
80
  if (node.children && node.children.length > 0) {
81
81
  // The inline code can potentially have children
82
- return (_jsx("code", { children: _jsx(MyST, { ast: node.children }) }));
82
+ return (_jsx("code", { className: className, children: _jsx(MyST, { ast: node.children }) }));
83
83
  }
84
- return _jsx("code", { children: node.value });
84
+ return _jsx("code", { className: className, children: node.value });
85
85
  };
86
86
  const CODE_RENDERERS = {
87
87
  code,
@@ -8,8 +8,9 @@ export declare function HoverPopover({ children, openDelay, card, side, arrowCla
8
8
  load: boolean;
9
9
  }) => React.ReactNode);
10
10
  }): import("react/jsx-runtime").JSX.Element;
11
- export declare function Tooltip({ title, children, }: {
11
+ export declare function Tooltip({ title, children, className, }: {
12
12
  title: React.ReactNode;
13
13
  children: React.ReactNode;
14
+ className?: string;
14
15
  }): import("react/jsx-runtime").JSX.Element;
15
16
  //# sourceMappingURL=HoverPopover.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"HoverPopover.d.ts","sourceRoot":"","sources":["../../src/components/HoverPopover.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAGxC,wBAAgB,YAAY,CAAC,EAC3B,QAAQ,EACR,SAAe,EACf,IAAI,EACJ,IAAI,EACJ,UAAyB,GAC1B,EAAE;IACD,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,IAAI,CAAC,EAAE,KAAK,GAAG,OAAO,GAAG,QAAQ,GAAG,MAAM,CAAC;IAC3C,IAAI,EAAE,KAAK,CAAC,SAAS,GAAG,CAAC,CAAC,IAAI,EAAE;QAAE,IAAI,EAAE,OAAO,CAAA;KAAE,KAAK,KAAK,CAAC,SAAS,CAAC,CAAC;CACxE,2CAmBA;AAED,wBAAgB,OAAO,CAAC,EACtB,KAAK,EACL,QAAQ,GACT,EAAE;IACD,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B,2CAcA"}
1
+ {"version":3,"file":"HoverPopover.d.ts","sourceRoot":"","sources":["../../src/components/HoverPopover.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAIxC,wBAAgB,YAAY,CAAC,EAC3B,QAAQ,EACR,SAAe,EACf,IAAI,EACJ,IAAI,EACJ,UAAyB,GAC1B,EAAE;IACD,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,IAAI,CAAC,EAAE,KAAK,GAAG,OAAO,GAAG,QAAQ,GAAG,MAAM,CAAC;IAC3C,IAAI,EAAE,KAAK,CAAC,SAAS,GAAG,CAAC,CAAC,IAAI,EAAE;QAAE,IAAI,EAAE,OAAO,CAAA;KAAE,KAAK,KAAK,CAAC,SAAS,CAAC,CAAC;CACxE,2CAmBA;AAED,wBAAgB,OAAO,CAAC,EACtB,KAAK,EACL,QAAQ,EACR,SAAS,GACV,EAAE;IACD,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,2CAmBA"}
@@ -1,10 +1,11 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { useState } from 'react';
3
3
  import * as HoverCard from '@radix-ui/react-hover-card';
4
+ import classNames from 'classnames';
4
5
  export function HoverPopover({ children, openDelay = 400, card, side, arrowClass = 'fill-white', }) {
5
6
  const [load, setLoad] = useState(false);
6
7
  return (_jsxs(HoverCard.Root, { openDelay: openDelay, children: [_jsx(HoverCard.Trigger, { asChild: true, onMouseEnter: () => setLoad(true), children: children }), _jsx(HoverCard.Portal, { children: _jsxs(HoverCard.Content, { className: "exclude-from-outline hover-card-content", sideOffset: 5, side: side, children: [typeof card === 'function' ? load && card({ load }) : card, _jsx(HoverCard.Arrow, { className: arrowClass })] }) })] }));
7
8
  }
8
- export function Tooltip({ title, children, }) {
9
- return (_jsx(HoverPopover, { side: "top", card: _jsx("div", { className: "p-1 text-xs text-white bg-blue-900 dark:bg-white dark:text-black", children: title }), arrowClass: "fill-blue-900 dark:fill-white", children: children }));
9
+ export function Tooltip({ title, children, className, }) {
10
+ return (_jsx(HoverPopover, { side: "top", card: _jsx("div", { className: classNames('p-1 text-xs text-white bg-blue-900 dark:bg-white dark:text-black', className), children: title }), arrowClass: "fill-blue-900 dark:fill-white", children: children }));
10
11
  }
@@ -1 +1 @@
1
- {"version":3,"file":"crossReference.d.ts","sourceRoot":"","sources":["../src/crossReference.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAChD,OAAO,EAOL,KAAK,YAAY,EAElB,MAAM,uBAAuB,CAAC;AA6E/B,wBAAgB,aAAa,CAAC,EAC5B,MAAM,EACN,GAAG,EACH,aAAa,EACb,OAAO,GACR,EAAE;IACD,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,4CAIA;AAqBD,wBAAgB,mBAAmB,CAAC,EAClC,GAAG,EAAE,KAAK,EACV,OAAO,EAAE,SAAS,EAClB,MAAM,EAAE,QAAQ,EAChB,aAAa,EAAE,eAAe,EAC9B,QAAQ,EACR,UAAU,EACV,SAAS,EACT,MAAW,GACZ,EAAE;IACD,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B,2CAuEA;AAED,eAAO,MAAM,kBAAkB,EAAE,YAAY,CAAC,cAAc,CAiC3D,CAAC;AAEF,QAAA,MAAM,yBAAyB;;CAE9B,CAAC;AAEF,eAAe,yBAAyB,CAAC"}
1
+ {"version":3,"file":"crossReference.d.ts","sourceRoot":"","sources":["../src/crossReference.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAChD,OAAO,EAOL,KAAK,YAAY,EAElB,MAAM,uBAAuB,CAAC;AA6E/B,wBAAgB,aAAa,CAAC,EAC5B,MAAM,EACN,GAAG,EACH,aAAa,EACb,OAAO,GACR,EAAE;IACD,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,4CAIA;AAqBD,wBAAgB,mBAAmB,CAAC,EAClC,GAAG,EAAE,KAAK,EACV,OAAO,EAAE,SAAS,EAClB,MAAM,EAAE,QAAQ,EAChB,aAAa,EAAE,eAAe,EAC9B,QAAQ,EACR,UAAU,EACV,SAAS,EACT,MAAW,GACZ,EAAE;IACD,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B,2CAuEA;AAED,eAAO,MAAM,kBAAkB,EAAE,YAAY,CAAC,cAAc,CAkC3D,CAAC;AAEF,QAAA,MAAM,yBAAyB;;CAE9B,CAAC;AAEF,eAAe,yBAAyB,CAAC"}
@@ -102,12 +102,12 @@ export function CrossReferenceHover({ url: urlIn, dataUrl: dataUrlIn, remote: re
102
102
  const isButtonLike = (className !== null && className !== void 0 ? className : '').split(' ').includes('button');
103
103
  return (_jsx(HoverPopover, { card: ({ load }) => (_jsx(XRefProvider, { remote: remote, remoteBaseUrl: remoteBaseUrl, url: url, dataUrl: dataUrl, children: _jsxs("div", { className: "hover-document article w-[500px] sm:max-w-[500px] overflow-auto", children: [remoteBaseUrl && (_jsxs("div", { className: "w-full px-3 py-1 text-xs border-b bg-gray-50", children: [_jsx("strong", { className: "text-gray-700", children: "Source: " }), _jsx("a", { className: classNames('text-gray-700', className), href: `${createRemoteBaseUrl(url, remoteBaseUrl)}${htmlId ? `#${htmlId}` : ''}`, target: "_blank", children: remoteBaseUrl })] })), _jsx("div", { className: "px-3", children: _jsx(XrefChildren, { load: load, identifier: identifier }) })] }) })), children: _jsxs("span", { children: [remote && external && (_jsx("a", { href: `${createRemoteBaseUrl(url, remoteBaseUrl)}${htmlId ? `#${htmlId}` : ''}`, target: "_blank", className: classNames({ 'hover-link': !isButtonLike }, className), children: children })), remote && !external && (_jsx(Link, { to: `${withBaseurl(url, baseurl)}${htmlId ? `#${htmlId}` : ''}`, prefetch: "intent", className: classNames({ 'hover-link': !isButtonLike }, className), children: children })), !remote && (_jsx("a", { href: `#${htmlId}`, onClick: scroll, className: classNames({ 'hover-link': !isButtonLike }, className), children: children }))] }) }));
104
104
  }
105
- export const CrossReferenceNode = ({ node }) => {
105
+ export const CrossReferenceNode = ({ node, className }) => {
106
106
  if (!node.children) {
107
- return (_jsx(InlineError, { value: node.label || node.identifier || 'No Label', message: "Cross Reference Not Found" }));
107
+ return (_jsx(InlineError, { value: node.label || node.identifier || 'No Label', message: "Cross Reference Not Found", className: className }));
108
108
  }
109
- const { remote, url, dataUrl, remoteBaseUrl, identifier, html_id, class: className, } = node;
110
- return (_jsxs(CrossReferenceHover, { identifier: identifier, htmlId: html_id, remote: remote, url: url, dataUrl: dataUrl, remoteBaseUrl: remoteBaseUrl, className: className, children: [node.prefix && _jsxs(_Fragment, { children: [node.prefix, " "] }), _jsx(MyST, { ast: node.children }), node.suffix || null] }));
109
+ const { remote, url, dataUrl, remoteBaseUrl, identifier, html_id, class: nodeClass, } = node;
110
+ return (_jsxs(CrossReferenceHover, { identifier: identifier, htmlId: html_id, remote: remote, url: url, dataUrl: dataUrl, remoteBaseUrl: remoteBaseUrl, className: classNames(nodeClass, className), children: [node.prefix && _jsxs(_Fragment, { children: [node.prefix, " "] }), _jsx(MyST, { ast: node.children }), node.suffix || null] }));
111
111
  };
112
112
  const CROSS_REFERENCE_RENDERERS = {
113
113
  crossReference: CrossReferenceNode,
@@ -1 +1 @@
1
- {"version":3,"file":"dropdown.d.ts","sourceRoot":"","sources":["../src/dropdown.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAK1D,KAAK,YAAY,GAAG;IAClB,IAAI,EAAE,SAAS,CAAC;IAChB,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB,CAAC;AACF,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,SAAS,CAAC;CACjB,CAAC;AAIF,eAAO,MAAM,YAAY,EAAE,YAAY,CAAC,WAAW,CAElD,CAAC;AAEF,wBAAgB,OAAO,CAAC,EACtB,KAAK,EACL,QAAQ,EACR,IAAI,EACJ,SAAS,GACV,EAAE;IACD,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,2CA+BA;AAED,eAAO,MAAM,eAAe,EAAE,YAAY,CAAC,YAAY,CAOtD,CAAC;AAEF,QAAA,MAAM,kBAAkB;;;CAGvB,CAAC;AAEF,eAAe,kBAAkB,CAAC"}
1
+ {"version":3,"file":"dropdown.d.ts","sourceRoot":"","sources":["../src/dropdown.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAK1D,KAAK,YAAY,GAAG;IAClB,IAAI,EAAE,SAAS,CAAC;IAChB,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB,CAAC;AACF,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,SAAS,CAAC;CACjB,CAAC;AAIF,eAAO,MAAM,YAAY,EAAE,YAAY,CAAC,WAAW,CAElD,CAAC;AAEF,wBAAgB,OAAO,CAAC,EACtB,KAAK,EACL,QAAQ,EACR,IAAI,EACJ,SAAS,GACV,EAAE;IACD,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,2CA+BA;AAED,eAAO,MAAM,eAAe,EAAE,YAAY,CAAC,YAAY,CAWtD,CAAC;AAEF,QAAA,MAAM,kBAAkB;;;CAGvB,CAAC;AAEF,eAAe,kBAAkB,CAAC"}
package/dist/dropdown.js CHANGED
@@ -3,15 +3,15 @@ import { ChevronRightIcon } from '@heroicons/react/24/solid';
3
3
  import classNames from 'classnames';
4
4
  import { MyST } from './MyST.js';
5
5
  const iconClass = 'inline-block pl-2 mr-2 -translate-y-[1px]';
6
- export const SummaryTitle = ({ node }) => {
7
- return _jsx(MyST, { ast: node.children });
6
+ export const SummaryTitle = ({ node, className }) => {
7
+ return _jsx(MyST, { ast: node.children, className: className });
8
8
  };
9
9
  export function Details({ title, children, open, className, }) {
10
10
  return (_jsxs("details", { className: classNames('rounded-md my-5 shadow dark:shadow-2xl dark:shadow-neutral-900 overflow-hidden', 'bg-gray-50 dark:bg-stone-800', className), open: open, children: [_jsx("summary", { className: classNames('m-0 text-lg font-medium py-1 min-h-[2em] pl-3', 'cursor-pointer hover:shadow-[inset_0_0_0px_30px_#00000003] dark:hover:shadow-[inset_0_0_0px_30px_#FFFFFF03]', 'bg-gray-100 dark:bg-slate-900'), children: _jsxs("span", { className: "text-neutral-900 dark:text-white", children: [_jsx("span", { className: "block float-right text-sm font-thin text-neutral-700 dark:text-neutral-200", children: _jsx(ChevronRightIcon, { width: "1.5rem", height: "1.5rem", className: classNames(iconClass, 'details-toggle', 'transition-transform') }) }), title] }) }), _jsx("div", { className: "px-4 py-1 details-body", children: children })] }));
11
11
  }
12
- export const DetailsRenderer = ({ node }) => {
12
+ export const DetailsRenderer = ({ node, className }) => {
13
13
  const [title, ...rest] = node.children;
14
- return (_jsx(Details, { title: _jsx(MyST, { ast: [title] }), open: node.open, className: node.class, children: _jsx(MyST, { ast: rest }) }));
14
+ return (_jsx(Details, { title: _jsx(MyST, { ast: [title] }), open: node.open, className: classNames(node.class, className), children: _jsx(MyST, { ast: rest }) }));
15
15
  };
16
16
  const DROPDOWN_RENDERERS = {
17
17
  details: DetailsRenderer,
@@ -2,12 +2,13 @@ import type { Admonition as AdmonitionSpec } from 'myst-spec';
2
2
  import React from 'react';
3
3
  import type { NodeRenderer } from '@myst-theme/providers';
4
4
  type Color = 'gray' | 'blue' | 'green' | 'yellow' | 'orange' | 'red' | 'purple';
5
- export declare function Callout({ title, color, dropdown, children, identifier, Icon, }: {
5
+ export declare function Callout({ title, color, dropdown, children, identifier, className, Icon, }: {
6
6
  title?: React.ReactNode;
7
7
  color?: Color;
8
8
  children: React.ReactNode;
9
9
  dropdown?: boolean;
10
10
  identifier?: string;
11
+ className?: string;
11
12
  Icon?: (props: {
12
13
  width?: string;
13
14
  height?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"exercise.d.ts","sourceRoot":"","sources":["../src/exercise.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,IAAI,cAAc,EAAE,MAAM,WAAW,CAAC;AAC9D,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAO1D,KAAK,KAAK,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,QAAQ,GAAG,QAAQ,GAAG,KAAK,GA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