myst-to-react 0.3.0 → 0.3.2

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 (73) hide show
  1. package/dist/cjs/admonitions.js +10 -10
  2. package/dist/cjs/basic.js +14 -14
  3. package/dist/cjs/card.js +8 -8
  4. package/dist/cjs/cite.js +4 -4
  5. package/dist/cjs/code.js +4 -4
  6. package/dist/cjs/components/CopyIcon.js +2 -2
  7. package/dist/cjs/components/HoverPopover.js +1 -1
  8. package/dist/cjs/components/LinkCard.js +2 -2
  9. package/dist/cjs/crossReference.js +2 -2
  10. package/dist/cjs/dropdown.js +2 -2
  11. package/dist/cjs/exercise.js +13 -13
  12. package/dist/cjs/extensions/chemicalFormula.d.ts +1 -1
  13. package/dist/cjs/extensions/chemicalFormula.js +2 -2
  14. package/dist/cjs/extensions/siunits.d.ts +1 -1
  15. package/dist/cjs/extensions/siunits.js +1 -1
  16. package/dist/cjs/footnotes.d.ts +1 -1
  17. package/dist/cjs/footnotes.js +2 -2
  18. package/dist/cjs/grid.js +2 -2
  19. package/dist/cjs/heading.js +4 -4
  20. package/dist/cjs/iframe.d.ts +1 -1
  21. package/dist/cjs/iframe.js +3 -3
  22. package/dist/cjs/inlineError.js +1 -1
  23. package/dist/cjs/inlineExpression.d.ts +1 -1
  24. package/dist/cjs/inlineExpression.js +1 -1
  25. package/dist/cjs/links/github.js +7 -7
  26. package/dist/cjs/links/index.js +9 -9
  27. package/dist/cjs/links/rrid.js +4 -4
  28. package/dist/cjs/links/wiki.js +3 -3
  29. package/dist/cjs/math.js +2 -2
  30. package/dist/cjs/proof.js +9 -9
  31. package/dist/cjs/tabs.js +8 -8
  32. package/dist/cjs/unknown.d.ts +1 -1
  33. package/dist/cjs/unknown.js +1 -1
  34. package/dist/esm/admonitions.js +9 -9
  35. package/dist/esm/basic.js +14 -14
  36. package/dist/esm/card.js +8 -8
  37. package/dist/esm/cite.js +4 -4
  38. package/dist/esm/code.js +4 -4
  39. package/dist/esm/components/CopyIcon.js +2 -2
  40. package/dist/esm/components/HoverPopover.js +1 -1
  41. package/dist/esm/components/LinkCard.js +2 -2
  42. package/dist/esm/crossReference.js +2 -2
  43. package/dist/esm/dropdown.js +2 -2
  44. package/dist/esm/exercise.js +13 -13
  45. package/dist/esm/extensions/chemicalFormula.d.ts +1 -1
  46. package/dist/esm/extensions/chemicalFormula.js +2 -2
  47. package/dist/esm/extensions/siunits.d.ts +1 -1
  48. package/dist/esm/extensions/siunits.js +1 -1
  49. package/dist/esm/footnotes.d.ts +1 -1
  50. package/dist/esm/footnotes.js +2 -2
  51. package/dist/esm/grid.js +2 -2
  52. package/dist/esm/heading.js +4 -4
  53. package/dist/esm/iframe.d.ts +1 -1
  54. package/dist/esm/iframe.js +3 -3
  55. package/dist/esm/inlineError.js +1 -1
  56. package/dist/esm/inlineExpression.d.ts +1 -1
  57. package/dist/esm/inlineExpression.js +1 -1
  58. package/dist/esm/links/github.js +7 -7
  59. package/dist/esm/links/index.js +9 -9
  60. package/dist/esm/links/rrid.js +4 -4
  61. package/dist/esm/links/wiki.js +3 -3
  62. package/dist/esm/math.js +2 -2
  63. package/dist/esm/proof.js +8 -8
  64. package/dist/esm/tabs.js +8 -8
  65. package/dist/esm/unknown.d.ts +1 -1
  66. package/dist/esm/unknown.js +1 -1
  67. package/dist/types/extensions/chemicalFormula.d.ts +1 -1
  68. package/dist/types/extensions/siunits.d.ts +1 -1
  69. package/dist/types/footnotes.d.ts +1 -1
  70. package/dist/types/iframe.d.ts +1 -1
  71. package/dist/types/inlineExpression.d.ts +1 -1
  72. package/dist/types/unknown.d.ts +1 -1
  73. package/package.json +8 -20
@@ -32,7 +32,7 @@ var AdmonitionKind;
32
32
  AdmonitionKind["seealso"] = "seealso";
33
33
  AdmonitionKind["tip"] = "tip";
34
34
  AdmonitionKind["warning"] = "warning";
