create-nextjs-cms 0.5.21 → 0.5.24
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/package.json +3 -5
- package/templates/default/_gitignore +1 -1
- package/templates/default/app/(auth)/auth/login/LoginPage.tsx +5 -5
- package/templates/default/apps/cms/node_modules/next/node_modules/sharp/LICENSE +191 -0
- package/templates/default/apps/cms/node_modules/next/node_modules/sharp/README.md +118 -0
- package/templates/default/apps/cms/node_modules/next/node_modules/sharp/install/build.js +38 -0
- package/templates/default/apps/cms/node_modules/next/node_modules/sharp/install/check.js +14 -0
- package/templates/default/apps/cms/node_modules/next/node_modules/sharp/lib/channel.js +177 -0
- package/templates/default/apps/cms/node_modules/next/node_modules/sharp/lib/colour.js +195 -0
- package/templates/default/apps/cms/node_modules/next/node_modules/sharp/lib/composite.js +212 -0
- package/templates/default/apps/cms/node_modules/next/node_modules/sharp/lib/constructor.js +499 -0
- package/templates/default/apps/cms/node_modules/next/node_modules/sharp/lib/index.d.ts +1971 -0
- package/templates/default/apps/cms/node_modules/next/node_modules/sharp/lib/index.js +16 -0
- package/templates/default/apps/cms/node_modules/next/node_modules/sharp/lib/input.js +809 -0
- package/templates/default/apps/cms/node_modules/next/node_modules/sharp/lib/is.js +143 -0
- package/templates/default/apps/cms/node_modules/next/node_modules/sharp/lib/libvips.js +207 -0
- package/templates/default/apps/cms/node_modules/next/node_modules/sharp/lib/operation.js +1016 -0
- package/templates/default/apps/cms/node_modules/next/node_modules/sharp/lib/output.js +1666 -0
- package/templates/default/apps/cms/node_modules/next/node_modules/sharp/lib/resize.js +595 -0
- package/templates/default/apps/cms/node_modules/next/node_modules/sharp/lib/sharp.js +121 -0
- package/templates/default/apps/cms/node_modules/next/node_modules/sharp/lib/utility.js +291 -0
- package/templates/default/apps/cms/node_modules/next/node_modules/sharp/package.json +202 -0
- package/templates/default/apps/cms/node_modules/next/node_modules/sharp/src/binding.gyp +298 -0
- package/templates/default/apps/cms/node_modules/next/node_modules/sharp/src/common.cc +1130 -0
- package/templates/default/apps/cms/node_modules/next/node_modules/sharp/src/common.h +402 -0
- package/templates/default/apps/cms/node_modules/next/node_modules/sharp/src/metadata.cc +346 -0
- package/templates/default/apps/cms/node_modules/next/node_modules/sharp/src/metadata.h +90 -0
- package/templates/default/apps/cms/node_modules/next/node_modules/sharp/src/operations.cc +499 -0
- package/templates/default/apps/cms/node_modules/next/node_modules/sharp/src/operations.h +137 -0
- package/templates/default/apps/cms/node_modules/next/node_modules/sharp/src/pipeline.cc +1814 -0
- package/templates/default/apps/cms/node_modules/next/node_modules/sharp/src/pipeline.h +408 -0
- package/templates/default/apps/cms/node_modules/next/node_modules/sharp/src/sharp.cc +43 -0
- package/templates/default/apps/cms/node_modules/next/node_modules/sharp/src/stats.cc +186 -0
- package/templates/default/apps/cms/node_modules/next/node_modules/sharp/src/stats.h +62 -0
- package/templates/default/apps/cms/node_modules/next/node_modules/sharp/src/utilities.cc +288 -0
- package/templates/default/apps/cms/node_modules/next/node_modules/sharp/src/utilities.h +22 -0
- package/templates/default/apps/cms/node_modules/sharp/LICENSE +191 -0
- package/templates/default/apps/cms/node_modules/sharp/README.md +118 -0
- package/templates/default/apps/cms/node_modules/sharp/install/check.js +41 -0
- package/templates/default/apps/cms/node_modules/sharp/lib/channel.js +174 -0
- package/templates/default/apps/cms/node_modules/sharp/lib/colour.js +180 -0
- package/templates/default/apps/cms/node_modules/sharp/lib/composite.js +210 -0
- package/templates/default/apps/cms/node_modules/sharp/lib/constructor.js +452 -0
- package/templates/default/apps/cms/node_modules/sharp/lib/index.d.ts +1754 -0
- package/templates/default/apps/cms/node_modules/sharp/lib/index.js +16 -0
- package/templates/default/apps/cms/node_modules/sharp/lib/input.js +658 -0
- package/templates/default/apps/cms/node_modules/sharp/lib/is.js +169 -0
- package/templates/default/apps/cms/node_modules/sharp/lib/libvips.js +203 -0
- package/templates/default/apps/cms/node_modules/sharp/lib/operation.js +958 -0
- package/templates/default/apps/cms/node_modules/sharp/lib/output.js +1587 -0
- package/templates/default/apps/cms/node_modules/sharp/lib/resize.js +587 -0
- package/templates/default/apps/cms/node_modules/sharp/lib/sharp.js +114 -0
- package/templates/default/apps/cms/node_modules/sharp/lib/utility.js +296 -0
- package/templates/default/apps/cms/node_modules/sharp/package.json +222 -0
- package/templates/default/apps/cms/node_modules/sharp/src/binding.gyp +280 -0
- package/templates/default/apps/cms/node_modules/sharp/src/common.cc +1091 -0
- package/templates/default/apps/cms/node_modules/sharp/src/common.h +393 -0
- package/templates/default/apps/cms/node_modules/sharp/src/metadata.cc +320 -0
- package/templates/default/apps/cms/node_modules/sharp/src/metadata.h +85 -0
- package/templates/default/apps/cms/node_modules/sharp/src/operations.cc +475 -0
- package/templates/default/apps/cms/node_modules/sharp/src/operations.h +125 -0
- package/templates/default/apps/cms/node_modules/sharp/src/pipeline.cc +1758 -0
- package/templates/default/apps/cms/node_modules/sharp/src/pipeline.h +393 -0
- package/templates/default/apps/cms/node_modules/sharp/src/sharp.cc +40 -0
- package/templates/default/apps/cms/node_modules/sharp/src/stats.cc +183 -0
- package/templates/default/apps/cms/node_modules/sharp/src/stats.h +59 -0
- package/templates/default/apps/cms/node_modules/sharp/src/utilities.cc +269 -0
- package/templates/default/apps/cms/node_modules/sharp/src/utilities.h +19 -0
- package/templates/default/components/AdminCard.tsx +1 -1
- package/templates/default/components/AdminsPage.tsx +1 -1
- package/templates/default/components/AdvancedSettingsPage.tsx +1 -1
- package/templates/default/components/AnalyticsPage.tsx +1 -1
- package/templates/default/components/BrowsePage.tsx +2 -2
- package/templates/default/components/CategorizedSectionPage.tsx +3 -3
- package/templates/default/components/CategoryDeleteConfirmPage.tsx +4 -4
- package/templates/default/components/CategorySectionSelectInput.tsx +1 -1
- package/templates/default/components/ContainerBox.tsx +1 -1
- package/templates/default/components/DashboardPage.tsx +1 -1
- package/templates/default/components/EmailCard.tsx +1 -1
- package/templates/default/components/EmailPasswordForm.tsx +2 -2
- package/templates/default/components/EmailQuotaForm.tsx +1 -1
- package/templates/default/components/EmailsPage.tsx +1 -1
- package/templates/default/components/GalleryPhoto.tsx +1 -1
- package/templates/default/components/ItemEditPage.tsx +2 -2
- package/templates/default/components/Layout.tsx +1 -1
- package/templates/default/components/LogPage.tsx +1 -1
- package/templates/default/components/Navbar.tsx +2 -2
- package/templates/default/components/NavbarAlt.tsx +6 -6
- package/templates/default/components/NewAdminForm.tsx +2 -2
- package/templates/default/components/NewEmailForm.tsx +3 -3
- package/templates/default/components/NewPage.tsx +2 -2
- package/templates/default/components/NewVariantComponent.tsx +1 -1
- package/templates/default/components/ProgressBar.tsx +46 -22
- package/templates/default/components/SectionItemCard.tsx +1 -1
- package/templates/default/components/SectionItemStatusBadge.tsx +1 -1
- package/templates/default/components/SectionPage.tsx +2 -2
- package/templates/default/components/SelectBox.tsx +2 -2
- package/templates/default/components/SettingsPage.tsx +1 -1
- package/templates/default/components/Sidebar.tsx +3 -3
- package/templates/default/components/VariantEditPage.tsx +2 -2
- package/templates/default/components/form/DateRangeFormInput.tsx +8 -6
- package/templates/default/components/form/Form.tsx +1 -1
- package/templates/default/components/form/FormInputElement.tsx +1 -1
- package/templates/default/components/form/helpers/{_section-hot-reload.ts → _section-hot-reload.js} +1 -1
- package/templates/default/components/form/helpers/util.ts +1 -1
- package/templates/default/components/form/inputs/ColorFormInput.tsx +1 -1
- package/templates/default/components/form/inputs/DateFormInput.tsx +82 -34
- package/templates/default/components/form/inputs/DocumentFormInput.tsx +3 -3
- package/templates/default/components/form/inputs/MultipleSelectFormInput.tsx +40 -107
- package/templates/default/components/form/inputs/NumberFormInput.tsx +1 -1
- package/templates/default/components/form/inputs/PasswordFormInput.tsx +1 -1
- package/templates/default/components/form/inputs/PhotoFormInput.tsx +4 -4
- package/templates/default/components/form/inputs/RichTextFormInput.tsx +2 -0
- package/templates/default/components/form/inputs/SelectFormInput.tsx +1 -1
- package/templates/default/components/form/inputs/TagsFormInput.tsx +115 -26
- package/templates/default/components/form/inputs/TextFormInput.tsx +1 -1
- package/templates/default/components/form/inputs/TextareaFormInput.tsx +1 -1
- package/templates/default/components/form/inputs/VideoFormInput.tsx +3 -3
- package/templates/default/components/multi-select.tsx +1144 -0
- package/templates/default/components/ui/badge.tsx +16 -12
- package/templates/default/components/ui/button.tsx +35 -30
- package/templates/default/components/ui/calendar.tsx +145 -47
- package/templates/default/components/ui/card.tsx +1 -1
- package/templates/default/components/ui/checkbox.tsx +1 -1
- package/templates/default/components/ui/command.tsx +184 -0
- package/templates/default/components/ui/dialog.tsx +143 -0
- package/templates/default/components/ui/dropdown-menu.tsx +6 -6
- package/templates/default/components/ui/input.tsx +1 -1
- package/templates/default/components/ui/popover.tsx +39 -22
- package/templates/default/components/ui/progress.tsx +31 -0
- package/templates/default/components/ui/scroll-area.tsx +2 -2
- package/templates/default/components/ui/select.tsx +150 -149
- package/templates/default/components/ui/separator.tsx +28 -0
- package/templates/default/components/ui/sheet.tsx +1 -1
- package/templates/default/components/ui/switch.tsx +1 -1
- package/templates/default/components/ui/table.tsx +3 -3
- package/templates/default/components/ui/tabs.tsx +2 -2
- package/templates/default/components/ui/toast.tsx +4 -4
- package/templates/default/components.json +8 -3
- package/templates/default/{postinstall.js → lib/postinstall.js} +1 -1
- package/templates/default/lib/utils.ts +6 -0
- package/templates/default/package.json +27 -47
- package/templates/default/postcss.config.mjs +7 -0
- package/templates/default/public/tinymce/CHANGELOG.md +155 -0
- package/templates/default/public/tinymce/README.md +12 -12
- package/templates/default/public/tinymce/bower.json +1 -1
- package/templates/default/public/tinymce/composer.json +2 -2
- package/templates/default/public/tinymce/icons/default/icons.js +40 -32
- package/templates/default/public/tinymce/icons/default/icons.min.js +1 -1
- package/templates/default/public/tinymce/license.md +7 -4
- package/templates/default/public/tinymce/models/dom/model.js +36 -50
- package/templates/default/public/tinymce/models/dom/model.min.js +1 -1
- package/templates/default/public/tinymce/notices.txt +2 -2
- package/templates/default/public/tinymce/package.json +2 -2
- package/templates/default/public/tinymce/plugins/accordion/plugin.js +45 -21
- package/templates/default/public/tinymce/plugins/accordion/plugin.min.js +1 -1
- package/templates/default/public/tinymce/plugins/advlist/plugin.js +8 -6
- package/templates/default/public/tinymce/plugins/advlist/plugin.min.js +1 -1
- package/templates/default/public/tinymce/plugins/anchor/plugin.js +1 -1
- package/templates/default/public/tinymce/plugins/autolink/plugin.js +3 -6
- package/templates/default/public/tinymce/plugins/autolink/plugin.min.js +1 -1
- package/templates/default/public/tinymce/plugins/autoresize/plugin.js +4 -6
- package/templates/default/public/tinymce/plugins/autoresize/plugin.min.js +1 -1
- package/templates/default/public/tinymce/plugins/autosave/plugin.js +4 -7
- package/templates/default/public/tinymce/plugins/autosave/plugin.min.js +1 -1
- package/templates/default/public/tinymce/plugins/charmap/plugin.js +8 -8
- package/templates/default/public/tinymce/plugins/charmap/plugin.min.js +1 -1
- package/templates/default/public/tinymce/plugins/code/plugin.js +3 -2
- package/templates/default/public/tinymce/plugins/code/plugin.min.js +1 -1
- package/templates/default/public/tinymce/plugins/codesample/plugin.js +11 -10
- package/templates/default/public/tinymce/plugins/codesample/plugin.min.js +2 -2
- package/templates/default/public/tinymce/plugins/directionality/plugin.js +9 -11
- package/templates/default/public/tinymce/plugins/directionality/plugin.min.js +1 -1
- package/templates/default/public/tinymce/plugins/emoticons/plugin.js +7 -7
- package/templates/default/public/tinymce/plugins/emoticons/plugin.min.js +1 -1
- package/templates/default/public/tinymce/plugins/fullscreen/plugin.js +11 -13
- package/templates/default/public/tinymce/plugins/fullscreen/plugin.min.js +1 -1
- package/templates/default/public/tinymce/plugins/help/js/i18n/keynav/bg-BG.js +93 -0
- package/templates/default/public/tinymce/plugins/help/js/i18n/keynav/fr-FR.js +93 -0
- package/templates/default/public/tinymce/plugins/help/js/i18n/keynav/he-IL.js +93 -0
- package/templates/default/public/tinymce/plugins/help/js/i18n/keynav/hu-HU.js +93 -0
- package/templates/default/public/tinymce/plugins/help/js/i18n/keynav/ko-KR.js +93 -0
- package/templates/default/public/tinymce/plugins/help/js/i18n/keynav/nb-NO.js +93 -0
- package/templates/default/public/tinymce/plugins/help/js/i18n/keynav/pt-BR.js +93 -0
- package/templates/default/public/tinymce/plugins/help/js/i18n/keynav/pt-PT.js +93 -0
- package/templates/default/public/tinymce/plugins/help/js/i18n/keynav/sl-SI.js +93 -0
- package/templates/default/public/tinymce/plugins/help/js/i18n/keynav/sv-SE.js +93 -0
- package/templates/default/public/tinymce/plugins/help/js/i18n/keynav/th-TH.js +93 -0
- package/templates/default/public/tinymce/plugins/help/js/i18n/keynav/zh-CN.js +87 -0
- package/templates/default/public/tinymce/plugins/help/js/i18n/keynav/zh-TW.js +93 -0
- package/templates/default/public/tinymce/plugins/help/plugin.js +15 -17
- package/templates/default/public/tinymce/plugins/help/plugin.min.js +1 -1
- package/templates/default/public/tinymce/plugins/image/plugin.js +34 -32
- package/templates/default/public/tinymce/plugins/image/plugin.min.js +1 -1
- package/templates/default/public/tinymce/plugins/importcss/plugin.js +4 -6
- package/templates/default/public/tinymce/plugins/importcss/plugin.min.js +1 -1
- package/templates/default/public/tinymce/plugins/insertdatetime/plugin.js +4 -3
- package/templates/default/public/tinymce/plugins/insertdatetime/plugin.min.js +1 -1
- package/templates/default/public/tinymce/plugins/link/plugin.js +170 -38
- package/templates/default/public/tinymce/plugins/link/plugin.min.js +1 -1
- package/templates/default/public/tinymce/plugins/lists/plugin.js +111 -2053
- package/templates/default/public/tinymce/plugins/lists/plugin.min.js +1 -1
- package/templates/default/public/tinymce/plugins/media/plugin.js +15 -23
- package/templates/default/public/tinymce/plugins/media/plugin.min.js +1 -1
- package/templates/default/public/tinymce/plugins/nonbreaking/plugin.js +1 -1
- package/templates/default/public/tinymce/plugins/pagebreak/plugin.js +1 -1
- package/templates/default/public/tinymce/plugins/preview/plugin.js +88 -10
- package/templates/default/public/tinymce/plugins/preview/plugin.min.js +1 -1
- package/templates/default/public/tinymce/plugins/quickbars/plugin.js +9 -9
- package/templates/default/public/tinymce/plugins/quickbars/plugin.min.js +1 -1
- package/templates/default/public/tinymce/plugins/save/plugin.js +1 -1
- package/templates/default/public/tinymce/plugins/searchreplace/plugin.js +10 -13
- package/templates/default/public/tinymce/plugins/searchreplace/plugin.min.js +1 -1
- package/templates/default/public/tinymce/plugins/table/plugin.js +13 -24
- package/templates/default/public/tinymce/plugins/table/plugin.min.js +1 -1
- package/templates/default/public/tinymce/plugins/visualblocks/plugin.js +1 -1
- package/templates/default/public/tinymce/plugins/visualchars/plugin.js +9 -10
- package/templates/default/public/tinymce/plugins/visualchars/plugin.min.js +1 -1
- package/templates/default/public/tinymce/plugins/wordcount/plugin.js +1 -1
- package/templates/default/public/tinymce/skins/content/dark/content.min.ts +3 -0
- package/templates/default/public/tinymce/skins/content/dark/content.ts +3 -0
- package/templates/default/public/tinymce/skins/content/default/content.min.ts +3 -0
- package/templates/default/public/tinymce/skins/content/default/content.ts +3 -0
- package/templates/default/public/tinymce/skins/content/document/content.min.ts +3 -0
- package/templates/default/public/tinymce/skins/content/document/content.ts +3 -0
- package/templates/default/public/tinymce/skins/content/tinymce-5/content.min.ts +3 -0
- package/templates/default/public/tinymce/skins/content/tinymce-5/content.ts +3 -0
- package/templates/default/public/tinymce/skins/content/tinymce-5-dark/content.min.ts +3 -0
- package/templates/default/public/tinymce/skins/content/tinymce-5-dark/content.ts +3 -0
- package/templates/default/public/tinymce/skins/content/writer/content.min.ts +3 -0
- package/templates/default/public/tinymce/skins/content/writer/content.ts +3 -0
- package/templates/default/public/tinymce/skins/ui/oxide/content.css +144 -0
- package/templates/default/public/tinymce/skins/ui/oxide/content.inline.css +144 -0
- package/templates/default/public/tinymce/skins/ui/oxide/content.inline.js +1 -1
- package/templates/default/public/tinymce/skins/ui/oxide/content.inline.min.css +1 -1
- package/templates/default/public/tinymce/skins/ui/oxide/content.inline.min.ts +116 -0
- package/templates/default/public/tinymce/skins/ui/oxide/content.inline.ts +116 -0
- package/templates/default/public/tinymce/skins/ui/oxide/content.js +1 -1
- package/templates/default/public/tinymce/skins/ui/oxide/content.min.css +1 -1
- package/templates/default/public/tinymce/skins/ui/oxide/content.min.ts +116 -0
- package/templates/default/public/tinymce/skins/ui/oxide/content.ts +116 -0
- package/templates/default/public/tinymce/skins/ui/oxide/skin.css +923 -449
- package/templates/default/public/tinymce/skins/ui/oxide/skin.js +1 -1
- package/templates/default/public/tinymce/skins/ui/oxide/skin.min.css +1 -1
- package/templates/default/public/tinymce/skins/ui/oxide/skin.min.ts +507 -0
- package/templates/default/public/tinymce/skins/ui/oxide/skin.shadowdom.min.ts +9 -0
- package/templates/default/public/tinymce/skins/ui/oxide/skin.shadowdom.ts +9 -0
- package/templates/default/public/tinymce/skins/ui/oxide/skin.ts +507 -0
- package/templates/default/public/tinymce/skins/ui/oxide-dark/content.css +144 -0
- package/templates/default/public/tinymce/skins/ui/oxide-dark/content.inline.css +144 -0
- package/templates/default/public/tinymce/skins/ui/oxide-dark/content.inline.js +1 -1
- package/templates/default/public/tinymce/skins/ui/oxide-dark/content.inline.min.css +1 -1
- package/templates/default/public/tinymce/skins/ui/oxide-dark/content.inline.min.ts +116 -0
- package/templates/default/public/tinymce/skins/ui/oxide-dark/content.inline.ts +116 -0
- package/templates/default/public/tinymce/skins/ui/oxide-dark/content.js +1 -1
- package/templates/default/public/tinymce/skins/ui/oxide-dark/content.min.css +1 -1
- package/templates/default/public/tinymce/skins/ui/oxide-dark/content.min.ts +116 -0
- package/templates/default/public/tinymce/skins/ui/oxide-dark/content.ts +116 -0
- package/templates/default/public/tinymce/skins/ui/oxide-dark/skin.css +926 -452
- package/templates/default/public/tinymce/skins/ui/oxide-dark/skin.js +1 -1
- package/templates/default/public/tinymce/skins/ui/oxide-dark/skin.min.css +1 -1
- package/templates/default/public/tinymce/skins/ui/oxide-dark/skin.min.ts +507 -0
- package/templates/default/public/tinymce/skins/ui/oxide-dark/skin.shadowdom.min.ts +9 -0
- package/templates/default/public/tinymce/skins/ui/oxide-dark/skin.shadowdom.ts +9 -0
- package/templates/default/public/tinymce/skins/ui/oxide-dark/skin.ts +507 -0
- package/templates/default/public/tinymce/skins/ui/tinymce-5/content.css +144 -0
- package/templates/default/public/tinymce/skins/ui/tinymce-5/content.inline.css +144 -0
- package/templates/default/public/tinymce/skins/ui/tinymce-5/content.inline.js +1 -1
- package/templates/default/public/tinymce/skins/ui/tinymce-5/content.inline.min.css +1 -1
- package/templates/default/public/tinymce/skins/ui/tinymce-5/content.inline.min.ts +116 -0
- package/templates/default/public/tinymce/skins/ui/tinymce-5/content.inline.ts +116 -0
- package/templates/default/public/tinymce/skins/ui/tinymce-5/content.js +1 -1
- package/templates/default/public/tinymce/skins/ui/tinymce-5/content.min.css +1 -1
- package/templates/default/public/tinymce/skins/ui/tinymce-5/content.min.ts +116 -0
- package/templates/default/public/tinymce/skins/ui/tinymce-5/content.ts +116 -0
- package/templates/default/public/tinymce/skins/ui/tinymce-5/skin.css +924 -450
- package/templates/default/public/tinymce/skins/ui/tinymce-5/skin.js +1 -1
- package/templates/default/public/tinymce/skins/ui/tinymce-5/skin.min.css +1 -1
- package/templates/default/public/tinymce/skins/ui/tinymce-5/skin.min.ts +508 -0
- package/templates/default/public/tinymce/skins/ui/tinymce-5/skin.shadowdom.min.ts +9 -0
- package/templates/default/public/tinymce/skins/ui/tinymce-5/skin.shadowdom.ts +9 -0
- package/templates/default/public/tinymce/skins/ui/tinymce-5/skin.ts +508 -0
- package/templates/default/public/tinymce/skins/ui/tinymce-5-dark/content.css +144 -0
- package/templates/default/public/tinymce/skins/ui/tinymce-5-dark/content.inline.css +144 -0
- package/templates/default/public/tinymce/skins/ui/tinymce-5-dark/content.inline.js +1 -1
- package/templates/default/public/tinymce/skins/ui/tinymce-5-dark/content.inline.min.css +1 -1
- package/templates/default/public/tinymce/skins/ui/tinymce-5-dark/content.inline.min.ts +116 -0
- package/templates/default/public/tinymce/skins/ui/tinymce-5-dark/content.inline.ts +116 -0
- package/templates/default/public/tinymce/skins/ui/tinymce-5-dark/content.js +1 -1
- package/templates/default/public/tinymce/skins/ui/tinymce-5-dark/content.min.css +1 -1
- package/templates/default/public/tinymce/skins/ui/tinymce-5-dark/content.min.ts +116 -0
- package/templates/default/public/tinymce/skins/ui/tinymce-5-dark/content.ts +116 -0
- package/templates/default/public/tinymce/skins/ui/tinymce-5-dark/skin.css +925 -451
- package/templates/default/public/tinymce/skins/ui/tinymce-5-dark/skin.js +1 -1
- package/templates/default/public/tinymce/skins/ui/tinymce-5-dark/skin.min.css +1 -1
- package/templates/default/public/tinymce/skins/ui/tinymce-5-dark/skin.min.ts +508 -0
- package/templates/default/public/tinymce/skins/ui/tinymce-5-dark/skin.shadowdom.min.ts +9 -0
- package/templates/default/public/tinymce/skins/ui/tinymce-5-dark/skin.shadowdom.ts +9 -0
- package/templates/default/public/tinymce/skins/ui/tinymce-5-dark/skin.ts +508 -0
- package/templates/default/public/tinymce/themes/silver/theme.js +543 -593
- package/templates/default/public/tinymce/themes/silver/theme.min.js +1 -1
- package/templates/default/public/tinymce/tinymce.d.ts +559 -496
- package/templates/default/public/tinymce/tinymce.js +6788 -3964
- package/templates/default/public/tinymce/tinymce.min.js +3 -4
- package/templates/default/styles/globals.css +131 -3
- package/templates/default/tsconfig.json +1 -0
- package/templates/default/.prettierrc.json +0 -19
- package/templates/default/postcss.config.js +0 -6
- package/templates/default/tailwind.config.js +0 -95
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* TinyMCE version
|
|
2
|
+
* TinyMCE version 8.3.1 (2025-12-17)
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
5
|
(function () {
|
|
@@ -9,13 +9,12 @@
|
|
|
9
9
|
|
|
10
10
|
/* eslint-disable @typescript-eslint/no-wrapper-object-types */
|
|
11
11
|
const hasProto = (v, constructor, predicate) => {
|
|
12
|
-
var _a;
|
|
13
12
|
if (predicate(v, constructor.prototype)) {
|
|
14
13
|
return true;
|
|
15
14
|
}
|
|
16
15
|
else {
|
|
17
16
|
// String-based fallback time
|
|
18
|
-
return
|
|
17
|
+
return v.constructor?.name === constructor.name;
|
|
19
18
|
}
|
|
20
19
|
};
|
|
21
20
|
const typeOf = (x) => {
|
|
@@ -62,6 +61,9 @@
|
|
|
62
61
|
return value;
|
|
63
62
|
};
|
|
64
63
|
};
|
|
64
|
+
const identity = (x) => {
|
|
65
|
+
return x;
|
|
66
|
+
};
|
|
65
67
|
const tripleEquals = (a, b) => {
|
|
66
68
|
return a === b;
|
|
67
69
|
};
|
|
@@ -82,6 +84,11 @@
|
|
|
82
84
|
* strict-null-checks
|
|
83
85
|
*/
|
|
84
86
|
class Optional {
|
|
87
|
+
tag;
|
|
88
|
+
value;
|
|
89
|
+
// Sneaky optimisation: every instance of Optional.none is identical, so just
|
|
90
|
+
// reuse the same object
|
|
91
|
+
static singletonNone = new Optional(false);
|
|
85
92
|
// The internal representation has a `tag` and a `value`, but both are
|
|
86
93
|
// private: able to be console.logged, but not able to be accessed by code
|
|
87
94
|
constructor(tag, value) {
|
|
@@ -249,7 +256,7 @@
|
|
|
249
256
|
*/
|
|
250
257
|
getOrDie(message) {
|
|
251
258
|
if (!this.tag) {
|
|
252
|
-
throw new Error(message
|
|
259
|
+
throw new Error(message ?? 'Called getOrDie on None');
|
|
253
260
|
}
|
|
254
261
|
else {
|
|
255
262
|
return this.value;
|
|
@@ -313,15 +320,10 @@
|
|
|
313
320
|
return this.tag ? `some(${this.value})` : 'none()';
|
|
314
321
|
}
|
|
315
322
|
}
|
|
316
|
-
// Sneaky optimisation: every instance of Optional.none is identical, so just
|
|
317
|
-
// reuse the same object
|
|
318
|
-
Optional.singletonNone = new Optional(false);
|
|
319
323
|
|
|
320
|
-
/* eslint-disable @typescript-eslint/unbound-method */
|
|
321
324
|
const nativeSlice = Array.prototype.slice;
|
|
322
325
|
const nativeIndexOf = Array.prototype.indexOf;
|
|
323
326
|
const nativePush = Array.prototype.push;
|
|
324
|
-
/* eslint-enable */
|
|
325
327
|
const rawIndexOf = (ts, t) => nativeIndexOf.call(ts, t);
|
|
326
328
|
const contains = (xs, x) => rawIndexOf(xs, x) > -1;
|
|
327
329
|
const map = (xs, f) => {
|
|
@@ -366,6 +368,8 @@
|
|
|
366
368
|
return r;
|
|
367
369
|
};
|
|
368
370
|
const bind = (xs, f) => flatten(map(xs, f));
|
|
371
|
+
const get = (xs, i) => i >= 0 && i < xs.length ? Optional.some(xs[i]) : Optional.none();
|
|
372
|
+
const head = (xs) => get(xs, 0);
|
|
369
373
|
isFunction(Array.from) ? Array.from : (x) => nativeSlice.call(x);
|
|
370
374
|
const findMap = (arr, f) => {
|
|
371
375
|
for (let i = 0; i < arr.length; i++) {
|
|
@@ -382,7 +386,6 @@
|
|
|
382
386
|
//
|
|
383
387
|
// Use the native keys if it is available (IE9+), otherwise fall back to manually filtering
|
|
384
388
|
const keys = Object.keys;
|
|
385
|
-
// eslint-disable-next-line @typescript-eslint/unbound-method
|
|
386
389
|
const hasOwnProperty = Object.hasOwnProperty;
|
|
387
390
|
const each = (obj, f) => {
|
|
388
391
|
const props = keys(obj);
|
|
@@ -549,6 +552,13 @@
|
|
|
549
552
|
registerOption('link_attributes_postprocess', {
|
|
550
553
|
processor: 'function',
|
|
551
554
|
});
|
|
555
|
+
registerOption('files_upload_handler', {
|
|
556
|
+
processor: 'function'
|
|
557
|
+
});
|
|
558
|
+
registerOption('link_uploadtab', {
|
|
559
|
+
processor: 'boolean',
|
|
560
|
+
default: true
|
|
561
|
+
});
|
|
552
562
|
};
|
|
553
563
|
const assumeExternalTargets = option('link_assume_external_targets');
|
|
554
564
|
const hasContextToolbar = option('link_context_toolbar');
|
|
@@ -562,6 +572,11 @@
|
|
|
562
572
|
const allowUnsafeLinkTarget = option('allow_unsafe_link_target');
|
|
563
573
|
const useQuickLink = option('link_quicklink');
|
|
564
574
|
const attributesPostProcess = option('link_attributes_postprocess');
|
|
575
|
+
const getFilesUploadHandler = option('files_upload_handler');
|
|
576
|
+
const hasLinkUploadtab = option('link_uploadtab');
|
|
577
|
+
const getDocumentsFileTypes = option('documents_file_types');
|
|
578
|
+
const hasFilesUploadHandler = (editor) => isNonNullable(editor.options.get('files_upload_handler'));
|
|
579
|
+
const hasDocumentsFileTypes = (editor) => isNonNullable(editor.options.get('documents_file_types'));
|
|
565
580
|
|
|
566
581
|
var global$4 = tinymce.util.Tools.resolve('tinymce.util.URI');
|
|
567
582
|
|
|
@@ -591,9 +606,8 @@
|
|
|
591
606
|
};
|
|
592
607
|
const hasProtocol = (url) => /^\w+:/i.test(url);
|
|
593
608
|
const getHref = (elm) => {
|
|
594
|
-
var _a, _b;
|
|
595
609
|
// Returns the real href value not the resolved a.href value
|
|
596
|
-
return
|
|
610
|
+
return elm.getAttribute('data-mce-href') ?? elm.getAttribute('href') ?? '';
|
|
597
611
|
};
|
|
598
612
|
const applyRelTargetRules = (rel, isUnsafe) => {
|
|
599
613
|
const rules = ['noopener'];
|
|
@@ -647,6 +661,16 @@
|
|
|
647
661
|
}
|
|
648
662
|
};
|
|
649
663
|
const isImageFigure = (elm) => isNonNullable(elm) && elm.nodeName === 'FIGURE' && /\bimage\b/i.test(elm.className);
|
|
664
|
+
const blobToDataUri = (blob) => new Promise((resolve, reject) => {
|
|
665
|
+
const reader = new FileReader();
|
|
666
|
+
reader.onload = () => {
|
|
667
|
+
resolve(reader.result);
|
|
668
|
+
};
|
|
669
|
+
reader.onerror = () => {
|
|
670
|
+
reject(new Error(reader.error?.message ?? 'Failed to convert blob to a data url'));
|
|
671
|
+
};
|
|
672
|
+
reader.readAsDataURL(blob);
|
|
673
|
+
});
|
|
650
674
|
|
|
651
675
|
const getLinkAttrs = (data) => {
|
|
652
676
|
const attrs = ['title', 'rel', 'class', 'target'];
|
|
@@ -804,22 +828,20 @@
|
|
|
804
828
|
editor.hasPlugin('rtc', true) ? editor.execCommand('unlink') : unlinkDomMutation(editor);
|
|
805
829
|
};
|
|
806
830
|
const unlinkImageFigure = (editor, fig) => {
|
|
807
|
-
var _a;
|
|
808
831
|
const img = editor.dom.select('img', fig)[0];
|
|
809
832
|
if (img) {
|
|
810
833
|
const a = editor.dom.getParents(img, 'a[href]', fig)[0];
|
|
811
834
|
if (a) {
|
|
812
|
-
|
|
835
|
+
a.parentNode?.insertBefore(img, a);
|
|
813
836
|
editor.dom.remove(a);
|
|
814
837
|
}
|
|
815
838
|
}
|
|
816
839
|
};
|
|
817
840
|
const linkImageFigure = (dom, fig, attrs) => {
|
|
818
|
-
var _a;
|
|
819
841
|
const img = dom.select('img', fig)[0];
|
|
820
842
|
if (img) {
|
|
821
843
|
const a = dom.create('a', attrs);
|
|
822
|
-
|
|
844
|
+
img.parentNode?.insertBefore(a, img);
|
|
823
845
|
a.appendChild(img);
|
|
824
846
|
}
|
|
825
847
|
};
|
|
@@ -906,8 +928,8 @@
|
|
|
906
928
|
text: initialData.text,
|
|
907
929
|
title: initialData.title
|
|
908
930
|
};
|
|
909
|
-
const getTitleFromUrlChange = (url) =>
|
|
910
|
-
const getTextFromUrlChange = (url) =>
|
|
931
|
+
const getTitleFromUrlChange = (url) => someIf(persistentData.title.length <= 0, Optional.from(url.meta?.title).getOr(''));
|
|
932
|
+
const getTextFromUrlChange = (url) => someIf(persistentData.text.length <= 0, Optional.from(url.meta?.text).getOr(url.value));
|
|
911
933
|
const onUrlChange = (data) => {
|
|
912
934
|
const text = getTextFromUrlChange(data.url);
|
|
913
935
|
const title = getTitleFromUrlChange(data.url);
|
|
@@ -1021,7 +1043,7 @@
|
|
|
1021
1043
|
try {
|
|
1022
1044
|
return Optional.some(JSON.parse(text));
|
|
1023
1045
|
}
|
|
1024
|
-
catch
|
|
1046
|
+
catch {
|
|
1025
1047
|
return Optional.none();
|
|
1026
1048
|
}
|
|
1027
1049
|
};
|
|
@@ -1113,6 +1135,7 @@
|
|
|
1113
1135
|
};
|
|
1114
1136
|
};
|
|
1115
1137
|
const collect = (editor, linkNode) => LinkListOptions.getLinks(editor).then((links) => {
|
|
1138
|
+
const hasUploadPanel = hasFilesUploadHandler(editor) && hasDocumentsFileTypes(editor) && hasLinkUploadtab(editor);
|
|
1116
1139
|
const anchor = extractFromAnchor(editor, linkNode);
|
|
1117
1140
|
return {
|
|
1118
1141
|
anchor,
|
|
@@ -1124,6 +1147,7 @@
|
|
|
1124
1147
|
anchor: AnchorListOptions.getAnchors(editor),
|
|
1125
1148
|
link: links
|
|
1126
1149
|
},
|
|
1150
|
+
hasUploadPanel,
|
|
1127
1151
|
optNode: linkNode,
|
|
1128
1152
|
flags: {
|
|
1129
1153
|
titleEnabled: shouldShowLinkTitle(editor)
|
|
@@ -1134,6 +1158,27 @@
|
|
|
1134
1158
|
collect
|
|
1135
1159
|
};
|
|
1136
1160
|
|
|
1161
|
+
const makeTab = (fileTypes) => {
|
|
1162
|
+
const items = [
|
|
1163
|
+
{
|
|
1164
|
+
type: 'dropzone',
|
|
1165
|
+
name: 'fileinput',
|
|
1166
|
+
buttonLabel: 'Browse for a file',
|
|
1167
|
+
dropAreaLabel: 'Drop a file here',
|
|
1168
|
+
allowedFileTypes: fileTypes.map((e) => e.mimeType).join(','),
|
|
1169
|
+
allowedFileExtensions: flatten(fileTypes.map((e) => e.extensions)),
|
|
1170
|
+
}
|
|
1171
|
+
];
|
|
1172
|
+
return {
|
|
1173
|
+
title: 'Upload',
|
|
1174
|
+
name: 'upload',
|
|
1175
|
+
items
|
|
1176
|
+
};
|
|
1177
|
+
};
|
|
1178
|
+
const UploadTab = {
|
|
1179
|
+
makeTab
|
|
1180
|
+
};
|
|
1181
|
+
|
|
1137
1182
|
const handleSubmit = (editor, info) => (api) => {
|
|
1138
1183
|
const data = api.getData();
|
|
1139
1184
|
if (!data.url.value) {
|
|
@@ -1163,6 +1208,60 @@
|
|
|
1163
1208
|
});
|
|
1164
1209
|
api.close();
|
|
1165
1210
|
};
|
|
1211
|
+
const uploadFile = (editor) => (blobInfo, progress) => {
|
|
1212
|
+
const fileUploadHandler = getFilesUploadHandler(editor);
|
|
1213
|
+
return fileUploadHandler(blobInfo, progress);
|
|
1214
|
+
};
|
|
1215
|
+
const dataUrlToBase64 = (dataUrl) => Optional.from(dataUrl.split(',')[1]).getOr('');
|
|
1216
|
+
const changeFileInput = (helpers, api) => {
|
|
1217
|
+
const data = api.getData();
|
|
1218
|
+
api.block('Uploading file');
|
|
1219
|
+
head(data.fileinput)
|
|
1220
|
+
.fold(() => {
|
|
1221
|
+
api.unblock();
|
|
1222
|
+
}, (file) => {
|
|
1223
|
+
const blobUri = URL.createObjectURL(file);
|
|
1224
|
+
const updateUrlAndSwitchTab = ({ url, fileName }) => {
|
|
1225
|
+
api.setData({ text: fileName, title: fileName, url: { value: url, meta: {} } });
|
|
1226
|
+
api.showTab('general');
|
|
1227
|
+
api.focus('url');
|
|
1228
|
+
};
|
|
1229
|
+
const finalize = () => {
|
|
1230
|
+
api.unblock();
|
|
1231
|
+
URL.revokeObjectURL(blobUri);
|
|
1232
|
+
};
|
|
1233
|
+
blobToDataUri(file).then((dataUrl) => {
|
|
1234
|
+
const existingBlobInfo = helpers.getExistingBlobInfo(dataUrlToBase64(dataUrl), file.type);
|
|
1235
|
+
const blobInfo = existingBlobInfo && existingBlobInfo.filename() === file.name ? existingBlobInfo : helpers.createBlobCache(file, blobUri, dataUrl);
|
|
1236
|
+
helpers.addToBlobCache(blobInfo);
|
|
1237
|
+
return helpers.uploadFile(blobInfo, identity);
|
|
1238
|
+
}).then((result) => {
|
|
1239
|
+
updateUrlAndSwitchTab(result);
|
|
1240
|
+
finalize();
|
|
1241
|
+
}).catch((err) => {
|
|
1242
|
+
finalize();
|
|
1243
|
+
helpers.alertErr(err, () => {
|
|
1244
|
+
api.focus('fileinput');
|
|
1245
|
+
});
|
|
1246
|
+
});
|
|
1247
|
+
});
|
|
1248
|
+
};
|
|
1249
|
+
const createBlobCache = (editor) => (file, blobUri, dataUrl) => editor.editorUpload.blobCache.create({
|
|
1250
|
+
blob: file,
|
|
1251
|
+
blobUri,
|
|
1252
|
+
name: file.name?.replace(/\.[^\.]+$/, ''),
|
|
1253
|
+
filename: file.name,
|
|
1254
|
+
base64: dataUrl.split(',')[1]
|
|
1255
|
+
});
|
|
1256
|
+
const addToBlobCache = (editor) => (blobInfo) => {
|
|
1257
|
+
editor.editorUpload.blobCache.add(blobInfo);
|
|
1258
|
+
};
|
|
1259
|
+
const getExistingBlobInfo = (editor) => (base64, type) => {
|
|
1260
|
+
return editor.editorUpload.blobCache.getByData(base64, type);
|
|
1261
|
+
};
|
|
1262
|
+
const alertErr = (editor) => (message, callback) => {
|
|
1263
|
+
editor.windowManager.alert(message, callback);
|
|
1264
|
+
};
|
|
1166
1265
|
const collectData = (editor) => {
|
|
1167
1266
|
const anchorNode = getAnchorElement(editor);
|
|
1168
1267
|
return DialogInfo.collect(editor, anchorNode);
|
|
@@ -1185,9 +1284,44 @@
|
|
|
1185
1284
|
link: url,
|
|
1186
1285
|
rel: anchor.rel.getOr(''),
|
|
1187
1286
|
target: anchor.target.or(defaultTarget).getOr(''),
|
|
1188
|
-
linkClass: anchor.linkClass.getOr('')
|
|
1287
|
+
linkClass: anchor.linkClass.getOr(''),
|
|
1288
|
+
fileinput: []
|
|
1189
1289
|
};
|
|
1190
1290
|
};
|
|
1291
|
+
const makeDialogBody = (urlInput, displayText, titleText, catalogs, hasUploadPanel, fileTypes) => {
|
|
1292
|
+
const generalPanelItems = flatten([
|
|
1293
|
+
urlInput,
|
|
1294
|
+
displayText,
|
|
1295
|
+
titleText,
|
|
1296
|
+
cat([
|
|
1297
|
+
catalogs.anchor.map(ListOptions.createUi('anchor', 'Anchors')),
|
|
1298
|
+
catalogs.rels.map(ListOptions.createUi('rel', 'Rel')),
|
|
1299
|
+
catalogs.targets.map(ListOptions.createUi('target', 'Open link in...')),
|
|
1300
|
+
catalogs.link.map(ListOptions.createUi('link', 'Link list')),
|
|
1301
|
+
catalogs.classes.map(ListOptions.createUi('linkClass', 'Class'))
|
|
1302
|
+
])
|
|
1303
|
+
]);
|
|
1304
|
+
if (hasUploadPanel) {
|
|
1305
|
+
const tabPanel = {
|
|
1306
|
+
type: 'tabpanel',
|
|
1307
|
+
tabs: flatten([
|
|
1308
|
+
[{
|
|
1309
|
+
title: 'General',
|
|
1310
|
+
name: 'general',
|
|
1311
|
+
items: generalPanelItems
|
|
1312
|
+
}],
|
|
1313
|
+
[UploadTab.makeTab(fileTypes)]
|
|
1314
|
+
])
|
|
1315
|
+
};
|
|
1316
|
+
return tabPanel;
|
|
1317
|
+
}
|
|
1318
|
+
else {
|
|
1319
|
+
return {
|
|
1320
|
+
type: 'panel',
|
|
1321
|
+
items: generalPanelItems
|
|
1322
|
+
};
|
|
1323
|
+
}
|
|
1324
|
+
};
|
|
1191
1325
|
const makeDialog = (settings, onSubmit, editor) => {
|
|
1192
1326
|
const urlInput = [
|
|
1193
1327
|
{
|
|
@@ -1214,20 +1348,13 @@
|
|
|
1214
1348
|
const initialData = getInitialData(settings, defaultTarget);
|
|
1215
1349
|
const catalogs = settings.catalogs;
|
|
1216
1350
|
const dialogDelta = DialogChanges.init(initialData, catalogs);
|
|
1217
|
-
const body =
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
catalogs.anchor.map(ListOptions.createUi('anchor', 'Anchors')),
|
|
1225
|
-
catalogs.rels.map(ListOptions.createUi('rel', 'Rel')),
|
|
1226
|
-
catalogs.targets.map(ListOptions.createUi('target', 'Open link in...')),
|
|
1227
|
-
catalogs.link.map(ListOptions.createUi('link', 'Link list')),
|
|
1228
|
-
catalogs.classes.map(ListOptions.createUi('linkClass', 'Class'))
|
|
1229
|
-
])
|
|
1230
|
-
])
|
|
1351
|
+
const body = makeDialogBody(urlInput, displayText, titleText, catalogs, settings.hasUploadPanel, getDocumentsFileTypes(editor));
|
|
1352
|
+
const helpers = {
|
|
1353
|
+
addToBlobCache: addToBlobCache(editor),
|
|
1354
|
+
createBlobCache: createBlobCache(editor),
|
|
1355
|
+
alertErr: alertErr(editor),
|
|
1356
|
+
uploadFile: uploadFile(editor),
|
|
1357
|
+
getExistingBlobInfo: getExistingBlobInfo(editor)
|
|
1231
1358
|
};
|
|
1232
1359
|
return {
|
|
1233
1360
|
title: 'Insert/Edit Link',
|
|
@@ -1248,9 +1375,14 @@
|
|
|
1248
1375
|
],
|
|
1249
1376
|
initialData,
|
|
1250
1377
|
onChange: (api, { name }) => {
|
|
1251
|
-
|
|
1252
|
-
api
|
|
1253
|
-
}
|
|
1378
|
+
if (name === 'fileinput') {
|
|
1379
|
+
changeFileInput(helpers, api);
|
|
1380
|
+
}
|
|
1381
|
+
else {
|
|
1382
|
+
dialogDelta.onChange(api.getData, { name }).each((newData) => {
|
|
1383
|
+
api.setData(newData);
|
|
1384
|
+
});
|
|
1385
|
+
}
|
|
1254
1386
|
},
|
|
1255
1387
|
onSubmit
|
|
1256
1388
|
};
|
|
@@ -1268,7 +1400,7 @@
|
|
|
1268
1400
|
|
|
1269
1401
|
const register = (editor) => {
|
|
1270
1402
|
editor.addCommand('mceLink', (_ui, value) => {
|
|
1271
|
-
if (
|
|
1403
|
+
if (value?.dialog === true || !useQuickLink(editor)) {
|
|
1272
1404
|
open(editor);
|
|
1273
1405
|
}
|
|
1274
1406
|
else {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager");const t=e=>t=>(e=>{const t=typeof e;return null===e?"null":"object"===t&&Array.isArray(e)?"array":"object"===t&&(n=o=e,(r=String).prototype.isPrototypeOf(n)||(null===(l=o.constructor)||void 0===l?void 0:l.name)===r.name)?"string":t;var n,o,r,l})(t)===e,n=e=>t=>typeof t===e,o=t("string"),r=t("object"),l=t("array"),s=e=>null===e;const a=n("boolean"),i=e=>!(e=>null==e)(e),c=n("function"),u=(e,t)=>{if(l(e)){for(let n=0,o=e.length;n<o;++n)if(!t(e[n]))return!1;return!0}return!1},g=()=>{},d=(e,t)=>e===t;class m{constructor(e,t){this.tag=e,this.value=t}static some(e){return new m(!0,e)}static none(){return m.singletonNone}fold(e,t){return this.tag?t(this.value):e()}isSome(){return this.tag}isNone(){return!this.tag}map(e){return this.tag?m.some(e(this.value)):m.none()}bind(e){return this.tag?e(this.value):m.none()}exists(e){return this.tag&&e(this.value)}forall(e){return!this.tag||e(this.value)}filter(e){return!this.tag||e(this.value)?this:m.none()}getOr(e){return this.tag?this.value:e}or(e){return this.tag?this:e}getOrThunk(e){return this.tag?this.value:e()}orThunk(e){return this.tag?this:e()}getOrDie(e){if(this.tag)return this.value;throw new Error(null!=e?e:"Called getOrDie on None")}static from(e){return i(e)?m.some(e):m.none()}getOrNull(){return this.tag?this.value:null}getOrUndefined(){return this.value}each(e){this.tag&&e(this.value)}toArray(){return this.tag?[this.value]:[]}toString(){return this.tag?`some(${this.value})`:"none()"}}m.singletonNone=new m(!1),Array.prototype.slice;const h=Array.prototype.indexOf,p=Array.prototype.push,f=e=>{const t=[];for(let n=0,o=e.length;n<o;++n){if(!l(e[n]))throw new Error("Arr.flatten item "+n+" was not an array, input: "+e);p.apply(t,e[n])}return t};c(Array.from)&&Array.from;const k=(e,t)=>{for(let n=0;n<e.length;n++){const o=t(e[n],n);if(o.isSome())return o}return m.none()},v=Object.keys,y=Object.hasOwnProperty,b=(e,t)=>y.call(e,t),x=(e,t,n=d)=>e.exists((e=>n(e,t))),_=e=>{const t=[],n=e=>{t.push(e)};for(let t=0;t<e.length;t++)e[t].each(n);return t},w=(e,t)=>e?m.some(t):m.none(),C=e=>t=>t.options.get(e),A=C("link_assume_external_targets"),O=C("link_context_toolbar"),S=C("link_list"),N=C("link_default_target"),E=C("link_default_protocol"),R=C("link_target_list"),T=C("link_rel_list"),L=C("link_class_list"),P=C("link_title"),M=C("allow_unsafe_link_target"),D=C("link_quicklink"),B=C("link_attributes_postprocess");var I=tinymce.util.Tools.resolve("tinymce.util.URI"),K=tinymce.util.Tools.resolve("tinymce.dom.TreeWalker"),j=tinymce.util.Tools.resolve("tinymce.util.Tools");const U=e=>i(e)&&"a"===e.nodeName.toLowerCase(),q=e=>U(e)&&!!$(e),F=(e,t)=>{if(e.collapsed)return[];{const n=e.cloneContents(),o=n.firstChild,r=new K(o,n),l=[];let s=o;do{t(s)&&l.push(s)}while(s=r.next());return l}},V=e=>/^\w+:/i.test(e),$=e=>{var t,n;return null!==(n=null!==(t=e.getAttribute("data-mce-href"))&&void 0!==t?t:e.getAttribute("href"))&&void 0!==n?n:""},z=(e,t)=>{const n=["noopener"],o=e?e.split(/\s+/):[],r=e=>e.filter((e=>-1===j.inArray(n,e))),l=t?(e=>(e=r(e)).length>0?e.concat(n):n)(o):r(o);return l.length>0?(e=>j.trim(e.sort().join(" ")))(l):""},G=(e,t)=>(t=t||W(e.selection.getRng())[0]||e.selection.getNode(),Z(t)?m.from(e.dom.select("a[href]",t)[0]):m.from(e.dom.getParent(t,"a[href]"))),H=(e,t)=>G(e,t).isSome(),J=(e,t)=>t.fold((()=>e.getContent({format:"text"})),(e=>e.innerText||e.textContent||"")).replace(/\uFEFF/g,""),W=e=>F(e,q),Q=e=>j.grep(e,q),X=e=>Q(e).length>0,Y=e=>{const t=e.schema.getTextInlineElements();if(G(e).exists((e=>e.hasAttribute("data-mce-block"))))return!1;const n=e.selection.getRng();return!!n.collapsed||0===F(n,(e=>1===e.nodeType&&!U(e)&&!b(t,e.nodeName.toLowerCase()))).length},Z=e=>i(e)&&"FIGURE"===e.nodeName&&/\bimage\b/i.test(e.className),ee=(e,t,n)=>{const o=e.selection.getNode(),r=G(e,o),l=((e,t)=>{const n={...t};if(0===T(e).length&&!M(e)){const e=z(n.rel,"_blank"===n.target);n.rel=e||null}return m.from(n.target).isNone()&&!1===R(e)&&(n.target=N(e)),n.href=((e,t)=>"http"!==t&&"https"!==t||V(e)?e:t+"://"+e)(n.href,A(e)),n})(e,(e=>{return t=["title","rel","class","target"],n=(t,n)=>(e[n].each((e=>{t[n]=e.length>0?e:null})),t),o={href:e.href},((e,t)=>{for(let n=0,o=e.length;n<o;n++)t(e[n],n)})(t,((e,t)=>{o=n(o,e)})),o;var t,n,o})(n)),s=B(e);i(s)&&s(l),e.undoManager.transact((()=>{n.href===t.href&&t.attach(),r.fold((()=>{((e,t,n,o)=>{const r=e.dom;Z(t)?le(r,t,o):n.fold((()=>{e.execCommand("mceInsertLink",!1,o);const t=e.selection.getEnd(),n=r.createRng();n.setStartAfter(t),n.setEndAfter(t),e.selection.setRng(n)}),(t=>{e.insertContent(r.createHTML("a",o,r.encode(t)))}))})(e,o,n.text,l)}),(t=>{e.focus(),((e,t,n,o)=>{n.each((e=>{b(t,"innerText")?t.innerText=e:t.textContent=e})),e.dom.setAttribs(t,o);const r=e.dom.createRng();r.setStartAfter(t),r.setEndAfter(t),e.selection.setRng(r)})(e,t,n.text,l)}))}))},te=e=>{const{class:t,href:n,rel:o,target:r,text:l,title:a}=e;return(e=>{const t={};var n;return((e,t,n,o)=>{((e,t)=>{const n=v(e);for(let o=0,r=n.length;o<r;o++){const r=n[o];t(e[r],r)}})(e,((e,r)=>{(t(e,r)?n:o)(e,r)}))})(e,((e,t)=>!1===s(e)),(n=t,(e,t)=>{n[t]=e}),g),t})({class:t.getOrNull(),href:n,rel:o.getOrNull(),target:r.getOrNull(),text:l.getOrNull(),title:a.getOrNull()})},ne=(e,t,n)=>{const o=((e,t)=>{const n=e.options.get,o={allow_html_data_urls:n("allow_html_data_urls"),allow_script_urls:n("allow_script_urls"),allow_svg_data_urls:n("allow_svg_data_urls")},r=t.href;return{...t,href:I.isDomSafe(r,"a",o)?r:""}})(e,n);e.hasPlugin("rtc",!0)?e.execCommand("createlink",!1,te(o)):ee(e,t,o)},oe=e=>{e.hasPlugin("rtc",!0)?e.execCommand("unlink"):(e=>{e.undoManager.transact((()=>{const t=e.selection.getNode();Z(t)?re(e,t):(e=>{const t=e.dom,n=e.selection,o=n.getBookmark(),r=n.getRng().cloneRange(),l=t.getParent(r.startContainer,"a[href]",e.getBody()),s=t.getParent(r.endContainer,"a[href]",e.getBody());l&&r.setStartBefore(l),s&&r.setEndAfter(s),n.setRng(r),e.execCommand("unlink"),n.moveToBookmark(o)})(e),e.focus()}))})(e)},re=(e,t)=>{var n;const o=e.dom.select("img",t)[0];if(o){const r=e.dom.getParents(o,"a[href]",t)[0];r&&(null===(n=r.parentNode)||void 0===n||n.insertBefore(o,r),e.dom.remove(r))}},le=(e,t,n)=>{var o;const r=e.select("img",t)[0];if(r){const t=e.create("a",n);null===(o=r.parentNode)||void 0===o||o.insertBefore(t,r),t.appendChild(r)}},se=e=>o(e.value)?e.value:"",ae=(e,t)=>{const n=[];return j.each(e,(e=>{const r=(e=>o(e.text)?e.text:o(e.title)?e.title:"")(e);if(void 0!==e.menu){const o=ae(e.menu,t);n.push({text:r,items:o})}else{const o=t(e);n.push({text:r,value:o})}})),n},ie=(e=se)=>t=>m.from(t).map((t=>ae(t,e))),ce=e=>ie(se)(e),ue=ie,ge=(e,t)=>n=>({name:e,type:"listbox",label:t,items:n}),de=se,me=(e,t)=>k(t,(t=>(e=>{return b(t=e,n="items")&&void 0!==t[n]&&null!==t[n];var t,n})(t)?me(e,t.items):w(t.value===e,t))),he=(e,t)=>{const n={text:e.text,title:e.title},o=(e,o)=>{const r=(l=t,s=o,"link"===s?l.link:"anchor"===s?l.anchor:m.none()).getOr([]);var l,s;return((e,t,n,o)=>{const r=o[t],l=e.length>0;return void 0!==r?me(r,n).map((t=>({url:{value:t.value,meta:{text:l?e:t.text,attach:g}},text:l?e:t.text}))):m.none()})(n.text,o,r,e)};return{onChange:(e,t)=>{const r=t.name;return"url"===r?(e=>{const t=(o=e.url,w(n.text.length<=0,m.from(null===(r=o.meta)||void 0===r?void 0:r.text).getOr(o.value)));var o,r;const l=(e=>{var t;return w(n.title.length<=0,m.from(null===(t=e.meta)||void 0===t?void 0:t.title).getOr(""))})(e.url);return t.isSome()||l.isSome()?m.some({...t.map((e=>({text:e}))).getOr({}),...l.map((e=>({title:e}))).getOr({})}):m.none()})(e()):((e,t)=>h.call(e,t))(["anchor","link"],r)>-1?o(e(),r):"text"===r||"title"===r?(n[r]=e()[r],m.none()):m.none()}}};var pe=tinymce.util.Tools.resolve("tinymce.util.Delay");const fe=e=>{const t=e.href;return t.indexOf("@")>0&&-1===t.indexOf("/")&&-1===t.indexOf("mailto:")?m.some({message:"The URL you entered seems to be an email address. Do you want to add the required mailto: prefix?",preprocess:e=>({...e,href:"mailto:"+t})}):m.none()},ke=(e,t)=>n=>{const o=n.href;return 1===e&&!V(o)||0===e&&/^\s*www(\.|\d\.)/i.test(o)?m.some({message:`The URL you entered seems to be an external link. Do you want to add the required ${t}:// prefix?`,preprocess:e=>({...e,href:t+"://"+o})}):m.none()},ve=e=>{const t=e.dom.select("a:not([href])"),n=f(((e,t)=>{const n=e.length,o=new Array(n);for(let r=0;r<n;r++){const n=e[r];o[r]=t(n,r)}return o})(t,(e=>{const t=e.name||e.id;return t?[{text:t,value:"#"+t}]:[]})));return n.length>0?m.some([{text:"None",value:""}].concat(n)):m.none()},ye=e=>{const t=L(e);return t.length>0?ce(t):m.none()},be=e=>{try{return m.some(JSON.parse(e))}catch(e){return m.none()}},xe=(e,t)=>{const n=T(e);if(n.length>0){const o=x(t,"_blank"),r=e=>z(de(e),o);return(!1===M(e)?ue(r):ce)(n)}return m.none()},_e=[{text:"Current window",value:""},{text:"New window",value:"_blank"}],we=e=>{const t=R(e);return l(t)?ce(t).orThunk((()=>m.some(_e))):!1===t?m.none():m.some(_e)},Ce=(e,t,n)=>{const o=e.getAttrib(t,n);return null!==o&&o.length>0?m.some(o):m.none()},Ae=(e,t)=>(e=>{const t=t=>e.convertURL(t.value||t.url||"","href"),n=S(e);return new Promise((e=>{o(n)?fetch(n).then((e=>e.ok?e.text().then(be):Promise.reject())).then(e,(()=>e(m.none()))):c(n)?n((t=>e(m.some(t)))):e(m.from(n))})).then((e=>e.bind(ue(t)).map((e=>e.length>0?[{text:"None",value:""}].concat(e):e))))})(e).then((n=>{const o=((e,t)=>{const n=e.dom,o=Y(e)?m.some(J(e.selection,t)):m.none(),r=t.bind((e=>m.from(n.getAttrib(e,"href")))),l=t.bind((e=>m.from(n.getAttrib(e,"target")))),s=t.bind((e=>Ce(n,e,"rel"))),a=t.bind((e=>Ce(n,e,"class")));return{url:r,text:o,title:t.bind((e=>Ce(n,e,"title"))),target:l,rel:s,linkClass:a}})(e,t);return{anchor:o,catalogs:{targets:we(e),rels:xe(e,o.target),classes:ye(e),anchor:ve(e),link:n},optNode:t,flags:{titleEnabled:P(e)}}})),Oe=e=>{const t=(e=>{const t=G(e);return Ae(e,t)})(e);t.then((t=>{const n=((e,t)=>n=>{const o=n.getData();if(!o.url.value)return oe(e),void n.close();const r=e=>m.from(o[e]).filter((n=>!x(t.anchor[e],n))),l={href:o.url.value,text:r("text"),target:r("target"),rel:r("rel"),class:r("linkClass"),title:r("title")},s={href:o.url.value,attach:void 0!==o.url.meta&&o.url.meta.attach?o.url.meta.attach:g};((e,t)=>k([fe,ke(A(e),E(e))],(e=>e(t))).fold((()=>Promise.resolve(t)),(n=>new Promise((o=>{((e,t,n)=>{const o=e.selection.getRng();pe.setEditorTimeout(e,(()=>{e.windowManager.confirm(t,(t=>{e.selection.setRng(o),n(t)}))}))})(e,n.message,(e=>{o(e?n.preprocess(t):t)}))})))))(e,l).then((t=>{ne(e,s,t)})),n.close()})(e,t);return((e,t,n)=>{const o=e.anchor.text.map((()=>({name:"text",type:"input",label:"Text to display"}))).toArray(),r=e.flags.titleEnabled?[{name:"title",type:"input",label:"Title"}]:[],l=((e,t)=>{const n=e.anchor,o=n.url.getOr("");return{url:{value:o,meta:{original:{value:o}}},text:n.text.getOr(""),title:n.title.getOr(""),anchor:o,link:o,rel:n.rel.getOr(""),target:n.target.or(t).getOr(""),linkClass:n.linkClass.getOr("")}})(e,m.from(N(n))),s=e.catalogs,a=he(l,s);return{title:"Insert/Edit Link",size:"normal",body:{type:"panel",items:f([[{name:"url",type:"urlinput",filetype:"file",label:"URL",picker_text:"Browse links"}],o,r,_([s.anchor.map(ge("anchor","Anchors")),s.rels.map(ge("rel","Rel")),s.targets.map(ge("target","Open link in...")),s.link.map(ge("link","Link list")),s.classes.map(ge("linkClass","Class"))])])},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:l,onChange:(e,{name:t})=>{a.onChange(e.getData,{name:t}).each((t=>{e.setData(t)}))},onSubmit:t}})(t,n,e)})).then((t=>{e.windowManager.open(t)}))};var Se=tinymce.util.Tools.resolve("tinymce.util.VK");const Ne=(e,t)=>{if(t){const o=$(t);if(/^#/.test(o)){const t=e.dom.select(`${o},[name="${n=o,((e,t)=>((e,t)=>""===t||e.length>=t.length&&e.substr(0,0+t.length)===t)(e,t))(n,"#")?(e=>e.substring(1))(n):n}"]`);t.length&&e.selection.scrollIntoView(t[0],!0)}else(e=>{const t=document.createElement("a");t.target="_blank",t.href=e,t.rel="noreferrer noopener";const n=new MouseEvent("click",{bubbles:!0,cancelable:!0,view:window});document.dispatchEvent(n),((e,t)=>{document.body.appendChild(e),e.dispatchEvent(t),document.body.removeChild(e)})(t,n)})(t.href)}var n},Ee=(e,t)=>{const n=Q(e.dom.getParents(t));return w(1===n.length,n[0])},Re=e=>e.selection.isCollapsed()||(e=>{const t=e.selection.getRng(),n=t.startContainer;return q(n)&&t.startContainer===t.endContainer&&1===e.dom.select("img",n).length})(e)?Ee(e,e.selection.getStart()):(e=>{const t=W(e.selection.getRng());return w(t.length>0,t[0]).or(Ee(e,e.selection.getNode()))})(e),Te=e=>()=>{e.execCommand("mceLink",!1,{dialog:!0})},Le=(e,t)=>(e.on("NodeChange",t),()=>e.off("NodeChange",t)),Pe=e=>t=>{const n=()=>{t.setActive(!e.mode.isReadOnly()&&H(e,e.selection.getNode())),t.setEnabled(e.selection.isEditable())};return n(),Le(e,n)},Me=e=>t=>{const n=()=>{t.setEnabled(e.selection.isEditable())};return n(),Le(e,n)},De=e=>t=>{const n=e.dom.getParents(e.selection.getStart()),o=n=>{t.setEnabled((t=>{return X(t)||(n=e.selection.getRng(),W(n).length>0);var n})(n)&&e.selection.isEditable())};return o(n),Le(e,(e=>o(e.parents)))},Be=e=>{const t=(e=>{const t=(()=>{const e=(e=>{const t=(e=>{let t=e;return{get:()=>t,set:e=>{t=e}}})(m.none()),n=()=>t.get().each(e);return{clear:()=>{n(),t.set(m.none())},isSet:()=>t.get().isSome(),get:()=>t.get(),set:e=>{n(),t.set(m.some(e))}}})(g);return{...e,on:t=>e.get().each(t)}})(),n=()=>t.get().or(Re(e));return e.on("contextmenu",(n=>{Ee(e,n.target).each(t.set)})),e.on("SelectionChange",(()=>{t.isSet()||Re(e).each(t.set)})),e.on("click",(n=>{t.clear();const o=Q(e.dom.getParents(n.target));1===o.length&&Se.metaKeyPressed(n)&&(n.preventDefault(),Ne(e,o[0]))})),e.on("keydown",(o=>{t.clear(),!o.isDefaultPrevented()&&13===o.keyCode&&(e=>!0===e.altKey&&!1===e.shiftKey&&!1===e.ctrlKey&&!1===e.metaKey)(o)&&n().each((t=>{o.preventDefault(),Ne(e,t)}))})),{gotoSelectedLink:()=>n().each((t=>Ne(e,t)))}})(e);((e,t)=>{e.ui.registry.addToggleButton("link",{icon:"link",tooltip:"Insert/edit link",shortcut:"Meta+K",onAction:Te(e),onSetup:Pe(e)}),e.ui.registry.addButton("openlink",{icon:"new-tab",tooltip:"Open link",onAction:t.gotoSelectedLink,onSetup:De(e)}),e.ui.registry.addButton("unlink",{icon:"unlink",tooltip:"Remove link",onAction:()=>oe(e),onSetup:De(e)})})(e,t),((e,t)=>{e.ui.registry.addMenuItem("openlink",{text:"Open link",icon:"new-tab",onAction:t.gotoSelectedLink,onSetup:De(e)}),e.ui.registry.addMenuItem("link",{icon:"link",text:"Link...",shortcut:"Meta+K",onAction:Te(e),onSetup:Me(e)}),e.ui.registry.addMenuItem("unlink",{icon:"unlink",text:"Remove link",onAction:()=>oe(e),onSetup:De(e)})})(e,t),(e=>{e.ui.registry.addContextMenu("link",{update:t=>e.dom.isEditable(t)?X(e.dom.getParents(t,"a"))?"link unlink openlink":"link":""})})(e),((e,t)=>{const n=t=>{const n=e.selection.getNode();return t.setEnabled(H(e,n)&&e.selection.isEditable()),g};e.ui.registry.addContextForm("quicklink",{launch:{type:"contextformtogglebutton",icon:"link",tooltip:"Link",onSetup:Pe(e)},label:"Link",predicate:t=>O(e)&&H(e,t),initValue:()=>G(e).fold((()=>""),$),commands:[{type:"contextformtogglebutton",icon:"link",tooltip:"Link",primary:!0,onSetup:t=>{const n=e.selection.getNode();return t.setActive(H(e,n)),Pe(e)(t)},onAction:t=>{const n=t.getValue(),o=(t=>{const n=G(e),o=Y(e);if(n.isNone()&&o){const o=J(e.selection,n);return w(0===o.length,t)}return m.none()})(n);ne(e,{href:n,attach:g},{href:n,text:o,title:m.none(),rel:m.none(),target:m.from(N(e)),class:m.none()}),(e=>{e.selection.collapse(!1)})(e),t.hide()}},{type:"contextformbutton",icon:"unlink",tooltip:"Remove link",onSetup:n,onAction:t=>{oe(e),t.hide()}},{type:"contextformbutton",icon:"new-tab",tooltip:"Open link",onSetup:n,onAction:e=>{t.gotoSelectedLink(),e.hide()}}]})})(e,t)};e.add("link",(e=>{(e=>{const t=e.options.register;t("link_assume_external_targets",{processor:e=>{const t=o(e)||a(e);return t?!0===e?{value:1,valid:t}:"http"===e||"https"===e?{value:e,valid:t}:{value:0,valid:t}:{valid:!1,message:"Must be a string or a boolean."}},default:!1}),t("link_context_toolbar",{processor:"boolean",default:!1}),t("link_list",{processor:e=>o(e)||c(e)||u(e,r)}),t("link_default_target",{processor:"string"}),t("link_default_protocol",{processor:"string",default:"https"}),t("link_target_list",{processor:e=>a(e)||u(e,r),default:!0}),t("link_rel_list",{processor:"object[]",default:[]}),t("link_class_list",{processor:"object[]",default:[]}),t("link_title",{processor:"boolean",default:!0}),t("allow_unsafe_link_target",{processor:"boolean",default:!1}),t("link_quicklink",{processor:"boolean",default:!1}),t("link_attributes_postprocess",{processor:"function"})})(e),(e=>{e.addCommand("mceLink",((t,n)=>{!0!==(null==n?void 0:n.dialog)&&D(e)?e.dispatch("contexttoolbar-show",{toolbarKey:"quicklink"}):Oe(e)}))})(e),Be(e),(e=>{e.addShortcut("Meta+K","",(()=>{e.execCommand("mceLink")}))})(e)}))}();
|
|
1
|
+
!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager");const t=e=>t=>(e=>{const t=typeof e;return null===e?"null":"object"===t&&Array.isArray(e)?"array":"object"===t&&(n=o=e,(r=String).prototype.isPrototypeOf(n)||o.constructor?.name===r.name)?"string":t;var n,o,r})(t)===e,n=e=>t=>typeof t===e,o=t("string"),r=t("object"),l=t("array"),a=e=>null===e;const s=n("boolean"),i=e=>!(e=>null==e)(e),c=n("function"),u=(e,t)=>{if(l(e)){for(let n=0,o=e.length;n<o;++n)if(!t(e[n]))return!1;return!0}return!1},g=()=>{},d=e=>e,m=(e,t)=>e===t;class h{tag;value;static singletonNone=new h(!1);constructor(e,t){this.tag=e,this.value=t}static some(e){return new h(!0,e)}static none(){return h.singletonNone}fold(e,t){return this.tag?t(this.value):e()}isSome(){return this.tag}isNone(){return!this.tag}map(e){return this.tag?h.some(e(this.value)):h.none()}bind(e){return this.tag?e(this.value):h.none()}exists(e){return this.tag&&e(this.value)}forall(e){return!this.tag||e(this.value)}filter(e){return!this.tag||e(this.value)?this:h.none()}getOr(e){return this.tag?this.value:e}or(e){return this.tag?this:e}getOrThunk(e){return this.tag?this.value:e()}orThunk(e){return this.tag?this:e()}getOrDie(e){if(this.tag)return this.value;throw new Error(e??"Called getOrDie on None")}static from(e){return i(e)?h.some(e):h.none()}getOrNull(){return this.tag?this.value:null}getOrUndefined(){return this.value}each(e){this.tag&&e(this.value)}toArray(){return this.tag?[this.value]:[]}toString(){return this.tag?`some(${this.value})`:"none()"}}Array.prototype.slice;const p=Array.prototype.indexOf,f=Array.prototype.push,k=e=>{const t=[];for(let n=0,o=e.length;n<o;++n){if(!l(e[n]))throw new Error("Arr.flatten item "+n+" was not an array, input: "+e);f.apply(t,e[n])}return t};c(Array.from)&&Array.from;const b=(e,t)=>{for(let n=0;n<e.length;n++){const o=t(e[n],n);if(o.isSome())return o}return h.none()},v=Object.keys,y=Object.hasOwnProperty,x=(e,t)=>y.call(e,t),_=(e,t,n=m)=>e.exists((e=>n(e,t))),w=e=>{const t=[],n=e=>{t.push(e)};for(let t=0;t<e.length;t++)e[t].each(n);return t},C=(e,t)=>e?h.some(t):h.none(),O=e=>t=>t.options.get(e),A=O("link_assume_external_targets"),S=O("link_context_toolbar"),N=O("link_list"),E=O("link_default_target"),R=O("link_default_protocol"),T=O("link_target_list"),L=O("link_rel_list"),P=O("link_class_list"),U=O("link_title"),B=O("allow_unsafe_link_target"),D=O("link_quicklink"),M=O("link_attributes_postprocess"),j=O("files_upload_handler"),I=O("link_uploadtab"),F=O("documents_file_types");var K=tinymce.util.Tools.resolve("tinymce.util.URI"),q=tinymce.util.Tools.resolve("tinymce.dom.TreeWalker"),$=tinymce.util.Tools.resolve("tinymce.util.Tools");const V=e=>i(e)&&"a"===e.nodeName.toLowerCase(),z=e=>V(e)&&!!J(e),G=(e,t)=>{if(e.collapsed)return[];{const n=e.cloneContents(),o=n.firstChild,r=new q(o,n),l=[];let a=o;do{t(a)&&l.push(a)}while(a=r.next());return l}},H=e=>/^\w+:/i.test(e),J=e=>e.getAttribute("data-mce-href")??e.getAttribute("href")??"",W=(e,t)=>{const n=["noopener"],o=e?e.split(/\s+/):[],r=e=>e.filter((e=>-1===$.inArray(n,e))),l=t?(e=>(e=r(e)).length>0?e.concat(n):n)(o):r(o);return l.length>0?(e=>$.trim(e.sort().join(" ")))(l):""},Q=(e,t)=>(t=t||Z(e.selection.getRng())[0]||e.selection.getNode(),oe(t)?h.from(e.dom.select("a[href]",t)[0]):h.from(e.dom.getParent(t,"a[href]"))),X=(e,t)=>Q(e,t).isSome(),Y=(e,t)=>t.fold((()=>e.getContent({format:"text"})),(e=>e.innerText||e.textContent||"")).replace(/\uFEFF/g,""),Z=e=>G(e,z),ee=e=>$.grep(e,z),te=e=>ee(e).length>0,ne=e=>{const t=e.schema.getTextInlineElements();if(Q(e).exists((e=>e.hasAttribute("data-mce-block"))))return!1;const n=e.selection.getRng();return!!n.collapsed||0===G(n,(e=>1===e.nodeType&&!V(e)&&!x(t,e.nodeName.toLowerCase()))).length},oe=e=>i(e)&&"FIGURE"===e.nodeName&&/\bimage\b/i.test(e.className),re=(e,t,n)=>{const o=e.selection.getNode(),r=Q(e,o),l=((e,t)=>{const n={...t};if(0===L(e).length&&!B(e)){const e=W(n.rel,"_blank"===n.target);n.rel=e||null}return h.from(n.target).isNone()&&!1===T(e)&&(n.target=E(e)),n.href=((e,t)=>"http"!==t&&"https"!==t||H(e)?e:t+"://"+e)(n.href,A(e)),n})(e,(e=>{return t=["title","rel","class","target"],n=(t,n)=>(e[n].each((e=>{t[n]=e.length>0?e:null})),t),o={href:e.href},((e,t)=>{for(let n=0,o=e.length;n<o;n++)t(e[n],n)})(t,((e,t)=>{o=n(o,e)})),o;var t,n,o})(n)),a=M(e);i(a)&&a(l),e.undoManager.transact((()=>{n.href===t.href&&t.attach(),r.fold((()=>{((e,t,n,o)=>{const r=e.dom;oe(t)?ce(r,t,o):n.fold((()=>{e.execCommand("mceInsertLink",!1,o);const t=e.selection.getEnd(),n=r.createRng();n.setStartAfter(t),n.setEndAfter(t),e.selection.setRng(n)}),(t=>{e.insertContent(r.createHTML("a",o,r.encode(t)))}))})(e,o,n.text,l)}),(t=>{e.focus(),((e,t,n,o)=>{n.each((e=>{x(t,"innerText")?t.innerText=e:t.textContent=e})),e.dom.setAttribs(t,o);const r=e.dom.createRng();r.setStartAfter(t),r.setEndAfter(t),e.selection.setRng(r)})(e,t,n.text,l)}))}))},le=e=>{const{class:t,href:n,rel:o,target:r,text:l,title:s}=e;return(e=>{const t={};var n;return((e,t,n,o)=>{((e,t)=>{const n=v(e);for(let o=0,r=n.length;o<r;o++){const r=n[o];t(e[r],r)}})(e,((e,r)=>{(t(e,r)?n:o)(e,r)}))})(e,((e,t)=>!1===a(e)),(n=t,(e,t)=>{n[t]=e}),g),t})({class:t.getOrNull(),href:n,rel:o.getOrNull(),target:r.getOrNull(),text:l.getOrNull(),title:s.getOrNull()})},ae=(e,t,n)=>{const o=((e,t)=>{const n=e.options.get,o={allow_html_data_urls:n("allow_html_data_urls"),allow_script_urls:n("allow_script_urls"),allow_svg_data_urls:n("allow_svg_data_urls")},r=t.href;return{...t,href:K.isDomSafe(r,"a",o)?r:""}})(e,n);e.hasPlugin("rtc",!0)?e.execCommand("createlink",!1,le(o)):re(e,t,o)},se=e=>{e.hasPlugin("rtc",!0)?e.execCommand("unlink"):(e=>{e.undoManager.transact((()=>{const t=e.selection.getNode();oe(t)?ie(e,t):(e=>{const t=e.dom,n=e.selection,o=n.getBookmark(),r=n.getRng().cloneRange(),l=t.getParent(r.startContainer,"a[href]",e.getBody()),a=t.getParent(r.endContainer,"a[href]",e.getBody());l&&r.setStartBefore(l),a&&r.setEndAfter(a),n.setRng(r),e.execCommand("unlink"),n.moveToBookmark(o)})(e),e.focus()}))})(e)},ie=(e,t)=>{const n=e.dom.select("img",t)[0];if(n){const o=e.dom.getParents(n,"a[href]",t)[0];o&&(o.parentNode?.insertBefore(n,o),e.dom.remove(o))}},ce=(e,t,n)=>{const o=e.select("img",t)[0];if(o){const t=e.create("a",n);o.parentNode?.insertBefore(t,o),t.appendChild(o)}},ue=e=>o(e.value)?e.value:"",ge=(e,t)=>{const n=[];return $.each(e,(e=>{const r=(e=>o(e.text)?e.text:o(e.title)?e.title:"")(e);if(void 0!==e.menu){const o=ge(e.menu,t);n.push({text:r,items:o})}else{const o=t(e);n.push({text:r,value:o})}})),n},de=(e=ue)=>t=>h.from(t).map((t=>ge(t,e))),me=e=>de(ue)(e),he=de,pe=(e,t)=>n=>({name:e,type:"listbox",label:t,items:n}),fe=ue,ke=(e,t)=>b(t,(t=>(e=>{return x(t=e,n="items")&&void 0!==t[n]&&null!==t[n];var t,n})(t)?ke(e,t.items):C(t.value===e,t))),be=(e,t)=>{const n={text:e.text,title:e.title},o=(e,o)=>{const r=(l=t,a=o,"link"===a?l.link:"anchor"===a?l.anchor:h.none()).getOr([]);var l,a;return((e,t,n,o)=>{const r=o[t],l=e.length>0;return void 0!==r?ke(r,n).map((t=>({url:{value:t.value,meta:{text:l?e:t.text,attach:g}},text:l?e:t.text}))):h.none()})(n.text,o,r,e)};return{onChange:(e,t)=>{const r=t.name;return"url"===r?(e=>{const t=(o=e.url,C(n.text.length<=0,h.from(o.meta?.text).getOr(o.value)));var o;const r=(e=>C(n.title.length<=0,h.from(e.meta?.title).getOr("")))(e.url);return t.isSome()||r.isSome()?h.some({...t.map((e=>({text:e}))).getOr({}),...r.map((e=>({title:e}))).getOr({})}):h.none()})(e()):((e,t)=>p.call(e,t))(["anchor","link"],r)>-1?o(e(),r):"text"===r||"title"===r?(n[r]=e()[r],h.none()):h.none()}}};var ve=tinymce.util.Tools.resolve("tinymce.util.Delay");const ye=e=>{const t=e.href;return t.indexOf("@")>0&&-1===t.indexOf("/")&&-1===t.indexOf("mailto:")?h.some({message:"The URL you entered seems to be an email address. Do you want to add the required mailto: prefix?",preprocess:e=>({...e,href:"mailto:"+t})}):h.none()},xe=(e,t)=>n=>{const o=n.href;return 1===e&&!H(o)||0===e&&/^\s*www(\.|\d\.)/i.test(o)?h.some({message:`The URL you entered seems to be an external link. Do you want to add the required ${t}:// prefix?`,preprocess:e=>({...e,href:t+"://"+o})}):h.none()},_e=e=>{const t=e.dom.select("a:not([href])"),n=k(((e,t)=>{const n=e.length,o=new Array(n);for(let r=0;r<n;r++){const n=e[r];o[r]=t(n,r)}return o})(t,(e=>{const t=e.name||e.id;return t?[{text:t,value:"#"+t}]:[]})));return n.length>0?h.some([{text:"None",value:""}].concat(n)):h.none()},we=e=>{const t=P(e);return t.length>0?me(t):h.none()},Ce=e=>{try{return h.some(JSON.parse(e))}catch{return h.none()}},Oe=(e,t)=>{const n=L(e);if(n.length>0){const o=_(t,"_blank"),r=e=>W(fe(e),o);return(!1===B(e)?he(r):me)(n)}return h.none()},Ae=[{text:"Current window",value:""},{text:"New window",value:"_blank"}],Se=e=>{const t=T(e);return l(t)?me(t).orThunk((()=>h.some(Ae))):!1===t?h.none():h.some(Ae)},Ne=(e,t,n)=>{const o=e.getAttrib(t,n);return null!==o&&o.length>0?h.some(o):h.none()},Ee=(e,t)=>(e=>{const t=t=>e.convertURL(t.value||t.url||"","href"),n=N(e);return new Promise((e=>{o(n)?fetch(n).then((e=>e.ok?e.text().then(Ce):Promise.reject())).then(e,(()=>e(h.none()))):c(n)?n((t=>e(h.some(t)))):e(h.from(n))})).then((e=>e.bind(he(t)).map((e=>e.length>0?[{text:"None",value:""}].concat(e):e))))})(e).then((n=>{const o=(e=>i(e.options.get("files_upload_handler")))(e)&&(e=>i(e.options.get("documents_file_types")))(e)&&I(e),r=((e,t)=>{const n=e.dom,o=ne(e)?h.some(Y(e.selection,t)):h.none(),r=t.bind((e=>h.from(n.getAttrib(e,"href")))),l=t.bind((e=>h.from(n.getAttrib(e,"target")))),a=t.bind((e=>Ne(n,e,"rel"))),s=t.bind((e=>Ne(n,e,"class")));return{url:r,text:o,title:t.bind((e=>Ne(n,e,"title"))),target:l,rel:a,linkClass:s}})(e,t);return{anchor:r,catalogs:{targets:Se(e),rels:Oe(e,r.target),classes:we(e),anchor:_e(e),link:n},hasUploadPanel:o,optNode:t,flags:{titleEnabled:U(e)}}})),Re=e=>({title:"Upload",name:"upload",items:[{type:"dropzone",name:"fileinput",buttonLabel:"Browse for a file",dropAreaLabel:"Drop a file here",allowedFileTypes:e.map((e=>e.mimeType)).join(","),allowedFileExtensions:k(e.map((e=>e.extensions)))}]}),Te=e=>(t,n)=>j(e)(t,n),Le=(e,t)=>{const n=t.getData();var o;t.block("Uploading file"),(o=n.fileinput,(e=>0<e.length?h.some(e[0]):h.none())(o)).fold((()=>{t.unblock()}),(n=>{const o=URL.createObjectURL(n),r=()=>{t.unblock(),URL.revokeObjectURL(o)};var l;(l=n,new Promise(((e,t)=>{const n=new FileReader;n.onload=()=>{e(n.result)},n.onerror=()=>{t(new Error(n.error?.message??"Failed to convert blob to a data url"))},n.readAsDataURL(l)}))).then((t=>{const r=e.getExistingBlobInfo((e=>h.from(e.split(",")[1]).getOr(""))(t),n.type),l=r&&r.filename()===n.name?r:e.createBlobCache(n,o,t);return e.addToBlobCache(l),e.uploadFile(l,d)})).then((e=>{(({url:e,fileName:n})=>{t.setData({text:n,title:n,url:{value:e,meta:{}}}),t.showTab("general"),t.focus("url")})(e),r()})).catch((n=>{r(),e.alertErr(n,(()=>{t.focus("fileinput")}))}))}))},Pe=e=>(t,n,o)=>e.editorUpload.blobCache.create({blob:t,blobUri:n,name:t.name?.replace(/\.[^\.]+$/,""),filename:t.name,base64:o.split(",")[1]}),Ue=e=>t=>{e.editorUpload.blobCache.add(t)},Be=e=>(t,n)=>e.editorUpload.blobCache.getByData(t,n),De=e=>(t,n)=>{e.windowManager.alert(t,n)},Me=e=>{const t=(e=>{const t=Q(e);return Ee(e,t)})(e);t.then((t=>{const n=((e,t)=>n=>{const o=n.getData();if(!o.url.value)return se(e),void n.close();const r=e=>h.from(o[e]).filter((n=>!_(t.anchor[e],n))),l={href:o.url.value,text:r("text"),target:r("target"),rel:r("rel"),class:r("linkClass"),title:r("title")},a={href:o.url.value,attach:void 0!==o.url.meta&&o.url.meta.attach?o.url.meta.attach:g};((e,t)=>b([ye,xe(A(e),R(e))],(e=>e(t))).fold((()=>Promise.resolve(t)),(n=>new Promise((o=>{((e,t,n)=>{const o=e.selection.getRng();ve.setEditorTimeout(e,(()=>{e.windowManager.confirm(t,(t=>{e.selection.setRng(o),n(t)}))}))})(e,n.message,(e=>{o(e?n.preprocess(t):t)}))})))))(e,l).then((t=>{ae(e,a,t)})),n.close()})(e,t);return((e,t,n)=>{const o=e.anchor.text.map((()=>({name:"text",type:"input",label:"Text to display"}))).toArray(),r=e.flags.titleEnabled?[{name:"title",type:"input",label:"Title"}]:[],l=((e,t)=>{const n=e.anchor,o=n.url.getOr("");return{url:{value:o,meta:{original:{value:o}}},text:n.text.getOr(""),title:n.title.getOr(""),anchor:o,link:o,rel:n.rel.getOr(""),target:n.target.or(t).getOr(""),linkClass:n.linkClass.getOr(""),fileinput:[]}})(e,h.from(E(n))),a=e.catalogs,s=be(l,a),i=((e,t,n,o,r,l)=>{const a=k([[{name:"url",type:"urlinput",filetype:"file",label:"URL",picker_text:"Browse links"}],t,n,w([o.anchor.map(pe("anchor","Anchors")),o.rels.map(pe("rel","Rel")),o.targets.map(pe("target","Open link in...")),o.link.map(pe("link","Link list")),o.classes.map(pe("linkClass","Class"))])]);return r?{type:"tabpanel",tabs:k([[{title:"General",name:"general",items:a}],[Re(l)]])}:{type:"panel",items:a}})(0,o,r,a,e.hasUploadPanel,F(n)),c={addToBlobCache:Ue(n),createBlobCache:Pe(n),alertErr:De(n),uploadFile:Te(n),getExistingBlobInfo:Be(n)};return{title:"Insert/Edit Link",size:"normal",body:i,buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:l,onChange:(e,{name:t})=>{"fileinput"===t?Le(c,e):s.onChange(e.getData,{name:t}).each((t=>{e.setData(t)}))},onSubmit:t}})(t,n,e)})).then((t=>{e.windowManager.open(t)}))};var je=tinymce.util.Tools.resolve("tinymce.util.VK");const Ie=(e,t)=>{if(t){const o=J(t);if(/^#/.test(o)){const t=e.dom.select(`${o},[name="${n=o,((e,t)=>((e,t)=>""===t||e.length>=t.length&&e.substr(0,0+t.length)===t)(e,t))(n,"#")?(e=>e.substring(1))(n):n}"]`);t.length&&e.selection.scrollIntoView(t[0],!0)}else(e=>{const t=document.createElement("a");t.target="_blank",t.href=e,t.rel="noreferrer noopener";const n=new MouseEvent("click",{bubbles:!0,cancelable:!0,view:window});document.dispatchEvent(n),((e,t)=>{document.body.appendChild(e),e.dispatchEvent(t),document.body.removeChild(e)})(t,n)})(t.href)}var n},Fe=(e,t)=>{const n=ee(e.dom.getParents(t));return C(1===n.length,n[0])},Ke=e=>e.selection.isCollapsed()||(e=>{const t=e.selection.getRng(),n=t.startContainer;return z(n)&&t.startContainer===t.endContainer&&1===e.dom.select("img",n).length})(e)?Fe(e,e.selection.getStart()):(e=>{const t=Z(e.selection.getRng());return C(t.length>0,t[0]).or(Fe(e,e.selection.getNode()))})(e),qe=e=>()=>{e.execCommand("mceLink",!1,{dialog:!0})},$e=(e,t)=>(e.on("NodeChange",t),()=>e.off("NodeChange",t)),Ve=e=>t=>{const n=()=>{t.setActive(!e.mode.isReadOnly()&&X(e,e.selection.getNode())),t.setEnabled(e.selection.isEditable())};return n(),$e(e,n)},ze=e=>t=>{const n=()=>{t.setEnabled(e.selection.isEditable())};return n(),$e(e,n)},Ge=e=>t=>{const n=e.dom.getParents(e.selection.getStart()),o=n=>{t.setEnabled((t=>{return te(t)||(n=e.selection.getRng(),Z(n).length>0);var n})(n)&&e.selection.isEditable())};return o(n),$e(e,(e=>o(e.parents)))},He=e=>{const t=(e=>{const t=(()=>{const e=(e=>{const t=(e=>{let t=e;return{get:()=>t,set:e=>{t=e}}})(h.none()),n=()=>t.get().each(e);return{clear:()=>{n(),t.set(h.none())},isSet:()=>t.get().isSome(),get:()=>t.get(),set:e=>{n(),t.set(h.some(e))}}})(g);return{...e,on:t=>e.get().each(t)}})(),n=()=>t.get().or(Ke(e));return e.on("contextmenu",(n=>{Fe(e,n.target).each(t.set)})),e.on("SelectionChange",(()=>{t.isSet()||Ke(e).each(t.set)})),e.on("click",(n=>{t.clear();const o=ee(e.dom.getParents(n.target));1===o.length&&je.metaKeyPressed(n)&&(n.preventDefault(),Ie(e,o[0]))})),e.on("keydown",(o=>{t.clear(),!o.isDefaultPrevented()&&13===o.keyCode&&(e=>!0===e.altKey&&!1===e.shiftKey&&!1===e.ctrlKey&&!1===e.metaKey)(o)&&n().each((t=>{o.preventDefault(),Ie(e,t)}))})),{gotoSelectedLink:()=>n().each((t=>Ie(e,t)))}})(e);((e,t)=>{e.ui.registry.addToggleButton("link",{icon:"link",tooltip:"Insert/edit link",shortcut:"Meta+K",onAction:qe(e),onSetup:Ve(e)}),e.ui.registry.addButton("openlink",{icon:"new-tab",tooltip:"Open link",onAction:t.gotoSelectedLink,onSetup:Ge(e)}),e.ui.registry.addButton("unlink",{icon:"unlink",tooltip:"Remove link",onAction:()=>se(e),onSetup:Ge(e)})})(e,t),((e,t)=>{e.ui.registry.addMenuItem("openlink",{text:"Open link",icon:"new-tab",onAction:t.gotoSelectedLink,onSetup:Ge(e)}),e.ui.registry.addMenuItem("link",{icon:"link",text:"Link...",shortcut:"Meta+K",onAction:qe(e),onSetup:ze(e)}),e.ui.registry.addMenuItem("unlink",{icon:"unlink",text:"Remove link",onAction:()=>se(e),onSetup:Ge(e)})})(e,t),(e=>{e.ui.registry.addContextMenu("link",{update:t=>e.dom.isEditable(t)?te(e.dom.getParents(t,"a"))?"link unlink openlink":"link":""})})(e),((e,t)=>{const n=t=>{const n=e.selection.getNode();return t.setEnabled(X(e,n)&&e.selection.isEditable()),g};e.ui.registry.addContextForm("quicklink",{launch:{type:"contextformtogglebutton",icon:"link",tooltip:"Link",onSetup:Ve(e)},label:"Link",predicate:t=>S(e)&&X(e,t),initValue:()=>Q(e).fold((()=>""),J),commands:[{type:"contextformtogglebutton",icon:"link",tooltip:"Link",primary:!0,onSetup:t=>{const n=e.selection.getNode();return t.setActive(X(e,n)),Ve(e)(t)},onAction:t=>{const n=t.getValue(),o=(t=>{const n=Q(e),o=ne(e);if(n.isNone()&&o){const o=Y(e.selection,n);return C(0===o.length,t)}return h.none()})(n);ae(e,{href:n,attach:g},{href:n,text:o,title:h.none(),rel:h.none(),target:h.from(E(e)),class:h.none()}),(e=>{e.selection.collapse(!1)})(e),t.hide()}},{type:"contextformbutton",icon:"unlink",tooltip:"Remove link",onSetup:n,onAction:t=>{se(e),t.hide()}},{type:"contextformbutton",icon:"new-tab",tooltip:"Open link",onSetup:n,onAction:e=>{t.gotoSelectedLink(),e.hide()}}]})})(e,t)};e.add("link",(e=>{(e=>{const t=e.options.register;t("link_assume_external_targets",{processor:e=>{const t=o(e)||s(e);return t?!0===e?{value:1,valid:t}:"http"===e||"https"===e?{value:e,valid:t}:{value:0,valid:t}:{valid:!1,message:"Must be a string or a boolean."}},default:!1}),t("link_context_toolbar",{processor:"boolean",default:!1}),t("link_list",{processor:e=>o(e)||c(e)||u(e,r)}),t("link_default_target",{processor:"string"}),t("link_default_protocol",{processor:"string",default:"https"}),t("link_target_list",{processor:e=>s(e)||u(e,r),default:!0}),t("link_rel_list",{processor:"object[]",default:[]}),t("link_class_list",{processor:"object[]",default:[]}),t("link_title",{processor:"boolean",default:!0}),t("allow_unsafe_link_target",{processor:"boolean",default:!1}),t("link_quicklink",{processor:"boolean",default:!1}),t("link_attributes_postprocess",{processor:"function"}),t("files_upload_handler",{processor:"function"}),t("link_uploadtab",{processor:"boolean",default:!0})})(e),(e=>{e.addCommand("mceLink",((t,n)=>{!0!==n?.dialog&&D(e)?e.dispatch("contexttoolbar-show",{toolbarKey:"quicklink"}):Me(e)}))})(e),He(e),(e=>{e.addShortcut("Meta+K","",(()=>{e.execCommand("mceLink")}))})(e)}))}();
|