@dxos/plugin-mermaid 0.8.4-main.c4373fc → 0.8.4-main.c85a9c8dae

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,9 +1,13 @@
1
1
  {
2
2
  "name": "@dxos/plugin-mermaid",
3
- "version": "0.8.4-main.c4373fc",
3
+ "version": "0.8.4-main.c85a9c8dae",
4
4
  "description": "Mermaid markdown plugin",
5
5
  "homepage": "https://dxos.org",
6
6
  "bugs": "https://github.com/dxos/dxos/issues",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "https://github.com/dxos/dxos"
10
+ },
7
11
  "license": "MIT",
8
12
  "author": "DXOS.org",
9
13
  "sideEffects": true,
@@ -27,31 +31,33 @@
27
31
  "@codemirror/language": "^6.11.3",
28
32
  "@codemirror/state": "^6.5.2",
29
33
  "@codemirror/view": "^6.38.4",
30
- "@preact-signals/safe-react": "^0.9.0",
31
34
  "mermaid": "^10.9.4",
32
- "@dxos/app-framework": "0.8.4-main.c4373fc",
33
- "@dxos/plugin-space": "0.8.4-main.c4373fc",
34
- "@dxos/plugin-markdown": "0.8.4-main.c4373fc",
35
- "@dxos/react-ui-editor": "0.8.4-main.c4373fc"
35
+ "@dxos/app-framework": "0.8.4-main.c85a9c8dae",
36
+ "@dxos/operation": "0.8.4-main.c85a9c8dae",
37
+ "@dxos/plugin-markdown": "0.8.4-main.c85a9c8dae",
38
+ "@dxos/plugin-space": "0.8.4-main.c85a9c8dae",
39
+ "@dxos/ui-editor": "0.8.4-main.c85a9c8dae",
40
+ "@dxos/util": "0.8.4-main.c85a9c8dae",
41
+ "@dxos/react-ui-editor": "0.8.4-main.c85a9c8dae"
36
42
  },
37
43
  "devDependencies": {
38
- "@types/react": "~19.2.2",
39
- "@types/react-dom": "~19.2.1",
40
- "effect": "3.18.3",
41
- "react": "~19.2.0",
42
- "react-dom": "~19.2.0",
43
- "vite": "7.1.9",
44
- "@dxos/echo": "0.8.4-main.c4373fc",
45
- "@dxos/react-ui": "0.8.4-main.c4373fc",
46
- "@dxos/react-ui-theme": "0.8.4-main.c4373fc",
47
- "@dxos/storybook-utils": "0.8.4-main.c4373fc"
44
+ "@types/react": "~19.2.7",
45
+ "@types/react-dom": "~19.2.3",
46
+ "effect": "3.19.16",
47
+ "react": "~19.2.3",
48
+ "react-dom": "~19.2.3",
49
+ "vite": "^7.1.11",
50
+ "@dxos/react-ui": "0.8.4-main.c85a9c8dae",
51
+ "@dxos/echo": "0.8.4-main.c85a9c8dae",
52
+ "@dxos/storybook-utils": "0.8.4-main.c85a9c8dae",
53
+ "@dxos/ui-theme": "0.8.4-main.c85a9c8dae"
48
54
  },
49
55
  "peerDependencies": {
50
- "effect": "^3.13.3",
51
- "react": "^19.0.0",
52
- "react-dom": "^19.0.0",
53
- "@dxos/react-ui": "0.8.4-main.c4373fc",
54
- "@dxos/react-ui-theme": "0.8.4-main.c4373fc"
56
+ "effect": "3.19.16",
57
+ "react": "~19.2.3",
58
+ "react-dom": "~19.2.3",
59
+ "@dxos/react-ui": "0.8.4-main.c85a9c8dae",
60
+ "@dxos/ui-theme": "0.8.4-main.c85a9c8dae"
55
61
  },
