myst-to-react 0.14.3 → 0.15.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"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"}
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,4CAkCA,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
@@ -35,11 +35,12 @@ export const Cite = ({ label, error, children, className, }) => {
35
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", { 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 })] }) }));
38
+ const isButtonLike = (className !== null && className !== void 0 ? className : '').split(' ').includes('button');
39
+ 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: classNames({ 'hover-link': !isButtonLike }), children: children })), !url && _jsx("span", { className: "hover-link", children: children })] }) }));
39
40
  };
40
41
  export const CiteRenderer = ({ node, className }) => {
41
42
  const numbered = useNumberedReferences();
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
+ return (_jsx(Cite, { label: node.label, error: node.error, className: classNames(className, node.class), children: numbered && node.kind === 'parenthetical' ? node.enumerator : _jsx(MyST, { ast: node.children }) }));
43
44
  };
44
45
  const CITE_RENDERERS = {
45
46
  citeGroup: CiteGroup,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "myst-to-react",
3
- "version": "0.14.3",
3
+ "version": "0.15.0",
4
4
  "type": "module",
5
5
  "exports": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -21,7 +21,7 @@
21
21
  },
22
22
  "dependencies": {
23
23
  "@heroicons/react": "^2.0.18",
24
- "@myst-theme/providers": "^0.14.3",
24
+ "@myst-theme/providers": "^0.15.0",
25
25
  "@scienceicons/react": "^0.0.11",
26
26
  "@radix-ui/react-hover-card": "^1.0.6",
27
27
  "buffer": "^6.0.3",