@firestitch/html-editor 9.5.9 → 12.0.2

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 (62) hide show
  1. package/app/components/html-editor/html-editor.component.d.ts +9 -5
  2. package/app/components/html-renderer/html-renderer.component.d.ts +4 -1
  3. package/app/enums/default-plugin.enum.d.ts +3 -2
  4. package/app/fs-html-editor.module.d.ts +20 -3
  5. package/app/interfaces/html-editor-config.d.ts +12 -3
  6. package/app/services/froala-loader.service.d.ts +8 -5
  7. package/bundles/firestitch-html-editor.umd.js +421 -268
  8. package/bundles/firestitch-html-editor.umd.js.map +1 -1
  9. package/esm2015/app/classes/plugin.js +1 -1
  10. package/esm2015/app/components/html-editor/html-editor.component.js +106 -62
  11. package/esm2015/app/components/html-renderer/html-renderer.component.js +20 -25
  12. package/esm2015/app/consts/paragraph-buttons.const.js +1 -1
  13. package/esm2015/app/consts/rich-buttons.const.js +1 -1
  14. package/esm2015/app/consts/text-buttons.const.js +1 -1
  15. package/esm2015/app/enums/default-plugin.enum.js +2 -1
  16. package/esm2015/app/fs-html-editor.module.js +30 -22
  17. package/esm2015/app/injects/config.inject.js +1 -1
  18. package/esm2015/app/interfaces/html-editor-config.js +2 -1
  19. package/esm2015/app/interfaces/plugin-button.js +2 -1
  20. package/esm2015/app/interfaces/plugin-config.js +2 -1
  21. package/esm2015/app/plugins/checklist.plugin.js +1 -1
  22. package/esm2015/app/plugins/code.plugin.js +1 -1
  23. package/esm2015/app/plugins/configs/mention-plugin.config.js +2 -1
  24. package/esm2015/app/plugins/configs/screen-record-plugin.config.js +2 -1
  25. package/esm2015/app/plugins/mention.plugin.js +1 -1
  26. package/esm2015/app/plugins/screen-record.plugin.js +1 -1
  27. package/esm2015/app/services/froala-loader.service.js +23 -24
  28. package/esm2015/app/utils/loader.js +2 -1
  29. package/esm2015/firestitch-html-editor.js +1 -5
  30. package/esm2015/public_api.js +1 -1
  31. package/fesm2015/firestitch-html-editor.js +182 -131
  32. package/fesm2015/firestitch-html-editor.js.map +1 -1
  33. package/firestitch-html-editor.d.ts +1 -5
  34. package/package.json +4 -7
  35. package/styles.scss +3 -2
  36. package/bundles/firestitch-html-editor.umd.min.js +0 -17
  37. package/bundles/firestitch-html-editor.umd.min.js.map +0 -1
  38. package/esm5/app/classes/plugin.js +0 -9
  39. package/esm5/app/components/html-editor/html-editor.component.js +0 -471
  40. package/esm5/app/components/html-renderer/html-renderer.component.js +0 -39
  41. package/esm5/app/consts/paragraph-buttons.const.js +0 -9
  42. package/esm5/app/consts/rich-buttons.const.js +0 -7
  43. package/esm5/app/consts/text-buttons.const.js +0 -19
  44. package/esm5/app/enums/default-plugin.enum.js +0 -1
  45. package/esm5/app/fs-html-editor.module.js +0 -62
  46. package/esm5/app/injects/config.inject.js +0 -4
  47. package/esm5/app/interfaces/html-editor-config.js +0 -1
  48. package/esm5/app/interfaces/plugin-button.js +0 -1
  49. package/esm5/app/interfaces/plugin-config.js +0 -1
  50. package/esm5/app/plugins/checklist.plugin.js +0 -41
  51. package/esm5/app/plugins/code.plugin.js +0 -70
  52. package/esm5/app/plugins/configs/mention-plugin.config.js +0 -1
  53. package/esm5/app/plugins/configs/screen-record-plugin.config.js +0 -1
  54. package/esm5/app/plugins/mention.plugin.js +0 -93
  55. package/esm5/app/plugins/screen-record.plugin.js +0 -106
  56. package/esm5/app/services/froala-loader.service.js +0 -96
  57. package/esm5/app/utils/loader.js +0 -83
  58. package/esm5/firestitch-html-editor.js +0 -9
  59. package/esm5/public_api.js +0 -12
  60. package/fesm5/firestitch-html-editor.js +0 -1074
  61. package/fesm5/firestitch-html-editor.js.map +0 -1
  62. package/firestitch-html-editor.metadata.json +0 -1
