@flogeez/angular-tiptap-editor 3.5.5 → 3.6.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.
Files changed (35) hide show
  1. package/CHANGELOG.md +27 -1
  2. package/README.md +2 -2
  3. package/esm2022/lib/components/editor/angular-tiptap-editor.component.mjs +93 -21
  4. package/esm2022/lib/config/ate-editor.config.mjs +3 -1
  5. package/esm2022/lib/config/ate-slash-commands.config.mjs +2 -1
  6. package/esm2022/lib/directives/ate-tooltip.directive.mjs +37 -2
  7. package/esm2022/lib/extensions/ate-block-shortcuts.extension.mjs +100 -0
  8. package/esm2022/lib/extensions/ate-pasted-image.extension.mjs +7 -3
  9. package/esm2022/lib/i18n/ateTranslationsModel.mjs +1 -1
  10. package/esm2022/lib/i18n/es_ateTranslations.mjs +230 -0
  11. package/esm2022/lib/i18n/pt_ateTranslations.mjs +220 -0
  12. package/esm2022/lib/models/ate-editor-config.model.mjs +1 -1
  13. package/esm2022/lib/models/ate-editor-ref.mjs +3 -3
  14. package/esm2022/lib/models/ate-image.model.mjs +12 -2
  15. package/esm2022/lib/services/ate-editor-commands.service.mjs +6 -3
  16. package/esm2022/lib/services/ate-i18n.service.mjs +19 -9
  17. package/esm2022/lib/services/ate-image.service.mjs +18 -11
  18. package/esm2022/lib/utils/ate-extensions.utils.mjs +79 -0
  19. package/esm2022/public-api.mjs +2 -1
  20. package/fesm2022/flogeez-angular-tiptap-editor.mjs +814 -47
  21. package/fesm2022/flogeez-angular-tiptap-editor.mjs.map +1 -1
  22. package/lib/components/editor/angular-tiptap-editor.component.d.ts +12 -2
  23. package/lib/config/ate-slash-commands.config.d.ts +2 -0
  24. package/lib/extensions/ate-block-shortcuts.extension.d.ts +32 -0
  25. package/lib/i18n/ateTranslationsModel.d.ts +1 -1
  26. package/lib/i18n/es_ateTranslations.d.ts +2 -0
  27. package/lib/i18n/pt_ateTranslations.d.ts +2 -0
  28. package/lib/models/ate-editor-config.model.d.ts +8 -0
  29. package/lib/models/ate-image.model.d.ts +30 -2
  30. package/lib/services/ate-editor-commands.service.d.ts +2 -1
  31. package/lib/services/ate-i18n.service.d.ts +3 -1
  32. package/lib/services/ate-image.service.d.ts +5 -3
  33. package/lib/utils/ate-extensions.utils.d.ts +13 -0
  34. package/package.json +1 -1
  35. package/public-api.d.ts +1 -0
