@bobfrankston/rmfmail 1.0.655 → 1.0.657
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/bin/build-tinymce.js +42 -0
- package/bin/mailx.js +54 -23
- package/bin/mailx.js.map +1 -1
- package/bin/mailx.ts +45 -20
- package/client/compose/editor.js +7 -1
- package/client/compose/editor.js.map +1 -1
- package/client/compose/editor.ts +7 -1
- package/client/lib/rmf-tiny.js +21 -3
- package/client/lib/tinymce/CHANGELOG.md +3991 -0
- package/client/lib/tinymce/README.md +77 -0
- package/client/lib/tinymce/bower.json +27 -0
- package/client/lib/tinymce/composer.json +52 -0
- package/client/lib/tinymce/icons/default/icons.js +270 -0
- package/client/lib/tinymce/icons/default/icons.min.js +1 -0
- package/client/lib/tinymce/icons/default/index.js +7 -0
- package/client/lib/tinymce/license.md +9 -0
- package/client/lib/tinymce/models/dom/index.js +7 -0
- package/client/lib/tinymce/models/dom/model.js +8994 -0
- package/client/lib/tinymce/models/dom/model.min.js +1 -0
- package/client/lib/tinymce/notices.txt +21 -0
- package/client/lib/tinymce/package.json +32 -0
- package/client/lib/tinymce/plugins/accordion/index.js +7 -0
- package/client/lib/tinymce/plugins/accordion/plugin.js +1373 -0
- package/client/lib/tinymce/plugins/accordion/plugin.min.js +1 -0
- package/client/lib/tinymce/plugins/advlist/index.js +7 -0
- package/client/lib/tinymce/plugins/advlist/plugin.js +473 -0
- package/client/lib/tinymce/plugins/advlist/plugin.min.js +1 -0
- package/client/lib/tinymce/plugins/anchor/index.js +7 -0
- package/client/lib/tinymce/plugins/anchor/plugin.js +237 -0
- package/client/lib/tinymce/plugins/anchor/plugin.min.js +1 -0
- package/client/lib/tinymce/plugins/autolink/index.js +7 -0
- package/client/lib/tinymce/plugins/autolink/plugin.js +315 -0
- package/client/lib/tinymce/plugins/autolink/plugin.min.js +1 -0
- package/client/lib/tinymce/plugins/autoresize/index.js +7 -0
- package/client/lib/tinymce/plugins/autoresize/plugin.js +221 -0
- package/client/lib/tinymce/plugins/autoresize/plugin.min.js +1 -0
- package/client/lib/tinymce/plugins/autosave/index.js +7 -0
- package/client/lib/tinymce/plugins/autosave/plugin.js +249 -0
- package/client/lib/tinymce/plugins/autosave/plugin.min.js +1 -0
- package/client/lib/tinymce/plugins/charmap/index.js +7 -0
- package/client/lib/tinymce/plugins/charmap/plugin.js +997 -0
- package/client/lib/tinymce/plugins/charmap/plugin.min.js +1 -0
- package/client/lib/tinymce/plugins/code/index.js +7 -0
- package/client/lib/tinymce/plugins/code/plugin.js +98 -0
- package/client/lib/tinymce/plugins/code/plugin.min.js +1 -0
- package/client/lib/tinymce/plugins/codesample/index.js +7 -0
- package/client/lib/tinymce/plugins/codesample/plugin.js +3655 -0
- package/client/lib/tinymce/plugins/codesample/plugin.min.js +9 -0
- package/client/lib/tinymce/plugins/directionality/index.js +7 -0
- package/client/lib/tinymce/plugins/directionality/plugin.js +670 -0
- package/client/lib/tinymce/plugins/directionality/plugin.min.js +1 -0
- package/client/lib/tinymce/plugins/emoticons/index.js +7 -0
- package/client/lib/tinymce/plugins/emoticons/js/emojiimages.js +1 -0
- package/client/lib/tinymce/plugins/emoticons/js/emojiimages.min.js +1 -0
- package/client/lib/tinymce/plugins/emoticons/js/emojis.js +1 -0
- package/client/lib/tinymce/plugins/emoticons/js/emojis.min.js +1 -0
- package/client/lib/tinymce/plugins/emoticons/plugin.js +809 -0
- package/client/lib/tinymce/plugins/emoticons/plugin.min.js +1 -0
- package/client/lib/tinymce/plugins/fullscreen/index.js +7 -0
- package/client/lib/tinymce/plugins/fullscreen/plugin.js +1607 -0
- package/client/lib/tinymce/plugins/fullscreen/plugin.min.js +1 -0
- package/client/lib/tinymce/plugins/help/index.js +7 -0
- package/client/lib/tinymce/plugins/help/js/i18n/keynav/ar.js +93 -0
- package/client/lib/tinymce/plugins/help/js/i18n/keynav/bg-BG.js +93 -0
- package/client/lib/tinymce/plugins/help/js/i18n/keynav/bg_BG.js +93 -0
- package/client/lib/tinymce/plugins/help/js/i18n/keynav/ca.js +93 -0
- package/client/lib/tinymce/plugins/help/js/i18n/keynav/cs.js +93 -0
- package/client/lib/tinymce/plugins/help/js/i18n/keynav/da.js +93 -0
- package/client/lib/tinymce/plugins/help/js/i18n/keynav/de.js +93 -0
- package/client/lib/tinymce/plugins/help/js/i18n/keynav/el.js +93 -0
- package/client/lib/tinymce/plugins/help/js/i18n/keynav/en.js +93 -0
- package/client/lib/tinymce/plugins/help/js/i18n/keynav/es.js +93 -0
- package/client/lib/tinymce/plugins/help/js/i18n/keynav/eu.js +93 -0
- package/client/lib/tinymce/plugins/help/js/i18n/keynav/fa.js +93 -0
- package/client/lib/tinymce/plugins/help/js/i18n/keynav/fi.js +93 -0
- package/client/lib/tinymce/plugins/help/js/i18n/keynav/fr-FR.js +93 -0
- package/client/lib/tinymce/plugins/help/js/i18n/keynav/fr_FR.js +93 -0
- package/client/lib/tinymce/plugins/help/js/i18n/keynav/he-IL.js +93 -0
- package/client/lib/tinymce/plugins/help/js/i18n/keynav/he_IL.js +93 -0
- package/client/lib/tinymce/plugins/help/js/i18n/keynav/hi.js +93 -0
- package/client/lib/tinymce/plugins/help/js/i18n/keynav/hr.js +93 -0
- package/client/lib/tinymce/plugins/help/js/i18n/keynav/hu-HU.js +93 -0
- package/client/lib/tinymce/plugins/help/js/i18n/keynav/hu_HU.js +93 -0
- package/client/lib/tinymce/plugins/help/js/i18n/keynav/id.js +93 -0
- package/client/lib/tinymce/plugins/help/js/i18n/keynav/it.js +93 -0
- package/client/lib/tinymce/plugins/help/js/i18n/keynav/ja.js +93 -0
- package/client/lib/tinymce/plugins/help/js/i18n/keynav/kk.js +93 -0
- package/client/lib/tinymce/plugins/help/js/i18n/keynav/ko-KR.js +93 -0
- package/client/lib/tinymce/plugins/help/js/i18n/keynav/ko_KR.js +93 -0
- package/client/lib/tinymce/plugins/help/js/i18n/keynav/ms.js +93 -0
- package/client/lib/tinymce/plugins/help/js/i18n/keynav/nb-NO.js +93 -0
- package/client/lib/tinymce/plugins/help/js/i18n/keynav/nb_NO.js +93 -0
- package/client/lib/tinymce/plugins/help/js/i18n/keynav/nl.js +93 -0
- package/client/lib/tinymce/plugins/help/js/i18n/keynav/pl.js +93 -0
- package/client/lib/tinymce/plugins/help/js/i18n/keynav/pt-BR.js +93 -0
- package/client/lib/tinymce/plugins/help/js/i18n/keynav/pt-PT.js +93 -0
- package/client/lib/tinymce/plugins/help/js/i18n/keynav/pt_BR.js +93 -0
- package/client/lib/tinymce/plugins/help/js/i18n/keynav/pt_PT.js +93 -0
- package/client/lib/tinymce/plugins/help/js/i18n/keynav/ro.js +93 -0
- package/client/lib/tinymce/plugins/help/js/i18n/keynav/ru.js +93 -0
- package/client/lib/tinymce/plugins/help/js/i18n/keynav/sk.js +93 -0
- package/client/lib/tinymce/plugins/help/js/i18n/keynav/sl-SI.js +93 -0
- package/client/lib/tinymce/plugins/help/js/i18n/keynav/sl_SI.js +93 -0
- package/client/lib/tinymce/plugins/help/js/i18n/keynav/sv-SE.js +93 -0
- package/client/lib/tinymce/plugins/help/js/i18n/keynav/sv_SE.js +93 -0
- package/client/lib/tinymce/plugins/help/js/i18n/keynav/th-TH.js +93 -0
- package/client/lib/tinymce/plugins/help/js/i18n/keynav/th_TH.js +93 -0
- package/client/lib/tinymce/plugins/help/js/i18n/keynav/tr.js +93 -0
- package/client/lib/tinymce/plugins/help/js/i18n/keynav/uk.js +93 -0
- package/client/lib/tinymce/plugins/help/js/i18n/keynav/vi.js +93 -0
- package/client/lib/tinymce/plugins/help/js/i18n/keynav/zh-CN.js +87 -0
- package/client/lib/tinymce/plugins/help/js/i18n/keynav/zh-TW.js +93 -0
- package/client/lib/tinymce/plugins/help/js/i18n/keynav/zh_CN.js +87 -0
- package/client/lib/tinymce/plugins/help/js/i18n/keynav/zh_TW.js +93 -0
- package/client/lib/tinymce/plugins/help/plugin.js +827 -0
- package/client/lib/tinymce/plugins/help/plugin.min.js +1 -0
- package/client/lib/tinymce/plugins/image/index.js +7 -0
- package/client/lib/tinymce/plugins/image/plugin.js +1692 -0
- package/client/lib/tinymce/plugins/image/plugin.min.js +1 -0
- package/client/lib/tinymce/plugins/importcss/index.js +7 -0
- package/client/lib/tinymce/plugins/importcss/plugin.js +401 -0
- package/client/lib/tinymce/plugins/importcss/plugin.min.js +1 -0
- package/client/lib/tinymce/plugins/insertdatetime/index.js +7 -0
- package/client/lib/tinymce/plugins/insertdatetime/plugin.js +187 -0
- package/client/lib/tinymce/plugins/insertdatetime/plugin.min.js +1 -0
- package/client/lib/tinymce/plugins/link/index.js +7 -0
- package/client/lib/tinymce/plugins/link/plugin.js +1711 -0
- package/client/lib/tinymce/plugins/link/plugin.min.js +1 -0
- package/client/lib/tinymce/plugins/lists/index.js +7 -0
- package/client/lib/tinymce/plugins/lists/plugin.js +602 -0
- package/client/lib/tinymce/plugins/lists/plugin.min.js +1 -0
- package/client/lib/tinymce/plugins/media/index.js +7 -0
- package/client/lib/tinymce/plugins/media/plugin.js +1442 -0
- package/client/lib/tinymce/plugins/media/plugin.min.js +1 -0
- package/client/lib/tinymce/plugins/nonbreaking/index.js +7 -0
- package/client/lib/tinymce/plugins/nonbreaking/plugin.js +128 -0
- package/client/lib/tinymce/plugins/nonbreaking/plugin.min.js +1 -0
- package/client/lib/tinymce/plugins/pagebreak/index.js +7 -0
- package/client/lib/tinymce/plugins/pagebreak/plugin.js +123 -0
- package/client/lib/tinymce/plugins/pagebreak/plugin.min.js +1 -0
- package/client/lib/tinymce/plugins/preview/index.js +7 -0
- package/client/lib/tinymce/plugins/preview/plugin.js +878 -0
- package/client/lib/tinymce/plugins/preview/plugin.min.js +1 -0
- package/client/lib/tinymce/plugins/quickbars/index.js +7 -0
- package/client/lib/tinymce/plugins/quickbars/plugin.js +654 -0
- package/client/lib/tinymce/plugins/quickbars/plugin.min.js +1 -0
- package/client/lib/tinymce/plugins/save/index.js +7 -0
- package/client/lib/tinymce/plugins/save/plugin.js +136 -0
- package/client/lib/tinymce/plugins/save/plugin.min.js +1 -0
- package/client/lib/tinymce/plugins/searchreplace/index.js +7 -0
- package/client/lib/tinymce/plugins/searchreplace/plugin.js +1367 -0
- package/client/lib/tinymce/plugins/searchreplace/plugin.min.js +1 -0
- package/client/lib/tinymce/plugins/table/index.js +7 -0
- package/client/lib/tinymce/plugins/table/plugin.js +4011 -0
- package/client/lib/tinymce/plugins/table/plugin.min.js +1 -0
- package/client/lib/tinymce/plugins/visualblocks/index.js +7 -0
- package/client/lib/tinymce/plugins/visualblocks/plugin.js +106 -0
- package/client/lib/tinymce/plugins/visualblocks/plugin.min.js +1 -0
- package/client/lib/tinymce/plugins/visualchars/index.js +7 -0
- package/client/lib/tinymce/plugins/visualchars/plugin.js +808 -0
- package/client/lib/tinymce/plugins/visualchars/plugin.min.js +1 -0
- package/client/lib/tinymce/plugins/wordcount/index.js +7 -0
- package/client/lib/tinymce/plugins/wordcount/plugin.js +586 -0
- package/client/lib/tinymce/plugins/wordcount/plugin.min.js +1 -0
- package/client/lib/tinymce/skins/content/dark/content.css +75 -0
- package/client/lib/tinymce/skins/content/dark/content.js +10 -0
- package/client/lib/tinymce/skins/content/dark/content.min.css +10 -0
- package/client/lib/tinymce/skins/content/dark/content.min.ts +3 -0
- package/client/lib/tinymce/skins/content/dark/content.ts +3 -0
- package/client/lib/tinymce/skins/content/default/content.css +70 -0
- package/client/lib/tinymce/skins/content/default/content.js +10 -0
- package/client/lib/tinymce/skins/content/default/content.min.css +10 -0
- package/client/lib/tinymce/skins/content/default/content.min.ts +3 -0
- package/client/lib/tinymce/skins/content/default/content.ts +3 -0
- package/client/lib/tinymce/skins/content/document/content.css +75 -0
- package/client/lib/tinymce/skins/content/document/content.js +10 -0
- package/client/lib/tinymce/skins/content/document/content.min.css +10 -0
- package/client/lib/tinymce/skins/content/document/content.min.ts +3 -0
- package/client/lib/tinymce/skins/content/document/content.ts +3 -0
- package/client/lib/tinymce/skins/content/tinymce-5/content.css +70 -0
- package/client/lib/tinymce/skins/content/tinymce-5/content.js +10 -0
- package/client/lib/tinymce/skins/content/tinymce-5/content.min.css +10 -0
- package/client/lib/tinymce/skins/content/tinymce-5/content.min.ts +3 -0
- package/client/lib/tinymce/skins/content/tinymce-5/content.ts +3 -0
- package/client/lib/tinymce/skins/content/tinymce-5-dark/content.css +75 -0
- package/client/lib/tinymce/skins/content/tinymce-5-dark/content.js +10 -0
- package/client/lib/tinymce/skins/content/tinymce-5-dark/content.min.css +10 -0
- package/client/lib/tinymce/skins/content/tinymce-5-dark/content.min.ts +3 -0
- package/client/lib/tinymce/skins/content/tinymce-5-dark/content.ts +3 -0
- package/client/lib/tinymce/skins/content/writer/content.css +71 -0
- package/client/lib/tinymce/skins/content/writer/content.js +10 -0
- package/client/lib/tinymce/skins/content/writer/content.min.css +10 -0
- package/client/lib/tinymce/skins/content/writer/content.min.ts +3 -0
- package/client/lib/tinymce/skins/content/writer/content.ts +3 -0
- package/client/lib/tinymce/skins/ui/oxide/content.css +1322 -0
- package/client/lib/tinymce/skins/ui/oxide/content.inline.css +1316 -0
- package/client/lib/tinymce/skins/ui/oxide/content.inline.js +10 -0
- package/client/lib/tinymce/skins/ui/oxide/content.inline.min.css +10 -0
- package/client/lib/tinymce/skins/ui/oxide/content.inline.min.ts +136 -0
- package/client/lib/tinymce/skins/ui/oxide/content.inline.ts +136 -0
- package/client/lib/tinymce/skins/ui/oxide/content.js +10 -0
- package/client/lib/tinymce/skins/ui/oxide/content.min.css +10 -0
- package/client/lib/tinymce/skins/ui/oxide/content.min.ts +136 -0
- package/client/lib/tinymce/skins/ui/oxide/content.ts +136 -0
- package/client/lib/tinymce/skins/ui/oxide/skin.css +7109 -0
- package/client/lib/tinymce/skins/ui/oxide/skin.js +1 -0
- package/client/lib/tinymce/skins/ui/oxide/skin.min.css +1 -0
- package/client/lib/tinymce/skins/ui/oxide/skin.min.ts +637 -0
- package/client/lib/tinymce/skins/ui/oxide/skin.shadowdom.css +30 -0
- package/client/lib/tinymce/skins/ui/oxide/skin.shadowdom.js +1 -0
- package/client/lib/tinymce/skins/ui/oxide/skin.shadowdom.min.css +1 -0
- package/client/lib/tinymce/skins/ui/oxide/skin.shadowdom.min.ts +9 -0
- package/client/lib/tinymce/skins/ui/oxide/skin.shadowdom.ts +9 -0
- package/client/lib/tinymce/skins/ui/oxide/skin.ts +637 -0
- package/client/lib/tinymce/skins/ui/oxide-dark/content.css +1310 -0
- package/client/lib/tinymce/skins/ui/oxide-dark/content.inline.css +1316 -0
- package/client/lib/tinymce/skins/ui/oxide-dark/content.inline.js +10 -0
- package/client/lib/tinymce/skins/ui/oxide-dark/content.inline.min.css +10 -0
- package/client/lib/tinymce/skins/ui/oxide-dark/content.inline.min.ts +136 -0
- package/client/lib/tinymce/skins/ui/oxide-dark/content.inline.ts +136 -0
- package/client/lib/tinymce/skins/ui/oxide-dark/content.js +10 -0
- package/client/lib/tinymce/skins/ui/oxide-dark/content.min.css +10 -0
- package/client/lib/tinymce/skins/ui/oxide-dark/content.min.ts +136 -0
- package/client/lib/tinymce/skins/ui/oxide-dark/content.ts +136 -0
- package/client/lib/tinymce/skins/ui/oxide-dark/skin.css +7112 -0
- package/client/lib/tinymce/skins/ui/oxide-dark/skin.js +1 -0
- package/client/lib/tinymce/skins/ui/oxide-dark/skin.min.css +1 -0
- package/client/lib/tinymce/skins/ui/oxide-dark/skin.min.ts +637 -0
- package/client/lib/tinymce/skins/ui/oxide-dark/skin.shadowdom.css +30 -0
- package/client/lib/tinymce/skins/ui/oxide-dark/skin.shadowdom.js +1 -0
- package/client/lib/tinymce/skins/ui/oxide-dark/skin.shadowdom.min.css +1 -0
- package/client/lib/tinymce/skins/ui/oxide-dark/skin.shadowdom.min.ts +9 -0
- package/client/lib/tinymce/skins/ui/oxide-dark/skin.shadowdom.ts +9 -0
- package/client/lib/tinymce/skins/ui/oxide-dark/skin.ts +637 -0
- package/client/lib/tinymce/skins/ui/tinymce-5/content.css +1322 -0
- package/client/lib/tinymce/skins/ui/tinymce-5/content.inline.css +1316 -0
- package/client/lib/tinymce/skins/ui/tinymce-5/content.inline.js +10 -0
- package/client/lib/tinymce/skins/ui/tinymce-5/content.inline.min.css +10 -0
- package/client/lib/tinymce/skins/ui/tinymce-5/content.inline.min.ts +136 -0
- package/client/lib/tinymce/skins/ui/tinymce-5/content.inline.ts +136 -0
- package/client/lib/tinymce/skins/ui/tinymce-5/content.js +10 -0
- package/client/lib/tinymce/skins/ui/tinymce-5/content.min.css +10 -0
- package/client/lib/tinymce/skins/ui/tinymce-5/content.min.ts +136 -0
- package/client/lib/tinymce/skins/ui/tinymce-5/content.ts +136 -0
- package/client/lib/tinymce/skins/ui/tinymce-5/skin.css +7228 -0
- package/client/lib/tinymce/skins/ui/tinymce-5/skin.js +1 -0
- package/client/lib/tinymce/skins/ui/tinymce-5/skin.min.css +1 -0
- package/client/lib/tinymce/skins/ui/tinymce-5/skin.min.ts +638 -0
- package/client/lib/tinymce/skins/ui/tinymce-5/skin.shadowdom.css +30 -0
- package/client/lib/tinymce/skins/ui/tinymce-5/skin.shadowdom.js +1 -0
- package/client/lib/tinymce/skins/ui/tinymce-5/skin.shadowdom.min.css +1 -0
- package/client/lib/tinymce/skins/ui/tinymce-5/skin.shadowdom.min.ts +9 -0
- package/client/lib/tinymce/skins/ui/tinymce-5/skin.shadowdom.ts +9 -0
- package/client/lib/tinymce/skins/ui/tinymce-5/skin.ts +638 -0
- package/client/lib/tinymce/skins/ui/tinymce-5-dark/content.css +1310 -0
- package/client/lib/tinymce/skins/ui/tinymce-5-dark/content.inline.css +1316 -0
- package/client/lib/tinymce/skins/ui/tinymce-5-dark/content.inline.js +10 -0
- package/client/lib/tinymce/skins/ui/tinymce-5-dark/content.inline.min.css +10 -0
- package/client/lib/tinymce/skins/ui/tinymce-5-dark/content.inline.min.ts +136 -0
- package/client/lib/tinymce/skins/ui/tinymce-5-dark/content.inline.ts +136 -0
- package/client/lib/tinymce/skins/ui/tinymce-5-dark/content.js +10 -0
- package/client/lib/tinymce/skins/ui/tinymce-5-dark/content.min.css +10 -0
- package/client/lib/tinymce/skins/ui/tinymce-5-dark/content.min.ts +136 -0
- package/client/lib/tinymce/skins/ui/tinymce-5-dark/content.ts +136 -0
- package/client/lib/tinymce/skins/ui/tinymce-5-dark/skin.css +7228 -0
- package/client/lib/tinymce/skins/ui/tinymce-5-dark/skin.js +1 -0
- package/client/lib/tinymce/skins/ui/tinymce-5-dark/skin.min.css +1 -0
- package/client/lib/tinymce/skins/ui/tinymce-5-dark/skin.min.ts +638 -0
- package/client/lib/tinymce/skins/ui/tinymce-5-dark/skin.shadowdom.css +30 -0
- package/client/lib/tinymce/skins/ui/tinymce-5-dark/skin.shadowdom.js +1 -0
- package/client/lib/tinymce/skins/ui/tinymce-5-dark/skin.shadowdom.min.css +1 -0
- package/client/lib/tinymce/skins/ui/tinymce-5-dark/skin.shadowdom.min.ts +9 -0
- package/client/lib/tinymce/skins/ui/tinymce-5-dark/skin.shadowdom.ts +9 -0
- package/client/lib/tinymce/skins/ui/tinymce-5-dark/skin.ts +638 -0
- package/client/lib/tinymce/themes/silver/index.js +7 -0
- package/client/lib/tinymce/themes/silver/theme.js +34829 -0
- package/client/lib/tinymce/themes/silver/theme.min.js +1 -0
- package/client/lib/tinymce/tinymce.js +41682 -0
- package/client/lib/tinymce/tinymce.min.js +10 -0
- package/package.json +5 -2
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TinyMCE version 8.5.0 (2026-04-29)
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
(function () {
|
|
6
|
+
'use strict';
|
|
7
|
+
|
|
8
|
+
const Cell = (initial) => {
|
|
9
|
+
let value = initial;
|
|
10
|
+
const get = () => {
|
|
11
|
+
return value;
|
|
12
|
+
};
|
|
13
|
+
const set = (v) => {
|
|
14
|
+
value = v;
|
|
15
|
+
};
|
|
16
|
+
return {
|
|
17
|
+
get,
|
|
18
|
+
set
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
var global$1 = tinymce.util.Tools.resolve('tinymce.PluginManager');
|
|
23
|
+
|
|
24
|
+
var global = tinymce.util.Tools.resolve('tinymce.Env');
|
|
25
|
+
|
|
26
|
+
const fireResizeEditor = (editor) => editor.dispatch('ResizeEditor');
|
|
27
|
+
|
|
28
|
+
const option = (name) => (editor) => editor.options.get(name);
|
|
29
|
+
const register$1 = (editor) => {
|
|
30
|
+
const registerOption = editor.options.register;
|
|
31
|
+
registerOption('autoresize_overflow_padding', {
|
|
32
|
+
processor: 'number',
|
|
33
|
+
default: 1
|
|
34
|
+
});
|
|
35
|
+
registerOption('autoresize_bottom_margin', {
|
|
36
|
+
processor: 'number',
|
|
37
|
+
default: 50
|
|
38
|
+
});
|
|
39
|
+
};
|
|
40
|
+
const getMinHeight = option('min_height');
|
|
41
|
+
const getMaxHeight = option('max_height');
|
|
42
|
+
const getAutoResizeOverflowPadding = option('autoresize_overflow_padding');
|
|
43
|
+
const getAutoResizeBottomMargin = option('autoresize_bottom_margin');
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* This class contains all core logic for the autoresize plugin.
|
|
47
|
+
*
|
|
48
|
+
* @class tinymce.autoresize.Plugin
|
|
49
|
+
* @private
|
|
50
|
+
*/
|
|
51
|
+
const isFullscreen = (editor) => editor.plugins.fullscreen && editor.plugins.fullscreen.isFullscreen();
|
|
52
|
+
const toggleScrolling = (editor, state) => {
|
|
53
|
+
const body = editor.getBody();
|
|
54
|
+
if (body) {
|
|
55
|
+
body.style.overflowY = state ? '' : 'hidden';
|
|
56
|
+
if (!state) {
|
|
57
|
+
body.scrollTop = 0;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
const parseCssValueToInt = (dom, elm, name, computed) => {
|
|
62
|
+
const value = parseInt(dom.getStyle(elm, name, computed) ?? '', 10);
|
|
63
|
+
// The value maybe be an empty string, so in that case treat it as being 0
|
|
64
|
+
return isNaN(value) ? 0 : value;
|
|
65
|
+
};
|
|
66
|
+
const shouldScrollIntoView = (trigger) => {
|
|
67
|
+
// Only scroll the selection into view when we're inserting content. Any other
|
|
68
|
+
// triggers the selection should already be in view and resizing would only
|
|
69
|
+
// extend the content area.
|
|
70
|
+
if (trigger?.type.toLowerCase() === 'setcontent') {
|
|
71
|
+
const setContentEvent = trigger;
|
|
72
|
+
return setContentEvent.selection === true || setContentEvent.paste === true;
|
|
73
|
+
}
|
|
74
|
+
else {
|
|
75
|
+
return false;
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
/**
|
|
79
|
+
* This method gets executed each time the editor needs to resize.
|
|
80
|
+
*/
|
|
81
|
+
const resize = (editor, oldSize, trigger, getExtraMarginBottom) => {
|
|
82
|
+
const dom = editor.dom;
|
|
83
|
+
const doc = editor.getDoc();
|
|
84
|
+
if (!doc) {
|
|
85
|
+
return;
|
|
86
|
+
}
|
|
87
|
+
if (isFullscreen(editor)) {
|
|
88
|
+
toggleScrolling(editor, true);
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
91
|
+
const docEle = doc.documentElement;
|
|
92
|
+
const resizeBottomMargin = getExtraMarginBottom ? getExtraMarginBottom() : getAutoResizeOverflowPadding(editor);
|
|
93
|
+
const minHeight = getMinHeight(editor) ?? editor.getElement().offsetHeight;
|
|
94
|
+
let resizeHeight = minHeight;
|
|
95
|
+
// Calculate outer height of the doc element using CSS styles
|
|
96
|
+
const marginTop = parseCssValueToInt(dom, docEle, 'margin-top', true);
|
|
97
|
+
const marginBottom = parseCssValueToInt(dom, docEle, 'margin-bottom', true);
|
|
98
|
+
let contentHeight = docEle.offsetHeight + marginTop + marginBottom + resizeBottomMargin;
|
|
99
|
+
// Make sure we have a valid height
|
|
100
|
+
if (contentHeight < 0) {
|
|
101
|
+
contentHeight = 0;
|
|
102
|
+
}
|
|
103
|
+
// Determine the size of the chroming (menubar, toolbar, etc...)
|
|
104
|
+
const containerHeight = editor.getContainer().offsetHeight;
|
|
105
|
+
const contentAreaHeight = editor.getContentAreaContainer().offsetHeight;
|
|
106
|
+
const chromeHeight = containerHeight - contentAreaHeight;
|
|
107
|
+
// Don't make it smaller than the minimum height
|
|
108
|
+
if (contentHeight + chromeHeight > minHeight) {
|
|
109
|
+
resizeHeight = contentHeight + chromeHeight;
|
|
110
|
+
}
|
|
111
|
+
// If a maximum height has been defined don't exceed this height
|
|
112
|
+
const maxHeight = getMaxHeight(editor);
|
|
113
|
+
if (maxHeight && resizeHeight > maxHeight) {
|
|
114
|
+
resizeHeight = maxHeight;
|
|
115
|
+
toggleScrolling(editor, true);
|
|
116
|
+
}
|
|
117
|
+
else {
|
|
118
|
+
toggleScrolling(editor, false);
|
|
119
|
+
}
|
|
120
|
+
const old = oldSize.get();
|
|
121
|
+
if (old.set) {
|
|
122
|
+
editor.dom.setStyles(editor.getDoc().documentElement, { 'min-height': 0 });
|
|
123
|
+
editor.dom.setStyles(editor.getBody(), { 'min-height': 'inherit' });
|
|
124
|
+
}
|
|
125
|
+
// Resize content element
|
|
126
|
+
if (resizeHeight !== old.totalHeight && (contentHeight - resizeBottomMargin !== old.contentHeight || !old.set)) {
|
|
127
|
+
const deltaSize = (resizeHeight - old.totalHeight);
|
|
128
|
+
dom.setStyle(editor.getContainer(), 'height', resizeHeight + 'px');
|
|
129
|
+
oldSize.set({
|
|
130
|
+
totalHeight: resizeHeight,
|
|
131
|
+
contentHeight,
|
|
132
|
+
set: true,
|
|
133
|
+
});
|
|
134
|
+
fireResizeEditor(editor);
|
|
135
|
+
// iPadOS has an issue where it won't rerender the body when the iframe is resized
|
|
136
|
+
// however if we reset the scroll position then it re-renders correctly
|
|
137
|
+
if (global.browser.isSafari() && (global.os.isMacOS() || global.os.isiOS())) {
|
|
138
|
+
const win = editor.getWin();
|
|
139
|
+
win.scrollTo(win.pageXOffset, win.pageYOffset);
|
|
140
|
+
}
|
|
141
|
+
// Ensure the selection is in view, as it's potentially out of view after inserting content into the editor
|
|
142
|
+
if (editor.hasFocus() && shouldScrollIntoView(trigger)) {
|
|
143
|
+
editor.selection.scrollIntoView();
|
|
144
|
+
}
|
|
145
|
+
// WebKit doesn't decrease the size of the body element until the iframe gets resized
|
|
146
|
+
// So we need to continue to resize the iframe down until the size gets fixed
|
|
147
|
+
if ((global.browser.isSafari() || global.browser.isChromium()) && deltaSize < 0) {
|
|
148
|
+
resize(editor, oldSize, trigger, getExtraMarginBottom);
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
};
|
|
152
|
+
const setup = (editor, oldSize) => {
|
|
153
|
+
const getExtraMarginBottom = () => getAutoResizeBottomMargin(editor);
|
|
154
|
+
editor.on('init', (e) => {
|
|
155
|
+
const overflowPadding = getAutoResizeOverflowPadding(editor);
|
|
156
|
+
const dom = editor.dom;
|
|
157
|
+
// Disable height 100% on the root document element otherwise we'll end up resizing indefinitely
|
|
158
|
+
dom.setStyles(editor.getDoc().documentElement, {
|
|
159
|
+
height: 'auto'
|
|
160
|
+
});
|
|
161
|
+
if (global.browser.isEdge() || global.browser.isIE()) {
|
|
162
|
+
dom.setStyles(editor.getBody(), {
|
|
163
|
+
'paddingLeft': overflowPadding,
|
|
164
|
+
'paddingRight': overflowPadding,
|
|
165
|
+
// IE & Edge have a min height of 150px by default on the body, so override that
|
|
166
|
+
'min-height': 0
|
|
167
|
+
});
|
|
168
|
+
}
|
|
169
|
+
else {
|
|
170
|
+
dom.setStyles(editor.getBody(), {
|
|
171
|
+
paddingLeft: overflowPadding,
|
|
172
|
+
paddingRight: overflowPadding
|
|
173
|
+
});
|
|
174
|
+
}
|
|
175
|
+
resize(editor, oldSize, e, getExtraMarginBottom);
|
|
176
|
+
});
|
|
177
|
+
editor.on('NodeChange SetContent keyup FullscreenStateChanged ResizeContent', (e) => {
|
|
178
|
+
resize(editor, oldSize, e, getExtraMarginBottom);
|
|
179
|
+
});
|
|
180
|
+
};
|
|
181
|
+
|
|
182
|
+
const register = (editor, oldSize) => {
|
|
183
|
+
editor.addCommand('mceAutoResize', () => {
|
|
184
|
+
resize(editor, oldSize);
|
|
185
|
+
});
|
|
186
|
+
};
|
|
187
|
+
|
|
188
|
+
/**
|
|
189
|
+
* This class contains all core logic for the autoresize plugin.
|
|
190
|
+
*
|
|
191
|
+
* @class tinymce.autoresize.Plugin
|
|
192
|
+
* @private
|
|
193
|
+
*/
|
|
194
|
+
var Plugin = () => {
|
|
195
|
+
global$1.add('autoresize', (editor) => {
|
|
196
|
+
register$1(editor);
|
|
197
|
+
// If autoresize is enabled, disable resize if the user hasn't explicitly enabled it
|
|
198
|
+
// TINY-8288: This currently does nothing because of a bug in the theme
|
|
199
|
+
if (!editor.options.isSet('resize')) {
|
|
200
|
+
editor.options.set('resize', false);
|
|
201
|
+
}
|
|
202
|
+
if (!editor.inline) {
|
|
203
|
+
const oldSize = Cell({
|
|
204
|
+
totalHeight: 0,
|
|
205
|
+
contentHeight: 0,
|
|
206
|
+
set: false,
|
|
207
|
+
});
|
|
208
|
+
register(editor, oldSize);
|
|
209
|
+
setup(editor, oldSize);
|
|
210
|
+
}
|
|
211
|
+
});
|
|
212
|
+
};
|
|
213
|
+
|
|
214
|
+
Plugin();
|
|
215
|
+
/** *****
|
|
216
|
+
* DO NOT EXPORT ANYTHING
|
|
217
|
+
*
|
|
218
|
+
* IF YOU DO ROLLUP WILL LEAVE A GLOBAL ON THE PAGE
|
|
219
|
+
*******/
|
|
220
|
+
|
|
221
|
+
})();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
!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"),n=o("max_height"),i=o("autoresize_overflow_padding"),r=o("autoresize_bottom_margin"),g=(e,t)=>{const o=e.getBody();o&&(o.style.overflowY=t?"":"hidden",t||(o.scrollTop=0))},l=(e,t,o,s)=>{const n=parseInt(e.getStyle(t,o,s)??"",10);return isNaN(n)?0:n},a=(e,o,r,c)=>{const d=e.dom,h=e.getDoc();if(!h)return;if((e=>e.plugins.fullscreen&&e.plugins.fullscreen.isFullscreen())(e))return void g(e,!0);const m=h.documentElement,u=c?c():i(e),f=s(e)??e.getElement().offsetHeight;let p=f;const y=l(d,m,"margin-top",!0),S=l(d,m,"margin-bottom",!0);let C=m.offsetHeight+y+S+u;C<0&&(C=0);const H=e.getContainer().offsetHeight-e.getContentAreaContainer().offsetHeight;C+H>f&&(p=C+H);const b=n(e);b&&p>b?(p=b,g(e,!0)):g(e,!1);const w=o.get();if(w.set&&(e.dom.setStyles(e.getDoc().documentElement,{"min-height":0}),e.dom.setStyles(e.getBody(),{"min-height":"inherit"})),p!==w.totalHeight&&(C-u!==w.contentHeight||!w.set)){const s=p-w.totalHeight;if(d.setStyle(e.getContainer(),"height",p+"px"),o.set({totalHeight:p,contentHeight:C,set:!0}),(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"===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=(()=>{let e={totalHeight:0,contentHeight:0,set:!1};return{get:()=>e,set:t=>{e=t}}})();((e,t)=>{e.addCommand("mceAutoResize",()=>{a(e,t)})})(e,o),((e,o)=>{const s=()=>r(e);e.on("init",n=>{const r=i(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,n,s)}),e.on("NodeChange SetContent keyup FullscreenStateChanged ResizeContent",t=>{a(e,o,t,s)})})(e,o)}})}();
|
|
@@ -0,0 +1,249 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TinyMCE version 8.5.0 (2026-04-29)
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
(function () {
|
|
6
|
+
'use strict';
|
|
7
|
+
|
|
8
|
+
var global$4 = tinymce.util.Tools.resolve('tinymce.PluginManager');
|
|
9
|
+
|
|
10
|
+
/* eslint-disable @typescript-eslint/no-wrapper-object-types */
|
|
11
|
+
const hasProto = (v, constructor, predicate) => {
|
|
12
|
+
if (predicate(v, constructor.prototype)) {
|
|
13
|
+
return true;
|
|
14
|
+
}
|
|
15
|
+
else {
|
|
16
|
+
// String-based fallback time
|
|
17
|
+
return v.constructor?.name === constructor.name;
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
const typeOf = (x) => {
|
|
21
|
+
const t = typeof x;
|
|
22
|
+
if (x === null) {
|
|
23
|
+
return 'null';
|
|
24
|
+
}
|
|
25
|
+
else if (t === 'object' && Array.isArray(x)) {
|
|
26
|
+
return 'array';
|
|
27
|
+
}
|
|
28
|
+
else if (t === 'object' && hasProto(x, String, (o, proto) => proto.isPrototypeOf(o))) {
|
|
29
|
+
return 'string';
|
|
30
|
+
}
|
|
31
|
+
else {
|
|
32
|
+
return t;
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
const isType = (type) => (value) => typeOf(value) === type;
|
|
36
|
+
const eq = (t) => (a) => t === a;
|
|
37
|
+
const isString = isType('string');
|
|
38
|
+
const isUndefined = eq(undefined);
|
|
39
|
+
|
|
40
|
+
var global$3 = tinymce.util.Tools.resolve('tinymce.util.Delay');
|
|
41
|
+
|
|
42
|
+
var global$2 = tinymce.util.Tools.resolve('tinymce.util.LocalStorage');
|
|
43
|
+
|
|
44
|
+
var global$1 = tinymce.util.Tools.resolve('tinymce.util.Tools');
|
|
45
|
+
|
|
46
|
+
const fireRestoreDraft = (editor) => editor.dispatch('RestoreDraft');
|
|
47
|
+
const fireStoreDraft = (editor) => editor.dispatch('StoreDraft');
|
|
48
|
+
const fireRemoveDraft = (editor) => editor.dispatch('RemoveDraft');
|
|
49
|
+
|
|
50
|
+
const parse = (timeString) => {
|
|
51
|
+
const multiples = {
|
|
52
|
+
s: 1000,
|
|
53
|
+
m: 60000
|
|
54
|
+
};
|
|
55
|
+
const parsedTime = /^(\d+)([ms]?)$/.exec(timeString);
|
|
56
|
+
return (parsedTime && parsedTime[2] ? multiples[parsedTime[2]] : 1) * parseInt(timeString, 10);
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
const option = (name) => (editor) => editor.options.get(name);
|
|
60
|
+
const register$1 = (editor) => {
|
|
61
|
+
const registerOption = editor.options.register;
|
|
62
|
+
const timeProcessor = (value) => {
|
|
63
|
+
const valid = isString(value);
|
|
64
|
+
if (valid) {
|
|
65
|
+
return { value: parse(value), valid };
|
|
66
|
+
}
|
|
67
|
+
else {
|
|
68
|
+
return { valid: false, message: 'Must be a string.' };
|
|
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
|
+
});
|
|
91
|
+
};
|
|
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)
|
|
99
|
+
.replace(/{query}/g, location.search)
|
|
100
|
+
.replace(/{hash}/g, location.hash)
|
|
101
|
+
.replace(/{id}/g, editor.id);
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
const isEmpty = (editor, html) => {
|
|
105
|
+
if (isUndefined(html)) {
|
|
106
|
+
return editor.dom.isEmpty(editor.getBody());
|
|
107
|
+
}
|
|
108
|
+
else {
|
|
109
|
+
const trimmedHtml = global$1.trim(html);
|
|
110
|
+
if (trimmedHtml === '') {
|
|
111
|
+
return true;
|
|
112
|
+
}
|
|
113
|
+
else {
|
|
114
|
+
const fragment = new DOMParser().parseFromString(trimmedHtml, 'text/html');
|
|
115
|
+
return editor.dom.isEmpty(fragment);
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
};
|
|
119
|
+
const hasDraft = (editor) => {
|
|
120
|
+
const time = parseInt(global$2.getItem(getAutoSavePrefix(editor) + 'time') ?? '0', 10) || 0;
|
|
121
|
+
if (new Date().getTime() - time > getAutoSaveRetention(editor)) {
|
|
122
|
+
removeDraft(editor, false);
|
|
123
|
+
return false;
|
|
124
|
+
}
|
|
125
|
+
return true;
|
|
126
|
+
};
|
|
127
|
+
const removeDraft = (editor, fire) => {
|
|
128
|
+
const prefix = getAutoSavePrefix(editor);
|
|
129
|
+
global$2.removeItem(prefix + 'draft');
|
|
130
|
+
global$2.removeItem(prefix + 'time');
|
|
131
|
+
if (fire !== false) {
|
|
132
|
+
fireRemoveDraft(editor);
|
|
133
|
+
}
|
|
134
|
+
};
|
|
135
|
+
const storeDraft = (editor) => {
|
|
136
|
+
const prefix = getAutoSavePrefix(editor);
|
|
137
|
+
if (!isEmpty(editor) && editor.isDirty()) {
|
|
138
|
+
global$2.setItem(prefix + 'draft', editor.getContent({ format: 'raw', no_events: true }));
|
|
139
|
+
global$2.setItem(prefix + 'time', new Date().getTime().toString());
|
|
140
|
+
fireStoreDraft(editor);
|
|
141
|
+
}
|
|
142
|
+
};
|
|
143
|
+
const restoreDraft = (editor) => {
|
|
144
|
+
const prefix = getAutoSavePrefix(editor);
|
|
145
|
+
if (hasDraft(editor)) {
|
|
146
|
+
editor.setContent(global$2.getItem(prefix + 'draft') ?? '', { 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)
|
|
170
|
+
});
|
|
171
|
+
|
|
172
|
+
var global = tinymce.util.Tools.resolve('tinymce.EditorManager');
|
|
173
|
+
|
|
174
|
+
const setup = (editor) => {
|
|
175
|
+
editor.editorManager.on('BeforeUnload', (e) => {
|
|
176
|
+
let msg;
|
|
177
|
+
global$1.each(global.get(), (editor) => {
|
|
178
|
+
// Store a draft for each editor instance
|
|
179
|
+
if (editor.plugins.autosave) {
|
|
180
|
+
editor.plugins.autosave.storeDraft();
|
|
181
|
+
}
|
|
182
|
+
// Setup a return message if the editor is dirty
|
|
183
|
+
if (!msg && editor.isDirty() && shouldAskBeforeUnload(editor)) {
|
|
184
|
+
msg = editor.translate('You have unsaved changes are you sure you want to navigate away?');
|
|
185
|
+
}
|
|
186
|
+
});
|
|
187
|
+
if (msg) {
|
|
188
|
+
e.preventDefault();
|
|
189
|
+
e.returnValue = msg;
|
|
190
|
+
}
|
|
191
|
+
});
|
|
192
|
+
};
|
|
193
|
+
|
|
194
|
+
const makeSetupHandler = (editor) => (api) => {
|
|
195
|
+
const shouldEnable = () => hasDraft(editor) && !editor.mode.isReadOnly();
|
|
196
|
+
api.setEnabled(shouldEnable());
|
|
197
|
+
const editorEventCallback = () => api.setEnabled(shouldEnable());
|
|
198
|
+
editor.on('StoreDraft RestoreDraft RemoveDraft', editorEventCallback);
|
|
199
|
+
return () => editor.off('StoreDraft RestoreDraft RemoveDraft', editorEventCallback);
|
|
200
|
+
};
|
|
201
|
+
const register = (editor) => {
|
|
202
|
+
// TODO: This was moved from makeSetupHandler as it would only be called when the menu item was rendered?
|
|
203
|
+
// Is it safe to start this process when the plugin is registered?
|
|
204
|
+
startStoreDraft(editor);
|
|
205
|
+
const onAction = () => {
|
|
206
|
+
restoreLastDraft(editor);
|
|
207
|
+
};
|
|
208
|
+
editor.ui.registry.addButton('restoredraft', {
|
|
209
|
+
tooltip: 'Restore last draft',
|
|
210
|
+
icon: 'restore-draft',
|
|
211
|
+
onAction,
|
|
212
|
+
onSetup: makeSetupHandler(editor)
|
|
213
|
+
});
|
|
214
|
+
editor.ui.registry.addMenuItem('restoredraft', {
|
|
215
|
+
text: 'Restore last draft',
|
|
216
|
+
icon: 'restore-draft',
|
|
217
|
+
onAction,
|
|
218
|
+
onSetup: makeSetupHandler(editor)
|
|
219
|
+
});
|
|
220
|
+
};
|
|
221
|
+
|
|
222
|
+
/**
|
|
223
|
+
* This class contains all core logic for the autosave plugin.
|
|
224
|
+
*
|
|
225
|
+
* @class tinymce.autosave.Plugin
|
|
226
|
+
* @private
|
|
227
|
+
*/
|
|
228
|
+
var Plugin = () => {
|
|
229
|
+
global$4.add('autosave', (editor) => {
|
|
230
|
+
register$1(editor);
|
|
231
|
+
setup(editor);
|
|
232
|
+
register(editor);
|
|
233
|
+
editor.on('init', () => {
|
|
234
|
+
if (shouldRestoreWhenEmpty(editor) && editor.dom.isEmpty(editor.getBody())) {
|
|
235
|
+
restoreDraft(editor);
|
|
236
|
+
}
|
|
237
|
+
});
|
|
238
|
+
return get(editor);
|
|
239
|
+
});
|
|
240
|
+
};
|
|
241
|
+
|
|
242
|
+
Plugin();
|
|
243
|
+
/** *****
|
|
244
|
+
* DO NOT EXPORT ANYTHING
|
|
245
|
+
*
|
|
246
|
+
* IF YOU DO ROLLUP WILL LEAVE A GLOBAL ON THE PAGE
|
|
247
|
+
*******/
|
|
248
|
+
|
|
249
|
+
})();
|
|
@@ -0,0 +1 @@
|
|
|
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)||o.constructor?.name===a.name)?"string":e;var r,o,a})(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"),c=i("autosave_restore_when_empty"),l=i("autosave_interval"),m=i("autosave_retention"),d=t=>{const e=document.location;return t.options.get("autosave_prefix").replace(/{path}/g,e.pathname).replace(/{query}/g,e.search).replace(/{hash}/g,e.hash).replace(/{id}/g,t.id)},f=(t,e)=>{if(r(e))return t.dom.isEmpty(t.getBody());{const r=s.trim(e);if(""===r)return!0;{const e=(new DOMParser).parseFromString(r,"text/html");return t.dom.isEmpty(e)}}},v=t=>{const e=parseInt(a.getItem(d(t)+"time")??"0",10)||0;return!((new Date).getTime()-e>m(t)&&(p(t,!1),1))},p=(t,e)=>{const r=d(t);a.removeItem(r+"draft"),a.removeItem(r+"time"),!1!==e&&(t=>{t.dispatch("RemoveDraft")})(t)},y=t=>{const e=d(t);!f(t)&&t.isDirty()&&(a.setItem(e+"draft",t.getContent({format:"raw",no_events:!0})),a.setItem(e+"time",(new Date).getTime().toString()),(t=>{t.dispatch("StoreDraft")})(t))},g=t=>{const e=d(t);v(t)&&(t.setContent(a.getItem(e+"draft")??"",{format:"raw"}),(t=>{t.dispatch("RestoreDraft")})(t))};var D=tinymce.util.Tools.resolve("tinymce.EditorManager");const h=t=>e=>{const r=()=>v(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=l(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",()=>{c(t)&&t.dom.isEmpty(t.getBody())&&g(t)}),(t=>({hasDraft:()=>v(t),storeDraft:()=>y(t),restoreDraft:()=>g(t),removeDraft:e=>p(t,e),isEmpty:e=>f(t,e)}))(t)))}();
|