@ixo/editor 1.1.4 → 1.2.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 +87 -62
- package/dist/chunk-R6LZUDT7.mjs +7976 -0
- package/dist/chunk-R6LZUDT7.mjs.map +1 -0
- package/dist/index.d.ts +1435 -0
- package/dist/index.mjs +20 -6
- package/dist/mantine/index.d.ts +5 -0
- package/dist/mantine/index.mjs +24 -404
- package/dist/mantine/index.mjs.map +1 -1
- package/package.json +37 -32
- package/style-core.css +11 -9
- package/style-mantine.css +11 -9
- package/style.css +12 -10
- package/dist/chunk-2UJGZZWQ.mjs +0 -180
- package/dist/chunk-2UJGZZWQ.mjs.map +0 -1
- package/dist/chunk-GSKWOGSU.mjs +0 -1611
- package/dist/chunk-GSKWOGSU.mjs.map +0 -1
- package/dist/graphql-client-BIr8uzKX.d.mts +0 -135
- package/dist/index.d.mts +0 -1328
- package/dist/mantine/index.d.mts +0 -1253
- package/dist/shadcn/index.d.mts +0 -6
- package/dist/shadcn/index.mjs +0 -27
- package/dist/shadcn/index.mjs.map +0 -1
- package/style-shadcn.css +0 -340
package/README.md
CHANGED
|
@@ -42,13 +42,13 @@ function MyEditor() {
|
|
|
42
42
|
{
|
|
43
43
|
type: 'heading',
|
|
44
44
|
content: 'Welcome to IXO Editor',
|
|
45
|
-
props: { level: 1 }
|
|
45
|
+
props: { level: 1 },
|
|
46
46
|
},
|
|
47
47
|
{
|
|
48
48
|
type: 'paragraph',
|
|
49
|
-
content: 'Start typing to create amazing content!'
|
|
50
|
-
}
|
|
51
|
-
]
|
|
49
|
+
content: 'Start typing to create amazing content!',
|
|
50
|
+
},
|
|
51
|
+
],
|
|
52
52
|
});
|
|
53
53
|
|
|
54
54
|
return <IxoEditor editor={editor} onChange={() => console.log('Content changed')} />;
|
|
@@ -70,9 +70,9 @@ function MyEditor() {
|
|
|
70
70
|
{
|
|
71
71
|
type: 'heading',
|
|
72
72
|
content: 'Welcome to IXO Editor',
|
|
73
|
-
props: { level: 1 }
|
|
74
|
-
}
|
|
75
|
-
]
|
|
73
|
+
props: { level: 1 },
|
|
74
|
+
},
|
|
75
|
+
],
|
|
76
76
|
});
|
|
77
77
|
|
|
78
78
|
return (
|
|
@@ -88,17 +88,19 @@ function MyEditor() {
|
|
|
88
88
|
The package provides flexible import patterns to suit your needs:
|
|
89
89
|
|
|
90
90
|
### Option 1: UI-Specific Imports (Recommended)
|
|
91
|
+
|
|
91
92
|
```tsx
|
|
92
93
|
// Shadcn version with complete CSS bundle
|
|
93
94
|
import { IxoEditor, useCreateIxoEditor } from '@ixo/editor/shadcn';
|
|
94
95
|
import '@ixo/editor/style-shadcn.css';
|
|
95
96
|
|
|
96
|
-
// Mantine version with complete CSS bundle
|
|
97
|
+
// Mantine version with complete CSS bundle
|
|
97
98
|
import { IxoEditor, useCreateIxoEditor } from '@ixo/editor/mantine';
|
|
98
99
|
import '@ixo/editor/style-mantine.css';
|
|
99
100
|
```
|
|
100
101
|
|
|
101
102
|
### Option 2: Default Import (Shadcn)
|
|
103
|
+
|
|
102
104
|
```tsx
|
|
103
105
|
// Uses Shadcn version by default for backward compatibility
|
|
104
106
|
import { IxoEditor, useCreateIxoEditor } from '@ixo/editor';
|
|
@@ -106,7 +108,8 @@ import '@ixo/editor/style.css';
|
|
|
106
108
|
```
|
|
107
109
|
|
|
108
110
|
### CSS Bundle Options
|
|
109
|
-
|
|
111
|
+
|
|
112
|
+
- `@ixo/editor/style-shadcn.css` - Complete bundle: Inter fonts + Shadcn + IXO styles
|
|
110
113
|
- `@ixo/editor/style-mantine.css` - Complete bundle: Inter fonts + Mantine + IXO styles
|
|
111
114
|
- `@ixo/editor/style.css` - Default bundle (same as shadcn)
|
|
112
115
|
- `@ixo/editor/style-core.css` - Only IXO custom styles (for advanced users)
|
|
@@ -123,18 +126,18 @@ const editor = useCreateIxoEditor(options?: IxoEditorOptions);
|
|
|
123
126
|
|
|
124
127
|
#### Options
|
|
125
128
|
|
|
126
|
-
| Option
|
|
127
|
-
|
|
128
|
-
| `theme`
|
|
129
|
-
| `uploadFile`
|
|
130
|
-
| `initialContent`
|
|
131
|
-
| `editable`
|
|
132
|
-
| `sideMenu`
|
|
133
|
-
| `slashMenu`
|
|
134
|
-
| `formattingToolbar` | `boolean`
|
|
135
|
-
| `linkToolbar`
|
|
136
|
-
| `filePanel`
|
|
137
|
-
| `tableHandles`
|
|
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 |
|
|
138
141
|
|
|
139
142
|
### `IxoEditor` Component
|
|
140
143
|
|
|
@@ -151,13 +154,13 @@ The main editor component. Available in both UI versions with identical APIs.
|
|
|
151
154
|
|
|
152
155
|
#### Props
|
|
153
156
|
|
|
154
|
-
| Prop
|
|
155
|
-
|
|
156
|
-
| `editor`
|
|
157
|
-
| `className`
|
|
158
|
-
| `onChange`
|
|
159
|
-
| `onSelectionChange` | `() => void`
|
|
160
|
-
| `children`
|
|
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 |
|
|
161
164
|
|
|
162
165
|
## Advanced Usage
|
|
163
166
|
|
|
@@ -168,15 +171,15 @@ const editor = useCreateIxoEditor({
|
|
|
168
171
|
uploadFile: async (file: File) => {
|
|
169
172
|
const formData = new FormData();
|
|
170
173
|
formData.append('file', file);
|
|
171
|
-
|
|
174
|
+
|
|
172
175
|
const response = await fetch('/api/upload', {
|
|
173
176
|
method: 'POST',
|
|
174
177
|
body: formData,
|
|
175
178
|
});
|
|
176
|
-
|
|
179
|
+
|
|
177
180
|
const { url } = await response.json();
|
|
178
181
|
return url;
|
|
179
|
-
}
|
|
182
|
+
},
|
|
180
183
|
});
|
|
181
184
|
```
|
|
182
185
|
|
|
@@ -195,10 +198,10 @@ function CollaborativeEditor() {
|
|
|
195
198
|
name: 'John Doe',
|
|
196
199
|
color: '#FF5733',
|
|
197
200
|
accessToken: 'your-matrix-access-token',
|
|
198
|
-
address: 'your-user-address'
|
|
201
|
+
address: 'your-user-address',
|
|
199
202
|
},
|
|
200
203
|
matrixClient: matrixClient,
|
|
201
|
-
roomId: '!roomId:matrix.org'
|
|
204
|
+
roomId: '!roomId:matrix.org',
|
|
202
205
|
});
|
|
203
206
|
|
|
204
207
|
return (
|
|
@@ -214,7 +217,7 @@ function CollaborativeEditor() {
|
|
|
214
217
|
|
|
215
218
|
```tsx
|
|
216
219
|
const editor = useCreateIxoEditor({
|
|
217
|
-
theme: 'dark'
|
|
220
|
+
theme: 'dark',
|
|
218
221
|
});
|
|
219
222
|
```
|
|
220
223
|
|
|
@@ -225,7 +228,7 @@ const editor = useCreateIxoEditor({
|
|
|
225
228
|
editable: false,
|
|
226
229
|
sideMenu: false,
|
|
227
230
|
slashMenu: false,
|
|
228
|
-
formattingToolbar: false
|
|
231
|
+
formattingToolbar: false,
|
|
229
232
|
});
|
|
230
233
|
```
|
|
231
234
|
|
|
@@ -237,7 +240,7 @@ The IXO Editor includes custom blocks for working with IXO ecosystem data, avail
|
|
|
237
240
|
|
|
238
241
|
The List block displays dynamic data from DID and fragment identifiers, perfect for displaying data from your GraphQL API.
|
|
239
242
|
|
|
240
|
-
### Overview Block
|
|
243
|
+
### Overview Block
|
|
241
244
|
|
|
242
245
|
The Overview block provides a comprehensive view of entity data from DID identifiers.
|
|
243
246
|
|
|
@@ -246,12 +249,14 @@ The Overview block provides a comprehensive view of entity data from DID identif
|
|
|
246
249
|
Both blocks can be inserted using the slash menu:
|
|
247
250
|
|
|
248
251
|
**List Block:**
|
|
252
|
+
|
|
249
253
|
1. Type `/list` in the editor
|
|
250
254
|
2. Or type `/` and search for "List", "data", or "dynamic"
|
|
251
255
|
3. Configure the DID and fragment identifier in the settings
|
|
252
256
|
|
|
253
257
|
**Overview Block:**
|
|
254
|
-
|
|
258
|
+
|
|
259
|
+
1. Type `/overview` in the editor
|
|
255
260
|
2. Or type `/` and search for "Overview", "overview-block", or "data-overview"
|
|
256
261
|
3. Configure the DID in the settings
|
|
257
262
|
|
|
@@ -259,41 +264,55 @@ Both blocks can be inserted using the slash menu:
|
|
|
259
264
|
|
|
260
265
|
```tsx
|
|
261
266
|
// Insert a list block programmatically
|
|
262
|
-
editor.insertBlocks(
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
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
|
+
);
|
|
270
281
|
|
|
271
282
|
// Insert an overview block programmatically
|
|
272
|
-
editor.insertBlocks(
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
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
|
+
);
|
|
278
295
|
```
|
|
279
296
|
|
|
280
297
|
## UI Library Comparison
|
|
281
298
|
|
|
282
|
-
| Feature
|
|
283
|
-
|
|
284
|
-
| **Bundle Size**
|
|
285
|
-
| **Custom Blocks** | Full-featured
|
|
286
|
-
| **Theming**
|
|
287
|
-
| **Dependencies**
|
|
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 |
|
|
288
305
|
| **Customization** | High (CSS variables) | High (theme provider) |
|
|
289
306
|
|
|
290
307
|
### When to Choose Shadcn UI
|
|
308
|
+
|
|
291
309
|
- ✅ You're already using Tailwind CSS
|
|
292
|
-
- ✅ You prefer smaller bundle sizes
|
|
310
|
+
- ✅ You prefer smaller bundle sizes
|
|
293
311
|
- ✅ You want the full-featured custom blocks
|
|
294
312
|
- ✅ You like CSS variable-based theming
|
|
295
313
|
|
|
296
|
-
### When to Choose Mantine UI
|
|
314
|
+
### When to Choose Mantine UI
|
|
315
|
+
|
|
297
316
|
- ✅ You're already using Mantine in your app
|
|
298
317
|
- ✅ You prefer component-based theming
|
|
299
318
|
- ✅ You want consistent Mantine design language
|
|
@@ -306,7 +325,7 @@ editor.insertBlocks([{
|
|
|
306
325
|
```
|
|
307
326
|
ixo-editor/
|
|
308
327
|
├── src/
|
|
309
|
-
│ ├── core/ # Shared infrastructure
|
|
328
|
+
│ ├── core/ # Shared infrastructure
|
|
310
329
|
│ │ ├── types.ts # Shared types
|
|
311
330
|
│ │ ├── hooks/ # Matrix provider
|
|
312
331
|
│ │ └── lib/ # GraphQL client & utilities
|
|
@@ -316,7 +335,7 @@ ixo-editor/
|
|
|
316
335
|
│ │ ├── components/ # Shadcn UI components
|
|
317
336
|
│ │ ├── hooks/ # Editor hooks
|
|
318
337
|
│ │ └── index.ts # Shadcn exports
|
|
319
|
-
│ ├── mantine/ # Mantine UI implementation
|
|
338
|
+
│ ├── mantine/ # Mantine UI implementation
|
|
320
339
|
│ │ ├── IxoEditor.tsx
|
|
321
340
|
│ │ ├── blocks/ # Minimal custom blocks
|
|
322
341
|
│ │ ├── hooks/ # Editor hooks
|
|
@@ -359,10 +378,12 @@ pnpm run type-check
|
|
|
359
378
|
### Additional Requirements by UI Library
|
|
360
379
|
|
|
361
380
|
**For Mantine version:**
|
|
381
|
+
|
|
362
382
|
- `@mantine/core` ^8.0.0 (peer dependency)
|
|
363
383
|
- `@mantine/hooks` ^8.0.0 (peer dependency)
|
|
364
384
|
|
|
365
385
|
**For Shadcn version:**
|
|
386
|
+
|
|
366
387
|
- Works with existing Tailwind CSS setup
|
|
367
388
|
- No additional peer dependencies
|
|
368
389
|
|
|
@@ -371,6 +392,7 @@ pnpm run type-check
|
|
|
371
392
|
### From v1.x to v2.x (Multi-UI)
|
|
372
393
|
|
|
373
394
|
**Before (v1.x):**
|
|
395
|
+
|
|
374
396
|
```tsx
|
|
375
397
|
import { IxoEditor } from '@ixo/editor';
|
|
376
398
|
import '@blocknote/shadcn/style.css';
|
|
@@ -378,6 +400,7 @@ import '@ixo/editor/style.css';
|
|
|
378
400
|
```
|
|
379
401
|
|
|
380
402
|
**After (v2.x) - Recommended:**
|
|
403
|
+
|
|
381
404
|
```tsx
|
|
382
405
|
// Explicit shadcn version with complete CSS bundle
|
|
383
406
|
import { IxoEditor } from '@ixo/editor/shadcn';
|
|
@@ -385,6 +408,7 @@ import '@ixo/editor/style-shadcn.css'; // Single import!
|
|
|
385
408
|
```
|
|
386
409
|
|
|
387
410
|
**After (v2.x) - Backward compatible:**
|
|
411
|
+
|
|
388
412
|
```tsx
|
|
389
413
|
// Still works! (defaults to shadcn)
|
|
390
414
|
import { IxoEditor } from '@ixo/editor';
|
|
@@ -404,10 +428,11 @@ This package is maintained by the IXO development team. For questions or issues,
|
|
|
404
428
|
### Version Management
|
|
405
429
|
|
|
406
430
|
Follow semantic versioning:
|
|
431
|
+
|
|
407
432
|
- Patch releases (0.0.x): Bug fixes and minor updates
|
|
408
433
|
- Minor releases (0.x.0): New features that are backward compatible
|
|
409
434
|
- Major releases (x.0.0): Breaking changes (like the multi-UI restructure)
|
|
410
435
|
|
|
411
436
|
### Contributing
|
|
412
437
|
|
|
413
|
-
This is an internal package. All contributions should go through the standard IXO development workflow and review process.
|
|
438
|
+
This is an internal package. All contributions should go through the standard IXO development workflow and review process.
|