@dangl/angular-material-shared 2.9.0-beta0040 → 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.
Files changed (165) hide show
  1. package/package.json +1 -1
  2. package/tinymce-assets/icons/default/icons.js +9 -46
  3. package/tinymce-assets/icons/default/icons.min.js +1 -1
  4. package/tinymce-assets/models/dom/model.js +7239 -8193
  5. package/tinymce-assets/models/dom/model.min.js +1 -1
  6. package/tinymce-assets/plugins/accordion/plugin.js +879 -1174
  7. package/tinymce-assets/plugins/accordion/plugin.min.js +5 -1
  8. package/tinymce-assets/plugins/advlist/plugin.js +200 -412
  9. package/tinymce-assets/plugins/advlist/plugin.min.js +5 -1
  10. package/tinymce-assets/plugins/anchor/plugin.js +166 -189
  11. package/tinymce-assets/plugins/anchor/plugin.min.js +5 -1
  12. package/tinymce-assets/plugins/autolink/plugin.js +220 -310
  13. package/tinymce-assets/plugins/autolink/plugin.min.js +5 -1
  14. package/tinymce-assets/plugins/autoresize/plugin.js +149 -180
  15. package/tinymce-assets/plugins/autoresize/plugin.min.js +5 -1
  16. package/tinymce-assets/plugins/autosave/plugin.js +189 -208
  17. package/tinymce-assets/plugins/autosave/plugin.min.js +5 -1
  18. package/tinymce-assets/plugins/charmap/plugin.js +1566 -905
  19. package/tinymce-assets/plugins/charmap/plugin.min.js +5 -1
  20. package/tinymce-assets/plugins/code/plugin.js +61 -73
  21. package/tinymce-assets/plugins/code/plugin.min.js +4 -0
  22. package/tinymce-assets/plugins/codesample/plugin.js +2409 -3592
  23. package/tinymce-assets/plugins/codesample/plugin.min.js +12 -8
  24. package/tinymce-assets/plugins/directionality/plugin.js +304 -545
  25. package/tinymce-assets/plugins/directionality/plugin.min.js +5 -1
  26. package/tinymce-assets/plugins/emoticons/plugin.js +488 -702
  27. package/tinymce-assets/plugins/emoticons/plugin.min.js +5 -1
  28. package/tinymce-assets/plugins/fullscreen/plugin.js +1049 -1409
  29. package/tinymce-assets/plugins/fullscreen/plugin.min.js +5 -1
  30. package/tinymce-assets/plugins/help/js/i18n/keynav/ar.js +1 -4
  31. package/tinymce-assets/plugins/help/js/i18n/keynav/bg_BG.js +1 -4
  32. package/tinymce-assets/plugins/help/js/i18n/keynav/ca.js +1 -4
  33. package/tinymce-assets/plugins/help/js/i18n/keynav/cs.js +1 -4
  34. package/tinymce-assets/plugins/help/js/i18n/keynav/da.js +1 -4
  35. package/tinymce-assets/plugins/help/js/i18n/keynav/de.js +1 -4
  36. package/tinymce-assets/plugins/help/js/i18n/keynav/el.js +1 -4
  37. package/tinymce-assets/plugins/help/js/i18n/keynav/en.js +1 -4
  38. package/tinymce-assets/plugins/help/js/i18n/keynav/es.js +1 -4
  39. package/tinymce-assets/plugins/help/js/i18n/keynav/eu.js +1 -4
  40. package/tinymce-assets/plugins/help/js/i18n/keynav/fa.js +1 -4
  41. package/tinymce-assets/plugins/help/js/i18n/keynav/fi.js +1 -4
  42. package/tinymce-assets/plugins/help/js/i18n/keynav/fr_FR.js +1 -4
  43. package/tinymce-assets/plugins/help/js/i18n/keynav/he_IL.js +1 -4
  44. package/tinymce-assets/plugins/help/js/i18n/keynav/hi.js +1 -4
  45. package/tinymce-assets/plugins/help/js/i18n/keynav/hr.js +1 -4
  46. package/tinymce-assets/plugins/help/js/i18n/keynav/hu_HU.js +1 -4
  47. package/tinymce-assets/plugins/help/js/i18n/keynav/id.js +1 -4
  48. package/tinymce-assets/plugins/help/js/i18n/keynav/it.js +1 -4
  49. package/tinymce-assets/plugins/help/js/i18n/keynav/ja.js +1 -4
  50. package/tinymce-assets/plugins/help/js/i18n/keynav/kk.js +1 -4
  51. package/tinymce-assets/plugins/help/js/i18n/keynav/ko_KR.js +1 -4
  52. package/tinymce-assets/plugins/help/js/i18n/keynav/ms.js +1 -4
  53. package/tinymce-assets/plugins/help/js/i18n/keynav/nb_NO.js +1 -4
  54. package/tinymce-assets/plugins/help/js/i18n/keynav/nl.js +1 -4
  55. package/tinymce-assets/plugins/help/js/i18n/keynav/pl.js +1 -4
  56. package/tinymce-assets/plugins/help/js/i18n/keynav/pt_BR.js +1 -4
  57. package/tinymce-assets/plugins/help/js/i18n/keynav/pt_PT.js +1 -4
  58. package/tinymce-assets/plugins/help/js/i18n/keynav/ro.js +1 -4
  59. package/tinymce-assets/plugins/help/js/i18n/keynav/ru.js +1 -4
  60. package/tinymce-assets/plugins/help/js/i18n/keynav/sk.js +1 -4
  61. package/tinymce-assets/plugins/help/js/i18n/keynav/sl_SI.js +2 -5
  62. package/tinymce-assets/plugins/help/js/i18n/keynav/sv_SE.js +1 -4
  63. package/tinymce-assets/plugins/help/js/i18n/keynav/th_TH.js +1 -4
  64. package/tinymce-assets/plugins/help/js/i18n/keynav/tr.js +1 -4
  65. package/tinymce-assets/plugins/help/js/i18n/keynav/uk.js +1 -4
  66. package/tinymce-assets/plugins/help/js/i18n/keynav/vi.js +1 -4
  67. package/tinymce-assets/plugins/help/js/i18n/keynav/zh_CN.js +5 -8
  68. package/tinymce-assets/plugins/help/js/i18n/keynav/zh_TW.js +1 -4
  69. package/tinymce-assets/plugins/help/plugin.js +809 -739
  70. package/tinymce-assets/plugins/help/plugin.min.js +5 -1
  71. package/tinymce-assets/plugins/image/plugin.js +1291 -1475
  72. package/tinymce-assets/plugins/image/plugin.min.js +5 -1
  73. package/tinymce-assets/plugins/importcss/plugin.js +269 -328
  74. package/tinymce-assets/plugins/importcss/plugin.min.js +5 -1
  75. package/tinymce-assets/plugins/insertdatetime/plugin.js +141 -140
  76. package/tinymce-assets/plugins/insertdatetime/plugin.min.js +5 -1
  77. package/tinymce-assets/plugins/link/plugin.js +1084 -1419
  78. package/tinymce-assets/plugins/link/plugin.min.js +5 -1
  79. package/tinymce-assets/plugins/lists/plugin.js +1805 -2177
  80. package/tinymce-assets/plugins/lists/plugin.min.js +5 -1
  81. package/tinymce-assets/plugins/media/plugin.js +1047 -1305
  82. package/tinymce-assets/plugins/media/plugin.min.js +5 -1
  83. package/tinymce-assets/plugins/nonbreaking/plugin.js +88 -93
  84. package/tinymce-assets/plugins/nonbreaking/plugin.min.js +4 -0
  85. package/tinymce-assets/plugins/pagebreak/plugin.js +85 -91
  86. package/tinymce-assets/plugins/pagebreak/plugin.min.js +4 -0
  87. package/tinymce-assets/plugins/preview/plugin.js +74 -742
  88. package/tinymce-assets/plugins/preview/plugin.min.js +5 -1
  89. package/tinymce-assets/plugins/quickbars/plugin.js +375 -582
  90. package/tinymce-assets/plugins/quickbars/plugin.min.js +5 -1
  91. package/tinymce-assets/plugins/save/plugin.js +82 -100
  92. package/tinymce-assets/plugins/save/plugin.min.js +5 -1
  93. package/tinymce-assets/plugins/searchreplace/plugin.js +906 -1183
  94. package/tinymce-assets/plugins/searchreplace/plugin.min.js +5 -1
  95. package/tinymce-assets/plugins/table/plugin.js +3094 -3651
  96. package/tinymce-assets/plugins/table/plugin.min.js +5 -1
  97. package/tinymce-assets/plugins/template/index.js +7 -0
  98. package/tinymce-assets/plugins/template/plugin.js +567 -0
  99. package/tinymce-assets/plugins/template/plugin.min.js +5 -0
  100. package/tinymce-assets/plugins/visualblocks/plugin.js +63 -71
  101. package/tinymce-assets/plugins/visualblocks/plugin.min.js +5 -1
  102. package/tinymce-assets/plugins/visualchars/plugin.js +436 -685
  103. package/tinymce-assets/plugins/visualchars/plugin.min.js +5 -1
  104. package/tinymce-assets/plugins/wordcount/plugin.js +307 -382
  105. package/tinymce-assets/plugins/wordcount/plugin.min.js +5 -1
  106. package/tinymce-assets/skins/content/dark/content.css +4 -0
  107. package/tinymce-assets/skins/content/dark/content.js +6 -1
  108. package/tinymce-assets/skins/content/dark/content.min.css +4 -0
  109. package/tinymce-assets/skins/content/default/content.css +4 -0
  110. package/tinymce-assets/skins/content/default/content.js +6 -1
  111. package/tinymce-assets/skins/content/default/content.min.css +4 -0
  112. package/tinymce-assets/skins/content/document/content.css +4 -0
  113. package/tinymce-assets/skins/content/document/content.js +6 -1
  114. package/tinymce-assets/skins/content/document/content.min.css +4 -0
  115. package/tinymce-assets/skins/content/tinymce-5/content.css +4 -0
  116. package/tinymce-assets/skins/content/tinymce-5/content.js +6 -1
  117. package/tinymce-assets/skins/content/tinymce-5/content.min.css +4 -0
  118. package/tinymce-assets/skins/content/tinymce-5-dark/content.css +4 -0
  119. package/tinymce-assets/skins/content/tinymce-5-dark/content.js +6 -1
  120. package/tinymce-assets/skins/content/tinymce-5-dark/content.min.css +4 -0
  121. package/tinymce-assets/skins/content/writer/content.css +4 -0
  122. package/tinymce-assets/skins/content/writer/content.js +6 -1
  123. package/tinymce-assets/skins/content/writer/content.min.css +4 -0
  124. package/tinymce-assets/skins/ui/oxide/content.css +53 -148
  125. package/tinymce-assets/skins/ui/oxide/content.inline.css +53 -148
  126. package/tinymce-assets/skins/ui/oxide/content.inline.js +6 -1
  127. package/tinymce-assets/skins/ui/oxide/content.inline.min.css +5 -1
  128. package/tinymce-assets/skins/ui/oxide/content.js +6 -1
  129. package/tinymce-assets/skins/ui/oxide/content.min.css +5 -1
  130. package/tinymce-assets/skins/ui/oxide/skin.css +207 -1585
  131. package/tinymce-assets/skins/ui/oxide/skin.js +2 -1
  132. package/tinymce-assets/skins/ui/oxide/skin.min.css +1 -1
  133. package/tinymce-assets/skins/ui/oxide/skin.shadowdom.js +2 -1
  134. package/tinymce-assets/skins/ui/oxide-dark/content.css +46 -148
  135. package/tinymce-assets/skins/ui/oxide-dark/content.inline.css +53 -148
  136. package/tinymce-assets/skins/ui/oxide-dark/content.inline.js +6 -1
  137. package/tinymce-assets/skins/ui/oxide-dark/content.inline.min.css +5 -1
  138. package/tinymce-assets/skins/ui/oxide-dark/content.js +6 -1
  139. package/tinymce-assets/skins/ui/oxide-dark/content.min.css +5 -1
  140. package/tinymce-assets/skins/ui/oxide-dark/skin.css +219 -1597
  141. package/tinymce-assets/skins/ui/oxide-dark/skin.js +2 -1
  142. package/tinymce-assets/skins/ui/oxide-dark/skin.min.css +1 -1
  143. package/tinymce-assets/skins/ui/oxide-dark/skin.shadowdom.js +2 -1
  144. package/tinymce-assets/skins/ui/tinymce-5/content.css +53 -148
  145. package/tinymce-assets/skins/ui/tinymce-5/content.inline.css +53 -148
  146. package/tinymce-assets/skins/ui/tinymce-5/content.inline.js +6 -1
  147. package/tinymce-assets/skins/ui/tinymce-5/content.inline.min.css +5 -1
  148. package/tinymce-assets/skins/ui/tinymce-5/content.js +6 -1
  149. package/tinymce-assets/skins/ui/tinymce-5/content.min.css +5 -1
  150. package/tinymce-assets/skins/ui/tinymce-5/skin.css +194 -1597
  151. package/tinymce-assets/skins/ui/tinymce-5/skin.js +2 -1
  152. package/tinymce-assets/skins/ui/tinymce-5/skin.min.css +1 -1
  153. package/tinymce-assets/skins/ui/tinymce-5/skin.shadowdom.js +2 -1
  154. package/tinymce-assets/skins/ui/tinymce-5-dark/content.css +46 -148
  155. package/tinymce-assets/skins/ui/tinymce-5-dark/content.inline.css +53 -148
  156. package/tinymce-assets/skins/ui/tinymce-5-dark/content.inline.js +6 -1
  157. package/tinymce-assets/skins/ui/tinymce-5-dark/content.inline.min.css +5 -1
  158. package/tinymce-assets/skins/ui/tinymce-5-dark/content.js +6 -1
  159. package/tinymce-assets/skins/ui/tinymce-5-dark/content.min.css +5 -1
  160. package/tinymce-assets/skins/ui/tinymce-5-dark/skin.css +202 -1605
  161. package/tinymce-assets/skins/ui/tinymce-5-dark/skin.js +2 -1
  162. package/tinymce-assets/skins/ui/tinymce-5-dark/skin.min.css +1 -1
  163. package/tinymce-assets/skins/ui/tinymce-5-dark/skin.shadowdom.js +2 -1
  164. package/tinymce-assets/themes/silver/theme.js +28439 -32466
  165. package/tinymce-assets/themes/silver/theme.min.js +1 -1