@@ -1,10 +1,34 @@
1
1
  (function (global, factory) {
2
2
  typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/common'), require('@firestitch/skeleton'), require('@angular/forms'), require('@firestitch/file'), require('rxjs'), require('rxjs/operators'), require('lodash-es'), require('@angular/platform-browser'), require('tributejs'), require('@firestitch/common')) :
3
3
  typeof define === 'function' && define.amd ? define('@firestitch/html-editor', ['exports', '@angular/core', '@angular/common', '@firestitch/skeleton', '@angular/forms', '@firestitch/file', 'rxjs', 'rxjs/operators', 'lodash-es', '@angular/platform-browser', 'tributejs', '@firestitch/common'], factory) :
4
- (global = global || self, factory((global.firestitch = global.firestitch || {}, global.firestitch['html-editor'] = {}), global.ng.core, global.ng.common, global.skeleton, global.ng.forms, global.file, global.rxjs, global.rxjs.operators, global.lodashEs, global.ng.platformBrowser, global.Tribute, global.common$1));
5
- }(this, (function (exports, core, common, skeleton, forms, file, rxjs, operators, lodashEs, platformBrowser, Tribute, common$1) { 'use strict';
4
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.firestitch = global.firestitch || {}, global.firestitch["html-editor"] = {}), global.ng.core, global.ng.common, global.i4, global.ng.forms, global.file, global.rxjs, global.rxjs.operators, global.lodashEs, global.ng.platformBrowser, global.Tribute, global.common));
5
+ })(this, (function (exports, i0, i3, i4, forms, file, rxjs, operators, lodashEs, i1, Tribute, common) { 'use strict';
6
6
 
7
- Tribute = Tribute && Object.prototype.hasOwnProperty.call(Tribute, 'default') ? Tribute['default'] : Tribute;
7
+ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
8
+
9
+ function _interopNamespace(e) {
10
+ if (e && e.__esModule) return e;
11
+ var n = Object.create(null);
12
+ if (e) {
13
+ Object.keys(e).forEach(function (k) {
14
+ if (k !== 'default') {
15
+ var d = Object.getOwnPropertyDescriptor(e, k);
16
+ Object.defineProperty(n, k, d.get ? d : {
17
+ enumerable: true,
18
+ get: function () { return e[k]; }
19
+ });
20
+ }
21
+ });
22
+ }
23
+ n["default"] = e;
24
+ return Object.freeze(n);
25
+ }
26
+
27
+ var i0__namespace = /*#__PURE__*/_interopNamespace(i0);
28
+ var i3__namespace = /*#__PURE__*/_interopNamespace(i3);
29
+ var i4__namespace = /*#__PURE__*/_interopNamespace(i4);
30
+ var i1__namespace = /*#__PURE__*/_interopNamespace(i1);
31
+ var Tribute__default = /*#__PURE__*/_interopDefaultLegacy(Tribute);
8
32
 
9
33
  /*! *****************************************************************************
10
34
  Copyright (c) Microsoft Corporation.
@@ -21,14 +45,14 @@
21
45
  PERFORMANCE OF THIS SOFTWARE.
22
46
  ***************************************************************************** */
23
47
  /* global Reflect, Promise */
24
-
25
- var extendStatics = function(d, b) {
48
+ var extendStatics = function (d, b) {
26
49
  extendStatics = Object.setPrototypeOf ||
27
50
  ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
28
- function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
51
+ function (d, b) { for (var p in b)
52
+ if (Object.prototype.hasOwnProperty.call(b, p))
53
+ d[p] = b[p]; };
29
54
  return extendStatics(d, b);
30
55
  };
31
-
32
56
  function __extends(d, b) {
33
57
  if (typeof b !== "function" && b !== null)
34
58
  throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
@@ -36,22 +60,23 @@
36
60
  function __() { this.constructor = d; }
37
61
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
38
62
  }
39
-
40
- var __assign = function() {
63
+ var __assign = function () {
41
64
  __assign = Object.assign || function __assign(t) {
42
65
  for (var s, i = 1, n = arguments.length; i < n; i++) {
43
66
  s = arguments[i];
44
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
67
+ for (var p in s)
68
+ if (Object.prototype.hasOwnProperty.call(s, p))
69
+ t[p] = s[p];
45
70
  }
46
71
  return t;
47
72
  };
48
73
  return __assign.apply(this, arguments);
49
74
  };
50
-
51
75
  function __rest(s, e) {
52
76
  var t = {};
53
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
54
- t[p] = s[p];
77
+ for (var p in s)
78
+ if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
79
+ t[p] = s[p];
55
80
  if (s != null && typeof Object.getOwnPropertySymbols === "function")
56
81
  for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
57
82
  if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
@@ -59,190 +84,267 @@
59
84
  }
60
85
  return t;
61
86
  }
62
-
63
87
  function __decorate(decorators, target, key, desc) {
64
88
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
65
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
66
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
89
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
90
+ r = Reflect.decorate(decorators, target, key, desc);
91
+ else
92
+ for (var i = decorators.length - 1; i >= 0; i--)
93
+ if (d = decorators[i])
94
+ r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
67
95
  return c > 3 && r && Object.defineProperty(target, key, r), r;
68
96
  }
69
-
70
97
  function __param(paramIndex, decorator) {
71
- return function (target, key) { decorator(target, key, paramIndex); }
98
+ return function (target, key) { decorator(target, key, paramIndex); };
72
99
  }
73
-
74
100
  function __metadata(metadataKey, metadataValue) {
75
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
101
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
102
+ return Reflect.metadata(metadataKey, metadataValue);
76
103
  }
77
-
78
104
  function __awaiter(thisArg, _arguments, P, generator) {
79
105
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
80
106
  return new (P || (P = Promise))(function (resolve, reject) {
81
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
82
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
107
+ function fulfilled(value) { try {
108
+ step(generator.next(value));
109
+ }
110
+ catch (e) {
111
+ reject(e);
112
+ } }
113
+ function rejected(value) { try {
114
+ step(generator["throw"](value));
115
+ }
116
+ catch (e) {
117
+ reject(e);
118
+ } }
83
119
  function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
84
120
  step((generator = generator.apply(thisArg, _arguments || [])).next());
85
121
  });
86
122
  }
87
-
88
123
  function __generator(thisArg, body) {
89
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
90
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
124
+ var _ = { label: 0, sent: function () { if (t[0] & 1)
125
+ throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
126
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function () { return this; }), g;
91
127
  function verb(n) { return function (v) { return step([n, v]); }; }
92
128
  function step(op) {
93
- if (f) throw new TypeError("Generator is already executing.");
94
- while (_) try {
95
- 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) return t;
96
- if (y = 0, t) op = [op[0] & 2, t.value];
97
- switch (op[0]) {
98
- case 0: case 1: t = op; break;
99
- case 4: _.label++; return { value: op[1], done: false };
100
- case 5: _.label++; y = op[1]; op = [0]; continue;
101
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
102
- default:
103
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
104
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
105
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
106
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
107
- if (t[2]) _.ops.pop();
108
- _.trys.pop(); continue;
129
+ if (f)
130
+ throw new TypeError("Generator is already executing.");
131
+ while (_)
132
+ try {
133
+ 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)
134
+ return t;
135
+ if (y = 0, t)
136
+ op = [op[0] & 2, t.value];
137
+ switch (op[0]) {
138
+ case 0:
139
+ case 1:
140
+ t = op;
141
+ break;
142
+ case 4:
143
+ _.label++;
144
+ return { value: op[1], done: false };
145
+ case 5:
146
+ _.label++;
147
+ y = op[1];
148
+ op = [0];
149
+ continue;
150
+ case 7:
151
+ op = _.ops.pop();
152
+ _.trys.pop();
153
+ continue;
154
+ default:
155
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
156
+ _ = 0;
157
+ continue;
158
+ }
159
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) {
160
+ _.label = op[1];
161
+ break;
162
+ }
163
+ if (op[0] === 6 && _.label < t[1]) {
164
+ _.label = t[1];
165
+ t = op;
166
+ break;
167
+ }
168
+ if (t && _.label < t[2]) {
169
+ _.label = t[2];
170
+ _.ops.push(op);
171
+ break;
172
+ }
173
+ if (t[2])
174
+ _.ops.pop();
175
+ _.trys.pop();
176
+ continue;
177
+ }
178
+ op = body.call(thisArg, _);
179
+ }
180
+ catch (e) {
181
+ op = [6, e];
182
+ y = 0;
183
+ }
184
+ finally {
185
+ f = t = 0;
109
186
  }
110
- op = body.call(thisArg, _);
111
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
112
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
187
+ if (op[0] & 5)
188
+ throw op[1];
189
+ return { value: op[0] ? op[1] : void 0, done: true };
113
190
  }
114
191
  }
115
-
116
- var __createBinding = Object.create ? (function(o, m, k, k2) {
117
- if (k2 === undefined) k2 = k;
118
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
119
- }) : (function(o, m, k, k2) {
120
- if (k2 === undefined) k2 = k;
192
+ var __createBinding = Object.create ? (function (o, m, k, k2) {
193
+ if (k2 === undefined)
194
+ k2 = k;
195
+ Object.defineProperty(o, k2, { enumerable: true, get: function () { return m[k]; } });
196
+ }) : (function (o, m, k, k2) {
197
+ if (k2 === undefined)
198
+ k2 = k;
121
199
  o[k2] = m[k];
122
200
  });
123
-
124
201
  function __exportStar(m, o) {
125
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);
202
+ for (var p in m)
203
+ if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p))
204
+ __createBinding(o, m, p);
126
205
  }
127
-
128
206
  function __values(o) {
129
207
  var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
130
- if (m) return m.call(o);
131
- if (o && typeof o.length === "number") return {
132
- next: function () {
133
- if (o && i >= o.length) o = void 0;
134
- return { value: o && o[i++], done: !o };
135
- }
136
- };
208
+ if (m)
209
+ return m.call(o);
210
+ if (o && typeof o.length === "number")
211
+ return {
212
+ next: function () {
213
+ if (o && i >= o.length)
214
+ o = void 0;
215
+ return { value: o && o[i++], done: !o };
216
+ }
217
+ };
137
218
  throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
138
219
  }
139
-
140
220
  function __read(o, n) {
141
221
  var m = typeof Symbol === "function" && o[Symbol.iterator];
142
- if (!m) return o;
222
+ if (!m)
223
+ return o;
143
224
  var i = m.call(o), r, ar = [], e;
144
225
  try {
145
- while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
226
+ while ((n === void 0 || n-- > 0) && !(r = i.next()).done)
227
+ ar.push(r.value);
228
+ }
229
+ catch (error) {
230
+ e = { error: error };
146
231
  }
147
- catch (error) { e = { error: error }; }
148
232
  finally {
149
233
  try {
150
- if (r && !r.done && (m = i["return"])) m.call(i);
234
+ if (r && !r.done && (m = i["return"]))
235
+ m.call(i);
236
+ }
237
+ finally {
238
+ if (e)
239
+ throw e.error;
151
240
  }
152
- finally { if (e) throw e.error; }
153
241
  }
154
242
  return ar;
155
243
  }
156
-
157
244
  /** @deprecated */
158
245
  function __spread() {
159
246
  for (var ar = [], i = 0; i < arguments.length; i++)
160
247
  ar = ar.concat(__read(arguments[i]));
161
248
  return ar;
162
249
  }
163
-
164
250
  /** @deprecated */
165
251
  function __spreadArrays() {
166
- for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
252
+ for (var s = 0, i = 0, il = arguments.length; i < il; i++)
253
+ s += arguments[i].length;
167
254
  for (var r = Array(s), k = 0, i = 0; i < il; i++)
168
255
  for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
169
256
  r[k] = a[j];
170
257
  return r;
171
258
  }
172
-
173
259
  function __spreadArray(to, from, pack) {
174
- if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
175
- if (ar || !(i in from)) {
176
- if (!ar) ar = Array.prototype.slice.call(from, 0, i);
177
- ar[i] = from[i];
260
+ if (pack || arguments.length === 2)
261
+ for (var i = 0, l = from.length, ar; i < l; i++) {
262
+ if (ar || !(i in from)) {
263
+ if (!ar)
264
+ ar = Array.prototype.slice.call(from, 0, i);
265
+ ar[i] = from[i];
266
+ }
178
267
  }
179
- }
180
268
  return to.concat(ar || Array.prototype.slice.call(from));
181
269
  }
182
-
183
270
  function __await(v) {
184
271
  return this instanceof __await ? (this.v = v, this) : new __await(v);
185
272
  }
186
-
187
273
  function __asyncGenerator(thisArg, _arguments, generator) {
188
- if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
274
+ if (!Symbol.asyncIterator)
275
+ throw new TypeError("Symbol.asyncIterator is not defined.");
189
276
  var g = generator.apply(thisArg, _arguments || []), i, q = [];
190
277
  return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
191
- function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
192
- function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
278
+ function verb(n) { if (g[n])
279
+ i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
280
+ function resume(n, v) { try {
281
+ step(g[n](v));
282
+ }
283
+ catch (e) {
284
+ settle(q[0][3], e);
285
+ } }
193
286
  function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
194
287
  function fulfill(value) { resume("next", value); }
195
288
  function reject(value) { resume("throw", value); }
196
- function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
289
+ function settle(f, v) { if (f(v), q.shift(), q.length)
290
+ resume(q[0][0], q[0][1]); }
197
291
  }
198
-
199
292
  function __asyncDelegator(o) {
200
293
  var i, p;
201
294
  return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
202
295
  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; }
203
296
  }
204
-
205
297
  function __asyncValues(o) {
206
- if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
298
+ if (!Symbol.asyncIterator)
299
+ throw new TypeError("Symbol.asyncIterator is not defined.");
207
300
  var m = o[Symbol.asyncIterator], i;
208
301
  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);
209
302
  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); }); }; }
