@dangl/angular-material-shared 2.9.0-beta0047 → 2.9.0-beta0048

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 (165) hide show
  1. package/package.json +1 -1
  2. package/tinymce-assets/icons/default/icons.js +9 -46
  3. package/tinymce-assets/icons/default/icons.min.js +1 -1
  4. package/tinymce-assets/models/dom/model.js +7239 -8193
  5. package/tinymce-assets/models/dom/model.min.js +1 -1
  6. package/tinymce-assets/plugins/accordion/plugin.js +879 -1174
  7. package/tinymce-assets/plugins/accordion/plugin.min.js +5 -1
  8. package/tinymce-assets/plugins/advlist/plugin.js +200 -412
  9. package/tinymce-assets/plugins/advlist/plugin.min.js +5 -1
  10. package/tinymce-assets/plugins/anchor/plugin.js +166 -189
  11. package/tinymce-assets/plugins/anchor/plugin.min.js +5 -1
  12. package/tinymce-assets/plugins/autolink/plugin.js +220 -310
  13. package/tinymce-assets/plugins/autolink/plugin.min.js +5 -1
  14. package/tinymce-assets/plugins/autoresize/plugin.js +149 -180
  15. package/tinymce-assets/plugins/autoresize/plugin.min.js +5 -1
  16. package/tinymce-assets/plugins/autosave/plugin.js +189 -208
  17. package/tinymce-assets/plugins/autosave/plugin.min.js +5 -1
  18. package/tinymce-assets/plugins/charmap/plugin.js +1566 -905
  19. package/tinymce-assets/plugins/charmap/plugin.min.js +5 -1
  20. package/tinymce-assets/plugins/code/plugin.js +61 -73
  21. package/tinymce-assets/plugins/code/plugin.min.js +4 -0
  22. package/tinymce-assets/plugins/codesample/plugin.js +2409 -3592
  23. package/tinymce-assets/plugins/codesample/plugin.min.js +12 -8
  24. package/tinymce-assets/plugins/directionality/plugin.js +304 -545
  25. package/tinymce-assets/plugins/directionality/plugin.min.js +5 -1
  26. package/tinymce-assets/plugins/emoticons/plugin.js +488 -702
  27. package/tinymce-assets/plugins/emoticons/plugin.min.js +5 -1
  28. package/tinymce-assets/plugins/fullscreen/plugin.js +1049 -1409
  29. package/tinymce-assets/plugins/fullscreen/plugin.min.js +5 -1
  30. package/tinymce-assets/plugins/help/js/i18n/keynav/ar.js +1 -4
  31. package/tinymce-assets/plugins/help/js/i18n/keynav/bg_BG.js +1 -4
  32. package/tinymce-assets/plugins/help/js/i18n/keynav/ca.js +1 -4
  33. package/tinymce-assets/plugins/help/js/i18n/keynav/cs.js +1 -4
  34. package/tinymce-assets/plugins/help/js/i18n/keynav/da.js +1 -4
  35. package/tinymce-assets/plugins/help/js/i18n/keynav/de.js +1 -4
  36. package/tinymce-assets/plugins/help/js/i18n/keynav/el.js +1 -4
  37. package/tinymce-assets/plugins/help/js/i18n/keynav/en.js +1 -4
  38. package/tinymce-assets/plugins/help/js/i18n/keynav/es.js +1 -4
  39. package/tinymce-assets/plugins/help/js/i18n/keynav/eu.js +1 -4
  40. package/tinymce-assets/plugins/help/js/i18n/keynav/fa.js +1 -4
  41. package/tinymce-assets/plugins/help/js/i18n/keynav/fi.js +1 -4
  42. package/tinymce-assets/plugins/help/js/i18n/keynav/fr_FR.js +1 -4
  43. package/tinymce-assets/plugins/help/js/i18n/keynav/he_IL.js +1 -4
  44. package/tinymce-assets/plugins/help/js/i18n/keynav/hi.js +1 -4
  45. package/tinymce-assets/plugins/help/js/i18n/keynav/hr.js +1 -4
  46. package/tinymce-assets/plugins/help/js/i18n/keynav/hu_HU.js +1 -4
  47. package/tinymce-assets/plugins/help/js/i18n/keynav/id.js +1 -4
  48. package/tinymce-assets/plugins/help/js/i18n/keynav/it.js +1 -4
  49. package/tinymce-assets/plugins/help/js/i18n/keynav/ja.js +1 -4
  50. package/tinymce-assets/plugins/help/js/i18n/keynav/kk.js +1 -4
  51. package/tinymce-assets/plugins/help/js/i18n/keynav/ko_KR.js +1 -4
  52. package/tinymce-assets/plugins/help/js/i18n/keynav/ms.js +1 -4
  53. package/tinymce-assets/plugins/help/js/i18n/keynav/nb_NO.js +1 -4
  54. package/tinymce-assets/plugins/help/js/i18n/keynav/nl.js +1 -4
  55. package/tinymce-assets/plugins/help/js/i18n/keynav/pl.js +1 -4
  56. package/tinymce-assets/plugins/help/js/i18n/keynav/pt_BR.js +1 -4
  57. package/tinymce-assets/plugins/help/js/i18n/keynav/pt_PT.js +1 -4
  58. package/tinymce-assets/plugins/help/js/i18n/keynav/ro.js +1 -4
  59. package/tinymce-assets/plugins/help/js/i18n/keynav/ru.js +1 -4
  60. package/tinymce-assets/plugins/help/js/i18n/keynav/sk.js +1 -4
  61. package/tinymce-assets/plugins/help/js/i18n/keynav/sl_SI.js +2 -5
  62. package/tinymce-assets/plugins/help/js/i18n/keynav/sv_SE.js +1 -4
  63. package/tinymce-assets/plugins/help/js/i18n/keynav/th_TH.js +1 -4
  64. package/tinymce-assets/plugins/help/js/i18n/keynav/tr.js +1 -4
  65. package/tinymce-assets/plugins/help/js/i18n/keynav/uk.js +1 -4
  66. package/tinymce-assets/plugins/help/js/i18n/keynav/vi.js +1 -4
  67. package/tinymce-assets/plugins/help/js/i18n/keynav/zh_CN.js +5 -8
  68. package/tinymce-assets/plugins/help/js/i18n/keynav/zh_TW.js +1 -4
  69. package/tinymce-assets/plugins/help/plugin.js +809 -739
  70. package/tinymce-assets/plugins/help/plugin.min.js +5 -1
  71. package/tinymce-assets/plugins/image/plugin.js +1291 -1475
  72. package/tinymce-assets/plugins/image/plugin.min.js +5 -1
  73. package/tinymce-assets/plugins/importcss/plugin.js +269 -328
  74. package/tinymce-assets/plugins/importcss/plugin.min.js +5 -1
  75. package/tinymce-assets/plugins/insertdatetime/plugin.js +141 -140
  76. package/tinymce-assets/plugins/insertdatetime/plugin.min.js +5 -1
  77. package/tinymce-assets/plugins/link/plugin.js +1084 -1419
  78. package/tinymce-assets/plugins/link/plugin.min.js +5 -1
  79. package/tinymce-assets/plugins/lists/plugin.js +1805 -2177
  80. package/tinymce-assets/plugins/lists/plugin.min.js +5 -1
  81. package/tinymce-assets/plugins/media/plugin.js +1047 -1305
  82. package/tinymce-assets/plugins/media/plugin.min.js +5 -1
  83. package/tinymce-assets/plugins/nonbreaking/plugin.js +88 -93
  84. package/tinymce-assets/plugins/nonbreaking/plugin.min.js +4 -0
  85. package/tinymce-assets/plugins/pagebreak/plugin.js +85 -91
  86. package/tinymce-assets/plugins/pagebreak/plugin.min.js +4 -0
  87. package/tinymce-assets/plugins/preview/plugin.js +74 -742
  88. package/tinymce-assets/plugins/preview/plugin.min.js +5 -1
  89. package/tinymce-assets/plugins/quickbars/plugin.js +375 -582
  90. package/tinymce-assets/plugins/quickbars/plugin.min.js +5 -1
  91. package/tinymce-assets/plugins/save/plugin.js +82 -100
  92. package/tinymce-assets/plugins/save/plugin.min.js +5 -1
  93. package/tinymce-assets/plugins/searchreplace/plugin.js +906 -1183
  94. package/tinymce-assets/plugins/searchreplace/plugin.min.js +5 -1
  95. package/tinymce-assets/plugins/table/plugin.js +3094 -3651
  96. package/tinymce-assets/plugins/table/plugin.min.js +5 -1
  97. package/tinymce-assets/plugins/template/index.js +7 -0
  98. package/tinymce-assets/plugins/template/plugin.js +567 -0
  99. package/tinymce-assets/plugins/template/plugin.min.js +5 -0
  100. package/tinymce-assets/plugins/visualblocks/plugin.js +63 -71
  101. package/tinymce-assets/plugins/visualblocks/plugin.min.js +5 -1
  102. package/tinymce-assets/plugins/visualchars/plugin.js +436 -685
  103. package/tinymce-assets/plugins/visualchars/plugin.min.js +5 -1
  104. package/tinymce-assets/plugins/wordcount/plugin.js +307 -382
  105. package/tinymce-assets/plugins/wordcount/plugin.min.js +5 -1
  106. package/tinymce-assets/skins/content/dark/content.css +4 -0
  107. package/tinymce-assets/skins/content/dark/content.js +6 -1
  108. package/tinymce-assets/skins/content/dark/content.min.css +4 -0
  109. package/tinymce-assets/skins/content/default/content.css +4 -0
  110. package/tinymce-assets/skins/content/default/content.js +6 -1
  111. package/tinymce-assets/skins/content/default/content.min.css +4 -0
  112. package/tinymce-assets/skins/content/document/content.css +4 -0
  113. package/tinymce-assets/skins/content/document/content.js +6 -1
  114. package/tinymce-assets/skins/content/document/content.min.css +4 -0
  115. package/tinymce-assets/skins/content/tinymce-5/content.css +4 -0
  116. package/tinymce-assets/skins/content/tinymce-5/content.js +6 -1
  117. package/tinymce-assets/skins/content/tinymce-5/content.min.css +4 -0
  118. package/tinymce-assets/skins/content/tinymce-5-dark/content.css +4 -0
  119. package/tinymce-assets/skins/content/tinymce-5-dark/content.js +6 -1
  120. package/tinymce-assets/skins/content/tinymce-5-dark/content.min.css +4 -0
  121. package/tinymce-assets/skins/content/writer/content.css +4 -0
  122. package/tinymce-assets/skins/content/writer/content.js +6 -1
  123. package/tinymce-assets/skins/content/writer/content.min.css +4 -0
  124. package/tinymce-assets/skins/ui/oxide/content.css +53 -148
  125. package/tinymce-assets/skins/ui/oxide/content.inline.css +53 -148
  126. package/tinymce-assets/skins/ui/oxide/content.inline.js +6 -1
  127. package/tinymce-assets/skins/ui/oxide/content.inline.min.css +5 -1
  128. package/tinymce-assets/skins/ui/oxide/content.js +6 -1
  129. package/tinymce-assets/skins/ui/oxide/content.min.css +5 -1
  130. package/tinymce-assets/skins/ui/oxide/skin.css +207 -1585
  131. package/tinymce-assets/skins/ui/oxide/skin.js +2 -1
  132. package/tinymce-assets/skins/ui/oxide/skin.min.css +1 -1
  133. package/tinymce-assets/skins/ui/oxide/skin.shadowdom.js +2 -1
  134. package/tinymce-assets/skins/ui/oxide-dark/content.css +46 -148
  135. package/tinymce-assets/skins/ui/oxide-dark/content.inline.css +53 -148
  136. package/tinymce-assets/skins/ui/oxide-dark/content.inline.js +6 -1
  137. package/tinymce-assets/skins/ui/oxide-dark/content.inline.min.css +5 -1
  138. package/tinymce-assets/skins/ui/oxide-dark/content.js +6 -1
  139. package/tinymce-assets/skins/ui/oxide-dark/content.min.css +5 -1
  140. package/tinymce-assets/skins/ui/oxide-dark/skin.css +219 -1597
  141. package/tinymce-assets/skins/ui/oxide-dark/skin.js +2 -1
  142. package/tinymce-assets/skins/ui/oxide-dark/skin.min.css +1 -1
  143. package/tinymce-assets/skins/ui/oxide-dark/skin.shadowdom.js +2 -1
  144. package/tinymce-assets/skins/ui/tinymce-5/content.css +53 -148
  145. package/tinymce-assets/skins/ui/tinymce-5/content.inline.css +53 -148
  146. package/tinymce-assets/skins/ui/tinymce-5/content.inline.js +6 -1
  147. package/tinymce-assets/skins/ui/tinymce-5/content.inline.min.css +5 -1
  148. package/tinymce-assets/skins/ui/tinymce-5/content.js +6 -1
  149. package/tinymce-assets/skins/ui/tinymce-5/content.min.css +5 -1
  150. package/tinymce-assets/skins/ui/tinymce-5/skin.css +194 -1597
  151. package/tinymce-assets/skins/ui/tinymce-5/skin.js +2 -1
  152. package/tinymce-assets/skins/ui/tinymce-5/skin.min.css +1 -1
  153. package/tinymce-assets/skins/ui/tinymce-5/skin.shadowdom.js +2 -1
  154. package/tinymce-assets/skins/ui/tinymce-5-dark/content.css +46 -148
  155. package/tinymce-assets/skins/ui/tinymce-5-dark/content.inline.css +53 -148
  156. package/tinymce-assets/skins/ui/tinymce-5-dark/content.inline.js +6 -1
  157. package/tinymce-assets/skins/ui/tinymce-5-dark/content.inline.min.css +5 -1
  158. package/tinymce-assets/skins/ui/tinymce-5-dark/content.js +6 -1
  159. package/tinymce-assets/skins/ui/tinymce-5-dark/content.min.css +5 -1
  160. package/tinymce-assets/skins/ui/tinymce-5-dark/skin.css +202 -1605
  161. package/tinymce-assets/skins/ui/tinymce-5-dark/skin.js +2 -1
  162. package/tinymce-assets/skins/ui/tinymce-5-dark/skin.min.css +1 -1
  163. package/tinymce-assets/skins/ui/tinymce-5-dark/skin.shadowdom.js +2 -1
  164. package/tinymce-assets/themes/silver/theme.js +28439 -32466
  165. package/tinymce-assets/themes/silver/theme.min.js +1 -1
