@dxos/plugin-mermaid 0.8.4-main.e098934 → 0.8.4-main.e8ec1fe

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dxos/plugin-mermaid",
3
- "version": "0.8.4-main.e098934",
3
+ "version": "0.8.4-main.e8ec1fe",
4
4
  "description": "Mermaid markdown plugin",
5
5
  "homepage": "https://dxos.org",
6
6
  "bugs": "https://github.com/dxos/dxos/issues",
@@ -26,32 +26,33 @@
26
26
  "dependencies": {
27
27
  "@codemirror/language": "^6.11.3",
28
28
  "@codemirror/state": "^6.5.2",
29
- "@codemirror/view": "^6.38.2",
29
+ "@codemirror/view": "^6.38.4",
30
30
  "@preact-signals/safe-react": "^0.9.0",
31
- "effect": "3.17.7",
32
- "mermaid": "^10.6.1",
33
- "@dxos/app-framework": "0.8.4-main.e098934",
34
- "@dxos/plugin-markdown": "0.8.4-main.e098934",
35
- "@dxos/plugin-space": "0.8.4-main.e098934",
36
- "@dxos/react-ui-editor": "0.8.4-main.e098934"
31
+ "mermaid": "^10.9.4",
32
+ "@dxos/app-framework": "0.8.4-main.e8ec1fe",
33
+ "@dxos/plugin-markdown": "0.8.4-main.e8ec1fe",
34
+ "@dxos/plugin-space": "0.8.4-main.e8ec1fe",
35
+ "@dxos/react-ui-editor": "0.8.4-main.e8ec1fe",
36
+ "@dxos/util": "0.8.4-main.e8ec1fe"
37
37
  },
38
38
  "devDependencies": {
39
- "@types/react": "~18.2.0",
40
- "@types/react-dom": "~18.2.0",
41
- "react": "~18.2.0",
42
- "react-dom": "~18.2.0",
43
- "vite": "7.1.1",
44
- "@dxos/react-ui": "0.8.4-main.e098934",
45
- "@dxos/echo-schema": "0.8.4-main.e098934",
46
- "@dxos/react-ui-theme": "0.8.4-main.e098934",
47
- "@dxos/storybook-utils": "0.8.4-main.e098934"
39
+ "@types/react": "~19.2.2",
40
+ "@types/react-dom": "~19.2.2",
41
+ "effect": "3.18.3",
42
+ "react": "~19.2.0",
43
+ "react-dom": "~19.2.0",
44
+ "vite": "7.1.9",
45
+ "@dxos/echo": "0.8.4-main.e8ec1fe",
46
+ "@dxos/react-ui": "0.8.4-main.e8ec1fe",
47
+ "@dxos/storybook-utils": "0.8.4-main.e8ec1fe",
48
+ "@dxos/react-ui-theme": "0.8.4-main.e8ec1fe"
48
49
  },
49
50
  "peerDependencies": {
50
51
  "effect": "^3.13.3",
51
- "react": "~18.2.0",
52
- "react-dom": "~18.2.0",
53
- "@dxos/react-ui": "0.8.4-main.e098934",
54
- "@dxos/react-ui-theme": "0.8.4-main.e098934"
52
+ "react": "^19.0.0",
53
+ "react-dom": "^19.0.0",
54
+ "@dxos/react-ui": "0.8.4-main.e8ec1fe",
55
+ "@dxos/react-ui-theme": "0.8.4-main.e8ec1fe"
55
56
  },
