@tabler/core 1.0.0-beta12 → 1.0.0-beta13

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 (222) hide show
  1. package/dist/css/demo.css +188 -248
  2. package/dist/css/demo.min.css +3 -3
  3. package/dist/css/demo.rtl.css +188 -248
  4. package/dist/css/demo.rtl.min.css +3 -3
  5. package/dist/css/tabler-flags.css +529 -266
  6. package/dist/css/tabler-flags.min.css +3 -3
  7. package/dist/css/tabler-flags.rtl.css +529 -266
  8. package/dist/css/tabler-flags.rtl.min.css +3 -3
  9. package/dist/css/tabler-payments.css +252 -127
  10. package/dist/css/tabler-payments.min.css +2 -2
  11. package/dist/css/tabler-payments.rtl.css +252 -127
  12. package/dist/css/tabler-payments.rtl.min.css +2 -2
  13. package/dist/css/tabler-vendors.css +739 -469
  14. package/dist/css/tabler-vendors.min.css +3 -3
  15. package/dist/css/tabler-vendors.rtl.css +739 -469
  16. package/dist/css/tabler-vendors.rtl.min.css +3 -3
  17. package/dist/css/tabler.css +13247 -8033
  18. package/dist/css/tabler.min.css +4 -4
  19. package/dist/css/tabler.rtl.css +13244 -8031
  20. package/dist/css/tabler.rtl.min.css +4 -4
  21. package/dist/js/demo-theme.js +2 -2
  22. package/dist/js/demo-theme.min.js +2 -2
  23. package/dist/js/demo.js +2 -2
  24. package/dist/js/demo.min.js +2 -2
  25. package/dist/js/tabler.esm.js +138 -77
  26. package/dist/js/tabler.esm.min.js +5 -5
  27. package/dist/js/tabler.js +140 -79
  28. package/dist/js/tabler.min.js +5 -5
  29. package/dist/libs/bootstrap/dist/js/bootstrap.bundle.js +66 -72
  30. package/dist/libs/bootstrap/dist/js/bootstrap.bundle.js.map +1 -1
  31. package/dist/libs/bootstrap/dist/js/bootstrap.bundle.min.js +2 -2
  32. package/dist/libs/bootstrap/dist/js/bootstrap.bundle.min.js.map +1 -1
  33. package/dist/libs/bootstrap/dist/js/bootstrap.esm.js +65 -71
  34. package/dist/libs/bootstrap/dist/js/bootstrap.esm.js.map +1 -1
  35. package/dist/libs/bootstrap/dist/js/bootstrap.esm.min.js +2 -2
  36. package/dist/libs/bootstrap/dist/js/bootstrap.esm.min.js.map +1 -1
  37. package/dist/libs/bootstrap/dist/js/bootstrap.js +66 -72
  38. package/dist/libs/bootstrap/dist/js/bootstrap.js.map +1 -1
  39. package/dist/libs/bootstrap/dist/js/bootstrap.min.js +2 -2
  40. package/dist/libs/bootstrap/dist/js/bootstrap.min.js.map +1 -1
  41. package/dist/libs/tinymce/CHANGELOG.md +45 -0
  42. package/dist/libs/tinymce/composer.json +1 -1
  43. package/dist/libs/tinymce/icons/default/icons.js +2 -0
  44. package/dist/libs/tinymce/icons/default/icons.min.js +1 -1
  45. package/dist/libs/tinymce/models/dom/model.js +14 -10
  46. package/dist/libs/tinymce/models/dom/model.min.js +2 -2
  47. package/dist/libs/tinymce/package.json +1 -1
  48. package/dist/libs/tinymce/plugins/advlist/plugin.js +16 -9
  49. package/dist/libs/tinymce/plugins/advlist/plugin.min.js +2 -2
  50. package/dist/libs/tinymce/plugins/anchor/plugin.js +7 -6
  51. package/dist/libs/tinymce/plugins/anchor/plugin.min.js +2 -2
  52. package/dist/libs/tinymce/plugins/autolink/plugin.js +93 -97
  53. package/dist/libs/tinymce/plugins/autolink/plugin.min.js +2 -2
  54. package/dist/libs/tinymce/plugins/autoresize/plugin.js +3 -2
  55. package/dist/libs/tinymce/plugins/autoresize/plugin.min.js +2 -2
  56. package/dist/libs/tinymce/plugins/autosave/plugin.js +11 -10
  57. package/dist/libs/tinymce/plugins/autosave/plugin.min.js +2 -2
  58. package/dist/libs/tinymce/plugins/charmap/plugin.js +17 -7
  59. package/dist/libs/tinymce/plugins/charmap/plugin.min.js +2 -2
  60. package/dist/libs/tinymce/plugins/code/plugin.js +1 -1
  61. package/dist/libs/tinymce/plugins/code/plugin.min.js +1 -1
  62. package/dist/libs/tinymce/plugins/codesample/plugin.js +4 -6
  63. package/dist/libs/tinymce/plugins/codesample/plugin.min.js +2 -2
  64. package/dist/libs/tinymce/plugins/directionality/plugin.js +1 -1
  65. package/dist/libs/tinymce/plugins/directionality/plugin.min.js +1 -1
  66. package/dist/libs/tinymce/plugins/emoticons/plugin.js +10 -4
  67. package/dist/libs/tinymce/plugins/emoticons/plugin.min.js +2 -2
  68. package/dist/libs/tinymce/plugins/fullscreen/plugin.js +11 -5
  69. package/dist/libs/tinymce/plugins/fullscreen/plugin.min.js +2 -2
  70. package/dist/libs/tinymce/plugins/help/plugin.js +92 -19
  71. package/dist/libs/tinymce/plugins/help/plugin.min.js +2 -2
  72. package/dist/libs/tinymce/plugins/image/plugin.js +50 -37
  73. package/dist/libs/tinymce/plugins/image/plugin.min.js +2 -2
  74. package/dist/libs/tinymce/plugins/importcss/plugin.js +8 -6
  75. package/dist/libs/tinymce/plugins/importcss/plugin.min.js +2 -2
  76. package/dist/libs/tinymce/plugins/insertdatetime/plugin.js +2 -3
  77. package/dist/libs/tinymce/plugins/insertdatetime/plugin.min.js +2 -2
  78. package/dist/libs/tinymce/plugins/link/plugin.js +57 -43
  79. package/dist/libs/tinymce/plugins/link/plugin.min.js +2 -2
  80. package/dist/libs/tinymce/plugins/lists/plugin.js +120 -74
  81. package/dist/libs/tinymce/plugins/lists/plugin.min.js +2 -2
  82. package/dist/libs/tinymce/plugins/media/plugin.js +39 -24
  83. package/dist/libs/tinymce/plugins/media/plugin.min.js +2 -2
  84. package/dist/libs/tinymce/plugins/nonbreaking/plugin.js +1 -1
  85. package/dist/libs/tinymce/plugins/nonbreaking/plugin.min.js +1 -1
  86. package/dist/libs/tinymce/plugins/pagebreak/plugin.js +2 -2
  87. package/dist/libs/tinymce/plugins/pagebreak/plugin.min.js +2 -2
  88. package/dist/libs/tinymce/plugins/preview/plugin.js +1 -1
  89. package/dist/libs/tinymce/plugins/preview/plugin.min.js +1 -1
  90. package/dist/libs/tinymce/plugins/quickbars/plugin.js +3 -2
  91. package/dist/libs/tinymce/plugins/quickbars/plugin.min.js +2 -2
  92. package/dist/libs/tinymce/plugins/save/plugin.js +1 -1
  93. package/dist/libs/tinymce/plugins/save/plugin.min.js +1 -1
  94. package/dist/libs/tinymce/plugins/searchreplace/plugin.js +13 -13
  95. package/dist/libs/tinymce/plugins/searchreplace/plugin.min.js +2 -2
  96. package/dist/libs/tinymce/plugins/table/plugin.js +42 -37
  97. package/dist/libs/tinymce/plugins/table/plugin.min.js +2 -2
  98. package/dist/libs/tinymce/plugins/template/plugin.js +7 -4
  99. package/dist/libs/tinymce/plugins/template/plugin.min.js +2 -2
  100. package/dist/libs/tinymce/plugins/visualblocks/plugin.js +1 -1
  101. package/dist/libs/tinymce/plugins/visualblocks/plugin.min.js +1 -1
  102. package/dist/libs/tinymce/plugins/visualchars/plugin.js +9 -6
  103. package/dist/libs/tinymce/plugins/visualchars/plugin.min.js +2 -2
  104. package/dist/libs/tinymce/plugins/wordcount/plugin.js +6 -5
  105. package/dist/libs/tinymce/plugins/wordcount/plugin.min.js +2 -2
  106. package/dist/libs/tinymce/skins/ui/oxide/content.css +28 -0
  107. package/dist/libs/tinymce/skins/ui/oxide/content.inline.css +28 -0
  108. package/dist/libs/tinymce/skins/ui/oxide/content.inline.min.css +1 -1
  109. package/dist/libs/tinymce/skins/ui/oxide/content.min.css +1 -1
  110. package/dist/libs/tinymce/skins/ui/oxide/skin.css +39 -4
  111. package/dist/libs/tinymce/skins/ui/oxide/skin.min.css +1 -1
  112. package/dist/libs/tinymce/skins/ui/oxide-dark/content.css +28 -0
  113. package/dist/libs/tinymce/skins/ui/oxide-dark/content.inline.css +28 -0
  114. package/dist/libs/tinymce/skins/ui/oxide-dark/content.inline.min.css +1 -1
  115. package/dist/libs/tinymce/skins/ui/oxide-dark/content.min.css +1 -1
  116. package/dist/libs/tinymce/skins/ui/oxide-dark/skin.css +39 -4
  117. package/dist/libs/tinymce/skins/ui/oxide-dark/skin.min.css +1 -1
  118. package/dist/libs/tinymce/skins/ui/tinymce-5/content.css +28 -0
  119. package/dist/libs/tinymce/skins/ui/tinymce-5/content.inline.css +28 -0
  120. package/dist/libs/tinymce/skins/ui/tinymce-5/content.inline.min.css +1 -1
  121. package/dist/libs/tinymce/skins/ui/tinymce-5/content.min.css +1 -1
  122. package/dist/libs/tinymce/skins/ui/tinymce-5/skin.css +45 -4
  123. package/dist/libs/tinymce/skins/ui/tinymce-5/skin.min.css +1 -1
  124. package/dist/libs/tinymce/skins/ui/tinymce-5-dark/content.css +28 -0
  125. package/dist/libs/tinymce/skins/ui/tinymce-5-dark/content.inline.css +28 -0
  126. package/dist/libs/tinymce/skins/ui/tinymce-5-dark/content.inline.min.css +1 -1
  127. package/dist/libs/tinymce/skins/ui/tinymce-5-dark/content.min.css +1 -1
  128. package/dist/libs/tinymce/skins/ui/tinymce-5-dark/skin.css +44 -3
  129. package/dist/libs/tinymce/skins/ui/tinymce-5-dark/skin.min.css +1 -1
  130. package/dist/libs/tinymce/themes/silver/theme.js +2494 -1999
  131. package/dist/libs/tinymce/themes/silver/theme.min.js +2 -2
  132. package/dist/libs/tinymce/tinymce.d.ts +345 -169
  133. package/dist/libs/tinymce/tinymce.js +2988 -2392
  134. package/dist/libs/tinymce/tinymce.min.js +2 -2
  135. package/dist/libs/tom-select/dist/js/plugins/caret_position.js +164 -160
  136. package/dist/libs/tom-select/dist/js/plugins/caret_position.js.map +1 -1
  137. package/dist/libs/tom-select/dist/js/plugins/change_listener.js +1 -1
  138. package/dist/libs/tom-select/dist/js/plugins/change_listener.js.map +1 -1
  139. package/dist/libs/tom-select/dist/js/plugins/checkbox_options.js +12 -7
  140. package/dist/libs/tom-select/dist/js/plugins/checkbox_options.js.map +1 -1
  141. package/dist/libs/tom-select/dist/js/plugins/clear_button.js +94 -89
  142. package/dist/libs/tom-select/dist/js/plugins/clear_button.js.map +1 -1
  143. package/dist/libs/tom-select/dist/js/plugins/drag_drop.js +1 -1
  144. package/dist/libs/tom-select/dist/js/plugins/drag_drop.js.map +1 -1
  145. package/dist/libs/tom-select/dist/js/plugins/dropdown_header.js +121 -116
  146. package/dist/libs/tom-select/dist/js/plugins/dropdown_header.js.map +1 -1
  147. package/dist/libs/tom-select/dist/js/plugins/dropdown_input.js +234 -230
  148. package/dist/libs/tom-select/dist/js/plugins/dropdown_input.js.map +1 -1
  149. package/dist/libs/tom-select/dist/js/plugins/input_autogrow.js +1 -1
  150. package/dist/libs/tom-select/dist/js/plugins/input_autogrow.js.map +1 -1
  151. package/dist/libs/tom-select/dist/js/plugins/no_active_items.js +1 -1
  152. package/dist/libs/tom-select/dist/js/plugins/no_active_items.js.map +1 -1
  153. package/dist/libs/tom-select/dist/js/plugins/no_backspace_delete.js +1 -1
  154. package/dist/libs/tom-select/dist/js/plugins/no_backspace_delete.js.map +1 -1
  155. package/dist/libs/tom-select/dist/js/plugins/optgroup_columns.js +112 -107
  156. package/dist/libs/tom-select/dist/js/plugins/optgroup_columns.js.map +1 -1
  157. package/dist/libs/tom-select/dist/js/plugins/remove_button.js +149 -144
  158. package/dist/libs/tom-select/dist/js/plugins/remove_button.js.map +1 -1
  159. package/dist/libs/tom-select/dist/js/plugins/restore_on_backspace.js +1 -1
  160. package/dist/libs/tom-select/dist/js/plugins/restore_on_backspace.js.map +1 -1
  161. package/dist/libs/tom-select/dist/js/plugins/virtual_scroll.js +277 -269
  162. package/dist/libs/tom-select/dist/js/plugins/virtual_scroll.js.map +1 -1
  163. package/dist/libs/tom-select/dist/js/tom-select.base.js +756 -272
  164. package/dist/libs/tom-select/dist/js/tom-select.base.js.map +1 -1
  165. package/dist/libs/tom-select/dist/js/tom-select.base.min.js +329 -272
  166. package/dist/libs/tom-select/dist/js/tom-select.base.min.js.map +1 -1
  167. package/dist/libs/tom-select/dist/js/tom-select.complete.js +761 -273
  168. package/dist/libs/tom-select/dist/js/tom-select.complete.js.map +1 -1
  169. package/dist/libs/tom-select/dist/js/tom-select.complete.min.js +268 -209
  170. package/dist/libs/tom-select/dist/js/tom-select.complete.min.js.map +1 -1
  171. package/dist/libs/tom-select/dist/js/tom-select.popular.js +753 -269
  172. package/dist/libs/tom-select/dist/js/tom-select.popular.js.map +1 -1
  173. package/dist/libs/tom-select/dist/js/tom-select.popular.min.js +348 -291
  174. package/dist/libs/tom-select/dist/js/tom-select.popular.min.js.map +1 -1
  175. package/package.json +22 -24
  176. package/src/js/src/dropdown.js +5 -2
  177. package/src/js/tabler.js +2 -2
  178. package/src/scss/_core.scss +1 -0
  179. package/src/scss/_utilities.scss +2 -4
  180. package/src/scss/_variables.scss +129 -104
  181. package/src/scss/demo/_examples.scss +2 -2
  182. package/src/scss/demo/_highlight.scss +13 -277
  183. package/src/scss/demo.scss +3 -3
  184. package/src/scss/layout/_core.scss +1 -1
  185. package/src/scss/layout/_dark.scss +21 -34
  186. package/src/scss/layout/_footer.scss +1 -1
  187. package/src/scss/layout/_navbar.scss +20 -18
  188. package/src/scss/layout/_page.scss +3 -3
  189. package/src/scss/layout/_root.scss +11 -0
  190. package/src/scss/mixins/_mixins.scss +7 -6
  191. package/src/scss/ui/_alerts.scss +2 -2
  192. package/src/scss/ui/_avatars.scss +3 -3
  193. package/src/scss/ui/_badges.scss +3 -3
  194. package/src/scss/ui/_buttons.scss +14 -9
  195. package/src/scss/ui/_calendars.scss +4 -4
  196. package/src/scss/ui/_cards.scss +37 -52
  197. package/src/scss/ui/_carousel.scss +4 -4
  198. package/src/scss/ui/_dropdowns.scss +2 -1
  199. package/src/scss/ui/_empty.scss +1 -1
  200. package/src/scss/ui/_flags.scss +1 -1
  201. package/src/scss/ui/_forms.scss +2 -2
  202. package/src/scss/ui/_grid.scss +3 -3
  203. package/src/scss/ui/_lists.scss +3 -3
  204. package/src/scss/ui/_modals.scss +1 -1
  205. package/src/scss/ui/_nav.scss +3 -3
  206. package/src/scss/ui/_offcanvas.scss +1 -5
  207. package/src/scss/ui/_progress.scss +1 -1
  208. package/src/scss/ui/_ribbons.scss +12 -7
  209. package/src/scss/ui/_status.scss +2 -2
  210. package/src/scss/ui/_steps.scss +2 -2
  211. package/src/scss/ui/_tables.scss +2 -2
  212. package/src/scss/ui/_toasts.scss +1 -1
  213. package/src/scss/ui/_tracking.scss +29 -0
  214. package/src/scss/ui/_type.scss +35 -47
  215. package/src/scss/ui/forms/_form-colorinput.scss +1 -1
  216. package/src/scss/ui/forms/_form-imagecheck.scss +12 -4
  217. package/src/scss/ui/forms/_form-selectgroup.scss +2 -2
  218. package/src/scss/utils/_colors.scss +5 -3
  219. package/src/scss/vendor/_apexcharts.scss +26 -0
  220. package/src/scss/vendor/_jsvectormap.scss +2 -2
  221. package/src/scss/vendor/_litepicker.scss +4 -3
  222. package/src/scss/vendor/_tinymce.scss +14 -3
