@novaprose/core 0.7.0 → 0.9.0

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 (347) hide show
  1. package/README.md +15 -2
  2. package/dist/a11y.cjs +314 -0
  3. package/dist/a11y.cjs.map +1 -0
  4. package/dist/a11y.d.cts +51 -0
  5. package/dist/a11y.d.ts +51 -0
  6. package/dist/a11y.js +11 -0
  7. package/dist/a11y.js.map +1 -0
  8. package/dist/a11ychecker-6ES3UMU3.js +449 -0
  9. package/dist/a11ychecker-6ES3UMU3.js.map +1 -0
  10. package/dist/accordion-ui-B4I2FJXE.js +201 -0
  11. package/dist/accordion-ui-B4I2FJXE.js.map +1 -0
  12. package/dist/advcode-7S6N64C7.js +51 -0
  13. package/dist/advcode-7S6N64C7.js.map +1 -0
  14. package/dist/advcode-editor-ENCPFVLO.js +257 -0
  15. package/dist/advcode-editor-ENCPFVLO.js.map +1 -0
  16. package/dist/{advlist-5FNKPLUX.js → advlist-FEDGNLMQ.js} +10 -7
  17. package/dist/advlist-FEDGNLMQ.js.map +1 -0
  18. package/dist/advtable-ui-JAVJY4L4.js +364 -0
  19. package/dist/advtable-ui-JAVJY4L4.js.map +1 -0
  20. package/dist/ai-5KM776QW.js +1485 -0
  21. package/dist/ai-5KM776QW.js.map +1 -0
  22. package/dist/anchor-ui-VPKNKZ7J.js +81 -0
  23. package/dist/anchor-ui-VPKNKZ7J.js.map +1 -0
  24. package/dist/autocorrect-5QLICCRN.js +851 -0
  25. package/dist/autocorrect-5QLICCRN.js.map +1 -0
  26. package/dist/{autolink-45LTODWB.js → autolink-ZYIPRXBA.js} +11 -8
  27. package/dist/autolink-ZYIPRXBA.js.map +1 -0
  28. package/dist/{autoresize-UB3GOA6D.js → autoresize-YRZAVCNO.js} +2 -2
  29. package/dist/autoresize-YRZAVCNO.js.map +1 -0
  30. package/dist/{autosave-GMWJ5BPE.js → autosave-IC7YYG44.js} +7 -7
  31. package/dist/autosave-IC7YYG44.js.map +1 -0
  32. package/dist/casechange-R7IO2APS.js +201 -0
  33. package/dist/casechange-R7IO2APS.js.map +1 -0
  34. package/dist/{charmap-2GC7LF7G.js → charmap-CARYZFKD.js} +7 -7
  35. package/dist/charmap-CARYZFKD.js.map +1 -0
  36. package/dist/checklist-7E47QW6L.js +189 -0
  37. package/dist/checklist-7E47QW6L.js.map +1 -0
  38. package/dist/chunk-23ZLVT5D.js +163 -0
  39. package/dist/chunk-23ZLVT5D.js.map +1 -0
  40. package/dist/{chunk-ND2CWNVG.js → chunk-3BOK3S3T.js} +2 -27
  41. package/dist/chunk-3BOK3S3T.js.map +1 -0
  42. package/dist/chunk-3KBQEAX2.js +926 -0
  43. package/dist/chunk-3KBQEAX2.js.map +1 -0
  44. package/dist/chunk-3NNILZVB.js +259 -0
  45. package/dist/chunk-3NNILZVB.js.map +1 -0
  46. package/dist/{chunk-PVFKXRID.js → chunk-4VPDY3LF.js} +1 -1
  47. package/dist/chunk-4VPDY3LF.js.map +1 -0
  48. package/dist/chunk-53AY5NAF.js +214 -0
  49. package/dist/chunk-53AY5NAF.js.map +1 -0
  50. package/dist/{chunk-5AW2HHG6.js → chunk-5KERLFDD.js} +50 -3
  51. package/dist/chunk-5KERLFDD.js.map +1 -0
  52. package/dist/{chunk-FCMZ7TUQ.js → chunk-6BJEOL5V.js} +296 -43
  53. package/dist/chunk-6BJEOL5V.js.map +1 -0
  54. package/dist/chunk-6LQM7G4V.js +159 -0
  55. package/dist/chunk-6LQM7G4V.js.map +1 -0
  56. package/dist/chunk-AB67XUSR.js +178 -0
  57. package/dist/chunk-AB67XUSR.js.map +1 -0
  58. package/dist/chunk-ANE5ASXG.js +26 -0
  59. package/dist/chunk-ANE5ASXG.js.map +1 -0
  60. package/dist/{chunk-Z3ELZ77W.js → chunk-AP2PJFLB.js} +5 -2
  61. package/dist/chunk-AP2PJFLB.js.map +1 -0
  62. package/dist/chunk-ARBKIZZU.js +137 -0
  63. package/dist/chunk-ARBKIZZU.js.map +1 -0
  64. package/dist/chunk-AUQSATWL.js +322 -0
  65. package/dist/chunk-AUQSATWL.js.map +1 -0
  66. package/dist/chunk-BMCH63QN.js +165 -0
  67. package/dist/chunk-BMCH63QN.js.map +1 -0
  68. package/dist/chunk-BUABAYZL.js +160 -0
  69. package/dist/chunk-BUABAYZL.js.map +1 -0
  70. package/dist/chunk-DCMPJ25E.js +140 -0
  71. package/dist/chunk-DCMPJ25E.js.map +1 -0
  72. package/dist/chunk-DV7TGRU6.js +47 -0
  73. package/dist/chunk-DV7TGRU6.js.map +1 -0
  74. package/dist/chunk-F2WT77ZG.js +163 -0
  75. package/dist/chunk-F2WT77ZG.js.map +1 -0
  76. package/dist/chunk-FNJ7AEJK.js +955 -0
  77. package/dist/chunk-FNJ7AEJK.js.map +1 -0
  78. package/dist/chunk-G74HNSB6.js +9 -0
  79. package/dist/chunk-G74HNSB6.js.map +1 -0
  80. package/dist/chunk-GTLE2HEW.js +108 -0
  81. package/dist/chunk-GTLE2HEW.js.map +1 -0
  82. package/dist/chunk-GUZCRDK6.js +143 -0
  83. package/dist/chunk-GUZCRDK6.js.map +1 -0
  84. package/dist/chunk-HNEAVVBC.js +98 -0
  85. package/dist/chunk-HNEAVVBC.js.map +1 -0
  86. package/dist/chunk-HSVNJGK3.js +1149 -0
  87. package/dist/chunk-HSVNJGK3.js.map +1 -0
  88. package/dist/chunk-IFSD6O5M.js +29 -0
  89. package/dist/chunk-IFSD6O5M.js.map +1 -0
  90. package/dist/{table-SSNABG5W.js → chunk-IO5PU52K.js} +119 -61
  91. package/dist/chunk-IO5PU52K.js.map +1 -0
  92. package/dist/chunk-K4LFGNS7.js +137 -0
  93. package/dist/chunk-K4LFGNS7.js.map +1 -0
  94. package/dist/chunk-KGEHUWGL.js +79 -0
  95. package/dist/chunk-KGEHUWGL.js.map +1 -0
  96. package/dist/chunk-KW6ATQPN.js +151 -0
  97. package/dist/chunk-KW6ATQPN.js.map +1 -0
  98. package/dist/chunk-NX3KWIP5.js +207 -0
  99. package/dist/chunk-NX3KWIP5.js.map +1 -0
  100. package/dist/chunk-OOVNE6MB.js +28 -0
  101. package/dist/chunk-OOVNE6MB.js.map +1 -0
  102. package/dist/chunk-OQMMHWMZ.js +7 -0
  103. package/dist/chunk-OQMMHWMZ.js.map +1 -0
  104. package/dist/{chunk-JPJVTB45.js → chunk-QU3KXMYT.js} +8 -2
  105. package/dist/chunk-QU3KXMYT.js.map +1 -0
  106. package/dist/chunk-QWT56RVG.js +158 -0
  107. package/dist/chunk-QWT56RVG.js.map +1 -0
  108. package/dist/chunk-RJ7T56OH.js +3787 -0
  109. package/dist/chunk-RJ7T56OH.js.map +1 -0
  110. package/dist/{chunk-KWXFL4WS.js → chunk-RPHA4HRX.js} +8 -5
  111. package/dist/chunk-RPHA4HRX.js.map +1 -0
  112. package/dist/chunk-S4DCQA74.js +66 -0
  113. package/dist/chunk-S4DCQA74.js.map +1 -0
  114. package/dist/chunk-SCIRO4XK.js +144 -0
  115. package/dist/chunk-SCIRO4XK.js.map +1 -0
  116. package/dist/chunk-SNVYHGGO.js +127 -0
  117. package/dist/chunk-SNVYHGGO.js.map +1 -0
  118. package/dist/chunk-T4543CB2.js +67 -0
  119. package/dist/chunk-T4543CB2.js.map +1 -0
  120. package/dist/{chunk-T3GY6IVK.js → chunk-UHUOAQA6.js} +71 -9
  121. package/dist/chunk-UHUOAQA6.js.map +1 -0
  122. package/dist/chunk-UTMS2P2K.js +288 -0
  123. package/dist/chunk-UTMS2P2K.js.map +1 -0
  124. package/dist/{chunk-HPLT3XRZ.js → chunk-V7WUHUHM.js} +13 -1
  125. package/dist/chunk-V7WUHUHM.js.map +1 -0
  126. package/dist/chunk-WAOU5NGN.js +430 -0
  127. package/dist/chunk-WAOU5NGN.js.map +1 -0
  128. package/dist/{chunk-R2UMUCVI.js → chunk-XCXJD5DO.js} +53 -8
  129. package/dist/chunk-XCXJD5DO.js.map +1 -0
  130. package/dist/chunk-XIH4SCO6.js +112 -0
  131. package/dist/chunk-XIH4SCO6.js.map +1 -0
  132. package/dist/chunk-XR7CY4NI.js +11 -0
  133. package/dist/chunk-XR7CY4NI.js.map +1 -0
  134. package/dist/chunk-Y2OXWCM7.js +263 -0
  135. package/dist/chunk-Y2OXWCM7.js.map +1 -0
  136. package/dist/chunk-YDF55N6Z.js +164 -0
  137. package/dist/chunk-YDF55N6Z.js.map +1 -0
  138. package/dist/chunk-YOTA26H7.js +373 -0
  139. package/dist/chunk-YOTA26H7.js.map +1 -0
  140. package/dist/chunk-YP7N47QR.js +101 -0
  141. package/dist/chunk-YP7N47QR.js.map +1 -0
  142. package/dist/{chunk-KPE3QRPB.js → chunk-YYCDRUE2.js} +16 -315
  143. package/dist/chunk-YYCDRUE2.js.map +1 -0
  144. package/dist/codesample-FOWXMCTC.js +546 -0
  145. package/dist/codesample-FOWXMCTC.js.map +1 -0
  146. package/dist/{comments-panel-HXMWSRAW.js → comments-panel-SOLBZ46Q.js} +9 -5
  147. package/dist/comments-panel-SOLBZ46Q.js.map +1 -0
  148. package/dist/{directionality-5JLWQGP2.js → directionality-BXWXNPRZ.js} +13 -10
  149. package/dist/directionality-BXWXNPRZ.js.map +1 -0
  150. package/dist/document-B0hLRhuH.d.cts +39 -0
  151. package/dist/document-Dh-jz1SK.d.ts +39 -0
  152. package/dist/docx.cjs +23575 -0
  153. package/dist/docx.cjs.map +1 -0
  154. package/dist/docx.d.cts +83 -0
  155. package/dist/docx.d.ts +83 -0
  156. package/dist/docx.js +1826 -0
  157. package/dist/docx.js.map +1 -0
  158. package/dist/draghandle-3IBHVHDE.js +389 -0
  159. package/dist/draghandle-3IBHVHDE.js.map +1 -0
  160. package/dist/editimage-GTLFGHYU.js +683 -0
  161. package/dist/editimage-GTLFGHYU.js.map +1 -0
  162. package/dist/editor-DnAN9aPd.d.ts +2948 -0
  163. package/dist/editor-S8w_w5W0.d.cts +2948 -0
  164. package/dist/email-FDSENENR.js +177 -0
  165. package/dist/email-FDSENENR.js.map +1 -0
  166. package/dist/email.cjs +588 -0
  167. package/dist/email.cjs.map +1 -0
  168. package/dist/email.d.cts +7 -0
  169. package/dist/email.d.ts +7 -0
  170. package/dist/email.js +21 -0
  171. package/dist/email.js.map +1 -0
  172. package/dist/{emoticons-ZD6ZRIWG.js → emoticons-SHYSAEID.js} +7 -7
  173. package/dist/emoticons-SHYSAEID.js.map +1 -0
  174. package/dist/exportpdf-TEBDQZSN.js +91 -0
  175. package/dist/exportpdf-TEBDQZSN.js.map +1 -0
  176. package/dist/exportword-BGH2CZXO.js +16 -0
  177. package/dist/exportword-BGH2CZXO.js.map +1 -0
  178. package/dist/footnotes-ui-KPKFDSN7.js +449 -0
  179. package/dist/footnotes-ui-KPKFDSN7.js.map +1 -0
  180. package/dist/form-dialog-SNWFPM2K.js +379 -0
  181. package/dist/form-dialog-SNWFPM2K.js.map +1 -0
  182. package/dist/formatpainter-CB4ZTKR5.js +209 -0
  183. package/dist/formatpainter-CB4ZTKR5.js.map +1 -0
  184. package/dist/fullpagehtml-ui-JPGRMXHD.js +220 -0
  185. package/dist/fullpagehtml-ui-JPGRMXHD.js.map +1 -0
  186. package/dist/html-rules-api-BLDDW9MO.d.cts +42 -0
  187. package/dist/html-rules-api-BLDDW9MO.d.ts +42 -0
  188. package/dist/html-rules.cjs +21 -19
  189. package/dist/html-rules.cjs.map +1 -1
  190. package/dist/html-rules.d.cts +37 -35
  191. package/dist/html-rules.d.ts +37 -35
  192. package/dist/html-rules.js +26 -22
  193. package/dist/html-rules.js.map +1 -1
  194. package/dist/i18n/de.cjs +349 -0
  195. package/dist/i18n/de.cjs.map +1 -1
  196. package/dist/i18n/de.d.cts +1 -1
  197. package/dist/i18n/de.d.ts +1 -1
  198. package/dist/i18n/de.js +349 -0
  199. package/dist/i18n/de.js.map +1 -1
  200. package/dist/i18n/es.cjs +349 -0
  201. package/dist/i18n/es.cjs.map +1 -1
  202. package/dist/i18n/es.d.cts +1 -1
  203. package/dist/i18n/es.d.ts +1 -1
  204. package/dist/i18n/es.js +349 -0
  205. package/dist/i18n/es.js.map +1 -1
  206. package/dist/i18n/fr.cjs +349 -0
  207. package/dist/i18n/fr.cjs.map +1 -1
  208. package/dist/i18n/fr.d.cts +1 -1
  209. package/dist/i18n/fr.d.ts +1 -1
  210. package/dist/i18n/fr.js +349 -0
  211. package/dist/i18n/fr.js.map +1 -1
  212. package/dist/i18n/it.cjs +349 -0
  213. package/dist/i18n/it.cjs.map +1 -1
  214. package/dist/i18n/it.d.cts +1 -1
  215. package/dist/i18n/it.d.ts +1 -1
  216. package/dist/i18n/it.js +349 -0
  217. package/dist/i18n/it.js.map +1 -1
  218. package/dist/i18n/pt-BR.cjs +349 -0
  219. package/dist/i18n/pt-BR.cjs.map +1 -1
  220. package/dist/i18n/pt-BR.d.cts +1 -1
  221. package/dist/i18n/pt-BR.d.ts +1 -1
  222. package/dist/i18n/pt-BR.js +349 -0
  223. package/dist/i18n/pt-BR.js.map +1 -1
  224. package/dist/i18n/ru.cjs +349 -0
  225. package/dist/i18n/ru.cjs.map +1 -1
  226. package/dist/i18n/ru.d.cts +3 -3
  227. package/dist/i18n/ru.d.ts +3 -3
  228. package/dist/i18n/ru.js +349 -0
  229. package/dist/i18n/ru.js.map +1 -1
  230. package/dist/importcss-JLNIRKGH.js +127 -0
  231. package/dist/importcss-JLNIRKGH.js.map +1 -0
  232. package/dist/importword-ZOWLUWSN.js +73 -0
  233. package/dist/importword-ZOWLUWSN.js.map +1 -0
  234. package/dist/{index-C603bU6r.d.ts → index-Pb2r0V-S.d.cts} +39 -17
  235. package/dist/{index-C603bU6r.d.cts → index-Pb2r0V-S.d.ts} +39 -17
  236. package/dist/index.cjs +29422 -10640
  237. package/dist/index.cjs.map +1 -1
  238. package/dist/index.d.cts +139 -64
  239. package/dist/index.d.ts +139 -64
  240. package/dist/index.js +204 -1412
  241. package/dist/index.js.map +1 -1
  242. package/dist/{insertdatetime-CRO7TJAQ.js → insertdatetime-BXQ3XXPH.js} +7 -7
  243. package/dist/insertdatetime-BXQ3XXPH.js.map +1 -0
  244. package/dist/linkchecker-JASSETVI.js +287 -0
  245. package/dist/linkchecker-JASSETVI.js.map +1 -0
  246. package/dist/markdown-OTLTCK26.js +136 -0
  247. package/dist/markdown-OTLTCK26.js.map +1 -0
  248. package/dist/markdown.cjs +94 -11
  249. package/dist/markdown.cjs.map +1 -1
  250. package/dist/markdown.d.cts +12 -10
  251. package/dist/markdown.d.ts +12 -10
  252. package/dist/markdown.js +4 -235
  253. package/dist/markdown.js.map +1 -1
  254. package/dist/math-ui-TY4VZF7Q.js +157 -0
  255. package/dist/math-ui-TY4VZF7Q.js.map +1 -0
  256. package/dist/media-ui-IXN4ENVF.js +123 -0
  257. package/dist/media-ui-IXN4ENVF.js.map +1 -0
  258. package/dist/mediaembed-ui-ODX5ECXC.js +207 -0
  259. package/dist/mediaembed-ui-ODX5ECXC.js.map +1 -0
  260. package/dist/mentions-ui-55GCKC6F.js +58 -0
  261. package/dist/mentions-ui-55GCKC6F.js.map +1 -0
  262. package/dist/mergetags-ui-6T7Z7MAZ.js +73 -0
  263. package/dist/mergetags-ui-6T7Z7MAZ.js.map +1 -0
  264. package/dist/{nonbreaking-66LFZV2W.js → nonbreaking-PONHSOMJ.js} +7 -7
  265. package/dist/nonbreaking-PONHSOMJ.js.map +1 -0
  266. package/dist/pagebreak-ui-AKAW7M5I.js +50 -0
  267. package/dist/pagebreak-ui-AKAW7M5I.js.map +1 -0
  268. package/dist/pageembed-ui-GUNPKMBR.js +172 -0
  269. package/dist/pageembed-ui-GUNPKMBR.js.map +1 -0
  270. package/dist/pagelayout-ui-JSFVEMHS.js +236 -0
  271. package/dist/pagelayout-ui-JSFVEMHS.js.map +1 -0
  272. package/dist/{paste-office-F3QW4WWO.js → paste-office-TORLAZ5L.js} +94 -4
  273. package/dist/paste-office-TORLAZ5L.js.map +1 -0
  274. package/dist/permanentpen-EACURV5U.js +206 -0
  275. package/dist/permanentpen-EACURV5U.js.map +1 -0
  276. package/dist/print-4XJCOANX.js +178 -0
  277. package/dist/print-4XJCOANX.js.map +1 -0
  278. package/dist/{quickbars-7E2QRS7J.js → quickbars-BT5PETRX.js} +20 -12
  279. package/dist/quickbars-BT5PETRX.js.map +1 -0
  280. package/dist/{revisionhistory-DXE7KU4R.js → revisionhistory-3FKLMJHJ.js} +42 -153
  281. package/dist/revisionhistory-3FKLMJHJ.js.map +1 -0
  282. package/dist/save-ZHFXH222.js +120 -0
  283. package/dist/save-ZHFXH222.js.map +1 -0
  284. package/dist/search-bar-6MVRMTK6.js +212 -0
  285. package/dist/search-bar-6MVRMTK6.js.map +1 -0
  286. package/dist/spellchecker-JJKA6B4R.js +474 -0
  287. package/dist/spellchecker-JJKA6B4R.js.map +1 -0
  288. package/dist/suggestions-panel-X37NFLXE.js +596 -0
  289. package/dist/suggestions-panel-X37NFLXE.js.map +1 -0
  290. package/dist/suggestions-ui-WN7QNYHB.js +395 -0
  291. package/dist/suggestions-ui-WN7QNYHB.js.map +1 -0
  292. package/dist/table-PEF56QG5.js +54 -0
  293. package/dist/table-PEF56QG5.js.map +1 -0
  294. package/dist/table-dialogs-QS3VFZD2.js +119 -0
  295. package/dist/table-dialogs-QS3VFZD2.js.map +1 -0
  296. package/dist/tableofcontents-ui-U7EV3UU7.js +167 -0
  297. package/dist/tableofcontents-ui-U7EV3UU7.js.map +1 -0
  298. package/dist/template-ZRTKIP2J.js +278 -0
  299. package/dist/template-ZRTKIP2J.js.map +1 -0
  300. package/dist/typography-S7RO54DB.js +399 -0
  301. package/dist/typography-S7RO54DB.js.map +1 -0
  302. package/dist/upload.cjs +160 -0
  303. package/dist/upload.cjs.map +1 -0
  304. package/dist/upload.d.cts +72 -0
  305. package/dist/upload.d.ts +72 -0
  306. package/dist/upload.js +132 -0
  307. package/dist/upload.js.map +1 -0
  308. package/dist/{visualblocks-6DLBXYOA.js → visualblocks-KJYRHF2L.js} +7 -7
  309. package/dist/visualblocks-KJYRHF2L.js.map +1 -0
  310. package/dist/visualchars-TDLZKFXD.js +134 -0
  311. package/dist/visualchars-TDLZKFXD.js.map +1 -0
  312. package/package.json +53 -3
  313. package/src/style.css +376 -550
  314. package/dist/advlist-5FNKPLUX.js.map +0 -1
  315. package/dist/autolink-45LTODWB.js.map +0 -1
  316. package/dist/autoresize-UB3GOA6D.js.map +0 -1
  317. package/dist/autosave-GMWJ5BPE.js.map +0 -1
  318. package/dist/charmap-2GC7LF7G.js.map +0 -1
  319. package/dist/chunk-5AW2HHG6.js.map +0 -1
  320. package/dist/chunk-DWZLSZDG.js +0 -5664
  321. package/dist/chunk-DWZLSZDG.js.map +0 -1
  322. package/dist/chunk-FCMZ7TUQ.js.map +0 -1
  323. package/dist/chunk-HPLT3XRZ.js.map +0 -1
  324. package/dist/chunk-JPJVTB45.js.map +0 -1
  325. package/dist/chunk-KPE3QRPB.js.map +0 -1
  326. package/dist/chunk-KWXFL4WS.js.map +0 -1
  327. package/dist/chunk-ND2CWNVG.js.map +0 -1
  328. package/dist/chunk-PVFKXRID.js.map +0 -1
  329. package/dist/chunk-R2UMUCVI.js.map +0 -1
  330. package/dist/chunk-T3GY6IVK.js.map +0 -1
  331. package/dist/chunk-Z3ELZ77W.js.map +0 -1
  332. package/dist/comments-panel-HXMWSRAW.js.map +0 -1
  333. package/dist/directionality-5JLWQGP2.js.map +0 -1
  334. package/dist/editor-CXkltf1R.d.ts +0 -1886
  335. package/dist/editor-CgSBFTke.d.cts +0 -1886
  336. package/dist/emoticons-ZD6ZRIWG.js.map +0 -1
  337. package/dist/form-dialog-QH6KAERD.js +0 -180
  338. package/dist/form-dialog-QH6KAERD.js.map +0 -1
  339. package/dist/html-rules-api-D3fKQi-R.d.cts +0 -40
  340. package/dist/html-rules-api-D3fKQi-R.d.ts +0 -40
  341. package/dist/insertdatetime-CRO7TJAQ.js.map +0 -1
  342. package/dist/nonbreaking-66LFZV2W.js.map +0 -1
  343. package/dist/paste-office-F3QW4WWO.js.map +0 -1
  344. package/dist/quickbars-7E2QRS7J.js.map +0 -1
  345. package/dist/revisionhistory-DXE7KU4R.js.map +0 -1
  346. package/dist/table-SSNABG5W.js.map +0 -1
  347. package/dist/visualblocks-6DLBXYOA.js.map +0 -1
