@flogeez/angular-tiptap-editor 3.0.3 → 3.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +20 -0
- package/README.md +71 -723
- package/fesm2022/flogeez-angular-tiptap-editor.mjs +462 -23
- package/fesm2022/flogeez-angular-tiptap-editor.mjs.map +1 -1
- package/index.d.ts +31 -7
- package/package.json +1 -1
|
@@ -220,15 +220,17 @@ const AteResizableImage = Node$1.create({
|
|
|
220
220
|
const handleMouseUp = () => {
|
|
221
221
|
isResizing = false;
|
|
222
222
|
document.body.classList.remove("resizing");
|
|
223
|
-
// Update Tiptap node with new dimensions
|
|
224
|
-
|
|
223
|
+
// Update Tiptap node with new dimensions at the specific position
|
|
224
|
+
const pos = typeof getPos === "function" ? getPos() : undefined;
|
|
225
|
+
if (typeof pos === "number") {
|
|
225
226
|
const finalWidth = parseInt(img.getAttribute("width") || "0");
|
|
226
227
|
const finalHeight = parseInt(img.getAttribute("height") || "0");
|
|
227
228
|
if (finalWidth && finalHeight) {
|
|
228
|
-
editor.
|
|
229
|
+
editor.view.dispatch(editor.view.state.tr.setNodeMarkup(pos, undefined, {
|
|
230
|
+
...node.attrs,
|
|
229
231
|
width: finalWidth,
|
|
230
232
|
height: finalHeight,
|
|
231
|
-
});
|
|
233
|
+
}));
|
|
232
234
|
}
|
|
233
235
|
}
|
|
234
236
|
document.removeEventListener("mousemove", handleMouseMove);
|
|
@@ -495,6 +497,7 @@ const AteTableExtension = Extension.create({
|
|
|
495
497
|
resizable: true,
|
|
496
498
|
handleWidth: 5,
|
|
497
499
|
cellMinWidth: 100,
|
|
500
|
+
allowTableNodeSelection: true,
|
|
498
501
|
}),
|
|
499
502
|
TableRow,
|
|
500
503
|
TableHeader.configure({
|
|
@@ -1073,6 +1076,8 @@ const ENGLISH_TRANSLATIONS = {
|
|
|
1073
1076
|
confirmDelete: "Are you sure you want to delete this?",
|
|
1074
1077
|
toggleEdit: "Switch to Edit Mode",
|
|
1075
1078
|
viewMode: "Switch to View Mode",
|
|
1079
|
+
blockAdd: "Click to add a block",
|
|
1080
|
+
blockDrag: "Drag to move this block",
|
|
1076
1081
|
},
|
|
1077
1082
|
common: {
|
|
1078
1083
|
cancel: "Cancel",
|
|
@@ -1244,6 +1249,8 @@ const FRENCH_TRANSLATIONS = {
|
|
|
1244
1249
|
confirmDelete: "Êtes-vous sûr de vouloir supprimer ceci ?",
|
|
1245
1250
|
toggleEdit: "Passer en mode édition",
|
|
1246
1251
|
viewMode: "Passer en mode affichage",
|
|
1252
|
+
blockAdd: "Cliquer pour ajouter un bloc",
|
|
1253
|
+
blockDrag: "Faire glisser pour déplacer ce bloc",
|
|
1247
1254
|
},
|
|
1248
1255
|
common: {
|
|
1249
1256
|
cancel: "Annuler",
|
|
@@ -3339,6 +3346,7 @@ const ATE_DEFAULT_CONFIG = {
|
|
|
3339
3346
|
showTableMenu: true,
|
|
3340
3347
|
showCellMenu: true,
|
|
3341
3348
|
enableSlashCommands: true,
|
|
3349
|
+
blockControls: "none",
|
|
3342
3350
|
floatingToolbar: false,
|
|
3343
3351
|
toolbar: ATE_DEFAULT_TOOLBAR_CONFIG,
|
|
3344
3352
|
bubbleMenu: ATE_DEFAULT_BUBBLE_MENU_CONFIG,
|
|
@@ -3408,7 +3416,7 @@ class AteBaseBubbleMenu {
|
|
|
3408
3416
|
this.updateMenu();
|
|
3409
3417
|
});
|
|
3410
3418
|
}
|
|
3411
|
-
|
|
3419
|
+
ngAfterViewInit() {
|
|
3412
3420
|
this.initTippy();
|
|
3413
3421
|
}
|
|
3414
3422
|
ngOnDestroy() {
|
|
@@ -3425,9 +3433,8 @@ class AteBaseBubbleMenu {
|
|
|
3425
3433
|
* Can be overridden for specific Tippy configurations.
|
|
3426
3434
|
*/
|
|
3427
3435
|
initTippy() {
|
|
3428
|
-
|
|
3429
|
-
|
|
3430
|
-
setTimeout(() => this.initTippy(), 50);
|
|
3436
|
+
const nativeElement = this.menuRef().nativeElement;
|
|
3437
|
+
if (!nativeElement) {
|
|
3431
3438
|
return;
|
|
3432
3439
|
}
|
|
3433
3440
|
const ed = this.editor();
|
|
@@ -3435,7 +3442,7 @@ class AteBaseBubbleMenu {
|
|
|
3435
3442
|
this.tippyInstance.destroy();
|
|
3436
3443
|
}
|
|
3437
3444
|
this.tippyInstance = tippy(document.body, {
|
|
3438
|
-
content:
|
|
3445
|
+
content: nativeElement,
|
|
3439
3446
|
trigger: "manual",
|
|
3440
3447
|
placement: "top-start",
|
|
3441
3448
|
theme: "ate-bubble-menu",
|
|
@@ -3570,7 +3577,6 @@ class AteBubbleMenuComponent extends AteBaseBubbleMenu {
|
|
|
3570
3577
|
}), ...(ngDevMode ? [{ debugName: "bubbleMenuConfig" }] : []));
|
|
3571
3578
|
}
|
|
3572
3579
|
ngOnInit() {
|
|
3573
|
-
super.ngOnInit();
|
|
3574
3580
|
const ed = this.editor();
|
|
3575
3581
|
// Specialized mousedown listener for the text bubble menu:
|
|
3576
3582
|
// This is necessary to hide the menu immediately when clicking elsewhere,
|
|
@@ -4601,7 +4607,7 @@ class AteBaseSubBubbleMenu {
|
|
|
4601
4607
|
this.updateMenu();
|
|
4602
4608
|
});
|
|
4603
4609
|
}
|
|
4604
|
-
|
|
4610
|
+
ngAfterViewInit() {
|
|
4605
4611
|
this.initTippy();
|
|
4606
4612
|
}
|
|
4607
4613
|
ngOnDestroy() {
|
|
@@ -4617,8 +4623,8 @@ class AteBaseSubBubbleMenu {
|
|
|
4617
4623
|
* Initializes the Tippy instance with sub-menu defaults.
|
|
4618
4624
|
*/
|
|
4619
4625
|
initTippy() {
|
|
4620
|
-
|
|
4621
|
-
|
|
4626
|
+
const nativeElement = this.menuRef().nativeElement;
|
|
4627
|
+
if (!nativeElement) {
|
|
4622
4628
|
return;
|
|
4623
4629
|
}
|
|
4624
4630
|
const ed = this.editor();
|
|
@@ -4626,7 +4632,7 @@ class AteBaseSubBubbleMenu {
|
|
|
4626
4632
|
this.tippyInstance.destroy();
|
|
4627
4633
|
}
|
|
4628
4634
|
this.tippyInstance = tippy(document.body, {
|
|
4629
|
-
content:
|
|
4635
|
+
content: nativeElement,
|
|
4630
4636
|
trigger: "manual",
|
|
4631
4637
|
placement: "bottom-start",
|
|
4632
4638
|
theme: "ate-bubble-menu",
|
|
@@ -5510,7 +5516,7 @@ class AteSlashCommandsComponent {
|
|
|
5510
5516
|
// updateMenu() will be called automatically when editor is ready
|
|
5511
5517
|
});
|
|
5512
5518
|
}
|
|
5513
|
-
|
|
5519
|
+
ngAfterViewInit() {
|
|
5514
5520
|
this.initTippy();
|
|
5515
5521
|
}
|
|
5516
5522
|
ngOnDestroy() {
|
|
@@ -5527,16 +5533,15 @@ class AteSlashCommandsComponent {
|
|
|
5527
5533
|
}
|
|
5528
5534
|
}
|
|
5529
5535
|
initTippy() {
|
|
5530
|
-
|
|
5531
|
-
|
|
5536
|
+
const nativeElement = this.menuRef().nativeElement;
|
|
5537
|
+
if (!nativeElement) {
|
|
5532
5538
|
return;
|
|
5533
5539
|
}
|
|
5534
|
-
const menuElement = this.menuRef().nativeElement;
|
|
5535
5540
|
if (this.tippyInstance) {
|
|
5536
5541
|
this.tippyInstance.destroy();
|
|
5537
5542
|
}
|
|
5538
5543
|
this.tippyInstance = tippy(document.body, {
|
|
5539
|
-
content:
|
|
5544
|
+
content: nativeElement,
|
|
5540
5545
|
trigger: "manual",
|
|
5541
5546
|
placement: "bottom-start",
|
|
5542
5547
|
theme: "slash-menu",
|
|
@@ -5740,6 +5745,257 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImpo
|
|
|
5740
5745
|
`, styles: [".slash-commands-menu{background:var(--ate-menu-bg);border:1px solid var(--ate-menu-border);border-radius:var(--ate-menu-border-radius, 12px);box-shadow:var(--ate-menu-shadow);padding:var(--ate-menu-padding);max-height:320px;overflow-y:auto;min-width:280px;outline:none;animation:slashMenuFadeIn .2s cubic-bezier(0,0,.2,1);scrollbar-width:thin;scrollbar-color:var(--ate-scrollbar-thumb) var(--ate-scrollbar-track)}.slash-commands-menu::-webkit-scrollbar{width:var(--ate-scrollbar-width)}.slash-commands-menu::-webkit-scrollbar-track{background:var(--ate-scrollbar-track)}.slash-commands-menu::-webkit-scrollbar-thumb{background:var(--ate-scrollbar-thumb);border:3px solid transparent;background-clip:content-box;border-radius:10px}.slash-commands-menu::-webkit-scrollbar-thumb:hover{background:var(--ate-scrollbar-thumb-hover);background-clip:content-box}@keyframes slashMenuFadeIn{0%{opacity:0;transform:translateY(4px)}to{opacity:1;transform:translateY(0)}}.slash-command-item{display:flex;align-items:center;gap:12px;padding:var(--ate-menu-padding);border-radius:var(--ate-menu-border-radius, 8px);cursor:pointer;transition:all .15s ease;border:var(--ate-border-width, 1px) solid transparent;outline:none;margin-bottom:2px}.slash-command-item:last-child{margin-bottom:0}.slash-command-item:hover{background:var(--ate-surface-secondary)}.slash-command-item.selected{background:var(--ate-primary-light);border-color:var(--ate-primary-light-alpha)}.slash-command-icon{display:flex;align-items:center;justify-content:center;width:32px;height:32px;background:var(--ate-surface-tertiary);border-radius:var(--ate-sub-border-radius, 8px);color:var(--ate-primary);flex-shrink:0;transition:all .15s ease}.slash-command-item.selected .slash-command-icon{background:var(--ate-primary);color:var(--ate-primary-contrast, #ffffff)}.slash-command-icon .material-symbols-outlined{font-size:18px}.slash-command-content{flex:1;min-width:0}.slash-command-title{font-weight:500;color:var(--ate-text);font-size:14px;margin-bottom:1px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.slash-command-description{color:var(--ate-text-secondary);font-size:11px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}\n"] }]
|
|
5741
5746
|
}], ctorParameters: () => [], propDecorators: { editor: [{ type: i0.Input, args: [{ isSignal: true, alias: "editor", required: true }] }], config: [{ type: i0.Input, args: [{ isSignal: true, alias: "config", required: false }] }], menuRef: [{ type: i0.ViewChild, args: ["menuRef", { isSignal: true }] }] } });
|
|
5742
5747
|
|
|
5748
|
+
/**
|
|
5749
|
+
* Component providing Notion-like block controls (Plus button and Drag Handle).
|
|
5750
|
+
*/
|
|
5751
|
+
class AteBlockControlsComponent {
|
|
5752
|
+
constructor() {
|
|
5753
|
+
this.i18n = inject(AteI18nService);
|
|
5754
|
+
this.editor = input.required(...(ngDevMode ? [{ debugName: "editor" }] : []));
|
|
5755
|
+
this.hoveredData = input(null, ...(ngDevMode ? [{ debugName: "hoveredData" }] : []));
|
|
5756
|
+
this.menuRef = viewChild.required("menuRef");
|
|
5757
|
+
this.isInteracting = signal(false, ...(ngDevMode ? [{ debugName: "isInteracting" }] : []));
|
|
5758
|
+
this.lastValidData = null;
|
|
5759
|
+
this.lastValidRect = null;
|
|
5760
|
+
this.tippyInstance = null;
|
|
5761
|
+
this.updateTimeout = null;
|
|
5762
|
+
effect(() => {
|
|
5763
|
+
const data = this.hoveredData();
|
|
5764
|
+
const interacting = this.isInteracting();
|
|
5765
|
+
if (data) {
|
|
5766
|
+
this.lastValidData = data;
|
|
5767
|
+
this.lastValidRect = data.element.getBoundingClientRect();
|
|
5768
|
+
}
|
|
5769
|
+
this.updateMenu(!!data || interacting);
|
|
5770
|
+
});
|
|
5771
|
+
}
|
|
5772
|
+
ngAfterViewInit() {
|
|
5773
|
+
this.initTippy();
|
|
5774
|
+
}
|
|
5775
|
+
ngOnDestroy() {
|
|
5776
|
+
if (this.updateTimeout) {
|
|
5777
|
+
window.clearTimeout(this.updateTimeout);
|
|
5778
|
+
}
|
|
5779
|
+
if (this.tippyInstance) {
|
|
5780
|
+
this.tippyInstance.destroy();
|
|
5781
|
+
this.tippyInstance = null;
|
|
5782
|
+
}
|
|
5783
|
+
}
|
|
5784
|
+
initTippy() {
|
|
5785
|
+
const nativeElement = this.menuRef().nativeElement;
|
|
5786
|
+
if (!nativeElement) {
|
|
5787
|
+
return;
|
|
5788
|
+
}
|
|
5789
|
+
this.tippyInstance = tippy(document.body, {
|
|
5790
|
+
content: nativeElement,
|
|
5791
|
+
trigger: "manual",
|
|
5792
|
+
placement: "left",
|
|
5793
|
+
theme: "ate-block-controls",
|
|
5794
|
+
appendTo: () => this.editor()?.options?.element || document.body,
|
|
5795
|
+
interactive: true,
|
|
5796
|
+
hideOnClick: false,
|
|
5797
|
+
arrow: false,
|
|
5798
|
+
offset: [0, 8],
|
|
5799
|
+
zIndex: 99,
|
|
5800
|
+
plugins: [sticky],
|
|
5801
|
+
sticky: "reference",
|
|
5802
|
+
moveTransition: "transform 0.2s ease-out",
|
|
5803
|
+
getReferenceClientRect: () => this.getSelectionRect(),
|
|
5804
|
+
popperOptions: {
|
|
5805
|
+
modifiers: [
|
|
5806
|
+
{
|
|
5807
|
+
name: "preventOverflow",
|
|
5808
|
+
options: {
|
|
5809
|
+
boundary: this.editor()?.options?.element || document.body,
|
|
5810
|
+
padding: 8,
|
|
5811
|
+
},
|
|
5812
|
+
},
|
|
5813
|
+
],
|
|
5814
|
+
},
|
|
5815
|
+
});
|
|
5816
|
+
}
|
|
5817
|
+
updateMenu(show) {
|
|
5818
|
+
if (this.updateTimeout) {
|
|
5819
|
+
window.clearTimeout(this.updateTimeout);
|
|
5820
|
+
}
|
|
5821
|
+
const delay = show ? 0 : 400;
|
|
5822
|
+
this.updateTimeout = window.setTimeout(() => {
|
|
5823
|
+
if (show) {
|
|
5824
|
+
this.showTippy();
|
|
5825
|
+
}
|
|
5826
|
+
else {
|
|
5827
|
+
this.hideTippy();
|
|
5828
|
+
}
|
|
5829
|
+
}, delay);
|
|
5830
|
+
}
|
|
5831
|
+
showTippy() {
|
|
5832
|
+
if (this.tippyInstance) {
|
|
5833
|
+
this.tippyInstance.setProps({
|
|
5834
|
+
getReferenceClientRect: () => this.getSelectionRect(),
|
|
5835
|
+
});
|
|
5836
|
+
this.tippyInstance.show();
|
|
5837
|
+
}
|
|
5838
|
+
}
|
|
5839
|
+
hideTippy() {
|
|
5840
|
+
if (this.tippyInstance) {
|
|
5841
|
+
this.tippyInstance.hide();
|
|
5842
|
+
}
|
|
5843
|
+
}
|
|
5844
|
+
getSelectionRect() {
|
|
5845
|
+
const data = this.hoveredData();
|
|
5846
|
+
if (data && data.element) {
|
|
5847
|
+
return data.element.getBoundingClientRect();
|
|
5848
|
+
}
|
|
5849
|
+
return this.lastValidRect || new DOMRect(-9999, -9999, 0, 0);
|
|
5850
|
+
}
|
|
5851
|
+
onMouseEnter() {
|
|
5852
|
+
this.isInteracting.set(true);
|
|
5853
|
+
}
|
|
5854
|
+
onMouseLeave() {
|
|
5855
|
+
this.isInteracting.set(false);
|
|
5856
|
+
}
|
|
5857
|
+
onContainerMouseDown(event) {
|
|
5858
|
+
if (event.target === event.currentTarget) {
|
|
5859
|
+
event.preventDefault();
|
|
5860
|
+
}
|
|
5861
|
+
}
|
|
5862
|
+
onButtonMouseDown(event) {
|
|
5863
|
+
event.preventDefault();
|
|
5864
|
+
}
|
|
5865
|
+
/**
|
|
5866
|
+
* Selection strategy to avoid partial node dragging (ghost table issue).
|
|
5867
|
+
*/
|
|
5868
|
+
onDragHandleMouseDown(event) {
|
|
5869
|
+
event.stopPropagation();
|
|
5870
|
+
const ed = this.editor();
|
|
5871
|
+
const data = this.hoveredData() || this.lastValidData;
|
|
5872
|
+
if (ed && data) {
|
|
5873
|
+
// Force whole-node selection. This is crucial for atomic nodes like tables and images.
|
|
5874
|
+
ed.commands.setNodeSelection(data.pos);
|
|
5875
|
+
}
|
|
5876
|
+
}
|
|
5877
|
+
addBlock(event) {
|
|
5878
|
+
event.stopPropagation();
|
|
5879
|
+
const ed = this.editor();
|
|
5880
|
+
const data = this.hoveredData() || this.lastValidData;
|
|
5881
|
+
if (!ed || !data) {
|
|
5882
|
+
return;
|
|
5883
|
+
}
|
|
5884
|
+
const { pos, node } = data;
|
|
5885
|
+
if (node.content.size === 0) {
|
|
5886
|
+
ed.chain()
|
|
5887
|
+
.focus()
|
|
5888
|
+
.setTextSelection(pos + 1)
|
|
5889
|
+
.insertContent("/")
|
|
5890
|
+
.run();
|
|
5891
|
+
}
|
|
5892
|
+
else {
|
|
5893
|
+
const nextPos = pos + node.nodeSize;
|
|
5894
|
+
ed.chain()
|
|
5895
|
+
.focus()
|
|
5896
|
+
.insertContentAt(nextPos, { type: "paragraph", content: [{ type: "text", text: "/" }] })
|
|
5897
|
+
.setTextSelection(nextPos + 2)
|
|
5898
|
+
.run();
|
|
5899
|
+
}
|
|
5900
|
+
this.isInteracting.set(false);
|
|
5901
|
+
this.hideTippy();
|
|
5902
|
+
}
|
|
5903
|
+
onDragStart(event) {
|
|
5904
|
+
const ed = this.editor();
|
|
5905
|
+
const data = this.hoveredData() || this.lastValidData;
|
|
5906
|
+
if (!ed || !data || !event.dataTransfer) {
|
|
5907
|
+
return;
|
|
5908
|
+
}
|
|
5909
|
+
const { element, pos } = data;
|
|
5910
|
+
const view = ed.view;
|
|
5911
|
+
// 1. Force the editor to focus and select the ENTIRE node
|
|
5912
|
+
view.focus();
|
|
5913
|
+
ed.commands.setNodeSelection(pos);
|
|
5914
|
+
// 2. Browser Drag Image & metadata
|
|
5915
|
+
event.dataTransfer.setDragImage(element, 0, 10);
|
|
5916
|
+
event.dataTransfer.effectAllowed = "move";
|
|
5917
|
+
event.dataTransfer.setData("text/plain", "");
|
|
5918
|
+
// 3. PRO-HACK: Indicate this is a move of the current selection (the whole node)
|
|
5919
|
+
view.dragging = {
|
|
5920
|
+
slice: ed.state.selection.content(),
|
|
5921
|
+
move: true,
|
|
5922
|
+
};
|
|
5923
|
+
// 4. Dispatch virtual dragstart
|
|
5924
|
+
const pmEvent = new DragEvent("dragstart", {
|
|
5925
|
+
dataTransfer: event.dataTransfer,
|
|
5926
|
+
bubbles: true,
|
|
5927
|
+
cancelable: true,
|
|
5928
|
+
});
|
|
5929
|
+
element.dispatchEvent(pmEvent);
|
|
5930
|
+
// 5. Cleanup UI
|
|
5931
|
+
setTimeout(() => {
|
|
5932
|
+
this.hideTippy();
|
|
5933
|
+
this.isInteracting.set(false);
|
|
5934
|
+
}, 0);
|
|
5935
|
+
}
|
|
5936
|
+
onDragEnd() {
|
|
5937
|
+
this.isInteracting.set(false);
|
|
5938
|
+
}
|
|
5939
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: AteBlockControlsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
5940
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "20.3.16", type: AteBlockControlsComponent, isStandalone: true, selector: "ate-block-controls", inputs: { editor: { classPropertyName: "editor", publicName: "editor", isSignal: true, isRequired: true, transformFunction: null }, hoveredData: { classPropertyName: "hoveredData", publicName: "hoveredData", isSignal: true, isRequired: false, transformFunction: null } }, viewQueries: [{ propertyName: "menuRef", first: true, predicate: ["menuRef"], descendants: true, isSignal: true }], ngImport: i0, template: `
|
|
5941
|
+
<div
|
|
5942
|
+
#menuRef
|
|
5943
|
+
class="ate-block-controls"
|
|
5944
|
+
(mouseenter)="onMouseEnter()"
|
|
5945
|
+
(mouseleave)="onMouseLeave()"
|
|
5946
|
+
(mousedown)="onContainerMouseDown($event)">
|
|
5947
|
+
<button
|
|
5948
|
+
class="ate-control-btn ate-block-add"
|
|
5949
|
+
(mousedown)="onButtonMouseDown($event)"
|
|
5950
|
+
(click)="addBlock($event)"
|
|
5951
|
+
[ateTooltip]="i18n.editor().blockAdd"
|
|
5952
|
+
ateTooltipPlacement="top">
|
|
5953
|
+
<span class="material-symbols-outlined">add</span>
|
|
5954
|
+
</button>
|
|
5955
|
+
<div
|
|
5956
|
+
class="ate-control-btn ate-block-drag"
|
|
5957
|
+
draggable="true"
|
|
5958
|
+
(mousedown)="onDragHandleMouseDown($event)"
|
|
5959
|
+
(dragstart)="onDragStart($event)"
|
|
5960
|
+
(dragend)="onDragEnd()"
|
|
5961
|
+
[ateTooltip]="i18n.editor().blockDrag"
|
|
5962
|
+
ateTooltipPlacement="top">
|
|
5963
|
+
<span class="material-symbols-outlined">drag_indicator</span>
|
|
5964
|
+
</div>
|
|
5965
|
+
</div>
|
|
5966
|
+
`, isInline: true, styles: [".ate-block-controls{display:flex;align-items:center;gap:2px;padding:4px;pointer-events:auto;will-change:transform}.ate-control-btn{display:flex;align-items:center;justify-content:center;width:24px;height:24px;border-radius:4px;border:none;background:transparent;color:var(--ate-text-secondary);cursor:pointer;transition:all .15s ease}.ate-control-btn:hover{background:var(--ate-surface-tertiary);color:var(--ate-text)}.ate-control-btn .material-symbols-outlined{font-size:18px}@media (max-width: 768px){:host{display:none!important}}\n"], dependencies: [{ kind: "directive", type: AteTooltipDirective, selector: "[ateTooltip]", inputs: ["ateTooltip", "ateTooltipPlacement", "ateTooltipDelay", "ateTooltipDisabled"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
5967
|
+
}
|
|
5968
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: AteBlockControlsComponent, decorators: [{
|
|
5969
|
+
type: Component,
|
|
5970
|
+
args: [{ selector: "ate-block-controls", standalone: true, imports: [AteTooltipDirective], changeDetection: ChangeDetectionStrategy.OnPush, template: `
|
|
5971
|
+
<div
|
|
5972
|
+
#menuRef
|
|
5973
|
+
class="ate-block-controls"
|
|
5974
|
+
(mouseenter)="onMouseEnter()"
|
|
5975
|
+
(mouseleave)="onMouseLeave()"
|
|
5976
|
+
(mousedown)="onContainerMouseDown($event)">
|
|
5977
|
+
<button
|
|
5978
|
+
class="ate-control-btn ate-block-add"
|
|
5979
|
+
(mousedown)="onButtonMouseDown($event)"
|
|
5980
|
+
(click)="addBlock($event)"
|
|
5981
|
+
[ateTooltip]="i18n.editor().blockAdd"
|
|
5982
|
+
ateTooltipPlacement="top">
|
|
5983
|
+
<span class="material-symbols-outlined">add</span>
|
|
5984
|
+
</button>
|
|
5985
|
+
<div
|
|
5986
|
+
class="ate-control-btn ate-block-drag"
|
|
5987
|
+
draggable="true"
|
|
5988
|
+
(mousedown)="onDragHandleMouseDown($event)"
|
|
5989
|
+
(dragstart)="onDragStart($event)"
|
|
5990
|
+
(dragend)="onDragEnd()"
|
|
5991
|
+
[ateTooltip]="i18n.editor().blockDrag"
|
|
5992
|
+
ateTooltipPlacement="top">
|
|
5993
|
+
<span class="material-symbols-outlined">drag_indicator</span>
|
|
5994
|
+
</div>
|
|
5995
|
+
</div>
|
|
5996
|
+
`, styles: [".ate-block-controls{display:flex;align-items:center;gap:2px;padding:4px;pointer-events:auto;will-change:transform}.ate-control-btn{display:flex;align-items:center;justify-content:center;width:24px;height:24px;border-radius:4px;border:none;background:transparent;color:var(--ate-text-secondary);cursor:pointer;transition:all .15s ease}.ate-control-btn:hover{background:var(--ate-surface-tertiary);color:var(--ate-text)}.ate-control-btn .material-symbols-outlined{font-size:18px}@media (max-width: 768px){:host{display:none!important}}\n"] }]
|
|
5997
|
+
}], ctorParameters: () => [], propDecorators: { editor: [{ type: i0.Input, args: [{ isSignal: true, alias: "editor", required: true }] }], hoveredData: [{ type: i0.Input, args: [{ isSignal: true, alias: "hoveredData", required: false }] }], menuRef: [{ type: i0.ViewChild, args: ["menuRef", { isSignal: true }] }] } });
|
|
5998
|
+
|
|
5743
5999
|
/**
|
|
5744
6000
|
* Edit Toggle Component
|
|
5745
6001
|
* Allows switching between editable and readonly modes
|
|
@@ -6529,6 +6785,160 @@ const AteLinkClickBehavior = Extension.create({
|
|
|
6529
6785
|
},
|
|
6530
6786
|
});
|
|
6531
6787
|
|
|
6788
|
+
// Helper to get the DOM element properly
|
|
6789
|
+
function getDomElement(view, pos) {
|
|
6790
|
+
const dom = view.nodeDOM(pos);
|
|
6791
|
+
if (!dom) {
|
|
6792
|
+
return null;
|
|
6793
|
+
}
|
|
6794
|
+
if (dom instanceof HTMLElement) {
|
|
6795
|
+
return dom;
|
|
6796
|
+
}
|
|
6797
|
+
return dom.parentElement;
|
|
6798
|
+
}
|
|
6799
|
+
// VERTICAL SCAN (For the empty margin)
|
|
6800
|
+
function findBlockElementAtY(view, y) {
|
|
6801
|
+
const editorDom = view.dom;
|
|
6802
|
+
const children = Array.from(editorDom.children);
|
|
6803
|
+
// We look for the direct child of the editor (Level 1) that intercepts the Y line
|
|
6804
|
+
return (children.find(child => {
|
|
6805
|
+
if (getComputedStyle(child).position === "absolute") {
|
|
6806
|
+
return false;
|
|
6807
|
+
}
|
|
6808
|
+
const rect = child.getBoundingClientRect();
|
|
6809
|
+
// Tolérance de 5px
|
|
6810
|
+
return y >= rect.top - 5 && y <= rect.bottom + 5;
|
|
6811
|
+
}) || null);
|
|
6812
|
+
}
|
|
6813
|
+
function resolveBlockData(view, y, targetElement) {
|
|
6814
|
+
let blockEl = null;
|
|
6815
|
+
// 1. FAST PATH : Direct target
|
|
6816
|
+
// LEVEL 1: We look for the first parent element that is a direct child of the editor
|
|
6817
|
+
if (targetElement && !targetElement.classList.contains("ProseMirror")) {
|
|
6818
|
+
blockEl = targetElement.closest(".ProseMirror > *");
|
|
6819
|
+
}
|
|
6820
|
+
// 2. GUTTER PATH : Vertical scan
|
|
6821
|
+
if (!blockEl) {
|
|
6822
|
+
blockEl = findBlockElementAtY(view, y);
|
|
6823
|
+
}
|
|
6824
|
+
if (!blockEl) {
|
|
6825
|
+
return null;
|
|
6826
|
+
}
|
|
6827
|
+
// 3. PROSEMIRROR NODE RESOLUTION
|
|
6828
|
+
try {
|
|
6829
|
+
// We ask for the position at the beginning of this root block
|
|
6830
|
+
const pos = view.posAtDOM(blockEl, 0);
|
|
6831
|
+
const $pos = view.state.doc.resolve(pos);
|
|
6832
|
+
// CASE A : STANDARD BLOCKS (H1, P, Lists, Blockquotes...)
|
|
6833
|
+
// We make sure to take the node of depth 1 (Direct child of the Doc)
|
|
6834
|
+
if ($pos.depth >= 1) {
|
|
6835
|
+
const rootNode = $pos.node(1);
|
|
6836
|
+
const rootPos = $pos.before(1);
|
|
6837
|
+
const rootElement = getDomElement(view, rootPos);
|
|
6838
|
+
// Sécurité : on vérifie que l'élément DOM correspond bien
|
|
6839
|
+
if (rootNode && (rootElement || blockEl)) {
|
|
6840
|
+
return { node: rootNode, element: rootElement || blockEl, pos: rootPos };
|
|
6841
|
+
}
|
|
6842
|
+
}
|
|
6843
|
+
// CASE B : IMAGES / ATOMS (Depth 0)
|
|
6844
|
+
// Sometimes a root image is seen as Depth 0 by resolve()
|
|
6845
|
+
// We look at the node right after the position
|
|
6846
|
+
if ($pos.depth === 0) {
|
|
6847
|
+
const nodeAfter = $pos.nodeAfter;
|
|
6848
|
+
if (nodeAfter && (nodeAfter.isBlock || nodeAfter.isAtom)) {
|
|
6849
|
+
return { node: nodeAfter, element: blockEl, pos: pos };
|
|
6850
|
+
}
|
|
6851
|
+
}
|
|
6852
|
+
}
|
|
6853
|
+
catch (_e) {
|
|
6854
|
+
// console.warn(_e);
|
|
6855
|
+
}
|
|
6856
|
+
return null;
|
|
6857
|
+
}
|
|
6858
|
+
const AteBlockControlsExtension = Extension.create({
|
|
6859
|
+
name: "ateBlockControls",
|
|
6860
|
+
addOptions() {
|
|
6861
|
+
return { onHover: undefined };
|
|
6862
|
+
},
|
|
6863
|
+
addProseMirrorPlugins() {
|
|
6864
|
+
let lastHoveredElement = null;
|
|
6865
|
+
let lastHoveredPos = null;
|
|
6866
|
+
let rafId = null;
|
|
6867
|
+
let lastMouseX = 0;
|
|
6868
|
+
let lastMouseY = 0;
|
|
6869
|
+
const update = (view) => {
|
|
6870
|
+
if (!this.editor.isEditable) {
|
|
6871
|
+
return;
|
|
6872
|
+
}
|
|
6873
|
+
const editorRect = view.dom.getBoundingClientRect();
|
|
6874
|
+
const gutterWidth = 80;
|
|
6875
|
+
// Check Limites (Marge Gauche + Editeur)
|
|
6876
|
+
if (lastMouseY < editorRect.top ||
|
|
6877
|
+
lastMouseY > editorRect.bottom ||
|
|
6878
|
+
lastMouseX > editorRect.right ||
|
|
6879
|
+
lastMouseX < editorRect.left - gutterWidth) {
|
|
6880
|
+
if (lastHoveredElement) {
|
|
6881
|
+
reset();
|
|
6882
|
+
}
|
|
6883
|
+
return;
|
|
6884
|
+
}
|
|
6885
|
+
// STICKY ANTI-FLICKER
|
|
6886
|
+
// On garde le bloc tant qu'on est dans sa hauteur
|
|
6887
|
+
if (lastHoveredElement && lastHoveredElement.isConnected) {
|
|
6888
|
+
const rect = lastHoveredElement.getBoundingClientRect();
|
|
6889
|
+
if (lastMouseY >= rect.top && lastMouseY <= rect.bottom) {
|
|
6890
|
+
return;
|
|
6891
|
+
}
|
|
6892
|
+
}
|
|
6893
|
+
const target = document.elementFromPoint(lastMouseX, lastMouseY);
|
|
6894
|
+
const data = resolveBlockData(view, lastMouseY, target);
|
|
6895
|
+
if (data && (data.element !== lastHoveredElement || data.pos !== lastHoveredPos)) {
|
|
6896
|
+
lastHoveredElement = data.element;
|
|
6897
|
+
lastHoveredPos = data.pos;
|
|
6898
|
+
this.options.onHover?.(data);
|
|
6899
|
+
}
|
|
6900
|
+
else if (!data) {
|
|
6901
|
+
if (!lastHoveredElement || !lastHoveredElement.isConnected) {
|
|
6902
|
+
reset();
|
|
6903
|
+
}
|
|
6904
|
+
}
|
|
6905
|
+
};
|
|
6906
|
+
const reset = () => {
|
|
6907
|
+
this.options.onHover?.(null);
|
|
6908
|
+
lastHoveredElement = null;
|
|
6909
|
+
lastHoveredPos = null;
|
|
6910
|
+
};
|
|
6911
|
+
return [
|
|
6912
|
+
new Plugin({
|
|
6913
|
+
key: new PluginKey("ateBlockControls"),
|
|
6914
|
+
props: {
|
|
6915
|
+
handleDOMEvents: {
|
|
6916
|
+
mousemove: (view, event) => {
|
|
6917
|
+
lastMouseX = event.clientX;
|
|
6918
|
+
lastMouseY = event.clientY;
|
|
6919
|
+
if (rafId === null) {
|
|
6920
|
+
rafId = window.requestAnimationFrame(() => {
|
|
6921
|
+
update(view);
|
|
6922
|
+
rafId = null;
|
|
6923
|
+
});
|
|
6924
|
+
}
|
|
6925
|
+
return false;
|
|
6926
|
+
},
|
|
6927
|
+
mouseleave: () => {
|
|
6928
|
+
if (rafId) {
|
|
6929
|
+
window.cancelAnimationFrame(rafId);
|
|
6930
|
+
rafId = null;
|
|
6931
|
+
}
|
|
6932
|
+
reset();
|
|
6933
|
+
return false;
|
|
6934
|
+
},
|
|
6935
|
+
},
|
|
6936
|
+
},
|
|
6937
|
+
}),
|
|
6938
|
+
];
|
|
6939
|
+
},
|
|
6940
|
+
});
|
|
6941
|
+
|
|
6532
6942
|
// Slash commands configuration is handled dynamically via slashCommandsConfigComputed
|
|
6533
6943
|
/**
|
|
6534
6944
|
* The main rich-text editor component for Angular.
|
|
@@ -6568,6 +6978,7 @@ class AngularTiptapEditorComponent {
|
|
|
6568
6978
|
this.enableSlashCommands = input(undefined, ...(ngDevMode ? [{ debugName: "enableSlashCommands" }] : []));
|
|
6569
6979
|
this.slashCommands = input(undefined, ...(ngDevMode ? [{ debugName: "slashCommands" }] : []));
|
|
6570
6980
|
this.customSlashCommands = input(undefined, ...(ngDevMode ? [{ debugName: "customSlashCommands" }] : []));
|
|
6981
|
+
this.blockControls = input(...(ngDevMode ? [undefined, { debugName: "blockControls" }] : []));
|
|
6571
6982
|
this.locale = input(undefined, ...(ngDevMode ? [{ debugName: "locale" }] : []));
|
|
6572
6983
|
this.autofocus = input(undefined, ...(ngDevMode ? [{ debugName: "autofocus" }] : []));
|
|
6573
6984
|
this.seamless = input(undefined, ...(ngDevMode ? [{ debugName: "seamless" }] : []));
|
|
@@ -6629,6 +7040,7 @@ class AngularTiptapEditorComponent {
|
|
|
6629
7040
|
this._wordCount = signal(0, ...(ngDevMode ? [{ debugName: "_wordCount" }] : []));
|
|
6630
7041
|
this._isDragOver = signal(false, ...(ngDevMode ? [{ debugName: "_isDragOver" }] : []));
|
|
6631
7042
|
this._editorFullyInitialized = signal(false, ...(ngDevMode ? [{ debugName: "_editorFullyInitialized" }] : []));
|
|
7043
|
+
this._hoveredBlock = signal(null, ...(ngDevMode ? [{ debugName: "_hoveredBlock" }] : []));
|
|
6632
7044
|
// Anti-echo: track last emitted HTML to prevent cursor reset on parent echo
|
|
6633
7045
|
this.lastEmittedHtml = null;
|
|
6634
7046
|
// Read-only access to signals
|
|
@@ -6637,6 +7049,7 @@ class AngularTiptapEditorComponent {
|
|
|
6637
7049
|
this.wordCount = this._wordCount.asReadonly();
|
|
6638
7050
|
this.isDragOver = this._isDragOver.asReadonly();
|
|
6639
7051
|
this.editorFullyInitialized = this._editorFullyInitialized.asReadonly();
|
|
7052
|
+
this.hoveredBlock = this._hoveredBlock.asReadonly();
|
|
6640
7053
|
this._isFormControlDisabled = signal(false, ...(ngDevMode ? [{ debugName: "_isFormControlDisabled" }] : []));
|
|
6641
7054
|
this.isFormControlDisabled = this._isFormControlDisabled.asReadonly();
|
|
6642
7055
|
// Combined disabled state (Input + FormControl)
|
|
@@ -6763,6 +7176,7 @@ class AngularTiptapEditorComponent {
|
|
|
6763
7176
|
// Behavior
|
|
6764
7177
|
this.finalAutofocus = computed(() => this.autofocus() ?? this.effectiveConfig().autofocus, ...(ngDevMode ? [{ debugName: "finalAutofocus" }] : []));
|
|
6765
7178
|
this.finalMaxCharacters = computed(() => this.maxCharacters() ?? this.effectiveConfig().maxCharacters, ...(ngDevMode ? [{ debugName: "finalMaxCharacters" }] : []));
|
|
7179
|
+
this.finalBlockControls = computed(() => this.blockControls() ?? this.effectiveConfig().blockControls ?? "none", ...(ngDevMode ? [{ debugName: "finalBlockControls" }] : []));
|
|
6766
7180
|
this.finalShowCharacterCount = computed(() => this.showCharacterCount() ?? this.effectiveConfig().showCharacterCount ?? true, ...(ngDevMode ? [{ debugName: "finalShowCharacterCount" }] : []));
|
|
6767
7181
|
this.finalShowWordCount = computed(() => this.showWordCount() ?? this.effectiveConfig().showWordCount ?? true, ...(ngDevMode ? [{ debugName: "finalShowWordCount" }] : []));
|
|
6768
7182
|
this.finalLocale = computed(() => this.locale() ?? this.effectiveConfig().locale, ...(ngDevMode ? [{ debugName: "finalLocale" }] : []));
|
|
@@ -6886,6 +7300,7 @@ class AngularTiptapEditorComponent {
|
|
|
6886
7300
|
this.finalTiptapExtensions();
|
|
6887
7301
|
this.finalTiptapOptions();
|
|
6888
7302
|
this.finalAngularNodesConfig();
|
|
7303
|
+
this.finalBlockControls();
|
|
6889
7304
|
untracked(() => {
|
|
6890
7305
|
// Only if already initialized (post AfterViewInit)
|
|
6891
7306
|
if (this.editorFullyInitialized()) {
|
|
@@ -6968,6 +7383,11 @@ class AngularTiptapEditorComponent {
|
|
|
6968
7383
|
],
|
|
6969
7384
|
}),
|
|
6970
7385
|
];
|
|
7386
|
+
if (this.finalBlockControls() !== "none") {
|
|
7387
|
+
extensions.push(AteBlockControlsExtension.configure({
|
|
7388
|
+
onHover: data => this._hoveredBlock.set(data),
|
|
7389
|
+
}));
|
|
7390
|
+
}
|
|
6971
7391
|
// Ajouter l'extension Office Paste si activée
|
|
6972
7392
|
if (this.finalEnableOfficePaste()) {
|
|
6973
7393
|
extensions.push(OfficePaste.configure({
|
|
@@ -7194,7 +7614,7 @@ class AngularTiptapEditorComponent {
|
|
|
7194
7614
|
}
|
|
7195
7615
|
}
|
|
7196
7616
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: AngularTiptapEditorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
7197
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.16", type: AngularTiptapEditorComponent, isStandalone: true, selector: "angular-tiptap-editor", inputs: { config: { classPropertyName: "config", publicName: "config", isSignal: true, isRequired: false, transformFunction: null }, content: { classPropertyName: "content", publicName: "content", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, editable: { classPropertyName: "editable", publicName: "editable", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, minHeight: { classPropertyName: "minHeight", publicName: "minHeight", isSignal: true, isRequired: false, transformFunction: null }, height: { classPropertyName: "height", publicName: "height", isSignal: true, isRequired: false, transformFunction: null }, maxHeight: { classPropertyName: "maxHeight", publicName: "maxHeight", isSignal: true, isRequired: false, transformFunction: null }, fillContainer: { classPropertyName: "fillContainer", publicName: "fillContainer", isSignal: true, isRequired: false, transformFunction: null }, showToolbar: { classPropertyName: "showToolbar", publicName: "showToolbar", isSignal: true, isRequired: false, transformFunction: null }, showFooter: { classPropertyName: "showFooter", publicName: "showFooter", isSignal: true, isRequired: false, transformFunction: null }, showCharacterCount: { classPropertyName: "showCharacterCount", publicName: "showCharacterCount", isSignal: true, isRequired: false, transformFunction: null }, showWordCount: { classPropertyName: "showWordCount", publicName: "showWordCount", isSignal: true, isRequired: false, transformFunction: null }, maxCharacters: { classPropertyName: "maxCharacters", publicName: "maxCharacters", isSignal: true, isRequired: false, transformFunction: null }, enableOfficePaste: { classPropertyName: "enableOfficePaste", publicName: "enableOfficePaste", isSignal: true, isRequired: false, transformFunction: null }, enableSlashCommands: { classPropertyName: "enableSlashCommands", publicName: "enableSlashCommands", isSignal: true, isRequired: false, transformFunction: null }, slashCommands: { classPropertyName: "slashCommands", publicName: "slashCommands", isSignal: true, isRequired: false, transformFunction: null }, customSlashCommands: { classPropertyName: "customSlashCommands", publicName: "customSlashCommands", isSignal: true, isRequired: false, transformFunction: null }, locale: { classPropertyName: "locale", publicName: "locale", isSignal: true, isRequired: false, transformFunction: null }, autofocus: { classPropertyName: "autofocus", publicName: "autofocus", isSignal: true, isRequired: false, transformFunction: null }, seamless: { classPropertyName: "seamless", publicName: "seamless", isSignal: true, isRequired: false, transformFunction: null }, floatingToolbar: { classPropertyName: "floatingToolbar", publicName: "floatingToolbar", isSignal: true, isRequired: false, transformFunction: null }, showEditToggle: { classPropertyName: "showEditToggle", publicName: "showEditToggle", isSignal: true, isRequired: false, transformFunction: null }, spellcheck: { classPropertyName: "spellcheck", publicName: "spellcheck", isSignal: true, isRequired: false, transformFunction: null }, tiptapExtensions: { classPropertyName: "tiptapExtensions", publicName: "tiptapExtensions", isSignal: true, isRequired: false, transformFunction: null }, tiptapOptions: { classPropertyName: "tiptapOptions", publicName: "tiptapOptions", isSignal: true, isRequired: false, transformFunction: null }, showBubbleMenu: { classPropertyName: "showBubbleMenu", publicName: "showBubbleMenu", isSignal: true, isRequired: false, transformFunction: null }, bubbleMenu: { classPropertyName: "bubbleMenu", publicName: "bubbleMenu", isSignal: true, isRequired: false, transformFunction: null }, showImageBubbleMenu: { classPropertyName: "showImageBubbleMenu", publicName: "showImageBubbleMenu", isSignal: true, isRequired: false, transformFunction: null }, imageBubbleMenu: { classPropertyName: "imageBubbleMenu", publicName: "imageBubbleMenu", isSignal: true, isRequired: false, transformFunction: null }, toolbar: { classPropertyName: "toolbar", publicName: "toolbar", isSignal: true, isRequired: false, transformFunction: null }, showTableBubbleMenu: { classPropertyName: "showTableBubbleMenu", publicName: "showTableBubbleMenu", isSignal: true, isRequired: false, transformFunction: null }, tableBubbleMenu: { classPropertyName: "tableBubbleMenu", publicName: "tableBubbleMenu", isSignal: true, isRequired: false, transformFunction: null }, showCellBubbleMenu: { classPropertyName: "showCellBubbleMenu", publicName: "showCellBubbleMenu", isSignal: true, isRequired: false, transformFunction: null }, cellBubbleMenu: { classPropertyName: "cellBubbleMenu", publicName: "cellBubbleMenu", isSignal: true, isRequired: false, transformFunction: null }, stateCalculators: { classPropertyName: "stateCalculators", publicName: "stateCalculators", isSignal: true, isRequired: false, transformFunction: null }, imageUpload: { classPropertyName: "imageUpload", publicName: "imageUpload", isSignal: true, isRequired: false, transformFunction: null }, imageUploadHandler: { classPropertyName: "imageUploadHandler", publicName: "imageUploadHandler", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { contentChange: "contentChange", editorCreated: "editorCreated", editorUpdate: "editorUpdate", editorFocus: "editorFocus", editorBlur: "editorBlur", editableChange: "editableChange" }, host: { properties: { "class.fill-container": "finalFillContainer()", "class.floating-toolbar": "finalFloatingToolbar()", "class.is-readonly": "!finalEditable() && !mergedDisabled()", "class.is-disabled": "mergedDisabled()", "style.--ate-border-width": "finalSeamless() || mergedDisabled() ? '0' : null", "style.--ate-background": "finalSeamless() ? 'transparent' : (mergedDisabled() ? 'var(--ate-surface-tertiary)' : null)", "style.--ate-toolbar-border-color": "finalSeamless() ? 'transparent' : null", "style.--ate-counter-background": "finalSeamless() ? 'transparent' : null", "style.--ate-counter-border-color": "finalSeamless() ? 'transparent' : null", "class.dark": "config().theme === 'dark'", "attr.data-theme": "config().theme" } }, providers: [AteEditorCommandsService, AteImageService, AteColorPickerService, AteLinkService], viewQueries: [{ propertyName: "editorElement", first: true, predicate: ["editorElement"], descendants: true, isSignal: true }], hostDirectives: [{ directive: AteNoopValueAccessorDirective }], ngImport: i0, template: `
|
|
7617
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.16", type: AngularTiptapEditorComponent, isStandalone: true, selector: "angular-tiptap-editor", inputs: { config: { classPropertyName: "config", publicName: "config", isSignal: true, isRequired: false, transformFunction: null }, content: { classPropertyName: "content", publicName: "content", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, editable: { classPropertyName: "editable", publicName: "editable", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, minHeight: { classPropertyName: "minHeight", publicName: "minHeight", isSignal: true, isRequired: false, transformFunction: null }, height: { classPropertyName: "height", publicName: "height", isSignal: true, isRequired: false, transformFunction: null }, maxHeight: { classPropertyName: "maxHeight", publicName: "maxHeight", isSignal: true, isRequired: false, transformFunction: null }, fillContainer: { classPropertyName: "fillContainer", publicName: "fillContainer", isSignal: true, isRequired: false, transformFunction: null }, showToolbar: { classPropertyName: "showToolbar", publicName: "showToolbar", isSignal: true, isRequired: false, transformFunction: null }, showFooter: { classPropertyName: "showFooter", publicName: "showFooter", isSignal: true, isRequired: false, transformFunction: null }, showCharacterCount: { classPropertyName: "showCharacterCount", publicName: "showCharacterCount", isSignal: true, isRequired: false, transformFunction: null }, showWordCount: { classPropertyName: "showWordCount", publicName: "showWordCount", isSignal: true, isRequired: false, transformFunction: null }, maxCharacters: { classPropertyName: "maxCharacters", publicName: "maxCharacters", isSignal: true, isRequired: false, transformFunction: null }, enableOfficePaste: { classPropertyName: "enableOfficePaste", publicName: "enableOfficePaste", isSignal: true, isRequired: false, transformFunction: null }, enableSlashCommands: { classPropertyName: "enableSlashCommands", publicName: "enableSlashCommands", isSignal: true, isRequired: false, transformFunction: null }, slashCommands: { classPropertyName: "slashCommands", publicName: "slashCommands", isSignal: true, isRequired: false, transformFunction: null }, customSlashCommands: { classPropertyName: "customSlashCommands", publicName: "customSlashCommands", isSignal: true, isRequired: false, transformFunction: null }, blockControls: { classPropertyName: "blockControls", publicName: "blockControls", isSignal: true, isRequired: false, transformFunction: null }, locale: { classPropertyName: "locale", publicName: "locale", isSignal: true, isRequired: false, transformFunction: null }, autofocus: { classPropertyName: "autofocus", publicName: "autofocus", isSignal: true, isRequired: false, transformFunction: null }, seamless: { classPropertyName: "seamless", publicName: "seamless", isSignal: true, isRequired: false, transformFunction: null }, floatingToolbar: { classPropertyName: "floatingToolbar", publicName: "floatingToolbar", isSignal: true, isRequired: false, transformFunction: null }, showEditToggle: { classPropertyName: "showEditToggle", publicName: "showEditToggle", isSignal: true, isRequired: false, transformFunction: null }, spellcheck: { classPropertyName: "spellcheck", publicName: "spellcheck", isSignal: true, isRequired: false, transformFunction: null }, tiptapExtensions: { classPropertyName: "tiptapExtensions", publicName: "tiptapExtensions", isSignal: true, isRequired: false, transformFunction: null }, tiptapOptions: { classPropertyName: "tiptapOptions", publicName: "tiptapOptions", isSignal: true, isRequired: false, transformFunction: null }, showBubbleMenu: { classPropertyName: "showBubbleMenu", publicName: "showBubbleMenu", isSignal: true, isRequired: false, transformFunction: null }, bubbleMenu: { classPropertyName: "bubbleMenu", publicName: "bubbleMenu", isSignal: true, isRequired: false, transformFunction: null }, showImageBubbleMenu: { classPropertyName: "showImageBubbleMenu", publicName: "showImageBubbleMenu", isSignal: true, isRequired: false, transformFunction: null }, imageBubbleMenu: { classPropertyName: "imageBubbleMenu", publicName: "imageBubbleMenu", isSignal: true, isRequired: false, transformFunction: null }, toolbar: { classPropertyName: "toolbar", publicName: "toolbar", isSignal: true, isRequired: false, transformFunction: null }, showTableBubbleMenu: { classPropertyName: "showTableBubbleMenu", publicName: "showTableBubbleMenu", isSignal: true, isRequired: false, transformFunction: null }, tableBubbleMenu: { classPropertyName: "tableBubbleMenu", publicName: "tableBubbleMenu", isSignal: true, isRequired: false, transformFunction: null }, showCellBubbleMenu: { classPropertyName: "showCellBubbleMenu", publicName: "showCellBubbleMenu", isSignal: true, isRequired: false, transformFunction: null }, cellBubbleMenu: { classPropertyName: "cellBubbleMenu", publicName: "cellBubbleMenu", isSignal: true, isRequired: false, transformFunction: null }, stateCalculators: { classPropertyName: "stateCalculators", publicName: "stateCalculators", isSignal: true, isRequired: false, transformFunction: null }, imageUpload: { classPropertyName: "imageUpload", publicName: "imageUpload", isSignal: true, isRequired: false, transformFunction: null }, imageUploadHandler: { classPropertyName: "imageUploadHandler", publicName: "imageUploadHandler", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { contentChange: "contentChange", editorCreated: "editorCreated", editorUpdate: "editorUpdate", editorFocus: "editorFocus", editorBlur: "editorBlur", editableChange: "editableChange" }, host: { properties: { "class.fill-container": "finalFillContainer()", "class.floating-toolbar": "finalFloatingToolbar()", "class.is-readonly": "!finalEditable() && !mergedDisabled()", "class.is-disabled": "mergedDisabled()", "style.--ate-border-width": "finalSeamless() || mergedDisabled() ? '0' : null", "style.--ate-background": "finalSeamless() ? 'transparent' : (mergedDisabled() ? 'var(--ate-surface-tertiary)' : null)", "style.--ate-toolbar-border-color": "finalSeamless() ? 'transparent' : null", "style.--ate-counter-background": "finalSeamless() ? 'transparent' : null", "style.--ate-counter-border-color": "finalSeamless() ? 'transparent' : null", "class.dark": "config().theme === 'dark'", "class.ate-blocks-inside": "finalBlockControls() === 'inside'", "class.ate-blocks-outside": "finalBlockControls() === 'outside'", "attr.data-theme": "config().theme" } }, providers: [AteEditorCommandsService, AteImageService, AteColorPickerService, AteLinkService], viewQueries: [{ propertyName: "editorElement", first: true, predicate: ["editorElement"], descendants: true, isSignal: true }], hostDirectives: [{ directive: AteNoopValueAccessorDirective }], ngImport: i0, template: `
|
|
7198
7618
|
<div class="ate-editor">
|
|
7199
7619
|
<!-- Toolbar -->
|
|
7200
7620
|
@if (finalEditable() && !mergedDisabled() && finalShowToolbar() && editor()) {
|
|
@@ -7228,6 +7648,14 @@ class AngularTiptapEditorComponent {
|
|
|
7228
7648
|
role="application"
|
|
7229
7649
|
[attr.aria-label]="currentTranslations().editor.placeholder"></div>
|
|
7230
7650
|
|
|
7651
|
+
<!-- Block Controls (Plus + Drag) -->
|
|
7652
|
+
@if (finalEditable() && !mergedDisabled() && editor() && finalBlockControls() !== "none") {
|
|
7653
|
+
<ate-block-controls
|
|
7654
|
+
[editor]="editor()!"
|
|
7655
|
+
[hoveredData]="hoveredBlock()"
|
|
7656
|
+
[style.display]="editorFullyInitialized() ? 'block' : 'none'"></ate-block-controls>
|
|
7657
|
+
}
|
|
7658
|
+
|
|
7231
7659
|
<!-- Text Bubble Menu -->
|
|
7232
7660
|
@if (finalEditable() && finalShowBubbleMenu() && editor()) {
|
|
7233
7661
|
<ate-bubble-menu
|
|
@@ -7312,7 +7740,7 @@ class AngularTiptapEditorComponent {
|
|
|
7312
7740
|
</div>
|
|
7313
7741
|
}
|
|
7314
7742
|
</div>
|
|
7315
|
-
`, 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-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: 16px;--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 ::ng-deep .ProseMirror{padding:var(--ate-content-padding);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 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"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
7743
|
+
`, 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-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 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 }); }
|
|
7316
7744
|
}
|
|
7317
7745
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: AngularTiptapEditorComponent, decorators: [{
|
|
7318
7746
|
type: Component,
|
|
@@ -7327,6 +7755,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImpo
|
|
|
7327
7755
|
"[style.--ate-counter-background]": "finalSeamless() ? 'transparent' : null",
|
|
7328
7756
|
"[style.--ate-counter-border-color]": "finalSeamless() ? 'transparent' : null",
|
|
7329
7757
|
"[class.dark]": "config().theme === 'dark'",
|
|
7758
|
+
"[class.ate-blocks-inside]": "finalBlockControls() === 'inside'",
|
|
7759
|
+
"[class.ate-blocks-outside]": "finalBlockControls() === 'outside'",
|
|
7330
7760
|
"[attr.data-theme]": "config().theme",
|
|
7331
7761
|
}, imports: [
|
|
7332
7762
|
AteToolbarComponent,
|
|
@@ -7338,6 +7768,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImpo
|
|
|
7338
7768
|
AteLinkBubbleMenuComponent,
|
|
7339
7769
|
AteColorBubbleMenuComponent,
|
|
7340
7770
|
AteEditToggleComponent,
|
|
7771
|
+
AteBlockControlsComponent,
|
|
7341
7772
|
], providers: [AteEditorCommandsService, AteImageService, AteColorPickerService, AteLinkService], template: `
|
|
7342
7773
|
<div class="ate-editor">
|
|
7343
7774
|
<!-- Toolbar -->
|
|
@@ -7372,6 +7803,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImpo
|
|
|
7372
7803
|
role="application"
|
|
7373
7804
|
[attr.aria-label]="currentTranslations().editor.placeholder"></div>
|
|
7374
7805
|
|
|
7806
|
+
<!-- Block Controls (Plus + Drag) -->
|
|
7807
|
+
@if (finalEditable() && !mergedDisabled() && editor() && finalBlockControls() !== "none") {
|
|
7808
|
+
<ate-block-controls
|
|
7809
|
+
[editor]="editor()!"
|
|
7810
|
+
[hoveredData]="hoveredBlock()"
|
|
7811
|
+
[style.display]="editorFullyInitialized() ? 'block' : 'none'"></ate-block-controls>
|
|
7812
|
+
}
|
|
7813
|
+
|
|
7375
7814
|
<!-- Text Bubble Menu -->
|
|
7376
7815
|
@if (finalEditable() && finalShowBubbleMenu() && editor()) {
|
|
7377
7816
|
<ate-bubble-menu
|
|
@@ -7456,8 +7895,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImpo
|
|
|
7456
7895
|
</div>
|
|
7457
7896
|
}
|
|
7458
7897
|
</div>
|
|
7459
|
-
`, 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-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: 16px;--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 ::ng-deep .ProseMirror{padding:var(--ate-content-padding);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 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"] }]
|
|
7460
|
-
}], ctorParameters: () => [], propDecorators: { config: [{ type: i0.Input, args: [{ isSignal: true, alias: "config", required: false }] }], content: [{ type: i0.Input, args: [{ isSignal: true, alias: "content", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], editable: [{ type: i0.Input, args: [{ isSignal: true, alias: "editable", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], minHeight: [{ type: i0.Input, args: [{ isSignal: true, alias: "minHeight", required: false }] }], height: [{ type: i0.Input, args: [{ isSignal: true, alias: "height", required: false }] }], maxHeight: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxHeight", required: false }] }], fillContainer: [{ type: i0.Input, args: [{ isSignal: true, alias: "fillContainer", required: false }] }], showToolbar: [{ type: i0.Input, args: [{ isSignal: true, alias: "showToolbar", required: false }] }], showFooter: [{ type: i0.Input, args: [{ isSignal: true, alias: "showFooter", required: false }] }], showCharacterCount: [{ type: i0.Input, args: [{ isSignal: true, alias: "showCharacterCount", required: false }] }], showWordCount: [{ type: i0.Input, args: [{ isSignal: true, alias: "showWordCount", required: false }] }], maxCharacters: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxCharacters", required: false }] }], enableOfficePaste: [{ type: i0.Input, args: [{ isSignal: true, alias: "enableOfficePaste", required: false }] }], enableSlashCommands: [{ type: i0.Input, args: [{ isSignal: true, alias: "enableSlashCommands", required: false }] }], slashCommands: [{ type: i0.Input, args: [{ isSignal: true, alias: "slashCommands", required: false }] }], customSlashCommands: [{ type: i0.Input, args: [{ isSignal: true, alias: "customSlashCommands", required: false }] }], locale: [{ type: i0.Input, args: [{ isSignal: true, alias: "locale", required: false }] }], autofocus: [{ type: i0.Input, args: [{ isSignal: true, alias: "autofocus", required: false }] }], seamless: [{ type: i0.Input, args: [{ isSignal: true, alias: "seamless", required: false }] }], floatingToolbar: [{ type: i0.Input, args: [{ isSignal: true, alias: "floatingToolbar", required: false }] }], showEditToggle: [{ type: i0.Input, args: [{ isSignal: true, alias: "showEditToggle", required: false }] }], spellcheck: [{ type: i0.Input, args: [{ isSignal: true, alias: "spellcheck", required: false }] }], tiptapExtensions: [{ type: i0.Input, args: [{ isSignal: true, alias: "tiptapExtensions", required: false }] }], tiptapOptions: [{ type: i0.Input, args: [{ isSignal: true, alias: "tiptapOptions", required: false }] }], showBubbleMenu: [{ type: i0.Input, args: [{ isSignal: true, alias: "showBubbleMenu", required: false }] }], bubbleMenu: [{ type: i0.Input, args: [{ isSignal: true, alias: "bubbleMenu", required: false }] }], showImageBubbleMenu: [{ type: i0.Input, args: [{ isSignal: true, alias: "showImageBubbleMenu", required: false }] }], imageBubbleMenu: [{ type: i0.Input, args: [{ isSignal: true, alias: "imageBubbleMenu", required: false }] }], toolbar: [{ type: i0.Input, args: [{ isSignal: true, alias: "toolbar", required: false }] }], showTableBubbleMenu: [{ type: i0.Input, args: [{ isSignal: true, alias: "showTableBubbleMenu", required: false }] }], tableBubbleMenu: [{ type: i0.Input, args: [{ isSignal: true, alias: "tableBubbleMenu", required: false }] }], showCellBubbleMenu: [{ type: i0.Input, args: [{ isSignal: true, alias: "showCellBubbleMenu", required: false }] }], cellBubbleMenu: [{ type: i0.Input, args: [{ isSignal: true, alias: "cellBubbleMenu", required: false }] }], stateCalculators: [{ type: i0.Input, args: [{ isSignal: true, alias: "stateCalculators", required: false }] }], imageUpload: [{ type: i0.Input, args: [{ isSignal: true, alias: "imageUpload", required: false }] }], imageUploadHandler: [{ type: i0.Input, args: [{ isSignal: true, alias: "imageUploadHandler", required: false }] }], contentChange: [{ type: i0.Output, args: ["contentChange"] }], editorCreated: [{ type: i0.Output, args: ["editorCreated"] }], editorUpdate: [{ type: i0.Output, args: ["editorUpdate"] }], editorFocus: [{ type: i0.Output, args: ["editorFocus"] }], editorBlur: [{ type: i0.Output, args: ["editorBlur"] }], editableChange: [{ type: i0.Output, args: ["editableChange"] }], editorElement: [{ type: i0.ViewChild, args: ["editorElement", { isSignal: true }] }] } });
|
|
7898
|
+
`, 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-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 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"] }]
|
|
7899
|
+
}], ctorParameters: () => [], propDecorators: { config: [{ type: i0.Input, args: [{ isSignal: true, alias: "config", required: false }] }], content: [{ type: i0.Input, args: [{ isSignal: true, alias: "content", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], editable: [{ type: i0.Input, args: [{ isSignal: true, alias: "editable", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], minHeight: [{ type: i0.Input, args: [{ isSignal: true, alias: "minHeight", required: false }] }], height: [{ type: i0.Input, args: [{ isSignal: true, alias: "height", required: false }] }], maxHeight: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxHeight", required: false }] }], fillContainer: [{ type: i0.Input, args: [{ isSignal: true, alias: "fillContainer", required: false }] }], showToolbar: [{ type: i0.Input, args: [{ isSignal: true, alias: "showToolbar", required: false }] }], showFooter: [{ type: i0.Input, args: [{ isSignal: true, alias: "showFooter", required: false }] }], showCharacterCount: [{ type: i0.Input, args: [{ isSignal: true, alias: "showCharacterCount", required: false }] }], showWordCount: [{ type: i0.Input, args: [{ isSignal: true, alias: "showWordCount", required: false }] }], maxCharacters: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxCharacters", required: false }] }], enableOfficePaste: [{ type: i0.Input, args: [{ isSignal: true, alias: "enableOfficePaste", required: false }] }], enableSlashCommands: [{ type: i0.Input, args: [{ isSignal: true, alias: "enableSlashCommands", required: false }] }], slashCommands: [{ type: i0.Input, args: [{ isSignal: true, alias: "slashCommands", required: false }] }], customSlashCommands: [{ type: i0.Input, args: [{ isSignal: true, alias: "customSlashCommands", required: false }] }], blockControls: [{ type: i0.Input, args: [{ isSignal: true, alias: "blockControls", required: false }] }], locale: [{ type: i0.Input, args: [{ isSignal: true, alias: "locale", required: false }] }], autofocus: [{ type: i0.Input, args: [{ isSignal: true, alias: "autofocus", required: false }] }], seamless: [{ type: i0.Input, args: [{ isSignal: true, alias: "seamless", required: false }] }], floatingToolbar: [{ type: i0.Input, args: [{ isSignal: true, alias: "floatingToolbar", required: false }] }], showEditToggle: [{ type: i0.Input, args: [{ isSignal: true, alias: "showEditToggle", required: false }] }], spellcheck: [{ type: i0.Input, args: [{ isSignal: true, alias: "spellcheck", required: false }] }], tiptapExtensions: [{ type: i0.Input, args: [{ isSignal: true, alias: "tiptapExtensions", required: false }] }], tiptapOptions: [{ type: i0.Input, args: [{ isSignal: true, alias: "tiptapOptions", required: false }] }], showBubbleMenu: [{ type: i0.Input, args: [{ isSignal: true, alias: "showBubbleMenu", required: false }] }], bubbleMenu: [{ type: i0.Input, args: [{ isSignal: true, alias: "bubbleMenu", required: false }] }], showImageBubbleMenu: [{ type: i0.Input, args: [{ isSignal: true, alias: "showImageBubbleMenu", required: false }] }], imageBubbleMenu: [{ type: i0.Input, args: [{ isSignal: true, alias: "imageBubbleMenu", required: false }] }], toolbar: [{ type: i0.Input, args: [{ isSignal: true, alias: "toolbar", required: false }] }], showTableBubbleMenu: [{ type: i0.Input, args: [{ isSignal: true, alias: "showTableBubbleMenu", required: false }] }], tableBubbleMenu: [{ type: i0.Input, args: [{ isSignal: true, alias: "tableBubbleMenu", required: false }] }], showCellBubbleMenu: [{ type: i0.Input, args: [{ isSignal: true, alias: "showCellBubbleMenu", required: false }] }], cellBubbleMenu: [{ type: i0.Input, args: [{ isSignal: true, alias: "cellBubbleMenu", required: false }] }], stateCalculators: [{ type: i0.Input, args: [{ isSignal: true, alias: "stateCalculators", required: false }] }], imageUpload: [{ type: i0.Input, args: [{ isSignal: true, alias: "imageUpload", required: false }] }], imageUploadHandler: [{ type: i0.Input, args: [{ isSignal: true, alias: "imageUploadHandler", required: false }] }], contentChange: [{ type: i0.Output, args: ["contentChange"] }], editorCreated: [{ type: i0.Output, args: ["editorCreated"] }], editorUpdate: [{ type: i0.Output, args: ["editorUpdate"] }], editorFocus: [{ type: i0.Output, args: ["editorFocus"] }], editorBlur: [{ type: i0.Output, args: ["editorBlur"] }], editableChange: [{ type: i0.Output, args: ["editableChange"] }], editorElement: [{ type: i0.ViewChild, args: ["editorElement", { isSignal: true }] }] } });
|
|
7461
7900
|
|
|
7462
7901
|
/**
|
|
7463
7902
|
* Provides the necessary configuration and initialization for the Angular TipTap Editor.
|