@@ -1,5 +1,5 @@
1
1
  /**
2
- * TinyMCE version 6.1.2 (2022-07-29)
2
+ * TinyMCE version 6.2.0 (2022-09-08)
3
3
  */
4
4
 
5
5
  (function () {
@@ -36,11 +36,11 @@
36
36
  const getNumberStyles = option('advlist_number_styles');
37
37
  const getBulletStyles = option('advlist_bullet_styles');
38
38
 
39
- var global = tinymce.util.Tools.resolve('tinymce.util.Tools');
40
-
41
39
  const isNullable = a => a === null || a === undefined;
42
40
  const isNonNullable = a => !isNullable(a);
43
41
 
42
+ var global = tinymce.util.Tools.resolve('tinymce.util.Tools');
43
+
44
44
  class Optional {
45
45
  constructor(tag, value) {
46
46
  this.tag = tag;
@@ -138,16 +138,21 @@
138
138
  return editor.dom.isChildOf(elm, editor.getBody());
139
139
  };
140
140
  const isTableCellNode = node => {
141
- return node && /^(TH|TD)$/.test(node.nodeName);
141
+ return isNonNullable(node) && /^(TH|TD)$/.test(node.nodeName);
142
142
  };
143
143
  const isListNode = editor => node => {
144
- return node && /^(OL|UL|DL)$/.test(node.nodeName) && isChildOfBody(editor, node);
144
+ return isNonNullable(node) && /^(OL|UL|DL)$/.test(node.nodeName) && isChildOfBody(editor, node);
145
145
  };
146
146
  const getSelectedStyleType = editor => {
147
147
  const listElm = editor.dom.getParent(editor.selection.getNode(), 'ol,ul');
148
148
  const style = editor.dom.getStyle(listElm, 'listStyleType');
149
149
  return Optional.from(style);
150
150
  };
151
+ const isWithinNonEditable = (editor, element) => element !== null && editor.dom.getContentEditableParent(element) === 'false';
152
+ const isWithinNonEditableList = (editor, element) => {
153
+ const parentList = editor.dom.getParent(element, 'ol,ul,dl');
154
+ return isWithinNonEditable(editor, parentList);
155
+ };
151
156
 
152
157
  const findIndex = (list, predicate) => {
153
158
  for (let index = 0; index < list.length; index++) {
@@ -163,6 +168,7 @@
163
168
  return chr.toUpperCase();
164
169
  });
165
170
  };
171
+ const normalizeStyleValue = styleValue => isNullable(styleValue) || styleValue === 'default' ? '' : styleValue;
166
172
  const isWithinList = (editor, e, nodeName) => {
167
173
  const tableCellIndex = findIndex(e.parents, isTableCellNode);
168
174
  const parents = tableCellIndex !== -1 ? e.parents.slice(0, tableCellIndex) : e.parents;
@@ -172,6 +178,7 @@
172
178
  const makeSetupHandler = (editor, nodeName) => api => {
173
179
  const nodeChangeHandler = e => {
174
180
  api.setActive(isWithinList(editor, e, nodeName));
181
+ api.setEnabled(!isWithinNonEditableList(editor, e.element));
175
182
  };
176
183
  editor.on('NodeChange', nodeChangeHandler);
177
184
  return () => editor.off('NodeChange', nodeChangeHandler);
@@ -186,7 +193,7 @@
186
193
  const items = global.map(styles, styleValue => {
187
194
  const iconStyle = nodeName === 'OL' ? 'num' : 'bull';
188
195
  const iconName = styleValue === 'disc' || styleValue === 'decimal' ? 'default' : styleValue;
189
- const itemValue = styleValue === 'default' ? '' : styleValue;
196
+ const itemValue = normalizeStyleValue(styleValue);
190
197
  const displayText = styleValueToText(styleValue);
191
198
  return {
192
199
  type: 'choiceitem',
@@ -208,20 +215,20 @@
208
215
  onSetup: makeSetupHandler(editor, nodeName)
209
216
  });
210
217
  };
211
- const addButton = (editor, id, tooltip, cmd, nodeName, _styles) => {
218
+ const addButton = (editor, id, tooltip, cmd, nodeName, styleValue) => {
212
219
  editor.ui.registry.addToggleButton(id, {
213
220
  active: false,
214
221
  tooltip,
215
222
  icon: nodeName === 'OL' ? 'ordered-list' : 'unordered-list',
216
223
  onSetup: makeSetupHandler(editor, nodeName),
217
- onAction: () => editor.execCommand(cmd)
224
+ onAction: () => editor.queryCommandState(cmd) || styleValue === '' ? editor.execCommand(cmd) : applyListFormat(editor, nodeName, styleValue)
218
225
  });
219
226
  };
220
227
  const addControl = (editor, id, tooltip, cmd, nodeName, styles) => {
221
228
  if (styles.length > 1) {
222
229
  addSplitButton(editor, id, tooltip, cmd, nodeName, styles);
223
230
  } else {
224
- addButton(editor, id, tooltip, cmd, nodeName);
231
+ addButton(editor, id, tooltip, cmd, nodeName, normalizeStyleValue(styles[0]));
225
232
  }
226
233
  };
227
234
  const register = editor => {
@@ -1,4 +1,4 @@
1
1
  /**
2
- * TinyMCE version 6.1.2 (2022-07-29)
2
+ * TinyMCE version 6.2.0 (2022-09-08)
3
3
  */
4
- !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.")}))}();
4
+ !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.")}))}();
@@ -1,5 +1,5 @@
1
1
  /**
2
- * TinyMCE version 6.1.2 (2022-07-29)
2
+ * TinyMCE version 6.2.0 (2022-09-08)
3
3
  */
4
4
 
5
5
  (function () {
@@ -27,7 +27,7 @@
27
27
  const id = elm.getAttribute('id') || elm.getAttribute('name');
28
28
  return id || '';
29
29
  };
30
- const isAnchor = elm => elm && elm.nodeName.toLowerCase() === 'a';
30
+ const isAnchor = elm => elm.nodeName.toLowerCase() === 'a';
31
31
  const isNamedAnchor = elm => isAnchor(elm) && !elm.getAttribute('href') && getIdFromAnchor(elm) !== '';
32
32
  const isEmptyNamedAnchor = elm => isNamedAnchor(elm) && !elm.firstChild;
33
33
 
@@ -60,7 +60,7 @@
60
60
  editor.insertContent(editor.dom.createHTML('a', { id }));
61
61
  } else {
62
62
  removeEmptyNamedAnchorsInSelection(editor);
63
- editor.formatter.remove('namedAnchor', null, null, true);
63
+ editor.formatter.remove('namedAnchor', undefined, undefined, true);
64
64
  editor.formatter.apply('namedAnchor', { value: id });
65
65
  editor.addVisual();
66
66
  }
@@ -133,7 +133,7 @@
133
133
  });
134
134
  };
135
135
 
136
- const isNamedAnchorNode = node => node && isEmptyString(node.attr('href')) && !isEmptyString(node.attr('id') || node.attr('name'));
136
+ const isNamedAnchorNode = node => isEmptyString(node.attr('href')) && !isEmptyString(node.attr('id') || node.attr('name'));
137
137
  const isEmptyNamedAnchorNode = node => isNamedAnchorNode(node) && !node.firstChild;
138
138
  const setContentEditable = state => nodes => {
139
139
  for (let i = 0; i < nodes.length; i++) {
@@ -165,16 +165,17 @@
165
165
  };
166
166
 
167
167
  const register = editor => {
168
+ const onAction = () => editor.execCommand('mceAnchor');
168
169
  editor.ui.registry.addToggleButton('anchor', {
169
170
  icon: 'bookmark',
170
171
  tooltip: 'Anchor',
171
- onAction: () => editor.execCommand('mceAnchor'),
172
+ onAction,
172
173
  onSetup: buttonApi => editor.selection.selectorChangedWithUnbind('a:not([href])', buttonApi.setActive).unbind
173
174
  });
174
175
  editor.ui.registry.addMenuItem('anchor', {
175
176
  icon: 'bookmark',
176
177
  text: 'Anchor...',
177
- onAction: () => editor.execCommand('mceAnchor')
178
+ onAction
178
179
  });
179
180
  };
180
181
 
@@ -1,4 +1,4 @@
1
1
  /**
2
- * TinyMCE version 6.1.2 (2022-07-29)
2
+ * TinyMCE version 6.2.0 (2022-09-08)
3
3
  */
4
- !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)}))}))}();
4
+ !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)}))}))}();
@@ -1,11 +1,11 @@
1
1
  /**
2
- * TinyMCE version 6.1.2 (2022-07-29)
2
+ * TinyMCE version 6.2.0 (2022-09-08)
3
3
  */
