@dxos/plugin-mermaid 0.9.0 → 0.9.1-staging.ee54ba693a
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/dist/lib/neutral/MermaidPlugin.mjs +2 -2
- package/dist/lib/neutral/MermaidPlugin.mjs.map +4 -4
- package/dist/lib/neutral/chunk-ZBARIEVA.mjs +45 -0
- package/dist/lib/neutral/chunk-ZBARIEVA.mjs.map +7 -0
- package/dist/lib/neutral/index.mjs +1 -1
- package/dist/lib/neutral/meta.json +1 -1
- package/dist/lib/neutral/meta.mjs +1 -1
- package/dist/lib/neutral/plugin.mjs +1 -1
- package/dist/types/dx.config.d.ts +28 -0
- package/dist/types/dx.config.d.ts.map +1 -0
- package/dist/types/src/capabilities/index.d.ts +1 -1
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/markdown-extension.d.ts +1 -1
- package/dist/types/src/extensions/mermaid.stories.d.ts +2 -2
- package/dist/types/src/extensions/mermaid.stories.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts +32 -2
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/dx.config.ts +35 -0
- package/package.json +23 -22
- package/src/MermaidPlugin.test.ts +1 -1
- package/src/MermaidPlugin.tsx +1 -1
- package/src/extensions/mermaid.stories.tsx +2 -2
- package/src/meta.ts +2 -28
- package/dist/lib/neutral/chunk-WD2YFG2L.mjs +0 -36
- package/dist/lib/neutral/chunk-WD2YFG2L.mjs.map +0 -7
package/dx.config.ts
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { Config2 } from '@dxos/app-framework/config';
|
|
6
|
+
import { trim } from '@dxos/util';
|
|
7
|
+
|
|
8
|
+
export default Config2.make({
|
|
9
|
+
plugin: {
|
|
10
|
+
key: 'org.dxos.plugin.mermaid',
|
|
11
|
+
name: 'Mermaid',
|
|
12
|
+
author: 'DXOS',
|
|
13
|
+
description: trim`
|
|
14
|
+
Generate diagrams from simple text-based definitions using Mermaid syntax.
|
|
15
|
+
Create flowcharts, sequence diagrams, class diagrams, state diagrams, entity-relationship
|
|
16
|
+
diagrams, Gantt charts, pie charts, Git graphs, mindmaps, and timelines — all from
|
|
17
|
+
plain-text source embedded directly in your documents.
|
|
18
|
+
|
|
19
|
+
The plugin integrates with the markdown editor as a CodeMirror extension.
|
|
20
|
+
Any fenced code block tagged with the \`mermaid\` language identifier is automatically
|
|
21
|
+
detected and replaced with a live SVG preview rendered by the Mermaid JS library.
|
|
22
|
+
The raw source is revealed for editing whenever the cursor moves inside the block,
|
|
23
|
+
then the rendered diagram is restored when the cursor moves away, providing a seamless
|
|
24
|
+
live-preview experience without leaving the editor.
|
|
25
|
+
|
|
26
|
+
Diagram rendering adapts to the editor's current color scheme: dark-mode documents
|
|
27
|
+
use Mermaid's dark theme while light-mode documents use the neutral theme.
|
|
28
|
+
Parse and render errors are shown inline in place of the diagram so that
|
|
29
|
+
invalid syntax is immediately visible without disrupting the rest of the document.
|
|
30
|
+
`,
|
|
31
|
+
source: 'https://github.com/dxos/dxos/tree/main/packages/plugins/plugin-mermaid',
|
|
32
|
+
icon: { key: 'ph--anchor-simple--regular', hue: 'cyan' },
|
|
33
|
+
spec: 'PLUGIN.mdl',
|
|
34
|
+
},
|
|
35
|
+
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/plugin-mermaid",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.1-staging.ee54ba693a",
|
|
4
4
|
"description": "Mermaid markdown plugin",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
@@ -45,6 +45,7 @@
|
|
|
45
45
|
"types": "dist/types/src/index.d.ts",
|
|
46
46
|
"files": [
|
|
47
47
|
"dist",
|
|
48
|
+
"dx.config.ts",
|
|
48
49
|
"src",
|
|
49
50
|
"PLUGIN.mdl"
|
|
50
51
|
],
|
|
@@ -53,33 +54,33 @@
|
|
|
53
54
|
"@codemirror/state": "^6.6.0",
|
|
54
55
|
"@codemirror/view": "^6.43.0",
|
|
55
56
|
"mermaid": "^10.9.4",
|
|
56
|
-
"@dxos/app-framework": "0.9.
|
|
57
|
-
"@dxos/
|
|
58
|
-
"@dxos/operation": "0.9.
|
|
59
|
-
"@dxos/
|
|
60
|
-
"@dxos/
|
|
61
|
-
"@dxos/
|
|
62
|
-
"@dxos/
|
|
63
|
-
"@dxos/
|
|
57
|
+
"@dxos/app-framework": "0.9.1-staging.ee54ba693a",
|
|
58
|
+
"@dxos/keys": "0.9.1-staging.ee54ba693a",
|
|
59
|
+
"@dxos/operation": "0.9.1-staging.ee54ba693a",
|
|
60
|
+
"@dxos/ui-editor": "0.9.1-staging.ee54ba693a",
|
|
61
|
+
"@dxos/app-toolkit": "0.9.1-staging.ee54ba693a",
|
|
62
|
+
"@dxos/react-ui-editor": "0.9.1-staging.ee54ba693a",
|
|
63
|
+
"@dxos/plugin-markdown": "0.9.1-staging.ee54ba693a",
|
|
64
|
+
"@dxos/util": "0.9.1-staging.ee54ba693a"
|
|
64
65
|
},
|
|
65
66
|
"devDependencies": {
|
|
66
|
-
"@types/react": "~19.2.
|
|
67
|
+
"@types/react": "~19.2.17",
|
|
67
68
|
"@types/react-dom": "~19.2.3",
|
|
68
|
-
"effect": "3.21.
|
|
69
|
-
"react": "~19.2.
|
|
70
|
-
"react-dom": "~19.2.
|
|
69
|
+
"effect": "3.21.4",
|
|
70
|
+
"react": "~19.2.7",
|
|
71
|
+
"react-dom": "~19.2.7",
|
|
71
72
|
"vite": "^8.0.16",
|
|
72
|
-
"@dxos/
|
|
73
|
-
"@dxos/
|
|
74
|
-
"@dxos/
|
|
75
|
-
"@dxos/ui-theme": "0.9.
|
|
73
|
+
"@dxos/storybook-utils": "0.9.1-staging.ee54ba693a",
|
|
74
|
+
"@dxos/echo": "0.9.1-staging.ee54ba693a",
|
|
75
|
+
"@dxos/react-ui": "0.9.1-staging.ee54ba693a",
|
|
76
|
+
"@dxos/ui-theme": "0.9.1-staging.ee54ba693a"
|
|
76
77
|
},
|
|
77
78
|
"peerDependencies": {
|
|
78
|
-
"effect": "3.21.
|
|
79
|
-
"react": "~19.2.
|
|
80
|
-
"react-dom": "~19.2.
|
|
81
|
-
"@dxos/react-ui": "0.9.
|
|
82
|
-
"@dxos/ui-theme": "0.9.
|
|
79
|
+
"effect": "3.21.4",
|
|
80
|
+
"react": "~19.2.7",
|
|
81
|
+
"react-dom": "~19.2.7",
|
|
82
|
+
"@dxos/react-ui": "0.9.1-staging.ee54ba693a",
|
|
83
|
+
"@dxos/ui-theme": "0.9.1-staging.ee54ba693a"
|
|
83
84
|
},
|
|
84
85
|
"publishConfig": {
|
|
85
86
|
"access": "public"
|
|
@@ -12,7 +12,7 @@ import { MermaidPlugin } from '#plugin';
|
|
|
12
12
|
|
|
13
13
|
import { meta } from './meta';
|
|
14
14
|
|
|
15
|
-
const moduleId = (name: string) => `${meta.
|
|
15
|
+
const moduleId = (name: string) => `${meta.profile.key}.module.${name}`;
|
|
16
16
|
|
|
17
17
|
describe('MermaidPlugin', () => {
|
|
18
18
|
test('modules activate on the expected events', async ({ expect }) => {
|
package/src/MermaidPlugin.tsx
CHANGED
|
@@ -19,7 +19,7 @@ export const MermaidPlugin = Plugin.define(meta).pipe(
|
|
|
19
19
|
activate: MarkdownExtension,
|
|
20
20
|
}),
|
|
21
21
|
AppPlugin.addPluginAssetModule({
|
|
22
|
-
asset: { pluginId: meta.
|
|
22
|
+
asset: { pluginId: meta.profile.key, path: 'PLUGIN.mdl', content: pluginSpec, mimeType: 'application/x-mdl' },
|
|
23
23
|
}),
|
|
24
24
|
Plugin.make,
|
|
25
25
|
);
|
|
@@ -19,11 +19,11 @@ import { mermaid } from './mermaid-extension';
|
|
|
19
19
|
|
|
20
20
|
const str = (...lines: string[]) => lines.join('\n');
|
|
21
21
|
|
|
22
|
-
type
|
|
22
|
+
type StoryArgs = {
|
|
23
23
|
text?: string;
|
|
24
24
|
};
|
|
25
25
|
|
|
26
|
-
const DefaultStory = ({ text }:
|
|
26
|
+
const DefaultStory = ({ text }: StoryArgs) => {
|
|
27
27
|
const { themeMode } = useThemeContext();
|
|
28
28
|
const { parentRef, focusAttributes } = useTextEditor(
|
|
29
29
|
() => ({
|
package/src/meta.ts
CHANGED
|
@@ -3,33 +3,7 @@
|
|
|
3
3
|
//
|
|
4
4
|
|
|
5
5
|
import { Plugin } from '@dxos/app-framework';
|
|
6
|
-
import { DXN } from '@dxos/keys';
|
|
7
|
-
import { trim } from '@dxos/util';
|
|
8
6
|
|
|
9
|
-
|
|
10
|
-
key: DXN.make('org.dxos.plugin.mermaid'),
|
|
11
|
-
name: 'Mermaid',
|
|
12
|
-
author: 'DXOS',
|
|
13
|
-
description: trim`
|
|
14
|
-
Generate diagrams from simple text-based definitions using Mermaid syntax.
|
|
15
|
-
Create flowcharts, sequence diagrams, class diagrams, state diagrams, entity-relationship
|
|
16
|
-
diagrams, Gantt charts, pie charts, Git graphs, mindmaps, and timelines — all from
|
|
17
|
-
plain-text source embedded directly in your documents.
|
|
7
|
+
import config from '../dx.config';
|
|
18
8
|
|
|
19
|
-
|
|
20
|
-
Any fenced code block tagged with the \`mermaid\` language identifier is automatically
|
|
21
|
-
detected and replaced with a live SVG preview rendered by the Mermaid JS library.
|
|
22
|
-
The raw source is revealed for editing whenever the cursor moves inside the block,
|
|
23
|
-
then the rendered diagram is restored when the cursor moves away, providing a seamless
|
|
24
|
-
live-preview experience without leaving the editor.
|
|
25
|
-
|
|
26
|
-
Diagram rendering adapts to the editor's current color scheme: dark-mode documents
|
|
27
|
-
use Mermaid's dark theme while light-mode documents use the neutral theme.
|
|
28
|
-
Parse and render errors are shown inline in place of the diagram so that
|
|
29
|
-
invalid syntax is immediately visible without disrupting the rest of the document.
|
|
30
|
-
`,
|
|
31
|
-
icon: 'ph--anchor-simple--regular',
|
|
32
|
-
iconHue: 'cyan',
|
|
33
|
-
source: 'https://github.com/dxos/dxos/tree/main/packages/plugins/plugin-mermaid',
|
|
34
|
-
spec: 'PLUGIN.mdl',
|
|
35
|
-
});
|
|
9
|
+
export const meta = Plugin.getMetaFromConfig(config);
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
// src/meta.ts
|
|
2
|
-
import { Plugin } from "@dxos/app-framework";
|
|
3
|
-
import { DXN } from "@dxos/keys";
|
|
4
|
-
import { trim } from "@dxos/util";
|
|
5
|
-
var meta = Plugin.makeMeta({
|
|
6
|
-
key: DXN.make("org.dxos.plugin.mermaid"),
|
|
7
|
-
name: "Mermaid",
|
|
8
|
-
author: "DXOS",
|
|
9
|
-
description: trim`
|
|
10
|
-
Generate diagrams from simple text-based definitions using Mermaid syntax.
|
|
11
|
-
Create flowcharts, sequence diagrams, class diagrams, state diagrams, entity-relationship
|
|
12
|
-
diagrams, Gantt charts, pie charts, Git graphs, mindmaps, and timelines — all from
|
|
13
|
-
plain-text source embedded directly in your documents.
|
|
14
|
-
|
|
15
|
-
The plugin integrates with the markdown editor as a CodeMirror extension.
|
|
16
|
-
Any fenced code block tagged with the \`mermaid\` language identifier is automatically
|
|
17
|
-
detected and replaced with a live SVG preview rendered by the Mermaid JS library.
|
|
18
|
-
The raw source is revealed for editing whenever the cursor moves inside the block,
|
|
19
|
-
then the rendered diagram is restored when the cursor moves away, providing a seamless
|
|
20
|
-
live-preview experience without leaving the editor.
|
|
21
|
-
|
|
22
|
-
Diagram rendering adapts to the editor's current color scheme: dark-mode documents
|
|
23
|
-
use Mermaid's dark theme while light-mode documents use the neutral theme.
|
|
24
|
-
Parse and render errors are shown inline in place of the diagram so that
|
|
25
|
-
invalid syntax is immediately visible without disrupting the rest of the document.
|
|
26
|
-
`,
|
|
27
|
-
icon: "ph--anchor-simple--regular",
|
|
28
|
-
iconHue: "cyan",
|
|
29
|
-
source: "https://github.com/dxos/dxos/tree/main/packages/plugins/plugin-mermaid",
|
|
30
|
-
spec: "PLUGIN.mdl"
|
|
31
|
-
});
|
|
32
|
-
|
|
33
|
-
export {
|
|
34
|
-
meta
|
|
35
|
-
};
|
|
36
|
-
//# sourceMappingURL=chunk-WD2YFG2L.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/meta.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { Plugin } from '@dxos/app-framework';\nimport { DXN } from '@dxos/keys';\nimport { trim } from '@dxos/util';\n\nexport const meta = Plugin.makeMeta({\n key: DXN.make('org.dxos.plugin.mermaid'),\n name: 'Mermaid',\n author: 'DXOS',\n description: trim`\n Generate diagrams from simple text-based definitions using Mermaid syntax.\n Create flowcharts, sequence diagrams, class diagrams, state diagrams, entity-relationship\n diagrams, Gantt charts, pie charts, Git graphs, mindmaps, and timelines — all from\n plain-text source embedded directly in your documents.\n\n The plugin integrates with the markdown editor as a CodeMirror extension.\n Any fenced code block tagged with the \\`mermaid\\` language identifier is automatically\n detected and replaced with a live SVG preview rendered by the Mermaid JS library.\n The raw source is revealed for editing whenever the cursor moves inside the block,\n then the rendered diagram is restored when the cursor moves away, providing a seamless\n live-preview experience without leaving the editor.\n\n Diagram rendering adapts to the editor's current color scheme: dark-mode documents\n use Mermaid's dark theme while light-mode documents use the neutral theme.\n Parse and render errors are shown inline in place of the diagram so that\n invalid syntax is immediately visible without disrupting the rest of the document.\n `,\n icon: 'ph--anchor-simple--regular',\n iconHue: 'cyan',\n source: 'https://github.com/dxos/dxos/tree/main/packages/plugins/plugin-mermaid',\n spec: 'PLUGIN.mdl',\n});\n"],
|
|
5
|
-
"mappings": ";AAIA,SAASA,cAAc;AACvB,SAASC,WAAW;AACpB,SAASC,YAAY;AAEd,IAAMC,OAAOH,OAAOI,SAAS;EAClCC,KAAKJ,IAAIK,KAAK,yBAAA;EACdC,MAAM;EACNC,QAAQ;EACRC,aAAaP;;;;;;;;;;;;;;;;;;EAkBbQ,MAAM;EACNC,SAAS;EACTC,QAAQ;EACRC,MAAM;AACR,CAAA;",
|
|
6
|
-
"names": ["Plugin", "DXN", "trim", "meta", "makeMeta", "key", "make", "name", "author", "description", "icon", "iconHue", "source", "spec"]
|
|
7
|
-
}
|