@sapui5/sap.ui.richtexteditor 1.111.2 → 1.111.3

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 (195) hide show
  1. package/package.json +1 -1
  2. package/src/sap/ui/richtexteditor/.library +2 -2
  3. package/src/sap/ui/richtexteditor/RTESplitButton.js +1 -1
  4. package/src/sap/ui/richtexteditor/js/tiny_mce6/icons/default/icons.js +4 -1
  5. package/src/sap/ui/richtexteditor/js/tiny_mce6/icons/default/icons.min.js +1 -1
  6. package/src/sap/ui/richtexteditor/js/tiny_mce6/langs/ar.js +1 -1
  7. package/src/sap/ui/richtexteditor/js/tiny_mce6/langs/bg_BG.js +1 -1
  8. package/src/sap/ui/richtexteditor/js/tiny_mce6/langs/ca.js +1 -1
  9. package/src/sap/ui/richtexteditor/js/tiny_mce6/langs/cs.js +1 -1
  10. package/src/sap/ui/richtexteditor/js/tiny_mce6/langs/cy.js +0 -6
  11. package/src/sap/ui/richtexteditor/js/tiny_mce6/langs/da.js +1 -1
  12. package/src/sap/ui/richtexteditor/js/tiny_mce6/langs/de.js +1 -1
  13. package/src/sap/ui/richtexteditor/js/tiny_mce6/langs/dv.js +0 -6
  14. package/src/sap/ui/richtexteditor/js/tiny_mce6/langs/el.js +1 -1
  15. package/src/sap/ui/richtexteditor/js/tiny_mce6/langs/es.js +1 -1
  16. package/src/sap/ui/richtexteditor/js/tiny_mce6/langs/es_MX.js +1 -7
  17. package/src/sap/ui/richtexteditor/js/tiny_mce6/langs/et.js +0 -6
  18. package/src/sap/ui/richtexteditor/js/tiny_mce6/langs/eu.js +7 -0
  19. package/src/sap/ui/richtexteditor/js/tiny_mce6/langs/fa.js +7 -0
  20. package/src/sap/ui/richtexteditor/js/tiny_mce6/langs/fi.js +1 -1
  21. package/src/sap/ui/richtexteditor/js/tiny_mce6/langs/fr_FR.js +1 -1
  22. package/src/sap/ui/richtexteditor/js/tiny_mce6/langs/he_IL.js +1 -1
  23. package/src/sap/ui/richtexteditor/js/tiny_mce6/langs/hi.js +1 -1
  24. package/src/sap/ui/richtexteditor/js/tiny_mce6/langs/hr.js +1 -1
  25. package/src/sap/ui/richtexteditor/js/tiny_mce6/langs/hu_HU.js +1 -1
  26. package/src/sap/ui/richtexteditor/js/tiny_mce6/langs/id.js +1 -1
  27. package/src/sap/ui/richtexteditor/js/tiny_mce6/langs/it.js +1 -1
  28. package/src/sap/ui/richtexteditor/js/tiny_mce6/langs/ja.js +1 -1
  29. package/src/sap/ui/richtexteditor/js/tiny_mce6/langs/kk.js +1 -1
  30. package/src/sap/ui/richtexteditor/js/tiny_mce6/langs/ko_KR.js +1 -1
  31. package/src/sap/ui/richtexteditor/js/tiny_mce6/langs/lt.js +1 -7
  32. package/src/sap/ui/richtexteditor/js/tiny_mce6/langs/lv.js +0 -6
  33. package/src/sap/ui/richtexteditor/js/tiny_mce6/langs/ms.js +1 -1
  34. package/src/sap/ui/richtexteditor/js/tiny_mce6/langs/nb_NO.js +1 -1
  35. package/src/sap/ui/richtexteditor/js/tiny_mce6/langs/nl.js +1 -1
  36. package/src/sap/ui/richtexteditor/js/tiny_mce6/langs/pl.js +1 -1
  37. package/src/sap/ui/richtexteditor/js/tiny_mce6/langs/pt_BR.js +7 -0
  38. package/src/sap/ui/richtexteditor/js/tiny_mce6/langs/pt_PT.js +1 -1
  39. package/src/sap/ui/richtexteditor/js/tiny_mce6/langs/ro.js +1 -1
  40. package/src/sap/ui/richtexteditor/js/tiny_mce6/langs/ru.js +1 -1
  41. package/src/sap/ui/richtexteditor/js/tiny_mce6/langs/sk.js +1 -1
  42. package/src/sap/ui/richtexteditor/js/tiny_mce6/langs/sl_SI.js +1 -1
  43. package/src/sap/ui/richtexteditor/js/tiny_mce6/langs/sr.js +0 -6
  44. package/src/sap/ui/richtexteditor/js/tiny_mce6/langs/sv_SE.js +1 -1
  45. package/src/sap/ui/richtexteditor/js/tiny_mce6/langs/th_TH.js +1 -1
  46. package/src/sap/ui/richtexteditor/js/tiny_mce6/langs/tr.js +1 -1
  47. package/src/sap/ui/richtexteditor/js/tiny_mce6/langs/uk.js +1 -1
  48. package/src/sap/ui/richtexteditor/js/tiny_mce6/langs/vi.js +1 -1
  49. package/src/sap/ui/richtexteditor/js/tiny_mce6/langs/zh_CN.js +1 -1
  50. package/src/sap/ui/richtexteditor/js/tiny_mce6/langs/zh_TW.js +1 -1
  51. package/src/sap/ui/richtexteditor/js/tiny_mce6/models/dom/model.js +14 -10
  52. package/src/sap/ui/richtexteditor/js/tiny_mce6/models/dom/model.min.js +2 -2
  53. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/advcode/CHANGELOG.md +7 -0
  54. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/advcode/codemirror.min.css +2 -2
  55. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/advcode/codemirror.min.js +1 -1
  56. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/advcode/customeditor.js +2 -2
  57. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/advcode/customeditor.min.js +2 -2
  58. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/advcode/langs/ar.js +10 -0
  59. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/advcode/langs/bg_BG.js +10 -0
  60. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/advcode/langs/ca.js +10 -0
  61. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/advcode/langs/cs.js +10 -0
  62. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/advcode/langs/da.js +10 -0
  63. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/advcode/langs/de.js +10 -0
  64. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/advcode/langs/el.js +10 -0
  65. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/advcode/langs/es.js +10 -0
  66. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/advcode/langs/eu.js +10 -0
  67. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/advcode/langs/fa.js +10 -0
  68. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/advcode/langs/fi.js +10 -0
  69. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/advcode/langs/fr_FR.js +10 -0
  70. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/advcode/langs/he_IL.js +10 -0
  71. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/advcode/langs/hi.js +10 -0
  72. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/advcode/langs/hr.js +10 -0
  73. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/advcode/langs/hu_HU.js +10 -0
  74. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/advcode/langs/id.js +10 -0
  75. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/advcode/langs/it.js +10 -0
  76. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/advcode/langs/ja.js +10 -0
  77. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/advcode/langs/kk.js +10 -0
  78. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/advcode/langs/ko_KR.js +10 -0
  79. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/advcode/langs/ms.js +10 -0
  80. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/advcode/langs/nb_NO.js +10 -0
  81. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/advcode/langs/nl.js +10 -0
  82. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/advcode/langs/pl.js +10 -0
  83. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/advcode/langs/pt_BR.js +10 -0
  84. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/advcode/langs/pt_PT.js +10 -0
  85. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/advcode/langs/ro.js +10 -0
  86. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/advcode/langs/ru.js +10 -0
  87. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/advcode/langs/sk.js +10 -0
  88. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/advcode/langs/sl_SI.js +10 -0
  89. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/advcode/langs/sv_SE.js +10 -0
  90. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/advcode/langs/th_TH.js +10 -0
  91. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/advcode/langs/tr.js +10 -0
  92. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/advcode/langs/uk.js +10 -0
  93. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/advcode/langs/vi.js +10 -0
  94. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/advcode/langs/zh_CN.js +10 -0
  95. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/advcode/langs/zh_TW.js +10 -0
  96. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/advcode/plugin.js +2 -2
  97. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/advcode/plugin.min.js +2 -2
  98. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/advcode/readme.txt +1 -1
  99. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/advcode/version.txt +1 -1
  100. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/advlist/plugin.js +16 -9
  101. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/advlist/plugin.min.js +2 -2
  102. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/anchor/plugin.js +7 -6
  103. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/anchor/plugin.min.js +2 -2
  104. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/autolink/plugin.js +131 -107
  105. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/autolink/plugin.min.js +2 -2
  106. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/autoresize/plugin.js +3 -2
  107. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/autoresize/plugin.min.js +2 -2
  108. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/autosave/plugin.js +11 -10
  109. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/autosave/plugin.min.js +2 -2
  110. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/charmap/plugin.js +17 -7
  111. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/charmap/plugin.min.js +2 -2
  112. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/code/plugin.js +1 -1
  113. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/code/plugin.min.js +1 -1
  114. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/codesample/plugin.js +23 -10
  115. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/codesample/plugin.min.js +2 -2
  116. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/directionality/plugin.js +1 -1
  117. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/directionality/plugin.min.js +1 -1
  118. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/emoticons/plugin.js +10 -4
  119. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/emoticons/plugin.min.js +2 -2
  120. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/fullscreen/plugin.js +11 -5
  121. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/fullscreen/plugin.min.js +2 -2
  122. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/help/plugin.js +107 -24
  123. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/help/plugin.min.js +2 -2
  124. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/image/plugin.js +50 -37
  125. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/image/plugin.min.js +2 -2
  126. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/importcss/plugin.js +8 -6
  127. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/importcss/plugin.min.js +2 -2
  128. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/insertdatetime/plugin.js +2 -3
  129. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/insertdatetime/plugin.min.js +2 -2
  130. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/link/plugin.js +68 -45
  131. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/link/plugin.min.js +2 -2
  132. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/lists/plugin.js +120 -74
  133. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/lists/plugin.min.js +2 -2
  134. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/media/plugin.js +39 -24
  135. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/media/plugin.min.js +2 -2
  136. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/nonbreaking/plugin.js +1 -1
  137. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/nonbreaking/plugin.min.js +1 -1
  138. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/pagebreak/plugin.js +2 -2
  139. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/pagebreak/plugin.min.js +2 -2
  140. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/powerpaste/CHANGELOG.md +13 -5
  141. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/powerpaste/js/wordimport.js +2850 -1729
  142. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/powerpaste/plugin.js +2 -2
  143. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/powerpaste/plugin.min.js +2 -2
  144. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/powerpaste/readme.txt +1 -1
  145. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/powerpaste/version.txt +1 -1
  146. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/preview/plugin.js +1 -1
  147. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/preview/plugin.min.js +1 -1
  148. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/quickbars/plugin.js +21 -13
  149. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/quickbars/plugin.min.js +2 -2
  150. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/save/plugin.js +1 -1
  151. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/save/plugin.min.js +1 -1
  152. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/searchreplace/plugin.js +13 -13
  153. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/searchreplace/plugin.min.js +2 -2
  154. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/table/plugin.js +42 -37
  155. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/table/plugin.min.js +2 -2
  156. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/template/plugin.js +7 -4
  157. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/template/plugin.min.js +2 -2
  158. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/visualblocks/plugin.js +1 -1
  159. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/visualblocks/plugin.min.js +1 -1
  160. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/visualchars/plugin.js +9 -6
  161. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/visualchars/plugin.min.js +2 -2
  162. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/wordcount/plugin.js +6 -5
  163. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/wordcount/plugin.min.js +2 -2
  164. package/src/sap/ui/richtexteditor/js/tiny_mce6/readme.txt +1 -1
  165. package/src/sap/ui/richtexteditor/js/tiny_mce6/skins/ui/oxide/content.css +31 -0
  166. package/src/sap/ui/richtexteditor/js/tiny_mce6/skins/ui/oxide/content.inline.css +31 -0
  167. package/src/sap/ui/richtexteditor/js/tiny_mce6/skins/ui/oxide/content.inline.min.css +1 -1
  168. package/src/sap/ui/richtexteditor/js/tiny_mce6/skins/ui/oxide/content.min.css +1 -1
  169. package/src/sap/ui/richtexteditor/js/tiny_mce6/skins/ui/oxide/skin.css +155 -46
  170. package/src/sap/ui/richtexteditor/js/tiny_mce6/skins/ui/oxide/skin.min.css +1 -1
  171. package/src/sap/ui/richtexteditor/js/tiny_mce6/skins/ui/oxide-dark/content.css +31 -0
  172. package/src/sap/ui/richtexteditor/js/tiny_mce6/skins/ui/oxide-dark/content.inline.css +31 -0
  173. package/src/sap/ui/richtexteditor/js/tiny_mce6/skins/ui/oxide-dark/content.inline.min.css +1 -1
  174. package/src/sap/ui/richtexteditor/js/tiny_mce6/skins/ui/oxide-dark/content.min.css +1 -1
  175. package/src/sap/ui/richtexteditor/js/tiny_mce6/skins/ui/oxide-dark/skin.css +149 -40
  176. package/src/sap/ui/richtexteditor/js/tiny_mce6/skins/ui/oxide-dark/skin.min.css +1 -1
  177. package/src/sap/ui/richtexteditor/js/tiny_mce6/skins/ui/tinymce-5/content.css +31 -0
  178. package/src/sap/ui/richtexteditor/js/tiny_mce6/skins/ui/tinymce-5/content.inline.css +31 -0
  179. package/src/sap/ui/richtexteditor/js/tiny_mce6/skins/ui/tinymce-5/content.inline.min.css +1 -1
  180. package/src/sap/ui/richtexteditor/js/tiny_mce6/skins/ui/tinymce-5/content.min.css +1 -1
  181. package/src/sap/ui/richtexteditor/js/tiny_mce6/skins/ui/tinymce-5/skin.css +164 -46
  182. package/src/sap/ui/richtexteditor/js/tiny_mce6/skins/ui/tinymce-5/skin.min.css +1 -1
  183. package/src/sap/ui/richtexteditor/js/tiny_mce6/skins/ui/tinymce-5-dark/content.css +31 -0
  184. package/src/sap/ui/richtexteditor/js/tiny_mce6/skins/ui/tinymce-5-dark/content.inline.css +31 -0
  185. package/src/sap/ui/richtexteditor/js/tiny_mce6/skins/ui/tinymce-5-dark/content.inline.min.css +1 -1
  186. package/src/sap/ui/richtexteditor/js/tiny_mce6/skins/ui/tinymce-5-dark/content.min.css +1 -1
  187. package/src/sap/ui/richtexteditor/js/tiny_mce6/skins/ui/tinymce-5-dark/skin.css +157 -39
  188. package/src/sap/ui/richtexteditor/js/tiny_mce6/skins/ui/tinymce-5-dark/skin.min.css +1 -1
  189. package/src/sap/ui/richtexteditor/js/tiny_mce6/themes/silver/theme.js +4874 -2361
  190. package/src/sap/ui/richtexteditor/js/tiny_mce6/themes/silver/theme.min.js +2 -2
  191. package/src/sap/ui/richtexteditor/js/tiny_mce6/tinymce.d.ts +406 -185
  192. package/src/sap/ui/richtexteditor/js/tiny_mce6/tinymce.js +3915 -3078
  193. package/src/sap/ui/richtexteditor/js/tiny_mce6/tinymce.min.js +2 -2
  194. package/src/sap/ui/richtexteditor/js/tiny_mce6/version.txt +1 -1
  195. package/src/sap/ui/richtexteditor/library.js +1 -1
