@codetectonics/mantle 1.0.10 → 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,10 +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 { ClassAttributor, Scope } from 'parchment';
100
+ import Clipboard from 'quill/modules/clipboard';
101
101
  import Highcharts from 'highcharts';
102
102
  import HighchartsItemSeries from 'highcharts/modules/item-series';
103
103
  import HighchartsGantt from 'highcharts/modules/gantt';
@@ -2517,12 +2517,20 @@ class RichTextMentionBlot extends MentionBlot {
2517
2517
  return element;
2518
2518
  }
2519
2519
  }
2520
- const RichTextAlignClass = new ClassAttributor('align', 'text', {
2521
- scope: Scope.BLOCK,
2522
- whitelist: ['left', 'center', 'right', 'justify']
2523
- });
2524
- Quill.register({ "blots/mention": RichTextMentionBlot, "modules/mention": Mention, 'formats/link': RichTextLink });
2525
- Quill.register(RichTextAlignClass, true);
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 });
2526
2534
  class RichTextInputComponent {
2527
2535
  constructor() {
2528
2536
  this.value = '';
@@ -2572,7 +2580,7 @@ class RichTextInputComponent {
2572
2580
  useExisting: forwardRef(() => RichTextInputComponent),
2573
2581
  multi: true
2574
2582
  }
2575
- ], ngImport: i0, template: "<div class=\"rich-text-editor-wrapper mat-mdc-form-field\" [class.mat-mdc-form-field-invalid]=\"error\">\n <label>\n {{ label | translate }}\n <mantle-tooltip *ngIf=\"tooltip\" [message]=\"tooltip\"></mantle-tooltip>\n </label>\n\n <quill-editor class=\"quill-editor\"\n theme=\"snow\"\n placeholder=\"\"\n [ngModel]=\"value\"\n [modules]=\"quillModules\"\n (onContentChanged)=\"onContentChanged($event)\"\n [readOnly]=\"disable\"\n [required]=\"required\">\n </quill-editor>\n\n <mat-hint *ngIf=\"error\" fxFlex=\"0 0 auto\" class=\"error-message\">{{ error }}</mat-hint>\n</div>\n", styles: ["label{text-transform:uppercase}\n"], dependencies: [{ kind: "directive", type: i1$3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3.DefaultFlexDirective, selector: " [fxFlex], [fxFlex.xs], [fxFlex.sm], [fxFlex.md], [fxFlex.lg], [fxFlex.xl], [fxFlex.lt-sm], [fxFlex.lt-md], [fxFlex.lt-lg], [fxFlex.lt-xl], [fxFlex.gt-xs], [fxFlex.gt-sm], [fxFlex.gt-md], [fxFlex.gt-lg]", inputs: ["fxFlex", "fxFlex.xs", "fxFlex.sm", "fxFlex.md", "fxFlex.lg", "fxFlex.xl", "fxFlex.lt-sm", "fxFlex.lt-md", "fxFlex.lt-lg", "fxFlex.lt-xl", "fxFlex.gt-xs", "fxFlex.gt-sm", "fxFlex.gt-md", "fxFlex.gt-lg"] }, { kind: "directive", type: i2$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2$2.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i2$2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i2$3.QuillEditorComponent, selector: "quill-editor" }, { kind: "directive", type: i3$3.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { kind: "component", type: TooltipComponent, selector: "mantle-tooltip", inputs: ["message"] }, { kind: "pipe", type: i6.TranslatePipe, name: "translate" }] }); }
2583
+ ], ngImport: i0, template: "<div class=\"rich-text-editor-wrapper mat-mdc-form-field\" [class.mat-mdc-form-field-invalid]=\"error\">\n <label>\n {{ label | translate }}\n <mantle-tooltip *ngIf=\"tooltip\" [message]=\"tooltip\"></mantle-tooltip>\n </label>\n\n <quill-editor class=\"quill-editor\"\n theme=\"snow\"\n placeholder=\"\"\n [ngModel]=\"value\"\n [modules]=\"quillModules\"\n [bounds]=\"'self'\"\n (onContentChanged)=\"onContentChanged($event)\"\n [readOnly]=\"disable\"\n [required]=\"required\">\n </quill-editor>\n\n <mat-hint *ngIf=\"error\" fxFlex=\"0 0 auto\" class=\"error-message\">{{ error }}</mat-hint>\n</div>\n", styles: ["label{text-transform:uppercase}\n"], dependencies: [{ kind: "directive", type: i1$3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3.DefaultFlexDirective, selector: " [fxFlex], [fxFlex.xs], [fxFlex.sm], [fxFlex.md], [fxFlex.lg], [fxFlex.xl], [fxFlex.lt-sm], [fxFlex.lt-md], [fxFlex.lt-lg], [fxFlex.lt-xl], [fxFlex.gt-xs], [fxFlex.gt-sm], [fxFlex.gt-md], [fxFlex.gt-lg]", inputs: ["fxFlex", "fxFlex.xs", "fxFlex.sm", "fxFlex.md", "fxFlex.lg", "fxFlex.xl", "fxFlex.lt-sm", "fxFlex.lt-md", "fxFlex.lt-lg", "fxFlex.lt-xl", "fxFlex.gt-xs", "fxFlex.gt-sm", "fxFlex.gt-md", "fxFlex.gt-lg"] }, { kind: "directive", type: i2$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2$2.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i2$2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i2$3.QuillEditorComponent, selector: "quill-editor" }, { kind: "directive", type: i3$3.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { kind: "component", type: TooltipComponent, selector: "mantle-tooltip", inputs: ["message"] }, { kind: "pipe", type: i6.TranslatePipe, name: "translate" }] }); }
2576
2584
  }
