@dangl/angular-material-shared 2.5.1-beta0012 → 2.6.0-beta0019
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.
- package/README.md +1 -7
- package/esm2022/lib/angular-material-shared.module.mjs +2 -2
- package/esm2022/lib/components/tiny-mce/tiny-mce.component.mjs +16 -19
- package/fesm2022/dangl-angular-material-shared.mjs +16 -19
- package/fesm2022/dangl-angular-material-shared.mjs.map +1 -1
- package/lib/components/tiny-mce/tiny-mce.component.d.ts +7 -8
- package/package.json +1 -1
- package/tinymce-assets/icons/default/icons.js +187 -171
- package/tinymce-assets/icons/default/icons.min.js +1 -1
- package/tinymce-assets/langs/it.js +1 -1
- package/tinymce-assets/plugins/accordion/index.js +7 -0
- package/tinymce-assets/plugins/accordion/plugin.js +1054 -0
- package/tinymce-assets/plugins/accordion/plugin.min.js +4 -0
- package/tinymce-assets/plugins/advlist/plugin.js +185 -187
- package/tinymce-assets/plugins/advlist/plugin.min.js +2 -7
- package/tinymce-assets/plugins/anchor/plugin.js +79 -81
- package/tinymce-assets/plugins/anchor/plugin.min.js +2 -7
- package/tinymce-assets/plugins/autolink/plugin.js +209 -194
- package/tinymce-assets/plugins/autolink/plugin.min.js +2 -7
- package/tinymce-assets/plugins/autoresize/plugin.js +110 -102
- package/tinymce-assets/plugins/autoresize/plugin.min.js +2 -7
- package/tinymce-assets/plugins/autosave/plugin.js +125 -104
- package/tinymce-assets/plugins/autosave/plugin.min.js +2 -7
- package/tinymce-assets/plugins/charmap/plugin.js +275 -313
- package/tinymce-assets/plugins/charmap/plugin.min.js +2 -7
- package/tinymce-assets/plugins/code/plugin.js +18 -24
- package/tinymce-assets/plugins/code/plugin.min.js +2 -7
- package/tinymce-assets/plugins/codesample/plugin.js +2075 -2074
- package/tinymce-assets/plugins/codesample/plugin.min.js +2 -7
- package/tinymce-assets/plugins/directionality/plugin.js +247 -305
- package/tinymce-assets/plugins/directionality/plugin.min.js +2 -7
- package/tinymce-assets/plugins/emoticons/js/emojiimages.js +1 -9424
- package/tinymce-assets/plugins/emoticons/js/emojiimages.min.js +1 -1
- package/tinymce-assets/plugins/emoticons/js/emojis.js +1 -9423
- package/tinymce-assets/plugins/emoticons/js/emojis.min.js +1 -1
- package/tinymce-assets/plugins/emoticons/plugin.js +334 -374
- package/tinymce-assets/plugins/emoticons/plugin.min.js +2 -7
- package/tinymce-assets/plugins/fullscreen/plugin.js +740 -837
- package/tinymce-assets/plugins/fullscreen/plugin.min.js +2 -7
- package/tinymce-assets/plugins/help/js/i18n/keynav/ar.js +90 -0
- package/tinymce-assets/plugins/help/js/i18n/keynav/bg_BG.js +90 -0
- package/tinymce-assets/plugins/help/js/i18n/keynav/ca.js +90 -0
- package/tinymce-assets/plugins/help/js/i18n/keynav/cs.js +90 -0
- package/tinymce-assets/plugins/help/js/i18n/keynav/da.js +90 -0
- package/tinymce-assets/plugins/help/js/i18n/keynav/de.js +90 -0
- package/tinymce-assets/plugins/help/js/i18n/keynav/el.js +90 -0
- package/tinymce-assets/plugins/help/js/i18n/keynav/en.js +90 -0
- package/tinymce-assets/plugins/help/js/i18n/keynav/es.js +90 -0
- package/tinymce-assets/plugins/help/js/i18n/keynav/eu.js +90 -0
- package/tinymce-assets/plugins/help/js/i18n/keynav/fa.js +90 -0
- package/tinymce-assets/plugins/help/js/i18n/keynav/fi.js +90 -0
- package/tinymce-assets/plugins/help/js/i18n/keynav/fr_FR.js +90 -0
- package/tinymce-assets/plugins/help/js/i18n/keynav/he_IL.js +90 -0
- package/tinymce-assets/plugins/help/js/i18n/keynav/hi.js +90 -0
- package/tinymce-assets/plugins/help/js/i18n/keynav/hr.js +90 -0
- package/tinymce-assets/plugins/help/js/i18n/keynav/hu_HU.js +90 -0
- package/tinymce-assets/plugins/help/js/i18n/keynav/id.js +90 -0
- package/tinymce-assets/plugins/help/js/i18n/keynav/it.js +90 -0
- package/tinymce-assets/plugins/help/js/i18n/keynav/ja.js +90 -0
- package/tinymce-assets/plugins/help/js/i18n/keynav/kk.js +90 -0
- package/tinymce-assets/plugins/help/js/i18n/keynav/ko_KR.js +90 -0
- package/tinymce-assets/plugins/help/js/i18n/keynav/ms.js +90 -0
- package/tinymce-assets/plugins/help/js/i18n/keynav/nb_NO.js +90 -0
- package/tinymce-assets/plugins/help/js/i18n/keynav/nl.js +90 -0
- package/tinymce-assets/plugins/help/js/i18n/keynav/pl.js +90 -0
- package/tinymce-assets/plugins/help/js/i18n/keynav/pt_BR.js +90 -0
- package/tinymce-assets/plugins/help/js/i18n/keynav/pt_PT.js +90 -0
- package/tinymce-assets/plugins/help/js/i18n/keynav/ro.js +90 -0
- package/tinymce-assets/plugins/help/js/i18n/keynav/ru.js +90 -0
- package/tinymce-assets/plugins/help/js/i18n/keynav/sk.js +90 -0
- package/tinymce-assets/plugins/help/js/i18n/keynav/sl_SI.js +90 -0
- package/tinymce-assets/plugins/help/js/i18n/keynav/sv_SE.js +90 -0
- package/tinymce-assets/plugins/help/js/i18n/keynav/th_TH.js +90 -0
- package/tinymce-assets/plugins/help/js/i18n/keynav/tr.js +90 -0
- package/tinymce-assets/plugins/help/js/i18n/keynav/uk.js +90 -0
- package/tinymce-assets/plugins/help/js/i18n/keynav/vi.js +90 -0
- package/tinymce-assets/plugins/help/js/i18n/keynav/zh_CN.js +84 -0
- package/tinymce-assets/plugins/help/js/i18n/keynav/zh_TW.js +90 -0
- package/tinymce-assets/plugins/help/plugin.js +411 -355
- package/tinymce-assets/plugins/help/plugin.min.js +2 -7
- package/tinymce-assets/plugins/image/plugin.js +876 -1037
- package/tinymce-assets/plugins/image/plugin.min.js +2 -7
- package/tinymce-assets/plugins/importcss/plugin.js +146 -144
- package/tinymce-assets/plugins/importcss/plugin.min.js +2 -7
- package/tinymce-assets/plugins/insertdatetime/plugin.js +93 -88
- package/tinymce-assets/plugins/insertdatetime/plugin.min.js +2 -7
- package/tinymce-assets/plugins/link/plugin.js +718 -768
- package/tinymce-assets/plugins/link/plugin.min.js +2 -7
- package/tinymce-assets/plugins/lists/plugin.js +1235 -1375
- package/tinymce-assets/plugins/lists/plugin.min.js +2 -7
- package/tinymce-assets/plugins/media/plugin.js +614 -756
- package/tinymce-assets/plugins/media/plugin.min.js +2 -7
- package/tinymce-assets/plugins/nonbreaking/plugin.js +71 -48
- package/tinymce-assets/plugins/nonbreaking/plugin.min.js +2 -7
- package/tinymce-assets/plugins/pagebreak/plugin.js +53 -40
- package/tinymce-assets/plugins/pagebreak/plugin.min.js +2 -7
- package/tinymce-assets/plugins/preview/plugin.js +36 -65
- package/tinymce-assets/plugins/preview/plugin.min.js +2 -7
- package/tinymce-assets/plugins/quickbars/plugin.js +304 -331
- package/tinymce-assets/plugins/quickbars/plugin.min.js +2 -7
- package/tinymce-assets/plugins/save/plugin.js +49 -50
- package/tinymce-assets/plugins/save/plugin.min.js +2 -7
- package/tinymce-assets/plugins/searchreplace/plugin.js +499 -571
- package/tinymce-assets/plugins/searchreplace/plugin.min.js +2 -7
- package/tinymce-assets/plugins/table/plugin.js +2572 -10617
- package/tinymce-assets/plugins/table/plugin.min.js +2 -7
- package/tinymce-assets/plugins/visualblocks/plugin.js +41 -46
- package/tinymce-assets/plugins/visualblocks/plugin.min.js +2 -7
- package/tinymce-assets/plugins/visualchars/plugin.js +346 -312
- package/tinymce-assets/plugins/visualchars/plugin.min.js +2 -7
- package/tinymce-assets/plugins/wordcount/plugin.js +159 -179
- package/tinymce-assets/plugins/wordcount/plugin.min.js +2 -7
- package/tinymce-assets/skins/content/dark/content.css +2 -8
- package/tinymce-assets/skins/content/dark/content.js +2 -0
- package/tinymce-assets/skins/content/dark/content.min.css +1 -7
- package/tinymce-assets/skins/content/default/content.css +0 -6
- package/tinymce-assets/skins/content/default/content.js +2 -0
- package/tinymce-assets/skins/content/default/content.min.css +0 -6
- package/tinymce-assets/skins/content/document/content.css +0 -6
- package/tinymce-assets/skins/content/document/content.js +2 -0
- package/tinymce-assets/skins/content/document/content.min.css +0 -6
- package/tinymce-assets/skins/content/tinymce-5/content.css +61 -0
- package/tinymce-assets/skins/content/tinymce-5/content.js +2 -0
- package/tinymce-assets/skins/content/tinymce-5/content.min.css +1 -0
- package/tinymce-assets/skins/content/tinymce-5-dark/content.css +66 -0
- package/tinymce-assets/skins/content/tinymce-5-dark/content.js +2 -0
- package/tinymce-assets/skins/content/tinymce-5-dark/content.min.css +1 -0
- package/tinymce-assets/skins/content/writer/content.css +0 -6
- package/tinymce-assets/skins/content/writer/content.js +2 -0
- package/tinymce-assets/skins/content/writer/content.min.css +0 -6
- package/tinymce-assets/skins/ui/oxide/content.css +73 -20
- package/tinymce-assets/skins/ui/oxide/content.inline.css +73 -20
- package/tinymce-assets/skins/ui/oxide/content.inline.js +2 -0
- package/tinymce-assets/skins/ui/oxide/content.inline.min.css +1 -7
- package/tinymce-assets/skins/ui/oxide/content.js +2 -0
- package/tinymce-assets/skins/ui/oxide/content.min.css +1 -7
- package/tinymce-assets/skins/ui/oxide/skin.css +1480 -435
- package/tinymce-assets/skins/ui/oxide/skin.js +2 -0
- package/tinymce-assets/skins/ui/oxide/skin.min.css +1 -7
- package/tinymce-assets/skins/ui/oxide/skin.shadowdom.css +1 -8
- package/tinymce-assets/skins/ui/oxide/skin.shadowdom.js +2 -0
- package/tinymce-assets/skins/ui/oxide/skin.shadowdom.min.css +1 -7
- package/tinymce-assets/skins/ui/oxide-dark/content.css +71 -19
- package/tinymce-assets/skins/ui/oxide-dark/content.inline.css +73 -20
- package/tinymce-assets/skins/ui/oxide-dark/content.inline.js +2 -0
- package/tinymce-assets/skins/ui/oxide-dark/content.inline.min.css +1 -7
- package/tinymce-assets/skins/ui/oxide-dark/content.js +2 -0
- package/tinymce-assets/skins/ui/oxide-dark/content.min.css +1 -7
- package/tinymce-assets/skins/ui/oxide-dark/skin.css +1498 -450
- package/tinymce-assets/skins/ui/oxide-dark/skin.js +2 -0
- package/tinymce-assets/skins/ui/oxide-dark/skin.min.css +1 -7
- package/tinymce-assets/skins/ui/oxide-dark/skin.shadowdom.css +1 -8
- package/tinymce-assets/skins/ui/oxide-dark/skin.shadowdom.js +2 -0
- package/tinymce-assets/skins/ui/oxide-dark/skin.shadowdom.min.css +1 -7
- package/tinymce-assets/skins/ui/tinymce-5/content.css +785 -0
- package/tinymce-assets/skins/ui/tinymce-5/content.inline.css +779 -0
- package/tinymce-assets/skins/ui/tinymce-5/content.inline.js +2 -0
- package/tinymce-assets/skins/ui/tinymce-5/content.inline.min.css +1 -0
- package/tinymce-assets/skins/ui/tinymce-5/content.js +2 -0
- package/tinymce-assets/skins/ui/tinymce-5/content.min.css +1 -0
- package/tinymce-assets/skins/ui/tinymce-5/skin.css +4185 -0
- package/tinymce-assets/skins/ui/tinymce-5/skin.js +2 -0
- package/tinymce-assets/skins/ui/tinymce-5/skin.min.css +1 -0
- package/tinymce-assets/skins/ui/tinymce-5/skin.shadowdom.css +30 -0
- package/tinymce-assets/skins/ui/tinymce-5/skin.shadowdom.js +2 -0
- package/tinymce-assets/skins/ui/tinymce-5/skin.shadowdom.min.css +1 -0
- package/tinymce-assets/skins/ui/tinymce-5-dark/content.css +766 -0
- package/tinymce-assets/skins/ui/tinymce-5-dark/content.inline.css +779 -0
- package/tinymce-assets/skins/ui/tinymce-5-dark/content.inline.js +2 -0
- package/tinymce-assets/skins/ui/tinymce-5-dark/content.inline.min.css +1 -0
- package/tinymce-assets/skins/ui/tinymce-5-dark/content.js +2 -0
- package/tinymce-assets/skins/ui/tinymce-5-dark/content.min.css +1 -0
- package/tinymce-assets/skins/ui/tinymce-5-dark/skin.css +4185 -0
- package/tinymce-assets/skins/ui/tinymce-5-dark/skin.js +2 -0
- package/tinymce-assets/skins/ui/tinymce-5-dark/skin.min.css +1 -0
- package/tinymce-assets/skins/ui/tinymce-5-dark/skin.shadowdom.css +30 -0
- package/tinymce-assets/skins/ui/tinymce-5-dark/skin.shadowdom.js +2 -0
- package/tinymce-assets/skins/ui/tinymce-5-dark/skin.shadowdom.min.css +1 -0
- package/tinymce-assets/themes/silver/theme.js +25226 -28188
- package/tinymce-assets/themes/silver/theme.min.js +2 -7
- package/tinymce-assets/plugins/bbcode/index.js +0 -7
- package/tinymce-assets/plugins/bbcode/plugin.js +0 -99
- package/tinymce-assets/plugins/bbcode/plugin.min.js +0 -9
- package/tinymce-assets/plugins/colorpicker/index.js +0 -7
- package/tinymce-assets/plugins/colorpicker/plugin.js +0 -21
- package/tinymce-assets/plugins/colorpicker/plugin.min.js +0 -9
- package/tinymce-assets/plugins/contextmenu/index.js +0 -7
- package/tinymce-assets/plugins/contextmenu/plugin.js +0 -21
- package/tinymce-assets/plugins/contextmenu/plugin.min.js +0 -9
- package/tinymce-assets/plugins/fullpage/index.js +0 -7
- package/tinymce-assets/plugins/fullpage/plugin.js +0 -544
- package/tinymce-assets/plugins/fullpage/plugin.min.js +0 -9
- package/tinymce-assets/plugins/hr/index.js +0 -7
- package/tinymce-assets/plugins/hr/plugin.js +0 -45
- package/tinymce-assets/plugins/hr/plugin.min.js +0 -9
- package/tinymce-assets/plugins/imagetools/index.js +0 -7
- package/tinymce-assets/plugins/imagetools/plugin.js +0 -1531
- package/tinymce-assets/plugins/imagetools/plugin.min.js +0 -9
- package/tinymce-assets/plugins/legacyoutput/index.js +0 -7
- package/tinymce-assets/plugins/legacyoutput/plugin.js +0 -199
- package/tinymce-assets/plugins/legacyoutput/plugin.min.js +0 -9
- package/tinymce-assets/plugins/noneditable/index.js +0 -7
- package/tinymce-assets/plugins/noneditable/plugin.js +0 -117
- package/tinymce-assets/plugins/noneditable/plugin.min.js +0 -9
- package/tinymce-assets/plugins/paste/index.js +0 -7
- package/tinymce-assets/plugins/paste/plugin.js +0 -1803
- package/tinymce-assets/plugins/paste/plugin.min.js +0 -9
- package/tinymce-assets/plugins/print/index.js +0 -7
- package/tinymce-assets/plugins/print/plugin.js +0 -52
- package/tinymce-assets/plugins/print/plugin.min.js +0 -9
- package/tinymce-assets/plugins/spellchecker/index.js +0 -7
- package/tinymce-assets/plugins/spellchecker/plugin.js +0 -730
- package/tinymce-assets/plugins/spellchecker/plugin.min.js +0 -9
- package/tinymce-assets/plugins/tabfocus/index.js +0 -7
- package/tinymce-assets/plugins/tabfocus/plugin.js +0 -130
- package/tinymce-assets/plugins/tabfocus/plugin.min.js +0 -9
- package/tinymce-assets/plugins/template/index.js +0 -7
- package/tinymce-assets/plugins/template/plugin.js +0 -591
- package/tinymce-assets/plugins/template/plugin.min.js +0 -9
- package/tinymce-assets/plugins/textcolor/index.js +0 -7
- package/tinymce-assets/plugins/textcolor/plugin.js +0 -21
- package/tinymce-assets/plugins/textcolor/plugin.min.js +0 -9
- package/tinymce-assets/plugins/textpattern/index.js +0 -7
- package/tinymce-assets/plugins/textpattern/plugin.js +0 -1374
- package/tinymce-assets/plugins/textpattern/plugin.min.js +0 -9
- package/tinymce-assets/plugins/toc/index.js +0 -7
- package/tinymce-assets/plugins/toc/plugin.js +0 -238
- package/tinymce-assets/plugins/toc/plugin.min.js +0 -9
- package/tinymce-assets/skins/ui/oxide/content.mobile.css +0 -29
- package/tinymce-assets/skins/ui/oxide/content.mobile.min.css +0 -7
- package/tinymce-assets/skins/ui/oxide/fonts/tinymce-mobile.woff +0 -0
- package/tinymce-assets/skins/ui/oxide/skin.mobile.css +0 -673
- package/tinymce-assets/skins/ui/oxide/skin.mobile.min.css +0 -7
- package/tinymce-assets/skins/ui/oxide-dark/content.mobile.css +0 -29
- package/tinymce-assets/skins/ui/oxide-dark/content.mobile.min.css +0 -7
- package/tinymce-assets/skins/ui/oxide-dark/fonts/tinymce-mobile.woff +0 -0
- package/tinymce-assets/skins/ui/oxide-dark/skin.mobile.css +0 -673
- package/tinymce-assets/skins/ui/oxide-dark/skin.mobile.min.css +0 -7
- package/tinymce-assets/themes/mobile/index.js +0 -7
- package/tinymce-assets/themes/mobile/theme.js +0 -13130
- package/tinymce-assets/themes/mobile/theme.min.js +0 -9
|
@@ -1,74 +1,56 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
* Licensed under the LGPL or a commercial license.
|
|
4
|
-
* For LGPL see License.txt in the project root for license information.
|
|
5
|
-
* For commercial licenses see https://www.tiny.cloud/
|
|
6
|
-
*
|
|
7
|
-
* Version: 5.10.9 (2023-11-15)
|
|
2
|
+
* TinyMCE version 7.0.1 (2024-04-10)
|
|
8
3
|
*/
|
|
4
|
+
|
|
9
5
|
(function () {
|
|
10
6
|
'use strict';
|
|
11
7
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
8
|
+
const Cell = initial => {
|
|
9
|
+
let value = initial;
|
|
10
|
+
const get = () => {
|
|
15
11
|
return value;
|
|
16
12
|
};
|
|
17
|
-
|
|
13
|
+
const set = v => {
|
|
18
14
|
value = v;
|
|
19
15
|
};
|
|
20
16
|
return {
|
|
21
|
-
get
|
|
22
|
-
set
|
|
17
|
+
get,
|
|
18
|
+
set
|
|
23
19
|
};
|
|
24
20
|
};
|
|
25
21
|
|
|
26
|
-
var
|
|
27
|
-
var has = function (obj, key) {
|
|
28
|
-
return hasOwnProperty.call(obj, key);
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
var global$2 = tinymce.util.Tools.resolve('tinymce.PluginManager');
|
|
22
|
+
var global$1 = tinymce.util.Tools.resolve('tinymce.PluginManager');
|
|
32
23
|
|
|
33
|
-
|
|
24
|
+
const constant = value => {
|
|
25
|
+
return () => {
|
|
26
|
+
return value;
|
|
27
|
+
};
|
|
28
|
+
};
|
|
34
29
|
|
|
35
|
-
var global = tinymce.util.Tools.resolve('tinymce.
|
|
30
|
+
var global = tinymce.util.Tools.resolve('tinymce.Env');
|
|
36
31
|
|
|
37
|
-
|
|
38
|
-
return editor.fire('ResizeEditor');
|
|
39
|
-
};
|
|
32
|
+
const fireResizeEditor = editor => editor.dispatch('ResizeEditor');
|
|
40
33
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
};
|
|
53
|
-
var shouldAutoResizeOnInit = function (editor) {
|
|
54
|
-
return editor.getParam('autoresize_on_init', true, 'boolean');
|
|
34
|
+
const option = name => editor => editor.options.get(name);
|
|
35
|
+
const register$1 = editor => {
|
|
36
|
+
const registerOption = editor.options.register;
|
|
37
|
+
registerOption('autoresize_overflow_padding', {
|
|
38
|
+
processor: 'number',
|
|
39
|
+
default: 1
|
|
40
|
+
});
|
|
41
|
+
registerOption('autoresize_bottom_margin', {
|
|
42
|
+
processor: 'number',
|
|
43
|
+
default: 50
|
|
44
|
+
});
|
|
55
45
|
};
|
|
46
|
+
const getMinHeight = option('min_height');
|
|
47
|
+
const getMaxHeight = option('max_height');
|
|
48
|
+
const getAutoResizeOverflowPadding = option('autoresize_overflow_padding');
|
|
49
|
+
const getAutoResizeBottomMargin = option('autoresize_bottom_margin');
|
|
56
50
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
var wait = function (editor, oldSize, times, interval, callback) {
|
|
61
|
-
global.setEditorTimeout(editor, function () {
|
|
62
|
-
resize(editor, oldSize);
|
|
63
|
-
if (times--) {
|
|
64
|
-
wait(editor, oldSize, times, interval, callback);
|
|
65
|
-
} else if (callback) {
|
|
66
|
-
callback();
|
|
67
|
-
}
|
|
68
|
-
}, interval);
|
|
69
|
-
};
|
|
70
|
-
var toggleScrolling = function (editor, state) {
|
|
71
|
-
var body = editor.getBody();
|
|
51
|
+
const isFullscreen = editor => editor.plugins.fullscreen && editor.plugins.fullscreen.isFullscreen();
|
|
52
|
+
const toggleScrolling = (editor, state) => {
|
|
53
|
+
const body = editor.getBody();
|
|
72
54
|
if (body) {
|
|
73
55
|
body.style.overflowY = state ? '' : 'hidden';
|
|
74
56
|
if (!state) {
|
|
@@ -76,21 +58,23 @@
|
|
|
76
58
|
}
|
|
77
59
|
}
|
|
78
60
|
};
|
|
79
|
-
|
|
80
|
-
var
|
|
61
|
+
const parseCssValueToInt = (dom, elm, name, computed) => {
|
|
62
|
+
var _a;
|
|
63
|
+
const value = parseInt((_a = dom.getStyle(elm, name, computed)) !== null && _a !== void 0 ? _a : '', 10);
|
|
81
64
|
return isNaN(value) ? 0 : value;
|
|
82
65
|
};
|
|
83
|
-
|
|
66
|
+
const shouldScrollIntoView = trigger => {
|
|
84
67
|
if ((trigger === null || trigger === void 0 ? void 0 : trigger.type.toLowerCase()) === 'setcontent') {
|
|
85
|
-
|
|
68
|
+
const setContentEvent = trigger;
|
|
86
69
|
return setContentEvent.selection === true || setContentEvent.paste === true;
|
|
87
70
|
} else {
|
|
88
71
|
return false;
|
|
89
72
|
}
|
|
90
73
|
};
|
|
91
|
-
|
|
92
|
-
var
|
|
93
|
-
|
|
74
|
+
const resize = (editor, oldSize, trigger, getExtraMarginBottom) => {
|
|
75
|
+
var _a;
|
|
76
|
+
const dom = editor.dom;
|
|
77
|
+
const doc = editor.getDoc();
|
|
94
78
|
if (!doc) {
|
|
95
79
|
return;
|
|
96
80
|
}
|
|
@@ -98,22 +82,23 @@
|
|
|
98
82
|
toggleScrolling(editor, true);
|
|
99
83
|
return;
|
|
100
84
|
}
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
85
|
+
const docEle = doc.documentElement;
|
|
86
|
+
const resizeBottomMargin = getExtraMarginBottom ? getExtraMarginBottom() : getAutoResizeOverflowPadding(editor);
|
|
87
|
+
const minHeight = (_a = getMinHeight(editor)) !== null && _a !== void 0 ? _a : editor.getElement().offsetHeight;
|
|
88
|
+
let resizeHeight = minHeight;
|
|
89
|
+
const marginTop = parseCssValueToInt(dom, docEle, 'margin-top', true);
|
|
90
|
+
const marginBottom = parseCssValueToInt(dom, docEle, 'margin-bottom', true);
|
|
91
|
+
let contentHeight = docEle.offsetHeight + marginTop + marginBottom + resizeBottomMargin;
|
|
107
92
|
if (contentHeight < 0) {
|
|
108
93
|
contentHeight = 0;
|
|
109
94
|
}
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
if (contentHeight + chromeHeight >
|
|
95
|
+
const containerHeight = editor.getContainer().offsetHeight;
|
|
96
|
+
const contentAreaHeight = editor.getContentAreaContainer().offsetHeight;
|
|
97
|
+
const chromeHeight = containerHeight - contentAreaHeight;
|
|
98
|
+
if (contentHeight + chromeHeight > minHeight) {
|
|
114
99
|
resizeHeight = contentHeight + chromeHeight;
|
|
115
100
|
}
|
|
116
|
-
|
|
101
|
+
const maxHeight = getMaxHeight(editor);
|
|
117
102
|
if (maxHeight && resizeHeight > maxHeight) {
|
|
118
103
|
resizeHeight = maxHeight;
|
|
119
104
|
toggleScrolling(editor, true);
|
|
@@ -121,64 +106,87 @@
|
|
|
121
106
|
toggleScrolling(editor, false);
|
|
122
107
|
}
|
|
123
108
|
if (resizeHeight !== oldSize.get()) {
|
|
124
|
-
|
|
109
|
+
const deltaSize = resizeHeight - oldSize.get();
|
|
125
110
|
dom.setStyle(editor.getContainer(), 'height', resizeHeight + 'px');
|
|
126
111
|
oldSize.set(resizeHeight);
|
|
127
112
|
fireResizeEditor(editor);
|
|
128
|
-
if (global
|
|
129
|
-
|
|
113
|
+
if (global.browser.isSafari() && (global.os.isMacOS() || global.os.isiOS())) {
|
|
114
|
+
const win = editor.getWin();
|
|
130
115
|
win.scrollTo(win.pageXOffset, win.pageYOffset);
|
|
131
116
|
}
|
|
132
117
|
if (editor.hasFocus() && shouldScrollIntoView(trigger)) {
|
|
133
118
|
editor.selection.scrollIntoView();
|
|
134
119
|
}
|
|
135
|
-
if (global
|
|
136
|
-
resize(editor, oldSize, trigger);
|
|
120
|
+
if ((global.browser.isSafari() || global.browser.isChromium()) && deltaSize < 0) {
|
|
121
|
+
resize(editor, oldSize, trigger, getExtraMarginBottom);
|
|
137
122
|
}
|
|
138
123
|
}
|
|
139
124
|
};
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
125
|
+
const setup = (editor, oldSize) => {
|
|
126
|
+
let getExtraMarginBottom = () => getAutoResizeBottomMargin(editor);
|
|
127
|
+
let resizeCounter;
|
|
128
|
+
let sizeAfterFirstResize;
|
|
129
|
+
editor.on('init', e => {
|
|
130
|
+
resizeCounter = 0;
|
|
131
|
+
const overflowPadding = getAutoResizeOverflowPadding(editor);
|
|
132
|
+
const dom = editor.dom;
|
|
144
133
|
dom.setStyles(editor.getDoc().documentElement, { height: 'auto' });
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
134
|
+
if (global.browser.isEdge() || global.browser.isIE()) {
|
|
135
|
+
dom.setStyles(editor.getBody(), {
|
|
136
|
+
'paddingLeft': overflowPadding,
|
|
137
|
+
'paddingRight': overflowPadding,
|
|
138
|
+
'min-height': 0
|
|
139
|
+
});
|
|
140
|
+
} else {
|
|
141
|
+
dom.setStyles(editor.getBody(), {
|
|
142
|
+
paddingLeft: overflowPadding,
|
|
143
|
+
paddingRight: overflowPadding
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
resize(editor, oldSize, e, getExtraMarginBottom);
|
|
147
|
+
resizeCounter += 1;
|
|
150
148
|
});
|
|
151
|
-
editor.on('NodeChange SetContent keyup FullscreenStateChanged ResizeContent',
|
|
152
|
-
|
|
149
|
+
editor.on('NodeChange SetContent keyup FullscreenStateChanged ResizeContent', e => {
|
|
150
|
+
if (resizeCounter === 1) {
|
|
151
|
+
sizeAfterFirstResize = editor.getContainer().offsetHeight;
|
|
152
|
+
resize(editor, oldSize, e, getExtraMarginBottom);
|
|
153
|
+
resizeCounter += 1;
|
|
154
|
+
} else if (resizeCounter === 2) {
|
|
155
|
+
const isLooping = sizeAfterFirstResize < editor.getContainer().offsetHeight;
|
|
156
|
+
if (isLooping) {
|
|
157
|
+
const dom = editor.dom;
|
|
158
|
+
const doc = editor.getDoc();
|
|
159
|
+
dom.setStyles(doc.documentElement, { 'min-height': 0 });
|
|
160
|
+
dom.setStyles(editor.getBody(), { 'min-height': 'inherit' });
|
|
161
|
+
}
|
|
162
|
+
getExtraMarginBottom = isLooping ? constant(0) : getExtraMarginBottom;
|
|
163
|
+
resizeCounter += 1;
|
|
164
|
+
} else {
|
|
165
|
+
resize(editor, oldSize, e, getExtraMarginBottom);
|
|
166
|
+
}
|
|
153
167
|
});
|
|
154
|
-
if (shouldAutoResizeOnInit(editor)) {
|
|
155
|
-
editor.on('init', function () {
|
|
156
|
-
wait(editor, oldSize, 20, 100, function () {
|
|
157
|
-
wait(editor, oldSize, 5, 1000);
|
|
158
|
-
});
|
|
159
|
-
});
|
|
160
|
-
}
|
|
161
168
|
};
|
|
162
169
|
|
|
163
|
-
|
|
164
|
-
editor.addCommand('mceAutoResize',
|
|
170
|
+
const register = (editor, oldSize) => {
|
|
171
|
+
editor.addCommand('mceAutoResize', () => {
|
|
165
172
|
resize(editor, oldSize);
|
|
166
173
|
});
|
|
167
174
|
};
|
|
168
175
|
|
|
169
|
-
|
|
170
|
-
global$
|
|
171
|
-
|
|
172
|
-
|
|
176
|
+
var Plugin = () => {
|
|
177
|
+
global$1.add('autoresize', editor => {
|
|
178
|
+
register$1(editor);
|
|
179
|
+
if (!editor.options.isSet('resize')) {
|
|
180
|
+
editor.options.set('resize', false);
|
|
173
181
|
}
|
|
174
182
|
if (!editor.inline) {
|
|
175
|
-
|
|
183
|
+
const oldSize = Cell(0);
|
|
176
184
|
register(editor, oldSize);
|
|
177
185
|
setup(editor, oldSize);
|
|
178
186
|
}
|
|
179
187
|
});
|
|
180
|
-
}
|
|
188
|
+
};
|
|
181
189
|
|
|
182
190
|
Plugin();
|
|
183
191
|
|
|
184
|
-
}()
|
|
192
|
+
})();
|
|
@@ -1,9 +1,4 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
* Licensed under the LGPL or a commercial license.
|
|
4
|
-
* For LGPL see License.txt in the project root for license information.
|
|
5
|
-
* For commercial licenses see https://www.tiny.cloud/
|
|
6
|
-
*
|
|
7
|
-
* Version: 5.10.9 (2023-11-15)
|
|
2
|
+
* TinyMCE version 7.0.1 (2024-04-10)
|
|
8
3
|
*/
|
|
9
|
-
!function(){"use strict";
|
|
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),s=o("min_height"),i=o("max_height"),n=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))},g=(e,t,o,s)=>{var i;const n=parseInt(null!==(i=e.getStyle(t,o,s))&&void 0!==i?i:"",10);return isNaN(n)?0:n},a=(e,o,r,c)=>{var d;const f=e.dom,u=e.getDoc();if(!u)return;if((e=>e.plugins.fullscreen&&e.plugins.fullscreen.isFullscreen())(e))return void l(e,!0);const m=u.documentElement,h=c?c():n(e),p=null!==(d=s(e))&&void 0!==d?d:e.getElement().offsetHeight;let y=p;const S=g(f,m,"margin-top",!0),v=g(f,m,"margin-bottom",!0);let C=m.offsetHeight+S+v+h;C<0&&(C=0);const b=e.getContainer().offsetHeight-e.getContentAreaContainer().offsetHeight;C+b>p&&(y=C+b);const w=i(e);if(w&&y>w?(y=w,l(e,!0)):l(e,!1),y!==o.get()){const s=y-o.get();if(f.setStyle(e.getContainer(),"height",y+"px"),o.set(y),(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})(r)&&e.selection.scrollIntoView(),(t.browser.isSafari()||t.browser.isChromium())&&s<0&&a(e,o,r,c)}};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 o=(e=>{let t=0;return{get:()=>t,set:e=>{t=e}}})();((e,t)=>{e.addCommand("mceAutoResize",(()=>{a(e,t)}))})(e,o),((e,o)=>{let s,i,l=()=>r(e);e.on("init",(i=>{s=0;const r=n(e),g=e.dom;g.setStyles(e.getDoc().documentElement,{height:"auto"}),t.browser.isEdge()||t.browser.isIE()?g.setStyles(e.getBody(),{paddingLeft:r,paddingRight:r,"min-height":0}):g.setStyles(e.getBody(),{paddingLeft:r,paddingRight:r}),a(e,o,i,l),s+=1})),e.on("NodeChange SetContent keyup FullscreenStateChanged ResizeContent",(t=>{if(1===s)i=e.getContainer().offsetHeight,a(e,o,t,l),s+=1;else if(2===s){const t=i<e.getContainer().offsetHeight;if(t){const t=e.dom,o=e.getDoc();t.setStyles(o.documentElement,{"min-height":0}),t.setStyles(e.getBody(),{"min-height":"inherit"})}l=t?(0,()=>0):l,s+=1}else a(e,o,t,l)}))})(e,o)}}))}();
|
|
@@ -1,22 +1,36 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
* Licensed under the LGPL or a commercial license.
|
|
4
|
-
* For LGPL see License.txt in the project root for license information.
|
|
5
|
-
* For commercial licenses see https://www.tiny.cloud/
|
|
6
|
-
*
|
|
7
|
-
* Version: 5.10.9 (2023-11-15)
|
|
2
|
+
* TinyMCE version 7.0.1 (2024-04-10)
|
|
8
3
|
*/
|
|
4
|
+
|
|
9
5
|
(function () {
|
|
10
6
|
'use strict';
|
|
11
7
|
|
|
12
8
|
var global$4 = tinymce.util.Tools.resolve('tinymce.PluginManager');
|
|
13
9
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
10
|
+
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
|
+
}
|
|
18
17
|
};
|
|
19
|
-
|
|
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;
|
|
32
|
+
const isString = isType('string');
|
|
33
|
+
const isUndefined = eq(undefined);
|
|
20
34
|
|
|
21
35
|
var global$3 = tinymce.util.Tools.resolve('tinymce.util.Delay');
|
|
22
36
|
|
|
@@ -24,74 +38,98 @@
|
|
|
24
38
|
|
|
25
39
|
var global$1 = tinymce.util.Tools.resolve('tinymce.util.Tools');
|
|
26
40
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
var fireStoreDraft = function (editor) {
|
|
31
|
-
return editor.fire('StoreDraft');
|
|
32
|
-
};
|
|
33
|
-
var fireRemoveDraft = function (editor) {
|
|
34
|
-
return editor.fire('RemoveDraft');
|
|
35
|
-
};
|
|
41
|
+
const fireRestoreDraft = editor => editor.dispatch('RestoreDraft');
|
|
42
|
+
const fireStoreDraft = editor => editor.dispatch('StoreDraft');
|
|
43
|
+
const fireRemoveDraft = editor => editor.dispatch('RemoveDraft');
|
|
36
44
|
|
|
37
|
-
|
|
38
|
-
|
|
45
|
+
const parse = timeString => {
|
|
46
|
+
const multiples = {
|
|
39
47
|
s: 1000,
|
|
40
48
|
m: 60000
|
|
41
49
|
};
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
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
|
+
});
|
|
59
91
|
};
|
|
60
|
-
|
|
61
|
-
|
|
92
|
+
const shouldAskBeforeUnload = option('autosave_ask_before_unload');
|
|
93
|
+
const shouldRestoreWhenEmpty = option('autosave_restore_when_empty');
|
|
94
|
+
const getAutoSaveInterval = option('autosave_interval');
|
|
95
|
+
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);
|
|
62
99
|
};
|
|
63
100
|
|
|
64
|
-
|
|
101
|
+
const isEmpty = (editor, html) => {
|
|
65
102
|
if (isUndefined(html)) {
|
|
66
103
|
return editor.dom.isEmpty(editor.getBody());
|
|
67
104
|
} else {
|
|
68
|
-
|
|
105
|
+
const trimmedHtml = global$1.trim(html);
|
|
69
106
|
if (trimmedHtml === '') {
|
|
70
107
|
return true;
|
|
71
108
|
} else {
|
|
72
|
-
|
|
109
|
+
const fragment = new DOMParser().parseFromString(trimmedHtml, 'text/html');
|
|
73
110
|
return editor.dom.isEmpty(fragment);
|
|
74
111
|
}
|
|
75
112
|
}
|
|
76
113
|
};
|
|
77
|
-
|
|
78
|
-
var
|
|
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;
|
|
79
117
|
if (new Date().getTime() - time > getAutoSaveRetention(editor)) {
|
|
80
118
|
removeDraft(editor, false);
|
|
81
119
|
return false;
|
|
82
120
|
}
|
|
83
121
|
return true;
|
|
84
122
|
};
|
|
85
|
-
|
|
86
|
-
|
|
123
|
+
const removeDraft = (editor, fire) => {
|
|
124
|
+
const prefix = getAutoSavePrefix(editor);
|
|
87
125
|
global$2.removeItem(prefix + 'draft');
|
|
88
126
|
global$2.removeItem(prefix + 'time');
|
|
89
127
|
if (fire !== false) {
|
|
90
128
|
fireRemoveDraft(editor);
|
|
91
129
|
}
|
|
92
130
|
};
|
|
93
|
-
|
|
94
|
-
|
|
131
|
+
const storeDraft = editor => {
|
|
132
|
+
const prefix = getAutoSavePrefix(editor);
|
|
95
133
|
if (!isEmpty(editor) && editor.isDirty()) {
|
|
96
134
|
global$2.setItem(prefix + 'draft', editor.getContent({
|
|
97
135
|
format: 'raw',
|
|
@@ -101,53 +139,42 @@
|
|
|
101
139
|
fireStoreDraft(editor);
|
|
102
140
|
}
|
|
103
141
|
};
|
|
104
|
-
|
|
105
|
-
var
|
|
142
|
+
const restoreDraft = editor => {
|
|
143
|
+
var _a;
|
|
144
|
+
const prefix = getAutoSavePrefix(editor);
|
|
106
145
|
if (hasDraft(editor)) {
|
|
107
|
-
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' });
|
|
108
147
|
fireRestoreDraft(editor);
|
|
109
148
|
}
|
|
110
149
|
};
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
global$3.setEditorInterval(editor,
|
|
150
|
+
const startStoreDraft = editor => {
|
|
151
|
+
const interval = getAutoSaveInterval(editor);
|
|
152
|
+
global$3.setEditorInterval(editor, () => {
|
|
114
153
|
storeDraft(editor);
|
|
115
154
|
}, interval);
|
|
116
155
|
};
|
|
117
|
-
|
|
118
|
-
editor.undoManager.transact(
|
|
156
|
+
const restoreLastDraft = editor => {
|
|
157
|
+
editor.undoManager.transact(() => {
|
|
119
158
|
restoreDraft(editor);
|
|
120
159
|
removeDraft(editor);
|
|
121
160
|
});
|
|
122
161
|
editor.focus();
|
|
123
162
|
};
|
|
124
163
|
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
},
|
|
133
|
-
restoreDraft: function () {
|
|
134
|
-
return restoreDraft(editor);
|
|
135
|
-
},
|
|
136
|
-
removeDraft: function (fire) {
|
|
137
|
-
return removeDraft(editor, fire);
|
|
138
|
-
},
|
|
139
|
-
isEmpty: function (html) {
|
|
140
|
-
return isEmpty(editor, html);
|
|
141
|
-
}
|
|
142
|
-
};
|
|
143
|
-
};
|
|
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)
|
|
170
|
+
});
|
|
144
171
|
|
|
145
172
|
var global = tinymce.util.Tools.resolve('tinymce.EditorManager');
|
|
146
173
|
|
|
147
|
-
|
|
148
|
-
editor.editorManager.on('BeforeUnload',
|
|
149
|
-
|
|
150
|
-
global$1.each(global.get(),
|
|
174
|
+
const setup = editor => {
|
|
175
|
+
editor.editorManager.on('BeforeUnload', e => {
|
|
176
|
+
let msg;
|
|
177
|
+
global$1.each(global.get(), editor => {
|
|
151
178
|
if (editor.plugins.autosave) {
|
|
152
179
|
editor.plugins.autosave.storeDraft();
|
|
153
180
|
}
|
|
@@ -162,51 +189,45 @@
|
|
|
162
189
|
});
|
|
163
190
|
};
|
|
164
191
|
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
};
|
|
171
|
-
editor.on('StoreDraft RestoreDraft RemoveDraft', editorEventCallback);
|
|
172
|
-
return function () {
|
|
173
|
-
return editor.off('StoreDraft RestoreDraft RemoveDraft', editorEventCallback);
|
|
174
|
-
};
|
|
175
|
-
};
|
|
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);
|
|
176
197
|
};
|
|
177
|
-
|
|
198
|
+
const register = editor => {
|
|
178
199
|
startStoreDraft(editor);
|
|
200
|
+
const onAction = () => {
|
|
201
|
+
restoreLastDraft(editor);
|
|
202
|
+
};
|
|
179
203
|
editor.ui.registry.addButton('restoredraft', {
|
|
180
204
|
tooltip: 'Restore last draft',
|
|
181
205
|
icon: 'restore-draft',
|
|
182
|
-
onAction
|
|
183
|
-
restoreLastDraft(editor);
|
|
184
|
-
},
|
|
206
|
+
onAction,
|
|
185
207
|
onSetup: makeSetupHandler(editor)
|
|
186
208
|
});
|
|
187
209
|
editor.ui.registry.addMenuItem('restoredraft', {
|
|
188
210
|
text: 'Restore last draft',
|
|
189
211
|
icon: 'restore-draft',
|
|
190
|
-
onAction
|
|
191
|
-
restoreLastDraft(editor);
|
|
192
|
-
},
|
|
212
|
+
onAction,
|
|
193
213
|
onSetup: makeSetupHandler(editor)
|
|
194
214
|
});
|
|
195
215
|
};
|
|
196
216
|
|
|
197
|
-
|
|
198
|
-
global$4.add('autosave',
|
|
217
|
+
var Plugin = () => {
|
|
218
|
+
global$4.add('autosave', editor => {
|
|
219
|
+
register$1(editor);
|
|
199
220
|
setup(editor);
|
|
200
221
|
register(editor);
|
|
201
|
-
editor.on('init',
|
|
222
|
+
editor.on('init', () => {
|
|
202
223
|
if (shouldRestoreWhenEmpty(editor) && editor.dom.isEmpty(editor.getBody())) {
|
|
203
224
|
restoreDraft(editor);
|
|
204
225
|
}
|
|
205
226
|
});
|
|
206
227
|
return get(editor);
|
|
207
228
|
});
|
|
208
|
-
}
|
|
229
|
+
};
|
|
209
230
|
|
|
210
231
|
Plugin();
|
|
211
232
|
|
|
212
|
-
}()
|
|
233
|
+
})();
|