@eui/components 17.0.2-snapshot-1702478232432 → 17.0.2-snapshot-1702481826405
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/docs/components/EuiEditorComponent.html +26 -2
- package/docs/components/QuillEditorComponent.html +13 -1
- package/docs/dependencies.html +2 -2
- package/docs/index.html +2 -2
- package/docs/injectables/LoaderService.html +273 -0
- package/docs/interfaces/QuillDynamicConfig.html +272 -0
- package/docs/js/menu-wc.js +16 -10
- package/docs/js/menu-wc_es5.js +1 -1
- package/docs/js/search/search_index.js +2 -2
- package/docs/miscellaneous/variables.html +50 -3
- package/docs/modules/QuillModule.html +9 -1
- package/esm2022/externals/eui-editor/eui-editor.component.mjs +67 -58
- package/esm2022/externals/eui-editor/eui-editor.module.mjs +9 -5
- package/esm2022/externals/eui-editor/json-view/eui-editor-json-view.component.mjs +3 -2
- package/esm2022/externals/quill/index.mjs +2 -1
- package/esm2022/externals/quill/loader.service.mjs +128 -0
- package/esm2022/externals/quill/quill-editor.component.mjs +134 -112
- package/esm2022/externals/quill/quill-editor.interfaces.mjs +2 -1
- package/esm2022/externals/quill/quill.module.mjs +10 -4
- package/externals/eui-editor/eui-editor.component.d.ts +6 -3
- package/externals/eui-editor/eui-editor.component.d.ts.map +1 -1
- package/externals/eui-editor/eui-editor.module.d.ts.map +1 -1
- package/externals/eui-editor/json-view/eui-editor-json-view.component.d.ts.map +1 -1
- package/externals/quill/index.d.ts +1 -0
- package/externals/quill/index.d.ts.map +1 -1
- package/externals/quill/loader.service.d.ts +18 -0
- package/externals/quill/loader.service.d.ts.map +1 -0
- package/externals/quill/quill-editor.component.d.ts +4 -1
- package/externals/quill/quill-editor.component.d.ts.map +1 -1
- package/externals/quill/quill-editor.interfaces.d.ts +5 -0
- package/externals/quill/quill-editor.interfaces.d.ts.map +1 -1
- package/externals/quill/quill.module.d.ts +5 -1
- package/externals/quill/quill.module.d.ts.map +1 -1
- package/fesm2022/eui-components-externals-eui-editor.mjs +81 -67
- package/fesm2022/eui-components-externals-eui-editor.mjs.map +1 -1
- package/fesm2022/eui-components-externals-quill.mjs +268 -116
- package/fesm2022/eui-components-externals-quill.mjs.map +1 -1
- package/package.json +53 -53
@@ -1,9 +1,10 @@
|
|
1
1
|
import * as i0 from '@angular/core';
|
2
|
-
import { InjectionToken, EventEmitter, SecurityContext, PLATFORM_ID, forwardRef, Component, ViewEncapsulation, Inject, Input, Output, NgModule } from '@angular/core';
|
3
|
-
import { isPlatformServer, DOCUMENT } from '@angular/common';
|
2
|
+
import { InjectionToken, inject, Injectable, EventEmitter, SecurityContext, PLATFORM_ID, forwardRef, Component, ViewEncapsulation, Inject, Input, Output, NgModule } from '@angular/core';
|
3
|
+
import { isPlatformServer, DOCUMENT, CommonModule } from '@angular/common';
|
4
4
|
import { NG_VALUE_ACCESSOR, NG_VALIDATORS } from '@angular/forms';
|
5
5
|
import { coerceBooleanProperty } from '@angular/cdk/coercion';
|
6
6
|
import * as i1 from '@angular/platform-browser';
|
7
|
+
import { Observable } from 'rxjs';
|
7
8
|
|
8
9
|
const defaultModules = {
|
9
10
|
toolbar: [
|
@@ -26,6 +27,131 @@ const defaultModules = {
|
|
26
27
|
};
|
27
28
|
|
28
29
|
const QUILL_CONFIG_TOKEN = new InjectionToken('config');
|
30
|
+
const QUILL_DYNAMIC_CONFIG_TOKEN = new InjectionToken('Dynamic loading config');
|
31
|
+
|
32
|
+
/**
|
33
|
+
* @internal This service is not part of the public API of the component
|
34
|
+
*/
|
35
|
+
class LoaderService {
|
36
|
+
constructor() {
|
37
|
+
this.dynamicConfig = inject(QUILL_DYNAMIC_CONFIG_TOKEN, { optional: true });
|
38
|
+
}
|
39
|
+
/**
|
40
|
+
* Load the Quill.js library
|
41
|
+
*
|
42
|
+
* @param path Path to the Quill.js library e.g. "assets/quill/dist". The path must contain the "quill.js"
|
43
|
+
* and "quillEditor.min.css" files and also the css ones.
|
44
|
+
*/
|
45
|
+
load() {
|
46
|
+
let loaded = false;
|
47
|
+
return new Observable(observer => {
|
48
|
+
// check if window.Quill is defined other load it
|
49
|
+
if (window.Quill === undefined) {
|
50
|
+
const loadResult = { mainScript: false, style: false, secondaryScript: false, };
|
51
|
+
// style
|
52
|
+
const quillEditorStyle = document.createElement('link');
|
53
|
+
quillEditorStyle.href = `${this.dynamicConfig?.path}/quill.core.css`;
|
54
|
+
quillEditorStyle.rel = 'stylesheet';
|
55
|
+
const quillEditorStyleOnload = () => {
|
56
|
+
quillEditorStyle.removeEventListener('load', quillEditorStyleOnload);
|
57
|
+
quillEditorStyle.removeEventListener('error', quillEditorOnerror);
|
58
|
+
loadResult.style = true;
|
59
|
+
if (Object.values(loadResult).every(v => v === true)) {
|
60
|
+
observer.next(true);
|
61
|
+
observer.complete();
|
62
|
+
loaded = true;
|
63
|
+
}
|
64
|
+
};
|
65
|
+
const quillEditorSnowStyle = document.createElement('link');
|
66
|
+
quillEditorSnowStyle.href = `${this.dynamicConfig?.path}/quill.snow.css`;
|
67
|
+
quillEditorSnowStyle.rel = 'stylesheet';
|
68
|
+
// script to inject into page the Quill.js
|
69
|
+
let quillEditorScript = document.createElement('script');
|
70
|
+
quillEditorScript.src = `${this.dynamicConfig?.path}/quill.js`;
|
71
|
+
quillEditorScript.type = 'application/javascript';
|
72
|
+
quillEditorScript.async = true;
|
73
|
+
const quillEditorScriptOnload = () => {
|
74
|
+
quillEditorScript.removeEventListener('load', quillEditorScriptOnload);
|
75
|
+
quillEditorScript.removeEventListener('error', quillEditorOnerror);
|
76
|
+
loadResult.mainScript = true;
|
77
|
+
document.body.append(quillBetterTableScript);
|
78
|
+
if (Object.values(loadResult).every(v => v === true)) {
|
79
|
+
observer.next(true);
|
80
|
+
observer.complete();
|
81
|
+
loaded = true;
|
82
|
+
}
|
83
|
+
};
|
84
|
+
// script to inject into page the Quill-better-table"node_modules/quill-better-table/dist/quill-better-table.min.js",
|
85
|
+
const quillBetterTableScript = document.createElement('script');
|
86
|
+
quillBetterTableScript.src = `${this.dynamicConfig?.path}/quill-better-table.js`;
|
87
|
+
quillBetterTableScript.type = 'application/javascript';
|
88
|
+
quillBetterTableScript.async = true;
|
89
|
+
const quillBetterTableScriptOnload = () => {
|
90
|
+
quillBetterTableScript.removeEventListener('load', quillBetterTableScriptOnload);
|
91
|
+
quillBetterTableScript.removeEventListener('error', quillEditorOnerror);
|
92
|
+
loadResult.secondaryScript = true;
|
93
|
+
if (Object.values(loadResult).every(v => v === true)) {
|
94
|
+
observer.next(true);
|
95
|
+
observer.complete();
|
96
|
+
loaded = true;
|
97
|
+
}
|
98
|
+
};
|
99
|
+
const quillEditorOnerror = () => {
|
100
|
+
quillEditorStyle.removeEventListener('load', quillEditorStyleOnload);
|
101
|
+
quillEditorStyle.removeEventListener('error', quillEditorOnerror);
|
102
|
+
quillEditorScript.removeEventListener('load', quillEditorScriptOnload);
|
103
|
+
quillEditorScript.removeEventListener('error', quillEditorOnerror);
|
104
|
+
observer.next(false);
|
105
|
+
observer.complete();
|
106
|
+
};
|
107
|
+
quillEditorStyle.addEventListener('load', quillEditorStyleOnload);
|
108
|
+
quillEditorStyle.addEventListener('error', quillEditorOnerror);
|
109
|
+
quillEditorSnowStyle.addEventListener('load', quillEditorStyleOnload);
|
110
|
+
quillEditorSnowStyle.addEventListener('error', quillEditorOnerror);
|
111
|
+
quillEditorScript.addEventListener('load', quillEditorScriptOnload);
|
112
|
+
quillEditorScript.addEventListener('error', quillEditorOnerror);
|
113
|
+
quillBetterTableScript.addEventListener('load', quillBetterTableScriptOnload);
|
114
|
+
quillBetterTableScript.addEventListener('error', quillEditorOnerror);
|
115
|
+
// check if the script is already loaded. Take into account the Hostname on to src
|
116
|
+
if (document.querySelector(`script[src="${this.dynamicConfig?.path}/quill.js"]`) === null) {
|
117
|
+
document.body.append(quillEditorScript);
|
118
|
+
}
|
119
|
+
else {
|
120
|
+
// interval timer to check when the script is loaded
|
121
|
+
const interval = setInterval(() => {
|
122
|
+
if (loaded) {
|
123
|
+
clearInterval(interval);
|
124
|
+
}
|
125
|
+
else if (window.Quill !== undefined && window.quillBetterTable !== undefined) {
|
126
|
+
observer.next(true);
|
127
|
+
observer.complete();
|
128
|
+
loaded = true;
|
129
|
+
clearInterval(interval);
|
130
|
+
}
|
131
|
+
}, 100);
|
132
|
+
}
|
133
|
+
// check if style is already loaded
|
134
|
+
if (document.querySelector(`link[href="${this.dynamicConfig?.path}/quill.core.css"]`) === null) {
|
135
|
+
document.body.append(quillEditorStyle);
|
136
|
+
}
|
137
|
+
// check if style is already loaded
|
138
|
+
if (document.querySelector(`link[href="${this.dynamicConfig?.path}/quill.snow.css"]`) === null) {
|
139
|
+
document.body.append(quillEditorSnowStyle);
|
140
|
+
}
|
141
|
+
}
|
142
|
+
else {
|
143
|
+
observer.next(true);
|
144
|
+
observer.complete();
|
145
|
+
}
|
146
|
+
});
|
147
|
+
}
|
148
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.6", ngImport: i0, type: LoaderService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
149
|
+
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.6", ngImport: i0, type: LoaderService, providedIn: 'root' }); }
|
150
|
+
}
|
151
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.6", ngImport: i0, type: LoaderService, decorators: [{
|
152
|
+
type: Injectable,
|
153
|
+
args: [{ providedIn: 'root' }]
|
154
|
+
}] });
|
29
155
|
|
30
156
|
const getFormat = (format, configFormat) => {
|
31
157
|
const passedFormat = format || configFormat;
|
@@ -64,7 +190,7 @@ class QuillEditorComponent {
|
|
64
190
|
}
|
65
191
|
constructor(elementRef, domSanitizer, doc,
|
66
192
|
// eslint-disable-next-line @typescript-eslint/ban-types
|
67
|
-
platformId, renderer, zone, config) {
|
193
|
+
platformId, renderer, zone, config, loader) {
|
68
194
|
this.elementRef = elementRef;
|
69
195
|
this.domSanitizer = domSanitizer;
|
70
196
|
this.doc = doc;
|
@@ -72,6 +198,8 @@ class QuillEditorComponent {
|
|
72
198
|
this.renderer = renderer;
|
73
199
|
this.zone = zone;
|
74
200
|
this.config = config;
|
201
|
+
this.loader = loader;
|
202
|
+
this.loaded = false;
|
75
203
|
this.customToolbarPosition = 'top';
|
76
204
|
this.styles = null;
|
77
205
|
this.customOptions = [];
|
@@ -189,117 +317,136 @@ class QuillEditorComponent {
|
|
189
317
|
// eslint-disable-next-line no-empty, no-empty-function, @typescript-eslint/no-empty-function, @typescript-eslint/explicit-function-return-type
|
190
318
|
onModelTouched() { }
|
191
319
|
ngAfterViewInit() {
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
let placeholder = this.placeholder !== undefined ? this.placeholder : this.config.placeholder;
|
208
|
-
if (placeholder === undefined) {
|
209
|
-
placeholder = 'Insert text here ...';
|
210
|
-
}
|
211
|
-
if (toolbarElem) {
|
212
|
-
// eslint-disable-next-line dot-notation,@typescript-eslint/dot-notation
|
213
|
-
modules['toolbar'] = toolbarElem;
|
214
|
-
}
|
215
|
-
if (!this.hasImageFeature) {
|
216
|
-
modules['uploader'] = { handler: () => false };
|
217
|
-
}
|
218
|
-
else {
|
219
|
-
modules['uploader'] = { mimetypes: ['image/png', 'image/jpeg'] };
|
220
|
-
}
|
221
|
-
if (this.styles) {
|
222
|
-
Object.keys(this.styles).forEach((key) => {
|
223
|
-
this.renderer.setStyle(this.editorElem, key, this.styles[key]);
|
224
|
-
});
|
225
|
-
}
|
226
|
-
this.customOptions.forEach((customOption) => {
|
227
|
-
const newCustomOption = Quill.import(customOption.import);
|
228
|
-
newCustomOption.whitelist = customOption.whitelist;
|
229
|
-
Quill.register(newCustomOption, true);
|
230
|
-
});
|
231
|
-
let bounds = this.bounds && this.bounds === 'self' ? this.editorElem : this.bounds;
|
232
|
-
if (!bounds) {
|
233
|
-
bounds = this.config.bounds ? this.config.bounds : this.doc.body;
|
234
|
-
}
|
235
|
-
let debug = this.debug;
|
236
|
-
if (!debug && debug !== false && this.config.debug) {
|
237
|
-
debug = this.config.debug;
|
238
|
-
}
|
239
|
-
let readOnly = this.readOnly;
|
240
|
-
if (!readOnly && this.readOnly !== false) {
|
241
|
-
readOnly = this.config.readOnly !== undefined ? this.config.readOnly : false;
|
242
|
-
}
|
243
|
-
let scrollingContainer = this.scrollingContainer;
|
244
|
-
if (!scrollingContainer && this.scrollingContainer !== null) {
|
245
|
-
scrollingContainer =
|
246
|
-
this.config.scrollingContainer === null || this.config.scrollingContainer ? this.config.scrollingContainer : null;
|
247
|
-
}
|
248
|
-
let formats = this.formats;
|
249
|
-
if (!formats && formats === undefined) {
|
250
|
-
formats = this.config.formats || this.config.formats === null ? this.config.formats : undefined;
|
251
|
-
}
|
252
|
-
Quill.formats = { ...Quill.formats, [this.id]: formats };
|
253
|
-
if (formats && formats.indexOf('table') !== -1) {
|
254
|
-
modules = {
|
255
|
-
...modules,
|
256
|
-
'better-table': false,
|
257
|
-
};
|
258
|
-
}
|
259
|
-
this.quillEditor = new Quill(this.editorElem, {
|
260
|
-
bounds,
|
261
|
-
debug,
|
262
|
-
formats,
|
263
|
-
modules,
|
264
|
-
placeholder,
|
265
|
-
readOnly,
|
266
|
-
scrollingContainer,
|
267
|
-
strict: this.strict,
|
268
|
-
theme: this.theme || (this.config.theme ? this.config.theme : 'snow'),
|
269
|
-
});
|
270
|
-
this.quillEditor.container.firstChild.id = this.id;
|
271
|
-
if (this.content) {
|
272
|
-
const format = getFormat(this.format, this.config.format);
|
273
|
-
if (format === 'object') {
|
274
|
-
this.quillEditor.setContents(this.content, 'silent');
|
275
|
-
}
|
276
|
-
else if (format === 'text') {
|
277
|
-
this.quillEditor.setText(this.content, 'silent');
|
278
|
-
}
|
279
|
-
else if (format === 'json') {
|
280
|
-
try {
|
281
|
-
this.quillEditor.setContents(JSON.parse(this.content), 'silent');
|
320
|
+
// const loader = new LoaderService();
|
321
|
+
this.loader.load().subscribe({
|
322
|
+
complete: () => {
|
323
|
+
// setup keyboard bindings from BetterTable if present
|
324
|
+
const QuillBetterTable = window['quillBetterTable'];
|
325
|
+
if (QuillBetterTable) {
|
326
|
+
// check if already registered
|
327
|
+
if (!window['Quill'].imports.hasOwnProperty('modules/better-table')) {
|
328
|
+
window['Quill'].register({ 'modules/better-table': QuillBetterTable });
|
329
|
+
}
|
330
|
+
if (!this.config.modules.keyboard) {
|
331
|
+
this.config.modules.keyboard = {
|
332
|
+
bindings: QuillBetterTable?.keyboardBindings,
|
333
|
+
};
|
334
|
+
}
|
282
335
|
}
|
283
|
-
|
284
|
-
|
336
|
+
if (isPlatformServer(this.platformId)) {
|
337
|
+
return;
|
285
338
|
}
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
339
|
+
if (!Quill) {
|
340
|
+
// Quill = require('quill')
|
341
|
+
Quill = window['Quill'];
|
342
|
+
}
|
343
|
+
this.overrideScrollBehavior(Quill);
|
344
|
+
this.loaded = true;
|
345
|
+
this.elementRef.nativeElement.insertAdjacentHTML(this.customToolbarPosition === 'top' ? 'beforeend' : 'afterbegin', this.preserveWhitespace ? '<pre quill-editor-element></pre>' : '<div quill-editor-element></div>');
|
346
|
+
this.editorElem = this.elementRef.nativeElement.querySelector('[quill-editor-element]');
|
347
|
+
const toolbarElem = this.elementRef.nativeElement.querySelector('[quill-editor-toolbar]');
|
348
|
+
let modules = this.modules || this.config.modules || defaultModules;
|
349
|
+
if (modules.toolbar === undefined) {
|
350
|
+
modules.toolbar = defaultModules.toolbar;
|
351
|
+
}
|
352
|
+
let placeholder = this.placeholder !== undefined ? this.placeholder : this.config.placeholder;
|
353
|
+
if (placeholder === undefined) {
|
354
|
+
placeholder = 'Insert text here ...';
|
355
|
+
}
|
356
|
+
if (toolbarElem) {
|
357
|
+
// eslint-disable-next-line dot-notation,@typescript-eslint/dot-notation
|
358
|
+
modules['toolbar'] = toolbarElem;
|
359
|
+
}
|
360
|
+
if (!this.hasImageFeature) {
|
361
|
+
modules['uploader'] = { handler: () => false };
|
290
362
|
}
|
291
|
-
|
292
|
-
|
363
|
+
else {
|
364
|
+
modules['uploader'] = { mimetypes: ['image/png', 'image/jpeg'] };
|
365
|
+
}
|
366
|
+
if (this.styles) {
|
367
|
+
Object.keys(this.styles).forEach((key) => {
|
368
|
+
this.renderer.setStyle(this.editorElem, key, this.styles[key]);
|
369
|
+
});
|
370
|
+
}
|
371
|
+
this.customOptions.forEach((customOption) => {
|
372
|
+
const newCustomOption = Quill.import(customOption.import);
|
373
|
+
newCustomOption.whitelist = customOption.whitelist;
|
374
|
+
Quill.register(newCustomOption, true);
|
375
|
+
});
|
376
|
+
let bounds = this.bounds && this.bounds === 'self' ? this.editorElem : this.bounds;
|
377
|
+
if (!bounds) {
|
378
|
+
bounds = this.config.bounds ? this.config.bounds : this.doc.body;
|
379
|
+
}
|
380
|
+
let debug = this.debug;
|
381
|
+
if (!debug && debug !== false && this.config.debug) {
|
382
|
+
debug = this.config.debug;
|
383
|
+
}
|
384
|
+
let readOnly = this.readOnly;
|
385
|
+
if (!readOnly && this.readOnly !== false) {
|
386
|
+
readOnly = this.config.readOnly !== undefined ? this.config.readOnly : false;
|
387
|
+
}
|
388
|
+
let scrollingContainer = this.scrollingContainer;
|
389
|
+
if (!scrollingContainer && this.scrollingContainer !== null) {
|
390
|
+
scrollingContainer =
|
391
|
+
this.config.scrollingContainer === null || this.config.scrollingContainer ? this.config.scrollingContainer : null;
|
392
|
+
}
|
393
|
+
let formats = this.formats;
|
394
|
+
if (!formats && formats === undefined) {
|
395
|
+
formats = this.config.formats || this.config.formats === null ? this.config.formats : undefined;
|
396
|
+
}
|
397
|
+
Quill.formats = { ...Quill.formats, [this.id]: formats };
|
398
|
+
if (formats && formats.indexOf('table') !== -1) {
|
399
|
+
modules = {
|
400
|
+
...modules,
|
401
|
+
'better-table': false,
|
402
|
+
};
|
403
|
+
}
|
404
|
+
this.quillEditor = new Quill(this.editorElem, {
|
405
|
+
bounds,
|
406
|
+
debug,
|
407
|
+
formats,
|
408
|
+
modules,
|
409
|
+
placeholder,
|
410
|
+
readOnly,
|
411
|
+
scrollingContainer,
|
412
|
+
strict: this.strict,
|
413
|
+
theme: this.theme || (this.config.theme ? this.config.theme : 'snow'),
|
414
|
+
});
|
415
|
+
this.quillEditor.container.firstChild.id = this.id;
|
416
|
+
if (this.content) {
|
417
|
+
const format = getFormat(this.format, this.config.format);
|
418
|
+
if (format === 'object') {
|
419
|
+
this.quillEditor.setContents(this.content, 'silent');
|
420
|
+
}
|
421
|
+
else if (format === 'text') {
|
422
|
+
this.quillEditor.setText(this.content, 'silent');
|
423
|
+
}
|
424
|
+
else if (format === 'json') {
|
425
|
+
try {
|
426
|
+
this.quillEditor.setContents(JSON.parse(this.content), 'silent');
|
427
|
+
}
|
428
|
+
catch (e) {
|
429
|
+
this.quillEditor.setText(this.content, 'silent');
|
430
|
+
}
|
431
|
+
}
|
432
|
+
else {
|
433
|
+
if (this.sanitize) {
|
434
|
+
this.content = this.domSanitizer.sanitize(SecurityContext.HTML, this.content);
|
435
|
+
}
|
436
|
+
const contents = this.quillEditor.clipboard.convert(this.content);
|
437
|
+
this.quillEditor.setContents(contents, 'silent');
|
438
|
+
}
|
439
|
+
this.quillEditor.history.clear();
|
440
|
+
}
|
441
|
+
// initialize disabled status based on this.disabled as default value
|
442
|
+
this.setDisabledState();
|
443
|
+
this.onEditorCreated.emit(this.quillEditor);
|
444
|
+
// mark model as touched if editor lost focus
|
445
|
+
this.quillEditor.on('selection-change', this.selectionChangeHandler);
|
446
|
+
// update model if text changes
|
447
|
+
this.quillEditor.on('text-change', this.textChangeHandler);
|
293
448
|
}
|
294
|
-
|
295
|
-
}
|
296
|
-
// initialize disabled status based on this.disabled as default value
|
297
|
-
this.setDisabledState();
|
298
|
-
this.onEditorCreated.emit(this.quillEditor);
|
299
|
-
// mark model as touched if editor lost focus
|
300
|
-
this.quillEditor.on('selection-change', this.selectionChangeHandler);
|
301
|
-
// update model if text changes
|
302
|
-
this.quillEditor.on('text-change', this.textChangeHandler);
|
449
|
+
});
|
303
450
|
}
|
304
451
|
ngOnDestroy() {
|
305
452
|
if (this.quillEditor) {
|
@@ -435,7 +582,7 @@ class QuillEditorComponent {
|
|
435
582
|
/** register the Scroll override */
|
436
583
|
QuillInstance.register('blots/scroll', Scroll, true);
|
437
584
|
}
|
438
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.6", ngImport: i0, type: QuillEditorComponent, deps: [{ token: i0.ElementRef }, { token: i1.DomSanitizer }, { token: DOCUMENT }, { token: PLATFORM_ID }, { token: i0.Renderer2 }, { token: i0.NgZone }, { token: QUILL_CONFIG_TOKEN }], target: i0.ɵɵFactoryTarget.Component }); }
|
585
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.6", ngImport: i0, type: QuillEditorComponent, deps: [{ token: i0.ElementRef }, { token: i1.DomSanitizer }, { token: DOCUMENT }, { token: PLATFORM_ID }, { token: i0.Renderer2 }, { token: i0.NgZone }, { token: QUILL_CONFIG_TOKEN }, { token: LoaderService }], target: i0.ɵɵFactoryTarget.Component }); }
|
439
586
|
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.0.6", type: QuillEditorComponent, selector: "quill-editor", inputs: { id: "id", format: "format", theme: "theme", modules: "modules", debug: "debug", placeholder: "placeholder", maxLength: "maxLength", minLength: "minLength", formats: "formats", customToolbarPosition: "customToolbarPosition", styles: "styles", scrollingContainer: "scrollingContainer", bounds: "bounds", customOptions: "customOptions", trackChanges: "trackChanges", hasImageFeature: "hasImageFeature", readOnly: "readOnly", required: "required", sanitize: "sanitize", strict: "strict", preserveWhitespace: "preserveWhitespace", valueGetter: "valueGetter", valueSetter: "valueSetter" }, outputs: { onEditorCreated: "onEditorCreated", onContentChanged: "onContentChanged", onSelectionChanged: "onSelectionChanged", onFocus: "onFocus", onBlur: "onBlur" }, providers: [
|
440
587
|
{
|
441
588
|
multi: true,
|
@@ -478,7 +625,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.6", ngImpor
|
|
478
625
|
}] }, { type: i0.Renderer2 }, { type: i0.NgZone }, { type: undefined, decorators: [{
|
479
626
|
type: Inject,
|
480
627
|
args: [QUILL_CONFIG_TOKEN]
|
481
|
-
}] }], propDecorators: { id: [{
|
628
|
+
}] }, { type: LoaderService }], propDecorators: { id: [{
|
482
629
|
type: Input
|
483
630
|
}], format: [{
|
484
631
|
type: Input
|
@@ -536,6 +683,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.6", ngImpor
|
|
536
683
|
type: Input
|
537
684
|
}] } });
|
538
685
|
|
686
|
+
// TODO: integrate that module and all related code with the eui-editor module.
|
687
|
+
// Remove this sub-entry and move all the code to the eui-editor.
|
688
|
+
/**
|
689
|
+
* @deprecated please don't use it. It will be removed
|
690
|
+
*/
|
539
691
|
class QuillModule {
|
540
692
|
static forRoot(config) {
|
541
693
|
return {
|
@@ -550,20 +702,20 @@ class QuillModule {
|
|
550
702
|
};
|
551
703
|
}
|
552
704
|
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.6", ngImport: i0, type: QuillModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
553
|
-
/** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.0.6", ngImport: i0, type: QuillModule, declarations: [QuillEditorComponent], exports: [QuillEditorComponent] }); }
|
705
|
+
/** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.0.6", ngImport: i0, type: QuillModule, declarations: [QuillEditorComponent], imports: [CommonModule], exports: [QuillEditorComponent] }); }
|
554
706
|
/** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.0.6", ngImport: i0, type: QuillModule, providers: [
|
555
707
|
{
|
556
708
|
provide: QUILL_CONFIG_TOKEN,
|
557
709
|
useValue: { modules: defaultModules },
|
558
710
|
},
|
559
|
-
] }); }
|
711
|
+
], imports: [CommonModule] }); }
|
560
712
|
}
|
561
713
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.6", ngImport: i0, type: QuillModule, decorators: [{
|
562
714
|
type: NgModule,
|
563
715
|
args: [{
|
564
716
|
declarations: [QuillEditorComponent],
|
565
717
|
exports: [QuillEditorComponent],
|
566
|
-
imports: [],
|
718
|
+
imports: [CommonModule],
|
567
719
|
providers: [
|
568
720
|
{
|
569
721
|
provide: QUILL_CONFIG_TOKEN,
|
@@ -577,5 +729,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.6", ngImpor
|
|
577
729
|
* Generated bundle index. Do not edit.
|
578
730
|
*/
|
579
731
|
|
580
|
-
export { QUILL_CONFIG_TOKEN, QuillEditorComponent, QuillModule, defaultModules };
|
732
|
+
export { LoaderService, QUILL_CONFIG_TOKEN, QUILL_DYNAMIC_CONFIG_TOKEN, QuillEditorComponent, QuillModule, defaultModules };
|
581
733
|
//# sourceMappingURL=eui-components-externals-quill.mjs.map
|