create-nextjs-cms 0.5.56 → 0.5.58
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 +4 -4
- package/templates/default/CHANGELOG.md +140 -140
- package/templates/default/_gitignore +1 -0
- package/templates/default/app/(rootLayout)/admins/page.tsx +7 -2
- package/templates/default/app/(rootLayout)/advanced/page.tsx +8 -2
- package/templates/default/app/(rootLayout)/browse/[section]/[page]/page.tsx +17 -3
- package/templates/default/app/(rootLayout)/categorized/[section]/page.tsx +9 -1
- package/templates/default/app/(rootLayout)/dashboard-new/page.tsx +7 -0
- package/templates/default/app/(rootLayout)/edit/[section]/[itemId]/page.tsx +11 -1
- package/templates/default/app/(rootLayout)/layout.tsx +8 -1
- package/templates/default/app/(rootLayout)/new/[section]/page.tsx +9 -1
- package/templates/default/app/(rootLayout)/section/[section]/page.tsx +10 -1
- package/templates/default/app/(rootLayout)/settings/page.tsx +7 -1
- package/templates/default/app/api/trpc/[trpc]/route.ts +1 -1
- package/templates/default/app/api/video/route.ts +1 -1
- package/templates/default/app/layout.tsx +1 -1
- package/templates/default/app/providers.tsx +4 -4
- package/templates/default/apps/cms/node_modules/next/node_modules/_tmp_40516_de1b9f7e36eccb968b79dbd2b8c388ea/LICENSE +191 -0
- package/templates/default/apps/cms/node_modules/next/node_modules/_tmp_40516_de1b9f7e36eccb968b79dbd2b8c388ea/README.md +118 -0
- package/templates/default/apps/cms/node_modules/next/node_modules/_tmp_40516_de1b9f7e36eccb968b79dbd2b8c388ea/install/build.js +38 -0
- package/templates/default/apps/cms/node_modules/next/node_modules/_tmp_40516_de1b9f7e36eccb968b79dbd2b8c388ea/install/check.js +14 -0
- package/templates/default/apps/cms/node_modules/next/node_modules/_tmp_40516_de1b9f7e36eccb968b79dbd2b8c388ea/lib/channel.js +177 -0
- package/templates/default/apps/cms/node_modules/next/node_modules/_tmp_40516_de1b9f7e36eccb968b79dbd2b8c388ea/lib/colour.js +195 -0
- package/templates/default/apps/cms/node_modules/next/node_modules/_tmp_40516_de1b9f7e36eccb968b79dbd2b8c388ea/lib/composite.js +212 -0
- package/templates/default/apps/cms/node_modules/next/node_modules/_tmp_40516_de1b9f7e36eccb968b79dbd2b8c388ea/lib/constructor.js +499 -0
- package/templates/default/apps/cms/node_modules/next/node_modules/_tmp_40516_de1b9f7e36eccb968b79dbd2b8c388ea/lib/index.d.ts +1971 -0
- package/templates/default/apps/cms/node_modules/next/node_modules/_tmp_40516_de1b9f7e36eccb968b79dbd2b8c388ea/lib/index.js +16 -0
- package/templates/default/apps/cms/node_modules/next/node_modules/_tmp_40516_de1b9f7e36eccb968b79dbd2b8c388ea/lib/input.js +809 -0
- package/templates/default/apps/cms/node_modules/next/node_modules/_tmp_40516_de1b9f7e36eccb968b79dbd2b8c388ea/lib/is.js +143 -0
- package/templates/default/apps/cms/node_modules/next/node_modules/_tmp_40516_de1b9f7e36eccb968b79dbd2b8c388ea/lib/libvips.js +207 -0
- package/templates/default/apps/cms/node_modules/next/node_modules/_tmp_40516_de1b9f7e36eccb968b79dbd2b8c388ea/lib/operation.js +1016 -0
- package/templates/default/apps/cms/node_modules/next/node_modules/_tmp_40516_de1b9f7e36eccb968b79dbd2b8c388ea/lib/output.js +1666 -0
- package/templates/default/apps/cms/node_modules/next/node_modules/_tmp_40516_de1b9f7e36eccb968b79dbd2b8c388ea/lib/resize.js +595 -0
- package/templates/default/apps/cms/node_modules/next/node_modules/_tmp_40516_de1b9f7e36eccb968b79dbd2b8c388ea/lib/sharp.js +121 -0
- package/templates/default/apps/cms/node_modules/next/node_modules/_tmp_40516_de1b9f7e36eccb968b79dbd2b8c388ea/lib/utility.js +291 -0
- package/templates/default/apps/cms/node_modules/next/node_modules/_tmp_40516_de1b9f7e36eccb968b79dbd2b8c388ea/package.json +202 -0
- package/templates/default/apps/cms/node_modules/next/node_modules/_tmp_40516_de1b9f7e36eccb968b79dbd2b8c388ea/src/binding.gyp +298 -0
- package/templates/default/apps/cms/node_modules/next/node_modules/_tmp_40516_de1b9f7e36eccb968b79dbd2b8c388ea/src/common.cc +1130 -0
- package/templates/default/apps/cms/node_modules/next/node_modules/_tmp_40516_de1b9f7e36eccb968b79dbd2b8c388ea/src/common.h +402 -0
- package/templates/default/apps/cms/node_modules/next/node_modules/_tmp_40516_de1b9f7e36eccb968b79dbd2b8c388ea/src/metadata.cc +346 -0
- package/templates/default/apps/cms/node_modules/next/node_modules/_tmp_40516_de1b9f7e36eccb968b79dbd2b8c388ea/src/metadata.h +90 -0
- package/templates/default/apps/cms/node_modules/next/node_modules/_tmp_40516_de1b9f7e36eccb968b79dbd2b8c388ea/src/operations.cc +499 -0
- package/templates/default/apps/cms/node_modules/next/node_modules/_tmp_40516_de1b9f7e36eccb968b79dbd2b8c388ea/src/operations.h +137 -0
- package/templates/default/apps/cms/node_modules/next/node_modules/_tmp_40516_de1b9f7e36eccb968b79dbd2b8c388ea/src/pipeline.cc +1814 -0
- package/templates/default/apps/cms/node_modules/next/node_modules/_tmp_40516_de1b9f7e36eccb968b79dbd2b8c388ea/src/pipeline.h +408 -0
- package/templates/default/apps/cms/node_modules/next/node_modules/_tmp_40516_de1b9f7e36eccb968b79dbd2b8c388ea/src/sharp.cc +43 -0
- package/templates/default/apps/cms/node_modules/next/node_modules/_tmp_40516_de1b9f7e36eccb968b79dbd2b8c388ea/src/stats.cc +186 -0
- package/templates/default/apps/cms/node_modules/next/node_modules/_tmp_40516_de1b9f7e36eccb968b79dbd2b8c388ea/src/stats.h +62 -0
- package/templates/default/apps/cms/node_modules/next/node_modules/_tmp_40516_de1b9f7e36eccb968b79dbd2b8c388ea/src/utilities.cc +288 -0
- package/templates/default/apps/cms/node_modules/next/node_modules/_tmp_40516_de1b9f7e36eccb968b79dbd2b8c388ea/src/utilities.h +22 -0
- package/templates/default/components/BrowsePage.tsx +4 -4
- package/templates/default/components/DashboardNewPage.tsx +252 -0
- package/templates/default/components/LogPage.tsx +2 -3
- package/templates/default/components/SettingsPage.tsx +1 -1
- package/templates/default/components/form/Form.tsx +5 -5
- package/templates/default/components/form/helpers/util.ts +5 -5
- package/templates/default/dynamic-schemas/schema.ts +381 -381
- package/templates/default/next-env.d.ts +1 -1
- package/templates/default/next.config.ts +24 -0
- package/templates/default/package.json +23 -17
- package/templates/default/{middleware.ts → proxy.ts} +3 -4
- package/templates/default/test/prize.section.ts +58 -0
- package/templates/default/tsconfig.json +6 -3
- package/templates/default/app/api/placeholder/route.ts +0 -7
- package/templates/default/components/form/helpers/_section-hot-reload.js +0 -11
- package/templates/default/public/tinymce/CHANGELOG.md +0 -3940
- package/templates/default/public/tinymce/README.md +0 -77
- package/templates/default/public/tinymce/bower.json +0 -27
- package/templates/default/public/tinymce/composer.json +0 -52
- package/templates/default/public/tinymce/icons/default/icons.js +0 -239
- package/templates/default/public/tinymce/icons/default/icons.min.js +0 -1
- package/templates/default/public/tinymce/icons/default/index.js +0 -7
- package/templates/default/public/tinymce/license.md +0 -9
- package/templates/default/public/tinymce/models/dom/index.js +0 -7
- package/templates/default/public/tinymce/models/dom/model.js +0 -8980
- package/templates/default/public/tinymce/models/dom/model.min.js +0 -1
- package/templates/default/public/tinymce/notices.txt +0 -21
- package/templates/default/public/tinymce/package.json +0 -32
- package/templates/default/public/tinymce/plugins/accordion/index.js +0 -7
- package/templates/default/public/tinymce/plugins/accordion/plugin.js +0 -1373
- package/templates/default/public/tinymce/plugins/accordion/plugin.min.js +0 -1
- package/templates/default/public/tinymce/plugins/advlist/index.js +0 -7
- package/templates/default/public/tinymce/plugins/advlist/plugin.js +0 -473
- package/templates/default/public/tinymce/plugins/advlist/plugin.min.js +0 -1
- package/templates/default/public/tinymce/plugins/anchor/index.js +0 -7
- package/templates/default/public/tinymce/plugins/anchor/plugin.js +0 -237
- package/templates/default/public/tinymce/plugins/anchor/plugin.min.js +0 -1
- package/templates/default/public/tinymce/plugins/autolink/index.js +0 -7
- package/templates/default/public/tinymce/plugins/autolink/plugin.js +0 -315
- package/templates/default/public/tinymce/plugins/autolink/plugin.min.js +0 -1
- package/templates/default/public/tinymce/plugins/autoresize/index.js +0 -7
- package/templates/default/public/tinymce/plugins/autoresize/plugin.js +0 -221
- package/templates/default/public/tinymce/plugins/autoresize/plugin.min.js +0 -1
- package/templates/default/public/tinymce/plugins/autosave/index.js +0 -7
- package/templates/default/public/tinymce/plugins/autosave/plugin.js +0 -249
- package/templates/default/public/tinymce/plugins/autosave/plugin.min.js +0 -1
- package/templates/default/public/tinymce/plugins/charmap/index.js +0 -7
- package/templates/default/public/tinymce/plugins/charmap/plugin.js +0 -997
- package/templates/default/public/tinymce/plugins/charmap/plugin.min.js +0 -1
- package/templates/default/public/tinymce/plugins/code/index.js +0 -7
- package/templates/default/public/tinymce/plugins/code/plugin.js +0 -98
- package/templates/default/public/tinymce/plugins/code/plugin.min.js +0 -1
- package/templates/default/public/tinymce/plugins/codesample/index.js +0 -7
- package/templates/default/public/tinymce/plugins/codesample/plugin.js +0 -3655
- package/templates/default/public/tinymce/plugins/codesample/plugin.min.js +0 -9
- package/templates/default/public/tinymce/plugins/directionality/index.js +0 -7
- package/templates/default/public/tinymce/plugins/directionality/plugin.js +0 -634
- package/templates/default/public/tinymce/plugins/directionality/plugin.min.js +0 -1
- package/templates/default/public/tinymce/plugins/emoticons/index.js +0 -7
- package/templates/default/public/tinymce/plugins/emoticons/js/emojiimages.js +0 -1
- package/templates/default/public/tinymce/plugins/emoticons/js/emojiimages.min.js +0 -1
- package/templates/default/public/tinymce/plugins/emoticons/js/emojis.js +0 -1
- package/templates/default/public/tinymce/plugins/emoticons/js/emojis.min.js +0 -1
- package/templates/default/public/tinymce/plugins/emoticons/plugin.js +0 -809
- package/templates/default/public/tinymce/plugins/emoticons/plugin.min.js +0 -1
- package/templates/default/public/tinymce/plugins/fullscreen/index.js +0 -7
- package/templates/default/public/tinymce/plugins/fullscreen/plugin.js +0 -1607
- package/templates/default/public/tinymce/plugins/fullscreen/plugin.min.js +0 -1
- package/templates/default/public/tinymce/plugins/help/index.js +0 -7
- package/templates/default/public/tinymce/plugins/help/js/i18n/keynav/ar.js +0 -93
- package/templates/default/public/tinymce/plugins/help/js/i18n/keynav/bg-BG.js +0 -93
- package/templates/default/public/tinymce/plugins/help/js/i18n/keynav/bg_BG.js +0 -93
- package/templates/default/public/tinymce/plugins/help/js/i18n/keynav/ca.js +0 -93
- package/templates/default/public/tinymce/plugins/help/js/i18n/keynav/cs.js +0 -93
- package/templates/default/public/tinymce/plugins/help/js/i18n/keynav/da.js +0 -93
- package/templates/default/public/tinymce/plugins/help/js/i18n/keynav/de.js +0 -93
- package/templates/default/public/tinymce/plugins/help/js/i18n/keynav/el.js +0 -93
- package/templates/default/public/tinymce/plugins/help/js/i18n/keynav/en.js +0 -93
- package/templates/default/public/tinymce/plugins/help/js/i18n/keynav/es.js +0 -93
- package/templates/default/public/tinymce/plugins/help/js/i18n/keynav/eu.js +0 -93
- package/templates/default/public/tinymce/plugins/help/js/i18n/keynav/fa.js +0 -93
- package/templates/default/public/tinymce/plugins/help/js/i18n/keynav/fi.js +0 -93
- package/templates/default/public/tinymce/plugins/help/js/i18n/keynav/fr-FR.js +0 -93
- package/templates/default/public/tinymce/plugins/help/js/i18n/keynav/fr_FR.js +0 -93
- package/templates/default/public/tinymce/plugins/help/js/i18n/keynav/he-IL.js +0 -93
- package/templates/default/public/tinymce/plugins/help/js/i18n/keynav/he_IL.js +0 -93
- package/templates/default/public/tinymce/plugins/help/js/i18n/keynav/hi.js +0 -93
- package/templates/default/public/tinymce/plugins/help/js/i18n/keynav/hr.js +0 -93
- package/templates/default/public/tinymce/plugins/help/js/i18n/keynav/hu-HU.js +0 -93
- package/templates/default/public/tinymce/plugins/help/js/i18n/keynav/hu_HU.js +0 -93
- package/templates/default/public/tinymce/plugins/help/js/i18n/keynav/id.js +0 -93
- package/templates/default/public/tinymce/plugins/help/js/i18n/keynav/it.js +0 -93
- package/templates/default/public/tinymce/plugins/help/js/i18n/keynav/ja.js +0 -93
- package/templates/default/public/tinymce/plugins/help/js/i18n/keynav/kk.js +0 -93
- package/templates/default/public/tinymce/plugins/help/js/i18n/keynav/ko-KR.js +0 -93
- package/templates/default/public/tinymce/plugins/help/js/i18n/keynav/ko_KR.js +0 -93
- package/templates/default/public/tinymce/plugins/help/js/i18n/keynav/ms.js +0 -93
- package/templates/default/public/tinymce/plugins/help/js/i18n/keynav/nb-NO.js +0 -93
- package/templates/default/public/tinymce/plugins/help/js/i18n/keynav/nb_NO.js +0 -93
- package/templates/default/public/tinymce/plugins/help/js/i18n/keynav/nl.js +0 -93
- package/templates/default/public/tinymce/plugins/help/js/i18n/keynav/pl.js +0 -93
- package/templates/default/public/tinymce/plugins/help/js/i18n/keynav/pt-BR.js +0 -93
- package/templates/default/public/tinymce/plugins/help/js/i18n/keynav/pt-PT.js +0 -93
- package/templates/default/public/tinymce/plugins/help/js/i18n/keynav/pt_BR.js +0 -93
- package/templates/default/public/tinymce/plugins/help/js/i18n/keynav/pt_PT.js +0 -93
- package/templates/default/public/tinymce/plugins/help/js/i18n/keynav/ro.js +0 -93
- package/templates/default/public/tinymce/plugins/help/js/i18n/keynav/ru.js +0 -93
- package/templates/default/public/tinymce/plugins/help/js/i18n/keynav/sk.js +0 -93
- package/templates/default/public/tinymce/plugins/help/js/i18n/keynav/sl-SI.js +0 -93
- package/templates/default/public/tinymce/plugins/help/js/i18n/keynav/sl_SI.js +0 -93
- package/templates/default/public/tinymce/plugins/help/js/i18n/keynav/sv-SE.js +0 -93
- package/templates/default/public/tinymce/plugins/help/js/i18n/keynav/sv_SE.js +0 -93
- package/templates/default/public/tinymce/plugins/help/js/i18n/keynav/th-TH.js +0 -93
- package/templates/default/public/tinymce/plugins/help/js/i18n/keynav/th_TH.js +0 -93
- package/templates/default/public/tinymce/plugins/help/js/i18n/keynav/tr.js +0 -93
- package/templates/default/public/tinymce/plugins/help/js/i18n/keynav/uk.js +0 -93
- package/templates/default/public/tinymce/plugins/help/js/i18n/keynav/vi.js +0 -93
- package/templates/default/public/tinymce/plugins/help/js/i18n/keynav/zh-CN.js +0 -87
- package/templates/default/public/tinymce/plugins/help/js/i18n/keynav/zh-TW.js +0 -93
- package/templates/default/public/tinymce/plugins/help/js/i18n/keynav/zh_CN.js +0 -87
- package/templates/default/public/tinymce/plugins/help/js/i18n/keynav/zh_TW.js +0 -93
- package/templates/default/public/tinymce/plugins/help/plugin.js +0 -826
- package/templates/default/public/tinymce/plugins/help/plugin.min.js +0 -1
- package/templates/default/public/tinymce/plugins/image/index.js +0 -7
- package/templates/default/public/tinymce/plugins/image/plugin.js +0 -1691
- package/templates/default/public/tinymce/plugins/image/plugin.min.js +0 -1
- package/templates/default/public/tinymce/plugins/importcss/index.js +0 -7
- package/templates/default/public/tinymce/plugins/importcss/plugin.js +0 -401
- package/templates/default/public/tinymce/plugins/importcss/plugin.min.js +0 -1
- package/templates/default/public/tinymce/plugins/insertdatetime/index.js +0 -7
- package/templates/default/public/tinymce/plugins/insertdatetime/plugin.js +0 -187
- package/templates/default/public/tinymce/plugins/insertdatetime/plugin.min.js +0 -1
- package/templates/default/public/tinymce/plugins/link/index.js +0 -7
- package/templates/default/public/tinymce/plugins/link/plugin.js +0 -1709
- package/templates/default/public/tinymce/plugins/link/plugin.min.js +0 -1
- package/templates/default/public/tinymce/plugins/lists/index.js +0 -7
- package/templates/default/public/tinymce/plugins/lists/plugin.js +0 -602
- package/templates/default/public/tinymce/plugins/lists/plugin.min.js +0 -1
- package/templates/default/public/tinymce/plugins/media/index.js +0 -7
- package/templates/default/public/tinymce/plugins/media/plugin.js +0 -1442
- package/templates/default/public/tinymce/plugins/media/plugin.min.js +0 -1
- package/templates/default/public/tinymce/plugins/nonbreaking/index.js +0 -7
- package/templates/default/public/tinymce/plugins/nonbreaking/plugin.js +0 -128
- package/templates/default/public/tinymce/plugins/nonbreaking/plugin.min.js +0 -1
- package/templates/default/public/tinymce/plugins/pagebreak/index.js +0 -7
- package/templates/default/public/tinymce/plugins/pagebreak/plugin.js +0 -123
- package/templates/default/public/tinymce/plugins/pagebreak/plugin.min.js +0 -1
- package/templates/default/public/tinymce/plugins/preview/index.js +0 -7
- package/templates/default/public/tinymce/plugins/preview/plugin.js +0 -843
- package/templates/default/public/tinymce/plugins/preview/plugin.min.js +0 -1
- package/templates/default/public/tinymce/plugins/quickbars/index.js +0 -7
- package/templates/default/public/tinymce/plugins/quickbars/plugin.js +0 -654
- package/templates/default/public/tinymce/plugins/quickbars/plugin.min.js +0 -1
- package/templates/default/public/tinymce/plugins/save/index.js +0 -7
- package/templates/default/public/tinymce/plugins/save/plugin.js +0 -136
- package/templates/default/public/tinymce/plugins/save/plugin.min.js +0 -1
- package/templates/default/public/tinymce/plugins/searchreplace/index.js +0 -7
- package/templates/default/public/tinymce/plugins/searchreplace/plugin.js +0 -1367
- package/templates/default/public/tinymce/plugins/searchreplace/plugin.min.js +0 -1
- package/templates/default/public/tinymce/plugins/table/index.js +0 -7
- package/templates/default/public/tinymce/plugins/table/plugin.js +0 -4008
- package/templates/default/public/tinymce/plugins/table/plugin.min.js +0 -1
- package/templates/default/public/tinymce/plugins/visualblocks/index.js +0 -7
- package/templates/default/public/tinymce/plugins/visualblocks/plugin.js +0 -106
- package/templates/default/public/tinymce/plugins/visualblocks/plugin.min.js +0 -1
- package/templates/default/public/tinymce/plugins/visualchars/index.js +0 -7
- package/templates/default/public/tinymce/plugins/visualchars/plugin.js +0 -808
- package/templates/default/public/tinymce/plugins/visualchars/plugin.min.js +0 -1
- package/templates/default/public/tinymce/plugins/wordcount/index.js +0 -7
- package/templates/default/public/tinymce/plugins/wordcount/plugin.js +0 -480
- package/templates/default/public/tinymce/plugins/wordcount/plugin.min.js +0 -1
- package/templates/default/public/tinymce/skins/content/dark/content.css +0 -75
- package/templates/default/public/tinymce/skins/content/dark/content.js +0 -10
- package/templates/default/public/tinymce/skins/content/dark/content.min.css +0 -10
- package/templates/default/public/tinymce/skins/content/dark/content.min.ts +0 -3
- package/templates/default/public/tinymce/skins/content/dark/content.ts +0 -3
- package/templates/default/public/tinymce/skins/content/default/content.css +0 -70
- package/templates/default/public/tinymce/skins/content/default/content.js +0 -10
- package/templates/default/public/tinymce/skins/content/default/content.min.css +0 -10
- package/templates/default/public/tinymce/skins/content/default/content.min.ts +0 -3
- package/templates/default/public/tinymce/skins/content/default/content.ts +0 -3
- package/templates/default/public/tinymce/skins/content/document/content.css +0 -75
- package/templates/default/public/tinymce/skins/content/document/content.js +0 -10
- package/templates/default/public/tinymce/skins/content/document/content.min.css +0 -10
- package/templates/default/public/tinymce/skins/content/document/content.min.ts +0 -3
- package/templates/default/public/tinymce/skins/content/document/content.ts +0 -3
- package/templates/default/public/tinymce/skins/content/tinymce-5/content.css +0 -70
- package/templates/default/public/tinymce/skins/content/tinymce-5/content.js +0 -10
- package/templates/default/public/tinymce/skins/content/tinymce-5/content.min.css +0 -10
- package/templates/default/public/tinymce/skins/content/tinymce-5/content.min.ts +0 -3
- package/templates/default/public/tinymce/skins/content/tinymce-5/content.ts +0 -3
- package/templates/default/public/tinymce/skins/content/tinymce-5-dark/content.css +0 -75
- package/templates/default/public/tinymce/skins/content/tinymce-5-dark/content.js +0 -10
- package/templates/default/public/tinymce/skins/content/tinymce-5-dark/content.min.css +0 -10
- package/templates/default/public/tinymce/skins/content/tinymce-5-dark/content.min.ts +0 -3
- package/templates/default/public/tinymce/skins/content/tinymce-5-dark/content.ts +0 -3
- package/templates/default/public/tinymce/skins/content/writer/content.css +0 -71
- package/templates/default/public/tinymce/skins/content/writer/content.js +0 -10
- package/templates/default/public/tinymce/skins/content/writer/content.min.css +0 -10
- package/templates/default/public/tinymce/skins/content/writer/content.min.ts +0 -3
- package/templates/default/public/tinymce/skins/content/writer/content.ts +0 -3
- package/templates/default/public/tinymce/skins/ui/oxide/content.css +0 -1037
- package/templates/default/public/tinymce/skins/ui/oxide/content.inline.css +0 -1031
- package/templates/default/public/tinymce/skins/ui/oxide/content.inline.js +0 -10
- package/templates/default/public/tinymce/skins/ui/oxide/content.inline.min.css +0 -10
- package/templates/default/public/tinymce/skins/ui/oxide/content.inline.min.ts +0 -116
- package/templates/default/public/tinymce/skins/ui/oxide/content.inline.ts +0 -116
- package/templates/default/public/tinymce/skins/ui/oxide/content.js +0 -10
- package/templates/default/public/tinymce/skins/ui/oxide/content.min.css +0 -10
- package/templates/default/public/tinymce/skins/ui/oxide/content.min.ts +0 -116
- package/templates/default/public/tinymce/skins/ui/oxide/content.ts +0 -116
- package/templates/default/public/tinymce/skins/ui/oxide/skin.css +0 -5615
- package/templates/default/public/tinymce/skins/ui/oxide/skin.js +0 -1
- package/templates/default/public/tinymce/skins/ui/oxide/skin.min.css +0 -1
- package/templates/default/public/tinymce/skins/ui/oxide/skin.min.ts +0 -507
- package/templates/default/public/tinymce/skins/ui/oxide/skin.shadowdom.css +0 -30
- package/templates/default/public/tinymce/skins/ui/oxide/skin.shadowdom.js +0 -1
- package/templates/default/public/tinymce/skins/ui/oxide/skin.shadowdom.min.css +0 -1
- package/templates/default/public/tinymce/skins/ui/oxide/skin.shadowdom.min.ts +0 -9
- package/templates/default/public/tinymce/skins/ui/oxide/skin.shadowdom.ts +0 -9
- package/templates/default/public/tinymce/skins/ui/oxide/skin.ts +0 -507
- package/templates/default/public/tinymce/skins/ui/oxide-dark/content.css +0 -1025
- package/templates/default/public/tinymce/skins/ui/oxide-dark/content.inline.css +0 -1031
- package/templates/default/public/tinymce/skins/ui/oxide-dark/content.inline.js +0 -10
- package/templates/default/public/tinymce/skins/ui/oxide-dark/content.inline.min.css +0 -10
- package/templates/default/public/tinymce/skins/ui/oxide-dark/content.inline.min.ts +0 -116
- package/templates/default/public/tinymce/skins/ui/oxide-dark/content.inline.ts +0 -116
- package/templates/default/public/tinymce/skins/ui/oxide-dark/content.js +0 -10
- package/templates/default/public/tinymce/skins/ui/oxide-dark/content.min.css +0 -10
- package/templates/default/public/tinymce/skins/ui/oxide-dark/content.min.ts +0 -116
- package/templates/default/public/tinymce/skins/ui/oxide-dark/content.ts +0 -116
- package/templates/default/public/tinymce/skins/ui/oxide-dark/skin.css +0 -5618
- package/templates/default/public/tinymce/skins/ui/oxide-dark/skin.js +0 -1
- package/templates/default/public/tinymce/skins/ui/oxide-dark/skin.min.css +0 -1
- package/templates/default/public/tinymce/skins/ui/oxide-dark/skin.min.ts +0 -507
- package/templates/default/public/tinymce/skins/ui/oxide-dark/skin.shadowdom.css +0 -30
- package/templates/default/public/tinymce/skins/ui/oxide-dark/skin.shadowdom.js +0 -1
- package/templates/default/public/tinymce/skins/ui/oxide-dark/skin.shadowdom.min.css +0 -1
- package/templates/default/public/tinymce/skins/ui/oxide-dark/skin.shadowdom.min.ts +0 -9
- package/templates/default/public/tinymce/skins/ui/oxide-dark/skin.shadowdom.ts +0 -9
- package/templates/default/public/tinymce/skins/ui/oxide-dark/skin.ts +0 -507
- package/templates/default/public/tinymce/skins/ui/tinymce-5/content.css +0 -1037
- package/templates/default/public/tinymce/skins/ui/tinymce-5/content.inline.css +0 -1031
- package/templates/default/public/tinymce/skins/ui/tinymce-5/content.inline.js +0 -10
- package/templates/default/public/tinymce/skins/ui/tinymce-5/content.inline.min.css +0 -10
- package/templates/default/public/tinymce/skins/ui/tinymce-5/content.inline.min.ts +0 -116
- package/templates/default/public/tinymce/skins/ui/tinymce-5/content.inline.ts +0 -116
- package/templates/default/public/tinymce/skins/ui/tinymce-5/content.js +0 -10
- package/templates/default/public/tinymce/skins/ui/tinymce-5/content.min.css +0 -10
- package/templates/default/public/tinymce/skins/ui/tinymce-5/content.min.ts +0 -116
- package/templates/default/public/tinymce/skins/ui/tinymce-5/content.ts +0 -116
- package/templates/default/public/tinymce/skins/ui/tinymce-5/skin.css +0 -5734
- package/templates/default/public/tinymce/skins/ui/tinymce-5/skin.js +0 -1
- package/templates/default/public/tinymce/skins/ui/tinymce-5/skin.min.css +0 -1
- package/templates/default/public/tinymce/skins/ui/tinymce-5/skin.min.ts +0 -508
- package/templates/default/public/tinymce/skins/ui/tinymce-5/skin.shadowdom.css +0 -30
- package/templates/default/public/tinymce/skins/ui/tinymce-5/skin.shadowdom.js +0 -1
- package/templates/default/public/tinymce/skins/ui/tinymce-5/skin.shadowdom.min.css +0 -1
- package/templates/default/public/tinymce/skins/ui/tinymce-5/skin.shadowdom.min.ts +0 -9
- package/templates/default/public/tinymce/skins/ui/tinymce-5/skin.shadowdom.ts +0 -9
- package/templates/default/public/tinymce/skins/ui/tinymce-5/skin.ts +0 -508
- package/templates/default/public/tinymce/skins/ui/tinymce-5-dark/content.css +0 -1025
- package/templates/default/public/tinymce/skins/ui/tinymce-5-dark/content.inline.css +0 -1031
- package/templates/default/public/tinymce/skins/ui/tinymce-5-dark/content.inline.js +0 -10
- package/templates/default/public/tinymce/skins/ui/tinymce-5-dark/content.inline.min.css +0 -10
- package/templates/default/public/tinymce/skins/ui/tinymce-5-dark/content.inline.min.ts +0 -116
- package/templates/default/public/tinymce/skins/ui/tinymce-5-dark/content.inline.ts +0 -116
- package/templates/default/public/tinymce/skins/ui/tinymce-5-dark/content.js +0 -10
- package/templates/default/public/tinymce/skins/ui/tinymce-5-dark/content.min.css +0 -10
- package/templates/default/public/tinymce/skins/ui/tinymce-5-dark/content.min.ts +0 -116
- package/templates/default/public/tinymce/skins/ui/tinymce-5-dark/content.ts +0 -116
- package/templates/default/public/tinymce/skins/ui/tinymce-5-dark/skin.css +0 -5734
- package/templates/default/public/tinymce/skins/ui/tinymce-5-dark/skin.js +0 -1
- package/templates/default/public/tinymce/skins/ui/tinymce-5-dark/skin.min.css +0 -1
- package/templates/default/public/tinymce/skins/ui/tinymce-5-dark/skin.min.ts +0 -508
- package/templates/default/public/tinymce/skins/ui/tinymce-5-dark/skin.shadowdom.css +0 -30
- package/templates/default/public/tinymce/skins/ui/tinymce-5-dark/skin.shadowdom.js +0 -1
- package/templates/default/public/tinymce/skins/ui/tinymce-5-dark/skin.shadowdom.min.css +0 -1
- package/templates/default/public/tinymce/skins/ui/tinymce-5-dark/skin.shadowdom.min.ts +0 -9
- package/templates/default/public/tinymce/skins/ui/tinymce-5-dark/skin.shadowdom.ts +0 -9
- package/templates/default/public/tinymce/skins/ui/tinymce-5-dark/skin.ts +0 -508
- package/templates/default/public/tinymce/themes/silver/index.js +0 -7
- package/templates/default/public/tinymce/themes/silver/theme.js +0 -34748
- package/templates/default/public/tinymce/themes/silver/theme.min.js +0 -1
- package/templates/default/public/tinymce/tinymce.d.ts +0 -3413
- package/templates/default/public/tinymce/tinymce.js +0 -41518
- package/templates/default/public/tinymce/tinymce.min.js +0 -10
|
@@ -1 +0,0 @@
|
|
|
1
|
-
!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager");const t=e=>t=>(e=>{const t=typeof e;return null===e?"null":"object"===t&&Array.isArray(e)?"array":"object"===t&&(n=o=e,(r=String).prototype.isPrototypeOf(n)||o.constructor?.name===r.name)?"string":t;var n,o,r})(t)===e,n=e=>t=>typeof t===e,o=t("string"),r=t("object"),l=t("array"),a=e=>null===e;const s=n("boolean"),i=e=>!(e=>null==e)(e),c=n("function"),u=(e,t)=>{if(l(e)){for(let n=0,o=e.length;n<o;++n)if(!t(e[n]))return!1;return!0}return!1},g=()=>{},d=e=>e,m=(e,t)=>e===t;class h{tag;value;static singletonNone=new h(!1);constructor(e,t){this.tag=e,this.value=t}static some(e){return new h(!0,e)}static none(){return h.singletonNone}fold(e,t){return this.tag?t(this.value):e()}isSome(){return this.tag}isNone(){return!this.tag}map(e){return this.tag?h.some(e(this.value)):h.none()}bind(e){return this.tag?e(this.value):h.none()}exists(e){return this.tag&&e(this.value)}forall(e){return!this.tag||e(this.value)}filter(e){return!this.tag||e(this.value)?this:h.none()}getOr(e){return this.tag?this.value:e}or(e){return this.tag?this:e}getOrThunk(e){return this.tag?this.value:e()}orThunk(e){return this.tag?this:e()}getOrDie(e){if(this.tag)return this.value;throw new Error(e??"Called getOrDie on None")}static from(e){return i(e)?h.some(e):h.none()}getOrNull(){return this.tag?this.value:null}getOrUndefined(){return this.value}each(e){this.tag&&e(this.value)}toArray(){return this.tag?[this.value]:[]}toString(){return this.tag?`some(${this.value})`:"none()"}}Array.prototype.slice;const p=Array.prototype.indexOf,f=Array.prototype.push,k=e=>{const t=[];for(let n=0,o=e.length;n<o;++n){if(!l(e[n]))throw new Error("Arr.flatten item "+n+" was not an array, input: "+e);f.apply(t,e[n])}return t};c(Array.from)&&Array.from;const b=(e,t)=>{for(let n=0;n<e.length;n++){const o=t(e[n],n);if(o.isSome())return o}return h.none()},v=Object.keys,y=Object.hasOwnProperty,x=(e,t)=>y.call(e,t),_=(e,t,n=m)=>e.exists((e=>n(e,t))),w=e=>{const t=[],n=e=>{t.push(e)};for(let t=0;t<e.length;t++)e[t].each(n);return t},C=(e,t)=>e?h.some(t):h.none(),O=e=>t=>t.options.get(e),A=O("link_assume_external_targets"),S=O("link_context_toolbar"),N=O("link_list"),E=O("link_default_target"),R=O("link_default_protocol"),T=O("link_target_list"),L=O("link_rel_list"),P=O("link_class_list"),U=O("link_title"),B=O("allow_unsafe_link_target"),D=O("link_quicklink"),M=O("link_attributes_postprocess"),j=O("files_upload_handler"),I=O("link_uploadtab"),F=O("documents_file_types");var K=tinymce.util.Tools.resolve("tinymce.util.URI"),q=tinymce.util.Tools.resolve("tinymce.dom.TreeWalker"),$=tinymce.util.Tools.resolve("tinymce.util.Tools");const V=e=>i(e)&&"a"===e.nodeName.toLowerCase(),z=e=>V(e)&&!!J(e),G=(e,t)=>{if(e.collapsed)return[];{const n=e.cloneContents(),o=n.firstChild,r=new q(o,n),l=[];let a=o;do{t(a)&&l.push(a)}while(a=r.next());return l}},H=e=>/^\w+:/i.test(e),J=e=>e.getAttribute("data-mce-href")??e.getAttribute("href")??"",W=(e,t)=>{const n=["noopener"],o=e?e.split(/\s+/):[],r=e=>e.filter((e=>-1===$.inArray(n,e))),l=t?(e=>(e=r(e)).length>0?e.concat(n):n)(o):r(o);return l.length>0?(e=>$.trim(e.sort().join(" ")))(l):""},Q=(e,t)=>(t=t||Z(e.selection.getRng())[0]||e.selection.getNode(),oe(t)?h.from(e.dom.select("a[href]",t)[0]):h.from(e.dom.getParent(t,"a[href]"))),X=(e,t)=>Q(e,t).isSome(),Y=(e,t)=>t.fold((()=>e.getContent({format:"text"})),(e=>e.innerText||e.textContent||"")).replace(/\uFEFF/g,""),Z=e=>G(e,z),ee=e=>$.grep(e,z),te=e=>ee(e).length>0,ne=e=>{const t=e.schema.getTextInlineElements();if(Q(e).exists((e=>e.hasAttribute("data-mce-block"))))return!1;const n=e.selection.getRng();return!!n.collapsed||0===G(n,(e=>1===e.nodeType&&!V(e)&&!x(t,e.nodeName.toLowerCase()))).length},oe=e=>i(e)&&"FIGURE"===e.nodeName&&/\bimage\b/i.test(e.className),re=(e,t,n)=>{const o=e.selection.getNode(),r=Q(e,o),l=((e,t)=>{const n={...t};if(0===L(e).length&&!B(e)){const e=W(n.rel,"_blank"===n.target);n.rel=e||null}return h.from(n.target).isNone()&&!1===T(e)&&(n.target=E(e)),n.href=((e,t)=>"http"!==t&&"https"!==t||H(e)?e:t+"://"+e)(n.href,A(e)),n})(e,(e=>{return t=["title","rel","class","target"],n=(t,n)=>(e[n].each((e=>{t[n]=e.length>0?e:null})),t),o={href:e.href},((e,t)=>{for(let n=0,o=e.length;n<o;n++)t(e[n],n)})(t,((e,t)=>{o=n(o,e)})),o;var t,n,o})(n)),a=M(e);i(a)&&a(l),e.undoManager.transact((()=>{n.href===t.href&&t.attach(),r.fold((()=>{((e,t,n,o)=>{const r=e.dom;oe(t)?ce(r,t,o):n.fold((()=>{e.execCommand("mceInsertLink",!1,o);const t=e.selection.getEnd(),n=r.createRng();n.setStartAfter(t),n.setEndAfter(t),e.selection.setRng(n)}),(t=>{e.insertContent(r.createHTML("a",o,r.encode(t)))}))})(e,o,n.text,l)}),(t=>{e.focus(),((e,t,n,o)=>{n.each((e=>{x(t,"innerText")?t.innerText=e:t.textContent=e})),e.dom.setAttribs(t,o);const r=e.dom.createRng();r.setStartAfter(t),r.setEndAfter(t),e.selection.setRng(r)})(e,t,n.text,l)}))}))},le=e=>{const{class:t,href:n,rel:o,target:r,text:l,title:s}=e;return(e=>{const t={};var n;return((e,t,n,o)=>{((e,t)=>{const n=v(e);for(let o=0,r=n.length;o<r;o++){const r=n[o];t(e[r],r)}})(e,((e,r)=>{(t(e,r)?n:o)(e,r)}))})(e,((e,t)=>!1===a(e)),(n=t,(e,t)=>{n[t]=e}),g),t})({class:t.getOrNull(),href:n,rel:o.getOrNull(),target:r.getOrNull(),text:l.getOrNull(),title:s.getOrNull()})},ae=(e,t,n)=>{const o=((e,t)=>{const n=e.options.get,o={allow_html_data_urls:n("allow_html_data_urls"),allow_script_urls:n("allow_script_urls"),allow_svg_data_urls:n("allow_svg_data_urls")},r=t.href;return{...t,href:K.isDomSafe(r,"a",o)?r:""}})(e,n);e.hasPlugin("rtc",!0)?e.execCommand("createlink",!1,le(o)):re(e,t,o)},se=e=>{e.hasPlugin("rtc",!0)?e.execCommand("unlink"):(e=>{e.undoManager.transact((()=>{const t=e.selection.getNode();oe(t)?ie(e,t):(e=>{const t=e.dom,n=e.selection,o=n.getBookmark(),r=n.getRng().cloneRange(),l=t.getParent(r.startContainer,"a[href]",e.getBody()),a=t.getParent(r.endContainer,"a[href]",e.getBody());l&&r.setStartBefore(l),a&&r.setEndAfter(a),n.setRng(r),e.execCommand("unlink"),n.moveToBookmark(o)})(e),e.focus()}))})(e)},ie=(e,t)=>{const n=e.dom.select("img",t)[0];if(n){const o=e.dom.getParents(n,"a[href]",t)[0];o&&(o.parentNode?.insertBefore(n,o),e.dom.remove(o))}},ce=(e,t,n)=>{const o=e.select("img",t)[0];if(o){const t=e.create("a",n);o.parentNode?.insertBefore(t,o),t.appendChild(o)}},ue=e=>o(e.value)?e.value:"",ge=(e,t)=>{const n=[];return $.each(e,(e=>{const r=(e=>o(e.text)?e.text:o(e.title)?e.title:"")(e);if(void 0!==e.menu){const o=ge(e.menu,t);n.push({text:r,items:o})}else{const o=t(e);n.push({text:r,value:o})}})),n},de=(e=ue)=>t=>h.from(t).map((t=>ge(t,e))),me=e=>de(ue)(e),he=de,pe=(e,t)=>n=>({name:e,type:"listbox",label:t,items:n}),fe=ue,ke=(e,t)=>b(t,(t=>(e=>{return x(t=e,n="items")&&void 0!==t[n]&&null!==t[n];var t,n})(t)?ke(e,t.items):C(t.value===e,t))),be=(e,t)=>{const n={text:e.text,title:e.title},o=(e,o)=>{const r=(l=t,a=o,"link"===a?l.link:"anchor"===a?l.anchor:h.none()).getOr([]);var l,a;return((e,t,n,o)=>{const r=o[t],l=e.length>0;return void 0!==r?ke(r,n).map((t=>({url:{value:t.value,meta:{text:l?e:t.text,attach:g}},text:l?e:t.text}))):h.none()})(n.text,o,r,e)};return{onChange:(e,t)=>{const r=t.name;return"url"===r?(e=>{const t=(o=e.url,C(n.text.length<=0,h.from(o.meta?.text).getOr(o.value)));var o;const r=(e=>C(n.title.length<=0,h.from(e.meta?.title).getOr("")))(e.url);return t.isSome()||r.isSome()?h.some({...t.map((e=>({text:e}))).getOr({}),...r.map((e=>({title:e}))).getOr({})}):h.none()})(e()):((e,t)=>p.call(e,t))(["anchor","link"],r)>-1?o(e(),r):"text"===r||"title"===r?(n[r]=e()[r],h.none()):h.none()}}};var ve=tinymce.util.Tools.resolve("tinymce.util.Delay");const ye=e=>{const t=e.href;return t.indexOf("@")>0&&-1===t.indexOf("/")&&-1===t.indexOf("mailto:")?h.some({message:"The URL you entered seems to be an email address. Do you want to add the required mailto: prefix?",preprocess:e=>({...e,href:"mailto:"+t})}):h.none()},xe=(e,t)=>n=>{const o=n.href;return 1===e&&!H(o)||0===e&&/^\s*www(\.|\d\.)/i.test(o)?h.some({message:`The URL you entered seems to be an external link. Do you want to add the required ${t}:// prefix?`,preprocess:e=>({...e,href:t+"://"+o})}):h.none()},_e=e=>{const t=e.dom.select("a:not([href])"),n=k(((e,t)=>{const n=e.length,o=new Array(n);for(let r=0;r<n;r++){const n=e[r];o[r]=t(n,r)}return o})(t,(e=>{const t=e.name||e.id;return t?[{text:t,value:"#"+t}]:[]})));return n.length>0?h.some([{text:"None",value:""}].concat(n)):h.none()},we=e=>{const t=P(e);return t.length>0?me(t):h.none()},Ce=e=>{try{return h.some(JSON.parse(e))}catch{return h.none()}},Oe=(e,t)=>{const n=L(e);if(n.length>0){const o=_(t,"_blank"),r=e=>W(fe(e),o);return(!1===B(e)?he(r):me)(n)}return h.none()},Ae=[{text:"Current window",value:""},{text:"New window",value:"_blank"}],Se=e=>{const t=T(e);return l(t)?me(t).orThunk((()=>h.some(Ae))):!1===t?h.none():h.some(Ae)},Ne=(e,t,n)=>{const o=e.getAttrib(t,n);return null!==o&&o.length>0?h.some(o):h.none()},Ee=(e,t)=>(e=>{const t=t=>e.convertURL(t.value||t.url||"","href"),n=N(e);return new Promise((e=>{o(n)?fetch(n).then((e=>e.ok?e.text().then(Ce):Promise.reject())).then(e,(()=>e(h.none()))):c(n)?n((t=>e(h.some(t)))):e(h.from(n))})).then((e=>e.bind(he(t)).map((e=>e.length>0?[{text:"None",value:""}].concat(e):e))))})(e).then((n=>{const o=(e=>i(e.options.get("files_upload_handler")))(e)&&(e=>i(e.options.get("documents_file_types")))(e)&&I(e),r=((e,t)=>{const n=e.dom,o=ne(e)?h.some(Y(e.selection,t)):h.none(),r=t.bind((e=>h.from(n.getAttrib(e,"href")))),l=t.bind((e=>h.from(n.getAttrib(e,"target")))),a=t.bind((e=>Ne(n,e,"rel"))),s=t.bind((e=>Ne(n,e,"class")));return{url:r,text:o,title:t.bind((e=>Ne(n,e,"title"))),target:l,rel:a,linkClass:s}})(e,t);return{anchor:r,catalogs:{targets:Se(e),rels:Oe(e,r.target),classes:we(e),anchor:_e(e),link:n},hasUploadPanel:o,optNode:t,flags:{titleEnabled:U(e)}}})),Re=e=>({title:"Upload",name:"upload",items:[{type:"dropzone",name:"fileinput",buttonLabel:"Browse for a file",dropAreaLabel:"Drop a file here",allowedFileTypes:e.map((e=>e.mimeType)).join(","),allowedFileExtensions:k(e.map((e=>e.extensions)))}]}),Te=e=>(t,n)=>j(e)(t,n),Le=(e,t)=>{const n=t.getData();var o;t.block("Uploading file"),(o=n.fileinput,(e=>0<e.length?h.some(e[0]):h.none())(o)).fold((()=>{t.unblock()}),(n=>{const o=URL.createObjectURL(n),r=()=>{t.unblock(),URL.revokeObjectURL(o)};var l;(l=n,new Promise(((e,t)=>{const n=new FileReader;n.onload=()=>{e(n.result)},n.onerror=()=>{t(new Error(n.error?.message??"Failed to convert blob to a data url"))},n.readAsDataURL(l)}))).then((t=>{const r=e.getExistingBlobInfo((e=>h.from(e.split(",")[1]).getOr(""))(t),n.type),l=r&&r.filename()===n.name?r:e.createBlobCache(n,o,t);return e.addToBlobCache(l),e.uploadFile(l,d)})).then((e=>{(({url:e,fileName:n})=>{t.setData({text:n,title:n,url:{value:e,meta:{}}}),t.showTab("general"),t.focus("url")})(e),r()})).catch((n=>{r(),e.alertErr(n,(()=>{t.focus("fileinput")}))}))}))},Pe=e=>(t,n,o)=>e.editorUpload.blobCache.create({blob:t,blobUri:n,name:t.name?.replace(/\.[^\.]+$/,""),filename:t.name,base64:o.split(",")[1]}),Ue=e=>t=>{e.editorUpload.blobCache.add(t)},Be=e=>(t,n)=>e.editorUpload.blobCache.getByData(t,n),De=e=>(t,n)=>{e.windowManager.alert(t,n)},Me=e=>{const t=(e=>{const t=Q(e);return Ee(e,t)})(e);t.then((t=>{const n=((e,t)=>n=>{const o=n.getData();if(!o.url.value)return se(e),void n.close();const r=e=>h.from(o[e]).filter((n=>!_(t.anchor[e],n))),l={href:o.url.value,text:r("text"),target:r("target"),rel:r("rel"),class:r("linkClass"),title:r("title")},a={href:o.url.value,attach:void 0!==o.url.meta&&o.url.meta.attach?o.url.meta.attach:g};((e,t)=>b([ye,xe(A(e),R(e))],(e=>e(t))).fold((()=>Promise.resolve(t)),(n=>new Promise((o=>{((e,t,n)=>{const o=e.selection.getRng();ve.setEditorTimeout(e,(()=>{e.windowManager.confirm(t,(t=>{e.selection.setRng(o),n(t)}))}))})(e,n.message,(e=>{o(e?n.preprocess(t):t)}))})))))(e,l).then((t=>{ae(e,a,t)})),n.close()})(e,t);return((e,t,n)=>{const o=e.anchor.text.map((()=>({name:"text",type:"input",label:"Text to display"}))).toArray(),r=e.flags.titleEnabled?[{name:"title",type:"input",label:"Title"}]:[],l=((e,t)=>{const n=e.anchor,o=n.url.getOr("");return{url:{value:o,meta:{original:{value:o}}},text:n.text.getOr(""),title:n.title.getOr(""),anchor:o,link:o,rel:n.rel.getOr(""),target:n.target.or(t).getOr(""),linkClass:n.linkClass.getOr(""),fileinput:[]}})(e,h.from(E(n))),a=e.catalogs,s=be(l,a),i=((e,t,n,o,r,l)=>{const a=k([[{name:"url",type:"urlinput",filetype:"file",label:"URL",picker_text:"Browse links"}],t,n,w([o.anchor.map(pe("anchor","Anchors")),o.rels.map(pe("rel","Rel")),o.targets.map(pe("target","Open link in...")),o.link.map(pe("link","Link list")),o.classes.map(pe("linkClass","Class"))])]);return r?{type:"tabpanel",tabs:k([[{title:"General",name:"general",items:a}],[Re(l)]])}:{type:"panel",items:a}})(0,o,r,a,e.hasUploadPanel,F(n)),c={addToBlobCache:Ue(n),createBlobCache:Pe(n),alertErr:De(n),uploadFile:Te(n),getExistingBlobInfo:Be(n)};return{title:"Insert/Edit Link",size:"normal",body:i,buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:l,onChange:(e,{name:t})=>{"fileinput"===t?Le(c,e):s.onChange(e.getData,{name:t}).each((t=>{e.setData(t)}))},onSubmit:t}})(t,n,e)})).then((t=>{e.windowManager.open(t)}))};var je=tinymce.util.Tools.resolve("tinymce.util.VK");const Ie=(e,t)=>{if(t){const o=J(t);if(/^#/.test(o)){const t=e.dom.select(`${o},[name="${n=o,((e,t)=>((e,t)=>""===t||e.length>=t.length&&e.substr(0,0+t.length)===t)(e,t))(n,"#")?(e=>e.substring(1))(n):n}"]`);t.length&&e.selection.scrollIntoView(t[0],!0)}else(e=>{const t=document.createElement("a");t.target="_blank",t.href=e,t.rel="noreferrer noopener";const n=new MouseEvent("click",{bubbles:!0,cancelable:!0,view:window});document.dispatchEvent(n),((e,t)=>{document.body.appendChild(e),e.dispatchEvent(t),document.body.removeChild(e)})(t,n)})(t.href)}var n},Fe=(e,t)=>{const n=ee(e.dom.getParents(t));return C(1===n.length,n[0])},Ke=e=>e.selection.isCollapsed()||(e=>{const t=e.selection.getRng(),n=t.startContainer;return z(n)&&t.startContainer===t.endContainer&&1===e.dom.select("img",n).length})(e)?Fe(e,e.selection.getStart()):(e=>{const t=Z(e.selection.getRng());return C(t.length>0,t[0]).or(Fe(e,e.selection.getNode()))})(e),qe=e=>()=>{e.execCommand("mceLink",!1,{dialog:!0})},$e=(e,t)=>(e.on("NodeChange",t),()=>e.off("NodeChange",t)),Ve=e=>t=>{const n=()=>{t.setActive(!e.mode.isReadOnly()&&X(e,e.selection.getNode())),t.setEnabled(e.selection.isEditable())};return n(),$e(e,n)},ze=e=>t=>{const n=()=>{t.setEnabled(e.selection.isEditable())};return n(),$e(e,n)},Ge=e=>t=>{const n=e.dom.getParents(e.selection.getStart()),o=n=>{t.setEnabled((t=>{return te(t)||(n=e.selection.getRng(),Z(n).length>0);var n})(n)&&e.selection.isEditable())};return o(n),$e(e,(e=>o(e.parents)))},He=e=>{const t=(e=>{const t=(()=>{const e=(e=>{const t=(e=>{let t=e;return{get:()=>t,set:e=>{t=e}}})(h.none()),n=()=>t.get().each(e);return{clear:()=>{n(),t.set(h.none())},isSet:()=>t.get().isSome(),get:()=>t.get(),set:e=>{n(),t.set(h.some(e))}}})(g);return{...e,on:t=>e.get().each(t)}})(),n=()=>t.get().or(Ke(e));return e.on("contextmenu",(n=>{Fe(e,n.target).each(t.set)})),e.on("SelectionChange",(()=>{t.isSet()||Ke(e).each(t.set)})),e.on("click",(n=>{t.clear();const o=ee(e.dom.getParents(n.target));1===o.length&&je.metaKeyPressed(n)&&(n.preventDefault(),Ie(e,o[0]))})),e.on("keydown",(o=>{t.clear(),!o.isDefaultPrevented()&&13===o.keyCode&&(e=>!0===e.altKey&&!1===e.shiftKey&&!1===e.ctrlKey&&!1===e.metaKey)(o)&&n().each((t=>{o.preventDefault(),Ie(e,t)}))})),{gotoSelectedLink:()=>n().each((t=>Ie(e,t)))}})(e);((e,t)=>{e.ui.registry.addToggleButton("link",{icon:"link",tooltip:"Insert/edit link",shortcut:"Meta+K",onAction:qe(e),onSetup:Ve(e)}),e.ui.registry.addButton("openlink",{icon:"new-tab",tooltip:"Open link",onAction:t.gotoSelectedLink,onSetup:Ge(e)}),e.ui.registry.addButton("unlink",{icon:"unlink",tooltip:"Remove link",onAction:()=>se(e),onSetup:Ge(e)})})(e,t),((e,t)=>{e.ui.registry.addMenuItem("openlink",{text:"Open link",icon:"new-tab",onAction:t.gotoSelectedLink,onSetup:Ge(e)}),e.ui.registry.addMenuItem("link",{icon:"link",text:"Link...",shortcut:"Meta+K",onAction:qe(e),onSetup:ze(e)}),e.ui.registry.addMenuItem("unlink",{icon:"unlink",text:"Remove link",onAction:()=>se(e),onSetup:Ge(e)})})(e,t),(e=>{e.ui.registry.addContextMenu("link",{update:t=>e.dom.isEditable(t)?te(e.dom.getParents(t,"a"))?"link unlink openlink":"link":""})})(e),((e,t)=>{const n=t=>{const n=e.selection.getNode();return t.setEnabled(X(e,n)&&e.selection.isEditable()),g};e.ui.registry.addContextForm("quicklink",{launch:{type:"contextformtogglebutton",icon:"link",tooltip:"Link",onSetup:Ve(e)},label:"Link",predicate:t=>S(e)&&X(e,t),initValue:()=>Q(e).fold((()=>""),J),commands:[{type:"contextformtogglebutton",icon:"link",tooltip:"Link",primary:!0,onSetup:t=>{const n=e.selection.getNode();return t.setActive(X(e,n)),Ve(e)(t)},onAction:t=>{const n=t.getValue(),o=(t=>{const n=Q(e),o=ne(e);if(n.isNone()&&o){const o=Y(e.selection,n);return C(0===o.length,t)}return h.none()})(n);ae(e,{href:n,attach:g},{href:n,text:o,title:h.none(),rel:h.none(),target:h.from(E(e)),class:h.none()}),(e=>{e.selection.collapse(!1)})(e),t.hide()}},{type:"contextformbutton",icon:"unlink",tooltip:"Remove link",onSetup:n,onAction:t=>{se(e),t.hide()}},{type:"contextformbutton",icon:"new-tab",tooltip:"Open link",onSetup:n,onAction:e=>{t.gotoSelectedLink(),e.hide()}}]})})(e,t)};e.add("link",(e=>{(e=>{const t=e.options.register;t("link_assume_external_targets",{processor:e=>{const t=o(e)||s(e);return t?!0===e?{value:1,valid:t}:"http"===e||"https"===e?{value:e,valid:t}:{value:0,valid:t}:{valid:!1,message:"Must be a string or a boolean."}},default:!1}),t("link_context_toolbar",{processor:"boolean",default:!1}),t("link_list",{processor:e=>o(e)||c(e)||u(e,r)}),t("link_default_target",{processor:"string"}),t("link_default_protocol",{processor:"string",default:"https"}),t("link_target_list",{processor:e=>s(e)||u(e,r),default:!0}),t("link_rel_list",{processor:"object[]",default:[]}),t("link_class_list",{processor:"object[]",default:[]}),t("link_title",{processor:"boolean",default:!0}),t("allow_unsafe_link_target",{processor:"boolean",default:!1}),t("link_quicklink",{processor:"boolean",default:!1}),t("link_attributes_postprocess",{processor:"function"}),t("files_upload_handler",{processor:"function"}),t("link_uploadtab",{processor:"boolean",default:!0})})(e),(e=>{e.addCommand("mceLink",((t,n)=>{!0!==n?.dialog&&D(e)?e.dispatch("contexttoolbar-show",{toolbarKey:"quicklink"}):Me(e)}))})(e),He(e),(e=>{e.addShortcut("Meta+K","",(()=>{e.execCommand("mceLink")}))})(e)}))}();
|
|
@@ -1,602 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* TinyMCE version 8.3.1 (2025-12-17)
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
(function () {
|
|
6
|
-
'use strict';
|
|
7
|
-
|
|
8
|
-
var global = tinymce.util.Tools.resolve('tinymce.PluginManager');
|
|
9
|
-
|
|
10
|
-
const get = (editor) => ({
|
|
11
|
-
backspaceDelete: (isForward) => {
|
|
12
|
-
editor.execCommand('mceListBackspaceDelete', false, isForward);
|
|
13
|
-
}
|
|
14
|
-
});
|
|
15
|
-
|
|
16
|
-
/* eslint-disable @typescript-eslint/no-wrapper-object-types */
|
|
17
|
-
const isSimpleType = (type) => (value) => typeof value === type;
|
|
18
|
-
const isNullable = (a) => a === null || a === undefined;
|
|
19
|
-
const isNonNullable = (a) => !isNullable(a);
|
|
20
|
-
const isFunction = isSimpleType('function');
|
|
21
|
-
|
|
22
|
-
const constant = (value) => {
|
|
23
|
-
return () => {
|
|
24
|
-
return value;
|
|
25
|
-
};
|
|
26
|
-
};
|
|
27
|
-
const tripleEquals = (a, b) => {
|
|
28
|
-
return a === b;
|
|
29
|
-
};
|
|
30
|
-
const never = constant(false);
|
|
31
|
-
|
|
32
|
-
/**
|
|
33
|
-
* The `Optional` type represents a value (of any type) that potentially does
|
|
34
|
-
* not exist. Any `Optional<T>` can either be a `Some<T>` (in which case the
|
|
35
|
-
* value does exist) or a `None` (in which case the value does not exist). This
|
|
36
|
-
* module defines a whole lot of FP-inspired utility functions for dealing with
|
|
37
|
-
* `Optional` objects.
|
|
38
|
-
*
|
|
39
|
-
* Comparison with null or undefined:
|
|
40
|
-
* - We don't get fancy null coalescing operators with `Optional`
|
|
41
|
-
* - We do get fancy helper functions with `Optional`
|
|
42
|
-
* - `Optional` support nesting, and allow for the type to still be nullable (or
|
|
43
|
-
* another `Optional`)
|
|
44
|
-
* - There is no option to turn off strict-optional-checks like there is for
|
|
45
|
-
* strict-null-checks
|
|
46
|
-
*/
|
|
47
|
-
class Optional {
|
|
48
|
-
tag;
|
|
49
|
-
value;
|
|
50
|
-
// Sneaky optimisation: every instance of Optional.none is identical, so just
|
|
51
|
-
// reuse the same object
|
|
52
|
-
static singletonNone = new Optional(false);
|
|
53
|
-
// The internal representation has a `tag` and a `value`, but both are
|
|
54
|
-
// private: able to be console.logged, but not able to be accessed by code
|
|
55
|
-
constructor(tag, value) {
|
|
56
|
-
this.tag = tag;
|
|
57
|
-
this.value = value;
|
|
58
|
-
}
|
|
59
|
-
// --- Identities ---
|
|
60
|
-
/**
|
|
61
|
-
* Creates a new `Optional<T>` that **does** contain a value.
|
|
62
|
-
*/
|
|
63
|
-
static some(value) {
|
|
64
|
-
return new Optional(true, value);
|
|
65
|
-
}
|
|
66
|
-
/**
|
|
67
|
-
* Create a new `Optional<T>` that **does not** contain a value. `T` can be
|
|
68
|
-
* any type because we don't actually have a `T`.
|
|
69
|
-
*/
|
|
70
|
-
static none() {
|
|
71
|
-
return Optional.singletonNone;
|
|
72
|
-
}
|
|
73
|
-
/**
|
|
74
|
-
* Perform a transform on an `Optional` type. Regardless of whether this
|
|
75
|
-
* `Optional` contains a value or not, `fold` will return a value of type `U`.
|
|
76
|
-
* If this `Optional` does not contain a value, the `U` will be created by
|
|
77
|
-
* calling `onNone`. If this `Optional` does contain a value, the `U` will be
|
|
78
|
-
* created by calling `onSome`.
|
|
79
|
-
*
|
|
80
|
-
* For the FP enthusiasts in the room, this function:
|
|
81
|
-
* 1. Could be used to implement all of the functions below
|
|
82
|
-
* 2. Forms a catamorphism
|
|
83
|
-
*/
|
|
84
|
-
fold(onNone, onSome) {
|
|
85
|
-
if (this.tag) {
|
|
86
|
-
return onSome(this.value);
|
|
87
|
-
}
|
|
88
|
-
else {
|
|
89
|
-
return onNone();
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
/**
|
|
93
|
-
* Determine if this `Optional` object contains a value.
|
|
94
|
-
*/
|
|
95
|
-
isSome() {
|
|
96
|
-
return this.tag;
|
|
97
|
-
}
|
|
98
|
-
/**
|
|
99
|
-
* Determine if this `Optional` object **does not** contain a value.
|
|
100
|
-
*/
|
|
101
|
-
isNone() {
|
|
102
|
-
return !this.tag;
|
|
103
|
-
}
|
|
104
|
-
// --- Functor (name stolen from Haskell / maths) ---
|
|
105
|
-
/**
|
|
106
|
-
* Perform a transform on an `Optional` object, **if** there is a value. If
|
|
107
|
-
* you provide a function to turn a T into a U, this is the function you use
|
|
108
|
-
* to turn an `Optional<T>` into an `Optional<U>`. If this **does** contain
|
|
109
|
-
* a value then the output will also contain a value (that value being the
|
|
110
|
-
* output of `mapper(this.value)`), and if this **does not** contain a value
|
|
111
|
-
* then neither will the output.
|
|
112
|
-
*/
|
|
113
|
-
map(mapper) {
|
|
114
|
-
if (this.tag) {
|
|
115
|
-
return Optional.some(mapper(this.value));
|
|
116
|
-
}
|
|
117
|
-
else {
|
|
118
|
-
return Optional.none();
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
// --- Monad (name stolen from Haskell / maths) ---
|
|
122
|
-
/**
|
|
123
|
-
* Perform a transform on an `Optional` object, **if** there is a value.
|
|
124
|
-
* Unlike `map`, here the transform itself also returns an `Optional`.
|
|
125
|
-
*/
|
|
126
|
-
bind(binder) {
|
|
127
|
-
if (this.tag) {
|
|
128
|
-
return binder(this.value);
|
|
129
|
-
}
|
|
130
|
-
else {
|
|
131
|
-
return Optional.none();
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
// --- Traversable (name stolen from Haskell / maths) ---
|
|
135
|
-
/**
|
|
136
|
-
* For a given predicate, this function finds out if there **exists** a value
|
|
137
|
-
* inside this `Optional` object that meets the predicate. In practice, this
|
|
138
|
-
* means that for `Optional`s that do not contain a value it returns false (as
|
|
139
|
-
* no predicate-meeting value exists).
|
|
140
|
-
*/
|
|
141
|
-
exists(predicate) {
|
|
142
|
-
return this.tag && predicate(this.value);
|
|
143
|
-
}
|
|
144
|
-
/**
|
|
145
|
-
* For a given predicate, this function finds out if **all** the values inside
|
|
146
|
-
* this `Optional` object meet the predicate. In practice, this means that
|
|
147
|
-
* for `Optional`s that do not contain a value it returns true (as all 0
|
|
148
|
-
* objects do meet the predicate).
|
|
149
|
-
*/
|
|
150
|
-
forall(predicate) {
|
|
151
|
-
return !this.tag || predicate(this.value);
|
|
152
|
-
}
|
|
153
|
-
filter(predicate) {
|
|
154
|
-
if (!this.tag || predicate(this.value)) {
|
|
155
|
-
return this;
|
|
156
|
-
}
|
|
157
|
-
else {
|
|
158
|
-
return Optional.none();
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
// --- Getters ---
|
|
162
|
-
/**
|
|
163
|
-
* Get the value out of the inside of the `Optional` object, using a default
|
|
164
|
-
* `replacement` value if the provided `Optional` object does not contain a
|
|
165
|
-
* value.
|
|
166
|
-
*/
|
|
167
|
-
getOr(replacement) {
|
|
168
|
-
return this.tag ? this.value : replacement;
|
|
169
|
-
}
|
|
170
|
-
/**
|
|
171
|
-
* Get the value out of the inside of the `Optional` object, using a default
|
|
172
|
-
* `replacement` value if the provided `Optional` object does not contain a
|
|
173
|
-
* value. Unlike `getOr`, in this method the `replacement` object is also
|
|
174
|
-
* `Optional` - meaning that this method will always return an `Optional`.
|
|
175
|
-
*/
|
|
176
|
-
or(replacement) {
|
|
177
|
-
return this.tag ? this : replacement;
|
|
178
|
-
}
|
|
179
|
-
/**
|
|
180
|
-
* Get the value out of the inside of the `Optional` object, using a default
|
|
181
|
-
* `replacement` value if the provided `Optional` object does not contain a
|
|
182
|
-
* value. Unlike `getOr`, in this method the `replacement` value is
|
|
183
|
-
* "thunked" - that is to say that you don't pass a value to `getOrThunk`, you
|
|
184
|
-
* pass a function which (if called) will **return** the `value` you want to
|
|
185
|
-
* use.
|
|
186
|
-
*/
|
|
187
|
-
getOrThunk(thunk) {
|
|
188
|
-
return this.tag ? this.value : thunk();
|
|
189
|
-
}
|
|
190
|
-
/**
|
|
191
|
-
* Get the value out of the inside of the `Optional` object, using a default
|
|
192
|
-
* `replacement` value if the provided Optional object does not contain a
|
|
193
|
-
* value.
|
|
194
|
-
*
|
|
195
|
-
* Unlike `or`, in this method the `replacement` value is "thunked" - that is
|
|
196
|
-
* to say that you don't pass a value to `orThunk`, you pass a function which
|
|
197
|
-
* (if called) will **return** the `value` you want to use.
|
|
198
|
-
*
|
|
199
|
-
* Unlike `getOrThunk`, in this method the `replacement` value is also
|
|
200
|
-
* `Optional`, meaning that this method will always return an `Optional`.
|
|
201
|
-
*/
|
|
202
|
-
orThunk(thunk) {
|
|
203
|
-
return this.tag ? this : thunk();
|
|
204
|
-
}
|
|
205
|
-
/**
|
|
206
|
-
* Get the value out of the inside of the `Optional` object, throwing an
|
|
207
|
-
* exception if the provided `Optional` object does not contain a value.
|
|
208
|
-
*
|
|
209
|
-
* WARNING:
|
|
210
|
-
* You should only be using this function if you know that the `Optional`
|
|
211
|
-
* object **is not** empty (otherwise you're throwing exceptions in production
|
|
212
|
-
* code, which is bad).
|
|
213
|
-
*
|
|
214
|
-
* In tests this is more acceptable.
|
|
215
|
-
*
|
|
216
|
-
* Prefer other methods to this, such as `.each`.
|
|
217
|
-
*/
|
|
218
|
-
getOrDie(message) {
|
|
219
|
-
if (!this.tag) {
|
|
220
|
-
throw new Error(message ?? 'Called getOrDie on None');
|
|
221
|
-
}
|
|
222
|
-
else {
|
|
223
|
-
return this.value;
|
|
224
|
-
}
|
|
225
|
-
}
|
|
226
|
-
// --- Interop with null and undefined ---
|
|
227
|
-
/**
|
|
228
|
-
* Creates an `Optional` value from a nullable (or undefined-able) input.
|
|
229
|
-
* Null, or undefined, is converted to `None`, and anything else is converted
|
|
230
|
-
* to `Some`.
|
|
231
|
-
*/
|
|
232
|
-
static from(value) {
|
|
233
|
-
return isNonNullable(value) ? Optional.some(value) : Optional.none();
|
|
234
|
-
}
|
|
235
|
-
/**
|
|
236
|
-
* Converts an `Optional` to a nullable type, by getting the value if it
|
|
237
|
-
* exists, or returning `null` if it does not.
|
|
238
|
-
*/
|
|
239
|
-
getOrNull() {
|
|
240
|
-
return this.tag ? this.value : null;
|
|
241
|
-
}
|
|
242
|
-
/**
|
|
243
|
-
* Converts an `Optional` to an undefined-able type, by getting the value if
|
|
244
|
-
* it exists, or returning `undefined` if it does not.
|
|
245
|
-
*/
|
|
246
|
-
getOrUndefined() {
|
|
247
|
-
return this.value;
|
|
248
|
-
}
|
|
249
|
-
// --- Utilities ---
|
|
250
|
-
/**
|
|
251
|
-
* If the `Optional` contains a value, perform an action on that value.
|
|
252
|
-
* Unlike the rest of the methods on this type, `.each` has side-effects. If
|
|
253
|
-
* you want to transform an `Optional<T>` **into** something, then this is not
|
|
254
|
-
* the method for you. If you want to use an `Optional<T>` to **do**
|
|
255
|
-
* something, then this is the method for you - provided you're okay with not
|
|
256
|
-
* doing anything in the case where the `Optional` doesn't have a value inside
|
|
257
|
-
* it. If you're not sure whether your use-case fits into transforming
|
|
258
|
-
* **into** something or **doing** something, check whether it has a return
|
|
259
|
-
* value. If it does, you should be performing a transform.
|
|
260
|
-
*/
|
|
261
|
-
each(worker) {
|
|
262
|
-
if (this.tag) {
|
|
263
|
-
worker(this.value);
|
|
264
|
-
}
|
|
265
|
-
}
|
|
266
|
-
/**
|
|
267
|
-
* Turn the `Optional` object into an array that contains all of the values
|
|
268
|
-
* stored inside the `Optional`. In practice, this means the output will have
|
|
269
|
-
* either 0 or 1 elements.
|
|
270
|
-
*/
|
|
271
|
-
toArray() {
|
|
272
|
-
return this.tag ? [this.value] : [];
|
|
273
|
-
}
|
|
274
|
-
/**
|
|
275
|
-
* Turn the `Optional` object into a string for debugging or printing. Not
|
|
276
|
-
* recommended for production code, but good for debugging. Also note that
|
|
277
|
-
* these days an `Optional` object can be logged to the console directly, and
|
|
278
|
-
* its inner value (if it exists) will be visible.
|
|
279
|
-
*/
|
|
280
|
-
toString() {
|
|
281
|
-
return this.tag ? `some(${this.value})` : 'none()';
|
|
282
|
-
}
|
|
283
|
-
}
|
|
284
|
-
|
|
285
|
-
const nativeSlice = Array.prototype.slice;
|
|
286
|
-
const exists = (xs, pred) => {
|
|
287
|
-
for (let i = 0, len = xs.length; i < len; i++) {
|
|
288
|
-
const x = xs[i];
|
|
289
|
-
if (pred(x, i)) {
|
|
290
|
-
return true;
|
|
291
|
-
}
|
|
292
|
-
}
|
|
293
|
-
return false;
|
|
294
|
-
};
|
|
295
|
-
const map = (xs, f) => {
|
|
296
|
-
// pre-allocating array size when it's guaranteed to be known
|
|
297
|
-
// http://jsperf.com/push-allocated-vs-dynamic/22
|
|
298
|
-
const len = xs.length;
|
|
299
|
-
const r = new Array(len);
|
|
300
|
-
for (let i = 0; i < len; i++) {
|
|
301
|
-
const x = xs[i];
|
|
302
|
-
r[i] = f(x, i);
|
|
303
|
-
}
|
|
304
|
-
return r;
|
|
305
|
-
};
|
|
306
|
-
// Unwound implementing other functions in terms of each.
|
|
307
|
-
// The code size is roughly the same, and it should allow for better optimisation.
|
|
308
|
-
// const each = function<T, U>(xs: T[], f: (x: T, i?: number, xs?: T[]) => void): void {
|
|
309
|
-
const each = (xs, f) => {
|
|
310
|
-
for (let i = 0, len = xs.length; i < len; i++) {
|
|
311
|
-
const x = xs[i];
|
|
312
|
-
f(x, i);
|
|
313
|
-
}
|
|
314
|
-
};
|
|
315
|
-
const foldl = (xs, f, acc) => {
|
|
316
|
-
each(xs, (x, i) => {
|
|
317
|
-
acc = f(acc, x, i);
|
|
318
|
-
});
|
|
319
|
-
return acc;
|
|
320
|
-
};
|
|
321
|
-
const findUntil = (xs, pred, until) => {
|
|
322
|
-
for (let i = 0, len = xs.length; i < len; i++) {
|
|
323
|
-
const x = xs[i];
|
|
324
|
-
if (pred(x, i)) {
|
|
325
|
-
return Optional.some(x);
|
|
326
|
-
}
|
|
327
|
-
else if (until(x, i)) {
|
|
328
|
-
break;
|
|
329
|
-
}
|
|
330
|
-
}
|
|
331
|
-
return Optional.none();
|
|
332
|
-
};
|
|
333
|
-
const find = (xs, pred) => {
|
|
334
|
-
return findUntil(xs, pred, never);
|
|
335
|
-
};
|
|
336
|
-
const reverse = (xs) => {
|
|
337
|
-
const r = nativeSlice.call(xs, 0);
|
|
338
|
-
r.reverse();
|
|
339
|
-
return r;
|
|
340
|
-
};
|
|
341
|
-
isFunction(Array.from) ? Array.from : (x) => nativeSlice.call(x);
|
|
342
|
-
|
|
343
|
-
/**
|
|
344
|
-
* **Is** the value stored inside this Optional object equal to `rhs`?
|
|
345
|
-
*/
|
|
346
|
-
const is = (lhs, rhs, comparator = tripleEquals) => lhs.exists((left) => comparator(left, rhs));
|
|
347
|
-
|
|
348
|
-
const blank = (r) => (s) => s.replace(r, '');
|
|
349
|
-
/** removes all leading and trailing spaces */
|
|
350
|
-
const trim = blank(/^\s+|\s+$/g);
|
|
351
|
-
const isNotEmpty = (s) => s.length > 0;
|
|
352
|
-
const isEmpty = (s) => !isNotEmpty(s);
|
|
353
|
-
|
|
354
|
-
// Example: 'AB' -> 28
|
|
355
|
-
const parseAlphabeticBase26 = (str) => {
|
|
356
|
-
const chars = reverse(trim(str).split(''));
|
|
357
|
-
const values = map(chars, (char, i) => {
|
|
358
|
-
const charValue = char.toUpperCase().charCodeAt(0) - 'A'.charCodeAt(0) + 1;
|
|
359
|
-
return Math.pow(26, i) * charValue;
|
|
360
|
-
});
|
|
361
|
-
return foldl(values, (sum, v) => sum + v, 0);
|
|
362
|
-
};
|
|
363
|
-
// Example: 28 -> 'AB'
|
|
364
|
-
const composeAlphabeticBase26 = (value) => {
|
|
365
|
-
value--;
|
|
366
|
-
if (value < 0) {
|
|
367
|
-
return '';
|
|
368
|
-
}
|
|
369
|
-
else {
|
|
370
|
-
const remainder = value % 26;
|
|
371
|
-
const quotient = Math.floor(value / 26);
|
|
372
|
-
const rest = composeAlphabeticBase26(quotient);
|
|
373
|
-
const char = String.fromCharCode('A'.charCodeAt(0) + remainder);
|
|
374
|
-
return rest + char;
|
|
375
|
-
}
|
|
376
|
-
};
|
|
377
|
-
const isUppercase = (str) => /^[A-Z]+$/.test(str);
|
|
378
|
-
const isLowercase = (str) => /^[a-z]+$/.test(str);
|
|
379
|
-
const isNumeric = (str) => /^[0-9]+$/.test(str);
|
|
380
|
-
const deduceListType = (start) => {
|
|
381
|
-
if (isNumeric(start)) {
|
|
382
|
-
return 2 /* ListType.Numeric */;
|
|
383
|
-
}
|
|
384
|
-
else if (isUppercase(start)) {
|
|
385
|
-
return 0 /* ListType.UpperAlpha */;
|
|
386
|
-
}
|
|
387
|
-
else if (isLowercase(start)) {
|
|
388
|
-
return 1 /* ListType.LowerAlpha */;
|
|
389
|
-
}
|
|
390
|
-
else if (isEmpty(start)) {
|
|
391
|
-
return 3 /* ListType.None */;
|
|
392
|
-
}
|
|
393
|
-
else {
|
|
394
|
-
return 4 /* ListType.Unknown */;
|
|
395
|
-
}
|
|
396
|
-
};
|
|
397
|
-
const parseStartValue = (start) => {
|
|
398
|
-
switch (deduceListType(start)) {
|
|
399
|
-
case 2 /* ListType.Numeric */:
|
|
400
|
-
return Optional.some({
|
|
401
|
-
listStyleType: Optional.none(),
|
|
402
|
-
start
|
|
403
|
-
});
|
|
404
|
-
case 0 /* ListType.UpperAlpha */:
|
|
405
|
-
return Optional.some({
|
|
406
|
-
listStyleType: Optional.some('upper-alpha'),
|
|
407
|
-
start: parseAlphabeticBase26(start).toString()
|
|
408
|
-
});
|
|
409
|
-
case 1 /* ListType.LowerAlpha */:
|
|
410
|
-
return Optional.some({
|
|
411
|
-
listStyleType: Optional.some('lower-alpha'),
|
|
412
|
-
start: parseAlphabeticBase26(start).toString()
|
|
413
|
-
});
|
|
414
|
-
case 3 /* ListType.None */:
|
|
415
|
-
return Optional.some({
|
|
416
|
-
listStyleType: Optional.none(),
|
|
417
|
-
start: ''
|
|
418
|
-
});
|
|
419
|
-
case 4 /* ListType.Unknown */:
|
|
420
|
-
return Optional.none();
|
|
421
|
-
}
|
|
422
|
-
};
|
|
423
|
-
const parseDetail = (detail) => {
|
|
424
|
-
const start = parseInt(detail.start, 10);
|
|
425
|
-
if (is(detail.listStyleType, 'upper-alpha')) {
|
|
426
|
-
return composeAlphabeticBase26(start);
|
|
427
|
-
}
|
|
428
|
-
else if (is(detail.listStyleType, 'lower-alpha')) {
|
|
429
|
-
return composeAlphabeticBase26(start).toLowerCase();
|
|
430
|
-
}
|
|
431
|
-
else {
|
|
432
|
-
return detail.start;
|
|
433
|
-
}
|
|
434
|
-
};
|
|
435
|
-
|
|
436
|
-
const option = (name) => (editor) => editor.options.get(name);
|
|
437
|
-
const getForcedRootBlock = option('forced_root_block');
|
|
438
|
-
|
|
439
|
-
const isCustomList = (list) => /\btox\-/.test(list.className);
|
|
440
|
-
const matchNodeNames = (regex) => (node) => isNonNullable(node) && regex.test(node.nodeName);
|
|
441
|
-
const matchNodeName = (name) => (node) => isNonNullable(node) && node.nodeName.toLowerCase() === name;
|
|
442
|
-
const isListNode = matchNodeNames(/^(OL|UL|DL)$/);
|
|
443
|
-
const isTableCellNode = matchNodeNames(/^(TH|TD)$/);
|
|
444
|
-
const isListItemNode = matchNodeNames(/^(LI|DT|DD)$/);
|
|
445
|
-
const inList = (parents, listName) => findUntil(parents, isListNode, isTableCellNode)
|
|
446
|
-
.exists((list) => list.nodeName === listName && !isCustomList(list));
|
|
447
|
-
const setNodeChangeHandler = (editor, nodeChangeHandler) => {
|
|
448
|
-
const initialNode = editor.selection.getNode();
|
|
449
|
-
// Set the initial state
|
|
450
|
-
nodeChangeHandler({
|
|
451
|
-
parents: editor.dom.getParents(initialNode),
|
|
452
|
-
element: initialNode
|
|
453
|
-
});
|
|
454
|
-
editor.on('NodeChange', nodeChangeHandler);
|
|
455
|
-
return () => editor.off('NodeChange', nodeChangeHandler);
|
|
456
|
-
};
|
|
457
|
-
const isWithinNonEditable = (editor, element) => element !== null && !editor.dom.isEditable(element);
|
|
458
|
-
const isWithinNonEditableList = (editor, element) => {
|
|
459
|
-
const parentList = editor.dom.getParent(element, 'ol,ul,dl');
|
|
460
|
-
return isWithinNonEditable(editor, parentList) || !editor.selection.isEditable();
|
|
461
|
-
};
|
|
462
|
-
const isOlNode = matchNodeName('ol');
|
|
463
|
-
const listNames = ['OL', 'UL', 'DL'];
|
|
464
|
-
const listSelector = listNames.join(',');
|
|
465
|
-
const getParentList = (editor, node) => {
|
|
466
|
-
const selectionStart = node || editor.selection.getStart(true);
|
|
467
|
-
return editor.dom.getParent(selectionStart, listSelector, getClosestListHost(editor, selectionStart));
|
|
468
|
-
};
|
|
469
|
-
const getClosestListHost = (editor, elm) => {
|
|
470
|
-
const parentBlocks = editor.dom.getParents(elm, editor.dom.isBlock);
|
|
471
|
-
const isNotForcedRootBlock = (elm) => elm.nodeName.toLowerCase() !== getForcedRootBlock(editor);
|
|
472
|
-
const parentBlock = find(parentBlocks, (elm) => isNotForcedRootBlock(elm) && isListHost(editor.schema, elm));
|
|
473
|
-
return parentBlock.getOr(editor.getBody());
|
|
474
|
-
};
|
|
475
|
-
const isListHost = (schema, node) => !isListNode(node) && !isListItemNode(node) && exists(listNames, (listName) => schema.isValidChild(node.nodeName, listName));
|
|
476
|
-
|
|
477
|
-
const open = (editor) => {
|
|
478
|
-
// Find the current list and skip opening if the selection isn't in an ordered list
|
|
479
|
-
const currentList = getParentList(editor);
|
|
480
|
-
if (!isOlNode(currentList) || isWithinNonEditableList(editor, currentList)) {
|
|
481
|
-
return;
|
|
482
|
-
}
|
|
483
|
-
editor.windowManager.open({
|
|
484
|
-
title: 'List Properties',
|
|
485
|
-
body: {
|
|
486
|
-
type: 'panel',
|
|
487
|
-
items: [
|
|
488
|
-
{
|
|
489
|
-
type: 'input',
|
|
490
|
-
name: 'start',
|
|
491
|
-
label: 'Start list at number',
|
|
492
|
-
inputMode: 'numeric'
|
|
493
|
-
}
|
|
494
|
-
]
|
|
495
|
-
},
|
|
496
|
-
initialData: {
|
|
497
|
-
start: parseDetail({
|
|
498
|
-
start: editor.dom.getAttrib(currentList, 'start', '1'),
|
|
499
|
-
listStyleType: Optional.from(editor.dom.getStyle(currentList, 'list-style-type'))
|
|
500
|
-
})
|
|
501
|
-
},
|
|
502
|
-
buttons: [
|
|
503
|
-
{
|
|
504
|
-
type: 'cancel',
|
|
505
|
-
name: 'cancel',
|
|
506
|
-
text: 'Cancel'
|
|
507
|
-
},
|
|
508
|
-
{
|
|
509
|
-
type: 'submit',
|
|
510
|
-
name: 'save',
|
|
511
|
-
text: 'Save',
|
|
512
|
-
primary: true
|
|
513
|
-
}
|
|
514
|
-
],
|
|
515
|
-
onSubmit: (api) => {
|
|
516
|
-
const data = api.getData();
|
|
517
|
-
parseStartValue(data.start).each((detail) => {
|
|
518
|
-
editor.execCommand('mceListUpdate', false, {
|
|
519
|
-
attrs: {
|
|
520
|
-
start: detail.start === '1' ? '' : detail.start
|
|
521
|
-
},
|
|
522
|
-
styles: {
|
|
523
|
-
'list-style-type': detail.listStyleType.getOr('')
|
|
524
|
-
}
|
|
525
|
-
});
|
|
526
|
-
});
|
|
527
|
-
api.close();
|
|
528
|
-
}
|
|
529
|
-
});
|
|
530
|
-
};
|
|
531
|
-
|
|
532
|
-
const register$2 = (editor) => {
|
|
533
|
-
editor.addCommand('mceListProps', () => {
|
|
534
|
-
open(editor);
|
|
535
|
-
});
|
|
536
|
-
};
|
|
537
|
-
|
|
538
|
-
const setupToggleButtonHandler = (editor, listName) => (api) => {
|
|
539
|
-
const toggleButtonHandler = (e) => {
|
|
540
|
-
api.setActive(inList(e.parents, listName));
|
|
541
|
-
api.setEnabled(!isWithinNonEditableList(editor, e.element) && editor.selection.isEditable());
|
|
542
|
-
};
|
|
543
|
-
api.setEnabled(editor.selection.isEditable());
|
|
544
|
-
return setNodeChangeHandler(editor, toggleButtonHandler);
|
|
545
|
-
};
|
|
546
|
-
const register$1 = (editor) => {
|
|
547
|
-
const exec = (command) => () => editor.execCommand(command);
|
|
548
|
-
if (!editor.hasPlugin('advlist')) {
|
|
549
|
-
editor.ui.registry.addToggleButton('numlist', {
|
|
550
|
-
icon: 'ordered-list',
|
|
551
|
-
active: false,
|
|
552
|
-
tooltip: 'Numbered list',
|
|
553
|
-
onAction: exec('InsertOrderedList'),
|
|
554
|
-
onSetup: setupToggleButtonHandler(editor, 'OL')
|
|
555
|
-
});
|
|
556
|
-
editor.ui.registry.addToggleButton('bullist', {
|
|
557
|
-
icon: 'unordered-list',
|
|
558
|
-
active: false,
|
|
559
|
-
tooltip: 'Bullet list',
|
|
560
|
-
onAction: exec('InsertUnorderedList'),
|
|
561
|
-
onSetup: setupToggleButtonHandler(editor, 'UL')
|
|
562
|
-
});
|
|
563
|
-
}
|
|
564
|
-
};
|
|
565
|
-
|
|
566
|
-
const setupMenuButtonHandler = (editor, listName) => (api) => {
|
|
567
|
-
const menuButtonHandler = (e) => api.setEnabled(inList(e.parents, listName) && !isWithinNonEditableList(editor, e.element));
|
|
568
|
-
return setNodeChangeHandler(editor, menuButtonHandler);
|
|
569
|
-
};
|
|
570
|
-
const register = (editor) => {
|
|
571
|
-
const listProperties = {
|
|
572
|
-
text: 'List properties...',
|
|
573
|
-
icon: 'ordered-list',
|
|
574
|
-
onAction: () => editor.execCommand('mceListProps'),
|
|
575
|
-
onSetup: setupMenuButtonHandler(editor, 'OL')
|
|
576
|
-
};
|
|
577
|
-
editor.ui.registry.addMenuItem('listprops', listProperties);
|
|
578
|
-
editor.ui.registry.addContextMenu('lists', {
|
|
579
|
-
update: (node) => {
|
|
580
|
-
const parentList = getParentList(editor, node);
|
|
581
|
-
return isOlNode(parentList) ? ['listprops'] : [];
|
|
582
|
-
}
|
|
583
|
-
});
|
|
584
|
-
};
|
|
585
|
-
|
|
586
|
-
var Plugin = () => {
|
|
587
|
-
global.add('lists', (editor) => {
|
|
588
|
-
register$2(editor);
|
|
589
|
-
register$1(editor);
|
|
590
|
-
register(editor);
|
|
591
|
-
return get(editor);
|
|
592
|
-
});
|
|
593
|
-
};
|
|
594
|
-
|
|
595
|
-
Plugin();
|
|
596
|
-
/** *****
|
|
597
|
-
* DO NOT EXPORT ANYTHING
|
|
598
|
-
*
|
|
599
|
-
* IF YOU DO ROLLUP WILL LEAVE A GLOBAL ON THE PAGE
|
|
600
|
-
*******/
|
|
601
|
-
|
|
602
|
-
})();
|
|
@@ -1 +0,0 @@
|
|
|
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))))}();
|