@firestitch/html-editor 12.6.0 → 12.7.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.
Files changed (52) hide show
  1. package/app/modules/html-editor/classes/plugin.d.ts +7 -7
  2. package/app/modules/html-editor/components/html-editor/html-editor.component.d.ts +57 -59
  3. package/app/modules/html-editor/consts/paragraph-buttons.const.d.ts +1 -1
  4. package/app/modules/html-editor/consts/rich-buttons.const.d.ts +1 -1
  5. package/app/modules/html-editor/consts/text-buttons.const.d.ts +1 -1
  6. package/app/modules/html-editor/enums/default-plugin.enum.d.ts +16 -16
  7. package/app/modules/html-editor/fs-html-editor.module.d.ts +43 -43
  8. package/app/modules/html-editor/injects/config.inject.d.ts +3 -3
  9. package/app/modules/html-editor/interfaces/html-editor-config.d.ts +40 -40
  10. package/app/modules/html-editor/interfaces/plugin-button.d.ts +12 -12
  11. package/app/modules/html-editor/interfaces/plugin-config.d.ts +5 -5
  12. package/app/modules/html-editor/plugins/checklist.plugin.d.ts +7 -7
  13. package/app/modules/html-editor/plugins/code.plugin.d.ts +9 -9
  14. package/app/modules/html-editor/plugins/configs/mention-plugin.config.d.ts +13 -13
  15. package/app/modules/html-editor/plugins/configs/screen-record-plugin.config.d.ts +7 -7
  16. package/app/modules/html-editor/plugins/mention.plugin.d.ts +15 -15
  17. package/app/modules/html-editor/plugins/realtime.plugin.d.ts +7 -7
  18. package/app/modules/html-editor/plugins/screen-record.plugin.d.ts +11 -11
  19. package/app/modules/html-editor/services/froala-loader.service.d.ts +21 -21
  20. package/app/modules/html-renderer/components/html-renderer/html-renderer.component.d.ts +12 -12
  21. package/app/modules/html-renderer/fs-html-renderer.module.d.ts +8 -8
  22. package/bundles/firestitch-html-editor.umd.js +1332 -1381
  23. package/bundles/firestitch-html-editor.umd.js.map +1 -1
  24. package/esm2015/app/modules/html-editor/classes/plugin.js +4 -4
  25. package/esm2015/app/modules/html-editor/components/html-editor/html-editor.component.js +462 -512
  26. package/esm2015/app/modules/html-editor/consts/paragraph-buttons.const.js +9 -9
  27. package/esm2015/app/modules/html-editor/consts/rich-buttons.const.js +6 -6
  28. package/esm2015/app/modules/html-editor/consts/text-buttons.const.js +18 -18
  29. package/esm2015/app/modules/html-editor/enums/default-plugin.enum.js +1 -1
  30. package/esm2015/app/modules/html-editor/fs-html-editor.module.js +68 -68
  31. package/esm2015/app/modules/html-editor/injects/config.inject.js +3 -3
  32. package/esm2015/app/modules/html-editor/interfaces/html-editor-config.js +1 -1
  33. package/esm2015/app/modules/html-editor/interfaces/plugin-button.js +1 -1
  34. package/esm2015/app/modules/html-editor/interfaces/plugin-config.js +1 -1
  35. package/esm2015/app/modules/html-editor/plugins/checklist.plugin.js +34 -34
  36. package/esm2015/app/modules/html-editor/plugins/code.plugin.js +62 -62
  37. package/esm2015/app/modules/html-editor/plugins/configs/mention-plugin.config.js +1 -1
  38. package/esm2015/app/modules/html-editor/plugins/configs/screen-record-plugin.config.js +1 -1
  39. package/esm2015/app/modules/html-editor/plugins/mention.plugin.js +86 -86
  40. package/esm2015/app/modules/html-editor/plugins/realtime.plugin.js +12 -12
  41. package/esm2015/app/modules/html-editor/plugins/screen-record.plugin.js +88 -88
  42. package/esm2015/app/modules/html-editor/services/froala-loader.service.js +89 -89
  43. package/esm2015/app/modules/html-renderer/components/html-renderer/html-renderer.component.js +28 -28
  44. package/esm2015/app/modules/html-renderer/fs-html-renderer.module.js +25 -25
  45. package/esm2015/firestitch-html-editor.js +4 -4
  46. package/esm2015/public_api.js +13 -13
  47. package/fesm2015/firestitch-html-editor.js +934 -983
  48. package/fesm2015/firestitch-html-editor.js.map +1 -1
  49. package/firestitch-html-editor.d.ts +5 -5
  50. package/package.json +1 -1
  51. package/public_api.d.ts +18 -18
  52. package/styles.scss +4 -0
@@ -1,8 +1,8 @@
1
1
  (function (global, factory) {
2
2
  typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/common'), require('@firestitch/label'), require('@firestitch/skeleton'), require('@angular/forms'), require('@firestitch/file'), require('rxjs'), require('rxjs/operators'), require('lodash-es'), require('@firestitch/common'), require('@angular/platform-browser'), require('tributejs')) :
3
3
  typeof define === 'function' && define.amd ? define('@firestitch/html-editor', ['exports', '@angular/core', '@angular/common', '@firestitch/label', '@firestitch/skeleton', '@angular/forms', '@firestitch/file', 'rxjs', 'rxjs/operators', 'lodash-es', '@firestitch/common', '@angular/platform-browser', 'tributejs'], factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.firestitch = global.firestitch || {}, global.firestitch["html-editor"] = {}), global.ng.core, global.ng.common, global.i2, global.i5, global.ng.forms, global.file, global.rxjs, global.rxjs.operators, global.lodashEs, global.common, global.ng.platformBrowser, global.Tribute));