56
57
  "publishConfig": {
57
58
  "access": "public"
@@ -8,11 +8,10 @@ import { MarkdownCapabilities, MarkdownEvents } from '@dxos/plugin-markdown';
8
8
  import { mermaid } from './extensions';
9
9
  import { meta } from './meta';
10
10
 
11
- export const MermaidPlugin = () =>
12
- definePlugin(meta, [
13
- defineModule({
14
- id: `${meta.id}/module/markdown`,
15
- activatesOn: MarkdownEvents.SetupExtensions,
16
- activate: () => contributes(MarkdownCapabilities.Extensions, [mermaid]),
17
- }),
18
- ]);
11
+ export const MermaidPlugin = definePlugin(meta, () => [
12
+ defineModule({
13
+ id: `${meta.id}/module/markdown`,
14
+ activatesOn: MarkdownEvents.SetupExtensions,
15
+ activate: () => contributes(MarkdownCapabilities.Extensions, [mermaid]),
16
+ }),
17
+ ]);
@@ -145,11 +145,15 @@ class MermaidWidget extends WidgetType {
145
145
  super();
146
146
  }
147
147
 
148
- override eq(other: this): boolean {
148
+ override eq(other: this) {
149
149
  return this._source === other._source;
150
150
  }
151
151
 
152
- override toDOM(view: EditorView): HTMLDivElement {
152
+ override ignoreEvent(ev: Event) {
153
+ return !/^mouse/.test(ev.type);
154
+ }
155
+
156
+ override toDOM(view: EditorView) {
153
157
  const div = document.createElement('div');
154
158
  div.className = 'cm-mermaid';
155
159
 
@@ -208,8 +212,4 @@ class MermaidWidget extends WidgetType {
208
212
  this._svg = undefined;
209
213
  }
210
214
  }
211
-
212
- override ignoreEvent(e: Event): boolean {
213
- return !/^mouse/.test(e.type);
214
- }
215
215
  }
@@ -2,12 +2,11 @@
2
2
  // Copyright 2023 DXOS.org
3
3
  //
4
4
 
5
- import '@dxos-theme';
6
-
7
5
  import { type Meta, type StoryObj } from '@storybook/react-vite';
8
6
  import React from 'react';
9
7
 
10
8
  import { useThemeContext } from '@dxos/react-ui';
9
+ import { withLayout, withTheme } from '@dxos/react-ui/testing';
11
10
  import {
12
11
  createBasicExtensions,
13
12
  createMarkdownExtensions,
@@ -15,7 +14,6 @@ import {
15
14
  decorateMarkdown,
16
15
  useTextEditor,
17
16
  } from '@dxos/react-ui-editor';
18
- import { withLayout, withTheme } from '@dxos/storybook-utils';
19
17
 
20
18
  import { mermaid } from './mermaid-extension';
21
19
 
@@ -41,19 +39,13 @@ const DefaultStory = ({ text }: StoryProps) => {
41
39
  [themeMode],
42
40
  );
43
41
 
44
- return <div className='w-[50rem]' ref={parentRef} {...focusAttributes} />;
42
+ return <div className='is-[50rem]' ref={parentRef} {...focusAttributes} />;
45
43
  };
46
44
 
47
45
  const meta = {
48
46
  title: 'plugins/plugin-mermaid/extensions',
49
47
  render: DefaultStory,
50
- decorators: [
51
- withTheme,
52
- withLayout({
53
- fullscreen: true,
54
- classNames: 'justify-center',
55
- }),
56
- ],
48
+ decorators: [withTheme, withLayout({ container: 'column' })],
57
49
  } satisfies Meta<typeof DefaultStory>;
58
50
 
59
51
  export default meta;
package/src/meta.ts CHANGED
@@ -3,13 +3,15 @@
3
3
  //
4
4
 
5
5
  import { type PluginMeta } from '@dxos/app-framework';
6
-
7
- export const MERMAID_PLUGIN = 'dxos.org/plugin/mermaid';
6
+ import { trim } from '@dxos/util';
8
7
 
9
8
  export const meta: PluginMeta = {
10
- id: MERMAID_PLUGIN,
9
+ id: 'dxos.org/plugin/mermaid',
11
10
  name: 'Mermaid',
12
- description: 'Tool that renders text definitions to create diagrams.',
11
+ description: trim`
12
+ Generate diagrams from simple text-based definitions using Mermaid syntax.
13
+ Create flowcharts, sequence diagrams, and other visualizations that stay in sync with your documentation.
14
+ `,
13
15
  icon: 'ph--anchor-simple--regular',
14
16
  source: 'https://github.com/dxos/dxos/tree/main/packages/plugins/plugin-mermaid',
15
17
  };