@firestitch/html-editor 9.5.7 → 12.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/app/components/html-editor/html-editor.component.d.ts +7 -4
- package/app/components/html-renderer/html-renderer.component.d.ts +4 -1
- package/app/fs-html-editor.module.d.ts +8 -0
- package/app/plugins/configs/mention-plugin.config.d.ts +1 -0
- package/app/plugins/mention.plugin.d.ts +3 -0
- package/app/services/froala-loader.service.d.ts +6 -3
- package/bundles/firestitch-html-editor.umd.js +510 -382
- package/bundles/firestitch-html-editor.umd.js.map +1 -1
- package/esm2015/app/classes/plugin.js +1 -1
- package/esm2015/app/components/html-editor/html-editor.component.js +59 -51
- package/esm2015/app/components/html-renderer/html-renderer.component.js +21 -26
- package/esm2015/app/consts/paragraph-buttons.const.js +1 -1
- package/esm2015/app/consts/rich-buttons.const.js +1 -1
- package/esm2015/app/consts/text-buttons.const.js +1 -1
- package/esm2015/app/enums/default-plugin.enum.js +2 -1
- package/esm2015/app/fs-html-editor.module.js +29 -21
- package/esm2015/app/injects/config.inject.js +1 -1
- package/esm2015/app/interfaces/html-editor-config.js +2 -1
- package/esm2015/app/interfaces/plugin-button.js +2 -1
- package/esm2015/app/interfaces/plugin-config.js +2 -1
- package/esm2015/app/plugins/checklist.plugin.js +1 -1
- package/esm2015/app/plugins/code.plugin.js +1 -1
- package/esm2015/app/plugins/configs/mention-plugin.config.js +2 -1
- package/esm2015/app/plugins/configs/screen-record-plugin.config.js +2 -1
- package/esm2015/app/plugins/mention.plugin.js +16 -2
- package/esm2015/app/plugins/screen-record.plugin.js +1 -1
- package/esm2015/app/services/froala-loader.service.js +16 -17
- package/esm2015/app/utils/loader.js +1 -1
- package/esm2015/firestitch-html-editor.js +1 -5
- package/esm2015/public_api.js +1 -1
- package/fesm2015/firestitch-html-editor.js +141 -113
- package/fesm2015/firestitch-html-editor.js.map +1 -1
- package/firestitch-html-editor.d.ts +1 -5
- package/package.json +4 -7
- package/styles.scss +3 -2
- package/bundles/firestitch-html-editor.umd.min.js +0 -17
- package/bundles/firestitch-html-editor.umd.min.js.map +0 -1
- package/esm5/app/classes/plugin.js +0 -9
- package/esm5/app/components/html-editor/html-editor.component.js +0 -471
- package/esm5/app/components/html-renderer/html-renderer.component.js +0 -39
- package/esm5/app/consts/paragraph-buttons.const.js +0 -9
- package/esm5/app/consts/rich-buttons.const.js +0 -7
- package/esm5/app/consts/text-buttons.const.js +0 -19
- package/esm5/app/enums/default-plugin.enum.js +0 -1
- package/esm5/app/fs-html-editor.module.js +0 -62
- package/esm5/app/injects/config.inject.js +0 -4
- package/esm5/app/interfaces/html-editor-config.js +0 -1
- package/esm5/app/interfaces/plugin-button.js +0 -1
- package/esm5/app/interfaces/plugin-config.js +0 -1
- package/esm5/app/plugins/checklist.plugin.js +0 -41
- package/esm5/app/plugins/code.plugin.js +0 -70
- package/esm5/app/plugins/configs/mention-plugin.config.js +0 -1
- package/esm5/app/plugins/configs/screen-record-plugin.config.js +0 -1
- package/esm5/app/plugins/mention.plugin.js +0 -79
- package/esm5/app/plugins/screen-record.plugin.js +0 -106
- package/esm5/app/services/froala-loader.service.js +0 -96
- package/esm5/app/utils/loader.js +0 -83
- package/esm5/firestitch-html-editor.js +0 -9
- package/esm5/public_api.js +0 -12
- package/fesm5/firestitch-html-editor.js +0 -1060
- package/fesm5/firestitch-html-editor.js.map +0 -1
- package/firestitch-html-editor.metadata.json +0 -1
|
@@ -1,14 +1,18 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { InjectionToken, Optional, Inject,
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { InjectionToken, Injectable, Optional, Inject, Component, ChangeDetectionStrategy, Input, forwardRef, HostBinding, ViewChild, NgModule } from '@angular/core';
|
|
3
|
+
import * as i3 from '@angular/common';
|
|
3
4
|
import { CommonModule } from '@angular/common';
|
|
5
|
+
import * as i4 from '@firestitch/skeleton';
|
|
4
6
|
import { FsSkeletonModule } from '@firestitch/skeleton';
|
|
5
7
|
import { NG_VALUE_ACCESSOR, NG_VALIDATORS } from '@angular/forms';
|
|
6
8
|
import { FileProcessor, FsFile } from '@firestitch/file';
|
|
7
9
|
import { Observable, BehaviorSubject, combineLatest, ReplaySubject, Subject, fromEventPattern } from 'rxjs';
|
|
8
10
|
import { shareReplay, map, tap, concatMap, switchMap, filter, startWith, distinctUntilChanged, skip, takeUntil } from 'rxjs/operators';
|
|
9
11
|
import { merge, debounce } from 'lodash-es';
|
|
10
|
-
import
|
|
12
|
+
import * as i1 from '@angular/platform-browser';
|
|
11
13
|
import Tribute from 'tributejs';
|
|
14
|
+
import { guid } from '@firestitch/common';
|
|
15
|
+
import { __awaiter } from 'tslib';
|
|
12
16
|
|
|
13
17
|
const RichButtons = [
|
|
14
18
|
'insertTable',
|
|
@@ -129,7 +133,7 @@ function resourceLoaderFactory() {
|
|
|
129
133
|
}
|
|
130
134
|
const ResourceLoader = resourceLoaderFactory();
|
|
131
135
|
|
|
132
|
-
|
|
136
|
+
class FsFroalaLoaderService {
|
|
133
137
|
constructor(_defaultConfig) {
|
|
134
138
|
this._defaultConfig = _defaultConfig;
|
|
135
139
|
this._froalaLoaded = new BehaviorSubject(false);
|
|
@@ -188,21 +192,47 @@ let FsFroalaLoaderService = class FsFroalaLoaderService {
|
|
|
188
192
|
_defaultPluginsDone() {
|
|
189
193
|
this._defaultPluginsLoaded.next(true);
|
|
190
194
|
}
|
|
191
|
-
}
|
|
192
|
-
FsFroalaLoaderService
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
195
|
+
}
|
|
196
|
+
FsFroalaLoaderService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsFroalaLoaderService, deps: [{ token: FS_HTML_EDITOR_CONFIG, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
197
|
+
FsFroalaLoaderService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsFroalaLoaderService, providedIn: 'root' });
|
|
198
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsFroalaLoaderService, decorators: [{
|
|
199
|
+
type: Injectable,
|
|
200
|
+
args: [{
|
|
201
|
+
providedIn: 'root',
|
|
202
|
+
}]
|
|
203
|
+
}], ctorParameters: function () { return [{ type: undefined, decorators: [{
|
|
204
|
+
type: Optional
|
|
205
|
+
}, {
|
|
206
|
+
type: Inject,
|
|
207
|
+
args: [FS_HTML_EDITOR_CONFIG]
|
|
208
|
+
}] }]; } });
|
|
203
209
|
|
|
204
|
-
|
|
205
|
-
|
|
210
|
+
class FsHtmlRendererComponent {
|
|
211
|
+
constructor(sanitized, _cdRef) {
|
|
212
|
+
this.sanitized = sanitized;
|
|
213
|
+
this._cdRef = _cdRef;
|
|
214
|
+
}
|
|
215
|
+
set setHtml(html) {
|
|
216
|
+
this.trustedHtml = this.sanitized.bypassSecurityTrustHtml(html || '');
|
|
217
|
+
this._cdRef.markForCheck();
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
FsHtmlRendererComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsHtmlRendererComponent, deps: [{ token: i1.DomSanitizer }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
221
|
+
FsHtmlRendererComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: FsHtmlRendererComponent, selector: "fs-html-renderer", inputs: { setHtml: ["html", "setHtml"] }, ngImport: i0, template: "<div class=\"fr-view fs-html-editor-default\" [innerHtml]=\"trustedHtml\"></div>\n", styles: [""], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
222
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsHtmlRendererComponent, decorators: [{
|
|
223
|
+
type: Component,
|
|
224
|
+
args: [{
|
|
225
|
+
selector: 'fs-html-renderer',
|
|
226
|
+
templateUrl: 'html-renderer.component.html',
|
|
227
|
+
styleUrls: ['html-renderer.component.scss'],
|
|
228
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
229
|
+
}]
|
|
230
|
+
}], ctorParameters: function () { return [{ type: i1.DomSanitizer }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { setHtml: [{
|
|
231
|
+
type: Input,
|
|
232
|
+
args: ['html']
|
|
233
|
+
}] } });
|
|
234
|
+
|
|
235
|
+
class FsHtmlEditorComponent {
|
|
206
236
|
constructor(_defaultConfig, _cdRef, _fr) {
|
|
207
237
|
this._defaultConfig = _defaultConfig;
|
|
208
238
|
this._cdRef = _cdRef;
|
|
@@ -587,87 +617,62 @@ let FsHtmlEditorComponent = FsHtmlEditorComponent_1 = class FsHtmlEditorComponen
|
|
|
587
617
|
this.focus();
|
|
588
618
|
}
|
|
589
619
|
}
|
|
590
|
-
}
|
|
591
|
-
FsHtmlEditorComponent
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
],
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
]
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
set setHtml(html) {
|
|
642
|
-
this.trustedHtml = this.sanitized.bypassSecurityTrustHtml(html);
|
|
643
|
-
this._cdRef.markForCheck();
|
|
644
|
-
}
|
|
645
|
-
};
|
|
646
|
-
FsHtmlRendererComponent.ctorParameters = () => [
|
|
647
|
-
{ type: DomSanitizer },
|
|
648
|
-
{ type: ChangeDetectorRef }
|
|
649
|
-
];
|
|
650
|
-
__decorate([
|
|
651
|
-
Input('html'),
|
|
652
|
-
__metadata("design:type", Object),
|
|
653
|
-
__metadata("design:paramtypes", [Object])
|
|
654
|
-
], FsHtmlRendererComponent.prototype, "setHtml", null);
|
|
655
|
-
FsHtmlRendererComponent = __decorate([
|
|
656
|
-
Component({
|
|
657
|
-
selector: 'fs-html-renderer',
|
|
658
|
-
template: "<div class=\"fr-view fs-html-editor-default\" [innerHtml]=\"trustedHtml\"></div>\n",
|
|
659
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
660
|
-
styles: [""]
|
|
661
|
-
}),
|
|
662
|
-
__metadata("design:paramtypes", [DomSanitizer,
|
|
663
|
-
ChangeDetectorRef])
|
|
664
|
-
], FsHtmlRendererComponent);
|
|
620
|
+
}
|
|
621
|
+
FsHtmlEditorComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsHtmlEditorComponent, deps: [{ token: FS_HTML_EDITOR_CONFIG, optional: true }, { token: i0.ChangeDetectorRef }, { token: FsFroalaLoaderService }], target: i0.ɵɵFactoryTarget.Component });
|
|
622
|
+
FsHtmlEditorComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: FsHtmlEditorComponent, selector: "fs-html-editor", inputs: { config: "config" }, host: { properties: { "class.focused": "this.classFocused", "class.disabled": "this.classDisabled" } }, providers: [
|
|
623
|
+
{
|
|
624
|
+
provide: NG_VALUE_ACCESSOR,
|
|
625
|
+
useExisting: forwardRef(() => FsHtmlEditorComponent),
|
|
626
|
+
multi: true
|
|
627
|
+
},
|
|
628
|
+
{
|
|
629
|
+
provide: NG_VALIDATORS,
|
|
630
|
+
useExisting: forwardRef(() => FsHtmlEditorComponent),
|
|
631
|
+
multi: true
|
|
632
|
+
},
|
|
633
|
+
], viewQueries: [{ propertyName: "elRef", first: true, predicate: ["elRef"], descendants: true }], ngImport: i0, template: "<div class=\"fs-html-editor-default\">\n <ng-container *ngIf=\"initialized\">\n <ng-container *fsSkeleton=\"(froalaLoaded$ | async) !== false\">\n </ng-container>\n </ng-container>\n\n <div #elRef></div>\n\n <div class=\"bottom-line\"></div>\n <div class=\"disabled-line\"></div>\n <fs-html-renderer\n *ngIf=\"!initialized\"\n [html]=\"html\"\n (click)=\"uninitializedClick($event)\">\n </fs-html-renderer>\n</div>\n", styles: [":host ::ng-deep .fr-box.fr-basic .fr-wrapper{border:0;border-bottom:1px solid #949494;margin-bottom:1px;background-color:transparent}:host ::ng-deep .fr-box.fr-basic .fr-element{padding:0;font-family:inherit;color:inherit;font-size:inherit;line-height:inherit;min-height:auto}:host ::ng-deep .fr-more-toolbar,:host ::ng-deep .fr-toolbar,:host ::ng-deep .fr-dropdown:after,:host ::ng-deep .fr-dropdown-menu .fr-dropdown-wrapper{transition:none!important}:host ::ng-deep .fr-toolbar.fr-top{position:sticky;z-index:2;border-radius:0;background-color:#fff}:host ::ng-deep .fr-toolbar.fr-top .fr-btn-grp{margin:0 20px 0 0}:host ::ng-deep .fr-toolbar.fr-top .fr-btn-grp:nth-child(1):after,:host ::ng-deep .fr-toolbar.fr-top .fr-btn-grp:nth-child(2):after{content:\"\";position:absolute;top:9px;height:30px;border-left:1px solid #e5e5e5;margin-left:10px}:host ::ng-deep .fr-toolbar.fr-top div:first-of-type:before{border:none}:host ::ng-deep .fr-toolbar.fr-top.fr-toolbar-open .fr-newline{height:auto}:host ::ng-deep .fr-toolbar.fr-top .fr-btn-grp:first-child{margin-left:0}:host ::ng-deep .fr-toolbar.fr-top.fr-top{border:0}:host ::ng-deep .fr-toolbar.fr-top .fr-newline{margin:0}:host ::ng-deep .fr-toolbar.fr-top .fr-more-toolbar{z-index:auto}:host ::ng-deep .fr-toolbar.fr-top .fr-command.fr-btn{z-index:auto}:host ::ng-deep .fr-toolbar.fr-top .fr-command.fr-btn.fr-dropdown:after{right:3px}:host ::ng-deep .fr-toolbar.fr-top .fr-command.fr-btn.fr-dropdown.fr-selection span{margin-right:24px}:host ::ng-deep .fr-toolbar.fr-top .fr-command.fr-btn.fr-open{border-radius:4px;margin:4px 2px}:host ::ng-deep .fr-view ol,:host ::ng-deep .fr-view ul{list-style-position:unset}:host.disabled ::ng-deep .fr-box.fr-basic{opacity:.5;pointer-events:none}:host.disabled ::ng-deep .fr-box.fr-basic .fr-wrapper{border:none}:host.disabled ::ng-deep .disabled-line{display:block}::ng-deep .fr-popup{z-index:1001!important}::ng-deep .fr-video-by-url-layer .fr-checkbox-line{display:none}.disabled-line{display:none;position:absolute;bottom:-1px;z-index:1;background-image:linear-gradient(90deg,rgba(0,0,0,.42) 0,rgba(0,0,0,.42) 33%,transparent 0);background-size:4px 100%;background-repeat:repeat-x;height:1px;width:100%}.bottom-line{opacity:0;transform-origin:50%;transform:scaleX(.5);transition:background-color .3s cubic-bezier(.55,0,.55,.2);width:100%;border-bottom:2px solid #949494;position:absolute;bottom:-1px;z-index:1}:host{position:relative;display:block}:host.focused .bottom-line{opacity:1;display:block;transform:scaleX(1);transition:transform .3s cubic-bezier(.25,.8,.25,1),opacity .1s cubic-bezier(.25,.8,.25,1),background-color .3s cubic-bezier(.25,.8,.25,1)}::ng-deep .fs-html-editor-mention-container{position:absolute;top:0;left:0;height:auto;max-height:300px;max-width:500px;overflow:auto;display:block;z-index:999999;box-shadow:0 2px 4px -1px #0003,0 4px 5px #00000024,0 1px 10px #0000001f;border-bottom-left-radius:4px;border-bottom-right-radius:4px;background:#fff}::ng-deep .fs-html-editor-mention-container ul{margin:0;padding:0;list-style:none}::ng-deep .fs-html-editor-mention-container li{padding:0 16px;cursor:pointer;line-height:48px}::ng-deep .fs-html-editor-mention-container li.highlight,::ng-deep .fs-html-editor-mention-container li:hover{background:#F5F5F5}::ng-deep .fs-html-editor-mention-container li.no-match{cursor:default}\n"], components: [{ type: FsHtmlRendererComponent, selector: "fs-html-renderer", inputs: ["html"] }], directives: [{ type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i4.FsSkeletonContentDirective, selector: "[fsSkeleton]", inputs: ["fsSkeleton", "fsSkeletonPattern"] }], pipes: { "async": i3.AsyncPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
634
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsHtmlEditorComponent, decorators: [{
|
|
635
|
+
type: Component,
|
|
636
|
+
args: [{
|
|
637
|
+
selector: 'fs-html-editor',
|
|
638
|
+
templateUrl: 'html-editor.component.html',
|
|
639
|
+
styleUrls: ['html-editor.component.scss'],
|
|
640
|
+
providers: [
|
|
641
|
+
{
|
|
642
|
+
provide: NG_VALUE_ACCESSOR,
|
|
643
|
+
useExisting: forwardRef(() => FsHtmlEditorComponent),
|
|
644
|
+
multi: true
|
|
645
|
+
},
|
|
646
|
+
{
|
|
647
|
+
provide: NG_VALIDATORS,
|
|
648
|
+
useExisting: forwardRef(() => FsHtmlEditorComponent),
|
|
649
|
+
multi: true
|
|
650
|
+
},
|
|
651
|
+
],
|
|
652
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
653
|
+
}]
|
|
654
|
+
}], ctorParameters: function () { return [{ type: undefined, decorators: [{
|
|
655
|
+
type: Optional
|
|
656
|
+
}, {
|
|
657
|
+
type: Inject,
|
|
658
|
+
args: [FS_HTML_EDITOR_CONFIG]
|
|
659
|
+
}] }, { type: i0.ChangeDetectorRef }, { type: FsFroalaLoaderService }]; }, propDecorators: { classFocused: [{
|
|
660
|
+
type: HostBinding,
|
|
661
|
+
args: ['class.focused']
|
|
662
|
+
}], classDisabled: [{
|
|
663
|
+
type: HostBinding,
|
|
664
|
+
args: ['class.disabled']
|
|
665
|
+
}], elRef: [{
|
|
666
|
+
type: ViewChild,
|
|
667
|
+
args: ['elRef']
|
|
668
|
+
}], config: [{
|
|
669
|
+
type: Input
|
|
670
|
+
}] } });
|
|
665
671
|
|
|
666
|
-
|
|
667
|
-
let FsHtmlEditorModule = FsHtmlEditorModule_1 = class FsHtmlEditorModule {
|
|
672
|
+
class FsHtmlEditorModule {
|
|
668
673
|
static forRoot(config = {}) {
|
|
669
674
|
return {
|
|
670
|
-
ngModule:
|
|
675
|
+
ngModule: FsHtmlEditorModule,
|
|
671
676
|
providers: [
|
|
672
677
|
{ provide: FS_HTML_EDITOR_DEFAULT_CONFIG, useValue: config },
|
|
673
678
|
{
|
|
@@ -678,23 +683,33 @@ let FsHtmlEditorModule = FsHtmlEditorModule_1 = class FsHtmlEditorModule {
|
|
|
678
683
|
]
|
|
679
684
|
};
|
|
680
685
|
}
|
|
681
|
-
}
|
|
682
|
-
FsHtmlEditorModule =
|
|
683
|
-
|
|
684
|
-
imports: [
|
|
686
|
+
}
|
|
687
|
+
FsHtmlEditorModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsHtmlEditorModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
688
|
+
FsHtmlEditorModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsHtmlEditorModule, declarations: [FsHtmlEditorComponent,
|
|
689
|
+
FsHtmlRendererComponent], imports: [CommonModule,
|
|
690
|
+
FsSkeletonModule], exports: [FsHtmlEditorComponent,
|
|
691
|
+
FsHtmlRendererComponent] });
|
|
692
|
+
FsHtmlEditorModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsHtmlEditorModule, imports: [[
|
|
685
693
|
CommonModule,
|
|
686
694
|
FsSkeletonModule,
|
|
687
|
-
]
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
695
|
+
]] });
|
|
696
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsHtmlEditorModule, decorators: [{
|
|
697
|
+
type: NgModule,
|
|
698
|
+
args: [{
|
|
699
|
+
imports: [
|
|
700
|
+
CommonModule,
|
|
701
|
+
FsSkeletonModule,
|
|
702
|
+
],
|
|
703
|
+
exports: [
|
|
704
|
+
FsHtmlEditorComponent,
|
|
705
|
+
FsHtmlRendererComponent,
|
|
706
|
+
],
|
|
707
|
+
declarations: [
|
|
708
|
+
FsHtmlEditorComponent,
|
|
709
|
+
FsHtmlRendererComponent,
|
|
710
|
+
],
|
|
711
|
+
}]
|
|
712
|
+
}] });
|
|
698
713
|
function FsHtmlEditorConfigFactory(config) {
|
|
699
714
|
return Object.assign({ defaultPlugins: [
|
|
700
715
|
"align" /* Align */,
|
|
@@ -721,6 +736,14 @@ class MentionPlugin extends Plugin {
|
|
|
721
736
|
constructor(config) {
|
|
722
737
|
super();
|
|
723
738
|
this.config = config;
|
|
739
|
+
this._guid = guid();
|
|
740
|
+
this.selected = (event) => {
|
|
741
|
+
if (this.config.selected) {
|
|
742
|
+
if (MentionPlugin._currentGuid === this._guid) {
|
|
743
|
+
this.config.selected(event.detail.item.original);
|
|
744
|
+
}
|
|
745
|
+
}
|
|
746
|
+
};
|
|
724
747
|
this.config = Object.assign(Object.assign({}, config), { buttons: [
|
|
725
748
|
{
|
|
726
749
|
name: config.name,
|
|
@@ -769,8 +792,11 @@ class MentionPlugin extends Plugin {
|
|
|
769
792
|
return false;
|
|
770
793
|
}
|
|
771
794
|
}, true);
|
|
795
|
+
this.editor.el.addEventListener("tribute-replaced", this.selected);
|
|
796
|
+
}
|
|
797
|
+
destroy() {
|
|
798
|
+
this.editor.el.removeEventListener("tribute-replaced", this.selected);
|
|
772
799
|
}
|
|
773
|
-
destroy() { }
|
|
774
800
|
_closeAll() {
|
|
775
801
|
MentionPlugin._tributes.forEach((tribute) => {
|
|
776
802
|
if (tribute.menu) {
|
|
@@ -779,12 +805,14 @@ class MentionPlugin extends Plugin {
|
|
|
779
805
|
});
|
|
780
806
|
}
|
|
781
807
|
_loadValues(keyword, cb) {
|
|
808
|
+
MentionPlugin._currentGuid = this._guid;
|
|
782
809
|
return this.config.fetch(keyword)
|
|
783
810
|
.subscribe((data) => {
|
|
784
811
|
cb(data);
|
|
785
812
|
});
|
|
786
813
|
}
|
|
787
814
|
}
|
|
815
|
+
MentionPlugin._currentGuid = null;
|
|
788
816
|
MentionPlugin._tributes = [];
|
|
789
817
|
|
|
790
818
|
class ChecklistPlugin extends Plugin {
|
|
@@ -978,5 +1006,5 @@ class ScreenRecordPlugin extends Plugin {
|
|
|
978
1006
|
* Generated bundle index. Do not edit.
|
|
979
1007
|
*/
|
|
980
1008
|
|
|
981
|
-
export { ChecklistPlugin, CodePlugin, FS_HTML_EDITOR_CONFIG, FsHtmlEditorComponent, FsHtmlEditorModule, FsHtmlRendererComponent, MentionPlugin, ParagraphButtons, RichButtons, ScreenRecordPlugin, TextButtons
|
|
1009
|
+
export { ChecklistPlugin, CodePlugin, FS_HTML_EDITOR_CONFIG, FsHtmlEditorComponent, FsHtmlEditorModule, FsHtmlRendererComponent, MentionPlugin, ParagraphButtons, RichButtons, ScreenRecordPlugin, TextButtons };
|
|
982
1010
|
//# sourceMappingURL=firestitch-html-editor.js.map
|