5
- })(this, (function (exports, i0, i4, i2, i5, forms, file, rxjs, operators, lodashEs, common, i1, Tribute) { 'use strict';
4
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.firestitch = global.firestitch || {}, global.firestitch["html-editor"] = {}), global.ng.core, global.ng.common, global.i2, global.i4, global.ng.forms, global.file, global.rxjs, global.rxjs.operators, global.lodashEs, global.common, global.ng.platformBrowser, global.Tribute));
5
+ })(this, (function (exports, i0, i3, i2, i4, forms, file, rxjs, operators, lodashEs, common, i1, Tribute) { 'use strict';
6
6
 
7
7
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
8
8
 
@@ -25,1421 +25,1372 @@
25
25
  }
26
26
 
27
27
  var i0__namespace = /*#__PURE__*/_interopNamespace(i0);
28
- var i4__namespace = /*#__PURE__*/_interopNamespace(i4);
28
+ var i3__namespace = /*#__PURE__*/_interopNamespace(i3);
29
29
  var i2__namespace = /*#__PURE__*/_interopNamespace(i2);
30
- var i5__namespace = /*#__PURE__*/_interopNamespace(i5);
30
+ var i4__namespace = /*#__PURE__*/_interopNamespace(i4);
31
31
  var i1__namespace = /*#__PURE__*/_interopNamespace(i1);
32
32
  var Tribute__default = /*#__PURE__*/_interopDefaultLegacy(Tribute);
33
33
 
34
- var RichButtons = [
35
- 'insertTable',
36
- 'insertImage',
37
- 'insertLink',
38
- 'insertVideo',
34
+ var RichButtons = [
35
+ 'insertTable',
36
+ 'insertImage',
37
+ 'insertLink',
38
+ 'insertVideo',
39
39
  ];
40
40
 
41
- var TextButtons = [
42
- 'paragraphFormat',
43
- 'code',
44
- 'bold',
45
- 'italic',
46
- 'underline',
47
- 'strikeThrough',
48
- 'subscript',
49
- 'superscript',
50
- 'fontFamily',
51
- 'fontSize',
52
- 'textColor',
53
- 'backgroundColor',
54
- 'inlineClass',
55
- 'inlineStyle',
56
- 'clearFormatting',
57
- 'quote',
41
+ var TextButtons = [
42
+ 'paragraphFormat',
43
+ 'code',
44
+ 'bold',
45
+ 'italic',
46
+ 'underline',
47
+ 'strikeThrough',
48
+ 'subscript',
49
+ 'superscript',
50
+ 'fontFamily',
51
+ 'fontSize',
52
+ 'textColor',
53
+ 'backgroundColor',
54
+ 'inlineClass',
55
+ 'inlineStyle',
56
+ 'clearFormatting',
57
+ 'quote',
58
58
  ];
59
59
 
60
- var ParagraphButtons = [
61
- 'align',
62
- 'formatOL',
63
- 'formatUL',
64
- 'checklist',
65
- 'indent',
66
- 'outdent',
67
- 'lineHeight'
60
+ var ParagraphButtons = [
61
+ 'align',
62
+ 'formatOL',
63
+ 'formatUL',
64
+ 'checklist',
65
+ 'indent',
66
+ 'outdent',
67
+ 'lineHeight'
68
68
  ];
69
69
 
70
- var FS_HTML_EDITOR_DEFAULT_CONFIG = new i0.InjectionToken('fs-html-editor.default-config');
70
+ var FS_HTML_EDITOR_DEFAULT_CONFIG = new i0.InjectionToken('fs-html-editor.default-config');
71
71
  var FS_HTML_EDITOR_CONFIG = new i0.InjectionToken('fs-html-editor.config');
72
72
 
73
- /*! *****************************************************************************
74
- Copyright (c) Microsoft Corporation.
75
-
76
- Permission to use, copy, modify, and/or distribute this software for any
77
- purpose with or without fee is hereby granted.
78
-
79
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
80
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
81
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
82
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
83
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
84
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
85
- PERFORMANCE OF THIS SOFTWARE.
86
- ***************************************************************************** */
87
- /* global Reflect, Promise */
88
- var extendStatics = function (d, b) {
89
- extendStatics = Object.setPrototypeOf ||
90
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
91
- function (d, b) { for (var p in b)
92
- if (Object.prototype.hasOwnProperty.call(b, p))
93
- d[p] = b[p]; };
94
- return extendStatics(d, b);
95
- };
96
- function __extends(d, b) {
97
- if (typeof b !== "function" && b !== null)
98
- throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
99
- extendStatics(d, b);
100
- function __() { this.constructor = d; }
101
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
102
- }
103
- var __assign = function () {
104
- __assign = Object.assign || function __assign(t) {
105
- for (var s, i = 1, n = arguments.length; i < n; i++) {
106
- s = arguments[i];
107
- for (var p in s)
108
- if (Object.prototype.hasOwnProperty.call(s, p))
109
- t[p] = s[p];
110
- }
111
- return t;
112
- };
113
- return __assign.apply(this, arguments);
114
- };
115
- function __rest(s, e) {
116
- var t = {};
117
- for (var p in s)
118
- if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
119
- t[p] = s[p];
120
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
121
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
122
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
123
- t[p[i]] = s[p[i]];
124
- }
125
- return t;
126
- }
127
- function __decorate(decorators, target, key, desc) {
128
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
129
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
130
- r = Reflect.decorate(decorators, target, key, desc);
131
- else
132
- for (var i = decorators.length - 1; i >= 0; i--)
133
- if (d = decorators[i])
134
- r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
135
- return c > 3 && r && Object.defineProperty(target, key, r), r;
136
- }
137
- function __param(paramIndex, decorator) {
138
- return function (target, key) { decorator(target, key, paramIndex); };
139
- }
140
- function __metadata(metadataKey, metadataValue) {
141
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
142
- return Reflect.metadata(metadataKey, metadataValue);
143
- }
144
- function __awaiter(thisArg, _arguments, P, generator) {
145
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
146
- return new (P || (P = Promise))(function (resolve, reject) {
147
- function fulfilled(value) { try {
148
- step(generator.next(value));
149
- }
150
- catch (e) {
151
- reject(e);
152
- } }
153
- function rejected(value) { try {
154
- step(generator["throw"](value));
155
- }
156
- catch (e) {
157
- reject(e);
158
- } }
159
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
160
- step((generator = generator.apply(thisArg, _arguments || [])).next());
161
- });
162
- }
163
- function __generator(thisArg, body) {
164
- var _ = { label: 0, sent: function () { if (t[0] & 1)
165
- throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
166
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function () { return this; }), g;
167
- function verb(n) { return function (v) { return step([n, v]); }; }
168
- function step(op) {
169
- if (f)
170
- throw new TypeError("Generator is already executing.");
171
- while (_)
172
- try {
173
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done)
174
- return t;
175
- if (y = 0, t)
176
- op = [op[0] & 2, t.value];
177
- switch (op[0]) {
178
- case 0:
179
- case 1:
180
- t = op;
181
- break;
182
- case 4:
183
- _.label++;
184
- return { value: op[1], done: false };
185
- case 5:
186
- _.label++;
187
- y = op[1];
188
- op = [0];
189
- continue;
190
- case 7:
191
- op = _.ops.pop();
192
- _.trys.pop();
193
- continue;
194
- default:
195
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
196
- _ = 0;
197
- continue;
198
- }
199
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) {
200
- _.label = op[1];
201
- break;
202
- }
203
- if (op[0] === 6 && _.label < t[1]) {
204
- _.label = t[1];
205
- t = op;
206
- break;
207
- }
208
- if (t && _.label < t[2]) {
209
- _.label = t[2];
210
- _.ops.push(op);
211
- break;
212
- }
213
- if (t[2])
214
- _.ops.pop();
215
- _.trys.pop();
216
- continue;
217
- }
218
- op = body.call(thisArg, _);
219
- }
220
- catch (e) {
221
- op = [6, e];
222
- y = 0;
223
- }
224
- finally {
225
- f = t = 0;
226
- }
227
- if (op[0] & 5)
228
- throw op[1];
229
- return { value: op[0] ? op[1] : void 0, done: true };
230
- }
231
- }
232
- var __createBinding = Object.create ? (function (o, m, k, k2) {
233
- if (k2 === undefined)
234
- k2 = k;
235
- Object.defineProperty(o, k2, { enumerable: true, get: function () { return m[k]; } });
236
- }) : (function (o, m, k, k2) {
237
- if (k2 === undefined)
238
- k2 = k;
239
- o[k2] = m[k];
240
- });
241
- function __exportStar(m, o) {
242
- for (var p in m)
243
- if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p))
244
- __createBinding(o, m, p);
245
- }
246
- function __values(o) {
247
- var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
248
- if (m)
249
- return m.call(o);
250
- if (o && typeof o.length === "number")
251
- return {
252
- next: function () {
253
- if (o && i >= o.length)
254
- o = void 0;
255
- return { value: o && o[i++], done: !o };
256
- }
257
- };
258
- throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
259
- }
260
- function __read(o, n) {
261
- var m = typeof Symbol === "function" && o[Symbol.iterator];
262
- if (!m)
263
- return o;
264
- var i = m.call(o), r, ar = [], e;
265
- try {
266
- while ((n === void 0 || n-- > 0) && !(r = i.next()).done)
267
- ar.push(r.value);
268
- }
269
- catch (error) {
270
- e = { error: error };
271
- }
272
- finally {
273
- try {
274
- if (r && !r.done && (m = i["return"]))
275
- m.call(i);
276
- }
277
- finally {
278
- if (e)
279
- throw e.error;
280
- }
281
- }
282
- return ar;
283
- }
284
- /** @deprecated */
285
- function __spread() {
286
- for (var ar = [], i = 0; i < arguments.length; i++)
287
- ar = ar.concat(__read(arguments[i]));
288
- return ar;
289
- }
290
- /** @deprecated */
291
- function __spreadArrays() {
292
- for (var s = 0, i = 0, il = arguments.length; i < il; i++)
293
- s += arguments[i].length;
294
- for (var r = Array(s), k = 0, i = 0; i < il; i++)
295
- for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
296
- r[k] = a[j];
297
- return r;
298
- }
299
- function __spreadArray(to, from, pack) {
300
- if (pack || arguments.length === 2)
301
- for (var i = 0, l = from.length, ar; i < l; i++) {
302
- if (ar || !(i in from)) {
303
- if (!ar)
304
- ar = Array.prototype.slice.call(from, 0, i);
305
- ar[i] = from[i];
306
- }
307
- }
308
- return to.concat(ar || Array.prototype.slice.call(from));
309
- }
310
- function __await(v) {
311
- return this instanceof __await ? (this.v = v, this) : new __await(v);
312
- }
313
- function __asyncGenerator(thisArg, _arguments, generator) {
314
- if (!Symbol.asyncIterator)
315
- throw new TypeError("Symbol.asyncIterator is not defined.");
316
- var g = generator.apply(thisArg, _arguments || []), i, q = [];
317
- return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
318
- function verb(n) { if (g[n])
319
- i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
320
- function resume(n, v) { try {
321
- step(g[n](v));
322
- }
323
- catch (e) {
324
- settle(q[0][3], e);
325
- } }
326
- function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
327
- function fulfill(value) { resume("next", value); }
328
- function reject(value) { resume("throw", value); }
329
- function settle(f, v) { if (f(v), q.shift(), q.length)
330
- resume(q[0][0], q[0][1]); }
331
- }
332
- function __asyncDelegator(o) {
333
- var i, p;
334
- return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
335
- function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; }
336
- }
337
- function __asyncValues(o) {
338
- if (!Symbol.asyncIterator)
339
- throw new TypeError("Symbol.asyncIterator is not defined.");
340
- var m = o[Symbol.asyncIterator], i;
341
- return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
342
- function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
343
- function settle(resolve, reject, d, v) { Promise.resolve(v).then(function (v) { resolve({ value: v, done: d }); }, reject); }
344
- }
345
- function __makeTemplateObject(cooked, raw) {
346
- if (Object.defineProperty) {
347
- Object.defineProperty(cooked, "raw", { value: raw });
348
- }
349
- else {
350
- cooked.raw = raw;
351
- }
352
- return cooked;
353
- }
354
- ;
355
- var __setModuleDefault = Object.create ? (function (o, v) {
356
- Object.defineProperty(o, "default", { enumerable: true, value: v });
357
- }) : function (o, v) {
358
- o["default"] = v;
359
- };
360
- function __importStar(mod) {
361
- if (mod && mod.__esModule)
362
- return mod;
363
- var result = {};
364
- if (mod != null)
365
- for (var k in mod)
366
- if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k))
367
- __createBinding(result, mod, k);
368
- __setModuleDefault(result, mod);
369
- return result;
370
- }
371
- function __importDefault(mod) {
372
- return (mod && mod.__esModule) ? mod : { default: mod };
373
- }
374
- function __classPrivateFieldGet(receiver, state, kind, f) {
375
- if (kind === "a" && !f)
376
- throw new TypeError("Private accessor was defined without a getter");
377
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
378
- throw new TypeError("Cannot read private member from an object whose class did not declare it");
379
- return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
380
- }
381
- function __classPrivateFieldSet(receiver, state, value, kind, f) {
382
- if (kind === "m")
383
- throw new TypeError("Private method is not writable");
384
- if (kind === "a" && !f)
385
- throw new TypeError("Private accessor was defined without a setter");
386
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
387
- throw new TypeError("Cannot write private member to an object whose class did not declare it");
388
- return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
73
+ /*! *****************************************************************************
74
+ Copyright (c) Microsoft Corporation.
75
+
76
+ Permission to use, copy, modify, and/or distribute this software for any
77
+ purpose with or without fee is hereby granted.
78
+
79
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
80
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
81
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
82
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
83
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
84
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
85
+ PERFORMANCE OF THIS SOFTWARE.
86
+ ***************************************************************************** */
87
+ /* global Reflect, Promise */
88
+ var extendStatics = function (d, b) {
89
+ extendStatics = Object.setPrototypeOf ||
90
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
91
+ function (d, b) { for (var p in b)
92
+ if (Object.prototype.hasOwnProperty.call(b, p))
93
+ d[p] = b[p]; };
94
+ return extendStatics(d, b);
95
+ };
96
+ function __extends(d, b) {
97
+ if (typeof b !== "function" && b !== null)
98
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
99
+ extendStatics(d, b);
100
+ function __() { this.constructor = d; }
101
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
102
+ }
103
+ var __assign = function () {
104
+ __assign = Object.assign || function __assign(t) {
105
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
106
+ s = arguments[i];
107
+ for (var p in s)
108
+ if (Object.prototype.hasOwnProperty.call(s, p))
109
+ t[p] = s[p];
110
+ }
111
+ return t;
112
+ };
113
+ return __assign.apply(this, arguments);
114
+ };
115
+ function __rest(s, e) {
116
+ var t = {};
117
+ for (var p in s)
118
+ if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
119
+ t[p] = s[p];
120
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
121
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
122
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
123
+ t[p[i]] = s[p[i]];
124
+ }
125
+ return t;
126
+ }
127
+ function __decorate(decorators, target, key, desc) {
128
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
129
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
130
+ r = Reflect.decorate(decorators, target, key, desc);
131
+ else
132
+ for (var i = decorators.length - 1; i >= 0; i--)
133
+ if (d = decorators[i])
134
+ r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
135
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
136
+ }
137
+ function __param(paramIndex, decorator) {
138
+ return function (target, key) { decorator(target, key, paramIndex); };
139
+ }
140
+ function __metadata(metadataKey, metadataValue) {
141
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
142
+ return Reflect.metadata(metadataKey, metadataValue);
143
+ }
144
+ function __awaiter(thisArg, _arguments, P, generator) {
145
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
146
+ return new (P || (P = Promise))(function (resolve, reject) {
147
+ function fulfilled(value) { try {
148
+ step(generator.next(value));
149
+ }
150
+ catch (e) {
151
+ reject(e);
152
+ } }
153
+ function rejected(value) { try {
154
+ step(generator["throw"](value));
155
+ }
156
+ catch (e) {
157
+ reject(e);
158
+ } }
159
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
160
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
161
+ });
162
+ }
163
+ function __generator(thisArg, body) {
164
+ var _ = { label: 0, sent: function () { if (t[0] & 1)
165
+ throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
166
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function () { return this; }), g;
167
+ function verb(n) { return function (v) { return step([n, v]); }; }
168
+ function step(op) {
169
+ if (f)
170
+ throw new TypeError("Generator is already executing.");
171
+ while (_)
172
+ try {
173
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done)
174
+ return t;
175
+ if (y = 0, t)
176
+ op = [op[0] & 2, t.value];
177
+ switch (op[0]) {
178
+ case 0:
179
+ case 1:
180
+ t = op;
181
+ break;
182
+ case 4:
183
+ _.label++;
184
+ return { value: op[1], done: false };
185
+ case 5:
186
+ _.label++;
187
+ y = op[1];
188
+ op = [0];
189
+ continue;
190
+ case 7:
191
+ op = _.ops.pop();
192
+ _.trys.pop();
193
+ continue;
194
+ default:
195
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
196
+ _ = 0;
197
+ continue;
198
+ }
199
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) {
200
+ _.label = op[1];
201
+ break;
202
+ }
203
+ if (op[0] === 6 && _.label < t[1]) {
204
+ _.label = t[1];
205
+ t = op;
206
+ break;
207
+ }
208
+ if (t && _.label < t[2]) {
209
+ _.label = t[2];
210
+ _.ops.push(op);
211
+ break;
212
+ }
213
+ if (t[2])
214
+ _.ops.pop();
215
+ _.trys.pop();
216
+ continue;
217
+ }
218
+ op = body.call(thisArg, _);
219
+ }
220
+ catch (e) {
221
+ op = [6, e];
222
+ y = 0;
223
+ }
224
+ finally {
225
+ f = t = 0;
226
+ }
227
+ if (op[0] & 5)
228
+ throw op[1];
229
+ return { value: op[0] ? op[1] : void 0, done: true };
230
+ }
231
+ }
232
+ var __createBinding = Object.create ? (function (o, m, k, k2) {
233
+ if (k2 === undefined)
234
+ k2 = k;
235
+ Object.defineProperty(o, k2, { enumerable: true, get: function () { return m[k]; } });
236
+ }) : (function (o, m, k, k2) {
237
+ if (k2 === undefined)
238
+ k2 = k;
239
+ o[k2] = m[k];
240
+ });
241
+ function __exportStar(m, o) {
242
+ for (var p in m)
243
+ if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p))
244
+ __createBinding(o, m, p);
245
+ }
246
+ function __values(o) {
247
+ var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
248
+ if (m)
249
+ return m.call(o);
250
+ if (o && typeof o.length === "number")
251
+ return {
252
+ next: function () {
253
+ if (o && i >= o.length)
254
+ o = void 0;
255
+ return { value: o && o[i++], done: !o };
256
+ }
257
+ };
258
+ throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
259
+ }
260
+ function __read(o, n) {
261
+ var m = typeof Symbol === "function" && o[Symbol.iterator];
262
+ if (!m)
263
+ return o;
264
+ var i = m.call(o), r, ar = [], e;
265
+ try {
266
+ while ((n === void 0 || n-- > 0) && !(r = i.next()).done)
267
+ ar.push(r.value);
268
+ }
269
+ catch (error) {
270
+ e = { error: error };
271
+ }
272
+ finally {
273
+ try {
274
+ if (r && !r.done && (m = i["return"]))
275
+ m.call(i);
276
+ }
277
+ finally {
278
+ if (e)
279
+ throw e.error;
280
+ }
281
+ }
282
+ return ar;
283
+ }
284
+ /** @deprecated */
285
+ function __spread() {
286
+ for (var ar = [], i = 0; i < arguments.length; i++)
287
+ ar = ar.concat(__read(arguments[i]));
288
+ return ar;
289
+ }
290
+ /** @deprecated */
291
+ function __spreadArrays() {
292
+ for (var s = 0, i = 0, il = arguments.length; i < il; i++)
293
+ s += arguments[i].length;
294
+ for (var r = Array(s), k = 0, i = 0; i < il; i++)
295
+ for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
296
+ r[k] = a[j];
297
+ return r;
298
+ }
299
+ function __spreadArray(to, from, pack) {
300
+ if (pack || arguments.length === 2)
301
+ for (var i = 0, l = from.length, ar; i < l; i++) {
302
+ if (ar || !(i in from)) {
303
+ if (!ar)
304
+ ar = Array.prototype.slice.call(from, 0, i);
305
+ ar[i] = from[i];
306
+ }
307
+ }
308
+ return to.concat(ar || Array.prototype.slice.call(from));
309
+ }
310
+ function __await(v) {
311
+ return this instanceof __await ? (this.v = v, this) : new __await(v);
312
+ }
313
+ function __asyncGenerator(thisArg, _arguments, generator) {
314
+ if (!Symbol.asyncIterator)
315
+ throw new TypeError("Symbol.asyncIterator is not defined.");
316
+ var g = generator.apply(thisArg, _arguments || []), i, q = [];
317
+ return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
318
+ function verb(n) { if (g[n])
319
+ i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
320
+ function resume(n, v) { try {
321
+ step(g[n](v));
322
+ }
323
+ catch (e) {
324
+ settle(q[0][3], e);
325
+ } }
326
+ function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
327
+ function fulfill(value) { resume("next", value); }
328
+ function reject(value) { resume("throw", value); }
329
+ function settle(f, v) { if (f(v), q.shift(), q.length)
330
+ resume(q[0][0], q[0][1]); }
331
+ }
332
+ function __asyncDelegator(o) {
333
+ var i, p;
334
+ return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
335
+ function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; }
336
+ }
337
+ function __asyncValues(o) {
338
+ if (!Symbol.asyncIterator)
339
+ throw new TypeError("Symbol.asyncIterator is not defined.");
340
+ var m = o[Symbol.asyncIterator], i;
341
+ return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
342
+ function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
343
+ function settle(resolve, reject, d, v) { Promise.resolve(v).then(function (v) { resolve({ value: v, done: d }); }, reject); }
344
+ }
345
+ function __makeTemplateObject(cooked, raw) {
346
+ if (Object.defineProperty) {
347
+ Object.defineProperty(cooked, "raw", { value: raw });
348
+ }
349
+ else {
350
+ cooked.raw = raw;
351
+ }
352
+ return cooked;
353
+ }
354
+ ;
355
+ var __setModuleDefault = Object.create ? (function (o, v) {
356
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
357
+ }) : function (o, v) {
358
+ o["default"] = v;
359
+ };
360
+ function __importStar(mod) {
361
+ if (mod && mod.__esModule)
362
+ return mod;
363
+ var result = {};
364
+ if (mod != null)
365
+ for (var k in mod)
366
+ if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k))
367
+ __createBinding(result, mod, k);
368
+ __setModuleDefault(result, mod);
369
+ return result;
370
+ }
371
+ function __importDefault(mod) {
372
+ return (mod && mod.__esModule) ? mod : { default: mod };
373
+ }
374
+ function __classPrivateFieldGet(receiver, state, kind, f) {
375
+ if (kind === "a" && !f)
376
+ throw new TypeError("Private accessor was defined without a getter");
377
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
378
+ throw new TypeError("Cannot read private member from an object whose class did not declare it");
379
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
380
+ }
381
+ function __classPrivateFieldSet(receiver, state, value, kind, f) {
382
+ if (kind === "m")
383
+ throw new TypeError("Private method is not writable");
384
+ if (kind === "a" && !f)
385
+ throw new TypeError("Private accessor was defined without a setter");
386
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
387
+ throw new TypeError("Cannot write private member to an object whose class did not declare it");
388
+ return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
389
389
  }
390
390
 
