@firestitch/html-editor 12.5.4 → 12.5.5

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 (51) 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 +59 -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 +1382 -1382
  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 +517 -517
  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 +88 -88
  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 +985 -985
  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
@@ -31,1420 +31,1420 @@
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
- this._sourceLoader.registerResources({
423
- froala: [
424
- '/assets/js/froala/froala_editor.min.js',
425
- '/assets/css/froala_editor.pkgd.min.css',
426
- ],
427
- froala_align: '/assets/js/froala/plugins/align.min.js',
428
- froala_colors: '/assets/js/froala/plugins/colors.min.js',
429
- froala_image: '/assets/js/froala/plugins/image.min.js',
430
- froala_link: '/assets/js/froala/plugins/link.min.js',
431
- froala_lists: '/assets/js/froala/plugins/lists.min.js',
432
- froala_paragraph_format: '/assets/js/froala/plugins/paragraph_format.min.js',
433
- froala_table: '/assets/js/froala/plugins/table.min.js',
434
- froala_url: '/assets/js/froala/plugins/url.min.js',
435
- froala_video: '/assets/js/froala/plugins/video.min.js',
436
- froala_quote: '/assets/js/froala/plugins/quote.min.js',
437
- froala_draggable: '/assets/js/froala/plugins/draggable.min.js',
438
- froala_font_size: '/assets/js/froala/plugins/font_size.min.js',
439
- froala_quick_insert: '/assets/js/froala/plugins/quick_insert.min.js',
440
- froala_line_height: '/assets/js/froala/plugins/line_height.min.js'
441
- });
442
- this._sourceLoader.loadResource('froala')
443
- .pipe(operators.tap(function () {
444
- _this._FroalaEditor = window.FroalaEditor;
445
- _this._froalaDone();
446
- }), operators.concatMap(function () {
447
- return _this._loadPlugins();
448
- }), operators.tap(function () {
449
- _this._froalaPluginsDone();
450
- }))
451
- .subscribe();
452
- };
453
- FsFroalaLoaderService.prototype._loadPlugins = function () {
454
- var resources = this._defaultConfig
455
- .froalaPlugins
456
- .map(function (pluginName) { return "froala_" + pluginName; });
457
- return this._sourceLoader.loadResources(resources);
458
- };
459
- FsFroalaLoaderService.prototype._froalaDone = function () {
460
- this._froalaLoaded.next(true);
461
- };
462
- FsFroalaLoaderService.prototype._froalaPluginsDone = function () {
463
- this._froalaPluginsLoaded.next(true);
464
- };
465
- return FsFroalaLoaderService;
466
- }());
467
- 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 });
468
- FsFroalaLoaderService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsFroalaLoaderService, providedIn: 'root' });
469
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsFroalaLoaderService, decorators: [{
470
- type: i0.Injectable,
471
- args: [{
472
- providedIn: 'root',
473
- }]
474
- }], ctorParameters: function () {
475
- return [{ type: undefined, decorators: [{
476
- type: i0.Optional
477
- }, {
478
- type: i0.Inject,
479
- args: [FS_HTML_EDITOR_CONFIG]
480
- }] }, { type: Document, decorators: [{
481
- type: i0.Inject,
482
- args: [i4.DOCUMENT]
483
- }] }];
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
+ this._sourceLoader.registerResources({
423
+ froala: [
424
+ '/assets/js/froala/froala_editor.min.js',
425
+ '/assets/css/froala_editor.pkgd.min.css',
426
+ ],
427
+ froala_align: '/assets/js/froala/plugins/align.min.js',
428
+ froala_colors: '/assets/js/froala/plugins/colors.min.js',
429
+ froala_image: '/assets/js/froala/plugins/image.min.js',
430
+ froala_link: '/assets/js/froala/plugins/link.min.js',
431
+ froala_lists: '/assets/js/froala/plugins/lists.min.js',
432
+ froala_paragraph_format: '/assets/js/froala/plugins/paragraph_format.min.js',
433
+ froala_table: '/assets/js/froala/plugins/table.min.js',
434
+ froala_url: '/assets/js/froala/plugins/url.min.js',
435
+ froala_video: '/assets/js/froala/plugins/video.min.js',
436
+ froala_quote: '/assets/js/froala/plugins/quote.min.js',
437
+ froala_draggable: '/assets/js/froala/plugins/draggable.min.js',
438
+ froala_font_size: '/assets/js/froala/plugins/font_size.min.js',
439
+ froala_quick_insert: '/assets/js/froala/plugins/quick_insert.min.js',
440
+ froala_line_height: '/assets/js/froala/plugins/line_height.min.js'
441
+ });
442
+ this._sourceLoader.loadResource('froala')
443
+ .pipe(operators.tap(function () {
444
+ _this._FroalaEditor = window.FroalaEditor;
445
+ _this._froalaDone();
446
+ }), operators.concatMap(function () {
447
+ return _this._loadPlugins();
448
+ }), operators.tap(function () {
449
+ _this._froalaPluginsDone();
450
+ }))
451
+ .subscribe();
452
+ };
453
+ FsFroalaLoaderService.prototype._loadPlugins = function () {
454
+ var resources = this._defaultConfig
455
+ .froalaPlugins
456
+ .map(function (pluginName) { return "froala_" + pluginName; });
457
+ return this._sourceLoader.loadResources(resources);
458
+ };
459
+ FsFroalaLoaderService.prototype._froalaDone = function () {
460
+ this._froalaLoaded.next(true);
461
+ };
462
+ FsFroalaLoaderService.prototype._froalaPluginsDone = function () {
463
+ this._froalaPluginsLoaded.next(true);
464
+ };
465
+ return FsFroalaLoaderService;
466
+ }());
467
+ 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 });
468
+ FsFroalaLoaderService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsFroalaLoaderService, providedIn: 'root' });
469
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsFroalaLoaderService, decorators: [{
470
+ type: i0.Injectable,
471
+ args: [{
472
+ providedIn: 'root',
473
+ }]
474
+ }], ctorParameters: function () {
475
+ return [{ type: undefined, decorators: [{
476
+ type: i0.Optional
477
+ }, {
478
+ type: i0.Inject,
479
+ args: [FS_HTML_EDITOR_CONFIG]
480
+ }] }, { type: Document, decorators: [{
481
+ type: i0.Inject,
482
+ args: [i4.DOCUMENT]
483
+ }] }];
484
484
  } });
485
485
 
486
- var FsHtmlRendererComponent = /** @class */ (function () {
487
- function FsHtmlRendererComponent(sanitized, _cdRef) {
488
- this.sanitized = sanitized;
489
- this._cdRef = _cdRef;
490
- }
491
- Object.defineProperty(FsHtmlRendererComponent.prototype, "setHtml", {
492
- set: function (html) {
493
- this.trustedHtml = this.sanitized.bypassSecurityTrustHtml(html || '');
494
- this._cdRef.markForCheck();
495
- },
496
- enumerable: false,
497
- configurable: true
498
- });
499
- return FsHtmlRendererComponent;
500
- }());
501
- 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 });
502
- 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: "<div class=\"fr-view fs-html-editor-default\" [innerHtml]=\"trustedHtml\"></div>\n", styles: [""], changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush });
503
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsHtmlRendererComponent, decorators: [{
504
- type: i0.Component,
505
- args: [{
506
- selector: 'fs-html-renderer',
507
- templateUrl: 'html-renderer.component.html',
508
- styleUrls: ['html-renderer.component.scss'],
509
- changeDetection: i0.ChangeDetectionStrategy.OnPush,
510
- }]
511
- }], ctorParameters: function () { return [{ type: i1__namespace.DomSanitizer }, { type: i0__namespace.ChangeDetectorRef }]; }, propDecorators: { setHtml: [{
512
- type: i0.Input,
513
- args: ['html']
486
+ var FsHtmlRendererComponent = /** @class */ (function () {
487
+ function FsHtmlRendererComponent(sanitized, _cdRef) {
488
+ this.sanitized = sanitized;
489
+ this._cdRef = _cdRef;
490
+ }
491
+ Object.defineProperty(FsHtmlRendererComponent.prototype, "setHtml", {
492
+ set: function (html) {
493
+ this.trustedHtml = this.sanitized.bypassSecurityTrustHtml(html || '');
494
+ this._cdRef.markForCheck();
495
+ },
496
+ enumerable: false,
497
+ configurable: true
498
+ });
499
+ return FsHtmlRendererComponent;
500
+ }());
501
+ 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 });
502
+ 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: "<div class=\"fr-view fs-html-editor-default\" [innerHtml]=\"trustedHtml\"></div>\n", styles: [""], changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush });
503
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsHtmlRendererComponent, decorators: [{
504
+ type: i0.Component,
505
+ args: [{
506
+ selector: 'fs-html-renderer',
507
+ templateUrl: 'html-renderer.component.html',
508
+ styleUrls: ['html-renderer.component.scss'],
509
+ changeDetection: i0.ChangeDetectionStrategy.OnPush,
510
+ }]
511
+ }], ctorParameters: function () { return [{ type: i1__namespace.DomSanitizer }, { type: i0__namespace.ChangeDetectorRef }]; }, propDecorators: { setHtml: [{
512
+ type: i0.Input,
513
+ args: ['html']
514
514
  }] } });
515
515
 
