@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,175 +1,161 @@
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 = tinymce.util.Tools.resolve('tinymce.PluginManager');
13
9
 
14
- var typeOf = function (x) {
15
- var t = typeof x;
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;
16
20
  if (x === null) {
17
21
  return 'null';
18
- } else if (t === 'object' && (Array.prototype.isPrototypeOf(x) || x.constructor && x.constructor.name === 'Array')) {
22
+ } else if (t === 'object' && Array.isArray(x)) {
19
23
  return 'array';
20
- } else if (t === 'object' && (String.prototype.isPrototypeOf(x) || x.constructor && x.constructor.name === 'String')) {
24
+ } else if (t === 'object' && hasProto(x, String, (o, proto) => proto.isPrototypeOf(o))) {
21
25
  return 'string';
22
26
  } else {
23
27
  return t;
24
28
  }
25
29
  };
26
- var isType$1 = function (type) {
27
- return function (value) {
28
- return typeOf(value) === type;
29
- };
30
- };
31
- var isSimpleType = function (type) {
32
- return function (value) {
33
- return typeof value === type;
34
- };
35
- };
36
- var isString = isType$1('string');
37
- var isBoolean = isSimpleType('boolean');
38
- var isNullable = function (a) {
39
- return a === null || a === undefined;
40
- };
41
- var isNonNullable = function (a) {
42
- return !isNullable(a);
43
- };
44
- var isFunction = isSimpleType('function');
45
- var isNumber = isSimpleType('number');
30
+ const isType$1 = type => value => typeOf(value) === type;
31
+ const isSimpleType = type => value => typeof value === type;
32
+ const isString = isType$1('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');
37
+ const isNumber = isSimpleType('number');
46
38
 