210
- function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
303
+ function settle(resolve, reject, d, v) { Promise.resolve(v).then(function (v) { resolve({ value: v, done: d }); }, reject); }
211
304
  }
212
-
213
305
  function __makeTemplateObject(cooked, raw) {
214
- if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
306
+ if (Object.defineProperty) {
307
+ Object.defineProperty(cooked, "raw", { value: raw });
308
+ }
309
+ else {
310
+ cooked.raw = raw;
311
+ }
215
312
  return cooked;
216
- };
217
-
218
- var __setModuleDefault = Object.create ? (function(o, v) {
313
+ }
314
+ ;
315
+ var __setModuleDefault = Object.create ? (function (o, v) {
219
316
  Object.defineProperty(o, "default", { enumerable: true, value: v });
220
- }) : function(o, v) {
317
+ }) : function (o, v) {
221
318
  o["default"] = v;
222
319
  };
223
-
224
320
  function __importStar(mod) {
225
- if (mod && mod.__esModule) return mod;
321
+ if (mod && mod.__esModule)
322
+ return mod;
226
323
  var result = {};
227
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
324
+ if (mod != null)
325
+ for (var k in mod)
326
+ if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k))
327
+ __createBinding(result, mod, k);
228
328
  __setModuleDefault(result, mod);
229
329
  return result;
230
330
  }
231
-
232
331
  function __importDefault(mod) {
233
332
  return (mod && mod.__esModule) ? mod : { default: mod };
234
333
  }
235
-
236
334
  function __classPrivateFieldGet(receiver, state, kind, f) {
237
- if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
238
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
335
+ if (kind === "a" && !f)
336
+ throw new TypeError("Private accessor was defined without a getter");
337
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
338
+ throw new TypeError("Cannot read private member from an object whose class did not declare it");
239
339
  return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
240
340
  }
241
-
242
341
  function __classPrivateFieldSet(receiver, state, value, kind, f) {
243
- if (kind === "m") throw new TypeError("Private method is not writable");
244
- if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
245
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
342
+ if (kind === "m")
343
+ throw new TypeError("Private method is not writable");
344
+ if (kind === "a" && !f)
345
+ throw new TypeError("Private accessor was defined without a setter");
346
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
347
+ throw new TypeError("Cannot write private member to an object whose class did not declare it");
246
348
  return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
247
349
  }
248
350
 
@@ -281,8 +383,8 @@
281
383
  'outdent',
282
384
  ];
283
385
 
284
- var FS_HTML_EDITOR_DEFAULT_CONFIG = new core.InjectionToken('fs-html-editor.default-config');
285
- var FS_HTML_EDITOR_CONFIG = new core.InjectionToken('fs-html-editor.config');
386
+ var FS_HTML_EDITOR_DEFAULT_CONFIG = new i0.InjectionToken('fs-html-editor.default-config');
387
+ var FS_HTML_EDITOR_CONFIG = new i0.InjectionToken('fs-html-editor.config');
286
388
 
