@flogeez/angular-tiptap-editor 0.4.0 → 0.5.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/CHANGELOG.md +24 -0
- package/README.md +108 -17
- package/fesm2022/flogeez-angular-tiptap-editor.mjs +346 -878
- package/fesm2022/flogeez-angular-tiptap-editor.mjs.map +1 -1
- package/index.d.ts +69 -24
- package/package.json +3 -1
- package/src/lib/styles/bubble-menu.global.css +11 -10
- package/src/lib/styles/index.css +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,30 @@ All notable changes to `@flogeez/angular-tiptap-editor` will be documented in th
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [0.5.1] - 2026-01-07
|
|
9
|
+
|
|
10
|
+
### Fixed
|
|
11
|
+
- **Library Dependencies**: Added missing `@tiptap/extension-color` and `@tiptap/extension-text-style` to peerDependencies.
|
|
12
|
+
|
|
13
|
+
## [0.5.0] - 2026-01-07
|
|
14
|
+
|
|
15
|
+
### Added
|
|
16
|
+
- **Full Theming System**: Introduced a complete set of CSS variables (`--ate-*`) for deep editor customization.
|
|
17
|
+
- **Dark Mode Support**: Native support for dark mode via `.dark` class or `[data-theme="dark"]` attribute on the editor component.
|
|
18
|
+
- **Theme Customizer**: New interactive panel in the demo application to customize and export CSS themes in real-time.
|
|
19
|
+
- **Improved Slash Menu**: Refactored slash menu with better UI, keyboard navigation, and easier command filtering.
|
|
20
|
+
|
|
21
|
+
### Breaking Changes
|
|
22
|
+
- **Slash Commands API**: The `slashCommands` input now takes a `SlashCommandsConfig` object (a set of boolean flags) to toggle default commands, instead of a list of command items.
|
|
23
|
+
- **Custom Slash Commands**: To provide your own commands, you must now use the new `customSlashCommands` input.
|
|
24
|
+
- **CSS Variables**: The editor now relies heavily on CSS variables. If you had deep CSS overrides, you might need to update them to use the new `--ate-*` tokens.
|
|
25
|
+
|
|
26
|
+
### Fixed
|
|
27
|
+
- **Text Color Picker**: Improved initial color detection using computed styles and refined UI behavior to accurately reflect text color even when using theme defaults.
|
|
28
|
+
|
|
29
|
+
### Changed
|
|
30
|
+
- Renamed several internal components and services for better consistency.
|
|
31
|
+
|
|
8
32
|
## [0.4.0] - 2026-01-07
|
|
9
33
|
|
|
10
34
|
### Added
|
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
A modern, customizable rich-text editor for Angular applications, built with Tiptap and featuring complete internationalization support.
|
|
4
4
|
|
|
5
|
-
[](https://stackblitz.com/edit/angular-tiptap-editor)
|
|
5
|
+
[](https://flogeez.github.io/angular-tiptap-editor/) [](https://stackblitz.com/edit/angular-tiptap-editor)
|
|
6
6
|
|
|
7
7
|
## 🚀 Features
|
|
8
8
|
|
|
@@ -112,8 +112,11 @@ export class AdvancedComponent {
|
|
|
112
112
|
table: true, // Enable table bubble menu
|
|
113
113
|
};
|
|
114
114
|
|
|
115
|
-
|
|
116
|
-
|
|
115
|
+
// No config needed if you want all commands enabled
|
|
116
|
+
slashCommands = {
|
|
117
|
+
image: true,
|
|
118
|
+
table: true,
|
|
119
|
+
heading1: true
|
|
117
120
|
};
|
|
118
121
|
|
|
119
122
|
onContentChange(newContent: string) {
|
|
@@ -427,13 +430,16 @@ const bubbleMenuWithTable = {
|
|
|
427
430
|
table: true, // Enable table bubble menu
|
|
428
431
|
};
|
|
429
432
|
|
|
430
|
-
// Slash commands configuration
|
|
433
|
+
// Slash commands configuration (simple toggle)
|
|
434
|
+
// By default, all commands are enabled and localized.
|
|
431
435
|
const slashCommands = {
|
|
432
|
-
|
|
436
|
+
heading1: true,
|
|
437
|
+
heading2: true,
|
|
438
|
+
image: false, // Disable image command
|
|
433
439
|
};
|
|
434
440
|
|
|
435
|
-
// Available
|
|
436
|
-
|
|
441
|
+
// Available keys: "heading1", "heading2", "heading3", "bulletList",
|
|
442
|
+
// "orderedList", "blockquote", "code", "image", "horizontalRule", "table"
|
|
437
443
|
```
|
|
438
444
|
|
|
439
445
|
## 🌍 Internationalization
|
|
@@ -464,22 +470,106 @@ The editor supports English and French with automatic browser language detection
|
|
|
464
470
|
|
|
465
471
|
### Custom Slash Commands
|
|
466
472
|
|
|
473
|
+
For advanced usage, you can provide entirely custom command items (titles, icons, logic):
|
|
474
|
+
|
|
467
475
|
```typescript
|
|
468
|
-
import {
|
|
469
|
-
|
|
470
|
-
|
|
476
|
+
import {
|
|
477
|
+
CustomSlashCommands,
|
|
478
|
+
SlashCommandItem
|
|
471
479
|
} from "@flogeez/angular-tiptap-editor";
|
|
472
480
|
|
|
473
|
-
//
|
|
474
|
-
const
|
|
475
|
-
|
|
481
|
+
// Define your custom items
|
|
482
|
+
const myCommands: SlashCommandItem[] = [
|
|
483
|
+
{
|
|
484
|
+
title: 'My Action',
|
|
485
|
+
description: 'Do something cool',
|
|
486
|
+
icon: 'star',
|
|
487
|
+
keywords: ['custom', 'cool'],
|
|
488
|
+
command: (editor) => { /* logic */ }
|
|
489
|
+
}
|
|
490
|
+
];
|
|
476
491
|
|
|
477
|
-
// Use in
|
|
478
|
-
|
|
479
|
-
commands:
|
|
492
|
+
// Use in template
|
|
493
|
+
customSlashCommands = {
|
|
494
|
+
commands: myCommands,
|
|
480
495
|
};
|
|
481
496
|
```
|
|
482
497
|
|
|
498
|
+
And in template:
|
|
499
|
+
```html
|
|
500
|
+
<angular-tiptap-editor [customSlashCommands]="customSlashCommands" />
|
|
501
|
+
```
|
|
502
|
+
|
|
503
|
+
### 🎨 CSS Custom Properties
|
|
504
|
+
|
|
505
|
+
Customize the editor appearance using CSS variables with the `--ate-` prefix:
|
|
506
|
+
|
|
507
|
+
```css
|
|
508
|
+
/* In your global styles or component styles */
|
|
509
|
+
angular-tiptap-editor {
|
|
510
|
+
--ate-primary: #2563eb;
|
|
511
|
+
--ate-primary-contrast: #ffffff;
|
|
512
|
+
--ate-primary-light: color-mix(in srgb, var(--ate-primary), transparent 90%);
|
|
513
|
+
--ate-primary-lighter: color-mix(in srgb, var(--ate-primary), transparent 95%);
|
|
514
|
+
--ate-primary-light-alpha: color-mix(in srgb, var(--ate-primary), transparent 85%);
|
|
515
|
+
|
|
516
|
+
--ate-surface: #ffffff;
|
|
517
|
+
--ate-surface-secondary: #f8f9fa;
|
|
518
|
+
--ate-surface-tertiary: #f1f5f9;
|
|
519
|
+
|
|
520
|
+
--ate-text: #2d3748;
|
|
521
|
+
--ate-text-secondary: #64748b;
|
|
522
|
+
--ate-text-muted: #a0aec0;
|
|
523
|
+
|
|
524
|
+
--ate-border: #e2e8f0;
|
|
525
|
+
|
|
526
|
+
/* And More... */
|
|
527
|
+
}
|
|
528
|
+
```
|
|
529
|
+
|
|
530
|
+
#### Dark Mode Support
|
|
531
|
+
|
|
532
|
+
The editor supports dark mode in two ways:
|
|
533
|
+
|
|
534
|
+
**1. With CSS Class**
|
|
535
|
+
|
|
536
|
+
```html
|
|
537
|
+
<angular-tiptap-editor [class.dark]="isDarkMode" />
|
|
538
|
+
```
|
|
539
|
+
|
|
540
|
+
**2. With Data Attribute**
|
|
541
|
+
|
|
542
|
+
```html
|
|
543
|
+
<angular-tiptap-editor [attr.data-theme]="isDarkMode ? 'dark' : null" />
|
|
544
|
+
```
|
|
545
|
+
|
|
546
|
+
#### Example: Custom Dark Theme
|
|
547
|
+
|
|
548
|
+
```css
|
|
549
|
+
angular-tiptap-editor.dark {
|
|
550
|
+
--ate-background: #1a1a2e;
|
|
551
|
+
--ate-border-color: #3d3d5c;
|
|
552
|
+
--ate-focus-color: #6366f1;
|
|
553
|
+
--ate-text-color: #e2e8f0;
|
|
554
|
+
--ate-placeholder-color: #64748b;
|
|
555
|
+
--ate-counter-background: #2d2d44;
|
|
556
|
+
--ate-counter-color: #94a3b8;
|
|
557
|
+
--ate-blockquote-background: #2d2d44;
|
|
558
|
+
--ate-code-background: #2d2d44;
|
|
559
|
+
}
|
|
560
|
+
```
|
|
561
|
+
|
|
562
|
+
#### Example: Custom Brand Colors
|
|
563
|
+
|
|
564
|
+
```css
|
|
565
|
+
angular-tiptap-editor {
|
|
566
|
+
--ate-focus-color: #8b5cf6;
|
|
567
|
+
--ate-image-selected-color: #8b5cf6;
|
|
568
|
+
--ate-border-radius: 12px;
|
|
569
|
+
}
|
|
570
|
+
```
|
|
571
|
+
|
|
572
|
+
|
|
483
573
|
## 🏗️ Architecture
|
|
484
574
|
|
|
485
575
|
### Service-Based Design
|
|
@@ -536,6 +626,7 @@ This runs the library in watch mode and starts the demo application.
|
|
|
536
626
|
- `npm run watch:lib` - Watch library changes
|
|
537
627
|
- `npm run dev` - Development mode (watch + serve)
|
|
538
628
|
|
|
629
|
+
|
|
539
630
|
## 📝 License
|
|
540
631
|
|
|
541
632
|
MIT License - see [LICENSE](LICENSE) file for details.
|
|
@@ -546,10 +637,10 @@ Contributions are welcome! Please feel free to submit a Pull Request.
|
|
|
546
637
|
|
|
547
638
|
## 🔗 Links
|
|
548
639
|
|
|
549
|
-
- 🎮 [Live Demo](https://flogeez.github.io/angular-tiptap-editor/)
|
|
550
640
|
- 📖 [Tiptap Documentation](https://tiptap.dev/)
|
|
551
641
|
- 🅰️ [Angular Documentation](https://angular.dev/)
|
|
552
642
|
- 📦 [NPM Package](https://www.npmjs.com/package/@flogeez/angular-tiptap-editor)
|
|
643
|
+
- 📖 [Live Demo](https://flogeez.github.io/angular-tiptap-editor/)
|
|
553
644
|
- 🐛 [Report Issues](https://github.com/FloGeez/angular-tiptap-editor/issues)
|
|
554
645
|
- 💡 [Feature Requests](https://github.com/FloGeez/angular-tiptap-editor/issues)
|
|
555
646
|
|