47
- var noop = function () {
48
- };
49
- var compose1 = function (fbc, fab) {
50
- return function (a) {
51
- return fbc(fab(a));
52
- };
53
- };
54
- var constant = function (value) {
55
- return function () {
39
+ const compose1 = (fbc, fab) => a => fbc(fab(a));
40
+ const constant = value => {
41
+ return () => {
56
42
  return value;
57
43
  };
58
44
  };
59
- var identity = function (x) {
60
- return x;
61
- };
62
- var never = constant(false);
63
- var always = constant(true);
45
+ const never = constant(false);
64
46
 
65
- var none = function () {
66
- return NONE;
67
- };
68
- var NONE = function () {
69
- var call = function (thunk) {
70
- return thunk();
71
- };
72
- var id = identity;
73
- var me = {
74
- fold: function (n, _s) {
75
- return n();
76
- },
77
- isSome: never,
78
- isNone: always,
79
- getOr: id,
80
- getOrThunk: call,
81
- getOrDie: function (msg) {
82
- throw new Error(msg || 'error: getOrDie called on none.');
83
- },
84
- getOrNull: constant(null),
85
- getOrUndefined: constant(undefined),
86
- or: id,
87
- orThunk: call,
88
- map: none,
89
- each: noop,
90
- bind: none,
91
- exists: never,
92
- forall: always,
93
- filter: function () {
94
- return none();
95
- },
96
- toArray: function () {
97
- return [];
98
- },
99
- toString: constant('none()')
100
- };
101
- return me;
102
- }();
103
- var some = function (a) {
104
- var constant_a = constant(a);
105
- var self = function () {
106
- return me;
107
- };
108
- var bind = function (f) {
109
- return f(a);
110
- };
111
- var me = {
112
- fold: function (n, s) {
113
- return s(a);
114
- },
115
- isSome: always,
116
- isNone: never,
117
- getOr: constant_a,
118
- getOrThunk: constant_a,
119
- getOrDie: constant_a,
120
- getOrNull: constant_a,
121
- getOrUndefined: constant_a,
122
- or: self,
123
- orThunk: self,
124
- map: function (f) {
125
- return some(f(a));
126
- },
127
- each: function (f) {
128
- f(a);
129
- },
130
- bind: bind,
131
- exists: bind,
132
- forall: bind,
133
- filter: function (f) {
134
- return f(a) ? me : NONE;
135
- },
136
- toArray: function () {
137
- return [a];
138
- },
139
- toString: function () {
140
- return 'some(' + a + ')';
47
+ class Optional {
48
+ constructor(tag, value) {
49
+ this.tag = tag;
50
+ this.value = value;
51
+ }
52
+ static some(value) {
53
+ return new Optional(true, value);
54
+ }
55
+ static none() {
56
+ return Optional.singletonNone;
57
+ }
58
+ fold(onNone, onSome) {
59
+ if (this.tag) {
60
+ return onSome(this.value);
61
+ } else {
62
+ return onNone();
141
63
  }
142
- };
143
- return me;
144
- };
145
- var from = function (value) {
146
- return value === null || value === undefined ? NONE : some(value);
147
- };
148
- var Optional = {
149
- some: some,
150
- none: none,
151
- from: from
152
- };
64
+ }
65
+ isSome() {
66
+ return this.tag;
67
+ }
68
+ isNone() {
69
+ return !this.tag;
70
+ }
71
+ map(mapper) {
72
+ if (this.tag) {
73
+ return Optional.some(mapper(this.value));
74
+ } else {
75
+ return Optional.none();
76
+ }
77
+ }
78
+ bind(binder) {
79
+ if (this.tag) {
80
+ return binder(this.value);
81
+ } else {
82
+ return Optional.none();
83
+ }
84
+ }
85
+ exists(predicate) {
86
+ return this.tag && predicate(this.value);
87
+ }
88
+ forall(predicate) {
89
+ return !this.tag || predicate(this.value);
90
+ }
91
+ filter(predicate) {
92
+ if (!this.tag || predicate(this.value)) {
93
+ return this;
94
+ } else {
95
+ return Optional.none();
96
+ }
97
+ }
98
+ getOr(replacement) {
99
+ return this.tag ? this.value : replacement;
100
+ }
101
+ or(replacement) {
102
+ return this.tag ? this : replacement;
103
+ }
104
+ getOrThunk(thunk) {
105
+ return this.tag ? this.value : thunk();
106
+ }
107
+ orThunk(thunk) {
108
+ return this.tag ? this : thunk();
109
+ }
110
+ getOrDie(message) {
111
+ if (!this.tag) {
112
+ throw new Error(message !== null && message !== void 0 ? message : 'Called getOrDie on None');
113
+ } else {
114
+ return this.value;
115
+ }
116
+ }
117
+ static from(value) {
118
+ return isNonNullable(value) ? Optional.some(value) : Optional.none();
119
+ }
120
+ getOrNull() {
121
+ return this.tag ? this.value : null;
122
+ }
123
+ getOrUndefined() {
124
+ return this.value;
125
+ }
126
+ each(worker) {
127
+ if (this.tag) {
128
+ worker(this.value);
129
+ }
130
+ }
131
+ toArray() {
132
+ return this.tag ? [this.value] : [];
133
+ }
134
+ toString() {
135
+ return this.tag ? `some(${ this.value })` : 'none()';
136
+ }
137
+ }
138
+ Optional.singletonNone = new Optional(false);
153
139
 
154
- var map = function (xs, f) {
155
- var len = xs.length;
156
- var r = new Array(len);
157
- for (var i = 0; i < len; i++) {
158
- var x = xs[i];
140
+ const map = (xs, f) => {
141
+ const len = xs.length;
142
+ const r = new Array(len);
143
+ for (let i = 0; i < len; i++) {
144
+ const x = xs[i];
159
145
  r[i] = f(x, i);
160
146
  }
161
147
  return r;
162
148
  };
163
- var each = function (xs, f) {
164
- for (var i = 0, len = xs.length; i < len; i++) {
165
- var x = xs[i];
149
+ const each = (xs, f) => {
150
+ for (let i = 0, len = xs.length; i < len; i++) {
151
+ const x = xs[i];
166
152
  f(x, i);
167
153
  }
168
154
  };
169
- var filter = function (xs, pred) {
170
- var r = [];
171
- for (var i = 0, len = xs.length; i < len; i++) {
172
- var x = xs[i];
155
+ const filter = (xs, pred) => {
156
+ const r = [];
157
+ for (let i = 0, len = xs.length; i < len; i++) {
158
+ const x = xs[i];
173
159
  if (pred(x, i)) {
174
160
  r.push(x);
175
161
  }
@@ -177,54 +163,53 @@
177
163
  return r;
178
164
  };
179
165
 
180
- var DOCUMENT = 9;
181
- var DOCUMENT_FRAGMENT = 11;
182
- var ELEMENT = 1;
183
- var TEXT = 3;
166
+ const DOCUMENT = 9;
167
+ const DOCUMENT_FRAGMENT = 11;
168
+ const ELEMENT = 1;
169
+ const TEXT = 3;
184
170
 
185
- var fromHtml = function (html, scope) {
186
- var doc = scope || document;
187
- var div = doc.createElement('div');
171
+ const fromHtml = (html, scope) => {
172
+ const doc = scope || document;
173
+ const div = doc.createElement('div');
188
174
  div.innerHTML = html;
189
175
  if (!div.hasChildNodes() || div.childNodes.length > 1) {
190
- console.error('HTML does not have a single root node', html);
191
- throw new Error('HTML must have a single root node');
176
+ const message = 'HTML does not have a single root node';
177
+ console.error(message, html);
178
+ throw new Error(message);
192
179
  }
193
180
  return fromDom(div.childNodes[0]);
194
181
  };
195
- var fromTag = function (tag, scope) {
196
- var doc = scope || document;
197
- var node = doc.createElement(tag);
182
+ const fromTag = (tag, scope) => {
183
+ const doc = scope || document;
184
+ const node = doc.createElement(tag);
198
185
  return fromDom(node);
199
186
  };
200
- var fromText = function (text, scope) {
201
- var doc = scope || document;
202
- var node = doc.createTextNode(text);
187
+ const fromText = (text, scope) => {
188
+ const doc = scope || document;
189
+ const node = doc.createTextNode(text);
203
190
  return fromDom(node);
204
191
  };
205
- var fromDom = function (node) {
192
+ const fromDom = node => {
206
193
  if (node === null || node === undefined) {
207
194
  throw new Error('Node cannot be null or undefined');
208
195
  }
209
196
  return { dom: node };
210
197
  };
211
- var fromPoint = function (docElm, x, y) {
212
- return Optional.from(docElm.dom.elementFromPoint(x, y)).map(fromDom);
213
- };
214
- var SugarElement = {
215
- fromHtml: fromHtml,
216
- fromTag: fromTag,
217
- fromText: fromText,
218
- fromDom: fromDom,
219
- fromPoint: fromPoint
198
+ const fromPoint = (docElm, x, y) => Optional.from(docElm.dom.elementFromPoint(x, y)).map(fromDom);
199
+ const SugarElement = {
200
+ fromHtml,
201
+ fromTag,
202
+ fromText,
203
+ fromDom,
204
+ fromPoint
220
205
  };
221
206
 
222
- var is = function (element, selector) {
223
- var dom = element.dom;
207
+ const is = (element, selector) => {
208
+ const dom = element.dom;
224
209
  if (dom.nodeType !== ELEMENT) {
225
210
  return false;
226
211
  } else {
227
- var elem = dom;
212
+ const elem = dom;
228
213
  if (elem.matches !== undefined) {
229
214
  return elem.matches(selector);
230
215
  } else if (elem.msMatchesSelector !== undefined) {
@@ -241,42 +226,24 @@
241
226
 
242
227
  typeof window !== 'undefined' ? window : Function('return this;')();
243
228
 
244
- var name = function (element) {
245
- var r = element.dom.nodeName;
229
+ const name = element => {
230
+ const r = element.dom.nodeName;
246
231
  return r.toLowerCase();
247
232
  };
248
- var type = function (element) {
249
- return element.dom.nodeType;
250
- };
251
- var isType = function (t) {
252
- return function (element) {
253
- return type(element) === t;
254
- };
255
- };
256
- var isElement = isType(ELEMENT);
257
- var isText = isType(TEXT);
258
- var isDocument = isType(DOCUMENT);
259
- var isDocumentFragment = isType(DOCUMENT_FRAGMENT);
260
- var isTag = function (tag) {
261
- return function (e) {
262
- return isElement(e) && name(e) === tag;
263
- };
264
- };
233
+ const type = element => element.dom.nodeType;
234
+ const isType = t => element => type(element) === t;
235
+ const isElement = isType(ELEMENT);
236
+ const isText = isType(TEXT);
237
+ const isDocument = isType(DOCUMENT);
238
+ const isDocumentFragment = isType(DOCUMENT_FRAGMENT);
239
+ const isTag = tag => e => isElement(e) && name(e) === tag;
265
240
 
266
- var owner = function (element) {
267
- return SugarElement.fromDom(element.dom.ownerDocument);
268
- };
269
- var documentOrOwner = function (dos) {
270
- return isDocument(dos) ? dos : owner(dos);
271
- };
272
- var parent = function (element) {
273
- return Optional.from(element.dom.parentNode).map(SugarElement.fromDom);
274
- };
275
- var children$2 = function (element) {
276
- return map(element.dom.childNodes, SugarElement.fromDom);
277
- };
241
+ const owner = element => SugarElement.fromDom(element.dom.ownerDocument);
242
+ const documentOrOwner = dos => isDocument(dos) ? dos : owner(dos);
243
+ const parent = element => Optional.from(element.dom.parentNode).map(SugarElement.fromDom);
244
+ const children$2 = element => map(element.dom.childNodes, SugarElement.fromDom);
278
245
 
279
- var rawSet = function (dom, key, value) {
246
+ const rawSet = (dom, key, value) => {
280
247
  if (isString(value) || isBoolean(value) || isNumber(value)) {
281
248
  dom.setAttribute(key, value + '');
282
249
  } else {
@@ -284,45 +251,37 @@
284
251
  throw new Error('Attribute value was not simple');
285
252
  }
286
253
  };
287
- var set = function (element, key, value) {
254
+ const set = (element, key, value) => {
288
255
  rawSet(element.dom, key, value);
289
256
  };
290
- var remove = function (element, key) {
257
+ const remove = (element, key) => {
291
258
  element.dom.removeAttribute(key);
292
259
  };
293
260
 
294
- var isShadowRoot = function (dos) {
295
- return isDocumentFragment(dos) && isNonNullable(dos.dom.host);
296
- };
297
- var supported = isFunction(Element.prototype.attachShadow) && isFunction(Node.prototype.getRootNode);
298
- var getRootNode = supported ? function (e) {
299
- return SugarElement.fromDom(e.dom.getRootNode());
300
- } : documentOrOwner;
301
- var getShadowRoot = function (e) {
302
- var r = getRootNode(e);
261
+ const isShadowRoot = dos => isDocumentFragment(dos) && isNonNullable(dos.dom.host);
262
+ const supported = isFunction(Element.prototype.attachShadow) && isFunction(Node.prototype.getRootNode);
263
+ const getRootNode = supported ? e => SugarElement.fromDom(e.dom.getRootNode()) : documentOrOwner;
264
+ const getShadowRoot = e => {
265
+ const r = getRootNode(e);
303
266
  return isShadowRoot(r) ? Optional.some(r) : Optional.none();
304
267
  };
305
- var getShadowHost = function (e) {
306
- return SugarElement.fromDom(e.dom.host);
307
- };
268
+ const getShadowHost = e => SugarElement.fromDom(e.dom.host);
308
269
 
309
- var inBody = function (element) {
310
- var dom = isText(element) ? element.dom.parentNode : element.dom;
270
+ const inBody = element => {
271
+ const dom = isText(element) ? element.dom.parentNode : element.dom;
311
272
  if (dom === undefined || dom === null || dom.ownerDocument === null) {
312
273
  return false;
313
274
  }
314
- var doc = dom.ownerDocument;
315
- return getShadowRoot(SugarElement.fromDom(dom)).fold(function () {
316
- return doc.body.contains(dom);
317
- }, compose1(inBody, getShadowHost));
275
+ const doc = dom.ownerDocument;
276
+ return getShadowRoot(SugarElement.fromDom(dom)).fold(() => doc.body.contains(dom), compose1(inBody, getShadowHost));
318
277
  };
319
278
 
320
- var ancestor$1 = function (scope, predicate, isRoot) {
321
- var element = scope.dom;
322
- var stop = isFunction(isRoot) ? isRoot : never;
279
+ const ancestor$1 = (scope, predicate, isRoot) => {
280
+ let element = scope.dom;
281
+ const stop = isFunction(isRoot) ? isRoot : never;
323
282
  while (element.parentNode) {
324
283
  element = element.parentNode;
325
- var el = SugarElement.fromDom(element);
284
+ const el = SugarElement.fromDom(element);
326
285
  if (predicate(el)) {
327
286
  return Optional.some(el);
328
287
  } else if (stop(el)) {
@@ -332,122 +291,105 @@
332
291
  return Optional.none();
333
292
  };
334
293
 
335
- var ancestor = function (scope, selector, isRoot) {
336
- return ancestor$1(scope, function (e) {
337
- return is(e, selector);
338
- }, isRoot);
339
- };
294
+ const ancestor = (scope, selector, isRoot) => ancestor$1(scope, e => is(e, selector), isRoot);
340
295
 
341
- var isSupported = function (dom) {
342
- return dom.style !== undefined && isFunction(dom.style.getPropertyValue);
343
- };
296
+ const isSupported = dom => dom.style !== undefined && isFunction(dom.style.getPropertyValue);
344
297
 
345
- var get = function (element, property) {
346
- var dom = element.dom;
347
- var styles = window.getComputedStyle(dom);
348
- var r = styles.getPropertyValue(property);
298
+ const get = (element, property) => {
299
+ const dom = element.dom;
300
+ const styles = window.getComputedStyle(dom);
301
+ const r = styles.getPropertyValue(property);
349
302
  return r === '' && !inBody(element) ? getUnsafeProperty(dom, property) : r;
350
303
  };
351
- var getUnsafeProperty = function (dom, property) {
352
- return isSupported(dom) ? dom.style.getPropertyValue(property) : '';
353
- };
304
+ const getUnsafeProperty = (dom, property) => isSupported(dom) ? dom.style.getPropertyValue(property) : '';
354
305
 
355
- var getDirection = function (element) {
356
- return get(element, 'direction') === 'rtl' ? 'rtl' : 'ltr';
357
- };
306
+ const getDirection = element => get(element, 'direction') === 'rtl' ? 'rtl' : 'ltr';
358
307
 
359
- var children$1 = function (scope, predicate) {
360
- return filter(children$2(scope), predicate);
361
- };
308
+ const children$1 = (scope, predicate) => filter(children$2(scope), predicate);
362
309
 
363
- var children = function (scope, selector) {
364
- return children$1(scope, function (e) {
365
- return is(e, selector);
366
- });
367
- };
310
+ const children = (scope, selector) => children$1(scope, e => is(e, selector));
368
311
 
369
- var getParentElement = function (element) {
370
- return parent(element).filter(isElement);
371
- };
372
- var getNormalizedBlock = function (element, isListItem) {
373
- var normalizedElement = isListItem ? ancestor(element, 'ol,ul') : Optional.some(element);
312
+ const getParentElement = element => parent(element).filter(isElement);
313
+ const getNormalizedBlock = (element, isListItem) => {
314
+ const normalizedElement = isListItem ? ancestor(element, 'ol,ul') : Optional.some(element);
374
315
  return normalizedElement.getOr(element);
375
316
  };
376
- var isListItem = isTag('li');
377
- var setDir = function (editor, dir) {
378
- var selectedBlocks = editor.selection.getSelectedBlocks();
379
- if (selectedBlocks.length > 0) {
380
- each(selectedBlocks, function (block) {
381
- var blockElement = SugarElement.fromDom(block);
382
- var isBlockElementListItem = isListItem(blockElement);
383
- var normalizedBlock = getNormalizedBlock(blockElement, isBlockElementListItem);
384
- var normalizedBlockParent = getParentElement(normalizedBlock);
385
- normalizedBlockParent.each(function (parent) {
386
- var parentDirection = getDirection(parent);
387
- if (parentDirection !== dir) {
388
- set(normalizedBlock, 'dir', dir);
389
- } else if (getDirection(normalizedBlock) !== dir) {
390
- remove(normalizedBlock, 'dir');
391
- }
392
- if (isBlockElementListItem) {
393
- var listItems = children(normalizedBlock, 'li[dir]');
394
- each(listItems, function (listItem) {
395
- return remove(listItem, 'dir');
396
- });
397
- }
398
- });
317
+ const isListItem = isTag('li');
318
+ const setDirOnElements = (dom, blocks, dir) => {
319
+ each(blocks, block => {
320
+ const blockElement = SugarElement.fromDom(block);
321
+ const isBlockElementListItem = isListItem(blockElement);
322
+ const normalizedBlock = getNormalizedBlock(blockElement, isBlockElementListItem);
323
+ const normalizedBlockParent = getParentElement(normalizedBlock);
324
+ normalizedBlockParent.each(parent => {
325
+ dom.setStyle(normalizedBlock.dom, 'direction', null);
326
+ const parentDirection = getDirection(parent);
327
+ if (parentDirection === dir) {
328
+ remove(normalizedBlock, 'dir');
329
+ } else {
330
+ set(normalizedBlock, 'dir', dir);
331
+ }
332
+ if (getDirection(normalizedBlock) !== dir) {
333
+ dom.setStyle(normalizedBlock.dom, 'direction', dir);
334
+ }
335
+ if (isBlockElementListItem) {
336
+ const listItems = children(normalizedBlock, 'li[dir],li[style]');
337
+ each(listItems, listItem => {
338
+ remove(listItem, 'dir');
339
+ dom.setStyle(listItem.dom, 'direction', null);
340
+ });
341
+ }
399
342
  });
343
+ });
344
+ };
345
+ const setDir = (editor, dir) => {
346
+ if (editor.selection.isEditable()) {
347
+ setDirOnElements(editor.dom, editor.selection.getSelectedBlocks(), dir);
400
348
  editor.nodeChanged();
401
349
  }
402
350
  };
403
351
 
404
- var register$1 = function (editor) {
405
- editor.addCommand('mceDirectionLTR', function () {
352
+ const register$1 = editor => {
353
+ editor.addCommand('mceDirectionLTR', () => {
406
354
  setDir(editor, 'ltr');
407
355
  });
408
- editor.addCommand('mceDirectionRTL', function () {
356
+ editor.addCommand('mceDirectionRTL', () => {
409
357
  setDir(editor, 'rtl');
410
358
  });
411
359
  };
412
360
 
413
- var getNodeChangeHandler = function (editor, dir) {
414
- return function (api) {
415
- var nodeChangeHandler = function (e) {
416
- var element = SugarElement.fromDom(e.element);
417
- api.setActive(getDirection(element) === dir);
418
- };
419
- editor.on('NodeChange', nodeChangeHandler);
420
- return function () {
421
- return editor.off('NodeChange', nodeChangeHandler);
422
- };
361
+ const getNodeChangeHandler = (editor, dir) => api => {
362
+ const nodeChangeHandler = e => {
363
+ const element = SugarElement.fromDom(e.element);
364
+ api.setActive(getDirection(element) === dir);
365
+ api.setEnabled(editor.selection.isEditable());
423
366
  };
367
+ editor.on('NodeChange', nodeChangeHandler);
368
+ api.setEnabled(editor.selection.isEditable());
369
+ return () => editor.off('NodeChange', nodeChangeHandler);
424
370
  };
425
- var register = function (editor) {
371
+ const register = editor => {
426
372
  editor.ui.registry.addToggleButton('ltr', {
427
373
  tooltip: 'Left to right',
428
374
  icon: 'ltr',
429
- onAction: function () {
430
- return editor.execCommand('mceDirectionLTR');
431
- },
375
+ onAction: () => editor.execCommand('mceDirectionLTR'),
432
376
  onSetup: getNodeChangeHandler(editor, 'ltr')
433
377
  });
434
378
  editor.ui.registry.addToggleButton('rtl', {
435
379
  tooltip: 'Right to left',
436
380
  icon: 'rtl',
437
- onAction: function () {
438
- return editor.execCommand('mceDirectionRTL');
439
- },
381
+ onAction: () => editor.execCommand('mceDirectionRTL'),
440
382
  onSetup: getNodeChangeHandler(editor, 'rtl')
441
383
  });
442
384
  };
443
385
 
444
- function Plugin () {
445
- global.add('directionality', function (editor) {
386
+ var Plugin = () => {
387
+ global.add('directionality', editor => {
446
388
  register$1(editor);
447
389
  register(editor);
448
390
  });
449
- }
391
+ };
450
392
 
451
393
  Plugin();
452
394
 
453
- }());
395
+ })();