4
4
 
5
5
  (function () {
6
6
  'use strict';
7
7
 
8
- var global = tinymce.util.Tools.resolve('tinymce.PluginManager');
8
+ var global$1 = tinymce.util.Tools.resolve('tinymce.PluginManager');
9
9
 
10
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;
11
11
 
@@ -25,6 +25,7 @@
25
25
  const getAutoLinkPattern = option('autolink_pattern');
26
26
  const getDefaultLinkTarget = option('link_default_target');
27
27
  const getDefaultLinkProtocol = option('link_default_protocol');
28
+ const allowUnsafeLinkTarget = option('allow_unsafe_link_target');
28
29
 
29
30
  const hasProto = (v, constructor, predicate) => {
30
31
  var _a;
@@ -47,123 +48,113 @@
47
48
  }
48
49
  };
49
50
  const isType = type => value => typeOf(value) === type;
51
+ const eq = t => a => t === a;
50
52
  const isString = isType('string');
53
+ const isUndefined = eq(undefined);
51
54
  const isNullable = a => a === null || a === undefined;
52
55
  const isNonNullable = a => !isNullable(a);
53
56
 
57
+ const not = f => t => !f(t);
58
+
59
+ const hasOwnProperty = Object.hasOwnProperty;
60
+ const has = (obj, key) => hasOwnProperty.call(obj, key);
61
+
54
62
  const checkRange = (str, substr, start) => substr === '' || str.length >= substr.length && str.substr(start, start + substr.length) === substr;
55
- const contains = (str, substr) => {
56
- return str.indexOf(substr) !== -1;
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
+ }
57
70
  };