package/dist/email.cjs ADDED
@@ -0,0 +1,588 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/email.ts
21
+ var email_exports = {};
22
+ __export(email_exports, {
23
+ EMAIL_CSS: () => EMAIL_CSS,
24
+ editorContentCss: () => editorContentCss,
25
+ emailHTML: () => emailHTML,
26
+ emailSettings: () => emailSettings,
27
+ parseDeclarations: () => parseDeclarations,
28
+ specificity: () => specificity,
29
+ toEmailHTML: () => toEmailHTML
30
+ });
31
+ module.exports = __toCommonJS(email_exports);
32
+
33
+ // src/content-css.ts
34
+ function splitTopLevel(css) {
35
+ const items = [];
36
+ let i = 0;
37
+ let start = 0;
38
+ let depth = 0;
39
+ let prelude = "";
40
+ while (i < css.length) {
41
+ const ch = css[i];
42
+ if (ch === "/" && css[i + 1] === "*") {
43
+ const end = css.indexOf("*/", i + 2);
44
+ const cut = end === -1 ? css.length : end + 2;
45
+ if (depth === 0) {
46
+ css = css.slice(0, i) + css.slice(cut);
47
+ continue;
48
+ }
49
+ i = cut;
50
+ continue;
51
+ }
52
+ if (ch === '"' || ch === "'") {
53
+ i++;
54
+ while (i < css.length && css[i] !== ch) i += css[i] === "\\" ? 2 : 1;
55
+ i++;
56
+ continue;
57
+ }
58
+ if (ch === "{") {
59
+ if (depth === 0) {
60
+ prelude = css.slice(start, i).trim();
61
+ start = i + 1;
62
+ }
63
+ depth++;
64
+ } else if (ch === "}") {
65
+ depth--;
66
+ if (depth === 0) {
67
+ items.push({ prelude, body: css.slice(start, i) });
68
+ start = i + 1;
69
+ }
70
+ if (depth < 0) depth = 0;
71
+ } else if (ch === ";" && depth === 0) {
72
+ const statement = css.slice(start, i).trim();
73
+ if (statement) items.push({ prelude: statement, body: null });
74
+ start = i + 1;
75
+ }
76
+ i++;
77
+ }
78
+ return items;
79
+ }
80
+ function splitSelectors(list) {
81
+ const parts = [];
82
+ let depth = 0;
83
+ let quote = "";
84
+ let start = 0;
85
+ for (let i = 0; i < list.length; i++) {
86
+ const ch = list[i];
87
+ if (quote) {
88
+ if (ch === "\\") i++;
89
+ else if (ch === quote) quote = "";
90
+ } else if (ch === '"' || ch === "'") quote = ch;
91
+ else if (ch === "(" || ch === "[") depth++;
92
+ else if (ch === ")" || ch === "]") depth--;
93
+ else if (ch === "," && depth === 0) {
94
+ parts.push(list.slice(start, i));
95
+ start = i + 1;
96
+ }
97
+ }
98
+ parts.push(list.slice(start));
99
+ return parts.map((s) => s.trim()).filter(Boolean);
100
+ }
101
+ function scopeSelector(selector, scope) {
102
+ let rest = selector;
103
+ let root = false;
104
+ for (; ; ) {
105
+ const m = rest.match(/^(html|body|:root)(?![\w-])\s*/i);
106
+ if (!m) break;
107
+ root = true;
108
+ rest = rest.slice(m[0].length);
109
+ }
110
+ if (!root) return `${scope} ${selector}`;
111
+ if (/^[.#[:]/.test(rest)) {
112
+ const end = rest.search(/[\s>+~]/);
113
+ return end === -1 ? `${scope}${rest}` : `${scope}${rest.slice(0, end)} ${rest.slice(end).trim()}`;
114
+ }
115
+ return rest ? `${scope} ${rest}` : scope;
116
+ }
117
+ function absolutizeUrls(css, base) {
118
+ return css.replace(/url\(\s*(['"]?)([^'")]+)\1\s*\)/gi, (match, quote, url) => {
119
+ if (/^(data:|https?:|\/\/|#)/i.test(url)) return match;
120
+ try {
121
+ return `url(${quote}${new URL(url, base).href}${quote})`;
122
+ } catch {
123
+ return match;
124
+ }
125
+ });
126
+ }
127
+ var IMPORT = /@import\s+(?:url\(\s*)?(['"]?)([^'")\s;]+)\1\s*\)?([^;]*);/gi;
128
+ async function loadCss(url, depth = 0) {
129
+ const base = new URL(url, document.baseURI).href;
130
+ const response = await fetch(base);
131
+ if (!response.ok) throw new Error(`HTTP ${response.status}`);
132
+ let css = absolutizeUrls(await response.text(), base);
133
+ if (depth >= 3) return css.replace(IMPORT, "");
134
+ const imports = [...css.matchAll(IMPORT)];
135
+ for (const m of imports) {
136
+ const media = m[3].trim();
137
+ let inner = "";
138
+ try {
139
+ inner = await loadCss(new URL(m[2], base).href, depth + 1);
140
+ } catch (error) {
141
+ console.warn(`[nova] contentCss: could not load ${m[2]}`, error);
142
+ }
143
+ css = css.replace(m[0], media ? `@media ${media}{${inner}}` : inner);
144
+ }
145
+ return css;
146
+ }
147
+
148
+ // src/url.ts
149
+ var SAFE_LINK_PROTOCOLS = /* @__PURE__ */ new Set(["http:", "https:", "mailto:", "tel:"]);
150
+ var SAFE_IMAGE_PROTOCOLS = /* @__PURE__ */ new Set(["http:", "https:", "blob:"]);
151
+ var SAFE_DATA_IMAGE = /^data:image\/(png|jpe?g|gif|webp|avif|bmp);base64,/i;
152
+ function protocolOf(url) {
153
+ if (typeof url !== "string") return null;
154
+ const cleaned = url.replace(/[\u0000- \u007f-\u009f]/g, "");
155
+ const match = cleaned.match(/^([a-z][a-z0-9+.-]*):/i);
156
+ return match ? `${match[1].toLowerCase()}:` : null;
157
+ }
158
+ function isSafeLinkUrl(url) {
159
+ if (typeof url !== "string") return false;
160
+ const protocol = protocolOf(url);
161
+ return protocol === null || SAFE_LINK_PROTOCOLS.has(protocol);
162
+ }
163
+ function isSafeImageUrl(url) {
164
+ if (typeof url !== "string") return false;
165
+ if (SAFE_DATA_IMAGE.test(url.trim())) return true;
166
+ const protocol = protocolOf(url);
167
+ return protocol === null || SAFE_IMAGE_PROTOCOLS.has(protocol);
168
+ }
169
+
170
+ // src/email.ts
171
+ var EMAIL_CSS = `
172
+ body { font-family: -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif; font-size: 16px; line-height: 1.6; color: #1f2328; }
173
+ p { margin: 0 0 12px; }
174
+ h1, h2, h3, h4, h5, h6 { margin: 20px 0 8px; line-height: 1.25; }
175
+ h1 { font-size: 32px; }
176
+ h2 { font-size: 24px; }
177
+ h3 { font-size: 19px; }
178
+ h4 { font-size: 16px; }
179
+ h5 { font-size: 14px; }
180
+ h6 { font-size: 13px; }
181
+ a { color: #0969da; text-decoration: underline; }
182
+ blockquote { margin: 0 0 12px; padding: 0 0 0 16px; border-left: 3px solid #d0d7de; color: #59636e; }
183
+ pre { margin: 0 0 12px; padding: 12px 14px; border-radius: 6px; background: #f6f8fa; font-family: Menlo, Consolas, 'Courier New', monospace; font-size: 14px; white-space: pre-wrap; }
184
+ code { padding: 1px 4px; border-radius: 4px; background: #f6f8fa; font-family: Menlo, Consolas, 'Courier New', monospace; font-size: 14px; }
185
+ pre code { padding: 0; background: transparent; }
186
+ ul, ol { margin: 0 0 12px; padding-left: 24px; }
187
+ li > p { margin: 0; }
188
+ ul[data-type="taskList"] { padding-left: 0; list-style: none; }
189
+ table { width: 100%; margin: 0 0 12px; border-collapse: collapse; }
190
+ th, td { padding: 6px 8px; border: 1px solid #afb8c1; vertical-align: top; }
191
+ th { background: #f6f8fa; font-weight: 600; }
192
+ td > :last-child, th > :last-child { margin-bottom: 0; }
193
+ img { max-width: 100%; height: auto; border: 0; }
194
+ figure { margin: 12px 0; }
195
+ figure img { display: block; }
196
+ figcaption { padding-top: 6px; color: #59636e; font-size: 14px; text-align: center; }
197
+ hr { margin: 20px 0; border: 0; border-top: 1px solid #d0d7de; }
198
+ [data-type="math-inline"], [data-type="math-block"] { font-family: Menlo, Consolas, 'Courier New', monospace; }
199
+ `;
200
+ function splitDeclarations(body) {
201
+ const parts = [];
202
+ let depth = 0;
203
+ let quote = "";
204
+ let start = 0;
205
+ for (let i = 0; i < body.length; i++) {
206
+ const ch = body[i];
207
+ if (quote) {
208
+ if (ch === "\\") i++;
209
+ else if (ch === quote) quote = "";
210
+ } else if (ch === '"' || ch === "'") quote = ch;
211
+ else if (ch === "(") depth++;
212
+ else if (ch === ")") depth = Math.max(0, depth - 1);
213
+ else if (ch === ";" && depth === 0) {
214
+ parts.push(body.slice(start, i));
215
+ start = i + 1;
216
+ }
217
+ }
218
+ parts.push(body.slice(start));
219
+ return parts;
220
+ }
221
+ var IMPORTANT = /!\s*important\s*$/i;
222
+ function parseDeclarations(body) {
223
+ const out = [];
224
+ for (const part of splitDeclarations(body.replace(/\/\*[\s\S]*?\*\//g, ""))) {
225
+ const colon = part.indexOf(":");
226
+ if (colon < 1) continue;
227
+ const raw = part.slice(0, colon).trim();
228
+ if (!/^(--[\w-]+|-?[a-zA-Z][\w-]*)$/.test(raw)) continue;
229
+ let value = part.slice(colon + 1).trim();
230
+ const important = IMPORTANT.test(value);
231
+ if (important) value = value.replace(IMPORTANT, "").trim();
232
+ if (!value) continue;
233
+ out.push({ name: raw.startsWith("--") ? raw : raw.toLowerCase(), value, important });
234
+ }
235
+ return out;
236
+ }
237
+ var PSEUDO_ELEMENT = /::|:(before|after|first-line|first-letter)\b/i;
238
+ var DYNAMIC = /:(hover|focus|focus-within|focus-visible|active|visited|target|checked|indeterminate|enabled|disabled|placeholder-shown|valid|invalid|in-range|out-of-range|read-only|read-write|autofill|user-valid|user-invalid|open|closed|popover-open|modal|fullscreen|playing|paused)\b/i;
239
+ var pass = (filter, value) => {
240
+ if (filter === void 0) return true;
241
+ if (typeof filter === "function") return !!filter(value);
242
+ if (filter instanceof RegExp) return filter.test(value);
243
+ return value.includes(filter);
244
+ };
245
+ function specificity(selector) {
246
+ let ids = 0;
247
+ let classes = 0;
248
+ let types = 0;
249
+ let rest = selector;
250
+ for (; ; ) {
251
+ const m = /:(where|is|not|has|matches|-webkit-any|-moz-any)\(/i.exec(rest);
252
+ if (!m) break;
253
+ const open = m.index + m[0].length - 1;
254
+ let depth = 0;
255
+ let end = -1;
256
+ for (let i = open; i < rest.length; i++) {
257
+ if (rest[i] === "(") depth++;
258
+ else if (rest[i] === ")" && --depth === 0) {
259
+ end = i;
260
+ break;
261
+ }
262
+ }
263
+ if (end < 0) break;
264
+ if (m[1].toLowerCase() !== "where") {
265
+ const inner = Math.max(0, ...splitSelectors(rest.slice(open + 1, end)).map(specificity));
266
+ ids += Math.floor(inner / 1e6);
267
+ classes += Math.floor(inner / 1e3) % 1e3;
268
+ types += inner % 1e3;
269
+ }
270
+ rest = `${rest.slice(0, m.index)} ${rest.slice(end + 1)}`;
271
+ }
272
+ rest = rest.replace(/\[[^\]]*\]/g, () => (classes++, " ")).replace(/:[\w-]+\([^)]*\)/g, () => (classes++, " ")).replace(/#[\w-]+/g, () => (ids++, " ")).replace(/\.[\w-]+/g, () => (classes++, " ")).replace(/::?[\w-]+/g, (pseudo) => (pseudo.startsWith("::") ? types++ : classes++, " "));
273
+ types += (rest.match(/(?:^|[\s>+~])[a-zA-Z][\w-]*/g) ?? []).length;
274
+ return Math.min(ids, 999) * 1e6 + Math.min(classes, 999) * 1e3 + Math.min(types, 999);
275
+ }
276
+ var ROOT_SCOPE = "nova-email-root";
277
+ var GLOBAL = /^(:root|html|body|\*)$/i;
278
+ var KEPT_AT_RULES = /^@(media|font-face|supports)\b/i;
279
+ function parseRules(css, filter) {
280
+ const rules = [];
281
+ const kept = [];
282
+ const vars = /* @__PURE__ */ new Map();
283
+ let order = 0;
284
+ for (const { prelude, body } of splitTopLevel(css)) {
285
+ if (body === null) continue;
286
+ if (prelude.startsWith("@")) {
287
+ if (KEPT_AT_RULES.test(prelude)) kept.push(`${prelude} {${body}}`);
288
+ continue;
289
+ }
290
+ const declarations = parseDeclarations(body);
291
+ order++;
292
+ for (const selector of splitSelectors(prelude)) {
293
+ if (GLOBAL.test(selector)) {
294
+ for (const d of declarations) if (d.name.startsWith("--")) vars.set(d.name, d.value);
295
+ }
296
+ if (PSEUDO_ELEMENT.test(selector) || DYNAMIC.test(selector) || !pass(filter, selector))
297
+ continue;
298
+ rules.push({
299
+ selector: scopeSelector(selector, ROOT_SCOPE),
300
+ specificity: specificity(selector),
301
+ order,
302
+ declarations: declarations.filter((d) => !d.name.startsWith("--"))
303
+ });
304
+ }
305
+ }
306
+ return { rules, kept, vars };
307
+ }
308
+ function resolveVars(value, vars, depth = 0) {
309
+ const at = value.indexOf("var(");
310
+ if (at < 0) return value;
311
+ if (depth > 8) return null;
312
+ let level = 0;
313
+ let end = -1;
314
+ let comma = -1;
315
+ for (let i = at + 3; i < value.length; i++) {
316
+ const ch = value[i];
317
+ if (ch === "(") level++;
318
+ else if (ch === ")" && --level === 0) {
319
+ end = i;
320
+ break;
321
+ } else if (ch === "," && level === 1 && comma < 0) comma = i;
322
+ }
323
+ if (end < 0) return null;
324
+ const name = value.slice(at + 4, comma > 0 ? comma : end).trim();
325
+ const fallback = comma > 0 ? value.slice(comma + 1, end).trim() : null;
326
+ const found = vars.get(name) ?? fallback;
327
+ if (found === null) return null;
328
+ const inner = resolveVars(found, vars, depth + 1);
329
+ if (inner === null) return null;
330
+ return resolveVars(value.slice(0, at) + inner + value.slice(end + 1), vars, depth + 1);
331
+ }
332
+ function inlineInto(root, css, filter) {
333
+ const { rules, kept, vars } = parseRules(css, filter);
334
+ const matched = /* @__PURE__ */ new Map();
335
+ const doc = root.ownerDocument;
336
+ for (const rule of rules) {
337
+ let hits;
338
+ try {
339
+ hits = [...doc.querySelectorAll(rule.selector)];
340
+ } catch {
341
+ continue;
342
+ }
343
+ for (const el of hits) {
344
+ if (el !== root && !root.contains(el)) continue;
345
+ const list = matched.get(el) ?? [];
346
+ for (const d of rule.declarations) list.push({ d, rule });
347
+ matched.set(el, list);
348
+ }
349
+ }
350
+ const byPrecedence = (a, b) => a.rule.specificity - b.rule.specificity || a.rule.order - b.rule.order;
351
+ for (const el of [root, ...root.querySelectorAll("[style]")]) {
352
+ if (el.hasAttribute("style") && !matched.has(el)) matched.set(el, []);
353
+ }
354
+ for (const [el, list] of matched) {
355
+ const inline = parseDeclarations(el.getAttribute("style") ?? "");
356
+ const sequence = [
357
+ ...list.filter((x) => !x.d.important).sort(byPrecedence).map((x) => x.d),
358
+ ...inline.filter((d) => !d.important),
359
+ ...list.filter((x) => x.d.important).sort(byPrecedence).map((x) => x.d),
360
+ ...inline.filter((d) => d.important)
361
+ ];
362
+ const seen = /* @__PURE__ */ new Set();
363
+ const out = [];
364
+ for (let i = sequence.length - 1; i >= 0; i--) {
365
+ const d = sequence[i];
366
+ if (d.name.startsWith("--") || seen.has(d.name)) continue;
367
+ seen.add(d.name);
368
+ const value = resolveVars(d.value, vars);
369
+ if (value !== null && safeDeclaration(d.name, value)) out.unshift(`${d.name}: ${value}`);
370
+ }
371
+ if (out.length) el.setAttribute("style", out.join("; "));
372
+ else el.removeAttribute("style");
373
+ }
374
+ return { kept };
375
+ }
376
+ var TEMPLATE_TAG = /\{\{|\}\}|\*\||\|\*|%7B%7B/i;
377
+ function absolute(url, base) {
378
+ if (!url || /^(#|mailto:|tel:|sms:|data:|cid:)/i.test(url) || TEMPLATE_TAG.test(url)) return url;
379
+ try {
380
+ return new URL(url, base).href;
381
+ } catch {
382
+ return url;
383
+ }
384
+ }
385
+ function videoPage(src) {
386
+ const youtube = /youtube(?:-nocookie)?\.com\/embed\/([\w-]{6,})/i.exec(src);
387
+ if (youtube) return `https://www.youtube.com/watch?v=${youtube[1]}`;
388
+ const vimeo = /player\.vimeo\.com\/video\/(\d+)/i.exec(src);
389
+ if (vimeo) return `https://vimeo.com/${vimeo[1]}`;
390
+ return src;
391
+ }
392
+ var UNSAFE_ELEMENTS = "script, style, link, meta, base, frame, frameset, object, embed, applet, noscript, template, form, input, button, select, textarea, svg, math";
393
+ var UNSAFE_ATTRIBUTE = /^(on|xmlns|xlink)|^(formaction|action|srcdoc|srcset)$/i;
394
+ function stripUnsafe(root) {
395
+ for (const el of [...root.querySelectorAll(UNSAFE_ELEMENTS)]) el.remove();
396
+ for (const el of [root, ...root.querySelectorAll("*")]) {
397
+ for (const { name } of [...el.attributes]) {
398
+ if (UNSAFE_ATTRIBUTE.test(name)) el.removeAttribute(name);
399
+ }
400
+ }
401
+ }
402
+ var UNSAFE_CSS = /expression\s*\(|javascript:|vbscript:|-moz-binding/i;
403
+ function safeDeclaration(name, value) {
404
+ if (name === "behavior" || name === "-moz-binding" || UNSAFE_CSS.test(value)) return false;
405
+ for (const url of value.matchAll(/url\(\s*(['"]?)([^'")]*)\1\s*\)/gi)) {
406
+ if (!isSafeImageUrl(url[2])) return false;
407
+ }
408
+ return true;
409
+ }
410
+ function emailSafe(root, base) {
411
+ const doc = root.ownerDocument;
412
+ stripUnsafe(root);
413
+ for (const details of [...root.querySelectorAll("details")].reverse()) {
414
+ const block = doc.createElement("div");
415
+ for (const child of [...details.childNodes]) {
416
+ if (child.nodeName === "SUMMARY") {
417
+ const p = doc.createElement("p");
418
+ const strong = doc.createElement("strong");
419
+ strong.append(...child.childNodes);
420
+ p.append(strong);
421
+ block.append(p);
422
+ } else block.append(child);
423
+ }
424
+ details.replaceWith(block);
425
+ }
426
+ for (const item of root.querySelectorAll('li[data-type="taskItem"]')) {
427
+ const mark = item.getAttribute("data-checked") === "true" ? "\u2611" : "\u2610";
428
+ (item.firstElementChild ?? item).prepend(`${mark} `);
429
+ }
430
+ for (const math of root.querySelectorAll('[data-type="math-inline"], [data-type="math-block"]')) {
431
+ const latex = math.getAttribute("data-latex");
432
+ if (latex !== null) math.textContent = latex;
433
+ }
434
+ for (const media of [...root.querySelectorAll("iframe, video, audio")]) {
435
+ const src = media.getAttribute("src") ?? "";
436
+ const href = src ? absolute(videoPage(src), base) : "";
437
+ if (!href || !isSafeLinkUrl(href)) {
438
+ media.remove();
439
+ continue;
440
+ }
441
+ const link = doc.createElement("a");
442
+ link.setAttribute("href", href);
443
+ link.textContent = media.getAttribute("title") || href;
444
+ const parent = media.parentElement;
445
+ const target = parent && parent !== root && parent.tagName === "DIV" && parent.children.length === 1 ? parent : media;
446
+ if (target.parentElement?.closest("p, li, td, th, figcaption")) target.replaceWith(link);
447
+ else {
448
+ const p = doc.createElement("p");
449
+ p.append(link);
450
+ target.replaceWith(p);
451
+ }
452
+ }
453
+ for (const pagebreak of root.querySelectorAll(".nova-pagebreak")) pagebreak.remove();
454
+ for (const link of root.querySelectorAll("a[href]")) {
455
+ const href = absolute(link.getAttribute("href"), base);
456
+ if (isSafeLinkUrl(href)) link.setAttribute("href", href);
457
+ else link.removeAttribute("href");
458
+ }
459
+ for (const el of root.querySelectorAll("[background]")) {
460
+ const image = absolute(el.getAttribute("background"), base);
461
+ if (isSafeImageUrl(image)) el.setAttribute("background", image);
462
+ else el.removeAttribute("background");
463
+ }
464
+ for (const img of [...root.querySelectorAll("img")]) {
465
+ const src = absolute(img.getAttribute("src") ?? "", base);
466
+ if (!src || !(isSafeImageUrl(src) || /^cid:[^\s"'<>]+$/i.test(src))) {
467
+ img.remove();
468
+ continue;
469
+ }
470
+ img.setAttribute("src", src);
471
+ if (!img.hasAttribute("width")) {
472
+ const width = /(?:^|;)\s*width\s*:\s*(\d+(?:\.\d+)?)px/i.exec(
473
+ img.getAttribute("style") ?? ""
474
+ );
475
+ if (width) img.setAttribute("width", String(Math.round(Number(width[1]))));
476
+ }
477
+ }
478
+ }
479
+ var escapeHTML = (text) => text.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;");
480
+ var color = (value, fallback) => typeof value === "string" && /^[#\w(),.%\s-]{1,64}$/.test(value.trim()) ? value.trim() : fallback;
481
+ function emailDocument(content, rootStyle, kept, options) {
482
+ const width = Math.min(Math.max(Math.round(Number(options.width) || 600), 280), 1200);
483
+ const background = color(options.background, "#ffffff");
484
+ const contentBackground = color(options.contentBackground, "#ffffff");
485
+ const lang = typeof options.lang === "string" && /^[\w-]{1,20}$/.test(options.lang) ? options.lang : "en";
486
+ const dir = options.dir === "rtl" ? "rtl" : "ltr";
487
+ const title = escapeHTML(String(options.title ?? ""));
488
+ const preheader = options.preheader ? `<div style="display: none; max-height: 0; overflow: hidden; mso-hide: all;">${escapeHTML(String(options.preheader))}</div>
489
+ ` : "";
490
+ const head = kept.join("\n").replace(/<\/style/gi, "<\\/style");
491
+ const cell = ["padding: 24px", rootStyle].filter(Boolean).join("; ");
492
+ return `<!DOCTYPE html>
493
+ <html lang="${lang}" dir="${dir}">
494
+ <head>
495
+ <meta charset="utf-8">
496
+ <meta name="viewport" content="width=device-width, initial-scale=1">
497
+ <meta name="x-apple-disable-message-reformatting">
498
+ <meta name="color-scheme" content="light">
499
+ <meta name="supported-color-schemes" content="light">
500
+ <title>${title}</title>
501
+ <style>
502
+ body { margin: 0; padding: 0; -webkit-text-size-adjust: 100%; -ms-text-size-adjust: 100%; }
503
+ img { -ms-interpolation-mode: bicubic; }
504
+ ${head}
505
+ </style>
506
+ </head>
507
+ <body style="margin: 0; padding: 0; background-color: ${background};">
508
+ ${preheader}<table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0" style="background-color: ${background};">
509
+ <tr><td align="center" style="padding: 24px 12px;">
510
+ <table role="presentation" width="${width}" cellpadding="0" cellspacing="0" border="0" style="width: 100%; max-width: ${width}px; background-color: ${contentBackground};">
511
+ <tr><td dir="${dir}" style="${escapeHTML(cell)}">
512
+ ${content}
513
+ </td></tr>
514
+ </table>
515
+ </td></tr>
516
+ </table>
517
+ </body>
518
+ </html>
519
+ `;
520
+ }
521
+ function toEmailHTML(html, options = {}) {
522
+ const doc = new DOMParser().parseFromString(html, "text/html");
523
+ const root = doc.createElement(ROOT_SCOPE);
524
+ root.append(...doc.body.childNodes);
525
+ doc.body.append(root);
526
+ const base = options.baseUrl ?? (typeof document === "undefined" ? doc.baseURI : document.baseURI);
527
+ emailSafe(root, base);
528
+ const baseCss = options.baseStyles === false ? "" : `${EMAIL_CSS}th { text-align: ${options.dir === "rtl" ? "right" : "left"}; }
529
+ `;
530
+ const css = [baseCss, options.contentCss ?? "", options.css ?? ""].join("\n");
531
+ const { kept } = inlineInto(root, css, options.selectorFilter);
532
+ const rootStyle = root.getAttribute("style") ?? "";
533
+ if (options.document) {
534
+ const settings = typeof options.document === "object" ? options.document : {};
535
+ return emailDocument(root.innerHTML, rootStyle, kept, {
536
+ ...settings,
537
+ dir: settings.dir ?? options.dir
538
+ });
539
+ }
540
+ if (!rootStyle && options.dir !== "rtl") return root.innerHTML;
541
+ const wrapper = doc.createElement("div");
542
+ if (options.dir === "rtl") wrapper.setAttribute("dir", "rtl");
543
+ if (rootStyle) wrapper.setAttribute("style", rootStyle);
544
+ wrapper.append(...root.childNodes);
545
+ return wrapper.outerHTML;
546
+ }
547
+ async function editorContentCss(editor, fileFilter) {
548
+ const { contentCss, contentStyle } = editor.options;
549
+ const files = contentCss === void 0 ? [] : Array.isArray(contentCss) ? contentCss : [contentCss];
550
+ const sheets = await Promise.all(
551
+ files.filter((url) => pass(fileFilter, new URL(url, document.baseURI).href)).map(
552
+ (url) => loadCss(url).catch((error) => {
553
+ console.warn(`[nova] email: could not load ${url}`, error);
554
+ return "";
555
+ })
556
+ )
557
+ );
558
+ return [...sheets, contentStyle ?? ""].join("\n");
559
+ }
560
+ function emailSettings(editor, options = {}) {
561
+ const settings = {
562
+ ...editor.options.pluginOptions?.email ?? {},
563
+ ...options
564
+ };
565
+ const { language, direction } = editor.options;
566
+ const document2 = settings.document && {
567
+ lang: language,
568
+ dir: direction,
569
+ ...typeof settings.document === "object" ? settings.document : {}
570
+ };
571
+ return { ...settings, document: document2 || false, ...direction ? { dir: direction } : {} };
572
+ }
573
+ async function emailHTML(editor, options = {}) {
574
+ const settings = emailSettings(editor, options);
575
+ const contentCss = await editorContentCss(editor, settings.fileFilter);
576
+ return toEmailHTML(editor.getHTML({ fullPage: false }), { ...settings, contentCss });
577
+ }
578
+ // Annotate the CommonJS export names for ESM import in node:
579
+ 0 && (module.exports = {
580
+ EMAIL_CSS,
581
+ editorContentCss,
582
+ emailHTML,
583
+ emailSettings,
584
+ parseDeclarations,
585
+ specificity,
586
+ toEmailHTML
587
+ });
588
+ //# sourceMappingURL=email.cjs.map