@flogeez/angular-tiptap-editor 3.2.2 → 3.4.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 +26 -0
- package/README.md +17 -19
- package/esm2022/lib/components/bubble-menus/base/ate-base-bubble-menu.mjs +3 -3
- package/esm2022/lib/components/bubble-menus/base/ate-base-sub-bubble-menu.mjs +1 -1
- package/esm2022/lib/components/bubble-menus/color/ate-color-bubble-menu.component.mjs +2 -2
- package/esm2022/lib/components/bubble-menus/link/ate-link-bubble-menu.component.mjs +2 -2
- package/esm2022/lib/components/edit-toggle/ate-edit-toggle.component.mjs +1 -1
- package/esm2022/lib/components/editor/angular-tiptap-editor.component.mjs +23 -7
- package/esm2022/lib/components/editor/ate-block-controls.component.mjs +4 -4
- package/esm2022/lib/components/slash-commands/ate-slash-commands.component.mjs +2 -2
- package/esm2022/lib/components/table-of-contents/ate-table-of-contents.component.mjs +359 -0
- package/esm2022/lib/extensions/ate-block-controls.extension.mjs +3 -3
- package/esm2022/lib/i18n/ateTranslationsModel.mjs +2 -0
- package/esm2022/lib/i18n/de_ateTranslations.mjs +190 -0
- package/esm2022/lib/i18n/en_ateTranslations.mjs +190 -0
- package/esm2022/lib/i18n/fr_ateTranslations.mjs +190 -0
- package/esm2022/lib/services/ate-i18n.service.mjs +6 -374
- package/esm2022/lib/services/ate-image.service.mjs +2 -2
- package/esm2022/public-api.mjs +2 -1
- package/fesm2022/flogeez-angular-tiptap-editor.mjs +589 -20
- package/fesm2022/flogeez-angular-tiptap-editor.mjs.map +1 -1
- package/lib/components/bubble-menus/base/ate-base-bubble-menu.d.ts +1 -1
- package/lib/components/bubble-menus/base/ate-base-sub-bubble-menu.d.ts +1 -1
- package/lib/components/edit-toggle/ate-edit-toggle.component.d.ts +1 -1
- package/lib/components/editor/angular-tiptap-editor.component.d.ts +3 -2
- package/lib/components/table-of-contents/ate-table-of-contents.component.d.ts +48 -0
- package/lib/i18n/ateTranslationsModel.d.ts +190 -0
- package/lib/i18n/de_ateTranslations.d.ts +2 -0
- package/lib/i18n/en_ateTranslations.d.ts +2 -0
- package/lib/i18n/fr_ateTranslations.d.ts +2 -0
- package/lib/services/ate-i18n.service.d.ts +5 -187
- package/package.json +1 -1
- package/public-api.d.ts +2 -1
- package/src/lib/styles/ate-variables.global.css +173 -0
- package/src/lib/styles/index.css +1 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { inject, ElementRef, input, computed, effect, Directive, output, Component, ChangeDetectionStrategy, signal, Injectable, viewChild, ApplicationRef, EnvironmentInjector, createComponent, InjectionToken, DestroyRef, Injector, untracked, makeEnvironmentProviders, APP_INITIALIZER } from '@angular/core';
|
|
2
|
+
import { inject, ElementRef, input, computed, effect, Directive, output, Component, ChangeDetectionStrategy, signal, Injectable, viewChild, ApplicationRef, EnvironmentInjector, createComponent, InjectionToken, DestroyRef, Injector, untracked, HostListener, makeEnvironmentProviders, APP_INITIALIZER } from '@angular/core';
|
|
3
3
|
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
4
4
|
import { Node as Node$1, mergeAttributes, nodeInputRule, Extension, getAttributes, Editor } from '@tiptap/core';
|
|
5
5
|
import StarterKit from '@tiptap/starter-kit';
|
|
@@ -1076,7 +1076,9 @@ const ENGLISH_TRANSLATIONS = {
|
|
|
1076
1076
|
editor: {
|
|
1077
1077
|
placeholder: "Start typing...",
|
|
1078
1078
|
character: "character",
|
|
1079
|
+
characterPlural: "characters",
|
|
1079
1080
|
word: "word",
|
|
1081
|
+
wordPlural: "words",
|
|
1080
1082
|
linkPrompt: "Enter link URL",
|
|
1081
1083
|
linkUrlPrompt: "Enter URL",
|
|
1082
1084
|
confirmDelete: "Are you sure you want to delete this?",
|
|
@@ -1084,6 +1086,7 @@ const ENGLISH_TRANSLATIONS = {
|
|
|
1084
1086
|
viewMode: "Switch to View Mode",
|
|
1085
1087
|
blockAdd: "Click to add a block",
|
|
1086
1088
|
blockDrag: "Drag to move this block",
|
|
1089
|
+
tableOfContents: "Table of Contents",
|
|
1087
1090
|
},
|
|
1088
1091
|
common: {
|
|
1089
1092
|
cancel: "Cancel",
|
|
@@ -1110,6 +1113,7 @@ const ENGLISH_TRANSLATIONS = {
|
|
|
1110
1113
|
copiedSuccess: "Copied to clipboard!",
|
|
1111
1114
|
},
|
|
1112
1115
|
};
|
|
1116
|
+
|
|
1113
1117
|
const FRENCH_TRANSLATIONS = {
|
|
1114
1118
|
toolbar: {
|
|
1115
1119
|
bold: "Gras\nCtrl+B",
|
|
@@ -1262,7 +1266,9 @@ const FRENCH_TRANSLATIONS = {
|
|
|
1262
1266
|
editor: {
|
|
1263
1267
|
placeholder: "Commencez à écrire...",
|
|
1264
1268
|
character: "caractère",
|
|
1269
|
+
characterPlural: "caractères",
|
|
1265
1270
|
word: "mot",
|
|
1271
|
+
wordPlural: "mots",
|
|
1266
1272
|
linkPrompt: "Entrez l'URL du lien",
|
|
1267
1273
|
linkUrlPrompt: "Entrez l'URL",
|
|
1268
1274
|
confirmDelete: "Êtes-vous sûr de vouloir supprimer ceci ?",
|
|
@@ -1270,6 +1276,7 @@ const FRENCH_TRANSLATIONS = {
|
|
|
1270
1276
|
viewMode: "Passer en mode affichage",
|
|
1271
1277
|
blockAdd: "Cliquer pour ajouter un bloc",
|
|
1272
1278
|
blockDrag: "Faire glisser pour déplacer ce bloc",
|
|
1279
|
+
tableOfContents: "Sommaire",
|
|
1273
1280
|
},
|
|
1274
1281
|
common: {
|
|
1275
1282
|
cancel: "Annuler",
|
|
@@ -1296,18 +1303,210 @@ const FRENCH_TRANSLATIONS = {
|
|
|
1296
1303
|
copiedSuccess: "Copié dans le presse-papiers !",
|
|
1297
1304
|
},
|
|
1298
1305
|
};
|
|
1306
|
+
|
|
1307
|
+
const GERMAN_TRANSLATIONS = {
|
|
1308
|
+
toolbar: {
|
|
1309
|
+
bold: "Fett\nStrg+B",
|
|
1310
|
+
italic: "Kursiv\nStrg+I",
|
|
1311
|
+
underline: "Unterstrichen\nStrg+U",
|
|
1312
|
+
strike: "Durchgestrichen\nStrg+Shift+X",
|
|
1313
|
+
code: "Inline-Code\nStrg+E",
|
|
1314
|
+
codeBlock: "Codeblock",
|
|
1315
|
+
superscript: "Hochgestellt",
|
|
1316
|
+
subscript: "Tiefgestellt",
|
|
1317
|
+
highlight: "Hervorheben",
|
|
1318
|
+
highlightPicker: "Hintergrundfarbe",
|
|
1319
|
+
heading1: "Überschrift 1",
|
|
1320
|
+
heading2: "Überschrift 2",
|
|
1321
|
+
heading3: "Überschrift 3",
|
|
1322
|
+
bulletList: "Aufzählungsliste",
|
|
1323
|
+
orderedList: "Nummerierte Liste",
|
|
1324
|
+
blockquote: "Zitatblock",
|
|
1325
|
+
alignLeft: "Links ausrichten",
|
|
1326
|
+
alignCenter: "Zentrieren",
|
|
1327
|
+
alignRight: "Rechts ausrichten",
|
|
1328
|
+
alignJustify: "Blocksatz",
|
|
1329
|
+
link: "Link hinzufügen",
|
|
1330
|
+
image: "Bild hinzufügen",
|
|
1331
|
+
horizontalRule: "Horizontale Linie",
|
|
1332
|
+
table: "Tabelle einfügen",
|
|
1333
|
+
undo: "Rückgängig\nStrg+Z",
|
|
1334
|
+
redo: "Wiederholen\nStrg+Shift+Z",
|
|
1335
|
+
clear: "Leeren",
|
|
1336
|
+
textColor: "Textfarbe",
|
|
1337
|
+
customColor: "Benutzerdefinierte Farbe",
|
|
1338
|
+
presets: "Voreinstellungen",
|
|
1339
|
+
},
|
|
1340
|
+
bubbleMenu: {
|
|
1341
|
+
bold: "Fett\nStrg+B",
|
|
1342
|
+
italic: "Kursiv\nStrg+I",
|
|
1343
|
+
underline: "Unterstrichen\nStrg+U",
|
|
1344
|
+
strike: "Durchgestrichen\nStrg+Shift+X",
|
|
1345
|
+
code: "Code\nStrg+E",
|
|
1346
|
+
superscript: "Hochgestellt",
|
|
1347
|
+
subscript: "Tiefgestellt",
|
|
1348
|
+
highlight: "Hervorheben",
|
|
1349
|
+
highlightPicker: "Hintergrundfarbe",
|
|
1350
|
+
textColor: "Textfarbe",
|
|
1351
|
+
link: "Link",
|
|
1352
|
+
addLink: "Link hinzufügen",
|
|
1353
|
+
editLink: "Link bearbeiten",
|
|
1354
|
+
removeLink: "Link entfernen",
|
|
1355
|
+
linkUrl: "Link-URL",
|
|
1356
|
+
linkText: "Link-Text",
|
|
1357
|
+
openLink: "Link öffnen",
|
|
1358
|
+
customColor: "Benutzerdefinierte Farbe",
|
|
1359
|
+
presets: "Voreinstellungen",
|
|
1360
|
+
},
|
|
1361
|
+
slashCommands: {
|
|
1362
|
+
heading1: {
|
|
1363
|
+
title: "Überschrift 1",
|
|
1364
|
+
description: "Große Abschnittsüberschrift",
|
|
1365
|
+
keywords: ["überschrift", "heading", "h1", "titel", "1", "header"],
|
|
1366
|
+
},
|
|
1367
|
+
heading2: {
|
|
1368
|
+
title: "Überschrift 2",
|
|
1369
|
+
description: "Mittlere Abschnittsüberschrift",
|
|
1370
|
+
keywords: ["überschrift", "heading", "h2", "titel", "2", "header"],
|
|
1371
|
+
},
|
|
1372
|
+
heading3: {
|
|
1373
|
+
title: "Überschrift 3",
|
|
1374
|
+
description: "Kleine Abschnittsüberschrift",
|
|
1375
|
+
keywords: ["überschrift", "heading", "h3", "titel", "3", "header"],
|
|
1376
|
+
},
|
|
1377
|
+
bulletList: {
|
|
1378
|
+
title: "Aufzählungsliste",
|
|
1379
|
+
description: "Eine Aufzählungsliste erstellen",
|
|
1380
|
+
keywords: ["aufzählung", "liste", "bullet", "ul", "unordered"],
|
|
1381
|
+
},
|
|
1382
|
+
orderedList: {
|
|
1383
|
+
title: "Nummerierte Liste",
|
|
1384
|
+
description: "Eine nummerierte Liste erstellen",
|
|
1385
|
+
keywords: ["nummeriert", "liste", "ordered", "ol", "zahlen"],
|
|
1386
|
+
},
|
|
1387
|
+
blockquote: {
|
|
1388
|
+
title: "Zitatblock",
|
|
1389
|
+
description: "Einen Zitatblock hinzufügen",
|
|
1390
|
+
keywords: ["zitat", "blockquote", "quote", "citation"],
|
|
1391
|
+
},
|
|
1392
|
+
code: {
|
|
1393
|
+
title: "Codeblock",
|
|
1394
|
+
description: "Einen Codeblock hinzufügen",
|
|
1395
|
+
keywords: ["code", "codeblock", "pre", "programmierung"],
|
|
1396
|
+
},
|
|
1397
|
+
image: {
|
|
1398
|
+
title: "Bild",
|
|
1399
|
+
description: "Ein Bild einfügen",
|
|
1400
|
+
keywords: ["bild", "image", "foto", "photo", "picture", "img"],
|
|
1401
|
+
},
|
|
1402
|
+
horizontalRule: {
|
|
1403
|
+
title: "Horizontale Linie",
|
|
1404
|
+
description: "Eine horizontale Trennlinie hinzufügen",
|
|
1405
|
+
keywords: ["linie", "horizontal", "rule", "hr", "trennlinie", "separator"],
|
|
1406
|
+
},
|
|
1407
|
+
table: {
|
|
1408
|
+
title: "Tabelle",
|
|
1409
|
+
description: "Eine Tabelle einfügen",
|
|
1410
|
+
keywords: ["tabelle", "table", "grid", "raster", "daten", "zeilen", "spalten"],
|
|
1411
|
+
},
|
|
1412
|
+
},
|
|
1413
|
+
table: {
|
|
1414
|
+
addRowBefore: "Zeile davor einfügen",
|
|
1415
|
+
addRowAfter: "Zeile danach einfügen",
|
|
1416
|
+
deleteRow: "Zeile löschen",
|
|
1417
|
+
addColumnBefore: "Spalte davor einfügen",
|
|
1418
|
+
addColumnAfter: "Spalte danach einfügen",
|
|
1419
|
+
deleteColumn: "Spalte löschen",
|
|
1420
|
+
deleteTable: "Tabelle löschen",
|
|
1421
|
+
toggleHeaderRow: "Kopfzeile umschalten",
|
|
1422
|
+
toggleHeaderColumn: "Kopfspalte umschalten",
|
|
1423
|
+
mergeCells: "Zellen verbinden",
|
|
1424
|
+
splitCell: "Zelle teilen",
|
|
1425
|
+
},
|
|
1426
|
+
imageUpload: {
|
|
1427
|
+
selectImage: "Bild auswählen",
|
|
1428
|
+
loadError: "Fehler beim Laden des Bildes",
|
|
1429
|
+
uploadingImage: "Bild wird hochgeladen...",
|
|
1430
|
+
uploadProgress: "Upload-Fortschritt",
|
|
1431
|
+
uploadError: "Upload-Fehler",
|
|
1432
|
+
uploadSuccess: "Upload erfolgreich",
|
|
1433
|
+
imageTooLarge: "Bild ist zu groß",
|
|
1434
|
+
invalidFileType: "Ungültiger Dateityp",
|
|
1435
|
+
dragDropText: "Bilder hierher ziehen und ablegen",
|
|
1436
|
+
changeImage: "Bild ändern",
|
|
1437
|
+
downloadImage: "Bild herunterladen",
|
|
1438
|
+
deleteImage: "Bild löschen",
|
|
1439
|
+
resizeSmall: "Klein",
|
|
1440
|
+
resizeMedium: "Mittel",
|
|
1441
|
+
resizeLarge: "Groß",
|
|
1442
|
+
resizeOriginal: "Originalgröße",
|
|
1443
|
+
alignLeft: "Links ausrichten",
|
|
1444
|
+
alignCenter: "Zentrieren",
|
|
1445
|
+
alignRight: "Rechts ausrichten",
|
|
1446
|
+
resizing: "Größe wird angepasst...",
|
|
1447
|
+
compressing: "Bild wird komprimiert...",
|
|
1448
|
+
compressionError: "Fehler bei der Komprimierung",
|
|
1449
|
+
validating: "Datei wird geprüft...",
|
|
1450
|
+
uploadingToServer: "Upload zum Server...",
|
|
1451
|
+
replacingImage: "Bild wird ersetzt...",
|
|
1452
|
+
insertingImage: "Bild wird in den Editor eingefügt...",
|
|
1453
|
+
noFileSelected: "Keine Bilddatei ausgewählt",
|
|
1454
|
+
selectionCancelled: "Auswahl abgebrochen",
|
|
1455
|
+
},
|
|
1456
|
+
editor: {
|
|
1457
|
+
placeholder: "Beginne zu schreiben...",
|
|
1458
|
+
character: "Zeichen",
|
|
1459
|
+
characterPlural: "Zeichen",
|
|
1460
|
+
word: "Wort",
|
|
1461
|
+
wordPlural: "Wörter",
|
|
1462
|
+
linkPrompt: "Link-URL eingeben",
|
|
1463
|
+
linkUrlPrompt: "URL eingeben",
|
|
1464
|
+
confirmDelete: "Möchtest du dies wirklich löschen?",
|
|
1465
|
+
toggleEdit: "In den Bearbeitungsmodus wechseln",
|
|
1466
|
+
viewMode: "In den Ansichtsmodus wechseln",
|
|
1467
|
+
blockAdd: "Klicken, um einen Block hinzuzufügen",
|
|
1468
|
+
blockDrag: "Ziehen, um diesen Block zu verschieben",
|
|
1469
|
+
tableOfContents: "Inhaltsverzeichnis",
|
|
1470
|
+
},
|
|
1471
|
+
common: {
|
|
1472
|
+
cancel: "Abbrechen",
|
|
1473
|
+
confirm: "Bestätigen",
|
|
1474
|
+
apply: "Anwenden",
|
|
1475
|
+
delete: "Löschen",
|
|
1476
|
+
save: "Speichern",
|
|
1477
|
+
close: "Schließen",
|
|
1478
|
+
loading: "Lädt",
|
|
1479
|
+
error: "Fehler",
|
|
1480
|
+
success: "Erfolg",
|
|
1481
|
+
},
|
|
1482
|
+
export: {
|
|
1483
|
+
export: "Exportieren",
|
|
1484
|
+
html: "HTML",
|
|
1485
|
+
markdown: "Markdown",
|
|
1486
|
+
text: "Nur Text",
|
|
1487
|
+
copyHtml: "Als HTML kopieren",
|
|
1488
|
+
copyMarkdown: "Als Markdown kopieren",
|
|
1489
|
+
copyText: "Als reinen Text kopieren",
|
|
1490
|
+
downloadHtml: ".html herunterladen",
|
|
1491
|
+
downloadMarkdown: ".md herunterladen",
|
|
1492
|
+
downloadText: ".txt herunterladen",
|
|
1493
|
+
copiedSuccess: "In die Zwischenablage kopiert!",
|
|
1494
|
+
},
|
|
1495
|
+
};
|
|
1496
|
+
|
|
1299
1497
|
class AteI18nService {
|
|
1300
1498
|
constructor() {
|
|
1301
1499
|
this._currentLocale = signal("en");
|
|
1302
1500
|
this._translations = signal({
|
|
1303
1501
|
en: ENGLISH_TRANSLATIONS,
|
|
1304
1502
|
fr: FRENCH_TRANSLATIONS,
|
|
1503
|
+
de: GERMAN_TRANSLATIONS,
|
|
1305
1504
|
});
|
|
1306
1505
|
// Public signals
|
|
1307
1506
|
this.currentLocale = this._currentLocale.asReadonly();
|
|
1308
1507
|
/** All loaded translations (useful for dynamic key access) */
|
|
1309
1508
|
this.allTranslations = this._translations.asReadonly();
|
|
1310
|
-
this.translations = computed(() => this._translations()[this._currentLocale()]);
|
|
1509
|
+
this.translations = computed(() => this._translations()[this._currentLocale()] ?? this._translations().en);
|
|
1311
1510
|
// Fast translation methods
|
|
1312
1511
|
this.t = computed(() => this.translations());
|
|
1313
1512
|
this.toolbar = computed(() => this.translations().toolbar);
|
|
@@ -1516,7 +1715,7 @@ class AteImageService {
|
|
|
1516
1715
|
// Detect if it's base64 or remote URL
|
|
1517
1716
|
if (src.startsWith("data:") ||
|
|
1518
1717
|
src.startsWith("blob:") ||
|
|
1519
|
-
src.startsWith(window.location.origin)) {
|
|
1718
|
+
(typeof window !== "undefined" && src.startsWith(window.location.origin))) {
|
|
1520
1719
|
const link = document.createElement("a");
|
|
1521
1720
|
link.href = src;
|
|
1522
1721
|
link.download = fileName;
|
|
@@ -3723,7 +3922,7 @@ class AteBaseBubbleMenu {
|
|
|
3723
3922
|
if (this.updateTimeout) {
|
|
3724
3923
|
clearTimeout(this.updateTimeout);
|
|
3725
3924
|
}
|
|
3726
|
-
this.updateTimeout =
|
|
3925
|
+
this.updateTimeout = setTimeout(() => {
|
|
3727
3926
|
const ed = this.editor();
|
|
3728
3927
|
if (!ed) {
|
|
3729
3928
|
return;
|
|
@@ -3862,7 +4061,7 @@ class AteBaseBubbleMenu {
|
|
|
3862
4061
|
return new DOMRect(-9999, -9999, 0, 0);
|
|
3863
4062
|
}
|
|
3864
4063
|
// 1. Try native selection for multi-line accuracy
|
|
3865
|
-
const selection = window.getSelection();
|
|
4064
|
+
const selection = typeof window !== "undefined" ? window.getSelection() : null;
|
|
3866
4065
|
if (selection && selection.rangeCount > 0) {
|
|
3867
4066
|
const range = selection.getRangeAt(0);
|
|
3868
4067
|
const rect = range.getBoundingClientRect();
|
|
@@ -5100,7 +5299,7 @@ class AteLinkBubbleMenuComponent extends AteBaseSubBubbleMenu {
|
|
|
5100
5299
|
/* ignore */
|
|
5101
5300
|
}
|
|
5102
5301
|
// Use native selection for multi-line accuracy
|
|
5103
|
-
const selection = window.getSelection();
|
|
5302
|
+
const selection = typeof window !== "undefined" ? window.getSelection() : null;
|
|
5104
5303
|
if (selection && selection.rangeCount > 0) {
|
|
5105
5304
|
const range = selection.getRangeAt(0);
|
|
5106
5305
|
const rect = range.getBoundingClientRect();
|
|
@@ -5353,7 +5552,7 @@ class AteColorBubbleMenuComponent extends AteBaseSubBubbleMenu {
|
|
|
5353
5552
|
/* ignore */
|
|
5354
5553
|
}
|
|
5355
5554
|
// Use native selection for multi-line accuracy
|
|
5356
|
-
const selection = window.getSelection();
|
|
5555
|
+
const selection = typeof window !== "undefined" ? window.getSelection() : null;
|
|
5357
5556
|
if (selection && selection.rangeCount > 0) {
|
|
5358
5557
|
const range = selection.getRangeAt(0);
|
|
5359
5558
|
const rect = range.getBoundingClientRect();
|
|
@@ -5931,7 +6130,7 @@ class AteSlashCommandsComponent {
|
|
|
5931
6130
|
catch (error) {
|
|
5932
6131
|
console.warn("Error calculating coordinates:", error);
|
|
5933
6132
|
// Fallback to window.getSelection
|
|
5934
|
-
const selection = window.getSelection();
|
|
6133
|
+
const selection = typeof window !== "undefined" ? window.getSelection() : null;
|
|
5935
6134
|
if (!selection || selection.rangeCount === 0) {
|
|
5936
6135
|
return new DOMRect(-9999, -9999, 0, 0);
|
|
5937
6136
|
}
|
|
@@ -6110,7 +6309,7 @@ class AteBlockControlsComponent {
|
|
|
6110
6309
|
}
|
|
6111
6310
|
ngOnDestroy() {
|
|
6112
6311
|
if (this.updateTimeout) {
|
|
6113
|
-
|
|
6312
|
+
clearTimeout(this.updateTimeout);
|
|
6114
6313
|
}
|
|
6115
6314
|
if (this.tippyInstance) {
|
|
6116
6315
|
this.tippyInstance.destroy();
|
|
@@ -6152,10 +6351,10 @@ class AteBlockControlsComponent {
|
|
|
6152
6351
|
}
|
|
6153
6352
|
updateMenu(show) {
|
|
6154
6353
|
if (this.updateTimeout) {
|
|
6155
|
-
|
|
6354
|
+
clearTimeout(this.updateTimeout);
|
|
6156
6355
|
}
|
|
6157
6356
|
const delay = show ? 0 : 400;
|
|
6158
|
-
this.updateTimeout =
|
|
6357
|
+
this.updateTimeout = setTimeout(() => {
|
|
6159
6358
|
if (show) {
|
|
6160
6359
|
this.showTippy();
|
|
6161
6360
|
}
|
|
@@ -7663,7 +7862,7 @@ const AteBlockControlsExtension = Extension.create({
|
|
|
7663
7862
|
lastMouseX = event.clientX;
|
|
7664
7863
|
lastMouseY = event.clientY;
|
|
7665
7864
|
if (rafId === null) {
|
|
7666
|
-
rafId =
|
|
7865
|
+
rafId = requestAnimationFrame(() => {
|
|
7667
7866
|
update(view);
|
|
7668
7867
|
rafId = null;
|
|
7669
7868
|
});
|
|
@@ -7672,7 +7871,7 @@ const AteBlockControlsExtension = Extension.create({
|
|
|
7672
7871
|
},
|
|
7673
7872
|
mouseleave: () => {
|
|
7674
7873
|
if (rafId) {
|
|
7675
|
-
|
|
7874
|
+
cancelAnimationFrame(rafId);
|
|
7676
7875
|
rafId = null;
|
|
7677
7876
|
}
|
|
7678
7877
|
reset();
|
|
@@ -8522,7 +8721,11 @@ class AngularTiptapEditorComponent {
|
|
|
8522
8721
|
[class.limit-reached]="finalMaxCharacters() && characterCount() >= finalMaxCharacters()!">
|
|
8523
8722
|
@if (finalShowCharacterCount()) {
|
|
8524
8723
|
{{ characterCount() }}
|
|
8525
|
-
{{
|
|
8724
|
+
{{
|
|
8725
|
+
characterCount() > 1
|
|
8726
|
+
? currentTranslations().editor.characterPlural
|
|
8727
|
+
: currentTranslations().editor.character
|
|
8728
|
+
}}
|
|
8526
8729
|
@if (finalMaxCharacters()) {
|
|
8527
8730
|
/ {{ finalMaxCharacters() }}
|
|
8528
8731
|
}
|
|
@@ -8534,12 +8737,16 @@ class AngularTiptapEditorComponent {
|
|
|
8534
8737
|
|
|
8535
8738
|
@if (finalShowWordCount()) {
|
|
8536
8739
|
{{ wordCount() }}
|
|
8537
|
-
{{
|
|
8740
|
+
{{
|
|
8741
|
+
wordCount() > 1
|
|
8742
|
+
? currentTranslations().editor.wordPlural
|
|
8743
|
+
: currentTranslations().editor.word
|
|
8744
|
+
}}
|
|
8538
8745
|
}
|
|
8539
8746
|
</div>
|
|
8540
8747
|
}
|
|
8541
8748
|
</div>
|
|
8542
|
-
`, isInline: true, styles: [":host{--ate-primary: #2563eb;--ate-primary-hover: #153ca9;--ate-primary-contrast: #ffffff;--ate-primary-light: color-mix(in srgb, var(--ate-primary), transparent 90%);--ate-primary-lighter: color-mix(in srgb, var(--ate-primary), transparent 95%);--ate-primary-light-alpha: color-mix(in srgb, var(--ate-primary), transparent 85%);--ate-surface: #ffffff;--ate-surface-secondary: #f8f9fa;--ate-surface-tertiary: #f1f5f9;--ate-text: #2d3748;--ate-text-secondary: #64748b;--ate-text-muted: #a0aec0;--ate-border: #e2e8f0;--ate-highlight-bg: #fef08a;--ate-highlight-color: #854d0e;--ate-button-hover: #f1f5f9;--ate-button-active: #e2e8f0;--ate-selection-bg: var(--ate-primary-light-alpha);--ate-error-color: #c53030;--ate-error-bg: #fed7d7;--ate-error-border: #feb2b2;--ate-border-color: var(--ate-border);--ate-border-width: 2px;--ate-border-radius: 12px;--ate-focus-color: var(--ate-primary);--ate-background: var(--ate-surface);--ate-sub-border-radius: 8px;--ate-text-color: var(--ate-text);--ate-placeholder-color: var(--ate-text-muted);--ate-line-height: 1.6;--ate-content-padding-block: 16px;--ate-content-padding-inline: 16px;--ate-content-gutter: 0px;--ate-menu-bg: var(--ate-surface);--ate-menu-border-radius: var(--ate-border-radius);--ate-menu-border: var(--ate-border);--ate-menu-shadow: 0 10px 15px -3px rgba(0, 0, 0, .1), 0 4px 6px -2px rgba(0, 0, 0, .05);--ate-menu-padding: 4px;--ate-menu-gap: 2px;--ate-toolbar-padding: var(--ate-menu-padding);--ate-toolbar-gap: var(--ate-menu-gap);--ate-toolbar-background: var(--ate-surface-secondary);--ate-toolbar-border-color: var(--ate-border);--ate-toolbar-button-color: var(--ate-text-secondary);--ate-toolbar-button-hover-background: transparent;--ate-toolbar-button-active-background: var(--ate-primary-light);--ate-toolbar-button-active-color: var(--ate-primary);--ate-counter-color: var(--ate-text-secondary);--ate-counter-background: var(--ate-surface-secondary);--ate-counter-border-color: var(--ate-border);--ate-drag-background: #f0f8ff;--ate-drag-border-color: var(--ate-primary);--ate-blockquote-border-color: var(--ate-border);--ate-blockquote-background: var(--ate-surface-secondary);--ate-code-background: var(--ate-surface-secondary);--ate-code-color: var(--ate-text);--ate-code-border-color: var(--ate-border);--ate-code-block-background: #0f172a;--ate-code-block-color: #e2e8f0;--ate-code-block-border-color: var(--ate-border);--ate-image-border-radius: 16px;--ate-image-selected-color: var(--ate-primary);--ate-scrollbar-width: 10px;--ate-scrollbar-thumb: var(--ate-border);--ate-scrollbar-thumb-hover: var(--ate-text-muted);--ate-scrollbar-track: transparent;--ate-table-border-color: var(--ate-border);--ate-table-header-background: var(--ate-surface-secondary);--ate-table-header-color: var(--ate-text);--ate-table-cell-background: var(--ate-surface);--ate-table-cell-selected-background: var(--ate-primary-light);--ate-table-resize-handle-color: var(--ate-primary);--ate-table-row-hover-background: var(--ate-primary-lighter);--ate-tooltip-bg: var(--ate-code-block-background, #0f172a);--ate-tooltip-color: var(--ate-code-block-color, #e2e8f0)}:host(.dark),:host([data-theme=\"dark\"]){--ate-primary: #3b82f6;--ate-primary-contrast: #ffffff;--ate-primary-light: color-mix(in srgb, var(--ate-primary), transparent 85%);--ate-primary-lighter: color-mix(in srgb, var(--ate-primary), transparent 92%);--ate-primary-light-alpha: color-mix(in srgb, var(--ate-primary), transparent 80%);--ate-surface: #020617;--ate-surface-secondary: #0f172a;--ate-surface-tertiary: #1e293b;--ate-text: #f8fafc;--ate-text-secondary: #94a3b8;--ate-text-muted: #64748b;--ate-border: #1e293b;--ate-highlight-bg: #854d0e;--ate-highlight-color: #fef08a;--ate-button-hover: #1e293b;--ate-button-active: #0f172a;--ate-menu-border: rgba(255, 255, 255, .1);--ate-menu-shadow: 0 20px 25px -5px rgba(0, 0, 0, .3), 0 10px 10px -5px rgba(0, 0, 0, .2);--ate-error-color: #f87171;--ate-error-bg: #450a0a;--ate-error-border: #7f1d1d;--ate-drag-background: var(--ate-surface-tertiary);--ate-drag-border-color: var(--ate-primary);--ate-blockquote-border-color: var(--ate-primary);--ate-toolbar-button-active-background: var(--ate-primary-light);--ate-toolbar-button-active-color: var(--ate-primary);--ate-button-hover: var(--ate-surface-tertiary);--ate-button-active: var(--ate-surface-secondary);--ate-scrollbar-thumb: var(--ate-surface-tertiary);--ate-scrollbar-thumb-hover: var(--ate-text-muted)}:host(.fill-container){display:block;height:100%}.ate-editor{border:var(--ate-border-width) solid var(--ate-border-color);border-radius:var(--ate-border-radius);background:var(--ate-background);overflow:visible;transition:border-color .2s ease;position:relative}:host(.floating-toolbar) .ate-editor{overflow:visible}:host(.fill-container) .ate-editor{display:flex;flex-direction:column;height:100%}:host(.fill-container) .ate-content-wrapper{flex:1;min-height:0}:host(.fill-container) .ate-content{flex:1;min-height:0;overflow-y:auto}.ate-editor:focus-within{border-color:var(--ate-focus-color)}.ate-content{min-height:var(--editor-min-height, 200px);height:var(--editor-height, auto);max-height:var(--editor-max-height, none);overflow-y:var(--editor-overflow, visible);outline:none;position:relative;scrollbar-width:thin;scrollbar-color:var(--ate-scrollbar-thumb) var(--ate-scrollbar-track)}:host(.is-disabled) .ate-content{cursor:not-allowed;opacity:.7;-webkit-user-select:none;user-select:none;pointer-events:none;background-color:var(--ate-surface-tertiary)}:host(.is-readonly) .ate-content{cursor:default;-webkit-user-select:text;user-select:text}:host(.is-readonly) .ate-content ::ng-deep .ate-link{cursor:pointer;pointer-events:auto}.ate-content::-webkit-scrollbar{width:var(--ate-scrollbar-width)}.ate-content-wrapper{position:relative;display:flex;flex-direction:column;min-height:0}.ate-content-wrapper .ate-content{flex:1}.ate-content::-webkit-scrollbar-track{background:var(--ate-scrollbar-track)}.ate-content::-webkit-scrollbar-thumb{background:var(--ate-scrollbar-thumb);border:3px solid transparent;background-clip:content-box;border-radius:10px}.ate-content::-webkit-scrollbar-thumb:hover{background:var(--ate-scrollbar-thumb-hover);background-clip:content-box}.ate-content.drag-over{background:var(--ate-drag-background);border:2px dashed var(--ate-drag-border-color)}.character-count{padding:6px 8px;font-size:12px;color:var(--ate-counter-color);text-align:right;border-top:1px solid var(--ate-counter-border-color);background:var(--ate-counter-background);transition:color .2s ease;border-bottom-left-radius:calc(var(--ate-border-radius) - var(--ate-border-width));border-bottom-right-radius:calc(var(--ate-border-radius) - var(--ate-border-width))}.character-count.limit-reached{color:var(--ate-error-color, #ef4444);font-weight:600}:host.ate-blocks-inside{--ate-content-gutter: 54px}@media (max-width: 768px){:host.ate-blocks-inside{--ate-content-gutter: 0px}ate-block-controls{display:none!important}}:host ::ng-deep .ProseMirror{padding-inline:calc(var(--ate-content-padding-inline) + var(--ate-content-gutter));padding-block:var(--ate-content-padding-block);outline:none;line-height:var(--ate-line-height);color:var(--ate-text-color);min-height:100%;height:100%;word-wrap:break-word;overflow-wrap:break-word}:host ::ng-deep .ProseMirror ::selection{background-color:var(--ate-selection-bg);color:inherit}:host ::ng-deep .ProseMirror ::-moz-selection{background-color:var(--ate-selection-bg);color:inherit}:host ::ng-deep .ProseMirror h1{font-size:2em;font-weight:700;margin-top:0;margin-bottom:.5em}:host ::ng-deep .ProseMirror h2{font-size:1.5em;font-weight:700;margin-top:1em;margin-bottom:.5em}:host ::ng-deep .ProseMirror h3{font-size:1.25em;font-weight:700;margin-top:1em;margin-bottom:.5em}:host ::ng-deep .ProseMirror p{margin:.5em 0}:host ::ng-deep .ProseMirror ul,:host ::ng-deep .ProseMirror ol{padding-left:2em;margin:.5em 0}:host ::ng-deep .ProseMirror blockquote{border-left:4px solid var(--ate-blockquote-border-color);margin:1em 0;background:var(--ate-blockquote-background);padding:.5em 1em;border-radius:0 4px 4px 0}:host ::ng-deep .ProseMirror code{background:var(--ate-code-background);color:var(--ate-code-color);border:1px solid var(--ate-code-border-color);padding:.15em .4em;border-radius:4px;font-family:JetBrains Mono,Fira Code,Monaco,Consolas,monospace;font-size:.85em;font-weight:500}:host ::ng-deep .ProseMirror pre{background:var(--ate-code-block-background);color:var(--ate-code-block-color);border:1px solid var(--ate-code-block-border-color);padding:1em;border-radius:var(--ate-border-radius);overflow-x:auto;margin:1em 0}:host ::ng-deep .ProseMirror pre code{background:none;color:inherit;border:none;padding:0}:host ::ng-deep .ProseMirror p.is-editor-empty:first-child:before{content:attr(data-placeholder);color:var(--ate-placeholder-color);pointer-events:none;float:left;height:0}:host ::ng-deep .ProseMirror[contenteditable=false] img{cursor:pointer}:host ::ng-deep .ProseMirror[contenteditable=false] a{cursor:pointer}:host ::ng-deep .ProseMirror[contenteditable=false] img:hover{transform:none;box-shadow:0 2px 8px #0000001a}:host ::ng-deep .ProseMirror[contenteditable=false] img.ProseMirror-selectednode{outline:none}:host ::ng-deep .ProseMirror img{position:relative;display:inline-block;max-width:100%;height:auto;cursor:pointer;transition:all .2s ease;border:2px solid transparent;border-radius:var(--ate-image-border-radius)}:host ::ng-deep .ProseMirror img:hover{border-color:var(--ate-border-color);box-shadow:0 2px 4px #0000001a}:host ::ng-deep .ProseMirror img.ProseMirror-selectednode,:host ::ng-deep .resizable-image-container.selected img{border-color:var(--ate-image-selected-color);transition:all .2s ease}:host ::ng-deep .ProseMirror [data-text-align=center],:host ::ng-deep .ProseMirror [data-align=center]{text-align:center}:host ::ng-deep .ProseMirror [data-text-align=right],:host ::ng-deep .ProseMirror [data-align=right]{text-align:right}:host ::ng-deep .ProseMirror [data-text-align=left],:host ::ng-deep .ProseMirror [data-align=left]{text-align:left}:host ::ng-deep .resizable-image-wrapper{display:block;width:100%;margin:.5em 0}:host ::ng-deep .resizable-image-container{position:relative;display:inline-block;max-width:100%}:host ::ng-deep .resize-controls{position:absolute;inset:0;pointer-events:none;z-index:1000;opacity:0;transition:opacity .2s ease}:host:not(.is-readonly):not(.is-disabled) ::ng-deep .resizable-image-container:hover .resize-controls,:host:not(.is-readonly):not(.is-disabled) ::ng-deep body.resizing .resize-controls{opacity:1}:host ::ng-deep .resize-handle{position:absolute;width:.35rem;height:2rem;background:var(--ate-primary);border:2px solid var(--ate-surface);border-radius:var(--ate-border-radius);pointer-events:all;cursor:pointer;z-index:1001;transition:all .15s ease;box-shadow:0 2px 6px #0003}:host ::ng-deep .resize-handle:hover{background:var(--ate-primary);box-shadow:0 3px 8px #0000004d}:host ::ng-deep .resize-handle:active{background:var(--ate-primary)}:host ::ng-deep .resize-handle-w:hover,:host ::ng-deep .resize-handle-e:hover{background:var(--ate-primary-hover)}:host ::ng-deep .resize-handle-w:active,:host ::ng-deep .resize-handle-e:active{transform:translateY(-50%) scale(.9);background:var(--ate-primary-hover)}:host ::ng-deep .resize-handle-w{top:50%;left:.35rem;transform:translateY(-50%);cursor:w-resize}:host ::ng-deep .resize-handle-e{top:50%;right:.35rem;transform:translateY(-50%);cursor:e-resize}:host ::ng-deep body.resizing{-webkit-user-select:none;user-select:none;cursor:crosshair}:host ::ng-deep body.resizing .ProseMirror{pointer-events:none}:host ::ng-deep body.resizing .ProseMirror .resizable-image-container{pointer-events:none}:host ::ng-deep .image-size-info{position:absolute;bottom:-20px;left:50%;transform:translate(-50%);background:#000c;color:#fff;padding:2px 6px;border-radius:3px;font-size:11px;white-space:nowrap;opacity:0;transition:opacity .2s ease}:host ::ng-deep .resizable-image-container:hover .image-size-info{opacity:1}:host ::ng-deep .ProseMirror table{border-collapse:separate;border-spacing:0;margin:0;table-layout:fixed;width:100%;border-radius:8px;overflow:hidden}:host ::ng-deep .ProseMirror table td,:host ::ng-deep .ProseMirror table th{border:none;border-right:1px solid var(--ate-table-border-color);border-bottom:1px solid var(--ate-table-border-color);box-sizing:border-box;min-width:1em;padding:8px 12px;position:relative;vertical-align:top;text-align:left}:host ::ng-deep .ProseMirror table td{background:var(--ate-table-cell-background)}:host ::ng-deep .ProseMirror table td:first-child,:host ::ng-deep .ProseMirror table th:first-child{border-left:1px solid var(--ate-table-border-color)}:host ::ng-deep .ProseMirror table tr:first-child td,:host ::ng-deep .ProseMirror table tr:first-child th{border-top:1px solid var(--ate-table-border-color)}:host ::ng-deep .ProseMirror table tr:first-child th:first-child{border-top-left-radius:8px}:host ::ng-deep .ProseMirror table tr:first-child th:last-child{border-top-right-radius:8px}:host ::ng-deep .ProseMirror table tr:last-child td:first-child{border-bottom-left-radius:8px}:host ::ng-deep .ProseMirror table tr:last-child td:last-child{border-bottom-right-radius:8px}:host ::ng-deep .ProseMirror table th{background:var(--ate-table-header-background);font-weight:600;color:var(--ate-table-header-color)}:host ::ng-deep .ProseMirror table .selectedCell:after{background:var(--ate-table-cell-selected-background);content:\"\";inset:0;pointer-events:none;position:absolute;z-index:2}:host ::ng-deep .ProseMirror table .column-resize-handle{position:absolute;right:-2px;top:0;bottom:0;width:4px;background-color:var(--ate-table-resize-handle-color);opacity:0;transition:opacity .2s ease}:host ::ng-deep .ProseMirror table:hover .column-resize-handle{opacity:1}:host ::ng-deep .ProseMirror table .column-resize-handle:hover{background-color:var(--ate-focus-color)}:host ::ng-deep .ProseMirror .tableWrapper{overflow-x:auto;margin:1em 0;border-radius:8px}:host ::ng-deep .ProseMirror .tableWrapper table{margin:0;border-radius:8px;min-width:600px;overflow:hidden}:host ::ng-deep .ProseMirror table p{margin:0}:host ::ng-deep .ProseMirror table tbody tr:hover td{background-color:var(--ate-table-row-hover-background)}\n"], dependencies: [{ kind: "component", type: AteToolbarComponent, selector: "ate-toolbar", inputs: ["editor", "config", "imageUpload", "floating"] }, { kind: "component", type: AteBubbleMenuComponent, selector: "ate-bubble-menu", inputs: ["config"] }, { kind: "component", type: AteImageBubbleMenuComponent, selector: "ate-image-bubble-menu", inputs: ["config", "imageUpload"] }, { kind: "component", type: AteTableBubbleMenuComponent, selector: "ate-table-bubble-menu", inputs: ["config"] }, { kind: "component", type: AteCellBubbleMenuComponent, selector: "ate-cell-bubble-menu", inputs: ["config"] }, { kind: "component", type: AteSlashCommandsComponent, selector: "ate-slash-commands", inputs: ["editor", "config"] }, { kind: "component", type: AteLinkBubbleMenuComponent, selector: "ate-link-bubble-menu" }, { kind: "component", type: AteColorBubbleMenuComponent, selector: "ate-color-bubble-menu" }, { kind: "component", type: AteEditToggleComponent, selector: "ate-edit-toggle", inputs: ["editable", "translations"], outputs: ["editToggle"] }, { kind: "component", type: AteBlockControlsComponent, selector: "ate-block-controls", inputs: ["editor", "hoveredData"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
8749
|
+
`, isInline: true, styles: [":host{--ate-primary: #2563eb;--ate-primary-hover: #153ca9;--ate-primary-contrast: #ffffff;--ate-primary-light: color-mix(in srgb, var(--ate-primary), transparent 90%);--ate-primary-lighter: color-mix(in srgb, var(--ate-primary), transparent 95%);--ate-primary-light-alpha: color-mix(in srgb, var(--ate-primary), transparent 85%);--ate-surface: #ffffff;--ate-surface-secondary: #f8f9fa;--ate-surface-tertiary: #f1f5f9;--ate-text: #2d3748;--ate-text-secondary: #64748b;--ate-text-muted: #a0aec0;--ate-border: #e2e8f0;--ate-highlight-bg: #fef08a;--ate-highlight-color: #854d0e;--ate-button-hover: #f1f5f9;--ate-button-active: #e2e8f0;--ate-selection-bg: var(--ate-primary-light-alpha);--ate-error-color: #c53030;--ate-error-bg: #fed7d7;--ate-error-border: #feb2b2;--ate-border-color: var(--ate-border);--ate-border-width: 2px;--ate-border-radius: 12px;--ate-sub-border-radius: 8px;--ate-focus-color: var(--ate-primary);--ate-background: var(--ate-surface);--ate-text-color: var(--ate-text, #2d3748);--ate-placeholder-color: var(--ate-text-muted, #a0aec0);--ate-line-height: 1.6;--ate-content-padding-block: 16px;--ate-content-padding-inline: 16px;--ate-content-gutter: 0px;--ate-menu-bg: var(--ate-surface, #ffffff);--ate-menu-border-radius: var(--ate-border-radius, 12px);--ate-menu-border: var(--ate-border, #e2e8f0);--ate-menu-shadow: 0 10px 15px -3px rgba(0, 0, 0, .1), 0 4px 6px -2px rgba(0, 0, 0, .05);--ate-menu-padding: 4px;--ate-menu-gap: 2px;--ate-toolbar-padding: var(--ate-menu-padding);--ate-toolbar-gap: var(--ate-menu-gap);--ate-toolbar-background: var(--ate-surface-secondary, #f8f9fa);--ate-toolbar-border-color: var(--ate-border, #e2e8f0);--ate-toolbar-button-color: var(--ate-text-secondary, #64748b);--ate-toolbar-button-hover-background: transparent;--ate-toolbar-button-active-background: color-mix( in srgb, var(--ate-primary, #2563eb), transparent 90% );--ate-toolbar-button-active-color: var(--ate-primary, #2563eb);--ate-counter-color: var(--ate-text-secondary, #64748b);--ate-counter-background: var(--ate-surface-secondary, #f8f9fa);--ate-counter-border-color: var(--ate-border, #e2e8f0);--ate-drag-background: #f0f8ff;--ate-drag-border-color: var(--ate-primary, #2563eb);--ate-blockquote-border-color: var(--ate-border, #e2e8f0);--ate-blockquote-background: var(--ate-surface-secondary, #f8f9fa);--ate-code-background: var(--ate-surface-secondary, #f8f9fa);--ate-code-color: var(--ate-text, #2d3748);--ate-code-border-color: var(--ate-border, #e2e8f0);--ate-code-block-background: #0f172a;--ate-code-block-color: #e2e8f0;--ate-code-block-border-color: var(--ate-border, #e2e8f0);--ate-image-border-radius: 16px;--ate-image-selected-color: var(--ate-primary, #2563eb);--ate-scrollbar-width: 10px;--ate-scrollbar-thumb: var(--ate-border, #e2e8f0);--ate-scrollbar-thumb-hover: var(--ate-text-muted, #a0aec0);--ate-scrollbar-track: transparent;--ate-table-border-color: var(--ate-border, #e2e8f0);--ate-table-header-background: var(--ate-surface-secondary, #f8f9fa);--ate-table-header-color: var(--ate-text, #2d3748);--ate-table-cell-background: var(--ate-surface, #ffffff);--ate-table-cell-selected-background: color-mix( in srgb, var(--ate-primary, #2563eb), transparent 90% );--ate-table-resize-handle-color: var(--ate-primary, #2563eb);--ate-table-row-hover-background: color-mix( in srgb, var(--ate-primary, #2563eb), transparent 95% );--ate-tooltip-bg: var(--ate-code-block-background, #0f172a);--ate-tooltip-color: var(--ate-code-block-color, #e2e8f0)}:host(.dark),:host([data-theme=\"dark\"]){--ate-primary: #3b82f6;--ate-primary-contrast: #ffffff;--ate-primary-light: color-mix(in srgb, var(--ate-primary), transparent 85%);--ate-primary-lighter: color-mix(in srgb, var(--ate-primary), transparent 92%);--ate-primary-light-alpha: color-mix(in srgb, var(--ate-primary), transparent 80%);--ate-surface: #020617;--ate-surface-secondary: #0f172a;--ate-surface-tertiary: #1e293b;--ate-text: #f8fafc;--ate-text-secondary: #94a3b8;--ate-text-muted: #64748b;--ate-border: #1e293b;--ate-highlight-bg: #854d0e;--ate-highlight-color: #fef08a;--ate-button-hover: #1e293b;--ate-button-active: #0f172a;--ate-menu-border: rgba(255, 255, 255, .1);--ate-menu-shadow: 0 20px 25px -5px rgba(0, 0, 0, .3), 0 10px 10px -5px rgba(0, 0, 0, .2);--ate-error-color: #f87171;--ate-error-bg: #450a0a;--ate-error-border: #7f1d1d;--ate-drag-background: var(--ate-surface-tertiary);--ate-drag-border-color: var(--ate-primary);--ate-blockquote-border-color: var(--ate-primary);--ate-toolbar-button-active-background: var(--ate-primary-light);--ate-toolbar-button-active-color: var(--ate-primary);--ate-button-hover: var(--ate-surface-tertiary);--ate-button-active: var(--ate-surface-secondary);--ate-scrollbar-thumb: var(--ate-surface-tertiary);--ate-scrollbar-thumb-hover: var(--ate-text-muted)}:host(.fill-container){display:block;height:100%}.ate-editor{border:var(--ate-border-width) solid var(--ate-border-color);border-radius:var(--ate-border-radius);background:var(--ate-background);overflow:visible;transition:border-color .2s ease;position:relative}:host(.floating-toolbar) .ate-editor{overflow:visible}:host(.fill-container) .ate-editor{display:flex;flex-direction:column;height:100%}:host(.fill-container) .ate-content-wrapper{flex:1;min-height:0}:host(.fill-container) .ate-content{flex:1;min-height:0;overflow-y:auto}.ate-editor:focus-within{border-color:var(--ate-focus-color)}.ate-content{min-height:var(--editor-min-height, 200px);height:var(--editor-height, auto);max-height:var(--editor-max-height, none);overflow-y:var(--editor-overflow, visible);outline:none;position:relative;scrollbar-width:thin;scrollbar-color:var(--ate-scrollbar-thumb) var(--ate-scrollbar-track)}:host(.is-disabled) .ate-content{cursor:not-allowed;opacity:.7;-webkit-user-select:none;user-select:none;pointer-events:none;background-color:var(--ate-surface-tertiary)}:host(.is-readonly) .ate-content{cursor:default;-webkit-user-select:text;user-select:text}:host(.is-readonly) .ate-content ::ng-deep .ate-link{cursor:pointer;pointer-events:auto}.ate-content::-webkit-scrollbar{width:var(--ate-scrollbar-width)}.ate-content-wrapper{position:relative;display:flex;flex-direction:column;min-height:0}.ate-content-wrapper .ate-content{flex:1}.ate-content::-webkit-scrollbar-track{background:var(--ate-scrollbar-track)}.ate-content::-webkit-scrollbar-thumb{background:var(--ate-scrollbar-thumb);border:3px solid transparent;background-clip:content-box;border-radius:10px}.ate-content::-webkit-scrollbar-thumb:hover{background:var(--ate-scrollbar-thumb-hover);background-clip:content-box}.ate-content.drag-over{background:var(--ate-drag-background);border:2px dashed var(--ate-drag-border-color)}.character-count{padding:6px 8px;font-size:12px;color:var(--ate-counter-color);text-align:right;border-top:1px solid var(--ate-counter-border-color);background:var(--ate-counter-background);transition:color .2s ease;border-bottom-left-radius:calc(var(--ate-border-radius) - var(--ate-border-width));border-bottom-right-radius:calc(var(--ate-border-radius) - var(--ate-border-width))}.character-count.limit-reached{color:var(--ate-error-color, #ef4444);font-weight:600}:host.ate-blocks-inside{--ate-content-gutter: 54px}@media (max-width: 768px){:host.ate-blocks-inside{--ate-content-gutter: 0px}ate-block-controls{display:none!important}}:host ::ng-deep .ProseMirror{padding-inline:calc(var(--ate-content-padding-inline) + var(--ate-content-gutter));padding-block:var(--ate-content-padding-block);outline:none;line-height:var(--ate-line-height);color:var(--ate-text-color);min-height:100%;height:100%;word-wrap:break-word;overflow-wrap:break-word}:host ::ng-deep .ProseMirror ::selection{background-color:var(--ate-selection-bg);color:inherit}:host ::ng-deep .ProseMirror ::-moz-selection{background-color:var(--ate-selection-bg);color:inherit}:host ::ng-deep .ProseMirror h1{font-size:2em;font-weight:700;margin-top:0;margin-bottom:.5em}:host ::ng-deep .ProseMirror h2{font-size:1.5em;font-weight:700;margin-top:1em;margin-bottom:.5em}:host ::ng-deep .ProseMirror h3{font-size:1.25em;font-weight:700;margin-top:1em;margin-bottom:.5em}:host ::ng-deep .ProseMirror p{margin:.5em 0}:host ::ng-deep .ProseMirror ul,:host ::ng-deep .ProseMirror ol{padding-left:2em;margin:.5em 0}:host ::ng-deep .ProseMirror blockquote{border-left:4px solid var(--ate-blockquote-border-color);margin:1em 0;background:var(--ate-blockquote-background);padding:.5em 1em;border-radius:0 4px 4px 0}:host ::ng-deep .ProseMirror code{background:var(--ate-code-background);color:var(--ate-code-color);border:1px solid var(--ate-code-border-color);padding:.15em .4em;border-radius:4px;font-family:JetBrains Mono,Fira Code,Monaco,Consolas,monospace;font-size:.85em;font-weight:500}:host ::ng-deep .ProseMirror pre{background:var(--ate-code-block-background);color:var(--ate-code-block-color);border:1px solid var(--ate-code-block-border-color);padding:1em;border-radius:var(--ate-border-radius);overflow-x:auto;margin:1em 0}:host ::ng-deep .ProseMirror pre code{background:none;color:inherit;border:none;padding:0}:host ::ng-deep .ProseMirror p.is-editor-empty:first-child:before{content:attr(data-placeholder);color:var(--ate-placeholder-color);pointer-events:none;float:left;height:0}:host ::ng-deep .ProseMirror[contenteditable=false] img{cursor:pointer}:host ::ng-deep .ProseMirror[contenteditable=false] a{cursor:pointer}:host ::ng-deep .ProseMirror[contenteditable=false] img:hover{transform:none;box-shadow:0 2px 8px #0000001a}:host ::ng-deep .ProseMirror[contenteditable=false] img.ProseMirror-selectednode{outline:none}:host ::ng-deep .ProseMirror img{position:relative;display:inline-block;max-width:100%;height:auto;cursor:pointer;transition:all .2s ease;border:2px solid transparent;border-radius:var(--ate-image-border-radius)}:host ::ng-deep .ProseMirror img:hover{border-color:var(--ate-border-color);box-shadow:0 2px 4px #0000001a}:host ::ng-deep .ProseMirror img.ProseMirror-selectednode,:host ::ng-deep .resizable-image-container.selected img{border-color:var(--ate-image-selected-color);transition:all .2s ease}:host ::ng-deep .ProseMirror [data-text-align=center],:host ::ng-deep .ProseMirror [data-align=center]{text-align:center}:host ::ng-deep .ProseMirror [data-text-align=right],:host ::ng-deep .ProseMirror [data-align=right]{text-align:right}:host ::ng-deep .ProseMirror [data-text-align=left],:host ::ng-deep .ProseMirror [data-align=left]{text-align:left}:host ::ng-deep .resizable-image-wrapper{display:block;width:100%;margin:.5em 0}:host ::ng-deep .resizable-image-container{position:relative;display:inline-block;max-width:100%}:host ::ng-deep .resize-controls{position:absolute;inset:0;pointer-events:none;z-index:1000;opacity:0;transition:opacity .2s ease}:host:not(.is-readonly):not(.is-disabled) ::ng-deep .resizable-image-container:hover .resize-controls,:host:not(.is-readonly):not(.is-disabled) ::ng-deep body.resizing .resize-controls{opacity:1}:host ::ng-deep .resize-handle{position:absolute;width:.35rem;height:2rem;background:var(--ate-primary);border:2px solid var(--ate-surface);border-radius:var(--ate-border-radius);pointer-events:all;cursor:pointer;z-index:1001;transition:all .15s ease;box-shadow:0 2px 6px #0003}:host ::ng-deep .resize-handle:hover{background:var(--ate-primary);box-shadow:0 3px 8px #0000004d}:host ::ng-deep .resize-handle:active{background:var(--ate-primary)}:host ::ng-deep .resize-handle-w:hover,:host ::ng-deep .resize-handle-e:hover{background:var(--ate-primary-hover)}:host ::ng-deep .resize-handle-w:active,:host ::ng-deep .resize-handle-e:active{transform:translateY(-50%) scale(.9);background:var(--ate-primary-hover)}:host ::ng-deep .resize-handle-w{top:50%;left:.35rem;transform:translateY(-50%);cursor:w-resize}:host ::ng-deep .resize-handle-e{top:50%;right:.35rem;transform:translateY(-50%);cursor:e-resize}:host ::ng-deep body.resizing{-webkit-user-select:none;user-select:none;cursor:crosshair}:host ::ng-deep body.resizing .ProseMirror{pointer-events:none}:host ::ng-deep body.resizing .ProseMirror .resizable-image-container{pointer-events:none}:host ::ng-deep .image-size-info{position:absolute;bottom:-20px;left:50%;transform:translate(-50%);background:#000c;color:#fff;padding:2px 6px;border-radius:3px;font-size:11px;white-space:nowrap;opacity:0;transition:opacity .2s ease}:host ::ng-deep .resizable-image-container:hover .image-size-info{opacity:1}:host ::ng-deep .ProseMirror table{border-collapse:separate;border-spacing:0;margin:0;table-layout:fixed;width:100%;border-radius:8px;overflow:hidden}:host ::ng-deep .ProseMirror table td,:host ::ng-deep .ProseMirror table th{border:none;border-right:1px solid var(--ate-table-border-color);border-bottom:1px solid var(--ate-table-border-color);box-sizing:border-box;min-width:1em;padding:8px 12px;position:relative;vertical-align:top;text-align:left}:host ::ng-deep .ProseMirror table td{background:var(--ate-table-cell-background)}:host ::ng-deep .ProseMirror table td:first-child,:host ::ng-deep .ProseMirror table th:first-child{border-left:1px solid var(--ate-table-border-color)}:host ::ng-deep .ProseMirror table tr:first-child td,:host ::ng-deep .ProseMirror table tr:first-child th{border-top:1px solid var(--ate-table-border-color)}:host ::ng-deep .ProseMirror table tr:first-child th:first-child{border-top-left-radius:8px}:host ::ng-deep .ProseMirror table tr:first-child th:last-child{border-top-right-radius:8px}:host ::ng-deep .ProseMirror table tr:last-child td:first-child{border-bottom-left-radius:8px}:host ::ng-deep .ProseMirror table tr:last-child td:last-child{border-bottom-right-radius:8px}:host ::ng-deep .ProseMirror table th{background:var(--ate-table-header-background);font-weight:600;color:var(--ate-table-header-color)}:host ::ng-deep .ProseMirror table .selectedCell:after{background:var(--ate-table-cell-selected-background);content:\"\";inset:0;pointer-events:none;position:absolute;z-index:2}:host ::ng-deep .ProseMirror table .column-resize-handle{position:absolute;right:-2px;top:0;bottom:0;width:4px;background-color:var(--ate-table-resize-handle-color);opacity:0;transition:opacity .2s ease}:host ::ng-deep .ProseMirror table:hover .column-resize-handle{opacity:1}:host ::ng-deep .ProseMirror table .column-resize-handle:hover{background-color:var(--ate-focus-color)}:host ::ng-deep .ProseMirror .tableWrapper{overflow-x:auto;margin:1em 0;border-radius:8px}:host ::ng-deep .ProseMirror .tableWrapper table{margin:0;border-radius:8px;min-width:600px;overflow:hidden}:host ::ng-deep .ProseMirror table p{margin:0}:host ::ng-deep .ProseMirror table tbody tr:hover td{background-color:var(--ate-table-row-hover-background)}\n"], dependencies: [{ kind: "component", type: AteToolbarComponent, selector: "ate-toolbar", inputs: ["editor", "config", "imageUpload", "floating"] }, { kind: "component", type: AteBubbleMenuComponent, selector: "ate-bubble-menu", inputs: ["config"] }, { kind: "component", type: AteImageBubbleMenuComponent, selector: "ate-image-bubble-menu", inputs: ["config", "imageUpload"] }, { kind: "component", type: AteTableBubbleMenuComponent, selector: "ate-table-bubble-menu", inputs: ["config"] }, { kind: "component", type: AteCellBubbleMenuComponent, selector: "ate-cell-bubble-menu", inputs: ["config"] }, { kind: "component", type: AteSlashCommandsComponent, selector: "ate-slash-commands", inputs: ["editor", "config"] }, { kind: "component", type: AteLinkBubbleMenuComponent, selector: "ate-link-bubble-menu" }, { kind: "component", type: AteColorBubbleMenuComponent, selector: "ate-color-bubble-menu" }, { kind: "component", type: AteEditToggleComponent, selector: "ate-edit-toggle", inputs: ["editable", "translations"], outputs: ["editToggle"] }, { kind: "component", type: AteBlockControlsComponent, selector: "ate-block-controls", inputs: ["editor", "hoveredData"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
8543
8750
|
}
|
|
8544
8751
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: AngularTiptapEditorComponent, decorators: [{
|
|
8545
8752
|
type: Component,
|
|
@@ -8683,7 +8890,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
|
|
|
8683
8890
|
[class.limit-reached]="finalMaxCharacters() && characterCount() >= finalMaxCharacters()!">
|
|
8684
8891
|
@if (finalShowCharacterCount()) {
|
|
8685
8892
|
{{ characterCount() }}
|
|
8686
|
-
{{
|
|
8893
|
+
{{
|
|
8894
|
+
characterCount() > 1
|
|
8895
|
+
? currentTranslations().editor.characterPlural
|
|
8896
|
+
: currentTranslations().editor.character
|
|
8897
|
+
}}
|
|
8687
8898
|
@if (finalMaxCharacters()) {
|
|
8688
8899
|
/ {{ finalMaxCharacters() }}
|
|
8689
8900
|
}
|
|
@@ -8695,14 +8906,372 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
|
|
|
8695
8906
|
|
|
8696
8907
|
@if (finalShowWordCount()) {
|
|
8697
8908
|
{{ wordCount() }}
|
|
8698
|
-
{{
|
|
8909
|
+
{{
|
|
8910
|
+
wordCount() > 1
|
|
8911
|
+
? currentTranslations().editor.wordPlural
|
|
8912
|
+
: currentTranslations().editor.word
|
|
8913
|
+
}}
|
|
8699
8914
|
}
|
|
8700
8915
|
</div>
|
|
8701
8916
|
}
|
|
8702
8917
|
</div>
|
|
8703
|
-
`, styles: [":host{--ate-primary: #2563eb;--ate-primary-hover: #153ca9;--ate-primary-contrast: #ffffff;--ate-primary-light: color-mix(in srgb, var(--ate-primary), transparent 90%);--ate-primary-lighter: color-mix(in srgb, var(--ate-primary), transparent 95%);--ate-primary-light-alpha: color-mix(in srgb, var(--ate-primary), transparent 85%);--ate-surface: #ffffff;--ate-surface-secondary: #f8f9fa;--ate-surface-tertiary: #f1f5f9;--ate-text: #2d3748;--ate-text-secondary: #64748b;--ate-text-muted: #a0aec0;--ate-border: #e2e8f0;--ate-highlight-bg: #fef08a;--ate-highlight-color: #854d0e;--ate-button-hover: #f1f5f9;--ate-button-active: #e2e8f0;--ate-selection-bg: var(--ate-primary-light-alpha);--ate-error-color: #c53030;--ate-error-bg: #fed7d7;--ate-error-border: #feb2b2;--ate-border-color: var(--ate-border);--ate-border-width: 2px;--ate-border-radius: 12px;--ate-focus-color: var(--ate-primary);--ate-background: var(--ate-surface);--ate-sub-border-radius: 8px;--ate-text-color: var(--ate-text);--ate-placeholder-color: var(--ate-text-muted);--ate-line-height: 1.6;--ate-content-padding-block: 16px;--ate-content-padding-inline: 16px;--ate-content-gutter: 0px;--ate-menu-bg: var(--ate-surface);--ate-menu-border-radius: var(--ate-border-radius);--ate-menu-border: var(--ate-border);--ate-menu-shadow: 0 10px 15px -3px rgba(0, 0, 0, .1), 0 4px 6px -2px rgba(0, 0, 0, .05);--ate-menu-padding: 4px;--ate-menu-gap: 2px;--ate-toolbar-padding: var(--ate-menu-padding);--ate-toolbar-gap: var(--ate-menu-gap);--ate-toolbar-background: var(--ate-surface-secondary);--ate-toolbar-border-color: var(--ate-border);--ate-toolbar-button-color: var(--ate-text-secondary);--ate-toolbar-button-hover-background: transparent;--ate-toolbar-button-active-background: var(--ate-primary-light);--ate-toolbar-button-active-color: var(--ate-primary);--ate-counter-color: var(--ate-text-secondary);--ate-counter-background: var(--ate-surface-secondary);--ate-counter-border-color: var(--ate-border);--ate-drag-background: #f0f8ff;--ate-drag-border-color: var(--ate-primary);--ate-blockquote-border-color: var(--ate-border);--ate-blockquote-background: var(--ate-surface-secondary);--ate-code-background: var(--ate-surface-secondary);--ate-code-color: var(--ate-text);--ate-code-border-color: var(--ate-border);--ate-code-block-background: #0f172a;--ate-code-block-color: #e2e8f0;--ate-code-block-border-color: var(--ate-border);--ate-image-border-radius: 16px;--ate-image-selected-color: var(--ate-primary);--ate-scrollbar-width: 10px;--ate-scrollbar-thumb: var(--ate-border);--ate-scrollbar-thumb-hover: var(--ate-text-muted);--ate-scrollbar-track: transparent;--ate-table-border-color: var(--ate-border);--ate-table-header-background: var(--ate-surface-secondary);--ate-table-header-color: var(--ate-text);--ate-table-cell-background: var(--ate-surface);--ate-table-cell-selected-background: var(--ate-primary-light);--ate-table-resize-handle-color: var(--ate-primary);--ate-table-row-hover-background: var(--ate-primary-lighter);--ate-tooltip-bg: var(--ate-code-block-background, #0f172a);--ate-tooltip-color: var(--ate-code-block-color, #e2e8f0)}:host(.dark),:host([data-theme=\"dark\"]){--ate-primary: #3b82f6;--ate-primary-contrast: #ffffff;--ate-primary-light: color-mix(in srgb, var(--ate-primary), transparent 85%);--ate-primary-lighter: color-mix(in srgb, var(--ate-primary), transparent 92%);--ate-primary-light-alpha: color-mix(in srgb, var(--ate-primary), transparent 80%);--ate-surface: #020617;--ate-surface-secondary: #0f172a;--ate-surface-tertiary: #1e293b;--ate-text: #f8fafc;--ate-text-secondary: #94a3b8;--ate-text-muted: #64748b;--ate-border: #1e293b;--ate-highlight-bg: #854d0e;--ate-highlight-color: #fef08a;--ate-button-hover: #1e293b;--ate-button-active: #0f172a;--ate-menu-border: rgba(255, 255, 255, .1);--ate-menu-shadow: 0 20px 25px -5px rgba(0, 0, 0, .3), 0 10px 10px -5px rgba(0, 0, 0, .2);--ate-error-color: #f87171;--ate-error-bg: #450a0a;--ate-error-border: #7f1d1d;--ate-drag-background: var(--ate-surface-tertiary);--ate-drag-border-color: var(--ate-primary);--ate-blockquote-border-color: var(--ate-primary);--ate-toolbar-button-active-background: var(--ate-primary-light);--ate-toolbar-button-active-color: var(--ate-primary);--ate-button-hover: var(--ate-surface-tertiary);--ate-button-active: var(--ate-surface-secondary);--ate-scrollbar-thumb: var(--ate-surface-tertiary);--ate-scrollbar-thumb-hover: var(--ate-text-muted)}:host(.fill-container){display:block;height:100%}.ate-editor{border:var(--ate-border-width) solid var(--ate-border-color);border-radius:var(--ate-border-radius);background:var(--ate-background);overflow:visible;transition:border-color .2s ease;position:relative}:host(.floating-toolbar) .ate-editor{overflow:visible}:host(.fill-container) .ate-editor{display:flex;flex-direction:column;height:100%}:host(.fill-container) .ate-content-wrapper{flex:1;min-height:0}:host(.fill-container) .ate-content{flex:1;min-height:0;overflow-y:auto}.ate-editor:focus-within{border-color:var(--ate-focus-color)}.ate-content{min-height:var(--editor-min-height, 200px);height:var(--editor-height, auto);max-height:var(--editor-max-height, none);overflow-y:var(--editor-overflow, visible);outline:none;position:relative;scrollbar-width:thin;scrollbar-color:var(--ate-scrollbar-thumb) var(--ate-scrollbar-track)}:host(.is-disabled) .ate-content{cursor:not-allowed;opacity:.7;-webkit-user-select:none;user-select:none;pointer-events:none;background-color:var(--ate-surface-tertiary)}:host(.is-readonly) .ate-content{cursor:default;-webkit-user-select:text;user-select:text}:host(.is-readonly) .ate-content ::ng-deep .ate-link{cursor:pointer;pointer-events:auto}.ate-content::-webkit-scrollbar{width:var(--ate-scrollbar-width)}.ate-content-wrapper{position:relative;display:flex;flex-direction:column;min-height:0}.ate-content-wrapper .ate-content{flex:1}.ate-content::-webkit-scrollbar-track{background:var(--ate-scrollbar-track)}.ate-content::-webkit-scrollbar-thumb{background:var(--ate-scrollbar-thumb);border:3px solid transparent;background-clip:content-box;border-radius:10px}.ate-content::-webkit-scrollbar-thumb:hover{background:var(--ate-scrollbar-thumb-hover);background-clip:content-box}.ate-content.drag-over{background:var(--ate-drag-background);border:2px dashed var(--ate-drag-border-color)}.character-count{padding:6px 8px;font-size:12px;color:var(--ate-counter-color);text-align:right;border-top:1px solid var(--ate-counter-border-color);background:var(--ate-counter-background);transition:color .2s ease;border-bottom-left-radius:calc(var(--ate-border-radius) - var(--ate-border-width));border-bottom-right-radius:calc(var(--ate-border-radius) - var(--ate-border-width))}.character-count.limit-reached{color:var(--ate-error-color, #ef4444);font-weight:600}:host.ate-blocks-inside{--ate-content-gutter: 54px}@media (max-width: 768px){:host.ate-blocks-inside{--ate-content-gutter: 0px}ate-block-controls{display:none!important}}:host ::ng-deep .ProseMirror{padding-inline:calc(var(--ate-content-padding-inline) + var(--ate-content-gutter));padding-block:var(--ate-content-padding-block);outline:none;line-height:var(--ate-line-height);color:var(--ate-text-color);min-height:100%;height:100%;word-wrap:break-word;overflow-wrap:break-word}:host ::ng-deep .ProseMirror ::selection{background-color:var(--ate-selection-bg);color:inherit}:host ::ng-deep .ProseMirror ::-moz-selection{background-color:var(--ate-selection-bg);color:inherit}:host ::ng-deep .ProseMirror h1{font-size:2em;font-weight:700;margin-top:0;margin-bottom:.5em}:host ::ng-deep .ProseMirror h2{font-size:1.5em;font-weight:700;margin-top:1em;margin-bottom:.5em}:host ::ng-deep .ProseMirror h3{font-size:1.25em;font-weight:700;margin-top:1em;margin-bottom:.5em}:host ::ng-deep .ProseMirror p{margin:.5em 0}:host ::ng-deep .ProseMirror ul,:host ::ng-deep .ProseMirror ol{padding-left:2em;margin:.5em 0}:host ::ng-deep .ProseMirror blockquote{border-left:4px solid var(--ate-blockquote-border-color);margin:1em 0;background:var(--ate-blockquote-background);padding:.5em 1em;border-radius:0 4px 4px 0}:host ::ng-deep .ProseMirror code{background:var(--ate-code-background);color:var(--ate-code-color);border:1px solid var(--ate-code-border-color);padding:.15em .4em;border-radius:4px;font-family:JetBrains Mono,Fira Code,Monaco,Consolas,monospace;font-size:.85em;font-weight:500}:host ::ng-deep .ProseMirror pre{background:var(--ate-code-block-background);color:var(--ate-code-block-color);border:1px solid var(--ate-code-block-border-color);padding:1em;border-radius:var(--ate-border-radius);overflow-x:auto;margin:1em 0}:host ::ng-deep .ProseMirror pre code{background:none;color:inherit;border:none;padding:0}:host ::ng-deep .ProseMirror p.is-editor-empty:first-child:before{content:attr(data-placeholder);color:var(--ate-placeholder-color);pointer-events:none;float:left;height:0}:host ::ng-deep .ProseMirror[contenteditable=false] img{cursor:pointer}:host ::ng-deep .ProseMirror[contenteditable=false] a{cursor:pointer}:host ::ng-deep .ProseMirror[contenteditable=false] img:hover{transform:none;box-shadow:0 2px 8px #0000001a}:host ::ng-deep .ProseMirror[contenteditable=false] img.ProseMirror-selectednode{outline:none}:host ::ng-deep .ProseMirror img{position:relative;display:inline-block;max-width:100%;height:auto;cursor:pointer;transition:all .2s ease;border:2px solid transparent;border-radius:var(--ate-image-border-radius)}:host ::ng-deep .ProseMirror img:hover{border-color:var(--ate-border-color);box-shadow:0 2px 4px #0000001a}:host ::ng-deep .ProseMirror img.ProseMirror-selectednode,:host ::ng-deep .resizable-image-container.selected img{border-color:var(--ate-image-selected-color);transition:all .2s ease}:host ::ng-deep .ProseMirror [data-text-align=center],:host ::ng-deep .ProseMirror [data-align=center]{text-align:center}:host ::ng-deep .ProseMirror [data-text-align=right],:host ::ng-deep .ProseMirror [data-align=right]{text-align:right}:host ::ng-deep .ProseMirror [data-text-align=left],:host ::ng-deep .ProseMirror [data-align=left]{text-align:left}:host ::ng-deep .resizable-image-wrapper{display:block;width:100%;margin:.5em 0}:host ::ng-deep .resizable-image-container{position:relative;display:inline-block;max-width:100%}:host ::ng-deep .resize-controls{position:absolute;inset:0;pointer-events:none;z-index:1000;opacity:0;transition:opacity .2s ease}:host:not(.is-readonly):not(.is-disabled) ::ng-deep .resizable-image-container:hover .resize-controls,:host:not(.is-readonly):not(.is-disabled) ::ng-deep body.resizing .resize-controls{opacity:1}:host ::ng-deep .resize-handle{position:absolute;width:.35rem;height:2rem;background:var(--ate-primary);border:2px solid var(--ate-surface);border-radius:var(--ate-border-radius);pointer-events:all;cursor:pointer;z-index:1001;transition:all .15s ease;box-shadow:0 2px 6px #0003}:host ::ng-deep .resize-handle:hover{background:var(--ate-primary);box-shadow:0 3px 8px #0000004d}:host ::ng-deep .resize-handle:active{background:var(--ate-primary)}:host ::ng-deep .resize-handle-w:hover,:host ::ng-deep .resize-handle-e:hover{background:var(--ate-primary-hover)}:host ::ng-deep .resize-handle-w:active,:host ::ng-deep .resize-handle-e:active{transform:translateY(-50%) scale(.9);background:var(--ate-primary-hover)}:host ::ng-deep .resize-handle-w{top:50%;left:.35rem;transform:translateY(-50%);cursor:w-resize}:host ::ng-deep .resize-handle-e{top:50%;right:.35rem;transform:translateY(-50%);cursor:e-resize}:host ::ng-deep body.resizing{-webkit-user-select:none;user-select:none;cursor:crosshair}:host ::ng-deep body.resizing .ProseMirror{pointer-events:none}:host ::ng-deep body.resizing .ProseMirror .resizable-image-container{pointer-events:none}:host ::ng-deep .image-size-info{position:absolute;bottom:-20px;left:50%;transform:translate(-50%);background:#000c;color:#fff;padding:2px 6px;border-radius:3px;font-size:11px;white-space:nowrap;opacity:0;transition:opacity .2s ease}:host ::ng-deep .resizable-image-container:hover .image-size-info{opacity:1}:host ::ng-deep .ProseMirror table{border-collapse:separate;border-spacing:0;margin:0;table-layout:fixed;width:100%;border-radius:8px;overflow:hidden}:host ::ng-deep .ProseMirror table td,:host ::ng-deep .ProseMirror table th{border:none;border-right:1px solid var(--ate-table-border-color);border-bottom:1px solid var(--ate-table-border-color);box-sizing:border-box;min-width:1em;padding:8px 12px;position:relative;vertical-align:top;text-align:left}:host ::ng-deep .ProseMirror table td{background:var(--ate-table-cell-background)}:host ::ng-deep .ProseMirror table td:first-child,:host ::ng-deep .ProseMirror table th:first-child{border-left:1px solid var(--ate-table-border-color)}:host ::ng-deep .ProseMirror table tr:first-child td,:host ::ng-deep .ProseMirror table tr:first-child th{border-top:1px solid var(--ate-table-border-color)}:host ::ng-deep .ProseMirror table tr:first-child th:first-child{border-top-left-radius:8px}:host ::ng-deep .ProseMirror table tr:first-child th:last-child{border-top-right-radius:8px}:host ::ng-deep .ProseMirror table tr:last-child td:first-child{border-bottom-left-radius:8px}:host ::ng-deep .ProseMirror table tr:last-child td:last-child{border-bottom-right-radius:8px}:host ::ng-deep .ProseMirror table th{background:var(--ate-table-header-background);font-weight:600;color:var(--ate-table-header-color)}:host ::ng-deep .ProseMirror table .selectedCell:after{background:var(--ate-table-cell-selected-background);content:\"\";inset:0;pointer-events:none;position:absolute;z-index:2}:host ::ng-deep .ProseMirror table .column-resize-handle{position:absolute;right:-2px;top:0;bottom:0;width:4px;background-color:var(--ate-table-resize-handle-color);opacity:0;transition:opacity .2s ease}:host ::ng-deep .ProseMirror table:hover .column-resize-handle{opacity:1}:host ::ng-deep .ProseMirror table .column-resize-handle:hover{background-color:var(--ate-focus-color)}:host ::ng-deep .ProseMirror .tableWrapper{overflow-x:auto;margin:1em 0;border-radius:8px}:host ::ng-deep .ProseMirror .tableWrapper table{margin:0;border-radius:8px;min-width:600px;overflow:hidden}:host ::ng-deep .ProseMirror table p{margin:0}:host ::ng-deep .ProseMirror table tbody tr:hover td{background-color:var(--ate-table-row-hover-background)}\n"] }]
|
|
8918
|
+
`, styles: [":host{--ate-primary: #2563eb;--ate-primary-hover: #153ca9;--ate-primary-contrast: #ffffff;--ate-primary-light: color-mix(in srgb, var(--ate-primary), transparent 90%);--ate-primary-lighter: color-mix(in srgb, var(--ate-primary), transparent 95%);--ate-primary-light-alpha: color-mix(in srgb, var(--ate-primary), transparent 85%);--ate-surface: #ffffff;--ate-surface-secondary: #f8f9fa;--ate-surface-tertiary: #f1f5f9;--ate-text: #2d3748;--ate-text-secondary: #64748b;--ate-text-muted: #a0aec0;--ate-border: #e2e8f0;--ate-highlight-bg: #fef08a;--ate-highlight-color: #854d0e;--ate-button-hover: #f1f5f9;--ate-button-active: #e2e8f0;--ate-selection-bg: var(--ate-primary-light-alpha);--ate-error-color: #c53030;--ate-error-bg: #fed7d7;--ate-error-border: #feb2b2;--ate-border-color: var(--ate-border);--ate-border-width: 2px;--ate-border-radius: 12px;--ate-sub-border-radius: 8px;--ate-focus-color: var(--ate-primary);--ate-background: var(--ate-surface);--ate-text-color: var(--ate-text, #2d3748);--ate-placeholder-color: var(--ate-text-muted, #a0aec0);--ate-line-height: 1.6;--ate-content-padding-block: 16px;--ate-content-padding-inline: 16px;--ate-content-gutter: 0px;--ate-menu-bg: var(--ate-surface, #ffffff);--ate-menu-border-radius: var(--ate-border-radius, 12px);--ate-menu-border: var(--ate-border, #e2e8f0);--ate-menu-shadow: 0 10px 15px -3px rgba(0, 0, 0, .1), 0 4px 6px -2px rgba(0, 0, 0, .05);--ate-menu-padding: 4px;--ate-menu-gap: 2px;--ate-toolbar-padding: var(--ate-menu-padding);--ate-toolbar-gap: var(--ate-menu-gap);--ate-toolbar-background: var(--ate-surface-secondary, #f8f9fa);--ate-toolbar-border-color: var(--ate-border, #e2e8f0);--ate-toolbar-button-color: var(--ate-text-secondary, #64748b);--ate-toolbar-button-hover-background: transparent;--ate-toolbar-button-active-background: color-mix( in srgb, var(--ate-primary, #2563eb), transparent 90% );--ate-toolbar-button-active-color: var(--ate-primary, #2563eb);--ate-counter-color: var(--ate-text-secondary, #64748b);--ate-counter-background: var(--ate-surface-secondary, #f8f9fa);--ate-counter-border-color: var(--ate-border, #e2e8f0);--ate-drag-background: #f0f8ff;--ate-drag-border-color: var(--ate-primary, #2563eb);--ate-blockquote-border-color: var(--ate-border, #e2e8f0);--ate-blockquote-background: var(--ate-surface-secondary, #f8f9fa);--ate-code-background: var(--ate-surface-secondary, #f8f9fa);--ate-code-color: var(--ate-text, #2d3748);--ate-code-border-color: var(--ate-border, #e2e8f0);--ate-code-block-background: #0f172a;--ate-code-block-color: #e2e8f0;--ate-code-block-border-color: var(--ate-border, #e2e8f0);--ate-image-border-radius: 16px;--ate-image-selected-color: var(--ate-primary, #2563eb);--ate-scrollbar-width: 10px;--ate-scrollbar-thumb: var(--ate-border, #e2e8f0);--ate-scrollbar-thumb-hover: var(--ate-text-muted, #a0aec0);--ate-scrollbar-track: transparent;--ate-table-border-color: var(--ate-border, #e2e8f0);--ate-table-header-background: var(--ate-surface-secondary, #f8f9fa);--ate-table-header-color: var(--ate-text, #2d3748);--ate-table-cell-background: var(--ate-surface, #ffffff);--ate-table-cell-selected-background: color-mix( in srgb, var(--ate-primary, #2563eb), transparent 90% );--ate-table-resize-handle-color: var(--ate-primary, #2563eb);--ate-table-row-hover-background: color-mix( in srgb, var(--ate-primary, #2563eb), transparent 95% );--ate-tooltip-bg: var(--ate-code-block-background, #0f172a);--ate-tooltip-color: var(--ate-code-block-color, #e2e8f0)}:host(.dark),:host([data-theme=\"dark\"]){--ate-primary: #3b82f6;--ate-primary-contrast: #ffffff;--ate-primary-light: color-mix(in srgb, var(--ate-primary), transparent 85%);--ate-primary-lighter: color-mix(in srgb, var(--ate-primary), transparent 92%);--ate-primary-light-alpha: color-mix(in srgb, var(--ate-primary), transparent 80%);--ate-surface: #020617;--ate-surface-secondary: #0f172a;--ate-surface-tertiary: #1e293b;--ate-text: #f8fafc;--ate-text-secondary: #94a3b8;--ate-text-muted: #64748b;--ate-border: #1e293b;--ate-highlight-bg: #854d0e;--ate-highlight-color: #fef08a;--ate-button-hover: #1e293b;--ate-button-active: #0f172a;--ate-menu-border: rgba(255, 255, 255, .1);--ate-menu-shadow: 0 20px 25px -5px rgba(0, 0, 0, .3), 0 10px 10px -5px rgba(0, 0, 0, .2);--ate-error-color: #f87171;--ate-error-bg: #450a0a;--ate-error-border: #7f1d1d;--ate-drag-background: var(--ate-surface-tertiary);--ate-drag-border-color: var(--ate-primary);--ate-blockquote-border-color: var(--ate-primary);--ate-toolbar-button-active-background: var(--ate-primary-light);--ate-toolbar-button-active-color: var(--ate-primary);--ate-button-hover: var(--ate-surface-tertiary);--ate-button-active: var(--ate-surface-secondary);--ate-scrollbar-thumb: var(--ate-surface-tertiary);--ate-scrollbar-thumb-hover: var(--ate-text-muted)}:host(.fill-container){display:block;height:100%}.ate-editor{border:var(--ate-border-width) solid var(--ate-border-color);border-radius:var(--ate-border-radius);background:var(--ate-background);overflow:visible;transition:border-color .2s ease;position:relative}:host(.floating-toolbar) .ate-editor{overflow:visible}:host(.fill-container) .ate-editor{display:flex;flex-direction:column;height:100%}:host(.fill-container) .ate-content-wrapper{flex:1;min-height:0}:host(.fill-container) .ate-content{flex:1;min-height:0;overflow-y:auto}.ate-editor:focus-within{border-color:var(--ate-focus-color)}.ate-content{min-height:var(--editor-min-height, 200px);height:var(--editor-height, auto);max-height:var(--editor-max-height, none);overflow-y:var(--editor-overflow, visible);outline:none;position:relative;scrollbar-width:thin;scrollbar-color:var(--ate-scrollbar-thumb) var(--ate-scrollbar-track)}:host(.is-disabled) .ate-content{cursor:not-allowed;opacity:.7;-webkit-user-select:none;user-select:none;pointer-events:none;background-color:var(--ate-surface-tertiary)}:host(.is-readonly) .ate-content{cursor:default;-webkit-user-select:text;user-select:text}:host(.is-readonly) .ate-content ::ng-deep .ate-link{cursor:pointer;pointer-events:auto}.ate-content::-webkit-scrollbar{width:var(--ate-scrollbar-width)}.ate-content-wrapper{position:relative;display:flex;flex-direction:column;min-height:0}.ate-content-wrapper .ate-content{flex:1}.ate-content::-webkit-scrollbar-track{background:var(--ate-scrollbar-track)}.ate-content::-webkit-scrollbar-thumb{background:var(--ate-scrollbar-thumb);border:3px solid transparent;background-clip:content-box;border-radius:10px}.ate-content::-webkit-scrollbar-thumb:hover{background:var(--ate-scrollbar-thumb-hover);background-clip:content-box}.ate-content.drag-over{background:var(--ate-drag-background);border:2px dashed var(--ate-drag-border-color)}.character-count{padding:6px 8px;font-size:12px;color:var(--ate-counter-color);text-align:right;border-top:1px solid var(--ate-counter-border-color);background:var(--ate-counter-background);transition:color .2s ease;border-bottom-left-radius:calc(var(--ate-border-radius) - var(--ate-border-width));border-bottom-right-radius:calc(var(--ate-border-radius) - var(--ate-border-width))}.character-count.limit-reached{color:var(--ate-error-color, #ef4444);font-weight:600}:host.ate-blocks-inside{--ate-content-gutter: 54px}@media (max-width: 768px){:host.ate-blocks-inside{--ate-content-gutter: 0px}ate-block-controls{display:none!important}}:host ::ng-deep .ProseMirror{padding-inline:calc(var(--ate-content-padding-inline) + var(--ate-content-gutter));padding-block:var(--ate-content-padding-block);outline:none;line-height:var(--ate-line-height);color:var(--ate-text-color);min-height:100%;height:100%;word-wrap:break-word;overflow-wrap:break-word}:host ::ng-deep .ProseMirror ::selection{background-color:var(--ate-selection-bg);color:inherit}:host ::ng-deep .ProseMirror ::-moz-selection{background-color:var(--ate-selection-bg);color:inherit}:host ::ng-deep .ProseMirror h1{font-size:2em;font-weight:700;margin-top:0;margin-bottom:.5em}:host ::ng-deep .ProseMirror h2{font-size:1.5em;font-weight:700;margin-top:1em;margin-bottom:.5em}:host ::ng-deep .ProseMirror h3{font-size:1.25em;font-weight:700;margin-top:1em;margin-bottom:.5em}:host ::ng-deep .ProseMirror p{margin:.5em 0}:host ::ng-deep .ProseMirror ul,:host ::ng-deep .ProseMirror ol{padding-left:2em;margin:.5em 0}:host ::ng-deep .ProseMirror blockquote{border-left:4px solid var(--ate-blockquote-border-color);margin:1em 0;background:var(--ate-blockquote-background);padding:.5em 1em;border-radius:0 4px 4px 0}:host ::ng-deep .ProseMirror code{background:var(--ate-code-background);color:var(--ate-code-color);border:1px solid var(--ate-code-border-color);padding:.15em .4em;border-radius:4px;font-family:JetBrains Mono,Fira Code,Monaco,Consolas,monospace;font-size:.85em;font-weight:500}:host ::ng-deep .ProseMirror pre{background:var(--ate-code-block-background);color:var(--ate-code-block-color);border:1px solid var(--ate-code-block-border-color);padding:1em;border-radius:var(--ate-border-radius);overflow-x:auto;margin:1em 0}:host ::ng-deep .ProseMirror pre code{background:none;color:inherit;border:none;padding:0}:host ::ng-deep .ProseMirror p.is-editor-empty:first-child:before{content:attr(data-placeholder);color:var(--ate-placeholder-color);pointer-events:none;float:left;height:0}:host ::ng-deep .ProseMirror[contenteditable=false] img{cursor:pointer}:host ::ng-deep .ProseMirror[contenteditable=false] a{cursor:pointer}:host ::ng-deep .ProseMirror[contenteditable=false] img:hover{transform:none;box-shadow:0 2px 8px #0000001a}:host ::ng-deep .ProseMirror[contenteditable=false] img.ProseMirror-selectednode{outline:none}:host ::ng-deep .ProseMirror img{position:relative;display:inline-block;max-width:100%;height:auto;cursor:pointer;transition:all .2s ease;border:2px solid transparent;border-radius:var(--ate-image-border-radius)}:host ::ng-deep .ProseMirror img:hover{border-color:var(--ate-border-color);box-shadow:0 2px 4px #0000001a}:host ::ng-deep .ProseMirror img.ProseMirror-selectednode,:host ::ng-deep .resizable-image-container.selected img{border-color:var(--ate-image-selected-color);transition:all .2s ease}:host ::ng-deep .ProseMirror [data-text-align=center],:host ::ng-deep .ProseMirror [data-align=center]{text-align:center}:host ::ng-deep .ProseMirror [data-text-align=right],:host ::ng-deep .ProseMirror [data-align=right]{text-align:right}:host ::ng-deep .ProseMirror [data-text-align=left],:host ::ng-deep .ProseMirror [data-align=left]{text-align:left}:host ::ng-deep .resizable-image-wrapper{display:block;width:100%;margin:.5em 0}:host ::ng-deep .resizable-image-container{position:relative;display:inline-block;max-width:100%}:host ::ng-deep .resize-controls{position:absolute;inset:0;pointer-events:none;z-index:1000;opacity:0;transition:opacity .2s ease}:host:not(.is-readonly):not(.is-disabled) ::ng-deep .resizable-image-container:hover .resize-controls,:host:not(.is-readonly):not(.is-disabled) ::ng-deep body.resizing .resize-controls{opacity:1}:host ::ng-deep .resize-handle{position:absolute;width:.35rem;height:2rem;background:var(--ate-primary);border:2px solid var(--ate-surface);border-radius:var(--ate-border-radius);pointer-events:all;cursor:pointer;z-index:1001;transition:all .15s ease;box-shadow:0 2px 6px #0003}:host ::ng-deep .resize-handle:hover{background:var(--ate-primary);box-shadow:0 3px 8px #0000004d}:host ::ng-deep .resize-handle:active{background:var(--ate-primary)}:host ::ng-deep .resize-handle-w:hover,:host ::ng-deep .resize-handle-e:hover{background:var(--ate-primary-hover)}:host ::ng-deep .resize-handle-w:active,:host ::ng-deep .resize-handle-e:active{transform:translateY(-50%) scale(.9);background:var(--ate-primary-hover)}:host ::ng-deep .resize-handle-w{top:50%;left:.35rem;transform:translateY(-50%);cursor:w-resize}:host ::ng-deep .resize-handle-e{top:50%;right:.35rem;transform:translateY(-50%);cursor:e-resize}:host ::ng-deep body.resizing{-webkit-user-select:none;user-select:none;cursor:crosshair}:host ::ng-deep body.resizing .ProseMirror{pointer-events:none}:host ::ng-deep body.resizing .ProseMirror .resizable-image-container{pointer-events:none}:host ::ng-deep .image-size-info{position:absolute;bottom:-20px;left:50%;transform:translate(-50%);background:#000c;color:#fff;padding:2px 6px;border-radius:3px;font-size:11px;white-space:nowrap;opacity:0;transition:opacity .2s ease}:host ::ng-deep .resizable-image-container:hover .image-size-info{opacity:1}:host ::ng-deep .ProseMirror table{border-collapse:separate;border-spacing:0;margin:0;table-layout:fixed;width:100%;border-radius:8px;overflow:hidden}:host ::ng-deep .ProseMirror table td,:host ::ng-deep .ProseMirror table th{border:none;border-right:1px solid var(--ate-table-border-color);border-bottom:1px solid var(--ate-table-border-color);box-sizing:border-box;min-width:1em;padding:8px 12px;position:relative;vertical-align:top;text-align:left}:host ::ng-deep .ProseMirror table td{background:var(--ate-table-cell-background)}:host ::ng-deep .ProseMirror table td:first-child,:host ::ng-deep .ProseMirror table th:first-child{border-left:1px solid var(--ate-table-border-color)}:host ::ng-deep .ProseMirror table tr:first-child td,:host ::ng-deep .ProseMirror table tr:first-child th{border-top:1px solid var(--ate-table-border-color)}:host ::ng-deep .ProseMirror table tr:first-child th:first-child{border-top-left-radius:8px}:host ::ng-deep .ProseMirror table tr:first-child th:last-child{border-top-right-radius:8px}:host ::ng-deep .ProseMirror table tr:last-child td:first-child{border-bottom-left-radius:8px}:host ::ng-deep .ProseMirror table tr:last-child td:last-child{border-bottom-right-radius:8px}:host ::ng-deep .ProseMirror table th{background:var(--ate-table-header-background);font-weight:600;color:var(--ate-table-header-color)}:host ::ng-deep .ProseMirror table .selectedCell:after{background:var(--ate-table-cell-selected-background);content:\"\";inset:0;pointer-events:none;position:absolute;z-index:2}:host ::ng-deep .ProseMirror table .column-resize-handle{position:absolute;right:-2px;top:0;bottom:0;width:4px;background-color:var(--ate-table-resize-handle-color);opacity:0;transition:opacity .2s ease}:host ::ng-deep .ProseMirror table:hover .column-resize-handle{opacity:1}:host ::ng-deep .ProseMirror table .column-resize-handle:hover{background-color:var(--ate-focus-color)}:host ::ng-deep .ProseMirror .tableWrapper{overflow-x:auto;margin:1em 0;border-radius:8px}:host ::ng-deep .ProseMirror .tableWrapper table{margin:0;border-radius:8px;min-width:600px;overflow:hidden}:host ::ng-deep .ProseMirror table p{margin:0}:host ::ng-deep .ProseMirror table tbody tr:hover td{background-color:var(--ate-table-row-hover-background)}\n"] }]
|
|
8704
8919
|
}], ctorParameters: () => [] });
|
|
8705
8920
|
|
|
8921
|
+
/**
|
|
8922
|
+
* Table of Contents Component (Notion-style)
|
|
8923
|
+
* Dynamically extracts headings from the active editor and displays them.
|
|
8924
|
+
* Configurable via inputs (floating, position, variants, hover expansion) and CSS variables.
|
|
8925
|
+
*/
|
|
8926
|
+
class AteTableOfContentsComponent {
|
|
8927
|
+
// Helper method for exact native SVG dash width per heading level
|
|
8928
|
+
dashWidth(level) {
|
|
8929
|
+
switch (level) {
|
|
8930
|
+
case 1:
|
|
8931
|
+
return 16;
|
|
8932
|
+
case 2:
|
|
8933
|
+
return 12;
|
|
8934
|
+
case 3:
|
|
8935
|
+
return 8;
|
|
8936
|
+
case 4:
|
|
8937
|
+
return 6;
|
|
8938
|
+
case 5:
|
|
8939
|
+
return 4;
|
|
8940
|
+
default:
|
|
8941
|
+
return 3;
|
|
8942
|
+
}
|
|
8943
|
+
}
|
|
8944
|
+
constructor() {
|
|
8945
|
+
// Input accepts raw Editor, AteEditorRef, or ID of registered editor
|
|
8946
|
+
this.editor = input(null);
|
|
8947
|
+
// Optional custom title (if not provided, uses i18n translation)
|
|
8948
|
+
this.title = input(null);
|
|
8949
|
+
// Whether to show the header title
|
|
8950
|
+
this.showTitle = input(true);
|
|
8951
|
+
// Layout mode: floating on fixed position or inline inside parent container
|
|
8952
|
+
this.floating = input(false);
|
|
8953
|
+
// Floating position: 'right' | 'left'
|
|
8954
|
+
this.position = input("right");
|
|
8955
|
+
// Visual variant: 'card' | 'transparent' | 'minimal'
|
|
8956
|
+
this.variant = input("card");
|
|
8957
|
+
// Notion-style hover expansion (collapses text into dashes until hovered)
|
|
8958
|
+
this.hoverExpand = input(true);
|
|
8959
|
+
this.registry = inject(AteEditorRegistry);
|
|
8960
|
+
this.i18n = inject(AteI18nService);
|
|
8961
|
+
// Computed header title with fallback to i18n
|
|
8962
|
+
this.headerTitle = computed(() => {
|
|
8963
|
+
const custom = this.title();
|
|
8964
|
+
if (custom !== null && custom !== undefined) {
|
|
8965
|
+
return custom;
|
|
8966
|
+
}
|
|
8967
|
+
return this.i18n.editor().tableOfContents;
|
|
8968
|
+
});
|
|
8969
|
+
// Resolved editor instance
|
|
8970
|
+
this.resolvedEditor = computed(() => {
|
|
8971
|
+
const val = this.editor();
|
|
8972
|
+
if (!val) {
|
|
8973
|
+
return this.registry.activeEditor()?.editor || null;
|
|
8974
|
+
}
|
|
8975
|
+
if (val instanceof AteEditorRef) {
|
|
8976
|
+
return val.editor;
|
|
8977
|
+
}
|
|
8978
|
+
if (typeof val === "string") {
|
|
8979
|
+
return this.registry.get(val)?.editor || null;
|
|
8980
|
+
}
|
|
8981
|
+
return val;
|
|
8982
|
+
});
|
|
8983
|
+
// Table of Contents items
|
|
8984
|
+
this.items = signal([]);
|
|
8985
|
+
// Distinct mouse hover and keyboard focus state tracking
|
|
8986
|
+
this.isMouseHovered = signal(false);
|
|
8987
|
+
this.isFocused = signal(false);
|
|
8988
|
+
this.isExpanded = computed(() => this.isMouseHovered() || this.isFocused());
|
|
8989
|
+
this.onEditorUpdate = () => {
|
|
8990
|
+
const editor = this.resolvedEditor();
|
|
8991
|
+
if (editor) {
|
|
8992
|
+
this.updateHeadings(editor);
|
|
8993
|
+
}
|
|
8994
|
+
};
|
|
8995
|
+
// React strictly to editor instance changes without tracking internal signal updates
|
|
8996
|
+
effect(() => {
|
|
8997
|
+
const editor = this.resolvedEditor();
|
|
8998
|
+
untracked(() => {
|
|
8999
|
+
if (editor) {
|
|
9000
|
+
this.bindEditorEvents(editor);
|
|
9001
|
+
this.updateHeadings(editor);
|
|
9002
|
+
}
|
|
9003
|
+
else {
|
|
9004
|
+
this.items.set([]);
|
|
9005
|
+
}
|
|
9006
|
+
});
|
|
9007
|
+
});
|
|
9008
|
+
}
|
|
9009
|
+
ngOnDestroy() {
|
|
9010
|
+
const editor = this.resolvedEditor();
|
|
9011
|
+
if (editor) {
|
|
9012
|
+
this.unbindEditorEvents(editor);
|
|
9013
|
+
}
|
|
9014
|
+
}
|
|
9015
|
+
onScroll() {
|
|
9016
|
+
this.checkActiveHeading();
|
|
9017
|
+
}
|
|
9018
|
+
// Handle mouse hover state independently
|
|
9019
|
+
setMouseHover(hovered) {
|
|
9020
|
+
this.isMouseHovered.set(hovered);
|
|
9021
|
+
}
|
|
9022
|
+
// Handle keyboard focus state independently
|
|
9023
|
+
setFocused(focused) {
|
|
9024
|
+
this.isFocused.set(focused);
|
|
9025
|
+
}
|
|
9026
|
+
// Navigate to heading on click
|
|
9027
|
+
scrollToHeading(item, event) {
|
|
9028
|
+
event.preventDefault();
|
|
9029
|
+
event.stopPropagation();
|
|
9030
|
+
const editor = this.resolvedEditor();
|
|
9031
|
+
if (!editor || !editor.view) {
|
|
9032
|
+
return;
|
|
9033
|
+
}
|
|
9034
|
+
try {
|
|
9035
|
+
// 1. Position cursor inside the heading text (item.pos + 1 points to inline text)
|
|
9036
|
+
const targetPos = Math.min(item.pos + 1, editor.state.doc.content.size);
|
|
9037
|
+
editor.commands.setTextSelection(targetPos);
|
|
9038
|
+
editor.commands.focus();
|
|
9039
|
+
}
|
|
9040
|
+
catch (_e) {
|
|
9041
|
+
// Safe-guard against position selection errors
|
|
9042
|
+
}
|
|
9043
|
+
// 2. Smoothly scroll DOM node into view
|
|
9044
|
+
setTimeout(() => {
|
|
9045
|
+
try {
|
|
9046
|
+
const domNode = editor.view.nodeDOM(item.pos);
|
|
9047
|
+
if (domNode) {
|
|
9048
|
+
domNode.scrollIntoView({ behavior: "smooth", block: "start" });
|
|
9049
|
+
}
|
|
9050
|
+
}
|
|
9051
|
+
catch (_e) {
|
|
9052
|
+
// Safe-guard
|
|
9053
|
+
}
|
|
9054
|
+
}, 10);
|
|
9055
|
+
}
|
|
9056
|
+
bindEditorEvents(editor) {
|
|
9057
|
+
this.unbindEditorEvents(editor);
|
|
9058
|
+
editor.on("update", this.onEditorUpdate);
|
|
9059
|
+
editor.on("selectionUpdate", this.onEditorUpdate);
|
|
9060
|
+
}
|
|
9061
|
+
unbindEditorEvents(editor) {
|
|
9062
|
+
editor.off("update", this.onEditorUpdate);
|
|
9063
|
+
editor.off("selectionUpdate", this.onEditorUpdate);
|
|
9064
|
+
}
|
|
9065
|
+
updateHeadings(editor) {
|
|
9066
|
+
const nextItems = [];
|
|
9067
|
+
try {
|
|
9068
|
+
editor.state.doc.descendants((node, pos) => {
|
|
9069
|
+
if (node.type.name === "heading") {
|
|
9070
|
+
const text = node.textContent.trim();
|
|
9071
|
+
const level = node.attrs["level"] || 1;
|
|
9072
|
+
if (text) {
|
|
9073
|
+
nextItems.push({
|
|
9074
|
+
text,
|
|
9075
|
+
level,
|
|
9076
|
+
pos,
|
|
9077
|
+
id: `heading-${pos}`,
|
|
9078
|
+
active: false,
|
|
9079
|
+
});
|
|
9080
|
+
}
|
|
9081
|
+
}
|
|
9082
|
+
});
|
|
9083
|
+
}
|
|
9084
|
+
catch (_e) {
|
|
9085
|
+
// Safe guard against document access issues
|
|
9086
|
+
}
|
|
9087
|
+
untracked(() => {
|
|
9088
|
+
this.items.set(nextItems);
|
|
9089
|
+
this.checkActiveHeading();
|
|
9090
|
+
});
|
|
9091
|
+
}
|
|
9092
|
+
checkActiveHeading() {
|
|
9093
|
+
const editor = this.resolvedEditor();
|
|
9094
|
+
if (!editor || !editor.view) {
|
|
9095
|
+
return;
|
|
9096
|
+
}
|
|
9097
|
+
untracked(() => {
|
|
9098
|
+
const currentItems = this.items();
|
|
9099
|
+
if (currentItems.length === 0) {
|
|
9100
|
+
return;
|
|
9101
|
+
}
|
|
9102
|
+
const headingsWithDom = currentItems
|
|
9103
|
+
.map(item => {
|
|
9104
|
+
try {
|
|
9105
|
+
const dom = editor.view.nodeDOM(item.pos);
|
|
9106
|
+
return { item, dom };
|
|
9107
|
+
}
|
|
9108
|
+
catch (_e) {
|
|
9109
|
+
return { item, dom: null };
|
|
9110
|
+
}
|
|
9111
|
+
})
|
|
9112
|
+
.filter((entry) => entry.dom !== null);
|
|
9113
|
+
if (headingsWithDom.length === 0) {
|
|
9114
|
+
return;
|
|
9115
|
+
}
|
|
9116
|
+
const windowHeight = typeof window !== "undefined" ? window.innerHeight : 800;
|
|
9117
|
+
let activeItem = null;
|
|
9118
|
+
for (let i = headingsWithDom.length - 1; i >= 0; i--) {
|
|
9119
|
+
const { item, dom } = headingsWithDom[i];
|
|
9120
|
+
const rect = dom.getBoundingClientRect();
|
|
9121
|
+
if (rect.top <= windowHeight * 0.35) {
|
|
9122
|
+
activeItem = item;
|
|
9123
|
+
break;
|
|
9124
|
+
}
|
|
9125
|
+
}
|
|
9126
|
+
if (!activeItem && headingsWithDom.length > 0) {
|
|
9127
|
+
activeItem = headingsWithDom[0].item;
|
|
9128
|
+
}
|
|
9129
|
+
if (activeItem) {
|
|
9130
|
+
const updated = currentItems.map(item => ({
|
|
9131
|
+
...item,
|
|
9132
|
+
active: item.id === activeItem.id,
|
|
9133
|
+
}));
|
|
9134
|
+
const isDifferent = updated.some((item, idx) => item.active !== currentItems[idx].active);
|
|
9135
|
+
if (isDifferent) {
|
|
9136
|
+
this.items.set(updated);
|
|
9137
|
+
}
|
|
9138
|
+
}
|
|
9139
|
+
});
|
|
9140
|
+
}
|
|
9141
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: AteTableOfContentsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
9142
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: AteTableOfContentsComponent, isStandalone: true, selector: "ate-table-of-contents", inputs: { editor: { classPropertyName: "editor", publicName: "editor", isSignal: true, isRequired: false, transformFunction: null }, title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, showTitle: { classPropertyName: "showTitle", publicName: "showTitle", isSignal: true, isRequired: false, transformFunction: null }, floating: { classPropertyName: "floating", publicName: "floating", isSignal: true, isRequired: false, transformFunction: null }, position: { classPropertyName: "position", publicName: "position", isSignal: true, isRequired: false, transformFunction: null }, variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, hoverExpand: { classPropertyName: "hoverExpand", publicName: "hoverExpand", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "window:scroll": "onScroll()", "window:resize": "onScroll()" } }, ngImport: i0, template: `
|
|
9143
|
+
<div
|
|
9144
|
+
class="ate-toc-wrapper"
|
|
9145
|
+
[class.ate-toc-floating]="floating()"
|
|
9146
|
+
[class.ate-toc-position-left]="position() === 'left'"
|
|
9147
|
+
[class.ate-toc-position-right]="position() === 'right'"
|
|
9148
|
+
(mouseenter)="setMouseHover(true)"
|
|
9149
|
+
(mouseleave)="setMouseHover(false)"
|
|
9150
|
+
(focusin)="setFocused(true)"
|
|
9151
|
+
(focusout)="setFocused(false)">
|
|
9152
|
+
<div
|
|
9153
|
+
class="ate-toc"
|
|
9154
|
+
[class.ate-toc-floating]="floating()"
|
|
9155
|
+
[class.ate-toc-position-left]="position() === 'left'"
|
|
9156
|
+
[class.ate-toc-position-right]="position() === 'right'"
|
|
9157
|
+
[class.ate-toc-variant-card]="variant() === 'card'"
|
|
9158
|
+
[class.ate-toc-variant-transparent]="variant() === 'transparent'"
|
|
9159
|
+
[class.ate-toc-variant-minimal]="variant() === 'minimal'"
|
|
9160
|
+
[class.ate-toc-hover-expand]="floating() && hoverExpand()"
|
|
9161
|
+
[class.ate-toc-hovered]="floating() && hoverExpand() && isExpanded()"
|
|
9162
|
+
role="navigation"
|
|
9163
|
+
aria-label="Table of Contents">
|
|
9164
|
+
@if (items().length > 0) {
|
|
9165
|
+
@if (showTitle()) {
|
|
9166
|
+
<div class="ate-toc-header">{{ headerTitle() }}</div>
|
|
9167
|
+
}
|
|
9168
|
+
<div class="ate-toc-list">
|
|
9169
|
+
@for (item of items(); track item.id) {
|
|
9170
|
+
<button
|
|
9171
|
+
type="button"
|
|
9172
|
+
class="ate-toc-item"
|
|
9173
|
+
[class.ate-toc-active]="item.active"
|
|
9174
|
+
[attr.aria-current]="item.active ? 'true' : null"
|
|
9175
|
+
[attr.data-level]="item.level"
|
|
9176
|
+
(click)="scrollToHeading(item, $event)"
|
|
9177
|
+
[title]="item.text">
|
|
9178
|
+
<!-- Perfect native vector SVG dash with level-adapted viewBox & width -->
|
|
9179
|
+
<svg
|
|
9180
|
+
[attr.width]="dashWidth(item.level)"
|
|
9181
|
+
height="2"
|
|
9182
|
+
[attr.viewBox]="'0 0 ' + dashWidth(item.level) + ' 2'"
|
|
9183
|
+
fill="none"
|
|
9184
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
9185
|
+
class="ate-toc-dash">
|
|
9186
|
+
<rect
|
|
9187
|
+
[attr.width]="dashWidth(item.level)"
|
|
9188
|
+
height="2"
|
|
9189
|
+
rx="1"
|
|
9190
|
+
ry="1"
|
|
9191
|
+
fill="currentColor"></rect>
|
|
9192
|
+
</svg>
|
|
9193
|
+
|
|
9194
|
+
<!-- Full heading text -->
|
|
9195
|
+
<span class="ate-toc-text">{{ item.text }}</span>
|
|
9196
|
+
</button>
|
|
9197
|
+
}
|
|
9198
|
+
</div>
|
|
9199
|
+
}
|
|
9200
|
+
</div>
|
|
9201
|
+
</div>
|
|
9202
|
+
`, isInline: true, styles: [":host{display:block}.ate-toc-wrapper.ate-toc-floating{position:fixed;top:var(--ate-toc-top, 50%);transform:translateY(-50%);z-index:var(--ate-toc-z-index, 95);display:flex;flex-direction:column;box-sizing:border-box}.ate-toc-wrapper.ate-toc-floating.ate-toc-position-right{right:var(--ate-toc-right, 2rem);left:auto;padding-left:var(--ate-toc-hitbox-padding, 16px);padding-right:0;padding-top:var(--ate-toc-hitbox-padding-vertical, 8px);padding-bottom:var(--ate-toc-hitbox-padding-vertical, 8px)}.ate-toc-wrapper.ate-toc-floating.ate-toc-position-left{left:var(--ate-toc-left, 2rem);right:auto;padding-right:var(--ate-toc-hitbox-padding, 16px);padding-left:0;padding-top:var(--ate-toc-hitbox-padding-vertical, 8px);padding-bottom:var(--ate-toc-hitbox-padding-vertical, 8px)}.ate-toc{font-family:inherit;-webkit-user-select:none;user-select:none;width:100%;box-sizing:border-box;transition:all .3s cubic-bezier(.25,.46,.45,.94)}.ate-toc.ate-toc-floating{max-height:var(--ate-toc-max-height, 400px);overflow:hidden;display:flex;flex-direction:column}.ate-toc.ate-toc-floating:not(.ate-toc-hover-expand),.ate-toc.ate-toc-floating.ate-toc-hover-expand:hover,.ate-toc.ate-toc-floating.ate-toc-hover-expand.ate-toc-hovered{width:var(--ate-toc-width, 240px);border-radius:var(--ate-toc-border-radius, var(--ate-border-radius, 16px));padding:var(--ate-toc-padding)}.ate-toc.ate-toc-floating.ate-toc-hover-expand:not(.ate-toc-hovered):not(:hover){width:var(--ate-toc-collapsed-width, 32px);border-radius:var(--ate-toc-collapsed-radius, 16px);padding:var(--ate-toc-padding)}.ate-toc.ate-toc-variant-card{background:var(--ate-toc-bg, var(--ate-surface, #ffffff));border:1px solid var(--ate-toc-border, var(--ate-border, #e2e8f0));border-radius:var(--ate-toc-border-radius, var(--ate-border-radius, 12px));box-shadow:var(--ate-toc-shadow, 0 4px 20px rgba(0, 0, 0, .06));padding:var(--ate-toc-padding)}.ate-toc.ate-toc-variant-minimal{background:transparent;border:1px solid transparent;box-shadow:none;border-radius:var(--ate-toc-border-radius, var(--ate-border-radius, 12px));padding:10px 12px}.ate-toc.ate-toc-variant-minimal:hover{background:var(--ate-toc-hover-bg, var(--ate-surface, rgba(255, 255, 255, .95)));border-color:var(--ate-toc-hover-border, var(--ate-border, #e2e8f0));box-shadow:var(--ate-toc-hover-shadow, 0 4px 20px rgba(0, 0, 0, .06))}.ate-toc.ate-toc-variant-transparent{background:transparent;border:none;box-shadow:none;padding:0}.ate-toc-header{font-size:.65rem;text-transform:uppercase;letter-spacing:.08em;font-weight:700;color:var(--ate-text-muted, #9ca3af);margin-bottom:10px;margin-top:6px;padding-left:12px;padding-right:0;text-align:left;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;transition:opacity .2s ease}.ate-toc-list{display:flex;flex-direction:column;gap:var(--ate-toc-text-gap, var(--ate-toc-gap, 2px));position:relative;transition:gap .2s ease}.ate-toc-item{display:flex;align-items:center;justify-content:flex-start;text-align:left;position:relative;text-decoration:none;background:transparent;border:none;padding-right:0;cursor:pointer;font:inherit;width:100%;height:var(--ate-toc-item-hover-height, 22px);color:var(--ate-toolbar-button-color, var(--ate-text-secondary, #64748b));outline:none;box-sizing:border-box;border-radius:var(--ate-sub-border-radius, 8px);transition:all .2s cubic-bezier(.4,0,.2,1);overflow:hidden}.ate-toc-item:focus-visible{outline:2px solid var(--ate-primary, #2563eb);outline-offset:1px}.ate-toc-item[data-level=\"1\"]{padding-left:8px}.ate-toc-item[data-level=\"2\"]{padding-left:16px}.ate-toc-item[data-level=\"3\"]{padding-left:24px}.ate-toc-item[data-level=\"4\"]{padding-left:32px}.ate-toc-item[data-level=\"5\"]{padding-left:40px}.ate-toc-item[data-level=\"6\"]{padding-left:48px}.ate-toc-item:before{content:\"\";position:absolute;inset:0;background:var(--ate-primary, #2563eb);opacity:0;transition:opacity .2s ease;border-radius:var(--ate-sub-border-radius, 8px);pointer-events:none}.ate-toc-item:hover{color:var(--ate-toolbar-button-active-color, var(--ate-primary, #2563eb));background:var(--ate-toolbar-button-hover-background, transparent)}.ate-toc-item:hover:before{opacity:.1}.ate-toc-item.ate-toc-active{color:var(--ate-toolbar-button-active-color, var(--ate-primary, #2563eb));background:var( --ate-toolbar-button-active-background, var(--ate-primary-light, color-mix(in srgb, var(--ate-primary, #2563eb), transparent 90%)) );font-weight:600}.ate-toc-text{font-size:.8rem;font-weight:500;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;flex:1;min-width:0;opacity:1;max-width:250px;transform:translate(0);margin-left:4px;margin-right:0;transition:opacity .25s cubic-bezier(.25,.46,.45,.94),max-width .3s cubic-bezier(.25,.46,.45,.94),transform .25s cubic-bezier(.25,.46,.45,.94),margin .25s ease}.ate-toc-dash{display:none;height:3px;color:var(--ate-toc-dash-color, var(--ate-border, #cbd5e1));flex-shrink:0;vertical-align:middle;overflow:visible;transition:all .3s cubic-bezier(.25,.46,.45,.94)}.ate-toc.ate-toc-hover-expand:not(.ate-toc-hovered) .ate-toc-header{display:none}.ate-toc.ate-toc-hover-expand:not(.ate-toc-hovered) .ate-toc-dash{display:inline-block}.ate-toc.ate-toc-hover-expand:not(.ate-toc-hovered) .ate-toc-item{height:var(--ate-toc-item-height, 18px);padding-left:0;padding-right:0;background:transparent}.ate-toc.ate-toc-hover-expand:not(.ate-toc-hovered) .ate-toc-item:before{opacity:0}.ate-toc.ate-toc-hover-expand:not(.ate-toc-hovered) .ate-toc-item:hover .ate-toc-dash,.ate-toc.ate-toc-hover-expand:not(.ate-toc-hovered) .ate-toc-item.ate-toc-active .ate-toc-dash{color:var(--ate-primary, #2563eb);opacity:1}.ate-toc.ate-toc-hover-expand.ate-toc-position-right:not(.ate-toc-hovered) .ate-toc-item{flex-direction:row-reverse;justify-content:flex-start}.ate-toc.ate-toc-hover-expand.ate-toc-position-right:not(.ate-toc-hovered) .ate-toc-text{opacity:0;max-width:0;transform:translate(4px);margin-right:0}.ate-toc.ate-toc-hover-expand:not(.ate-toc-position-right):not(.ate-toc-hovered) .ate-toc-item,.ate-toc.ate-toc-hover-expand.ate-toc-position-left:not(.ate-toc-hovered) .ate-toc-item{flex-direction:row;justify-content:flex-start}.ate-toc.ate-toc-hover-expand:not(.ate-toc-position-right):not(.ate-toc-hovered) .ate-toc-text,.ate-toc.ate-toc-hover-expand.ate-toc-position-left:not(.ate-toc-hovered) .ate-toc-text{opacity:0;max-width:0;transform:translate(-4px);margin-left:0}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
9203
|
+
}
|
|
9204
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: AteTableOfContentsComponent, decorators: [{
|
|
9205
|
+
type: Component,
|
|
9206
|
+
args: [{ selector: "ate-table-of-contents", standalone: true, imports: [], changeDetection: ChangeDetectionStrategy.OnPush, template: `
|
|
9207
|
+
<div
|
|
9208
|
+
class="ate-toc-wrapper"
|
|
9209
|
+
[class.ate-toc-floating]="floating()"
|
|
9210
|
+
[class.ate-toc-position-left]="position() === 'left'"
|
|
9211
|
+
[class.ate-toc-position-right]="position() === 'right'"
|
|
9212
|
+
(mouseenter)="setMouseHover(true)"
|
|
9213
|
+
(mouseleave)="setMouseHover(false)"
|
|
9214
|
+
(focusin)="setFocused(true)"
|
|
9215
|
+
(focusout)="setFocused(false)">
|
|
9216
|
+
<div
|
|
9217
|
+
class="ate-toc"
|
|
9218
|
+
[class.ate-toc-floating]="floating()"
|
|
9219
|
+
[class.ate-toc-position-left]="position() === 'left'"
|
|
9220
|
+
[class.ate-toc-position-right]="position() === 'right'"
|
|
9221
|
+
[class.ate-toc-variant-card]="variant() === 'card'"
|
|
9222
|
+
[class.ate-toc-variant-transparent]="variant() === 'transparent'"
|
|
9223
|
+
[class.ate-toc-variant-minimal]="variant() === 'minimal'"
|
|
9224
|
+
[class.ate-toc-hover-expand]="floating() && hoverExpand()"
|
|
9225
|
+
[class.ate-toc-hovered]="floating() && hoverExpand() && isExpanded()"
|
|
9226
|
+
role="navigation"
|
|
9227
|
+
aria-label="Table of Contents">
|
|
9228
|
+
@if (items().length > 0) {
|
|
9229
|
+
@if (showTitle()) {
|
|
9230
|
+
<div class="ate-toc-header">{{ headerTitle() }}</div>
|
|
9231
|
+
}
|
|
9232
|
+
<div class="ate-toc-list">
|
|
9233
|
+
@for (item of items(); track item.id) {
|
|
9234
|
+
<button
|
|
9235
|
+
type="button"
|
|
9236
|
+
class="ate-toc-item"
|
|
9237
|
+
[class.ate-toc-active]="item.active"
|
|
9238
|
+
[attr.aria-current]="item.active ? 'true' : null"
|
|
9239
|
+
[attr.data-level]="item.level"
|
|
9240
|
+
(click)="scrollToHeading(item, $event)"
|
|
9241
|
+
[title]="item.text">
|
|
9242
|
+
<!-- Perfect native vector SVG dash with level-adapted viewBox & width -->
|
|
9243
|
+
<svg
|
|
9244
|
+
[attr.width]="dashWidth(item.level)"
|
|
9245
|
+
height="2"
|
|
9246
|
+
[attr.viewBox]="'0 0 ' + dashWidth(item.level) + ' 2'"
|
|
9247
|
+
fill="none"
|
|
9248
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
9249
|
+
class="ate-toc-dash">
|
|
9250
|
+
<rect
|
|
9251
|
+
[attr.width]="dashWidth(item.level)"
|
|
9252
|
+
height="2"
|
|
9253
|
+
rx="1"
|
|
9254
|
+
ry="1"
|
|
9255
|
+
fill="currentColor"></rect>
|
|
9256
|
+
</svg>
|
|
9257
|
+
|
|
9258
|
+
<!-- Full heading text -->
|
|
9259
|
+
<span class="ate-toc-text">{{ item.text }}</span>
|
|
9260
|
+
</button>
|
|
9261
|
+
}
|
|
9262
|
+
</div>
|
|
9263
|
+
}
|
|
9264
|
+
</div>
|
|
9265
|
+
</div>
|
|
9266
|
+
`, styles: [":host{display:block}.ate-toc-wrapper.ate-toc-floating{position:fixed;top:var(--ate-toc-top, 50%);transform:translateY(-50%);z-index:var(--ate-toc-z-index, 95);display:flex;flex-direction:column;box-sizing:border-box}.ate-toc-wrapper.ate-toc-floating.ate-toc-position-right{right:var(--ate-toc-right, 2rem);left:auto;padding-left:var(--ate-toc-hitbox-padding, 16px);padding-right:0;padding-top:var(--ate-toc-hitbox-padding-vertical, 8px);padding-bottom:var(--ate-toc-hitbox-padding-vertical, 8px)}.ate-toc-wrapper.ate-toc-floating.ate-toc-position-left{left:var(--ate-toc-left, 2rem);right:auto;padding-right:var(--ate-toc-hitbox-padding, 16px);padding-left:0;padding-top:var(--ate-toc-hitbox-padding-vertical, 8px);padding-bottom:var(--ate-toc-hitbox-padding-vertical, 8px)}.ate-toc{font-family:inherit;-webkit-user-select:none;user-select:none;width:100%;box-sizing:border-box;transition:all .3s cubic-bezier(.25,.46,.45,.94)}.ate-toc.ate-toc-floating{max-height:var(--ate-toc-max-height, 400px);overflow:hidden;display:flex;flex-direction:column}.ate-toc.ate-toc-floating:not(.ate-toc-hover-expand),.ate-toc.ate-toc-floating.ate-toc-hover-expand:hover,.ate-toc.ate-toc-floating.ate-toc-hover-expand.ate-toc-hovered{width:var(--ate-toc-width, 240px);border-radius:var(--ate-toc-border-radius, var(--ate-border-radius, 16px));padding:var(--ate-toc-padding)}.ate-toc.ate-toc-floating.ate-toc-hover-expand:not(.ate-toc-hovered):not(:hover){width:var(--ate-toc-collapsed-width, 32px);border-radius:var(--ate-toc-collapsed-radius, 16px);padding:var(--ate-toc-padding)}.ate-toc.ate-toc-variant-card{background:var(--ate-toc-bg, var(--ate-surface, #ffffff));border:1px solid var(--ate-toc-border, var(--ate-border, #e2e8f0));border-radius:var(--ate-toc-border-radius, var(--ate-border-radius, 12px));box-shadow:var(--ate-toc-shadow, 0 4px 20px rgba(0, 0, 0, .06));padding:var(--ate-toc-padding)}.ate-toc.ate-toc-variant-minimal{background:transparent;border:1px solid transparent;box-shadow:none;border-radius:var(--ate-toc-border-radius, var(--ate-border-radius, 12px));padding:10px 12px}.ate-toc.ate-toc-variant-minimal:hover{background:var(--ate-toc-hover-bg, var(--ate-surface, rgba(255, 255, 255, .95)));border-color:var(--ate-toc-hover-border, var(--ate-border, #e2e8f0));box-shadow:var(--ate-toc-hover-shadow, 0 4px 20px rgba(0, 0, 0, .06))}.ate-toc.ate-toc-variant-transparent{background:transparent;border:none;box-shadow:none;padding:0}.ate-toc-header{font-size:.65rem;text-transform:uppercase;letter-spacing:.08em;font-weight:700;color:var(--ate-text-muted, #9ca3af);margin-bottom:10px;margin-top:6px;padding-left:12px;padding-right:0;text-align:left;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;transition:opacity .2s ease}.ate-toc-list{display:flex;flex-direction:column;gap:var(--ate-toc-text-gap, var(--ate-toc-gap, 2px));position:relative;transition:gap .2s ease}.ate-toc-item{display:flex;align-items:center;justify-content:flex-start;text-align:left;position:relative;text-decoration:none;background:transparent;border:none;padding-right:0;cursor:pointer;font:inherit;width:100%;height:var(--ate-toc-item-hover-height, 22px);color:var(--ate-toolbar-button-color, var(--ate-text-secondary, #64748b));outline:none;box-sizing:border-box;border-radius:var(--ate-sub-border-radius, 8px);transition:all .2s cubic-bezier(.4,0,.2,1);overflow:hidden}.ate-toc-item:focus-visible{outline:2px solid var(--ate-primary, #2563eb);outline-offset:1px}.ate-toc-item[data-level=\"1\"]{padding-left:8px}.ate-toc-item[data-level=\"2\"]{padding-left:16px}.ate-toc-item[data-level=\"3\"]{padding-left:24px}.ate-toc-item[data-level=\"4\"]{padding-left:32px}.ate-toc-item[data-level=\"5\"]{padding-left:40px}.ate-toc-item[data-level=\"6\"]{padding-left:48px}.ate-toc-item:before{content:\"\";position:absolute;inset:0;background:var(--ate-primary, #2563eb);opacity:0;transition:opacity .2s ease;border-radius:var(--ate-sub-border-radius, 8px);pointer-events:none}.ate-toc-item:hover{color:var(--ate-toolbar-button-active-color, var(--ate-primary, #2563eb));background:var(--ate-toolbar-button-hover-background, transparent)}.ate-toc-item:hover:before{opacity:.1}.ate-toc-item.ate-toc-active{color:var(--ate-toolbar-button-active-color, var(--ate-primary, #2563eb));background:var( --ate-toolbar-button-active-background, var(--ate-primary-light, color-mix(in srgb, var(--ate-primary, #2563eb), transparent 90%)) );font-weight:600}.ate-toc-text{font-size:.8rem;font-weight:500;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;flex:1;min-width:0;opacity:1;max-width:250px;transform:translate(0);margin-left:4px;margin-right:0;transition:opacity .25s cubic-bezier(.25,.46,.45,.94),max-width .3s cubic-bezier(.25,.46,.45,.94),transform .25s cubic-bezier(.25,.46,.45,.94),margin .25s ease}.ate-toc-dash{display:none;height:3px;color:var(--ate-toc-dash-color, var(--ate-border, #cbd5e1));flex-shrink:0;vertical-align:middle;overflow:visible;transition:all .3s cubic-bezier(.25,.46,.45,.94)}.ate-toc.ate-toc-hover-expand:not(.ate-toc-hovered) .ate-toc-header{display:none}.ate-toc.ate-toc-hover-expand:not(.ate-toc-hovered) .ate-toc-dash{display:inline-block}.ate-toc.ate-toc-hover-expand:not(.ate-toc-hovered) .ate-toc-item{height:var(--ate-toc-item-height, 18px);padding-left:0;padding-right:0;background:transparent}.ate-toc.ate-toc-hover-expand:not(.ate-toc-hovered) .ate-toc-item:before{opacity:0}.ate-toc.ate-toc-hover-expand:not(.ate-toc-hovered) .ate-toc-item:hover .ate-toc-dash,.ate-toc.ate-toc-hover-expand:not(.ate-toc-hovered) .ate-toc-item.ate-toc-active .ate-toc-dash{color:var(--ate-primary, #2563eb);opacity:1}.ate-toc.ate-toc-hover-expand.ate-toc-position-right:not(.ate-toc-hovered) .ate-toc-item{flex-direction:row-reverse;justify-content:flex-start}.ate-toc.ate-toc-hover-expand.ate-toc-position-right:not(.ate-toc-hovered) .ate-toc-text{opacity:0;max-width:0;transform:translate(4px);margin-right:0}.ate-toc.ate-toc-hover-expand:not(.ate-toc-position-right):not(.ate-toc-hovered) .ate-toc-item,.ate-toc.ate-toc-hover-expand.ate-toc-position-left:not(.ate-toc-hovered) .ate-toc-item{flex-direction:row;justify-content:flex-start}.ate-toc.ate-toc-hover-expand:not(.ate-toc-position-right):not(.ate-toc-hovered) .ate-toc-text,.ate-toc.ate-toc-hover-expand.ate-toc-position-left:not(.ate-toc-hovered) .ate-toc-text{opacity:0;max-width:0;transform:translate(-4px);margin-left:0}\n"] }]
|
|
9267
|
+
}], ctorParameters: () => [], propDecorators: { onScroll: [{
|
|
9268
|
+
type: HostListener,
|
|
9269
|
+
args: ["window:scroll", []]
|
|
9270
|
+
}, {
|
|
9271
|
+
type: HostListener,
|
|
9272
|
+
args: ["window:resize", []]
|
|
9273
|
+
}] } });
|
|
9274
|
+
|
|
8706
9275
|
/**
|
|
8707
9276
|
* Provides the necessary configuration and initialization for the Angular TipTap Editor.
|
|
8708
9277
|
* This should be called in your app.config.ts (for standalone) or main.ts.
|
|
@@ -8782,5 +9351,5 @@ const ATE_TOOLBAR_KEYS = [
|
|
|
8782
9351
|
* Generated bundle index. Do not edit.
|
|
8783
9352
|
*/
|
|
8784
9353
|
|
|
8785
|
-
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_IMAGE_UPLOAD_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, AteEditorRef, AteEditorRegistry, AteExportService, AteI18nService, AteImageCalculator, AteImageService, AteLinkService, AteMarksCalculator, AteNodeViewRenderer, AteNoopValueAccessorDirective, AteSelectionCalculator, AteStructureCalculator, AteTableCalculator, AteTooltipDirective, createAngularComponentExtension, createDefaultSlashCommands, filterSlashCommands, provideAteEditor, registerAngularComponent };
|
|
9354
|
+
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_IMAGE_UPLOAD_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, AteEditorRef, AteEditorRegistry, AteExportService, AteI18nService, AteImageCalculator, AteImageService, AteLinkService, AteMarksCalculator, AteNodeViewRenderer, AteNoopValueAccessorDirective, AteSelectionCalculator, AteStructureCalculator, AteTableCalculator, AteTableOfContentsComponent, AteTooltipDirective, createAngularComponentExtension, createDefaultSlashCommands, filterSlashCommands, provideAteEditor, registerAngularComponent };
|
|
8786
9355
|
//# sourceMappingURL=flogeez-angular-tiptap-editor.mjs.map
|