argous 1.2.202 → 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/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/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,227 +1,200 @@
|
|
|
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
|
-
|
|
13
|
-
|
|
14
|
-
|
|
8
|
+
const Cell = initial => {
|
|
9
|
+
let value = initial;
|
|
10
|
+
const get = () => {
|
|
15
11
|
return value;
|
|
16
12
|
};
|
|
17
|
-
|
|
13
|
+
const set = v => {
|
|
18
14
|
value = v;
|
|
19
15
|
};
|
|
20
16
|
return {
|
|
21
|
-
get
|
|
22
|
-
set
|
|
17
|
+
get,
|
|
18
|
+
set
|
|
23
19
|
};
|
|
24
20
|
};
|
|
25
21
|
|
|
26
|
-
var global = tinymce.util.Tools.resolve('tinymce.PluginManager');
|
|
22
|
+
var global$3 = tinymce.util.Tools.resolve('tinymce.PluginManager');
|
|
27
23
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
}
|
|
36
|
-
return t;
|
|
37
|
-
};
|
|
38
|
-
return __assign.apply(this, arguments);
|
|
24
|
+
const hasProto = (v, constructor, predicate) => {
|
|
25
|
+
var _a;
|
|
26
|
+
if (predicate(v, constructor.prototype)) {
|
|
27
|
+
return true;
|
|
28
|
+
} else {
|
|
29
|
+
return ((_a = v.constructor) === null || _a === void 0 ? void 0 : _a.name) === constructor.name;
|
|
30
|
+
}
|
|
39
31
|
};
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
var t = typeof x;
|
|
32
|
+
const typeOf = x => {
|
|
33
|
+
const t = typeof x;
|
|
43
34
|
if (x === null) {
|
|
44
35
|
return 'null';
|
|
45
|
-
} else if (t === 'object' &&
|
|
36
|
+
} else if (t === 'object' && Array.isArray(x)) {
|
|
46
37
|
return 'array';
|
|
47
|
-
} else if (t === 'object' && (String
|
|
38
|
+
} else if (t === 'object' && hasProto(x, String, (o, proto) => proto.isPrototypeOf(o))) {
|
|
48
39
|
return 'string';
|
|
49
40
|
} else {
|
|
50
41
|
return t;
|
|
51
42
|
}
|
|
52
43
|
};
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
};
|
|
62
|
-
};
|
|
63
|
-
var isString = isType('string');
|
|
64
|
-
var isArray = isType('array');
|
|
65
|
-
var isBoolean = isSimpleType('boolean');
|
|
66
|
-
var isNumber = isSimpleType('number');
|
|
44
|
+
const isType$1 = type => value => typeOf(value) === type;
|
|
45
|
+
const isSimpleType = type => value => typeof value === type;
|
|
46
|
+
const isString = isType$1('string');
|
|
47
|
+
const isArray = isType$1('array');
|
|
48
|
+
const isBoolean = isSimpleType('boolean');
|
|
49
|
+
const isNullable = a => a === null || a === undefined;
|
|
50
|
+
const isNonNullable = a => !isNullable(a);
|
|
51
|
+
const isNumber = isSimpleType('number');
|
|
67
52
|
|
|
68
|
-
|
|
53
|
+
const noop = () => {
|
|
69
54
|
};
|
|
70
|
-
|
|
71
|
-
return
|
|
55
|
+
const constant = value => {
|
|
56
|
+
return () => {
|
|
72
57
|
return value;
|
|
73
58
|
};
|
|
74
59
|
};
|
|
75
|
-
|
|
76
|
-
var always = constant(true);
|
|
60
|
+
const always = constant(true);
|
|
77
61
|
|
|
78
|
-
|
|
62
|
+
const punctuationStr = `[~\u2116|!-*+-\\/:;?@\\[-\`{}\u00A1\u00AB\u00B7\u00BB\u00BF;\u00B7\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1361-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u3008\u3009\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30\u2E31\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]`;
|
|
79
63
|
|
|
80
|
-
|
|
64
|
+
const punctuation$1 = constant(punctuationStr);
|
|
81
65
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
return
|
|
98
|
-
},
|
|
99
|
-
is: never,
|
|
100
|
-
isSome: never,
|
|
101
|
-
isNone: always,
|
|
102
|
-
getOr: id,
|
|
103
|
-
getOrThunk: call,
|
|
104
|
-
getOrDie: function (msg) {
|
|
105
|
-
throw new Error(msg || 'error: getOrDie called on none.');
|
|
106
|
-
},
|
|
107
|
-
getOrNull: constant(null),
|
|
108
|
-
getOrUndefined: constant(undefined),
|
|
109
|
-
or: id,
|
|
110
|
-
orThunk: call,
|
|
111
|
-
map: none,
|
|
112
|
-
each: noop,
|
|
113
|
-
bind: none,
|
|
114
|
-
exists: never,
|
|
115
|
-
forall: always,
|
|
116
|
-
filter: none,
|
|
117
|
-
equals: eq,
|
|
118
|
-
equals_: eq,
|
|
119
|
-
toArray: function () {
|
|
120
|
-
return [];
|
|
121
|
-
},
|
|
122
|
-
toString: constant('none()')
|
|
123
|
-
};
|
|
124
|
-
return me;
|
|
125
|
-
}();
|
|
126
|
-
var some = function (a) {
|
|
127
|
-
var constant_a = constant(a);
|
|
128
|
-
var self = function () {
|
|
129
|
-
return me;
|
|
130
|
-
};
|
|
131
|
-
var bind = function (f) {
|
|
132
|
-
return f(a);
|
|
133
|
-
};
|
|
134
|
-
var me = {
|
|
135
|
-
fold: function (n, s) {
|
|
136
|
-
return s(a);
|
|
137
|
-
},
|
|
138
|
-
is: function (v) {
|
|
139
|
-
return a === v;
|
|
140
|
-
},
|
|
141
|
-
isSome: always,
|
|
142
|
-
isNone: never,
|
|
143
|
-
getOr: constant_a,
|
|
144
|
-
getOrThunk: constant_a,
|
|
145
|
-
getOrDie: constant_a,
|
|
146
|
-
getOrNull: constant_a,
|
|
147
|
-
getOrUndefined: constant_a,
|
|
148
|
-
or: self,
|
|
149
|
-
orThunk: self,
|
|
150
|
-
map: function (f) {
|
|
151
|
-
return some(f(a));
|
|
152
|
-
},
|
|
153
|
-
each: function (f) {
|
|
154
|
-
f(a);
|
|
155
|
-
},
|
|
156
|
-
bind: bind,
|
|
157
|
-
exists: bind,
|
|
158
|
-
forall: bind,
|
|
159
|
-
filter: function (f) {
|
|
160
|
-
return f(a) ? me : NONE;
|
|
161
|
-
},
|
|
162
|
-
toArray: function () {
|
|
163
|
-
return [a];
|
|
164
|
-
},
|
|
165
|
-
toString: function () {
|
|
166
|
-
return 'some(' + a + ')';
|
|
167
|
-
},
|
|
168
|
-
equals: function (o) {
|
|
169
|
-
return o.is(a);
|
|
170
|
-
},
|
|
171
|
-
equals_: function (o, elementEq) {
|
|
172
|
-
return o.fold(never, function (b) {
|
|
173
|
-
return elementEq(a, b);
|
|
174
|
-
});
|
|
66
|
+
class Optional {
|
|
67
|
+
constructor(tag, value) {
|
|
68
|
+
this.tag = tag;
|
|
69
|
+
this.value = value;
|
|
70
|
+
}
|
|
71
|
+
static some(value) {
|
|
72
|
+
return new Optional(true, value);
|
|
73
|
+
}
|
|
74
|
+
static none() {
|
|
75
|
+
return Optional.singletonNone;
|
|
76
|
+
}
|
|
77
|
+
fold(onNone, onSome) {
|
|
78
|
+
if (this.tag) {
|
|
79
|
+
return onSome(this.value);
|
|
80
|
+
} else {
|
|
81
|
+
return onNone();
|
|
175
82
|
}
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
83
|
+
}
|
|
84
|
+
isSome() {
|
|
85
|
+
return this.tag;
|
|
86
|
+
}
|
|
87
|
+
isNone() {
|
|
88
|
+
return !this.tag;
|
|
89
|
+
}
|
|
90
|
+
map(mapper) {
|
|
91
|
+
if (this.tag) {
|
|
92
|
+
return Optional.some(mapper(this.value));
|
|
93
|
+
} else {
|
|
94
|
+
return Optional.none();
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
bind(binder) {
|
|
98
|
+
if (this.tag) {
|
|
99
|
+
return binder(this.value);
|
|
100
|
+
} else {
|
|
101
|
+
return Optional.none();
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
exists(predicate) {
|
|
105
|
+
return this.tag && predicate(this.value);
|
|
106
|
+
}
|
|
107
|
+
forall(predicate) {
|
|
108
|
+
return !this.tag || predicate(this.value);
|
|
109
|
+
}
|
|
110
|
+
filter(predicate) {
|
|
111
|
+
if (!this.tag || predicate(this.value)) {
|
|
112
|
+
return this;
|
|
113
|
+
} else {
|
|
114
|
+
return Optional.none();
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
getOr(replacement) {
|
|
118
|
+
return this.tag ? this.value : replacement;
|
|
119
|
+
}
|
|
120
|
+
or(replacement) {
|
|
121
|
+
return this.tag ? this : replacement;
|
|
122
|
+
}
|
|
123
|
+
getOrThunk(thunk) {
|
|
124
|
+
return this.tag ? this.value : thunk();
|
|
125
|
+
}
|
|
126
|
+
orThunk(thunk) {
|
|
127
|
+
return this.tag ? this : thunk();
|
|
128
|
+
}
|
|
129
|
+
getOrDie(message) {
|
|
130
|
+
if (!this.tag) {
|
|
131
|
+
throw new Error(message !== null && message !== void 0 ? message : 'Called getOrDie on None');
|
|
132
|
+
} else {
|
|
133
|
+
return this.value;
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
static from(value) {
|
|
137
|
+
return isNonNullable(value) ? Optional.some(value) : Optional.none();
|
|
138
|
+
}
|
|
139
|
+
getOrNull() {
|
|
140
|
+
return this.tag ? this.value : null;
|
|
141
|
+
}
|
|
142
|
+
getOrUndefined() {
|
|
143
|
+
return this.value;
|
|
144
|
+
}
|
|
145
|
+
each(worker) {
|
|
146
|
+
if (this.tag) {
|
|
147
|
+
worker(this.value);
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
toArray() {
|
|
151
|
+
return this.tag ? [this.value] : [];
|
|
152
|
+
}
|
|
153
|
+
toString() {
|
|
154
|
+
return this.tag ? `some(${ this.value })` : 'none()';
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
Optional.singletonNone = new Optional(false);
|
|
187
158
|
|
|
188
|
-
|
|
159
|
+
const punctuation = punctuation$1;
|
|
160
|
+
|
|
161
|
+
var global$2 = tinymce.util.Tools.resolve('tinymce.Env');
|
|
189
162
|
|
|
190
163
|
var global$1 = tinymce.util.Tools.resolve('tinymce.util.Tools');
|
|
191
164
|
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
for (
|
|
198
|
-
|
|
165
|
+
const nativeSlice = Array.prototype.slice;
|
|
166
|
+
const nativePush = Array.prototype.push;
|
|
167
|
+
const map = (xs, f) => {
|
|
168
|
+
const len = xs.length;
|
|
169
|
+
const r = new Array(len);
|
|
170
|
+
for (let i = 0; i < len; i++) {
|
|
171
|
+
const x = xs[i];
|
|
199
172
|
r[i] = f(x, i);
|
|
200
173
|
}
|
|
201
174
|
return r;
|
|
202
175
|
};
|
|
203
|
-
|
|
204
|
-
for (
|
|
205
|
-
|
|
176
|
+
const each = (xs, f) => {
|
|
177
|
+
for (let i = 0, len = xs.length; i < len; i++) {
|
|
178
|
+
const x = xs[i];
|
|
206
179
|
f(x, i);
|
|
207
180
|
}
|
|
208
181
|
};
|
|
209
|
-
|
|
210
|
-
for (
|
|
211
|
-
|
|
182
|
+
const eachr = (xs, f) => {
|
|
183
|
+
for (let i = xs.length - 1; i >= 0; i--) {
|
|
184
|
+
const x = xs[i];
|
|
212
185
|
f(x, i);
|
|
213
186
|
}
|
|
214
187
|
};
|
|
215
|
-
|
|
188
|
+
const groupBy = (xs, f) => {
|
|
216
189
|
if (xs.length === 0) {
|
|
217
190
|
return [];
|
|
218
191
|
} else {
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
for (
|
|
223
|
-
|
|
224
|
-
|
|
192
|
+
let wasType = f(xs[0]);
|
|
193
|
+
const r = [];
|
|
194
|
+
let group = [];
|
|
195
|
+
for (let i = 0, len = xs.length; i < len; i++) {
|
|
196
|
+
const x = xs[i];
|
|
197
|
+
const type = f(x);
|
|
225
198
|
if (type !== wasType) {
|
|
226
199
|
r.push(group);
|
|
227
200
|
group = [];
|
|
@@ -235,15 +208,15 @@
|
|
|
235
208
|
return r;
|
|
236
209
|
}
|
|
237
210
|
};
|
|
238
|
-
|
|
239
|
-
each(xs,
|
|
240
|
-
acc = f(acc, x);
|
|
211
|
+
const foldl = (xs, f, acc) => {
|
|
212
|
+
each(xs, (x, i) => {
|
|
213
|
+
acc = f(acc, x, i);
|
|
241
214
|
});
|
|
242
215
|
return acc;
|
|
243
216
|
};
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
for (
|
|
217
|
+
const flatten = xs => {
|
|
218
|
+
const r = [];
|
|
219
|
+
for (let i = 0, len = xs.length; i < len; ++i) {
|
|
247
220
|
if (!isArray(xs[i])) {
|
|
248
221
|
throw new Error('Arr.flatten item ' + i + ' was not an array, input: ' + xs);
|
|
249
222
|
}
|
|
@@ -251,38 +224,28 @@
|
|
|
251
224
|
}
|
|
252
225
|
return r;
|
|
253
226
|
};
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
var sort = function (xs, comparator) {
|
|
258
|
-
var copy = nativeSlice.call(xs, 0);
|
|
227
|
+
const bind = (xs, f) => flatten(map(xs, f));
|
|
228
|
+
const sort = (xs, comparator) => {
|
|
229
|
+
const copy = nativeSlice.call(xs, 0);
|
|
259
230
|
copy.sort(comparator);
|
|
260
231
|
return copy;
|
|
261
232
|
};
|
|
262
233
|
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
return hasOwnProperty.call(obj, key);
|
|
266
|
-
};
|
|
234
|
+
const hasOwnProperty = Object.hasOwnProperty;
|
|
235
|
+
const has = (obj, key) => hasOwnProperty.call(obj, key);
|
|
267
236
|
|
|
268
|
-
|
|
237
|
+
typeof window !== 'undefined' ? window : Function('return this;')();
|
|
269
238
|
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
239
|
+
const DOCUMENT = 9;
|
|
240
|
+
const DOCUMENT_FRAGMENT = 11;
|
|
241
|
+
const ELEMENT = 1;
|
|
242
|
+
const TEXT = 3;
|
|
274
243
|
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
var isType$1 = function (t) {
|
|
279
|
-
return function (element) {
|
|
280
|
-
return type(element) === t;
|
|
281
|
-
};
|
|
282
|
-
};
|
|
283
|
-
var isText = isType$1(TEXT);
|
|
244
|
+
const type = element => element.dom.nodeType;
|
|
245
|
+
const isType = t => element => type(element) === t;
|
|
246
|
+
const isText$1 = isType(TEXT);
|
|
284
247
|
|
|
285
|
-
|
|
248
|
+
const rawSet = (dom, key, value) => {
|
|
286
249
|
if (isString(value) || isBoolean(value) || isNumber(value)) {
|
|
287
250
|
dom.setAttribute(key, value + '');
|
|
288
251
|
} else {
|
|
@@ -290,164 +253,130 @@
|
|
|
290
253
|
throw new Error('Attribute value was not simple');
|
|
291
254
|
}
|
|
292
255
|
};
|
|
293
|
-
|
|
256
|
+
const set = (element, key, value) => {
|
|
294
257
|
rawSet(element.dom, key, value);
|
|
295
258
|
};
|
|
296
259
|
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
var documentPositionPreceding = function (a, b) {
|
|
301
|
-
return compareDocumentPosition(a, b, Node.DOCUMENT_POSITION_PRECEDING);
|
|
302
|
-
};
|
|
303
|
-
|
|
304
|
-
var fromHtml = function (html, scope) {
|
|
305
|
-
var doc = scope || document;
|
|
306
|
-
var div = doc.createElement('div');
|
|
260
|
+
const fromHtml = (html, scope) => {
|
|
261
|
+
const doc = scope || document;
|
|
262
|
+
const div = doc.createElement('div');
|
|
307
263
|
div.innerHTML = html;
|
|
308
264
|
if (!div.hasChildNodes() || div.childNodes.length > 1) {
|
|
309
|
-
|
|
310
|
-
|
|
265
|
+
const message = 'HTML does not have a single root node';
|
|
266
|
+
console.error(message, html);
|
|
267
|
+
throw new Error(message);
|
|
311
268
|
}
|
|
312
269
|
return fromDom(div.childNodes[0]);
|
|
313
270
|
};
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
271
|
+
const fromTag = (tag, scope) => {
|
|
272
|
+
const doc = scope || document;
|
|
273
|
+
const node = doc.createElement(tag);
|
|
317
274
|
return fromDom(node);
|
|
318
275
|
};
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
276
|
+
const fromText = (text, scope) => {
|
|
277
|
+
const doc = scope || document;
|
|
278
|
+
const node = doc.createTextNode(text);
|
|
322
279
|
return fromDom(node);
|
|
323
280
|
};
|
|
324
|
-
|
|
281
|
+
const fromDom = node => {
|
|
325
282
|
if (node === null || node === undefined) {
|
|
326
283
|
throw new Error('Node cannot be null or undefined');
|
|
327
284
|
}
|
|
328
285
|
return { dom: node };
|
|
329
286
|
};
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
fromDom: fromDom,
|
|
338
|
-
fromPoint: fromPoint
|
|
287
|
+
const fromPoint = (docElm, x, y) => Optional.from(docElm.dom.elementFromPoint(x, y)).map(fromDom);
|
|
288
|
+
const SugarElement = {
|
|
289
|
+
fromHtml,
|
|
290
|
+
fromTag,
|
|
291
|
+
fromText,
|
|
292
|
+
fromDom,
|
|
293
|
+
fromPoint
|
|
339
294
|
};
|
|
340
295
|
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
var all = function (selector, scope) {
|
|
345
|
-
var base = scope === undefined ? document : scope.dom;
|
|
296
|
+
const bypassSelector = dom => dom.nodeType !== ELEMENT && dom.nodeType !== DOCUMENT && dom.nodeType !== DOCUMENT_FRAGMENT || dom.childElementCount === 0;
|
|
297
|
+
const all = (selector, scope) => {
|
|
298
|
+
const base = scope === undefined ? document : scope.dom;
|
|
346
299
|
return bypassSelector(base) ? [] : map(base.querySelectorAll(selector), SugarElement.fromDom);
|
|
347
300
|
};
|
|
348
301
|
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
};
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
element: element,
|
|
358
|
-
offset: offset
|
|
359
|
-
};
|
|
360
|
-
};
|
|
361
|
-
var leaf = function (element, offset) {
|
|
362
|
-
var cs = children(element);
|
|
302
|
+
const parent = element => Optional.from(element.dom.parentNode).map(SugarElement.fromDom);
|
|
303
|
+
const children = element => map(element.dom.childNodes, SugarElement.fromDom);
|
|
304
|
+
const spot = (element, offset) => ({
|
|
305
|
+
element,
|
|
306
|
+
offset
|
|
307
|
+
});
|
|
308
|
+
const leaf = (element, offset) => {
|
|
309
|
+
const cs = children(element);
|
|
363
310
|
return cs.length > 0 && offset < cs.length ? spot(cs[offset], 0) : spot(element, offset);
|
|
364
311
|
};
|
|
365
312
|
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
parent$1.each(
|
|
313
|
+
const before = (marker, element) => {
|
|
314
|
+
const parent$1 = parent(marker);
|
|
315
|
+
parent$1.each(v => {
|
|
369
316
|
v.dom.insertBefore(element.dom, marker.dom);
|
|
370
317
|
});
|
|
371
318
|
};
|
|
372
|
-
|
|
319
|
+
const append = (parent, element) => {
|
|
373
320
|
parent.dom.appendChild(element.dom);
|
|
374
321
|
};
|
|
375
|
-
|
|
322
|
+
const wrap = (element, wrapper) => {
|
|
376
323
|
before(element, wrapper);
|
|
377
324
|
append(wrapper, element);
|
|
378
325
|
};
|
|
379
326
|
|
|
380
|
-
|
|
381
|
-
|
|
327
|
+
const NodeValue = (is, name) => {
|
|
328
|
+
const get = element => {
|
|
382
329
|
if (!is(element)) {
|
|
383
330
|
throw new Error('Can only get ' + name + ' value of a ' + name + ' node');
|
|
384
331
|
}
|
|
385
332
|
return getOption(element).getOr('');
|
|
386
333
|
};
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
};
|
|
390
|
-
var set = function (element, value) {
|
|
334
|
+
const getOption = element => is(element) ? Optional.from(element.dom.nodeValue) : Optional.none();
|
|
335
|
+
const set = (element, value) => {
|
|
391
336
|
if (!is(element)) {
|
|
392
337
|
throw new Error('Can only set raw ' + name + ' value of a ' + name + ' node');
|
|
393
338
|
}
|
|
394
339
|
element.dom.nodeValue = value;
|
|
395
340
|
};
|
|
396
341
|
return {
|
|
397
|
-
get
|
|
398
|
-
getOption
|
|
399
|
-
set
|
|
342
|
+
get,
|
|
343
|
+
getOption,
|
|
344
|
+
set
|
|
400
345
|
};
|
|
401
346
|
};
|
|
402
347
|
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
return api.get(element);
|
|
406
|
-
};
|
|
348
|
+
const api = NodeValue(isText$1, 'text');
|
|
349
|
+
const get$1 = element => api.get(element);
|
|
407
350
|
|
|
408
|
-
|
|
409
|
-
return
|
|
351
|
+
const compareDocumentPosition = (a, b, match) => {
|
|
352
|
+
return (a.compareDocumentPosition(b) & match) !== 0;
|
|
353
|
+
};
|
|
354
|
+
const documentPositionPreceding = (a, b) => {
|
|
355
|
+
return compareDocumentPosition(a, b, Node.DOCUMENT_POSITION_PRECEDING);
|
|
410
356
|
};
|
|
411
357
|
|
|
412
|
-
|
|
358
|
+
const descendants = (scope, selector) => all(selector, scope);
|
|
413
359
|
|
|
414
|
-
var
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
return node.nodeType === 3;
|
|
431
|
-
};
|
|
432
|
-
var nuSection = function () {
|
|
433
|
-
return {
|
|
434
|
-
sOffset: 0,
|
|
435
|
-
fOffset: 0,
|
|
436
|
-
elements: []
|
|
437
|
-
};
|
|
438
|
-
};
|
|
439
|
-
var toLeaf = function (node, offset) {
|
|
440
|
-
return leaf(SugarElement.fromDom(node), offset);
|
|
441
|
-
};
|
|
442
|
-
var walk = function (dom, walkerFn, startNode, callbacks, endNode, skipStart) {
|
|
443
|
-
if (skipStart === void 0) {
|
|
444
|
-
skipStart = true;
|
|
445
|
-
}
|
|
446
|
-
var next = skipStart ? walkerFn(false) : startNode;
|
|
360
|
+
var global = tinymce.util.Tools.resolve('tinymce.dom.TreeWalker');
|
|
361
|
+
|
|
362
|
+
const isSimpleBoundary = (dom, node) => dom.isBlock(node) || has(dom.schema.getVoidElements(), node.nodeName);
|
|
363
|
+
const isContentEditableFalse = (dom, node) => !dom.isEditable(node);
|
|
364
|
+
const isContentEditableTrueInCef = (dom, node) => dom.getContentEditable(node) === 'true' && node.parentNode && !dom.isEditable(node.parentNode);
|
|
365
|
+
const isHidden = (dom, node) => !dom.isBlock(node) && has(dom.schema.getWhitespaceElements(), node.nodeName);
|
|
366
|
+
const isBoundary = (dom, node) => isSimpleBoundary(dom, node) || isContentEditableFalse(dom, node) || isHidden(dom, node) || isContentEditableTrueInCef(dom, node);
|
|
367
|
+
const isText = node => node.nodeType === 3;
|
|
368
|
+
const nuSection = () => ({
|
|
369
|
+
sOffset: 0,
|
|
370
|
+
fOffset: 0,
|
|
371
|
+
elements: []
|
|
372
|
+
});
|
|
373
|
+
const toLeaf = (node, offset) => leaf(SugarElement.fromDom(node), offset);
|
|
374
|
+
const walk = (dom, walkerFn, startNode, callbacks, endNode, skipStart = true) => {
|
|
375
|
+
let next = skipStart ? walkerFn(false) : startNode;
|
|
447
376
|
while (next) {
|
|
448
|
-
|
|
377
|
+
const isCefNode = isContentEditableFalse(dom, next);
|
|
449
378
|
if (isCefNode || isHidden(dom, next)) {
|
|
450
|
-
|
|
379
|
+
const stopWalking = isCefNode ? callbacks.cef(next) : callbacks.boundary(next);
|
|
451
380
|
if (stopWalking) {
|
|
452
381
|
break;
|
|
453
382
|
} else {
|
|
@@ -458,7 +387,7 @@
|
|
|
458
387
|
if (callbacks.boundary(next)) {
|
|
459
388
|
break;
|
|
460
389
|
}
|
|
461
|
-
} else if (isText
|
|
390
|
+
} else if (isText(next)) {
|
|
462
391
|
callbacks.text(next);
|
|
463
392
|
}
|
|
464
393
|
if (next === endNode) {
|
|
@@ -468,17 +397,18 @@
|
|
|
468
397
|
}
|
|
469
398
|
}
|
|
470
399
|
};
|
|
471
|
-
|
|
400
|
+
const collectTextToBoundary = (dom, section, node, rootNode, forwards) => {
|
|
401
|
+
var _a;
|
|
472
402
|
if (isBoundary(dom, node)) {
|
|
473
403
|
return;
|
|
474
404
|
}
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
405
|
+
const rootBlock = (_a = dom.getParent(rootNode, dom.isBlock)) !== null && _a !== void 0 ? _a : dom.getRoot();
|
|
406
|
+
const walker = new global(node, rootBlock);
|
|
407
|
+
const walkerFn = forwards ? walker.next.bind(walker) : walker.prev.bind(walker);
|
|
478
408
|
walk(dom, walkerFn, node, {
|
|
479
409
|
boundary: always,
|
|
480
410
|
cef: always,
|
|
481
|
-
text:
|
|
411
|
+
text: next => {
|
|
482
412
|
if (forwards) {
|
|
483
413
|
section.fOffset += next.length;
|
|
484
414
|
} else {
|
|
@@ -488,15 +418,12 @@
|
|
|
488
418
|
}
|
|
489
419
|
});
|
|
490
420
|
};
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
var walker = new global$2(startNode, rootNode);
|
|
496
|
-
var sections = [];
|
|
497
|
-
var current = nuSection();
|
|
421
|
+
const collect = (dom, rootNode, startNode, endNode, callbacks, skipStart = true) => {
|
|
422
|
+
const walker = new global(startNode, rootNode);
|
|
423
|
+
const sections = [];
|
|
424
|
+
let current = nuSection();
|
|
498
425
|
collectTextToBoundary(dom, current, startNode, rootNode, false);
|
|
499
|
-
|
|
426
|
+
const finishSection = () => {
|
|
500
427
|
if (current.elements.length > 0) {
|
|
501
428
|
sections.push(current);
|
|
502
429
|
current = nuSection();
|
|
@@ -505,14 +432,14 @@
|
|
|
505
432
|
};
|
|
506
433
|
walk(dom, walker.next.bind(walker), startNode, {
|
|
507
434
|
boundary: finishSection,
|
|
508
|
-
cef:
|
|
435
|
+
cef: node => {
|
|
509
436
|
finishSection();
|
|
510
437
|
if (callbacks) {
|
|
511
|
-
sections.push
|
|
438
|
+
sections.push(...callbacks.cef(node));
|
|
512
439
|
}
|
|
513
440
|
return false;
|
|
514
441
|
},
|
|
515
|
-
text:
|
|
442
|
+
text: next => {
|
|
516
443
|
current.elements.push(SugarElement.fromDom(next));
|
|
517
444
|
if (callbacks) {
|
|
518
445
|
callbacks.text(next, current);
|
|
@@ -525,59 +452,45 @@
|
|
|
525
452
|
finishSection();
|
|
526
453
|
return sections;
|
|
527
454
|
};
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
455
|
+
const collectRangeSections = (dom, rng) => {
|
|
456
|
+
const start = toLeaf(rng.startContainer, rng.startOffset);
|
|
457
|
+
const startNode = start.element.dom;
|
|
458
|
+
const end = toLeaf(rng.endContainer, rng.endOffset);
|
|
459
|
+
const endNode = end.element.dom;
|
|
533
460
|
return collect(dom, rng.commonAncestorContainer, startNode, endNode, {
|
|
534
|
-
text:
|
|
461
|
+
text: (node, section) => {
|
|
535
462
|
if (node === endNode) {
|
|
536
463
|
section.fOffset += node.length - end.offset;
|
|
537
464
|
} else if (node === startNode) {
|
|
538
465
|
section.sOffset += start.offset;
|
|
539
466
|
}
|
|
540
467
|
},
|
|
541
|
-
cef:
|
|
542
|
-
|
|
543
|
-
|
|
468
|
+
cef: node => {
|
|
469
|
+
const sections = bind(descendants(SugarElement.fromDom(node), '*[contenteditable=true]'), e => {
|
|
470
|
+
const ceTrueNode = e.dom;
|
|
544
471
|
return collect(dom, ceTrueNode, ceTrueNode);
|
|
545
472
|
});
|
|
546
|
-
return sort(sections,
|
|
547
|
-
return documentPositionPreceding(a.elements[0].dom, b.elements[0].dom) ? 1 : -1;
|
|
548
|
-
});
|
|
473
|
+
return sort(sections, (a, b) => documentPositionPreceding(a.elements[0].dom, b.elements[0].dom) ? 1 : -1);
|
|
549
474
|
}
|
|
550
475
|
}, false);
|
|
551
476
|
};
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
var fromNode = function (dom, node) {
|
|
556
|
-
var rng = dom.createRng();
|
|
477
|
+
const fromRng = (dom, rng) => rng.collapsed ? [] : collectRangeSections(dom, rng);
|
|
478
|
+
const fromNode = (dom, node) => {
|
|
479
|
+
const rng = dom.createRng();
|
|
557
480
|
rng.selectNode(node);
|
|
558
481
|
return fromRng(dom, rng);
|
|
559
482
|
};
|
|
560
|
-
|
|
561
|
-
return bind(nodes, function (node) {
|
|
562
|
-
return fromNode(dom, node);
|
|
563
|
-
});
|
|
564
|
-
};
|
|
483
|
+
const fromNodes = (dom, nodes) => bind(nodes, node => fromNode(dom, node));
|
|
565
484
|
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
start = 0;
|
|
569
|
-
}
|
|
570
|
-
if (finish === void 0) {
|
|
571
|
-
finish = text.length;
|
|
572
|
-
}
|
|
573
|
-
var regex = pattern.regex;
|
|
485
|
+
const find$2 = (text, pattern, start = 0, finish = text.length) => {
|
|
486
|
+
const regex = pattern.regex;
|
|
574
487
|
regex.lastIndex = start;
|
|
575
|
-
|
|
576
|
-
|
|
488
|
+
const results = [];
|
|
489
|
+
let match;
|
|
577
490
|
while (match = regex.exec(text)) {
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
491
|
+
const matchedText = match[pattern.matchIndex];
|
|
492
|
+
const matchStart = match.index + match[0].indexOf(matchedText);
|
|
493
|
+
const matchFinish = matchStart + matchedText.length;
|
|
581
494
|
if (matchFinish > finish) {
|
|
582
495
|
break;
|
|
583
496
|
}
|
|
@@ -589,15 +502,15 @@
|
|
|
589
502
|
}
|
|
590
503
|
return results;
|
|
591
504
|
};
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
505
|
+
const extract = (elements, matches) => {
|
|
506
|
+
const nodePositions = foldl(elements, (acc, element) => {
|
|
507
|
+
const content = get$1(element);
|
|
508
|
+
const start = acc.last;
|
|
509
|
+
const finish = start + content.length;
|
|
510
|
+
const positions = bind(matches, (match, matchIdx) => {
|
|
598
511
|
if (match.start < finish && match.finish > start) {
|
|
599
512
|
return [{
|
|
600
|
-
element
|
|
513
|
+
element,
|
|
601
514
|
start: Math.max(start, match.start) - start,
|
|
602
515
|
finish: Math.min(finish, match.finish) - start,
|
|
603
516
|
matchId: matchIdx
|
|
@@ -614,64 +527,56 @@
|
|
|
614
527
|
results: [],
|
|
615
528
|
last: 0
|
|
616
529
|
}).results;
|
|
617
|
-
return groupBy(nodePositions,
|
|
618
|
-
return position.matchId;
|
|
619
|
-
});
|
|
530
|
+
return groupBy(nodePositions, position => position.matchId);
|
|
620
531
|
};
|
|
621
532
|
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
eachr(match, function (pos) {
|
|
633
|
-
var wrapper = SugarElement.fromDom(replacementNode.cloneNode(false));
|
|
533
|
+
const find$1 = (pattern, sections) => bind(sections, section => {
|
|
534
|
+
const elements = section.elements;
|
|
535
|
+
const content = map(elements, get$1).join('');
|
|
536
|
+
const positions = find$2(content, pattern, section.sOffset, content.length - section.fOffset);
|
|
537
|
+
return extract(elements, positions);
|
|
538
|
+
});
|
|
539
|
+
const mark = (matches, replacementNode) => {
|
|
540
|
+
eachr(matches, (match, idx) => {
|
|
541
|
+
eachr(match, pos => {
|
|
542
|
+
const wrapper = SugarElement.fromDom(replacementNode.cloneNode(false));
|
|
634
543
|
set(wrapper, 'data-mce-index', idx);
|
|
635
|
-
|
|
544
|
+
const textNode = pos.element.dom;
|
|
636
545
|
if (textNode.length === pos.finish && pos.start === 0) {
|
|
637
546
|
wrap(pos.element, wrapper);
|
|
638
547
|
} else {
|
|
639
548
|
if (textNode.length !== pos.finish) {
|
|
640
549
|
textNode.splitText(pos.finish);
|
|
641
550
|
}
|
|
642
|
-
|
|
551
|
+
const matchNode = textNode.splitText(pos.start);
|
|
643
552
|
wrap(SugarElement.fromDom(matchNode), wrapper);
|
|
644
553
|
}
|
|
645
554
|
});
|
|
646
555
|
});
|
|
647
556
|
};
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
557
|
+
const findAndMark = (dom, pattern, node, replacementNode) => {
|
|
558
|
+
const textSections = fromNode(dom, node);
|
|
559
|
+
const matches = find$1(pattern, textSections);
|
|
651
560
|
mark(matches, replacementNode);
|
|
652
561
|
return matches.length;
|
|
653
562
|
};
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
563
|
+
const findAndMarkInSelection = (dom, pattern, selection, replacementNode) => {
|
|
564
|
+
const bookmark = selection.getBookmark();
|
|
565
|
+
const nodes = dom.select('td[data-mce-selected],th[data-mce-selected]');
|
|
566
|
+
const textSections = nodes.length > 0 ? fromNodes(dom, nodes) : fromRng(dom, selection.getRng());
|
|
567
|
+
const matches = find$1(pattern, textSections);
|
|
659
568
|
mark(matches, replacementNode);
|
|
660
569
|
selection.moveToBookmark(bookmark);
|
|
661
570
|
return matches.length;
|
|
662
571
|
};
|
|
663
572
|
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
if (typeof value === 'number') {
|
|
667
|
-
return '' + value;
|
|
668
|
-
}
|
|
669
|
-
return value;
|
|
573
|
+
const getElmIndex = elm => {
|
|
574
|
+
return elm.getAttribute('data-mce-index');
|
|
670
575
|
};
|
|
671
|
-
|
|
672
|
-
|
|
576
|
+
const markAllMatches = (editor, currentSearchState, pattern, inSelection) => {
|
|
577
|
+
const marker = editor.dom.create('span', { 'data-mce-bogus': 1 });
|
|
673
578
|
marker.className = 'mce-match-marker';
|
|
674
|
-
|
|
579
|
+
const node = editor.getBody();
|
|
675
580
|
done(editor, currentSearchState, false);
|
|
676
581
|
if (inSelection) {
|
|
677
582
|
return findAndMarkInSelection(editor.dom, pattern, editor.selection, marker);
|
|
@@ -679,19 +584,20 @@
|
|
|
679
584
|
return findAndMark(editor.dom, pattern, node, marker);
|
|
680
585
|
}
|
|
681
586
|
};
|
|
682
|
-
|
|
683
|
-
var
|
|
587
|
+
const unwrap = node => {
|
|
588
|
+
var _a;
|
|
589
|
+
const parentNode = node.parentNode;
|
|
684
590
|
if (node.firstChild) {
|
|
685
591
|
parentNode.insertBefore(node.firstChild, node);
|
|
686
592
|
}
|
|
687
|
-
node.parentNode.removeChild(node);
|
|
593
|
+
(_a = node.parentNode) === null || _a === void 0 ? void 0 : _a.removeChild(node);
|
|
688
594
|
};
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
595
|
+
const findSpansByIndex = (editor, index) => {
|
|
596
|
+
const spans = [];
|
|
597
|
+
const nodes = global$1.toArray(editor.getBody().getElementsByTagName('span'));
|
|
692
598
|
if (nodes.length) {
|
|
693
|
-
for (
|
|
694
|
-
|
|
599
|
+
for (let i = 0; i < nodes.length; i++) {
|
|
600
|
+
const nodeIndex = getElmIndex(nodes[i]);
|
|
695
601
|
if (nodeIndex === null || !nodeIndex.length) {
|
|
696
602
|
continue;
|
|
697
603
|
}
|
|
@@ -702,11 +608,10 @@
|
|
|
702
608
|
}
|
|
703
609
|
return spans;
|
|
704
610
|
};
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
forward = forward !== false;
|
|
611
|
+
const moveSelection = (editor, currentSearchState, forward) => {
|
|
612
|
+
const searchState = currentSearchState.get();
|
|
613
|
+
let testIndex = searchState.index;
|
|
614
|
+
const dom = editor.dom;
|
|
710
615
|
if (forward) {
|
|
711
616
|
if (testIndex + 1 === searchState.count) {
|
|
712
617
|
testIndex = 0;
|
|
@@ -721,7 +626,7 @@
|
|
|
721
626
|
}
|
|
722
627
|
}
|
|
723
628
|
dom.removeClass(findSpansByIndex(editor, searchState.index), 'mce-match-marker-selected');
|
|
724
|
-
|
|
629
|
+
const spans = findSpansByIndex(editor, testIndex);
|
|
725
630
|
if (spans.length) {
|
|
726
631
|
dom.addClass(findSpansByIndex(editor, testIndex), 'mce-match-marker-selected');
|
|
727
632
|
editor.selection.scrollIntoView(spans[0]);
|
|
@@ -729,63 +634,74 @@
|
|
|
729
634
|
}
|
|
730
635
|
return -1;
|
|
731
636
|
};
|
|
732
|
-
|
|
733
|
-
|
|
637
|
+
const removeNode = (dom, node) => {
|
|
638
|
+
const parent = node.parentNode;
|
|
734
639
|
dom.remove(node);
|
|
735
|
-
if (dom.isEmpty(parent)) {
|
|
640
|
+
if (parent && dom.isEmpty(parent)) {
|
|
736
641
|
dom.remove(parent);
|
|
737
642
|
}
|
|
738
643
|
};
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
return wholeWord ?
|
|
644
|
+
const escapeSearchText = (text, wholeWord) => {
|
|
645
|
+
const escapedText = text.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, '\\$&').replace(/\s/g, '[^\\S\\r\\n\\uFEFF]');
|
|
646
|
+
const wordRegex = '(' + escapedText + ')';
|
|
647
|
+
return wholeWord ? `(?:^|\\s|${ punctuation() })` + wordRegex + `(?=$|\\s|${ punctuation() })` : wordRegex;
|
|
743
648
|
};
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
649
|
+
const find = (editor, currentSearchState, text, matchCase, wholeWord, inSelection) => {
|
|
650
|
+
const selection = editor.selection;
|
|
651
|
+
const escapedText = escapeSearchText(text, wholeWord);
|
|
652
|
+
const isForwardSelection = selection.isForward();
|
|
653
|
+
const pattern = {
|
|
747
654
|
regex: new RegExp(escapedText, matchCase ? 'g' : 'gi'),
|
|
748
655
|
matchIndex: 1
|
|
749
656
|
};
|
|
750
|
-
|
|
657
|
+
const count = markAllMatches(editor, currentSearchState, pattern, inSelection);
|
|
658
|
+
if (global$2.browser.isSafari()) {
|
|
659
|
+
selection.setRng(selection.getRng(), isForwardSelection);
|
|
660
|
+
}
|
|
751
661
|
if (count) {
|
|
752
|
-
|
|
662
|
+
const newIndex = moveSelection(editor, currentSearchState, true);
|
|
753
663
|
currentSearchState.set({
|
|
754
664
|
index: newIndex,
|
|
755
|
-
count
|
|
756
|
-
text
|
|
757
|
-
matchCase
|
|
758
|
-
wholeWord
|
|
759
|
-
inSelection
|
|
665
|
+
count,
|
|
666
|
+
text,
|
|
667
|
+
matchCase,
|
|
668
|
+
wholeWord,
|
|
669
|
+
inSelection
|
|
760
670
|
});
|
|
761
671
|
}
|
|
762
672
|
return count;
|
|
763
673
|
};
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
currentSearchState.set(
|
|
674
|
+
const next = (editor, currentSearchState) => {
|
|
675
|
+
const index = moveSelection(editor, currentSearchState, true);
|
|
676
|
+
currentSearchState.set({
|
|
677
|
+
...currentSearchState.get(),
|
|
678
|
+
index
|
|
679
|
+
});
|
|
767
680
|
};
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
currentSearchState.set(
|
|
681
|
+
const prev = (editor, currentSearchState) => {
|
|
682
|
+
const index = moveSelection(editor, currentSearchState, false);
|
|
683
|
+
currentSearchState.set({
|
|
684
|
+
...currentSearchState.get(),
|
|
685
|
+
index
|
|
686
|
+
});
|
|
771
687
|
};
|
|
772
|
-
|
|
773
|
-
|
|
688
|
+
const isMatchSpan = node => {
|
|
689
|
+
const matchIndex = getElmIndex(node);
|
|
774
690
|
return matchIndex !== null && matchIndex.length > 0;
|
|
775
691
|
};
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
692
|
+
const replace = (editor, currentSearchState, text, forward, all) => {
|
|
693
|
+
const searchState = currentSearchState.get();
|
|
694
|
+
const currentIndex = searchState.index;
|
|
695
|
+
let currentMatchIndex, nextIndex = currentIndex;
|
|
780
696
|
forward = forward !== false;
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
for (
|
|
784
|
-
|
|
785
|
-
|
|
697
|
+
const node = editor.getBody();
|
|
698
|
+
const nodes = global$1.grep(global$1.toArray(node.getElementsByTagName('span')), isMatchSpan);
|
|
699
|
+
for (let i = 0; i < nodes.length; i++) {
|
|
700
|
+
const nodeIndex = getElmIndex(nodes[i]);
|
|
701
|
+
let matchIndex = currentMatchIndex = parseInt(nodeIndex, 10);
|
|
786
702
|
if (all || matchIndex === searchState.index) {
|
|
787
703
|
if (text.length) {
|
|
788
|
-
nodes[i].
|
|
704
|
+
nodes[i].innerText = text;
|
|
789
705
|
unwrap(nodes[i]);
|
|
790
706
|
} else {
|
|
791
707
|
removeNode(editor.dom, nodes[i]);
|
|
@@ -806,10 +722,11 @@
|
|
|
806
722
|
nodes[i].setAttribute('data-mce-index', String(currentMatchIndex - 1));
|
|
807
723
|
}
|
|
808
724
|
}
|
|
809
|
-
currentSearchState.set(
|
|
725
|
+
currentSearchState.set({
|
|
726
|
+
...searchState,
|
|
810
727
|
count: all ? 0 : searchState.count - 1,
|
|
811
728
|
index: nextIndex
|
|
812
|
-
})
|
|
729
|
+
});
|
|
813
730
|
if (forward) {
|
|
814
731
|
next(editor, currentSearchState);
|
|
815
732
|
} else {
|
|
@@ -817,12 +734,13 @@
|
|
|
817
734
|
}
|
|
818
735
|
return !all && currentSearchState.get().count > 0;
|
|
819
736
|
};
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
737
|
+
const done = (editor, currentSearchState, keepEditorSelection) => {
|
|
738
|
+
let startContainer;
|
|
739
|
+
let endContainer;
|
|
740
|
+
const searchState = currentSearchState.get();
|
|
741
|
+
const nodes = global$1.toArray(editor.getBody().getElementsByTagName('span'));
|
|
742
|
+
for (let i = 0; i < nodes.length; i++) {
|
|
743
|
+
const nodeIndex = getElmIndex(nodes[i]);
|
|
826
744
|
if (nodeIndex !== null && nodeIndex.length) {
|
|
827
745
|
if (nodeIndex === searchState.index.toString()) {
|
|
828
746
|
if (!startContainer) {
|
|
@@ -833,127 +751,125 @@
|
|
|
833
751
|
unwrap(nodes[i]);
|
|
834
752
|
}
|
|
835
753
|
}
|
|
836
|
-
currentSearchState.set(
|
|
754
|
+
currentSearchState.set({
|
|
755
|
+
...searchState,
|
|
837
756
|
index: -1,
|
|
838
757
|
count: 0,
|
|
839
758
|
text: ''
|
|
840
|
-
})
|
|
759
|
+
});
|
|
841
760
|
if (startContainer && endContainer) {
|
|
842
|
-
|
|
761
|
+
const rng = editor.dom.createRng();
|
|
843
762
|
rng.setStart(startContainer, 0);
|
|
844
763
|
rng.setEnd(endContainer, endContainer.data.length);
|
|
845
764
|
if (keepEditorSelection !== false) {
|
|
846
765
|
editor.selection.setRng(rng);
|
|
847
766
|
}
|
|
848
767
|
return rng;
|
|
768
|
+
} else {
|
|
769
|
+
return undefined;
|
|
849
770
|
}
|
|
850
771
|
};
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
};
|
|
854
|
-
var hasPrev = function (editor, currentSearchState) {
|
|
855
|
-
return currentSearchState.get().count > 1;
|
|
856
|
-
};
|
|
772
|
+
const hasNext = (editor, currentSearchState) => currentSearchState.get().count > 1;
|
|
773
|
+
const hasPrev = (editor, currentSearchState) => currentSearchState.get().count > 1;
|
|
857
774
|
|
|
858
|
-
|
|
859
|
-
|
|
775
|
+
const get = (editor, currentState) => {
|
|
776
|
+
const done$1 = keepEditorSelection => {
|
|
860
777
|
return done(editor, currentState, keepEditorSelection);
|
|
861
778
|
};
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
inSelection = false;
|
|
865
|
-
}
|
|
866
|
-
return find$2(editor, currentState, text, matchCase, wholeWord, inSelection);
|
|
779
|
+
const find$1 = (text, matchCase, wholeWord, inSelection = false) => {
|
|
780
|
+
return find(editor, currentState, text, matchCase, wholeWord, inSelection);
|
|
867
781
|
};
|
|
868
|
-
|
|
782
|
+
const next$1 = () => {
|
|
869
783
|
return next(editor, currentState);
|
|
870
784
|
};
|
|
871
|
-
|
|
785
|
+
const prev$1 = () => {
|
|
872
786
|
return prev(editor, currentState);
|
|
873
787
|
};
|
|
874
|
-
|
|
788
|
+
const replace$1 = (text, forward, all) => {
|
|
875
789
|
return replace(editor, currentState, text, forward, all);
|
|
876
790
|
};
|
|
877
791
|
return {
|
|
878
792
|
done: done$1,
|
|
879
|
-
find: find,
|
|
793
|
+
find: find$1,
|
|
880
794
|
next: next$1,
|
|
881
795
|
prev: prev$1,
|
|
882
796
|
replace: replace$1
|
|
883
797
|
};
|
|
884
798
|
};
|
|
885
799
|
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
return subject.set(Optional.some(s));
|
|
800
|
+
const singleton = doRevoke => {
|
|
801
|
+
const subject = Cell(Optional.none());
|
|
802
|
+
const revoke = () => subject.get().each(doRevoke);
|
|
803
|
+
const clear = () => {
|
|
804
|
+
revoke();
|
|
805
|
+
subject.set(Optional.none());
|
|
893
806
|
};
|
|
894
|
-
|
|
895
|
-
|
|
807
|
+
const isSet = () => subject.get().isSome();
|
|
808
|
+
const get = () => subject.get();
|
|
809
|
+
const set = s => {
|
|
810
|
+
revoke();
|
|
811
|
+
subject.set(Optional.some(s));
|
|
896
812
|
};
|
|
897
|
-
|
|
898
|
-
|
|
813
|
+
return {
|
|
814
|
+
clear,
|
|
815
|
+
isSet,
|
|
816
|
+
get,
|
|
817
|
+
set
|
|
899
818
|
};
|
|
819
|
+
};
|
|
820
|
+
const value = () => {
|
|
821
|
+
const subject = singleton(noop);
|
|
822
|
+
const on = f => subject.get().each(f);
|
|
900
823
|
return {
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
isSet: isSet,
|
|
904
|
-
on: on
|
|
824
|
+
...subject,
|
|
825
|
+
on
|
|
905
826
|
};
|
|
906
827
|
};
|
|
907
828
|
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
var open = function (editor, currentSearchState) {
|
|
911
|
-
var dialogApi = value();
|
|
829
|
+
const open = (editor, currentSearchState) => {
|
|
830
|
+
const dialogApi = value();
|
|
912
831
|
editor.undoManager.add();
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
var updatePrev = hasPrev(editor, currentSearchState) ? api.enable : api.disable;
|
|
918
|
-
updatePrev('prev');
|
|
832
|
+
const selectedText = global$1.trim(editor.selection.getContent({ format: 'text' }));
|
|
833
|
+
const updateButtonStates = api => {
|
|
834
|
+
api.setEnabled('next', hasNext(editor, currentSearchState));
|
|
835
|
+
api.setEnabled('prev', hasPrev(editor, currentSearchState));
|
|
919
836
|
};
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
currentSearchState.set(
|
|
837
|
+
const updateSearchState = api => {
|
|
838
|
+
const data = api.getData();
|
|
839
|
+
const current = currentSearchState.get();
|
|
840
|
+
currentSearchState.set({
|
|
841
|
+
...current,
|
|
924
842
|
matchCase: data.matchcase,
|
|
925
843
|
wholeWord: data.wholewords,
|
|
926
844
|
inSelection: data.inselection
|
|
927
|
-
})
|
|
845
|
+
});
|
|
928
846
|
};
|
|
929
|
-
|
|
930
|
-
|
|
847
|
+
const disableAll = (api, disable) => {
|
|
848
|
+
const buttons = [
|
|
931
849
|
'replace',
|
|
932
850
|
'replaceall',
|
|
933
851
|
'prev',
|
|
934
852
|
'next'
|
|
935
853
|
];
|
|
936
|
-
|
|
854
|
+
const toggle = name => api.setEnabled(name, !disable);
|
|
937
855
|
each(buttons, toggle);
|
|
938
856
|
};
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
api.focus('findtext');
|
|
942
|
-
});
|
|
857
|
+
const toggleNotFoundAlert = (isVisible, api) => {
|
|
858
|
+
api.redial(getDialogSpec(isVisible, api.getData()));
|
|
943
859
|
};
|
|
944
|
-
|
|
945
|
-
if (global$
|
|
860
|
+
const focusButtonIfRequired = (api, name) => {
|
|
861
|
+
if (global$2.browser.isSafari() && global$2.deviceType.isTouch() && (name === 'find' || name === 'replace' || name === 'replaceall')) {
|
|
946
862
|
api.focus(name);
|
|
947
863
|
}
|
|
948
864
|
};
|
|
949
|
-
|
|
865
|
+
const reset = api => {
|
|
950
866
|
done(editor, currentSearchState, false);
|
|
951
867
|
disableAll(api, true);
|
|
952
868
|
updateButtonStates(api);
|
|
953
869
|
};
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
870
|
+
const doFind = api => {
|
|
871
|
+
const data = api.getData();
|
|
872
|
+
const last = currentSearchState.get();
|
|
957
873
|
if (!data.findtext.length) {
|
|
958
874
|
reset(api);
|
|
959
875
|
return;
|
|
@@ -961,63 +877,75 @@
|
|
|
961
877
|
if (last.text === data.findtext && last.matchCase === data.matchcase && last.wholeWord === data.wholewords) {
|
|
962
878
|
next(editor, currentSearchState);
|
|
963
879
|
} else {
|
|
964
|
-
|
|
880
|
+
const count = find(editor, currentSearchState, data.findtext, data.matchcase, data.wholewords, data.inselection);
|
|
965
881
|
if (count <= 0) {
|
|
966
|
-
|
|
882
|
+
toggleNotFoundAlert(true, api);
|
|
967
883
|
}
|
|
968
884
|
disableAll(api, count === 0);
|
|
969
885
|
}
|
|
970
886
|
updateButtonStates(api);
|
|
971
887
|
};
|
|
972
|
-
|
|
973
|
-
|
|
888
|
+
const initialState = currentSearchState.get();
|
|
889
|
+
const initialData = {
|
|
974
890
|
findtext: selectedText,
|
|
975
891
|
replacetext: '',
|
|
976
892
|
wholewords: initialState.wholeWord,
|
|
977
893
|
matchcase: initialState.matchCase,
|
|
978
894
|
inselection: initialState.inSelection
|
|
979
895
|
};
|
|
980
|
-
|
|
896
|
+
const getPanelItems = error => {
|
|
897
|
+
const items = [
|
|
898
|
+
{
|
|
899
|
+
type: 'bar',
|
|
900
|
+
items: [
|
|
901
|
+
{
|
|
902
|
+
type: 'input',
|
|
903
|
+
name: 'findtext',
|
|
904
|
+
placeholder: 'Find',
|
|
905
|
+
maximized: true,
|
|
906
|
+
inputMode: 'search'
|
|
907
|
+
},
|
|
908
|
+
{
|
|
909
|
+
type: 'button',
|
|
910
|
+
name: 'prev',
|
|
911
|
+
text: 'Previous',
|
|
912
|
+
icon: 'action-prev',
|
|
913
|
+
enabled: false,
|
|
914
|
+
borderless: true
|
|
915
|
+
},
|
|
916
|
+
{
|
|
917
|
+
type: 'button',
|
|
918
|
+
name: 'next',
|
|
919
|
+
text: 'Next',
|
|
920
|
+
icon: 'action-next',
|
|
921
|
+
enabled: false,
|
|
922
|
+
borderless: true
|
|
923
|
+
}
|
|
924
|
+
]
|
|
925
|
+
},
|
|
926
|
+
{
|
|
927
|
+
type: 'input',
|
|
928
|
+
name: 'replacetext',
|
|
929
|
+
placeholder: 'Replace with',
|
|
930
|
+
inputMode: 'search'
|
|
931
|
+
}
|
|
932
|
+
];
|
|
933
|
+
if (error) {
|
|
934
|
+
items.push({
|
|
935
|
+
type: 'alertbanner',
|
|
936
|
+
level: 'error',
|
|
937
|
+
text: 'Could not find the specified string.',
|
|
938
|
+
icon: 'warning'
|
|
939
|
+
});
|
|
940
|
+
}
|
|
941
|
+
return items;
|
|
942
|
+
};
|
|
943
|
+
const getDialogSpec = (showNoMatchesAlertBanner, initialData) => ({
|
|
981
944
|
title: 'Find and Replace',
|
|
982
945
|
size: 'normal',
|
|
983
946
|
body: {
|
|
984
947
|
type: 'panel',
|
|
985
|
-
items:
|
|
986
|
-
{
|
|
987
|
-
type: 'bar',
|
|
988
|
-
items: [
|
|
989
|
-
{
|
|
990
|
-
type: 'input',
|
|
991
|
-
name: 'findtext',
|
|
992
|
-
placeholder: 'Find',
|
|
993
|
-
maximized: true,
|
|
994
|
-
inputMode: 'search'
|
|
995
|
-
},
|
|
996
|
-
{
|
|
997
|
-
type: 'button',
|
|
998
|
-
name: 'prev',
|
|
999
|
-
text: 'Previous',
|
|
1000
|
-
icon: 'action-prev',
|
|
1001
|
-
disabled: true,
|
|
1002
|
-
borderless: true
|
|
1003
|
-
},
|
|
1004
|
-
{
|
|
1005
|
-
type: 'button',
|
|
1006
|
-
name: 'next',
|
|
1007
|
-
text: 'Next',
|
|
1008
|
-
icon: 'action-next',
|
|
1009
|
-
disabled: true,
|
|
1010
|
-
borderless: true
|
|
1011
|
-
}
|
|
1012
|
-
]
|
|
1013
|
-
},
|
|
1014
|
-
{
|
|
1015
|
-
type: 'input',
|
|
1016
|
-
name: 'replacetext',
|
|
1017
|
-
placeholder: 'Replace with',
|
|
1018
|
-
inputMode: 'search'
|
|
1019
|
-
}
|
|
1020
|
-
]
|
|
948
|
+
items: getPanelItems(showNoMatchesAlertBanner)
|
|
1021
949
|
},
|
|
1022
950
|
buttons: [
|
|
1023
951
|
{
|
|
@@ -1054,23 +982,26 @@
|
|
|
1054
982
|
type: 'custom',
|
|
1055
983
|
name: 'replace',
|
|
1056
984
|
text: 'Replace',
|
|
1057
|
-
|
|
985
|
+
enabled: false
|
|
1058
986
|
},
|
|
1059
987
|
{
|
|
1060
988
|
type: 'custom',
|
|
1061
989
|
name: 'replaceall',
|
|
1062
990
|
text: 'Replace all',
|
|
1063
|
-
|
|
991
|
+
enabled: false
|
|
1064
992
|
}
|
|
1065
993
|
],
|
|
1066
|
-
initialData
|
|
1067
|
-
onChange:
|
|
994
|
+
initialData,
|
|
995
|
+
onChange: (api, details) => {
|
|
996
|
+
if (showNoMatchesAlertBanner) {
|
|
997
|
+
toggleNotFoundAlert(false, api);
|
|
998
|
+
}
|
|
1068
999
|
if (details.name === 'findtext' && currentSearchState.get().count > 0) {
|
|
1069
1000
|
reset(api);
|
|
1070
1001
|
}
|
|
1071
1002
|
},
|
|
1072
|
-
onAction:
|
|
1073
|
-
|
|
1003
|
+
onAction: (api, details) => {
|
|
1004
|
+
const data = api.getData();
|
|
1074
1005
|
switch (details.name) {
|
|
1075
1006
|
case 'find':
|
|
1076
1007
|
doFind(api);
|
|
@@ -1097,37 +1028,36 @@
|
|
|
1097
1028
|
case 'matchcase':
|
|
1098
1029
|
case 'wholewords':
|
|
1099
1030
|
case 'inselection':
|
|
1031
|
+
toggleNotFoundAlert(false, api);
|
|
1100
1032
|
updateSearchState(api);
|
|
1101
1033
|
reset(api);
|
|
1102
1034
|
break;
|
|
1103
1035
|
}
|
|
1104
1036
|
focusButtonIfRequired(api, details.name);
|
|
1105
1037
|
},
|
|
1106
|
-
onSubmit:
|
|
1038
|
+
onSubmit: api => {
|
|
1107
1039
|
doFind(api);
|
|
1108
1040
|
focusButtonIfRequired(api, 'find');
|
|
1109
1041
|
},
|
|
1110
|
-
onClose:
|
|
1042
|
+
onClose: () => {
|
|
1111
1043
|
editor.focus();
|
|
1112
1044
|
done(editor, currentSearchState);
|
|
1113
1045
|
editor.undoManager.add();
|
|
1114
1046
|
}
|
|
1115
|
-
};
|
|
1116
|
-
dialogApi.set(editor.windowManager.open(
|
|
1047
|
+
});
|
|
1048
|
+
dialogApi.set(editor.windowManager.open(getDialogSpec(false, initialData), { inline: 'toolbar' }));
|
|
1117
1049
|
};
|
|
1118
1050
|
|
|
1119
|
-
|
|
1120
|
-
editor.addCommand('SearchReplace',
|
|
1051
|
+
const register$1 = (editor, currentSearchState) => {
|
|
1052
|
+
editor.addCommand('SearchReplace', () => {
|
|
1121
1053
|
open(editor, currentSearchState);
|
|
1122
1054
|
});
|
|
1123
1055
|
};
|
|
1124
1056
|
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
open(editor, currentSearchState);
|
|
1128
|
-
};
|
|
1057
|
+
const showDialog = (editor, currentSearchState) => () => {
|
|
1058
|
+
open(editor, currentSearchState);
|
|
1129
1059
|
};
|
|
1130
|
-
|
|
1060
|
+
const register = (editor, currentSearchState) => {
|
|
1131
1061
|
editor.ui.registry.addMenuItem('searchreplace', {
|
|
1132
1062
|
text: 'Find and replace...',
|
|
1133
1063
|
shortcut: 'Meta+F',
|
|
@@ -1142,9 +1072,9 @@
|
|
|
1142
1072
|
editor.shortcuts.add('Meta+F', '', showDialog(editor, currentSearchState));
|
|
1143
1073
|
};
|
|
1144
1074
|
|
|
1145
|
-
|
|
1146
|
-
global.add('searchreplace',
|
|
1147
|
-
|
|
1075
|
+
var Plugin = () => {
|
|
1076
|
+
global$3.add('searchreplace', editor => {
|
|
1077
|
+
const currentSearchState = Cell({
|
|
1148
1078
|
index: -1,
|
|
1149
1079
|
count: 0,
|
|
1150
1080
|
text: '',
|
|
@@ -1152,12 +1082,12 @@
|
|
|
1152
1082
|
wholeWord: false,
|
|
1153
1083
|
inSelection: false
|
|
1154
1084
|
});
|
|
1155
|
-
register(editor, currentSearchState);
|
|
1156
1085
|
register$1(editor, currentSearchState);
|
|
1157
|
-
|
|
1086
|
+
register(editor, currentSearchState);
|
|
1087
|
+
return get(editor, currentSearchState);
|
|
1158
1088
|
});
|
|
1159
|
-
}
|
|
1089
|
+
};
|
|
1160
1090
|
|
|
1161
1091
|
Plugin();
|
|
1162
1092
|
|
|
1163
|
-
}()
|
|
1093
|
+
})();
|