@codetectonics/mantle 1.0.11 → 1.0.12
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.
|
@@ -94,9 +94,10 @@ import * as i1$1 from '@citizenobserver/angular-token';
|
|
|
94
94
|
import * as i5$1 from '@angular/flex-layout/extended';
|
|
95
95
|
import * as i3 from '@angular/flex-layout/flex';
|
|
96
96
|
import { DataSource } from '@angular/cdk/collections';
|
|
97
|
-
import Quill from 'quill';
|
|
97
|
+
import Quill, { Delta } from 'quill';
|
|
98
98
|
import Link from 'quill/formats/link';
|
|
99
99
|
import { MentionBlot, Mention } from 'quill-mention';
|
|
100
|
+
import Clipboard from 'quill/modules/clipboard';
|
|
100
101
|
import Highcharts from 'highcharts';
|
|
101
102
|
import HighchartsItemSeries from 'highcharts/modules/item-series';
|
|
102
103
|
import HighchartsGantt from 'highcharts/modules/gantt';
|
|
@@ -2516,7 +2517,20 @@ class RichTextMentionBlot extends MentionBlot {
|
|
|
2516
2517
|
return element;
|
|
2517
2518
|
}
|
|
2518
2519
|
}
|
|
2519
|
-
|
|
2520
|
+
class RichTextClipboard extends Clipboard {
|
|
2521
|
+
onPaste(range, { text, html }) {
|
|
2522
|
+
const formats = this.quill.getFormat(range.index);
|
|
2523
|
+
const pastedDelta = this.convert({ text }, formats);
|
|
2524
|
+
const delta = new Delta()
|
|
2525
|
+
.retain(range?.index)
|
|
2526
|
+
.delete(range?.length)
|
|
2527
|
+
.concat(pastedDelta);
|
|
2528
|
+
this.quill.updateContents(delta, Quill.sources.USER);
|
|
2529
|
+
this.quill.setSelection(delta.length() - range.length, Quill.sources.SILENT);
|
|
2530
|
+
this.quill.scrollSelectionIntoView();
|
|
2531
|
+
}
|
|
2532
|
+
}
|
|
2533
|
+
Quill.register({ "blots/mention": RichTextMentionBlot, "modules/mention": Mention, 'formats/link': RichTextLink, 'modules/clipboard': RichTextClipboard });
|
|
2520
2534
|
class RichTextInputComponent {
|
|
2521
2535
|
constructor() {
|
|
2522
2536
|
this.value = '';
|