@domternal/angular 0.2.1 → 0.3.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
@@ -3,13 +3,16 @@
3
3
  [![Version](https://img.shields.io/npm/v/@domternal/angular.svg)](https://www.npmjs.com/package/@domternal/angular)
4
4
  [![MIT License](https://img.shields.io/badge/License-MIT-blue.svg)](https://github.com/domternal/domternal/blob/main/LICENSE)
5
5
 
6
- A lightweight, extensible rich text editor toolkit built on [ProseMirror](https://prosemirror.net/). Framework-agnostic headless core with first-class **Angular** support. Use it headless with vanilla JS/TS, add the built-in toolbar and theme, or drop in ready-made Angular components. Fully tree-shakeable, import only what you use, unused extensions are stripped from your bundle.
6
+ A lightweight, extensible rich text editor toolkit built on <u>[ProseMirror](https://prosemirror.net/)</u>. Framework-agnostic headless core with first-class Angular support.
7
+ Use it headless with vanilla JS/TS, add the built-in toolbar and theme, or drop in ready-made Angular components. Fully tree-shakeable, import only what you use, unused extensions are stripped from your bundle.
7
8
 
8
- **[Website](https://domternal.dev)** · **[Documentation](https://domternal.dev/v1/introduction)** · **[StackBlitz (Vanilla TS)](https://stackblitz.com/edit/domternal-vanilla-full-example)** · **[StackBlitz (Angular)](https://stackblitz.com/edit/domternal-angular-full-example)**
9
+ ## Links
10
+
11
+ <u>[Website](https://domternal.dev)</u> &nbsp;&nbsp;&nbsp;•&nbsp;&nbsp;&nbsp; <u>[Documentation](https://domternal.dev/v1/introduction)</u> &nbsp;&nbsp;&nbsp;•&nbsp;&nbsp;&nbsp; <u>[StackBlitz (Vanilla TS)](https://stackblitz.com/edit/domternal-vanilla-full-example)</u> &nbsp;&nbsp;&nbsp;•&nbsp;&nbsp;&nbsp; <u>[StackBlitz (Angular)](https://stackblitz.com/edit/domternal-angular-full-example)</u>
9
12
 
10
13
  ## Features
11
14
 
12
- See [Packages & Bundle Size](https://domternal.dev/v1/packages) for a full breakdown of all packages and what each one includes.
15
+ See <u>[Packages & Bundle Size](https://domternal.dev/v1/packages)</u> for a full breakdown of all packages and what each one includes.
13
16
 
14
17
  - **Headless core** - use with any framework or vanilla JS/TS
15
18
  - **Angular components** - editor, toolbar, bubble menu, floating menu, emoji picker (signals, OnPush, zoneless-ready)
@@ -17,20 +20,20 @@ See [Packages & Bundle Size](https://domternal.dev/v1/packages) for a full break
17
20
  - **140+ chainable commands** - `editor.chain().focus().toggleBold().run()`
18
21
  - **Full table support** - cell merging, column resize, row/column controls, cell toolbar, all free and MIT licensed
19
22
  - **Tree-shakeable** - import only what you use, your bundler strips the rest
20
- - **~38 KB gzipped** (own code), [~108 KB total](https://domternal.dev/v1/packages) with ProseMirror
23
+ - **~38 KB gzipped** (own code), <u>[~108 KB total](https://domternal.dev/v1/packages)</u> with ProseMirror
21
24
  - **TypeScript first** - 100% typed, zero `any`
22
- - **4,200+ tests** - 2,675 unit tests and 1,550 E2E tests across 34 Playwright specs
25
+ - **4,400+ tests** - 2,687 unit tests and 1,796 E2E tests across 37 Playwright specs
23
26
  - **Light and dark theme** - 70+ CSS custom properties for full visual control
24
27
  - **Inline styles export** - `getHTML({ styled: true })` produces inline CSS ready for email clients, CMS, and Google Docs
25
28
  - **SSR helpers** - `generateHTML`, `generateJSON`, `generateText` for server-side rendering
26
29
 
27
30
  ## Documentation
28
31
 
29
- - [Getting Started](https://domternal.dev/v1/getting-started) - install and create your first editor
30
- - [Introduction](https://domternal.dev/v1/introduction) - core concepts, architecture, and design decisions
31
- - [Packages & Bundle Size](https://domternal.dev/v1/packages) - what each package includes and bundle size breakdown
32
- - [Blog](https://domternal.dev/blog)
32
+ - <u>[Getting Started](https://domternal.dev/v1/getting-started)</u> - install and create your first editor
33
+ - <u>[Introduction](https://domternal.dev/v1/introduction)</u> - core concepts, architecture, and design decisions
34
+ - <u>[Packages & Bundle Size](https://domternal.dev/v1/packages)</u> - what each package includes and bundle size breakdown
35
+ - <u>[Blog](https://domternal.dev/blog)</u>
33
36
 
34
37
  ## License
35
38
 
36
- [MIT](https://github.com/domternal/domternal/blob/main/LICENSE)
39
+ <u>[MIT](https://github.com/domternal/domternal/blob/main/LICENSE)</u>
package/dist/README.md CHANGED
@@ -1,71 +1,39 @@
1
1
  # @domternal/angular
2
2
 
3
- Angular components for the Domternal editor: editor, toolbar, bubble menu, floating menu, and emoji picker. Standalone components with signals, OnPush change detection, reactive forms (`ControlValueAccessor`), and zoneless mode support.
3
+ [![Version](https://img.shields.io/npm/v/@domternal/angular.svg)](https://www.npmjs.com/package/@domternal/angular)
4
+ [![MIT License](https://img.shields.io/badge/License-MIT-blue.svg)](https://github.com/domternal/domternal/blob/main/LICENSE)
4
5
 
5
- Part of the [Domternal](https://github.com/domternal/domternal) toolkit. Full docs at [domternal.dev](https://domternal.dev).
6
+ A lightweight, extensible rich text editor toolkit built on <u>[ProseMirror](https://prosemirror.net/)</u>. Framework-agnostic headless core with first-class Angular support.
7
+ Use it headless with vanilla JS/TS, add the built-in toolbar and theme, or drop in ready-made Angular components. Fully tree-shakeable, import only what you use, unused extensions are stripped from your bundle.
6
8
 
7
- Requires Angular 17.1+.
9
+ ## Links
8
10
 
9
- ## Installation
11
+ <u>[Website](https://domternal.dev)</u> &nbsp;&nbsp;&nbsp;•&nbsp;&nbsp;&nbsp; <u>[Documentation](https://domternal.dev/v1/introduction)</u> &nbsp;&nbsp;&nbsp;•&nbsp;&nbsp;&nbsp; <u>[StackBlitz (Vanilla TS)](https://stackblitz.com/edit/domternal-vanilla-full-example)</u> &nbsp;&nbsp;&nbsp;•&nbsp;&nbsp;&nbsp; <u>[StackBlitz (Angular)](https://stackblitz.com/edit/domternal-angular-full-example)</u>
10
12
 
11
- ```bash
12
- npm install @domternal/core @domternal/theme @domternal/angular
13
- ```
13
+ ## Features
14
14
 
15
- ## Quick Start
15
+ See <u>[Packages & Bundle Size](https://domternal.dev/v1/packages)</u> for a full breakdown of all packages and what each one includes.
16
16
 
17
- ```ts
18
- import { Component, signal } from '@angular/core';
19
- import {
20
- DomternalEditorComponent,
21
- DomternalToolbarComponent,
22
- DomternalBubbleMenuComponent,
23
- } from '@domternal/angular';
24
- import { Editor, StarterKit, BubbleMenu } from '@domternal/core';
17
+ - **Headless core** - use with any framework or vanilla JS/TS
18
+ - **Angular components** - editor, toolbar, bubble menu, floating menu, emoji picker (signals, OnPush, zoneless-ready)
19
+ - **57 extensions across 10 packages** - 23 nodes, 9 marks, and 25 behavior extensions
20
+ - **140+ chainable commands** - `editor.chain().focus().toggleBold().run()`
21
+ - **Full table support** - cell merging, column resize, row/column controls, cell toolbar, all free and MIT licensed
22
+ - **Tree-shakeable** - import only what you use, your bundler strips the rest
23
+ - **~38 KB gzipped** (own code), <u>[~108 KB total](https://domternal.dev/v1/packages)</u> with ProseMirror
24
+ - **TypeScript first** - 100% typed, zero `any`
25
+ - **4,400+ tests** - 2,687 unit tests and 1,796 E2E tests across 37 Playwright specs
26
+ - **Light and dark theme** - 70+ CSS custom properties for full visual control
27
+ - **Inline styles export** - `getHTML({ styled: true })` produces inline CSS ready for email clients, CMS, and Google Docs
28
+ - **SSR helpers** - `generateHTML`, `generateJSON`, `generateText` for server-side rendering
25
29
 
26
- @Component({
27
- imports: [DomternalEditorComponent, DomternalToolbarComponent, DomternalBubbleMenuComponent],
28
- template: `
29
- @if (editor(); as ed) {
30
- <domternal-toolbar [editor]="ed" />
31
- }
32
- <domternal-editor
33
- [extensions]="extensions"
34
- [content]="content"
35
- (editorCreated)="editor.set($event)"
36
- />
37
- @if (editor(); as ed) {
38
- <domternal-bubble-menu [editor]="ed" />
39
- }
40
- `,
41
- })
42
- export class EditorComponent {
43
- editor = signal<Editor | null>(null);
44
- extensions = [StarterKit, BubbleMenu];
45
- content = '<p>Hello from Angular!</p>';
46
- }
47
- ```
30
+ ## Documentation
48
31
 
49
- ### Global Styles
50
-
51
- Add the theme to your global stylesheet to load editor and toolbar styles:
52
-
53
- ```scss
54
- @use '@domternal/theme';
55
- ```
56
-
57
- ### Available Components
58
-
59
- | Component | Description |
60
- |---|---|
61
- | `<domternal-editor>` | The core editor surface |
62
- | `<domternal-toolbar>` | Auto-renders toolbar buttons based on provided extensions |
63
- | `<domternal-bubble-menu>` | Contextual formatting menu on text selection |
64
- | `<domternal-floating-menu>` | Block-level insertion menu on empty lines |
65
- | `<domternal-emoji-picker>` | Emoji picker panel for the Emoji extension |
66
-
67
- The toolbar and bubble menu components auto-render buttons based on the extensions you provide. No manual button wiring needed.
32
+ - <u>[Getting Started](https://domternal.dev/v1/getting-started)</u> - install and create your first editor
33
+ - <u>[Introduction](https://domternal.dev/v1/introduction)</u> - core concepts, architecture, and design decisions
34
+ - <u>[Packages & Bundle Size](https://domternal.dev/v1/packages)</u> - what each package includes and bundle size breakdown
35
+ - <u>[Blog](https://domternal.dev/blog)</u>
68
36
 
69
37
  ## License
70
38
 
71
- [MIT](https://github.com/domternal/domternal/blob/main/LICENSE)
39
+ <u>[MIT](https://github.com/domternal/domternal/blob/main/LICENSE)</u>
@@ -314,7 +314,7 @@ class DomternalToolbarComponent {
314
314
  getTooltip(item) {
315
315
  if (item.shortcut) {
316
316
  const parts = item.shortcut.split('-');
317
- const mapped = parts.map(p => {
317
+ const mapped = parts.map((p) => {
318
318
  if (p === 'Mod')
319
319
  return isMac ? '\u2318' : 'Ctrl';
320
320
  if (p === 'Shift')
@@ -1124,6 +1124,7 @@ class DomternalBubbleMenuComponent {
1124
1124
  [class.dm-toolbar-button--active]="isItemActive(item)"
1125
1125
  [disabled]="isItemDisabled(item)"
1126
1126
  [title]="item.label"
1127
+ [attr.aria-label]="item.label"
1127
1128
  [innerHTML]="getCachedIcon(item.icon)"
1128
1129
  (mousedown)="$event.preventDefault()"
1129
1130
  (click)="executeCommand(item)"></button>
@@ -1145,6 +1146,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.5", ngImpor
1145
1146
  [class.dm-toolbar-button--active]="isItemActive(item)"
1146
1147
  [disabled]="isItemDisabled(item)"
1147
1148
  [title]="item.label"
1149
+ [attr.aria-label]="item.label"
1148
1150
  [innerHTML]="getCachedIcon(item.icon)"
1149
1151
  (mousedown)="$event.preventDefault()"
1150
1152
  (click)="executeCommand(item)"></button>
@@ -1432,6 +1434,7 @@ class DomternalEmojiPickerComponent {
1432
1434
  class="dm-emoji-picker-tab"
1433
1435
  [class.dm-emoji-picker-tab--active]="activeCategory() === cat"
1434
1436
  [title]="cat"
1437
+ [attr.aria-label]="cat"
1435
1438
  (mousedown)="$event.preventDefault()"
1436
1439
  (click)="scrollToCategory(cat)"
1437
1440
  >{{ categoryIcon(cat) }}</button>
@@ -1445,6 +1448,7 @@ class DomternalEmojiPickerComponent {
1445
1448
  type="button"
1446
1449
  class="dm-emoji-swatch"
1447
1450
  [title]="formatName(item.name)"
1451
+ [attr.aria-label]="formatName(item.name)"
1448
1452
  (mousedown)="$event.preventDefault()"
1449
1453
  (click)="selectEmoji(item)"
1450
1454
  >{{ item.emoji }}</button>
@@ -1460,6 +1464,7 @@ class DomternalEmojiPickerComponent {
1460
1464
  type="button"
1461
1465
  class="dm-emoji-swatch"
1462
1466
  [title]="formatName(item.name)"
1467
+ [attr.aria-label]="formatName(item.name)"
1463
1468
  (mousedown)="$event.preventDefault()"
1464
1469
  (click)="selectEmoji(item)"
1465
1470
  >{{ item.emoji }}</button>
@@ -1472,6 +1477,7 @@ class DomternalEmojiPickerComponent {
1472
1477
  type="button"
1473
1478
  class="dm-emoji-swatch"
1474
1479
  [title]="formatName(item.name)"
1480
+ [attr.aria-label]="formatName(item.name)"
1475
1481
  (mousedown)="$event.preventDefault()"
1476
1482
  (click)="selectEmoji(item)"
1477
1483
  >{{ item.emoji }}</button>
@@ -1511,6 +1517,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.5", ngImpor
1511
1517
  class="dm-emoji-picker-tab"
1512
1518
  [class.dm-emoji-picker-tab--active]="activeCategory() === cat"
1513
1519
  [title]="cat"
1520
+ [attr.aria-label]="cat"
1514
1521
  (mousedown)="$event.preventDefault()"
1515
1522
  (click)="scrollToCategory(cat)"
1516
1523
  >{{ categoryIcon(cat) }}</button>
@@ -1524,6 +1531,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.5", ngImpor
1524
1531
  type="button"
1525
1532
  class="dm-emoji-swatch"
1526
1533
  [title]="formatName(item.name)"
1534
+ [attr.aria-label]="formatName(item.name)"
1527
1535
  (mousedown)="$event.preventDefault()"
1528
1536
  (click)="selectEmoji(item)"
1529
1537
  >{{ item.emoji }}</button>
@@ -1539,6 +1547,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.5", ngImpor
1539
1547
  type="button"
1540
1548
  class="dm-emoji-swatch"
1541
1549
  [title]="formatName(item.name)"
1550
+ [attr.aria-label]="formatName(item.name)"
1542
1551
  (mousedown)="$event.preventDefault()"
1543
1552
  (click)="selectEmoji(item)"
1544
1553
  >{{ item.emoji }}</button>
@@ -1551,6 +1560,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.5", ngImpor
1551
1560
  type="button"
1552
1561
  class="dm-emoji-swatch"
1553
1562
  [title]="formatName(item.name)"
1563
+ [attr.aria-label]="formatName(item.name)"
1554
1564
  (mousedown)="$event.preventDefault()"
1555
1565
  (click)="selectEmoji(item)"
1556
1566
  >{{ item.emoji }}</button>