@dangl/angular-material-shared 2.9.0-beta0036 → 2.9.0-beta0039

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 (173) hide show
  1. package/fesm2022/dangl-angular-material-shared-tiny-mce.mjs +38 -31
  2. package/fesm2022/dangl-angular-material-shared-tiny-mce.mjs.map +1 -1
  3. package/fesm2022/dangl-angular-material-shared.mjs +36 -51
  4. package/fesm2022/dangl-angular-material-shared.mjs.map +1 -1
  5. package/package.json +11 -10
  6. package/tinymce-assets/icons/default/icons.js +46 -9
  7. package/tinymce-assets/icons/default/icons.min.js +1 -1
  8. package/tinymce-assets/models/dom/model.js +8198 -7244
  9. package/tinymce-assets/models/dom/model.min.js +1 -4
  10. package/tinymce-assets/plugins/accordion/plugin.js +1174 -879
  11. package/tinymce-assets/plugins/accordion/plugin.min.js +1 -4
  12. package/tinymce-assets/plugins/advlist/plugin.js +412 -200
  13. package/tinymce-assets/plugins/advlist/plugin.min.js +1 -4
  14. package/tinymce-assets/plugins/anchor/plugin.js +189 -166
  15. package/tinymce-assets/plugins/anchor/plugin.min.js +1 -4
  16. package/tinymce-assets/plugins/autolink/plugin.js +310 -220
  17. package/tinymce-assets/plugins/autolink/plugin.min.js +1 -4
  18. package/tinymce-assets/plugins/autoresize/plugin.js +180 -149
  19. package/tinymce-assets/plugins/autoresize/plugin.min.js +1 -4
  20. package/tinymce-assets/plugins/autosave/plugin.js +208 -189
  21. package/tinymce-assets/plugins/autosave/plugin.min.js +1 -4
  22. package/tinymce-assets/plugins/charmap/plugin.js +905 -1566
  23. package/tinymce-assets/plugins/charmap/plugin.min.js +1 -4
  24. package/tinymce-assets/plugins/code/plugin.js +73 -61
  25. package/tinymce-assets/plugins/code/plugin.min.js +0 -3
  26. package/tinymce-assets/plugins/codesample/plugin.js +3593 -2402
  27. package/tinymce-assets/plugins/codesample/plugin.min.js +8 -3
  28. package/tinymce-assets/plugins/directionality/plugin.js +545 -304
  29. package/tinymce-assets/plugins/directionality/plugin.min.js +1 -4
  30. package/tinymce-assets/plugins/emoticons/js/emojiimages.min.js +0 -2
  31. package/tinymce-assets/plugins/emoticons/js/emojis.min.js +0 -1
  32. package/tinymce-assets/plugins/emoticons/plugin.js +702 -488
  33. package/tinymce-assets/plugins/emoticons/plugin.min.js +1 -4
  34. package/tinymce-assets/plugins/fullscreen/plugin.js +1409 -1049
  35. package/tinymce-assets/plugins/fullscreen/plugin.min.js +1 -4
  36. package/tinymce-assets/plugins/help/js/i18n/keynav/ar.js +4 -1
  37. package/tinymce-assets/plugins/help/js/i18n/keynav/bg_BG.js +4 -1
  38. package/tinymce-assets/plugins/help/js/i18n/keynav/ca.js +4 -1
  39. package/tinymce-assets/plugins/help/js/i18n/keynav/cs.js +4 -1
  40. package/tinymce-assets/plugins/help/js/i18n/keynav/da.js +4 -1
  41. package/tinymce-assets/plugins/help/js/i18n/keynav/de.js +4 -1
  42. package/tinymce-assets/plugins/help/js/i18n/keynav/el.js +4 -1
  43. package/tinymce-assets/plugins/help/js/i18n/keynav/en.js +4 -1
  44. package/tinymce-assets/plugins/help/js/i18n/keynav/es.js +4 -1
  45. package/tinymce-assets/plugins/help/js/i18n/keynav/eu.js +4 -1
  46. package/tinymce-assets/plugins/help/js/i18n/keynav/fa.js +4 -1
  47. package/tinymce-assets/plugins/help/js/i18n/keynav/fi.js +4 -1
  48. package/tinymce-assets/plugins/help/js/i18n/keynav/fr_FR.js +4 -1
  49. package/tinymce-assets/plugins/help/js/i18n/keynav/he_IL.js +4 -1
  50. package/tinymce-assets/plugins/help/js/i18n/keynav/hi.js +4 -1
  51. package/tinymce-assets/plugins/help/js/i18n/keynav/hr.js +4 -1
  52. package/tinymce-assets/plugins/help/js/i18n/keynav/hu_HU.js +4 -1
  53. package/tinymce-assets/plugins/help/js/i18n/keynav/id.js +4 -1
  54. package/tinymce-assets/plugins/help/js/i18n/keynav/it.js +4 -1
  55. package/tinymce-assets/plugins/help/js/i18n/keynav/ja.js +4 -1
  56. package/tinymce-assets/plugins/help/js/i18n/keynav/kk.js +4 -1
  57. package/tinymce-assets/plugins/help/js/i18n/keynav/ko_KR.js +4 -1
  58. package/tinymce-assets/plugins/help/js/i18n/keynav/ms.js +4 -1
  59. package/tinymce-assets/plugins/help/js/i18n/keynav/nb_NO.js +4 -1
  60. package/tinymce-assets/plugins/help/js/i18n/keynav/nl.js +4 -1
  61. package/tinymce-assets/plugins/help/js/i18n/keynav/pl.js +4 -1
  62. package/tinymce-assets/plugins/help/js/i18n/keynav/pt_BR.js +4 -1
  63. package/tinymce-assets/plugins/help/js/i18n/keynav/pt_PT.js +4 -1
  64. package/tinymce-assets/plugins/help/js/i18n/keynav/ro.js +4 -1
  65. package/tinymce-assets/plugins/help/js/i18n/keynav/ru.js +4 -1
  66. package/tinymce-assets/plugins/help/js/i18n/keynav/sk.js +4 -1
  67. package/tinymce-assets/plugins/help/js/i18n/keynav/sl_SI.js +5 -2
  68. package/tinymce-assets/plugins/help/js/i18n/keynav/sv_SE.js +4 -1
  69. package/tinymce-assets/plugins/help/js/i18n/keynav/th_TH.js +4 -1
  70. package/tinymce-assets/plugins/help/js/i18n/keynav/tr.js +4 -1
  71. package/tinymce-assets/plugins/help/js/i18n/keynav/uk.js +4 -1
  72. package/tinymce-assets/plugins/help/js/i18n/keynav/vi.js +4 -1
  73. package/tinymce-assets/plugins/help/js/i18n/keynav/zh_CN.js +8 -5
  74. package/tinymce-assets/plugins/help/js/i18n/keynav/zh_TW.js +4 -1
  75. package/tinymce-assets/plugins/help/plugin.js +739 -809
  76. package/tinymce-assets/plugins/help/plugin.min.js +1 -4
  77. package/tinymce-assets/plugins/image/plugin.js +1475 -1291
  78. package/tinymce-assets/plugins/image/plugin.min.js +1 -4
  79. package/tinymce-assets/plugins/importcss/plugin.js +328 -269
  80. package/tinymce-assets/plugins/importcss/plugin.min.js +1 -4
  81. package/tinymce-assets/plugins/insertdatetime/plugin.js +140 -141
  82. package/tinymce-assets/plugins/insertdatetime/plugin.min.js +1 -4
  83. package/tinymce-assets/plugins/link/plugin.js +1419 -1084
  84. package/tinymce-assets/plugins/link/plugin.min.js +1 -4
  85. package/tinymce-assets/plugins/lists/plugin.js +2177 -1805
  86. package/tinymce-assets/plugins/lists/plugin.min.js +1 -4
  87. package/tinymce-assets/plugins/media/plugin.js +1305 -1047
  88. package/tinymce-assets/plugins/media/plugin.min.js +1 -4
  89. package/tinymce-assets/plugins/nonbreaking/plugin.js +93 -88
  90. package/tinymce-assets/plugins/nonbreaking/plugin.min.js +0 -3
  91. package/tinymce-assets/plugins/pagebreak/plugin.js +91 -85
  92. package/tinymce-assets/plugins/pagebreak/plugin.min.js +0 -3
  93. package/tinymce-assets/plugins/preview/plugin.js +742 -74
  94. package/tinymce-assets/plugins/preview/plugin.min.js +1 -4
  95. package/tinymce-assets/plugins/quickbars/plugin.js +582 -375
  96. package/tinymce-assets/plugins/quickbars/plugin.min.js +1 -4
  97. package/tinymce-assets/plugins/save/plugin.js +100 -82
  98. package/tinymce-assets/plugins/save/plugin.min.js +1 -4
  99. package/tinymce-assets/plugins/searchreplace/plugin.js +1183 -906
  100. package/tinymce-assets/plugins/searchreplace/plugin.min.js +1 -4
  101. package/tinymce-assets/plugins/table/plugin.js +3651 -3094
  102. package/tinymce-assets/plugins/table/plugin.min.js +1 -4
  103. package/tinymce-assets/plugins/visualblocks/plugin.js +71 -63
  104. package/tinymce-assets/plugins/visualblocks/plugin.min.js +1 -4
  105. package/tinymce-assets/plugins/visualchars/plugin.js +685 -436
  106. package/tinymce-assets/plugins/visualchars/plugin.min.js +1 -4
  107. package/tinymce-assets/plugins/wordcount/plugin.js +382 -307
  108. package/tinymce-assets/plugins/wordcount/plugin.min.js +1 -4
  109. package/tinymce-assets/skins/content/dark/content.css +9 -0
  110. package/tinymce-assets/skins/content/dark/content.js +10 -2
  111. package/tinymce-assets/skins/content/dark/content.min.css +9 -0
  112. package/tinymce-assets/skins/content/default/content.css +9 -0
  113. package/tinymce-assets/skins/content/default/content.js +10 -2
  114. package/tinymce-assets/skins/content/default/content.min.css +9 -0
  115. package/tinymce-assets/skins/content/document/content.css +9 -0
  116. package/tinymce-assets/skins/content/document/content.js +10 -2
  117. package/tinymce-assets/skins/content/document/content.min.css +9 -0
  118. package/tinymce-assets/skins/content/tinymce-5/content.css +9 -0
  119. package/tinymce-assets/skins/content/tinymce-5/content.js +10 -2
  120. package/tinymce-assets/skins/content/tinymce-5/content.min.css +9 -0
  121. package/tinymce-assets/skins/content/tinymce-5-dark/content.css +9 -0
  122. package/tinymce-assets/skins/content/tinymce-5-dark/content.js +10 -2
  123. package/tinymce-assets/skins/content/tinymce-5-dark/content.min.css +9 -0
  124. package/tinymce-assets/skins/content/writer/content.css +9 -0
  125. package/tinymce-assets/skins/content/writer/content.js +10 -2
  126. package/tinymce-assets/skins/content/writer/content.min.css +9 -0
  127. package/tinymce-assets/skins/ui/oxide/content.css +157 -49
  128. package/tinymce-assets/skins/ui/oxide/content.inline.css +157 -49
  129. package/tinymce-assets/skins/ui/oxide/content.inline.js +10 -2
  130. package/tinymce-assets/skins/ui/oxide/content.inline.min.css +10 -1
  131. package/tinymce-assets/skins/ui/oxide/content.js +10 -2
  132. package/tinymce-assets/skins/ui/oxide/content.min.css +10 -1
  133. package/tinymce-assets/skins/ui/oxide/skin.css +1592 -214
  134. package/tinymce-assets/skins/ui/oxide/skin.js +1 -2
  135. package/tinymce-assets/skins/ui/oxide/skin.min.css +1 -1
  136. package/tinymce-assets/skins/ui/oxide/skin.shadowdom.js +1 -2
  137. package/tinymce-assets/skins/ui/oxide-dark/content.css +157 -42
  138. package/tinymce-assets/skins/ui/oxide-dark/content.inline.css +157 -49
  139. package/tinymce-assets/skins/ui/oxide-dark/content.inline.js +10 -2
  140. package/tinymce-assets/skins/ui/oxide-dark/content.inline.min.css +10 -1
  141. package/tinymce-assets/skins/ui/oxide-dark/content.js +10 -2
  142. package/tinymce-assets/skins/ui/oxide-dark/content.min.css +10 -1
  143. package/tinymce-assets/skins/ui/oxide-dark/skin.css +1595 -217
  144. package/tinymce-assets/skins/ui/oxide-dark/skin.js +1 -2
  145. package/tinymce-assets/skins/ui/oxide-dark/skin.min.css +1 -1
  146. package/tinymce-assets/skins/ui/oxide-dark/skin.shadowdom.js +1 -2
  147. package/tinymce-assets/skins/ui/tinymce-5/content.css +157 -49
  148. package/tinymce-assets/skins/ui/tinymce-5/content.inline.css +157 -49
  149. package/tinymce-assets/skins/ui/tinymce-5/content.inline.js +10 -2
  150. package/tinymce-assets/skins/ui/tinymce-5/content.inline.min.css +10 -1
  151. package/tinymce-assets/skins/ui/tinymce-5/content.js +10 -2
  152. package/tinymce-assets/skins/ui/tinymce-5/content.min.css +10 -1
  153. package/tinymce-assets/skins/ui/tinymce-5/skin.css +1606 -203
  154. package/tinymce-assets/skins/ui/tinymce-5/skin.js +1 -2
  155. package/tinymce-assets/skins/ui/tinymce-5/skin.min.css +1 -1
  156. package/tinymce-assets/skins/ui/tinymce-5/skin.shadowdom.js +1 -2
  157. package/tinymce-assets/skins/ui/tinymce-5-dark/content.css +157 -42
  158. package/tinymce-assets/skins/ui/tinymce-5-dark/content.inline.css +157 -49
  159. package/tinymce-assets/skins/ui/tinymce-5-dark/content.inline.js +10 -2
  160. package/tinymce-assets/skins/ui/tinymce-5-dark/content.inline.min.css +10 -1
  161. package/tinymce-assets/skins/ui/tinymce-5-dark/content.js +10 -2
  162. package/tinymce-assets/skins/ui/tinymce-5-dark/content.min.css +10 -1
  163. package/tinymce-assets/skins/ui/tinymce-5-dark/skin.css +1607 -204
  164. package/tinymce-assets/skins/ui/tinymce-5-dark/skin.js +1 -2
  165. package/tinymce-assets/skins/ui/tinymce-5-dark/skin.min.css +1 -1
  166. package/tinymce-assets/skins/ui/tinymce-5-dark/skin.shadowdom.js +1 -2
  167. package/tinymce-assets/themes/silver/theme.js +32786 -28738
  168. package/tinymce-assets/themes/silver/theme.min.js +1 -4
  169. package/types/dangl-angular-material-shared-tiny-mce.d.ts +13 -13
  170. package/types/dangl-angular-material-shared.d.ts +26 -26
  171. package/tinymce-assets/plugins/template/index.js +0 -7
  172. package/tinymce-assets/plugins/template/plugin.js +0 -567
  173. package/tinymce-assets/plugins/template/plugin.min.js +0 -4
