@ixo/editor 5.20.2 → 5.25.0

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 CHANGED
@@ -1,438 +1,433 @@
1
- # IXO Editor
2
-
3
- A custom BlockNote editor wrapper built specifically for the IXO team's needs. This package provides a highly customized rich text editing experience built on top of [BlockNote](https://www.blocknotejs.org/) with support for both **Shadcn UI** and **Mantine UI**.
4
-
5
- > **Note**: This package is designed for internal IXO team use and is not intended for public consumption, though it is hosted publicly.
6
-
7
- ## Features
8
-
9
- - 🎨 **Multi-UI Support**: Choose between Shadcn UI or Mantine UI components
10
- - 🔧 **Simplified API**: Wrapped BlockNote functionality with sensible defaults
11
- - 📝 **Rich Text Editing**: Full support for headings, lists, code blocks, tables, and more
12
- - 🔗 **Custom Blocks**: Built-in custom blocks including dynamic List block for DID data
13
- - 🖼️ **Media Support**: Image and file upload handling
14
- - 🎯 **TypeScript**: Full TypeScript support with exported types
15
- - 🤝 **Collaboration Ready**: Built-in Matrix-based collaborative editing with real-time synchronization
16
- - 📱 **Responsive**: Mobile-friendly editor experience
17
- - 💎 **Complete CSS Bundles**: Self-contained CSS with all dependencies included
18
-
19
- ## Installation
20
-
21
- ```bash
22
- npm install @ixo/editor
23
- # or
24
- yarn add @ixo/editor
25
- # or
26
- pnpm add @ixo/editor
27
- ```
28
-
29
- ## Quick Start
30
-
31
- ### Shadcn UI Version (Default)
32
-
33
- ```tsx
34
- import React from 'react';
35
- import { useCreateIxoEditor, IxoEditor } from '@ixo/editor/shadcn';
36
- import '@ixo/editor/style-shadcn.css'; // Complete CSS bundle - no other imports needed!
37
-
38
- function MyEditor() {
39
- const editor = useCreateIxoEditor({
40
- theme: 'light',
41
- initialContent: [
42
- {
43
- type: 'heading',
44
- content: 'Welcome to IXO Editor',
45
- props: { level: 1 },
46
- },
47
- {
48
- type: 'paragraph',
49
- content: 'Start typing to create amazing content!',
50
- },
51
- ],
52
- });
53
-
54
- return <IxoEditor editor={editor} onChange={() => console.log('Content changed')} />;
55
- }
56
- ```
57
-
58
- ### Mantine UI Version
59
-
60
- ```tsx
61
- import React from 'react';
62
- import { MantineProvider } from '@mantine/core';
63
- import { useCreateIxoEditor, IxoEditor } from '@ixo/editor/mantine';
64
- import '@ixo/editor/style-mantine.css'; // Complete CSS bundle - no other imports needed!
65
-
66
- function MyEditor() {
67
- const editor = useCreateIxoEditor({
68
- theme: 'light',
69
- initialContent: [
70
- {
71
- type: 'heading',
72
- content: 'Welcome to IXO Editor',
73
- props: { level: 1 },
74
- },
75
- ],
76
- });
77
-
78
- return (
79
- <MantineProvider>
80
- <IxoEditor editor={editor} onChange={() => console.log('Content changed')} />
81
- </MantineProvider>
82
- );
83
- }
84
- ```
85
-
86
- ## Import Options
87
-
88
- The package provides flexible import patterns to suit your needs:
89
-
90
- ### Option 1: UI-Specific Imports (Recommended)
91
-
92
- ```tsx
93
- // Shadcn version with complete CSS bundle
94
- import { IxoEditor, useCreateIxoEditor } from '@ixo/editor/shadcn';
95
- import '@ixo/editor/style-shadcn.css';
96
-
97
- // Mantine version with complete CSS bundle
98
- import { IxoEditor, useCreateIxoEditor } from '@ixo/editor/mantine';
99
- import '@ixo/editor/style-mantine.css';
100
- ```
101
-
102
- ### Option 2: Default Import (Shadcn)
103
-
104
- ```tsx
105
- // Uses Shadcn version by default for backward compatibility
106
- import { IxoEditor, useCreateIxoEditor } from '@ixo/editor';
107
- import '@ixo/editor/style.css';
108
- ```
109
-
110
- ### CSS Bundle Options
111
-
112
- - `@ixo/editor/style-shadcn.css` - Complete bundle: Inter fonts + Shadcn + IXO styles
113
- - `@ixo/editor/style-mantine.css` - Complete bundle: Inter fonts + Mantine + IXO styles
114
- - `@ixo/editor/style.css` - Default bundle (same as shadcn)
115
- - `@ixo/editor/style-core.css` - Only IXO custom styles (for advanced users)
116
-
117
- ## API Reference
118
-
119
- ### `useCreateIxoEditor`
120
-
121
- The main hook for creating an IXO editor instance. Available in both UI versions.
122
-
123
- ```tsx
124
- const editor = useCreateIxoEditor(options?: IxoEditorOptions);
125
- ```
126
-
127
- #### Options
128
-
129
- | Option | Type | Default | Description |
130
- | ------------------- | --------------------------------- | ------------------ | ----------------------------------------- |
131
- | `theme` | `'light' \| 'dark'` | `'light'` | Editor color theme |
132
- | `uploadFile` | `(file: File) => Promise<string>` | Data URL converter | File upload handler |
133
- | `initialContent` | `PartialBlock[]` | `undefined` | Initial editor content |
134
- | `editable` | `boolean` | `true` | Whether editor is editable |
135
- | `sideMenu` | `boolean` | `true` | Show side menu (drag handle, plus button) |
136
- | `slashMenu` | `boolean` | `true` | Enable slash commands menu |
137
- | `formattingToolbar` | `boolean` | `true` | Show formatting toolbar |
138
- | `linkToolbar` | `boolean` | `true` | Show link toolbar |
139
- | `filePanel` | `boolean` | `true` | Show file panel |
140
- | `tableHandles` | `boolean` | `true` | Show table manipulation handles |
141
-
142
- ### `IxoEditor` Component
143
-
144
- The main editor component. Available in both UI versions with identical APIs.
145
-
146
- ```tsx
147
- <IxoEditor
148
- editor={editor}
149
- className="my-custom-class"
150
- onChange={() => {}}
151
- onSelectionChange={() => {}}
152
- />
153
- ```
154
-
155
- #### Props
156
-
157
- | Prop | Type | Description |
158
- | ------------------- | ------------------------------ | ----------------------------------------- |
159
- | `editor` | `BlockNoteEditor \| undefined` | Editor instance from `useCreateIxoEditor` |
160
- | `className` | `string` | Additional CSS classes |
161
- | `onChange` | `() => void` | Callback when content changes |
162
- | `onSelectionChange` | `() => void` | Callback when selection changes |
163
- | `children` | `React.ReactNode` | Custom child components |
164
-
165
- ## Advanced Usage
166
-
167
- ### Custom File Upload
168
-
169
- ```tsx
170
- const editor = useCreateIxoEditor({
171
- uploadFile: async (file: File) => {
172
- const formData = new FormData();
173
- formData.append('file', file);
174
-
175
- const response = await fetch('/api/upload', {
176
- method: 'POST',
177
- body: formData,
178
- });
179
-
180
- const { url } = await response.json();
181
- return url;
182
- },
183
- });
184
- ```
185
-
186
- ### Collaborative Editing
187
-
188
- For real-time collaborative editing, use the `useCreateCollaborativeIxoEditor` hook with Matrix protocol:
189
-
190
- ```tsx
191
- import { useCreateCollaborativeIxoEditor, IxoEditor } from '@ixo/editor/shadcn';
192
-
193
- function CollaborativeEditor() {
194
- const { editor, connectionStatus } = useCreateCollaborativeIxoEditor({
195
- theme: 'light',
196
- user: {
197
- id: 'user-123',
198
- name: 'John Doe',
199
- color: '#FF5733',
200
- accessToken: 'your-matrix-access-token',
201
- address: 'your-user-address',
202
- },
203
- matrixClient: matrixClient,
204
- roomId: '!roomId:matrix.org',
205
- });
206
-
207
- return (
208
- <div>
209
- <div>Connection: {connectionStatus}</div>
210
- <IxoEditor editor={editor} />
211
- </div>
212
- );
213
- }
214
- ```
215
-
216
- ### Dark Theme
217
-
218
- ```tsx
219
- const editor = useCreateIxoEditor({
220
- theme: 'dark',
221
- });
222
- ```
223
-
224
- ### Read-Only Mode
225
-
226
- ```tsx
227
- const editor = useCreateIxoEditor({
228
- editable: false,
229
- sideMenu: false,
230
- slashMenu: false,
231
- formattingToolbar: false,
232
- });
233
- ```
234
-
235
- ## Custom Blocks
236
-
237
- The IXO Editor includes custom blocks for working with IXO ecosystem data, available in both UI versions:
238
-
239
- ### List Block
240
-
241
- The List block displays dynamic data from DID and fragment identifiers, perfect for displaying data from your GraphQL API.
242
-
243
- ### Overview Block
244
-
245
- The Overview block provides a comprehensive view of entity data from DID identifiers.
246
-
247
- #### Usage
248
-
249
- Both blocks can be inserted using the slash menu:
250
-
251
- **List Block:**
252
-
253
- 1. Type `/list` in the editor
254
- 2. Or type `/` and search for "List", "data", or "dynamic"
255
- 3. Configure the DID and fragment identifier in the settings
256
-
257
- **Overview Block:**
258
-
259
- 1. Type `/overview` in the editor
260
- 2. Or type `/` and search for "Overview", "overview-block", or "data-overview"
261
- 3. Configure the DID in the settings
262
-
263
- #### Programmatic Usage
264
-
265
- ```tsx
266
- // Insert a list block programmatically
267
- editor.insertBlocks(
268
- [
269
- {
270
- type: 'list',
271
- props: {
272
- title: 'My Data List',
273
- did: 'did:ixo:entity123',
274
- fragmentIdentifier: 'claims-data',
275
- },
276
- },
277
- ],
278
- editor.getTextCursorPosition().block,
279
- 'after'
280
- );
281
-
282
- // Insert an overview block programmatically
283
- editor.insertBlocks(
284
- [
285
- {
286
- type: 'overview',
287
- props: {
288
- did: 'did:ixo:entity123',
289
- },
290
- },
291
- ],
292
- editor.getTextCursorPosition().block,
293
- 'after'
294
- );
295
- ```
296
-
297
- ## UI Library Comparison
298
-
299
- | Feature | Shadcn UI | Mantine UI |
300
- | ----------------- | -------------------- | --------------------- |
301
- | **Bundle Size** | ~46KB CSS | ~173KB CSS |
302
- | **Custom Blocks** | Full-featured | Minimal (expandable) |
303
- | **Theming** | Tailwind-based | CSS-in-JS |
304
- | **Dependencies** | Radix UI primitives | Mantine ecosystem |
305
- | **Customization** | High (CSS variables) | High (theme provider) |
306
-
307
- ### When to Choose Shadcn UI
308
-
309
- - You're already using Tailwind CSS
310
- - ✅ You prefer smaller bundle sizes
311
- - ✅ You want the full-featured custom blocks
312
- - ✅ You like CSS variable-based theming
313
-
314
- ### When to Choose Mantine UI
315
-
316
- - ✅ You're already using Mantine in your app
317
- - ✅ You prefer component-based theming
318
- - You want consistent Mantine design language
319
- - ✅ You plan to enhance the minimal blocks with Mantine components
320
-
321
- ## Development
322
-
323
- ### Project Structure
324
-
325
- ```
326
- ixo-editor/
327
- ├── src/
328
- │ ├── core/ # Shared infrastructure
329
- │ │ ├── types.ts # Shared types
330
- │ │ ├── hooks/ # Matrix provider
331
- │ │ └── lib/ # GraphQL client & utilities
332
- ├── shadcn/ # Shadcn UI implementation
333
- ├── IxoEditor.tsx
334
- │ │ ├── blocks/ # Full-featured custom blocks
335
- │ │ ├── components/ # Shadcn UI components
336
- │ │ ├── hooks/ # Editor hooks
337
- │ │ └── index.ts # Shadcn exports
338
- │ ├── mantine/ # Mantine UI implementation
339
- │ │ ├── IxoEditor.tsx
340
- │ ├── blocks/ # Minimal custom blocks
341
- │ │ ├── hooks/ # Editor hooks
342
- │ │ └── index.ts # Mantine exports
343
- │ ├── styles/ # Source CSS
344
- │ └── ixo-editor.css
345
- │ └── index.ts # Main entry (defaults to shadcn)
346
- ├── fonts/ # Inter font files
347
- ├── dist/ # Built JavaScript
348
- │ ├── index.js # Main bundle
349
- │ ├── shadcn/ # Shadcn bundle
350
- │ └── mantine/ # Mantine bundle
351
- ├── style*.css # CSS bundles
352
- └── package.json
353
- ```
354
-
355
- ### Building the Package
356
-
357
- ```bash
358
- # Install dependencies
359
- pnpm install
360
-
361
- # Build the package (creates all bundles)
362
- pnpm build
363
-
364
- # Watch for changes during development
365
- pnpm run dev
366
-
367
- # Type checking
368
- pnpm run type-check
369
- ```
370
-
371
- ## Requirements
372
-
373
- - React 18.0.0 or higher
374
- - React DOM 18.0.0 or higher
375
- - Modern browser with ES2020 support
376
- - For collaborative editing: Matrix server access
377
-
378
- ### Additional Requirements by UI Library
379
-
380
- **For Mantine version:**
381
-
382
- - `@mantine/core` ^8.0.0 (peer dependency)
383
- - `@mantine/hooks` ^8.0.0 (peer dependency)
384
-
385
- **For Shadcn version:**
386
-
387
- - Works with existing Tailwind CSS setup
388
- - No additional peer dependencies
389
-
390
- ## Migration Guide
391
-
392
- ### From v1.x to v2.x (Multi-UI)
393
-
394
- **Before (v1.x):**
395
-
396
- ```tsx
397
- import { IxoEditor } from '@ixo/editor';
398
- import '@blocknote/shadcn/style.css';
399
- import '@ixo/editor/style.css';
400
- ```
401
-
402
- **After (v2.x) - Recommended:**
403
-
404
- ```tsx
405
- // Explicit shadcn version with complete CSS bundle
406
- import { IxoEditor } from '@ixo/editor/shadcn';
407
- import '@ixo/editor/style-shadcn.css'; // Single import!
408
- ```
409
-
410
- **After (v2.x) - Backward compatible:**
411
-
412
- ```tsx
413
- // Still works! (defaults to shadcn)
414
- import { IxoEditor } from '@ixo/editor';
415
- import '@ixo/editor/style.css'; // Now includes all dependencies
416
- ```
417
-
418
- ## License
419
-
420
- MIT © IXO Team
421
-
422
- ---
423
-
424
- ## Internal Notes
425
-
426
- This package is maintained by the IXO development team. For questions or issues, please contact the team directly through internal channels.
427
-
428
- ### Version Management
429
-
430
- Follow semantic versioning:
431
-
432
- - Patch releases (0.0.x): Bug fixes and minor updates
433
- - Minor releases (0.x.0): New features that are backward compatible
434
- - Major releases (x.0.0): Breaking changes (like the multi-UI restructure)
435
-
436
- ### Contributing
437
-
438
- This is an internal package. All contributions should go through the standard IXO development workflow and review process.
1
+ # IXO Editor
2
+
3
+ A custom BlockNote editor wrapper built specifically for the IXO team's needs. This package provides a highly customized rich text editing experience built on top of [BlockNote](https://www.blocknotejs.org/) with support for both **Shadcn UI** and **Mantine UI**.
4
+
5
+ > **Note**: This package is designed for internal IXO team use and is not intended for public consumption, though it is hosted publicly.
6
+
7
+ ## Features
8
+
9
+ - 🎨 **Multi-UI Support**: Choose between Shadcn UI or Mantine UI components.
10
+ - 🔧 **Simplified API**: Wrapped BlockNote functionality with sensible defaults
11
+ - 📝 **Rich Text Editing**: Full support for headings, lists, code blocks, tables, and more
12
+ - 🔗 **Custom Blocks**: Built-in custom blocks including dynamic List block for DID data
13
+ - 🖼️ **Media Support**: Image and file upload handling
14
+ - 🎯 **TypeScript**: Full TypeScript support with exported types
15
+ - 🤝 **Collaboration Ready**: Built-in Matrix-based collaborative editing with real-time synchronization
16
+ - 📱 **Responsive**: Mobile-friendly editor experience
17
+ - 💎 **Complete CSS Bundles**: Self-contained CSS with all dependencies included
18
+
19
+ ## Installation
20
+
21
+ ```bash
22
+ npm install @ixo/editor
23
+ # or
24
+ yarn add @ixo/editor
25
+ # or
26
+ pnpm add @ixo/editor
27
+ ```
28
+
29
+ ## Quick Start
30
+
31
+ ### Shadcn UI Version (Default)
32
+
33
+ ```tsx
34
+ import React from 'react';
35
+ import { useCreateIxoEditor, IxoEditor } from '@ixo/editor/shadcn';
36
+ import '@ixo/editor/style-shadcn.css'; // Complete CSS bundle - no other imports needed!
37
+
38
+ function MyEditor() {
39
+ const editor = useCreateIxoEditor({
40
+ theme: 'light',
41
+ initialContent: [
42
+ {
43
+ type: 'heading',
44
+ content: 'Welcome to IXO Editor',
45
+ props: { level: 1 },
46
+ },
47
+ {
48
+ type: 'paragraph',
49
+ content: 'Start typing to create amazing content!',
50
+ },
51
+ ],
52
+ });
53
+
54
+ return <IxoEditor editor={editor} onChange={() => console.log('Content changed')} />;
55
+ }
56
+ ```
57
+
58
+ ### Mantine UI Version
59
+
60
+ ```tsx
61
+ import React from 'react';
62
+ import { MantineProvider } from '@mantine/core';
63
+ import { useCreateIxoEditor, IxoEditor } from '@ixo/editor/mantine';
64
+ import '@ixo/editor/style-mantine.css'; // Complete CSS bundle - no other imports needed!
65
+
66
+ function MyEditor() {
67
+ const editor = useCreateIxoEditor({
68
+ theme: 'light',
69
+ initialContent: [
70
+ {
71
+ type: 'heading',
72
+ content: 'Welcome to IXO Editor',
73
+ props: { level: 1 },
74
+ },
75
+ ],
76
+ });
77
+
78
+ return (
79
+ <MantineProvider>
80
+ <IxoEditor editor={editor} onChange={() => console.log('Content changed')} />
81
+ </MantineProvider>
82
+ );
83
+ }
84
+ ```
85
+
86
+ ## Import Options
87
+
88
+ The package provides flexible import patterns to suit your needs:
89
+
90
+ ### Option 1: UI-Specific Imports (Recommended)
91
+
92
+ ```tsx
93
+ // Shadcn version with complete CSS bundle
94
+ import { IxoEditor, useCreateIxoEditor } from '@ixo/editor/shadcn';
95
+ import '@ixo/editor/style-shadcn.css';
96
+
97
+ // Mantine version with complete CSS bundle
98
+ import { IxoEditor, useCreateIxoEditor } from '@ixo/editor/mantine';
99
+ import '@ixo/editor/style-mantine.css';
100
+ ```
101
+
102
+ ### Option 2: Default Import (Shadcn)
103
+
104
+ ```tsx
105
+ // Uses Shadcn version by default for backward compatibility
106
+ import { IxoEditor, useCreateIxoEditor } from '@ixo/editor';
107
+ import '@ixo/editor/style.css';
108
+ ```
109
+
110
+ ### CSS Bundle Options
111
+
112
+ - `@ixo/editor/style-shadcn.css` - Complete bundle: Inter fonts + Shadcn + IXO styles
113
+ - `@ixo/editor/style-mantine.css` - Complete bundle: Inter fonts + Mantine + IXO styles
114
+ - `@ixo/editor/style.css` - Default bundle (same as shadcn)
115
+ - `@ixo/editor/style-core.css` - Only IXO custom styles (for advanced users)
116
+
117
+ ## API Reference
118
+
119
+ ### `useCreateIxoEditor`
120
+
121
+ The main hook for creating an IXO editor instance. Available in both UI versions.
122
+
123
+ ```tsx
124
+ const editor = useCreateIxoEditor(options?: IxoEditorOptions);
125
+ ```
126
+
127
+ #### Options
128
+
129
+ | Option | Type | Default | Description |
130
+ | ------------------- | --------------------------------- | ------------------ | ----------------------------------------- |
131
+ | `theme` | `'light' \| 'dark'` | `'light'` | Editor color theme |
132
+ | `uploadFile` | `(file: File) => Promise<string>` | Data URL converter | File upload handler |
133
+ | `initialContent` | `PartialBlock[]` | `undefined` | Initial editor content |
134
+ | `editable` | `boolean` | `true` | Whether editor is editable |
135
+ | `sideMenu` | `boolean` | `true` | Show side menu (drag handle, plus button) |
136
+ | `slashMenu` | `boolean` | `true` | Enable slash commands menu |
137
+ | `formattingToolbar` | `boolean` | `true` | Show formatting toolbar |
138
+ | `linkToolbar` | `boolean` | `true` | Show link toolbar |
139
+ | `filePanel` | `boolean` | `true` | Show file panel |
140
+ | `tableHandles` | `boolean` | `true` | Show table manipulation handles |
141
+
142
+ ### `IxoEditor` Component
143
+
144
+ The main editor component. Available in both UI versions with identical APIs.
145
+
146
+ ```tsx
147
+ <IxoEditor editor={editor} className="my-custom-class" onChange={() => {}} onSelectionChange={() => {}} />
148
+ ```
149
+
150
+ #### Props
151
+
152
+ | Prop | Type | Description |
153
+ | ------------------- | ------------------------------ | ----------------------------------------- |
154
+ | `editor` | `BlockNoteEditor \| undefined` | Editor instance from `useCreateIxoEditor` |
155
+ | `className` | `string` | Additional CSS classes |
156
+ | `onChange` | `() => void` | Callback when content changes |
157
+ | `onSelectionChange` | `() => void` | Callback when selection changes |
158
+ | `children` | `React.ReactNode` | Custom child components |
159
+
160
+ ## Advanced Usage
161
+
162
+ ### Custom File Upload
163
+
164
+ ```tsx
165
+ const editor = useCreateIxoEditor({
166
+ uploadFile: async (file: File) => {
167
+ const formData = new FormData();
168
+ formData.append('file', file);
169
+
170
+ const response = await fetch('/api/upload', {
171
+ method: 'POST',
172
+ body: formData,
173
+ });
174
+
175
+ const { url } = await response.json();
176
+ return url;
177
+ },
178
+ });
179
+ ```
180
+
181
+ ### Collaborative Editing
182
+
183
+ For real-time collaborative editing, use the `useCreateCollaborativeIxoEditor` hook with Matrix protocol:
184
+
185
+ ```tsx
186
+ import { useCreateCollaborativeIxoEditor, IxoEditor } from '@ixo/editor/shadcn';
187
+
188
+ function CollaborativeEditor() {
189
+ const { editor, connectionStatus } = useCreateCollaborativeIxoEditor({
190
+ theme: 'light',
191
+ user: {
192
+ id: 'user-123',
193
+ name: 'John Doe',
194
+ color: '#FF5733',
195
+ accessToken: 'your-matrix-access-token',
196
+ address: 'your-user-address',
197
+ },
198
+ matrixClient: matrixClient,
199
+ roomId: '!roomId:matrix.org',
200
+ });
201
+
202
+ return (
203
+ <div>
204
+ <div>Connection: {connectionStatus}</div>
205
+ <IxoEditor editor={editor} />
206
+ </div>
207
+ );
208
+ }
209
+ ```
210
+
211
+ ### Dark Theme
212
+
213
+ ```tsx
214
+ const editor = useCreateIxoEditor({
215
+ theme: 'dark',
216
+ });
217
+ ```
218
+
219
+ ### Read-Only Mode
220
+
221
+ ```tsx
222
+ const editor = useCreateIxoEditor({
223
+ editable: false,
224
+ sideMenu: false,
225
+ slashMenu: false,
226
+ formattingToolbar: false,
227
+ });
228
+ ```
229
+
230
+ ## Custom Blocks
231
+
232
+ The IXO Editor includes custom blocks for working with IXO ecosystem data, available in both UI versions:
233
+
234
+ ### List Block
235
+
236
+ The List block displays dynamic data from DID and fragment identifiers, perfect for displaying data from your GraphQL API.
237
+
238
+ ### Overview Block
239
+
240
+ The Overview block provides a comprehensive view of entity data from DID identifiers.
241
+
242
+ #### Usage
243
+
244
+ Both blocks can be inserted using the slash menu:
245
+
246
+ **List Block:**
247
+
248
+ 1. Type `/list` in the editor
249
+ 2. Or type `/` and search for "List", "data", or "dynamic"
250
+ 3. Configure the DID and fragment identifier in the settings
251
+
252
+ **Overview Block:**
253
+
254
+ 1. Type `/overview` in the editor
255
+ 2. Or type `/` and search for "Overview", "overview-block", or "data-overview"
256
+ 3. Configure the DID in the settings
257
+
258
+ #### Programmatic Usage
259
+
260
+ ```tsx
261
+ // Insert a list block programmatically
262
+ editor.insertBlocks(
263
+ [
264
+ {
265
+ type: 'list',
266
+ props: {
267
+ title: 'My Data List',
268
+ did: 'did:ixo:entity123',
269
+ fragmentIdentifier: 'claims-data',
270
+ },
271
+ },
272
+ ],
273
+ editor.getTextCursorPosition().block,
274
+ 'after'
275
+ );
276
+
277
+ // Insert an overview block programmatically
278
+ editor.insertBlocks(
279
+ [
280
+ {
281
+ type: 'overview',
282
+ props: {
283
+ did: 'did:ixo:entity123',
284
+ },
285
+ },
286
+ ],
287
+ editor.getTextCursorPosition().block,
288
+ 'after'
289
+ );
290
+ ```
291
+
292
+ ## UI Library Comparison
293
+
294
+ | Feature | Shadcn UI | Mantine UI |
295
+ | ----------------- | -------------------- | --------------------- |
296
+ | **Bundle Size** | ~46KB CSS | ~173KB CSS |
297
+ | **Custom Blocks** | Full-featured | Minimal (expandable) |
298
+ | **Theming** | Tailwind-based | CSS-in-JS |
299
+ | **Dependencies** | Radix UI primitives | Mantine ecosystem |
300
+ | **Customization** | High (CSS variables) | High (theme provider) |
301
+
302
+ ### When to Choose Shadcn UI
303
+
304
+ - You're already using Tailwind CSS
305
+ - You prefer smaller bundle sizes
306
+ - ✅ You want the full-featured custom blocks
307
+ - You like CSS variable-based theming
308
+
309
+ ### When to Choose Mantine UI
310
+
311
+ - ✅ You're already using Mantine in your app
312
+ - ✅ You prefer component-based theming
313
+ - ✅ You want consistent Mantine design language
314
+ - You plan to enhance the minimal blocks with Mantine components
315
+
316
+ ## Development
317
+
318
+ ### Project Structure
319
+
320
+ ```
321
+ ixo-editor/
322
+ ├── src/
323
+ │ ├── core/ # Shared infrastructure
324
+ │ │ ├── types.ts # Shared types
325
+ │ │ ├── hooks/ # Matrix provider
326
+ │ │ └── lib/ # GraphQL client & utilities
327
+ ├── shadcn/ # Shadcn UI implementation
328
+ ├── IxoEditor.tsx
329
+ │ │ ├── blocks/ # Full-featured custom blocks
330
+ │ │ ├── components/ # Shadcn UI components
331
+ │ │ ├── hooks/ # Editor hooks
332
+ │ └── index.ts # Shadcn exports
333
+ │ ├── mantine/ # Mantine UI implementation
334
+ │ │ ├── IxoEditor.tsx
335
+ │ │ ├── blocks/ # Minimal custom blocks
336
+ │ │ ├── hooks/ # Editor hooks
337
+ │ │ └── index.ts # Mantine exports
338
+ │ ├── styles/ # Source CSS
339
+ │ │ └── ixo-editor.css
340
+ └── index.ts # Main entry (defaults to shadcn)
341
+ ├── fonts/ # Inter font files
342
+ ├── dist/ # Built JavaScript
343
+ │ ├── index.js # Main bundle
344
+ ├── shadcn/ # Shadcn bundle
345
+ │ └── mantine/ # Mantine bundle
346
+ ├── style*.css # CSS bundles
347
+ └── package.json
348
+ ```
349
+
350
+ ### Building the Package
351
+
352
+ ```bash
353
+ # Install dependencies
354
+ pnpm install
355
+
356
+ # Build the package (creates all bundles)
357
+ pnpm build
358
+
359
+ # Watch for changes during development
360
+ pnpm run dev
361
+
362
+ # Type checking
363
+ pnpm run type-check
364
+ ```
365
+
366
+ ## Requirements
367
+
368
+ - React 18.0.0 or higher
369
+ - React DOM 18.0.0 or higher
370
+ - Modern browser with ES2020 support
371
+ - For collaborative editing: Matrix server access
372
+
373
+ ### Additional Requirements by UI Library
374
+
375
+ **For Mantine version:**
376
+
377
+ - `@mantine/core` ^8.0.0 (peer dependency)
378
+ - `@mantine/hooks` ^8.0.0 (peer dependency)
379
+
380
+ **For Shadcn version:**
381
+
382
+ - Works with existing Tailwind CSS setup
383
+ - No additional peer dependencies
384
+
385
+ ## Migration Guide
386
+
387
+ ### From v1.x to v2.x (Multi-UI)
388
+
389
+ **Before (v1.x):**
390
+
391
+ ```tsx
392
+ import { IxoEditor } from '@ixo/editor';
393
+ import '@blocknote/shadcn/style.css';
394
+ import '@ixo/editor/style.css';
395
+ ```
396
+
397
+ **After (v2.x) - Recommended:**
398
+
399
+ ```tsx
400
+ // Explicit shadcn version with complete CSS bundle
401
+ import { IxoEditor } from '@ixo/editor/shadcn';
402
+ import '@ixo/editor/style-shadcn.css'; // Single import!
403
+ ```
404
+
405
+ **After (v2.x) - Backward compatible:**
406
+
407
+ ```tsx
408
+ // Still works! (defaults to shadcn)
409
+ import { IxoEditor } from '@ixo/editor';
410
+ import '@ixo/editor/style.css'; // Now includes all dependencies
411
+ ```
412
+
413
+ ## License
414
+
415
+ MIT © IXO Team
416
+
417
+ ---
418
+
419
+ ## Internal Notes
420
+
421
+ This package is maintained by the IXO development team. For questions or issues, please contact the team directly through internal channels.
422
+
423
+ ### Version Management
424
+
425
+ Follow semantic versioning:
426
+
427
+ - Patch releases (0.0.x): Bug fixes and minor updates
428
+ - Minor releases (0.x.0): New features that are backward compatible
429
+ - Major releases (x.0.0): Breaking changes (like the multi-UI restructure)
430
+
431
+ ### Contributing
432
+
433
+ This is an internal package. All contributions should go through the standard IXO development workflow and review process.