@pubwave/editor 0.5.7 → 0.5.8

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
@@ -15,6 +15,7 @@ A Notion-level block editor built with React and Tiptap.
15
15
  - 📦 **Lightweight** - Only ships what you need (React + Tiptap peer dependencies)
16
16
  - ⌨️ **Slash Commands** - Type `/` to quickly insert blocks and formatting
17
17
  - 🎨 **Text & Background Colors** - Rich color picker with recently used colors
18
+ - 🏷️ **Inline Tags** - Inline tag marks with custom colors, variants, and spacing
18
19
  - 🔄 **Turn Into** - Convert blocks between different types (paragraph, headings, lists, etc.)
19
20
  - 📋 **Rich Formatting** - Bold, italic, underline, strikethrough, code, links, and text alignment
20
21
  - 📝 **Multiple Block Types** - Paragraphs, headings, lists, quotes, code blocks, tables, charts, and more
@@ -135,6 +136,7 @@ For complete TypeScript type definitions, see the exported types from `@pubwave/
135
136
 
136
137
  - `EditorTheme` - Theme configuration
137
138
  - `EditorAPI` - Editor API interface
139
+ - `TagProps` - Standalone tag component props
138
140
  - `EditorLocale` - Supported locale codes: `'en' | 'zh' | 'zh-CN' | 'ja' | 'ko' | 'fr' | 'de' | 'es' | 'pt'`
139
141
  - `ImageUploadConfig` - Image upload configuration
140
142
 
@@ -414,6 +416,69 @@ The editor also uses CSS custom properties for styling. Define these in your CSS
414
416
  }
415
417
  ```
416
418
 
419
+ ### Inline Tags
420
+
421
+ Pubwave Editor supports inline `tag` marks in content JSON.
422
+
423
+ Supported attributes:
424
+
425
+ - `variant`: `'soft' | 'outline' | 'solid'`
426
+ - `tone`: `'primary' | 'neutral'`
427
+ - `size`: `'sm' | 'md'`
428
+ - `backgroundColor`: custom background color
429
+ - `textColor`: custom text color
430
+ - `borderColor`: custom border color
431
+ - `spacing`: trailing spacing such as `'8px'` or `'0.5rem'`
432
+
433
+ Example content:
434
+
435
+ ```ts
436
+ const content = {
437
+ type: 'doc',
438
+ content: [
439
+ {
440
+ type: 'paragraph',
441
+ content: [
442
+ {
443
+ type: 'text',
444
+ text: 'Live Preview',
445
+ marks: [
446
+ {
447
+ type: 'tag',
448
+ attrs: {
449
+ variant: 'outline',
450
+ backgroundColor: 'rgba(20, 10, 31, 0.38)',
451
+ textColor: '#f5f3ff',
452
+ borderColor: '#5b21b6',
453
+ spacing: '0.75rem',
454
+ },
455
+ },
456
+ ],
457
+ },
458
+ ],
459
+ },
460
+ ],
461
+ };
462
+ ```
463
+
464
+ You can also use the standalone `Tag` component outside the editor:
465
+
466
+ ```tsx
467
+ import { Tag } from '@pubwave/editor';
468
+
469
+ <Tag
470
+ variant="outline"
471
+ colors={{
472
+ background: 'rgba(20, 10, 31, 0.38)',
473
+ text: '#f5f3ff',
474
+ border: '#5b21b6',
475
+ }}
476
+ spacing="0.75rem"
477
+ >
478
+ Live Preview
479
+ </Tag>;
480
+ ```
481
+
417
482
  ---
418
483
 
419
484
  ## 🎯 Core Features