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,182 +1,142 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
* Licensed under the LGPL or a commercial license.
|
|
4
|
-
* For LGPL see License.txt in the project root for license information.
|
|
5
|
-
* For commercial licenses see https://www.tiny.cloud/
|
|
6
|
-
*
|
|
7
|
-
* Version: 5.9.0 (TBD)
|
|
2
|
+
* TinyMCE version 6.8.2 (2023-12-11)
|
|
8
3
|
*/
|
|
4
|
+
|
|
9
5
|
(function () {
|
|
10
6
|
'use strict';
|
|
11
7
|
|
|
12
|
-
var global = tinymce.util.Tools.resolve('tinymce.PluginManager');
|
|
8
|
+
var global$6 = tinymce.util.Tools.resolve('tinymce.PluginManager');
|
|
13
9
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
}
|
|
22
|
-
return t;
|
|
23
|
-
};
|
|
24
|
-
return __assign.apply(this, arguments);
|
|
10
|
+
const 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
|
+
}
|
|
25
17
|
};
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
var t = typeof x;
|
|
18
|
+
const typeOf = x => {
|
|
19
|
+
const t = typeof x;
|
|
29
20
|
if (x === null) {
|
|
30
21
|
return 'null';
|
|
31
|
-
} else if (t === 'object' &&
|
|
22
|
+
} else if (t === 'object' && Array.isArray(x)) {
|
|
32
23
|
return 'array';
|
|
33
|
-
} else if (t === 'object' && (String
|
|
24
|
+
} else if (t === 'object' && hasProto(x, String, (o, proto) => proto.isPrototypeOf(o))) {
|
|
34
25
|
return 'string';
|
|
35
26
|
} else {
|
|
36
27
|
return t;
|
|
37
28
|
}
|
|
38
29
|
};
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
var isObject = isType('object');
|
|
46
|
-
var isArray = isType('array');
|
|
47
|
-
var isNullable = function (a) {
|
|
48
|
-
return a === null || a === undefined;
|
|
49
|
-
};
|
|
50
|
-
var isNonNullable = function (a) {
|
|
51
|
-
return !isNullable(a);
|
|
52
|
-
};
|
|
30
|
+
const isType = type => value => typeOf(value) === type;
|
|
31
|
+
const isString = isType('string');
|
|
32
|
+
const isObject = isType('object');
|
|
33
|
+
const isArray = isType('array');
|
|
34
|
+
const isNullable = a => a === null || a === undefined;
|
|
35
|
+
const isNonNullable = a => !isNullable(a);
|
|
53
36
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
};
|
|
71
|
-
var call = function (thunk) {
|
|
72
|
-
return thunk();
|
|
73
|
-
};
|
|
74
|
-
var id = function (n) {
|
|
75
|
-
return n;
|
|
76
|
-
};
|
|
77
|
-
var me = {
|
|
78
|
-
fold: function (n, _s) {
|
|
79
|
-
return n();
|
|
80
|
-
},
|
|
81
|
-
is: never,
|
|
82
|
-
isSome: never,
|
|
83
|
-
isNone: always,
|
|
84
|
-
getOr: id,
|
|
85
|
-
getOrThunk: call,
|
|
86
|
-
getOrDie: function (msg) {
|
|
87
|
-
throw new Error(msg || 'error: getOrDie called on none.');
|
|
88
|
-
},
|
|
89
|
-
getOrNull: constant(null),
|
|
90
|
-
getOrUndefined: constant(undefined),
|
|
91
|
-
or: id,
|
|
92
|
-
orThunk: call,
|
|
93
|
-
map: none,
|
|
94
|
-
each: noop,
|
|
95
|
-
bind: none,
|
|
96
|
-
exists: never,
|
|
97
|
-
forall: always,
|
|
98
|
-
filter: none,
|
|
99
|
-
equals: eq,
|
|
100
|
-
equals_: eq,
|
|
101
|
-
toArray: function () {
|
|
102
|
-
return [];
|
|
103
|
-
},
|
|
104
|
-
toString: constant('none()')
|
|
105
|
-
};
|
|
106
|
-
return me;
|
|
107
|
-
}();
|
|
108
|
-
var some = function (a) {
|
|
109
|
-
var constant_a = constant(a);
|
|
110
|
-
var self = function () {
|
|
111
|
-
return me;
|
|
112
|
-
};
|
|
113
|
-
var bind = function (f) {
|
|
114
|
-
return f(a);
|
|
115
|
-
};
|
|
116
|
-
var me = {
|
|
117
|
-
fold: function (n, s) {
|
|
118
|
-
return s(a);
|
|
119
|
-
},
|
|
120
|
-
is: function (v) {
|
|
121
|
-
return a === v;
|
|
122
|
-
},
|
|
123
|
-
isSome: always,
|
|
124
|
-
isNone: never,
|
|
125
|
-
getOr: constant_a,
|
|
126
|
-
getOrThunk: constant_a,
|
|
127
|
-
getOrDie: constant_a,
|
|
128
|
-
getOrNull: constant_a,
|
|
129
|
-
getOrUndefined: constant_a,
|
|
130
|
-
or: self,
|
|
131
|
-
orThunk: self,
|
|
132
|
-
map: function (f) {
|
|
133
|
-
return some(f(a));
|
|
134
|
-
},
|
|
135
|
-
each: function (f) {
|
|
136
|
-
f(a);
|
|
137
|
-
},
|
|
138
|
-
bind: bind,
|
|
139
|
-
exists: bind,
|
|
140
|
-
forall: bind,
|
|
141
|
-
filter: function (f) {
|
|
142
|
-
return f(a) ? me : NONE;
|
|
143
|
-
},
|
|
144
|
-
toArray: function () {
|
|
145
|
-
return [a];
|
|
146
|
-
},
|
|
147
|
-
toString: function () {
|
|
148
|
-
return 'some(' + a + ')';
|
|
149
|
-
},
|
|
150
|
-
equals: function (o) {
|
|
151
|
-
return o.is(a);
|
|
152
|
-
},
|
|
153
|
-
equals_: function (o, elementEq) {
|
|
154
|
-
return o.fold(never, function (b) {
|
|
155
|
-
return elementEq(a, b);
|
|
156
|
-
});
|
|
37
|
+
class Optional {
|
|
38
|
+
constructor(tag, value) {
|
|
39
|
+
this.tag = tag;
|
|
40
|
+
this.value = value;
|
|
41
|
+
}
|
|
42
|
+
static some(value) {
|
|
43
|
+
return new Optional(true, value);
|
|
44
|
+
}
|
|
45
|
+
static none() {
|
|
46
|
+
return Optional.singletonNone;
|
|
47
|
+
}
|
|
48
|
+
fold(onNone, onSome) {
|
|
49
|
+
if (this.tag) {
|
|
50
|
+
return onSome(this.value);
|
|
51
|
+
} else {
|
|
52
|
+
return onNone();
|
|
157
53
|
}
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
54
|
+
}
|
|
55
|
+
isSome() {
|
|
56
|
+
return this.tag;
|
|
57
|
+
}
|
|
58
|
+
isNone() {
|
|
59
|
+
return !this.tag;
|
|
60
|
+
}
|
|
61
|
+
map(mapper) {
|
|
62
|
+
if (this.tag) {
|
|
63
|
+
return Optional.some(mapper(this.value));
|
|
64
|
+
} else {
|
|
65
|
+
return Optional.none();
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
bind(binder) {
|
|
69
|
+
if (this.tag) {
|
|
70
|
+
return binder(this.value);
|
|
71
|
+
} else {
|
|
72
|
+
return Optional.none();
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
exists(predicate) {
|
|
76
|
+
return this.tag && predicate(this.value);
|
|
77
|
+
}
|
|
78
|
+
forall(predicate) {
|
|
79
|
+
return !this.tag || predicate(this.value);
|
|
80
|
+
}
|
|
81
|
+
filter(predicate) {
|
|
82
|
+
if (!this.tag || predicate(this.value)) {
|
|
83
|
+
return this;
|
|
84
|
+
} else {
|
|
85
|
+
return Optional.none();
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
getOr(replacement) {
|
|
89
|
+
return this.tag ? this.value : replacement;
|
|
90
|
+
}
|
|
91
|
+
or(replacement) {
|
|
92
|
+
return this.tag ? this : replacement;
|
|
93
|
+
}
|
|
94
|
+
getOrThunk(thunk) {
|
|
95
|
+
return this.tag ? this.value : thunk();
|
|
96
|
+
}
|
|
97
|
+
orThunk(thunk) {
|
|
98
|
+
return this.tag ? this : thunk();
|
|
99
|
+
}
|
|
100
|
+
getOrDie(message) {
|
|
101
|
+
if (!this.tag) {
|
|
102
|
+
throw new Error(message !== null && message !== void 0 ? message : 'Called getOrDie on None');
|
|
103
|
+
} else {
|
|
104
|
+
return this.value;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
static from(value) {
|
|
108
|
+
return isNonNullable(value) ? Optional.some(value) : Optional.none();
|
|
109
|
+
}
|
|
110
|
+
getOrNull() {
|
|
111
|
+
return this.tag ? this.value : null;
|
|
112
|
+
}
|
|
113
|
+
getOrUndefined() {
|
|
114
|
+
return this.value;
|
|
115
|
+
}
|
|
116
|
+
each(worker) {
|
|
117
|
+
if (this.tag) {
|
|
118
|
+
worker(this.value);
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
toArray() {
|
|
122
|
+
return this.tag ? [this.value] : [];
|
|
123
|
+
}
|
|
124
|
+
toString() {
|
|
125
|
+
return this.tag ? `some(${ this.value })` : 'none()';
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
Optional.singletonNone = new Optional(false);
|
|
169
129
|
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
for (
|
|
173
|
-
|
|
130
|
+
const nativePush = Array.prototype.push;
|
|
131
|
+
const each$1 = (xs, f) => {
|
|
132
|
+
for (let i = 0, len = xs.length; i < len; i++) {
|
|
133
|
+
const x = xs[i];
|
|
174
134
|
f(x, i);
|
|
175
135
|
}
|
|
176
136
|
};
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
for (
|
|
137
|
+
const flatten = xs => {
|
|
138
|
+
const r = [];
|
|
139
|
+
for (let i = 0, len = xs.length; i < len; ++i) {
|
|
180
140
|
if (!isArray(xs[i])) {
|
|
181
141
|
throw new Error('Arr.flatten item ' + i + ' was not an array, input: ' + xs);
|
|
182
142
|
}
|
|
@@ -185,150 +145,138 @@
|
|
|
185
145
|
return r;
|
|
186
146
|
};
|
|
187
147
|
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
148
|
+
const Cell = initial => {
|
|
149
|
+
let value = initial;
|
|
150
|
+
const get = () => {
|
|
191
151
|
return value;
|
|
192
152
|
};
|
|
193
|
-
|
|
153
|
+
const set = v => {
|
|
194
154
|
value = v;
|
|
195
155
|
};
|
|
196
156
|
return {
|
|
197
|
-
get
|
|
198
|
-
set
|
|
157
|
+
get,
|
|
158
|
+
set
|
|
199
159
|
};
|
|
200
160
|
};
|
|
201
161
|
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
for (
|
|
207
|
-
|
|
208
|
-
|
|
162
|
+
const keys = Object.keys;
|
|
163
|
+
const hasOwnProperty = Object.hasOwnProperty;
|
|
164
|
+
const each = (obj, f) => {
|
|
165
|
+
const props = keys(obj);
|
|
166
|
+
for (let k = 0, len = props.length; k < len; k++) {
|
|
167
|
+
const i = props[k];
|
|
168
|
+
const x = obj[i];
|
|
209
169
|
f(x, i);
|
|
210
170
|
}
|
|
211
171
|
};
|
|
212
|
-
|
|
172
|
+
const get$1 = (obj, key) => {
|
|
213
173
|
return has(obj, key) ? Optional.from(obj[key]) : Optional.none();
|
|
214
174
|
};
|
|
215
|
-
|
|
216
|
-
return hasOwnProperty.call(obj, key);
|
|
217
|
-
};
|
|
175
|
+
const has = (obj, key) => hasOwnProperty.call(obj, key);
|
|
218
176
|
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
177
|
+
const option = name => editor => editor.options.get(name);
|
|
178
|
+
const register$2 = editor => {
|
|
179
|
+
const registerOption = editor.options.register;
|
|
180
|
+
registerOption('audio_template_callback', { processor: 'function' });
|
|
181
|
+
registerOption('video_template_callback', { processor: 'function' });
|
|
182
|
+
registerOption('iframe_template_callback', { processor: 'function' });
|
|
183
|
+
registerOption('media_live_embeds', {
|
|
184
|
+
processor: 'boolean',
|
|
185
|
+
default: true
|
|
186
|
+
});
|
|
187
|
+
registerOption('media_filter_html', {
|
|
188
|
+
processor: 'boolean',
|
|
189
|
+
default: true
|
|
190
|
+
});
|
|
191
|
+
registerOption('media_url_resolver', { processor: 'function' });
|
|
192
|
+
registerOption('media_alt_source', {
|
|
193
|
+
processor: 'boolean',
|
|
194
|
+
default: true
|
|
195
|
+
});
|
|
196
|
+
registerOption('media_poster', {
|
|
197
|
+
processor: 'boolean',
|
|
198
|
+
default: true
|
|
199
|
+
});
|
|
200
|
+
registerOption('media_dimensions', {
|
|
201
|
+
processor: 'boolean',
|
|
202
|
+
default: true
|
|
203
|
+
});
|
|
245
204
|
};
|
|
205
|
+
const getAudioTemplateCallback = option('audio_template_callback');
|
|
206
|
+
const getVideoTemplateCallback = option('video_template_callback');
|
|
207
|
+
const getIframeTemplateCallback = option('iframe_template_callback');
|
|
208
|
+
const hasLiveEmbeds = option('media_live_embeds');
|
|
209
|
+
const shouldFilterHtml = option('media_filter_html');
|
|
210
|
+
const getUrlResolver = option('media_url_resolver');
|
|
211
|
+
const hasAltSource = option('media_alt_source');
|
|
212
|
+
const hasPoster = option('media_poster');
|
|
213
|
+
const hasDimensions = option('media_dimensions');
|
|
246
214
|
|
|
247
|
-
var global$
|
|
215
|
+
var global$5 = tinymce.util.Tools.resolve('tinymce.util.Tools');
|
|
248
216
|
|
|
249
|
-
var global$
|
|
217
|
+
var global$4 = tinymce.util.Tools.resolve('tinymce.dom.DOMUtils');
|
|
250
218
|
|
|
251
|
-
var global$3 = tinymce.util.Tools.resolve('tinymce.html.
|
|
219
|
+
var global$3 = tinymce.util.Tools.resolve('tinymce.html.DomParser');
|
|
252
220
|
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
}
|
|
259
|
-
}
|
|
260
|
-
}
|
|
261
|
-
};
|
|
262
|
-
|
|
263
|
-
var DOM = global$2.DOM;
|
|
264
|
-
var trimPx = function (value) {
|
|
265
|
-
return value.replace(/px$/, '');
|
|
266
|
-
};
|
|
267
|
-
var getEphoxEmbedData = function (attrs) {
|
|
268
|
-
var style = attrs.map.style;
|
|
269
|
-
var styles = style ? DOM.parseStyle(style) : {};
|
|
221
|
+
const DOM$1 = global$4.DOM;
|
|
222
|
+
const trimPx = value => value.replace(/px$/, '');
|
|
223
|
+
const getEphoxEmbedData = node => {
|
|
224
|
+
const style = node.attr('style');
|
|
225
|
+
const styles = style ? DOM$1.parseStyle(style) : {};
|
|
270
226
|
return {
|
|
271
227
|
type: 'ephox-embed-iri',
|
|
272
|
-
source:
|
|
228
|
+
source: node.attr('data-ephox-embed-iri'),
|
|
273
229
|
altsource: '',
|
|
274
230
|
poster: '',
|
|
275
|
-
width: get(styles, 'max-width').map(trimPx).getOr(''),
|
|
276
|
-
height: get(styles, 'max-height').map(trimPx).getOr('')
|
|
231
|
+
width: get$1(styles, 'max-width').map(trimPx).getOr(''),
|
|
232
|
+
height: get$1(styles, 'max-height').map(trimPx).getOr('')
|
|
277
233
|
};
|
|
278
234
|
};
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
global$3({
|
|
235
|
+
const htmlToData = (html, schema) => {
|
|
236
|
+
let data = {};
|
|
237
|
+
const parser = global$3({
|
|
283
238
|
validate: false,
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
239
|
+
forced_root_block: false
|
|
240
|
+
}, schema);
|
|
241
|
+
const rootNode = parser.parse(html);
|
|
242
|
+
for (let node = rootNode; node; node = node.walk()) {
|
|
243
|
+
if (node.type === 1) {
|
|
244
|
+
const name = node.name;
|
|
245
|
+
if (node.attr('data-ephox-embed-iri')) {
|
|
246
|
+
data = getEphoxEmbedData(node);
|
|
247
|
+
break;
|
|
289
248
|
} else {
|
|
290
249
|
if (!data.source && name === 'param') {
|
|
291
|
-
data.source =
|
|
250
|
+
data.source = node.attr('movie');
|
|
292
251
|
}
|
|
293
252
|
if (name === 'iframe' || name === 'object' || name === 'embed' || name === 'video' || name === 'audio') {
|
|
294
253
|
if (!data.type) {
|
|
295
254
|
data.type = name;
|
|
296
255
|
}
|
|
297
|
-
data = global$
|
|
298
|
-
}
|
|
299
|
-
if (name === 'script') {
|
|
300
|
-
var videoScript = getVideoScriptMatch(prefixes, attrs.map.src);
|
|
301
|
-
if (!videoScript) {
|
|
302
|
-
return;
|
|
303
|
-
}
|
|
304
|
-
data = {
|
|
305
|
-
type: 'script',
|
|
306
|
-
source: attrs.map.src,
|
|
307
|
-
width: String(videoScript.width),
|
|
308
|
-
height: String(videoScript.height)
|
|
309
|
-
};
|
|
256
|
+
data = global$5.extend(node.attributes.map, data);
|
|
310
257
|
}
|
|
311
258
|
if (name === 'source') {
|
|
312
259
|
if (!data.source) {
|
|
313
|
-
data.source =
|
|
260
|
+
data.source = node.attr('src');
|
|
314
261
|
} else if (!data.altsource) {
|
|
315
|
-
data.altsource =
|
|
262
|
+
data.altsource = node.attr('src');
|
|
316
263
|
}
|
|
317
264
|
}
|
|
318
265
|
if (name === 'img' && !data.poster) {
|
|
319
|
-
data.poster =
|
|
266
|
+
data.poster = node.attr('src');
|
|
320
267
|
}
|
|
321
268
|
}
|
|
322
269
|
}
|
|
323
|
-
}
|
|
324
|
-
data.source = data.source || data.src ||
|
|
270
|
+
}
|
|
271
|
+
data.source = data.source || data.src || '';
|
|
325
272
|
data.altsource = data.altsource || '';
|
|
326
273
|
data.poster = data.poster || '';
|
|
327
274
|
return data;
|
|
328
275
|
};
|
|
329
276
|
|
|
330
|
-
|
|
331
|
-
var
|
|
277
|
+
const guess = url => {
|
|
278
|
+
var _a;
|
|
279
|
+
const mimes = {
|
|
332
280
|
mp3: 'audio/mpeg',
|
|
333
281
|
m4a: 'audio/x-m4a',
|
|
334
282
|
wav: 'audio/wav',
|
|
@@ -337,77 +285,50 @@
|
|
|
337
285
|
ogg: 'video/ogg',
|
|
338
286
|
swf: 'application/x-shockwave-flash'
|
|
339
287
|
};
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
return mime ? mime : '';
|
|
288
|
+
const fileEnd = (_a = url.toLowerCase().split('.').pop()) !== null && _a !== void 0 ? _a : '';
|
|
289
|
+
return get$1(mimes, fileEnd).getOr('');
|
|
343
290
|
};
|
|
344
291
|
|
|
345
|
-
var global$
|
|
292
|
+
var global$2 = tinymce.util.Tools.resolve('tinymce.html.Node');
|
|
346
293
|
|
|
347
|
-
var global$
|
|
294
|
+
var global$1 = tinymce.util.Tools.resolve('tinymce.html.Serializer');
|
|
348
295
|
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
}
|
|
369
|
-
}
|
|
370
|
-
} else if (value) {
|
|
371
|
-
attrs.push({
|
|
372
|
-
name: name,
|
|
373
|
-
value: value
|
|
374
|
-
});
|
|
375
|
-
attrs.map[name] = value;
|
|
376
|
-
}
|
|
377
|
-
});
|
|
378
|
-
};
|
|
379
|
-
var updateEphoxEmbed = function (data, attrs) {
|
|
380
|
-
var style = attrs.map.style;
|
|
381
|
-
var styleMap = style ? DOM$1.parseStyle(style) : {};
|
|
382
|
-
styleMap['max-width'] = addPx(data.width);
|
|
383
|
-
styleMap['max-height'] = addPx(data.height);
|
|
384
|
-
setAttributes(attrs, { style: DOM$1.serializeStyle(styleMap) });
|
|
296
|
+
const Parser = (schema, settings = {}) => global$3({
|
|
297
|
+
forced_root_block: false,
|
|
298
|
+
validate: false,
|
|
299
|
+
allow_conditional_comments: true,
|
|
300
|
+
...settings
|
|
301
|
+
}, schema);
|
|
302
|
+
|
|
303
|
+
const DOM = global$4.DOM;
|
|
304
|
+
const addPx = value => /^[0-9.]+$/.test(value) ? value + 'px' : value;
|
|
305
|
+
const updateEphoxEmbed = (data, node) => {
|
|
306
|
+
const style = node.attr('style');
|
|
307
|
+
const styleMap = style ? DOM.parseStyle(style) : {};
|
|
308
|
+
if (isNonNullable(data.width)) {
|
|
309
|
+
styleMap['max-width'] = addPx(data.width);
|
|
310
|
+
}
|
|
311
|
+
if (isNonNullable(data.height)) {
|
|
312
|
+
styleMap['max-height'] = addPx(data.height);
|
|
313
|
+
}
|
|
314
|
+
node.attr('style', DOM.serializeStyle(styleMap));
|
|
385
315
|
};
|
|
386
|
-
|
|
316
|
+
const sources = [
|
|
387
317
|
'source',
|
|
388
318
|
'altsource'
|
|
389
319
|
];
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
writer.cdata(text);
|
|
403
|
-
},
|
|
404
|
-
text: function (text, raw) {
|
|
405
|
-
writer.text(text, raw);
|
|
406
|
-
},
|
|
407
|
-
start: function (name, attrs, empty) {
|
|
408
|
-
if (isEphoxEmbed.get()) ; else if (has(attrs.map, 'data-ephox-embed-iri')) {
|
|
409
|
-
isEphoxEmbed.set(true);
|
|
410
|
-
updateEphoxEmbed(data, attrs);
|
|
320
|
+
const updateHtml = (html, data, updateAll, schema) => {
|
|
321
|
+
let numSources = 0;
|
|
322
|
+
let sourceCount = 0;
|
|
323
|
+
const parser = Parser(schema);
|
|
324
|
+
parser.addNodeFilter('source', nodes => numSources = nodes.length);
|
|
325
|
+
const rootNode = parser.parse(html);
|
|
326
|
+
for (let node = rootNode; node; node = node.walk()) {
|
|
327
|
+
if (node.type === 1) {
|
|
328
|
+
const name = node.name;
|
|
329
|
+
if (node.attr('data-ephox-embed-iri')) {
|
|
330
|
+
updateEphoxEmbed(data, node);
|
|
331
|
+
break;
|
|
411
332
|
} else {
|
|
412
333
|
switch (name) {
|
|
413
334
|
case 'video':
|
|
@@ -416,85 +337,64 @@
|
|
|
416
337
|
case 'img':
|
|
417
338
|
case 'iframe':
|
|
418
339
|
if (data.height !== undefined && data.width !== undefined) {
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
height: data.height
|
|
422
|
-
});
|
|
340
|
+
node.attr('width', data.width);
|
|
341
|
+
node.attr('height', data.height);
|
|
423
342
|
}
|
|
424
343
|
break;
|
|
425
344
|
}
|
|
426
345
|
if (updateAll) {
|
|
427
346
|
switch (name) {
|
|
428
347
|
case 'video':
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
348
|
+
node.attr('poster', data.poster);
|
|
349
|
+
node.attr('src', null);
|
|
350
|
+
for (let index = numSources; index < 2; index++) {
|
|
351
|
+
if (data[sources[index]]) {
|
|
352
|
+
const source = new global$2('source', 1);
|
|
353
|
+
source.attr('src', data[sources[index]]);
|
|
354
|
+
source.attr('type', data[sources[index] + 'mime'] || null);
|
|
355
|
+
node.append(source);
|
|
356
|
+
}
|
|
435
357
|
}
|
|
436
358
|
break;
|
|
437
359
|
case 'iframe':
|
|
438
|
-
|
|
360
|
+
node.attr('src', data.source);
|
|
361
|
+
break;
|
|
362
|
+
case 'object':
|
|
363
|
+
const hasImage = node.getAll('img').length > 0;
|
|
364
|
+
if (data.poster && !hasImage) {
|
|
365
|
+
node.attr('src', data.poster);
|
|
366
|
+
const img = new global$2('img', 1);
|
|
367
|
+
img.attr('src', data.poster);
|
|
368
|
+
img.attr('width', data.width);
|
|
369
|
+
img.attr('height', data.height);
|
|
370
|
+
node.append(img);
|
|
371
|
+
}
|
|
439
372
|
break;
|
|
440
373
|
case 'source':
|
|
441
374
|
if (sourceCount < 2) {
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
type: data[sources[sourceCount] + 'mime']
|
|
445
|
-
});
|
|
375
|
+
node.attr('src', data[sources[sourceCount]]);
|
|
376
|
+
node.attr('type', data[sources[sourceCount] + 'mime'] || null);
|
|
446
377
|
if (!data[sources[sourceCount]]) {
|
|
447
|
-
|
|
378
|
+
node.remove();
|
|
379
|
+
continue;
|
|
448
380
|
}
|
|
449
381
|
}
|
|
450
382
|
sourceCount++;
|
|
451
383
|
break;
|
|
452
384
|
case 'img':
|
|
453
385
|
if (!data.poster) {
|
|
454
|
-
|
|
386
|
+
node.remove();
|
|
455
387
|
}
|
|
456
|
-
hasImage = true;
|
|
457
388
|
break;
|
|
458
389
|
}
|
|
459
390
|
}
|
|
460
391
|
}
|
|
461
|
-
writer.start(name, attrs, empty);
|
|
462
|
-
},
|
|
463
|
-
end: function (name) {
|
|
464
|
-
if (!isEphoxEmbed.get()) {
|
|
465
|
-
if (name === 'video' && updateAll) {
|
|
466
|
-
for (var index = 0; index < 2; index++) {
|
|
467
|
-
if (data[sources[index]]) {
|
|
468
|
-
var attrs = [];
|
|
469
|
-
attrs.map = {};
|
|
470
|
-
if (sourceCount <= index) {
|
|
471
|
-
setAttributes(attrs, {
|
|
472
|
-
src: data[sources[index]],
|
|
473
|
-
type: data[sources[index] + 'mime']
|
|
474
|
-
});
|
|
475
|
-
writer.start('source', attrs, true);
|
|
476
|
-
}
|
|
477
|
-
}
|
|
478
|
-
}
|
|
479
|
-
}
|
|
480
|
-
if (data.poster && name === 'object' && updateAll && !hasImage) {
|
|
481
|
-
var imgAttrs = [];
|
|
482
|
-
imgAttrs.map = {};
|
|
483
|
-
setAttributes(imgAttrs, {
|
|
484
|
-
src: data.poster,
|
|
485
|
-
width: data.width,
|
|
486
|
-
height: data.height
|
|
487
|
-
});
|
|
488
|
-
writer.start('img', imgAttrs, true);
|
|
489
|
-
}
|
|
490
|
-
}
|
|
491
|
-
writer.end(name);
|
|
492
392
|
}
|
|
493
|
-
}
|
|
494
|
-
return
|
|
393
|
+
}
|
|
394
|
+
return global$1({}, schema).serialize(rootNode);
|
|
495
395
|
};
|
|
496
396
|
|
|
497
|
-
|
|
397
|
+
const urlPatterns = [
|
|
498
398
|
{
|
|
499
399
|
regex: /youtu\.be\/([\w\-_\?&=.]+)/i,
|
|
500
400
|
type: 'iframe',
|
|
@@ -519,6 +419,22 @@
|
|
|
519
419
|
url: 'www.youtube.com/embed/$1',
|
|
520
420
|
allowFullscreen: true
|
|
521
421
|
},
|
|
422
|
+
{
|
|
423
|
+
regex: /vimeo\.com\/([0-9]+)\?h=(\w+)/,
|
|
424
|
+
type: 'iframe',
|
|
425
|
+
w: 425,
|
|
426
|
+
h: 350,
|
|
427
|
+
url: 'player.vimeo.com/video/$1?h=$2&title=0&byline=0&portrait=0&color=8dc7dc',
|
|
428
|
+
allowFullscreen: true
|
|
429
|
+
},
|
|
430
|
+
{
|
|
431
|
+
regex: /vimeo\.com\/(.*)\/([0-9]+)\?h=(\w+)/,
|
|
432
|
+
type: 'iframe',
|
|
433
|
+
w: 425,
|
|
434
|
+
h: 350,
|
|
435
|
+
url: 'player.vimeo.com/video/$2?h=$3&title=0&byline=0',
|
|
436
|
+
allowFullscreen: true
|
|
437
|
+
},
|
|
522
438
|
{
|
|
523
439
|
regex: /vimeo\.com\/([0-9]+)/,
|
|
524
440
|
type: 'iframe',
|
|
@@ -560,72 +476,69 @@
|
|
|
560
476
|
allowFullscreen: true
|
|
561
477
|
}
|
|
562
478
|
];
|
|
563
|
-
|
|
564
|
-
|
|
479
|
+
const getProtocol = url => {
|
|
480
|
+
const protocolMatches = url.match(/^(https?:\/\/|www\.)(.+)$/i);
|
|
565
481
|
if (protocolMatches && protocolMatches.length > 1) {
|
|
566
482
|
return protocolMatches[1] === 'www.' ? 'https://' : protocolMatches[1];
|
|
567
483
|
} else {
|
|
568
484
|
return 'https://';
|
|
569
485
|
}
|
|
570
486
|
};
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
}
|
|
579
|
-
};
|
|
580
|
-
for (var i = 0; i < match.length; i++) {
|
|
581
|
-
_loop_1(i);
|
|
487
|
+
const getUrl = (pattern, url) => {
|
|
488
|
+
const protocol = getProtocol(url);
|
|
489
|
+
const match = pattern.regex.exec(url);
|
|
490
|
+
let newUrl = protocol + pattern.url;
|
|
491
|
+
if (isNonNullable(match)) {
|
|
492
|
+
for (let i = 0; i < match.length; i++) {
|
|
493
|
+
newUrl = newUrl.replace('$' + i, () => match[i] ? match[i] : '');
|
|
494
|
+
}
|
|
582
495
|
}
|
|
583
496
|
return newUrl.replace(/\?$/, '');
|
|
584
497
|
};
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
return pattern.regex.test(url);
|
|
588
|
-
});
|
|
498
|
+
const matchPattern = url => {
|
|
499
|
+
const patterns = urlPatterns.filter(pattern => pattern.regex.test(url));
|
|
589
500
|
if (patterns.length > 0) {
|
|
590
|
-
return global$
|
|
501
|
+
return global$5.extend({}, patterns[0], { url: getUrl(patterns[0], url) });
|
|
591
502
|
} else {
|
|
592
503
|
return null;
|
|
593
504
|
}
|
|
594
505
|
};
|
|
595
506
|
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
507
|
+
const getIframeHtml = (data, iframeTemplateCallback) => {
|
|
508
|
+
if (iframeTemplateCallback) {
|
|
509
|
+
return iframeTemplateCallback(data);
|
|
510
|
+
} else {
|
|
511
|
+
const allowFullscreen = data.allowfullscreen ? ' allowFullscreen="1"' : '';
|
|
512
|
+
return '<iframe src="' + data.source + '" width="' + data.width + '" height="' + data.height + '"' + allowFullscreen + '></iframe>';
|
|
513
|
+
}
|
|
599
514
|
};
|
|
600
|
-
|
|
601
|
-
|
|
515
|
+
const getFlashHtml = data => {
|
|
516
|
+
let html = '<object data="' + data.source + '" width="' + data.width + '" height="' + data.height + '" type="application/x-shockwave-flash">';
|
|
602
517
|
if (data.poster) {
|
|
603
518
|
html += '<img src="' + data.poster + '" width="' + data.width + '" height="' + data.height + '" />';
|
|
604
519
|
}
|
|
605
520
|
html += '</object>';
|
|
606
521
|
return html;
|
|
607
522
|
};
|
|
608
|
-
|
|
523
|
+
const getAudioHtml = (data, audioTemplateCallback) => {
|
|
609
524
|
if (audioTemplateCallback) {
|
|
610
525
|
return audioTemplateCallback(data);
|
|
611
526
|
} else {
|
|
612
527
|
return '<audio controls="controls" src="' + data.source + '">' + (data.altsource ? '\n<source src="' + data.altsource + '"' + (data.altsourcemime ? ' type="' + data.altsourcemime + '"' : '') + ' />\n' : '') + '</audio>';
|
|
613
528
|
}
|
|
614
529
|
};
|
|
615
|
-
|
|
530
|
+
const getVideoHtml = (data, videoTemplateCallback) => {
|
|
616
531
|
if (videoTemplateCallback) {
|
|
617
532
|
return videoTemplateCallback(data);
|
|
618
533
|
} else {
|
|
619
534
|
return '<video width="' + data.width + '" height="' + data.height + '"' + (data.poster ? ' poster="' + data.poster + '"' : '') + ' controls="controls">\n' + '<source src="' + data.source + '"' + (data.sourcemime ? ' type="' + data.sourcemime + '"' : '') + ' />\n' + (data.altsource ? '<source src="' + data.altsource + '"' + (data.altsourcemime ? ' type="' + data.altsourcemime + '"' : '') + ' />\n' : '') + '</video>';
|
|
620
535
|
}
|
|
621
536
|
};
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
var dataToHtml = function (editor, dataIn) {
|
|
626
|
-
var data = global$1.extend({}, dataIn);
|
|
537
|
+
const dataToHtml = (editor, dataIn) => {
|
|
538
|
+
var _a;
|
|
539
|
+
const data = global$5.extend({}, dataIn);
|
|
627
540
|
if (!data.source) {
|
|
628
|
-
global$
|
|
541
|
+
global$5.extend(data, htmlToData((_a = data.embed) !== null && _a !== void 0 ? _a : '', editor.schema));
|
|
629
542
|
if (!data.source) {
|
|
630
543
|
return '';
|
|
631
544
|
}
|
|
@@ -641,7 +554,7 @@
|
|
|
641
554
|
data.sourcemime = guess(data.source);
|
|
642
555
|
data.altsourcemime = guess(data.altsource);
|
|
643
556
|
data.poster = editor.convertURL(data.poster, 'poster');
|
|
644
|
-
|
|
557
|
+
const pattern = matchPattern(data.source);
|
|
645
558
|
if (pattern) {
|
|
646
559
|
data.source = pattern.url;
|
|
647
560
|
data.type = pattern.type;
|
|
@@ -650,41 +563,57 @@
|
|
|
650
563
|
data.height = data.height || String(pattern.h);
|
|
651
564
|
}
|
|
652
565
|
if (data.embed) {
|
|
653
|
-
return updateHtml(data.embed, data, true);
|
|
566
|
+
return updateHtml(data.embed, data, true, editor.schema);
|
|
654
567
|
} else {
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
data.width = String(videoScript.width);
|
|
659
|
-
data.height = String(videoScript.height);
|
|
660
|
-
}
|
|
661
|
-
var audioTemplateCallback = getAudioTemplateCallback(editor);
|
|
662
|
-
var videoTemplateCallback = getVideoTemplateCallback(editor);
|
|
568
|
+
const audioTemplateCallback = getAudioTemplateCallback(editor);
|
|
569
|
+
const videoTemplateCallback = getVideoTemplateCallback(editor);
|
|
570
|
+
const iframeTemplateCallback = getIframeTemplateCallback(editor);
|
|
663
571
|
data.width = data.width || '300';
|
|
664
572
|
data.height = data.height || '150';
|
|
665
|
-
global$
|
|
573
|
+
global$5.each(data, (value, key) => {
|
|
666
574
|
data[key] = editor.dom.encode('' + value);
|
|
667
575
|
});
|
|
668
576
|
if (data.type === 'iframe') {
|
|
669
|
-
return getIframeHtml(data);
|
|
577
|
+
return getIframeHtml(data, iframeTemplateCallback);
|
|
670
578
|
} else if (data.sourcemime === 'application/x-shockwave-flash') {
|
|
671
579
|
return getFlashHtml(data);
|
|
672
580
|
} else if (data.sourcemime.indexOf('audio') !== -1) {
|
|
673
581
|
return getAudioHtml(data, audioTemplateCallback);
|
|
674
|
-
} else if (data.type === 'script') {
|
|
675
|
-
return getScriptHtml(data);
|
|
676
582
|
} else {
|
|
677
583
|
return getVideoHtml(data, videoTemplateCallback);
|
|
678
584
|
}
|
|
679
585
|
}
|
|
680
586
|
};
|
|
681
587
|
|
|
682
|
-
|
|
588
|
+
const isMediaElement = element => element.hasAttribute('data-mce-object') || element.hasAttribute('data-ephox-embed-iri');
|
|
589
|
+
const setup$2 = editor => {
|
|
590
|
+
editor.on('click keyup touchend', () => {
|
|
591
|
+
const selectedNode = editor.selection.getNode();
|
|
592
|
+
if (selectedNode && editor.dom.hasClass(selectedNode, 'mce-preview-object')) {
|
|
593
|
+
if (editor.dom.getAttrib(selectedNode, 'data-mce-selected')) {
|
|
594
|
+
selectedNode.setAttribute('data-mce-selected', '2');
|
|
595
|
+
}
|
|
596
|
+
}
|
|
597
|
+
});
|
|
598
|
+
editor.on('ObjectResized', e => {
|
|
599
|
+
const target = e.target;
|
|
600
|
+
if (target.getAttribute('data-mce-object')) {
|
|
601
|
+
let html = target.getAttribute('data-mce-html');
|
|
602
|
+
if (html) {
|
|
603
|
+
html = unescape(html);
|
|
604
|
+
target.setAttribute('data-mce-html', escape(updateHtml(html, {
|
|
605
|
+
width: String(e.width),
|
|
606
|
+
height: String(e.height)
|
|
607
|
+
}, false, editor.schema)));
|
|
608
|
+
}
|
|
609
|
+
}
|
|
610
|
+
});
|
|
611
|
+
};
|
|
683
612
|
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
return new
|
|
687
|
-
|
|
613
|
+
const cache = {};
|
|
614
|
+
const embedPromise = (data, dataToHtml, handler) => {
|
|
615
|
+
return new Promise((res, rej) => {
|
|
616
|
+
const wrappedResolve = response => {
|
|
688
617
|
if (response.html) {
|
|
689
618
|
cache[data.source] = response;
|
|
690
619
|
}
|
|
@@ -700,139 +629,113 @@
|
|
|
700
629
|
}
|
|
701
630
|
});
|
|
702
631
|
};
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
};
|
|
711
|
-
var loadedData = function (editor) {
|
|
712
|
-
return function (data) {
|
|
713
|
-
return dataToHtml(editor, data);
|
|
714
|
-
};
|
|
715
|
-
};
|
|
716
|
-
var getEmbedHtml = function (editor, data) {
|
|
717
|
-
var embedHandler = getUrlResolver(editor);
|
|
632
|
+
const defaultPromise = (data, dataToHtml) => Promise.resolve({
|
|
633
|
+
html: dataToHtml(data),
|
|
634
|
+
url: data.source
|
|
635
|
+
});
|
|
636
|
+
const loadedData = editor => data => dataToHtml(editor, data);
|
|
637
|
+
const getEmbedHtml = (editor, data) => {
|
|
638
|
+
const embedHandler = getUrlResolver(editor);
|
|
718
639
|
return embedHandler ? embedPromise(data, loadedData(editor), embedHandler) : defaultPromise(data, loadedData(editor));
|
|
719
640
|
};
|
|
720
|
-
|
|
721
|
-
return cache.hasOwnProperty(url);
|
|
722
|
-
};
|
|
641
|
+
const isCached = url => has(cache, url);
|
|
723
642
|
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
};
|
|
738
|
-
var getNonEmptyValue = function (c) {
|
|
739
|
-
return get(c, 'value').bind(function (v) {
|
|
740
|
-
return v.length > 0 ? Optional.some(v) : Optional.none();
|
|
741
|
-
});
|
|
742
|
-
};
|
|
743
|
-
var getFromValueFirst = function () {
|
|
744
|
-
return getFromData().bind(function (child) {
|
|
745
|
-
return isObject(child) ? getNonEmptyValue(child).orThunk(getFromMetaData) : getFromMetaData().orThunk(function () {
|
|
746
|
-
return Optional.from(child);
|
|
747
|
-
});
|
|
748
|
-
});
|
|
749
|
-
};
|
|
750
|
-
var getFromMetaFirst = function () {
|
|
751
|
-
return getFromMetaData().orThunk(function () {
|
|
752
|
-
return getFromData().bind(function (child) {
|
|
753
|
-
return isObject(child) ? getNonEmptyValue(child) : Optional.from(child);
|
|
754
|
-
});
|
|
755
|
-
});
|
|
756
|
-
};
|
|
757
|
-
return _a = {}, _a[prop] = (prop === sourceInput ? getFromValueFirst() : getFromMetaFirst()).getOr(''), _a;
|
|
758
|
-
};
|
|
759
|
-
};
|
|
760
|
-
var getDimensions = function (data, metaData) {
|
|
761
|
-
var dimensions = {};
|
|
762
|
-
get(data, 'dimensions').each(function (dims) {
|
|
763
|
-
each([
|
|
643
|
+
const extractMeta = (sourceInput, data) => get$1(data, sourceInput).bind(mainData => get$1(mainData, 'meta'));
|
|
644
|
+
const getValue = (data, metaData, sourceInput) => prop => {
|
|
645
|
+
const getFromData = () => get$1(data, prop);
|
|
646
|
+
const getFromMetaData = () => get$1(metaData, prop);
|
|
647
|
+
const getNonEmptyValue = c => get$1(c, 'value').bind(v => v.length > 0 ? Optional.some(v) : Optional.none());
|
|
648
|
+
const getFromValueFirst = () => getFromData().bind(child => isObject(child) ? getNonEmptyValue(child).orThunk(getFromMetaData) : getFromMetaData().orThunk(() => Optional.from(child)));
|
|
649
|
+
const getFromMetaFirst = () => getFromMetaData().orThunk(() => getFromData().bind(child => isObject(child) ? getNonEmptyValue(child) : Optional.from(child)));
|
|
650
|
+
return { [prop]: (prop === sourceInput ? getFromValueFirst() : getFromMetaFirst()).getOr('') };
|
|
651
|
+
};
|
|
652
|
+
const getDimensions = (data, metaData) => {
|
|
653
|
+
const dimensions = {};
|
|
654
|
+
get$1(data, 'dimensions').each(dims => {
|
|
655
|
+
each$1([
|
|
764
656
|
'width',
|
|
765
657
|
'height'
|
|
766
|
-
],
|
|
767
|
-
get(metaData, prop).orThunk(
|
|
768
|
-
return get(dims, prop);
|
|
769
|
-
}).each(function (value) {
|
|
770
|
-
return dimensions[prop] = value;
|
|
771
|
-
});
|
|
658
|
+
], prop => {
|
|
659
|
+
get$1(metaData, prop).orThunk(() => get$1(dims, prop)).each(value => dimensions[prop] = value);
|
|
772
660
|
});
|
|
773
661
|
});
|
|
774
662
|
return dimensions;
|
|
775
663
|
};
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
return
|
|
664
|
+
const unwrap = (data, sourceInput) => {
|
|
665
|
+
const metaData = sourceInput && sourceInput !== 'dimensions' ? extractMeta(sourceInput, data).getOr({}) : {};
|
|
666
|
+
const get = getValue(data, metaData, sourceInput);
|
|
667
|
+
return {
|
|
668
|
+
...get('source'),
|
|
669
|
+
...get('altsource'),
|
|
670
|
+
...get('poster'),
|
|
671
|
+
...get('embed'),
|
|
672
|
+
...getDimensions(data, metaData)
|
|
673
|
+
};
|
|
780
674
|
};
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
675
|
+
const wrap = data => {
|
|
676
|
+
const wrapped = {
|
|
677
|
+
...data,
|
|
678
|
+
source: { value: get$1(data, 'source').getOr('') },
|
|
679
|
+
altsource: { value: get$1(data, 'altsource').getOr('') },
|
|
680
|
+
poster: { value: get$1(data, 'poster').getOr('') }
|
|
681
|
+
};
|
|
682
|
+
each$1([
|
|
788
683
|
'width',
|
|
789
684
|
'height'
|
|
790
|
-
],
|
|
791
|
-
get(data, prop).each(
|
|
792
|
-
|
|
685
|
+
], prop => {
|
|
686
|
+
get$1(data, prop).each(value => {
|
|
687
|
+
const dimensions = wrapped.dimensions || {};
|
|
793
688
|
dimensions[prop] = value;
|
|
794
689
|
wrapped.dimensions = dimensions;
|
|
795
690
|
});
|
|
796
691
|
});
|
|
797
692
|
return wrapped;
|
|
798
693
|
};
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
});
|
|
806
|
-
};
|
|
807
|
-
};
|
|
808
|
-
var snippetToData = function (editor, embedSnippet) {
|
|
809
|
-
return htmlToData(getScripts(editor), embedSnippet);
|
|
810
|
-
};
|
|
811
|
-
var isMediaElement = function (element) {
|
|
812
|
-
return element.getAttribute('data-mce-object') || element.getAttribute('data-ephox-embed-iri');
|
|
813
|
-
};
|
|
814
|
-
var getEditorData = function (editor) {
|
|
815
|
-
var element = editor.selection.getNode();
|
|
816
|
-
var snippet = isMediaElement(element) ? editor.serializer.serialize(element, { selection: true }) : '';
|
|
817
|
-
return __assign({ embed: snippet }, htmlToData(getScripts(editor), snippet));
|
|
694
|
+
const handleError = editor => error => {
|
|
695
|
+
const errorMessage = error && error.msg ? 'Media embed handler error: ' + error.msg : 'Media embed handler threw unknown error.';
|
|
696
|
+
editor.notificationManager.open({
|
|
697
|
+
type: 'error',
|
|
698
|
+
text: errorMessage
|
|
699
|
+
});
|
|
818
700
|
};
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
701
|
+
const getEditorData = editor => {
|
|
702
|
+
const element = editor.selection.getNode();
|
|
703
|
+
const snippet = isMediaElement(element) ? editor.serializer.serialize(element, { selection: true }) : '';
|
|
704
|
+
const data = htmlToData(snippet, editor.schema);
|
|
705
|
+
const getDimensionsOfElement = () => {
|
|
706
|
+
if (isEmbedIframe(data.source, data.type)) {
|
|
707
|
+
const rect = editor.dom.getRect(element);
|
|
708
|
+
return {
|
|
709
|
+
width: rect.w.toString().replace(/px$/, ''),
|
|
710
|
+
height: rect.h.toString().replace(/px$/, '')
|
|
711
|
+
};
|
|
712
|
+
} else {
|
|
713
|
+
return {};
|
|
829
714
|
}
|
|
830
715
|
};
|
|
716
|
+
const dimensions = getDimensionsOfElement();
|
|
717
|
+
return {
|
|
718
|
+
embed: snippet,
|
|
719
|
+
...data,
|
|
720
|
+
...dimensions
|
|
721
|
+
};
|
|
831
722
|
};
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
723
|
+
const addEmbedHtml = (api, editor) => response => {
|
|
724
|
+
if (isString(response.url) && response.url.trim().length > 0) {
|
|
725
|
+
const html = response.html;
|
|
726
|
+
const snippetData = htmlToData(html, editor.schema);
|
|
727
|
+
const nuData = {
|
|
728
|
+
...snippetData,
|
|
729
|
+
source: response.url,
|
|
730
|
+
embed: html
|
|
731
|
+
};
|
|
732
|
+
api.setData(wrap(nuData));
|
|
733
|
+
}
|
|
734
|
+
};
|
|
735
|
+
const selectPlaceholder = (editor, beforeObjects) => {
|
|
736
|
+
const afterObjects = editor.dom.select('*[data-mce-object]');
|
|
737
|
+
for (let i = 0; i < beforeObjects.length; i++) {
|
|
738
|
+
for (let y = afterObjects.length - 1; y >= 0; y--) {
|
|
836
739
|
if (beforeObjects[i] === afterObjects[y]) {
|
|
837
740
|
afterObjects.splice(y, 1);
|
|
838
741
|
}
|
|
@@ -840,28 +743,37 @@
|
|
|
840
743
|
}
|
|
841
744
|
editor.selection.select(afterObjects[0]);
|
|
842
745
|
};
|
|
843
|
-
|
|
844
|
-
|
|
746
|
+
const handleInsert = (editor, html) => {
|
|
747
|
+
const beforeObjects = editor.dom.select('*[data-mce-object]');
|
|
845
748
|
editor.insertContent(html);
|
|
846
749
|
selectPlaceholder(editor, beforeObjects);
|
|
847
750
|
editor.nodeChanged();
|
|
848
751
|
};
|
|
849
|
-
|
|
850
|
-
|
|
752
|
+
const isEmbedIframe = (url, mediaDataType) => isNonNullable(mediaDataType) && mediaDataType === 'ephox-embed-iri' && isNonNullable(matchPattern(url));
|
|
753
|
+
const shouldInsertAsNewIframe = (prevData, newData) => {
|
|
754
|
+
const hasDimensionsChanged = (prevData, newData) => prevData.width !== newData.width || prevData.height !== newData.height;
|
|
755
|
+
return hasDimensionsChanged(prevData, newData) && isEmbedIframe(newData.source, prevData.type);
|
|
756
|
+
};
|
|
757
|
+
const submitForm = (prevData, newData, editor) => {
|
|
758
|
+
var _a;
|
|
759
|
+
newData.embed = shouldInsertAsNewIframe(prevData, newData) && hasDimensions(editor) ? dataToHtml(editor, {
|
|
760
|
+
...newData,
|
|
761
|
+
embed: ''
|
|
762
|
+
}) : updateHtml((_a = newData.embed) !== null && _a !== void 0 ? _a : '', newData, false, editor.schema);
|
|
851
763
|
if (newData.embed && (prevData.source === newData.source || isCached(newData.source))) {
|
|
852
764
|
handleInsert(editor, newData.embed);
|
|
853
765
|
} else {
|
|
854
|
-
getEmbedHtml(editor, newData).then(
|
|
766
|
+
getEmbedHtml(editor, newData).then(response => {
|
|
855
767
|
handleInsert(editor, response.html);
|
|
856
768
|
}).catch(handleError(editor));
|
|
857
769
|
}
|
|
858
770
|
};
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
771
|
+
const showDialog = editor => {
|
|
772
|
+
const editorData = getEditorData(editor);
|
|
773
|
+
const currentData = Cell(editorData);
|
|
774
|
+
const initialData = wrap(editorData);
|
|
775
|
+
const handleSource = (prevData, api) => {
|
|
776
|
+
const serviceData = unwrap(api.getData(), 'source');
|
|
865
777
|
if (prevData.source !== serviceData.source) {
|
|
866
778
|
addEmbedHtml(win, editor)({
|
|
867
779
|
url: serviceData.source,
|
|
@@ -870,29 +782,38 @@
|
|
|
870
782
|
getEmbedHtml(editor, serviceData).then(addEmbedHtml(win, editor)).catch(handleError(editor));
|
|
871
783
|
}
|
|
872
784
|
};
|
|
873
|
-
|
|
874
|
-
var
|
|
875
|
-
|
|
785
|
+
const handleEmbed = api => {
|
|
786
|
+
var _a;
|
|
787
|
+
const data = unwrap(api.getData());
|
|
788
|
+
const dataFromEmbed = htmlToData((_a = data.embed) !== null && _a !== void 0 ? _a : '', editor.schema);
|
|
876
789
|
api.setData(wrap(dataFromEmbed));
|
|
877
790
|
};
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
791
|
+
const handleUpdate = (api, sourceInput, prevData) => {
|
|
792
|
+
const dialogData = unwrap(api.getData(), sourceInput);
|
|
793
|
+
const data = shouldInsertAsNewIframe(prevData, dialogData) && hasDimensions(editor) ? {
|
|
794
|
+
...dialogData,
|
|
795
|
+
embed: ''
|
|
796
|
+
} : dialogData;
|
|
797
|
+
const embed = dataToHtml(editor, data);
|
|
798
|
+
api.setData(wrap({
|
|
799
|
+
...data,
|
|
800
|
+
embed
|
|
801
|
+
}));
|
|
882
802
|
};
|
|
883
|
-
|
|
803
|
+
const mediaInput = [{
|
|
884
804
|
name: 'source',
|
|
885
805
|
type: 'urlinput',
|
|
886
806
|
filetype: 'media',
|
|
887
|
-
label: 'Source'
|
|
807
|
+
label: 'Source',
|
|
808
|
+
picker_text: 'Browse files'
|
|
888
809
|
}];
|
|
889
|
-
|
|
810
|
+
const sizeInput = !hasDimensions(editor) ? [] : [{
|
|
890
811
|
type: 'sizeinput',
|
|
891
812
|
name: 'dimensions',
|
|
892
813
|
label: 'Constrain proportions',
|
|
893
814
|
constrain: true
|
|
894
815
|
}];
|
|
895
|
-
|
|
816
|
+
const generalTab = {
|
|
896
817
|
title: 'General',
|
|
897
818
|
name: 'general',
|
|
898
819
|
items: flatten([
|
|
@@ -900,16 +821,16 @@
|
|
|
900
821
|
sizeInput
|
|
901
822
|
])
|
|
902
823
|
};
|
|
903
|
-
|
|
824
|
+
const embedTextarea = {
|
|
904
825
|
type: 'textarea',
|
|
905
826
|
name: 'embed',
|
|
906
827
|
label: 'Paste your embed code below:'
|
|
907
828
|
};
|
|
908
|
-
|
|
829
|
+
const embedTab = {
|
|
909
830
|
title: 'Embed',
|
|
910
831
|
items: [embedTextarea]
|
|
911
832
|
};
|
|
912
|
-
|
|
833
|
+
const advancedFormItems = [];
|
|
913
834
|
if (hasAltSource(editor)) {
|
|
914
835
|
advancedFormItems.push({
|
|
915
836
|
name: 'altsource',
|
|
@@ -926,26 +847,26 @@
|
|
|
926
847
|
label: 'Media poster (Image URL)'
|
|
927
848
|
});
|
|
928
849
|
}
|
|
929
|
-
|
|
850
|
+
const advancedTab = {
|
|
930
851
|
title: 'Advanced',
|
|
931
852
|
name: 'advanced',
|
|
932
853
|
items: advancedFormItems
|
|
933
854
|
};
|
|
934
|
-
|
|
855
|
+
const tabs = [
|
|
935
856
|
generalTab,
|
|
936
857
|
embedTab
|
|
937
858
|
];
|
|
938
859
|
if (advancedFormItems.length > 0) {
|
|
939
860
|
tabs.push(advancedTab);
|
|
940
861
|
}
|
|
941
|
-
|
|
862
|
+
const body = {
|
|
942
863
|
type: 'tabpanel',
|
|
943
|
-
tabs
|
|
864
|
+
tabs
|
|
944
865
|
};
|
|
945
|
-
|
|
866
|
+
const win = editor.windowManager.open({
|
|
946
867
|
title: 'Insert/Edit Media',
|
|
947
868
|
size: 'normal',
|
|
948
|
-
body
|
|
869
|
+
body,
|
|
949
870
|
buttons: [
|
|
950
871
|
{
|
|
951
872
|
type: 'cancel',
|
|
@@ -959,12 +880,12 @@
|
|
|
959
880
|
primary: true
|
|
960
881
|
}
|
|
961
882
|
],
|
|
962
|
-
onSubmit:
|
|
963
|
-
|
|
883
|
+
onSubmit: api => {
|
|
884
|
+
const serviceData = unwrap(api.getData());
|
|
964
885
|
submitForm(currentData.get(), serviceData, editor);
|
|
965
886
|
api.close();
|
|
966
887
|
},
|
|
967
|
-
onChange:
|
|
888
|
+
onChange: (api, detail) => {
|
|
968
889
|
switch (detail.name) {
|
|
969
890
|
case 'source':
|
|
970
891
|
handleSource(currentData.get(), api);
|
|
@@ -975,96 +896,42 @@
|
|
|
975
896
|
case 'dimensions':
|
|
976
897
|
case 'altsource':
|
|
977
898
|
case 'poster':
|
|
978
|
-
handleUpdate(api, detail.name);
|
|
899
|
+
handleUpdate(api, detail.name, currentData.get());
|
|
979
900
|
break;
|
|
980
901
|
}
|
|
981
902
|
currentData.set(unwrap(api.getData()));
|
|
982
903
|
},
|
|
983
|
-
initialData
|
|
904
|
+
initialData
|
|
984
905
|
});
|
|
985
906
|
};
|
|
986
907
|
|
|
987
|
-
|
|
988
|
-
|
|
908
|
+
const get = editor => {
|
|
909
|
+
const showDialog$1 = () => {
|
|
989
910
|
showDialog(editor);
|
|
990
911
|
};
|
|
991
912
|
return { showDialog: showDialog$1 };
|
|
992
913
|
};
|
|
993
914
|
|
|
994
|
-
|
|
995
|
-
|
|
915
|
+
const register$1 = editor => {
|
|
916
|
+
const showDialog$1 = () => {
|
|
996
917
|
showDialog(editor);
|
|
997
918
|
};
|
|
998
919
|
editor.addCommand('mceMedia', showDialog$1);
|
|
999
920
|
};
|
|
1000
921
|
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
var global$9 = tinymce.util.Tools.resolve('tinymce.html.DomParser');
|
|
1006
|
-
|
|
1007
|
-
var sanitize = function (editor, html) {
|
|
1008
|
-
if (shouldFilterHtml(editor) === false) {
|
|
1009
|
-
return html;
|
|
1010
|
-
}
|
|
1011
|
-
var writer = global$5();
|
|
1012
|
-
var blocked;
|
|
1013
|
-
global$3({
|
|
1014
|
-
validate: false,
|
|
1015
|
-
allow_conditional_comments: false,
|
|
1016
|
-
comment: function (text) {
|
|
1017
|
-
if (!blocked) {
|
|
1018
|
-
writer.comment(text);
|
|
1019
|
-
}
|
|
1020
|
-
},
|
|
1021
|
-
cdata: function (text) {
|
|
1022
|
-
if (!blocked) {
|
|
1023
|
-
writer.cdata(text);
|
|
1024
|
-
}
|
|
1025
|
-
},
|
|
1026
|
-
text: function (text, raw) {
|
|
1027
|
-
if (!blocked) {
|
|
1028
|
-
writer.text(text, raw);
|
|
1029
|
-
}
|
|
1030
|
-
},
|
|
1031
|
-
start: function (name, attrs, empty) {
|
|
1032
|
-
blocked = true;
|
|
1033
|
-
if (name === 'script' || name === 'noscript' || name === 'svg') {
|
|
1034
|
-
return;
|
|
1035
|
-
}
|
|
1036
|
-
for (var i = attrs.length - 1; i >= 0; i--) {
|
|
1037
|
-
var attrName = attrs[i].name;
|
|
1038
|
-
if (attrName.indexOf('on') === 0) {
|
|
1039
|
-
delete attrs.map[attrName];
|
|
1040
|
-
attrs.splice(i, 1);
|
|
1041
|
-
}
|
|
1042
|
-
if (attrName === 'style') {
|
|
1043
|
-
attrs[i].value = editor.dom.serializeStyle(editor.dom.parseStyle(attrs[i].value), name);
|
|
1044
|
-
}
|
|
1045
|
-
}
|
|
1046
|
-
writer.start(name, attrs, empty);
|
|
1047
|
-
blocked = false;
|
|
1048
|
-
},
|
|
1049
|
-
end: function (name) {
|
|
1050
|
-
if (blocked) {
|
|
1051
|
-
return;
|
|
1052
|
-
}
|
|
1053
|
-
writer.end(name);
|
|
1054
|
-
}
|
|
1055
|
-
}, global$4({})).parse(html);
|
|
1056
|
-
return writer.getContent();
|
|
922
|
+
const checkRange = (str, substr, start) => substr === '' || str.length >= substr.length && str.substr(start, start + substr.length) === substr;
|
|
923
|
+
const startsWith = (str, prefix) => {
|
|
924
|
+
return checkRange(str, prefix, 0);
|
|
1057
925
|
};
|
|
1058
926
|
|
|
1059
|
-
var
|
|
1060
|
-
|
|
927
|
+
var global = tinymce.util.Tools.resolve('tinymce.Env');
|
|
928
|
+
|
|
929
|
+
const isLiveEmbedNode = node => {
|
|
930
|
+
const name = node.name;
|
|
1061
931
|
return name === 'iframe' || name === 'video' || name === 'audio';
|
|
1062
932
|
};
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
defaultValue = null;
|
|
1066
|
-
}
|
|
1067
|
-
var value = node.attr(dimension);
|
|
933
|
+
const getDimension = (node, styles, dimension, defaultValue = null) => {
|
|
934
|
+
const value = node.attr(dimension);
|
|
1068
935
|
if (isNonNullable(value)) {
|
|
1069
936
|
return value;
|
|
1070
937
|
} else if (!has(styles, dimension)) {
|
|
@@ -1073,42 +940,39 @@
|
|
|
1073
940
|
return null;
|
|
1074
941
|
}
|
|
1075
942
|
};
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
943
|
+
const setDimensions = (node, previewNode, styles) => {
|
|
944
|
+
const useDefaults = previewNode.name === 'img' || node.name === 'video';
|
|
945
|
+
const defaultWidth = useDefaults ? '300' : null;
|
|
946
|
+
const fallbackHeight = node.name === 'audio' ? '30' : '150';
|
|
947
|
+
const defaultHeight = useDefaults ? fallbackHeight : null;
|
|
1081
948
|
previewNode.attr({
|
|
1082
949
|
width: getDimension(node, styles, 'width', defaultWidth),
|
|
1083
950
|
height: getDimension(node, styles, 'height', defaultHeight)
|
|
1084
951
|
});
|
|
1085
952
|
};
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
forced_root_block: false,
|
|
1089
|
-
validate: false
|
|
1090
|
-
}, editor.schema).parse(html, { context: nodeName });
|
|
953
|
+
const appendNodeContent = (editor, nodeName, previewNode, html) => {
|
|
954
|
+
const newNode = Parser(editor.schema).parse(html, { context: nodeName });
|
|
1091
955
|
while (newNode.firstChild) {
|
|
1092
956
|
previewNode.append(newNode.firstChild);
|
|
1093
957
|
}
|
|
1094
958
|
};
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
placeHolder.shortEnded = true;
|
|
959
|
+
const createPlaceholderNode = (editor, node) => {
|
|
960
|
+
const name = node.name;
|
|
961
|
+
const placeHolder = new global$2('img', 1);
|
|
1099
962
|
retainAttributesAndInnerHtml(editor, node, placeHolder);
|
|
1100
963
|
setDimensions(node, placeHolder, {});
|
|
1101
964
|
placeHolder.attr({
|
|
1102
965
|
'style': node.attr('style'),
|
|
1103
|
-
'src': global
|
|
966
|
+
'src': global.transparentSrc,
|
|
1104
967
|
'data-mce-object': name,
|
|
1105
968
|
'class': 'mce-object mce-object-' + name
|
|
1106
969
|
});
|
|
1107
970
|
return placeHolder;
|
|
1108
971
|
};
|
|
1109
|
-
|
|
1110
|
-
var
|
|
1111
|
-
|
|
972
|
+
const createPreviewNode = (editor, node) => {
|
|
973
|
+
var _a;
|
|
974
|
+
const name = node.name;
|
|
975
|
+
const previewWrapper = new global$2('span', 1);
|
|
1112
976
|
previewWrapper.attr({
|
|
1113
977
|
'contentEditable': 'false',
|
|
1114
978
|
'style': node.attr('style'),
|
|
@@ -1116,8 +980,8 @@
|
|
|
1116
980
|
'class': 'mce-preview-object mce-object-' + name
|
|
1117
981
|
});
|
|
1118
982
|
retainAttributesAndInnerHtml(editor, node, previewWrapper);
|
|
1119
|
-
|
|
1120
|
-
|
|
983
|
+
const styles = editor.dom.parseStyle((_a = node.attr('style')) !== null && _a !== void 0 ? _a : '');
|
|
984
|
+
const previewNode = new global$2(name, 1);
|
|
1121
985
|
setDimensions(node, previewNode, styles);
|
|
1122
986
|
previewNode.attr({
|
|
1123
987
|
src: node.attr('src'),
|
|
@@ -1127,10 +991,11 @@
|
|
|
1127
991
|
if (name === 'iframe') {
|
|
1128
992
|
previewNode.attr({
|
|
1129
993
|
allowfullscreen: node.attr('allowfullscreen'),
|
|
1130
|
-
frameborder: '0'
|
|
994
|
+
frameborder: '0',
|
|
995
|
+
sandbox: node.attr('sandbox')
|
|
1131
996
|
});
|
|
1132
997
|
} else {
|
|
1133
|
-
|
|
998
|
+
const attrs = [
|
|
1134
999
|
'controls',
|
|
1135
1000
|
'crossorigin',
|
|
1136
1001
|
'currentTime',
|
|
@@ -1139,122 +1004,119 @@
|
|
|
1139
1004
|
'poster',
|
|
1140
1005
|
'preload'
|
|
1141
1006
|
];
|
|
1142
|
-
each(attrs,
|
|
1007
|
+
each$1(attrs, attrName => {
|
|
1143
1008
|
previewNode.attr(attrName, node.attr(attrName));
|
|
1144
1009
|
});
|
|
1145
|
-
|
|
1010
|
+
const sanitizedHtml = previewWrapper.attr('data-mce-html');
|
|
1146
1011
|
if (isNonNullable(sanitizedHtml)) {
|
|
1147
|
-
appendNodeContent(editor, name, previewNode, sanitizedHtml);
|
|
1012
|
+
appendNodeContent(editor, name, previewNode, unescape(sanitizedHtml));
|
|
1148
1013
|
}
|
|
1149
1014
|
}
|
|
1150
|
-
|
|
1015
|
+
const shimNode = new global$2('span', 1);
|
|
1151
1016
|
shimNode.attr('class', 'mce-shim');
|
|
1152
1017
|
previewWrapper.append(previewNode);
|
|
1153
1018
|
previewWrapper.append(shimNode);
|
|
1154
1019
|
return previewWrapper;
|
|
1155
1020
|
};
|
|
1156
|
-
|
|
1157
|
-
var
|
|
1158
|
-
|
|
1021
|
+
const retainAttributesAndInnerHtml = (editor, sourceNode, targetNode) => {
|
|
1022
|
+
var _a;
|
|
1023
|
+
const attribs = (_a = sourceNode.attributes) !== null && _a !== void 0 ? _a : [];
|
|
1024
|
+
let ai = attribs.length;
|
|
1159
1025
|
while (ai--) {
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
if (attrName !== 'width' && attrName !== 'height' && attrName !== 'style') {
|
|
1026
|
+
const attrName = attribs[ai].name;
|
|
1027
|
+
let attrValue = attribs[ai].value;
|
|
1028
|
+
if (attrName !== 'width' && attrName !== 'height' && attrName !== 'style' && !startsWith(attrName, 'data-mce-')) {
|
|
1163
1029
|
if (attrName === 'data' || attrName === 'src') {
|
|
1164
1030
|
attrValue = editor.convertURL(attrValue, attrName);
|
|
1165
1031
|
}
|
|
1166
1032
|
targetNode.attr('data-mce-p-' + attrName, attrValue);
|
|
1167
1033
|
}
|
|
1168
1034
|
}
|
|
1169
|
-
|
|
1035
|
+
const serializer = global$1({ inner: true }, editor.schema);
|
|
1036
|
+
const tempNode = new global$2('div', 1);
|
|
1037
|
+
each$1(sourceNode.children(), child => tempNode.append(child));
|
|
1038
|
+
const innerHtml = serializer.serialize(tempNode);
|
|
1170
1039
|
if (innerHtml) {
|
|
1171
|
-
targetNode.attr('data-mce-html', escape(
|
|
1172
|
-
targetNode.
|
|
1040
|
+
targetNode.attr('data-mce-html', escape(innerHtml));
|
|
1041
|
+
targetNode.empty();
|
|
1173
1042
|
}
|
|
1174
1043
|
};
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
return nodeClass && /\btiny-pageembed\b/.test(nodeClass);
|
|
1044
|
+
const isPageEmbedWrapper = node => {
|
|
1045
|
+
const nodeClass = node.attr('class');
|
|
1046
|
+
return isString(nodeClass) && /\btiny-pageembed\b/.test(nodeClass);
|
|
1178
1047
|
};
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1048
|
+
const isWithinEmbedWrapper = node => {
|
|
1049
|
+
let tempNode = node;
|
|
1050
|
+
while (tempNode = tempNode.parent) {
|
|
1051
|
+
if (tempNode.attr('data-ephox-embed-iri') || isPageEmbedWrapper(tempNode)) {
|
|
1182
1052
|
return true;
|
|
1183
1053
|
}
|
|
1184
1054
|
}
|
|
1185
1055
|
return false;
|
|
1186
1056
|
};
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
videoScript = getVideoScriptMatch(getScripts(editor), node.attr('src'));
|
|
1202
|
-
if (!videoScript) {
|
|
1203
|
-
continue;
|
|
1204
|
-
}
|
|
1205
|
-
}
|
|
1206
|
-
if (videoScript) {
|
|
1207
|
-
if (videoScript.width) {
|
|
1208
|
-
node.attr('width', videoScript.width.toString());
|
|
1209
|
-
}
|
|
1210
|
-
if (videoScript.height) {
|
|
1211
|
-
node.attr('height', videoScript.height.toString());
|
|
1212
|
-
}
|
|
1057
|
+
const placeHolderConverter = editor => nodes => {
|
|
1058
|
+
let i = nodes.length;
|
|
1059
|
+
let node;
|
|
1060
|
+
while (i--) {
|
|
1061
|
+
node = nodes[i];
|
|
1062
|
+
if (!node.parent) {
|
|
1063
|
+
continue;
|
|
1064
|
+
}
|
|
1065
|
+
if (node.parent.attr('data-mce-object')) {
|
|
1066
|
+
continue;
|
|
1067
|
+
}
|
|
1068
|
+
if (isLiveEmbedNode(node) && hasLiveEmbeds(editor)) {
|
|
1069
|
+
if (!isWithinEmbedWrapper(node)) {
|
|
1070
|
+
node.replace(createPreviewNode(editor, node));
|
|
1213
1071
|
}
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
}
|
|
1218
|
-
} else {
|
|
1219
|
-
if (!isWithinEmbedWrapper(node)) {
|
|
1220
|
-
node.replace(createPlaceholderNode(editor, node));
|
|
1221
|
-
}
|
|
1072
|
+
} else {
|
|
1073
|
+
if (!isWithinEmbedWrapper(node)) {
|
|
1074
|
+
node.replace(createPlaceholderNode(editor, node));
|
|
1222
1075
|
}
|
|
1223
1076
|
}
|
|
1224
|
-
}
|
|
1077
|
+
}
|
|
1225
1078
|
};
|
|
1226
1079
|
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1080
|
+
const parseAndSanitize = (editor, context, html) => {
|
|
1081
|
+
const getEditorOption = editor.options.get;
|
|
1082
|
+
const sanitize = getEditorOption('xss_sanitization');
|
|
1083
|
+
const validate = shouldFilterHtml(editor);
|
|
1084
|
+
return Parser(editor.schema, {
|
|
1085
|
+
sanitize,
|
|
1086
|
+
validate
|
|
1087
|
+
}).parse(html, { context });
|
|
1088
|
+
};
|
|
1089
|
+
|
|
1090
|
+
const setup$1 = editor => {
|
|
1091
|
+
editor.on('PreInit', () => {
|
|
1092
|
+
const {schema, serializer, parser} = editor;
|
|
1093
|
+
const boolAttrs = schema.getBoolAttrs();
|
|
1094
|
+
each$1('webkitallowfullscreen mozallowfullscreen'.split(' '), name => {
|
|
1235
1095
|
boolAttrs[name] = {};
|
|
1236
1096
|
});
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1097
|
+
each({ embed: ['wmode'] }, (attrs, name) => {
|
|
1098
|
+
const rule = schema.getElementRule(name);
|
|
1099
|
+
if (rule) {
|
|
1100
|
+
each$1(attrs, attr => {
|
|
1101
|
+
rule.attributes[attr] = {};
|
|
1102
|
+
rule.attributesOrder.push(attr);
|
|
1103
|
+
});
|
|
1104
|
+
}
|
|
1105
|
+
});
|
|
1106
|
+
parser.addNodeFilter('iframe,video,audio,object,embed', placeHolderConverter(editor));
|
|
1107
|
+
serializer.addAttributeFilter('data-mce-object', (nodes, name) => {
|
|
1108
|
+
var _a;
|
|
1109
|
+
let i = nodes.length;
|
|
1248
1110
|
while (i--) {
|
|
1249
|
-
node = nodes[i];
|
|
1111
|
+
const node = nodes[i];
|
|
1250
1112
|
if (!node.parent) {
|
|
1251
1113
|
continue;
|
|
1252
1114
|
}
|
|
1253
|
-
realElmName = node.attr(name);
|
|
1254
|
-
realElm = new global$
|
|
1255
|
-
if (realElmName !== 'audio'
|
|
1256
|
-
className = node.attr('class');
|
|
1257
|
-
if (className && className.indexOf('mce-preview-object') !== -1) {
|
|
1115
|
+
const realElmName = node.attr(name);
|
|
1116
|
+
const realElm = new global$2(realElmName, 1);
|
|
1117
|
+
if (realElmName !== 'audio') {
|
|
1118
|
+
const className = node.attr('class');
|
|
1119
|
+
if (className && className.indexOf('mce-preview-object') !== -1 && node.firstChild) {
|
|
1258
1120
|
realElm.attr({
|
|
1259
1121
|
width: node.firstChild.attr('width'),
|
|
1260
1122
|
height: node.firstChild.attr('height')
|
|
@@ -1267,116 +1129,89 @@
|
|
|
1267
1129
|
}
|
|
1268
1130
|
}
|
|
1269
1131
|
realElm.attr({ style: node.attr('style') });
|
|
1270
|
-
attribs = node.attributes;
|
|
1271
|
-
ai = attribs.length;
|
|
1132
|
+
const attribs = (_a = node.attributes) !== null && _a !== void 0 ? _a : [];
|
|
1133
|
+
let ai = attribs.length;
|
|
1272
1134
|
while (ai--) {
|
|
1273
|
-
|
|
1135
|
+
const attrName = attribs[ai].name;
|
|
1274
1136
|
if (attrName.indexOf('data-mce-p-') === 0) {
|
|
1275
1137
|
realElm.attr(attrName.substr(11), attribs[ai].value);
|
|
1276
1138
|
}
|
|
1277
1139
|
}
|
|
1278
|
-
|
|
1279
|
-
realElm.attr('type', 'text/javascript');
|
|
1280
|
-
}
|
|
1281
|
-
innerHtml = node.attr('data-mce-html');
|
|
1140
|
+
const innerHtml = node.attr('data-mce-html');
|
|
1282
1141
|
if (innerHtml) {
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
innerNode.value = sanitize(editor, unescape(innerHtml));
|
|
1286
|
-
realElm.append(innerNode);
|
|
1142
|
+
const fragment = parseAndSanitize(editor, realElmName, unescape(innerHtml));
|
|
1143
|
+
each$1(fragment.children(), child => realElm.append(child));
|
|
1287
1144
|
}
|
|
1288
1145
|
node.replace(realElm);
|
|
1289
1146
|
}
|
|
1290
1147
|
});
|
|
1291
1148
|
});
|
|
1292
|
-
editor.on('SetContent',
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
if (
|
|
1296
|
-
|
|
1149
|
+
editor.on('SetContent', () => {
|
|
1150
|
+
const dom = editor.dom;
|
|
1151
|
+
each$1(dom.select('span.mce-preview-object'), elm => {
|
|
1152
|
+
if (dom.select('span.mce-shim', elm).length === 0) {
|
|
1153
|
+
dom.add(elm, 'span', { class: 'mce-shim' });
|
|
1297
1154
|
}
|
|
1298
1155
|
});
|
|
1299
1156
|
});
|
|
1300
1157
|
};
|
|
1301
1158
|
|
|
1302
|
-
|
|
1303
|
-
editor.on('ResolveName',
|
|
1304
|
-
|
|
1159
|
+
const setup = editor => {
|
|
1160
|
+
editor.on('ResolveName', e => {
|
|
1161
|
+
let name;
|
|
1305
1162
|
if (e.target.nodeType === 1 && (name = e.target.getAttribute('data-mce-object'))) {
|
|
1306
1163
|
e.name = name;
|
|
1307
1164
|
}
|
|
1308
1165
|
});
|
|
1309
1166
|
};
|
|
1310
1167
|
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
});
|
|
1320
|
-
editor.on('ObjectSelected', function (e) {
|
|
1321
|
-
var objectType = e.target.getAttribute('data-mce-object');
|
|
1322
|
-
if (objectType === 'script') {
|
|
1323
|
-
e.preventDefault();
|
|
1324
|
-
}
|
|
1325
|
-
});
|
|
1326
|
-
editor.on('ObjectResized', function (e) {
|
|
1327
|
-
var target = e.target;
|
|
1328
|
-
var html;
|
|
1329
|
-
if (target.getAttribute('data-mce-object')) {
|
|
1330
|
-
html = target.getAttribute('data-mce-html');
|
|
1331
|
-
if (html) {
|
|
1332
|
-
html = unescape(html);
|
|
1333
|
-
target.setAttribute('data-mce-html', escape(updateHtml(html, {
|
|
1334
|
-
width: String(e.width),
|
|
1335
|
-
height: String(e.height)
|
|
1336
|
-
})));
|
|
1337
|
-
}
|
|
1338
|
-
}
|
|
1339
|
-
});
|
|
1340
|
-
};
|
|
1341
|
-
|
|
1342
|
-
var stateSelectorAdapter = function (editor, selector) {
|
|
1343
|
-
return function (buttonApi) {
|
|
1344
|
-
return editor.selection.selectorChangedWithUnbind(selector.join(','), buttonApi.setActive).unbind;
|
|
1168
|
+
const onSetupEditable = editor => api => {
|
|
1169
|
+
const nodeChanged = () => {
|
|
1170
|
+
api.setEnabled(editor.selection.isEditable());
|
|
1171
|
+
};
|
|
1172
|
+
editor.on('NodeChange', nodeChanged);
|
|
1173
|
+
nodeChanged();
|
|
1174
|
+
return () => {
|
|
1175
|
+
editor.off('NodeChange', nodeChanged);
|
|
1345
1176
|
};
|
|
1346
1177
|
};
|
|
1347
|
-
|
|
1178
|
+
const register = editor => {
|
|
1179
|
+
const onAction = () => editor.execCommand('mceMedia');
|
|
1348
1180
|
editor.ui.registry.addToggleButton('media', {
|
|
1349
1181
|
tooltip: 'Insert/edit media',
|
|
1350
1182
|
icon: 'embed',
|
|
1351
|
-
onAction
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
'img[data-mce-object]',
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1183
|
+
onAction,
|
|
1184
|
+
onSetup: buttonApi => {
|
|
1185
|
+
const selection = editor.selection;
|
|
1186
|
+
buttonApi.setActive(isMediaElement(selection.getNode()));
|
|
1187
|
+
const unbindSelectorChanged = selection.selectorChangedWithUnbind('img[data-mce-object],span[data-mce-object],div[data-ephox-embed-iri]', buttonApi.setActive).unbind;
|
|
1188
|
+
const unbindEditable = onSetupEditable(editor)(buttonApi);
|
|
1189
|
+
return () => {
|
|
1190
|
+
unbindSelectorChanged();
|
|
1191
|
+
unbindEditable();
|
|
1192
|
+
};
|
|
1193
|
+
}
|
|
1359
1194
|
});
|
|
1360
1195
|
editor.ui.registry.addMenuItem('media', {
|
|
1361
1196
|
icon: 'embed',
|
|
1362
1197
|
text: 'Media...',
|
|
1363
|
-
onAction
|
|
1364
|
-
|
|
1365
|
-
}
|
|
1198
|
+
onAction,
|
|
1199
|
+
onSetup: onSetupEditable(editor)
|
|
1366
1200
|
});
|
|
1367
1201
|
};
|
|
1368
1202
|
|
|
1369
|
-
|
|
1370
|
-
global.add('media',
|
|
1371
|
-
register(editor);
|
|
1203
|
+
var Plugin = () => {
|
|
1204
|
+
global$6.add('media', editor => {
|
|
1205
|
+
register$2(editor);
|
|
1372
1206
|
register$1(editor);
|
|
1373
|
-
|
|
1207
|
+
register(editor);
|
|
1374
1208
|
setup(editor);
|
|
1209
|
+
setup$1(editor);
|
|
1375
1210
|
setup$2(editor);
|
|
1376
|
-
return get
|
|
1211
|
+
return get(editor);
|
|
1377
1212
|
});
|
|
1378
|
-
}
|
|
1213
|
+
};
|
|
1379
1214
|
|
|
1380
1215
|
Plugin();
|
|
1381
1216
|
|
|
1382
|
-
}()
|
|
1217
|
+
})();
|