@barzhsieh/nuxt-content-mermaid 2.2.3 → 3.0.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.
- package/README.md +47 -502
- package/README.zh-TW.md +46 -509
- package/dist/module.d.mts +39 -53
- package/dist/module.json +3 -3
- package/dist/module.mjs +600 -155
- package/dist/runtime/built-in-renderer/BuiltInRenderer.d.vue.ts +0 -0
- package/dist/runtime/built-in-renderer/BuiltInRenderer.vue +597 -0
- package/dist/runtime/built-in-renderer/BuiltInRenderer.vue.d.ts +0 -0
- package/dist/runtime/component-configuration-error.d.ts +3 -0
- package/dist/runtime/component-configuration-error.js +7 -0
- package/dist/runtime/component-configuration.d.ts +23 -0
- package/dist/runtime/component-configuration.js +78 -0
- package/dist/runtime/components/ContentMermaidTransport.d.vue.ts +10 -0
- package/dist/runtime/components/ContentMermaidTransport.vue +21 -0
- package/dist/runtime/components/ContentMermaidTransport.vue.d.ts +10 -0
- package/dist/runtime/components/Mermaid.d.vue.ts +0 -31
- package/dist/runtime/components/Mermaid.vue +136 -743
- package/dist/runtime/components/Mermaid.vue.d.ts +0 -31
- package/dist/runtime/components/MermaidExpandOverlay.d.vue.ts +13 -16
- package/dist/runtime/components/MermaidExpandOverlay.vue +61 -53
- package/dist/runtime/components/MermaidExpandOverlay.vue.d.ts +13 -16
- package/dist/runtime/components/MermaidFullscreenPresentation.d.vue.ts +18 -0
- package/dist/runtime/components/MermaidFullscreenPresentation.vue +56 -0
- package/dist/runtime/components/MermaidFullscreenPresentation.vue.d.ts +18 -0
- package/dist/runtime/composables/useMermaidExpand.d.ts +16 -32
- package/dist/runtime/composables/useMermaidExpand.js +232 -75
- package/dist/runtime/composables/useMermaidFullscreen.d.ts +18 -0
- package/dist/runtime/composables/useMermaidFullscreen.js +242 -0
- package/dist/runtime/composables/useMermaidZoom.d.ts +5 -1
- package/dist/runtime/composables/useMermaidZoom.js +54 -28
- package/dist/runtime/configuration/core.d.ts +27 -0
- package/dist/runtime/configuration/core.js +340 -0
- package/dist/runtime/configuration/module.d.ts +17 -0
- package/dist/runtime/configuration/module.js +233 -0
- package/dist/runtime/configuration/runtime-options.d.ts +4 -0
- package/dist/runtime/configuration/runtime-options.js +57 -0
- package/dist/runtime/constants.d.ts +24 -0
- package/dist/runtime/constants.js +60 -2
- package/dist/runtime/direct-mermaid-config.d.ts +5 -0
- package/dist/runtime/direct-mermaid-config.js +216 -0
- package/dist/runtime/mermaid-config.d.ts +9 -5
- package/dist/runtime/mermaid-config.js +30 -19
- package/dist/runtime/mermaid-rendering.d.ts +28 -0
- package/dist/runtime/mermaid-rendering.js +140 -0
- package/dist/runtime/plugins/content-mermaid-transport.d.ts +2 -0
- package/dist/runtime/plugins/content-mermaid-transport.js +5 -0
- package/dist/runtime/plugins/mermaid.client.d.ts +0 -3
- package/dist/runtime/plugins/mermaid.client.js +14 -32
- package/dist/runtime/plugins/runtime-config.d.ts +2 -0
- package/dist/runtime/plugins/runtime-config.js +9 -0
- package/dist/runtime/rendererSelection.d.ts +43 -0
- package/dist/runtime/rendererSelection.js +36 -0
- package/dist/runtime/rendererSelectionOrchestration.d.ts +12 -0
- package/dist/runtime/rendererSelectionOrchestration.js +13 -0
- package/dist/runtime/runtime-snapshot.d.ts +3 -0
- package/dist/runtime/runtime-snapshot.js +26 -0
- package/dist/runtime/utils/index.d.ts +0 -4
- package/dist/runtime/utils/index.js +0 -37
- package/dist/types.d.mts +2 -2
- package/package.json +38 -32
- package/dist/runtime/utils/mermaid-transform.d.ts +0 -18
- package/dist/runtime/utils/mermaid-transform.js +0 -345
package/dist/module.d.mts
CHANGED
|
@@ -26,37 +26,21 @@ declare module 'vue' {
|
|
|
26
26
|
$mermaid: () => Promise<Mermaid>
|
|
27
27
|
}
|
|
28
28
|
interface GlobalComponents {
|
|
29
|
-
Mermaid: DefineComponent<
|
|
30
|
-
config?: MermaidConfig
|
|
31
|
-
toolbar?: MermaidToolbarOptions
|
|
32
|
-
code?: string
|
|
33
|
-
}>
|
|
29
|
+
Mermaid: DefineComponent<MermaidComponentProps>
|
|
34
30
|
}
|
|
35
31
|
}
|
|
36
32
|
|
|
37
|
-
declare module 'nuxt/schema' {
|
|
33
|
+
declare module '@nuxt/schema' {
|
|
38
34
|
interface NuxtConfig {
|
|
39
35
|
contentMermaid?: ModuleOptions
|
|
40
|
-
/**
|
|
41
|
-
* @deprecated Use `contentMermaid`
|
|
42
|
-
*/
|
|
43
|
-
mermaidContent?: ModuleOptions
|
|
44
36
|
}
|
|
45
37
|
|
|
46
38
|
interface NuxtOptions {
|
|
47
39
|
contentMermaid?: ModuleOptions
|
|
48
|
-
/**
|
|
49
|
-
* @deprecated Use `contentMermaid`
|
|
50
|
-
*/
|
|
51
|
-
mermaidContent?: ModuleOptions
|
|
52
40
|
}
|
|
53
41
|
|
|
54
42
|
interface PublicRuntimeConfig {
|
|
55
|
-
contentMermaid?:
|
|
56
|
-
/**
|
|
57
|
-
* @deprecated Use `contentMermaid`
|
|
58
|
-
*/
|
|
59
|
-
mermaidContent?: Partial<ModuleOptions>
|
|
43
|
+
contentMermaid?: RuntimeOptions
|
|
60
44
|
}
|
|
61
45
|
}
|
|
62
46
|
|
|
@@ -72,12 +56,18 @@ declare global {
|
|
|
72
56
|
}
|
|
73
57
|
}
|
|
74
58
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
59
|
+
type JsonPrimitive = string | number | boolean | null;
|
|
60
|
+
type JsonValue = JsonPrimitive | JsonObject | JsonValue[];
|
|
61
|
+
type JsonObject = {
|
|
62
|
+
[key: string]: JsonValue;
|
|
63
|
+
};
|
|
64
|
+
type IsAny<T> = 0 extends (1 & T) ? true : false;
|
|
65
|
+
type RuntimeDataMember<T> = IsAny<T> extends true ? never : T extends JsonPrimitive ? T : T extends (...args: never[]) => unknown ? never : T extends readonly (infer Item)[] ? RuntimeDataMember<Item>[] : T extends object ? {
|
|
66
|
+
[Key in keyof T]: RuntimeDataMember<T[Key]>;
|
|
67
|
+
} : never;
|
|
68
|
+
type RuntimeMermaidConfig = RuntimeDataMember<MermaidConfig> & JsonObject;
|
|
69
|
+
type PageMermaidConfig = RuntimeMermaidConfig;
|
|
70
|
+
interface RuntimeOptions {
|
|
81
71
|
/**
|
|
82
72
|
* Enable debug mode for detailed logging and error reporting
|
|
83
73
|
* @default false
|
|
@@ -88,9 +78,9 @@ interface ModuleOptions {
|
|
|
88
78
|
*/
|
|
89
79
|
loader?: {
|
|
90
80
|
/**
|
|
91
|
-
*
|
|
81
|
+
* Pure-data configuration passed through Nuxt public runtime config.
|
|
92
82
|
*/
|
|
93
|
-
init?:
|
|
83
|
+
init?: RuntimeMermaidConfig;
|
|
94
84
|
/**
|
|
95
85
|
* Whether to lazy load the diagram when it enters the viewport.
|
|
96
86
|
* Can be a boolean or an object with IntersectionObserver options.
|
|
@@ -104,10 +94,7 @@ interface ModuleOptions {
|
|
|
104
94
|
* Options related to theme handling
|
|
105
95
|
*/
|
|
106
96
|
theme?: {
|
|
107
|
-
/**
|
|
108
|
-
* @deprecated The module now automatically detects and syncs with @nuxtjs/color-mode.
|
|
109
|
-
* This option no longer has any effect and will be removed in a future version.
|
|
110
|
-
*/
|
|
97
|
+
/** @deprecated No effect; retained for 3.0 compatibility. */
|
|
111
98
|
useColorModeTheme?: boolean;
|
|
112
99
|
light?: MermaidConfig['theme'];
|
|
113
100
|
dark?: MermaidConfig['theme'];
|
|
@@ -116,28 +103,10 @@ interface ModuleOptions {
|
|
|
116
103
|
* Names for custom implementation components
|
|
117
104
|
*/
|
|
118
105
|
components?: {
|
|
119
|
-
/**
|
|
120
|
-
* Custom Mermaid implementation component name (e.g., 'MyMermaid').
|
|
121
|
-
* The Markdown transformation phase always outputs `<Mermaid>`, this setting only affects
|
|
122
|
-
* which component implementation `Mermaid.vue` delegates to at runtime.
|
|
123
|
-
*/
|
|
124
106
|
renderer?: string;
|
|
125
|
-
/**
|
|
126
|
-
* Spinner component name to use while Mermaid is loading.
|
|
127
|
-
* This should be a globally available component name (e.g., under the project `components/` directory).
|
|
128
|
-
* If not provided, the module's built-in `Spinner.vue` will be used.
|
|
129
|
-
*/
|
|
130
107
|
spinner?: string;
|
|
131
|
-
/**
|
|
132
|
-
* Error component name to display when Mermaid rendering fails.
|
|
133
|
-
* This should be a globally available component name (e.g., under the project `components/` directory).
|
|
134
|
-
* If not provided, the module's built-in fallback message will be used.
|
|
135
|
-
*/
|
|
136
108
|
error?: string;
|
|
137
109
|
};
|
|
138
|
-
/**
|
|
139
|
-
* Options related to SVG expand (lightbox) interactions
|
|
140
|
-
*/
|
|
141
110
|
/**
|
|
142
111
|
* Expand configuration. `false` disables expand, `true` uses defaults.
|
|
143
112
|
*/
|
|
@@ -147,9 +116,26 @@ interface ModuleOptions {
|
|
|
147
116
|
*/
|
|
148
117
|
toolbar?: MermaidToolbarOptions;
|
|
149
118
|
}
|
|
150
|
-
|
|
119
|
+
interface ModuleOptions extends RuntimeOptions {
|
|
120
|
+
/**
|
|
121
|
+
* Whether to enable the entire Mermaid process at build time.
|
|
122
|
+
* @default true
|
|
123
|
+
*/
|
|
124
|
+
enabled?: boolean;
|
|
125
|
+
}
|
|
126
|
+
interface MermaidComponentBaseProps {
|
|
127
|
+
toolbar?: MermaidToolbarOptions;
|
|
128
|
+
code?: string;
|
|
129
|
+
}
|
|
130
|
+
type MermaidComponentProps = MermaidComponentBaseProps & ({
|
|
131
|
+
pageConfig?: PageMermaidConfig;
|
|
132
|
+
config?: never;
|
|
133
|
+
} | {
|
|
134
|
+
pageConfig?: never;
|
|
135
|
+
config?: MermaidConfig;
|
|
136
|
+
});
|
|
151
137
|
|
|
152
|
-
declare
|
|
138
|
+
declare const _default: _nuxt_schema.NuxtModule<ModuleOptions, ModuleOptions, false>;
|
|
153
139
|
|
|
154
|
-
export { _default as default
|
|
155
|
-
export type { ModuleOptions };
|
|
140
|
+
export { _default as default };
|
|
141
|
+
export type { MermaidComponentProps, ModuleOptions, PageMermaidConfig, RuntimeMermaidConfig, RuntimeOptions };
|
package/dist/module.json
CHANGED
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
"name": "@barzhsieh/nuxt-content-mermaid",
|
|
3
3
|
"configKey": "contentMermaid",
|
|
4
4
|
"compatibility": {
|
|
5
|
-
"nuxt": "^
|
|
5
|
+
"nuxt": "^4.1.0"
|
|
6
6
|
},
|
|
7
|
-
"version": "
|
|
7
|
+
"version": "3.0.2",
|
|
8
8
|
"builder": {
|
|
9
|
-
"@nuxt/module-builder": "1.0.
|
|
9
|
+
"@nuxt/module-builder": "1.0.3",
|
|
10
10
|
"unbuild": "3.6.1"
|
|
11
11
|
}
|
|
12
12
|
}
|