@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,188 +1,180 @@
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 Cell = function (initial) {
13
- var value = initial;
14
- var get = function () {
8
+ const Cell = initial => {
9
+ let value = initial;
10
+ const get = () => {
15
11
  return value;
16
12
  };
17
- var set = function (v) {
13
+ const set = v => {
18
14
  value = v;
19
15
  };
20
16
  return {
21
- get: get,
22
- set: set
17
+ get,
18
+ set
23
19
  };
24
20
  };
25
21
 
26
- var global$1 = tinymce.util.Tools.resolve('tinymce.PluginManager');
22
+ var global = tinymce.util.Tools.resolve('tinymce.PluginManager');
27
23
 
28
- var get$2 = function (toggleState) {
29
- var isEnabled = function () {
24
+ const get$2 = toggleState => {
25
+ const isEnabled = () => {
30
26
  return toggleState.get();
31
27
  };
32
- return { isEnabled: isEnabled };
28
+ return { isEnabled };
33
29
  };
34
30
 
35
- var fireVisualChars = function (editor, state) {
36
- return editor.fire('VisualChars', { state: state });
31
+ const fireVisualChars = (editor, state) => {
32
+ return editor.dispatch('VisualChars', { state });
37
33
  };
38
34
 
39
- var typeOf = function (x) {
40
- var t = typeof x;
35
+ const hasProto = (v, constructor, predicate) => {
36
+ var _a;
37
+ if (predicate(v, constructor.prototype)) {
38
+ return true;
39
+ } else {
40
+ return ((_a = v.constructor) === null || _a === void 0 ? void 0 : _a.name) === constructor.name;
41
+ }
42
+ };
43
+ const typeOf = x => {
44
+ const t = typeof x;
41
45
  if (x === null) {
42
46
  return 'null';
43
- } else if (t === 'object' && (Array.prototype.isPrototypeOf(x) || x.constructor && x.constructor.name === 'Array')) {
47
+ } else if (t === 'object' && Array.isArray(x)) {
44
48
  return 'array';
45
- } else if (t === 'object' && (String.prototype.isPrototypeOf(x) || x.constructor && x.constructor.name === 'String')) {
49
+ } else if (t === 'object' && hasProto(x, String, (o, proto) => proto.isPrototypeOf(o))) {
46
50
  return 'string';
47
51
  } else {
48
52
  return t;
49
53
  }
50
54
  };
51
- var isType$1 = function (type) {
52
- return function (value) {
53
- return typeOf(value) === type;
54
- };
55
- };
56
- var isSimpleType = function (type) {
57
- return function (value) {
58
- return typeof value === type;
59
- };
60
- };
61
- var isString = isType$1('string');
62
- var isBoolean = isSimpleType('boolean');
63
- var isNumber = isSimpleType('number');
64
-
65
- var noop = function () {
66
- };
67
- var constant = function (value) {
68
- return function () {
69
- return value;
70
- };
71
- };
72
- var identity = function (x) {
73
- return x;
74
- };
75
- var never = constant(false);
76
- var always = constant(true);
55
+ const isType$1 = type => value => typeOf(value) === type;
56
+ const isSimpleType = type => value => typeof value === type;
57
+ const eq = t => a => t === a;
58
+ const isString = isType$1('string');
59
+ const isObject = isType$1('object');
60
+ const isNull = eq(null);
61
+ const isBoolean = isSimpleType('boolean');
62
+ const isNullable = a => a === null || a === undefined;
63
+ const isNonNullable = a => !isNullable(a);
64
+ const isNumber = isSimpleType('number');
77
65
 
78
- var none = function () {
79
- return NONE;
80
- };
81
- var NONE = function () {
82
- var call = function (thunk) {
83
- return thunk();
84
- };
85
- var id = identity;
86
- var me = {
87
- fold: function (n, _s) {
88
- return n();
89
- },
90
- isSome: never,
91
- isNone: always,
92
- getOr: id,
93
- getOrThunk: call,
94
- getOrDie: function (msg) {
95
- throw new Error(msg || 'error: getOrDie called on none.');
96
- },
97
- getOrNull: constant(null),
98
- getOrUndefined: constant(undefined),
99
- or: id,
100
- orThunk: call,
101
- map: none,
102
- each: noop,
103
- bind: none,
104
- exists: never,
105
- forall: always,
106
- filter: function () {
107
- return none();
108
- },
109
- toArray: function () {
110
- return [];
111
- },
112
- toString: constant('none()')
113
- };
114
- return me;
115
- }();
116
- var some = function (a) {
117
- var constant_a = constant(a);
118
- var self = function () {
119
- return me;
120
- };
121
- var bind = function (f) {
122
- return f(a);
123
- };
124
- var me = {
125
- fold: function (n, s) {
126
- return s(a);
127
- },
128
- isSome: always,
129
- isNone: never,
130
- getOr: constant_a,
131
- getOrThunk: constant_a,
132
- getOrDie: constant_a,
133
- getOrNull: constant_a,
134
- getOrUndefined: constant_a,
135
- or: self,
136
- orThunk: self,
137
- map: function (f) {
138
- return some(f(a));
139
- },
140
- each: function (f) {
141
- f(a);
142
- },
143
- bind: bind,
144
- exists: bind,
145
- forall: bind,
146
- filter: function (f) {
147
- return f(a) ? me : NONE;
148
- },
149
- toArray: function () {
150
- return [a];
151
- },
152
- toString: function () {
153
- return 'some(' + a + ')';
66
+ class Optional {
67
+ constructor(tag, value) {
68
+ this.tag = tag;
69
+ this.value = value;
70
+ }
71
+ static some(value) {
72
+ return new Optional(true, value);
73
+ }
74
+ static none() {
75
+ return Optional.singletonNone;
76
+ }
77
+ fold(onNone, onSome) {
78
+ if (this.tag) {
79
+ return onSome(this.value);
80
+ } else {
81
+ return onNone();
154
82
  }
155
- };
156
- return me;
157
- };
158
- var from = function (value) {
159
- return value === null || value === undefined ? NONE : some(value);
160
- };
161
- var Optional = {
162
- some: some,
163
- none: none,
164
- from: from
165
- };
83
+ }
84
+ isSome() {
85
+ return this.tag;
86
+ }
87
+ isNone() {
88
+ return !this.tag;
89
+ }
90
+ map(mapper) {
91
+ if (this.tag) {
92
+ return Optional.some(mapper(this.value));
93
+ } else {
94
+ return Optional.none();
95
+ }
96
+ }
97
+ bind(binder) {
98
+ if (this.tag) {
99
+ return binder(this.value);
100
+ } else {
101
+ return Optional.none();
102
+ }
103
+ }
104
+ exists(predicate) {
105
+ return this.tag && predicate(this.value);
106
+ }
107
+ forall(predicate) {
108
+ return !this.tag || predicate(this.value);
109
+ }
110
+ filter(predicate) {
111
+ if (!this.tag || predicate(this.value)) {
112
+ return this;
113
+ } else {
114
+ return Optional.none();
115
+ }
116
+ }
117
+ getOr(replacement) {
118
+ return this.tag ? this.value : replacement;
119
+ }
120
+ or(replacement) {
121
+ return this.tag ? this : replacement;
122
+ }
123
+ getOrThunk(thunk) {
124
+ return this.tag ? this.value : thunk();
125
+ }
126
+ orThunk(thunk) {
127
+ return this.tag ? this : thunk();
128
+ }
129
+ getOrDie(message) {
130
+ if (!this.tag) {
131
+ throw new Error(message !== null && message !== void 0 ? message : 'Called getOrDie on None');
132
+ } else {
133
+ return this.value;
134
+ }
135
+ }
136
+ static from(value) {
137
+ return isNonNullable(value) ? Optional.some(value) : Optional.none();
138
+ }
139
+ getOrNull() {
140
+ return this.tag ? this.value : null;
141
+ }
142
+ getOrUndefined() {
143
+ return this.value;
144
+ }
145
+ each(worker) {
146
+ if (this.tag) {
147
+ worker(this.value);
148
+ }
149
+ }
150
+ toArray() {
151
+ return this.tag ? [this.value] : [];
152
+ }
153
+ toString() {
154
+ return this.tag ? `some(${ this.value })` : 'none()';
155
+ }
156
+ }
157
+ Optional.singletonNone = new Optional(false);
166
158
 
167
- var map = function (xs, f) {
168
- var len = xs.length;
169
- var r = new Array(len);
170
- for (var i = 0; i < len; i++) {
171
- var x = xs[i];
159
+ const map = (xs, f) => {
160
+ const len = xs.length;
161
+ const r = new Array(len);
162
+ for (let i = 0; i < len; i++) {
163
+ const x = xs[i];
172
164
  r[i] = f(x, i);
173
165
  }
174
166
  return r;
175
167
  };
176
- var each$1 = function (xs, f) {
177
- for (var i = 0, len = xs.length; i < len; i++) {
178
- var x = xs[i];
168
+ const each$1 = (xs, f) => {
169
+ for (let i = 0, len = xs.length; i < len; i++) {
170
+ const x = xs[i];
179
171
  f(x, i);
180
172
  }
181
173
  };
182
- var filter = function (xs, pred) {
183
- var r = [];
184
- for (var i = 0, len = xs.length; i < len; i++) {
185
- var x = xs[i];
174
+ const filter = (xs, pred) => {
175
+ const r = [];
176
+ for (let i = 0, len = xs.length; i < len; i++) {
177
+ const x = xs[i];
186
178
  if (pred(x, i)) {
187
179
  r.push(x);
188
180
  }
@@ -190,34 +182,61 @@
190
182
  return r;
191
183
  };
192
184
 
193
- var keys = Object.keys;
194
- var each = function (obj, f) {
195
- var props = keys(obj);
196
- for (var k = 0, len = props.length; k < len; k++) {
197
- var i = props[k];
198
- var x = obj[i];
185
+ const keys = Object.keys;
186
+ const each = (obj, f) => {
187
+ const props = keys(obj);
188
+ for (let k = 0, len = props.length; k < len; k++) {
189
+ const i = props[k];
190
+ const x = obj[i];
199
191
  f(x, i);
200
192
  }
201
193
  };
202
194
 
203
- typeof window !== 'undefined' ? window : Function('return this;')();
195
+ const Global = typeof window !== 'undefined' ? window : Function('return this;')();
204
196
 
205
- var TEXT = 3;
197
+ const path = (parts, scope) => {
198
+ let o = scope !== undefined && scope !== null ? scope : Global;
199
+ for (let i = 0; i < parts.length && o !== undefined && o !== null; ++i) {
200
+ o = o[parts[i]];
201
+ }
202
+ return o;
203
+ };
204
+ const resolve = (p, scope) => {
205
+ const parts = p.split('.');
206
+ return path(parts, scope);
207
+ };
206
208
 
207
- var type = function (element) {
208
- return element.dom.nodeType;
209
+ const unsafe = (name, scope) => {
210
+ return resolve(name, scope);
211
+ };
212
+ const getOrDie = (name, scope) => {
213
+ const actual = unsafe(name, scope);
214
+ if (actual === undefined || actual === null) {
215
+ throw new Error(name + ' not available on this browser');
216
+ }
217
+ return actual;
209
218
  };
210
- var value = function (element) {
211
- return element.dom.nodeValue;
219
+
220
+ const getPrototypeOf = Object.getPrototypeOf;
221
+ const sandHTMLElement = scope => {
222
+ return getOrDie('HTMLElement', scope);
212
223
  };
213
- var isType = function (t) {
214
- return function (element) {
215
- return type(element) === t;
216
- };
224
+ const isPrototypeOf = x => {
225
+ const scope = resolve('ownerDocument.defaultView', x);
226
+ return isObject(x) && (sandHTMLElement(scope).prototype.isPrototypeOf(x) || /^HTML\w*Element$/.test(getPrototypeOf(x).constructor.name));
217
227
  };
218
- var isText = isType(TEXT);
219
228
 
220
- var rawSet = function (dom, key, value) {
229
+ const ELEMENT = 1;
230
+ const TEXT = 3;
231
+
232
+ const type = element => element.dom.nodeType;
233
+ const value = element => element.dom.nodeValue;
234
+ const isType = t => element => type(element) === t;
235
+ const isHTMLElement = element => isElement(element) && isPrototypeOf(element.dom);
236
+ const isElement = isType(ELEMENT);
237
+ const isText = isType(TEXT);
238
+
239
+ const rawSet = (dom, key, value) => {
221
240
  if (isString(value) || isBoolean(value) || isNumber(value)) {
222
241
  dom.setAttribute(key, value + '');
223
242
  } else {
@@ -225,31 +244,29 @@
225
244
  throw new Error('Attribute value was not simple');
226
245
  }
227
246
  };
228
- var set = function (element, key, value) {
247
+ const set = (element, key, value) => {
229
248
  rawSet(element.dom, key, value);
230
249
  };
231
- var get$1 = function (element, key) {
232
- var v = element.dom.getAttribute(key);
250
+ const get$1 = (element, key) => {
251
+ const v = element.dom.getAttribute(key);
233
252
  return v === null ? undefined : v;
234
253
  };
235
- var remove$3 = function (element, key) {
254
+ const remove$3 = (element, key) => {
236
255
  element.dom.removeAttribute(key);
237
256
  };
238
257
 
239
- var read = function (element, attr) {
240
- var value = get$1(element, attr);
258
+ const read = (element, attr) => {
259
+ const value = get$1(element, attr);
241
260
  return value === undefined || value === '' ? [] : value.split(' ');
242
261
  };
243
- var add$2 = function (element, attr, id) {
244
- var old = read(element, attr);
245
- var nu = old.concat([id]);
262
+ const add$2 = (element, attr, id) => {
263
+ const old = read(element, attr);
264
+ const nu = old.concat([id]);
246
265
  set(element, attr, nu.join(' '));
247
266
  return true;
248
267
  };
249
- var remove$2 = function (element, attr, id) {
250
- var nu = filter(read(element, attr), function (v) {
251
- return v !== id;
252
- });
268
+ const remove$2 = (element, attr, id) => {
269
+ const nu = filter(read(element, attr), v => v !== id);
253
270
  if (nu.length > 0) {
254
271
  set(element, attr, nu.join(' '));
255
272
  } else {
@@ -258,35 +275,27 @@
258
275
  return false;
259
276
  };
260
277
 
261
- var supports = function (element) {
262
- return element.dom.classList !== undefined;
263
- };
264
- var get = function (element) {
265
- return read(element, 'class');
266
- };
267
- var add$1 = function (element, clazz) {
268
- return add$2(element, 'class', clazz);
269
- };
270
- var remove$1 = function (element, clazz) {
271
- return remove$2(element, 'class', clazz);
272
- };
278
+ const supports = element => element.dom.classList !== undefined;
279
+ const get = element => read(element, 'class');
280
+ const add$1 = (element, clazz) => add$2(element, 'class', clazz);
281
+ const remove$1 = (element, clazz) => remove$2(element, 'class', clazz);
273
282
 
274
- var add = function (element, clazz) {
283
+ const add = (element, clazz) => {
275
284
  if (supports(element)) {
276
285
  element.dom.classList.add(clazz);
277
286
  } else {
278
287
  add$1(element, clazz);
279
288
  }
280
289
  };
281
- var cleanClass = function (element) {
282
- var classList = supports(element) ? element.dom.classList : get(element);
290
+ const cleanClass = element => {
291
+ const classList = supports(element) ? element.dom.classList : get(element);
283
292
  if (classList.length === 0) {
284
293
  remove$3(element, 'class');
285
294
  }
286
295
  };
287
- var remove = function (element, clazz) {
296
+ const remove = (element, clazz) => {
288
297
  if (supports(element)) {
289
- var classList = element.dom.classList;
298
+ const classList = element.dom.classList;
290
299
  classList.remove(clazz);
291
300
  } else {
292
301
  remove$1(element, clazz);
@@ -294,57 +303,56 @@
294
303
  cleanClass(element);
295
304
  };
296
305
 
297
- var fromHtml = function (html, scope) {
298
- var doc = scope || document;
299
- var div = doc.createElement('div');
306
+ const fromHtml = (html, scope) => {
307
+ const doc = scope || document;
308
+ const div = doc.createElement('div');
300
309
  div.innerHTML = html;
301
310
  if (!div.hasChildNodes() || div.childNodes.length > 1) {
302
- console.error('HTML does not have a single root node', html);
303
- throw new Error('HTML must have a single root node');
311
+ const message = 'HTML does not have a single root node';
312
+ console.error(message, html);
313
+ throw new Error(message);
304
314
  }
305
315
  return fromDom(div.childNodes[0]);
306
316
  };
307
- var fromTag = function (tag, scope) {
308
- var doc = scope || document;
309
- var node = doc.createElement(tag);
317
+ const fromTag = (tag, scope) => {
318
+ const doc = scope || document;
319
+ const node = doc.createElement(tag);
310
320
  return fromDom(node);
311
321
  };
312
- var fromText = function (text, scope) {
313
- var doc = scope || document;
314
- var node = doc.createTextNode(text);
322
+ const fromText = (text, scope) => {
323
+ const doc = scope || document;
324
+ const node = doc.createTextNode(text);
315
325
  return fromDom(node);
316
326
  };
317
- var fromDom = function (node) {
327
+ const fromDom = node => {
318
328
  if (node === null || node === undefined) {
319
329
  throw new Error('Node cannot be null or undefined');
320
330
  }
321
331
  return { dom: node };
322
332
  };
323
- var fromPoint = function (docElm, x, y) {
324
- return Optional.from(docElm.dom.elementFromPoint(x, y)).map(fromDom);
325
- };
326
- var SugarElement = {
327
- fromHtml: fromHtml,
328
- fromTag: fromTag,
329
- fromText: fromText,
330
- fromDom: fromDom,
331
- fromPoint: fromPoint
333
+ const fromPoint = (docElm, x, y) => Optional.from(docElm.dom.elementFromPoint(x, y)).map(fromDom);
334
+ const SugarElement = {
335
+ fromHtml,
336
+ fromTag,
337
+ fromText,
338
+ fromDom,
339
+ fromPoint
332
340
  };
333
341
 
334
- var charMap = {
342
+ const charMap = {
335
343
  '\xA0': 'nbsp',
336
344
  '\xAD': 'shy'
337
345
  };
338
- var charMapToRegExp = function (charMap, global) {
339
- var regExp = '';
340
- each(charMap, function (_value, key) {
346
+ const charMapToRegExp = (charMap, global) => {
347
+ let regExp = '';
348
+ each(charMap, (_value, key) => {
341
349
  regExp += key;
342
350
  });
343
351
  return new RegExp('[' + regExp + ']', global ? 'g' : '');
344
352
  };
345
- var charMapToSelector = function (charMap) {
346
- var selector = '';
347
- each(charMap, function (value) {
353
+ const charMapToSelector = charMap => {
354
+ let selector = '';
355
+ each(charMap, value => {
348
356
  if (selector) {
349
357
  selector += ',';
350
358
  }
@@ -352,66 +360,78 @@
352
360
  });
353
361
  return selector;
354
362
  };
355
- var regExp = charMapToRegExp(charMap);
356
- var regExpGlobal = charMapToRegExp(charMap, true);
357
- var selector = charMapToSelector(charMap);
358
- var nbspClass = 'mce-nbsp';
363
+ const regExp = charMapToRegExp(charMap);
364
+ const regExpGlobal = charMapToRegExp(charMap, true);
365
+ const selector = charMapToSelector(charMap);
366
+ const nbspClass = 'mce-nbsp';
359
367
 
360
- var wrapCharWithSpan = function (value) {
361
- return '<span data-mce-bogus="1" class="mce-' + charMap[value] + '">' + value + '</span>';
362
- };
368
+ const getRaw = element => element.dom.contentEditable;
363
369
 
364
- var isMatch = function (n) {
365
- var value$1 = value(n);
366
- return isText(n) && value$1 !== undefined && regExp.test(value$1);
367
- };
368
- var filterDescendants = function (scope, predicate) {
369
- var result = [];
370
- var dom = scope.dom;
371
- var children = map(dom.childNodes, SugarElement.fromDom);
372
- each$1(children, function (x) {
373
- if (predicate(x)) {
370
+ const wrapCharWithSpan = value => '<span data-mce-bogus="1" class="mce-' + charMap[value] + '">' + value + '</span>';
371
+
372
+ const isWrappedNbsp = node => node.nodeName.toLowerCase() === 'span' && node.classList.contains('mce-nbsp-wrap');
373
+ const isMatch = n => {
374
+ const value$1 = value(n);
375
+ return isText(n) && isString(value$1) && regExp.test(value$1);
376
+ };
377
+ const isContentEditableFalse = node => isHTMLElement(node) && getRaw(node) === 'false';
378
+ const isChildEditable = (node, currentState) => {
379
+ if (isHTMLElement(node) && !isWrappedNbsp(node.dom)) {
380
+ const value = getRaw(node);
381
+ if (value === 'true') {
382
+ return true;
383
+ } else if (value === 'false') {
384
+ return false;
385
+ }
386
+ }
387
+ return currentState;
388
+ };
389
+ const filterEditableDescendants = (scope, predicate, editable) => {
390
+ let result = [];
391
+ const dom = scope.dom;
392
+ const children = map(dom.childNodes, SugarElement.fromDom);
393
+ const isEditable = node => isWrappedNbsp(node.dom) || !isContentEditableFalse(node);
394
+ each$1(children, x => {
395
+ if (editable && isEditable(x) && predicate(x)) {
374
396
  result = result.concat([x]);
375
397
  }
376
- result = result.concat(filterDescendants(x, predicate));
398
+ result = result.concat(filterEditableDescendants(x, predicate, isChildEditable(x, editable)));
377
399
  });
378
400
  return result;
379
401
  };
380
- var findParentElm = function (elm, rootElm) {
402
+ const findParentElm = (elm, rootElm) => {
381
403
  while (elm.parentNode) {
382
404
  if (elm.parentNode === rootElm) {
383
- return elm;
405
+ return rootElm;
384
406
  }
385
407
  elm = elm.parentNode;
386
408
  }
409
+ return undefined;
387
410
  };
388
- var replaceWithSpans = function (text) {
389
- return text.replace(regExpGlobal, wrapCharWithSpan);
390
- };
411
+ const replaceWithSpans = text => text.replace(regExpGlobal, wrapCharWithSpan);
391
412
 
392
- var isWrappedNbsp = function (node) {
393
- return node.nodeName.toLowerCase() === 'span' && node.classList.contains('mce-nbsp-wrap');
394
- };
395
- var show = function (editor, rootElm) {
396
- var nodeList = filterDescendants(SugarElement.fromDom(rootElm), isMatch);
397
- each$1(nodeList, function (n) {
398
- var parent = n.dom.parentNode;
413
+ const show = (editor, rootElm) => {
414
+ const dom = editor.dom;
415
+ const nodeList = filterEditableDescendants(SugarElement.fromDom(rootElm), isMatch, editor.dom.isEditable(rootElm));
416
+ each$1(nodeList, n => {
417
+ var _a;
418
+ const parent = n.dom.parentNode;
399
419
  if (isWrappedNbsp(parent)) {
400
420
  add(SugarElement.fromDom(parent), nbspClass);
401
421
  } else {
402
- var withSpans = replaceWithSpans(editor.dom.encode(value(n)));
403
- var div = editor.dom.create('div', null, withSpans);
404
- var node = void 0;
422
+ const withSpans = replaceWithSpans(dom.encode((_a = value(n)) !== null && _a !== void 0 ? _a : ''));
423
+ const div = dom.create('div', {}, withSpans);
424
+ let node;
405
425
  while (node = div.lastChild) {
406
- editor.dom.insertAfter(node, n.dom);
426
+ dom.insertAfter(node, n.dom);
407
427
  }
408
428
  editor.dom.remove(n.dom);
409
429
  }
410
430
  });
411
431
  };
412
- var hide = function (editor, rootElm) {
413
- var nodeList = editor.dom.select(selector, rootElm);
414
- each$1(nodeList, function (node) {
432
+ const hide = (editor, rootElm) => {
433
+ const nodeList = editor.dom.select(selector, rootElm);
434
+ each$1(nodeList, node => {
415
435
  if (isWrappedNbsp(node)) {
416
436
  remove(SugarElement.fromDom(node), nbspClass);
417
437
  } else {
@@ -419,108 +439,122 @@
419
439
  }
420
440
  });
421
441
  };
422
- var toggle = function (editor) {
423
- var body = editor.getBody();
424
- var bookmark = editor.selection.getBookmark();
425
- var parentNode = findParentElm(editor.selection.getNode(), body);
442
+ const toggle = editor => {
443
+ const body = editor.getBody();
444
+ const bookmark = editor.selection.getBookmark();
445
+ let parentNode = findParentElm(editor.selection.getNode(), body);
426
446
  parentNode = parentNode !== undefined ? parentNode : body;
427
447
  hide(editor, parentNode);
428
448
  show(editor, parentNode);
429
449
  editor.selection.moveToBookmark(bookmark);
430
450
  };
431
451
 
432
- var applyVisualChars = function (editor, toggleState) {
452
+ const applyVisualChars = (editor, toggleState) => {
433
453
  fireVisualChars(editor, toggleState.get());
434
- var body = editor.getBody();
454
+ const body = editor.getBody();
435
455
  if (toggleState.get() === true) {
436
456
  show(editor, body);
437
457
  } else {
438
458
  hide(editor, body);
439
459
  }
440
460
  };
441
- var toggleVisualChars = function (editor, toggleState) {
461
+ const toggleVisualChars = (editor, toggleState) => {
442
462
  toggleState.set(!toggleState.get());
443
- var bookmark = editor.selection.getBookmark();
463
+ const bookmark = editor.selection.getBookmark();
444
464
  applyVisualChars(editor, toggleState);
445
465
  editor.selection.moveToBookmark(bookmark);
446
466
  };
447
467
 
448
- var register$1 = function (editor, toggleState) {
449
- editor.addCommand('mceVisualChars', function () {
468
+ const register$2 = (editor, toggleState) => {
469
+ editor.addCommand('mceVisualChars', () => {
450
470
  toggleVisualChars(editor, toggleState);
451
471
  });
452
472
  };
453
473
 
454
- var isEnabledByDefault = function (editor) {
455
- return editor.getParam('visualchars_default_state', false);
456
- };
457
- var hasForcedRootBlock = function (editor) {
458
- return editor.getParam('forced_root_block') !== false;
474
+ const option = name => editor => editor.options.get(name);
475
+ const register$1 = editor => {
476
+ const registerOption = editor.options.register;
477
+ registerOption('visualchars_default_state', {
478
+ processor: 'boolean',
479
+ default: false
480
+ });
459
481
  };
482
+ const isEnabledByDefault = option('visualchars_default_state');
460
483
 
461
- var setup$1 = function (editor, toggleState) {
462
- editor.on('init', function () {
484
+ const setup$1 = (editor, toggleState) => {
485
+ editor.on('init', () => {
463
486
  applyVisualChars(editor, toggleState);
464
487
  });
465
488
  };
466
489
 
467
- var global = tinymce.util.Tools.resolve('tinymce.util.Delay');
490
+ const first = (fn, rate) => {
491
+ let timer = null;
492
+ const cancel = () => {
493
+ if (!isNull(timer)) {
494
+ clearTimeout(timer);
495
+ timer = null;
496
+ }
497
+ };
498
+ const throttle = (...args) => {
499
+ if (isNull(timer)) {
500
+ timer = setTimeout(() => {
501
+ timer = null;
502
+ fn.apply(null, args);
503
+ }, rate);
504
+ }
505
+ };
506
+ return {
507
+ cancel,
508
+ throttle
509
+ };
510
+ };
468
511
 
469
- var setup = function (editor, toggleState) {
470
- var debouncedToggle = global.debounce(function () {
512
+ const setup = (editor, toggleState) => {
513
+ const debouncedToggle = first(() => {
471
514
  toggle(editor);
472
515
  }, 300);
473
- if (hasForcedRootBlock(editor)) {
474
- editor.on('keydown', function (e) {
475
- if (toggleState.get() === true) {
476
- e.keyCode === 13 ? toggle(editor) : debouncedToggle();
477
- }
478
- });
479
- }
480
- editor.on('remove', debouncedToggle.stop);
516
+ editor.on('keydown', e => {
517
+ if (toggleState.get() === true) {
518
+ e.keyCode === 13 ? toggle(editor) : debouncedToggle.throttle();
519
+ }
520
+ });
521
+ editor.on('remove', debouncedToggle.cancel);
481
522
  };
482
523
 
483
- var toggleActiveState = function (editor, enabledStated) {
484
- return function (api) {
485
- api.setActive(enabledStated.get());
486
- var editorEventCallback = function (e) {
487
- return api.setActive(e.state);
488
- };
489
- editor.on('VisualChars', editorEventCallback);
490
- return function () {
491
- return editor.off('VisualChars', editorEventCallback);
492
- };
493
- };
494
- };
495
- var register = function (editor, toggleState) {
496
- var onAction = function () {
497
- return editor.execCommand('mceVisualChars');
498
- };
524
+ const toggleActiveState = (editor, enabledStated) => api => {
525
+ api.setActive(enabledStated.get());
526
+ const editorEventCallback = e => api.setActive(e.state);
527
+ editor.on('VisualChars', editorEventCallback);
528
+ return () => editor.off('VisualChars', editorEventCallback);
529
+ };
530
+ const register = (editor, toggleState) => {
531
+ const onAction = () => editor.execCommand('mceVisualChars');
499
532
  editor.ui.registry.addToggleButton('visualchars', {
500
533
  tooltip: 'Show invisible characters',
501
534
  icon: 'visualchars',
502
- onAction: onAction,
535
+ onAction,
503
536
  onSetup: toggleActiveState(editor, toggleState)
504
537
  });
505
538
  editor.ui.registry.addToggleMenuItem('visualchars', {
506
539
  text: 'Show invisible characters',
507
540
  icon: 'visualchars',
508
- onAction: onAction,
541
+ onAction,
509
542
  onSetup: toggleActiveState(editor, toggleState)
510
543
  });
511
544
  };
512
545
 
513
- function Plugin () {
514
- global$1.add('visualchars', function (editor) {
515
- var toggleState = Cell(isEnabledByDefault(editor));
516
- register$1(editor, toggleState);
546
+ var Plugin = () => {
547
+ global.add('visualchars', editor => {
548
+ register$1(editor);
549
+ const toggleState = Cell(isEnabledByDefault(editor));
550
+ register$2(editor, toggleState);
517
551
  register(editor, toggleState);
518
552
  setup(editor, toggleState);
519
553
  setup$1(editor, toggleState);
520
554
  return get$2(toggleState);
521
555
  });
522
- }
556
+ };
523
557
 
524
558
  Plugin();
525
559
 
526
- }());
560
+ })();