391
- var FsFroalaLoaderService = /** @class */ (function () {
392
- function FsFroalaLoaderService(_defaultConfig, _document) {
393
- this._defaultConfig = _defaultConfig;
394
- this._document = _document;
395
- this._froalaLoaded = new rxjs.BehaviorSubject(false);
396
- this._froalaPluginsLoaded = new rxjs.BehaviorSubject(false);
397
- this._sourceLoader = common.fsSourceLoader;
398
- this._loaded$ = rxjs.combineLatest([this._froalaLoaded, this._froalaPluginsLoaded])
399
- .pipe(operators.map(function (_a) {
400
- var _b = __read(_a, 2), FroalaReady = _b[0], pluginsRead = _b[1];
401
- return pluginsRead && FroalaReady;
402
- }), operators.shareReplay(1));
403
- this._sourceLoader.setDocument(this._document);
404
- this._load();
405
- }
406
- Object.defineProperty(FsFroalaLoaderService.prototype, "loaded$", {
407
- get: function () {
408
- return this._loaded$;
409
- },
410
- enumerable: false,
411
- configurable: true
412
- });
413
- Object.defineProperty(FsFroalaLoaderService.prototype, "FroalaEditor", {
414
- get: function () {
415
- return this._FroalaEditor;
416
- },
417
- enumerable: false,
418
- configurable: true
419
- });
420
- FsFroalaLoaderService.prototype._load = function () {
421
- var _this = this;
422
- var baseDir = '/assets/froala/';
423
- this._sourceLoader.registerResources({
424
- froala: [
425
- baseDir + "js/froala_editor.min.js",
426
- baseDir + "css/froala_editor.pkgd.min.css",
427
- ],
428
- froala_align: baseDir + "js/plugins/align.min.js",
429
- froala_colors: baseDir + "js/plugins/colors.min.js",
430
- froala_image: baseDir + "js/plugins/image.min.js",
431
- froala_link: baseDir + "js/plugins/link.min.js",
432
- froala_lists: baseDir + "js/plugins/lists.min.js",
433
- froala_paragraph_format: baseDir + "js/plugins/paragraph_format.min.js",
434
- froala_table: baseDir + "js/plugins/table.min.js",
435
- froala_url: baseDir + "js/plugins/url.min.js",
436
- froala_video: baseDir + "js/plugins/video.min.js",
437
- froala_quote: baseDir + "js/plugins/quote.min.js",
438
- froala_draggable: baseDir + "js/plugins/draggable.min.js",
439
- froala_font_size: baseDir + "js/plugins/font_size.min.js",
440
- froala_quick_insert: baseDir + "js/plugins/quick_insert.min.js",
441
- froala_line_height: baseDir + "js/plugins/line_height.min.js"
442
- });
443
- this._sourceLoader.loadResource('froala')
444
- .pipe(operators.tap(function () {
445
- _this._FroalaEditor = window.FroalaEditor;
446
- _this._froalaDone();
447
- }), operators.concatMap(function () {
448
- return _this._loadPlugins();
449
- }), operators.tap(function () {
450
- _this._froalaPluginsDone();
451
- }))
452
- .subscribe();
453
- };
454
- FsFroalaLoaderService.prototype._loadPlugins = function () {
455
- var resources = this._defaultConfig
456
- .froalaPlugins
457
- .map(function (pluginName) { return "froala_" + pluginName; });
458
- return this._sourceLoader.loadResources(resources);
459
- };
460
- FsFroalaLoaderService.prototype._froalaDone = function () {
461
- this._froalaLoaded.next(true);
462
- };
463
- FsFroalaLoaderService.prototype._froalaPluginsDone = function () {
464
- this._froalaPluginsLoaded.next(true);
465
- };
466
- return FsFroalaLoaderService;
467
- }());
468
- FsFroalaLoaderService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsFroalaLoaderService, deps: [{ token: FS_HTML_EDITOR_CONFIG, optional: true }, { token: i4.DOCUMENT }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
469
- FsFroalaLoaderService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsFroalaLoaderService, providedIn: 'root' });
470
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsFroalaLoaderService, decorators: [{
471
- type: i0.Injectable,
472
- args: [{
473
- providedIn: 'root',
474
- }]
475
- }], ctorParameters: function () {
476
- return [{ type: undefined, decorators: [{
477
- type: i0.Optional
478
- }, {
479
- type: i0.Inject,
480
- args: [FS_HTML_EDITOR_CONFIG]
481
- }] }, { type: Document, decorators: [{
482
- type: i0.Inject,
483
- args: [i4.DOCUMENT]
484
- }] }];
391
+ var FsFroalaLoaderService = /** @class */ (function () {
392
+ function FsFroalaLoaderService(_defaultConfig, _document) {
393
+ this._defaultConfig = _defaultConfig;
394
+ this._document = _document;
395
+ this._froalaLoaded = new rxjs.BehaviorSubject(false);
396
+ this._froalaPluginsLoaded = new rxjs.BehaviorSubject(false);
397
+ this._sourceLoader = common.fsSourceLoader;
398
+ this._loaded$ = rxjs.combineLatest([this._froalaLoaded, this._froalaPluginsLoaded])
399
+ .pipe(operators.map(function (_a) {
400
+ var _b = __read(_a, 2), FroalaReady = _b[0], pluginsRead = _b[1];
401
+ return pluginsRead && FroalaReady;
402
+ }), operators.shareReplay(1));
403
+ this._sourceLoader.setDocument(this._document);
404
+ this._load();
405
+ }
406
+ Object.defineProperty(FsFroalaLoaderService.prototype, "loaded$", {
407
+ get: function () {
408
+ return this._loaded$;
409
+ },
410
+ enumerable: false,
411
+ configurable: true
412
+ });
413
+ Object.defineProperty(FsFroalaLoaderService.prototype, "FroalaEditor", {
414
+ get: function () {
415
+ return this._FroalaEditor;
416
+ },
417
+ enumerable: false,
418
+ configurable: true
419
+ });
420
+ FsFroalaLoaderService.prototype._load = function () {
421
+ var _this = this;
422
+ var baseDir = '/assets/froala/';
423
+ this._sourceLoader.registerResources({
424
+ froala: [
425
+ baseDir + "js/froala_editor.min.js",
426
+ baseDir + "css/froala_editor.pkgd.min.css",
427
+ ],
428
+ froala_align: baseDir + "js/plugins/align.min.js",
429
+ froala_colors: baseDir + "js/plugins/colors.min.js",
430
+ froala_image: baseDir + "js/plugins/image.min.js",
431
+ froala_link: baseDir + "js/plugins/link.min.js",
432
+ froala_lists: baseDir + "js/plugins/lists.min.js",
433
+ froala_paragraph_format: baseDir + "js/plugins/paragraph_format.min.js",
434
+ froala_table: baseDir + "js/plugins/table.min.js",
435
+ froala_url: baseDir + "js/plugins/url.min.js",
436
+ froala_video: baseDir + "js/plugins/video.min.js",
437
+ froala_quote: baseDir + "js/plugins/quote.min.js",
438
+ froala_draggable: baseDir + "js/plugins/draggable.min.js",
439
+ froala_font_size: baseDir + "js/plugins/font_size.min.js",
440
+ froala_quick_insert: baseDir + "js/plugins/quick_insert.min.js",
441
+ froala_line_height: baseDir + "js/plugins/line_height.min.js"
442
+ });
443
+ this._sourceLoader.loadResource('froala')
444
+ .pipe(operators.tap(function () {
445
+ _this._FroalaEditor = window.FroalaEditor;
446
+ _this._froalaDone();
447
+ }), operators.concatMap(function () {
448
+ return _this._loadPlugins();
449
+ }), operators.tap(function () {
450
+ _this._froalaPluginsDone();
451
+ }))
452
+ .subscribe();
453
+ };
454
+ FsFroalaLoaderService.prototype._loadPlugins = function () {
455
+ var resources = this._defaultConfig
456
+ .froalaPlugins
457
+ .map(function (pluginName) { return "froala_" + pluginName; });
458
+ return this._sourceLoader.loadResources(resources);
459
+ };
460
+ FsFroalaLoaderService.prototype._froalaDone = function () {
461
+ this._froalaLoaded.next(true);
462
+ };
463
+ FsFroalaLoaderService.prototype._froalaPluginsDone = function () {
464
+ this._froalaPluginsLoaded.next(true);
465
+ };
466
+ return FsFroalaLoaderService;
467
+ }());
468
+ FsFroalaLoaderService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsFroalaLoaderService, deps: [{ token: FS_HTML_EDITOR_CONFIG, optional: true }, { token: i3.DOCUMENT }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
469
+ FsFroalaLoaderService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsFroalaLoaderService, providedIn: 'root' });
470
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsFroalaLoaderService, decorators: [{
471
+ type: i0.Injectable,
472
+ args: [{
473
+ providedIn: 'root',
474
+ }]
475
+ }], ctorParameters: function () {
476
+ return [{ type: undefined, decorators: [{
477
+ type: i0.Optional
478
+ }, {
479
+ type: i0.Inject,
480
+ args: [FS_HTML_EDITOR_CONFIG]
481
+ }] }, { type: Document, decorators: [{
482
+ type: i0.Inject,
483
+ args: [i3.DOCUMENT]
484
+ }] }];
485
485
  } });
486
486
 