287
389
  function resourceLoaderFactory() {
288
390
  var resourceBase = '/assets/js/froala/';
@@ -303,6 +405,7 @@
303
405
  quote: 'plugins/quote.min.js',
304
406
  draggable: 'plugins/draggable.min.js',
305
407
  font_size: 'plugins/font_size.min.js',
408
+ quick_insert: 'plugins/quick_insert.min.js',
306
409
  };
307
410
  var stylesPaths = {
308
411
  froala: 'froala_editor.pkgd.min.css',
@@ -369,8 +472,8 @@
369
472
  function FsFroalaLoaderService(_defaultConfig) {
370
473
  this._defaultConfig = _defaultConfig;
371
474
  this._froalaLoaded = new rxjs.BehaviorSubject(false);
372
- this._defaultPluginsLoaded = new rxjs.BehaviorSubject(false);
373
- this._loaded$ = rxjs.combineLatest([this._froalaLoaded, this._defaultPluginsLoaded])
475
+ this._froalaPluginsLoaded = new rxjs.BehaviorSubject(false);
476
+ this._loaded$ = rxjs.combineLatest([this._froalaLoaded, this._froalaPluginsLoaded])
374
477
  .pipe(operators.map(function (_a) {
375
478
  var _b = __read(_a, 2), FroalaReady = _b[0], pluginsRead = _b[1];
376
479
  return pluginsRead && FroalaReady;
@@ -389,21 +492,21 @@
389
492
  get: function () {
390
493
  return this._loaded$;
391
494
  },
392
- enumerable: true,
495
+ enumerable: false,
393
496
  configurable: true
394
497
  });
395
498
  Object.defineProperty(FsFroalaLoaderService.prototype, "ready", {
396
499
  get: function () {
397
- return this._froalaLoaded.getValue() && this._defaultPluginsLoaded.getValue();
500
+ return this._froalaLoaded.getValue() && this._froalaPluginsLoaded.getValue();
398
501
  },
399
- enumerable: true,
502
+ enumerable: false,
400
503
  configurable: true
401
504
  });
402
505
  Object.defineProperty(FsFroalaLoaderService.prototype, "FroalaEditor", {
403
506
  get: function () {
404
507
  return this._FroalaEditor;
405
508
  },
406
- enumerable: true,
509
+ enumerable: false,
407
510
  configurable: true
408
511
  });
409
512
  FsFroalaLoaderService.prototype._load = function () {
@@ -418,13 +521,13 @@
418
521
  }), operators.concatMap(function () {
419
522
  return _this._loadPlugins();
420
523
  }), operators.tap(function () {
421
- _this._defaultPluginsDone();
524
+ _this._froalaPluginsDone();
422
525
  }))
423
526
  .subscribe();
424
527
  };
425
528
  FsFroalaLoaderService.prototype._loadPlugins = function () {
426
529
  var imports = this._defaultConfig
427
- .defaultPlugins
530
+ .froalaPlugins
428
531
  .reduce(function (acc, pluginName) {
429
532
  var import$ = ResourceLoader.loadResource(pluginName);
430
533
  acc.push(import$);
@@ -435,22 +538,56 @@
435
538
  FsFroalaLoaderService.prototype._froalaDone = function () {
436
539
  this._froalaLoaded.next(true);
437
540
  };
438
- FsFroalaLoaderService.prototype._defaultPluginsDone = function () {
439
- this._defaultPluginsLoaded.next(true);
541
+ FsFroalaLoaderService.prototype._froalaPluginsDone = function () {
542
+ this._froalaPluginsLoaded.next(true);
440
543
  };
441
- FsFroalaLoaderService.ctorParameters = function () { return [
442
- { type: undefined, decorators: [{ type: core.Optional }, { type: core.Inject, args: [FS_HTML_EDITOR_CONFIG,] }] }
443
- ]; };
444
- FsFroalaLoaderService.ɵprov = core.ɵɵdefineInjectable({ factory: function FsFroalaLoaderService_Factory() { return new FsFroalaLoaderService(core.ɵɵinject(FS_HTML_EDITOR_CONFIG, 8)); }, token: FsFroalaLoaderService, providedIn: "root" });
445
- FsFroalaLoaderService = __decorate([
446
- core.Injectable({
447
- providedIn: 'root',
448
- }),
449
- __param(0, core.Optional()), __param(0, core.Inject(FS_HTML_EDITOR_CONFIG)),
450
- __metadata("design:paramtypes", [Object])
451
- ], FsFroalaLoaderService);
452
544
  return FsFroalaLoaderService;
453
- }());
545
+ }());
546
+ 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 }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
547
+ FsFroalaLoaderService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsFroalaLoaderService, providedIn: 'root' });
548
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsFroalaLoaderService, decorators: [{
549
+ type: i0.Injectable,
550
+ args: [{
551
+ providedIn: 'root',
552
+ }]
553
+ }], ctorParameters: function () {
554
+ return [{ type: undefined, decorators: [{
555
+ type: i0.Optional
556
+ }, {
557
+ type: i0.Inject,
558
+ args: [FS_HTML_EDITOR_CONFIG]
559
+ }] }];
560
+ } });
561
+
562
+ var FsHtmlRendererComponent = /** @class */ (function () {
563
+ function FsHtmlRendererComponent(sanitized, _cdRef) {
564
+ this.sanitized = sanitized;
565
+ this._cdRef = _cdRef;
566
+ }
567
+ Object.defineProperty(FsHtmlRendererComponent.prototype, "setHtml", {
568
+ set: function (html) {
569
+ this.trustedHtml = this.sanitized.bypassSecurityTrustHtml(html || '');
570
+ this._cdRef.markForCheck();
571
+ },
572
+ enumerable: false,
573
+ configurable: true
574
+ });
575
+ return FsHtmlRendererComponent;
576
+ }());
577
+ 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 });
578
+ 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 });
579
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsHtmlRendererComponent, decorators: [{
580
+ type: i0.Component,
581
+ args: [{
582
+ selector: 'fs-html-renderer',
583
+ templateUrl: 'html-renderer.component.html',
584
+ styleUrls: ['html-renderer.component.scss'],
585
+ changeDetection: i0.ChangeDetectionStrategy.OnPush,
586
+ }]
587
+ }], ctorParameters: function () { return [{ type: i1__namespace.DomSanitizer }, { type: i0__namespace.ChangeDetectorRef }]; }, propDecorators: { setHtml: [{
588
+ type: i0.Input,
589
+ args: ['html']
590
+ }] } });
454
591
 
