@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.
Files changed (175) hide show
  1. package/fesm2022/dangl-angular-material-shared-tiny-mce.mjs +29 -35
  2. package/fesm2022/dangl-angular-material-shared-tiny-mce.mjs.map +1 -1
  3. package/fesm2022/dangl-angular-material-shared.mjs +36 -51
  4. package/fesm2022/dangl-angular-material-shared.mjs.map +1 -1
  5. package/package.json +11 -10
  6. package/styles/material-theme.scss +1 -1
  7. package/styles/material-variables.scss +5 -5
  8. package/tinymce-assets/icons/default/icons.js +46 -9
  9. package/tinymce-assets/icons/default/icons.min.js +1 -1
  10. package/tinymce-assets/models/dom/model.js +8198 -7244
  11. package/tinymce-assets/models/dom/model.min.js +1 -4
  12. package/tinymce-assets/plugins/accordion/plugin.js +1174 -879
  13. package/tinymce-assets/plugins/accordion/plugin.min.js +1 -4
  14. package/tinymce-assets/plugins/advlist/plugin.js +412 -200
  15. package/tinymce-assets/plugins/advlist/plugin.min.js +1 -4
  16. package/tinymce-assets/plugins/anchor/plugin.js +189 -166
  17. package/tinymce-assets/plugins/anchor/plugin.min.js +1 -4
  18. package/tinymce-assets/plugins/autolink/plugin.js +310 -220
  19. package/tinymce-assets/plugins/autolink/plugin.min.js +1 -4
  20. package/tinymce-assets/plugins/autoresize/plugin.js +180 -149
  21. package/tinymce-assets/plugins/autoresize/plugin.min.js +1 -4
  22. package/tinymce-assets/plugins/autosave/plugin.js +208 -189
  23. package/tinymce-assets/plugins/autosave/plugin.min.js +1 -4
  24. package/tinymce-assets/plugins/charmap/plugin.js +905 -1566
  25. package/tinymce-assets/plugins/charmap/plugin.min.js +1 -4
  26. package/tinymce-assets/plugins/code/plugin.js +73 -61
  27. package/tinymce-assets/plugins/code/plugin.min.js +0 -3
  28. package/tinymce-assets/plugins/codesample/plugin.js +3593 -2402
  29. package/tinymce-assets/plugins/codesample/plugin.min.js +8 -3
  30. package/tinymce-assets/plugins/directionality/plugin.js +545 -304
  31. package/tinymce-assets/plugins/directionality/plugin.min.js +1 -4
  32. package/tinymce-assets/plugins/emoticons/js/emojiimages.min.js +0 -2
  33. package/tinymce-assets/plugins/emoticons/js/emojis.min.js +0 -1
  34. package/tinymce-assets/plugins/emoticons/plugin.js +702 -488
  35. package/tinymce-assets/plugins/emoticons/plugin.min.js +1 -4
  36. package/tinymce-assets/plugins/fullscreen/plugin.js +1409 -1049
  37. package/tinymce-assets/plugins/fullscreen/plugin.min.js +1 -4
  38. package/tinymce-assets/plugins/help/js/i18n/keynav/ar.js +4 -1
  39. package/tinymce-assets/plugins/help/js/i18n/keynav/bg_BG.js +4 -1
  40. package/tinymce-assets/plugins/help/js/i18n/keynav/ca.js +4 -1
  41. package/tinymce-assets/plugins/help/js/i18n/keynav/cs.js +4 -1
  42. package/tinymce-assets/plugins/help/js/i18n/keynav/da.js +4 -1
  43. package/tinymce-assets/plugins/help/js/i18n/keynav/de.js +4 -1
  44. package/tinymce-assets/plugins/help/js/i18n/keynav/el.js +4 -1
  45. package/tinymce-assets/plugins/help/js/i18n/keynav/en.js +4 -1
  46. package/tinymce-assets/plugins/help/js/i18n/keynav/es.js +4 -1
  47. package/tinymce-assets/plugins/help/js/i18n/keynav/eu.js +4 -1
  48. package/tinymce-assets/plugins/help/js/i18n/keynav/fa.js +4 -1
  49. package/tinymce-assets/plugins/help/js/i18n/keynav/fi.js +4 -1
  50. package/tinymce-assets/plugins/help/js/i18n/keynav/fr_FR.js +4 -1
  51. package/tinymce-assets/plugins/help/js/i18n/keynav/he_IL.js +4 -1
  52. package/tinymce-assets/plugins/help/js/i18n/keynav/hi.js +4 -1
  53. package/tinymce-assets/plugins/help/js/i18n/keynav/hr.js +4 -1
  54. package/tinymce-assets/plugins/help/js/i18n/keynav/hu_HU.js +4 -1
  55. package/tinymce-assets/plugins/help/js/i18n/keynav/id.js +4 -1
  56. package/tinymce-assets/plugins/help/js/i18n/keynav/it.js +4 -1
  57. package/tinymce-assets/plugins/help/js/i18n/keynav/ja.js +4 -1
  58. package/tinymce-assets/plugins/help/js/i18n/keynav/kk.js +4 -1
  59. package/tinymce-assets/plugins/help/js/i18n/keynav/ko_KR.js +4 -1
  60. package/tinymce-assets/plugins/help/js/i18n/keynav/ms.js +4 -1
  61. package/tinymce-assets/plugins/help/js/i18n/keynav/nb_NO.js +4 -1
  62. package/tinymce-assets/plugins/help/js/i18n/keynav/nl.js +4 -1
  63. package/tinymce-assets/plugins/help/js/i18n/keynav/pl.js +4 -1
  64. package/tinymce-assets/plugins/help/js/i18n/keynav/pt_BR.js +4 -1
  65. package/tinymce-assets/plugins/help/js/i18n/keynav/pt_PT.js +4 -1
  66. package/tinymce-assets/plugins/help/js/i18n/keynav/ro.js +4 -1
  67. package/tinymce-assets/plugins/help/js/i18n/keynav/ru.js +4 -1
  68. package/tinymce-assets/plugins/help/js/i18n/keynav/sk.js +4 -1
  69. package/tinymce-assets/plugins/help/js/i18n/keynav/sl_SI.js +5 -2
  70. package/tinymce-assets/plugins/help/js/i18n/keynav/sv_SE.js +4 -1
  71. package/tinymce-assets/plugins/help/js/i18n/keynav/th_TH.js +4 -1
  72. package/tinymce-assets/plugins/help/js/i18n/keynav/tr.js +4 -1
  73. package/tinymce-assets/plugins/help/js/i18n/keynav/uk.js +4 -1
  74. package/tinymce-assets/plugins/help/js/i18n/keynav/vi.js +4 -1
  75. package/tinymce-assets/plugins/help/js/i18n/keynav/zh_CN.js +8 -5
  76. package/tinymce-assets/plugins/help/js/i18n/keynav/zh_TW.js +4 -1
  77. package/tinymce-assets/plugins/help/plugin.js +739 -809
  78. package/tinymce-assets/plugins/help/plugin.min.js +1 -4
  79. package/tinymce-assets/plugins/image/plugin.js +1475 -1291
  80. package/tinymce-assets/plugins/image/plugin.min.js +1 -4
  81. package/tinymce-assets/plugins/importcss/plugin.js +328 -269
  82. package/tinymce-assets/plugins/importcss/plugin.min.js +1 -4
  83. package/tinymce-assets/plugins/insertdatetime/plugin.js +140 -141
  84. package/tinymce-assets/plugins/insertdatetime/plugin.min.js +1 -4
  85. package/tinymce-assets/plugins/link/plugin.js +1419 -1084
  86. package/tinymce-assets/plugins/link/plugin.min.js +1 -4
  87. package/tinymce-assets/plugins/lists/plugin.js +2177 -1805
  88. package/tinymce-assets/plugins/lists/plugin.min.js +1 -4
  89. package/tinymce-assets/plugins/media/plugin.js +1305 -1047
  90. package/tinymce-assets/plugins/media/plugin.min.js +1 -4
  91. package/tinymce-assets/plugins/nonbreaking/plugin.js +93 -88
  92. package/tinymce-assets/plugins/nonbreaking/plugin.min.js +0 -3
  93. package/tinymce-assets/plugins/pagebreak/plugin.js +91 -85
  94. package/tinymce-assets/plugins/pagebreak/plugin.min.js +0 -3
  95. package/tinymce-assets/plugins/preview/plugin.js +742 -74
  96. package/tinymce-assets/plugins/preview/plugin.min.js +1 -4
  97. package/tinymce-assets/plugins/quickbars/plugin.js +582 -375
  98. package/tinymce-assets/plugins/quickbars/plugin.min.js +1 -4
  99. package/tinymce-assets/plugins/save/plugin.js +100 -82
  100. package/tinymce-assets/plugins/save/plugin.min.js +1 -4
  101. package/tinymce-assets/plugins/searchreplace/plugin.js +1183 -906
  102. package/tinymce-assets/plugins/searchreplace/plugin.min.js +1 -4
  103. package/tinymce-assets/plugins/table/plugin.js +3651 -3094
  104. package/tinymce-assets/plugins/table/plugin.min.js +1 -4
  105. package/tinymce-assets/plugins/visualblocks/plugin.js +71 -63
  106. package/tinymce-assets/plugins/visualblocks/plugin.min.js +1 -4
  107. package/tinymce-assets/plugins/visualchars/plugin.js +685 -436
  108. package/tinymce-assets/plugins/visualchars/plugin.min.js +1 -4
  109. package/tinymce-assets/plugins/wordcount/plugin.js +382 -307
  110. package/tinymce-assets/plugins/wordcount/plugin.min.js +1 -4
  111. package/tinymce-assets/skins/content/dark/content.css +9 -0
  112. package/tinymce-assets/skins/content/dark/content.js +10 -2
  113. package/tinymce-assets/skins/content/dark/content.min.css +9 -0
  114. package/tinymce-assets/skins/content/default/content.css +9 -0
  115. package/tinymce-assets/skins/content/default/content.js +10 -2
  116. package/tinymce-assets/skins/content/default/content.min.css +9 -0
  117. package/tinymce-assets/skins/content/document/content.css +9 -0
  118. package/tinymce-assets/skins/content/document/content.js +10 -2
  119. package/tinymce-assets/skins/content/document/content.min.css +9 -0
  120. package/tinymce-assets/skins/content/tinymce-5/content.css +9 -0
  121. package/tinymce-assets/skins/content/tinymce-5/content.js +10 -2
  122. package/tinymce-assets/skins/content/tinymce-5/content.min.css +9 -0
  123. package/tinymce-assets/skins/content/tinymce-5-dark/content.css +9 -0
  124. package/tinymce-assets/skins/content/tinymce-5-dark/content.js +10 -2
  125. package/tinymce-assets/skins/content/tinymce-5-dark/content.min.css +9 -0
  126. package/tinymce-assets/skins/content/writer/content.css +9 -0
  127. package/tinymce-assets/skins/content/writer/content.js +10 -2
  128. package/tinymce-assets/skins/content/writer/content.min.css +9 -0
  129. package/tinymce-assets/skins/ui/oxide/content.css +157 -49
  130. package/tinymce-assets/skins/ui/oxide/content.inline.css +157 -49
  131. package/tinymce-assets/skins/ui/oxide/content.inline.js +10 -2
  132. package/tinymce-assets/skins/ui/oxide/content.inline.min.css +10 -1
  133. package/tinymce-assets/skins/ui/oxide/content.js +10 -2
  134. package/tinymce-assets/skins/ui/oxide/content.min.css +10 -1
  135. package/tinymce-assets/skins/ui/oxide/skin.css +1592 -214
  136. package/tinymce-assets/skins/ui/oxide/skin.js +1 -2
  137. package/tinymce-assets/skins/ui/oxide/skin.min.css +1 -1
  138. package/tinymce-assets/skins/ui/oxide/skin.shadowdom.js +1 -2
  139. package/tinymce-assets/skins/ui/oxide-dark/content.css +157 -42
  140. package/tinymce-assets/skins/ui/oxide-dark/content.inline.css +157 -49
  141. package/tinymce-assets/skins/ui/oxide-dark/content.inline.js +10 -2
  142. package/tinymce-assets/skins/ui/oxide-dark/content.inline.min.css +10 -1
  143. package/tinymce-assets/skins/ui/oxide-dark/content.js +10 -2
  144. package/tinymce-assets/skins/ui/oxide-dark/content.min.css +10 -1
  145. package/tinymce-assets/skins/ui/oxide-dark/skin.css +1595 -217
  146. package/tinymce-assets/skins/ui/oxide-dark/skin.js +1 -2
  147. package/tinymce-assets/skins/ui/oxide-dark/skin.min.css +1 -1
  148. package/tinymce-assets/skins/ui/oxide-dark/skin.shadowdom.js +1 -2
  149. package/tinymce-assets/skins/ui/tinymce-5/content.css +157 -49
  150. package/tinymce-assets/skins/ui/tinymce-5/content.inline.css +157 -49
  151. package/tinymce-assets/skins/ui/tinymce-5/content.inline.js +10 -2
  152. package/tinymce-assets/skins/ui/tinymce-5/content.inline.min.css +10 -1
  153. package/tinymce-assets/skins/ui/tinymce-5/content.js +10 -2
  154. package/tinymce-assets/skins/ui/tinymce-5/content.min.css +10 -1
  155. package/tinymce-assets/skins/ui/tinymce-5/skin.css +1606 -203
  156. package/tinymce-assets/skins/ui/tinymce-5/skin.js +1 -2
  157. package/tinymce-assets/skins/ui/tinymce-5/skin.min.css +1 -1
  158. package/tinymce-assets/skins/ui/tinymce-5/skin.shadowdom.js +1 -2
  159. package/tinymce-assets/skins/ui/tinymce-5-dark/content.css +157 -42
  160. package/tinymce-assets/skins/ui/tinymce-5-dark/content.inline.css +157 -49
  161. package/tinymce-assets/skins/ui/tinymce-5-dark/content.inline.js +10 -2
  162. package/tinymce-assets/skins/ui/tinymce-5-dark/content.inline.min.css +10 -1
  163. package/tinymce-assets/skins/ui/tinymce-5-dark/content.js +10 -2
  164. package/tinymce-assets/skins/ui/tinymce-5-dark/content.min.css +10 -1
  165. package/tinymce-assets/skins/ui/tinymce-5-dark/skin.css +1607 -204
  166. package/tinymce-assets/skins/ui/tinymce-5-dark/skin.js +1 -2
  167. package/tinymce-assets/skins/ui/tinymce-5-dark/skin.min.css +1 -1
  168. package/tinymce-assets/skins/ui/tinymce-5-dark/skin.shadowdom.js +1 -2
  169. package/tinymce-assets/themes/silver/theme.js +32786 -28738
  170. package/tinymce-assets/themes/silver/theme.min.js +1 -4
  171. package/types/dangl-angular-material-shared-tiny-mce.d.ts +12 -13
  172. package/types/dangl-angular-material-shared.d.ts +26 -26
  173. package/tinymce-assets/plugins/template/index.js +0 -7
  174. package/tinymce-assets/plugins/template/plugin.js +0 -567
  175. package/tinymce-assets/plugins/template/plugin.min.js +0 -4