487
- var FsHtmlRendererComponent = /** @class */ (function () {
488
- function FsHtmlRendererComponent(sanitized, _cdRef) {
489
- this.sanitized = sanitized;
490
- this._cdRef = _cdRef;
491
- }
492
- Object.defineProperty(FsHtmlRendererComponent.prototype, "setHtml", {
493
- set: function (html) {
494
- this.trustedHtml = this.sanitized.bypassSecurityTrustHtml(html || '');
495
- this._cdRef.markForCheck();
496
- },
497
- enumerable: false,
498
- configurable: true
499
- });
500
- return FsHtmlRendererComponent;
501
- }());
502
- FsHtmlRendererComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsHtmlRendererComponent, deps: [{ token: i1__namespace.DomSanitizer }, { token: i0__namespace.ChangeDetectorRef }], target: i0__namespace.ɵɵFactoryTarget.Component });
503
- FsHtmlRendererComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: FsHtmlRendererComponent, selector: "fs-html-renderer", inputs: { setHtml: ["html", "setHtml"] }, ngImport: i0__namespace, template: "<span class=\"fr-view fs-html-editor-default\" [innerHtml]=\"trustedHtml\"></span>\n", styles: [""], changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush });
504
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsHtmlRendererComponent, decorators: [{
505
- type: i0.Component,
506
- args: [{
507
- selector: 'fs-html-renderer',
508
- templateUrl: 'html-renderer.component.html',
509
- styleUrls: ['html-renderer.component.scss'],
510
- changeDetection: i0.ChangeDetectionStrategy.OnPush,
511
- }]
512
- }], ctorParameters: function () { return [{ type: i1__namespace.DomSanitizer }, { type: i0__namespace.ChangeDetectorRef }]; }, propDecorators: { setHtml: [{
513
- type: i0.Input,
514
- args: ['html']
487
+ var FsHtmlEditorComponent = /** @class */ (function () {
488
+ function FsHtmlEditorComponent(_defaultConfig, _cdRef, _fr) {
489
+ this._defaultConfig = _defaultConfig;
490
+ this._cdRef = _cdRef;
491
+ this._fr = _fr;
492
+ this.classFocused = false;
493
+ this.classDisabled = false;
494
+ this.config = {};
495
+ this.initialized = false;
496
+ this._initialize$ = new rxjs.ReplaySubject();
497
+ this._froalaReady$ = new rxjs.BehaviorSubject(null);
498
+ this._destroy$ = new rxjs.Subject();
499
+ this.onChange = function (data) { };
500
+ this.onTouched = function () { };
501
+ }
502
+ Object.defineProperty(FsHtmlEditorComponent.prototype, "el", {
503
+ get: function () {
504
+ return this.elRef.nativeElement;
505
+ },
506
+ enumerable: false,
507
+ configurable: true
508
+ });
509
+ Object.defineProperty(FsHtmlEditorComponent.prototype, "html", {
510
+ get: function () {
511
+ return this._html;
512
+ },
513
+ enumerable: false,
514
+ configurable: true
515
+ });
516
+ Object.defineProperty(FsHtmlEditorComponent.prototype, "editor", {
517
+ get: function () {
518
+ return this._editor;
519
+ },
520
+ enumerable: false,
521
+ configurable: true
522
+ });
523
+ Object.defineProperty(FsHtmlEditorComponent.prototype, "froalaLoaded$", {
524
+ get: function () {
525
+ return this._fr.loaded$;
526
+ },
527
+ enumerable: false,
528
+ configurable: true
529
+ });
530
+ FsHtmlEditorComponent.prototype.ngOnInit = function () {
531
+ this.config = this.config || {};
532
+ this.config.autofocus = this.config.autofocus !== false && !this.config.disabled;
533
+ this._listenLazyInit();
534
+ };
535
+ FsHtmlEditorComponent.prototype.ngAfterViewInit = function () {
536
+ this._initialize$.next();
537
+ };
538
+ FsHtmlEditorComponent.prototype.hasContent = function () {
539
+ var el = document.createElement('div');
540
+ if (el.querySelector('img')) {
541
+ return true;
542
+ }
543
+ el.innerHTML = this._html;
544
+ return !!el.innerText.length;
545
+ };
546
+ FsHtmlEditorComponent.prototype.initialize = function (options) {
547
+ var _this = this;
548
+ if (options === void 0) { options = {}; }
549
+ var config = this._createConfig();
550
+ this._initPlugins(config);
551
+ this._initButtons(config);
552
+ this._editor = new this._fr.FroalaEditor(this.el, this._createOptions(), function () {
553
+ _this._froalaReady$.next({ config: config, options: options });
554
+ });
555
+ };
556
+ FsHtmlEditorComponent.prototype._processImageUpload = function (blob) {
557
+ var _this = this;
558
+ var processor = new file.FileProcessor();
559
+ var file$1 = new file.FsFile(blob);
560
+ var config = {
561
+ orientate: true,
562
+ quality: this.config.image.quality,
563
+ format: this.config.image.format,
564
+ maxWidth: this.config.image.width,
565
+ maxHeight: this.config.image.height,
566
+ minWidth: this.config.image.minWidth,
567
+ minHeight: this.config.image.minHeight,
568
+ };
569
+ return processor.processFile(file$1, config)
570
+ .pipe(operators.switchMap(function (fsFile) {
571
+ return _this.config.image.upload(fsFile.file);
572
+ }));
573
+ };
574
+ FsHtmlEditorComponent.prototype.updateSize = function () {
575
+ // Hack: To trigger the toolbar button size modes
576
+ window.dispatchEvent(new Event('resize'));
577
+ };
578
+ FsHtmlEditorComponent.prototype.validate = function (control) {
579
+ var err = {};
580
+ if (this.config.maxLength && this._html) {
581
+ var maxLength = this.config.maxLength;
582
+ var length = this._html.length;
583
+ if (length > maxLength) {
584
+ err.maxLengthError = "Must be " + maxLength + " characters or fewer. You entered " + length + " characters.";
585
+ }
586
+ }
587
+ return Object.keys(err).length ? err : null;
588
+ };
589
+ FsHtmlEditorComponent.prototype.focus = function (options) {
590
+ options = options ? options : {};
591
+ if (options.cursorPosition === 'end') {
592
+ this.editor.selection.setAtEnd(this.editor.$el.get(0));
593
+ }
594
+ else {
595
+ this.editor.selection.setAtStart(this.editor.$el.get(0));
596
+ }
597
+ this.editor.selection.restore();
598
+ var elSelection = this.editor.selection.element();
599
+ if (elSelection) {
600
+ elSelection.scrollIntoView({ block: 'center' });
601
+ }
602
+ };
603
+ FsHtmlEditorComponent.prototype.clear = function () {
604
+ this.writeValue('');
605
+ };
606
+ FsHtmlEditorComponent.prototype.disable = function () {
607
+ this.classDisabled = true;
608
+ };
609
+ FsHtmlEditorComponent.prototype.setHtml = function (html) {
610
+ this.writeValue(html);
611
+ };
612
+ FsHtmlEditorComponent.prototype.writeValue = function (html) {
613
+ this._html = html || '';
614
+ if (Array.isArray(this._html)) {
615
+ this._html = this._html.pop();
616
+ }
617
+ this._html = this._html
618
+ .replace(/<(li)>\s?<(div)>/g, '<li>')
619
+ .replace(/<\/(div)><\/(li)>/g, '</li>');
620
+ if (this.editor && this.editor.html) {
621
+ try {
622
+ this.editor.html.set(this._html);
623
+ }
624
+ catch (e) {
625
+ }
626
+ }
627
+ this._cdRef.markForCheck();
628
+ };
629
+ FsHtmlEditorComponent.prototype.registerOnChange = function (fn) {
630
+ this.onChange = fn;
631
+ };
632
+ FsHtmlEditorComponent.prototype.registerOnTouched = function (fn) {
633
+ this.onTouched = fn;
634
+ };
635
+ FsHtmlEditorComponent.prototype.ngOnDestroy = function () {
636
+ this._initialize$.complete();
637
+ this._destroy$.next();
638
+ this._destroy$.complete();
639
+ this.destroy();
640
+ };
641
+ FsHtmlEditorComponent.prototype.destroy = function () {
642
+ if (this.editor) {
643
+ this.editor.destroy();
644
+ }
645
+ this.initialized = false;
646
+ this._cdRef.markForCheck();
647
+ this.el.innerHTML = '';
648
+ };
649
+ FsHtmlEditorComponent.prototype._createConfig = function () {
650
+ return lodashEs.merge({ froalaConfig: {} }, this._defaultConfig, this.config);
651
+ };
652
+ FsHtmlEditorComponent.prototype._change = function (html) {
653
+ this._html = html;
654
+ this.onChange(html);
655
+ };
656
+ FsHtmlEditorComponent.prototype._initButtons = function (config) {
657
+ var _this = this;
658
+ (config.buttons || [])
659
+ .forEach(function (button) {
660
+ /*
661
+ Svg Keys:
662
+ ["add", "advancedImageEditor", "alignCenter", "alignJustify", "alignLeft", "alignRight",
663
+ "anchors", "back", "backgroundColor", "blockquote", "bold", "cellBackground",
664
+ "cellBorderColor", "cellOptions", "cellStyle", "clearFormatting", "close", "codeView",
665
+ "cogs", "columns", "editLink", "exitFullscreen", "fontAwesome", "fontFamily",
666
+ "fontSize", "fullscreen", "help", "horizontalLine", "imageAltText", "imageCaption",
667
+ "imageClass", "imageDisplay", "imageManager", "imageSize", "indent", "inlineClass",
668
+ "inlineStyle", "insertEmbed", "insertFile", "insertImage", "insertLink", "insertMore",
669
+ "insertTable", "insertVideo", "upload", "italic", "search", "lineHeight", "linkStyles",
670
+ "mention", "more", "openLink", "orderedList", "outdent", "pageBreaker",
671
+ "paragraphFormat", "paragraphMore", "paragraphStyle", "pdfExport", "print",
672
+ "redo", "removeTable", "remove", "replaceImage", "row", "selectAll", "smile",
673
+ "spellcheck", "star", "strikeThrough", "subscript", "superscript", "symbols", "tags",
674
+ "tableHeader", "tableStyle", "textColor", "textMore", "underline", "undo", "unlink",
675
+ "unorderedList", "verticalAlignBottom", "verticalAlignMiddle", "verticalAlignTop"]
676
+ */
677
+ var _a, _b, _c;
678
+ if (button.svgKey) {
679
+ _this._fr.FroalaEditor.DefineIcon(button.name, { SVG_KEY: button.svgKey });
680
+ }
681
+ _this._fr.FroalaEditor.RegisterCommand(button.name, {
682
+ title: button.title,
683
+ focus: (_a = button.focus) !== null && _a !== void 0 ? _a : true,
684
+ undo: (_b = button.undo) !== null && _b !== void 0 ? _b : true,
685
+ refreshAfterCallback: (_c = button.refreshAfterCallback) !== null && _c !== void 0 ? _c : true,
686
+ callback: function () {
687
+ button.click(this);
688
+ }
689
+ });
690
+ });
691
+ };
692
+ FsHtmlEditorComponent.prototype._initPlugins = function (config) {
693
+ var _this = this;
694
+ (config.plugins || []).forEach(function (plugin) {
695
+ _this._fr.FroalaEditor.PLUGINS[plugin.config.name] = function (editor) {
696
+ plugin.editor = editor;
697
+ plugin.initialize();
698
+ return plugin;
699
+ };
700
+ (plugin.config.buttons || []).forEach(function (button) {
701
+ _this._fr.FroalaEditor.DefineIcon(button.name, {
702
+ NAME: button.name,
703
+ PATH: button.svgPath,
704
+ });
705
+ _this._fr.FroalaEditor.RegisterCommand(button.name, {
706
+ icon: button.name,
707
+ title: button.tooltip,
708
+ undo: button.undo,
709
+ focus: button.focus,
710
+ showOnMobile: button.showOnMobile,
711
+ refreshAfterCallback: button.refreshAfterCallback,
712
+ callback: function () {
713
+ if (button.click) {
714
+ button.click(this);
715
+ }
716
+ },
717
+ refresh: function (button) {
718
+ if (button.refresh) {
719
+ button.refresh(this, button);
720
+ }
721
+ }
722
+ });
723
+ });
724
+ });
725
+ };
726
+ FsHtmlEditorComponent.prototype._createOptions = function () {
727
+ var _a, _b;
728
+ var config = this._createConfig();
729
+ return lodashEs.merge(
730
+ // For some reason editor store somewhere pointer on default config object and dublicate options each time on init
731
+ // Extra merge level fixed this problem and allow to init config properly without legacy data
732
+ {}, {
733
+ shortcutsEnabled: ['show', 'bold', 'italic', 'underline', 'indent', 'outdent', 'undo', 'redo', 'insertImage', 'createLink'],
734
+ key: config.activationKey,
735
+ placeholderText: config.placeholder,
736
+ linkAlwaysBlank: true,
737
+ tabSpaces: 2,
738
+ typingTimer: 250,
739
+ tooltips: false,
740
+ wordPasteModal: false,
741
+ imageDefaultWidth: 0,
742
+ imageDefaultAlign: 'left',
743
+ quickInsertEnabled: false,
744
+ paragraphDefaultSelection: 'Format',
745
+ videoUpload: false,
746
+ imagePaste: !!((_a = config.image) === null || _a === void 0 ? void 0 : _a.upload),
747
+ imageUpload: !!((_b = config.image) === null || _b === void 0 ? void 0 : _b.upload),
748
+ paragraphFormat: {
749
+ N: 'Normal',
750
+ H1: 'Heading 1',
751
+ H2: 'Heading 2',
752
+ H3: 'Heading 3',
753
+ H4: 'Heading 4',
754
+ BLOCKQUOTE: 'Quote',
755
+ },
756
+ lineHeights: {
757
+ Default: '',
758
+ '0.5': '0.5',
759
+ 'Single': '1',
760
+ '1.15': '1.15',
761
+ '1.5': '1.5',
762
+ 'Double': '2'
763
+ },
764
+ paragraphFormatSelection: true,
765
+ toolbarButtonsXS: {
766
+ moreText: {
767
+ buttons: TextButtons,
768
+ buttonsVisible: 1,
769
+ },
770
+ moreParagraph: {
771
+ buttons: ParagraphButtons,
772
+ buttonsVisible: 2,
773
+ },
774
+ moreRich: {
775
+ buttons: RichButtons,
776
+ buttonsVisible: 0,
777
+ },
778
+ },
779
+ toolbarButtons: {
780
+ moreText: {
781
+ buttons: TextButtons,
782
+ buttonsVisible: 3,
783
+ },
784
+ moreParagraph: {
785
+ buttons: ParagraphButtons,
786
+ buttonsVisible: 5,
787
+ },
788
+ moreRich: {
789
+ buttons: RichButtons,
790
+ buttonsVisible: 3,
791
+ },
792
+ },
793
+ }, config.froalaConfig);
794
+ };
795
+ FsHtmlEditorComponent.prototype._listenLazyInit = function () {
796
+ var _this = this;
797
+ this.froalaLoaded$
798
+ .pipe(operators.filter(function (ready) { return ready; }), operators.switchMap(function () { return _this._initialize$; }), operators.tap(function () {
799
+ var selection = window.getSelection();
800
+ var options = {};
801
+ if (selection.baseNode) {
802
+ options.selection = {
803
+ node: selection.baseNode.nodeValue,
804
+ offset: selection.baseOffset,
805
+ };
806
+ }
807
+ _this.initialize(options);
808
+ }), operators.switchMap(function () { return _this._froalaReady$; }), operators.filter(function (data) { return !!data; }), operators.tap(function (_d) {
809
+ var config = _d.config, options = _d.options;
810
+ _this._setupFroala(config, options);
811
+ }))
812
+ .subscribe();
813
+ };
814
+ FsHtmlEditorComponent.prototype._contentChanged = function () {
815
+ var editorHTML = this._editor.html.get();
816
+ if (this.html !== editorHTML) {
817
+ this._change(editorHTML);
818
+ }
819
+ };
820
+ FsHtmlEditorComponent.prototype._setupFroala = function (config, options) {
821
+ var _this = this;
822
+ this._cdRef.markForCheck();
823
+ this.setHtml(this._html);
824
+ if (config.disabled) {
825
+ this.disable();
826
+ }
827
+ if (config.froalaConfig.events) {
828
+ if (config.froalaConfig.events.initialized) {
829
+ config.froalaConfig.events.initialized();
830
+ }
831
+ }
832
+ this._editor.events.on('focus', function () {
833
+ _this.classFocused = true;
834
+ _this._cdRef.markForCheck();
835
+ });
836
+ this._editor.events.on('blur', function () {
837
+ _this.classFocused = false;
838
+ _this._cdRef.markForCheck();
839
+ });
840
+ this._editor.events.on('click', function () {
841
+ if (_this.config.initOnClick && !_this.initialized) {
842
+ _this.initialized = true;
843
+ _this._cdRef.markForCheck();
844
+ }
845
+ });
846
+ rxjs.fromEventPattern(function (handler) {
847
+ _this._editor.events.on('contentChanged', handler);
848
+ }, function () { })
849
+ .pipe(operators.startWith(this._html), operators.map(function () { return _this.editor.html.get(); }), operators.distinctUntilChanged(), operators.skip(1))
850
+ .subscribe(function () {
851
+ _this._contentChanged();
852
+ });
853
+ this._editor.events.on('paste.afterCleanup', function (html) {
854
+ var div = document.createElement('div');
855
+ div.innerHTML = html;
856
+ div.querySelectorAll('*')
857
+ .forEach(function (el) {
858
+ for (var i = 0; i < el.attributes.length; i++) {
859
+ var name = el.attributes[0].name;
860
+ if (name !== 'href') {
861
+ el.removeAttribute(name);
862
+ }
863
+ }
864
+ });
865
+ return div.innerHTML;
866
+ });
867
+ this._editor.events.on('keydown', function () {
868
+ _this.onTouched();
869
+ });
870
+ if (this.config.image && this.config.image.upload) {
871
+ this._editor.events.on('image.beforePasteUpload', function (image) {
872
+ fetch(image.getAttribute('src'))
873
+ .then(function (res) {
874
+ res.blob()
875
+ .then(function (blob) {
876
+ _this._processImageUpload(blob)
877
+ .pipe(operators.takeUntil(_this._destroy$))
878
+ .subscribe(function (url) {
879
+ image.setAttribute('src', url);
880
+ image.removeAttribute('data-fr-image-pasted');
881
+ _this._contentChanged();
882
+ });
883
+ });
884
+ });
885
+ return false;
886
+ });
887
+ this._editor.events.on('image.beforeUpload', function (blobs) {
888
+ _this._processImageUpload(blobs[0])
889
+ .pipe(operators.takeUntil(_this._destroy$))
890
+ .subscribe(function (url) {
891
+ _this.editor.image.insert(url, null, null, _this.editor.image.get());
892
+ });
893
+ return false;
894
+ });
895
+ }
896
+ if (this.el.querySelector('.fr-second-toolbar')) {
897
+ this.el.querySelector('.fr-second-toolbar').remove();
898
+ }
899
+ if (this.config.autofocus && !this.config.initOnClick) {
900
+ this.focus();
901
+ }
902
+ };
903
+ return FsHtmlEditorComponent;
904
+ }());
905
+ FsHtmlEditorComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsHtmlEditorComponent, deps: [{ token: FS_HTML_EDITOR_CONFIG, optional: true }, { token: i0__namespace.ChangeDetectorRef }, { token: FsFroalaLoaderService }], target: i0__namespace.ɵɵFactoryTarget.Component });
906
+ FsHtmlEditorComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: FsHtmlEditorComponent, selector: "fs-html-editor", inputs: { config: "config", hint: "hint" }, host: { properties: { "class.focused": "this.classFocused", "class.disabled": "this.classDisabled" } }, providers: [
907
+ {
908
+ provide: forms.NG_VALUE_ACCESSOR,
909
+ useExisting: i0.forwardRef(function () { return FsHtmlEditorComponent; }),
910
+ multi: true
911
+ },
912
+ {
913
+ provide: forms.NG_VALIDATORS,
914
+ useExisting: i0.forwardRef(function () { return FsHtmlEditorComponent; }),
915
+ multi: true
916
+ },
917
+ ], viewQueries: [{ propertyName: "elRef", first: true, predicate: ["elRef"], descendants: true }], ngImport: i0__namespace, template: "<fs-label-field>\n <fs-label *ngIf=\"config.label\">{{config.label}}</fs-label>\n <div \n class=\"html-editor-container fs-html-editor-default\" \n [ngClass]=\"{ \n initialized: initialized,\n 'init-on-click': config.initOnClick\n }\"> \n <ng-container *fsSkeleton=\"(froalaLoaded$ | async) !== false\"></ng-container> \n <div #elRef></div>\n \n <div class=\"bottom-line\"></div>\n <div class=\"disabled-line\"></div>\n </div>\n \n <fs-label-message>\n <div class=\"fs-form-message\">\n <div class=\"fs-form-hint\">{{hint}}</div>\n </div>\n </fs-label-message>\n</fs-label-field>\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-open .fr-more-toolbar{display:block}:host ::ng-deep .fr-more-toolbar{display:none}: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;display:flex;justify-content:center;padding-left:0!important}: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 ::ng-deep .html-editor-container.init-on-click:not(.initialized) .fr-toolbar{display:none}: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;transform:translate(-180px)}::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: i2__namespace.FsLabelFieldComponent, selector: "fs-label-field", inputs: ["bottomMargin", "topMargin", "labelMargin"] }, { type: i2__namespace.FsLabelComponent, selector: "fs-label" }, { type: i2__namespace.FsLabelMessageComponent, selector: "fs-label-message" }], directives: [{ type: i3__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i3__namespace.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i4__namespace.FsSkeletonContentDirective, selector: "[fsSkeleton]", inputs: ["fsSkeleton", "fsSkeletonPattern"] }], pipes: { "async": i3__namespace.AsyncPipe }, changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush });
918
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsHtmlEditorComponent, decorators: [{
919
+ type: i0.Component,
920
+ args: [{
921
+ selector: 'fs-html-editor',
922
+ templateUrl: 'html-editor.component.html',
923
+ styleUrls: ['html-editor.component.scss'],
924
+ providers: [
925
+ {
926
+ provide: forms.NG_VALUE_ACCESSOR,
927
+ useExisting: i0.forwardRef(function () { return FsHtmlEditorComponent; }),
928
+ multi: true
929
+ },
930
+ {
931
+ provide: forms.NG_VALIDATORS,
932
+ useExisting: i0.forwardRef(function () { return FsHtmlEditorComponent; }),
933
+ multi: true
934
+ },
935
+ ],
936
+ changeDetection: i0.ChangeDetectionStrategy.OnPush,
937
+ }]
938
+ }], ctorParameters: function () {
939
+ return [{ type: undefined, decorators: [{
940
+ type: i0.Optional
941
+ }, {
942
+ type: i0.Inject,
943
+ args: [FS_HTML_EDITOR_CONFIG]
944
+ }] }, { type: i0__namespace.ChangeDetectorRef }, { type: FsFroalaLoaderService }];
945
+ }, propDecorators: { classFocused: [{
946
+ type: i0.HostBinding,
947
+ args: ['class.focused']
948
+ }], classDisabled: [{
949
+ type: i0.HostBinding,
950
+ args: ['class.disabled']
951
+ }], elRef: [{
952
+ type: i0.ViewChild,
953
+ args: ['elRef']
954
+ }], config: [{
955
+ type: i0.Input
956
+ }], hint: [{
957
+ type: i0.Input
515
958
  }] } });