@@ -1,5 +1,5 @@
1
1
  /**
2
- * TinyMCE version 6.8.3 (2024-02-08)
2
+ * TinyMCE version 7.9.3 (2026-05-19)
3
3
  */
4
4
 
5
5
  (function () {
@@ -7,28 +7,34 @@
7
7
 
8
8
  var global$4 = tinymce.util.Tools.resolve('tinymce.PluginManager');
9
9
 
10
+ /* eslint-disable @typescript-eslint/no-wrapper-object-types */
10
11
  const hasProto = (v, constructor, predicate) => {
11
- var _a;
12
- if (predicate(v, constructor.prototype)) {
13
- return true;
14
- } else {
15
- return ((_a = v.constructor) === null || _a === void 0 ? void 0 : _a.name) === constructor.name;
16
- }
17
- };
18
- const typeOf = x => {
19
- const t = typeof x;
20
- if (x === null) {
21
- return 'null';
22
- } else if (t === 'object' && Array.isArray(x)) {
23
- return 'array';
24
- } else if (t === 'object' && hasProto(x, String, (o, proto) => proto.isPrototypeOf(o))) {
25
- return 'string';
26
- } else {
27
- return t;
28
- }
29
- };
30
- const isType = type => value => typeOf(value) === type;
31
- const eq = t => a => t === a;
12
+ var _a;
13
+ if (predicate(v, constructor.prototype)) {
14
+ return true;
15
+ }
16
+ else {
17
+ // String-based fallback time
18
+ return ((_a = v.constructor) === null || _a === void 0 ? void 0 : _a.name) === constructor.name;
19
+ }
20
+ };
21
+ const typeOf = (x) => {
22
+ const t = typeof x;
23
+ if (x === null) {
24
+ return 'null';
25
+ }
26
+ else if (t === 'object' && Array.isArray(x)) {
27
+ return 'array';
28
+ }
29
+ else if (t === 'object' && hasProto(x, String, (o, proto) => proto.isPrototypeOf(o))) {
30
+ return 'string';
31
+ }
32
+ else {
33
+ return t;
34
+ }
35
+ };
36
+ const isType = (type) => (value) => typeOf(value) === type;
37
+ const eq = (t) => (a) => t === a;
32
38
  const isString = isType('string');
33
39
  const isUndefined = eq(undefined);
34
40
 
@@ -38,196 +44,209 @@
38
44
 
39
45
  var global$1 = tinymce.util.Tools.resolve('tinymce.util.Tools');
40
46
 
41
- const fireRestoreDraft = editor => editor.dispatch('RestoreDraft');
42
- const fireStoreDraft = editor => editor.dispatch('StoreDraft');
43
- const fireRemoveDraft = editor => editor.dispatch('RemoveDraft');
44
-
45
- const parse = timeString => {
46
- const multiples = {
47
- s: 1000,
48
- m: 60000
49
- };
50
- const parsedTime = /^(\d+)([ms]?)$/.exec(timeString);
51
- return (parsedTime && parsedTime[2] ? multiples[parsedTime[2]] : 1) * parseInt(timeString, 10);
52
- };
53
-
54
- const option = name => editor => editor.options.get(name);
55
- const register$1 = editor => {
56
- const registerOption = editor.options.register;
57
- const timeProcessor = value => {
58
- const valid = isString(value);
59
- if (valid) {
60
- return {
61
- value: parse(value),
62
- valid
63
- };
64
- } else {
65
- return {
66
- valid: false,
67
- message: 'Must be a string.'
68
- };
69
- }
70
- };
71
- registerOption('autosave_ask_before_unload', {
72
- processor: 'boolean',
73
- default: true
74
- });
75
- registerOption('autosave_prefix', {
76
- processor: 'string',
77
- default: 'tinymce-autosave-{path}{query}{hash}-{id}-'
78
- });
79
- registerOption('autosave_restore_when_empty', {
80
- processor: 'boolean',
81
- default: false
82
- });
83
- registerOption('autosave_interval', {
84
- processor: timeProcessor,
85
- default: '30s'
86
- });
87
- registerOption('autosave_retention', {
88
- processor: timeProcessor,
89
- default: '20m'
90
- });
47
+ const fireRestoreDraft = (editor) => editor.dispatch('RestoreDraft');
48
+ const fireStoreDraft = (editor) => editor.dispatch('StoreDraft');
49
+ const fireRemoveDraft = (editor) => editor.dispatch('RemoveDraft');
50
+
51
+ const parse = (timeString) => {
52
+ const multiples = {
53
+ s: 1000,
54
+ m: 60000
55
+ };
56
+ const parsedTime = /^(\d+)([ms]?)$/.exec(timeString);
57
+ return (parsedTime && parsedTime[2] ? multiples[parsedTime[2]] : 1) * parseInt(timeString, 10);
58
+ };
59
+
60
+ const option = (name) => (editor) => editor.options.get(name);
61
+ const register$1 = (editor) => {
62
+ const registerOption = editor.options.register;
63
+ const timeProcessor = (value) => {
64
+ const valid = isString(value);
65
+ if (valid) {
66
+ return { value: parse(value), valid };
67
+ }
68
+ else {
69
+ return { valid: false, message: 'Must be a string.' };
70
+ }
71
+ };
72
+ registerOption('autosave_ask_before_unload', {
73
+ processor: 'boolean',
74
+ default: true
75
+ });
76
+ registerOption('autosave_prefix', {
77
+ processor: 'string',
78
+ default: 'tinymce-autosave-{path}{query}{hash}-{id}-'
79
+ });
80
+ registerOption('autosave_restore_when_empty', {
81
+ processor: 'boolean',
82
+ default: false
83
+ });
84
+ registerOption('autosave_interval', {
85
+ processor: timeProcessor,
86
+ default: '30s'
87
+ });
88
+ registerOption('autosave_retention', {
89
+ processor: timeProcessor,
90
+ default: '20m'
91
+ });
91
92
  };
92
93
  const shouldAskBeforeUnload = option('autosave_ask_before_unload');
93
94
  const shouldRestoreWhenEmpty = option('autosave_restore_when_empty');
94
95
  const getAutoSaveInterval = option('autosave_interval');
95
96
  const getAutoSaveRetention = option('autosave_retention');
96
- const getAutoSavePrefix = editor => {
97
- const location = document.location;
98
- return editor.options.get('autosave_prefix').replace(/{path}/g, location.pathname).replace(/{query}/g, location.search).replace(/{hash}/g, location.hash).replace(/{id}/g, editor.id);
97
+ const getAutoSavePrefix = (editor) => {
98
+ const location = document.location;
99
+ return editor.options.get('autosave_prefix').replace(/{path}/g, location.pathname)
100
+ .replace(/{query}/g, location.search)
101
+ .replace(/{hash}/g, location.hash)
102
+ .replace(/{id}/g, editor.id);
99
103
  };
100
104
 
101
105
  const isEmpty = (editor, html) => {
102
- if (isUndefined(html)) {
103
- return editor.dom.isEmpty(editor.getBody());
104
- } else {
105
- const trimmedHtml = global$1.trim(html);
106
- if (trimmedHtml === '') {
107
- return true;
108
- } else {
109
- const fragment = new DOMParser().parseFromString(trimmedHtml, 'text/html');
110
- return editor.dom.isEmpty(fragment);
106
+ if (isUndefined(html)) {
107
+ return editor.dom.isEmpty(editor.getBody());
108
+ }
109
+ else {
110
+ const trimmedHtml = global$1.trim(html);
111
+ if (trimmedHtml === '') {
112
+ return true;
113
+ }
114
+ else {
115
+ const fragment = new DOMParser().parseFromString(trimmedHtml, 'text/html');
116
+ return editor.dom.isEmpty(fragment);
117
+ }
111
118
  }
112
- }
113
119
  };
114
- const hasDraft = editor => {
115
- var _a;
116
- const time = parseInt((_a = global$2.getItem(getAutoSavePrefix(editor) + 'time')) !== null && _a !== void 0 ? _a : '0', 10) || 0;
117
- if (new Date().getTime() - time > getAutoSaveRetention(editor)) {
118
- removeDraft(editor, false);
119
- return false;
120
- }
121
- return true;
120
+ const hasDraft = (editor) => {
121
+ var _a;
122
+ const time = parseInt((_a = global$2.getItem(getAutoSavePrefix(editor) + 'time')) !== null && _a !== void 0 ? _a : '0', 10) || 0;
123
+ if (new Date().getTime() - time > getAutoSaveRetention(editor)) {
124
+ removeDraft(editor, false);
125
+ return false;
126
+ }
127
+ return true;
122
128
  };
123
129
  const removeDraft = (editor, fire) => {
124
- const prefix = getAutoSavePrefix(editor);
125
- global$2.removeItem(prefix + 'draft');
126
- global$2.removeItem(prefix + 'time');
127
- if (fire !== false) {
128
- fireRemoveDraft(editor);
129
- }
130
- };
131
- const storeDraft = editor => {
132
- const prefix = getAutoSavePrefix(editor);
133
- if (!isEmpty(editor) && editor.isDirty()) {
134
- global$2.setItem(prefix + 'draft', editor.getContent({
135
- format: 'raw',
136
- no_events: true
137
- }));
138
- global$2.setItem(prefix + 'time', new Date().getTime().toString());
139
- fireStoreDraft(editor);
140
- }
141
- };
142
- const restoreDraft = editor => {
143
- var _a;
144
- const prefix = getAutoSavePrefix(editor);
145
- if (hasDraft(editor)) {
146
- editor.setContent((_a = global$2.getItem(prefix + 'draft')) !== null && _a !== void 0 ? _a : '', { format: 'raw' });
147
- fireRestoreDraft(editor);
148
- }
149
- };
150
- const startStoreDraft = editor => {
151
- const interval = getAutoSaveInterval(editor);
152
- global$3.setEditorInterval(editor, () => {
153
- storeDraft(editor);
154
- }, interval);
155
- };
156
- const restoreLastDraft = editor => {
157
- editor.undoManager.transact(() => {
158
- restoreDraft(editor);
159
- removeDraft(editor);
160
- });
161
- editor.focus();
162
- };
163
-
164
- const get = editor => ({
165
- hasDraft: () => hasDraft(editor),
166
- storeDraft: () => storeDraft(editor),
167
- restoreDraft: () => restoreDraft(editor),
168
- removeDraft: fire => removeDraft(editor, fire),
169
- isEmpty: html => isEmpty(editor, html)
130
+ const prefix = getAutoSavePrefix(editor);
131
+ global$2.removeItem(prefix + 'draft');
132
+ global$2.removeItem(prefix + 'time');
133
+ if (fire !== false) {
134
+ fireRemoveDraft(editor);
135
+ }
136
+ };
137
+ const storeDraft = (editor) => {
138
+ const prefix = getAutoSavePrefix(editor);
139
+ if (!isEmpty(editor) && editor.isDirty()) {
140
+ global$2.setItem(prefix + 'draft', editor.getContent({ format: 'raw', no_events: true }));
141
+ global$2.setItem(prefix + 'time', new Date().getTime().toString());
142
+ fireStoreDraft(editor);
143
+ }
144
+ };
145
+ const restoreDraft = (editor) => {
146
+ var _a;
147
+ const prefix = getAutoSavePrefix(editor);
148
+ if (hasDraft(editor)) {
149
+ editor.setContent((_a = global$2.getItem(prefix + 'draft')) !== null && _a !== void 0 ? _a : '', { format: 'raw' });
150
+ fireRestoreDraft(editor);
151
+ }
152
+ };
153
+ const startStoreDraft = (editor) => {
154
+ const interval = getAutoSaveInterval(editor);
155
+ global$3.setEditorInterval(editor, () => {
156
+ storeDraft(editor);
157
+ }, interval);
158
+ };
159
+ const restoreLastDraft = (editor) => {
160
+ editor.undoManager.transact(() => {
161
+ restoreDraft(editor);
162
+ removeDraft(editor);
163
+ });
164
+ editor.focus();
165
+ };
166
+
167
+ const get = (editor) => ({
168
+ hasDraft: () => hasDraft(editor),
169
+ storeDraft: () => storeDraft(editor),
170
+ restoreDraft: () => restoreDraft(editor),
171
+ removeDraft: (fire) => removeDraft(editor, fire),
172
+ isEmpty: (html) => isEmpty(editor, html)
170
173
  });
171
174
 
172
175
  var global = tinymce.util.Tools.resolve('tinymce.EditorManager');
173
176
 
174
- const setup = editor => {
175
- editor.editorManager.on('BeforeUnload', e => {
176
- let msg;
177
- global$1.each(global.get(), editor => {
178
- if (editor.plugins.autosave) {
179
- editor.plugins.autosave.storeDraft();
180
- }
181
- if (!msg && editor.isDirty() && shouldAskBeforeUnload(editor)) {
182
- msg = editor.translate('You have unsaved changes are you sure you want to navigate away?');
183
- }
177
+ const setup = (editor) => {
178
+ editor.editorManager.on('BeforeUnload', (e) => {
179
+ let msg;
180
+ global$1.each(global.get(), (editor) => {
181
+ // Store a draft for each editor instance
182
+ if (editor.plugins.autosave) {
183
+ editor.plugins.autosave.storeDraft();
184
+ }
185
+ // Setup a return message if the editor is dirty
186
+ if (!msg && editor.isDirty() && shouldAskBeforeUnload(editor)) {
187
+ msg = editor.translate('You have unsaved changes are you sure you want to navigate away?');
188
+ }
189
+ });
190
+ if (msg) {
191
+ e.preventDefault();
192
+ e.returnValue = msg;
193
+ }
194
+ });
195
+ };
196
+
197
+ const makeSetupHandler = (editor) => (api) => {
198
+ const shouldEnable = () => hasDraft(editor) && !editor.mode.isReadOnly();
199
+ api.setEnabled(shouldEnable());
200
+ const editorEventCallback = () => api.setEnabled(shouldEnable());
201
+ editor.on('StoreDraft RestoreDraft RemoveDraft', editorEventCallback);
202
+ return () => editor.off('StoreDraft RestoreDraft RemoveDraft', editorEventCallback);
203
+ };
204
+ const register = (editor) => {
205
+ // TODO: This was moved from makeSetupHandler as it would only be called when the menu item was rendered?
206
+ // Is it safe to start this process when the plugin is registered?
207
+ startStoreDraft(editor);
208
+ const onAction = () => {
209
+ restoreLastDraft(editor);
210
+ };
211
+ editor.ui.registry.addButton('restoredraft', {
212
+ tooltip: 'Restore last draft',
213
+ icon: 'restore-draft',
214
+ onAction,
215
+ onSetup: makeSetupHandler(editor)
216
+ });
217
+ editor.ui.registry.addMenuItem('restoredraft', {
218
+ text: 'Restore last draft',
219
+ icon: 'restore-draft',
220
+ onAction,
221
+ onSetup: makeSetupHandler(editor)
184
222
  });
185
- if (msg) {
186
- e.preventDefault();
187
- e.returnValue = msg;
188
- }
189
- });
190
- };
191
-
192
- const makeSetupHandler = editor => api => {
193
- api.setEnabled(hasDraft(editor));
194
- const editorEventCallback = () => api.setEnabled(hasDraft(editor));
195
- editor.on('StoreDraft RestoreDraft RemoveDraft', editorEventCallback);
196
- return () => editor.off('StoreDraft RestoreDraft RemoveDraft', editorEventCallback);
197
- };
198
- const register = editor => {
199
- startStoreDraft(editor);
200
- const onAction = () => {
201
- restoreLastDraft(editor);
202
- };
203
- editor.ui.registry.addButton('restoredraft', {
204
- tooltip: 'Restore last draft',
205
- icon: 'restore-draft',
206
- onAction,
207
- onSetup: makeSetupHandler(editor)
208
- });
209
- editor.ui.registry.addMenuItem('restoredraft', {
210
- text: 'Restore last draft',
211
- icon: 'restore-draft',
212
- onAction,
213
- onSetup: makeSetupHandler(editor)
214
- });
215
223
  };
216
224
 
225
+ /**
226
+ * This class contains all core logic for the autosave plugin.
227
+ *
228
+ * @class tinymce.autosave.Plugin
229
+ * @private
230
+ */
217
231
  var Plugin = () => {
218
- global$4.add('autosave', editor => {
219
- register$1(editor);
220
- setup(editor);
221
- register(editor);
222
- editor.on('init', () => {
223
- if (shouldRestoreWhenEmpty(editor) && editor.dom.isEmpty(editor.getBody())) {
224
- restoreDraft(editor);
225
- }
232
+ global$4.add('autosave', (editor) => {
233
+ register$1(editor);
234
+ setup(editor);
235
+ register(editor);
236
+ editor.on('init', () => {
237
+ if (shouldRestoreWhenEmpty(editor) && editor.dom.isEmpty(editor.getBody())) {
238
+ restoreDraft(editor);
239
+ }
240
+ });
241
+ return get(editor);
226
242
  });
227
- return get(editor);
228
- });
229
243
  };
230
244
 
231
245
  Plugin();
246
+ /** *****
247
+ * DO NOT EXPORT ANYTHING
248
+ *
249
+ * IF YOU DO ROLLUP WILL LEAVE A GLOBAL ON THE PAGE
250
+ *******/
232
251
 
233
252
  })();
@@ -1,4 +1 @@
1
- /**
2
- * TinyMCE version 6.8.3 (2024-02-08)
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&&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))))}();
1
+ !function(){"use strict";var t=tinymce.util.Tools.resolve("tinymce.PluginManager");const e=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=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)},y=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))},g=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=>{const r=()=>f(t)&&!t.mode.isReadOnly();e.setEnabled(r());const o=()=>e.setEnabled(r());return t.on("StoreDraft RestoreDraft RemoveDraft",o),()=>t.off("StoreDraft RestoreDraft RemoveDraft",o)};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,(()=>{y(t)}),e)})(t);const e=()=>{(t=>{t.undoManager.transact((()=>{g(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())&&g(t)})),(t=>({hasDraft:()=>f(t),storeDraft:()=>y(t),restoreDraft:()=>g(t),removeDraft:e=>p(t,e),isEmpty:e=>v(t,e)}))(t))))}();