@barzhsieh/nuxt-content-mermaid 3.0.5 → 4.0.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.
Files changed (30) hide show
  1. package/README.md +9 -3
  2. package/README.zh-TW.md +7 -3
  3. package/dist/module.json +1 -1
  4. package/dist/runtime/components/Spinner.d.vue.ts +8 -0
  5. package/dist/runtime/components/Spinner.vue.d.ts +8 -0
  6. package/dist/runtime/components/icons/IconClipboard.d.vue.ts +1 -1
  7. package/dist/runtime/components/icons/IconClipboard.vue.d.ts +1 -1
  8. package/dist/runtime/components/icons/IconClipboardHover.d.vue.ts +1 -1
  9. package/dist/runtime/components/icons/IconClipboardHover.vue.d.ts +1 -1
  10. package/dist/runtime/components/icons/IconClipboardSuccess.d.vue.ts +1 -1
  11. package/dist/runtime/components/icons/IconClipboardSuccess.vue.d.ts +1 -1
  12. package/dist/runtime/components/icons/IconCollapse.d.vue.ts +1 -1
  13. package/dist/runtime/components/icons/IconCollapse.vue.d.ts +1 -1
  14. package/dist/runtime/components/icons/IconDownload.d.vue.ts +1 -1
  15. package/dist/runtime/components/icons/IconDownload.vue.d.ts +1 -1
  16. package/dist/runtime/components/icons/IconExpand.d.vue.ts +1 -1
  17. package/dist/runtime/components/icons/IconExpand.vue.d.ts +1 -1
  18. package/dist/runtime/components/icons/IconMinus.d.vue.ts +1 -1
  19. package/dist/runtime/components/icons/IconMinus.vue.d.ts +1 -1
  20. package/dist/runtime/components/icons/IconPlus.d.vue.ts +1 -1
  21. package/dist/runtime/components/icons/IconPlus.vue.d.ts +1 -1
  22. package/dist/runtime/components/icons/iconFullScreen.d.vue.ts +1 -1
  23. package/dist/runtime/components/icons/iconFullScreen.vue.d.ts +1 -1
  24. package/dist/runtime/components/icons/iconFullScreenExit.d.vue.ts +1 -1
  25. package/dist/runtime/components/icons/iconFullScreenExit.vue.d.ts +1 -1
  26. package/dist/runtime/constants.d.ts +2 -2
  27. package/dist/runtime/constants.js +9 -2
  28. package/dist/runtime/direct-mermaid-config.js +5 -5
  29. package/dist/runtime/mermaid-config.js +19 -0
  30. package/package.json +15 -13
package/README.md CHANGED
@@ -8,9 +8,13 @@
8
8
  [![npm downloads][npm-downloads-src]][npm-downloads-href]
9
9
  [![License][license-src]][license-href]
10
10
  [![Nuxt][nuxt-src]][nuxt-href]