516
959
 
517
- var FsHtmlEditorComponent = /** @class */ (function () {
518
- function FsHtmlEditorComponent(_defaultConfig, _cdRef, _fr) {
519
- this._defaultConfig = _defaultConfig;
520
- this._cdRef = _cdRef;
521
- this._fr = _fr;
522
- this.classFocused = false;
523
- this.classDisabled = false;
524
- this.config = {};
525
- this.initialized = false;
526
- this._initialize$ = new rxjs.ReplaySubject();
527
- this._froalaReady$ = new rxjs.BehaviorSubject(null);
528
- this._destroy$ = new rxjs.Subject();
529
- this.onChange = function (data) { };
530
- this.onTouched = function () { };
531
- }
532
- Object.defineProperty(FsHtmlEditorComponent.prototype, "el", {
533
- get: function () {
534
- return this.elRef.nativeElement;
535
- },
536
- enumerable: false,
537
- configurable: true
538
- });
539
- Object.defineProperty(FsHtmlEditorComponent.prototype, "html", {
540
- get: function () {
541
- return this._html;
542
- },
543
- enumerable: false,
544
- configurable: true
545
- });
546
- Object.defineProperty(FsHtmlEditorComponent.prototype, "editor", {
547
- get: function () {
548
- return this._editor;
549
- },
550
- enumerable: false,
551
- configurable: true
552
- });
553
- Object.defineProperty(FsHtmlEditorComponent.prototype, "froalaLoaded$", {
554
- get: function () {
555
- return this._fr.loaded$;
556
- },
557
- enumerable: false,
558
- configurable: true
559
- });
560
- FsHtmlEditorComponent.prototype.ngOnInit = function () {
561
- this.config = this.config || {};
562
- this.config.autofocus = this.config.autofocus !== false && !this.config.disabled;
563
- this.initialized = !this.config.initOnClick;
564
- this._listenLazyInit();
565
- };
566
- FsHtmlEditorComponent.prototype.ngAfterViewInit = function () {
567
- if (!this.config.initOnClick || !this.hasContent()) {
568
- this.initialized = true;
569
- this._initialize$.next();
570
- }
571
- };
572
- FsHtmlEditorComponent.prototype.hasContent = function () {
573
- var el = document.createElement('div');
574
- if (el.querySelector('img')) {
575
- return true;
576
- }
577
- el.innerHTML = this._html;
578
- return !!el.innerText.length;
579
- };
580
- FsHtmlEditorComponent.prototype.initialize = function (options) {
581
- var _this = this;
582
- if (options === void 0) { options = {}; }
583
- var config = this._createConfig();
584
- this._initPlugins(config);
585
- this._initButtons(config);
586
- this._editor = new this._fr.FroalaEditor(this.el, this._createOptions(), function () {
587
- _this._froalaReady$.next({ config: config, options: options });
588
- });
589
- };
590
- FsHtmlEditorComponent.prototype._processImageUpload = function (blob) {
591
- var _this = this;
592
- var processor = new file.FileProcessor();
593
- var file$1 = new file.FsFile(blob);
594
- var config = {
595
- orientate: true,
596
- quality: this.config.image.quality,
597
- format: this.config.image.format,
598
- maxWidth: this.config.image.width,
599
- maxHeight: this.config.image.height,
600
- minWidth: this.config.image.minWidth,
601
- minHeight: this.config.image.minHeight,
602
- };
603
- return processor.processFile(file$1, config)
604
- .pipe(operators.switchMap(function (fsFile) {
605
- return _this.config.image.upload(fsFile.file);
606
- }));
607
- };
608
- FsHtmlEditorComponent.prototype.uninitializedClick = function (event) {
609
- if (!event.defaultPrevented) {
610
- var target_1 = event.target;
611
- if (target_1 && target_1.nodeName === 'A' && target_1.getAttribute('href')) {
612
- var targetTarget_1 = target_1.getAttribute('target');
613
- target_1.setAttribute('target', '_blank');
614
- setTimeout(function () {
615
- if (targetTarget_1) {
616
- target_1.setAttribute('target', targetTarget_1);
617
- }
618
- else {
619
- target_1.removeAttribute('target');
620
- }
621
- });
622
- }
623
- else {
624
- if (this.config.initClick) {
625
- this.config.initClick(event);
626
- }
627
- this._initialize$.next();
628
- this.initialized = true;
629
- }
630
- }
631
- };
632
- FsHtmlEditorComponent.prototype.updateSize = function () {
633
- // Hack: To trigger the toolbar button size modes
634
- window.dispatchEvent(new Event('resize'));
635
- };
636
- FsHtmlEditorComponent.prototype.validate = function (control) {
637
- var err = {};
638
- if (this.config.maxLength && this._html) {
639
- var maxLength = this.config.maxLength;
640
- var length = this._html.length;
641
- if (length > maxLength) {
642
- err.maxLengthError = "Must be " + maxLength + " characters or fewer. You entered " + length + " characters.";
643
- }
644
- }
645
- return Object.keys(err).length ? err : null;
646
- };
647
- FsHtmlEditorComponent.prototype.focus = function (options) {
648
- options = options ? options : {};
649
- if (options.cursorPosition === 'end') {
650
- this.editor.selection.setAtEnd(this.editor.$el.get(0));
651
- }
652
- else {
653
- this.editor.selection.setAtStart(this.editor.$el.get(0));
654
- }
655
- this.editor.selection.restore();
656
- var elSelection = this.editor.selection.element();
657
- if (elSelection) {
658
- elSelection.scrollIntoView({ block: 'center' });
659
- }
660
- };
661
- FsHtmlEditorComponent.prototype.clear = function () {
662
- this.writeValue('');
663
- };
664
- FsHtmlEditorComponent.prototype.disable = function () {
665
- this.classDisabled = true;
666
- };
667
- FsHtmlEditorComponent.prototype.setHtml = function (html) {
668
- this.writeValue(html);
669
- };
670
- FsHtmlEditorComponent.prototype.writeValue = function (html) {
671
- this._html = html || '';
672
- if (Array.isArray(this._html)) {
673
- this._html = this._html.pop();
674
- }
675
- this._html = this._html
676
- .replace(/<(li)>\s?<(div)>/g, '<li>')
677
- .replace(/<\/(div)><\/(li)>/g, '</li>');
678
- if (this.editor && this.editor.html) {
679
- try {
680
- this.editor.html.set(this._html);
681
- }
682
- catch (e) {
683
- }
684
- }
685
- this._cdRef.markForCheck();
686
- };
687
- FsHtmlEditorComponent.prototype.registerOnChange = function (fn) {
688
- this.onChange = fn;
689
- };
690
- FsHtmlEditorComponent.prototype.registerOnTouched = function (fn) {
691
- this.onTouched = fn;
692
- };
693
- FsHtmlEditorComponent.prototype.ngOnDestroy = function () {
694
- this._initialize$.complete();
695
- this._destroy$.next();
696
- this._destroy$.complete();
697
- this.destroy();
698
- };
699
- FsHtmlEditorComponent.prototype.destroy = function () {
700
- if (this.editor) {
701
- this.editor.destroy();
702
- }
703
- this.initialized = false;
704
- this._cdRef.markForCheck();
705
- this.el.innerHTML = '';
706
- };
707
- FsHtmlEditorComponent.prototype._createConfig = function () {
708
- return lodashEs.merge({ froalaConfig: {} }, this._defaultConfig, this.config);
709
- };
710
- FsHtmlEditorComponent.prototype._change = function (html) {
711
- this._html = html;
712
- this.onChange(html);
713
- };
714
- FsHtmlEditorComponent.prototype._initButtons = function (config) {
715
- var _this = this;
716
- (config.buttons || [])
717
- .forEach(function (button) {
718
- /*
719
- Svg Keys:
720
- ["add", "advancedImageEditor", "alignCenter", "alignJustify", "alignLeft", "alignRight",
721
- "anchors", "back", "backgroundColor", "blockquote", "bold", "cellBackground",
722
- "cellBorderColor", "cellOptions", "cellStyle", "clearFormatting", "close", "codeView",
723
- "cogs", "columns", "editLink", "exitFullscreen", "fontAwesome", "fontFamily",
724
- "fontSize", "fullscreen", "help", "horizontalLine", "imageAltText", "imageCaption",
725
- "imageClass", "imageDisplay", "imageManager", "imageSize", "indent", "inlineClass",
726
- "inlineStyle", "insertEmbed", "insertFile", "insertImage", "insertLink", "insertMore",
727
- "insertTable", "insertVideo", "upload", "italic", "search", "lineHeight", "linkStyles",
728
- "mention", "more", "openLink", "orderedList", "outdent", "pageBreaker",
729
- "paragraphFormat", "paragraphMore", "paragraphStyle", "pdfExport", "print",
730
- "redo", "removeTable", "remove", "replaceImage", "row", "selectAll", "smile",
731
- "spellcheck", "star", "strikeThrough", "subscript", "superscript", "symbols", "tags",
732
- "tableHeader", "tableStyle", "textColor", "textMore", "underline", "undo", "unlink",
733
- "unorderedList", "verticalAlignBottom", "verticalAlignMiddle", "verticalAlignTop"]
734
- */
735
- var _a, _b, _c;
736
- if (button.svgKey) {
737
- _this._fr.FroalaEditor.DefineIcon(button.name, { SVG_KEY: button.svgKey });
738
- }
739
- _this._fr.FroalaEditor.RegisterCommand(button.name, {
740
- title: button.title,
741
- focus: (_a = button.focus) !== null && _a !== void 0 ? _a : true,
742
- undo: (_b = button.undo) !== null && _b !== void 0 ? _b : true,
743
- refreshAfterCallback: (_c = button.refreshAfterCallback) !== null && _c !== void 0 ? _c : true,
744
- callback: function () {
745
- button.click(this);
746
- }
747
- });
748
- });
749
- };
750
- FsHtmlEditorComponent.prototype._initPlugins = function (config) {
751
- var _this = this;
752
- (config.plugins || []).forEach(function (plugin) {
753
- _this._fr.FroalaEditor.PLUGINS[plugin.config.name] = function (editor) {
754
- plugin.editor = editor;
755
- plugin.initialize();
756
- return plugin;
757
- };
758
- (plugin.config.buttons || []).forEach(function (button) {
759
- _this._fr.FroalaEditor.DefineIcon(button.name, {
760
- NAME: button.name,
761
- PATH: button.svgPath,
762
- });
763
- _this._fr.FroalaEditor.RegisterCommand(button.name, {
764
- icon: button.name,
765
- title: button.tooltip,
766
- undo: button.undo,
767
- focus: button.focus,
768
- showOnMobile: button.showOnMobile,
769
- refreshAfterCallback: button.refreshAfterCallback,
770
- callback: function () {
771
- if (button.click) {
772
- button.click(this);
773
- }
774
- },
775
- refresh: function (button) {
776
- if (button.refresh) {
777
- button.refresh(this, button);
778
- }
779
- }
780
- });
781
- });
782
- });
783
- };
784
- FsHtmlEditorComponent.prototype._createOptions = function () {
785
- var _a, _b;
786
- var config = this._createConfig();
787
- return lodashEs.merge(
788
- // For some reason editor store somewhere pointer on default config object and dublicate options each time on init
789
- // Extra merge level fixed this problem and allow to init config properly without legacy data
790
- {}, {
791
- shortcutsEnabled: ['show', 'bold', 'italic', 'underline', 'indent', 'outdent', 'undo', 'redo', 'insertImage', 'createLink'],
792
- key: config.activationKey,
793
- placeholderText: config.placeholder,
794
- linkAlwaysBlank: true,
795
- tabSpaces: 2,
796
- typingTimer: 250,
797
- tooltips: false,
798
- wordPasteModal: false,
799
- imageDefaultWidth: 0,
800
- imageDefaultAlign: 'left',
801
- quickInsertEnabled: false,
802
- paragraphDefaultSelection: 'Format',
803
- videoUpload: false,
804
- imagePaste: !!((_a = config.image) === null || _a === void 0 ? void 0 : _a.upload),
805
- imageUpload: !!((_b = config.image) === null || _b === void 0 ? void 0 : _b.upload),
806
- paragraphFormat: {
807
- N: 'Normal',
808
- H1: 'Heading 1',
809
- H2: 'Heading 2',
810
- H3: 'Heading 3',
811
- H4: 'Heading 4',
812
- BLOCKQUOTE: 'Quote',
813
- },
814
- lineHeights: {
815
- Default: '',
816
- '0.5': '0.5',
817
- 'Single': '1',
818
- '1.15': '1.15',
819
- '1.5': '1.5',
820
- 'Double': '2'
821
- },
822
- paragraphFormatSelection: true,
823
- toolbarButtonsXS: {
824
- moreText: {
825
- buttons: TextButtons,
826
- buttonsVisible: 1,
827
- },
828
- moreParagraph: {
829
- buttons: ParagraphButtons,
830
- buttonsVisible: 2,
831
- },
832
- moreRich: {
833
- buttons: RichButtons,
834
- buttonsVisible: 0,
835
- },
836
- },
837
- toolbarButtons: {
838
- moreText: {
839
- buttons: TextButtons,
840
- buttonsVisible: 3,
841
- },
842
- moreParagraph: {
843
- buttons: ParagraphButtons,
844
- buttonsVisible: 5,
845
- },
846
- moreRich: {
847
- buttons: RichButtons,
848
- buttonsVisible: 3,
849
- },
850
- },
851
- }, config.froalaConfig);
852
- };
853
- FsHtmlEditorComponent.prototype._listenLazyInit = function () {
854
- var _this = this;
855
- this.froalaLoaded$
856
- .pipe(operators.filter(function (ready) { return ready; }), operators.switchMap(function () { return _this._initialize$; }), operators.tap(function () {
857
- var selection = window.getSelection();
858
- var options = {};
859
- if (selection.baseNode) {
860
- options.selection = {
861
- node: selection.baseNode.nodeValue,
862
- offset: selection.baseOffset,
863
- };
864
- }
865
- _this.initialize(options);
866
- }), operators.switchMap(function () { return _this._froalaReady$; }), operators.filter(function (data) { return !!data; }), operators.tap(function (_d) {
867
- var config = _d.config, options = _d.options;
868
- _this._setupFroala(config, options);
869
- }))
870
- .subscribe();
871
- };
872
- FsHtmlEditorComponent.prototype._contentChanged = function () {
873
- var editorHTML = this._editor.html.get();
874
- if (this.html !== editorHTML) {
875
- this._change(editorHTML);
876
- }
877
- };
878
- FsHtmlEditorComponent.prototype._setupFroala = function (config, options) {
879
- var _this = this;
880
- this._cdRef.markForCheck();
881
- this.setHtml(this._html);
882
- if (config.disabled) {
883
- this.disable();
884
- }
885
- if (config.froalaConfig.events) {
886
- if (config.froalaConfig.events.initialized) {
887
- config.froalaConfig.events.initialized();
888
- }
889
- }
890
- this._editor.events.on('focus', function () {
891
- _this.classFocused = true;
892
- _this._cdRef.markForCheck();
893
- });
894
- this._editor.events.on('blur', function () {
895
- _this.classFocused = false;
896
- _this._cdRef.markForCheck();
897
- });
898
- rxjs.fromEventPattern(function (handler) {
899
- _this._editor.events.on('contentChanged', handler);
900
- }, function () { })
901
- .pipe(operators.startWith(this._html), operators.map(function () { return _this.editor.html.get(); }), operators.distinctUntilChanged(), operators.skip(1))
902
- .subscribe(function () {
903
- _this._contentChanged();
904
- });
905
- this._editor.events.on('paste.afterCleanup', function (html) {
906
- var div = document.createElement('div');
907
- div.innerHTML = html;
908
- div.querySelectorAll('*')
909
- .forEach(function (el) {
910
- for (var i = 0; i < el.attributes.length; i++) {
911
- var name = el.attributes[0].name;
912
- if (name !== 'href') {
913
- el.removeAttribute(name);
914
- }
915
- }
916
- });
917
- return div.innerHTML;
918
- });
919
- this._editor.events.on('keydown', function () {
920
- _this.onTouched();
921
- });
922
- if (this.config.image && this.config.image.upload) {
923
- this._editor.events.on('image.beforePasteUpload', function (image) {
924
- fetch(image.getAttribute('src'))
925
- .then(function (res) {
926
- res.blob()
927
- .then(function (blob) {
928
- _this._processImageUpload(blob)
929
- .pipe(operators.takeUntil(_this._destroy$))
930
- .subscribe(function (url) {
931
- image.setAttribute('src', url);
932
- image.removeAttribute('data-fr-image-pasted');
933
- _this._contentChanged();
934
- });
935
- });
936
- });
937
- return false;
938
- });
939
- this._editor.events.on('image.beforeUpload', function (blobs) {
940
- _this._processImageUpload(blobs[0])
941
- .pipe(operators.takeUntil(_this._destroy$))
942
- .subscribe(function (url) {
943
- _this.editor.image.insert(url, null, null, _this.editor.image.get());
944
- });
945
- return false;
946
- });
947
- }
948
- if (this.el.querySelector('.fr-second-toolbar')) {
949
- this.el.querySelector('.fr-second-toolbar').remove();
950
- }
951
- var selection = options.selection;
952
- if (selection) {
953
- var node = Array.from(this.el.querySelectorAll('.fr-element *')).find(function (node) {
954
- return selection.node === node.textContent;
955
- });
956
- if (node) {
957
- var range = document.createRange();
958
- var sel = window.getSelection();
959
- range.setStart(this._getTextNode(node), selection.offset);
960
- range.collapse(true);
961
- sel.removeAllRanges();
962
- sel.addRange(range);
963
- }
964
- else if (this.config.autofocus) {
965
- this.focus();
966
- }
967
- }
968
- else if (this.config.autofocus) {
969
- this.focus();
970
- }
971
- };
972
- FsHtmlEditorComponent.prototype._getTextNode = function (node) {
973
- if (node) {
974
- if (node.nodeType === Node.TEXT_NODE) {
975
- return node;
976
- }
977
- if (node.childNodes) {
978
- return this._getTextNode(node.childNodes[0]);
979
- }
980
- }
981
- };
982
- return FsHtmlEditorComponent;
983
- }());
984
- FsHtmlEditorComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsHtmlEditorComponent, deps: [{ token: FS_HTML_EDITOR_CONFIG, optional: true }, { token: i0__namespace.ChangeDetectorRef }, { token: FsFroalaLoaderService }], target: i0__namespace.ɵɵFactoryTarget.Component });
985
- FsHtmlEditorComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: FsHtmlEditorComponent, selector: "fs-html-editor", inputs: { config: "config", hint: "hint" }, host: { properties: { "class.focused": "this.classFocused", "class.disabled": "this.classDisabled" } }, providers: [
986
- {
987
- provide: forms.NG_VALUE_ACCESSOR,
988
- useExisting: i0.forwardRef(function () { return FsHtmlEditorComponent; }),
989
- multi: true
990
- },
991
- {
992
- provide: forms.NG_VALIDATORS,
993
- useExisting: i0.forwardRef(function () { return FsHtmlEditorComponent; }),
994
- multi: true
995
- },
996
- ], viewQueries: [{ propertyName: "elRef", first: true, predicate: ["elRef"], descendants: true }], ngImport: i0__namespace, template: "<fs-label-field>\n <fs-label *ngIf=\"config.label\">{{config.label}}</fs-label>\n <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 \n <fs-label-message>\n <div class=\"fs-form-message\">\n <div class=\"fs-form-hint\">{{hint}}</div>\n </div>\n </fs-label-message>\n</fs-label-field>\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-open .fr-more-toolbar{display:block}:host ::ng-deep .fr-more-toolbar{display:none}: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;display:flex;justify-content:center;padding-left:0!important}: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;transform:translate(-180px)}::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: i2__namespace.FsLabelFieldComponent, selector: "fs-label-field", inputs: ["bottomMargin", "topMargin", "labelMargin"] }, { type: i2__namespace.FsLabelComponent, selector: "fs-label" }, { type: FsHtmlRendererComponent, selector: "fs-html-renderer", inputs: ["html"] }, { type: i2__namespace.FsLabelMessageComponent, selector: "fs-label-message" }], directives: [{ type: i4__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i5__namespace.FsSkeletonContentDirective, selector: "[fsSkeleton]", inputs: ["fsSkeleton", "fsSkeletonPattern"] }], pipes: { "async": i4__namespace.AsyncPipe }, changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush });
997
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsHtmlEditorComponent, decorators: [{
998
- type: i0.Component,
999
- args: [{
1000
- selector: 'fs-html-editor',
1001
- templateUrl: 'html-editor.component.html',
1002
- styleUrls: ['html-editor.component.scss'],
1003
- providers: [
1004
- {
1005
- provide: forms.NG_VALUE_ACCESSOR,
1006
- useExisting: i0.forwardRef(function () { return FsHtmlEditorComponent; }),
1007
- multi: true
1008
- },
1009
- {
1010
- provide: forms.NG_VALIDATORS,
1011
- useExisting: i0.forwardRef(function () { return FsHtmlEditorComponent; }),
1012
- multi: true
1013
- },
1014
- ],
1015
- changeDetection: i0.ChangeDetectionStrategy.OnPush,
1016
- }]
1017
- }], ctorParameters: function () {
1018
- return [{ type: undefined, decorators: [{
1019
- type: i0.Optional
1020
- }, {
1021
- type: i0.Inject,
1022
- args: [FS_HTML_EDITOR_CONFIG]
1023
- }] }, { type: i0__namespace.ChangeDetectorRef }, { type: FsFroalaLoaderService }];
1024
- }, propDecorators: { classFocused: [{
1025
- type: i0.HostBinding,
1026
- args: ['class.focused']
1027
- }], classDisabled: [{
1028
- type: i0.HostBinding,
1029
- args: ['class.disabled']
1030
- }], elRef: [{
1031
- type: i0.ViewChild,
1032
- args: ['elRef']
1033
- }], config: [{
1034
- type: i0.Input
1035
- }], hint: [{
1036
- type: i0.Input
960
+ var FsHtmlRendererComponent = /** @class */ (function () {
961
+ function FsHtmlRendererComponent(sanitized, _cdRef) {
962
+ this.sanitized = sanitized;
963
+ this._cdRef = _cdRef;
964
+ }
965
+ Object.defineProperty(FsHtmlRendererComponent.prototype, "setHtml", {
966
+ set: function (html) {
967
+ this.trustedHtml = this.sanitized.bypassSecurityTrustHtml(html || '');
968
+ this._cdRef.markForCheck();
969
+ },
970
+ enumerable: false,
971
+ configurable: true
972
+ });
973
+ return FsHtmlRendererComponent;
974
+ }());
975
+ FsHtmlRendererComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsHtmlRendererComponent, deps: [{ token: i1__namespace.DomSanitizer }, { token: i0__namespace.ChangeDetectorRef }], target: i0__namespace.ɵɵFactoryTarget.Component });
976
+ FsHtmlRendererComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: FsHtmlRendererComponent, selector: "fs-html-renderer", inputs: { setHtml: ["html", "setHtml"] }, ngImport: i0__namespace, template: "<span class=\"fr-view fs-html-editor-default\" [innerHtml]=\"trustedHtml\"></span>\n", styles: [""], changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush });
977
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsHtmlRendererComponent, decorators: [{
978
+ type: i0.Component,
979
+ args: [{
980
+ selector: 'fs-html-renderer',
981
+ templateUrl: 'html-renderer.component.html',
982
+ styleUrls: ['html-renderer.component.scss'],
983
+ changeDetection: i0.ChangeDetectionStrategy.OnPush,
984
+ }]
985
+ }], ctorParameters: function () { return [{ type: i1__namespace.DomSanitizer }, { type: i0__namespace.ChangeDetectorRef }]; }, propDecorators: { setHtml: [{
986
+ type: i0.Input,
987
+ args: ['html']
1037
988
  }] } });
