@dangl/angular-material-shared 2.5.1-beta0012 → 2.5.1-beta0018

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 (241) hide show
  1. package/README.md +1 -7
  2. package/esm2022/lib/angular-material-shared.module.mjs +2 -2
  3. package/esm2022/lib/components/tiny-mce/tiny-mce.component.mjs +16 -19
  4. package/fesm2022/dangl-angular-material-shared.mjs +16 -19
  5. package/fesm2022/dangl-angular-material-shared.mjs.map +1 -1
  6. package/lib/components/tiny-mce/tiny-mce.component.d.ts +7 -8
  7. package/package.json +1 -1
  8. package/tinymce-assets/icons/default/icons.js +187 -171
  9. package/tinymce-assets/icons/default/icons.min.js +1 -1
  10. package/tinymce-assets/langs/it.js +1 -1
  11. package/tinymce-assets/plugins/accordion/index.js +7 -0
  12. package/tinymce-assets/plugins/accordion/plugin.js +1054 -0
  13. package/tinymce-assets/plugins/accordion/plugin.min.js +4 -0
  14. package/tinymce-assets/plugins/advlist/plugin.js +185 -187
  15. package/tinymce-assets/plugins/advlist/plugin.min.js +2 -7
  16. package/tinymce-assets/plugins/anchor/plugin.js +79 -81
  17. package/tinymce-assets/plugins/anchor/plugin.min.js +2 -7
  18. package/tinymce-assets/plugins/autolink/plugin.js +209 -194
  19. package/tinymce-assets/plugins/autolink/plugin.min.js +2 -7
  20. package/tinymce-assets/plugins/autoresize/plugin.js +110 -102
  21. package/tinymce-assets/plugins/autoresize/plugin.min.js +2 -7
  22. package/tinymce-assets/plugins/autosave/plugin.js +125 -104
  23. package/tinymce-assets/plugins/autosave/plugin.min.js +2 -7
  24. package/tinymce-assets/plugins/charmap/plugin.js +275 -313
  25. package/tinymce-assets/plugins/charmap/plugin.min.js +2 -7
  26. package/tinymce-assets/plugins/code/plugin.js +18 -24
  27. package/tinymce-assets/plugins/code/plugin.min.js +2 -7
  28. package/tinymce-assets/plugins/codesample/plugin.js +2075 -2074
  29. package/tinymce-assets/plugins/codesample/plugin.min.js +2 -7
  30. package/tinymce-assets/plugins/directionality/plugin.js +247 -305
  31. package/tinymce-assets/plugins/directionality/plugin.min.js +2 -7
  32. package/tinymce-assets/plugins/emoticons/js/emojiimages.js +1 -9424
  33. package/tinymce-assets/plugins/emoticons/js/emojiimages.min.js +1 -1
  34. package/tinymce-assets/plugins/emoticons/js/emojis.js +1 -9423
  35. package/tinymce-assets/plugins/emoticons/js/emojis.min.js +1 -1
  36. package/tinymce-assets/plugins/emoticons/plugin.js +334 -374
  37. package/tinymce-assets/plugins/emoticons/plugin.min.js +2 -7
  38. package/tinymce-assets/plugins/fullscreen/plugin.js +740 -837
  39. package/tinymce-assets/plugins/fullscreen/plugin.min.js +2 -7
  40. package/tinymce-assets/plugins/help/js/i18n/keynav/ar.js +90 -0
  41. package/tinymce-assets/plugins/help/js/i18n/keynav/bg_BG.js +90 -0
  42. package/tinymce-assets/plugins/help/js/i18n/keynav/ca.js +90 -0
  43. package/tinymce-assets/plugins/help/js/i18n/keynav/cs.js +90 -0
  44. package/tinymce-assets/plugins/help/js/i18n/keynav/da.js +90 -0
  45. package/tinymce-assets/plugins/help/js/i18n/keynav/de.js +90 -0
  46. package/tinymce-assets/plugins/help/js/i18n/keynav/el.js +90 -0
  47. package/tinymce-assets/plugins/help/js/i18n/keynav/en.js +90 -0
  48. package/tinymce-assets/plugins/help/js/i18n/keynav/es.js +90 -0
  49. package/tinymce-assets/plugins/help/js/i18n/keynav/eu.js +90 -0
  50. package/tinymce-assets/plugins/help/js/i18n/keynav/fa.js +90 -0
  51. package/tinymce-assets/plugins/help/js/i18n/keynav/fi.js +90 -0
  52. package/tinymce-assets/plugins/help/js/i18n/keynav/fr_FR.js +90 -0
  53. package/tinymce-assets/plugins/help/js/i18n/keynav/he_IL.js +90 -0
  54. package/tinymce-assets/plugins/help/js/i18n/keynav/hi.js +90 -0
  55. package/tinymce-assets/plugins/help/js/i18n/keynav/hr.js +90 -0
  56. package/tinymce-assets/plugins/help/js/i18n/keynav/hu_HU.js +90 -0
  57. package/tinymce-assets/plugins/help/js/i18n/keynav/id.js +90 -0
  58. package/tinymce-assets/plugins/help/js/i18n/keynav/it.js +90 -0
  59. package/tinymce-assets/plugins/help/js/i18n/keynav/ja.js +90 -0
  60. package/tinymce-assets/plugins/help/js/i18n/keynav/kk.js +90 -0
  61. package/tinymce-assets/plugins/help/js/i18n/keynav/ko_KR.js +90 -0
  62. package/tinymce-assets/plugins/help/js/i18n/keynav/ms.js +90 -0
  63. package/tinymce-assets/plugins/help/js/i18n/keynav/nb_NO.js +90 -0
  64. package/tinymce-assets/plugins/help/js/i18n/keynav/nl.js +90 -0
  65. package/tinymce-assets/plugins/help/js/i18n/keynav/pl.js +90 -0
  66. package/tinymce-assets/plugins/help/js/i18n/keynav/pt_BR.js +90 -0
  67. package/tinymce-assets/plugins/help/js/i18n/keynav/pt_PT.js +90 -0
  68. package/tinymce-assets/plugins/help/js/i18n/keynav/ro.js +90 -0
  69. package/tinymce-assets/plugins/help/js/i18n/keynav/ru.js +90 -0
  70. package/tinymce-assets/plugins/help/js/i18n/keynav/sk.js +90 -0
  71. package/tinymce-assets/plugins/help/js/i18n/keynav/sl_SI.js +90 -0
  72. package/tinymce-assets/plugins/help/js/i18n/keynav/sv_SE.js +90 -0
  73. package/tinymce-assets/plugins/help/js/i18n/keynav/th_TH.js +90 -0
  74. package/tinymce-assets/plugins/help/js/i18n/keynav/tr.js +90 -0
  75. package/tinymce-assets/plugins/help/js/i18n/keynav/uk.js +90 -0
  76. package/tinymce-assets/plugins/help/js/i18n/keynav/vi.js +90 -0
  77. package/tinymce-assets/plugins/help/js/i18n/keynav/zh_CN.js +84 -0
  78. package/tinymce-assets/plugins/help/js/i18n/keynav/zh_TW.js +90 -0
  79. package/tinymce-assets/plugins/help/plugin.js +411 -355
  80. package/tinymce-assets/plugins/help/plugin.min.js +2 -7
  81. package/tinymce-assets/plugins/image/plugin.js +876 -1037
  82. package/tinymce-assets/plugins/image/plugin.min.js +2 -7
  83. package/tinymce-assets/plugins/importcss/plugin.js +146 -144
  84. package/tinymce-assets/plugins/importcss/plugin.min.js +2 -7
  85. package/tinymce-assets/plugins/insertdatetime/plugin.js +93 -88
  86. package/tinymce-assets/plugins/insertdatetime/plugin.min.js +2 -7
  87. package/tinymce-assets/plugins/link/plugin.js +718 -768
  88. package/tinymce-assets/plugins/link/plugin.min.js +2 -7
  89. package/tinymce-assets/plugins/lists/plugin.js +1235 -1375
  90. package/tinymce-assets/plugins/lists/plugin.min.js +2 -7
  91. package/tinymce-assets/plugins/media/plugin.js +614 -756
  92. package/tinymce-assets/plugins/media/plugin.min.js +2 -7
  93. package/tinymce-assets/plugins/nonbreaking/plugin.js +71 -48
  94. package/tinymce-assets/plugins/nonbreaking/plugin.min.js +2 -7
  95. package/tinymce-assets/plugins/pagebreak/plugin.js +53 -40
  96. package/tinymce-assets/plugins/pagebreak/plugin.min.js +2 -7
  97. package/tinymce-assets/plugins/preview/plugin.js +36 -65
  98. package/tinymce-assets/plugins/preview/plugin.min.js +2 -7
  99. package/tinymce-assets/plugins/quickbars/plugin.js +304 -331
  100. package/tinymce-assets/plugins/quickbars/plugin.min.js +2 -7
  101. package/tinymce-assets/plugins/save/plugin.js +49 -50
  102. package/tinymce-assets/plugins/save/plugin.min.js +2 -7
  103. package/tinymce-assets/plugins/searchreplace/plugin.js +499 -571
  104. package/tinymce-assets/plugins/searchreplace/plugin.min.js +2 -7
  105. package/tinymce-assets/plugins/table/plugin.js +2572 -10617
  106. package/tinymce-assets/plugins/table/plugin.min.js +2 -7
  107. package/tinymce-assets/plugins/visualblocks/plugin.js +41 -46
  108. package/tinymce-assets/plugins/visualblocks/plugin.min.js +2 -7
  109. package/tinymce-assets/plugins/visualchars/plugin.js +346 -312
  110. package/tinymce-assets/plugins/visualchars/plugin.min.js +2 -7
  111. package/tinymce-assets/plugins/wordcount/plugin.js +159 -179
  112. package/tinymce-assets/plugins/wordcount/plugin.min.js +2 -7
  113. package/tinymce-assets/skins/content/dark/content.css +2 -8
  114. package/tinymce-assets/skins/content/dark/content.js +2 -0
  115. package/tinymce-assets/skins/content/dark/content.min.css +1 -7
  116. package/tinymce-assets/skins/content/default/content.css +0 -6
  117. package/tinymce-assets/skins/content/default/content.js +2 -0
  118. package/tinymce-assets/skins/content/default/content.min.css +0 -6
  119. package/tinymce-assets/skins/content/document/content.css +0 -6
  120. package/tinymce-assets/skins/content/document/content.js +2 -0
  121. package/tinymce-assets/skins/content/document/content.min.css +0 -6
  122. package/tinymce-assets/skins/content/tinymce-5/content.css +61 -0
  123. package/tinymce-assets/skins/content/tinymce-5/content.js +2 -0
  124. package/tinymce-assets/skins/content/tinymce-5/content.min.css +1 -0
  125. package/tinymce-assets/skins/content/tinymce-5-dark/content.css +66 -0
  126. package/tinymce-assets/skins/content/tinymce-5-dark/content.js +2 -0
  127. package/tinymce-assets/skins/content/tinymce-5-dark/content.min.css +1 -0
  128. package/tinymce-assets/skins/content/writer/content.css +0 -6
  129. package/tinymce-assets/skins/content/writer/content.js +2 -0
  130. package/tinymce-assets/skins/content/writer/content.min.css +0 -6
  131. package/tinymce-assets/skins/ui/oxide/content.css +73 -20
  132. package/tinymce-assets/skins/ui/oxide/content.inline.css +73 -20
  133. package/tinymce-assets/skins/ui/oxide/content.inline.js +2 -0
  134. package/tinymce-assets/skins/ui/oxide/content.inline.min.css +1 -7
  135. package/tinymce-assets/skins/ui/oxide/content.js +2 -0
  136. package/tinymce-assets/skins/ui/oxide/content.min.css +1 -7
  137. package/tinymce-assets/skins/ui/oxide/skin.css +1480 -435
  138. package/tinymce-assets/skins/ui/oxide/skin.js +2 -0
  139. package/tinymce-assets/skins/ui/oxide/skin.min.css +1 -7
  140. package/tinymce-assets/skins/ui/oxide/skin.shadowdom.css +1 -8
  141. package/tinymce-assets/skins/ui/oxide/skin.shadowdom.js +2 -0
  142. package/tinymce-assets/skins/ui/oxide/skin.shadowdom.min.css +1 -7
  143. package/tinymce-assets/skins/ui/oxide-dark/content.css +71 -19
  144. package/tinymce-assets/skins/ui/oxide-dark/content.inline.css +73 -20
  145. package/tinymce-assets/skins/ui/oxide-dark/content.inline.js +2 -0
  146. package/tinymce-assets/skins/ui/oxide-dark/content.inline.min.css +1 -7
  147. package/tinymce-assets/skins/ui/oxide-dark/content.js +2 -0
  148. package/tinymce-assets/skins/ui/oxide-dark/content.min.css +1 -7
  149. package/tinymce-assets/skins/ui/oxide-dark/skin.css +1498 -450
  150. package/tinymce-assets/skins/ui/oxide-dark/skin.js +2 -0
  151. package/tinymce-assets/skins/ui/oxide-dark/skin.min.css +1 -7
  152. package/tinymce-assets/skins/ui/oxide-dark/skin.shadowdom.css +1 -8
  153. package/tinymce-assets/skins/ui/oxide-dark/skin.shadowdom.js +2 -0
  154. package/tinymce-assets/skins/ui/oxide-dark/skin.shadowdom.min.css +1 -7
  155. package/tinymce-assets/skins/ui/tinymce-5/content.css +785 -0
  156. package/tinymce-assets/skins/ui/tinymce-5/content.inline.css +779 -0
  157. package/tinymce-assets/skins/ui/tinymce-5/content.inline.js +2 -0
  158. package/tinymce-assets/skins/ui/tinymce-5/content.inline.min.css +1 -0
  159. package/tinymce-assets/skins/ui/tinymce-5/content.js +2 -0
  160. package/tinymce-assets/skins/ui/tinymce-5/content.min.css +1 -0
  161. package/tinymce-assets/skins/ui/tinymce-5/skin.css +4185 -0
  162. package/tinymce-assets/skins/ui/tinymce-5/skin.js +2 -0
  163. package/tinymce-assets/skins/ui/tinymce-5/skin.min.css +1 -0
  164. package/tinymce-assets/skins/ui/tinymce-5/skin.shadowdom.css +30 -0
  165. package/tinymce-assets/skins/ui/tinymce-5/skin.shadowdom.js +2 -0
  166. package/tinymce-assets/skins/ui/tinymce-5/skin.shadowdom.min.css +1 -0
  167. package/tinymce-assets/skins/ui/tinymce-5-dark/content.css +766 -0
  168. package/tinymce-assets/skins/ui/tinymce-5-dark/content.inline.css +779 -0
  169. package/tinymce-assets/skins/ui/tinymce-5-dark/content.inline.js +2 -0
  170. package/tinymce-assets/skins/ui/tinymce-5-dark/content.inline.min.css +1 -0
  171. package/tinymce-assets/skins/ui/tinymce-5-dark/content.js +2 -0
  172. package/tinymce-assets/skins/ui/tinymce-5-dark/content.min.css +1 -0
  173. package/tinymce-assets/skins/ui/tinymce-5-dark/skin.css +4185 -0
  174. package/tinymce-assets/skins/ui/tinymce-5-dark/skin.js +2 -0
  175. package/tinymce-assets/skins/ui/tinymce-5-dark/skin.min.css +1 -0
  176. package/tinymce-assets/skins/ui/tinymce-5-dark/skin.shadowdom.css +30 -0
  177. package/tinymce-assets/skins/ui/tinymce-5-dark/skin.shadowdom.js +2 -0
  178. package/tinymce-assets/skins/ui/tinymce-5-dark/skin.shadowdom.min.css +1 -0
  179. package/tinymce-assets/themes/silver/theme.js +25226 -28188
  180. package/tinymce-assets/themes/silver/theme.min.js +2 -7
  181. package/tinymce-assets/plugins/bbcode/index.js +0 -7
  182. package/tinymce-assets/plugins/bbcode/plugin.js +0 -99
  183. package/tinymce-assets/plugins/bbcode/plugin.min.js +0 -9
  184. package/tinymce-assets/plugins/colorpicker/index.js +0 -7
  185. package/tinymce-assets/plugins/colorpicker/plugin.js +0 -21
  186. package/tinymce-assets/plugins/colorpicker/plugin.min.js +0 -9
  187. package/tinymce-assets/plugins/contextmenu/index.js +0 -7
  188. package/tinymce-assets/plugins/contextmenu/plugin.js +0 -21
  189. package/tinymce-assets/plugins/contextmenu/plugin.min.js +0 -9
  190. package/tinymce-assets/plugins/fullpage/index.js +0 -7
  191. package/tinymce-assets/plugins/fullpage/plugin.js +0 -544
  192. package/tinymce-assets/plugins/fullpage/plugin.min.js +0 -9
  193. package/tinymce-assets/plugins/hr/index.js +0 -7
  194. package/tinymce-assets/plugins/hr/plugin.js +0 -45
  195. package/tinymce-assets/plugins/hr/plugin.min.js +0 -9
  196. package/tinymce-assets/plugins/imagetools/index.js +0 -7
  197. package/tinymce-assets/plugins/imagetools/plugin.js +0 -1531
  198. package/tinymce-assets/plugins/imagetools/plugin.min.js +0 -9
  199. package/tinymce-assets/plugins/legacyoutput/index.js +0 -7
  200. package/tinymce-assets/plugins/legacyoutput/plugin.js +0 -199
  201. package/tinymce-assets/plugins/legacyoutput/plugin.min.js +0 -9
  202. package/tinymce-assets/plugins/noneditable/index.js +0 -7
  203. package/tinymce-assets/plugins/noneditable/plugin.js +0 -117
  204. package/tinymce-assets/plugins/noneditable/plugin.min.js +0 -9
  205. package/tinymce-assets/plugins/paste/index.js +0 -7
  206. package/tinymce-assets/plugins/paste/plugin.js +0 -1803
  207. package/tinymce-assets/plugins/paste/plugin.min.js +0 -9
  208. package/tinymce-assets/plugins/print/index.js +0 -7
  209. package/tinymce-assets/plugins/print/plugin.js +0 -52
  210. package/tinymce-assets/plugins/print/plugin.min.js +0 -9
  211. package/tinymce-assets/plugins/spellchecker/index.js +0 -7
  212. package/tinymce-assets/plugins/spellchecker/plugin.js +0 -730
  213. package/tinymce-assets/plugins/spellchecker/plugin.min.js +0 -9
  214. package/tinymce-assets/plugins/tabfocus/index.js +0 -7
  215. package/tinymce-assets/plugins/tabfocus/plugin.js +0 -130
  216. package/tinymce-assets/plugins/tabfocus/plugin.min.js +0 -9
  217. package/tinymce-assets/plugins/template/index.js +0 -7
  218. package/tinymce-assets/plugins/template/plugin.js +0 -591
  219. package/tinymce-assets/plugins/template/plugin.min.js +0 -9
  220. package/tinymce-assets/plugins/textcolor/index.js +0 -7
  221. package/tinymce-assets/plugins/textcolor/plugin.js +0 -21
  222. package/tinymce-assets/plugins/textcolor/plugin.min.js +0 -9
  223. package/tinymce-assets/plugins/textpattern/index.js +0 -7
  224. package/tinymce-assets/plugins/textpattern/plugin.js +0 -1374
  225. package/tinymce-assets/plugins/textpattern/plugin.min.js +0 -9
  226. package/tinymce-assets/plugins/toc/index.js +0 -7
  227. package/tinymce-assets/plugins/toc/plugin.js +0 -238
  228. package/tinymce-assets/plugins/toc/plugin.min.js +0 -9
  229. package/tinymce-assets/skins/ui/oxide/content.mobile.css +0 -29
  230. package/tinymce-assets/skins/ui/oxide/content.mobile.min.css +0 -7
  231. package/tinymce-assets/skins/ui/oxide/fonts/tinymce-mobile.woff +0 -0
  232. package/tinymce-assets/skins/ui/oxide/skin.mobile.css +0 -673
  233. package/tinymce-assets/skins/ui/oxide/skin.mobile.min.css +0 -7
  234. package/tinymce-assets/skins/ui/oxide-dark/content.mobile.css +0 -29
  235. package/tinymce-assets/skins/ui/oxide-dark/content.mobile.min.css +0 -7
  236. package/tinymce-assets/skins/ui/oxide-dark/fonts/tinymce-mobile.woff +0 -0
  237. package/tinymce-assets/skins/ui/oxide-dark/skin.mobile.css +0 -673
  238. package/tinymce-assets/skins/ui/oxide-dark/skin.mobile.min.css +0 -7
  239. package/tinymce-assets/themes/mobile/index.js +0 -7
  240. package/tinymce-assets/themes/mobile/theme.js +0 -13130
  241. package/tinymce-assets/themes/mobile/theme.min.js +0 -9