2577
2585
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.3", ngImport: i0, type: RichTextInputComponent, decorators: [{
2578
2586
  type: Component,
@@ -2582,7 +2590,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.3", ngImpor
2582
2590
  useExisting: forwardRef(() => RichTextInputComponent),
2583
2591
  multi: true
2584
2592
  }
2585
- ], template: "<div class=\"rich-text-editor-wrapper mat-mdc-form-field\" [class.mat-mdc-form-field-invalid]=\"error\">\n <label>\n {{ label | translate }}\n <mantle-tooltip *ngIf=\"tooltip\" [message]=\"tooltip\"></mantle-tooltip>\n </label>\n\n <quill-editor class=\"quill-editor\"\n theme=\"snow\"\n placeholder=\"\"\n [ngModel]=\"value\"\n [modules]=\"quillModules\"\n (onContentChanged)=\"onContentChanged($event)\"\n [readOnly]=\"disable\"\n [required]=\"required\">\n </quill-editor>\n\n <mat-hint *ngIf=\"error\" fxFlex=\"0 0 auto\" class=\"error-message\">{{ error }}</mat-hint>\n</div>\n", styles: ["label{text-transform:uppercase}\n"] }]
2593
+ ], template: "<div class=\"rich-text-editor-wrapper mat-mdc-form-field\" [class.mat-mdc-form-field-invalid]=\"error\">\n <label>\n {{ label | translate }}\n <mantle-tooltip *ngIf=\"tooltip\" [message]=\"tooltip\"></mantle-tooltip>\n </label>\n\n <quill-editor class=\"quill-editor\"\n theme=\"snow\"\n placeholder=\"\"\n [ngModel]=\"value\"\n [modules]=\"quillModules\"\n [bounds]=\"'self'\"\n (onContentChanged)=\"onContentChanged($event)\"\n [readOnly]=\"disable\"\n [required]=\"required\">\n </quill-editor>\n\n <mat-hint *ngIf=\"error\" fxFlex=\"0 0 auto\" class=\"error-message\">{{ error }}</mat-hint>\n</div>\n", styles: ["label{text-transform:uppercase}\n"] }]
2586
2594
  }], ctorParameters: () => [], propDecorators: { label: [{
2587
2595
  type: Input
2588
2596
  }], tooltip: [{