1038
989
 
1039
- var FsHtmlRendererModule = /** @class */ (function () {
1040
- function FsHtmlRendererModule() {
1041
- }
1042
- return FsHtmlRendererModule;
1043
- }());
1044
- FsHtmlRendererModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsHtmlRendererModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
1045
- FsHtmlRendererModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsHtmlRendererModule, declarations: [FsHtmlRendererComponent], imports: [i4.CommonModule], exports: [FsHtmlRendererComponent] });
1046
- FsHtmlRendererModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsHtmlRendererModule, imports: [[
1047
- i4.CommonModule,
1048
- ]] });
1049
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsHtmlRendererModule, decorators: [{
1050
- type: i0.NgModule,
1051
- args: [{
1052
- imports: [
1053
- i4.CommonModule,
1054
- ],
1055
- exports: [
1056
- FsHtmlRendererComponent,
1057
- ],
1058
- declarations: [
1059
- FsHtmlRendererComponent,
1060
- ],
1061
- }]
990
+ var FsHtmlRendererModule = /** @class */ (function () {
991
+ function FsHtmlRendererModule() {
992
+ }
993
+ return FsHtmlRendererModule;
994
+ }());
995
+ FsHtmlRendererModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsHtmlRendererModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
996
+ FsHtmlRendererModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsHtmlRendererModule, declarations: [FsHtmlRendererComponent], imports: [i3.CommonModule], exports: [FsHtmlRendererComponent] });
997
+ FsHtmlRendererModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsHtmlRendererModule, imports: [[
998
+ i3.CommonModule,
999
+ ]] });
1000
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsHtmlRendererModule, decorators: [{
1001
+ type: i0.NgModule,
1002
+ args: [{
1003
+ imports: [
1004
+ i3.CommonModule,
1005
+ ],
1006
+ exports: [
1007
+ FsHtmlRendererComponent,
1008
+ ],
1009
+ declarations: [
1010
+ FsHtmlRendererComponent,
1011
+ ],
1012
+ }]
1062
1013
  }] });
1063
1014
 
1064
- var FsHtmlEditorModule = /** @class */ (function () {
1065
- function FsHtmlEditorModule() {
1066
- }
1067
- FsHtmlEditorModule.forRoot = function (config) {
1068
- if (config === void 0) { config = {}; }
1069
- return {
1070
- ngModule: FsHtmlEditorModule,
1071
- providers: [
1072
- { provide: FS_HTML_EDITOR_DEFAULT_CONFIG, useValue: config },
1073
- {
1074
- provide: FS_HTML_EDITOR_CONFIG,
1075
- useFactory: FsHtmlEditorConfigFactory,
1076
- deps: [FS_HTML_EDITOR_DEFAULT_CONFIG]
1077
- }
1078
- ]
1079
- };
1080
- };
1081
- return FsHtmlEditorModule;
1082
- }());
1083
- FsHtmlEditorModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsHtmlEditorModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
1084
- FsHtmlEditorModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsHtmlEditorModule, declarations: [FsHtmlEditorComponent], imports: [i4.CommonModule,
1085
- i5.FsSkeletonModule,
1086
- i2.FsLabelModule,
1087
- FsHtmlRendererModule], exports: [FsHtmlEditorComponent] });
1088
- FsHtmlEditorModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsHtmlEditorModule, imports: [[
1089
- i4.CommonModule,
1090
- i5.FsSkeletonModule,
1091
- i2.FsLabelModule,
1092
- FsHtmlRendererModule,
1093
- ]] });
1094
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsHtmlEditorModule, decorators: [{
1095
- type: i0.NgModule,
1096
- args: [{
1097
- imports: [
1098
- i4.CommonModule,
1099
- i5.FsSkeletonModule,
1100
- i2.FsLabelModule,
1101
- FsHtmlRendererModule,
1102
- ],
1103
- exports: [
1104
- FsHtmlEditorComponent,
1105
- ],
1106
- declarations: [
1107
- FsHtmlEditorComponent,
1108
- ],
1109
- }]
1110
- }] });
1111
- function FsHtmlEditorConfigFactory(config) {
1112
- return Object.assign({ froalaPlugins: [
1113
- "align" /* Align */,
1114
- "colors" /* Colors */,
1115
- "image" /* Image */,
1116
- "link" /* Link */,
1117
- "lists" /* Lists */,
1118
- "paragraph_format" /* ParagraphFormat */,
1119
- "quote" /* Quote */,
1120
- "table" /* Table */,
1121
- "url" /* Url */,
1122
- "video" /* Video */,
1123
- "draggable" /* Draggable */,
1124
- "font_size" /* FontSize */,
1125
- "line_height" /* LineHeight */,
1126
- ] }, config);
1015
+ var FsHtmlEditorModule = /** @class */ (function () {
1016
+ function FsHtmlEditorModule() {
1017
+ }
1018
+ FsHtmlEditorModule.forRoot = function (config) {
1019
+ if (config === void 0) { config = {}; }
1020
+ return {
1021
+ ngModule: FsHtmlEditorModule,
1022
+ providers: [
1023
+ { provide: FS_HTML_EDITOR_DEFAULT_CONFIG, useValue: config },
1024
+ {
1025
+ provide: FS_HTML_EDITOR_CONFIG,
1026
+ useFactory: FsHtmlEditorConfigFactory,
1027
+ deps: [FS_HTML_EDITOR_DEFAULT_CONFIG]
1028
+ }
1029
+ ]
1030
+ };
1031
+ };
1032
+ return FsHtmlEditorModule;
1033
+ }());
1034
+ FsHtmlEditorModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsHtmlEditorModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
1035
+ FsHtmlEditorModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsHtmlEditorModule, declarations: [FsHtmlEditorComponent], imports: [i3.CommonModule,
1036
+ i4.FsSkeletonModule,
1037
+ i2.FsLabelModule,
1038
+ FsHtmlRendererModule], exports: [FsHtmlEditorComponent] });
1039
+ FsHtmlEditorModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsHtmlEditorModule, imports: [[
1040
+ i3.CommonModule,
1041
+ i4.FsSkeletonModule,
1042
+ i2.FsLabelModule,
1043
+ FsHtmlRendererModule,
1044
+ ]] });
1045
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsHtmlEditorModule, decorators: [{
1046
+ type: i0.NgModule,
1047
+ args: [{
1048
+ imports: [
1049
+ i3.CommonModule,
1050
+ i4.FsSkeletonModule,
1051
+ i2.FsLabelModule,
1052
+ FsHtmlRendererModule,
1053
+ ],
1054
+ exports: [
1055
+ FsHtmlEditorComponent,
1056
+ ],
1057
+ declarations: [
1058
+ FsHtmlEditorComponent,
1059
+ ],
1060
+ }]
1061
+ }] });
1062
+ function FsHtmlEditorConfigFactory(config) {
1063
+ return Object.assign({ froalaPlugins: [
1064
+ "align" /* Align */,
1065
+ "colors" /* Colors */,
1066
+ "image" /* Image */,
1067
+ "link" /* Link */,
1068
+ "lists" /* Lists */,
1069
+ "paragraph_format" /* ParagraphFormat */,
1070
+ "quote" /* Quote */,
1071
+ "table" /* Table */,
1072
+ "url" /* Url */,
1073
+ "video" /* Video */,
1074
+ "draggable" /* Draggable */,
1075
+ "font_size" /* FontSize */,
1076
+ "line_height" /* LineHeight */,
1077
+ ] }, config);
1127
1078
  }