516
- var FsHtmlEditorComponent = /** @class */ (function () {
517
- function FsHtmlEditorComponent(_defaultConfig, _cdRef, _fr) {
518
- this._defaultConfig = _defaultConfig;
519
- this._cdRef = _cdRef;
520
- this._fr = _fr;
521
- this.classFocused = false;
522
- this.classDisabled = false;
523
- this.config = {};
524
- this.initialized = false;
525
- this._initialize$ = new rxjs.ReplaySubject();
526
- this._froalaReady$ = new rxjs.BehaviorSubject(null);
527
- this._destroy$ = new rxjs.Subject();
528
- this.onChange = function (data) { };
529
- this.onTouched = function () { };
530
- }
531
- Object.defineProperty(FsHtmlEditorComponent.prototype, "el", {
532
- get: function () {
533
- return this.elRef.nativeElement;
534
- },
535
- enumerable: false,
536
- configurable: true
537
- });
538
- Object.defineProperty(FsHtmlEditorComponent.prototype, "html", {
539
- get: function () {
540
- return this._html;
541
- },
542
- enumerable: false,
543
- configurable: true
544
- });
545
- Object.defineProperty(FsHtmlEditorComponent.prototype, "editor", {
546
- get: function () {
547
- return this._editor;
548
- },
549
- enumerable: false,
550
- configurable: true
551
- });
552
- Object.defineProperty(FsHtmlEditorComponent.prototype, "froalaLoaded$", {
553
- get: function () {
554
- return this._fr.loaded$;
555
- },
556
- enumerable: false,
557
- configurable: true
558
- });
559
- FsHtmlEditorComponent.prototype.ngOnInit = function () {
560
- this.config = this.config || {};
561
- this.config.autofocus = this.config.autofocus !== false && !this.config.disabled;
562
- this.initialized = !this.config.initOnClick;
563
- this._listenLazyInit();
564
- };
565
- FsHtmlEditorComponent.prototype.ngAfterViewInit = function () {
566
- if (!this.config.initOnClick || !this.hasContent()) {
567
- this.initialized = true;
568
- this._initialize$.next();
569
- }
570
- };
571
- FsHtmlEditorComponent.prototype.hasContent = function () {
572
- var el = document.createElement('div');
573
- if (el.querySelector('img')) {
574
- return true;
575
- }
576
- el.innerHTML = this._html;
577
- return !!el.innerText.length;
578
- };
579
- FsHtmlEditorComponent.prototype.initialize = function (options) {
580
- var _this = this;
581
- if (options === void 0) { options = {}; }
582
- var config = this._createConfig();
583
- this._initPlugins(config);
584
- this._initButtons(config);
585
- this._editor = new this._fr.FroalaEditor(this.el, this._createOptions(), function () {
586
- _this._froalaReady$.next({ config: config, options: options });
587
- });
588
- };
589
- FsHtmlEditorComponent.prototype._processImageUpload = function (blob) {
590
- var _this = this;
591
- var processor = new file.FileProcessor();
592
- var file$1 = new file.FsFile(blob);
593
- var config = {
594
- orientate: true,
595
- quality: this.config.image.quality,
596
- format: this.config.image.format,
597
- maxWidth: this.config.image.width,
598
- maxHeight: this.config.image.height,
599
- minWidth: this.config.image.minWidth,
600
- minHeight: this.config.image.minHeight,
601
- };
602
- return processor.processFile(file$1, config)
603
- .pipe(operators.switchMap(function (fsFile) {
604
- return _this.config.image.upload(fsFile.file);
605
- }));
606
- };
607
- FsHtmlEditorComponent.prototype.uninitializedClick = function (event) {
608
- if (!event.defaultPrevented) {
609
- var target_1 = event.target;
610
- if (target_1 && target_1.nodeName === 'A' && target_1.getAttribute('href')) {
611
- var targetTarget_1 = target_1.getAttribute('target');
612
- target_1.setAttribute('target', '_blank');
613
- setTimeout(function () {
614
- if (targetTarget_1) {
615
- target_1.setAttribute('target', targetTarget_1);
616
- }
617
- else {
618
- target_1.removeAttribute('target');
619
- }
620
- });
621
- }
622
- else {
623
- if (this.config.initClick) {
624
- this.config.initClick(event);
625
- }
626
- this._initialize$.next();
627
- this.initialized = true;
628
- }
629
- }
630
- };
631
- FsHtmlEditorComponent.prototype.updateSize = function () {
632
- // Hack: To trigger the toolbar button size modes
633
- window.dispatchEvent(new Event('resize'));
634
- };
635
- FsHtmlEditorComponent.prototype.validate = function (control) {
636
- var err = {};
637
- if (this.config.maxLength && this._html) {
638
- var maxLength = this.config.maxLength;
639
- var length = this._html.length;
640
- if (length > maxLength) {
641
- err.maxLengthError = "Must be " + maxLength + " characters or fewer. You entered " + length + " characters.";
642
- }
643
- }
644
- return Object.keys(err).length ? err : null;
645
- };
646
- FsHtmlEditorComponent.prototype.focus = function (options) {
647
- options = options ? options : {};
648
- if (options.cursorPosition === 'end') {
649
- this.editor.selection.setAtEnd(this.editor.$el.get(0));
650
- }
651
- else {
652
- this.editor.selection.setAtStart(this.editor.$el.get(0));
653
- }
654
- this.editor.selection.restore();
655
- var elSelection = this.editor.selection.element();
656
- if (elSelection) {
657
- elSelection.scrollIntoView({ block: 'center' });
658
- }
659
- };
660
- FsHtmlEditorComponent.prototype.clear = function () {
661
- this.writeValue('');
662
- };
663
- FsHtmlEditorComponent.prototype.disable = function () {
664
- this.classDisabled = true;
665
- };
666
- FsHtmlEditorComponent.prototype.setHtml = function (html) {
667
- this.writeValue(html);
668
- };
669
- FsHtmlEditorComponent.prototype.writeValue = function (html) {
670
- this._html = html || '';
671
- if (Array.isArray(this._html)) {
672
- this._html = this._html.pop();
673
- }
674
- this._html = this._html
675
- .replace(/<(li)>\s?<(div)>/g, '<li>')
676
- .replace(/<\/(div)><\/(li)>/g, '</li>');
677
- if (this.editor && this.editor.html) {
678
- try {
679
- this.editor.html.set(this._html);
680
- }
681
- catch (e) {
682
- }
683
- }
684
- this._cdRef.markForCheck();
685
- };
686
- FsHtmlEditorComponent.prototype.registerOnChange = function (fn) {
687
- this.onChange = fn;
688
- };
689
- FsHtmlEditorComponent.prototype.registerOnTouched = function (fn) {
690
- this.onTouched = fn;
691
- };
692
- FsHtmlEditorComponent.prototype.ngOnDestroy = function () {
693
- this._initialize$.complete();
694
- this._destroy$.next();
695
- this._destroy$.complete();
696
- this.destroy();
697
- };
698
- FsHtmlEditorComponent.prototype.destroy = function () {
699
- if (this.editor) {
700
- this.editor.destroy();
701
- }
702
- this.initialized = false;
703
- this._cdRef.markForCheck();
704
- this.el.innerHTML = '';
705
- };
706
- FsHtmlEditorComponent.prototype._createConfig = function () {
707
- return lodashEs.merge({ froalaConfig: {} }, this._defaultConfig, this.config);
708
- };
709
- FsHtmlEditorComponent.prototype._change = function (html) {
710
- this._html = html;
711
- this.onChange(html);
712
- };
713
- FsHtmlEditorComponent.prototype._initButtons = function (config) {
714
- var _this = this;
715
- (config.buttons || [])
716
- .forEach(function (button) {
717
- /*
718
- Svg Keys:
719
- ["add", "advancedImageEditor", "alignCenter", "alignJustify", "alignLeft", "alignRight",
720
- "anchors", "back", "backgroundColor", "blockquote", "bold", "cellBackground",
721
- "cellBorderColor", "cellOptions", "cellStyle", "clearFormatting", "close", "codeView",
722
- "cogs", "columns", "editLink", "exitFullscreen", "fontAwesome", "fontFamily",
723
- "fontSize", "fullscreen", "help", "horizontalLine", "imageAltText", "imageCaption",
724
- "imageClass", "imageDisplay", "imageManager", "imageSize", "indent", "inlineClass",
725
- "inlineStyle", "insertEmbed", "insertFile", "insertImage", "insertLink", "insertMore",
726
- "insertTable", "insertVideo", "upload", "italic", "search", "lineHeight", "linkStyles",
727
- "mention", "more", "openLink", "orderedList", "outdent", "pageBreaker",
728
- "paragraphFormat", "paragraphMore", "paragraphStyle", "pdfExport", "print",
729
- "redo", "removeTable", "remove", "replaceImage", "row", "selectAll", "smile",
730
- "spellcheck", "star", "strikeThrough", "subscript", "superscript", "symbols", "tags",
731
- "tableHeader", "tableStyle", "textColor", "textMore", "underline", "undo", "unlink",
732
- "unorderedList", "verticalAlignBottom", "verticalAlignMiddle", "verticalAlignTop"]
733
- */
734
- var _a, _b, _c;
735
- if (button.svgKey) {
736
- _this._fr.FroalaEditor.DefineIcon(button.name, { SVG_KEY: button.svgKey });
737
- }
738
- _this._fr.FroalaEditor.RegisterCommand(button.name, {
739
- title: button.title,
740
- focus: (_a = button.focus) !== null && _a !== void 0 ? _a : true,
741
- undo: (_b = button.undo) !== null && _b !== void 0 ? _b : true,
742
- refreshAfterCallback: (_c = button.refreshAfterCallback) !== null && _c !== void 0 ? _c : true,
743
- callback: function () {
744
- button.click(this);
745
- }
746
- });
747
- });
748
- };
749
- FsHtmlEditorComponent.prototype._initPlugins = function (config) {
750
- var _this = this;
751
- (config.plugins || []).forEach(function (plugin) {
752
- _this._fr.FroalaEditor.PLUGINS[plugin.config.name] = function (editor) {
753
- plugin.editor = editor;
754
- plugin.initialize();
755
- return plugin;
756
- };
757
- (plugin.config.buttons || []).forEach(function (button) {
758
- _this._fr.FroalaEditor.DefineIcon(button.name, {
759
- NAME: button.name,
760
- PATH: button.svgPath,
761
- });
762
- _this._fr.FroalaEditor.RegisterCommand(button.name, {
763
- icon: button.name,
764
- title: button.tooltip,
765
- undo: button.undo,
766
- focus: button.focus,
767
- showOnMobile: button.showOnMobile,
768
- refreshAfterCallback: button.refreshAfterCallback,
769
- callback: function () {
770
- if (button.click) {
771
- button.click(this);
772
- }
773
- },
774
- refresh: function (button) {
775
- if (button.refresh) {
776
- button.refresh(this, button);
777
- }
778
- }
779
- });
780
- });
781
- });
782
- };
783
- FsHtmlEditorComponent.prototype._createOptions = function () {
784
- var _a, _b;
785
- var config = this._createConfig();
786
- return lodashEs.merge(
787
- // For some reason editor store somewhere pointer on default config object and dublicate options each time on init
788
- // Extra merge level fixed this problem and allow to init config properly without legacy data
789
- {}, {
790
- shortcutsEnabled: ['show', 'bold', 'italic', 'underline', 'indent', 'outdent', 'undo', 'redo', 'insertImage', 'createLink'],
791
- key: config.activationKey,
792
- placeholderText: config.placeholder,
793
- linkAlwaysBlank: true,
794
- tabSpaces: 2,
795
- typingTimer: 250,
796
- tooltips: false,
797
- wordPasteModal: false,
798
- imageDefaultWidth: 0,
799
- imageDefaultAlign: 'left',
800
- quickInsertEnabled: false,
801
- paragraphDefaultSelection: 'Format',
802
- videoUpload: false,
803
- imagePaste: !!((_a = config.image) === null || _a === void 0 ? void 0 : _a.upload),
804
- imageUpload: !!((_b = config.image) === null || _b === void 0 ? void 0 : _b.upload),
805
- paragraphFormat: {
806
- N: 'Normal',
807
- H1: 'Heading 1',
808
- H2: 'Heading 2',
809
- H3: 'Heading 3',
810
- H4: 'Heading 4',
811
- BLOCKQUOTE: 'Quote',
812
- },
813
- lineHeights: {
814
- Default: '',
815
- '0.5': '0.5',
816
- 'Single': '1',
817
- '1.15': '1.15',
818
- '1.5': '1.5',
819
- 'Double': '2'
820
- },
821
- paragraphFormatSelection: true,
822
- toolbarButtonsXS: {
823
- moreText: {
824
- buttons: TextButtons,
825
- buttonsVisible: 1,
826
- },
827
- moreParagraph: {
828
- buttons: ParagraphButtons,
829
- buttonsVisible: 2,
830
- },
831
- moreRich: {
832
- buttons: RichButtons,
833
- buttonsVisible: 0,
834
- },
835
- },
836
- toolbarButtons: {
837
- moreText: {
838
- buttons: TextButtons,
839
- buttonsVisible: 3,
840
- },
841
- moreParagraph: {
842
- buttons: ParagraphButtons,
843
- buttonsVisible: 5,
844
- },
845
- moreRich: {
846
- buttons: RichButtons,
847
- buttonsVisible: 3,
848
- },
849
- },
850
- }, config.froalaConfig);
851
- };
852
- FsHtmlEditorComponent.prototype._listenLazyInit = function () {
853
- var _this = this;
854
- this.froalaLoaded$
855
- .pipe(operators.filter(function (ready) { return ready; }), operators.switchMap(function () { return _this._initialize$; }), operators.tap(function () {
856
- var selection = window.getSelection();
857
- var options = {};
858
- if (selection.baseNode) {
859
- options.selection = {
860
- node: selection.baseNode.nodeValue,
861
- offset: selection.baseOffset,
862
- };
863
- }
864
- _this.initialize(options);
865
- }), operators.switchMap(function () { return _this._froalaReady$; }), operators.filter(function (data) { return !!data; }), operators.tap(function (_d) {
866
- var config = _d.config, options = _d.options;
867
- _this._setupFroala(config, options);
868
- }))
869
- .subscribe();
870
- };
871
- FsHtmlEditorComponent.prototype._contentChanged = function () {
872
- var editorHTML = this._editor.html.get();
873
- if (this.html !== editorHTML) {
874
- this._change(editorHTML);
875
- }
876
- };
877
- FsHtmlEditorComponent.prototype._setupFroala = function (config, options) {
878
- var _this = this;
879
- this._cdRef.markForCheck();
880
- this.setHtml(this._html);
881
- if (config.disabled) {
882
- this.disable();
883
- }
884
- if (config.froalaConfig.events) {
885
- if (config.froalaConfig.events.initialized) {
886
- config.froalaConfig.events.initialized();
887
- }
888
- }
889
- this._editor.events.on('focus', function () {
890
- _this.classFocused = true;
891
- _this._cdRef.markForCheck();
892
- });
893
- this._editor.events.on('blur', function () {
894
- _this.classFocused = false;
895
- _this._cdRef.markForCheck();
896
- });
897
- rxjs.fromEventPattern(function (handler) {
898
- _this._editor.events.on('contentChanged', handler);
899
- }, function () { })
900
- .pipe(operators.startWith(this._html), operators.map(function () { return _this.editor.html.get(); }), operators.distinctUntilChanged(), operators.skip(1))
901
- .subscribe(function () {
902
- _this._contentChanged();
903
- });
904
- // this._editor.events.on('contentChanged', () => {
905
- // console.log('test');
906
- // if (!this._firstChange) {
907
- // this._contentChanged();
908
- // }
909
- // });
910
- this._editor.events.on('paste.afterCleanup', function (html) {
911
- var div = document.createElement('div');
912
- div.innerHTML = html;
913
- div.querySelectorAll('*')
914
- .forEach(function (el) {
915
- for (var i = 0; i < el.attributes.length; i++) {
916
- var name = el.attributes[0].name;
917
- if (name !== 'href') {
918
- el.removeAttribute(name);
919
- }
920
- }
921
- });
922
- return div.innerHTML;
923
- });
924
- this._editor.events.on('keydown', function () {
925
- _this.onTouched();
926
- });
927
- if (this.config.image && this.config.image.upload) {
928
- this._editor.events.on('image.beforePasteUpload', function (image) {
929
- fetch(image.getAttribute('src'))
930
- .then(function (res) {
931
- res.blob()
932
- .then(function (blob) {
933
- _this._processImageUpload(blob)
934
- .pipe(operators.takeUntil(_this._destroy$))
935
- .subscribe(function (url) {
936
- image.setAttribute('src', url);
937
- image.removeAttribute('data-fr-image-pasted');
938
- _this._contentChanged();
939
- });
940
- });
941
- });
942
- return false;
943
- });
944
- this._editor.events.on('image.beforeUpload', function (blobs) {
945
- _this._processImageUpload(blobs[0])
946
- .pipe(operators.takeUntil(_this._destroy$))
947
- .subscribe(function (url) {
948
- _this.editor.image.insert(url, null, null, _this.editor.image.get());
949
- });
950
- return false;
951
- });
952
- }
953
- if (this.el.querySelector('.fr-second-toolbar')) {
954
- this.el.querySelector('.fr-second-toolbar').remove();
955
- }
956
- var selection = options.selection;
957
- if (selection) {
958
- var node = Array.from(this.el.querySelectorAll('.fr-element *')).find(function (node) {
959
- return selection.node === node.textContent;
960
- });
961
- if (node) {
962
- var range = document.createRange();
963
- var sel = window.getSelection();
964
- range.setStart(this._getTextNode(node), selection.offset);
965
- range.collapse(true);
966
- sel.removeAllRanges();
967
- sel.addRange(range);
968
- }
969
- else if (this.config.autofocus) {
970
- this.focus();
971
- }
972
- }
973
- else if (this.config.autofocus) {
974
- this.focus();
975
- }
976
- };
977
- FsHtmlEditorComponent.prototype._getTextNode = function (node) {
978
- if (node) {
979
- if (node.nodeType === Node.TEXT_NODE) {
980
- return node;
981
- }
982
- if (node.childNodes) {
983
- return this._getTextNode(node.childNodes[0]);
984
- }
985
- }
986
- };
987
- return FsHtmlEditorComponent;
988
- }());
989
- 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 });
990
- 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: [
991
- {
992
- provide: forms.NG_VALUE_ACCESSOR,
993
- useExisting: i0.forwardRef(function () { return FsHtmlEditorComponent; }),
994
- multi: true
995
- },
996
- {
997
- provide: forms.NG_VALIDATORS,
998
- useExisting: i0.forwardRef(function () { return FsHtmlEditorComponent; }),
999
- multi: true
1000
- },
1001
- ], 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}:host ::ng-deep .fr-toolbar.fr-top .fr-command.fr-btn{z-index:auto}:host ::ng-deep .fr-toolbar.fr-top .fr-command.fr-btn.fr-dropdown:after{right:3px}:host ::ng-deep .fr-toolbar.fr-top .fr-command.fr-btn.fr-dropdown.fr-selection span{margin-right:24px}:host ::ng-deep .fr-toolbar.fr-top .fr-command.fr-btn.fr-open{border-radius:4px;margin:4px 2px}:host ::ng-deep .fr-view ol,:host ::ng-deep .fr-view ul{list-style-position:unset}:host.disabled ::ng-deep .fr-box.fr-basic{opacity:.5;pointer-events:none}:host.disabled ::ng-deep .fr-box.fr-basic .fr-wrapper{border:none}:host.disabled ::ng-deep .disabled-line{display:block}::ng-deep .fr-popup{z-index:1001!important}::ng-deep .fr-video-by-url-layer .fr-checkbox-line{display:none}.disabled-line{display:none;position:absolute;bottom:-1px;z-index:1;background-image:linear-gradient(90deg,rgba(0,0,0,.42) 0,rgba(0,0,0,.42) 33%,transparent 0);background-size:4px 100%;background-repeat:repeat-x;height:1px;width:100%}.bottom-line{opacity:0;transform-origin:50%;transform:scaleX(.5);transition:background-color .3s cubic-bezier(.55,0,.55,.2);width:100%;border-bottom:2px solid #949494;position:absolute;bottom:-1px;z-index:1}:host{position:relative;display:block}:host.focused .bottom-line{opacity:1;display:block;transform:scaleX(1);transition:transform .3s cubic-bezier(.25,.8,.25,1),opacity .1s cubic-bezier(.25,.8,.25,1),background-color .3s cubic-bezier(.25,.8,.25,1)}::ng-deep .fs-html-editor-mention-container{position:absolute;top:0;left:0;height:auto;max-height:300px;max-width:500px;overflow:auto;display:block;z-index:999999;box-shadow:0 2px 4px -1px #0003,0 4px 5px #00000024,0 1px 10px #0000001f;border-bottom-left-radius:4px;border-bottom-right-radius:4px;background:#fff}::ng-deep .fs-html-editor-mention-container ul{margin:0;padding:0;list-style:none}::ng-deep .fs-html-editor-mention-container li{padding:0 16px;cursor:pointer;line-height:48px}::ng-deep .fs-html-editor-mention-container li.highlight,::ng-deep .fs-html-editor-mention-container li:hover{background:#F5F5F5}::ng-deep .fs-html-editor-mention-container li.no-match{cursor:default}\n"], components: [{ type: 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 });
1002
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsHtmlEditorComponent, decorators: [{
1003
- type: i0.Component,
1004
- args: [{
1005
- selector: 'fs-html-editor',
1006
- templateUrl: 'html-editor.component.html',
1007
- styleUrls: ['html-editor.component.scss'],
1008
- providers: [
1009
- {
1010
- provide: forms.NG_VALUE_ACCESSOR,
1011
- useExisting: i0.forwardRef(function () { return FsHtmlEditorComponent; }),
1012
- multi: true
1013
- },
1014
- {
1015
- provide: forms.NG_VALIDATORS,
1016
- useExisting: i0.forwardRef(function () { return FsHtmlEditorComponent; }),
1017
- multi: true
1018
- },
1019
- ],
1020
- changeDetection: i0.ChangeDetectionStrategy.OnPush,
1021
- }]
1022
- }], ctorParameters: function () {
1023
- return [{ type: undefined, decorators: [{
1024
- type: i0.Optional
1025
- }, {
1026
- type: i0.Inject,
1027
- args: [FS_HTML_EDITOR_CONFIG]
1028
- }] }, { type: i0__namespace.ChangeDetectorRef }, { type: FsFroalaLoaderService }];
1029
- }, propDecorators: { classFocused: [{
1030
- type: i0.HostBinding,
1031
- args: ['class.focused']
1032
- }], classDisabled: [{
1033
- type: i0.HostBinding,
1034
- args: ['class.disabled']
1035
- }], elRef: [{
1036
- type: i0.ViewChild,
1037
- args: ['elRef']
1038
- }], config: [{
1039
- type: i0.Input
1040
- }], hint: [{
1041
- type: i0.Input
516
+ var FsHtmlEditorComponent = /** @class */ (function () {
517
+ function FsHtmlEditorComponent(_defaultConfig, _cdRef, _fr) {
518
+ this._defaultConfig = _defaultConfig;
519
+ this._cdRef = _cdRef;
520
+ this._fr = _fr;
521
+ this.classFocused = false;
522
+ this.classDisabled = false;
523
+ this.config = {};
524
+ this.initialized = false;
525
+ this._initialize$ = new rxjs.ReplaySubject();
526
+ this._froalaReady$ = new rxjs.BehaviorSubject(null);
527
+ this._destroy$ = new rxjs.Subject();
528
+ this.onChange = function (data) { };
529
+ this.onTouched = function () { };
530
+ }
531
+ Object.defineProperty(FsHtmlEditorComponent.prototype, "el", {
532
+ get: function () {
533
+ return this.elRef.nativeElement;
534
+ },
535
+ enumerable: false,
536
+ configurable: true
537
+ });
538
+ Object.defineProperty(FsHtmlEditorComponent.prototype, "html", {
539
+ get: function () {
540
+ return this._html;
541
+ },
542
+ enumerable: false,
543
+ configurable: true
544
+ });
545
+ Object.defineProperty(FsHtmlEditorComponent.prototype, "editor", {
546
+ get: function () {
547
+ return this._editor;
548
+ },
549
+ enumerable: false,
550
+ configurable: true
551
+ });
552
+ Object.defineProperty(FsHtmlEditorComponent.prototype, "froalaLoaded$", {
553
+ get: function () {
554
+ return this._fr.loaded$;
555
+ },
556
+ enumerable: false,
557
+ configurable: true
558
+ });
559
+ FsHtmlEditorComponent.prototype.ngOnInit = function () {
560
+ this.config = this.config || {};
561
+ this.config.autofocus = this.config.autofocus !== false && !this.config.disabled;
562
+ this.initialized = !this.config.initOnClick;
563
+ this._listenLazyInit();
564
+ };
565
+ FsHtmlEditorComponent.prototype.ngAfterViewInit = function () {
566
+ if (!this.config.initOnClick || !this.hasContent()) {
567
+ this.initialized = true;
568
+ this._initialize$.next();
569
+ }
570
+ };
571
+ FsHtmlEditorComponent.prototype.hasContent = function () {
572
+ var el = document.createElement('div');
573
+ if (el.querySelector('img')) {
574
+ return true;
575
+ }
576
+ el.innerHTML = this._html;
577
+ return !!el.innerText.length;
578
+ };
579
+ FsHtmlEditorComponent.prototype.initialize = function (options) {
580
+ var _this = this;
581
+ if (options === void 0) { options = {}; }
582
+ var config = this._createConfig();
583
+ this._initPlugins(config);
584
+ this._initButtons(config);
585
+ this._editor = new this._fr.FroalaEditor(this.el, this._createOptions(), function () {
586
+ _this._froalaReady$.next({ config: config, options: options });
587
+ });
588
+ };
589
+ FsHtmlEditorComponent.prototype._processImageUpload = function (blob) {
590
+ var _this = this;
591
+ var processor = new file.FileProcessor();
592
+ var file$1 = new file.FsFile(blob);
593
+ var config = {
594
+ orientate: true,
595
+ quality: this.config.image.quality,
596
+ format: this.config.image.format,
597
+ maxWidth: this.config.image.width,
598
+ maxHeight: this.config.image.height,
599
+ minWidth: this.config.image.minWidth,
600
+ minHeight: this.config.image.minHeight,
601
+ };
602
+ return processor.processFile(file$1, config)
603
+ .pipe(operators.switchMap(function (fsFile) {
604
+ return _this.config.image.upload(fsFile.file);
605
+ }));
606
+ };
607
+ FsHtmlEditorComponent.prototype.uninitializedClick = function (event) {
608
+ if (!event.defaultPrevented) {
609
+ var target_1 = event.target;
610
+ if (target_1 && target_1.nodeName === 'A' && target_1.getAttribute('href')) {
611
+ var targetTarget_1 = target_1.getAttribute('target');
612
+ target_1.setAttribute('target', '_blank');
613
+ setTimeout(function () {
614
+ if (targetTarget_1) {
615
+ target_1.setAttribute('target', targetTarget_1);
616
+ }
617
+ else {
618
+ target_1.removeAttribute('target');
619
+ }
620
+ });
621
+ }
622
+ else {
623
+ if (this.config.initClick) {
624
+ this.config.initClick(event);
625
+ }
626
+ this._initialize$.next();
627
+ this.initialized = true;
628
+ }
629
+ }
630
+ };
631
+ FsHtmlEditorComponent.prototype.updateSize = function () {
632
+ // Hack: To trigger the toolbar button size modes
633
+ window.dispatchEvent(new Event('resize'));
634
+ };
635
+ FsHtmlEditorComponent.prototype.validate = function (control) {
636
+ var err = {};
637
+ if (this.config.maxLength && this._html) {
638
+ var maxLength = this.config.maxLength;
639
+ var length = this._html.length;
640
+ if (length > maxLength) {
641
+ err.maxLengthError = "Must be " + maxLength + " characters or fewer. You entered " + length + " characters.";
642
+ }
643
+ }
644
+ return Object.keys(err).length ? err : null;
645
+ };
646
+ FsHtmlEditorComponent.prototype.focus = function (options) {
647
+ options = options ? options : {};
648
+ if (options.cursorPosition === 'end') {
649
+ this.editor.selection.setAtEnd(this.editor.$el.get(0));
650
+ }
651
+ else {
652
+ this.editor.selection.setAtStart(this.editor.$el.get(0));
653
+ }
654
+ this.editor.selection.restore();
655
+ var elSelection = this.editor.selection.element();
656
+ if (elSelection) {
657
+ elSelection.scrollIntoView({ block: 'center' });
658
+ }
659
+ };
660
+ FsHtmlEditorComponent.prototype.clear = function () {
661
+ this.writeValue('');
662
+ };
663
+ FsHtmlEditorComponent.prototype.disable = function () {
664
+ this.classDisabled = true;
665
+ };
666
+ FsHtmlEditorComponent.prototype.setHtml = function (html) {
667
+ this.writeValue(html);
668
+ };
669
+ FsHtmlEditorComponent.prototype.writeValue = function (html) {
670
+ this._html = html || '';
671
+ if (Array.isArray(this._html)) {
672
+ this._html = this._html.pop();
673
+ }
674
+ this._html = this._html
675
+ .replace(/<(li)>\s?<(div)>/g, '<li>')
676
+ .replace(/<\/(div)><\/(li)>/g, '</li>');
677
+ if (this.editor && this.editor.html) {
678
+ try {
679
+ this.editor.html.set(this._html);
680
+ }
681
+ catch (e) {
682
+ }
683
+ }
684
+ this._cdRef.markForCheck();
685
+ };
686
+ FsHtmlEditorComponent.prototype.registerOnChange = function (fn) {
687
+ this.onChange = fn;
688
+ };
689
+ FsHtmlEditorComponent.prototype.registerOnTouched = function (fn) {
690
+ this.onTouched = fn;
691
+ };
692
+ FsHtmlEditorComponent.prototype.ngOnDestroy = function () {
693
+ this._initialize$.complete();
694
+ this._destroy$.next();
695
+ this._destroy$.complete();
696
+ this.destroy();
697
+ };
698
+ FsHtmlEditorComponent.prototype.destroy = function () {
699
+ if (this.editor) {
700
+ this.editor.destroy();
701
+ }
702
+ this.initialized = false;
703
+ this._cdRef.markForCheck();
704
+ this.el.innerHTML = '';
705
+ };
706
+ FsHtmlEditorComponent.prototype._createConfig = function () {
707
+ return lodashEs.merge({ froalaConfig: {} }, this._defaultConfig, this.config);
708
+ };
709
+ FsHtmlEditorComponent.prototype._change = function (html) {
710
+ this._html = html;
711
+ this.onChange(html);
712
+ };
713
+ FsHtmlEditorComponent.prototype._initButtons = function (config) {
714
+ var _this = this;
715
+ (config.buttons || [])
716
+ .forEach(function (button) {
717
+ /*
718
+ Svg Keys:
719
+ ["add", "advancedImageEditor", "alignCenter", "alignJustify", "alignLeft", "alignRight",
720
+ "anchors", "back", "backgroundColor", "blockquote", "bold", "cellBackground",
721
+ "cellBorderColor", "cellOptions", "cellStyle", "clearFormatting", "close", "codeView",
722
+ "cogs", "columns", "editLink", "exitFullscreen", "fontAwesome", "fontFamily",
723
+ "fontSize", "fullscreen", "help", "horizontalLine", "imageAltText", "imageCaption",
724
+ "imageClass", "imageDisplay", "imageManager", "imageSize", "indent", "inlineClass",
725
+ "inlineStyle", "insertEmbed", "insertFile", "insertImage", "insertLink", "insertMore",
726
+ "insertTable", "insertVideo", "upload", "italic", "search", "lineHeight", "linkStyles",
727
+ "mention", "more", "openLink", "orderedList", "outdent", "pageBreaker",
728
+ "paragraphFormat", "paragraphMore", "paragraphStyle", "pdfExport", "print",
729
+ "redo", "removeTable", "remove", "replaceImage", "row", "selectAll", "smile",
730
+ "spellcheck", "star", "strikeThrough", "subscript", "superscript", "symbols", "tags",
731
+ "tableHeader", "tableStyle", "textColor", "textMore", "underline", "undo", "unlink",
732
+ "unorderedList", "verticalAlignBottom", "verticalAlignMiddle", "verticalAlignTop"]
733
+ */
734
+ var _a, _b, _c;
735
+ if (button.svgKey) {
736
+ _this._fr.FroalaEditor.DefineIcon(button.name, { SVG_KEY: button.svgKey });
737
+ }
738
+ _this._fr.FroalaEditor.RegisterCommand(button.name, {
739
+ title: button.title,
740
+ focus: (_a = button.focus) !== null && _a !== void 0 ? _a : true,
741
+ undo: (_b = button.undo) !== null && _b !== void 0 ? _b : true,
742
+ refreshAfterCallback: (_c = button.refreshAfterCallback) !== null && _c !== void 0 ? _c : true,
743
+ callback: function () {
744
+ button.click(this);
745
+ }
746
+ });
747
+ });
748
+ };
749
+ FsHtmlEditorComponent.prototype._initPlugins = function (config) {
750
+ var _this = this;
751
+ (config.plugins || []).forEach(function (plugin) {
752
+ _this._fr.FroalaEditor.PLUGINS[plugin.config.name] = function (editor) {
753
+ plugin.editor = editor;
754
+ plugin.initialize();
755
+ return plugin;
756
+ };
757
+ (plugin.config.buttons || []).forEach(function (button) {
758
+ _this._fr.FroalaEditor.DefineIcon(button.name, {
759
+ NAME: button.name,
760
+ PATH: button.svgPath,
761
+ });
762
+ _this._fr.FroalaEditor.RegisterCommand(button.name, {
763
+ icon: button.name,
764
+ title: button.tooltip,
765
+ undo: button.undo,
766
+ focus: button.focus,
767
+ showOnMobile: button.showOnMobile,
768
+ refreshAfterCallback: button.refreshAfterCallback,
769
+ callback: function () {
770
+ if (button.click) {
771
+ button.click(this);
772
+ }
773
+ },
774
+ refresh: function (button) {
775
+ if (button.refresh) {
776
+ button.refresh(this, button);
777
+ }
778
+ }
779
+ });
780
+ });
781
+ });
782
+ };
783
+ FsHtmlEditorComponent.prototype._createOptions = function () {
784
+ var _a, _b;
785
+ var config = this._createConfig();
786
+ return lodashEs.merge(
787
+ // For some reason editor store somewhere pointer on default config object and dublicate options each time on init
788
+ // Extra merge level fixed this problem and allow to init config properly without legacy data
789
+ {}, {
790
+ shortcutsEnabled: ['show', 'bold', 'italic', 'underline', 'indent', 'outdent', 'undo', 'redo', 'insertImage', 'createLink'],
791
+ key: config.activationKey,
792
+ placeholderText: config.placeholder,
793
+ linkAlwaysBlank: true,
794
+ tabSpaces: 2,
795
+ typingTimer: 250,
796
+ tooltips: false,
797
+ wordPasteModal: false,
798
+ imageDefaultWidth: 0,
799
+ imageDefaultAlign: 'left',
800
+ quickInsertEnabled: false,
801
+ paragraphDefaultSelection: 'Format',
802
+ videoUpload: false,
803
+ imagePaste: !!((_a = config.image) === null || _a === void 0 ? void 0 : _a.upload),
804
+ imageUpload: !!((_b = config.image) === null || _b === void 0 ? void 0 : _b.upload),
805
+ paragraphFormat: {
806
+ N: 'Normal',
807
+ H1: 'Heading 1',
808
+ H2: 'Heading 2',
809
+ H3: 'Heading 3',
810
+ H4: 'Heading 4',
811
+ BLOCKQUOTE: 'Quote',
812
+ },
813
+ lineHeights: {
814
+ Default: '',
815
+ '0.5': '0.5',
816
+ 'Single': '1',
817
+ '1.15': '1.15',
818
+ '1.5': '1.5',
819
+ 'Double': '2'
820
+ },
821
+ paragraphFormatSelection: true,
822
+ toolbarButtonsXS: {
823
+ moreText: {
824
+ buttons: TextButtons,
825
+ buttonsVisible: 1,
826
+ },
827
+ moreParagraph: {
828
+ buttons: ParagraphButtons,
829
+ buttonsVisible: 2,
830
+ },
831
+ moreRich: {
832
+ buttons: RichButtons,
833
+ buttonsVisible: 0,
834
+ },
835
+ },
836
+ toolbarButtons: {
837
+ moreText: {
838
+ buttons: TextButtons,
839
+ buttonsVisible: 3,
840
+ },
841
+ moreParagraph: {
842
+ buttons: ParagraphButtons,
843
+ buttonsVisible: 5,
844
+ },
845
+ moreRich: {
846
+ buttons: RichButtons,
847
+ buttonsVisible: 3,
848
+ },
849
+ },
850
+ }, config.froalaConfig);
851
+ };
852
+ FsHtmlEditorComponent.prototype._listenLazyInit = function () {
853
+ var _this = this;
854
+ this.froalaLoaded$
855
+ .pipe(operators.filter(function (ready) { return ready; }), operators.switchMap(function () { return _this._initialize$; }), operators.tap(function () {
856
+ var selection = window.getSelection();
857
+ var options = {};
858
+ if (selection.baseNode) {
859
+ options.selection = {
860
+ node: selection.baseNode.nodeValue,
861
+ offset: selection.baseOffset,
862
+ };
863
+ }
864
+ _this.initialize(options);
865
+ }), operators.switchMap(function () { return _this._froalaReady$; }), operators.filter(function (data) { return !!data; }), operators.tap(function (_d) {
866
+ var config = _d.config, options = _d.options;
867
+ _this._setupFroala(config, options);
868
+ }))
869
+ .subscribe();
870
+ };
871
+ FsHtmlEditorComponent.prototype._contentChanged = function () {
872
+ var editorHTML = this._editor.html.get();
873
+ if (this.html !== editorHTML) {
874
+ this._change(editorHTML);
875
+ }
876
+ };
877
+ FsHtmlEditorComponent.prototype._setupFroala = function (config, options) {
878
+ var _this = this;
879
+ this._cdRef.markForCheck();
880
+ this.setHtml(this._html);
881
+ if (config.disabled) {
882
+ this.disable();
883
+ }
884
+ if (config.froalaConfig.events) {
885
+ if (config.froalaConfig.events.initialized) {
886
+ config.froalaConfig.events.initialized();
887
+ }
888
+ }
889
+ this._editor.events.on('focus', function () {
890
+ _this.classFocused = true;
891
+ _this._cdRef.markForCheck();
892
+ });
893
+ this._editor.events.on('blur', function () {
894
+ _this.classFocused = false;
895
+ _this._cdRef.markForCheck();
896
+ });
897
+ rxjs.fromEventPattern(function (handler) {
898
+ _this._editor.events.on('contentChanged', handler);
899
+ }, function () { })
900
+ .pipe(operators.startWith(this._html), operators.map(function () { return _this.editor.html.get(); }), operators.distinctUntilChanged(), operators.skip(1))
901
+ .subscribe(function () {
902
+ _this._contentChanged();
903
+ });
904
+ // this._editor.events.on('contentChanged', () => {
905
+ // console.log('test');
906
+ // if (!this._firstChange) {
907
+ // this._contentChanged();
908
+ // }
909
+ // });
910
+ this._editor.events.on('paste.afterCleanup', function (html) {
911
+ var div = document.createElement('div');
912
+ div.innerHTML = html;
913
+ div.querySelectorAll('*')
914
+ .forEach(function (el) {
915
+ for (var i = 0; i < el.attributes.length; i++) {
916
+ var name = el.attributes[0].name;
917
+ if (name !== 'href') {
918
+ el.removeAttribute(name);
919
+ }
920
+ }
921
+ });
922
+ return div.innerHTML;
923
+ });
924
+ this._editor.events.on('keydown', function () {
925
+ _this.onTouched();
926
+ });
927
+ if (this.config.image && this.config.image.upload) {
928
+ this._editor.events.on('image.beforePasteUpload', function (image) {
929
+ fetch(image.getAttribute('src'))
930
+ .then(function (res) {
931
+ res.blob()
932
+ .then(function (blob) {
933
+ _this._processImageUpload(blob)
934
+ .pipe(operators.takeUntil(_this._destroy$))
935
+ .subscribe(function (url) {
936
+ image.setAttribute('src', url);
937
+ image.removeAttribute('data-fr-image-pasted');
938
+ _this._contentChanged();
939
+ });
940
+ });
941
+ });
942
+ return false;
943
+ });
944
+ this._editor.events.on('image.beforeUpload', function (blobs) {
945
+ _this._processImageUpload(blobs[0])
946
+ .pipe(operators.takeUntil(_this._destroy$))
947
+ .subscribe(function (url) {
948
+ _this.editor.image.insert(url, null, null, _this.editor.image.get());
949
+ });
950
+ return false;
951
+ });
952
+ }
953
+ if (this.el.querySelector('.fr-second-toolbar')) {
954
+ this.el.querySelector('.fr-second-toolbar').remove();
955
+ }
956
+ var selection = options.selection;
957
+ if (selection) {
958
+ var node = Array.from(this.el.querySelectorAll('.fr-element *')).find(function (node) {
959
+ return selection.node === node.textContent;
960
+ });
961
+ if (node) {
962
+ var range = document.createRange();
963
+ var sel = window.getSelection();
964
+ range.setStart(this._getTextNode(node), selection.offset);
965
+ range.collapse(true);
966
+ sel.removeAllRanges();
967
+ sel.addRange(range);
968
+ }
969
+ else if (this.config.autofocus) {
970
+ this.focus();
971
+ }
972
+ }
973
+ else if (this.config.autofocus) {
974
+ this.focus();
975
+ }
976
+ };
977
+ FsHtmlEditorComponent.prototype._getTextNode = function (node) {
978
+ if (node) {
979
+ if (node.nodeType === Node.TEXT_NODE) {
980
+ return node;
981
+ }
982
+ if (node.childNodes) {
983
+ return this._getTextNode(node.childNodes[0]);
984
+ }
985
+ }
986
+ };
987
+ return FsHtmlEditorComponent;
988
+ }());
989
+ 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 });
990
+ 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: [
991
+ {
992
+ provide: forms.NG_VALUE_ACCESSOR,
993
+ useExisting: i0.forwardRef(function () { return FsHtmlEditorComponent; }),
994
+ multi: true
995
+ },
996
+ {
997
+ provide: forms.NG_VALIDATORS,
998
+ useExisting: i0.forwardRef(function () { return FsHtmlEditorComponent; }),
999
+ multi: true
1000
+ },
1001
+ ], 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-toolbar:has(> .fr-active),:host ::ng-deep .fr-btn-wrap:has(> .fr-active){padding-bottom:125px}: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 });
1002
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsHtmlEditorComponent, decorators: [{
1003
+ type: i0.Component,
1004
+ args: [{
1005
+ selector: 'fs-html-editor',
1006
+ templateUrl: 'html-editor.component.html',
1007
+ styleUrls: ['html-editor.component.scss'],
1008
+ providers: [
1009
+ {
1010
+ provide: forms.NG_VALUE_ACCESSOR,
1011
+ useExisting: i0.forwardRef(function () { return FsHtmlEditorComponent; }),
1012
+ multi: true
1013
+ },
1014
+ {
1015
+ provide: forms.NG_VALIDATORS,
1016
+ useExisting: i0.forwardRef(function () { return FsHtmlEditorComponent; }),
1017
+ multi: true
1018
+ },
1019
+ ],
1020
+ changeDetection: i0.ChangeDetectionStrategy.OnPush,
1021
+ }]
1022
+ }], ctorParameters: function () {
1023
+ return [{ type: undefined, decorators: [{
1024
+ type: i0.Optional
1025
+ }, {
1026
+ type: i0.Inject,
1027
+ args: [FS_HTML_EDITOR_CONFIG]
1028
+ }] }, { type: i0__namespace.ChangeDetectorRef }, { type: FsFroalaLoaderService }];
1029
+ }, propDecorators: { classFocused: [{
1030
+ type: i0.HostBinding,
1031
+ args: ['class.focused']
1032
+ }], classDisabled: [{
1033
+ type: i0.HostBinding,
1034
+ args: ['class.disabled']
1035
+ }], elRef: [{
1036
+ type: i0.ViewChild,
1037
+ args: ['elRef']
1038
+ }], config: [{
1039
+ type: i0.Input
1040
+ }], hint: [{
1041
+ type: i0.Input
1042
1042
  }] } });