package/CHANGELOG.md CHANGED
@@ -5,11 +5,37 @@ 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), with the exception that the major version is specifically aligned with the major version of [Tiptap](https://tiptap.dev).
7
7
 
8
+ ## [3.6.1] - 2026-10-26
9
+
10
+ ### Changed
11
+
12
+ - **Tooltips Stay Warm Across Controls**: Once a tooltip is open, moving the pointer to another control shows its tooltip at once, without the show delay or fade-in, and the previous one disappears immediately so only one tooltip is visible at a time. The warm state lasts 300 ms after the last tooltip closes, so a short gap between two buttons keeps it. The first tooltip still waits for its `ateTooltipDelay`; keyboard and touch behavior are unchanged.
13
+
14
+ ## [3.6.0] - 2026-10-26
15
+
16
+ ### Added
17
+
18
+ - **`starterKitOptions` Input**: New input (also available as `starterKitOptions` in `AteEditorConfig`) typed `Partial<StarterKitOptions>`, forwarded to `StarterKit.configure()` and merged over the library defaults (the default `link` options are kept). It lets apps disable or tune bundled extensions, e.g. `{ undoRedo: false }` to use `@tiptap/extension-collaboration` (Yjs) without the local history conflicting with Yjs' undo manager. Changing it at runtime re-creates the editor. (#61)
19
+ - **`imageRejected` Output**: Emits an `AteImageRejection` (`{ reason: 'invalid-type' | 'too-large' | 'upload-failed', file, source: 'paste' | 'drop' | 'picker' | 'api' }`) when an image file is not inserted, so apps can tell the user why. Covers clipboard files, drag-and-drop, the toolbar, slash-menu and bubble-menu pickers, and `uploadImage`. (#64)
20
+ - **`AteImageValidationError`**: Typed error (`reason: 'invalid-type' | 'too-large'`, translated `message`) thrown by the upload pipeline when `allowedTypes` or `maxSize` validation fails. (#64)
21
+ - **Brazilian Portuguese and Spanish Translations**: Built-in `pt` (Brazilian wording) and `es` locales covering every `AteTranslations` key, including slash command titles, descriptions and search keywords (English keywords are kept, so typing English still finds the command). (#68)
22
+ - **Block Keyboard Shortcuts**: `Mod+D` duplicates the current block right after it, and `Mod+Shift+ArrowUp` / `Mod+Shift+ArrowDown` move it up or down by one sibling, keeping the selection inside the moved block. Inside a list the block is the list or task item and it moves within its list. At the edges and in read-only editors the key event is not consumed. Enabled by default and controlled by the new `enableBlockShortcuts` input / config option. (#66)
23
+
24
+ ### Changed
25
+
26
+ - **Browser Language Detection**: Detection now matches any built-in or registered locale from `navigator.language`, so `pt-BR`, `es-MX` and `de-DE` pick `pt`, `es` and `de` automatically (previously only `fr` was auto-detected and all other browsers fell back to `en`). A regional tag such as `pt-BR` passed to `locale` or `setLocale()` resolves to its language translations. (#68)
27
+ - **Custom Extensions in `tiptapExtensions` Override Built-ins**: An extension passed in `tiptapExtensions` whose `name` matches a built-in ATE extension (`highlight`, `textStyle`, `textAlign`, `placeholder`, `resizableImage`, ...) or a `StarterKit` extension (`link`, `codeBlock`, `heading`, ...) now replaces the built-in extension instead of being silently dropped or duplicating the `StarterKit` extension. If the same `StarterKit` extension is also configured in `starterKitOptions`, the custom extension in `tiptapExtensions` takes precedence. In Angular development mode (`isDevMode()`), a one-time `[ATE]` `console.warn` per editor instance lists the replaced extensions, the ATE UI features and state calculators that depend on them, and any ignored `starterKitOptions` keys. (#70)
28
+
29
+ ### Fixed
30
+
31
+ - **Silent Image Validation Failures**: A file rejected for its type or size used to disappear with only a `console.error`, and file paste and drop turned the failure into an unhandled promise rejection. Failures are now reported through `imageRejected`, and paste, drop and the fire-and-forget commands (`execute('insertImage' | 'uploadImage')`, `AteEditorRef.insertImage` / `uploadImage`) no longer leak unhandled rejections. Awaited `uploadImage()` calls still reject. (#64)
32
+ - **`pastedImageRejected` Reasons**: A base64 image in pasted HTML rejected by validation now reports `invalid-type` or `too-large` instead of `upload-failed`, which stays reserved for upload handler failures. (#64)
33
+
8
34
  ## [3.5.5] - 2026-10-26
9
35
 
10
36
  ### Fixed
11
37
 
12
- - **Color Picker Anchor in Seamless Mode**: The text color and highlight pickers opened from the bubble menu are now anchored to the selected text even when `seamless` is enabled. The lookup for a colored element used `closest()` with a `style*="background"` selector, which walked out of the editor content and matched the editor host itself (its inline style carries the seamless CSS variables), or any styled ancestor in the host app, so the picker was positioned relative to the whole editor. The search is now limited to the elements inside the editor content. (#72)
38
+ - **Color Picker Anchor in Seamless Mode**: The text color and highlight pickers opened from the bubble menu are now anchored to the selected text even when `seamless` is enabled. The colored-element lookup is now bounded to the elements inside the editor content. (#72)
13
39
  - **Editor Re-created on Unrelated `config` Changes**: Any change to the `[config]` input (for example switching `theme` between `dark` and `light`) destroyed and re-created the Tiptap editor, losing the caret, selection, undo history and node views. The effective extensions, Tiptap options and Angular nodes are now compared by value, so a new array or object with the same content no longer re-initializes the editor. Changing the actual extension list, Tiptap options, Angular nodes or `blockControls` still does. (#62)
14
40
 
15
41
  ## [3.5.4] - 2026-10-21
package/README.md CHANGED
@@ -32,7 +32,7 @@ Yet, I've worked to keep it fully customizable: you can easily configure the edi
32
32
  - ⌨️ **UX First**: Slash commands (`/`) and context-aware bubble menus (Notion-like).
33
33
  - 📊 **Table Power**: Advanced management with cell selection and merging.
34
34
  - 🖼️ **Pro Media**: Image resizing, auto-compression, and custom uploaders.
35
- - 🌍 **Built-in i18n**: Support for English, French, and German out of the box.
35
+ - 🌍 **Built-in i18n**: Support for English, French, German, Brazilian Portuguese, and Spanish out of the box.
36
36
  - 📎 **Office-Ready**: Clean pasting from Word and Excel.
37
37
  - 🎨 **Highly Customizable**: Easily configure toolbars, bubble menus, and slash command items.
38
38
  - 🛠️ **Extensible**: Easily add custom Tiptap extensions and reactive state calculators.
@@ -180,7 +180,7 @@ Looking for deeper integration patterns? Explore our **[Advanced Usage Guide](./
180
180
 
181
181
  ## 🌍 i18n & 🎨 Styling
182
182
 
183
- - **Languages**: English, French, and German built-in. Detects browser language automatically. Extend with `AteI18nService.addTranslations()`.
183
+ - **Languages**: English (`en`), French (`fr`), German (`de`), Portuguese (`pt`, Brazilian wording) and Spanish (`es`) built-in. Detects browser language automatically (regional tags like `pt-BR` or `es-MX` resolve to their language). Extend with `AteI18nService.addTranslations()`.
184
184
  - **Styling**: Customize via CSS variables (e.g., `--ate-primary`, `--ate-border-radius`, and much more).
185
185
  - **Dark Mode**: Works natively by adding `.dark` or `[data-theme="dark"]`.
186
186