@dxos/plugin-mermaid 0.8.4-main.c85a9c8dae → 0.8.4-main.dfabb4ec29
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/{browser/index.mjs → neutral/MermaidPlugin.mjs} +4 -15
- package/dist/lib/neutral/MermaidPlugin.mjs.map +7 -0
- package/dist/lib/neutral/chunk-JGZ2QEV6.mjs +17 -0
- package/dist/lib/neutral/chunk-JGZ2QEV6.mjs.map +7 -0
- package/dist/lib/neutral/index.mjs +7 -0
- package/dist/lib/neutral/index.mjs.map +7 -0
- package/dist/lib/neutral/meta.json +1 -0
- package/dist/lib/neutral/meta.mjs +7 -0
- package/dist/lib/neutral/meta.mjs.map +7 -0
- package/dist/lib/neutral/plugin.mjs +11 -0
- package/dist/lib/neutral/plugin.mjs.map +7 -0
- package/dist/types/src/MermaidPlugin.d.ts +1 -0
- package/dist/types/src/MermaidPlugin.d.ts.map +1 -1
- package/dist/types/src/MermaidPlugin.test.d.ts +2 -0
- package/dist/types/src/MermaidPlugin.test.d.ts.map +1 -0
- package/dist/types/src/extensions/mermaid-extension.d.ts.map +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/index.d.ts +0 -1
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/plugin.d.ts +3 -0
- package/dist/types/src/plugin.d.ts.map +1 -0
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +36 -22
- package/src/MermaidPlugin.test.ts +30 -0
- package/src/MermaidPlugin.tsx +4 -1
- package/src/extensions/mermaid.stories.tsx +3 -3
- package/src/index.ts +0 -1
- package/src/meta.ts +1 -1
- package/src/plugin.ts +9 -0
- package/dist/lib/browser/index.mjs.map +0 -7
- package/dist/lib/browser/meta.json +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/plugin-mermaid",
|
|
3
|
-
"version": "0.8.4-main.
|
|
3
|
+
"version": "0.8.4-main.dfabb4ec29",
|
|
4
4
|
"description": "Mermaid markdown plugin",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
@@ -12,17 +12,31 @@
|
|
|
12
12
|
"author": "DXOS.org",
|
|
13
13
|
"sideEffects": true,
|
|
14
14
|
"type": "module",
|
|
15
|
+
"imports": {
|
|
16
|
+
"#meta": {
|
|
17
|
+
"source": "./src/meta.ts",
|
|
18
|
+
"types": "./dist/types/src/meta.d.ts",
|
|
19
|
+
"default": "./dist/lib/neutral/meta.mjs"
|
|
20
|
+
},
|
|
21
|
+
"#plugin": {
|
|
22
|
+
"source": "./src/MermaidPlugin.tsx",
|
|
23
|
+
"types": "./dist/types/src/MermaidPlugin.d.ts",
|
|
24
|
+
"default": "./dist/lib/neutral/MermaidPlugin.mjs"
|
|
25
|
+
}
|
|
26
|
+
},
|
|
15
27
|
"exports": {
|
|
16
28
|
".": {
|
|
17
29
|
"source": "./src/index.ts",
|
|
18
30
|
"types": "./dist/types/src/index.d.ts",
|
|
19
|
-
"
|
|
31
|
+
"default": "./dist/lib/neutral/index.mjs"
|
|
32
|
+
},
|
|
33
|
+
"./plugin": {
|
|
34
|
+
"source": "./src/plugin.ts",
|
|
35
|
+
"types": "./dist/types/src/plugin.d.ts",
|
|
36
|
+
"default": "./dist/lib/neutral/plugin.mjs"
|
|
20
37
|
}
|
|
21
38
|
},
|
|
22
39
|
"types": "dist/types/src/index.d.ts",
|
|
23
|
-
"typesVersions": {
|
|
24
|
-
"*": {}
|
|
25
|
-
},
|
|
26
40
|
"files": [
|
|
27
41
|
"dist",
|
|
28
42
|
"src"
|
|
@@ -30,34 +44,34 @@
|
|
|
30
44
|
"dependencies": {
|
|
31
45
|
"@codemirror/language": "^6.11.3",
|
|
32
46
|
"@codemirror/state": "^6.5.2",
|
|
33
|
-
"@codemirror/view": "^6.38.
|
|
47
|
+
"@codemirror/view": "^6.38.5",
|
|
34
48
|
"mermaid": "^10.9.4",
|
|
35
|
-
"@dxos/
|
|
36
|
-
"@dxos/
|
|
37
|
-
"@dxos/
|
|
38
|
-
"@dxos/
|
|
39
|
-
"@dxos/
|
|
40
|
-
"@dxos/
|
|
41
|
-
"@dxos/
|
|
49
|
+
"@dxos/operation": "0.8.4-main.dfabb4ec29",
|
|
50
|
+
"@dxos/plugin-space": "0.8.4-main.dfabb4ec29",
|
|
51
|
+
"@dxos/react-ui-editor": "0.8.4-main.dfabb4ec29",
|
|
52
|
+
"@dxos/util": "0.8.4-main.dfabb4ec29",
|
|
53
|
+
"@dxos/app-framework": "0.8.4-main.dfabb4ec29",
|
|
54
|
+
"@dxos/ui-editor": "0.8.4-main.dfabb4ec29",
|
|
55
|
+
"@dxos/plugin-markdown": "0.8.4-main.dfabb4ec29"
|
|
42
56
|
},
|
|
43
57
|
"devDependencies": {
|
|
44
58
|
"@types/react": "~19.2.7",
|
|
45
59
|
"@types/react-dom": "~19.2.3",
|
|
46
|
-
"effect": "3.
|
|
60
|
+
"effect": "3.20.0",
|
|
47
61
|
"react": "~19.2.3",
|
|
48
62
|
"react-dom": "~19.2.3",
|
|
49
|
-
"vite": "^
|
|
50
|
-
"@dxos/
|
|
51
|
-
"@dxos/
|
|
52
|
-
"@dxos/
|
|
53
|
-
"@dxos/
|
|
63
|
+
"vite": "^8.0.10",
|
|
64
|
+
"@dxos/echo": "0.8.4-main.dfabb4ec29",
|
|
65
|
+
"@dxos/react-ui": "0.8.4-main.dfabb4ec29",
|
|
66
|
+
"@dxos/ui-theme": "0.8.4-main.dfabb4ec29",
|
|
67
|
+
"@dxos/storybook-utils": "0.8.4-main.dfabb4ec29"
|
|
54
68
|
},
|
|
55
69
|
"peerDependencies": {
|
|
56
|
-
"effect": "3.
|
|
70
|
+
"effect": "3.20.0",
|
|
57
71
|
"react": "~19.2.3",
|
|
58
72
|
"react-dom": "~19.2.3",
|
|
59
|
-
"@dxos/react-ui": "0.8.4-main.
|
|
60
|
-
"@dxos/ui-theme": "0.8.4-main.
|
|
73
|
+
"@dxos/react-ui": "0.8.4-main.dfabb4ec29",
|
|
74
|
+
"@dxos/ui-theme": "0.8.4-main.dfabb4ec29"
|
|
61
75
|
},
|
|
62
76
|
"publishConfig": {
|
|
63
77
|
"access": "public"
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2026 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { describe, test } from 'vitest';
|
|
6
|
+
|
|
7
|
+
import { OperationPlugin, RuntimePlugin } from '@dxos/app-framework';
|
|
8
|
+
import { createTestApp } from '@dxos/app-framework/testing';
|
|
9
|
+
import { MarkdownEvents } from '@dxos/plugin-markdown';
|
|
10
|
+
|
|
11
|
+
import { MermaidPlugin } from '#plugin';
|
|
12
|
+
|
|
13
|
+
import { meta } from './meta';
|
|
14
|
+
|
|
15
|
+
const moduleId = (name: string) => `${meta.id}.module.${name}`;
|
|
16
|
+
|
|
17
|
+
describe('MermaidPlugin', () => {
|
|
18
|
+
test('modules activate on the expected events', async ({ expect }) => {
|
|
19
|
+
// Use createTestApp directly — only RuntimePlugin and OperationPlugin are needed.
|
|
20
|
+
// MermaidPlugin has no surface module so SetupReactSurface firing harmlessly is fine.
|
|
21
|
+
await using harness = await createTestApp({
|
|
22
|
+
plugins: [OperationPlugin(), RuntimePlugin(), MermaidPlugin()],
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
// The markdown module activates on MarkdownEvents.SetupExtensions,
|
|
26
|
+
// which is fired by MarkdownPlugin before its ReactSurface activates.
|
|
27
|
+
await harness.fire(MarkdownEvents.SetupExtensions);
|
|
28
|
+
expect(harness.manager.getActive()).toContain(moduleId('markdown'));
|
|
29
|
+
});
|
|
30
|
+
});
|
package/src/MermaidPlugin.tsx
CHANGED
|
@@ -7,8 +7,9 @@ import * as Effect from 'effect/Effect';
|
|
|
7
7
|
import { Capability, Plugin } from '@dxos/app-framework';
|
|
8
8
|
import { MarkdownCapabilities, MarkdownEvents } from '@dxos/plugin-markdown';
|
|
9
9
|
|
|
10
|
+
import { meta } from '#meta';
|
|
11
|
+
|
|
10
12
|
import { mermaid } from './extensions';
|
|
11
|
-
import { meta } from './meta';
|
|
12
13
|
|
|
13
14
|
export const MermaidPlugin = Plugin.define(meta).pipe(
|
|
14
15
|
Plugin.addModule({
|
|
@@ -18,3 +19,5 @@ export const MermaidPlugin = Plugin.define(meta).pipe(
|
|
|
18
19
|
}),
|
|
19
20
|
Plugin.make,
|
|
20
21
|
);
|
|
22
|
+
|
|
23
|
+
export default MermaidPlugin;
|
|
@@ -6,8 +6,8 @@ import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
|
6
6
|
import React from 'react';
|
|
7
7
|
|
|
8
8
|
import { useThemeContext } from '@dxos/react-ui';
|
|
9
|
-
import { withLayout, withTheme } from '@dxos/react-ui/testing';
|
|
10
9
|
import { useTextEditor } from '@dxos/react-ui-editor';
|
|
10
|
+
import { withLayout, withTheme } from '@dxos/react-ui/testing';
|
|
11
11
|
import {
|
|
12
12
|
createBasicExtensions,
|
|
13
13
|
createMarkdownExtensions,
|
|
@@ -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 DefaultStoryProps = {
|
|
23
23
|
text?: string;
|
|
24
24
|
};
|
|
25
25
|
|
|
26
|
-
const DefaultStory = ({ text }:
|
|
26
|
+
const DefaultStory = ({ text }: DefaultStoryProps) => {
|
|
27
27
|
const { themeMode } = useThemeContext();
|
|
28
28
|
const { parentRef, focusAttributes } = useTextEditor(
|
|
29
29
|
() => ({
|
package/src/index.ts
CHANGED
package/src/meta.ts
CHANGED
|
@@ -6,7 +6,7 @@ import { type Plugin } from '@dxos/app-framework';
|
|
|
6
6
|
import { trim } from '@dxos/util';
|
|
7
7
|
|
|
8
8
|
export const meta: Plugin.Meta = {
|
|
9
|
-
id: 'dxos.
|
|
9
|
+
id: 'org.dxos.plugin.mermaid',
|
|
10
10
|
name: 'Mermaid',
|
|
11
11
|
description: trim`
|
|
12
12
|
Generate diagrams from simple text-based definitions using Mermaid syntax.
|
package/src/plugin.ts
ADDED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/MermaidPlugin.tsx", "../../../src/extensions/mermaid-extension.ts", "../../../src/meta.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport { Capability, Plugin } from '@dxos/app-framework';\nimport { MarkdownCapabilities, MarkdownEvents } from '@dxos/plugin-markdown';\n\nimport { mermaid } from './extensions';\nimport { meta } from './meta';\n\nexport const MermaidPlugin = Plugin.define(meta).pipe(\n Plugin.addModule({\n id: 'markdown',\n activatesOn: MarkdownEvents.SetupExtensions,\n activate: () => Effect.succeed(Capability.contributes(MarkdownCapabilities.Extensions, [mermaid])),\n }),\n Plugin.make,\n);\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport { syntaxTree } from '@codemirror/language';\nimport { type Extension } from '@codemirror/state';\nimport { Decoration, type DecorationSet, EditorView, ViewPlugin, type ViewUpdate, WidgetType } from '@codemirror/view';\nimport _mermaid from 'mermaid';\n\nexport type MermaidOptions = {};\n\n/**\n * Extension to create mermaid diagrams.\n */\nexport const mermaid = (_options: MermaidOptions = {}): Extension => {\n return [\n ViewPlugin.fromClass(\n class {\n decorations: DecorationSet;\n\n constructor(view: EditorView) {\n this.decorations = this.buildDecorations(view);\n }\n\n update(update: ViewUpdate) {\n // Always rebuild decorations when selection changes to handle arrow key navigation.\n if (update.docChanged || update.viewportChanged || update.selectionSet || update.focusChanged) {\n this.decorations = this.buildDecorations(update.view);\n }\n }\n\n buildDecorations(view: EditorView): DecorationSet {\n const decorations: Array<{ from: number; to: number; decoration: Decoration }> = [];\n\n syntaxTree(view.state).iterate({\n enter: (node) => {\n if (node.name === 'FencedCode') {\n const cursor = view.state.selection.main.head;\n // Show widget when cursor is outside the code block.\n // Add a buffer of 1 position before and after to handle edge cases.\n const showWidget = view.state.readOnly || cursor < node.from - 1 || cursor > node.to + 1;\n if (showWidget) {\n const info = node.node.getChild('CodeInfo');\n if (info) {\n const type = view.state.sliceDoc(info.from, info.to);\n const text = node.node.getChild('CodeText');\n if (type === 'mermaid' && text) {\n const content = view.state.sliceDoc(text.from, text.to).trim();\n const label = content.split(' ')[0];\n\n // Create widget.\n const widget = new MermaidWidget(`mermaid-${node.from}`, content, label);\n\n // Find the line after the code block to place the widget.\n const endLine = view.state.doc.lineAt(node.to);\n const nextLinePos = endLine.to + 1;\n\n // Add widget after the code block.\n if (nextLinePos <= view.state.doc.length) {\n decorations.push({\n from: nextLinePos,\n to: nextLinePos,\n decoration: Decoration.widget({\n widget,\n }),\n });\n } else {\n // Check if at the end of the document.\n decorations.push({\n from: endLine.to,\n to: endLine.to,\n decoration: Decoration.widget({\n widget,\n side: 1,\n }),\n });\n }\n\n // Hide each line of the code block.\n const startLine = view.state.doc.lineAt(node.from);\n for (let lineNum = startLine.number; lineNum <= endLine.number; lineNum++) {\n const line = view.state.doc.line(lineNum);\n decorations.push({\n from: line.from,\n to: line.from,\n decoration: Decoration.line({\n class: 'cm-mermaid-hidden',\n }),\n });\n }\n }\n }\n }\n }\n },\n });\n\n return Decoration.set(\n decorations.sort((a, b) => a.from - b.from || a.to - b.to).map((d) => d.decoration.range(d.from, d.to)),\n );\n }\n },\n {\n decorations: (v) => v.decorations,\n },\n ),\n EditorView.theme({\n '& .cm-mermaid': {\n position: 'relative',\n display: 'inline-flex',\n width: '100%',\n maring: '4px 0',\n padding: '16px',\n justifyContent: 'center',\n backgroundColor: 'var(--color-group-surface)',\n borderRadius: '8px',\n },\n '& .cm-mermaid-label': {\n position: 'absolute',\n right: '16px',\n fontFamily: 'unset',\n color: 'var(--color-subdued)',\n },\n '& .cm-mermaid-error': {\n display: 'inline-block',\n color: 'var(--color-error)',\n },\n '& .cm-mermaid-hidden': {\n display: 'none !important',\n },\n }),\n ];\n};\n\nclass MermaidWidget extends WidgetType {\n _svg: string | undefined;\n _error: string | undefined;\n\n // TODO(burdon): Mermaid API requires unique id.\n constructor(\n private readonly _id: string,\n private readonly _source: string,\n private readonly _label?: string,\n ) {\n super();\n }\n\n override eq(other: this) {\n return this._source === other._source;\n }\n\n override ignoreEvent(ev: Event) {\n return !/^mouse/.test(ev.type);\n }\n\n override toDOM(view: EditorView) {\n const div = document.createElement('div');\n div.className = 'cm-mermaid';\n\n setTimeout(async () => {\n // https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts\n _mermaid.initialize({\n darkMode: view.state.facet(EditorView.darkTheme),\n theme: 'neutral',\n // TODO(burdon): Styles.\n // NOTE: Must specify 'base' in order to override.\n // theme: 'base',\n // themeVariables: {\n // primaryColor: getToken('extend.colors.red.100'),\n // primaryBorderColor: getToken('extend.colors.neutral.200'),\n // },\n // https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/diagrams/flowchart/styles.ts\n // https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/diagrams/sequence/styles.js\n // https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/diagrams/state/styles.js\n // themeCSS: '.node rect { fill: red; }',\n });\n\n // TODO(burdon): Cache?\n const svg = await this.render(div);\n if (this._error) {\n div.className = 'cm-mermaid-error';\n div.innerText = this._error;\n } else {\n div.className = 'cm-mermaid';\n div.innerHTML = svg!;\n\n if (this._label) {\n const label = document.createElement('span');\n label.innerText = this._label;\n label.className = 'cm-mermaid-label';\n div.appendChild(label);\n view.requestMeasure();\n }\n }\n });\n\n return div;\n }\n\n async render(_container: Element): Promise<string | undefined> {\n try {\n // https://github.com/mermaid-js/mermaid\n const valid = await _mermaid.parse(this._source);\n if (valid) {\n const result = await _mermaid.render(this._id, this._source);\n this._error = undefined;\n this._svg = result.svg;\n return result.svg;\n }\n } catch (err: any) {\n this._error = String(err);\n this._svg = undefined;\n }\n }\n}\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { type Plugin } from '@dxos/app-framework';\nimport { trim } from '@dxos/util';\n\nexport const meta: Plugin.Meta = {\n id: 'dxos.org/plugin/mermaid',\n name: 'Mermaid',\n description: trim`\n Generate diagrams from simple text-based definitions using Mermaid syntax.\n Create flowcharts, sequence diagrams, and other visualizations that stay in sync with your documentation.\n `,\n icon: 'ph--anchor-simple--regular',\n source: 'https://github.com/dxos/dxos/tree/main/packages/plugins/plugin-mermaid',\n};\n"],
|
|
5
|
-
"mappings": ";AAIA,YAAYA,YAAY;AAExB,SAASC,YAAYC,cAAc;AACnC,SAASC,sBAAsBC,sBAAsB;;;ACHrD,SAASC,kBAAkB;AAE3B,SAASC,YAAgCC,YAAYC,YAA6BC,kBAAkB;AACpG,OAAOC,cAAc;AAOd,IAAMC,UAAU,CAACC,WAA2B,CAAC,MAAC;AACnD,SAAO;IACLC,WAAWC,UACT,MAAA;MACEC;MAEA,YAAYC,MAAkB;AAC5B,aAAKD,cAAc,KAAKE,iBAAiBD,IAAAA;MAC3C;MAEAE,OAAOA,QAAoB;AAEzB,YAAIA,OAAOC,cAAcD,OAAOE,mBAAmBF,OAAOG,gBAAgBH,OAAOI,cAAc;AAC7F,eAAKP,cAAc,KAAKE,iBAAiBC,OAAOF,IAAI;QACtD;MACF;MAEAC,iBAAiBD,MAAiC;AAChD,cAAMD,cAA2E,CAAA;AAEjFQ,mBAAWP,KAAKQ,KAAK,EAAEC,QAAQ;UAC7BC,OAAO,CAACC,SAAAA;AACN,gBAAIA,KAAKC,SAAS,cAAc;AAC9B,oBAAMC,SAASb,KAAKQ,MAAMM,UAAUC,KAAKC;AAGzC,oBAAMC,aAAajB,KAAKQ,MAAMU,YAAYL,SAASF,KAAKQ,OAAO,KAAKN,SAASF,KAAKS,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YAAIG,YAAY;AAChBH,YAAIY,YAAY,KAAKtB;MACvB,OAAO;AACLU,YAAIG,YAAY;AAChBH,YAAIa,YAAYH;AAEhB,YAAI,KAAKjB,QAAQ;AACf,gBAAM5C,QAAQoD,SAASC,cAAc,MAAA;AACrCrD,gBAAM+D,YAAY,KAAKnB;AACvB5C,gBAAMsD,YAAY;AAClBH,cAAIc,YAAYjE,KAAAA;AAChB5B,eAAK8F,eAAc;QACrB;MACF;IACF,CAAA;AAEA,WAAOf;EACT;EAEA,MAAMW,OAAOK,YAAkD;AAC7D,QAAI;AAEF,YAAMC,QAAQ,MAAMZ,SAASa,MAAM,KAAK1B,OAAO;AAC/C,UAAIyB,OAAO;AACT,cAAME,SAAS,MAAMd,SAASM,OAAO,KAAKpB,KAAK,KAAKC,OAAO;AAC3D,aAAKF,SAAS8B;AACd,aAAK/B,OAAO8B,OAAOT;AACnB,eAAOS,OAAOT;MAChB;IACF,SAASW,KAAU;AACjB,WAAK/B,SAASgC,OAAOD,GAAAA;AACrB,WAAKhC,OAAO+B;IACd;EACF;AACF;;;ACjNA,SAASG,YAAY;AAEd,IAAMC,OAAoB;EAC/BC,IAAI;EACJC,MAAM;EACNC,aAAaC;;;;EAIbC,MAAM;EACNC,QAAQ;AACV;;;AFJO,IAAMC,gBAAgBC,OAAOC,OAAOC,IAAAA,EAAMC,KAC/CH,OAAOI,UAAU;EACfC,IAAI;EACJC,aAAaC,eAAeC;EAC5BC,UAAU,MAAaC,eAAQC,WAAWC,YAAYC,qBAAqBC,YAAY;IAACC;GAAQ,CAAA;AAClG,CAAA,GACAf,OAAOgB,IAAI;",
|
|
6
|
-
"names": ["Effect", "Capability", "Plugin", "MarkdownCapabilities", "MarkdownEvents", "syntaxTree", "Decoration", "EditorView", "ViewPlugin", "WidgetType", "_mermaid", "mermaid", "_options", "ViewPlugin", "fromClass", "decorations", "view", "buildDecorations", "update", "docChanged", "viewportChanged", "selectionSet", "focusChanged", "syntaxTree", "state", "iterate", "enter", "node", "name", "cursor", "selection", "main", "head", "showWidget", "readOnly", "from", "to", "info", "getChild", "type", "sliceDoc", "text", "content", "trim", "label", "split", "widget", "MermaidWidget", "endLine", "doc", "lineAt", "nextLinePos", "length", "push", "decoration", "Decoration", "side", "startLine", "lineNum", "number", "line", "class", "set", "sort", "a", "b", "map", "d", "range", "v", "EditorView", "theme", "position", "display", "width", "maring", "padding", "justifyContent", "backgroundColor", "borderRadius", "right", "fontFamily", "color", "WidgetType", "_svg", "_error", "_id", "_source", "_label", "eq", "other", "ignoreEvent", "ev", "test", "toDOM", "div", "document", "createElement", "className", "setTimeout", "_mermaid", "initialize", "darkMode", "facet", "darkTheme", "svg", "render", "innerText", "innerHTML", "appendChild", "requestMeasure", "_container", "valid", "parse", "result", "undefined", "err", "String", "trim", "meta", "id", "name", "description", "trim", "icon", "source", "MermaidPlugin", "Plugin", "define", "meta", "pipe", "addModule", "id", "activatesOn", "MarkdownEvents", "SetupExtensions", "activate", "succeed", "Capability", "contributes", "MarkdownCapabilities", "Extensions", "mermaid", "make"]
|
|
7
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"inputs":{"src/extensions/mermaid-extension.ts":{"bytes":25131,"imports":[{"path":"@codemirror/language","kind":"import-statement","external":true},{"path":"@codemirror/view","kind":"import-statement","external":true},{"path":"mermaid","kind":"import-statement","external":true}],"format":"esm"},"src/extensions/index.ts":{"bytes":494,"imports":[{"path":"src/extensions/mermaid-extension.ts","kind":"import-statement","original":"./mermaid-extension"}],"format":"esm"},"src/meta.ts":{"bytes":1791,"imports":[{"path":"@dxos/util","kind":"import-statement","external":true}],"format":"esm"},"src/MermaidPlugin.tsx":{"bytes":2446,"imports":[{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/plugin-markdown","kind":"import-statement","external":true},{"path":"src/extensions/index.ts","kind":"import-statement","original":"./extensions"},{"path":"src/meta.ts","kind":"import-statement","original":"./meta"}],"format":"esm"},"src/index.ts":{"bytes":551,"imports":[{"path":"src/MermaidPlugin.tsx","kind":"import-statement","original":"./MermaidPlugin"},{"path":"src/meta.ts","kind":"import-statement","original":"./meta"}],"format":"esm"}},"outputs":{"dist/lib/browser/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":14235},"dist/lib/browser/index.mjs":{"imports":[{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/plugin-markdown","kind":"import-statement","external":true},{"path":"@codemirror/language","kind":"import-statement","external":true},{"path":"@codemirror/view","kind":"import-statement","external":true},{"path":"mermaid","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true}],"exports":["MermaidPlugin","meta"],"entryPoint":"src/index.ts","inputs":{"src/MermaidPlugin.tsx":{"bytesInOutput":433},"src/extensions/mermaid-extension.ts":{"bytesInOutput":5273},"src/extensions/index.ts":{"bytesInOutput":0},"src/meta.ts":{"bytesInOutput":439},"src/index.ts":{"bytesInOutput":0}},"bytes":6323}}}
|