1043
1043
 
1044
- var FsHtmlRendererModule = /** @class */ (function () {
1045
- function FsHtmlRendererModule() {
1046
- }
1047
- return FsHtmlRendererModule;
1048
- }());
1049
- FsHtmlRendererModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsHtmlRendererModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
1050
- 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] });
1051
- FsHtmlRendererModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsHtmlRendererModule, imports: [[
1052
- i4.CommonModule,
1053
- ]] });
1054
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsHtmlRendererModule, decorators: [{
1055
- type: i0.NgModule,
1056
- args: [{
1057
- imports: [
1058
- i4.CommonModule,
1059
- ],
1060
- exports: [
1061
- FsHtmlRendererComponent,
1062
- ],
1063
- declarations: [
1064
- FsHtmlRendererComponent,
1065
- ],
1066
- }]
1044
+ var FsHtmlRendererModule = /** @class */ (function () {
1045
+ function FsHtmlRendererModule() {
1046
+ }
1047
+ return FsHtmlRendererModule;
1048
+ }());
1049
+ FsHtmlRendererModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsHtmlRendererModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
1050
+ 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] });
1051
+ FsHtmlRendererModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsHtmlRendererModule, imports: [[
1052
+ i4.CommonModule,
1053
+ ]] });
1054
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsHtmlRendererModule, decorators: [{
1055
+ type: i0.NgModule,
1056
+ args: [{
1057
+ imports: [
1058
+ i4.CommonModule,
1059
+ ],
1060
+ exports: [
1061
+ FsHtmlRendererComponent,
1062
+ ],
1063
+ declarations: [
1064
+ FsHtmlRendererComponent,
1065
+ ],
1066
+ }]
1067
1067
  }] });