58
71
  const startsWith = (str, prefix) => {
59
72
  return checkRange(str, prefix, 0);
60
73
  };
61
74
 
62
- const rangeEqualsBracketOrSpace = rangeString => /^[(\[{ \u00a0]$/.test(rangeString);
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
+
63
81
  const isTextNode = node => node.nodeType === 3;
64
82
  const isElement = node => node.nodeType === 1;
65
- const scopeIndex = (container, index) => {
66
- if (index < 0) {
67
- index = 0;
68
- }
69
- if (isTextNode(container)) {
70
- const len = container.data.length;
71
- if (index > len) {
72
- index = len;
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;
73
91
  }
74
92
  }
75
- return index;
93
+ return -1;
76
94
  };
77
- const setStart = (rng, container, offset) => {
78
- if (!isElement(container) || container.hasChildNodes()) {
79
- rng.setStart(container, scopeIndex(container, offset));
80
- } else {
81
- rng.setStartBefore(container);
82
- }
83
- };
84
- const setEnd = (rng, container, offset) => {
85
- if (!isElement(container) || container.hasChildNodes()) {
86
- rng.setEnd(container, scopeIndex(container, offset));
87
- } else {
88
- rng.setEndAfter(container);
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;
89
101
  }
102
+ return {
103
+ container: tempNode,
104
+ offset: tempOffset
105
+ };
90
106
  };
91
- const hasProtocol = url => /^([A-Za-z][A-Za-z\d.+-]*:\/\/)|mailto:/.test(url);
92
- const isPunctuation = char => /[?!,.;:]/.test(char);
93
- const parseCurrentLine = (editor, endOffset) => {
94
- let end, endContainer, text, prev, len, rngText;
107
+
108
+ const parseCurrentLine = (editor, offset) => {
109
+ var _a;
110
+ const voidElements = editor.schema.getVoidElements();
95
111
  const autoLinkPattern = getAutoLinkPattern(editor);
96
- if (editor.dom.getParent(editor.selection.getNode(), 'a[href]') !== null) {
97
- return;
112
+ const {dom, selection} = editor;
113
+ if (dom.getParent(selection.getNode(), 'a[href]') !== null) {
114
+ return null;
98
115
  }
99
- const rng = editor.selection.getRng().cloneRange();
100
- if (rng.startOffset < 5) {
101
- prev = rng.endContainer.previousSibling;
102
- if (!prev) {
103
- if (!rng.endContainer.firstChild || !rng.endContainer.firstChild.nextSibling) {
104
- return;
105
- }
106
- prev = rng.endContainer.firstChild.nextSibling;
107
- }
108
- len = prev.length;
109
- setStart(rng, prev, len);
110
- setEnd(rng, prev, len);
111
- if (rng.endOffset < 5) {
112
- return;
113
- }
114
- end = rng.endOffset;
115
- endContainer = prev;
116
- } else {
117
- endContainer = rng.endContainer;
118
- if (!isTextNode(endContainer) && endContainer.firstChild) {
119
- while (!isTextNode(endContainer) && endContainer.firstChild) {
120
- endContainer = endContainer.firstChild;
121
- }
122
- if (isTextNode(endContainer)) {
123
- setStart(rng, endContainer, 0);
124
- setEnd(rng, endContainer, endContainer.nodeValue.length);
125
- }
126
- }
127
- if (rng.endOffset === 1) {
128
- end = 2;
129
- } else {
130
- end = rng.endOffset - 1 - endOffset;
131
- }
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
132
  }
133
- const start = end;
134
- do {
135
- setStart(rng, endContainer, end >= 2 ? end - 2 : 0);
136
- setEnd(rng, endContainer, end >= 1 ? end - 1 : 0);
137
- end -= 1;
138
- rngText = rng.toString();
139
- } while (!rangeEqualsBracketOrSpace(rngText) && end - 2 >= 0);
140
- if (rangeEqualsBracketOrSpace(rng.toString())) {
141
- setStart(rng, endContainer, end);
142
- setEnd(rng, endContainer, start);
143
- end += 1;
144
- } else if (rng.startOffset === 0) {
145
- setStart(rng, endContainer, 0);
146
- setEnd(rng, endContainer, start);
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);
147
142
  } else {
148
- setStart(rng, endContainer, end);
149
- setEnd(rng, endContainer, start);
143
+ newRng.setStart(startSpot.container, startSpot.offset);
150
144
  }
151
- text = rng.toString();
152
- if (isPunctuation(text.charAt(text.length - 1))) {
153
- setEnd(rng, endContainer, start - 1);
154
- }
155
- text = rng.toString().trim();
156
- const matches = text.match(autoLinkPattern);
157
- const protocol = getDefaultLinkProtocol(editor);
145
+ newRng.setEnd(endSpot.container, endSpot.offset);
146
+ const rngText = removeZwsp(newRng.toString());
147
+ const matches = rngText.match(autoLinkPattern);
158
148
  if (matches) {
159
149
  let url = matches[0];
160
150
  if (startsWith(url, 'www.')) {
151
+ const protocol = getDefaultLinkProtocol(editor);
161
152
  url = protocol + '://' + url;
162
153
  } else if (contains(url, '@') && !hasProtocol(url)) {
163
154
  url = 'mailto:' + url;
164
155
  }
165
156
  return {
166
- rng,
157
+ rng: newRng,
167
158
  url
168
159
  };
169
160
  } else {
@@ -171,10 +162,10 @@
171
162
  }
172
163
  };
173
164
  const convertToLink = (editor, result) => {
174
- const defaultLinkTarget = getDefaultLinkTarget(editor);
165
+ const {dom, selection} = editor;
175
166
  const {rng, url} = result;
176
- const bookmark = editor.selection.getBookmark();
177
- editor.selection.setRng(rng);
167
+ const bookmark = selection.getBookmark();
168
+ selection.setRng(rng);
178
169
  const command = 'createlink';
179
170
  const args = {
180
171
  command,
@@ -185,22 +176,27 @@
185
176
  if (!beforeExecEvent.isDefaultPrevented()) {
186
177
  editor.getDoc().execCommand(command, false, url);
187
178
  editor.dispatch('ExecCommand', args);
179
+ const defaultLinkTarget = getDefaultLinkTarget(editor);
188
180
  if (isString(defaultLinkTarget)) {
189
- editor.dom.setAttrib(editor.selection.getNode(), 'target', defaultLinkTarget);
181
+ const anchor = selection.getNode();
182
+ dom.setAttrib(anchor, 'target', defaultLinkTarget);
183
+ if (defaultLinkTarget === '_blank' && !allowUnsafeLinkTarget(editor)) {
184
+ dom.setAttrib(anchor, 'rel', 'noopener');
185
+ }
190
186
  }
191
187
  }
192
- editor.selection.moveToBookmark(bookmark);
188
+ selection.moveToBookmark(bookmark);
193
189
  editor.nodeChanged();
194
190
  };
195
191
  const handleSpacebar = editor => {
196
- const result = parseCurrentLine(editor, 0);
192
+ const result = parseCurrentLine(editor, -1);
197
193
  if (isNonNullable(result)) {
198
194
  convertToLink(editor, result);
199
195
  }
200
196
  };
201
197
  const handleBracket = handleSpacebar;
202
198
  const handleEnter = editor => {
203
- const result = parseCurrentLine(editor, -1);
199
+ const result = parseCurrentLine(editor, 0);
204
200
  if (isNonNullable(result)) {
205
201
  convertToLink(editor, result);
206
202
  }
@@ -221,7 +217,7 @@
221
217
  };
222
218
 
223
219
  var Plugin = () => {
224
- global.add('autolink', editor => {
220
+ global$1.add('autolink', editor => {
225
221
  register(editor);
226
222
  setup(editor);
227
223
  });
@@ -1,4 +1,4 @@
1
1
  /**
2
- * TinyMCE version 6.1.2 (2022-07-29)
2
+ * TinyMCE version 6.2.0 (2022-09-08)
3
3
  */
4
- !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=>!(t=>null==t)(t),l=t=>/^[(\[{ \u00a0]$/.test(t),a=t=>3===t.nodeType,d=t=>1===t.nodeType,c=(t,e)=>{if(e<0&&(e=0),a(t)){const n=t.data.length;e>n&&(e=n)}return e},f=(t,e,n)=>{!d(e)||e.hasChildNodes()?t.setStart(e,c(e,n)):t.setStartBefore(e)},g=(t,e,n)=>{!d(e)||e.hasChildNodes()?t.setEnd(e,c(e,n)):t.setEndAfter(e)},u=(t,e)=>{let o,i,s,d,c,u;const h=n(t);if(null!==t.dom.getParent(t.selection.getNode(),"a[href]"))return;const p=t.selection.getRng().cloneRange();if(p.startOffset<5){if(d=p.endContainer.previousSibling,!d){if(!p.endContainer.firstChild||!p.endContainer.firstChild.nextSibling)return;d=p.endContainer.firstChild.nextSibling}if(c=d.length,f(p,d,c),g(p,d,c),p.endOffset<5)return;o=p.endOffset,i=d}else{if(i=p.endContainer,!a(i)&&i.firstChild){for(;!a(i)&&i.firstChild;)i=i.firstChild;a(i)&&(f(p,i,0),g(p,i,i.nodeValue.length))}o=1===p.endOffset?2:p.endOffset-1-e}const m=o;do{f(p,i,o>=2?o-2:0),g(p,i,o>=1?o-1:0),o-=1,u=p.toString()}while(!l(u)&&o-2>=0);var C;l(p.toString())?(f(p,i,o),g(p,i,m),o+=1):0===p.startOffset?(f(p,i,0),g(p,i,m)):(f(p,i,o),g(p,i,m)),s=p.toString(),C=s.charAt(s.length-1),/[?!,.;:]/.test(C)&&g(p,i,m-1),s=p.toString().trim();const k=s.match(h),y=r(t);if(k){let t=k[0];return v="www.",(w=t).length>=v.length&&w.substr(0,0+v.length)===v?t=y+"://"+t:((t,e)=>-1!==t.indexOf("@"))(t)&&!(t=>/^([A-Za-z][A-Za-z\d.+-]*:\/\/)|mailto:/.test(t))(t)&&(t="mailto:"+t),{rng:p,url:t}}var w,v;return null},h=(t,e)=>{const n=o(t),{rng:r,url:s}=e,l=t.selection.getBookmark();t.selection.setRng(r);const a="createlink",d={command:a,ui:!1,value:s};t.dispatch("BeforeExecCommand",d).isDefaultPrevented()||(t.getDoc().execCommand(a,!1,s),t.dispatch("ExecCommand",d),i(n)&&t.dom.setAttrib(t.selection.getNode(),"target",n)),t.selection.moveToBookmark(l),t.nodeChanged()},p=t=>{const e=u(t,0);s(e)&&h(t,e)},m=p;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=>{13!==e.keyCode||e.isDefaultPrevented()||(t=>{const e=u(t,-1);s(e)&&h(t,e)})(t)})),t.on("keyup",(e=>{32===e.keyCode?p(t):(48===e.keyCode&&e.shiftKey||221===e.keyCode)&&m(t)}))})(t)}))}();
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),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)}))}();
@@ -1,5 +1,5 @@
1
1
  /**
2
- * TinyMCE version 6.1.2 (2022-07-29)
2
+ * TinyMCE version 6.2.0 (2022-09-08)
3
3
  */
