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