@dangl/angular-material-shared 2.5.1-beta0012 → 2.6.0-beta0019

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,74 +1,56 @@
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 hasOwnProperty = Object.hasOwnProperty;
27
- var has = function (obj, key) {
28
- return hasOwnProperty.call(obj, key);
29
- };
30
-
31
- var global$2 = tinymce.util.Tools.resolve('tinymce.PluginManager');
22
+ var global$1 = tinymce.util.Tools.resolve('tinymce.PluginManager');
32
23
 
33
- var global$1 = tinymce.util.Tools.resolve('tinymce.Env');
24
+ const constant = value => {
25
+ return () => {
26
+ return value;
27
+ };
28
+ };
34
29
 
35
- var global = tinymce.util.Tools.resolve('tinymce.util.Delay');
30
+ var global = tinymce.util.Tools.resolve('tinymce.Env');
36
31
 
37
- var fireResizeEditor = function (editor) {
38
- return editor.fire('ResizeEditor');
39
- };
32
+ const fireResizeEditor = editor => editor.dispatch('ResizeEditor');
40
33
 
41
- var getAutoResizeMinHeight = function (editor) {
42
- return editor.getParam('min_height', editor.getElement().offsetHeight, 'number');
43
- };
44
- var getAutoResizeMaxHeight = function (editor) {
45
- return editor.getParam('max_height', 0, 'number');
46
- };
47
- var getAutoResizeOverflowPadding = function (editor) {
48
- return editor.getParam('autoresize_overflow_padding', 1, 'number');
49
- };
50
- var getAutoResizeBottomMargin = function (editor) {
51
- return editor.getParam('autoresize_bottom_margin', 50, 'number');
52
- };
53
- var shouldAutoResizeOnInit = function (editor) {
54
- return editor.getParam('autoresize_on_init', true, 'boolean');
34
+ const option = name => editor => editor.options.get(name);
35
+ const register$1 = editor => {
36
+ const registerOption = editor.options.register;
37
+ registerOption('autoresize_overflow_padding', {
38
+ processor: 'number',
39
+ default: 1
40
+ });
41
+ registerOption('autoresize_bottom_margin', {
42
+ processor: 'number',
43
+ default: 50
44
+ });
55
45
  };
46
+ const getMinHeight = option('min_height');
47
+ const getMaxHeight = option('max_height');
48
+ const getAutoResizeOverflowPadding = option('autoresize_overflow_padding');
49
+ const getAutoResizeBottomMargin = option('autoresize_bottom_margin');
56
50
 
57
- var isFullscreen = function (editor) {
58
- return editor.plugins.fullscreen && editor.plugins.fullscreen.isFullscreen();
59
- };
60
- var wait = function (editor, oldSize, times, interval, callback) {
61
- global.setEditorTimeout(editor, function () {
62
- resize(editor, oldSize);
63
- if (times--) {
64
- wait(editor, oldSize, times, interval, callback);
65
- } else if (callback) {
66
- callback();
67
- }
68
- }, interval);
69
- };
70
- var toggleScrolling = function (editor, state) {
71
- var body = editor.getBody();
51
+ const isFullscreen = editor => editor.plugins.fullscreen && editor.plugins.fullscreen.isFullscreen();
52
+ const toggleScrolling = (editor, state) => {
53
+ const body = editor.getBody();
72
54
  if (body) {
73
55
  body.style.overflowY = state ? '' : 'hidden';
74
56
  if (!state) {
@@ -76,21 +58,23 @@
76
58
  }
77
59
  }
78
60
  };
79
- var parseCssValueToInt = function (dom, elm, name, computed) {
80
- var value = parseInt(dom.getStyle(elm, name, computed), 10);
61
+ const parseCssValueToInt = (dom, elm, name, computed) => {
62
+ var _a;
63
+ const value = parseInt((_a = dom.getStyle(elm, name, computed)) !== null && _a !== void 0 ? _a : '', 10);
81
64
  return isNaN(value) ? 0 : value;
82
65
  };
83
- var shouldScrollIntoView = function (trigger) {
66
+ const shouldScrollIntoView = trigger => {
84
67
  if ((trigger === null || trigger === void 0 ? void 0 : trigger.type.toLowerCase()) === 'setcontent') {
85
- var setContentEvent = trigger;
68
+ const setContentEvent = trigger;
86
69
  return setContentEvent.selection === true || setContentEvent.paste === true;
87
70
  } else {
88
71
  return false;
89
72
  }
90
73
  };
91
- var resize = function (editor, oldSize, trigger) {
92
- var dom = editor.dom;
93
- var doc = editor.getDoc();
74
+ const resize = (editor, oldSize, trigger, getExtraMarginBottom) => {
75
+ var _a;
76
+ const dom = editor.dom;
77
+ const doc = editor.getDoc();
94
78
  if (!doc) {
95
79
  return;
96
80
  }
@@ -98,22 +82,23 @@
98
82
  toggleScrolling(editor, true);
99
83
  return;
100
84
  }
101
- var docEle = doc.documentElement;
102
- var resizeBottomMargin = getAutoResizeBottomMargin(editor);
103
- var resizeHeight = getAutoResizeMinHeight(editor);
104
- var marginTop = parseCssValueToInt(dom, docEle, 'margin-top', true);
105
- var marginBottom = parseCssValueToInt(dom, docEle, 'margin-bottom', true);
106
- var contentHeight = docEle.offsetHeight + marginTop + marginBottom + resizeBottomMargin;
85
+ const docEle = doc.documentElement;
86
+ const resizeBottomMargin = getExtraMarginBottom ? getExtraMarginBottom() : getAutoResizeOverflowPadding(editor);
87
+ const minHeight = (_a = getMinHeight(editor)) !== null && _a !== void 0 ? _a : editor.getElement().offsetHeight;
88
+ let resizeHeight = minHeight;
89
+ const marginTop = parseCssValueToInt(dom, docEle, 'margin-top', true);
90
+ const marginBottom = parseCssValueToInt(dom, docEle, 'margin-bottom', true);
91
+ let contentHeight = docEle.offsetHeight + marginTop + marginBottom + resizeBottomMargin;
107
92
  if (contentHeight < 0) {
108
93
  contentHeight = 0;
109
94
  }
110
- var containerHeight = editor.getContainer().offsetHeight;
111
- var contentAreaHeight = editor.getContentAreaContainer().offsetHeight;
112
- var chromeHeight = containerHeight - contentAreaHeight;
113
- if (contentHeight + chromeHeight > getAutoResizeMinHeight(editor)) {
95
+ const containerHeight = editor.getContainer().offsetHeight;
96
+ const contentAreaHeight = editor.getContentAreaContainer().offsetHeight;
97
+ const chromeHeight = containerHeight - contentAreaHeight;
98
+ if (contentHeight + chromeHeight > minHeight) {
114
99
  resizeHeight = contentHeight + chromeHeight;
115
100
  }
116
- var maxHeight = getAutoResizeMaxHeight(editor);
101
+ const maxHeight = getMaxHeight(editor);
117
102
  if (maxHeight && resizeHeight > maxHeight) {
118
103
  resizeHeight = maxHeight;
119
104
  toggleScrolling(editor, true);
@@ -121,64 +106,87 @@
121
106
  toggleScrolling(editor, false);
122
107
  }
123
108
  if (resizeHeight !== oldSize.get()) {
124
- var deltaSize = resizeHeight - oldSize.get();
109
+ const deltaSize = resizeHeight - oldSize.get();
125
110
  dom.setStyle(editor.getContainer(), 'height', resizeHeight + 'px');
126
111
  oldSize.set(resizeHeight);
127
112
  fireResizeEditor(editor);
128
- if (global$1.browser.isSafari() && global$1.mac) {
129
- var win = editor.getWin();
113
+ if (global.browser.isSafari() && (global.os.isMacOS() || global.os.isiOS())) {
114
+ const win = editor.getWin();
130
115
  win.scrollTo(win.pageXOffset, win.pageYOffset);
131
116
  }
132
117
  if (editor.hasFocus() && shouldScrollIntoView(trigger)) {
133
118
  editor.selection.scrollIntoView();
134
119
  }
135
- if (global$1.webkit && deltaSize < 0) {
136
- resize(editor, oldSize, trigger);
120
+ if ((global.browser.isSafari() || global.browser.isChromium()) && deltaSize < 0) {
121
+ resize(editor, oldSize, trigger, getExtraMarginBottom);
137
122
  }
138
123
  }
139
124
  };
140
- var setup = function (editor, oldSize) {
141
- editor.on('init', function () {
142
- var overflowPadding = getAutoResizeOverflowPadding(editor);
143
- var dom = editor.dom;
125
+ const setup = (editor, oldSize) => {
126
+ let getExtraMarginBottom = () => getAutoResizeBottomMargin(editor);
127
+ let resizeCounter;
128
+ let sizeAfterFirstResize;
129
+ editor.on('init', e => {
130
+ resizeCounter = 0;
131
+ const overflowPadding = getAutoResizeOverflowPadding(editor);
132
+ const dom = editor.dom;
144
133
  dom.setStyles(editor.getDoc().documentElement, { height: 'auto' });
145
- dom.setStyles(editor.getBody(), {
146
- 'paddingLeft': overflowPadding,
147
- 'paddingRight': overflowPadding,
148
- 'min-height': 0
149
- });
134
+ if (global.browser.isEdge() || global.browser.isIE()) {
135
+ dom.setStyles(editor.getBody(), {
136
+ 'paddingLeft': overflowPadding,
137
+ 'paddingRight': overflowPadding,
138
+ 'min-height': 0
139
+ });
140
+ } else {
141
+ dom.setStyles(editor.getBody(), {
142
+ paddingLeft: overflowPadding,
143
+ paddingRight: overflowPadding
144
+ });
145
+ }
146
+ resize(editor, oldSize, e, getExtraMarginBottom);
147
+ resizeCounter += 1;
150
148
  });
151
- editor.on('NodeChange SetContent keyup FullscreenStateChanged ResizeContent', function (e) {
152
- resize(editor, oldSize, e);
149
+ editor.on('NodeChange SetContent keyup FullscreenStateChanged ResizeContent', e => {
150
+ if (resizeCounter === 1) {
151
+ sizeAfterFirstResize = editor.getContainer().offsetHeight;
152
+ resize(editor, oldSize, e, getExtraMarginBottom);
153
+ resizeCounter += 1;
154
+ } else if (resizeCounter === 2) {
155
+ const isLooping = sizeAfterFirstResize < editor.getContainer().offsetHeight;
156
+ if (isLooping) {
157
+ const dom = editor.dom;
158
+ const doc = editor.getDoc();
159
+ dom.setStyles(doc.documentElement, { 'min-height': 0 });
160
+ dom.setStyles(editor.getBody(), { 'min-height': 'inherit' });
161
+ }
162
+ getExtraMarginBottom = isLooping ? constant(0) : getExtraMarginBottom;
163
+ resizeCounter += 1;
164
+ } else {
165
+ resize(editor, oldSize, e, getExtraMarginBottom);
166
+ }
153
167
  });
154
- if (shouldAutoResizeOnInit(editor)) {
155
- editor.on('init', function () {
156
- wait(editor, oldSize, 20, 100, function () {
157
- wait(editor, oldSize, 5, 1000);
158
- });
159
- });
160
- }
161
168
  };
162
169
 
163
- var register = function (editor, oldSize) {
164
- editor.addCommand('mceAutoResize', function () {
170
+ const register = (editor, oldSize) => {
171
+ editor.addCommand('mceAutoResize', () => {
165
172
  resize(editor, oldSize);
166
173
  });
167
174
  };
168
175
 
169
- function Plugin () {
170
- global$2.add('autoresize', function (editor) {
171
- if (!has(editor.settings, 'resize')) {
172
- editor.settings.resize = false;
176
+ var Plugin = () => {
177
+ global$1.add('autoresize', editor => {
178
+ register$1(editor);
179
+ if (!editor.options.isSet('resize')) {
180
+ editor.options.set('resize', false);
173
181
  }
174
182
  if (!editor.inline) {
175
- var oldSize = Cell(0);
183
+ const oldSize = Cell(0);
176
184
  register(editor, oldSize);
177
185
  setup(editor, oldSize);
178
186
  }
179
187
  });
180
- }
188
+ };
181
189
 
182
190
  Plugin();
183
191
 
184
- }());
192
+ })();
@@ -1,9 +1,4 @@
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
  */
9
- !function(){"use strict";function y(e){return e.getParam("min_height",e.getElement().offsetHeight,"number")}function p(e,t){var n=e.getBody();n&&(n.style.overflowY=t?"":"hidden",t||(n.scrollTop=0))}function v(e,t,n,i){var o=parseInt(e.getStyle(t,n,i),10);return isNaN(o)?0:o}var l=Object.hasOwnProperty,e=tinymce.util.Tools.resolve("tinymce.PluginManager"),b=tinymce.util.Tools.resolve("tinymce.Env"),r=tinymce.util.Tools.resolve("tinymce.util.Delay"),u=function(e,t,n,i,o){r.setEditorTimeout(e,function(){C(e,t),n--?u(e,t,n,i,o):o&&o()},i)},C=function(e,t,n){var i,o,r,s,a,l,u,g,c,m,f,d=e.dom,h=e.getDoc();h&&(e.plugins.fullscreen&&e.plugins.fullscreen.isFullscreen()?p(e,!0):(i=h.documentElement,o=e.getParam("autoresize_bottom_margin",50,"number"),r=y(e),s=v(d,i,"margin-top",!0),a=v(d,i,"margin-bottom",!0),(l=(l=i.offsetHeight+s+a+o)<0?0:l)+(u=e.getContainer().offsetHeight-e.getContentAreaContainer().offsetHeight)>y(e)&&(r=l+u),(g=e.getParam("max_height",0,"number"))&&g<r?(r=g,p(e,!0)):p(e,!1),r!==t.get()&&(c=r-t.get(),d.setStyle(e.getContainer(),"height",r+"px"),t.set(r),e.fire("ResizeEditor"),b.browser.isSafari()&&b.mac&&(m=e.getWin()).scrollTo(m.pageXOffset,m.pageYOffset),!e.hasFocus()||"setcontent"!==(null==(f=n)?void 0:f.type.toLowerCase())||!0!==f.selection&&!0!==f.paste||e.selection.scrollIntoView(),b.webkit&&c<0&&C(e,t,n))))};e.add("autoresize",function(e){var t,n,i,o,r,s,a=e.settings;l.call(a,"resize")||(e.settings.resize=!1),e.inline||(s=0,r=t={get:function(){return s},set:function(e){s=e}},(o=e).addCommand("mceAutoResize",function(){C(o,r)}),i=t,(n=e).on("init",function(){var e=n.getParam("autoresize_overflow_padding",1,"number"),t=n.dom;t.setStyles(n.getDoc().documentElement,{height:"auto"}),t.setStyles(n.getBody(),{paddingLeft:e,paddingRight:e,"min-height":0})}),n.on("NodeChange SetContent keyup FullscreenStateChanged ResizeContent",function(e){C(n,i,e)}),n.getParam("autoresize_on_init",!0,"boolean")&&n.on("init",function(){u(n,i,20,100,function(){u(n,i,5,1e3)})}))})}();
4
+ !function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),t=tinymce.util.Tools.resolve("tinymce.Env");const o=e=>t=>t.options.get(e),s=o("min_height"),i=o("max_height"),n=o("autoresize_overflow_padding"),r=o("autoresize_bottom_margin"),l=(e,t)=>{const o=e.getBody();o&&(o.style.overflowY=t?"":"hidden",t||(o.scrollTop=0))},g=(e,t,o,s)=>{var i;const n=parseInt(null!==(i=e.getStyle(t,o,s))&&void 0!==i?i:"",10);return isNaN(n)?0:n},a=(e,o,r,c)=>{var d;const f=e.dom,u=e.getDoc();if(!u)return;if((e=>e.plugins.fullscreen&&e.plugins.fullscreen.isFullscreen())(e))return void l(e,!0);const m=u.documentElement,h=c?c():n(e),p=null!==(d=s(e))&&void 0!==d?d:e.getElement().offsetHeight;let y=p;const S=g(f,m,"margin-top",!0),v=g(f,m,"margin-bottom",!0);let C=m.offsetHeight+S+v+h;C<0&&(C=0);const b=e.getContainer().offsetHeight-e.getContentAreaContainer().offsetHeight;C+b>p&&(y=C+b);const w=i(e);if(w&&y>w?(y=w,l(e,!0)):l(e,!1),y!==o.get()){const s=y-o.get();if(f.setStyle(e.getContainer(),"height",y+"px"),o.set(y),(e=>{e.dispatch("ResizeEditor")})(e),t.browser.isSafari()&&(t.os.isMacOS()||t.os.isiOS())){const t=e.getWin();t.scrollTo(t.pageXOffset,t.pageYOffset)}e.hasFocus()&&(e=>{if("setcontent"===(null==e?void 0:e.type.toLowerCase())){const t=e;return!0===t.selection||!0===t.paste}return!1})(r)&&e.selection.scrollIntoView(),(t.browser.isSafari()||t.browser.isChromium())&&s<0&&a(e,o,r,c)}};e.add("autoresize",(e=>{if((e=>{const t=e.options.register;t("autoresize_overflow_padding",{processor:"number",default:1}),t("autoresize_bottom_margin",{processor:"number",default:50})})(e),e.options.isSet("resize")||e.options.set("resize",!1),!e.inline){const o=(e=>{let t=0;return{get:()=>t,set:e=>{t=e}}})();((e,t)=>{e.addCommand("mceAutoResize",(()=>{a(e,t)}))})(e,o),((e,o)=>{let s,i,l=()=>r(e);e.on("init",(i=>{s=0;const r=n(e),g=e.dom;g.setStyles(e.getDoc().documentElement,{height:"auto"}),t.browser.isEdge()||t.browser.isIE()?g.setStyles(e.getBody(),{paddingLeft:r,paddingRight:r,"min-height":0}):g.setStyles(e.getBody(),{paddingLeft:r,paddingRight:r}),a(e,o,i,l),s+=1})),e.on("NodeChange SetContent keyup FullscreenStateChanged ResizeContent",(t=>{if(1===s)i=e.getContainer().offsetHeight,a(e,o,t,l),s+=1;else if(2===s){const t=i<e.getContainer().offsetHeight;if(t){const t=e.dom,o=e.getDoc();t.setStyles(o.documentElement,{"min-height":0}),t.setStyles(e.getBody(),{"min-height":"inherit"})}l=t?(0,()=>0):l,s+=1}else a(e,o,t,l)}))})(e,o)}}))}();
@@ -1,22 +1,36 @@
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
8
  var global$4 = tinymce.util.Tools.resolve('tinymce.PluginManager');
13
9
 
14
- var eq = function (t) {
15
- return function (a) {
16
- return t === a;
17
- };
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
+ }
18
17
  };
19
- var isUndefined = eq(undefined);
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
+ }
29
+ };
30
+ const isType = type => value => typeOf(value) === type;
31
+ const eq = t => a => t === a;
32
+ const isString = isType('string');
33
+ const isUndefined = eq(undefined);
20
34
 
21
35
  var global$3 = tinymce.util.Tools.resolve('tinymce.util.Delay');
22
36
 
@@ -24,74 +38,98 @@
24
38
 
25
39
  var global$1 = tinymce.util.Tools.resolve('tinymce.util.Tools');
26
40
 
27
- var fireRestoreDraft = function (editor) {
28
- return editor.fire('RestoreDraft');
29
- };
30
- var fireStoreDraft = function (editor) {
31
- return editor.fire('StoreDraft');
32
- };
33
- var fireRemoveDraft = function (editor) {
34
- return editor.fire('RemoveDraft');
35
- };
41
+ const fireRestoreDraft = editor => editor.dispatch('RestoreDraft');
42
+ const fireStoreDraft = editor => editor.dispatch('StoreDraft');
43
+ const fireRemoveDraft = editor => editor.dispatch('RemoveDraft');
36
44
 
37
- var parse = function (timeString, defaultTime) {
38
- var multiples = {
45
+ const parse = timeString => {
46
+ const multiples = {
39
47
  s: 1000,
40
48
  m: 60000
41
49
  };
42
- var toParse = timeString || defaultTime;
43
- var parsedTime = /^(\d+)([ms]?)$/.exec('' + toParse);
44
- return (parsedTime[2] ? multiples[parsedTime[2]] : 1) * parseInt(toParse, 10);
45
- };
46
-
47
- var shouldAskBeforeUnload = function (editor) {
48
- return editor.getParam('autosave_ask_before_unload', true);
49
- };
50
- var getAutoSavePrefix = function (editor) {
51
- var location = document.location;
52
- return editor.getParam('autosave_prefix', 'tinymce-autosave-{path}{query}{hash}-{id}-').replace(/{path}/g, location.pathname).replace(/{query}/g, location.search).replace(/{hash}/g, location.hash).replace(/{id}/g, editor.id);
53
- };
54
- var shouldRestoreWhenEmpty = function (editor) {
55
- return editor.getParam('autosave_restore_when_empty', false);
56
- };
57
- var getAutoSaveInterval = function (editor) {
58
- return parse(editor.getParam('autosave_interval'), '30s');
50
+ const parsedTime = /^(\d+)([ms]?)$/.exec(timeString);
51
+ return (parsedTime && parsedTime[2] ? multiples[parsedTime[2]] : 1) * parseInt(timeString, 10);
52
+ };
53
+
54
+ const option = name => editor => editor.options.get(name);
55
+ const register$1 = editor => {
56
+ const registerOption = editor.options.register;
57
+ const timeProcessor = value => {
58
+ const valid = isString(value);
59
+ if (valid) {
60
+ return {
61
+ value: parse(value),
62
+ valid
63
+ };
64
+ } else {
65
+ return {
66
+ valid: false,
67
+ message: 'Must be a string.'
68
+ };
69
+ }
70
+ };
71
+ registerOption('autosave_ask_before_unload', {
72
+ processor: 'boolean',
73
+ default: true
74
+ });
75
+ registerOption('autosave_prefix', {
76
+ processor: 'string',
77
+ default: 'tinymce-autosave-{path}{query}{hash}-{id}-'
78
+ });
79
+ registerOption('autosave_restore_when_empty', {
80
+ processor: 'boolean',
81
+ default: false
82
+ });
83
+ registerOption('autosave_interval', {
84
+ processor: timeProcessor,
85
+ default: '30s'
86
+ });
87
+ registerOption('autosave_retention', {
88
+ processor: timeProcessor,
89
+ default: '20m'
90
+ });
59
91
  };
60
- var getAutoSaveRetention = function (editor) {
61
- return parse(editor.getParam('autosave_retention'), '20m');
92
+ const shouldAskBeforeUnload = option('autosave_ask_before_unload');
93
+ const shouldRestoreWhenEmpty = option('autosave_restore_when_empty');
94
+ const getAutoSaveInterval = option('autosave_interval');
95
+ const getAutoSaveRetention = option('autosave_retention');
96
+ const getAutoSavePrefix = editor => {
97
+ const location = document.location;
98
+ return editor.options.get('autosave_prefix').replace(/{path}/g, location.pathname).replace(/{query}/g, location.search).replace(/{hash}/g, location.hash).replace(/{id}/g, editor.id);
62
99
  };
63
100
 
64
- var isEmpty = function (editor, html) {
101
+ const isEmpty = (editor, html) => {
65
102
  if (isUndefined(html)) {
66
103
  return editor.dom.isEmpty(editor.getBody());
67
104
  } else {
68
- var trimmedHtml = global$1.trim(html);
105
+ const trimmedHtml = global$1.trim(html);
69
106
  if (trimmedHtml === '') {
70
107
  return true;
71
108
  } else {
72
- var fragment = new DOMParser().parseFromString(trimmedHtml, 'text/html');
109
+ const fragment = new DOMParser().parseFromString(trimmedHtml, 'text/html');
73
110
  return editor.dom.isEmpty(fragment);
74
111
  }
75
112
  }
76
113
  };
77
- var hasDraft = function (editor) {
78
- var time = parseInt(global$2.getItem(getAutoSavePrefix(editor) + 'time'), 10) || 0;
114
+ const hasDraft = editor => {
115
+ var _a;
116
+ const time = parseInt((_a = global$2.getItem(getAutoSavePrefix(editor) + 'time')) !== null && _a !== void 0 ? _a : '0', 10) || 0;
79
117
  if (new Date().getTime() - time > getAutoSaveRetention(editor)) {
80
118
  removeDraft(editor, false);
81
119
  return false;
82
120
  }
83
121
  return true;
84
122
  };
85
- var removeDraft = function (editor, fire) {
86
- var prefix = getAutoSavePrefix(editor);
123
+ const removeDraft = (editor, fire) => {
124
+ const prefix = getAutoSavePrefix(editor);
87
125
  global$2.removeItem(prefix + 'draft');
88
126
  global$2.removeItem(prefix + 'time');
89
127
  if (fire !== false) {
90
128
  fireRemoveDraft(editor);
91
129
  }
92
130
  };
93
- var storeDraft = function (editor) {
94
- var prefix = getAutoSavePrefix(editor);
131
+ const storeDraft = editor => {
132
+ const prefix = getAutoSavePrefix(editor);
95
133
  if (!isEmpty(editor) && editor.isDirty()) {
96
134
  global$2.setItem(prefix + 'draft', editor.getContent({
97
135
  format: 'raw',
@@ -101,53 +139,42 @@
101
139
  fireStoreDraft(editor);
102
140
  }
103
141
  };
104
- var restoreDraft = function (editor) {
105
- var prefix = getAutoSavePrefix(editor);
142
+ const restoreDraft = editor => {
143
+ var _a;
144
+ const prefix = getAutoSavePrefix(editor);
106
145
  if (hasDraft(editor)) {
107
- editor.setContent(global$2.getItem(prefix + 'draft'), { format: 'raw' });
146
+ editor.setContent((_a = global$2.getItem(prefix + 'draft')) !== null && _a !== void 0 ? _a : '', { format: 'raw' });
108
147
  fireRestoreDraft(editor);
109
148
  }
110
149
  };
111
- var startStoreDraft = function (editor) {
112
- var interval = getAutoSaveInterval(editor);
113
- global$3.setEditorInterval(editor, function () {
150
+ const startStoreDraft = editor => {
151
+ const interval = getAutoSaveInterval(editor);
152
+ global$3.setEditorInterval(editor, () => {
114
153
  storeDraft(editor);
115
154
  }, interval);
116
155
  };
117
- var restoreLastDraft = function (editor) {
118
- editor.undoManager.transact(function () {
156
+ const restoreLastDraft = editor => {
157
+ editor.undoManager.transact(() => {
119
158
  restoreDraft(editor);
120
159
  removeDraft(editor);
121
160
  });
122
161
  editor.focus();
123
162
  };
124
163
 
125
- var get = function (editor) {
126
- return {
127
- hasDraft: function () {
128
- return hasDraft(editor);
129
- },
130
- storeDraft: function () {
131
- return storeDraft(editor);
132
- },
133
- restoreDraft: function () {
134
- return restoreDraft(editor);
135
- },
136
- removeDraft: function (fire) {
137
- return removeDraft(editor, fire);
138
- },
139
- isEmpty: function (html) {
140
- return isEmpty(editor, html);
141
- }
142
- };
143
- };
164
+ const get = editor => ({
165
+ hasDraft: () => hasDraft(editor),
166
+ storeDraft: () => storeDraft(editor),
167
+ restoreDraft: () => restoreDraft(editor),
168
+ removeDraft: fire => removeDraft(editor, fire),
169
+ isEmpty: html => isEmpty(editor, html)
170
+ });
144
171
 
145
172
  var global = tinymce.util.Tools.resolve('tinymce.EditorManager');
146
173
 
147
- var setup = function (editor) {
148
- editor.editorManager.on('BeforeUnload', function (e) {
149
- var msg;
150
- global$1.each(global.get(), function (editor) {
174
+ const setup = editor => {
175
+ editor.editorManager.on('BeforeUnload', e => {
176
+ let msg;
177
+ global$1.each(global.get(), editor => {
151
178
  if (editor.plugins.autosave) {
152
179
  editor.plugins.autosave.storeDraft();
153
180
  }
@@ -162,51 +189,45 @@
162
189
  });
163
190
  };
164
191
 
165
- var makeSetupHandler = function (editor) {
166
- return function (api) {
167
- api.setDisabled(!hasDraft(editor));
168
- var editorEventCallback = function () {
169
- return api.setDisabled(!hasDraft(editor));
170
- };
171
- editor.on('StoreDraft RestoreDraft RemoveDraft', editorEventCallback);
172
- return function () {
173
- return editor.off('StoreDraft RestoreDraft RemoveDraft', editorEventCallback);
174
- };
175
- };
192
+ const makeSetupHandler = editor => api => {
193
+ api.setEnabled(hasDraft(editor));
194
+ const editorEventCallback = () => api.setEnabled(hasDraft(editor));
195
+ editor.on('StoreDraft RestoreDraft RemoveDraft', editorEventCallback);
196
+ return () => editor.off('StoreDraft RestoreDraft RemoveDraft', editorEventCallback);
176
197
  };
177
- var register = function (editor) {
198
+ const register = editor => {
178
199
  startStoreDraft(editor);
200
+ const onAction = () => {
201
+ restoreLastDraft(editor);
202
+ };
179
203
  editor.ui.registry.addButton('restoredraft', {
180
204
  tooltip: 'Restore last draft',
181
205
  icon: 'restore-draft',
182
- onAction: function () {
183
- restoreLastDraft(editor);
184
- },
206
+ onAction,
185
207
  onSetup: makeSetupHandler(editor)
186
208
  });
187
209
  editor.ui.registry.addMenuItem('restoredraft', {
188
210
  text: 'Restore last draft',
189
211
  icon: 'restore-draft',
190
- onAction: function () {
191
- restoreLastDraft(editor);
192
- },
212
+ onAction,
193
213
  onSetup: makeSetupHandler(editor)
194
214
  });
195
215
  };
196
216
 
197
- function Plugin () {
198
- global$4.add('autosave', function (editor) {
217
+ var Plugin = () => {
218
+ global$4.add('autosave', editor => {
219
+ register$1(editor);
199
220
  setup(editor);
200
221
  register(editor);
201
- editor.on('init', function () {
222
+ editor.on('init', () => {
202
223
  if (shouldRestoreWhenEmpty(editor) && editor.dom.isEmpty(editor.getBody())) {
203
224
  restoreDraft(editor);
204
225
  }
205
226
  });
206
227
  return get(editor);
207
228
  });
208
- }
229
+ };
209
230
 
210
231
  Plugin();
211
232
 
212
- }());
233
+ })();