argous 1.2.201 → 1.2.203
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/DropArea/DropArea.js +2 -7
- package/dist/components/Editor/components/Editor.d.ts +4 -4
- package/dist/components/Editor/components/Editor.js +3 -3
- 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/DropArea/DropArea.js +9 -10
- package/lib/components/Editor/components/Editor.tsx +8 -8
- 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/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,239 +1,187 @@
|
|
|
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');
|
|
13
|
-
|
|
14
|
-
var global$1 = tinymce.util.Tools.resolve('tinymce.util.VK');
|
|
8
|
+
var global$5 = tinymce.util.Tools.resolve('tinymce.PluginManager');
|
|
15
9
|
|
|
16
|
-
|
|
17
|
-
var
|
|
10
|
+
const hasProto = (v, constructor, predicate) => {
|
|
11
|
+
var _a;
|
|
12
|
+
if (predicate(v, constructor.prototype)) {
|
|
13
|
+
return true;
|
|
14
|
+
} else {
|
|
15
|
+
return ((_a = v.constructor) === null || _a === void 0 ? void 0 : _a.name) === constructor.name;
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
const typeOf = x => {
|
|
19
|
+
const t = typeof x;
|
|
18
20
|
if (x === null) {
|
|
19
21
|
return 'null';
|
|
20
|
-
} else if (t === 'object' &&
|
|
22
|
+
} else if (t === 'object' && Array.isArray(x)) {
|
|
21
23
|
return 'array';
|
|
22
|
-
} else if (t === 'object' && (String
|
|
24
|
+
} else if (t === 'object' && hasProto(x, String, (o, proto) => proto.isPrototypeOf(o))) {
|
|
23
25
|
return 'string';
|
|
24
26
|
} else {
|
|
25
27
|
return t;
|
|
26
28
|
}
|
|
27
29
|
};
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
var isFunction = isSimpleType('function');
|
|
48
|
-
|
|
49
|
-
var assumeExternalTargets = function (editor) {
|
|
50
|
-
var externalTargets = editor.getParam('link_assume_external_targets', false);
|
|
51
|
-
if (isBoolean(externalTargets) && externalTargets) {
|
|
52
|
-
return 1;
|
|
53
|
-
} else if (isString(externalTargets) && (externalTargets === 'http' || externalTargets === 'https')) {
|
|
54
|
-
return externalTargets;
|
|
30
|
+
const isType = type => value => typeOf(value) === type;
|
|
31
|
+
const isSimpleType = type => value => typeof value === type;
|
|
32
|
+
const eq = t => a => t === a;
|
|
33
|
+
const isString = isType('string');
|
|
34
|
+
const isObject = isType('object');
|
|
35
|
+
const isArray = isType('array');
|
|
36
|
+
const isNull = eq(null);
|
|
37
|
+
const isBoolean = isSimpleType('boolean');
|
|
38
|
+
const isNullable = a => a === null || a === undefined;
|
|
39
|
+
const isNonNullable = a => !isNullable(a);
|
|
40
|
+
const isFunction = isSimpleType('function');
|
|
41
|
+
const isArrayOf = (value, pred) => {
|
|
42
|
+
if (isArray(value)) {
|
|
43
|
+
for (let i = 0, len = value.length; i < len; ++i) {
|
|
44
|
+
if (!pred(value[i])) {
|
|
45
|
+
return false;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
return true;
|
|
55
49
|
}
|
|
56
|
-
return
|
|
57
|
-
};
|
|
58
|
-
var hasContextToolbar = function (editor) {
|
|
59
|
-
return editor.getParam('link_context_toolbar', false, 'boolean');
|
|
60
|
-
};
|
|
61
|
-
var getLinkList = function (editor) {
|
|
62
|
-
return editor.getParam('link_list');
|
|
63
|
-
};
|
|
64
|
-
var getDefaultLinkTarget = function (editor) {
|
|
65
|
-
return editor.getParam('default_link_target');
|
|
66
|
-
};
|
|
67
|
-
var getTargetList = function (editor) {
|
|
68
|
-
return editor.getParam('target_list', true);
|
|
69
|
-
};
|
|
70
|
-
var getRelList = function (editor) {
|
|
71
|
-
return editor.getParam('rel_list', [], 'array');
|
|
72
|
-
};
|
|
73
|
-
var getLinkClassList = function (editor) {
|
|
74
|
-
return editor.getParam('link_class_list', [], 'array');
|
|
75
|
-
};
|
|
76
|
-
var shouldShowLinkTitle = function (editor) {
|
|
77
|
-
return editor.getParam('link_title', true, 'boolean');
|
|
78
|
-
};
|
|
79
|
-
var allowUnsafeLinkTarget = function (editor) {
|
|
80
|
-
return editor.getParam('allow_unsafe_link_target', false, 'boolean');
|
|
81
|
-
};
|
|
82
|
-
var useQuickLink = function (editor) {
|
|
83
|
-
return editor.getParam('link_quicklink', false, 'boolean');
|
|
84
|
-
};
|
|
85
|
-
var getDefaultLinkProtocol = function (editor) {
|
|
86
|
-
return editor.getParam('link_default_protocol', 'http', 'string');
|
|
50
|
+
return false;
|
|
87
51
|
};
|
|
88
52
|
|
|
89
|
-
|
|
53
|
+
const noop = () => {
|
|
90
54
|
};
|
|
91
|
-
|
|
92
|
-
return
|
|
55
|
+
const constant = value => {
|
|
56
|
+
return () => {
|
|
93
57
|
return value;
|
|
94
58
|
};
|
|
95
59
|
};
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
var none = function () {
|
|
100
|
-
return NONE;
|
|
60
|
+
const tripleEquals = (a, b) => {
|
|
61
|
+
return a === b;
|
|
101
62
|
};
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
getOr: id,
|
|
120
|
-
getOrThunk: call,
|
|
121
|
-
getOrDie: function (msg) {
|
|
122
|
-
throw new Error(msg || 'error: getOrDie called on none.');
|
|
123
|
-
},
|
|
124
|
-
getOrNull: constant(null),
|
|
125
|
-
getOrUndefined: constant(undefined),
|
|
126
|
-
or: id,
|
|
127
|
-
orThunk: call,
|
|
128
|
-
map: none,
|
|
129
|
-
each: noop,
|
|
130
|
-
bind: none,
|
|
131
|
-
exists: never,
|
|
132
|
-
forall: always,
|
|
133
|
-
filter: none,
|
|
134
|
-
equals: eq,
|
|
135
|
-
equals_: eq,
|
|
136
|
-
toArray: function () {
|
|
137
|
-
return [];
|
|
138
|
-
},
|
|
139
|
-
toString: constant('none()')
|
|
140
|
-
};
|
|
141
|
-
return me;
|
|
142
|
-
}();
|
|
143
|
-
var some = function (a) {
|
|
144
|
-
var constant_a = constant(a);
|
|
145
|
-
var self = function () {
|
|
146
|
-
return me;
|
|
147
|
-
};
|
|
148
|
-
var bind = function (f) {
|
|
149
|
-
return f(a);
|
|
150
|
-
};
|
|
151
|
-
var me = {
|
|
152
|
-
fold: function (n, s) {
|
|
153
|
-
return s(a);
|
|
154
|
-
},
|
|
155
|
-
is: function (v) {
|
|
156
|
-
return a === v;
|
|
157
|
-
},
|
|
158
|
-
isSome: always,
|
|
159
|
-
isNone: never,
|
|
160
|
-
getOr: constant_a,
|
|
161
|
-
getOrThunk: constant_a,
|
|
162
|
-
getOrDie: constant_a,
|
|
163
|
-
getOrNull: constant_a,
|
|
164
|
-
getOrUndefined: constant_a,
|
|
165
|
-
or: self,
|
|
166
|
-
orThunk: self,
|
|
167
|
-
map: function (f) {
|
|
168
|
-
return some(f(a));
|
|
169
|
-
},
|
|
170
|
-
each: function (f) {
|
|
171
|
-
f(a);
|
|
172
|
-
},
|
|
173
|
-
bind: bind,
|
|
174
|
-
exists: bind,
|
|
175
|
-
forall: bind,
|
|
176
|
-
filter: function (f) {
|
|
177
|
-
return f(a) ? me : NONE;
|
|
178
|
-
},
|
|
179
|
-
toArray: function () {
|
|
180
|
-
return [a];
|
|
181
|
-
},
|
|
182
|
-
toString: function () {
|
|
183
|
-
return 'some(' + a + ')';
|
|
184
|
-
},
|
|
185
|
-
equals: function (o) {
|
|
186
|
-
return o.is(a);
|
|
187
|
-
},
|
|
188
|
-
equals_: function (o, elementEq) {
|
|
189
|
-
return o.fold(never, function (b) {
|
|
190
|
-
return elementEq(a, b);
|
|
191
|
-
});
|
|
63
|
+
|
|
64
|
+
class Optional {
|
|
65
|
+
constructor(tag, value) {
|
|
66
|
+
this.tag = tag;
|
|
67
|
+
this.value = value;
|
|
68
|
+
}
|
|
69
|
+
static some(value) {
|
|
70
|
+
return new Optional(true, value);
|
|
71
|
+
}
|
|
72
|
+
static none() {
|
|
73
|
+
return Optional.singletonNone;
|
|
74
|
+
}
|
|
75
|
+
fold(onNone, onSome) {
|
|
76
|
+
if (this.tag) {
|
|
77
|
+
return onSome(this.value);
|
|
78
|
+
} else {
|
|
79
|
+
return onNone();
|
|
192
80
|
}
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
81
|
+
}
|
|
82
|
+
isSome() {
|
|
83
|
+
return this.tag;
|
|
84
|
+
}
|
|
85
|
+
isNone() {
|
|
86
|
+
return !this.tag;
|
|
87
|
+
}
|
|
88
|
+
map(mapper) {
|
|
89
|
+
if (this.tag) {
|
|
90
|
+
return Optional.some(mapper(this.value));
|
|
91
|
+
} else {
|
|
92
|
+
return Optional.none();
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
bind(binder) {
|
|
96
|
+
if (this.tag) {
|
|
97
|
+
return binder(this.value);
|
|
98
|
+
} else {
|
|
99
|
+
return Optional.none();
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
exists(predicate) {
|
|
103
|
+
return this.tag && predicate(this.value);
|
|
104
|
+
}
|
|
105
|
+
forall(predicate) {
|
|
106
|
+
return !this.tag || predicate(this.value);
|
|
107
|
+
}
|
|
108
|
+
filter(predicate) {
|
|
109
|
+
if (!this.tag || predicate(this.value)) {
|
|
110
|
+
return this;
|
|
111
|
+
} else {
|
|
112
|
+
return Optional.none();
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
getOr(replacement) {
|
|
116
|
+
return this.tag ? this.value : replacement;
|
|
117
|
+
}
|
|
118
|
+
or(replacement) {
|
|
119
|
+
return this.tag ? this : replacement;
|
|
120
|
+
}
|
|
121
|
+
getOrThunk(thunk) {
|
|
122
|
+
return this.tag ? this.value : thunk();
|
|
123
|
+
}
|
|
124
|
+
orThunk(thunk) {
|
|
125
|
+
return this.tag ? this : thunk();
|
|
126
|
+
}
|
|
127
|
+
getOrDie(message) {
|
|
128
|
+
if (!this.tag) {
|
|
129
|
+
throw new Error(message !== null && message !== void 0 ? message : 'Called getOrDie on None');
|
|
130
|
+
} else {
|
|
131
|
+
return this.value;
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
static from(value) {
|
|
135
|
+
return isNonNullable(value) ? Optional.some(value) : Optional.none();
|
|
136
|
+
}
|
|
137
|
+
getOrNull() {
|
|
138
|
+
return this.tag ? this.value : null;
|
|
139
|
+
}
|
|
140
|
+
getOrUndefined() {
|
|
141
|
+
return this.value;
|
|
142
|
+
}
|
|
143
|
+
each(worker) {
|
|
144
|
+
if (this.tag) {
|
|
145
|
+
worker(this.value);
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
toArray() {
|
|
149
|
+
return this.tag ? [this.value] : [];
|
|
150
|
+
}
|
|
151
|
+
toString() {
|
|
152
|
+
return this.tag ? `some(${ this.value })` : 'none()';
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
Optional.singletonNone = new Optional(false);
|
|
204
156
|
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
var len = xs.length;
|
|
215
|
-
var r = new Array(len);
|
|
216
|
-
for (var i = 0; i < len; i++) {
|
|
217
|
-
var x = xs[i];
|
|
157
|
+
const nativeIndexOf = Array.prototype.indexOf;
|
|
158
|
+
const nativePush = Array.prototype.push;
|
|
159
|
+
const rawIndexOf = (ts, t) => nativeIndexOf.call(ts, t);
|
|
160
|
+
const contains = (xs, x) => rawIndexOf(xs, x) > -1;
|
|
161
|
+
const map = (xs, f) => {
|
|
162
|
+
const len = xs.length;
|
|
163
|
+
const r = new Array(len);
|
|
164
|
+
for (let i = 0; i < len; i++) {
|
|
165
|
+
const x = xs[i];
|
|
218
166
|
r[i] = f(x, i);
|
|
219
167
|
}
|
|
220
168
|
return r;
|
|
221
169
|
};
|
|
222
|
-
|
|
223
|
-
for (
|
|
224
|
-
|
|
170
|
+
const each$1 = (xs, f) => {
|
|
171
|
+
for (let i = 0, len = xs.length; i < len; i++) {
|
|
172
|
+
const x = xs[i];
|
|
225
173
|
f(x, i);
|
|
226
174
|
}
|
|
227
175
|
};
|
|
228
|
-
|
|
229
|
-
each(xs,
|
|
230
|
-
acc = f(acc, x);
|
|
176
|
+
const foldl = (xs, f, acc) => {
|
|
177
|
+
each$1(xs, (x, i) => {
|
|
178
|
+
acc = f(acc, x, i);
|
|
231
179
|
});
|
|
232
180
|
return acc;
|
|
233
181
|
};
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
for (
|
|
182
|
+
const flatten = xs => {
|
|
183
|
+
const r = [];
|
|
184
|
+
for (let i = 0, len = xs.length; i < len; ++i) {
|
|
237
185
|
if (!isArray(xs[i])) {
|
|
238
186
|
throw new Error('Arr.flatten item ' + i + ' was not an array, input: ' + xs);
|
|
239
187
|
}
|
|
@@ -241,12 +189,10 @@
|
|
|
241
189
|
}
|
|
242
190
|
return r;
|
|
243
191
|
};
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
for (var i = 0; i < arr.length; i++) {
|
|
249
|
-
var r = f(arr[i], i);
|
|
192
|
+
const bind = (xs, f) => flatten(map(xs, f));
|
|
193
|
+
const findMap = (arr, f) => {
|
|
194
|
+
for (let i = 0; i < arr.length; i++) {
|
|
195
|
+
const r = f(arr[i], i);
|
|
250
196
|
if (r.isSome()) {
|
|
251
197
|
return r;
|
|
252
198
|
}
|
|
@@ -254,26 +200,102 @@
|
|
|
254
200
|
return Optional.none();
|
|
255
201
|
};
|
|
256
202
|
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
203
|
+
const is = (lhs, rhs, comparator = tripleEquals) => lhs.exists(left => comparator(left, rhs));
|
|
204
|
+
const cat = arr => {
|
|
205
|
+
const r = [];
|
|
206
|
+
const push = x => {
|
|
260
207
|
r.push(x);
|
|
261
208
|
};
|
|
262
|
-
for (
|
|
209
|
+
for (let i = 0; i < arr.length; i++) {
|
|
263
210
|
arr[i].each(push);
|
|
264
211
|
}
|
|
265
212
|
return r;
|
|
266
213
|
};
|
|
267
|
-
|
|
268
|
-
|
|
214
|
+
const someIf = (b, a) => b ? Optional.some(a) : Optional.none();
|
|
215
|
+
|
|
216
|
+
const option = name => editor => editor.options.get(name);
|
|
217
|
+
const register$1 = editor => {
|
|
218
|
+
const registerOption = editor.options.register;
|
|
219
|
+
registerOption('link_assume_external_targets', {
|
|
220
|
+
processor: value => {
|
|
221
|
+
const valid = isString(value) || isBoolean(value);
|
|
222
|
+
if (valid) {
|
|
223
|
+
if (value === true) {
|
|
224
|
+
return {
|
|
225
|
+
value: 1,
|
|
226
|
+
valid
|
|
227
|
+
};
|
|
228
|
+
} else if (value === 'http' || value === 'https') {
|
|
229
|
+
return {
|
|
230
|
+
value,
|
|
231
|
+
valid
|
|
232
|
+
};
|
|
233
|
+
} else {
|
|
234
|
+
return {
|
|
235
|
+
value: 0,
|
|
236
|
+
valid
|
|
237
|
+
};
|
|
238
|
+
}
|
|
239
|
+
} else {
|
|
240
|
+
return {
|
|
241
|
+
valid: false,
|
|
242
|
+
message: 'Must be a string or a boolean.'
|
|
243
|
+
};
|
|
244
|
+
}
|
|
245
|
+
},
|
|
246
|
+
default: false
|
|
247
|
+
});
|
|
248
|
+
registerOption('link_context_toolbar', {
|
|
249
|
+
processor: 'boolean',
|
|
250
|
+
default: false
|
|
251
|
+
});
|
|
252
|
+
registerOption('link_list', { processor: value => isString(value) || isFunction(value) || isArrayOf(value, isObject) });
|
|
253
|
+
registerOption('link_default_target', { processor: 'string' });
|
|
254
|
+
registerOption('link_default_protocol', {
|
|
255
|
+
processor: 'string',
|
|
256
|
+
default: 'https'
|
|
257
|
+
});
|
|
258
|
+
registerOption('link_target_list', {
|
|
259
|
+
processor: value => isBoolean(value) || isArrayOf(value, isObject),
|
|
260
|
+
default: true
|
|
261
|
+
});
|
|
262
|
+
registerOption('link_rel_list', {
|
|
263
|
+
processor: 'object[]',
|
|
264
|
+
default: []
|
|
265
|
+
});
|
|
266
|
+
registerOption('link_class_list', {
|
|
267
|
+
processor: 'object[]',
|
|
268
|
+
default: []
|
|
269
|
+
});
|
|
270
|
+
registerOption('link_title', {
|
|
271
|
+
processor: 'boolean',
|
|
272
|
+
default: true
|
|
273
|
+
});
|
|
274
|
+
registerOption('allow_unsafe_link_target', {
|
|
275
|
+
processor: 'boolean',
|
|
276
|
+
default: false
|
|
277
|
+
});
|
|
278
|
+
registerOption('link_quicklink', {
|
|
279
|
+
processor: 'boolean',
|
|
280
|
+
default: false
|
|
281
|
+
});
|
|
269
282
|
};
|
|
283
|
+
const assumeExternalTargets = option('link_assume_external_targets');
|
|
284
|
+
const hasContextToolbar = option('link_context_toolbar');
|
|
285
|
+
const getLinkList = option('link_list');
|
|
286
|
+
const getDefaultLinkTarget = option('link_default_target');
|
|
287
|
+
const getDefaultLinkProtocol = option('link_default_protocol');
|
|
288
|
+
const getTargetList = option('link_target_list');
|
|
289
|
+
const getRelList = option('link_rel_list');
|
|
290
|
+
const getLinkClassList = option('link_class_list');
|
|
291
|
+
const shouldShowLinkTitle = option('link_title');
|
|
292
|
+
const allowUnsafeLinkTarget = option('allow_unsafe_link_target');
|
|
293
|
+
const useQuickLink = option('link_quicklink');
|
|
270
294
|
|
|
271
|
-
var global$
|
|
295
|
+
var global$4 = tinymce.util.Tools.resolve('tinymce.util.Tools');
|
|
272
296
|
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
};
|
|
276
|
-
var getText = function (item) {
|
|
297
|
+
const getValue = item => isString(item.value) ? item.value : '';
|
|
298
|
+
const getText = item => {
|
|
277
299
|
if (isString(item.text)) {
|
|
278
300
|
return item.text;
|
|
279
301
|
} else if (isString(item.title)) {
|
|
@@ -282,119 +304,82 @@
|
|
|
282
304
|
return '';
|
|
283
305
|
}
|
|
284
306
|
};
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
global$
|
|
288
|
-
|
|
307
|
+
const sanitizeList = (list, extractValue) => {
|
|
308
|
+
const out = [];
|
|
309
|
+
global$4.each(list, item => {
|
|
310
|
+
const text = getText(item);
|
|
289
311
|
if (item.menu !== undefined) {
|
|
290
|
-
|
|
312
|
+
const items = sanitizeList(item.menu, extractValue);
|
|
291
313
|
out.push({
|
|
292
|
-
text
|
|
293
|
-
items
|
|
314
|
+
text,
|
|
315
|
+
items
|
|
294
316
|
});
|
|
295
317
|
} else {
|
|
296
|
-
|
|
318
|
+
const value = extractValue(item);
|
|
297
319
|
out.push({
|
|
298
|
-
text
|
|
299
|
-
value
|
|
320
|
+
text,
|
|
321
|
+
value
|
|
300
322
|
});
|
|
301
323
|
}
|
|
302
324
|
});
|
|
303
325
|
return out;
|
|
304
326
|
};
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
var createUi = function (name, label) {
|
|
319
|
-
return function (items) {
|
|
320
|
-
return {
|
|
321
|
-
name: name,
|
|
322
|
-
type: 'listbox',
|
|
323
|
-
label: label,
|
|
324
|
-
items: items
|
|
325
|
-
};
|
|
326
|
-
};
|
|
327
|
-
};
|
|
328
|
-
var ListOptions = {
|
|
329
|
-
sanitize: sanitize,
|
|
330
|
-
sanitizeWith: sanitizeWith,
|
|
331
|
-
createUi: createUi,
|
|
332
|
-
getValue: getValue
|
|
333
|
-
};
|
|
334
|
-
|
|
335
|
-
var __assign = function () {
|
|
336
|
-
__assign = Object.assign || function __assign(t) {
|
|
337
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
338
|
-
s = arguments[i];
|
|
339
|
-
for (var p in s)
|
|
340
|
-
if (Object.prototype.hasOwnProperty.call(s, p))
|
|
341
|
-
t[p] = s[p];
|
|
342
|
-
}
|
|
343
|
-
return t;
|
|
344
|
-
};
|
|
345
|
-
return __assign.apply(this, arguments);
|
|
327
|
+
const sanitizeWith = (extracter = getValue) => list => Optional.from(list).map(list => sanitizeList(list, extracter));
|
|
328
|
+
const sanitize = list => sanitizeWith(getValue)(list);
|
|
329
|
+
const createUi = (name, label) => items => ({
|
|
330
|
+
name,
|
|
331
|
+
type: 'listbox',
|
|
332
|
+
label,
|
|
333
|
+
items
|
|
334
|
+
});
|
|
335
|
+
const ListOptions = {
|
|
336
|
+
sanitize,
|
|
337
|
+
sanitizeWith,
|
|
338
|
+
createUi,
|
|
339
|
+
getValue
|
|
346
340
|
};
|
|
347
341
|
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
for (
|
|
353
|
-
|
|
354
|
-
|
|
342
|
+
const keys = Object.keys;
|
|
343
|
+
const hasOwnProperty = Object.hasOwnProperty;
|
|
344
|
+
const each = (obj, f) => {
|
|
345
|
+
const props = keys(obj);
|
|
346
|
+
for (let k = 0, len = props.length; k < len; k++) {
|
|
347
|
+
const i = props[k];
|
|
348
|
+
const x = obj[i];
|
|
355
349
|
f(x, i);
|
|
356
350
|
}
|
|
357
351
|
};
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
r[i] = x;
|
|
361
|
-
};
|
|
352
|
+
const objAcc = r => (x, i) => {
|
|
353
|
+
r[i] = x;
|
|
362
354
|
};
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
each$1(obj, function (x, i) {
|
|
355
|
+
const internalFilter = (obj, pred, onTrue, onFalse) => {
|
|
356
|
+
each(obj, (x, i) => {
|
|
366
357
|
(pred(x, i) ? onTrue : onFalse)(x, i);
|
|
367
358
|
});
|
|
368
|
-
return r;
|
|
369
359
|
};
|
|
370
|
-
|
|
371
|
-
|
|
360
|
+
const filter = (obj, pred) => {
|
|
361
|
+
const t = {};
|
|
372
362
|
internalFilter(obj, pred, objAcc(t), noop);
|
|
373
363
|
return t;
|
|
374
364
|
};
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
};
|
|
378
|
-
var hasNonNullableKey = function (obj, key) {
|
|
379
|
-
return has(obj, key) && obj[key] !== undefined && obj[key] !== null;
|
|
380
|
-
};
|
|
365
|
+
const has = (obj, key) => hasOwnProperty.call(obj, key);
|
|
366
|
+
const hasNonNullableKey = (obj, key) => has(obj, key) && obj[key] !== undefined && obj[key] !== null;
|
|
381
367
|
|
|
382
368
|
var global$3 = tinymce.util.Tools.resolve('tinymce.dom.TreeWalker');
|
|
383
369
|
|
|
384
|
-
var
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
};
|
|
390
|
-
var collectNodesInRange = function (rng, predicate) {
|
|
370
|
+
var global$2 = tinymce.util.Tools.resolve('tinymce.util.URI');
|
|
371
|
+
|
|
372
|
+
const isAnchor = elm => isNonNullable(elm) && elm.nodeName.toLowerCase() === 'a';
|
|
373
|
+
const isLink = elm => isAnchor(elm) && !!getHref(elm);
|
|
374
|
+
const collectNodesInRange = (rng, predicate) => {
|
|
391
375
|
if (rng.collapsed) {
|
|
392
376
|
return [];
|
|
393
377
|
} else {
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
378
|
+
const contents = rng.cloneContents();
|
|
379
|
+
const firstChild = contents.firstChild;
|
|
380
|
+
const walker = new global$3(firstChild, contents);
|
|
381
|
+
const elements = [];
|
|
382
|
+
let current = firstChild;
|
|
398
383
|
do {
|
|
399
384
|
if (predicate(current)) {
|
|
400
385
|
elements.push(current);
|
|
@@ -403,86 +388,81 @@
|
|
|
403
388
|
return elements;
|
|
404
389
|
}
|
|
405
390
|
};
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
var href = elm.getAttribute('data-mce-href');
|
|
411
|
-
return href ? href : elm.getAttribute('href');
|
|
391
|
+
const hasProtocol = url => /^\w+:/i.test(url);
|
|
392
|
+
const getHref = elm => {
|
|
393
|
+
var _a, _b;
|
|
394
|
+
return (_b = (_a = elm.getAttribute('data-mce-href')) !== null && _a !== void 0 ? _a : elm.getAttribute('href')) !== null && _b !== void 0 ? _b : '';
|
|
412
395
|
};
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
};
|
|
419
|
-
var addTargetRules = function (rels) {
|
|
396
|
+
const applyRelTargetRules = (rel, isUnsafe) => {
|
|
397
|
+
const rules = ['noopener'];
|
|
398
|
+
const rels = rel ? rel.split(/\s+/) : [];
|
|
399
|
+
const toString = rels => global$4.trim(rels.sort().join(' '));
|
|
400
|
+
const addTargetRules = rels => {
|
|
420
401
|
rels = removeTargetRules(rels);
|
|
421
402
|
return rels.length > 0 ? rels.concat(rules) : rules;
|
|
422
403
|
};
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
return global$2.inArray(rules, val) === -1;
|
|
426
|
-
});
|
|
427
|
-
};
|
|
428
|
-
var newRels = isUnsafe ? addTargetRules(rels) : removeTargetRules(rels);
|
|
404
|
+
const removeTargetRules = rels => rels.filter(val => global$4.inArray(rules, val) === -1);
|
|
405
|
+
const newRels = isUnsafe ? addTargetRules(rels) : removeTargetRules(rels);
|
|
429
406
|
return newRels.length > 0 ? toString(newRels) : '';
|
|
430
407
|
};
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
var getAnchorElement = function (editor, selectedElm) {
|
|
435
|
-
selectedElm = selectedElm || editor.selection.getNode();
|
|
408
|
+
const trimCaretContainers = text => text.replace(/\uFEFF/g, '');
|
|
409
|
+
const getAnchorElement = (editor, selectedElm) => {
|
|
410
|
+
selectedElm = selectedElm || getLinksInSelection(editor.selection.getRng())[0] || editor.selection.getNode();
|
|
436
411
|
if (isImageFigure(selectedElm)) {
|
|
437
|
-
return editor.dom.select('a[href]', selectedElm)[0];
|
|
412
|
+
return Optional.from(editor.dom.select('a[href]', selectedElm)[0]);
|
|
438
413
|
} else {
|
|
439
|
-
return editor.dom.getParent(selectedElm, 'a[href]');
|
|
414
|
+
return Optional.from(editor.dom.getParent(selectedElm, 'a[href]'));
|
|
440
415
|
}
|
|
441
416
|
};
|
|
442
|
-
|
|
443
|
-
|
|
417
|
+
const isInAnchor = (editor, selectedElm) => getAnchorElement(editor, selectedElm).isSome();
|
|
418
|
+
const getAnchorText = (selection, anchorElm) => {
|
|
419
|
+
const text = anchorElm.fold(() => selection.getContent({ format: 'text' }), anchorElm => anchorElm.innerText || anchorElm.textContent || '');
|
|
444
420
|
return trimCaretContainers(text);
|
|
445
421
|
};
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
return
|
|
456
|
-
}
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
422
|
+
const getLinksInSelection = rng => collectNodesInRange(rng, isLink);
|
|
423
|
+
const getLinks$1 = elements => global$4.grep(elements, isLink);
|
|
424
|
+
const hasLinks = elements => getLinks$1(elements).length > 0;
|
|
425
|
+
const hasLinksInSelection = rng => getLinksInSelection(rng).length > 0;
|
|
426
|
+
const isOnlyTextSelected = editor => {
|
|
427
|
+
const inlineTextElements = editor.schema.getTextInlineElements();
|
|
428
|
+
const isElement = elm => elm.nodeType === 1 && !isAnchor(elm) && !has(inlineTextElements, elm.nodeName.toLowerCase());
|
|
429
|
+
const isInBlockAnchor = getAnchorElement(editor).exists(anchor => anchor.hasAttribute('data-mce-block'));
|
|
430
|
+
if (isInBlockAnchor) {
|
|
431
|
+
return false;
|
|
432
|
+
}
|
|
433
|
+
const rng = editor.selection.getRng();
|
|
434
|
+
if (!rng.collapsed) {
|
|
435
|
+
const elements = collectNodesInRange(rng, isElement);
|
|
436
|
+
return elements.length === 0;
|
|
437
|
+
} else {
|
|
438
|
+
return true;
|
|
439
|
+
}
|
|
462
440
|
};
|
|
463
|
-
|
|
464
|
-
|
|
441
|
+
const isImageFigure = elm => isNonNullable(elm) && elm.nodeName === 'FIGURE' && /\bimage\b/i.test(elm.className);
|
|
442
|
+
const getLinkAttrs = data => {
|
|
443
|
+
const attrs = [
|
|
465
444
|
'title',
|
|
466
445
|
'rel',
|
|
467
446
|
'class',
|
|
468
447
|
'target'
|
|
469
|
-
]
|
|
470
|
-
|
|
448
|
+
];
|
|
449
|
+
return foldl(attrs, (acc, key) => {
|
|
450
|
+
data[key].each(value => {
|
|
471
451
|
acc[key] = value.length > 0 ? value : null;
|
|
472
452
|
});
|
|
473
453
|
return acc;
|
|
474
454
|
}, { href: data.href });
|
|
475
455
|
};
|
|
476
|
-
|
|
456
|
+
const handleExternalTargets = (href, assumeExternalTargets) => {
|
|
477
457
|
if ((assumeExternalTargets === 'http' || assumeExternalTargets === 'https') && !hasProtocol(href)) {
|
|
478
458
|
return assumeExternalTargets + '://' + href;
|
|
479
459
|
}
|
|
480
460
|
return href;
|
|
481
461
|
};
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
if (
|
|
485
|
-
|
|
462
|
+
const applyLinkOverrides = (editor, linkAttrs) => {
|
|
463
|
+
const newLinkAttrs = { ...linkAttrs };
|
|
464
|
+
if (getRelList(editor).length === 0 && !allowUnsafeLinkTarget(editor)) {
|
|
465
|
+
const newRel = applyRelTargetRules(newLinkAttrs.rel, newLinkAttrs.target === '_blank');
|
|
486
466
|
newLinkAttrs.rel = newRel ? newRel : null;
|
|
487
467
|
}
|
|
488
468
|
if (Optional.from(newLinkAttrs.target).isNone() && getTargetList(editor) === false) {
|
|
@@ -491,9 +471,9 @@
|
|
|
491
471
|
newLinkAttrs.href = handleExternalTargets(newLinkAttrs.href, assumeExternalTargets(editor));
|
|
492
472
|
return newLinkAttrs;
|
|
493
473
|
};
|
|
494
|
-
|
|
495
|
-
text.each(
|
|
496
|
-
if (anchorElm
|
|
474
|
+
const updateLink = (editor, anchorElm, text, linkAttrs) => {
|
|
475
|
+
text.each(text => {
|
|
476
|
+
if (has(anchorElm, 'innerText')) {
|
|
497
477
|
anchorElm.innerText = text;
|
|
498
478
|
} else {
|
|
499
479
|
anchorElm.textContent = text;
|
|
@@ -502,39 +482,40 @@
|
|
|
502
482
|
editor.dom.setAttribs(anchorElm, linkAttrs);
|
|
503
483
|
editor.selection.select(anchorElm);
|
|
504
484
|
};
|
|
505
|
-
|
|
485
|
+
const createLink = (editor, selectedElm, text, linkAttrs) => {
|
|
486
|
+
const dom = editor.dom;
|
|
506
487
|
if (isImageFigure(selectedElm)) {
|
|
507
|
-
linkImageFigure(
|
|
488
|
+
linkImageFigure(dom, selectedElm, linkAttrs);
|
|
508
489
|
} else {
|
|
509
|
-
text.fold(
|
|
490
|
+
text.fold(() => {
|
|
510
491
|
editor.execCommand('mceInsertLink', false, linkAttrs);
|
|
511
|
-
},
|
|
512
|
-
editor.insertContent(
|
|
492
|
+
}, text => {
|
|
493
|
+
editor.insertContent(dom.createHTML('a', linkAttrs, dom.encode(text)));
|
|
513
494
|
});
|
|
514
495
|
}
|
|
515
496
|
};
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
editor.undoManager.transact(
|
|
497
|
+
const linkDomMutation = (editor, attachState, data) => {
|
|
498
|
+
const selectedElm = editor.selection.getNode();
|
|
499
|
+
const anchorElm = getAnchorElement(editor, selectedElm);
|
|
500
|
+
const linkAttrs = applyLinkOverrides(editor, getLinkAttrs(data));
|
|
501
|
+
editor.undoManager.transact(() => {
|
|
521
502
|
if (data.href === attachState.href) {
|
|
522
503
|
attachState.attach();
|
|
523
504
|
}
|
|
524
|
-
|
|
525
|
-
editor.focus();
|
|
526
|
-
updateLink(editor, anchorElm, data.text, linkAttrs);
|
|
527
|
-
} else {
|
|
505
|
+
anchorElm.fold(() => {
|
|
528
506
|
createLink(editor, selectedElm, data.text, linkAttrs);
|
|
529
|
-
}
|
|
507
|
+
}, elm => {
|
|
508
|
+
editor.focus();
|
|
509
|
+
updateLink(editor, elm, data.text, linkAttrs);
|
|
510
|
+
});
|
|
530
511
|
});
|
|
531
512
|
};
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
513
|
+
const unlinkSelection = editor => {
|
|
514
|
+
const dom = editor.dom, selection = editor.selection;
|
|
515
|
+
const bookmark = selection.getBookmark();
|
|
516
|
+
const rng = selection.getRng().cloneRange();
|
|
517
|
+
const startAnchorElm = dom.getParent(rng.startContainer, 'a[href]', editor.getBody());
|
|
518
|
+
const endAnchorElm = dom.getParent(rng.endContainer, 'a[href]', editor.getBody());
|
|
538
519
|
if (startAnchorElm) {
|
|
539
520
|
rng.setStartBefore(startAnchorElm);
|
|
540
521
|
}
|
|
@@ -545,9 +526,9 @@
|
|
|
545
526
|
editor.execCommand('unlink');
|
|
546
527
|
selection.moveToBookmark(bookmark);
|
|
547
528
|
};
|
|
548
|
-
|
|
549
|
-
editor.undoManager.transact(
|
|
550
|
-
|
|
529
|
+
const unlinkDomMutation = editor => {
|
|
530
|
+
editor.undoManager.transact(() => {
|
|
531
|
+
const node = editor.selection.getNode();
|
|
551
532
|
if (isImageFigure(node)) {
|
|
552
533
|
unlinkImageFigure(editor, node);
|
|
553
534
|
} else {
|
|
@@ -556,73 +537,88 @@
|
|
|
556
537
|
editor.focus();
|
|
557
538
|
});
|
|
558
539
|
};
|
|
559
|
-
|
|
560
|
-
|
|
540
|
+
const unwrapOptions = data => {
|
|
541
|
+
const {
|
|
542
|
+
class: cls,
|
|
543
|
+
href,
|
|
544
|
+
rel,
|
|
545
|
+
target,
|
|
546
|
+
text,
|
|
547
|
+
title
|
|
548
|
+
} = data;
|
|
561
549
|
return filter({
|
|
562
550
|
class: cls.getOrNull(),
|
|
563
|
-
href
|
|
551
|
+
href,
|
|
564
552
|
rel: rel.getOrNull(),
|
|
565
553
|
target: target.getOrNull(),
|
|
566
554
|
text: text.getOrNull(),
|
|
567
555
|
title: title.getOrNull()
|
|
568
|
-
},
|
|
569
|
-
|
|
570
|
-
|
|
556
|
+
}, (v, _k) => isNull(v) === false);
|
|
557
|
+
};
|
|
558
|
+
const sanitizeData = (editor, data) => {
|
|
559
|
+
const getOption = editor.options.get;
|
|
560
|
+
const uriOptions = {
|
|
561
|
+
allow_html_data_urls: getOption('allow_html_data_urls'),
|
|
562
|
+
allow_script_urls: getOption('allow_script_urls'),
|
|
563
|
+
allow_svg_data_urls: getOption('allow_svg_data_urls')
|
|
564
|
+
};
|
|
565
|
+
const href = data.href;
|
|
566
|
+
return {
|
|
567
|
+
...data,
|
|
568
|
+
href: global$2.isDomSafe(href, 'a', uriOptions) ? href : ''
|
|
569
|
+
};
|
|
571
570
|
};
|
|
572
|
-
|
|
573
|
-
|
|
571
|
+
const link = (editor, attachState, data) => {
|
|
572
|
+
const sanitizedData = sanitizeData(editor, data);
|
|
573
|
+
editor.hasPlugin('rtc', true) ? editor.execCommand('createlink', false, unwrapOptions(sanitizedData)) : linkDomMutation(editor, attachState, sanitizedData);
|
|
574
574
|
};
|
|
575
|
-
|
|
575
|
+
const unlink = editor => {
|
|
576
576
|
editor.hasPlugin('rtc', true) ? editor.execCommand('unlink') : unlinkDomMutation(editor);
|
|
577
577
|
};
|
|
578
|
-
|
|
579
|
-
var
|
|
578
|
+
const unlinkImageFigure = (editor, fig) => {
|
|
579
|
+
var _a;
|
|
580
|
+
const img = editor.dom.select('img', fig)[0];
|
|
580
581
|
if (img) {
|
|
581
|
-
|
|
582
|
+
const a = editor.dom.getParents(img, 'a[href]', fig)[0];
|
|
582
583
|
if (a) {
|
|
583
|
-
a.parentNode.insertBefore(img, a);
|
|
584
|
+
(_a = a.parentNode) === null || _a === void 0 ? void 0 : _a.insertBefore(img, a);
|
|
584
585
|
editor.dom.remove(a);
|
|
585
586
|
}
|
|
586
587
|
}
|
|
587
588
|
};
|
|
588
|
-
|
|
589
|
-
var
|
|
589
|
+
const linkImageFigure = (dom, fig, attrs) => {
|
|
590
|
+
var _a;
|
|
591
|
+
const img = dom.select('img', fig)[0];
|
|
590
592
|
if (img) {
|
|
591
|
-
|
|
592
|
-
img.parentNode.insertBefore(a, img);
|
|
593
|
+
const a = dom.create('a', attrs);
|
|
594
|
+
(_a = img.parentNode) === null || _a === void 0 ? void 0 : _a.insertBefore(a, img);
|
|
593
595
|
a.appendChild(img);
|
|
594
596
|
}
|
|
595
597
|
};
|
|
596
598
|
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
attach: noop
|
|
619
|
-
}
|
|
620
|
-
},
|
|
621
|
-
text: hasPersistentText ? persistentText : i.text
|
|
622
|
-
};
|
|
623
|
-
}) : Optional.none();
|
|
599
|
+
const isListGroup = item => hasNonNullableKey(item, 'items');
|
|
600
|
+
const findTextByValue = (value, catalog) => findMap(catalog, item => {
|
|
601
|
+
if (isListGroup(item)) {
|
|
602
|
+
return findTextByValue(value, item.items);
|
|
603
|
+
} else {
|
|
604
|
+
return someIf(item.value === value, item);
|
|
605
|
+
}
|
|
606
|
+
});
|
|
607
|
+
const getDelta = (persistentText, fieldName, catalog, data) => {
|
|
608
|
+
const value = data[fieldName];
|
|
609
|
+
const hasPersistentText = persistentText.length > 0;
|
|
610
|
+
return value !== undefined ? findTextByValue(value, catalog).map(i => ({
|
|
611
|
+
url: {
|
|
612
|
+
value: i.value,
|
|
613
|
+
meta: {
|
|
614
|
+
text: hasPersistentText ? persistentText : i.text,
|
|
615
|
+
attach: noop
|
|
616
|
+
}
|
|
617
|
+
},
|
|
618
|
+
text: hasPersistentText ? persistentText : i.text
|
|
619
|
+
})) : Optional.none();
|
|
624
620
|
};
|
|
625
|
-
|
|
621
|
+
const findCatalog = (catalogs, fieldName) => {
|
|
626
622
|
if (fieldName === 'link') {
|
|
627
623
|
return catalogs.link;
|
|
628
624
|
} else if (fieldName === 'anchor') {
|
|
@@ -631,43 +627,44 @@
|
|
|
631
627
|
return Optional.none();
|
|
632
628
|
}
|
|
633
629
|
};
|
|
634
|
-
|
|
635
|
-
|
|
630
|
+
const init = (initialData, linkCatalog) => {
|
|
631
|
+
const persistentData = {
|
|
636
632
|
text: initialData.text,
|
|
637
633
|
title: initialData.title
|
|
638
634
|
};
|
|
639
|
-
|
|
640
|
-
|
|
635
|
+
const getTitleFromUrlChange = url => {
|
|
636
|
+
var _a;
|
|
637
|
+
return someIf(persistentData.title.length <= 0, Optional.from((_a = url.meta) === null || _a === void 0 ? void 0 : _a.title).getOr(''));
|
|
641
638
|
};
|
|
642
|
-
|
|
643
|
-
|
|
639
|
+
const getTextFromUrlChange = url => {
|
|
640
|
+
var _a;
|
|
641
|
+
return someIf(persistentData.text.length <= 0, Optional.from((_a = url.meta) === null || _a === void 0 ? void 0 : _a.text).getOr(url.value));
|
|
644
642
|
};
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
643
|
+
const onUrlChange = data => {
|
|
644
|
+
const text = getTextFromUrlChange(data.url);
|
|
645
|
+
const title = getTitleFromUrlChange(data.url);
|
|
648
646
|
if (text.isSome() || title.isSome()) {
|
|
649
|
-
return Optional.some(
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
}).getOr({})));
|
|
647
|
+
return Optional.some({
|
|
648
|
+
...text.map(text => ({ text })).getOr({}),
|
|
649
|
+
...title.map(title => ({ title })).getOr({})
|
|
650
|
+
});
|
|
654
651
|
} else {
|
|
655
652
|
return Optional.none();
|
|
656
653
|
}
|
|
657
654
|
};
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
return getDelta(persistentData.text, change
|
|
655
|
+
const onCatalogChange = (data, change) => {
|
|
656
|
+
const catalog = findCatalog(linkCatalog, change).getOr([]);
|
|
657
|
+
return getDelta(persistentData.text, change, catalog, data);
|
|
661
658
|
};
|
|
662
|
-
|
|
663
|
-
|
|
659
|
+
const onChange = (getData, change) => {
|
|
660
|
+
const name = change.name;
|
|
664
661
|
if (name === 'url') {
|
|
665
662
|
return onUrlChange(getData());
|
|
666
663
|
} else if (contains([
|
|
667
664
|
'anchor',
|
|
668
665
|
'link'
|
|
669
666
|
], name)) {
|
|
670
|
-
return onCatalogChange(getData(),
|
|
667
|
+
return onCatalogChange(getData(), name);
|
|
671
668
|
} else if (name === 'text' || name === 'title') {
|
|
672
669
|
persistentData[name] = getData()[name];
|
|
673
670
|
return Optional.none();
|
|
@@ -675,70 +672,60 @@
|
|
|
675
672
|
return Optional.none();
|
|
676
673
|
}
|
|
677
674
|
};
|
|
678
|
-
return { onChange
|
|
675
|
+
return { onChange };
|
|
679
676
|
};
|
|
680
|
-
|
|
681
|
-
init
|
|
682
|
-
getDelta
|
|
677
|
+
const DialogChanges = {
|
|
678
|
+
init,
|
|
679
|
+
getDelta
|
|
683
680
|
};
|
|
684
681
|
|
|
685
|
-
var global$
|
|
686
|
-
|
|
687
|
-
var global$5 = tinymce.util.Tools.resolve('tinymce.util.Promise');
|
|
682
|
+
var global$1 = tinymce.util.Tools.resolve('tinymce.util.Delay');
|
|
688
683
|
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
global$
|
|
692
|
-
editor.windowManager.confirm(message,
|
|
684
|
+
const delayedConfirm = (editor, message, callback) => {
|
|
685
|
+
const rng = editor.selection.getRng();
|
|
686
|
+
global$1.setEditorTimeout(editor, () => {
|
|
687
|
+
editor.windowManager.confirm(message, state => {
|
|
693
688
|
editor.selection.setRng(rng);
|
|
694
689
|
callback(state);
|
|
695
690
|
});
|
|
696
691
|
});
|
|
697
692
|
};
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
693
|
+
const tryEmailTransform = data => {
|
|
694
|
+
const url = data.href;
|
|
695
|
+
const suggestMailTo = url.indexOf('@') > 0 && url.indexOf('/') === -1 && url.indexOf('mailto:') === -1;
|
|
701
696
|
return suggestMailTo ? Optional.some({
|
|
702
697
|
message: 'The URL you entered seems to be an email address. Do you want to add the required mailto: prefix?',
|
|
703
|
-
preprocess:
|
|
704
|
-
|
|
705
|
-
|
|
698
|
+
preprocess: oldData => ({
|
|
699
|
+
...oldData,
|
|
700
|
+
href: 'mailto:' + url
|
|
701
|
+
})
|
|
706
702
|
}) : Optional.none();
|
|
707
703
|
};
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
};
|
|
704
|
+
const tryProtocolTransform = (assumeExternalTargets, defaultLinkProtocol) => data => {
|
|
705
|
+
const url = data.href;
|
|
706
|
+
const suggestProtocol = assumeExternalTargets === 1 && !hasProtocol(url) || assumeExternalTargets === 0 && /^\s*www(\.|\d\.)/i.test(url);
|
|
707
|
+
return suggestProtocol ? Optional.some({
|
|
708
|
+
message: `The URL you entered seems to be an external link. Do you want to add the required ${ defaultLinkProtocol }:// prefix?`,
|
|
709
|
+
preprocess: oldData => ({
|
|
710
|
+
...oldData,
|
|
711
|
+
href: defaultLinkProtocol + '://' + url
|
|
712
|
+
})
|
|
713
|
+
}) : Optional.none();
|
|
719
714
|
};
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
}).fold(function () {
|
|
727
|
-
return global$5.resolve(data);
|
|
728
|
-
}, function (transform) {
|
|
729
|
-
return new global$5(function (callback) {
|
|
730
|
-
delayedConfirm(editor, transform.message, function (state) {
|
|
731
|
-
callback(state ? transform.preprocess(data) : data);
|
|
732
|
-
});
|
|
733
|
-
});
|
|
715
|
+
const preprocess = (editor, data) => findMap([
|
|
716
|
+
tryEmailTransform,
|
|
717
|
+
tryProtocolTransform(assumeExternalTargets(editor), getDefaultLinkProtocol(editor))
|
|
718
|
+
], f => f(data)).fold(() => Promise.resolve(data), transform => new Promise(callback => {
|
|
719
|
+
delayedConfirm(editor, transform.message, state => {
|
|
720
|
+
callback(state ? transform.preprocess(data) : data);
|
|
734
721
|
});
|
|
735
|
-
};
|
|
736
|
-
|
|
722
|
+
}));
|
|
723
|
+
const DialogConfirms = { preprocess };
|
|
737
724
|
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
725
|
+
const getAnchors = editor => {
|
|
726
|
+
const anchorNodes = editor.dom.select('a:not([href])');
|
|
727
|
+
const anchors = bind(anchorNodes, anchor => {
|
|
728
|
+
const id = anchor.name || anchor.id;
|
|
742
729
|
return id ? [{
|
|
743
730
|
text: id,
|
|
744
731
|
value: '#' + id
|
|
@@ -749,81 +736,63 @@
|
|
|
749
736
|
value: ''
|
|
750
737
|
}].concat(anchors)) : Optional.none();
|
|
751
738
|
};
|
|
752
|
-
|
|
739
|
+
const AnchorListOptions = { getAnchors };
|
|
753
740
|
|
|
754
|
-
|
|
755
|
-
|
|
741
|
+
const getClasses = editor => {
|
|
742
|
+
const list = getLinkClassList(editor);
|
|
756
743
|
if (list.length > 0) {
|
|
757
744
|
return ListOptions.sanitize(list);
|
|
758
745
|
}
|
|
759
746
|
return Optional.none();
|
|
760
747
|
};
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
var global$6 = tinymce.util.Tools.resolve('tinymce.util.XHR');
|
|
748
|
+
const ClassListOptions = { getClasses };
|
|
764
749
|
|
|
765
|
-
|
|
750
|
+
const parseJson = text => {
|
|
766
751
|
try {
|
|
767
752
|
return Optional.some(JSON.parse(text));
|
|
768
753
|
} catch (err) {
|
|
769
754
|
return Optional.none();
|
|
770
755
|
}
|
|
771
756
|
};
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
var linkList = getLinkList(editor);
|
|
777
|
-
return new global$5(function (callback) {
|
|
757
|
+
const getLinks = editor => {
|
|
758
|
+
const extractor = item => editor.convertURL(item.value || item.url || '', 'href');
|
|
759
|
+
const linkList = getLinkList(editor);
|
|
760
|
+
return new Promise(resolve => {
|
|
778
761
|
if (isString(linkList)) {
|
|
779
|
-
|
|
780
|
-
url: linkList,
|
|
781
|
-
success: function (text) {
|
|
782
|
-
return callback(parseJson(text));
|
|
783
|
-
},
|
|
784
|
-
error: function (_) {
|
|
785
|
-
return callback(Optional.none());
|
|
786
|
-
}
|
|
787
|
-
});
|
|
762
|
+
fetch(linkList).then(res => res.ok ? res.text().then(parseJson) : Promise.reject()).then(resolve, () => resolve(Optional.none()));
|
|
788
763
|
} else if (isFunction(linkList)) {
|
|
789
|
-
linkList(
|
|
790
|
-
return callback(Optional.some(output));
|
|
791
|
-
});
|
|
764
|
+
linkList(output => resolve(Optional.some(output)));
|
|
792
765
|
} else {
|
|
793
|
-
|
|
766
|
+
resolve(Optional.from(linkList));
|
|
794
767
|
}
|
|
795
|
-
}).then(
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
});
|
|
807
|
-
});
|
|
768
|
+
}).then(optItems => optItems.bind(ListOptions.sanitizeWith(extractor)).map(items => {
|
|
769
|
+
if (items.length > 0) {
|
|
770
|
+
const noneItem = [{
|
|
771
|
+
text: 'None',
|
|
772
|
+
value: ''
|
|
773
|
+
}];
|
|
774
|
+
return noneItem.concat(items);
|
|
775
|
+
} else {
|
|
776
|
+
return items;
|
|
777
|
+
}
|
|
778
|
+
}));
|
|
808
779
|
};
|
|
809
|
-
|
|
780
|
+
const LinkListOptions = { getLinks };
|
|
810
781
|
|
|
811
|
-
|
|
812
|
-
|
|
782
|
+
const getRels = (editor, initialTarget) => {
|
|
783
|
+
const list = getRelList(editor);
|
|
813
784
|
if (list.length > 0) {
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
};
|
|
819
|
-
var sanitizer = enforceSafe ? ListOptions.sanitizeWith(safeRelExtractor) : ListOptions.sanitize;
|
|
785
|
+
const isTargetBlank = is(initialTarget, '_blank');
|
|
786
|
+
const enforceSafe = allowUnsafeLinkTarget(editor) === false;
|
|
787
|
+
const safeRelExtractor = item => applyRelTargetRules(ListOptions.getValue(item), isTargetBlank);
|
|
788
|
+
const sanitizer = enforceSafe ? ListOptions.sanitizeWith(safeRelExtractor) : ListOptions.sanitize;
|
|
820
789
|
return sanitizer(list);
|
|
821
790
|
}
|
|
822
791
|
return Optional.none();
|
|
823
792
|
};
|
|
824
|
-
|
|
793
|
+
const RelOptions = { getRels };
|
|
825
794
|
|
|
826
|
-
|
|
795
|
+
const fallbacks = [
|
|
827
796
|
{
|
|
828
797
|
text: 'Current window',
|
|
829
798
|
value: ''
|
|
@@ -833,98 +802,88 @@
|
|
|
833
802
|
value: '_blank'
|
|
834
803
|
}
|
|
835
804
|
];
|
|
836
|
-
|
|
837
|
-
|
|
805
|
+
const getTargets = editor => {
|
|
806
|
+
const list = getTargetList(editor);
|
|
838
807
|
if (isArray(list)) {
|
|
839
|
-
return ListOptions.sanitize(list).orThunk(
|
|
840
|
-
return Optional.some(fallbacks);
|
|
841
|
-
});
|
|
808
|
+
return ListOptions.sanitize(list).orThunk(() => Optional.some(fallbacks));
|
|
842
809
|
} else if (list === false) {
|
|
843
810
|
return Optional.none();
|
|
844
811
|
}
|
|
845
812
|
return Optional.some(fallbacks);
|
|
846
813
|
};
|
|
847
|
-
|
|
814
|
+
const TargetOptions = { getTargets };
|
|
848
815
|
|
|
849
|
-
|
|
850
|
-
|
|
816
|
+
const nonEmptyAttr = (dom, elem, name) => {
|
|
817
|
+
const val = dom.getAttrib(elem, name);
|
|
851
818
|
return val !== null && val.length > 0 ? Optional.some(val) : Optional.none();
|
|
852
819
|
};
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
820
|
+
const extractFromAnchor = (editor, anchor) => {
|
|
821
|
+
const dom = editor.dom;
|
|
822
|
+
const onlyText = isOnlyTextSelected(editor);
|
|
823
|
+
const text = onlyText ? Optional.some(getAnchorText(editor.selection, anchor)) : Optional.none();
|
|
824
|
+
const url = anchor.bind(anchorElm => Optional.from(dom.getAttrib(anchorElm, 'href')));
|
|
825
|
+
const target = anchor.bind(anchorElm => Optional.from(dom.getAttrib(anchorElm, 'target')));
|
|
826
|
+
const rel = anchor.bind(anchorElm => nonEmptyAttr(dom, anchorElm, 'rel'));
|
|
827
|
+
const linkClass = anchor.bind(anchorElm => nonEmptyAttr(dom, anchorElm, 'class'));
|
|
828
|
+
const title = anchor.bind(anchorElm => nonEmptyAttr(dom, anchorElm, 'title'));
|
|
862
829
|
return {
|
|
863
|
-
url
|
|
864
|
-
text
|
|
865
|
-
title
|
|
866
|
-
target
|
|
867
|
-
rel
|
|
868
|
-
linkClass
|
|
830
|
+
url,
|
|
831
|
+
text,
|
|
832
|
+
title,
|
|
833
|
+
target,
|
|
834
|
+
rel,
|
|
835
|
+
linkClass
|
|
869
836
|
};
|
|
870
837
|
};
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
};
|
|
888
|
-
var DialogInfo = { collect: collect };
|
|
838
|
+
const collect = (editor, linkNode) => LinkListOptions.getLinks(editor).then(links => {
|
|
839
|
+
const anchor = extractFromAnchor(editor, linkNode);
|
|
840
|
+
return {
|
|
841
|
+
anchor,
|
|
842
|
+
catalogs: {
|
|
843
|
+
targets: TargetOptions.getTargets(editor),
|
|
844
|
+
rels: RelOptions.getRels(editor, anchor.target),
|
|
845
|
+
classes: ClassListOptions.getClasses(editor),
|
|
846
|
+
anchor: AnchorListOptions.getAnchors(editor),
|
|
847
|
+
link: links
|
|
848
|
+
},
|
|
849
|
+
optNode: linkNode,
|
|
850
|
+
flags: { titleEnabled: shouldShowLinkTitle(editor) }
|
|
851
|
+
};
|
|
852
|
+
});
|
|
853
|
+
const DialogInfo = { collect };
|
|
889
854
|
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
unlink(editor);
|
|
895
|
-
api.close();
|
|
896
|
-
return;
|
|
897
|
-
}
|
|
898
|
-
var getChangedValue = function (key) {
|
|
899
|
-
return Optional.from(data[key]).filter(function (value) {
|
|
900
|
-
return !info.anchor[key].is(value);
|
|
901
|
-
});
|
|
902
|
-
};
|
|
903
|
-
var changedData = {
|
|
904
|
-
href: data.url.value,
|
|
905
|
-
text: getChangedValue('text'),
|
|
906
|
-
target: getChangedValue('target'),
|
|
907
|
-
rel: getChangedValue('rel'),
|
|
908
|
-
class: getChangedValue('linkClass'),
|
|
909
|
-
title: getChangedValue('title')
|
|
910
|
-
};
|
|
911
|
-
var attachState = {
|
|
912
|
-
href: data.url.value,
|
|
913
|
-
attach: data.url.meta !== undefined && data.url.meta.attach ? data.url.meta.attach : noop
|
|
914
|
-
};
|
|
915
|
-
DialogConfirms.preprocess(editor, changedData).then(function (pData) {
|
|
916
|
-
link(editor, attachState, pData);
|
|
917
|
-
});
|
|
855
|
+
const handleSubmit = (editor, info) => api => {
|
|
856
|
+
const data = api.getData();
|
|
857
|
+
if (!data.url.value) {
|
|
858
|
+
unlink(editor);
|
|
918
859
|
api.close();
|
|
860
|
+
return;
|
|
861
|
+
}
|
|
862
|
+
const getChangedValue = key => Optional.from(data[key]).filter(value => !is(info.anchor[key], value));
|
|
863
|
+
const changedData = {
|
|
864
|
+
href: data.url.value,
|
|
865
|
+
text: getChangedValue('text'),
|
|
866
|
+
target: getChangedValue('target'),
|
|
867
|
+
rel: getChangedValue('rel'),
|
|
868
|
+
class: getChangedValue('linkClass'),
|
|
869
|
+
title: getChangedValue('title')
|
|
870
|
+
};
|
|
871
|
+
const attachState = {
|
|
872
|
+
href: data.url.value,
|
|
873
|
+
attach: data.url.meta !== undefined && data.url.meta.attach ? data.url.meta.attach : noop
|
|
919
874
|
};
|
|
875
|
+
DialogConfirms.preprocess(editor, changedData).then(pData => {
|
|
876
|
+
link(editor, attachState, pData);
|
|
877
|
+
});
|
|
878
|
+
api.close();
|
|
920
879
|
};
|
|
921
|
-
|
|
922
|
-
|
|
880
|
+
const collectData = editor => {
|
|
881
|
+
const anchorNode = getAnchorElement(editor);
|
|
923
882
|
return DialogInfo.collect(editor, anchorNode);
|
|
924
883
|
};
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
884
|
+
const getInitialData = (info, defaultTarget) => {
|
|
885
|
+
const anchor = info.anchor;
|
|
886
|
+
const url = anchor.url.getOr('');
|
|
928
887
|
return {
|
|
929
888
|
url: {
|
|
930
889
|
value: url,
|
|
@@ -939,30 +898,29 @@
|
|
|
939
898
|
linkClass: anchor.linkClass.getOr('')
|
|
940
899
|
};
|
|
941
900
|
};
|
|
942
|
-
|
|
943
|
-
|
|
901
|
+
const makeDialog = (settings, onSubmit, editor) => {
|
|
902
|
+
const urlInput = [{
|
|
944
903
|
name: 'url',
|
|
945
904
|
type: 'urlinput',
|
|
946
905
|
filetype: 'file',
|
|
947
|
-
label: 'URL'
|
|
906
|
+
label: 'URL',
|
|
907
|
+
picker_text: 'Browse links'
|
|
948
908
|
}];
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
}).toArray();
|
|
956
|
-
var titleText = settings.flags.titleEnabled ? [{
|
|
909
|
+
const displayText = settings.anchor.text.map(() => ({
|
|
910
|
+
name: 'text',
|
|
911
|
+
type: 'input',
|
|
912
|
+
label: 'Text to display'
|
|
913
|
+
})).toArray();
|
|
914
|
+
const titleText = settings.flags.titleEnabled ? [{
|
|
957
915
|
name: 'title',
|
|
958
916
|
type: 'input',
|
|
959
917
|
label: 'Title'
|
|
960
918
|
}] : [];
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
919
|
+
const defaultTarget = Optional.from(getDefaultLinkTarget(editor));
|
|
920
|
+
const initialData = getInitialData(settings, defaultTarget);
|
|
921
|
+
const catalogs = settings.catalogs;
|
|
922
|
+
const dialogDelta = DialogChanges.init(initialData, catalogs);
|
|
923
|
+
const body = {
|
|
966
924
|
type: 'panel',
|
|
967
925
|
items: flatten([
|
|
968
926
|
urlInput,
|
|
@@ -980,7 +938,7 @@
|
|
|
980
938
|
return {
|
|
981
939
|
title: 'Insert/Edit Link',
|
|
982
940
|
size: 'normal',
|
|
983
|
-
body
|
|
941
|
+
body,
|
|
984
942
|
buttons: [
|
|
985
943
|
{
|
|
986
944
|
type: 'cancel',
|
|
@@ -994,216 +952,223 @@
|
|
|
994
952
|
primary: true
|
|
995
953
|
}
|
|
996
954
|
],
|
|
997
|
-
initialData
|
|
998
|
-
onChange:
|
|
999
|
-
|
|
1000
|
-
dialogDelta.onChange(api.getData, { name: name }).each(function (newData) {
|
|
955
|
+
initialData,
|
|
956
|
+
onChange: (api, {name}) => {
|
|
957
|
+
dialogDelta.onChange(api.getData, { name }).each(newData => {
|
|
1001
958
|
api.setData(newData);
|
|
1002
959
|
});
|
|
1003
960
|
},
|
|
1004
|
-
onSubmit
|
|
961
|
+
onSubmit
|
|
1005
962
|
};
|
|
1006
963
|
};
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
data.then(
|
|
1010
|
-
|
|
964
|
+
const open$1 = editor => {
|
|
965
|
+
const data = collectData(editor);
|
|
966
|
+
data.then(info => {
|
|
967
|
+
const onSubmit = handleSubmit(editor, info);
|
|
1011
968
|
return makeDialog(info, onSubmit, editor);
|
|
1012
|
-
}).then(
|
|
969
|
+
}).then(spec => {
|
|
1013
970
|
editor.windowManager.open(spec);
|
|
1014
971
|
});
|
|
1015
972
|
};
|
|
1016
973
|
|
|
1017
|
-
|
|
974
|
+
const register = editor => {
|
|
975
|
+
editor.addCommand('mceLink', (_ui, value) => {
|
|
976
|
+
if ((value === null || value === void 0 ? void 0 : value.dialog) === true || !useQuickLink(editor)) {
|
|
977
|
+
open$1(editor);
|
|
978
|
+
} else {
|
|
979
|
+
editor.dispatch('contexttoolbar-show', { toolbarKey: 'quicklink' });
|
|
980
|
+
}
|
|
981
|
+
});
|
|
982
|
+
};
|
|
983
|
+
|
|
984
|
+
var global = tinymce.util.Tools.resolve('tinymce.util.VK');
|
|
985
|
+
|
|
986
|
+
const appendClickRemove = (link, evt) => {
|
|
1018
987
|
document.body.appendChild(link);
|
|
1019
988
|
link.dispatchEvent(evt);
|
|
1020
989
|
document.body.removeChild(link);
|
|
1021
990
|
};
|
|
1022
|
-
|
|
1023
|
-
|
|
991
|
+
const open = url => {
|
|
992
|
+
const link = document.createElement('a');
|
|
1024
993
|
link.target = '_blank';
|
|
1025
994
|
link.href = url;
|
|
1026
995
|
link.rel = 'noreferrer noopener';
|
|
1027
|
-
|
|
996
|
+
const evt = document.createEvent('MouseEvents');
|
|
1028
997
|
evt.initMouseEvent('click', true, true, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null);
|
|
1029
998
|
appendClickRemove(link, evt);
|
|
1030
999
|
};
|
|
1031
1000
|
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
var getSelectedLink = function (editor) {
|
|
1036
|
-
return getLink(editor, editor.selection.getStart());
|
|
1037
|
-
};
|
|
1038
|
-
var hasOnlyAltModifier = function (e) {
|
|
1001
|
+
const getLink = (editor, elm) => editor.dom.getParent(elm, 'a[href]');
|
|
1002
|
+
const getSelectedLink = editor => getLink(editor, editor.selection.getStart());
|
|
1003
|
+
const hasOnlyAltModifier = e => {
|
|
1039
1004
|
return e.altKey === true && e.shiftKey === false && e.ctrlKey === false && e.metaKey === false;
|
|
1040
1005
|
};
|
|
1041
|
-
|
|
1006
|
+
const gotoLink = (editor, a) => {
|
|
1042
1007
|
if (a) {
|
|
1043
|
-
|
|
1008
|
+
const href = getHref(a);
|
|
1044
1009
|
if (/^#/.test(href)) {
|
|
1045
|
-
|
|
1010
|
+
const targetEl = editor.dom.select(href);
|
|
1046
1011
|
if (targetEl.length) {
|
|
1047
1012
|
editor.selection.scrollIntoView(targetEl[0], true);
|
|
1048
1013
|
}
|
|
1049
1014
|
} else {
|
|
1050
|
-
open
|
|
1015
|
+
open(a.href);
|
|
1051
1016
|
}
|
|
1052
1017
|
}
|
|
1053
1018
|
};
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
open(editor);
|
|
1057
|
-
};
|
|
1019
|
+
const openDialog = editor => () => {
|
|
1020
|
+
editor.execCommand('mceLink', false, { dialog: true });
|
|
1058
1021
|
};
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
gotoLink(editor, getSelectedLink(editor));
|
|
1062
|
-
};
|
|
1022
|
+
const gotoSelectedLink = editor => () => {
|
|
1023
|
+
gotoLink(editor, getSelectedLink(editor));
|
|
1063
1024
|
};
|
|
1064
|
-
|
|
1065
|
-
editor.on('click',
|
|
1066
|
-
|
|
1067
|
-
if (link && global
|
|
1025
|
+
const setupGotoLinks = editor => {
|
|
1026
|
+
editor.on('click', e => {
|
|
1027
|
+
const link = getLink(editor, e.target);
|
|
1028
|
+
if (link && global.metaKeyPressed(e)) {
|
|
1068
1029
|
e.preventDefault();
|
|
1069
1030
|
gotoLink(editor, link);
|
|
1070
1031
|
}
|
|
1071
1032
|
});
|
|
1072
|
-
editor.on('keydown',
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1033
|
+
editor.on('keydown', e => {
|
|
1034
|
+
if (!e.isDefaultPrevented() && e.keyCode === 13 && hasOnlyAltModifier(e)) {
|
|
1035
|
+
const link = getSelectedLink(editor);
|
|
1036
|
+
if (link) {
|
|
1037
|
+
e.preventDefault();
|
|
1038
|
+
gotoLink(editor, link);
|
|
1039
|
+
}
|
|
1077
1040
|
}
|
|
1078
1041
|
});
|
|
1079
1042
|
};
|
|
1080
|
-
|
|
1043
|
+
const toggleState = (editor, toggler) => {
|
|
1081
1044
|
editor.on('NodeChange', toggler);
|
|
1082
|
-
return
|
|
1083
|
-
return editor.off('NodeChange', toggler);
|
|
1084
|
-
};
|
|
1045
|
+
return () => editor.off('NodeChange', toggler);
|
|
1085
1046
|
};
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
});
|
|
1047
|
+
const toggleLinkState = editor => api => {
|
|
1048
|
+
const updateState = () => {
|
|
1049
|
+
api.setActive(!editor.mode.isReadOnly() && isInAnchor(editor, editor.selection.getNode()));
|
|
1050
|
+
api.setEnabled(editor.selection.isEditable());
|
|
1091
1051
|
};
|
|
1052
|
+
updateState();
|
|
1053
|
+
return toggleState(editor, updateState);
|
|
1092
1054
|
};
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
return api.setDisabled(getAnchorElement(editor, editor.selection.getNode()) === null);
|
|
1097
|
-
};
|
|
1098
|
-
updateState();
|
|
1099
|
-
return toggleState(editor, updateState);
|
|
1055
|
+
const toggleLinkMenuState = editor => api => {
|
|
1056
|
+
const updateState = () => {
|
|
1057
|
+
api.setEnabled(editor.selection.isEditable());
|
|
1100
1058
|
};
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1059
|
+
updateState();
|
|
1060
|
+
return toggleState(editor, updateState);
|
|
1061
|
+
};
|
|
1062
|
+
const hasExactlyOneLinkInSelection = editor => {
|
|
1063
|
+
const links = editor.selection.isCollapsed() ? getLinks$1(editor.dom.getParents(editor.selection.getStart())) : getLinksInSelection(editor.selection.getRng());
|
|
1064
|
+
return links.length === 1;
|
|
1065
|
+
};
|
|
1066
|
+
const toggleGotoLinkState = editor => api => {
|
|
1067
|
+
const updateState = () => api.setEnabled(hasExactlyOneLinkInSelection(editor));
|
|
1068
|
+
updateState();
|
|
1069
|
+
return toggleState(editor, updateState);
|
|
1070
|
+
};
|
|
1071
|
+
const toggleUnlinkState = editor => api => {
|
|
1072
|
+
const hasLinks$1 = parents => hasLinks(parents) || hasLinksInSelection(editor.selection.getRng());
|
|
1073
|
+
const parents = editor.dom.getParents(editor.selection.getStart());
|
|
1074
|
+
const updateEnabled = parents => {
|
|
1075
|
+
api.setEnabled(hasLinks$1(parents) && editor.selection.isEditable());
|
|
1112
1076
|
};
|
|
1077
|
+
updateEnabled(parents);
|
|
1078
|
+
return toggleState(editor, e => updateEnabled(e.parents));
|
|
1113
1079
|
};
|
|
1114
1080
|
|
|
1115
|
-
|
|
1116
|
-
editor.
|
|
1117
|
-
if (useQuickLink(editor)) {
|
|
1118
|
-
editor.fire('contexttoolbar-show', { toolbarKey: 'quicklink' });
|
|
1119
|
-
} else {
|
|
1120
|
-
openDialog(editor)();
|
|
1121
|
-
}
|
|
1122
|
-
});
|
|
1123
|
-
};
|
|
1124
|
-
|
|
1125
|
-
var setup = function (editor) {
|
|
1126
|
-
editor.addShortcut('Meta+K', '', function () {
|
|
1081
|
+
const setup = editor => {
|
|
1082
|
+
editor.addShortcut('Meta+K', '', () => {
|
|
1127
1083
|
editor.execCommand('mceLink');
|
|
1128
1084
|
});
|
|
1129
1085
|
};
|
|
1130
1086
|
|
|
1131
|
-
|
|
1087
|
+
const setupButtons = editor => {
|
|
1132
1088
|
editor.ui.registry.addToggleButton('link', {
|
|
1133
1089
|
icon: 'link',
|
|
1134
1090
|
tooltip: 'Insert/edit link',
|
|
1135
1091
|
onAction: openDialog(editor),
|
|
1136
|
-
onSetup:
|
|
1092
|
+
onSetup: toggleLinkState(editor)
|
|
1137
1093
|
});
|
|
1138
1094
|
editor.ui.registry.addButton('openlink', {
|
|
1139
1095
|
icon: 'new-tab',
|
|
1140
1096
|
tooltip: 'Open link',
|
|
1141
1097
|
onAction: gotoSelectedLink(editor),
|
|
1142
|
-
onSetup:
|
|
1098
|
+
onSetup: toggleGotoLinkState(editor)
|
|
1143
1099
|
});
|
|
1144
1100
|
editor.ui.registry.addButton('unlink', {
|
|
1145
1101
|
icon: 'unlink',
|
|
1146
1102
|
tooltip: 'Remove link',
|
|
1147
|
-
onAction:
|
|
1148
|
-
return unlink(editor);
|
|
1149
|
-
},
|
|
1103
|
+
onAction: () => unlink(editor),
|
|
1150
1104
|
onSetup: toggleUnlinkState(editor)
|
|
1151
1105
|
});
|
|
1152
1106
|
};
|
|
1153
|
-
|
|
1107
|
+
const setupMenuItems = editor => {
|
|
1154
1108
|
editor.ui.registry.addMenuItem('openlink', {
|
|
1155
1109
|
text: 'Open link',
|
|
1156
1110
|
icon: 'new-tab',
|
|
1157
1111
|
onAction: gotoSelectedLink(editor),
|
|
1158
|
-
onSetup:
|
|
1112
|
+
onSetup: toggleGotoLinkState(editor)
|
|
1159
1113
|
});
|
|
1160
1114
|
editor.ui.registry.addMenuItem('link', {
|
|
1161
1115
|
icon: 'link',
|
|
1162
1116
|
text: 'Link...',
|
|
1163
1117
|
shortcut: 'Meta+K',
|
|
1118
|
+
onSetup: toggleLinkMenuState(editor),
|
|
1164
1119
|
onAction: openDialog(editor)
|
|
1165
1120
|
});
|
|
1166
1121
|
editor.ui.registry.addMenuItem('unlink', {
|
|
1167
1122
|
icon: 'unlink',
|
|
1168
1123
|
text: 'Remove link',
|
|
1169
|
-
onAction:
|
|
1170
|
-
return unlink(editor);
|
|
1171
|
-
},
|
|
1124
|
+
onAction: () => unlink(editor),
|
|
1172
1125
|
onSetup: toggleUnlinkState(editor)
|
|
1173
1126
|
});
|
|
1174
1127
|
};
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1128
|
+
const setupContextMenu = editor => {
|
|
1129
|
+
const inLink = 'link unlink openlink';
|
|
1130
|
+
const noLink = 'link';
|
|
1178
1131
|
editor.ui.registry.addContextMenu('link', {
|
|
1179
|
-
update:
|
|
1132
|
+
update: element => {
|
|
1133
|
+
const isEditable = editor.dom.isEditable(element);
|
|
1134
|
+
if (!isEditable) {
|
|
1135
|
+
return '';
|
|
1136
|
+
}
|
|
1180
1137
|
return hasLinks(editor.dom.getParents(element, 'a')) ? inLink : noLink;
|
|
1181
1138
|
}
|
|
1182
1139
|
});
|
|
1183
1140
|
};
|
|
1184
|
-
|
|
1185
|
-
|
|
1141
|
+
const setupContextToolbars = editor => {
|
|
1142
|
+
const collapseSelectionToEnd = editor => {
|
|
1186
1143
|
editor.selection.collapse(false);
|
|
1187
1144
|
};
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
buttonApi.
|
|
1145
|
+
const onSetupLink = buttonApi => {
|
|
1146
|
+
const node = editor.selection.getNode();
|
|
1147
|
+
buttonApi.setEnabled(isInAnchor(editor, node));
|
|
1191
1148
|
return noop;
|
|
1192
1149
|
};
|
|
1150
|
+
const getLinkText = value => {
|
|
1151
|
+
const anchor = getAnchorElement(editor);
|
|
1152
|
+
const onlyText = isOnlyTextSelected(editor);
|
|
1153
|
+
if (anchor.isNone() && onlyText) {
|
|
1154
|
+
const text = getAnchorText(editor.selection, anchor);
|
|
1155
|
+
return someIf(text.length === 0, value);
|
|
1156
|
+
} else {
|
|
1157
|
+
return Optional.none();
|
|
1158
|
+
}
|
|
1159
|
+
};
|
|
1193
1160
|
editor.ui.registry.addContextForm('quicklink', {
|
|
1194
1161
|
launch: {
|
|
1195
1162
|
type: 'contextformtogglebutton',
|
|
1196
1163
|
icon: 'link',
|
|
1197
1164
|
tooltip: 'Link',
|
|
1198
|
-
onSetup:
|
|
1165
|
+
onSetup: toggleLinkState(editor)
|
|
1199
1166
|
},
|
|
1200
1167
|
label: 'Link',
|
|
1201
|
-
predicate:
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
var elm = getAnchorElement(editor);
|
|
1206
|
-
return !!elm ? getHref(elm) : '';
|
|
1168
|
+
predicate: node => hasContextToolbar(editor) && isInAnchor(editor, node),
|
|
1169
|
+
initValue: () => {
|
|
1170
|
+
const elm = getAnchorElement(editor);
|
|
1171
|
+
return elm.fold(constant(''), getHref);
|
|
1207
1172
|
},
|
|
1208
1173
|
commands: [
|
|
1209
1174
|
{
|
|
@@ -1211,39 +1176,28 @@
|
|
|
1211
1176
|
icon: 'link',
|
|
1212
1177
|
tooltip: 'Link',
|
|
1213
1178
|
primary: true,
|
|
1214
|
-
onSetup:
|
|
1215
|
-
|
|
1216
|
-
buttonApi.setActive(
|
|
1217
|
-
return
|
|
1179
|
+
onSetup: buttonApi => {
|
|
1180
|
+
const node = editor.selection.getNode();
|
|
1181
|
+
buttonApi.setActive(isInAnchor(editor, node));
|
|
1182
|
+
return toggleLinkState(editor)(buttonApi);
|
|
1218
1183
|
},
|
|
1219
|
-
onAction:
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
target: Optional.none(),
|
|
1237
|
-
class: Optional.none()
|
|
1238
|
-
});
|
|
1239
|
-
formApi.hide();
|
|
1240
|
-
} else {
|
|
1241
|
-
editor.undoManager.transact(function () {
|
|
1242
|
-
editor.dom.setAttrib(anchor, 'href', value);
|
|
1243
|
-
collapseSelectionToEnd(editor);
|
|
1244
|
-
formApi.hide();
|
|
1245
|
-
});
|
|
1246
|
-
}
|
|
1184
|
+
onAction: formApi => {
|
|
1185
|
+
const value = formApi.getValue();
|
|
1186
|
+
const text = getLinkText(value);
|
|
1187
|
+
const attachState = {
|
|
1188
|
+
href: value,
|
|
1189
|
+
attach: noop
|
|
1190
|
+
};
|
|
1191
|
+
link(editor, attachState, {
|
|
1192
|
+
href: value,
|
|
1193
|
+
text,
|
|
1194
|
+
title: Optional.none(),
|
|
1195
|
+
rel: Optional.none(),
|
|
1196
|
+
target: Optional.none(),
|
|
1197
|
+
class: Optional.none()
|
|
1198
|
+
});
|
|
1199
|
+
collapseSelectionToEnd(editor);
|
|
1200
|
+
formApi.hide();
|
|
1247
1201
|
}
|
|
1248
1202
|
},
|
|
1249
1203
|
{
|
|
@@ -1251,7 +1205,7 @@
|
|
|
1251
1205
|
icon: 'unlink',
|
|
1252
1206
|
tooltip: 'Remove link',
|
|
1253
1207
|
onSetup: onSetupLink,
|
|
1254
|
-
onAction:
|
|
1208
|
+
onAction: formApi => {
|
|
1255
1209
|
unlink(editor);
|
|
1256
1210
|
formApi.hide();
|
|
1257
1211
|
}
|
|
@@ -1261,7 +1215,7 @@
|
|
|
1261
1215
|
icon: 'new-tab',
|
|
1262
1216
|
tooltip: 'Open link',
|
|
1263
1217
|
onSetup: onSetupLink,
|
|
1264
|
-
onAction:
|
|
1218
|
+
onAction: formApi => {
|
|
1265
1219
|
gotoSelectedLink(editor)();
|
|
1266
1220
|
formApi.hide();
|
|
1267
1221
|
}
|
|
@@ -1270,8 +1224,9 @@
|
|
|
1270
1224
|
});
|
|
1271
1225
|
};
|
|
1272
1226
|
|
|
1273
|
-
|
|
1274
|
-
global.add('link',
|
|
1227
|
+
var Plugin = () => {
|
|
1228
|
+
global$5.add('link', editor => {
|
|
1229
|
+
register$1(editor);
|
|
1275
1230
|
setupButtons(editor);
|
|
1276
1231
|
setupMenuItems(editor);
|
|
1277
1232
|
setupContextMenu(editor);
|
|
@@ -1280,8 +1235,8 @@
|
|
|
1280
1235
|
register(editor);
|
|
1281
1236
|
setup(editor);
|
|
1282
1237
|
});
|
|
1283
|
-
}
|
|
1238
|
+
};
|
|
1284
1239
|
|
|
1285
1240
|
Plugin();
|
|
1286
1241
|
|
|
1287
|
-
}()
|
|
1242
|
+
})();
|