@flogeez/angular-tiptap-editor 2.4.0 → 3.0.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/CHANGELOG.md +16 -0
- package/README.md +3 -0
- package/fesm2022/flogeez-angular-tiptap-editor.mjs +183 -142
- package/fesm2022/flogeez-angular-tiptap-editor.mjs.map +1 -1
- package/index.d.ts +87 -158
- package/package.json +13 -21
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,22 @@ 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.0.0] - 2026-02-05
|
|
9
|
+
|
|
10
|
+
### Changed
|
|
11
|
+
|
|
12
|
+
- **Upgrade to Tiptap v3**: Full migration from Tiptap v2 to v3, aligning with the latest stable ecosystem.
|
|
13
|
+
- **Consolidated Dependencies**: Transitioned to the unified `@tiptap/extensions` package instead of individual packages, simplifying dependency management and improving performance.
|
|
14
|
+
- **Refined Configuration Hierarchy**: Implemented a more intuitive configuration cascade: **Component Inputs > [config] Object > Global Configuration > Defaults**. Direct inputs now have absolute priority for better DX.
|
|
15
|
+
- **Flexible Height Types**: `height`, `minHeight`, and `maxHeight` inputs now accept both `number` (pixels) and `string` (CSS values like '80vh') interchangeably.
|
|
16
|
+
|
|
17
|
+
### Breaking Changes
|
|
18
|
+
|
|
19
|
+
- **Peer Dependencies**: The library now requires `@tiptap/core`, `@tiptap/pm`, and associated extensions to be at version `^3.0.0`.
|
|
20
|
+
- **Input Defaults**: All optional component inputs (except `content`) now default to `undefined` to allow proper inheritance from global or instance-level configurations.
|
|
21
|
+
- **Removal of Deprecated Aliases**: Definitive removal of legacy exported names (without the `Ate` prefix) that were deprecated in v2.2.0.
|
|
22
|
+
- **Office Paste**: Updated `@intevation/tiptap-extension-office-paste` to `^0.1.2` for Tiptap v3 compatibility.
|
|
23
|
+
|
|
8
24
|
## [2.4.0] - 2026-01-29
|
|
9
25
|
|
|
10
26
|
### Added
|
package/README.md
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
# Angular Tiptap Editor
|
|
2
2
|
|
|
3
|
+
> [!IMPORTANT]
|
|
4
|
+
> **New Version Available**: v3.0.0 uses Tiptap v3. If you need to stay on Tiptap v2, please use version `^2.4.0`.
|
|
5
|
+
|
|
3
6
|
A modern, customizable rich-text editor for Angular, built with Tiptap.
|
|
4
7
|
|
|
5
8
|
[](https://www.npmjs.com/package/@flogeez/angular-tiptap-editor) [](https://flogeez.github.io/angular-tiptap-editor/) [](https://stackblitz.com/edit/angular-tiptap-editor)
|
|
@@ -3,23 +3,19 @@ import { input, output, ChangeDetectionStrategy, Component, signal, computed, In
|
|
|
3
3
|
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
4
4
|
import { Node as Node$1, nodeInputRule, mergeAttributes, Extension, getAttributes, Editor } from '@tiptap/core';
|
|
5
5
|
import StarterKit from '@tiptap/starter-kit';
|
|
6
|
-
import Placeholder from '@tiptap/
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import Color from '@tiptap/extension-color';
|
|
6
|
+
import { Placeholder, CharacterCount } from '@tiptap/extensions';
|
|
7
|
+
import { Underline } from '@tiptap/extension-underline';
|
|
8
|
+
import { Superscript } from '@tiptap/extension-superscript';
|
|
9
|
+
import { Subscript } from '@tiptap/extension-subscript';
|
|
10
|
+
import { TextAlign } from '@tiptap/extension-text-align';
|
|
11
|
+
import { Link } from '@tiptap/extension-link';
|
|
12
|
+
import { Highlight } from '@tiptap/extension-highlight';
|
|
13
|
+
import { TextStyle } from '@tiptap/extension-text-style';
|
|
14
|
+
import { Color } from '@tiptap/extension-color';
|
|
16
15
|
import OfficePaste from '@intevation/tiptap-extension-office-paste';
|
|
17
16
|
import { Plugin, PluginKey, TextSelection, NodeSelection } from '@tiptap/pm/state';
|
|
18
17
|
import { DecorationSet, Decoration } from '@tiptap/pm/view';
|
|
19
|
-
import Table from '@tiptap/extension-table';
|
|
20
|
-
import TableRow from '@tiptap/extension-table-row';
|
|
21
|
-
import TableCell from '@tiptap/extension-table-cell';
|
|
22
|
-
import TableHeader from '@tiptap/extension-table-header';
|
|
18
|
+
import { Table, TableRow, TableHeader, TableCell } from '@tiptap/extension-table';
|
|
23
19
|
import { isObservable, firstValueFrom, Subscription, concat, defer, of, tap } from 'rxjs';
|
|
24
20
|
import { CommonModule } from '@angular/common';
|
|
25
21
|
import tippy, { sticky } from 'tippy.js';
|
|
@@ -1679,7 +1675,8 @@ class AteColorPickerService {
|
|
|
1679
1675
|
let trigger;
|
|
1680
1676
|
if (event && typeof event !== "string") {
|
|
1681
1677
|
const target = event.target;
|
|
1682
|
-
trigger =
|
|
1678
|
+
trigger =
|
|
1679
|
+
event.currentTarget || target?.closest("button") || target;
|
|
1683
1680
|
}
|
|
1684
1681
|
this.open(mode, trigger);
|
|
1685
1682
|
}
|
|
@@ -1883,7 +1880,9 @@ class AteLinkService {
|
|
|
1883
1880
|
if (urlOrEvent && typeof urlOrEvent !== "string") {
|
|
1884
1881
|
const target = urlOrEvent.target;
|
|
1885
1882
|
trigger =
|
|
1886
|
-
urlOrEvent.currentTarget ||
|
|
1883
|
+
urlOrEvent.currentTarget ||
|
|
1884
|
+
target?.closest("button") ||
|
|
1885
|
+
target;
|
|
1887
1886
|
}
|
|
1888
1887
|
// Open the edit menu
|
|
1889
1888
|
this.open(trigger);
|
|
@@ -2375,7 +2374,7 @@ class AteEditorCommandsService {
|
|
|
2375
2374
|
if (!editor) {
|
|
2376
2375
|
return;
|
|
2377
2376
|
}
|
|
2378
|
-
editor.commands.setContent(content, emitUpdate);
|
|
2377
|
+
editor.commands.setContent(content, { emitUpdate });
|
|
2379
2378
|
}
|
|
2380
2379
|
setEditable(editor, editable) {
|
|
2381
2380
|
if (!editor) {
|
|
@@ -3138,7 +3137,7 @@ class AteBaseBubbleMenu {
|
|
|
3138
3137
|
content: this.menuRef().nativeElement,
|
|
3139
3138
|
trigger: "manual",
|
|
3140
3139
|
placement: "top-start",
|
|
3141
|
-
appendTo: () =>
|
|
3140
|
+
appendTo: () => ed?.options?.element || document.body,
|
|
3142
3141
|
interactive: true,
|
|
3143
3142
|
hideOnClick: false,
|
|
3144
3143
|
arrow: false,
|
|
@@ -3151,7 +3150,7 @@ class AteBaseBubbleMenu {
|
|
|
3151
3150
|
{
|
|
3152
3151
|
name: "preventOverflow",
|
|
3153
3152
|
options: {
|
|
3154
|
-
boundary: this.editor().options.element,
|
|
3153
|
+
boundary: this.editor().options.element || document.body,
|
|
3155
3154
|
padding: 8,
|
|
3156
3155
|
},
|
|
3157
3156
|
},
|
|
@@ -3808,7 +3807,9 @@ class AteTableBubbleMenuComponent extends AteBaseBubbleMenu {
|
|
|
3808
3807
|
// 1. Direct ProseMirror approach: get DOM node at position
|
|
3809
3808
|
const dom = ed.view.domAtPos(from).node;
|
|
3810
3809
|
// Find closest table element
|
|
3811
|
-
const tableElement = dom instanceof HTMLElement
|
|
3810
|
+
const tableElement = dom instanceof HTMLElement
|
|
3811
|
+
? dom.closest("table")
|
|
3812
|
+
: dom.parentElement?.closest("table");
|
|
3812
3813
|
if (tableElement) {
|
|
3813
3814
|
return tableElement.getBoundingClientRect();
|
|
3814
3815
|
}
|
|
@@ -4209,7 +4210,7 @@ class AteBaseSubBubbleMenu {
|
|
|
4209
4210
|
content: this.menuRef().nativeElement,
|
|
4210
4211
|
trigger: "manual",
|
|
4211
4212
|
placement: "bottom-start",
|
|
4212
|
-
appendTo: () => ed
|
|
4213
|
+
appendTo: () => ed?.options?.element || document.body,
|
|
4213
4214
|
interactive: true,
|
|
4214
4215
|
arrow: false,
|
|
4215
4216
|
offset: [0, 8],
|
|
@@ -4221,7 +4222,10 @@ class AteBaseSubBubbleMenu {
|
|
|
4221
4222
|
modifiers: [
|
|
4222
4223
|
{
|
|
4223
4224
|
name: "preventOverflow",
|
|
4224
|
-
options: {
|
|
4225
|
+
options: {
|
|
4226
|
+
boundary: ed?.options?.element || document.body,
|
|
4227
|
+
padding: 8,
|
|
4228
|
+
},
|
|
4225
4229
|
},
|
|
4226
4230
|
{
|
|
4227
4231
|
name: "flip",
|
|
@@ -5134,7 +5138,7 @@ class AteSlashCommandsComponent {
|
|
|
5134
5138
|
{
|
|
5135
5139
|
name: "preventOverflow",
|
|
5136
5140
|
options: {
|
|
5137
|
-
boundary: this.editor().options.element,
|
|
5141
|
+
boundary: this.editor().options.element || document.body,
|
|
5138
5142
|
padding: 8,
|
|
5139
5143
|
},
|
|
5140
5144
|
},
|
|
@@ -6180,6 +6184,48 @@ const ATE_DEFAULT_CELL_MENU_CONFIG = {
|
|
|
6180
6184
|
mergeCells: true,
|
|
6181
6185
|
splitCell: true,
|
|
6182
6186
|
};
|
|
6187
|
+
/**
|
|
6188
|
+
* Ultimate default configuration for the Angular Tiptap Editor.
|
|
6189
|
+
* This serves as the 'Level 4' fallback in the configuration hierarchy:
|
|
6190
|
+
* 1. Component Inputs (Le Roi)
|
|
6191
|
+
* 2. Component [config] (Le Prince)
|
|
6192
|
+
* 3. Global provideAteEditor() (Le Duc)
|
|
6193
|
+
* 4. ATE_DEFAULT_CONFIG (Le Peuple)
|
|
6194
|
+
*/
|
|
6195
|
+
const ATE_DEFAULT_CONFIG = {
|
|
6196
|
+
theme: "auto",
|
|
6197
|
+
mode: "classic",
|
|
6198
|
+
height: "auto",
|
|
6199
|
+
minHeight: "200px",
|
|
6200
|
+
maxHeight: "none",
|
|
6201
|
+
fillContainer: false,
|
|
6202
|
+
autofocus: false,
|
|
6203
|
+
editable: true,
|
|
6204
|
+
disabled: false,
|
|
6205
|
+
spellcheck: true,
|
|
6206
|
+
enableOfficePaste: true,
|
|
6207
|
+
showToolbar: true,
|
|
6208
|
+
showFooter: true,
|
|
6209
|
+
showCharacterCount: true,
|
|
6210
|
+
showWordCount: true,
|
|
6211
|
+
showEditToggle: false,
|
|
6212
|
+
showBubbleMenu: true,
|
|
6213
|
+
showImageBubbleMenu: true,
|
|
6214
|
+
showTableMenu: true,
|
|
6215
|
+
showCellMenu: true,
|
|
6216
|
+
enableSlashCommands: true,
|
|
6217
|
+
floatingToolbar: false,
|
|
6218
|
+
toolbar: ATE_DEFAULT_TOOLBAR_CONFIG,
|
|
6219
|
+
bubbleMenu: ATE_DEFAULT_BUBBLE_MENU_CONFIG,
|
|
6220
|
+
imageBubbleMenu: ATE_DEFAULT_IMAGE_BUBBLE_MENU_CONFIG,
|
|
6221
|
+
tableBubbleMenu: ATE_DEFAULT_TABLE_MENU_CONFIG,
|
|
6222
|
+
cellBubbleMenu: ATE_DEFAULT_CELL_MENU_CONFIG,
|
|
6223
|
+
slashCommands: {},
|
|
6224
|
+
tiptapExtensions: [],
|
|
6225
|
+
tiptapOptions: {},
|
|
6226
|
+
stateCalculators: [],
|
|
6227
|
+
angularNodes: [],
|
|
6228
|
+
};
|
|
6183
6229
|
|
|
6184
6230
|
// Slash commands configuration is handled dynamically via slashCommandsConfigComputed
|
|
6185
6231
|
/**
|
|
@@ -6204,48 +6250,48 @@ class AngularTiptapEditorComponent {
|
|
|
6204
6250
|
/** Configuration globale de l'éditeur */
|
|
6205
6251
|
this.config = input({}, ...(ngDevMode ? [{ debugName: "config" }] : []));
|
|
6206
6252
|
this.content = input("", ...(ngDevMode ? [{ debugName: "content" }] : []));
|
|
6207
|
-
this.placeholder = input(
|
|
6208
|
-
this.editable = input(
|
|
6209
|
-
this.disabled = input(
|
|
6210
|
-
this.minHeight = input(
|
|
6253
|
+
this.placeholder = input(undefined, ...(ngDevMode ? [{ debugName: "placeholder" }] : []));
|
|
6254
|
+
this.editable = input(undefined, ...(ngDevMode ? [{ debugName: "editable" }] : []));
|
|
6255
|
+
this.disabled = input(undefined, ...(ngDevMode ? [{ debugName: "disabled" }] : []));
|
|
6256
|
+
this.minHeight = input(undefined, ...(ngDevMode ? [{ debugName: "minHeight" }] : []));
|
|
6211
6257
|
this.height = input(undefined, ...(ngDevMode ? [{ debugName: "height" }] : []));
|
|
6212
6258
|
this.maxHeight = input(undefined, ...(ngDevMode ? [{ debugName: "maxHeight" }] : []));
|
|
6213
|
-
this.fillContainer = input(
|
|
6214
|
-
this.showToolbar = input(
|
|
6215
|
-
this.showFooter = input(
|
|
6216
|
-
this.showCharacterCount = input(
|
|
6217
|
-
this.showWordCount = input(
|
|
6259
|
+
this.fillContainer = input(undefined, ...(ngDevMode ? [{ debugName: "fillContainer" }] : []));
|
|
6260
|
+
this.showToolbar = input(undefined, ...(ngDevMode ? [{ debugName: "showToolbar" }] : []));
|
|
6261
|
+
this.showFooter = input(undefined, ...(ngDevMode ? [{ debugName: "showFooter" }] : []));
|
|
6262
|
+
this.showCharacterCount = input(undefined, ...(ngDevMode ? [{ debugName: "showCharacterCount" }] : []));
|
|
6263
|
+
this.showWordCount = input(undefined, ...(ngDevMode ? [{ debugName: "showWordCount" }] : []));
|
|
6218
6264
|
this.maxCharacters = input(undefined, ...(ngDevMode ? [{ debugName: "maxCharacters" }] : []));
|
|
6219
|
-
this.enableOfficePaste = input(
|
|
6220
|
-
this.enableSlashCommands = input(
|
|
6221
|
-
this.slashCommands = input(
|
|
6265
|
+
this.enableOfficePaste = input(undefined, ...(ngDevMode ? [{ debugName: "enableOfficePaste" }] : []));
|
|
6266
|
+
this.enableSlashCommands = input(undefined, ...(ngDevMode ? [{ debugName: "enableSlashCommands" }] : []));
|
|
6267
|
+
this.slashCommands = input(undefined, ...(ngDevMode ? [{ debugName: "slashCommands" }] : []));
|
|
6222
6268
|
this.customSlashCommands = input(undefined, ...(ngDevMode ? [{ debugName: "customSlashCommands" }] : []));
|
|
6223
6269
|
this.locale = input(undefined, ...(ngDevMode ? [{ debugName: "locale" }] : []));
|
|
6224
|
-
this.autofocus = input(
|
|
6225
|
-
this.seamless = input(
|
|
6226
|
-
this.floatingToolbar = input(
|
|
6227
|
-
this.showEditToggle = input(
|
|
6228
|
-
this.spellcheck = input(
|
|
6229
|
-
this.tiptapExtensions = input(
|
|
6230
|
-
this.tiptapOptions = input(
|
|
6270
|
+
this.autofocus = input(undefined, ...(ngDevMode ? [{ debugName: "autofocus" }] : []));
|
|
6271
|
+
this.seamless = input(undefined, ...(ngDevMode ? [{ debugName: "seamless" }] : []));
|
|
6272
|
+
this.floatingToolbar = input(undefined, ...(ngDevMode ? [{ debugName: "floatingToolbar" }] : []));
|
|
6273
|
+
this.showEditToggle = input(undefined, ...(ngDevMode ? [{ debugName: "showEditToggle" }] : []));
|
|
6274
|
+
this.spellcheck = input(undefined, ...(ngDevMode ? [{ debugName: "spellcheck" }] : []));
|
|
6275
|
+
this.tiptapExtensions = input(undefined, ...(ngDevMode ? [{ debugName: "tiptapExtensions" }] : []));
|
|
6276
|
+
this.tiptapOptions = input(undefined, ...(ngDevMode ? [{ debugName: "tiptapOptions" }] : []));
|
|
6231
6277
|
// Nouveaux inputs pour les bubble menus
|
|
6232
|
-
this.showBubbleMenu = input(
|
|
6233
|
-
this.bubbleMenu = input(
|
|
6234
|
-
this.showImageBubbleMenu = input(
|
|
6235
|
-
this.imageBubbleMenu = input(
|
|
6278
|
+
this.showBubbleMenu = input(undefined, ...(ngDevMode ? [{ debugName: "showBubbleMenu" }] : []));
|
|
6279
|
+
this.bubbleMenu = input(undefined, ...(ngDevMode ? [{ debugName: "bubbleMenu" }] : []));
|
|
6280
|
+
this.showImageBubbleMenu = input(undefined, ...(ngDevMode ? [{ debugName: "showImageBubbleMenu" }] : []));
|
|
6281
|
+
this.imageBubbleMenu = input(undefined, ...(ngDevMode ? [{ debugName: "imageBubbleMenu" }] : []));
|
|
6236
6282
|
// Configuration de la toolbar
|
|
6237
|
-
this.toolbar = input(
|
|
6283
|
+
this.toolbar = input(undefined, ...(ngDevMode ? [{ debugName: "toolbar" }] : []));
|
|
6238
6284
|
// Configuration des menus de table
|
|
6239
|
-
this.showTableBubbleMenu = input(
|
|
6240
|
-
this.tableBubbleMenu = input(
|
|
6241
|
-
this.showCellBubbleMenu = input(
|
|
6242
|
-
this.cellBubbleMenu = input(
|
|
6285
|
+
this.showTableBubbleMenu = input(undefined, ...(ngDevMode ? [{ debugName: "showTableBubbleMenu" }] : []));
|
|
6286
|
+
this.tableBubbleMenu = input(undefined, ...(ngDevMode ? [{ debugName: "tableBubbleMenu" }] : []));
|
|
6287
|
+
this.showCellBubbleMenu = input(undefined, ...(ngDevMode ? [{ debugName: "showCellBubbleMenu" }] : []));
|
|
6288
|
+
this.cellBubbleMenu = input(undefined, ...(ngDevMode ? [{ debugName: "cellBubbleMenu" }] : []));
|
|
6243
6289
|
/**
|
|
6244
6290
|
* Additionnal state calculators to extend the reactive editor state.
|
|
6245
6291
|
*/
|
|
6246
|
-
this.stateCalculators = input(
|
|
6292
|
+
this.stateCalculators = input(undefined, ...(ngDevMode ? [{ debugName: "stateCalculators" }] : []));
|
|
6247
6293
|
// Nouveau input pour la configuration de l'upload d'images
|
|
6248
|
-
this.imageUpload = input(
|
|
6294
|
+
this.imageUpload = input(undefined, ...(ngDevMode ? [{ debugName: "imageUpload" }] : []));
|
|
6249
6295
|
/**
|
|
6250
6296
|
* Custom handler for image uploads.
|
|
6251
6297
|
* When provided, images will be processed through this handler instead of being converted to base64.
|
|
@@ -6292,7 +6338,7 @@ class AngularTiptapEditorComponent {
|
|
|
6292
6338
|
this._isFormControlDisabled = signal(false, ...(ngDevMode ? [{ debugName: "_isFormControlDisabled" }] : []));
|
|
6293
6339
|
this.isFormControlDisabled = this._isFormControlDisabled.asReadonly();
|
|
6294
6340
|
// Combined disabled state (Input + FormControl)
|
|
6295
|
-
this.mergedDisabled = computed(() => (this.
|
|
6341
|
+
this.mergedDisabled = computed(() => (this.disabled() ?? this.effectiveConfig().disabled) || this.isFormControlDisabled(), ...(ngDevMode ? [{ debugName: "mergedDisabled" }] : []));
|
|
6296
6342
|
// Computed for editor states
|
|
6297
6343
|
this.isEditorReady = computed(() => this.editor() !== null, ...(ngDevMode ? [{ debugName: "isEditorReady" }] : []));
|
|
6298
6344
|
// ============================================
|
|
@@ -6300,109 +6346,132 @@ class AngularTiptapEditorComponent {
|
|
|
6300
6346
|
// ============================================
|
|
6301
6347
|
// Appearance & Fundamentals
|
|
6302
6348
|
this.finalSeamless = computed(() => {
|
|
6349
|
+
const inputVal = this.seamless();
|
|
6350
|
+
if (inputVal !== undefined)
|
|
6351
|
+
return inputVal;
|
|
6303
6352
|
const fromConfig = this.effectiveConfig().mode;
|
|
6304
|
-
|
|
6305
|
-
return fromConfig === "seamless";
|
|
6306
|
-
}
|
|
6307
|
-
return this.seamless();
|
|
6353
|
+
return fromConfig === "seamless";
|
|
6308
6354
|
}, ...(ngDevMode ? [{ debugName: "finalSeamless" }] : []));
|
|
6309
|
-
this.finalEditable = computed(() => this.
|
|
6310
|
-
this.finalPlaceholder = computed(() => this.
|
|
6311
|
-
|
|
6312
|
-
|
|
6313
|
-
this.
|
|
6314
|
-
this.
|
|
6315
|
-
this.
|
|
6316
|
-
this.
|
|
6317
|
-
|
|
6318
|
-
|
|
6319
|
-
|
|
6355
|
+
this.finalEditable = computed(() => this.editable() ?? this.effectiveConfig().editable, ...(ngDevMode ? [{ debugName: "finalEditable" }] : []));
|
|
6356
|
+
this.finalPlaceholder = computed(() => this.placeholder() ??
|
|
6357
|
+
this.effectiveConfig().placeholder ??
|
|
6358
|
+
this.currentTranslations().editor.placeholder, ...(ngDevMode ? [{ debugName: "finalPlaceholder" }] : []));
|
|
6359
|
+
this.finalFillContainer = computed(() => this.fillContainer() ?? this.effectiveConfig().fillContainer, ...(ngDevMode ? [{ debugName: "finalFillContainer" }] : []));
|
|
6360
|
+
this.finalShowFooter = computed(() => this.showFooter() ?? this.effectiveConfig().showFooter, ...(ngDevMode ? [{ debugName: "finalShowFooter" }] : []));
|
|
6361
|
+
this.finalShowEditToggle = computed(() => this.showEditToggle() ?? this.effectiveConfig().showEditToggle, ...(ngDevMode ? [{ debugName: "finalShowEditToggle" }] : []));
|
|
6362
|
+
this.finalHeight = computed(() => {
|
|
6363
|
+
const h = this.height() ?? this.effectiveConfig().height;
|
|
6364
|
+
return typeof h === "number" ? `${h}px` : h;
|
|
6365
|
+
}, ...(ngDevMode ? [{ debugName: "finalHeight" }] : []));
|
|
6366
|
+
this.finalMinHeight = computed(() => {
|
|
6367
|
+
const mh = this.minHeight() ?? this.effectiveConfig().minHeight;
|
|
6368
|
+
return typeof mh === "number" ? `${mh}px` : mh;
|
|
6369
|
+
}, ...(ngDevMode ? [{ debugName: "finalMinHeight" }] : []));
|
|
6370
|
+
this.finalMaxHeight = computed(() => {
|
|
6371
|
+
const mh = this.maxHeight() ?? this.effectiveConfig().maxHeight;
|
|
6372
|
+
return typeof mh === "number" ? `${mh}px` : mh;
|
|
6373
|
+
}, ...(ngDevMode ? [{ debugName: "finalMaxHeight" }] : []));
|
|
6374
|
+
this.finalSpellcheck = computed(() => this.spellcheck() ?? this.effectiveConfig().spellcheck, ...(ngDevMode ? [{ debugName: "finalSpellcheck" }] : []));
|
|
6375
|
+
this.finalEnableOfficePaste = computed(() => this.enableOfficePaste() ?? this.effectiveConfig().enableOfficePaste, ...(ngDevMode ? [{ debugName: "finalEnableOfficePaste" }] : []));
|
|
6320
6376
|
// Features
|
|
6321
|
-
this.finalShowToolbar = computed(() => this.
|
|
6377
|
+
this.finalShowToolbar = computed(() => this.showToolbar() ?? this.effectiveConfig().showToolbar, ...(ngDevMode ? [{ debugName: "finalShowToolbar" }] : []));
|
|
6322
6378
|
this.finalToolbarConfig = computed(() => {
|
|
6379
|
+
const fromInput = this.toolbar();
|
|
6323
6380
|
const fromConfig = this.effectiveConfig().toolbar;
|
|
6324
6381
|
const base = ATE_DEFAULT_TOOLBAR_CONFIG;
|
|
6382
|
+
if (fromInput && Object.keys(fromInput).length > 0) {
|
|
6383
|
+
return { ...base, ...fromInput };
|
|
6384
|
+
}
|
|
6325
6385
|
if (fromConfig) {
|
|
6326
6386
|
return { ...base, ...fromConfig };
|
|
6327
6387
|
}
|
|
6328
|
-
|
|
6329
|
-
return Object.keys(fromInput).length === 0 ? base : { ...base, ...fromInput };
|
|
6388
|
+
return base;
|
|
6330
6389
|
}, ...(ngDevMode ? [{ debugName: "finalToolbarConfig" }] : []));
|
|
6331
|
-
this.finalFloatingToolbar = computed(() => this.
|
|
6332
|
-
this.finalShowBubbleMenu = computed(() => this.
|
|
6390
|
+
this.finalFloatingToolbar = computed(() => this.floatingToolbar() ?? this.effectiveConfig().floatingToolbar, ...(ngDevMode ? [{ debugName: "finalFloatingToolbar" }] : []));
|
|
6391
|
+
this.finalShowBubbleMenu = computed(() => this.showBubbleMenu() ?? this.effectiveConfig().showBubbleMenu, ...(ngDevMode ? [{ debugName: "finalShowBubbleMenu" }] : []));
|
|
6333
6392
|
this.finalBubbleMenuConfig = computed(() => {
|
|
6393
|
+
const fromInput = this.bubbleMenu();
|
|
6334
6394
|
const fromConfig = this.effectiveConfig().bubbleMenu;
|
|
6335
6395
|
const base = ATE_DEFAULT_BUBBLE_MENU_CONFIG;
|
|
6396
|
+
if (fromInput && Object.keys(fromInput).length > 0) {
|
|
6397
|
+
return { ...base, ...fromInput };
|
|
6398
|
+
}
|
|
6336
6399
|
if (fromConfig) {
|
|
6337
6400
|
return { ...base, ...fromConfig };
|
|
6338
6401
|
}
|
|
6339
|
-
return
|
|
6402
|
+
return base;
|
|
6340
6403
|
}, ...(ngDevMode ? [{ debugName: "finalBubbleMenuConfig" }] : []));
|
|
6341
|
-
this.finalShowImageBubbleMenu = computed(() => this.
|
|
6404
|
+
this.finalShowImageBubbleMenu = computed(() => this.showImageBubbleMenu() ?? this.effectiveConfig().showImageBubbleMenu, ...(ngDevMode ? [{ debugName: "finalShowImageBubbleMenu" }] : []));
|
|
6342
6405
|
this.finalImageBubbleMenuConfig = computed(() => {
|
|
6406
|
+
const fromInput = this.imageBubbleMenu();
|
|
6343
6407
|
const fromConfig = this.effectiveConfig().imageBubbleMenu;
|
|
6344
6408
|
const base = ATE_DEFAULT_IMAGE_BUBBLE_MENU_CONFIG;
|
|
6409
|
+
if (fromInput && Object.keys(fromInput).length > 0) {
|
|
6410
|
+
return { ...base, ...fromInput };
|
|
6411
|
+
}
|
|
6345
6412
|
if (fromConfig) {
|
|
6346
6413
|
return { ...base, ...fromConfig };
|
|
6347
6414
|
}
|
|
6348
|
-
return
|
|
6349
|
-
? base
|
|
6350
|
-
: { ...base, ...this.imageBubbleMenu() };
|
|
6415
|
+
return base;
|
|
6351
6416
|
}, ...(ngDevMode ? [{ debugName: "finalImageBubbleMenuConfig" }] : []));
|
|
6352
|
-
this.finalShowTableBubbleMenu = computed(() => this.
|
|
6417
|
+
this.finalShowTableBubbleMenu = computed(() => this.showTableBubbleMenu() ?? this.effectiveConfig().showTableMenu, ...(ngDevMode ? [{ debugName: "finalShowTableBubbleMenu" }] : []));
|
|
6353
6418
|
this.finalTableBubbleMenuConfig = computed(() => {
|
|
6419
|
+
const fromInput = this.tableBubbleMenu();
|
|
6354
6420
|
const fromConfig = this.effectiveConfig().tableBubbleMenu;
|
|
6355
6421
|
const base = ATE_DEFAULT_TABLE_MENU_CONFIG;
|
|
6422
|
+
if (fromInput && Object.keys(fromInput).length > 0) {
|
|
6423
|
+
return { ...base, ...fromInput };
|
|
6424
|
+
}
|
|
6356
6425
|
if (fromConfig) {
|
|
6357
6426
|
return { ...base, ...fromConfig };
|
|
6358
6427
|
}
|
|
6359
|
-
return
|
|
6360
|
-
? base
|
|
6361
|
-
: { ...base, ...this.tableBubbleMenu() };
|
|
6428
|
+
return base;
|
|
6362
6429
|
}, ...(ngDevMode ? [{ debugName: "finalTableBubbleMenuConfig" }] : []));
|
|
6363
|
-
this.finalShowCellBubbleMenu = computed(() => this.
|
|
6430
|
+
this.finalShowCellBubbleMenu = computed(() => this.showCellBubbleMenu() ?? this.effectiveConfig().showCellMenu, ...(ngDevMode ? [{ debugName: "finalShowCellBubbleMenu" }] : []));
|
|
6364
6431
|
this.finalCellBubbleMenuConfig = computed(() => {
|
|
6432
|
+
const fromInput = this.cellBubbleMenu();
|
|
6365
6433
|
const fromConfig = this.effectiveConfig().cellBubbleMenu;
|
|
6366
6434
|
const base = ATE_DEFAULT_CELL_MENU_CONFIG;
|
|
6435
|
+
if (fromInput && Object.keys(fromInput).length > 0) {
|
|
6436
|
+
return { ...base, ...fromInput };
|
|
6437
|
+
}
|
|
6367
6438
|
if (fromConfig) {
|
|
6368
6439
|
return { ...base, ...fromConfig };
|
|
6369
6440
|
}
|
|
6370
|
-
return
|
|
6371
|
-
? base
|
|
6372
|
-
: { ...base, ...this.cellBubbleMenu() };
|
|
6441
|
+
return base;
|
|
6373
6442
|
}, ...(ngDevMode ? [{ debugName: "finalCellBubbleMenuConfig" }] : []));
|
|
6374
|
-
this.finalEnableSlashCommands = computed(() => this.
|
|
6443
|
+
this.finalEnableSlashCommands = computed(() => this.enableSlashCommands() ?? this.effectiveConfig().enableSlashCommands, ...(ngDevMode ? [{ debugName: "finalEnableSlashCommands" }] : []));
|
|
6375
6444
|
this.finalSlashCommandsConfig = computed(() => {
|
|
6376
|
-
const
|
|
6377
|
-
const
|
|
6378
|
-
const
|
|
6379
|
-
const customConfig = fromInputCustom ?? fromGlobalCustom;
|
|
6445
|
+
const fromInputComponent = this.customSlashCommands();
|
|
6446
|
+
const fromConfigComponent = this.effectiveConfig().customSlashCommands;
|
|
6447
|
+
const customConfig = fromInputComponent ?? fromConfigComponent;
|
|
6380
6448
|
if (customConfig) {
|
|
6381
6449
|
return customConfig;
|
|
6382
6450
|
}
|
|
6383
|
-
|
|
6384
|
-
|
|
6385
|
-
|
|
6386
|
-
|
|
6451
|
+
const fromInputOptions = this.slashCommands();
|
|
6452
|
+
const fromConfigOptions = this.effectiveConfig().slashCommands;
|
|
6453
|
+
const baseConfig = fromInputOptions && Object.keys(fromInputOptions).length > 0
|
|
6454
|
+
? fromInputOptions
|
|
6455
|
+
: fromConfigOptions;
|
|
6387
6456
|
return {
|
|
6388
|
-
commands: filterSlashCommands(baseConfig, this.i18nService, this.editorCommandsService, this.finalImageUploadConfig()),
|
|
6457
|
+
commands: filterSlashCommands(baseConfig || {}, this.i18nService, this.editorCommandsService, this.finalImageUploadConfig()),
|
|
6389
6458
|
};
|
|
6390
6459
|
}, ...(ngDevMode ? [{ debugName: "finalSlashCommandsConfig" }] : []));
|
|
6391
6460
|
// Behavior
|
|
6392
|
-
this.finalAutofocus = computed(() => this.
|
|
6393
|
-
this.finalMaxCharacters = computed(() => this.
|
|
6394
|
-
this.finalShowCharacterCount = computed(() => this.
|
|
6395
|
-
this.finalShowWordCount = computed(() => this.
|
|
6396
|
-
this.finalLocale = computed(() => this.
|
|
6461
|
+
this.finalAutofocus = computed(() => this.autofocus() ?? this.effectiveConfig().autofocus, ...(ngDevMode ? [{ debugName: "finalAutofocus" }] : []));
|
|
6462
|
+
this.finalMaxCharacters = computed(() => this.maxCharacters() ?? this.effectiveConfig().maxCharacters, ...(ngDevMode ? [{ debugName: "finalMaxCharacters" }] : []));
|
|
6463
|
+
this.finalShowCharacterCount = computed(() => this.showCharacterCount() ?? this.effectiveConfig().showCharacterCount, ...(ngDevMode ? [{ debugName: "finalShowCharacterCount" }] : []));
|
|
6464
|
+
this.finalShowWordCount = computed(() => this.showWordCount() ?? this.effectiveConfig().showWordCount, ...(ngDevMode ? [{ debugName: "finalShowWordCount" }] : []));
|
|
6465
|
+
this.finalLocale = computed(() => this.locale() ?? this.effectiveConfig().locale, ...(ngDevMode ? [{ debugName: "finalLocale" }] : []));
|
|
6397
6466
|
// Extensions & Options
|
|
6398
|
-
this.finalTiptapExtensions = computed(() => this.
|
|
6399
|
-
this.finalTiptapOptions = computed(() => this.
|
|
6400
|
-
this.finalStateCalculators = computed(() => this.
|
|
6467
|
+
this.finalTiptapExtensions = computed(() => this.tiptapExtensions() ?? this.effectiveConfig().tiptapExtensions ?? [], ...(ngDevMode ? [{ debugName: "finalTiptapExtensions" }] : []));
|
|
6468
|
+
this.finalTiptapOptions = computed(() => this.tiptapOptions() ?? this.effectiveConfig().tiptapOptions ?? {}, ...(ngDevMode ? [{ debugName: "finalTiptapOptions" }] : []));
|
|
6469
|
+
this.finalStateCalculators = computed(() => this.stateCalculators() ?? this.effectiveConfig().stateCalculators ?? [], ...(ngDevMode ? [{ debugName: "finalStateCalculators" }] : []));
|
|
6401
6470
|
this.finalAngularNodesConfig = computed(() => this.effectiveConfig().angularNodes ?? [], ...(ngDevMode ? [{ debugName: "finalAngularNodesConfig" }] : []));
|
|
6402
6471
|
// Image Upload
|
|
6403
6472
|
this.finalImageUploadConfig = computed(() => {
|
|
6404
|
-
const fromConfig = this.effectiveConfig().imageUpload;
|
|
6405
6473
|
const fromInput = this.imageUpload();
|
|
6474
|
+
const fromConfig = this.effectiveConfig().imageUpload;
|
|
6406
6475
|
const merged = {
|
|
6407
6476
|
maxSize: 5, // Default 5MB
|
|
6408
6477
|
maxWidth: 1920,
|
|
@@ -6413,15 +6482,15 @@ class AngularTiptapEditorComponent {
|
|
|
6413
6482
|
multiple: false,
|
|
6414
6483
|
compressImages: true,
|
|
6415
6484
|
quality: 0.8,
|
|
6416
|
-
...fromInput,
|
|
6417
6485
|
...fromConfig,
|
|
6486
|
+
...fromInput,
|
|
6418
6487
|
};
|
|
6419
6488
|
return {
|
|
6420
6489
|
...merged,
|
|
6421
6490
|
maxSize: merged.maxSize * 1024 * 1024, // Convert MB to bytes for internal service
|
|
6422
6491
|
};
|
|
6423
6492
|
}, ...(ngDevMode ? [{ debugName: "finalImageUploadConfig" }] : []));
|
|
6424
|
-
this.finalImageUploadHandler = computed(() => this.
|
|
6493
|
+
this.finalImageUploadHandler = computed(() => this.imageUploadHandler() ?? this.effectiveConfig().imageUpload?.handler, ...(ngDevMode ? [{ debugName: "finalImageUploadHandler" }] : []));
|
|
6425
6494
|
// Computed for current translations (allows per-instance override via config or input)
|
|
6426
6495
|
this.currentTranslations = computed(() => {
|
|
6427
6496
|
const localeOverride = this.finalLocale();
|
|
@@ -6447,7 +6516,7 @@ class AngularTiptapEditorComponent {
|
|
|
6447
6516
|
this.effectiveConfig = computed(() => {
|
|
6448
6517
|
const fromInput = this.config();
|
|
6449
6518
|
const fromGlobal = this.globalConfig || {};
|
|
6450
|
-
return { ...fromGlobal, ...fromInput };
|
|
6519
|
+
return { ...ATE_DEFAULT_CONFIG, ...fromGlobal, ...fromInput };
|
|
6451
6520
|
}, ...(ngDevMode ? [{ debugName: "effectiveConfig" }] : []));
|
|
6452
6521
|
// Effect to update editor content (with anti-echo)
|
|
6453
6522
|
effect(() => {
|
|
@@ -6470,7 +6539,7 @@ class AngularTiptapEditorComponent {
|
|
|
6470
6539
|
if (hasFormControl && !content) {
|
|
6471
6540
|
return;
|
|
6472
6541
|
}
|
|
6473
|
-
editor.commands.setContent(content, false);
|
|
6542
|
+
editor.commands.setContent(content, { emitUpdate: false });
|
|
6474
6543
|
});
|
|
6475
6544
|
});
|
|
6476
6545
|
// Effect to update height properties
|
|
@@ -6618,7 +6687,7 @@ class AngularTiptapEditorComponent {
|
|
|
6618
6687
|
}
|
|
6619
6688
|
// Register automatic node views from config
|
|
6620
6689
|
const autoNodeViews = this.finalAngularNodesConfig();
|
|
6621
|
-
autoNodeViews.forEach(reg => {
|
|
6690
|
+
autoNodeViews.forEach((reg) => {
|
|
6622
6691
|
const options = typeof reg === "function"
|
|
6623
6692
|
? { component: reg }
|
|
6624
6693
|
: reg;
|
|
@@ -6634,9 +6703,9 @@ class AngularTiptapEditorComponent {
|
|
|
6634
6703
|
const customExtensions = this.finalTiptapExtensions();
|
|
6635
6704
|
if (customExtensions.length > 0) {
|
|
6636
6705
|
const existingNames = new Set(extensions
|
|
6637
|
-
.map(ext => ext?.name)
|
|
6706
|
+
.map((ext) => ext?.name)
|
|
6638
6707
|
.filter((name) => !!name));
|
|
6639
|
-
const toAdd = customExtensions.filter(ext => {
|
|
6708
|
+
const toAdd = customExtensions.filter((ext) => {
|
|
6640
6709
|
const name = ext?.name;
|
|
6641
6710
|
return !name || !existingNames.has(name);
|
|
6642
6711
|
});
|
|
@@ -7203,38 +7272,10 @@ const ATE_CELL_BUBBLE_MENU_KEYS = ["mergeCells", "splitCell"];
|
|
|
7203
7272
|
* Public API Surface of tiptap-editor
|
|
7204
7273
|
*/
|
|
7205
7274
|
// Main component & Provider
|
|
7206
|
-
/** @deprecated Renamed to `ATE_INITIAL_EDITOR_STATE`. This alias will be removed in v3.0.0. */
|
|
7207
|
-
const INITIAL_EDITOR_STATE = ATE_INITIAL_EDITOR_STATE;
|
|
7208
|
-
/** @deprecated Renamed to `ATE_SLASH_COMMAND_KEYS`. This alias will be removed in v3.0.0. */
|
|
7209
|
-
const SLASH_COMMAND_KEYS = ATE_SLASH_COMMAND_KEYS;
|
|
7210
|
-
/** @deprecated Renamed to `ATE_DEFAULT_SLASH_COMMANDS_CONFIG`. This alias will be removed in v3.0.0. */
|
|
7211
|
-
const DEFAULT_SLASH_COMMANDS_CONFIG = ATE_DEFAULT_SLASH_COMMANDS_CONFIG;
|
|
7212
|
-
/** @deprecated Renamed to `AteDiscoveryCalculator`. This alias will be removed in v3.0.0. */
|
|
7213
|
-
const DiscoveryCalculator = AteDiscoveryCalculator;
|
|
7214
|
-
/** @deprecated Renamed to `AteImageCalculator`. This alias will be removed in v3.0.0. */
|
|
7215
|
-
const ImageCalculator = AteImageCalculator;
|
|
7216
|
-
/** @deprecated Renamed to `AteMarksCalculator`. This alias will be removed in v3.0.0. */
|
|
7217
|
-
const MarksCalculator = AteMarksCalculator;
|
|
7218
|
-
/** @deprecated Renamed to `AteSelectionCalculator`. This alias will be removed in v3.0.0. */
|
|
7219
|
-
const SelectionCalculator = AteSelectionCalculator;
|
|
7220
|
-
/** @deprecated Renamed to `AteStructureCalculator`. This alias will be removed in v3.0.0. */
|
|
7221
|
-
const StructureCalculator = AteStructureCalculator;
|
|
7222
|
-
/** @deprecated Renamed to `AteTableCalculator`. This alias will be removed in v3.0.0. */
|
|
7223
|
-
const TableCalculator = AteTableCalculator;
|
|
7224
|
-
/** @deprecated Renamed to `ATE_DEFAULT_TOOLBAR_CONFIG`. This alias will be removed in v3.0.0. */
|
|
7225
|
-
const DEFAULT_TOOLBAR_CONFIG = ATE_DEFAULT_TOOLBAR_CONFIG;
|
|
7226
|
-
/** @deprecated Renamed to `ATE_DEFAULT_BUBBLE_MENU_CONFIG`. This alias will be removed in v3.0.0. */
|
|
7227
|
-
const DEFAULT_BUBBLE_MENU_CONFIG = ATE_DEFAULT_BUBBLE_MENU_CONFIG;
|
|
7228
|
-
/** @deprecated Renamed to `ATE_DEFAULT_IMAGE_BUBBLE_MENU_CONFIG`. This alias will be removed in v3.0.0. */
|
|
7229
|
-
const DEFAULT_IMAGE_BUBBLE_MENU_CONFIG = ATE_DEFAULT_IMAGE_BUBBLE_MENU_CONFIG;
|
|
7230
|
-
/** @deprecated Renamed to `ATE_DEFAULT_TABLE_MENU_CONFIG`. This alias will be removed in v3.0.0. */
|
|
7231
|
-
const DEFAULT_TABLE_MENU_CONFIG = ATE_DEFAULT_TABLE_MENU_CONFIG;
|
|
7232
|
-
/** @deprecated Renamed to `ATE_DEFAULT_CELL_MENU_CONFIG`. This alias will be removed in v3.0.0. */
|
|
7233
|
-
const DEFAULT_CELL_MENU_CONFIG = ATE_DEFAULT_CELL_MENU_CONFIG;
|
|
7234
7275
|
|
|
7235
7276
|
/**
|
|
7236
7277
|
* Generated bundle index. Do not edit.
|
|
7237
7278
|
*/
|
|
7238
7279
|
|
|
7239
|
-
export { ATE_BUBBLE_MENU_KEYS, ATE_CELL_BUBBLE_MENU_KEYS, ATE_DEFAULT_BUBBLE_MENU_CONFIG, ATE_DEFAULT_CELL_MENU_CONFIG, ATE_DEFAULT_IMAGE_BUBBLE_MENU_CONFIG, ATE_DEFAULT_SLASH_COMMANDS_CONFIG, ATE_DEFAULT_TABLE_MENU_CONFIG, ATE_DEFAULT_TOOLBAR_CONFIG, ATE_GLOBAL_CONFIG, ATE_IMAGE_BUBBLE_MENU_KEYS, ATE_INITIAL_EDITOR_STATE, ATE_SLASH_COMMAND_KEYS, ATE_TABLE_BUBBLE_MENU_KEYS, ATE_TOOLBAR_KEYS, AngularTiptapEditorComponent, AteAngularNodeView, AteColorPickerService, AteDiscoveryCalculator, AteEditorCommandsService, AteI18nService, AteImageCalculator, AteImageService, AteLinkService, AteMarksCalculator, AteNodeViewRenderer, AteNoopValueAccessorDirective, AteSelectionCalculator, AteStructureCalculator, AteTableCalculator,
|
|
7280
|
+
export { ATE_BUBBLE_MENU_KEYS, ATE_CELL_BUBBLE_MENU_KEYS, ATE_DEFAULT_BUBBLE_MENU_CONFIG, ATE_DEFAULT_CELL_MENU_CONFIG, ATE_DEFAULT_CONFIG, ATE_DEFAULT_IMAGE_BUBBLE_MENU_CONFIG, ATE_DEFAULT_SLASH_COMMANDS_CONFIG, ATE_DEFAULT_TABLE_MENU_CONFIG, ATE_DEFAULT_TOOLBAR_CONFIG, ATE_GLOBAL_CONFIG, ATE_IMAGE_BUBBLE_MENU_KEYS, ATE_INITIAL_EDITOR_STATE, ATE_SLASH_COMMAND_KEYS, ATE_TABLE_BUBBLE_MENU_KEYS, ATE_TOOLBAR_KEYS, AngularTiptapEditorComponent, AteAngularNodeView, AteColorPickerService, AteDiscoveryCalculator, AteEditorCommandsService, AteI18nService, AteImageCalculator, AteImageService, AteLinkService, AteMarksCalculator, AteNodeViewRenderer, AteNoopValueAccessorDirective, AteSelectionCalculator, AteStructureCalculator, AteTableCalculator, createAngularComponentExtension, createDefaultSlashCommands, filterSlashCommands, provideAteEditor, registerAngularComponent };
|
|
7240
7281
|
//# sourceMappingURL=flogeez-angular-tiptap-editor.mjs.map
|