1068
1068
 
1069
- var FsHtmlEditorModule = /** @class */ (function () {
1070
- function FsHtmlEditorModule() {
1071
- }
1072
- FsHtmlEditorModule.forRoot = function (config) {
1073
- if (config === void 0) { config = {}; }
1074
- return {
1075
- ngModule: FsHtmlEditorModule,
1076
- providers: [
1077
- { provide: FS_HTML_EDITOR_DEFAULT_CONFIG, useValue: config },
1078
- {
1079
- provide: FS_HTML_EDITOR_CONFIG,
1080
- useFactory: FsHtmlEditorConfigFactory,
1081
- deps: [FS_HTML_EDITOR_DEFAULT_CONFIG]
1082
- }
1083
- ]
1084
- };
1085
- };
1086
- return FsHtmlEditorModule;
1087
- }());
1088
- FsHtmlEditorModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsHtmlEditorModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
1089
- FsHtmlEditorModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsHtmlEditorModule, declarations: [FsHtmlEditorComponent], imports: [i4.CommonModule,
1090
- i5.FsSkeletonModule,
1091
- i2.FsLabelModule,
1092
- FsHtmlRendererModule], exports: [FsHtmlEditorComponent] });
1093
- FsHtmlEditorModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsHtmlEditorModule, imports: [[
1094
- i4.CommonModule,
1095
- i5.FsSkeletonModule,
1096
- i2.FsLabelModule,
1097
- FsHtmlRendererModule,
1098
- ]] });
1099
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsHtmlEditorModule, decorators: [{
1100
- type: i0.NgModule,
1101
- args: [{
1102
- imports: [
1103
- i4.CommonModule,
1104
- i5.FsSkeletonModule,
1105
- i2.FsLabelModule,
1106
- FsHtmlRendererModule,
1107
- ],
1108
- exports: [
1109
- FsHtmlEditorComponent,
1110
- ],
1111
- declarations: [
1112
- FsHtmlEditorComponent,
1113
- ],
1114
- }]
1115
- }] });
1116
- function FsHtmlEditorConfigFactory(config) {
1117
- return Object.assign({ froalaPlugins: [
1118
- "align" /* Align */,
1119
- "colors" /* Colors */,
1120
- "image" /* Image */,
1121
- "link" /* Link */,
1122
- "lists" /* Lists */,
1123
- "paragraph_format" /* ParagraphFormat */,
1124
- "quote" /* Quote */,
1125
- "table" /* Table */,
1126
- "url" /* Url */,
1127
- "video" /* Video */,
1128
- "draggable" /* Draggable */,
1129
- "font_size" /* FontSize */,
1130
- "line_height" /* LineHeight */,
1131
- ] }, config);
1069
+ var FsHtmlEditorModule = /** @class */ (function () {
1070
+ function FsHtmlEditorModule() {
1071
+ }
1072
+ FsHtmlEditorModule.forRoot = function (config) {
1073
+ if (config === void 0) { config = {}; }
1074
+ return {
1075
+ ngModule: FsHtmlEditorModule,
1076
+ providers: [
1077
+ { provide: FS_HTML_EDITOR_DEFAULT_CONFIG, useValue: config },
1078
+ {
1079
+ provide: FS_HTML_EDITOR_CONFIG,
1080
+ useFactory: FsHtmlEditorConfigFactory,
1081
+ deps: [FS_HTML_EDITOR_DEFAULT_CONFIG]
1082
+ }
1083
+ ]
1084
+ };
1085
+ };
1086
+ return FsHtmlEditorModule;
1087
+ }());
1088
+ FsHtmlEditorModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsHtmlEditorModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
1089
+ FsHtmlEditorModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsHtmlEditorModule, declarations: [FsHtmlEditorComponent], imports: [i4.CommonModule,
1090
+ i5.FsSkeletonModule,
1091
+ i2.FsLabelModule,
1092
+ FsHtmlRendererModule], exports: [FsHtmlEditorComponent] });
1093
+ FsHtmlEditorModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsHtmlEditorModule, imports: [[
1094
+ i4.CommonModule,
1095
+ i5.FsSkeletonModule,
1096
+ i2.FsLabelModule,
1097
+ FsHtmlRendererModule,
1098
+ ]] });
1099
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsHtmlEditorModule, decorators: [{
1100
+ type: i0.NgModule,
1101
+ args: [{
1102
+ imports: [
1103
+ i4.CommonModule,
1104
+ i5.FsSkeletonModule,
1105
+ i2.FsLabelModule,
1106
+ FsHtmlRendererModule,
1107
+ ],
1108
+ exports: [
1109
+ FsHtmlEditorComponent,
1110
+ ],
1111
+ declarations: [
1112
+ FsHtmlEditorComponent,
1113
+ ],
1114
+ }]
1115
+ }] });
1116
+ function FsHtmlEditorConfigFactory(config) {
1117
+ return Object.assign({ froalaPlugins: [
1118
+ "align" /* Align */,
1119
+ "colors" /* Colors */,
1120
+ "image" /* Image */,
1121
+ "link" /* Link */,
1122
+ "lists" /* Lists */,
1123
+ "paragraph_format" /* ParagraphFormat */,
1124
+ "quote" /* Quote */,
1125
+ "table" /* Table */,
1126
+ "url" /* Url */,
1127
+ "video" /* Video */,
1128
+ "draggable" /* Draggable */,
1129
+ "font_size" /* FontSize */,
1130
+ "line_height" /* LineHeight */,
1131
+ ] }, config);
1132
1132
  }