@@ -1,5 +1,5 @@
1
1
  /**
2
- * TinyMCE version 7.9.3 (2026-05-19)
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
- 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
- }
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 = (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
- }
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 = (type) => (value) => typeOf(value) === type;
37
- const isSimpleType = (type) => (value) => typeof value === type;
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 = (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
- });
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
- 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
- };
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 = (url) => {
157
- const cacheSuffix = global$1.cacheSuffix;
158
- if (isString(url)) {
159
- url = url.replace('?' + cacheSuffix, '').replace('&' + cacheSuffix, '');
160
- }
161
- return url;
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
- 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;
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 = (filter) => {
175
- if (isString(filter)) {
176
- return (value) => {
177
- return value.indexOf(filter) !== -1;
178
- };
179
- }
180
- else if (filter instanceof RegExp) {
181
- return (value) => {
182
- return filter.test(value);
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 = (rule) => rule.styleSheet;
188
- const isCssPageRule = (rule) => rule.selectorText;
160
+ const isCssImportRule = rule => rule.styleSheet;
161
+ const isCssPageRule = rule => rule.selectorText;
189
162
  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
- }
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
- global.each(doc.styleSheets, (styleSheet) => {
231
- append(styleSheet);
232
- });
233
- }
234
- catch (_a) {
235
- // Ignore
176
+ rules = styleSheet.cssRules || styleSheet.rules;
177
+ } catch (e) {
236
178
  }
237
- return selectors;
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
- 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;
245
- }
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
- };
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
- // 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;
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
- return global.grep(groups, (group) => {
286
- return !group.filter || group.filter(selector);
287
- });
238
+ return global.grep(groups, group => {
239
+ return !group.filter || group.filter(selector);
240
+ });
288
241
  };
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
- });
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
- // 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);
252
+ return group === null || shouldImportExclusive(editor);
301
253
  };
302
254
  const isUniqueSelector = (editor, selector, group, globallyUniqueSelectors) => {
303
- return !(isExclusiveMode(editor, group) ? selector in globallyUniqueSelectors : selector in group.selectors);
255
+ return !(isExclusiveMode(editor, group) ? selector in globallyUniqueSelectors : selector in group.selectors);
304
256
  };
305
257
  const markUniqueSelector = (editor, selector, group, globallyUniqueSelectors) => {
306
- if (isExclusiveMode(editor, group)) {
307
- globallyUniqueSelectors[selector] = true;
308
- }
309
- else {
310
- group.selectors[selector] = true;
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
- 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);
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 = (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
- }
347
- }
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
- }
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
- const items = model.toFormats();
372
- editor.dispatch('addStyleModifications', {
373
- items,
374
- replace: !shouldAppend(editor)
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 = (editor) => {
380
- const convertSelectorToFormat = (selectorText) => {
381
- return defaultConvertSelectorToFormat(editor, selectorText);
382
- };
383
- return {
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
- global$4.add('importcss', (editor) => {
390
- register(editor);
391
- setup(editor);
392
- return get(editor);
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
  })();