@skyux/text-editor 5.7.2 → 6.0.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/documentation.json +2 -2
- package/esm2020/index.mjs +15 -0
- package/esm2020/lib/modules/rich-text-display/rich-text-display.component.mjs +36 -0
- package/esm2020/lib/modules/rich-text-display/rich-text-display.module.mjs +18 -0
- package/esm2020/lib/modules/shared/forms-utility.mjs +10 -0
- package/esm2020/lib/modules/shared/sky-text-editor-resources.module.mjs +106 -0
- package/esm2020/lib/modules/text-editor/defaults/font-list-defaults.mjs +42 -0
- package/esm2020/lib/modules/text-editor/defaults/font-size-list-defaults.mjs +7 -0
- package/esm2020/lib/modules/text-editor/defaults/menu-defaults.mjs +5 -0
- package/esm2020/lib/modules/text-editor/defaults/style-state-defaults.mjs +15 -0
- package/esm2020/lib/modules/text-editor/defaults/toolbar-action-defaults.mjs +12 -0
- package/esm2020/lib/modules/text-editor/menubar/text-editor-menubar.component.mjs +191 -0
- package/esm2020/lib/modules/text-editor/services/text-editor-adapter.service.mjs +477 -0
- package/esm2020/lib/modules/text-editor/services/text-editor-selection.service.mjs +80 -0
- package/esm2020/lib/modules/text-editor/services/text-editor.service.mjs +61 -0
- package/esm2020/lib/modules/text-editor/services/text-sanitization.service.mjs +38 -0
- package/esm2020/lib/modules/text-editor/text-editor.component.mjs +322 -0
- package/esm2020/lib/modules/text-editor/text-editor.module.mjs +98 -0
- package/esm2020/lib/modules/text-editor/toolbar/text-editor-toolbar.component.mjs +179 -0
- package/esm2020/lib/modules/text-editor/types/editor-command.mjs +2 -0
- package/esm2020/lib/modules/text-editor/types/editor-setting.mjs +2 -0
- package/esm2020/lib/modules/text-editor/types/font-state.mjs +2 -0
- package/esm2020/lib/modules/text-editor/types/menu-type.mjs +2 -0
- package/esm2020/lib/modules/text-editor/types/style-state.mjs +2 -0
- package/esm2020/lib/modules/text-editor/types/text-editor-merge-field.mjs +2 -0
- package/esm2020/lib/modules/text-editor/types/toolbar-action-type.mjs +2 -0
- package/esm2020/lib/modules/text-editor/url-modal/text-editor-url-modal-context.mjs +6 -0
- package/esm2020/lib/modules/text-editor/url-modal/text-editor-url-modal-result.mjs +2 -0
- package/esm2020/lib/modules/text-editor/url-modal/text-editor-url-modal.component.mjs +117 -0
- package/esm2020/lib/modules/text-editor/url-modal/text-editor-url-target.mjs +9 -0
- package/esm2020/skyux-text-editor.mjs +5 -0
- package/fesm2015/{skyux-text-editor.js → skyux-text-editor.mjs} +45 -69
- package/fesm2015/skyux-text-editor.mjs.map +1 -0
- package/fesm2020/skyux-text-editor.mjs +1743 -0
- package/fesm2020/skyux-text-editor.mjs.map +1 -0
- package/package.json +38 -22
- package/bundles/skyux-text-editor.umd.js +0 -2195
- package/esm2015/index.js +0 -15
- package/esm2015/index.js.map +0 -1
- package/esm2015/lib/modules/rich-text-display/rich-text-display.component.js +0 -39
- package/esm2015/lib/modules/rich-text-display/rich-text-display.component.js.map +0 -1
- package/esm2015/lib/modules/rich-text-display/rich-text-display.module.js +0 -18
- package/esm2015/lib/modules/rich-text-display/rich-text-display.module.js.map +0 -1
- package/esm2015/lib/modules/shared/forms-utility.js +0 -10
- package/esm2015/lib/modules/shared/forms-utility.js.map +0 -1
- package/esm2015/lib/modules/shared/sky-text-editor-resources.module.js +0 -106
- package/esm2015/lib/modules/shared/sky-text-editor-resources.module.js.map +0 -1
- package/esm2015/lib/modules/text-editor/defaults/font-list-defaults.js +0 -42
- package/esm2015/lib/modules/text-editor/defaults/font-list-defaults.js.map +0 -1
- package/esm2015/lib/modules/text-editor/defaults/font-size-list-defaults.js +0 -7
- package/esm2015/lib/modules/text-editor/defaults/font-size-list-defaults.js.map +0 -1
- package/esm2015/lib/modules/text-editor/defaults/menu-defaults.js +0 -5
- package/esm2015/lib/modules/text-editor/defaults/menu-defaults.js.map +0 -1
- package/esm2015/lib/modules/text-editor/defaults/style-state-defaults.js +0 -15
- package/esm2015/lib/modules/text-editor/defaults/style-state-defaults.js.map +0 -1
- package/esm2015/lib/modules/text-editor/defaults/toolbar-action-defaults.js +0 -12
- package/esm2015/lib/modules/text-editor/defaults/toolbar-action-defaults.js.map +0 -1
- package/esm2015/lib/modules/text-editor/menubar/text-editor-menubar.component.js +0 -196
- package/esm2015/lib/modules/text-editor/menubar/text-editor-menubar.component.js.map +0 -1
- package/esm2015/lib/modules/text-editor/services/text-editor-adapter.service.js +0 -474
- package/esm2015/lib/modules/text-editor/services/text-editor-adapter.service.js.map +0 -1
- package/esm2015/lib/modules/text-editor/services/text-editor-selection.service.js +0 -80
- package/esm2015/lib/modules/text-editor/services/text-editor-selection.service.js.map +0 -1
- package/esm2015/lib/modules/text-editor/services/text-editor.service.js +0 -61
- package/esm2015/lib/modules/text-editor/services/text-editor.service.js.map +0 -1
- package/esm2015/lib/modules/text-editor/services/text-sanitization.service.js +0 -38
- package/esm2015/lib/modules/text-editor/services/text-sanitization.service.js.map +0 -1
- package/esm2015/lib/modules/text-editor/text-editor.component.js +0 -322
- package/esm2015/lib/modules/text-editor/text-editor.component.js.map +0 -1
- package/esm2015/lib/modules/text-editor/text-editor.module.js +0 -99
- package/esm2015/lib/modules/text-editor/text-editor.module.js.map +0 -1
- package/esm2015/lib/modules/text-editor/toolbar/text-editor-toolbar.component.js +0 -175
- package/esm2015/lib/modules/text-editor/toolbar/text-editor-toolbar.component.js.map +0 -1
- package/esm2015/lib/modules/text-editor/types/editor-command.js +0 -2
- package/esm2015/lib/modules/text-editor/types/editor-command.js.map +0 -1
- package/esm2015/lib/modules/text-editor/types/editor-setting.js +0 -2
- package/esm2015/lib/modules/text-editor/types/editor-setting.js.map +0 -1
- package/esm2015/lib/modules/text-editor/types/font-state.js +0 -2
- package/esm2015/lib/modules/text-editor/types/font-state.js.map +0 -1
- package/esm2015/lib/modules/text-editor/types/menu-type.js +0 -2
- package/esm2015/lib/modules/text-editor/types/menu-type.js.map +0 -1
- package/esm2015/lib/modules/text-editor/types/style-state.js +0 -2
- package/esm2015/lib/modules/text-editor/types/style-state.js.map +0 -1
- package/esm2015/lib/modules/text-editor/types/text-editor-merge-field.js +0 -2
- package/esm2015/lib/modules/text-editor/types/text-editor-merge-field.js.map +0 -1
- package/esm2015/lib/modules/text-editor/types/toolbar-action-type.js +0 -2
- package/esm2015/lib/modules/text-editor/types/toolbar-action-type.js.map +0 -1
- package/esm2015/lib/modules/text-editor/url-modal/text-editor-url-modal-context.js +0 -6
- package/esm2015/lib/modules/text-editor/url-modal/text-editor-url-modal-context.js.map +0 -1
- package/esm2015/lib/modules/text-editor/url-modal/text-editor-url-modal-result.js +0 -2
- package/esm2015/lib/modules/text-editor/url-modal/text-editor-url-modal-result.js.map +0 -1
- package/esm2015/lib/modules/text-editor/url-modal/text-editor-url-modal.component.js +0 -121
- package/esm2015/lib/modules/text-editor/url-modal/text-editor-url-modal.component.js.map +0 -1
- package/esm2015/lib/modules/text-editor/url-modal/text-editor-url-target.js +0 -9
- package/esm2015/lib/modules/text-editor/url-modal/text-editor-url-target.js.map +0 -1
- package/esm2015/skyux-text-editor.js +0 -5
- package/esm2015/skyux-text-editor.js.map +0 -1
- package/fesm2015/skyux-text-editor.js.map +0 -1
|
@@ -1,2195 +0,0 @@
|
|
|
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/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
|
-
|
|
7
|
-
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
8
|
-
|
|
9
|
-
function _interopNamespace(e) {
|
|
10
|
-
if (e && e.__esModule) return e;
|
|
11
|
-
var n = Object.create(null);
|
|
12
|
-
if (e) {
|
|
13
|
-
Object.keys(e).forEach(function (k) {
|
|
14
|
-
if (k !== 'default') {
|
|
15
|
-
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
16
|
-
Object.defineProperty(n, k, d.get ? d : {
|
|
17
|
-
enumerable: true,
|
|
18
|
-
get: function () { return e[k]; }
|
|
19
|
-
});
|
|
20
|
-
}
|
|
21
|
-
});
|
|
22
|
-
}
|
|
23
|
-
n["default"] = e;
|
|
24
|
-
return Object.freeze(n);
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
var i5__namespace = /*#__PURE__*/_interopNamespace(i5);
|
|
28
|
-
var i0__namespace = /*#__PURE__*/_interopNamespace(i0);
|
|
29
|
-
var i1__namespace = /*#__PURE__*/_interopNamespace(i1);
|
|
30
|
-
var createDOMPurify__default = /*#__PURE__*/_interopDefaultLegacy(createDOMPurify);
|
|
31
|
-
var i5__namespace$1 = /*#__PURE__*/_interopNamespace(i5$1);
|
|
32
|
-
var i6__namespace$1 = /*#__PURE__*/_interopNamespace(i6$1);
|
|
33
|
-
var i3__namespace = /*#__PURE__*/_interopNamespace(i3);
|
|
34
|
-
var i4__namespace$1 = /*#__PURE__*/_interopNamespace(i4$1);
|
|
35
|
-
var i2__namespace = /*#__PURE__*/_interopNamespace(i2);
|
|
36
|
-
var i7__namespace = /*#__PURE__*/_interopNamespace(i7);
|
|
37
|
-
var i3__namespace$1 = /*#__PURE__*/_interopNamespace(i3$1);
|
|
38
|
-
var i1__namespace$1 = /*#__PURE__*/_interopNamespace(i1$1);
|
|
39
|
-
var i4__namespace = /*#__PURE__*/_interopNamespace(i4);
|
|
40
|
-
var i3__namespace$2 = /*#__PURE__*/_interopNamespace(i3$2);
|
|
41
|
-
var i6__namespace = /*#__PURE__*/_interopNamespace(i6);
|
|
42
|
-
|
|
43
|
-
var domPurify = createDOMPurify__default["default"](window);
|
|
44
|
-
domPurify.addHook('afterSanitizeAttributes', function (node) {
|
|
45
|
-
// Set all elements owning target to target=_blank
|
|
46
|
-
// so we only allow the target attribute with that value.
|
|
47
|
-
if (node.getAttribute('target')) {
|
|
48
|
-
node.setAttribute('target', '_blank');
|
|
49
|
-
node.setAttribute('rel', 'noopener noreferrer');
|
|
50
|
-
}
|
|
51
|
-
});
|
|
52
|
-
/**
|
|
53
|
-
* The `SkyTextSanitizationService` user the `DOMPurify` library to sanitize strings for use
|
|
54
|
-
* in the DOM. `DOMPurify` allows more customization than Angular's internal `DomSanitizer` so we
|
|
55
|
-
* can preserve `<style>` tags and allow `target` attributes for new tab links.
|
|
56
|
-
* @internal
|
|
57
|
-
*/
|
|
58
|
-
var SkyTextSanitizationService = /** @class */ (function () {
|
|
59
|
-
function SkyTextSanitizationService() {
|
|
60
|
-
this.allowedAttributes = ['target'];
|
|
61
|
-
}
|
|
62
|
-
/**
|
|
63
|
-
* Returns a sanitized string, allowing target attribute for new tab links.
|
|
64
|
-
*/
|
|
65
|
-
SkyTextSanitizationService.prototype.sanitize = function (htmlString) {
|
|
66
|
-
return domPurify.sanitize(htmlString, { ADD_ATTR: this.allowedAttributes });
|
|
67
|
-
};
|
|
68
|
-
return SkyTextSanitizationService;
|
|
69
|
-
}());
|
|
70
|
-
SkyTextSanitizationService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyTextSanitizationService, deps: [], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
71
|
-
SkyTextSanitizationService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyTextSanitizationService, providedIn: 'root' });
|
|
72
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyTextSanitizationService, decorators: [{
|
|
73
|
-
type: i0.Injectable,
|
|
74
|
-
args: [{
|
|
75
|
-
providedIn: 'root',
|
|
76
|
-
}]
|
|
77
|
-
}] });
|
|
78
|
-
|
|
79
|
-
var SkyRichTextDisplayComponent = /** @class */ (function () {
|
|
80
|
-
function SkyRichTextDisplayComponent(sanitizer, sanitizationService) {
|
|
81
|
-
this.sanitizer = sanitizer;
|
|
82
|
-
this.sanitizationService = sanitizationService;
|
|
83
|
-
this.sanitizedText = '';
|
|
84
|
-
this._richText = '';
|
|
85
|
-
}
|
|
86
|
-
Object.defineProperty(SkyRichTextDisplayComponent.prototype, "richText", {
|
|
87
|
-
/**
|
|
88
|
-
* Specifies the rich text to display.
|
|
89
|
-
*/
|
|
90
|
-
set: function (value) {
|
|
91
|
-
var cleaned = this.sanitizationService.sanitize(value);
|
|
92
|
-
/* istanbul ignore else */
|
|
93
|
-
if (cleaned !== this._richText) {
|
|
94
|
-
this._richText = cleaned;
|
|
95
|
-
// Text has already been sanitized with DOMPurifier.
|
|
96
|
-
// Tell Angular to bypass its own internal sanitization.
|
|
97
|
-
this.sanitizedText = this.sanitizer.bypassSecurityTrustHtml(cleaned);
|
|
98
|
-
}
|
|
99
|
-
},
|
|
100
|
-
enumerable: false,
|
|
101
|
-
configurable: true
|
|
102
|
-
});
|
|
103
|
-
return SkyRichTextDisplayComponent;
|
|
104
|
-
}());
|
|
105
|
-
SkyRichTextDisplayComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyRichTextDisplayComponent, deps: [{ token: i1__namespace.DomSanitizer }, { token: SkyTextSanitizationService }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
106
|
-
SkyRichTextDisplayComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: SkyRichTextDisplayComponent, selector: "sky-rich-text-display", inputs: { richText: "richText" }, ngImport: i0__namespace, template: "<span class=\"sky-rich-text-display-text\" [innerHTML]=\"sanitizedText\"> </span>\n" });
|
|
107
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyRichTextDisplayComponent, decorators: [{
|
|
108
|
-
type: i0.Component,
|
|
109
|
-
args: [{
|
|
110
|
-
selector: 'sky-rich-text-display',
|
|
111
|
-
template: "<span class=\"sky-rich-text-display-text\" [innerHTML]=\"sanitizedText\"> </span>\n",
|
|
112
|
-
}]
|
|
113
|
-
}], ctorParameters: function () { return [{ type: i1__namespace.DomSanitizer }, { type: SkyTextSanitizationService }]; }, propDecorators: { richText: [{
|
|
114
|
-
type: i0.Input
|
|
115
|
-
}] } });
|
|
116
|
-
|
|
117
|
-
var SkyRichTextDisplayModule = /** @class */ (function () {
|
|
118
|
-
function SkyRichTextDisplayModule() {
|
|
119
|
-
}
|
|
120
|
-
return SkyRichTextDisplayModule;
|
|
121
|
-
}());
|
|
122
|
-
SkyRichTextDisplayModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyRichTextDisplayModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
|
|
123
|
-
SkyRichTextDisplayModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyRichTextDisplayModule, declarations: [SkyRichTextDisplayComponent], imports: [i5.CommonModule], exports: [SkyRichTextDisplayComponent] });
|
|
124
|
-
SkyRichTextDisplayModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyRichTextDisplayModule, imports: [[i5.CommonModule]] });
|
|
125
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyRichTextDisplayModule, decorators: [{
|
|
126
|
-
type: i0.NgModule,
|
|
127
|
-
args: [{
|
|
128
|
-
imports: [i5.CommonModule],
|
|
129
|
-
exports: [SkyRichTextDisplayComponent],
|
|
130
|
-
declarations: [SkyRichTextDisplayComponent],
|
|
131
|
-
}]
|
|
132
|
-
}] });
|
|
133
|
-
|
|
134
|
-
/**
|
|
135
|
-
* NOTICE: DO NOT MODIFY THIS FILE!
|
|
136
|
-
* The contents of this file were automatically generated by
|
|
137
|
-
* the 'ng generate @skyux/i18n:lib-resources-module lib/modules/shared/sky-text-editor' schematic.
|
|
138
|
-
* To update this file, simply rerun the command.
|
|
139
|
-
*/
|
|
140
|
-
var RESOURCES = {
|
|
141
|
-
'EN-US': {
|
|
142
|
-
skyux_text_editor_format_menu_action_bold_label: { message: 'Bold' },
|
|
143
|
-
skyux_text_editor_format_menu_action_bold_key_shortcut: {
|
|
144
|
-
message: 'Ctrl+B',
|
|
145
|
-
},
|
|
146
|
-
skyux_text_editor_format_menu_action_italic_label: { message: 'Italic' },
|
|
147
|
-
skyux_text_editor_format_menu_action_italic_key_shortcut: {
|
|
148
|
-
message: 'Ctrl+I',
|
|
149
|
-
},
|
|
150
|
-
skyux_text_editor_format_menu_action_underline_label: {
|
|
151
|
-
message: 'Underline',
|
|
152
|
-
},
|
|
153
|
-
skyux_text_editor_format_menu_action_underline_key_shortcut: {
|
|
154
|
-
message: 'Ctrl+U',
|
|
155
|
-
},
|
|
156
|
-
skyux_text_editor_format_menu_action_strikethrough_label: {
|
|
157
|
-
message: 'Strikethrough',
|
|
158
|
-
},
|
|
159
|
-
skyux_text_editor_format_menu_action_clear_formatting_label: {
|
|
160
|
-
message: 'Clear formatting',
|
|
161
|
-
},
|
|
162
|
-
skyux_text_editor_edit_menu_action_undo_label: { message: 'Undo' },
|
|
163
|
-
skyux_text_editor_edit_menu_action_undo_key_shortcut: { message: 'Ctrl+Z' },
|
|
164
|
-
skyux_text_editor_edit_menu_action_redo_label: { message: 'Redo' },
|
|
165
|
-
skyux_text_editor_edit_menu_action_redo_key_shortcut: { message: 'Ctrl+Y' },
|
|
166
|
-
skyux_text_editor_edit_menu_action_cut_label: { message: 'Cut' },
|
|
167
|
-
skyux_text_editor_edit_menu_action_cut_key_shortcut: { message: 'Ctrl+X' },
|
|
168
|
-
skyux_text_editor_edit_menu_action_copy_label: { message: 'Copy' },
|
|
169
|
-
skyux_text_editor_edit_menu_action_copy_key_shortcut: { message: 'Ctrl+C' },
|
|
170
|
-
skyux_text_editor_edit_menu_action_paste_label: { message: 'Paste' },
|
|
171
|
-
skyux_text_editor_edit_menu_action_paste_key_shortcut: {
|
|
172
|
-
message: 'Ctrl+V',
|
|
173
|
-
},
|
|
174
|
-
skyux_text_editor_edit_menu_action_select_all_label: {
|
|
175
|
-
message: 'Select all',
|
|
176
|
-
},
|
|
177
|
-
skyux_text_editor_edit_menu_action_select_all_key_shortcut: {
|
|
178
|
-
message: 'Ctrl+A',
|
|
179
|
-
},
|
|
180
|
-
skyux_text_editor_menubar_dropdown_button_edit_label: { message: 'Edit' },
|
|
181
|
-
skyux_text_editor_menubar_dropdown_button_format_label: {
|
|
182
|
-
message: 'Format',
|
|
183
|
-
},
|
|
184
|
-
skyux_text_editor_menubar_dropdown_button_insert_label: {
|
|
185
|
-
message: 'Insert merge field',
|
|
186
|
-
},
|
|
187
|
-
skyux_text_editor_url_modal_header_label: { message: 'Create link' },
|
|
188
|
-
skyux_text_editor_url_modal_url_label: {
|
|
189
|
-
message: 'Enter a URL to link to:',
|
|
190
|
-
},
|
|
191
|
-
skyux_text_editor_url_modal_open_label: {
|
|
192
|
-
message: 'Where should it open?',
|
|
193
|
-
},
|
|
194
|
-
skyux_text_editor_url_modal_current_option_label: {
|
|
195
|
-
message: 'Current window',
|
|
196
|
-
},
|
|
197
|
-
skyux_text_editor_url_modal_new_option_label: { message: 'New window' },
|
|
198
|
-
skyux_text_editor_url_modal_email_label: { message: 'Email address' },
|
|
199
|
-
skyux_text_editor_url_modal_subject_label: { message: 'Subject line' },
|
|
200
|
-
skyux_text_editor_url_modal_save_button_label: { message: 'Save' },
|
|
201
|
-
skyux_text_editor_url_modal_cancel_button_label: { message: 'Cancel' },
|
|
202
|
-
},
|
|
203
|
-
};
|
|
204
|
-
var SkyTextEditorResourcesProvider = /** @class */ (function () {
|
|
205
|
-
function SkyTextEditorResourcesProvider() {
|
|
206
|
-
}
|
|
207
|
-
SkyTextEditorResourcesProvider.prototype.getString = function (localeInfo, name) {
|
|
208
|
-
return i2.getLibStringForLocale(RESOURCES, localeInfo.locale, name);
|
|
209
|
-
};
|
|
210
|
-
return SkyTextEditorResourcesProvider;
|
|
211
|
-
}());
|
|
212
|
-
/**
|
|
213
|
-
* Import into any component library module that needs to use resource strings.
|
|
214
|
-
*/
|
|
215
|
-
var SkyTextEditorResourcesModule = /** @class */ (function () {
|
|
216
|
-
function SkyTextEditorResourcesModule() {
|
|
217
|
-
}
|
|
218
|
-
return SkyTextEditorResourcesModule;
|
|
219
|
-
}());
|
|
220
|
-
SkyTextEditorResourcesModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyTextEditorResourcesModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
|
|
221
|
-
SkyTextEditorResourcesModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyTextEditorResourcesModule, exports: [i2.SkyI18nModule] });
|
|
222
|
-
SkyTextEditorResourcesModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyTextEditorResourcesModule, providers: [
|
|
223
|
-
{
|
|
224
|
-
provide: i2.SKY_LIB_RESOURCES_PROVIDERS,
|
|
225
|
-
useClass: SkyTextEditorResourcesProvider,
|
|
226
|
-
multi: true,
|
|
227
|
-
},
|
|
228
|
-
], imports: [i2.SkyI18nModule] });
|
|
229
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyTextEditorResourcesModule, decorators: [{
|
|
230
|
-
type: i0.NgModule,
|
|
231
|
-
args: [{
|
|
232
|
-
exports: [i2.SkyI18nModule],
|
|
233
|
-
providers: [
|
|
234
|
-
{
|
|
235
|
-
provide: i2.SKY_LIB_RESOURCES_PROVIDERS,
|
|
236
|
-
useClass: SkyTextEditorResourcesProvider,
|
|
237
|
-
multi: true,
|
|
238
|
-
},
|
|
239
|
-
],
|
|
240
|
-
}]
|
|
241
|
-
}] });
|
|
242
|
-
|
|
243
|
-
// Need to add the following to classes which contain static methods.
|
|
244
|
-
// See: https://github.com/ng-packagr/ng-packagr/issues/641
|
|
245
|
-
// @dynamic
|
|
246
|
-
var SkyFormsUtility = /** @class */ (function () {
|
|
247
|
-
function SkyFormsUtility() {
|
|
248
|
-
}
|
|
249
|
-
/** Coerces a data-bound value (typically a string) to a boolean. */
|
|
250
|
-
SkyFormsUtility.coerceBooleanProperty = function (value) {
|
|
251
|
-
return value !== undefined && "" + value !== 'false';
|
|
252
|
-
};
|
|
253
|
-
return SkyFormsUtility;
|
|
254
|
-
}());
|
|
255
|
-
|
|
256
|
-
/*! *****************************************************************************
|
|
257
|
-
Copyright (c) Microsoft Corporation.
|
|
258
|
-
|
|
259
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
|
260
|
-
purpose with or without fee is hereby granted.
|
|
261
|
-
|
|
262
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
263
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
264
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
265
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
266
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
267
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
268
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
269
|
-
***************************************************************************** */
|
|
270
|
-
/* global Reflect, Promise */
|
|
271
|
-
var extendStatics = function (d, b) {
|
|
272
|
-
extendStatics = Object.setPrototypeOf ||
|
|
273
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
274
|
-
function (d, b) { for (var p in b)
|
|
275
|
-
if (Object.prototype.hasOwnProperty.call(b, p))
|
|
276
|
-
d[p] = b[p]; };
|
|
277
|
-
return extendStatics(d, b);
|
|
278
|
-
};
|
|
279
|
-
function __extends(d, b) {
|
|
280
|
-
if (typeof b !== "function" && b !== null)
|
|
281
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
282
|
-
extendStatics(d, b);
|
|
283
|
-
function __() { this.constructor = d; }
|
|
284
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
285
|
-
}
|
|
286
|
-
var __assign = function () {
|
|
287
|
-
__assign = Object.assign || function __assign(t) {
|
|
288
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
289
|
-
s = arguments[i];
|
|
290
|
-
for (var p in s)
|
|
291
|
-
if (Object.prototype.hasOwnProperty.call(s, p))
|
|
292
|
-
t[p] = s[p];
|
|
293
|
-
}
|
|
294
|
-
return t;
|
|
295
|
-
};
|
|
296
|
-
return __assign.apply(this, arguments);
|
|
297
|
-
};
|
|
298
|
-
function __rest(s, e) {
|
|
299
|
-
var t = {};
|
|
300
|
-
for (var p in s)
|
|
301
|
-
if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
302
|
-
t[p] = s[p];
|
|
303
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
304
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
305
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
306
|
-
t[p[i]] = s[p[i]];
|
|
307
|
-
}
|
|
308
|
-
return t;
|
|
309
|
-
}
|
|
310
|
-
function __decorate(decorators, target, key, desc) {
|
|
311
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
312
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
313
|
-
r = Reflect.decorate(decorators, target, key, desc);
|
|
314
|
-
else
|
|
315
|
-
for (var i = decorators.length - 1; i >= 0; i--)
|
|
316
|
-
if (d = decorators[i])
|
|
317
|
-
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
318
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
319
|
-
}
|
|
320
|
-
function __param(paramIndex, decorator) {
|
|
321
|
-
return function (target, key) { decorator(target, key, paramIndex); };
|
|
322
|
-
}
|
|
323
|
-
function __metadata(metadataKey, metadataValue) {
|
|
324
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
|
|
325
|
-
return Reflect.metadata(metadataKey, metadataValue);
|
|
326
|
-
}
|
|
327
|
-
function __awaiter(thisArg, _arguments, P, generator) {
|
|
328
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
329
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
330
|
-
function fulfilled(value) { try {
|
|
331
|
-
step(generator.next(value));
|
|
332
|
-
}
|
|
333
|
-
catch (e) {
|
|
334
|
-
reject(e);
|
|
335
|
-
} }
|
|
336
|
-
function rejected(value) { try {
|
|
337
|
-
step(generator["throw"](value));
|
|
338
|
-
}
|
|
339
|
-
catch (e) {
|
|
340
|
-
reject(e);
|
|
341
|
-
} }
|
|
342
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
343
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
344
|
-
});
|
|
345
|
-
}
|
|
346
|
-
function __generator(thisArg, body) {
|
|
347
|
-
var _ = { label: 0, sent: function () { if (t[0] & 1)
|
|
348
|
-
throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
349
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function () { return this; }), g;
|
|
350
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
351
|
-
function step(op) {
|
|
352
|
-
if (f)
|
|
353
|
-
throw new TypeError("Generator is already executing.");
|
|
354
|
-
while (_)
|
|
355
|
-
try {
|
|
356
|
-
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)
|
|
357
|
-
return t;
|
|
358
|
-
if (y = 0, t)
|
|
359
|
-
op = [op[0] & 2, t.value];
|
|
360
|
-
switch (op[0]) {
|
|
361
|
-
case 0:
|
|
362
|
-
case 1:
|
|
363
|
-
t = op;
|
|
364
|
-
break;
|
|
365
|
-
case 4:
|
|
366
|
-
_.label++;
|
|
367
|
-
return { value: op[1], done: false };
|
|
368
|
-
case 5:
|
|
369
|
-
_.label++;
|
|
370
|
-
y = op[1];
|
|
371
|
-
op = [0];
|
|
372
|
-
continue;
|
|
373
|
-
case 7:
|
|
374
|
-
op = _.ops.pop();
|
|
375
|
-
_.trys.pop();
|
|
376
|
-
continue;
|
|
377
|
-
default:
|
|
378
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
379
|
-
_ = 0;
|
|
380
|
-
continue;
|
|
381
|
-
}
|
|
382
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) {
|
|
383
|
-
_.label = op[1];
|
|
384
|
-
break;
|
|
385
|
-
}
|
|
386
|
-
if (op[0] === 6 && _.label < t[1]) {
|
|
387
|
-
_.label = t[1];
|
|
388
|
-
t = op;
|
|
389
|
-
break;
|
|
390
|
-
}
|
|
391
|
-
if (t && _.label < t[2]) {
|
|
392
|
-
_.label = t[2];
|
|
393
|
-
_.ops.push(op);
|
|
394
|
-
break;
|
|
395
|
-
}
|
|
396
|
-
if (t[2])
|
|
397
|
-
_.ops.pop();
|
|
398
|
-
_.trys.pop();
|
|
399
|
-
continue;
|
|
400
|
-
}
|
|
401
|
-
op = body.call(thisArg, _);
|
|
402
|
-
}
|
|
403
|
-
catch (e) {
|
|
404
|
-
op = [6, e];
|
|
405
|
-
y = 0;
|
|
406
|
-
}
|
|
407
|
-
finally {
|
|
408
|
-
f = t = 0;
|
|
409
|
-
}
|
|
410
|
-
if (op[0] & 5)
|
|
411
|
-
throw op[1];
|
|
412
|
-
return { value: op[0] ? op[1] : void 0, done: true };
|
|
413
|
-
}
|
|
414
|
-
}
|
|
415
|
-
var __createBinding = Object.create ? (function (o, m, k, k2) {
|
|
416
|
-
if (k2 === undefined)
|
|
417
|
-
k2 = k;
|
|
418
|
-
Object.defineProperty(o, k2, { enumerable: true, get: function () { return m[k]; } });
|
|
419
|
-
}) : (function (o, m, k, k2) {
|
|
420
|
-
if (k2 === undefined)
|
|
421
|
-
k2 = k;
|
|
422
|
-
o[k2] = m[k];
|
|
423
|
-
});
|
|
424
|
-
function __exportStar(m, o) {
|
|
425
|
-
for (var p in m)
|
|
426
|
-
if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p))
|
|
427
|
-
__createBinding(o, m, p);
|
|
428
|
-
}
|
|
429
|
-
function __values(o) {
|
|
430
|
-
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
431
|
-
if (m)
|
|
432
|
-
return m.call(o);
|
|
433
|
-
if (o && typeof o.length === "number")
|
|
434
|
-
return {
|
|
435
|
-
next: function () {
|
|
436
|
-
if (o && i >= o.length)
|
|
437
|
-
o = void 0;
|
|
438
|
-
return { value: o && o[i++], done: !o };
|
|
439
|
-
}
|
|
440
|
-
};
|
|
441
|
-
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
442
|
-
}
|
|
443
|
-
function __read(o, n) {
|
|
444
|
-
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
445
|
-
if (!m)
|
|
446
|
-
return o;
|
|
447
|
-
var i = m.call(o), r, ar = [], e;
|
|
448
|
-
try {
|
|
449
|
-
while ((n === void 0 || n-- > 0) && !(r = i.next()).done)
|
|
450
|
-
ar.push(r.value);
|
|
451
|
-
}
|
|
452
|
-
catch (error) {
|
|
453
|
-
e = { error: error };
|
|
454
|
-
}
|
|
455
|
-
finally {
|
|
456
|
-
try {
|
|
457
|
-
if (r && !r.done && (m = i["return"]))
|
|
458
|
-
m.call(i);
|
|
459
|
-
}
|
|
460
|
-
finally {
|
|
461
|
-
if (e)
|
|
462
|
-
throw e.error;
|
|
463
|
-
}
|
|
464
|
-
}
|
|
465
|
-
return ar;
|
|
466
|
-
}
|
|
467
|
-
/** @deprecated */
|
|
468
|
-
function __spread() {
|
|
469
|
-
for (var ar = [], i = 0; i < arguments.length; i++)
|
|
470
|
-
ar = ar.concat(__read(arguments[i]));
|
|
471
|
-
return ar;
|
|
472
|
-
}
|
|
473
|
-
/** @deprecated */
|
|
474
|
-
function __spreadArrays() {
|
|
475
|
-
for (var s = 0, i = 0, il = arguments.length; i < il; i++)
|
|
476
|
-
s += arguments[i].length;
|
|
477
|
-
for (var r = Array(s), k = 0, i = 0; i < il; i++)
|
|
478
|
-
for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
|
|
479
|
-
r[k] = a[j];
|
|
480
|
-
return r;
|
|
481
|
-
}
|
|
482
|
-
function __spreadArray(to, from, pack) {
|
|
483
|
-
if (pack || arguments.length === 2)
|
|
484
|
-
for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
485
|
-
if (ar || !(i in from)) {
|
|
486
|
-
if (!ar)
|
|
487
|
-
ar = Array.prototype.slice.call(from, 0, i);
|
|
488
|
-
ar[i] = from[i];
|
|
489
|
-
}
|
|
490
|
-
}
|
|
491
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
492
|
-
}
|
|
493
|
-
function __await(v) {
|
|
494
|
-
return this instanceof __await ? (this.v = v, this) : new __await(v);
|
|
495
|
-
}
|
|
496
|
-
function __asyncGenerator(thisArg, _arguments, generator) {
|
|
497
|
-
if (!Symbol.asyncIterator)
|
|
498
|
-
throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
499
|
-
var g = generator.apply(thisArg, _arguments || []), i, q = [];
|
|
500
|
-
return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
|
|
501
|
-
function verb(n) { if (g[n])
|
|
502
|
-
i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
|
|
503
|
-
function resume(n, v) { try {
|
|
504
|
-
step(g[n](v));
|
|
505
|
-
}
|
|
506
|
-
catch (e) {
|
|
507
|
-
settle(q[0][3], e);
|
|
508
|
-
} }
|
|
509
|
-
function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
|
|
510
|
-
function fulfill(value) { resume("next", value); }
|
|
511
|
-
function reject(value) { resume("throw", value); }
|
|
512
|
-
function settle(f, v) { if (f(v), q.shift(), q.length)
|
|
513
|
-
resume(q[0][0], q[0][1]); }
|
|
514
|
-
}
|
|
515
|
-
function __asyncDelegator(o) {
|
|
516
|
-
var i, p;
|
|
517
|
-
return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
|
|
518
|
-
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; }
|
|
519
|
-
}
|
|
520
|
-
function __asyncValues(o) {
|
|
521
|
-
if (!Symbol.asyncIterator)
|
|
522
|
-
throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
523
|
-
var m = o[Symbol.asyncIterator], i;
|
|
524
|
-
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);
|
|
525
|
-
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); }); }; }
|
|
526
|
-
function settle(resolve, reject, d, v) { Promise.resolve(v).then(function (v) { resolve({ value: v, done: d }); }, reject); }
|
|
527
|
-
}
|
|
528
|
-
function __makeTemplateObject(cooked, raw) {
|
|
529
|
-
if (Object.defineProperty) {
|
|
530
|
-
Object.defineProperty(cooked, "raw", { value: raw });
|
|
531
|
-
}
|
|
532
|
-
else {
|
|
533
|
-
cooked.raw = raw;
|
|
534
|
-
}
|
|
535
|
-
return cooked;
|
|
536
|
-
}
|
|
537
|
-
;
|
|
538
|
-
var __setModuleDefault = Object.create ? (function (o, v) {
|
|
539
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
540
|
-
}) : function (o, v) {
|
|
541
|
-
o["default"] = v;
|
|
542
|
-
};
|
|
543
|
-
function __importStar(mod) {
|
|
544
|
-
if (mod && mod.__esModule)
|
|
545
|
-
return mod;
|
|
546
|
-
var result = {};
|
|
547
|
-
if (mod != null)
|
|
548
|
-
for (var k in mod)
|
|
549
|
-
if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k))
|
|
550
|
-
__createBinding(result, mod, k);
|
|
551
|
-
__setModuleDefault(result, mod);
|
|
552
|
-
return result;
|
|
553
|
-
}
|
|
554
|
-
function __importDefault(mod) {
|
|
555
|
-
return (mod && mod.__esModule) ? mod : { default: mod };
|
|
556
|
-
}
|
|
557
|
-
function __classPrivateFieldGet(receiver, state, kind, f) {
|
|
558
|
-
if (kind === "a" && !f)
|
|
559
|
-
throw new TypeError("Private accessor was defined without a getter");
|
|
560
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
|
|
561
|
-
throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
562
|
-
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
563
|
-
}
|
|
564
|
-
function __classPrivateFieldSet(receiver, state, value, kind, f) {
|
|
565
|
-
if (kind === "m")
|
|
566
|
-
throw new TypeError("Private method is not writable");
|
|
567
|
-
if (kind === "a" && !f)
|
|
568
|
-
throw new TypeError("Private accessor was defined without a setter");
|
|
569
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
|
|
570
|
-
throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
571
|
-
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
572
|
-
}
|
|
573
|
-
|
|
574
|
-
/**
|
|
575
|
-
* @internal
|
|
576
|
-
*/
|
|
577
|
-
var FONT_LIST_DEFAULTS = [
|
|
578
|
-
{
|
|
579
|
-
name: 'Blackbaud Sans',
|
|
580
|
-
value: '"Blackbaud Sans", Arial, sans-serif',
|
|
581
|
-
},
|
|
582
|
-
{
|
|
583
|
-
name: 'Arial',
|
|
584
|
-
value: 'Arial',
|
|
585
|
-
},
|
|
586
|
-
{
|
|
587
|
-
name: 'Arial Black',
|
|
588
|
-
value: '"Arial Black"',
|
|
589
|
-
},
|
|
590
|
-
{
|
|
591
|
-
name: 'Courier New',
|
|
592
|
-
value: '"Courier New"',
|
|
593
|
-
},
|
|
594
|
-
{
|
|
595
|
-
name: 'Georgia',
|
|
596
|
-
value: 'Georgia, serif',
|
|
597
|
-
},
|
|
598
|
-
{
|
|
599
|
-
name: 'Tahoma',
|
|
600
|
-
value: 'Tahoma, Geneva, sans-serif',
|
|
601
|
-
},
|
|
602
|
-
{
|
|
603
|
-
name: 'Times New Roman',
|
|
604
|
-
value: '"Times New Roman"',
|
|
605
|
-
},
|
|
606
|
-
{
|
|
607
|
-
name: 'Trebuchet MS',
|
|
608
|
-
value: '"Trebuchet MS", sans-serif',
|
|
609
|
-
},
|
|
610
|
-
{
|
|
611
|
-
name: 'Verdana',
|
|
612
|
-
value: 'Verdana, Geneva, sans-serif',
|
|
613
|
-
},
|
|
614
|
-
];
|
|
615
|
-
|
|
616
|
-
/**
|
|
617
|
-
* @internal
|
|
618
|
-
*/
|
|
619
|
-
var STYLE_STATE_DEFAULTS = {
|
|
620
|
-
backColor: 'rgba(0, 0, 0, 0)',
|
|
621
|
-
fontColor: '#000',
|
|
622
|
-
fontSize: 14,
|
|
623
|
-
font: FONT_LIST_DEFAULTS[0].value,
|
|
624
|
-
boldState: false,
|
|
625
|
-
italicState: false,
|
|
626
|
-
underlineState: false,
|
|
627
|
-
linkState: false,
|
|
628
|
-
};
|
|
629
|
-
|
|
630
|
-
/**
|
|
631
|
-
* @internal
|
|
632
|
-
*/
|
|
633
|
-
var UrlTarget;
|
|
634
|
-
(function (UrlTarget) {
|
|
635
|
-
UrlTarget[UrlTarget["None"] = 0] = "None";
|
|
636
|
-
UrlTarget[UrlTarget["NewWindow"] = 1] = "NewWindow";
|
|
637
|
-
})(UrlTarget || (UrlTarget = {}));
|
|
638
|
-
|
|
639
|
-
/**
|
|
640
|
-
* @internal
|
|
641
|
-
*/
|
|
642
|
-
var SkyTextEditorSelectionService = /** @class */ (function () {
|
|
643
|
-
function SkyTextEditorSelectionService() {
|
|
644
|
-
}
|
|
645
|
-
SkyTextEditorSelectionService.prototype.isElementSelected = function (documentEl, element) {
|
|
646
|
-
var selectedNode = this.getCurrentSelection(documentEl)
|
|
647
|
-
.anchorNode;
|
|
648
|
-
/* istanbul ignore next */
|
|
649
|
-
return (selectedNode &&
|
|
650
|
-
(element.contains(selectedNode) ||
|
|
651
|
-
(selectedNode.parentNode && element.contains(selectedNode.parentNode))));
|
|
652
|
-
};
|
|
653
|
-
SkyTextEditorSelectionService.prototype.getCurrentSelection = function (documentEl) {
|
|
654
|
-
return documentEl.getSelection();
|
|
655
|
-
};
|
|
656
|
-
SkyTextEditorSelectionService.prototype.getCurrentSelectionParentElement = function (documentEl) {
|
|
657
|
-
var selection = this.getCurrentSelection(documentEl);
|
|
658
|
-
var selectedEl;
|
|
659
|
-
/* istanbul ignore else */
|
|
660
|
-
if (selection &&
|
|
661
|
-
selection.getRangeAt &&
|
|
662
|
-
selection.getRangeAt(0).commonAncestorContainer) {
|
|
663
|
-
selectedEl = selection.getRangeAt(0).commonAncestorContainer;
|
|
664
|
-
selectedEl =
|
|
665
|
-
selectedEl.nodeType !== 1 ? selectedEl.parentElement : selectedEl;
|
|
666
|
-
}
|
|
667
|
-
else if (selection && selection.type !== 'Control') {
|
|
668
|
-
selectedEl = selection.createRange().parentElement();
|
|
669
|
-
}
|
|
670
|
-
else {
|
|
671
|
-
return undefined;
|
|
672
|
-
}
|
|
673
|
-
return selectedEl;
|
|
674
|
-
};
|
|
675
|
-
SkyTextEditorSelectionService.prototype.getCurrentSelectionRange = function (documentEl, windowEl) {
|
|
676
|
-
/* istanbul ignore else */
|
|
677
|
-
if (windowEl.getSelection) {
|
|
678
|
-
var sel = windowEl.getSelection();
|
|
679
|
-
/* istanbul ignore else */
|
|
680
|
-
if (sel.getRangeAt && sel.rangeCount) {
|
|
681
|
-
return sel.getRangeAt(0);
|
|
682
|
-
}
|
|
683
|
-
}
|
|
684
|
-
else if (documentEl.getSelection() &&
|
|
685
|
-
documentEl.getSelection().getRangeAt) {
|
|
686
|
-
return documentEl.getSelection().getRangeAt(0);
|
|
687
|
-
}
|
|
688
|
-
};
|
|
689
|
-
SkyTextEditorSelectionService.prototype.selectElement = function (documentEl, windowEl, element) {
|
|
690
|
-
/* istanbul ignore else */
|
|
691
|
-
if (element) {
|
|
692
|
-
/* istanbul ignore else */
|
|
693
|
-
if (windowEl.getSelection) {
|
|
694
|
-
var sel = windowEl.getSelection();
|
|
695
|
-
sel.removeAllRanges();
|
|
696
|
-
var range = documentEl.createRange();
|
|
697
|
-
range.selectNodeContents(element);
|
|
698
|
-
sel.addRange(range);
|
|
699
|
-
}
|
|
700
|
-
else if (documentEl.getSelection) {
|
|
701
|
-
var sel = documentEl.getSelection();
|
|
702
|
-
sel.removeAllRanges();
|
|
703
|
-
var range = documentEl.createRange();
|
|
704
|
-
range.selectNodeContents(element);
|
|
705
|
-
sel.addRange(range);
|
|
706
|
-
}
|
|
707
|
-
}
|
|
708
|
-
};
|
|
709
|
-
return SkyTextEditorSelectionService;
|
|
710
|
-
}());
|
|
711
|
-
SkyTextEditorSelectionService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyTextEditorSelectionService, deps: [], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
712
|
-
SkyTextEditorSelectionService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyTextEditorSelectionService, providedIn: 'root' });
|
|
713
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyTextEditorSelectionService, decorators: [{
|
|
714
|
-
type: i0.Injectable,
|
|
715
|
-
args: [{
|
|
716
|
-
providedIn: 'root',
|
|
717
|
-
}]
|
|
718
|
-
}] });
|
|
719
|
-
|
|
720
|
-
/**
|
|
721
|
-
* @internal
|
|
722
|
-
*/
|
|
723
|
-
var SkyTextEditorService = /** @class */ (function () {
|
|
724
|
-
function SkyTextEditorService() {
|
|
725
|
-
/**
|
|
726
|
-
* A dictionary representing all active text editors and their settings.
|
|
727
|
-
*/
|
|
728
|
-
this.editors = {};
|
|
729
|
-
}
|
|
730
|
-
/**
|
|
731
|
-
* Returns the blur observable from the editor with the corresponding id.
|
|
732
|
-
*/
|
|
733
|
-
SkyTextEditorService.prototype.blurListener = function (id) {
|
|
734
|
-
return this.editors[id].blurObservable;
|
|
735
|
-
};
|
|
736
|
-
/**
|
|
737
|
-
* Returns the click observable from the editor with the corresponding id.
|
|
738
|
-
*/
|
|
739
|
-
SkyTextEditorService.prototype.clickListener = function (id) {
|
|
740
|
-
return this.editors[id].clickObservable;
|
|
741
|
-
};
|
|
742
|
-
/**
|
|
743
|
-
* Returns the command change observable from the editor with the corresponding id.
|
|
744
|
-
*/
|
|
745
|
-
SkyTextEditorService.prototype.commandChangeListener = function (id) {
|
|
746
|
-
return this.editors[id].commandChangeObservable;
|
|
747
|
-
};
|
|
748
|
-
/**
|
|
749
|
-
* Returns the input change observable from the editor with the corresponding id.
|
|
750
|
-
*/
|
|
751
|
-
SkyTextEditorService.prototype.inputListener = function (id) {
|
|
752
|
-
return this.editors[id].inputObservable;
|
|
753
|
-
};
|
|
754
|
-
/**
|
|
755
|
-
* Removes editor from the `editors` index by id.
|
|
756
|
-
*/
|
|
757
|
-
SkyTextEditorService.prototype.removeEditor = function (id) {
|
|
758
|
-
/* istanbul ignore else */
|
|
759
|
-
if (id in this.editors) {
|
|
760
|
-
delete this.editors[id];
|
|
761
|
-
}
|
|
762
|
-
};
|
|
763
|
-
/**
|
|
764
|
-
* Returns the selection change observable from the editor with the corresponding id.
|
|
765
|
-
*/
|
|
766
|
-
SkyTextEditorService.prototype.selectionChangeListener = function (id) {
|
|
767
|
-
return this.editors[id].selectionChangeObservable;
|
|
768
|
-
};
|
|
769
|
-
return SkyTextEditorService;
|
|
770
|
-
}());
|
|
771
|
-
SkyTextEditorService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyTextEditorService, deps: [], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
772
|
-
SkyTextEditorService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyTextEditorService, providedIn: 'root' });
|
|
773
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyTextEditorService, decorators: [{
|
|
774
|
-
type: i0.Injectable,
|
|
775
|
-
args: [{
|
|
776
|
-
providedIn: 'root',
|
|
777
|
-
}]
|
|
778
|
-
}] });
|
|
779
|
-
|
|
780
|
-
/**
|
|
781
|
-
* @internal
|
|
782
|
-
*/
|
|
783
|
-
var SkyTextEditorAdapterService = /** @class */ (function () {
|
|
784
|
-
function SkyTextEditorAdapterService(selectionService, textEditorService, windowService) {
|
|
785
|
-
this.selectionService = selectionService;
|
|
786
|
-
this.textEditorService = textEditorService;
|
|
787
|
-
this.windowService = windowService;
|
|
788
|
-
}
|
|
789
|
-
Object.defineProperty(SkyTextEditorAdapterService.prototype, "editors", {
|
|
790
|
-
get: function () {
|
|
791
|
-
return this.textEditorService.editors;
|
|
792
|
-
},
|
|
793
|
-
enumerable: false,
|
|
794
|
-
configurable: true
|
|
795
|
-
});
|
|
796
|
-
/**
|
|
797
|
-
* Creates a text editor inside the supplied iframe element.
|
|
798
|
-
*/
|
|
799
|
-
SkyTextEditorAdapterService.prototype.addEditor = function (id, iframeElement, styleState, placeholder) {
|
|
800
|
-
/* istanbul ignore else */
|
|
801
|
-
if (!(id in this.editors)) {
|
|
802
|
-
this.editors[id] = this.createObservers(id, iframeElement);
|
|
803
|
-
var documentEl = this.getIframeDocumentEl(id);
|
|
804
|
-
var styleEl = documentEl.createElement('style');
|
|
805
|
-
styleEl.innerHTML = ".editor:empty:before {\n content: attr(data-placeholder);\n font-family: \"Blackbaud Sans\", Arial, sans-serif;\n color: #686c73;\n font-weight: 400;\n font-size: 15px;\n font-style: italic;\n }";
|
|
806
|
-
documentEl.head.appendChild(styleEl);
|
|
807
|
-
var style = Object.assign(Object.assign({}, STYLE_STATE_DEFAULTS), styleState);
|
|
808
|
-
var bodyStyle = "background-color: " + style.backColor + ";\n color: " + style.fontColor + ";\n font-family: " + style.font + ";\n font-size: " + style.fontSize + "px";
|
|
809
|
-
documentEl.querySelector('html').setAttribute('lang', 'en');
|
|
810
|
-
documentEl.body.setAttribute('contenteditable', 'true');
|
|
811
|
-
documentEl.body.setAttribute('id', id);
|
|
812
|
-
documentEl.body.setAttribute('role', 'main');
|
|
813
|
-
documentEl.body.setAttribute('class', 'editor');
|
|
814
|
-
documentEl.body.setAttribute('style', bodyStyle);
|
|
815
|
-
documentEl.body.setAttribute('data-placeholder', placeholder || '');
|
|
816
|
-
}
|
|
817
|
-
};
|
|
818
|
-
SkyTextEditorAdapterService.prototype.disableEditor = function (id, focusableChildren, textEditorNativeElement) {
|
|
819
|
-
this.setEditorDisabled(id, focusableChildren, textEditorNativeElement, true);
|
|
820
|
-
};
|
|
821
|
-
SkyTextEditorAdapterService.prototype.enableEditor = function (id, focusableChildren, textEditorNativeElement) {
|
|
822
|
-
this.setEditorDisabled(id, focusableChildren, textEditorNativeElement, false);
|
|
823
|
-
};
|
|
824
|
-
/**
|
|
825
|
-
* Executes a command on the text editor with the corresponding id.
|
|
826
|
-
*/
|
|
827
|
-
SkyTextEditorAdapterService.prototype.execCommand = function (id, editorCommand) {
|
|
828
|
-
/* istanbul ignore else */
|
|
829
|
-
if (id in this.editors) {
|
|
830
|
-
var documentEl = this.getIframeDocumentEl(id);
|
|
831
|
-
/* istanbul ignore else */
|
|
832
|
-
if (this.editorSelected(id)) {
|
|
833
|
-
var commandIsSupportedAndEnabled = documentEl.execCommand(editorCommand.command, false, editorCommand.value);
|
|
834
|
-
// IE11 doesn't support insertHTML
|
|
835
|
-
/* istanbul ignore next */
|
|
836
|
-
if (editorCommand.command.toLowerCase() === 'inserthtml' &&
|
|
837
|
-
!commandIsSupportedAndEnabled) {
|
|
838
|
-
this.insertHtmlInIE11(id, editorCommand.value);
|
|
839
|
-
}
|
|
840
|
-
this.focusEditor(id);
|
|
841
|
-
this.editors[id].commandChangeObservable.next();
|
|
842
|
-
}
|
|
843
|
-
}
|
|
844
|
-
};
|
|
845
|
-
SkyTextEditorAdapterService.prototype.getCurrentSelection = function (id) {
|
|
846
|
-
return this.selectionService.getCurrentSelection(this.getIframeDocumentEl(id));
|
|
847
|
-
};
|
|
848
|
-
/**
|
|
849
|
-
* Returns a data URI using the provided text string.
|
|
850
|
-
* Used to display a merge field inside a string of text.
|
|
851
|
-
*/
|
|
852
|
-
SkyTextEditorAdapterService.prototype.getMergeFieldDataURI = function (text) {
|
|
853
|
-
var documentEl = this.windowService.nativeWindow.document;
|
|
854
|
-
var textToUse = text;
|
|
855
|
-
if (text.length > 18) {
|
|
856
|
-
textToUse = text.substr(0, 15) + '...';
|
|
857
|
-
}
|
|
858
|
-
var canvasElement = documentEl.createElement('canvas');
|
|
859
|
-
canvasElement.setAttribute('height', '20');
|
|
860
|
-
canvasElement.setAttribute('width', '100');
|
|
861
|
-
canvasElement.style.backgroundColor = 'tan';
|
|
862
|
-
canvasElement.style.border = '1px solid #000000';
|
|
863
|
-
canvasElement.style.borderRadius = '5px';
|
|
864
|
-
var context = canvasElement.getContext('2d');
|
|
865
|
-
context.font = '12px Arial';
|
|
866
|
-
context.textAlign = 'center';
|
|
867
|
-
context.fillText(textToUse, 50, 15);
|
|
868
|
-
context.globalCompositeOperation = 'destination-over';
|
|
869
|
-
context.fillStyle = '#00FFFF';
|
|
870
|
-
context.fillRect(0, 0, 100, 20);
|
|
871
|
-
context.globalCompositeOperation = 'source-over';
|
|
872
|
-
context.lineWidth = 2;
|
|
873
|
-
context.strokeStyle = '#FF0000';
|
|
874
|
-
context.strokeRect(0, 0, 100, 20);
|
|
875
|
-
var result = canvasElement.toDataURL('image/png', 1.0);
|
|
876
|
-
return result;
|
|
877
|
-
};
|
|
878
|
-
SkyTextEditorAdapterService.prototype.getStyleState = function (id) {
|
|
879
|
-
var documentEl = this.getIframeDocumentEl(id);
|
|
880
|
-
/* istanbul ignore else */
|
|
881
|
-
if (this.editorSelected(id)) {
|
|
882
|
-
return {
|
|
883
|
-
backColor: this.getColor(documentEl, 'BackColor'),
|
|
884
|
-
fontColor: this.getColor(documentEl, 'ForeColor'),
|
|
885
|
-
fontSize: parseInt(this.getFontSize(id), undefined),
|
|
886
|
-
font: documentEl.queryCommandValue('fontname'),
|
|
887
|
-
boldState: documentEl.queryCommandState('Bold'),
|
|
888
|
-
italicState: documentEl.queryCommandState('Italic'),
|
|
889
|
-
underlineState: documentEl.queryCommandState('Underline'),
|
|
890
|
-
linkState: this.hasLink(id),
|
|
891
|
-
};
|
|
892
|
-
}
|
|
893
|
-
/* istanbul ignore next */
|
|
894
|
-
return {};
|
|
895
|
-
};
|
|
896
|
-
SkyTextEditorAdapterService.prototype.getEditorInnerHtml = function (id) {
|
|
897
|
-
var documentEl = this.getIframeDocumentEl(id);
|
|
898
|
-
if (documentEl) {
|
|
899
|
-
return this.replaceHtmlCodes(documentEl.body.innerHTML);
|
|
900
|
-
}
|
|
901
|
-
return '';
|
|
902
|
-
};
|
|
903
|
-
SkyTextEditorAdapterService.prototype.setEditorInnerHtml = function (id, value) {
|
|
904
|
-
var documentEl = this.getIframeDocumentEl(id);
|
|
905
|
-
var editorContent = documentEl.body;
|
|
906
|
-
/* istanbul ignore else */
|
|
907
|
-
if (editorContent.innerHTML !== value) {
|
|
908
|
-
editorContent.innerHTML = value;
|
|
909
|
-
}
|
|
910
|
-
};
|
|
911
|
-
SkyTextEditorAdapterService.prototype.focusEditor = function (id) {
|
|
912
|
-
/* istanbul ignore else */
|
|
913
|
-
if (id in this.editors) {
|
|
914
|
-
var windowEl = this.getContentWindowEl(id);
|
|
915
|
-
var iframeDocumentEl = this.getIframeDocumentEl(id);
|
|
916
|
-
var currentSelection = this.selectionService.getCurrentSelectionRange(iframeDocumentEl, windowEl);
|
|
917
|
-
var cursorIsNotActiveAndHasReset = currentSelection &&
|
|
918
|
-
currentSelection.startOffset === 0 &&
|
|
919
|
-
currentSelection.endOffset === 0;
|
|
920
|
-
if (!this.editorSelected(id) || cursorIsNotActiveAndHasReset) {
|
|
921
|
-
// focus the end of the editor
|
|
922
|
-
var documentEl = this.windowService.nativeWindow.document;
|
|
923
|
-
var editor = iframeDocumentEl.body;
|
|
924
|
-
var range = documentEl.createRange();
|
|
925
|
-
this.editors[id].iframeElementRef.focus();
|
|
926
|
-
editor.focus();
|
|
927
|
-
/* istanbul ignore else */
|
|
928
|
-
if (windowEl.getSelection && documentEl.createRange) {
|
|
929
|
-
range.selectNodeContents(editor);
|
|
930
|
-
range.collapse(false);
|
|
931
|
-
var sel = windowEl.getSelection();
|
|
932
|
-
sel.removeAllRanges();
|
|
933
|
-
sel.addRange(range);
|
|
934
|
-
}
|
|
935
|
-
else {
|
|
936
|
-
// IE only
|
|
937
|
-
var textRange = editor.createTextRange();
|
|
938
|
-
textRange.moveToElementText(editor);
|
|
939
|
-
textRange.collapse(false);
|
|
940
|
-
textRange.select();
|
|
941
|
-
}
|
|
942
|
-
}
|
|
943
|
-
else {
|
|
944
|
-
// Cursor may not be active, restore it
|
|
945
|
-
this.editors[id].iframeElementRef.focus();
|
|
946
|
-
iframeDocumentEl.body.focus();
|
|
947
|
-
}
|
|
948
|
-
}
|
|
949
|
-
};
|
|
950
|
-
SkyTextEditorAdapterService.prototype.getLink = function (editorId) {
|
|
951
|
-
var link = undefined;
|
|
952
|
-
var anchorEl = this.getSelectedAnchorTag(editorId);
|
|
953
|
-
if (anchorEl && anchorEl.href) {
|
|
954
|
-
link = {
|
|
955
|
-
target: anchorEl.getAttribute('target') === '_blank'
|
|
956
|
-
? UrlTarget.NewWindow
|
|
957
|
-
: UrlTarget.None,
|
|
958
|
-
url: anchorEl.href,
|
|
959
|
-
};
|
|
960
|
-
}
|
|
961
|
-
return link;
|
|
962
|
-
};
|
|
963
|
-
SkyTextEditorAdapterService.prototype.getSelectedAnchorTag = function (editorId) {
|
|
964
|
-
var selectedEl = this.getCurrentSelectionParentElement(editorId);
|
|
965
|
-
return this.getParent(selectedEl, 'a');
|
|
966
|
-
};
|
|
967
|
-
SkyTextEditorAdapterService.prototype.saveSelection = function (id) {
|
|
968
|
-
return this.selectionService.getCurrentSelectionRange(this.getIframeDocumentEl(id), this.getContentWindowEl(id));
|
|
969
|
-
};
|
|
970
|
-
SkyTextEditorAdapterService.prototype.selectElement = function (id, element) {
|
|
971
|
-
this.selectionService.selectElement(this.getIframeDocumentEl(id), this.getContentWindowEl(id), element);
|
|
972
|
-
};
|
|
973
|
-
SkyTextEditorAdapterService.prototype.setPlaceholder = function (id, placeholder) {
|
|
974
|
-
var documentEl = this.getIframeDocumentEl(id);
|
|
975
|
-
documentEl.body.setAttribute('data-placeholder', placeholder || '');
|
|
976
|
-
};
|
|
977
|
-
SkyTextEditorAdapterService.prototype.setFontSize = function (id, fontSize) {
|
|
978
|
-
var e_1, _a;
|
|
979
|
-
var doc = this.getIframeDocumentEl(id);
|
|
980
|
-
this.execCommand(id, { command: 'fontSize', value: 1 });
|
|
981
|
-
var fontElements = Array.from(doc.querySelectorAll('font[size="1"]'));
|
|
982
|
-
try {
|
|
983
|
-
for (var fontElements_1 = __values(fontElements), fontElements_1_1 = fontElements_1.next(); !fontElements_1_1.done; fontElements_1_1 = fontElements_1.next()) {
|
|
984
|
-
var element = fontElements_1_1.value;
|
|
985
|
-
element.removeAttribute('size');
|
|
986
|
-
element.style.fontSize = fontSize + 'px';
|
|
987
|
-
}
|
|
988
|
-
}
|
|
989
|
-
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
990
|
-
finally {
|
|
991
|
-
try {
|
|
992
|
-
if (fontElements_1_1 && !fontElements_1_1.done && (_a = fontElements_1.return)) _a.call(fontElements_1);
|
|
993
|
-
}
|
|
994
|
-
finally { if (e_1) throw e_1.error; }
|
|
995
|
-
}
|
|
996
|
-
this.cleanUpBlankStyleTags(doc);
|
|
997
|
-
this.focusEditor(id);
|
|
998
|
-
this.editors[id].commandChangeObservable.next();
|
|
999
|
-
};
|
|
1000
|
-
SkyTextEditorAdapterService.prototype.removeObservers = function (setting) {
|
|
1001
|
-
/* istanbul ignore next */
|
|
1002
|
-
var documentEl = setting.iframeElementRef.contentWindow
|
|
1003
|
-
? setting.iframeElementRef.contentWindow.document
|
|
1004
|
-
: setting.iframeElementRef.contentDocument;
|
|
1005
|
-
setting.selectionChangeObservable.complete();
|
|
1006
|
-
setting.clickObservable.complete();
|
|
1007
|
-
setting.commandChangeObservable.complete();
|
|
1008
|
-
documentEl.removeEventListener('selectionchange', setting.selectionListener);
|
|
1009
|
-
documentEl.removeEventListener('input', setting.selectionListener);
|
|
1010
|
-
documentEl.removeEventListener('mousedown', setting.clickListener);
|
|
1011
|
-
documentEl.body.removeEventListener('paste', setting.pasteListener);
|
|
1012
|
-
};
|
|
1013
|
-
SkyTextEditorAdapterService.prototype.getContentWindowEl = function (id) {
|
|
1014
|
-
return this.editors[id].iframeElementRef.contentWindow;
|
|
1015
|
-
};
|
|
1016
|
-
SkyTextEditorAdapterService.prototype.getChildSelectedAnchorTags = function (editorId) {
|
|
1017
|
-
var selectedRange = this.getCurrentSelection(editorId).getRangeAt(0);
|
|
1018
|
-
if (selectedRange.toString().length <= 0) {
|
|
1019
|
-
return [];
|
|
1020
|
-
}
|
|
1021
|
-
var parentElement = this.getCurrentSelectionParentElement(editorId);
|
|
1022
|
-
var childElements = [];
|
|
1023
|
-
/* istanbul ignore else */
|
|
1024
|
-
if (parentElement) {
|
|
1025
|
-
childElements = Array.from(parentElement.querySelectorAll('a'));
|
|
1026
|
-
}
|
|
1027
|
-
/* istanbul ignore next */
|
|
1028
|
-
return childElements.filter(function (element) {
|
|
1029
|
-
// IE specific
|
|
1030
|
-
if (!selectedRange.intersectsNode) {
|
|
1031
|
-
if (!element || !element.href) {
|
|
1032
|
-
return false;
|
|
1033
|
-
}
|
|
1034
|
-
var tempRange = document.createRange();
|
|
1035
|
-
tempRange.selectNodeContents(element);
|
|
1036
|
-
return ((selectedRange.compareBoundaryPoints(Range.START_TO_START, tempRange) !== -1 &&
|
|
1037
|
-
selectedRange.compareBoundaryPoints(Range.START_TO_END, tempRange) !== 1) ||
|
|
1038
|
-
(selectedRange.compareBoundaryPoints(Range.END_TO_START, tempRange) !== -1 &&
|
|
1039
|
-
selectedRange.compareBoundaryPoints(Range.END_TO_END, tempRange) !==
|
|
1040
|
-
1));
|
|
1041
|
-
}
|
|
1042
|
-
// Normal non-IE
|
|
1043
|
-
return (!!element && !!element.href && selectedRange.intersectsNode(element));
|
|
1044
|
-
});
|
|
1045
|
-
};
|
|
1046
|
-
SkyTextEditorAdapterService.prototype.getIframeDocumentEl = function (id) {
|
|
1047
|
-
/* istanbul ignore next */
|
|
1048
|
-
if (!(id in this.editors)) {
|
|
1049
|
-
return undefined;
|
|
1050
|
-
}
|
|
1051
|
-
var contentWindowEl = this.getContentWindowEl(id);
|
|
1052
|
-
/* istanbul ignore else */
|
|
1053
|
-
if (contentWindowEl) {
|
|
1054
|
-
return contentWindowEl.document;
|
|
1055
|
-
}
|
|
1056
|
-
/* istanbul ignore next */
|
|
1057
|
-
return this.editors[id].iframeElementRef.contentDocument;
|
|
1058
|
-
};
|
|
1059
|
-
SkyTextEditorAdapterService.prototype.getFontSize = function (id) {
|
|
1060
|
-
var fontSize = STYLE_STATE_DEFAULTS.fontSize.toString();
|
|
1061
|
-
var selection = this.getCurrentSelection(id);
|
|
1062
|
-
/* istanbul ignore else */
|
|
1063
|
-
if (selection &&
|
|
1064
|
-
selection.anchorNode &&
|
|
1065
|
-
selection.anchorNode.parentElement) {
|
|
1066
|
-
var element = selection.anchorNode;
|
|
1067
|
-
if (element.nodeType !== 1) {
|
|
1068
|
-
element = element.parentElement;
|
|
1069
|
-
}
|
|
1070
|
-
var computedStyle = window.getComputedStyle(element);
|
|
1071
|
-
/* istanbul ignore else */
|
|
1072
|
-
if (computedStyle) {
|
|
1073
|
-
fontSize = computedStyle.getPropertyValue('font-size');
|
|
1074
|
-
}
|
|
1075
|
-
}
|
|
1076
|
-
return fontSize;
|
|
1077
|
-
};
|
|
1078
|
-
SkyTextEditorAdapterService.prototype.createObservers = function (id, element) {
|
|
1079
|
-
/* istanbul ignore next */
|
|
1080
|
-
var documentEl = element.contentWindow
|
|
1081
|
-
? element.contentWindow.document
|
|
1082
|
-
: element.contentDocument;
|
|
1083
|
-
// Firefox bug where we need to open/close to cancel load so it doesn't overwrite attrs
|
|
1084
|
-
documentEl.open();
|
|
1085
|
-
documentEl.close();
|
|
1086
|
-
var selectionObservable = new rxjs.Subject();
|
|
1087
|
-
var selectionListener = function () { return selectionObservable.next(); };
|
|
1088
|
-
var clickObservable = new rxjs.Subject();
|
|
1089
|
-
var clickListener = function () { return clickObservable.next(); };
|
|
1090
|
-
var pasteListener = this.getPasteOverride(id);
|
|
1091
|
-
var blurObservable = new rxjs.Subject();
|
|
1092
|
-
var blurListener = function () { return blurObservable.next(); };
|
|
1093
|
-
var inputObservable = new rxjs.Subject();
|
|
1094
|
-
var inputListener = function () { return inputObservable.next(); };
|
|
1095
|
-
documentEl.addEventListener('selectionchange', selectionListener);
|
|
1096
|
-
documentEl.addEventListener('input', inputListener);
|
|
1097
|
-
documentEl.addEventListener('mousedown', clickListener);
|
|
1098
|
-
documentEl.body.addEventListener('paste', pasteListener);
|
|
1099
|
-
documentEl.body.addEventListener('blur', blurListener);
|
|
1100
|
-
return {
|
|
1101
|
-
blurObservable: blurObservable,
|
|
1102
|
-
clickObservable: clickObservable,
|
|
1103
|
-
commandChangeObservable: new rxjs.Subject(),
|
|
1104
|
-
iframeElementRef: element,
|
|
1105
|
-
inputObservable: inputObservable,
|
|
1106
|
-
selectionChangeObservable: selectionObservable,
|
|
1107
|
-
blurListener: blurListener,
|
|
1108
|
-
clickListener: clickListener,
|
|
1109
|
-
inputListener: inputListener,
|
|
1110
|
-
pasteListener: pasteListener,
|
|
1111
|
-
selectionListener: selectionListener,
|
|
1112
|
-
};
|
|
1113
|
-
};
|
|
1114
|
-
/* istanbul ignore next */
|
|
1115
|
-
SkyTextEditorAdapterService.prototype.getPasteOverride = function (id) {
|
|
1116
|
-
var _this = this;
|
|
1117
|
-
return function (e) {
|
|
1118
|
-
e.preventDefault();
|
|
1119
|
-
var text = e.clipboardData.getData('text/plain');
|
|
1120
|
-
_this.execCommand(id, { command: 'insertHTML', value: text });
|
|
1121
|
-
};
|
|
1122
|
-
};
|
|
1123
|
-
SkyTextEditorAdapterService.prototype.getCurrentSelectionParentElement = function (id) {
|
|
1124
|
-
return this.selectionService.getCurrentSelectionParentElement(this.getIframeDocumentEl(id));
|
|
1125
|
-
};
|
|
1126
|
-
SkyTextEditorAdapterService.prototype.getColor = function (documentEl, selector) {
|
|
1127
|
-
var commandValue = documentEl.queryCommandValue(selector);
|
|
1128
|
-
// Edge is weird and returns numbers
|
|
1129
|
-
/* istanbul ignore if */
|
|
1130
|
-
if (typeof commandValue === 'number') {
|
|
1131
|
-
/* istanbul ignore next */
|
|
1132
|
-
// tslint:disable-next-line: no-bitwise
|
|
1133
|
-
return ('rgb(' +
|
|
1134
|
-
(commandValue & 0xff) +
|
|
1135
|
-
', ' +
|
|
1136
|
-
// tslint:disable-next-line: no-bitwise
|
|
1137
|
-
((commandValue & 0xff00) >> 8) +
|
|
1138
|
-
', ' +
|
|
1139
|
-
// tslint:disable-next-line: no-bitwise
|
|
1140
|
-
((commandValue & 0xff0000) >> 16) +
|
|
1141
|
-
')');
|
|
1142
|
-
}
|
|
1143
|
-
// Firefox uses 'Transparent' instead of a color value
|
|
1144
|
-
/* istanbul ignore next */
|
|
1145
|
-
if (commandValue.toString().toLowerCase() === 'transparent') {
|
|
1146
|
-
return STYLE_STATE_DEFAULTS.backColor;
|
|
1147
|
-
}
|
|
1148
|
-
return commandValue;
|
|
1149
|
-
};
|
|
1150
|
-
SkyTextEditorAdapterService.prototype.hasLink = function (editorId) {
|
|
1151
|
-
var anchorEl = this.getSelectedAnchorTag(editorId);
|
|
1152
|
-
var childAnchorEls = this.getChildSelectedAnchorTags(editorId);
|
|
1153
|
-
/* istanbul ignore next */
|
|
1154
|
-
return childAnchorEls.length > 0 || (!!anchorEl && !!anchorEl.href);
|
|
1155
|
-
};
|
|
1156
|
-
SkyTextEditorAdapterService.prototype.getParent = function (element, tag) {
|
|
1157
|
-
var currentNode = element;
|
|
1158
|
-
while (currentNode && currentNode.tagName.toUpperCase() !== 'BODY') {
|
|
1159
|
-
if (currentNode.tagName.toUpperCase() === tag.toUpperCase()) {
|
|
1160
|
-
return currentNode;
|
|
1161
|
-
}
|
|
1162
|
-
currentNode = currentNode.parentElement;
|
|
1163
|
-
}
|
|
1164
|
-
return undefined;
|
|
1165
|
-
};
|
|
1166
|
-
SkyTextEditorAdapterService.prototype.editorSelected = function (id) {
|
|
1167
|
-
var documentEl = this.getIframeDocumentEl(id);
|
|
1168
|
-
return this.selectionService.isElementSelected(documentEl, documentEl.body);
|
|
1169
|
-
};
|
|
1170
|
-
/* istanbul ignore next */
|
|
1171
|
-
SkyTextEditorAdapterService.prototype.insertHtmlInIE11 = function (id, html) {
|
|
1172
|
-
var documentEl = this.getIframeDocumentEl(id);
|
|
1173
|
-
var windowEl = this.getContentWindowEl(id);
|
|
1174
|
-
var sel = windowEl.getSelection();
|
|
1175
|
-
if (sel.getRangeAt && sel.rangeCount) {
|
|
1176
|
-
var range = sel.getRangeAt(0);
|
|
1177
|
-
range.deleteContents();
|
|
1178
|
-
var el = documentEl.createElement('div');
|
|
1179
|
-
el.innerHTML = html;
|
|
1180
|
-
var frag = documentEl.createDocumentFragment();
|
|
1181
|
-
var node = void 0, lastNode = void 0;
|
|
1182
|
-
while (el.firstChild) {
|
|
1183
|
-
node = el.firstChild;
|
|
1184
|
-
lastNode = frag.appendChild(node);
|
|
1185
|
-
}
|
|
1186
|
-
range.insertNode(frag);
|
|
1187
|
-
// Preserve the selection
|
|
1188
|
-
if (lastNode) {
|
|
1189
|
-
range = range.cloneRange();
|
|
1190
|
-
range.setStartAfter(lastNode);
|
|
1191
|
-
range.collapse(true);
|
|
1192
|
-
sel.removeAllRanges();
|
|
1193
|
-
sel.addRange(range);
|
|
1194
|
-
}
|
|
1195
|
-
}
|
|
1196
|
-
};
|
|
1197
|
-
SkyTextEditorAdapterService.prototype.cleanUpBlankStyleTags = function (doc) {
|
|
1198
|
-
var e_2, _a, e_3, _b;
|
|
1199
|
-
var orphanElements = Array.from(doc.querySelectorAll('font,span,*[style=""]'));
|
|
1200
|
-
try {
|
|
1201
|
-
for (var orphanElements_1 = __values(orphanElements), orphanElements_1_1 = orphanElements_1.next(); !orphanElements_1_1.done; orphanElements_1_1 = orphanElements_1.next()) {
|
|
1202
|
-
var element = orphanElements_1_1.value;
|
|
1203
|
-
if (!element.getAttribute('style')) {
|
|
1204
|
-
element.removeAttribute('style');
|
|
1205
|
-
}
|
|
1206
|
-
}
|
|
1207
|
-
}
|
|
1208
|
-
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
|
1209
|
-
finally {
|
|
1210
|
-
try {
|
|
1211
|
-
if (orphanElements_1_1 && !orphanElements_1_1.done && (_a = orphanElements_1.return)) _a.call(orphanElements_1);
|
|
1212
|
-
}
|
|
1213
|
-
finally { if (e_2) throw e_2.error; }
|
|
1214
|
-
}
|
|
1215
|
-
var removableElements = orphanElements.filter(function (element) {
|
|
1216
|
-
var tagName = element.tagName.toUpperCase();
|
|
1217
|
-
return ((tagName === 'FONT' || tagName === 'SPAN') &&
|
|
1218
|
-
(element.attributes.length === 0 || !element.hasChildNodes));
|
|
1219
|
-
});
|
|
1220
|
-
try {
|
|
1221
|
-
for (var removableElements_1 = __values(removableElements), removableElements_1_1 = removableElements_1.next(); !removableElements_1_1.done; removableElements_1_1 = removableElements_1.next()) {
|
|
1222
|
-
var element = removableElements_1_1.value;
|
|
1223
|
-
var parent = element.parentNode;
|
|
1224
|
-
/* istanbul ignore else */
|
|
1225
|
-
if (parent) {
|
|
1226
|
-
while (element.firstChild) {
|
|
1227
|
-
parent.insertBefore(element.firstChild, element);
|
|
1228
|
-
}
|
|
1229
|
-
parent.removeChild(element);
|
|
1230
|
-
}
|
|
1231
|
-
}
|
|
1232
|
-
}
|
|
1233
|
-
catch (e_3_1) { e_3 = { error: e_3_1 }; }
|
|
1234
|
-
finally {
|
|
1235
|
-
try {
|
|
1236
|
-
if (removableElements_1_1 && !removableElements_1_1.done && (_b = removableElements_1.return)) _b.call(removableElements_1);
|
|
1237
|
-
}
|
|
1238
|
-
finally { if (e_3) throw e_3.error; }
|
|
1239
|
-
}
|
|
1240
|
-
};
|
|
1241
|
-
// Certain values are encoded in html and need to be decoded
|
|
1242
|
-
SkyTextEditorAdapterService.prototype.replaceHtmlCodes = function (str) {
|
|
1243
|
-
return str
|
|
1244
|
-
.replace(/ /, String.fromCharCode(160))
|
|
1245
|
-
.replace(/</g, '<')
|
|
1246
|
-
.replace(/>/g, '>')
|
|
1247
|
-
.replace(/&/g, '&');
|
|
1248
|
-
};
|
|
1249
|
-
SkyTextEditorAdapterService.prototype.setEditorDisabled = function (id, focusableChildren, textEditorNativeElement, disabled) {
|
|
1250
|
-
textEditorNativeElement.style.pointerEvents = disabled ? 'none' : 'auto';
|
|
1251
|
-
textEditorNativeElement.setAttribute('aria-disabled', disabled ? 'true' : 'false');
|
|
1252
|
-
/* istanbul ignore else */
|
|
1253
|
-
if (focusableChildren.length > 0) {
|
|
1254
|
-
focusableChildren.forEach(function (aFocusableChild) {
|
|
1255
|
-
aFocusableChild.tabIndex = disabled ? -1 : 0;
|
|
1256
|
-
});
|
|
1257
|
-
}
|
|
1258
|
-
this.getIframeDocumentEl(id).body.setAttribute('contenteditable', disabled ? 'false' : 'true');
|
|
1259
|
-
};
|
|
1260
|
-
return SkyTextEditorAdapterService;
|
|
1261
|
-
}());
|
|
1262
|
-
SkyTextEditorAdapterService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyTextEditorAdapterService, deps: [{ token: SkyTextEditorSelectionService }, { token: SkyTextEditorService }, { token: i3__namespace.SkyAppWindowRef }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
1263
|
-
SkyTextEditorAdapterService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyTextEditorAdapterService, providedIn: 'root' });
|
|
1264
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyTextEditorAdapterService, decorators: [{
|
|
1265
|
-
type: i0.Injectable,
|
|
1266
|
-
args: [{
|
|
1267
|
-
providedIn: 'root',
|
|
1268
|
-
}]
|
|
1269
|
-
}], ctorParameters: function () { return [{ type: SkyTextEditorSelectionService }, { type: SkyTextEditorService }, { type: i3__namespace.SkyAppWindowRef }]; } });
|
|
1270
|
-
|
|
1271
|
-
/**
|
|
1272
|
-
* @internal
|
|
1273
|
-
*/
|
|
1274
|
-
var SkyTextEditorMenubarComponent = /** @class */ (function () {
|
|
1275
|
-
function SkyTextEditorMenubarComponent(adapterService, changeDetector, resources) {
|
|
1276
|
-
this.adapterService = adapterService;
|
|
1277
|
-
this.changeDetector = changeDetector;
|
|
1278
|
-
this.resources = resources;
|
|
1279
|
-
this.editorFocusStream = new rxjs.Subject();
|
|
1280
|
-
this.menus = [];
|
|
1281
|
-
this.mergeFields = [];
|
|
1282
|
-
this._disabled = false;
|
|
1283
|
-
this.editDropdownStream = new rxjs.Subject();
|
|
1284
|
-
this.formatDropdownStream = new rxjs.Subject();
|
|
1285
|
-
this.mergeFieldDropdownStream = new rxjs.Subject();
|
|
1286
|
-
this.ngUnsubscribe = new rxjs.Subject();
|
|
1287
|
-
}
|
|
1288
|
-
Object.defineProperty(SkyTextEditorMenubarComponent.prototype, "disabled", {
|
|
1289
|
-
get: function () {
|
|
1290
|
-
return this._disabled;
|
|
1291
|
-
},
|
|
1292
|
-
set: function (value) {
|
|
1293
|
-
var coercedValue = SkyFormsUtility.coerceBooleanProperty(value);
|
|
1294
|
-
if (coercedValue !== this.disabled) {
|
|
1295
|
-
this._disabled = coercedValue;
|
|
1296
|
-
this.changeDetector.markForCheck();
|
|
1297
|
-
}
|
|
1298
|
-
},
|
|
1299
|
-
enumerable: false,
|
|
1300
|
-
configurable: true
|
|
1301
|
-
});
|
|
1302
|
-
SkyTextEditorMenubarComponent.prototype.ngOnInit = function () {
|
|
1303
|
-
var _this = this;
|
|
1304
|
-
this.editorFocusStream.pipe(operators.takeUntil(this.ngUnsubscribe)).subscribe(function () {
|
|
1305
|
-
_this.closeDropdowns();
|
|
1306
|
-
});
|
|
1307
|
-
rxjs.forkJoin([
|
|
1308
|
-
// Format menu strings.
|
|
1309
|
-
this.resources.getString('skyux_text_editor_format_menu_action_bold_label'),
|
|
1310
|
-
this.resources.getString('skyux_text_editor_format_menu_action_bold_key_shortcut'),
|
|
1311
|
-
this.resources.getString('skyux_text_editor_format_menu_action_italic_label'),
|
|
1312
|
-
this.resources.getString('skyux_text_editor_format_menu_action_italic_key_shortcut'),
|
|
1313
|
-
this.resources.getString('skyux_text_editor_format_menu_action_underline_label'),
|
|
1314
|
-
this.resources.getString('skyux_text_editor_format_menu_action_underline_key_shortcut'),
|
|
1315
|
-
this.resources.getString('skyux_text_editor_format_menu_action_strikethrough_label'),
|
|
1316
|
-
this.resources.getString('skyux_text_editor_format_menu_action_clear_formatting_label'),
|
|
1317
|
-
// Edit menu string - start at index 8.
|
|
1318
|
-
this.resources.getString('skyux_text_editor_edit_menu_action_undo_label'),
|
|
1319
|
-
this.resources.getString('skyux_text_editor_edit_menu_action_undo_key_shortcut'),
|
|
1320
|
-
this.resources.getString('skyux_text_editor_edit_menu_action_redo_label'),
|
|
1321
|
-
this.resources.getString('skyux_text_editor_edit_menu_action_redo_key_shortcut'),
|
|
1322
|
-
this.resources.getString('skyux_text_editor_edit_menu_action_cut_label'),
|
|
1323
|
-
this.resources.getString('skyux_text_editor_edit_menu_action_cut_key_shortcut'),
|
|
1324
|
-
this.resources.getString('skyux_text_editor_edit_menu_action_copy_label'),
|
|
1325
|
-
this.resources.getString('skyux_text_editor_edit_menu_action_copy_key_shortcut'),
|
|
1326
|
-
this.resources.getString('skyux_text_editor_edit_menu_action_paste_label'),
|
|
1327
|
-
this.resources.getString('skyux_text_editor_edit_menu_action_paste_key_shortcut'),
|
|
1328
|
-
this.resources.getString('skyux_text_editor_edit_menu_action_select_all_label'),
|
|
1329
|
-
this.resources.getString('skyux_text_editor_edit_menu_action_select_all_key_shortcut'),
|
|
1330
|
-
])
|
|
1331
|
-
.pipe(operators.take(1))
|
|
1332
|
-
.subscribe(function (resources) {
|
|
1333
|
-
_this.formatItems = [
|
|
1334
|
-
{
|
|
1335
|
-
function: function () { return _this.execCommand('bold'); },
|
|
1336
|
-
label: resources[0],
|
|
1337
|
-
keyShortcut: resources[1],
|
|
1338
|
-
},
|
|
1339
|
-
{
|
|
1340
|
-
function: function () { return _this.execCommand('italic'); },
|
|
1341
|
-
label: resources[2],
|
|
1342
|
-
keyShortcut: resources[3],
|
|
1343
|
-
},
|
|
1344
|
-
{
|
|
1345
|
-
function: function () { return _this.execCommand('underline'); },
|
|
1346
|
-
label: resources[4],
|
|
1347
|
-
keyShortcut: resources[5],
|
|
1348
|
-
},
|
|
1349
|
-
{
|
|
1350
|
-
function: function () { return _this.execCommand('strikethrough'); },
|
|
1351
|
-
label: resources[6],
|
|
1352
|
-
},
|
|
1353
|
-
{
|
|
1354
|
-
isDivider: true,
|
|
1355
|
-
},
|
|
1356
|
-
{
|
|
1357
|
-
function: function () { return _this.clearFormat(); },
|
|
1358
|
-
label: resources[7],
|
|
1359
|
-
},
|
|
1360
|
-
];
|
|
1361
|
-
_this.editItems = [
|
|
1362
|
-
{
|
|
1363
|
-
function: function () { return _this.execCommand('undo'); },
|
|
1364
|
-
label: resources[8],
|
|
1365
|
-
keyShortcut: resources[9],
|
|
1366
|
-
},
|
|
1367
|
-
{
|
|
1368
|
-
function: function () { return _this.execCommand('redo'); },
|
|
1369
|
-
label: resources[10],
|
|
1370
|
-
keyShortcut: resources[11],
|
|
1371
|
-
},
|
|
1372
|
-
{
|
|
1373
|
-
isDivider: true,
|
|
1374
|
-
},
|
|
1375
|
-
{
|
|
1376
|
-
function: function () { return _this.execCommand('cut'); },
|
|
1377
|
-
label: resources[12],
|
|
1378
|
-
keyShortcut: resources[13],
|
|
1379
|
-
},
|
|
1380
|
-
{
|
|
1381
|
-
function: function () { return _this.execCommand('copy'); },
|
|
1382
|
-
label: resources[14],
|
|
1383
|
-
keyShortcut: resources[15],
|
|
1384
|
-
},
|
|
1385
|
-
{
|
|
1386
|
-
function: function () { return _this.execCommand('paste'); },
|
|
1387
|
-
label: resources[16],
|
|
1388
|
-
keyShortcut: resources[17],
|
|
1389
|
-
},
|
|
1390
|
-
{
|
|
1391
|
-
isDivider: true,
|
|
1392
|
-
},
|
|
1393
|
-
{
|
|
1394
|
-
function: function () { return _this.execCommand('selectAll'); },
|
|
1395
|
-
label: resources[18],
|
|
1396
|
-
keyShortcut: resources[19],
|
|
1397
|
-
},
|
|
1398
|
-
];
|
|
1399
|
-
});
|
|
1400
|
-
};
|
|
1401
|
-
SkyTextEditorMenubarComponent.prototype.ngOnDestroy = function () {
|
|
1402
|
-
this.ngUnsubscribe.next();
|
|
1403
|
-
this.ngUnsubscribe.complete();
|
|
1404
|
-
};
|
|
1405
|
-
SkyTextEditorMenubarComponent.prototype.execCommand = function (command, value) {
|
|
1406
|
-
if (value === void 0) { value = ''; }
|
|
1407
|
-
this.adapterService.execCommand(this.editorId, {
|
|
1408
|
-
command: command,
|
|
1409
|
-
value: value,
|
|
1410
|
-
});
|
|
1411
|
-
};
|
|
1412
|
-
SkyTextEditorMenubarComponent.prototype.insertMergeField = function (field) {
|
|
1413
|
-
this.execCommand('insertHTML', '<img style="display: inline; cursor: grab;" data-fieldid="' +
|
|
1414
|
-
field.id +
|
|
1415
|
-
'" data-fielddisplay="' +
|
|
1416
|
-
field.name +
|
|
1417
|
-
'" src="' +
|
|
1418
|
-
(field.previewImageUrl ||
|
|
1419
|
-
this.adapterService.getMergeFieldDataURI(field.name)) +
|
|
1420
|
-
'">');
|
|
1421
|
-
};
|
|
1422
|
-
SkyTextEditorMenubarComponent.prototype.closeDropdowns = function () {
|
|
1423
|
-
this.editDropdownStream.next({ type: i4.SkyDropdownMessageType.Close });
|
|
1424
|
-
this.formatDropdownStream.next({ type: i4.SkyDropdownMessageType.Close });
|
|
1425
|
-
this.mergeFieldDropdownStream.next({ type: i4.SkyDropdownMessageType.Close });
|
|
1426
|
-
};
|
|
1427
|
-
SkyTextEditorMenubarComponent.prototype.clearFormat = function () {
|
|
1428
|
-
var currentSelection = this.adapterService.getCurrentSelection(this.editorId);
|
|
1429
|
-
/* istanbul ignore else */
|
|
1430
|
-
if (currentSelection.rangeCount > 0 &&
|
|
1431
|
-
currentSelection.getRangeAt(0).toString().length <= 0) {
|
|
1432
|
-
this.execCommand('selectAll');
|
|
1433
|
-
}
|
|
1434
|
-
this.execCommand('removeFormat');
|
|
1435
|
-
};
|
|
1436
|
-
return SkyTextEditorMenubarComponent;
|
|
1437
|
-
}());
|
|
1438
|
-
SkyTextEditorMenubarComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyTextEditorMenubarComponent, deps: [{ token: SkyTextEditorAdapterService }, { token: i0__namespace.ChangeDetectorRef }, { token: i2__namespace.SkyLibResourcesService }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
1439
|
-
SkyTextEditorMenubarComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: SkyTextEditorMenubarComponent, selector: "sky-text-editor-menubar", inputs: { editorFocusStream: "editorFocusStream", editorId: "editorId", menus: "menus", mergeFields: "mergeFields", disabled: "disabled" }, ngImport: i0__namespace, template: "<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", styles: [".sky-text-editor-dropdown-item-divider{border:0;padding:0;height:1px;margin:9px 1px;overflow:hidden;background:transparent;border-bottom:1px solid rgba(0,0,0,.1);cursor:default;filter:none}.sky-text-editor-menu-key-shortcut{float:right;margin-left:15px}\n"], components: [{ type: i3__namespace$1.λ39, selector: "sky-toolbar-item" }, { type: i4__namespace.λ3, selector: "sky-dropdown", inputs: ["buttonStyle", "buttonType", "disabled", "dismissOnBlur", "label", "horizontalAlignment", "messageStream", "title", "trigger"] }, { type: i4__namespace.λ2, selector: "sky-dropdown-button" }, { type: i4__namespace.λ4, selector: "sky-dropdown-menu", inputs: ["ariaLabelledBy", "ariaRole", "useNativeFocus"], outputs: ["menuChanges"] }, { type: i4__namespace.λ1, selector: "sky-dropdown-item", inputs: ["ariaRole"] }], directives: [{ type: i5__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i5__namespace.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i5__namespace.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i5__namespace.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { type: i5__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i6__namespace.λ2, selector: "[skyThemeClass]", inputs: ["class", "skyThemeClass"] }], pipes: { "skyLibResources": i2__namespace.SkyLibResourcesPipe }, changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush });
|
|
1440
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyTextEditorMenubarComponent, decorators: [{
|
|
1441
|
-
type: i0.Component,
|
|
1442
|
-
args: [{
|
|
1443
|
-
selector: 'sky-text-editor-menubar',
|
|
1444
|
-
template: "<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",
|
|
1445
|
-
styles: [".sky-text-editor-dropdown-item-divider{border:0;padding:0;height:1px;margin:9px 1px;overflow:hidden;background:transparent;border-bottom:1px solid rgba(0,0,0,.1);cursor:default;filter:none}.sky-text-editor-menu-key-shortcut{float:right;margin-left:15px}\n"],
|
|
1446
|
-
changeDetection: i0.ChangeDetectionStrategy.OnPush,
|
|
1447
|
-
}]
|
|
1448
|
-
}], ctorParameters: function () { return [{ type: SkyTextEditorAdapterService }, { type: i0__namespace.ChangeDetectorRef }, { type: i2__namespace.SkyLibResourcesService }]; }, propDecorators: { editorFocusStream: [{
|
|
1449
|
-
type: i0.Input
|
|
1450
|
-
}], editorId: [{
|
|
1451
|
-
type: i0.Input
|
|
1452
|
-
}], menus: [{
|
|
1453
|
-
type: i0.Input
|
|
1454
|
-
}], mergeFields: [{
|
|
1455
|
-
type: i0.Input
|
|
1456
|
-
}], disabled: [{
|
|
1457
|
-
type: i0.Input
|
|
1458
|
-
}] } });
|
|
1459
|
-
|
|
1460
|
-
/**
|
|
1461
|
-
* @internal
|
|
1462
|
-
*/
|
|
1463
|
-
var FONT_SIZE_LIST_DEFAULTS = [
|
|
1464
|
-
6, 8, 9, 10, 11, 12, 13, 14, 15, 16, 18, 20, 22, 24, 26, 28, 36, 48,
|
|
1465
|
-
];
|
|
1466
|
-
|
|
1467
|
-
/**
|
|
1468
|
-
* @internal
|
|
1469
|
-
*/
|
|
1470
|
-
var MENU_DEFAULTS = ['edit', 'format'];
|
|
1471
|
-
|
|
1472
|
-
/**
|
|
1473
|
-
* @internal
|
|
1474
|
-
*/
|
|
1475
|
-
var TOOLBAR_ACTION_DEFAULTS = [
|
|
1476
|
-
'font-family',
|
|
1477
|
-
'font-size',
|
|
1478
|
-
'font-style',
|
|
1479
|
-
'color',
|
|
1480
|
-
'list',
|
|
1481
|
-
'link',
|
|
1482
|
-
];
|
|
1483
|
-
|
|
1484
|
-
/**
|
|
1485
|
-
* @internal
|
|
1486
|
-
*/
|
|
1487
|
-
var SkyUrlModalContext = /** @class */ (function () {
|
|
1488
|
-
function SkyUrlModalContext() {
|
|
1489
|
-
}
|
|
1490
|
-
return SkyUrlModalContext;
|
|
1491
|
-
}());
|
|
1492
|
-
|
|
1493
|
-
var emailKey = 'mailto:';
|
|
1494
|
-
var queryStringParamKey = '?Subject=';
|
|
1495
|
-
/**
|
|
1496
|
-
* @internal
|
|
1497
|
-
*/
|
|
1498
|
-
var SkyTextEditorUrlModalComponent = /** @class */ (function () {
|
|
1499
|
-
function SkyTextEditorUrlModalComponent(modalInstance, modalContext) {
|
|
1500
|
-
this.modalInstance = modalInstance;
|
|
1501
|
-
this.emailAddressValid = false;
|
|
1502
|
-
this.subject = '';
|
|
1503
|
-
this.target = 0;
|
|
1504
|
-
this.valid = false;
|
|
1505
|
-
this._activeTab = 0;
|
|
1506
|
-
this._emailAddress = '';
|
|
1507
|
-
this._url = 'https://';
|
|
1508
|
-
if (modalContext.urlResult) {
|
|
1509
|
-
if (modalContext.urlResult.url.startsWith(emailKey)) {
|
|
1510
|
-
this.emailAddress = modalContext.urlResult.url.replace(emailKey, '');
|
|
1511
|
-
var queryStringIndex = this.emailAddress.indexOf(queryStringParamKey);
|
|
1512
|
-
queryStringIndex =
|
|
1513
|
-
queryStringIndex > -1
|
|
1514
|
-
? queryStringIndex
|
|
1515
|
-
: this.emailAddress.indexOf(queryStringParamKey.toLowerCase());
|
|
1516
|
-
/* istanbul ignore else */
|
|
1517
|
-
if (queryStringIndex > -1) {
|
|
1518
|
-
this.subject = decodeURI(this.emailAddress).slice(queryStringIndex + queryStringParamKey.length);
|
|
1519
|
-
this.emailAddress = this.emailAddress.slice(0, queryStringIndex);
|
|
1520
|
-
}
|
|
1521
|
-
// Set active tab to email
|
|
1522
|
-
this.activeTab = 1;
|
|
1523
|
-
}
|
|
1524
|
-
else {
|
|
1525
|
-
(this.url = modalContext.urlResult.url),
|
|
1526
|
-
(this.target = modalContext.urlResult.target);
|
|
1527
|
-
// set active tab to web page
|
|
1528
|
-
this.activeTab = 0;
|
|
1529
|
-
}
|
|
1530
|
-
}
|
|
1531
|
-
}
|
|
1532
|
-
Object.defineProperty(SkyTextEditorUrlModalComponent.prototype, "activeTab", {
|
|
1533
|
-
get: function () {
|
|
1534
|
-
return this._activeTab;
|
|
1535
|
-
},
|
|
1536
|
-
set: function (value) {
|
|
1537
|
-
this._activeTab = value;
|
|
1538
|
-
this.valid = this.isValid();
|
|
1539
|
-
},
|
|
1540
|
-
enumerable: false,
|
|
1541
|
-
configurable: true
|
|
1542
|
-
});
|
|
1543
|
-
Object.defineProperty(SkyTextEditorUrlModalComponent.prototype, "emailAddress", {
|
|
1544
|
-
get: function () {
|
|
1545
|
-
return this._emailAddress;
|
|
1546
|
-
},
|
|
1547
|
-
set: function (value) {
|
|
1548
|
-
this._emailAddress = value;
|
|
1549
|
-
this.valid = this.isValid();
|
|
1550
|
-
},
|
|
1551
|
-
enumerable: false,
|
|
1552
|
-
configurable: true
|
|
1553
|
-
});
|
|
1554
|
-
Object.defineProperty(SkyTextEditorUrlModalComponent.prototype, "url", {
|
|
1555
|
-
get: function () {
|
|
1556
|
-
return this._url;
|
|
1557
|
-
},
|
|
1558
|
-
set: function (value) {
|
|
1559
|
-
this._url = value;
|
|
1560
|
-
this.valid = this.isValid();
|
|
1561
|
-
},
|
|
1562
|
-
enumerable: false,
|
|
1563
|
-
configurable: true
|
|
1564
|
-
});
|
|
1565
|
-
SkyTextEditorUrlModalComponent.prototype.activeTabChanged = function (value) {
|
|
1566
|
-
this.activeTab = value;
|
|
1567
|
-
};
|
|
1568
|
-
SkyTextEditorUrlModalComponent.prototype.save = function () {
|
|
1569
|
-
/* istanbul ignore else */
|
|
1570
|
-
if (this.isValid()) {
|
|
1571
|
-
if (this.activeTab === 0) {
|
|
1572
|
-
this.modalInstance.save({
|
|
1573
|
-
url: this.url,
|
|
1574
|
-
target: this.target
|
|
1575
|
-
? parseInt(this.target, undefined)
|
|
1576
|
-
: UrlTarget.None,
|
|
1577
|
-
});
|
|
1578
|
-
}
|
|
1579
|
-
else {
|
|
1580
|
-
this.modalInstance.save({
|
|
1581
|
-
url: this.getEmailUrl(),
|
|
1582
|
-
target: UrlTarget.None,
|
|
1583
|
-
});
|
|
1584
|
-
}
|
|
1585
|
-
}
|
|
1586
|
-
};
|
|
1587
|
-
SkyTextEditorUrlModalComponent.prototype.cancel = function () {
|
|
1588
|
-
this.modalInstance.cancel();
|
|
1589
|
-
};
|
|
1590
|
-
SkyTextEditorUrlModalComponent.prototype.getEmailUrl = function () {
|
|
1591
|
-
return (emailKey +
|
|
1592
|
-
this.emailAddress +
|
|
1593
|
-
(this.subject ? '?Subject=' + encodeURI(this.subject) : ''));
|
|
1594
|
-
};
|
|
1595
|
-
SkyTextEditorUrlModalComponent.prototype.isValid = function () {
|
|
1596
|
-
if (this.activeTab === 0) {
|
|
1597
|
-
return !!this.url && validation.SkyValidation.isUrl(this.url);
|
|
1598
|
-
}
|
|
1599
|
-
return !!this.emailAddress && validation.SkyValidation.isEmail(this.emailAddress);
|
|
1600
|
-
};
|
|
1601
|
-
return SkyTextEditorUrlModalComponent;
|
|
1602
|
-
}());
|
|
1603
|
-
SkyTextEditorUrlModalComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyTextEditorUrlModalComponent, deps: [{ token: i1__namespace$1.SkyModalInstance }, { token: SkyUrlModalContext }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
1604
|
-
SkyTextEditorUrlModalComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: SkyTextEditorUrlModalComponent, selector: "sky-text-editor-url-modal", ngImport: i0__namespace, template: "<sky-modal>\n <sky-modal-header>\n {{ 'skyux_text_editor_url_modal_header_label' | skyLibResources }}\n </sky-modal-header>\n <sky-modal-content>\n <sky-tabset\n data-sky-id=\"test-tabset\"\n [active]=\"activeTab\"\n (activeChange)=\"activeTabChanged($event)\"\n >\n <sky-tab tabHeading=\"Web page\">\n <div class=\"sky-form-group sky-text-editor-url-modal-first-field\">\n <sky-input-box>\n <label\n class=\"sky-control-label sky-control-label-required\"\n [for]=\"urlInput.id\"\n >\n {{ 'skyux_text_editor_url_modal_url_label' | skyLibResources }}\n </label>\n <input\n class=\"sky-form-control\"\n type=\"text\"\n [(ngModel)]=\"url\"\n skyId\n #urlInput=\"skyId\"\n />\n </sky-input-box>\n </div>\n <sky-input-box class=\"sky-form-group\">\n <label class=\"sky-control-label\" [for]=\"targetInput.id\">\n {{ 'skyux_text_editor_url_modal_open_label' | skyLibResources }}\n </label>\n <select\n class=\"sky-form-control\"\n [(ngModel)]=\"target\"\n skyId\n #targetInput=\"skyId\"\n >\n <option value=\"0\">\n {{\n 'skyux_text_editor_url_modal_current_option_label'\n | skyLibResources\n }}\n </option>\n <option value=\"1\">\n {{\n 'skyux_text_editor_url_modal_new_option_label' | skyLibResources\n }}\n </option>\n </select>\n </sky-input-box>\n </sky-tab>\n <sky-tab tabHeading=\"Email address\">\n <div class=\"sky-form-group first-field\">\n <sky-input-box>\n <label\n class=\"sky-control-label sky-control-label-required\"\n [for]=\"emailAddressInput.id\"\n >\n {{ 'skyux_text_editor_url_modal_email_label' | skyLibResources }}\n </label>\n <input\n class=\"sky-form-control\"\n type=\"text\"\n [(ngModel)]=\"emailAddress\"\n skyId\n #emailAddressInput=\"skyId\"\n />\n </sky-input-box>\n </div>\n <sky-input-box class=\"sky-form-group\">\n <label class=\"sky-control-label\" [for]=\"subjectInput.id\">\n {{ 'skyux_text_editor_url_modal_subject_label' | skyLibResources }}\n </label>\n <input\n class=\"sky-form-control\"\n type=\"text\"\n [(ngModel)]=\"subject\"\n skyId\n #subjectInput=\"skyId\"\n />\n </sky-input-box>\n </sky-tab>\n </sky-tabset>\n </sky-modal-content>\n <sky-modal-footer>\n <button\n type=\"submit\"\n class=\"sky-btn sky-btn-primary\"\n [disabled]=\"!valid\"\n (click)=\"save()\"\n >\n {{ 'skyux_text_editor_url_modal_save_button_label' | skyLibResources }}\n </button>\n <button type=\"button\" class=\"sky-btn sky-btn-link\" (click)=\"cancel()\">\n {{ 'skyux_text_editor_url_modal_cancel_button_label' | skyLibResources }}\n </button>\n </sky-modal-footer>\n</sky-modal>\n", styles: [".sky-text-editor-url-modal-first-field{margin-top:15px}\n"], components: [{ type: i1__namespace$1.λ5, selector: "sky-modal", inputs: ["ariaRole", "tiledBody"] }, { type: i1__namespace$1.λ4, selector: "sky-modal-header" }, { type: i1__namespace$1.λ2, selector: "sky-modal-content" }, { type: i3__namespace$2.λ2, selector: "sky-tabset", inputs: ["active", "ariaLabel", "ariaLabelledBy", "permalinkId", "tabStyle"], outputs: ["activeChange", "newTab", "openTab", "tabIndexesChange"] }, { type: i3__namespace$2.λ1, selector: "sky-tab", inputs: ["active", "disabled", "permalinkValue", "tabHeaderCount", "tabHeading", "tabIndex"], outputs: ["close"] }, { type: i4__namespace$1.λ10, selector: "sky-input-box", inputs: ["hasErrors", "disabled"] }, { type: i1__namespace$1.λ3, selector: "sky-modal-footer" }], directives: [{ type: i5__namespace$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i3__namespace.λ2, selector: "[skyId]", exportAs: ["skyId"] }, { type: i5__namespace$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i5__namespace$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i5__namespace$1.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { type: i5__namespace$1.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { type: i5__namespace$1.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }], pipes: { "skyLibResources": i2__namespace.SkyLibResourcesPipe } });
|
|
1605
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyTextEditorUrlModalComponent, decorators: [{
|
|
1606
|
-
type: i0.Component,
|
|
1607
|
-
args: [{
|
|
1608
|
-
selector: 'sky-text-editor-url-modal',
|
|
1609
|
-
template: "<sky-modal>\n <sky-modal-header>\n {{ 'skyux_text_editor_url_modal_header_label' | skyLibResources }}\n </sky-modal-header>\n <sky-modal-content>\n <sky-tabset\n data-sky-id=\"test-tabset\"\n [active]=\"activeTab\"\n (activeChange)=\"activeTabChanged($event)\"\n >\n <sky-tab tabHeading=\"Web page\">\n <div class=\"sky-form-group sky-text-editor-url-modal-first-field\">\n <sky-input-box>\n <label\n class=\"sky-control-label sky-control-label-required\"\n [for]=\"urlInput.id\"\n >\n {{ 'skyux_text_editor_url_modal_url_label' | skyLibResources }}\n </label>\n <input\n class=\"sky-form-control\"\n type=\"text\"\n [(ngModel)]=\"url\"\n skyId\n #urlInput=\"skyId\"\n />\n </sky-input-box>\n </div>\n <sky-input-box class=\"sky-form-group\">\n <label class=\"sky-control-label\" [for]=\"targetInput.id\">\n {{ 'skyux_text_editor_url_modal_open_label' | skyLibResources }}\n </label>\n <select\n class=\"sky-form-control\"\n [(ngModel)]=\"target\"\n skyId\n #targetInput=\"skyId\"\n >\n <option value=\"0\">\n {{\n 'skyux_text_editor_url_modal_current_option_label'\n | skyLibResources\n }}\n </option>\n <option value=\"1\">\n {{\n 'skyux_text_editor_url_modal_new_option_label' | skyLibResources\n }}\n </option>\n </select>\n </sky-input-box>\n </sky-tab>\n <sky-tab tabHeading=\"Email address\">\n <div class=\"sky-form-group first-field\">\n <sky-input-box>\n <label\n class=\"sky-control-label sky-control-label-required\"\n [for]=\"emailAddressInput.id\"\n >\n {{ 'skyux_text_editor_url_modal_email_label' | skyLibResources }}\n </label>\n <input\n class=\"sky-form-control\"\n type=\"text\"\n [(ngModel)]=\"emailAddress\"\n skyId\n #emailAddressInput=\"skyId\"\n />\n </sky-input-box>\n </div>\n <sky-input-box class=\"sky-form-group\">\n <label class=\"sky-control-label\" [for]=\"subjectInput.id\">\n {{ 'skyux_text_editor_url_modal_subject_label' | skyLibResources }}\n </label>\n <input\n class=\"sky-form-control\"\n type=\"text\"\n [(ngModel)]=\"subject\"\n skyId\n #subjectInput=\"skyId\"\n />\n </sky-input-box>\n </sky-tab>\n </sky-tabset>\n </sky-modal-content>\n <sky-modal-footer>\n <button\n type=\"submit\"\n class=\"sky-btn sky-btn-primary\"\n [disabled]=\"!valid\"\n (click)=\"save()\"\n >\n {{ 'skyux_text_editor_url_modal_save_button_label' | skyLibResources }}\n </button>\n <button type=\"button\" class=\"sky-btn sky-btn-link\" (click)=\"cancel()\">\n {{ 'skyux_text_editor_url_modal_cancel_button_label' | skyLibResources }}\n </button>\n </sky-modal-footer>\n</sky-modal>\n",
|
|
1610
|
-
styles: [".sky-text-editor-url-modal-first-field{margin-top:15px}\n"],
|
|
1611
|
-
}]
|
|
1612
|
-
}], ctorParameters: function () { return [{ type: i1__namespace$1.SkyModalInstance }, { type: SkyUrlModalContext }]; } });
|
|
1613
|
-
|
|
1614
|
-
/**
|
|
1615
|
-
* @internal
|
|
1616
|
-
*/
|
|
1617
|
-
var SkyTextEditorToolbarComponent = /** @class */ (function () {
|
|
1618
|
-
function SkyTextEditorToolbarComponent(adapterService, changeDetector, modalService) {
|
|
1619
|
-
this.adapterService = adapterService;
|
|
1620
|
-
this.changeDetector = changeDetector;
|
|
1621
|
-
this.modalService = modalService;
|
|
1622
|
-
this.editorFocusStream = new rxjs.Subject();
|
|
1623
|
-
this.backColorpickerStream = new rxjs.Subject();
|
|
1624
|
-
this.colorpickerStream = new rxjs.Subject();
|
|
1625
|
-
this.fontPickerStream = new rxjs.Subject();
|
|
1626
|
-
this.fontSizeStream = new rxjs.Subject();
|
|
1627
|
-
this._disabled = false;
|
|
1628
|
-
this._styleState = STYLE_STATE_DEFAULTS;
|
|
1629
|
-
}
|
|
1630
|
-
Object.defineProperty(SkyTextEditorToolbarComponent.prototype, "styleState", {
|
|
1631
|
-
get: function () {
|
|
1632
|
-
return this._styleState;
|
|
1633
|
-
},
|
|
1634
|
-
set: function (value) {
|
|
1635
|
-
this._styleState = value;
|
|
1636
|
-
if (value.font !== this.styleStateFontName) {
|
|
1637
|
-
if (value.font === '"Blackbaud Sans", Arial, sans-serif') {
|
|
1638
|
-
this.styleStateFontName = this.getFontName('Blackbaud Sans');
|
|
1639
|
-
}
|
|
1640
|
-
else {
|
|
1641
|
-
this.styleStateFontName = this.getFontName(value.font);
|
|
1642
|
-
}
|
|
1643
|
-
}
|
|
1644
|
-
},
|
|
1645
|
-
enumerable: false,
|
|
1646
|
-
configurable: true
|
|
1647
|
-
});
|
|
1648
|
-
Object.defineProperty(SkyTextEditorToolbarComponent.prototype, "disabled", {
|
|
1649
|
-
get: function () {
|
|
1650
|
-
return this._disabled;
|
|
1651
|
-
},
|
|
1652
|
-
set: function (value) {
|
|
1653
|
-
var coercedValue = SkyFormsUtility.coerceBooleanProperty(value);
|
|
1654
|
-
if (coercedValue !== this.disabled) {
|
|
1655
|
-
this._disabled = coercedValue;
|
|
1656
|
-
this.changeDetector.markForCheck();
|
|
1657
|
-
}
|
|
1658
|
-
},
|
|
1659
|
-
enumerable: false,
|
|
1660
|
-
configurable: true
|
|
1661
|
-
});
|
|
1662
|
-
SkyTextEditorToolbarComponent.prototype.ngOnInit = function () {
|
|
1663
|
-
var _this = this;
|
|
1664
|
-
this.editorFocusStream.subscribe(function () {
|
|
1665
|
-
_this.styleState = Object.assign(Object.assign({}, _this._styleState), _this.adapterService.getStyleState(_this.editorId));
|
|
1666
|
-
_this.closeDropdowns();
|
|
1667
|
-
_this.changeDetector.detectChanges();
|
|
1668
|
-
});
|
|
1669
|
-
};
|
|
1670
|
-
SkyTextEditorToolbarComponent.prototype.execCommand = function (command, value) {
|
|
1671
|
-
if (value === void 0) { value = ''; }
|
|
1672
|
-
this.adapterService.execCommand(this.editorId, {
|
|
1673
|
-
command: command,
|
|
1674
|
-
value: value,
|
|
1675
|
-
});
|
|
1676
|
-
this.styleState = Object.assign(Object.assign({}, this.styleState), this.adapterService.getStyleState(this.editorId));
|
|
1677
|
-
};
|
|
1678
|
-
SkyTextEditorToolbarComponent.prototype.toggleFontStyle = function (currentState, newState, command) {
|
|
1679
|
-
if (currentState !== newState) {
|
|
1680
|
-
this.execCommand(command);
|
|
1681
|
-
}
|
|
1682
|
-
// Force sky-checkbox to show changes on user's initial click.
|
|
1683
|
-
this.changeDetector.detectChanges();
|
|
1684
|
-
};
|
|
1685
|
-
SkyTextEditorToolbarComponent.prototype.link = function () {
|
|
1686
|
-
var _this = this;
|
|
1687
|
-
var priorSelection = this.adapterService.saveSelection(this.editorId);
|
|
1688
|
-
var currentLink = this.adapterService.getLink(this.editorId);
|
|
1689
|
-
var inputModal = this.modalService.open(SkyTextEditorUrlModalComponent, [
|
|
1690
|
-
{
|
|
1691
|
-
provide: SkyUrlModalContext,
|
|
1692
|
-
useValue: { urlResult: currentLink },
|
|
1693
|
-
},
|
|
1694
|
-
]);
|
|
1695
|
-
inputModal.closed.subscribe(function (result) {
|
|
1696
|
-
if (result.reason === 'save' && priorSelection) {
|
|
1697
|
-
if (currentLink) {
|
|
1698
|
-
var anchor = _this.adapterService.getSelectedAnchorTag(_this.editorId);
|
|
1699
|
-
_this.adapterService.selectElement(_this.editorId, anchor);
|
|
1700
|
-
}
|
|
1701
|
-
_this.execCommand('unlink');
|
|
1702
|
-
if (result.data.target === UrlTarget.None) {
|
|
1703
|
-
// Current window
|
|
1704
|
-
_this.execCommand('createLink', result.data.url);
|
|
1705
|
-
}
|
|
1706
|
-
else {
|
|
1707
|
-
// New Window
|
|
1708
|
-
var sText = _this.adapterService.getCurrentSelection(_this.editorId);
|
|
1709
|
-
_this.execCommand('insertHTML', '<a href="' +
|
|
1710
|
-
result.data.url +
|
|
1711
|
-
'" rel="noopener noreferrer" target="_blank">' +
|
|
1712
|
-
sText +
|
|
1713
|
-
'</a>');
|
|
1714
|
-
}
|
|
1715
|
-
}
|
|
1716
|
-
});
|
|
1717
|
-
};
|
|
1718
|
-
SkyTextEditorToolbarComponent.prototype.unlink = function () {
|
|
1719
|
-
var currentSelectionRange = this.adapterService
|
|
1720
|
-
.getCurrentSelection(this.editorId)
|
|
1721
|
-
.getRangeAt(0);
|
|
1722
|
-
if (currentSelectionRange.toString().length <= 0) {
|
|
1723
|
-
var anchorTag = this.adapterService.getSelectedAnchorTag(this.editorId);
|
|
1724
|
-
this.adapterService.selectElement(this.editorId, anchorTag);
|
|
1725
|
-
}
|
|
1726
|
-
this.execCommand('unlink');
|
|
1727
|
-
};
|
|
1728
|
-
SkyTextEditorToolbarComponent.prototype.changeFontSize = function (size) {
|
|
1729
|
-
this.adapterService.setFontSize(this.editorId, size);
|
|
1730
|
-
this.styleState = Object.assign(Object.assign({}, this.styleState), this.adapterService.getStyleState(this.editorId));
|
|
1731
|
-
};
|
|
1732
|
-
SkyTextEditorToolbarComponent.prototype.onColorpickerColorChanged = function (color, isBackground) {
|
|
1733
|
-
if (isBackground === void 0) { isBackground = false; }
|
|
1734
|
-
this.execCommand(isBackground ? 'backColor' : 'foreColor', color.hex);
|
|
1735
|
-
};
|
|
1736
|
-
SkyTextEditorToolbarComponent.prototype.closeDropdowns = function () {
|
|
1737
|
-
var message = {
|
|
1738
|
-
type: i6$1.SkyColorpickerMessageType.Close,
|
|
1739
|
-
};
|
|
1740
|
-
this.colorpickerStream.next(message);
|
|
1741
|
-
this.backColorpickerStream.next(message);
|
|
1742
|
-
this.fontPickerStream.next({ type: i4.SkyDropdownMessageType.Close });
|
|
1743
|
-
this.fontSizeStream.next({ type: i4.SkyDropdownMessageType.Close });
|
|
1744
|
-
};
|
|
1745
|
-
SkyTextEditorToolbarComponent.prototype.getFontName = function (fontName) {
|
|
1746
|
-
for (var i = 0; i < this.fontList.length; i++) {
|
|
1747
|
-
if (fontName.replace(/['"]+/g, '') === this.fontList[i].name) {
|
|
1748
|
-
return this.fontList[i].name;
|
|
1749
|
-
}
|
|
1750
|
-
}
|
|
1751
|
-
};
|
|
1752
|
-
return SkyTextEditorToolbarComponent;
|
|
1753
|
-
}());
|
|
1754
|
-
SkyTextEditorToolbarComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyTextEditorToolbarComponent, deps: [{ token: SkyTextEditorAdapterService }, { token: i0__namespace.ChangeDetectorRef }, { token: i1__namespace$1.SkyModalService }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
1755
|
-
SkyTextEditorToolbarComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: SkyTextEditorToolbarComponent, selector: "sky-text-editor-toolbar", inputs: { editorFocusStream: "editorFocusStream", editorId: "editorId", fontList: "fontList", fontSizeList: "fontSizeList", toolbarActions: "toolbarActions", styleState: "styleState", disabled: "disabled" }, ngImport: i0__namespace, template: "<sky-toolbar-item\n *ngFor=\"let action of toolbarActions\"\n class=\"sky-text-editor-toolbar-action\"\n [ngClass]=\"'sky-text-editor-toolbar-action-' + action\"\n>\n <ng-container [ngSwitch]=\"action\">\n <ng-container *ngSwitchCase=\"'font-family'\">\n <sky-dropdown\n class=\"sky-text-editor-font-picker\"\n [disabled]=\"disabled\"\n [label]=\"'Font: ' + styleStateFontName\"\n [messageStream]=\"fontPickerStream\"\n >\n <sky-dropdown-button\n [ngStyle]=\"{\n 'font-family': styleState.font\n }\"\n >\n {{ styleStateFontName }}\n </sky-dropdown-button>\n <sky-dropdown-menu>\n <sky-dropdown-item *ngFor=\"let fontModel of fontList\">\n <button\n type=\"button\"\n [ngStyle]=\"{\n 'font-family': fontModel.value\n }\"\n (click)=\"execCommand('fontname', fontModel.name)\"\n >\n {{ fontModel.name }}\n </button>\n </sky-dropdown-item>\n </sky-dropdown-menu>\n </sky-dropdown>\n </ng-container>\n <ng-container *ngSwitchCase=\"'font-size'\">\n <sky-dropdown\n class=\"sky-text-editor-font-size-picker\"\n [disabled]=\"disabled\"\n [label]=\"'Font size: ' + styleState.fontSize + 'px'\"\n [messageStream]=\"fontSizeStream\"\n >\n <sky-dropdown-button\n [ngStyle]=\"{\n 'font-family': styleState.fontSize\n }\"\n >\n {{ styleState.fontSize + 'px' }}\n </sky-dropdown-button>\n <sky-dropdown-menu>\n <sky-dropdown-item *ngFor=\"let size of fontSizeList\">\n <button type=\"button\" (click)=\"changeFontSize(size)\">\n {{ size + 'px' }}\n </button>\n </sky-dropdown-item>\n </sky-dropdown-menu>\n </sky-dropdown>\n </ng-container>\n <ng-container *ngSwitchCase=\"'font-style'\">\n <div class=\"sky-switch-icon-group sky-text-editor-font-style-picker\">\n <sky-checkbox\n icon=\"bold\"\n label=\"Bold\"\n title=\"Bold\"\n [disabled]=\"disabled\"\n [ngModel]=\"styleState.boldState\"\n (ngModelChange)=\"\n toggleFontStyle(styleState.boldState, $event, 'bold')\n \"\n >\n </sky-checkbox>\n <sky-checkbox\n icon=\"italic\"\n label=\"Italicized\"\n title=\"Italicized\"\n [disabled]=\"disabled\"\n [ngModel]=\"styleState.italicState\"\n (ngModelChange)=\"\n toggleFontStyle(styleState.italicState, $event, 'italic')\n \"\n >\n </sky-checkbox>\n <sky-checkbox\n icon=\"underline\"\n label=\"Underline\"\n title=\"Underline\"\n [disabled]=\"disabled\"\n [ngModel]=\"styleState.underlineState\"\n (ngModelChange)=\"\n toggleFontStyle(styleState.underlineState, $event, 'underline')\n \"\n >\n </sky-checkbox>\n </div>\n </ng-container>\n <ng-container *ngSwitchCase=\"'color'\">\n <div class=\"sky-text-editor-colorpicker-group\">\n <div class=\"sky-text-editor-colorpicker-container\">\n <sky-colorpicker\n class=\"sky-text-editor-font-color-picker\"\n label=\"Font color\"\n [messageStream]=\"colorpickerStream\"\n [showResetButton]=\"false\"\n (selectedColorChanged)=\"onColorpickerColorChanged($event)\"\n #colorPicker\n >\n <input\n outputFormat=\"hex\"\n type=\"text\"\n [allowTransparency]=\"false\"\n [disabled]=\"disabled\"\n [ngModel]=\"styleState.fontColor\"\n [skyColorpickerInput]=\"colorPicker\"\n />\n </sky-colorpicker>\n </div>\n <div class=\"sky-text-editor-colorpicker-container\">\n <sky-colorpicker\n class=\"sky-text-editor-background-color-picker\"\n label=\"Background color\"\n [messageStream]=\"backColorpickerStream\"\n [showResetButton]=\"false\"\n (selectedColorChanged)=\"onColorpickerColorChanged($event, true)\"\n #backColorPicker\n >\n <input\n outputFormat=\"rgba\"\n type=\"text\"\n [allowTransparency]=\"true\"\n [disabled]=\"disabled\"\n [ngModel]=\"styleState.backColor\"\n [skyColorpickerInput]=\"backColorPicker\"\n />\n </sky-colorpicker>\n </div>\n </div>\n </ng-container>\n <ng-container *ngSwitchCase=\"'list'\">\n <div class=\"sky-switch-icon-group\">\n <button\n aria-label=\"Bulleted list\"\n class=\"sky-btn sky-btn-default sky-btn-icon\"\n title=\"Bulleted list\"\n [disabled]=\"disabled\"\n (click)=\"execCommand('insertUnorderedList')\"\n >\n <sky-icon *skyThemeIf=\"'default'\" icon=\"list-ul\"> </sky-icon>\n <sky-icon\n *skyThemeIf=\"'modern'\"\n icon=\"bullet-list-line\"\n iconType=\"skyux\"\n >\n </sky-icon>\n </button>\n <button\n aria-label=\"Numbered list\"\n class=\"sky-btn sky-btn-default sky-btn-icon\"\n title=\"Numbered list\"\n [disabled]=\"disabled\"\n (click)=\"execCommand('insertOrderedList')\"\n >\n <sky-icon *skyThemeIf=\"'default'\" icon=\"list-ol\"> </sky-icon>\n <sky-icon\n *skyThemeIf=\"'modern'\"\n icon=\"number-list-line\"\n iconType=\"skyux\"\n >\n </sky-icon>\n </button>\n </div>\n </ng-container>\n <ng-container *ngSwitchCase=\"'alignment'\">\n <div class=\"sky-switch-icon-group\">\n <button\n aria-label=\"Align left\"\n class=\"sky-btn sky-btn-default sky-btn-icon\"\n title=\"Align left\"\n [disabled]=\"disabled\"\n (click)=\"execCommand('justifyLeft')\"\n >\n <sky-icon *skyThemeIf=\"'default'\" icon=\"align-left\"> </sky-icon>\n <sky-icon\n *skyThemeIf=\"'modern'\"\n icon=\"align-left-text-line\"\n iconType=\"skyux\"\n >\n </sky-icon>\n </button>\n <button\n aria-label=\"Align center\"\n class=\"sky-btn sky-btn-default sky-btn-icon\"\n title=\"Align center\"\n [disabled]=\"disabled\"\n (click)=\"execCommand('justifyCenter')\"\n >\n <sky-icon *skyThemeIf=\"'default'\" icon=\"align-center\"> </sky-icon>\n <sky-icon\n *skyThemeIf=\"'modern'\"\n icon=\"center-text-line\"\n iconType=\"skyux\"\n >\n </sky-icon>\n </button>\n <button\n aria-label=\"Align right\"\n class=\"sky-btn sky-btn-default sky-btn-icon\"\n title=\"Align right\"\n [disabled]=\"disabled\"\n (click)=\"execCommand('justifyRight')\"\n >\n <sky-icon *skyThemeIf=\"'default'\" icon=\"align-right\"> </sky-icon>\n <sky-icon\n *skyThemeIf=\"'modern'\"\n icon=\"align-right-text-line\"\n iconType=\"skyux\"\n >\n </sky-icon>\n </button>\n </div>\n </ng-container>\n <ng-container *ngSwitchCase=\"'indentation'\">\n <div class=\"sky-switch-icon-group\">\n <button\n aria-label=\"Outdent\"\n class=\"sky-btn sky-btn-default sky-btn-icon\"\n title=\"Outdent\"\n [disabled]=\"disabled\"\n (click)=\"execCommand('outdent')\"\n >\n <sky-icon *skyThemeIf=\"'default'\" icon=\"outdent\"> </sky-icon>\n <sky-icon *skyThemeIf=\"'modern'\" icon=\"outdent-line\" iconType=\"skyux\">\n </sky-icon>\n </button>\n <button\n aria-label=\"Indent\"\n class=\"sky-btn sky-btn-default sky-btn-icon\"\n title=\"Indent\"\n [disabled]=\"disabled\"\n (click)=\"execCommand('indent')\"\n >\n <sky-icon *skyThemeIf=\"'default'\" icon=\"indent\"> </sky-icon>\n <sky-icon *skyThemeIf=\"'modern'\" icon=\"indent-line\" iconType=\"skyux\">\n </sky-icon>\n </button>\n </div>\n </ng-container>\n <ng-container *ngSwitchCase=\"'undo-redo'\">\n <div class=\"sky-switch-icon-group\">\n <button\n aria-label=\"Undo\"\n class=\"sky-btn sky-btn-default sky-btn-icon\"\n title=\"Undo\"\n [disabled]=\"disabled\"\n (click)=\"execCommand('undo')\"\n >\n <sky-icon *skyThemeIf=\"'default'\" icon=\"undo\"> </sky-icon>\n <sky-icon *skyThemeIf=\"'modern'\" icon=\"undo-line\" iconType=\"skyux\">\n </sky-icon>\n </button>\n <button\n aria-label=\"Redo\"\n class=\"sky-btn sky-btn-default sky-btn-icon\"\n title=\"Redo\"\n [disabled]=\"disabled\"\n (click)=\"execCommand('redo')\"\n >\n <sky-icon *skyThemeIf=\"'default'\" icon=\"repeat\"> </sky-icon>\n <sky-icon *skyThemeIf=\"'modern'\" icon=\"redo-line\" iconType=\"skyux\">\n </sky-icon>\n </button>\n </div>\n </ng-container>\n <ng-container *ngSwitchCase=\"'link'\">\n <div class=\"sky-switch-icon-group\">\n <button\n aria-label=\"Link\"\n class=\"sky-btn sky-btn-default sky-btn-icon\"\n title=\"Link\"\n [disabled]=\"disabled\"\n [ngClass]=\"{\n 'icon-btn-active': styleState.linkState\n }\"\n (click)=\"link()\"\n >\n <sky-icon *skyThemeIf=\"'default'\" icon=\"link\"> </sky-icon>\n <sky-icon *skyThemeIf=\"'modern'\" icon=\"link-line\" iconType=\"skyux\">\n </sky-icon>\n </button>\n <button\n aria-label=\"Unlink\"\n class=\"sky-btn sky-btn-default sky-btn-icon\"\n title=\"Unlink\"\n [disabled]=\"!styleState.linkState || disabled\"\n (click)=\"unlink()\"\n >\n <sky-icon *skyThemeIf=\"'default'\" icon=\"unlink\"> </sky-icon>\n <sky-icon *skyThemeIf=\"'modern'\" icon=\"unlink-line\" iconType=\"skyux\">\n </sky-icon>\n </button>\n </div>\n </ng-container>\n </ng-container>\n</sky-toolbar-item>\n", styles: [".sky-text-editor-toolbar-action .sky-toolbar-item{margin-right:15px}.sky-text-editor-toolbar-action .sky-text-editor-font-picker ::ng-deep .sky-dropdown-button-content-container{width:140px;height:20px;text-align:left}.sky-text-editor-toolbar-action .sky-text-editor-colorpicker-group{display:flex}.sky-text-editor-toolbar-action .sky-text-editor-colorpicker-group .sky-text-editor-colorpicker-container{position:relative;top:3px;margin:0 10px 0 0}.sky-text-editor-toolbar-action .sky-text-editor-colorpicker-group .sky-text-editor-colorpicker-container:last-child{margin-right:0}.sky-text-editor-toolbar-action .sky-switch-icon-group .sky-btn{margin-left:0;margin-right:0;border-radius:0;border-right:none}.sky-text-editor-toolbar-action .sky-switch-icon-group .sky-btn:first-of-type{border-top-left-radius:3px;border-bottom-left-radius:3px}.sky-text-editor-toolbar-action .sky-switch-icon-group .sky-btn:last-of-type{border-top-right-radius:3px;border-bottom-right-radius:3px;border-right:1px solid #cdcfd2}:host-context(.sky-theme-modern) .sky-text-editor-colorpicker-group .sky-text-editor-colorpicker-container{top:-2px;margin:0}:host-context(.sky-theme-modern) .sky-text-editor-colorpicker-group .sky-text-editor-colorpicker-container:last-child ::ng-deep sky-colorpicker .sky-colorpicker-button{margin-right:0}:host-context(.sky-theme-modern) .sky-switch-icon-group .sky-btn{margin:inherit;border-radius:6px}:host-context(.sky-theme-modern) .sky-switch-icon-group .sky-btn:first-of-type,:host-context(.sky-theme-modern) .sky-switch-icon-group .sky-btn:last-of-type{border-radius:6px}:host-context(.sky-theme-modern) .sky-text-editor-toolbar-action .sky-switch-icon-group .sky-btn:last-of-type{border:none}.sky-theme-modern .sky-text-editor-colorpicker-group .sky-text-editor-colorpicker-container{top:-2px;margin:0}.sky-theme-modern .sky-text-editor-colorpicker-group .sky-text-editor-colorpicker-container:last-child ::ng-deep sky-colorpicker .sky-colorpicker-button{margin-right:0}.sky-theme-modern .sky-switch-icon-group .sky-btn{margin:inherit;border-radius:6px}.sky-theme-modern .sky-switch-icon-group .sky-btn:first-of-type,.sky-theme-modern .sky-switch-icon-group .sky-btn:last-of-type{border-radius:6px}.sky-theme-modern .sky-text-editor-toolbar-action .sky-switch-icon-group .sky-btn:last-of-type{border:none}\n"], components: [{ type: i3__namespace$1.λ39, selector: "sky-toolbar-item" }, { type: i4__namespace.λ3, selector: "sky-dropdown", inputs: ["buttonStyle", "buttonType", "disabled", "dismissOnBlur", "label", "horizontalAlignment", "messageStream", "title", "trigger"] }, { type: i4__namespace.λ2, selector: "sky-dropdown-button" }, { type: i4__namespace.λ4, selector: "sky-dropdown-menu", inputs: ["ariaLabelledBy", "ariaRole", "useNativeFocus"], outputs: ["menuChanges"] }, { type: i4__namespace.λ1, selector: "sky-dropdown-item", inputs: ["ariaRole"] }, { type: i4__namespace$1.λ3, selector: "sky-checkbox", inputs: ["label", "labelledBy", "id", "disabled", "tabindex", "name", "icon", "checkboxType", "checked", "required"], outputs: ["change", "checkedChange", "disabledChange"] }, { type: i6__namespace$1.λ1, selector: "sky-colorpicker", inputs: ["pickerButtonIcon", "pickerButtonIconType", "label", "labelledBy", "messageStream", "showResetButton"], outputs: ["selectedColorChanged", "selectedColorApplied"] }, { type: i7__namespace.λ4, selector: "sky-icon", inputs: ["icon", "iconType", "size", "fixedWidth", "variant"] }], directives: [{ type: i5__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i5__namespace.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i5__namespace.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i5__namespace.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { type: i5__namespace.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { type: i5__namespace$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i5__namespace$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i5__namespace$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i6__namespace$1.λ2, selector: "[skyColorpickerInput]", inputs: ["skyColorpickerInput", "initialColor", "returnFormat", "outputFormat", "presetColors", "alphaChannel", "allowTransparency"] }, { type: i6__namespace.λ3, selector: "[skyThemeIf]", inputs: ["skyThemeIf"] }], changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush });
|
|
1756
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyTextEditorToolbarComponent, decorators: [{
|
|
1757
|
-
type: i0.Component,
|
|
1758
|
-
args: [{
|
|
1759
|
-
selector: 'sky-text-editor-toolbar',
|
|
1760
|
-
template: "<sky-toolbar-item\n *ngFor=\"let action of toolbarActions\"\n class=\"sky-text-editor-toolbar-action\"\n [ngClass]=\"'sky-text-editor-toolbar-action-' + action\"\n>\n <ng-container [ngSwitch]=\"action\">\n <ng-container *ngSwitchCase=\"'font-family'\">\n <sky-dropdown\n class=\"sky-text-editor-font-picker\"\n [disabled]=\"disabled\"\n [label]=\"'Font: ' + styleStateFontName\"\n [messageStream]=\"fontPickerStream\"\n >\n <sky-dropdown-button\n [ngStyle]=\"{\n 'font-family': styleState.font\n }\"\n >\n {{ styleStateFontName }}\n </sky-dropdown-button>\n <sky-dropdown-menu>\n <sky-dropdown-item *ngFor=\"let fontModel of fontList\">\n <button\n type=\"button\"\n [ngStyle]=\"{\n 'font-family': fontModel.value\n }\"\n (click)=\"execCommand('fontname', fontModel.name)\"\n >\n {{ fontModel.name }}\n </button>\n </sky-dropdown-item>\n </sky-dropdown-menu>\n </sky-dropdown>\n </ng-container>\n <ng-container *ngSwitchCase=\"'font-size'\">\n <sky-dropdown\n class=\"sky-text-editor-font-size-picker\"\n [disabled]=\"disabled\"\n [label]=\"'Font size: ' + styleState.fontSize + 'px'\"\n [messageStream]=\"fontSizeStream\"\n >\n <sky-dropdown-button\n [ngStyle]=\"{\n 'font-family': styleState.fontSize\n }\"\n >\n {{ styleState.fontSize + 'px' }}\n </sky-dropdown-button>\n <sky-dropdown-menu>\n <sky-dropdown-item *ngFor=\"let size of fontSizeList\">\n <button type=\"button\" (click)=\"changeFontSize(size)\">\n {{ size + 'px' }}\n </button>\n </sky-dropdown-item>\n </sky-dropdown-menu>\n </sky-dropdown>\n </ng-container>\n <ng-container *ngSwitchCase=\"'font-style'\">\n <div class=\"sky-switch-icon-group sky-text-editor-font-style-picker\">\n <sky-checkbox\n icon=\"bold\"\n label=\"Bold\"\n title=\"Bold\"\n [disabled]=\"disabled\"\n [ngModel]=\"styleState.boldState\"\n (ngModelChange)=\"\n toggleFontStyle(styleState.boldState, $event, 'bold')\n \"\n >\n </sky-checkbox>\n <sky-checkbox\n icon=\"italic\"\n label=\"Italicized\"\n title=\"Italicized\"\n [disabled]=\"disabled\"\n [ngModel]=\"styleState.italicState\"\n (ngModelChange)=\"\n toggleFontStyle(styleState.italicState, $event, 'italic')\n \"\n >\n </sky-checkbox>\n <sky-checkbox\n icon=\"underline\"\n label=\"Underline\"\n title=\"Underline\"\n [disabled]=\"disabled\"\n [ngModel]=\"styleState.underlineState\"\n (ngModelChange)=\"\n toggleFontStyle(styleState.underlineState, $event, 'underline')\n \"\n >\n </sky-checkbox>\n </div>\n </ng-container>\n <ng-container *ngSwitchCase=\"'color'\">\n <div class=\"sky-text-editor-colorpicker-group\">\n <div class=\"sky-text-editor-colorpicker-container\">\n <sky-colorpicker\n class=\"sky-text-editor-font-color-picker\"\n label=\"Font color\"\n [messageStream]=\"colorpickerStream\"\n [showResetButton]=\"false\"\n (selectedColorChanged)=\"onColorpickerColorChanged($event)\"\n #colorPicker\n >\n <input\n outputFormat=\"hex\"\n type=\"text\"\n [allowTransparency]=\"false\"\n [disabled]=\"disabled\"\n [ngModel]=\"styleState.fontColor\"\n [skyColorpickerInput]=\"colorPicker\"\n />\n </sky-colorpicker>\n </div>\n <div class=\"sky-text-editor-colorpicker-container\">\n <sky-colorpicker\n class=\"sky-text-editor-background-color-picker\"\n label=\"Background color\"\n [messageStream]=\"backColorpickerStream\"\n [showResetButton]=\"false\"\n (selectedColorChanged)=\"onColorpickerColorChanged($event, true)\"\n #backColorPicker\n >\n <input\n outputFormat=\"rgba\"\n type=\"text\"\n [allowTransparency]=\"true\"\n [disabled]=\"disabled\"\n [ngModel]=\"styleState.backColor\"\n [skyColorpickerInput]=\"backColorPicker\"\n />\n </sky-colorpicker>\n </div>\n </div>\n </ng-container>\n <ng-container *ngSwitchCase=\"'list'\">\n <div class=\"sky-switch-icon-group\">\n <button\n aria-label=\"Bulleted list\"\n class=\"sky-btn sky-btn-default sky-btn-icon\"\n title=\"Bulleted list\"\n [disabled]=\"disabled\"\n (click)=\"execCommand('insertUnorderedList')\"\n >\n <sky-icon *skyThemeIf=\"'default'\" icon=\"list-ul\"> </sky-icon>\n <sky-icon\n *skyThemeIf=\"'modern'\"\n icon=\"bullet-list-line\"\n iconType=\"skyux\"\n >\n </sky-icon>\n </button>\n <button\n aria-label=\"Numbered list\"\n class=\"sky-btn sky-btn-default sky-btn-icon\"\n title=\"Numbered list\"\n [disabled]=\"disabled\"\n (click)=\"execCommand('insertOrderedList')\"\n >\n <sky-icon *skyThemeIf=\"'default'\" icon=\"list-ol\"> </sky-icon>\n <sky-icon\n *skyThemeIf=\"'modern'\"\n icon=\"number-list-line\"\n iconType=\"skyux\"\n >\n </sky-icon>\n </button>\n </div>\n </ng-container>\n <ng-container *ngSwitchCase=\"'alignment'\">\n <div class=\"sky-switch-icon-group\">\n <button\n aria-label=\"Align left\"\n class=\"sky-btn sky-btn-default sky-btn-icon\"\n title=\"Align left\"\n [disabled]=\"disabled\"\n (click)=\"execCommand('justifyLeft')\"\n >\n <sky-icon *skyThemeIf=\"'default'\" icon=\"align-left\"> </sky-icon>\n <sky-icon\n *skyThemeIf=\"'modern'\"\n icon=\"align-left-text-line\"\n iconType=\"skyux\"\n >\n </sky-icon>\n </button>\n <button\n aria-label=\"Align center\"\n class=\"sky-btn sky-btn-default sky-btn-icon\"\n title=\"Align center\"\n [disabled]=\"disabled\"\n (click)=\"execCommand('justifyCenter')\"\n >\n <sky-icon *skyThemeIf=\"'default'\" icon=\"align-center\"> </sky-icon>\n <sky-icon\n *skyThemeIf=\"'modern'\"\n icon=\"center-text-line\"\n iconType=\"skyux\"\n >\n </sky-icon>\n </button>\n <button\n aria-label=\"Align right\"\n class=\"sky-btn sky-btn-default sky-btn-icon\"\n title=\"Align right\"\n [disabled]=\"disabled\"\n (click)=\"execCommand('justifyRight')\"\n >\n <sky-icon *skyThemeIf=\"'default'\" icon=\"align-right\"> </sky-icon>\n <sky-icon\n *skyThemeIf=\"'modern'\"\n icon=\"align-right-text-line\"\n iconType=\"skyux\"\n >\n </sky-icon>\n </button>\n </div>\n </ng-container>\n <ng-container *ngSwitchCase=\"'indentation'\">\n <div class=\"sky-switch-icon-group\">\n <button\n aria-label=\"Outdent\"\n class=\"sky-btn sky-btn-default sky-btn-icon\"\n title=\"Outdent\"\n [disabled]=\"disabled\"\n (click)=\"execCommand('outdent')\"\n >\n <sky-icon *skyThemeIf=\"'default'\" icon=\"outdent\"> </sky-icon>\n <sky-icon *skyThemeIf=\"'modern'\" icon=\"outdent-line\" iconType=\"skyux\">\n </sky-icon>\n </button>\n <button\n aria-label=\"Indent\"\n class=\"sky-btn sky-btn-default sky-btn-icon\"\n title=\"Indent\"\n [disabled]=\"disabled\"\n (click)=\"execCommand('indent')\"\n >\n <sky-icon *skyThemeIf=\"'default'\" icon=\"indent\"> </sky-icon>\n <sky-icon *skyThemeIf=\"'modern'\" icon=\"indent-line\" iconType=\"skyux\">\n </sky-icon>\n </button>\n </div>\n </ng-container>\n <ng-container *ngSwitchCase=\"'undo-redo'\">\n <div class=\"sky-switch-icon-group\">\n <button\n aria-label=\"Undo\"\n class=\"sky-btn sky-btn-default sky-btn-icon\"\n title=\"Undo\"\n [disabled]=\"disabled\"\n (click)=\"execCommand('undo')\"\n >\n <sky-icon *skyThemeIf=\"'default'\" icon=\"undo\"> </sky-icon>\n <sky-icon *skyThemeIf=\"'modern'\" icon=\"undo-line\" iconType=\"skyux\">\n </sky-icon>\n </button>\n <button\n aria-label=\"Redo\"\n class=\"sky-btn sky-btn-default sky-btn-icon\"\n title=\"Redo\"\n [disabled]=\"disabled\"\n (click)=\"execCommand('redo')\"\n >\n <sky-icon *skyThemeIf=\"'default'\" icon=\"repeat\"> </sky-icon>\n <sky-icon *skyThemeIf=\"'modern'\" icon=\"redo-line\" iconType=\"skyux\">\n </sky-icon>\n </button>\n </div>\n </ng-container>\n <ng-container *ngSwitchCase=\"'link'\">\n <div class=\"sky-switch-icon-group\">\n <button\n aria-label=\"Link\"\n class=\"sky-btn sky-btn-default sky-btn-icon\"\n title=\"Link\"\n [disabled]=\"disabled\"\n [ngClass]=\"{\n 'icon-btn-active': styleState.linkState\n }\"\n (click)=\"link()\"\n >\n <sky-icon *skyThemeIf=\"'default'\" icon=\"link\"> </sky-icon>\n <sky-icon *skyThemeIf=\"'modern'\" icon=\"link-line\" iconType=\"skyux\">\n </sky-icon>\n </button>\n <button\n aria-label=\"Unlink\"\n class=\"sky-btn sky-btn-default sky-btn-icon\"\n title=\"Unlink\"\n [disabled]=\"!styleState.linkState || disabled\"\n (click)=\"unlink()\"\n >\n <sky-icon *skyThemeIf=\"'default'\" icon=\"unlink\"> </sky-icon>\n <sky-icon *skyThemeIf=\"'modern'\" icon=\"unlink-line\" iconType=\"skyux\">\n </sky-icon>\n </button>\n </div>\n </ng-container>\n </ng-container>\n</sky-toolbar-item>\n",
|
|
1761
|
-
styles: [".sky-text-editor-toolbar-action .sky-toolbar-item{margin-right:15px}.sky-text-editor-toolbar-action .sky-text-editor-font-picker ::ng-deep .sky-dropdown-button-content-container{width:140px;height:20px;text-align:left}.sky-text-editor-toolbar-action .sky-text-editor-colorpicker-group{display:flex}.sky-text-editor-toolbar-action .sky-text-editor-colorpicker-group .sky-text-editor-colorpicker-container{position:relative;top:3px;margin:0 10px 0 0}.sky-text-editor-toolbar-action .sky-text-editor-colorpicker-group .sky-text-editor-colorpicker-container:last-child{margin-right:0}.sky-text-editor-toolbar-action .sky-switch-icon-group .sky-btn{margin-left:0;margin-right:0;border-radius:0;border-right:none}.sky-text-editor-toolbar-action .sky-switch-icon-group .sky-btn:first-of-type{border-top-left-radius:3px;border-bottom-left-radius:3px}.sky-text-editor-toolbar-action .sky-switch-icon-group .sky-btn:last-of-type{border-top-right-radius:3px;border-bottom-right-radius:3px;border-right:1px solid #cdcfd2}:host-context(.sky-theme-modern) .sky-text-editor-colorpicker-group .sky-text-editor-colorpicker-container{top:-2px;margin:0}:host-context(.sky-theme-modern) .sky-text-editor-colorpicker-group .sky-text-editor-colorpicker-container:last-child ::ng-deep sky-colorpicker .sky-colorpicker-button{margin-right:0}:host-context(.sky-theme-modern) .sky-switch-icon-group .sky-btn{margin:inherit;border-radius:6px}:host-context(.sky-theme-modern) .sky-switch-icon-group .sky-btn:first-of-type,:host-context(.sky-theme-modern) .sky-switch-icon-group .sky-btn:last-of-type{border-radius:6px}:host-context(.sky-theme-modern) .sky-text-editor-toolbar-action .sky-switch-icon-group .sky-btn:last-of-type{border:none}.sky-theme-modern .sky-text-editor-colorpicker-group .sky-text-editor-colorpicker-container{top:-2px;margin:0}.sky-theme-modern .sky-text-editor-colorpicker-group .sky-text-editor-colorpicker-container:last-child ::ng-deep sky-colorpicker .sky-colorpicker-button{margin-right:0}.sky-theme-modern .sky-switch-icon-group .sky-btn{margin:inherit;border-radius:6px}.sky-theme-modern .sky-switch-icon-group .sky-btn:first-of-type,.sky-theme-modern .sky-switch-icon-group .sky-btn:last-of-type{border-radius:6px}.sky-theme-modern .sky-text-editor-toolbar-action .sky-switch-icon-group .sky-btn:last-of-type{border:none}\n"],
|
|
1762
|
-
changeDetection: i0.ChangeDetectionStrategy.OnPush,
|
|
1763
|
-
}]
|
|
1764
|
-
}], ctorParameters: function () { return [{ type: SkyTextEditorAdapterService }, { type: i0__namespace.ChangeDetectorRef }, { type: i1__namespace$1.SkyModalService }]; }, propDecorators: { editorFocusStream: [{
|
|
1765
|
-
type: i0.Input
|
|
1766
|
-
}], editorId: [{
|
|
1767
|
-
type: i0.Input
|
|
1768
|
-
}], fontList: [{
|
|
1769
|
-
type: i0.Input
|
|
1770
|
-
}], fontSizeList: [{
|
|
1771
|
-
type: i0.Input
|
|
1772
|
-
}], toolbarActions: [{
|
|
1773
|
-
type: i0.Input
|
|
1774
|
-
}], styleState: [{
|
|
1775
|
-
type: i0.Input
|
|
1776
|
-
}], disabled: [{
|
|
1777
|
-
type: i0.Input
|
|
1778
|
-
}] } });
|
|
1779
|
-
|
|
1780
|
-
/**
|
|
1781
|
-
* Auto-incrementing integer used to generate unique ids for radio components.
|
|
1782
|
-
*/
|
|
1783
|
-
var nextUniqueId = 0;
|
|
1784
|
-
/**
|
|
1785
|
-
* The text editor component lets users format and manipulate text.
|
|
1786
|
-
*/
|
|
1787
|
-
var SkyTextEditorComponent = /** @class */ (function () {
|
|
1788
|
-
function SkyTextEditorComponent(changeDetector, coreAdapterService, adapterService, editorService, sanitizationService, ngControl, zone) {
|
|
1789
|
-
this.changeDetector = changeDetector;
|
|
1790
|
-
this.coreAdapterService = coreAdapterService;
|
|
1791
|
-
this.adapterService = adapterService;
|
|
1792
|
-
this.editorService = editorService;
|
|
1793
|
-
this.sanitizationService = sanitizationService;
|
|
1794
|
-
this.ngControl = ngControl;
|
|
1795
|
-
this.zone = zone;
|
|
1796
|
-
/**
|
|
1797
|
-
* Indicates whether to put focus on the editor after it renders.
|
|
1798
|
-
*/
|
|
1799
|
-
this.autofocus = false;
|
|
1800
|
-
this.editorFocusStream = new rxjs.Subject();
|
|
1801
|
-
/**
|
|
1802
|
-
* Specifies the fonts to include in the font picker.
|
|
1803
|
-
* @default [{name: 'Blackbaud Sans', value: '"Blackbaud Sans", Arial, sans-serif'}, {name: 'Arial', value: 'Arial'}, {name: 'Arial Black', value: '"Arial Black"'}, {name: 'Courier New', value: '"Courier New"'}, {name: 'Georgia', value: 'Georgia, serif'}, {name: 'Tahoma', value: 'Tahoma, Geneva, sans-serif'}, {name: 'Times New Roman', value: '"Times New Roman"'}, {name: 'Trebuchet MS', value: '"Trebuchet MS", sans-serif'}, {name: 'Verdana', value: 'Verdana, Geneva, sans-serif'}]
|
|
1804
|
-
*/
|
|
1805
|
-
this.fontList = FONT_LIST_DEFAULTS;
|
|
1806
|
-
/**
|
|
1807
|
-
* Specifies the font sizes to include in the font size picker.
|
|
1808
|
-
* @default [6, 8, 9, 10, 11, 12, 13, 14, 15, 16, 18, 20, 22, 24, 26, 28, 36, 48]
|
|
1809
|
-
*/
|
|
1810
|
-
this.fontSizeList = FONT_SIZE_LIST_DEFAULTS;
|
|
1811
|
-
/**
|
|
1812
|
-
* Specifies a unique ID attribute for the text editor.
|
|
1813
|
-
* By default, the component generates a random ID.
|
|
1814
|
-
*/
|
|
1815
|
-
this.id = "sky-text-editor-" + ++nextUniqueId;
|
|
1816
|
-
/**
|
|
1817
|
-
* Specifies the menus to include in the menu bar.
|
|
1818
|
-
* @default [ 'edit', 'format' ]
|
|
1819
|
-
*/
|
|
1820
|
-
this.menus = MENU_DEFAULTS;
|
|
1821
|
-
/**
|
|
1822
|
-
* Specifies the merge fields to include in the merge field menu.
|
|
1823
|
-
*/
|
|
1824
|
-
this.mergeFields = [];
|
|
1825
|
-
/**
|
|
1826
|
-
* Specifies the actions to include in the toolbar and determines their order.
|
|
1827
|
-
* @default [ 'font-family', 'font-size', 'font-style', 'color', 'list', 'link ]
|
|
1828
|
-
*/
|
|
1829
|
-
this.toolbarActions = TOOLBAR_ACTION_DEFAULTS;
|
|
1830
|
-
this.focusInitialized = false;
|
|
1831
|
-
this.initialized = false;
|
|
1832
|
-
this.ngUnsubscribe = new rxjs.Subject();
|
|
1833
|
-
this._disabled = false;
|
|
1834
|
-
this._initialStyleState = Object.assign({}, STYLE_STATE_DEFAULTS);
|
|
1835
|
-
this._placeholder = '';
|
|
1836
|
-
this._value = '<p></p>';
|
|
1837
|
-
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
1838
|
-
this._onTouched = function () { };
|
|
1839
|
-
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
1840
|
-
this._onChange = function () { };
|
|
1841
|
-
this.ngControl.valueAccessor = this;
|
|
1842
|
-
}
|
|
1843
|
-
Object.defineProperty(SkyTextEditorComponent.prototype, "disabled", {
|
|
1844
|
-
get: function () {
|
|
1845
|
-
return this._disabled;
|
|
1846
|
-
},
|
|
1847
|
-
/**
|
|
1848
|
-
* Indicates whether to disable the text editor.
|
|
1849
|
-
* @default false
|
|
1850
|
-
*/
|
|
1851
|
-
set: function (value) {
|
|
1852
|
-
var coercedValue = SkyFormsUtility.coerceBooleanProperty(value);
|
|
1853
|
-
if (coercedValue !== this.disabled) {
|
|
1854
|
-
this._disabled = coercedValue;
|
|
1855
|
-
// Update focusableChildren inside the iframe.
|
|
1856
|
-
var focusableChildren = void 0;
|
|
1857
|
-
/* istanbul ignore else */
|
|
1858
|
-
if (this.iframeRef) {
|
|
1859
|
-
focusableChildren = this.coreAdapterService.getFocusableChildren(this.iframeRef.nativeElement.contentDocument.body, {
|
|
1860
|
-
ignoreVisibility: true,
|
|
1861
|
-
ignoreTabIndex: true,
|
|
1862
|
-
});
|
|
1863
|
-
}
|
|
1864
|
-
if (this._disabled) {
|
|
1865
|
-
this.adapterService.disableEditor(this.id, focusableChildren, this.iframeRef.nativeElement);
|
|
1866
|
-
}
|
|
1867
|
-
else {
|
|
1868
|
-
this.adapterService.enableEditor(this.id, focusableChildren, this.iframeRef.nativeElement);
|
|
1869
|
-
}
|
|
1870
|
-
this.changeDetector.markForCheck();
|
|
1871
|
-
}
|
|
1872
|
-
},
|
|
1873
|
-
enumerable: false,
|
|
1874
|
-
configurable: true
|
|
1875
|
-
});
|
|
1876
|
-
Object.defineProperty(SkyTextEditorComponent.prototype, "initialStyleState", {
|
|
1877
|
-
get: function () {
|
|
1878
|
-
return this._initialStyleState;
|
|
1879
|
-
},
|
|
1880
|
-
/**
|
|
1881
|
-
* Specifies the initial styles for all content, including background color, font size, and link state.
|
|
1882
|
-
*/
|
|
1883
|
-
set: function (state) {
|
|
1884
|
-
// Do not update the state after initialization has taken place
|
|
1885
|
-
/* istanbul ignore else */
|
|
1886
|
-
if (!this.initialized) {
|
|
1887
|
-
this._initialStyleState = Object.assign(Object.assign({}, STYLE_STATE_DEFAULTS), state);
|
|
1888
|
-
}
|
|
1889
|
-
},
|
|
1890
|
-
enumerable: false,
|
|
1891
|
-
configurable: true
|
|
1892
|
-
});
|
|
1893
|
-
Object.defineProperty(SkyTextEditorComponent.prototype, "placeholder", {
|
|
1894
|
-
get: function () {
|
|
1895
|
-
return this._placeholder;
|
|
1896
|
-
},
|
|
1897
|
-
/**
|
|
1898
|
-
* Specifies placeholder text to display when the text entry area is empty.
|
|
1899
|
-
*/
|
|
1900
|
-
set: function (value) {
|
|
1901
|
-
/* istanbul ignore else */
|
|
1902
|
-
if (value !== this._placeholder) {
|
|
1903
|
-
this._placeholder = value;
|
|
1904
|
-
if (this.initialized) {
|
|
1905
|
-
this.adapterService.setPlaceholder(this.id, value);
|
|
1906
|
-
}
|
|
1907
|
-
}
|
|
1908
|
-
},
|
|
1909
|
-
enumerable: false,
|
|
1910
|
-
configurable: true
|
|
1911
|
-
});
|
|
1912
|
-
Object.defineProperty(SkyTextEditorComponent.prototype, "value", {
|
|
1913
|
-
get: function () {
|
|
1914
|
-
return this._value;
|
|
1915
|
-
},
|
|
1916
|
-
/**
|
|
1917
|
-
* The internal value of the control.
|
|
1918
|
-
*/
|
|
1919
|
-
set: function (value) {
|
|
1920
|
-
// Normalize value and set any empty state to an empty string.
|
|
1921
|
-
var normalizedValue = value;
|
|
1922
|
-
if (!value ||
|
|
1923
|
-
value.trim() === '<p></p>' ||
|
|
1924
|
-
value.trim() === '<br>' ||
|
|
1925
|
-
value.trim() === '<p><br></p>') {
|
|
1926
|
-
normalizedValue = '';
|
|
1927
|
-
}
|
|
1928
|
-
normalizedValue = this.sanitizationService.sanitize(normalizedValue).trim();
|
|
1929
|
-
if (this._value !== normalizedValue) {
|
|
1930
|
-
this._value = normalizedValue;
|
|
1931
|
-
// Update angular form control if model has been normalized.
|
|
1932
|
-
/* istanbul ignore else */
|
|
1933
|
-
if (this.ngControl && this.ngControl.control) {
|
|
1934
|
-
/* istanbul ignore else */
|
|
1935
|
-
if (normalizedValue !== this.ngControl.control.value) {
|
|
1936
|
-
this.ngControl.control.setValue(normalizedValue, {
|
|
1937
|
-
emitModelToViewChange: false,
|
|
1938
|
-
});
|
|
1939
|
-
}
|
|
1940
|
-
}
|
|
1941
|
-
// Autofocus isn't testable in Firefox and IE.
|
|
1942
|
-
/* istanbul ignore next */
|
|
1943
|
-
if (this.autofocus && !this.focusInitialized) {
|
|
1944
|
-
this.adapterService.focusEditor(this.id);
|
|
1945
|
-
this.focusInitialized = true;
|
|
1946
|
-
}
|
|
1947
|
-
}
|
|
1948
|
-
},
|
|
1949
|
-
enumerable: false,
|
|
1950
|
-
configurable: true
|
|
1951
|
-
});
|
|
1952
|
-
SkyTextEditorComponent.prototype.ngAfterViewInit = function () {
|
|
1953
|
-
this.initIframe();
|
|
1954
|
-
};
|
|
1955
|
-
SkyTextEditorComponent.prototype.ngOnDestroy = function () {
|
|
1956
|
-
this.adapterService.removeObservers(this.editorService.editors[this.id]);
|
|
1957
|
-
this.editorService.removeEditor(this.id);
|
|
1958
|
-
this.ngUnsubscribe.next();
|
|
1959
|
-
this.ngUnsubscribe.complete();
|
|
1960
|
-
};
|
|
1961
|
-
SkyTextEditorComponent.prototype.onIframeLoad = function () {
|
|
1962
|
-
// Remove editor if it already exists to cover situations where the text editor might have been moved in the DOM.
|
|
1963
|
-
/* istanbul ignore else */
|
|
1964
|
-
if (this.editorService.editors[this.id]) {
|
|
1965
|
-
this.editorService.removeEditor(this.id);
|
|
1966
|
-
this.initIframe();
|
|
1967
|
-
}
|
|
1968
|
-
};
|
|
1969
|
-
/**
|
|
1970
|
-
* Implemented as part of ControlValueAccessor.
|
|
1971
|
-
*/
|
|
1972
|
-
SkyTextEditorComponent.prototype.writeValue = function (value) {
|
|
1973
|
-
this.value = value;
|
|
1974
|
-
// Update HTML if necessary.
|
|
1975
|
-
var editorValue = this.adapterService.getEditorInnerHtml(this.id);
|
|
1976
|
-
if (this.initialized && editorValue !== this._value) {
|
|
1977
|
-
this.adapterService.setEditorInnerHtml(this.id, this._value);
|
|
1978
|
-
}
|
|
1979
|
-
};
|
|
1980
|
-
/**
|
|
1981
|
-
* Implemented as part of ControlValueAccessor.
|
|
1982
|
-
*/
|
|
1983
|
-
SkyTextEditorComponent.prototype.registerOnChange = function (fn) {
|
|
1984
|
-
this._onChange = fn;
|
|
1985
|
-
};
|
|
1986
|
-
/**
|
|
1987
|
-
* Implemented as part of ControlValueAccessor.
|
|
1988
|
-
*/
|
|
1989
|
-
SkyTextEditorComponent.prototype.registerOnTouched = function (fn) {
|
|
1990
|
-
this._onTouched = fn;
|
|
1991
|
-
};
|
|
1992
|
-
/**
|
|
1993
|
-
* Implemented as part of ControlValueAccessor.
|
|
1994
|
-
*/
|
|
1995
|
-
SkyTextEditorComponent.prototype.setDisabledState = function (isDisabled) {
|
|
1996
|
-
this.disabled = isDisabled;
|
|
1997
|
-
};
|
|
1998
|
-
SkyTextEditorComponent.prototype.updateStyle = function () {
|
|
1999
|
-
this._initialStyleState = Object.assign(Object.assign({}, this._initialStyleState), this.adapterService.getStyleState(this.id));
|
|
2000
|
-
};
|
|
2001
|
-
SkyTextEditorComponent.prototype.initIframe = function () {
|
|
2002
|
-
var _this = this;
|
|
2003
|
-
this.adapterService.addEditor(this.id, this.iframeRef.nativeElement, this.initialStyleState, this.placeholder);
|
|
2004
|
-
this.editorService
|
|
2005
|
-
.inputListener(this.id)
|
|
2006
|
-
.pipe(operators.takeUntil(this.ngUnsubscribe))
|
|
2007
|
-
.subscribe(function () {
|
|
2008
|
-
// Angular doesn't run change detection for changes originating inside an iframe,
|
|
2009
|
-
// so we have to call the onChange() event inside NgZone to force change propigation to consuming components.
|
|
2010
|
-
_this.zone.run(function () {
|
|
2011
|
-
_this.ViewToModelUpdate();
|
|
2012
|
-
});
|
|
2013
|
-
});
|
|
2014
|
-
this.editorService
|
|
2015
|
-
.selectionChangeListener(this.id)
|
|
2016
|
-
.pipe(operators.takeUntil(this.ngUnsubscribe))
|
|
2017
|
-
.subscribe(function () {
|
|
2018
|
-
_this.updateStyle();
|
|
2019
|
-
_this.editorFocusStream.next();
|
|
2020
|
-
});
|
|
2021
|
-
this.editorService
|
|
2022
|
-
.clickListener(this.id)
|
|
2023
|
-
.pipe(operators.takeUntil(this.ngUnsubscribe))
|
|
2024
|
-
.subscribe(function () {
|
|
2025
|
-
_this.editorFocusStream.next();
|
|
2026
|
-
});
|
|
2027
|
-
this.editorService
|
|
2028
|
-
.blurListener(this.id)
|
|
2029
|
-
.pipe(operators.takeUntil(this.ngUnsubscribe))
|
|
2030
|
-
.subscribe(function () {
|
|
2031
|
-
// Angular doesn't run change detection for changes originating inside an iframe,
|
|
2032
|
-
// so we have to run markForCheck() inside the NgZone to force change propigation to consuming components.
|
|
2033
|
-
_this.zone.run(function () {
|
|
2034
|
-
_this._onTouched();
|
|
2035
|
-
});
|
|
2036
|
-
});
|
|
2037
|
-
this.editorService
|
|
2038
|
-
.commandChangeListener(this.id)
|
|
2039
|
-
.pipe(operators.takeUntil(this.ngUnsubscribe))
|
|
2040
|
-
.subscribe(function () {
|
|
2041
|
-
_this.updateStyle();
|
|
2042
|
-
_this.ViewToModelUpdate();
|
|
2043
|
-
});
|
|
2044
|
-
this.adapterService.setEditorInnerHtml(this.id, this._value);
|
|
2045
|
-
/* istanbul ignore next */
|
|
2046
|
-
if (this.autofocus) {
|
|
2047
|
-
this.adapterService.focusEditor(this.id);
|
|
2048
|
-
}
|
|
2049
|
-
this.initialized = true;
|
|
2050
|
-
};
|
|
2051
|
-
SkyTextEditorComponent.prototype.ViewToModelUpdate = function (emitChange) {
|
|
2052
|
-
if (emitChange === void 0) { emitChange = true; }
|
|
2053
|
-
this.value = this.adapterService.getEditorInnerHtml(this.id);
|
|
2054
|
-
/* istanbul ignore else */
|
|
2055
|
-
if (emitChange) {
|
|
2056
|
-
this._onChange(this._value);
|
|
2057
|
-
}
|
|
2058
|
-
};
|
|
2059
|
-
return SkyTextEditorComponent;
|
|
2060
|
-
}());
|
|
2061
|
-
SkyTextEditorComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyTextEditorComponent, deps: [{ token: i0__namespace.ChangeDetectorRef }, { token: i3__namespace.SkyCoreAdapterService }, { token: SkyTextEditorAdapterService }, { token: SkyTextEditorService }, { token: SkyTextSanitizationService }, { token: i5__namespace$1.NgControl }, { token: i0__namespace.NgZone }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
2062
|
-
SkyTextEditorComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: SkyTextEditorComponent, selector: "sky-text-editor", inputs: { autofocus: "autofocus", disabled: "disabled", fontList: "fontList", fontSizeList: "fontSizeList", id: "id", initialStyleState: "initialStyleState", menus: "menus", mergeFields: "mergeFields", placeholder: "placeholder", toolbarActions: "toolbarActions" }, viewQueries: [{ propertyName: "iframeRef", first: true, predicate: ["iframe"], descendants: true }], ngImport: i0__namespace, template: "<div class=\"sky-text-editor\">\n <sky-toolbar class=\"sky-text-editor-toolbar\">\n <sky-toolbar-section\n aria-label=\"Text formatting\"\n class=\"menubar\"\n role=\"toolbar\"\n >\n <sky-text-editor-menubar\n [disabled]=\"disabled\"\n [editorFocusStream]=\"editorFocusStream\"\n [editorId]=\"id\"\n [menus]=\"menus\"\n [mergeFields]=\"mergeFields\"\n >\n </sky-text-editor-menubar>\n </sky-toolbar-section>\n <sky-toolbar-section\n aria-label=\"Text formatting\"\n class=\"toolbar\"\n role=\"toolbar\"\n >\n <sky-text-editor-toolbar\n [disabled]=\"disabled\"\n [editorFocusStream]=\"editorFocusStream\"\n [editorId]=\"id\"\n [fontList]=\"fontList\"\n [fontSizeList]=\"fontSizeList\"\n [toolbarActions]=\"toolbarActions\"\n [styleState]=\"initialStyleState\"\n >\n </sky-text-editor-toolbar>\n </sky-toolbar-section>\n </sky-toolbar>\n <iframe\n class=\"sky-text-editor-wrapper\"\n src=\"about:blank\"\n title=\"Text Editor\"\n [ngClass]=\"{\n 'sky-text-editor-wrapper-disabled': disabled\n }\"\n (load)=\"onIframeLoad()\"\n #iframe\n >\n </iframe>\n</div>\n", styles: [".sky-text-editor .sky-text-editor-wrapper{display:flex;flex-wrap:wrap;background-color:#fff;width:100%;height:300px;padding:1rem;font-size:1.2rem;border:1px solid #c0c0c0;overflow-y:auto;outline:none}.sky-text-editor .sky-text-editor-wrapper.sky-text-editor-wrapper-disabled{background-color:#ededee}.sky-text-editor .sky-text-editor-toolbar .sky-toolbar-section{padding:10px 10px 0}.sky-text-editor .sky-text-editor-toolbar .sky-toolbar-sectioned{border-left:1px solid #cdcfd2!important;border-right:1px solid #cdcfd2!important}.sky-text-editor .sky-text-editor-toolbar .sky-toolbar-item{margin:0 20px 10px 0}.sky-text-editor .sky-text-editor-toolbar .sky-dropdown-button{border:none}.sky-text-editor .sky-text-editor-toolbar sky-text-editor-menubar,.sky-text-editor .sky-text-editor-toolbar sky-text-editor-toolbar{display:flex;flex-wrap:wrap}.sky-theme-modern .sky-text-editor .sky-text-editor-wrapper{border:1px solid #d2d2d2}.sky-theme-modern .sky-text-editor .sky-text-editor-wrapper.sky-text-editor-wrapper-disabled{background-color:#ececed}.sky-theme-modern .sky-text-editor .sky-text-editor-toolbar .sky-toolbar{padding:10px 10px 0}.sky-theme-modern .sky-text-editor .sky-text-editor-toolbar .sky-toolbar-section{padding:10px!important}.sky-theme-modern .sky-text-editor .sky-text-editor-toolbar .sky-toolbar-sectioned{border-top:1px solid #d2d2d2!important;border-left:1px solid #d2d2d2!important;border-right:1px solid #d2d2d2!important}.sky-theme-modern .sky-text-editor .sky-text-editor-toolbar .sky-toolbar-item{margin:0 20px 0 0!important}\n"], components: [{ type: i3__namespace$1.λ37, selector: "sky-toolbar" }, { type: i3__namespace$1.λ38, selector: "sky-toolbar-section" }, { type: SkyTextEditorMenubarComponent, selector: "sky-text-editor-menubar", inputs: ["editorFocusStream", "editorId", "menus", "mergeFields", "disabled"] }, { type: SkyTextEditorToolbarComponent, selector: "sky-text-editor-toolbar", inputs: ["editorFocusStream", "editorId", "fontList", "fontSizeList", "toolbarActions", "styleState", "disabled"] }], directives: [{ type: i5__namespace.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }], changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush, encapsulation: i0__namespace.ViewEncapsulation.None });
|
|
2063
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyTextEditorComponent, decorators: [{
|
|
2064
|
-
type: i0.Component,
|
|
2065
|
-
args: [{
|
|
2066
|
-
selector: 'sky-text-editor',
|
|
2067
|
-
template: "<div class=\"sky-text-editor\">\n <sky-toolbar class=\"sky-text-editor-toolbar\">\n <sky-toolbar-section\n aria-label=\"Text formatting\"\n class=\"menubar\"\n role=\"toolbar\"\n >\n <sky-text-editor-menubar\n [disabled]=\"disabled\"\n [editorFocusStream]=\"editorFocusStream\"\n [editorId]=\"id\"\n [menus]=\"menus\"\n [mergeFields]=\"mergeFields\"\n >\n </sky-text-editor-menubar>\n </sky-toolbar-section>\n <sky-toolbar-section\n aria-label=\"Text formatting\"\n class=\"toolbar\"\n role=\"toolbar\"\n >\n <sky-text-editor-toolbar\n [disabled]=\"disabled\"\n [editorFocusStream]=\"editorFocusStream\"\n [editorId]=\"id\"\n [fontList]=\"fontList\"\n [fontSizeList]=\"fontSizeList\"\n [toolbarActions]=\"toolbarActions\"\n [styleState]=\"initialStyleState\"\n >\n </sky-text-editor-toolbar>\n </sky-toolbar-section>\n </sky-toolbar>\n <iframe\n class=\"sky-text-editor-wrapper\"\n src=\"about:blank\"\n title=\"Text Editor\"\n [ngClass]=\"{\n 'sky-text-editor-wrapper-disabled': disabled\n }\"\n (load)=\"onIframeLoad()\"\n #iframe\n >\n </iframe>\n</div>\n",
|
|
2068
|
-
styles: [".sky-text-editor .sky-text-editor-wrapper{display:flex;flex-wrap:wrap;background-color:#fff;width:100%;height:300px;padding:1rem;font-size:1.2rem;border:1px solid #c0c0c0;overflow-y:auto;outline:none}.sky-text-editor .sky-text-editor-wrapper.sky-text-editor-wrapper-disabled{background-color:#ededee}.sky-text-editor .sky-text-editor-toolbar .sky-toolbar-section{padding:10px 10px 0}.sky-text-editor .sky-text-editor-toolbar .sky-toolbar-sectioned{border-left:1px solid #cdcfd2!important;border-right:1px solid #cdcfd2!important}.sky-text-editor .sky-text-editor-toolbar .sky-toolbar-item{margin:0 20px 10px 0}.sky-text-editor .sky-text-editor-toolbar .sky-dropdown-button{border:none}.sky-text-editor .sky-text-editor-toolbar sky-text-editor-menubar,.sky-text-editor .sky-text-editor-toolbar sky-text-editor-toolbar{display:flex;flex-wrap:wrap}.sky-theme-modern .sky-text-editor .sky-text-editor-wrapper{border:1px solid #d2d2d2}.sky-theme-modern .sky-text-editor .sky-text-editor-wrapper.sky-text-editor-wrapper-disabled{background-color:#ececed}.sky-theme-modern .sky-text-editor .sky-text-editor-toolbar .sky-toolbar{padding:10px 10px 0}.sky-theme-modern .sky-text-editor .sky-text-editor-toolbar .sky-toolbar-section{padding:10px!important}.sky-theme-modern .sky-text-editor .sky-text-editor-toolbar .sky-toolbar-sectioned{border-top:1px solid #d2d2d2!important;border-left:1px solid #d2d2d2!important;border-right:1px solid #d2d2d2!important}.sky-theme-modern .sky-text-editor .sky-text-editor-toolbar .sky-toolbar-item{margin:0 20px 0 0!important}\n"],
|
|
2069
|
-
changeDetection: i0.ChangeDetectionStrategy.OnPush,
|
|
2070
|
-
encapsulation: i0.ViewEncapsulation.None,
|
|
2071
|
-
}]
|
|
2072
|
-
}], ctorParameters: function () { return [{ type: i0__namespace.ChangeDetectorRef }, { type: i3__namespace.SkyCoreAdapterService }, { type: SkyTextEditorAdapterService }, { type: SkyTextEditorService }, { type: SkyTextSanitizationService }, { type: i5__namespace$1.NgControl }, { type: i0__namespace.NgZone }]; }, propDecorators: { autofocus: [{
|
|
2073
|
-
type: i0.Input
|
|
2074
|
-
}], disabled: [{
|
|
2075
|
-
type: i0.Input
|
|
2076
|
-
}], fontList: [{
|
|
2077
|
-
type: i0.Input
|
|
2078
|
-
}], fontSizeList: [{
|
|
2079
|
-
type: i0.Input
|
|
2080
|
-
}], id: [{
|
|
2081
|
-
type: i0.Input
|
|
2082
|
-
}], initialStyleState: [{
|
|
2083
|
-
type: i0.Input
|
|
2084
|
-
}], menus: [{
|
|
2085
|
-
type: i0.Input
|
|
2086
|
-
}], mergeFields: [{
|
|
2087
|
-
type: i0.Input
|
|
2088
|
-
}], placeholder: [{
|
|
2089
|
-
type: i0.Input
|
|
2090
|
-
}], toolbarActions: [{
|
|
2091
|
-
type: i0.Input
|
|
2092
|
-
}], iframeRef: [{
|
|
2093
|
-
type: i0.ViewChild,
|
|
2094
|
-
args: ['iframe']
|
|
2095
|
-
}] } });
|
|
2096
|
-
|
|
2097
|
-
var SkyTextEditorModule = /** @class */ (function () {
|
|
2098
|
-
function SkyTextEditorModule() {
|
|
2099
|
-
}
|
|
2100
|
-
return SkyTextEditorModule;
|
|
2101
|
-
}());
|
|
2102
|
-
SkyTextEditorModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyTextEditorModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
|
|
2103
|
-
SkyTextEditorModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyTextEditorModule, declarations: [SkyTextEditorComponent,
|
|
2104
|
-
SkyTextEditorUrlModalComponent,
|
|
2105
|
-
SkyTextEditorToolbarComponent,
|
|
2106
|
-
SkyTextEditorMenubarComponent], imports: [i5.CommonModule,
|
|
2107
|
-
i5$1.FormsModule,
|
|
2108
|
-
i5$1.ReactiveFormsModule,
|
|
2109
|
-
i3.SkyCoreAdapterModule,
|
|
2110
|
-
SkyTextEditorResourcesModule,
|
|
2111
|
-
i2.SkyI18nModule,
|
|
2112
|
-
i7.SkyIconModule,
|
|
2113
|
-
i3.SkyIdModule,
|
|
2114
|
-
i4$1.SkyInputBoxModule,
|
|
2115
|
-
i6$1.SkyColorpickerModule,
|
|
2116
|
-
i4$1.SkyCheckboxModule,
|
|
2117
|
-
i4.SkyDropdownModule,
|
|
2118
|
-
i1$1.SkyModalModule,
|
|
2119
|
-
i3$2.SkyTabsModule,
|
|
2120
|
-
i6.SkyThemeModule,
|
|
2121
|
-
i3$1.SkyToolbarModule], exports: [SkyTextEditorComponent,
|
|
2122
|
-
SkyTextEditorUrlModalComponent,
|
|
2123
|
-
SkyTextEditorToolbarComponent,
|
|
2124
|
-
SkyTextEditorMenubarComponent] });
|
|
2125
|
-
SkyTextEditorModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyTextEditorModule, imports: [[
|
|
2126
|
-
i5.CommonModule,
|
|
2127
|
-
i5$1.FormsModule,
|
|
2128
|
-
i5$1.ReactiveFormsModule,
|
|
2129
|
-
i3.SkyCoreAdapterModule,
|
|
2130
|
-
SkyTextEditorResourcesModule,
|
|
2131
|
-
i2.SkyI18nModule,
|
|
2132
|
-
i7.SkyIconModule,
|
|
2133
|
-
i3.SkyIdModule,
|
|
2134
|
-
i4$1.SkyInputBoxModule,
|
|
2135
|
-
i6$1.SkyColorpickerModule,
|
|
2136
|
-
i4$1.SkyCheckboxModule,
|
|
2137
|
-
i4.SkyDropdownModule,
|
|
2138
|
-
i1$1.SkyModalModule,
|
|
2139
|
-
i3$2.SkyTabsModule,
|
|
2140
|
-
i6.SkyThemeModule,
|
|
2141
|
-
i3$1.SkyToolbarModule,
|
|
2142
|
-
]] });
|
|
2143
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyTextEditorModule, decorators: [{
|
|
2144
|
-
type: i0.NgModule,
|
|
2145
|
-
args: [{
|
|
2146
|
-
imports: [
|
|
2147
|
-
i5.CommonModule,
|
|
2148
|
-
i5$1.FormsModule,
|
|
2149
|
-
i5$1.ReactiveFormsModule,
|
|
2150
|
-
i3.SkyCoreAdapterModule,
|
|
2151
|
-
SkyTextEditorResourcesModule,
|
|
2152
|
-
i2.SkyI18nModule,
|
|
2153
|
-
i7.SkyIconModule,
|
|
2154
|
-
i3.SkyIdModule,
|
|
2155
|
-
i4$1.SkyInputBoxModule,
|
|
2156
|
-
i6$1.SkyColorpickerModule,
|
|
2157
|
-
i4$1.SkyCheckboxModule,
|
|
2158
|
-
i4.SkyDropdownModule,
|
|
2159
|
-
i1$1.SkyModalModule,
|
|
2160
|
-
i3$2.SkyTabsModule,
|
|
2161
|
-
i6.SkyThemeModule,
|
|
2162
|
-
i3$1.SkyToolbarModule,
|
|
2163
|
-
],
|
|
2164
|
-
exports: [
|
|
2165
|
-
SkyTextEditorComponent,
|
|
2166
|
-
SkyTextEditorUrlModalComponent,
|
|
2167
|
-
SkyTextEditorToolbarComponent,
|
|
2168
|
-
SkyTextEditorMenubarComponent,
|
|
2169
|
-
],
|
|
2170
|
-
declarations: [
|
|
2171
|
-
SkyTextEditorComponent,
|
|
2172
|
-
SkyTextEditorUrlModalComponent,
|
|
2173
|
-
SkyTextEditorToolbarComponent,
|
|
2174
|
-
SkyTextEditorMenubarComponent,
|
|
2175
|
-
],
|
|
2176
|
-
entryComponents: [SkyTextEditorUrlModalComponent],
|
|
2177
|
-
}]
|
|
2178
|
-
}] });
|
|
2179
|
-
|
|
2180
|
-
/**
|
|
2181
|
-
* Generated bundle index. Do not edit.
|
|
2182
|
-
*/
|
|
2183
|
-
|
|
2184
|
-
exports.SkyRichTextDisplayModule = SkyRichTextDisplayModule;
|
|
2185
|
-
exports.SkyTextEditorModule = SkyTextEditorModule;
|
|
2186
|
-
exports["λ1"] = SkyRichTextDisplayComponent;
|
|
2187
|
-
exports["λ2"] = SkyTextEditorMenubarComponent;
|
|
2188
|
-
exports["λ3"] = SkyTextEditorUrlModalComponent;
|
|
2189
|
-
exports["λ4"] = SkyTextEditorToolbarComponent;
|
|
2190
|
-
exports["λ5"] = SkyTextEditorComponent;
|
|
2191
|
-
|
|
2192
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
2193
|
-
|
|
2194
|
-
}));
|
|
2195
|
-
//# sourceMappingURL=skyux-text-editor.umd.js.map
|