11
- [![Mermaid](https://img.shields.io/badge/mermaid-11.x-0f5b9d?logo=mermaid)](https://mermaid.js.org/)
11
+ [![Mermaid](https://img.shields.io/badge/mermaid-12.x-0f5b9d?logo=mermaid)](https://mermaid.js.org/)
12
12
  [![Nuxt Content](https://img.shields.io/badge/Nuxt%20Content-3.x-00DC82?logo=nuxt.js)](https://content.nuxt.com/)
13
13
 
14
+ > This README covers 4.x, which bundles Mermaid 12. The frozen 3.x line keeps its
15
+ > [3.x contract](./docs/en/DEPENDENCY_AND_MIGRATION_CONTRACT.md); to upgrade, follow
16
+ > [Migration to v4](https://nuxt-content-mermaid.barz.app/migration/v4).
17
+
14
18
  **@barzhsieh/nuxt-content-mermaid** turns `mermaid` code blocks in Nuxt
15
19
  Content Markdown into responsive, interactive diagrams. It supports lazy
16
20
  loading, light and dark themes, toolbar controls, and application-provided
@@ -38,10 +42,11 @@ Nuxt Content peer dependencies and the Nuxt Content database connector.
38
42
  - Node.js `>=22.19.0`
39
43
  - Nuxt `^4.1.0`
40
44
  - Nuxt Content `>=3.5.0 <4.0.0`
45
+ - ES2024 browsers; Safari / iOS / iPadOS `17.4+`
41
46
 
42
- For dependency ownership, the Nuxt Content v2 migration boundary, and rendering
47
+ For dependency ownership, the v4 migration boundary, and rendering
43
48
  guarantees, see the
44
- [Dependency and Migration Contract](./docs/en/DEPENDENCY_AND_MIGRATION_CONTRACT.md).
49
+ [4.x Dependency and Migration Contract](./docs/en/DEPENDENCY_AND_MIGRATION_CONTRACT_V4.md).
45
50
 
46
51
  ## Quick start
47
52
 
@@ -79,6 +84,7 @@ For database connector choices and a complete first-project walkthrough, follow
79
84
  - [Configuration](https://nuxt-content-mermaid.barz.app/configuration)
80
85
  - [Troubleshooting](https://nuxt-content-mermaid.barz.app/troubleshooting)
81
86
  - [Migration to v3](https://nuxt-content-mermaid.barz.app/migration/v3)
87
+ - [Migration to v4](https://nuxt-content-mermaid.barz.app/migration/v4)
82
88
 
83
89
  ## Support and contribution
84
90
 
package/README.zh-TW.md CHANGED
@@ -8,9 +8,11 @@
8
8
  [![npm downloads][npm-downloads-src]][npm-downloads-href]
9
9
  [![License][license-src]][license-href]
10
10
  [![Nuxt][nuxt-src]][nuxt-href]
11
- [![Mermaid](https://img.shields.io/badge/mermaid-11.x-0f5b9d?logo=mermaid)](https://mermaid.js.org/)
11
+ [![Mermaid](https://img.shields.io/badge/mermaid-12.x-0f5b9d?logo=mermaid)](https://mermaid.js.org/)
12
12
  [![Nuxt Content](https://img.shields.io/badge/Nuxt%20Content-3.x-00DC82?logo=nuxt.js)](https://content.nuxt.com/)
13
13
 
14
+ > 本文件說明綁定 Mermaid 12 的 4.x。已凍結的 3.x 仍適用 [3.x 契約](./docs/ch/DEPENDENCY_AND_MIGRATION_CONTRACT.md);升級請參閱[升級至 v4](https://nuxt-content-mermaid.barz.app/zh/migration/v4)。
15
+
14
16
  **@barzhsieh/nuxt-content-mermaid** 會將 Nuxt Content Markdown 中的
15
17
  `mermaid` 程式碼圍欄 (fence) 轉換為響應式、可互動的圖表,並支援延遲載入、深淺色
16
18
  主題、工具列控制,以及由應用程式提供的渲染元件。
@@ -38,9 +40,10 @@ dependencies,以及 Nuxt Content database connector。
38
40
  - Node.js `>=22.19.0`
39
41
  - Nuxt `^4.1.0`
40
42
  - Nuxt Content `>=3.5.0 <4.0.0`
43
+ - ES2024 瀏覽器;Safari/iOS/iPadOS `17.4+`
41
44
 
42
- 相依擁有權、Nuxt Content v2 遷移邊界與渲染保證,請參閱
43
- [相依與遷移契約](./docs/ch/DEPENDENCY_AND_MIGRATION_CONTRACT.md)。
45
+ 相依擁有權、v4 遷移邊界與渲染保證,請參閱
46
+ [4.x 相依與遷移契約](./docs/ch/DEPENDENCY_AND_MIGRATION_CONTRACT_V4.md)。
44
47
 
45
48
  ## 快速開始
46
49
 
@@ -77,6 +80,7 @@ Mermaid 已包含在本模組中,不需要另外安裝。資料庫 connector
77
80
  - [設定](https://nuxt-content-mermaid.barz.app/zh/configuration)
78
81
  - [疑難排解](https://nuxt-content-mermaid.barz.app/zh/troubleshooting)
79
82
  - [升級至 v3](https://nuxt-content-mermaid.barz.app/zh/migration/v3)
83
+ - [升級至 v4](https://nuxt-content-mermaid.barz.app/zh/migration/v4)
80
84
 
81
85
  ## 支持與貢獻
82
86
 
package/dist/module.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "compatibility": {
5
5
  "nuxt": "^4.1.0"
6
6
  },
7
- "version": "3.0.5",
7
+ "version": "4.0.0",
8
8
  "builder": {
9
9
  "@nuxt/module-builder": "1.0.3",
10
10
  "unbuild": "3.6.1"
@@ -1,3 +1,11 @@
1
1
  declare const _default: typeof __VLS_export;
2
2
  export default _default;
3
+ export type __VLS_LocalComponents = {};
4
+ export type __VLS_GlobalComponents = import("vue").GlobalComponents;
5
+ export type __VLS_LocalDirectives = {};
6
+ export type __VLS_StyleScopedClasses = {} & {
7
+ "ncm-spinner": boolean;
8
+ } & {
9
+ "ncm-spinner__path": boolean;
10
+ };
3
11
  declare const __VLS_export: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
@@ -1,3 +1,11 @@
1
1
  declare const _default: typeof __VLS_export;
2
2
  export default _default;
3
+ export type __VLS_LocalComponents = {};
4
+ export type __VLS_GlobalComponents = import("vue").GlobalComponents;
5
+ export type __VLS_LocalDirectives = {};
6
+ export type __VLS_StyleScopedClasses = {} & {
7
+ "ncm-spinner": boolean;
8
+ } & {
9
+ "ncm-spinner__path": boolean;
10
+ };
3
11
  declare const __VLS_export: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
@@ -2,7 +2,7 @@ type __VLS_Props = {
2
2
  size?: number | string;
3
3
  };
4
4
  declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
5
- size: number | string;
5
+ size: string | number;
6
6
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
7
7
  declare const _default: typeof __VLS_export;
8
8
  export default _default;
@@ -2,7 +2,7 @@ type __VLS_Props = {
2
2
  size?: number | string;
3
3
  };
4
4
  declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
5
- size: number | string;
5
+ size: string | number;
6
6
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
7
7
  declare const _default: typeof __VLS_export;
8
8
  export default _default;
@@ -2,7 +2,7 @@ type __VLS_Props = {
2
2
  size?: number | string;
3
3
  };
4
4
  declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
5
- size: number | string;
5
+ size: string | number;
6
6
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
7
7
  declare const _default: typeof __VLS_export;
8
8
  export default _default;
@@ -2,7 +2,7 @@ type __VLS_Props = {
2
2
  size?: number | string;
3
3
  };
4
4
  declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
5
- size: number | string;
5
+ size: string | number;
6
6
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
7
7
  declare const _default: typeof __VLS_export;
8
8
  export default _default;
@@ -2,7 +2,7 @@ type __VLS_Props = {
2
2
  size?: number | string;
3
3
  };
4
4
  declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
5
- size: number | string;
5
+ size: string | number;
6
6
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
7
7
  declare const _default: typeof __VLS_export;
8
8
  export default _default;
@@ -2,7 +2,7 @@ type __VLS_Props = {
2
2
  size?: number | string;
3
3
  };
4
4
  declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
5
- size: number | string;
5
+ size: string | number;
6
6
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
7
7
  declare const _default: typeof __VLS_export;
8
8
  export default _default;
@@ -2,7 +2,7 @@ type __VLS_Props = {
2
2
  size?: number | string;
3
3
  };
4
4
  declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
5
- size: number | string;
5
+ size: string | number;
6
6
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
7
7
  declare const _default: typeof __VLS_export;
8
8
  export default _default;
@@ -2,7 +2,7 @@ type __VLS_Props = {
2
2
  size?: number | string;
3
3
  };
4
4
  declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
5
- size: number | string;
5
+ size: string | number;
6
6
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
7
7
  declare const _default: typeof __VLS_export;
8
8
  export default _default;
@@ -2,7 +2,7 @@ type __VLS_Props = {
2
2
  size?: number | string;
3
3
  };
4
4
  declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
5
- size: number | string;
5
+ size: string | number;
6
6
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
7
7
  declare const _default: typeof __VLS_export;
8
8
  export default _default;
@@ -2,7 +2,7 @@ type __VLS_Props = {
2
2
  size?: number | string;
3
3
  };
4
4
  declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
5
- size: number | string;
5
+ size: string | number;
6
6
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
7
7
  declare const _default: typeof __VLS_export;
8
8
  export default _default;
@@ -2,7 +2,7 @@ type __VLS_Props = {
2
2
  size?: number | string;
3
3
  };
4
4
  declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
5
- size: number | string;
5
+ size: string | number;
6
6
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
7
7
  declare const _default: typeof __VLS_export;
8
8
  export default _default;
@@ -2,7 +2,7 @@ type __VLS_Props = {
2
2
  size?: number | string;
3
3
  };
4
4
  declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
5
- size: number | string;
5
+ size: string | number;
6
6
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
7
7
  declare const _default: typeof __VLS_export;
8
8
  export default _default;
@@ -2,7 +2,7 @@ type __VLS_Props = {
2
2
  size?: number | string;
3
3
  };
4
4
  declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
5
- size: number | string;
5
+ size: string | number;
6
6
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
7
7
  declare const _default: typeof __VLS_export;
8
8
  export default _default;
@@ -2,7 +2,7 @@ type __VLS_Props = {
2
2
  size?: number | string;
3
3
  };
4
4
  declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
5
- size: number | string;
5
+ size: string | number;
6
6
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
7
7
  declare const _default: typeof __VLS_export;
8
8
  export default _default;
@@ -2,7 +2,7 @@ type __VLS_Props = {
2
2
  size?: number | string;
3
3
  };
4
4
  declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
5
- size: number | string;
5
+ size: string | number;
6
6
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
7
7
  declare const _default: typeof __VLS_export;
8
8
  export default _default;
@@ -2,7 +2,7 @@ type __VLS_Props = {
2
2
  size?: number | string;
3
3
  };
4
4
  declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
5
- size: number | string;
5
+ size: string | number;
6
6
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
7
7
  declare const _default: typeof __VLS_export;
8
8
  export default _default;
@@ -2,7 +2,7 @@ type __VLS_Props = {
2
2
  size?: number | string;
3
3
  };
4
4
  declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
5
- size: number | string;
5
+ size: string | number;
6
6
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
7
7
  declare const _default: typeof __VLS_export;
8
8
  export default _default;
@@ -2,7 +2,7 @@ type __VLS_Props = {
2
2
  size?: number | string;
3
3
  };
4
4
  declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
5
- size: number | string;
5
+ size: string | number;
6
6
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
7
7
  declare const _default: typeof __VLS_export;
8
8
  export default _default;
@@ -2,7 +2,7 @@ type __VLS_Props = {
2
2
  size?: number | string;
3
3
  };
4
4
  declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
5
- size: number | string;
5
+ size: string | number;
6
6
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
7
7
  declare const _default: typeof __VLS_export;
8
8
  export default _default;
@@ -2,7 +2,7 @@ type __VLS_Props = {
2
2
  size?: number | string;
3
3
  };
4
4
  declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
5
- size: number | string;
5
+ size: string | number;
6
6
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
7
7
  declare const _default: typeof __VLS_export;
8
8
  export default _default;
@@ -45,6 +45,6 @@ export declare const DEFAULT_RUNTIME_OPTIONS: {
45
45
  toolbar: MermaidToolbarOptions;
46
46
  };
47
47
  export declare const DEFAULT_FRONTMATTER_CONFIG_KEY = "config";
48
- export declare const MERMAID_11_16_1_REGEXP_PATHS: readonly [readonly ["dompurifyConfig", "ALLOWED_URI_REGEXP"], readonly ["dompurifyConfig", "CUSTOM_ELEMENT_HANDLING", "attributeNameCheck"], readonly ["dompurifyConfig", "CUSTOM_ELEMENT_HANDLING", "tagNameCheck"]];
49
- export declare const MERMAID_11_16_1_FUNCTION_CAPABILITY_PATHS: readonly [readonly ["sequence", "actorFont"], readonly ["sequence", "messageFont"], readonly ["sequence", "noteFont"], readonly ["c4", "personFont"], readonly ["c4", "external_personFont"], readonly ["c4", "systemFont"], readonly ["c4", "external_systemFont"], readonly ["c4", "system_dbFont"], readonly ["c4", "external_system_dbFont"], readonly ["c4", "system_queueFont"], readonly ["c4", "external_system_queueFont"], readonly ["c4", "containerFont"], readonly ["c4", "external_containerFont"], readonly ["c4", "container_dbFont"], readonly ["c4", "external_container_dbFont"], readonly ["c4", "container_queueFont"], readonly ["c4", "external_container_queueFont"], readonly ["c4", "componentFont"], readonly ["c4", "external_componentFont"], readonly ["c4", "component_dbFont"], readonly ["c4", "external_component_dbFont"], readonly ["c4", "component_queueFont"], readonly ["c4", "external_component_queueFont"], readonly ["c4", "boundaryFont"], readonly ["c4", "messageFont"], readonly ["dompurifyConfig", "ADD_ATTR"], readonly ["dompurifyConfig", "ADD_TAGS"], readonly ["dompurifyConfig", "CUSTOM_ELEMENT_HANDLING", "attributeNameCheck"], readonly ["dompurifyConfig", "CUSTOM_ELEMENT_HANDLING", "tagNameCheck"]];
48
+ export declare const MERMAID_12_2_0_REGEXP_PATHS: readonly [readonly ["dompurifyConfig", "ALLOWED_URI_REGEXP"], readonly ["dompurifyConfig", "CUSTOM_ELEMENT_HANDLING", "attributeNameCheck"], readonly ["dompurifyConfig", "CUSTOM_ELEMENT_HANDLING", "tagNameCheck"]];
49
+ export declare const MERMAID_12_2_0_FUNCTION_CAPABILITY_PATHS: readonly [readonly ["sequence", "actorFont"], readonly ["sequence", "messageFont"], readonly ["sequence", "noteFont"], readonly ["c4", "personFont"], readonly ["c4", "external_personFont"], readonly ["c4", "systemFont"], readonly ["c4", "external_systemFont"], readonly ["c4", "system_dbFont"], readonly ["c4", "external_system_dbFont"], readonly ["c4", "system_queueFont"], readonly ["c4", "external_system_queueFont"], readonly ["c4", "containerFont"], readonly ["c4", "external_containerFont"], readonly ["c4", "container_dbFont"], readonly ["c4", "external_container_dbFont"], readonly ["c4", "container_queueFont"], readonly ["c4", "external_container_queueFont"], readonly ["c4", "componentFont"], readonly ["c4", "external_componentFont"], readonly ["c4", "component_dbFont"], readonly ["c4", "external_component_dbFont"], readonly ["c4", "component_queueFont"], readonly ["c4", "external_component_queueFont"], readonly ["c4", "boundaryFont"], readonly ["c4", "messageFont"], readonly ["dompurifyConfig", "ADD_ATTR"], readonly ["dompurifyConfig", "ADD_TAGS"], readonly ["dompurifyConfig", "CUSTOM_ELEMENT_HANDLING", "attributeNameCheck"], readonly ["dompurifyConfig", "CUSTOM_ELEMENT_HANDLING", "tagNameCheck"]];
50
50
  export declare const DOMPURIFY_3_4_13_OPAQUE_CAPABILITY_PATHS: readonly [readonly ["dompurifyConfig", "TRUSTED_TYPES_POLICY"]];
@@ -9,6 +9,13 @@ export const FULLSCREEN_ZOOM_HINT_DURATION_MS = 3e3;
9
9
  export const DEFAULT_MERMAID_CONFIG = {
10
10
  startOnLoad: false,
11
11
  theme: "default",
12
+ layout: "dagre",
13
+ look: "classic",
14
+ // Mermaid 12 resolves a top-level layout above each diagram type's own schema
15
+ // default, and mindmap skips cose-bilkent whenever any top-level layout is set,
16
+ // so the types whose 3.x layout was never dagre keep theirs explicitly.
17
+ mindmap: { layout: "cose-bilkent" },
18
+ swimlane: { layout: "swimlane" },
12
19
  fontFamily: "Arial, sans-serif, \u5FAE\u8EDF\u6B63\u9ED1\u9AD4",
13
20
  securityLevel: "strict"
14
21
  };
@@ -84,12 +91,12 @@ export const DEFAULT_RUNTIME_OPTIONS = {
84
91
  toolbar: DEFAULT_TOOLBAR_OPTIONS
85
92
  };
86
93
  export const DEFAULT_FRONTMATTER_CONFIG_KEY = "config";
87
- export const MERMAID_11_16_1_REGEXP_PATHS = [
94
+ export const MERMAID_12_2_0_REGEXP_PATHS = [
88
95
  ["dompurifyConfig", "ALLOWED_URI_REGEXP"],
89
96
  ["dompurifyConfig", "CUSTOM_ELEMENT_HANDLING", "attributeNameCheck"],
90
97
  ["dompurifyConfig", "CUSTOM_ELEMENT_HANDLING", "tagNameCheck"]
91
98
  ];
92
- export const MERMAID_11_16_1_FUNCTION_CAPABILITY_PATHS = [
99
+ export const MERMAID_12_2_0_FUNCTION_CAPABILITY_PATHS = [
93
100
  ["sequence", "actorFont"],
94
101
  ["sequence", "messageFont"],
95
102
  ["sequence", "noteFont"],
@@ -1,8 +1,8 @@
1
1
  import { createMermaidComponentConfigurationError } from "./component-configuration-error.js";
2
2
  import {
3
3
  DOMPURIFY_3_4_13_OPAQUE_CAPABILITY_PATHS,
4
- MERMAID_11_16_1_FUNCTION_CAPABILITY_PATHS,
5
- MERMAID_11_16_1_REGEXP_PATHS
4
+ MERMAID_12_2_0_FUNCTION_CAPABILITY_PATHS,
5
+ MERMAID_12_2_0_REGEXP_PATHS
6
6
  } from "./constants.js";
7
7
  function formatConfigPath(path) {
8
8
  return path.reduce(
@@ -28,7 +28,7 @@ function matchesSupportedPath(path, supportedPaths) {
28
28
  return supportedPaths.some((supportedPath) => supportedPath.length === path.length && supportedPath.every((segment, index) => path[index] === segment));
29
29
  }
30
30
  function isFunctionCapability(value, path) {
31
- return typeof value === "function" && matchesSupportedPath(path, MERMAID_11_16_1_FUNCTION_CAPABILITY_PATHS);
31
+ return typeof value === "function" && matchesSupportedPath(path, MERMAID_12_2_0_FUNCTION_CAPABILITY_PATHS);
32
32
  }
33
33
  function isOpaqueObjectCapability(value, path) {
34
34
  return value !== null && typeof value === "object" && matchesSupportedPath(path, DOMPURIFY_3_4_13_OPAQUE_CAPABILITY_PATHS);
@@ -37,12 +37,12 @@ function validateDirectValue(value, path, ancestors) {
37
37
  if (isFunctionCapability(value, path) || isOpaqueObjectCapability(value, path))
38
38
  return;
39
39
  if (typeof value === "function")
40
- invalidDirectConfig(path, "a supported capability at its exact Mermaid 11.17.0 or DOMPurify 3.4.13 path");
40
+ invalidDirectConfig(path, "a supported capability at its exact Mermaid 12.2.0 or DOMPurify 3.4.13 path");
41
41
  if (typeof value === "symbol" || typeof value === "bigint")
42
42
  invalidDirectConfig(path, "structural data");
43
43
  if (value === null || typeof value !== "object") return;
44
44
  if (value instanceof RegExp) {
45
- if (!matchesSupportedPath(path, MERMAID_11_16_1_REGEXP_PATHS))
45
+ if (!matchesSupportedPath(path, MERMAID_12_2_0_REGEXP_PATHS))
46
46
  invalidDirectConfig(path, "a RegExp at an exact DOMPurify 3.4.13 RegExp path");
47
47
  if (Reflect.ownKeys(value).some((key) => key !== "lastIndex"))
48
48
  invalidDirectConfig(path, "a RegExp without custom properties");
@@ -1,5 +1,7 @@
1
1
  import { mergeByPresence } from "./configuration/core.js";
2
2
  import { mergeDirectMermaidConfigForInvocation } from "./direct-mermaid-config.js";
3
+ import { MERMAID_LOG_PREFIX, PAGE_MERMAID_CONFIG_PHASE } from "./constants.js";
4
+ const defaultRendererWarnings = import.meta.dev ? /* @__PURE__ */ new Set() : void 0;
3
5
  export function resolveMermaidTheme(options) {
4
6
  const {
5
7
  colorModeValue,
@@ -51,5 +53,22 @@ export function materializeMermaidConfigForInvocation(options) {
51
53
  writable: true
52
54
  });
53
55
  }
56
+ if (import.meta.dev && defaultRendererWarnings) {
57
+ const sourceLabel = options.source.kind === "page" ? PAGE_MERMAID_CONFIG_PHASE.name : "Direct Mermaid Config";
58
+ const sourceConfig = options.source.kind === "runtime-only" ? void 0 : options.source.config;
59
+ const sources = [
60
+ ["loader.init", options.runtimeConfig],
61
+ [sourceLabel, sourceConfig]
62
+ ];
63
+ for (const [source, config] of sources) {
64
+ for (const diagram of ["flowchart", "class", "state"]) {
65
+ const diagramConfig = config?.[diagram];
66
+ const key = `${source}.${diagram}.defaultRenderer`;
67
+ if (!diagramConfig || !Object.hasOwn(diagramConfig, "defaultRenderer") || defaultRendererWarnings.has(key)) continue;
68
+ defaultRendererWarnings.add(key);
69
+ console.warn(`${MERMAID_LOG_PREFIX} ${key} is ignored by Mermaid 12. Set layout: 'dagre' (previously 'dagre-wrapper') or layout: 'elk' inside ${diagram} to keep the per-type scope, or at top level for every supporting diagram type.`);
70
+ }
71
+ }
72
+ }
54
73
  return sourceWorkingCopy;
55
74
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@barzhsieh/nuxt-content-mermaid",
3
- "version": "3.0.5",
3
+ "version": "4.0.0",
4
4
  "description": "A Nuxt module designed for integrating Mermaid with `@nuxt/content`. It automatically converts `mermaid` code blocks in Markdown into responsive chart components, and supports lazy loading and dark/light theme switching.",
5
5
  "keywords": [
6
6
  "nuxt",
@@ -52,7 +52,7 @@
52
52
  "defu": "^6.1.7",
53
53
  "destr": "^2.0.5",
54
54
  "html-to-image": "1.11.11",
55
- "mermaid": "~11.17.0",
55
+ "mermaid": "~12.2.0",
56
56
  "yaml": "^2.9.0"
57
57
  },
58
58
  "peerDependencies": {
@@ -60,22 +60,23 @@
60
60
  "nuxt": "^4.1.0"
61
61
  },
62
62
  "devDependencies": {
63
- "@nuxt/content": "3.15.2",
64
- "@nuxt/devtools": "3.4.1",
63
+ "@nuxt/content": "3.16.2",
64
+ "@nuxt/devtools": "3.4.4",
65
65
  "@nuxt/eslint-config": "1.17.0",
66
66
  "@nuxt/module-builder": "1.0.3",
67
- "@nuxt/schema": "4.5.2",
68
- "@nuxt/test-utils": "^4.1.0",
67
+ "@nuxt/schema": "4.6.2",
68
+ "@nuxt/test-utils": "^4.3.4",
69
69
  "@nuxtjs/color-mode": "4.0.1",
70
- "@nuxtjs/mdc": "^0.23.1",
70
+ "@nuxtjs/mdc": "^0.23.2",
71
71
  "@types/node": "^25.3.0",
72
72
  "changelogen": "^0.6.2",
73
- "eslint": "^10.8.1",
74
- "nuxt": "4.5.2",
75
- "playwright": "^1.62.1",
73
+ "eslint": "^10.13.0",
74
+ "nuxt": "4.6.2",
75
+ "oxc-parser": "^0.143.0",
76
+ "playwright": "^1.64.1",
76
77
  "typescript": "~5.9.3",
77
- "vitest": "^4.1.11",
78
- "vue-tsc": "^3.3.10",
78
+ "vitest": "^5.0.5",
79
+ "vue-tsc": "^3.3.13",
79
80
  "yaml": "^2.9.0"
80
81
  },
81
82
  "volta": {
@@ -85,12 +86,13 @@
85
86
  "dev": "pnpm dev:prepare && nuxi dev playground",
86
87
  "dev:build": "nuxi build playground",
87
88
  "dev:prepare": "pnpm nuxt-module-build build --stub && pnpm nuxt-module-build prepare && nuxi prepare playground",
89
+ "audit:published": "node scripts/release-verification/audit-published.mjs",
88
90
  "lint": "eslint .",
89
91
  "release:prepare:major": "changelogen --release --major --no-commit --no-tag --no-github && pnpm install --lockfile-only --ignore-scripts",
90
92
  "release:prepare:minor": "changelogen --release --minor --no-commit --no-tag --no-github && pnpm install --lockfile-only --ignore-scripts",
91
93
  "release:prepare:patch": "changelogen --release --patch --no-commit --no-tag --no-github && pnpm install --lockfile-only --ignore-scripts",
92
94
  "test": "vitest run --exclude test/packagePrepack.test.ts && vitest run test/packagePrepack.test.ts",
93
- "test:package-artifact": "node scripts/release-verification/package-artifact.mjs --profile v3-known-latest",
95
+ "test:package-artifact": "node scripts/release-verification/package-artifact.mjs --profile known-latest",
94
96
  "test:compatibility-profile": "node scripts/release-verification/package-artifact.mjs",
95
97
  "test:package-contract": "pnpm prepack && vue-tsc -p test/release-verification/consumer-template/type-contracts/tsconfig.json --noEmit",
96
98
  "test:watch": "vitest watch",