1133
1133
 
1134
- var Plugin = /** @class */ (function () {
1135
- function Plugin() {
1136
- }
1137
- Plugin.prototype.initialize = function () { };
1138
- Plugin.prototype.destroy = function () { };
1139
- return Plugin;
1134
+ var Plugin = /** @class */ (function () {
1135
+ function Plugin() {
1136
+ }
1137
+ Plugin.prototype.initialize = function () { };
1138
+ Plugin.prototype.destroy = function () { };
1139
+ return Plugin;
1140
1140
  }());
1141
1141
 
1142
- var MentionPlugin = /** @class */ (function (_super) {
1143
- __extends(MentionPlugin, _super);
1144
- function MentionPlugin(config) {
1145
- var _this = _super.call(this) || this;
1146
- _this.config = config;
1147
- _this._guid = common.guid();
1148
- _this.selected = function (event) {
1149
- if (_this.config.selected) {
1150
- if (MentionPlugin._currentGuid === _this._guid) {
1151
- _this.config.selected(event.detail.item.original);
1152
- }
1153
- }
1154
- };
1155
- _this.config = Object.assign(Object.assign({}, config), { buttons: [
1156
- {
1157
- name: config.name,
1158
- tooltip: config.tooltip,
1159
- svgPath: config.iconPath,
1160
- click: function (editor) {
1161
- _this._closeAll();
1162
- _this._tribute.showMenuForCollection(editor.el);
1163
- }
1164
- }
1165
- ] });
1166
- _this._tribute = new Tribute__default["default"]({
1167
- values: lodashEs.debounce(_this._loadValues.bind(_this), 200),
1168
- searchOpts: {
1169
- pre: '',
1170
- post: '',
1171
- skip: true
1172
- },
1173
- containerClass: "fs-html-editor-mention-container " + (_this.config.containerClass || ''),
1174
- itemClass: "fs-html-editor-mention-menu-item " + (_this.config.menuItemClass || ''),
1175
- trigger: _this.config.trigger,
1176
- allowSpaces: true,
1177
- menuItemTemplate: function (item) {
1178
- return _this.config.menuItemTemplate(item.original);
1179
- },
1180
- selectTemplate: function (item) {
1181
- var template = _this.config.selectedTemplate(item.original);
1182
- var p = document.createElement('p');
1183
- p.innerHTML = template;
1184
- var node = p.firstElementChild;
1185
- if (!node) {
1186
- node = document.createElement('span');
1187
- node.innerHTML = template;
1188
- }
1189
- node.setAttribute('contenteditable', 'false');
1190
- node.classList.add('fr-deletable');
1191
- return node.outerHTML;
1192
- },
1193
- });
1194
- MentionPlugin._tributes.push(_this._tribute);
1195
- return _this;
1196
- }
1197
- MentionPlugin.prototype.initialize = function () {
1198
- var _this = this;
1199
- this._tribute.attach(this.editor.el);
1200
- this.editor.events.on('keydown', function (e) {
1201
- if (e.key === 'Enter' && _this._tribute.isActive) {
1202
- return false;
1203
- }
1204
- }, true);
1205
- this.editor.el.addEventListener("tribute-replaced", this.selected);
1206
- };
1207
- MentionPlugin.prototype.destroy = function () {
1208
- this.editor.el.removeEventListener("tribute-replaced", this.selected);
1209
- };
1210
- MentionPlugin.prototype._closeAll = function () {
1211
- MentionPlugin._tributes.forEach(function (tribute) {
1212
- if (tribute.menu) {
1213
- tribute.hideMenu();
1214
- }
1215
- });
1216
- };
1217
- MentionPlugin.prototype._loadValues = function (keyword, cb) {
1218
- MentionPlugin._currentGuid = this._guid;
1219
- return this.config.fetch(keyword)
1220
- .subscribe(function (data) {
1221
- cb(data);
1222
- });
1223
- };
1224
- return MentionPlugin;
1225
- }(Plugin));
1226
- MentionPlugin._currentGuid = null;
1142
+ var MentionPlugin = /** @class */ (function (_super) {
1143
+ __extends(MentionPlugin, _super);
1144
+ function MentionPlugin(config) {
1145
+ var _this = _super.call(this) || this;
1146
+ _this.config = config;
1147
+ _this._guid = common.guid();
1148
+ _this.selected = function (event) {
1149
+ if (_this.config.selected) {
1150
+ if (MentionPlugin._currentGuid === _this._guid) {
1151
+ _this.config.selected(event.detail.item.original);
1152
+ }
1153
+ }
1154
+ };
1155
+ _this.config = Object.assign(Object.assign({}, config), { buttons: [
1156
+ {
1157
+ name: config.name,
1158
+ tooltip: config.tooltip,
1159
+ svgPath: config.iconPath,
1160
+ click: function (editor) {
1161
+ _this._closeAll();
1162
+ _this._tribute.showMenuForCollection(editor.el);
1163
+ }
1164
+ }
1165
+ ] });
1166
+ _this._tribute = new Tribute__default["default"]({
1167
+ values: lodashEs.debounce(_this._loadValues.bind(_this), 200),
1168
+ searchOpts: {
1169
+ pre: '',
1170
+ post: '',
1171
+ skip: true
1172
+ },
1173
+ containerClass: "fs-html-editor-mention-container " + (_this.config.containerClass || ''),
1174
+ itemClass: "fs-html-editor-mention-menu-item " + (_this.config.menuItemClass || ''),
1175
+ trigger: _this.config.trigger,
1176
+ allowSpaces: true,
1177
+ menuItemTemplate: function (item) {
1178
+ return _this.config.menuItemTemplate(item.original);
1179
+ },
1180
+ selectTemplate: function (item) {
1181
+ var template = _this.config.selectedTemplate(item.original);
1182
+ var p = document.createElement('p');
1183
+ p.innerHTML = template;
1184
+ var node = p.firstElementChild;
1185
+ if (!node) {
1186
+ node = document.createElement('span');
1187
+ node.innerHTML = template;
1188
+ }
1189
+ node.setAttribute('contenteditable', 'false');
1190
+ node.classList.add('fr-deletable');
1191
+ return node.outerHTML;
1192
+ },
1193
+ });
1194
+ MentionPlugin._tributes.push(_this._tribute);
1195
+ return _this;
1196
+ }
1197
+ MentionPlugin.prototype.initialize = function () {
1198
+ var _this = this;
1199
+ this._tribute.attach(this.editor.el);
1200
+ this.editor.events.on('keydown', function (e) {
1201
+ if (e.key === 'Enter' && _this._tribute.isActive) {
1202
+ return false;
1203
+ }
1204
+ }, true);
1205
+ this.editor.el.addEventListener("tribute-replaced", this.selected);
1206
+ };
1207
+ MentionPlugin.prototype.destroy = function () {
1208
+ this.editor.el.removeEventListener("tribute-replaced", this.selected);
1209
+ };
1210
+ MentionPlugin.prototype._closeAll = function () {
1211
+ MentionPlugin._tributes.forEach(function (tribute) {
1212
+ if (tribute.menu) {
1213
+ tribute.hideMenu();
1214
+ }
1215
+ });
1216
+ };
1217
+ MentionPlugin.prototype._loadValues = function (keyword, cb) {
1218
+ MentionPlugin._currentGuid = this._guid;
1219
+ return this.config.fetch(keyword)
1220
+ .subscribe(function (data) {
1221
+ cb(data);
1222
+ });
1223
+ };
1224
+ return MentionPlugin;
1225
+ }(Plugin));
1226
+ MentionPlugin._currentGuid = null;
1227
1227
  MentionPlugin._tributes = [];
1228
1228
 
1229
- var ChecklistPlugin = /** @class */ (function (_super) {
1230
- __extends(ChecklistPlugin, _super);
1231
- function ChecklistPlugin(config) {
1232
- if (config === void 0) { config = { name: 'checklist' }; }
1233
- var _this = _super.call(this) || this;
1234
- _this.config = config;
1235
- _this.config = Object.assign(Object.assign({}, config), { name: 'checklist', buttons: [
1236
- {
1237
- name: 'checklist',
1238
- 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',
1239
- click: function (editor) {
1240
- editor.html.insert('<ul class="checklist"><li></li></ul>');
1241
- }
1242
- }
1243
- ] });
1244
- return _this;
1245
- }
1246
- ChecklistPlugin.prototype.initialize = function () {
1247
- this.editor.events.on('click', function (e) {
1248
- var li = e.target;
1249
- if (li.nodeName === 'LI' && e.offsetX < 0) {
1250
- var items = __spreadArray([li], __read(li.querySelectorAll('li')));
1251
- if (li.classList.contains('checked')) {
1252
- items.forEach(function (item) {
1253
- item.classList.remove('checked');
1254
- });
1255
- }
1256
- else {
1257
- items.forEach(function (item) {
1258
- item.classList.add('checked');
1259
- });
1260
- }
1261
- }
1262
- }, false);
1263
- };
1264
- return ChecklistPlugin;
1229
+ var ChecklistPlugin = /** @class */ (function (_super) {
1230
+ __extends(ChecklistPlugin, _super);
1231
+ function ChecklistPlugin(config) {
1232
+ if (config === void 0) { config = { name: 'checklist' }; }
1233
+ var _this = _super.call(this) || this;
1234
+ _this.config = config;
1235
+ _this.config = Object.assign(Object.assign({}, config), { name: 'checklist', buttons: [
1236
+ {
1237
+ name: 'checklist',
1238
+ 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',
1239
+ click: function (editor) {
1240
+ editor.html.insert('<ul class="checklist"><li></li></ul>');
1241
+ }
1242
+ }
1243
+ ] });
1244
+ return _this;
1245
+ }
1246
+ ChecklistPlugin.prototype.initialize = function () {
1247
+ this.editor.events.on('click', function (e) {
1248
+ var li = e.target;
1249
+ if (li.nodeName === 'LI' && e.offsetX < 0) {
1250
+ var items = __spreadArray([li], __read(li.querySelectorAll('li')));
1251
+ if (li.classList.contains('checked')) {
1252
+ items.forEach(function (item) {
1253
+ item.classList.remove('checked');
1254
+ });
1255
+ }
1256
+ else {
1257
+ items.forEach(function (item) {
1258
+ item.classList.add('checked');
1259
+ });
1260
+ }
1261
+ }
1262
+ }, false);
1263
+ };
1264
+ return ChecklistPlugin;
1265
1265
  }(Plugin));
1266
1266
 
1267
- var CodePlugin = /** @class */ (function (_super) {
1268
- __extends(CodePlugin, _super);
1269
- function CodePlugin(config) {
1270
- if (config === void 0) { config = { name: 'code' }; }
1271
- var _this = _super.call(this) || this;
1272
- _this.config = config;
1273
- _this.config = Object.assign(Object.assign({}, config), { name: 'code', buttons: [
1274
- {
1275
- name: 'code',
1276
- 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',
1277
- click: function (editor) {
1278
- var node = editor.selection.get();
1279
- var codeEl = _this._getCodeEl(node.baseNode);
1280
- if (codeEl) {
1281
- codeEl.classList.remove('code');
1282
- }
1283
- else {
1284
- editor.html.insert('<p class="code">' + editor.selection.get().toString().replace(/\n{1,}/g, '<br>') + '</p>');
1285
- }
1286
- }
1287
- }
1288
- ] });
1289
- return _this;
1290
- }
1291
- CodePlugin.prototype.initialize = function () {
1292
- var _this = this;
1293
- this.editor.events.on('keydown', function (e) {
1294
- if (e.keyCode === 13) {
1295
- var selection = _this.editor.selection.get();
1296
- if (selection && _this._getCodeEl(selection.baseNode)) {
1297
- e.preventDefault();
1298
- e.stopPropagation();
1299
- e.stopImmediatePropagation();
1300
- var br = '<br>';
1301
- var base = selection.baseNode;
1302
- if (base.nodeName === '#text' && selection.baseOffset === base.length) {
1303
- if (!(base.nextSibling && base.nextSibling.nodeName === 'BR')) {
1304
- br += '<br>';
1305
- }
1306
- }
1307
- else {
1308
- var el = Array.from(base.childNodes).splice(selection.baseOffset - 1, 1).pop();
1309
- if (el && el.nodeName !== 'BR') {
1310
- br += '<br>';
1311
- }
1312
- }
1313
- _this.editor.html.insert(br);
1314
- return false;
1315
- }
1316
- }
1317
- }, true);
1318
- };
1319
- CodePlugin.prototype.destroy = function () { };
1320
- CodePlugin.prototype._getCodeEl = function (el) {
1321
- if (el) {
1322
- if (el.classList && el.classList.contains('code')) {
1323
- return el;
1324
- }
1325
- if (el.parentElement) {
1326
- return this._getCodeEl(el.parentElement);
1327
- }
1328
- }
1329
- return null;
1330
- };
1331
- return CodePlugin;
1267
+ var CodePlugin = /** @class */ (function (_super) {
1268
+ __extends(CodePlugin, _super);
1269
+ function CodePlugin(config) {
1270
+ if (config === void 0) { config = { name: 'code' }; }
1271
+ var _this = _super.call(this) || this;
1272
+ _this.config = config;
1273
+ _this.config = Object.assign(Object.assign({}, config), { name: 'code', buttons: [
1274
+ {
1275
+ name: 'code',
1276
+ 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',
1277
+ click: function (editor) {
1278
+ var node = editor.selection.get();
1279
+ var codeEl = _this._getCodeEl(node.baseNode);
1280
+ if (codeEl) {
1281
+ codeEl.classList.remove('code');
1282
+ }
1283
+ else {
1284
+ editor.html.insert('<p class="code">' + editor.selection.get().toString().replace(/\n{1,}/g, '<br>') + '</p>');
1285
+ }
1286
+ }
1287
+ }
1288
+ ] });
1289
+ return _this;
1290
+ }
1291
+ CodePlugin.prototype.initialize = function () {
1292
+ var _this = this;
1293
+ this.editor.events.on('keydown', function (e) {
1294
+ if (e.keyCode === 13) {
1295
+ var selection = _this.editor.selection.get();
1296
+ if (selection && _this._getCodeEl(selection.baseNode)) {
1297
+ e.preventDefault();
1298
+ e.stopPropagation();
1299
+ e.stopImmediatePropagation();
1300
+ var br = '<br>';
1301
+ var base = selection.baseNode;
1302
+ if (base.nodeName === '#text' && selection.baseOffset === base.length) {
1303
+ if (!(base.nextSibling && base.nextSibling.nodeName === 'BR')) {
1304
+ br += '<br>';
1305
+ }
1306
+ }
1307
+ else {
1308
+ var el = Array.from(base.childNodes).splice(selection.baseOffset - 1, 1).pop();
1309
+ if (el && el.nodeName !== 'BR') {
1310
+ br += '<br>';
1311
+ }
1312
+ }
1313
+ _this.editor.html.insert(br);
1314
+ return false;
1315
+ }
1316
+ }
1317
+ }, true);
1318
+ };
1319
+ CodePlugin.prototype.destroy = function () { };
1320
+ CodePlugin.prototype._getCodeEl = function (el) {
1321
+ if (el) {
1322
+ if (el.classList && el.classList.contains('code')) {
1323
+ return el;
1324
+ }
1325
+ if (el.parentElement) {
1326
+ return this._getCodeEl(el.parentElement);
1327
+ }
1328
+ }
1329
+ return null;
1330
+ };
1331
+ return CodePlugin;
1332
1332
  }(Plugin));
1333
1333
 
1334
- var ScreenRecordPlugin = /** @class */ (function (_super) {
1335
- __extends(ScreenRecordPlugin, _super);
1336
- function ScreenRecordPlugin(config) {
1337
- if (config === void 0) { config = {}; }
1338
- var _this = _super.call(this) || this;
1339
- _this.config = config;
1340
- _this.config = Object.assign(Object.assign({}, config), { name: config.name || 'screenRecord', buttons: [
1341
- {
1342
- name: 'screenRecord',
1343
- 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",
1344
- tooltip: 'Screen Record',
1345
- click: function (editor) {
1346
- navigator.mediaDevices.getDisplayMedia({ video: true })
1347
- .then(function (stream) {
1348
- var chunks = [];
1349
- var options = { mimeType: 'video/webm; codecs=vp9' };
1350
- var mediaRecorder = new MediaRecorder(stream, options);
1351
- stream.addEventListener('inactive', function (e) {
1352
- mediaRecorder.stop();
1353
- mediaRecorder = null;
1354
- stream.getTracks().forEach(function (track) { return track.stop(); });
1355
- stream = null;
1356
- var blob = new Blob(chunks, { type: 'video/webm' });
1357
- config.upload(blob)
1358
- .subscribe(function (url) {
1359
- 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>");
1360
- });
1361
- });
1362
- mediaRecorder.addEventListener('dataavailable', function (event) {
1363
- if (event.data && event.data.size > 0) {
1364
- chunks.push(event.data);
1365
- }
1366
- });
1367
- mediaRecorder.start(10);
1368
- })
1369
- .catch(function (e) { });
1370
- }
1371
- }
1372
- ] });
1373
- return _this;
1374
- }
1375
- ScreenRecordPlugin.prototype.initialize = function () {
1376
- return __awaiter(this, void 0, void 0, function () {
1377
- var FroalaEditor;
1378
- var _this = this;
1379
- return __generator(this, function (_a) {
1380
- FroalaEditor = window.FroalaEditor;
1381
- this.editor.events.on('mouseup', function (e) {
1382
- var el = _this._getEl(e.target);
1383
- if (el) {
1384
- _this.editor.popups.hideAll();
1385
- _this._activeEl = el;
1386
- _this._showPopup(el);
1387
- }
1388
- });
1389
- FroalaEditor.POPUP_TEMPLATES["screenRecordPlugin.popup"] = '[_BUTTONS_]';
1390
- FroalaEditor.DefineIcon('popupClose', { NAME: 'trash', SVG_KEY: 'remove' });
1391
- FroalaEditor.RegisterCommand('popupClose', {
1392
- title: 'Remove',
1393
- undo: false,
1394
- focus: false,
1395
- callback: function () {
1396
- if (_this._activeEl) {
1397
- _this._activeEl.remove();
1398
- }
1399
- }
1400
- });
1401
- return [2 /*return*/];
1402
- });
1403
- });
1404
- };
1405
- ScreenRecordPlugin.prototype._createPopup = function () {
1406
- var template = {
1407
- buttons: "<div class=\"fr-buttons\">" + this.editor.button.buildList(['popupClose']) + "</div>",
1408
- };
1409
- return this.editor.popups.create('screenRecordPlugin.popup', template);
1410
- };
1411
- ScreenRecordPlugin.prototype._showPopup = function (el) {
1412
- var $popup = this.editor.popups.get('screenRecordPlugin.popup');
1413
- if (!$popup) {
1414
- $popup = this._createPopup();
1415
- }
1416
- this.editor.popups.setContainer('screenRecordPlugin.popup', this.editor.$(el));
1417
- var left = el.offsetLeft + el.offsetWidth / 2;
1418
- this.editor.popups.show('screenRecordPlugin.popup', left, null);
1419
- };
1420
- ScreenRecordPlugin.prototype._getEl = function (el) {
1421
- if (el && el.classList) {
1422
- if (el.classList.contains('fr-screen-record'))
1423
- return el;
1424
- return this._getEl(el.parentNode);
1425
- }
1426
- };
1427
- return ScreenRecordPlugin;
1334
+ var ScreenRecordPlugin = /** @class */ (function (_super) {
1335
+ __extends(ScreenRecordPlugin, _super);
1336
+ function ScreenRecordPlugin(config) {
1337
+ if (config === void 0) { config = {}; }
1338
+ var _this = _super.call(this) || this;
1339
+ _this.config = config;
1340
+ _this.config = Object.assign(Object.assign({}, config), { name: config.name || 'screenRecord', buttons: [
1341
+ {
1342
+ name: 'screenRecord',
1343
+ 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",
1344
+ tooltip: 'Screen Record',
1345
+ click: function (editor) {
1346
+ navigator.mediaDevices.getDisplayMedia({ video: true })
1347
+ .then(function (stream) {
1348
+ var chunks = [];
1349
+ var options = { mimeType: 'video/webm; codecs=vp9' };
1350
+ var mediaRecorder = new MediaRecorder(stream, options);
1351
+ stream.addEventListener('inactive', function (e) {
1352
+ mediaRecorder.stop();
1353
+ mediaRecorder = null;
1354
+ stream.getTracks().forEach(function (track) { return track.stop(); });
1355
+ stream = null;
1356
+ var blob = new Blob(chunks, { type: 'video/webm' });
1357
+ config.upload(blob)
1358
+ .subscribe(function (url) {
1359
+ 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>");
1360
+ });
1361
+ });
1362
+ mediaRecorder.addEventListener('dataavailable', function (event) {
1363
+ if (event.data && event.data.size > 0) {
1364
+ chunks.push(event.data);
1365
+ }
1366
+ });
1367
+ mediaRecorder.start(10);
1368
+ })
1369
+ .catch(function (e) { });
1370
+ }
1371
+ }
1372
+ ] });
1373
+ return _this;
1374
+ }
1375
+ ScreenRecordPlugin.prototype.initialize = function () {
1376
+ return __awaiter(this, void 0, void 0, function () {
1377
+ var FroalaEditor;
1378
+ var _this = this;
1379
+ return __generator(this, function (_a) {
1380
+ FroalaEditor = window.FroalaEditor;
1381
+ this.editor.events.on('mouseup', function (e) {
1382
+ var el = _this._getEl(e.target);
1383
+ if (el) {
1384
+ _this.editor.popups.hideAll();
1385
+ _this._activeEl = el;
1386
+ _this._showPopup(el);
1387
+ }
1388
+ });
1389
+ FroalaEditor.POPUP_TEMPLATES["screenRecordPlugin.popup"] = '[_BUTTONS_]';
1390
+ FroalaEditor.DefineIcon('popupClose', { NAME: 'trash', SVG_KEY: 'remove' });
1391
+ FroalaEditor.RegisterCommand('popupClose', {
1392
+ title: 'Remove',
1393
+ undo: false,
1394
+ focus: false,
1395
+ callback: function () {
1396
+ if (_this._activeEl) {
1397
+ _this._activeEl.remove();
1398
+ }
1399
+ }
1400
+ });
1401
+ return [2 /*return*/];
1402
+ });
1403
+ });
1404
+ };
1405
+ ScreenRecordPlugin.prototype._createPopup = function () {
1406
+ var template = {
1407
+ buttons: "<div class=\"fr-buttons\">" + this.editor.button.buildList(['popupClose']) + "</div>",
1408
+ };
1409
+ return this.editor.popups.create('screenRecordPlugin.popup', template);
1410
+ };
1411
+ ScreenRecordPlugin.prototype._showPopup = function (el) {
1412
+ var $popup = this.editor.popups.get('screenRecordPlugin.popup');
1413
+ if (!$popup) {
1414
+ $popup = this._createPopup();
1415
+ }
1416
+ this.editor.popups.setContainer('screenRecordPlugin.popup', this.editor.$(el));
1417
+ var left = el.offsetLeft + el.offsetWidth / 2;
1418
+ this.editor.popups.show('screenRecordPlugin.popup', left, null);
1419
+ };
1420
+ ScreenRecordPlugin.prototype._getEl = function (el) {
1421
+ if (el && el.classList) {
1422
+ if (el.classList.contains('fr-screen-record'))
1423
+ return el;
1424
+ return this._getEl(el.parentNode);
1425
+ }
1426
+ };
1427
+ return ScreenRecordPlugin;
1428
1428
  }(Plugin));
1429
1429
 
1430
- var RealtimePlugin = /** @class */ (function (_super) {
1431
- __extends(RealtimePlugin, _super);
1432
- function RealtimePlugin(config) {
1433
- if (config === void 0) { config = { name: 'realtime' }; }
1434
- var _this = _super.call(this) || this;
1435
- _this.config = config;
1436
- _this.config = Object.assign(Object.assign({}, config), { name: 'realtime' });
1437
- return _this;
1438
- }
1439
- RealtimePlugin.prototype.initialize = function () {
1440
- this.editor.events.on('click', function (e) {
1441
- }, false);
1442
- };
1443
- return RealtimePlugin;
1430
+ var RealtimePlugin = /** @class */ (function (_super) {
1431
+ __extends(RealtimePlugin, _super);
1432
+ function RealtimePlugin(config) {
1433
+ if (config === void 0) { config = { name: 'realtime' }; }
1434
+ var _this = _super.call(this) || this;
1435
+ _this.config = config;
1436
+ _this.config = Object.assign(Object.assign({}, config), { name: 'realtime' });
1437
+ return _this;
1438
+ }
1439
+ RealtimePlugin.prototype.initialize = function () {
1440
+ this.editor.events.on('click', function (e) {
1441
+ }, false);
1442
+ };
1443
+ return RealtimePlugin;
1444
1444
  }(Plugin));
1445
1445
 
1446
- /**
1447
- * Generated bundle index. Do not edit.
1446
+ /**
1447
+ * Generated bundle index. Do not edit.
1448
1448
  */
1449
1449
 
1450
1450
  exports.ChecklistPlugin = ChecklistPlugin;