455
592
  var FsHtmlEditorComponent = /** @class */ (function () {
456
593
  function FsHtmlEditorComponent(_defaultConfig, _cdRef, _fr) {
@@ -467,33 +604,32 @@
467
604
  this.onChange = function (data) { };
468
605
  this.onTouched = function () { };
469
606
  }
470
- FsHtmlEditorComponent_1 = FsHtmlEditorComponent;
471
607
  Object.defineProperty(FsHtmlEditorComponent.prototype, "el", {
472
608
  get: function () {
473
609
  return this.elRef.nativeElement;
474
610
  },
475
- enumerable: true,
611
+ enumerable: false,
476
612
  configurable: true
477
613
  });
478
614
  Object.defineProperty(FsHtmlEditorComponent.prototype, "html", {
479
615
  get: function () {
480
616
  return this._html;
481
617
  },
482
- enumerable: true,
618
+ enumerable: false,
483
619
  configurable: true
484
620
  });
485
621
  Object.defineProperty(FsHtmlEditorComponent.prototype, "editor", {
486
622
  get: function () {
487
623
  return this._editor;
488
624
  },
489
- enumerable: true,
625
+ enumerable: false,
490
626
  configurable: true
491
627
  });
492
628
  Object.defineProperty(FsHtmlEditorComponent.prototype, "froalaLoaded$", {
493
629
  get: function () {
494
630
  return this._fr.loaded$;
495
631
  },
496
- enumerable: true,
632
+ enumerable: false,
497
633
  configurable: true
498
634
  });
499
635
  FsHtmlEditorComponent.prototype.ngOnInit = function () {
@@ -521,7 +657,7 @@
521
657
  if (options === void 0) { options = {}; }
522
658
  var config = this._createConfig();
523
659
  this._initPlugins(config);
524
- // this.el.innerHTML = this._html || '';
660
+ this._initButtons(config);
525
661
  this._editor = new this._fr.FroalaEditor(this.el, this._createOptions(), function () {
526
662
  _this._froalaReady$.next({ config: config, options: options });
527
663
  });
@@ -531,21 +667,11 @@
531
667
  var processor = new file.FileProcessor();
532
668
  var file$1 = new file.FsFile(blob);
533
669
  return processor.process([file$1], this.config.image)
534
- .pipe(operators.switchMap(function (_a) {
535
- var _b = __read(_a, 1), f = _b[0];
670
+ .pipe(operators.switchMap(function (_d) {
671
+ var _e = __read(_d, 1), f = _e[0];
536
672
  return _this.config.image.upload(f.file);
537
673
  }));
538
674
  };
539
- FsHtmlEditorComponent.prototype._getTextNode = function (node) {
540
- if (node) {
541
- if (node.nodeType === Node.TEXT_NODE) {
542
- return node;
543
- }
544
- if (node.childNodes) {
545
- return this._getTextNode(node.childNodes[0]);
546
- }
547
- }
548
- };
549
675
  FsHtmlEditorComponent.prototype.uninitializedClick = function (event) {
550
676
  if (!event.defaultPrevented) {
551
677
  var target_1 = event.target;
@@ -578,9 +704,9 @@
578
704
  var err = {};
579
705
  if (this.config.maxLength && this._html) {
580
706
  var maxLength = this.config.maxLength;
581
- var length_1 = this._html.length;
582
- if (length_1 > maxLength) {
583
- err.maxLengthError = "Must be " + maxLength + " characters or fewer. You entered " + length_1 + " characters.";
707
+ var length = this._html.length;
708
+ if (length > maxLength) {
709
+ err.maxLengthError = "Must be " + maxLength + " characters or fewer. You entered " + length + " characters.";
584
710
  }
585
711
  }
586
712
  return Object.keys(err).length ? err : null;
@@ -646,6 +772,42 @@
646
772
  // this._html = html;
647
773
  this.onChange(html);
648
774
  };
775
+ FsHtmlEditorComponent.prototype._initButtons = function (config) {
776
+ var _this = this;
777
+ (config.buttons || [])
778
+ .forEach(function (button) {
779
+ /*
780
+ Svg Keys:
781
+ ["add", "advancedImageEditor", "alignCenter", "alignJustify", "alignLeft", "alignRight",
782
+ "anchors", "back", "backgroundColor", "blockquote", "bold", "cellBackground",
783
+ "cellBorderColor", "cellOptions", "cellStyle", "clearFormatting", "close", "codeView",
784
+ "cogs", "columns", "editLink", "exitFullscreen", "fontAwesome", "fontFamily",
785
+ "fontSize", "fullscreen", "help", "horizontalLine", "imageAltText", "imageCaption",
786
+ "imageClass", "imageDisplay", "imageManager", "imageSize", "indent", "inlineClass",
787
+ "inlineStyle", "insertEmbed", "insertFile", "insertImage", "insertLink", "insertMore",
788
+ "insertTable", "insertVideo", "upload", "italic", "search", "lineHeight", "linkStyles",
789
+ "mention", "more", "openLink", "orderedList", "outdent", "pageBreaker",
790
+ "paragraphFormat", "paragraphMore", "paragraphStyle", "pdfExport", "print",
791
+ "redo", "removeTable", "remove", "replaceImage", "row", "selectAll", "smile",
792
+ "spellcheck", "star", "strikeThrough", "subscript", "superscript", "symbols", "tags",
793
+ "tableHeader", "tableStyle", "textColor", "textMore", "underline", "undo", "unlink",
794
+ "unorderedList", "verticalAlignBottom", "verticalAlignMiddle", "verticalAlignTop"]
795
+ */
796
+ var _a, _b, _c;
797
+ if (button.svgKey) {
798
+ _this._fr.FroalaEditor.DefineIcon(button.name, { SVG_KEY: button.svgKey });
799
+ }
800
+ _this._fr.FroalaEditor.RegisterCommand(button.name, {
801
+ title: button.title,
802
+ focus: (_a = button.focus) !== null && _a !== void 0 ? _a : true,
803
+ undo: (_b = button.undo) !== null && _b !== void 0 ? _b : true,
804
+ refreshAfterCallback: (_c = button.refreshAfterCallback) !== null && _c !== void 0 ? _c : true,
805
+ callback: function () {
806
+ button.click(this);
807
+ }
808
+ });
809
+ });
810
+ };
649
811
  FsHtmlEditorComponent.prototype._initPlugins = function (config) {
650
812
  var _this = this;
651
813
  (config.plugins || []).forEach(function (plugin) {
@@ -686,6 +848,7 @@
686
848
  // For some reason editor store somewhere pointer on default config object and dublicate options each time on init
687
849
  // Extra merge level fixed this problem and allow to init config properly without legacy data
688
850
  {}, {
851
+ shortcutsEnabled: ['show', 'bold', 'italic', 'underline', 'indent', 'outdent', 'undo', 'redo', 'insertImage', 'createLink'],
689
852
  key: config.activationKey,
690
853
  placeholderText: config.placeholder,
691
854
  linkAlwaysBlank: true,
@@ -750,8 +913,8 @@
750
913
  };
751
914
  }
752
915
  _this.initialize(options);
753
- }), operators.switchMap(function () { return _this._froalaReady$; }), operators.filter(function (data) { return !!data; }), operators.tap(function (_a) {
754
- var config = _a.config, options = _a.options;
916
+ }), operators.switchMap(function () { return _this._froalaReady$; }), operators.filter(function (data) { return !!data; }), operators.tap(function (_d) {
917
+ var config = _d.config, options = _d.options;
755
918
  _this._setupFroala(config, options);
756
919
  }))
757
920
  .subscribe();
@@ -801,9 +964,9 @@
801
964
  div.querySelectorAll('*')
802
965
  .forEach(function (el) {
803
966
  for (var i = 0; i < el.attributes.length; i++) {
804
- var name_1 = el.attributes[0].name;
805
- if (name_1 !== 'href') {
806
- el.removeAttribute(name_1);
967
+ var name = el.attributes[0].name;
968
+ if (name !== 'href') {
969
+ el.removeAttribute(name);
807
970
  }
808
971
  }
809
972
  });
@@ -862,97 +1025,78 @@
862
1025
  this.focus();
863
1026
  }
864
1027
  };
865
- var FsHtmlEditorComponent_1;
866
- FsHtmlEditorComponent.ctorParameters = function () { return [
867
- { type: undefined, decorators: [{ type: core.Optional }, { type: core.Inject, args: [FS_HTML_EDITOR_CONFIG,] }] },
868
- { type: core.ChangeDetectorRef },
869
- { type: FsFroalaLoaderService }
870
- ]; };
871
- __decorate([
872
- core.HostBinding('class.focused'),
873
- __metadata("design:type", Object)
874
- ], FsHtmlEditorComponent.prototype, "classFocused", void 0);
875
- __decorate([
876
- core.HostBinding('class.disabled'),
877
- __metadata("design:type", Object)
878
- ], FsHtmlEditorComponent.prototype, "classDisabled", void 0);
879
- __decorate([
880
- core.ViewChild('elRef'),
881
- __metadata("design:type", core.ElementRef)
882
- ], FsHtmlEditorComponent.prototype, "elRef", void 0);
883
- __decorate([
884
- core.Input(),
885
- __metadata("design:type", Object)
886
- ], FsHtmlEditorComponent.prototype, "config", void 0);
887
- FsHtmlEditorComponent = FsHtmlEditorComponent_1 = __decorate([
888
- core.Component({
889
- selector: 'fs-html-editor',
890
- template: "<div class=\"fs-html-editor-default\">\n <ng-container *ngIf=\"initialized\">\n <ng-container *fsSkeleton=\"(froalaLoaded$ | async) !== false\">\n </ng-container>\n </ng-container>\n\n <div #elRef></div>\n\n <div class=\"bottom-line\"></div>\n <div class=\"disabled-line\"></div>\n <fs-html-renderer\n *ngIf=\"!initialized\"\n [html]=\"html\"\n (click)=\"uninitializedClick($event)\">\n </fs-html-renderer>\n</div>\n",
891
- providers: [
892
- {
893
- provide: forms.NG_VALUE_ACCESSOR,
894
- useExisting: core.forwardRef(function () { return FsHtmlEditorComponent_1; }),
895
- multi: true
896
- },
897
- {
898
- provide: forms.NG_VALIDATORS,
899
- useExisting: core.forwardRef(function () { return FsHtmlEditorComponent_1; }),
900
- multi: true
901
- },
902
- ],
903
- changeDetection: core.ChangeDetectionStrategy.OnPush,
904
- 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-dropdown-menu .fr-dropdown-wrapper,:host ::ng-deep .fr-dropdown:after,:host ::ng-deep .fr-more-toolbar,:host ::ng-deep .fr-toolbar{transition:none!important}:host ::ng-deep .fr-toolbar.fr-top{position:-webkit-sticky;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 rgba(0,0,0,.2),0 4px 5px 0 rgba(0,0,0,.14),0 1px 10px 0 rgba(0,0,0,.12);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}"]
905
- }),
906
- __param(0, core.Optional()), __param(0, core.Inject(FS_HTML_EDITOR_CONFIG)),
907
- __metadata("design:paramtypes", [Object, core.ChangeDetectorRef,
908
- FsFroalaLoaderService])
909
- ], FsHtmlEditorComponent);
1028
+ FsHtmlEditorComponent.prototype._getTextNode = function (node) {
1029
+ if (node) {
1030
+ if (node.nodeType === Node.TEXT_NODE) {
1031
+ return node;
1032
+ }
1033
+ if (node.childNodes) {
1034
+ return this._getTextNode(node.childNodes[0]);
1035
+ }
1036
+ }
1037
+ };
910
1038
  return FsHtmlEditorComponent;
911
- }());
912
-
913
- var FsHtmlRendererComponent = /** @class */ (function () {
914
- function FsHtmlRendererComponent(sanitized, _cdRef) {
915
- this.sanitized = sanitized;
916
- this._cdRef = _cdRef;
917
- }
918
- Object.defineProperty(FsHtmlRendererComponent.prototype, "setHtml", {
919
- set: function (html) {
920
- this.trustedHtml = this.sanitized.bypassSecurityTrustHtml(html || '');
921
- this._cdRef.markForCheck();
1039
+ }());
1040
+ 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 });
1041
+ FsHtmlEditorComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: FsHtmlEditorComponent, selector: "fs-html-editor", inputs: { config: "config" }, host: { properties: { "class.focused": "this.classFocused", "class.disabled": "this.classDisabled" } }, providers: [
1042
+ {
1043
+ provide: forms.NG_VALUE_ACCESSOR,
1044
+ useExisting: i0.forwardRef(function () { return FsHtmlEditorComponent; }),
1045
+ multi: true
922
1046
  },
923
- enumerable: true,
924
- configurable: true
925
- });
926
- FsHtmlRendererComponent.ctorParameters = function () { return [
927
- { type: platformBrowser.DomSanitizer },
928
- { type: core.ChangeDetectorRef }
929
- ]; };
930
- __decorate([
931
- core.Input('html'),
932
- __metadata("design:type", Object),
933
- __metadata("design:paramtypes", [Object])
934
- ], FsHtmlRendererComponent.prototype, "setHtml", null);
935
- FsHtmlRendererComponent = __decorate([
936
- core.Component({
937
- selector: 'fs-html-renderer',
938
- template: "<div class=\"fr-view fs-html-editor-default\" [innerHtml]=\"trustedHtml\"></div>\n",
939
- changeDetection: core.ChangeDetectionStrategy.OnPush,
940
- styles: [""]
941
- }),
942
- __metadata("design:paramtypes", [platformBrowser.DomSanitizer,
943
- core.ChangeDetectorRef])
944
- ], FsHtmlRendererComponent);
945
- return FsHtmlRendererComponent;
946
- }());
1047
+ {
1048
+ provide: forms.NG_VALIDATORS,
1049
+ useExisting: i0.forwardRef(function () { return FsHtmlEditorComponent; }),
1050
+ multi: true
1051
+ },
1052
+ ], viewQueries: [{ propertyName: "elRef", first: true, predicate: ["elRef"], descendants: true }], ngImport: i0__namespace, template: "<div class=\"fs-html-editor-default\">\n <ng-container *ngIf=\"initialized\">\n <ng-container *fsSkeleton=\"(froalaLoaded$ | async) !== false\">\n </ng-container>\n </ng-container>\n\n <div #elRef></div>\n\n <div class=\"bottom-line\"></div>\n <div class=\"disabled-line\"></div>\n <fs-html-renderer\n *ngIf=\"!initialized\"\n [html]=\"html\"\n (click)=\"uninitializedClick($event)\">\n </fs-html-renderer>\n</div>\n", styles: [":host ::ng-deep .fr-box.fr-basic .fr-wrapper{border:0;border-bottom:1px solid #949494;margin-bottom:1px;background-color:transparent}:host ::ng-deep .fr-box.fr-basic .fr-element{padding:0;font-family:inherit;color:inherit;font-size:inherit;line-height:inherit;min-height:auto}:host ::ng-deep .fr-more-toolbar,:host ::ng-deep .fr-toolbar,:host ::ng-deep .fr-dropdown:after,:host ::ng-deep .fr-dropdown-menu .fr-dropdown-wrapper{transition:none!important}:host ::ng-deep .fr-toolbar.fr-top{position:sticky;z-index:2;border-radius:0;background-color:#fff}:host ::ng-deep .fr-toolbar.fr-top .fr-btn-grp{margin:0 20px 0 0}:host ::ng-deep .fr-toolbar.fr-top .fr-btn-grp:nth-child(1):after,:host ::ng-deep .fr-toolbar.fr-top .fr-btn-grp:nth-child(2):after{content:\"\";position:absolute;top:9px;height:30px;border-left:1px solid #e5e5e5;margin-left:10px}:host ::ng-deep .fr-toolbar.fr-top div:first-of-type:before{border:none}:host ::ng-deep .fr-toolbar.fr-top.fr-toolbar-open .fr-newline{height:auto}:host ::ng-deep .fr-toolbar.fr-top .fr-btn-grp:first-child{margin-left:0}:host ::ng-deep .fr-toolbar.fr-top.fr-top{border:0}:host ::ng-deep .fr-toolbar.fr-top .fr-newline{margin:0}:host ::ng-deep .fr-toolbar.fr-top .fr-more-toolbar{z-index:auto}:host ::ng-deep .fr-toolbar.fr-top .fr-command.fr-btn{z-index:auto}:host ::ng-deep .fr-toolbar.fr-top .fr-command.fr-btn.fr-dropdown:after{right:3px}:host ::ng-deep .fr-toolbar.fr-top .fr-command.fr-btn.fr-dropdown.fr-selection span{margin-right:24px}:host ::ng-deep .fr-toolbar.fr-top .fr-command.fr-btn.fr-open{border-radius:4px;margin:4px 2px}:host ::ng-deep .fr-view ol,:host ::ng-deep .fr-view ul{list-style-position:unset}:host.disabled ::ng-deep .fr-box.fr-basic{opacity:.5;pointer-events:none}:host.disabled ::ng-deep .fr-box.fr-basic .fr-wrapper{border:none}:host.disabled ::ng-deep .disabled-line{display:block}::ng-deep .fr-popup{z-index:1001!important}::ng-deep .fr-video-by-url-layer .fr-checkbox-line{display:none}.disabled-line{display:none;position:absolute;bottom:-1px;z-index:1;background-image:linear-gradient(90deg,rgba(0,0,0,.42) 0,rgba(0,0,0,.42) 33%,transparent 0);background-size:4px 100%;background-repeat:repeat-x;height:1px;width:100%}.bottom-line{opacity:0;transform-origin:50%;transform:scaleX(.5);transition:background-color .3s cubic-bezier(.55,0,.55,.2);width:100%;border-bottom:2px solid #949494;position:absolute;bottom:-1px;z-index:1}:host{position:relative;display:block}:host.focused .bottom-line{opacity:1;display:block;transform:scaleX(1);transition:transform .3s cubic-bezier(.25,.8,.25,1),opacity .1s cubic-bezier(.25,.8,.25,1),background-color .3s cubic-bezier(.25,.8,.25,1)}::ng-deep .fs-html-editor-mention-container{position:absolute;top:0;left:0;height:auto;max-height:300px;max-width:500px;overflow:auto;display:block;z-index:999999;box-shadow:0 2px 4px -1px #0003,0 4px 5px #00000024,0 1px 10px #0000001f;border-bottom-left-radius:4px;border-bottom-right-radius:4px;background:#fff}::ng-deep .fs-html-editor-mention-container ul{margin:0;padding:0;list-style:none}::ng-deep .fs-html-editor-mention-container li{padding:0 16px;cursor:pointer;line-height:48px}::ng-deep .fs-html-editor-mention-container li.highlight,::ng-deep .fs-html-editor-mention-container li:hover{background:#F5F5F5}::ng-deep .fs-html-editor-mention-container li.no-match{cursor:default}\n"], components: [{ type: FsHtmlRendererComponent, selector: "fs-html-renderer", inputs: ["html"] }], directives: [{ type: i3__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i4__namespace.FsSkeletonContentDirective, selector: "[fsSkeleton]", inputs: ["fsSkeleton", "fsSkeletonPattern"] }], pipes: { "async": i3__namespace.AsyncPipe }, changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush });
1053
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsHtmlEditorComponent, decorators: [{
1054
+ type: i0.Component,
1055
+ args: [{
1056
+ selector: 'fs-html-editor',
1057
+ templateUrl: 'html-editor.component.html',
1058
+ styleUrls: ['html-editor.component.scss'],
1059
+ providers: [
1060
+ {
1061
+ provide: forms.NG_VALUE_ACCESSOR,
1062
+ useExisting: i0.forwardRef(function () { return FsHtmlEditorComponent; }),
1063
+ multi: true
1064
+ },
1065
+ {
1066
+ provide: forms.NG_VALIDATORS,
1067
+ useExisting: i0.forwardRef(function () { return FsHtmlEditorComponent; }),
1068
+ multi: true
1069
+ },
1070
+ ],
1071
+ changeDetection: i0.ChangeDetectionStrategy.OnPush,
1072
+ }]
1073
+ }], ctorParameters: function () {
1074
+ return [{ type: undefined, decorators: [{
1075
+ type: i0.Optional
1076
+ }, {
1077
+ type: i0.Inject,
1078
+ args: [FS_HTML_EDITOR_CONFIG]
1079
+ }] }, { type: i0__namespace.ChangeDetectorRef }, { type: FsFroalaLoaderService }];
1080
+ }, propDecorators: { classFocused: [{
1081
+ type: i0.HostBinding,
1082
+ args: ['class.focused']
1083
+ }], classDisabled: [{
1084
+ type: i0.HostBinding,
1085
+ args: ['class.disabled']
1086
+ }], elRef: [{
1087
+ type: i0.ViewChild,
1088
+ args: ['elRef']
1089
+ }], config: [{
1090
+ type: i0.Input
1091
+ }] } });
947
1092
 
