create-nextjs-cms 0.5.55 → 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.
Files changed (341) hide show
  1. package/package.json +4 -4
  2. package/templates/default/CHANGELOG.md +140 -140
  3. package/templates/default/_gitignore +1 -0
  4. package/templates/default/app/(auth)/auth/login/LoginPage.tsx +14 -11
  5. package/templates/default/app/(rootLayout)/admins/page.tsx +7 -2
  6. package/templates/default/app/(rootLayout)/advanced/page.tsx +8 -2
  7. package/templates/default/app/(rootLayout)/browse/[section]/[page]/page.tsx +17 -3
  8. package/templates/default/app/(rootLayout)/categorized/[section]/page.tsx +9 -1
  9. package/templates/default/app/(rootLayout)/dashboard-new/page.tsx +7 -0
  10. package/templates/default/app/(rootLayout)/edit/[section]/[itemId]/page.tsx +11 -1
  11. package/templates/default/app/(rootLayout)/layout.tsx +8 -1
  12. package/templates/default/app/(rootLayout)/new/[section]/page.tsx +9 -1
  13. package/templates/default/app/(rootLayout)/section/[section]/page.tsx +10 -1
  14. package/templates/default/app/(rootLayout)/settings/page.tsx +7 -1
  15. package/templates/default/app/api/trpc/[trpc]/route.ts +1 -1
  16. package/templates/default/app/api/video/route.ts +1 -1
  17. package/templates/default/app/layout.tsx +5 -3
  18. package/templates/default/app/providers.tsx +10 -9
  19. package/templates/default/apps/cms/node_modules/next/node_modules/_tmp_40516_de1b9f7e36eccb968b79dbd2b8c388ea/LICENSE +191 -0
  20. package/templates/default/apps/cms/node_modules/next/node_modules/_tmp_40516_de1b9f7e36eccb968b79dbd2b8c388ea/README.md +118 -0
  21. package/templates/default/apps/cms/node_modules/next/node_modules/_tmp_40516_de1b9f7e36eccb968b79dbd2b8c388ea/install/build.js +38 -0
  22. package/templates/default/apps/cms/node_modules/next/node_modules/_tmp_40516_de1b9f7e36eccb968b79dbd2b8c388ea/install/check.js +14 -0
  23. package/templates/default/apps/cms/node_modules/next/node_modules/_tmp_40516_de1b9f7e36eccb968b79dbd2b8c388ea/lib/channel.js +177 -0
  24. package/templates/default/apps/cms/node_modules/next/node_modules/_tmp_40516_de1b9f7e36eccb968b79dbd2b8c388ea/lib/colour.js +195 -0
  25. package/templates/default/apps/cms/node_modules/next/node_modules/_tmp_40516_de1b9f7e36eccb968b79dbd2b8c388ea/lib/composite.js +212 -0
  26. package/templates/default/apps/cms/node_modules/next/node_modules/_tmp_40516_de1b9f7e36eccb968b79dbd2b8c388ea/lib/constructor.js +499 -0
  27. package/templates/default/apps/cms/node_modules/next/node_modules/_tmp_40516_de1b9f7e36eccb968b79dbd2b8c388ea/lib/index.d.ts +1971 -0
  28. package/templates/default/apps/cms/node_modules/next/node_modules/_tmp_40516_de1b9f7e36eccb968b79dbd2b8c388ea/lib/index.js +16 -0
  29. package/templates/default/apps/cms/node_modules/next/node_modules/_tmp_40516_de1b9f7e36eccb968b79dbd2b8c388ea/lib/input.js +809 -0
  30. package/templates/default/apps/cms/node_modules/next/node_modules/_tmp_40516_de1b9f7e36eccb968b79dbd2b8c388ea/lib/is.js +143 -0
  31. package/templates/default/apps/cms/node_modules/next/node_modules/_tmp_40516_de1b9f7e36eccb968b79dbd2b8c388ea/lib/libvips.js +207 -0
  32. package/templates/default/apps/cms/node_modules/next/node_modules/_tmp_40516_de1b9f7e36eccb968b79dbd2b8c388ea/lib/operation.js +1016 -0
  33. package/templates/default/apps/cms/node_modules/next/node_modules/_tmp_40516_de1b9f7e36eccb968b79dbd2b8c388ea/lib/output.js +1666 -0
  34. package/templates/default/apps/cms/node_modules/next/node_modules/_tmp_40516_de1b9f7e36eccb968b79dbd2b8c388ea/lib/resize.js +595 -0
  35. package/templates/default/apps/cms/node_modules/next/node_modules/_tmp_40516_de1b9f7e36eccb968b79dbd2b8c388ea/lib/sharp.js +121 -0
  36. package/templates/default/apps/cms/node_modules/next/node_modules/_tmp_40516_de1b9f7e36eccb968b79dbd2b8c388ea/lib/utility.js +291 -0
  37. package/templates/default/apps/cms/node_modules/next/node_modules/_tmp_40516_de1b9f7e36eccb968b79dbd2b8c388ea/package.json +202 -0
  38. package/templates/default/apps/cms/node_modules/next/node_modules/_tmp_40516_de1b9f7e36eccb968b79dbd2b8c388ea/src/binding.gyp +298 -0
  39. package/templates/default/apps/cms/node_modules/next/node_modules/_tmp_40516_de1b9f7e36eccb968b79dbd2b8c388ea/src/common.cc +1130 -0
  40. package/templates/default/apps/cms/node_modules/next/node_modules/_tmp_40516_de1b9f7e36eccb968b79dbd2b8c388ea/src/common.h +402 -0
  41. package/templates/default/apps/cms/node_modules/next/node_modules/_tmp_40516_de1b9f7e36eccb968b79dbd2b8c388ea/src/metadata.cc +346 -0
  42. package/templates/default/apps/cms/node_modules/next/node_modules/_tmp_40516_de1b9f7e36eccb968b79dbd2b8c388ea/src/metadata.h +90 -0
  43. package/templates/default/apps/cms/node_modules/next/node_modules/_tmp_40516_de1b9f7e36eccb968b79dbd2b8c388ea/src/operations.cc +499 -0
  44. package/templates/default/apps/cms/node_modules/next/node_modules/_tmp_40516_de1b9f7e36eccb968b79dbd2b8c388ea/src/operations.h +137 -0
  45. package/templates/default/apps/cms/node_modules/next/node_modules/_tmp_40516_de1b9f7e36eccb968b79dbd2b8c388ea/src/pipeline.cc +1814 -0
  46. package/templates/default/apps/cms/node_modules/next/node_modules/_tmp_40516_de1b9f7e36eccb968b79dbd2b8c388ea/src/pipeline.h +408 -0
  47. package/templates/default/apps/cms/node_modules/next/node_modules/_tmp_40516_de1b9f7e36eccb968b79dbd2b8c388ea/src/sharp.cc +43 -0
  48. package/templates/default/apps/cms/node_modules/next/node_modules/_tmp_40516_de1b9f7e36eccb968b79dbd2b8c388ea/src/stats.cc +186 -0
  49. package/templates/default/apps/cms/node_modules/next/node_modules/_tmp_40516_de1b9f7e36eccb968b79dbd2b8c388ea/src/stats.h +62 -0
  50. package/templates/default/apps/cms/node_modules/next/node_modules/_tmp_40516_de1b9f7e36eccb968b79dbd2b8c388ea/src/utilities.cc +288 -0
  51. package/templates/default/apps/cms/node_modules/next/node_modules/_tmp_40516_de1b9f7e36eccb968b79dbd2b8c388ea/src/utilities.h +22 -0
  52. package/templates/default/components/BrowsePage.tsx +4 -4
  53. package/templates/default/components/DashboardNewPage.tsx +252 -0
  54. package/templates/default/components/Layout.tsx +2 -2
  55. package/templates/default/components/LogPage.tsx +2 -3
  56. package/templates/default/components/NavbarAlt.tsx +5 -5
  57. package/templates/default/components/SettingsPage.tsx +1 -1
  58. package/templates/default/components/Sidebar.tsx +7 -7
  59. package/templates/default/components/form/Form.tsx +5 -5
  60. package/templates/default/components/form/helpers/util.ts +5 -5
  61. package/templates/default/dynamic-schemas/schema.ts +381 -381
  62. package/templates/default/next-env.d.ts +1 -1
  63. package/templates/default/next.config.ts +24 -0
  64. package/templates/default/package.json +23 -17
  65. package/templates/default/{middleware.ts → proxy.ts} +3 -4
  66. package/templates/default/test/prize.section.ts +58 -0
  67. package/templates/default/tsconfig.json +6 -3
  68. package/templates/default/app/api/placeholder/route.ts +0 -7
  69. package/templates/default/components/form/helpers/_section-hot-reload.js +0 -11
  70. package/templates/default/public/tinymce/CHANGELOG.md +0 -3940
  71. package/templates/default/public/tinymce/README.md +0 -77
  72. package/templates/default/public/tinymce/bower.json +0 -27
  73. package/templates/default/public/tinymce/composer.json +0 -52
  74. package/templates/default/public/tinymce/icons/default/icons.js +0 -239
  75. package/templates/default/public/tinymce/icons/default/icons.min.js +0 -1
  76. package/templates/default/public/tinymce/icons/default/index.js +0 -7
  77. package/templates/default/public/tinymce/license.md +0 -9
  78. package/templates/default/public/tinymce/models/dom/index.js +0 -7
  79. package/templates/default/public/tinymce/models/dom/model.js +0 -8980
  80. package/templates/default/public/tinymce/models/dom/model.min.js +0 -1
  81. package/templates/default/public/tinymce/notices.txt +0 -21
  82. package/templates/default/public/tinymce/package.json +0 -32
  83. package/templates/default/public/tinymce/plugins/accordion/index.js +0 -7
  84. package/templates/default/public/tinymce/plugins/accordion/plugin.js +0 -1373
  85. package/templates/default/public/tinymce/plugins/accordion/plugin.min.js +0 -1
  86. package/templates/default/public/tinymce/plugins/advlist/index.js +0 -7
  87. package/templates/default/public/tinymce/plugins/advlist/plugin.js +0 -473
  88. package/templates/default/public/tinymce/plugins/advlist/plugin.min.js +0 -1
  89. package/templates/default/public/tinymce/plugins/anchor/index.js +0 -7
  90. package/templates/default/public/tinymce/plugins/anchor/plugin.js +0 -237
  91. package/templates/default/public/tinymce/plugins/anchor/plugin.min.js +0 -1
  92. package/templates/default/public/tinymce/plugins/autolink/index.js +0 -7
  93. package/templates/default/public/tinymce/plugins/autolink/plugin.js +0 -315
  94. package/templates/default/public/tinymce/plugins/autolink/plugin.min.js +0 -1
  95. package/templates/default/public/tinymce/plugins/autoresize/index.js +0 -7
  96. package/templates/default/public/tinymce/plugins/autoresize/plugin.js +0 -221
  97. package/templates/default/public/tinymce/plugins/autoresize/plugin.min.js +0 -1
  98. package/templates/default/public/tinymce/plugins/autosave/index.js +0 -7
  99. package/templates/default/public/tinymce/plugins/autosave/plugin.js +0 -249
  100. package/templates/default/public/tinymce/plugins/autosave/plugin.min.js +0 -1
  101. package/templates/default/public/tinymce/plugins/charmap/index.js +0 -7
  102. package/templates/default/public/tinymce/plugins/charmap/plugin.js +0 -997
  103. package/templates/default/public/tinymce/plugins/charmap/plugin.min.js +0 -1
  104. package/templates/default/public/tinymce/plugins/code/index.js +0 -7
  105. package/templates/default/public/tinymce/plugins/code/plugin.js +0 -98
  106. package/templates/default/public/tinymce/plugins/code/plugin.min.js +0 -1
  107. package/templates/default/public/tinymce/plugins/codesample/index.js +0 -7
  108. package/templates/default/public/tinymce/plugins/codesample/plugin.js +0 -3655
  109. package/templates/default/public/tinymce/plugins/codesample/plugin.min.js +0 -9
  110. package/templates/default/public/tinymce/plugins/directionality/index.js +0 -7
  111. package/templates/default/public/tinymce/plugins/directionality/plugin.js +0 -634
  112. package/templates/default/public/tinymce/plugins/directionality/plugin.min.js +0 -1
  113. package/templates/default/public/tinymce/plugins/emoticons/index.js +0 -7
  114. package/templates/default/public/tinymce/plugins/emoticons/js/emojiimages.js +0 -1
  115. package/templates/default/public/tinymce/plugins/emoticons/js/emojiimages.min.js +0 -1
  116. package/templates/default/public/tinymce/plugins/emoticons/js/emojis.js +0 -1
  117. package/templates/default/public/tinymce/plugins/emoticons/js/emojis.min.js +0 -1
  118. package/templates/default/public/tinymce/plugins/emoticons/plugin.js +0 -809
  119. package/templates/default/public/tinymce/plugins/emoticons/plugin.min.js +0 -1
  120. package/templates/default/public/tinymce/plugins/fullscreen/index.js +0 -7
  121. package/templates/default/public/tinymce/plugins/fullscreen/plugin.js +0 -1607
  122. package/templates/default/public/tinymce/plugins/fullscreen/plugin.min.js +0 -1
  123. package/templates/default/public/tinymce/plugins/help/index.js +0 -7
  124. package/templates/default/public/tinymce/plugins/help/js/i18n/keynav/ar.js +0 -93
  125. package/templates/default/public/tinymce/plugins/help/js/i18n/keynav/bg-BG.js +0 -93
  126. package/templates/default/public/tinymce/plugins/help/js/i18n/keynav/bg_BG.js +0 -93
  127. package/templates/default/public/tinymce/plugins/help/js/i18n/keynav/ca.js +0 -93
  128. package/templates/default/public/tinymce/plugins/help/js/i18n/keynav/cs.js +0 -93
  129. package/templates/default/public/tinymce/plugins/help/js/i18n/keynav/da.js +0 -93
  130. package/templates/default/public/tinymce/plugins/help/js/i18n/keynav/de.js +0 -93
  131. package/templates/default/public/tinymce/plugins/help/js/i18n/keynav/el.js +0 -93
  132. package/templates/default/public/tinymce/plugins/help/js/i18n/keynav/en.js +0 -93
  133. package/templates/default/public/tinymce/plugins/help/js/i18n/keynav/es.js +0 -93
  134. package/templates/default/public/tinymce/plugins/help/js/i18n/keynav/eu.js +0 -93
  135. package/templates/default/public/tinymce/plugins/help/js/i18n/keynav/fa.js +0 -93
  136. package/templates/default/public/tinymce/plugins/help/js/i18n/keynav/fi.js +0 -93
  137. package/templates/default/public/tinymce/plugins/help/js/i18n/keynav/fr-FR.js +0 -93
  138. package/templates/default/public/tinymce/plugins/help/js/i18n/keynav/fr_FR.js +0 -93
  139. package/templates/default/public/tinymce/plugins/help/js/i18n/keynav/he-IL.js +0 -93
  140. package/templates/default/public/tinymce/plugins/help/js/i18n/keynav/he_IL.js +0 -93
  141. package/templates/default/public/tinymce/plugins/help/js/i18n/keynav/hi.js +0 -93
  142. package/templates/default/public/tinymce/plugins/help/js/i18n/keynav/hr.js +0 -93
  143. package/templates/default/public/tinymce/plugins/help/js/i18n/keynav/hu-HU.js +0 -93
  144. package/templates/default/public/tinymce/plugins/help/js/i18n/keynav/hu_HU.js +0 -93
  145. package/templates/default/public/tinymce/plugins/help/js/i18n/keynav/id.js +0 -93
  146. package/templates/default/public/tinymce/plugins/help/js/i18n/keynav/it.js +0 -93
  147. package/templates/default/public/tinymce/plugins/help/js/i18n/keynav/ja.js +0 -93
  148. package/templates/default/public/tinymce/plugins/help/js/i18n/keynav/kk.js +0 -93
  149. package/templates/default/public/tinymce/plugins/help/js/i18n/keynav/ko-KR.js +0 -93
  150. package/templates/default/public/tinymce/plugins/help/js/i18n/keynav/ko_KR.js +0 -93
  151. package/templates/default/public/tinymce/plugins/help/js/i18n/keynav/ms.js +0 -93
  152. package/templates/default/public/tinymce/plugins/help/js/i18n/keynav/nb-NO.js +0 -93
  153. package/templates/default/public/tinymce/plugins/help/js/i18n/keynav/nb_NO.js +0 -93
  154. package/templates/default/public/tinymce/plugins/help/js/i18n/keynav/nl.js +0 -93
  155. package/templates/default/public/tinymce/plugins/help/js/i18n/keynav/pl.js +0 -93
  156. package/templates/default/public/tinymce/plugins/help/js/i18n/keynav/pt-BR.js +0 -93
  157. package/templates/default/public/tinymce/plugins/help/js/i18n/keynav/pt-PT.js +0 -93
  158. package/templates/default/public/tinymce/plugins/help/js/i18n/keynav/pt_BR.js +0 -93
  159. package/templates/default/public/tinymce/plugins/help/js/i18n/keynav/pt_PT.js +0 -93
  160. package/templates/default/public/tinymce/plugins/help/js/i18n/keynav/ro.js +0 -93
  161. package/templates/default/public/tinymce/plugins/help/js/i18n/keynav/ru.js +0 -93
  162. package/templates/default/public/tinymce/plugins/help/js/i18n/keynav/sk.js +0 -93
  163. package/templates/default/public/tinymce/plugins/help/js/i18n/keynav/sl-SI.js +0 -93
  164. package/templates/default/public/tinymce/plugins/help/js/i18n/keynav/sl_SI.js +0 -93
  165. package/templates/default/public/tinymce/plugins/help/js/i18n/keynav/sv-SE.js +0 -93
  166. package/templates/default/public/tinymce/plugins/help/js/i18n/keynav/sv_SE.js +0 -93
  167. package/templates/default/public/tinymce/plugins/help/js/i18n/keynav/th-TH.js +0 -93
  168. package/templates/default/public/tinymce/plugins/help/js/i18n/keynav/th_TH.js +0 -93
  169. package/templates/default/public/tinymce/plugins/help/js/i18n/keynav/tr.js +0 -93
  170. package/templates/default/public/tinymce/plugins/help/js/i18n/keynav/uk.js +0 -93
  171. package/templates/default/public/tinymce/plugins/help/js/i18n/keynav/vi.js +0 -93
  172. package/templates/default/public/tinymce/plugins/help/js/i18n/keynav/zh-CN.js +0 -87
  173. package/templates/default/public/tinymce/plugins/help/js/i18n/keynav/zh-TW.js +0 -93
  174. package/templates/default/public/tinymce/plugins/help/js/i18n/keynav/zh_CN.js +0 -87
  175. package/templates/default/public/tinymce/plugins/help/js/i18n/keynav/zh_TW.js +0 -93
  176. package/templates/default/public/tinymce/plugins/help/plugin.js +0 -826
  177. package/templates/default/public/tinymce/plugins/help/plugin.min.js +0 -1
  178. package/templates/default/public/tinymce/plugins/image/index.js +0 -7
  179. package/templates/default/public/tinymce/plugins/image/plugin.js +0 -1691
  180. package/templates/default/public/tinymce/plugins/image/plugin.min.js +0 -1
  181. package/templates/default/public/tinymce/plugins/importcss/index.js +0 -7
  182. package/templates/default/public/tinymce/plugins/importcss/plugin.js +0 -401
  183. package/templates/default/public/tinymce/plugins/importcss/plugin.min.js +0 -1
  184. package/templates/default/public/tinymce/plugins/insertdatetime/index.js +0 -7
  185. package/templates/default/public/tinymce/plugins/insertdatetime/plugin.js +0 -187
  186. package/templates/default/public/tinymce/plugins/insertdatetime/plugin.min.js +0 -1
  187. package/templates/default/public/tinymce/plugins/link/index.js +0 -7
  188. package/templates/default/public/tinymce/plugins/link/plugin.js +0 -1709
  189. package/templates/default/public/tinymce/plugins/link/plugin.min.js +0 -1
  190. package/templates/default/public/tinymce/plugins/lists/index.js +0 -7
  191. package/templates/default/public/tinymce/plugins/lists/plugin.js +0 -602
  192. package/templates/default/public/tinymce/plugins/lists/plugin.min.js +0 -1
  193. package/templates/default/public/tinymce/plugins/media/index.js +0 -7
  194. package/templates/default/public/tinymce/plugins/media/plugin.js +0 -1442
  195. package/templates/default/public/tinymce/plugins/media/plugin.min.js +0 -1
  196. package/templates/default/public/tinymce/plugins/nonbreaking/index.js +0 -7
  197. package/templates/default/public/tinymce/plugins/nonbreaking/plugin.js +0 -128
  198. package/templates/default/public/tinymce/plugins/nonbreaking/plugin.min.js +0 -1
  199. package/templates/default/public/tinymce/plugins/pagebreak/index.js +0 -7
  200. package/templates/default/public/tinymce/plugins/pagebreak/plugin.js +0 -123
  201. package/templates/default/public/tinymce/plugins/pagebreak/plugin.min.js +0 -1
  202. package/templates/default/public/tinymce/plugins/preview/index.js +0 -7
  203. package/templates/default/public/tinymce/plugins/preview/plugin.js +0 -843
  204. package/templates/default/public/tinymce/plugins/preview/plugin.min.js +0 -1
  205. package/templates/default/public/tinymce/plugins/quickbars/index.js +0 -7
  206. package/templates/default/public/tinymce/plugins/quickbars/plugin.js +0 -654
  207. package/templates/default/public/tinymce/plugins/quickbars/plugin.min.js +0 -1
  208. package/templates/default/public/tinymce/plugins/save/index.js +0 -7
  209. package/templates/default/public/tinymce/plugins/save/plugin.js +0 -136
  210. package/templates/default/public/tinymce/plugins/save/plugin.min.js +0 -1
  211. package/templates/default/public/tinymce/plugins/searchreplace/index.js +0 -7
  212. package/templates/default/public/tinymce/plugins/searchreplace/plugin.js +0 -1367
  213. package/templates/default/public/tinymce/plugins/searchreplace/plugin.min.js +0 -1
  214. package/templates/default/public/tinymce/plugins/table/index.js +0 -7
  215. package/templates/default/public/tinymce/plugins/table/plugin.js +0 -4008
  216. package/templates/default/public/tinymce/plugins/table/plugin.min.js +0 -1
  217. package/templates/default/public/tinymce/plugins/visualblocks/index.js +0 -7
  218. package/templates/default/public/tinymce/plugins/visualblocks/plugin.js +0 -106
  219. package/templates/default/public/tinymce/plugins/visualblocks/plugin.min.js +0 -1
  220. package/templates/default/public/tinymce/plugins/visualchars/index.js +0 -7
  221. package/templates/default/public/tinymce/plugins/visualchars/plugin.js +0 -808
  222. package/templates/default/public/tinymce/plugins/visualchars/plugin.min.js +0 -1
  223. package/templates/default/public/tinymce/plugins/wordcount/index.js +0 -7
  224. package/templates/default/public/tinymce/plugins/wordcount/plugin.js +0 -480
  225. package/templates/default/public/tinymce/plugins/wordcount/plugin.min.js +0 -1
  226. package/templates/default/public/tinymce/skins/content/dark/content.css +0 -75
  227. package/templates/default/public/tinymce/skins/content/dark/content.js +0 -10
  228. package/templates/default/public/tinymce/skins/content/dark/content.min.css +0 -10
  229. package/templates/default/public/tinymce/skins/content/dark/content.min.ts +0 -3
  230. package/templates/default/public/tinymce/skins/content/dark/content.ts +0 -3
  231. package/templates/default/public/tinymce/skins/content/default/content.css +0 -70
  232. package/templates/default/public/tinymce/skins/content/default/content.js +0 -10
  233. package/templates/default/public/tinymce/skins/content/default/content.min.css +0 -10
  234. package/templates/default/public/tinymce/skins/content/default/content.min.ts +0 -3
  235. package/templates/default/public/tinymce/skins/content/default/content.ts +0 -3
  236. package/templates/default/public/tinymce/skins/content/document/content.css +0 -75
  237. package/templates/default/public/tinymce/skins/content/document/content.js +0 -10
  238. package/templates/default/public/tinymce/skins/content/document/content.min.css +0 -10
  239. package/templates/default/public/tinymce/skins/content/document/content.min.ts +0 -3
  240. package/templates/default/public/tinymce/skins/content/document/content.ts +0 -3
  241. package/templates/default/public/tinymce/skins/content/tinymce-5/content.css +0 -70
  242. package/templates/default/public/tinymce/skins/content/tinymce-5/content.js +0 -10
  243. package/templates/default/public/tinymce/skins/content/tinymce-5/content.min.css +0 -10
  244. package/templates/default/public/tinymce/skins/content/tinymce-5/content.min.ts +0 -3
  245. package/templates/default/public/tinymce/skins/content/tinymce-5/content.ts +0 -3
  246. package/templates/default/public/tinymce/skins/content/tinymce-5-dark/content.css +0 -75
  247. package/templates/default/public/tinymce/skins/content/tinymce-5-dark/content.js +0 -10
  248. package/templates/default/public/tinymce/skins/content/tinymce-5-dark/content.min.css +0 -10
  249. package/templates/default/public/tinymce/skins/content/tinymce-5-dark/content.min.ts +0 -3
  250. package/templates/default/public/tinymce/skins/content/tinymce-5-dark/content.ts +0 -3
  251. package/templates/default/public/tinymce/skins/content/writer/content.css +0 -71
  252. package/templates/default/public/tinymce/skins/content/writer/content.js +0 -10
  253. package/templates/default/public/tinymce/skins/content/writer/content.min.css +0 -10
  254. package/templates/default/public/tinymce/skins/content/writer/content.min.ts +0 -3
  255. package/templates/default/public/tinymce/skins/content/writer/content.ts +0 -3
  256. package/templates/default/public/tinymce/skins/ui/oxide/content.css +0 -1037
  257. package/templates/default/public/tinymce/skins/ui/oxide/content.inline.css +0 -1031
  258. package/templates/default/public/tinymce/skins/ui/oxide/content.inline.js +0 -10
  259. package/templates/default/public/tinymce/skins/ui/oxide/content.inline.min.css +0 -10
  260. package/templates/default/public/tinymce/skins/ui/oxide/content.inline.min.ts +0 -116
  261. package/templates/default/public/tinymce/skins/ui/oxide/content.inline.ts +0 -116
  262. package/templates/default/public/tinymce/skins/ui/oxide/content.js +0 -10
  263. package/templates/default/public/tinymce/skins/ui/oxide/content.min.css +0 -10
  264. package/templates/default/public/tinymce/skins/ui/oxide/content.min.ts +0 -116
  265. package/templates/default/public/tinymce/skins/ui/oxide/content.ts +0 -116
  266. package/templates/default/public/tinymce/skins/ui/oxide/skin.css +0 -5615
  267. package/templates/default/public/tinymce/skins/ui/oxide/skin.js +0 -1
  268. package/templates/default/public/tinymce/skins/ui/oxide/skin.min.css +0 -1
  269. package/templates/default/public/tinymce/skins/ui/oxide/skin.min.ts +0 -507
  270. package/templates/default/public/tinymce/skins/ui/oxide/skin.shadowdom.css +0 -30
  271. package/templates/default/public/tinymce/skins/ui/oxide/skin.shadowdom.js +0 -1
  272. package/templates/default/public/tinymce/skins/ui/oxide/skin.shadowdom.min.css +0 -1
  273. package/templates/default/public/tinymce/skins/ui/oxide/skin.shadowdom.min.ts +0 -9
  274. package/templates/default/public/tinymce/skins/ui/oxide/skin.shadowdom.ts +0 -9
  275. package/templates/default/public/tinymce/skins/ui/oxide/skin.ts +0 -507
  276. package/templates/default/public/tinymce/skins/ui/oxide-dark/content.css +0 -1025
  277. package/templates/default/public/tinymce/skins/ui/oxide-dark/content.inline.css +0 -1031
  278. package/templates/default/public/tinymce/skins/ui/oxide-dark/content.inline.js +0 -10
  279. package/templates/default/public/tinymce/skins/ui/oxide-dark/content.inline.min.css +0 -10
  280. package/templates/default/public/tinymce/skins/ui/oxide-dark/content.inline.min.ts +0 -116
  281. package/templates/default/public/tinymce/skins/ui/oxide-dark/content.inline.ts +0 -116
  282. package/templates/default/public/tinymce/skins/ui/oxide-dark/content.js +0 -10
  283. package/templates/default/public/tinymce/skins/ui/oxide-dark/content.min.css +0 -10
  284. package/templates/default/public/tinymce/skins/ui/oxide-dark/content.min.ts +0 -116
  285. package/templates/default/public/tinymce/skins/ui/oxide-dark/content.ts +0 -116
  286. package/templates/default/public/tinymce/skins/ui/oxide-dark/skin.css +0 -5618
  287. package/templates/default/public/tinymce/skins/ui/oxide-dark/skin.js +0 -1
  288. package/templates/default/public/tinymce/skins/ui/oxide-dark/skin.min.css +0 -1
  289. package/templates/default/public/tinymce/skins/ui/oxide-dark/skin.min.ts +0 -507
  290. package/templates/default/public/tinymce/skins/ui/oxide-dark/skin.shadowdom.css +0 -30
  291. package/templates/default/public/tinymce/skins/ui/oxide-dark/skin.shadowdom.js +0 -1
  292. package/templates/default/public/tinymce/skins/ui/oxide-dark/skin.shadowdom.min.css +0 -1
  293. package/templates/default/public/tinymce/skins/ui/oxide-dark/skin.shadowdom.min.ts +0 -9
  294. package/templates/default/public/tinymce/skins/ui/oxide-dark/skin.shadowdom.ts +0 -9
  295. package/templates/default/public/tinymce/skins/ui/oxide-dark/skin.ts +0 -507
  296. package/templates/default/public/tinymce/skins/ui/tinymce-5/content.css +0 -1037
  297. package/templates/default/public/tinymce/skins/ui/tinymce-5/content.inline.css +0 -1031
  298. package/templates/default/public/tinymce/skins/ui/tinymce-5/content.inline.js +0 -10
  299. package/templates/default/public/tinymce/skins/ui/tinymce-5/content.inline.min.css +0 -10
  300. package/templates/default/public/tinymce/skins/ui/tinymce-5/content.inline.min.ts +0 -116
  301. package/templates/default/public/tinymce/skins/ui/tinymce-5/content.inline.ts +0 -116
  302. package/templates/default/public/tinymce/skins/ui/tinymce-5/content.js +0 -10
  303. package/templates/default/public/tinymce/skins/ui/tinymce-5/content.min.css +0 -10
  304. package/templates/default/public/tinymce/skins/ui/tinymce-5/content.min.ts +0 -116
  305. package/templates/default/public/tinymce/skins/ui/tinymce-5/content.ts +0 -116
  306. package/templates/default/public/tinymce/skins/ui/tinymce-5/skin.css +0 -5734
  307. package/templates/default/public/tinymce/skins/ui/tinymce-5/skin.js +0 -1
  308. package/templates/default/public/tinymce/skins/ui/tinymce-5/skin.min.css +0 -1
  309. package/templates/default/public/tinymce/skins/ui/tinymce-5/skin.min.ts +0 -508
  310. package/templates/default/public/tinymce/skins/ui/tinymce-5/skin.shadowdom.css +0 -30
  311. package/templates/default/public/tinymce/skins/ui/tinymce-5/skin.shadowdom.js +0 -1
  312. package/templates/default/public/tinymce/skins/ui/tinymce-5/skin.shadowdom.min.css +0 -1
  313. package/templates/default/public/tinymce/skins/ui/tinymce-5/skin.shadowdom.min.ts +0 -9
  314. package/templates/default/public/tinymce/skins/ui/tinymce-5/skin.shadowdom.ts +0 -9
  315. package/templates/default/public/tinymce/skins/ui/tinymce-5/skin.ts +0 -508
  316. package/templates/default/public/tinymce/skins/ui/tinymce-5-dark/content.css +0 -1025
  317. package/templates/default/public/tinymce/skins/ui/tinymce-5-dark/content.inline.css +0 -1031
  318. package/templates/default/public/tinymce/skins/ui/tinymce-5-dark/content.inline.js +0 -10
  319. package/templates/default/public/tinymce/skins/ui/tinymce-5-dark/content.inline.min.css +0 -10
  320. package/templates/default/public/tinymce/skins/ui/tinymce-5-dark/content.inline.min.ts +0 -116
  321. package/templates/default/public/tinymce/skins/ui/tinymce-5-dark/content.inline.ts +0 -116
  322. package/templates/default/public/tinymce/skins/ui/tinymce-5-dark/content.js +0 -10
  323. package/templates/default/public/tinymce/skins/ui/tinymce-5-dark/content.min.css +0 -10
  324. package/templates/default/public/tinymce/skins/ui/tinymce-5-dark/content.min.ts +0 -116
  325. package/templates/default/public/tinymce/skins/ui/tinymce-5-dark/content.ts +0 -116
  326. package/templates/default/public/tinymce/skins/ui/tinymce-5-dark/skin.css +0 -5734
  327. package/templates/default/public/tinymce/skins/ui/tinymce-5-dark/skin.js +0 -1
  328. package/templates/default/public/tinymce/skins/ui/tinymce-5-dark/skin.min.css +0 -1
  329. package/templates/default/public/tinymce/skins/ui/tinymce-5-dark/skin.min.ts +0 -508
  330. package/templates/default/public/tinymce/skins/ui/tinymce-5-dark/skin.shadowdom.css +0 -30
  331. package/templates/default/public/tinymce/skins/ui/tinymce-5-dark/skin.shadowdom.js +0 -1
  332. package/templates/default/public/tinymce/skins/ui/tinymce-5-dark/skin.shadowdom.min.css +0 -1
  333. package/templates/default/public/tinymce/skins/ui/tinymce-5-dark/skin.shadowdom.min.ts +0 -9
  334. package/templates/default/public/tinymce/skins/ui/tinymce-5-dark/skin.shadowdom.ts +0 -9
  335. package/templates/default/public/tinymce/skins/ui/tinymce-5-dark/skin.ts +0 -508
  336. package/templates/default/public/tinymce/themes/silver/index.js +0 -7
  337. package/templates/default/public/tinymce/themes/silver/theme.js +0 -34748
  338. package/templates/default/public/tinymce/themes/silver/theme.min.js +0 -1
  339. package/templates/default/public/tinymce/tinymce.d.ts +0 -3413
  340. package/templates/default/public/tinymce/tinymce.js +0 -41518
  341. package/templates/default/public/tinymce/tinymce.min.js +0 -10
