@skyux/text-editor 5.5.0 → 5.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/bundles/skyux-text-editor.umd.js +30 -30
- package/documentation.json +30 -30
- package/esm2015/lib/modules/rich-text-display/rich-text-display.component.js.map +1 -1
- package/esm2015/lib/modules/rich-text-display/rich-text-display.module.js.map +1 -1
- package/esm2015/lib/modules/shared/sky-text-editor-resources.module.js +1 -1
- package/esm2015/lib/modules/shared/sky-text-editor-resources.module.js.map +1 -1
- package/esm2015/lib/modules/text-editor/defaults/style-state-defaults.js.map +1 -1
- package/esm2015/lib/modules/text-editor/menubar/text-editor-menubar.component.js +4 -4
- package/esm2015/lib/modules/text-editor/menubar/text-editor-menubar.component.js.map +1 -1
- package/esm2015/lib/modules/text-editor/services/text-editor-adapter.service.js +4 -4
- package/esm2015/lib/modules/text-editor/services/text-editor-adapter.service.js.map +1 -1
- package/esm2015/lib/modules/text-editor/services/text-sanitization.service.js +1 -1
- package/esm2015/lib/modules/text-editor/services/text-sanitization.service.js.map +1 -1
- package/esm2015/lib/modules/text-editor/text-editor.component.js +6 -6
- package/esm2015/lib/modules/text-editor/text-editor.component.js.map +1 -1
- package/esm2015/lib/modules/text-editor/text-editor.module.js +3 -3
- package/esm2015/lib/modules/text-editor/text-editor.module.js.map +1 -1
- package/esm2015/lib/modules/text-editor/toolbar/text-editor-toolbar.component.js +4 -4
- package/esm2015/lib/modules/text-editor/toolbar/text-editor-toolbar.component.js.map +1 -1
- package/esm2015/lib/modules/text-editor/url-modal/text-editor-url-modal.component.js.map +1 -1
- package/fesm2015/skyux-text-editor.js +101 -101
- package/fesm2015/skyux-text-editor.js.map +1 -1
- package/lib/modules/text-editor/services/text-editor-adapter.service.d.ts +1 -1
- package/lib/modules/text-editor/text-editor.component.d.ts +1 -1
- package/lib/modules/text-editor/toolbar/text-editor-toolbar.component.d.ts +2 -2
- package/package.json +9 -9
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
(function (global, factory) {
|
|
2
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/common'), require('@angular/core'), require('@angular/platform-browser'), require('dompurify'), require('@angular/forms'), require('@skyux/colorpicker'), require('@skyux/core'), require('@skyux/forms'), require('@skyux/
|
|
3
|
-
typeof define === 'function' && define.amd ? define('@skyux/text-editor', ['exports', '@angular/common', '@angular/core', '@angular/platform-browser', 'dompurify', '@angular/forms', '@skyux/colorpicker', '@skyux/core', '@skyux/forms', '@skyux/
|
|
4
|
-
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.skyux = global.skyux || {}, global.skyux["text-editor"] = {}), global.ng.common, global.ng.core, global.ng.platformBrowser, global.createDOMPurify, global.ng.forms, global.i6$1, global.i3, global.i4$1, global.
|
|
5
|
-
})(this, (function (exports, i5, i0, i1, createDOMPurify, i5$1, i6$1, i3, i4$1,
|
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/common'), require('@angular/core'), require('@angular/platform-browser'), require('dompurify'), require('@angular/forms'), require('@skyux/colorpicker'), require('@skyux/core'), require('@skyux/forms'), require('@skyux/i18n'), require('@skyux/indicators'), require('@skyux/layout'), require('@skyux/modals'), require('@skyux/popovers'), require('@skyux/tabs'), require('@skyux/theme'), require('rxjs'), require('rxjs/operators'), require('@skyux/validation')) :
|
|
3
|
+
typeof define === 'function' && define.amd ? define('@skyux/text-editor', ['exports', '@angular/common', '@angular/core', '@angular/platform-browser', 'dompurify', '@angular/forms', '@skyux/colorpicker', '@skyux/core', '@skyux/forms', '@skyux/i18n', '@skyux/indicators', '@skyux/layout', '@skyux/modals', '@skyux/popovers', '@skyux/tabs', '@skyux/theme', 'rxjs', 'rxjs/operators', '@skyux/validation'], factory) :
|
|
4
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.skyux = global.skyux || {}, global.skyux["text-editor"] = {}), global.ng.common, global.ng.core, global.ng.platformBrowser, global.createDOMPurify, global.ng.forms, global.i6$1, global.i3, global.i4$1, global.i2, global.i7, global.i3$1, global.i1$1, global.i4, global.i3$2, global.i6, global.rxjs, global.rxjs.operators, global.validation));
|
|
5
|
+
})(this, (function (exports, i5, i0, i1, createDOMPurify, i5$1, i6$1, i3, i4$1, i2, i7, i3$1, i1$1, i4, i3$2, i6, rxjs, operators, validation) { 'use strict';
|
|
6
6
|
|
|
7
7
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
8
8
|
|
|
@@ -32,10 +32,10 @@
|
|
|
32
32
|
var i6__namespace$1 = /*#__PURE__*/_interopNamespace(i6$1);
|
|
33
33
|
var i3__namespace = /*#__PURE__*/_interopNamespace(i3);
|
|
34
34
|
var i4__namespace$1 = /*#__PURE__*/_interopNamespace(i4$1);
|
|
35
|
-
var i1__namespace$1 = /*#__PURE__*/_interopNamespace(i1$1);
|
|
36
35
|
var i2__namespace = /*#__PURE__*/_interopNamespace(i2);
|
|
37
36
|
var i7__namespace = /*#__PURE__*/_interopNamespace(i7);
|
|
38
37
|
var i3__namespace$1 = /*#__PURE__*/_interopNamespace(i3$1);
|
|
38
|
+
var i1__namespace$1 = /*#__PURE__*/_interopNamespace(i1$1);
|
|
39
39
|
var i4__namespace = /*#__PURE__*/_interopNamespace(i4);
|
|
40
40
|
var i3__namespace$2 = /*#__PURE__*/_interopNamespace(i3$2);
|
|
41
41
|
var i6__namespace = /*#__PURE__*/_interopNamespace(i6);
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
domPurify.addHook('afterSanitizeAttributes', function (node) {
|
|
45
45
|
// Set all elements owning target to target=_blank
|
|
46
46
|
// so we only allow the target attribute with that value.
|
|
47
|
-
if (
|
|
47
|
+
if (node.getAttribute('target')) {
|
|
48
48
|
node.setAttribute('target', '_blank');
|
|
49
49
|
node.setAttribute('rel', 'noopener noreferrer');
|
|
50
50
|
}
|
|
@@ -1456,6 +1456,30 @@
|
|
|
1456
1456
|
type: i0.Input
|
|
1457
1457
|
}] } });
|
|
1458
1458
|
|
|
1459
|
+
/**
|
|
1460
|
+
* @internal
|
|
1461
|
+
*/
|
|
1462
|
+
var FONT_SIZE_LIST_DEFAULTS = [
|
|
1463
|
+
6, 8, 9, 10, 11, 12, 13, 14, 15, 16, 18, 20, 22, 24, 26, 28, 36, 48,
|
|
1464
|
+
];
|
|
1465
|
+
|
|
1466
|
+
/**
|
|
1467
|
+
* @internal
|
|
1468
|
+
*/
|
|
1469
|
+
var MENU_DEFAULTS = ['edit', 'format'];
|
|
1470
|
+
|
|
1471
|
+
/**
|
|
1472
|
+
* @internal
|
|
1473
|
+
*/
|
|
1474
|
+
var TOOLBAR_ACTION_DEFAULTS = [
|
|
1475
|
+
'font-family',
|
|
1476
|
+
'font-size',
|
|
1477
|
+
'font-style',
|
|
1478
|
+
'color',
|
|
1479
|
+
'list',
|
|
1480
|
+
'link',
|
|
1481
|
+
];
|
|
1482
|
+
|
|
1459
1483
|
/**
|
|
1460
1484
|
* @internal
|
|
1461
1485
|
*/
|
|
@@ -1752,30 +1776,6 @@
|
|
|
1752
1776
|
type: i0.Input
|
|
1753
1777
|
}] } });
|
|
1754
1778
|
|
|
1755
|
-
/**
|
|
1756
|
-
* @internal
|
|
1757
|
-
*/
|
|
1758
|
-
var MENU_DEFAULTS = ['edit', 'format'];
|
|
1759
|
-
|
|
1760
|
-
/**
|
|
1761
|
-
* @internal
|
|
1762
|
-
*/
|
|
1763
|
-
var TOOLBAR_ACTION_DEFAULTS = [
|
|
1764
|
-
'font-family',
|
|
1765
|
-
'font-size',
|
|
1766
|
-
'font-style',
|
|
1767
|
-
'color',
|
|
1768
|
-
'list',
|
|
1769
|
-
'link',
|
|
1770
|
-
];
|
|
1771
|
-
|
|
1772
|
-
/**
|
|
1773
|
-
* @internal
|
|
1774
|
-
*/
|
|
1775
|
-
var FONT_SIZE_LIST_DEFAULTS = [
|
|
1776
|
-
6, 8, 9, 10, 11, 12, 13, 14, 15, 16, 18, 20, 22, 24, 26, 28, 36, 48,
|
|
1777
|
-
];
|
|
1778
|
-
|
|
1779
1779
|
/**
|
|
1780
1780
|
* Auto-incrementing integer used to generate unique ids for radio components.
|
|
1781
1781
|
*/
|
package/documentation.json
CHANGED
|
@@ -73,7 +73,7 @@
|
|
|
73
73
|
"sources": [
|
|
74
74
|
{
|
|
75
75
|
"fileName": "projects/text-editor/src/modules/rich-text-display/rich-text-display.module.ts",
|
|
76
|
-
"line":
|
|
76
|
+
"line": 11,
|
|
77
77
|
"character": 13
|
|
78
78
|
}
|
|
79
79
|
]
|
|
@@ -133,7 +133,7 @@
|
|
|
133
133
|
"sources": [
|
|
134
134
|
{
|
|
135
135
|
"fileName": "projects/text-editor/src/modules/text-editor/text-editor.module.ts",
|
|
136
|
-
"line":
|
|
136
|
+
"line": 55,
|
|
137
137
|
"character": 13
|
|
138
138
|
}
|
|
139
139
|
]
|
|
@@ -168,7 +168,7 @@
|
|
|
168
168
|
"sources": [
|
|
169
169
|
{
|
|
170
170
|
"fileName": "projects/text-editor/src/modules/rich-text-display/rich-text-display.component.ts",
|
|
171
|
-
"line":
|
|
171
|
+
"line": 31,
|
|
172
172
|
"character": 2
|
|
173
173
|
}
|
|
174
174
|
],
|
|
@@ -224,7 +224,7 @@
|
|
|
224
224
|
"sources": [
|
|
225
225
|
{
|
|
226
226
|
"fileName": "projects/text-editor/src/modules/rich-text-display/rich-text-display.component.ts",
|
|
227
|
-
"line":
|
|
227
|
+
"line": 27,
|
|
228
228
|
"character": 9
|
|
229
229
|
}
|
|
230
230
|
],
|
|
@@ -259,7 +259,7 @@
|
|
|
259
259
|
"sources": [
|
|
260
260
|
{
|
|
261
261
|
"fileName": "projects/text-editor/src/modules/rich-text-display/rich-text-display.component.ts",
|
|
262
|
-
"line":
|
|
262
|
+
"line": 15,
|
|
263
263
|
"character": 13
|
|
264
264
|
}
|
|
265
265
|
],
|
|
@@ -320,7 +320,7 @@
|
|
|
320
320
|
"sources": [
|
|
321
321
|
{
|
|
322
322
|
"fileName": "projects/text-editor/src/modules/rich-text-display/rich-text-display.component.ts",
|
|
323
|
-
"line":
|
|
323
|
+
"line": 10,
|
|
324
324
|
"character": 13
|
|
325
325
|
}
|
|
326
326
|
]
|
|
@@ -358,7 +358,7 @@
|
|
|
358
358
|
"sources": [
|
|
359
359
|
{
|
|
360
360
|
"fileName": "projects/text-editor/src/modules/text-editor/text-editor.component.ts",
|
|
361
|
-
"line":
|
|
361
|
+
"line": 241,
|
|
362
362
|
"character": 2
|
|
363
363
|
}
|
|
364
364
|
],
|
|
@@ -488,7 +488,7 @@
|
|
|
488
488
|
"sources": [
|
|
489
489
|
{
|
|
490
490
|
"fileName": "projects/text-editor/src/modules/text-editor/text-editor.component.ts",
|
|
491
|
-
"line":
|
|
491
|
+
"line": 55,
|
|
492
492
|
"character": 9
|
|
493
493
|
}
|
|
494
494
|
],
|
|
@@ -509,7 +509,7 @@
|
|
|
509
509
|
"sources": [
|
|
510
510
|
{
|
|
511
511
|
"fileName": "projects/text-editor/src/modules/text-editor/text-editor.component.ts",
|
|
512
|
-
"line":
|
|
512
|
+
"line": 101,
|
|
513
513
|
"character": 9
|
|
514
514
|
}
|
|
515
515
|
],
|
|
@@ -559,7 +559,7 @@
|
|
|
559
559
|
"sources": [
|
|
560
560
|
{
|
|
561
561
|
"fileName": "projects/text-editor/src/modules/text-editor/text-editor.component.ts",
|
|
562
|
-
"line":
|
|
562
|
+
"line": 108,
|
|
563
563
|
"character": 9
|
|
564
564
|
}
|
|
565
565
|
],
|
|
@@ -605,7 +605,7 @@
|
|
|
605
605
|
"sources": [
|
|
606
606
|
{
|
|
607
607
|
"fileName": "projects/text-editor/src/modules/text-editor/text-editor.component.ts",
|
|
608
|
-
"line":
|
|
608
|
+
"line": 115,
|
|
609
609
|
"character": 9
|
|
610
610
|
}
|
|
611
611
|
],
|
|
@@ -644,7 +644,7 @@
|
|
|
644
644
|
"sources": [
|
|
645
645
|
{
|
|
646
646
|
"fileName": "projects/text-editor/src/modules/text-editor/text-editor.component.ts",
|
|
647
|
-
"line":
|
|
647
|
+
"line": 122,
|
|
648
648
|
"character": 9
|
|
649
649
|
}
|
|
650
650
|
],
|
|
@@ -686,7 +686,7 @@
|
|
|
686
686
|
"sources": [
|
|
687
687
|
{
|
|
688
688
|
"fileName": "projects/text-editor/src/modules/text-editor/text-editor.component.ts",
|
|
689
|
-
"line":
|
|
689
|
+
"line": 148,
|
|
690
690
|
"character": 9
|
|
691
691
|
}
|
|
692
692
|
],
|
|
@@ -726,7 +726,7 @@
|
|
|
726
726
|
"sources": [
|
|
727
727
|
{
|
|
728
728
|
"fileName": "projects/text-editor/src/modules/text-editor/text-editor.component.ts",
|
|
729
|
-
"line":
|
|
729
|
+
"line": 154,
|
|
730
730
|
"character": 9
|
|
731
731
|
}
|
|
732
732
|
],
|
|
@@ -772,7 +772,7 @@
|
|
|
772
772
|
"sources": [
|
|
773
773
|
{
|
|
774
774
|
"fileName": "projects/text-editor/src/modules/text-editor/text-editor.component.ts",
|
|
775
|
-
"line":
|
|
775
|
+
"line": 179,
|
|
776
776
|
"character": 9
|
|
777
777
|
}
|
|
778
778
|
],
|
|
@@ -809,7 +809,7 @@
|
|
|
809
809
|
"sources": [
|
|
810
810
|
{
|
|
811
811
|
"fileName": "projects/text-editor/src/modules/text-editor/text-editor.component.ts",
|
|
812
|
-
"line":
|
|
812
|
+
"line": 62,
|
|
813
813
|
"character": 13
|
|
814
814
|
}
|
|
815
815
|
],
|
|
@@ -894,7 +894,7 @@
|
|
|
894
894
|
"sources": [
|
|
895
895
|
{
|
|
896
896
|
"fileName": "projects/text-editor/src/modules/text-editor/text-editor.component.ts",
|
|
897
|
-
"line":
|
|
897
|
+
"line": 128,
|
|
898
898
|
"character": 13
|
|
899
899
|
}
|
|
900
900
|
],
|
|
@@ -969,7 +969,7 @@
|
|
|
969
969
|
"sources": [
|
|
970
970
|
{
|
|
971
971
|
"fileName": "projects/text-editor/src/modules/text-editor/text-editor.component.ts",
|
|
972
|
-
"line":
|
|
972
|
+
"line": 160,
|
|
973
973
|
"character": 13
|
|
974
974
|
}
|
|
975
975
|
],
|
|
@@ -1030,7 +1030,7 @@
|
|
|
1030
1030
|
"sources": [
|
|
1031
1031
|
{
|
|
1032
1032
|
"fileName": "projects/text-editor/src/modules/text-editor/text-editor.component.ts",
|
|
1033
|
-
"line":
|
|
1033
|
+
"line": 184,
|
|
1034
1034
|
"character": 13
|
|
1035
1035
|
}
|
|
1036
1036
|
],
|
|
@@ -1091,7 +1091,7 @@
|
|
|
1091
1091
|
"sources": [
|
|
1092
1092
|
{
|
|
1093
1093
|
"fileName": "projects/text-editor/src/modules/text-editor/text-editor.component.ts",
|
|
1094
|
-
"line":
|
|
1094
|
+
"line": 253,
|
|
1095
1095
|
"character": 9
|
|
1096
1096
|
}
|
|
1097
1097
|
],
|
|
@@ -1128,7 +1128,7 @@
|
|
|
1128
1128
|
"sources": [
|
|
1129
1129
|
{
|
|
1130
1130
|
"fileName": "projects/text-editor/src/modules/text-editor/text-editor.component.ts",
|
|
1131
|
-
"line":
|
|
1131
|
+
"line": 257,
|
|
1132
1132
|
"character": 9
|
|
1133
1133
|
}
|
|
1134
1134
|
],
|
|
@@ -1165,7 +1165,7 @@
|
|
|
1165
1165
|
"sources": [
|
|
1166
1166
|
{
|
|
1167
1167
|
"fileName": "projects/text-editor/src/modules/text-editor/text-editor.component.ts",
|
|
1168
|
-
"line":
|
|
1168
|
+
"line": 264,
|
|
1169
1169
|
"character": 9
|
|
1170
1170
|
}
|
|
1171
1171
|
],
|
|
@@ -1194,7 +1194,7 @@
|
|
|
1194
1194
|
"sources": [
|
|
1195
1195
|
{
|
|
1196
1196
|
"fileName": "projects/text-editor/src/modules/text-editor/text-editor.component.ts",
|
|
1197
|
-
"line":
|
|
1197
|
+
"line": 289,
|
|
1198
1198
|
"character": 9
|
|
1199
1199
|
}
|
|
1200
1200
|
],
|
|
@@ -1271,7 +1271,7 @@
|
|
|
1271
1271
|
"sources": [
|
|
1272
1272
|
{
|
|
1273
1273
|
"fileName": "projects/text-editor/src/modules/text-editor/text-editor.component.ts",
|
|
1274
|
-
"line":
|
|
1274
|
+
"line": 296,
|
|
1275
1275
|
"character": 9
|
|
1276
1276
|
}
|
|
1277
1277
|
],
|
|
@@ -1335,7 +1335,7 @@
|
|
|
1335
1335
|
"sources": [
|
|
1336
1336
|
{
|
|
1337
1337
|
"fileName": "projects/text-editor/src/modules/text-editor/text-editor.component.ts",
|
|
1338
|
-
"line":
|
|
1338
|
+
"line": 303,
|
|
1339
1339
|
"character": 9
|
|
1340
1340
|
}
|
|
1341
1341
|
],
|
|
@@ -1380,7 +1380,7 @@
|
|
|
1380
1380
|
"sources": [
|
|
1381
1381
|
{
|
|
1382
1382
|
"fileName": "projects/text-editor/src/modules/text-editor/text-editor.component.ts",
|
|
1383
|
-
"line":
|
|
1383
|
+
"line": 276,
|
|
1384
1384
|
"character": 9
|
|
1385
1385
|
}
|
|
1386
1386
|
],
|
|
@@ -1464,7 +1464,7 @@
|
|
|
1464
1464
|
"sources": [
|
|
1465
1465
|
{
|
|
1466
1466
|
"fileName": "projects/text-editor/src/modules/text-editor/text-editor.component.ts",
|
|
1467
|
-
"line":
|
|
1467
|
+
"line": 50,
|
|
1468
1468
|
"character": 13
|
|
1469
1469
|
}
|
|
1470
1470
|
],
|
|
@@ -1981,7 +1981,7 @@
|
|
|
1981
1981
|
{
|
|
1982
1982
|
"fileName": "rich-text-display-demo.module.ts",
|
|
1983
1983
|
"filePath": "/projects/text-editor/documentation/code-examples/rich-text-display/rich-text-display-demo.module.ts",
|
|
1984
|
-
"rawContents": "import {
|
|
1984
|
+
"rawContents": "import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { SkyRichTextDisplayModule } from '@skyux/text-editor';\n\nimport { RichTextDisplayDemoComponent } from './rich-text-display-demo.component';\n\n@NgModule({\n imports: [CommonModule, SkyRichTextDisplayModule],\n declarations: [RichTextDisplayDemoComponent],\n exports: [RichTextDisplayDemoComponent],\n})\nexport class RichTextDisplayDemoModule {}\n"
|
|
1985
1985
|
},
|
|
1986
1986
|
{
|
|
1987
1987
|
"fileName": "text-editor-demo.component.html",
|
|
@@ -1991,12 +1991,12 @@
|
|
|
1991
1991
|
{
|
|
1992
1992
|
"fileName": "text-editor-demo.component.ts",
|
|
1993
1993
|
"filePath": "/projects/text-editor/documentation/code-examples/text-editor/text-editor-demo.component.ts",
|
|
1994
|
-
"rawContents": "import { Component, OnInit } from '@angular/core';\
|
|
1994
|
+
"rawContents": "import { Component, OnInit } from '@angular/core';\nimport { FormBuilder, FormControl, FormGroup } from '@angular/forms';\n\n@Component({\n selector: 'app-text-editor-demo',\n templateUrl: './text-editor-demo.component.html',\n})\nexport class TextEditorDemoComponent implements OnInit {\n public myForm: FormGroup;\n\n private richText = `<font style=\"font-size: 18px\" face=\"Arial\" color=\"#a25353\"><b>Exclusively committed to your impact</b></font><p>Since day one, Blackbaud has been 100% focused on driving impact for social good organizations.</p><p>We equip change agents with <b>cloud software</b>, <i>services</i>, <u>expertise</u>, and <font color=\"#a25353\">data intelligence</font> designed with unmatched insight and supported with unparalleled commitment. Every day, our <b>customers</b> achieve unmatched impact as they advance their missions.</p><ul><li><a href=\"#\">Build a better world</a></li><li><a href=\"#\">Explore our solutions</a></li></ul>`;\n\n constructor(private formBuilder: FormBuilder) {}\n\n public ngOnInit(): void {\n this.myForm = this.formBuilder.group({\n myText: new FormControl(this.richText),\n });\n }\n}\n"
|
|
1995
1995
|
},
|
|
1996
1996
|
{
|
|
1997
1997
|
"fileName": "text-editor-demo.module.ts",
|
|
1998
1998
|
"filePath": "/projects/text-editor/documentation/code-examples/text-editor/text-editor-demo.module.ts",
|
|
1999
|
-
"rawContents": "import {
|
|
1999
|
+
"rawContents": "import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { ReactiveFormsModule } from '@angular/forms';\nimport { SkyIdModule } from '@skyux/core';\nimport { SkyTextEditorModule } from '@skyux/text-editor';\n\nimport { TextEditorDemoComponent } from './text-editor-demo.component';\n\n@NgModule({\n imports: [\n CommonModule,\n ReactiveFormsModule,\n SkyIdModule,\n SkyTextEditorModule,\n ],\n declarations: [TextEditorDemoComponent],\n exports: [TextEditorDemoComponent],\n})\nexport class TextEditorDemoModule {}\n"
|
|
2000
2000
|
}
|
|
2001
2001
|
]
|
|
2002
2002
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rich-text-display.component.js","sourceRoot":"","sources":["../../../../../../../../libs/components/text-editor/src/lib/modules/rich-text-display/rich-text-display.component.ts","../../../../../../../../libs/components/text-editor/src/lib/modules/rich-text-display/rich-text-display.component.html"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"rich-text-display.component.js","sourceRoot":"","sources":["../../../../../../../../libs/components/text-editor/src/lib/modules/rich-text-display/rich-text-display.component.ts","../../../../../../../../libs/components/text-editor/src/lib/modules/rich-text-display/rich-text-display.component.html"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,EAAE,YAAY,EAAY,MAAM,2BAA2B,CAAC;AAEnE,OAAO,EAAE,0BAA0B,EAAE,MAAM,mDAAmD,CAAC;;;;AAM/F,MAAM,OAAO,2BAA2B;IAqBtC,YACU,SAAuB,EACvB,mBAA+C;QAD/C,cAAS,GAAT,SAAS,CAAc;QACvB,wBAAmB,GAAnB,mBAAmB,CAA4B;QANlD,kBAAa,GAAa,EAAE,CAAC;QAE5B,cAAS,GAAG,EAAE,CAAC;IAKpB,CAAC;IAvBJ;;OAEG;IACH,IACW,QAAQ,CAAC,KAAa;QAC/B,MAAM,OAAO,GAAG,IAAI,CAAC,mBAAmB,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;QACzD,0BAA0B;QAC1B,IAAI,OAAO,KAAK,IAAI,CAAC,SAAS,EAAE;YAC9B,IAAI,CAAC,SAAS,GAAG,OAAO,CAAC;YAEzB,oDAAoD;YACpD,wDAAwD;YACxD,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,SAAS,CAAC,uBAAuB,CAAC,OAAO,CAAC,CAAC;SACtE;IACH,CAAC;;yHAfU,2BAA2B;6GAA3B,2BAA2B,+FCTxC,qFACA;4FDQa,2BAA2B;kBAJvC,SAAS;mBAAC;oBACT,QAAQ,EAAE,uBAAuB;oBACjC,WAAW,EAAE,oCAAoC;iBAClD;4IAMY,QAAQ;sBADlB,KAAK","sourcesContent":["import { Component, Input } from '@angular/core';\nimport { DomSanitizer, SafeHtml } from '@angular/platform-browser';\n\nimport { SkyTextSanitizationService } from '../text-editor/services/text-sanitization.service';\n\n@Component({\n selector: 'sky-rich-text-display',\n templateUrl: './rich-text-display.component.html',\n})\nexport class SkyRichTextDisplayComponent {\n /**\n * Specifies the rich text to display.\n */\n @Input()\n public set richText(value: string) {\n const cleaned = this.sanitizationService.sanitize(value);\n /* istanbul ignore else */\n if (cleaned !== this._richText) {\n this._richText = cleaned;\n\n // Text has already been sanitized with DOMPurifier.\n // Tell Angular to bypass its own internal sanitization.\n this.sanitizedText = this.sanitizer.bypassSecurityTrustHtml(cleaned);\n }\n }\n\n public sanitizedText: SafeHtml = '';\n\n private _richText = '';\n\n constructor(\n private sanitizer: DomSanitizer,\n private sanitizationService: SkyTextSanitizationService\n ) {}\n}\n","<span class=\"sky-rich-text-display-text\" [innerHTML]=\"sanitizedText\"> </span>\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rich-text-display.module.js","sourceRoot":"","sources":["../../../../../../../../libs/components/text-editor/src/lib/modules/rich-text-display/rich-text-display.module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"rich-text-display.module.js","sourceRoot":"","sources":["../../../../../../../../libs/components/text-editor/src/lib/modules/rich-text-display/rich-text-display.module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC,OAAO,EAAE,2BAA2B,EAAE,MAAM,+BAA+B,CAAC;;AAO5E,MAAM,OAAO,wBAAwB;;sHAAxB,wBAAwB;uHAAxB,wBAAwB,iBAFpB,2BAA2B,aAFhC,YAAY,aACZ,2BAA2B;uHAG1B,wBAAwB,YAJ1B,CAAC,YAAY,CAAC;4FAIZ,wBAAwB;kBALpC,QAAQ;mBAAC;oBACR,OAAO,EAAE,CAAC,YAAY,CAAC;oBACvB,OAAO,EAAE,CAAC,2BAA2B,CAAC;oBACtC,YAAY,EAAE,CAAC,2BAA2B,CAAC;iBAC5C","sourcesContent":["import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\n\nimport { SkyRichTextDisplayComponent } from './rich-text-display.component';\n\n@NgModule({\n imports: [CommonModule],\n exports: [SkyRichTextDisplayComponent],\n declarations: [SkyRichTextDisplayComponent],\n})\nexport class SkyRichTextDisplayModule {}\n"]}
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* To update this file, simply rerun the command.
|
|
6
6
|
*/
|
|
7
7
|
import { NgModule } from '@angular/core';
|
|
8
|
-
import {
|
|
8
|
+
import { SKY_LIB_RESOURCES_PROVIDERS, SkyI18nModule, getLibStringForLocale, } from '@skyux/i18n';
|
|
9
9
|
import * as i0 from "@angular/core";
|
|
10
10
|
const RESOURCES = {
|
|
11
11
|
'EN-US': {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sky-text-editor-resources.module.js","sourceRoot":"","sources":["../../../../../../../../libs/components/text-editor/src/lib/modules/shared/sky-text-editor-resources.module.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;
|
|
1
|
+
{"version":3,"file":"sky-text-editor-resources.module.js","sourceRoot":"","sources":["../../../../../../../../libs/components/text-editor/src/lib/modules/shared/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* NOTICE: DO NOT MODIFY THIS FILE!\n * The contents of this file were automatically generated by\n * the 'ng generate @skyux/i18n:lib-resources-module modules/shared/sky-text-editor' schematic.\n * To update this file, simply rerun the command.\n */\nimport { NgModule } from '@angular/core';\nimport {\n SKY_LIB_RESOURCES_PROVIDERS,\n SkyAppLocaleInfo,\n SkyI18nModule,\n SkyLibResources,\n SkyLibResourcesProvider,\n getLibStringForLocale,\n} from '@skyux/i18n';\n\nconst RESOURCES: { [locale: string]: SkyLibResources } = {\n 'EN-US': {\n skyux_text_editor_format_menu_action_bold_label: { message: 'Bold' },\n skyux_text_editor_format_menu_action_bold_key_shortcut: {\n message: 'Ctrl+B',\n },\n skyux_text_editor_format_menu_action_italic_label: { message: 'Italic' },\n skyux_text_editor_format_menu_action_italic_key_shortcut: {\n message: 'Ctrl+I',\n },\n skyux_text_editor_format_menu_action_underline_label: {\n message: 'Underline',\n },\n skyux_text_editor_format_menu_action_underline_key_shortcut: {\n message: 'Ctrl+U',\n },\n skyux_text_editor_format_menu_action_strikethrough_label: {\n message: 'Strikethrough',\n },\n skyux_text_editor_format_menu_action_clear_formatting_label: {\n message: 'Clear formatting',\n },\n skyux_text_editor_edit_menu_action_undo_label: { message: 'Undo' },\n skyux_text_editor_edit_menu_action_undo_key_shortcut: { message: 'Ctrl+Z' },\n skyux_text_editor_edit_menu_action_redo_label: { message: 'Redo' },\n skyux_text_editor_edit_menu_action_redo_key_shortcut: { message: 'Ctrl+Y' },\n skyux_text_editor_edit_menu_action_cut_label: { message: 'Cut' },\n skyux_text_editor_edit_menu_action_cut_key_shortcut: { message: 'Ctrl+X' },\n skyux_text_editor_edit_menu_action_copy_label: { message: 'Copy' },\n skyux_text_editor_edit_menu_action_copy_key_shortcut: { message: 'Ctrl+C' },\n skyux_text_editor_edit_menu_action_paste_label: { message: 'Paste' },\n skyux_text_editor_edit_menu_action_paste_key_shortcut: {\n message: 'Ctrl+V',\n },\n skyux_text_editor_edit_menu_action_select_all_label: {\n message: 'Select all',\n },\n skyux_text_editor_edit_menu_action_select_all_key_shortcut: {\n message: 'Ctrl+A',\n },\n skyux_text_editor_menubar_dropdown_button_edit_label: { message: 'Edit' },\n skyux_text_editor_menubar_dropdown_button_format_label: {\n message: 'Format',\n },\n skyux_text_editor_menubar_dropdown_button_insert_label: {\n message: 'Insert merge field',\n },\n skyux_text_editor_url_modal_header_label: { message: 'Create link' },\n skyux_text_editor_url_modal_url_label: {\n message: 'Enter a URL to link to:',\n },\n skyux_text_editor_url_modal_open_label: {\n message: 'Where should it open?',\n },\n skyux_text_editor_url_modal_current_option_label: {\n message: 'Current window',\n },\n skyux_text_editor_url_modal_new_option_label: { message: 'New window' },\n skyux_text_editor_url_modal_email_label: { message: 'Email address' },\n skyux_text_editor_url_modal_subject_label: { message: 'Subject line' },\n skyux_text_editor_url_modal_save_button_label: { message: 'Save' },\n skyux_text_editor_url_modal_cancel_button_label: { message: 'Cancel' },\n },\n};\n\nexport class SkyTextEditorResourcesProvider implements SkyLibResourcesProvider {\n public getString(localeInfo: SkyAppLocaleInfo, name: string): string {\n return getLibStringForLocale(RESOURCES, localeInfo.locale, name);\n }\n}\n\n/**\n * Import into any component library module that needs to use resource strings.\n */\n@NgModule({\n exports: [SkyI18nModule],\n providers: [\n {\n provide: SKY_LIB_RESOURCES_PROVIDERS,\n useClass: SkyTextEditorResourcesProvider,\n multi: true,\n },\n ],\n})\nexport class SkyTextEditorResourcesModule {}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"style-state-defaults.js","sourceRoot":"","sources":["../../../../../../../../../libs/components/text-editor/src/lib/modules/text-editor/defaults/style-state-defaults.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"style-state-defaults.js","sourceRoot":"","sources":["../../../../../../../../../libs/components/text-editor/src/lib/modules/text-editor/defaults/style-state-defaults.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE1D;;GAEG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAA4B;IAC3D,SAAS,EAAE,kBAAkB;IAC7B,SAAS,EAAE,MAAM;IACjB,QAAQ,EAAE,EAAE;IACZ,IAAI,EAAE,kBAAkB,CAAC,CAAC,CAAC,CAAC,KAAK;IACjC,SAAS,EAAE,KAAK;IAChB,WAAW,EAAE,KAAK;IAClB,cAAc,EAAE,KAAK;IACrB,SAAS,EAAE,KAAK;CACjB,CAAC","sourcesContent":["import { SkyTextEditorStyleState } from '../types/style-state';\n\nimport { FONT_LIST_DEFAULTS } from './font-list-defaults';\n\n/**\n * @internal\n */\nexport const STYLE_STATE_DEFAULTS: SkyTextEditorStyleState = {\n backColor: 'rgba(0, 0, 0, 0)',\n fontColor: '#000',\n fontSize: 14,\n font: FONT_LIST_DEFAULTS[0].value,\n boldState: false,\n italicState: false,\n underlineState: false,\n linkState: false,\n};\n"]}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ChangeDetectionStrategy, ChangeDetectorRef, Component, Input, } from '@angular/core';
|
|
2
2
|
import { SkyLibResourcesService } from '@skyux/i18n';
|
|
3
3
|
import { SkyDropdownMessageType } from '@skyux/popovers';
|
|
4
|
-
import {
|
|
4
|
+
import { Subject, forkJoin } from 'rxjs';
|
|
5
5
|
import { take, takeUntil } from 'rxjs/operators';
|
|
6
|
-
import { SkyTextEditorAdapterService } from '../services/text-editor-adapter.service';
|
|
7
6
|
import { SkyFormsUtility } from '../../shared/forms-utility';
|
|
7
|
+
import { SkyTextEditorAdapterService } from '../services/text-editor-adapter.service';
|
|
8
8
|
import * as i0 from "@angular/core";
|
|
9
9
|
import * as i1 from "../services/text-editor-adapter.service";
|
|
10
10
|
import * as i2 from "@skyux/i18n";
|
|
@@ -163,7 +163,7 @@ export class SkyTextEditorMenubarComponent {
|
|
|
163
163
|
this.mergeFieldDropdownStream.next({ type: SkyDropdownMessageType.Close });
|
|
164
164
|
}
|
|
165
165
|
clearFormat() {
|
|
166
|
-
|
|
166
|
+
const currentSelection = this.adapterService.getCurrentSelection(this.editorId);
|
|
167
167
|
/* istanbul ignore else */
|
|
168
168
|
if (currentSelection.rangeCount > 0 &&
|
|
169
169
|
currentSelection.getRangeAt(0).toString().length <= 0) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"text-editor-menubar.component.js","sourceRoot":"","sources":["../../../../../../../../../libs/components/text-editor/src/lib/modules/text-editor/menubar/text-editor-menubar.component.ts","../../../../../../../../../libs/components/text-editor/src/lib/modules/text-editor/menubar/text-editor-menubar.component.html"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EACjB,uBAAuB,EACvB,SAAS,EACT,KAAK,GAGN,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAErD,OAAO,EAAsB,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AAE7E,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAEzC,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAEjD,OAAO,EAAE,2BAA2B,EAAE,MAAM,yCAAyC,CAAC;AAMtF,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;;;;;;;;AAE7D;;GAEG;AAOH,MAAM,OAAO,6BAA6B;IAkDxC,YACU,cAA2C,EAC3C,cAAiC,EACjC,SAAiC;QAFjC,mBAAc,GAAd,cAAc,CAA6B;QAC3C,mBAAc,GAAd,cAAc,CAAmB;QACjC,cAAS,GAAT,SAAS,CAAwB;QAnDpC,sBAAiB,GAAG,IAAI,OAAO,EAAE,CAAC;QAMlC,UAAK,GAA4B,EAAE,CAAC;QAGpC,gBAAW,GAA8B,EAAE,CAAC;QAe3C,cAAS,GAAY,KAAK,CAAC;QAE5B,uBAAkB,GAAG,IAAI,OAAO,EAAsB,CAAC;QASvD,yBAAoB,GAAG,IAAI,OAAO,EAAsB,CAAC;QASzD,6B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C5D,IAAI,CAAC,QAAQ,CACd,CAAC;QACF,0BAA0B;QAC1B,IACE,gBAAgB,CAAC,UAAU,GAAG,CAAC;YAC/B,gBAAgB,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,MAAM,IAAI,CAAC,EACrD;YACA,IAAI,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC;SAC/B;QACD,IAAI,CAAC,WAAW,CAAC,cAAc,CAAC,CAAC;IACnC,CAAC;;2HAzOU,6BAA6B;+GAA7B,6BAA6B,2MClC1C,8pHA8GA;4FD5Ea,6BAA6B;kBANzC,SAAS;mBAAC;oBACT,QAAQ,EAAE,yBAAyB;oBACnC,WAAW,EAAE,sCAAsC;oBACnD,SAAS,EAAE,CAAC,sCAAsC,CAAC;oBACnD,eAAe,EAAE,uBAAuB,CAAC,MAAM;iBAChD;uLAGQ,iBAAiB;sBADvB,KAAK;gBAIC,QAAQ;sBADd,KAAK;gBAIC,KAAK;sBADX,KAAK;gBAIC,WAAW;sBADjB,KAAK;gBAIK,QAAQ;sBADlB,KAAK","sourcesContent":["import {\n ChangeDetectorRef,\n ChangeDetectionStrategy,\n Component,\n Input,\n OnDestroy,\n OnInit,\n} from '@angular/core';\n\nimport { SkyLibResourcesService } from '@skyux/i18n';\n\nimport { SkyDropdownMessage, SkyDropdownMessageType } from '@skyux/popovers';\n\nimport { forkJoin, Subject } from 'rxjs';\n\nimport { take, takeUntil } from 'rxjs/operators';\n\nimport { SkyTextEditorAdapterService } from '../services/text-editor-adapter.service';\n\nimport { SkyTextEditorMenuType } from '../types/menu-type';\n\nimport { SkyTextEditorMergeField } from '../types/text-editor-merge-field';\n\nimport { SkyFormsUtility } from '../../shared/forms-utility';\n\n/**\n * @internal\n */\n@Component({\n selector: 'sky-text-editor-menubar',\n templateUrl: './text-editor-menubar.component.html',\n styleUrls: ['./text-editor-menubar.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class SkyTextEditorMenubarComponent implements OnDestroy, OnInit {\n @Input()\n public editorFocusStream = new Subject();\n\n @Input()\n public editorId: string;\n\n @Input()\n public menus: SkyTextEditorMenuType[] = [];\n\n @Input()\n public mergeFields: SkyTextEditorMergeField[] = [];\n\n @Input()\n public set disabled(value: boolean) {\n const coercedValue = SkyFormsUtility.coerceBooleanProperty(value);\n if (coercedValue !== this.disabled) {\n this._disabled = coercedValue;\n this.changeDetector.markForCheck();\n }\n }\n\n public get disabled(): boolean {\n return this._disabled;\n }\n\n private _disabled: boolean = false;\n\n public editDropdownStream = new Subject<SkyDropdownMessage>();\n\n public editItems: {\n function?: () => void;\n isDivider?: boolean;\n label?: string;\n keyShortcut?: string;\n }[];\n\n public formatDropdownStream = new Subject<SkyDropdownMessage>();\n\n public formatItems: {\n function?: () => void;\n isDivider?: boolean;\n label?: string;\n keyShortcut?: string;\n }[];\n\n public mergeFieldDropdownStream = new Subject<SkyDropdownMessage>();\n\n private ngUnsubscribe = new Subject<void>();\n\n constructor(\n private adapterService: SkyTextEditorAdapterService,\n private changeDetector: ChangeDetectorRef,\n private resources: SkyLibResourcesService\n ) {}\n\n public ngOnInit(): void {\n this.editorFocusStream.pipe(takeUntil(this.ngUnsubscribe)).subscribe(() => {\n this.closeDropdowns();\n });\n\n forkJoin([\n // Format menu strings.\n this.resources.getString(\n 'skyux_text_editor_format_menu_action_bold_label'\n ),\n this.resources.getString(\n 'skyux_text_editor_format_menu_action_bold_key_shortcut'\n ),\n this.resources.getString(\n 'skyux_text_editor_format_menu_action_italic_label'\n ),\n this.resources.getString(\n 'skyux_text_editor_format_menu_action_italic_key_shortcut'\n ),\n this.resources.getString(\n 'skyux_text_editor_format_menu_action_underline_label'\n ),\n this.resources.getString(\n 'skyux_text_editor_format_menu_action_underline_key_shortcut'\n ),\n this.resources.getString(\n 'skyux_text_editor_format_menu_action_strikethrough_label'\n ),\n this.resources.getString(\n 'skyux_text_editor_format_menu_action_clear_formatting_label'\n ),\n\n // Edit menu string - start at index 8.\n this.resources.getString('skyux_text_editor_edit_menu_action_undo_label'),\n this.resources.getString(\n 'skyux_text_editor_edit_menu_action_undo_key_shortcut'\n ),\n this.resources.getString('skyux_text_editor_edit_menu_action_redo_label'),\n this.resources.getString(\n 'skyux_text_editor_edit_menu_action_redo_key_shortcut'\n ),\n this.resources.getString('skyux_text_editor_edit_menu_action_cut_label'),\n this.resources.getString(\n 'skyux_text_editor_edit_menu_action_cut_key_shortcut'\n ),\n this.resources.getString('skyux_text_editor_edit_menu_action_copy_label'),\n this.resources.getString(\n 'skyux_text_editor_edit_menu_action_copy_key_shortcut'\n ),\n this.resources.getString(\n 'skyux_text_editor_edit_menu_action_paste_label'\n ),\n this.resources.getString(\n 'skyux_text_editor_edit_menu_action_paste_key_shortcut'\n ),\n this.resources.getString(\n 'skyux_text_editor_edit_menu_action_select_all_label'\n ),\n this.resources.getString(\n 'skyux_text_editor_edit_menu_action_select_all_key_shortcut'\n ),\n ])\n .pipe(take(1))\n .subscribe((resources) => {\n this.formatItems = [\n {\n function: () => this.execCommand('bold'),\n label: resources[0],\n keyShortcut: resources[1],\n },\n {\n function: () => this.execCommand('italic'),\n label: resources[2],\n keyShortcut: resources[3],\n },\n {\n function: () => this.execCommand('underline'),\n label: resources[4],\n keyShortcut: resources[5],\n },\n {\n function: () => this.execCommand('strikethrough'),\n label: resources[6],\n },\n {\n isDivider: true,\n },\n {\n function: () => this.clearFormat(),\n label: resources[7],\n },\n ];\n this.editItems = [\n {\n function: () => this.execCommand('undo'),\n label: resources[8],\n keyShortcut: resources[9],\n },\n {\n function: () => this.execCommand('redo'),\n label: resources[10],\n keyShortcut: resources[11],\n },\n {\n isDivider: true,\n },\n {\n function: () => this.execCommand('cut'),\n label: resources[12],\n keyShortcut: resources[13],\n },\n {\n function: () => this.execCommand('copy'),\n label: resources[14],\n keyShortcut: resources[15],\n },\n {\n function: () => this.execCommand('paste'),\n label: resources[16],\n keyShortcut: resources[17],\n },\n {\n isDivider: true,\n },\n {\n function: () => this.execCommand('selectAll'),\n label: resources[18],\n keyShortcut: resources[19],\n },\n ];\n });\n }\n\n public ngOnDestroy(): void {\n this.ngUnsubscribe.next();\n this.ngUnsubscribe.complete();\n }\n\n public execCommand(command: string, value: any = ''): void {\n this.adapterService.execCommand(this.editorId, {\n command: command,\n value: value,\n });\n }\n\n public insertMergeField(field: SkyTextEditorMergeField): void {\n this.execCommand(\n 'insertHTML',\n '<img style=\"display: inline; cursor: grab;\" data-fieldid=\"' +\n field.id +\n '\" data-fielddisplay=\"' +\n field.name +\n '\" src=\"' +\n (field.previewImageUrl ||\n this.adapterService.getMergeFieldDataURI(field.name)) +\n '\">'\n );\n }\n\n private closeDropdowns(): void {\n this.editDropdownStream.next({ type: SkyDropdownMessageType.Close });\n this.formatDropdownStream.next({ type: SkyDropdownMessageType.Close });\n this.mergeFieldDropdownStream.next({ type: SkyDropdownMessageType.Close });\n }\n\n private clearFormat(): void {\n let currentSelection = this.adapterService.getCurrentSelection(\n this.editorId\n );\n /* istanbul ignore else */\n if (\n currentSelection.rangeCount > 0 &&\n currentSelection.getRangeAt(0).toString().length <= 0\n ) {\n this.execCommand('selectAll');\n }\n this.execCommand('removeFormat');\n }\n}\n","<sky-toolbar-item\n *ngFor=\"let menu of menus\"\n class=\"sky-text-editor-menu\"\n [ngClass]=\"'sky-text-editor-menu-' + menu\"\n>\n <ng-container [ngSwitch]=\"menu\">\n <ng-container *ngSwitchCase=\"'edit'\">\n <sky-dropdown\n label=\"Edit menu\"\n [disabled]=\"disabled\"\n [messageStream]=\"editDropdownStream\"\n >\n <sky-dropdown-button>\n {{\n 'skyux_text_editor_menubar_dropdown_button_edit_label'\n | skyLibResources\n }}\n </sky-dropdown-button>\n <sky-dropdown-menu>\n <sky-dropdown-item *ngFor=\"let editItem of editItems\">\n <button\n *ngIf=\"!editItem.isDivider\"\n type=\"button\"\n (click)=\"editItem.function()\"\n >\n {{ editItem.label }}\n <div\n *ngIf=\"editItem.keyShortcut\"\n class=\"sky-text-editor-menu-key-shortcut\"\n [skyThemeClass]=\"{\n 'sky-font-deemphasized': 'modern',\n 'sky-deemphasized': 'default'\n }\"\n >\n {{ editItem.keyShortcut }}\n </div>\n </button>\n <div\n *ngIf=\"editItem.isDivider\"\n class=\"sky-text-editor-dropdown-item-divider\"\n role=\"divider\"\n ></div>\n </sky-dropdown-item>\n </sky-dropdown-menu>\n </sky-dropdown>\n </ng-container>\n <ng-container *ngSwitchCase=\"'format'\">\n <sky-dropdown\n label=\"Format menu\"\n [disabled]=\"disabled\"\n [messageStream]=\"formatDropdownStream\"\n >\n <sky-dropdown-button>\n {{\n 'skyux_text_editor_menubar_dropdown_button_format_label'\n | skyLibResources\n }}\n </sky-dropdown-button>\n <sky-dropdown-menu>\n <sky-dropdown-item *ngFor=\"let formatItem of formatItems\">\n <button\n *ngIf=\"!formatItem.isDivider\"\n type=\"button\"\n (click)=\"formatItem.function()\"\n >\n {{ formatItem.label }}\n <div\n *ngIf=\"formatItem.keyShortcut\"\n class=\"sky-text-editor-menu-key-shortcut\"\n [skyThemeClass]=\"{\n 'sky-font-deemphasized': 'modern',\n 'sky-deemphasized': 'default'\n }\"\n >\n {{ formatItem.keyShortcut }}\n </div>\n </button>\n <div\n *ngIf=\"formatItem.isDivider\"\n class=\"sky-text-editor-dropdown-item-divider\"\n role=\"divider\"\n ></div>\n </sky-dropdown-item>\n </sky-dropdown-menu>\n </sky-dropdown>\n </ng-container>\n <ng-container *ngSwitchCase=\"'merge-field'\">\n <sky-dropdown\n *ngIf=\"mergeFields && mergeFields.length > 0\"\n label=\"Insert merge field\"\n [disabled]=\"disabled\"\n [messageStream]=\"mergeFieldDropdownStream\"\n >\n <sky-dropdown-button>\n {{\n 'skyux_text_editor_menubar_dropdown_button_insert_label'\n | skyLibResources\n }}\n </sky-dropdown-button>\n <sky-dropdown-menu>\n <sky-dropdown-item *ngFor=\"let mergeField of mergeFields\">\n <button type=\"button\" (click)=\"insertMergeField(mergeField)\">\n {{ mergeField.name }}\n </button>\n </sky-dropdown-item>\n </sky-dropdown-menu>\n </sky-dropdown>\n </ng-container>\n </ng-container>\n</sky-toolbar-item>\n"]}
|
|
1
|
+
{"version":3,"file":"text-editor-menubar.component.js","sourceRoot":"","sources":["../../../../../../../../../libs/components/text-editor/src/lib/modules/text-editor/menubar/text-editor-menubar.component.ts","../../../../../../../../../libs/components/text-editor/src/lib/modules/text-editor/menubar/text-editor-menubar.component.html"],"names":[],"mappings":"AAAA,OAAO,EACL,uBAAuB,EACvB,iBAAiB,EACjB,SAAS,EACT,KAAK,GAGN,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AACrD,OAAO,EAAsB,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AAE7E,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,MAAM,CAAC;AACzC,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAEjD,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAC7D,OAAO,EAAE,2BAA2B,EAAE,MAAM,yCAAyC,CAAC;;;;;;;;AAItF;;GAEG;AAOH,MAAM,OAAO,6BAA6B;IAkDxC,YACU,cAA2C,EAC3C,cAAiC,EACjC,SAAiC;QAFjC,mBAAc,GAAd,cAAc,CAA6B;QAC3C,mBAAc,GAAd,cAAc,CAAmB;QACjC,cAAS,GAAT,SAAS,CAAwB;QAnDpC,sBAAiB,GAAG,IAAI,OAAO,EAAE,CAAC;QAMlC,UAAK,GAA4B,EAAE,CAAC;QAGpC,gBAAW,GAA8B,EAAE,CAAC;QAe3C,cAAS,GAAG,KAAK,CAAC;QAEnB,uBAAkB,GAAG,IAAI,OAAO,EAAsB,CAAC;QASvD,yBAAoB,GAAG,IAAI,OAAO,EAAsB,CAAC;QASzD,6BAAwB,GAAG,IAAI,OAAO,EAAsB,CAAC;QAE5D,kBAAa,GAAG,IAAI,OAAO,EAAQ,CAAC;IAMzC,CAAC;IAzCJ,IACW,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AAC,UAAU,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,MAAM,IAAI,CAAC,EACrD;YACA,IAAI,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC;SAC/B;QACD,IAAI,CAAC,WAAW,CAAC,cAAc,CAAC,CAAC;IACnC,CAAC;;2HAzOU,6BAA6B;+GAA7B,6BAA6B,2MC5B1C,8pHA8GA;4FDlFa,6BAA6B;kBANzC,SAAS;mBAAC;oBACT,QAAQ,EAAE,yBAAyB;oBACnC,WAAW,EAAE,sCAAsC;oBACnD,SAAS,EAAE,CAAC,sCAAsC,CAAC;oBACnD,eAAe,EAAE,uBAAuB,CAAC,MAAM;iBAChD;uLAGQ,iBAAiB;sBADvB,KAAK;gBAIC,QAAQ;sBADd,KAAK;gBAIC,KAAK;sBADX,KAAK;gBAIC,WAAW;sBADjB,KAAK;gBAIK,QAAQ;sBADlB,KAAK","sourcesContent":["import {\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n Input,\n OnDestroy,\n OnInit,\n} from '@angular/core';\nimport { SkyLibResourcesService } from '@skyux/i18n';\nimport { SkyDropdownMessage, SkyDropdownMessageType } from '@skyux/popovers';\n\nimport { Subject, forkJoin } from 'rxjs';\nimport { take, takeUntil } from 'rxjs/operators';\n\nimport { SkyFormsUtility } from '../../shared/forms-utility';\nimport { SkyTextEditorAdapterService } from '../services/text-editor-adapter.service';\nimport { SkyTextEditorMenuType } from '../types/menu-type';\nimport { SkyTextEditorMergeField } from '../types/text-editor-merge-field';\n\n/**\n * @internal\n */\n@Component({\n selector: 'sky-text-editor-menubar',\n templateUrl: './text-editor-menubar.component.html',\n styleUrls: ['./text-editor-menubar.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class SkyTextEditorMenubarComponent implements OnDestroy, OnInit {\n @Input()\n public editorFocusStream = new Subject();\n\n @Input()\n public editorId: string;\n\n @Input()\n public menus: SkyTextEditorMenuType[] = [];\n\n @Input()\n public mergeFields: SkyTextEditorMergeField[] = [];\n\n @Input()\n public set disabled(value: boolean) {\n const coercedValue = SkyFormsUtility.coerceBooleanProperty(value);\n if (coercedValue !== this.disabled) {\n this._disabled = coercedValue;\n this.changeDetector.markForCheck();\n }\n }\n\n public get disabled(): boolean {\n return this._disabled;\n }\n\n private _disabled = false;\n\n public editDropdownStream = new Subject<SkyDropdownMessage>();\n\n public editItems: {\n function?: () => void;\n isDivider?: boolean;\n label?: string;\n keyShortcut?: string;\n }[];\n\n public formatDropdownStream = new Subject<SkyDropdownMessage>();\n\n public formatItems: {\n function?: () => void;\n isDivider?: boolean;\n label?: string;\n keyShortcut?: string;\n }[];\n\n public mergeFieldDropdownStream = new Subject<SkyDropdownMessage>();\n\n private ngUnsubscribe = new Subject<void>();\n\n constructor(\n private adapterService: SkyTextEditorAdapterService,\n private changeDetector: ChangeDetectorRef,\n private resources: SkyLibResourcesService\n ) {}\n\n public ngOnInit(): void {\n this.editorFocusStream.pipe(takeUntil(this.ngUnsubscribe)).subscribe(() => {\n this.closeDropdowns();\n });\n\n forkJoin([\n // Format menu strings.\n this.resources.getString(\n 'skyux_text_editor_format_menu_action_bold_label'\n ),\n this.resources.getString(\n 'skyux_text_editor_format_menu_action_bold_key_shortcut'\n ),\n this.resources.getString(\n 'skyux_text_editor_format_menu_action_italic_label'\n ),\n this.resources.getString(\n 'skyux_text_editor_format_menu_action_italic_key_shortcut'\n ),\n this.resources.getString(\n 'skyux_text_editor_format_menu_action_underline_label'\n ),\n this.resources.getString(\n 'skyux_text_editor_format_menu_action_underline_key_shortcut'\n ),\n this.resources.getString(\n 'skyux_text_editor_format_menu_action_strikethrough_label'\n ),\n this.resources.getString(\n 'skyux_text_editor_format_menu_action_clear_formatting_label'\n ),\n\n // Edit menu string - start at index 8.\n this.resources.getString('skyux_text_editor_edit_menu_action_undo_label'),\n this.resources.getString(\n 'skyux_text_editor_edit_menu_action_undo_key_shortcut'\n ),\n this.resources.getString('skyux_text_editor_edit_menu_action_redo_label'),\n this.resources.getString(\n 'skyux_text_editor_edit_menu_action_redo_key_shortcut'\n ),\n this.resources.getString('skyux_text_editor_edit_menu_action_cut_label'),\n this.resources.getString(\n 'skyux_text_editor_edit_menu_action_cut_key_shortcut'\n ),\n this.resources.getString('skyux_text_editor_edit_menu_action_copy_label'),\n this.resources.getString(\n 'skyux_text_editor_edit_menu_action_copy_key_shortcut'\n ),\n this.resources.getString(\n 'skyux_text_editor_edit_menu_action_paste_label'\n ),\n this.resources.getString(\n 'skyux_text_editor_edit_menu_action_paste_key_shortcut'\n ),\n this.resources.getString(\n 'skyux_text_editor_edit_menu_action_select_all_label'\n ),\n this.resources.getString(\n 'skyux_text_editor_edit_menu_action_select_all_key_shortcut'\n ),\n ])\n .pipe(take(1))\n .subscribe((resources) => {\n this.formatItems = [\n {\n function: () => this.execCommand('bold'),\n label: resources[0],\n keyShortcut: resources[1],\n },\n {\n function: () => this.execCommand('italic'),\n label: resources[2],\n keyShortcut: resources[3],\n },\n {\n function: () => this.execCommand('underline'),\n label: resources[4],\n keyShortcut: resources[5],\n },\n {\n function: () => this.execCommand('strikethrough'),\n label: resources[6],\n },\n {\n isDivider: true,\n },\n {\n function: () => this.clearFormat(),\n label: resources[7],\n },\n ];\n this.editItems = [\n {\n function: () => this.execCommand('undo'),\n label: resources[8],\n keyShortcut: resources[9],\n },\n {\n function: () => this.execCommand('redo'),\n label: resources[10],\n keyShortcut: resources[11],\n },\n {\n isDivider: true,\n },\n {\n function: () => this.execCommand('cut'),\n label: resources[12],\n keyShortcut: resources[13],\n },\n {\n function: () => this.execCommand('copy'),\n label: resources[14],\n keyShortcut: resources[15],\n },\n {\n function: () => this.execCommand('paste'),\n label: resources[16],\n keyShortcut: resources[17],\n },\n {\n isDivider: true,\n },\n {\n function: () => this.execCommand('selectAll'),\n label: resources[18],\n keyShortcut: resources[19],\n },\n ];\n });\n }\n\n public ngOnDestroy(): void {\n this.ngUnsubscribe.next();\n this.ngUnsubscribe.complete();\n }\n\n public execCommand(command: string, value: any = ''): void {\n this.adapterService.execCommand(this.editorId, {\n command: command,\n value: value,\n });\n }\n\n public insertMergeField(field: SkyTextEditorMergeField): void {\n this.execCommand(\n 'insertHTML',\n '<img style=\"display: inline; cursor: grab;\" data-fieldid=\"' +\n field.id +\n '\" data-fielddisplay=\"' +\n field.name +\n '\" src=\"' +\n (field.previewImageUrl ||\n this.adapterService.getMergeFieldDataURI(field.name)) +\n '\">'\n );\n }\n\n private closeDropdowns(): void {\n this.editDropdownStream.next({ type: SkyDropdownMessageType.Close });\n this.formatDropdownStream.next({ type: SkyDropdownMessageType.Close });\n this.mergeFieldDropdownStream.next({ type: SkyDropdownMessageType.Close });\n }\n\n private clearFormat(): void {\n const currentSelection = this.adapterService.getCurrentSelection(\n this.editorId\n );\n /* istanbul ignore else */\n if (\n currentSelection.rangeCount > 0 &&\n currentSelection.getRangeAt(0).toString().length <= 0\n ) {\n this.execCommand('selectAll');\n }\n this.execCommand('removeFormat');\n }\n}\n","<sky-toolbar-item\n *ngFor=\"let menu of menus\"\n class=\"sky-text-editor-menu\"\n [ngClass]=\"'sky-text-editor-menu-' + menu\"\n>\n <ng-container [ngSwitch]=\"menu\">\n <ng-container *ngSwitchCase=\"'edit'\">\n <sky-dropdown\n label=\"Edit menu\"\n [disabled]=\"disabled\"\n [messageStream]=\"editDropdownStream\"\n >\n <sky-dropdown-button>\n {{\n 'skyux_text_editor_menubar_dropdown_button_edit_label'\n | skyLibResources\n }}\n </sky-dropdown-button>\n <sky-dropdown-menu>\n <sky-dropdown-item *ngFor=\"let editItem of editItems\">\n <button\n *ngIf=\"!editItem.isDivider\"\n type=\"button\"\n (click)=\"editItem.function()\"\n >\n {{ editItem.label }}\n <div\n *ngIf=\"editItem.keyShortcut\"\n class=\"sky-text-editor-menu-key-shortcut\"\n [skyThemeClass]=\"{\n 'sky-font-deemphasized': 'modern',\n 'sky-deemphasized': 'default'\n }\"\n >\n {{ editItem.keyShortcut }}\n </div>\n </button>\n <div\n *ngIf=\"editItem.isDivider\"\n class=\"sky-text-editor-dropdown-item-divider\"\n role=\"divider\"\n ></div>\n </sky-dropdown-item>\n </sky-dropdown-menu>\n </sky-dropdown>\n </ng-container>\n <ng-container *ngSwitchCase=\"'format'\">\n <sky-dropdown\n label=\"Format menu\"\n [disabled]=\"disabled\"\n [messageStream]=\"formatDropdownStream\"\n >\n <sky-dropdown-button>\n {{\n 'skyux_text_editor_menubar_dropdown_button_format_label'\n | skyLibResources\n }}\n </sky-dropdown-button>\n <sky-dropdown-menu>\n <sky-dropdown-item *ngFor=\"let formatItem of formatItems\">\n <button\n *ngIf=\"!formatItem.isDivider\"\n type=\"button\"\n (click)=\"formatItem.function()\"\n >\n {{ formatItem.label }}\n <div\n *ngIf=\"formatItem.keyShortcut\"\n class=\"sky-text-editor-menu-key-shortcut\"\n [skyThemeClass]=\"{\n 'sky-font-deemphasized': 'modern',\n 'sky-deemphasized': 'default'\n }\"\n >\n {{ formatItem.keyShortcut }}\n </div>\n </button>\n <div\n *ngIf=\"formatItem.isDivider\"\n class=\"sky-text-editor-dropdown-item-divider\"\n role=\"divider\"\n ></div>\n </sky-dropdown-item>\n </sky-dropdown-menu>\n </sky-dropdown>\n </ng-container>\n <ng-container *ngSwitchCase=\"'merge-field'\">\n <sky-dropdown\n *ngIf=\"mergeFields && mergeFields.length > 0\"\n label=\"Insert merge field\"\n [disabled]=\"disabled\"\n [messageStream]=\"mergeFieldDropdownStream\"\n >\n <sky-dropdown-button>\n {{\n 'skyux_text_editor_menubar_dropdown_button_insert_label'\n | skyLibResources\n }}\n </sky-dropdown-button>\n <sky-dropdown-menu>\n <sky-dropdown-item *ngFor=\"let mergeField of mergeFields\">\n <button type=\"button\" (click)=\"insertMergeField(mergeField)\">\n {{ mergeField.name }}\n </button>\n </sky-dropdown-item>\n </sky-dropdown-menu>\n </sky-dropdown>\n </ng-container>\n </ng-container>\n</sky-toolbar-item>\n"]}
|
|
@@ -3,8 +3,8 @@ import { SkyAppWindowRef } from '@skyux/core';
|
|
|
3
3
|
import { Subject } from 'rxjs';
|
|
4
4
|
import { STYLE_STATE_DEFAULTS } from '../defaults/style-state-defaults';
|
|
5
5
|
import { UrlTarget } from '../url-modal/text-editor-url-target';
|
|
6
|
-
import { SkyTextEditorService } from './text-editor.service';
|
|
7
6
|
import { SkyTextEditorSelectionService } from './text-editor-selection.service';
|
|
7
|
+
import { SkyTextEditorService } from './text-editor.service';
|
|
8
8
|
import * as i0 from "@angular/core";
|
|
9
9
|
import * as i1 from "./text-editor-selection.service";
|
|
10
10
|
import * as i2 from "./text-editor.service";
|
|
@@ -216,7 +216,7 @@ export class SkyTextEditorAdapterService {
|
|
|
216
216
|
const doc = this.getIframeDocumentEl(id);
|
|
217
217
|
this.execCommand(id, { command: 'fontSize', value: 1 });
|
|
218
218
|
const fontElements = Array.from(doc.querySelectorAll('font[size="1"]'));
|
|
219
|
-
for (
|
|
219
|
+
for (const element of fontElements) {
|
|
220
220
|
element.removeAttribute('size');
|
|
221
221
|
element.style.fontSize = fontSize + 'px';
|
|
222
222
|
}
|
|
@@ -421,7 +421,7 @@ export class SkyTextEditorAdapterService {
|
|
|
421
421
|
}
|
|
422
422
|
cleanUpBlankStyleTags(doc) {
|
|
423
423
|
const orphanElements = Array.from(doc.querySelectorAll('font,span,*[style=""]'));
|
|
424
|
-
for (
|
|
424
|
+
for (const element of orphanElements) {
|
|
425
425
|
if (!element.getAttribute('style')) {
|
|
426
426
|
element.removeAttribute('style');
|
|
427
427
|
}
|
|
@@ -431,7 +431,7 @@ export class SkyTextEditorAdapterService {
|
|
|
431
431
|
return ((tagName === 'FONT' || tagName === 'SPAN') &&
|
|
432
432
|
(element.attributes.length === 0 || !element.hasChildNodes));
|
|
433
433
|
});
|
|
434
|
-
for (
|
|
434
|
+
for (const element of removableElements) {
|
|
435
435
|
const parent = element.parentNode;
|
|
436
436
|
/* istanbul ignore else */
|
|
437
437
|
if (parent) {
|