@dangl/angular-material-shared 2.9.0-beta0047 → 2.9.0-beta0048
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/package.json +1 -1
- package/tinymce-assets/icons/default/icons.js +9 -46
- package/tinymce-assets/icons/default/icons.min.js +1 -1
- package/tinymce-assets/models/dom/model.js +7239 -8193
- package/tinymce-assets/models/dom/model.min.js +1 -1
- package/tinymce-assets/plugins/accordion/plugin.js +879 -1174
- package/tinymce-assets/plugins/accordion/plugin.min.js +5 -1
- package/tinymce-assets/plugins/advlist/plugin.js +200 -412
- package/tinymce-assets/plugins/advlist/plugin.min.js +5 -1
- package/tinymce-assets/plugins/anchor/plugin.js +166 -189
- package/tinymce-assets/plugins/anchor/plugin.min.js +5 -1
- package/tinymce-assets/plugins/autolink/plugin.js +220 -310
- package/tinymce-assets/plugins/autolink/plugin.min.js +5 -1
- package/tinymce-assets/plugins/autoresize/plugin.js +149 -180
- package/tinymce-assets/plugins/autoresize/plugin.min.js +5 -1
- package/tinymce-assets/plugins/autosave/plugin.js +189 -208
- package/tinymce-assets/plugins/autosave/plugin.min.js +5 -1
- package/tinymce-assets/plugins/charmap/plugin.js +1566 -905
- package/tinymce-assets/plugins/charmap/plugin.min.js +5 -1
- package/tinymce-assets/plugins/code/plugin.js +61 -73
- package/tinymce-assets/plugins/code/plugin.min.js +4 -0
- package/tinymce-assets/plugins/codesample/plugin.js +2409 -3592
- package/tinymce-assets/plugins/codesample/plugin.min.js +12 -8
- package/tinymce-assets/plugins/directionality/plugin.js +304 -545
- package/tinymce-assets/plugins/directionality/plugin.min.js +5 -1
- package/tinymce-assets/plugins/emoticons/plugin.js +488 -702
- package/tinymce-assets/plugins/emoticons/plugin.min.js +5 -1
- package/tinymce-assets/plugins/fullscreen/plugin.js +1049 -1409
- package/tinymce-assets/plugins/fullscreen/plugin.min.js +5 -1
- package/tinymce-assets/plugins/help/js/i18n/keynav/ar.js +1 -4
- package/tinymce-assets/plugins/help/js/i18n/keynav/bg_BG.js +1 -4
- package/tinymce-assets/plugins/help/js/i18n/keynav/ca.js +1 -4
- package/tinymce-assets/plugins/help/js/i18n/keynav/cs.js +1 -4
- package/tinymce-assets/plugins/help/js/i18n/keynav/da.js +1 -4
- package/tinymce-assets/plugins/help/js/i18n/keynav/de.js +1 -4
- package/tinymce-assets/plugins/help/js/i18n/keynav/el.js +1 -4
- package/tinymce-assets/plugins/help/js/i18n/keynav/en.js +1 -4
- package/tinymce-assets/plugins/help/js/i18n/keynav/es.js +1 -4
- package/tinymce-assets/plugins/help/js/i18n/keynav/eu.js +1 -4
- package/tinymce-assets/plugins/help/js/i18n/keynav/fa.js +1 -4
- package/tinymce-assets/plugins/help/js/i18n/keynav/fi.js +1 -4
- package/tinymce-assets/plugins/help/js/i18n/keynav/fr_FR.js +1 -4
- package/tinymce-assets/plugins/help/js/i18n/keynav/he_IL.js +1 -4
- package/tinymce-assets/plugins/help/js/i18n/keynav/hi.js +1 -4
- package/tinymce-assets/plugins/help/js/i18n/keynav/hr.js +1 -4
- package/tinymce-assets/plugins/help/js/i18n/keynav/hu_HU.js +1 -4
- package/tinymce-assets/plugins/help/js/i18n/keynav/id.js +1 -4
- package/tinymce-assets/plugins/help/js/i18n/keynav/it.js +1 -4
- package/tinymce-assets/plugins/help/js/i18n/keynav/ja.js +1 -4
- package/tinymce-assets/plugins/help/js/i18n/keynav/kk.js +1 -4
- package/tinymce-assets/plugins/help/js/i18n/keynav/ko_KR.js +1 -4
- package/tinymce-assets/plugins/help/js/i18n/keynav/ms.js +1 -4
- package/tinymce-assets/plugins/help/js/i18n/keynav/nb_NO.js +1 -4
- package/tinymce-assets/plugins/help/js/i18n/keynav/nl.js +1 -4
- package/tinymce-assets/plugins/help/js/i18n/keynav/pl.js +1 -4
- package/tinymce-assets/plugins/help/js/i18n/keynav/pt_BR.js +1 -4
- package/tinymce-assets/plugins/help/js/i18n/keynav/pt_PT.js +1 -4
- package/tinymce-assets/plugins/help/js/i18n/keynav/ro.js +1 -4
- package/tinymce-assets/plugins/help/js/i18n/keynav/ru.js +1 -4
- package/tinymce-assets/plugins/help/js/i18n/keynav/sk.js +1 -4
- package/tinymce-assets/plugins/help/js/i18n/keynav/sl_SI.js +2 -5
- package/tinymce-assets/plugins/help/js/i18n/keynav/sv_SE.js +1 -4
- package/tinymce-assets/plugins/help/js/i18n/keynav/th_TH.js +1 -4
- package/tinymce-assets/plugins/help/js/i18n/keynav/tr.js +1 -4
- package/tinymce-assets/plugins/help/js/i18n/keynav/uk.js +1 -4
- package/tinymce-assets/plugins/help/js/i18n/keynav/vi.js +1 -4
- package/tinymce-assets/plugins/help/js/i18n/keynav/zh_CN.js +5 -8
- package/tinymce-assets/plugins/help/js/i18n/keynav/zh_TW.js +1 -4
- package/tinymce-assets/plugins/help/plugin.js +809 -739
- package/tinymce-assets/plugins/help/plugin.min.js +5 -1
- package/tinymce-assets/plugins/image/plugin.js +1291 -1475
- package/tinymce-assets/plugins/image/plugin.min.js +5 -1
- package/tinymce-assets/plugins/importcss/plugin.js +269 -328
- package/tinymce-assets/plugins/importcss/plugin.min.js +5 -1
- package/tinymce-assets/plugins/insertdatetime/plugin.js +141 -140
- package/tinymce-assets/plugins/insertdatetime/plugin.min.js +5 -1
- package/tinymce-assets/plugins/link/plugin.js +1084 -1419
- package/tinymce-assets/plugins/link/plugin.min.js +5 -1
- package/tinymce-assets/plugins/lists/plugin.js +1805 -2177
- package/tinymce-assets/plugins/lists/plugin.min.js +5 -1
- package/tinymce-assets/plugins/media/plugin.js +1047 -1305
- package/tinymce-assets/plugins/media/plugin.min.js +5 -1
- package/tinymce-assets/plugins/nonbreaking/plugin.js +88 -93
- package/tinymce-assets/plugins/nonbreaking/plugin.min.js +4 -0
- package/tinymce-assets/plugins/pagebreak/plugin.js +85 -91
- package/tinymce-assets/plugins/pagebreak/plugin.min.js +4 -0
- package/tinymce-assets/plugins/preview/plugin.js +74 -742
- package/tinymce-assets/plugins/preview/plugin.min.js +5 -1
- package/tinymce-assets/plugins/quickbars/plugin.js +375 -582
- package/tinymce-assets/plugins/quickbars/plugin.min.js +5 -1
- package/tinymce-assets/plugins/save/plugin.js +82 -100
- package/tinymce-assets/plugins/save/plugin.min.js +5 -1
- package/tinymce-assets/plugins/searchreplace/plugin.js +906 -1183
- package/tinymce-assets/plugins/searchreplace/plugin.min.js +5 -1
- package/tinymce-assets/plugins/table/plugin.js +3094 -3651
- package/tinymce-assets/plugins/table/plugin.min.js +5 -1
- package/tinymce-assets/plugins/template/index.js +7 -0
- package/tinymce-assets/plugins/template/plugin.js +567 -0
- package/tinymce-assets/plugins/template/plugin.min.js +5 -0
- package/tinymce-assets/plugins/visualblocks/plugin.js +63 -71
- package/tinymce-assets/plugins/visualblocks/plugin.min.js +5 -1
- package/tinymce-assets/plugins/visualchars/plugin.js +436 -685
- package/tinymce-assets/plugins/visualchars/plugin.min.js +5 -1
- package/tinymce-assets/plugins/wordcount/plugin.js +307 -382
- package/tinymce-assets/plugins/wordcount/plugin.min.js +5 -1
- package/tinymce-assets/skins/content/dark/content.css +4 -0
- package/tinymce-assets/skins/content/dark/content.js +6 -1
- package/tinymce-assets/skins/content/dark/content.min.css +4 -0
- package/tinymce-assets/skins/content/default/content.css +4 -0
- package/tinymce-assets/skins/content/default/content.js +6 -1
- package/tinymce-assets/skins/content/default/content.min.css +4 -0
- package/tinymce-assets/skins/content/document/content.css +4 -0
- package/tinymce-assets/skins/content/document/content.js +6 -1
- package/tinymce-assets/skins/content/document/content.min.css +4 -0
- package/tinymce-assets/skins/content/tinymce-5/content.css +4 -0
- package/tinymce-assets/skins/content/tinymce-5/content.js +6 -1
- package/tinymce-assets/skins/content/tinymce-5/content.min.css +4 -0
- package/tinymce-assets/skins/content/tinymce-5-dark/content.css +4 -0
- package/tinymce-assets/skins/content/tinymce-5-dark/content.js +6 -1
- package/tinymce-assets/skins/content/tinymce-5-dark/content.min.css +4 -0
- package/tinymce-assets/skins/content/writer/content.css +4 -0
- package/tinymce-assets/skins/content/writer/content.js +6 -1
- package/tinymce-assets/skins/content/writer/content.min.css +4 -0
- package/tinymce-assets/skins/ui/oxide/content.css +53 -148
- package/tinymce-assets/skins/ui/oxide/content.inline.css +53 -148
- package/tinymce-assets/skins/ui/oxide/content.inline.js +6 -1
- package/tinymce-assets/skins/ui/oxide/content.inline.min.css +5 -1
- package/tinymce-assets/skins/ui/oxide/content.js +6 -1
- package/tinymce-assets/skins/ui/oxide/content.min.css +5 -1
- package/tinymce-assets/skins/ui/oxide/skin.css +207 -1585
- package/tinymce-assets/skins/ui/oxide/skin.js +2 -1
- package/tinymce-assets/skins/ui/oxide/skin.min.css +1 -1
- package/tinymce-assets/skins/ui/oxide/skin.shadowdom.js +2 -1
- package/tinymce-assets/skins/ui/oxide-dark/content.css +46 -148
- package/tinymce-assets/skins/ui/oxide-dark/content.inline.css +53 -148
- package/tinymce-assets/skins/ui/oxide-dark/content.inline.js +6 -1
- package/tinymce-assets/skins/ui/oxide-dark/content.inline.min.css +5 -1
- package/tinymce-assets/skins/ui/oxide-dark/content.js +6 -1
- package/tinymce-assets/skins/ui/oxide-dark/content.min.css +5 -1
- package/tinymce-assets/skins/ui/oxide-dark/skin.css +219 -1597
- package/tinymce-assets/skins/ui/oxide-dark/skin.js +2 -1
- package/tinymce-assets/skins/ui/oxide-dark/skin.min.css +1 -1
- package/tinymce-assets/skins/ui/oxide-dark/skin.shadowdom.js +2 -1
- package/tinymce-assets/skins/ui/tinymce-5/content.css +53 -148
- package/tinymce-assets/skins/ui/tinymce-5/content.inline.css +53 -148
- package/tinymce-assets/skins/ui/tinymce-5/content.inline.js +6 -1
- package/tinymce-assets/skins/ui/tinymce-5/content.inline.min.css +5 -1
- package/tinymce-assets/skins/ui/tinymce-5/content.js +6 -1
- package/tinymce-assets/skins/ui/tinymce-5/content.min.css +5 -1
- package/tinymce-assets/skins/ui/tinymce-5/skin.css +194 -1597
- package/tinymce-assets/skins/ui/tinymce-5/skin.js +2 -1
- package/tinymce-assets/skins/ui/tinymce-5/skin.min.css +1 -1
- package/tinymce-assets/skins/ui/tinymce-5/skin.shadowdom.js +2 -1
- package/tinymce-assets/skins/ui/tinymce-5-dark/content.css +46 -148
- package/tinymce-assets/skins/ui/tinymce-5-dark/content.inline.css +53 -148
- package/tinymce-assets/skins/ui/tinymce-5-dark/content.inline.js +6 -1
- package/tinymce-assets/skins/ui/tinymce-5-dark/content.inline.min.css +5 -1
- package/tinymce-assets/skins/ui/tinymce-5-dark/content.js +6 -1
- package/tinymce-assets/skins/ui/tinymce-5-dark/content.min.css +5 -1
- package/tinymce-assets/skins/ui/tinymce-5-dark/skin.css +202 -1605
- package/tinymce-assets/skins/ui/tinymce-5-dark/skin.js +2 -1
- package/tinymce-assets/skins/ui/tinymce-5-dark/skin.min.css +1 -1
- package/tinymce-assets/skins/ui/tinymce-5-dark/skin.shadowdom.js +2 -1
- package/tinymce-assets/themes/silver/theme.js +28439 -32466
- package/tinymce-assets/themes/silver/theme.min.js +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* TinyMCE version
|
|
2
|
+
* TinyMCE version 6.8.6 (TBD)
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
5
|
(function () {
|
|
@@ -7,71 +7,33 @@
|
|
|
7
7
|
|
|
8
8
|
var global$4 = tinymce.util.Tools.resolve('tinymce.PluginManager');
|
|
9
9
|
|
|
10
|
-
/* eslint-disable @typescript-eslint/no-wrapper-object-types */
|
|
11
10
|
const hasProto = (v, constructor, predicate) => {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
return ((_a = v.constructor) === null || _a === void 0 ? void 0 : _a.name) === constructor.name;
|
|
19
|
-
}
|
|
11
|
+
var _a;
|
|
12
|
+
if (predicate(v, constructor.prototype)) {
|
|
13
|
+
return true;
|
|
14
|
+
} else {
|
|
15
|
+
return ((_a = v.constructor) === null || _a === void 0 ? void 0 : _a.name) === constructor.name;
|
|
16
|
+
}
|
|
20
17
|
};
|
|
21
|
-
const typeOf =
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
else {
|
|
33
|
-
return t;
|
|
34
|
-
}
|
|
18
|
+
const typeOf = x => {
|
|
19
|
+
const t = typeof x;
|
|
20
|
+
if (x === null) {
|
|
21
|
+
return 'null';
|
|
22
|
+
} else if (t === 'object' && Array.isArray(x)) {
|
|
23
|
+
return 'array';
|
|
24
|
+
} else if (t === 'object' && hasProto(x, String, (o, proto) => proto.isPrototypeOf(o))) {
|
|
25
|
+
return 'string';
|
|
26
|
+
} else {
|
|
27
|
+
return t;
|
|
28
|
+
}
|
|
35
29
|
};
|
|
36
|
-
const isType =
|
|
37
|
-
const isSimpleType =
|
|
30
|
+
const isType = type => value => typeOf(value) === type;
|
|
31
|
+
const isSimpleType = type => value => typeof value === type;
|
|
38
32
|
const isString = isType('string');
|
|
39
33
|
const isObject = isType('object');
|
|
40
34
|
const isArray = isType('array');
|
|
41
35
|
const isFunction = isSimpleType('function');
|
|
42
36
|
|
|
43
|
-
/* eslint-disable @typescript-eslint/unbound-method */
|
|
44
|
-
const nativeSlice = Array.prototype.slice;
|
|
45
|
-
const nativePush = Array.prototype.push;
|
|
46
|
-
const map = (xs, f) => {
|
|
47
|
-
// pre-allocating array size when it's guaranteed to be known
|
|
48
|
-
// http://jsperf.com/push-allocated-vs-dynamic/22
|
|
49
|
-
const len = xs.length;
|
|
50
|
-
const r = new Array(len);
|
|
51
|
-
for (let i = 0; i < len; i++) {
|
|
52
|
-
const x = xs[i];
|
|
53
|
-
r[i] = f(x, i);
|
|
54
|
-
}
|
|
55
|
-
return r;
|
|
56
|
-
};
|
|
57
|
-
const flatten = (xs) => {
|
|
58
|
-
// Note, this is possible because push supports multiple arguments:
|
|
59
|
-
// http://jsperf.com/concat-push/6
|
|
60
|
-
// Note that in the past, concat() would silently work (very slowly) for array-like objects.
|
|
61
|
-
// With this change it will throw an error.
|
|
62
|
-
const r = [];
|
|
63
|
-
for (let i = 0, len = xs.length; i < len; ++i) {
|
|
64
|
-
// Ensure that each value is an array itself
|
|
65
|
-
if (!isArray(xs[i])) {
|
|
66
|
-
throw new Error('Arr.flatten item ' + i + ' was not an array, input: ' + xs);
|
|
67
|
-
}
|
|
68
|
-
nativePush.apply(r, xs[i]);
|
|
69
|
-
}
|
|
70
|
-
return r;
|
|
71
|
-
};
|
|
72
|
-
const bind = (xs, f) => flatten(map(xs, f));
|
|
73
|
-
isFunction(Array.from) ? Array.from : (x) => nativeSlice.call(x);
|
|
74
|
-
|
|
75
37
|
var global$3 = tinymce.util.Tools.resolve('tinymce.dom.DOMUtils');
|
|
76
38
|
|
|
77
39
|
var global$2 = tinymce.util.Tools.resolve('tinymce.EditorManager');
|
|
@@ -80,34 +42,26 @@
|
|
|
80
42
|
|
|
81
43
|
var global = tinymce.util.Tools.resolve('tinymce.util.Tools');
|
|
82
44
|
|
|
83
|
-
const option =
|
|
84
|
-
const register =
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
});
|
|
104
|
-
registerOption('importcss_groups', {
|
|
105
|
-
processor: 'object[]'
|
|
106
|
-
});
|
|
107
|
-
registerOption('importcss_append', {
|
|
108
|
-
processor: 'boolean',
|
|
109
|
-
default: false
|
|
110
|
-
});
|
|
45
|
+
const option = name => editor => editor.options.get(name);
|
|
46
|
+
const register = editor => {
|
|
47
|
+
const registerOption = editor.options.register;
|
|
48
|
+
const filterProcessor = value => isString(value) || isFunction(value) || isObject(value);
|
|
49
|
+
registerOption('importcss_merge_classes', {
|
|
50
|
+
processor: 'boolean',
|
|
51
|
+
default: true
|
|
52
|
+
});
|
|
53
|
+
registerOption('importcss_exclusive', {
|
|
54
|
+
processor: 'boolean',
|
|
55
|
+
default: true
|
|
56
|
+
});
|
|
57
|
+
registerOption('importcss_selector_converter', { processor: 'function' });
|
|
58
|
+
registerOption('importcss_selector_filter', { processor: filterProcessor });
|
|
59
|
+
registerOption('importcss_file_filter', { processor: filterProcessor });
|
|
60
|
+
registerOption('importcss_groups', { processor: 'object[]' });
|
|
61
|
+
registerOption('importcss_append', {
|
|
62
|
+
processor: 'boolean',
|
|
63
|
+
default: false
|
|
64
|
+
});
|
|
111
65
|
};
|
|
112
66
|
const shouldMergeClasses = option('importcss_merge_classes');
|
|
113
67
|
const shouldImportExclusive = option('importcss_exclusive');
|
|
@@ -119,285 +73,272 @@
|
|
|
119
73
|
const getSkin = option('skin');
|
|
120
74
|
const getSkinUrl = option('skin_url');
|
|
121
75
|
|
|
76
|
+
const nativePush = Array.prototype.push;
|
|
77
|
+
const map = (xs, f) => {
|
|
78
|
+
const len = xs.length;
|
|
79
|
+
const r = new Array(len);
|
|
80
|
+
for (let i = 0; i < len; i++) {
|
|
81
|
+
const x = xs[i];
|
|
82
|
+
r[i] = f(x, i);
|
|
83
|
+
}
|
|
84
|
+
return r;
|
|
85
|
+
};
|
|
86
|
+
const flatten = xs => {
|
|
87
|
+
const r = [];
|
|
88
|
+
for (let i = 0, len = xs.length; i < len; ++i) {
|
|
89
|
+
if (!isArray(xs[i])) {
|
|
90
|
+
throw new Error('Arr.flatten item ' + i + ' was not an array, input: ' + xs);
|
|
91
|
+
}
|
|
92
|
+
nativePush.apply(r, xs[i]);
|
|
93
|
+
}
|
|
94
|
+
return r;
|
|
95
|
+
};
|
|
96
|
+
const bind = (xs, f) => flatten(map(xs, f));
|
|
97
|
+
|
|
122
98
|
const generate = () => {
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
const
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
};
|
|
99
|
+
const ungroupedOrder = [];
|
|
100
|
+
const groupOrder = [];
|
|
101
|
+
const groups = {};
|
|
102
|
+
const addItemToGroup = (groupTitle, itemInfo) => {
|
|
103
|
+
if (groups[groupTitle]) {
|
|
104
|
+
groups[groupTitle].push(itemInfo);
|
|
105
|
+
} else {
|
|
106
|
+
groupOrder.push(groupTitle);
|
|
107
|
+
groups[groupTitle] = [itemInfo];
|
|
108
|
+
}
|
|
109
|
+
};
|
|
110
|
+
const addItem = itemInfo => {
|
|
111
|
+
ungroupedOrder.push(itemInfo);
|
|
112
|
+
};
|
|
113
|
+
const toFormats = () => {
|
|
114
|
+
const groupItems = bind(groupOrder, g => {
|
|
115
|
+
const items = groups[g];
|
|
116
|
+
return items.length === 0 ? [] : [{
|
|
117
|
+
title: g,
|
|
118
|
+
items
|
|
119
|
+
}];
|
|
120
|
+
});
|
|
121
|
+
return groupItems.concat(ungroupedOrder);
|
|
122
|
+
};
|
|
123
|
+
return {
|
|
124
|
+
addItemToGroup,
|
|
125
|
+
addItem,
|
|
126
|
+
toFormats
|
|
127
|
+
};
|
|
153
128
|
};
|
|
154
129
|
|
|
155
130
|
const internalEditorStyle = /^\.(?:ephox|tiny-pageembed|mce)(?:[.-]+\w+)+$/;
|
|
156
|
-
const removeCacheSuffix =
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
131
|
+
const removeCacheSuffix = url => {
|
|
132
|
+
const cacheSuffix = global$1.cacheSuffix;
|
|
133
|
+
if (isString(url)) {
|
|
134
|
+
url = url.replace('?' + cacheSuffix, '').replace('&' + cacheSuffix, '');
|
|
135
|
+
}
|
|
136
|
+
return url;
|
|
162
137
|
};
|
|
163
138
|
const isSkinContentCss = (editor, href) => {
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
return false;
|
|
139
|
+
const skin = getSkin(editor);
|
|
140
|
+
if (skin) {
|
|
141
|
+
const skinUrlBase = getSkinUrl(editor);
|
|
142
|
+
const skinUrl = skinUrlBase ? editor.documentBaseURI.toAbsolute(skinUrlBase) : global$2.baseURL + '/skins/ui/' + skin;
|
|
143
|
+
const contentSkinUrlPart = global$2.baseURL + '/skins/content/';
|
|
144
|
+
return href === skinUrl + '/content' + (editor.inline ? '.inline' : '') + '.min.css' || href.indexOf(contentSkinUrlPart) !== -1;
|
|
145
|
+
}
|
|
146
|
+
return false;
|
|
173
147
|
};
|
|
174
|
-
const compileFilter =
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
return filter;
|
|
148
|
+
const compileFilter = filter => {
|
|
149
|
+
if (isString(filter)) {
|
|
150
|
+
return value => {
|
|
151
|
+
return value.indexOf(filter) !== -1;
|
|
152
|
+
};
|
|
153
|
+
} else if (filter instanceof RegExp) {
|
|
154
|
+
return value => {
|
|
155
|
+
return filter.test(value);
|
|
156
|
+
};
|
|
157
|
+
}
|
|
158
|
+
return filter;
|
|
186
159
|
};
|
|
187
|
-
const isCssImportRule =
|
|
188
|
-
const isCssPageRule =
|
|
160
|
+
const isCssImportRule = rule => rule.styleSheet;
|
|
161
|
+
const isCssPageRule = rule => rule.selectorText;
|
|
189
162
|
const getSelectors = (editor, doc, fileFilter) => {
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
}
|
|
199
|
-
// TODO: Is this still need as TypeScript/MDN says imports doesn't exist?
|
|
200
|
-
global.each(styleSheet.imports, (styleSheet) => {
|
|
201
|
-
append(styleSheet, true);
|
|
202
|
-
});
|
|
203
|
-
try {
|
|
204
|
-
rules = styleSheet.cssRules || styleSheet.rules;
|
|
205
|
-
}
|
|
206
|
-
catch (_a) {
|
|
207
|
-
// Firefox fails on rules to remote domain for example:
|
|
208
|
-
// @import url(//fonts.googleapis.com/css?family=Pathway+Gothic+One);
|
|
209
|
-
}
|
|
210
|
-
global.each(rules, (cssRule) => {
|
|
211
|
-
if (isCssImportRule(cssRule) && cssRule.styleSheet) {
|
|
212
|
-
append(cssRule.styleSheet, true);
|
|
213
|
-
}
|
|
214
|
-
else if (isCssPageRule(cssRule)) {
|
|
215
|
-
global.each(cssRule.selectorText.split(','), (selector) => {
|
|
216
|
-
selectors.push(global.trim(selector));
|
|
217
|
-
});
|
|
218
|
-
}
|
|
219
|
-
});
|
|
220
|
-
};
|
|
221
|
-
global.each(editor.contentCSS, (url) => {
|
|
222
|
-
contentCSSUrls[url] = true;
|
|
223
|
-
});
|
|
224
|
-
if (!fileFilter) {
|
|
225
|
-
fileFilter = (href, imported) => {
|
|
226
|
-
return imported || contentCSSUrls[href];
|
|
227
|
-
};
|
|
163
|
+
const selectors = [];
|
|
164
|
+
const contentCSSUrls = {};
|
|
165
|
+
const append = (styleSheet, imported) => {
|
|
166
|
+
let href = styleSheet.href;
|
|
167
|
+
let rules;
|
|
168
|
+
href = removeCacheSuffix(href);
|
|
169
|
+
if (!href || fileFilter && !fileFilter(href, imported) || isSkinContentCss(editor, href)) {
|
|
170
|
+
return;
|
|
228
171
|
}
|
|
172
|
+
global.each(styleSheet.imports, styleSheet => {
|
|
173
|
+
append(styleSheet, true);
|
|
174
|
+
});
|
|
229
175
|
try {
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
});
|
|
233
|
-
}
|
|
234
|
-
catch (_a) {
|
|
235
|
-
// Ignore
|
|
176
|
+
rules = styleSheet.cssRules || styleSheet.rules;
|
|
177
|
+
} catch (e) {
|
|
236
178
|
}
|
|
237
|
-
|
|
179
|
+
global.each(rules, cssRule => {
|
|
180
|
+
if (isCssImportRule(cssRule) && cssRule.styleSheet) {
|
|
181
|
+
append(cssRule.styleSheet, true);
|
|
182
|
+
} else if (isCssPageRule(cssRule)) {
|
|
183
|
+
global.each(cssRule.selectorText.split(','), selector => {
|
|
184
|
+
selectors.push(global.trim(selector));
|
|
185
|
+
});
|
|
186
|
+
}
|
|
187
|
+
});
|
|
188
|
+
};
|
|
189
|
+
global.each(editor.contentCSS, url => {
|
|
190
|
+
contentCSSUrls[url] = true;
|
|
191
|
+
});
|
|
192
|
+
if (!fileFilter) {
|
|
193
|
+
fileFilter = (href, imported) => {
|
|
194
|
+
return imported || contentCSSUrls[href];
|
|
195
|
+
};
|
|
196
|
+
}
|
|
197
|
+
try {
|
|
198
|
+
global.each(doc.styleSheets, styleSheet => {
|
|
199
|
+
append(styleSheet);
|
|
200
|
+
});
|
|
201
|
+
} catch (e) {
|
|
202
|
+
}
|
|
203
|
+
return selectors;
|
|
238
204
|
};
|
|
239
205
|
const defaultConvertSelectorToFormat = (editor, selectorText) => {
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
if (
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
format.block = elementName;
|
|
257
|
-
}
|
|
258
|
-
else if (editor.schema.getBlockElements()[elementName] || inlineSelectorElements[elementName.toLowerCase()]) {
|
|
259
|
-
// Block elements such as table.class and special inline elements such as a.class or img.class
|
|
260
|
-
format.selector = elementName;
|
|
261
|
-
}
|
|
262
|
-
else {
|
|
263
|
-
// Inline format strong.class1
|
|
264
|
-
format.inline = elementName;
|
|
265
|
-
}
|
|
266
|
-
}
|
|
267
|
-
else if (selector[2]) {
|
|
268
|
-
// .class - Produce inline span with classes
|
|
269
|
-
format = {
|
|
270
|
-
inline: 'span',
|
|
271
|
-
title: selectorText.substr(1),
|
|
272
|
-
classes
|
|
273
|
-
};
|
|
206
|
+
let format = {};
|
|
207
|
+
const selector = /^(?:([a-z0-9\-_]+))?(\.[a-z0-9_\-\.]+)$/i.exec(selectorText);
|
|
208
|
+
if (!selector) {
|
|
209
|
+
return;
|
|
210
|
+
}
|
|
211
|
+
const elementName = selector[1];
|
|
212
|
+
const classes = selector[2].substr(1).split('.').join(' ');
|
|
213
|
+
const inlineSelectorElements = global.makeMap('a,img');
|
|
214
|
+
if (selector[1]) {
|
|
215
|
+
format = { title: selectorText };
|
|
216
|
+
if (editor.schema.getTextBlockElements()[elementName]) {
|
|
217
|
+
format.block = elementName;
|
|
218
|
+
} else if (editor.schema.getBlockElements()[elementName] || inlineSelectorElements[elementName.toLowerCase()]) {
|
|
219
|
+
format.selector = elementName;
|
|
220
|
+
} else {
|
|
221
|
+
format.inline = elementName;
|
|
274
222
|
}
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
223
|
+
} else if (selector[2]) {
|
|
224
|
+
format = {
|
|
225
|
+
inline: 'span',
|
|
226
|
+
title: selectorText.substr(1),
|
|
227
|
+
classes
|
|
228
|
+
};
|
|
229
|
+
}
|
|
230
|
+
if (shouldMergeClasses(editor)) {
|
|
231
|
+
format.classes = classes;
|
|
232
|
+
} else {
|
|
233
|
+
format.attributes = { class: classes };
|
|
234
|
+
}
|
|
235
|
+
return format;
|
|
283
236
|
};
|
|
284
237
|
const getGroupsBySelector = (groups, selector) => {
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
238
|
+
return global.grep(groups, group => {
|
|
239
|
+
return !group.filter || group.filter(selector);
|
|
240
|
+
});
|
|
288
241
|
};
|
|
289
|
-
const compileUserDefinedGroups =
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
});
|
|
242
|
+
const compileUserDefinedGroups = groups => {
|
|
243
|
+
return global.map(groups, group => {
|
|
244
|
+
return global.extend({}, group, {
|
|
245
|
+
original: group,
|
|
246
|
+
selectors: {},
|
|
247
|
+
filter: compileFilter(group.filter)
|
|
296
248
|
});
|
|
249
|
+
});
|
|
297
250
|
};
|
|
298
251
|
const isExclusiveMode = (editor, group) => {
|
|
299
|
-
|
|
300
|
-
return group === null || shouldImportExclusive(editor);
|
|
252
|
+
return group === null || shouldImportExclusive(editor);
|
|
301
253
|
};
|
|
302
254
|
const isUniqueSelector = (editor, selector, group, globallyUniqueSelectors) => {
|
|
303
|
-
|
|
255
|
+
return !(isExclusiveMode(editor, group) ? selector in globallyUniqueSelectors : selector in group.selectors);
|
|
304
256
|
};
|
|
305
257
|
const markUniqueSelector = (editor, selector, group, globallyUniqueSelectors) => {
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
}
|
|
258
|
+
if (isExclusiveMode(editor, group)) {
|
|
259
|
+
globallyUniqueSelectors[selector] = true;
|
|
260
|
+
} else {
|
|
261
|
+
group.selectors[selector] = true;
|
|
262
|
+
}
|
|
312
263
|
};
|
|
313
264
|
const convertSelectorToFormat = (editor, plugin, selector, group) => {
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
}
|
|
327
|
-
return selectorConverter.call(plugin, selector, group);
|
|
265
|
+
let selectorConverter;
|
|
266
|
+
const converter = getSelectorConverter(editor);
|
|
267
|
+
if (group && group.selector_converter) {
|
|
268
|
+
selectorConverter = group.selector_converter;
|
|
269
|
+
} else if (converter) {
|
|
270
|
+
selectorConverter = converter;
|
|
271
|
+
} else {
|
|
272
|
+
selectorConverter = () => {
|
|
273
|
+
return defaultConvertSelectorToFormat(editor, selector);
|
|
274
|
+
};
|
|
275
|
+
}
|
|
276
|
+
return selectorConverter.call(plugin, selector, group);
|
|
328
277
|
};
|
|
329
|
-
const setup =
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
model.addItem(menuItem);
|
|
366
|
-
}
|
|
367
|
-
}
|
|
368
|
-
}
|
|
278
|
+
const setup = editor => {
|
|
279
|
+
editor.on('init', () => {
|
|
280
|
+
const model = generate();
|
|
281
|
+
const globallyUniqueSelectors = {};
|
|
282
|
+
const selectorFilter = compileFilter(getSelectorFilter(editor));
|
|
283
|
+
const groups = compileUserDefinedGroups(getCssGroups(editor));
|
|
284
|
+
const processSelector = (selector, group) => {
|
|
285
|
+
if (isUniqueSelector(editor, selector, group, globallyUniqueSelectors)) {
|
|
286
|
+
markUniqueSelector(editor, selector, group, globallyUniqueSelectors);
|
|
287
|
+
const format = convertSelectorToFormat(editor, editor.plugins.importcss, selector, group);
|
|
288
|
+
if (format) {
|
|
289
|
+
const formatName = format.name || global$3.DOM.uniqueId();
|
|
290
|
+
editor.formatter.register(formatName, format);
|
|
291
|
+
return {
|
|
292
|
+
title: format.title,
|
|
293
|
+
format: formatName
|
|
294
|
+
};
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
return null;
|
|
298
|
+
};
|
|
299
|
+
global.each(getSelectors(editor, editor.getDoc(), compileFilter(getFileFilter(editor))), selector => {
|
|
300
|
+
if (!internalEditorStyle.test(selector)) {
|
|
301
|
+
if (!selectorFilter || selectorFilter(selector)) {
|
|
302
|
+
const selectorGroups = getGroupsBySelector(groups, selector);
|
|
303
|
+
if (selectorGroups.length > 0) {
|
|
304
|
+
global.each(selectorGroups, group => {
|
|
305
|
+
const menuItem = processSelector(selector, group);
|
|
306
|
+
if (menuItem) {
|
|
307
|
+
model.addItemToGroup(group.title, menuItem);
|
|
308
|
+
}
|
|
309
|
+
});
|
|
310
|
+
} else {
|
|
311
|
+
const menuItem = processSelector(selector, null);
|
|
312
|
+
if (menuItem) {
|
|
313
|
+
model.addItem(menuItem);
|
|
369
314
|
}
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
});
|
|
319
|
+
const items = model.toFormats();
|
|
320
|
+
editor.dispatch('addStyleModifications', {
|
|
321
|
+
items,
|
|
322
|
+
replace: !shouldAppend(editor)
|
|
376
323
|
});
|
|
324
|
+
});
|
|
377
325
|
};
|
|
378
326
|
|
|
379
|
-
const get =
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
convertSelectorToFormat
|
|
385
|
-
};
|
|
327
|
+
const get = editor => {
|
|
328
|
+
const convertSelectorToFormat = selectorText => {
|
|
329
|
+
return defaultConvertSelectorToFormat(editor, selectorText);
|
|
330
|
+
};
|
|
331
|
+
return { convertSelectorToFormat };
|
|
386
332
|
};
|
|
387
333
|
|
|
388
334
|
var Plugin = () => {
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
335
|
+
global$4.add('importcss', editor => {
|
|
336
|
+
register(editor);
|
|
337
|
+
setup(editor);
|
|
338
|
+
return get(editor);
|
|
339
|
+
});
|
|
394
340
|
};
|
|
395
341
|
|
|
396
342
|
Plugin();
|
|
397
|
-
/** *****
|
|
398
|
-
* DO NOT EXPORT ANYTHING
|
|
399
|
-
*
|
|
400
|
-
* IF YOU DO ROLLUP WILL LEAVE A GLOBAL ON THE PAGE
|
|
401
|
-
*******/
|
|
402
343
|
|
|
403
344
|
})();
|