argous 1.2.202 → 1.2.204
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/dist/components/ConfirmModal/ModalProvider.d.ts +1 -1
- package/dist/components/Editor/Events.d.ts +9 -7
- package/dist/components/Editor/Events.js +0 -7
- package/dist/components/Editor/ScriptLoader2.d.ts +10 -0
- package/dist/components/Editor/ScriptLoader2.js +146 -0
- package/dist/components/Editor/TinyMCE.d.ts +1 -8
- package/dist/components/Editor/TinyMCE.js +2 -10
- package/dist/components/Editor/Utils.d.ts +2 -7
- package/dist/components/Editor/Utils.js +29 -9
- package/dist/components/Editor/components/Editor.d.ts +17 -16
- package/dist/components/Editor/components/Editor.js +94 -51
- package/dist/components/Editor/components/EditorPropTypes.d.ts +1 -8
- package/dist/components/Editor/components/EditorPropTypes.js +19 -9
- package/dist/components/Editor/index.d.ts +2 -9
- package/dist/components/Editor/index.js +0 -7
- package/dist/components/Editor/skins/content/dark/content.d.ts +0 -0
- package/dist/components/Editor/skins/content/dark/content.js +3 -0
- package/dist/components/Editor/skins/content/default/content.d.ts +0 -0
- package/dist/components/Editor/skins/content/default/content.js +3 -0
- package/dist/components/Editor/skins/content/document/content.d.ts +0 -0
- package/dist/components/Editor/skins/content/document/content.js +3 -0
- package/dist/components/Editor/skins/content/tinymce-5/content.d.ts +0 -0
- package/dist/components/Editor/skins/content/tinymce-5/content.js +3 -0
- package/dist/components/Editor/skins/content/tinymce-5-dark/content.d.ts +0 -0
- package/dist/components/Editor/skins/content/tinymce-5-dark/content.js +3 -0
- package/dist/components/Editor/skins/content/writer/content.d.ts +0 -0
- package/dist/components/Editor/skins/content/writer/content.js +3 -0
- package/dist/components/Editor/skins/ui/oxide/content.d.ts +0 -0
- package/dist/components/Editor/skins/ui/oxide/content.inline.d.ts +0 -0
- package/dist/components/Editor/skins/ui/oxide/content.inline.js +3 -0
- package/dist/components/Editor/skins/ui/oxide/content.js +3 -0
- package/dist/components/Editor/skins/ui/oxide/skin.d.ts +0 -0
- package/dist/components/Editor/skins/ui/oxide/skin.js +3 -0
- package/dist/components/Editor/skins/ui/oxide/skin.shadowdom.d.ts +0 -0
- package/dist/components/Editor/skins/ui/oxide/skin.shadowdom.js +3 -0
- package/dist/components/Editor/skins/ui/oxide-dark/content.d.ts +0 -0
- package/dist/components/Editor/skins/ui/oxide-dark/content.inline.d.ts +0 -0
- package/dist/components/Editor/skins/ui/oxide-dark/content.inline.js +3 -0
- package/dist/components/Editor/skins/ui/oxide-dark/content.js +3 -0
- package/dist/components/Editor/skins/ui/oxide-dark/skin.d.ts +0 -0
- package/dist/components/Editor/skins/ui/oxide-dark/skin.js +3 -0
- package/dist/components/Editor/skins/ui/oxide-dark/skin.shadowdom.d.ts +0 -0
- package/dist/components/Editor/skins/ui/oxide-dark/skin.shadowdom.js +3 -0
- package/dist/components/Editor/skins/ui/tinymce-5/content.d.ts +0 -0
- package/dist/components/Editor/skins/ui/tinymce-5/content.inline.d.ts +0 -0
- package/dist/components/Editor/skins/ui/tinymce-5/content.inline.js +3 -0
- package/dist/components/Editor/skins/ui/tinymce-5/content.js +3 -0
- package/dist/components/Editor/skins/ui/tinymce-5/skin.d.ts +0 -0
- package/dist/components/Editor/skins/ui/tinymce-5/skin.js +3 -0
- package/dist/components/Editor/skins/ui/tinymce-5/skin.shadowdom.d.ts +0 -0
- package/dist/components/Editor/skins/ui/tinymce-5/skin.shadowdom.js +3 -0
- package/dist/components/Editor/skins/ui/tinymce-5-dark/content.d.ts +0 -0
- package/dist/components/Editor/skins/ui/tinymce-5-dark/content.inline.d.ts +0 -0
- package/dist/components/Editor/skins/ui/tinymce-5-dark/content.inline.js +3 -0
- package/dist/components/Editor/skins/ui/tinymce-5-dark/content.js +3 -0
- package/dist/components/Editor/skins/ui/tinymce-5-dark/skin.d.ts +0 -0
- package/dist/components/Editor/skins/ui/tinymce-5-dark/skin.js +3 -0
- package/dist/components/Editor/skins/ui/tinymce-5-dark/skin.shadowdom.d.ts +0 -0
- package/dist/components/Editor/skins/ui/tinymce-5-dark/skin.shadowdom.js +3 -0
- package/dist/components/Editor/tinymce/tinymce.d.ts +1722 -1447
- package/lib/components/Editor/Events.ts +9 -8
- package/lib/components/Editor/ScriptLoader2.ts +161 -0
- package/lib/components/Editor/TinyMCE.ts +2 -12
- package/lib/components/Editor/Utils.ts +25 -8
- package/lib/components/Editor/components/Editor.tsx +102 -79
- package/lib/components/Editor/components/EditorPropTypes.ts +21 -12
- package/lib/components/Editor/index.tsx +2 -10
- package/lib/components/Editor/skins/content/dark/content.js +2 -0
- package/lib/components/Editor/skins/content/dark/content.min.css +1 -8
- package/lib/components/Editor/skins/content/default/content.js +2 -0
- package/lib/components/Editor/skins/content/default/content.min.css +0 -7
- package/lib/components/Editor/skins/content/document/content.js +2 -0
- package/lib/components/Editor/skins/content/document/content.min.css +0 -7
- package/lib/components/Editor/skins/content/tinymce-5/content.js +2 -0
- package/lib/components/Editor/skins/content/tinymce-5/content.min.css +1 -0
- package/lib/components/Editor/skins/content/tinymce-5-dark/content.js +2 -0
- package/lib/components/Editor/skins/content/tinymce-5-dark/content.min.css +1 -0
- package/lib/components/Editor/skins/content/writer/content.js +2 -0
- package/lib/components/Editor/skins/content/writer/content.min.css +0 -7
- package/lib/components/Editor/skins/ui/oxide/content.inline.js +2 -0
- package/lib/components/Editor/skins/ui/oxide/content.inline.min.css +1 -0
- package/lib/components/Editor/skins/ui/oxide/content.js +2 -0
- package/lib/components/Editor/skins/ui/oxide/content.min.css +1 -0
- package/lib/components/Editor/skins/ui/oxide/skin.js +2 -0
- package/lib/components/Editor/skins/ui/oxide/skin.min.css +1 -0
- package/lib/components/Editor/skins/ui/oxide/skin.shadowdom.js +2 -0
- package/lib/components/Editor/skins/ui/oxide/skin.shadowdom.min.css +1 -0
- package/lib/components/Editor/skins/ui/oxide-dark/content.inline.js +2 -0
- package/lib/components/Editor/skins/ui/oxide-dark/content.inline.min.css +1 -0
- package/lib/components/Editor/skins/ui/oxide-dark/content.js +2 -0
- package/lib/components/Editor/skins/ui/oxide-dark/content.min.css +1 -0
- package/lib/components/Editor/skins/ui/oxide-dark/skin.js +2 -0
- package/lib/components/Editor/skins/ui/oxide-dark/skin.min.css +1 -0
- package/lib/components/Editor/skins/ui/oxide-dark/skin.shadowdom.js +2 -0
- package/lib/components/Editor/skins/ui/oxide-dark/skin.shadowdom.min.css +1 -0
- package/lib/components/Editor/skins/ui/tinymce-5/content.inline.js +2 -0
- package/lib/components/Editor/skins/ui/tinymce-5/content.inline.min.css +1 -0
- package/lib/components/Editor/skins/ui/tinymce-5/content.js +2 -0
- package/lib/components/Editor/skins/ui/tinymce-5/content.min.css +1 -0
- package/lib/components/Editor/skins/ui/tinymce-5/skin.js +2 -0
- package/lib/components/Editor/skins/ui/tinymce-5/skin.min.css +1 -0
- package/lib/components/Editor/skins/ui/tinymce-5/skin.shadowdom.js +2 -0
- package/lib/components/Editor/skins/ui/tinymce-5/skin.shadowdom.min.css +1 -0
- package/lib/components/Editor/skins/ui/tinymce-5-dark/content.inline.js +2 -0
- package/lib/components/Editor/skins/ui/tinymce-5-dark/content.inline.min.css +1 -0
- package/lib/components/Editor/skins/ui/tinymce-5-dark/content.js +2 -0
- package/lib/components/Editor/skins/ui/tinymce-5-dark/content.min.css +1 -0
- package/lib/components/Editor/skins/ui/tinymce-5-dark/skin.js +2 -0
- package/lib/components/Editor/skins/ui/tinymce-5-dark/skin.min.css +1 -0
- package/lib/components/Editor/skins/ui/tinymce-5-dark/skin.shadowdom.js +2 -0
- package/lib/components/Editor/skins/ui/tinymce-5-dark/skin.shadowdom.min.css +1 -0
- package/lib/components/Editor/tinymce/README.md +24 -14
- package/lib/components/Editor/tinymce/icons/default/icons.js +185 -163
- package/lib/components/Editor/tinymce/icons/default/icons.min.js +1 -1
- package/lib/components/Editor/tinymce/langs/README.md +1 -1
- package/lib/components/Editor/tinymce/license.txt +21 -504
- package/lib/components/Editor/tinymce/models/dom/model.js +8040 -0
- package/lib/components/Editor/tinymce/models/dom/model.min.js +4 -0
- package/lib/components/Editor/tinymce/plugins/accordion/plugin.js +1054 -0
- package/lib/components/Editor/tinymce/plugins/accordion/plugin.min.js +4 -0
- package/lib/components/Editor/tinymce/plugins/advlist/plugin.js +187 -208
- package/lib/components/Editor/tinymce/plugins/advlist/plugin.min.js +2 -7
- package/lib/components/Editor/tinymce/plugins/anchor/plugin.js +82 -84
- package/lib/components/Editor/tinymce/plugins/anchor/plugin.min.js +2 -7
- package/lib/components/Editor/tinymce/plugins/autolink/plugin.js +210 -167
- package/lib/components/Editor/tinymce/plugins/autolink/plugin.min.js +2 -7
- package/lib/components/Editor/tinymce/plugins/autoresize/plugin.js +118 -97
- package/lib/components/Editor/tinymce/plugins/autoresize/plugin.min.js +2 -7
- package/lib/components/Editor/tinymce/plugins/autosave/plugin.js +129 -108
- package/lib/components/Editor/tinymce/plugins/autosave/plugin.min.js +2 -7
- package/lib/components/Editor/tinymce/plugins/charmap/plugin.js +285 -333
- package/lib/components/Editor/tinymce/plugins/charmap/plugin.min.js +2 -7
- package/lib/components/Editor/tinymce/plugins/code/plugin.js +19 -26
- package/lib/components/Editor/tinymce/plugins/code/plugin.min.js +2 -7
- package/lib/components/Editor/tinymce/plugins/codesample/plugin.js +2225 -2094
- package/lib/components/Editor/tinymce/plugins/codesample/plugin.min.js +2 -7
- package/lib/components/Editor/tinymce/plugins/directionality/plugin.js +318 -243
- package/lib/components/Editor/tinymce/plugins/directionality/plugin.min.js +2 -7
- package/lib/components/Editor/tinymce/plugins/emoticons/js/emojiimages.js +1 -9424
- package/lib/components/Editor/tinymce/plugins/emoticons/js/emojiimages.min.js +1 -1
- package/lib/components/Editor/tinymce/plugins/emoticons/js/emojis.js +1 -9423
- package/lib/components/Editor/tinymce/plugins/emoticons/js/emojis.min.js +1 -1
- package/lib/components/Editor/tinymce/plugins/emoticons/plugin.js +406 -416
- package/lib/components/Editor/tinymce/plugins/emoticons/plugin.min.js +2 -7
- package/lib/components/Editor/tinymce/plugins/fullscreen/plugin.js +821 -604
- package/lib/components/Editor/tinymce/plugins/fullscreen/plugin.min.js +2 -7
- package/lib/components/Editor/tinymce/plugins/help/js/i18n/keynav/ar.js +90 -0
- package/lib/components/Editor/tinymce/plugins/help/js/i18n/keynav/bg_BG.js +90 -0
- package/lib/components/Editor/tinymce/plugins/help/js/i18n/keynav/ca.js +90 -0
- package/lib/components/Editor/tinymce/plugins/help/js/i18n/keynav/cs.js +90 -0
- package/lib/components/Editor/tinymce/plugins/help/js/i18n/keynav/da.js +90 -0
- package/lib/components/Editor/tinymce/plugins/help/js/i18n/keynav/de.js +90 -0
- package/lib/components/Editor/tinymce/plugins/help/js/i18n/keynav/el.js +90 -0
- package/lib/components/Editor/tinymce/plugins/help/js/i18n/keynav/en.js +90 -0
- package/lib/components/Editor/tinymce/plugins/help/js/i18n/keynav/es.js +90 -0
- package/lib/components/Editor/tinymce/plugins/help/js/i18n/keynav/eu.js +90 -0
- package/lib/components/Editor/tinymce/plugins/help/js/i18n/keynav/fa.js +90 -0
- package/lib/components/Editor/tinymce/plugins/help/js/i18n/keynav/fi.js +90 -0
- package/lib/components/Editor/tinymce/plugins/help/js/i18n/keynav/fr_FR.js +90 -0
- package/lib/components/Editor/tinymce/plugins/help/js/i18n/keynav/he_IL.js +90 -0
- package/lib/components/Editor/tinymce/plugins/help/js/i18n/keynav/hi.js +90 -0
- package/lib/components/Editor/tinymce/plugins/help/js/i18n/keynav/hr.js +90 -0
- package/lib/components/Editor/tinymce/plugins/help/js/i18n/keynav/hu_HU.js +90 -0
- package/lib/components/Editor/tinymce/plugins/help/js/i18n/keynav/id.js +90 -0
- package/lib/components/Editor/tinymce/plugins/help/js/i18n/keynav/it.js +90 -0
- package/lib/components/Editor/tinymce/plugins/help/js/i18n/keynav/ja.js +90 -0
- package/lib/components/Editor/tinymce/plugins/help/js/i18n/keynav/kk.js +90 -0
- package/lib/components/Editor/tinymce/plugins/help/js/i18n/keynav/ko_KR.js +90 -0
- package/lib/components/Editor/tinymce/plugins/help/js/i18n/keynav/ms.js +90 -0
- package/lib/components/Editor/tinymce/plugins/help/js/i18n/keynav/nb_NO.js +90 -0
- package/lib/components/Editor/tinymce/plugins/help/js/i18n/keynav/nl.js +90 -0
- package/lib/components/Editor/tinymce/plugins/help/js/i18n/keynav/pl.js +90 -0
- package/lib/components/Editor/tinymce/plugins/help/js/i18n/keynav/pt_BR.js +90 -0
- package/lib/components/Editor/tinymce/plugins/help/js/i18n/keynav/pt_PT.js +90 -0
- package/lib/components/Editor/tinymce/plugins/help/js/i18n/keynav/ro.js +90 -0
- package/lib/components/Editor/tinymce/plugins/help/js/i18n/keynav/ru.js +90 -0
- package/lib/components/Editor/tinymce/plugins/help/js/i18n/keynav/sk.js +90 -0
- package/lib/components/Editor/tinymce/plugins/help/js/i18n/keynav/sl_SI.js +90 -0
- package/lib/components/Editor/tinymce/plugins/help/js/i18n/keynav/sv_SE.js +90 -0
- package/lib/components/Editor/tinymce/plugins/help/js/i18n/keynav/th_TH.js +90 -0
- package/lib/components/Editor/tinymce/plugins/help/js/i18n/keynav/tr.js +90 -0
- package/lib/components/Editor/tinymce/plugins/help/js/i18n/keynav/uk.js +90 -0
- package/lib/components/Editor/tinymce/plugins/help/js/i18n/keynav/vi.js +90 -0
- package/lib/components/Editor/tinymce/plugins/help/js/i18n/keynav/zh_CN.js +84 -0
- package/lib/components/Editor/tinymce/plugins/help/js/i18n/keynav/zh_TW.js +90 -0
- package/lib/components/Editor/tinymce/plugins/help/plugin.js +428 -403
- package/lib/components/Editor/tinymce/plugins/help/plugin.min.js +2 -7
- package/lib/components/Editor/tinymce/plugins/image/plugin.js +887 -1043
- package/lib/components/Editor/tinymce/plugins/image/plugin.min.js +2 -7
- package/lib/components/Editor/tinymce/plugins/importcss/plugin.js +163 -162
- package/lib/components/Editor/tinymce/plugins/importcss/plugin.min.js +2 -7
- package/lib/components/Editor/tinymce/plugins/insertdatetime/plugin.js +101 -91
- package/lib/components/Editor/tinymce/plugins/insertdatetime/plugin.min.js +2 -7
- package/lib/components/Editor/tinymce/plugins/link/plugin.js +739 -784
- package/lib/components/Editor/tinymce/plugins/link/plugin.min.js +2 -7
- package/lib/components/Editor/tinymce/plugins/lists/plugin.js +1282 -1396
- package/lib/components/Editor/tinymce/plugins/lists/plugin.min.js +2 -7
- package/lib/components/Editor/tinymce/plugins/media/plugin.js +641 -806
- package/lib/components/Editor/tinymce/plugins/media/plugin.min.js +2 -7
- package/lib/components/Editor/tinymce/plugins/nonbreaking/plugin.js +76 -54
- package/lib/components/Editor/tinymce/plugins/nonbreaking/plugin.min.js +2 -7
- package/lib/components/Editor/tinymce/plugins/pagebreak/plugin.js +58 -46
- package/lib/components/Editor/tinymce/plugins/pagebreak/plugin.min.js +2 -7
- package/lib/components/Editor/tinymce/plugins/preview/plugin.js +39 -69
- package/lib/components/Editor/tinymce/plugins/preview/plugin.min.js +2 -7
- package/lib/components/Editor/tinymce/plugins/quickbars/plugin.js +307 -349
- package/lib/components/Editor/tinymce/plugins/quickbars/plugin.min.js +2 -7
- package/lib/components/Editor/tinymce/plugins/save/plugin.js +50 -51
- package/lib/components/Editor/tinymce/plugins/save/plugin.min.js +2 -7
- package/lib/components/Editor/tinymce/plugins/searchreplace/plugin.js +517 -587
- package/lib/components/Editor/tinymce/plugins/searchreplace/plugin.min.js +2 -7
- package/lib/components/Editor/tinymce/plugins/table/plugin.js +2666 -10142
- package/lib/components/Editor/tinymce/plugins/table/plugin.min.js +2 -7
- package/lib/components/Editor/tinymce/plugins/template/plugin.js +403 -413
- package/lib/components/Editor/tinymce/plugins/template/plugin.min.js +2 -7
- package/lib/components/Editor/tinymce/plugins/visualblocks/plugin.js +42 -48
- package/lib/components/Editor/tinymce/plugins/visualblocks/plugin.min.js +2 -7
- package/lib/components/Editor/tinymce/plugins/visualchars/plugin.js +352 -333
- package/lib/components/Editor/tinymce/plugins/visualchars/plugin.min.js +2 -7
- package/lib/components/Editor/tinymce/plugins/wordcount/plugin.js +184 -195
- package/lib/components/Editor/tinymce/plugins/wordcount/plugin.min.js +2 -7
- package/lib/components/Editor/tinymce/skins/content/dark/content.css +2 -8
- package/lib/components/Editor/tinymce/skins/content/dark/content.js +2 -0
- package/lib/components/Editor/tinymce/skins/content/dark/content.js.map +1 -0
- package/lib/components/Editor/tinymce/skins/content/dark/content.min.css +2 -8
- package/lib/components/Editor/tinymce/skins/content/dark/content.min.css.map +1 -1
- package/lib/components/Editor/tinymce/skins/content/default/content.css +0 -6
- package/lib/components/Editor/tinymce/skins/content/default/content.js +2 -0
- package/lib/components/Editor/tinymce/skins/content/default/content.js.map +1 -0
- package/lib/components/Editor/tinymce/skins/content/default/content.min.css +1 -7
- package/lib/components/Editor/tinymce/skins/content/default/content.min.css.map +1 -1
- package/lib/components/Editor/tinymce/skins/content/document/content.css +0 -6
- package/lib/components/Editor/tinymce/skins/content/document/content.js +2 -0
- package/lib/components/Editor/tinymce/skins/content/document/content.js.map +1 -0
- package/lib/components/Editor/tinymce/skins/content/document/content.min.css +0 -6
- package/lib/components/Editor/tinymce/skins/content/document/content.min.css.map +1 -1
- package/lib/components/Editor/{skins/content/default → tinymce/skins/content/tinymce-5}/content.css +0 -6
- package/lib/components/Editor/tinymce/skins/content/tinymce-5/content.js +2 -0
- package/lib/components/Editor/tinymce/skins/content/tinymce-5/content.js.map +1 -0
- package/lib/components/Editor/tinymce/skins/content/tinymce-5/content.min.css +2 -0
- package/lib/components/Editor/tinymce/skins/content/tinymce-5/content.min.css.map +1 -0
- package/lib/components/Editor/{skins/content/dark → tinymce/skins/content/tinymce-5-dark}/content.css +1 -7
- package/lib/components/Editor/tinymce/skins/content/tinymce-5-dark/content.js +2 -0
- package/lib/components/Editor/tinymce/skins/content/tinymce-5-dark/content.js.map +1 -0
- package/lib/components/Editor/tinymce/skins/content/tinymce-5-dark/content.min.css +2 -0
- package/lib/components/Editor/tinymce/skins/content/tinymce-5-dark/content.min.css.map +1 -0
- package/lib/components/Editor/tinymce/skins/content/writer/content.css +0 -6
- package/lib/components/Editor/tinymce/skins/content/writer/content.js +2 -0
- package/lib/components/Editor/tinymce/skins/content/writer/content.js.map +1 -0
- package/lib/components/Editor/tinymce/skins/content/writer/content.min.css +0 -6
- package/lib/components/Editor/tinymce/skins/content/writer/content.min.css.map +1 -1
- package/lib/components/Editor/tinymce/skins/ui/oxide/content.css +74 -21
- package/lib/components/Editor/tinymce/skins/ui/oxide/content.inline.css +74 -21
- package/lib/components/Editor/tinymce/skins/ui/oxide/content.inline.js +2 -0
- package/lib/components/Editor/tinymce/skins/ui/oxide/content.inline.js.map +1 -0
- package/lib/components/Editor/tinymce/skins/ui/oxide/content.inline.min.css +1 -7
- package/lib/components/Editor/tinymce/skins/ui/oxide/content.inline.min.css.map +1 -1
- package/lib/components/Editor/tinymce/skins/ui/oxide/content.js +2 -0
- package/lib/components/Editor/tinymce/skins/ui/oxide/content.js.map +1 -0
- package/lib/components/Editor/tinymce/skins/ui/oxide/content.min.css +1 -7
- package/lib/components/Editor/tinymce/skins/ui/oxide/content.min.css.map +1 -1
- package/lib/components/Editor/tinymce/skins/ui/oxide/skin.css +1131 -402
- package/lib/components/Editor/tinymce/skins/ui/oxide/skin.js +2 -0
- package/lib/components/Editor/tinymce/skins/ui/oxide/skin.js.map +1 -0
- package/lib/components/Editor/tinymce/skins/ui/oxide/skin.min.css +1 -7
- package/lib/components/Editor/tinymce/skins/ui/oxide/skin.min.css.map +1 -1
- package/lib/components/Editor/tinymce/skins/ui/oxide/skin.shadowdom.css +8 -15
- package/lib/components/Editor/tinymce/skins/ui/oxide/skin.shadowdom.js +2 -0
- package/lib/components/Editor/tinymce/skins/ui/oxide/skin.shadowdom.js.map +1 -0
- package/lib/components/Editor/tinymce/skins/ui/oxide/skin.shadowdom.min.css +1 -7
- package/lib/components/Editor/tinymce/skins/ui/oxide/skin.shadowdom.min.css.map +1 -1
- package/lib/components/Editor/tinymce/skins/ui/oxide-dark/content.css +72 -20
- package/lib/components/Editor/tinymce/skins/ui/oxide-dark/content.inline.css +74 -21
- package/lib/components/Editor/tinymce/skins/ui/oxide-dark/content.inline.js +2 -0
- package/lib/components/Editor/tinymce/skins/ui/oxide-dark/content.inline.js.map +1 -0
- package/lib/components/Editor/tinymce/skins/ui/oxide-dark/content.inline.min.css +1 -7
- package/lib/components/Editor/tinymce/skins/ui/oxide-dark/content.inline.min.css.map +1 -1
- package/lib/components/Editor/tinymce/skins/ui/oxide-dark/content.js +2 -0
- package/lib/components/Editor/tinymce/skins/ui/oxide-dark/content.js.map +1 -0
- package/lib/components/Editor/tinymce/skins/ui/oxide-dark/content.min.css +1 -7
- package/lib/components/Editor/tinymce/skins/ui/oxide-dark/content.min.css.map +1 -1
- package/lib/components/Editor/tinymce/skins/ui/oxide-dark/skin.css +1155 -423
- package/lib/components/Editor/tinymce/skins/ui/oxide-dark/skin.js +2 -0
- package/lib/components/Editor/tinymce/skins/ui/oxide-dark/skin.js.map +1 -0
- package/lib/components/Editor/tinymce/skins/ui/oxide-dark/skin.min.css +1 -7
- package/lib/components/Editor/tinymce/skins/ui/oxide-dark/skin.min.css.map +1 -1
- package/lib/components/Editor/tinymce/skins/ui/oxide-dark/skin.shadowdom.css +8 -15
- package/lib/components/Editor/tinymce/skins/ui/oxide-dark/skin.shadowdom.js +2 -0
- package/lib/components/Editor/tinymce/skins/ui/oxide-dark/skin.shadowdom.js.map +1 -0
- package/lib/components/Editor/tinymce/skins/ui/oxide-dark/skin.shadowdom.min.css +1 -7
- package/lib/components/Editor/tinymce/skins/ui/oxide-dark/skin.shadowdom.min.css.map +1 -1
- package/lib/components/Editor/{skins/ui/default → tinymce/skins/ui/tinymce-5}/content.css +75 -22
- package/lib/components/Editor/{skins/ui/default → tinymce/skins/ui/tinymce-5}/content.inline.css +75 -22
- package/lib/components/Editor/tinymce/skins/ui/tinymce-5/content.inline.js +2 -0
- package/lib/components/Editor/tinymce/skins/ui/tinymce-5/content.inline.js.map +1 -0
- package/lib/components/Editor/tinymce/skins/ui/tinymce-5/content.inline.min.css +2 -0
- package/lib/components/Editor/tinymce/skins/ui/tinymce-5/content.inline.min.css.map +1 -0
- package/lib/components/Editor/tinymce/skins/ui/tinymce-5/content.js +2 -0
- package/lib/components/Editor/tinymce/skins/ui/tinymce-5/content.js.map +1 -0
- package/lib/components/Editor/tinymce/skins/ui/tinymce-5/content.min.css +2 -0
- package/lib/components/Editor/tinymce/skins/ui/tinymce-5/content.min.css.map +1 -0
- package/lib/components/Editor/{skins/ui/default → tinymce/skins/ui/tinymce-5}/skin.css +1261 -438
- package/lib/components/Editor/tinymce/skins/ui/tinymce-5/skin.js +2 -0
- package/lib/components/Editor/tinymce/skins/ui/tinymce-5/skin.js.map +1 -0
- package/lib/components/Editor/tinymce/skins/ui/tinymce-5/skin.min.css +2 -0
- package/lib/components/Editor/tinymce/skins/ui/tinymce-5/skin.min.css.map +1 -0
- package/lib/components/Editor/{skins/ui/default → tinymce/skins/ui/tinymce-5}/skin.shadowdom.css +8 -15
- package/lib/components/Editor/tinymce/skins/ui/tinymce-5/skin.shadowdom.js +2 -0
- package/lib/components/Editor/tinymce/skins/ui/tinymce-5/skin.shadowdom.js.map +1 -0
- package/lib/components/Editor/tinymce/skins/ui/tinymce-5/skin.shadowdom.min.css +2 -0
- package/lib/components/Editor/tinymce/skins/ui/tinymce-5/skin.shadowdom.min.css.map +1 -0
- package/lib/components/Editor/{skins/ui/dark → tinymce/skins/ui/tinymce-5-dark}/content.css +73 -21
- package/lib/components/Editor/{skins/ui/dark → tinymce/skins/ui/tinymce-5-dark}/content.inline.css +75 -22
- package/lib/components/Editor/tinymce/skins/ui/tinymce-5-dark/content.inline.js +2 -0
- package/lib/components/Editor/tinymce/skins/ui/tinymce-5-dark/content.inline.js.map +1 -0
- package/lib/components/Editor/tinymce/skins/ui/tinymce-5-dark/content.inline.min.css +2 -0
- package/lib/components/Editor/tinymce/skins/ui/tinymce-5-dark/content.inline.min.css.map +1 -0
- package/lib/components/Editor/tinymce/skins/ui/tinymce-5-dark/content.js +2 -0
- package/lib/components/Editor/tinymce/skins/ui/tinymce-5-dark/content.js.map +1 -0
- package/lib/components/Editor/tinymce/skins/ui/tinymce-5-dark/content.min.css +2 -0
- package/lib/components/Editor/tinymce/skins/ui/tinymce-5-dark/content.min.css.map +1 -0
- package/lib/components/Editor/{skins/ui/dark → tinymce/skins/ui/tinymce-5-dark}/skin.css +1244 -421
- package/lib/components/Editor/tinymce/skins/ui/tinymce-5-dark/skin.js +2 -0
- package/lib/components/Editor/tinymce/skins/ui/tinymce-5-dark/skin.js.map +1 -0
- package/lib/components/Editor/tinymce/skins/ui/tinymce-5-dark/skin.min.css +2 -0
- package/lib/components/Editor/tinymce/skins/ui/tinymce-5-dark/skin.min.css.map +1 -0
- package/lib/components/Editor/{skins/ui/dark → tinymce/skins/ui/tinymce-5-dark}/skin.shadowdom.css +8 -15
- package/lib/components/Editor/tinymce/skins/ui/tinymce-5-dark/skin.shadowdom.js +2 -0
- package/lib/components/Editor/tinymce/skins/ui/tinymce-5-dark/skin.shadowdom.js.map +1 -0
- package/lib/components/Editor/tinymce/skins/ui/tinymce-5-dark/skin.shadowdom.min.css +2 -0
- package/lib/components/Editor/tinymce/skins/ui/tinymce-5-dark/skin.shadowdom.min.css.map +1 -0
- package/lib/components/Editor/tinymce/themes/silver/theme.js +23228 -24955
- package/lib/components/Editor/tinymce/themes/silver/theme.min.js +2 -7
- package/lib/components/Editor/tinymce/tinymce.d.ts +1722 -1447
- package/lib/components/Editor/tinymce/tinymce.js +23668 -22018
- package/lib/components/Editor/tinymce/tinymce.min.js +2 -30104
- package/package.json +1 -1
- package/lib/components/Editor/ScriptLoader.ts +0 -96
- package/lib/components/Editor/skins/content/dark/content.min.css.map +0 -1
- package/lib/components/Editor/skins/content/default/content.min.css.map +0 -1
- package/lib/components/Editor/skins/content/document/content.css +0 -72
- package/lib/components/Editor/skins/content/document/content.min.css.map +0 -1
- package/lib/components/Editor/skins/content/writer/content.css +0 -68
- package/lib/components/Editor/skins/content/writer/content.min.css.map +0 -1
- package/lib/components/Editor/skins/ui/dark/content.inline.min.css +0 -8
- package/lib/components/Editor/skins/ui/dark/content.inline.min.css.map +0 -1
- package/lib/components/Editor/skins/ui/dark/content.min.css +0 -8
- package/lib/components/Editor/skins/ui/dark/content.min.css.map +0 -1
- package/lib/components/Editor/skins/ui/dark/content.mobile.css +0 -29
- package/lib/components/Editor/skins/ui/dark/content.mobile.min.css +0 -8
- package/lib/components/Editor/skins/ui/dark/content.mobile.min.css.map +0 -1
- package/lib/components/Editor/skins/ui/dark/fonts/tinymce-mobile.woff +0 -0
- package/lib/components/Editor/skins/ui/dark/skin.min.css +0 -8
- package/lib/components/Editor/skins/ui/dark/skin.min.css.map +0 -1
- package/lib/components/Editor/skins/ui/dark/skin.mobile.css +0 -673
- package/lib/components/Editor/skins/ui/dark/skin.mobile.min.css +0 -8
- package/lib/components/Editor/skins/ui/dark/skin.mobile.min.css.map +0 -1
- package/lib/components/Editor/skins/ui/dark/skin.shadowdom.min.css +0 -8
- package/lib/components/Editor/skins/ui/dark/skin.shadowdom.min.css.map +0 -1
- package/lib/components/Editor/skins/ui/default/content.inline.min.css +0 -8
- package/lib/components/Editor/skins/ui/default/content.inline.min.css.map +0 -1
- package/lib/components/Editor/skins/ui/default/content.min.css +0 -8
- package/lib/components/Editor/skins/ui/default/content.min.css.map +0 -1
- package/lib/components/Editor/skins/ui/default/content.mobile.css +0 -29
- package/lib/components/Editor/skins/ui/default/content.mobile.min.css +0 -8
- package/lib/components/Editor/skins/ui/default/content.mobile.min.css.map +0 -1
- package/lib/components/Editor/skins/ui/default/fonts/tinymce-mobile.woff +0 -0
- package/lib/components/Editor/skins/ui/default/skin.min.css +0 -8
- package/lib/components/Editor/skins/ui/default/skin.min.css.map +0 -1
- package/lib/components/Editor/skins/ui/default/skin.mobile.css +0 -673
- package/lib/components/Editor/skins/ui/default/skin.mobile.min.css +0 -8
- package/lib/components/Editor/skins/ui/default/skin.mobile.min.css.map +0 -1
- package/lib/components/Editor/skins/ui/default/skin.shadowdom.min.css +0 -8
- package/lib/components/Editor/skins/ui/default/skin.shadowdom.min.css.map +0 -1
- package/lib/components/Editor/skins/ui/plugin-tinycomments-tinymce4/fonts/tinymce-mobile.woff +0 -0
- package/lib/components/Editor/skins/ui/plugin-tinycomments-tinymce4/plugin-tinycomments-tinymce4.css +0 -1641
- package/lib/components/Editor/skins/ui/plugin-tinycomments-tinymce4/plugin-tinycomments-tinymce4.min.css +0 -8
- package/lib/components/Editor/skins/ui/plugin-tinycomments-tinymce4/plugin-tinycomments-tinymce4.min.css.map +0 -1
- package/lib/components/Editor/tinymce/jquery.tinymce.min.js +0 -92
- package/lib/components/Editor/tinymce/langs/pt_BR.js +0 -419
- package/lib/components/Editor/tinymce/plugins/bbcode/plugin.js +0 -99
- package/lib/components/Editor/tinymce/plugins/bbcode/plugin.min.js +0 -9
- package/lib/components/Editor/tinymce/plugins/colorpicker/plugin.js +0 -22
- package/lib/components/Editor/tinymce/plugins/colorpicker/plugin.min.js +0 -9
- package/lib/components/Editor/tinymce/plugins/contextmenu/plugin.js +0 -22
- package/lib/components/Editor/tinymce/plugins/contextmenu/plugin.min.js +0 -9
- package/lib/components/Editor/tinymce/plugins/fullpage/plugin.js +0 -544
- package/lib/components/Editor/tinymce/plugins/fullpage/plugin.min.js +0 -9
- package/lib/components/Editor/tinymce/plugins/hr/plugin.js +0 -46
- package/lib/components/Editor/tinymce/plugins/hr/plugin.min.js +0 -9
- package/lib/components/Editor/tinymce/plugins/imagetools/plugin.js +0 -1354
- package/lib/components/Editor/tinymce/plugins/imagetools/plugin.min.js +0 -9
- package/lib/components/Editor/tinymce/plugins/legacyoutput/plugin.js +0 -199
- package/lib/components/Editor/tinymce/plugins/legacyoutput/plugin.min.js +0 -9
- package/lib/components/Editor/tinymce/plugins/noneditable/plugin.js +0 -117
- package/lib/components/Editor/tinymce/plugins/noneditable/plugin.min.js +0 -9
- package/lib/components/Editor/tinymce/plugins/paste/plugin.js +0 -1764
- package/lib/components/Editor/tinymce/plugins/paste/plugin.min.js +0 -9
- package/lib/components/Editor/tinymce/plugins/print/plugin.js +0 -53
- package/lib/components/Editor/tinymce/plugins/print/plugin.min.js +0 -9
- package/lib/components/Editor/tinymce/plugins/spellchecker/plugin.js +0 -731
- package/lib/components/Editor/tinymce/plugins/spellchecker/plugin.min.js +0 -9
- package/lib/components/Editor/tinymce/plugins/tabfocus/plugin.js +0 -129
- package/lib/components/Editor/tinymce/plugins/tabfocus/plugin.min.js +0 -9
- package/lib/components/Editor/tinymce/plugins/textcolor/plugin.js +0 -22
- package/lib/components/Editor/tinymce/plugins/textcolor/plugin.min.js +0 -9
- package/lib/components/Editor/tinymce/plugins/textpattern/plugin.js +0 -1394
- package/lib/components/Editor/tinymce/plugins/textpattern/plugin.min.js +0 -9
- package/lib/components/Editor/tinymce/plugins/toc/plugin.js +0 -236
- package/lib/components/Editor/tinymce/plugins/toc/plugin.min.js +0 -9
- package/lib/components/Editor/tinymce/skins/ui/oxide/content.mobile.css +0 -29
- package/lib/components/Editor/tinymce/skins/ui/oxide/content.mobile.min.css +0 -8
- package/lib/components/Editor/tinymce/skins/ui/oxide/content.mobile.min.css.map +0 -1
- package/lib/components/Editor/tinymce/skins/ui/oxide/fonts/tinymce-mobile.woff +0 -0
- package/lib/components/Editor/tinymce/skins/ui/oxide/skin.mobile.css +0 -673
- package/lib/components/Editor/tinymce/skins/ui/oxide/skin.mobile.min.css +0 -8
- package/lib/components/Editor/tinymce/skins/ui/oxide/skin.mobile.min.css.map +0 -1
- package/lib/components/Editor/tinymce/skins/ui/oxide-dark/content.mobile.css +0 -29
- package/lib/components/Editor/tinymce/skins/ui/oxide-dark/content.mobile.min.css +0 -8
- package/lib/components/Editor/tinymce/skins/ui/oxide-dark/content.mobile.min.css.map +0 -1
- package/lib/components/Editor/tinymce/skins/ui/oxide-dark/fonts/tinymce-mobile.woff +0 -0
- package/lib/components/Editor/tinymce/skins/ui/oxide-dark/skin.mobile.css +0 -673
- package/lib/components/Editor/tinymce/skins/ui/oxide-dark/skin.mobile.min.css +0 -8
- package/lib/components/Editor/tinymce/skins/ui/oxide-dark/skin.mobile.min.css.map +0 -1
- package/lib/components/Editor/tinymce/themes/mobile/theme.js +0 -13587
- package/lib/components/Editor/tinymce/themes/mobile/theme.min.js +0 -9
|
@@ -1,223 +1,185 @@
|
|
|
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.9.0 (TBD)
|
|
2
|
+
* TinyMCE version 6.8.2 (2023-12-11)
|
|
8
3
|
*/
|
|
4
|
+
|
|
9
5
|
(function () {
|
|
10
6
|
'use strict';
|
|
11
7
|
|
|
12
|
-
var global = tinymce.util.Tools.resolve('tinymce.PluginManager');
|
|
8
|
+
var global$4 = tinymce.util.Tools.resolve('tinymce.PluginManager');
|
|
13
9
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
return t;
|
|
23
|
-
};
|
|
24
|
-
return __assign.apply(this, arguments);
|
|
10
|
+
const getPrototypeOf = Object.getPrototypeOf;
|
|
11
|
+
const hasProto = (v, constructor, predicate) => {
|
|
12
|
+
var _a;
|
|
13
|
+
if (predicate(v, constructor.prototype)) {
|
|
14
|
+
return true;
|
|
15
|
+
} else {
|
|
16
|
+
return ((_a = v.constructor) === null || _a === void 0 ? void 0 : _a.name) === constructor.name;
|
|
17
|
+
}
|
|
25
18
|
};
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
var t = typeof x;
|
|
19
|
+
const typeOf = x => {
|
|
20
|
+
const t = typeof x;
|
|
29
21
|
if (x === null) {
|
|
30
22
|
return 'null';
|
|
31
|
-
} else if (t === 'object' &&
|
|
23
|
+
} else if (t === 'object' && Array.isArray(x)) {
|
|
32
24
|
return 'array';
|
|
33
|
-
} else if (t === 'object' && (String
|
|
25
|
+
} else if (t === 'object' && hasProto(x, String, (o, proto) => proto.isPrototypeOf(o))) {
|
|
34
26
|
return 'string';
|
|
35
27
|
} else {
|
|
36
28
|
return t;
|
|
37
29
|
}
|
|
38
30
|
};
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
return !isNullable(a);
|
|
31
|
+
const isType = type => value => typeOf(value) === type;
|
|
32
|
+
const isSimpleType = type => value => typeof value === type;
|
|
33
|
+
const eq = t => a => t === a;
|
|
34
|
+
const is = (value, constructor) => isObject(value) && hasProto(value, constructor, (o, proto) => getPrototypeOf(o) === proto);
|
|
35
|
+
const isString = isType('string');
|
|
36
|
+
const isObject = isType('object');
|
|
37
|
+
const isPlainObject = value => is(value, Object);
|
|
38
|
+
const isArray = isType('array');
|
|
39
|
+
const isNull = eq(null);
|
|
40
|
+
const isBoolean = isSimpleType('boolean');
|
|
41
|
+
const isNullable = a => a === null || a === undefined;
|
|
42
|
+
const isNonNullable = a => !isNullable(a);
|
|
43
|
+
const isFunction = isSimpleType('function');
|
|
44
|
+
const isNumber = isSimpleType('number');
|
|
45
|
+
const isArrayOf = (value, pred) => {
|
|
46
|
+
if (isArray(value)) {
|
|
47
|
+
for (let i = 0, len = value.length; i < len; ++i) {
|
|
48
|
+
if (!pred(value[i])) {
|
|
49
|
+
return false;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
return true;
|
|
53
|
+
}
|
|
54
|
+
return false;
|
|
64
55
|
};
|
|
65
|
-
var isNumber = isSimpleType('number');
|
|
66
56
|
|
|
67
|
-
|
|
68
|
-
};
|
|
69
|
-
var constant = function (value) {
|
|
70
|
-
return function () {
|
|
71
|
-
return value;
|
|
72
|
-
};
|
|
57
|
+
const noop = () => {
|
|
73
58
|
};
|
|
74
|
-
var never = constant(false);
|
|
75
|
-
var always = constant(true);
|
|
76
59
|
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
return
|
|
93
|
-
},
|
|
94
|
-
is: never,
|
|
95
|
-
isSome: never,
|
|
96
|
-
isNone: always,
|
|
97
|
-
getOr: id,
|
|
98
|
-
getOrThunk: call,
|
|
99
|
-
getOrDie: function (msg) {
|
|
100
|
-
throw new Error(msg || 'error: getOrDie called on none.');
|
|
101
|
-
},
|
|
102
|
-
getOrNull: constant(null),
|
|
103
|
-
getOrUndefined: constant(undefined),
|
|
104
|
-
or: id,
|
|
105
|
-
orThunk: call,
|
|
106
|
-
map: none,
|
|
107
|
-
each: noop,
|
|
108
|
-
bind: none,
|
|
109
|
-
exists: never,
|
|
110
|
-
forall: always,
|
|
111
|
-
filter: none,
|
|
112
|
-
equals: eq,
|
|
113
|
-
equals_: eq,
|
|
114
|
-
toArray: function () {
|
|
115
|
-
return [];
|
|
116
|
-
},
|
|
117
|
-
toString: constant('none()')
|
|
118
|
-
};
|
|
119
|
-
return me;
|
|
120
|
-
}();
|
|
121
|
-
var some = function (a) {
|
|
122
|
-
var constant_a = constant(a);
|
|
123
|
-
var self = function () {
|
|
124
|
-
return me;
|
|
125
|
-
};
|
|
126
|
-
var bind = function (f) {
|
|
127
|
-
return f(a);
|
|
128
|
-
};
|
|
129
|
-
var me = {
|
|
130
|
-
fold: function (n, s) {
|
|
131
|
-
return s(a);
|
|
132
|
-
},
|
|
133
|
-
is: function (v) {
|
|
134
|
-
return a === v;
|
|
135
|
-
},
|
|
136
|
-
isSome: always,
|
|
137
|
-
isNone: never,
|
|
138
|
-
getOr: constant_a,
|
|
139
|
-
getOrThunk: constant_a,
|
|
140
|
-
getOrDie: constant_a,
|
|
141
|
-
getOrNull: constant_a,
|
|
142
|
-
getOrUndefined: constant_a,
|
|
143
|
-
or: self,
|
|
144
|
-
orThunk: self,
|
|
145
|
-
map: function (f) {
|
|
146
|
-
return some(f(a));
|
|
147
|
-
},
|
|
148
|
-
each: function (f) {
|
|
149
|
-
f(a);
|
|
150
|
-
},
|
|
151
|
-
bind: bind,
|
|
152
|
-
exists: bind,
|
|
153
|
-
forall: bind,
|
|
154
|
-
filter: function (f) {
|
|
155
|
-
return f(a) ? me : NONE;
|
|
156
|
-
},
|
|
157
|
-
toArray: function () {
|
|
158
|
-
return [a];
|
|
159
|
-
},
|
|
160
|
-
toString: function () {
|
|
161
|
-
return 'some(' + a + ')';
|
|
162
|
-
},
|
|
163
|
-
equals: function (o) {
|
|
164
|
-
return o.is(a);
|
|
165
|
-
},
|
|
166
|
-
equals_: function (o, elementEq) {
|
|
167
|
-
return o.fold(never, function (b) {
|
|
168
|
-
return elementEq(a, b);
|
|
169
|
-
});
|
|
60
|
+
class Optional {
|
|
61
|
+
constructor(tag, value) {
|
|
62
|
+
this.tag = tag;
|
|
63
|
+
this.value = value;
|
|
64
|
+
}
|
|
65
|
+
static some(value) {
|
|
66
|
+
return new Optional(true, value);
|
|
67
|
+
}
|
|
68
|
+
static none() {
|
|
69
|
+
return Optional.singletonNone;
|
|
70
|
+
}
|
|
71
|
+
fold(onNone, onSome) {
|
|
72
|
+
if (this.tag) {
|
|
73
|
+
return onSome(this.value);
|
|
74
|
+
} else {
|
|
75
|
+
return onNone();
|
|
170
76
|
}
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
77
|
+
}
|
|
78
|
+
isSome() {
|
|
79
|
+
return this.tag;
|
|
80
|
+
}
|
|
81
|
+
isNone() {
|
|
82
|
+
return !this.tag;
|
|
83
|
+
}
|
|
84
|
+
map(mapper) {
|
|
85
|
+
if (this.tag) {
|
|
86
|
+
return Optional.some(mapper(this.value));
|
|
87
|
+
} else {
|
|
88
|
+
return Optional.none();
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
bind(binder) {
|
|
92
|
+
if (this.tag) {
|
|
93
|
+
return binder(this.value);
|
|
94
|
+
} else {
|
|
95
|
+
return Optional.none();
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
exists(predicate) {
|
|
99
|
+
return this.tag && predicate(this.value);
|
|
100
|
+
}
|
|
101
|
+
forall(predicate) {
|
|
102
|
+
return !this.tag || predicate(this.value);
|
|
103
|
+
}
|
|
104
|
+
filter(predicate) {
|
|
105
|
+
if (!this.tag || predicate(this.value)) {
|
|
106
|
+
return this;
|
|
107
|
+
} else {
|
|
108
|
+
return Optional.none();
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
getOr(replacement) {
|
|
112
|
+
return this.tag ? this.value : replacement;
|
|
113
|
+
}
|
|
114
|
+
or(replacement) {
|
|
115
|
+
return this.tag ? this : replacement;
|
|
116
|
+
}
|
|
117
|
+
getOrThunk(thunk) {
|
|
118
|
+
return this.tag ? this.value : thunk();
|
|
119
|
+
}
|
|
120
|
+
orThunk(thunk) {
|
|
121
|
+
return this.tag ? this : thunk();
|
|
122
|
+
}
|
|
123
|
+
getOrDie(message) {
|
|
124
|
+
if (!this.tag) {
|
|
125
|
+
throw new Error(message !== null && message !== void 0 ? message : 'Called getOrDie on None');
|
|
126
|
+
} else {
|
|
127
|
+
return this.value;
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
static from(value) {
|
|
131
|
+
return isNonNullable(value) ? Optional.some(value) : Optional.none();
|
|
132
|
+
}
|
|
133
|
+
getOrNull() {
|
|
134
|
+
return this.tag ? this.value : null;
|
|
135
|
+
}
|
|
136
|
+
getOrUndefined() {
|
|
137
|
+
return this.value;
|
|
138
|
+
}
|
|
139
|
+
each(worker) {
|
|
140
|
+
if (this.tag) {
|
|
141
|
+
worker(this.value);
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
toArray() {
|
|
145
|
+
return this.tag ? [this.value] : [];
|
|
146
|
+
}
|
|
147
|
+
toString() {
|
|
148
|
+
return this.tag ? `some(${ this.value })` : 'none()';
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
Optional.singletonNone = new Optional(false);
|
|
182
152
|
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
for (
|
|
188
|
-
|
|
189
|
-
|
|
153
|
+
const keys = Object.keys;
|
|
154
|
+
const hasOwnProperty = Object.hasOwnProperty;
|
|
155
|
+
const each = (obj, f) => {
|
|
156
|
+
const props = keys(obj);
|
|
157
|
+
for (let k = 0, len = props.length; k < len; k++) {
|
|
158
|
+
const i = props[k];
|
|
159
|
+
const x = obj[i];
|
|
190
160
|
f(x, i);
|
|
191
161
|
}
|
|
192
162
|
};
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
r[i] = x;
|
|
196
|
-
};
|
|
163
|
+
const objAcc = r => (x, i) => {
|
|
164
|
+
r[i] = x;
|
|
197
165
|
};
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
each(obj, function (x, i) {
|
|
166
|
+
const internalFilter = (obj, pred, onTrue, onFalse) => {
|
|
167
|
+
each(obj, (x, i) => {
|
|
201
168
|
(pred(x, i) ? onTrue : onFalse)(x, i);
|
|
202
169
|
});
|
|
203
|
-
return r;
|
|
204
170
|
};
|
|
205
|
-
|
|
206
|
-
|
|
171
|
+
const filter = (obj, pred) => {
|
|
172
|
+
const t = {};
|
|
207
173
|
internalFilter(obj, pred, objAcc(t), noop);
|
|
208
174
|
return t;
|
|
209
175
|
};
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
};
|
|
213
|
-
var hasNonNullableKey = function (obj, key) {
|
|
214
|
-
return has(obj, key) && obj[key] !== undefined && obj[key] !== null;
|
|
215
|
-
};
|
|
176
|
+
const has = (obj, key) => hasOwnProperty.call(obj, key);
|
|
177
|
+
const hasNonNullableKey = (obj, key) => has(obj, key) && obj[key] !== undefined && obj[key] !== null;
|
|
216
178
|
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
for (
|
|
179
|
+
const nativePush = Array.prototype.push;
|
|
180
|
+
const flatten = xs => {
|
|
181
|
+
const r = [];
|
|
182
|
+
for (let i = 0, len = xs.length; i < len; ++i) {
|
|
221
183
|
if (!isArray(xs[i])) {
|
|
222
184
|
throw new Error('Arr.flatten item ' + i + ' was not an array, input: ' + xs);
|
|
223
185
|
}
|
|
@@ -225,15 +187,11 @@
|
|
|
225
187
|
}
|
|
226
188
|
return r;
|
|
227
189
|
};
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
};
|
|
234
|
-
var findMap = function (arr, f) {
|
|
235
|
-
for (var i = 0; i < arr.length; i++) {
|
|
236
|
-
var r = f(arr[i], i);
|
|
190
|
+
const get = (xs, i) => i >= 0 && i < xs.length ? Optional.some(xs[i]) : Optional.none();
|
|
191
|
+
const head = xs => get(xs, 0);
|
|
192
|
+
const findMap = (arr, f) => {
|
|
193
|
+
for (let i = 0; i < arr.length; i++) {
|
|
194
|
+
const r = f(arr[i], i);
|
|
237
195
|
if (r.isSome()) {
|
|
238
196
|
return r;
|
|
239
197
|
}
|
|
@@ -241,9 +199,9 @@
|
|
|
241
199
|
return Optional.none();
|
|
242
200
|
};
|
|
243
201
|
|
|
244
|
-
|
|
202
|
+
typeof window !== 'undefined' ? window : Function('return this;')();
|
|
245
203
|
|
|
246
|
-
|
|
204
|
+
const rawSet = (dom, key, value) => {
|
|
247
205
|
if (isString(value) || isBoolean(value) || isNumber(value)) {
|
|
248
206
|
dom.setAttribute(key, value + '');
|
|
249
207
|
} else {
|
|
@@ -251,144 +209,160 @@
|
|
|
251
209
|
throw new Error('Attribute value was not simple');
|
|
252
210
|
}
|
|
253
211
|
};
|
|
254
|
-
|
|
212
|
+
const set = (element, key, value) => {
|
|
255
213
|
rawSet(element.dom, key, value);
|
|
256
214
|
};
|
|
257
|
-
|
|
215
|
+
const remove = (element, key) => {
|
|
258
216
|
element.dom.removeAttribute(key);
|
|
259
217
|
};
|
|
260
218
|
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
219
|
+
const fromHtml = (html, scope) => {
|
|
220
|
+
const doc = scope || document;
|
|
221
|
+
const div = doc.createElement('div');
|
|
264
222
|
div.innerHTML = html;
|
|
265
223
|
if (!div.hasChildNodes() || div.childNodes.length > 1) {
|
|
266
|
-
|
|
267
|
-
|
|
224
|
+
const message = 'HTML does not have a single root node';
|
|
225
|
+
console.error(message, html);
|
|
226
|
+
throw new Error(message);
|
|
268
227
|
}
|
|
269
228
|
return fromDom(div.childNodes[0]);
|
|
270
229
|
};
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
230
|
+
const fromTag = (tag, scope) => {
|
|
231
|
+
const doc = scope || document;
|
|
232
|
+
const node = doc.createElement(tag);
|
|
274
233
|
return fromDom(node);
|
|
275
234
|
};
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
235
|
+
const fromText = (text, scope) => {
|
|
236
|
+
const doc = scope || document;
|
|
237
|
+
const node = doc.createTextNode(text);
|
|
279
238
|
return fromDom(node);
|
|
280
239
|
};
|
|
281
|
-
|
|
240
|
+
const fromDom = node => {
|
|
282
241
|
if (node === null || node === undefined) {
|
|
283
242
|
throw new Error('Node cannot be null or undefined');
|
|
284
243
|
}
|
|
285
244
|
return { dom: node };
|
|
286
245
|
};
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
fromDom: fromDom,
|
|
295
|
-
fromPoint: fromPoint
|
|
246
|
+
const fromPoint = (docElm, x, y) => Optional.from(docElm.dom.elementFromPoint(x, y)).map(fromDom);
|
|
247
|
+
const SugarElement = {
|
|
248
|
+
fromHtml,
|
|
249
|
+
fromTag,
|
|
250
|
+
fromText,
|
|
251
|
+
fromDom,
|
|
252
|
+
fromPoint
|
|
296
253
|
};
|
|
297
254
|
|
|
298
|
-
var global$
|
|
255
|
+
var global$3 = tinymce.util.Tools.resolve('tinymce.dom.DOMUtils');
|
|
299
256
|
|
|
300
|
-
var global$2 = tinymce.util.Tools.resolve('tinymce.util.
|
|
257
|
+
var global$2 = tinymce.util.Tools.resolve('tinymce.util.URI');
|
|
301
258
|
|
|
302
|
-
|
|
259
|
+
const isNotEmpty = s => s.length > 0;
|
|
303
260
|
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
return Math.max(parseInt(val1, 10), parseInt(val2, 10));
|
|
346
|
-
};
|
|
347
|
-
var getImageSize = function (url) {
|
|
348
|
-
return new global$2(function (callback) {
|
|
349
|
-
var img = document.createElement('img');
|
|
350
|
-
var done = function (dimensions) {
|
|
351
|
-
if (img.parentNode) {
|
|
352
|
-
img.parentNode.removeChild(img);
|
|
353
|
-
}
|
|
354
|
-
callback(dimensions);
|
|
355
|
-
};
|
|
356
|
-
img.onload = function () {
|
|
357
|
-
var width = parseIntAndGetMax(img.width, img.clientWidth);
|
|
358
|
-
var height = parseIntAndGetMax(img.height, img.clientHeight);
|
|
359
|
-
var dimensions = {
|
|
360
|
-
width: width,
|
|
361
|
-
height: height
|
|
261
|
+
const option = name => editor => editor.options.get(name);
|
|
262
|
+
const register$2 = editor => {
|
|
263
|
+
const registerOption = editor.options.register;
|
|
264
|
+
registerOption('image_dimensions', {
|
|
265
|
+
processor: 'boolean',
|
|
266
|
+
default: true
|
|
267
|
+
});
|
|
268
|
+
registerOption('image_advtab', {
|
|
269
|
+
processor: 'boolean',
|
|
270
|
+
default: false
|
|
271
|
+
});
|
|
272
|
+
registerOption('image_uploadtab', {
|
|
273
|
+
processor: 'boolean',
|
|
274
|
+
default: true
|
|
275
|
+
});
|
|
276
|
+
registerOption('image_prepend_url', {
|
|
277
|
+
processor: 'string',
|
|
278
|
+
default: ''
|
|
279
|
+
});
|
|
280
|
+
registerOption('image_class_list', { processor: 'object[]' });
|
|
281
|
+
registerOption('image_description', {
|
|
282
|
+
processor: 'boolean',
|
|
283
|
+
default: true
|
|
284
|
+
});
|
|
285
|
+
registerOption('image_title', {
|
|
286
|
+
processor: 'boolean',
|
|
287
|
+
default: false
|
|
288
|
+
});
|
|
289
|
+
registerOption('image_caption', {
|
|
290
|
+
processor: 'boolean',
|
|
291
|
+
default: false
|
|
292
|
+
});
|
|
293
|
+
registerOption('image_list', {
|
|
294
|
+
processor: value => {
|
|
295
|
+
const valid = value === false || isString(value) || isArrayOf(value, isObject) || isFunction(value);
|
|
296
|
+
return valid ? {
|
|
297
|
+
value,
|
|
298
|
+
valid
|
|
299
|
+
} : {
|
|
300
|
+
valid: false,
|
|
301
|
+
message: 'Must be false, a string, an array or a function.'
|
|
362
302
|
};
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
img.onerror = function () {
|
|
366
|
-
done(global$2.reject('Failed to get image dimensions for: ' + url));
|
|
367
|
-
};
|
|
368
|
-
var style = img.style;
|
|
369
|
-
style.visibility = 'hidden';
|
|
370
|
-
style.position = 'fixed';
|
|
371
|
-
style.bottom = style.left = '0px';
|
|
372
|
-
style.width = style.height = 'auto';
|
|
373
|
-
document.body.appendChild(img);
|
|
374
|
-
img.src = url;
|
|
303
|
+
},
|
|
304
|
+
default: false
|
|
375
305
|
});
|
|
376
306
|
};
|
|
377
|
-
|
|
307
|
+
const hasDimensions = option('image_dimensions');
|
|
308
|
+
const hasAdvTab = option('image_advtab');
|
|
309
|
+
const hasUploadTab = option('image_uploadtab');
|
|
310
|
+
const getPrependUrl = option('image_prepend_url');
|
|
311
|
+
const getClassList = option('image_class_list');
|
|
312
|
+
const hasDescription = option('image_description');
|
|
313
|
+
const hasImageTitle = option('image_title');
|
|
314
|
+
const hasImageCaption = option('image_caption');
|
|
315
|
+
const getImageList = option('image_list');
|
|
316
|
+
const showAccessibilityOptions = option('a11y_advanced_options');
|
|
317
|
+
const isAutomaticUploadsEnabled = option('automatic_uploads');
|
|
318
|
+
const hasUploadUrl = editor => isNotEmpty(editor.options.get('images_upload_url'));
|
|
319
|
+
const hasUploadHandler = editor => isNonNullable(editor.options.get('images_upload_handler'));
|
|
320
|
+
|
|
321
|
+
const parseIntAndGetMax = (val1, val2) => Math.max(parseInt(val1, 10), parseInt(val2, 10));
|
|
322
|
+
const getImageSize = url => new Promise(callback => {
|
|
323
|
+
const img = document.createElement('img');
|
|
324
|
+
const done = dimensions => {
|
|
325
|
+
img.onload = img.onerror = null;
|
|
326
|
+
if (img.parentNode) {
|
|
327
|
+
img.parentNode.removeChild(img);
|
|
328
|
+
}
|
|
329
|
+
callback(dimensions);
|
|
330
|
+
};
|
|
331
|
+
img.onload = () => {
|
|
332
|
+
const width = parseIntAndGetMax(img.width, img.clientWidth);
|
|
333
|
+
const height = parseIntAndGetMax(img.height, img.clientHeight);
|
|
334
|
+
const dimensions = {
|
|
335
|
+
width,
|
|
336
|
+
height
|
|
337
|
+
};
|
|
338
|
+
done(Promise.resolve(dimensions));
|
|
339
|
+
};
|
|
340
|
+
img.onerror = () => {
|
|
341
|
+
done(Promise.reject(`Failed to get image dimensions for: ${ url }`));
|
|
342
|
+
};
|
|
343
|
+
const style = img.style;
|
|
344
|
+
style.visibility = 'hidden';
|
|
345
|
+
style.position = 'fixed';
|
|
346
|
+
style.bottom = style.left = '0px';
|
|
347
|
+
style.width = style.height = 'auto';
|
|
348
|
+
document.body.appendChild(img);
|
|
349
|
+
img.src = url;
|
|
350
|
+
});
|
|
351
|
+
const removePixelSuffix = value => {
|
|
378
352
|
if (value) {
|
|
379
353
|
value = value.replace(/px$/, '');
|
|
380
354
|
}
|
|
381
355
|
return value;
|
|
382
356
|
};
|
|
383
|
-
|
|
357
|
+
const addPixelSuffix = value => {
|
|
384
358
|
if (value.length > 0 && /^[0-9]+$/.test(value)) {
|
|
385
359
|
value += 'px';
|
|
386
360
|
}
|
|
387
361
|
return value;
|
|
388
362
|
};
|
|
389
|
-
|
|
363
|
+
const mergeMargins = css => {
|
|
390
364
|
if (css.margin) {
|
|
391
|
-
|
|
365
|
+
const splitMargin = String(css.margin).split(' ');
|
|
392
366
|
switch (splitMargin.length) {
|
|
393
367
|
case 1:
|
|
394
368
|
css['margin-top'] = css['margin-top'] || splitMargin[0];
|
|
@@ -418,30 +392,29 @@
|
|
|
418
392
|
}
|
|
419
393
|
return css;
|
|
420
394
|
};
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
if (
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
callback(JSON.parse(text));
|
|
395
|
+
const createImageList = (editor, callback) => {
|
|
396
|
+
const imageList = getImageList(editor);
|
|
397
|
+
if (isString(imageList)) {
|
|
398
|
+
fetch(imageList).then(res => {
|
|
399
|
+
if (res.ok) {
|
|
400
|
+
res.json().then(callback);
|
|
428
401
|
}
|
|
429
402
|
});
|
|
430
|
-
} else if (
|
|
403
|
+
} else if (isFunction(imageList)) {
|
|
431
404
|
imageList(callback);
|
|
432
405
|
} else {
|
|
433
406
|
callback(imageList);
|
|
434
407
|
}
|
|
435
408
|
};
|
|
436
|
-
|
|
437
|
-
|
|
409
|
+
const waitLoadImage = (editor, data, imgElm) => {
|
|
410
|
+
const selectImage = () => {
|
|
438
411
|
imgElm.onload = imgElm.onerror = null;
|
|
439
412
|
if (editor.selection) {
|
|
440
413
|
editor.selection.select(imgElm);
|
|
441
414
|
editor.nodeChanged();
|
|
442
415
|
}
|
|
443
416
|
};
|
|
444
|
-
imgElm.onload =
|
|
417
|
+
imgElm.onload = () => {
|
|
445
418
|
if (!data.width && !data.height && hasDimensions(editor)) {
|
|
446
419
|
editor.dom.setAttribs(imgElm, {
|
|
447
420
|
width: String(imgElm.clientWidth),
|
|
@@ -452,86 +425,89 @@
|
|
|
452
425
|
};
|
|
453
426
|
imgElm.onerror = selectImage;
|
|
454
427
|
};
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
reader.
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
428
|
+
const blobToDataUri = blob => new Promise((resolve, reject) => {
|
|
429
|
+
const reader = new FileReader();
|
|
430
|
+
reader.onload = () => {
|
|
431
|
+
resolve(reader.result);
|
|
432
|
+
};
|
|
433
|
+
reader.onerror = () => {
|
|
434
|
+
var _a;
|
|
435
|
+
reject((_a = reader.error) === null || _a === void 0 ? void 0 : _a.message);
|
|
436
|
+
};
|
|
437
|
+
reader.readAsDataURL(blob);
|
|
438
|
+
});
|
|
439
|
+
const isPlaceholderImage = imgElm => imgElm.nodeName === 'IMG' && (imgElm.hasAttribute('data-mce-object') || imgElm.hasAttribute('data-mce-placeholder'));
|
|
440
|
+
const isSafeImageUrl = (editor, src) => {
|
|
441
|
+
const getOption = editor.options.get;
|
|
442
|
+
return global$2.isDomSafe(src, 'img', {
|
|
443
|
+
allow_html_data_urls: getOption('allow_html_data_urls'),
|
|
444
|
+
allow_script_urls: getOption('allow_script_urls'),
|
|
445
|
+
allow_svg_data_urls: getOption('allow_svg_data_urls')
|
|
465
446
|
});
|
|
466
447
|
};
|
|
467
|
-
var isPlaceholderImage = function (imgElm) {
|
|
468
|
-
return imgElm.nodeName === 'IMG' && (imgElm.hasAttribute('data-mce-object') || imgElm.hasAttribute('data-mce-placeholder'));
|
|
469
|
-
};
|
|
470
448
|
|
|
471
|
-
|
|
472
|
-
|
|
449
|
+
const DOM = global$3.DOM;
|
|
450
|
+
const getHspace = image => {
|
|
473
451
|
if (image.style.marginLeft && image.style.marginRight && image.style.marginLeft === image.style.marginRight) {
|
|
474
452
|
return removePixelSuffix(image.style.marginLeft);
|
|
475
453
|
} else {
|
|
476
454
|
return '';
|
|
477
455
|
}
|
|
478
456
|
};
|
|
479
|
-
|
|
457
|
+
const getVspace = image => {
|
|
480
458
|
if (image.style.marginTop && image.style.marginBottom && image.style.marginTop === image.style.marginBottom) {
|
|
481
459
|
return removePixelSuffix(image.style.marginTop);
|
|
482
460
|
} else {
|
|
483
461
|
return '';
|
|
484
462
|
}
|
|
485
463
|
};
|
|
486
|
-
|
|
464
|
+
const getBorder = image => {
|
|
487
465
|
if (image.style.borderWidth) {
|
|
488
466
|
return removePixelSuffix(image.style.borderWidth);
|
|
489
467
|
} else {
|
|
490
468
|
return '';
|
|
491
469
|
}
|
|
492
470
|
};
|
|
493
|
-
|
|
471
|
+
const getAttrib = (image, name) => {
|
|
472
|
+
var _a;
|
|
494
473
|
if (image.hasAttribute(name)) {
|
|
495
|
-
return image.getAttribute(name);
|
|
474
|
+
return (_a = image.getAttribute(name)) !== null && _a !== void 0 ? _a : '';
|
|
496
475
|
} else {
|
|
497
476
|
return '';
|
|
498
477
|
}
|
|
499
478
|
};
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
var hasCaption = function (image) {
|
|
504
|
-
return image.parentNode !== null && image.parentNode.nodeName === 'FIGURE';
|
|
505
|
-
};
|
|
506
|
-
var updateAttrib = function (image, name, value) {
|
|
507
|
-
if (value === '') {
|
|
479
|
+
const hasCaption = image => image.parentNode !== null && image.parentNode.nodeName === 'FIGURE';
|
|
480
|
+
const updateAttrib = (image, name, value) => {
|
|
481
|
+
if (value === '' || value === null) {
|
|
508
482
|
image.removeAttribute(name);
|
|
509
483
|
} else {
|
|
510
484
|
image.setAttribute(name, value);
|
|
511
485
|
}
|
|
512
486
|
};
|
|
513
|
-
|
|
514
|
-
|
|
487
|
+
const wrapInFigure = image => {
|
|
488
|
+
const figureElm = DOM.create('figure', { class: 'image' });
|
|
515
489
|
DOM.insertAfter(figureElm, image);
|
|
516
490
|
figureElm.appendChild(image);
|
|
517
491
|
figureElm.appendChild(DOM.create('figcaption', { contentEditable: 'true' }, 'Caption'));
|
|
518
492
|
figureElm.contentEditable = 'false';
|
|
519
493
|
};
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
494
|
+
const removeFigure = image => {
|
|
495
|
+
const figureElm = image.parentNode;
|
|
496
|
+
if (isNonNullable(figureElm)) {
|
|
497
|
+
DOM.insertAfter(image, figureElm);
|
|
498
|
+
DOM.remove(figureElm);
|
|
499
|
+
}
|
|
524
500
|
};
|
|
525
|
-
|
|
501
|
+
const toggleCaption = image => {
|
|
526
502
|
if (hasCaption(image)) {
|
|
527
503
|
removeFigure(image);
|
|
528
504
|
} else {
|
|
529
505
|
wrapInFigure(image);
|
|
530
506
|
}
|
|
531
507
|
};
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
508
|
+
const normalizeStyle = (image, normalizeCss) => {
|
|
509
|
+
const attrValue = image.getAttribute('style');
|
|
510
|
+
const value = normalizeCss(attrValue !== null ? attrValue : '');
|
|
535
511
|
if (value.length > 0) {
|
|
536
512
|
image.setAttribute('style', value);
|
|
537
513
|
image.setAttribute('data-mce-style', value);
|
|
@@ -539,78 +515,71 @@
|
|
|
539
515
|
image.removeAttribute('style');
|
|
540
516
|
}
|
|
541
517
|
};
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
};
|
|
518
|
+
const setSize = (name, normalizeCss) => (image, name, value) => {
|
|
519
|
+
const styles = image.style;
|
|
520
|
+
if (styles[name]) {
|
|
521
|
+
styles[name] = addPixelSuffix(value);
|
|
522
|
+
normalizeStyle(image, normalizeCss);
|
|
523
|
+
} else {
|
|
524
|
+
updateAttrib(image, name, value);
|
|
525
|
+
}
|
|
551
526
|
};
|
|
552
|
-
|
|
527
|
+
const getSize = (image, name) => {
|
|
553
528
|
if (image.style[name]) {
|
|
554
529
|
return removePixelSuffix(image.style[name]);
|
|
555
530
|
} else {
|
|
556
531
|
return getAttrib(image, name);
|
|
557
532
|
}
|
|
558
533
|
};
|
|
559
|
-
|
|
560
|
-
|
|
534
|
+
const setHspace = (image, value) => {
|
|
535
|
+
const pxValue = addPixelSuffix(value);
|
|
561
536
|
image.style.marginLeft = pxValue;
|
|
562
537
|
image.style.marginRight = pxValue;
|
|
563
538
|
};
|
|
564
|
-
|
|
565
|
-
|
|
539
|
+
const setVspace = (image, value) => {
|
|
540
|
+
const pxValue = addPixelSuffix(value);
|
|
566
541
|
image.style.marginTop = pxValue;
|
|
567
542
|
image.style.marginBottom = pxValue;
|
|
568
543
|
};
|
|
569
|
-
|
|
570
|
-
|
|
544
|
+
const setBorder = (image, value) => {
|
|
545
|
+
const pxValue = addPixelSuffix(value);
|
|
571
546
|
image.style.borderWidth = pxValue;
|
|
572
547
|
};
|
|
573
|
-
|
|
548
|
+
const setBorderStyle = (image, value) => {
|
|
574
549
|
image.style.borderStyle = value;
|
|
575
550
|
};
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
var isFigure = function (elm) {
|
|
580
|
-
return elm.nodeName === 'FIGURE';
|
|
581
|
-
};
|
|
582
|
-
var isImage = function (elm) {
|
|
583
|
-
return elm.nodeName === 'IMG';
|
|
551
|
+
const getBorderStyle = image => {
|
|
552
|
+
var _a;
|
|
553
|
+
return (_a = image.style.borderStyle) !== null && _a !== void 0 ? _a : '';
|
|
584
554
|
};
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
555
|
+
const isFigure = elm => isNonNullable(elm) && elm.nodeName === 'FIGURE';
|
|
556
|
+
const isImage = elm => elm.nodeName === 'IMG';
|
|
557
|
+
const getIsDecorative = image => DOM.getAttrib(image, 'alt').length === 0 && DOM.getAttrib(image, 'role') === 'presentation';
|
|
558
|
+
const getAlt = image => {
|
|
589
559
|
if (getIsDecorative(image)) {
|
|
590
560
|
return '';
|
|
591
561
|
} else {
|
|
592
562
|
return getAttrib(image, 'alt');
|
|
593
563
|
}
|
|
594
564
|
};
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
var image = document.createElement('img');
|
|
565
|
+
const defaultData = () => ({
|
|
566
|
+
src: '',
|
|
567
|
+
alt: '',
|
|
568
|
+
title: '',
|
|
569
|
+
width: '',
|
|
570
|
+
height: '',
|
|
571
|
+
class: '',
|
|
572
|
+
style: '',
|
|
573
|
+
caption: false,
|
|
574
|
+
hspace: '',
|
|
575
|
+
vspace: '',
|
|
576
|
+
border: '',
|
|
577
|
+
borderStyle: '',
|
|
578
|
+
isDecorative: false
|
|
579
|
+
});
|
|
580
|
+
const getStyleValue = (normalizeCss, data) => {
|
|
581
|
+
var _a;
|
|
582
|
+
const image = document.createElement('img');
|
|
614
583
|
updateAttrib(image, 'style', data.style);
|
|
615
584
|
if (getHspace(image) || data.hspace !== '') {
|
|
616
585
|
setHspace(image, data.hspace);
|
|
@@ -624,14 +593,17 @@
|
|
|
624
593
|
if (getBorderStyle(image) || data.borderStyle !== '') {
|
|
625
594
|
setBorderStyle(image, data.borderStyle);
|
|
626
595
|
}
|
|
627
|
-
return normalizeCss(image.getAttribute('style'));
|
|
628
|
-
};
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
write(normalizeCss,
|
|
596
|
+
return normalizeCss((_a = image.getAttribute('style')) !== null && _a !== void 0 ? _a : '');
|
|
597
|
+
};
|
|
598
|
+
const create = (normalizeCss, data) => {
|
|
599
|
+
const image = document.createElement('img');
|
|
600
|
+
write(normalizeCss, {
|
|
601
|
+
...data,
|
|
602
|
+
caption: false
|
|
603
|
+
}, image);
|
|
632
604
|
setAlt(image, data.alt, data.isDecorative);
|
|
633
605
|
if (data.caption) {
|
|
634
|
-
|
|
606
|
+
const figure = DOM.create('figure', { class: 'image' });
|
|
635
607
|
figure.appendChild(image);
|
|
636
608
|
figure.appendChild(DOM.create('figcaption', { contentEditable: 'true' }, 'Caption'));
|
|
637
609
|
figure.contentEditable = 'false';
|
|
@@ -640,39 +612,37 @@
|
|
|
640
612
|
return image;
|
|
641
613
|
}
|
|
642
614
|
};
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
};
|
|
660
|
-
var updateProp = function (image, oldData, newData, name, set) {
|
|
615
|
+
const read = (normalizeCss, image) => ({
|
|
616
|
+
src: getAttrib(image, 'src'),
|
|
617
|
+
alt: getAlt(image),
|
|
618
|
+
title: getAttrib(image, 'title'),
|
|
619
|
+
width: getSize(image, 'width'),
|
|
620
|
+
height: getSize(image, 'height'),
|
|
621
|
+
class: getAttrib(image, 'class'),
|
|
622
|
+
style: normalizeCss(getAttrib(image, 'style')),
|
|
623
|
+
caption: hasCaption(image),
|
|
624
|
+
hspace: getHspace(image),
|
|
625
|
+
vspace: getVspace(image),
|
|
626
|
+
border: getBorder(image),
|
|
627
|
+
borderStyle: getBorderStyle(image),
|
|
628
|
+
isDecorative: getIsDecorative(image)
|
|
629
|
+
});
|
|
630
|
+
const updateProp = (image, oldData, newData, name, set) => {
|
|
661
631
|
if (newData[name] !== oldData[name]) {
|
|
662
|
-
set(image, name, newData[name]);
|
|
632
|
+
set(image, name, String(newData[name]));
|
|
663
633
|
}
|
|
664
634
|
};
|
|
665
|
-
|
|
635
|
+
const setAlt = (image, alt, isDecorative) => {
|
|
666
636
|
if (isDecorative) {
|
|
667
637
|
DOM.setAttrib(image, 'role', 'presentation');
|
|
668
|
-
|
|
638
|
+
const sugarImage = SugarElement.fromDom(image);
|
|
669
639
|
set(sugarImage, 'alt', '');
|
|
670
640
|
} else {
|
|
671
641
|
if (isNull(alt)) {
|
|
672
|
-
|
|
642
|
+
const sugarImage = SugarElement.fromDom(image);
|
|
673
643
|
remove(sugarImage, 'alt');
|
|
674
644
|
} else {
|
|
675
|
-
|
|
645
|
+
const sugarImage = SugarElement.fromDom(image);
|
|
676
646
|
set(sugarImage, 'alt', alt);
|
|
677
647
|
}
|
|
678
648
|
if (DOM.getAttrib(image, 'role') === 'presentation') {
|
|
@@ -680,30 +650,24 @@
|
|
|
680
650
|
}
|
|
681
651
|
}
|
|
682
652
|
};
|
|
683
|
-
|
|
653
|
+
const updateAlt = (image, oldData, newData) => {
|
|
684
654
|
if (newData.alt !== oldData.alt || newData.isDecorative !== oldData.isDecorative) {
|
|
685
655
|
setAlt(image, newData.alt, newData.isDecorative);
|
|
686
656
|
}
|
|
687
657
|
};
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
normalizeStyle(image, normalizeCss);
|
|
692
|
-
};
|
|
658
|
+
const normalized = (set, normalizeCss) => (image, name, value) => {
|
|
659
|
+
set(image, value);
|
|
660
|
+
normalizeStyle(image, normalizeCss);
|
|
693
661
|
};
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
updateProp(image, oldData, newData, 'caption',
|
|
697
|
-
return toggleCaption(image);
|
|
698
|
-
});
|
|
662
|
+
const write = (normalizeCss, newData, image) => {
|
|
663
|
+
const oldData = read(normalizeCss, image);
|
|
664
|
+
updateProp(image, oldData, newData, 'caption', (image, _name, _value) => toggleCaption(image));
|
|
699
665
|
updateProp(image, oldData, newData, 'src', updateAttrib);
|
|
700
666
|
updateProp(image, oldData, newData, 'title', updateAttrib);
|
|
701
667
|
updateProp(image, oldData, newData, 'width', setSize('width', normalizeCss));
|
|
702
668
|
updateProp(image, oldData, newData, 'height', setSize('height', normalizeCss));
|
|
703
669
|
updateProp(image, oldData, newData, 'class', updateAttrib);
|
|
704
|
-
updateProp(image, oldData, newData, 'style', normalized(
|
|
705
|
-
return updateAttrib(image, 'style', value);
|
|
706
|
-
}, normalizeCss));
|
|
670
|
+
updateProp(image, oldData, newData, 'style', normalized((image, value) => updateAttrib(image, 'style', value), normalizeCss));
|
|
707
671
|
updateProp(image, oldData, newData, 'hspace', normalized(setHspace, normalizeCss));
|
|
708
672
|
updateProp(image, oldData, newData, 'vspace', normalized(setVspace, normalizeCss));
|
|
709
673
|
updateProp(image, oldData, newData, 'border', normalized(setBorder, normalizeCss));
|
|
@@ -711,15 +675,15 @@
|
|
|
711
675
|
updateAlt(image, oldData, newData);
|
|
712
676
|
};
|
|
713
677
|
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
678
|
+
const normalizeCss$1 = (editor, cssText) => {
|
|
679
|
+
const css = editor.dom.styles.parse(cssText);
|
|
680
|
+
const mergedCss = mergeMargins(css);
|
|
681
|
+
const compressed = editor.dom.styles.parse(editor.dom.styles.serialize(mergedCss));
|
|
718
682
|
return editor.dom.styles.serialize(compressed);
|
|
719
683
|
};
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
684
|
+
const getSelectedImage = editor => {
|
|
685
|
+
const imgElm = editor.selection.getNode();
|
|
686
|
+
const figureElm = editor.dom.getParent(imgElm, 'figure.image');
|
|
723
687
|
if (figureElm) {
|
|
724
688
|
return editor.dom.select('img', figureElm)[0];
|
|
725
689
|
}
|
|
@@ -728,48 +692,41 @@
|
|
|
728
692
|
}
|
|
729
693
|
return imgElm;
|
|
730
694
|
};
|
|
731
|
-
|
|
732
|
-
var
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
var textBlock = dom.getParent(figure.parentNode, function (node) {
|
|
737
|
-
return hasNonNullableKey(textBlockElements, node.nodeName);
|
|
738
|
-
}, editor.getBody());
|
|
695
|
+
const splitTextBlock = (editor, figure) => {
|
|
696
|
+
var _a;
|
|
697
|
+
const dom = editor.dom;
|
|
698
|
+
const textBlockElements = filter(editor.schema.getTextBlockElements(), (_, parentElm) => !editor.schema.isValidChild(parentElm, 'figure'));
|
|
699
|
+
const textBlock = dom.getParent(figure.parentNode, node => hasNonNullableKey(textBlockElements, node.nodeName), editor.getBody());
|
|
739
700
|
if (textBlock) {
|
|
740
|
-
return dom.split(textBlock, figure);
|
|
701
|
+
return (_a = dom.split(textBlock, figure)) !== null && _a !== void 0 ? _a : figure;
|
|
741
702
|
} else {
|
|
742
703
|
return figure;
|
|
743
704
|
}
|
|
744
705
|
};
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
return image ? read(
|
|
748
|
-
return normalizeCss(editor, css);
|
|
749
|
-
}, image) : defaultData();
|
|
706
|
+
const readImageDataFromSelection = editor => {
|
|
707
|
+
const image = getSelectedImage(editor);
|
|
708
|
+
return image ? read(css => normalizeCss$1(editor, css), image) : defaultData();
|
|
750
709
|
};
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
return normalizeCss(editor, css);
|
|
754
|
-
}, data);
|
|
710
|
+
const insertImageAtCaret = (editor, data) => {
|
|
711
|
+
const elm = create(css => normalizeCss$1(editor, css), data);
|
|
755
712
|
editor.dom.setAttrib(elm, 'data-mce-id', '__mcenew');
|
|
756
713
|
editor.focus();
|
|
757
714
|
editor.selection.setContent(elm.outerHTML);
|
|
758
|
-
|
|
715
|
+
const insertedElm = editor.dom.select('*[data-mce-id="__mcenew"]')[0];
|
|
759
716
|
editor.dom.setAttrib(insertedElm, 'data-mce-id', null);
|
|
760
717
|
if (isFigure(insertedElm)) {
|
|
761
|
-
|
|
718
|
+
const figure = splitTextBlock(editor, insertedElm);
|
|
762
719
|
editor.selection.select(figure);
|
|
763
720
|
} else {
|
|
764
721
|
editor.selection.select(insertedElm);
|
|
765
722
|
}
|
|
766
723
|
};
|
|
767
|
-
|
|
724
|
+
const syncSrcAttr = (editor, image) => {
|
|
768
725
|
editor.dom.setAttrib(image, 'src', image.getAttribute('src'));
|
|
769
726
|
};
|
|
770
|
-
|
|
727
|
+
const deleteImage = (editor, image) => {
|
|
771
728
|
if (image) {
|
|
772
|
-
|
|
729
|
+
const elm = editor.dom.is(image.parentNode, 'figure.image') ? image.parentNode : image;
|
|
773
730
|
editor.dom.remove(elm);
|
|
774
731
|
editor.focus();
|
|
775
732
|
editor.nodeChanged();
|
|
@@ -779,57 +736,64 @@
|
|
|
779
736
|
}
|
|
780
737
|
}
|
|
781
738
|
};
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
739
|
+
const writeImageDataToSelection = (editor, data) => {
|
|
740
|
+
const image = getSelectedImage(editor);
|
|
741
|
+
if (image) {
|
|
742
|
+
write(css => normalizeCss$1(editor, css), data, image);
|
|
743
|
+
syncSrcAttr(editor, image);
|
|
744
|
+
if (isFigure(image.parentNode)) {
|
|
745
|
+
const figure = image.parentNode;
|
|
746
|
+
splitTextBlock(editor, figure);
|
|
747
|
+
editor.selection.select(image.parentNode);
|
|
748
|
+
} else {
|
|
749
|
+
editor.selection.select(image);
|
|
750
|
+
waitLoadImage(editor, data, image);
|
|
751
|
+
}
|
|
795
752
|
}
|
|
796
753
|
};
|
|
797
|
-
|
|
798
|
-
|
|
754
|
+
const sanitizeImageData = (editor, data) => {
|
|
755
|
+
const src = data.src;
|
|
756
|
+
return {
|
|
757
|
+
...data,
|
|
758
|
+
src: isSafeImageUrl(editor, src) ? src : ''
|
|
759
|
+
};
|
|
760
|
+
};
|
|
761
|
+
const insertOrUpdateImage = (editor, partialData) => {
|
|
762
|
+
const image = getSelectedImage(editor);
|
|
799
763
|
if (image) {
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
764
|
+
const selectedImageData = read(css => normalizeCss$1(editor, css), image);
|
|
765
|
+
const data = {
|
|
766
|
+
...selectedImageData,
|
|
767
|
+
...partialData
|
|
768
|
+
};
|
|
769
|
+
const sanitizedData = sanitizeImageData(editor, data);
|
|
804
770
|
if (data.src) {
|
|
805
|
-
writeImageDataToSelection(editor,
|
|
771
|
+
writeImageDataToSelection(editor, sanitizedData);
|
|
806
772
|
} else {
|
|
807
773
|
deleteImage(editor, image);
|
|
808
774
|
}
|
|
809
775
|
} else if (partialData.src) {
|
|
810
|
-
insertImageAtCaret(editor,
|
|
776
|
+
insertImageAtCaret(editor, {
|
|
777
|
+
...defaultData(),
|
|
778
|
+
...partialData
|
|
779
|
+
});
|
|
811
780
|
}
|
|
812
781
|
};
|
|
813
782
|
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
var bothObjects = isObject(old) && isObject(nu);
|
|
783
|
+
const deep = (old, nu) => {
|
|
784
|
+
const bothObjects = isPlainObject(old) && isPlainObject(nu);
|
|
817
785
|
return bothObjects ? deepMerge(old, nu) : nu;
|
|
818
786
|
};
|
|
819
|
-
|
|
820
|
-
return
|
|
821
|
-
var objects = [];
|
|
822
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
823
|
-
objects[_i] = arguments[_i];
|
|
824
|
-
}
|
|
787
|
+
const baseMerge = merger => {
|
|
788
|
+
return (...objects) => {
|
|
825
789
|
if (objects.length === 0) {
|
|
826
|
-
throw new Error(
|
|
790
|
+
throw new Error(`Can't merge zero objects`);
|
|
827
791
|
}
|
|
828
|
-
|
|
829
|
-
for (
|
|
830
|
-
|
|
831
|
-
for (
|
|
832
|
-
if (
|
|
792
|
+
const ret = {};
|
|
793
|
+
for (let j = 0; j < objects.length; j++) {
|
|
794
|
+
const curObject = objects[j];
|
|
795
|
+
for (const key in curObject) {
|
|
796
|
+
if (has(curObject, key)) {
|
|
833
797
|
ret[key] = merger(ret[key], curObject[key]);
|
|
834
798
|
}
|
|
835
799
|
}
|
|
@@ -837,20 +801,14 @@
|
|
|
837
801
|
return ret;
|
|
838
802
|
};
|
|
839
803
|
};
|
|
840
|
-
|
|
804
|
+
const deepMerge = baseMerge(deep);
|
|
841
805
|
|
|
842
|
-
var
|
|
843
|
-
return s.length > 0;
|
|
844
|
-
};
|
|
806
|
+
var global$1 = tinymce.util.Tools.resolve('tinymce.util.ImageUploader');
|
|
845
807
|
|
|
846
|
-
var global
|
|
808
|
+
var global = tinymce.util.Tools.resolve('tinymce.util.Tools');
|
|
847
809
|
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
var getValue = function (item) {
|
|
851
|
-
return isString(item.value) ? item.value : '';
|
|
852
|
-
};
|
|
853
|
-
var getText = function (item) {
|
|
810
|
+
const getValue = item => isString(item.value) ? item.value : '';
|
|
811
|
+
const getText = item => {
|
|
854
812
|
if (isString(item.text)) {
|
|
855
813
|
return item.text;
|
|
856
814
|
} else if (isString(item.title)) {
|
|
@@ -859,241 +817,206 @@
|
|
|
859
817
|
return '';
|
|
860
818
|
}
|
|
861
819
|
};
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
global
|
|
865
|
-
|
|
820
|
+
const sanitizeList = (list, extractValue) => {
|
|
821
|
+
const out = [];
|
|
822
|
+
global.each(list, item => {
|
|
823
|
+
const text = getText(item);
|
|
866
824
|
if (item.menu !== undefined) {
|
|
867
|
-
|
|
825
|
+
const items = sanitizeList(item.menu, extractValue);
|
|
868
826
|
out.push({
|
|
869
|
-
text
|
|
870
|
-
items
|
|
827
|
+
text,
|
|
828
|
+
items
|
|
871
829
|
});
|
|
872
830
|
} else {
|
|
873
|
-
|
|
831
|
+
const value = extractValue(item);
|
|
874
832
|
out.push({
|
|
875
|
-
text
|
|
876
|
-
value
|
|
833
|
+
text,
|
|
834
|
+
value
|
|
877
835
|
});
|
|
878
836
|
}
|
|
879
837
|
});
|
|
880
838
|
return out;
|
|
881
839
|
};
|
|
882
|
-
|
|
883
|
-
if (
|
|
884
|
-
|
|
840
|
+
const sanitizer = (extractor = getValue) => list => {
|
|
841
|
+
if (list) {
|
|
842
|
+
return Optional.from(list).map(list => sanitizeList(list, extractor));
|
|
843
|
+
} else {
|
|
844
|
+
return Optional.none();
|
|
885
845
|
}
|
|
886
|
-
return function (list) {
|
|
887
|
-
if (list) {
|
|
888
|
-
return Optional.from(list).map(function (list) {
|
|
889
|
-
return sanitizeList(list, extracter);
|
|
890
|
-
});
|
|
891
|
-
} else {
|
|
892
|
-
return Optional.none();
|
|
893
|
-
}
|
|
894
|
-
};
|
|
895
|
-
};
|
|
896
|
-
var sanitize = function (list) {
|
|
897
|
-
return sanitizer(getValue)(list);
|
|
898
846
|
};
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
return findEntryDelegate(list, value);
|
|
916
|
-
});
|
|
917
|
-
};
|
|
918
|
-
var ListUtils = {
|
|
919
|
-
sanitizer: sanitizer,
|
|
920
|
-
sanitize: sanitize,
|
|
921
|
-
findEntry: findEntry
|
|
922
|
-
};
|
|
923
|
-
|
|
924
|
-
var makeTab = function (_info) {
|
|
925
|
-
return {
|
|
926
|
-
title: 'Advanced',
|
|
927
|
-
name: 'advanced',
|
|
928
|
-
items: [
|
|
929
|
-
{
|
|
930
|
-
type: 'input',
|
|
931
|
-
label: 'Style',
|
|
932
|
-
name: 'style'
|
|
933
|
-
},
|
|
934
|
-
{
|
|
935
|
-
type: 'grid',
|
|
936
|
-
columns: 2,
|
|
937
|
-
items: [
|
|
938
|
-
{
|
|
939
|
-
type: 'input',
|
|
940
|
-
label: 'Vertical space',
|
|
941
|
-
name: 'vspace',
|
|
942
|
-
inputMode: 'numeric'
|
|
943
|
-
},
|
|
944
|
-
{
|
|
945
|
-
type: 'input',
|
|
946
|
-
label: 'Horizontal space',
|
|
947
|
-
name: 'hspace',
|
|
948
|
-
inputMode: 'numeric'
|
|
949
|
-
},
|
|
950
|
-
{
|
|
951
|
-
type: 'input',
|
|
952
|
-
label: 'Border width',
|
|
953
|
-
name: 'border',
|
|
954
|
-
inputMode: 'numeric'
|
|
955
|
-
},
|
|
956
|
-
{
|
|
957
|
-
type: 'listbox',
|
|
958
|
-
name: 'borderstyle',
|
|
959
|
-
label: 'Border style',
|
|
960
|
-
items: [
|
|
961
|
-
{
|
|
962
|
-
text: 'Select...',
|
|
963
|
-
value: ''
|
|
964
|
-
},
|
|
965
|
-
{
|
|
966
|
-
text: 'Solid',
|
|
967
|
-
value: 'solid'
|
|
968
|
-
},
|
|
969
|
-
{
|
|
970
|
-
text: 'Dotted',
|
|
971
|
-
value: 'dotted'
|
|
972
|
-
},
|
|
973
|
-
{
|
|
974
|
-
text: 'Dashed',
|
|
975
|
-
value: 'dashed'
|
|
976
|
-
},
|
|
977
|
-
{
|
|
978
|
-
text: 'Double',
|
|
979
|
-
value: 'double'
|
|
980
|
-
},
|
|
981
|
-
{
|
|
982
|
-
text: 'Groove',
|
|
983
|
-
value: 'groove'
|
|
984
|
-
},
|
|
985
|
-
{
|
|
986
|
-
text: 'Ridge',
|
|
987
|
-
value: 'ridge'
|
|
988
|
-
},
|
|
989
|
-
{
|
|
990
|
-
text: 'Inset',
|
|
991
|
-
value: 'inset'
|
|
992
|
-
},
|
|
993
|
-
{
|
|
994
|
-
text: 'Outset',
|
|
995
|
-
value: 'outset'
|
|
996
|
-
},
|
|
997
|
-
{
|
|
998
|
-
text: 'None',
|
|
999
|
-
value: 'none'
|
|
1000
|
-
},
|
|
1001
|
-
{
|
|
1002
|
-
text: 'Hidden',
|
|
1003
|
-
value: 'hidden'
|
|
1004
|
-
}
|
|
1005
|
-
]
|
|
1006
|
-
}
|
|
1007
|
-
]
|
|
1008
|
-
}
|
|
1009
|
-
]
|
|
1010
|
-
};
|
|
847
|
+
const sanitize = list => sanitizer(getValue)(list);
|
|
848
|
+
const isGroup = item => has(item, 'items');
|
|
849
|
+
const findEntryDelegate = (list, value) => findMap(list, item => {
|
|
850
|
+
if (isGroup(item)) {
|
|
851
|
+
return findEntryDelegate(item.items, value);
|
|
852
|
+
} else if (item.value === value) {
|
|
853
|
+
return Optional.some(item);
|
|
854
|
+
} else {
|
|
855
|
+
return Optional.none();
|
|
856
|
+
}
|
|
857
|
+
});
|
|
858
|
+
const findEntry = (optList, value) => optList.bind(list => findEntryDelegate(list, value));
|
|
859
|
+
const ListUtils = {
|
|
860
|
+
sanitizer,
|
|
861
|
+
sanitize,
|
|
862
|
+
findEntry
|
|
1011
863
|
};
|
|
1012
|
-
var AdvTab = { makeTab: makeTab };
|
|
1013
864
|
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
865
|
+
const makeTab$2 = _info => ({
|
|
866
|
+
title: 'Advanced',
|
|
867
|
+
name: 'advanced',
|
|
868
|
+
items: [{
|
|
869
|
+
type: 'grid',
|
|
870
|
+
columns: 2,
|
|
871
|
+
items: [
|
|
872
|
+
{
|
|
873
|
+
type: 'input',
|
|
874
|
+
label: 'Vertical space',
|
|
875
|
+
name: 'vspace',
|
|
876
|
+
inputMode: 'numeric'
|
|
877
|
+
},
|
|
878
|
+
{
|
|
879
|
+
type: 'input',
|
|
880
|
+
label: 'Horizontal space',
|
|
881
|
+
name: 'hspace',
|
|
882
|
+
inputMode: 'numeric'
|
|
883
|
+
},
|
|
884
|
+
{
|
|
885
|
+
type: 'input',
|
|
886
|
+
label: 'Border width',
|
|
887
|
+
name: 'border',
|
|
888
|
+
inputMode: 'numeric'
|
|
889
|
+
},
|
|
890
|
+
{
|
|
891
|
+
type: 'listbox',
|
|
892
|
+
name: 'borderstyle',
|
|
893
|
+
label: 'Border style',
|
|
894
|
+
items: [
|
|
895
|
+
{
|
|
896
|
+
text: 'Select...',
|
|
1024
897
|
value: ''
|
|
1025
|
-
}
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
898
|
+
},
|
|
899
|
+
{
|
|
900
|
+
text: 'Solid',
|
|
901
|
+
value: 'solid'
|
|
902
|
+
},
|
|
903
|
+
{
|
|
904
|
+
text: 'Dotted',
|
|
905
|
+
value: 'dotted'
|
|
906
|
+
},
|
|
907
|
+
{
|
|
908
|
+
text: 'Dashed',
|
|
909
|
+
value: 'dashed'
|
|
910
|
+
},
|
|
911
|
+
{
|
|
912
|
+
text: 'Double',
|
|
913
|
+
value: 'double'
|
|
914
|
+
},
|
|
915
|
+
{
|
|
916
|
+
text: 'Groove',
|
|
917
|
+
value: 'groove'
|
|
918
|
+
},
|
|
919
|
+
{
|
|
920
|
+
text: 'Ridge',
|
|
921
|
+
value: 'ridge'
|
|
922
|
+
},
|
|
923
|
+
{
|
|
924
|
+
text: 'Inset',
|
|
925
|
+
value: 'inset'
|
|
926
|
+
},
|
|
927
|
+
{
|
|
928
|
+
text: 'Outset',
|
|
929
|
+
value: 'outset'
|
|
930
|
+
},
|
|
931
|
+
{
|
|
932
|
+
text: 'None',
|
|
933
|
+
value: 'none'
|
|
934
|
+
},
|
|
935
|
+
{
|
|
936
|
+
text: 'Hidden',
|
|
937
|
+
value: 'hidden'
|
|
938
|
+
}
|
|
939
|
+
]
|
|
940
|
+
}
|
|
941
|
+
]
|
|
942
|
+
}]
|
|
943
|
+
});
|
|
944
|
+
const AdvTab = { makeTab: makeTab$2 };
|
|
945
|
+
|
|
946
|
+
const collect = editor => {
|
|
947
|
+
const urlListSanitizer = ListUtils.sanitizer(item => editor.convertURL(item.value || item.url || '', 'src'));
|
|
948
|
+
const futureImageList = new Promise(completer => {
|
|
949
|
+
createImageList(editor, imageList => {
|
|
950
|
+
completer(urlListSanitizer(imageList).map(items => flatten([
|
|
951
|
+
[{
|
|
952
|
+
text: 'None',
|
|
953
|
+
value: ''
|
|
954
|
+
}],
|
|
955
|
+
items
|
|
956
|
+
])));
|
|
1029
957
|
});
|
|
1030
958
|
});
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
hasAccessibilityOptions: hasAccessibilityOptions,
|
|
1061
|
-
automaticUploads: automaticUploads
|
|
1062
|
-
};
|
|
1063
|
-
});
|
|
959
|
+
const classList = ListUtils.sanitize(getClassList(editor));
|
|
960
|
+
const hasAdvTab$1 = hasAdvTab(editor);
|
|
961
|
+
const hasUploadTab$1 = hasUploadTab(editor);
|
|
962
|
+
const hasUploadUrl$1 = hasUploadUrl(editor);
|
|
963
|
+
const hasUploadHandler$1 = hasUploadHandler(editor);
|
|
964
|
+
const image = readImageDataFromSelection(editor);
|
|
965
|
+
const hasDescription$1 = hasDescription(editor);
|
|
966
|
+
const hasImageTitle$1 = hasImageTitle(editor);
|
|
967
|
+
const hasDimensions$1 = hasDimensions(editor);
|
|
968
|
+
const hasImageCaption$1 = hasImageCaption(editor);
|
|
969
|
+
const hasAccessibilityOptions = showAccessibilityOptions(editor);
|
|
970
|
+
const automaticUploads = isAutomaticUploadsEnabled(editor);
|
|
971
|
+
const prependURL = Optional.some(getPrependUrl(editor)).filter(preUrl => isString(preUrl) && preUrl.length > 0);
|
|
972
|
+
return futureImageList.then(imageList => ({
|
|
973
|
+
image,
|
|
974
|
+
imageList,
|
|
975
|
+
classList,
|
|
976
|
+
hasAdvTab: hasAdvTab$1,
|
|
977
|
+
hasUploadTab: hasUploadTab$1,
|
|
978
|
+
hasUploadUrl: hasUploadUrl$1,
|
|
979
|
+
hasUploadHandler: hasUploadHandler$1,
|
|
980
|
+
hasDescription: hasDescription$1,
|
|
981
|
+
hasImageTitle: hasImageTitle$1,
|
|
982
|
+
hasDimensions: hasDimensions$1,
|
|
983
|
+
hasImageCaption: hasImageCaption$1,
|
|
984
|
+
prependURL,
|
|
985
|
+
hasAccessibilityOptions,
|
|
986
|
+
automaticUploads
|
|
987
|
+
}));
|
|
1064
988
|
};
|
|
1065
989
|
|
|
1066
|
-
|
|
1067
|
-
|
|
990
|
+
const makeItems = info => {
|
|
991
|
+
const imageUrl = {
|
|
1068
992
|
name: 'src',
|
|
1069
993
|
type: 'urlinput',
|
|
1070
994
|
filetype: 'image',
|
|
1071
|
-
label: 'Source'
|
|
995
|
+
label: 'Source',
|
|
996
|
+
picker_text: 'Browse files'
|
|
1072
997
|
};
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
});
|
|
1081
|
-
var imageDescription = {
|
|
998
|
+
const imageList = info.imageList.map(items => ({
|
|
999
|
+
name: 'images',
|
|
1000
|
+
type: 'listbox',
|
|
1001
|
+
label: 'Image list',
|
|
1002
|
+
items
|
|
1003
|
+
}));
|
|
1004
|
+
const imageDescription = {
|
|
1082
1005
|
name: 'alt',
|
|
1083
1006
|
type: 'input',
|
|
1084
1007
|
label: 'Alternative description',
|
|
1085
|
-
|
|
1008
|
+
enabled: !(info.hasAccessibilityOptions && info.image.isDecorative)
|
|
1086
1009
|
};
|
|
1087
|
-
|
|
1010
|
+
const imageTitle = {
|
|
1088
1011
|
name: 'title',
|
|
1089
1012
|
type: 'input',
|
|
1090
1013
|
label: 'Image title'
|
|
1091
1014
|
};
|
|
1092
|
-
|
|
1015
|
+
const imageDimensions = {
|
|
1093
1016
|
name: 'dimensions',
|
|
1094
1017
|
type: 'sizeinput'
|
|
1095
1018
|
};
|
|
1096
|
-
|
|
1019
|
+
const isDecorative = {
|
|
1097
1020
|
type: 'label',
|
|
1098
1021
|
label: 'Accessibility',
|
|
1099
1022
|
items: [{
|
|
@@ -1102,15 +1025,13 @@
|
|
|
1102
1025
|
label: 'Image is decorative'
|
|
1103
1026
|
}]
|
|
1104
1027
|
};
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
});
|
|
1113
|
-
var caption = {
|
|
1028
|
+
const classList = info.classList.map(items => ({
|
|
1029
|
+
name: 'classes',
|
|
1030
|
+
type: 'listbox',
|
|
1031
|
+
label: 'Class',
|
|
1032
|
+
items
|
|
1033
|
+
}));
|
|
1034
|
+
const caption = {
|
|
1114
1035
|
type: 'label',
|
|
1115
1036
|
label: 'Caption',
|
|
1116
1037
|
items: [{
|
|
@@ -1119,12 +1040,10 @@
|
|
|
1119
1040
|
label: 'Show caption'
|
|
1120
1041
|
}]
|
|
1121
1042
|
};
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
} : { type: 'panel' };
|
|
1127
|
-
};
|
|
1043
|
+
const getDialogContainerType = useColumns => useColumns ? {
|
|
1044
|
+
type: 'grid',
|
|
1045
|
+
columns: 2
|
|
1046
|
+
} : { type: 'panel' };
|
|
1128
1047
|
return flatten([
|
|
1129
1048
|
[imageUrl],
|
|
1130
1049
|
imageList.toArray(),
|
|
@@ -1132,90 +1051,83 @@
|
|
|
1132
1051
|
info.hasDescription ? [imageDescription] : [],
|
|
1133
1052
|
info.hasImageTitle ? [imageTitle] : [],
|
|
1134
1053
|
info.hasDimensions ? [imageDimensions] : [],
|
|
1135
|
-
[
|
|
1054
|
+
[{
|
|
1055
|
+
...getDialogContainerType(info.classList.isSome() && info.hasImageCaption),
|
|
1136
1056
|
items: flatten([
|
|
1137
1057
|
classList.toArray(),
|
|
1138
1058
|
info.hasImageCaption ? [caption] : []
|
|
1139
1059
|
])
|
|
1140
|
-
}
|
|
1060
|
+
}]
|
|
1141
1061
|
]);
|
|
1142
1062
|
};
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
};
|
|
1150
|
-
var MainTab = {
|
|
1063
|
+
const makeTab$1 = info => ({
|
|
1064
|
+
title: 'General',
|
|
1065
|
+
name: 'general',
|
|
1066
|
+
items: makeItems(info)
|
|
1067
|
+
});
|
|
1068
|
+
const MainTab = {
|
|
1151
1069
|
makeTab: makeTab$1,
|
|
1152
|
-
makeItems
|
|
1070
|
+
makeItems
|
|
1153
1071
|
};
|
|
1154
1072
|
|
|
1155
|
-
|
|
1156
|
-
|
|
1073
|
+
const makeTab = _info => {
|
|
1074
|
+
const items = [{
|
|
1157
1075
|
type: 'dropzone',
|
|
1158
1076
|
name: 'fileinput'
|
|
1159
1077
|
}];
|
|
1160
1078
|
return {
|
|
1161
1079
|
title: 'Upload',
|
|
1162
1080
|
name: 'upload',
|
|
1163
|
-
items
|
|
1081
|
+
items
|
|
1164
1082
|
};
|
|
1165
1083
|
};
|
|
1166
|
-
|
|
1084
|
+
const UploadTab = { makeTab };
|
|
1167
1085
|
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
border: data.border,
|
|
1212
|
-
borderStyle: data.borderstyle,
|
|
1213
|
-
isDecorative: data.isDecorative
|
|
1214
|
-
};
|
|
1215
|
-
};
|
|
1216
|
-
var addPrependUrl2 = function (info, srcURL) {
|
|
1086
|
+
const createState = info => ({
|
|
1087
|
+
prevImage: ListUtils.findEntry(info.imageList, info.image.src),
|
|
1088
|
+
prevAlt: info.image.alt,
|
|
1089
|
+
open: true
|
|
1090
|
+
});
|
|
1091
|
+
const fromImageData = image => ({
|
|
1092
|
+
src: {
|
|
1093
|
+
value: image.src,
|
|
1094
|
+
meta: {}
|
|
1095
|
+
},
|
|
1096
|
+
images: image.src,
|
|
1097
|
+
alt: image.alt,
|
|
1098
|
+
title: image.title,
|
|
1099
|
+
dimensions: {
|
|
1100
|
+
width: image.width,
|
|
1101
|
+
height: image.height
|
|
1102
|
+
},
|
|
1103
|
+
classes: image.class,
|
|
1104
|
+
caption: image.caption,
|
|
1105
|
+
style: image.style,
|
|
1106
|
+
vspace: image.vspace,
|
|
1107
|
+
border: image.border,
|
|
1108
|
+
hspace: image.hspace,
|
|
1109
|
+
borderstyle: image.borderStyle,
|
|
1110
|
+
fileinput: [],
|
|
1111
|
+
isDecorative: image.isDecorative
|
|
1112
|
+
});
|
|
1113
|
+
const toImageData = (data, removeEmptyAlt) => ({
|
|
1114
|
+
src: data.src.value,
|
|
1115
|
+
alt: (data.alt === null || data.alt.length === 0) && removeEmptyAlt ? null : data.alt,
|
|
1116
|
+
title: data.title,
|
|
1117
|
+
width: data.dimensions.width,
|
|
1118
|
+
height: data.dimensions.height,
|
|
1119
|
+
class: data.classes,
|
|
1120
|
+
style: data.style,
|
|
1121
|
+
caption: data.caption,
|
|
1122
|
+
hspace: data.hspace,
|
|
1123
|
+
vspace: data.vspace,
|
|
1124
|
+
border: data.border,
|
|
1125
|
+
borderStyle: data.borderstyle,
|
|
1126
|
+
isDecorative: data.isDecorative
|
|
1127
|
+
});
|
|
1128
|
+
const addPrependUrl2 = (info, srcURL) => {
|
|
1217
1129
|
if (!/^(?:[a-zA-Z]+:)?\/\//.test(srcURL)) {
|
|
1218
|
-
return info.prependURL.bind(
|
|
1130
|
+
return info.prependURL.bind(prependUrl => {
|
|
1219
1131
|
if (srcURL.substring(0, prependUrl.length) !== prependUrl) {
|
|
1220
1132
|
return Optional.some(prependUrl + srcURL);
|
|
1221
1133
|
}
|
|
@@ -1224,9 +1136,9 @@
|
|
|
1224
1136
|
}
|
|
1225
1137
|
return Optional.none();
|
|
1226
1138
|
};
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
addPrependUrl2(info, data.src.value).each(
|
|
1139
|
+
const addPrependUrl = (info, api) => {
|
|
1140
|
+
const data = api.getData();
|
|
1141
|
+
addPrependUrl2(info, data.src.value).each(srcURL => {
|
|
1230
1142
|
api.setData({
|
|
1231
1143
|
src: {
|
|
1232
1144
|
value: srcURL,
|
|
@@ -1235,7 +1147,7 @@
|
|
|
1235
1147
|
});
|
|
1236
1148
|
});
|
|
1237
1149
|
};
|
|
1238
|
-
|
|
1150
|
+
const formFillFromMeta2 = (info, data, meta) => {
|
|
1239
1151
|
if (info.hasDescription && isString(meta.alt)) {
|
|
1240
1152
|
data.alt = meta.alt;
|
|
1241
1153
|
}
|
|
@@ -1254,7 +1166,7 @@
|
|
|
1254
1166
|
}
|
|
1255
1167
|
}
|
|
1256
1168
|
if (isString(meta.class)) {
|
|
1257
|
-
ListUtils.findEntry(info.classList, meta.class).each(
|
|
1169
|
+
ListUtils.findEntry(info.classList, meta.class).each(entry => {
|
|
1258
1170
|
data.classes = entry.value;
|
|
1259
1171
|
});
|
|
1260
1172
|
}
|
|
@@ -1281,28 +1193,26 @@
|
|
|
1281
1193
|
}
|
|
1282
1194
|
}
|
|
1283
1195
|
};
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1196
|
+
const formFillFromMeta = (info, api) => {
|
|
1197
|
+
const data = api.getData();
|
|
1198
|
+
const meta = data.src.meta;
|
|
1287
1199
|
if (meta !== undefined) {
|
|
1288
|
-
|
|
1200
|
+
const newData = deepMerge({}, data);
|
|
1289
1201
|
formFillFromMeta2(info, newData, meta);
|
|
1290
1202
|
api.setData(newData);
|
|
1291
1203
|
}
|
|
1292
1204
|
};
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1205
|
+
const calculateImageSize = (helpers, info, state, api) => {
|
|
1206
|
+
const data = api.getData();
|
|
1207
|
+
const url = data.src.value;
|
|
1208
|
+
const meta = data.src.meta || {};
|
|
1297
1209
|
if (!meta.width && !meta.height && info.hasDimensions) {
|
|
1298
1210
|
if (isNotEmpty(url)) {
|
|
1299
|
-
helpers.imageSize(url).then(
|
|
1211
|
+
helpers.imageSize(url).then(size => {
|
|
1300
1212
|
if (state.open) {
|
|
1301
1213
|
api.setData({ dimensions: size });
|
|
1302
1214
|
}
|
|
1303
|
-
}).catch(
|
|
1304
|
-
return console.error(e);
|
|
1305
|
-
});
|
|
1215
|
+
}).catch(e => console.error(e));
|
|
1306
1216
|
} else {
|
|
1307
1217
|
api.setData({
|
|
1308
1218
|
dimensions: {
|
|
@@ -1313,29 +1223,23 @@
|
|
|
1313
1223
|
}
|
|
1314
1224
|
}
|
|
1315
1225
|
};
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1226
|
+
const updateImagesDropdown = (info, state, api) => {
|
|
1227
|
+
const data = api.getData();
|
|
1228
|
+
const image = ListUtils.findEntry(info.imageList, data.src.value);
|
|
1319
1229
|
state.prevImage = image;
|
|
1320
|
-
api.setData({
|
|
1321
|
-
images: image.map(function (entry) {
|
|
1322
|
-
return entry.value;
|
|
1323
|
-
}).getOr('')
|
|
1324
|
-
});
|
|
1230
|
+
api.setData({ images: image.map(entry => entry.value).getOr('') });
|
|
1325
1231
|
};
|
|
1326
|
-
|
|
1232
|
+
const changeSrc = (helpers, info, state, api) => {
|
|
1327
1233
|
addPrependUrl(info, api);
|
|
1328
1234
|
formFillFromMeta(info, api);
|
|
1329
1235
|
calculateImageSize(helpers, info, state, api);
|
|
1330
1236
|
updateImagesDropdown(info, state, api);
|
|
1331
1237
|
};
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
image.each(
|
|
1336
|
-
|
|
1337
|
-
return image.text === data.alt;
|
|
1338
|
-
}).getOr(false);
|
|
1238
|
+
const changeImages = (helpers, info, state, api) => {
|
|
1239
|
+
const data = api.getData();
|
|
1240
|
+
const image = ListUtils.findEntry(info.imageList, data.images);
|
|
1241
|
+
image.each(img => {
|
|
1242
|
+
const updateAlt = data.alt === '' || state.prevImage.map(image => image.text === data.alt).getOr(false);
|
|
1339
1243
|
if (updateAlt) {
|
|
1340
1244
|
if (img.value === '') {
|
|
1341
1245
|
api.setData({
|
|
@@ -1355,55 +1259,18 @@
|
|
|
1355
1259
|
state.prevImage = image;
|
|
1356
1260
|
changeSrc(helpers, info, state, api);
|
|
1357
1261
|
};
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
return matchingTopBottom ? removePixelSuffix(String(css['margin-top'])) : '';
|
|
1361
|
-
};
|
|
1362
|
-
var calcHSpace = function (css) {
|
|
1363
|
-
var matchingLeftRight = css['margin-right'] && css['margin-left'] && css['margin-right'] === css['margin-left'];
|
|
1364
|
-
return matchingLeftRight ? removePixelSuffix(String(css['margin-right'])) : '';
|
|
1365
|
-
};
|
|
1366
|
-
var calcBorderWidth = function (css) {
|
|
1367
|
-
return css['border-width'] ? removePixelSuffix(String(css['border-width'])) : '';
|
|
1368
|
-
};
|
|
1369
|
-
var calcBorderStyle = function (css) {
|
|
1370
|
-
return css['border-style'] ? String(css['border-style']) : '';
|
|
1371
|
-
};
|
|
1372
|
-
var calcStyle = function (parseStyle, serializeStyle, css) {
|
|
1373
|
-
return serializeStyle(parseStyle(serializeStyle(css)));
|
|
1374
|
-
};
|
|
1375
|
-
var changeStyle2 = function (parseStyle, serializeStyle, data) {
|
|
1376
|
-
var css = mergeMargins(parseStyle(data.style));
|
|
1377
|
-
var dataCopy = deepMerge({}, data);
|
|
1378
|
-
dataCopy.vspace = calcVSpace(css);
|
|
1379
|
-
dataCopy.hspace = calcHSpace(css);
|
|
1380
|
-
dataCopy.border = calcBorderWidth(css);
|
|
1381
|
-
dataCopy.borderstyle = calcBorderStyle(css);
|
|
1382
|
-
dataCopy.style = calcStyle(parseStyle, serializeStyle, css);
|
|
1383
|
-
return dataCopy;
|
|
1384
|
-
};
|
|
1385
|
-
var changeStyle = function (helpers, api) {
|
|
1386
|
-
var data = api.getData();
|
|
1387
|
-
var newData = changeStyle2(helpers.parseStyle, helpers.serializeStyle, data);
|
|
1388
|
-
api.setData(newData);
|
|
1389
|
-
};
|
|
1390
|
-
var changeAStyle = function (helpers, info, api) {
|
|
1391
|
-
var data = deepMerge(fromImageData(info.image), api.getData());
|
|
1392
|
-
var style = getStyleValue(helpers.normalizeCss, toImageData(data, false));
|
|
1393
|
-
api.setData({ style: style });
|
|
1394
|
-
};
|
|
1395
|
-
var changeFileInput = function (helpers, info, state, api) {
|
|
1396
|
-
var data = api.getData();
|
|
1262
|
+
const changeFileInput = (helpers, info, state, api) => {
|
|
1263
|
+
const data = api.getData();
|
|
1397
1264
|
api.block('Uploading image');
|
|
1398
|
-
head(data.fileinput).fold(
|
|
1265
|
+
head(data.fileinput).fold(() => {
|
|
1399
1266
|
api.unblock();
|
|
1400
|
-
},
|
|
1401
|
-
|
|
1402
|
-
|
|
1267
|
+
}, file => {
|
|
1268
|
+
const blobUri = URL.createObjectURL(file);
|
|
1269
|
+
const finalize = () => {
|
|
1403
1270
|
api.unblock();
|
|
1404
1271
|
URL.revokeObjectURL(blobUri);
|
|
1405
1272
|
};
|
|
1406
|
-
|
|
1273
|
+
const updateSrcAndSwitchTab = url => {
|
|
1407
1274
|
api.setData({
|
|
1408
1275
|
src: {
|
|
1409
1276
|
value: url,
|
|
@@ -1413,13 +1280,13 @@
|
|
|
1413
1280
|
api.showTab('general');
|
|
1414
1281
|
changeSrc(helpers, info, state, api);
|
|
1415
1282
|
};
|
|
1416
|
-
blobToDataUri(file).then(
|
|
1417
|
-
|
|
1283
|
+
blobToDataUri(file).then(dataUrl => {
|
|
1284
|
+
const blobInfo = helpers.createBlobCache(file, blobUri, dataUrl);
|
|
1418
1285
|
if (info.automaticUploads) {
|
|
1419
|
-
helpers.uploadImage(blobInfo).then(
|
|
1286
|
+
helpers.uploadImage(blobInfo).then(result => {
|
|
1420
1287
|
updateSrcAndSwitchTab(result.url);
|
|
1421
1288
|
finalize();
|
|
1422
|
-
}).catch(
|
|
1289
|
+
}).catch(err => {
|
|
1423
1290
|
finalize();
|
|
1424
1291
|
helpers.alertErr(err);
|
|
1425
1292
|
});
|
|
@@ -1431,37 +1298,25 @@
|
|
|
1431
1298
|
});
|
|
1432
1299
|
});
|
|
1433
1300
|
};
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
} else if (evt.name === 'fileinput') {
|
|
1447
|
-
changeFileInput(helpers, info, state, api);
|
|
1448
|
-
} else if (evt.name === 'isDecorative') {
|
|
1449
|
-
if (api.getData().isDecorative) {
|
|
1450
|
-
api.disable('alt');
|
|
1451
|
-
} else {
|
|
1452
|
-
api.enable('alt');
|
|
1453
|
-
}
|
|
1454
|
-
}
|
|
1455
|
-
};
|
|
1301
|
+
const changeHandler = (helpers, info, state) => (api, evt) => {
|
|
1302
|
+
if (evt.name === 'src') {
|
|
1303
|
+
changeSrc(helpers, info, state, api);
|
|
1304
|
+
} else if (evt.name === 'images') {
|
|
1305
|
+
changeImages(helpers, info, state, api);
|
|
1306
|
+
} else if (evt.name === 'alt') {
|
|
1307
|
+
state.prevAlt = api.getData().alt;
|
|
1308
|
+
} else if (evt.name === 'fileinput') {
|
|
1309
|
+
changeFileInput(helpers, info, state, api);
|
|
1310
|
+
} else if (evt.name === 'isDecorative') {
|
|
1311
|
+
api.setEnabled('alt', !api.getData().isDecorative);
|
|
1312
|
+
}
|
|
1456
1313
|
};
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
state.open = false;
|
|
1460
|
-
};
|
|
1314
|
+
const closeHandler = state => () => {
|
|
1315
|
+
state.open = false;
|
|
1461
1316
|
};
|
|
1462
|
-
|
|
1317
|
+
const makeDialogBody = info => {
|
|
1463
1318
|
if (info.hasAdvTab || info.hasUploadUrl || info.hasUploadHandler) {
|
|
1464
|
-
|
|
1319
|
+
const tabPanel = {
|
|
1465
1320
|
type: 'tabpanel',
|
|
1466
1321
|
tabs: flatten([
|
|
1467
1322
|
[MainTab.makeTab(info)],
|
|
@@ -1471,191 +1326,180 @@
|
|
|
1471
1326
|
};
|
|
1472
1327
|
return tabPanel;
|
|
1473
1328
|
} else {
|
|
1474
|
-
|
|
1329
|
+
const panel = {
|
|
1475
1330
|
type: 'panel',
|
|
1476
1331
|
items: MainTab.makeItems(info)
|
|
1477
1332
|
};
|
|
1478
1333
|
return panel;
|
|
1479
1334
|
}
|
|
1480
1335
|
};
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
size: 'normal',
|
|
1487
|
-
body: makeDialogBody(info),
|
|
1488
|
-
buttons: [
|
|
1489
|
-
{
|
|
1490
|
-
type: 'cancel',
|
|
1491
|
-
name: 'cancel',
|
|
1492
|
-
text: 'Cancel'
|
|
1493
|
-
},
|
|
1494
|
-
{
|
|
1495
|
-
type: 'submit',
|
|
1496
|
-
name: 'save',
|
|
1497
|
-
text: 'Save',
|
|
1498
|
-
primary: true
|
|
1499
|
-
}
|
|
1500
|
-
],
|
|
1501
|
-
initialData: fromImageData(info.image),
|
|
1502
|
-
onSubmit: helpers.onSubmit(info),
|
|
1503
|
-
onChange: changeHandler(helpers, info, state),
|
|
1504
|
-
onClose: closeHandler(state)
|
|
1505
|
-
};
|
|
1506
|
-
};
|
|
1507
|
-
};
|
|
1508
|
-
var submitHandler = function (editor) {
|
|
1509
|
-
return function (info) {
|
|
1510
|
-
return function (api) {
|
|
1511
|
-
var data = deepMerge(fromImageData(info.image), api.getData());
|
|
1512
|
-
editor.execCommand('mceUpdateImage', false, toImageData(data, info.hasAccessibilityOptions));
|
|
1513
|
-
editor.editorUpload.uploadImagesAuto();
|
|
1514
|
-
api.close();
|
|
1515
|
-
};
|
|
1516
|
-
};
|
|
1517
|
-
};
|
|
1518
|
-
var imageSize = function (editor) {
|
|
1519
|
-
return function (url) {
|
|
1520
|
-
return getImageSize(editor.documentBaseURI.toAbsolute(url)).then(function (dimensions) {
|
|
1521
|
-
return {
|
|
1522
|
-
width: String(dimensions.width),
|
|
1523
|
-
height: String(dimensions.height)
|
|
1524
|
-
};
|
|
1525
|
-
});
|
|
1336
|
+
const submitHandler = (editor, info, helpers) => api => {
|
|
1337
|
+
const data = deepMerge(fromImageData(info.image), api.getData());
|
|
1338
|
+
const finalData = {
|
|
1339
|
+
...data,
|
|
1340
|
+
style: getStyleValue(helpers.normalizeCss, toImageData(data, false))
|
|
1526
1341
|
};
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1342
|
+
editor.execCommand('mceUpdateImage', false, toImageData(finalData, info.hasAccessibilityOptions));
|
|
1343
|
+
editor.editorUpload.uploadImagesAuto();
|
|
1344
|
+
api.close();
|
|
1345
|
+
};
|
|
1346
|
+
const imageSize = editor => url => {
|
|
1347
|
+
if (!isSafeImageUrl(editor, url)) {
|
|
1348
|
+
return Promise.resolve({
|
|
1349
|
+
width: '',
|
|
1350
|
+
height: ''
|
|
1536
1351
|
});
|
|
1537
|
-
}
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
}
|
|
1543
|
-
};
|
|
1544
|
-
var alertErr = function (editor) {
|
|
1545
|
-
return function (message) {
|
|
1546
|
-
editor.windowManager.alert(message);
|
|
1547
|
-
};
|
|
1548
|
-
};
|
|
1549
|
-
var normalizeCss$1 = function (editor) {
|
|
1550
|
-
return function (cssText) {
|
|
1551
|
-
return normalizeCss(editor, cssText);
|
|
1552
|
-
};
|
|
1553
|
-
};
|
|
1554
|
-
var parseStyle = function (editor) {
|
|
1555
|
-
return function (cssText) {
|
|
1556
|
-
return editor.dom.parseStyle(cssText);
|
|
1557
|
-
};
|
|
1558
|
-
};
|
|
1559
|
-
var serializeStyle = function (editor) {
|
|
1560
|
-
return function (stylesArg, name) {
|
|
1561
|
-
return editor.dom.serializeStyle(stylesArg, name);
|
|
1562
|
-
};
|
|
1352
|
+
} else {
|
|
1353
|
+
return getImageSize(editor.documentBaseURI.toAbsolute(url)).then(dimensions => ({
|
|
1354
|
+
width: String(dimensions.width),
|
|
1355
|
+
height: String(dimensions.height)
|
|
1356
|
+
}));
|
|
1357
|
+
}
|
|
1563
1358
|
};
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
}
|
|
1574
|
-
});
|
|
1575
|
-
};
|
|
1359
|
+
const createBlobCache = editor => (file, blobUri, dataUrl) => {
|
|
1360
|
+
var _a;
|
|
1361
|
+
return editor.editorUpload.blobCache.create({
|
|
1362
|
+
blob: file,
|
|
1363
|
+
blobUri,
|
|
1364
|
+
name: (_a = file.name) === null || _a === void 0 ? void 0 : _a.replace(/\.[^\.]+$/, ''),
|
|
1365
|
+
filename: file.name,
|
|
1366
|
+
base64: dataUrl.split(',')[1]
|
|
1367
|
+
});
|
|
1576
1368
|
};
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1369
|
+
const addToBlobCache = editor => blobInfo => {
|
|
1370
|
+
editor.editorUpload.blobCache.add(blobInfo);
|
|
1371
|
+
};
|
|
1372
|
+
const alertErr = editor => message => {
|
|
1373
|
+
editor.windowManager.alert(message);
|
|
1374
|
+
};
|
|
1375
|
+
const normalizeCss = editor => cssText => normalizeCss$1(editor, cssText);
|
|
1376
|
+
const parseStyle = editor => cssText => editor.dom.parseStyle(cssText);
|
|
1377
|
+
const serializeStyle = editor => (stylesArg, name) => editor.dom.serializeStyle(stylesArg, name);
|
|
1378
|
+
const uploadImage = editor => blobInfo => global$1(editor).upload([blobInfo], false).then(results => {
|
|
1379
|
+
var _a;
|
|
1380
|
+
if (results.length === 0) {
|
|
1381
|
+
return Promise.reject('Failed to upload image');
|
|
1382
|
+
} else if (results[0].status === false) {
|
|
1383
|
+
return Promise.reject((_a = results[0].error) === null || _a === void 0 ? void 0 : _a.message);
|
|
1384
|
+
} else {
|
|
1385
|
+
return results[0];
|
|
1386
|
+
}
|
|
1387
|
+
});
|
|
1388
|
+
const Dialog = editor => {
|
|
1389
|
+
const helpers = {
|
|
1580
1390
|
imageSize: imageSize(editor),
|
|
1581
1391
|
addToBlobCache: addToBlobCache(editor),
|
|
1582
1392
|
createBlobCache: createBlobCache(editor),
|
|
1583
1393
|
alertErr: alertErr(editor),
|
|
1584
|
-
normalizeCss: normalizeCss
|
|
1394
|
+
normalizeCss: normalizeCss(editor),
|
|
1585
1395
|
parseStyle: parseStyle(editor),
|
|
1586
1396
|
serializeStyle: serializeStyle(editor),
|
|
1587
1397
|
uploadImage: uploadImage(editor)
|
|
1588
1398
|
};
|
|
1589
|
-
|
|
1590
|
-
collect(editor).then(
|
|
1399
|
+
const open = () => {
|
|
1400
|
+
collect(editor).then(info => {
|
|
1401
|
+
const state = createState(info);
|
|
1402
|
+
return {
|
|
1403
|
+
title: 'Insert/Edit Image',
|
|
1404
|
+
size: 'normal',
|
|
1405
|
+
body: makeDialogBody(info),
|
|
1406
|
+
buttons: [
|
|
1407
|
+
{
|
|
1408
|
+
type: 'cancel',
|
|
1409
|
+
name: 'cancel',
|
|
1410
|
+
text: 'Cancel'
|
|
1411
|
+
},
|
|
1412
|
+
{
|
|
1413
|
+
type: 'submit',
|
|
1414
|
+
name: 'save',
|
|
1415
|
+
text: 'Save',
|
|
1416
|
+
primary: true
|
|
1417
|
+
}
|
|
1418
|
+
],
|
|
1419
|
+
initialData: fromImageData(info.image),
|
|
1420
|
+
onSubmit: submitHandler(editor, info, helpers),
|
|
1421
|
+
onChange: changeHandler(helpers, info, state),
|
|
1422
|
+
onClose: closeHandler(state)
|
|
1423
|
+
};
|
|
1424
|
+
}).then(editor.windowManager.open);
|
|
1591
1425
|
};
|
|
1592
|
-
return { open
|
|
1426
|
+
return { open };
|
|
1593
1427
|
};
|
|
1594
1428
|
|
|
1595
|
-
|
|
1429
|
+
const register$1 = editor => {
|
|
1596
1430
|
editor.addCommand('mceImage', Dialog(editor).open);
|
|
1597
|
-
editor.addCommand('mceUpdateImage',
|
|
1598
|
-
editor.undoManager.transact(
|
|
1599
|
-
return insertOrUpdateImage(editor, data);
|
|
1600
|
-
});
|
|
1431
|
+
editor.addCommand('mceUpdateImage', (_ui, data) => {
|
|
1432
|
+
editor.undoManager.transact(() => insertOrUpdateImage(editor, data));
|
|
1601
1433
|
});
|
|
1602
1434
|
};
|
|
1603
1435
|
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
return className && /\bimage\b/.test(className);
|
|
1607
|
-
};
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
node.attr('contenteditable', state ? 'true' : null);
|
|
1613
|
-
};
|
|
1614
|
-
while (i--) {
|
|
1615
|
-
var node = nodes[i];
|
|
1616
|
-
if (hasImageClass(node)) {
|
|
1617
|
-
node.attr('contenteditable', state ? 'false' : null);
|
|
1618
|
-
global$5.each(node.getAll('figcaption'), toggleContentEditable);
|
|
1619
|
-
}
|
|
1620
|
-
}
|
|
1436
|
+
const hasImageClass = node => {
|
|
1437
|
+
const className = node.attr('class');
|
|
1438
|
+
return isNonNullable(className) && /\bimage\b/.test(className);
|
|
1439
|
+
};
|
|
1440
|
+
const toggleContentEditableState = state => nodes => {
|
|
1441
|
+
let i = nodes.length;
|
|
1442
|
+
const toggleContentEditable = node => {
|
|
1443
|
+
node.attr('contenteditable', state ? 'true' : null);
|
|
1621
1444
|
};
|
|
1445
|
+
while (i--) {
|
|
1446
|
+
const node = nodes[i];
|
|
1447
|
+
if (hasImageClass(node)) {
|
|
1448
|
+
node.attr('contenteditable', state ? 'false' : null);
|
|
1449
|
+
global.each(node.getAll('figcaption'), toggleContentEditable);
|
|
1450
|
+
}
|
|
1451
|
+
}
|
|
1622
1452
|
};
|
|
1623
|
-
|
|
1624
|
-
editor.on('PreInit',
|
|
1453
|
+
const setup = editor => {
|
|
1454
|
+
editor.on('PreInit', () => {
|
|
1625
1455
|
editor.parser.addNodeFilter('figure', toggleContentEditableState(true));
|
|
1626
1456
|
editor.serializer.addNodeFilter('figure', toggleContentEditableState(false));
|
|
1627
1457
|
});
|
|
1628
1458
|
};
|
|
1629
1459
|
|
|
1630
|
-
|
|
1460
|
+
const onSetupEditable = editor => api => {
|
|
1461
|
+
const nodeChanged = () => {
|
|
1462
|
+
api.setEnabled(editor.selection.isEditable());
|
|
1463
|
+
};
|
|
1464
|
+
editor.on('NodeChange', nodeChanged);
|
|
1465
|
+
nodeChanged();
|
|
1466
|
+
return () => {
|
|
1467
|
+
editor.off('NodeChange', nodeChanged);
|
|
1468
|
+
};
|
|
1469
|
+
};
|
|
1470
|
+
const register = editor => {
|
|
1631
1471
|
editor.ui.registry.addToggleButton('image', {
|
|
1632
1472
|
icon: 'image',
|
|
1633
1473
|
tooltip: 'Insert/edit image',
|
|
1634
1474
|
onAction: Dialog(editor).open,
|
|
1635
|
-
onSetup:
|
|
1636
|
-
|
|
1475
|
+
onSetup: buttonApi => {
|
|
1476
|
+
buttonApi.setActive(isNonNullable(getSelectedImage(editor)));
|
|
1477
|
+
const unbindSelectorChanged = editor.selection.selectorChangedWithUnbind('img:not([data-mce-object]):not([data-mce-placeholder]),figure.image', buttonApi.setActive).unbind;
|
|
1478
|
+
const unbindEditable = onSetupEditable(editor)(buttonApi);
|
|
1479
|
+
return () => {
|
|
1480
|
+
unbindSelectorChanged();
|
|
1481
|
+
unbindEditable();
|
|
1482
|
+
};
|
|
1637
1483
|
}
|
|
1638
1484
|
});
|
|
1639
1485
|
editor.ui.registry.addMenuItem('image', {
|
|
1640
1486
|
icon: 'image',
|
|
1641
1487
|
text: 'Image...',
|
|
1642
|
-
onAction: Dialog(editor).open
|
|
1643
|
-
|
|
1644
|
-
editor.ui.registry.addContextMenu('image', {
|
|
1645
|
-
update: function (element) {
|
|
1646
|
-
return isFigure(element) || isImage(element) && !isPlaceholderImage(element) ? ['image'] : [];
|
|
1647
|
-
}
|
|
1488
|
+
onAction: Dialog(editor).open,
|
|
1489
|
+
onSetup: onSetupEditable(editor)
|
|
1648
1490
|
});
|
|
1491
|
+
editor.ui.registry.addContextMenu('image', { update: element => editor.selection.isEditable() && (isFigure(element) || isImage(element) && !isPlaceholderImage(element)) ? ['image'] : [] });
|
|
1649
1492
|
};
|
|
1650
1493
|
|
|
1651
|
-
|
|
1652
|
-
global.add('image',
|
|
1494
|
+
var Plugin = () => {
|
|
1495
|
+
global$4.add('image', editor => {
|
|
1496
|
+
register$2(editor);
|
|
1653
1497
|
setup(editor);
|
|
1654
|
-
register$1(editor);
|
|
1655
1498
|
register(editor);
|
|
1499
|
+
register$1(editor);
|
|
1656
1500
|
});
|
|
1657
|
-
}
|
|
1501
|
+
};
|
|
1658
1502
|
|
|
1659
1503
|
Plugin();
|
|
1660
1504
|
|
|
1661
|
-
}()
|
|
1505
|
+
})();
|