@haklex/rich-ext-excalidraw 0.24.0 → 0.25.1
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 +31 -28
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -10,90 +10,93 @@ pnpm add @haklex/rich-ext-excalidraw
|
|
|
10
10
|
|
|
11
11
|
## Peer Dependencies
|
|
12
12
|
|
|
13
|
-
| Package
|
|
14
|
-
|
|
|
15
|
-
| `@lexical/react` | `^0.
|
|
16
|
-
| `lexical`
|
|
17
|
-
| `lucide-react`
|
|
18
|
-
| `react`
|
|
19
|
-
| `react-dom`
|
|
13
|
+
| Package | Version |
|
|
14
|
+
| ---------------- | --------- |
|
|
15
|
+
| `@lexical/react` | `^0.45.0` |
|
|
16
|
+
| `lexical` | `^0.45.0` |
|
|
17
|
+
| `lucide-react` | `^1.0.0` |
|
|
18
|
+
| `react` | `>= 19` |
|
|
19
|
+
| `react-dom` | `>= 19` |
|
|
20
20
|
|
|
21
21
|
## Usage
|
|
22
22
|
|
|
23
23
|
### Register nodes in your editor config
|
|
24
24
|
|
|
25
25
|
```ts
|
|
26
|
-
import { ExcalidrawEditNode } from '@haklex/rich-ext-excalidraw'
|
|
26
|
+
import { ExcalidrawEditNode } from '@haklex/rich-ext-excalidraw';
|
|
27
27
|
|
|
28
28
|
const editorConfig = {
|
|
29
29
|
nodes: [ExcalidrawEditNode],
|
|
30
|
-
}
|
|
30
|
+
};
|
|
31
31
|
```
|
|
32
32
|
|
|
33
33
|
For static/read-only rendering:
|
|
34
34
|
|
|
35
35
|
```ts
|
|
36
|
-
import { ExcalidrawNode } from '@haklex/rich-ext-excalidraw/static'
|
|
36
|
+
import { ExcalidrawNode } from '@haklex/rich-ext-excalidraw/static';
|
|
37
37
|
|
|
38
38
|
const staticConfig = {
|
|
39
39
|
nodes: [ExcalidrawNode],
|
|
40
|
-
}
|
|
40
|
+
};
|
|
41
41
|
```
|
|
42
42
|
|
|
43
43
|
### Use the Excalidraw plugin
|
|
44
44
|
|
|
45
45
|
```tsx
|
|
46
|
-
import { ExcalidrawPlugin } from '@haklex/rich-ext-excalidraw'
|
|
46
|
+
import { ExcalidrawPlugin } from '@haklex/rich-ext-excalidraw';
|
|
47
47
|
|
|
48
48
|
function EditorPlugins() {
|
|
49
|
-
return <ExcalidrawPlugin
|
|
49
|
+
return <ExcalidrawPlugin />;
|
|
50
50
|
}
|
|
51
51
|
```
|
|
52
52
|
|
|
53
53
|
### Insert an Excalidraw block programmatically
|
|
54
54
|
|
|
55
55
|
```ts
|
|
56
|
-
import { INSERT_EXCALIDRAW_COMMAND } from '@haklex/rich-ext-excalidraw'
|
|
56
|
+
import { INSERT_EXCALIDRAW_COMMAND } from '@haklex/rich-ext-excalidraw';
|
|
57
57
|
|
|
58
|
-
editor.dispatchCommand(INSERT_EXCALIDRAW_COMMAND, undefined)
|
|
58
|
+
editor.dispatchCommand(INSERT_EXCALIDRAW_COMMAND, undefined);
|
|
59
59
|
```
|
|
60
60
|
|
|
61
61
|
### Configure Excalidraw behavior
|
|
62
62
|
|
|
63
63
|
```tsx
|
|
64
|
-
import { ExcalidrawConfigProvider } from '@haklex/rich-ext-excalidraw'
|
|
65
|
-
import type { ExcalidrawConfig } from '@haklex/rich-ext-excalidraw'
|
|
64
|
+
import { ExcalidrawConfigProvider } from '@haklex/rich-ext-excalidraw';
|
|
65
|
+
import type { ExcalidrawConfig } from '@haklex/rich-ext-excalidraw';
|
|
66
66
|
|
|
67
67
|
const config: ExcalidrawConfig = {
|
|
68
68
|
// your Excalidraw configuration
|
|
69
|
-
}
|
|
69
|
+
};
|
|
70
70
|
|
|
71
71
|
function App() {
|
|
72
72
|
return (
|
|
73
73
|
<ExcalidrawConfigProvider value={config}>
|
|
74
74
|
<Editor />
|
|
75
75
|
</ExcalidrawConfigProvider>
|
|
76
|
-
)
|
|
76
|
+
);
|
|
77
77
|
}
|
|
78
78
|
```
|
|
79
79
|
|
|
80
80
|
### Use renderers
|
|
81
81
|
|
|
82
82
|
```tsx
|
|
83
|
-
import { ExcalidrawEditRenderer } from '@haklex/rich-ext-excalidraw'
|
|
84
|
-
import {
|
|
83
|
+
import { ExcalidrawEditRenderer } from '@haklex/rich-ext-excalidraw';
|
|
84
|
+
import {
|
|
85
|
+
ExcalidrawDisplayRenderer,
|
|
86
|
+
ExcalidrawSSRRenderer,
|
|
87
|
+
} from '@haklex/rich-ext-excalidraw/static';
|
|
85
88
|
```
|
|
86
89
|
|
|
87
90
|
### Snapshot utilities
|
|
88
91
|
|
|
89
92
|
```ts
|
|
90
|
-
import { parseSnapshot, serializeSnapshot } from '@haklex/rich-ext-excalidraw'
|
|
93
|
+
import { parseSnapshot, serializeSnapshot } from '@haklex/rich-ext-excalidraw';
|
|
91
94
|
```
|
|
92
95
|
|
|
93
96
|
### Import styles
|
|
94
97
|
|
|
95
98
|
```ts
|
|
96
|
-
import '@haklex/rich-ext-excalidraw/style.css'
|
|
99
|
+
import '@haklex/rich-ext-excalidraw/style.css';
|
|
97
100
|
```
|
|
98
101
|
|
|
99
102
|
## Exports
|
|
@@ -132,11 +135,11 @@ import '@haklex/rich-ext-excalidraw/style.css'
|
|
|
132
135
|
|
|
133
136
|
### Sub-path Exports
|
|
134
137
|
|
|
135
|
-
| Path
|
|
136
|
-
|
|
|
137
|
-
| `@haklex/rich-ext-excalidraw`
|
|
138
|
-
| `@haklex/rich-ext-excalidraw/static`
|
|
139
|
-
| `@haklex/rich-ext-excalidraw/style.css` | Stylesheet
|
|
138
|
+
| Path | Description |
|
|
139
|
+
| --------------------------------------- | --------------------------------------- |
|
|
140
|
+
| `@haklex/rich-ext-excalidraw` | Full exports (edit + static) |
|
|
141
|
+
| `@haklex/rich-ext-excalidraw/static` | Static-only (no Excalidraw editor deps) |
|
|
142
|
+
| `@haklex/rich-ext-excalidraw/style.css` | Stylesheet |
|
|
140
143
|
|
|
141
144
|
## Part of Haklex
|
|
142
145
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@haklex/rich-ext-excalidraw",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.25.1",
|
|
4
4
|
"description": "Excalidraw whiteboard extension",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
],
|
|
27
27
|
"dependencies": {
|
|
28
28
|
"jsondiffpatch": "^0.7.6",
|
|
29
|
-
"@haklex/rich-headless": "0.
|
|
29
|
+
"@haklex/rich-headless": "0.25.1"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
32
|
"@excalidraw/excalidraw": "^0.18.1",
|
|
@@ -50,9 +50,9 @@
|
|
|
50
50
|
"lucide-react": "^1.0.0",
|
|
51
51
|
"react": ">=19",
|
|
52
52
|
"react-dom": ">=19",
|
|
53
|
-
"@haklex/rich-editor": "0.
|
|
54
|
-
"@haklex/rich-style-token": "0.
|
|
55
|
-
"@haklex/rich-editor-ui": "0.
|
|
53
|
+
"@haklex/rich-editor": "0.25.1",
|
|
54
|
+
"@haklex/rich-style-token": "0.25.1",
|
|
55
|
+
"@haklex/rich-editor-ui": "0.25.1"
|
|
56
56
|
},
|
|
57
57
|
"publishConfig": {
|
|
58
58
|
"access": "public"
|