4
4
 
5
5
  (function () {
@@ -53,7 +53,8 @@
53
53
  }
54
54
  };
55
55
  const parseCssValueToInt = (dom, elm, name, computed) => {
56
- const value = parseInt(dom.getStyle(elm, name, computed), 10);
56
+ var _a;
57
+ const value = parseInt((_a = dom.getStyle(elm, name, computed)) !== null && _a !== void 0 ? _a : '', 10);
57
58
  return isNaN(value) ? 0 : value;
58
59
  };
59
60
  const shouldScrollIntoView = trigger => {
@@ -1,4 +1,4 @@
1
1
  /**
2
- * TinyMCE version 6.1.2 (2022-07-29)
2
+ * TinyMCE version 6.2.0 (2022-09-08)
3
3
  */
4
- !function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),t=tinymce.util.Tools.resolve("tinymce.Env");const o=e=>t=>t.options.get(e),n=o("min_height"),s=o("max_height"),i=o("autoresize_overflow_padding"),r=o("autoresize_bottom_margin"),l=(e,t)=>{const o=e.getBody();o&&(o.style.overflowY=t?"":"hidden",t||(o.scrollTop=0))},a=(e,t,o,n)=>{const s=parseInt(e.getStyle(t,o,n),10);return isNaN(s)?0:s},g=(e,o,i)=>{var c;const u=e.dom,d=e.getDoc();if(!d)return;if((e=>e.plugins.fullscreen&&e.plugins.fullscreen.isFullscreen())(e))return void l(e,!0);const f=d.documentElement,m=r(e),p=null!==(c=n(e))&&void 0!==c?c:e.getElement().offsetHeight;let h=p;const y=a(u,f,"margin-top",!0),v=a(u,f,"margin-bottom",!0);let C=f.offsetHeight+y+v+m;C<0&&(C=0);const S=e.getContainer().offsetHeight-e.getContentAreaContainer().offsetHeight;C+S>p&&(h=C+S);const z=s(e);if(z&&h>z?(h=z,l(e,!0)):l(e,!1),h!==o.get()){const n=h-o.get();if(u.setStyle(e.getContainer(),"height",h+"px"),o.set(h),(e=>{e.dispatch("ResizeEditor")})(e),t.browser.isSafari()&&(t.os.isMacOS()||t.os.isiOS())){const t=e.getWin();t.scrollTo(t.pageXOffset,t.pageYOffset)}e.hasFocus()&&(e=>{if("setcontent"===(null==e?void 0:e.type.toLowerCase())){const t=e;return!0===t.selection||!0===t.paste}return!1})(i)&&e.selection.scrollIntoView(),(t.browser.isSafari()||t.browser.isChromium())&&n<0&&g(e,o,i)}};e.add("autoresize",(e=>{if((e=>{const t=e.options.register;t("autoresize_overflow_padding",{processor:"number",default:1}),t("autoresize_bottom_margin",{processor:"number",default:50})})(e),e.options.isSet("resize")||e.options.set("resize",!1),!e.inline){const t=(e=>{let t=0;return{get:()=>t,set:e=>{t=e}}})();((e,t)=>{e.addCommand("mceAutoResize",(()=>{g(e,t)}))})(e,t),((e,t)=>{e.on("init",(()=>{const t=i(e),o=e.dom;o.setStyles(e.getDoc().documentElement,{height:"auto"}),o.setStyles(e.getBody(),{paddingLeft:t,paddingRight:t,"min-height":0})})),e.on("NodeChange SetContent keyup FullscreenStateChanged ResizeContent",(o=>{g(e,t,o)}))})(e,t)}}))}();
4
+ !function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),t=tinymce.util.Tools.resolve("tinymce.Env");const o=e=>t=>t.options.get(e),n=o("min_height"),s=o("max_height"),i=o("autoresize_overflow_padding"),r=o("autoresize_bottom_margin"),l=(e,t)=>{const o=e.getBody();o&&(o.style.overflowY=t?"":"hidden",t||(o.scrollTop=0))},a=(e,t,o,n)=>{var s;const i=parseInt(null!==(s=e.getStyle(t,o,n))&&void 0!==s?s:"",10);return isNaN(i)?0:i},g=(e,o,i)=>{var c;const u=e.dom,d=e.getDoc();if(!d)return;if((e=>e.plugins.fullscreen&&e.plugins.fullscreen.isFullscreen())(e))return void l(e,!0);const f=d.documentElement,m=r(e),p=null!==(c=n(e))&&void 0!==c?c:e.getElement().offsetHeight;let h=p;const v=a(u,f,"margin-top",!0),y=a(u,f,"margin-bottom",!0);let C=f.offsetHeight+v+y+m;C<0&&(C=0);const S=e.getContainer().offsetHeight-e.getContentAreaContainer().offsetHeight;C+S>p&&(h=C+S);const z=s(e);if(z&&h>z?(h=z,l(e,!0)):l(e,!1),h!==o.get()){const n=h-o.get();if(u.setStyle(e.getContainer(),"height",h+"px"),o.set(h),(e=>{e.dispatch("ResizeEditor")})(e),t.browser.isSafari()&&(t.os.isMacOS()||t.os.isiOS())){const t=e.getWin();t.scrollTo(t.pageXOffset,t.pageYOffset)}e.hasFocus()&&(e=>{if("setcontent"===(null==e?void 0:e.type.toLowerCase())){const t=e;return!0===t.selection||!0===t.paste}return!1})(i)&&e.selection.scrollIntoView(),(t.browser.isSafari()||t.browser.isChromium())&&n<0&&g(e,o,i)}};e.add("autoresize",(e=>{if((e=>{const t=e.options.register;t("autoresize_overflow_padding",{processor:"number",default:1}),t("autoresize_bottom_margin",{processor:"number",default:50})})(e),e.options.isSet("resize")||e.options.set("resize",!1),!e.inline){const t=(e=>{let t=0;return{get:()=>t,set:e=>{t=e}}})();((e,t)=>{e.addCommand("mceAutoResize",(()=>{g(e,t)}))})(e,t),((e,t)=>{e.on("init",(()=>{const t=i(e),o=e.dom;o.setStyles(e.getDoc().documentElement,{height:"auto"}),o.setStyles(e.getBody(),{paddingLeft:t,paddingRight:t,"min-height":0})})),e.on("NodeChange SetContent keyup FullscreenStateChanged ResizeContent",(o=>{g(e,t,o)}))})(e,t)}}))}();
@@ -1,5 +1,5 @@
1
1
  /**
2
- * TinyMCE version 6.1.2 (2022-07-29)
2
+ * TinyMCE version 6.2.0 (2022-09-08)
3
3
  */
