@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,213 +1,228 @@
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
- 'use strict';
6
+ 'use strict';
11
7
 
12
- var global$1 = tinymce.util.Tools.resolve('tinymce.PluginManager');
8
+ var global$1 = tinymce.util.Tools.resolve('tinymce.PluginManager');
13
9
 
14
- var checkRange = function (str, substr, start) {
15
- return substr === '' || str.length >= substr.length && str.substr(start, start + substr.length) === substr;
16
- };
17
- var contains = function (str, substr) {
18
- return str.indexOf(substr) !== -1;
19
- };
20
- var startsWith = function (str, prefix) {
21
- return checkRange(str, prefix, 0);
22
- };
10
+ const link = () => /(?:[A-Za-z][A-Za-z\d.+-]{0,14}:\/\/(?:[-.~*+=!&;:'%@?^${}(),\w]+@)?|www\.|[-;:&=+$,.\w]+@)[A-Za-z\d-]+(?:\.[A-Za-z\d-]+)*(?::\d+)?(?:\/(?:[-.~*+=!;:'%@$(),\/\w]*[-~*+=%@$()\/\w])?)?(?:\?(?:[-.~*+=!&;:'%@?^${}(),\/\w]+))?(?:#(?:[-.~*+=!&;:'%@?^${}(),\/\w]+))?/g;
23
11
 
24
- var global = tinymce.util.Tools.resolve('tinymce.Env');
12
+ const option = name => editor => editor.options.get(name);
13
+ const register = editor => {
14
+ const registerOption = editor.options.register;
15
+ registerOption('autolink_pattern', {
16
+ processor: 'regexp',
17
+ default: new RegExp('^' + link().source + '$', 'i')
18
+ });
19
+ registerOption('link_default_target', { processor: 'string' });
20
+ registerOption('link_default_protocol', {
21
+ processor: 'string',
22
+ default: 'https'
23
+ });
24
+ };
25
+ const getAutoLinkPattern = option('autolink_pattern');
26
+ const getDefaultLinkTarget = option('link_default_target');
27
+ const getDefaultLinkProtocol = option('link_default_protocol');
28
+ const allowUnsafeLinkTarget = option('allow_unsafe_link_target');
25
29
 
26
- var link = function () {
27
- return /(?:[A-Za-z][A-Za-z\d.+-]{0,14}:\/\/(?:[-.~*+=!&;:'%@?^${}(),\w]+@)?|www\.|[-;:&=+$,.\w]+@)[A-Za-z\d-]+(?:\.[A-Za-z\d-]+)*(?::\d+)?(?:\/(?:[-.~*+=!;:'%@$(),\/\w]*[-~*+=%@$()\/\w])?)?(?:\?(?:[-.~*+=!&;:'%@?^${}(),\/\w]+))?(?:#(?:[-.~*+=!&;:'%@?^${}(),\/\w]+))?/g;
28
- };
30
+ const hasProto = (v, constructor, predicate) => {
31
+ var _a;
32
+ if (predicate(v, constructor.prototype)) {
33
+ return true;
34
+ } else {
35
+ return ((_a = v.constructor) === null || _a === void 0 ? void 0 : _a.name) === constructor.name;
36
+ }
37
+ };
38
+ const typeOf = x => {
39
+ const t = typeof x;
40
+ if (x === null) {
41
+ return 'null';
42
+ } else if (t === 'object' && Array.isArray(x)) {
43
+ return 'array';
44
+ } else if (t === 'object' && hasProto(x, String, (o, proto) => proto.isPrototypeOf(o))) {
45
+ return 'string';
46
+ } else {
47
+ return t;
48
+ }
49
+ };
50
+ const isType = type => value => typeOf(value) === type;
51
+ const eq = t => a => t === a;
52
+ const isString = isType('string');
53
+ const isUndefined = eq(undefined);
54
+ const isNullable = a => a === null || a === undefined;
55
+ const isNonNullable = a => !isNullable(a);
29
56
 
30
- var defaultLinkPattern = new RegExp('^' + link().source + '$', 'i');
31
- var getAutoLinkPattern = function (editor) {
32
- return editor.getParam('autolink_pattern', defaultLinkPattern);
33
- };
34
- var getDefaultLinkTarget = function (editor) {
35
- return editor.getParam('default_link_target', false);
36
- };
37
- var getDefaultLinkProtocol = function (editor) {
38
- return editor.getParam('link_default_protocol', 'http', 'string');
39
- };
57
+ const not = f => t => !f(t);
40
58
 