@@ -1,5 +1,5 @@
1
1
  /**
2
- * TinyMCE version 7.9.3 (2026-05-19)
2
+ * TinyMCE version 6.8.6 (TBD)
3
3
  */
4
4
 
5
5
  (function () {
@@ -7,34 +7,28 @@
7
7
 
8
8
  var global$4 = tinymce.util.Tools.resolve('tinymce.PluginManager');
9
9
 
10
- /* eslint-disable @typescript-eslint/no-wrapper-object-types */
11
10
  const hasProto = (v, constructor, predicate) => {
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;
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;
38
32
  const isString = isType('string');
39
33
  const isUndefined = eq(undefined);
40
34
 
@@ -44,209 +38,196 @@
44
38
 
45
39
  var global$1 = tinymce.util.Tools.resolve('tinymce.util.Tools');
46
40
 
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
- });
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
+ });
92
91
  };
93
92
  const shouldAskBeforeUnload = option('autosave_ask_before_unload');
94
93
  const shouldRestoreWhenEmpty = option('autosave_restore_when_empty');
95
94
  const getAutoSaveInterval = option('autosave_interval');
96
95
  const getAutoSaveRetention = option('autosave_retention');
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);
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);
103
99
  };
104
100
 
105
101
  const isEmpty = (editor, html) => {
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
- }
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);
118
111
  }
112
+ }
119
113
  };
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;
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;
128
122
  };
129
123
  const removeDraft = (editor, fire) => {
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)
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)
173
170
  });
174
171
 
175
172
  var global = tinymce.util.Tools.resolve('tinymce.EditorManager');
176
173
 
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)
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
+ }
222
184
  });
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
+ });
223
215
  };
224
216
 
225
- /**
226
- * This class contains all core logic for the autosave plugin.
227
- *
228
- * @class tinymce.autosave.Plugin
229
- * @private
230
- */
231
217
  var Plugin = () => {
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);
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
+ }
242
226
  });
227
+ return get(editor);
228
+ });
243
229
  };
244
230
 
245
231
  Plugin();
246
- /** *****
247
- * DO NOT EXPORT ANYTHING
248
- *
249
- * IF YOU DO ROLLUP WILL LEAVE A GLOBAL ON THE PAGE
250
- *******/
251
232
 
252
233
  })();
@@ -1 +1,5 @@
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))))}();
1
+ /**
2
+ * TinyMCE version 6.8.6 (TBD)
3
+ */
4
+
5
+ !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))))}();