@diplodoc/client 5.7.7 → 5.7.8

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.
@@ -14575,19 +14575,30 @@ function omit(object, props) {
14575
14575
  }
14576
14576
  function MermaidRuntime(props) {
14577
14577
  const renderMermaid = useMermaid();
14578
- const config = omit(props, ["querySelector", "nodes", "nonce", "onError"]);
14578
+ const config = omit(props, [
14579
+ "querySelector",
14580
+ "nodes",
14581
+ "nonce",
14582
+ "onError",
14583
+ "layoutLoaders"
14584
+ ]);
14579
14585
  const options = pick(props, ["querySelector", "nodes", "nonce"]);
14580
14586
  (0,react__rspack_import_0.useEffect)(() => {
14581
- renderMermaid(config, options).catch(props.onError || (() => {
14582
- }));
14587
+ renderMermaid(config, options, props.layoutLoaders).catch(
14588
+ props.onError || (() => {
14589
+ })
14590
+ );
14583
14591
  });
14584
14592
  return null;
14585
14593
  }
14586
14594
  function useMermaid() {
14587
14595
  const [mermaid, setMermaid] = (0,react__rspack_import_0.useState)(null);
14588
14596
  const render = (0,react__rspack_import_0.useCallback)(
14589
- async (config, options) => {
14597
+ async (config, options, layoutLoaders) => {
14590
14598
  if (mermaid) {
14599
+ if (layoutLoaders) {
14600
+ mermaid.registerLayoutLoaders(layoutLoaders);
14601
+ }
14591
14602
  mermaid.initialize(config);
14592
14603
  return mermaid.run(options);
14593
14604
  }