@@ -1,119 +1,168 @@
1
1
  /**
2
- * Copyright (c) Tiny Technologies, Inc. All rights reserved.
3
- * Licensed under the LGPL or a commercial license.
4
- * For LGPL see License.txt in the project root for license information.
5
- * For commercial licenses see https://www.tiny.cloud/
6
- *
7
- * Version: 5.10.9 (2023-11-15)
2
+ * TinyMCE version 7.0.1 (2024-04-10)
8
3
  */
4
+
9
5
  (function () {
10
6
  'use strict';
11
7
 
12
- var global$3 = tinymce.util.Tools.resolve('tinymce.PluginManager');
8
+ var global$1 = tinymce.util.Tools.resolve('tinymce.PluginManager');
13
9
 
14
- var unique = 0;
15
- var generate = function (prefix) {
16
- var date = new Date();
17
- var time = date.getTime();
18
- var random = Math.floor(Math.random() * 1000000000);
19
- unique++;
20
- return prefix + '_' + random + unique + String(time);
10
+ 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
+ }
17
+ };
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
29
  };
30
+ const isType = type => value => typeOf(value) === type;
31
+ const isSimpleType = type => value => typeof value === type;
32
+ const isString = isType('string');
33
+ const isBoolean = isSimpleType('boolean');
34
+ const isNullable = a => a === null || a === undefined;
35
+ const isNonNullable = a => !isNullable(a);
36
+ const isFunction = isSimpleType('function');
22
37
 
