create-nextjs-cms 0.5.56 → 0.5.60

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 (336) 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/(rootLayout)/admins/page.tsx +7 -2
  5. package/templates/default/app/(rootLayout)/advanced/page.tsx +8 -2
  6. package/templates/default/app/(rootLayout)/browse/[section]/[page]/page.tsx +17 -3
  7. package/templates/default/app/(rootLayout)/categorized/[section]/page.tsx +9 -1
  8. package/templates/default/app/(rootLayout)/dashboard-new/page.tsx +7 -0
  9. package/templates/default/app/(rootLayout)/edit/[section]/[itemId]/page.tsx +11 -1
  10. package/templates/default/app/(rootLayout)/layout.tsx +8 -1
  11. package/templates/default/app/(rootLayout)/new/[section]/page.tsx +9 -1
  12. package/templates/default/app/(rootLayout)/section/[section]/page.tsx +10 -1
  13. package/templates/default/app/(rootLayout)/settings/page.tsx +7 -1
  14. package/templates/default/app/api/trpc/[trpc]/route.ts +1 -1
  15. package/templates/default/app/api/video/route.ts +1 -1
  16. package/templates/default/app/layout.tsx +1 -1
  17. package/templates/default/app/providers.tsx +4 -4
  18. package/templates/default/apps/cms/node_modules/next/node_modules/_tmp_40516_de1b9f7e36eccb968b79dbd2b8c388ea/LICENSE +191 -0
  19. package/templates/default/apps/cms/node_modules/next/node_modules/_tmp_40516_de1b9f7e36eccb968b79dbd2b8c388ea/README.md +118 -0
  20. package/templates/default/apps/cms/node_modules/next/node_modules/_tmp_40516_de1b9f7e36eccb968b79dbd2b8c388ea/install/build.js +38 -0
  21. package/templates/default/apps/cms/node_modules/next/node_modules/_tmp_40516_de1b9f7e36eccb968b79dbd2b8c388ea/install/check.js +14 -0
  22. package/templates/default/apps/cms/node_modules/next/node_modules/_tmp_40516_de1b9f7e36eccb968b79dbd2b8c388ea/lib/channel.js +177 -0
  23. package/templates/default/apps/cms/node_modules/next/node_modules/_tmp_40516_de1b9f7e36eccb968b79dbd2b8c388ea/lib/colour.js +195 -0
  24. package/templates/default/apps/cms/node_modules/next/node_modules/_tmp_40516_de1b9f7e36eccb968b79dbd2b8c388ea/lib/composite.js +212 -0
  25. package/templates/default/apps/cms/node_modules/next/node_modules/_tmp_40516_de1b9f7e36eccb968b79dbd2b8c388ea/lib/constructor.js +499 -0
  26. package/templates/default/apps/cms/node_modules/next/node_modules/_tmp_40516_de1b9f7e36eccb968b79dbd2b8c388ea/lib/index.d.ts +1971 -0
  27. package/templates/default/apps/cms/node_modules/next/node_modules/_tmp_40516_de1b9f7e36eccb968b79dbd2b8c388ea/lib/index.js +16 -0
  28. package/templates/default/apps/cms/node_modules/next/node_modules/_tmp_40516_de1b9f7e36eccb968b79dbd2b8c388ea/lib/input.js +809 -0
  29. package/templates/default/apps/cms/node_modules/next/node_modules/_tmp_40516_de1b9f7e36eccb968b79dbd2b8c388ea/lib/is.js +143 -0
  30. package/templates/default/apps/cms/node_modules/next/node_modules/_tmp_40516_de1b9f7e36eccb968b79dbd2b8c388ea/lib/libvips.js +207 -0
  31. package/templates/default/apps/cms/node_modules/next/node_modules/_tmp_40516_de1b9f7e36eccb968b79dbd2b8c388ea/lib/operation.js +1016 -0
  32. package/templates/default/apps/cms/node_modules/next/node_modules/_tmp_40516_de1b9f7e36eccb968b79dbd2b8c388ea/lib/output.js +1666 -0
  33. package/templates/default/apps/cms/node_modules/next/node_modules/_tmp_40516_de1b9f7e36eccb968b79dbd2b8c388ea/lib/resize.js +595 -0
  34. package/templates/default/apps/cms/node_modules/next/node_modules/_tmp_40516_de1b9f7e36eccb968b79dbd2b8c388ea/lib/sharp.js +121 -0
  35. package/templates/default/apps/cms/node_modules/next/node_modules/_tmp_40516_de1b9f7e36eccb968b79dbd2b8c388ea/lib/utility.js +291 -0
  36. package/templates/default/apps/cms/node_modules/next/node_modules/_tmp_40516_de1b9f7e36eccb968b79dbd2b8c388ea/package.json +202 -0
  37. package/templates/default/apps/cms/node_modules/next/node_modules/_tmp_40516_de1b9f7e36eccb968b79dbd2b8c388ea/src/binding.gyp +298 -0
  38. package/templates/default/apps/cms/node_modules/next/node_modules/_tmp_40516_de1b9f7e36eccb968b79dbd2b8c388ea/src/common.cc +1130 -0
  39. package/templates/default/apps/cms/node_modules/next/node_modules/_tmp_40516_de1b9f7e36eccb968b79dbd2b8c388ea/src/common.h +402 -0
  40. package/templates/default/apps/cms/node_modules/next/node_modules/_tmp_40516_de1b9f7e36eccb968b79dbd2b8c388ea/src/metadata.cc +346 -0
  41. package/templates/default/apps/cms/node_modules/next/node_modules/_tmp_40516_de1b9f7e36eccb968b79dbd2b8c388ea/src/metadata.h +90 -0
  42. package/templates/default/apps/cms/node_modules/next/node_modules/_tmp_40516_de1b9f7e36eccb968b79dbd2b8c388ea/src/operations.cc +499 -0
  43. package/templates/default/apps/cms/node_modules/next/node_modules/_tmp_40516_de1b9f7e36eccb968b79dbd2b8c388ea/src/operations.h +137 -0
  44. package/templates/default/apps/cms/node_modules/next/node_modules/_tmp_40516_de1b9f7e36eccb968b79dbd2b8c388ea/src/pipeline.cc +1814 -0
  45. package/templates/default/apps/cms/node_modules/next/node_modules/_tmp_40516_de1b9f7e36eccb968b79dbd2b8c388ea/src/pipeline.h +408 -0
  46. package/templates/default/apps/cms/node_modules/next/node_modules/_tmp_40516_de1b9f7e36eccb968b79dbd2b8c388ea/src/sharp.cc +43 -0
  47. package/templates/default/apps/cms/node_modules/next/node_modules/_tmp_40516_de1b9f7e36eccb968b79dbd2b8c388ea/src/stats.cc +186 -0
  48. package/templates/default/apps/cms/node_modules/next/node_modules/_tmp_40516_de1b9f7e36eccb968b79dbd2b8c388ea/src/stats.h +62 -0
  49. package/templates/default/apps/cms/node_modules/next/node_modules/_tmp_40516_de1b9f7e36eccb968b79dbd2b8c388ea/src/utilities.cc +288 -0
  50. package/templates/default/apps/cms/node_modules/next/node_modules/_tmp_40516_de1b9f7e36eccb968b79dbd2b8c388ea/src/utilities.h +22 -0
  51. package/templates/default/components/BrowsePage.tsx +4 -4
  52. package/templates/default/components/DashboardNewPage.tsx +252 -0
  53. package/templates/default/components/LogPage.tsx +2 -3
  54. package/templates/default/components/SettingsPage.tsx +1 -1
  55. package/templates/default/components/form/Form.tsx +5 -5
  56. package/templates/default/components/form/helpers/_section-hot-reload.js +1 -1
  57. package/templates/default/components/form/helpers/util.ts +5 -5
  58. package/templates/default/dynamic-schemas/schema.ts +381 -381
  59. package/templates/default/next-env.d.ts +1 -1
  60. package/templates/default/next.config.ts +24 -0
  61. package/templates/default/package.json +23 -17
  62. package/templates/default/{middleware.ts → proxy.ts} +3 -4
  63. package/templates/default/tsconfig.json +6 -3
  64. package/templates/default/app/api/placeholder/route.ts +0 -7
  65. package/templates/default/public/tinymce/CHANGELOG.md +0 -3940
  66. package/templates/default/public/tinymce/README.md +0 -77
  67. package/templates/default/public/tinymce/bower.json +0 -27
  68. package/templates/default/public/tinymce/composer.json +0 -52
  69. package/templates/default/public/tinymce/icons/default/icons.js +0 -239
  70. package/templates/default/public/tinymce/icons/default/icons.min.js +0 -1
  71. package/templates/default/public/tinymce/icons/default/index.js +0 -7
  72. package/templates/default/public/tinymce/license.md +0 -9
  73. package/templates/default/public/tinymce/models/dom/index.js +0 -7
  74. package/templates/default/public/tinymce/models/dom/model.js +0 -8980
  75. package/templates/default/public/tinymce/models/dom/model.min.js +0 -1
  76. package/templates/default/public/tinymce/notices.txt +0 -21
  77. package/templates/default/public/tinymce/package.json +0 -32
  78. package/templates/default/public/tinymce/plugins/accordion/index.js +0 -7
  79. package/templates/default/public/tinymce/plugins/accordion/plugin.js +0 -1373
  80. package/templates/default/public/tinymce/plugins/accordion/plugin.min.js +0 -1
  81. package/templates/default/public/tinymce/plugins/advlist/index.js +0 -7
  82. package/templates/default/public/tinymce/plugins/advlist/plugin.js +0 -473
  83. package/templates/default/public/tinymce/plugins/advlist/plugin.min.js +0 -1
  84. package/templates/default/public/tinymce/plugins/anchor/index.js +0 -7
  85. package/templates/default/public/tinymce/plugins/anchor/plugin.js +0 -237
  86. package/templates/default/public/tinymce/plugins/anchor/plugin.min.js +0 -1
  87. package/templates/default/public/tinymce/plugins/autolink/index.js +0 -7
  88. package/templates/default/public/tinymce/plugins/autolink/plugin.js +0 -315
  89. package/templates/default/public/tinymce/plugins/autolink/plugin.min.js +0 -1
  90. package/templates/default/public/tinymce/plugins/autoresize/index.js +0 -7
  91. package/templates/default/public/tinymce/plugins/autoresize/plugin.js +0 -221
  92. package/templates/default/public/tinymce/plugins/autoresize/plugin.min.js +0 -1
  93. package/templates/default/public/tinymce/plugins/autosave/index.js +0 -7
  94. package/templates/default/public/tinymce/plugins/autosave/plugin.js +0 -249
  95. package/templates/default/public/tinymce/plugins/autosave/plugin.min.js +0 -1
  96. package/templates/default/public/tinymce/plugins/charmap/index.js +0 -7
  97. package/templates/default/public/tinymce/plugins/charmap/plugin.js +0 -997
  98. package/templates/default/public/tinymce/plugins/charmap/plugin.min.js +0 -1
  99. package/templates/default/public/tinymce/plugins/code/index.js +0 -7
  100. package/templates/default/public/tinymce/plugins/code/plugin.js +0 -98
  101. package/templates/default/public/tinymce/plugins/code/plugin.min.js +0 -1
  102. package/templates/default/public/tinymce/plugins/codesample/index.js +0 -7
  103. package/templates/default/public/tinymce/plugins/codesample/plugin.js +0 -3655
  104. package/templates/default/public/tinymce/plugins/codesample/plugin.min.js +0 -9
  105. package/templates/default/public/tinymce/plugins/directionality/index.js +0 -7
  106. package/templates/default/public/tinymce/plugins/directionality/plugin.js +0 -634
  107. package/templates/default/public/tinymce/plugins/directionality/plugin.min.js +0 -1
  108. package/templates/default/public/tinymce/plugins/emoticons/index.js +0 -7
  109. package/templates/default/public/tinymce/plugins/emoticons/js/emojiimages.js +0 -1
  110. package/templates/default/public/tinymce/plugins/emoticons/js/emojiimages.min.js +0 -1
  111. package/templates/default/public/tinymce/plugins/emoticons/js/emojis.js +0 -1
  112. package/templates/default/public/tinymce/plugins/emoticons/js/emojis.min.js +0 -1
  113. package/templates/default/public/tinymce/plugins/emoticons/plugin.js +0 -809
  114. package/templates/default/public/tinymce/plugins/emoticons/plugin.min.js +0 -1
  115. package/templates/default/public/tinymce/plugins/fullscreen/index.js +0 -7
  116. package/templates/default/public/tinymce/plugins/fullscreen/plugin.js +0 -1607
  117. package/templates/default/public/tinymce/plugins/fullscreen/plugin.min.js +0 -1
  118. package/templates/default/public/tinymce/plugins/help/index.js +0 -7
  119. package/templates/default/public/tinymce/plugins/help/js/i18n/keynav/ar.js +0 -93
  120. package/templates/default/public/tinymce/plugins/help/js/i18n/keynav/bg-BG.js +0 -93
  121. package/templates/default/public/tinymce/plugins/help/js/i18n/keynav/bg_BG.js +0 -93
  122. package/templates/default/public/tinymce/plugins/help/js/i18n/keynav/ca.js +0 -93
  123. package/templates/default/public/tinymce/plugins/help/js/i18n/keynav/cs.js +0 -93
  124. package/templates/default/public/tinymce/plugins/help/js/i18n/keynav/da.js +0 -93
  125. package/templates/default/public/tinymce/plugins/help/js/i18n/keynav/de.js +0 -93
  126. package/templates/default/public/tinymce/plugins/help/js/i18n/keynav/el.js +0 -93
  127. package/templates/default/public/tinymce/plugins/help/js/i18n/keynav/en.js +0 -93
  128. package/templates/default/public/tinymce/plugins/help/js/i18n/keynav/es.js +0 -93
  129. package/templates/default/public/tinymce/plugins/help/js/i18n/keynav/eu.js +0 -93
  130. package/templates/default/public/tinymce/plugins/help/js/i18n/keynav/fa.js +0 -93
  131. package/templates/default/public/tinymce/plugins/help/js/i18n/keynav/fi.js +0 -93
  132. package/templates/default/public/tinymce/plugins/help/js/i18n/keynav/fr-FR.js +0 -93
  133. package/templates/default/public/tinymce/plugins/help/js/i18n/keynav/fr_FR.js +0 -93
  134. package/templates/default/public/tinymce/plugins/help/js/i18n/keynav/he-IL.js +0 -93
  135. package/templates/default/public/tinymce/plugins/help/js/i18n/keynav/he_IL.js +0 -93
  136. package/templates/default/public/tinymce/plugins/help/js/i18n/keynav/hi.js +0 -93
  137. package/templates/default/public/tinymce/plugins/help/js/i18n/keynav/hr.js +0 -93
  138. package/templates/default/public/tinymce/plugins/help/js/i18n/keynav/hu-HU.js +0 -93
  139. package/templates/default/public/tinymce/plugins/help/js/i18n/keynav/hu_HU.js +0 -93
  140. package/templates/default/public/tinymce/plugins/help/js/i18n/keynav/id.js +0 -93
  141. package/templates/default/public/tinymce/plugins/help/js/i18n/keynav/it.js +0 -93
  142. package/templates/default/public/tinymce/plugins/help/js/i18n/keynav/ja.js +0 -93
  143. package/templates/default/public/tinymce/plugins/help/js/i18n/keynav/kk.js +0 -93
  144. package/templates/default/public/tinymce/plugins/help/js/i18n/keynav/ko-KR.js +0 -93
  145. package/templates/default/public/tinymce/plugins/help/js/i18n/keynav/ko_KR.js +0 -93
  146. package/templates/default/public/tinymce/plugins/help/js/i18n/keynav/ms.js +0 -93
  147. package/templates/default/public/tinymce/plugins/help/js/i18n/keynav/nb-NO.js +0 -93
  148. package/templates/default/public/tinymce/plugins/help/js/i18n/keynav/nb_NO.js +0 -93
  149. package/templates/default/public/tinymce/plugins/help/js/i18n/keynav/nl.js +0 -93
  150. package/templates/default/public/tinymce/plugins/help/js/i18n/keynav/pl.js +0 -93
  151. package/templates/default/public/tinymce/plugins/help/js/i18n/keynav/pt-BR.js +0 -93
  152. package/templates/default/public/tinymce/plugins/help/js/i18n/keynav/pt-PT.js +0 -93
  153. package/templates/default/public/tinymce/plugins/help/js/i18n/keynav/pt_BR.js +0 -93
  154. package/templates/default/public/tinymce/plugins/help/js/i18n/keynav/pt_PT.js +0 -93
  155. package/templates/default/public/tinymce/plugins/help/js/i18n/keynav/ro.js +0 -93
  156. package/templates/default/public/tinymce/plugins/help/js/i18n/keynav/ru.js +0 -93
  157. package/templates/default/public/tinymce/plugins/help/js/i18n/keynav/sk.js +0 -93
  158. package/templates/default/public/tinymce/plugins/help/js/i18n/keynav/sl-SI.js +0 -93
  159. package/templates/default/public/tinymce/plugins/help/js/i18n/keynav/sl_SI.js +0 -93
  160. package/templates/default/public/tinymce/plugins/help/js/i18n/keynav/sv-SE.js +0 -93
  161. package/templates/default/public/tinymce/plugins/help/js/i18n/keynav/sv_SE.js +0 -93
  162. package/templates/default/public/tinymce/plugins/help/js/i18n/keynav/th-TH.js +0 -93
  163. package/templates/default/public/tinymce/plugins/help/js/i18n/keynav/th_TH.js +0 -93
  164. package/templates/default/public/tinymce/plugins/help/js/i18n/keynav/tr.js +0 -93
  165. package/templates/default/public/tinymce/plugins/help/js/i18n/keynav/uk.js +0 -93
  166. package/templates/default/public/tinymce/plugins/help/js/i18n/keynav/vi.js +0 -93
  167. package/templates/default/public/tinymce/plugins/help/js/i18n/keynav/zh-CN.js +0 -87
  168. package/templates/default/public/tinymce/plugins/help/js/i18n/keynav/zh-TW.js +0 -93
  169. package/templates/default/public/tinymce/plugins/help/js/i18n/keynav/zh_CN.js +0 -87
  170. package/templates/default/public/tinymce/plugins/help/js/i18n/keynav/zh_TW.js +0 -93
  171. package/templates/default/public/tinymce/plugins/help/plugin.js +0 -826
  172. package/templates/default/public/tinymce/plugins/help/plugin.min.js +0 -1
  173. package/templates/default/public/tinymce/plugins/image/index.js +0 -7
  174. package/templates/default/public/tinymce/plugins/image/plugin.js +0 -1691
  175. package/templates/default/public/tinymce/plugins/image/plugin.min.js +0 -1
  176. package/templates/default/public/tinymce/plugins/importcss/index.js +0 -7
  177. package/templates/default/public/tinymce/plugins/importcss/plugin.js +0 -401
  178. package/templates/default/public/tinymce/plugins/importcss/plugin.min.js +0 -1
  179. package/templates/default/public/tinymce/plugins/insertdatetime/index.js +0 -7
  180. package/templates/default/public/tinymce/plugins/insertdatetime/plugin.js +0 -187
  181. package/templates/default/public/tinymce/plugins/insertdatetime/plugin.min.js +0 -1
  182. package/templates/default/public/tinymce/plugins/link/index.js +0 -7
  183. package/templates/default/public/tinymce/plugins/link/plugin.js +0 -1709
  184. package/templates/default/public/tinymce/plugins/link/plugin.min.js +0 -1
  185. package/templates/default/public/tinymce/plugins/lists/index.js +0 -7
  186. package/templates/default/public/tinymce/plugins/lists/plugin.js +0 -602
  187. package/templates/default/public/tinymce/plugins/lists/plugin.min.js +0 -1
  188. package/templates/default/public/tinymce/plugins/media/index.js +0 -7
  189. package/templates/default/public/tinymce/plugins/media/plugin.js +0 -1442
  190. package/templates/default/public/tinymce/plugins/media/plugin.min.js +0 -1
  191. package/templates/default/public/tinymce/plugins/nonbreaking/index.js +0 -7
  192. package/templates/default/public/tinymce/plugins/nonbreaking/plugin.js +0 -128
  193. package/templates/default/public/tinymce/plugins/nonbreaking/plugin.min.js +0 -1
  194. package/templates/default/public/tinymce/plugins/pagebreak/index.js +0 -7
  195. package/templates/default/public/tinymce/plugins/pagebreak/plugin.js +0 -123
  196. package/templates/default/public/tinymce/plugins/pagebreak/plugin.min.js +0 -1
  197. package/templates/default/public/tinymce/plugins/preview/index.js +0 -7
  198. package/templates/default/public/tinymce/plugins/preview/plugin.js +0 -843
  199. package/templates/default/public/tinymce/plugins/preview/plugin.min.js +0 -1
  200. package/templates/default/public/tinymce/plugins/quickbars/index.js +0 -7
  201. package/templates/default/public/tinymce/plugins/quickbars/plugin.js +0 -654
  202. package/templates/default/public/tinymce/plugins/quickbars/plugin.min.js +0 -1
  203. package/templates/default/public/tinymce/plugins/save/index.js +0 -7
  204. package/templates/default/public/tinymce/plugins/save/plugin.js +0 -136
  205. package/templates/default/public/tinymce/plugins/save/plugin.min.js +0 -1
  206. package/templates/default/public/tinymce/plugins/searchreplace/index.js +0 -7
  207. package/templates/default/public/tinymce/plugins/searchreplace/plugin.js +0 -1367
  208. package/templates/default/public/tinymce/plugins/searchreplace/plugin.min.js +0 -1
  209. package/templates/default/public/tinymce/plugins/table/index.js +0 -7
  210. package/templates/default/public/tinymce/plugins/table/plugin.js +0 -4008
  211. package/templates/default/public/tinymce/plugins/table/plugin.min.js +0 -1
  212. package/templates/default/public/tinymce/plugins/visualblocks/index.js +0 -7
  213. package/templates/default/public/tinymce/plugins/visualblocks/plugin.js +0 -106
  214. package/templates/default/public/tinymce/plugins/visualblocks/plugin.min.js +0 -1
  215. package/templates/default/public/tinymce/plugins/visualchars/index.js +0 -7
  216. package/templates/default/public/tinymce/plugins/visualchars/plugin.js +0 -808
  217. package/templates/default/public/tinymce/plugins/visualchars/plugin.min.js +0 -1
  218. package/templates/default/public/tinymce/plugins/wordcount/index.js +0 -7
  219. package/templates/default/public/tinymce/plugins/wordcount/plugin.js +0 -480
  220. package/templates/default/public/tinymce/plugins/wordcount/plugin.min.js +0 -1
  221. package/templates/default/public/tinymce/skins/content/dark/content.css +0 -75
  222. package/templates/default/public/tinymce/skins/content/dark/content.js +0 -10
  223. package/templates/default/public/tinymce/skins/content/dark/content.min.css +0 -10
  224. package/templates/default/public/tinymce/skins/content/dark/content.min.ts +0 -3
  225. package/templates/default/public/tinymce/skins/content/dark/content.ts +0 -3
  226. package/templates/default/public/tinymce/skins/content/default/content.css +0 -70
  227. package/templates/default/public/tinymce/skins/content/default/content.js +0 -10
  228. package/templates/default/public/tinymce/skins/content/default/content.min.css +0 -10
  229. package/templates/default/public/tinymce/skins/content/default/content.min.ts +0 -3
  230. package/templates/default/public/tinymce/skins/content/default/content.ts +0 -3
  231. package/templates/default/public/tinymce/skins/content/document/content.css +0 -75
  232. package/templates/default/public/tinymce/skins/content/document/content.js +0 -10
  233. package/templates/default/public/tinymce/skins/content/document/content.min.css +0 -10
  234. package/templates/default/public/tinymce/skins/content/document/content.min.ts +0 -3
  235. package/templates/default/public/tinymce/skins/content/document/content.ts +0 -3
  236. package/templates/default/public/tinymce/skins/content/tinymce-5/content.css +0 -70
  237. package/templates/default/public/tinymce/skins/content/tinymce-5/content.js +0 -10
  238. package/templates/default/public/tinymce/skins/content/tinymce-5/content.min.css +0 -10
  239. package/templates/default/public/tinymce/skins/content/tinymce-5/content.min.ts +0 -3
  240. package/templates/default/public/tinymce/skins/content/tinymce-5/content.ts +0 -3
  241. package/templates/default/public/tinymce/skins/content/tinymce-5-dark/content.css +0 -75
  242. package/templates/default/public/tinymce/skins/content/tinymce-5-dark/content.js +0 -10
  243. package/templates/default/public/tinymce/skins/content/tinymce-5-dark/content.min.css +0 -10
  244. package/templates/default/public/tinymce/skins/content/tinymce-5-dark/content.min.ts +0 -3
  245. package/templates/default/public/tinymce/skins/content/tinymce-5-dark/content.ts +0 -3
  246. package/templates/default/public/tinymce/skins/content/writer/content.css +0 -71
  247. package/templates/default/public/tinymce/skins/content/writer/content.js +0 -10
  248. package/templates/default/public/tinymce/skins/content/writer/content.min.css +0 -10
  249. package/templates/default/public/tinymce/skins/content/writer/content.min.ts +0 -3
  250. package/templates/default/public/tinymce/skins/content/writer/content.ts +0 -3
  251. package/templates/default/public/tinymce/skins/ui/oxide/content.css +0 -1037
  252. package/templates/default/public/tinymce/skins/ui/oxide/content.inline.css +0 -1031
  253. package/templates/default/public/tinymce/skins/ui/oxide/content.inline.js +0 -10
  254. package/templates/default/public/tinymce/skins/ui/oxide/content.inline.min.css +0 -10
  255. package/templates/default/public/tinymce/skins/ui/oxide/content.inline.min.ts +0 -116
  256. package/templates/default/public/tinymce/skins/ui/oxide/content.inline.ts +0 -116
  257. package/templates/default/public/tinymce/skins/ui/oxide/content.js +0 -10
  258. package/templates/default/public/tinymce/skins/ui/oxide/content.min.css +0 -10
  259. package/templates/default/public/tinymce/skins/ui/oxide/content.min.ts +0 -116
  260. package/templates/default/public/tinymce/skins/ui/oxide/content.ts +0 -116
  261. package/templates/default/public/tinymce/skins/ui/oxide/skin.css +0 -5615
  262. package/templates/default/public/tinymce/skins/ui/oxide/skin.js +0 -1
  263. package/templates/default/public/tinymce/skins/ui/oxide/skin.min.css +0 -1
  264. package/templates/default/public/tinymce/skins/ui/oxide/skin.min.ts +0 -507
  265. package/templates/default/public/tinymce/skins/ui/oxide/skin.shadowdom.css +0 -30
  266. package/templates/default/public/tinymce/skins/ui/oxide/skin.shadowdom.js +0 -1
  267. package/templates/default/public/tinymce/skins/ui/oxide/skin.shadowdom.min.css +0 -1
  268. package/templates/default/public/tinymce/skins/ui/oxide/skin.shadowdom.min.ts +0 -9
  269. package/templates/default/public/tinymce/skins/ui/oxide/skin.shadowdom.ts +0 -9
  270. package/templates/default/public/tinymce/skins/ui/oxide/skin.ts +0 -507
  271. package/templates/default/public/tinymce/skins/ui/oxide-dark/content.css +0 -1025
  272. package/templates/default/public/tinymce/skins/ui/oxide-dark/content.inline.css +0 -1031
  273. package/templates/default/public/tinymce/skins/ui/oxide-dark/content.inline.js +0 -10
  274. package/templates/default/public/tinymce/skins/ui/oxide-dark/content.inline.min.css +0 -10
  275. package/templates/default/public/tinymce/skins/ui/oxide-dark/content.inline.min.ts +0 -116
  276. package/templates/default/public/tinymce/skins/ui/oxide-dark/content.inline.ts +0 -116
  277. package/templates/default/public/tinymce/skins/ui/oxide-dark/content.js +0 -10
  278. package/templates/default/public/tinymce/skins/ui/oxide-dark/content.min.css +0 -10
  279. package/templates/default/public/tinymce/skins/ui/oxide-dark/content.min.ts +0 -116
  280. package/templates/default/public/tinymce/skins/ui/oxide-dark/content.ts +0 -116
  281. package/templates/default/public/tinymce/skins/ui/oxide-dark/skin.css +0 -5618
  282. package/templates/default/public/tinymce/skins/ui/oxide-dark/skin.js +0 -1
  283. package/templates/default/public/tinymce/skins/ui/oxide-dark/skin.min.css +0 -1
  284. package/templates/default/public/tinymce/skins/ui/oxide-dark/skin.min.ts +0 -507
  285. package/templates/default/public/tinymce/skins/ui/oxide-dark/skin.shadowdom.css +0 -30
  286. package/templates/default/public/tinymce/skins/ui/oxide-dark/skin.shadowdom.js +0 -1
  287. package/templates/default/public/tinymce/skins/ui/oxide-dark/skin.shadowdom.min.css +0 -1
  288. package/templates/default/public/tinymce/skins/ui/oxide-dark/skin.shadowdom.min.ts +0 -9
  289. package/templates/default/public/tinymce/skins/ui/oxide-dark/skin.shadowdom.ts +0 -9
  290. package/templates/default/public/tinymce/skins/ui/oxide-dark/skin.ts +0 -507
  291. package/templates/default/public/tinymce/skins/ui/tinymce-5/content.css +0 -1037
  292. package/templates/default/public/tinymce/skins/ui/tinymce-5/content.inline.css +0 -1031
  293. package/templates/default/public/tinymce/skins/ui/tinymce-5/content.inline.js +0 -10
  294. package/templates/default/public/tinymce/skins/ui/tinymce-5/content.inline.min.css +0 -10
  295. package/templates/default/public/tinymce/skins/ui/tinymce-5/content.inline.min.ts +0 -116
  296. package/templates/default/public/tinymce/skins/ui/tinymce-5/content.inline.ts +0 -116
  297. package/templates/default/public/tinymce/skins/ui/tinymce-5/content.js +0 -10
  298. package/templates/default/public/tinymce/skins/ui/tinymce-5/content.min.css +0 -10
  299. package/templates/default/public/tinymce/skins/ui/tinymce-5/content.min.ts +0 -116
  300. package/templates/default/public/tinymce/skins/ui/tinymce-5/content.ts +0 -116
  301. package/templates/default/public/tinymce/skins/ui/tinymce-5/skin.css +0 -5734
  302. package/templates/default/public/tinymce/skins/ui/tinymce-5/skin.js +0 -1
  303. package/templates/default/public/tinymce/skins/ui/tinymce-5/skin.min.css +0 -1
  304. package/templates/default/public/tinymce/skins/ui/tinymce-5/skin.min.ts +0 -508
  305. package/templates/default/public/tinymce/skins/ui/tinymce-5/skin.shadowdom.css +0 -30
  306. package/templates/default/public/tinymce/skins/ui/tinymce-5/skin.shadowdom.js +0 -1
  307. package/templates/default/public/tinymce/skins/ui/tinymce-5/skin.shadowdom.min.css +0 -1
  308. package/templates/default/public/tinymce/skins/ui/tinymce-5/skin.shadowdom.min.ts +0 -9
  309. package/templates/default/public/tinymce/skins/ui/tinymce-5/skin.shadowdom.ts +0 -9
  310. package/templates/default/public/tinymce/skins/ui/tinymce-5/skin.ts +0 -508
  311. package/templates/default/public/tinymce/skins/ui/tinymce-5-dark/content.css +0 -1025
  312. package/templates/default/public/tinymce/skins/ui/tinymce-5-dark/content.inline.css +0 -1031
  313. package/templates/default/public/tinymce/skins/ui/tinymce-5-dark/content.inline.js +0 -10
  314. package/templates/default/public/tinymce/skins/ui/tinymce-5-dark/content.inline.min.css +0 -10
  315. package/templates/default/public/tinymce/skins/ui/tinymce-5-dark/content.inline.min.ts +0 -116
  316. package/templates/default/public/tinymce/skins/ui/tinymce-5-dark/content.inline.ts +0 -116
  317. package/templates/default/public/tinymce/skins/ui/tinymce-5-dark/content.js +0 -10
  318. package/templates/default/public/tinymce/skins/ui/tinymce-5-dark/content.min.css +0 -10
  319. package/templates/default/public/tinymce/skins/ui/tinymce-5-dark/content.min.ts +0 -116
  320. package/templates/default/public/tinymce/skins/ui/tinymce-5-dark/content.ts +0 -116
  321. package/templates/default/public/tinymce/skins/ui/tinymce-5-dark/skin.css +0 -5734
  322. package/templates/default/public/tinymce/skins/ui/tinymce-5-dark/skin.js +0 -1
  323. package/templates/default/public/tinymce/skins/ui/tinymce-5-dark/skin.min.css +0 -1
  324. package/templates/default/public/tinymce/skins/ui/tinymce-5-dark/skin.min.ts +0 -508
  325. package/templates/default/public/tinymce/skins/ui/tinymce-5-dark/skin.shadowdom.css +0 -30
  326. package/templates/default/public/tinymce/skins/ui/tinymce-5-dark/skin.shadowdom.js +0 -1
  327. package/templates/default/public/tinymce/skins/ui/tinymce-5-dark/skin.shadowdom.min.css +0 -1
  328. package/templates/default/public/tinymce/skins/ui/tinymce-5-dark/skin.shadowdom.min.ts +0 -9
  329. package/templates/default/public/tinymce/skins/ui/tinymce-5-dark/skin.shadowdom.ts +0 -9
  330. package/templates/default/public/tinymce/skins/ui/tinymce-5-dark/skin.ts +0 -508
  331. package/templates/default/public/tinymce/themes/silver/index.js +0 -7
  332. package/templates/default/public/tinymce/themes/silver/theme.js +0 -34748
  333. package/templates/default/public/tinymce/themes/silver/theme.min.js +0 -1
  334. package/templates/default/public/tinymce/tinymce.d.ts +0 -3413
  335. package/templates/default/public/tinymce/tinymce.js +0 -41518
  336. package/templates/default/public/tinymce/tinymce.min.js +0 -10