4
4
 
5
5
  (function () {
@@ -48,7 +48,7 @@
48
48
  m: 60000
49
49
  };
50
50
  const parsedTime = /^(\d+)([ms]?)$/.exec(timeString);
51
- return (parsedTime[2] ? multiples[parsedTime[2]] : 1) * parseInt(timeString, 10);
51
+ return (parsedTime && parsedTime[2] ? multiples[parsedTime[2]] : 1) * parseInt(timeString, 10);
52
52
  };
53
53
 
54
54
  const option = name => editor => editor.options.get(name);
@@ -112,7 +112,8 @@
112
112
  }
113
113
  };
114
114
  const hasDraft = editor => {
115
- const time = parseInt(global$2.getItem(getAutoSavePrefix(editor) + 'time'), 10) || 0;
115
+ var _a;
116
+ const time = parseInt((_a = global$2.getItem(getAutoSavePrefix(editor) + 'time')) !== null && _a !== void 0 ? _a : '0', 10) || 0;
116
117
  if (new Date().getTime() - time > getAutoSaveRetention(editor)) {
117
118
  removeDraft(editor, false);
118
119
  return false;
@@ -139,9 +140,10 @@
139
140
  }
140
141
  };
141
142
  const restoreDraft = editor => {
143
+ var _a;
142
144
  const prefix = getAutoSavePrefix(editor);
143
145
  if (hasDraft(editor)) {
144
- editor.setContent(global$2.getItem(prefix + 'draft'), { format: 'raw' });
146
+ editor.setContent((_a = global$2.getItem(prefix + 'draft')) !== null && _a !== void 0 ? _a : '', { format: 'raw' });
145
147
  fireRestoreDraft(editor);
146
148
  }
147
149
  };