23
- var createTableHtml = function (cols, rows) {
24
- var html = '<table data-mce-id="mce" style="width: 100%">';
25
- html += '<tbody>';
26
- for (var y = 0; y < rows; y++) {
27
- html += '<tr>';
28
- for (var x = 0; x < cols; x++) {
29
- html += '<td><br></td>';
38
+ const option = name => editor => editor.options.get(name);
39
+ const register = editor => {
40
+ const registerOption = editor.options.register;
41
+ const toolbarProcessor = defaultValue => value => {
42
+ const valid = isBoolean(value) || isString(value);
43
+ if (valid) {
44
+ if (isBoolean(value)) {
45
+ return {
46
+ value: value ? defaultValue : '',
47
+ valid
48
+ };
49
+ } else {
50
+ return {
51
+ value: value.trim(),
52
+ valid
53
+ };
54
+ }
55
+ } else {
56
+ return {
57
+ valid: false,
58
+ message: 'Must be a boolean or string.'
59
+ };
30
60
  }
31
- html += '</tr>';
32
- }
33
- html += '</tbody>';
34
- html += '</table>';
35
- return html;
61
+ };
62
+ const defaultSelectionToolbar = 'bold italic | quicklink h2 h3 blockquote';
63
+ registerOption('quickbars_selection_toolbar', {
64
+ processor: toolbarProcessor(defaultSelectionToolbar),
65
+ default: defaultSelectionToolbar
66
+ });
67
+ const defaultInsertToolbar = 'quickimage quicktable';
68
+ registerOption('quickbars_insert_toolbar', {
69
+ processor: toolbarProcessor(defaultInsertToolbar),
70
+ default: defaultInsertToolbar
71
+ });
72
+ const defaultImageToolbar = 'alignleft aligncenter alignright';
73
+ registerOption('quickbars_image_toolbar', {
74
+ processor: toolbarProcessor(defaultImageToolbar),
75
+ default: defaultImageToolbar
76
+ });
36
77
  };
37
- var getInsertedElement = function (editor) {
38
- var elms = editor.dom.select('*[data-mce-id]');
39
- return elms[0];
78
+ const getTextSelectionToolbarItems = option('quickbars_selection_toolbar');
79
+ const getInsertToolbarItems = option('quickbars_insert_toolbar');
80
+ const getImageToolbarItems = option('quickbars_image_toolbar');
81
+
82
+ let unique = 0;
83
+ const generate = prefix => {
84
+ const date = new Date();
85
+ const time = date.getTime();
86
+ const random = Math.floor(Math.random() * 1000000000);
87
+ unique++;
88
+ return prefix + '_' + random + unique + String(time);
40
89
  };
41
- var insertTableHtml = function (editor, cols, rows) {
42
- editor.undoManager.transact(function () {
43
- editor.insertContent(createTableHtml(cols, rows));
44
- var tableElm = getInsertedElement(editor);
45
- tableElm.removeAttribute('data-mce-id');
46
- var cellElm = editor.dom.select('td,th', tableElm);
47
- editor.selection.setCursorLocation(cellElm[0], 0);
90
+
91
+ const insertTable = (editor, columns, rows) => {
92
+ editor.execCommand('mceInsertTable', false, {
93
+ rows,
94
+ columns
48
95
  });
49
96
  };
50
- var insertTable = function (editor, cols, rows) {
51
- editor.plugins.table ? editor.plugins.table.insertTable(cols, rows) : insertTableHtml(editor, cols, rows);
52
- };
53
- var insertBlob = function (editor, base64, blob) {
54
- var blobCache = editor.editorUpload.blobCache;
55
- var blobInfo = blobCache.create(generate('mceu'), blob, base64);
97
+ const insertBlob = (editor, base64, blob) => {
98
+ const blobCache = editor.editorUpload.blobCache;
99
+ const blobInfo = blobCache.create(generate('mceu'), blob, base64);
56
100
  blobCache.add(blobInfo);
57
101
  editor.insertContent(editor.dom.createHTML('img', { src: blobInfo.blobUri() }));
58
102
  };
59
103
 
60
- var global$2 = tinymce.util.Tools.resolve('tinymce.util.Promise');
61
-
62
- var blobToBase64 = function (blob) {
63
- return new global$2(function (resolve) {
64
- var reader = new FileReader();
65
- reader.onloadend = function () {
104
+ const blobToBase64 = blob => {
105
+ return new Promise(resolve => {
106
+ const reader = new FileReader();
107
+ reader.onloadend = () => {
66
108
  resolve(reader.result.split(',')[1]);
67
109
  };
68
110
  reader.readAsDataURL(blob);
69
111
  });
70
112
  };
71
113
 
72
- var global$1 = tinymce.util.Tools.resolve('tinymce.Env');
73
-
74
114
  var global = tinymce.util.Tools.resolve('tinymce.util.Delay');
75
115
 
76
- var pickFile = function (editor) {
77
- return new global$2(function (resolve) {
78
- var fileInput = document.createElement('input');
79
- fileInput.type = 'file';
80
- fileInput.accept = 'image/*';
81
- fileInput.style.position = 'fixed';
82
- fileInput.style.left = '0';
83
- fileInput.style.top = '0';
84
- fileInput.style.opacity = '0.001';
85
- document.body.appendChild(fileInput);
86
- var changeHandler = function (e) {
87
- resolve(Array.prototype.slice.call(e.target.files));
116
+ const pickFile = editor => new Promise(resolve => {
117
+ let resolved = false;
118
+ const fileInput = document.createElement('input');
119
+ fileInput.type = 'file';
120
+ fileInput.accept = 'image/*';
121
+ fileInput.style.position = 'fixed';
122
+ fileInput.style.left = '0';
123
+ fileInput.style.top = '0';
124
+ fileInput.style.opacity = '0.001';
125
+ document.body.appendChild(fileInput);
126
+ const resolveFileInput = value => {
127
+ var _a;
128
+ if (!resolved) {
129
+ (_a = fileInput.parentNode) === null || _a === void 0 ? void 0 : _a.removeChild(fileInput);
130
+ resolved = true;
131
+ resolve(value);
132
+ }
133
+ };
134
+ const changeHandler = e => {
135
+ resolveFileInput(Array.prototype.slice.call(e.target.files));
136
+ };
137
+ fileInput.addEventListener('input', changeHandler);
138
+ fileInput.addEventListener('change', changeHandler);
139
+ const cancelHandler = e => {
140
+ const cleanup = () => {
141
+ resolveFileInput([]);
88
142
  };
89
- fileInput.addEventListener('change', changeHandler);
90
- var cancelHandler = function (e) {
91
- var cleanup = function () {
92
- resolve([]);
93
- fileInput.parentNode.removeChild(fileInput);
94
- };
95
- if (global$1.os.isAndroid() && e.type !== 'remove') {
96
- global.setEditorTimeout(editor, cleanup, 0);
143
+ if (!resolved) {
144
+ if (e.type === 'focusin') {
145
+ global.setEditorTimeout(editor, cleanup, 1000);
97
146
  } else {
98
147
  cleanup();
99
148
  }
100
- editor.off('focusin remove', cancelHandler);
101
- };
102
- editor.on('focusin remove', cancelHandler);
103
- fileInput.click();
104
- });
105
- };
149
+ }
150
+ editor.off('focusin remove', cancelHandler);
151
+ };
152
+ editor.on('focusin remove', cancelHandler);
153
+ fileInput.click();
154
+ });
106
155
 
107
- var setupButtons = function (editor) {
156
+ const setupButtons = editor => {
108
157
  editor.ui.registry.addButton('quickimage', {
109
158
  icon: 'image',
110
159
  tooltip: 'Insert image',
111
- onAction: function () {
112
- pickFile(editor).then(function (files) {
160
+ onAction: () => {
161
+ pickFile(editor).then(files => {
113
162
  if (files.length > 0) {
114
- var blob_1 = files[0];
115
- blobToBase64(blob_1).then(function (base64) {
116
- insertBlob(editor, base64, blob_1);
163
+ const blob = files[0];
164
+ blobToBase64(blob).then(base64 => {
165
+ insertBlob(editor, base64, blob);
117
166
  });
118
167
  }
119
168
  });
@@ -122,149 +171,127 @@
122
171
  editor.ui.registry.addButton('quicktable', {
123
172
  icon: 'table',
124
173
  tooltip: 'Insert table',
125
- onAction: function () {
174
+ onAction: () => {
126
175
  insertTable(editor, 2, 2);
127
176
  }
128
177
  });
129
178
  };
130
179
 
131
- var typeOf = function (x) {
132
- var t = typeof x;
133
- if (x === null) {
134
- return 'null';
135
- } else if (t === 'object' && (Array.prototype.isPrototypeOf(x) || x.constructor && x.constructor.name === 'Array')) {
136
- return 'array';
137
- } else if (t === 'object' && (String.prototype.isPrototypeOf(x) || x.constructor && x.constructor.name === 'String')) {
138
- return 'string';
139
- } else {
140
- return t;
141
- }
142
- };
143
- var isType = function (type) {
144
- return function (value) {
145
- return typeOf(value) === type;
146
- };
147
- };
148
- var isSimpleType = function (type) {
149
- return function (value) {
150
- return typeof value === type;
151
- };
152
- };
153
- var eq = function (t) {
154
- return function (a) {
155
- return t === a;
156
- };
157
- };
158
- var isString = isType('string');
159
- var isObject = isType('object');
160
- var isArray = isType('array');
161
- var isBoolean = isSimpleType('boolean');
162
- var isUndefined = eq(undefined);
163
- var isFunction = isSimpleType('function');
164
-
165
- var noop = function () {
166
- };
167
- var constant = function (value) {
168
- return function () {
180
+ const constant = value => {
181
+ return () => {
169
182
  return value;
170
183
  };
171
184
  };
172
- var identity = function (x) {
173
- return x;
174
- };
175
- var never = constant(false);
176
- var always = constant(true);
185
+ const never = constant(false);
177
186
 
178
- var none = function () {
179
- return NONE;
180
- };
181
- var NONE = function () {
182
- var call = function (thunk) {
183
- return thunk();
184
- };
185
- var id = identity;
186
- var me = {
187
- fold: function (n, _s) {
188
- return n();
189
- },
190
- isSome: never,
191
- isNone: always,
192
- getOr: id,
193
- getOrThunk: call,
194
- getOrDie: function (msg) {
195
- throw new Error(msg || 'error: getOrDie called on none.');
196
- },
197
- getOrNull: constant(null),
198
- getOrUndefined: constant(undefined),
199
- or: id,
200
- orThunk: call,
201
- map: none,
202
- each: noop,
203
- bind: none,
204
- exists: never,
205
- forall: always,
206
- filter: function () {
207
- return none();
208
- },
209
- toArray: function () {
210
- return [];
211
- },
212
- toString: constant('none()')
213
- };
214
- return me;
215
- }();
216
- var some = function (a) {
217
- var constant_a = constant(a);
218
- var self = function () {
219
- return me;
220
- };
221
- var bind = function (f) {
222
- return f(a);
223
- };
224
- var me = {
225
- fold: function (n, s) {
226
- return s(a);
227
- },
228
- isSome: always,
229
- isNone: never,
230
- getOr: constant_a,
231
- getOrThunk: constant_a,
232
- getOrDie: constant_a,
233
- getOrNull: constant_a,
234
- getOrUndefined: constant_a,
235
- or: self,
236
- orThunk: self,
237
- map: function (f) {
238
- return some(f(a));
239
- },
240
- each: function (f) {
241
- f(a);
242
- },
243
- bind: bind,
244
- exists: bind,
245
- forall: bind,
246
- filter: function (f) {
247
- return f(a) ? me : NONE;
248
- },
249
- toArray: function () {
250
- return [a];
251
- },
252
- toString: function () {
253
- return 'some(' + a + ')';
187
+ class Optional {
188
+ constructor(tag, value) {
189
+ this.tag = tag;
190
+ this.value = value;
191
+ }
192
+ static some(value) {
193
+ return new Optional(true, value);
194
+ }
195
+ static none() {
196
+ return Optional.singletonNone;
197
+ }
198
+ fold(onNone, onSome) {
199
+ if (this.tag) {
200
+ return onSome(this.value);
201
+ } else {
202
+ return onNone();
254
203
  }
255
- };
256
- return me;
257
- };
258
- var from = function (value) {
259
- return value === null || value === undefined ? NONE : some(value);
204
+ }
205
+ isSome() {
206
+ return this.tag;
207
+ }
208
+ isNone() {
209
+ return !this.tag;
210
+ }
211
+ map(mapper) {
212
+ if (this.tag) {
213
+ return Optional.some(mapper(this.value));
214
+ } else {
215
+ return Optional.none();
216
+ }
217
+ }
218
+ bind(binder) {
219
+ if (this.tag) {
220
+ return binder(this.value);
221
+ } else {
222
+ return Optional.none();
223
+ }
224
+ }
225
+ exists(predicate) {
226
+ return this.tag && predicate(this.value);
227
+ }
228
+ forall(predicate) {
229
+ return !this.tag || predicate(this.value);
230
+ }
231
+ filter(predicate) {
232
+ if (!this.tag || predicate(this.value)) {
233
+ return this;
234
+ } else {
235
+ return Optional.none();
236
+ }
237
+ }
238
+ getOr(replacement) {
239
+ return this.tag ? this.value : replacement;
240
+ }
241
+ or(replacement) {
242
+ return this.tag ? this : replacement;
243
+ }
244
+ getOrThunk(thunk) {
245
+ return this.tag ? this.value : thunk();
246
+ }
247
+ orThunk(thunk) {
248
+ return this.tag ? this : thunk();
249
+ }
250
+ getOrDie(message) {
251
+ if (!this.tag) {
252
+ throw new Error(message !== null && message !== void 0 ? message : 'Called getOrDie on None');
253
+ } else {
254
+ return this.value;
255
+ }
256
+ }
257
+ static from(value) {
258
+ return isNonNullable(value) ? Optional.some(value) : Optional.none();
259
+ }
260
+ getOrNull() {
261
+ return this.tag ? this.value : null;
262
+ }
263
+ getOrUndefined() {
264
+ return this.value;
265
+ }
266
+ each(worker) {
267
+ if (this.tag) {
268
+ worker(this.value);
269
+ }
270
+ }
271
+ toArray() {
272
+ return this.tag ? [this.value] : [];
273
+ }
274
+ toString() {
275
+ return this.tag ? `some(${ this.value })` : 'none()';
276
+ }
277
+ }
278
+ Optional.singletonNone = new Optional(false);
279
+
280
+ typeof window !== 'undefined' ? window : Function('return this;')();
281
+
282
+ const ELEMENT = 1;
283
+
284
+ const name = element => {
285
+ const r = element.dom.nodeName;
286
+ return r.toLowerCase();
260
287
  };
261
- var Optional = {
262
- some: some,
263
- none: none,
264
- from: from
288
+
289
+ const has$1 = (element, key) => {
290
+ const dom = element.dom;
291
+ return dom && dom.hasAttribute ? dom.hasAttribute(key) : false;
265
292
  };
266
293
 
267
- function ClosestOrAncestor (is, ancestor, scope, a, isRoot) {
294
+ var ClosestOrAncestor = (is, ancestor, scope, a, isRoot) => {
268
295
  if (is(scope, a)) {
269
296
  return Optional.some(scope);
270
297
  } else if (isFunction(isRoot) && isRoot(scope)) {
@@ -272,53 +299,50 @@
272
299
  } else {
273
300
  return ancestor(scope, a, isRoot);
274
301
  }
275
- }
276
-
277
- var ELEMENT = 1;
302
+ };
278
303
 
279
- var fromHtml = function (html, scope) {
280
- var doc = scope || document;
281
- var div = doc.createElement('div');
304
+ const fromHtml = (html, scope) => {
305
+ const doc = scope || document;
306
+ const div = doc.createElement('div');
282
307
  div.innerHTML = html;
283
308
  if (!div.hasChildNodes() || div.childNodes.length > 1) {
284
- console.error('HTML does not have a single root node', html);
285
- throw new Error('HTML must have a single root node');
309
+ const message = 'HTML does not have a single root node';
310
+ console.error(message, html);
311
+ throw new Error(message);
286
312
  }
287
313
  return fromDom(div.childNodes[0]);
288
314
  };
289
- var fromTag = function (tag, scope) {
290
- var doc = scope || document;
291
- var node = doc.createElement(tag);
315
+ const fromTag = (tag, scope) => {
316
+ const doc = scope || document;
317
+ const node = doc.createElement(tag);
292
318
  return fromDom(node);
293
319
  };
294
- var fromText = function (text, scope) {
295
- var doc = scope || document;
296
- var node = doc.createTextNode(text);
320
+ const fromText = (text, scope) => {
321
+ const doc = scope || document;
322
+ const node = doc.createTextNode(text);
297
323
  return fromDom(node);
298
324
  };
299
- var fromDom = function (node) {
325
+ const fromDom = node => {
300
326
  if (node === null || node === undefined) {
301
327
  throw new Error('Node cannot be null or undefined');
302
328
  }
303
329
  return { dom: node };
304
330
  };
305
- var fromPoint = function (docElm, x, y) {
306
- return Optional.from(docElm.dom.elementFromPoint(x, y)).map(fromDom);
307
- };
308
- var SugarElement = {
309
- fromHtml: fromHtml,
310
- fromTag: fromTag,
311
- fromText: fromText,
312
- fromDom: fromDom,
313
- fromPoint: fromPoint
331
+ const fromPoint = (docElm, x, y) => Optional.from(docElm.dom.elementFromPoint(x, y)).map(fromDom);
332
+ const SugarElement = {
333
+ fromHtml,
334
+ fromTag,
335
+ fromText,
336
+ fromDom,
337
+ fromPoint
314
338
  };
315
339
 
316
- var is = function (element, selector) {
317
- var dom = element.dom;
340
+ const is = (element, selector) => {
341
+ const dom = element.dom;
318
342
  if (dom.nodeType !== ELEMENT) {
319
343
  return false;
320
344
  } else {
321
- var elem = dom;
345
+ const elem = dom;
322
346
  if (elem.matches !== undefined) {
323
347
  return elem.matches(selector);
324
348
  } else if (elem.msMatchesSelector !== undefined) {
@@ -333,19 +357,12 @@
333
357
  }
334
358
  };
335
359
 
336
- typeof window !== 'undefined' ? window : Function('return this;')();
337
-
338
- var name = function (element) {
339
- var r = element.dom.nodeName;
340
- return r.toLowerCase();
341
- };
342
-
343
- var ancestor$1 = function (scope, predicate, isRoot) {
344
- var element = scope.dom;
345
- var stop = isFunction(isRoot) ? isRoot : never;
360
+ const ancestor$1 = (scope, predicate, isRoot) => {
361
+ let element = scope.dom;
362
+ const stop = isFunction(isRoot) ? isRoot : never;
346
363
  while (element.parentNode) {
347
364
  element = element.parentNode;
348
- var el = SugarElement.fromDom(element);
365
+ const el = SugarElement.fromDom(element);
349
366
  if (predicate(el)) {
350
367
  return Optional.some(el);
351
368
  } else if (stop(el)) {
@@ -354,77 +371,28 @@
354
371
  }
355
372
  return Optional.none();
356
373
  };
357
- var closest$1 = function (scope, predicate, isRoot) {
358
- var is = function (s, test) {
359
- return test(s);
360
- };
374
+ const closest$2 = (scope, predicate, isRoot) => {
375
+ const is = (s, test) => test(s);
361
376
  return ClosestOrAncestor(is, ancestor$1, scope, predicate, isRoot);
362
377
  };
363
378
 
364
- var ancestor = function (scope, selector, isRoot) {
365
- return ancestor$1(scope, function (e) {
366
- return is(e, selector);
367
- }, isRoot);
368
- };
369
- var closest = function (scope, selector, isRoot) {
370
- var is$1 = function (element, selector) {
371
- return is(element, selector);
372
- };
373
- return ClosestOrAncestor(is$1, ancestor, scope, selector, isRoot);
374
- };
375
-
376
- var validDefaultOrDie = function (value, predicate) {
377
- if (predicate(value)) {
378
- return true;
379
- }
380
- throw new Error('Default value doesn\'t match requested type.');
381
- };
382
- var items = function (value, defaultValue) {
383
- if (isArray(value) || isObject(value)) {
384
- throw new Error('expected a string but found: ' + value);
385
- }
386
- if (isUndefined(value)) {
387
- return defaultValue;
388
- }
389
- if (isBoolean(value)) {
390
- return value === false ? '' : defaultValue;
391
- }
392
- return value;
393
- };
394
- var getToolbarItemsOr_ = function (predicate) {
395
- return function (editor, name, defaultValue) {
396
- validDefaultOrDie(defaultValue, predicate);
397
- var value = editor.getParam(name, defaultValue);
398
- return items(value, defaultValue);
399
- };
400
- };
401
- var getToolbarItemsOr = getToolbarItemsOr_(isString);
379
+ const closest$1 = (scope, predicate, isRoot) => closest$2(scope, predicate, isRoot).isSome();
402
380
 
403
- var getTextSelectionToolbarItems = function (editor) {
404
- return getToolbarItemsOr(editor, 'quickbars_selection_toolbar', 'bold italic | quicklink h2 h3 blockquote');
405
- };
406
- var getInsertToolbarItems = function (editor) {
407
- return getToolbarItemsOr(editor, 'quickbars_insert_toolbar', 'quickimage quicktable');
408
- };
409
- var getImageToolbarItems = function (editor) {
410
- return getToolbarItemsOr(editor, 'quickbars_image_toolbar', 'alignleft aligncenter alignright');
381
+ const ancestor = (scope, selector, isRoot) => ancestor$1(scope, e => is(e, selector), isRoot);
382
+ const closest = (scope, selector, isRoot) => {
383
+ const is$1 = (element, selector) => is(element, selector);
384
+ return ClosestOrAncestor(is$1, ancestor, scope, selector, isRoot);
411
385
  };
412
386
 
413
- var addToEditor$1 = function (editor) {
414
- var insertToolbarItems = getInsertToolbarItems(editor);
415
- if (insertToolbarItems.trim().length > 0) {
387
+ const addToEditor$1 = editor => {
388
+ const insertToolbarItems = getInsertToolbarItems(editor);
389
+ if (insertToolbarItems.length > 0) {
416
390
  editor.ui.registry.addContextToolbar('quickblock', {
417
- predicate: function (node) {
418
- var sugarNode = SugarElement.fromDom(node);
419
- var textBlockElementsMap = editor.schema.getTextBlockElements();
420
- var isRoot = function (elem) {
421
- return elem.dom === editor.getBody();
422
- };
423
- return closest(sugarNode, 'table', isRoot).fold(function () {
424
- return closest$1(sugarNode, function (elem) {
425
- return name(elem) in textBlockElementsMap && editor.dom.isEmpty(elem.dom);
426
- }, isRoot).isSome();
427
- }, never);
391
+ predicate: node => {
392
+ const sugarNode = SugarElement.fromDom(node);
393
+ const textBlockElementsMap = editor.schema.getTextBlockElements();
394
+ const isRoot = elem => elem.dom === editor.getBody();
395
+ return !has$1(sugarNode, 'data-mce-bogus') && closest(sugarNode, 'table,[data-mce-bogus="all"]', isRoot).fold(() => closest$1(sugarNode, elem => name(elem) in textBlockElementsMap && editor.dom.isEmpty(elem.dom), isRoot), never);
428
396
  },
429
397
  items: insertToolbarItems,
430
398
  position: 'line',
@@ -433,27 +401,31 @@
433
401
  }
434
402
  };
435
403
 
436
- var addToEditor = function (editor) {
437
- var isEditable = function (node) {
438
- return editor.dom.getContentEditableParent(node) !== 'false';
439
- };
440
- var isImage = function (node) {
441
- return node.nodeName === 'IMG' || node.nodeName === 'FIGURE' && /image/i.test(node.className);
404
+ const supports = element => element.dom.classList !== undefined;
405
+
406
+ const has = (element, clazz) => supports(element) && element.dom.classList.contains(clazz);
407
+
408
+ const addToEditor = editor => {
409
+ const isEditable = node => editor.dom.isEditable(node);
410
+ const isInEditableContext = el => isEditable(el.parentElement);
411
+ const isImage = node => {
412
+ const isImageFigure = node.nodeName === 'FIGURE' && /image/i.test(node.className);
413
+ const isImage = node.nodeName === 'IMG' || isImageFigure;
414
+ const isPagebreak = has(SugarElement.fromDom(node), 'mce-pagebreak');
415
+ return isImage && isInEditableContext(node) && !isPagebreak;
442
416
  };
443
- var imageToolbarItems = getImageToolbarItems(editor);
444
- if (imageToolbarItems.trim().length > 0) {
417
+ const imageToolbarItems = getImageToolbarItems(editor);
418
+ if (imageToolbarItems.length > 0) {
445
419
  editor.ui.registry.addContextToolbar('imageselection', {
446
420
  predicate: isImage,
447
421
  items: imageToolbarItems,
448
422
  position: 'node'
449
423
  });
450
424
  }
451
- var textToolbarItems = getTextSelectionToolbarItems(editor);
452
- if (textToolbarItems.trim().length > 0) {
425
+ const textToolbarItems = getTextSelectionToolbarItems(editor);
426
+ if (textToolbarItems.length > 0) {
453
427
  editor.ui.registry.addContextToolbar('textselection', {
454
- predicate: function (node) {
455
- return !isImage(node) && !editor.selection.isCollapsed() && isEditable(node);
456
- },
428
+ predicate: node => !isImage(node) && !editor.selection.isCollapsed() && isEditable(node),
457
429
  items: textToolbarItems,
458
430
  position: 'selection',
459
431
  scope: 'editor'
@@ -461,14 +433,15 @@
461
433
  }
462
434
  };
463
435
 
464
- function Plugin () {
465
- global$3.add('quickbars', function (editor) {
436
+ var Plugin = () => {
437
+ global$1.add('quickbars', editor => {
438
+ register(editor);
466
439
  setupButtons(editor);
467
440
  addToEditor$1(editor);
468
441
  addToEditor(editor);
469
442
  });
470
- }
443
+ };
471
444
 
472
445
  Plugin();
473
446
 
474
- }());
447
+ })();