@myst-theme/diagrams 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.
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAY1D,wBAAgB,eAAe,CAAC,EAC9B,EAAE,EACF,KAAK,EACL,SAAS,GACV,EAAE;IACD,KAAK,EAAE,MAAM,CAAC;IACd,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,2CA6BA;AAED,eAAO,MAAM,mBAAmB,EAAE,YAQjC,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAa1D,wBAAgB,eAAe,CAAC,EAC9B,EAAE,EACF,KAAK,EACL,SAAS,GACV,EAAE;IACD,KAAK,EAAE,MAAM,CAAC;IACd,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,2CA6BA;AAED,eAAO,MAAM,mBAAmB,EAAE,YAQjC,CAAC"}
package/dist/index.js CHANGED
@@ -9,6 +9,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
9
  };
10
10
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
11
11
  import { useEffect, useId, useState } from 'react';
12
+ import classNames from 'classnames';
12
13
  function parse(id, text) {
13
14
  return __awaiter(this, void 0, void 0, function* () {
14
15
  const { default: mermaid } = yield import('mermaid');
@@ -36,6 +37,6 @@ export function MermaidRenderer({ id, value, className, }) {
36
37
  }, []);
37
38
  return (_jsxs("figure", { id: id, className: className, children: [graph && _jsx("div", { dangerouslySetInnerHTML: { __html: graph } }), error && (_jsxs("pre", { children: ["Error parsing mermaid graph.", '\n\n', error.message, '\n\n', value] }))] }));
38
39
  }
39
- export const MermaidNodeRenderer = ({ node }) => {
40
- return (_jsx(MermaidRenderer, { id: node.html_id || node.identifier, value: node.value, className: node.class }));
40
+ export const MermaidNodeRenderer = ({ node, className }) => {
41
+ return (_jsx(MermaidRenderer, { id: node.html_id || node.identifier, value: node.value, className: classNames(node.class, className) }));
41
42
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@myst-theme/diagrams",
3
- "version": "0.13.6",
3
+ "version": "0.13.7",
4
4
  "type": "module",
5
5
  "exports": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -20,8 +20,9 @@
20
20
  "build": "npm-run-all -l clean -p build:esm"
21
21
  },
22
22
  "dependencies": {
23
- "@myst-theme/providers": "^0.13.6",
24
- "mermaid": "^9.3.0"
23
+ "@myst-theme/providers": "^0.13.7",
24
+ "mermaid": "^9.3.0",
25
+ "classnames": "^2.3.2"
25
26
  },
26
27
  "peerDependencies": {
27
28
  "@types/react": "^16.8 || ^17.0 || ^18.0",