56
62
  "publishConfig": {
57
63
  "access": "public"
@@ -2,16 +2,19 @@
2
2
  // Copyright 2023 DXOS.org
3
3
  //
4
4
 
5
- import { contributes, defineModule, definePlugin } from '@dxos/app-framework';
5
+ import * as Effect from 'effect/Effect';
6
+
7
+ import { Capability, Plugin } from '@dxos/app-framework';
6
8
  import { MarkdownCapabilities, MarkdownEvents } from '@dxos/plugin-markdown';
7
9
 
8
10
  import { mermaid } from './extensions';
9
11
  import { meta } from './meta';
10
12
 
11
- export const MermaidPlugin = definePlugin(meta, () => [
12
- defineModule({
13
- id: `${meta.id}/module/markdown`,
13
+ export const MermaidPlugin = Plugin.define(meta).pipe(
14
+ Plugin.addModule({
15
+ id: 'markdown',
14
16
  activatesOn: MarkdownEvents.SetupExtensions,
15
- activate: () => contributes(MarkdownCapabilities.Extensions, [mermaid]),
17
+ activate: () => Effect.succeed(Capability.contributes(MarkdownCapabilities.Extensions, [mermaid])),
16
18
  }),
17
- ]);
19
+ Plugin.make,
20
+ );
@@ -112,18 +112,18 @@ export const mermaid = (_options: MermaidOptions = {}): Extension => {
112
112
  maring: '4px 0',
113
113
  padding: '16px',
114
114
  justifyContent: 'center',
115
- backgroundColor: 'var(--dx-groupSurface)',
115
+ backgroundColor: 'var(--color-group-surface)',
116
116
  borderRadius: '8px',
117
117
  },
118
118
  '& .cm-mermaid-label': {
119
119
  position: 'absolute',
120
120
  right: '16px',
121
121
  fontFamily: 'unset',
122
- color: 'var(--dx-subdued)',
122
+ color: 'var(--color-subdued)',
123
123
  },
124
124
  '& .cm-mermaid-error': {
125
125
  display: 'inline-block',
126
- color: 'var(--dx-errorText)',
126
+ color: 'var(--color-error)',
127
127
  },
128
128
  '& .cm-mermaid-hidden': {
129
129
  display: 'none !important',
@@ -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
  }
@@ -6,14 +6,14 @@ 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 { withTheme } from '@dxos/react-ui/testing';
9
+ import { withLayout, withTheme } from '@dxos/react-ui/testing';
10
+ import { useTextEditor } from '@dxos/react-ui-editor';
10
11
  import {
11
12
  createBasicExtensions,
12
13
  createMarkdownExtensions,
13
14
  createThemeExtensions,
14
15
  decorateMarkdown,
15
- useTextEditor,
16
- } from '@dxos/react-ui-editor';
16
+ } from '@dxos/ui-editor';
17
17
 
18
18
  import { mermaid } from './mermaid-extension';
19
19
 
@@ -43,12 +43,9 @@ const DefaultStory = ({ text }: StoryProps) => {
43
43
  };
44
44
 
45
45
  const meta = {
46
- title: 'plugins/plugin-mermaid/extensions',
46
+ title: 'plugins/plugin-mermaid/extensions/mermaid',
47
47
  render: DefaultStory,
48
- decorators: [withTheme],
49
- parameters: {
50
- layout: 'column',
51
- },
48
+ decorators: [withTheme(), withLayout({ layout: 'column' })],
52
49
  } satisfies Meta<typeof DefaultStory>;
53
50
 
54
51
  export default meta;
package/src/meta.ts CHANGED
@@ -2,12 +2,16 @@
2
2
  // Copyright 2023 DXOS.org
3
3
  //
4
4
 
5
- import { type PluginMeta } from '@dxos/app-framework';
5
+ import { type Plugin } from '@dxos/app-framework';
6
+ import { trim } from '@dxos/util';
6
7
 
7
- export const meta: PluginMeta = {
8
+ export const meta: Plugin.Meta = {
8
9
  id: 'dxos.org/plugin/mermaid',
9
10
  name: 'Mermaid',
10
- 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
+ `,
11
15
  icon: 'ph--anchor-simple--regular',
12
16
  source: 'https://github.com/dxos/dxos/tree/main/packages/plugins/plugin-mermaid',
13
17
  };