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 +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===(s=o.constructor)||void 0===s?void 0:s.name)===r.name)?"string":t;var n,o,r,s})(t)===e,n=e=>t=>typeof t===e,o=t("string"),r=t("object"),s=t("array"),i=n("boolean"),l=e=>!(e=>null==e)(e),a=n("function"),d=n("number"),c=()=>{},m=e=>()=>e,u=(e,t)=>e===t,p=e=>t=>!e(t),g=m(!1);class h{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(null!=e?e:"Called getOrDie on None")}static from(e){return l(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()"}}h.singletonNone=new h(!1);const f=Array.prototype.slice,y=Array.prototype.indexOf,v=Array.prototype.push,C=(e,t)=>{return n=e,o=t,y.call(n,o)>-1;var n,o},b=(e,t)=>{for(let n=0,o=e.length;n<o;n++)if(t(e[n],n))return!0;return!1},N=(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},S=(e,t)=>{for(let n=0,o=e.length;n<o;n++)t(e[n],n)},L=(e,t)=>{const n=[];for(let o=0,r=e.length;o<r;o++){const r=e[o];t(r,o)&&n.push(r)}return n},O=(e,t,n)=>(S(e,((e,o)=>{n=t(n,e,o)})),n),A=(e,t,n)=>{for(let o=0,r=e.length;o<r;o++){const r=e[o];if(t(r,o))return h.some(r);if(n(r,o))break}return h.none()},T=(e,t)=>A(e,t,g),x=(e,t)=>(e=>{const t=[];for(let n=0,o=e.length;n<o;++n){if(!s(e[n]))throw new Error("Arr.flatten item "+n+" was not an array, input: "+e);v.apply(t,e[n])}return t})(N(e,t)),k=e=>{const t=f.call(e,0);return t.reverse(),t},E=(e,t)=>t>=0&&t<e.length?h.some(e[t]):h.none(),w=e=>E(e,0),D=e=>E(e,e.length-1),B=(e,t)=>{const n=[],o=a(t)?e=>b(n,(n=>t(n,e))):e=>C(n,e);for(let t=0,r=e.length;t<r;t++){const r=e[t];o(r)||n.push(r)}return n},M=Object.keys,P=(e,t)=>{const n=M(e);for(let o=0,r=n.length;o<r;o++){const r=n[o];t(e[r],r)}},I="undefined"!=typeof window?window:Function("return this;")(),R=(e,t,n=u)=>e.exists((e=>n(e,t))),U=(e,t,n)=>e.isSome()&&t.isSome()?h.some(n(e.getOrDie(),t.getOrDie())):h.none(),$=(e,t)=>((e,t)=>{let n=null!=t?t:I;for(let t=0;t<e.length&&null!=n;++t)n=n[e[t]];return n})(e.split("."),t),_=(H=/^\s+|\s+$/g,e=>e.replace(H,""));var H;const F=e=>"\ufeff"===e,V=e=>{if(null==e)throw new Error("Node cannot be null or undefined");return{dom:e}},j=(e,t)=>{const n=(t||document).createElement("div");if(n.innerHTML=e,!n.hasChildNodes()||n.childNodes.length>1){const t="HTML does not have a single root node";throw console.error(t,e),new Error(t)}return V(n.childNodes[0])},K=(e,t)=>{const n=(t||document).createElement(e);return V(n)},z=V,Q=(e,t)=>{const n=e.dom;if(1!==n.nodeType)return!1;{const e=n;if(void 0!==e.matches)return e.matches(t);if(void 0!==e.msMatchesSelector)return e.msMatchesSelector(t);if(void 0!==e.webkitMatchesSelector)return e.webkitMatchesSelector(t);if(void 0!==e.mozMatchesSelector)return e.mozMatchesSelector(t);throw new Error("Browser lacks native selectors")}},W=(e,t)=>e.dom===t.dom,q=Q,Z=Object.getPrototypeOf,G=e=>{const t=$("ownerDocument.defaultView",e);return r(e)&&((e=>((e,t)=>{const n=((e,t)=>$(e,t))(e,t);if(null==n)throw new Error(e+" not available on this browser");return n})("HTMLElement",e))(t).prototype.isPrototypeOf(e)||/^HTML\w*Element$/.test(Z(e).constructor.name))},J=e=>e.dom.nodeName.toLowerCase(),X=e=>e.dom.nodeType,Y=e=>t=>X(t)===e,ee=e=>te(e)&&G(e.dom),te=Y(1),ne=Y(3),oe=Y(11),re=e=>t=>te(t)&&J(t)===e,se=e=>h.from(e.dom.parentNode).map(z),ie=e=>N(e.dom.childNodes,z),le=(e,t)=>{const n=e.dom.childNodes;return h.from(n[t]).map(z)},ae=e=>le(e,0),de=e=>le(e,e.dom.childNodes.length-1),ce=e=>z(e.dom.host),me=(e,t)=>{se(e).each((n=>{n.dom.insertBefore(t.dom,e.dom)}))},ue=(e,t)=>{e.dom.appendChild(t.dom)},pe=(e,t)=>{S(t,(t=>{ue(e,t)}))},ge=(e,t)=>{const n=e.dom;P(t,((e,t)=>{((e,t,n)=>{if(!(o(n)||i(n)||d(n)))throw console.error("Invalid call to Attribute.set. Key ",t,":: Value ",n,":: Element ",e),new Error("Attribute value was not simple");e.setAttribute(t,n+"")})(n,t,e)}))},he=e=>O(e.dom.attributes,((e,t)=>(e[t.name]=t.value,e)),{}),fe=e=>{e.dom.textContent="",S(ie(e),(e=>{ye(e)}))},ye=e=>{const t=e.dom;null!==t.parentNode&&t.parentNode.removeChild(t)},ve=e=>(e=>z(e.dom.cloneNode(!0)))(e),Ce=(e,t)=>{const n=((e,t)=>{const n=K(t),o=he(e);return ge(n,o),n})(e,t);var o,r;r=n,(e=>h.from(e.dom.nextSibling).map(z))(o=e).fold((()=>{se(o).each((e=>{ue(e,r)}))}),(e=>{me(e,r)}));const s=ie(e);return pe(n,s),ye(e),n},be=e=>N(e,z),Ne=e=>{const t=ne(e)?e.dom.parentNode:e.dom;if(null==t||null===t.ownerDocument)return!1;const n=t.ownerDocument;return(e=>{const t=(e=>z(e.dom.getRootNode()))(e);return oe(n=t)&&l(n.dom.host)?h.some(t):h.none();var n})(z(t)).fold((()=>n.body.contains(t)),(o=Ne,r=ce,e=>o(r(e))));var o,r},Se=(e,t,n)=>{((e,t,n)=>{if(!o(n))throw console.error("Invalid call to CSS.set. Property ",t,":: Value ",n,":: Element ",e),new Error("CSS value must be a string: "+n);(e=>void 0!==e.style&&a(e.style.getPropertyValue))(e)&&e.style.setProperty(t,n)})(e.dom,t,n)},Le=(e,t)=>{const n=(t||document).createDocumentFragment();return S(e,(e=>{n.appendChild(e.dom)})),z(n)};var Oe=(e,t,n,o,r)=>e(n,o)?h.some(n):a(r)&&r(n)?h.none():t(n,o,r);const Ae=(e,t,n)=>{let o=e.dom;const r=a(n)?n:g;for(;o.parentNode;){o=o.parentNode;const e=z(o);if(t(e))return h.some(e);if(r(e))break}return h.none()},Te=(e,t,n)=>Oe(((e,t)=>t(e)),Ae,e,t,n),xe=(e,t,n)=>Ae(e,(e=>Q(e,t)),n);var ke=tinymce.util.Tools.resolve("tinymce.dom.RangeUtils"),Ee=tinymce.util.Tools.resolve("tinymce.dom.TreeWalker"),we=tinymce.util.Tools.resolve("tinymce.util.VK"),De=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),Be=tinymce.util.Tools.resolve("tinymce.util.Tools");const Me=e=>t=>l(t)&&t.nodeName.toLowerCase()===e,Pe=e=>t=>l(t)&&e.test(t.nodeName),Ie=e=>l(e)&&3===e.nodeType,Re=e=>l(e)&&1===e.nodeType,Ue=Pe(/^(OL|UL|DL)$/),$e=Pe(/^(OL|UL)$/),_e=Me("ol"),He=Pe(/^(LI|DT|DD)$/),Fe=Pe(/^(DT|DD)$/),Ve=Pe(/^(TH|TD)$/),je=Me("br"),Ke=(e,t)=>l(t)&&t.nodeName in e.schema.getTextBlockElements(),ze=(e,t)=>l(e)&&e.nodeName in t,Qe=(e,t)=>l(t)&&t.nodeName in e.schema.getVoidElements(),We=(e,t,n)=>{const o=e.isEmpty(t);return!(n&&e.select("span[data-mce-type=bookmark]",t).length>0)&&o},qe=(e,t)=>e.isChildOf(t,e.getRoot()),Ze=e=>t=>t.options.get(e),Ge=Ze("lists_indent_on_tab"),Je=Ze("forced_root_block"),Xe=Ze("forced_root_block_attrs"),Ye=(e,t,n={})=>{const o=e.dom,r=e.schema.getBlockElements(),s=o.createFragment(),i=Je(e),l=Xe(e);let a,d,c=!1;for(d=o.create(i,{...l,...n.style?{style:n.style}:{}}),ze(t.firstChild,r)||s.appendChild(d);a=t.firstChild;){const e=a.nodeName;c||"SPAN"===e&&"bookmark"===a.getAttribute("data-mce-type")||(c=!0),ze(a,r)?(s.appendChild(a),d=null):(d||(d=o.create(i,l),s.appendChild(d)),d.appendChild(a))}return!c&&d&&d.appendChild(o.create("br",{"data-mce-bogus":"1"})),s},et=De.DOM,tt=re("dd"),nt=re("dt"),ot=(e,t)=>{var n;tt(t)?Ce(t,"dt"):nt(t)&&(n=t,h.from(n.dom.parentElement).map(z)).each((n=>((e,t,n)=>{const o=et.select('span[data-mce-type="bookmark"]',t),r=Ye(e,n),s=et.createRng();s.setStartAfter(n),s.setEndAfter(t);const i=s.extractContents();for(let t=i.firstChild;t;t=t.firstChild)if("LI"===t.nodeName&&e.dom.isEmpty(t)){et.remove(t);break}e.dom.isEmpty(i)||et.insertAfter(i,t),et.insertAfter(r,t);const l=n.parentElement;l&&We(e.dom,l)&&(e=>{const t=e.parentNode;t&&Be.each(o,(e=>{t.insertBefore(e,n.parentNode)})),et.remove(e)})(l),et.remove(n),We(e.dom,t)&&et.remove(t)})(e,n.dom,t.dom)))},rt=e=>{nt(e)&&Ce(e,"dd")},st=(e,t)=>{if(Ie(e))return{container:e,offset:t};const n=ke.getNode(e,t);return Ie(n)?{container:n,offset:t>=e.childNodes.length?n.data.length:0}:n.previousSibling&&Ie(n.previousSibling)?{container:n.previousSibling,offset:n.previousSibling.data.length}:n.nextSibling&&Ie(n.nextSibling)?{container:n.nextSibling,offset:0}:{container:e,offset:t}},it=e=>{const t=e.cloneRange(),n=st(e.startContainer,e.startOffset);t.setStart(n.container,n.offset);const o=st(e.endContainer,e.endOffset);return t.setEnd(o.container,o.offset),t},lt=["OL","UL","DL"],at=lt.join(","),dt=(e,t)=>{const n=t||e.selection.getStart(!0);return e.dom.getParent(n,at,ut(e,n))},ct=e=>{const t=e.selection.getSelectedBlocks();return L(((e,t)=>{const n=Be.map(t,(t=>e.dom.getParent(t,"li,dd,dt",ut(e,t))||t));return B(n)})(e,t),He)},mt=(e,t)=>{const n=e.dom.getParents(t,"TD,TH");return n.length>0?n[0]:e.getBody()},ut=(e,t)=>{const n=e.dom.getParents(t,e.dom.isBlock),o=T(n,(t=>{return(t=>t.nodeName.toLowerCase()!==Je(e))(t)&&(n=e.schema,!Ue(o=t)&&!He(o)&&b(lt,(e=>n.isValidChild(o.nodeName,e))));var n,o}));return o.getOr(e.getBody())},pt=(e,t)=>{const n=e.dom.getParents(t,"ol,ul",ut(e,t));return D(n)},gt=(e,t)=>{const n=N(t,(t=>pt(e,t).getOr(t)));return B(n)},ht=e=>/\btox\-/.test(e.className),ft=(e,t)=>A(e,Ue,Ve).exists((e=>e.nodeName===t&&!ht(e))),yt=(e,t)=>null!==t&&!e.dom.isEditable(t),vt=(e,t)=>{const n=e.dom.getParent(t,"ol,ul,dl");return yt(e,n)||!e.selection.isEditable()},Ct=(e,t)=>{const n=e.selection.getNode();return t({parents:e.dom.getParents(n),element:n}),e.on("NodeChange",t),()=>e.off("NodeChange",t)},bt=(e,t,n)=>e.dispatch("ListMutation",{action:t,element:n}),Nt=e=>q(e,"OL,UL"),St=e=>ae(e).exists(Nt),Lt=e=>"listAttributes"in e,Ot=e=>"isComment"in e,At=e=>e.depth>0,Tt=e=>e.isSelected,xt=e=>{const t=ie(e),n=de(e).exists(Nt)?t.slice(0,-1):t;return N(n,ve)},kt=(e,t)=>{ue(e.item,t.list)},Et=(e,t)=>{const n={list:K(t,e),item:K("li",e)};return ue(n.list,n.item),n},wt=(e,t,n)=>{const o=t.slice(0,n.depth);return D(o).each((t=>{if(Lt(n)){const o=((e,t,n)=>{const o=K("li",e);return ge(o,t),pe(o,n),o})(e,n.itemAttributes,n.content);((e,t)=>{ue(e.list,t),e.item=t})(t,o),((e,t)=>{J(e.list)!==t.listType&&(e.list=Ce(e.list,t.listType)),ge(e.list,t.listAttributes)})(t,n)}else if((e=>"isFragment"in e)(n))pe(t.item,n.content);else{const e=j(`\x3c!--${n.content}--\x3e`);ue(t.list,e)}})),o},Dt=(e,t)=>{let n=h.none();const o=O(t,((t,o,r)=>Ot(o)?0===r?(n=h.some(o),t):wt(e,t,o):o.depth>t.length?((e,t,n)=>{const o=((e,t,n)=>{const o=[];for(let r=0;r<n;r++)o.push(Et(e,Lt(t)?t.listType:t.parentListType));return o})(e,n,n.depth-t.length);var r;return(e=>{for(let t=1;t<e.length;t++)kt(e[t-1],e[t])})(o),((e,t)=>{for(let t=0;t<e.length-1;t++)Se(e[t].item,"list-style-type","none");D(e).each((e=>{Lt(t)&&(ge(e.list,t.listAttributes),ge(e.item,t.itemAttributes)),pe(e.item,t.content)}))})(o,n),r=o,U(D(t),w(r),kt),t.concat(o)})(e,t,o):wt(e,t,o)),[]);return n.each((e=>{const t=j(`\x3c!--${e.content}--\x3e`);w(o).each((e=>{((e,t)=>{ae(e).fold((()=>{ue(e,t)}),(n=>{e.dom.insertBefore(t.dom,n.dom)}))})(e.list,t)}))})),w(o).map((e=>e.list))},Bt=e=>(S(e,((t,n)=>{((e,t)=>{const n=e[t].depth,o=e=>e.depth===n&&!e.dirty,r=e=>e.depth<n;return A(k(e.slice(0,t)),o,r).orThunk((()=>A(e.slice(t+1),o,r)))})(e,n).fold((()=>{t.dirty&&Lt(t)&&(e=>{e.listAttributes=((e,t)=>{const n={};var o;return((e,t,n,o)=>{P(e,((e,r)=>{(t(e,r)?n:o)(e,r)}))})(e,t,(o=n,(e,t)=>{o[t]=e}),c),n})(e.listAttributes,((e,t)=>"start"!==t))})(t)}),(e=>{return o=e,void(Lt(n=t)&&Lt(o)&&(n.listType=o.listType,n.listAttributes={...o.listAttributes}));var n,o}))})),e),Mt=(e,t,n,o)=>{var r,s;if(8===X(s=o)||"#comment"===J(s))return[{depth:e+1,content:null!==(r=o.dom.nodeValue)&&void 0!==r?r:"",dirty:!1,isSelected:!1,isComment:!0}];t.each((e=>{W(e.start,o)&&n.set(!0)}));const i=((e,t,n)=>se(e).filter(te).map((o=>({depth:t,dirty:!1,isSelected:n,content:xt(e),itemAttributes:he(e),listAttributes:he(o),listType:J(o),isInPreviousLi:!1}))))(o,e,n.get());t.each((e=>{W(e.end,o)&&n.set(!1)}));const l=de(o).filter(Nt).map((o=>It(e,t,n,o))).getOr([]);return i.toArray().concat(l)},Pt=(e,t,n,o)=>ae(o).filter(Nt).fold((()=>Mt(e,t,n,o)),(r=>{const s=O(ie(o),((o,s,i)=>{if(0===i)return o;if(q(s,"LI"))return o.concat(Mt(e,t,n,s));{const t={isFragment:!0,depth:e,content:[s],isSelected:!1,dirty:!1,parentListType:J(r)};return o.concat(t)}}),[]);return It(e,t,n,r).concat(s)})),It=(e,t,n,o)=>x(ie(o),(o=>(Nt(o)?It:Pt)(e+1,t,n,o))),Rt=(e,t,n)=>{const o=((e,t)=>{const n=(()=>{let e=!1;return{get:()=>e,set:t=>{e=t}}})();return N(e,(e=>({sourceList:e,entries:It(0,t,n,e)})))})(t,(e=>{const t=N(ct(e),z);return U(T(t,p(St)),T(k(t),p(St)),((e,t)=>({start:e,end:t})))})(e));S(o,(t=>{((e,t)=>{S(L(e,Tt),(e=>((e,t)=>{switch(e){case"Indent":t.depth++;break;case"Outdent":t.depth--;break;case"Flatten":t.depth=0}t.dirty=!0})(t,e)))})(t.entries,n);const o=((e,t)=>x(((e,t)=>{if(0===e.length)return[];{let n=t(e[0]);const o=[];let r=[];for(let s=0,i=e.length;s<i;s++){const i=e[s],l=t(i);l!==n&&(o.push(r),r=[]),n=l,r.push(i)}return 0!==r.length&&o.push(r),o}})(t,At),(t=>w(t).exists(At)?((e,t)=>{const n=Bt(t);return Dt(e.contentDocument,n).toArray()})(e,t):((e,t)=>{const n=Bt(t);return N(n,(t=>{const n=Ot(t)?Le([j(`\x3c!--${t.content}--\x3e`)]):Le(t.content),o=Lt(t)?t.itemAttributes:{};return z(Ye(e,n.dom,o))}))})(e,t))))(e,t.entries);var r;S(o,(t=>{bt(e,"Indent"===n?"IndentList":"OutdentList",t.dom)})),r=t.sourceList,S(o,(e=>{me(r,e)})),ye(t.sourceList)}))},Ut=(e,t)=>{const n=be((e=>{const t=(e=>{const t=pt(e,e.selection.getStart()),n=L(e.selection.getSelectedBlocks(),$e);return t.toArray().concat(n)})(e),n=(e=>{const t=e.selection.getStart();return e.dom.getParents(t,"ol,ul",ut(e,t))})(e);return T(n,(e=>{return t=z(e),se(t).exists((e=>He(e.dom)&&ae(e).exists((e=>!Ue(e.dom)))&&de(e).exists((e=>!Ue(e.dom)))));var t})).fold((()=>gt(e,t)),(e=>[e]))})(e)),o=be((e=>L(ct(e),Fe))(e));let r=!1;if(n.length||o.length){const s=e.selection.getBookmark();Rt(e,n,t),((e,t,n)=>{S(n,"Indent"===t?rt:t=>ot(e,t))})(e,t,o),e.selection.moveToBookmark(s),e.selection.setRng(it(e.selection.getRng())),e.nodeChanged(),r=!0}return r},$t=(e,t)=>!(e=>{const t=dt(e);return yt(e,t)||!e.selection.isEditable()})(e)&&Ut(e,t),_t=e=>$t(e,"Indent"),Ht=e=>$t(e,"Outdent"),Ft=e=>$t(e,"Flatten");var Vt=tinymce.util.Tools.resolve("tinymce.dom.BookmarkManager");const jt=De.DOM,Kt=e=>{const t={},n=n=>{let o=e[n?"startContainer":"endContainer"],r=e[n?"startOffset":"endOffset"];if(Re(o)){const e=jt.create("span",{"data-mce-type":"bookmark"});o.hasChildNodes()?(r=Math.min(r,o.childNodes.length-1),n?o.insertBefore(e,o.childNodes[r]):jt.insertAfter(e,o.childNodes[r])):o.appendChild(e),o=e,r=0}t[n?"startContainer":"endContainer"]=o,t[n?"startOffset":"endOffset"]=r};return n(!0),e.collapsed||n(),t},zt=e=>{const t=t=>{let n=e[t?"startContainer":"endContainer"],o=e[t?"startOffset":"endOffset"];if(n){if(Re(n)&&n.parentNode){const e=n;o=(e=>{var t;let n=null===(t=e.parentNode)||void 0===t?void 0:t.firstChild,o=0;for(;n;){if(n===e)return o;Re(n)&&"bookmark"===n.getAttribute("data-mce-type")||o++,n=n.nextSibling}return-1})(n),n=n.parentNode,jt.remove(e),!n.hasChildNodes()&&jt.isBlock(n)&&n.appendChild(jt.create("br"))}e[t?"startContainer":"endContainer"]=n,e[t?"startOffset":"endOffset"]=o}};t(!0),t();const n=jt.createRng();return n.setStart(e.startContainer,e.startOffset),e.endContainer&&n.setEnd(e.endContainer,e.endOffset),it(n)},Qt=e=>{switch(e){case"UL":return"ToggleUlList";case"OL":return"ToggleOlList";case"DL":return"ToggleDLList"}},Wt=(e,t)=>{Be.each(t,((t,n)=>{e.setAttribute(n,t)}))},qt=(e,t,n)=>{((e,t,n)=>{const o=n["list-style-type"]?n["list-style-type"]:null;e.setStyle(t,"list-style-type",o)})(e,t,n),((e,t,n)=>{Wt(t,n["list-attributes"]),Be.each(e.select("li",t),(e=>{Wt(e,n["list-item-attributes"])}))})(e,t,n)},Zt=(e,t)=>l(t)&&!ze(t,e.schema.getBlockElements()),Gt=(e,t,n,o)=>{let r=t[n?"startContainer":"endContainer"];const s=t[n?"startOffset":"endOffset"];Re(r)&&(r=r.childNodes[Math.min(s,r.childNodes.length-1)]||r),!n&&je(r.nextSibling)&&(r=r.nextSibling);const i=(t,n)=>{var r;const s=new Ee(t,(t=>{for(;!e.dom.isBlock(t)&&t.parentNode&&o!==t;)t=t.parentNode;return t})(t)),i=n?"next":"prev";let l;for(;l=s[i]();)if(!Qe(e,l)&&!F(l.textContent)&&0!==(null===(r=l.textContent)||void 0===r?void 0:r.length))return h.some(l);return h.none()};if(n&&Ie(r))if(F(r.textContent))r=i(r,!1).getOr(r);else for(null!==r.parentNode&&Zt(e,r.parentNode)&&(r=r.parentNode);null!==r.previousSibling&&(Zt(e,r.previousSibling)||Ie(r.previousSibling));)r=r.previousSibling;if(!n&&Ie(r))if(F(r.textContent))r=i(r,!0).getOr(r);else for(null!==r.parentNode&&Zt(e,r.parentNode)&&(r=r.parentNode);null!==r.nextSibling&&(Zt(e,r.nextSibling)||Ie(r.nextSibling));)r=r.nextSibling;for(;r.parentNode!==o;){const t=r.parentNode;if(Ke(e,r))return r;if(/^(TD|TH)$/.test(t.nodeName))return r;r=t}return r},Jt=(e,t,n)=>{const o=e.selection.getRng();let r="LI";const s=ut(e,((e,t)=>{const n=e.selection.getStart(!0),o=Gt(e,t,!0,e.getBody());return r=z(o),s=z(t.commonAncestorContainer),i=r,l=function(e,...t){return(...n)=>{const o=t.concat(n);return e.apply(null,o)}}(W,s),Ae(i,l,void 0).isSome()?t.commonAncestorContainer:n;var r,s,i,l})(e,o)),i=e.dom;if("false"===i.getContentEditable(e.selection.getNode()))return;"DL"===(t=t.toUpperCase())&&(r="DT");const l=Kt(o),a=L(((e,t,n)=>{const o=[],r=e.dom,s=Gt(e,t,!0,n),i=Gt(e,t,!1,n);let l;const a=[];for(let e=s;e&&(a.push(e),e!==i);e=e.nextSibling);return Be.each(a,(t=>{var s;if(Ke(e,t))return o.push(t),void(l=null);if(r.isBlock(t)||je(t))return je(t)&&r.remove(t),void(l=null);const i=t.nextSibling;Vt.isBookmarkNode(t)&&(Ue(i)||Ke(e,i)||!i&&t.parentNode===n)?l=null:(l||(l=r.create("p"),null===(s=t.parentNode)||void 0===s||s.insertBefore(l,t),o.push(l)),l.appendChild(t))})),o})(e,o,s),e.dom.isEditable);Be.each(a,(o=>{let s;const l=o.previousSibling,a=o.parentNode;He(a)||(l&&Ue(l)&&l.nodeName===t&&((e,t,n)=>{const o=e.getStyle(t,"list-style-type");let r=n?n["list-style-type"]:"";return r=null===r?"":r,o===r})(i,l,n)?(s=l,o=i.rename(o,r),l.appendChild(o)):(s=i.create(t),a.insertBefore(s,o),s.appendChild(o),o=i.rename(o,r)),((e,t)=>{Be.each(["margin","margin-right","margin-bottom","margin-left","margin-top","padding","padding-right","padding-bottom","padding-left","padding-top"],(n=>e.setStyle(t,n,"")))})(i,o),qt(i,s,n),Yt(e.dom,s))})),e.selection.setRng(zt(l))},Xt=(e,t,n)=>{return((e,t)=>Ue(e)&&e.nodeName===(null==t?void 0:t.nodeName))(t,n)&&((e,t,n)=>e.getStyle(t,"list-style-type",!0)===e.getStyle(n,"list-style-type",!0))(e,t,n)&&(o=n,t.className===o.className);var o},Yt=(e,t)=>{let n,o=t.nextSibling;if(Xt(e,t,o)){const r=o;for(;n=r.firstChild;)t.appendChild(n);e.remove(r)}if(o=t.previousSibling,Xt(e,t,o)){const r=o;for(;n=r.lastChild;)t.insertBefore(n,t.firstChild);e.remove(r)}},en=(e,t,n,o)=>{if(t.nodeName!==n){const r=e.dom.rename(t,n);qt(e.dom,r,o),bt(e,Qt(n),r)}else qt(e.dom,t,o),bt(e,Qt(n),t)},tn=(e,t,n,o)=>{if(t.classList.forEach(((e,n,o)=>{e.startsWith("tox-")&&(o.remove(e),0===o.length&&t.removeAttribute("class"))})),t.nodeName!==n){const r=e.dom.rename(t,n);qt(e.dom,r,o),bt(e,Qt(n),r)}else qt(e.dom,t,o),bt(e,Qt(n),t)},nn=e=>"list-style-type"in e,on=(e,t,n)=>{const o=dt(e);if(vt(e,o))return;const s=(e=>{const t=dt(e),n=e.selection.getSelectedBlocks();return((e,t)=>l(e)&&1===t.length&&t[0]===e)(t,n)?(e=>L(e.querySelectorAll(at),Ue))(t):L(n,(e=>Ue(e)&&t!==e))})(e),i=r(n)?n:{};s.length>0?((e,t,n,o,r)=>{const s=Ue(t);if(!s||t.nodeName!==o||nn(r)||ht(t)){Jt(e,o,r);const i=Kt(e.selection.getRng()),l=s?[t,...n]:n,a=s&&ht(t)?tn:en;Be.each(l,(t=>{a(e,t,o,r)})),e.selection.setRng(zt(i))}else Ft(e)})(e,o,s,t,i):((e,t,n,o)=>{if(t!==e.getBody())if(t)if(t.nodeName!==n||nn(o)||ht(t)){const r=Kt(e.selection.getRng());ht(t)&&t.classList.forEach(((e,n,o)=>{e.startsWith("tox-")&&(o.remove(e),0===o.length&&t.removeAttribute("class"))})),qt(e.dom,t,o);const s=e.dom.rename(t,n);Yt(e.dom,s),e.selection.setRng(zt(r)),Jt(e,n,o),bt(e,Qt(n),s)}else Ft(e);else Jt(e,n,o),bt(e,Qt(n),t)})(e,o,t,i)},rn=De.DOM,sn=(e,t)=>{const n=Be.grep(e.select("ol,ul",t));Be.each(n,(t=>{((e,t)=>{const n=t.parentElement;if(n&&"LI"===n.nodeName&&n.firstChild===t){const o=n.previousSibling;o&&"LI"===o.nodeName?(o.appendChild(t),We(e,n)&&rn.remove(n)):rn.setStyle(n,"listStyleType","none")}if(Ue(n)){const e=n.previousSibling;e&&"LI"===e.nodeName&&e.appendChild(t)}})(e,t)}))},ln=(e,t,n,o)=>{let r=t.startContainer;const s=t.startOffset;if(Ie(r)&&(n?s<r.data.length:s>0))return r;const i=e.schema.getNonEmptyElements();Re(r)&&(r=ke.getNode(r,s));const l=new Ee(r,o);n&&((e,t)=>!!je(t)&&e.isBlock(t.nextSibling)&&!je(t.previousSibling))(e.dom,r)&&l.next();const a=n?l.next.bind(l):l.prev2.bind(l);for(;r=a();){if("LI"===r.nodeName&&!r.hasChildNodes())return r;if(i[r.nodeName])return r;if(Ie(r)&&r.data.length>0)return r}return null},an=(e,t)=>{const n=t.childNodes;return 1===n.length&&!Ue(n[0])&&e.isBlock(n[0])},dn=e=>h.from(e).map(z).filter(ee).exists((e=>((e,t=!1)=>{return Ne(e)?e.dom.isContentEditable:(n=e,Oe(((e,t)=>Q(e,t)),xe,n,"[contenteditable]",void 0)).fold(m(t),(e=>"true"===(e=>e.dom.contentEditable)(e)));var n})(e)&&!C(["details"],J(e)))),cn=(e,t,n)=>{let o;const r=an(e,n)?n.firstChild:n;if(((e,t)=>{an(e,t)&&dn(t.firstChild)&&e.remove(t.firstChild,!0)})(e,t),!We(e,t,!0))for(;o=t.firstChild;)r.appendChild(o)},mn=(e,t,n)=>{let o;const r=t.parentNode;if(!qe(e,t)||!qe(e,n))return;Ue(n.lastChild)&&(o=n.lastChild),r===n.lastChild&&je(r.previousSibling)&&e.remove(r.previousSibling);const s=n.lastChild;s&&je(s)&&t.hasChildNodes()&&e.remove(s),We(e,n,!0)&&fe(z(n)),cn(e,t,n),o&&n.appendChild(o);const i=((e,t)=>{const n=e.dom,o=t.dom;return n!==o&&n.contains(o)})(z(n),z(t))?e.getParents(t,Ue,n):[];e.remove(t),S(i,(t=>{We(e,t)&&t!==e.getRoot()&&e.remove(t)}))},un=(e,t)=>{const n=e.dom,o=e.selection,r=o.getStart(),s=mt(e,r),i=n.getParent(o.getStart(),"LI",s);if(i){const r=i.parentElement;if(r===e.getBody()&&We(n,r))return!0;const l=it(o.getRng()),a=n.getParent(ln(e,l,t,s),"LI",s),d=a&&(t?n.isChildOf(i,a):n.isChildOf(a,i));if(a&&a!==i&&!d)return e.undoManager.transact((()=>{var n,o;t?((e,t,n,o)=>{const r=e.dom;if(r.isEmpty(o))((e,t,n)=>{fe(z(n)),mn(e.dom,t,n),e.selection.setCursorLocation(n,0)})(e,n,o);else{const s=Kt(t);mn(r,n,o),e.selection.setRng(zt(s))}})(e,l,a,i):(null===(o=(n=i).parentNode)||void 0===o?void 0:o.firstChild)===n?Ht(e):((e,t,n,o)=>{const r=Kt(t);mn(e.dom,n,o);const s=zt(r);e.selection.setRng(s)})(e,l,i,a)})),!0;if(d&&!t&&a!==i){const t=l.commonAncestorContainer.parentElement;return!(!t||n.isChildOf(a,t)||(e.undoManager.transact((()=>{const o=Kt(l);cn(n,t,a),t.remove();const r=zt(o);e.selection.setRng(r)})),0))}if(!a&&!t&&0===l.startOffset&&0===l.endOffset)return e.undoManager.transact((()=>{Ft(e)})),!0}return!1},pn=e=>{const t=e.selection.getStart(),n=mt(e,t);return e.dom.getParent(t,"LI,DT,DD",n)||ct(e).length>0},gn=(e,t)=>{const n=e.selection;return!vt(e,n.getNode())&&(n.isCollapsed()?((e,t)=>un(e,t)||((e,t)=>{const n=e.dom,o=e.selection.getStart(),r=mt(e,o),s=n.getParent(o,n.isBlock,r);if(s&&n.isEmpty(s,void 0,{checkRootAsContent:!0})){const o=it(e.selection.getRng()),i=ln(e,o,t,r),l=n.getParent(i,"LI",r);if(i&&l){const a=e=>C(["td","th","caption"],J(e)),d=e=>e.dom===r;return!!((e,t,n=u)=>U(e,t,n).getOr(e.isNone()&&t.isNone()))(Te(z(l),a,d),Te(z(o.startContainer),a,d),W)&&(e.undoManager.transact((()=>{const o=l.parentNode;((e,t,n)=>{const o=e.getParent(t.parentNode,e.isBlock,n);e.remove(t),o&&e.isEmpty(o)&&e.remove(o)})(n,s,r),Yt(n,o),e.selection.select(i,!0),e.selection.collapse(t)})),!0)}}return!1})(e,t))(e,t):(e=>!!pn(e)&&(e.undoManager.transact((()=>{let t=!0;const n=()=>t=!1;e.on("input",n),e.execCommand("Delete"),e.off("input",n),t&&e.dispatch("input"),sn(e.dom,e.getBody())})),!0))(e))},hn=e=>{const t=k(_(e).split("")),n=N(t,((e,t)=>{const n=e.toUpperCase().charCodeAt(0)-"A".charCodeAt(0)+1;return Math.pow(26,t)*n}));return O(n,((e,t)=>e+t),0)},fn=e=>{if(--e<0)return"";{const t=e%26,n=Math.floor(e/26);return fn(n)+String.fromCharCode("A".charCodeAt(0)+t)}},yn=e=>{const t=parseInt(e.start,10);return R(e.listStyleType,"upper-alpha")?fn(t):R(e.listStyleType,"lower-alpha")?fn(t).toLowerCase():e.start},vn=(e,t)=>()=>{const n=dt(e);return l(n)&&n.nodeName===t},Cn=e=>{e.addCommand("mceListProps",(()=>{(e=>{const t=dt(e);_e(t)&&!vt(e,t)&&e.windowManager.open({title:"List Properties",body:{type:"panel",items:[{type:"input",name:"start",label:"Start list at number",inputMode:"numeric"}]},initialData:{start:yn({start:e.dom.getAttrib(t,"start","1"),listStyleType:h.from(e.dom.getStyle(t,"list-style-type"))})},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],onSubmit:t=>{(e=>{switch((e=>/^[0-9]+$/.test(e)?2:/^[A-Z]+$/.test(e)?0:/^[a-z]+$/.test(e)?1:e.length>0?4:3)(e)){case 2:return h.some({listStyleType:h.none(),start:e});case 0:return h.some({listStyleType:h.some("upper-alpha"),start:hn(e).toString()});case 1:return h.some({listStyleType:h.some("lower-alpha"),start:hn(e).toString()});case 3:return h.some({listStyleType:h.none(),start:""});case 4:return h.none()}})(t.getData().start).each((t=>{e.execCommand("mceListUpdate",!1,{attrs:{start:"1"===t.start?"":t.start},styles:{"list-style-type":t.listStyleType.getOr("")}})})),t.close()}})})(e)}))};var bn=tinymce.util.Tools.resolve("tinymce.html.Node");const Nn=e=>3===e.type,Sn=e=>0===e.length,Ln=e=>{const t=(t,n)=>{const o=bn.create("li");S(t,(e=>o.append(e))),n?e.insert(o,n,!0):e.append(o)},n=O(e.children(),((e,n)=>Nn(n)?[...e,n]:Sn(e)||Nn(n)?e:(t(e,n),[])),[]);Sn(n)||t(n)},On=(e,t)=>n=>(n.setEnabled(e.selection.isEditable()),Ct(e,(o=>{n.setActive(ft(o.parents,t)),n.setEnabled(!vt(e,o.element)&&e.selection.isEditable())}))),An=(e,t)=>n=>Ct(e,(o=>n.setEnabled(ft(o.parents,t)&&!vt(e,o.element))));e.add("lists",(e=>((e=>{(0,e.options.register)("lists_indent_on_tab",{processor:"boolean",default:!0})})(e),(e=>{e.on("PreInit",(()=>{const{parser:t}=e;t.addNodeFilter("ul,ol",(e=>S(e,Ln)))}))})(e),e.hasPlugin("rtc",!0)?Cn(e):((e=>{Ge(e)&&(e=>{e.on("keydown",(t=>{t.keyCode!==we.TAB||we.metaKeyPressed(t)||e.undoManager.transact((()=>{(t.shiftKey?Ht(e):_t(e))&&t.preventDefault()}))}))})(e),(e=>{e.on("ExecCommand",(t=>{const n=t.command.toLowerCase();"delete"!==n&&"forwarddelete"!==n||!pn(e)||sn(e.dom,e.getBody())})),e.on("keydown",(t=>{t.keyCode===we.BACKSPACE?gn(e,!1)&&t.preventDefault():t.keyCode===we.DELETE&&gn(e,!0)&&t.preventDefault()}))})(e)})(e),(e=>{e.on("BeforeExecCommand",(t=>{const n=t.command.toLowerCase();"indent"===n?_t(e):"outdent"===n&&Ht(e)})),e.addCommand("InsertUnorderedList",((t,n)=>{on(e,"UL",n)})),e.addCommand("InsertOrderedList",((t,n)=>{on(e,"OL",n)})),e.addCommand("InsertDefinitionList",((t,n)=>{on(e,"DL",n)})),e.addCommand("RemoveList",(()=>{Ft(e)})),Cn(e),e.addCommand("mceListUpdate",((t,n)=>{r(n)&&((e,t)=>{const n=dt(e);null===n||vt(e,n)||e.undoManager.transact((()=>{r(t.styles)&&e.dom.setStyles(n,t.styles),r(t.attrs)&&P(t.attrs,((t,o)=>e.dom.setAttrib(n,o,t)))}))})(e,n)})),e.addQueryStateHandler("InsertUnorderedList",vn(e,"UL")),e.addQueryStateHandler("InsertOrderedList",vn(e,"OL")),e.addQueryStateHandler("InsertDefinitionList",vn(e,"DL"))})(e)),(e=>{const t=t=>()=>e.execCommand(t);e.hasPlugin("advlist")||(e.ui.registry.addToggleButton("numlist",{icon:"ordered-list",active:!1,tooltip:"Numbered list",onAction:t("InsertOrderedList"),onSetup:On(e,"OL")}),e.ui.registry.addToggleButton("bullist",{icon:"unordered-list",active:!1,tooltip:"Bullet list",onAction:t("InsertUnorderedList"),onSetup:On(e,"UL")}))})(e),(e=>{const t={text:"List properties...",icon:"ordered-list",onAction:()=>e.execCommand("mceListProps"),onSetup:An(e,"OL")};e.ui.registry.addMenuItem("listprops",t),e.ui.registry.addContextMenu("lists",{update:t=>{const n=dt(e,t);return _e(n)?["listprops"]:[]}})})(e),(e=>({backspaceDelete:t=>{gn(e,t)}}))(e))))}();
|
|
1
|
+
!function(){"use strict";var t=tinymce.util.Tools.resolve("tinymce.PluginManager");const e=t=>!(t=>null==t)(t),r=t=>"function"==typeof t;const s=(t,e)=>t===e,n=()=>false;class o{tag;value;static singletonNone=new o(!1);constructor(t,e){this.tag=t,this.value=e}static some(t){return new o(!0,t)}static none(){return o.singletonNone}fold(t,e){return this.tag?e(this.value):t()}isSome(){return this.tag}isNone(){return!this.tag}map(t){return this.tag?o.some(t(this.value)):o.none()}bind(t){return this.tag?t(this.value):o.none()}exists(t){return this.tag&&t(this.value)}forall(t){return!this.tag||t(this.value)}filter(t){return!this.tag||t(this.value)?this:o.none()}getOr(t){return this.tag?this.value:t}or(t){return this.tag?this:t}getOrThunk(t){return this.tag?this.value:t()}orThunk(t){return this.tag?this:t()}getOrDie(t){if(this.tag)return this.value;throw new Error(t??"Called getOrDie on None")}static from(t){return e(t)?o.some(t):o.none()}getOrNull(){return this.tag?this.value:null}getOrUndefined(){return this.value}each(t){this.tag&&t(this.value)}toArray(){return this.tag?[this.value]:[]}toString(){return this.tag?`some(${this.value})`:"none()"}}const a=Array.prototype.slice,i=(t,e,r)=>{for(let s=0,n=t.length;s<n;s++){const n=t[s];if(e(n,s))return o.some(n);if(r(n,s))break}return o.none()};r(Array.from)&&Array.from;const l=(t,e,r=s)=>t.exists((t=>r(t,e))),u=(c=/^\s+|\s+$/g,t=>t.replace(c,""));var c;const d=t=>{const e=(t=>{const e=a.call(t,0);return e.reverse(),e})(u(t).split("")),r=((t,e)=>{const r=t.length,s=new Array(r);for(let n=0;n<r;n++){const r=t[n];s[n]=e(r,n)}return s})(e,((t,e)=>{const r=t.toUpperCase().charCodeAt(0)-"A".charCodeAt(0)+1;return Math.pow(26,e)*r}));return s=(t,e)=>t+e,n=0,((t,e)=>{for(let r=0,s=t.length;r<s;r++)e(t[r],r)})(r,((t,e)=>{n=s(n,t)})),n;var s,n},g=t=>{if(--t<0)return"";{const e=t%26,r=Math.floor(t/26);return g(r)+String.fromCharCode("A".charCodeAt(0)+e)}},m=t=>{const e=parseInt(t.start,10);return l(t.listStyleType,"upper-alpha")?g(e):l(t.listStyleType,"lower-alpha")?g(e).toLowerCase():t.start},h=t=>t.options.get("forced_root_block");const p=t=>r=>e(r)&&t.test(r.nodeName),y=p(/^(OL|UL|DL)$/),v=p(/^(TH|TD)$/),f=p(/^(LI|DT|DD)$/),b=(t,e)=>i(t,y,v).exists((t=>t.nodeName===e&&!(t=>/\btox\-/.test(t.className))(t))),L=(t,e)=>{const r=t.selection.getNode();return e({parents:t.dom.getParents(r),element:r}),t.on("NodeChange",e),()=>t.off("NodeChange",e)},S=(t,e)=>{const r=t.dom.getParent(e,"ol,ul,dl");return((t,e)=>null!==e&&!t.dom.isEditable(e))(t,r)||!t.selection.isEditable()},C=t=>e(t)&&"ol"===t.nodeName.toLowerCase(),A=["OL","UL","DL"],T=A.join(","),N=(t,e)=>{const r=e||t.selection.getStart(!0);return t.dom.getParent(r,T,w(t,r))},w=(t,e)=>{const r=t.dom.getParents(e,t.dom.isBlock),s=(o=e=>(e=>e.nodeName.toLowerCase()!==h(t))(e)&&O(t.schema,e),i(r,o,n));var o;return s.getOr(t.getBody())},O=(t,e)=>!y(e)&&!f(e)&&(r=>{for(let n=0,o=r.length;n<o;n++)if(s=r[n],t.isValidChild(e.nodeName,s))return!0;var s;return!1})(A),x=(t,e)=>r=>(r.setEnabled(t.selection.isEditable()),L(t,(s=>{r.setActive(b(s.parents,e)),r.setEnabled(!S(t,s.element)&&t.selection.isEditable())}))),D=(t,e)=>r=>L(t,(s=>r.setEnabled(b(s.parents,e)&&!S(t,s.element))));t.add("lists",(t=>((t=>{t.addCommand("mceListProps",(()=>{(t=>{const e=N(t);C(e)&&!S(t,e)&&t.windowManager.open({title:"List Properties",body:{type:"panel",items:[{type:"input",name:"start",label:"Start list at number",inputMode:"numeric"}]},initialData:{start:m({start:t.dom.getAttrib(e,"start","1"),listStyleType:o.from(t.dom.getStyle(e,"list-style-type"))})},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],onSubmit:e=>{(t=>{switch((t=>/^[0-9]+$/.test(t)?2:/^[A-Z]+$/.test(t)?0:/^[a-z]+$/.test(t)?1:t.length>0?4:3)(t)){case 2:return o.some({listStyleType:o.none(),start:t});case 0:return o.some({listStyleType:o.some("upper-alpha"),start:d(t).toString()});case 1:return o.some({listStyleType:o.some("lower-alpha"),start:d(t).toString()});case 3:return o.some({listStyleType:o.none(),start:""});case 4:return o.none()}})(e.getData().start).each((e=>{t.execCommand("mceListUpdate",!1,{attrs:{start:"1"===e.start?"":e.start},styles:{"list-style-type":e.listStyleType.getOr("")}})})),e.close()}})})(t)}))})(t),(t=>{const e=e=>()=>t.execCommand(e);t.hasPlugin("advlist")||(t.ui.registry.addToggleButton("numlist",{icon:"ordered-list",active:!1,tooltip:"Numbered list",onAction:e("InsertOrderedList"),onSetup:x(t,"OL")}),t.ui.registry.addToggleButton("bullist",{icon:"unordered-list",active:!1,tooltip:"Bullet list",onAction:e("InsertUnorderedList"),onSetup:x(t,"UL")}))})(t),(t=>{const e={text:"List properties...",icon:"ordered-list",onAction:()=>t.execCommand("mceListProps"),onSetup:D(t,"OL")};t.ui.registry.addMenuItem("listprops",e),t.ui.registry.addContextMenu("lists",{update:e=>{const r=N(t,e);return C(r)?["listprops"]:[]}})})(t),(t=>({backspaceDelete:e=>{t.execCommand("mceListBackspaceDelete",!1,e)}}))(t))))}();
|
|
@@ -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) => {
|
|
@@ -58,6 +57,11 @@
|
|
|
58
57
|
* strict-null-checks
|
|
59
58
|
*/
|
|
60
59
|
class Optional {
|
|
60
|
+
tag;
|
|
61
|
+
value;
|
|
62
|
+
// Sneaky optimisation: every instance of Optional.none is identical, so just
|
|
63
|
+
// reuse the same object
|
|
64
|
+
static singletonNone = new Optional(false);
|
|
61
65
|
// The internal representation has a `tag` and a `value`, but both are
|
|
62
66
|
// private: able to be console.logged, but not able to be accessed by code
|
|
63
67
|
constructor(tag, value) {
|
|
@@ -225,7 +229,7 @@
|
|
|
225
229
|
*/
|
|
226
230
|
getOrDie(message) {
|
|
227
231
|
if (!this.tag) {
|
|
228
|
-
throw new Error(message
|
|
232
|
+
throw new Error(message ?? 'Called getOrDie on None');
|
|
229
233
|
}
|
|
230
234
|
else {
|
|
231
235
|
return this.value;
|
|
@@ -289,11 +293,7 @@
|
|
|
289
293
|
return this.tag ? `some(${this.value})` : 'none()';
|
|
290
294
|
}
|
|
291
295
|
}
|
|
292
|
-
// Sneaky optimisation: every instance of Optional.none is identical, so just
|
|
293
|
-
// reuse the same object
|
|
294
|
-
Optional.singletonNone = new Optional(false);
|
|
295
296
|
|
|
296
|
-
/* eslint-disable @typescript-eslint/unbound-method */
|
|
297
297
|
const nativeSlice = Array.prototype.slice;
|
|
298
298
|
const nativePush = Array.prototype.push;
|
|
299
299
|
// Unwound implementing other functions in terms of each.
|
|
@@ -327,7 +327,6 @@
|
|
|
327
327
|
//
|
|
328
328
|
// Use the native keys if it is available (IE9+), otherwise fall back to manually filtering
|
|
329
329
|
const keys = Object.keys;
|
|
330
|
-
// eslint-disable-next-line @typescript-eslint/unbound-method
|
|
331
330
|
const hasOwnProperty = Object.hasOwnProperty;
|
|
332
331
|
const each = (obj, f) => {
|
|
333
332
|
const props = keys(obj);
|
|
@@ -476,7 +475,6 @@
|
|
|
476
475
|
};
|
|
477
476
|
|
|
478
477
|
const guess = (url) => {
|
|
479
|
-
var _a;
|
|
480
478
|
const mimes = {
|
|
481
479
|
mp3: 'audio/mpeg',
|
|
482
480
|
m4a: 'audio/x-m4a',
|
|
@@ -486,7 +484,7 @@
|
|
|
486
484
|
ogg: 'video/ogg',
|
|
487
485
|
swf: 'application/x-shockwave-flash'
|
|
488
486
|
};
|
|
489
|
-
const fileEnd =
|
|
487
|
+
const fileEnd = url.toLowerCase().split('.').pop() ?? '';
|
|
490
488
|
return get$1(mimes, fileEnd).getOr('');
|
|
491
489
|
};
|
|
492
490
|
|
|
@@ -733,10 +731,9 @@
|
|
|
733
731
|
}
|
|
734
732
|
};
|
|
735
733
|
const dataToHtml = (editor, dataIn) => {
|
|
736
|
-
var _a;
|
|
737
734
|
const data = global$5.extend({}, dataIn);
|
|
738
735
|
if (!data.source) {
|
|
739
|
-
global$5.extend(data, htmlToData(
|
|
736
|
+
global$5.extend(data, htmlToData(data.embed ?? '', editor.schema));
|
|
740
737
|
if (!data.source) {
|
|
741
738
|
return '';
|
|
742
739
|
}
|
|
@@ -969,11 +966,10 @@
|
|
|
969
966
|
return hasDimensionsChanged(prevData, newData) && isEmbedIframe(newData.source, prevData.type);
|
|
970
967
|
};
|
|
971
968
|
const submitForm = (prevData, newData, editor) => {
|
|
972
|
-
var _a;
|
|
973
969
|
newData.embed =
|
|
974
970
|
shouldInsertAsNewIframe(prevData, newData) && hasDimensions(editor)
|
|
975
971
|
? dataToHtml(editor, { ...newData, embed: '' })
|
|
976
|
-
: updateHtml(
|
|
972
|
+
: updateHtml(newData.embed ?? '', newData, false, editor.schema);
|
|
977
973
|
// Only fetch the embed HTML content if the URL has changed from what it previously was
|
|
978
974
|
if (newData.embed && (prevData.source === newData.source || isCached(newData.source))) {
|
|
979
975
|
handleInsert(editor, newData.embed);
|
|
@@ -1000,9 +996,8 @@
|
|
|
1000
996
|
}
|
|
1001
997
|
};
|
|
1002
998
|
const handleEmbed = (api) => {
|
|
1003
|
-
var _a;
|
|
1004
999
|
const data = unwrap(api.getData());
|
|
1005
|
-
const dataFromEmbed = htmlToData(
|
|
1000
|
+
const dataFromEmbed = htmlToData(data.embed ?? '', editor.schema);
|
|
1006
1001
|
api.setData(wrap(dataFromEmbed));
|
|
1007
1002
|
};
|
|
1008
1003
|
const handleUpdate = (api, sourceInput, prevData) => {
|
|
@@ -1186,7 +1181,6 @@
|
|
|
1186
1181
|
return placeHolder;
|
|
1187
1182
|
};
|
|
1188
1183
|
const createPreviewNode = (editor, node) => {
|
|
1189
|
-
var _a;
|
|
1190
1184
|
const name = node.name;
|
|
1191
1185
|
const previewWrapper = new global$2('span', 1);
|
|
1192
1186
|
previewWrapper.attr({
|
|
@@ -1196,7 +1190,7 @@
|
|
|
1196
1190
|
'class': 'mce-preview-object mce-object-' + name
|
|
1197
1191
|
});
|
|
1198
1192
|
retainAttributesAndInnerHtml(editor, node, previewWrapper);
|
|
1199
|
-
const styles = editor.dom.parseStyle(
|
|
1193
|
+
const styles = editor.dom.parseStyle(node.attr('style') ?? '');
|
|
1200
1194
|
const previewNode = new global$2(name, 1);
|
|
1201
1195
|
setDimensions(node, previewNode, styles);
|
|
1202
1196
|
previewNode.attr({
|
|
@@ -1231,10 +1225,9 @@
|
|
|
1231
1225
|
return previewWrapper;
|
|
1232
1226
|
};
|
|
1233
1227
|
const retainAttributesAndInnerHtml = (editor, sourceNode, targetNode) => {
|
|
1234
|
-
var _a;
|
|
1235
1228
|
// Prefix all attributes except internal (data-mce-*), width, height and style since we
|
|
1236
1229
|
// will add these to the placeholder
|
|
1237
|
-
const attribs =
|
|
1230
|
+
const attribs = sourceNode.attributes ?? [];
|
|
1238
1231
|
let ai = attribs.length;
|
|
1239
1232
|
while (ai--) {
|
|
1240
1233
|
const attrName = attribs[ai].name;
|
|
@@ -1325,7 +1318,6 @@
|
|
|
1325
1318
|
parser.addNodeFilter('iframe,video,audio,object,embed', placeHolderConverter(editor));
|
|
1326
1319
|
// Replaces placeholder images with real elements for video, object, iframe etc
|
|
1327
1320
|
serializer.addAttributeFilter('data-mce-object', (nodes, name) => {
|
|
1328
|
-
var _a;
|
|
1329
1321
|
let i = nodes.length;
|
|
1330
1322
|
while (i--) {
|
|
1331
1323
|
const node = nodes[i];
|
|
@@ -1354,7 +1346,7 @@
|
|
|
1354
1346
|
style: node.attr('style')
|
|
1355
1347
|
});
|
|
1356
1348
|
// Unprefix all placeholder attributes
|
|
1357
|
-
const attribs =
|
|
1349
|
+
const attribs = node.attributes ?? [];
|
|
1358
1350
|
let ai = attribs.length;
|
|
1359
1351
|
while (ai--) {
|
|
1360
1352
|
const attrName = attribs[ai].name;
|
|
@@ -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&&(r=o=e,(a=String).prototype.isPrototypeOf(r)||(null===(s=o.constructor)||void 0===s?void 0:s.name)===a.name)?"string":t;var r,o,a,s})(t)===e,r=t("string"),o=t("object"),a=t("array"),s=e=>!(e=>null==e)(e),i=e=>"function"==typeof e;class n{constructor(e,t){this.tag=e,this.value=t}static some(e){return new n(!0,e)}static none(){return n.singletonNone}fold(e,t){return this.tag?t(this.value):e()}isSome(){return this.tag}isNone(){return!this.tag}map(e){return this.tag?n.some(e(this.value)):n.none()}bind(e){return this.tag?e(this.value):n.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:n.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 s(e)?n.some(e):n.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()"}}n.singletonNone=new n(!1),Array.prototype.slice;const l=Array.prototype.push,c=(e,t)=>{for(let r=0,o=e.length;r<o;r++)t(e[r],r)},m=e=>{const t=[];for(let r=0,o=e.length;r<o;++r){if(!a(e[r]))throw new Error("Arr.flatten item "+r+" was not an array, input: "+e);l.apply(t,e[r])}return t};i(Array.from)&&Array.from;const u=Object.keys,d=Object.hasOwnProperty,h=(e,t)=>p(e,t)?n.from(e[t]):n.none(),p=(e,t)=>d.call(e,t),g=e=>t=>t.options.get(e),b=g("audio_template_callback"),w=g("video_template_callback"),f=g("iframe_template_callback"),v=g("media_live_embeds"),y=g("media_filter_html"),x=g("media_url_resolver"),_=g("media_alt_source"),k=g("media_poster"),j=g("media_dimensions");var A=tinymce.util.Tools.resolve("tinymce.util.Tools"),O=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),S=tinymce.util.Tools.resolve("tinymce.html.DomParser");const $=O.DOM,C=e=>e.replace(/px$/,""),T=e=>{const t=e.attr("style"),r=t?$.parseStyle(t):{};return{type:"ephox-embed-iri",source:e.attr("data-ephox-embed-iri"),altsource:"",poster:"",width:h(r,"max-width").map(C).getOr(""),height:h(r,"max-height").map(C).getOr("")}},z=(e,t)=>{let r={};for(let o=S({validate:!1,forced_root_block:!1},t).parse(e);o;o=o.walk())if(1===o.type){const e=o.name;if(o.attr("data-ephox-embed-iri")){r=T(o);break}r.source||"param"!==e||(r.source=o.attr("movie")),"iframe"!==e&&"object"!==e&&"embed"!==e&&"video"!==e&&"audio"!==e||(r.type||(r.type=e),r=A.extend(o.attributes.map,r)),"source"===e&&(r.source?r.altsource||(r.altsource=o.attr("src")):r.source=o.attr("src")),"img"!==e||r.poster||(r.poster=o.attr("src"))}return r.source=r.source||r.src||"",r.altsource=r.altsource||"",r.poster=r.poster||"",r},D=e=>{var t;const r=null!==(t=e.toLowerCase().split(".").pop())&&void 0!==t?t:"";return h({mp3:"audio/mpeg",m4a:"audio/x-m4a",wav:"audio/wav",mp4:"video/mp4",webm:"video/webm",ogg:"video/ogg",swf:"application/x-shockwave-flash"},r).getOr("")};var F=tinymce.util.Tools.resolve("tinymce.html.Node"),M=tinymce.util.Tools.resolve("tinymce.html.Serializer");const N=(e,t={})=>S({forced_root_block:!1,validate:!1,allow_conditional_comments:!0,...t},e),P=O.DOM,R=e=>/^[0-9.]+$/.test(e)?e+"px":e,E=(e,t)=>{const r=t.attr("style"),o=r?P.parseStyle(r):{};s(e.width)&&(o["max-width"]=R(e.width)),s(e.height)&&(o["max-height"]=R(e.height)),t.attr("style",P.serializeStyle(o))},U=["source","altsource"],L=(e,t,r,o)=>{let a=0,s=0;const i=N(o);i.addNodeFilter("source",(e=>a=e.length));const n=i.parse(e);for(let e=n;e;e=e.walk())if(1===e.type){const o=e.name;if(e.attr("data-ephox-embed-iri")){E(t,e);break}switch(o){case"video":case"object":case"embed":case"img":case"iframe":void 0!==t.height&&void 0!==t.width&&(e.attr("width",t.width),e.attr("height",t.height))}if(r)switch(o){case"video":e.attr("poster",t.poster),e.attr("src",null);for(let r=a;r<2;r++)if(t[U[r]]){const o=new F("source",1);o.attr("src",t[U[r]]),o.attr("type",t[U[r]+"mime"]||null),e.append(o)}break;case"iframe":e.attr("src",t.source);break;case"object":const r=e.getAll("img").length>0;if(t.poster&&!r){e.attr("src",t.poster);const r=new F("img",1);r.attr("src",t.poster),r.attr("width",t.width),r.attr("height",t.height),e.append(r)}break;case"source":if(s<2&&(e.attr("src",t[U[s]]),e.attr("type",t[U[s]+"mime"]||null),!t[U[s]])){e.remove();continue}s++;break;case"img":t.poster||e.remove()}}return M({},o).serialize(n)},I=[{regex:/youtu\.be\/([\w\-_\?&=.]+)/i,type:"iframe",w:560,h:314,url:"www.youtube.com/embed/$1",allowFullscreen:!0},{regex:/youtube\.com(.+)v=([^&]+)(&([a-z0-9&=\-_]+))?/i,type:"iframe",w:560,h:314,url:"www.youtube.com/embed/$2?$4",allowFullscreen:!0},{regex:/youtube.com\/embed\/([a-z0-9\?&=\-_]+)/i,type:"iframe",w:560,h:314,url:"www.youtube.com/embed/$1",allowFullscreen:!0},{regex:/vimeo\.com\/([0-9]+)\?h=(\w+)/,type:"iframe",w:425,h:350,url:"player.vimeo.com/video/$1?h=$2&title=0&byline=0&portrait=0&color=8dc7dc",allowFullscreen:!0},{regex:/vimeo\.com\/(.*)\/([0-9]+)\?h=(\w+)/,type:"iframe",w:425,h:350,url:"player.vimeo.com/video/$2?h=$3&title=0&byline=0",allowFullscreen:!0},{regex:/vimeo\.com\/([0-9]+)/,type:"iframe",w:425,h:350,url:"player.vimeo.com/video/$1?title=0&byline=0&portrait=0&color=8dc7dc",allowFullscreen:!0},{regex:/vimeo\.com\/(.*)\/([0-9]+)/,type:"iframe",w:425,h:350,url:"player.vimeo.com/video/$2?title=0&byline=0",allowFullscreen:!0},{regex:/maps\.google\.([a-z]{2,3})\/maps\/(.+)msid=(.+)/,type:"iframe",w:425,h:350,url:'maps.google.com/maps/ms?msid=$2&output=embed"',allowFullscreen:!1},{regex:/dailymotion\.com\/video\/([^_]+)/,type:"iframe",w:480,h:270,url:"www.dailymotion.com/embed/video/$1",allowFullscreen:!0},{regex:/dai\.ly\/([^_]+)/,type:"iframe",w:480,h:270,url:"www.dailymotion.com/embed/video/$1",allowFullscreen:!0}],B=(e,t)=>{const r=(e=>{const t=e.match(/^(https?:\/\/|www\.)(.+)$/i);return t&&t.length>1?"www."===t[1]?"https://":t[1]:"https://"})(t),o=e.regex.exec(t);let a=r+e.url;if(s(o))for(let e=0;e<o.length;e++)a=a.replace("$"+e,(()=>o[e]?o[e]:""));return a.replace(/\?$/,"")},G=e=>{const t=I.filter((t=>t.regex.test(e)));return t.length>0?A.extend({},t[0],{url:B(t[0],e)}):null},W=(e,t)=>{var r;const o=A.extend({},t);if(!o.source&&(A.extend(o,z(null!==(r=o.embed)&&void 0!==r?r:"",e.schema)),!o.source))return"";o.altsource||(o.altsource=""),o.poster||(o.poster=""),o.source=e.convertURL(o.source,"source"),o.altsource=e.convertURL(o.altsource,"source"),o.sourcemime=D(o.source),o.altsourcemime=D(o.altsource),o.poster=e.convertURL(o.poster,"poster");const a=G(o.source);if(a&&(o.source=a.url,o.type=a.type,o.allowfullscreen=a.allowFullscreen,o.width=o.width||String(a.w),o.height=o.height||String(a.h)),o.embed)return L(o.embed,o,!0,e.schema);{const t=b(e),r=w(e),a=f(e);return o.width=o.width||"300",o.height=o.height||"150",A.each(o,((t,r)=>{o[r]=e.dom.encode(""+t)})),"iframe"===o.type?((e,t)=>{if(t)return t(e);{const t=e.allowfullscreen?' allowFullscreen="1"':"";return'<iframe src="'+e.source+'" width="'+e.width+'" height="'+e.height+'"'+t+"></iframe>"}})(o,a):"application/x-shockwave-flash"===o.sourcemime?(e=>{let t='<object data="'+e.source+'" width="'+e.width+'" height="'+e.height+'" type="application/x-shockwave-flash">';return e.poster&&(t+='<img src="'+e.poster+'" width="'+e.width+'" height="'+e.height+'" />'),t+="</object>",t})(o):-1!==o.sourcemime.indexOf("audio")?((e,t)=>t?t(e):'<audio controls="controls" src="'+e.source+'">'+(e.altsource?'\n<source src="'+e.altsource+'"'+(e.altsourcemime?' type="'+e.altsourcemime+'"':"")+" />\n":"")+"</audio>")(o,t):((e,t)=>t?t(e):'<video width="'+e.width+'" height="'+e.height+'"'+(e.poster?' poster="'+e.poster+'"':"")+' controls="controls">\n<source src="'+e.source+'"'+(e.sourcemime?' type="'+e.sourcemime+'"':"")+" />\n"+(e.altsource?'<source src="'+e.altsource+'"'+(e.altsourcemime?' type="'+e.altsourcemime+'"':"")+" />\n":"")+"</video>")(o,r)}},q=e=>e.hasAttribute("data-mce-object")||e.hasAttribute("data-ephox-embed-iri"),H={},J=e=>t=>W(e,t),K=(e,t)=>{const r=x(e);return r?((e,t,r)=>new Promise(((o,a)=>{const s=r=>(r.html&&(H[e.source]=r),o({url:e.source,html:r.html?r.html:t(e)}));H[e.source]?s(H[e.source]):r({url:e.source}).then(s).catch(a)})))(t,J(e),r):((e,t)=>Promise.resolve({html:t(e),url:e.source}))(t,J(e))},Q=(e,t)=>{const r={};return h(e,"dimensions").each((e=>{c(["width","height"],(o=>{h(t,o).orThunk((()=>h(e,o))).each((e=>r[o]=e))}))})),r},V=(e,t)=>{const r=t&&"dimensions"!==t?((e,t)=>h(t,e).bind((e=>h(e,"meta"))))(t,e).getOr({}):{},a=((e,t,r)=>a=>{const s=()=>h(e,a),i=()=>h(t,a),l=e=>h(e,"value").bind((e=>e.length>0?n.some(e):n.none()));return{[a]:(a===r?s().bind((e=>o(e)?l(e).orThunk(i):i().orThunk((()=>n.from(e))))):i().orThunk((()=>s().bind((e=>o(e)?l(e):n.from(e)))))).getOr("")}})(e,r,t);return{...a("source"),...a("altsource"),...a("poster"),...a("embed"),...Q(e,r)}},X=e=>{const t={...e,source:{value:h(e,"source").getOr("")},altsource:{value:h(e,"altsource").getOr("")},poster:{value:h(e,"poster").getOr("")}};return c(["width","height"],(r=>{h(e,r).each((e=>{const o=t.dimensions||{};o[r]=e,t.dimensions=o}))})),t},Y=e=>t=>{const r=t&&t.msg?"Media embed handler error: "+t.msg:"Media embed handler threw unknown error.";e.notificationManager.open({type:"error",text:r})},Z=(e,t)=>o=>{if(r(o.url)&&o.url.trim().length>0){const r=o.html,a={...z(r,t.schema),source:o.url,embed:r};e.setData(X(a))}},ee=(e,t)=>{const r=e.dom.select("*[data-mce-object]");e.insertContent(t),((e,t)=>{const r=e.dom.select("*[data-mce-object]");for(let e=0;e<t.length;e++)for(let o=r.length-1;o>=0;o--)t[e]===r[o]&&r.splice(o,1);e.selection.select(r[0])})(e,r),e.nodeChanged()},te=(e,t)=>s(t)&&"ephox-embed-iri"===t&&s(G(e)),re=(e,t)=>((e,t)=>e.width!==t.width||e.height!==t.height)(e,t)&&te(t.source,e.type),oe=e=>{const t=(e=>{const t=e.selection.getNode(),r=q(t)?e.serializer.serialize(t,{selection:!0}):"",o=z(r,e.schema),a=(()=>{if(te(o.source,o.type)){const r=e.dom.getRect(t);return{width:r.w.toString().replace(/px$/,""),height:r.h.toString().replace(/px$/,"")}}return{}})();return{embed:r,...o,...a}})(e),r=(e=>{let t=e;return{get:()=>t,set:e=>{t=e}}})(t),o=X(t),a=j(e)?[{type:"sizeinput",name:"dimensions",label:"Constrain proportions",constrain:!0}]:[],s={title:"General",name:"general",items:m([[{name:"source",type:"urlinput",filetype:"media",label:"Source",picker_text:"Browse files"}],a])},i=[];_(e)&&i.push({name:"altsource",type:"urlinput",filetype:"media",label:"Alternative source URL"}),k(e)&&i.push({name:"poster",type:"urlinput",filetype:"image",label:"Media poster (Image URL)"});const n={title:"Advanced",name:"advanced",items:i},l=[s,{title:"Embed",items:[{type:"textarea",name:"embed",label:"Paste your embed code below:"}]}];i.length>0&&l.push(n);const c={type:"tabpanel",tabs:l},u=e.windowManager.open({title:"Insert/Edit Media",size:"normal",body:c,buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],onSubmit:t=>{const o=V(t.getData());((e,t,r)=>{var o,a;t.embed=re(e,t)&&j(r)?W(r,{...t,embed:""}):L(null!==(o=t.embed)&&void 0!==o?o:"",t,!1,r.schema),t.embed&&(e.source===t.source||(a=t.source,p(H,a)))?ee(r,t.embed):K(r,t).then((e=>{ee(r,e.html)})).catch(Y(r))})(r.get(),o,e),t.close()},onChange:(t,o)=>{switch(o.name){case"source":((t,r)=>{const o=V(r.getData(),"source");t.source!==o.source&&(Z(u,e)({url:o.source,html:""}),K(e,o).then(Z(u,e)).catch(Y(e)))})(r.get(),t);break;case"embed":(t=>{var r;const o=V(t.getData()),a=z(null!==(r=o.embed)&&void 0!==r?r:"",e.schema);t.setData(X(a))})(t);break;case"dimensions":case"altsource":case"poster":((t,r,o)=>{const a=V(t.getData(),r),s=re(o,a)&&j(e)?{...a,embed:""}:a,i=W(e,s);t.setData(X({...s,embed:i}))})(t,o.name,r.get())}r.set(V(t.getData()))},initialData:o})};var ae=tinymce.util.Tools.resolve("tinymce.Env");const se=e=>{const t=e.name;return"iframe"===t||"video"===t||"audio"===t},ie=(e,t,r,o=null)=>{const a=e.attr(r);return s(a)?a:p(t,r)?null:o},ne=(e,t,r)=>{const o="img"===t.name||"video"===e.name,a=o?"300":null,s="audio"===e.name?"30":"150",i=o?s:null;t.attr({width:ie(e,r,"width",a),height:ie(e,r,"height",i)})},le=(e,t)=>{const r=t.name,o=new F("img",1);return me(e,t,o),ne(t,o,{}),o.attr({style:t.attr("style"),src:ae.transparentSrc,"data-mce-object":r,class:"mce-object mce-object-"+r}),o},ce=(e,t)=>{var r;const o=t.name,a=new F("span",1);a.attr({contentEditable:"false",style:t.attr("style"),"data-mce-object":o,class:"mce-preview-object mce-object-"+o}),me(e,t,a);const i=e.dom.parseStyle(null!==(r=t.attr("style"))&&void 0!==r?r:""),n=new F(o,1);if(ne(t,n,i),n.attr({src:t.attr("src"),style:t.attr("style"),class:t.attr("class")}),"iframe"===o)n.attr({allowfullscreen:t.attr("allowfullscreen"),frameborder:"0",sandbox:t.attr("sandbox"),referrerpolicy:t.attr("referrerpolicy")});else{c(["controls","crossorigin","currentTime","loop","muted","poster","preload"],(e=>{n.attr(e,t.attr(e))}));const r=a.attr("data-mce-html");s(r)&&((e,t,r,o)=>{const a=N(e.schema).parse(o,{context:t});for(;a.firstChild;)r.append(a.firstChild)})(e,o,n,unescape(r))}const l=new F("span",1);return l.attr("class","mce-shim"),a.append(n),a.append(l),a},me=(e,t,r)=>{var o;const a=null!==(o=t.attributes)&&void 0!==o?o:[];let s=a.length;for(;s--;){const t=a[s].name;let o=a[s].value;"width"===t||"height"===t||"style"===t||(n="data-mce-",(i=t).length>=9&&i.substr(0,9)===n)||("data"!==t&&"src"!==t||(o=e.convertURL(o,t)),r.attr("data-mce-p-"+t,o))}var i,n;const l=M({inner:!0},e.schema),m=new F("div",1);c(t.children(),(e=>m.append(e)));const u=l.serialize(m);u&&(r.attr("data-mce-html",escape(u)),r.empty())},ue=e=>{const t=e.attr("class");return r(t)&&/\btiny-pageembed\b/.test(t)},de=e=>{let t=e;for(;t=t.parent;)if(t.attr("data-ephox-embed-iri")||ue(t))return!0;return!1},he=(e,t,r)=>{const o=(0,e.options.get)("xss_sanitization"),a=y(e);return N(e.schema,{sanitize:o,validate:a}).parse(r,{context:t})},pe=e=>t=>{const r=()=>{t.setEnabled(e.selection.isEditable())};return e.on("NodeChange",r),r(),()=>{e.off("NodeChange",r)}};e.add("media",(e=>((e=>{const t=e.options.register;t("audio_template_callback",{processor:"function"}),t("video_template_callback",{processor:"function"}),t("iframe_template_callback",{processor:"function"}),t("media_live_embeds",{processor:"boolean",default:!0}),t("media_filter_html",{processor:"boolean",default:!0}),t("media_url_resolver",{processor:"function"}),t("media_alt_source",{processor:"boolean",default:!0}),t("media_poster",{processor:"boolean",default:!0}),t("media_dimensions",{processor:"boolean",default:!0})})(e),(e=>{e.addCommand("mceMedia",(()=>{oe(e)}))})(e),(e=>{const t=()=>e.execCommand("mceMedia");e.ui.registry.addToggleButton("media",{tooltip:"Insert/edit media",icon:"embed",onAction:t,onSetup:t=>{const r=e.selection;t.setActive(q(r.getNode()));const o=r.selectorChangedWithUnbind("img[data-mce-object],span[data-mce-object],div[data-ephox-embed-iri]",t.setActive).unbind,a=pe(e)(t);return()=>{o(),a()}}}),e.ui.registry.addMenuItem("media",{icon:"embed",text:"Media...",onAction:t,onSetup:pe(e)})})(e),(e=>{e.on("ResolveName",(e=>{let t;1===e.target.nodeType&&(t=e.target.getAttribute("data-mce-object"))&&(e.name=t)}))})(e),(e=>{e.on("PreInit",(()=>{const{schema:t,serializer:r,parser:o}=e,a=t.getBoolAttrs();c("webkitallowfullscreen mozallowfullscreen".split(" "),(e=>{a[e]={}})),((e,t)=>{const r=u(e);for(let o=0,a=r.length;o<a;o++){const a=r[o];t(e[a],a)}})({embed:["wmode"]},((e,r)=>{const o=t.getElementRule(r);o&&c(e,(e=>{o.attributes[e]={},o.attributesOrder.push(e)}))})),o.addNodeFilter("iframe,video,audio,object,embed",(e=>t=>{let r,o=t.length;for(;o--;)r=t[o],r.parent&&(r.parent.attr("data-mce-object")||(se(r)&&v(e)?de(r)||r.replace(ce(e,r)):de(r)||r.replace(le(e,r))))})(e)),r.addAttributeFilter("data-mce-object",((t,r)=>{var o;let a=t.length;for(;a--;){const s=t[a];if(!s.parent)continue;const i=s.attr(r),n=new F(i,1);if("audio"!==i){const e=s.attr("class");e&&-1!==e.indexOf("mce-preview-object")&&s.firstChild?n.attr({width:s.firstChild.attr("width"),height:s.firstChild.attr("height")}):n.attr({width:s.attr("width"),height:s.attr("height")})}n.attr({style:s.attr("style")});const l=null!==(o=s.attributes)&&void 0!==o?o:[];let m=l.length;for(;m--;){const e=l[m].name;0===e.indexOf("data-mce-p-")&&n.attr(e.substr(11),l[m].value)}const u=s.attr("data-mce-html");if(u){const t=he(e,i,unescape(u));c(t.children(),(e=>n.append(e)))}s.replace(n)}}))})),e.on("SetContent",(()=>{const t=e.dom;c(t.select("span.mce-preview-object"),(e=>{0===t.select("span.mce-shim",e).length&&t.add(e,"span",{class:"mce-shim"})}))}))})(e),(e=>{e.on("mousedown",(t=>{const r=e.dom.getParent(t.target,".mce-preview-object");r&&"2"===e.dom.getAttrib(r,"data-mce-selected")&&t.stopImmediatePropagation()})),e.on("click keyup touchend",(()=>{const t=e.selection.getNode();t&&e.dom.hasClass(t,"mce-preview-object")&&e.dom.getAttrib(t,"data-mce-selected")&&t.setAttribute("data-mce-selected","2")})),e.on("ObjectResized",(t=>{const r=t.target;if(r.getAttribute("data-mce-object")){let o=r.getAttribute("data-mce-html");o&&(o=unescape(o),r.setAttribute("data-mce-html",escape(L(o,{width:String(t.width),height:String(t.height)},!1,e.schema))))}}))})(e),(e=>({showDialog:()=>{oe(e)}}))(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&&(r=o=e,(a=String).prototype.isPrototypeOf(r)||o.constructor?.name===a.name)?"string":t;var r,o,a})(t)===e,r=t("string"),o=t("object"),a=t("array"),s=e=>!(e=>null==e)(e),i=e=>"function"==typeof e;class n{tag;value;static singletonNone=new n(!1);constructor(e,t){this.tag=e,this.value=t}static some(e){return new n(!0,e)}static none(){return n.singletonNone}fold(e,t){return this.tag?t(this.value):e()}isSome(){return this.tag}isNone(){return!this.tag}map(e){return this.tag?n.some(e(this.value)):n.none()}bind(e){return this.tag?e(this.value):n.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:n.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 s(e)?n.some(e):n.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 c=Array.prototype.push,l=(e,t)=>{for(let r=0,o=e.length;r<o;r++)t(e[r],r)},m=e=>{const t=[];for(let r=0,o=e.length;r<o;++r){if(!a(e[r]))throw new Error("Arr.flatten item "+r+" was not an array, input: "+e);c.apply(t,e[r])}return t};i(Array.from)&&Array.from;const u=Object.keys,d=Object.hasOwnProperty,h=(e,t)=>p(e,t)?n.from(e[t]):n.none(),p=(e,t)=>d.call(e,t),g=e=>t=>t.options.get(e),b=g("audio_template_callback"),w=g("video_template_callback"),f=g("iframe_template_callback"),y=g("media_live_embeds"),v=g("media_filter_html"),x=g("media_url_resolver"),_=g("media_alt_source"),k=g("media_poster"),j=g("media_dimensions");var A=tinymce.util.Tools.resolve("tinymce.util.Tools"),O=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),S=tinymce.util.Tools.resolve("tinymce.html.DomParser");const $=O.DOM,C=e=>e.replace(/px$/,""),T=e=>{const t=e.attr("style"),r=t?$.parseStyle(t):{};return{type:"ephox-embed-iri",source:e.attr("data-ephox-embed-iri"),altsource:"",poster:"",width:h(r,"max-width").map(C).getOr(""),height:h(r,"max-height").map(C).getOr("")}},z=(e,t)=>{let r={};for(let o=S({validate:!1,forced_root_block:!1},t).parse(e);o;o=o.walk())if(1===o.type){const e=o.name;if(o.attr("data-ephox-embed-iri")){r=T(o);break}r.source||"param"!==e||(r.source=o.attr("movie")),"iframe"!==e&&"object"!==e&&"embed"!==e&&"video"!==e&&"audio"!==e||(r.type||(r.type=e),r=A.extend(o.attributes.map,r)),"source"===e&&(r.source?r.altsource||(r.altsource=o.attr("src")):r.source=o.attr("src")),"img"!==e||r.poster||(r.poster=o.attr("src"))}return r.source=r.source||r.src||"",r.altsource=r.altsource||"",r.poster=r.poster||"",r},D=e=>{const t=e.toLowerCase().split(".").pop()??"";return h({mp3:"audio/mpeg",m4a:"audio/x-m4a",wav:"audio/wav",mp4:"video/mp4",webm:"video/webm",ogg:"video/ogg",swf:"application/x-shockwave-flash"},t).getOr("")};var F=tinymce.util.Tools.resolve("tinymce.html.Node"),M=tinymce.util.Tools.resolve("tinymce.html.Serializer");const N=(e,t={})=>S({forced_root_block:!1,validate:!1,allow_conditional_comments:!0,...t},e),P=O.DOM,R=e=>/^[0-9.]+$/.test(e)?e+"px":e,E=(e,t)=>{const r=t.attr("style"),o=r?P.parseStyle(r):{};s(e.width)&&(o["max-width"]=R(e.width)),s(e.height)&&(o["max-height"]=R(e.height)),t.attr("style",P.serializeStyle(o))},U=["source","altsource"],L=(e,t,r,o)=>{let a=0,s=0;const i=N(o);i.addNodeFilter("source",(e=>a=e.length));const n=i.parse(e);for(let e=n;e;e=e.walk())if(1===e.type){const o=e.name;if(e.attr("data-ephox-embed-iri")){E(t,e);break}switch(o){case"video":case"object":case"embed":case"img":case"iframe":void 0!==t.height&&void 0!==t.width&&(e.attr("width",t.width),e.attr("height",t.height))}if(r)switch(o){case"video":e.attr("poster",t.poster),e.attr("src",null);for(let r=a;r<2;r++)if(t[U[r]]){const o=new F("source",1);o.attr("src",t[U[r]]),o.attr("type",t[U[r]+"mime"]||null),e.append(o)}break;case"iframe":e.attr("src",t.source);break;case"object":const r=e.getAll("img").length>0;if(t.poster&&!r){e.attr("src",t.poster);const r=new F("img",1);r.attr("src",t.poster),r.attr("width",t.width),r.attr("height",t.height),e.append(r)}break;case"source":if(s<2&&(e.attr("src",t[U[s]]),e.attr("type",t[U[s]+"mime"]||null),!t[U[s]])){e.remove();continue}s++;break;case"img":t.poster||e.remove()}}return M({},o).serialize(n)},I=[{regex:/youtu\.be\/([\w\-_\?&=.]+)/i,type:"iframe",w:560,h:314,url:"www.youtube.com/embed/$1",allowFullscreen:!0},{regex:/youtube\.com(.+)v=([^&]+)(&([a-z0-9&=\-_]+))?/i,type:"iframe",w:560,h:314,url:"www.youtube.com/embed/$2?$4",allowFullscreen:!0},{regex:/youtube.com\/embed\/([a-z0-9\?&=\-_]+)/i,type:"iframe",w:560,h:314,url:"www.youtube.com/embed/$1",allowFullscreen:!0},{regex:/vimeo\.com\/([0-9]+)\?h=(\w+)/,type:"iframe",w:425,h:350,url:"player.vimeo.com/video/$1?h=$2&title=0&byline=0&portrait=0&color=8dc7dc",allowFullscreen:!0},{regex:/vimeo\.com\/(.*)\/([0-9]+)\?h=(\w+)/,type:"iframe",w:425,h:350,url:"player.vimeo.com/video/$2?h=$3&title=0&byline=0",allowFullscreen:!0},{regex:/vimeo\.com\/([0-9]+)/,type:"iframe",w:425,h:350,url:"player.vimeo.com/video/$1?title=0&byline=0&portrait=0&color=8dc7dc",allowFullscreen:!0},{regex:/vimeo\.com\/(.*)\/([0-9]+)/,type:"iframe",w:425,h:350,url:"player.vimeo.com/video/$2?title=0&byline=0",allowFullscreen:!0},{regex:/maps\.google\.([a-z]{2,3})\/maps\/(.+)msid=(.+)/,type:"iframe",w:425,h:350,url:'maps.google.com/maps/ms?msid=$2&output=embed"',allowFullscreen:!1},{regex:/dailymotion\.com\/video\/([^_]+)/,type:"iframe",w:480,h:270,url:"www.dailymotion.com/embed/video/$1",allowFullscreen:!0},{regex:/dai\.ly\/([^_]+)/,type:"iframe",w:480,h:270,url:"www.dailymotion.com/embed/video/$1",allowFullscreen:!0}],B=(e,t)=>{const r=(e=>{const t=e.match(/^(https?:\/\/|www\.)(.+)$/i);return t&&t.length>1?"www."===t[1]?"https://":t[1]:"https://"})(t),o=e.regex.exec(t);let a=r+e.url;if(s(o))for(let e=0;e<o.length;e++)a=a.replace("$"+e,(()=>o[e]?o[e]:""));return a.replace(/\?$/,"")},G=e=>{const t=I.filter((t=>t.regex.test(e)));return t.length>0?A.extend({},t[0],{url:B(t[0],e)}):null},W=(e,t)=>{const r=A.extend({},t);if(!r.source&&(A.extend(r,z(r.embed??"",e.schema)),!r.source))return"";r.altsource||(r.altsource=""),r.poster||(r.poster=""),r.source=e.convertURL(r.source,"source"),r.altsource=e.convertURL(r.altsource,"source"),r.sourcemime=D(r.source),r.altsourcemime=D(r.altsource),r.poster=e.convertURL(r.poster,"poster");const o=G(r.source);if(o&&(r.source=o.url,r.type=o.type,r.allowfullscreen=o.allowFullscreen,r.width=r.width||String(o.w),r.height=r.height||String(o.h)),r.embed)return L(r.embed,r,!0,e.schema);{const t=b(e),o=w(e),a=f(e);return r.width=r.width||"300",r.height=r.height||"150",A.each(r,((t,o)=>{r[o]=e.dom.encode(""+t)})),"iframe"===r.type?((e,t)=>{if(t)return t(e);{const t=e.allowfullscreen?' allowFullscreen="1"':"";return'<iframe src="'+e.source+'" width="'+e.width+'" height="'+e.height+'"'+t+"></iframe>"}})(r,a):"application/x-shockwave-flash"===r.sourcemime?(e=>{let t='<object data="'+e.source+'" width="'+e.width+'" height="'+e.height+'" type="application/x-shockwave-flash">';return e.poster&&(t+='<img src="'+e.poster+'" width="'+e.width+'" height="'+e.height+'" />'),t+="</object>",t})(r):-1!==r.sourcemime.indexOf("audio")?((e,t)=>t?t(e):'<audio controls="controls" src="'+e.source+'">'+(e.altsource?'\n<source src="'+e.altsource+'"'+(e.altsourcemime?' type="'+e.altsourcemime+'"':"")+" />\n":"")+"</audio>")(r,t):((e,t)=>t?t(e):'<video width="'+e.width+'" height="'+e.height+'"'+(e.poster?' poster="'+e.poster+'"':"")+' controls="controls">\n<source src="'+e.source+'"'+(e.sourcemime?' type="'+e.sourcemime+'"':"")+" />\n"+(e.altsource?'<source src="'+e.altsource+'"'+(e.altsourcemime?' type="'+e.altsourcemime+'"':"")+" />\n":"")+"</video>")(r,o)}},q=e=>e.hasAttribute("data-mce-object")||e.hasAttribute("data-ephox-embed-iri"),H={},J=e=>t=>W(e,t),K=(e,t)=>{const r=x(e);return r?((e,t,r)=>new Promise(((o,a)=>{const s=r=>(r.html&&(H[e.source]=r),o({url:e.source,html:r.html?r.html:t(e)}));H[e.source]?s(H[e.source]):r({url:e.source}).then(s).catch(a)})))(t,J(e),r):((e,t)=>Promise.resolve({html:t(e),url:e.source}))(t,J(e))},Q=(e,t)=>{const r={};return h(e,"dimensions").each((e=>{l(["width","height"],(o=>{h(t,o).orThunk((()=>h(e,o))).each((e=>r[o]=e))}))})),r},V=(e,t)=>{const r=t&&"dimensions"!==t?((e,t)=>h(t,e).bind((e=>h(e,"meta"))))(t,e).getOr({}):{},a=((e,t,r)=>a=>{const s=()=>h(e,a),i=()=>h(t,a),c=e=>h(e,"value").bind((e=>e.length>0?n.some(e):n.none()));return{[a]:(a===r?s().bind((e=>o(e)?c(e).orThunk(i):i().orThunk((()=>n.from(e))))):i().orThunk((()=>s().bind((e=>o(e)?c(e):n.from(e)))))).getOr("")}})(e,r,t);return{...a("source"),...a("altsource"),...a("poster"),...a("embed"),...Q(e,r)}},X=e=>{const t={...e,source:{value:h(e,"source").getOr("")},altsource:{value:h(e,"altsource").getOr("")},poster:{value:h(e,"poster").getOr("")}};return l(["width","height"],(r=>{h(e,r).each((e=>{const o=t.dimensions||{};o[r]=e,t.dimensions=o}))})),t},Y=e=>t=>{const r=t&&t.msg?"Media embed handler error: "+t.msg:"Media embed handler threw unknown error.";e.notificationManager.open({type:"error",text:r})},Z=(e,t)=>o=>{if(r(o.url)&&o.url.trim().length>0){const r=o.html,a={...z(r,t.schema),source:o.url,embed:r};e.setData(X(a))}},ee=(e,t)=>{const r=e.dom.select("*[data-mce-object]");e.insertContent(t),((e,t)=>{const r=e.dom.select("*[data-mce-object]");for(let e=0;e<t.length;e++)for(let o=r.length-1;o>=0;o--)t[e]===r[o]&&r.splice(o,1);e.selection.select(r[0])})(e,r),e.nodeChanged()},te=(e,t)=>s(t)&&"ephox-embed-iri"===t&&s(G(e)),re=(e,t)=>((e,t)=>e.width!==t.width||e.height!==t.height)(e,t)&&te(t.source,e.type),oe=e=>{const t=(e=>{const t=e.selection.getNode(),r=q(t)?e.serializer.serialize(t,{selection:!0}):"",o=z(r,e.schema),a=(()=>{if(te(o.source,o.type)){const r=e.dom.getRect(t);return{width:r.w.toString().replace(/px$/,""),height:r.h.toString().replace(/px$/,"")}}return{}})();return{embed:r,...o,...a}})(e),r=(e=>{let t=e;return{get:()=>t,set:e=>{t=e}}})(t),o=X(t),a=j(e)?[{type:"sizeinput",name:"dimensions",label:"Constrain proportions",constrain:!0}]:[],s={title:"General",name:"general",items:m([[{name:"source",type:"urlinput",filetype:"media",label:"Source",picker_text:"Browse files"}],a])},i=[];_(e)&&i.push({name:"altsource",type:"urlinput",filetype:"media",label:"Alternative source URL"}),k(e)&&i.push({name:"poster",type:"urlinput",filetype:"image",label:"Media poster (Image URL)"});const n={title:"Advanced",name:"advanced",items:i},c=[s,{title:"Embed",items:[{type:"textarea",name:"embed",label:"Paste your embed code below:"}]}];i.length>0&&c.push(n);const l={type:"tabpanel",tabs:c},u=e.windowManager.open({title:"Insert/Edit Media",size:"normal",body:l,buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],onSubmit:t=>{const o=V(t.getData());((e,t,r)=>{var o;t.embed=re(e,t)&&j(r)?W(r,{...t,embed:""}):L(t.embed??"",t,!1,r.schema),t.embed&&(e.source===t.source||(o=t.source,p(H,o)))?ee(r,t.embed):K(r,t).then((e=>{ee(r,e.html)})).catch(Y(r))})(r.get(),o,e),t.close()},onChange:(t,o)=>{switch(o.name){case"source":((t,r)=>{const o=V(r.getData(),"source");t.source!==o.source&&(Z(u,e)({url:o.source,html:""}),K(e,o).then(Z(u,e)).catch(Y(e)))})(r.get(),t);break;case"embed":(t=>{const r=V(t.getData()),o=z(r.embed??"",e.schema);t.setData(X(o))})(t);break;case"dimensions":case"altsource":case"poster":((t,r,o)=>{const a=V(t.getData(),r),s=re(o,a)&&j(e)?{...a,embed:""}:a,i=W(e,s);t.setData(X({...s,embed:i}))})(t,o.name,r.get())}r.set(V(t.getData()))},initialData:o})};var ae=tinymce.util.Tools.resolve("tinymce.Env");const se=e=>{const t=e.name;return"iframe"===t||"video"===t||"audio"===t},ie=(e,t,r,o=null)=>{const a=e.attr(r);return s(a)?a:p(t,r)?null:o},ne=(e,t,r)=>{const o="img"===t.name||"video"===e.name,a=o?"300":null,s="audio"===e.name?"30":"150",i=o?s:null;t.attr({width:ie(e,r,"width",a),height:ie(e,r,"height",i)})},ce=(e,t)=>{const r=t.name,o=new F("img",1);return me(e,t,o),ne(t,o,{}),o.attr({style:t.attr("style"),src:ae.transparentSrc,"data-mce-object":r,class:"mce-object mce-object-"+r}),o},le=(e,t)=>{const r=t.name,o=new F("span",1);o.attr({contentEditable:"false",style:t.attr("style"),"data-mce-object":r,class:"mce-preview-object mce-object-"+r}),me(e,t,o);const a=e.dom.parseStyle(t.attr("style")??""),i=new F(r,1);if(ne(t,i,a),i.attr({src:t.attr("src"),style:t.attr("style"),class:t.attr("class")}),"iframe"===r)i.attr({allowfullscreen:t.attr("allowfullscreen"),frameborder:"0",sandbox:t.attr("sandbox"),referrerpolicy:t.attr("referrerpolicy")});else{l(["controls","crossorigin","currentTime","loop","muted","poster","preload"],(e=>{i.attr(e,t.attr(e))}));const a=o.attr("data-mce-html");s(a)&&((e,t,r,o)=>{const a=N(e.schema).parse(o,{context:t});for(;a.firstChild;)r.append(a.firstChild)})(e,r,i,unescape(a))}const n=new F("span",1);return n.attr("class","mce-shim"),o.append(i),o.append(n),o},me=(e,t,r)=>{const o=t.attributes??[];let a=o.length;for(;a--;){const t=o[a].name;let n=o[a].value;"width"===t||"height"===t||"style"===t||(i="data-mce-",(s=t).length>=9&&s.substr(0,9)===i)||("data"!==t&&"src"!==t||(n=e.convertURL(n,t)),r.attr("data-mce-p-"+t,n))}var s,i;const n=M({inner:!0},e.schema),c=new F("div",1);l(t.children(),(e=>c.append(e)));const m=n.serialize(c);m&&(r.attr("data-mce-html",escape(m)),r.empty())},ue=e=>{const t=e.attr("class");return r(t)&&/\btiny-pageembed\b/.test(t)},de=e=>{let t=e;for(;t=t.parent;)if(t.attr("data-ephox-embed-iri")||ue(t))return!0;return!1},he=(e,t,r)=>{const o=(0,e.options.get)("xss_sanitization"),a=v(e);return N(e.schema,{sanitize:o,validate:a}).parse(r,{context:t})},pe=e=>t=>{const r=()=>{t.setEnabled(e.selection.isEditable())};return e.on("NodeChange",r),r(),()=>{e.off("NodeChange",r)}};e.add("media",(e=>((e=>{const t=e.options.register;t("audio_template_callback",{processor:"function"}),t("video_template_callback",{processor:"function"}),t("iframe_template_callback",{processor:"function"}),t("media_live_embeds",{processor:"boolean",default:!0}),t("media_filter_html",{processor:"boolean",default:!0}),t("media_url_resolver",{processor:"function"}),t("media_alt_source",{processor:"boolean",default:!0}),t("media_poster",{processor:"boolean",default:!0}),t("media_dimensions",{processor:"boolean",default:!0})})(e),(e=>{e.addCommand("mceMedia",(()=>{oe(e)}))})(e),(e=>{const t=()=>e.execCommand("mceMedia");e.ui.registry.addToggleButton("media",{tooltip:"Insert/edit media",icon:"embed",onAction:t,onSetup:t=>{const r=e.selection;t.setActive(q(r.getNode()));const o=r.selectorChangedWithUnbind("img[data-mce-object],span[data-mce-object],div[data-ephox-embed-iri]",t.setActive).unbind,a=pe(e)(t);return()=>{o(),a()}}}),e.ui.registry.addMenuItem("media",{icon:"embed",text:"Media...",onAction:t,onSetup:pe(e)})})(e),(e=>{e.on("ResolveName",(e=>{let t;1===e.target.nodeType&&(t=e.target.getAttribute("data-mce-object"))&&(e.name=t)}))})(e),(e=>{e.on("PreInit",(()=>{const{schema:t,serializer:r,parser:o}=e,a=t.getBoolAttrs();l("webkitallowfullscreen mozallowfullscreen".split(" "),(e=>{a[e]={}})),((e,t)=>{const r=u(e);for(let o=0,a=r.length;o<a;o++){const a=r[o];t(e[a],a)}})({embed:["wmode"]},((e,r)=>{const o=t.getElementRule(r);o&&l(e,(e=>{o.attributes[e]={},o.attributesOrder.push(e)}))})),o.addNodeFilter("iframe,video,audio,object,embed",(e=>t=>{let r,o=t.length;for(;o--;)r=t[o],r.parent&&(r.parent.attr("data-mce-object")||(se(r)&&y(e)?de(r)||r.replace(le(e,r)):de(r)||r.replace(ce(e,r))))})(e)),r.addAttributeFilter("data-mce-object",((t,r)=>{let o=t.length;for(;o--;){const a=t[o];if(!a.parent)continue;const s=a.attr(r),i=new F(s,1);if("audio"!==s){const e=a.attr("class");e&&-1!==e.indexOf("mce-preview-object")&&a.firstChild?i.attr({width:a.firstChild.attr("width"),height:a.firstChild.attr("height")}):i.attr({width:a.attr("width"),height:a.attr("height")})}i.attr({style:a.attr("style")});const n=a.attributes??[];let c=n.length;for(;c--;){const e=n[c].name;0===e.indexOf("data-mce-p-")&&i.attr(e.substr(11),n[c].value)}const m=a.attr("data-mce-html");if(m){const t=he(e,s,unescape(m));l(t.children(),(e=>i.append(e)))}a.replace(i)}}))})),e.on("SetContent",(()=>{const t=e.dom;l(t.select("span.mce-preview-object"),(e=>{0===t.select("span.mce-shim",e).length&&t.add(e,"span",{class:"mce-shim"})}))}))})(e),(e=>{e.on("mousedown",(t=>{const r=e.dom.getParent(t.target,".mce-preview-object");r&&"2"===e.dom.getAttrib(r,"data-mce-selected")&&t.stopImmediatePropagation()})),e.on("click keyup touchend",(()=>{const t=e.selection.getNode();t&&e.dom.hasClass(t,"mce-preview-object")&&e.dom.getAttrib(t,"data-mce-selected")&&t.setAttribute("data-mce-selected","2")})),e.on("ObjectResized",(t=>{const r=t.target;if(r.getAttribute("data-mce-object")){let o=r.getAttribute("data-mce-html");o&&(o=unescape(o),r.setAttribute("data-mce-html",escape(L(o,{width:String(t.width),height:String(t.height)},!1,e.schema))))}}))})(e),(e=>({showDialog:()=>{oe(e)}}))(e))))}();
|
|
@@ -1,23 +1,28 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* TinyMCE version
|
|
2
|
+
* TinyMCE version 8.3.1 (2025-12-17)
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
5
|
(function () {
|
|
6
6
|
'use strict';
|
|
7
7
|
|
|
8
|
-
var global$
|
|
8
|
+
var global$2 = tinymce.util.Tools.resolve('tinymce.PluginManager');
|
|
9
9
|
|
|
10
10
|
/* eslint-disable @typescript-eslint/no-wrapper-object-types */
|
|
11
|
+
const isSimpleType = (type) => (value) => typeof value === type;
|
|
11
12
|
const eq = (t) => (a) => t === a;
|
|
12
13
|
const isUndefined = eq(undefined);
|
|
13
14
|
const isNullable = (a) => a === null || a === undefined;
|
|
14
15
|
const isNonNullable = (a) => !isNullable(a);
|
|
16
|
+
const isFunction = isSimpleType('function');
|
|
15
17
|
|
|
16
18
|
const constant = (value) => {
|
|
17
19
|
return () => {
|
|
18
20
|
return value;
|
|
19
21
|
};
|
|
20
22
|
};
|
|
23
|
+
const identity = (x) => {
|
|
24
|
+
return x;
|
|
25
|
+
};
|
|
21
26
|
const never = constant(false);
|
|
22
27
|
|
|
23
28
|
/**
|
|
@@ -36,6 +41,11 @@
|
|
|
36
41
|
* strict-null-checks
|
|
37
42
|
*/
|
|
38
43
|
class Optional {
|
|
44
|
+
tag;
|
|
45
|
+
value;
|
|
46
|
+
// Sneaky optimisation: every instance of Optional.none is identical, so just
|
|
47
|
+
// reuse the same object
|
|
48
|
+
static singletonNone = new Optional(false);
|
|
39
49
|
// The internal representation has a `tag` and a `value`, but both are
|
|
40
50
|
// private: able to be console.logged, but not able to be accessed by code
|
|
41
51
|
constructor(tag, value) {
|
|
@@ -203,7 +213,7 @@
|
|
|
203
213
|
*/
|
|
204
214
|
getOrDie(message) {
|
|
205
215
|
if (!this.tag) {
|
|
206
|
-
throw new Error(message
|
|
216
|
+
throw new Error(message ?? 'Called getOrDie on None');
|
|
207
217
|
}
|
|
208
218
|
else {
|
|
209
219
|
return this.value;
|
|
@@ -267,10 +277,31 @@
|
|
|
267
277
|
return this.tag ? `some(${this.value})` : 'none()';
|
|
268
278
|
}
|
|
269
279
|
}
|
|
270
|
-
// Sneaky optimisation: every instance of Optional.none is identical, so just
|
|
271
|
-
// reuse the same object
|
|
272
|
-
Optional.singletonNone = new Optional(false);
|
|
273
280
|
|
|
281
|
+
const nativeSlice = Array.prototype.slice;
|
|
282
|
+
const nativeIndexOf = Array.prototype.indexOf;
|
|
283
|
+
const rawIndexOf = (ts, t) => nativeIndexOf.call(ts, t);
|
|
284
|
+
const contains$1 = (xs, x) => rawIndexOf(xs, x) > -1;
|
|
285
|
+
const exists = (xs, pred) => {
|
|
286
|
+
for (let i = 0, len = xs.length; i < len; i++) {
|
|
287
|
+
const x = xs[i];
|
|
288
|
+
if (pred(x, i)) {
|
|
289
|
+
return true;
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
return false;
|
|
293
|
+
};
|
|
294
|
+
const map = (xs, f) => {
|
|
295
|
+
// pre-allocating array size when it's guaranteed to be known
|
|
296
|
+
// http://jsperf.com/push-allocated-vs-dynamic/22
|
|
297
|
+
const len = xs.length;
|
|
298
|
+
const r = new Array(len);
|
|
299
|
+
for (let i = 0; i < len; i++) {
|
|
300
|
+
const x = xs[i];
|
|
301
|
+
r[i] = f(x, i);
|
|
302
|
+
}
|
|
303
|
+
return r;
|
|
304
|
+
};
|
|
274
305
|
const findUntil = (xs, pred, until) => {
|
|
275
306
|
for (let i = 0, len = xs.length; i < len; i++) {
|
|
276
307
|
const x = xs[i];
|
|
@@ -286,6 +317,7 @@
|
|
|
286
317
|
const find$1 = (xs, pred) => {
|
|
287
318
|
return findUntil(xs, pred, never);
|
|
288
319
|
};
|
|
320
|
+
isFunction(Array.from) ? Array.from : (x) => nativeSlice.call(x);
|
|
289
321
|
const findMap = (arr, f) => {
|
|
290
322
|
for (let i = 0; i < arr.length; i++) {
|
|
291
323
|
const r = f(arr[i], i);
|
|
@@ -295,6 +327,43 @@
|
|
|
295
327
|
}
|
|
296
328
|
return Optional.none();
|
|
297
329
|
};
|
|
330
|
+
const unique = (xs, comparator) => {
|
|
331
|
+
const r = [];
|
|
332
|
+
const isDuplicated = isFunction(comparator) ?
|
|
333
|
+
(x) => exists(r, (i) => comparator(i, x)) :
|
|
334
|
+
(x) => contains$1(r, x);
|
|
335
|
+
for (let i = 0, len = xs.length; i < len; i++) {
|
|
336
|
+
const x = xs[i];
|
|
337
|
+
if (!isDuplicated(x)) {
|
|
338
|
+
r.push(x);
|
|
339
|
+
}
|
|
340
|
+
}
|
|
341
|
+
return r;
|
|
342
|
+
};
|
|
343
|
+
|
|
344
|
+
// There are many variations of Object iteration that are faster than the 'for-in' style:
|
|
345
|
+
// http://jsperf.com/object-keys-iteration/107
|
|
346
|
+
//
|
|
347
|
+
// Use the native keys if it is available (IE9+), otherwise fall back to manually filtering
|
|
348
|
+
const keys = Object.keys;
|
|
349
|
+
const each = (obj, f) => {
|
|
350
|
+
const props = keys(obj);
|
|
351
|
+
for (let k = 0, len = props.length; k < len; k++) {
|
|
352
|
+
const i = props[k];
|
|
353
|
+
const x = obj[i];
|
|
354
|
+
f(x, i);
|
|
355
|
+
}
|
|
356
|
+
};
|
|
357
|
+
const mapToArray = (obj, f) => {
|
|
358
|
+
const r = [];
|
|
359
|
+
each(obj, (value, name) => {
|
|
360
|
+
r.push(f(value, name));
|
|
361
|
+
});
|
|
362
|
+
return r;
|
|
363
|
+
};
|
|
364
|
+
const values = (obj) => {
|
|
365
|
+
return mapToArray(obj, identity);
|
|
366
|
+
};
|
|
298
367
|
|
|
299
368
|
const contains = (str, substr, start = 0, end) => {
|
|
300
369
|
const idx = str.indexOf(substr, start);
|
|
@@ -381,7 +450,7 @@
|
|
|
381
450
|
const detectBrowser$1 = (browsers, userAgentData) => {
|
|
382
451
|
return findMap(userAgentData.brands, (uaBrand) => {
|
|
383
452
|
const lcBrand = uaBrand.brand.toLowerCase();
|
|
384
|
-
return find$1(browsers, (browser) =>
|
|
453
|
+
return find$1(browsers, (browser) => lcBrand === browser.brand?.toLowerCase())
|
|
385
454
|
.map((info) => ({
|
|
386
455
|
current: info.name,
|
|
387
456
|
version: Version.nu(parseInt(uaBrand.version, 10), 0)
|
|
@@ -655,6 +724,8 @@
|
|
|
655
724
|
return `<script>(${fn.toString()})(${isMacOSOrIOS})</script>`;
|
|
656
725
|
};
|
|
657
726
|
|
|
727
|
+
var global$1 = tinymce.util.Tools.resolve('tinymce.dom.ScriptLoader');
|
|
728
|
+
|
|
658
729
|
var global = tinymce.util.Tools.resolve('tinymce.util.Tools');
|
|
659
730
|
|
|
660
731
|
const option = (name) => (editor) => editor.options.get(name);
|
|
@@ -663,11 +734,17 @@
|
|
|
663
734
|
const getBodyClass = option('body_class');
|
|
664
735
|
const getBodyId = option('body_id');
|
|
665
736
|
|
|
737
|
+
const getComponentScriptsHtml = (editor) => {
|
|
738
|
+
const urls = unique(values(editor.schema.getComponentUrls()));
|
|
739
|
+
return map(urls, (url) => {
|
|
740
|
+
const attrs = mapToArray(global$1.ScriptLoader.getScriptAttributes(url), (v, k) => ` ${editor.dom.encode(k)}="${editor.dom.encode(v)}"`);
|
|
741
|
+
return `<script src="${editor.dom.encode(url)}"${attrs.join('')}></script>`;
|
|
742
|
+
}).join('');
|
|
743
|
+
};
|
|
666
744
|
const getPreviewHtml = (editor) => {
|
|
667
|
-
var _a;
|
|
668
745
|
let headHtml = '';
|
|
669
746
|
const encode = editor.dom.encode;
|
|
670
|
-
const contentStyle =
|
|
747
|
+
const contentStyle = getContentStyle(editor) ?? '';
|
|
671
748
|
headHtml += `<base href="${encode(editor.documentBaseURI.getURI())}">`;
|
|
672
749
|
const cors = shouldUseContentCssCors(editor) ? ' crossorigin="anonymous"' : '';
|
|
673
750
|
global.each(editor.contentCSS, (url) => {
|
|
@@ -676,6 +753,7 @@
|
|
|
676
753
|
if (contentStyle) {
|
|
677
754
|
headHtml += '<style type="text/css">' + contentStyle + '</style>';
|
|
678
755
|
}
|
|
756
|
+
headHtml += getComponentScriptsHtml(editor);
|
|
679
757
|
const bodyId = getBodyId(editor);
|
|
680
758
|
const bodyClass = getBodyClass(editor);
|
|
681
759
|
const directionality = editor.getBody().dir;
|
|
@@ -749,7 +827,7 @@
|
|
|
749
827
|
};
|
|
750
828
|
|
|
751
829
|
var Plugin = () => {
|
|
752
|
-
global$
|
|
830
|
+
global$2.add('preview', (editor) => {
|
|
753
831
|
register$1(editor);
|
|
754
832
|
register(editor);
|
|
755
833
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager");const t=e=>undefined===e;const r=e=>()=>e,n
|
|
1
|
+
!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager");const t=e=>undefined===e;const r=e=>"function"==typeof e;const n=e=>()=>e,s=e=>e,o=n(!1);class i{tag;value;static singletonNone=new i(!1);constructor(e,t){this.tag=e,this.value=t}static some(e){return new i(!0,e)}static none(){return i.singletonNone}fold(e,t){return this.tag?t(this.value):e()}isSome(){return this.tag}isNone(){return!this.tag}map(e){return this.tag?i.some(e(this.value)):i.none()}bind(e){return this.tag?e(this.value):i.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:i.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 null==e?i.none():i.some(e)}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 a=Array.prototype.indexOf,c=(e,t)=>((e,t,r)=>{for(let n=0,s=e.length;n<s;n++){const s=e[n];if(t(s,n))return i.some(s);if(r(s,n))break}return i.none()})(e,t,o);r(Array.from)&&Array.from;const u=Object.keys,l=(e,t)=>{const r=[];return((e,t)=>{const r=u(e);for(let n=0,s=r.length;n<s;n++){const s=r[n];t(e[s],s)}})(e,((e,n)=>{r.push(t(e,n))})),r},d=(e,r,n=0,s)=>{const o=e.indexOf(r,n);return-1!==o&&(!!t(s)||o+r.length<=s)},m=()=>h(0,0),h=(e,t)=>({major:e,minor:t}),g={nu:h,detect:(e,t)=>{const r=String(t).toLowerCase();return 0===e.length?m():((e,t)=>{const r=((e,t)=>{for(let r=0;r<e.length;r++){const n=e[r];if(n.test(t))return n}})(e,t);if(!r)return{major:0,minor:0};const n=e=>Number(t.replace(r,"$"+e));return h(n(1),n(2))})(e,r)},unknown:m},v=(e,t)=>{const r=String(t).toLowerCase();return c(e,(e=>e.search(r)))},p=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,f=e=>t=>d(t,e),w=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:e=>d(e,"edge/")&&d(e,"chrome")&&d(e,"safari")&&d(e,"applewebkit")},{name:"Chromium",brand:"Chromium",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,p],search:e=>d(e,"chrome")&&!d(e,"chromeframe")},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:e=>d(e,"msie")||d(e,"trident")},{name:"Opera",versionRegexes:[p,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:f("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:f("firefox")},{name:"Safari",versionRegexes:[p,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:e=>(d(e,"safari")||d(e,"mobile/"))&&d(e,"applewebkit")}],y=[{name:"Windows",search:f("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:e=>d(e,"iphone")||d(e,"ipad"),versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:f("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"macOS",search:f("mac os x"),versionRegexes:[/.*?mac\ os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:f("linux"),versionRegexes:[]},{name:"Solaris",search:f("sunos"),versionRegexes:[]},{name:"FreeBSD",search:f("freebsd"),versionRegexes:[]},{name:"ChromeOS",search:f("cros"),versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/]}],x={browsers:n(w),oses:n(y)},S="Edge",b="Chromium",O="Opera",A="Firefox",C="Safari",R=e=>{const t=e.current,r=e.version,n=e=>()=>t===e;return{current:t,version:r,isEdge:n(S),isChromium:n(b),isIE:n("IE"),isOpera:n(O),isFirefox:n(A),isSafari:n(C)}},k=()=>R({current:void 0,version:g.unknown()}),D=R,E=(n(S),n(b),n("IE"),n(O),n(A),n(C),"Windows"),I="Android",T="Linux",L="macOS",P="Solaris",$="FreeBSD",_="ChromeOS",B=e=>{const t=e.current,r=e.version,n=e=>()=>t===e;return{current:t,version:r,isWindows:n(E),isiOS:n("iOS"),isAndroid:n(I),isMacOS:n(L),isLinux:n(T),isSolaris:n(P),isFreeBSD:n($),isChromeOS:n(_)}},N=()=>B({current:void 0,version:g.unknown()}),F=B,M=(n(E),n("iOS"),n(I),n(T),n(L),n(P),n($),n(_),(e,t,r)=>{const s=x.browsers(),o=x.oses(),a=t.bind((e=>((e,t)=>((e,t)=>{for(let r=0;r<e.length;r++){const n=t(e[r]);if(n.isSome())return n}return i.none()})(t.brands,(t=>{const r=t.brand.toLowerCase();return c(e,(e=>r===e.brand?.toLowerCase())).map((e=>({current:e.name,version:g.nu(parseInt(t.version,10),0)})))})))(s,e))).orThunk((()=>((e,t)=>v(e,t).map((e=>{const r=g.detect(e.versionRegexes,t);return{current:e.name,version:r}})))(s,e))).fold(k,D),u=((e,t)=>v(e,t).map((e=>{const r=g.detect(e.versionRegexes,t);return{current:e.name,version:r}})))(o,e).fold(N,F),l=((e,t,r,s)=>{const o=e.isiOS()&&!0===/ipad/i.test(r),i=e.isiOS()&&!o,a=e.isiOS()||e.isAndroid(),c=a||s("(pointer:coarse)"),u=o||!i&&a&&s("(min-device-width:768px)"),l=i||a&&!u,d=t.isSafari()&&e.isiOS()&&!1===/safari/i.test(r),m=!l&&!u&&!d;return{isiPad:n(o),isiPhone:n(i),isTablet:n(u),isPhone:n(l),isTouch:n(c),isAndroid:e.isAndroid,isiOS:e.isiOS,isWebView:n(d),isDesktop:n(m)}})(u,a,e,r);return{browser:a,os:u,deviceType:l}}),j=e=>window.matchMedia(e).matches;let U=(e=>{let t,r=!1;return(...n)=>(r||(r=!0,t=e.apply(null,n)),t)})((()=>M(window.navigator.userAgent,i.from(window.navigator.userAgentData),j)));const W=()=>U();var K=tinymce.util.Tools.resolve("tinymce.dom.ScriptLoader"),V=tinymce.util.Tools.resolve("tinymce.util.Tools");const z=e=>t=>t.options.get(e),Y=z("content_style"),q=z("content_css_cors"),G=z("body_class"),H=z("body_id"),J=e=>{var t;return((e,t)=>{const r=e.length,n=new Array(r);for(let s=0;s<r;s++){const r=e[s];n[s]=t(r)}return n})(((e,t)=>{const n=[],s=r(t)?e=>((e,t)=>{for(let r=0,n=e.length;r<n;r++)if(t(e[r]))return!0;return!1})(n,(r=>t(r,e))):e=>((e,t)=>((e,t)=>a.call(e,t))(e,t)>-1)(n,e);for(let t=0,r=e.length;t<r;t++){const r=e[t];s(r)||n.push(r)}return n})((t=e.schema.getComponentUrls(),l(t,s))),(t=>{const r=l(K.ScriptLoader.getScriptAttributes(t),((t,r)=>` ${e.dom.encode(r)}="${e.dom.encode(t)}"`));return`<script src="${e.dom.encode(t)}"${r.join("")}><\/script>`})).join("")},Q=e=>{const t=(e=>{let t="";const r=e.dom.encode,n=Y(e)??"";t+=`<base href="${r(e.documentBaseURI.getURI())}">`;const s=q(e)?' crossorigin="anonymous"':"";V.each(e.contentCSS,(n=>{t+='<link type="text/css" rel="stylesheet" href="'+r(e.documentBaseURI.toAbsolute(n))+'"'+s+">"})),n&&(t+='<style type="text/css">'+n+"</style>"),t+=J(e);const o=H(e),i=G(e),a=e.getBody().dir,c=a?' dir="'+r(a)+'"':"";return"<!DOCTYPE html><html><head>"+t+'</head><body id="'+r(o)+'" class="mce-content-body '+r(i)+'"'+c+">"+e.getContent()+(()=>{const e=W().os.isMacOS()||W().os.isiOS();return`<script>(${(e=>{document.addEventListener("click",(t=>{for(let r=t.target;r;r=r.parentNode)if("A"===r.nodeName){const n=r.getAttribute("href");if(n&&n.startsWith("#")){t.preventDefault();const e=document.getElementById(n.substring(1));return void(e&&e.scrollIntoView({behavior:"smooth"}))}(e?t.metaKey:t.ctrlKey&&!t.altKey)||t.preventDefault()}}),!1)}).toString()})(${e})<\/script>`})()+"</body></html>"})(e);e.windowManager.open({title:"Preview",size:"large",body:{type:"panel",items:[{name:"preview",type:"iframe",sandboxed:!0,transparent:!1}]},buttons:[{type:"cancel",name:"close",text:"Close",primary:!0}],initialData:{preview:t}}).focus("close")};e.add("preview",(e=>{(e=>{e.addCommand("mcePreview",(()=>{Q(e)}))})(e),(e=>{const t=()=>e.execCommand("mcePreview");e.ui.registry.addButton("preview",{icon:"preview",tooltip:"Preview",onAction:t,context:"any"}),e.ui.registry.addMenuItem("preview",{icon:"preview",text:"Preview",onAction:t,context:"any"})})(e)}))}();
|