1128
1079
 
1129
- var Plugin = /** @class */ (function () {
1130
- function Plugin() {
1131
- }
1132
- Plugin.prototype.initialize = function () { };
1133
- Plugin.prototype.destroy = function () { };
1134
- return Plugin;
1080
+ var Plugin = /** @class */ (function () {
1081
+ function Plugin() {
1082
+ }
1083
+ Plugin.prototype.initialize = function () { };
1084
+ Plugin.prototype.destroy = function () { };
1085
+ return Plugin;
1135
1086
  }());
1136
1087
 
1137
- var MentionPlugin = /** @class */ (function (_super) {
1138
- __extends(MentionPlugin, _super);
1139
- function MentionPlugin(config) {
1140
- var _this = _super.call(this) || this;
1141
- _this.config = config;
1142
- _this._guid = common.guid();
1143
- _this.selected = function (event) {
1144
- if (_this.config.selected) {
1145
- if (MentionPlugin._currentGuid === _this._guid) {
1146
- _this.config.selected(event.detail.item.original);
1147
- }
1148
- }
1149
- };
1150
- _this.config = Object.assign(Object.assign({}, config), { buttons: [
1151
- {
1152
- name: config.name,
1153
- tooltip: config.tooltip,
1154
- svgPath: config.iconPath,
1155
- click: function (editor) {
1156
- _this._closeAll();
1157
- _this._tribute.showMenuForCollection(editor.el);
1158
- }
1159
- }
1160
- ] });
1161
- _this._tribute = new Tribute__default["default"]({
1162
- values: lodashEs.debounce(_this._loadValues.bind(_this), 200),
1163
- searchOpts: {
1164
- pre: '',
1165
- post: '',
1166
- skip: true
1167
- },
1168
- containerClass: "fs-html-editor-mention-container " + (_this.config.containerClass || ''),
1169
- itemClass: "fs-html-editor-mention-menu-item " + (_this.config.menuItemClass || ''),
1170
- trigger: _this.config.trigger,
1171
- allowSpaces: true,
1172
- menuItemTemplate: function (item) {
1173
- return _this.config.menuItemTemplate(item.original);
1174
- },
1175
- selectTemplate: function (item) {
1176
- var template = _this.config.selectedTemplate(item.original);
1177
- var p = document.createElement('p');
1178
- p.innerHTML = template;
1179
- var node = p.firstElementChild;
1180
- if (!node) {
1181
- node = document.createElement('span');
1182
- node.innerHTML = template;
1183
- }
1184
- node.setAttribute('contenteditable', 'false');
1185
- node.classList.add('fr-deletable');
1186
- return node.outerHTML;
1187
- },
1188
- });
1189
- MentionPlugin._tributes.push(_this._tribute);
1190
- return _this;
1191
- }
1192
- MentionPlugin.prototype.initialize = function () {
1193
- var _this = this;
1194
- this._tribute.attach(this.editor.el);
1195
- this.editor.events.on('keydown', function (e) {
1196
- if (e.key === 'Enter' && _this._tribute.isActive) {
1197
- return false;
1198
- }
1199
- }, true);
1200
- this.editor.el.addEventListener("tribute-replaced", this.selected);
1201
- };
1202
- MentionPlugin.prototype.destroy = function () {
1203
- this.editor.el.removeEventListener("tribute-replaced", this.selected);
1204
- };
1205
- MentionPlugin.prototype._closeAll = function () {
1206
- MentionPlugin._tributes.forEach(function (tribute) {
1207
- if (tribute.menu) {
1208
- tribute.hideMenu();
1209
- }
1210
- });
1211
- };
1212
- MentionPlugin.prototype._loadValues = function (keyword, cb) {
1213
- MentionPlugin._currentGuid = this._guid;
1214
- return this.config.fetch(keyword)
1215
- .subscribe(function (data) {
1216
- cb(data);
1217
- });
1218
- };
1219
- return MentionPlugin;
1220
- }(Plugin));
1221
- MentionPlugin._currentGuid = null;
1088
+ var MentionPlugin = /** @class */ (function (_super) {
1089
+ __extends(MentionPlugin, _super);
1090
+ function MentionPlugin(config) {
1091
+ var _this = _super.call(this) || this;
1092
+ _this.config = config;
1093
+ _this._guid = common.guid();
1094
+ _this.selected = function (event) {
1095
+ if (_this.config.selected) {
1096
+ if (MentionPlugin._currentGuid === _this._guid) {
1097
+ _this.config.selected(event.detail.item.original);
1098
+ }
1099
+ }
1100
+ };
1101
+ _this.config = Object.assign(Object.assign({}, config), { buttons: [
1102
+ {
1103
+ name: config.name,
1104
+ tooltip: config.tooltip,
1105
+ svgPath: config.iconPath,
1106
+ click: function (editor) {
1107
+ _this._closeAll();
1108
+ _this._tribute.showMenuForCollection(editor.el);
1109
+ }
1110
+ }
1111
+ ] });
1112
+ _this._tribute = new Tribute__default["default"]({
1113
+ values: lodashEs.debounce(_this._loadValues.bind(_this), 200),
1114
+ searchOpts: {
1115
+ pre: '',
1116
+ post: '',
1117
+ skip: true
1118
+ },
1119
+ containerClass: "fs-html-editor-mention-container " + (_this.config.containerClass || ''),
1120
+ itemClass: "fs-html-editor-mention-menu-item " + (_this.config.menuItemClass || ''),
1121
+ trigger: _this.config.trigger,
1122
+ allowSpaces: true,
1123
+ menuItemTemplate: function (item) {
1124
+ return _this.config.menuItemTemplate(item.original);
1125
+ },
1126
+ selectTemplate: function (item) {
1127
+ var template = _this.config.selectedTemplate(item.original);
1128
+ var p = document.createElement('p');
1129
+ p.innerHTML = template;
1130
+ var node = p.firstElementChild;
1131
+ if (!node) {
1132
+ node = document.createElement('span');
1133
+ node.innerHTML = template;
1134
+ }
1135
+ node.setAttribute('contenteditable', 'false');
1136
+ node.classList.add('fr-deletable');
1137
+ return node.outerHTML;
1138
+ },
1139
+ });
1140
+ MentionPlugin._tributes.push(_this._tribute);
1141
+ return _this;
1142
+ }
1143
+ MentionPlugin.prototype.initialize = function () {
1144
+ var _this = this;
1145
+ this._tribute.attach(this.editor.el);
1146
+ this.editor.events.on('keydown', function (e) {
1147
+ if (e.key === 'Enter' && _this._tribute.isActive) {
1148
+ return false;
1149
+ }
1150
+ }, true);
1151
+ this.editor.el.addEventListener("tribute-replaced", this.selected);
1152
+ };
1153
+ MentionPlugin.prototype.destroy = function () {
1154
+ this.editor.el.removeEventListener("tribute-replaced", this.selected);
1155
+ };
1156
+ MentionPlugin.prototype._closeAll = function () {
1157
+ MentionPlugin._tributes.forEach(function (tribute) {
1158
+ if (tribute.menu) {
1159
+ tribute.hideMenu();
1160
+ }
1161
+ });
1162
+ };
1163
+ MentionPlugin.prototype._loadValues = function (keyword, cb) {
1164
+ MentionPlugin._currentGuid = this._guid;
1165
+ return this.config.fetch(keyword)
1166
+ .subscribe(function (data) {
1167
+ cb(data);
1168
+ });
1169
+ };
1170
+ return MentionPlugin;
1171
+ }(Plugin));
1172
+ MentionPlugin._currentGuid = null;
1222
1173
  MentionPlugin._tributes = [];
1223
1174
 
1224
- var ChecklistPlugin = /** @class */ (function (_super) {
1225
- __extends(ChecklistPlugin, _super);
1226
- function ChecklistPlugin(config) {
1227
- if (config === void 0) { config = { name: 'checklist' }; }
1228
- var _this = _super.call(this) || this;
1229
- _this.config = config;
1230
- _this.config = Object.assign(Object.assign({}, config), { name: 'checklist', buttons: [
1231
- {
1232
- name: 'checklist',
1233
- svgPath: 'M8.4,10.3l-1.2,1.2l4,4L20,6.7l-1.2-1.2l-7.6,7.6L8.4,10.3z M18.2,18.2H5.8V5.8h8.9V4H5.8C4.8,4,4,4.8,4,5.8v12.4c0,1,0.8,1.8,1.8,1.8h12.4c1,0,1.8-0.8,1.8-1.8v-7.1h-1.8V18.2z',
1234
- click: function (editor) {
1235
- editor.html.insert('<ul class="checklist"><li></li></ul>');
1236
- }
1237
- }
1238
- ] });
1239
- return _this;
1240
- }
1241
- ChecklistPlugin.prototype.initialize = function () {
1242
- this.editor.events.on('click', function (e) {
1243
- var li = e.target;
1244
- if (li.nodeName === 'LI' && e.offsetX < 0) {
1245
- var items = __spreadArray([li], __read(li.querySelectorAll('li')));
1246
- if (li.classList.contains('checked')) {
1247
- items.forEach(function (item) {
1248
- item.classList.remove('checked');
1249
- });
1250
- }
1251
- else {
1252
- items.forEach(function (item) {
1253
- item.classList.add('checked');
1254
- });
1255
- }
1256
- }
1257
- }, false);
1258
- };
1259
- return ChecklistPlugin;
1175
+ var ChecklistPlugin = /** @class */ (function (_super) {
1176
+ __extends(ChecklistPlugin, _super);
1177
+ function ChecklistPlugin(config) {
1178
+ if (config === void 0) { config = { name: 'checklist' }; }
1179
+ var _this = _super.call(this) || this;
1180
+ _this.config = config;
1181
+ _this.config = Object.assign(Object.assign({}, config), { name: 'checklist', buttons: [
1182
+ {
1183
+ name: 'checklist',
1184
+ svgPath: 'M8.4,10.3l-1.2,1.2l4,4L20,6.7l-1.2-1.2l-7.6,7.6L8.4,10.3z M18.2,18.2H5.8V5.8h8.9V4H5.8C4.8,4,4,4.8,4,5.8v12.4c0,1,0.8,1.8,1.8,1.8h12.4c1,0,1.8-0.8,1.8-1.8v-7.1h-1.8V18.2z',
1185
+ click: function (editor) {
1186
+ editor.html.insert('<ul class="checklist"><li></li></ul>');
1187
+ }
1188
+ }
1189
+ ] });
1190
+ return _this;
1191
+ }
1192
+ ChecklistPlugin.prototype.initialize = function () {
1193
+ this.editor.events.on('click', function (e) {
1194
+ var li = e.target;
1195
+ if (li.nodeName === 'LI' && e.offsetX < 0) {
1196
+ var items = __spreadArray([li], __read(li.querySelectorAll('li')));
1197
+ if (li.classList.contains('checked')) {
1198
+ items.forEach(function (item) {
1199
+ item.classList.remove('checked');
1200
+ });
1201
+ }
1202
+ else {
1203
+ items.forEach(function (item) {
1204
+ item.classList.add('checked');
1205
+ });
1206
+ }
1207
+ }
1208
+ }, false);
1209
+ };
1210
+ return ChecklistPlugin;
1260
1211
  }(Plugin));
1261
1212
 
1262
- var CodePlugin = /** @class */ (function (_super) {
1263
- __extends(CodePlugin, _super);
1264
- function CodePlugin(config) {
1265
- if (config === void 0) { config = { name: 'code' }; }
1266
- var _this = _super.call(this) || this;
1267
- _this.config = config;
1268
- _this.config = Object.assign(Object.assign({}, config), { name: 'code', buttons: [
1269
- {
1270
- name: 'code',
1271
- svgPath: 'M8.9,7.3L4.2,12l4.7,4.7l1.1-1.1L6.4,12L10,8.4L8.9,7.3z M15.1,7.3L14,8.4l3.6,3.6L14,15.6l1.1,1.1l4.7-4.7L15.1,7.3z',
1272
- click: function (editor) {
1273
- var node = editor.selection.get();
1274
- var codeEl = _this._getCodeEl(node.baseNode);
1275
- if (codeEl) {
1276
- codeEl.classList.remove('code');
1277
- }
1278
- else {
1279
- editor.html.insert('<p class="code">' + editor.selection.get().toString().replace(/\n{1,}/g, '<br>') + '</p>');
1280
- }
1281
- }
1282
- }
1283
- ] });
1284
- return _this;
1285
- }
1286
- CodePlugin.prototype.initialize = function () {
1287
- var _this = this;
1288
- this.editor.events.on('keydown', function (e) {
1289
- if (e.keyCode === 13) {
1290
- var selection = _this.editor.selection.get();
1291
- if (selection && _this._getCodeEl(selection.baseNode)) {
1292
- e.preventDefault();
1293
- e.stopPropagation();
1294
- e.stopImmediatePropagation();
1295
- var br = '<br>';
1296
- var base = selection.baseNode;
1297
- if (base.nodeName === '#text' && selection.baseOffset === base.length) {
1298
- if (!(base.nextSibling && base.nextSibling.nodeName === 'BR')) {
1299
- br += '<br>';
1300
- }
1301
- }
1302
- else {
1303
- var el = Array.from(base.childNodes).splice(selection.baseOffset - 1, 1).pop();
1304
- if (el && el.nodeName !== 'BR') {
1305
- br += '<br>';
1306
- }
1307
- }
1308
- _this.editor.html.insert(br);
1309
- return false;
1310
- }
1311
- }
1312
- }, true);
1313
- };
1314
- CodePlugin.prototype.destroy = function () { };
1315
- CodePlugin.prototype._getCodeEl = function (el) {
1316
- if (el) {
1317
- if (el.classList && el.classList.contains('code')) {
1318
- return el;
1319
- }
1320
- if (el.parentElement) {
1321
- return this._getCodeEl(el.parentElement);
1322
- }
1323
- }
1324
- return null;
1325
- };
1326
- return CodePlugin;
1213
+ var CodePlugin = /** @class */ (function (_super) {
1214
+ __extends(CodePlugin, _super);
1215
+ function CodePlugin(config) {
1216
+ if (config === void 0) { config = { name: 'code' }; }
1217
+ var _this = _super.call(this) || this;
1218
+ _this.config = config;
1219
+ _this.config = Object.assign(Object.assign({}, config), { name: 'code', buttons: [
1220
+ {
1221
+ name: 'code',
1222
+ svgPath: 'M8.9,7.3L4.2,12l4.7,4.7l1.1-1.1L6.4,12L10,8.4L8.9,7.3z M15.1,7.3L14,8.4l3.6,3.6L14,15.6l1.1,1.1l4.7-4.7L15.1,7.3z',
1223
+ click: function (editor) {
1224
+ var node = editor.selection.get();
1225
+ var codeEl = _this._getCodeEl(node.baseNode);
1226
+ if (codeEl) {
1227
+ codeEl.classList.remove('code');
1228
+ }
1229
+ else {
1230
+ editor.html.insert('<p class="code">' + editor.selection.get().toString().replace(/\n{1,}/g, '<br>') + '</p>');
1231
+ }
1232
+ }
1233
+ }
1234
+ ] });
1235
+ return _this;
1236
+ }
1237
+ CodePlugin.prototype.initialize = function () {
1238
+ var _this = this;
1239
+ this.editor.events.on('keydown', function (e) {
1240
+ if (e.keyCode === 13) {
1241
+ var selection = _this.editor.selection.get();
1242
+ if (selection && _this._getCodeEl(selection.baseNode)) {
1243
+ e.preventDefault();
1244
+ e.stopPropagation();
1245
+ e.stopImmediatePropagation();
1246
+ var br = '<br>';
1247
+ var base = selection.baseNode;
1248
+ if (base.nodeName === '#text' && selection.baseOffset === base.length) {
1249
+ if (!(base.nextSibling && base.nextSibling.nodeName === 'BR')) {
1250
+ br += '<br>';
1251
+ }
1252
+ }
1253
+ else {
1254
+ var el = Array.from(base.childNodes).splice(selection.baseOffset - 1, 1).pop();
1255
+ if (el && el.nodeName !== 'BR') {
1256
+ br += '<br>';
1257
+ }
1258
+ }
1259
+ _this.editor.html.insert(br);
1260
+ return false;
1261
+ }
1262
+ }
1263
+ }, true);
1264
+ };
1265
+ CodePlugin.prototype.destroy = function () { };
1266
+ CodePlugin.prototype._getCodeEl = function (el) {
1267
+ if (el) {
1268
+ if (el.classList && el.classList.contains('code')) {
1269
+ return el;
1270
+ }
1271
+ if (el.parentElement) {
1272
+ return this._getCodeEl(el.parentElement);
1273
+ }
1274
+ }
1275
+ return null;
1276
+ };
1277
+ return CodePlugin;
1327
1278
  }(Plugin));
1328
1279
 
1329
- var ScreenRecordPlugin = /** @class */ (function (_super) {
1330
- __extends(ScreenRecordPlugin, _super);
1331
- function ScreenRecordPlugin(config) {
1332
- if (config === void 0) { config = {}; }
1333
- var _this = _super.call(this) || this;
1334
- _this.config = config;
1335
- _this.config = Object.assign(Object.assign({}, config), { name: config.name || 'screenRecord', buttons: [
1336
- {
1337
- name: 'screenRecord',
1338
- svgPath: "M14.7,7.7v6.1H7.1V7.7H14.7 M16.3,9.6V6.9c0-0.4-0.3-0.8-0.8-0.8H6.4c-0.4,0-0.8,0.3-0.8,0.8v7.6c0,0.4,0.3,0.8,0.8,0.8h9.1c0.4,0,0.8-0.3,0.8-0.8v-2.7l1.7,1.7c0.3,0.3,0.8,0.3,1.1,0c0.1-0.1,0.2-0.3,0.2-0.5V8.4c0-0.4-0.3-0.8-0.8-0.8\n\tc-0.2,0-0.4,0.1-0.5,0.2L16.3,9.6z M21.5,1.6H2.9c-0.7,0-1.3,0.7-1.3,1.6v14.6c0,0.9,0.6,1.6,1.3,1.6h7.6v1.1l-5,1c-0.2,0-0.4,0.3-0.4,0.6c0,0.3,0.2,0.4,0.4,0.4c0,0,0,0,0.1,0l5.3-1h2.6l5.3,1c0,0,0,0,0.1,0c0.2,0,0.4-0.2,0.4-0.4\n c0-0.3-0.1-0.6-0.4-0.6l-5-1v-1.1h7.6c0.7,0,1.3-0.7,1.3-1.6V3.2C22.9,2.3,22.3,1.6,21.5,1.6z M21.1,17.3H3.3V3.7h17.8L21.1,17.3L21.1,17.3z",
1339
- tooltip: 'Screen Record',
1340
- click: function (editor) {
1341
- navigator.mediaDevices.getDisplayMedia({ video: true })
1342
- .then(function (stream) {
1343
- var chunks = [];
1344
- var options = { mimeType: 'video/webm; codecs=vp9' };
1345
- var mediaRecorder = new MediaRecorder(stream, options);
1346
- stream.addEventListener('inactive', function (e) {
1347
- mediaRecorder.stop();
1348
- mediaRecorder = null;
1349
- stream.getTracks().forEach(function (track) { return track.stop(); });
1350
- stream = null;
1351
- var blob = new Blob(chunks, { type: 'video/webm' });
1352
- config.upload(blob)
1353
- .subscribe(function (url) {
1354
- editor.html.insert("<span class=\"fr-screen-record fr-deletable fr-draggable\"><video controls style=\"max-width:" + config.maxWidth + "\"><source src=\"" + url + "\" type=\"video/webm\"></video></span>");
1355
- });
1356
- });
1357
- mediaRecorder.addEventListener('dataavailable', function (event) {
1358
- if (event.data && event.data.size > 0) {
1359
- chunks.push(event.data);
1360
- }
1361
- });
1362
- mediaRecorder.start(10);
1363
- })
1364
- .catch(function (e) { });
1365
- }
1366
- }
1367
- ] });
1368
- return _this;
1369
- }
1370
- ScreenRecordPlugin.prototype.initialize = function () {
1371
- return __awaiter(this, void 0, void 0, function () {
1372
- var FroalaEditor;
1373
- var _this = this;
1374
- return __generator(this, function (_a) {
1375
- FroalaEditor = window.FroalaEditor;
1376
- this.editor.events.on('mouseup', function (e) {
1377
- var el = _this._getEl(e.target);
1378
- if (el) {
1379
- _this.editor.popups.hideAll();
1380
- _this._activeEl = el;
1381
- _this._showPopup(el);
1382
- }
1383
- });
1384
- FroalaEditor.POPUP_TEMPLATES["screenRecordPlugin.popup"] = '[_BUTTONS_]';
1385
- FroalaEditor.DefineIcon('popupClose', { NAME: 'trash', SVG_KEY: 'remove' });
1386
- FroalaEditor.RegisterCommand('popupClose', {
1387
- title: 'Remove',
1388
- undo: false,
1389
- focus: false,
1390
- callback: function () {
1391
- if (_this._activeEl) {
1392
- _this._activeEl.remove();
1393
- }
1394
- }
1395
- });
1396
- return [2 /*return*/];
1397
- });
1398
- });
1399
- };
1400
- ScreenRecordPlugin.prototype._createPopup = function () {
1401
- var template = {
1402
- buttons: "<div class=\"fr-buttons\">" + this.editor.button.buildList(['popupClose']) + "</div>",
1403
- };
1404
- return this.editor.popups.create('screenRecordPlugin.popup', template);
1405
- };
1406
- ScreenRecordPlugin.prototype._showPopup = function (el) {
1407
- var $popup = this.editor.popups.get('screenRecordPlugin.popup');
1408
- if (!$popup) {
1409
- $popup = this._createPopup();
1410
- }
1411
- this.editor.popups.setContainer('screenRecordPlugin.popup', this.editor.$(el));
1412
- var left = el.offsetLeft + el.offsetWidth / 2;
1413
- this.editor.popups.show('screenRecordPlugin.popup', left, null);
1414
- };
1415
- ScreenRecordPlugin.prototype._getEl = function (el) {
1416
- if (el && el.classList) {
1417
- if (el.classList.contains('fr-screen-record'))
1418
- return el;
1419
- return this._getEl(el.parentNode);
1420
- }
1421
- };
1422
- return ScreenRecordPlugin;
1280
+ var ScreenRecordPlugin = /** @class */ (function (_super) {
1281
+ __extends(ScreenRecordPlugin, _super);
1282
+ function ScreenRecordPlugin(config) {
1283
+ if (config === void 0) { config = {}; }
1284
+ var _this = _super.call(this) || this;
1285
+ _this.config = config;
1286
+ _this.config = Object.assign(Object.assign({}, config), { name: config.name || 'screenRecord', buttons: [
1287
+ {
1288
+ name: 'screenRecord',
1289
+ svgPath: "M14.7,7.7v6.1H7.1V7.7H14.7 M16.3,9.6V6.9c0-0.4-0.3-0.8-0.8-0.8H6.4c-0.4,0-0.8,0.3-0.8,0.8v7.6c0,0.4,0.3,0.8,0.8,0.8h9.1c0.4,0,0.8-0.3,0.8-0.8v-2.7l1.7,1.7c0.3,0.3,0.8,0.3,1.1,0c0.1-0.1,0.2-0.3,0.2-0.5V8.4c0-0.4-0.3-0.8-0.8-0.8\n\tc-0.2,0-0.4,0.1-0.5,0.2L16.3,9.6z M21.5,1.6H2.9c-0.7,0-1.3,0.7-1.3,1.6v14.6c0,0.9,0.6,1.6,1.3,1.6h7.6v1.1l-5,1c-0.2,0-0.4,0.3-0.4,0.6c0,0.3,0.2,0.4,0.4,0.4c0,0,0,0,0.1,0l5.3-1h2.6l5.3,1c0,0,0,0,0.1,0c0.2,0,0.4-0.2,0.4-0.4\n c0-0.3-0.1-0.6-0.4-0.6l-5-1v-1.1h7.6c0.7,0,1.3-0.7,1.3-1.6V3.2C22.9,2.3,22.3,1.6,21.5,1.6z M21.1,17.3H3.3V3.7h17.8L21.1,17.3L21.1,17.3z",
1290
+ tooltip: 'Screen Record',
1291
+ click: function (editor) {
1292
+ navigator.mediaDevices.getDisplayMedia({ video: true })
1293
+ .then(function (stream) {
1294
+ var chunks = [];
1295
+ var options = { mimeType: 'video/webm; codecs=vp9' };
1296
+ var mediaRecorder = new MediaRecorder(stream, options);
1297
+ stream.addEventListener('inactive', function (e) {
1298
+ mediaRecorder.stop();
1299
+ mediaRecorder = null;
1300
+ stream.getTracks().forEach(function (track) { return track.stop(); });
1301
+ stream = null;
1302
+ var blob = new Blob(chunks, { type: 'video/webm' });
1303
+ config.upload(blob)
1304
+ .subscribe(function (url) {
1305
+ editor.html.insert("<span class=\"fr-screen-record fr-deletable fr-draggable\"><video controls style=\"max-width:" + config.maxWidth + "\"><source src=\"" + url + "\" type=\"video/webm\"></video></span>");
1306
+ });
1307
+ });
1308
+ mediaRecorder.addEventListener('dataavailable', function (event) {
1309
+ if (event.data && event.data.size > 0) {
1310
+ chunks.push(event.data);
1311
+ }
1312
+ });
1313
+ mediaRecorder.start(10);
1314
+ })
1315
+ .catch(function (e) { });
1316
+ }
1317
+ }
1318
+ ] });
1319
+ return _this;
1320
+ }
1321
+ ScreenRecordPlugin.prototype.initialize = function () {
1322
+ return __awaiter(this, void 0, void 0, function () {
1323
+ var FroalaEditor;
1324
+ var _this = this;
1325
+ return __generator(this, function (_a) {
1326
+ FroalaEditor = window.FroalaEditor;
1327
+ this.editor.events.on('mouseup', function (e) {
1328
+ var el = _this._getEl(e.target);
1329
+ if (el) {
1330
+ _this.editor.popups.hideAll();
1331
+ _this._activeEl = el;
1332
+ _this._showPopup(el);
1333
+ }
1334
+ });
1335
+ FroalaEditor.POPUP_TEMPLATES["screenRecordPlugin.popup"] = '[_BUTTONS_]';
1336
+ FroalaEditor.DefineIcon('popupClose', { NAME: 'trash', SVG_KEY: 'remove' });
1337
+ FroalaEditor.RegisterCommand('popupClose', {
1338
+ title: 'Remove',
1339
+ undo: false,
1340
+ focus: false,
1341
+ callback: function () {
1342
+ if (_this._activeEl) {
1343
+ _this._activeEl.remove();
1344
+ }
1345
+ }
1346
+ });
1347
+ return [2 /*return*/];
1348
+ });
1349
+ });
1350
+ };
1351
+ ScreenRecordPlugin.prototype._createPopup = function () {
1352
+ var template = {
1353
+ buttons: "<div class=\"fr-buttons\">" + this.editor.button.buildList(['popupClose']) + "</div>",
1354
+ };
1355
+ return this.editor.popups.create('screenRecordPlugin.popup', template);
1356
+ };
1357
+ ScreenRecordPlugin.prototype._showPopup = function (el) {
1358
+ var $popup = this.editor.popups.get('screenRecordPlugin.popup');
1359
+ if (!$popup) {
1360
+ $popup = this._createPopup();
1361
+ }
1362
+ this.editor.popups.setContainer('screenRecordPlugin.popup', this.editor.$(el));
1363
+ var left = el.offsetLeft + el.offsetWidth / 2;
1364
+ this.editor.popups.show('screenRecordPlugin.popup', left, null);
1365
+ };
1366
+ ScreenRecordPlugin.prototype._getEl = function (el) {
1367
+ if (el && el.classList) {
1368
+ if (el.classList.contains('fr-screen-record'))
1369
+ return el;
1370
+ return this._getEl(el.parentNode);
1371
+ }
1372
+ };
1373
+ return ScreenRecordPlugin;
1423
1374
  }(Plugin));
1424
1375
 
1425
- var RealtimePlugin = /** @class */ (function (_super) {
1426
- __extends(RealtimePlugin, _super);
1427
- function RealtimePlugin(config) {
1428
- if (config === void 0) { config = { name: 'realtime' }; }
1429
- var _this = _super.call(this) || this;
1430
- _this.config = config;
1431
- _this.config = Object.assign(Object.assign({}, config), { name: 'realtime' });
1432
- return _this;
1433
- }
1434
- RealtimePlugin.prototype.initialize = function () {
1435
- this.editor.events.on('click', function (e) {
1436
- }, false);
1437
- };
1438
- return RealtimePlugin;
1376
+ var RealtimePlugin = /** @class */ (function (_super) {
1377
+ __extends(RealtimePlugin, _super);
1378
+ function RealtimePlugin(config) {
1379
+ if (config === void 0) { config = { name: 'realtime' }; }
1380
+ var _this = _super.call(this) || this;
1381
+ _this.config = config;
1382
+ _this.config = Object.assign(Object.assign({}, config), { name: 'realtime' });
1383
+ return _this;
1384
+ }
1385
+ RealtimePlugin.prototype.initialize = function () {
1386
+ this.editor.events.on('click', function (e) {
1387
+ }, false);
1388
+ };
1389
+ return RealtimePlugin;
1439
1390
  }(Plugin));
1440
1391
 
1441
- /**
1442
- * Generated bundle index. Do not edit.
1392
+ /**
1393
+ * Generated bundle index. Do not edit.
1443
1394
  */
1444
1395
 
1445
1396
  exports.ChecklistPlugin = ChecklistPlugin;