948
1093
  var FsHtmlEditorModule = /** @class */ (function () {
949
1094
  function FsHtmlEditorModule() {
950
1095
  }
951
- FsHtmlEditorModule_1 = FsHtmlEditorModule;
952
1096
  FsHtmlEditorModule.forRoot = function (config) {
953
1097
  if (config === void 0) { config = {}; }
954
1098
  return {
955
- ngModule: FsHtmlEditorModule_1,
1099
+ ngModule: FsHtmlEditorModule,
956
1100
  providers: [
957
1101
  { provide: FS_HTML_EDITOR_DEFAULT_CONFIG, useValue: config },
958
1102
  {
@@ -963,27 +1107,36 @@
963
1107
  ]
964
1108
  };
965
1109
  };
966
- var FsHtmlEditorModule_1;
967
- FsHtmlEditorModule = FsHtmlEditorModule_1 = __decorate([
968
- core.NgModule({
969
- imports: [
970
- common.CommonModule,
971
- skeleton.FsSkeletonModule,
972
- ],
973
- exports: [
974
- FsHtmlEditorComponent,
975
- FsHtmlRendererComponent,
976
- ],
977
- declarations: [
978
- FsHtmlEditorComponent,
979
- FsHtmlRendererComponent,
980
- ],
981
- })
982
- ], FsHtmlEditorModule);
983
1110
  return FsHtmlEditorModule;
984
1111
  }());
1112
+ FsHtmlEditorModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsHtmlEditorModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
1113
+ FsHtmlEditorModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsHtmlEditorModule, declarations: [FsHtmlEditorComponent,
1114
+ FsHtmlRendererComponent], imports: [i3.CommonModule,
1115
+ i4.FsSkeletonModule], exports: [FsHtmlEditorComponent,
1116
+ FsHtmlRendererComponent] });
1117
+ FsHtmlEditorModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsHtmlEditorModule, imports: [[
1118
+ i3.CommonModule,
1119
+ i4.FsSkeletonModule,
1120
+ ]] });
1121
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsHtmlEditorModule, decorators: [{
1122
+ type: i0.NgModule,
1123
+ args: [{
1124
+ imports: [
1125
+ i3.CommonModule,
1126
+ i4.FsSkeletonModule,
1127
+ ],
1128
+ exports: [
1129
+ FsHtmlEditorComponent,
1130
+ FsHtmlRendererComponent,
1131
+ ],
1132
+ declarations: [
1133
+ FsHtmlEditorComponent,
1134
+ FsHtmlRendererComponent,
1135
+ ],
1136
+ }]
1137
+ }] });
985
1138
  function FsHtmlEditorConfigFactory(config) {
986
- return __assign({ defaultPlugins: [
1139
+ return Object.assign({ froalaPlugins: [
987
1140
  "align" /* Align */,
988
1141
  "colors" /* Colors */,
989
1142
  "image" /* Image */,
@@ -1012,7 +1165,7 @@
1012
1165
  function MentionPlugin(config) {
1013
1166
  var _this = _super.call(this) || this;
1014
1167
  _this.config = config;
1015
- _this._guid = common$1.guid();
1168
+ _this._guid = common.guid();
1016
1169
  _this.selected = function (event) {
1017
1170
  if (_this.config.selected) {
1018
1171
  if (MentionPlugin._currentGuid === _this._guid) {
@@ -1020,7 +1173,7 @@
1020
1173
  }
1021
1174
  }
1022
1175
  };
1023
- _this.config = __assign(__assign({}, config), { buttons: [
1176
+ _this.config = Object.assign(Object.assign({}, config), { buttons: [
1024
1177
  {
1025
1178
  name: config.name,
1026
1179
  tooltip: config.tooltip,
@@ -1031,7 +1184,7 @@
1031
1184
  }
1032
1185
  }
1033
1186
  ] });
1034
- _this._tribute = new Tribute({
1187
+ _this._tribute = new Tribute__default["default"]({
1035
1188
  values: lodashEs.debounce(_this._loadValues.bind(_this), 200),
1036
1189
  searchOpts: {
1037
1190
  pre: '',
@@ -1089,10 +1242,10 @@
1089
1242
  cb(data);
1090
1243
  });
1091
1244
  };
1092
- MentionPlugin._currentGuid = null;
1093
- MentionPlugin._tributes = [];
1094
1245
  return MentionPlugin;
1095
- }(Plugin));
1246
+ }(Plugin));
1247
+ MentionPlugin._currentGuid = null;
1248
+ MentionPlugin._tributes = [];
1096
1249
 
1097
1250
  var ChecklistPlugin = /** @class */ (function (_super) {
1098
1251
  __extends(ChecklistPlugin, _super);
@@ -1100,7 +1253,7 @@
1100
1253
  if (config === void 0) { config = { name: 'checklist' }; }
1101
1254
  var _this = _super.call(this) || this;
1102
1255
  _this.config = config;
1103
- _this.config = __assign(__assign({}, config), { name: 'checklist', buttons: [
1256
+ _this.config = Object.assign(Object.assign({}, config), { name: 'checklist', buttons: [
1104
1257
  {
1105
1258
  name: 'checklist',
1106
1259
  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',
@@ -1115,7 +1268,7 @@
1115
1268
  this.editor.events.on('click', function (e) {
1116
1269
  var li = e.target;
1117
1270
  if (li.nodeName === 'LI' && e.offsetX < 0) {
1118
- var items = __spread([li], li.querySelectorAll('li'));
1271
+ var items = __spreadArray([li], __read(li.querySelectorAll('li')));
1119
1272
  if (li.classList.contains('checked')) {
1120
1273
  items.forEach(function (item) {
1121
1274
  item.classList.remove('checked');
@@ -1138,7 +1291,7 @@
1138
1291
  if (config === void 0) { config = { name: 'code' }; }
1139
1292
  var _this = _super.call(this) || this;
1140
1293
  _this.config = config;
1141
- _this.config = __assign(__assign({}, config), { name: 'code', buttons: [
1294
+ _this.config = Object.assign(Object.assign({}, config), { name: 'code', buttons: [
1142
1295
  {
1143
1296
  name: 'code',
1144
1297
  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',
@@ -1205,7 +1358,7 @@
1205
1358
  if (config === void 0) { config = {}; }
1206
1359
  var _this = _super.call(this) || this;
1207
1360
  _this.config = config;
1208
- _this.config = __assign(__assign({}, config), { name: config.name || 'screenRecord', buttons: [
1361
+ _this.config = Object.assign(Object.assign({}, config), { name: config.name || 'screenRecord', buttons: [
1209
1362
  {
1210
1363
  name: 'screenRecord',
1211
1364
  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",
@@ -1301,6 +1454,10 @@
1301
1454
  return ScreenRecordPlugin;
1302
1455
  }(Plugin));
1303
1456
 
1457
+ /**
1458
+ * Generated bundle index. Do not edit.
1459
+ */
1460
+
1304
1461
  exports.ChecklistPlugin = ChecklistPlugin;
1305
1462
  exports.CodePlugin = CodePlugin;
1306
1463
  exports.FS_HTML_EDITOR_CONFIG = FS_HTML_EDITOR_CONFIG;
@@ -1312,12 +1469,8 @@
1312
1469
  exports.RichButtons = RichButtons;
1313
1470
  exports.ScreenRecordPlugin = ScreenRecordPlugin;
1314
1471
  exports.TextButtons = TextButtons;
1315
- exports.ɵa = FsHtmlEditorConfigFactory;
1316
- exports.ɵb = FS_HTML_EDITOR_DEFAULT_CONFIG;
1317
- exports.ɵc = FsFroalaLoaderService;
1318
- exports.ɵe = Plugin;
1319
1472
 
1320
1473
  Object.defineProperty(exports, '__esModule', { value: true });
1321
1474
 
1322
- })));
1475
+ }));
1323
1476
  //# sourceMappingURL=firestitch-html-editor.umd.js.map