@@ -4,7 +4,7 @@
4
4
  * Copyright (c) 2022 Ephox Corporation DBA Tiny Technologies, Inc.
5
5
  * Licensed under the Tiny commercial license. See https://www.tiny.cloud/legal/
6
6
  *
7
- * Version: 3.0.2-34
7
+ * Version: 3.1.0-57
8
8
  */
9
9
 
10
- !function(){"use strict";const e=e=>parseInt(e,10),t=(e,t)=>{const r=e-t;return 0===r?0:r>0?1:-1},r=(e,t,r)=>({major:e,minor:t,patch:r}),o=t=>{const o=/([0-9]+)\.([0-9]+)\.([0-9]+)(?:(\-.+)?)/.exec(t);return o?r(e(o[1]),e(o[2]),e(o[3])):r(0,0,0)},n=e=>t=>t.options.get(e),i=n("codemirror_script"),s=n("codemirror_css"),c=n("codemirror_linewrapping"),a=n("codemirror_linenumbers"),u=n("codemirror_foldgutter"),d=n("codemirror_gutter"),l=n("codemirror_theme"),m=e=>"rtl"===e.getBody().dir?"rtl":"ltr",h=("function",e=>"function"==typeof e);const g=(!1,()=>false);class p{constructor(e,t){this.tag=e,this.value=t}static some(e){return new p(!0,e)}static none(){return p.singletonNone}fold(e,t){return this.tag?t(this.value):e()}isSome(){return this.tag}isNone(){return!this.tag}map(e){return this.tag?p.some(e(this.value)):p.none()}bind(e){return this.tag?e(this.value):p.none()}exists(e){return this.tag&&e(this.value)}forall(e){return!this.tag||e(this.value)}filter(e){return!this.tag||e(this.value)?this:p.none()}getOr(e){return this.tag?this.value:e}or(e){return this.tag?this:e}getOrThunk(e){return this.tag?this.value:e()}orThunk(e){return this.tag?this:e()}getOrDie(e){if(this.tag)return this.value;throw new Error(null!=e?e:"Called getOrDie on None")}static from(e){return null==e?p.none():p.some(e)}getOrNull(){return this.tag?this.value:null}getOrUndefined(){return this.value}each(e){this.tag&&e(this.value)}toArray(){return this.tag?[this.value]:[]}toString(){return this.tag?`some(${this.value})`:"none()"}}p.singletonNone=new p(!1);const f=Object.hasOwnProperty,v=e=>{if(null==e)throw new Error("Node cannot be null or undefined");return{dom:e}},w=(e,t)=>{const r=(t||document).createElement("div");if(r.innerHTML=e,!r.hasChildNodes()||r.childNodes.length>1){const t="HTML does not have a single root node";throw console.error(t,e),new Error(t)}return v(r.childNodes[0])},b=v;"undefined"!=typeof window?window:Function("return this;")();const y=e=>{const t=e.dom;null!==t.parentNode&&t.parentNode.removeChild(t)},_=(e,t,r)=>{let o=e.dom;const n=h(r)?r:g;for(;o.parentNode;){o=o.parentNode;const e=b(o);if(t(e))return p.some(e);if(n(e))break}return p.none()},N="\x3c!--mce_cursor--\x3e",C=(e,t)=>{const r=e.dom,o=e.selection,n=o.getBookmark(),i=(e=>{return t=e,f.call(t,"name");var t})(n)?r.select(n.name)[n.index]:r.select(`#${n.id}_start`)[0],s=p.from(i).map((t=>{const r=b(e.getBody());return((e,t)=>{const o=w(N),n=b(e),i=((e,t,r)=>((e,t,r,o,n)=>o(r)?p.some(r):h(n)&&n(r)?p.none():t(r,o,n))(0,_,e,t,r))(n,(e=>((e,t)=>{const r=e.dom;return!(!r||!r.hasAttribute)&&r.hasAttribute("data-mce-bogus")})(e)),(e=>{return t=r,e.dom===t.dom;var t})).getOr(n);return((e,t)=>{const r=(e=>p.from(e.dom.parentNode).map(b))(e);r.each((r=>{r.dom.insertBefore(t.dom,e.dom)}))})(i,o),o})(t)})),c=t();return s.each(y),o.moveToBookmark(n),c},O=e=>({name:"codeview",type:"customeditor",tag:"div",scriptId:"tinymce.plugins.advcode.customeditor",scriptUrl:e.customEditorScriptUrl,settings:e}),S=(e,t)=>{const r=(e=>{const t=(e=>{const t=e.split(/\r?\n/);return((e,t)=>{for(let r=0;r<e.length;r++){const o=t(e[r],r);if(o.isSome())return o}return p.none()})(t,((e,r)=>{const o=e.indexOf(N);return(n=-1!==o,i=o,n?p.some(i):p.none()).map((o=>e===N?0===r?{line:r,ch:0}:{line:r-1,ch:t[r-1].length}:{line:r,ch:o}));var n,i})).getOr({line:0,ch:0})})(C(e,(()=>e.getContent({source_view:!0}))));return{content:e.getContent({source_view:!0}),cursor:t}})(e),o={...t,cursor:r.cursor},n={title:"Source Code",size:"large",body:{type:"panel",items:[O(o)]},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:{codeview:r.content},onSubmit:t=>{((e,t)=>{e.focus(),e.undoManager.transact((()=>{e.setContent(t)})),e.selection.setCursorLocation(),e.nodeChanged()})(e,t.getData().codeview),t.close()}};e.windowManager.open(n)};tinymce.PluginManager.add("advcode",((e,r)=>{((e,r)=>!!e&&-1===((e,r)=>{const o=t(e.major,r.major);if(0!==o)return o;const n=t(e.minor,r.minor);if(0!==n)return n;const i=t(e.patch,r.patch);return 0!==i?i:0})((e=>o((e=>[e.majorVersion,e.minorVersion].join(".").split(".").slice(0,3).join("."))(e)))(e),o(r)))(tinymce,"6.0.0")?console.error("The advcode plugin requires at least version 6.0.0 of TinyMCE."):((e,t)=>{((e,t)=>{const r=e.options.register;r("codemirror_script",{processor:"string",default:t+"/codemirror.min.js"}),r("codemirror_css",{processor:"string",default:t+"/codemirror.min.css"}),r("codemirror_linewrapping",{processor:"boolean",default:!0}),r("codemirror_linenumbers",{processor:"boolean",default:!0}),r("codemirror_foldgutter",{processor:"boolean",default:!0}),r("codemirror_gutter",{processor:"boolean",default:!0}),r("codemirror_theme",{processor:"string",default:"default"})})(e,t);const r="sourcecode",o=((e,t,r)=>()=>{const o=((e,t)=>({customEditorScriptUrl:t+"/customeditor.min.js",codeMirrorScriptUrl:i(e),codeMirrorCssUrl:s(e),lineWrapping:c(e),lineNumbers:a(e),foldGutter:u(e),theme:l(e),direction:m(e),gutter:d(e),editorId:e.id}))(t,r);e(t,o)})(S,e,t);e.addCommand("mceCodeEditor",o),e.ui.registry.addButton("code",{icon:r,tooltip:"Source code",onAction:o}),e.ui.registry.addMenuItem("code",{icon:r,text:"Source code",onAction:o})})(e,r)}))}();
10
+ !function(){"use strict";const e=e=>parseInt(e,10),t=(e,t)=>{const o=e-t;return 0===o?0:o>0?1:-1},o=(e,t,o)=>({major:e,minor:t,patch:o}),r=t=>{const r=/([0-9]+)\.([0-9]+)\.([0-9]+)(?:(\-.+)?)/.exec(t);return r?o(e(r[1]),e(r[2]),e(r[3])):o(0,0,0)},n=e=>t=>t.options.get(e),s=n("codemirror_script"),i=n("codemirror_css"),c=n("codemirror_linewrapping"),d=n("codemirror_linenumbers"),a=n("codemirror_foldgutter"),l=n("codemirror_gutter"),u=n("codemirror_theme"),m=e=>"rtl"===e.getBody().dir?"rtl":"ltr",g=n("advcode_headless"),h=n("advcode_inline"),p=(e,t)=>({customEditorScriptUrl:t+"/customeditor.min.js",codeMirrorScriptUrl:s(e),codeMirrorCssUrl:i(e),lineWrapping:c(e),lineNumbers:d(e),foldGutter:a(e),theme:u(e),direction:m(e),gutter:l(e),editorId:e.id}),v=e=>t=>typeof t===e,f=e=>"string"===(e=>{const t=typeof e;return null===e?"null":"object"===t&&Array.isArray(e)?"array":"object"===t&&(o=r=e,(n=String).prototype.isPrototypeOf(o)||(null===(s=r.constructor)||void 0===s?void 0:s.name)===n.name)?"string":t;var o,r,n,s})(e),y=v("boolean"),b=e=>!(e=>null==e)(e),C=v("function"),w=v("number"),_=()=>{},T=()=>!1;class S{constructor(e,t){this.tag=e,this.value=t}static some(e){return new S(!0,e)}static none(){return S.singletonNone}fold(e,t){return this.tag?t(this.value):e()}isSome(){return this.tag}isNone(){return!this.tag}map(e){return this.tag?S.some(e(this.value)):S.none()}bind(e){return this.tag?e(this.value):S.none()}exists(e){return this.tag&&e(this.value)}forall(e){return!this.tag||e(this.value)}filter(e){return!this.tag||e(this.value)?this:S.none()}getOr(e){return this.tag?this.value:e}or(e){return this.tag?this:e}getOrThunk(e){return this.tag?this.value:e()}orThunk(e){return this.tag?this:e()}getOrDie(e){if(this.tag)return this.value;throw new Error(null!=e?e:"Called getOrDie on None")}static from(e){return b(e)?S.some(e):S.none()}getOrNull(){return this.tag?this.value:null}getOrUndefined(){return this.value}each(e){this.tag&&e(this.value)}toArray(){return this.tag?[this.value]:[]}toString(){return this.tag?`some(${this.value})`:"none()"}}S.singletonNone=new S(!1);const E=Object.hasOwnProperty,N=(e,t)=>E.call(e,t);"undefined"!=typeof window?window:Function("return this;")();const k=e=>t=>(e=>e.dom.nodeType)(t)===e,A=k(1),M=k(9),x=k(11),O=e=>{if(null==e)throw new Error("Node cannot be null or undefined");return{dom:e}},L=(e,t)=>{const o=(t||document).createElement("div");if(o.innerHTML=e,!o.hasChildNodes()||o.childNodes.length>1){const t="HTML does not have a single root node";throw console.error(t,e),new Error(t)}return O(o.childNodes[0])},I=(e,t)=>{const o=(t||document).createElement(e);return O(o)},V=O,P=e=>M(e)?e:V(e.dom.ownerDocument),j=(e,t)=>{e.dom.appendChild(t.dom)},B=C(Element.prototype.attachShadow)&&C(Node.prototype.getRootNode)?e=>V(e.dom.getRootNode()):P,R=()=>D(V(document)),D=e=>{const t=e.dom.body;if(null==t)throw new Error("Body is not available yet");return V(t)},U=(e,t,o)=>{let r=e.dom;const n=C(o)?o:T;for(;r.parentNode;){r=r.parentNode;const e=V(r);if(t(e))return S.some(e);if(n(e))break}return S.none()},G=e=>{const t=e.dom;null!==t.parentNode&&t.parentNode.removeChild(t)},H="\x3c!--mce_cursor--\x3e",W=(e,t)=>{const o=e.dom,r=e.selection,n=r.getBookmark(),s=(e=>N(e,"name"))(n)?o.select(n.name)[n.index]:o.select(`#${n.id}_start`)[0],i=S.from(s).map((t=>{const o=V(e.getBody());return((e,t)=>{const r=L(H),n=V(e),s=((e,t,o)=>((e,t,o,r,n)=>r(o)?S.some(o):C(n)&&n(o)?S.none():t(o,r,n))(0,U,e,t,o))(n,(e=>((e,t)=>{const o=e.dom;return!(!o||!o.hasAttribute)&&o.hasAttribute("data-mce-bogus")})(e)),(e=>{return t=o,e.dom===t.dom;var t})).getOr(n);return((e,t)=>{const o=(e=>S.from(e.dom.parentNode).map(V))(e);o.each((o=>{o.dom.insertBefore(t.dom,e.dom)}))})(s,r),r})(t)})),c=t();return i.each(G),r.moveToBookmark(n),c},q=e=>{const t=(e=>{const t=e.split(/\r?\n/);return((e,t)=>{for(let o=0;o<e.length;o++){const r=t(e[o],o);if(r.isSome())return r}return S.none()})(t,((e,o)=>{const r=e.indexOf(H);return(n=-1!==r,s=r,n?S.some(s):S.none()).map((r=>e===H?0===o?{line:o,ch:0}:{line:o-1,ch:t[o-1].length}:{line:o,ch:r}));var n,s})).getOr({line:0,ch:0})})(W(e,(()=>e.getContent({source_view:!0}))));return{content:e.getContent({source_view:!0}),cursor:t}},z=(e,t)=>{e.focus(),e.undoManager.transact((()=>{e.setContent(t)})),e.selection.setCursorLocation(),e.nodeChanged()},F=e=>{return(t=tinymce,"get",N(t,"get")?S.from(t.get):S.none()).bind((t=>S.from(t.call(tinymce,e))));var t},K=(e,t)=>((e,t,o)=>{const r=((e,t)=>{const o=((e,t)=>{const o=e.dom.getAttribute("class");return null===o?void 0:o})(e);return void 0===o||""===o?[]:o.split(" ")})(e);return((e,t,o)=>{((e,t,o)=>{if(!(f(o)||y(o)||w(o)))throw console.error("Invalid call to Attribute.set. Key ",t,":: Value ",o,":: Element ",e),new Error("Attribute value was not simple");e.setAttribute(t,o+"")})(e.dom,t,o)})(e,t,r.concat([o]).join(" ")),!0})(e,"class",t),$=(e,t)=>{(e=>void 0!==e.dom.classList)(e)?e.dom.classList.add(t):K(e,t)},J=(e,t,o,r="")=>{const n=(e=>{const t=F(e).map((e=>{const t=B(V(e.getElement()));return(e=>x(e)&&b(e.dom.host))(o=t)?o:V(P(o).dom.body);var o})).getOrThunk(R);if(A(t))return{element:t,destroy:_};{const e=I("div");return j(t,e),{element:e,destroy:()=>G(e)}}})(o.editorId),s=((e,t)=>{const o=(o,r)=>(r&&!r()||setTimeout((()=>{o.state.completionActive||o.showHint({completeSingle:!1,container:t})}),100),e.Pass);return{completeAfter:o,completeIfAfterLt:t=>o(t,(()=>{const o=t.getCursor();return"<"===t.getRange(e.Pos(o.line,o.ch-1),o)})),completeIfInTag:t=>o(t,(()=>{const o=t.getTokenAt(t.getCursor());return!!("string"!==o.type||/['"]/.test(o.string.charAt(o.string.length-1))&&1!==o.string.length)&&e.innerMode(t.getMode(),o.state).state.tagName}))}})(e,n.element.dom),i={lineWrapping:o.lineWrapping,lineNumbers:o.lineNumbers,foldGutter:o.foldGutter,theme:o.theme,direction:o.direction,matchTags:{bothTags:!0},keyMap:"sublime",gutters:o.gutter?["CodeMirror-linenumbers","CodeMirror-foldgutter"]:[],extraKeys:{"Alt-F":"findPersistent","Ctrl-J":"toMatchingTag","Ctrl-B":"selectNextOccurrence","'<'":s.completeAfter,"'/'":s.completeIfAfterLt,"' '":s.completeIfInTag,"'='":s.completeIfInTag,"Ctrl-Q":e=>{e.foldCode(e.getCursor())}},mode:"text/html",value:r},c=e(t,i),d=e=>{27!==e.keyCode&&e.stopPropagation()};t.addEventListener("keyup",d),t.addEventListener("keydown",d),t.addEventListener("keypress",d),setTimeout((()=>{c.focus(),o.cursor&&c.doc.setCursor(o.cursor)}),0),setTimeout((()=>c.refresh()),200);const a={getValue:()=>c.doc.getValue(),setValue:e=>c.doc.setValue(e),destroy:()=>{t.removeEventListener("keyup",d),t.removeEventListener("keydown",d),t.removeEventListener("keypress",d),n.destroy()}};return a},Q={},X=(e,t)=>{if(Q[t])return Promise.resolve();{const n=F(t),s=n.bind((e=>{var t;return S.from(null===(t=e.ui)||void 0===t?void 0:t.styleSheetLoader)})).getOr(tinymce.DOM.styleSheetLoader);return n.each((o=>{o.on("remove",(()=>{s.unload(e),delete Q[t]}))})),Q[t]=!0,o=e,(null!=(r=s)?r:tinymce.DOM.styleSheetLoader).load(o)}var o,r},Y=e=>({name:"codeview",type:"customeditor",tag:"div",scriptId:"tinymce.plugins.advcode.customeditor",scriptUrl:e.customEditorScriptUrl,settings:e}),Z=(e,t)=>{e.addCommand("mceCodeEditor",(()=>{h(e)&&!e.inline?"code"===e.mode.get()?e.mode.set("design"):e.mode.set("code"):(()=>{const o=p(e,t);((e,t)=>{const o=q(e),r={...t,cursor:o.cursor},n={title:"Source Code",size:"large",body:{type:"panel",items:[Y(r)]},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:{codeview:o.content},onSubmit:t=>{z(e,t.getData().codeview),t.close()}};e.windowManager.open(n)})(e,o)})()}))},ee=(e,t,o,r,n)=>{const s=q(o),i={...n,cursor:s.cursor},c=I("div");var d;d=c,((e,t)=>{for(let t=0,o=e.length;t<o;t++)$(d,e[t])})([0===t?"tox-inline-headless-codemirror":"tox-inline-codemirror","mce-codemirror"]),j(V(e),c);const{getValue:a,destroy:l}=r(c.dom,i,s.content);var u,m;1===t&&(u=V(c.dom),m=".CodeMirror",((e,t)=>{const o=void 0===t?document:t.dom;return 1!==(r=o).nodeType&&9!==r.nodeType&&11!==r.nodeType||0===r.childElementCount?S.none():S.from(o.querySelector(e)).map(V);var r})(m,u)).each((e=>$(e,"tox-view__pane_panel")));const g=()=>z(o,a());return 0===t&&o.on("BeforeGetContent",g),{syncWithEditor:g,destroy:()=>{0===t&&(o.off("BeforeGetContent",g),g()),G(c),l()}}},te=(e,t,o)=>{const r=(()=>{const e=(e=>{const t=(e=>{let t=e;return{get:()=>t,set:e=>{t=e}}})(S.none()),o=()=>t.get().each(e);return{clear:()=>{o(),t.set(S.none())},isSet:()=>t.get().isSome(),get:()=>t.get(),set:e=>{o(),t.set(S.some(e))}}})(_);return{...e,on:t=>e.get().each(t)}})(),n=()=>{r.get().each((({destroy:e})=>{e()})),r.clear()};e.ui.registry.addView("code",{buttons:1===o?[{type:"button",text:"Cancel",onAction:()=>{r.get().each((()=>{n(),e.mode.set("design")}))}},{type:"button",text:"Save code",buttonType:"primary",onAction:()=>{r.get().each((({syncWithEditor:t})=>{t(),n(),e.mode.set("design")}))}}]:[],onShow:n=>{const c=n.getContainer(),d=p(e,t);e.setProgressState(!0),((e,t,o)=>{return Promise.all([X(t,o),("tinymce.plugins.advcode.CodeMirror",r=e,tinymce.Resource.load("tinymce.plugins.advcode.CodeMirror",r))]).then((([e,t])=>(e,o,r)=>J(t(),e,o,r)));var r})(s(e),i(e),e.id).then((t=>{e.setProgressState(!1),r.set(ee(c,o,e,t,d))}))},onHide:n})};tinymce.PluginManager.requireLangPack("advcode","ar,bg_BG,ca,cs,da,de,el,es,eu,fa,fi,fr_FR,he_IL,hi,hr,hu_HU,id,it,ja,kk,ko_KR,ms,nb_NO,nl,pl,pt_BR,pt_PT,ro,ru,sk,sl_SI,sv_SE,th_TH,tr,uk,vi,zh_CN,zh_TW"),tinymce.PluginManager.add("advcode",((e,o)=>{((e,o)=>!!e&&-1===((e,o)=>{const r=t(e.major,o.major);if(0!==r)return r;const n=t(e.minor,o.minor);if(0!==n)return n;const s=t(e.patch,o.patch);return 0!==s?s:0})((e=>r((e=>[e.majorVersion,e.minorVersion].join(".").split(".").slice(0,3).join("."))(e)))(e),r(o)))(tinymce,"6.3.0")?console.error("The advcode plugin requires at least version 6.3.0 of TinyMCE."):((e,t)=>{((e,t)=>{const o=e.options.register;o("codemirror_script",{processor:"string",default:t+"/codemirror.min.js"}),o("codemirror_css",{processor:"string",default:t+"/codemirror.min.css"}),o("codemirror_linewrapping",{processor:"boolean",default:!0}),o("codemirror_linenumbers",{processor:"boolean",default:!0}),o("codemirror_foldgutter",{processor:"boolean",default:!0}),o("codemirror_gutter",{processor:"boolean",default:!0}),o("codemirror_theme",{processor:"string",default:"default"}),o("advcode_headless",{processor:"boolean",default:!1}),o("advcode_inline",{processor:"boolean",default:!1})})(e,t),Z(e,t),(e=>{const t="sourcecode",o=()=>e.execCommand("mceCodeEditor");e.ui.registry.addButton("code",{icon:t,tooltip:"Source code",onAction:o}),e.ui.registry.addMenuItem("code",{icon:t,text:"Source code",onAction:o})})(e),((e,t)=>{te(e,t,g(e)?0:1)})(e,t),(e=>{e.mode.register("code",{activate:()=>{"code"!==e.queryCommandValue("ToggleView")&&e.execCommand("ToggleView",!1,"code")},deactivate:()=>{"code"===e.queryCommandValue("ToggleView")&&e.execCommand("ToggleView",!1,"code")},editorReadOnly:!1})})(e)})(e,o)}))}();
@@ -1,4 +1,4 @@
1
- advcode - build: 3.0.2-34
1
+ advcode - build: 3.1.0-57
2
2
 
3
3
  Documentation
4
4
  -----------------
@@ -1 +1 @@
1
- 3.0.2-34
1
+ 3.1.0-57
@@ -4,7 +4,7 @@
4
4
  * Copyright (c) 2022 Ephox Corporation DBA Tiny Technologies, Inc.
5
5
  * Licensed under the Tiny commercial license. See https://www.tiny.cloud/legal/
6
6
  *
7
- * Version: 6.1.0
7
+ * Version: 6.3.1
8
8
  */
9
9
 
10
10
  (function () {
@@ -41,11 +41,11 @@
41
41
  const getNumberStyles = option('advlist_number_styles');
42
42
  const getBulletStyles = option('advlist_bullet_styles');
43
43
 
44
- var global = tinymce.util.Tools.resolve('tinymce.util.Tools');
45
-
46
44
  const isNullable = a => a === null || a === undefined;
47
45
  const isNonNullable = a => !isNullable(a);
48
46
 
47
+ var global = tinymce.util.Tools.resolve('tinymce.util.Tools');
48
+
49
49
  class Optional {
50
50
  constructor(tag, value) {
51
51
  this.tag = tag;
@@ -143,16 +143,21 @@
143
143
  return editor.dom.isChildOf(elm, editor.getBody());
144
144
  };
145
145
  const isTableCellNode = node => {
146
- return node && /^(TH|TD)$/.test(node.nodeName);
146
+ return isNonNullable(node) && /^(TH|TD)$/.test(node.nodeName);
147
147
  };
148
148
  const isListNode = editor => node => {
149
- return node && /^(OL|UL|DL)$/.test(node.nodeName) && isChildOfBody(editor, node);
149
+ return isNonNullable(node) && /^(OL|UL|DL)$/.test(node.nodeName) && isChildOfBody(editor, node);
150
150
  };
151
151
  const getSelectedStyleType = editor => {
152
152
  const listElm = editor.dom.getParent(editor.selection.getNode(), 'ol,ul');
153
153
  const style = editor.dom.getStyle(listElm, 'listStyleType');
154
154
  return Optional.from(style);
155
155
  };
156
+ const isWithinNonEditable = (editor, element) => element !== null && editor.dom.getContentEditableParent(element) === 'false';
157
+ const isWithinNonEditableList = (editor, element) => {
158
+ const parentList = editor.dom.getParent(element, 'ol,ul,dl');
159
+ return isWithinNonEditable(editor, parentList);
160
+ };
156
161
 
157
162
  const findIndex = (list, predicate) => {
158
163
  for (let index = 0; index < list.length; index++) {
@@ -168,6 +173,7 @@
168
173
  return chr.toUpperCase();
169
174
  });
170
175
  };
176
+ const normalizeStyleValue = styleValue => isNullable(styleValue) || styleValue === 'default' ? '' : styleValue;
171
177
  const isWithinList = (editor, e, nodeName) => {
172
178
  const tableCellIndex = findIndex(e.parents, isTableCellNode);
173
179
  const parents = tableCellIndex !== -1 ? e.parents.slice(0, tableCellIndex) : e.parents;
@@ -177,6 +183,7 @@
177
183
  const makeSetupHandler = (editor, nodeName) => api => {
178
184
  const nodeChangeHandler = e => {
179
185
  api.setActive(isWithinList(editor, e, nodeName));
186
+ api.setEnabled(!isWithinNonEditableList(editor, e.element));
180
187
  };
181
188
  editor.on('NodeChange', nodeChangeHandler);
182
189
  return () => editor.off('NodeChange', nodeChangeHandler);
@@ -191,7 +198,7 @@
191
198
  const items = global.map(styles, styleValue => {
192
199
  const iconStyle = nodeName === 'OL' ? 'num' : 'bull';
193
200
  const iconName = styleValue === 'disc' || styleValue === 'decimal' ? 'default' : styleValue;
194
- const itemValue = styleValue === 'default' ? '' : styleValue;
201
+ const itemValue = normalizeStyleValue(styleValue);
195
202
  const displayText = styleValueToText(styleValue);
196
203
  return {
197
204
  type: 'choiceitem',
@@ -213,20 +220,20 @@
213
220
  onSetup: makeSetupHandler(editor, nodeName)
214
221
  });
215
222
  };
216
- const addButton = (editor, id, tooltip, cmd, nodeName, _styles) => {
223
+ const addButton = (editor, id, tooltip, cmd, nodeName, styleValue) => {
217
224
  editor.ui.registry.addToggleButton(id, {
218
225
  active: false,
219
226
  tooltip,
220
227
  icon: nodeName === 'OL' ? 'ordered-list' : 'unordered-list',
221
228
  onSetup: makeSetupHandler(editor, nodeName),
222
- onAction: () => editor.execCommand(cmd)
229
+ onAction: () => editor.queryCommandState(cmd) || styleValue === '' ? editor.execCommand(cmd) : applyListFormat(editor, nodeName, styleValue)
223
230
  });
224
231
  };
225
232
  const addControl = (editor, id, tooltip, cmd, nodeName, styles) => {
226
233
  if (styles.length > 1) {
227
234
  addSplitButton(editor, id, tooltip, cmd, nodeName, styles);
228
235
  } else {
229
- addButton(editor, id, tooltip, cmd, nodeName);
236
+ addButton(editor, id, tooltip, cmd, nodeName, normalizeStyleValue(styles[0]));
230
237
  }
231
238
  };
232
239
  const register = editor => {
@@ -4,6 +4,6 @@
4
4
  * Copyright (c) 2022 Ephox Corporation DBA Tiny Technologies, Inc.
5
5
  * Licensed under the Tiny commercial license. See https://www.tiny.cloud/legal/
6
6
  *
7
- * Version: 6.1.0
7
+ * Version: 6.3.1
8
8
  */
9
- !function(){"use strict";var t=tinymce.util.Tools.resolve("tinymce.PluginManager");const e=(t,e,r)=>{const s="UL"===e?"InsertUnorderedList":"InsertOrderedList";t.execCommand(s,!1,!1===r?null:{"list-style-type":r})},r=t=>e=>e.options.get(t),s=r("advlist_number_styles"),n=r("advlist_bullet_styles");var i=tinymce.util.Tools.resolve("tinymce.util.Tools");class l{constructor(t,e){this.tag=t,this.value=e}static some(t){return new l(!0,t)}static none(){return l.singletonNone}fold(t,e){return this.tag?e(this.value):t()}isSome(){return this.tag}isNone(){return!this.tag}map(t){return this.tag?l.some(t(this.value)):l.none()}bind(t){return this.tag?t(this.value):l.none()}exists(t){return this.tag&&t(this.value)}forall(t){return!this.tag||t(this.value)}filter(t){return!this.tag||t(this.value)?this:l.none()}getOr(t){return this.tag?this.value:t}or(t){return this.tag?this:t}getOrThunk(t){return this.tag?this.value:t()}orThunk(t){return this.tag?this:t()}getOrDie(t){if(this.tag)return this.value;throw new Error(null!=t?t:"Called getOrDie on None")}static from(t){return null==t?l.none():l.some(t)}getOrNull(){return this.tag?this.value:null}getOrUndefined(){return this.value}each(t){this.tag&&t(this.value)}toArray(){return this.tag?[this.value]:[]}toString(){return this.tag?`some(${this.value})`:"none()"}}l.singletonNone=new l(!1);const o=t=>t&&/^(TH|TD)$/.test(t.nodeName),a=(t,e)=>r=>{const s=s=>{r.setActive(((t,e,r)=>{const s=((t,e)=>{for(let r=0;r<t.length;r++)if(e(t[r]))return r;return-1})(e.parents,o),n=-1!==s?e.parents.slice(0,s):e.parents,l=i.grep(n,(t=>e=>e&&/^(OL|UL|DL)$/.test(e.nodeName)&&((t,e)=>t.dom.isChildOf(e,t.getBody()))(t,e))(t));return l.length>0&&l[0].nodeName===r})(t,s,e))};return t.on("NodeChange",s),()=>t.off("NodeChange",s)},u=(t,r,s,n,o,u)=>{u.length>1?((t,r,s,n,o,u)=>{t.ui.registry.addSplitButton(r,{tooltip:s,icon:"OL"===o?"ordered-list":"unordered-list",presets:"listpreview",columns:3,fetch:t=>{t(i.map(u,(t=>{const e="OL"===o?"num":"bull",r="disc"===t||"decimal"===t?"default":t,s="default"===t?"":t,n=(t=>t.replace(/\-/g," ").replace(/\b\w/g,(t=>t.toUpperCase())))(t);return{type:"choiceitem",value:s,icon:"list-"+e+"-"+r,text:n}})))},onAction:()=>t.execCommand(n),onItemAction:(r,s)=>{e(t,o,s)},select:e=>{const r=(t=>{const e=t.dom.getParent(t.selection.getNode(),"ol,ul"),r=t.dom.getStyle(e,"listStyleType");return l.from(r)})(t);return r.map((t=>e===t)).getOr(!1)},onSetup:a(t,o)})})(t,r,s,n,o,u):((t,e,r,s,n,i)=>{t.ui.registry.addToggleButton(e,{active:!1,tooltip:r,icon:"OL"===n?"ordered-list":"unordered-list",onSetup:a(t,n),onAction:()=>t.execCommand(s)})})(t,r,s,n,o)};t.add("advlist",(t=>{t.hasPlugin("lists")?((t=>{const e=t.options.register;e("advlist_number_styles",{processor:"string[]",default:"default,lower-alpha,lower-greek,lower-roman,upper-alpha,upper-roman".split(",")}),e("advlist_bullet_styles",{processor:"string[]",default:"default,circle,square".split(",")})})(t),(t=>{u(t,"numlist","Numbered list","InsertOrderedList","OL",s(t)),u(t,"bullist","Bullet list","InsertUnorderedList","UL",n(t))})(t),(t=>{t.addCommand("ApplyUnorderedListStyle",((r,s)=>{e(t,"UL",s["list-style-type"])})),t.addCommand("ApplyOrderedListStyle",((r,s)=>{e(t,"OL",s["list-style-type"])}))})(t)):console.error("Please use the Lists plugin together with the Advanced List plugin.")}))}();
9
+ !function(){"use strict";var t=tinymce.util.Tools.resolve("tinymce.PluginManager");const e=(t,e,r)=>{const s="UL"===e?"InsertUnorderedList":"InsertOrderedList";t.execCommand(s,!1,!1===r?null:{"list-style-type":r})},r=t=>e=>e.options.get(t),s=r("advlist_number_styles"),n=r("advlist_bullet_styles"),l=t=>null==t,i=t=>!l(t);var o=tinymce.util.Tools.resolve("tinymce.util.Tools");class a{constructor(t,e){this.tag=t,this.value=e}static some(t){return new a(!0,t)}static none(){return a.singletonNone}fold(t,e){return this.tag?e(this.value):t()}isSome(){return this.tag}isNone(){return!this.tag}map(t){return this.tag?a.some(t(this.value)):a.none()}bind(t){return this.tag?t(this.value):a.none()}exists(t){return this.tag&&t(this.value)}forall(t){return!this.tag||t(this.value)}filter(t){return!this.tag||t(this.value)?this:a.none()}getOr(t){return this.tag?this.value:t}or(t){return this.tag?this:t}getOrThunk(t){return this.tag?this.value:t()}orThunk(t){return this.tag?this:t()}getOrDie(t){if(this.tag)return this.value;throw new Error(null!=t?t:"Called getOrDie on None")}static from(t){return i(t)?a.some(t):a.none()}getOrNull(){return this.tag?this.value:null}getOrUndefined(){return this.value}each(t){this.tag&&t(this.value)}toArray(){return this.tag?[this.value]:[]}toString(){return this.tag?`some(${this.value})`:"none()"}}a.singletonNone=new a(!1);const u=t=>i(t)&&/^(TH|TD)$/.test(t.nodeName),d=t=>l(t)||"default"===t?"":t,g=(t,e)=>r=>{const s=s=>{r.setActive(((t,e,r)=>{const s=((t,e)=>{for(let r=0;r<t.length;r++)if(e(t[r]))return r;return-1})(e.parents,u),n=-1!==s?e.parents.slice(0,s):e.parents,l=o.grep(n,(t=>e=>i(e)&&/^(OL|UL|DL)$/.test(e.nodeName)&&((t,e)=>t.dom.isChildOf(e,t.getBody()))(t,e))(t));return l.length>0&&l[0].nodeName===r})(t,s,e)),r.setEnabled(!((t,e)=>{const r=t.dom.getParent(e,"ol,ul,dl");return((t,e)=>null!==e&&"false"===t.dom.getContentEditableParent(e))(t,r)})(t,s.element))};return t.on("NodeChange",s),()=>t.off("NodeChange",s)},h=(t,r,s,n,l,i)=>{i.length>1?((t,r,s,n,l,i)=>{t.ui.registry.addSplitButton(r,{tooltip:s,icon:"OL"===l?"ordered-list":"unordered-list",presets:"listpreview",columns:3,fetch:t=>{t(o.map(i,(t=>{const e="OL"===l?"num":"bull",r="disc"===t||"decimal"===t?"default":t,s=d(t),n=(t=>t.replace(/\-/g," ").replace(/\b\w/g,(t=>t.toUpperCase())))(t);return{type:"choiceitem",value:s,icon:"list-"+e+"-"+r,text:n}})))},onAction:()=>t.execCommand(n),onItemAction:(r,s)=>{e(t,l,s)},select:e=>{const r=(t=>{const e=t.dom.getParent(t.selection.getNode(),"ol,ul"),r=t.dom.getStyle(e,"listStyleType");return a.from(r)})(t);return r.map((t=>e===t)).getOr(!1)},onSetup:g(t,l)})})(t,r,s,n,l,i):((t,r,s,n,l,i)=>{t.ui.registry.addToggleButton(r,{active:!1,tooltip:s,icon:"OL"===l?"ordered-list":"unordered-list",onSetup:g(t,l),onAction:()=>t.queryCommandState(n)||""===i?t.execCommand(n):e(t,l,i)})})(t,r,s,n,l,d(i[0]))};t.add("advlist",(t=>{t.hasPlugin("lists")?((t=>{const e=t.options.register;e("advlist_number_styles",{processor:"string[]",default:"default,lower-alpha,lower-greek,lower-roman,upper-alpha,upper-roman".split(",")}),e("advlist_bullet_styles",{processor:"string[]",default:"default,circle,square".split(",")})})(t),(t=>{h(t,"numlist","Numbered list","InsertOrderedList","OL",s(t)),h(t,"bullist","Bullet list","InsertUnorderedList","UL",n(t))})(t),(t=>{t.addCommand("ApplyUnorderedListStyle",((r,s)=>{e(t,"UL",s["list-style-type"])})),t.addCommand("ApplyOrderedListStyle",((r,s)=>{e(t,"OL",s["list-style-type"])}))})(t)):console.error("Please use the Lists plugin together with the Advanced List plugin.")}))}();
@@ -4,7 +4,7 @@
4
4
  * Copyright (c) 2022 Ephox Corporation DBA Tiny Technologies, Inc.
5
5
  * Licensed under the Tiny commercial license. See https://www.tiny.cloud/legal/
6
6
  *
7
- * Version: 6.1.0
7
+ * Version: 6.3.1
8
8
  */
9
9
 
10
10
  (function () {
@@ -32,7 +32,7 @@
32
32
  const id = elm.getAttribute('id') || elm.getAttribute('name');
33
33
  return id || '';
34
34
  };
35
- const isAnchor = elm => elm && elm.nodeName.toLowerCase() === 'a';
35
+ const isAnchor = elm => elm.nodeName.toLowerCase() === 'a';
36
36
  const isNamedAnchor = elm => isAnchor(elm) && !elm.getAttribute('href') && getIdFromAnchor(elm) !== '';
37
37
  const isEmptyNamedAnchor = elm => isNamedAnchor(elm) && !elm.firstChild;
38
38
 
@@ -65,7 +65,7 @@
65
65
  editor.insertContent(editor.dom.createHTML('a', { id }));
66
66
  } else {
67
67
  removeEmptyNamedAnchorsInSelection(editor);
68
- editor.formatter.remove('namedAnchor', null, null, true);
68
+ editor.formatter.remove('namedAnchor', undefined, undefined, true);
69
69
  editor.formatter.apply('namedAnchor', { value: id });
70
70
  editor.addVisual();
71
71
  }
@@ -138,7 +138,7 @@
138
138
  });
139
139
  };
140
140
 
141
- const isNamedAnchorNode = node => node && isEmptyString(node.attr('href')) && !isEmptyString(node.attr('id') || node.attr('name'));
141
+ const isNamedAnchorNode = node => isEmptyString(node.attr('href')) && !isEmptyString(node.attr('id') || node.attr('name'));
142
142
  const isEmptyNamedAnchorNode = node => isNamedAnchorNode(node) && !node.firstChild;
143
143
  const setContentEditable = state => nodes => {
144
144
  for (let i = 0; i < nodes.length; i++) {
@@ -170,16 +170,17 @@
170
170
  };
171
171
 
172
172
  const register = editor => {
173
+ const onAction = () => editor.execCommand('mceAnchor');
173
174
  editor.ui.registry.addToggleButton('anchor', {
174
175
  icon: 'bookmark',
175
176
  tooltip: 'Anchor',
176
- onAction: () => editor.execCommand('mceAnchor'),
177
+ onAction,
177
178
  onSetup: buttonApi => editor.selection.selectorChangedWithUnbind('a:not([href])', buttonApi.setActive).unbind
178
179
  });
179
180
  editor.ui.registry.addMenuItem('anchor', {
180
181
  icon: 'bookmark',
181
182
  text: 'Anchor...',
182
- onAction: () => editor.execCommand('mceAnchor')
183
+ onAction
183
184
  });
184
185
  };
185
186
 
@@ -4,6 +4,6 @@
4
4
  * Copyright (c) 2022 Ephox Corporation DBA Tiny Technologies, Inc.
5
5
  * Licensed under the Tiny commercial license. See https://www.tiny.cloud/legal/
6
6
  *
7
- * Version: 6.1.0
7
+ * Version: 6.3.1
8
8
  */
9
- !function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),t=tinymce.util.Tools.resolve("tinymce.dom.RangeUtils"),n=tinymce.util.Tools.resolve("tinymce.util.Tools");const o=("allow_html_in_named_anchor",e=>e.options.get("allow_html_in_named_anchor"));const a="a:not([href])",r=e=>!e,i=e=>e.getAttribute("id")||e.getAttribute("name")||"",l=e=>(e=>e&&"a"===e.nodeName.toLowerCase())(e)&&!e.getAttribute("href")&&""!==i(e),s=e=>e.dom.getParent(e.selection.getStart(),a),c=(e,a)=>{const r=s(e);r?((e,t,n)=>{n.removeAttribute("name"),n.id=t,e.addVisual(),e.undoManager.add()})(e,a,r):((e,a)=>{e.undoManager.transact((()=>{o(e)||e.selection.collapse(!0),e.selection.isCollapsed()?e.insertContent(e.dom.createHTML("a",{id:a})):((e=>{const o=e.dom;t(o).walk(e.selection.getRng(),(e=>{n.each(e,(e=>{var t;l(t=e)&&!t.firstChild&&o.remove(e,!1)}))}))})(e),e.formatter.remove("namedAnchor",null,null,!0),e.formatter.apply("namedAnchor",{value:a}),e.addVisual())}))})(e,a),e.focus()},d=e=>(e=>e&&r(e.attr("href"))&&!r(e.attr("id")||e.attr("name")))(e)&&!e.firstChild,m=e=>t=>{for(let n=0;n<t.length;n++){const o=t[n];d(o)&&o.attr("contenteditable",e)}};e.add("anchor",(e=>{(e=>{(0,e.options.register)("allow_html_in_named_anchor",{processor:"boolean",default:!1})})(e),(e=>{e.on("PreInit",(()=>{e.parser.addNodeFilter("a",m("false")),e.serializer.addNodeFilter("a",m(null))}))})(e),(e=>{e.addCommand("mceAnchor",(()=>{(e=>{const t=(e=>{const t=s(e);return t?i(t):""})(e);e.windowManager.open({title:"Anchor",size:"normal",body:{type:"panel",items:[{name:"id",type:"input",label:"ID",placeholder:"example"}]},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:{id:t},onSubmit:t=>{((e,t)=>/^[A-Za-z][A-Za-z0-9\-:._]*$/.test(t)?(c(e,t),!0):(e.windowManager.alert("ID should start with a letter, followed only by letters, numbers, dashes, dots, colons or underscores."),!1))(e,t.getData().id)&&t.close()}})})(e)}))})(e),(e=>{e.ui.registry.addToggleButton("anchor",{icon:"bookmark",tooltip:"Anchor",onAction:()=>e.execCommand("mceAnchor"),onSetup:t=>e.selection.selectorChangedWithUnbind("a:not([href])",t.setActive).unbind}),e.ui.registry.addMenuItem("anchor",{icon:"bookmark",text:"Anchor...",onAction:()=>e.execCommand("mceAnchor")})})(e),e.on("PreInit",(()=>{(e=>{e.formatter.register("namedAnchor",{inline:"a",selector:a,remove:"all",split:!0,deep:!0,attributes:{id:"%value"},onmatch:(e,t,n)=>l(e)})})(e)}))}))}();
9
+ !function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),t=tinymce.util.Tools.resolve("tinymce.dom.RangeUtils"),o=tinymce.util.Tools.resolve("tinymce.util.Tools");const n=("allow_html_in_named_anchor",e=>e.options.get("allow_html_in_named_anchor"));const a="a:not([href])",r=e=>!e,i=e=>e.getAttribute("id")||e.getAttribute("name")||"",l=e=>(e=>"a"===e.nodeName.toLowerCase())(e)&&!e.getAttribute("href")&&""!==i(e),s=e=>e.dom.getParent(e.selection.getStart(),a),d=(e,a)=>{const r=s(e);r?((e,t,o)=>{o.removeAttribute("name"),o.id=t,e.addVisual(),e.undoManager.add()})(e,a,r):((e,a)=>{e.undoManager.transact((()=>{n(e)||e.selection.collapse(!0),e.selection.isCollapsed()?e.insertContent(e.dom.createHTML("a",{id:a})):((e=>{const n=e.dom;t(n).walk(e.selection.getRng(),(e=>{o.each(e,(e=>{var t;l(t=e)&&!t.firstChild&&n.remove(e,!1)}))}))})(e),e.formatter.remove("namedAnchor",void 0,void 0,!0),e.formatter.apply("namedAnchor",{value:a}),e.addVisual())}))})(e,a),e.focus()},c=e=>(e=>r(e.attr("href"))&&!r(e.attr("id")||e.attr("name")))(e)&&!e.firstChild,m=e=>t=>{for(let o=0;o<t.length;o++){const n=t[o];c(n)&&n.attr("contenteditable",e)}};e.add("anchor",(e=>{(e=>{(0,e.options.register)("allow_html_in_named_anchor",{processor:"boolean",default:!1})})(e),(e=>{e.on("PreInit",(()=>{e.parser.addNodeFilter("a",m("false")),e.serializer.addNodeFilter("a",m(null))}))})(e),(e=>{e.addCommand("mceAnchor",(()=>{(e=>{const t=(e=>{const t=s(e);return t?i(t):""})(e);e.windowManager.open({title:"Anchor",size:"normal",body:{type:"panel",items:[{name:"id",type:"input",label:"ID",placeholder:"example"}]},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:{id:t},onSubmit:t=>{((e,t)=>/^[A-Za-z][A-Za-z0-9\-:._]*$/.test(t)?(d(e,t),!0):(e.windowManager.alert("ID should start with a letter, followed only by letters, numbers, dashes, dots, colons or underscores."),!1))(e,t.getData().id)&&t.close()}})})(e)}))})(e),(e=>{const t=()=>e.execCommand("mceAnchor");e.ui.registry.addToggleButton("anchor",{icon:"bookmark",tooltip:"Anchor",onAction:t,onSetup:t=>e.selection.selectorChangedWithUnbind("a:not([href])",t.setActive).unbind}),e.ui.registry.addMenuItem("anchor",{icon:"bookmark",text:"Anchor...",onAction:t})})(e),e.on("PreInit",(()=>{(e=>{e.formatter.register("namedAnchor",{inline:"a",selector:a,remove:"all",split:!0,deep:!0,attributes:{id:"%value"},onmatch:(e,t,o)=>l(e)})})(e)}))}))}();
@@ -4,13 +4,13 @@
4
4
  * Copyright (c) 2022 Ephox Corporation DBA Tiny Technologies, Inc.
5
5
  * Licensed under the Tiny commercial license. See https://www.tiny.cloud/legal/
6
6
  *
7
- * Version: 6.1.0
7
+ * Version: 6.3.1
8
8
  */
9
9
 
10
10
  (function () {
11
11
  'use strict';
12
12
 
13
- var global = tinymce.util.Tools.resolve('tinymce.PluginManager');
13
+ var global$1 = tinymce.util.Tools.resolve('tinymce.PluginManager');
14
14
 
15
15
  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;
16
16
 
@@ -30,6 +30,7 @@
30
30
  const getAutoLinkPattern = option('autolink_pattern');
31
31
  const getDefaultLinkTarget = option('link_default_target');
32
32
  const getDefaultLinkProtocol = option('link_default_protocol');
33
+ const allowUnsafeLinkTarget = option('allow_unsafe_link_target');
33
34
 
34
35
  const hasProto = (v, constructor, predicate) => {
35
36
  var _a;
@@ -52,153 +53,176 @@
52
53
  }
53
54
  };
54
55
  const isType = type => value => typeOf(value) === type;
56
+ const eq = t => a => t === a;
55
57
  const isString = isType('string');
58
+ const isUndefined = eq(undefined);
59
+ const isNullable = a => a === null || a === undefined;
60
+ const isNonNullable = a => !isNullable(a);
61
+
62
+ const not = f => t => !f(t);
63
+
64
+ const hasOwnProperty = Object.hasOwnProperty;
65
+ const has = (obj, key) => hasOwnProperty.call(obj, key);
56
66
 
57
67
  const checkRange = (str, substr, start) => substr === '' || str.length >= substr.length && str.substr(start, start + substr.length) === substr;
58
- const contains = (str, substr) => {
59
- return str.indexOf(substr) !== -1;
68
+ const contains = (str, substr, start = 0, end) => {
69
+ const idx = str.indexOf(substr, start);
70
+ if (idx !== -1) {
71
+ return isUndefined(end) ? true : idx + substr.length <= end;
72
+ } else {
73
+ return false;
74
+ }
60
75
  };
61
76
  const startsWith = (str, prefix) => {
62
77
  return checkRange(str, prefix, 0);
63
78
  };
64
79
 
65
- const rangeEqualsBracketOrSpace = rangeString => /^[(\[{ \u00a0]$/.test(rangeString);
80
+ const zeroWidth = '\uFEFF';
81
+ const isZwsp = char => char === zeroWidth;
82
+ const removeZwsp = s => s.replace(/\uFEFF/g, '');
83
+
84
+ var global = tinymce.util.Tools.resolve('tinymce.dom.TextSeeker');
85
+
66
86
  const isTextNode = node => node.nodeType === 3;
67
87
  const isElement = node => node.nodeType === 1;
68
- const handleBracket = editor => parseCurrentLine(editor, -1);
69
- const handleSpacebar = editor => parseCurrentLine(editor, 0);
70
- const handleEnter = editor => parseCurrentLine(editor, -1);
71
- const scopeIndex = (container, index) => {
72
- if (index < 0) {
73
- index = 0;
74
- }
75
- if (isTextNode(container)) {
76
- const len = container.data.length;
77
- if (index > len) {
78
- index = len;
88
+ const isBracketOrSpace = char => /^[(\[{ \u00a0]$/.test(char);
89
+ const hasProtocol = url => /^([A-Za-z][A-Za-z\d.+-]*:\/\/)|mailto:/.test(url);
90
+ const isPunctuation = char => /[?!,.;:]/.test(char);
91
+ const findChar = (text, index, predicate) => {
92
+ for (let i = index - 1; i >= 0; i--) {
93
+ const char = text.charAt(i);
94
+ if (!isZwsp(char) && predicate(char)) {
95
+ return i;
79
96
  }
80
97
  }
81
- return index;
98
+ return -1;
82
99
  };
83
- const setStart = (rng, container, offset) => {
84
- if (!isElement(container) || container.hasChildNodes()) {
85
- rng.setStart(container, scopeIndex(container, offset));
86
- } else {
87
- rng.setStartBefore(container);
100
+ const freefallRtl = (container, offset) => {
101
+ let tempNode = container;
102
+ let tempOffset = offset;
103
+ while (isElement(tempNode) && tempNode.childNodes[tempOffset]) {
104
+ tempNode = tempNode.childNodes[tempOffset];
105
+ tempOffset = isTextNode(tempNode) ? tempNode.data.length : tempNode.childNodes.length;
88
106
  }
107
+ return {
108
+ container: tempNode,
109
+ offset: tempOffset
110
+ };
89
111
  };
90
- const setEnd = (rng, container, offset) => {
91
- if (!isElement(container) || container.hasChildNodes()) {
92
- rng.setEnd(container, scopeIndex(container, offset));
93
- } else {
94
- rng.setEndAfter(container);
95
- }
96
- };
97
- const hasProtocol = url => /^([A-Za-z][A-Za-z\d.+-]*:\/\/)|mailto:/.test(url);
98
- const isPunctuation = char => /[?!,.;:]/.test(char);
99
- const parseCurrentLine = (editor, endOffset) => {
100
- let end, endContainer, bookmark, text, prev, len, rngText;
112
+
113
+ const parseCurrentLine = (editor, offset) => {
114
+ var _a;
115
+ const voidElements = editor.schema.getVoidElements();
101
116
  const autoLinkPattern = getAutoLinkPattern(editor);
102
- const defaultLinkTarget = getDefaultLinkTarget(editor);
103
- if (editor.dom.getParent(editor.selection.getNode(), 'a[href]') !== null) {
104
- return;
117
+ const {dom, selection} = editor;
118
+ if (dom.getParent(selection.getNode(), 'a[href]') !== null) {
119
+ return null;
105
120
  }
106
- const rng = editor.selection.getRng().cloneRange();
107
- if (rng.startOffset < 5) {
108
- prev = rng.endContainer.previousSibling;
109
- if (!prev) {
110
- if (!rng.endContainer.firstChild || !rng.endContainer.firstChild.nextSibling) {
111
- return;
112
- }
113
- prev = rng.endContainer.firstChild.nextSibling;
114
- }
115
- len = prev.length;
116
- setStart(rng, prev, len);
117
- setEnd(rng, prev, len);
118
- if (rng.endOffset < 5) {
119
- return;
120
- }
121
- end = rng.endOffset;
122
- endContainer = prev;
123
- } else {
124
- endContainer = rng.endContainer;
125
- if (!isTextNode(endContainer) && endContainer.firstChild) {
126
- while (!isTextNode(endContainer) && endContainer.firstChild) {
127
- endContainer = endContainer.firstChild;
128
- }
129
- if (isTextNode(endContainer)) {
130
- setStart(rng, endContainer, 0);
131
- setEnd(rng, endContainer, endContainer.nodeValue.length);
132
- }
133
- }
134
- if (rng.endOffset === 1) {
135
- end = 2;
136
- } else {
137
- end = rng.endOffset - 1 - endOffset;
138
- }
121
+ const rng = selection.getRng();
122
+ const textSeeker = global(dom, node => {
123
+ return dom.isBlock(node) || has(voidElements, node.nodeName.toLowerCase()) || dom.getContentEditable(node) === 'false';
124
+ });
125
+ const {
126
+ container: endContainer,
127
+ offset: endOffset
128
+ } = freefallRtl(rng.endContainer, rng.endOffset);
129
+ const root = (_a = dom.getParent(endContainer, dom.isBlock)) !== null && _a !== void 0 ? _a : dom.getRoot();
130
+ const endSpot = textSeeker.backwards(endContainer, endOffset + offset, (node, offset) => {
131
+ const text = node.data;
132
+ const idx = findChar(text, offset, not(isBracketOrSpace));
133
+ return idx === -1 || isPunctuation(text[idx]) ? idx : idx + 1;
134
+ }, root);
135
+ if (!endSpot) {
136
+ return null;
139
137
  }
140
- const start = end;
141
- do {
142
- setStart(rng, endContainer, end >= 2 ? end - 2 : 0);
143
- setEnd(rng, endContainer, end >= 1 ? end - 1 : 0);
144
- end -= 1;
145
- rngText = rng.toString();
146
- } while (!rangeEqualsBracketOrSpace(rngText) && end - 2 >= 0);
147
- if (rangeEqualsBracketOrSpace(rng.toString())) {
148
- setStart(rng, endContainer, end);
149
- setEnd(rng, endContainer, start);
150
- end += 1;
151
- } else if (rng.startOffset === 0) {
152
- setStart(rng, endContainer, 0);
153
- setEnd(rng, endContainer, start);
138
+ let lastTextNode = endSpot.container;
139
+ const startSpot = textSeeker.backwards(endSpot.container, endSpot.offset, (node, offset) => {
140
+ lastTextNode = node;
141
+ const idx = findChar(node.data, offset, isBracketOrSpace);
142
+ return idx === -1 ? idx : idx + 1;
143
+ }, root);
144
+ const newRng = dom.createRng();
145
+ if (!startSpot) {
146
+ newRng.setStart(lastTextNode, 0);
154
147
  } else {
155
- setStart(rng, endContainer, end);
156
- setEnd(rng, endContainer, start);
148
+ newRng.setStart(startSpot.container, startSpot.offset);
157
149
  }
158
- text = rng.toString();
159
- if (isPunctuation(text.charAt(text.length - 1))) {
160
- setEnd(rng, endContainer, start - 1);
161
- }
162
- text = rng.toString().trim();
163
- const matches = text.match(autoLinkPattern);
164
- const protocol = getDefaultLinkProtocol(editor);
150
+ newRng.setEnd(endSpot.container, endSpot.offset);
151
+ const rngText = removeZwsp(newRng.toString());
152
+ const matches = rngText.match(autoLinkPattern);
165
153
  if (matches) {
166
154
  let url = matches[0];
167
155
  if (startsWith(url, 'www.')) {
156
+ const protocol = getDefaultLinkProtocol(editor);
168
157
  url = protocol + '://' + url;
169
158
  } else if (contains(url, '@') && !hasProtocol(url)) {
170
159
  url = 'mailto:' + url;
171
160
  }
172
- bookmark = editor.selection.getBookmark();
173
- editor.selection.setRng(rng);
174
- editor.getDoc().execCommand('createlink', false, url);
161
+ return {
162
+ rng: newRng,
163
+ url
164
+ };
165
+ } else {
166
+ return null;
167
+ }
168
+ };
169
+ const convertToLink = (editor, result) => {
170
+ const {dom, selection} = editor;
171
+ const {rng, url} = result;
172
+ const bookmark = selection.getBookmark();
173
+ selection.setRng(rng);
174
+ const command = 'createlink';
175
+ const args = {
176
+ command,
177
+ ui: false,
178
+ value: url
179
+ };
180
+ const beforeExecEvent = editor.dispatch('BeforeExecCommand', args);
181
+ if (!beforeExecEvent.isDefaultPrevented()) {
182
+ editor.getDoc().execCommand(command, false, url);
183
+ editor.dispatch('ExecCommand', args);
184
+ const defaultLinkTarget = getDefaultLinkTarget(editor);
175
185
  if (isString(defaultLinkTarget)) {
176
- editor.dom.setAttrib(editor.selection.getNode(), 'target', defaultLinkTarget);
186
+ const anchor = selection.getNode();
187
+ dom.setAttrib(anchor, 'target', defaultLinkTarget);
188
+ if (defaultLinkTarget === '_blank' && !allowUnsafeLinkTarget(editor)) {
189
+ dom.setAttrib(anchor, 'rel', 'noopener');
190
+ }
177
191
  }
178
- editor.selection.moveToBookmark(bookmark);
179
- editor.nodeChanged();
192
+ }
193
+ selection.moveToBookmark(bookmark);
194
+ editor.nodeChanged();
195
+ };
196
+ const handleSpacebar = editor => {
197
+ const result = parseCurrentLine(editor, -1);
198
+ if (isNonNullable(result)) {
199
+ convertToLink(editor, result);
200
+ }
201
+ };
202
+ const handleBracket = handleSpacebar;
203
+ const handleEnter = editor => {
204
+ const result = parseCurrentLine(editor, 0);
205
+ if (isNonNullable(result)) {
206
+ convertToLink(editor, result);
180
207
  }
181
208
  };
182
209
  const setup = editor => {
183
210
  editor.on('keydown', e => {
184
- if (e.keyCode === 13) {
185
- return handleEnter(editor);
186
- }
187
- });
188
- editor.on('keypress', e => {
189
- if (e.keyCode === 41 || e.keyCode === 93 || e.keyCode === 125) {
190
- return handleBracket(editor);
211
+ if (e.keyCode === 13 && !e.isDefaultPrevented()) {
212
+ handleEnter(editor);
191
213
  }
192
214
  });
193
215
  editor.on('keyup', e => {
194
216
  if (e.keyCode === 32) {
195
- return handleSpacebar(editor);
217
+ handleSpacebar(editor);
218
+ } else if (e.keyCode === 48 && e.shiftKey || e.keyCode === 221) {
219
+ handleBracket(editor);
196
220
  }
197
221
  });
198
222
  };
199
223
 
200
224
  var Plugin = () => {
201
- global.add('autolink', editor => {
225
+ global$1.add('autolink', editor => {
202
226
  register(editor);
203
227
  setup(editor);
204
228
  });
@@ -4,6 +4,6 @@
4
4
  * Copyright (c) 2022 Ephox Corporation DBA Tiny Technologies, Inc.
5
5
  * Licensed under the Tiny commercial license. See https://www.tiny.cloud/legal/
6
6
  *
7
- * Version: 6.1.0
7
+ * Version: 6.3.1
8
8
  */
9
- !function(){"use strict";var t=tinymce.util.Tools.resolve("tinymce.PluginManager");const e=t=>e=>e.options.get(t),n=e("autolink_pattern"),o=e("link_default_target"),r=e("link_default_protocol"),i=("string",t=>"string"===(t=>{const e=typeof t;return null===t?"null":"object"===e&&Array.isArray(t)?"array":"object"===e&&(n=o=t,(r=String).prototype.isPrototypeOf(n)||(null===(i=o.constructor)||void 0===i?void 0:i.name)===r.name)?"string":e;var n,o,r,i})(t));const s=t=>/^[(\[{ \u00a0]$/.test(t),a=t=>3===t.nodeType,l=t=>1===t.nodeType,d=(t,e)=>{if(e<0&&(e=0),a(t)){const n=t.data.length;e>n&&(e=n)}return e},f=(t,e,n)=>{!l(e)||e.hasChildNodes()?t.setStart(e,d(e,n)):t.setStartBefore(e)},g=(t,e,n)=>{!l(e)||e.hasChildNodes()?t.setEnd(e,d(e,n)):t.setEndAfter(e)},c=(t,e)=>{let l,d,c,u,h,p,k;const C=n(t),y=o(t);if(null!==t.dom.getParent(t.selection.getNode(),"a[href]"))return;const m=t.selection.getRng().cloneRange();if(m.startOffset<5){if(h=m.endContainer.previousSibling,!h){if(!m.endContainer.firstChild||!m.endContainer.firstChild.nextSibling)return;h=m.endContainer.firstChild.nextSibling}if(p=h.length,f(m,h,p),g(m,h,p),m.endOffset<5)return;l=m.endOffset,d=h}else{if(d=m.endContainer,!a(d)&&d.firstChild){for(;!a(d)&&d.firstChild;)d=d.firstChild;a(d)&&(f(m,d,0),g(m,d,d.nodeValue.length))}l=1===m.endOffset?2:m.endOffset-1-e}const w=l;do{f(m,d,l>=2?l-2:0),g(m,d,l>=1?l-1:0),l-=1,k=m.toString()}while(!s(k)&&l-2>=0);var A;s(m.toString())?(f(m,d,l),g(m,d,w),l+=1):0===m.startOffset?(f(m,d,0),g(m,d,w)):(f(m,d,l),g(m,d,w)),u=m.toString(),A=u.charAt(u.length-1),/[?!,.;:]/.test(A)&&g(m,d,w-1),u=m.toString().trim();const S=u.match(C),_=r(t);if(S){let e=S[0];O="www.",(v=e).length>=O.length&&v.substr(0,0+O.length)===O?e=_+"://"+e:((t,e)=>-1!==t.indexOf("@"))(e)&&!(t=>/^([A-Za-z][A-Za-z\d.+-]*:\/\/)|mailto:/.test(t))(e)&&(e="mailto:"+e),c=t.selection.getBookmark(),t.selection.setRng(m),t.getDoc().execCommand("createlink",!1,e),i(y)&&t.dom.setAttrib(t.selection.getNode(),"target",y),t.selection.moveToBookmark(c),t.nodeChanged()}var v,O};t.add("autolink",(t=>{(t=>{const e=t.options.register;e("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")}),e("link_default_target",{processor:"string"}),e("link_default_protocol",{processor:"string",default:"https"})})(t),(t=>{t.on("keydown",(e=>{if(13===e.keyCode)return(t=>c(t,-1))(t)})),t.on("keypress",(e=>{if(41===e.keyCode||93===e.keyCode||125===e.keyCode)return(t=>c(t,-1))(t)})),t.on("keyup",(e=>{if(32===e.keyCode)return(t=>c(t,0))(t)}))})(t)}))}();
9
+ !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),h=null!==(o=i.getParent(p,i.isBlock))&&void 0!==o?o:i.getRoot(),w=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}),h);if(!w)return null;let v=w.container;const _=k.backwards(w.container,w.offset,((e,t)=>{v=e;const n=g(e.data,t,f);return-1===n?n:n+1}),h),A=i.createRng();_?A.setStart(_.container,_.offset):A.setStart(v,0),A.setEnd(w.container,w.offset);const C=A.toString().replace(/\uFEFF/g,"").match(s);if(C){let t=C[0];return $="www.",(b=t).length>=$.length&&b.substr(0,0+$.length)===$?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)}))}();
@@ -4,7 +4,7 @@
4
4
  * Copyright (c) 2022 Ephox Corporation DBA Tiny Technologies, Inc.
5
5
  * Licensed under the Tiny commercial license. See https://www.tiny.cloud/legal/
6
6
  *
7
- * Version: 6.1.0
7
+ * Version: 6.3.1
8
8
  */
9
9
 
10
10
  (function () {
@@ -58,7 +58,8 @@
58
58
  }
59
59
  };
60
60
  const parseCssValueToInt = (dom, elm, name, computed) => {
61
- const value = parseInt(dom.getStyle(elm, name, computed), 10);
61
+ var _a;
62
+ const value = parseInt((_a = dom.getStyle(elm, name, computed)) !== null && _a !== void 0 ? _a : '', 10);
62
63
  return isNaN(value) ? 0 : value;
63
64
  };
64
65
  const shouldScrollIntoView = trigger => {