@@ -1,808 +0,0 @@
1
- /**
2
- * TinyMCE version 8.3.1 (2025-12-17)
3
- */
4
-
5
- (function () {
6
- 'use strict';
7
-
8
- /* eslint-disable @typescript-eslint/no-wrapper-object-types */
9
- const hasProto = (v, constructor, predicate) => {
10
- if (predicate(v, constructor.prototype)) {
11
- return true;
12
- }
13
- else {
14
- // String-based fallback time
15
- return v.constructor?.name === constructor.name;
16
- }
17
- };
18
- const typeOf = (x) => {
19
- const t = typeof x;
20
- if (x === null) {
21
- return 'null';
22
- }
23
- else if (t === 'object' && Array.isArray(x)) {
24
- return 'array';
25
- }
26
- else if (t === 'object' && hasProto(x, String, (o, proto) => proto.isPrototypeOf(o))) {
27
- return 'string';
28
- }
29
- else {
30
- return t;
31
- }
32
- };
33
- const isType$1 = (type) => (value) => typeOf(value) === type;
34
- const isSimpleType = (type) => (value) => typeof value === type;
35
- const eq = (t) => (a) => t === a;
36
- const isString = isType$1('string');
37
- const isObject = isType$1('object');
38
- const isNull = eq(null);
39
- const isBoolean = isSimpleType('boolean');
40
- const isNullable = (a) => a === null || a === undefined;
41
- const isNonNullable = (a) => !isNullable(a);
42
- const isFunction = isSimpleType('function');
43
- const isNumber = isSimpleType('number');
44
-
45
- /**
46
- * The `Optional` type represents a value (of any type) that potentially does
47
- * not exist. Any `Optional<T>` can either be a `Some<T>` (in which case the
48
- * value does exist) or a `None` (in which case the value does not exist). This
49
- * module defines a whole lot of FP-inspired utility functions for dealing with
50
- * `Optional` objects.
51
- *
52
- * Comparison with null or undefined:
53
- * - We don't get fancy null coalescing operators with `Optional`
54
- * - We do get fancy helper functions with `Optional`
55
- * - `Optional` support nesting, and allow for the type to still be nullable (or
56
- * another `Optional`)
57
- * - There is no option to turn off strict-optional-checks like there is for
58
- * strict-null-checks
59
- */
60
- class Optional {
61
- tag;
62
- value;
63
- // Sneaky optimisation: every instance of Optional.none is identical, so just
64
- // reuse the same object
65
- static singletonNone = new Optional(false);
66
- // The internal representation has a `tag` and a `value`, but both are
67
- // private: able to be console.logged, but not able to be accessed by code
68
- constructor(tag, value) {
69
- this.tag = tag;
70
- this.value = value;
71
- }
72
- // --- Identities ---
73
- /**
74
- * Creates a new `Optional<T>` that **does** contain a value.
75
- */
76
- static some(value) {
77
- return new Optional(true, value);
78
- }
79
- /**
80
- * Create a new `Optional<T>` that **does not** contain a value. `T` can be
81
- * any type because we don't actually have a `T`.
82
- */
83
- static none() {
84
- return Optional.singletonNone;
85
- }
86
- /**
87
- * Perform a transform on an `Optional` type. Regardless of whether this
88
- * `Optional` contains a value or not, `fold` will return a value of type `U`.
89
- * If this `Optional` does not contain a value, the `U` will be created by
90
- * calling `onNone`. If this `Optional` does contain a value, the `U` will be
91
- * created by calling `onSome`.
92
- *
93
- * For the FP enthusiasts in the room, this function:
94
- * 1. Could be used to implement all of the functions below
95
- * 2. Forms a catamorphism
96
- */
97
- fold(onNone, onSome) {
98
- if (this.tag) {
99
- return onSome(this.value);
100
- }
101
- else {
102
- return onNone();
103
- }
104
- }
105
- /**
106
- * Determine if this `Optional` object contains a value.
107
- */
108
- isSome() {
109
- return this.tag;
110
- }
111
- /**
112
- * Determine if this `Optional` object **does not** contain a value.
113
- */
114
- isNone() {
115
- return !this.tag;
116
- }
117
- // --- Functor (name stolen from Haskell / maths) ---
118
- /**
119
- * Perform a transform on an `Optional` object, **if** there is a value. If
120
- * you provide a function to turn a T into a U, this is the function you use
121
- * to turn an `Optional<T>` into an `Optional<U>`. If this **does** contain
122
- * a value then the output will also contain a value (that value being the
123
- * output of `mapper(this.value)`), and if this **does not** contain a value
124
- * then neither will the output.
125
- */
126
- map(mapper) {
127
- if (this.tag) {
128
- return Optional.some(mapper(this.value));
129
- }
130
- else {
131
- return Optional.none();
132
- }
133
- }
134
- // --- Monad (name stolen from Haskell / maths) ---
135
- /**
136
- * Perform a transform on an `Optional` object, **if** there is a value.
137
- * Unlike `map`, here the transform itself also returns an `Optional`.
138
- */
139
- bind(binder) {
140
- if (this.tag) {
141
- return binder(this.value);
142
- }
143
- else {
144
- return Optional.none();
145
- }
146
- }
147
- // --- Traversable (name stolen from Haskell / maths) ---
148
- /**
149
- * For a given predicate, this function finds out if there **exists** a value
150
- * inside this `Optional` object that meets the predicate. In practice, this
151
- * means that for `Optional`s that do not contain a value it returns false (as
152
- * no predicate-meeting value exists).
153
- */
154
- exists(predicate) {
155
- return this.tag && predicate(this.value);
156
- }
157
- /**
158
- * For a given predicate, this function finds out if **all** the values inside
159
- * this `Optional` object meet the predicate. In practice, this means that
160
- * for `Optional`s that do not contain a value it returns true (as all 0
161
- * objects do meet the predicate).
162
- */
163
- forall(predicate) {
164
- return !this.tag || predicate(this.value);
165
- }
166
- filter(predicate) {
167
- if (!this.tag || predicate(this.value)) {
168
- return this;
169
- }
170
- else {
171
- return Optional.none();
172
- }
173
- }
174
- // --- Getters ---
175
- /**
176
- * Get the value out of the inside of the `Optional` object, using a default
177
- * `replacement` value if the provided `Optional` object does not contain a
178
- * value.
179
- */
180
- getOr(replacement) {
181
- return this.tag ? this.value : replacement;
182
- }
183
- /**
184
- * Get the value out of the inside of the `Optional` object, using a default
185
- * `replacement` value if the provided `Optional` object does not contain a
186
- * value. Unlike `getOr`, in this method the `replacement` object is also
187
- * `Optional` - meaning that this method will always return an `Optional`.
188
- */
189
- or(replacement) {
190
- return this.tag ? this : replacement;
191
- }
192
- /**
193
- * Get the value out of the inside of the `Optional` object, using a default
194
- * `replacement` value if the provided `Optional` object does not contain a
195
- * value. Unlike `getOr`, in this method the `replacement` value is
196
- * "thunked" - that is to say that you don't pass a value to `getOrThunk`, you
197
- * pass a function which (if called) will **return** the `value` you want to
198
- * use.
199
- */
200
- getOrThunk(thunk) {
201
- return this.tag ? this.value : thunk();
202
- }
203
- /**
204
- * Get the value out of the inside of the `Optional` object, using a default
205
- * `replacement` value if the provided Optional object does not contain a
206
- * value.
207
- *
208
- * Unlike `or`, in this method the `replacement` value is "thunked" - that is
209
- * to say that you don't pass a value to `orThunk`, you pass a function which
210
- * (if called) will **return** the `value` you want to use.
211
- *
212
- * Unlike `getOrThunk`, in this method the `replacement` value is also
213
- * `Optional`, meaning that this method will always return an `Optional`.
214
- */
215
- orThunk(thunk) {
216
- return this.tag ? this : thunk();
217
- }
218
- /**
219
- * Get the value out of the inside of the `Optional` object, throwing an
220
- * exception if the provided `Optional` object does not contain a value.
221
- *
222
- * WARNING:
223
- * You should only be using this function if you know that the `Optional`
224
- * object **is not** empty (otherwise you're throwing exceptions in production
225
- * code, which is bad).
226
- *
227
- * In tests this is more acceptable.
228
- *
229
- * Prefer other methods to this, such as `.each`.
230
- */
231
- getOrDie(message) {
232
- if (!this.tag) {
233
- throw new Error(message ?? 'Called getOrDie on None');
234
- }
235
- else {
236
- return this.value;
237
- }
238
- }
239
- // --- Interop with null and undefined ---
240
- /**
241
- * Creates an `Optional` value from a nullable (or undefined-able) input.
242
- * Null, or undefined, is converted to `None`, and anything else is converted
243
- * to `Some`.
244
- */
245
- static from(value) {
246
- return isNonNullable(value) ? Optional.some(value) : Optional.none();
247
- }
248
- /**
249
- * Converts an `Optional` to a nullable type, by getting the value if it
250
- * exists, or returning `null` if it does not.
251
- */
252
- getOrNull() {
253
- return this.tag ? this.value : null;
254
- }
255
- /**
256
- * Converts an `Optional` to an undefined-able type, by getting the value if
257
- * it exists, or returning `undefined` if it does not.
258
- */
259
- getOrUndefined() {
260
- return this.value;
261
- }
262
- // --- Utilities ---
263
- /**
264
- * If the `Optional` contains a value, perform an action on that value.
265
- * Unlike the rest of the methods on this type, `.each` has side-effects. If
266
- * you want to transform an `Optional<T>` **into** something, then this is not
267
- * the method for you. If you want to use an `Optional<T>` to **do**
268
- * something, then this is the method for you - provided you're okay with not
269
- * doing anything in the case where the `Optional` doesn't have a value inside
270
- * it. If you're not sure whether your use-case fits into transforming
271
- * **into** something or **doing** something, check whether it has a return
272
- * value. If it does, you should be performing a transform.
273
- */
274
- each(worker) {
275
- if (this.tag) {
276
- worker(this.value);
277
- }
278
- }
279
- /**
280
- * Turn the `Optional` object into an array that contains all of the values
281
- * stored inside the `Optional`. In practice, this means the output will have
282
- * either 0 or 1 elements.
283
- */
284
- toArray() {
285
- return this.tag ? [this.value] : [];
286
- }
287
- /**
288
- * Turn the `Optional` object into a string for debugging or printing. Not
289
- * recommended for production code, but good for debugging. Also note that
290
- * these days an `Optional` object can be logged to the console directly, and
291
- * its inner value (if it exists) will be visible.
292
- */
293
- toString() {
294
- return this.tag ? `some(${this.value})` : 'none()';
295
- }
296
- }
297
-
298
- const nativeSlice = Array.prototype.slice;
299
- const map = (xs, f) => {
300
- // pre-allocating array size when it's guaranteed to be known
301
- // http://jsperf.com/push-allocated-vs-dynamic/22
302
- const len = xs.length;
303
- const r = new Array(len);
304
- for (let i = 0; i < len; i++) {
305
- const x = xs[i];
306
- r[i] = f(x, i);
307
- }
308
- return r;
309
- };
310
- // Unwound implementing other functions in terms of each.
311
- // The code size is roughly the same, and it should allow for better optimisation.
312
- // const each = function<T, U>(xs: T[], f: (x: T, i?: number, xs?: T[]) => void): void {
313
- const each$1 = (xs, f) => {
314
- for (let i = 0, len = xs.length; i < len; i++) {
315
- const x = xs[i];
316
- f(x, i);
317
- }
318
- };
319
- const filter = (xs, pred) => {
320
- const r = [];
321
- for (let i = 0, len = xs.length; i < len; i++) {
322
- const x = xs[i];
323
- if (pred(x, i)) {
324
- r.push(x);
325
- }
326
- }
327
- return r;
328
- };
329
- isFunction(Array.from) ? Array.from : (x) => nativeSlice.call(x);
330
-
331
- // There are many variations of Object iteration that are faster than the 'for-in' style:
332
- // http://jsperf.com/object-keys-iteration/107
333
- //
334
- // Use the native keys if it is available (IE9+), otherwise fall back to manually filtering
335
- const keys = Object.keys;
336
- const each = (obj, f) => {
337
- const props = keys(obj);
338
- for (let k = 0, len = props.length; k < len; k++) {
339
- const i = props[k];
340
- const x = obj[i];
341
- f(x, i);
342
- }
343
- };
344
-
345
- const Cell = (initial) => {
346
- let value = initial;
347
- const get = () => {
348
- return value;
349
- };
350
- const set = (v) => {
351
- value = v;
352
- };
353
- return {
354
- get,
355
- set
356
- };
357
- };
358
-
359
- // Use window object as the global if it's available since CSP will block script evals
360
- // eslint-disable-next-line @typescript-eslint/no-implied-eval
361
- const Global = typeof window !== 'undefined' ? window : Function('return this;')();
362
-
363
- /** path :: ([String], JsObj?) -> JsObj */
364
- const path = (parts, scope) => {
365
- let o = scope !== undefined && scope !== null ? scope : Global;
366
- for (let i = 0; i < parts.length && o !== undefined && o !== null; ++i) {
367
- o = o[parts[i]];
368
- }
369
- return o;
370
- };
371
- /** resolve :: (String, JsObj?) -> JsObj */
372
- const resolve = (p, scope) => {
373
- const parts = p.split('.');
374
- return path(parts, scope);
375
- };
376
-
377
- // Run a function fn after rate ms. If another invocation occurs
378
- // during the time it is waiting, ignore it completely.
379
- const first = (fn, rate) => {
380
- let timer = null;
381
- const cancel = () => {
382
- if (!isNull(timer)) {
383
- clearTimeout(timer);
384
- timer = null;
385
- }
386
- };
387
- const throttle = (...args) => {
388
- if (isNull(timer)) {
389
- timer = setTimeout(() => {
390
- timer = null;
391
- fn.apply(null, args);
392
- }, rate);
393
- }
394
- };
395
- return {
396
- cancel,
397
- throttle
398
- };
399
- };
400
-
401
- var global = tinymce.util.Tools.resolve('tinymce.PluginManager');
402
-
403
- const get$2 = (toggleState) => {
404
- const isEnabled = () => {
405
- return toggleState.get();
406
- };
407
- return {
408
- isEnabled
409
- };
410
- };
411
-
412
- const fireVisualChars = (editor, state) => {
413
- return editor.dispatch('VisualChars', { state });
414
- };
415
-
416
- const fromHtml = (html, scope) => {
417
- const doc = scope || document;
418
- const div = doc.createElement('div');
419
- div.innerHTML = html;
420
- if (!div.hasChildNodes() || div.childNodes.length > 1) {
421
- const message = 'HTML does not have a single root node';
422
- // eslint-disable-next-line no-console
423
- console.error(message, html);
424
- throw new Error(message);
425
- }
426
- return fromDom(div.childNodes[0]);
427
- };
428
- const fromTag = (tag, scope) => {
429
- const doc = scope || document;
430
- const node = doc.createElement(tag);
431
- return fromDom(node);
432
- };
433
- const fromText = (text, scope) => {
434
- const doc = scope || document;
435
- const node = doc.createTextNode(text);
436
- return fromDom(node);
437
- };
438
- const fromDom = (node) => {
439
- // TODO: Consider removing this check, but left atm for safety
440
- if (node === null || node === undefined) {
441
- throw new Error('Node cannot be null or undefined');
442
- }
443
- return {
444
- dom: node
445
- };
446
- };
447
- const fromPoint = (docElm, x, y) => Optional.from(docElm.dom.elementFromPoint(x, y)).map(fromDom);
448
- // tslint:disable-next-line:variable-name
449
- const SugarElement = {
450
- fromHtml,
451
- fromTag,
452
- fromText,
453
- fromDom,
454
- fromPoint
455
- };
456
-
457
- const ELEMENT = 1;
458
- const TEXT = 3;
459
-
460
- const unsafe = (name, scope) => {
461
- return resolve(name, scope);
462
- };
463
- const getOrDie = (name, scope) => {
464
- const actual = unsafe(name, scope);
465
- if (actual === undefined || actual === null) {
466
- throw new Error(name + ' not available on this browser');
467
- }
468
- return actual;
469
- };
470
-
471
- const getPrototypeOf = Object.getPrototypeOf;
472
- /*
473
- * IE9 and above
474
- *
475
- * MDN no use on this one, but here's the link anyway:
476
- * https://developer.mozilla.org/en/docs/Web/API/HTMLElement
477
- */
478
- const sandHTMLElement = (scope) => {
479
- return getOrDie('HTMLElement', scope);
480
- };
481
- const isPrototypeOf = (x) => {
482
- // use Resolve to get the window object for x and just return undefined if it can't find it.
483
- // undefined scope later triggers using the global window.
484
- const scope = resolve('ownerDocument.defaultView', x);
485
- // TINY-7374: We can't rely on looking at the owner window HTMLElement as the element may have
486
- // been constructed in a different window and then appended to the current window document.
487
- return isObject(x) && (sandHTMLElement(scope).prototype.isPrototypeOf(x) || /^HTML\w*Element$/.test(getPrototypeOf(x).constructor.name));
488
- };
489
-
490
- const type = (element) => element.dom.nodeType;
491
- const value = (element) => element.dom.nodeValue;
492
- const isType = (t) => (element) => type(element) === t;
493
- const isHTMLElement = (element) => isElement(element) && isPrototypeOf(element.dom);
494
- const isElement = isType(ELEMENT);
495
- const isText = isType(TEXT);
496
-
497
- const rawSet = (dom, key, value) => {
498
- /*
499
- * JQuery coerced everything to a string, and silently did nothing on text node/null/undefined.
500
- *
501
- * We fail on those invalid cases, only allowing numbers and booleans.
502
- */
503
- if (isString(value) || isBoolean(value) || isNumber(value)) {
504
- dom.setAttribute(key, value + '');
505
- }
506
- else {
507
- // eslint-disable-next-line no-console
508
- console.error('Invalid call to Attribute.set. Key ', key, ':: Value ', value, ':: Element ', dom);
509
- throw new Error('Attribute value was not simple');
510
- }
511
- };
512
- const set = (element, key, value) => {
513
- rawSet(element.dom, key, value);
514
- };
515
- const get$1 = (element, key) => {
516
- const v = element.dom.getAttribute(key);
517
- // undefined is the more appropriate value for JS, and this matches JQuery
518
- return v === null ? undefined : v;
519
- };
520
- const remove$3 = (element, key) => {
521
- element.dom.removeAttribute(key);
522
- };
523
-
524
- // Methods for handling attributes that contain a list of values <div foo="alpha beta theta">
525
- const read = (element, attr) => {
526
- const value = get$1(element, attr);
527
- return value === undefined || value === '' ? [] : value.split(' ');
528
- };
529
- const add$2 = (element, attr, id) => {
530
- const old = read(element, attr);
531
- const nu = old.concat([id]);
532
- set(element, attr, nu.join(' '));
533
- return true;
534
- };
535
- const remove$2 = (element, attr, id) => {
536
- const nu = filter(read(element, attr), (v) => v !== id);
537
- if (nu.length > 0) {
538
- set(element, attr, nu.join(' '));
539
- }
540
- else {
541
- remove$3(element, attr);
542
- }
543
- return false;
544
- };
545
-
546
- // IE11 Can return undefined for a classList on elements such as math, so we make sure it's not undefined before attempting to use it.
547
- const supports = (element) => element.dom.classList !== undefined;
548
- const get = (element) => read(element, 'class');
549
- const add$1 = (element, clazz) => add$2(element, 'class', clazz);
550
- const remove$1 = (element, clazz) => remove$2(element, 'class', clazz);
551
-
552
- /*
553
- * ClassList is IE10 minimum:
554
- * https://developer.mozilla.org/en-US/docs/Web/API/Element.classList
555
- *
556
- * Note that IE doesn't support the second argument to toggle (at all).
557
- * If it did, the toggler could be better.
558
- */
559
- const add = (element, clazz) => {
560
- if (supports(element)) {
561
- element.dom.classList.add(clazz);
562
- }
563
- else {
564
- add$1(element, clazz);
565
- }
566
- };
567
- const cleanClass = (element) => {
568
- const classList = supports(element) ? element.dom.classList : get(element);
569
- // classList is a "live list", so this is up to date already
570
- if (classList.length === 0) {
571
- // No more classes left, remove the class attribute as well
572
- remove$3(element, 'class');
573
- }
574
- };
575
- const remove = (element, clazz) => {
576
- if (supports(element)) {
577
- const classList = element.dom.classList;
578
- classList.remove(clazz);
579
- }
580
- else {
581
- remove$1(element, clazz);
582
- }
583
- cleanClass(element);
584
- };
585
-
586
- const getRaw = (element) => element.dom.contentEditable;
587
-
588
- const charMap = {
589
- '\u00a0': 'nbsp',
590
- '\u00ad': 'shy'
591
- };
592
- const charMapToRegExp = (charMap, global) => {
593
- let regExp = '';
594
- each(charMap, (_value, key) => {
595
- regExp += key;
596
- });
597
- return new RegExp('[' + regExp + ']', global ? 'g' : '');
598
- };
599
- const charMapToSelector = (charMap) => {
600
- let selector = '';
601
- each(charMap, (value) => {
602
- if (selector) {
603
- selector += ',';
604
- }
605
- selector += 'span.mce-' + value;
606
- });
607
- return selector;
608
- };
609
- const regExp = charMapToRegExp(charMap);
610
- const regExpGlobal = charMapToRegExp(charMap, true);
611
- const selector = charMapToSelector(charMap);
612
- const nbspClass = 'mce-nbsp';
613
-
614
- const wrapCharWithSpan = (value) => '<span data-mce-bogus="1" class="mce-' + charMap[value] + '">' + value + '</span>';
615
-
616
- const isWrappedNbsp = (node) => node.nodeName.toLowerCase() === 'span' && node.classList.contains('mce-nbsp-wrap');
617
- const isMatch = (n) => {
618
- const value$1 = value(n);
619
- return isText(n) &&
620
- isString(value$1) &&
621
- regExp.test(value$1);
622
- };
623
- const isContentEditableFalse = (node) => isHTMLElement(node) && getRaw(node) === 'false';
624
- const isChildEditable = (node, currentState) => {
625
- if (isHTMLElement(node) && !isWrappedNbsp(node.dom)) {
626
- const value = getRaw(node);
627
- if (value === 'true') {
628
- return true;
629
- }
630
- else if (value === 'false') {
631
- return false;
632
- }
633
- }
634
- return currentState;
635
- };
636
- // inlined sugars PredicateFilter.descendants for file size but also make it only act on editable nodes it changes the current editable state when it traveses down
637
- const filterEditableDescendants = (scope, predicate, editable) => {
638
- let result = [];
639
- const dom = scope.dom;
640
- const children = map(dom.childNodes, SugarElement.fromDom);
641
- const isEditable = (node) => isWrappedNbsp(node.dom) || !isContentEditableFalse(node);
642
- each$1(children, (x) => {
643
- if (editable && isEditable(x) && predicate(x)) {
644
- result = result.concat([x]);
645
- }
646
- result = result.concat(filterEditableDescendants(x, predicate, isChildEditable(x, editable)));
647
- });
648
- return result;
649
- };
650
- const findParentElm = (elm, rootElm) => {
651
- while (elm.parentNode) {
652
- if (elm.parentNode === rootElm) {
653
- return rootElm;
654
- }
655
- elm = elm.parentNode;
656
- }
657
- return undefined;
658
- };
659
- const replaceWithSpans = (text) => text.replace(regExpGlobal, wrapCharWithSpan);
660
-
661
- const show = (editor, rootElm) => {
662
- const dom = editor.dom;
663
- const nodeList = filterEditableDescendants(SugarElement.fromDom(rootElm), isMatch, editor.dom.isEditable(rootElm));
664
- each$1(nodeList, (n) => {
665
- const parent = n.dom.parentNode;
666
- if (isWrappedNbsp(parent)) {
667
- add(SugarElement.fromDom(parent), nbspClass);
668
- }
669
- else {
670
- const withSpans = replaceWithSpans(dom.encode(value(n) ?? ''));
671
- const div = dom.create('div', {}, withSpans);
672
- let node;
673
- while ((node = div.lastChild)) {
674
- dom.insertAfter(node, n.dom);
675
- }
676
- editor.dom.remove(n.dom);
677
- }
678
- });
679
- };
680
- const hide = (editor, rootElm) => {
681
- const nodeList = editor.dom.select(selector, rootElm);
682
- each$1(nodeList, (node) => {
683
- if (isWrappedNbsp(node)) {
684
- remove(SugarElement.fromDom(node), nbspClass);
685
- }
686
- else {
687
- editor.dom.remove(node, true);
688
- }
689
- });
690
- };
691
- const toggle = (editor) => {
692
- const body = editor.getBody();
693
- const bookmark = editor.selection.getBookmark();
694
- let parentNode = findParentElm(editor.selection.getNode(), body);
695
- // if user does select all the parentNode will be undefined
696
- parentNode = parentNode !== undefined ? parentNode : body;
697
- hide(editor, parentNode);
698
- show(editor, parentNode);
699
- editor.selection.moveToBookmark(bookmark);
700
- };
701
-
702
- const applyVisualChars = (editor, toggleState) => {
703
- fireVisualChars(editor, toggleState.get());
704
- const body = editor.getBody();
705
- if (toggleState.get() === true) {
706
- show(editor, body);
707
- }
708
- else {
709
- hide(editor, body);
710
- }
711
- };
712
- // Toggle state and save selection bookmark before applying visualChars
713
- const toggleVisualChars = (editor, toggleState) => {
714
- toggleState.set(!toggleState.get());
715
- const bookmark = editor.selection.getBookmark();
716
- applyVisualChars(editor, toggleState);
717
- editor.selection.moveToBookmark(bookmark);
718
- };
719
-
720
- const register$2 = (editor, toggleState) => {
721
- editor.addCommand('mceVisualChars', () => {
722
- toggleVisualChars(editor, toggleState);
723
- });
724
- };
725
-
726
- const option = (name) => (editor) => editor.options.get(name);
727
- const register$1 = (editor) => {
728
- const registerOption = editor.options.register;
729
- registerOption('visualchars_default_state', {
730
- processor: 'boolean',
731
- default: false
732
- });
733
- };
734
- const isEnabledByDefault = option('visualchars_default_state');
735
-
736
- const setup$1 = (editor, toggleState) => {
737
- /*
738
- Note: applyVisualChars does not place a bookmark before modifying the DOM on init.
739
- This will cause a loss of selection if the following conditions are met:
740
- - Autofocus enabled, or editor is manually focused on init
741
- - The first piece of text in the editor must be a nbsp
742
- - Integrator has manually set the selection before init
743
-
744
- Another improvement would be to ensure DOM elements aren't destroyed/recreated,
745
- but rather wrapped/unwrapped when applying styling for visualchars so that selection
746
- is not lost.
747
- */
748
- editor.on('init', () => {
749
- applyVisualChars(editor, toggleState);
750
- });
751
- };
752
-
753
- const setup = (editor, toggleState) => {
754
- const debouncedToggle = first(() => {
755
- toggle(editor);
756
- }, 300);
757
- editor.on('keydown', (e) => {
758
- if (toggleState.get() === true) {
759
- e.keyCode === 13 ? toggle(editor) : debouncedToggle.throttle();
760
- }
761
- });
762
- editor.on('remove', debouncedToggle.cancel);
763
- };
764
-
765
- const toggleActiveState = (editor, enabledStated) => (api) => {
766
- api.setActive(enabledStated.get());
767
- const editorEventCallback = (e) => api.setActive(e.state);
768
- editor.on('VisualChars', editorEventCallback);
769
- return () => editor.off('VisualChars', editorEventCallback);
770
- };
771
- const register = (editor, toggleState) => {
772
- const onAction = () => editor.execCommand('mceVisualChars');
773
- editor.ui.registry.addToggleButton('visualchars', {
774
- tooltip: 'Show invisible characters',
775
- icon: 'visualchars',
776
- onAction,
777
- onSetup: toggleActiveState(editor, toggleState),
778
- context: 'any'
779
- });
780
- editor.ui.registry.addToggleMenuItem('visualchars', {
781
- text: 'Show invisible characters',
782
- icon: 'visualchars',
783
- onAction,
784
- onSetup: toggleActiveState(editor, toggleState),
785
- context: 'any'
786
- });
787
- };
788
-
789
- var Plugin = () => {
790
- global.add('visualchars', (editor) => {
791
- register$1(editor);
792
- const toggleState = Cell(isEnabledByDefault(editor));
793
- register$2(editor, toggleState);
794
- register(editor, toggleState);
795
- setup(editor, toggleState);
796
- setup$1(editor, toggleState);
797
- return get$2(toggleState);
798
- });
799
- };
800
-
801
- Plugin();
802
- /** *****
803
- * DO NOT EXPORT ANYTHING
804
- *
805
- * IF YOU DO ROLLUP WILL LEAVE A GLOBAL ON THE PAGE
806
- *******/
807
-
808
- })();