41
- var rangeEqualsBracketOrSpace = function (rangeString) {
42
- return /^[(\[{ \u00a0]$/.test(rangeString);
43
- };
44
- var isTextNode = function (node) {
45
- return node.nodeType === 3;
46
- };
47
- var isElement = function (node) {
48
- return node.nodeType === 1;
49
- };
50
- var handleBracket = function (editor) {
51
- return parseCurrentLine(editor, -1);
52
- };
53
- var handleSpacebar = function (editor) {
54
- return parseCurrentLine(editor, 0);
55
- };
56
- var handleEnter = function (editor) {
57
- return parseCurrentLine(editor, -1);
58
- };
59
- var scopeIndex = function (container, index) {
60
- if (index < 0) {
61
- index = 0;
62
- }
63
- if (isTextNode(container)) {
64
- var len = container.data.length;
65
- if (index > len) {
66
- index = len;
67
- }
68
- }
69
- return index;
70
- };
71
- var setStart = function (rng, container, offset) {
72
- if (!isElement(container) || container.hasChildNodes()) {
73
- rng.setStart(container, scopeIndex(container, offset));
74
- } else {
75
- rng.setStartBefore(container);
76
- }
77
- };
78
- var setEnd = function (rng, container, offset) {
79
- if (!isElement(container) || container.hasChildNodes()) {
80
- rng.setEnd(container, scopeIndex(container, offset));
81
- } else {
82
- rng.setEndAfter(container);
59
+ const hasOwnProperty = Object.hasOwnProperty;
60
+ const has = (obj, key) => hasOwnProperty.call(obj, key);
61
+
62
+ const checkRange = (str, substr, start) => substr === '' || str.length >= substr.length && str.substr(start, start + substr.length) === substr;
63
+ const contains = (str, substr, start = 0, end) => {
64
+ const idx = str.indexOf(substr, start);
65
+ if (idx !== -1) {
66
+ return isUndefined(end) ? true : idx + substr.length <= end;
67
+ } else {
68
+ return false;
69
+ }
70
+ };
71
+ const startsWith = (str, prefix) => {
72
+ return checkRange(str, prefix, 0);
73
+ };
74
+
75
+ const zeroWidth = '\uFEFF';
76
+ const isZwsp = char => char === zeroWidth;
77
+ const removeZwsp = s => s.replace(/\uFEFF/g, '');
78
+
79
+ var global = tinymce.util.Tools.resolve('tinymce.dom.TextSeeker');
80
+
81
+ const isTextNode = node => node.nodeType === 3;
82
+ const isElement = node => node.nodeType === 1;
83
+ const isBracketOrSpace = char => /^[(\[{ \u00a0]$/.test(char);
84
+ const hasProtocol = url => /^([A-Za-z][A-Za-z\d.+-]*:\/\/)|mailto:/.test(url);
85
+ const isPunctuation = char => /[?!,.;:]/.test(char);
86
+ const findChar = (text, index, predicate) => {
87
+ for (let i = index - 1; i >= 0; i--) {
88
+ const char = text.charAt(i);
89
+ if (!isZwsp(char) && predicate(char)) {
90
+ return i;
83
91
  }
92
+ }
93
+ return -1;
94
+ };
95
+ const freefallRtl = (container, offset) => {
96
+ let tempNode = container;
97
+ let tempOffset = offset;
98
+ while (isElement(tempNode) && tempNode.childNodes[tempOffset]) {
99
+ tempNode = tempNode.childNodes[tempOffset];
100
+ tempOffset = isTextNode(tempNode) ? tempNode.data.length : tempNode.childNodes.length;
101
+ }
102
+ return {
103
+ container: tempNode,
104
+ offset: tempOffset
84
105
  };
85
- var hasProtocol = function (url) {
86
- return /^([A-Za-z][A-Za-z\d.+-]*:\/\/)|mailto:/.test(url);
87
- };
88
- var isPunctuation = function (char) {
89
- return /[?!,.;:]/.test(char);
90
- };
91
- var parseCurrentLine = function (editor, endOffset) {
92
- var end, endContainer, bookmark, text, prev, len, rngText;
93
- var autoLinkPattern = getAutoLinkPattern(editor);
94
- var defaultLinkTarget = getDefaultLinkTarget(editor);
95
- if (editor.dom.getParent(editor.selection.getNode(), 'a[href]') !== null) {
96
- return;
106
+ };
107
+
108
+ const parseCurrentLine = (editor, offset) => {
109
+ var _a;
110
+ const voidElements = editor.schema.getVoidElements();
111
+ const autoLinkPattern = getAutoLinkPattern(editor);
112
+ const {dom, selection} = editor;
113
+ if (dom.getParent(selection.getNode(), 'a[href]') !== null) {
114
+ return null;
115
+ }
116
+ const rng = selection.getRng();
117
+ const textSeeker = global(dom, node => {
118
+ return dom.isBlock(node) || has(voidElements, node.nodeName.toLowerCase()) || dom.getContentEditable(node) === 'false';
119
+ });
120
+ const {
121
+ container: endContainer,
122
+ offset: endOffset
123
+ } = freefallRtl(rng.endContainer, rng.endOffset);
124
+ const root = (_a = dom.getParent(endContainer, dom.isBlock)) !== null && _a !== void 0 ? _a : dom.getRoot();
125
+ const endSpot = textSeeker.backwards(endContainer, endOffset + offset, (node, offset) => {
126
+ const text = node.data;
127
+ const idx = findChar(text, offset, not(isBracketOrSpace));
128
+ return idx === -1 || isPunctuation(text[idx]) ? idx : idx + 1;
129
+ }, root);
130
+ if (!endSpot) {
131
+ return null;
132
+ }
133
+ let lastTextNode = endSpot.container;
134
+ const startSpot = textSeeker.backwards(endSpot.container, endSpot.offset, (node, offset) => {
135
+ lastTextNode = node;
136
+ const idx = findChar(node.data, offset, isBracketOrSpace);
137
+ return idx === -1 ? idx : idx + 1;
138
+ }, root);
139
+ const newRng = dom.createRng();
140
+ if (!startSpot) {
141
+ newRng.setStart(lastTextNode, 0);
142
+ } else {
143
+ newRng.setStart(startSpot.container, startSpot.offset);
144
+ }
145
+ newRng.setEnd(endSpot.container, endSpot.offset);
146
+ const rngText = removeZwsp(newRng.toString());
147
+ const matches = rngText.match(autoLinkPattern);
148
+ if (matches) {
149
+ let url = matches[0];
150
+ if (startsWith(url, 'www.')) {
151
+ const protocol = getDefaultLinkProtocol(editor);
152
+ url = protocol + '://' + url;
153
+ } else if (contains(url, '@') && !hasProtocol(url)) {
154
+ url = 'mailto:' + url;
97
155
  }
98
- var rng = editor.selection.getRng().cloneRange();
99
- if (rng.startOffset < 5) {
100
- prev = rng.endContainer.previousSibling;
101
- if (!prev) {
102
- if (!rng.endContainer.firstChild || !rng.endContainer.firstChild.nextSibling) {
103
- return;
104
- }
105
- prev = rng.endContainer.firstChild.nextSibling;
106
- }
107
- len = prev.length;
108
- setStart(rng, prev, len);
109
- setEnd(rng, prev, len);
110
- if (rng.endOffset < 5) {
111
- return;
112
- }
113
- end = rng.endOffset;
114
- endContainer = prev;
115
- } else {
116
- endContainer = rng.endContainer;
117
- if (!isTextNode(endContainer) && endContainer.firstChild) {
118
- while (!isTextNode(endContainer) && endContainer.firstChild) {
119
- endContainer = endContainer.firstChild;
120
- }
121
- if (isTextNode(endContainer)) {
122
- setStart(rng, endContainer, 0);
123
- setEnd(rng, endContainer, endContainer.nodeValue.length);
124
- }
125
- }
126
- if (rng.endOffset === 1) {
127
- end = 2;
128
- } else {
129
- end = rng.endOffset - 1 - endOffset;
156
+ return {
157
+ rng: newRng,
158
+ url
159
+ };
160
+ } else {
161
+ return null;
162
+ }
163
+ };
164
+ const convertToLink = (editor, result) => {
165
+ const {dom, selection} = editor;
166
+ const {rng, url} = result;
167
+ const bookmark = selection.getBookmark();
168
+ selection.setRng(rng);
169
+ const command = 'createlink';
170
+ const args = {
171
+ command,
172
+ ui: false,
173
+ value: url
174
+ };
175
+ const beforeExecEvent = editor.dispatch('BeforeExecCommand', args);
176
+ if (!beforeExecEvent.isDefaultPrevented()) {
177
+ editor.getDoc().execCommand(command, false, url);
178
+ editor.dispatch('ExecCommand', args);
179
+ const defaultLinkTarget = getDefaultLinkTarget(editor);
180
+ if (isString(defaultLinkTarget)) {
181
+ const anchor = selection.getNode();
182
+ dom.setAttrib(anchor, 'target', defaultLinkTarget);
183
+ if (defaultLinkTarget === '_blank' && !allowUnsafeLinkTarget(editor)) {
184
+ dom.setAttrib(anchor, 'rel', 'noopener');
130
185
  }
131
186
  }
132
- var start = end;
133
- do {
134
- setStart(rng, endContainer, end >= 2 ? end - 2 : 0);
135
- setEnd(rng, endContainer, end >= 1 ? end - 1 : 0);
136
- end -= 1;
137
- rngText = rng.toString();
138
- } while (!rangeEqualsBracketOrSpace(rngText) && end - 2 >= 0);
139
- if (rangeEqualsBracketOrSpace(rng.toString())) {
140
- setStart(rng, endContainer, end);
141
- setEnd(rng, endContainer, start);
142
- end += 1;
143
- } else if (rng.startOffset === 0) {
144
- setStart(rng, endContainer, 0);
145
- setEnd(rng, endContainer, start);
146
- } else {
147
- setStart(rng, endContainer, end);
148
- setEnd(rng, endContainer, start);
187
+ }
188
+ selection.moveToBookmark(bookmark);
189
+ editor.nodeChanged();
190
+ };
191
+ const handleSpacebar = editor => {
192
+ const result = parseCurrentLine(editor, -1);
193
+ if (isNonNullable(result)) {
194
+ convertToLink(editor, result);
195
+ }
196
+ };
197
+ const handleBracket = handleSpacebar;
198
+ const handleEnter = editor => {
199
+ const result = parseCurrentLine(editor, 0);
200
+ if (isNonNullable(result)) {
201
+ convertToLink(editor, result);
202
+ }
203
+ };
204
+ const setup = editor => {
205
+ editor.on('keydown', e => {
206
+ if (e.keyCode === 13 && !e.isDefaultPrevented()) {
207
+ handleEnter(editor);
149
208
  }
150
- text = rng.toString();
151
- if (isPunctuation(text.charAt(text.length - 1))) {
152
- setEnd(rng, endContainer, start - 1);
209
+ });
210
+ editor.on('keyup', e => {
211
+ if (e.keyCode === 32) {
212
+ handleSpacebar(editor);
213
+ } else if (e.keyCode === 48 && e.shiftKey || e.keyCode === 221) {
214
+ handleBracket(editor);
153
215
  }
154
- text = rng.toString().trim();
155
- var matches = text.match(autoLinkPattern);
156
- var protocol = getDefaultLinkProtocol(editor);
157
- if (matches) {
158
- var url = matches[0];
159
- if (startsWith(url, 'www.')) {
160
- url = protocol + '://' + url;
161
- } else if (contains(url, '@') && !hasProtocol(url)) {
162
- url = 'mailto:' + url;
163
- }
164
- bookmark = editor.selection.getBookmark();
165
- editor.selection.setRng(rng);
166
- editor.execCommand('createlink', false, url);
167
- if (defaultLinkTarget !== false) {
168
- editor.dom.setAttrib(editor.selection.getNode(), 'target', defaultLinkTarget);
169
- }
170
- editor.selection.moveToBookmark(bookmark);
171
- editor.nodeChanged();
172
- }
173
- };
174
- var setup = function (editor) {
175
- var autoUrlDetectState;
176
- editor.on('keydown', function (e) {
177
- if (e.keyCode === 13) {
178
- return handleEnter(editor);
179
- }
180
- });
181
- if (global.browser.isIE()) {
182
- editor.on('focus', function () {
183
- if (!autoUrlDetectState) {
184
- autoUrlDetectState = true;
185
- try {
186
- editor.execCommand('AutoUrlDetect', false, true);
187
- } catch (ex) {
188
- }
189
- }
190
- });
191
- return;
192
- }
193
- editor.on('keypress', function (e) {
194
- if (e.keyCode === 41 || e.keyCode === 93 || e.keyCode === 125) {
195
- return handleBracket(editor);
196
- }
197
- });
198
- editor.on('keyup', function (e) {
199
- if (e.keyCode === 32) {
200
- return handleSpacebar(editor);
201
- }
202
- });
203
- };
216
+ });
217
+ };
204
218
 
205
- function Plugin () {
206
- global$1.add('autolink', function (editor) {
207
- setup(editor);
208
- });
209
- }
219
+ var Plugin = () => {
220
+ global$1.add('autolink', editor => {
221
+ register(editor);
222
+ setup(editor);
223
+ });
224
+ };
210
225
 
211
- Plugin();
226
+ Plugin();
212
227
 
213
- }());
228
+ })();
@@ -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 k(e){return/^[(\[{ \u00a0]$/.test(e)}function w(e){return 3===e.nodeType}function i(e){return 1===e.nodeType}function o(e,t){var n;return t<0&&(t=0),!w(e)||(n=e.data.length)<t&&(t=n),t}function y(e,t,n){!i(t)||t.hasChildNodes()?e.setStart(t,o(t,n)):e.setStartBefore(t)}function v(e,t,n){!i(t)||t.hasChildNodes()?e.setEnd(t,o(t,n)):e.setEndAfter(t)}function r(e,t){var n,i,o,r,a,f=e.getParam("autolink_pattern",A),s=e.getParam("default_link_target",!1);if(null===e.dom.getParent(e.selection.getNode(),"a[href]")){var d=e.selection.getRng().cloneRange();if(d.startOffset<5){if(!(r=d.endContainer.previousSibling)){if(!d.endContainer.firstChild||!d.endContainer.firstChild.nextSibling)return;r=d.endContainer.firstChild.nextSibling}if(y(d,r,a=r.length),v(d,r,a),d.endOffset<5)return;n=d.endOffset,i=r}else{if(!w(i=d.endContainer)&&i.firstChild){for(;!w(i)&&i.firstChild;)i=i.firstChild;w(i)&&(y(d,i,0),v(d,i,i.nodeValue.length))}n=1===d.endOffset?2:d.endOffset-1-t}for(var l=n;y(d,i,2<=n?n-2:0),v(d,i,1<=n?n-1:0),--n,!k(d.toString())&&0<=n-2;);k(d.toString())?(y(d,i,n),v(d,i,l),n+=1):(0===d.startOffset?y(d,i,0):y(d,i,n),v(d,i,l)),u=d.toString(),/[?!,.;:]/.test(u.charAt(u.length-1))&&v(d,i,l-1);var u,c,g,h,C=(u=d.toString().trim()).match(f),m=e.getParam("link_default_protocol","http","string");C&&((g=c=C[0]).length>=(h="www.").length&&g.substr(0,0+h.length)===h?c=m+"://"+c:-1===c.indexOf("@")||/^([A-Za-z][A-Za-z\d.+-]*:\/\/)|mailto:/.test(c)||(c="mailto:"+c),o=e.selection.getBookmark(),e.selection.setRng(d),e.execCommand("createlink",!1,c),!1!==s&&e.dom.setAttrib(e.selection.getNode(),"target",s),e.selection.moveToBookmark(o),e.nodeChanged())}}var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),a=tinymce.util.Tools.resolve("tinymce.Env"),A=new RegExp("^"+/(?:[A-Za-z][A-Za-z\d.+-]{0,14}:\/\/(?:[-.~*+=!&;:'%@?^${}(),\w]+@)?|www\.|[-;:&=+$,.\w]+@)[A-Za-z\d-]+(?:\.[A-Za-z\d-]+)*(?::\d+)?(?:\/(?:[-.~*+=!;:'%@$(),\/\w]*[-~*+=%@$()\/\w])?)?(?:\?(?:[-.~*+=!&;:'%@?^${}(),\/\w]+))?(?:#(?:[-.~*+=!&;:'%@?^${}(),\/\w]+))?/g.source+"$","i");e.add("autolink",function(e){var t,n;(t=e).on("keydown",function(e){if(13===e.keyCode)return r(t,-1)}),a.browser.isIE()?t.on("focus",function(){if(!n){n=!0;try{t.execCommand("AutoUrlDetect",!1,!0)}catch(e){}}}):(t.on("keypress",function(e){if(41===e.keyCode||93===e.keyCode||125===e.keyCode)return r(t,-1)}),t.on("keyup",function(e){if(32===e.keyCode)return r(t,0)}))})}();
4
+ !function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager");const t=e=>t=>t.options.get(e),n=t("autolink_pattern"),o=t("link_default_target"),r=t("link_default_protocol"),a=t("allow_unsafe_link_target"),s=("string",e=>"string"===(e=>{const t=typeof e;return null===e?"null":"object"===t&&Array.isArray(e)?"array":"object"===t&&(n=o=e,(r=String).prototype.isPrototypeOf(n)||(null===(a=o.constructor)||void 0===a?void 0:a.name)===r.name)?"string":t;var n,o,r,a})(e));const l=(void 0,e=>undefined===e);const i=e=>!(e=>null==e)(e),c=Object.hasOwnProperty,d=e=>"\ufeff"===e;var u=tinymce.util.Tools.resolve("tinymce.dom.TextSeeker");const f=e=>/^[(\[{ \u00a0]$/.test(e),g=(e,t,n)=>{for(let o=t-1;o>=0;o--){const t=e.charAt(o);if(!d(t)&&n(t))return o}return-1},m=(e,t)=>{var o;const a=e.schema.getVoidElements(),s=n(e),{dom:i,selection:d}=e;if(null!==i.getParent(d.getNode(),"a[href]"))return null;const m=d.getRng(),k=u(i,(e=>{return i.isBlock(e)||(t=a,n=e.nodeName.toLowerCase(),c.call(t,n))||"false"===i.getContentEditable(e);var t,n})),{container:p,offset:y}=((e,t)=>{let n=e,o=t;for(;1===n.nodeType&&n.childNodes[o];)n=n.childNodes[o],o=3===n.nodeType?n.data.length:n.childNodes.length;return{container:n,offset:o}})(m.endContainer,m.endOffset),w=null!==(o=i.getParent(p,i.isBlock))&&void 0!==o?o:i.getRoot(),h=k.backwards(p,y+t,((e,t)=>{const n=e.data,o=g(n,t,(r=f,e=>!r(e)));var r,a;return-1===o||(a=n[o],/[?!,.;:]/.test(a))?o:o+1}),w);if(!h)return null;let v=h.container;const _=k.backwards(h.container,h.offset,((e,t)=>{v=e;const n=g(e.data,t,f);return-1===n?n:n+1}),w),A=i.createRng();_?A.setStart(_.container,_.offset):A.setStart(v,0),A.setEnd(h.container,h.offset);const C=A.toString().replace(/\uFEFF/g,"").match(s);if(C){let t=C[0];return $="www.",(b=t).length>=4&&b.substr(0,4)===$?t=r(e)+"://"+t:((e,t,n=0,o)=>{const r=e.indexOf(t,n);return-1!==r&&(!!l(o)||r+t.length<=o)})(t,"@")&&!(e=>/^([A-Za-z][A-Za-z\d.+-]*:\/\/)|mailto:/.test(e))(t)&&(t="mailto:"+t),{rng:A,url:t}}var b,$;return null},k=(e,t)=>{const{dom:n,selection:r}=e,{rng:l,url:i}=t,c=r.getBookmark();r.setRng(l);const d="createlink",u={command:d,ui:!1,value:i};if(!e.dispatch("BeforeExecCommand",u).isDefaultPrevented()){e.getDoc().execCommand(d,!1,i),e.dispatch("ExecCommand",u);const t=o(e);if(s(t)){const o=r.getNode();n.setAttrib(o,"target",t),"_blank"!==t||a(e)||n.setAttrib(o,"rel","noopener")}}r.moveToBookmark(c),e.nodeChanged()},p=e=>{const t=m(e,-1);i(t)&&k(e,t)},y=p;e.add("autolink",(e=>{(e=>{const t=e.options.register;t("autolink_pattern",{processor:"regexp",default:new RegExp("^"+/(?:[A-Za-z][A-Za-z\d.+-]{0,14}:\/\/(?:[-.~*+=!&;:'%@?^${}(),\w]+@)?|www\.|[-;:&=+$,.\w]+@)[A-Za-z\d-]+(?:\.[A-Za-z\d-]+)*(?::\d+)?(?:\/(?:[-.~*+=!;:'%@$(),\/\w]*[-~*+=%@$()\/\w])?)?(?:\?(?:[-.~*+=!&;:'%@?^${}(),\/\w]+))?(?:#(?:[-.~*+=!&;:'%@?^${}(),\/\w]+))?/g.source+"$","i")}),t("link_default_target",{processor:"string"}),t("link_default_protocol",{processor:"string",default:"https"})})(e),(e=>{e.on("keydown",(t=>{13!==t.keyCode||t.isDefaultPrevented()||(e=>{const t=m(e,0);i(t)&&k(e,t)})(e)})),e.on("keyup",(t=>{32===t.keyCode?p(e):(48===t.keyCode&&t.shiftKey||221===t.keyCode)&&y(e)}))})(e)}))}();