@@ -1,5 +1,5 @@
1
1
  /**
2
- * TinyMCE version 6.8.3 (2024-02-08)
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
- 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
- }
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
- 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
- }
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
- 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
- });
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
- 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
- };
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
- const cacheSuffix = global$1.cacheSuffix;
133
- if (isString(url)) {
134
- url = url.replace('?' + cacheSuffix, '').replace('&' + cacheSuffix, '');
135
- }
136
- return url;
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
- 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;
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 isCssImportRule = rule => rule.styleSheet;
161
- const isCssPageRule = rule => rule.selectorText;
162
- const getSelectors = (editor, doc, fileFilter) => {
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;
174
+ const compileFilter = (filter) => {
175
+ if (isString(filter)) {
176
+ return (value) => {
177
+ return value.indexOf(filter) !== -1;
178
+ };
171
179
  }
172
- global.each(styleSheet.imports, styleSheet => {
173
- append(styleSheet, true);
174
- });
175
- try {
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
- 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
+ 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
- try {
198
- global.each(doc.styleSheets, styleSheet => {
199
- append(styleSheet);
221
+ global.each(editor.contentCSS, (url) => {
222
+ contentCSSUrls[url] = true;
200
223
  });
201
- } catch (e) {
202
- }
203
- return selectors;
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
- 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;
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
- } 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;
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
- return global.grep(groups, group => {
239
- return !group.filter || group.filter(selector);
240
- });
285
+ return global.grep(groups, (group) => {
286
+ return !group.filter || group.filter(selector);
287
+ });
241
288
  };
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)
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
- return group === null || shouldImportExclusive(editor);
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
- return !(isExclusiveMode(editor, group) ? selector in globallyUniqueSelectors : selector in group.selectors);
303
+ return !(isExclusiveMode(editor, group) ? selector in globallyUniqueSelectors : selector in group.selectors);
256
304
  };
257
305
  const markUniqueSelector = (editor, selector, group, globallyUniqueSelectors) => {
258
- if (isExclusiveMode(editor, group)) {
259
- globallyUniqueSelectors[selector] = true;
260
- } else {
261
- group.selectors[selector] = true;
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
- 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);
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
- 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);
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
- const items = model.toFormats();
320
- editor.dispatch('addStyleModifications', {
321
- items,
322
- replace: !shouldAppend(editor)
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
- const convertSelectorToFormat = selectorText => {
329
- return defaultConvertSelectorToFormat(editor, selectorText);
330
- };
331
- return { convertSelectorToFormat };
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
- global$4.add('importcss', editor => {
336
- register(editor);
337
- setup(editor);
338
- return get(editor);
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
  })();