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