@@ -195,20 +197,19 @@
195
197
  };
196
198
  const register = editor => {
197
199
  startStoreDraft(editor);
200
+ const onAction = () => {
201
+ restoreLastDraft(editor);
202
+ };
198
203
  editor.ui.registry.addButton('restoredraft', {
199
204
  tooltip: 'Restore last draft',
200
205
  icon: 'restore-draft',
201
- onAction: () => {
202
- restoreLastDraft(editor);
203
- },
206
+ onAction,
204
207
  onSetup: makeSetupHandler(editor)
205
208
  });
206
209
  editor.ui.registry.addMenuItem('restoredraft', {
207
210
  text: 'Restore last draft',
208
211
  icon: 'restore-draft',
209
- onAction: () => {
210
- restoreLastDraft(editor);
211
- },
212
+ onAction,
212
213
  onSetup: makeSetupHandler(editor)
213
214
  });
214
215
  };
@@ -1,4 +1,4 @@
1
1
  /**
2
- * TinyMCE version 6.1.2 (2022-07-29)
2
+ * TinyMCE version 6.2.0 (2022-09-08)
3
3
  */
4
- !function(){"use strict";var t=tinymce.util.Tools.resolve("tinymce.PluginManager");const e=("string",t=>"string"===(t=>{const e=typeof t;return null===t?"null":"object"===e&&Array.isArray(t)?"array":"object"===e&&(r=o=t,(a=String).prototype.isPrototypeOf(r)||(null===(s=o.constructor)||void 0===s?void 0:s.name)===a.name)?"string":e;var r,o,a,s})(t));const r=(void 0,t=>undefined===t);var o=tinymce.util.Tools.resolve("tinymce.util.Delay"),a=tinymce.util.Tools.resolve("tinymce.util.LocalStorage"),s=tinymce.util.Tools.resolve("tinymce.util.Tools");const n=t=>{const e=/^(\d+)([ms]?)$/.exec(t);return(e[2]?{s:1e3,m:6e4}[e[2]]:1)*parseInt(t,10)},i=t=>e=>e.options.get(t),u=i("autosave_ask_before_unload"),l=i("autosave_restore_when_empty"),c=i("autosave_interval"),m=i("autosave_retention"),d=t=>{const e=document.location;return t.options.get("autosave_prefix").replace(/{path}/g,e.pathname).replace(/{query}/g,e.search).replace(/{hash}/g,e.hash).replace(/{id}/g,t.id)},f=(t,e)=>{if(r(e))return t.dom.isEmpty(t.getBody());{const r=s.trim(e);if(""===r)return!0;{const e=(new DOMParser).parseFromString(r,"text/html");return t.dom.isEmpty(e)}}},v=t=>{const e=parseInt(a.getItem(d(t)+"time"),10)||0;return!((new Date).getTime()-e>m(t)&&(p(t,!1),1))},p=(t,e)=>{const r=d(t);a.removeItem(r+"draft"),a.removeItem(r+"time"),!1!==e&&(t=>{t.dispatch("RemoveDraft")})(t)},g=t=>{const e=d(t);!f(t)&&t.isDirty()&&(a.setItem(e+"draft",t.getContent({format:"raw",no_events:!0})),a.setItem(e+"time",(new Date).getTime().toString()),(t=>{t.dispatch("StoreDraft")})(t))},y=t=>{const e=d(t);v(t)&&(t.setContent(a.getItem(e+"draft"),{format:"raw"}),(t=>{t.dispatch("RestoreDraft")})(t))},D=t=>{t.undoManager.transact((()=>{y(t),p(t)})),t.focus()};var h=tinymce.util.Tools.resolve("tinymce.EditorManager");const _=t=>e=>{e.setEnabled(v(t));const r=()=>e.setEnabled(v(t));return t.on("StoreDraft RestoreDraft RemoveDraft",r),()=>t.off("StoreDraft RestoreDraft RemoveDraft",r)};t.add("autosave",(t=>((t=>{const r=t.options.register,o=t=>{const r=e(t);return r?{value:n(t),valid:r}:{valid:!1,message:"Must be a string."}};r("autosave_ask_before_unload",{processor:"boolean",default:!0}),r("autosave_prefix",{processor:"string",default:"tinymce-autosave-{path}{query}{hash}-{id}-"}),r("autosave_restore_when_empty",{processor:"boolean",default:!1}),r("autosave_interval",{processor:o,default:"30s"}),r("autosave_retention",{processor:o,default:"20m"})})(t),(t=>{t.editorManager.on("BeforeUnload",(t=>{let e;s.each(h.get(),(t=>{t.plugins.autosave&&t.plugins.autosave.storeDraft(),!e&&t.isDirty()&&u(t)&&(e=t.translate("You have unsaved changes are you sure you want to navigate away?"))})),e&&(t.preventDefault(),t.returnValue=e)}))})(t),(t=>{(t=>{const e=c(t);o.setEditorInterval(t,(()=>{g(t)}),e)})(t),t.ui.registry.addButton("restoredraft",{tooltip:"Restore last draft",icon:"restore-draft",onAction:()=>{D(t)},onSetup:_(t)}),t.ui.registry.addMenuItem("restoredraft",{text:"Restore last draft",icon:"restore-draft",onAction:()=>{D(t)},onSetup:_(t)})})(t),t.on("init",(()=>{l(t)&&t.dom.isEmpty(t.getBody())&&y(t)})),(t=>({hasDraft:()=>v(t),storeDraft:()=>g(t),restoreDraft:()=>y(t),removeDraft:e=>p(t,e),isEmpty:e=>f(t,e)}))(t))))}();
4
+ !function(){"use strict";var t=tinymce.util.Tools.resolve("tinymce.PluginManager");const e=("string",t=>"string"===(t=>{const e=typeof t;return null===t?"null":"object"===e&&Array.isArray(t)?"array":"object"===e&&(r=o=t,(a=String).prototype.isPrototypeOf(r)||(null===(s=o.constructor)||void 0===s?void 0:s.name)===a.name)?"string":e;var r,o,a,s})(t));const r=(void 0,t=>undefined===t);var o=tinymce.util.Tools.resolve("tinymce.util.Delay"),a=tinymce.util.Tools.resolve("tinymce.util.LocalStorage"),s=tinymce.util.Tools.resolve("tinymce.util.Tools");const n=t=>{const e=/^(\d+)([ms]?)$/.exec(t);return(e&&e[2]?{s:1e3,m:6e4}[e[2]]:1)*parseInt(t,10)},i=t=>e=>e.options.get(t),u=i("autosave_ask_before_unload"),l=i("autosave_restore_when_empty"),c=i("autosave_interval"),d=i("autosave_retention"),m=t=>{const e=document.location;return t.options.get("autosave_prefix").replace(/{path}/g,e.pathname).replace(/{query}/g,e.search).replace(/{hash}/g,e.hash).replace(/{id}/g,t.id)},v=(t,e)=>{if(r(e))return t.dom.isEmpty(t.getBody());{const r=s.trim(e);if(""===r)return!0;{const e=(new DOMParser).parseFromString(r,"text/html");return t.dom.isEmpty(e)}}},f=t=>{var e;const r=parseInt(null!==(e=a.getItem(m(t)+"time"))&&void 0!==e?e:"0",10)||0;return!((new Date).getTime()-r>d(t)&&(p(t,!1),1))},p=(t,e)=>{const r=m(t);a.removeItem(r+"draft"),a.removeItem(r+"time"),!1!==e&&(t=>{t.dispatch("RemoveDraft")})(t)},g=t=>{const e=m(t);!v(t)&&t.isDirty()&&(a.setItem(e+"draft",t.getContent({format:"raw",no_events:!0})),a.setItem(e+"time",(new Date).getTime().toString()),(t=>{t.dispatch("StoreDraft")})(t))},y=t=>{var e;const r=m(t);f(t)&&(t.setContent(null!==(e=a.getItem(r+"draft"))&&void 0!==e?e:"",{format:"raw"}),(t=>{t.dispatch("RestoreDraft")})(t))};var D=tinymce.util.Tools.resolve("tinymce.EditorManager");const h=t=>e=>{e.setEnabled(f(t));const r=()=>e.setEnabled(f(t));return t.on("StoreDraft RestoreDraft RemoveDraft",r),()=>t.off("StoreDraft RestoreDraft RemoveDraft",r)};t.add("autosave",(t=>((t=>{const r=t.options.register,o=t=>{const r=e(t);return r?{value:n(t),valid:r}:{valid:!1,message:"Must be a string."}};r("autosave_ask_before_unload",{processor:"boolean",default:!0}),r("autosave_prefix",{processor:"string",default:"tinymce-autosave-{path}{query}{hash}-{id}-"}),r("autosave_restore_when_empty",{processor:"boolean",default:!1}),r("autosave_interval",{processor:o,default:"30s"}),r("autosave_retention",{processor:o,default:"20m"})})(t),(t=>{t.editorManager.on("BeforeUnload",(t=>{let e;s.each(D.get(),(t=>{t.plugins.autosave&&t.plugins.autosave.storeDraft(),!e&&t.isDirty()&&u(t)&&(e=t.translate("You have unsaved changes are you sure you want to navigate away?"))})),e&&(t.preventDefault(),t.returnValue=e)}))})(t),(t=>{(t=>{const e=c(t);o.setEditorInterval(t,(()=>{g(t)}),e)})(t);const e=()=>{(t=>{t.undoManager.transact((()=>{y(t),p(t)})),t.focus()})(t)};t.ui.registry.addButton("restoredraft",{tooltip:"Restore last draft",icon:"restore-draft",onAction:e,onSetup:h(t)}),t.ui.registry.addMenuItem("restoredraft",{text:"Restore last draft",icon:"restore-draft",onAction:e,onSetup:h(t)})})(t),t.on("init",(()=>{l(t)&&t.dom.isEmpty(t.getBody())&&y(t)})),(t=>({hasDraft:()=>f(t),storeDraft:()=>g(t),restoreDraft:()=>y(t),removeDraft:e=>p(t,e),isEmpty:e=>v(t,e)}))(t))))}();