@@ -1,1442 +0,0 @@
1
- /**
2
- * TinyMCE version 8.3.1 (2025-12-17)
3
- */
4
-
5
- (function () {
6
- 'use strict';
7
-
8
- var global$6 = tinymce.util.Tools.resolve('tinymce.PluginManager');
9
-
10
- /* eslint-disable @typescript-eslint/no-wrapper-object-types */
11
- const hasProto = (v, constructor, predicate) => {
12
- if (predicate(v, constructor.prototype)) {
13
- return true;
14
- }
15
- else {
16
- // String-based fallback time
17
- return v.constructor?.name === constructor.name;
18
- }
19
- };
20
- const typeOf = (x) => {
21
- const t = typeof x;
22
- if (x === null) {
23
- return 'null';
24
- }
25
- else if (t === 'object' && Array.isArray(x)) {
26
- return 'array';
27
- }
28
- else if (t === 'object' && hasProto(x, String, (o, proto) => proto.isPrototypeOf(o))) {
29
- return 'string';
30
- }
31
- else {
32
- return t;
33
- }
34
- };
35
- const isType = (type) => (value) => typeOf(value) === type;
36
- const isSimpleType = (type) => (value) => typeof value === type;
37
- const isString = isType('string');
38
- const isObject = isType('object');
39
- const isArray = isType('array');
40
- const isNullable = (a) => a === null || a === undefined;
41
- const isNonNullable = (a) => !isNullable(a);
42
- const isFunction = isSimpleType('function');
43
-
44
- /**
45
- * The `Optional` type represents a value (of any type) that potentially does
46
- * not exist. Any `Optional<T>` can either be a `Some<T>` (in which case the
47
- * value does exist) or a `None` (in which case the value does not exist). This
48
- * module defines a whole lot of FP-inspired utility functions for dealing with
49
- * `Optional` objects.
50
- *
51
- * Comparison with null or undefined:
52
- * - We don't get fancy null coalescing operators with `Optional`
53
- * - We do get fancy helper functions with `Optional`
54
- * - `Optional` support nesting, and allow for the type to still be nullable (or
55
- * another `Optional`)
56
- * - There is no option to turn off strict-optional-checks like there is for
57
- * strict-null-checks
58
- */
59
- class Optional {
60
- tag;
61
- value;
62
- // Sneaky optimisation: every instance of Optional.none is identical, so just
63
- // reuse the same object
64
- static singletonNone = new Optional(false);
65
- // The internal representation has a `tag` and a `value`, but both are
66
- // private: able to be console.logged, but not able to be accessed by code
67
- constructor(tag, value) {
68
- this.tag = tag;
69
- this.value = value;
70
- }
71
- // --- Identities ---
72
- /**
73
- * Creates a new `Optional<T>` that **does** contain a value.
74
- */
75
- static some(value) {
76
- return new Optional(true, value);
77
- }
78
- /**
79
- * Create a new `Optional<T>` that **does not** contain a value. `T` can be
80
- * any type because we don't actually have a `T`.
81
- */
82
- static none() {
83
- return Optional.singletonNone;
84
- }
85
- /**
86
- * Perform a transform on an `Optional` type. Regardless of whether this
87
- * `Optional` contains a value or not, `fold` will return a value of type `U`.
88
- * If this `Optional` does not contain a value, the `U` will be created by
89
- * calling `onNone`. If this `Optional` does contain a value, the `U` will be
90
- * created by calling `onSome`.
91
- *
92
- * For the FP enthusiasts in the room, this function:
93
- * 1. Could be used to implement all of the functions below
94
- * 2. Forms a catamorphism
95
- */
96
- fold(onNone, onSome) {
97
- if (this.tag) {
98
- return onSome(this.value);
99
- }
100
- else {
101
- return onNone();
102
- }
103
- }
104
- /**
105
- * Determine if this `Optional` object contains a value.
106
- */
107
- isSome() {
108
- return this.tag;
109
- }
110
- /**
111
- * Determine if this `Optional` object **does not** contain a value.
112
- */
113
- isNone() {
114
- return !this.tag;
115
- }
116
- // --- Functor (name stolen from Haskell / maths) ---
117
- /**
118
- * Perform a transform on an `Optional` object, **if** there is a value. If
119
- * you provide a function to turn a T into a U, this is the function you use
120
- * to turn an `Optional<T>` into an `Optional<U>`. If this **does** contain
121
- * a value then the output will also contain a value (that value being the
122
- * output of `mapper(this.value)`), and if this **does not** contain a value
123
- * then neither will the output.
124
- */
125
- map(mapper) {
126
- if (this.tag) {
127
- return Optional.some(mapper(this.value));
128
- }
129
- else {
130
- return Optional.none();
131
- }
132
- }
133
- // --- Monad (name stolen from Haskell / maths) ---
134
- /**
135
- * Perform a transform on an `Optional` object, **if** there is a value.
136
- * Unlike `map`, here the transform itself also returns an `Optional`.
137
- */
138
- bind(binder) {
139
- if (this.tag) {
140
- return binder(this.value);
141
- }
142
- else {
143
- return Optional.none();
144
- }
145
- }
146
- // --- Traversable (name stolen from Haskell / maths) ---
147
- /**
148
- * For a given predicate, this function finds out if there **exists** a value
149
- * inside this `Optional` object that meets the predicate. In practice, this
150
- * means that for `Optional`s that do not contain a value it returns false (as
151
- * no predicate-meeting value exists).
152
- */
153
- exists(predicate) {
154
- return this.tag && predicate(this.value);
155
- }
156
- /**
157
- * For a given predicate, this function finds out if **all** the values inside
158
- * this `Optional` object meet the predicate. In practice, this means that
159
- * for `Optional`s that do not contain a value it returns true (as all 0
160
- * objects do meet the predicate).
161
- */
162
- forall(predicate) {
163
- return !this.tag || predicate(this.value);
164
- }
165
- filter(predicate) {
166
- if (!this.tag || predicate(this.value)) {
167
- return this;
168
- }
169
- else {
170
- return Optional.none();
171
- }
172
- }
173
- // --- Getters ---
174
- /**
175
- * Get the value out of the inside of the `Optional` object, using a default
176
- * `replacement` value if the provided `Optional` object does not contain a
177
- * value.
178
- */
179
- getOr(replacement) {
180
- return this.tag ? this.value : replacement;
181
- }
182
- /**
183
- * Get the value out of the inside of the `Optional` object, using a default
184
- * `replacement` value if the provided `Optional` object does not contain a
185
- * value. Unlike `getOr`, in this method the `replacement` object is also
186
- * `Optional` - meaning that this method will always return an `Optional`.
187
- */
188
- or(replacement) {
189
- return this.tag ? this : replacement;
190
- }
191
- /**
192
- * Get the value out of the inside of the `Optional` object, using a default
193
- * `replacement` value if the provided `Optional` object does not contain a
194
- * value. Unlike `getOr`, in this method the `replacement` value is
195
- * "thunked" - that is to say that you don't pass a value to `getOrThunk`, you
196
- * pass a function which (if called) will **return** the `value` you want to
197
- * use.
198
- */
199
- getOrThunk(thunk) {
200
- return this.tag ? this.value : thunk();
201
- }
202
- /**
203
- * Get the value out of the inside of the `Optional` object, using a default
204
- * `replacement` value if the provided Optional object does not contain a
205
- * value.
206
- *
207
- * Unlike `or`, in this method the `replacement` value is "thunked" - that is
208
- * to say that you don't pass a value to `orThunk`, you pass a function which
209
- * (if called) will **return** the `value` you want to use.
210
- *
211
- * Unlike `getOrThunk`, in this method the `replacement` value is also
212
- * `Optional`, meaning that this method will always return an `Optional`.
213
- */
214
- orThunk(thunk) {
215
- return this.tag ? this : thunk();
216
- }
217
- /**
218
- * Get the value out of the inside of the `Optional` object, throwing an
219
- * exception if the provided `Optional` object does not contain a value.
220
- *
221
- * WARNING:
222
- * You should only be using this function if you know that the `Optional`
223
- * object **is not** empty (otherwise you're throwing exceptions in production
224
- * code, which is bad).
225
- *
226
- * In tests this is more acceptable.
227
- *
228
- * Prefer other methods to this, such as `.each`.
229
- */
230
- getOrDie(message) {
231
- if (!this.tag) {
232
- throw new Error(message ?? 'Called getOrDie on None');
233
- }
234
- else {
235
- return this.value;
236
- }
237
- }
238
- // --- Interop with null and undefined ---
239
- /**
240
- * Creates an `Optional` value from a nullable (or undefined-able) input.
241
- * Null, or undefined, is converted to `None`, and anything else is converted
242
- * to `Some`.
243
- */
244
- static from(value) {
245
- return isNonNullable(value) ? Optional.some(value) : Optional.none();
246
- }
247
- /**
248
- * Converts an `Optional` to a nullable type, by getting the value if it
249
- * exists, or returning `null` if it does not.
250
- */
251
- getOrNull() {
252
- return this.tag ? this.value : null;
253
- }
254
- /**
255
- * Converts an `Optional` to an undefined-able type, by getting the value if
256
- * it exists, or returning `undefined` if it does not.
257
- */
258
- getOrUndefined() {
259
- return this.value;
260
- }
261
- // --- Utilities ---
262
- /**
263
- * If the `Optional` contains a value, perform an action on that value.
264
- * Unlike the rest of the methods on this type, `.each` has side-effects. If
265
- * you want to transform an `Optional<T>` **into** something, then this is not
266
- * the method for you. If you want to use an `Optional<T>` to **do**
267
- * something, then this is the method for you - provided you're okay with not
268
- * doing anything in the case where the `Optional` doesn't have a value inside
269
- * it. If you're not sure whether your use-case fits into transforming
270
- * **into** something or **doing** something, check whether it has a return
271
- * value. If it does, you should be performing a transform.
272
- */
273
- each(worker) {
274
- if (this.tag) {
275
- worker(this.value);
276
- }
277
- }
278
- /**
279
- * Turn the `Optional` object into an array that contains all of the values
280
- * stored inside the `Optional`. In practice, this means the output will have
281
- * either 0 or 1 elements.
282
- */
283
- toArray() {
284
- return this.tag ? [this.value] : [];
285
- }
286
- /**
287
- * Turn the `Optional` object into a string for debugging or printing. Not
288
- * recommended for production code, but good for debugging. Also note that
289
- * these days an `Optional` object can be logged to the console directly, and
290
- * its inner value (if it exists) will be visible.
291
- */
292
- toString() {
293
- return this.tag ? `some(${this.value})` : 'none()';
294
- }
295
- }
296
-
297
- const nativeSlice = Array.prototype.slice;
298
- const nativePush = Array.prototype.push;
299
- // Unwound implementing other functions in terms of each.
300
- // The code size is roughly the same, and it should allow for better optimisation.
301
- // const each = function<T, U>(xs: T[], f: (x: T, i?: number, xs?: T[]) => void): void {
302
- const each$1 = (xs, f) => {
303
- for (let i = 0, len = xs.length; i < len; i++) {
304
- const x = xs[i];
305
- f(x, i);
306
- }
307
- };
308
- const flatten = (xs) => {
309
- // Note, this is possible because push supports multiple arguments:
310
- // http://jsperf.com/concat-push/6
311
- // Note that in the past, concat() would silently work (very slowly) for array-like objects.
312
- // With this change it will throw an error.
313
- const r = [];
314
- for (let i = 0, len = xs.length; i < len; ++i) {
315
- // Ensure that each value is an array itself
316
- if (!isArray(xs[i])) {
317
- throw new Error('Arr.flatten item ' + i + ' was not an array, input: ' + xs);
318
- }
319
- nativePush.apply(r, xs[i]);
320
- }
321
- return r;
322
- };
323
- isFunction(Array.from) ? Array.from : (x) => nativeSlice.call(x);
324
-
325
- // There are many variations of Object iteration that are faster than the 'for-in' style:
326
- // http://jsperf.com/object-keys-iteration/107
327
- //
328
- // Use the native keys if it is available (IE9+), otherwise fall back to manually filtering
329
- const keys = Object.keys;
330
- const hasOwnProperty = Object.hasOwnProperty;
331
- const each = (obj, f) => {
332
- const props = keys(obj);
333
- for (let k = 0, len = props.length; k < len; k++) {
334
- const i = props[k];
335
- const x = obj[i];
336
- f(x, i);
337
- }
338
- };
339
- const get$1 = (obj, key) => {
340
- return has(obj, key) ? Optional.from(obj[key]) : Optional.none();
341
- };
342
- const has = (obj, key) => hasOwnProperty.call(obj, key);
343
-
344
- const Cell = (initial) => {
345
- let value = initial;
346
- const get = () => {
347
- return value;
348
- };
349
- const set = (v) => {
350
- value = v;
351
- };
352
- return {
353
- get,
354
- set
355
- };
356
- };
357
-
358
- const checkRange = (str, substr, start) => substr === '' || str.length >= substr.length && str.substr(start, start + substr.length) === substr;
359
- /** Does 'str' start with 'prefix'?
360
- * Note: all strings start with the empty string.
361
- * More formally, for all strings x, startsWith(x, "").
362
- * This is so that for all strings x and y, startsWith(y + x, y)
363
- */
364
- const startsWith = (str, prefix) => {
365
- return checkRange(str, prefix, 0);
366
- };
367
-
368
- const option = (name) => (editor) => editor.options.get(name);
369
- const register$2 = (editor) => {
370
- const registerOption = editor.options.register;
371
- registerOption('audio_template_callback', {
372
- processor: 'function'
373
- });
374
- registerOption('video_template_callback', {
375
- processor: 'function'
376
- });
377
- registerOption('iframe_template_callback', {
378
- processor: 'function'
379
- });
380
- registerOption('media_live_embeds', {
381
- processor: 'boolean',
382
- default: true
383
- });
384
- registerOption('media_filter_html', {
385
- processor: 'boolean',
386
- default: true
387
- });
388
- registerOption('media_url_resolver', {
389
- processor: 'function'
390
- });
391
- registerOption('media_alt_source', {
392
- processor: 'boolean',
393
- default: true
394
- });
395
- registerOption('media_poster', {
396
- processor: 'boolean',
397
- default: true
398
- });
399
- registerOption('media_dimensions', {
400
- processor: 'boolean',
401
- default: true
402
- });
403
- };
404
- const getAudioTemplateCallback = option('audio_template_callback');
405
- const getVideoTemplateCallback = option('video_template_callback');
406
- const getIframeTemplateCallback = option('iframe_template_callback');
407
- const hasLiveEmbeds = option('media_live_embeds');
408
- const shouldFilterHtml = option('media_filter_html');
409
- const getUrlResolver = option('media_url_resolver');
410
- const hasAltSource = option('media_alt_source');
411
- const hasPoster = option('media_poster');
412
- const hasDimensions = option('media_dimensions');
413
-
414
- var global$5 = tinymce.util.Tools.resolve('tinymce.util.Tools');
415
-
416
- var global$4 = tinymce.util.Tools.resolve('tinymce.dom.DOMUtils');
417
-
418
- var global$3 = tinymce.util.Tools.resolve('tinymce.html.DomParser');
419
-
420
- const DOM$1 = global$4.DOM;
421
- const trimPx = (value) => value.replace(/px$/, '');
422
- const getEphoxEmbedData = (node) => {
423
- const style = node.attr('style');
424
- const styles = style ? DOM$1.parseStyle(style) : {};
425
- return {
426
- type: 'ephox-embed-iri',
427
- source: node.attr('data-ephox-embed-iri'),
428
- altsource: '',
429
- poster: '',
430
- width: get$1(styles, 'max-width').map(trimPx).getOr(''),
431
- height: get$1(styles, 'max-height').map(trimPx).getOr('')
432
- };
433
- };
434
- const htmlToData = (html, schema) => {
435
- let data = {};
436
- const parser = global$3({ validate: false, forced_root_block: false }, schema);
437
- const rootNode = parser.parse(html);
438
- for (let node = rootNode; node; node = node.walk()) {
439
- if (node.type === 1) {
440
- const name = node.name;
441
- if (node.attr('data-ephox-embed-iri')) {
442
- data = getEphoxEmbedData(node);
443
- // Don't continue to collect if we find an EME embed
444
- break;
445
- }
446
- else {
447
- if (!data.source && name === 'param') {
448
- data.source = node.attr('movie');
449
- }
450
- if (name === 'iframe' || name === 'object' || name === 'embed' || name === 'video' || name === 'audio') {
451
- if (!data.type) {
452
- data.type = name;
453
- }
454
- // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
455
- data = global$5.extend(node.attributes.map, data);
456
- }
457
- if (name === 'source') {
458
- if (!data.source) {
459
- data.source = node.attr('src');
460
- }
461
- else if (!data.altsource) {
462
- data.altsource = node.attr('src');
463
- }
464
- }
465
- if (name === 'img' && !data.poster) {
466
- data.poster = node.attr('src');
467
- }
468
- }
469
- }
470
- }
471
- data.source = data.source || data.src || '';
472
- data.altsource = data.altsource || '';
473
- data.poster = data.poster || '';
474
- return data;
475
- };
476
-
477
- const guess = (url) => {
478
- const mimes = {
479
- mp3: 'audio/mpeg',
480
- m4a: 'audio/x-m4a',
481
- wav: 'audio/wav',
482
- mp4: 'video/mp4',
483
- webm: 'video/webm',
484
- ogg: 'video/ogg',
485
- swf: 'application/x-shockwave-flash'
486
- };
487
- const fileEnd = url.toLowerCase().split('.').pop() ?? '';
488
- return get$1(mimes, fileEnd).getOr('');
489
- };
490
-
491
- var global$2 = tinymce.util.Tools.resolve('tinymce.html.Node');
492
-
493
- var global$1 = tinymce.util.Tools.resolve('tinymce.html.Serializer');
494
-
495
- const Parser = (schema, settings = {}) => global$3({
496
- forced_root_block: false,
497
- validate: false,
498
- allow_conditional_comments: true,
499
- ...settings
500
- }, schema);
501
-
502
- const DOM = global$4.DOM;
503
- const addPx = (value) => /^[0-9.]+$/.test(value) ? (value + 'px') : value;
504
- const updateEphoxEmbed = (data, node) => {
505
- const style = node.attr('style');
506
- const styleMap = style ? DOM.parseStyle(style) : {};
507
- if (isNonNullable(data.width)) {
508
- styleMap['max-width'] = addPx(data.width);
509
- }
510
- if (isNonNullable(data.height)) {
511
- styleMap['max-height'] = addPx(data.height);
512
- }
513
- node.attr('style', DOM.serializeStyle(styleMap));
514
- };
515
- const sources = ['source', 'altsource'];
516
- const updateHtml = (html, data, updateAll, schema) => {
517
- let numSources = 0;
518
- let sourceCount = 0;
519
- const parser = Parser(schema);
520
- parser.addNodeFilter('source', (nodes) => numSources = nodes.length);
521
- const rootNode = parser.parse(html);
522
- for (let node = rootNode; node; node = node.walk()) {
523
- if (node.type === 1) {
524
- const name = node.name;
525
- if (node.attr('data-ephox-embed-iri')) {
526
- updateEphoxEmbed(data, node);
527
- // Don't continue to update if we find an EME embed
528
- break;
529
- }
530
- else {
531
- switch (name) {
532
- case 'video':
533
- case 'object':
534
- case 'embed':
535
- case 'img':
536
- case 'iframe':
537
- if (data.height !== undefined && data.width !== undefined) {
538
- node.attr('width', data.width);
539
- node.attr('height', data.height);
540
- }
541
- break;
542
- }
543
- if (updateAll) {
544
- switch (name) {
545
- case 'video':
546
- node.attr('poster', data.poster);
547
- node.attr('src', null);
548
- // Add <source> child elements
549
- for (let index = numSources; index < 2; index++) {
550
- if (data[sources[index]]) {
551
- const source = new global$2('source', 1);
552
- source.attr('src', data[sources[index]]);
553
- source.attr('type', data[sources[index] + 'mime'] || null);
554
- node.append(source);
555
- }
556
- }
557
- break;
558
- case 'iframe':
559
- node.attr('src', data.source);
560
- break;
561
- case 'object':
562
- const hasImage = node.getAll('img').length > 0;
563
- if (data.poster && !hasImage) {
564
- node.attr('src', data.poster);
565
- const img = new global$2('img', 1);
566
- img.attr('src', data.poster);
567
- img.attr('width', data.width);
568
- img.attr('height', data.height);
569
- node.append(img);
570
- }
571
- break;
572
- case 'source':
573
- if (sourceCount < 2) {
574
- node.attr('src', data[sources[sourceCount]]);
575
- node.attr('type', data[sources[sourceCount] + 'mime'] || null);
576
- if (!data[sources[sourceCount]]) {
577
- node.remove();
578
- continue;
579
- }
580
- }
581
- sourceCount++;
582
- break;
583
- case 'img':
584
- if (!data.poster) {
585
- node.remove();
586
- }
587
- break;
588
- }
589
- }
590
- }
591
- }
592
- }
593
- return global$1({}, schema).serialize(rootNode);
594
- };
595
-
596
- const urlPatterns = [
597
- {
598
- regex: /youtu\.be\/([\w\-_\?&=.]+)/i,
599
- type: 'iframe', w: 560, h: 314,
600
- url: 'www.youtube.com/embed/$1',
601
- allowFullscreen: true
602
- },
603
- {
604
- regex: /youtube\.com(.+)v=([^&]+)(&([a-z0-9&=\-_]+))?/i,
605
- type: 'iframe', w: 560, h: 314,
606
- url: 'www.youtube.com/embed/$2?$4',
607
- allowFullscreen: true
608
- },
609
- {
610
- regex: /youtube.com\/embed\/([a-z0-9\?&=\-_]+)/i,
611
- type: 'iframe', w: 560, h: 314,
612
- url: 'www.youtube.com/embed/$1',
613
- allowFullscreen: true
614
- },
615
- {
616
- regex: /vimeo\.com\/([0-9]+)\?h=(\w+)/,
617
- type: 'iframe', w: 425, h: 350,
618
- url: 'player.vimeo.com/video/$1?h=$2&title=0&byline=0&portrait=0&color=8dc7dc',
619
- allowFullscreen: true
620
- },
621
- {
622
- regex: /vimeo\.com\/(.*)\/([0-9]+)\?h=(\w+)/,
623
- type: 'iframe', w: 425, h: 350,
624
- url: 'player.vimeo.com/video/$2?h=$3&title=0&amp;byline=0',
625
- allowFullscreen: true
626
- },
627
- {
628
- regex: /vimeo\.com\/([0-9]+)/,
629
- type: 'iframe', w: 425, h: 350,
630
- url: 'player.vimeo.com/video/$1?title=0&byline=0&portrait=0&color=8dc7dc',
631
- allowFullscreen: true
632
- },
633
- {
634
- regex: /vimeo\.com\/(.*)\/([0-9]+)/,
635
- type: 'iframe', w: 425, h: 350,
636
- url: 'player.vimeo.com/video/$2?title=0&amp;byline=0',
637
- allowFullscreen: true
638
- },
639
- {
640
- regex: /maps\.google\.([a-z]{2,3})\/maps\/(.+)msid=(.+)/,
641
- type: 'iframe', w: 425, h: 350,
642
- url: 'maps.google.com/maps/ms?msid=$2&output=embed"',
643
- allowFullscreen: false
644
- },
645
- {
646
- regex: /dailymotion\.com\/video\/([^_]+)/,
647
- type: 'iframe', w: 480, h: 270,
648
- url: 'www.dailymotion.com/embed/video/$1',
649
- allowFullscreen: true
650
- },
651
- {
652
- regex: /dai\.ly\/([^_]+)/,
653
- type: 'iframe', w: 480, h: 270,
654
- url: 'www.dailymotion.com/embed/video/$1',
655
- allowFullscreen: true
656
- }
657
- ];
658
- const getProtocol = (url) => {
659
- const protocolMatches = url.match(/^(https?:\/\/|www\.)(.+)$/i);
660
- if (protocolMatches && protocolMatches.length > 1) {
661
- return protocolMatches[1] === 'www.' ? 'https://' : protocolMatches[1];
662
- }
663
- else {
664
- return 'https://';
665
- }
666
- };
667
- const getUrl = (pattern, url) => {
668
- const protocol = getProtocol(url);
669
- const match = pattern.regex.exec(url);
670
- let newUrl = protocol + pattern.url;
671
- if (isNonNullable(match)) {
672
- for (let i = 0; i < match.length; i++) {
673
- newUrl = newUrl.replace('$' + i, () => match[i] ? match[i] : '');
674
- }
675
- }
676
- return newUrl.replace(/\?$/, '');
677
- };
678
- const matchPattern = (url) => {
679
- const patterns = urlPatterns.filter((pattern) => pattern.regex.test(url));
680
- if (patterns.length > 0) {
681
- return global$5.extend({}, patterns[0], { url: getUrl(patterns[0], url) });
682
- }
683
- else {
684
- return null;
685
- }
686
- };
687
-
688
- const getIframeHtml = (data, iframeTemplateCallback) => {
689
- if (iframeTemplateCallback) {
690
- return iframeTemplateCallback(data);
691
- }
692
- else {
693
- const allowFullscreen = data.allowfullscreen ? ' allowFullscreen="1"' : '';
694
- return '<iframe src="' + data.source + '" width="' + data.width + '" height="' + data.height + '"' + allowFullscreen + '></iframe>';
695
- }
696
- };
697
- const getFlashHtml = (data) => {
698
- let html = '<object data="' + data.source + '" width="' + data.width + '" height="' + data.height + '" type="application/x-shockwave-flash">';
699
- if (data.poster) {
700
- html += '<img src="' + data.poster + '" width="' + data.width + '" height="' + data.height + '" />';
701
- }
702
- html += '</object>';
703
- return html;
704
- };
705
- const getAudioHtml = (data, audioTemplateCallback) => {
706
- if (audioTemplateCallback) {
707
- return audioTemplateCallback(data);
708
- }
709
- else {
710
- return ('<audio controls="controls" src="' + data.source + '">' +
711
- (data.altsource ?
712
- '\n<source src="' + data.altsource + '"' +
713
- (data.altsourcemime ? ' type="' + data.altsourcemime + '"' : '') +
714
- ' />\n' : '') +
715
- '</audio>');
716
- }
717
- };
718
- const getVideoHtml = (data, videoTemplateCallback) => {
719
- if (videoTemplateCallback) {
720
- return videoTemplateCallback(data);
721
- }
722
- else {
723
- return ('<video width="' + data.width +
724
- '" height="' + data.height + '"' +
725
- (data.poster ? ' poster="' + data.poster + '"' : '') + ' controls="controls">\n' +
726
- '<source src="' + data.source + '"' +
727
- (data.sourcemime ? ' type="' + data.sourcemime + '"' : '') + ' />\n' +
728
- (data.altsource ? '<source src="' + data.altsource + '"' +
729
- (data.altsourcemime ? ' type="' + data.altsourcemime + '"' : '') + ' />\n' : '') +
730
- '</video>');
731
- }
732
- };
733
- const dataToHtml = (editor, dataIn) => {
734
- const data = global$5.extend({}, dataIn);
735
- if (!data.source) {
736
- global$5.extend(data, htmlToData(data.embed ?? '', editor.schema));
737
- if (!data.source) {
738
- return '';
739
- }
740
- }
741
- if (!data.altsource) {
742
- data.altsource = '';
743
- }
744
- if (!data.poster) {
745
- data.poster = '';
746
- }
747
- data.source = editor.convertURL(data.source, 'source');
748
- data.altsource = editor.convertURL(data.altsource, 'source');
749
- data.sourcemime = guess(data.source);
750
- data.altsourcemime = guess(data.altsource);
751
- data.poster = editor.convertURL(data.poster, 'poster');
752
- const pattern = matchPattern(data.source);
753
- if (pattern) {
754
- data.source = pattern.url;
755
- data.type = pattern.type;
756
- data.allowfullscreen = pattern.allowFullscreen;
757
- data.width = data.width || String(pattern.w);
758
- data.height = data.height || String(pattern.h);
759
- }
760
- if (data.embed) {
761
- return updateHtml(data.embed, data, true, editor.schema);
762
- }
763
- else {
764
- const audioTemplateCallback = getAudioTemplateCallback(editor);
765
- const videoTemplateCallback = getVideoTemplateCallback(editor);
766
- const iframeTemplateCallback = getIframeTemplateCallback(editor);
767
- data.width = data.width || '300';
768
- data.height = data.height || '150';
769
- global$5.each(data, (value, key) => {
770
- data[key] = editor.dom.encode('' + value);
771
- });
772
- if (data.type === 'iframe') {
773
- return getIframeHtml(data, iframeTemplateCallback);
774
- }
775
- else if (data.sourcemime === 'application/x-shockwave-flash') {
776
- return getFlashHtml(data);
777
- }
778
- else if (data.sourcemime.indexOf('audio') !== -1) {
779
- return getAudioHtml(data, audioTemplateCallback);
780
- }
781
- else {
782
- return getVideoHtml(data, videoTemplateCallback);
783
- }
784
- }
785
- };
786
-
787
- const isMediaElement = (element) => element.hasAttribute('data-mce-object') || element.hasAttribute('data-ephox-embed-iri');
788
- const setup$2 = (editor) => {
789
- // TINY-10774: On Safari all events bubble out even if you click on the video play button on other browsers the video element doesn't bubble the event
790
- editor.on('mousedown', (e) => {
791
- const previewObj = editor.dom.getParent(e.target, '.mce-preview-object');
792
- if (previewObj && editor.dom.getAttrib(previewObj, 'data-mce-selected') === '2') {
793
- e.stopImmediatePropagation();
794
- }
795
- });
796
- editor.on('click keyup touchend', () => {
797
- const selectedNode = editor.selection.getNode();
798
- if (selectedNode && editor.dom.hasClass(selectedNode, 'mce-preview-object')) {
799
- if (editor.dom.getAttrib(selectedNode, 'data-mce-selected')) {
800
- selectedNode.setAttribute('data-mce-selected', '2');
801
- }
802
- }
803
- });
804
- editor.on('ObjectResized', (e) => {
805
- const target = e.target;
806
- if (target.getAttribute('data-mce-object')) {
807
- let html = target.getAttribute('data-mce-html');
808
- if (html) {
809
- html = unescape(html);
810
- target.setAttribute('data-mce-html', escape(updateHtml(html, {
811
- width: String(e.width),
812
- height: String(e.height)
813
- }, false, editor.schema)));
814
- }
815
- }
816
- });
817
- };
818
-
819
- const cache = {};
820
- const embedPromise = (data, dataToHtml, handler) => {
821
- return new Promise((res, rej) => {
822
- const wrappedResolve = (response) => {
823
- if (response.html) {
824
- cache[data.source] = response;
825
- }
826
- return res({
827
- url: data.source,
828
- html: response.html ? response.html : dataToHtml(data)
829
- });
830
- };
831
- if (cache[data.source]) {
832
- wrappedResolve(cache[data.source]);
833
- }
834
- else {
835
- handler({ url: data.source }).then(wrappedResolve).catch(rej);
836
- }
837
- });
838
- };
839
- const defaultPromise = (data, dataToHtml) => Promise.resolve({ html: dataToHtml(data), url: data.source });
840
- const loadedData = (editor) => (data) => dataToHtml(editor, data);
841
- const getEmbedHtml = (editor, data) => {
842
- const embedHandler = getUrlResolver(editor);
843
- return embedHandler ? embedPromise(data, loadedData(editor), embedHandler) : defaultPromise(data, loadedData(editor));
844
- };
845
- const isCached = (url) => has(cache, url);
846
-
847
- const extractMeta = (sourceInput, data) => get$1(data, sourceInput).bind((mainData) => get$1(mainData, 'meta'));
848
- const getValue = (data, metaData, sourceInput) => (prop) => {
849
- // Cases:
850
- // 1. Get the nested value prop (component is the executed urlinput)
851
- // 2. Get from metadata (a urlinput was executed but urlinput != this component)
852
- // 3. Not a urlinput so just get string
853
- // If prop === sourceInput do 1, 2 then 3, else do 2 then 1 or 3
854
- // ASSUMPTION: we only want to get values for props that already exist in data
855
- const getFromData = () => get$1(data, prop);
856
- const getFromMetaData = () => get$1(metaData, prop);
857
- const getNonEmptyValue = (c) => get$1(c, 'value').bind((v) => v.length > 0 ? Optional.some(v) : Optional.none());
858
- const getFromValueFirst = () => getFromData().bind((child) => isObject(child)
859
- ? getNonEmptyValue(child).orThunk(getFromMetaData)
860
- : getFromMetaData().orThunk(() => Optional.from(child)));
861
- const getFromMetaFirst = () => getFromMetaData().orThunk(() => getFromData().bind((child) => isObject(child)
862
- ? getNonEmptyValue(child)
863
- : Optional.from(child)));
864
- return { [prop]: (prop === sourceInput ? getFromValueFirst() : getFromMetaFirst()).getOr('') };
865
- };
866
- const getDimensions = (data, metaData) => {
867
- const dimensions = {};
868
- get$1(data, 'dimensions').each((dims) => {
869
- each$1(['width', 'height'], (prop) => {
870
- get$1(metaData, prop).orThunk(() => get$1(dims, prop)).each((value) => dimensions[prop] = value);
871
- });
872
- });
873
- return dimensions;
874
- };
875
- const unwrap = (data, sourceInput) => {
876
- const metaData = sourceInput && sourceInput !== 'dimensions' ? extractMeta(sourceInput, data).getOr({}) : {};
877
- const get = getValue(data, metaData, sourceInput);
878
- return {
879
- ...get('source'),
880
- ...get('altsource'),
881
- ...get('poster'),
882
- ...get('embed'),
883
- ...getDimensions(data, metaData)
884
- };
885
- };
886
- const wrap = (data) => {
887
- const wrapped = {
888
- ...data,
889
- source: { value: get$1(data, 'source').getOr('') },
890
- altsource: { value: get$1(data, 'altsource').getOr('') },
891
- poster: { value: get$1(data, 'poster').getOr('') }
892
- };
893
- // Add additional size values that may or may not have been in the html
894
- each$1(['width', 'height'], (prop) => {
895
- get$1(data, prop).each((value) => {
896
- const dimensions = wrapped.dimensions || {};
897
- dimensions[prop] = value;
898
- wrapped.dimensions = dimensions;
899
- });
900
- });
901
- return wrapped;
902
- };
903
- const handleError = (editor) => (error) => {
904
- const errorMessage = error && error.msg ?
905
- 'Media embed handler error: ' + error.msg :
906
- 'Media embed handler threw unknown error.';
907
- editor.notificationManager.open({ type: 'error', text: errorMessage });
908
- };
909
- const getEditorData = (editor) => {
910
- const element = editor.selection.getNode();
911
- const snippet = isMediaElement(element) ? editor.serializer.serialize(element, { selection: true }) : '';
912
- const data = htmlToData(snippet, editor.schema);
913
- const getDimensionsOfElement = () => {
914
- if (isEmbedIframe(data.source, data.type)) {
915
- const rect = editor.dom.getRect(element);
916
- return {
917
- width: rect.w.toString().replace(/px$/, ''),
918
- height: rect.h.toString().replace(/px$/, ''),
919
- };
920
- }
921
- else {
922
- return {};
923
- }
924
- };
925
- const dimensions = getDimensionsOfElement();
926
- return {
927
- embed: snippet,
928
- ...data,
929
- ...dimensions
930
- };
931
- };
932
- const addEmbedHtml = (api, editor) => (response) => {
933
- // Only set values if a URL has been defined
934
- if (isString(response.url) && response.url.trim().length > 0) {
935
- const html = response.html;
936
- const snippetData = htmlToData(html, editor.schema);
937
- const nuData = {
938
- ...snippetData,
939
- source: response.url,
940
- embed: html
941
- };
942
- api.setData(wrap(nuData));
943
- }
944
- };
945
- const selectPlaceholder = (editor, beforeObjects) => {
946
- const afterObjects = editor.dom.select('*[data-mce-object]');
947
- // Find new image placeholder so we can select it
948
- for (let i = 0; i < beforeObjects.length; i++) {
949
- for (let y = afterObjects.length - 1; y >= 0; y--) {
950
- if (beforeObjects[i] === afterObjects[y]) {
951
- afterObjects.splice(y, 1);
952
- }
953
- }
954
- }
955
- editor.selection.select(afterObjects[0]);
956
- };
957
- const handleInsert = (editor, html) => {
958
- const beforeObjects = editor.dom.select('*[data-mce-object]');
959
- editor.insertContent(html);
960
- selectPlaceholder(editor, beforeObjects);
961
- editor.nodeChanged();
962
- };
963
- const isEmbedIframe = (url, mediaDataType) => isNonNullable(mediaDataType) && mediaDataType === 'ephox-embed-iri' && isNonNullable(matchPattern(url));
964
- const shouldInsertAsNewIframe = (prevData, newData) => {
965
- const hasDimensionsChanged = (prevData, newData) => prevData.width !== newData.width || prevData.height !== newData.height;
966
- return hasDimensionsChanged(prevData, newData) && isEmbedIframe(newData.source, prevData.type);
967
- };
968
- const submitForm = (prevData, newData, editor) => {
969
- newData.embed =
970
- shouldInsertAsNewIframe(prevData, newData) && hasDimensions(editor)
971
- ? dataToHtml(editor, { ...newData, embed: '' })
972
- : updateHtml(newData.embed ?? '', newData, false, editor.schema);
973
- // Only fetch the embed HTML content if the URL has changed from what it previously was
974
- if (newData.embed && (prevData.source === newData.source || isCached(newData.source))) {
975
- handleInsert(editor, newData.embed);
976
- }
977
- else {
978
- getEmbedHtml(editor, newData)
979
- .then((response) => {
980
- handleInsert(editor, response.html);
981
- }).catch(handleError(editor));
982
- }
983
- };
984
- const showDialog = (editor) => {
985
- const editorData = getEditorData(editor);
986
- const currentData = Cell(editorData);
987
- const initialData = wrap(editorData);
988
- const handleSource = (prevData, api) => {
989
- const serviceData = unwrap(api.getData(), 'source');
990
- // If a new URL is entered, then clear the embed html and fetch the new data
991
- if (prevData.source !== serviceData.source) {
992
- addEmbedHtml(win, editor)({ url: serviceData.source, html: '' });
993
- getEmbedHtml(editor, serviceData)
994
- .then(addEmbedHtml(win, editor))
995
- .catch(handleError(editor));
996
- }
997
- };
998
- const handleEmbed = (api) => {
999
- const data = unwrap(api.getData());
1000
- const dataFromEmbed = htmlToData(data.embed ?? '', editor.schema);
1001
- api.setData(wrap(dataFromEmbed));
1002
- };
1003
- const handleUpdate = (api, sourceInput, prevData) => {
1004
- const dialogData = unwrap(api.getData(), sourceInput);
1005
- const data = shouldInsertAsNewIframe(prevData, dialogData) && hasDimensions(editor)
1006
- ? { ...dialogData, embed: '' }
1007
- : dialogData;
1008
- const embed = dataToHtml(editor, data);
1009
- api.setData(wrap({
1010
- ...data,
1011
- embed
1012
- }));
1013
- };
1014
- const mediaInput = [{
1015
- name: 'source',
1016
- type: 'urlinput',
1017
- filetype: 'media',
1018
- label: 'Source',
1019
- picker_text: 'Browse files'
1020
- }];
1021
- const sizeInput = !hasDimensions(editor) ? [] : [{
1022
- type: 'sizeinput',
1023
- name: 'dimensions',
1024
- label: 'Constrain proportions',
1025
- constrain: true
1026
- }];
1027
- const generalTab = {
1028
- title: 'General',
1029
- name: 'general',
1030
- items: flatten([mediaInput, sizeInput])
1031
- };
1032
- const embedTextarea = {
1033
- type: 'textarea',
1034
- name: 'embed',
1035
- label: 'Paste your embed code below:'
1036
- };
1037
- const embedTab = {
1038
- title: 'Embed',
1039
- items: [
1040
- embedTextarea
1041
- ]
1042
- };
1043
- const advancedFormItems = [];
1044
- if (hasAltSource(editor)) {
1045
- advancedFormItems.push({
1046
- name: 'altsource',
1047
- type: 'urlinput',
1048
- filetype: 'media',
1049
- label: 'Alternative source URL'
1050
- });
1051
- }
1052
- if (hasPoster(editor)) {
1053
- advancedFormItems.push({
1054
- name: 'poster',
1055
- type: 'urlinput',
1056
- filetype: 'image',
1057
- label: 'Media poster (Image URL)'
1058
- });
1059
- }
1060
- const advancedTab = {
1061
- title: 'Advanced',
1062
- name: 'advanced',
1063
- items: advancedFormItems
1064
- };
1065
- const tabs = [
1066
- generalTab,
1067
- embedTab
1068
- ];
1069
- if (advancedFormItems.length > 0) {
1070
- tabs.push(advancedTab);
1071
- }
1072
- const body = {
1073
- type: 'tabpanel',
1074
- tabs
1075
- };
1076
- const win = editor.windowManager.open({
1077
- title: 'Insert/Edit Media',
1078
- size: 'normal',
1079
- body,
1080
- buttons: [
1081
- {
1082
- type: 'cancel',
1083
- name: 'cancel',
1084
- text: 'Cancel'
1085
- },
1086
- {
1087
- type: 'submit',
1088
- name: 'save',
1089
- text: 'Save',
1090
- primary: true
1091
- }
1092
- ],
1093
- onSubmit: (api) => {
1094
- const serviceData = unwrap(api.getData());
1095
- submitForm(currentData.get(), serviceData, editor);
1096
- api.close();
1097
- },
1098
- onChange: (api, detail) => {
1099
- switch (detail.name) {
1100
- case 'source':
1101
- handleSource(currentData.get(), api);
1102
- break;
1103
- case 'embed':
1104
- handleEmbed(api);
1105
- break;
1106
- case 'dimensions':
1107
- case 'altsource':
1108
- case 'poster':
1109
- handleUpdate(api, detail.name, currentData.get());
1110
- break;
1111
- }
1112
- currentData.set(unwrap(api.getData()));
1113
- },
1114
- initialData
1115
- });
1116
- };
1117
-
1118
- const get = (editor) => {
1119
- const showDialog$1 = () => {
1120
- showDialog(editor);
1121
- };
1122
- return {
1123
- showDialog: showDialog$1
1124
- };
1125
- };
1126
-
1127
- const register$1 = (editor) => {
1128
- const showDialog$1 = () => {
1129
- showDialog(editor);
1130
- };
1131
- editor.addCommand('mceMedia', showDialog$1);
1132
- };
1133
-
1134
- var global = tinymce.util.Tools.resolve('tinymce.Env');
1135
-
1136
- const isLiveEmbedNode = (node) => {
1137
- const name = node.name;
1138
- return name === 'iframe' || name === 'video' || name === 'audio';
1139
- };
1140
- const getDimension = (node, styles, dimension, defaultValue = null) => {
1141
- const value = node.attr(dimension);
1142
- if (isNonNullable(value)) {
1143
- return value;
1144
- }
1145
- else if (!has(styles, dimension)) {
1146
- return defaultValue;
1147
- }
1148
- else {
1149
- return null;
1150
- }
1151
- };
1152
- const setDimensions = (node, previewNode, styles) => {
1153
- // Apply dimensions for video elements to maintain legacy behaviour
1154
- const useDefaults = previewNode.name === 'img' || node.name === 'video';
1155
- // Determine the defaults
1156
- const defaultWidth = useDefaults ? '300' : null;
1157
- const fallbackHeight = node.name === 'audio' ? '30' : '150';
1158
- const defaultHeight = useDefaults ? fallbackHeight : null;
1159
- previewNode.attr({
1160
- width: getDimension(node, styles, 'width', defaultWidth),
1161
- height: getDimension(node, styles, 'height', defaultHeight)
1162
- });
1163
- };
1164
- const appendNodeContent = (editor, nodeName, previewNode, html) => {
1165
- const newNode = Parser(editor.schema).parse(html, { context: nodeName });
1166
- while (newNode.firstChild) {
1167
- previewNode.append(newNode.firstChild);
1168
- }
1169
- };
1170
- const createPlaceholderNode = (editor, node) => {
1171
- const name = node.name;
1172
- const placeHolder = new global$2('img', 1);
1173
- retainAttributesAndInnerHtml(editor, node, placeHolder);
1174
- setDimensions(node, placeHolder, {});
1175
- placeHolder.attr({
1176
- 'style': node.attr('style'),
1177
- 'src': global.transparentSrc,
1178
- 'data-mce-object': name,
1179
- 'class': 'mce-object mce-object-' + name
1180
- });
1181
- return placeHolder;
1182
- };
1183
- const createPreviewNode = (editor, node) => {
1184
- const name = node.name;
1185
- const previewWrapper = new global$2('span', 1);
1186
- previewWrapper.attr({
1187
- 'contentEditable': 'false',
1188
- 'style': node.attr('style'),
1189
- 'data-mce-object': name,
1190
- 'class': 'mce-preview-object mce-object-' + name
1191
- });
1192
- retainAttributesAndInnerHtml(editor, node, previewWrapper);
1193
- const styles = editor.dom.parseStyle(node.attr('style') ?? '');
1194
- const previewNode = new global$2(name, 1);
1195
- setDimensions(node, previewNode, styles);
1196
- previewNode.attr({
1197
- src: node.attr('src'),
1198
- style: node.attr('style'),
1199
- class: node.attr('class')
1200
- });
1201
- if (name === 'iframe') {
1202
- previewNode.attr({
1203
- allowfullscreen: node.attr('allowfullscreen'),
1204
- frameborder: '0',
1205
- sandbox: node.attr('sandbox'),
1206
- referrerpolicy: node.attr('referrerpolicy')
1207
- });
1208
- }
1209
- else {
1210
- // Exclude autoplay as we don't want video/audio to play by default
1211
- const attrs = ['controls', 'crossorigin', 'currentTime', 'loop', 'muted', 'poster', 'preload'];
1212
- each$1(attrs, (attrName) => {
1213
- previewNode.attr(attrName, node.attr(attrName));
1214
- });
1215
- // Recreate the child nodes using the sanitized inner HTML
1216
- const sanitizedHtml = previewWrapper.attr('data-mce-html');
1217
- if (isNonNullable(sanitizedHtml)) {
1218
- appendNodeContent(editor, name, previewNode, unescape(sanitizedHtml));
1219
- }
1220
- }
1221
- const shimNode = new global$2('span', 1);
1222
- shimNode.attr('class', 'mce-shim');
1223
- previewWrapper.append(previewNode);
1224
- previewWrapper.append(shimNode);
1225
- return previewWrapper;
1226
- };
1227
- const retainAttributesAndInnerHtml = (editor, sourceNode, targetNode) => {
1228
- // Prefix all attributes except internal (data-mce-*), width, height and style since we
1229
- // will add these to the placeholder
1230
- const attribs = sourceNode.attributes ?? [];
1231
- let ai = attribs.length;
1232
- while (ai--) {
1233
- const attrName = attribs[ai].name;
1234
- let attrValue = attribs[ai].value;
1235
- if (attrName !== 'width' && attrName !== 'height' && attrName !== 'style' && !startsWith(attrName, 'data-mce-')) {
1236
- if (attrName === 'data' || attrName === 'src') {
1237
- attrValue = editor.convertURL(attrValue, attrName);
1238
- }
1239
- targetNode.attr('data-mce-p-' + attrName, attrValue);
1240
- }
1241
- }
1242
- // Place the inner HTML contents inside an escaped attribute
1243
- // This enables us to copy/paste the fake object
1244
- const serializer = global$1({ inner: true }, editor.schema);
1245
- const tempNode = new global$2('div', 1);
1246
- each$1(sourceNode.children(), (child) => tempNode.append(child));
1247
- const innerHtml = serializer.serialize(tempNode);
1248
- if (innerHtml) {
1249
- targetNode.attr('data-mce-html', escape(innerHtml));
1250
- targetNode.empty();
1251
- }
1252
- };
1253
- const isPageEmbedWrapper = (node) => {
1254
- const nodeClass = node.attr('class');
1255
- return isString(nodeClass) && /\btiny-pageembed\b/.test(nodeClass);
1256
- };
1257
- const isWithinEmbedWrapper = (node) => {
1258
- let tempNode = node;
1259
- while ((tempNode = tempNode.parent)) {
1260
- if (tempNode.attr('data-ephox-embed-iri') || isPageEmbedWrapper(tempNode)) {
1261
- return true;
1262
- }
1263
- }
1264
- return false;
1265
- };
1266
- const placeHolderConverter = (editor) => (nodes) => {
1267
- let i = nodes.length;
1268
- let node;
1269
- while (i--) {
1270
- node = nodes[i];
1271
- if (!node.parent) {
1272
- continue;
1273
- }
1274
- if (node.parent.attr('data-mce-object')) {
1275
- continue;
1276
- }
1277
- if (isLiveEmbedNode(node) && hasLiveEmbeds(editor)) {
1278
- if (!isWithinEmbedWrapper(node)) {
1279
- node.replace(createPreviewNode(editor, node));
1280
- }
1281
- }
1282
- else {
1283
- if (!isWithinEmbedWrapper(node)) {
1284
- node.replace(createPlaceholderNode(editor, node));
1285
- }
1286
- }
1287
- }
1288
- };
1289
-
1290
- const parseAndSanitize = (editor, context, html) => {
1291
- const getEditorOption = editor.options.get;
1292
- const sanitize = getEditorOption('xss_sanitization');
1293
- const validate = shouldFilterHtml(editor);
1294
- return Parser(editor.schema, { sanitize, validate }).parse(html, { context });
1295
- };
1296
-
1297
- const setup$1 = (editor) => {
1298
- editor.on('PreInit', () => {
1299
- const { schema, serializer, parser } = editor;
1300
- // Set browser specific allowFullscreen attribs as boolean
1301
- const boolAttrs = schema.getBoolAttrs();
1302
- each$1('webkitallowfullscreen mozallowfullscreen'.split(' '), (name) => {
1303
- boolAttrs[name] = {};
1304
- });
1305
- // Add some non-standard attributes to the schema
1306
- each({
1307
- embed: ['wmode']
1308
- }, (attrs, name) => {
1309
- const rule = schema.getElementRule(name);
1310
- if (rule) {
1311
- each$1(attrs, (attr) => {
1312
- rule.attributes[attr] = {};
1313
- rule.attributesOrder.push(attr);
1314
- });
1315
- }
1316
- });
1317
- // Converts iframe, video etc into placeholder images
1318
- parser.addNodeFilter('iframe,video,audio,object,embed', placeHolderConverter(editor));
1319
- // Replaces placeholder images with real elements for video, object, iframe etc
1320
- serializer.addAttributeFilter('data-mce-object', (nodes, name) => {
1321
- let i = nodes.length;
1322
- while (i--) {
1323
- const node = nodes[i];
1324
- if (!node.parent) {
1325
- continue;
1326
- }
1327
- const realElmName = node.attr(name);
1328
- const realElm = new global$2(realElmName, 1);
1329
- // Add width/height to everything but audio
1330
- if (realElmName !== 'audio') {
1331
- const className = node.attr('class');
1332
- if (className && className.indexOf('mce-preview-object') !== -1 && node.firstChild) {
1333
- realElm.attr({
1334
- width: node.firstChild.attr('width'),
1335
- height: node.firstChild.attr('height')
1336
- });
1337
- }
1338
- else {
1339
- realElm.attr({
1340
- width: node.attr('width'),
1341
- height: node.attr('height')
1342
- });
1343
- }
1344
- }
1345
- realElm.attr({
1346
- style: node.attr('style')
1347
- });
1348
- // Unprefix all placeholder attributes
1349
- const attribs = node.attributes ?? [];
1350
- let ai = attribs.length;
1351
- while (ai--) {
1352
- const attrName = attribs[ai].name;
1353
- if (attrName.indexOf('data-mce-p-') === 0) {
1354
- realElm.attr(attrName.substr(11), attribs[ai].value);
1355
- }
1356
- }
1357
- // Inject innerhtml
1358
- const innerHtml = node.attr('data-mce-html');
1359
- if (innerHtml) {
1360
- const fragment = parseAndSanitize(editor, realElmName, unescape(innerHtml));
1361
- each$1(fragment.children(), (child) => realElm.append(child));
1362
- }
1363
- node.replace(realElm);
1364
- }
1365
- });
1366
- });
1367
- editor.on('SetContent', () => {
1368
- // TODO: This shouldn't be needed there should be a way to mark bogus
1369
- // elements so they are never removed except external save
1370
- const dom = editor.dom;
1371
- each$1(dom.select('span.mce-preview-object'), (elm) => {
1372
- if (dom.select('span.mce-shim', elm).length === 0) {
1373
- dom.add(elm, 'span', { class: 'mce-shim' });
1374
- }
1375
- });
1376
- });
1377
- };
1378
-
1379
- const setup = (editor) => {
1380
- editor.on('ResolveName', (e) => {
1381
- let name;
1382
- if (e.target.nodeType === 1 && (name = e.target.getAttribute('data-mce-object'))) {
1383
- e.name = name;
1384
- }
1385
- });
1386
- };
1387
-
1388
- const onSetupEditable = (editor) => (api) => {
1389
- const nodeChanged = () => {
1390
- api.setEnabled(editor.selection.isEditable());
1391
- };
1392
- editor.on('NodeChange', nodeChanged);
1393
- nodeChanged();
1394
- return () => {
1395
- editor.off('NodeChange', nodeChanged);
1396
- };
1397
- };
1398
- const register = (editor) => {
1399
- const onAction = () => editor.execCommand('mceMedia');
1400
- editor.ui.registry.addToggleButton('media', {
1401
- tooltip: 'Insert/edit media',
1402
- icon: 'embed',
1403
- onAction,
1404
- onSetup: (buttonApi) => {
1405
- const selection = editor.selection;
1406
- buttonApi.setActive(isMediaElement(selection.getNode()));
1407
- const unbindSelectorChanged = selection.selectorChangedWithUnbind('img[data-mce-object],span[data-mce-object],div[data-ephox-embed-iri]', buttonApi.setActive).unbind;
1408
- const unbindEditable = onSetupEditable(editor)(buttonApi);
1409
- return () => {
1410
- unbindSelectorChanged();
1411
- unbindEditable();
1412
- };
1413
- }
1414
- });
1415
- editor.ui.registry.addMenuItem('media', {
1416
- icon: 'embed',
1417
- text: 'Media...',
1418
- onAction,
1419
- onSetup: onSetupEditable(editor)
1420
- });
1421
- };
1422
-
1423
- var Plugin = () => {
1424
- global$6.add('media', (editor) => {
1425
- register$2(editor);
1426
- register$1(editor);
1427
- register(editor);
1428
- setup(editor);
1429
- setup$1(editor);
1430
- setup$2(editor);
1431
- return get(editor);
1432
- });
1433
- };
1434
-
1435
- Plugin();
1436
- /** *****
1437
- * DO NOT EXPORT ANYTHING
1438
- *
1439
- * IF YOU DO ROLLUP WILL LEAVE A GLOBAL ON THE PAGE
1440
- *******/
1441
-
1442
- })();