35
- })(AdmonitionKind = exports.AdmonitionKind || (exports.AdmonitionKind = {}));
35
+ })(AdmonitionKind || (exports.AdmonitionKind = AdmonitionKind = {}));
36
36
  function getClasses(className) {
37
37
  var _a;
38
38
  const classes = (_a = className === null || className === void 0 ? void 0 : className.split(' ').map((s) => s.trim().toLowerCase()).filter((s) => !!s)) !== null && _a !== void 0 ? _a : [];
@@ -102,23 +102,23 @@ const AdmonitionTitle = (node, children) => {
102
102
  exports.AdmonitionTitle = AdmonitionTitle;
103
103
  const WrapperElement = ({ dropdown, className, children, }) => {
104
104
  if (dropdown)
105
- return (0, jsx_runtime_1.jsx)("details", Object.assign({ className: className }, { children: children }));
106
- return (0, jsx_runtime_1.jsx)("aside", Object.assign({ className: className }, { children: children }));
105
+ return (0, jsx_runtime_1.jsx)("details", { className: className, children: children });
106
+ return (0, jsx_runtime_1.jsx)("aside", { className: className, children: children });
107
107
  };
108
108
  const HeaderElement = ({ dropdown, className, children, }) => {
109
109
  if (dropdown)
110
- return (0, jsx_runtime_1.jsx)("summary", Object.assign({ className: className }, { children: children }));
111
- return (0, jsx_runtime_1.jsx)("div", Object.assign({ className: className }, { children: children }));
110
+ return (0, jsx_runtime_1.jsx)("summary", { className: className, children: children });
111
+ return (0, jsx_runtime_1.jsx)("div", { className: className, children: children });
112
112
  };
113
113
  function Admonition({ title, kind, color, simple, dropdown, children, hideIcon, }) {
114
- return ((0, jsx_runtime_1.jsxs)(WrapperElement, Object.assign({ dropdown: dropdown, className: (0, classnames_1.default)('my-5 shadow-md dark:shadow-2xl dark:shadow-neutral-900', 'bg-gray-50/10 dark:bg-stone-800', 'overflow-hidden', {
114
+ return ((0, jsx_runtime_1.jsxs)(WrapperElement, { dropdown: dropdown, className: (0, classnames_1.default)('my-5 shadow-md dark:shadow-2xl dark:shadow-neutral-900', 'bg-gray-50/10 dark:bg-stone-800', 'overflow-hidden', {
115
115
  'rounded border-l-4': !simple,
116
116
  'border-l-2': simple,
117
117
  'border-blue-500': !color || color === 'blue',
118
118
  'border-green-600': color === 'green',
119
119
  'border-amber-600': color === 'yellow',
120
120
  'border-red-600': color === 'red',
121
- }) }, { children: [title && ((0, jsx_runtime_1.jsxs)(HeaderElement, Object.assign({ dropdown: dropdown, className: (0, classnames_1.default)('m-0 font-medium py-1 flex min-w-0', {
121
+ }), children: [title && ((0, jsx_runtime_1.jsxs)(HeaderElement, { dropdown: dropdown, className: (0, classnames_1.default)('m-0 font-medium py-1 flex min-w-0', {
122
122
  'text-lg': !simple,
123
123
  'text-md': simple,
124
124
  'bg-gray-100 dark:bg-stone-700': simple,
@@ -127,13 +127,13 @@ function Admonition({ title, kind, color, simple, dropdown, children, hideIcon,
127
127
  'text-amber-600 bg-amber-50 dark:bg-slate-900': !simple && color === 'yellow',
128
128
  'text-red-600 bg-red-50 dark:bg-slate-900': !simple && color === 'red',
129
129
  'cursor-pointer hover:shadow-[inset_0_0_0px_30px_#00000003] dark:hover:shadow-[inset_0_0_0px_30px_#FFFFFF03]': dropdown,
130
- }) }, { children: [!hideIcon && ((0, jsx_runtime_1.jsx)(AdmonitionIcon, { kind: kind !== null && kind !== void 0 ? kind : AdmonitionKind.note, className: (0, classnames_1.default)({
130
+ }), children: [!hideIcon && ((0, jsx_runtime_1.jsx)(AdmonitionIcon, { kind: kind !== null && kind !== void 0 ? kind : AdmonitionKind.note, className: (0, classnames_1.default)({
131
131
  // Needed for simple!
132
132
  'text-blue-600': !color || color === 'blue',
133
133
  'text-green-600': color === 'green',
134
134
  'text-amber-600': color === 'yellow',
135
135
  'text-red-600': color === 'red',
136
- }) })), (0, jsx_runtime_1.jsx)("div", Object.assign({ className: (0, classnames_1.default)('text-neutral-900 dark:text-white grow self-center overflow-hidden break-words', { 'ml-4': hideIcon }) }, { children: title })), dropdown && ((0, jsx_runtime_1.jsx)("div", Object.assign({ className: "font-thin text-sm text-neutral-700 dark:text-neutral-200 self-center flex-none" }, { children: (0, jsx_runtime_1.jsx)(ChevronRightIcon_1.default, { className: (0, classnames_1.default)(iconClass, 'transition-transform details-toggle') }) })))] }))), (0, jsx_runtime_1.jsx)("div", Object.assign({ className: (0, classnames_1.default)('px-4', { 'py-1': !simple, 'details-body': dropdown }) }, { children: children }))] })));
136
+ }) })), (0, jsx_runtime_1.jsx)("div", { className: (0, classnames_1.default)('text-neutral-900 dark:text-white grow self-center overflow-hidden break-words', { 'ml-4': hideIcon }), children: title }), dropdown && ((0, jsx_runtime_1.jsx)("div", { className: "font-thin text-sm text-neutral-700 dark:text-neutral-200 self-center flex-none", children: (0, jsx_runtime_1.jsx)(ChevronRightIcon_1.default, { className: (0, classnames_1.default)(iconClass, 'transition-transform details-toggle') }) }))] })), (0, jsx_runtime_1.jsx)("div", { className: (0, classnames_1.default)('px-4', { 'py-1': !simple, 'details-body': dropdown }), children: children })] }));
137
137
  }
138
138
  exports.Admonition = Admonition;
139
139
  const AdmonitionRenderer = (node, children) => {
@@ -145,7 +145,7 @@ const AdmonitionRenderer = (node, children) => {
145
145
  const isSimple = classes.includes('simple');
146
146
  const hideIcon = node.icon === false;
147
147
  const useTitle = ((_a = node.children) === null || _a === void 0 ? void 0 : _a[0].type) === 'admonitionTitle';
148
- return ((0, jsx_runtime_1.jsxs)(Admonition, Object.assign({ title: useTitle ? title : undefined, kind: kind, color: color, dropdown: isDropdown, simple: isSimple, hideIcon: hideIcon }, { children: [!useTitle && title, rest] }), node.key));
148
+ return ((0, jsx_runtime_1.jsxs)(Admonition, { title: useTitle ? title : undefined, kind: kind, color: color, dropdown: isDropdown, simple: isSimple, hideIcon: hideIcon, children: [!useTitle && title, rest] }, node.key));
149
149
  };
150
150
  exports.AdmonitionRenderer = AdmonitionRenderer;
151
151
  const ADMONITION_RENDERERS = {
package/dist/cjs/basic.js CHANGED
@@ -18,16 +18,16 @@ const BASIC_RENDERERS = {
18
18
  return (0, jsx_runtime_1.jsx)("em", { children: children }, node.key);
19
19
  },
20
20
  underline(node, children) {
21
- return ((0, jsx_runtime_1.jsx)("span", Object.assign({ style: { textDecoration: 'underline' } }, { children: children }), node.key));
21
+ return ((0, jsx_runtime_1.jsx)("span", { style: { textDecoration: 'underline' }, children: children }, node.key));
22
22
  },
23
23
  smallcaps(node, children) {
24
- return ((0, jsx_runtime_1.jsx)("span", Object.assign({ style: { fontVariant: 'small-caps' } }, { children: children }), node.key));
24
+ return ((0, jsx_runtime_1.jsx)("span", { style: { fontVariant: 'small-caps' }, children: children }, node.key));
25
25
  },
26
26
  link(node, children) {
27
- return ((0, jsx_runtime_1.jsx)("a", Object.assign({ target: "_blank", href: node.url, rel: "noreferrer" }, { children: children }), node.key));
27
+ return ((0, jsx_runtime_1.jsx)("a", { target: "_blank", href: node.url, rel: "noreferrer", children: children }, node.key));
28
28
  },
29
29
  paragraph(node, children) {
30
- return ((0, jsx_runtime_1.jsx)("p", Object.assign({ id: node.html_id }, { children: children }), node.key));
30
+ return ((0, jsx_runtime_1.jsx)("p", { id: node.html_id, children: children }, node.key));
31
31
  },
32
32
  break(node) {
33
33
  return (0, jsx_runtime_1.jsx)("br", {}, node.key);
@@ -40,24 +40,24 @@ const BASIC_RENDERERS = {
40
40
  },
41
41
  list(node, children) {
42
42
  if (node.ordered) {
43
- return ((0, jsx_runtime_1.jsx)("ol", Object.assign({ start: node.start || undefined, id: node.html_id }, { children: children }), node.key));
43
+ return ((0, jsx_runtime_1.jsx)("ol", { start: node.start || undefined, id: node.html_id, children: children }, node.key));
44
44
  }
45
- return ((0, jsx_runtime_1.jsx)("ul", Object.assign({ id: node.html_id }, { children: children }), node.key));
45
+ return ((0, jsx_runtime_1.jsx)("ul", { id: node.html_id, children: children }, node.key));
46
46
  },
47
47
  listItem(node, children) {
48
48
  if (node.checked == null) {
49
49
  return (0, jsx_runtime_1.jsx)("li", { children: children }, node.key);
50
50
  }
51
- return ((0, jsx_runtime_1.jsxs)("li", Object.assign({ className: "task-list-item" }, { children: [(0, jsx_runtime_1.jsx)("input", { type: "checkbox", className: "task-list-item-checkbox", defaultChecked: node.checked }), children] }), node.key));
51
+ return ((0, jsx_runtime_1.jsxs)("li", { className: "task-list-item", children: [(0, jsx_runtime_1.jsx)("input", { type: "checkbox", className: "task-list-item-checkbox", defaultChecked: node.checked }), children] }, node.key));
52
52
  },
53
53
  container(node, children) {
54
- return ((0, jsx_runtime_1.jsx)("figure", Object.assign({ id: node.html_id || node.identifier || node.key, className: (0, classnames_1.default)(node.kind, node.class) }, { children: children }), node.key));
54
+ return ((0, jsx_runtime_1.jsx)("figure", { id: node.html_id || node.identifier || node.key, className: (0, classnames_1.default)(node.kind, node.class), children: children }, node.key));
55
55
  },
56
56
  caption(node, children) {
57
- return ((0, jsx_runtime_1.jsx)("figcaption", Object.assign({ className: "group" }, { children: children }), node.key));
57
+ return ((0, jsx_runtime_1.jsx)("figcaption", { className: "group", children: children }, node.key));
58
58
  },
59
59
  blockquote(node, children) {
60
- return ((0, jsx_runtime_1.jsx)("blockquote", Object.assign({ id: node.html_id }, { children: children }), node.key));
60
+ return ((0, jsx_runtime_1.jsx)("blockquote", { id: node.html_id, children: children }, node.key));
61
61
  },
62
62
  thematicBreak(node) {
63
63
  return (0, jsx_runtime_1.jsx)("hr", { className: "py-2 my-5 translate-y-2" }, node.key);
@@ -71,7 +71,7 @@ const BASIC_RENDERERS = {
71
71
  }
72
72
  const label = typeof children === 'string' ? backwardsCompatibleLabel(children, node.kind) : children;
73
73
  const id = node.html_id || node.identifier || node.key;
74
- return ((0, jsx_runtime_1.jsx)(heading_1.HashLink, Object.assign({ id: id, kind: node.kind, className: "mr-1 text-inherit hover:text-inherit font-semibold hover:font-semibold" }, { children: label }), node.key));
74
+ return ((0, jsx_runtime_1.jsx)(heading_1.HashLink, { id: id, kind: node.kind, className: "mr-1 text-inherit hover:text-inherit font-semibold hover:font-semibold", children: label }, node.key));
75
75
  },
76
76
  table(node, children) {
77
77
  // TODO: actually render the tbody on the server if it isn't included here.
@@ -98,7 +98,7 @@ const BASIC_RENDERERS = {
98
98
  return (0, jsx_runtime_1.jsx)("sup", { children: children }, node.key);
99
99
  },
100
100
  abbreviation(node, children) {
101
- return ((0, jsx_runtime_1.jsx)(HoverPopover_1.HoverPopover, Object.assign({ side: "top", card: (0, jsx_runtime_1.jsx)("div", Object.assign({ className: "bg-blue-900 text-white dark:bg-white dark:text-black text-xs p-1" }, { children: node.title })), arrowClass: "fill-blue-900 dark:fill-white" }, { children: (0, jsx_runtime_1.jsx)("abbr", Object.assign({ "aria-label": node.title, className: "cursor-help border-b border-dotted" }, { children: children })) }), node.key));
101
+ return ((0, jsx_runtime_1.jsx)(HoverPopover_1.HoverPopover, { side: "top", card: (0, jsx_runtime_1.jsx)("div", { className: "bg-blue-900 text-white dark:bg-white dark:text-black text-xs p-1", children: node.title }), arrowClass: "fill-blue-900 dark:fill-white", children: (0, jsx_runtime_1.jsx)("abbr", { "aria-label": node.title, className: "cursor-help border-b border-dotted", children: children }) }, node.key));
102
102
  },
103
103
  mystComment() {
104
104
  return null;
@@ -107,7 +107,7 @@ const BASIC_RENDERERS = {
107
107
  return null;
108
108
  },
109
109
  definitionList(node, children) {
110
- return ((0, jsx_runtime_1.jsx)("dl", Object.assign({ className: "my-5", id: node.html_id }, { children: children }), node.key));
110
+ return ((0, jsx_runtime_1.jsx)("dl", { className: "my-5", id: node.html_id, children: children }, node.key));
111
111
  },
112
112
  definitionTerm(node, children) {
113
113
  let strongChildren = children;
@@ -124,7 +124,7 @@ const BASIC_RENDERERS = {
124
124
  else if (typeof children === 'string') {
125
125
  strongChildren = (0, jsx_runtime_1.jsx)("strong", { children: children }, node.key + '0');
126
126
  }
127
- return ((0, jsx_runtime_1.jsx)("dt", Object.assign({ id: node.html_id }, { children: strongChildren }), node.key));
127
+ return ((0, jsx_runtime_1.jsx)("dt", { id: node.html_id, children: strongChildren }, node.key));
128
128
  },
129
129
  definitionDescription(node, children) {
130
130
  return (0, jsx_runtime_1.jsx)("dd", { children: children }, node.key);
package/dist/cjs/card.js CHANGED
@@ -8,15 +8,15 @@ const jsx_runtime_1 = require("react/jsx-runtime");
8
8
  const classnames_1 = __importDefault(require("classnames"));
9
9
  const providers_1 = require("@myst-theme/providers");
10
10
  const Header = (node, children) => {
11
- return ((0, jsx_runtime_1.jsx)("header", Object.assign({ className: "m-0 py-1 pl-3 bg-gray-50 dark:bg-slate-900 border-b border-gray-100 dark:border-gray-800" }, { children: children }), node.key));
11
+ return ((0, jsx_runtime_1.jsx)("header", { className: "m-0 py-1 pl-3 bg-gray-50 dark:bg-slate-900 border-b border-gray-100 dark:border-gray-800", children: children }, node.key));
12
12
  };
13
13
  exports.Header = Header;
14
14
  const Footer = (node, children) => {
15
- return ((0, jsx_runtime_1.jsx)("footer", Object.assign({ className: "m-0 py-1 pl-3 bg-gray-50 dark:bg-slate-900 border-t border-gray-100 dark:border-gray-800" }, { children: children }), node.key));
15
+ return ((0, jsx_runtime_1.jsx)("footer", { className: "m-0 py-1 pl-3 bg-gray-50 dark:bg-slate-900 border-t border-gray-100 dark:border-gray-800", children: children }, node.key));
16
16
  };
17
17
  exports.Footer = Footer;
18
18
  const CardTitle = (node, children) => {
19
- return ((0, jsx_runtime_1.jsx)("div", Object.assign({ className: "pt-3 font-bold group-hover:underline" }, { children: children }), node.key));
19
+ return ((0, jsx_runtime_1.jsx)("div", { className: "pt-3 font-bold group-hover:underline", children: children }, node.key));
20
20
  };
21
21
  exports.CardTitle = CardTitle;
22
22
  function getParts(children) {
@@ -38,21 +38,21 @@ function ExternalOrInternalLink({ to, className, isStatic, prefetch = 'intent',
38
38
  const Link = (0, providers_1.useLinkProvider)();
39
39
  const baseurl = (0, providers_1.useBaseurl)();
40
40
  if (to.startsWith('http') || isStatic) {
41
- return ((0, jsx_runtime_1.jsx)("a", Object.assign({ href: to, className: className, target: "_blank", rel: "noopener noreferrer" }, { children: children })));
41
+ return ((0, jsx_runtime_1.jsx)("a", { href: to, className: className, target: "_blank", rel: "noopener noreferrer", children: children }));
42
42
  }
43
- return ((0, jsx_runtime_1.jsx)(Link, Object.assign({ to: (0, providers_1.withBaseurl)(to, baseurl), className: className, prefetch: prefetch }, { children: children })));
43
+ return ((0, jsx_runtime_1.jsx)(Link, { to: (0, providers_1.withBaseurl)(to, baseurl), className: className, prefetch: prefetch, children: children }));
44
44
  }
45
45
  function Card({ children, url, isStatic, }) {
46
46
  const parts = getParts(children);
47
47
  const link = !!url;
48
48
  const sharedStyle = 'my-5 rounded shadow dark:shadow-neutral-800 overflow-hidden border border-gray-100 dark:border-gray-800 flex flex-col';
49
49
  if (link) {
50
- return ((0, jsx_runtime_1.jsxs)(ExternalOrInternalLink, Object.assign({ to: url, isStatic: isStatic, className: (0, classnames_1.default)(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: [parts.header, (0, jsx_runtime_1.jsx)("div", Object.assign({ className: "py-2 px-4 flex-grow" }, { children: parts.body })), parts.footer] })));
50
+ return ((0, jsx_runtime_1.jsxs)(ExternalOrInternalLink, { to: url, isStatic: isStatic, className: (0, classnames_1.default)(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: [parts.header, (0, jsx_runtime_1.jsx)("div", { className: "py-2 px-4 flex-grow", children: parts.body }), parts.footer] }));
51
51
  }
52
- return ((0, jsx_runtime_1.jsxs)("div", Object.assign({ className: sharedStyle }, { children: [parts.header, (0, jsx_runtime_1.jsx)("div", Object.assign({ className: "py-2 px-4 flex-grow" }, { children: parts.body })), parts.footer] })));
52
+ return ((0, jsx_runtime_1.jsxs)("div", { className: sharedStyle, children: [parts.header, (0, jsx_runtime_1.jsx)("div", { className: "py-2 px-4 flex-grow", children: parts.body }), parts.footer] }));
53
53
  }
54
54
  const CardRenderer = (node, children) => {
55
- return ((0, jsx_runtime_1.jsx)(Card, Object.assign({ url: node.url, isStatic: node.static || false }, { children: children }), node.key));
55
+ return ((0, jsx_runtime_1.jsx)(Card, { url: node.url, isStatic: node.static || false, children: children }, node.key));
56
56
  };
57
57
  exports.CardRenderer = CardRenderer;
58
58
  const CARD_RENDERERS = {
package/dist/cjs/cite.js CHANGED
@@ -14,10 +14,10 @@ function CiteChild({ html }) {
14
14
  return ((0, jsx_runtime_1.jsx)("div", { className: "hover-document w-[500px] sm:max-w-[500px] p-3", dangerouslySetInnerHTML: { __html: html || '' } }));
15
15
  }
16
16
  const CiteGroup = (node, children) => {
17
- return ((0, jsx_runtime_1.jsx)("span", Object.assign({ className: (0, classnames_1.default)('cite-group', {
17
+ return ((0, jsx_runtime_1.jsx)("span", { className: (0, classnames_1.default)('cite-group', {
18
18
  narrative: node.kind === 'narrative',
19
19
  parenthetical: node.kind === 'parenthetical',
20
- }) }, { children: children }), node.key));
20
+ }), children: children }, node.key));
21
21
  };
22
22
  exports.CiteGroup = CiteGroup;
23
23
  const Cite = ({ label, error, children, }) => {
@@ -31,11 +31,11 @@ const Cite = ({ label, error, children, }) => {
31
31
  return (0, jsx_runtime_1.jsx)(inlineError_1.InlineError, { value: label, message: 'Citation Not Found' });
32
32
  }
33
33
  const doiUrl = doiString ? doi_utils_1.doi.buildUrl(doiString) : null;
34
- return ((0, jsx_runtime_1.jsx)(HoverPopover_1.HoverPopover, Object.assign({ openDelay: 300, card: (0, jsx_runtime_1.jsx)(CiteChild, { html: html }) }, { children: (0, jsx_runtime_1.jsxs)("cite", Object.assign({ className: "hover-link" }, { children: [doiUrl && ((0, jsx_runtime_1.jsx)("a", Object.assign({ href: doiUrl, target: "_blank", rel: "noreferrer", className: "hover-link" }, { children: children }))), !doiUrl && children] })) })));
34
+ return ((0, jsx_runtime_1.jsx)(HoverPopover_1.HoverPopover, { openDelay: 300, card: (0, jsx_runtime_1.jsx)(CiteChild, { html: html }), children: (0, jsx_runtime_1.jsxs)("cite", { className: "hover-link", children: [doiUrl && ((0, jsx_runtime_1.jsx)("a", { href: doiUrl, target: "_blank", rel: "noreferrer", className: "hover-link", children: children })), !doiUrl && children] }) }));
35
35
  };
36
36
  exports.Cite = Cite;
37
37
  const CiteRenderer = (node, children) => {
38
- return ((0, jsx_runtime_1.jsx)(exports.Cite, Object.assign({ label: node.label, error: node.error }, { children: children }), node.key));
38
+ return ((0, jsx_runtime_1.jsx)(exports.Cite, { label: node.label, error: node.error, children: children }, node.key));
39
39
  };
40
40
  exports.CiteRenderer = CiteRenderer;
41
41
  const CITE_RENDERERS = {
package/dist/cjs/code.js CHANGED
@@ -23,11 +23,11 @@ function CodeBlock(props) {
23
23
  const { isLight } = (0, providers_1.useTheme)();
24
24
  const { value, lang, identifier, emphasizeLines, showLineNumbers, className, showCopy = true, startingLineNumber = 1, filename, shadow, background, border, } = props;
25
25
  const highlightLines = new Set(emphasizeLines);
26
- return ((0, jsx_runtime_1.jsxs)("div", Object.assign({ id: identifier, className: (0, classnames_1.default)('relative group not-prose overflow-auto', className, {
26
+ return ((0, jsx_runtime_1.jsxs)("div", { id: identifier, className: (0, classnames_1.default)('relative group not-prose overflow-auto', className, {
27
27
  'shadow hover:shadow-md dark:shadow-2xl dark:shadow-neutral-900 my-5 text-sm': shadow,
28
28
  'bg-stone-200/10': background,
29
29
  'border border-l-4 border-l-blue-400 border-gray-200 dark:border-l-blue-400 dark:border-gray-800': border,
30
- }) }, { children: [filename && (0, jsx_runtime_1.jsx)("div", Object.assign({ className: "leading-3 mt-1 p-1" }, { children: filename })), (0, jsx_runtime_1.jsx)(react_syntax_highlighter_1.LightAsync, Object.assign({ language: normalizeLanguage(lang), startingLineNumber: startingLineNumber, showLineNumbers: showLineNumbers, style: isLight ? Object.assign(Object.assign({}, xcode_1.default), { hljs: Object.assign(Object.assign({}, xcode_1.default.hljs), { background: 'transparent' }) }) : vs2015_1.default, wrapLines: true, lineNumberContainerStyle: {
30
+ }), children: [filename && (0, jsx_runtime_1.jsx)("div", { className: "leading-3 mt-1 p-1", children: filename }), (0, jsx_runtime_1.jsx)(react_syntax_highlighter_1.LightAsync, { language: normalizeLanguage(lang), startingLineNumber: startingLineNumber, showLineNumbers: showLineNumbers, style: isLight ? Object.assign(Object.assign({}, xcode_1.default), { hljs: Object.assign(Object.assign({}, xcode_1.default.hljs), { background: 'transparent' }) }) : vs2015_1.default, wrapLines: true, lineNumberContainerStyle: {
31
31
  // This stops page content shifts
32
32
  display: 'inline-block',
33
33
  float: 'left',
@@ -45,7 +45,7 @@ function CodeBlock(props) {
45
45
  'data-highlight': 'true',
46
46
  }
47
47
  : { 'data-line-number': `${line}` };
48
- }, customStyle: { padding: '0.8rem' } }, { children: value })), showCopy && ((0, jsx_runtime_1.jsx)("div", Object.assign({ className: "absolute hidden top-1 right-1 group-hover:block" }, { children: (0, jsx_runtime_1.jsx)(CopyIcon_1.CopyIcon, { text: value }) })))] })));
48
+ }, customStyle: { padding: '0.8rem' }, children: value }), showCopy && ((0, jsx_runtime_1.jsx)("div", { className: "absolute hidden top-1 right-1 group-hover:block", children: (0, jsx_runtime_1.jsx)(CopyIcon_1.CopyIcon, { text: value }) }))] }));
49
49
  }
50
50
  exports.CodeBlock = CodeBlock;
51
51
  const code = (node) => {
@@ -64,7 +64,7 @@ function isColor(maybeColorHash) {
64
64
  }
65
65
  const inlineCode = (node, children) => {
66
66
  if (isColor(node.value)) {
67
- return ((0, jsx_runtime_1.jsxs)("code", Object.assign({ className: "bg-slate-100 text-slate-700 dark:bg-slate-800 dark:text-slate-100 px-1 rounded" }, { children: [children, (0, jsx_runtime_1.jsx)("span", { style: { backgroundColor: node.value }, className: "inline-block w-[10px] h-[10px] rounded-full ml-1" })] }), node.key));
67
+ return ((0, jsx_runtime_1.jsxs)("code", { className: "bg-slate-100 text-slate-700 dark:bg-slate-800 dark:text-slate-100 px-1 rounded", children: [children, (0, jsx_runtime_1.jsx)("span", { style: { backgroundColor: node.value }, className: "inline-block w-[10px] h-[10px] rounded-full ml-1" })] }, node.key));
68
68
  }
69
69
  return (0, jsx_runtime_1.jsx)("code", { children: children }, node.key);
70
70
  };
@@ -19,9 +19,9 @@ function CopyIcon({ text }) {
19
19
  setTimeout(() => setCopied(false), 3000);
20
20
  });
21
21
  };
22
- return ((0, jsx_runtime_1.jsx)("button", Object.assign({ title: copied ? 'Copied!!' : 'Copy to Clipboard', className: (0, classnames_1.default)('inline-flex items-center opacity-60 hover:opacity-100 active:opacity-40 cursor-pointer ml-2', 'transition-color duration-200 ease-in-out', {
22
+ return ((0, jsx_runtime_1.jsx)("button", { title: copied ? 'Copied!!' : 'Copy to Clipboard', className: (0, classnames_1.default)('inline-flex items-center opacity-60 hover:opacity-100 active:opacity-40 cursor-pointer ml-2', 'transition-color duration-200 ease-in-out', {
23
23
  'text-blue-500 border-blue-500': !copied,
24
24
  'text-green-500 border-green-500 ': copied,
25
- }), onClick: onClick, "aria-pressed": copied ? 'true' : 'false', "aria-label": "Copy code to clipboard" }, { children: copied ? ((0, jsx_runtime_1.jsx)(CheckIcon_1.default, { className: "w-[24px] h-[24px] text-success" })) : ((0, jsx_runtime_1.jsx)(DocumentDuplicateIcon_1.default, { className: "w-[24px] h-[24px]" })) })));
25
+ }), onClick: onClick, "aria-pressed": copied ? 'true' : 'false', "aria-label": "Copy code to clipboard", children: copied ? ((0, jsx_runtime_1.jsx)(CheckIcon_1.default, { className: "w-[24px] h-[24px] text-success" })) : ((0, jsx_runtime_1.jsx)(DocumentDuplicateIcon_1.default, { className: "w-[24px] h-[24px]" })) }));
26
26
  }
27
27
  exports.CopyIcon = CopyIcon;
@@ -29,6 +29,6 @@ const react_1 = require("react");
29
29
  const HoverCard = __importStar(require("@radix-ui/react-hover-card"));
30
30
  function HoverPopover({ children, openDelay = 400, card, side, arrowClass = 'fill-white', }) {
31
31
  const [load, setLoad] = (0, react_1.useState)(false);
32
- return ((0, jsx_runtime_1.jsxs)(HoverCard.Root, Object.assign({ openDelay: openDelay }, { children: [(0, jsx_runtime_1.jsx)(HoverCard.Trigger, Object.assign({ asChild: true, onMouseEnter: () => setLoad(true) }, { children: children })), (0, jsx_runtime_1.jsx)(HoverCard.Portal, { children: (0, jsx_runtime_1.jsxs)(HoverCard.Content, Object.assign({ className: "exclude-from-outline hover-card-content", sideOffset: 5, side: side }, { children: [typeof card === 'function' ? load && card({ load }) : card, (0, jsx_runtime_1.jsx)(HoverCard.Arrow, { className: arrowClass })] })) })] })));
32
+ return ((0, jsx_runtime_1.jsxs)(HoverCard.Root, { openDelay: openDelay, children: [(0, jsx_runtime_1.jsx)(HoverCard.Trigger, { asChild: true, onMouseEnter: () => setLoad(true), children: children }), (0, jsx_runtime_1.jsx)(HoverCard.Portal, { children: (0, jsx_runtime_1.jsxs)(HoverCard.Content, { className: "exclude-from-outline hover-card-content", sideOffset: 5, side: side, children: [typeof card === 'function' ? load && card({ load }) : card, (0, jsx_runtime_1.jsx)(HoverCard.Arrow, { className: arrowClass })] }) })] }));
33
33
  }
34
34
  exports.HoverPopover = HoverPopover;
@@ -12,8 +12,8 @@ function LinkCard({ url, title, internal = false, loading = false, description,
12
12
  const Link = (0, providers_1.useLinkProvider)();
13
13
  const baseurl = (0, providers_1.useBaseurl)();
14
14
  const to = (0, providers_1.withBaseurl)(url, baseurl);
15
- return ((0, jsx_runtime_1.jsxs)("div", Object.assign({ className: (0, classnames_1.default)('hover-card-content rounded overflow-hidden', className, {
15
+ return ((0, jsx_runtime_1.jsxs)("div", { className: (0, classnames_1.default)('hover-card-content rounded overflow-hidden', className, {
16
16
  'animate-pulse': loading,
17
- }) }, { children: [!loading && thumbnail && ((0, jsx_runtime_1.jsx)("img", { src: thumbnail, className: "w-full h-[150px] object-cover object-top object-left m-0" })), loading && (0, jsx_runtime_1.jsx)("div", { className: "animate-pulse bg-slate-100 dark:bg-slate-800 w-full h-[150px]" }), internal && ((0, jsx_runtime_1.jsx)(Link, Object.assign({ to: to, className: "block text-sm font-semibold text-inherit hover:text-inherit px-3 mt-3", prefetch: "intent" }, { children: title }))), !internal && ((0, jsx_runtime_1.jsxs)("a", Object.assign({ href: to, className: "block text-sm font-semibold text-inherit hover:text-inherit px-3 mt-3", target: "_blank", rel: "noreferrer" }, { children: [(0, jsx_runtime_1.jsx)(ArrowTopRightOnSquareIcon_1.default, { className: "w-4 h-4 float-right" }), title] }))), !loading && description && ((0, jsx_runtime_1.jsx)("div", Object.assign({ className: "p-3 prose text-sm max-h-[300px] overflow-hidden" }, { children: description })))] })));
17
+ }), children: [!loading && thumbnail && ((0, jsx_runtime_1.jsx)("img", { src: thumbnail, className: "w-full h-[150px] object-cover object-top object-left m-0" })), loading && (0, jsx_runtime_1.jsx)("div", { className: "animate-pulse bg-slate-100 dark:bg-slate-800 w-full h-[150px]" }), internal && ((0, jsx_runtime_1.jsx)(Link, { to: to, className: "block text-sm font-semibold text-inherit hover:text-inherit px-3 mt-3", prefetch: "intent", children: title })), !internal && ((0, jsx_runtime_1.jsxs)("a", { href: to, className: "block text-sm font-semibold text-inherit hover:text-inherit px-3 mt-3", target: "_blank", rel: "noreferrer", children: [(0, jsx_runtime_1.jsx)(ArrowTopRightOnSquareIcon_1.default, { className: "w-4 h-4 float-right" }), title] })), !loading && description && ((0, jsx_runtime_1.jsx)("div", { className: "p-3 prose text-sm max-h-[300px] overflow-hidden", children: description }))] }));
18
18
  }
19
19
  exports.LinkCard = LinkCard;
@@ -144,7 +144,7 @@ function CrossReferenceHover({ url: urlIn, dataUrl: dataUrlIn, remote: remoteIn,
144
144
  el === null || el === void 0 ? void 0 : el.scrollIntoView({ behavior: 'smooth' });
145
145
  history.replaceState(undefined, '', `#${htmlId}`);
146
146
  };
147
- return ((0, jsx_runtime_1.jsx)(HoverPopover_1.HoverPopover, Object.assign({ card: ({ load }) => ((0, jsx_runtime_1.jsx)(providers_1.XRefProvider, Object.assign({ remote: remote, url: url, dataUrl: dataUrl }, { children: (0, jsx_runtime_1.jsx)("div", Object.assign({ className: "hover-document w-[500px] sm:max-w-[500px] px-3" }, { children: (0, jsx_runtime_1.jsx)(XrefChildren, { load: load, remote: remote, url: url, dataUrl: dataUrl, identifier: identifier }) })) }))) }, { children: (0, jsx_runtime_1.jsxs)("span", { children: [remote && external && ((0, jsx_runtime_1.jsx)("a", Object.assign({ href: `${url}${htmlId ? `#${htmlId}` : ''}`, target: "_blank", className: "hover-link" }, { children: children }))), remote && !external && ((0, jsx_runtime_1.jsx)(Link, Object.assign({ to: `${(0, providers_1.withBaseurl)(url, baseurl)}${htmlId ? `#${htmlId}` : ''}`, prefetch: "intent", className: "hover-link" }, { children: children }))), !remote && ((0, jsx_runtime_1.jsx)("a", Object.assign({ href: `#${htmlId}`, onClick: scroll, className: "hover-link" }, { children: children })))] }) })));
147
+ return ((0, jsx_runtime_1.jsx)(HoverPopover_1.HoverPopover, { card: ({ load }) => ((0, jsx_runtime_1.jsx)(providers_1.XRefProvider, { remote: remote, url: url, dataUrl: dataUrl, children: (0, jsx_runtime_1.jsx)("div", { className: "hover-document w-[500px] sm:max-w-[500px] px-3", children: (0, jsx_runtime_1.jsx)(XrefChildren, { load: load, remote: remote, url: url, dataUrl: dataUrl, identifier: identifier }) }) })), children: (0, jsx_runtime_1.jsxs)("span", { children: [remote && external && ((0, jsx_runtime_1.jsx)("a", { href: `${url}${htmlId ? `#${htmlId}` : ''}`, target: "_blank", className: "hover-link", children: children })), remote && !external && ((0, jsx_runtime_1.jsx)(Link, { to: `${(0, providers_1.withBaseurl)(url, baseurl)}${htmlId ? `#${htmlId}` : ''}`, prefetch: "intent", className: "hover-link", children: children })), !remote && ((0, jsx_runtime_1.jsx)("a", { href: `#${htmlId}`, onClick: scroll, className: "hover-link", children: children }))] }) }));
148
148
  }
149
149
  exports.CrossReferenceHover = CrossReferenceHover;
150
150
  const CrossReferenceNode = (node, children) => {
@@ -152,7 +152,7 @@ const CrossReferenceNode = (node, children) => {
152
152
  return ((0, jsx_runtime_1.jsx)(inlineError_1.InlineError, { value: node.label || node.identifier || 'No Label', message: "Cross Reference Not Found" }, node.key));
153
153
  }
154
154
  const { remote, url, dataUrl, identifier, html_id } = node;
155
- return ((0, jsx_runtime_1.jsx)(CrossReferenceHover, Object.assign({ identifier: identifier, htmlId: html_id, remote: remote, url: url, dataUrl: dataUrl }, { children: children }), node.key));
155
+ return ((0, jsx_runtime_1.jsx)(CrossReferenceHover, { identifier: identifier, htmlId: html_id, remote: remote, url: url, dataUrl: dataUrl, children: children }, node.key));
156
156
  };
157
157
  exports.CrossReferenceNode = CrossReferenceNode;
158
158
  const CROSS_REFERENCE_RENDERERS = {
@@ -13,12 +13,12 @@ const SummaryTitle = (node, children) => {
13
13
  };
14
14
  exports.SummaryTitle = SummaryTitle;
15
15
  function Details({ title, children, open, }) {
16
- return ((0, jsx_runtime_1.jsxs)("details", Object.assign({ className: (0, classnames_1.default)('rounded-md my-5 shadow dark:shadow-2xl dark:shadow-neutral-900 overflow-hidden', 'bg-gray-50 dark:bg-stone-800'), open: open }, { children: [(0, jsx_runtime_1.jsx)("summary", Object.assign({ className: (0, classnames_1.default)('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: (0, jsx_runtime_1.jsxs)("span", Object.assign({ className: "text-neutral-900 dark:text-white" }, { children: [(0, jsx_runtime_1.jsx)("span", Object.assign({ className: "block float-right font-thin text-sm text-neutral-700 dark:text-neutral-200" }, { children: (0, jsx_runtime_1.jsx)(ChevronRightIcon_1.default, { className: (0, classnames_1.default)(iconClass, 'details-toggle', 'transition-transform') }) })), title] })) })), (0, jsx_runtime_1.jsx)("div", Object.assign({ className: "px-4 py-1 details-body" }, { children: children }))] })));
16
+ return ((0, jsx_runtime_1.jsxs)("details", { className: (0, classnames_1.default)('rounded-md my-5 shadow dark:shadow-2xl dark:shadow-neutral-900 overflow-hidden', 'bg-gray-50 dark:bg-stone-800'), open: open, children: [(0, jsx_runtime_1.jsx)("summary", { className: (0, classnames_1.default)('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: (0, jsx_runtime_1.jsxs)("span", { className: "text-neutral-900 dark:text-white", children: [(0, jsx_runtime_1.jsx)("span", { className: "block float-right font-thin text-sm text-neutral-700 dark:text-neutral-200", children: (0, jsx_runtime_1.jsx)(ChevronRightIcon_1.default, { className: (0, classnames_1.default)(iconClass, 'details-toggle', 'transition-transform') }) }), title] }) }), (0, jsx_runtime_1.jsx)("div", { className: "px-4 py-1 details-body", children: children })] }));
17
17
  }
18
18
  exports.Details = Details;
19
19
  const DetailsRenderer = (node, children) => {
20
20
  const [title, ...rest] = children;
21
- return ((0, jsx_runtime_1.jsx)(Details, Object.assign({ title: title, open: node.open }, { children: rest }), node.key));
21
+ return ((0, jsx_runtime_1.jsx)(Details, { title: title, open: node.open, children: rest }, node.key));
22
22
  };
23
23
  exports.DetailsRenderer = DetailsRenderer;
24
24
  const DROPDOWN_RENDERERS = {
@@ -32,17 +32,17 @@ function getColor({ classes = [] }, defaultColor = 'blue') {
32
32
  }
33
33
  const WrapperElement = ({ id, dropdown, className, children, }) => {
34
34
  if (dropdown)
35
- return ((0, jsx_runtime_1.jsx)("details", Object.assign({ id: id, className: className }, { children: children })));
36
- return ((0, jsx_runtime_1.jsx)("aside", Object.assign({ id: id, className: className }, { children: children })));
35
+ return ((0, jsx_runtime_1.jsx)("details", { id: id, className: className, children: children }));
36
+ return ((0, jsx_runtime_1.jsx)("aside", { id: id, className: className, children: children }));
37
37
  };
38
38
  const HeaderElement = ({ dropdown, className, children, }) => {
39
39
  if (dropdown)
40
- return (0, jsx_runtime_1.jsx)("summary", Object.assign({ className: className }, { children: children }));
41
- return (0, jsx_runtime_1.jsx)("div", Object.assign({ className: className }, { children: children }));
40
+ return (0, jsx_runtime_1.jsx)("summary", { className: className, children: children });
41
+ return (0, jsx_runtime_1.jsx)("div", { className: className, children: children });
42
42
  };
43
43
  const iconClass = 'h-8 w-8 inline-block pl-2 mr-2 self-center flex-none';
44
44
  function Callout({ title, color, dropdown, children, identifier, Icon, }) {
45
- return ((0, jsx_runtime_1.jsxs)(WrapperElement, Object.assign({ id: identifier, dropdown: dropdown, className: (0, classnames_1.default)('my-5 shadow dark:bg-stone-800 overflow-hidden', 'dark:border-l-4 border-slate-400', {
45
+ return ((0, jsx_runtime_1.jsxs)(WrapperElement, { id: identifier, dropdown: dropdown, className: (0, classnames_1.default)('my-5 shadow dark:bg-stone-800 overflow-hidden', 'dark:border-l-4 border-slate-400', {
46
46
  'dark:border-gray-500/60': !color || color === 'gray',
47
47
  'dark:border-blue-500/60': color === 'blue',
48
48
  'dark:border-green-500/60': color === 'green',
@@ -50,7 +50,7 @@ function Callout({ title, color, dropdown, children, identifier, Icon, }) {
50
50
  'dark:border-orange-500/60': color === 'orange',
51
51
  'dark:border-red-500/60': color === 'red',
52
52
  'dark:border-purple-500/60': color === 'purple',
53
- }) }, { children: [(0, jsx_runtime_1.jsxs)(HeaderElement, Object.assign({ dropdown: dropdown, className: (0, classnames_1.default)('m-0 font-medium py-2 flex min-w-0', 'text-md', 'border-y dark:border-y-0', {
53
+ }), children: [(0, jsx_runtime_1.jsxs)(HeaderElement, { dropdown: dropdown, className: (0, classnames_1.default)('m-0 font-medium py-2 flex min-w-0', 'text-md', 'border-y dark:border-y-0', {
54
54
  'bg-gray-50/80 dark:bg-slate-900': !color || color === 'gray',
55
55
  'bg-blue-50/80 dark:bg-slate-900': color === 'blue',
56
56
  'bg-green-50/80 dark:bg-slate-900': color === 'green',
@@ -59,7 +59,7 @@ function Callout({ title, color, dropdown, children, identifier, Icon, }) {
59
59
  'bg-red-50/80 dark:bg-slate-900': color === 'red',
60
60
  'bg-purple-50/80 dark:bg-slate-900': color === 'purple',
61
61
  'cursor-pointer hover:shadow-[inset_0_0_0px_30px_#00000003] dark:hover:shadow-[inset_0_0_0px_30px_#FFFFFF03]': dropdown,
62
- }) }, { children: [Icon && ((0, jsx_runtime_1.jsx)(Icon, { className: (0, classnames_1.default)('h-8 w-8 inline-block pl-2 mr-2 self-center flex-none', (0, classnames_1.default)({
62
+ }), children: [Icon && ((0, jsx_runtime_1.jsx)(Icon, { className: (0, classnames_1.default)('h-8 w-8 inline-block pl-2 mr-2 self-center flex-none', (0, classnames_1.default)({
63
63
  'text-gray-600': !color || color === 'gray',
64
64
  'text-blue-600': color === 'blue',
65
65
  'text-green-600': color === 'green',
@@ -67,8 +67,8 @@ function Callout({ title, color, dropdown, children, identifier, Icon, }) {
67
67
  'text-orange-600': color === 'orange',
68
68
  'text-red-600': color === 'red',
69
69
  'text-purple-600': color === 'purple',
70
- })) })), (0, jsx_runtime_1.jsx)("div", Object.assign({ className: (0, classnames_1.default)('text-neutral-900 dark:text-white grow self-center overflow-hidden break-words', { 'ml-4': !Icon }, // No icon!
71
- 'group') }, { children: title })), dropdown && ((0, jsx_runtime_1.jsx)("div", Object.assign({ className: "font-thin text-sm text-neutral-700 dark:text-neutral-200 self-center flex-none" }, { children: (0, jsx_runtime_1.jsx)(ChevronRightIcon_1.default, { className: (0, classnames_1.default)(iconClass, 'transition-transform details-toggle') }) })))] })), (0, jsx_runtime_1.jsx)("div", Object.assign({ className: (0, classnames_1.default)('px-4', { 'details-body': dropdown }) }, { children: children }))] })));
70
+ })) })), (0, jsx_runtime_1.jsx)("div", { className: (0, classnames_1.default)('text-neutral-900 dark:text-white grow self-center overflow-hidden break-words', { 'ml-4': !Icon }, // No icon!
71
+ 'group'), children: title }), dropdown && ((0, jsx_runtime_1.jsx)("div", { className: "font-thin text-sm text-neutral-700 dark:text-neutral-200 self-center flex-none", children: (0, jsx_runtime_1.jsx)(ChevronRightIcon_1.default, { className: (0, classnames_1.default)(iconClass, 'transition-transform details-toggle') }) }))] }), (0, jsx_runtime_1.jsx)("div", { className: (0, classnames_1.default)('px-4', { 'details-body': dropdown }), children: children })] }));
72
72
  }
73
73
  exports.Callout = Callout;
74
74
  const ExerciseRenderer = (node, children) => {
@@ -82,8 +82,8 @@ const ExerciseRenderer = (node, children) => {
82
82
  const useTitle = ((_c = (_b = node.children) === null || _b === void 0 ? void 0 : _b[0]) === null || _c === void 0 ? void 0 : _c.type) === 'admonitionTitle';
83
83
  const identifier = node.html_id;
84
84
  const enumerator = node.enumerator;
85
- const titleNode = ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)(heading_1.HashLink, Object.assign({ id: identifier, kind: "Exercise" }, { children: [node.gate === 'start' && 'Start of ', node.gate === 'end' && 'End of ', "Exercise", enumerator != null && (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [" ", enumerator] })] })), useTitle && (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [" (", title, ")"] })] }));
86
- return ((0, jsx_runtime_1.jsxs)(Callout, Object.assign({ identifier: identifier, title: titleNode, color: color, dropdown: isDropdown }, { children: [!useTitle && title, rest] }), node.key));
85
+ const titleNode = ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)(heading_1.HashLink, { id: identifier, kind: "Exercise", children: [node.gate === 'start' && 'Start of ', node.gate === 'end' && 'End of ', "Exercise", enumerator != null && (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [" ", enumerator] })] }), useTitle && (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [" (", title, ")"] })] }));
86
+ return ((0, jsx_runtime_1.jsxs)(Callout, { identifier: identifier, title: titleNode, color: color, dropdown: isDropdown, children: [!useTitle && title, rest] }, node.key));
87
87
  };
88
88
  exports.ExerciseRenderer = ExerciseRenderer;
89
89
  const SolutionRenderer = (node, children) => {
@@ -96,8 +96,8 @@ const SolutionRenderer = (node, children) => {
96
96
  const isDropdown = classes.includes('dropdown');
97
97
  const useTitle = ((_c = (_b = node.children) === null || _b === void 0 ? void 0 : _b[0]) === null || _c === void 0 ? void 0 : _c.type) === 'admonitionTitle';
98
98
  const identifier = node.html_id;
99
- const titleNode = ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [node.gate === 'start' && 'Start of ', node.gate === 'end' && 'End of ', title, (0, jsx_runtime_1.jsx)(heading_1.HashLink, Object.assign({ id: identifier, kind: "Solution", hover: true, hideInPopup: true }, { children: ' #' }))] }));
100
- return ((0, jsx_runtime_1.jsxs)(Callout, Object.assign({ identifier: identifier, title: useTitle ? titleNode : undefined, color: color, dropdown: isDropdown }, { children: [!useTitle && title, rest] }), node.key));
99
+ const titleNode = ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [node.gate === 'start' && 'Start of ', node.gate === 'end' && 'End of ', title, (0, jsx_runtime_1.jsx)(heading_1.HashLink, { id: identifier, kind: "Solution", hover: true, hideInPopup: true, children: ' #' })] }));
100
+ return ((0, jsx_runtime_1.jsxs)(Callout, { identifier: identifier, title: useTitle ? titleNode : undefined, color: color, dropdown: isDropdown, children: [!useTitle && title, rest] }, node.key));
101
101
  };
102
102
  exports.SolutionRenderer = SolutionRenderer;
103
103
  const EXERCISE_RENDERERS = {
@@ -1,7 +1,7 @@
1
1
  import type { NodeRenderer } from '@myst-theme/providers';
2
2
  export declare const ChemicalFormula: NodeRenderer;
3
3
  declare const CHEM_RENDERERS: {
4
- chemicalFormula: NodeRenderer<any>;
4
+ chemicalFormula: NodeRenderer;
5
5
  };
6
6
  export default CHEM_RENDERERS;
7
7
  //# sourceMappingURL=chemicalFormula.d.ts.map
@@ -26,11 +26,11 @@ function parseFormula(formula) {
26
26
  }
27
27
  const ChemicalFormula = (node) => {
28
28
  const parts = parseFormula(node.value);
29
- return ((0, jsx_runtime_1.jsx)("code", Object.assign({ className: "text-inherit" }, { children: parts.map((letter, index) => {
29
+ return ((0, jsx_runtime_1.jsx)("code", { className: "text-inherit", children: parts.map((letter, index) => {
30
30
  if (letter.match(/[0-9]/))
31
31
  return (0, jsx_runtime_1.jsx)("sub", { children: letter }, index);
32
32
  return (0, jsx_runtime_1.jsx)("span", { children: letter }, index);
33
- }) }), node.key));
33
+ }) }, node.key));
34
34
  };
35
35
  exports.ChemicalFormula = ChemicalFormula;
36
36
  const CHEM_RENDERERS = {
@@ -1,7 +1,7 @@
1
1
  import type { NodeRenderer } from '@myst-theme/providers';
2
2
  export declare const SIUnits: NodeRenderer;
3
3
  declare const SI_RENDERERS: {
4
- si: NodeRenderer<any>;
4
+ si: NodeRenderer;
5
5
  };
6
6
  export default SI_RENDERERS;
7
7
  //# sourceMappingURL=siunits.d.ts.map
@@ -6,7 +6,7 @@ const SIUnits = (node) => {
6
6
  var _a;
7
7
  const space = node.number == null ? '' : ' ';
8
8
  const title = `${(_a = node.number) !== null && _a !== void 0 ? _a : ''}${space}${node.alt}`;
9
- return ((0, jsx_runtime_1.jsx)("span", Object.assign({ title: title }, { children: node.value }), node.key));
9
+ return ((0, jsx_runtime_1.jsx)("span", { title: title, children: node.value }, node.key));
10
10
  };
11
11
  exports.SIUnits = SIUnits;
12
12
  const SI_RENDERERS = {
@@ -1,7 +1,7 @@
1
1
  import type { NodeRenderer } from '@myst-theme/providers';
2
2
  export declare const FootnoteReference: NodeRenderer;
3
3
  declare const FOOTNOTE_RENDERERS: {
4
- footnoteReference: NodeRenderer<any>;
4
+ footnoteReference: NodeRenderer;
5
5
  footnoteDefinition: () => null;
6
6
  };
7
7
  export default FOOTNOTE_RENDERERS;
@@ -12,11 +12,11 @@ function FootnoteDefinition({ identifier }) {
12
12
  const renderers = (0, providers_1.useNodeRenderers)();
13
13
  const node = (_b = (_a = references === null || references === void 0 ? void 0 : references.footnotes) === null || _a === void 0 ? void 0 : _a[identifier]) !== null && _b !== void 0 ? _b : (0, unist_util_select_1.select)(`footnoteDefinition[identifier=${identifier}]`, references === null || references === void 0 ? void 0 : references.article);
14
14
  const children = (0, _1.useParse)(node, renderers);
15
- return ((0, jsx_runtime_1.jsx)(providers_1.XRefProvider, { children: (0, jsx_runtime_1.jsx)("div", Object.assign({ className: "hover-document w-[500px] sm:max-w-[500px] px-3" }, { children: children })) }));
15
+ return ((0, jsx_runtime_1.jsx)(providers_1.XRefProvider, { children: (0, jsx_runtime_1.jsx)("div", { className: "hover-document w-[500px] sm:max-w-[500px] px-3", children: children }) }));
16
16
  }
17
17
  const FootnoteReference = (node) => {
18
18
  var _a;
19
- return ((0, jsx_runtime_1.jsx)(HoverPopover_1.HoverPopover, Object.assign({ openDelay: 0, card: (0, jsx_runtime_1.jsx)(FootnoteDefinition, { identifier: node.identifier }) }, { children: (0, jsx_runtime_1.jsx)("span", { children: (0, jsx_runtime_1.jsxs)("sup", Object.assign({ className: "hover-link" }, { children: ["[", (_a = node.number) !== null && _a !== void 0 ? _a : node.identifier, "]"] })) }) }), node.key));
19
+ return ((0, jsx_runtime_1.jsx)(HoverPopover_1.HoverPopover, { openDelay: 0, card: (0, jsx_runtime_1.jsx)(FootnoteDefinition, { identifier: node.identifier }), children: (0, jsx_runtime_1.jsx)("span", { children: (0, jsx_runtime_1.jsxs)("sup", { className: "hover-link", children: ["[", (_a = node.number) !== null && _a !== void 0 ? _a : node.identifier, "]"] }) }) }, node.key));
20
20
  };
21
21
  exports.FootnoteReference = FootnoteReference;
22
22
  const FOOTNOTE_RENDERERS = {
package/dist/cjs/grid.js CHANGED
@@ -105,10 +105,10 @@ function gridColumnClasses(columns) {
105
105
  function Grid({ columns, children }) {
106
106
  const gridClasses = gridColumnClasses(columns);
107
107
  const gutterClasses = 'gap-4';
108
- return ((0, jsx_runtime_1.jsx)("div", Object.assign({ className: (0, classnames_1.default)('myst-grid grid my-5', gridClasses, gutterClasses) }, { children: children })));
108
+ return ((0, jsx_runtime_1.jsx)("div", { className: (0, classnames_1.default)('myst-grid grid my-5', gridClasses, gutterClasses), children: children }));
109
109
  }
110
110
  const GridRenderer = (node, children) => {
111
- return ((0, jsx_runtime_1.jsx)(Grid, Object.assign({ columns: node.columns }, { children: children }), node.key));
111
+ return ((0, jsx_runtime_1.jsx)(Grid, { columns: node.columns, children: children }, node.key));
112
112
  };
113
113
  exports.GridRenderer = GridRenderer;
114
114
  const GRID_RENDERERS = {
@@ -13,7 +13,7 @@ function HashLink({ id, kind, title = `Link to this ${kind}`, children = '¶', h
13
13
  if (inCrossRef || !id) {
14
14
  // If we are in a cross-reference pop-out, either hide hash link
15
15
  // or return something that is **not** a link
16
- return hideInPopup ? null : ((0, jsx_runtime_1.jsx)("span", Object.assign({ className: (0, classnames_1.default)('select-none', className) }, { children: children })));
16
+ return hideInPopup ? null : ((0, jsx_runtime_1.jsx)("span", { className: (0, classnames_1.default)('select-none', className), children: children }));
17
17
  }
18
18
  const scroll = (evt) => {
19
19
  evt.preventDefault();
@@ -21,16 +21,16 @@ function HashLink({ id, kind, title = `Link to this ${kind}`, children = '¶', h
21
21
  el === null || el === void 0 ? void 0 : el.scrollIntoView({ behavior: 'smooth' });
22
22
  history.replaceState(undefined, '', `#${id}`);
23
23
  };
24
- return ((0, jsx_runtime_1.jsx)("a", Object.assign({ className: (0, classnames_1.default)('select-none no-underline text-inherit hover:text-inherit', className, {
24
+ return ((0, jsx_runtime_1.jsx)("a", { className: (0, classnames_1.default)('select-none no-underline text-inherit hover:text-inherit', className, {
25
25
  'transition-opacity opacity-0 group-hover:opacity-70': hover,
26
26
  'hover:underline': !hover,
27
- }), onClick: scroll, href: `#${id}`, title: title, "aria-label": title }, { children: children })));
27
+ }), onClick: scroll, href: `#${id}`, title: title, "aria-label": title, children: children }));
28
28
  }
29
29
  exports.HashLink = HashLink;
30
30
  const Heading = (node, children) => {
31
31
  const { enumerator, depth, key, identifier, html_id } = node;
32
32
  const id = html_id || identifier || key;
33
- const textContent = ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [enumerator && (0, jsx_runtime_1.jsx)("span", Object.assign({ className: "select-none mr-3" }, { children: enumerator })), (0, jsx_runtime_1.jsx)("span", Object.assign({ className: "heading-text" }, { children: children })), (0, jsx_runtime_1.jsx)(HashLink, { id: id, kind: "Section", className: "px-2 font-normal", hover: true, hideInPopup: true })] }));
33
+ const textContent = ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [enumerator && (0, jsx_runtime_1.jsx)("span", { className: "select-none mr-3", children: enumerator }), (0, jsx_runtime_1.jsx)("span", { className: "heading-text", children: children }), (0, jsx_runtime_1.jsx)(HashLink, { id: id, kind: "Section", className: "px-2 font-normal", hover: true, hideInPopup: true })] }));
34
34
  // The `heading-text` class is picked up in the Outline to select without the enumerator and "#" link
35
35
  return (0, react_1.createElement)(`h${depth}`, {
36
36
  key: node.key,
@@ -1,7 +1,7 @@
1
1
  import type { NodeRenderer } from '@myst-theme/providers';
2
2
  export declare const IFrame: NodeRenderer;
3
3
  declare const IFRAME_RENDERERS: {
4
- iframe: NodeRenderer<any>;
4
+ iframe: NodeRenderer;
5
5
  };
6
6
  export default IFRAME_RENDERERS;
7
7
  //# sourceMappingURL=iframe.d.ts.map
@@ -26,19 +26,19 @@ function getStyleValue(width) {
26
26
  }
27
27
  const IFrame = (node) => {
28
28
  const width = getStyleValue(node.width) || 70;
29
- return ((0, jsx_runtime_1.jsx)("figure", Object.assign({ id: node.label || undefined, style: { textAlign: node.align || 'center' } }, { children: (0, jsx_runtime_1.jsx)("div", Object.assign({ style: {
29
+ return ((0, jsx_runtime_1.jsx)("figure", { id: node.label || undefined, style: { textAlign: node.align || 'center' }, children: (0, jsx_runtime_1.jsx)("div", { style: {
30
30
  position: 'relative',
31
31
  display: 'inline-block',
32
32
  paddingBottom: '60%',
33
33
  width: `min(max(${width}%, 500px), 100%)`,
34
- } }, { children: (0, jsx_runtime_1.jsx)("iframe", { width: "100%", height: "100%", src: node.src, allowFullScreen: true, allow: "autoplay", style: {
34
+ }, children: (0, jsx_runtime_1.jsx)("iframe", { width: "100%", height: "100%", src: node.src, allowFullScreen: true, allow: "autoplay", style: {
35
35
  width: '100%',
36
36
  height: '100%',
37
37
  position: 'absolute',
38
38
  top: 0,
39
39
  left: 0,
40
40
  border: 'none',
41
- } }) })) }), node.key));
41
+ } }) }) }, node.key));
42
42
  };
43
43
  exports.IFrame = IFrame;
44
44
  const IFRAME_RENDERERS = {
@@ -7,6 +7,6 @@ exports.InlineError = void 0;
7
7
  const jsx_runtime_1 = require("react/jsx-runtime");
8
8
  const ExclamationCircleIcon_1 = __importDefault(require("@heroicons/react/24/outline/ExclamationCircleIcon"));
9
9
  function InlineError({ value, message }) {
10
- return ((0, jsx_runtime_1.jsxs)("span", Object.assign({ className: "text-yellow-600", title: message || value }, { children: [(0, jsx_runtime_1.jsx)(ExclamationCircleIcon_1.default, { className: "inline h-[1em] mr-1" }), value] })));
10
+ return ((0, jsx_runtime_1.jsxs)("span", { className: "text-yellow-600", title: message || value, children: [(0, jsx_runtime_1.jsx)(ExclamationCircleIcon_1.default, { className: "inline h-[1em] mr-1" }), value] }));
11
11
  }
12
12
  exports.InlineError = InlineError;