argous 1.2.132 → 1.2.136
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/api/index.d.ts +1 -0
- package/dist/api/index.js +18 -1
- package/dist/components/AutoCompleteFavorites/AutoCompleteFavorites.d.ts +21 -0
- package/dist/components/AutoCompleteFavorites/AutoCompleteFavorites.js +331 -0
- package/dist/components/Compartilhar/Compartilhar.js +1 -1
- package/lib/actions/index.ts +57 -0
- package/lib/api/WebSocket.js +148 -0
- package/lib/api/index.js +402 -0
- package/lib/api/ws.js +27 -0
- package/lib/components/Alert/Alert.d.ts +8 -0
- package/lib/components/Alert/Alert.js +49 -0
- package/lib/components/Alert/index.d.ts +2 -0
- package/lib/components/Alert/index.js +1 -0
- package/lib/components/ArgousAction/ArgousAction.d.ts +8 -0
- package/lib/components/ArgousAction/ArgousAction.js +78 -0
- package/lib/components/ArgousAction/index.d.ts +2 -0
- package/lib/components/ArgousAction/index.js +1 -0
- package/lib/components/ArgousAvatar/ArgousAvatar.d.ts +14 -0
- package/lib/components/ArgousAvatar/ArgousAvatar.js +79 -0
- package/lib/components/ArgousAvatar/index.d.ts +2 -0
- package/lib/components/ArgousAvatar/index.js +1 -0
- package/lib/components/ArgousComplexPagination/ArgousComplexPagination.d.ts +76 -0
- package/lib/components/ArgousComplexPagination/ArgousComplexPagination.js +182 -0
- package/lib/components/ArgousComplexPagination/index.d.ts +2 -0
- package/lib/components/ArgousComplexPagination/index.js +1 -0
- package/lib/components/ArgousComplexTable/ArgousComplexTable.d.ts +131 -0
- package/lib/components/ArgousComplexTable/ArgousComplexTable.js +360 -0
- package/lib/components/ArgousComplexTable/index.d.ts +2 -0
- package/lib/components/ArgousComplexTable/index.js +1 -0
- package/lib/components/ArgousComplexTableBody/ArgousComplexTableBody.d.ts +177 -0
- package/lib/components/ArgousComplexTableBody/ArgousComplexTableBody.js +162 -0
- package/lib/components/ArgousComplexTableBody/index.d.ts +2 -0
- package/lib/components/ArgousComplexTableBody/index.js +1 -0
- package/lib/components/ArgousComplexTableHead/ArgousComplexTableHead.d.ts +73 -0
- package/lib/components/ArgousComplexTableHead/ArgousComplexTableHead.js +98 -0
- package/lib/components/ArgousComplexTableHead/index.d.ts +2 -0
- package/lib/components/ArgousComplexTableHead/index.js +1 -0
- package/lib/components/ArgousComplexTableToolbar/ArgousComplexTableToolBar.d.ts +58 -0
- package/lib/components/ArgousComplexTableToolbar/ArgousComplexTableToolBar.js +66 -0
- package/lib/components/ArgousComplexTableToolbar/index.d.ts +2 -0
- package/lib/components/ArgousComplexTableToolbar/index.js +1 -0
- package/lib/components/ArgousInput/ArgousInput.d.ts +8 -0
- package/lib/components/ArgousInput/ArgousInput.js +616 -0
- package/lib/components/ArgousInput/index.d.ts +2 -0
- package/lib/components/ArgousInput/index.js +1 -0
- package/lib/components/ArgousPagination/ArgousPagination.d.ts +8 -0
- package/lib/components/ArgousPagination/ArgousPagination.js +43 -0
- package/lib/components/ArgousPagination/index.d.ts +2 -0
- package/lib/components/ArgousPagination/index.js +1 -0
- package/lib/components/ArgousProgressBar/ArgousProgressBar.d.ts +22 -0
- package/lib/components/ArgousProgressBar/ArgousProgressBar.js +167 -0
- package/lib/components/ArgousProgressBar/index.d.ts +2 -0
- package/lib/components/ArgousProgressBar/index.js +1 -0
- package/lib/components/ArgousSimpleTable/ArgousSimpleTable.d.ts +8 -0
- package/lib/components/ArgousSimpleTable/ArgousSimpleTable.js +241 -0
- package/lib/components/ArgousSimpleTable/index.d.ts +2 -0
- package/lib/components/ArgousSimpleTable/index.js +1 -0
- package/lib/components/AutoComplete/AutoComplete.d.ts +8 -0
- package/lib/components/AutoComplete/AutoComplete.js +189 -0
- package/lib/components/AutoComplete/index.d.ts +2 -0
- package/lib/components/AutoComplete/index.js +1 -0
- package/lib/components/AutoCompleteFavorites/AutoCompleteFavorites.js +298 -0
- package/lib/components/BarChart/BarChart.d.ts +8 -0
- package/lib/components/BarChart/BarChart.js +92 -0
- package/lib/components/BarChart/index.d.ts +2 -0
- package/lib/components/BarChart/index.js +1 -0
- package/lib/components/BarraFerramentas/BarraFerramentas.d.ts +21 -0
- package/lib/components/BarraFerramentas/BarraFerramentas.js +277 -0
- package/lib/components/BarraFerramentas/index.d.ts +2 -0
- package/lib/components/BarraFerramentas/index.js +1 -0
- package/lib/components/Button/Button.d.ts +8 -0
- package/lib/components/Button/Button.js +135 -0
- package/lib/components/Button/index.d.ts +2 -0
- package/lib/components/Button/index.js +1 -0
- package/lib/components/Cabecalho/Cabecalho.d.ts +8 -0
- package/lib/components/Cabecalho/Cabecalho.js +245 -0
- package/lib/components/Cabecalho/index.d.ts +2 -0
- package/lib/components/Cabecalho/index.js +1 -0
- package/lib/components/Calendar/Calendar.d.ts +8 -0
- package/lib/components/Calendar/Calendar.js +156 -0
- package/lib/components/Calendar/index.d.ts +2 -0
- package/lib/components/Calendar/index.js +1 -0
- package/lib/components/CartaoUsuario/CartaoUsuario.d.ts +9 -0
- package/lib/components/CartaoUsuario/CartaoUsuario.js +108 -0
- package/lib/components/CartaoUsuario/index.d.ts +2 -0
- package/lib/components/CartaoUsuario/index.js +1 -0
- package/lib/components/Collapse/Collapse.d.ts +60 -0
- package/lib/components/Collapse/Collapse.js +317 -0
- package/lib/components/Collapse/index.d.ts +3 -0
- package/lib/components/Collapse/index.js +1 -0
- package/lib/components/Compartilhar/Compartilhar.d.ts +7 -0
- package/lib/components/Compartilhar/Compartilhar.js +314 -0
- package/lib/components/Compartilhar/index.d.ts +2 -0
- package/lib/components/Compartilhar/index.js +1 -0
- package/lib/components/ConfirmModal/BasicModal.tsx +63 -0
- package/lib/components/ConfirmModal/ModalProvider.tsx +81 -0
- package/lib/components/ConfirmModal/WrapperModal.tsx +33 -0
- package/lib/components/ConfirmModal/index.d.ts +20 -0
- package/lib/components/ConfirmModal/index.js +8 -0
- package/lib/components/DropArea/DropArea.d.ts +21 -0
- package/lib/components/DropArea/DropArea.js +90 -0
- package/lib/components/DropArea/Html5FileSelector.js +164 -0
- package/lib/components/DropArea/index.d.ts +2 -0
- package/lib/components/DropArea/index.js +1 -0
- package/lib/components/Editor/Events.ts +83 -0
- package/lib/components/Editor/ScriptLoader.ts +96 -0
- package/lib/components/Editor/TinyMCE.ts +19 -0
- package/lib/components/Editor/Utils.ts +95 -0
- package/lib/components/Editor/components/Editor.tsx +375 -0
- package/lib/components/Editor/components/EditorPropTypes.ts +106 -0
- package/lib/components/Editor/index.tsx +11 -0
- package/lib/components/Editor/skins/content/dark/content.css +72 -0
- package/lib/components/Editor/skins/content/dark/content.min.css +8 -0
- package/lib/components/Editor/skins/content/dark/content.min.css.map +1 -0
- package/lib/components/Editor/skins/content/default/content.css +67 -0
- package/lib/components/Editor/skins/content/default/content.min.css +8 -0
- package/lib/components/Editor/skins/content/default/content.min.css.map +1 -0
- package/lib/components/Editor/skins/content/document/content.css +72 -0
- package/lib/components/Editor/skins/content/document/content.min.css +8 -0
- package/lib/components/Editor/skins/content/document/content.min.css.map +1 -0
- package/lib/components/Editor/skins/content/writer/content.css +68 -0
- package/lib/components/Editor/skins/content/writer/content.min.css +8 -0
- package/lib/components/Editor/skins/content/writer/content.min.css.map +1 -0
- package/lib/components/Editor/skins/ui/dark/content.css +714 -0
- package/lib/components/Editor/skins/ui/dark/content.inline.css +726 -0
- package/lib/components/Editor/skins/ui/dark/content.inline.min.css +8 -0
- package/lib/components/Editor/skins/ui/dark/content.inline.min.css.map +1 -0
- package/lib/components/Editor/skins/ui/dark/content.min.css +8 -0
- package/lib/components/Editor/skins/ui/dark/content.min.css.map +1 -0
- package/lib/components/Editor/skins/ui/dark/content.mobile.css +29 -0
- package/lib/components/Editor/skins/ui/dark/content.mobile.min.css +8 -0
- package/lib/components/Editor/skins/ui/dark/content.mobile.min.css.map +1 -0
- package/lib/components/Editor/skins/ui/dark/fonts/tinymce-mobile.woff +0 -0
- package/lib/components/Editor/skins/ui/dark/skin.css +3034 -0
- package/lib/components/Editor/skins/ui/dark/skin.min.css +8 -0
- package/lib/components/Editor/skins/ui/dark/skin.min.css.map +1 -0
- package/lib/components/Editor/skins/ui/dark/skin.mobile.css +673 -0
- package/lib/components/Editor/skins/ui/dark/skin.mobile.min.css +8 -0
- package/lib/components/Editor/skins/ui/dark/skin.mobile.min.css.map +1 -0
- package/lib/components/Editor/skins/ui/dark/skin.shadowdom.css +37 -0
- package/lib/components/Editor/skins/ui/dark/skin.shadowdom.min.css +8 -0
- package/lib/components/Editor/skins/ui/dark/skin.shadowdom.min.css.map +1 -0
- package/lib/components/Editor/skins/ui/default/content.css +732 -0
- package/lib/components/Editor/skins/ui/default/content.inline.css +726 -0
- package/lib/components/Editor/skins/ui/default/content.inline.min.css +8 -0
- package/lib/components/Editor/skins/ui/default/content.inline.min.css.map +1 -0
- package/lib/components/Editor/skins/ui/default/content.min.css +8 -0
- package/lib/components/Editor/skins/ui/default/content.min.css.map +1 -0
- package/lib/components/Editor/skins/ui/default/content.mobile.css +29 -0
- package/lib/components/Editor/skins/ui/default/content.mobile.min.css +8 -0
- package/lib/components/Editor/skins/ui/default/content.mobile.min.css.map +1 -0
- package/lib/components/Editor/skins/ui/default/fonts/tinymce-mobile.woff +0 -0
- package/lib/components/Editor/skins/ui/default/skin.css +3034 -0
- package/lib/components/Editor/skins/ui/default/skin.min.css +8 -0
- package/lib/components/Editor/skins/ui/default/skin.min.css.map +1 -0
- package/lib/components/Editor/skins/ui/default/skin.mobile.css +673 -0
- package/lib/components/Editor/skins/ui/default/skin.mobile.min.css +8 -0
- package/lib/components/Editor/skins/ui/default/skin.mobile.min.css.map +1 -0
- package/lib/components/Editor/skins/ui/default/skin.shadowdom.css +37 -0
- package/lib/components/Editor/skins/ui/default/skin.shadowdom.min.css +8 -0
- package/lib/components/Editor/skins/ui/default/skin.shadowdom.min.css.map +1 -0
- 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 +1641 -0
- package/lib/components/Editor/skins/ui/plugin-tinycomments-tinymce4/plugin-tinycomments-tinymce4.min.css +8 -0
- package/lib/components/Editor/skins/ui/plugin-tinycomments-tinymce4/plugin-tinycomments-tinymce4.min.css.map +1 -0
- package/lib/components/Editor/tinymce/README.md +63 -0
- package/lib/components/Editor/tinymce/icons/default/icons.js +172 -0
- package/lib/components/Editor/tinymce/icons/default/icons.min.js +1 -0
- package/lib/components/Editor/tinymce/jquery.tinymce.min.js +92 -0
- package/lib/components/Editor/tinymce/langs/README.md +3 -0
- package/lib/components/Editor/tinymce/langs/pt_BR.js +419 -0
- package/lib/components/Editor/tinymce/license.txt +504 -0
- package/lib/components/Editor/tinymce/plugins/advlist/plugin.js +280 -0
- package/lib/components/Editor/tinymce/plugins/advlist/plugin.min.js +9 -0
- package/lib/components/Editor/tinymce/plugins/anchor/plugin.js +216 -0
- package/lib/components/Editor/tinymce/plugins/anchor/plugin.min.js +9 -0
- package/lib/components/Editor/tinymce/plugins/autolink/plugin.js +185 -0
- package/lib/components/Editor/tinymce/plugins/autolink/plugin.min.js +9 -0
- package/lib/components/Editor/tinymce/plugins/autoresize/plugin.js +171 -0
- package/lib/components/Editor/tinymce/plugins/autoresize/plugin.min.js +9 -0
- package/lib/components/Editor/tinymce/plugins/autosave/plugin.js +212 -0
- package/lib/components/Editor/tinymce/plugins/autosave/plugin.min.js +9 -0
- package/lib/components/Editor/tinymce/plugins/bbcode/plugin.js +99 -0
- package/lib/components/Editor/tinymce/plugins/bbcode/plugin.min.js +9 -0
- package/lib/components/Editor/tinymce/plugins/charmap/plugin.js +1706 -0
- package/lib/components/Editor/tinymce/plugins/charmap/plugin.min.js +9 -0
- package/lib/components/Editor/tinymce/plugins/code/plugin.js +92 -0
- package/lib/components/Editor/tinymce/plugins/code/plugin.min.js +9 -0
- package/lib/components/Editor/tinymce/plugins/codesample/plugin.js +2332 -0
- package/lib/components/Editor/tinymce/plugins/codesample/plugin.min.js +9 -0
- package/{dist/components/Editor/tinymce/plugins/textcolor → lib/components/Editor/tinymce/plugins/colorpicker}/plugin.js +8 -5
- package/lib/components/Editor/tinymce/plugins/colorpicker/plugin.min.js +9 -0
- package/{dist/components/Editor/tinymce/plugins/colorpicker → lib/components/Editor/tinymce/plugins/contextmenu}/plugin.js +8 -5
- package/lib/components/Editor/tinymce/plugins/contextmenu/plugin.min.js +9 -0
- package/lib/components/Editor/tinymce/plugins/directionality/plugin.js +320 -0
- package/lib/components/Editor/tinymce/plugins/directionality/plugin.min.js +9 -0
- package/lib/components/Editor/tinymce/plugins/emoticons/js/emojiimages.js +9424 -0
- package/lib/components/Editor/tinymce/plugins/emoticons/js/emojiimages.min.js +3 -0
- package/lib/components/Editor/tinymce/plugins/emoticons/js/emojis.js +9423 -0
- package/lib/components/Editor/tinymce/plugins/emoticons/js/emojis.min.js +2 -0
- package/lib/components/Editor/tinymce/plugins/emoticons/plugin.js +605 -0
- package/lib/components/Editor/tinymce/plugins/emoticons/plugin.min.js +9 -0
- package/lib/components/Editor/tinymce/plugins/fullpage/plugin.js +544 -0
- package/lib/components/Editor/tinymce/plugins/fullpage/plugin.min.js +9 -0
- package/lib/components/Editor/tinymce/plugins/fullscreen/plugin.js +979 -0
- package/lib/components/Editor/tinymce/plugins/fullscreen/plugin.min.js +9 -0
- package/lib/components/Editor/tinymce/plugins/help/plugin.js +873 -0
- package/lib/components/Editor/tinymce/plugins/help/plugin.min.js +9 -0
- package/lib/components/Editor/tinymce/plugins/hr/plugin.js +46 -0
- package/lib/components/Editor/tinymce/plugins/hr/plugin.min.js +9 -0
- package/lib/components/Editor/tinymce/plugins/image/plugin.js +1661 -0
- package/lib/components/Editor/tinymce/plugins/image/plugin.min.js +9 -0
- package/lib/components/Editor/tinymce/plugins/imagetools/plugin.js +1354 -0
- package/lib/components/Editor/tinymce/plugins/imagetools/plugin.min.js +9 -0
- package/lib/components/Editor/tinymce/plugins/importcss/plugin.js +343 -0
- package/lib/components/Editor/tinymce/plugins/importcss/plugin.min.js +9 -0
- package/lib/components/Editor/tinymce/plugins/insertdatetime/plugin.js +177 -0
- package/lib/components/Editor/tinymce/plugins/insertdatetime/plugin.min.js +9 -0
- package/lib/components/Editor/tinymce/plugins/legacyoutput/plugin.js +199 -0
- package/lib/components/Editor/tinymce/plugins/legacyoutput/plugin.min.js +9 -0
- package/lib/components/Editor/tinymce/plugins/link/plugin.js +1287 -0
- package/lib/components/Editor/tinymce/plugins/link/plugin.min.js +9 -0
- package/lib/components/Editor/tinymce/plugins/lists/plugin.js +2286 -0
- package/lib/components/Editor/tinymce/plugins/lists/plugin.min.js +9 -0
- package/lib/components/Editor/tinymce/plugins/media/plugin.js +1382 -0
- package/lib/components/Editor/tinymce/plugins/media/plugin.min.js +9 -0
- package/lib/components/Editor/tinymce/plugins/nonbreaking/plugin.js +101 -0
- package/lib/components/Editor/tinymce/plugins/nonbreaking/plugin.min.js +9 -0
- package/lib/components/Editor/tinymce/plugins/noneditable/plugin.js +117 -0
- package/lib/components/Editor/tinymce/plugins/noneditable/plugin.min.js +9 -0
- package/lib/components/Editor/tinymce/plugins/pagebreak/plugin.js +105 -0
- package/lib/components/Editor/tinymce/plugins/pagebreak/plugin.min.js +9 -0
- package/lib/components/Editor/tinymce/plugins/paste/plugin.js +1764 -0
- package/lib/components/Editor/tinymce/plugins/paste/plugin.min.js +9 -0
- package/lib/components/Editor/tinymce/plugins/preview/plugin.js +127 -0
- package/lib/components/Editor/tinymce/plugins/preview/plugin.min.js +9 -0
- package/lib/components/Editor/tinymce/plugins/print/plugin.js +53 -0
- package/lib/components/Editor/tinymce/plugins/print/plugin.min.js +9 -0
- package/lib/components/Editor/tinymce/plugins/quickbars/plugin.js +489 -0
- package/lib/components/Editor/tinymce/plugins/quickbars/plugin.min.js +9 -0
- package/lib/components/Editor/tinymce/plugins/save/plugin.js +119 -0
- package/lib/components/Editor/tinymce/plugins/save/plugin.min.js +9 -0
- package/lib/components/Editor/tinymce/plugins/searchreplace/plugin.js +1163 -0
- package/lib/components/Editor/tinymce/plugins/searchreplace/plugin.min.js +9 -0
- package/lib/components/Editor/tinymce/plugins/spellchecker/plugin.js +731 -0
- package/lib/components/Editor/tinymce/plugins/spellchecker/plugin.min.js +9 -0
- package/lib/components/Editor/tinymce/plugins/tabfocus/plugin.js +129 -0
- package/lib/components/Editor/tinymce/plugins/tabfocus/plugin.min.js +9 -0
- package/lib/components/Editor/tinymce/plugins/table/plugin.js +10938 -0
- package/lib/components/Editor/tinymce/plugins/table/plugin.min.js +9 -0
- package/lib/components/Editor/tinymce/plugins/template/plugin.js +577 -0
- package/lib/components/Editor/tinymce/plugins/template/plugin.min.js +9 -0
- package/{dist/components/Editor/tinymce/plugins/contextmenu → lib/components/Editor/tinymce/plugins/textcolor}/plugin.js +8 -5
- package/lib/components/Editor/tinymce/plugins/textcolor/plugin.min.js +9 -0
- package/lib/components/Editor/tinymce/plugins/textpattern/plugin.js +1394 -0
- package/lib/components/Editor/tinymce/plugins/textpattern/plugin.min.js +9 -0
- package/lib/components/Editor/tinymce/plugins/toc/plugin.js +236 -0
- package/lib/components/Editor/tinymce/plugins/toc/plugin.min.js +9 -0
- package/lib/components/Editor/tinymce/plugins/visualblocks/plugin.js +104 -0
- package/lib/components/Editor/tinymce/plugins/visualblocks/plugin.min.js +9 -0
- package/lib/components/Editor/tinymce/plugins/visualchars/plugin.js +541 -0
- package/lib/components/Editor/tinymce/plugins/visualchars/plugin.min.js +9 -0
- package/lib/components/Editor/tinymce/plugins/wordcount/plugin.js +416 -0
- package/lib/components/Editor/tinymce/plugins/wordcount/plugin.min.js +9 -0
- package/lib/components/Editor/tinymce/skins/content/dark/content.css +72 -0
- package/lib/components/Editor/tinymce/skins/content/dark/content.min.css +8 -0
- package/lib/components/Editor/tinymce/skins/content/dark/content.min.css.map +1 -0
- package/lib/components/Editor/tinymce/skins/content/default/content.css +67 -0
- package/lib/components/Editor/tinymce/skins/content/default/content.min.css +8 -0
- package/lib/components/Editor/tinymce/skins/content/default/content.min.css.map +1 -0
- package/lib/components/Editor/tinymce/skins/content/document/content.css +72 -0
- package/lib/components/Editor/tinymce/skins/content/document/content.min.css +8 -0
- package/lib/components/Editor/tinymce/skins/content/document/content.min.css.map +1 -0
- package/lib/components/Editor/tinymce/skins/content/writer/content.css +68 -0
- package/lib/components/Editor/tinymce/skins/content/writer/content.min.css +8 -0
- package/lib/components/Editor/tinymce/skins/content/writer/content.min.css.map +1 -0
- package/lib/components/Editor/tinymce/skins/ui/oxide/content.css +732 -0
- package/lib/components/Editor/tinymce/skins/ui/oxide/content.inline.css +726 -0
- package/lib/components/Editor/tinymce/skins/ui/oxide/content.inline.min.css +8 -0
- package/lib/components/Editor/tinymce/skins/ui/oxide/content.inline.min.css.map +1 -0
- package/lib/components/Editor/tinymce/skins/ui/oxide/content.min.css +8 -0
- package/lib/components/Editor/tinymce/skins/ui/oxide/content.min.css.map +1 -0
- package/lib/components/Editor/tinymce/skins/ui/oxide/content.mobile.css +29 -0
- package/lib/components/Editor/tinymce/skins/ui/oxide/content.mobile.min.css +8 -0
- package/lib/components/Editor/tinymce/skins/ui/oxide/content.mobile.min.css.map +1 -0
- package/lib/components/Editor/tinymce/skins/ui/oxide/fonts/tinymce-mobile.woff +0 -0
- package/lib/components/Editor/tinymce/skins/ui/oxide/skin.css +3034 -0
- package/lib/components/Editor/tinymce/skins/ui/oxide/skin.min.css +8 -0
- package/lib/components/Editor/tinymce/skins/ui/oxide/skin.min.css.map +1 -0
- package/lib/components/Editor/tinymce/skins/ui/oxide/skin.mobile.css +673 -0
- package/lib/components/Editor/tinymce/skins/ui/oxide/skin.mobile.min.css +8 -0
- package/lib/components/Editor/tinymce/skins/ui/oxide/skin.mobile.min.css.map +1 -0
- package/lib/components/Editor/tinymce/skins/ui/oxide/skin.shadowdom.css +37 -0
- package/lib/components/Editor/tinymce/skins/ui/oxide/skin.shadowdom.min.css +8 -0
- package/lib/components/Editor/tinymce/skins/ui/oxide/skin.shadowdom.min.css.map +1 -0
- package/lib/components/Editor/tinymce/skins/ui/oxide-dark/content.css +714 -0
- package/lib/components/Editor/tinymce/skins/ui/oxide-dark/content.inline.css +726 -0
- package/lib/components/Editor/tinymce/skins/ui/oxide-dark/content.inline.min.css +8 -0
- package/lib/components/Editor/tinymce/skins/ui/oxide-dark/content.inline.min.css.map +1 -0
- package/lib/components/Editor/tinymce/skins/ui/oxide-dark/content.min.css +8 -0
- package/lib/components/Editor/tinymce/skins/ui/oxide-dark/content.min.css.map +1 -0
- package/lib/components/Editor/tinymce/skins/ui/oxide-dark/content.mobile.css +29 -0
- package/lib/components/Editor/tinymce/skins/ui/oxide-dark/content.mobile.min.css +8 -0
- package/lib/components/Editor/tinymce/skins/ui/oxide-dark/content.mobile.min.css.map +1 -0
- 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.css +3034 -0
- package/lib/components/Editor/tinymce/skins/ui/oxide-dark/skin.min.css +8 -0
- package/lib/components/Editor/tinymce/skins/ui/oxide-dark/skin.min.css.map +1 -0
- package/lib/components/Editor/tinymce/skins/ui/oxide-dark/skin.mobile.css +673 -0
- package/lib/components/Editor/tinymce/skins/ui/oxide-dark/skin.mobile.min.css +8 -0
- package/lib/components/Editor/tinymce/skins/ui/oxide-dark/skin.mobile.min.css.map +1 -0
- package/lib/components/Editor/tinymce/skins/ui/oxide-dark/skin.shadowdom.css +37 -0
- package/lib/components/Editor/tinymce/skins/ui/oxide-dark/skin.shadowdom.min.css +8 -0
- package/lib/components/Editor/tinymce/skins/ui/oxide-dark/skin.shadowdom.min.css.map +1 -0
- package/lib/components/Editor/tinymce/themes/mobile/theme.js +13587 -0
- package/lib/components/Editor/tinymce/themes/mobile/theme.min.js +9 -0
- package/lib/components/Editor/tinymce/themes/silver/theme.js +32480 -0
- package/lib/components/Editor/tinymce/themes/silver/theme.min.js +9 -0
- package/lib/components/Editor/tinymce/tinymce.d.ts +2963 -0
- package/lib/components/Editor/tinymce/tinymce.js +30106 -0
- package/lib/components/Editor/tinymce/tinymce.min.js +30106 -0
- package/lib/components/FilePreparer/FilePreparer.d.ts +26 -0
- package/lib/components/FilePreparer/FilePreparer.js +247 -0
- package/lib/components/FilePreparer/index.d.ts +2 -0
- package/lib/components/FilePreparer/index.js +1 -0
- package/lib/components/FileUploader/FileUploader.d.ts +9 -0
- package/lib/components/FileUploader/FileUploader.js +318 -0
- package/lib/components/FileUploader/index.d.ts +2 -0
- package/lib/components/FileUploader/index.js +1 -0
- package/lib/components/FormVisualizer/FormVisualizer.d.ts +92 -0
- package/lib/components/FormVisualizer/FormVisualizer.js +289 -0
- package/lib/components/FormVisualizer/index.d.ts +2 -0
- package/lib/components/FormVisualizer/index.js +1 -0
- package/lib/components/Highlight/Highlight.d.ts +7 -0
- package/lib/components/Highlight/Highlight.js +51 -0
- package/lib/components/Highlight/index.d.ts +2 -0
- package/lib/components/Highlight/index.js +1 -0
- package/lib/components/ImageResize/ImageResize.d.ts +28 -0
- package/lib/components/ImageResize/ImageResize.js +479 -0
- package/lib/components/ImageResize/index.d.ts +2 -0
- package/lib/components/ImageResize/index.js +1 -0
- package/lib/components/ImageResizeButton/ImageResizeButton.d.ts +26 -0
- package/lib/components/ImageResizeButton/ImageResizeButton.js +65 -0
- package/lib/components/ImageResizeButton/index.d.ts +2 -0
- package/lib/components/ImageResizeButton/index.js +1 -0
- package/lib/components/Input/Input.d.ts +8 -0
- package/lib/components/Input/Input.js +353 -0
- package/lib/components/Input/index.d.ts +2 -0
- package/lib/components/Input/index.js +1 -0
- package/lib/components/InputTags/InputTags.d.ts +8 -0
- package/lib/components/InputTags/InputTags.js +94 -0
- package/lib/components/InputTags/index.d.ts +2 -0
- package/lib/components/InputTags/index.js +1 -0
- package/lib/components/ListSelect/ListSelect.d.ts +8 -0
- package/lib/components/ListSelect/ListSelect.js +94 -0
- package/lib/components/ListSelect/index.d.ts +2 -0
- package/lib/components/ListSelect/index.js +1 -0
- package/lib/components/MaterialButton/MaterialButton.d.ts +13 -0
- package/lib/components/MaterialButton/MaterialButton.js +177 -0
- package/lib/components/MaterialButton/index.d.ts +2 -0
- package/lib/components/MaterialButton/index.js +1 -0
- package/lib/components/MenuBar/MenuBar.d.ts +8 -0
- package/lib/components/MenuBar/MenuBar.js +139 -0
- package/lib/components/MenuBar/index.d.ts +2 -0
- package/lib/components/MenuBar/index.js +1 -0
- package/lib/components/MonthPicker/MonthPicker.d.ts +8 -0
- package/lib/components/MonthPicker/MonthPicker.js +313 -0
- package/lib/components/MonthPicker/index.d.ts +2 -0
- package/lib/components/MonthPicker/index.js +1 -0
- package/lib/components/MultipleSelect/MultipleSelect.d.ts +8 -0
- package/lib/components/MultipleSelect/MultipleSelect.js +106 -0
- package/lib/components/MultipleSelect/index.d.ts +2 -0
- package/lib/components/MultipleSelect/index.js +1 -0
- package/lib/components/OtpInput/OtpInput.tsx +244 -0
- package/lib/components/OtpInput/index.d.ts +2 -0
- package/lib/components/OtpInput/index.js +1 -0
- package/lib/components/OutputText/OutputText.d.ts +8 -0
- package/lib/components/OutputText/OutputText.js +57 -0
- package/lib/components/OutputText/index.d.ts +2 -0
- package/lib/components/OutputText/index.js +1 -0
- package/lib/components/Pagination/Pagination.d.ts +8 -0
- package/lib/components/Pagination/Pagination.js +32 -0
- package/lib/components/Pagination/index.d.ts +2 -0
- package/lib/components/Pagination/index.js +1 -0
- package/lib/components/Programa/Programa.d.ts +31 -0
- package/lib/components/Programa/Programa.js +172 -0
- package/lib/components/Programa/index.d.ts +2 -0
- package/lib/components/Programa/index.js +1 -0
- package/lib/components/ProgressBar/ProgressBar.d.ts +8 -0
- package/lib/components/ProgressBar/ProgressBar.js +71 -0
- package/lib/components/ProgressBar/index.d.ts +2 -0
- package/lib/components/ProgressBar/index.js +1 -0
- package/lib/components/Select/Select.d.ts +8 -0
- package/lib/components/Select/Select.js +117 -0
- package/lib/components/Select/index.d.ts +2 -0
- package/lib/components/Select/index.js +1 -0
- package/lib/components/SimpleTable/SimpleTable.d.ts +13 -0
- package/lib/components/SimpleTable/SimpleTable.js +504 -0
- package/lib/components/SimpleTable/index.d.ts +2 -0
- package/lib/components/SimpleTable/index.js +2 -0
- package/lib/components/Stepper/Stepper.d.ts +54 -0
- package/lib/components/Stepper/Stepper.js +222 -0
- package/lib/components/Stepper/index.d.ts +2 -0
- package/lib/components/Stepper/index.js +1 -0
- package/lib/components/TablePicker/TablePicker.d.ts +8 -0
- package/lib/components/TablePicker/TablePicker.js +238 -0
- package/lib/components/TablePicker/index.d.ts +2 -0
- package/lib/components/TablePicker/index.js +1 -0
- package/lib/components/Tabs/Tabs.d.ts +8 -0
- package/lib/components/Tabs/Tabs.js +59 -0
- package/lib/components/Tabs/index.d.ts +2 -0
- package/lib/components/Tabs/index.js +1 -0
- package/lib/components/TextArea/TextArea.d.ts +8 -0
- package/lib/components/TextArea/TextArea.js +123 -0
- package/lib/components/TextArea/index.d.ts +2 -0
- package/lib/components/TextArea/index.js +1 -0
- package/lib/components/ThreadLog/ThreadLog.d.ts +8 -0
- package/lib/components/ThreadLog/ThreadLog.js +189 -0
- package/lib/components/ThreadLog/index.d.ts +2 -0
- package/lib/components/ThreadLog/index.js +1 -0
- package/lib/components/UtilAutoComplete/UtilAutoComplete.d.ts +93 -0
- package/lib/components/UtilAutoComplete/UtilAutoComplete.js +130 -0
- package/lib/components/UtilAutoComplete/index.d.ts +2 -0
- package/lib/components/UtilAutoComplete/index.js +1 -0
- package/lib/components/index.d.ts +148 -0
- package/lib/components/index.js +146 -0
- package/lib/fieldsRedux/createField.d.ts +8 -0
- package/lib/fieldsRedux/createField.js +120 -0
- package/lib/fieldsRedux/fieldsRedux.d.ts +71 -0
- package/lib/fieldsRedux/fieldsRedux.js +391 -0
- package/lib/fieldsRedux/index.d.ts +4 -0
- package/lib/fieldsRedux/index.js +5 -0
- package/lib/fieldsRedux/passFields.d.ts +5 -0
- package/lib/fieldsRedux/passFields.js +76 -0
- package/lib/reducers/argous.ts +103 -0
- package/lib/reducers/index.ts +6 -0
- package/lib/types.d.ts +144 -0
- package/lib/utils/api.ts +153 -0
- package/lib/utils/config.ts +12 -0
- package/lib/utils/date.ts +63 -0
- package/lib/utils/index.ts +314 -0
- package/lib/utils/rippleEffect.js +211 -0
- package/lib/utils/store.ts +11 -0
- package/lib/utils/xmlToJson.js +117 -0
- package/package.json +1 -1
- package/dist/components/ArgousComplexTableBody/dnd/Container.d.ts +0 -55
- package/dist/components/ArgousComplexTableBody/dnd/Container.js +0 -173
- package/dist/components/ArgousComplexTableBody/dnd/Draggable.d.ts +0 -14
- package/dist/components/ArgousComplexTableBody/dnd/Draggable.js +0 -73
- package/dist/components/ArgousComplexTableBody/dnd/index.d.ts +0 -2
- package/dist/components/ArgousComplexTableBody/dnd/index.js +0 -10
- package/dist/components/ConfirmModal/useModal.d.ts +0 -2
- package/dist/components/ConfirmModal/useModal.js +0 -9
- package/dist/components/DropArea/worker.d.ts +0 -1
- package/dist/components/DropArea/worker.js +0 -55
- package/dist/components/Editor/tinymce/icons/default/icons.d.ts +0 -0
- package/dist/components/Editor/tinymce/icons/default/icons.js +0 -173
- package/dist/components/Editor/tinymce/plugins/advlist/plugin.d.ts +0 -0
- package/dist/components/Editor/tinymce/plugins/advlist/plugin.js +0 -271
- package/dist/components/Editor/tinymce/plugins/anchor/plugin.d.ts +0 -0
- package/dist/components/Editor/tinymce/plugins/anchor/plugin.js +0 -207
- package/dist/components/Editor/tinymce/plugins/autolink/plugin.d.ts +0 -0
- package/dist/components/Editor/tinymce/plugins/autolink/plugin.js +0 -187
- package/dist/components/Editor/tinymce/plugins/autoresize/plugin.d.ts +0 -0
- package/dist/components/Editor/tinymce/plugins/autoresize/plugin.js +0 -163
- package/dist/components/Editor/tinymce/plugins/autosave/plugin.d.ts +0 -0
- package/dist/components/Editor/tinymce/plugins/autosave/plugin.js +0 -199
- package/dist/components/Editor/tinymce/plugins/bbcode/plugin.d.ts +0 -0
- package/dist/components/Editor/tinymce/plugins/bbcode/plugin.js +0 -94
- package/dist/components/Editor/tinymce/plugins/charmap/plugin.d.ts +0 -0
- package/dist/components/Editor/tinymce/plugins/charmap/plugin.js +0 -1691
- package/dist/components/Editor/tinymce/plugins/code/plugin.d.ts +0 -0
- package/dist/components/Editor/tinymce/plugins/code/plugin.js +0 -85
- package/dist/components/Editor/tinymce/plugins/codesample/plugin.js +0 -2331
- package/dist/components/Editor/tinymce/plugins/colorpicker/plugin.d.ts +0 -0
- package/dist/components/Editor/tinymce/plugins/contextmenu/plugin.d.ts +0 -0
- package/dist/components/Editor/tinymce/plugins/directionality/plugin.d.ts +0 -0
- package/dist/components/Editor/tinymce/plugins/directionality/plugin.js +0 -300
- package/dist/components/Editor/tinymce/plugins/emoticons/js/emojiimages.d.ts +0 -0
- package/dist/components/Editor/tinymce/plugins/emoticons/js/emojiimages.js +0 -9425
- package/dist/components/Editor/tinymce/plugins/emoticons/js/emojis.d.ts +0 -0
- package/dist/components/Editor/tinymce/plugins/emoticons/js/emojis.js +0 -9424
- package/dist/components/Editor/tinymce/plugins/emoticons/plugin.d.ts +0 -0
- package/dist/components/Editor/tinymce/plugins/emoticons/plugin.js +0 -585
- package/dist/components/Editor/tinymce/plugins/fullpage/plugin.d.ts +0 -0
- package/dist/components/Editor/tinymce/plugins/fullpage/plugin.js +0 -539
- package/dist/components/Editor/tinymce/plugins/fullscreen/plugin.d.ts +0 -0
- package/dist/components/Editor/tinymce/plugins/fullscreen/plugin.js +0 -962
- package/dist/components/Editor/tinymce/plugins/help/plugin.d.ts +0 -0
- package/dist/components/Editor/tinymce/plugins/help/plugin.js +0 -850
- package/dist/components/Editor/tinymce/plugins/hr/plugin.d.ts +0 -0
- package/dist/components/Editor/tinymce/plugins/hr/plugin.js +0 -41
- package/dist/components/Editor/tinymce/plugins/image/plugin.d.ts +0 -0
- package/dist/components/Editor/tinymce/plugins/image/plugin.js +0 -1673
- package/dist/components/Editor/tinymce/plugins/imagetools/plugin.d.ts +0 -0
- package/dist/components/Editor/tinymce/plugins/imagetools/plugin.js +0 -1335
- package/dist/components/Editor/tinymce/plugins/importcss/plugin.d.ts +0 -0
- package/dist/components/Editor/tinymce/plugins/importcss/plugin.js +0 -346
- package/dist/components/Editor/tinymce/plugins/insertdatetime/plugin.d.ts +0 -0
- package/dist/components/Editor/tinymce/plugins/insertdatetime/plugin.js +0 -171
- package/dist/components/Editor/tinymce/plugins/legacyoutput/plugin.d.ts +0 -0
- package/dist/components/Editor/tinymce/plugins/legacyoutput/plugin.js +0 -193
- package/dist/components/Editor/tinymce/plugins/link/plugin.d.ts +0 -0
- package/dist/components/Editor/tinymce/plugins/link/plugin.js +0 -1282
- package/dist/components/Editor/tinymce/plugins/lists/plugin.d.ts +0 -0
- package/dist/components/Editor/tinymce/plugins/lists/plugin.js +0 -2256
- package/dist/components/Editor/tinymce/plugins/media/plugin.d.ts +0 -0
- package/dist/components/Editor/tinymce/plugins/media/plugin.js +0 -1374
- package/dist/components/Editor/tinymce/plugins/nonbreaking/plugin.d.ts +0 -0
- package/dist/components/Editor/tinymce/plugins/nonbreaking/plugin.js +0 -93
- package/dist/components/Editor/tinymce/plugins/noneditable/plugin.d.ts +0 -0
- package/dist/components/Editor/tinymce/plugins/noneditable/plugin.js +0 -114
- package/dist/components/Editor/tinymce/plugins/pagebreak/plugin.d.ts +0 -0
- package/dist/components/Editor/tinymce/plugins/pagebreak/plugin.js +0 -96
- package/dist/components/Editor/tinymce/plugins/paste/plugin.d.ts +0 -0
- package/dist/components/Editor/tinymce/plugins/paste/plugin.js +0 -1747
- package/dist/components/Editor/tinymce/plugins/preview/plugin.d.ts +0 -0
- package/dist/components/Editor/tinymce/plugins/preview/plugin.js +0 -119
- package/dist/components/Editor/tinymce/plugins/print/plugin.d.ts +0 -0
- package/dist/components/Editor/tinymce/plugins/print/plugin.js +0 -48
- package/dist/components/Editor/tinymce/plugins/quickbars/plugin.d.ts +0 -0
- package/dist/components/Editor/tinymce/plugins/quickbars/plugin.js +0 -475
- package/dist/components/Editor/tinymce/plugins/save/plugin.d.ts +0 -0
- package/dist/components/Editor/tinymce/plugins/save/plugin.js +0 -112
- package/dist/components/Editor/tinymce/plugins/searchreplace/plugin.d.ts +0 -0
- package/dist/components/Editor/tinymce/plugins/searchreplace/plugin.js +0 -1149
- package/dist/components/Editor/tinymce/plugins/spellchecker/plugin.d.ts +0 -0
- package/dist/components/Editor/tinymce/plugins/spellchecker/plugin.js +0 -723
- package/dist/components/Editor/tinymce/plugins/tabfocus/plugin.d.ts +0 -0
- package/dist/components/Editor/tinymce/plugins/tabfocus/plugin.js +0 -124
- package/dist/components/Editor/tinymce/plugins/table/plugin.d.ts +0 -0
- package/dist/components/Editor/tinymce/plugins/table/plugin.js +0 -10853
- package/dist/components/Editor/tinymce/plugins/template/plugin.d.ts +0 -0
- package/dist/components/Editor/tinymce/plugins/template/plugin.js +0 -561
- package/dist/components/Editor/tinymce/plugins/textcolor/plugin.d.ts +0 -0
- package/dist/components/Editor/tinymce/plugins/textpattern/plugin.d.ts +0 -0
- package/dist/components/Editor/tinymce/plugins/textpattern/plugin.js +0 -1393
- package/dist/components/Editor/tinymce/plugins/toc/plugin.d.ts +0 -0
- package/dist/components/Editor/tinymce/plugins/toc/plugin.js +0 -227
- package/dist/components/Editor/tinymce/plugins/visualblocks/plugin.d.ts +0 -0
- package/dist/components/Editor/tinymce/plugins/visualblocks/plugin.js +0 -94
- package/dist/components/Editor/tinymce/plugins/visualchars/plugin.d.ts +0 -0
- package/dist/components/Editor/tinymce/plugins/visualchars/plugin.js +0 -521
- package/dist/components/Editor/tinymce/plugins/wordcount/plugin.d.ts +0 -0
- package/dist/components/Editor/tinymce/plugins/wordcount/plugin.js +0 -397
- package/dist/components/Editor/tinymce/themes/mobile/theme.js +0 -13348
- package/dist/components/Editor/tinymce/themes/silver/theme.js +0 -32028
- package/dist/components/Editor/tinymce/tinymce.js +0 -30486
- package/dist/components/FilePreparer/worker.d.ts +0 -2
- package/dist/components/FilePreparer/worker.js +0 -31
- package/dist/convertReacticons.d.ts +0 -1
- package/dist/convertReacticons.js +0 -62
- package/dist/utils/Fields.d.ts +0 -0
- package/dist/utils/Fields.js +0 -1
|
@@ -1,1335 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* Copyright (c) Tiny Technologies, Inc. All rights reserved.
|
|
4
|
-
* Licensed under the LGPL or a commercial license.
|
|
5
|
-
* For LGPL see License.txt in the project root for license information.
|
|
6
|
-
* For commercial licenses see https://www.tiny.cloud/
|
|
7
|
-
*
|
|
8
|
-
* Version: 5.9.0 (TBD)
|
|
9
|
-
*/
|
|
10
|
-
(function () {
|
|
11
|
-
'use strict';
|
|
12
|
-
var Cell = function (initial) {
|
|
13
|
-
var value = initial;
|
|
14
|
-
var get = function () {
|
|
15
|
-
return value;
|
|
16
|
-
};
|
|
17
|
-
var set = function (v) {
|
|
18
|
-
value = v;
|
|
19
|
-
};
|
|
20
|
-
return {
|
|
21
|
-
get: get,
|
|
22
|
-
set: set
|
|
23
|
-
};
|
|
24
|
-
};
|
|
25
|
-
var global = tinymce.util.Tools.resolve('tinymce.PluginManager');
|
|
26
|
-
var global$1 = tinymce.util.Tools.resolve('tinymce.util.Tools');
|
|
27
|
-
var isSimpleType = function (type) {
|
|
28
|
-
return function (value) {
|
|
29
|
-
return typeof value === type;
|
|
30
|
-
};
|
|
31
|
-
};
|
|
32
|
-
var isNullable = function (a) {
|
|
33
|
-
return a === null || a === undefined;
|
|
34
|
-
};
|
|
35
|
-
var isNonNullable = function (a) {
|
|
36
|
-
return !isNullable(a);
|
|
37
|
-
};
|
|
38
|
-
var isFunction = isSimpleType('function');
|
|
39
|
-
var noop = function () {
|
|
40
|
-
};
|
|
41
|
-
var constant = function (value) {
|
|
42
|
-
return function () {
|
|
43
|
-
return value;
|
|
44
|
-
};
|
|
45
|
-
};
|
|
46
|
-
var never = constant(false);
|
|
47
|
-
var always = constant(true);
|
|
48
|
-
var none = function () {
|
|
49
|
-
return NONE;
|
|
50
|
-
};
|
|
51
|
-
var NONE = function () {
|
|
52
|
-
var eq = function (o) {
|
|
53
|
-
return o.isNone();
|
|
54
|
-
};
|
|
55
|
-
var call = function (thunk) {
|
|
56
|
-
return thunk();
|
|
57
|
-
};
|
|
58
|
-
var id = function (n) {
|
|
59
|
-
return n;
|
|
60
|
-
};
|
|
61
|
-
var me = {
|
|
62
|
-
fold: function (n, _s) {
|
|
63
|
-
return n();
|
|
64
|
-
},
|
|
65
|
-
is: never,
|
|
66
|
-
isSome: never,
|
|
67
|
-
isNone: always,
|
|
68
|
-
getOr: id,
|
|
69
|
-
getOrThunk: call,
|
|
70
|
-
getOrDie: function (msg) {
|
|
71
|
-
throw new Error(msg || 'error: getOrDie called on none.');
|
|
72
|
-
},
|
|
73
|
-
getOrNull: constant(null),
|
|
74
|
-
getOrUndefined: constant(undefined),
|
|
75
|
-
or: id,
|
|
76
|
-
orThunk: call,
|
|
77
|
-
map: none,
|
|
78
|
-
each: noop,
|
|
79
|
-
bind: none,
|
|
80
|
-
exists: never,
|
|
81
|
-
forall: always,
|
|
82
|
-
filter: none,
|
|
83
|
-
equals: eq,
|
|
84
|
-
equals_: eq,
|
|
85
|
-
toArray: function () {
|
|
86
|
-
return [];
|
|
87
|
-
},
|
|
88
|
-
toString: constant('none()')
|
|
89
|
-
};
|
|
90
|
-
return me;
|
|
91
|
-
}();
|
|
92
|
-
var some = function (a) {
|
|
93
|
-
var constant_a = constant(a);
|
|
94
|
-
var self = function () {
|
|
95
|
-
return me;
|
|
96
|
-
};
|
|
97
|
-
var bind = function (f) {
|
|
98
|
-
return f(a);
|
|
99
|
-
};
|
|
100
|
-
var me = {
|
|
101
|
-
fold: function (n, s) {
|
|
102
|
-
return s(a);
|
|
103
|
-
},
|
|
104
|
-
is: function (v) {
|
|
105
|
-
return a === v;
|
|
106
|
-
},
|
|
107
|
-
isSome: always,
|
|
108
|
-
isNone: never,
|
|
109
|
-
getOr: constant_a,
|
|
110
|
-
getOrThunk: constant_a,
|
|
111
|
-
getOrDie: constant_a,
|
|
112
|
-
getOrNull: constant_a,
|
|
113
|
-
getOrUndefined: constant_a,
|
|
114
|
-
or: self,
|
|
115
|
-
orThunk: self,
|
|
116
|
-
map: function (f) {
|
|
117
|
-
return some(f(a));
|
|
118
|
-
},
|
|
119
|
-
each: function (f) {
|
|
120
|
-
f(a);
|
|
121
|
-
},
|
|
122
|
-
bind: bind,
|
|
123
|
-
exists: bind,
|
|
124
|
-
forall: bind,
|
|
125
|
-
filter: function (f) {
|
|
126
|
-
return f(a) ? me : NONE;
|
|
127
|
-
},
|
|
128
|
-
toArray: function () {
|
|
129
|
-
return [a];
|
|
130
|
-
},
|
|
131
|
-
toString: function () {
|
|
132
|
-
return 'some(' + a + ')';
|
|
133
|
-
},
|
|
134
|
-
equals: function (o) {
|
|
135
|
-
return o.is(a);
|
|
136
|
-
},
|
|
137
|
-
equals_: function (o, elementEq) {
|
|
138
|
-
return o.fold(never, function (b) {
|
|
139
|
-
return elementEq(a, b);
|
|
140
|
-
});
|
|
141
|
-
}
|
|
142
|
-
};
|
|
143
|
-
return me;
|
|
144
|
-
};
|
|
145
|
-
var from = function (value) {
|
|
146
|
-
return value === null || value === undefined ? NONE : some(value);
|
|
147
|
-
};
|
|
148
|
-
var Optional = {
|
|
149
|
-
some: some,
|
|
150
|
-
none: none,
|
|
151
|
-
from: from
|
|
152
|
-
};
|
|
153
|
-
var create = function (width, height) {
|
|
154
|
-
return resize(document.createElement('canvas'), width, height);
|
|
155
|
-
};
|
|
156
|
-
var clone = function (canvas) {
|
|
157
|
-
var tCanvas = create(canvas.width, canvas.height);
|
|
158
|
-
var ctx = get2dContext(tCanvas);
|
|
159
|
-
ctx.drawImage(canvas, 0, 0);
|
|
160
|
-
return tCanvas;
|
|
161
|
-
};
|
|
162
|
-
var get2dContext = function (canvas) {
|
|
163
|
-
return canvas.getContext('2d');
|
|
164
|
-
};
|
|
165
|
-
var resize = function (canvas, width, height) {
|
|
166
|
-
canvas.width = width;
|
|
167
|
-
canvas.height = height;
|
|
168
|
-
return canvas;
|
|
169
|
-
};
|
|
170
|
-
var getWidth = function (image) {
|
|
171
|
-
return image.naturalWidth || image.width;
|
|
172
|
-
};
|
|
173
|
-
var getHeight = function (image) {
|
|
174
|
-
return image.naturalHeight || image.height;
|
|
175
|
-
};
|
|
176
|
-
var promise = function () {
|
|
177
|
-
var Promise = function (fn) {
|
|
178
|
-
if (typeof this !== 'object') {
|
|
179
|
-
throw new TypeError('Promises must be constructed via new');
|
|
180
|
-
}
|
|
181
|
-
if (typeof fn !== 'function') {
|
|
182
|
-
throw new TypeError('not a function');
|
|
183
|
-
}
|
|
184
|
-
this._state = null;
|
|
185
|
-
this._value = null;
|
|
186
|
-
this._deferreds = [];
|
|
187
|
-
doResolve(fn, bind(resolve, this), bind(reject, this));
|
|
188
|
-
};
|
|
189
|
-
var anyWindow = window;
|
|
190
|
-
var asap = Promise.immediateFn || typeof anyWindow.setImmediate === 'function' && anyWindow.setImmediate || function (fn) {
|
|
191
|
-
return setTimeout(fn, 1);
|
|
192
|
-
};
|
|
193
|
-
var bind = function (fn, thisArg) {
|
|
194
|
-
return function () {
|
|
195
|
-
var args = [];
|
|
196
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
197
|
-
args[_i] = arguments[_i];
|
|
198
|
-
}
|
|
199
|
-
return fn.apply(thisArg, args);
|
|
200
|
-
};
|
|
201
|
-
};
|
|
202
|
-
var isArray = Array.isArray || function (value) {
|
|
203
|
-
return Object.prototype.toString.call(value) === '[object Array]';
|
|
204
|
-
};
|
|
205
|
-
function handle(deferred) {
|
|
206
|
-
var me = this;
|
|
207
|
-
if (this._state === null) {
|
|
208
|
-
this._deferreds.push(deferred);
|
|
209
|
-
return;
|
|
210
|
-
}
|
|
211
|
-
asap(function () {
|
|
212
|
-
var cb = me._state ? deferred.onFulfilled : deferred.onRejected;
|
|
213
|
-
if (cb === null) {
|
|
214
|
-
(me._state ? deferred.resolve : deferred.reject)(me._value);
|
|
215
|
-
return;
|
|
216
|
-
}
|
|
217
|
-
var ret;
|
|
218
|
-
try {
|
|
219
|
-
ret = cb(me._value);
|
|
220
|
-
}
|
|
221
|
-
catch (e) {
|
|
222
|
-
deferred.reject(e);
|
|
223
|
-
return;
|
|
224
|
-
}
|
|
225
|
-
deferred.resolve(ret);
|
|
226
|
-
});
|
|
227
|
-
}
|
|
228
|
-
function resolve(newValue) {
|
|
229
|
-
try {
|
|
230
|
-
if (newValue === this) {
|
|
231
|
-
throw new TypeError('A promise cannot be resolved with itself.');
|
|
232
|
-
}
|
|
233
|
-
if (newValue && (typeof newValue === 'object' || typeof newValue === 'function')) {
|
|
234
|
-
var then = newValue.then;
|
|
235
|
-
if (typeof then === 'function') {
|
|
236
|
-
doResolve(bind(then, newValue), bind(resolve, this), bind(reject, this));
|
|
237
|
-
return;
|
|
238
|
-
}
|
|
239
|
-
}
|
|
240
|
-
this._state = true;
|
|
241
|
-
this._value = newValue;
|
|
242
|
-
finale.call(this);
|
|
243
|
-
}
|
|
244
|
-
catch (e) {
|
|
245
|
-
reject.call(this, e);
|
|
246
|
-
}
|
|
247
|
-
}
|
|
248
|
-
function reject(newValue) {
|
|
249
|
-
this._state = false;
|
|
250
|
-
this._value = newValue;
|
|
251
|
-
finale.call(this);
|
|
252
|
-
}
|
|
253
|
-
function finale() {
|
|
254
|
-
for (var _i = 0, _a = this._deferreds; _i < _a.length; _i++) {
|
|
255
|
-
var deferred = _a[_i];
|
|
256
|
-
handle.call(this, deferred);
|
|
257
|
-
}
|
|
258
|
-
this._deferreds = [];
|
|
259
|
-
}
|
|
260
|
-
function Handler(onFulfilled, onRejected, resolve, reject) {
|
|
261
|
-
this.onFulfilled = typeof onFulfilled === 'function' ? onFulfilled : null;
|
|
262
|
-
this.onRejected = typeof onRejected === 'function' ? onRejected : null;
|
|
263
|
-
this.resolve = resolve;
|
|
264
|
-
this.reject = reject;
|
|
265
|
-
}
|
|
266
|
-
var doResolve = function (fn, onFulfilled, onRejected) {
|
|
267
|
-
var done = false;
|
|
268
|
-
try {
|
|
269
|
-
fn(function (value) {
|
|
270
|
-
if (done) {
|
|
271
|
-
return;
|
|
272
|
-
}
|
|
273
|
-
done = true;
|
|
274
|
-
onFulfilled(value);
|
|
275
|
-
}, function (reason) {
|
|
276
|
-
if (done) {
|
|
277
|
-
return;
|
|
278
|
-
}
|
|
279
|
-
done = true;
|
|
280
|
-
onRejected(reason);
|
|
281
|
-
});
|
|
282
|
-
}
|
|
283
|
-
catch (ex) {
|
|
284
|
-
if (done) {
|
|
285
|
-
return;
|
|
286
|
-
}
|
|
287
|
-
done = true;
|
|
288
|
-
onRejected(ex);
|
|
289
|
-
}
|
|
290
|
-
};
|
|
291
|
-
Promise.prototype.catch = function (onRejected) {
|
|
292
|
-
return this.then(null, onRejected);
|
|
293
|
-
};
|
|
294
|
-
Promise.prototype.then = function (onFulfilled, onRejected) {
|
|
295
|
-
var me = this;
|
|
296
|
-
return new Promise(function (resolve, reject) {
|
|
297
|
-
handle.call(me, new Handler(onFulfilled, onRejected, resolve, reject));
|
|
298
|
-
});
|
|
299
|
-
};
|
|
300
|
-
Promise.all = function () {
|
|
301
|
-
var values = [];
|
|
302
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
303
|
-
values[_i] = arguments[_i];
|
|
304
|
-
}
|
|
305
|
-
var args = Array.prototype.slice.call(values.length === 1 && isArray(values[0]) ? values[0] : values);
|
|
306
|
-
return new Promise(function (resolve, reject) {
|
|
307
|
-
if (args.length === 0) {
|
|
308
|
-
return resolve([]);
|
|
309
|
-
}
|
|
310
|
-
var remaining = args.length;
|
|
311
|
-
var res = function (i, val) {
|
|
312
|
-
try {
|
|
313
|
-
if (val && (typeof val === 'object' || typeof val === 'function')) {
|
|
314
|
-
var then = val.then;
|
|
315
|
-
if (typeof then === 'function') {
|
|
316
|
-
then.call(val, function (val) {
|
|
317
|
-
res(i, val);
|
|
318
|
-
}, reject);
|
|
319
|
-
return;
|
|
320
|
-
}
|
|
321
|
-
}
|
|
322
|
-
args[i] = val;
|
|
323
|
-
if (--remaining === 0) {
|
|
324
|
-
resolve(args);
|
|
325
|
-
}
|
|
326
|
-
}
|
|
327
|
-
catch (ex) {
|
|
328
|
-
reject(ex);
|
|
329
|
-
}
|
|
330
|
-
};
|
|
331
|
-
for (var i = 0; i < args.length; i++) {
|
|
332
|
-
res(i, args[i]);
|
|
333
|
-
}
|
|
334
|
-
});
|
|
335
|
-
};
|
|
336
|
-
Promise.resolve = function (value) {
|
|
337
|
-
if (value && typeof value === 'object' && value.constructor === Promise) {
|
|
338
|
-
return value;
|
|
339
|
-
}
|
|
340
|
-
return new Promise(function (resolve) {
|
|
341
|
-
resolve(value);
|
|
342
|
-
});
|
|
343
|
-
};
|
|
344
|
-
Promise.reject = function (reason) {
|
|
345
|
-
return new Promise(function (resolve, reject) {
|
|
346
|
-
reject(reason);
|
|
347
|
-
});
|
|
348
|
-
};
|
|
349
|
-
Promise.race = function (values) {
|
|
350
|
-
return new Promise(function (resolve, reject) {
|
|
351
|
-
for (var _i = 0, values_1 = values; _i < values_1.length; _i++) {
|
|
352
|
-
var value = values_1[_i];
|
|
353
|
-
value.then(resolve, reject);
|
|
354
|
-
}
|
|
355
|
-
});
|
|
356
|
-
};
|
|
357
|
-
return Promise;
|
|
358
|
-
};
|
|
359
|
-
var Promise = window.Promise ? window.Promise : promise();
|
|
360
|
-
var imageToBlob = function (image) {
|
|
361
|
-
var src = image.src;
|
|
362
|
-
if (src.indexOf('data:') === 0) {
|
|
363
|
-
return dataUriToBlob(src);
|
|
364
|
-
}
|
|
365
|
-
return anyUriToBlob(src);
|
|
366
|
-
};
|
|
367
|
-
var blobToImage = function (blob) {
|
|
368
|
-
return new Promise(function (resolve, reject) {
|
|
369
|
-
var blobUrl = URL.createObjectURL(blob);
|
|
370
|
-
var image = new Image();
|
|
371
|
-
var removeListeners = function () {
|
|
372
|
-
image.removeEventListener('load', loaded);
|
|
373
|
-
image.removeEventListener('error', error);
|
|
374
|
-
};
|
|
375
|
-
var loaded = function () {
|
|
376
|
-
removeListeners();
|
|
377
|
-
resolve(image);
|
|
378
|
-
};
|
|
379
|
-
var error = function () {
|
|
380
|
-
removeListeners();
|
|
381
|
-
reject('Unable to load data of type ' + blob.type + ': ' + blobUrl);
|
|
382
|
-
};
|
|
383
|
-
image.addEventListener('load', loaded);
|
|
384
|
-
image.addEventListener('error', error);
|
|
385
|
-
image.src = blobUrl;
|
|
386
|
-
if (image.complete) {
|
|
387
|
-
setTimeout(loaded, 0);
|
|
388
|
-
}
|
|
389
|
-
});
|
|
390
|
-
};
|
|
391
|
-
var anyUriToBlob = function (url) {
|
|
392
|
-
return new Promise(function (resolve, reject) {
|
|
393
|
-
var xhr = new XMLHttpRequest();
|
|
394
|
-
xhr.open('GET', url, true);
|
|
395
|
-
xhr.responseType = 'blob';
|
|
396
|
-
xhr.onload = function () {
|
|
397
|
-
if (this.status === 200) {
|
|
398
|
-
resolve(this.response);
|
|
399
|
-
}
|
|
400
|
-
};
|
|
401
|
-
xhr.onerror = function () {
|
|
402
|
-
var _this = this;
|
|
403
|
-
var corsError = function () {
|
|
404
|
-
var obj = new Error('No access to download image');
|
|
405
|
-
obj.code = 18;
|
|
406
|
-
obj.name = 'SecurityError';
|
|
407
|
-
return obj;
|
|
408
|
-
};
|
|
409
|
-
var genericError = function () {
|
|
410
|
-
return new Error('Error ' + _this.status + ' downloading image');
|
|
411
|
-
};
|
|
412
|
-
reject(this.status === 0 ? corsError() : genericError());
|
|
413
|
-
};
|
|
414
|
-
xhr.send();
|
|
415
|
-
});
|
|
416
|
-
};
|
|
417
|
-
var dataUriToBlobSync = function (uri) {
|
|
418
|
-
var data = uri.split(',');
|
|
419
|
-
var matches = /data:([^;]+)/.exec(data[0]);
|
|
420
|
-
if (!matches) {
|
|
421
|
-
return Optional.none();
|
|
422
|
-
}
|
|
423
|
-
var mimetype = matches[1];
|
|
424
|
-
var base64 = data[1];
|
|
425
|
-
var sliceSize = 1024;
|
|
426
|
-
var byteCharacters = atob(base64);
|
|
427
|
-
var bytesLength = byteCharacters.length;
|
|
428
|
-
var slicesCount = Math.ceil(bytesLength / sliceSize);
|
|
429
|
-
var byteArrays = new Array(slicesCount);
|
|
430
|
-
for (var sliceIndex = 0; sliceIndex < slicesCount; ++sliceIndex) {
|
|
431
|
-
var begin = sliceIndex * sliceSize;
|
|
432
|
-
var end = Math.min(begin + sliceSize, bytesLength);
|
|
433
|
-
var bytes = new Array(end - begin);
|
|
434
|
-
for (var offset = begin, i = 0; offset < end; ++i, ++offset) {
|
|
435
|
-
bytes[i] = byteCharacters[offset].charCodeAt(0);
|
|
436
|
-
}
|
|
437
|
-
byteArrays[sliceIndex] = new Uint8Array(bytes);
|
|
438
|
-
}
|
|
439
|
-
return Optional.some(new Blob(byteArrays, { type: mimetype }));
|
|
440
|
-
};
|
|
441
|
-
var dataUriToBlob = function (uri) {
|
|
442
|
-
return new Promise(function (resolve, reject) {
|
|
443
|
-
dataUriToBlobSync(uri).fold(function () {
|
|
444
|
-
reject('uri is not base64: ' + uri);
|
|
445
|
-
}, resolve);
|
|
446
|
-
});
|
|
447
|
-
};
|
|
448
|
-
var canvasToBlob = function (canvas, type, quality) {
|
|
449
|
-
type = type || 'image/png';
|
|
450
|
-
if (isFunction(HTMLCanvasElement.prototype.toBlob)) {
|
|
451
|
-
return new Promise(function (resolve, reject) {
|
|
452
|
-
canvas.toBlob(function (blob) {
|
|
453
|
-
if (blob) {
|
|
454
|
-
resolve(blob);
|
|
455
|
-
}
|
|
456
|
-
else {
|
|
457
|
-
reject();
|
|
458
|
-
}
|
|
459
|
-
}, type, quality);
|
|
460
|
-
});
|
|
461
|
-
}
|
|
462
|
-
else {
|
|
463
|
-
return dataUriToBlob(canvas.toDataURL(type, quality));
|
|
464
|
-
}
|
|
465
|
-
};
|
|
466
|
-
var canvasToDataURL = function (canvas, type, quality) {
|
|
467
|
-
type = type || 'image/png';
|
|
468
|
-
return canvas.toDataURL(type, quality);
|
|
469
|
-
};
|
|
470
|
-
var blobToCanvas = function (blob) {
|
|
471
|
-
return blobToImage(blob).then(function (image) {
|
|
472
|
-
revokeImageUrl(image);
|
|
473
|
-
var canvas = create(getWidth(image), getHeight(image));
|
|
474
|
-
var context = get2dContext(canvas);
|
|
475
|
-
context.drawImage(image, 0, 0);
|
|
476
|
-
return canvas;
|
|
477
|
-
});
|
|
478
|
-
};
|
|
479
|
-
var blobToDataUri = function (blob) {
|
|
480
|
-
return new Promise(function (resolve) {
|
|
481
|
-
var reader = new FileReader();
|
|
482
|
-
reader.onloadend = function () {
|
|
483
|
-
resolve(reader.result);
|
|
484
|
-
};
|
|
485
|
-
reader.readAsDataURL(blob);
|
|
486
|
-
});
|
|
487
|
-
};
|
|
488
|
-
var revokeImageUrl = function (image) {
|
|
489
|
-
URL.revokeObjectURL(image.src);
|
|
490
|
-
};
|
|
491
|
-
var blobToImage$1 = function (blob) {
|
|
492
|
-
return blobToImage(blob);
|
|
493
|
-
};
|
|
494
|
-
var imageToBlob$1 = function (image) {
|
|
495
|
-
return imageToBlob(image);
|
|
496
|
-
};
|
|
497
|
-
var each = function (xs, f) {
|
|
498
|
-
for (var i = 0, len = xs.length; i < len; i++) {
|
|
499
|
-
var x = xs[i];
|
|
500
|
-
f(x, i);
|
|
501
|
-
}
|
|
502
|
-
};
|
|
503
|
-
var foldl = function (xs, f, acc) {
|
|
504
|
-
each(xs, function (x) {
|
|
505
|
-
acc = f(acc, x);
|
|
506
|
-
});
|
|
507
|
-
return acc;
|
|
508
|
-
};
|
|
509
|
-
var findUntil = function (xs, pred, until) {
|
|
510
|
-
for (var i = 0, len = xs.length; i < len; i++) {
|
|
511
|
-
var x = xs[i];
|
|
512
|
-
if (pred(x, i)) {
|
|
513
|
-
return Optional.some(x);
|
|
514
|
-
}
|
|
515
|
-
else if (until(x, i)) {
|
|
516
|
-
break;
|
|
517
|
-
}
|
|
518
|
-
}
|
|
519
|
-
return Optional.none();
|
|
520
|
-
};
|
|
521
|
-
var find = function (xs, pred) {
|
|
522
|
-
return findUntil(xs, pred, never);
|
|
523
|
-
};
|
|
524
|
-
var create$1 = function (getCanvas, blob, uri) {
|
|
525
|
-
var initialType = blob.type;
|
|
526
|
-
var getType = constant(initialType);
|
|
527
|
-
var toBlob = function () {
|
|
528
|
-
return Promise.resolve(blob);
|
|
529
|
-
};
|
|
530
|
-
var toDataURL = constant(uri);
|
|
531
|
-
var toBase64 = function () {
|
|
532
|
-
return uri.split(',')[1];
|
|
533
|
-
};
|
|
534
|
-
var toAdjustedBlob = function (type, quality) {
|
|
535
|
-
return getCanvas.then(function (canvas) {
|
|
536
|
-
return canvasToBlob(canvas, type, quality);
|
|
537
|
-
});
|
|
538
|
-
};
|
|
539
|
-
var toAdjustedDataURL = function (type, quality) {
|
|
540
|
-
return getCanvas.then(function (canvas) {
|
|
541
|
-
return canvasToDataURL(canvas, type, quality);
|
|
542
|
-
});
|
|
543
|
-
};
|
|
544
|
-
var toAdjustedBase64 = function (type, quality) {
|
|
545
|
-
return toAdjustedDataURL(type, quality).then(function (dataurl) {
|
|
546
|
-
return dataurl.split(',')[1];
|
|
547
|
-
});
|
|
548
|
-
};
|
|
549
|
-
var toCanvas = function () {
|
|
550
|
-
return getCanvas.then(clone);
|
|
551
|
-
};
|
|
552
|
-
return {
|
|
553
|
-
getType: getType,
|
|
554
|
-
toBlob: toBlob,
|
|
555
|
-
toDataURL: toDataURL,
|
|
556
|
-
toBase64: toBase64,
|
|
557
|
-
toAdjustedBlob: toAdjustedBlob,
|
|
558
|
-
toAdjustedDataURL: toAdjustedDataURL,
|
|
559
|
-
toAdjustedBase64: toAdjustedBase64,
|
|
560
|
-
toCanvas: toCanvas
|
|
561
|
-
};
|
|
562
|
-
};
|
|
563
|
-
var fromBlob = function (blob) {
|
|
564
|
-
return blobToDataUri(blob).then(function (uri) {
|
|
565
|
-
return create$1(blobToCanvas(blob), blob, uri);
|
|
566
|
-
});
|
|
567
|
-
};
|
|
568
|
-
var fromCanvas = function (canvas, type) {
|
|
569
|
-
return canvasToBlob(canvas, type).then(function (blob) {
|
|
570
|
-
return create$1(Promise.resolve(canvas), blob, canvas.toDataURL());
|
|
571
|
-
});
|
|
572
|
-
};
|
|
573
|
-
var ceilWithPrecision = function (num, precision) {
|
|
574
|
-
if (precision === void 0) {
|
|
575
|
-
precision = 2;
|
|
576
|
-
}
|
|
577
|
-
var mul = Math.pow(10, precision);
|
|
578
|
-
var upper = Math.round(num * mul);
|
|
579
|
-
return Math.ceil(upper / mul);
|
|
580
|
-
};
|
|
581
|
-
var rotate = function (ir, angle) {
|
|
582
|
-
return ir.toCanvas().then(function (canvas) {
|
|
583
|
-
return applyRotate(canvas, ir.getType(), angle);
|
|
584
|
-
});
|
|
585
|
-
};
|
|
586
|
-
var applyRotate = function (image, type, angle) {
|
|
587
|
-
var degrees = angle < 0 ? 360 + angle : angle;
|
|
588
|
-
var rad = degrees * Math.PI / 180;
|
|
589
|
-
var width = image.width;
|
|
590
|
-
var height = image.height;
|
|
591
|
-
var sin = Math.sin(rad);
|
|
592
|
-
var cos = Math.cos(rad);
|
|
593
|
-
var newWidth = ceilWithPrecision(Math.abs(width * cos) + Math.abs(height * sin));
|
|
594
|
-
var newHeight = ceilWithPrecision(Math.abs(width * sin) + Math.abs(height * cos));
|
|
595
|
-
var canvas = create(newWidth, newHeight);
|
|
596
|
-
var context = get2dContext(canvas);
|
|
597
|
-
context.translate(newWidth / 2, newHeight / 2);
|
|
598
|
-
context.rotate(rad);
|
|
599
|
-
context.drawImage(image, -width / 2, -height / 2);
|
|
600
|
-
return fromCanvas(canvas, type);
|
|
601
|
-
};
|
|
602
|
-
var flip = function (ir, axis) {
|
|
603
|
-
return ir.toCanvas().then(function (canvas) {
|
|
604
|
-
return applyFlip(canvas, ir.getType(), axis);
|
|
605
|
-
});
|
|
606
|
-
};
|
|
607
|
-
var applyFlip = function (image, type, axis) {
|
|
608
|
-
var canvas = create(image.width, image.height);
|
|
609
|
-
var context = get2dContext(canvas);
|
|
610
|
-
if (axis === 'v') {
|
|
611
|
-
context.scale(1, -1);
|
|
612
|
-
context.drawImage(image, 0, -canvas.height);
|
|
613
|
-
}
|
|
614
|
-
else {
|
|
615
|
-
context.scale(-1, 1);
|
|
616
|
-
context.drawImage(image, -canvas.width, 0);
|
|
617
|
-
}
|
|
618
|
-
return fromCanvas(canvas, type);
|
|
619
|
-
};
|
|
620
|
-
var flip$1 = function (ir, axis) {
|
|
621
|
-
return flip(ir, axis);
|
|
622
|
-
};
|
|
623
|
-
var rotate$1 = function (ir, angle) {
|
|
624
|
-
return rotate(ir, angle);
|
|
625
|
-
};
|
|
626
|
-
var keys = Object.keys;
|
|
627
|
-
var each$1 = function (obj, f) {
|
|
628
|
-
var props = keys(obj);
|
|
629
|
-
for (var k = 0, len = props.length; k < len; k++) {
|
|
630
|
-
var i = props[k];
|
|
631
|
-
var x = obj[i];
|
|
632
|
-
f(x, i);
|
|
633
|
-
}
|
|
634
|
-
};
|
|
635
|
-
var sendRequest = function (url, headers, withCredentials) {
|
|
636
|
-
if (withCredentials === void 0) {
|
|
637
|
-
withCredentials = false;
|
|
638
|
-
}
|
|
639
|
-
return new Promise(function (resolve) {
|
|
640
|
-
var xhr = new XMLHttpRequest();
|
|
641
|
-
xhr.onreadystatechange = function () {
|
|
642
|
-
if (xhr.readyState === 4) {
|
|
643
|
-
resolve({
|
|
644
|
-
status: xhr.status,
|
|
645
|
-
blob: xhr.response
|
|
646
|
-
});
|
|
647
|
-
}
|
|
648
|
-
};
|
|
649
|
-
xhr.open('GET', url, true);
|
|
650
|
-
xhr.withCredentials = withCredentials;
|
|
651
|
-
each$1(headers, function (value, key) {
|
|
652
|
-
xhr.setRequestHeader(key, value);
|
|
653
|
-
});
|
|
654
|
-
xhr.responseType = 'blob';
|
|
655
|
-
xhr.send();
|
|
656
|
-
});
|
|
657
|
-
};
|
|
658
|
-
var readBlobText = function (blob) {
|
|
659
|
-
return new Promise(function (resolve, reject) {
|
|
660
|
-
var reader = new FileReader();
|
|
661
|
-
reader.onload = function () {
|
|
662
|
-
resolve(reader.result);
|
|
663
|
-
};
|
|
664
|
-
reader.onerror = function (e) {
|
|
665
|
-
reject(e);
|
|
666
|
-
};
|
|
667
|
-
reader.readAsText(blob);
|
|
668
|
-
});
|
|
669
|
-
};
|
|
670
|
-
var parseJson = function (text) {
|
|
671
|
-
try {
|
|
672
|
-
return Optional.some(JSON.parse(text));
|
|
673
|
-
}
|
|
674
|
-
catch (ex) {
|
|
675
|
-
return Optional.none();
|
|
676
|
-
}
|
|
677
|
-
};
|
|
678
|
-
var friendlyHttpErrors = [
|
|
679
|
-
{
|
|
680
|
-
code: 404,
|
|
681
|
-
message: 'Could not find Image Proxy'
|
|
682
|
-
},
|
|
683
|
-
{
|
|
684
|
-
code: 403,
|
|
685
|
-
message: 'Rejected request'
|
|
686
|
-
},
|
|
687
|
-
{
|
|
688
|
-
code: 0,
|
|
689
|
-
message: 'Incorrect Image Proxy URL'
|
|
690
|
-
}
|
|
691
|
-
];
|
|
692
|
-
var friendlyServiceErrors = [
|
|
693
|
-
{
|
|
694
|
-
type: 'not_found',
|
|
695
|
-
message: 'Failed to load image.'
|
|
696
|
-
},
|
|
697
|
-
{
|
|
698
|
-
type: 'key_missing',
|
|
699
|
-
message: 'The request did not include an api key.'
|
|
700
|
-
},
|
|
701
|
-
{
|
|
702
|
-
type: 'key_not_found',
|
|
703
|
-
message: 'The provided api key could not be found.'
|
|
704
|
-
},
|
|
705
|
-
{
|
|
706
|
-
type: 'domain_not_trusted',
|
|
707
|
-
message: 'The api key is not valid for the request origins.'
|
|
708
|
-
}
|
|
709
|
-
];
|
|
710
|
-
var traverseJson = function (json, path) {
|
|
711
|
-
var value = foldl(path, function (result, key) {
|
|
712
|
-
return isNonNullable(result) ? result[key] : undefined;
|
|
713
|
-
}, json);
|
|
714
|
-
return Optional.from(value);
|
|
715
|
-
};
|
|
716
|
-
var isServiceErrorCode = function (code, blob) {
|
|
717
|
-
return (blob === null || blob === void 0 ? void 0 : blob.type) === 'application/json' && (code === 400 || code === 403 || code === 404 || code === 500);
|
|
718
|
-
};
|
|
719
|
-
var getHttpErrorMsg = function (status) {
|
|
720
|
-
var message = find(friendlyHttpErrors, function (error) {
|
|
721
|
-
return status === error.code;
|
|
722
|
-
}).fold(constant('Unknown ImageProxy error'), function (error) {
|
|
723
|
-
return error.message;
|
|
724
|
-
});
|
|
725
|
-
return 'ImageProxy HTTP error: ' + message;
|
|
726
|
-
};
|
|
727
|
-
var handleHttpError = function (status) {
|
|
728
|
-
var message = getHttpErrorMsg(status);
|
|
729
|
-
return Promise.reject(message);
|
|
730
|
-
};
|
|
731
|
-
var getServiceErrorMsg = function (type) {
|
|
732
|
-
return find(friendlyServiceErrors, function (error) {
|
|
733
|
-
return error.type === type;
|
|
734
|
-
}).fold(constant('Unknown service error'), function (error) {
|
|
735
|
-
return error.message;
|
|
736
|
-
});
|
|
737
|
-
};
|
|
738
|
-
var getServiceError = function (text) {
|
|
739
|
-
var serviceError = parseJson(text);
|
|
740
|
-
var errorMsg = serviceError.bind(function (err) {
|
|
741
|
-
return traverseJson(err, [
|
|
742
|
-
'error',
|
|
743
|
-
'type'
|
|
744
|
-
]).map(getServiceErrorMsg);
|
|
745
|
-
}).getOr('Invalid JSON in service error message');
|
|
746
|
-
return 'ImageProxy Service error: ' + errorMsg;
|
|
747
|
-
};
|
|
748
|
-
var handleServiceError = function (blob) {
|
|
749
|
-
return readBlobText(blob).then(function (text) {
|
|
750
|
-
var serviceError = getServiceError(text);
|
|
751
|
-
return Promise.reject(serviceError);
|
|
752
|
-
});
|
|
753
|
-
};
|
|
754
|
-
var handleServiceErrorResponse = function (status, blob) {
|
|
755
|
-
return isServiceErrorCode(status, blob) ? handleServiceError(blob) : handleHttpError(status);
|
|
756
|
-
};
|
|
757
|
-
var appendApiKey = function (url, apiKey) {
|
|
758
|
-
var separator = url.indexOf('?') === -1 ? '?' : '&';
|
|
759
|
-
if (/[?&]apiKey=/.test(url)) {
|
|
760
|
-
return url;
|
|
761
|
-
}
|
|
762
|
-
else {
|
|
763
|
-
return url + separator + 'apiKey=' + encodeURIComponent(apiKey);
|
|
764
|
-
}
|
|
765
|
-
};
|
|
766
|
-
var isError = function (status) {
|
|
767
|
-
return status < 200 || status >= 300;
|
|
768
|
-
};
|
|
769
|
-
var requestServiceBlob = function (url, apiKey) {
|
|
770
|
-
var headers = {
|
|
771
|
-
'Content-Type': 'application/json;charset=UTF-8',
|
|
772
|
-
'tiny-api-key': apiKey
|
|
773
|
-
};
|
|
774
|
-
return sendRequest(appendApiKey(url, apiKey), headers).then(function (result) {
|
|
775
|
-
return isError(result.status) ? handleServiceErrorResponse(result.status, result.blob) : Promise.resolve(result.blob);
|
|
776
|
-
});
|
|
777
|
-
};
|
|
778
|
-
var requestBlob = function (url, withCredentials) {
|
|
779
|
-
return sendRequest(url, {}, withCredentials).then(function (result) {
|
|
780
|
-
return isError(result.status) ? handleHttpError(result.status) : Promise.resolve(result.blob);
|
|
781
|
-
});
|
|
782
|
-
};
|
|
783
|
-
var getUrl = function (url, apiKey, withCredentials) {
|
|
784
|
-
if (withCredentials === void 0) {
|
|
785
|
-
withCredentials = false;
|
|
786
|
-
}
|
|
787
|
-
return apiKey ? requestServiceBlob(url, apiKey) : requestBlob(url, withCredentials);
|
|
788
|
-
};
|
|
789
|
-
var blobToImageResult = function (blob) {
|
|
790
|
-
return fromBlob(blob);
|
|
791
|
-
};
|
|
792
|
-
var ELEMENT = 1;
|
|
793
|
-
var fromHtml = function (html, scope) {
|
|
794
|
-
var doc = scope || document;
|
|
795
|
-
var div = doc.createElement('div');
|
|
796
|
-
div.innerHTML = html;
|
|
797
|
-
if (!div.hasChildNodes() || div.childNodes.length > 1) {
|
|
798
|
-
console.error('HTML does not have a single root node', html);
|
|
799
|
-
throw new Error('HTML must have a single root node');
|
|
800
|
-
}
|
|
801
|
-
return fromDom(div.childNodes[0]);
|
|
802
|
-
};
|
|
803
|
-
var fromTag = function (tag, scope) {
|
|
804
|
-
var doc = scope || document;
|
|
805
|
-
var node = doc.createElement(tag);
|
|
806
|
-
return fromDom(node);
|
|
807
|
-
};
|
|
808
|
-
var fromText = function (text, scope) {
|
|
809
|
-
var doc = scope || document;
|
|
810
|
-
var node = doc.createTextNode(text);
|
|
811
|
-
return fromDom(node);
|
|
812
|
-
};
|
|
813
|
-
var fromDom = function (node) {
|
|
814
|
-
if (node === null || node === undefined) {
|
|
815
|
-
throw new Error('Node cannot be null or undefined');
|
|
816
|
-
}
|
|
817
|
-
return { dom: node };
|
|
818
|
-
};
|
|
819
|
-
var fromPoint = function (docElm, x, y) {
|
|
820
|
-
return Optional.from(docElm.dom.elementFromPoint(x, y)).map(fromDom);
|
|
821
|
-
};
|
|
822
|
-
var SugarElement = {
|
|
823
|
-
fromHtml: fromHtml,
|
|
824
|
-
fromTag: fromTag,
|
|
825
|
-
fromText: fromText,
|
|
826
|
-
fromDom: fromDom,
|
|
827
|
-
fromPoint: fromPoint
|
|
828
|
-
};
|
|
829
|
-
var is = function (element, selector) {
|
|
830
|
-
var dom = element.dom;
|
|
831
|
-
if (dom.nodeType !== ELEMENT) {
|
|
832
|
-
return false;
|
|
833
|
-
}
|
|
834
|
-
else {
|
|
835
|
-
var elem = dom;
|
|
836
|
-
if (elem.matches !== undefined) {
|
|
837
|
-
return elem.matches(selector);
|
|
838
|
-
}
|
|
839
|
-
else if (elem.msMatchesSelector !== undefined) {
|
|
840
|
-
return elem.msMatchesSelector(selector);
|
|
841
|
-
}
|
|
842
|
-
else if (elem.webkitMatchesSelector !== undefined) {
|
|
843
|
-
return elem.webkitMatchesSelector(selector);
|
|
844
|
-
}
|
|
845
|
-
else if (elem.mozMatchesSelector !== undefined) {
|
|
846
|
-
return elem.mozMatchesSelector(selector);
|
|
847
|
-
}
|
|
848
|
-
else {
|
|
849
|
-
throw new Error('Browser lacks native selectors');
|
|
850
|
-
}
|
|
851
|
-
}
|
|
852
|
-
};
|
|
853
|
-
var Global = typeof window !== 'undefined' ? window : Function('return this;')();
|
|
854
|
-
var child = function (scope, predicate) {
|
|
855
|
-
var pred = function (node) {
|
|
856
|
-
return predicate(SugarElement.fromDom(node));
|
|
857
|
-
};
|
|
858
|
-
var result = find(scope.dom.childNodes, pred);
|
|
859
|
-
return result.map(SugarElement.fromDom);
|
|
860
|
-
};
|
|
861
|
-
var child$1 = function (scope, selector) {
|
|
862
|
-
return child(scope, function (e) {
|
|
863
|
-
return is(e, selector);
|
|
864
|
-
});
|
|
865
|
-
};
|
|
866
|
-
var global$2 = tinymce.util.Tools.resolve('tinymce.util.Delay');
|
|
867
|
-
var global$3 = tinymce.util.Tools.resolve('tinymce.util.Promise');
|
|
868
|
-
var global$4 = tinymce.util.Tools.resolve('tinymce.util.URI');
|
|
869
|
-
var getToolbarItems = function (editor) {
|
|
870
|
-
return editor.getParam('imagetools_toolbar', 'rotateleft rotateright flipv fliph editimage imageoptions');
|
|
871
|
-
};
|
|
872
|
-
var getProxyUrl = function (editor) {
|
|
873
|
-
return editor.getParam('imagetools_proxy');
|
|
874
|
-
};
|
|
875
|
-
var getCorsHosts = function (editor) {
|
|
876
|
-
return editor.getParam('imagetools_cors_hosts', [], 'string[]');
|
|
877
|
-
};
|
|
878
|
-
var getCredentialsHosts = function (editor) {
|
|
879
|
-
return editor.getParam('imagetools_credentials_hosts', [], 'string[]');
|
|
880
|
-
};
|
|
881
|
-
var getFetchImage = function (editor) {
|
|
882
|
-
return Optional.from(editor.getParam('imagetools_fetch_image', null, 'function'));
|
|
883
|
-
};
|
|
884
|
-
var getApiKey = function (editor) {
|
|
885
|
-
return editor.getParam('api_key', editor.getParam('imagetools_api_key', '', 'string'), 'string');
|
|
886
|
-
};
|
|
887
|
-
var getUploadTimeout = function (editor) {
|
|
888
|
-
return editor.getParam('images_upload_timeout', 30000, 'number');
|
|
889
|
-
};
|
|
890
|
-
var shouldReuseFilename = function (editor) {
|
|
891
|
-
return editor.getParam('images_reuse_filename', false, 'boolean');
|
|
892
|
-
};
|
|
893
|
-
var getImageSize = function (img) {
|
|
894
|
-
var width, height;
|
|
895
|
-
var isPxValue = function (value) {
|
|
896
|
-
return /^[0-9\.]+px$/.test(value);
|
|
897
|
-
};
|
|
898
|
-
width = img.style.width;
|
|
899
|
-
height = img.style.height;
|
|
900
|
-
if (width || height) {
|
|
901
|
-
if (isPxValue(width) && isPxValue(height)) {
|
|
902
|
-
return {
|
|
903
|
-
w: parseInt(width, 10),
|
|
904
|
-
h: parseInt(height, 10)
|
|
905
|
-
};
|
|
906
|
-
}
|
|
907
|
-
return null;
|
|
908
|
-
}
|
|
909
|
-
width = img.width;
|
|
910
|
-
height = img.height;
|
|
911
|
-
if (width && height) {
|
|
912
|
-
return {
|
|
913
|
-
w: parseInt(width, 10),
|
|
914
|
-
h: parseInt(height, 10)
|
|
915
|
-
};
|
|
916
|
-
}
|
|
917
|
-
return null;
|
|
918
|
-
};
|
|
919
|
-
var setImageSize = function (img, size) {
|
|
920
|
-
var width, height;
|
|
921
|
-
if (size) {
|
|
922
|
-
width = img.style.width;
|
|
923
|
-
height = img.style.height;
|
|
924
|
-
if (width || height) {
|
|
925
|
-
img.style.width = size.w + 'px';
|
|
926
|
-
img.style.height = size.h + 'px';
|
|
927
|
-
img.removeAttribute('data-mce-style');
|
|
928
|
-
}
|
|
929
|
-
width = img.width;
|
|
930
|
-
height = img.height;
|
|
931
|
-
if (width || height) {
|
|
932
|
-
img.setAttribute('width', String(size.w));
|
|
933
|
-
img.setAttribute('height', String(size.h));
|
|
934
|
-
}
|
|
935
|
-
}
|
|
936
|
-
};
|
|
937
|
-
var getNaturalImageSize = function (img) {
|
|
938
|
-
return {
|
|
939
|
-
w: img.naturalWidth,
|
|
940
|
-
h: img.naturalHeight
|
|
941
|
-
};
|
|
942
|
-
};
|
|
943
|
-
var count = 0;
|
|
944
|
-
var getFigureImg = function (elem) {
|
|
945
|
-
return child$1(SugarElement.fromDom(elem), 'img');
|
|
946
|
-
};
|
|
947
|
-
var isFigure = function (editor, elem) {
|
|
948
|
-
return editor.dom.is(elem, 'figure');
|
|
949
|
-
};
|
|
950
|
-
var isImage = function (editor, imgNode) {
|
|
951
|
-
return editor.dom.is(imgNode, 'img:not([data-mce-object],[data-mce-placeholder])');
|
|
952
|
-
};
|
|
953
|
-
var getEditableImage = function (editor, node) {
|
|
954
|
-
var isEditable = function (imgNode) {
|
|
955
|
-
return isImage(editor, imgNode) && (isLocalImage(editor, imgNode) || isCorsImage(editor, imgNode) || isNonNullable(getProxyUrl(editor)));
|
|
956
|
-
};
|
|
957
|
-
if (isFigure(editor, node)) {
|
|
958
|
-
return getFigureImg(node).bind(function (img) {
|
|
959
|
-
return isEditable(img.dom) ? Optional.some(img.dom) : Optional.none();
|
|
960
|
-
});
|
|
961
|
-
}
|
|
962
|
-
else {
|
|
963
|
-
return isEditable(node) ? Optional.some(node) : Optional.none();
|
|
964
|
-
}
|
|
965
|
-
};
|
|
966
|
-
var displayError = function (editor, error) {
|
|
967
|
-
editor.notificationManager.open({
|
|
968
|
-
text: error,
|
|
969
|
-
type: 'error'
|
|
970
|
-
});
|
|
971
|
-
};
|
|
972
|
-
var getSelectedImage = function (editor) {
|
|
973
|
-
var elem = editor.selection.getNode();
|
|
974
|
-
var figureElm = editor.dom.getParent(elem, 'figure.image');
|
|
975
|
-
if (figureElm !== null && isFigure(editor, figureElm)) {
|
|
976
|
-
return getFigureImg(figureElm);
|
|
977
|
-
}
|
|
978
|
-
else if (isImage(editor, elem)) {
|
|
979
|
-
return Optional.some(SugarElement.fromDom(elem));
|
|
980
|
-
}
|
|
981
|
-
else {
|
|
982
|
-
return Optional.none();
|
|
983
|
-
}
|
|
984
|
-
};
|
|
985
|
-
var extractFilename = function (editor, url, group) {
|
|
986
|
-
var m = url.match(/(?:\/|^)(([^\/\?]+)\.(?:[a-z0-9.]+))(?:\?|$)/i);
|
|
987
|
-
return isNonNullable(m) ? editor.dom.encode(m[group]) : null;
|
|
988
|
-
};
|
|
989
|
-
var createId = function () {
|
|
990
|
-
return 'imagetools' + count++;
|
|
991
|
-
};
|
|
992
|
-
var isLocalImage = function (editor, img) {
|
|
993
|
-
var url = img.src;
|
|
994
|
-
return url.indexOf('data:') === 0 || url.indexOf('blob:') === 0 || new global$4(url).host === editor.documentBaseURI.host;
|
|
995
|
-
};
|
|
996
|
-
var isCorsImage = function (editor, img) {
|
|
997
|
-
return global$1.inArray(getCorsHosts(editor), new global$4(img.src).host) !== -1;
|
|
998
|
-
};
|
|
999
|
-
var isCorsWithCredentialsImage = function (editor, img) {
|
|
1000
|
-
return global$1.inArray(getCredentialsHosts(editor), new global$4(img.src).host) !== -1;
|
|
1001
|
-
};
|
|
1002
|
-
var defaultFetchImage = function (editor, img) {
|
|
1003
|
-
if (isCorsImage(editor, img)) {
|
|
1004
|
-
return getUrl(img.src, null, isCorsWithCredentialsImage(editor, img));
|
|
1005
|
-
}
|
|
1006
|
-
if (!isLocalImage(editor, img)) {
|
|
1007
|
-
var proxyUrl = getProxyUrl(editor);
|
|
1008
|
-
var src = proxyUrl + (proxyUrl.indexOf('?') === -1 ? '?' : '&') + 'url=' + encodeURIComponent(img.src);
|
|
1009
|
-
var apiKey = getApiKey(editor);
|
|
1010
|
-
return getUrl(src, apiKey, false);
|
|
1011
|
-
}
|
|
1012
|
-
return imageToBlob$1(img);
|
|
1013
|
-
};
|
|
1014
|
-
var imageToBlob$2 = function (editor, img) {
|
|
1015
|
-
return getFetchImage(editor).fold(function () {
|
|
1016
|
-
return defaultFetchImage(editor, img);
|
|
1017
|
-
}, function (customFetchImage) {
|
|
1018
|
-
return customFetchImage(img);
|
|
1019
|
-
});
|
|
1020
|
-
};
|
|
1021
|
-
var findBlob = function (editor, img) {
|
|
1022
|
-
var blobInfo = editor.editorUpload.blobCache.getByUri(img.src);
|
|
1023
|
-
if (blobInfo) {
|
|
1024
|
-
return global$3.resolve(blobInfo.blob());
|
|
1025
|
-
}
|
|
1026
|
-
return imageToBlob$2(editor, img);
|
|
1027
|
-
};
|
|
1028
|
-
var startTimedUpload = function (editor, imageUploadTimerState) {
|
|
1029
|
-
var imageUploadTimer = global$2.setEditorTimeout(editor, function () {
|
|
1030
|
-
editor.editorUpload.uploadImagesAuto();
|
|
1031
|
-
}, getUploadTimeout(editor));
|
|
1032
|
-
imageUploadTimerState.set(imageUploadTimer);
|
|
1033
|
-
};
|
|
1034
|
-
var cancelTimedUpload = function (imageUploadTimerState) {
|
|
1035
|
-
global$2.clearTimeout(imageUploadTimerState.get());
|
|
1036
|
-
};
|
|
1037
|
-
var updateSelectedImage = function (editor, origBlob, ir, uploadImmediately, imageUploadTimerState, selectedImage, size) {
|
|
1038
|
-
return ir.toBlob().then(function (blob) {
|
|
1039
|
-
var uri, name, filename, blobInfo;
|
|
1040
|
-
var blobCache = editor.editorUpload.blobCache;
|
|
1041
|
-
uri = selectedImage.src;
|
|
1042
|
-
var useFilename = origBlob.type === blob.type;
|
|
1043
|
-
if (shouldReuseFilename(editor)) {
|
|
1044
|
-
blobInfo = blobCache.getByUri(uri);
|
|
1045
|
-
if (isNonNullable(blobInfo)) {
|
|
1046
|
-
uri = blobInfo.uri();
|
|
1047
|
-
name = blobInfo.name();
|
|
1048
|
-
filename = blobInfo.filename();
|
|
1049
|
-
}
|
|
1050
|
-
else {
|
|
1051
|
-
name = extractFilename(editor, uri, 2);
|
|
1052
|
-
filename = extractFilename(editor, uri, 1);
|
|
1053
|
-
}
|
|
1054
|
-
}
|
|
1055
|
-
blobInfo = blobCache.create({
|
|
1056
|
-
id: createId(),
|
|
1057
|
-
blob: blob,
|
|
1058
|
-
base64: ir.toBase64(),
|
|
1059
|
-
uri: uri,
|
|
1060
|
-
name: name,
|
|
1061
|
-
filename: useFilename ? filename : undefined
|
|
1062
|
-
});
|
|
1063
|
-
blobCache.add(blobInfo);
|
|
1064
|
-
editor.undoManager.transact(function () {
|
|
1065
|
-
var imageLoadedHandler = function () {
|
|
1066
|
-
editor.$(selectedImage).off('load', imageLoadedHandler);
|
|
1067
|
-
editor.nodeChanged();
|
|
1068
|
-
if (uploadImmediately) {
|
|
1069
|
-
editor.editorUpload.uploadImagesAuto();
|
|
1070
|
-
}
|
|
1071
|
-
else {
|
|
1072
|
-
cancelTimedUpload(imageUploadTimerState);
|
|
1073
|
-
startTimedUpload(editor, imageUploadTimerState);
|
|
1074
|
-
}
|
|
1075
|
-
};
|
|
1076
|
-
editor.$(selectedImage).on('load', imageLoadedHandler);
|
|
1077
|
-
if (size) {
|
|
1078
|
-
editor.$(selectedImage).attr({
|
|
1079
|
-
width: size.w,
|
|
1080
|
-
height: size.h
|
|
1081
|
-
});
|
|
1082
|
-
}
|
|
1083
|
-
editor.$(selectedImage).attr({ src: blobInfo.blobUri() }).removeAttr('data-mce-src');
|
|
1084
|
-
});
|
|
1085
|
-
return blobInfo;
|
|
1086
|
-
});
|
|
1087
|
-
};
|
|
1088
|
-
var selectedImageOperation = function (editor, imageUploadTimerState, fn, size) {
|
|
1089
|
-
return function () {
|
|
1090
|
-
var imgOpt = getSelectedImage(editor);
|
|
1091
|
-
return imgOpt.fold(function () {
|
|
1092
|
-
displayError(editor, 'Could not find selected image');
|
|
1093
|
-
}, function (img) {
|
|
1094
|
-
return editor._scanForImages().then(function () {
|
|
1095
|
-
return findBlob(editor, img.dom);
|
|
1096
|
-
}).then(function (blob) {
|
|
1097
|
-
return blobToImageResult(blob).then(fn).then(function (imageResult) {
|
|
1098
|
-
return updateSelectedImage(editor, blob, imageResult, false, imageUploadTimerState, img.dom, size);
|
|
1099
|
-
});
|
|
1100
|
-
}).catch(function (error) {
|
|
1101
|
-
displayError(editor, error);
|
|
1102
|
-
});
|
|
1103
|
-
});
|
|
1104
|
-
};
|
|
1105
|
-
};
|
|
1106
|
-
var rotate$2 = function (editor, imageUploadTimerState, angle) {
|
|
1107
|
-
return function () {
|
|
1108
|
-
var imgOpt = getSelectedImage(editor);
|
|
1109
|
-
var flippedSize = imgOpt.fold(function () {
|
|
1110
|
-
return null;
|
|
1111
|
-
}, function (img) {
|
|
1112
|
-
var size = getImageSize(img.dom);
|
|
1113
|
-
return size ? {
|
|
1114
|
-
w: size.h,
|
|
1115
|
-
h: size.w
|
|
1116
|
-
} : null;
|
|
1117
|
-
});
|
|
1118
|
-
return selectedImageOperation(editor, imageUploadTimerState, function (imageResult) {
|
|
1119
|
-
return rotate$1(imageResult, angle);
|
|
1120
|
-
}, flippedSize)();
|
|
1121
|
-
};
|
|
1122
|
-
};
|
|
1123
|
-
var flip$2 = function (editor, imageUploadTimerState, axis) {
|
|
1124
|
-
return function () {
|
|
1125
|
-
return selectedImageOperation(editor, imageUploadTimerState, function (imageResult) {
|
|
1126
|
-
return flip$1(imageResult, axis);
|
|
1127
|
-
})();
|
|
1128
|
-
};
|
|
1129
|
-
};
|
|
1130
|
-
var handleDialogBlob = function (editor, imageUploadTimerState, img, originalSize, blob) {
|
|
1131
|
-
return blobToImage$1(blob).then(function (newImage) {
|
|
1132
|
-
var newSize = getNaturalImageSize(newImage);
|
|
1133
|
-
if (originalSize.w !== newSize.w || originalSize.h !== newSize.h) {
|
|
1134
|
-
if (getImageSize(img)) {
|
|
1135
|
-
setImageSize(img, newSize);
|
|
1136
|
-
}
|
|
1137
|
-
}
|
|
1138
|
-
URL.revokeObjectURL(newImage.src);
|
|
1139
|
-
return blob;
|
|
1140
|
-
}).then(blobToImageResult).then(function (imageResult) {
|
|
1141
|
-
return updateSelectedImage(editor, blob, imageResult, true, imageUploadTimerState, img);
|
|
1142
|
-
});
|
|
1143
|
-
};
|
|
1144
|
-
var saveState = 'save-state';
|
|
1145
|
-
var disable = 'disable';
|
|
1146
|
-
var enable = 'enable';
|
|
1147
|
-
var createState = function (blob) {
|
|
1148
|
-
return {
|
|
1149
|
-
blob: blob,
|
|
1150
|
-
url: URL.createObjectURL(blob)
|
|
1151
|
-
};
|
|
1152
|
-
};
|
|
1153
|
-
var makeOpen = function (editor, imageUploadTimerState) {
|
|
1154
|
-
return function () {
|
|
1155
|
-
var getLoadedSpec = function (currentState) {
|
|
1156
|
-
return {
|
|
1157
|
-
title: 'Edit Image',
|
|
1158
|
-
size: 'large',
|
|
1159
|
-
body: {
|
|
1160
|
-
type: 'panel',
|
|
1161
|
-
items: [{
|
|
1162
|
-
type: 'imagetools',
|
|
1163
|
-
name: 'imagetools',
|
|
1164
|
-
label: 'Edit Image',
|
|
1165
|
-
currentState: currentState
|
|
1166
|
-
}]
|
|
1167
|
-
},
|
|
1168
|
-
buttons: [
|
|
1169
|
-
{
|
|
1170
|
-
type: 'cancel',
|
|
1171
|
-
name: 'cancel',
|
|
1172
|
-
text: 'Cancel'
|
|
1173
|
-
},
|
|
1174
|
-
{
|
|
1175
|
-
type: 'submit',
|
|
1176
|
-
name: 'save',
|
|
1177
|
-
text: 'Save',
|
|
1178
|
-
primary: true,
|
|
1179
|
-
disabled: true
|
|
1180
|
-
}
|
|
1181
|
-
],
|
|
1182
|
-
onSubmit: function (api) {
|
|
1183
|
-
var blob = api.getData().imagetools.blob;
|
|
1184
|
-
originalImgOpt.each(function (originalImg) {
|
|
1185
|
-
originalSizeOpt.each(function (originalSize) {
|
|
1186
|
-
handleDialogBlob(editor, imageUploadTimerState, originalImg.dom, originalSize, blob);
|
|
1187
|
-
});
|
|
1188
|
-
});
|
|
1189
|
-
api.close();
|
|
1190
|
-
},
|
|
1191
|
-
onCancel: noop,
|
|
1192
|
-
onAction: function (api, details) {
|
|
1193
|
-
switch (details.name) {
|
|
1194
|
-
case saveState:
|
|
1195
|
-
if (details.value) {
|
|
1196
|
-
api.enable('save');
|
|
1197
|
-
}
|
|
1198
|
-
else {
|
|
1199
|
-
api.disable('save');
|
|
1200
|
-
}
|
|
1201
|
-
break;
|
|
1202
|
-
case disable:
|
|
1203
|
-
api.disable('save');
|
|
1204
|
-
api.disable('cancel');
|
|
1205
|
-
break;
|
|
1206
|
-
case enable:
|
|
1207
|
-
api.enable('cancel');
|
|
1208
|
-
break;
|
|
1209
|
-
}
|
|
1210
|
-
}
|
|
1211
|
-
};
|
|
1212
|
-
};
|
|
1213
|
-
var originalImgOpt = getSelectedImage(editor);
|
|
1214
|
-
var originalSizeOpt = originalImgOpt.map(function (origImg) {
|
|
1215
|
-
return getNaturalImageSize(origImg.dom);
|
|
1216
|
-
});
|
|
1217
|
-
originalImgOpt.each(function (img) {
|
|
1218
|
-
getEditableImage(editor, img.dom).each(function (_) {
|
|
1219
|
-
findBlob(editor, img.dom).then(function (blob) {
|
|
1220
|
-
var state = createState(blob);
|
|
1221
|
-
editor.windowManager.open(getLoadedSpec(state));
|
|
1222
|
-
});
|
|
1223
|
-
});
|
|
1224
|
-
});
|
|
1225
|
-
};
|
|
1226
|
-
};
|
|
1227
|
-
var register = function (editor, imageUploadTimerState) {
|
|
1228
|
-
global$1.each({
|
|
1229
|
-
mceImageRotateLeft: rotate$2(editor, imageUploadTimerState, -90),
|
|
1230
|
-
mceImageRotateRight: rotate$2(editor, imageUploadTimerState, 90),
|
|
1231
|
-
mceImageFlipVertical: flip$2(editor, imageUploadTimerState, 'v'),
|
|
1232
|
-
mceImageFlipHorizontal: flip$2(editor, imageUploadTimerState, 'h'),
|
|
1233
|
-
mceEditImage: makeOpen(editor, imageUploadTimerState)
|
|
1234
|
-
}, function (fn, cmd) {
|
|
1235
|
-
editor.addCommand(cmd, fn);
|
|
1236
|
-
});
|
|
1237
|
-
};
|
|
1238
|
-
var setup = function (editor, imageUploadTimerState, lastSelectedImageState) {
|
|
1239
|
-
editor.on('NodeChange', function (e) {
|
|
1240
|
-
var lastSelectedImage = lastSelectedImageState.get();
|
|
1241
|
-
var selectedImage = getEditableImage(editor, e.element);
|
|
1242
|
-
if (lastSelectedImage && !selectedImage.exists(function (img) {
|
|
1243
|
-
return lastSelectedImage.src === img.src;
|
|
1244
|
-
})) {
|
|
1245
|
-
cancelTimedUpload(imageUploadTimerState);
|
|
1246
|
-
editor.editorUpload.uploadImagesAuto();
|
|
1247
|
-
lastSelectedImageState.set(null);
|
|
1248
|
-
}
|
|
1249
|
-
selectedImage.each(lastSelectedImageState.set);
|
|
1250
|
-
});
|
|
1251
|
-
};
|
|
1252
|
-
var register$1 = function (editor) {
|
|
1253
|
-
var cmd = function (command) {
|
|
1254
|
-
return function () {
|
|
1255
|
-
return editor.execCommand(command);
|
|
1256
|
-
};
|
|
1257
|
-
};
|
|
1258
|
-
editor.ui.registry.addButton('rotateleft', {
|
|
1259
|
-
tooltip: 'Rotate counterclockwise',
|
|
1260
|
-
icon: 'rotate-left',
|
|
1261
|
-
onAction: cmd('mceImageRotateLeft')
|
|
1262
|
-
});
|
|
1263
|
-
editor.ui.registry.addButton('rotateright', {
|
|
1264
|
-
tooltip: 'Rotate clockwise',
|
|
1265
|
-
icon: 'rotate-right',
|
|
1266
|
-
onAction: cmd('mceImageRotateRight')
|
|
1267
|
-
});
|
|
1268
|
-
editor.ui.registry.addButton('flipv', {
|
|
1269
|
-
tooltip: 'Flip vertically',
|
|
1270
|
-
icon: 'flip-vertically',
|
|
1271
|
-
onAction: cmd('mceImageFlipVertical')
|
|
1272
|
-
});
|
|
1273
|
-
editor.ui.registry.addButton('fliph', {
|
|
1274
|
-
tooltip: 'Flip horizontally',
|
|
1275
|
-
icon: 'flip-horizontally',
|
|
1276
|
-
onAction: cmd('mceImageFlipHorizontal')
|
|
1277
|
-
});
|
|
1278
|
-
editor.ui.registry.addButton('editimage', {
|
|
1279
|
-
tooltip: 'Edit image',
|
|
1280
|
-
icon: 'edit-image',
|
|
1281
|
-
onAction: cmd('mceEditImage'),
|
|
1282
|
-
onSetup: function (buttonApi) {
|
|
1283
|
-
var setDisabled = function () {
|
|
1284
|
-
var disabled = getSelectedImage(editor).forall(function (element) {
|
|
1285
|
-
return getEditableImage(editor, element.dom).isNone();
|
|
1286
|
-
});
|
|
1287
|
-
buttonApi.setDisabled(disabled);
|
|
1288
|
-
};
|
|
1289
|
-
editor.on('NodeChange', setDisabled);
|
|
1290
|
-
return function () {
|
|
1291
|
-
editor.off('NodeChange', setDisabled);
|
|
1292
|
-
};
|
|
1293
|
-
}
|
|
1294
|
-
});
|
|
1295
|
-
editor.ui.registry.addButton('imageoptions', {
|
|
1296
|
-
tooltip: 'Image options',
|
|
1297
|
-
icon: 'image',
|
|
1298
|
-
onAction: cmd('mceImage')
|
|
1299
|
-
});
|
|
1300
|
-
editor.ui.registry.addContextMenu('imagetools', {
|
|
1301
|
-
update: function (element) {
|
|
1302
|
-
return getEditableImage(editor, element).fold(function () {
|
|
1303
|
-
return [];
|
|
1304
|
-
}, function (_) {
|
|
1305
|
-
return [{
|
|
1306
|
-
text: 'Edit image',
|
|
1307
|
-
icon: 'edit-image',
|
|
1308
|
-
onAction: cmd('mceEditImage')
|
|
1309
|
-
}];
|
|
1310
|
-
});
|
|
1311
|
-
}
|
|
1312
|
-
});
|
|
1313
|
-
};
|
|
1314
|
-
var register$2 = function (editor) {
|
|
1315
|
-
editor.ui.registry.addContextToolbar('imagetools', {
|
|
1316
|
-
items: getToolbarItems(editor),
|
|
1317
|
-
predicate: function (elem) {
|
|
1318
|
-
return getEditableImage(editor, elem).isSome();
|
|
1319
|
-
},
|
|
1320
|
-
position: 'node',
|
|
1321
|
-
scope: 'node'
|
|
1322
|
-
});
|
|
1323
|
-
};
|
|
1324
|
-
function Plugin() {
|
|
1325
|
-
global.add('imagetools', function (editor) {
|
|
1326
|
-
var imageUploadTimerState = Cell(0);
|
|
1327
|
-
var lastSelectedImageState = Cell(null);
|
|
1328
|
-
register(editor, imageUploadTimerState);
|
|
1329
|
-
register$1(editor);
|
|
1330
|
-
register$2(editor);
|
|
1331
|
-
setup(editor, imageUploadTimerState, lastSelectedImageState);
|
|
1332
|
-
});
|
|
1333
|
-
}
|
|
1334
|
-
Plugin();
|
|
1335
|
-
}());
|